refactor: reorganize imports and update type references across services

- Updated import paths for types and utilities in config-service, menu-service, script-execution-service, script-store-service, and window-service to reflect new structure.
- Moved utility functions like debounce and cloneDeep to shared utilities.
- Created new runtime and script types files to centralize type definitions.
- Removed deprecated task-types and locale messages files.
- Updated constants to use shared definitions and added new placeholders for providers.
- Enhanced provider type information with additional placeholders for different languages.
This commit is contained in:
duanshuwen
2026-04-21 23:25:51 +08:00
parent 97a956ffe8
commit 721344883f
24 changed files with 181 additions and 670 deletions

View File

@@ -2,9 +2,13 @@ import {
DEFAULT_AGENT_ID,
DEFAULT_CHANNEL_ACCOUNT_ID,
DEFAULT_MAIN_SESSION_SUFFIX,
buildAgentSessionKey,
buildMainSessionKey,
buildChannelAccountOwnerKey,
normalizeAgentId,
normalizeChannelAccountId,
normalizeChannelType,
normalizeSessionSuffix,
parseChannelAccountOwnerKey,
resolveChannelAccountOwner,
type AgentSummary,
@@ -29,27 +33,6 @@ export interface ParsedSessionKey {
isAgentSession: boolean;
}
export function normalizeAgentId(value: string | null | undefined): string {
const normalized = String(value ?? '').trim().toLowerCase();
return normalized || DEFAULT_AGENT_ID;
}
export function normalizeSessionSuffix(value: string | null | undefined): string {
const normalized = String(value ?? '').trim().toLowerCase();
return normalized || DEFAULT_MAIN_SESSION_SUFFIX;
}
export function buildAgentSessionKey(agentId: string, sessionId: string): string {
return `agent:${normalizeAgentId(agentId)}:${normalizeSessionSuffix(sessionId)}`;
}
export function buildMainSessionKey(
agentId: string,
sessionId = DEFAULT_MAIN_SESSION_SUFFIX,
): string {
return buildAgentSessionKey(agentId, sessionId);
}
export function parseSessionKey(sessionKey: string): ParsedSessionKey {
const trimmed = String(sessionKey ?? '').trim();
@@ -97,9 +80,13 @@ export {
DEFAULT_AGENT_ID,
DEFAULT_CHANNEL_ACCOUNT_ID,
DEFAULT_MAIN_SESSION_SUFFIX,
buildAgentSessionKey,
buildMainSessionKey,
buildChannelAccountOwnerKey,
normalizeAgentId,
normalizeChannelAccountId,
normalizeChannelType,
normalizeSessionSuffix,
parseChannelAccountOwnerKey,
resolveChannelAccountOwner,
};