@tutti-os/agent-gui 0.0.229 → 0.0.231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-gui.js +5 -3
- package/dist/{chunk-ZVSKNM6D.js → chunk-5IFWKS7A.js} +71 -49
- package/dist/chunk-5IFWKS7A.js.map +1 -0
- package/dist/{chunk-P2OOYHKQ.js → chunk-7AYFKNLD.js} +6 -4
- package/dist/{chunk-P2OOYHKQ.js.map → chunk-7AYFKNLD.js.map} +1 -1
- package/dist/{chunk-2QF3RBR4.js → chunk-JA6XAKKE.js} +2 -60
- package/dist/chunk-JA6XAKKE.js.map +1 -0
- package/dist/chunk-T57ZZWTC.js +65 -0
- package/dist/chunk-T57ZZWTC.js.map +1 -0
- package/dist/chunk-ZBI6R46N.js +79 -0
- package/dist/chunk-ZBI6R46N.js.map +1 -0
- package/dist/conversation-rail-projection.d.ts +44 -0
- package/dist/conversation-rail-projection.js +14 -0
- package/dist/conversation-rail-projection.js.map +1 -0
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/workbench/contribution.js +3 -2
- package/dist/workbench/index.js +3 -2
- package/dist/workbench/sessionTitle.js +2 -1
- package/package.json +23 -16
- package/dist/chunk-2QF3RBR4.js.map +0 -1
- package/dist/chunk-ZVSKNM6D.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../contexts/settings/domain/agentSettings.providers.ts","../contexts/settings/domain/agentSettings.providerMeta.ts","../shared/agentConversationTitleProjection.ts"],"sourcesContent":["export const AGENT_PROVIDERS = [\n \"claude-code\",\n \"codex\",\n \"cursor\",\n \"tutti-agent\",\n \"nexight\",\n \"opencode\",\n \"openclaw\"\n] as const;\nexport const EXPERIMENTAL_AGENT_PROVIDERS = [] as const;\n\nexport type AgentProvider = (typeof AGENT_PROVIDERS)[number];\n\nexport function isValidProvider(value: unknown): value is AgentProvider {\n return (\n typeof value === \"string\" &&\n AGENT_PROVIDERS.includes(value as AgentProvider)\n );\n}\n\nexport function normalizeAgentProviderOrder(value: unknown): AgentProvider[] {\n if (!Array.isArray(value)) {\n return [...AGENT_PROVIDERS];\n }\n\n const normalized: AgentProvider[] = [];\n const seen = new Set<AgentProvider>();\n\n for (const item of value) {\n if (!isValidProvider(item)) {\n continue;\n }\n\n if (seen.has(item)) {\n continue;\n }\n\n seen.add(item);\n normalized.push(item);\n }\n\n for (const provider of AGENT_PROVIDERS) {\n if (seen.has(provider)) {\n continue;\n }\n\n seen.add(provider);\n normalized.push(provider);\n }\n\n return normalized;\n}\n","import { resolveAgentGUIProviderCatalogIdentity } from \"../../../providerIdentityCatalog.ts\";\nimport {\n AGENT_PROVIDERS,\n type AgentProvider\n} from \"./agentSettings.providers.ts\";\n\nexport const AGENT_PROVIDER_LABEL = Object.fromEntries(\n AGENT_PROVIDERS.map((provider) => {\n const identity = resolveAgentGUIProviderCatalogIdentity(provider);\n if (!identity) {\n throw new Error(`Missing provider identity for ${provider}`);\n }\n return [provider, identity.displayName];\n })\n) as Record<AgentProvider, string>;\n\nexport interface AgentProviderCapabilities {\n runtimeObservation: \"jsonl\" | \"provider-api\" | \"none\";\n experimental: boolean;\n}\n\nexport const AGENT_PROVIDER_CAPABILITIES: Record<\n AgentProvider,\n AgentProviderCapabilities\n> = {\n \"claude-code\": {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n codex: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n \"tutti-agent\": {\n runtimeObservation: \"provider-api\",\n experimental: false\n },\n cursor: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n nexight: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n opencode: {\n runtimeObservation: \"provider-api\",\n experimental: false\n },\n openclaw: {\n runtimeObservation: \"jsonl\",\n experimental: false\n }\n};\n","import { AGENT_PROVIDER_LABEL } from \"../contexts/settings/domain/agentSettings.providerMeta.ts\";\nimport {\n isPendingActivationViable,\n type PendingActivationStatus,\n type AgentActivityMessage,\n type AgentPromptContentBlock\n} from \"@tutti-os/agent-activity-core\";\nimport {\n extractRichTextLinksFromContent,\n extractRichTextMentionsFromContent,\n removeRichTextMentionFromContent\n} from \"@tutti-os/ui-rich-text/core\";\nimport { translateInUiLanguage } from \"../i18n/runtime.ts\";\nimport { resolveAgentGUIProviderCatalogIdentity } from \"../providerIdentityCatalog.ts\";\nimport type { AgentGUIProvider } from \"../types.ts\";\nimport type { WorkspaceAgentActivityTimelineItem } from \"./workspaceAgentTimelineTypes.ts\";\nimport { normalizeAgentTitleText } from \"./utils/agentTitleText.ts\";\n\nexport type AgentGUIResolvedProvider = AgentGUIProvider | \"unknown\";\nexport type AgentGUIConversationTitleFallback = \"untitled-conversation\" | null;\nexport type AgentGUIConversationTitleLeadingMentionKind =\n | \"agent\"\n | \"app\"\n | \"file\"\n | \"session\"\n | \"task\";\n\nconst AGENT_GUI_UNRESOLVED_PROVIDER: AgentGUIResolvedProvider = \"unknown\";\nconst AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS = 120;\nconst AGENT_GUI_TRUNCATED_TITLE_SUFFIX = \"...\";\n\nexport function isAgentGUIProviderUnresolved(\n value: AgentGUIResolvedProvider\n): value is \"unknown\" {\n return value === AGENT_GUI_UNRESOLVED_PROVIDER;\n}\n\nexport interface AgentGUIConversationTitleMessage {\n id?: number | string | null;\n messageId?: string | null;\n version?: number | null;\n role?: string | null;\n kind?: string | null;\n payload?: {\n content?: unknown;\n displayPrompt?: unknown;\n text?: unknown;\n } | null;\n occurredAtUnixMs?: number | null;\n completedAtUnixMs?: number | null;\n startedAtUnixMs?: number | null;\n}\n\nexport function normalizeAgentGUIProviderIdentity(\n provider: string | null | undefined\n): AgentGUIResolvedProvider {\n const normalized = provider?.trim().toLowerCase() ?? \"\";\n const catalogIdentity = resolveAgentGUIProviderCatalogIdentity(normalized);\n if (catalogIdentity) {\n return catalogIdentity.providerId as AgentGUIProvider;\n }\n if (!/^[a-z][a-z0-9._:-]{0,127}$/.test(normalized)) {\n return \"unknown\";\n }\n return normalized as AgentGUIProvider;\n}\n\nfunction providerLabel(provider: AgentGUIProvider): string {\n return (AGENT_PROVIDER_LABEL as Record<string, string>)[provider] ?? provider;\n}\n\nexport function resolveAgentGUIProviderIdentity(input: {\n sessionProvider?: string | null;\n workspaceSessionProvider?: string | null;\n conversationProvider?: string | null;\n timelineItems?: readonly WorkspaceAgentActivityTimelineItem[];\n}): AgentGUIResolvedProvider {\n const candidates = [\n input.sessionProvider,\n input.workspaceSessionProvider,\n input.conversationProvider,\n timelineProviderHint(input.timelineItems ?? [])\n ];\n for (const candidate of candidates) {\n const normalized = normalizeAgentGUIProviderIdentity(candidate);\n if (normalized !== \"unknown\") {\n return normalized;\n }\n }\n return \"unknown\";\n}\n\nexport function resolveAgentGUIConversationTitle(\n title: string | null | undefined\n): {\n title: string;\n titleFallback: AgentGUIConversationTitleFallback;\n} {\n const normalizedTitle = stripAgentGUITitleTrailingPeriod(title?.trim() ?? \"\");\n if (normalizedTitle) {\n return {\n title: normalizedTitle,\n titleFallback: null\n };\n }\n return {\n title: \"\",\n titleFallback: \"untitled-conversation\"\n };\n}\n\nexport function deriveAgentGUIOptimisticConversationTitle(\n visiblePrompt: string | null | undefined\n): string {\n const normalizedTitle = normalizeAgentTitleText(visiblePrompt);\n const codePoints = Array.from(normalizedTitle);\n if (codePoints.length <= AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS) {\n return normalizedTitle;\n }\n return `${codePoints\n .slice(\n 0,\n AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS -\n AGENT_GUI_TRUNCATED_TITLE_SUFFIX.length\n )\n .join(\"\")\n .trimEnd()}${AGENT_GUI_TRUNCATED_TITLE_SUFFIX}`;\n}\n\nexport function resolveAgentGUIConversationTitleDisplayPrompt(input: {\n activation?: {\n content: readonly AgentPromptContentBlock[];\n displayPrompt?: string;\n mode: \"existing\" | \"new\";\n status: PendingActivationStatus;\n } | null;\n allowEmptyTitle?: boolean;\n firstUserDisplayPrompt?: string | null;\n messages?: readonly AgentActivityMessage[];\n title: string | null;\n}): string | null {\n const prompt = resolveAgentGUIConversationTitlePrompt(input);\n if (\n !prompt ||\n (extractRichTextMentionsFromContent(prompt).length === 0 &&\n extractRichTextLinksFromContent(prompt).length === 0) ||\n !agentGUITitleMatchesDerivedPrompt(\n input.title,\n prompt,\n input.allowEmptyTitle\n )\n ) {\n return null;\n }\n // Titles are presentation text, not an interactive rich-text surface. Keep\n // the mention label but discard its Markdown href before handing it to the\n // header/rail consumers so mention SVGs cannot leak into the chrome.\n return normalizeAgentTitleText(prompt);\n}\n\nexport function resolveAgentGUIConversationBrowserFreeTitle(input: {\n activation?: {\n content: readonly AgentPromptContentBlock[];\n displayPrompt?: string;\n mode: \"existing\" | \"new\";\n status: PendingActivationStatus;\n } | null;\n allowEmptyTitle?: boolean;\n firstUserDisplayPrompt?: string | null;\n messages?: readonly AgentActivityMessage[];\n title: string | null;\n}): string | null {\n const prompt = resolveAgentGUIConversationTitlePrompt(input);\n if (\n !prompt ||\n !agentGUITitleMatchesDerivedPrompt(\n input.title,\n prompt,\n input.allowEmptyTitle\n )\n ) {\n return input.title;\n }\n const presentationPrompt = removeAgentGUIBrowserElementMentions(prompt);\n return presentationPrompt === prompt\n ? input.title\n : deriveAgentGUIOptimisticConversationTitle(presentationPrompt);\n}\n\nexport function resolveAgentGUIConversationTitleLeadingMentionKind(\n _displayPrompt: string | null | undefined\n): AgentGUIConversationTitleLeadingMentionKind | null {\n return null;\n}\n\nfunction resolveAgentGUIConversationTitlePrompt(input: {\n activation?: {\n content: readonly AgentPromptContentBlock[];\n displayPrompt?: string;\n mode: \"existing\" | \"new\";\n status: PendingActivationStatus;\n } | null;\n firstUserDisplayPrompt?: string | null;\n messages?: readonly AgentActivityMessage[];\n}): string {\n const activationPrompt =\n input.activation?.mode === \"new\" &&\n isPendingActivationViable(input.activation)\n ? agentGUIActivationPromptText(\n input.activation.content,\n input.activation.displayPrompt ?? null\n )\n : \"\";\n return (\n activationPrompt ||\n input.firstUserDisplayPrompt?.trim() ||\n resolveAgentGUIFirstUserMessageDisplayPrompt(input.messages ?? [])\n );\n}\n\nfunction removeAgentGUIBrowserElementMentions(prompt: string): string {\n return extractRichTextMentionsFromContent(prompt)\n .filter((mention) => mention.providerId === \"browser-element\")\n .reduce(\n (content, mention) => removeRichTextMentionFromContent(content, mention),\n prompt\n );\n}\n\nexport function resolveAgentGUIFirstUserMessageDisplayPrompt(\n messages: readonly AgentActivityMessage[]\n): string {\n const message = messages.find(\n (candidate) =>\n candidate.role.trim().toLowerCase() === \"user\" &&\n candidate.kind.trim().toLowerCase() === \"text\"\n );\n if (!message) {\n return \"\";\n }\n return (\n agentGUIStringValue(message.payload.displayPrompt) ||\n agentGUIPromptTextFromUnknownContent(message.payload.content) ||\n agentGUIStringValue(message.payload.text) ||\n agentGUIStringValue(message.payload.content)\n );\n}\n\nfunction agentGUIPromptTextFromUnknownContent(content: unknown): string {\n if (!Array.isArray(content)) {\n return \"\";\n }\n return content\n .flatMap((value) => {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return [];\n }\n const block = value as Record<string, unknown>;\n return block.type === \"text\" && typeof block.text === \"string\"\n ? [block.text.trim()]\n : [];\n })\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nfunction agentGUIActivationPromptText(\n content: readonly AgentPromptContentBlock[],\n displayPrompt: string | null\n): string {\n const display = displayPrompt?.trim() ?? \"\";\n if (display) {\n return display;\n }\n return content\n .filter((block) => block.type === \"text\")\n .map((block) => block.text?.trim() ?? \"\")\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nfunction agentGUITitleMatchesDerivedPrompt(\n title: string | null,\n prompt: string,\n allowEmptyTitle = false\n): boolean {\n const canonicalTitle = title?.trim() ?? \"\";\n if (!canonicalTitle) {\n return allowEmptyTitle;\n }\n const derivedTitle = normalizeAgentTitleText(prompt);\n if (canonicalTitle === derivedTitle) {\n return true;\n }\n const runes = Array.from(derivedTitle);\n const truncatedDerivedTitle =\n runes.length > AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS\n ? `${runes\n .slice(\n 0,\n AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS -\n AGENT_GUI_TRUNCATED_TITLE_SUFFIX.length\n )\n .join(\"\")\n .trim()}${AGENT_GUI_TRUNCATED_TITLE_SUFFIX}`\n : derivedTitle;\n return canonicalTitle === truncatedDerivedTitle;\n}\n\nfunction agentGUIStringValue(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\nexport function resolveAgentGUIConversationDisplayTitle(\n input: {\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n },\n untitledConversationLabel: string\n): string {\n if (input.title) {\n return stripAgentGUITitleTrailingPeriod(input.title.trim());\n }\n if (input.titleFallback === \"untitled-conversation\") {\n return stripAgentGUITitleTrailingPeriod(untitledConversationLabel);\n }\n return \"\";\n}\n\nexport function resolveAgentGUIDockConversationTitle(input: {\n provider: AgentGUIResolvedProvider;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n}): string | null {\n return resolveAgentGUIExplicitConversationTitle(input);\n}\n\nexport function resolveAgentGUIExplicitConversationTitle(input: {\n provider: AgentGUIResolvedProvider;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n}): string | null {\n if (input.titleFallback) {\n return null;\n }\n\n const title = stripAgentGUITitleTrailingPeriod(input.title.trim());\n if (!title) {\n return null;\n }\n if (isAgentGUIUntitledTaskTitle(title)) {\n return null;\n }\n\n if (input.provider !== \"unknown\" && title === providerLabel(input.provider)) {\n return null;\n }\n\n return title;\n}\n\nexport function resolveAgentGUIExplicitConversationTitleFromMessages(input: {\n messages: readonly AgentGUIConversationTitleMessage[];\n provider: AgentGUIResolvedProvider;\n title: string | null | undefined;\n}): string | null {\n const explicitTitle = resolveAgentGUIExplicitConversationTitle({\n provider: input.provider,\n title: input.title?.trim() ?? \"\"\n });\n if (explicitTitle) {\n return explicitTitle;\n }\n return resolveAgentGUIExplicitConversationTitle({\n provider: input.provider,\n title: firstAgentGUIUserMessageTitle(input.messages)\n });\n}\n\nexport function resolveAgentGUIProviderDisplayLabel(\n provider: string | null | undefined,\n fallbackAgentLabel: string\n): string {\n const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);\n if (resolvedProvider === \"unknown\") {\n return fallbackAgentLabel;\n }\n return providerLabel(resolvedProvider);\n}\n\nexport function firstAgentGUIUserMessageTitle(\n messages: readonly AgentGUIConversationTitleMessage[]\n): string {\n const userMessage = [...messages]\n .filter(\n (message) =>\n messageRole(message) === \"user\" && messageText(message).length > 0\n )\n .sort(compareMessagesAscending)[0];\n return userMessage ? messageText(userMessage) : \"\";\n}\n\nfunction messageRole(\n message: AgentGUIConversationTitleMessage\n): \"user\" | \"agent\" | null {\n const role = message.role?.trim().toLowerCase();\n if (role === \"user\") {\n return \"user\";\n }\n if (role === \"assistant\" || role === \"agent\") {\n return \"agent\";\n }\n const kind = message.kind?.trim().toLowerCase() ?? \"\";\n if (kind === \"message.user\") {\n return \"user\";\n }\n if (kind === \"message.assistant\" || kind === \"message.agent\") {\n return \"agent\";\n }\n return null;\n}\n\nfunction messageText(message: AgentGUIConversationTitleMessage): string {\n const payload = message.payload;\n const displayPrompt =\n typeof payload?.displayPrompt === \"string\" ? payload.displayPrompt : \"\";\n const text = typeof payload?.text === \"string\" ? payload.text : \"\";\n const content = typeof payload?.content === \"string\" ? payload.content : \"\";\n return normalizeAgentTitleText(displayPrompt || text || content);\n}\n\nfunction compareMessagesAscending(\n left: AgentGUIConversationTitleMessage,\n right: AgentGUIConversationTitleMessage\n): number {\n const leftTime =\n left.occurredAtUnixMs ??\n left.completedAtUnixMs ??\n left.startedAtUnixMs ??\n 0;\n const rightTime =\n right.occurredAtUnixMs ??\n right.completedAtUnixMs ??\n right.startedAtUnixMs ??\n 0;\n const timeDiff = leftTime - rightTime;\n if (timeDiff !== 0) {\n return timeDiff;\n }\n const sequenceDiff =\n messageSequence(left) - messageSequence(right) ||\n (left.messageId ?? \"\").localeCompare(right.messageId ?? \"\");\n return sequenceDiff;\n}\n\nfunction messageSequence(message: AgentGUIConversationTitleMessage): number {\n const numericId =\n typeof message.id === \"number\" && Number.isFinite(message.id)\n ? message.id\n : 0;\n return message.version ?? numericId;\n}\n\nfunction stripAgentGUITitleTrailingPeriod(title: string): string {\n return title\n .trimEnd()\n .replace(/[.。]+$/u, \"\")\n .trimEnd();\n}\n\nfunction isAgentGUIUntitledTaskTitle(title: string): boolean {\n return localizedAgentGUIUntitledTaskLabels().has(compactTitleText(title));\n}\n\nfunction localizedAgentGUIUntitledTaskLabels(): Set<string> {\n return new Set(\n ([\"en\", \"zh-CN\"] as const)\n .map((language) =>\n compactTitleText(\n translateInUiLanguage(\n language,\n \"agentHost.workspaceAgentsUntitledConversation\"\n )\n )\n )\n .filter(Boolean)\n );\n}\n\nfunction timelineProviderHint(\n timelineItems: readonly WorkspaceAgentActivityTimelineItem[]\n): string | null {\n for (const item of timelineItems) {\n if (isUserTimelineItem(item)) {\n continue;\n }\n const normalized = normalizeAgentGUIProviderIdentity(item.actorId);\n if (normalized !== \"unknown\") {\n return normalized;\n }\n }\n return null;\n}\n\nfunction isUserTimelineItem(item: WorkspaceAgentActivityTimelineItem): boolean {\n const role = item.role?.trim().toLowerCase();\n if (role === \"user\") {\n return true;\n }\n const actorType = item.actorType.trim().toLowerCase();\n if (actorType === \"user\") {\n return true;\n }\n return item.itemType.trim().toLowerCase() === \"message.user\";\n}\n\nfunction compactTitleText(value: string): string {\n return value.trim().replace(/\\s+/g, \" \");\n}\n"],"mappings":";;;;;;;;;;;AAAO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACFO,IAAM,uBAAuB,OAAO;AAAA,EACzC,gBAAgB,IAAI,CAAC,aAAa;AAChC,UAAM,WAAW,uCAAuC,QAAQ;AAChE,QAA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,UACE;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF,EACC,OAAO,OAAO;AAAA,EACnB;AACF;AAEA,SAAS,qBACP,eACe;AACf,aAAW,QAAQ,eAAe;AAChC,QAAI,mBAAmB,IAAI,GAAG;AAC5B;AAAA,IACF;AACA,UAAM,aAAa,kCAAkC,KAAK,OAAO;AACjE,QAAI,eAAe,WAAW;AAC5B,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,mBAAmB,MAAmD;AAC7E,QAAM,OAAO,KAAK,MAAM,KAAK,EAAE,YAAY;AAC3C,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,EACT;AACA,QAAM,YAAY,KAAK,UAAU,KAAK,EAAE,YAAY;AACpD,MAAI,cAAc,QAAQ;AACxB,WAAO;AAAA,EACT;AACA,SAAO,KAAK,SAAS,KAAK,EAAE,YAAY,MAAM;AAChD;AAEA,SAAS,iBAAiB,OAAuB;AAC/C,SAAO,MAAM,KAAK,EAAE,QAAQ,QAAQ,GAAG;AACzC;","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveAgentGUIProviderDisplayLabel
|
|
3
|
+
} from "./chunk-JA6XAKKE.js";
|
|
4
|
+
|
|
5
|
+
// workbench/sessionTitle.ts
|
|
6
|
+
function resolveAgentGuiWorkbenchHeaderTitle({
|
|
7
|
+
agentName,
|
|
8
|
+
conversationTitle,
|
|
9
|
+
provider
|
|
10
|
+
}) {
|
|
11
|
+
return stripTitle(agentName) || stripTitle(resolveAgentGUIProviderDisplayLabel(provider, "")) || stripTitle(conversationTitle) || null;
|
|
12
|
+
}
|
|
13
|
+
function resolveAgentGuiWorkbenchSessionTitle({
|
|
14
|
+
agentSessionId,
|
|
15
|
+
fallbackTitle,
|
|
16
|
+
optimisticTitle,
|
|
17
|
+
session = null
|
|
18
|
+
}) {
|
|
19
|
+
const normalizedAgentSessionId = agentSessionId?.trim() ?? "";
|
|
20
|
+
if (!normalizedAgentSessionId) {
|
|
21
|
+
return { agentSessionId: null, source: "none", title: null };
|
|
22
|
+
}
|
|
23
|
+
const snapshotTitle = stripTitle(session?.title);
|
|
24
|
+
if (snapshotTitle) {
|
|
25
|
+
return {
|
|
26
|
+
agentSessionId: normalizedAgentSessionId,
|
|
27
|
+
source: "snapshot",
|
|
28
|
+
title: snapshotTitle
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const projectedOptimisticTitle = stripTitle(optimisticTitle);
|
|
32
|
+
if (projectedOptimisticTitle) {
|
|
33
|
+
return {
|
|
34
|
+
agentSessionId: normalizedAgentSessionId,
|
|
35
|
+
source: "optimistic",
|
|
36
|
+
title: projectedOptimisticTitle
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (session) {
|
|
40
|
+
return {
|
|
41
|
+
agentSessionId: normalizedAgentSessionId,
|
|
42
|
+
source: "none",
|
|
43
|
+
title: null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const fallbackDisplayTitle = stripTitle(fallbackTitle);
|
|
47
|
+
return fallbackDisplayTitle ? {
|
|
48
|
+
agentSessionId: normalizedAgentSessionId,
|
|
49
|
+
source: "fallback",
|
|
50
|
+
title: fallbackDisplayTitle
|
|
51
|
+
} : {
|
|
52
|
+
agentSessionId: normalizedAgentSessionId,
|
|
53
|
+
source: "none",
|
|
54
|
+
title: null
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function stripTitle(value) {
|
|
58
|
+
return value?.trim() ?? "";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
resolveAgentGuiWorkbenchHeaderTitle,
|
|
63
|
+
resolveAgentGuiWorkbenchSessionTitle
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=chunk-T57ZZWTC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../workbench/sessionTitle.ts"],"sourcesContent":["import type { AgentActivitySession } from \"@tutti-os/agent-activity-core\";\nimport { resolveAgentGUIProviderDisplayLabel } from \"../shared/agentConversationTitleProjection.ts\";\n\nexport interface ResolveAgentGuiWorkbenchHeaderTitleInput {\n agentName?: string | null;\n conversationTitle?: string | null;\n provider?: string | null;\n}\n\nexport interface ResolveAgentGuiWorkbenchSessionTitleInput {\n agentSessionId?: string | null;\n fallbackTitle?: string | null;\n optimisticTitle?: string | null;\n session?: Pick<AgentActivitySession, \"title\"> | null;\n}\n\nexport interface AgentGuiWorkbenchSessionTitleResult {\n agentSessionId: string | null;\n source: \"snapshot\" | \"optimistic\" | \"fallback\" | \"none\";\n title: string | null;\n}\n\nexport function resolveAgentGuiWorkbenchHeaderTitle({\n agentName,\n conversationTitle,\n provider\n}: ResolveAgentGuiWorkbenchHeaderTitleInput): string | null {\n return (\n stripTitle(agentName) ||\n stripTitle(resolveAgentGUIProviderDisplayLabel(provider, \"\")) ||\n stripTitle(conversationTitle) ||\n null\n );\n}\n\nexport function resolveAgentGuiWorkbenchSessionTitle({\n agentSessionId,\n fallbackTitle,\n optimisticTitle,\n session = null\n}: ResolveAgentGuiWorkbenchSessionTitleInput): AgentGuiWorkbenchSessionTitleResult {\n const normalizedAgentSessionId = agentSessionId?.trim() ?? \"\";\n if (!normalizedAgentSessionId) {\n return { agentSessionId: null, source: \"none\", title: null };\n }\n\n const snapshotTitle = stripTitle(session?.title);\n if (snapshotTitle) {\n return {\n agentSessionId: normalizedAgentSessionId,\n source: \"snapshot\",\n title: snapshotTitle\n };\n }\n\n const projectedOptimisticTitle = stripTitle(optimisticTitle);\n if (projectedOptimisticTitle) {\n return {\n agentSessionId: normalizedAgentSessionId,\n source: \"optimistic\",\n title: projectedOptimisticTitle\n };\n }\n\n if (session) {\n return {\n agentSessionId: normalizedAgentSessionId,\n source: \"none\",\n title: null\n };\n }\n\n const fallbackDisplayTitle = stripTitle(fallbackTitle);\n return fallbackDisplayTitle\n ? {\n agentSessionId: normalizedAgentSessionId,\n source: \"fallback\",\n title: fallbackDisplayTitle\n }\n : {\n agentSessionId: normalizedAgentSessionId,\n source: \"none\",\n title: null\n };\n}\n\nfunction stripTitle(value: string | null | undefined): string {\n return value?.trim() ?? \"\";\n}\n"],"mappings":";;;;;AAsBO,SAAS,oCAAoC;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AACF,GAA4D;AAC1D,SACE,WAAW,SAAS,KACpB,WAAW,oCAAoC,UAAU,EAAE,CAAC,KAC5D,WAAW,iBAAiB,KAC5B;AAEJ;AAEO,SAAS,qCAAqC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAAmF;AACjF,QAAM,2BAA2B,gBAAgB,KAAK,KAAK;AAC3D,MAAI,CAAC,0BAA0B;AAC7B,WAAO,EAAE,gBAAgB,MAAM,QAAQ,QAAQ,OAAO,KAAK;AAAA,EAC7D;AAEA,QAAM,gBAAgB,WAAW,SAAS,KAAK;AAC/C,MAAI,eAAe;AACjB,WAAO;AAAA,MACL,gBAAgB;AAAA,MAChB,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,2BAA2B,WAAW,eAAe;AAC3D,MAAI,0BAA0B;AAC5B,WAAO;AAAA,MACL,gBAAgB;AAAA,MAChB,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,SAAS;AACX,WAAO;AAAA,MACL,gBAAgB;AAAA,MAChB,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,uBAAuB,WAAW,aAAa;AACrD,SAAO,uBACH;AAAA,IACE,gBAAgB;AAAA,IAChB,QAAQ;AAAA,IACR,OAAO;AAAA,EACT,IACA;AAAA,IACE,gBAAgB;AAAA,IAChB,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AACN;AAEA,SAAS,WAAW,OAA0C;AAC5D,SAAO,OAAO,KAAK,KAAK;AAC1B;","names":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAgentGUIProviderUnresolved,
|
|
3
|
+
resolveAgentGUIConversationBrowserFreeTitle,
|
|
4
|
+
resolveAgentGUIConversationTitle,
|
|
5
|
+
resolveAgentGUIConversationTitleDisplayPrompt,
|
|
6
|
+
resolveAgentGUIConversationTitleLeadingMentionKind,
|
|
7
|
+
resolveAgentGUIProviderIdentity
|
|
8
|
+
} from "./chunk-JA6XAKKE.js";
|
|
9
|
+
import {
|
|
10
|
+
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
11
|
+
} from "./chunk-YMXYBG7U.js";
|
|
12
|
+
|
|
13
|
+
// shared/agentGUIConversationSummaryProjection.ts
|
|
14
|
+
import {
|
|
15
|
+
selectWorkspaceAgentConsumerSessions
|
|
16
|
+
} from "@tutti-os/agent-activity-core";
|
|
17
|
+
function projectCanonicalAgentGUIConversationSummaries(sessions, firstUserDisplayPromptsBySessionId = {}, rootSessionIdsAwaitingUserAction) {
|
|
18
|
+
return sessions.map((item) => {
|
|
19
|
+
const provider = resolveAgentGUIProviderIdentity({
|
|
20
|
+
sessionProvider: item.session.provider
|
|
21
|
+
});
|
|
22
|
+
const { title: canonicalTitle } = resolveAgentGUIConversationTitle(
|
|
23
|
+
item.session.title
|
|
24
|
+
);
|
|
25
|
+
const firstUserDisplayPrompt = firstUserDisplayPromptsBySessionId[item.session.agentSessionId];
|
|
26
|
+
const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
|
|
27
|
+
firstUserDisplayPrompt,
|
|
28
|
+
title: canonicalTitle
|
|
29
|
+
});
|
|
30
|
+
const { title, titleFallback } = resolveAgentGUIConversationTitle(
|
|
31
|
+
resolveAgentGUIConversationBrowserFreeTitle({
|
|
32
|
+
firstUserDisplayPrompt,
|
|
33
|
+
title: canonicalTitle
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
const canonicalUpdatedAtUnixMs = item.session.updatedAtUnixMs ?? item.session.createdAtUnixMs ?? 0;
|
|
37
|
+
const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(titleDisplayPrompt);
|
|
38
|
+
return {
|
|
39
|
+
agentTargetId: item.session.agentTargetId ?? null,
|
|
40
|
+
cwd: item.session.cwd,
|
|
41
|
+
id: item.session.agentSessionId,
|
|
42
|
+
needsUserAction: rootSessionIdsAwaitingUserAction?.has(item.session.agentSessionId) ?? item.pendingInteractions.length > 0,
|
|
43
|
+
pinnedAtUnixMs: item.session.pinnedAtUnixMs ?? null,
|
|
44
|
+
provider,
|
|
45
|
+
railSectionKey: item.session.railSectionKey,
|
|
46
|
+
resumable: item.session.resumable,
|
|
47
|
+
sortTimeUnixMs: resolveWorkspaceAgentSessionSortTimeUnixMs({
|
|
48
|
+
createdAtUnixMs: item.session.createdAtUnixMs,
|
|
49
|
+
latestTurn: item.latestTurn
|
|
50
|
+
}),
|
|
51
|
+
status: item.displayStatus === "idle" ? "ready" : item.displayStatus,
|
|
52
|
+
title,
|
|
53
|
+
titleLeadingMentionKind,
|
|
54
|
+
titleFallback,
|
|
55
|
+
updatedAtUnixMs: canonicalUpdatedAtUnixMs,
|
|
56
|
+
userId: item.session.userId?.trim() ?? ""
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function projectCanonicalAgentGUIConversationSummariesFromState(state, input) {
|
|
61
|
+
const provider = input.provider?.trim().toLowerCase() ?? "";
|
|
62
|
+
return projectCanonicalAgentGUIConversationSummaries(
|
|
63
|
+
selectWorkspaceAgentConsumerSessions(state).filter(
|
|
64
|
+
(item) => item.session.workspaceId === input.workspaceId
|
|
65
|
+
),
|
|
66
|
+
input.firstUserDisplayPromptsBySessionId,
|
|
67
|
+
input.rootSessionIdsAwaitingUserAction
|
|
68
|
+
).filter(
|
|
69
|
+
(conversation) => !provider || conversation.provider === provider || isAgentGUIProviderUnresolved(conversation.provider)
|
|
70
|
+
).sort(
|
|
71
|
+
(left, right) => (right.sortTimeUnixMs ?? right.updatedAtUnixMs) - (left.sortTimeUnixMs ?? left.updatedAtUnixMs) || left.id.localeCompare(right.id)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
projectCanonicalAgentGUIConversationSummaries,
|
|
77
|
+
projectCanonicalAgentGUIConversationSummariesFromState
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=chunk-ZBI6R46N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../shared/agentGUIConversationSummaryProjection.ts"],"sourcesContent":["import {\n selectWorkspaceAgentConsumerSessions,\n type AgentSessionEngineState\n} from \"@tutti-os/agent-activity-core\";\nimport {\n isAgentGUIProviderUnresolved,\n resolveAgentGUIConversationBrowserFreeTitle,\n resolveAgentGUIConversationTitle,\n resolveAgentGUIConversationTitleDisplayPrompt,\n resolveAgentGUIConversationTitleLeadingMentionKind,\n resolveAgentGUIProviderIdentity,\n type AgentGUIConversationTitleFallback,\n type AgentGUIConversationTitleLeadingMentionKind,\n type AgentGUIResolvedProvider\n} from \"./agentConversationTitleProjection.ts\";\nimport type { AgentGUIConversationRailTitlePromptsBySessionId } from \"./agentConversationRailTitlePromptSelector.ts\";\nimport { resolveWorkspaceAgentSessionSortTimeUnixMs } from \"./workspaceAgentSessionSortTime.ts\";\n\nexport type AgentGUIConsumerSessions = ReturnType<\n typeof selectWorkspaceAgentConsumerSessions\n>;\n\nexport type AgentConversationRailStatus =\n | \"working\"\n | \"waiting\"\n | \"ready\"\n | \"completed\"\n | \"failed\"\n | \"canceled\";\n\nexport interface AgentConversationRailSummary {\n agentTargetId?: string | null;\n cwd: string;\n id: string;\n needsUserAction?: boolean;\n pinnedAtUnixMs?: number | null;\n provider: AgentGUIResolvedProvider;\n railSectionKey?: string;\n resumable?: boolean;\n sortTimeUnixMs?: number;\n status: AgentConversationRailStatus;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n titleLeadingMentionKind?: AgentGUIConversationTitleLeadingMentionKind | null;\n updatedAtUnixMs: number;\n userId?: string;\n}\n\nexport function projectCanonicalAgentGUIConversationSummaries(\n sessions: AgentGUIConsumerSessions,\n firstUserDisplayPromptsBySessionId: AgentGUIConversationRailTitlePromptsBySessionId = {},\n rootSessionIdsAwaitingUserAction?: ReadonlySet<string>\n): AgentConversationRailSummary[] {\n return sessions.map((item): AgentConversationRailSummary => {\n const provider = resolveAgentGUIProviderIdentity({\n sessionProvider: item.session.provider\n });\n const { title: canonicalTitle } = resolveAgentGUIConversationTitle(\n item.session.title\n );\n const firstUserDisplayPrompt =\n firstUserDisplayPromptsBySessionId[item.session.agentSessionId];\n const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({\n firstUserDisplayPrompt,\n title: canonicalTitle\n });\n const { title, titleFallback } = resolveAgentGUIConversationTitle(\n resolveAgentGUIConversationBrowserFreeTitle({\n firstUserDisplayPrompt,\n title: canonicalTitle\n })\n );\n const canonicalUpdatedAtUnixMs =\n item.session.updatedAtUnixMs ?? item.session.createdAtUnixMs ?? 0;\n const titleLeadingMentionKind =\n resolveAgentGUIConversationTitleLeadingMentionKind(titleDisplayPrompt);\n return {\n agentTargetId: item.session.agentTargetId ?? null,\n cwd: item.session.cwd,\n id: item.session.agentSessionId,\n needsUserAction:\n rootSessionIdsAwaitingUserAction?.has(item.session.agentSessionId) ??\n item.pendingInteractions.length > 0,\n pinnedAtUnixMs: item.session.pinnedAtUnixMs ?? null,\n provider,\n railSectionKey: item.session.railSectionKey,\n resumable: item.session.resumable,\n sortTimeUnixMs: resolveWorkspaceAgentSessionSortTimeUnixMs({\n createdAtUnixMs: item.session.createdAtUnixMs,\n latestTurn: item.latestTurn\n }),\n status: item.displayStatus === \"idle\" ? \"ready\" : item.displayStatus,\n title,\n titleLeadingMentionKind,\n titleFallback,\n updatedAtUnixMs: canonicalUpdatedAtUnixMs,\n userId: item.session.userId?.trim() ?? \"\"\n };\n });\n}\n\nexport function projectCanonicalAgentGUIConversationSummariesFromState(\n state: AgentSessionEngineState,\n input: {\n firstUserDisplayPromptsBySessionId?: AgentGUIConversationRailTitlePromptsBySessionId;\n provider?: string | null;\n rootSessionIdsAwaitingUserAction?: ReadonlySet<string>;\n workspaceId: string;\n }\n): AgentConversationRailSummary[] {\n const provider = input.provider?.trim().toLowerCase() ?? \"\";\n return projectCanonicalAgentGUIConversationSummaries(\n selectWorkspaceAgentConsumerSessions(state).filter(\n (item) => item.session.workspaceId === input.workspaceId\n ),\n input.firstUserDisplayPromptsBySessionId,\n input.rootSessionIdsAwaitingUserAction\n )\n .filter(\n (conversation) =>\n !provider ||\n conversation.provider === provider ||\n isAgentGUIProviderUnresolved(conversation.provider)\n )\n .sort(\n (left, right) =>\n (right.sortTimeUnixMs ?? right.updatedAtUnixMs) -\n (left.sortTimeUnixMs ?? left.updatedAtUnixMs) ||\n left.id.localeCompare(right.id)\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,OAEK;AA6CA,SAAS,8CACd,UACA,qCAAsF,CAAC,GACvF,kCACgC;AAChC,SAAO,SAAS,IAAI,CAAC,SAAuC;AAC1D,UAAM,WAAW,gCAAgC;AAAA,MAC/C,iBAAiB,KAAK,QAAQ;AAAA,IAChC,CAAC;AACD,UAAM,EAAE,OAAO,eAAe,IAAI;AAAA,MAChC,KAAK,QAAQ;AAAA,IACf;AACA,UAAM,yBACJ,mCAAmC,KAAK,QAAQ,cAAc;AAChE,UAAM,qBAAqB,8CAA8C;AAAA,MACvE;AAAA,MACA,OAAO;AAAA,IACT,CAAC;AACD,UAAM,EAAE,OAAO,cAAc,IAAI;AAAA,MAC/B,4CAA4C;AAAA,QAC1C;AAAA,QACA,OAAO;AAAA,MACT,CAAC;AAAA,IACH;AACA,UAAM,2BACJ,KAAK,QAAQ,mBAAmB,KAAK,QAAQ,mBAAmB;AAClE,UAAM,0BACJ,mDAAmD,kBAAkB;AACvE,WAAO;AAAA,MACL,eAAe,KAAK,QAAQ,iBAAiB;AAAA,MAC7C,KAAK,KAAK,QAAQ;AAAA,MAClB,IAAI,KAAK,QAAQ;AAAA,MACjB,iBACE,kCAAkC,IAAI,KAAK,QAAQ,cAAc,KACjE,KAAK,oBAAoB,SAAS;AAAA,MACpC,gBAAgB,KAAK,QAAQ,kBAAkB;AAAA,MAC/C;AAAA,MACA,gBAAgB,KAAK,QAAQ;AAAA,MAC7B,WAAW,KAAK,QAAQ;AAAA,MACxB,gBAAgB,2CAA2C;AAAA,QACzD,iBAAiB,KAAK,QAAQ;AAAA,QAC9B,YAAY,KAAK;AAAA,MACnB,CAAC;AAAA,MACD,QAAQ,KAAK,kBAAkB,SAAS,UAAU,KAAK;AAAA,MACvD;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB,QAAQ,KAAK,QAAQ,QAAQ,KAAK,KAAK;AAAA,IACzC;AAAA,EACF,CAAC;AACH;AAEO,SAAS,uDACd,OACA,OAMgC;AAChC,QAAM,WAAW,MAAM,UAAU,KAAK,EAAE,YAAY,KAAK;AACzD,SAAO;AAAA,IACL,qCAAqC,KAAK,EAAE;AAAA,MAC1C,CAAC,SAAS,KAAK,QAAQ,gBAAgB,MAAM;AAAA,IAC/C;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR,EACG;AAAA,IACC,CAAC,iBACC,CAAC,YACD,aAAa,aAAa,YAC1B,6BAA6B,aAAa,QAAQ;AAAA,EACtD,EACC;AAAA,IACC,CAAC,MAAM,WACJ,MAAM,kBAAkB,MAAM,oBAC5B,KAAK,kBAAkB,KAAK,oBAC/B,KAAK,GAAG,cAAc,MAAM,EAAE;AAAA,EAClC;AACJ;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { selectWorkspaceAgentConsumerSessions, AgentSessionEngineState } from '@tutti-os/agent-activity-core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Open runtime metadata reported by an Agent Target.
|
|
5
|
+
*
|
|
6
|
+
* Built-in providers still use AgentProvider, while externally installed ACP
|
|
7
|
+
* extensions use namespaced values such as `acp:gemini`.
|
|
8
|
+
*/
|
|
9
|
+
type AgentGUIProvider = string;
|
|
10
|
+
|
|
11
|
+
type AgentGUIResolvedProvider = AgentGUIProvider | "unknown";
|
|
12
|
+
type AgentGUIConversationTitleFallback = "untitled-conversation" | null;
|
|
13
|
+
type AgentGUIConversationTitleLeadingMentionKind = "agent" | "app" | "file" | "session" | "task";
|
|
14
|
+
|
|
15
|
+
type AgentGUIConversationRailTitlePromptsBySessionId = Readonly<Record<string, string>>;
|
|
16
|
+
|
|
17
|
+
type AgentGUIConsumerSessions = ReturnType<typeof selectWorkspaceAgentConsumerSessions>;
|
|
18
|
+
type AgentConversationRailStatus = "working" | "waiting" | "ready" | "completed" | "failed" | "canceled";
|
|
19
|
+
interface AgentConversationRailSummary {
|
|
20
|
+
agentTargetId?: string | null;
|
|
21
|
+
cwd: string;
|
|
22
|
+
id: string;
|
|
23
|
+
needsUserAction?: boolean;
|
|
24
|
+
pinnedAtUnixMs?: number | null;
|
|
25
|
+
provider: AgentGUIResolvedProvider;
|
|
26
|
+
railSectionKey?: string;
|
|
27
|
+
resumable?: boolean;
|
|
28
|
+
sortTimeUnixMs?: number;
|
|
29
|
+
status: AgentConversationRailStatus;
|
|
30
|
+
title: string;
|
|
31
|
+
titleFallback?: AgentGUIConversationTitleFallback;
|
|
32
|
+
titleLeadingMentionKind?: AgentGUIConversationTitleLeadingMentionKind | null;
|
|
33
|
+
updatedAtUnixMs: number;
|
|
34
|
+
userId?: string;
|
|
35
|
+
}
|
|
36
|
+
declare function projectCanonicalAgentGUIConversationSummaries(sessions: AgentGUIConsumerSessions, firstUserDisplayPromptsBySessionId?: AgentGUIConversationRailTitlePromptsBySessionId, rootSessionIdsAwaitingUserAction?: ReadonlySet<string>): AgentConversationRailSummary[];
|
|
37
|
+
declare function projectCanonicalAgentGUIConversationSummariesFromState(state: AgentSessionEngineState, input: {
|
|
38
|
+
firstUserDisplayPromptsBySessionId?: AgentGUIConversationRailTitlePromptsBySessionId;
|
|
39
|
+
provider?: string | null;
|
|
40
|
+
rootSessionIdsAwaitingUserAction?: ReadonlySet<string>;
|
|
41
|
+
workspaceId: string;
|
|
42
|
+
}): AgentConversationRailSummary[];
|
|
43
|
+
|
|
44
|
+
export { type AgentConversationRailStatus, type AgentConversationRailSummary, type AgentGUIConsumerSessions, projectCanonicalAgentGUIConversationSummaries, projectCanonicalAgentGUIConversationSummariesFromState };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
projectCanonicalAgentGUIConversationSummaries,
|
|
3
|
+
projectCanonicalAgentGUIConversationSummariesFromState
|
|
4
|
+
} from "./chunk-ZBI6R46N.js";
|
|
5
|
+
import "./chunk-JA6XAKKE.js";
|
|
6
|
+
import "./chunk-YMXYBG7U.js";
|
|
7
|
+
import "./chunk-MIJXEELH.js";
|
|
8
|
+
import "./chunk-ZXEICU6J.js";
|
|
9
|
+
import "./chunk-O433KXLK.js";
|
|
10
|
+
export {
|
|
11
|
+
projectCanonicalAgentGUIConversationSummaries,
|
|
12
|
+
projectCanonicalAgentGUIConversationSummariesFromState
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=conversation-rail-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -10,15 +10,17 @@ import {
|
|
|
10
10
|
normalizeAgentGUIAgentTargets,
|
|
11
11
|
resolveAgentGUIAgentTarget,
|
|
12
12
|
selectAgentStatusControllerSnapshot
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5IFWKS7A.js";
|
|
14
|
+
import "./chunk-ZBI6R46N.js";
|
|
14
15
|
import {
|
|
15
16
|
AGENT_CONVERSATION_RAIL_RUNTIME_METHODS,
|
|
16
17
|
createAgentConversationRailRuntime,
|
|
17
18
|
inspectAgentConversationBatchDeletionCapability
|
|
18
19
|
} from "./chunk-LB4AGT7B.js";
|
|
19
20
|
import "./chunk-A4WCTHWS.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-7AYFKNLD.js";
|
|
22
|
+
import "./chunk-T57ZZWTC.js";
|
|
23
|
+
import "./chunk-JA6XAKKE.js";
|
|
22
24
|
import "./chunk-KDN6SLJM.js";
|
|
23
25
|
import "./chunk-SUVMLCED.js";
|
|
24
26
|
import "./chunk-MGSRWYRN.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts"],"sourcesContent":["export {\n getAgentCustomMentionKind,\n registerAgentCustomMentionKind,\n resetAgentCustomMentionKindsForTests,\n type AgentCustomMentionChipContext,\n type AgentCustomMentionIdentity,\n type AgentCustomMentionKindDefinition,\n type AgentCustomMentionPresentation\n} from \"./shared/agentCustomMentionKinds\";\nexport {\n AGENT_PASTED_TEXT_BLOCK_KIND,\n AGENT_PASTED_TEXT_MENTION_KIND\n} from \"./shared/pastedTextKinds\";\nexport { AgentGUI } from \"./AgentGUI\";\nexport type {\n AgentGUIProps,\n AgentGUIReferenceProvenanceFilterCatalog\n} from \"./AgentGUI\";\nexport type {\n TuttiModePlanAssignmentAgentDetail,\n TuttiModePlanAssignmentAgentOption,\n TuttiModePlanAssignmentOptionsSource,\n TuttiModePlanReviewSnapshot,\n TuttiModePlanReviewRuntime,\n TuttiModePlanTaskAssignmentInput,\n TuttiPlanIssueMaterializationFailure,\n TuttiPlanIssueQueryResult,\n TuttiPlanIssueSnapshot,\n TuttiPlanIssueSource,\n TuttiPlanIssueTaskSnapshot\n} from \"./workspaceWorkflow\";\nexport type { AgentGUIComposerAppendRequest } from \"./agent-gui/agentGuiNode/controller/useAgentGUIComposerAppendRequest\";\nexport {\n createAgentStatusController,\n selectAgentStatusControllerSnapshot,\n type AgentStatusController,\n type AgentStatusControllerOptions,\n type AgentStatusControllerSnapshot,\n type AgentStatusFrame,\n type AgentStatusQuery,\n type AgentStatusRequestPhase,\n type AgentStatusRequestReason,\n type AgentStatusSelectionKey,\n type AgentStatusSectionState,\n type AgentStatusSource,\n type AgentStatusSourceError,\n type AgentStatusStreamObserver,\n type AgentStatusValue\n} from \"./agent-gui/agentGuiNode/controller/AgentStatusController\";\nexport {\n AgentHandoffMenu,\n type AgentHandoffMenuLabels,\n type AgentHandoffMenuProps\n} from \"./agent-gui/agentGuiNode/composer/AgentHandoffMenu\";\nexport {\n createAgentSessionHandoffPrompt,\n createAgentSessionMarkdownLink\n} from \"./agent-gui/agentGuiNode/agentRichText/agentMentionMarkdown\";\nexport type {\n CreateAgentSessionHandoffPromptInput,\n CreateAgentSessionMarkdownLinkInput\n} from \"./agent-gui/agentGuiNode/agentRichText/agentMentionMarkdown\";\nexport type { AgentComposerDraftFile } from \"./agent-gui/agentGuiNode/model/agentGuiNodeTypes\";\nexport type {\n AgentExternalPromptFilePreparationErrorCode,\n AgentExternalPromptFilePreparationResult,\n AgentExternalPromptFilePreparer,\n AgentPreparedExternalPromptFile\n} from \"./agent-gui/agentGuiNode/model/agentExternalPromptFiles\";\nexport type {\n AgentExternalPromptEntryResolution,\n AgentExternalPromptEntryResolver\n} from \"./agent-gui/agentGuiNode/model/agentExternalPromptEntries\";\nexport type {\n AgentRunErrorCode,\n AgentVisibleErrorOverride,\n AgentVisibleErrorOverrideCode,\n AgentVisibleErrorOverrides\n} from \"./shared/agentEnv/agentErrorPresentation\";\nexport type {\n AgentGUIComposerContentType,\n AgentGUIComposerFocusMethod,\n AgentGUIEngagementContext,\n AgentGUIEngagementEvent,\n AgentGUIEngagementEventSink\n} from \"./agent-gui/agentGuiNode/engagement/agentGUIEngagement.types\";\nexport {\n agentGUIAgentIsReady,\n normalizeAgentGUIAgents,\n projectAgentGUIAgentsToTargets,\n resolveAgentGUISelectedDirectoryAgent\n} from \"./agents\";\nexport {\n agentGUIDefaultTargetProviders,\n createLocalAgentGUIAgentTarget,\n createLocalAgentGUIAgentTargets,\n createSharedAgentGUIAgentTarget,\n localAgentGUIAgentTargetId,\n normalizeAgentGUIAgentTargets,\n resolveAgentGUIAgentTarget\n} from \"./agentTargets\";\nexport type {\n AgentGUIAgent,\n AgentGUIAgentDirectoryPort,\n AgentGUIAgentDirectorySnapshot,\n AgentGUIAgentDirectoryStatus,\n AgentGUIAgentAvailability,\n AgentGUIAgentAvailabilityAction,\n AgentGUIAgentAvailabilityStatus,\n AgentGUIAgentOwner,\n AgentGUIAgentOwnership,\n AgentGUIHomeSuggestionId,\n AgentGUIAllAgentsPresentation,\n AgentGUIProvider,\n AgentGUIProviderRailAllPresentation,\n AgentGUIProviderRailMode,\n AgentGUIProviderReadinessGate,\n AgentGUIProviderReadinessGateAction,\n AgentGUIProviderReadinessGateStatus,\n AgentGUITargetConnectionSource,\n AgentGUITargetConnectionState,\n AgentGUITargetConnectionStatus,\n AgentGUIAgentTarget,\n AgentGUIAgentTargetBadge,\n AgentGUIAgentTargetRef\n} from \"./types\";\nexport {\n AgentGuiI18nProvider,\n agentGuiI18nModule,\n agentGuiI18nResources\n} from \"./i18n/index\";\nexport type { AgentGuiI18nLocale } from \"./i18n/index\";\nexport { agentGuiDockIconUrl, agentGuiDockIconUrls } from \"./dockIcons\";\nexport {\n AGENT_GUI_COLLAPSED_MIN_WIDTH_PX,\n AGENT_GUI_DETAIL_MIN_WIDTH_PX,\n AGENT_GUI_EXPANDED_TARGET_WIDTH_PX,\n AGENT_GUI_STANDALONE_MIDDLE_CONTENT_MIN_WIDTH_PX,\n resolveAgentGUIConversationRailPresentation,\n resolveAgentGUIExpandedWindowFrame,\n resolveStandaloneAgentGUIViewportMinimumWidthPx,\n shouldAutoCollapseAgentGUIConversationRail\n} from \"./agent-gui/agentGuiNode/model/agentGuiRailLayout\";\nexport type {\n AgentGUIConversationRailAutoCollapseMode,\n AgentGUIConversationRailPresentation\n} from \"./agent-gui/agentGuiNode/model/agentGuiRailLayout\";\nexport type {\n AgentGUIAgentsEmptyRenderer,\n AgentGUIConversationRailLayout,\n AgentGUIProviderUnavailableStateContext,\n AgentGUIProviderUnavailableStateRenderer,\n AgentGUISidebarFooterContext,\n AgentGUISidebarFooterRenderer\n} from \"./agent-gui/agentGuiNode/AgentGUINodeView\";\nexport {\n AGENT_CONTEXT_MENTION_PROVIDER_IDS,\n type AgentContextMentionProviderId,\n type AgentContextMentionProvider\n} from \"./agent-gui/agentGuiNode/agentContextMentionProvider\";\nexport { preloadAgentMentionBrowse } from \"./agent-gui/agentGuiNode/AgentMentionSearchController\";\nexport { AgentActivityHostProvider } from \"./agentActivityHost\";\nexport type { AgentActivityHostProviderProps } from \"./agentActivityHost\";\nexport { useEngineSelector } from \"./shared/engine/useEngineSelector\";\nexport type { EngineStateStore } from \"./shared/engine/useEngineSelector\";\nexport {\n dispatchAgentPlanPromptAction,\n selectAgentPlanPromptTurn\n} from \"./shared/agentConversation/agentPlanPromptDispatch\";\nexport type { AgentPlanPromptAction } from \"./shared/agentConversation/agentPlanPromptDispatch\";\nexport {\n AgentActivityRuntimeProvider,\n resetAgentActivityRuntimeForTests,\n setAgentActivityRuntimeForTests,\n useAgentActivitySnapshot,\n useAgentActivityRuntime,\n useOptionalAgentActivityRuntime\n} from \"./agentActivityRuntime\";\nexport type {\n AgentActivityRuntime,\n AgentActivityRuntimeListSessionMessagesInput,\n AgentActivityRuntimeProviderProps,\n AgentActivityRuntimePromptContentBlock,\n AgentActivityRuntimeDeleteSessionsBatchInput,\n AgentActivityRuntimeDeleteSessionsBatchResult,\n AgentActivityRuntimeSessionSectionDeletionCandidates,\n AgentActivityRuntimeSessionSectionScopeInput,\n AgentActivityRuntimeSetSessionPinnedInput,\n AgentActivityRuntimeUploadPromptContentInput,\n AgentActivityRuntimeUploadPromptContentResult,\n AgentActivityRuntimeUpdateSessionSettingsInput,\n AgentActivityRuntimeUpdateSessionSettingsResult\n} from \"./agentActivityRuntime\";\nexport {\n AGENT_CONVERSATION_RAIL_RUNTIME_METHODS,\n createAgentConversationRailRuntime,\n inspectAgentConversationBatchDeletionCapability\n} from \"./agentConversationRailRuntime\";\nexport type {\n AgentConversationBatchDeletionCapability,\n AgentConversationRailRuntime,\n AgentConversationRailRuntimeSource\n} from \"./agentConversationRailRuntime\";\nexport type {\n AgentHostApi,\n AgentHostAgentTargetAuthenticatedAccount,\n AgentHostAgentTargetSetupSnapshot,\n AgentHostAgentTargetSetupState,\n AgentHostAgentTargetSetupWatch,\n AgentHostApplyWorkspaceGitPatchInput,\n AgentHostInputApi,\n AgentHostQuickPrompt,\n AgentHostQuickPromptSnapshot,\n AgentHostQuickPromptsApi,\n AgentHostSelectFilesInput,\n AgentHostRuntimeApi,\n AgentHostUserProject,\n AgentProviderProbeListInput,\n AgentProviderProbeListResult\n} from \"./host/agentHostApi\";\nexport type {\n AgentProbeProvider,\n AgentProbeSnapshot,\n PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n AgentUsageQuota,\n AgentUsageSnapshot,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\n} from \"./shared/contracts/dto\";\nexport {\n selectNeedsAttentionCount,\n selectNeedsAttentionItems\n} from \"@tutti-os/agent-activity-core\";\nexport type {\n AgentActivityAdapter,\n AgentActivityMessage,\n AgentActivityNeedsAttentionItem,\n AgentActivitySnapshot\n} from \"@tutti-os/agent-activity-core\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../index.ts"],"sourcesContent":["export {\n getAgentCustomMentionKind,\n registerAgentCustomMentionKind,\n resetAgentCustomMentionKindsForTests,\n type AgentCustomMentionChipContext,\n type AgentCustomMentionIdentity,\n type AgentCustomMentionKindDefinition,\n type AgentCustomMentionPresentation\n} from \"./shared/agentCustomMentionKinds\";\nexport {\n AGENT_PASTED_TEXT_BLOCK_KIND,\n AGENT_PASTED_TEXT_MENTION_KIND\n} from \"./shared/pastedTextKinds\";\nexport { AgentGUI } from \"./AgentGUI\";\nexport type {\n AgentGUIProps,\n AgentGUIReferenceProvenanceFilterCatalog\n} from \"./AgentGUI\";\nexport type {\n TuttiModePlanAssignmentAgentDetail,\n TuttiModePlanAssignmentAgentOption,\n TuttiModePlanAssignmentOptionsSource,\n TuttiModePlanReviewSnapshot,\n TuttiModePlanReviewRuntime,\n TuttiModePlanTaskAssignmentInput,\n TuttiPlanIssueMaterializationFailure,\n TuttiPlanIssueQueryResult,\n TuttiPlanIssueSnapshot,\n TuttiPlanIssueSource,\n TuttiPlanIssueTaskSnapshot\n} from \"./workspaceWorkflow\";\nexport type { AgentGUIComposerAppendRequest } from \"./agent-gui/agentGuiNode/controller/useAgentGUIComposerAppendRequest\";\nexport {\n createAgentStatusController,\n selectAgentStatusControllerSnapshot,\n type AgentStatusController,\n type AgentStatusControllerOptions,\n type AgentStatusControllerSnapshot,\n type AgentStatusFrame,\n type AgentStatusQuery,\n type AgentStatusRequestPhase,\n type AgentStatusRequestReason,\n type AgentStatusSelectionKey,\n type AgentStatusSectionState,\n type AgentStatusSource,\n type AgentStatusSourceError,\n type AgentStatusStreamObserver,\n type AgentStatusValue\n} from \"./agent-gui/agentGuiNode/controller/AgentStatusController\";\nexport {\n AgentHandoffMenu,\n type AgentHandoffMenuLabels,\n type AgentHandoffMenuProps\n} from \"./agent-gui/agentGuiNode/composer/AgentHandoffMenu\";\nexport {\n createAgentSessionHandoffPrompt,\n createAgentSessionMarkdownLink\n} from \"./agent-gui/agentGuiNode/agentRichText/agentMentionMarkdown\";\nexport type {\n CreateAgentSessionHandoffPromptInput,\n CreateAgentSessionMarkdownLinkInput\n} from \"./agent-gui/agentGuiNode/agentRichText/agentMentionMarkdown\";\nexport type { AgentComposerDraftFile } from \"./agent-gui/agentGuiNode/model/agentGuiNodeTypes\";\nexport type {\n AgentExternalPromptFilePreparationErrorCode,\n AgentExternalPromptFilePreparationResult,\n AgentExternalPromptFilePreparer,\n AgentPreparedExternalPromptFile\n} from \"./agent-gui/agentGuiNode/model/agentExternalPromptFiles\";\nexport type {\n AgentExternalPromptEntryResolution,\n AgentExternalPromptEntryResolver\n} from \"./agent-gui/agentGuiNode/model/agentExternalPromptEntries\";\nexport type {\n AgentRunErrorCode,\n AgentVisibleErrorOverride,\n AgentVisibleErrorOverrideCode,\n AgentVisibleErrorOverrides\n} from \"./shared/agentEnv/agentErrorPresentation\";\nexport type {\n AgentGUIComposerContentType,\n AgentGUIComposerFocusMethod,\n AgentGUIEngagementContext,\n AgentGUIEngagementEvent,\n AgentGUIEngagementEventSink\n} from \"./agent-gui/agentGuiNode/engagement/agentGUIEngagement.types\";\nexport {\n agentGUIAgentIsReady,\n normalizeAgentGUIAgents,\n projectAgentGUIAgentsToTargets,\n resolveAgentGUISelectedDirectoryAgent\n} from \"./agents\";\nexport {\n agentGUIDefaultTargetProviders,\n createLocalAgentGUIAgentTarget,\n createLocalAgentGUIAgentTargets,\n createSharedAgentGUIAgentTarget,\n localAgentGUIAgentTargetId,\n normalizeAgentGUIAgentTargets,\n resolveAgentGUIAgentTarget\n} from \"./agentTargets\";\nexport type {\n AgentGUIAgent,\n AgentGUIAgentDirectoryPort,\n AgentGUIAgentDirectorySnapshot,\n AgentGUIAgentDirectoryStatus,\n AgentGUIAgentAvailability,\n AgentGUIAgentAvailabilityAction,\n AgentGUIAgentAvailabilityStatus,\n AgentGUIAgentOwner,\n AgentGUIAgentOwnership,\n AgentGUIHomeSuggestionId,\n AgentGUIAllAgentsPresentation,\n AgentGUIProvider,\n AgentGUIProviderRailAllPresentation,\n AgentGUIProviderRailMode,\n AgentGUIProviderReadinessGate,\n AgentGUIProviderReadinessGateAction,\n AgentGUIProviderReadinessGateStatus,\n AgentGUITargetConnectionSource,\n AgentGUITargetConnectionState,\n AgentGUITargetConnectionStatus,\n AgentGUIAgentTarget,\n AgentGUIAgentTargetBadge,\n AgentGUIAgentTargetRef\n} from \"./types\";\nexport {\n AgentGuiI18nProvider,\n agentGuiI18nModule,\n agentGuiI18nResources\n} from \"./i18n/index\";\nexport type { AgentGuiI18nLocale } from \"./i18n/index\";\nexport { agentGuiDockIconUrl, agentGuiDockIconUrls } from \"./dockIcons\";\nexport {\n AGENT_GUI_COLLAPSED_MIN_WIDTH_PX,\n AGENT_GUI_DETAIL_MIN_WIDTH_PX,\n AGENT_GUI_EXPANDED_TARGET_WIDTH_PX,\n AGENT_GUI_STANDALONE_MIDDLE_CONTENT_MIN_WIDTH_PX,\n resolveAgentGUIConversationRailPresentation,\n resolveAgentGUIExpandedWindowFrame,\n resolveStandaloneAgentGUIViewportMinimumWidthPx,\n shouldAutoCollapseAgentGUIConversationRail\n} from \"./agent-gui/agentGuiNode/model/agentGuiRailLayout\";\nexport type {\n AgentGUIConversationRailAutoCollapseMode,\n AgentGUIConversationRailPresentation\n} from \"./agent-gui/agentGuiNode/model/agentGuiRailLayout\";\nexport type {\n AgentGUIAgentsEmptyRenderer,\n AgentGUIConversationRailLayout,\n AgentGUIProviderUnavailableStateContext,\n AgentGUIProviderUnavailableStateRenderer,\n AgentGUISidebarFooterContext,\n AgentGUISidebarFooterRenderer\n} from \"./agent-gui/agentGuiNode/AgentGUINodeView\";\nexport {\n AGENT_CONTEXT_MENTION_PROVIDER_IDS,\n type AgentContextMentionProviderId,\n type AgentContextMentionProvider\n} from \"./agent-gui/agentGuiNode/agentContextMentionProvider\";\nexport { preloadAgentMentionBrowse } from \"./agent-gui/agentGuiNode/AgentMentionSearchController\";\nexport { AgentActivityHostProvider } from \"./agentActivityHost\";\nexport type { AgentActivityHostProviderProps } from \"./agentActivityHost\";\nexport { useEngineSelector } from \"./shared/engine/useEngineSelector\";\nexport type { EngineStateStore } from \"./shared/engine/useEngineSelector\";\nexport {\n dispatchAgentPlanPromptAction,\n selectAgentPlanPromptTurn\n} from \"./shared/agentConversation/agentPlanPromptDispatch\";\nexport type { AgentPlanPromptAction } from \"./shared/agentConversation/agentPlanPromptDispatch\";\nexport {\n AgentActivityRuntimeProvider,\n resetAgentActivityRuntimeForTests,\n setAgentActivityRuntimeForTests,\n useAgentActivitySnapshot,\n useAgentActivityRuntime,\n useOptionalAgentActivityRuntime\n} from \"./agentActivityRuntime\";\nexport type {\n AgentActivityRuntime,\n AgentActivityRuntimeListSessionMessagesInput,\n AgentActivityRuntimeProviderProps,\n AgentActivityRuntimePromptContentBlock,\n AgentActivityRuntimeDeleteSessionsBatchInput,\n AgentActivityRuntimeDeleteSessionsBatchResult,\n AgentActivityRuntimeSessionSectionDeletionCandidates,\n AgentActivityRuntimeSessionSectionScopeInput,\n AgentActivityRuntimeSetSessionPinnedInput,\n AgentActivityRuntimeUploadPromptContentInput,\n AgentActivityRuntimeUploadPromptContentResult,\n AgentActivityRuntimeUpdateSessionSettingsInput,\n AgentActivityRuntimeUpdateSessionSettingsResult\n} from \"./agentActivityRuntime\";\nexport {\n AGENT_CONVERSATION_RAIL_RUNTIME_METHODS,\n createAgentConversationRailRuntime,\n inspectAgentConversationBatchDeletionCapability\n} from \"./agentConversationRailRuntime\";\nexport type {\n AgentConversationBatchDeletionCapability,\n AgentConversationRailRuntime,\n AgentConversationRailRuntimeSource\n} from \"./agentConversationRailRuntime\";\nexport type {\n AgentHostApi,\n AgentHostAgentTargetAuthenticatedAccount,\n AgentHostAgentTargetSetupSnapshot,\n AgentHostAgentTargetSetupState,\n AgentHostAgentTargetSetupWatch,\n AgentHostApplyWorkspaceGitPatchInput,\n AgentHostInputApi,\n AgentHostQuickPrompt,\n AgentHostQuickPromptSnapshot,\n AgentHostQuickPromptsApi,\n AgentHostSelectFilesInput,\n AgentHostRuntimeApi,\n AgentHostUserProject,\n AgentProviderProbeListInput,\n AgentProviderProbeListResult\n} from \"./host/agentHostApi\";\nexport type {\n AgentProbeProvider,\n AgentProbeSnapshot,\n PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n AgentUsageQuota,\n AgentUsageSnapshot,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\n} from \"./shared/contracts/dto\";\nexport {\n selectNeedsAttentionCount,\n selectNeedsAttentionItems\n} from \"@tutti-os/agent-activity-core\";\nexport type {\n AgentActivityAdapter,\n AgentActivityMessage,\n AgentActivityNeedsAttentionItem,\n AgentActivitySnapshot\n} from \"@tutti-os/agent-activity-core\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsOA;AAAA,EACE;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -17,8 +17,9 @@ import {
|
|
|
17
17
|
resolveAgentGuiUnifiedDockLaunchPayload,
|
|
18
18
|
resolveAgentGuiWorkbenchContributionCopy,
|
|
19
19
|
resolveAgentGuiWorkbenchDefaultLaunchFrame
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-7AYFKNLD.js";
|
|
21
|
+
import "../chunk-T57ZZWTC.js";
|
|
22
|
+
import "../chunk-JA6XAKKE.js";
|
|
22
23
|
import "../chunk-KDN6SLJM.js";
|
|
23
24
|
import "../chunk-SUVMLCED.js";
|
|
24
25
|
import "../chunk-MGSRWYRN.js";
|
package/dist/workbench/index.js
CHANGED
|
@@ -13,11 +13,12 @@ import {
|
|
|
13
13
|
resolveAgentGuiUnifiedDockLaunchPayload,
|
|
14
14
|
resolveAgentGuiWorkbenchContributionCopy,
|
|
15
15
|
resolveAgentGuiWorkbenchConversationIdentity
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-7AYFKNLD.js";
|
|
17
17
|
import {
|
|
18
18
|
resolveAgentGuiWorkbenchHeaderTitle,
|
|
19
19
|
resolveAgentGuiWorkbenchSessionTitle
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-T57ZZWTC.js";
|
|
21
|
+
import "../chunk-JA6XAKKE.js";
|
|
21
22
|
import {
|
|
22
23
|
areAgentGuiWorkbenchNodeStatesEqual,
|
|
23
24
|
areAgentGuiWorkbenchStatesEqual,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveAgentGuiWorkbenchHeaderTitle,
|
|
3
3
|
resolveAgentGuiWorkbenchSessionTitle
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-T57ZZWTC.js";
|
|
5
|
+
import "../chunk-JA6XAKKE.js";
|
|
5
6
|
import "../chunk-MIJXEELH.js";
|
|
6
7
|
import "../chunk-ZXEICU6J.js";
|
|
7
8
|
import "../chunk-O433KXLK.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tutti-os/agent-gui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.231",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -93,6 +93,10 @@
|
|
|
93
93
|
"types": "./dist/conversation-rail-runtime.d.ts",
|
|
94
94
|
"import": "./dist/conversation-rail-runtime.js"
|
|
95
95
|
},
|
|
96
|
+
"./conversation-rail-projection": {
|
|
97
|
+
"types": "./dist/conversation-rail-projection.d.ts",
|
|
98
|
+
"import": "./dist/conversation-rail-projection.js"
|
|
99
|
+
},
|
|
96
100
|
"./workspace-query-cache": {
|
|
97
101
|
"types": "./dist/workspace-query-cache.d.ts",
|
|
98
102
|
"import": "./dist/workspace-query-cache.js"
|
|
@@ -150,19 +154,19 @@
|
|
|
150
154
|
},
|
|
151
155
|
"dependencies": {
|
|
152
156
|
"@tanstack/react-virtual": "^3.13.12",
|
|
153
|
-
"@tutti-os/agent-activity-core": "0.0.
|
|
154
|
-
"@tutti-os/browser-node": "0.0.
|
|
155
|
-
"@tutti-os/ui-i18n-runtime": "0.0.
|
|
156
|
-
"@tutti-os/ui-react-hooks": "0.0.
|
|
157
|
-
"@tutti-os/ui-rich-text": "0.0.
|
|
158
|
-
"@tutti-os/ui-system": "0.0.
|
|
159
|
-
"@tutti-os/workbench-surface": "0.0.
|
|
160
|
-
"@tutti-os/workspace-external-core": "0.0.
|
|
161
|
-
"@tutti-os/workspace-file-manager": "0.0.
|
|
162
|
-
"@tutti-os/workspace-file-preview": "0.0.
|
|
163
|
-
"@tutti-os/workspace-file-reference": "0.0.
|
|
164
|
-
"@tutti-os/workspace-issue-manager": "0.0.
|
|
165
|
-
"@tutti-os/workspace-user-project": "0.0.
|
|
157
|
+
"@tutti-os/agent-activity-core": "0.0.231",
|
|
158
|
+
"@tutti-os/browser-node": "0.0.231",
|
|
159
|
+
"@tutti-os/ui-i18n-runtime": "0.0.231",
|
|
160
|
+
"@tutti-os/ui-react-hooks": "0.0.231",
|
|
161
|
+
"@tutti-os/ui-rich-text": "0.0.231",
|
|
162
|
+
"@tutti-os/ui-system": "0.0.231",
|
|
163
|
+
"@tutti-os/workbench-surface": "0.0.231",
|
|
164
|
+
"@tutti-os/workspace-external-core": "0.0.231",
|
|
165
|
+
"@tutti-os/workspace-file-manager": "0.0.231",
|
|
166
|
+
"@tutti-os/workspace-file-preview": "0.0.231",
|
|
167
|
+
"@tutti-os/workspace-file-reference": "0.0.231",
|
|
168
|
+
"@tutti-os/workspace-issue-manager": "0.0.231",
|
|
169
|
+
"@tutti-os/workspace-user-project": "0.0.231",
|
|
166
170
|
"clsx": "^2.1.1",
|
|
167
171
|
"framer-motion": "^12.40.0",
|
|
168
172
|
"lodash": "^4.17.21",
|
|
@@ -197,8 +201,8 @@
|
|
|
197
201
|
"typescript": "^5.8.3",
|
|
198
202
|
"vite": "^6.4.2",
|
|
199
203
|
"vitest": "^4.0.13",
|
|
200
|
-
"@tutti-os/
|
|
201
|
-
"@tutti-os/
|
|
204
|
+
"@tutti-os/client-tuttid-ts": "0.0.0",
|
|
205
|
+
"@tutti-os/config-tsconfig": "0.0.0"
|
|
202
206
|
},
|
|
203
207
|
"peerDependencies": {
|
|
204
208
|
"@tiptap/core": "^3.11.1",
|
|
@@ -283,6 +287,9 @@
|
|
|
283
287
|
"conversation-rail-runtime": [
|
|
284
288
|
"./dist/conversation-rail-runtime.d.ts"
|
|
285
289
|
],
|
|
290
|
+
"conversation-rail-projection": [
|
|
291
|
+
"./dist/conversation-rail-projection.d.ts"
|
|
292
|
+
],
|
|
286
293
|
"workspace-query-cache": [
|
|
287
294
|
"./dist/workspace-query-cache.d.ts"
|
|
288
295
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../contexts/settings/domain/agentSettings.providers.ts","../contexts/settings/domain/agentSettings.providerMeta.ts","../shared/agentConversationTitleProjection.ts","../workbench/sessionTitle.ts"],"sourcesContent":["export const AGENT_PROVIDERS = [\n \"claude-code\",\n \"codex\",\n \"cursor\",\n \"tutti-agent\",\n \"nexight\",\n \"opencode\",\n \"openclaw\"\n] as const;\nexport const EXPERIMENTAL_AGENT_PROVIDERS = [] as const;\n\nexport type AgentProvider = (typeof AGENT_PROVIDERS)[number];\n\nexport function isValidProvider(value: unknown): value is AgentProvider {\n return (\n typeof value === \"string\" &&\n AGENT_PROVIDERS.includes(value as AgentProvider)\n );\n}\n\nexport function normalizeAgentProviderOrder(value: unknown): AgentProvider[] {\n if (!Array.isArray(value)) {\n return [...AGENT_PROVIDERS];\n }\n\n const normalized: AgentProvider[] = [];\n const seen = new Set<AgentProvider>();\n\n for (const item of value) {\n if (!isValidProvider(item)) {\n continue;\n }\n\n if (seen.has(item)) {\n continue;\n }\n\n seen.add(item);\n normalized.push(item);\n }\n\n for (const provider of AGENT_PROVIDERS) {\n if (seen.has(provider)) {\n continue;\n }\n\n seen.add(provider);\n normalized.push(provider);\n }\n\n return normalized;\n}\n","import { resolveAgentGUIProviderCatalogIdentity } from \"../../../providerIdentityCatalog.ts\";\nimport {\n AGENT_PROVIDERS,\n type AgentProvider\n} from \"./agentSettings.providers.ts\";\n\nexport const AGENT_PROVIDER_LABEL = Object.fromEntries(\n AGENT_PROVIDERS.map((provider) => {\n const identity = resolveAgentGUIProviderCatalogIdentity(provider);\n if (!identity) {\n throw new Error(`Missing provider identity for ${provider}`);\n }\n return [provider, identity.displayName];\n })\n) as Record<AgentProvider, string>;\n\nexport interface AgentProviderCapabilities {\n runtimeObservation: \"jsonl\" | \"provider-api\" | \"none\";\n experimental: boolean;\n}\n\nexport const AGENT_PROVIDER_CAPABILITIES: Record<\n AgentProvider,\n AgentProviderCapabilities\n> = {\n \"claude-code\": {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n codex: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n \"tutti-agent\": {\n runtimeObservation: \"provider-api\",\n experimental: false\n },\n cursor: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n nexight: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n opencode: {\n runtimeObservation: \"provider-api\",\n experimental: false\n },\n openclaw: {\n runtimeObservation: \"jsonl\",\n experimental: false\n }\n};\n","import { AGENT_PROVIDER_LABEL } from \"../contexts/settings/domain/agentSettings.providerMeta.ts\";\nimport {\n isPendingActivationViable,\n type PendingActivationStatus,\n type AgentActivityMessage,\n type AgentPromptContentBlock\n} from \"@tutti-os/agent-activity-core\";\nimport {\n extractRichTextLinksFromContent,\n extractRichTextMentionsFromContent,\n removeRichTextMentionFromContent\n} from \"@tutti-os/ui-rich-text/core\";\nimport { translateInUiLanguage } from \"../i18n/runtime.ts\";\nimport { resolveAgentGUIProviderCatalogIdentity } from \"../providerIdentityCatalog.ts\";\nimport type { AgentGUIProvider } from \"../types.ts\";\nimport type { WorkspaceAgentActivityTimelineItem } from \"./workspaceAgentTimelineTypes.ts\";\nimport { normalizeAgentTitleText } from \"./utils/agentTitleText.ts\";\n\nexport type AgentGUIResolvedProvider = AgentGUIProvider | \"unknown\";\nexport type AgentGUIConversationTitleFallback = \"untitled-conversation\" | null;\nexport type AgentGUIConversationTitleLeadingMentionKind =\n | \"agent\"\n | \"app\"\n | \"file\"\n | \"session\"\n | \"task\";\n\nconst AGENT_GUI_UNRESOLVED_PROVIDER: AgentGUIResolvedProvider = \"unknown\";\nconst AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS = 120;\nconst AGENT_GUI_TRUNCATED_TITLE_SUFFIX = \"...\";\n\nexport function isAgentGUIProviderUnresolved(\n value: AgentGUIResolvedProvider\n): value is \"unknown\" {\n return value === AGENT_GUI_UNRESOLVED_PROVIDER;\n}\n\nexport interface AgentGUIConversationTitleMessage {\n id?: number | string | null;\n messageId?: string | null;\n version?: number | null;\n role?: string | null;\n kind?: string | null;\n payload?: {\n content?: unknown;\n displayPrompt?: unknown;\n text?: unknown;\n } | null;\n occurredAtUnixMs?: number | null;\n completedAtUnixMs?: number | null;\n startedAtUnixMs?: number | null;\n}\n\nexport function normalizeAgentGUIProviderIdentity(\n provider: string | null | undefined\n): AgentGUIResolvedProvider {\n const normalized = provider?.trim().toLowerCase() ?? \"\";\n const catalogIdentity = resolveAgentGUIProviderCatalogIdentity(normalized);\n if (catalogIdentity) {\n return catalogIdentity.providerId as AgentGUIProvider;\n }\n if (!/^[a-z][a-z0-9._:-]{0,127}$/.test(normalized)) {\n return \"unknown\";\n }\n return normalized as AgentGUIProvider;\n}\n\nfunction providerLabel(provider: AgentGUIProvider): string {\n return (AGENT_PROVIDER_LABEL as Record<string, string>)[provider] ?? provider;\n}\n\nexport function resolveAgentGUIProviderIdentity(input: {\n sessionProvider?: string | null;\n workspaceSessionProvider?: string | null;\n conversationProvider?: string | null;\n timelineItems?: readonly WorkspaceAgentActivityTimelineItem[];\n}): AgentGUIResolvedProvider {\n const candidates = [\n input.sessionProvider,\n input.workspaceSessionProvider,\n input.conversationProvider,\n timelineProviderHint(input.timelineItems ?? [])\n ];\n for (const candidate of candidates) {\n const normalized = normalizeAgentGUIProviderIdentity(candidate);\n if (normalized !== \"unknown\") {\n return normalized;\n }\n }\n return \"unknown\";\n}\n\nexport function resolveAgentGUIConversationTitle(\n title: string | null | undefined\n): {\n title: string;\n titleFallback: AgentGUIConversationTitleFallback;\n} {\n const normalizedTitle = stripAgentGUITitleTrailingPeriod(title?.trim() ?? \"\");\n if (normalizedTitle) {\n return {\n title: normalizedTitle,\n titleFallback: null\n };\n }\n return {\n title: \"\",\n titleFallback: \"untitled-conversation\"\n };\n}\n\nexport function deriveAgentGUIOptimisticConversationTitle(\n visiblePrompt: string | null | undefined\n): string {\n const normalizedTitle = normalizeAgentTitleText(visiblePrompt);\n const codePoints = Array.from(normalizedTitle);\n if (codePoints.length <= AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS) {\n return normalizedTitle;\n }\n return `${codePoints\n .slice(\n 0,\n AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS -\n AGENT_GUI_TRUNCATED_TITLE_SUFFIX.length\n )\n .join(\"\")\n .trimEnd()}${AGENT_GUI_TRUNCATED_TITLE_SUFFIX}`;\n}\n\nexport function resolveAgentGUIConversationTitleDisplayPrompt(input: {\n activation?: {\n content: readonly AgentPromptContentBlock[];\n displayPrompt?: string;\n mode: \"existing\" | \"new\";\n status: PendingActivationStatus;\n } | null;\n allowEmptyTitle?: boolean;\n firstUserDisplayPrompt?: string | null;\n messages?: readonly AgentActivityMessage[];\n title: string | null;\n}): string | null {\n const prompt = resolveAgentGUIConversationTitlePrompt(input);\n if (\n !prompt ||\n (extractRichTextMentionsFromContent(prompt).length === 0 &&\n extractRichTextLinksFromContent(prompt).length === 0) ||\n !agentGUITitleMatchesDerivedPrompt(\n input.title,\n prompt,\n input.allowEmptyTitle\n )\n ) {\n return null;\n }\n // Titles are presentation text, not an interactive rich-text surface. Keep\n // the mention label but discard its Markdown href before handing it to the\n // header/rail consumers so mention SVGs cannot leak into the chrome.\n return normalizeAgentTitleText(prompt);\n}\n\nexport function resolveAgentGUIConversationBrowserFreeTitle(input: {\n activation?: {\n content: readonly AgentPromptContentBlock[];\n displayPrompt?: string;\n mode: \"existing\" | \"new\";\n status: PendingActivationStatus;\n } | null;\n allowEmptyTitle?: boolean;\n firstUserDisplayPrompt?: string | null;\n messages?: readonly AgentActivityMessage[];\n title: string | null;\n}): string | null {\n const prompt = resolveAgentGUIConversationTitlePrompt(input);\n if (\n !prompt ||\n !agentGUITitleMatchesDerivedPrompt(\n input.title,\n prompt,\n input.allowEmptyTitle\n )\n ) {\n return input.title;\n }\n const presentationPrompt = removeAgentGUIBrowserElementMentions(prompt);\n return presentationPrompt === prompt\n ? input.title\n : deriveAgentGUIOptimisticConversationTitle(presentationPrompt);\n}\n\nexport function resolveAgentGUIConversationTitleLeadingMentionKind(\n _displayPrompt: string | null | undefined\n): AgentGUIConversationTitleLeadingMentionKind | null {\n return null;\n}\n\nfunction resolveAgentGUIConversationTitlePrompt(input: {\n activation?: {\n content: readonly AgentPromptContentBlock[];\n displayPrompt?: string;\n mode: \"existing\" | \"new\";\n status: PendingActivationStatus;\n } | null;\n firstUserDisplayPrompt?: string | null;\n messages?: readonly AgentActivityMessage[];\n}): string {\n const activationPrompt =\n input.activation?.mode === \"new\" &&\n isPendingActivationViable(input.activation)\n ? agentGUIActivationPromptText(\n input.activation.content,\n input.activation.displayPrompt ?? null\n )\n : \"\";\n return (\n activationPrompt ||\n input.firstUserDisplayPrompt?.trim() ||\n resolveAgentGUIFirstUserMessageDisplayPrompt(input.messages ?? [])\n );\n}\n\nfunction removeAgentGUIBrowserElementMentions(prompt: string): string {\n return extractRichTextMentionsFromContent(prompt)\n .filter((mention) => mention.providerId === \"browser-element\")\n .reduce(\n (content, mention) => removeRichTextMentionFromContent(content, mention),\n prompt\n );\n}\n\nexport function resolveAgentGUIFirstUserMessageDisplayPrompt(\n messages: readonly AgentActivityMessage[]\n): string {\n const message = messages.find(\n (candidate) =>\n candidate.role.trim().toLowerCase() === \"user\" &&\n candidate.kind.trim().toLowerCase() === \"text\"\n );\n if (!message) {\n return \"\";\n }\n return (\n agentGUIStringValue(message.payload.displayPrompt) ||\n agentGUIPromptTextFromUnknownContent(message.payload.content) ||\n agentGUIStringValue(message.payload.text) ||\n agentGUIStringValue(message.payload.content)\n );\n}\n\nfunction agentGUIPromptTextFromUnknownContent(content: unknown): string {\n if (!Array.isArray(content)) {\n return \"\";\n }\n return content\n .flatMap((value) => {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return [];\n }\n const block = value as Record<string, unknown>;\n return block.type === \"text\" && typeof block.text === \"string\"\n ? [block.text.trim()]\n : [];\n })\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nfunction agentGUIActivationPromptText(\n content: readonly AgentPromptContentBlock[],\n displayPrompt: string | null\n): string {\n const display = displayPrompt?.trim() ?? \"\";\n if (display) {\n return display;\n }\n return content\n .filter((block) => block.type === \"text\")\n .map((block) => block.text?.trim() ?? \"\")\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nfunction agentGUITitleMatchesDerivedPrompt(\n title: string | null,\n prompt: string,\n allowEmptyTitle = false\n): boolean {\n const canonicalTitle = title?.trim() ?? \"\";\n if (!canonicalTitle) {\n return allowEmptyTitle;\n }\n const derivedTitle = normalizeAgentTitleText(prompt);\n if (canonicalTitle === derivedTitle) {\n return true;\n }\n const runes = Array.from(derivedTitle);\n const truncatedDerivedTitle =\n runes.length > AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS\n ? `${runes\n .slice(\n 0,\n AGENT_GUI_MAX_OPTIMISTIC_TITLE_CODE_POINTS -\n AGENT_GUI_TRUNCATED_TITLE_SUFFIX.length\n )\n .join(\"\")\n .trim()}${AGENT_GUI_TRUNCATED_TITLE_SUFFIX}`\n : derivedTitle;\n return canonicalTitle === truncatedDerivedTitle;\n}\n\nfunction agentGUIStringValue(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\nexport function resolveAgentGUIConversationDisplayTitle(\n input: {\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n },\n untitledConversationLabel: string\n): string {\n if (input.title) {\n return stripAgentGUITitleTrailingPeriod(input.title.trim());\n }\n if (input.titleFallback === \"untitled-conversation\") {\n return stripAgentGUITitleTrailingPeriod(untitledConversationLabel);\n }\n return \"\";\n}\n\nexport function resolveAgentGUIDockConversationTitle(input: {\n provider: AgentGUIResolvedProvider;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n}): string | null {\n return resolveAgentGUIExplicitConversationTitle(input);\n}\n\nexport function resolveAgentGUIExplicitConversationTitle(input: {\n provider: AgentGUIResolvedProvider;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n}): string | null {\n if (input.titleFallback) {\n return null;\n }\n\n const title = stripAgentGUITitleTrailingPeriod(input.title.trim());\n if (!title) {\n return null;\n }\n if (isAgentGUIUntitledTaskTitle(title)) {\n return null;\n }\n\n if (input.provider !== \"unknown\" && title === providerLabel(input.provider)) {\n return null;\n }\n\n return title;\n}\n\nexport function resolveAgentGUIExplicitConversationTitleFromMessages(input: {\n messages: readonly AgentGUIConversationTitleMessage[];\n provider: AgentGUIResolvedProvider;\n title: string | null | undefined;\n}): string | null {\n const explicitTitle = resolveAgentGUIExplicitConversationTitle({\n provider: input.provider,\n title: input.title?.trim() ?? \"\"\n });\n if (explicitTitle) {\n return explicitTitle;\n }\n return resolveAgentGUIExplicitConversationTitle({\n provider: input.provider,\n title: firstAgentGUIUserMessageTitle(input.messages)\n });\n}\n\nexport function resolveAgentGUIProviderDisplayLabel(\n provider: string | null | undefined,\n fallbackAgentLabel: string\n): string {\n const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);\n if (resolvedProvider === \"unknown\") {\n return fallbackAgentLabel;\n }\n return providerLabel(resolvedProvider);\n}\n\nexport function firstAgentGUIUserMessageTitle(\n messages: readonly AgentGUIConversationTitleMessage[]\n): string {\n const userMessage = [...messages]\n .filter(\n (message) =>\n messageRole(message) === \"user\" && messageText(message).length > 0\n )\n .sort(compareMessagesAscending)[0];\n return userMessage ? messageText(userMessage) : \"\";\n}\n\nfunction messageRole(\n message: AgentGUIConversationTitleMessage\n): \"user\" | \"agent\" | null {\n const role = message.role?.trim().toLowerCase();\n if (role === \"user\") {\n return \"user\";\n }\n if (role === \"assistant\" || role === \"agent\") {\n return \"agent\";\n }\n const kind = message.kind?.trim().toLowerCase() ?? \"\";\n if (kind === \"message.user\") {\n return \"user\";\n }\n if (kind === \"message.assistant\" || kind === \"message.agent\") {\n return \"agent\";\n }\n return null;\n}\n\nfunction messageText(message: AgentGUIConversationTitleMessage): string {\n const payload = message.payload;\n const displayPrompt =\n typeof payload?.displayPrompt === \"string\" ? payload.displayPrompt : \"\";\n const text = typeof payload?.text === \"string\" ? payload.text : \"\";\n const content = typeof payload?.content === \"string\" ? payload.content : \"\";\n return normalizeAgentTitleText(displayPrompt || text || content);\n}\n\nfunction compareMessagesAscending(\n left: AgentGUIConversationTitleMessage,\n right: AgentGUIConversationTitleMessage\n): number {\n const leftTime =\n left.occurredAtUnixMs ??\n left.completedAtUnixMs ??\n left.startedAtUnixMs ??\n 0;\n const rightTime =\n right.occurredAtUnixMs ??\n right.completedAtUnixMs ??\n right.startedAtUnixMs ??\n 0;\n const timeDiff = leftTime - rightTime;\n if (timeDiff !== 0) {\n return timeDiff;\n }\n const sequenceDiff =\n messageSequence(left) - messageSequence(right) ||\n (left.messageId ?? \"\").localeCompare(right.messageId ?? \"\");\n return sequenceDiff;\n}\n\nfunction messageSequence(message: AgentGUIConversationTitleMessage): number {\n const numericId =\n typeof message.id === \"number\" && Number.isFinite(message.id)\n ? message.id\n : 0;\n return message.version ?? numericId;\n}\n\nfunction stripAgentGUITitleTrailingPeriod(title: string): string {\n return title\n .trimEnd()\n .replace(/[.。]+$/u, \"\")\n .trimEnd();\n}\n\nfunction isAgentGUIUntitledTaskTitle(title: string): boolean {\n return localizedAgentGUIUntitledTaskLabels().has(compactTitleText(title));\n}\n\nfunction localizedAgentGUIUntitledTaskLabels(): Set<string> {\n return new Set(\n ([\"en\", \"zh-CN\"] as const)\n .map((language) =>\n compactTitleText(\n translateInUiLanguage(\n language,\n \"agentHost.workspaceAgentsUntitledConversation\"\n )\n )\n )\n .filter(Boolean)\n );\n}\n\nfunction timelineProviderHint(\n timelineItems: readonly WorkspaceAgentActivityTimelineItem[]\n): string | null {\n for (const item of timelineItems) {\n if (isUserTimelineItem(item)) {\n continue;\n }\n const normalized = normalizeAgentGUIProviderIdentity(item.actorId);\n if (normalized !== \"unknown\") {\n return normalized;\n }\n }\n return null;\n}\n\nfunction isUserTimelineItem(item: WorkspaceAgentActivityTimelineItem): boolean {\n const role = item.role?.trim().toLowerCase();\n if (role === \"user\") {\n return true;\n }\n const actorType = item.actorType.trim().toLowerCase();\n if (actorType === \"user\") {\n return true;\n }\n return item.itemType.trim().toLowerCase() === \"message.user\";\n}\n\nfunction compactTitleText(value: string): string {\n return value.trim().replace(/\\s+/g, \" \");\n}\n","import type { AgentActivitySession } from \"@tutti-os/agent-activity-core\";\nimport { resolveAgentGUIProviderDisplayLabel } from \"../shared/agentConversationTitleProjection.ts\";\n\nexport interface ResolveAgentGuiWorkbenchHeaderTitleInput {\n agentName?: string | null;\n conversationTitle?: string | null;\n provider?: string | null;\n}\n\nexport interface ResolveAgentGuiWorkbenchSessionTitleInput {\n agentSessionId?: string | null;\n fallbackTitle?: string | null;\n optimisticTitle?: string | null;\n session?: Pick<AgentActivitySession, \"title\"> | null;\n}\n\nexport interface AgentGuiWorkbenchSessionTitleResult {\n agentSessionId: string | null;\n source: \"snapshot\" | \"optimistic\" | \"fallback\" | \"none\";\n title: string | null;\n}\n\nexport function resolveAgentGuiWorkbenchHeaderTitle({\n agentName,\n conversationTitle,\n provider\n}: ResolveAgentGuiWorkbenchHeaderTitleInput): string | null {\n return (\n stripTitle(agentName) ||\n stripTitle(resolveAgentGUIProviderDisplayLabel(provider, \"\")) ||\n stripTitle(conversationTitle) ||\n null\n );\n}\n\nexport function resolveAgentGuiWorkbenchSessionTitle({\n agentSessionId,\n fallbackTitle,\n optimisticTitle,\n session = null\n}: ResolveAgentGuiWorkbenchSessionTitleInput): AgentGuiWorkbenchSessionTitleResult {\n const normalizedAgentSessionId = agentSessionId?.trim() ?? \"\";\n if (!normalizedAgentSessionId) {\n return { agentSessionId: null, source: \"none\", title: null };\n }\n\n const snapshotTitle = stripTitle(session?.title);\n if (snapshotTitle) {\n return {\n agentSessionId: normalizedAgentSessionId,\n source: \"snapshot\",\n title: snapshotTitle\n };\n }\n\n const projectedOptimisticTitle = stripTitle(optimisticTitle);\n if (projectedOptimisticTitle) {\n return {\n agentSessionId: normalizedAgentSessionId,\n source: \"optimistic\",\n title: projectedOptimisticTitle\n };\n }\n\n if (session) {\n return {\n agentSessionId: normalizedAgentSessionId,\n source: \"none\",\n title: null\n };\n }\n\n const fallbackDisplayTitle = stripTitle(fallbackTitle);\n return fallbackDisplayTitle\n ? {\n agentSessionId: normalizedAgentSessionId,\n source: \"fallback\",\n title: fallbackDisplayTitle\n }\n : {\n agentSessionId: normalizedAgentSessionId,\n source: \"none\",\n title: null\n };\n}\n\nfunction stripTitle(value: string | null | undefined): string {\n return value?.trim() ?? \"\";\n}\n"],"mappings":";;;;;;;;;;;AAAO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACFO,IAAM,uBAAuB,OAAO;AAAA,EACzC,gBAAgB,IAAI,CAAC,aAAa;AAChC,UAAM,WAAW,uCAAuC,QAAQ;AAChE,QAAI,CAAC,UAAU;AACb,YAAM,IAAI,MAAM,iCAAiC,QAAQ,EAAE;AAAA,IAC7D;AACA,WAAO,CAAC,UAAU,SAAS,WAAW;AAAA,EACxC,CAAC;AACH;;;ACbA;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgBP,IAAM,gCAA0D;AAChE,IAAM,6CAA6C;AACnD,IAAM,mCAAmC;AAElC,SAAS,6BACd,OACoB;AACpB,SAAO,UAAU;AACnB;AAkBO,SAAS,kCACd,UAC0B;AAC1B,QAAM,aAAa,UAAU,KAAK,EAAE,YAAY,KAAK;AACrD,QAAM,kBAAkB,uCAAuC,UAAU;AACzE,MAAI,iBAAiB;AACnB,WAAO,gBAAgB;AAAA,EACzB;AACA,MAAI,CAAC,6BAA6B,KAAK,UAAU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