@tutti-os/agent-gui 0.0.67 → 0.0.69

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 (89) hide show
  1. package/dist/agent-conversation/index.d.ts +2 -2
  2. package/dist/agent-conversation/index.js +8 -8
  3. package/dist/agent-env/index.js +2 -1
  4. package/dist/agent-env/index.js.map +1 -1
  5. package/dist/agent-message-center/index.js +10 -10
  6. package/dist/{agentGuiNodeTypes-DNXndXhV.d.ts → agentGuiNodeTypes-BipgG2ib.d.ts} +9 -1
  7. package/dist/app/renderer/agentactivity.css +107 -9
  8. package/dist/app/renderer/assets/icons/agents/opencode-flat-filled.svg +4 -0
  9. package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
  10. package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
  11. package/dist/{chunk-OEJQJP65.js → chunk-4I2VCAMW.js} +14 -1
  12. package/dist/chunk-4I2VCAMW.js.map +1 -0
  13. package/dist/{chunk-IL2ORY23.js → chunk-4US2YHBY.js} +3 -1
  14. package/dist/chunk-4US2YHBY.js.map +1 -0
  15. package/dist/{chunk-JGU2VMDA.js → chunk-547R2HOD.js} +3 -3
  16. package/dist/{chunk-PFKY5W76.js → chunk-6XRTDIDR.js} +13 -28
  17. package/dist/chunk-6XRTDIDR.js.map +1 -0
  18. package/dist/{chunk-NCAVJEHI.js → chunk-ATEZXUHK.js} +1 -1
  19. package/dist/chunk-ATEZXUHK.js.map +1 -0
  20. package/dist/{chunk-RNFP7CUO.js → chunk-BHNJN2TR.js} +5 -2
  21. package/dist/chunk-BHNJN2TR.js.map +1 -0
  22. package/dist/{chunk-CTYXJGSW.js → chunk-DAPKF2SN.js} +3 -3
  23. package/dist/{chunk-XBR7D7X2.js → chunk-EHLJL76A.js} +2 -2
  24. package/dist/{chunk-YYAP6IK7.js → chunk-ERBUQOIL.js} +3 -3
  25. package/dist/{chunk-UAXKJNM2.js → chunk-FRAG4UFU.js} +74 -24
  26. package/dist/chunk-FRAG4UFU.js.map +1 -0
  27. package/dist/{chunk-YU3XLPLC.js → chunk-HAKNLXW7.js} +2 -2
  28. package/dist/{chunk-QZYGCZNQ.js → chunk-JA6Z3QA7.js} +4 -4
  29. package/dist/{chunk-MA254MXR.js → chunk-KAPBUKIT.js} +33 -15
  30. package/dist/chunk-KAPBUKIT.js.map +1 -0
  31. package/dist/{chunk-JWWHS34V.js → chunk-KTIHLBCN.js} +12 -3
  32. package/dist/chunk-KTIHLBCN.js.map +1 -0
  33. package/dist/{chunk-ZABN3POD.js → chunk-KTIKZNGS.js} +6 -2
  34. package/dist/chunk-KTIKZNGS.js.map +1 -0
  35. package/dist/{chunk-SKWDZTEV.js → chunk-N37A62BK.js} +21 -1
  36. package/dist/chunk-N37A62BK.js.map +1 -0
  37. package/dist/{chunk-KS4ULVGM.js → chunk-NH3XBJTZ.js} +2 -2
  38. package/dist/{chunk-DQTBWOIK.js → chunk-NROZAN34.js} +16 -4
  39. package/dist/chunk-NROZAN34.js.map +1 -0
  40. package/dist/{chunk-VIJQ5C33.js → chunk-S32FLJRP.js} +5 -5
  41. package/dist/{chunk-DP2X4J2D.js → chunk-UAAXRSW2.js} +3 -3
  42. package/dist/{chunk-BX4UBTOI.js → chunk-ZZBLWZJR.js} +12 -6
  43. package/dist/chunk-ZZBLWZJR.js.map +1 -0
  44. package/dist/context-mention-palette/index.js +9 -9
  45. package/dist/i18n/index.d.ts +32 -14
  46. package/dist/i18n/index.js +2 -2
  47. package/dist/index.d.ts +22 -6
  48. package/dist/index.js +1895 -998
  49. package/dist/index.js.map +1 -1
  50. package/dist/opencode-flat-filled-CYAJPX45.svg +4 -0
  51. package/dist/queued-prompt-runtime.d.ts +2 -2
  52. package/dist/{types-BxOwnK7K.d.ts → types-DZ79b8Zn.d.ts} +8 -3
  53. package/dist/workbench/contribution.d.ts +1 -1
  54. package/dist/workbench/contribution.js +8 -8
  55. package/dist/workbench/index.d.ts +3 -2
  56. package/dist/workbench/index.js +11 -11
  57. package/dist/workbench/launch.d.ts +1 -1
  58. package/dist/workbench/launch.js +3 -3
  59. package/dist/workbench/providerCatalog.d.ts +3 -3
  60. package/dist/workbench/providerCatalog.js +1 -1
  61. package/dist/workbench/sessionTitle.d.ts +1 -1
  62. package/dist/workbench/sessionTitle.js +3 -3
  63. package/dist/workbench/state.d.ts +11 -2
  64. package/dist/workbench/state.js +5 -3
  65. package/dist/workbench/types.d.ts +2 -2
  66. package/dist/workbench/types.js +1 -1
  67. package/dist/workspace-agent-generated-files.js +4 -4
  68. package/package.json +12 -12
  69. package/dist/chunk-BX4UBTOI.js.map +0 -1
  70. package/dist/chunk-DQTBWOIK.js.map +0 -1
  71. package/dist/chunk-IL2ORY23.js.map +0 -1
  72. package/dist/chunk-JWWHS34V.js.map +0 -1
  73. package/dist/chunk-MA254MXR.js.map +0 -1
  74. package/dist/chunk-NCAVJEHI.js.map +0 -1
  75. package/dist/chunk-OEJQJP65.js.map +0 -1
  76. package/dist/chunk-PFKY5W76.js.map +0 -1
  77. package/dist/chunk-RNFP7CUO.js.map +0 -1
  78. package/dist/chunk-SKWDZTEV.js.map +0 -1
  79. package/dist/chunk-UAXKJNM2.js.map +0 -1
  80. package/dist/chunk-ZABN3POD.js.map +0 -1
  81. /package/dist/{chunk-JGU2VMDA.js.map → chunk-547R2HOD.js.map} +0 -0
  82. /package/dist/{chunk-CTYXJGSW.js.map → chunk-DAPKF2SN.js.map} +0 -0
  83. /package/dist/{chunk-XBR7D7X2.js.map → chunk-EHLJL76A.js.map} +0 -0
  84. /package/dist/{chunk-YYAP6IK7.js.map → chunk-ERBUQOIL.js.map} +0 -0
  85. /package/dist/{chunk-YU3XLPLC.js.map → chunk-HAKNLXW7.js.map} +0 -0
  86. /package/dist/{chunk-QZYGCZNQ.js.map → chunk-JA6Z3QA7.js.map} +0 -0
  87. /package/dist/{chunk-KS4ULVGM.js.map → chunk-NH3XBJTZ.js.map} +0 -0
  88. /package/dist/{chunk-VIJQ5C33.js.map → chunk-S32FLJRP.js.map} +0 -0
  89. /package/dist/{chunk-DP2X4J2D.js.map → chunk-UAAXRSW2.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../shared/agentCustomMentionKinds.ts","../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts","../shared/managedAgentIcons.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\n// 自定义 mention kind 注册表:让宿主(如 tsh)从外部注册 mention://<kind>/... 链接的\n// 解析与 composer 内 chip 渲染,包内不内置任何具体业务 kind。\n//\n// 管线接点:\n// - 解析:agentFileMentionExtension.parseMentionItemFromHref 命中注册 kind 时产出\n// AgentMentionCustomItem(展示字段由 present() 提取;href 是完整信息源,round-trip 无损)\n// - 渲染:AgentMentionNodeView 对 kind===\"custom\" 调 renderChip(),缺省用包内通用双行卡\n// - 点击:clickable 的 kind 经 resolveWorkspaceMentionLinkAction 上抛\n// open-custom-mention 链接动作(携带原始 href,宿主自行二次解析)\n//\n// 注册时机:宿主渲染进程 bootstrap(早于首个 composer 挂载);模块级单例,重复注册以\n// 后者为准(HMR 友好)。\n\nexport interface AgentCustomMentionIdentity {\n entityId: string;\n label: string;\n scope?: Readonly<Record<string, string>>;\n}\n\nexport interface AgentCustomMentionPresentation {\n /** chip 第一行(缺省用链接 label)。 */\n name: string;\n /** chip 第二行(可选,通用双行卡的次要文案)。 */\n summary?: string;\n /** 所属 workspace(可选;custom kind 的 scope 键由注册方约定)。 */\n workspaceId?: string;\n}\n\nexport interface AgentCustomMentionChipContext {\n href: string;\n name: string;\n summary?: string;\n isEditable: boolean;\n /** 可编辑态的移除按钮,由 NodeView 注入;自定义渲染需自行摆放。 */\n removeAction?: ReactNode;\n}\n\nexport interface AgentCustomMentionKindDefinition {\n /** mention://<kind>/... 的 providerId(URL hostname,小写)。 */\n kind: string;\n /**\n * 从 canonical mention 链接提取展示字段;返回 null 表示链接无效,\n * 退化为普通链接/字面文本。\n */\n present(\n mention: AgentCustomMentionIdentity,\n href: string\n ): AgentCustomMentionPresentation | null;\n /** 自定义 chip 渲染;缺省用包内通用双行卡(name + summary)。 */\n renderChip?(context: AgentCustomMentionChipContext): ReactNode;\n /** 点击是否上抛 open-custom-mention 链接动作;缺省 false(chip 只展示)。 */\n clickable?: boolean;\n}\n\nconst registry = new Map<string, AgentCustomMentionKindDefinition>();\n\n// 包内管线已内置处理的 providerId(agentFileMentionExtension /\n// resolveWorkspaceMentionLinkAction),以及宿主侧沿用的 legacy 短名与内部 kind。\n// 注册表查找在部分链路先于内置分支执行,若放行同名注册会静默劫持内置 mention\n// 的解析——注册发生在宿主 bootstrap,直接抛错 fail-fast。\nconst RESERVED_AGENT_MENTION_PROVIDER_IDS = new Set([\n \"agent-session\",\n \"agent-target\",\n \"custom\",\n \"file\",\n \"issue\",\n \"session\",\n \"task\",\n \"workspace-app\",\n \"workspace-app-factory\",\n \"workspace-issue\",\n \"workspace-reference\"\n]);\n\nexport function registerAgentCustomMentionKind(\n definition: AgentCustomMentionKindDefinition\n): void {\n const kind = definition.kind.trim().toLowerCase();\n if (!kind) {\n throw new Error(\n \"[agent-gui] custom mention kind must be a non-empty provider id\"\n );\n }\n if (RESERVED_AGENT_MENTION_PROVIDER_IDS.has(kind)) {\n throw new Error(\n `[agent-gui] custom mention kind \"${kind}\" collides with a built-in provider id`\n );\n }\n registry.set(kind, definition);\n}\n\nexport function getAgentCustomMentionKind(\n kind: string\n): AgentCustomMentionKindDefinition | undefined {\n return registry.get(kind.trim().toLowerCase());\n}\n\nexport function resetAgentCustomMentionKindsForTests(): void {\n registry.clear();\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityCancelSessionInput,\n AgentActivityCancelSessionResult,\n AgentActivityGoalControlInput,\n AgentActivityGoalControlResult,\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\";\nimport { WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN } from \"./shared/workspaceAgentActivityTypes\";\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 AgentActivityRuntimeListSessionsPageInput {\n limit?: number;\n searchQuery?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeSessionPageResult {\n hasMore: boolean;\n nextCursor?: string;\n sessions: AgentActivitySession[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionsInput {\n agentTargetId?: string | null;\n limitPerSection?: number;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionPageInput {\n agentTargetId?: string | null;\n cursor?: string;\n limit?: number;\n sectionKey: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUserProject {\n createdAtUnixMs: number;\n id: string;\n label: string;\n lastUsedAtUnixMs?: number;\n path: string;\n sectionKey: string;\n updatedAtUnixMs: number;\n}\n\nexport interface AgentActivityRuntimeSessionSection {\n kind: \"conversations\" | \"project\";\n sectionKey: string;\n userProject?: AgentActivityRuntimeUserProject;\n sessions: AgentActivitySession[];\n hasMore: boolean;\n nextCursor?: string;\n}\n\nexport interface AgentActivityRuntimeSessionSectionsResult {\n sections: AgentActivityRuntimeSessionSection[];\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 /**\n * Stable identity of this runtime instance (e.g. a local origin vs a\n * shared/room origin). When present, the conversation-list and session-view\n * stores key their query state, runtime resolution, and subscriptions by this\n * value, so multiple runtimes can coexist for the same workspace without\n * fighting over a single module-global slot. Absent => legacy single-runtime\n * behaviour resolved via the module-global.\n */\n origin?: string;\n /**\n * The session cwd is not resolvable on the local filesystem (e.g. a\n * shared/cloud sandbox not mounted locally), so AgentGUI must not run its\n * local stat-based \"working directory missing\" existence check — it would\n * always false-positive. Absent/false (default) => local, legacy behaviour.\n * Only that one guard is gated; project selection/listing is unaffected.\n */\n projectPathIsRemote?: boolean;\n promptContentUploadSupport?: {\n file?: boolean;\n image?: boolean;\n };\n cancelSession(\n input: AgentActivityCancelSessionInput\n ): Promise<AgentActivityCancelSessionResult>;\n goalControl(\n input: AgentActivityGoalControlInput\n ): Promise<AgentActivityGoalControlResult>;\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 listSessionsPage?(\n input: AgentActivityRuntimeListSessionsPageInput\n ): Promise<AgentActivityRuntimeSessionPageResult>;\n listSessionSections?(\n input: AgentActivityRuntimeListSessionSectionsInput\n ): Promise<AgentActivityRuntimeSessionSectionsResult>;\n listSessionSectionPage?(\n input: AgentActivityRuntimeListSessionSectionPageInput\n ): Promise<AgentActivityRuntimeSessionSection>;\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\n// Registry of runtimes indexed by their stable `origin`. Non-React module\n// singletons (the conversation-list and session-view stores) resolve the\n// correct runtime for a query's origin from here instead of reading the\n// last-mounted module-global — the single slot two runtimes used to fight over.\nconst runtimesByOrigin = new Map<string, AgentActivityRuntime>();\n\n// A runtime without an explicit origin is the default (local) runtime. It\n// registers under this canonical origin — the same value the conversation-list\n// query and session-view refs fall back to — so the local window resolves to it\n// by origin instead of depending on the last-mounted module-global. A shared/\n// room runtime opts in by setting a distinct `origin`; no host wiring needed for\n// the local case.\nfunction normalizeRuntimeOrigin(origin: string | null | undefined): string {\n return origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;\n}\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 const origin = normalizeRuntimeOrigin(runtime?.origin);\n // Register during render to close the gap before the effect runs (parity with\n // the module-global write above); the effect owns cleanup on unmount.\n if (origin && runtime) {\n runtimesByOrigin.set(origin, runtime);\n }\n useEffect(() => {\n if (!origin || !runtime) {\n return;\n }\n runtimesByOrigin.set(origin, runtime);\n return () => {\n // Only clear if a newer provider hasn't already re-registered this origin.\n if (runtimesByOrigin.get(origin) === runtime) {\n runtimesByOrigin.delete(origin);\n }\n };\n }, [origin, runtime]);\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\n/**\n * Resolve the runtime for a given origin. When the origin is registered (two\n * runtimes coexisting for one workspace), returns that exact instance.\n *\n * Only the default (local) origin falls back to legacy single-runtime\n * resolution. An explicit non-default origin that is not registered returns null\n * rather than cross-routing to a different runtime via the module-global slot —\n * e.g. a shared query must never silently load from the local runtime.\n */\nexport function getAgentActivityRuntimeByOrigin(\n origin: string | null | undefined\n): AgentActivityRuntime | null {\n const normalizedOrigin = normalizeRuntimeOrigin(origin);\n const runtime = runtimesByOrigin.get(normalizedOrigin);\n if (runtime) {\n return runtime;\n }\n if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {\n return getOptionalAgentActivityRuntime();\n }\n return null;\n}\n\nexport function resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = null;\n runtimesByOrigin.clear();\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 useEffect,\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\";\nimport { WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN } from \"./shared/workspaceAgentActivityTypes\";\n\nconst AgentActivityHostContext = createContext<AgentHostRuntimeApi | null>(\n null\n);\n\nlet currentAgentHostApi: AgentHostRuntimeApi | null = null;\n\n// Host APIs indexed by their runtime origin, mirroring the runtime registry.\n// Read-state persistence resolves the host API by the query's origin so a\n// local window persists to the local host and a shared/cloud window persists to\n// its own cloud host — each backend keyed by (roomId, userId) with no origin\n// needed on the record itself.\nconst hostApiByOrigin = new Map<string, AgentHostRuntimeApi>();\n\nfunction resolveHostOrigin(\n runtime: AgentActivityRuntime | null | undefined\n): string {\n return (\n runtime?.origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN\n );\n}\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 const origin = resolveHostOrigin(agentActivityRuntime);\n // Register during render to close the gap before the effect runs; the effect\n // owns cleanup on unmount.\n if (resolvedAgentHostApi) {\n hostApiByOrigin.set(origin, resolvedAgentHostApi);\n }\n useEffect(() => {\n if (!resolvedAgentHostApi) {\n return;\n }\n hostApiByOrigin.set(origin, resolvedAgentHostApi);\n return () => {\n if (hostApiByOrigin.get(origin) === resolvedAgentHostApi) {\n hostApiByOrigin.delete(origin);\n }\n };\n }, [origin, 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 getOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return (\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi()\n );\n}\n\n/**\n * Resolve the host API for a given runtime origin. When the origin is registered\n * (local vs shared/cloud host), returns that exact host API so its persistence\n * (read-state, etc.) targets the matching backend; otherwise falls back to\n * legacy single-host resolution.\n */\nexport function getAgentHostApiByOrigin(\n origin: string | null | undefined\n): AgentHostRuntimeApi | null {\n const normalizedOrigin =\n origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;\n const hostApi = hostApiByOrigin.get(normalizedOrigin);\n if (hostApi) {\n return hostApi;\n }\n // Only the default (local) origin falls back to the legacy single-host slot.\n // An explicit non-default origin that is not registered returns null so its\n // persistence never lands in a different host's store (e.g. shared read-state\n // must not be written to the local backend).\n if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {\n return getOptionalAgentHostApi();\n }\n return null;\n}\n\nexport function resetAgentHostApiForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = null;\n hostApiByOrigin.clear();\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","import { normalizeManagedAgentProvider } from \"./managedAgentProviders\";\nimport {\n claudeRoundedUrl,\n codexRoundedUrl,\n cursorColorfulUrl,\n cursorRoundedUrl,\n geminiRoundedUrl,\n hermesRoundedUrl,\n manageAgentClaudeCodeUrl,\n manageAgentCodexUrl,\n manageAgentGeminiUrl,\n manageAgentHermesUrl,\n manageAgentOpenCodeUrl,\n manageAgentTuttiUrl,\n manageAgentOpenclawUrl,\n providerRailClaudeCodeColorfulUrl,\n providerRailCodexColorfulUrl,\n providerRailHermesColorfulUrl,\n providerRailOpenCodeColorfulUrl,\n providerRailTuttiUrl,\n tuttiDocRoundedUrl,\n opencodeRoundedUrl,\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 cursor: cursorRoundedUrl,\n gemini: manageAgentGeminiUrl,\n hermes: manageAgentHermesUrl,\n tutti: manageAgentTuttiUrl,\n openclaw: manageAgentOpenclawUrl,\n opencode: manageAgentOpenCodeUrl\n};\n\n/** Colorful provider rail icons used by AgentGUI's left provider filter. */\nexport const MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS: Record<string, string> = {\n \"claude-code\": providerRailClaudeCodeColorfulUrl,\n codex: providerRailCodexColorfulUrl,\n cursor: cursorColorfulUrl,\n hermes: providerRailHermesColorfulUrl,\n tutti: providerRailTuttiUrl,\n opencode: providerRailOpenCodeColorfulUrl\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 cursor: cursorColorfulUrl,\n gemini: geminiRoundedUrl,\n hermes: hermesRoundedUrl,\n tutti: tuttiDocRoundedUrl,\n openclaw: openclawRoundedUrl,\n opencode: opencodeRoundedUrl\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAM,WAAW,oBAAI,IAA8C;AAMnE,IAAM,sCAAsC,oBAAI,IAAI;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,+BACd,YACM;AACN,QAAM,OAAO,WAAW,KAAK,KAAK,EAAE,YAAY;AAChD,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI,oCAAoC,IAAI,IAAI,GAAG;AACjD,UAAM,IAAI;AAAA,MACR,oCAAoC,IAAI;AAAA,IAC1C;AAAA,EACF;AACA,WAAS,IAAI,MAAM,UAAU;AAC/B;AAEO,SAAS,0BACd,MAC8C;AAC9C,S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ACT;AACA,QAAM,mBAAmB,eAAe;AAIxC,SAAO,mBAAmB,sBAAsB,gBAAgB,IAAI;AACtE;;;AE9JO,IAAM,0BAAkD;AAAA,EAC7D,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,IAAM,wCAAgE;AAAA,EAC3E,eAAe;AAAA,EACf,OAAO;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,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AAGA,IAAM,0CAA0C;AAEzC,IAAM,kCAAkC;AAExC,SAAS,2BACd,UACQ;AACR,SACE,gCAAgC,8BAA8B,QAAQ,CAAC,KACvE;AAEJ;","names":["createContext","useContext","useEffect","jsx","createContext","useEffect","useContext"]}
@@ -4,19 +4,19 @@ import {
4
4
  AgentMentionSearchController,
5
5
  flattenAgentMentionPaletteEntries,
6
6
  groupStartKeys
7
- } from "../chunk-VIJQ5C33.js";
8
- import "../chunk-YYAP6IK7.js";
9
- import "../chunk-YU3XLPLC.js";
7
+ } from "../chunk-S32FLJRP.js";
8
+ import "../chunk-ERBUQOIL.js";
9
+ import "../chunk-HAKNLXW7.js";
10
10
  import "../chunk-IBIMGLCD.js";
