@tutti-os/agent-gui 0.0.53 → 0.0.55
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/{AgentMentionSearchController-CExFPobz.d.ts → AgentMentionSearchController-DzhWr0PN.d.ts} +13 -3
- package/dist/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +7 -6
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-message-center/index.js +15 -12
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentGuiNodeTypes-wzOITHRW.d.ts → agentGuiNodeTypes-DCnsaqJr.d.ts} +16 -2
- package/dist/app/renderer/agentactivity.css +157 -6
- package/dist/{chunk-ZTSS2NU2.js → chunk-2XVECUTU.js} +25 -1
- package/dist/chunk-2XVECUTU.js.map +1 -0
- package/dist/{chunk-OBFDA7RG.js → chunk-4PSDYKZQ.js} +20 -3
- package/dist/chunk-4PSDYKZQ.js.map +1 -0
- package/dist/{chunk-BFIYBPFD.js → chunk-6AXH2BOD.js} +5 -5
- package/dist/{chunk-4K22O34C.js → chunk-7GM7UQXD.js} +29 -3
- package/dist/chunk-7GM7UQXD.js.map +1 -0
- package/dist/{chunk-2OLYX32K.js → chunk-7H4IH67L.js} +76 -7
- package/dist/chunk-7H4IH67L.js.map +1 -0
- package/dist/{chunk-FYVVHRLZ.js → chunk-BGZ2OSDQ.js} +2 -2
- package/dist/{chunk-DPG2J7N5.js → chunk-CMOGPJ23.js} +2 -2
- package/dist/{chunk-3ZVVFQH5.js → chunk-GBAQVKQN.js} +180 -88
- package/dist/chunk-GBAQVKQN.js.map +1 -0
- package/dist/{chunk-66EQ6EQO.js → chunk-GL54NRMB.js} +59 -2
- package/dist/chunk-GL54NRMB.js.map +1 -0
- package/dist/{chunk-Y7ZVTWMZ.js → chunk-H2YWXFYX.js} +2 -2
- package/dist/{chunk-UKDC63WG.js → chunk-NBTJEF3H.js} +81 -4
- package/dist/chunk-NBTJEF3H.js.map +1 -0
- package/dist/{chunk-EFDGMXTB.js → chunk-OQJSZSYB.js} +48 -48
- package/dist/chunk-OQJSZSYB.js.map +1 -0
- package/dist/{chunk-GWHPTB4L.js → chunk-PBHTLI3E.js} +2 -2
- package/dist/{chunk-GWHPTB4L.js.map → chunk-PBHTLI3E.js.map} +1 -1
- package/dist/{chunk-5Y3PC7HP.js → chunk-VOXUYDQF.js} +238 -25
- package/dist/chunk-VOXUYDQF.js.map +1 -0
- package/dist/{chunk-HDBKB5RA.js → chunk-WMQN7SZC.js} +2 -58
- package/dist/chunk-WMQN7SZC.js.map +1 -0
- package/dist/{chunk-F5DYXCY3.js → chunk-Z2BTIAOC.js} +1 -1
- package/dist/chunk-Z2BTIAOC.js.map +1 -0
- package/dist/{chunk-PIKG746A.js → chunk-ZFDO72FE.js} +132 -67
- package/dist/chunk-ZFDO72FE.js.map +1 -0
- package/dist/context-mention-palette/index.d.ts +2 -2
- package/dist/context-mention-palette/index.js +8 -8
- package/dist/context-mention-provider.d.ts +1 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +21 -53
- package/dist/index.js +1256 -679
- package/dist/index.js.map +1 -1
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/{types-xMz0lJWt.d.ts → types-B2m7UcBb.d.ts} +8 -0
- package/dist/workbench/contribution.d.ts +43 -4
- package/dist/workbench/contribution.js +9 -5
- package/dist/workbench/index.d.ts +3 -3
- package/dist/workbench/index.js +18 -8
- package/dist/workbench/launch.d.ts +2 -1
- package/dist/workbench/launch.js +2 -2
- package/dist/workbench/providerCatalog.d.ts +1 -1
- package/dist/workbench/sessionTitle.d.ts +1 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +1 -1
- package/dist/workbench/state.js +2 -2
- package/dist/workbench/types.d.ts +8 -8
- package/dist/workbench/types.js +1 -1
- package/dist/workspace-agent-generated-files.js +3 -3
- package/package.json +14 -14
- package/dist/chunk-2OLYX32K.js.map +0 -1
- package/dist/chunk-3ZVVFQH5.js.map +0 -1
- package/dist/chunk-4K22O34C.js.map +0 -1
- package/dist/chunk-5Y3PC7HP.js.map +0 -1
- package/dist/chunk-66EQ6EQO.js.map +0 -1
- package/dist/chunk-EFDGMXTB.js.map +0 -1
- package/dist/chunk-F5DYXCY3.js.map +0 -1
- package/dist/chunk-HDBKB5RA.js.map +0 -1
- package/dist/chunk-OBFDA7RG.js.map +0 -1
- package/dist/chunk-PIKG746A.js.map +0 -1
- package/dist/chunk-UKDC63WG.js.map +0 -1
- package/dist/chunk-ZTSS2NU2.js.map +0 -1
- /package/dist/{chunk-BFIYBPFD.js.map → chunk-6AXH2BOD.js.map} +0 -0
- /package/dist/{chunk-FYVVHRLZ.js.map → chunk-BGZ2OSDQ.js.map} +0 -0
- /package/dist/{chunk-DPG2J7N5.js.map → chunk-CMOGPJ23.js.map} +0 -0
- /package/dist/{chunk-Y7ZVTWMZ.js.map → chunk-H2YWXFYX.js.map} +0 -0
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
claudeRoundedUrl,
|
|
3
|
+
codexRoundedUrl,
|
|
4
|
+
geminiRoundedUrl,
|
|
5
|
+
hermesRoundedUrl,
|
|
6
|
+
manageAgentClaudeCodeUrl,
|
|
7
|
+
manageAgentCodexUrl,
|
|
8
|
+
manageAgentGeminiUrl,
|
|
9
|
+
manageAgentHermesUrl,
|
|
10
|
+
manageAgentOpenclawUrl,
|
|
11
|
+
manageAgentTuttiUrl,
|
|
12
|
+
openclawRoundedUrl,
|
|
13
|
+
tuttiDocRoundedUrl
|
|
14
|
+
} from "./chunk-MTFSQWZ6.js";
|
|
15
|
+
|
|
1
16
|
// agentActivityRuntime.tsx
|
|
2
17
|
import {
|
|
3
18
|
createContext,
|
|
@@ -181,6 +196,44 @@ function getExplicitWindowTestAgentHostApi() {
|
|
|
181
196
|
return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;
|
|
182
197
|
}
|
|
183
198
|
|
|
199
|
+
// shared/managedAgentProviders.ts
|
|
200
|
+
function normalizeManagedAgentProvider(provider) {
|
|
201
|
+
const normalized = provider?.trim().toLowerCase().replace(/[_\s]+/gu, "-") ?? "";
|
|
202
|
+
switch (normalized) {
|
|
203
|
+
case "claude":
|
|
204
|
+
case "claude-code":
|
|
205
|
+
return "claude-code";
|
|
206
|
+
case "nexight":
|
|
207
|
+
case "tutti-doc":
|
|
208
|
+
return "tutti";
|
|
209
|
+
default:
|
|
210
|
+
return normalized;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// shared/managedAgentIcons.ts
|
|
215
|
+
var MANAGED_AGENT_ICON_URLS = {
|
|
216
|
+
"claude-code": manageAgentClaudeCodeUrl,
|
|
217
|
+
codex: manageAgentCodexUrl,
|
|
218
|
+
gemini: manageAgentGeminiUrl,
|
|
219
|
+
hermes: manageAgentHermesUrl,
|
|
220
|
+
tutti: manageAgentTuttiUrl,
|
|
221
|
+
openclaw: manageAgentOpenclawUrl
|
|
222
|
+
};
|
|
223
|
+
var MANAGED_AGENT_ICON_ROUNDED_URLS = {
|
|
224
|
+
"claude-code": claudeRoundedUrl,
|
|
225
|
+
codex: codexRoundedUrl,
|
|
226
|
+
gemini: geminiRoundedUrl,
|
|
227
|
+
hermes: hermesRoundedUrl,
|
|
228
|
+
tutti: tuttiDocRoundedUrl,
|
|
229
|
+
openclaw: openclawRoundedUrl
|
|
230
|
+
};
|
|
231
|
+
var MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL = tuttiDocRoundedUrl;
|
|
232
|
+
var MANAGED_AGENT_ICON_FALLBACK_URL = manageAgentTuttiUrl;
|
|
233
|
+
function managedAgentRoundedIconUrl(provider) {
|
|
234
|
+
return MANAGED_AGENT_ICON_ROUNDED_URLS[normalizeManagedAgentProvider(provider)] ?? MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL;
|
|
235
|
+
}
|
|
236
|
+
|
|
184
237
|
export {
|
|
185
238
|
AgentActivityRuntimeProvider,
|
|
186
239
|
useAgentActivityRuntime,
|
|
@@ -193,6 +246,10 @@ export {
|
|
|
193
246
|
AgentActivityHostProvider,
|
|
194
247
|
useAgentHostApi,
|
|
195
248
|
useOptionalAgentHostApi,
|
|
196
|
-
getOptionalAgentHostApi
|
|
249
|
+
getOptionalAgentHostApi,
|
|
250
|
+
normalizeManagedAgentProvider,
|
|
251
|
+
MANAGED_AGENT_ICON_URLS,
|
|
252
|
+
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
253
|
+
managedAgentRoundedIconUrl
|
|
197
254
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
255
|
+
//# sourceMappingURL=chunk-GL54NRMB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts","../shared/managedAgentProviders.ts","../shared/managedAgentIcons.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 AgentActivitySendInputResult,\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\";\nimport type { AgentGUIProviderTargetRef } from \"./types\";\n\nexport interface AgentActivityRuntimeListSessionMessagesInput {\n afterVersion?: number;\n beforeVersion?: number;\n cache?: boolean;\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 agentTargetId?: string | null;\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 agentTargetId?: string | null;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n metadata?: Record<string, unknown>;\n mode: \"existing\" | \"new\";\n openclawGatewayReady?: boolean;\n provider?: string;\n /**\n * Opaque host-owned target reference. AgentGUI passes this through only; hosts\n * must not treat it as authority and must re-authenticate before launch.\n */\n providerTargetRef?: AgentGUIProviderTargetRef | null;\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 AgentActivityRuntimeReadPromptAssetInput {\n agentSessionId?: string | null;\n assetId?: string | null;\n hostPath?: string | null;\n kind?: string | null;\n mimeType: string;\n name?: string | null;\n path?: string | null;\n sha256?: string | null;\n uploadStatus?: string | null;\n uri?: string | null;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimePromptContentBlock =\n AgentActivitySendInput[\"content\"][number] & {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n path?: string;\n sizeBytes?: number;\n uploadStatus?: string;\n uri?: string;\n };\n\nexport interface AgentActivityRuntimeUploadPromptContentInput {\n content: AgentActivityRuntimePromptContentBlock[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUploadPromptContentResult {\n content: AgentActivityRuntimePromptContentBlock[];\n}\n\nexport interface AgentActivityRuntimeSessionAttachment {\n attachmentId: string;\n mimeType: string;\n name?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntimePromptAsset {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n mimeType: string;\n name?: string;\n path: string;\n uploadStatus?: string;\n uri?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntime {\n promptContentUploadSupport?: {\n file?: boolean;\n image?: boolean;\n };\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(\n input: AgentActivitySendInput\n ): Promise<AgentActivitySendInputResult>;\n uploadPromptContent?(\n input: AgentActivityRuntimeUploadPromptContentInput\n ): Promise<AgentActivityRuntimeUploadPromptContentResult>;\n readSessionAttachment?(\n input: AgentActivityRuntimeReadSessionAttachmentInput\n ): Promise<AgentActivityRuntimeSessionAttachment>;\n readPromptAsset?(\n input: AgentActivityRuntimeReadPromptAssetInput\n ): Promise<AgentActivityRuntimePromptAsset>;\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 PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n ReadWorkspaceFileResult as AgentHostReadWorkspaceFileResult,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\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 writeImage?: (input: {\n data: string;\n mimeType: \"image/png\";\n }) => AgentHostAsyncResult<void>;\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 type AgentHostPersistenceApi = AgentHostRecord & {\n readWorkspaceAgentReadState: (\n input: ReadWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<WorkspaceAgentReadStateSnapshot>;\n writeWorkspaceAgentReadState: (\n input: WriteWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<PersistWriteResult>;\n};\n\nexport type AgentHostToastApi = AgentHostRecord & {\n error: (title: string, description?: string) => void;\n info?: (title: string, description?: string) => void;\n success?: (title: string, description?: string) => void;\n};\n\nexport interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport interface AgentHostSelectFilesInput {\n allowDirectories?: boolean;\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchInput {\n allowBinary?: boolean;\n atomic?: boolean;\n cwd: string;\n diff: string;\n revert?: boolean;\n target?: \"unstaged\" | \"staged\" | \"staged-and-unstaged\";\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchResult {\n status: \"success\" | \"partial-success\" | \"error\";\n appliedPaths: string[];\n skippedPaths: string[];\n conflictedPaths: string[];\n errorCode?: \"not-git-repo\" | string;\n execOutput?: {\n command: string;\n stdout: string;\n stderr: string;\n };\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportInput {\n cwd: string;\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportResult {\n supported: boolean;\n root?: string;\n errorCode?: \"not-git-repo\" | string;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n applyGitPatch?: (\n input: AgentHostApplyWorkspaceGitPatchInput\n ) => AgentHostAsyncResult<AgentHostApplyWorkspaceGitPatchResult>;\n resolveGitPatchSupport?: (\n input: AgentHostResolveWorkspaceGitPatchSupportInput\n ) => AgentHostAsyncResult<AgentHostResolveWorkspaceGitPatchSupportResult>;\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getReferenceForFile?: (file: File) => {\n kind: \"file\" | \"folder\";\n path: string;\n };\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: (\n input?: AgentHostSelectFilesInput\n ) => 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 persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\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 persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\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 persistence: hostApi.persistence,\n runtime: hostApi.runtime,\n toast: hostApi.toast,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n","export function normalizeManagedAgentProvider(\n provider: string | undefined\n): string {\n const normalized =\n provider\n ?.trim()\n .toLowerCase()\n .replace(/[_\\s]+/gu, \"-\") ?? \"\";\n switch (normalized) {\n case \"claude\":\n case \"claude-code\":\n return \"claude-code\";\n case \"nexight\":\n case \"tutti-doc\":\n return \"tutti\";\n default:\n return normalized;\n }\n}\n","import { normalizeManagedAgentProvider } from \"./managedAgentProviders\";\nimport {\n claudeRoundedUrl,\n codexRoundedUrl,\n geminiRoundedUrl,\n hermesRoundedUrl,\n manageAgentClaudeCodeUrl,\n manageAgentCodexUrl,\n manageAgentGeminiUrl,\n manageAgentHermesUrl,\n manageAgentTuttiUrl,\n manageAgentOpenclawUrl,\n tuttiDocRoundedUrl,\n openclawRoundedUrl\n} from \"../managedAgentIconAssets\";\n\n/** Square avatar art for the managed toolchain agents (used by Manage Agents and Launch home Agents floor). */\nexport const MANAGED_AGENT_ICON_URLS: Record<string, string> = {\n \"claude-code\": manageAgentClaudeCodeUrl,\n codex: manageAgentCodexUrl,\n gemini: manageAgentGeminiUrl,\n hermes: manageAgentHermesUrl,\n tutti: manageAgentTuttiUrl,\n openclaw: manageAgentOpenclawUrl\n};\n\n/** Rounded avatars for Room status / room activity panel only. */\nexport const MANAGED_AGENT_ICON_ROUNDED_URLS: Record<string, string> = {\n \"claude-code\": claudeRoundedUrl,\n codex: codexRoundedUrl,\n gemini: geminiRoundedUrl,\n hermes: hermesRoundedUrl,\n tutti: tuttiDocRoundedUrl,\n openclaw: openclawRoundedUrl\n};\n\n/** 与 Manage Agents 列表用的方图区分;房间预览弹幕条等仅用圆图 */\nconst MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL = tuttiDocRoundedUrl;\n\nexport const MANAGED_AGENT_ICON_FALLBACK_URL = manageAgentTuttiUrl;\n\nexport function managedAgentRoundedIconUrl(\n provider: string | undefined\n): string {\n return (\n MANAGED_AGENT_ICON_ROUNDED_URLS[normalizeManagedAgentProvider(provider)] ??\n MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAsTH;AAhBJ,IAAM,8BAA8B;A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;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ;AAGO,IAAM,kCAA0D;AAAA,EACrE,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ;AAGA,IAAM,0CAA0C;AAEzC,IAAM,kCAAkC;AAExC,SAAS,2BACd,UACQ;AACR,SACE,gCAAgC,8BAA8B,QAAQ,CAAC,KACvE;AAEJ;","names":["createContext","useContext","jsx","createContext","useContext"]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
setCurrentAgentGuiI18nRuntime,
|
|
7
7
|
translate,
|
|
8
8
|
translateInUiLanguage
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2XVECUTU.js";
|
|
10
10
|
|
|
11
11
|
// i18n/index.ts
|
|
12
12
|
import React, {
|
|
@@ -68,4 +68,4 @@ export {
|
|
|
68
68
|
AgentGuiI18nProvider,
|
|
69
69
|
useTranslation
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-H2YWXFYX.js.map
|
|
@@ -2,10 +2,13 @@ import {
|
|
|
2
2
|
resolveAgentMentionFileThumbnailUrl,
|
|
3
3
|
resolveAgentMentionFileVisualKind
|
|
4
4
|
} from "./chunk-LUGELG5V.js";
|
|
5
|
+
import {
|
|
6
|
+
managedAgentRoundedIconUrl
|
|
7
|
+
} from "./chunk-GL54NRMB.js";
|
|
5
8
|
import {
|
|
6
9
|
translate,
|
|
7
10
|
useTranslation
|
|
8
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-H2YWXFYX.js";
|
|
9
12
|
|
|
10
13
|
// agent-gui/agentGuiNode/agentRichText/agentFileMentionExtension.ts
|
|
11
14
|
import { mergeAttributes, Node } from "@tiptap/core";
|
|
@@ -58,6 +61,9 @@ function normalizeKind(value) {
|
|
|
58
61
|
if (value === "workspace-app-factory") {
|
|
59
62
|
return "workspace-app-factory";
|
|
60
63
|
}
|
|
64
|
+
if (value === "agent-target") {
|
|
65
|
+
return "agent-target";
|
|
66
|
+
}
|
|
61
67
|
return "file";
|
|
62
68
|
}
|
|
63
69
|
function normalizeSessionTitle(value) {
|
|
@@ -168,6 +174,18 @@ function mentionViewModel(attrs, t) {
|
|
|
168
174
|
label: name
|
|
169
175
|
};
|
|
170
176
|
}
|
|
177
|
+
if (kind === "agent-target") {
|
|
178
|
+
const agentProviderId = attrString(attrs, "agentProviderId").trim();
|
|
179
|
+
return {
|
|
180
|
+
ariaLabel: `${t("agentHost.agentGui.mentionKindAgent")} ${name}`.trim(),
|
|
181
|
+
directoryPath: "",
|
|
182
|
+
entryKind: "",
|
|
183
|
+
href,
|
|
184
|
+
iconUrl: attrString(attrs, "iconUrl").trim() || managedAgentRoundedIconUrl(agentProviderId),
|
|
185
|
+
kind,
|
|
186
|
+
label: name
|
|
187
|
+
};
|
|
188
|
+
}
|
|
171
189
|
const path = attrString(attrs, "path") || href;
|
|
172
190
|
const entryKind = attrString(attrs, "entryKind") || "unknown";
|
|
173
191
|
return {
|
|
@@ -355,7 +373,7 @@ function AgentMentionNodeView(props) {
|
|
|
355
373
|
if (mention.kind === "file") {
|
|
356
374
|
return /* @__PURE__ */ jsx(AgentMentionLegacyFileNodeView, { ...props });
|
|
357
375
|
}
|
|
358
|
-
if (mention.kind === "workspace-app" || mention.kind === "workspace-reference") {
|
|
376
|
+
if (mention.kind === "workspace-app" || mention.kind === "workspace-reference" || mention.kind === "agent-target") {
|
|
359
377
|
return /* @__PURE__ */ jsx(
|
|
360
378
|
NodeViewWrapper,
|
|
361
379
|
{
|
|
@@ -482,6 +500,7 @@ function createAgentFileMentionExtension(options = {}) {
|
|
|
482
500
|
creatorName: { default: "" },
|
|
483
501
|
topicId: { default: "" },
|
|
484
502
|
appId: { default: "" },
|
|
503
|
+
agentProviderId: { default: "" },
|
|
485
504
|
jobId: { default: "" },
|
|
486
505
|
action: { default: "" },
|
|
487
506
|
contextPath: { default: "" },
|
|
@@ -529,7 +548,7 @@ function createAgentFileMentionExtension(options = {}) {
|
|
|
529
548
|
"data-agent-file-visual-kind": resolveAgentMentionFileVisualKind(item)
|
|
530
549
|
} : {},
|
|
531
550
|
...options.renderAsLink ? { href } : {},
|
|
532
|
-
...(item.kind === "workspace-app" || item.kind === "workspace-reference") && item.iconUrl ? { "data-agent-mention-icon-url": item.iconUrl } : {},
|
|
551
|
+
...(item.kind === "workspace-app" || item.kind === "agent-target" || item.kind === "workspace-reference") && item.iconUrl ? { "data-agent-mention-icon-url": item.iconUrl } : {},
|
|
533
552
|
...item.kind === "workspace-reference" ? { "data-agent-mention-file-count": String(item.fileCount) } : {},
|
|
534
553
|
...fileThumbnailUrl ? { "data-agent-mention-thumbnail-url": fileThumbnailUrl } : {},
|
|
535
554
|
class: item.kind === "file" ? "tsh-agent-object-token tsh-agent-object-token--file" : "tsh-agent-object-token tsh-agent-object-token--entity"
|
|
@@ -638,6 +657,9 @@ function createAgentFileMentionExtension(options = {}) {
|
|
|
638
657
|
allowSpaces: true,
|
|
639
658
|
items: () => [],
|
|
640
659
|
allow: ({ state, range }) => {
|
|
660
|
+
if (options.shouldSuppressSuggestion?.()) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
641
663
|
if (range.from <= 1) {
|
|
642
664
|
return true;
|
|
643
665
|
}
|
|
@@ -728,6 +750,14 @@ function formatAgentMentionMarkdown(item) {
|
|
|
728
750
|
}
|
|
729
751
|
});
|
|
730
752
|
}
|
|
753
|
+
if (item.kind === "agent-target") {
|
|
754
|
+
return createRichTextMentionMarkdown({
|
|
755
|
+
providerId: "agent-target",
|
|
756
|
+
entityId: item.targetId,
|
|
757
|
+
label: item.name,
|
|
758
|
+
scope: { workspaceId: item.workspaceId }
|
|
759
|
+
});
|
|
760
|
+
}
|
|
731
761
|
const identity = parseRichTextMentionHref(item.href, item.name);
|
|
732
762
|
return identity ? createRichTextMentionMarkdown(identity) : "";
|
|
733
763
|
}
|
|
@@ -866,6 +896,18 @@ function parseMentionItemFromHref(input) {
|
|
|
866
896
|
name
|
|
867
897
|
};
|
|
868
898
|
}
|
|
899
|
+
if (resource === "agent-target") {
|
|
900
|
+
if (!workspaceId) {
|
|
901
|
+
return null;
|
|
902
|
+
}
|
|
903
|
+
return {
|
|
904
|
+
kind: "agent-target",
|
|
905
|
+
href,
|
|
906
|
+
workspaceId,
|
|
907
|
+
targetId,
|
|
908
|
+
name
|
|
909
|
+
};
|
|
910
|
+
}
|
|
869
911
|
if (resource === "workspace-reference") {
|
|
870
912
|
if (!workspaceId) {
|
|
871
913
|
return null;
|
|
@@ -943,6 +985,18 @@ function mentionItemToAttrs(item) {
|
|
|
943
985
|
iconUrl: item.iconUrl ?? ""
|
|
944
986
|
};
|
|
945
987
|
}
|
|
988
|
+
if (item.kind === "agent-target") {
|
|
989
|
+
return {
|
|
990
|
+
name: item.name,
|
|
991
|
+
kind: item.kind,
|
|
992
|
+
href: item.href,
|
|
993
|
+
...workspaceMentionAttrs(item.workspaceId),
|
|
994
|
+
targetId: item.targetId,
|
|
995
|
+
description: item.description ?? "",
|
|
996
|
+
agentProviderId: item.agentProviderId ?? "",
|
|
997
|
+
iconUrl: item.iconUrl ?? ""
|
|
998
|
+
};
|
|
999
|
+
}
|
|
946
1000
|
if (item.kind === "workspace-reference") {
|
|
947
1001
|
return {
|
|
948
1002
|
name: item.name,
|
|
@@ -1040,6 +1094,20 @@ function attrsToMentionItem(attrs) {
|
|
|
1040
1094
|
iconUrl: typeof attrs.iconUrl === "string" && attrs.iconUrl.trim() ? attrs.iconUrl.trim() : void 0
|
|
1041
1095
|
};
|
|
1042
1096
|
}
|
|
1097
|
+
if (kind === "agent-target") {
|
|
1098
|
+
const workspaceId = workspaceIdFromMentionAttrs(attrs);
|
|
1099
|
+
const targetId = typeof attrs.targetId === "string" ? attrs.targetId : "";
|
|
1100
|
+
return {
|
|
1101
|
+
kind,
|
|
1102
|
+
href,
|
|
1103
|
+
workspaceId,
|
|
1104
|
+
targetId,
|
|
1105
|
+
name,
|
|
1106
|
+
description: typeof attrs.description === "string" ? attrs.description : void 0,
|
|
1107
|
+
agentProviderId: typeof attrs.agentProviderId === "string" && attrs.agentProviderId.trim() ? attrs.agentProviderId.trim() : void 0,
|
|
1108
|
+
iconUrl: typeof attrs.iconUrl === "string" && attrs.iconUrl.trim() ? attrs.iconUrl.trim() : void 0
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1043
1111
|
if (kind === "workspace-reference") {
|
|
1044
1112
|
const workspaceId = workspaceIdFromMentionAttrs(attrs);
|
|
1045
1113
|
const targetId = typeof attrs.targetId === "string" ? attrs.targetId.trim() : "";
|
|
@@ -1124,6 +1192,9 @@ function normalizeMentionKind(value) {
|
|
|
1124
1192
|
if (value === "workspace-app") {
|
|
1125
1193
|
return "workspace-app";
|
|
1126
1194
|
}
|
|
1195
|
+
if (value === "agent-target") {
|
|
1196
|
+
return "agent-target";
|
|
1197
|
+
}
|
|
1127
1198
|
if (value === "workspace-reference") {
|
|
1128
1199
|
return "workspace-reference";
|
|
1129
1200
|
}
|
|
@@ -1155,6 +1226,12 @@ function mentionVisual(item) {
|
|
|
1155
1226
|
primary: item.name
|
|
1156
1227
|
};
|
|
1157
1228
|
}
|
|
1229
|
+
if (item.kind === "agent-target") {
|
|
1230
|
+
return {
|
|
1231
|
+
kindLabel: "Agent",
|
|
1232
|
+
primary: item.name
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1158
1235
|
if (item.kind === "workspace-app-factory") {
|
|
1159
1236
|
return {
|
|
1160
1237
|
kindLabel: "App Factory",
|
|
@@ -1224,4 +1301,4 @@ export {
|
|
|
1224
1301
|
mentionItemToAttrs,
|
|
1225
1302
|
attrsToMentionItem
|
|
1226
1303
|
};
|
|
1227
|
-
//# sourceMappingURL=chunk-
|
|
1304
|
+
//# sourceMappingURL=chunk-NBTJEF3H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../agent-gui/agentGuiNode/agentRichText/agentFileMentionExtension.ts","../agent-gui/agentGuiNode/agentRichText/AgentMentionNodeView.tsx","../agent-gui/agentGuiNode/agentRichText/agentRichTextCaretAnchor.ts"],"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 createRichTextLinkMarkdown,\n createRichTextMentionMarkdown,\n isRichTextMentionHref,\n parseRichTextMentionHref\n} from \"@tutti-os/ui-rich-text/core\";\nimport {\n resolveAgentMentionFileThumbnailUrl,\n resolveAgentMentionFileVisualKind\n} from \"../../shared/mentionFilePresentation\";\nimport { translate } from \"../../../i18n/index\";\nimport { AgentMentionNodeView } from \"./AgentMentionNodeView\";\nimport { AGENT_RICH_TEXT_CARET_ANCHOR } from \"./agentRichTextCaretAnchor\";\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 | \"agent-target\"\n | \"session\"\n | \"workspace-app\"\n | \"workspace-reference\"\n | \"workspace-app-factory\"\n | \"workspace-issue\";\n\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 AgentMentionAgentTargetItem {\n kind: \"agent-target\";\n href: string;\n workspaceId: string;\n targetId: string;\n name: string;\n description?: string;\n agentProviderId?: string;\n iconUrl?: string;\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 | AgentMentionAgentTargetItem\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 shouldSuppressSuggestion?: () => 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 agentProviderId: { 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 === \"agent-target\" ||\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 (options.shouldSuppressSuggestion?.()) {\n return false;\n }\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 const prefixCaretAnchor =\n range.from <= 1 ||\n editor.state.doc.textBetween(\n Math.max(1, range.from - 1),\n range.from,\n \"\\n\",\n \"\\n\"\n ) === \"\\n\";\n editor\n .chain()\n .focus()\n .insertContentAt(range, [\n ...(prefixCaretAnchor\n ? ([\n {\n type: \"text\",\n text: AGENT_RICH_TEXT_CARET_ANCHOR\n }\n ] as const)\n : []),\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 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 if (item.kind === \"file\") {\n const label = item.name.trim().startsWith(\"@\")\n ? item.name\n : `@${item.name}`;\n return createRichTextLinkMarkdown({\n kind: \"file\",\n name: label,\n path: item.href\n });\n }\n if (item.kind === \"workspace-reference\") {\n return createRichTextMentionMarkdown({\n providerId: \"workspace-reference\",\n entityId: item.targetId,\n label: item.name,\n scope: {\n workspaceId: item.workspaceId,\n source: item.source,\n ...(item.groupId?.trim() ? { groupId: item.groupId.trim() } : {}),\n ...(item.fileCount > 0 ? { count: String(item.fileCount) } : {})\n }\n });\n }\n if (item.kind === \"agent-target\") {\n return createRichTextMentionMarkdown({\n providerId: \"agent-target\",\n entityId: item.targetId,\n label: item.name,\n scope: { workspaceId: item.workspaceId }\n });\n }\n const identity = parseRichTextMentionHref(item.href, item.name);\n return identity ? createRichTextMentionMarkdown(identity) : \"\";\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 !isRichTextMentionHref(href)\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 const mention = parseRichTextMentionHref(href, input.name);\n if (!mention && !isRichTextMentionHref(href)) {\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 if (!mention) {\n return null;\n }\n\n const resource = mention.providerId.trim().toLowerCase();\n const targetId = mention.entityId.trim();\n const workspaceId = mention.scope?.workspaceId?.trim() ?? \"\";\n const name = mention.label;\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,\n title: 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: mention.scope?.topicId?.trim() || undefined,\n name,\n title: 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\n };\n }\n if (resource === \"agent-target\") {\n if (!workspaceId) {\n return null;\n }\n return {\n kind: \"agent-target\",\n href,\n workspaceId,\n targetId,\n name\n };\n }\n if (resource === \"workspace-reference\") {\n if (!workspaceId) {\n return null;\n }\n const source = mention.scope?.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: mention.scope?.groupId?.trim() || undefined,\n name,\n iconUrl: mention.scope?.icon?.trim() || undefined,\n fileCount: parseMentionFileCount(mention.scope?.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 name ||\n translate(\"agentHost.agentGui.workspaceAppFactoryMentionFallback\"),\n action: mention.scope?.action?.trim() || undefined,\n contextPath: mention.scope?.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 === \"agent-target\") {\n return {\n name: item.name,\n kind: item.kind,\n href: item.href,\n ...workspaceMentionAttrs(item.workspaceId),\n targetId: item.targetId,\n description: item.description ?? \"\",\n agentProviderId: item.agentProviderId ?? \"\",\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,\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 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,\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 === \"agent-target\") {\n const workspaceId = workspaceIdFromMentionAttrs(attrs);\n const targetId = typeof attrs.targetId === \"string\" ? attrs.targetId : \"\";\n return {\n kind,\n href,\n workspaceId,\n targetId,\n name,\n description:\n typeof attrs.description === \"string\" ? attrs.description : undefined,\n agentProviderId:\n typeof attrs.agentProviderId === \"string\" &&\n attrs.agentProviderId.trim()\n ? attrs.agentProviderId.trim()\n : 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 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 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 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 === \"agent-target\") {\n return \"agent-target\";\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 === \"agent-target\") {\n return {\n kindLabel: \"Agent\",\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","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\";\nimport { managedAgentRoundedIconUrl } from \"../../../shared/managedAgentIcons\";\nimport { AGENT_RICH_TEXT_CARET_ANCHOR } from \"./agentRichTextCaretAnchor\";\n\ntype AgentMentionNodeViewKind =\n | \"file\"\n | \"agent-target\"\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 if (value === \"agent-target\") {\n return \"agent-target\";\n }\n return \"file\";\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,\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,\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,\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,\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,\n kind,\n label: name\n };\n }\n\n if (kind === \"agent-target\") {\n const agentProviderId = attrString(attrs, \"agentProviderId\").trim();\n return {\n ariaLabel: `${t(\"agentHost.agentGui.mentionKindAgent\")} ${name}`.trim(),\n directoryPath: \"\",\n entryKind: \"\",\n href,\n iconUrl:\n attrString(attrs, \"iconUrl\").trim() ||\n managedAgentRoundedIconUrl(agentProviderId),\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 (\n node.isText &&\n node.textContent.replaceAll(AGENT_RICH_TEXT_CARET_ANCHOR, \"\").trim()\n .length > 0\n ) {\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={`agent-rich-text-mention-node 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 mention.kind === \"agent-target\"\n ) {\n return (\n <NodeViewWrapper\n as=\"span\"\n aria-label={mention.ariaLabel}\n className={`agent-rich-text-mention-node inline-flex max-w-[min(100%,var(--agent-mention-max-width,16rem))] align-middle ${\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-0 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 align-middle text-[13px] font-medium leading-6 text-[var(--agent-gui-mention-app-color,var(--tutti-purple))] 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={`agent-rich-text-mention-node inline-flex max-w-[min(100%,var(--agent-mention-max-width,16rem))] align-middle ${\n selected ? \"is-selected\" : \"\"\n }`}\n contentEditable={false}\n >\n <MentionPill\n aria-label={mention.ariaLabel}\n className=\"top-0 h-6 py-0 align-middle leading-6\"\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","export const AGENT_RICH_TEXT_CARET_ANCHOR = \"\\u200B\";\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,iBAAiB,YAAqC;AAC/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