@tutti-os/agent-gui 0.0.49 → 0.0.50

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 (56) hide show
  1. package/dist/agent-conversation/index.d.ts +5 -3
  2. package/dist/agent-conversation/index.js +6 -6
  3. package/dist/agent-message-center/index.d.ts +1 -1
  4. package/dist/agent-message-center/index.js +8 -8
  5. package/dist/{agentConversationVM-DSXrFL9v.d.ts → agentConversationVM-Qbz9GBwR.d.ts} +25 -0
  6. package/dist/{agentGuiNodeTypes-Bp1G8pOj.d.ts → agentGuiNodeTypes-wzOITHRW.d.ts} +1 -1
  7. package/dist/app/renderer/agentactivity.css +426 -4
  8. package/dist/{chunk-AKK7UOAS.js → chunk-5Y3PC7HP.js} +9 -4
  9. package/dist/chunk-5Y3PC7HP.js.map +1 -0
  10. package/dist/{chunk-U6JWW45G.js → chunk-66EQ6EQO.js} +1 -1
  11. package/dist/chunk-66EQ6EQO.js.map +1 -0
  12. package/dist/{chunk-Q3MOU4CD.js → chunk-ARCM7YB2.js} +2 -2
  13. package/dist/{chunk-5HJWT6YN.js → chunk-BQVYICR7.js} +5 -5
  14. package/dist/{chunk-TTDBLIQ3.js → chunk-DPG2J7N5.js} +2 -2
  15. package/dist/{chunk-A2EN24OI.js → chunk-FS26J46N.js} +5 -5
  16. package/dist/{chunk-FSRS2JFR.js → chunk-FYVVHRLZ.js} +2 -2
  17. package/dist/{chunk-AYEYXKLF.js → chunk-HDBKB5RA.js} +2 -2
  18. package/dist/{chunk-QGBIGRZA.js → chunk-OBFDA7RG.js} +14 -2
  19. package/dist/chunk-OBFDA7RG.js.map +1 -0
  20. package/dist/{chunk-XRJZCEOX.js → chunk-RPXRNKU5.js} +1764 -594
  21. package/dist/chunk-RPXRNKU5.js.map +1 -0
  22. package/dist/{chunk-6KQHNUR5.js → chunk-UUY5VEK4.js} +2 -2
  23. package/dist/{chunk-RJR2OZ6T.js → chunk-VKP5ZW5O.js} +5 -3
  24. package/dist/{chunk-RJR2OZ6T.js.map → chunk-VKP5ZW5O.js.map} +1 -1
  25. package/dist/{chunk-77UR4G7P.js → chunk-Y7ZVTWMZ.js} +2 -2
  26. package/dist/{chunk-K6SRLYC3.js → chunk-ZTSS2NU2.js} +17 -1
  27. package/dist/chunk-ZTSS2NU2.js.map +1 -0
  28. package/dist/context-mention-palette/index.js +7 -7
  29. package/dist/i18n/index.d.ts +16 -0
  30. package/dist/i18n/index.js +2 -2
  31. package/dist/index.d.ts +50 -3
  32. package/dist/index.js +519 -29
  33. package/dist/index.js.map +1 -1
  34. package/dist/plan-decision-ops.d.ts +1 -1
  35. package/dist/queued-prompt-runtime.d.ts +2 -2
  36. package/dist/workbench/contribution.d.ts +5 -1
  37. package/dist/workbench/contribution.js +4 -2
  38. package/dist/workbench/index.js +5 -5
  39. package/dist/workbench/launch.d.ts +4 -0
  40. package/dist/workbench/launch.js +1 -1
  41. package/dist/workbench/sessionTitle.js +3 -3
  42. package/dist/workspace-agent-generated-files.js +3 -3
  43. package/package.json +12 -12
  44. package/dist/chunk-AKK7UOAS.js.map +0 -1
  45. package/dist/chunk-K6SRLYC3.js.map +0 -1
  46. package/dist/chunk-QGBIGRZA.js.map +0 -1
  47. package/dist/chunk-U6JWW45G.js.map +0 -1
  48. package/dist/chunk-XRJZCEOX.js.map +0 -1
  49. /package/dist/{chunk-Q3MOU4CD.js.map → chunk-ARCM7YB2.js.map} +0 -0
  50. /package/dist/{chunk-5HJWT6YN.js.map → chunk-BQVYICR7.js.map} +0 -0
  51. /package/dist/{chunk-TTDBLIQ3.js.map → chunk-DPG2J7N5.js.map} +0 -0
  52. /package/dist/{chunk-A2EN24OI.js.map → chunk-FS26J46N.js.map} +0 -0
  53. /package/dist/{chunk-FSRS2JFR.js.map → chunk-FYVVHRLZ.js.map} +0 -0
  54. /package/dist/{chunk-AYEYXKLF.js.map → chunk-HDBKB5RA.js.map} +0 -0
  55. /package/dist/{chunk-6KQHNUR5.js.map → chunk-UUY5VEK4.js.map} +0 -0
  56. /package/dist/{chunk-77UR4G7P.js.map → chunk-Y7ZVTWMZ.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../workbench/launch.ts"],"sourcesContent":["import type { WorkbenchHostLaunchRequest } from \"@tutti-os/workbench-surface\";\nimport {\n isAgentGuiWorkbenchProvider,\n normalizeAgentGuiWorkbenchProvider\n} from \"./providerCatalog.ts\";\nimport {\n agentGuiWorkbenchOpenSessionActivationType,\n agentGuiWorkbenchPrefillPromptActivationType,\n type AgentGuiWorkbenchPrefillPromptPayload,\n type AgentGuiWorkbenchProvider\n} from \"./types.ts\";\n\nexport { agentGuiWorkbenchPrefillPromptActivationType } from \"./types.ts\";\n\ntype AgentGuiWorkbenchLaunchRequestInput = Pick<\n WorkbenchHostLaunchRequest,\n \"payload\" | \"typeId\"\n> & {\n dockEntryId?: string | null;\n};\n\nexport const agentGuiWorkbenchTypeId = \"agent-gui\";\n\nconst agentGuiWorkbenchDockEntryPrefix = \"agent-gui:\";\nconst agentGuiWorkbenchUnifiedDockEntryIdValue = \"agent-gui:unified\";\nlet agentGuiWorkbenchInstanceSequence = 0;\n\nexport type AgentGuiWorkbenchDockLayout = \"legacySplit\" | \"unified\";\n\nexport type AgentGuiWorkbenchDockIdentity =\n | {\n kind: \"legacyProvider\";\n provider: AgentGuiWorkbenchProvider;\n }\n | {\n kind: \"unifiedAggregate\";\n };\n\nexport function agentGuiWorkbenchDockEntryId(\n provider: AgentGuiWorkbenchProvider\n): string {\n return provider === \"codex\"\n ? agentGuiWorkbenchTypeId\n : `${agentGuiWorkbenchDockEntryPrefix}${provider}`;\n}\n\nexport function agentGuiWorkbenchUnifiedDockEntryId(): string {\n return agentGuiWorkbenchUnifiedDockEntryIdValue;\n}\n\nexport function agentGuiWorkbenchDockEntryIdForLayout(input: {\n dockLayout: AgentGuiWorkbenchDockLayout;\n provider: AgentGuiWorkbenchProvider;\n}): string {\n return input.dockLayout === \"unified\"\n ? agentGuiWorkbenchUnifiedDockEntryId()\n : agentGuiWorkbenchDockEntryId(input.provider);\n}\n\nexport function agentGuiWorkbenchInstanceId(\n provider: AgentGuiWorkbenchProvider\n): string {\n return `${agentGuiWorkbenchDockEntryPrefix}${provider}`;\n}\n\nexport function createAgentGuiWorkbenchInstanceId(input: {\n agentSessionId?: string | null;\n provider: AgentGuiWorkbenchProvider;\n}): string {\n const prefix = agentGuiWorkbenchInstanceId(input.provider);\n const agentSessionId = input.agentSessionId?.trim();\n if (agentSessionId) {\n return `${prefix}:session:${encodeAgentGuiWorkbenchInstanceSegment(\n agentSessionId\n )}`;\n }\n\n agentGuiWorkbenchInstanceSequence += 1;\n return [\n prefix,\n \"panel\",\n `${Date.now().toString(36)}-${agentGuiWorkbenchInstanceSequence.toString(36)}`\n ].join(\":\");\n}\n\nexport function agentGuiWorkbenchProviderFromIdentifier(\n value: string | null | undefined\n): AgentGuiWorkbenchProvider | null {\n const identity = agentGuiWorkbenchDockIdentityFromIdentifier(value);\n return identity?.kind === \"legacyProvider\" ? identity.provider : null;\n}\n\nexport function agentGuiWorkbenchDockIdentityFromIdentifier(\n value: string | null | undefined\n): AgentGuiWorkbenchDockIdentity | null {\n const normalized = value?.trim();\n if (!normalized) {\n return null;\n }\n if (normalized === agentGuiWorkbenchUnifiedDockEntryId()) {\n return { kind: \"unifiedAggregate\" };\n }\n if (normalized === agentGuiWorkbenchTypeId) {\n return { kind: \"legacyProvider\", provider: \"codex\" };\n }\n if (!normalized.startsWith(agentGuiWorkbenchDockEntryPrefix)) {\n return null;\n }\n const provider = normalized\n .slice(agentGuiWorkbenchDockEntryPrefix.length)\n .split(\":\", 1)[0];\n return isAgentGuiWorkbenchProvider(provider)\n ? { kind: \"legacyProvider\", provider }\n : null;\n}\n\nexport function agentGuiWorkbenchProviderFromLaunchRequest(\n request: AgentGuiWorkbenchLaunchRequestInput\n): AgentGuiWorkbenchProvider {\n const payloadProvider =\n request.payload &&\n typeof request.payload === \"object\" &&\n !Array.isArray(request.payload)\n ? (request.payload as { provider?: unknown }).provider\n : null;\n if (isAgentGuiWorkbenchProvider(payloadProvider)) {\n return payloadProvider;\n }\n return (\n agentGuiWorkbenchProviderFromIdentifier(request.dockEntryId) ??\n agentGuiWorkbenchProviderFromIdentifier(request.typeId) ??\n \"codex\"\n );\n}\n\nexport function createAgentGuiWorkbenchSessionLaunchRequest(input: {\n agentSessionId?: string;\n provider: unknown;\n}) {\n const provider = normalizeAgentGuiWorkbenchProvider(input.provider);\n return {\n dockEntryId: agentGuiWorkbenchDockEntryId(provider),\n payload: {\n ...(input.agentSessionId ? { agentSessionId: input.agentSessionId } : {}),\n provider\n },\n reason: \"host\" as const,\n typeId: agentGuiWorkbenchTypeId\n };\n}\n\nexport function createAgentGuiWorkbenchDraftLaunchRequest(input: {\n autoSubmit?: boolean;\n draftPrompt: string;\n provider: unknown;\n userProjectPath?: string | null;\n}) {\n const provider = normalizeAgentGuiWorkbenchProvider(input.provider);\n const userProjectPath = normalizeAgentGuiWorkbenchUserProjectPath(\n input.userProjectPath\n );\n return {\n dockEntryId: agentGuiWorkbenchDockEntryId(provider),\n payload: {\n draftPrompt: input.draftPrompt,\n provider,\n ...(input.autoSubmit ? { autoSubmit: true } : {}),\n ...(userProjectPath ? { userProjectPath } : {})\n },\n reason: \"host\" as const,\n typeId: agentGuiWorkbenchTypeId\n };\n}\n\nexport interface AgentGuiWorkbenchLaunchDescriptor {\n activation:\n | {\n payload: {\n agentSessionId: string;\n };\n type: typeof agentGuiWorkbenchOpenSessionActivationType;\n }\n | {\n payload: AgentGuiWorkbenchPrefillPromptPayload;\n type: typeof agentGuiWorkbenchPrefillPromptActivationType;\n }\n | null;\n dockEntryId: string;\n instanceId: string;\n provider: AgentGuiWorkbenchProvider;\n reuseDockEntryNode: boolean;\n targetAgentSessionId: string | null;\n}\n\nexport function createAgentGuiWorkbenchLaunchDescriptor(\n request: AgentGuiWorkbenchLaunchRequestInput\n): AgentGuiWorkbenchLaunchDescriptor {\n const provider = agentGuiWorkbenchProviderFromLaunchRequest(request);\n const dockEntryId = resolveAgentGuiWorkbenchLaunchDockEntryId({\n provider,\n requestedDockEntryId: request.dockEntryId\n });\n const prefillPrompt = prefillPromptFromLaunchPayload(request.payload);\n if (prefillPrompt) {\n return {\n activation: {\n payload: prefillPrompt,\n type: agentGuiWorkbenchPrefillPromptActivationType\n },\n dockEntryId,\n instanceId: createAgentGuiWorkbenchInstanceId({ provider }),\n provider,\n reuseDockEntryNode: shouldReuseAgentGuiWorkbenchDockEntryNode({\n dockEntryId,\n launchKind: \"prefill\"\n }),\n targetAgentSessionId: null\n };\n }\n\n const targetAgentSessionId = agentSessionIdFromLaunchPayload(request.payload);\n const instanceId = createAgentGuiWorkbenchInstanceId({\n agentSessionId: targetAgentSessionId,\n provider\n });\n\n return {\n activation: targetAgentSessionId\n ? {\n payload: {\n agentSessionId: targetAgentSessionId\n },\n type: agentGuiWorkbenchOpenSessionActivationType\n }\n : null,\n dockEntryId,\n instanceId,\n provider,\n reuseDockEntryNode: shouldReuseAgentGuiWorkbenchDockEntryNode({\n dockEntryId,\n launchKind: targetAgentSessionId ? \"session\" : \"empty\"\n }),\n targetAgentSessionId\n };\n}\n\nexport function resolveAgentGuiWorkbenchLaunchDockEntryId(input: {\n provider: AgentGuiWorkbenchProvider;\n requestedDockEntryId?: string | null;\n}): string {\n const requestedIdentity = agentGuiWorkbenchDockIdentityFromIdentifier(\n input.requestedDockEntryId\n );\n if (requestedIdentity?.kind === \"unifiedAggregate\") {\n return agentGuiWorkbenchUnifiedDockEntryId();\n }\n return agentGuiWorkbenchDockEntryId(input.provider);\n}\n\nexport function shouldReuseAgentGuiWorkbenchDockEntryNode(input: {\n dockEntryId: string;\n launchKind: \"empty\" | \"prefill\" | \"session\";\n}): boolean {\n if (input.launchKind !== \"prefill\") {\n return false;\n }\n return (\n agentGuiWorkbenchDockIdentityFromIdentifier(input.dockEntryId)?.kind !==\n \"unifiedAggregate\"\n );\n}\n\nfunction encodeAgentGuiWorkbenchInstanceSegment(value: string): string {\n return encodeURIComponent(value.trim());\n}\n\nfunction prefillPromptFromLaunchPayload(\n payload: unknown\n): AgentGuiWorkbenchPrefillPromptPayload | null {\n if (!payload || typeof payload !== \"object\" || Array.isArray(payload)) {\n return null;\n }\n const draftPrompt = (payload as { draftPrompt?: unknown }).draftPrompt;\n if (typeof draftPrompt !== \"string\" || !draftPrompt.trim()) {\n return null;\n }\n const autoSubmit = (payload as { autoSubmit?: unknown }).autoSubmit === true;\n const userProjectPath = (payload as { userProjectPath?: unknown })\n .userProjectPath;\n const normalizedUserProjectPath =\n typeof userProjectPath === \"string\"\n ? normalizeAgentGuiWorkbenchUserProjectPath(userProjectPath)\n : null;\n return {\n draftPrompt,\n ...(autoSubmit ? { autoSubmit: true } : {}),\n ...(normalizedUserProjectPath\n ? { userProjectPath: normalizedUserProjectPath }\n : {})\n };\n}\n\nfunction normalizeAgentGuiWorkbenchUserProjectPath(\n value: string | null | undefined\n): string | null {\n const normalized = value?.trim().replaceAll(\"\\\\\", \"/\").replace(/\\/+$/, \"\");\n return normalized ? normalized : null;\n}\n\nfunction agentSessionIdFromLaunchPayload(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\" || Array.isArray(payload)) {\n return null;\n }\n const agentSessionId = (payload as { agentSessionId?: unknown })\n .agentSessionId;\n return typeof agentSessionId === \"string\" && agentSessionId.trim()\n ? agentSessionId.trim()\n : null;\n}\n"],"mappings":";;;;;;;;;;AAqBO,IAAM,0BAA0B;AAEvC,IAAM,mCAAmC;AACzC,IAAM,2CAA2C;AACjD,IAAI,oCAAoC;AAajC,SAAS,6BACd,UACQ;AACR,SAAO,aAAa,UAChB,0BACA,GAAG,gCAAgC,GAAG,QAAQ;AACpD;AAEO,SAAS,sCAA8C;AAC5D,SAAO;AACT;AAEO,SAAS,sCAAsC,OAG3C;AACT,SAAO,MAAM,eAAe,YACxB,oCAAoC,IACpC,6BAA6B,MAAM,QAAQ;AACjD;AAEO,SAAS,4BACd,UACQ;AACR,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AAE,WAAW,MAAM,GAAG,EAAE,QAAQ,QAAQ,EAAE;AACzE,SAAO,aAAa,aAAa;AACnC;AAEA,SAAS,gCAAgC,SAAiC;AACxE,MAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACrE,WAAO;AAAA,EACT;AACA,QAAM,iBAAkB,QACrB;AACH,SAAO,OAAO,mBAAmB,YAAY,eAAe,KAAK,IAC7D,eAAe,KAAK,IACpB;AACN;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts"],"sourcesContent":["import {\n createContext,\n useContext,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityCancelSessionInput,\n AgentActivityCancelSessionResult,\n AgentActivityCreateSessionInput,\n AgentActivityDeleteSessionInput,\n AgentActivityDeleteSessionResult,\n AgentActivityMessageOrder,\n AgentActivityMessagePage,\n AgentActivitySendInput,\n 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 cwd?: string | null;\n force?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUpdateSessionSettingsInput {\n agentSessionId: string;\n settings: AgentHostAgentSessionComposerSettings;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput {\n nextSettings: AgentHostAgentSessionComposerSettings;\n previousSettings: AgentHostAgentSessionComposerSettings;\n provider: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeWarmupOpenclawGatewayInput {\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeDiagnosticInput {\n details?: Record<string, unknown>;\n event: string;\n level?: \"debug\" | \"info\" | \"warn\" | \"error\";\n source?: string;\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeActivateSessionInput {\n agentSessionId: string;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n 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"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAoTH;AAhBJ,IAAM,8BAA8B;AAAA,EAClC;AACF;AAEA,IAAI,8BAA2D;AAMxD,SAAS,6BAA6B;AAAA,EAC3C;AAAA,EACA;AACF,GAAmD;AACjD,gCAA8B,WAAW;AACzC,SACE,oBAAC,4BAA4B,UAA5B,EAAqC,OAAO,WAAW,MACrD,UACH;AAEJ;AAEO,SAAS,0BAAgD;AAC9D,QAAM,UACJ,WAAW,2BAA2B,KAAK,4BAA4B;AACzE,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAA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