@tutti-os/agent-gui 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/dist/{AgentMessageMarkdown-BVeh06AJ.d.ts → AgentMessageMarkdown-GDgLA-im.d.ts} +3 -156
- package/dist/agent-conversation/index.d.ts +2 -1
- package/dist/agent-conversation/index.js +3 -3
- package/dist/agent-message-center/index.js +3 -3
- package/dist/chunk-4K22O34C.js +123 -0
- package/dist/chunk-4K22O34C.js.map +1 -0
- package/dist/{chunk-3AXEEQMV.js → chunk-DO7D7OOL.js} +3 -3
- package/dist/{chunk-ZWJBG2JM.js → chunk-EFDGMXTB.js} +62 -7
- package/dist/chunk-EFDGMXTB.js.map +1 -0
- package/dist/{chunk-C7ZZZXKB.js → chunk-EQ4RSPQE.js} +2 -2
- package/dist/{chunk-JNGYJ7GM.js → chunk-EU7RWKHE.js} +2 -2
- package/dist/{chunk-IXIGWLQY.js → chunk-F5DYXCY3.js} +1 -1
- package/dist/{chunk-IXIGWLQY.js.map → chunk-F5DYXCY3.js.map} +1 -1
- package/dist/{chunk-XL2EKJTQ.js → chunk-R7XH3C4Y.js} +3 -3
- package/dist/{chunk-B2JKDZSR.js → chunk-TXXWUG2J.js} +1 -1
- package/dist/chunk-TXXWUG2J.js.map +1 -0
- package/dist/{chunk-46IYJEZX.js → chunk-UUM2GZXH.js} +3 -3
- package/dist/{chunk-5HQDW73P.js → chunk-WC34LVH6.js} +2 -2
- package/dist/context-mention-palette/index.js +2 -2
- package/dist/index.d.ts +124 -102
- package/dist/index.js +243 -57
- package/dist/index.js.map +1 -1
- package/dist/types-xMz0lJWt.d.ts +173 -0
- package/dist/workbench/contribution.d.ts +1 -0
- package/dist/workbench/contribution.js +5 -4
- package/dist/workbench/index.d.ts +1 -0
- package/dist/workbench/index.js +5 -4
- package/dist/workbench/launch.d.ts +1 -0
- package/dist/workbench/launch.js +2 -2
- package/dist/workbench/providerCatalog.d.ts +1 -0
- package/dist/workbench/state.d.ts +1 -0
- package/dist/workbench/state.js +2 -1
- package/dist/workbench/types.d.ts +6 -0
- package/dist/workbench/types.js +1 -1
- package/package.json +12 -12
- package/dist/chunk-B2JKDZSR.js.map +0 -1
- package/dist/chunk-ZWJBG2JM.js.map +0 -1
- /package/dist/{chunk-3AXEEQMV.js.map → chunk-DO7D7OOL.js.map} +0 -0
- /package/dist/{chunk-C7ZZZXKB.js.map → chunk-EQ4RSPQE.js.map} +0 -0
- /package/dist/{chunk-JNGYJ7GM.js.map → chunk-EU7RWKHE.js.map} +0 -0
- /package/dist/{chunk-XL2EKJTQ.js.map → chunk-R7XH3C4Y.js.map} +0 -0
- /package/dist/{chunk-46IYJEZX.js.map → chunk-UUM2GZXH.js.map} +0 -0
- /package/dist/{chunk-5HQDW73P.js.map → chunk-WC34LVH6.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
agentGuiWorkbenchOpenSessionActivationType,
|
|
7
7
|
agentGuiWorkbenchPrefillPromptActivationType
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F5DYXCY3.js";
|
|
9
9
|
|
|
10
10
|
// workbench/launch.ts
|
|
11
11
|
var agentGuiWorkbenchTypeId = "agent-gui";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
createAgentGuiWorkbenchDraftLaunchRequest,
|
|
158
158
|
createAgentGuiWorkbenchLaunchDescriptor
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-EU7RWKHE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../workbench/types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../workbench/types.ts"],"sourcesContent":["import type { AgentGUIProviderTargetRef } from \"../types\";\n\nexport type AgentGuiWorkbenchProvider =\n | \"claude-code\"\n | \"codex\"\n | \"nexight\"\n | \"gemini\"\n | \"hermes\"\n | \"openclaw\";\n\nexport const agentGuiWorkbenchOpenSessionActivationType =\n \"agent-gui:open-session\";\n\nexport const agentGuiWorkbenchPrefillPromptActivationType =\n \"agent-gui:prefill-prompt\";\n\nexport interface AgentGuiWorkbenchPrefillPromptPayload {\n autoSubmit?: boolean;\n draftPrompt: string;\n userProjectPath?: string | null;\n}\n\nexport interface AgentGuiWorkbenchComposerOverrides {\n model?: string | null;\n permissionModeId?: string | null;\n planMode?: boolean;\n reasoningEffort?: string | null;\n}\n\nexport type AgentGuiWorkbenchComposerOverridesByProvider = Partial<\n Record<AgentGuiWorkbenchProvider, AgentGuiWorkbenchComposerOverrides | null>\n>;\n\nexport interface AgentGuiWorkbenchNodeState {\n composerOverrides?: AgentGuiWorkbenchComposerOverrides | null;\n composerOverridesByProvider?: AgentGuiWorkbenchComposerOverridesByProvider | null;\n conversationCount?: number | null;\n conversationRailCollapsed?: boolean | null;\n conversationRailWidthPx?: number | null;\n lastActiveAgentSessionId: string | null;\n /** @deprecated Conversation titles are derived from the active session id. */\n lastActiveConversationTitle?: string | null;\n provider: AgentGuiWorkbenchProvider;\n providerTargetId?: string | null;\n providerTargetRef?: AgentGUIProviderTargetRef | null;\n}\n\nexport interface AgentGuiWorkbenchState {\n composerOverrides?: AgentGuiWorkbenchComposerOverrides | null;\n composerOverridesByProvider?: AgentGuiWorkbenchComposerOverridesByProvider | null;\n conversationRailCollapsed?: boolean | null;\n conversationRailWidthPx?: number | null;\n lastActiveAgentSessionId: string | null;\n /** @deprecated Conversation titles are derived from the active session id. */\n lastActiveConversationTitle?: string | null;\n providerTargetId?: string | null;\n providerTargetRef?: AgentGUIProviderTargetRef | null;\n}\n\nexport interface AgentGuiWorkbenchWorkspaceState {\n workspaceId: string;\n}\n"],"mappings":";AAUO,IAAM,6CACX;AAEK,IAAM,+CACX;","names":[]}
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
agentGuiWorkbenchProviderFromIdentifier,
|
|
4
4
|
agentGuiWorkbenchTypeId,
|
|
5
5
|
createAgentGuiWorkbenchLaunchDescriptor
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EU7RWKHE.js";
|
|
7
7
|
import {
|
|
8
8
|
agentGuiWorkbenchProviderFromInstanceId,
|
|
9
9
|
createAgentGuiWorkbenchNodeStateSource,
|
|
10
10
|
normalizeAgentGuiWorkbenchNodeState,
|
|
11
11
|
normalizeAgentGuiWorkbenchState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EFDGMXTB.js";
|
|
13
13
|
import {
|
|
14
14
|
agentGuiWorkbenchProviderLabels,
|
|
15
15
|
agentGuiWorkbenchProviders,
|
|
@@ -485,4 +485,4 @@ export {
|
|
|
485
485
|
resolveAgentGuiWorkbenchDefaultLaunchFrame,
|
|
486
486
|
resolveAgentGuiWorkbenchContributionCopy
|
|
487
487
|
};
|
|
488
|
-
//# sourceMappingURL=chunk-
|
|
488
|
+
//# sourceMappingURL=chunk-R7XH3C4Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 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 interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport interface AgentHostSelectFilesInput {\n allowDirectories?: boolean;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getPathForFile: (file: File) => string;\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: (\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 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 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 userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAgTH;AAhBJ,IAAM,8BAA8B;AAAA,EAClC;AACF;AAEA,IAAI,8BAA2D;AAMxD,SAAS,6BAA6B;AAAA,EAC3C;AAAA,EACA;AACF,GAAmD;AACjD,gCAA8B,WAAW;AACzC,SACE,oBAAC,4BAA4B,UAA5B,EAAqC,OAAO,WAAW,MACrD,UACH;AAEJ;AAEO,SAAS,0BAAgD;AAC9D,QAAM,UACJ,WAAW,2BAA2B,KAAK,4BAA4B;AACzE,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,kCAA+D;AAC7E,SACE,WAAW,2BAA2B,KAAK,4BAA4B;AAE3E;AAEO,SAAS,yBACd,aACuB;AACvB,QAAM,UAAU,wBAAwB;AACxC,QAAM,wBAAwB,YAAY,KAAK;AAC/C,SAAO;AAAA,IACL,CAAC,aAAa,QAAQ,UAAU,uBAAuB,QAAQ;AAAA,IAC/D,MAAM,QAAQ,YAAY,qBAAqB;AAAA,IAC/C,MAAM,QAAQ,YAAY,qBAAqB;AAAA,EACjD;AACF;AAEO,SAAS,0BAAgD;AAC9D,QAAM,UACJ,0CAA0C,KAC1C,+BACA,4BAA4B;AAC9B,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,kCAA+D;AAC7E,SACE,0CAA0C,KAC1C,+BACA,4BAA4B;AAEhC;AAEO,SAAS,oCAA0C;AACxD,MAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,kCAA8B;AAAA,EAChC;AACF;AAEO,SAAS,gCACd,SACM;AACN,MAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,kCAA8B;AAAA,EAChC;AACF;AAEA,SAAS,8BAA2D;AAClE,MAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO;AAAA,EACT;AACA,QAAM,kBAAkB,0CAA0C;AAClE,MAAI,iBAAiB;AACnB,WAAO;AAAA,EACT;AACA,MAAI,6BAA6B;AAC/B,WAAO;AAAA,EACT;AACA,QAAM,cACJ,OAGA;AACF,SAAO,eAAe;AACxB;AAEA,SAAS,4CAAyE;AAChF,MAAI,QAAQ,IAAI,aAAa,UAAU,OAAO,WAAW,aAAa;AACpE,WAAO;AAAA,EACT;AACA,QAAM,iBAAiB,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,EACF;AACA,MAAI,CAAC,kBAAkB,EAAE,WAAW,iBAAiB;AACnD,WAAO;AAAA,EACT;AACA,SAAQ,eAAe,SAA8C;AACvE;;;AC9ZA;AAAA,EACE,iBAAAA;AAAA,EACA,cAAAC;AAAA,EACA;AAAA,OAGK;;;ACuSA,SAAS,sBACd,SACqB;AACrB,SAAO;AAAA,IACL,SAAS,QAAQ;AAAA,IACjB,eAAe,QAAQ,iBAAkB,CAAC;AAAA,IAC1C,WAAW,QAAQ;AAAA,IACnB,OAAO,QAAQ;AAAA,IACf,YAAY,QAAQ;AAAA,IACpB,MAAM,QAAQ;AAAA,IACd,aAAa,QAAQ;AAAA,IACrB,aAAa,QAAQ;AAAA,IACrB,SAAS,QAAQ;AAAA,IACjB,cAAc,QAAQ;AAAA,IACtB,WAAW,QAAQ;AAAA,IACnB,sBAAsB,QAAQ;AAAA,EAChC;AACF;;;ADtRM,gBAAAC,YAAA;AAvBN,IAAM,2BAA2BC;AAAA,EAC/B;AACF;AAEA,IAAI,sBAAkD;AAO/C,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACF,GAAgD;AAC9C,QAAM,uBAAuB;AAAA,IAC3B,MAAO,eAAe,sBAAsB,YAAY,IAAI;AAAA,IAC5D,CAAC,YAAY;AAAA,EACf;AACA,wBAAsB;AACtB,SACE,gBAAAD,KAAC,gCAA6B,SAAS,sBACrC,0BAAAA,KAAC,yBAAyB,UAAzB,EAAkC,OAAO,sBACvC,UACH,GACF;AAEJ;AAEO,SAAS,kBAAuC;AACrD,QAAM,eACJE,YAAW,wBAAwB,KAAK,oBAAoB;AAC9D,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,0BAAsD;AACpE,SAAOA,YAAW,wBAAwB,KAAK,oBAAoB;AACrE;AAeO,SAAS,0BAAsD;AACpE,SACE,kCAAkC,KAClC,uBACA,oBAAoB;AAExB;AAkBA,SAAS,sBAAkD;AACzD,MAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO;AAAA,EACT;AACA,QAAM,uBAAuB,kCAAkC;AAC/D,MAAI,sBAAsB;AACxB,WAAO;AAAA,EACT;AACA,MAAI,qBAAqB;AACvB,WAAO;AAAA,EACT;AACA,QAAM,mBACJ,OAGA;AACF,SAAO,mBAAmB,sBAAsB,gBAAgB,IAAI;AACtE;AAEA,SAAS,oCAAgE;AACvE,MAAI,QAAQ,IAAI,aAAa,UAAU,OAAO,WAAW,aAAa;AACpE,WAAO;AAAA,EACT;AACA,QAAM,iBAAiB,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,EACF;AACA,MAAI,CAAC,kBAAkB,EAAE,WAAW,iBAAiB;AACnD,WAAO;AAAA,EACT;AACA,QAAM,mBAAmB,eAAe;AAIxC,SAAO,mBAAmB,sBAAsB,gBAAgB,IAAI;AACtE;","names":["createContext","useContext","jsx","createContext","useContext"]}
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
AgentGUIConversation_styles_default,
|
|
8
8
|
MessageSquareMoreIcon,
|
|
9
9
|
extractAgentMcpToolTarget
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WC34LVH6.js";
|
|
11
11
|
import {
|
|
12
12
|
Spinner
|
|
13
13
|
} from "./chunk-Y2DQJPTL.js";
|
|
14
14
|
import {
|
|
15
15
|
getOptionalAgentHostApi,
|
|
16
16
|
useOptionalAgentHostApi
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TXXWUG2J.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeAgentTitleText
|
|
20
20
|
} from "./chunk-GCBDIQDX.js";
|
|
@@ -1213,4 +1213,4 @@ export {
|
|
|
1213
1213
|
isPromptRequestIdTitle,
|
|
1214
1214
|
AgentInteractivePromptSurface
|
|
1215
1215
|
};
|
|
1216
|
-
//# sourceMappingURL=chunk-
|
|
1216
|
+
//# sourceMappingURL=chunk-UUM2GZXH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getOptionalAgentHostApi,
|
|
3
3
|
useOptionalAgentHostApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TXXWUG2J.js";
|
|
5
5
|
import {
|
|
6
6
|
translate,
|
|
7
7
|
useTranslation
|
|
@@ -3025,4 +3025,4 @@ export {
|
|
|
3025
3025
|
CustomScrollArea,
|
|
3026
3026
|
MessageSquareMoreIcon
|
|
3027
3027
|
};
|
|
3028
|
-
//# sourceMappingURL=chunk-
|
|
3028
|
+
//# sourceMappingURL=chunk-WC34LVH6.js.map
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
AgentMentionSearchController,
|
|
5
5
|
flattenAgentMentionPaletteEntries,
|
|
6
6
|
groupStartKeys
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-EQ4RSPQE.js";
|
|
8
8
|
import "../chunk-Y5SE2XMU.js";
|
|
9
9
|
import "../chunk-Y2DQJPTL.js";
|
|
10
10
|
import "../chunk-MTFSQWZ6.js";
|
|
11
11
|
import "../chunk-IBIMGLCD.js";
|
|
12
12
|
import "../chunk-RE3AHBX6.js";
|
|
13
13
|
import "../chunk-Y35GDLP2.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-TXXWUG2J.js";
|
|
15
15
|
import "../chunk-TYGL25EL.js";
|
|
16
16
|
import {
|
|
17
17
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ import { m as WorkspaceAgentActivityListViewModel, g as AgentHostWorkspaceAgentS
|
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { PropsWithChildren, JSX } from 'react';
|
|
6
6
|
import { I18nRuntime } from '@tutti-os/ui-i18n-runtime';
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { n as AgentProvider, c as AgentGUIProviderTargetRef, f as AgentHostAgentSessionComposerSettings, d as AgentHostActivateAgentSessionResult, l as AgentHostUpdateAgentSessionSettingsResult, j as AgentHostAgentSessionState, k as AgentHostUnactivateAgentSessionResult, A as AgentGUINodeData, P as Point, b as AgentGUIProviderTarget, N as NodeFrame, a as AgentGUIProvider } from './types-xMz0lJWt.js';
|
|
8
|
+
import { h as AgentProbeSnapshot, A as AgentGUINodeViewModel, f as AgentMessageMarkdownWorkspaceAppIcon, c as AgentHostInputApi } from './AgentMessageMarkdown-GDgLA-im.js';
|
|
9
|
+
export { b as AgentHostApi, d as AgentHostRuntimeApi, e as AgentHostSelectFilesInput, g as AgentProbeProvider, i as AgentProviderProbeListInput, j as AgentProviderProbeListResult, k as AgentUsageQuota, l as AgentUsageSnapshot, P as PersistWriteResult, R as ReadWorkspaceAgentReadStateInput, W as WorkspaceAgentReadStateSnapshot, m as WriteWorkspaceAgentReadStateInput } from './AgentMessageMarkdown-GDgLA-im.js';
|
|
9
10
|
import { ReferenceLocateTarget, WorkspaceFileReferenceAdapter, WorkspaceFileReference } from '@tutti-os/workspace-file-reference/contracts';
|
|
10
11
|
import { ReferenceSourceAggregator } from '@tutti-os/workspace-file-reference/core';
|
|
11
12
|
import { W as WorkspaceLinkAction } from './workspaceLinkActions-C6POH38D.js';
|
|
@@ -41,6 +42,105 @@ declare function agentHostSnapshotFromAgentActivitySnapshot(snapshot: AgentActiv
|
|
|
41
42
|
*/
|
|
42
43
|
declare function projectCoreSessionStatus(status: string): string;
|
|
43
44
|
|
|
45
|
+
type AgentCustomModelEnabledByProvider<TProvider extends string> = Record<TProvider, boolean>;
|
|
46
|
+
type AgentCustomModelByProvider<TProvider extends string> = Record<TProvider, string>;
|
|
47
|
+
type AgentCustomModelOptionsByProvider<TProvider extends string> = Record<TProvider, string[]>;
|
|
48
|
+
|
|
49
|
+
type FocusNodeTargetZoom = number;
|
|
50
|
+
|
|
51
|
+
declare const UI_LANGUAGES: readonly ["en", "zh-CN"];
|
|
52
|
+
type UiLanguage = (typeof UI_LANGUAGES)[number];
|
|
53
|
+
declare const UI_THEMES: readonly ["system", "light", "dark"];
|
|
54
|
+
type UiTheme = (typeof UI_THEMES)[number];
|
|
55
|
+
|
|
56
|
+
declare const COMMAND_IDS: readonly ["commandCenter.toggle", "app.togglePrimarySidebar", "workspaceCanvas.createTerminal"];
|
|
57
|
+
type CommandId = (typeof COMMAND_IDS)[number];
|
|
58
|
+
type KeyChord = {
|
|
59
|
+
code: string;
|
|
60
|
+
altKey: boolean;
|
|
61
|
+
ctrlKey: boolean;
|
|
62
|
+
metaKey: boolean;
|
|
63
|
+
shiftKey: boolean;
|
|
64
|
+
};
|
|
65
|
+
type KeybindingOverrides = Partial<Record<CommandId, KeyChord | null>>;
|
|
66
|
+
|
|
67
|
+
declare const CANVAS_INPUT_MODES: readonly ["auto", "mouse", "trackpad"];
|
|
68
|
+
type CanvasInputMode = (typeof CANVAS_INPUT_MODES)[number];
|
|
69
|
+
declare const CANVAS_WHEEL_BEHAVIORS: readonly ["zoom", "pan"];
|
|
70
|
+
type CanvasWheelBehavior = (typeof CANVAS_WHEEL_BEHAVIORS)[number];
|
|
71
|
+
declare const CANVAS_WHEEL_ZOOM_MODIFIERS: readonly ["primary", "ctrl", "alt"];
|
|
72
|
+
type CanvasWheelZoomModifier = (typeof CANVAS_WHEEL_ZOOM_MODIFIERS)[number];
|
|
73
|
+
declare const STANDARD_WINDOW_SIZE_BUCKETS: readonly ["compact", "regular", "large"];
|
|
74
|
+
type StandardWindowSizeBucket = (typeof STANDARD_WINDOW_SIZE_BUCKETS)[number];
|
|
75
|
+
|
|
76
|
+
type QuickCommand = {
|
|
77
|
+
id: string;
|
|
78
|
+
title: string;
|
|
79
|
+
kind: "terminal";
|
|
80
|
+
command: string;
|
|
81
|
+
enabled: boolean;
|
|
82
|
+
pinned: boolean;
|
|
83
|
+
} | {
|
|
84
|
+
id: string;
|
|
85
|
+
title: string;
|
|
86
|
+
kind: "url";
|
|
87
|
+
url: string;
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
pinned: boolean;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
type QuickPhrase = {
|
|
93
|
+
id: string;
|
|
94
|
+
title: string;
|
|
95
|
+
content: string;
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
type AgentEnvRow = {
|
|
100
|
+
id: string;
|
|
101
|
+
key: string;
|
|
102
|
+
value: string;
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
};
|
|
105
|
+
type AgentEnvByProvider = Record<AgentProvider, AgentEnvRow[]>;
|
|
106
|
+
|
|
107
|
+
type TerminalProfileId = string | null;
|
|
108
|
+
interface AgentSettings {
|
|
109
|
+
language: UiLanguage;
|
|
110
|
+
uiTheme: UiTheme;
|
|
111
|
+
isPrimarySidebarCollapsed: boolean;
|
|
112
|
+
defaultProvider: AgentProvider;
|
|
113
|
+
agentProviderOrder: AgentProvider[];
|
|
114
|
+
agentFullAccess: boolean;
|
|
115
|
+
defaultTerminalProfileId: TerminalProfileId;
|
|
116
|
+
customModelEnabledByProvider: AgentCustomModelEnabledByProvider<AgentProvider>;
|
|
117
|
+
customModelByProvider: AgentCustomModelByProvider<AgentProvider>;
|
|
118
|
+
customModelOptionsByProvider: AgentCustomModelOptionsByProvider<AgentProvider>;
|
|
119
|
+
quickCommands: QuickCommand[];
|
|
120
|
+
quickPhrases: QuickPhrase[];
|
|
121
|
+
agentEnvByProvider: AgentEnvByProvider;
|
|
122
|
+
focusNodeOnClick: boolean;
|
|
123
|
+
focusNodeTargetZoom: FocusNodeTargetZoom;
|
|
124
|
+
focusNodeUseVisibleCanvasCenter: boolean;
|
|
125
|
+
standbyBannerEnabled: boolean;
|
|
126
|
+
standbyBannerShowTask: boolean;
|
|
127
|
+
standbyBannerShowSpace: boolean;
|
|
128
|
+
standbyBannerShowBranch: boolean;
|
|
129
|
+
disableAppShortcutsWhenTerminalFocused: boolean;
|
|
130
|
+
keybindings: KeybindingOverrides;
|
|
131
|
+
canvasInputMode: CanvasInputMode;
|
|
132
|
+
canvasWheelBehavior: CanvasWheelBehavior;
|
|
133
|
+
canvasWheelZoomModifier: CanvasWheelZoomModifier;
|
|
134
|
+
standardWindowSizeBucket: StandardWindowSizeBucket;
|
|
135
|
+
defaultTerminalWindowScalePercent: number;
|
|
136
|
+
terminalFontSize: number;
|
|
137
|
+
terminalFontFamily: string | null;
|
|
138
|
+
uiFontSize: number;
|
|
139
|
+
avoidGroupingEdits: boolean;
|
|
140
|
+
updatePolicy: AppUpdatePolicy;
|
|
141
|
+
hideWorktreeMismatchDropWarning: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
44
144
|
interface AgentActivityRuntimeListSessionMessagesInput {
|
|
45
145
|
afterVersion?: number;
|
|
46
146
|
beforeVersion?: number;
|
|
@@ -126,6 +226,11 @@ interface AgentActivityRuntimeActivateSessionInput {
|
|
|
126
226
|
mode: "existing" | "new";
|
|
127
227
|
openclawGatewayReady?: boolean;
|
|
128
228
|
provider?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Opaque host-owned target reference. AgentGUI passes this through only; hosts
|
|
231
|
+
* must not treat it as authority and must re-authenticate before launch.
|
|
232
|
+
*/
|
|
233
|
+
providerTargetRef?: AgentGUIProviderTargetRef | null;
|
|
129
234
|
settings?: AgentHostAgentSessionComposerSettings;
|
|
130
235
|
title?: string;
|
|
131
236
|
visible?: boolean;
|
|
@@ -228,105 +333,6 @@ declare function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null;
|
|
|
228
333
|
declare function resetAgentActivityRuntimeForTests(): void;
|
|
229
334
|
declare function setAgentActivityRuntimeForTests(runtime: AgentActivityRuntime | null): void;
|
|
230
335
|
|
|
231
|
-
type AgentCustomModelEnabledByProvider<TProvider extends string> = Record<TProvider, boolean>;
|
|
232
|
-
type AgentCustomModelByProvider<TProvider extends string> = Record<TProvider, string>;
|
|
233
|
-
type AgentCustomModelOptionsByProvider<TProvider extends string> = Record<TProvider, string[]>;
|
|
234
|
-
|
|
235
|
-
type FocusNodeTargetZoom = number;
|
|
236
|
-
|
|
237
|
-
declare const UI_LANGUAGES: readonly ["en", "zh-CN"];
|
|
238
|
-
type UiLanguage = (typeof UI_LANGUAGES)[number];
|
|
239
|
-
declare const UI_THEMES: readonly ["system", "light", "dark"];
|
|
240
|
-
type UiTheme = (typeof UI_THEMES)[number];
|
|
241
|
-
|
|
242
|
-
declare const COMMAND_IDS: readonly ["commandCenter.toggle", "app.togglePrimarySidebar", "workspaceCanvas.createTerminal"];
|
|
243
|
-
type CommandId = (typeof COMMAND_IDS)[number];
|
|
244
|
-
type KeyChord = {
|
|
245
|
-
code: string;
|
|
246
|
-
altKey: boolean;
|
|
247
|
-
ctrlKey: boolean;
|
|
248
|
-
metaKey: boolean;
|
|
249
|
-
shiftKey: boolean;
|
|
250
|
-
};
|
|
251
|
-
type KeybindingOverrides = Partial<Record<CommandId, KeyChord | null>>;
|
|
252
|
-
|
|
253
|
-
declare const CANVAS_INPUT_MODES: readonly ["auto", "mouse", "trackpad"];
|
|
254
|
-
type CanvasInputMode = (typeof CANVAS_INPUT_MODES)[number];
|
|
255
|
-
declare const CANVAS_WHEEL_BEHAVIORS: readonly ["zoom", "pan"];
|
|
256
|
-
type CanvasWheelBehavior = (typeof CANVAS_WHEEL_BEHAVIORS)[number];
|
|
257
|
-
declare const CANVAS_WHEEL_ZOOM_MODIFIERS: readonly ["primary", "ctrl", "alt"];
|
|
258
|
-
type CanvasWheelZoomModifier = (typeof CANVAS_WHEEL_ZOOM_MODIFIERS)[number];
|
|
259
|
-
declare const STANDARD_WINDOW_SIZE_BUCKETS: readonly ["compact", "regular", "large"];
|
|
260
|
-
type StandardWindowSizeBucket = (typeof STANDARD_WINDOW_SIZE_BUCKETS)[number];
|
|
261
|
-
|
|
262
|
-
type QuickCommand = {
|
|
263
|
-
id: string;
|
|
264
|
-
title: string;
|
|
265
|
-
kind: "terminal";
|
|
266
|
-
command: string;
|
|
267
|
-
enabled: boolean;
|
|
268
|
-
pinned: boolean;
|
|
269
|
-
} | {
|
|
270
|
-
id: string;
|
|
271
|
-
title: string;
|
|
272
|
-
kind: "url";
|
|
273
|
-
url: string;
|
|
274
|
-
enabled: boolean;
|
|
275
|
-
pinned: boolean;
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
type QuickPhrase = {
|
|
279
|
-
id: string;
|
|
280
|
-
title: string;
|
|
281
|
-
content: string;
|
|
282
|
-
enabled: boolean;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
type AgentEnvRow = {
|
|
286
|
-
id: string;
|
|
287
|
-
key: string;
|
|
288
|
-
value: string;
|
|
289
|
-
enabled: boolean;
|
|
290
|
-
};
|
|
291
|
-
type AgentEnvByProvider = Record<AgentProvider, AgentEnvRow[]>;
|
|
292
|
-
|
|
293
|
-
type TerminalProfileId = string | null;
|
|
294
|
-
interface AgentSettings {
|
|
295
|
-
language: UiLanguage;
|
|
296
|
-
uiTheme: UiTheme;
|
|
297
|
-
isPrimarySidebarCollapsed: boolean;
|
|
298
|
-
defaultProvider: AgentProvider;
|
|
299
|
-
agentProviderOrder: AgentProvider[];
|
|
300
|
-
agentFullAccess: boolean;
|
|
301
|
-
defaultTerminalProfileId: TerminalProfileId;
|
|
302
|
-
customModelEnabledByProvider: AgentCustomModelEnabledByProvider<AgentProvider>;
|
|
303
|
-
customModelByProvider: AgentCustomModelByProvider<AgentProvider>;
|
|
304
|
-
customModelOptionsByProvider: AgentCustomModelOptionsByProvider<AgentProvider>;
|
|
305
|
-
quickCommands: QuickCommand[];
|
|
306
|
-
quickPhrases: QuickPhrase[];
|
|
307
|
-
agentEnvByProvider: AgentEnvByProvider;
|
|
308
|
-
focusNodeOnClick: boolean;
|
|
309
|
-
focusNodeTargetZoom: FocusNodeTargetZoom;
|
|
310
|
-
focusNodeUseVisibleCanvasCenter: boolean;
|
|
311
|
-
standbyBannerEnabled: boolean;
|
|
312
|
-
standbyBannerShowTask: boolean;
|
|
313
|
-
standbyBannerShowSpace: boolean;
|
|
314
|
-
standbyBannerShowBranch: boolean;
|
|
315
|
-
disableAppShortcutsWhenTerminalFocused: boolean;
|
|
316
|
-
keybindings: KeybindingOverrides;
|
|
317
|
-
canvasInputMode: CanvasInputMode;
|
|
318
|
-
canvasWheelBehavior: CanvasWheelBehavior;
|
|
319
|
-
canvasWheelZoomModifier: CanvasWheelZoomModifier;
|
|
320
|
-
standardWindowSizeBucket: StandardWindowSizeBucket;
|
|
321
|
-
defaultTerminalWindowScalePercent: number;
|
|
322
|
-
terminalFontSize: number;
|
|
323
|
-
terminalFontFamily: string | null;
|
|
324
|
-
uiFontSize: number;
|
|
325
|
-
avoidGroupingEdits: boolean;
|
|
326
|
-
updatePolicy: AppUpdatePolicy;
|
|
327
|
-
hideWorktreeMismatchDropWarning: boolean;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
336
|
interface DesktopSize {
|
|
331
337
|
width: number;
|
|
332
338
|
height: number;
|
|
@@ -414,6 +420,8 @@ interface AgentGUINodeProps {
|
|
|
414
420
|
capabilityMenuState?: AgentComposerCapabilityMenuState;
|
|
415
421
|
onCapabilitySettingsRequest?: (capability: AgentComposerCapabilitySettingsTarget) => void;
|
|
416
422
|
onAgentProviderLogin?: (provider: AgentProvider) => void;
|
|
423
|
+
providerTargets?: readonly AgentGUIProviderTarget[];
|
|
424
|
+
defaultProviderTargetId?: string | null;
|
|
417
425
|
onWorkspaceFileReferencesAdded?: (input: {
|
|
418
426
|
provider: AgentProvider;
|
|
419
427
|
references: readonly WorkspaceFileReference[];
|
|
@@ -450,6 +458,20 @@ interface AgentGUIProps extends AgentGUINodeProps {
|
|
|
450
458
|
}
|
|
451
459
|
declare const AgentGUI: react.NamedExoticComponent<AgentGUIProps>;
|
|
452
460
|
|
|
461
|
+
declare const agentGUIDefaultTargetProviders: readonly ["codex", "claude-code", "nexight", "hermes", "gemini", "openclaw"];
|
|
462
|
+
declare function createLocalAgentGUIProviderTarget(provider: AgentGUIProvider): AgentGUIProviderTarget;
|
|
463
|
+
declare function createLocalAgentGUIProviderTargets(providers?: readonly AgentGUIProvider[]): AgentGUIProviderTarget[];
|
|
464
|
+
declare function localAgentGUIProviderTargetId(provider: AgentGUIProvider): string;
|
|
465
|
+
declare function normalizeAgentGUIProviderTargets(targets: readonly AgentGUIProviderTarget[] | null | undefined, options?: {
|
|
466
|
+
fallbackToLocal?: boolean;
|
|
467
|
+
}): AgentGUIProviderTarget[];
|
|
468
|
+
declare function resolveAgentGUIProviderTarget(input: {
|
|
469
|
+
defaultProviderTargetId?: string | null;
|
|
470
|
+
provider: AgentGUIProvider;
|
|
471
|
+
providerTargetId?: string | null;
|
|
472
|
+
providerTargets: readonly AgentGUIProviderTarget[];
|
|
473
|
+
}): AgentGUIProviderTarget;
|
|
474
|
+
|
|
453
475
|
declare const agentGuiDockIconUrl: string;
|
|
454
476
|
declare const agentGuiDockIconUrls: {
|
|
455
477
|
readonly "claude-code": string;
|
|
@@ -491,4 +513,4 @@ interface AgentActivityHostProviderProps extends PropsWithChildren {
|
|
|
491
513
|
}
|
|
492
514
|
declare function AgentActivityHostProvider({ agentActivityRuntime, agentHostApi, children }: AgentActivityHostProviderProps): JSX.Element;
|
|
493
515
|
|
|
494
|
-
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, AgentGUI, type AgentGUIProps, AgentGuiI18nLocale, AgentHostInputApi, AgentProbeSnapshot, agentGuiDockIconUrl, agentGuiDockIconUrls, agentHostSnapshotFromAgentActivitySnapshot, buildAgentActivitySnapshotProjection, getAgentActivityRuntime, getOptionalAgentActivityRuntime, projectCoreSessionStatus, resetAgentActivityRuntimeForTests, resolveAgentGUIExpandedWindowFrame, setAgentActivityRuntimeForTests, shouldAutoCollapseAgentGUIConversationRail, useAgentActivityRuntime, useAgentActivitySnapshot, useOptionalAgentActivityRuntime };
|
|
516
|
+
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, AgentGUI, type AgentGUIProps, AgentGUIProvider, AgentGUIProviderTarget, AgentGUIProviderTargetRef, AgentGuiI18nLocale, AgentHostInputApi, AgentProbeSnapshot, agentGUIDefaultTargetProviders, agentGuiDockIconUrl, agentGuiDockIconUrls, agentHostSnapshotFromAgentActivitySnapshot, buildAgentActivitySnapshotProjection, createLocalAgentGUIProviderTarget, createLocalAgentGUIProviderTargets, getAgentActivityRuntime, getOptionalAgentActivityRuntime, localAgentGUIProviderTargetId, normalizeAgentGUIProviderTargets, projectCoreSessionStatus, resetAgentActivityRuntimeForTests, resolveAgentGUIExpandedWindowFrame, resolveAgentGUIProviderTarget, setAgentActivityRuntimeForTests, shouldAutoCollapseAgentGUIConversationRail, useAgentActivityRuntime, useAgentActivitySnapshot, useOptionalAgentActivityRuntime };
|