11
- import "../chunk-JGU2VMDA.js";
11
+ import "../chunk-547R2HOD.js";
12
12
  import "../chunk-Y35GDLP2.js";
13
13
  import "../chunk-LUGELG5V.js";
14
- import "../chunk-BX4UBTOI.js";
15
- import "../chunk-IL2ORY23.js";
16
- import "../chunk-KS4ULVGM.js";
14
+ import "../chunk-ZZBLWZJR.js";
15
+ import "../chunk-4US2YHBY.js";
16
+ import "../chunk-NH3XBJTZ.js";
17
17
  import "../chunk-PJP5BUU6.js";
18
- import "../chunk-OEJQJP65.js";
19
- import "../chunk-MA254MXR.js";
18
+ import "../chunk-4I2VCAMW.js";
19
+ import "../chunk-KAPBUKIT.js";
20
20
  import {
21
21
  AGENT_CONTEXT_MENTION_PROVIDER_IDS
22
22
  } from "../chunk-JM24HADP.js";
@@ -334,14 +334,14 @@ declare const agentGuiI18nResources: {
334
334
  readonly agentGui: {
335
335
  readonly initialPlaceholder: "Type @ to reference sessions, files, tasks, and apps";
336
336
  readonly followupPlaceholder: "Request follow-up changes from {{provider}}";
337
- readonly installRequiredPlaceholder: "Finish setting up {{provider}} to send messages";
338
- readonly installRequiredAction: "Set up";
337
+ readonly installRequiredPlaceholder: "Connect {{provider}} to send messages";
338
+ readonly installRequiredAction: "Connect";
339
339
  readonly providerGateCheckingTitle: "Checking your agent";
340
340
  readonly providerGateCheckingDescription: "One moment while we check whether {{provider}} is ready.";
341
341
  readonly providerGateCheckingAgentsDescription: "One moment while we check whether agents are ready.";
342
- readonly providerGateInstallTitle: "Install {{provider}} first";
343
- readonly providerGateInstallDescription: "{{provider}} needs to be installed before you can start a new chat here.";
344
- readonly providerGateInstallAction: "Install";
342
+ readonly providerGateInstallTitle: "Connect {{provider}} first";
343
+ readonly providerGateInstallDescription: "{{provider}} needs to be connected before you can start a new chat here.";
344
+ readonly providerGateInstallAction: "Connect";
345
345
  readonly providerGateLoginTitle: "Log in to {{provider}}";
346
346
  readonly providerGateLoginDescription: "Log in with your account to start chatting with {{provider}}.";
347
347
  readonly providerGateLoginAction: "Log in";
@@ -351,7 +351,7 @@ declare const agentGuiI18nResources: {
351
351
  readonly providerGateUnavailableTitle: "{{provider}} is not ready yet";
352
352
  readonly providerGateUnavailableDescription: "We could not confirm that {{provider}} is ready. Try checking again.";
353
353
  readonly providerGateRetryAction: "Check again";
354
- readonly providerGatePendingInstall: "Installing…";
354
+ readonly providerGatePendingInstall: "Connecting…";
355
355
  readonly providerGatePendingLogin: "Opening sign in…";
356
356
  readonly providerGatePendingRefresh: "Checking…";
357
357
  readonly collaboratorSessionReadOnlyPlaceholder: "This session belongs to another user and cannot be replied to directly";
@@ -506,6 +506,7 @@ declare const agentGuiI18nResources: {
506
506
  readonly slashStatusBaseUrl: "Base URL";
507
507
  readonly slashStatusContext: "Context";
508
508
  readonly slashStatusLimits: "Usage Limits";
509
+ readonly slashStatusAccount: "Account";
509
510
  readonly slashStatusClose: "Close";
510
511
  readonly slashStatusFiveHourLimit: "5h limit";
511
512
  readonly slashStatusWeeklyLimit: "7d limit";
@@ -514,6 +515,12 @@ declare const agentGuiI18nResources: {
514
515
  readonly slashStatusContextValue: "{{percentLeft}}% left ({{usedTokens}} used / {{totalTokens}})";
515
516
  readonly slashStatusContextUnavailable: "Context usage unavailable";
516
517
  readonly slashStatusLimitsUnavailable: "Rate limits unavailable from this agent";
518
+ readonly slashStatusUsageJustUpdated: "Updated just now";
519
+ readonly slashStatusUsageMinutesAgo: "Updated {{count}}m ago";
520
+ readonly slashStatusUsageHoursAgo: "Updated {{count}}h ago";
521
+ readonly slashStatusUsageUpdating: "Updating…";
522
+ readonly slashStatusUsageRefreshFailed: "Refresh failed";
523
+ readonly slashStatusUsageRefreshAria: "Refresh usage";
517
524
  readonly usageChipLabel: "Context {{percent}}%";
518
525
  readonly usageTooltipLabel: "Context usage";
519
526
  readonly usagePopoverTitle: "Context Usage";
@@ -533,6 +540,7 @@ declare const agentGuiI18nResources: {
533
540
  readonly planImplementationSkip: "Stay in Plan Mode";
534
541
  readonly noRunningResponse: "No running response to stop.";
535
542
  readonly composerTextMenu: "Composer text actions";
543
+ readonly pastedTextPromptAttachment: "Pasted text attachment: {{name}}";
536
544
  readonly copyMessage: "Copy message";
537
545
  readonly copyImage: "Copy image";
538
546
  readonly messageCopied: "Copied";
@@ -611,6 +619,7 @@ declare const agentGuiI18nResources: {
611
619
  readonly conversationFilterTutti: "Tutti";
612
620
  readonly providerSwitchLabel: "Switch provider";
613
621
  readonly handoffConversation: "Handoff";
622
+ readonly handoffConversationTooltip: "Hand off to another agent";
614
623
  readonly handoffConversationMenu: "Choose an agent for handoff";
615
624
  readonly batchRunnerStandaloneTitle: "Agent GUI batch runner";
616
625
  readonly batchRunnerSubtitle: "Run JSONL prompt cases and review execution results";
@@ -768,7 +777,7 @@ declare const agentGuiI18nResources: {
768
777
  readonly visibleErrorConfigTimeout: "{{provider}} couldn't apply session settings before the request timed out. Try again in a moment.";
769
778
  readonly visibleErrorStreamDisconnected: "{{provider}}'s response was interrupted before it completed. Try again in a moment.";
770
779
  readonly visibleErrorConcurrencyLimit: "{{provider}} is handling too many requests right now. Try again after another task finishes.";
771
- readonly visibleErrorActionInstall: "Set up";
780
+ readonly visibleErrorActionInstall: "Connect";
772
781
  readonly visibleErrorActionUpgrade: "Upgrade";
773
782
  readonly visibleErrorActionRelogin: "Sign in";
774
783
  readonly visibleErrorActionCheckNetwork: "Check network";
@@ -2866,14 +2875,14 @@ declare const agentGuiI18nResources: {
2866
2875
  readonly agentGui: {
2867
2876
  readonly initialPlaceholder: "输入 @ 引用会话、文件、任务和应用";
2868
2877
  readonly followupPlaceholder: "要求 {{provider}} 继续后续变更";
2869
- readonly installRequiredPlaceholder: "请先完成 {{provider}} 配置,然后再发送消息";
2870
- readonly installRequiredAction: "设置";
2878
+ readonly installRequiredPlaceholder: "请先连接 {{provider}},然后再发送消息";
2879
+ readonly installRequiredAction: "连接";
2871
2880
  readonly providerGateCheckingTitle: "正在检查 Agent";
2872
2881
  readonly providerGateCheckingDescription: "稍等一下,我们正在确认 {{provider}} 是否已经可用。";
2873
2882
  readonly providerGateCheckingAgentsDescription: "稍等一下,我们正在确认 agents 是否已经可用。";
2874
- readonly providerGateInstallTitle: "先安装 {{provider}}";
2875
- readonly providerGateInstallDescription: "需要先安装 {{provider}},才能在这里开始新的对话。";
2876
- readonly providerGateInstallAction: "安装";
2883
+ readonly providerGateInstallTitle: "先连接 {{provider}}";
2884
+ readonly providerGateInstallDescription: "需要先连接 {{provider}},才能在这里开始新的对话。";
2885
+ readonly providerGateInstallAction: "连接";
2877
2886
  readonly providerGateLoginTitle: "登录 {{provider}}";
2878
2887
  readonly providerGateLoginDescription: "使用账号登录后即可开始使用 {{provider}} 对话。";
2879
2888
  readonly providerGateLoginAction: "登录";
@@ -2883,7 +2892,7 @@ declare const agentGuiI18nResources: {
2883
2892
  readonly providerGateUnavailableTitle: "{{provider}} 暂时还不可用";
2884
2893
  readonly providerGateUnavailableDescription: "我们还不能确认 {{provider}} 已准备好,可以再检测一次。";
2885
2894
  readonly providerGateRetryAction: "重新检测";
2886
- readonly providerGatePendingInstall: "正在安装…";
2895
+ readonly providerGatePendingInstall: "正在连接…";
2887
2896
  readonly providerGatePendingLogin: "正在打开登录…";
2888
2897
  readonly providerGatePendingRefresh: "正在检测…";
2889
2898
  readonly collaboratorSessionReadOnlyPlaceholder: "非当前用户会话,不可直接对话";
@@ -3038,6 +3047,7 @@ declare const agentGuiI18nResources: {
3038
3047
  readonly slashStatusBaseUrl: "Base URL";
3039
3048
  readonly slashStatusContext: "上下文";
3040
3049
  readonly slashStatusLimits: "限制";
3050
+ readonly slashStatusAccount: "账户";
3041
3051
  readonly slashStatusClose: "关闭";
3042
3052
  readonly slashStatusFiveHourLimit: "5h limit";
3043
3053
  readonly slashStatusWeeklyLimit: "7d limit";
@@ -3046,6 +3056,12 @@ declare const agentGuiI18nResources: {
3046
3056
  readonly slashStatusContextValue: "{{percentLeft}}% 剩余(已用 {{usedTokens}} / {{totalTokens}})";
3047
3057
  readonly slashStatusContextUnavailable: "上下文用量不可用";
3048
3058
  readonly slashStatusLimitsUnavailable: "当前 Agent 未提供额度限制";
3059
+ readonly slashStatusUsageJustUpdated: "刚刚更新";
3060
+ readonly slashStatusUsageMinutesAgo: "{{count}} 分钟前更新";
3061
+ readonly slashStatusUsageHoursAgo: "{{count}} 小时前更新";
3062
+ readonly slashStatusUsageUpdating: "更新中…";
3063
+ readonly slashStatusUsageRefreshFailed: "刷新失败";
3064
+ readonly slashStatusUsageRefreshAria: "刷新额度用量";
3049
3065
  readonly usageChipLabel: "上下文 {{percent}}%";
3050
3066
  readonly usageTooltipLabel: "上下文用量";
3051
3067
  readonly usagePopoverTitle: "上下文用量";
@@ -3065,6 +3081,7 @@ declare const agentGuiI18nResources: {
3065
3081
  readonly planImplementationSkip: "留在计划模式";
3066
3082
  readonly noRunningResponse: "当前没有正在运行的回复。";
3067
3083
  readonly composerTextMenu: "输入框文本操作";
3084
+ readonly pastedTextPromptAttachment: "粘贴的文本附件:{{name}}";
3068
3085
  readonly copyMessage: "复制消息";
3069
3086
  readonly copyImage: "复制图片";
3070
3087
  readonly messageCopied: "已复制";
@@ -3143,6 +3160,7 @@ declare const agentGuiI18nResources: {
3143
3160
  readonly conversationFilterTutti: "Tutti";
3144
3161
  readonly providerSwitchLabel: "切换 Provider";
3145
3162
  readonly handoffConversation: "Handoff";
3163
+ readonly handoffConversationTooltip: "交接给其他 Agent";
3146
3164
  readonly handoffConversationMenu: "选择要交接的 Agent";
3147
3165
  readonly batchRunnerStandaloneTitle: "Agent GUI 批量执行面板";
3148
3166
  readonly batchRunnerSubtitle: "批量执行 JSONL 用例,查看进度与执行结果";
@@ -3300,7 +3318,7 @@ declare const agentGuiI18nResources: {
3300
3318
  readonly visibleErrorConfigTimeout: "{{provider}} 在请求超时前未能应用会话设置。请稍后重试。";
3301
3319
  readonly visibleErrorStreamDisconnected: "{{provider}} 的响应在完成前被中断。请稍后重试。";
3302
3320
  readonly visibleErrorConcurrencyLimit: "{{provider}} 当前处理的请求过多。请在其他任务完成后再试。";
3303
- readonly visibleErrorActionInstall: "去安装";
3321
+ readonly visibleErrorActionInstall: "去连接";
3304
3322
  readonly visibleErrorActionUpgrade: "去升级";
3305
3323
  readonly visibleErrorActionRelogin: "登录";
3306
3324
  readonly visibleErrorActionCheckNetwork: "检测网络";
@@ -6,8 +6,8 @@ import {
6
6
  translate,
7
7
  translateInUiLanguage,
8
8
  useTranslation
9
- } from "../chunk-KS4ULVGM.js";
10
- import "../chunk-MA254MXR.js";
9
+ } from "../chunk-NH3XBJTZ.js";
10
+ import "../chunk-KAPBUKIT.js";
11
11
  export {
12
12
  AgentGuiI18nProvider,
13
13
  agentGuiI18nModule,
package/dist/index.d.ts CHANGED
@@ -4,10 +4,10 @@ import { m as WorkspaceAgentActivityListViewModel, g as AgentHostWorkspaceAgentS
4
4
  import * as react from 'react';
5
5
  import { ReactNode, PropsWithChildren, JSX, HTMLAttributes } from 'react';
6
6
  import { I18nRuntime } from '@tutti-os/ui-i18n-runtime';
7
- import { r as AgentProvider, g as AgentGUIProviderTargetRef, j as AgentHostAgentSessionComposerSettings, h as AgentHostActivateAgentSessionResult, p as AgentHostUpdateAgentSessionSettingsResult, n as AgentHostAgentSessionState, o as AgentHostUnactivateAgentSessionResult, A as AgentGUINodeData, a as AgentGUIProvider, f as AgentGUIProviderTarget, q as AgentPromptContentBlock, P as Point, b as AgentGUIProviderRailMode, c as AgentGUIProviderReadinessGate, N as NodeFrame } from './types-BxOwnK7K.js';
8
- export { d as AgentGUIProviderReadinessGateAction, e as AgentGUIProviderReadinessGateStatus } from './types-BxOwnK7K.js';
9
- import { k as AgentProbeSnapshot, A as AgentComposerDraft, n as AgentSessionCommand, c as AgentGUIProviderSkillOption, a as AgentGUIComposerSettingsVM, d as AgentGUIQueuedPromptVM, b as AgentGUINodeViewModel, g as AgentHostInputApi } from './agentGuiNodeTypes-DNXndXhV.js';
10
- export { e as AgentHostApi, f as AgentHostApplyWorkspaceGitPatchInput, h as AgentHostRuntimeApi, i as AgentHostSelectFilesInput, j as AgentProbeProvider, l as AgentProviderProbeListInput, m as AgentProviderProbeListResult, o as AgentUsageQuota, p as AgentUsageSnapshot, P as PersistWriteResult, R as ReadWorkspaceAgentReadStateInput, W as WorkspaceAgentReadStateSnapshot, q as WriteWorkspaceAgentReadStateInput } from './agentGuiNodeTypes-DNXndXhV.js';
7
+ import { s as AgentProvider, h as AgentGUIProviderTargetRef, k as AgentHostAgentSessionComposerSettings, i as AgentHostActivateAgentSessionResult, q as AgentHostUpdateAgentSessionSettingsResult, o as AgentHostAgentSessionState, p as AgentHostUnactivateAgentSessionResult, A as AgentGUINodeData, a as AgentGUIProvider, f as AgentGUIProviderTarget, r as AgentPromptContentBlock, P as Point, b as AgentGUIProviderRailMode, c as AgentGUIProviderReadinessGate, N as NodeFrame, g as AgentGUIProviderTargetBadge } from './types-DZ79b8Zn.js';
8
+ export { d as AgentGUIProviderReadinessGateAction, e as AgentGUIProviderReadinessGateStatus } from './types-DZ79b8Zn.js';
9
+ import { k as AgentProbeSnapshot, A as AgentComposerDraft, n as AgentSessionCommand, c as AgentGUIProviderSkillOption, a as AgentGUIComposerSettingsVM, d as AgentGUIQueuedPromptVM, b as AgentGUINodeViewModel, g as AgentHostInputApi } from './agentGuiNodeTypes-BipgG2ib.js';
10
+ export { e as AgentHostApi, f as AgentHostApplyWorkspaceGitPatchInput, h as AgentHostRuntimeApi, i as AgentHostSelectFilesInput, j as AgentProbeProvider, l as AgentProviderProbeListInput, m as AgentProviderProbeListResult, o as AgentUsageQuota, p as AgentUsageSnapshot, P as PersistWriteResult, R as ReadWorkspaceAgentReadStateInput, W as WorkspaceAgentReadStateSnapshot, q as WriteWorkspaceAgentReadStateInput } from './agentGuiNodeTypes-BipgG2ib.js';
11
11
  import { WorkspaceFileEntry } from '@tutti-os/workspace-file-manager/services';
12
12
  import { WorkspaceFileReference, ReferenceLocateTarget, WorkspaceFileReferenceAdapter } from '@tutti-os/workspace-file-reference/contracts';
13
13
  import { ReferenceSourceAggregator } from '@tutti-os/workspace-file-reference/core';
@@ -391,6 +391,14 @@ interface AgentActivityRuntime {
391
391
  * behaviour resolved via the module-global.
392
392
  */
393
393
  origin?: string;
394
+ /**
395
+ * The session cwd is not resolvable on the local filesystem (e.g. a
396
+ * shared/cloud sandbox not mounted locally), so AgentGUI must not run its
397
+ * local stat-based "working directory missing" existence check — it would
398
+ * always false-positive. Absent/false (default) => local, legacy behaviour.
399
+ * Only that one guard is gated; project selection/listing is unaffected.
400
+ */
401
+ projectPathIsRemote?: boolean;
394
402
  promptContentUploadSupport?: {
395
403
  file?: boolean;
396
404
  image?: boolean;
@@ -450,6 +458,10 @@ interface WorkspaceDesktopAgentProbesState {
450
458
  snapshot: AgentProbeSnapshot | null;
451
459
  isLoadingAvailability: boolean;
452
460
  isLoadingUsage: boolean;
461
+ /** True when the most recent usage probe fetch failed (the retained snapshot,
462
+ * if any, is stale). Lets surfaces show a refresh/retry affordance instead of
463
+ * silently displaying old numbers. Absent is treated as "no failure". */
464
+ usageLoadFailed?: boolean;
453
465
  }
454
466
  type WorkspaceDesktopAgentProbeDemandChange = (provider: AgentProvider | null, sourceId?: string) => void;
455
467
  type WorkspaceDesktopAgentProbeRefreshRequest = (provider: AgentProvider, sourceId?: string) => void;
@@ -741,6 +753,7 @@ interface AgentComposerProps {
741
753
  addContent: string;
742
754
  referenceWorkspaceFiles: string;
743
755
  handoffConversation: string;
756
+ handoffConversationTooltip: string;
744
757
  handoffConversationMenu: string;
745
758
  providerSwitchLabel: string;
746
759
  projectLocked: string;
@@ -941,6 +954,7 @@ interface AgentGUINodeProps {
941
954
  workspaceAgentProbes?: WorkspaceDesktopAgentProbesState | null;
942
955
  onAgentProbeDemandChange?: WorkspaceDesktopAgentProbeDemandChange;
943
956
  onAgentProbeRefreshRequest?: WorkspaceDesktopAgentProbeRefreshRequest;
957
+ providerAuthAccountLabels?: Partial<Record<string, string>>;
944
958
  managedAgentsState?: AgentHostManagedAgentsState | null;
945
959
  contextMentionProviders?: readonly AgentContextMentionProvider[];
946
960
  workspaceAppIcons?: readonly AgentMessageMarkdownWorkspaceAppIcon[];
@@ -970,13 +984,14 @@ interface AgentGUIProps extends AgentGUINodeProps {
970
984
  }
971
985
  declare const AgentGUI: react.NamedExoticComponent<AgentGUIProps>;
972
986
 
973
- declare const agentGUIDefaultTargetProviders: readonly ["codex", "claude-code", "cursor", "tutti-agent", "hermes", "openclaw"];
987
+ declare const agentGUIDefaultTargetProviders: readonly ["codex", "claude-code", "cursor", "tutti-agent", "opencode", "hermes", "openclaw"];
974
988
  declare function createLocalAgentGUIProviderTarget(provider: AgentGUIProvider): AgentGUIProviderTarget;
975
989
  declare function createSharedAgentGUIProviderTarget(input: {
976
990
  provider: AgentGUIProvider;
977
991
  sharedAgentId: string;
978
992
  label: string;
979
993
  agentTargetId?: string | null;
994
+ badge?: AgentGUIProviderTargetBadge | null;
980
995
  ownerLabel?: string | null;
981
996
  iconUrl?: string | null;
982
997
  unavailableReason?: string | null;
@@ -1008,6 +1023,7 @@ declare const agentGuiDockIconUrls: {
1008
1023
  readonly hermes: string;
1009
1024
  readonly nexight: string;
1010
1025
  readonly openclaw: string;
1026
+ readonly opencode: string;
1011
1027
  readonly "tutti-agent": string;
1012
1028
  };
1013
1029
 
@@ -1042,4 +1058,4 @@ interface AgentActivityHostProviderProps extends PropsWithChildren {
1042
1058
  }
1043
1059
  declare function AgentActivityHostProvider({ agentActivityRuntime, agentHostApi, children }: AgentActivityHostProviderProps): JSX.Element;
1044
1060
 
1045
- export { AgentActivityHostProvider, type AgentActivityHostProviderProps, type AgentActivityRuntime, type AgentActivityRuntimeListSessionMessagesInput, type AgentActivityRuntimePromptContentBlock, AgentActivityRuntimeProvider, type AgentActivityRuntimeProviderProps, type AgentActivityRuntimeRetainSessionEventsInput, type AgentActivityRuntimeSetSessionPinnedInput, type AgentActivityRuntimeUpdateSessionSettingsInput, type AgentActivityRuntimeUploadPromptContentInput, type AgentActivityRuntimeUploadPromptContentResult, type AgentActivityRuntimeWarmupOpenclawGatewayInput, type AgentActivitySnapshotProjection, AgentContextMentionProvider, type AgentCustomMentionChipContext, type AgentCustomMentionIdentity, type AgentCustomMentionKindDefinition, type AgentCustomMentionPresentation, AgentGUI, type AgentGUIAccountMenuState, type AgentGUIProps, AgentGUIProvider, type AgentGUIProviderRailEmptyRenderer, AgentGUIProviderRailMode, AgentGUIProviderReadinessGate, AgentGUIProviderTarget, AgentGUIProviderTargetRef, type AgentGUISidebarFooterContext, type AgentGUISidebarFooterRenderer, AgentGuiI18nLocale, AgentHostInputApi, AgentProbeSnapshot, AgentQueuedPromptQueueSnapshot, AgentQueuedPromptRuntime, AgentQueuedPromptRuntimeProvider, type AgentQueuedPromptRuntimeProviderProps, agentGUIDefaultTargetProviders, agentGuiDockIconUrl, agentGuiDockIconUrls, agentHostSnapshotFromAgentActivitySnapshot, buildAgentActivitySnapshotProjection, createLocalAgentGUIProviderTarget, createLocalAgentGUIProviderTargets, createSharedAgentGUIProviderTarget, getAgentActivityRuntime, getAgentCustomMentionKind, getOptionalAgentActivityRuntime, localAgentGUIAgentTargetId, localAgentGUIProviderTargetId, normalizeAgentGUIProviderTargets, projectCoreSessionStatus, registerAgentCustomMentionKind, resetAgentActivityRuntimeForTests, resetAgentCustomMentionKindsForTests, resetAgentQueuedPromptRuntimeForTests, resolveAgentGUIExpandedWindowFrame, resolveAgentGUIProviderTarget, setAgentActivityRuntimeForTests, setAgentQueuedPromptRuntimeForTests, shouldAutoCollapseAgentGUIConversationRail, useAgentActivityRuntime, useAgentActivitySnapshot, useAgentQueuedPromptRuntime, useAgentQueuedPromptSessionSnapshot, useOptionalAgentActivityRuntime };
1061
+ export { AgentActivityHostProvider, type AgentActivityHostProviderProps, type AgentActivityRuntime, type AgentActivityRuntimeListSessionMessagesInput, type AgentActivityRuntimePromptContentBlock, AgentActivityRuntimeProvider, type AgentActivityRuntimeProviderProps, type AgentActivityRuntimeRetainSessionEventsInput, type AgentActivityRuntimeSetSessionPinnedInput, type AgentActivityRuntimeUpdateSessionSettingsInput, type AgentActivityRuntimeUploadPromptContentInput, type AgentActivityRuntimeUploadPromptContentResult, type AgentActivityRuntimeWarmupOpenclawGatewayInput, type AgentActivitySnapshotProjection, AgentContextMentionProvider, type AgentCustomMentionChipContext, type AgentCustomMentionIdentity, type AgentCustomMentionKindDefinition, type AgentCustomMentionPresentation, AgentGUI, type AgentGUIAccountMenuState, type AgentGUIProps, AgentGUIProvider, type AgentGUIProviderRailEmptyRenderer, AgentGUIProviderRailMode, AgentGUIProviderReadinessGate, AgentGUIProviderTarget, AgentGUIProviderTargetBadge, AgentGUIProviderTargetRef, type AgentGUISidebarFooterContext, type AgentGUISidebarFooterRenderer, AgentGuiI18nLocale, AgentHostInputApi, AgentProbeSnapshot, AgentQueuedPromptQueueSnapshot, AgentQueuedPromptRuntime, AgentQueuedPromptRuntimeProvider, type AgentQueuedPromptRuntimeProviderProps, agentGUIDefaultTargetProviders, agentGuiDockIconUrl, agentGuiDockIconUrls, agentHostSnapshotFromAgentActivitySnapshot, buildAgentActivitySnapshotProjection, createLocalAgentGUIProviderTarget, createLocalAgentGUIProviderTargets, createSharedAgentGUIProviderTarget, getAgentActivityRuntime, getAgentCustomMentionKind, getOptionalAgentActivityRuntime, localAgentGUIAgentTargetId, localAgentGUIProviderTargetId, normalizeAgentGUIProviderTargets, projectCoreSessionStatus, registerAgentCustomMentionKind, resetAgentActivityRuntimeForTests, resetAgentCustomMentionKindsForTests, resetAgentQueuedPromptRuntimeForTests, resolveAgentGUIExpandedWindowFrame, resolveAgentGUIProviderTarget, setAgentActivityRuntimeForTests, setAgentQueuedPromptRuntimeForTests, shouldAutoCollapseAgentGUIConversationRail, useAgentActivityRuntime, useAgentActivitySnapshot, useAgentQueuedPromptRuntime, useAgentQueuedPromptSessionSnapshot, useOptionalAgentActivityRuntime };