@tutti-os/agent-gui 0.0.17 → 0.0.19

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.
Files changed (49) hide show
  1. package/dist/{AgentMentionSearchController-DqssJ2-b.d.ts → AgentMentionSearchController-2Vjvmzh3.d.ts} +0 -1
  2. package/dist/agent-conversation/index.d.ts +1 -1
  3. package/dist/agent-conversation/index.js +5 -5
  4. package/dist/agent-message-center/index.d.ts +1 -1
  5. package/dist/agent-message-center/index.js +5 -5
  6. package/dist/{chunk-O5TUTXHT.js → chunk-222YHU5Z.js} +1 -1
  7. package/dist/chunk-222YHU5Z.js.map +1 -0
  8. package/dist/{chunk-VNAQ6QFE.js → chunk-5BVKJM77.js} +37 -15
  9. package/dist/chunk-5BVKJM77.js.map +1 -0
  10. package/dist/{chunk-VO2TZNKV.js → chunk-B727YDVW.js} +5 -5
  11. package/dist/{chunk-OJ5WX7SZ.js → chunk-B7DTDZVT.js} +2 -2
  12. package/dist/{chunk-CDTTIUPL.js → chunk-F7XLV7M3.js} +2 -2
  13. package/dist/{chunk-65YMY2M3.js → chunk-GLDKFIWM.js} +7 -3
  14. package/dist/chunk-GLDKFIWM.js.map +1 -0
  15. package/dist/{chunk-K44WER5Z.js → chunk-HFL5WGRF.js} +33 -49
  16. package/dist/chunk-HFL5WGRF.js.map +1 -0
  17. package/dist/{chunk-HIREVEZM.js → chunk-JM24HADP.js} +1 -1
  18. package/dist/chunk-JM24HADP.js.map +1 -0
  19. package/dist/{chunk-HVOPJU2K.js → chunk-SY3ES2SA.js} +5 -5
  20. package/dist/{chunk-KHTIC52P.js → chunk-XAQQN6MP.js} +51 -185
  21. package/dist/chunk-XAQQN6MP.js.map +1 -0
  22. package/dist/{chunk-GWR6WGZY.js → chunk-XHJQNUH4.js} +41 -28
  23. package/dist/chunk-XHJQNUH4.js.map +1 -0
  24. package/dist/context-mention-palette/index.d.ts +2 -2
  25. package/dist/context-mention-palette/index.js +7 -7
  26. package/dist/context-mention-provider.d.ts +4 -40
  27. package/dist/context-mention-provider.js +1 -1
  28. package/dist/i18n/index.d.ts +6 -2
  29. package/dist/i18n/index.js +1 -1
  30. package/dist/index.d.ts +15 -4
  31. package/dist/index.js +277 -78
  32. package/dist/index.js.map +1 -1
  33. package/dist/workbench/contribution.d.ts +1 -0
  34. package/dist/workbench/contribution.js +1 -1
  35. package/dist/workbench/index.js +1 -1
  36. package/dist/workspace-agent-generated-files.js +2 -2
  37. package/dist/{workspaceLinkActions-Mjktl_Be.d.ts → workspaceLinkActions-CqWZaCY4.d.ts} +1 -0
  38. package/package.json +12 -12
  39. package/dist/chunk-65YMY2M3.js.map +0 -1
  40. package/dist/chunk-GWR6WGZY.js.map +0 -1
  41. package/dist/chunk-HIREVEZM.js.map +0 -1
  42. package/dist/chunk-K44WER5Z.js.map +0 -1
  43. package/dist/chunk-KHTIC52P.js.map +0 -1
  44. package/dist/chunk-O5TUTXHT.js.map +0 -1
  45. package/dist/chunk-VNAQ6QFE.js.map +0 -1
  46. /package/dist/{chunk-VO2TZNKV.js.map → chunk-B727YDVW.js.map} +0 -0
  47. /package/dist/{chunk-OJ5WX7SZ.js.map → chunk-B7DTDZVT.js.map} +0 -0
  48. /package/dist/{chunk-CDTTIUPL.js.map → chunk-F7XLV7M3.js.map} +0 -0
  49. /package/dist/{chunk-HVOPJU2K.js.map → chunk-SY3ES2SA.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../agent-gui/agentGuiNode/agentRichText/agentFileMentionExtension.ts","../agent-gui/agentGuiNode/agentRichText/AgentMentionNodeView.tsx"],"sourcesContent":["import { mergeAttributes, Node, type Editor, type Range } from \"@tiptap/core\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport { ReactNodeViewRenderer } from \"@tiptap/react\";\nimport Suggestion, { exitSuggestion } from \"@tiptap/suggestion\";\nimport { isRichTextTriggerPrefixBoundary } from \"@tutti-os/ui-rich-text/editor\";\nimport {\n resolveAgentMentionFileThumbnailUrl,\n resolveAgentMentionFileVisualKind\n} from \"../../shared/mentionFilePresentation\";\nimport { translate } from \"../../../i18n/index\";\nimport { AgentMentionNodeView } from \"./AgentMentionNodeView\";\n\nexport type AgentFileMentionKind = \"file\" | \"directory\" | \"unknown\";\nexport type AgentMentionFileNavigationAction =\n | \"agent-generated-folder\"\n | \"agent-generated-folder-back\";\nexport type AgentMentionScope = \"my_sessions\" | \"collab_sessions\";\nexport type AgentMentionKind =\n | \"file\"\n | \"session\"\n | \"workspace-app\"\n | \"workspace-reference\"\n | \"workspace-app-factory\"\n | \"workspace-issue\";\n\n/** workspace-reference 句柄的来源(与 daemon `reference list --source` 一致)。 */\nexport type AgentMentionReferenceSource = \"app\" | \"task\";\n\nexport interface AgentMentionFileItem {\n kind: \"file\";\n path: string;\n href: string;\n name: string;\n entryKind: AgentFileMentionKind;\n directoryPath: string;\n score?: number;\n thumbnailUrl?: string | null;\n mentionNavigation?: AgentMentionFileNavigationAction;\n childCount?: number;\n}\n\nexport interface AgentMentionSessionItem {\n kind: \"session\";\n href: string;\n workspaceId: string;\n targetId: string;\n name: string;\n title: string;\n scope: AgentMentionScope;\n initiatorName: string;\n initiatorAvatarUrl?: string;\n agentName: string;\n status?: string;\n inputPreview?: string;\n summaryPreview?: string;\n updatedAtUnixMs?: number;\n}\n\nexport interface AgentMentionWorkspaceIssueItem {\n kind: \"workspace-issue\";\n href: string;\n workspaceId: string;\n targetId: string;\n topicId?: string;\n name: string;\n title: string;\n creatorName?: string;\n status?: string;\n contentPreview?: string;\n updatedAtUnixMs?: number;\n}\n\nexport interface AgentMentionWorkspaceAppItem {\n kind: \"workspace-app\";\n href: string;\n workspaceId: string;\n targetId: string;\n appId: string;\n name: string;\n description?: string;\n iconUrl?: string;\n /** 应用是否能够提供产物文件(reference),决定 @ 面板行末尾是否展示「查看产物文件」入口。 */\n referencesListSupported?: boolean;\n}\n\nexport interface AgentMentionWorkspaceReferenceItem {\n kind: \"workspace-reference\";\n href: string;\n workspaceId: string;\n /** URI path id:source=app 时为 appId,source=task 时为 topicId。 */\n targetId: string;\n source: AgentMentionReferenceSource;\n /** 子级 id:app 子分组 / issueId。缺省表示整个 app / topic。 */\n groupId?: string;\n name: string;\n iconUrl?: string;\n /** 展示用文件数(来自 picker 节点 childCount);序列化不再展开文件。 */\n fileCount: number;\n}\n\nexport interface AgentMentionWorkspaceAppFactoryItem {\n kind: \"workspace-app-factory\";\n href: string;\n workspaceId: string;\n targetId: string;\n jobId: string;\n name: string;\n action?: string;\n contextPath?: string;\n}\n\nexport type AgentContextMentionItem =\n | AgentMentionFileItem\n | AgentMentionSessionItem\n | AgentMentionWorkspaceAppItem\n | AgentMentionWorkspaceReferenceItem\n | AgentMentionWorkspaceAppFactoryItem\n | AgentMentionWorkspaceIssueItem;\n\nexport type AgentFileMentionItem = AgentContextMentionItem;\n\nexport interface AgentMentionSuggestionState {\n editor: Editor;\n range: Range;\n query: string;\n text: string;\n command: (item: AgentContextMentionItem) => void;\n clientRect?: (() => DOMRect | null) | null;\n}\n\nexport type AgentFileMentionSuggestionState = AgentMentionSuggestionState;\n\nexport interface AgentFileMentionExtensionOptions {\n enableSuggestions?: boolean;\n onSuggestionChange?: (state: AgentMentionSuggestionState | null) => void;\n onSuggestionKeyDown?: (event: KeyboardEvent) => boolean;\n removeActionAriaLabel?: string;\n renderAsLink?: boolean;\n}\n\nexport interface ParsedAgentMentionMarkdown {\n item: AgentContextMentionItem;\n end: number;\n}\n\nexport const agentFileMentionPluginKey = new PluginKey(\n \"agentFileMentionSuggestion\"\n);\n\nexport function exitAgentFileMentionSuggestion(editor: Editor): void {\n exitSuggestion(editor.view, agentFileMentionPluginKey);\n}\n\nexport function createAgentFileMentionExtension(\n options: AgentFileMentionExtensionOptions = {}\n): Node {\n return Node.create({\n name: \"agentFileMention\",\n group: \"inline\",\n inline: true,\n atom: true,\n selectable: false,\n\n addOptions() {\n return options;\n },\n\n addAttributes() {\n return {\n name: { default: \"\" },\n kind: { default: \"file\" },\n href: { default: \"\" },\n path: { default: \"\" },\n entryKind: { default: \"unknown\" },\n directoryPath: { default: \"\" },\n workspaceId: { default: \"\" },\n targetId: { default: \"\" },\n scope: { default: \"\" },\n title: { default: \"\" },\n initiatorName: { default: \"\" },\n agentName: { default: \"\" },\n status: { default: \"\" },\n inputPreview: { default: \"\" },\n summaryPreview: { default: \"\" },\n creatorName: { default: \"\" },\n topicId: { default: \"\" },\n appId: { default: \"\" },\n jobId: { default: \"\" },\n action: { default: \"\" },\n contextPath: { default: \"\" },\n description: { default: \"\" },\n iconUrl: { default: \"\" },\n contentPreview: { default: \"\" },\n thumbnailUrl: { default: \"\" },\n source: { default: \"\" },\n groupId: { default: \"\" },\n fileCount: { default: \"\" }\n };\n },\n\n parseHTML() {\n return [\n {\n tag: \"span[data-agent-file-mention]\",\n getAttrs: parseAgentMentionHTMLElementAttrs\n },\n {\n tag: \"a[data-agent-file-mention]\",\n getAttrs: parseAgentMentionHTMLElementAttrs\n }\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n const item = attrsToMentionItem(HTMLAttributes);\n const fileThumbnailUrl =\n item.kind === \"file\"\n ? resolveAgentMentionFileThumbnailUrl(item)\n : undefined;\n const href = item.href;\n const tagName = options.renderAsLink ? \"a\" : \"span\";\n const visual = mentionVisual(item);\n const sessionVisual =\n item.kind === \"session\" ? sessionMentionVisual(item) : null;\n const sharedAttributes = {\n \"data-agent-file-mention\": \"true\",\n \"data-agent-mention-href\": href,\n \"data-agent-mention-kind\": item.kind,\n \"aria-label\":\n item.kind === \"file\"\n ? visual.primary\n : `${visual.kindLabel} ${visual.primary}`.trim()\n };\n return [\n tagName,\n mergeAttributes(HTMLAttributes, {\n ...sharedAttributes,\n ...(item.kind === \"file\"\n ? {\n \"data-agent-file-entry-kind\": item.entryKind,\n \"data-agent-file-directory-path\": item.directoryPath,\n \"data-agent-file-visual-kind\":\n resolveAgentMentionFileVisualKind(item)\n }\n : {}),\n ...(options.renderAsLink ? { href } : {}),\n ...((item.kind === \"workspace-app\" ||\n item.kind === \"workspace-reference\") &&\n item.iconUrl\n ? { \"data-agent-mention-icon-url\": item.iconUrl }\n : {}),\n ...(item.kind === \"workspace-reference\"\n ? { \"data-agent-mention-file-count\": String(item.fileCount) }\n : {}),\n ...(fileThumbnailUrl\n ? { \"data-agent-mention-thumbnail-url\": fileThumbnailUrl }\n : {}),\n class:\n item.kind === \"file\"\n ? \"tsh-agent-object-token tsh-agent-object-token--file\"\n : \"tsh-agent-object-token tsh-agent-object-token--entity\"\n }),\n ...(item.kind === \"file\"\n ? [\n fileThumbnailUrl\n ? [\n \"span\",\n {\n class: \"agent-gui-node__mention-file-thumb\",\n \"data-agent-mention-file-thumb\": \"true\",\n \"aria-hidden\": \"true\"\n },\n [\n \"img\",\n {\n src: fileThumbnailUrl,\n alt: \"\",\n decoding: \"async\",\n loading: \"lazy\",\n draggable: \"false\"\n }\n ]\n ]\n : [\n \"span\",\n {\n class: \"tsh-agent-object-token__icon\",\n \"aria-hidden\": \"true\"\n },\n \"\"\n ],\n [\n \"span\",\n { class: \"tsh-agent-object-token__main\" },\n visual.primary\n ]\n ]\n : item.kind === \"session\"\n ? [\n [\n \"span\",\n {\n class: \"tsh-agent-object-token__kind\",\n \"aria-hidden\": \"true\"\n },\n [\n \"span\",\n {\n class: \"tsh-agent-object-token__kind-icon\",\n \"aria-hidden\": \"true\"\n },\n \"\"\n ]\n ],\n [\n \"span\",\n { class: \"tsh-agent-object-token__main\" },\n [\n \"span\",\n { class: \"tsh-agent-object-token__participant\" },\n sessionVisual?.participant ?? \"\"\n ],\n [\n \"span\",\n { class: \"tsh-agent-object-token__summary\" },\n sessionVisual?.summary ? ` ${sessionVisual.summary}` : \"\"\n ]\n ]\n ]\n : [\n [\n \"span\",\n {\n class: \"tsh-agent-object-token__kind\",\n \"aria-hidden\": \"true\"\n },\n [\n \"span\",\n {\n class: \"tsh-agent-object-token__kind-icon\",\n \"aria-hidden\": \"true\"\n },\n \"\"\n ]\n ],\n [\n \"span\",\n { class: \"tsh-agent-object-token__main\" },\n visual.primary\n ]\n ])\n ];\n },\n\n renderText({ node }) {\n return formatAgentMentionMarkdown(attrsToMentionItem(node.attrs ?? {}));\n },\n\n addNodeView() {\n return ReactNodeViewRenderer(AgentMentionNodeView);\n },\n\n addProseMirrorPlugins() {\n if (options.enableSuggestions === false) {\n return [];\n }\n return [\n Suggestion<AgentContextMentionItem, AgentContextMentionItem>({\n editor: this.editor,\n pluginKey: agentFileMentionPluginKey,\n char: \"@\",\n allowedPrefixes: [\" \", \"\\n\", \"\\t\"],\n allowSpaces: true,\n items: () => [],\n allow: ({ state, range }) => {\n if (range.from <= 1) {\n return true;\n }\n const previous = state.doc.textBetween(\n range.from - 1,\n range.from,\n \"\\n\",\n \"\\n\"\n );\n return isRichTextTriggerPrefixBoundary(previous, \"whitespace\");\n },\n command: ({ editor, range, props }) => {\n editor\n .chain()\n .focus()\n .insertContentAt(range, [\n {\n type: this.name,\n attrs: mentionItemToAttrs(props)\n },\n { type: \"text\", text: \" \" }\n ])\n .run();\n },\n render: () => ({\n onStart: (props) => {\n options.onSuggestionChange?.({\n editor: props.editor,\n range: props.range,\n query: props.query,\n text: props.text,\n command: props.command,\n clientRect: props.clientRect\n });\n },\n onUpdate: (props) => {\n options.onSuggestionChange?.({\n editor: props.editor,\n range: props.range,\n query: props.query,\n text: props.text,\n command: props.command,\n clientRect: props.clientRect\n });\n },\n onExit: () => {\n options.onSuggestionChange?.(null);\n },\n onKeyDown: (props) =>\n options.onSuggestionKeyDown?.(props.event) ?? false\n })\n })\n ];\n }\n });\n}\n\nexport function buildAgentSessionMentionHref(\n workspaceId: string,\n agentSessionId: string,\n _provider?: string | null\n): string {\n return buildAgentGenericMentionHref(\"agent-session\", agentSessionId, {\n workspaceId\n });\n}\n\nexport function buildAgentWorkspaceIssueMentionHref(\n workspaceId: string,\n issueId: string,\n input?: {\n mode?: \"breakdown\" | \"execute\";\n outputDir?: string | null;\n runId?: string | null;\n taskId?: string | null;\n topicId?: string | null;\n }\n): string {\n return buildAgentGenericMentionHref(\"workspace-issue\", issueId, {\n workspaceId,\n topicId: input?.topicId ?? undefined\n });\n}\n\nexport function buildAgentWorkspaceAppMentionHref(\n workspaceId: string,\n appId: string\n): string {\n return buildAgentGenericMentionHref(\"workspace-app\", appId, {\n workspaceId\n });\n}\n\nexport function buildAgentWorkspaceReferenceMentionHref(\n workspaceId: string,\n handle: {\n source: AgentMentionReferenceSource;\n id: string;\n groupId?: string | null;\n },\n options?: { iconUrl?: string | null; fileCount?: number }\n): string {\n // 只编可被 daemon/CLI 解析的领域句柄(source + id + groupId);不再夹带文件路径。\n // icon / count 仅供展示侧渲染(对话流图标、chip 文件数),不影响 agent 解析。\n return buildAgentGenericMentionHref(\"workspace-reference\", handle.id, {\n workspaceId,\n source: handle.source,\n groupId: handle.groupId?.trim() || undefined,\n icon: options?.iconUrl?.trim() || undefined,\n count:\n options?.fileCount != null && options.fileCount > 0\n ? String(options.fileCount)\n : undefined\n });\n}\n\nexport function buildAgentWorkspaceAppFactoryMentionHref(\n workspaceId?: string | null,\n jobId?: string | null,\n input?: { action?: string | null; contextPath?: string | null }\n): string {\n const params = new URLSearchParams();\n const trimmedWorkspaceId = workspaceId?.trim() ?? \"\";\n const trimmedJobId = jobId?.trim() ?? \"\";\n const action = input?.action?.trim() ?? \"\";\n const contextPath = input?.contextPath?.trim() ?? \"\";\n if (trimmedWorkspaceId) {\n params.set(\"workspaceId\", trimmedWorkspaceId);\n }\n if (trimmedJobId) {\n params.set(\"jobId\", trimmedJobId);\n }\n if (action) {\n params.set(\"action\", action);\n }\n if (contextPath) {\n params.set(\"contextPath\", contextPath);\n }\n return buildAgentGenericMentionHref(\n \"workspace-app-factory\",\n trimmedJobId || \"create\",\n Object.fromEntries(params)\n );\n}\n\nexport function normalizeAgentSessionMentionTitle(value: string): string {\n const trimmed = value.trim();\n const withoutMentionPrefix = trimmed.replace(/^@+/, \"\").trim();\n return withoutMentionPrefix || trimmed;\n}\n\nexport function formatAgentFileMentionMarkdown(\n name: string,\n path: string\n): string {\n return formatAgentMentionMarkdown({\n kind: \"file\",\n href: path,\n path,\n name,\n entryKind: \"unknown\",\n directoryPath: \"\"\n });\n}\n\nexport function formatAgentMentionMarkdown(\n item: AgentContextMentionItem\n): string {\n // 所有 entity(含 workspace-reference)统一序列化成单条 mention 链接。\n // workspace-reference 不再展开成文件路径——agent 拿到 URI 后经 skill+CLI 按需解析。\n const label = item.name.trim().startsWith(\"@\") ? item.name : `@${item.name}`;\n return `[${escapeMarkdownLinkLabel(label)}](${escapeMarkdownLinkTarget(item.href)})`;\n}\n\nfunction parseMentionFileCount(value: unknown): number {\n const parsed =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\"\n ? Number.parseInt(value.trim(), 10)\n : Number.NaN;\n return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;\n}\n\nexport function parseAgentMentionMarkdown(\n value: string,\n start = 0\n): ParsedAgentMentionMarkdown | null {\n if (!value.startsWith(\"[\", start)) {\n return null;\n }\n\n let index = start + 1;\n const prefixedMention = value[index] === \"@\";\n if (prefixedMention) {\n index += 1;\n }\n let name = \"\";\n while (index < value.length) {\n const current = value[index];\n if (current === \"\\\\\") {\n const escaped = value[index + 1];\n if (escaped === \"\\\\\" || escaped === \"[\" || escaped === \"]\") {\n name += escaped;\n index += 2;\n continue;\n }\n name += current;\n index += 1;\n continue;\n }\n if (current === \"]\") {\n break;\n }\n name += current;\n index += 1;\n }\n\n if (value[index] !== \"]\" || value[index + 1] !== \"(\") {\n return null;\n }\n\n index += 2;\n let href = \"\";\n while (index < value.length) {\n const current = value[index];\n if (current === \"\\\\\") {\n const escaped = value[index + 1];\n if (escaped === \"\\\\\" || escaped === \")\") {\n href += escaped;\n index += 2;\n continue;\n }\n href += current;\n index += 1;\n continue;\n }\n if (current === \")\") {\n const item = parseMentionItemFromHref({ name, href });\n if (!item) {\n return null;\n }\n if (\n item.kind !== \"file\" &&\n !prefixedMention &&\n !href.trim().toLowerCase().startsWith(\"mention://\")\n ) {\n return null;\n }\n return {\n item,\n end: index + 1\n };\n }\n href += current;\n index += 1;\n }\n\n return null;\n}\n\nexport function parseMentionItemFromHref(input: {\n name: string;\n href: string;\n}): AgentContextMentionItem | null {\n const href = input.href.trim();\n if (!href) {\n return null;\n }\n if (!href.startsWith(\"mention://\")) {\n return {\n kind: \"file\",\n href,\n path: href,\n name: input.name,\n entryKind: isLocalDirectoryMentionHref(href) ? \"directory\" : \"unknown\",\n directoryPath: dirnameFromPath(href)\n };\n }\n\n let url: URL;\n try {\n url = new URL(href);\n } catch {\n return null;\n }\n const resource = url.hostname.trim().toLowerCase();\n if (!resource || hasLegacyMentionQueryParams(url)) {\n return null;\n }\n const targetId = decodeURIComponent(url.pathname.replace(/^\\/+/, \"\")).trim();\n if (!targetId) {\n return null;\n }\n const workspaceId = workspaceIdFromMentionUrl(url);\n if (resource === \"agent-session\") {\n if (!workspaceId) {\n return null;\n }\n return {\n kind: \"session\",\n href,\n workspaceId,\n targetId,\n name: input.name,\n title: input.name,\n scope: \"collab_sessions\",\n initiatorName: \"\",\n agentName: \"\"\n };\n }\n if (resource === \"workspace-issue\") {\n if (!workspaceId) {\n return null;\n }\n return {\n kind: \"workspace-issue\",\n href,\n workspaceId,\n targetId,\n topicId: url.searchParams.get(\"topicId\")?.trim() || undefined,\n name: input.name,\n title: input.name\n };\n }\n if (resource === \"workspace-app\") {\n if (!workspaceId) {\n return null;\n }\n return {\n kind: \"workspace-app\",\n href,\n workspaceId,\n targetId,\n appId: targetId,\n name: input.name\n };\n }\n if (resource === \"workspace-reference\") {\n if (!workspaceId) {\n return null;\n }\n const source = url.searchParams.get(\"source\")?.trim();\n if (source !== \"app\" && source !== \"task\") {\n return null;\n }\n return {\n kind: \"workspace-reference\",\n href,\n workspaceId,\n targetId,\n source,\n groupId: url.searchParams.get(\"groupId\")?.trim() || undefined,\n name: input.name,\n iconUrl: url.searchParams.get(\"icon\")?.trim() || undefined,\n fileCount: parseMentionFileCount(url.searchParams.get(\"count\"))\n };\n }\n if (resource === \"workspace-app-factory\") {\n return {\n kind: \"workspace-app-factory\",\n href,\n workspaceId,\n targetId,\n jobId: targetId === \"create\" ? \"\" : targetId,\n name:\n input.name ||\n translate(\"agentHost.agentGui.workspaceAppFactoryMentionFallback\"),\n action: url.searchParams.get(\"action\")?.trim() || undefined,\n contextPath: url.searchParams.get(\"contextPath\")?.trim() || undefined\n };\n }\n return null;\n}\n\nfunction isLocalDirectoryMentionHref(href: string): boolean {\n return href.endsWith(\"/\") && !/^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(href);\n}\n\nexport function mentionItemToAttrs(\n item: AgentContextMentionItem\n): Record<string, string> {\n if (item.kind === \"file\") {\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n path: item.path,\n entryKind: item.entryKind,\n directoryPath: item.directoryPath,\n thumbnailUrl: resolveAgentMentionFileThumbnailUrl(item) ?? \"\"\n };\n }\n if (item.kind === \"session\") {\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n ...workspaceMentionAttrs(item.workspaceId),\n targetId: item.targetId,\n scope: item.scope,\n title: item.title,\n initiatorName: item.initiatorName,\n agentName: item.agentName,\n status: item.status ?? \"\",\n inputPreview: item.inputPreview ?? \"\",\n summaryPreview: item.summaryPreview ?? \"\"\n };\n }\n if (item.kind === \"workspace-app\") {\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n ...workspaceMentionAttrs(item.workspaceId),\n targetId: item.targetId,\n appId: item.appId,\n description: item.description ?? \"\",\n iconUrl: item.iconUrl ?? \"\"\n };\n }\n if (item.kind === \"workspace-reference\") {\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n ...workspaceMentionAttrs(item.workspaceId),\n targetId: item.targetId,\n source: item.source,\n groupId: item.groupId ?? \"\",\n iconUrl: item.iconUrl ?? \"\",\n fileCount: String(item.fileCount)\n };\n }\n if (item.kind === \"workspace-app-factory\") {\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n ...workspaceMentionAttrs(item.workspaceId),\n targetId: item.targetId,\n jobId: item.jobId,\n action: item.action ?? \"\",\n contextPath: item.contextPath ?? \"\"\n };\n }\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n ...workspaceMentionAttrs(item.workspaceId),\n targetId: item.targetId,\n topicId: item.topicId ?? \"\",\n title: item.title,\n creatorName: item.creatorName ?? \"\",\n status: item.status ?? \"\",\n contentPreview: item.contentPreview ?? \"\"\n };\n}\n\nfunction workspaceMentionAttrs(\n workspaceId: string\n): Pick<AgentMentionSessionItem, \"workspaceId\"> {\n const normalizedWorkspaceId = workspaceId.trim();\n return {\n workspaceId: normalizedWorkspaceId\n };\n}\n\nexport function attrsToMentionItem(\n attrs: Record<string, unknown>\n): AgentContextMentionItem {\n const kind = normalizeMentionKind(attrs.kind);\n const name = typeof attrs.name === \"string\" ? attrs.name : \"\";\n const href =\n typeof attrs.href === \"string\" && attrs.href.trim() ? attrs.href : \"\";\n if (kind === \"session\") {\n const workspaceId = workspaceIdFromMentionAttrs(attrs);\n const targetId = typeof attrs.targetId === \"string\" ? attrs.targetId : \"\";\n return {\n kind,\n href: href || buildAgentSessionMentionHref(workspaceId, targetId),\n workspaceId,\n targetId,\n name,\n title:\n typeof attrs.title === \"string\" && attrs.title.trim()\n ? attrs.title\n : name,\n scope:\n attrs.scope === \"my_sessions\" || attrs.scope === \"collab_sessions\"\n ? attrs.scope\n : \"collab_sessions\",\n initiatorName:\n typeof attrs.initiatorName === \"string\" ? attrs.initiatorName : \"\",\n agentName: typeof attrs.agentName === \"string\" ? attrs.agentName : \"\",\n status: typeof attrs.status === \"string\" ? attrs.status : undefined,\n inputPreview:\n typeof attrs.inputPreview === \"string\" ? attrs.inputPreview : undefined,\n summaryPreview:\n typeof attrs.summaryPreview === \"string\"\n ? attrs.summaryPreview\n : undefined\n };\n }\n if (kind === \"workspace-issue\") {\n const workspaceId = workspaceIdFromMentionAttrs(attrs);\n const targetId = typeof attrs.targetId === \"string\" ? attrs.targetId : \"\";\n const topicId =\n typeof attrs.topicId === \"string\" && attrs.topicId.trim()\n ? attrs.topicId.trim()\n : undefined;\n return {\n kind,\n href:\n href ||\n buildAgentWorkspaceIssueMentionHref(workspaceId, targetId, {\n topicId\n }),\n workspaceId,\n targetId,\n topicId,\n name,\n title:\n typeof attrs.title === \"string\" && attrs.title.trim()\n ? attrs.title\n : name,\n creatorName:\n typeof attrs.creatorName === \"string\" ? attrs.creatorName : undefined,\n status: typeof attrs.status === \"string\" ? attrs.status : undefined,\n contentPreview:\n typeof attrs.contentPreview === \"string\"\n ? attrs.contentPreview\n : undefined\n };\n }\n if (kind === \"workspace-app\") {\n const workspaceId = workspaceIdFromMentionAttrs(attrs);\n const appId =\n typeof attrs.appId === \"string\" && attrs.appId.trim()\n ? attrs.appId.trim()\n : typeof attrs.targetId === \"string\"\n ? attrs.targetId.trim()\n : \"\";\n return {\n kind,\n href: href || buildAgentWorkspaceAppMentionHref(workspaceId, appId),\n workspaceId,\n targetId: appId,\n appId,\n name,\n description:\n typeof attrs.description === \"string\" ? attrs.description : undefined,\n iconUrl:\n typeof attrs.iconUrl === \"string\" && attrs.iconUrl.trim()\n ? attrs.iconUrl.trim()\n : undefined\n };\n }\n if (kind === \"workspace-reference\") {\n const workspaceId = workspaceIdFromMentionAttrs(attrs);\n const targetId =\n typeof attrs.targetId === \"string\" ? attrs.targetId.trim() : \"\";\n const source: AgentMentionReferenceSource =\n attrs.source === \"task\" ? \"task\" : \"app\";\n const groupId =\n typeof attrs.groupId === \"string\" && attrs.groupId.trim()\n ? attrs.groupId.trim()\n : undefined;\n const iconUrl =\n typeof attrs.iconUrl === \"string\" && attrs.iconUrl.trim()\n ? attrs.iconUrl.trim()\n : undefined;\n const fileCount = parseMentionFileCount(attrs.fileCount);\n return {\n kind,\n href:\n href ||\n buildAgentWorkspaceReferenceMentionHref(\n workspaceId,\n { source, id: targetId, groupId },\n { iconUrl, fileCount }\n ),\n workspaceId,\n targetId,\n source,\n groupId,\n name,\n iconUrl,\n fileCount\n };\n }\n if (kind === \"workspace-app-factory\") {\n const workspaceId = workspaceIdFromMentionAttrs(attrs);\n const jobId =\n typeof attrs.jobId === \"string\" && attrs.jobId.trim()\n ? attrs.jobId.trim()\n : typeof attrs.targetId === \"string\"\n ? attrs.targetId.trim()\n : \"\";\n const action =\n typeof attrs.action === \"string\" && attrs.action.trim()\n ? attrs.action.trim()\n : undefined;\n const contextPath =\n typeof attrs.contextPath === \"string\" && attrs.contextPath.trim()\n ? attrs.contextPath.trim()\n : undefined;\n return {\n kind,\n href:\n href ||\n buildAgentWorkspaceAppFactoryMentionHref(workspaceId, jobId, {\n action,\n contextPath\n }),\n workspaceId,\n targetId: jobId,\n jobId,\n name,\n action,\n contextPath\n };\n }\n const path =\n typeof attrs.path === \"string\" && attrs.path.trim()\n ? attrs.path\n : typeof attrs.href === \"string\"\n ? attrs.href\n : \"\";\n return {\n kind: \"file\",\n href: href || path,\n path,\n name,\n entryKind: normalizeEntryKind(attrs.entryKind),\n directoryPath:\n typeof attrs.directoryPath === \"string\" && attrs.directoryPath.trim()\n ? attrs.directoryPath\n : dirnameFromPath(path),\n thumbnailUrl: resolveAgentMentionFileThumbnailUrl({\n entryKind: normalizeEntryKind(attrs.entryKind),\n href: href || path,\n name,\n path,\n thumbnailUrl:\n typeof attrs.thumbnailUrl === \"string\" ? attrs.thumbnailUrl : undefined\n })\n };\n}\n\nfunction workspaceIdFromMentionAttrs(attrs: Record<string, unknown>): string {\n return typeof attrs.workspaceId === \"string\" ? attrs.workspaceId.trim() : \"\";\n}\n\nfunction parseAgentMentionHTMLElementAttrs(\n node: HTMLElement | string\n): Record<string, string> | false {\n if (typeof node === \"string\") {\n return false;\n }\n const href =\n node.getAttribute(\"data-agent-mention-href\") ||\n node.getAttribute(\"data-agent-link-href\") ||\n node.getAttribute(\"href\") ||\n \"\";\n const name =\n node.getAttribute(\"name\") ||\n (node.textContent ?? \"\").replace(/^@+/, \"\").trim();\n const parsedItem = href ? parseMentionItemFromHref({ name, href }) : null;\n const parsedAttrs = parsedItem ? mentionItemToAttrs(parsedItem) : {};\n const iconUrl = node.getAttribute(\"data-agent-mention-icon-url\") || \"\";\n const fileCount = node.getAttribute(\"data-agent-mention-file-count\") || \"\";\n return {\n ...parsedAttrs,\n name,\n kind:\n node.getAttribute(\"data-agent-mention-kind\") ||\n node.getAttribute(\"kind\") ||\n parsedAttrs.kind ||\n \"file\",\n href,\n ...(iconUrl ? { iconUrl } : {}),\n ...(fileCount ? { fileCount } : {})\n };\n}\n\nfunction workspaceIdFromMentionUrl(url: URL): string {\n return url.searchParams.get(\"workspaceId\")?.trim() ?? \"\";\n}\n\nexport function buildAgentGenericMentionHref(\n providerId: string,\n entityId: string,\n scope?: Readonly<Record<string, string | null | undefined>>\n): string {\n const normalizedProviderId = providerId.trim();\n const normalizedEntityId = entityId.trim();\n if (!normalizedProviderId || !normalizedEntityId) {\n return \"\";\n }\n const params = new URLSearchParams();\n Object.entries(scope ?? {})\n .map(([key, value]) => [key.trim(), value?.trim() ?? \"\"] as const)\n .filter(([key, value]) => key && value)\n .sort(([left], [right]) => left.localeCompare(right))\n .forEach(([key, value]) => {\n params.set(key, value);\n });\n const query = params.toString();\n const href = `mention://${encodeURIComponent(\n normalizedProviderId\n )}/${encodeURIComponent(normalizedEntityId)}`;\n return query ? `${href}?${query}` : href;\n}\n\nfunction hasLegacyMentionQueryParams(url: URL): boolean {\n return [...url.searchParams.keys()].some(\n (key) =>\n key === \"appId\" ||\n key === \"id\" ||\n key === \"kind\" ||\n key === \"link\" ||\n key === \"provider\" ||\n key === \"v\" ||\n key === \"version\" ||\n key.startsWith(\"meta.\")\n );\n}\n\nfunction normalizeMentionKind(value: unknown): AgentMentionKind {\n if (value === \"session\" || value === \"agent-session\") {\n return \"session\";\n }\n if (value === \"workspace-issue\") {\n return \"workspace-issue\";\n }\n if (value === \"workspace-app\") {\n return \"workspace-app\";\n }\n if (value === \"workspace-reference\") {\n return \"workspace-reference\";\n }\n if (value === \"workspace-app-factory\") {\n return \"workspace-app-factory\";\n }\n return \"file\";\n}\n\nfunction normalizeEntryKind(value: unknown): AgentFileMentionKind {\n return value === \"directory\" || value === \"file\" ? value : \"unknown\";\n}\n\nfunction mentionVisual(item: AgentContextMentionItem): {\n kindLabel: string;\n primary: string;\n} {\n if (item.kind === \"file\") {\n return {\n kindLabel: \"File\",\n primary: item.name\n };\n }\n if (item.kind === \"session\") {\n const visual = sessionMentionVisual(item);\n return {\n kindLabel: \"Session\",\n primary: `${visual.participant} ${visual.summary}`.trim()\n };\n }\n if (item.kind === \"workspace-app\") {\n return {\n kindLabel: \"App\",\n primary: item.name\n };\n }\n if (item.kind === \"workspace-app-factory\") {\n return {\n kindLabel: \"App Factory\",\n primary: item.name\n };\n }\n if (item.kind === \"workspace-reference\") {\n return {\n kindLabel: \"Reference\",\n primary: item.name\n };\n }\n return {\n kindLabel: \"Task\",\n primary: item.name\n };\n}\n\nfunction sessionMentionVisual(\n item: Extract<AgentContextMentionItem, { kind: \"session\" }>\n): {\n participant: string;\n summary: string;\n} {\n const initiatorName = item.initiatorName.trim();\n const agentName = item.agentName.trim();\n const title = normalizeAgentSessionMentionTitle(item.title);\n if (initiatorName && agentName) {\n const dottedTitle = parseDottedSessionMentionText(title);\n return {\n participant: `${initiatorName} & ${agentName}`,\n summary:\n dottedTitle?.summary ||\n (title && title !== item.name.trim()\n ? title\n : item.inputPreview?.trim() || \"\")\n };\n }\n\n const dottedName = parseDottedSessionMentionText(item.name);\n if (dottedName) {\n return {\n participant: dottedName.participant,\n summary: dottedName.summary\n };\n }\n\n return {\n participant: item.name.trim(),\n summary:\n title && title !== item.name.trim()\n ? title\n : item.inputPreview?.trim() || \"\"\n };\n}\n\nfunction parseDottedSessionMentionText(\n value: string\n): { participant: string; summary: string } | null {\n const parts = value\n .split(\"·\")\n .map((part) => part.trim())\n .filter(Boolean);\n if (parts.length < 3) {\n return null;\n }\n return {\n participant: `${parts[0]} & ${parts[1]}`,\n summary: normalizeAgentSessionMentionTitle(parts.slice(2).join(\" \"))\n };\n}\n\nfunction dirnameFromPath(path: string): string {\n const parts = path.split(\"/\").filter(Boolean);\n if (parts.length <= 1) {\n return path.startsWith(\"/\") ? \"/\" : \"\";\n }\n return `/${parts.slice(0, -1).join(\"/\")}`;\n}\n\nfunction escapeMarkdownLinkLabel(value: string): string {\n return value.replace(/([\\\\[\\]])/g, \"\\\\$1\");\n}\n\nfunction escapeMarkdownLinkTarget(value: string): string {\n return value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\)/g, \"\\\\)\");\n}\n","import { useEffect, useState, type JSX, type MouseEvent } from \"react\";\nimport { NodeViewWrapper, type NodeViewProps } from \"@tiptap/react\";\nimport {\n MentionPill,\n TruncatingPillLabel\n} from \"@tutti-os/ui-system/components\";\nimport { CloseIcon } from \"@tutti-os/ui-system/icons\";\nimport { useTranslation } from \"../../../i18n/index\";\nimport {\n resolveAgentMentionFileThumbnailUrl,\n resolveAgentMentionFileVisualKind\n} from \"../../shared/mentionFilePresentation\";\n\ntype AgentMentionNodeViewKind =\n | \"file\"\n | \"session\"\n | \"workspace-app\"\n | \"workspace-reference\"\n | \"workspace-app-factory\"\n | \"workspace-issue\";\n\nfunction parseFileCountAttr(value: unknown): number {\n const parsed =\n typeof value === \"string\" ? Number.parseInt(value.trim(), 10) : Number.NaN;\n return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;\n}\n\ninterface AgentMentionNodeViewModel {\n ariaLabel: string;\n directoryPath: string;\n entryKind: string;\n href: string;\n iconUrl?: string;\n kind: AgentMentionNodeViewKind;\n label: string;\n summary?: string;\n thumbnailUrl?: string;\n /** 引用文件数量(workspace-reference 专用)。 */\n fileCount?: number;\n}\n\nfunction attrString(attrs: Record<string, unknown>, key: string): string {\n const value = attrs[key];\n return typeof value === \"string\" ? value : \"\";\n}\n\nfunction normalizeKind(value: string): AgentMentionNodeViewKind {\n if (value === \"session\" || value === \"agent-session\") {\n return \"session\";\n }\n if (value === \"workspace-issue\") {\n return \"workspace-issue\";\n }\n if (value === \"workspace-app\") {\n return \"workspace-app\";\n }\n if (value === \"workspace-reference\") {\n return \"workspace-reference\";\n }\n if (value === \"workspace-app-factory\") {\n return \"workspace-app-factory\";\n }\n return \"file\";\n}\n\nfunction buildMentionHref(\n resource:\n | \"agent-session\"\n | \"workspace-app\"\n | \"workspace-reference\"\n | \"workspace-app-factory\"\n | \"workspace-issue\",\n attrs: Record<string, unknown>\n): string {\n const workspaceId = attrString(attrs, \"workspaceId\").trim();\n const targetId = attrString(attrs, \"targetId\").trim();\n if (resource === \"workspace-issue\") {\n return buildAgentGenericMentionHref(resource, targetId, {\n topicId: attrString(attrs, \"topicId\").trim(),\n workspaceId\n });\n }\n if (resource === \"workspace-reference\") {\n return buildAgentGenericMentionHref(resource, targetId, {\n source: attrString(attrs, \"source\").trim(),\n groupId: attrString(attrs, \"groupId\").trim(),\n icon: attrString(attrs, \"iconUrl\").trim(),\n count: attrString(attrs, \"fileCount\").trim(),\n workspaceId\n });\n }\n if (resource === \"workspace-app\") {\n const appId = attrString(attrs, \"appId\").trim() || targetId;\n return buildAgentGenericMentionHref(resource, appId, { workspaceId });\n }\n if (resource === \"workspace-app-factory\") {\n const jobId = attrString(attrs, \"jobId\").trim() || targetId;\n return buildAgentGenericMentionHref(resource, jobId || \"create\", {\n action: attrString(attrs, \"action\").trim(),\n contextPath: attrString(attrs, \"contextPath\").trim(),\n workspaceId\n });\n }\n return buildAgentGenericMentionHref(resource, targetId, { workspaceId });\n}\n\nfunction buildAgentGenericMentionHref(\n providerId: string,\n entityId: string,\n scope?: Readonly<Record<string, string | null | undefined>>\n): string {\n const normalizedProviderId = providerId.trim();\n const normalizedEntityId = entityId.trim();\n if (!normalizedProviderId || !normalizedEntityId) {\n return \"\";\n }\n const params = new URLSearchParams();\n Object.entries(scope ?? {})\n .map(([key, value]) => [key.trim(), value?.trim() ?? \"\"] as const)\n .filter(([key, value]) => key && value)\n .sort(([left], [right]) => left.localeCompare(right))\n .forEach(([key, value]) => {\n params.set(key, value);\n });\n const query = params.toString();\n const href = `mention://${encodeURIComponent(\n normalizedProviderId\n )}/${encodeURIComponent(normalizedEntityId)}`;\n return query ? `${href}?${query}` : href;\n}\n\nfunction normalizeSessionTitle(value: string): string {\n const trimmed = value.trim();\n const withoutMentionPrefix = trimmed.replace(/^@+/, \"\").trim();\n return withoutMentionPrefix || trimmed;\n}\n\nfunction parseDottedSessionText(\n value: string\n): { participant: string; summary: string } | null {\n const parts = value\n .split(\"·\")\n .map((part) => part.trim())\n .filter(Boolean);\n if (parts.length < 3) {\n return null;\n }\n return {\n participant: `${parts[0]} & ${parts[1]}`,\n summary: normalizeSessionTitle(parts.slice(2).join(\" \"))\n };\n}\n\nfunction sessionPresentation(attrs: Record<string, unknown>): {\n label: string;\n summary: string;\n} {\n const name = attrString(attrs, \"name\").trim();\n const initiatorName = attrString(attrs, \"initiatorName\").trim();\n const agentName = attrString(attrs, \"agentName\").trim();\n const title = normalizeSessionTitle(attrString(attrs, \"title\") || name);\n const inputPreview = attrString(attrs, \"inputPreview\").trim();\n\n if (initiatorName && agentName) {\n const dottedTitle = parseDottedSessionText(title);\n return {\n // i18n-check-ignore: Dynamic participant display names.\n label: `${initiatorName} & ${agentName}`,\n summary:\n dottedTitle?.summary || (title && title !== name ? title : inputPreview)\n };\n }\n\n const dottedName = parseDottedSessionText(name);\n if (dottedName) {\n return {\n label: dottedName.participant,\n summary: dottedName.summary\n };\n }\n\n return {\n label: name,\n summary: title && title !== name ? title : inputPreview\n };\n}\n\nfunction dirnameFromPath(path: string): string {\n const parts = path.split(\"/\").filter(Boolean);\n if (parts.length <= 1) {\n return path.startsWith(\"/\") ? \"/\" : \"\";\n }\n return `/${parts.slice(0, -1).join(\"/\")}`;\n}\n\nfunction mentionViewModel(\n attrs: Record<string, unknown>,\n t: (key: string) => string\n): AgentMentionNodeViewModel {\n const kind = normalizeKind(attrString(attrs, \"kind\"));\n const name = attrString(attrs, \"name\");\n const href = attrString(attrs, \"href\");\n\n if (kind === \"session\") {\n const presentation = sessionPresentation(attrs);\n const primary = `${presentation.label} ${presentation.summary}`.trim();\n return {\n ariaLabel:\n `${t(\"agentHost.agentGui.mentionKindSession\")} ${primary}`.trim(),\n directoryPath: \"\",\n entryKind: \"\",\n href: href || buildMentionHref(\"agent-session\", attrs),\n kind,\n label: presentation.label,\n summary: presentation.summary\n };\n }\n\n if (kind === \"workspace-issue\") {\n return {\n ariaLabel: `${t(\"agentHost.agentGui.mentionKindIssue\")} ${name}`.trim(),\n directoryPath: \"\",\n entryKind: \"\",\n href: href || buildMentionHref(\"workspace-issue\", attrs),\n kind,\n label: name\n };\n }\n\n if (kind === \"workspace-app\") {\n return {\n ariaLabel: `${t(\"agentHost.agentGui.mentionKindApp\")} ${name}`.trim(),\n directoryPath: \"\",\n entryKind: \"\",\n href: href || buildMentionHref(\"workspace-app\", attrs),\n iconUrl: attrString(attrs, \"iconUrl\").trim() || undefined,\n kind,\n label: name\n };\n }\n\n if (kind === \"workspace-reference\") {\n return {\n ariaLabel: `${t(\"agentHost.agentGui.mentionKindApp\")} ${name}`.trim(),\n directoryPath: \"\",\n entryKind: \"\",\n href: href || buildMentionHref(\"workspace-reference\", attrs),\n iconUrl: attrString(attrs, \"iconUrl\").trim() || undefined,\n kind,\n label: name,\n fileCount: parseFileCountAttr(attrs.fileCount)\n };\n }\n\n if (kind === \"workspace-app-factory\") {\n return {\n ariaLabel:\n `${t(\"agentHost.agentGui.mentionKindAppFactory\")} ${name}`.trim(),\n directoryPath: \"\",\n entryKind: \"\",\n href: href || buildMentionHref(\"workspace-app-factory\", attrs),\n kind,\n label: name\n };\n }\n\n const path = attrString(attrs, \"path\") || href;\n const entryKind = attrString(attrs, \"entryKind\") || \"unknown\";\n return {\n ariaLabel: name,\n directoryPath: attrString(attrs, \"directoryPath\") || dirnameFromPath(path),\n entryKind,\n href: href || path,\n kind,\n label: name,\n thumbnailUrl: resolveAgentMentionFileThumbnailUrl({\n entryKind,\n href: href || path,\n name,\n path,\n thumbnailUrl: attrString(attrs, \"thumbnailUrl\")\n })\n };\n}\n\nfunction fileVisualKind(entryKind: string, path: string): string {\n return resolveAgentMentionFileVisualKind({ entryKind, path });\n}\n\nfunction hasPromptContentAfterMentionRemoval(\n doc: NodeViewProps[\"editor\"][\"state\"][\"doc\"]\n): boolean {\n let hasContent = false;\n doc.descendants((node) => {\n if (hasContent) {\n return false;\n }\n if (node.type.name === \"agentFileMention\") {\n hasContent = true;\n return false;\n }\n if (node.isText && node.textContent.trim().length > 0) {\n hasContent = true;\n return false;\n }\n return true;\n });\n return hasContent;\n}\n\nfunction AgentMentionLegacyFileNodeView({\n deleteNode,\n editor,\n extension,\n node,\n selected\n}: NodeViewProps): JSX.Element {\n const mention = mentionViewModel(node.attrs ?? {}, () => \"\");\n const [isEditable, setIsEditable] = useState(editor.isEditable);\n const extensionOptions = extension.options as {\n removeActionAriaLabel?: string;\n };\n const removeActionAriaLabel =\n typeof extensionOptions.removeActionAriaLabel === \"string\"\n ? extensionOptions.removeActionAriaLabel\n : undefined;\n\n useEffect(() => {\n const syncEditable = () => {\n setIsEditable(editor.isEditable);\n };\n\n syncEditable();\n editor.on(\"transaction\", syncEditable);\n editor.on(\"update\", syncEditable);\n return () => {\n editor.off(\"transaction\", syncEditable);\n editor.off(\"update\", syncEditable);\n };\n }, [editor]);\n\n const handleRemove = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n if (!editor.isEditable) {\n return;\n }\n deleteNode();\n if (!hasPromptContentAfterMentionRemoval(editor.state.doc)) {\n editor.commands.clearContent();\n }\n };\n\n return (\n <NodeViewWrapper\n as=\"span\"\n aria-label={mention.ariaLabel}\n className={`group tsh-agent-object-token tsh-agent-object-token--file ${\n selected ? \"is-selected\" : \"\"\n }`}\n contentEditable={false}\n data-agent-file-directory-path={mention.directoryPath}\n data-agent-file-entry-kind={mention.entryKind}\n data-agent-file-mention=\"true\"\n {...(mention.thumbnailUrl\n ? {}\n : {\n \"data-agent-file-visual-kind\": fileVisualKind(\n mention.entryKind,\n mention.href || mention.label\n )\n })}\n data-agent-mention-href={mention.href}\n data-agent-mention-kind={mention.kind}\n {...(mention.thumbnailUrl\n ? { \"data-agent-mention-thumbnail-url\": mention.thumbnailUrl }\n : {})}\n >\n {mention.thumbnailUrl ? (\n <span\n className=\"agent-gui-node__mention-file-thumb relative\"\n data-agent-mention-file-thumb=\"true\"\n aria-hidden={isEditable ? undefined : true}\n >\n <img\n src={mention.thumbnailUrl}\n alt=\"\"\n className={`h-full w-full object-cover transition-opacity ${\n isEditable\n ? \"group-hover:opacity-0 group-focus-within:opacity-0\"\n : \"\"\n }`}\n decoding=\"async\"\n loading=\"lazy\"\n draggable={false}\n />\n {isEditable ? (\n <button\n aria-label={removeActionAriaLabel}\n className=\"absolute left-1/2 top-1/2 inline-flex size-5 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-sm text-[var(--text-secondary)] opacity-0 transition-opacity hover:bg-transparency-block hover:text-[var(--text-primary)] focus-visible:opacity-100 group-hover:opacity-100\"\n type=\"button\"\n onMouseDown={handleRemove}\n >\n <CloseIcon className=\"size-3.5\" />\n </button>\n ) : null}\n </span>\n ) : (\n <span\n className=\"relative grid size-4 shrink-0 place-items-center\"\n aria-hidden={isEditable ? undefined : true}\n >\n <span\n className={`tsh-agent-object-token__icon transition-opacity ${\n isEditable\n ? \"group-hover:opacity-0 group-focus-within:opacity-0\"\n : \"\"\n }`}\n aria-hidden=\"true\"\n />\n {isEditable ? (\n <button\n aria-label={removeActionAriaLabel}\n className=\"absolute left-1/2 top-1/2 inline-flex size-5 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-sm text-[var(--text-secondary)] opacity-0 transition-opacity hover:bg-transparency-block hover:text-[var(--text-primary)] focus-visible:opacity-100 group-hover:opacity-100\"\n type=\"button\"\n onMouseDown={handleRemove}\n >\n <CloseIcon className=\"size-3.5\" />\n </button>\n ) : null}\n </span>\n )}\n <span className=\"tsh-agent-object-token__main\">{mention.label}</span>\n </NodeViewWrapper>\n );\n}\n\nexport function AgentMentionNodeView(props: NodeViewProps): JSX.Element {\n const { deleteNode, editor, extension, node, selected } = props;\n const { t } = useTranslation();\n const mention = mentionViewModel(node.attrs ?? {}, t);\n const [isEditable, setIsEditable] = useState(editor.isEditable);\n const extensionOptions = extension.options as {\n removeActionAriaLabel?: string;\n };\n const removeActionAriaLabel =\n typeof extensionOptions.removeActionAriaLabel === \"string\"\n ? extensionOptions.removeActionAriaLabel\n : undefined;\n\n useEffect(() => {\n const syncEditable = () => {\n setIsEditable(editor.isEditable);\n };\n\n syncEditable();\n editor.on(\"transaction\", syncEditable);\n editor.on(\"update\", syncEditable);\n return () => {\n editor.off(\"transaction\", syncEditable);\n editor.off(\"update\", syncEditable);\n };\n }, [editor]);\n\n const handleRemove = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n if (!editor.isEditable) {\n return;\n }\n deleteNode();\n if (!hasPromptContentAfterMentionRemoval(editor.state.doc)) {\n editor.commands.clearContent();\n }\n };\n\n if (mention.kind === \"file\") {\n return <AgentMentionLegacyFileNodeView {...props} />;\n }\n\n if (\n mention.kind === \"workspace-app\" ||\n mention.kind === \"workspace-reference\"\n ) {\n return (\n <NodeViewWrapper\n as=\"span\"\n aria-label={mention.ariaLabel}\n className={`inline-flex max-w-[min(100%,var(--agent-mention-max-width,16rem))] align-baseline ${\n selected ? \"is-selected\" : \"\"\n }`}\n contentEditable={false}\n data-agent-file-mention=\"true\"\n data-agent-mention-href={mention.href}\n data-agent-mention-icon-url={mention.iconUrl}\n data-agent-mention-kind={mention.kind}\n >\n <span\n className=\"group relative top-[3px] inline-flex max-w-[min(100%,var(--agent-mention-max-width,16rem))] cursor-pointer items-center gap-1 overflow-hidden rounded-[4px] border border-transparent bg-transparent px-1 py-0.5 align-baseline text-[13px] font-medium leading-5 text-[var(--accent)] no-underline transition-colors hover:border-transparent hover:bg-[color-mix(in_srgb,currentColor_12%,transparent)]\"\n data-agent-mention-kind={mention.kind}\n data-slot=\"mention-pill\"\n >\n <span\n aria-hidden={isEditable ? undefined : true}\n className=\"relative grid size-4 shrink-0 place-items-center overflow-hidden rounded-[4px] bg-block\"\n data-agent-mention-app-icon=\"true\"\n data-workspace-app-icon=\"true\"\n >\n {mention.iconUrl ? (\n <img\n src={mention.iconUrl}\n alt=\"\"\n className={`size-full object-cover transition-opacity ${\n isEditable\n ? \"group-hover:opacity-0 group-focus-within:opacity-0\"\n : \"\"\n }`}\n decoding=\"async\"\n loading=\"lazy\"\n draggable={false}\n />\n ) : (\n <span\n className={`tsh-agent-object-token__kind-icon size-4 transition-opacity ${\n isEditable\n ? \"group-hover:opacity-0 group-focus-within:opacity-0\"\n : \"\"\n }`}\n />\n )}\n {isEditable ? (\n <button\n aria-label={removeActionAriaLabel}\n className=\"absolute left-1/2 top-1/2 inline-flex size-5 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-sm text-[var(--text-secondary)] opacity-0 transition-opacity hover:bg-transparency-block hover:text-[var(--text-primary)] focus-visible:opacity-100 group-hover:opacity-100\"\n type=\"button\"\n onMouseDown={handleRemove}\n >\n <CloseIcon className=\"size-3.5\" />\n </button>\n ) : null}\n </span>\n <TruncatingPillLabel tooltip={mention.label}>\n {mention.label}\n </TruncatingPillLabel>\n </span>\n </NodeViewWrapper>\n );\n }\n\n return (\n <NodeViewWrapper\n as=\"span\"\n className={`inline-flex max-w-[min(100%,var(--agent-mention-max-width,16rem))] align-baseline ${\n selected ? \"is-selected\" : \"\"\n }`}\n contentEditable={false}\n >\n <MentionPill\n aria-label={mention.ariaLabel}\n data-agent-mention-href={mention.href}\n data-agent-mention-kind={mention.kind}\n kind={mention.kind === \"session\" ? \"session\" : \"issue\"}\n label={mention.label}\n removable={isEditable}\n removeButtonProps={\n isEditable\n ? {\n \"aria-label\": removeActionAriaLabel,\n onMouseDown: handleRemove\n }\n : undefined\n }\n summary={mention.summary}\n />\n </NodeViewWrapper>\n );\n}\n"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,KAAK,IAC/B,QACA,KAAK,cAAc,KAAK,KAAK;AAAA,IACrC;AAAA,EACF;AAEA,QAAM,aAAa,8BAA8B,KAAK,IAAI;AAC1D,MAAI,YAAY;AACd,WAAO;AAAA,MACL,aAAa,WAAW;AAAA,MACxB,SAAS,WAAW;AAAA,IACtB;AAAA,EACF;AAEA,SAAO;AAAA,IACL,aAAa,KAAK,KAAK,KAAK;AAAA,IAC5B,SACE,SAAS,UAAU,KAAK,KAAK,KAAK,IAC9B,QACA,KAAK,cAAc,KAAK,KAAK;AAAA,EACrC;AACF;AAEA,SAAS,8BACP,OACiD;AACjD,QAAM,QAAQ,MACX,MAAM,MAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO;AACjB,MAAI,MAAM,SAAS,GAAG;AACpB,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,aAAa,GAAG,MAAM,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC;AAAA,IACtC,SAAS,kCAAkC,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAAA,EACrE;AACF;AAEA,SAASD,iBAAgB,MAAsB;AAC7C,QAAM,QAAQ,KAAK,MAAM,GAAG,EAAE,OAAO,OAAO;AAC5C,MAAI,MAAM,UAAU,GAAG;AACrB,WAAO,KAAK,WAAW,GAAG,IAAI,MAAM;AAAA,EACtC;AACA,SAAO,IAAI,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC;AACzC;AAEA,SAAS,wBAAwB,OAAuB;AACtD,SAAO,MAAM,QAAQ,cAAc,MAAM;AAC3C;AAEA,SAAS,yBAAyB,OAAuB;AACvD,SAAO,MAAM,QAAQ,OAAO,MAAM,EAAE,QAAQ,OAAO,KAAK;AAC1D;","names":["buildAgentGenericMentionHref","dirnameFromPath","buildAgentGenericMentionHref"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts"],"sourcesContent":["import {\n createContext,\n useContext,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityCancelSessionInput,\n AgentActivityCancelSessionResult,\n AgentActivityCreateSessionInput,\n AgentActivityDeleteSessionInput,\n AgentActivityDeleteSessionResult,\n AgentActivityMessageOrder,\n AgentActivityMessagePage,\n AgentActivitySendInput,\n AgentActivitySession,\n AgentActivitySnapshot,\n AgentActivitySnapshotListener,\n AgentActivitySubmitInteractiveInput\n} from \"@tutti-os/agent-activity-core\";\nimport type {\n AgentHostAgentSessionComposerSettings,\n AgentHostActivateAgentSessionResult,\n AgentHostRuntimeOpenclawGatewayWarmupResult,\n AgentHostUpdateAgentSessionSettingsResult,\n AgentHostUnactivateAgentSessionResult,\n AgentHostAgentSessionState\n} from \"./shared/contracts/dto\";\n\nexport interface AgentActivityRuntimeListSessionMessagesInput {\n afterVersion?: number;\n beforeVersion?: number;\n agentSessionId: string;\n limit?: number;\n order?: AgentActivityMessageOrder;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListGeneratedFilesInput {\n limit?: number;\n query?: string;\n sessionCwd?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFile {\n label: string;\n path: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFileList {\n entries: AgentActivityRuntimeGeneratedFile[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeEnsureSessionSynchronizedInput {\n afterVersion?: number;\n agentSessionId: string;\n onError?: (error: unknown) => void;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimeRetainSessionEventsInput =\n AgentActivityRuntimeEnsureSessionSynchronizedInput;\n\nexport interface AgentActivityRuntimeSetSessionPinnedInput {\n agentSessionId: string;\n pinned: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackSettingsProjectChangeInput {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetSessionControlStateInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetComposerOptionsInput {\n cwd?: string | null;\n force?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUpdateSessionSettingsInput {\n agentSessionId: string;\n settings: AgentHostAgentSessionComposerSettings;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput {\n nextSettings: AgentHostAgentSessionComposerSettings;\n previousSettings: AgentHostAgentSessionComposerSettings;\n provider: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeWarmupOpenclawGatewayInput {\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeDiagnosticInput {\n details?: Record<string, unknown>;\n event: string;\n level?: \"debug\" | \"info\" | \"warn\" | \"error\";\n source?: string;\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeActivateSessionInput {\n agentSessionId: string;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n mode: \"existing\" | \"new\";\n openclawGatewayReady?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings;\n title?: string;\n visible?: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUnactivateSessionInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadSessionAttachmentInput {\n agentSessionId: string;\n attachmentId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeSessionAttachment {\n attachmentId: string;\n mimeType: string;\n name?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntime {\n cancelSession(\n input: AgentActivityCancelSessionInput\n ): Promise<AgentActivityCancelSessionResult>;\n createSession(\n input: AgentActivityCreateSessionInput\n ): Promise<AgentActivitySession>;\n deleteSession(\n input: AgentActivityDeleteSessionInput\n ): Promise<AgentActivityDeleteSessionResult>;\n activateSession(\n input: AgentActivityRuntimeActivateSessionInput\n ): Promise<AgentHostActivateAgentSessionResult>;\n getSession(\n workspaceId: string,\n agentSessionId: string\n ): Promise<AgentActivitySession>;\n getComposerOptions(\n input: AgentActivityRuntimeGetComposerOptionsInput\n ): Promise<unknown>;\n updateSessionSettings(\n input: AgentActivityRuntimeUpdateSessionSettingsInput\n ): Promise<AgentHostUpdateAgentSessionSettingsResult>;\n warmupOpenclawGateway?(\n input?: AgentActivityRuntimeWarmupOpenclawGatewayInput\n ): Promise<AgentHostRuntimeOpenclawGatewayWarmupResult>;\n getSessionControlState(\n input: AgentActivityRuntimeGetSessionControlStateInput\n ): Promise<AgentHostAgentSessionState>;\n getSnapshot(workspaceId: string): AgentActivitySnapshot;\n listSessionMessages(\n input: AgentActivityRuntimeListSessionMessagesInput\n ): Promise<AgentActivityMessagePage>;\n listAgentGeneratedFiles?(\n input: AgentActivityRuntimeListGeneratedFilesInput\n ): Promise<AgentActivityRuntimeGeneratedFileList>;\n load(\n workspaceId: string,\n signal?: AbortSignal\n ): Promise<AgentActivitySnapshot>;\n ensureSessionSynchronized?(\n input: AgentActivityRuntimeEnsureSessionSynchronizedInput\n ): () => void;\n /** @deprecated Use ensureSessionSynchronized. */\n retainSessionEvents(\n input: AgentActivityRuntimeRetainSessionEventsInput\n ): () => void;\n sendInput(input: AgentActivitySendInput): Promise<AgentActivitySession>;\n readSessionAttachment?(\n input: AgentActivityRuntimeReadSessionAttachmentInput\n ): Promise<AgentActivityRuntimeSessionAttachment>;\n setSessionPinned(\n input: AgentActivityRuntimeSetSessionPinnedInput\n ): Promise<AgentActivitySession>;\n trackSettingsProjectChange?(\n input: AgentActivityRuntimeTrackSettingsProjectChangeInput\n ): Promise<void>;\n trackDraftComposerSettingsChange?(\n input: AgentActivityRuntimeTrackDraftComposerSettingsChangeInput\n ): Promise<void>;\n reportDiagnostic?(\n input: AgentActivityRuntimeDiagnosticInput\n ): Promise<void> | void;\n unactivateSession(\n input: AgentActivityRuntimeUnactivateSessionInput\n ): Promise<AgentHostUnactivateAgentSessionResult>;\n submitInteractive(\n input: AgentActivitySubmitInteractiveInput\n ): Promise<unknown>;\n subscribeSessionEvents(\n workspaceId: string,\n listener: (event: unknown) => void\n ): () => void;\n subscribe(\n workspaceId: string,\n listener: AgentActivitySnapshotListener\n ): () => void;\n}\n\nconst AgentActivityRuntimeContext = createContext<AgentActivityRuntime | null>(\n null\n);\n\nlet currentAgentActivityRuntime: AgentActivityRuntime | null = null;\n\nexport interface AgentActivityRuntimeProviderProps extends PropsWithChildren {\n runtime?: AgentActivityRuntime | null;\n}\n\nexport function AgentActivityRuntimeProvider({\n children,\n runtime\n}: AgentActivityRuntimeProviderProps): JSX.Element {\n currentAgentActivityRuntime = runtime ?? null;\n return (\n <AgentActivityRuntimeContext.Provider value={runtime ?? null}>\n {children}\n </AgentActivityRuntimeContext.Provider>\n );\n}\n\nexport function useAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function useOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime()\n );\n}\n\nexport function useAgentActivitySnapshot(\n workspaceId: string\n): AgentActivitySnapshot {\n const runtime = useAgentActivityRuntime();\n const normalizedWorkspaceId = workspaceId.trim();\n return useSyncExternalStore(\n (listener) => runtime.subscribe(normalizedWorkspaceId, listener),\n () => runtime.getSnapshot(normalizedWorkspaceId),\n () => runtime.getSnapshot(normalizedWorkspaceId)\n );\n}\n\nexport function getAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime()\n );\n}\n\nexport function resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = null;\n }\n}\n\nexport function setAgentActivityRuntimeForTests(\n runtime: AgentActivityRuntime | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = runtime;\n }\n}\n\nfunction getTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitRuntime = getExplicitWindowTestAgentActivityRuntime();\n if (explicitRuntime) {\n return explicitRuntime;\n }\n if (currentAgentActivityRuntime) {\n return currentAgentActivityRuntime;\n }\n const testRuntime = (\n window as unknown as Window & {\n agentActivityRuntime?: AgentActivityRuntime;\n }\n ).agentActivityRuntime;\n return testRuntime ?? null;\n}\n\nfunction getExplicitWindowTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentActivityRuntime\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n return (testDescriptor.value as AgentActivityRuntime | undefined) ?? null;\n}\n","import {\n createContext,\n useContext,\n useMemo,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport {\n toAgentHostRuntimeApi,\n type AgentHostInputApi,\n type AgentHostRuntimeApi\n} from \"./host/agentHostApi\";\nimport {\n AgentActivityRuntimeProvider,\n type AgentActivityRuntime\n} from \"./agentActivityRuntime\";\n\nconst AgentActivityHostContext = createContext<AgentHostRuntimeApi | null>(\n null\n);\n\nlet currentAgentHostApi: AgentHostRuntimeApi | null = null;\n\nexport interface AgentActivityHostProviderProps extends PropsWithChildren {\n agentActivityRuntime?: AgentActivityRuntime | null;\n agentHostApi?: AgentHostInputApi | null;\n}\n\nexport function AgentActivityHostProvider({\n agentActivityRuntime,\n agentHostApi,\n children\n}: AgentActivityHostProviderProps): JSX.Element {\n const resolvedAgentHostApi = useMemo(\n () => (agentHostApi ? toAgentHostRuntimeApi(agentHostApi) : null),\n [agentHostApi]\n );\n currentAgentHostApi = resolvedAgentHostApi;\n return (\n <AgentActivityRuntimeProvider runtime={agentActivityRuntime}>\n <AgentActivityHostContext.Provider value={resolvedAgentHostApi}>\n {children}\n </AgentActivityHostContext.Provider>\n </AgentActivityRuntimeProvider>\n );\n}\n\nexport function useAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function useOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n}\n\nexport function getAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function getOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return (\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi()\n );\n}\n\nexport function resetAgentHostApiForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = null;\n }\n}\n\nexport function setAgentHostApiForTests(\n agentHostApi: AgentHostInputApi | AgentHostRuntimeApi | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = agentHostApi\n ? toAgentHostRuntimeApi(agentHostApi)\n : null;\n }\n}\n\nfunction getTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitAgentHostApi = getExplicitWindowTestAgentHostApi();\n if (explicitAgentHostApi) {\n return explicitAgentHostApi;\n }\n if (currentAgentHostApi) {\n return currentAgentHostApi;\n }\n const testAgentHostApi = (\n window as unknown as Window & {\n agentHostApi?: AgentHostInputApi | AgentHostRuntimeApi;\n }\n ).agentHostApi;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n\nfunction getExplicitWindowTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentHostApi\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n const testAgentHostApi = testDescriptor.value as\n | AgentHostInputApi\n | AgentHostRuntimeApi\n | undefined;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n","import type {\n AgentHostBatchUserInfoInput,\n AgentHostBatchUserInfoResult,\n AgentHostDeleteWorkspaceAgentSessionInput,\n AgentHostWorkspaceAgentListInput as AgentHostListWorkspaceAgentsInput,\n AgentHostListWorkspaceAgentProbesInput,\n AgentHostWorkspaceAgentSessionMessages,\n AgentHostWorkspaceAgentSessionMessagesInput,\n AgentHostWorkspaceAgentSessionSummary,\n AgentHostWorkspaceAgentSessionSummaryInput,\n AgentHostWorkspaceAgentProbesResult,\n AgentHostWorkspaceAgentSnapshot,\n ReadWorkspaceFileResult as AgentHostReadWorkspaceFileResult\n} from \"../shared/contracts/dto\";\nimport type { WorkspaceUserProjectService } from \"@tutti-os/workspace-user-project/contracts\";\n\ntype AgentHostAsyncResult<T = any> = Promise<T>;\ntype AgentHostRecord = Record<string, unknown>;\ntype AgentHostUnsubscribe = () => void;\ntype AgentHostWorkspaceScopedInput<\n T extends {\n workspaceId?: string | null;\n }\n> = Omit<T, \"workspaceId\"> & {\n workspaceId: string;\n};\ntype AgentHostWorkspaceAgentsListInput =\n AgentHostWorkspaceScopedInput<AgentHostListWorkspaceAgentsInput>;\ntype AgentHostWorkspaceAgentSessionMessagesRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionMessagesInput>;\ntype AgentHostWorkspaceAgentSessionSummaryRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionSummaryInput>;\ntype AgentHostDeleteWorkspaceAgentSessionRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostDeleteWorkspaceAgentSessionInput>;\n\nexport type AgentHostClipboardApi = {\n writeText: (text: string) => AgentHostAsyncResult<void>;\n};\n\nexport type AgentHostDebugApi = {\n logRuntimeDiagnostics: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n logTerminalDiagnostics?: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n};\n\nexport type AgentHostFilesystemApi = AgentHostRecord & {\n readFileText: (payload: {\n path?: string;\n uri?: string;\n }) => AgentHostAsyncResult<{\n content: string;\n name?: string;\n path?: string;\n }>;\n};\n\nexport type AgentHostMetaApi = AgentHostRecord & {\n appVersion?: string | null;\n isPackaged?: boolean;\n isTest?: boolean;\n mainPid?: number | null;\n platform?: string;\n workspaceId?: string;\n};\n\nexport type AgentHostEnvironmentApi = AgentHostRecord & {\n getBaseUrl?: () => AgentHostAsyncResult<string>;\n warmupOpenclawGateway?: (input?: unknown) => AgentHostAsyncResult<unknown>;\n};\n\nexport interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getPathForFile: (file: File) => string;\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: () => AgentHostAsyncResult<AgentHostSelectedFile[]>;\n writeFileText: (input: {\n content: string;\n path: string;\n }) => AgentHostAsyncResult<unknown>;\n};\n\nexport interface AgentHostInputApi {\n account?: AgentHostAccountApi;\n agentGuiBatch?: AgentHostAgentGuiBatchApi;\n agentSessions?: AgentHostAgentSessionsApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n runtime?: AgentHostEnvironmentApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n workspaceAgents?: AgentHostWorkspaceAgentsApi;\n}\n\nexport type AgentHostApi = AgentHostInputApi;\n\nexport type AgentHostAccountApi = AgentHostRecord & {\n batchGetUserInfo: (\n input: AgentHostBatchUserInfoInput\n ) => AgentHostAsyncResult<AgentHostBatchUserInfoResult>;\n ensureProfiles?: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostAgentGuiBatchApi = AgentHostRecord & {\n exportRun: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & {\n list: (\n input: AgentHostListWorkspaceAgentProbesInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentProbesResult>;\n};\n\nexport type AgentProviderProbeListInput =\n AgentHostListWorkspaceAgentProbesInput;\nexport type AgentProviderProbeListResult = AgentHostWorkspaceAgentProbesResult;\n\nexport interface AgentHostUserProject {\n id: string;\n path: string;\n label: string;\n createdAtUnixMs?: number;\n updatedAtUnixMs?: number;\n lastUsedAtUnixMs?: number;\n}\n\nexport type AgentHostUserProjectsApi = AgentHostRecord & {\n service?: WorkspaceUserProjectService;\n checkPath?: (input: { path: string }) => AgentHostAsyncResult<{\n exists: boolean;\n isDirectory: boolean;\n path: string;\n }>;\n create?: (input: {\n name: string;\n }) => AgentHostAsyncResult<AgentHostUserProject>;\n getDefaultSelection?: () => AgentHostAsyncResult<{\n path: string | null;\n } | null>;\n list: () => AgentHostAsyncResult<{\n projects: AgentHostUserProject[];\n }>;\n subscribe?: (listener: () => void) => AgentHostUnsubscribe;\n prepareSelection?: (input: {\n projectLocked: boolean;\n selectedPath: string | null;\n }) => AgentHostAsyncResult<{\n isSelectedPathMissing: boolean;\n projects: AgentHostUserProject[];\n selection:\n | {\n kind: \"clear\";\n suppressedPath: string;\n }\n | {\n kind: \"none\";\n }\n | {\n kind: \"select\";\n path: string;\n };\n }>;\n remove?: (input: { path: string }) => AgentHostAsyncResult<void>;\n isNoProjectPath?: (input: { path: string }) => boolean;\n rememberDefaultSelection?: (input: {\n path: string | null;\n }) => AgentHostAsyncResult<void>;\n use: (input: { path: string }) => AgentHostAsyncResult<AgentHostUserProject>;\n};\n\nexport type AgentHostAgentSessionsApi = AgentHostRecord & {\n activate: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.cancelSession.\n */\n cancel: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.sendInput.\n */\n exec: (input: any) => AgentHostAsyncResult<any>;\n getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;\n getState: (input: any) => AgentHostAsyncResult<any>;\n onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.setSessionPinned.\n */\n pinSession?: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n releaseEventStream?: (input?: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n retainEventStream?: (input: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.submitInteractive.\n */\n submitInteractive: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production UI must derive events from AgentActivityRuntime snapshots.\n */\n trackSettingsProjectChange?: (input: {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n }) => AgentHostAsyncResult<void>;\n subscribeEvents: (\n input: any,\n listener: (event: any) => void\n ) => AgentHostUnsubscribe;\n unactivate: (input: any) => AgentHostAsyncResult<any>;\n updateSettings: (input: any) => AgentHostAsyncResult<any>;\n};\n\n/**\n * @deprecated Legacy host DTO projection. AgentGUI production reads and writes\n * must use AgentActivityRuntime and AgentActivity* models.\n */\nexport type AgentHostWorkspaceAgentsApi = AgentHostRecord & {\n /**\n * @deprecated Use AgentActivityRuntime.deleteSession.\n */\n deleteSession: (\n input: AgentHostDeleteWorkspaceAgentSessionRuntimeInput\n ) => AgentHostAsyncResult<any>;\n /**\n * @deprecated Derive summaries from AgentActivitySnapshot/session messages.\n */\n getSessionSummary: (\n input: AgentHostWorkspaceAgentSessionSummaryRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionSummary>;\n /**\n * @deprecated Use AgentActivityRuntime.load/getSnapshot.\n */\n list: (\n input: string | AgentHostWorkspaceAgentsListInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSnapshot>;\n /**\n * @deprecated Use AgentActivityRuntime.listSessionMessages.\n */\n listSessionMessages: (\n input: AgentHostWorkspaceAgentSessionMessagesRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionMessages>;\n};\n\nexport interface AgentHostRuntimeApi {\n account?: AgentHostAccountApi;\n agentGuiBatch: AgentHostAgentGuiBatchApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n runtime?: AgentHostEnvironmentApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n}\n\nexport function toAgentHostRuntimeApi(\n hostApi: AgentHostInputApi | AgentHostRuntimeApi\n): AgentHostRuntimeApi {\n return {\n account: hostApi.account,\n agentGuiBatch: hostApi.agentGuiBatch ?? ({} as AgentHostAgentGuiBatchApi),\n clipboard: hostApi.clipboard,\n debug: hostApi.debug,\n filesystem: hostApi.filesystem,\n meta: hostApi.meta,\n onHostEvent: hostApi.onHostEvent,\n runtime: hostApi.runtime,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAiPH;AAhBJ,IAAM,8BAA8B;AAAA,EAClC;AACF;AAEA,IAAI,8BAA2D;AAMxD,SAAS,6BAA6B;AAAA,EAC3C;AAAA,EACA;AACF,GAAmD;AACjD,gCAA8B,WAAW;AACzC,SACE,oBAAC,4BAA4B,UAA5B,EAAqC,OAAO,WAAW,MACrD,UACH;AAEJ;AAEO,SAAS,0BAAgD;AAC9D,QAAM,UACJ,WAAW,2BAA2B,KAAK,4BAA4B;AACzE,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,kCAA+D;AAC7E,SACE,WAAW,2BAA2B,KAAK,4BAA4B;AAE3E;AAEO,SAAS,yBACd,aACuB;AACvB,QAAM,UAAU,wBAAwB;AACxC,QAAM,wBAAwB,YAAY,KAAK;AAC/C,SAAO;AAAA,IACL,CAAC,aAAa,QAAQ,UAAU,uBAAuB,QAAQ;AAAA,IA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