@tutti-os/agent-gui 0.0.107 → 0.0.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentGUI-Do6py-T_.d.ts → AgentGUI-CkxdEB8F.d.ts} +6 -3
- package/dist/AgentRichTextReadonly-42TUVYX5.js +18 -0
- package/dist/agent-conversation/index.d.ts +4 -4
- package/dist/agent-conversation/index.js +13 -12
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-env/index.js +1 -1
- package/dist/agent-gui.d.ts +5 -4
- package/dist/agent-gui.js +27 -25
- package/dist/agent-message-center/index.d.ts +3 -1
- package/dist/agent-message-center/index.js +22 -10
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentConversationVM-Bf3Zv3iI.d.ts → agentConversationVM-D3Dn2LqN.d.ts} +18 -2
- package/dist/{agentGuiNodeTypes-DbgQBiYz.d.ts → agentGuiNodeTypes-B3N_hJZp.d.ts} +5 -3
- package/dist/agents.d.ts +1 -1
- package/dist/agents.js +1 -1
- package/dist/app/renderer/agentactivity.css +64 -2
- package/dist/app/renderer/assets/icons/agent-vinyl-beta-tag.svg +5 -0
- package/dist/{chunk-OWW7CU4U.js → chunk-25BPR75P.js} +2 -2
- package/dist/{chunk-N4WVVCNI.js → chunk-2QHKXI5N.js} +2 -2
- package/dist/{chunk-KJQERFKX.js → chunk-6CUELYIF.js} +3 -3
- package/dist/chunk-6CUELYIF.js.map +1 -0
- package/dist/{chunk-TKBEVCHG.js → chunk-7BN2WQ2M.js} +32 -2
- package/dist/chunk-7BN2WQ2M.js.map +1 -0
- package/dist/chunk-7KVZPJ3O.js +25 -0
- package/dist/chunk-7KVZPJ3O.js.map +1 -0
- package/dist/{chunk-C35SNDVZ.js → chunk-7OYHDOGG.js} +2 -1
- package/dist/chunk-7OYHDOGG.js.map +1 -0
- package/dist/{chunk-4ZWV57MF.js → chunk-AIZJHA4Q.js} +14 -9
- package/dist/chunk-AIZJHA4Q.js.map +1 -0
- package/dist/{chunk-QY22OBJS.js → chunk-AY5AFMT2.js} +8 -84
- package/dist/chunk-AY5AFMT2.js.map +1 -0
- package/dist/{chunk-V5ROOS2O.js → chunk-BM3CSFWU.js} +22 -6
- package/dist/chunk-BM3CSFWU.js.map +1 -0
- package/dist/{chunk-F7Q7QK42.js → chunk-BRLKORQI.js} +1432 -1902
- package/dist/chunk-BRLKORQI.js.map +1 -0
- package/dist/{chunk-LDZ6C3YV.js → chunk-E74BMFHI.js} +3 -3
- package/dist/chunk-E74BMFHI.js.map +1 -0
- package/dist/{chunk-ZSJBCZUH.js → chunk-EBXOSQ5G.js} +102 -73
- package/dist/chunk-EBXOSQ5G.js.map +1 -0
- package/dist/chunk-J4K7KIFZ.js +75 -0
- package/dist/chunk-J4K7KIFZ.js.map +1 -0
- package/dist/{chunk-UFIEUC3Y.js → chunk-JBX3JPTC.js} +9 -8
- package/dist/chunk-JBX3JPTC.js.map +1 -0
- package/dist/{chunk-4YVKAPKW.js → chunk-JLRPIEIE.js} +2 -17
- package/dist/chunk-JLRPIEIE.js.map +1 -0
- package/dist/{chunk-ZWY32ZKZ.js → chunk-KXZMIZ5H.js} +1269 -728
- package/dist/chunk-KXZMIZ5H.js.map +1 -0
- package/dist/{chunk-4YG7YK7S.js → chunk-L2GENUG3.js} +3 -3
- package/dist/{chunk-J2HG7UCP.js → chunk-OEYXSD3O.js} +3 -3
- package/dist/{chunk-P3CVAWGJ.js → chunk-QTW5CH62.js} +5 -5
- package/dist/{chunk-L3GMMGRS.js → chunk-R2ZADXRB.js} +2 -2
- package/dist/chunk-R7AXDQCA.js +146 -0
- package/dist/chunk-R7AXDQCA.js.map +1 -0
- package/dist/{chunk-7MPN2JGL.js → chunk-U4CVBCHD.js} +37 -119
- package/dist/chunk-U4CVBCHD.js.map +1 -0
- package/dist/{chunk-BXOKBZH4.js → chunk-UFD2QKGC.js} +9 -6
- package/dist/chunk-UFD2QKGC.js.map +1 -0
- package/dist/{chunk-4YCCATI4.js → chunk-USIFGHT3.js} +17 -4
- package/dist/chunk-USIFGHT3.js.map +1 -0
- package/dist/{chunk-7BXWPI4F.js → chunk-VMQNG2KI.js} +13 -1
- package/dist/{chunk-7BXWPI4F.js.map → chunk-VMQNG2KI.js.map} +1 -1
- package/dist/{chunk-SN6UYX54.js → chunk-W6TO6K2X.js} +4 -4
- package/dist/{chunk-UGVI47X6.js → chunk-YNSXUEIR.js} +6 -6
- package/dist/context-mention-palette/index.js +13 -12
- package/dist/{contribution-C6K5YfJ7.d.ts → contribution-C2LDwLA7.d.ts} +3 -2
- package/dist/dock-icons.js +3 -3
- package/dist/i18n/index.d.ts +31 -1
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +8 -7
- package/dist/index.js +27 -25
- package/dist/index.js.map +1 -1
- package/dist/mention-search.js +11 -10
- package/dist/provider-icons.js +1 -1
- package/dist/provider-identity.js +1 -1
- package/dist/{types-CnT8rNUI.d.ts → types-yF_0mrNS.d.ts} +1 -0
- package/dist/workbench/contribution.d.ts +2 -2
- package/dist/workbench/contribution.js +11 -11
- package/dist/workbench/index.d.ts +4 -4
- package/dist/workbench/index.js +22 -28
- package/dist/workbench/launch.d.ts +11 -14
- package/dist/workbench/launch.js +5 -11
- package/dist/workbench/providerCatalog.js +2 -2
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +2 -12
- package/dist/workbench/state.js +3 -9
- package/dist/workspace-agent-generated-files.js +2 -1
- package/dist/workspace-query-cache.d.ts +19 -0
- package/dist/workspace-query-cache.js +7 -0
- package/dist/workspace-query-cache.js.map +1 -0
- package/package.json +21 -14
- package/dist/@-bold-lined-BLLFKBFI.svg +0 -10
- package/dist/AgentRichTextReadonly-F6PHC5SX.js +0 -18
- package/dist/add-lined-bold-5QPUDZCU.svg +0 -3
- package/dist/chunk-4YCCATI4.js.map +0 -1
- package/dist/chunk-4YVKAPKW.js.map +0 -1
- package/dist/chunk-4ZWV57MF.js.map +0 -1
- package/dist/chunk-7MPN2JGL.js.map +0 -1
- package/dist/chunk-BXOKBZH4.js.map +0 -1
- package/dist/chunk-C35SNDVZ.js.map +0 -1
- package/dist/chunk-F7Q7QK42.js.map +0 -1
- package/dist/chunk-H6IQ63DQ.js +0 -14
- package/dist/chunk-H6IQ63DQ.js.map +0 -1
- package/dist/chunk-KJQERFKX.js.map +0 -1
- package/dist/chunk-LDZ6C3YV.js.map +0 -1
- package/dist/chunk-QY22OBJS.js.map +0 -1
- package/dist/chunk-TKBEVCHG.js.map +0 -1
- package/dist/chunk-UFIEUC3Y.js.map +0 -1
- package/dist/chunk-V5ROOS2O.js.map +0 -1
- package/dist/chunk-ZSJBCZUH.js.map +0 -1
- package/dist/chunk-ZWY32ZKZ.js.map +0 -1
- package/dist/claudecode-flat-filled-NHO4JCVK.svg +0 -10
- package/dist/codex-flat-filled-WYHCF5VR.svg +0 -10
- package/dist/cursor-flat-filled-CL7N3BTZ.svg +0 -3
- package/dist/handoff-lined-4WQUBVG3.svg +0 -11
- package/dist/open-link-lined-JWEKUKME.svg +0 -4
- package/dist/opencode-flat-filled-CYAJPX45.svg +0 -4
- package/dist/tutti-flat-filled-K32QBTZE.svg +0 -12
- /package/dist/{AgentRichTextReadonly-F6PHC5SX.js.map → AgentRichTextReadonly-42TUVYX5.js.map} +0 -0
- /package/dist/{chunk-OWW7CU4U.js.map → chunk-25BPR75P.js.map} +0 -0
- /package/dist/{chunk-N4WVVCNI.js.map → chunk-2QHKXI5N.js.map} +0 -0
- /package/dist/{chunk-4YG7YK7S.js.map → chunk-L2GENUG3.js.map} +0 -0
- /package/dist/{chunk-J2HG7UCP.js.map → chunk-OEYXSD3O.js.map} +0 -0
- /package/dist/{chunk-P3CVAWGJ.js.map → chunk-QTW5CH62.js.map} +0 -0
- /package/dist/{chunk-L3GMMGRS.js.map → chunk-R2ZADXRB.js.map} +0 -0
- /package/dist/{chunk-SN6UYX54.js.map → chunk-W6TO6K2X.js.map} +0 -0
- /package/dist/{chunk-UGVI47X6.js.map → chunk-YNSXUEIR.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
translate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-25BPR75P.js";
|
|
4
4
|
import {
|
|
5
5
|
agentGUIProviderIdentityDisplayName,
|
|
6
6
|
resolveMigratedAgentGUIProviderIdentity
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6CUELYIF.js";
|
|
8
8
|
|
|
9
9
|
// agentActivityRuntime.tsx
|
|
10
10
|
import {
|
|
@@ -211,4 +211,4 @@ export {
|
|
|
211
211
|
getOptionalAgentHostApi,
|
|
212
212
|
workspaceAgentProviderLabel
|
|
213
213
|
};
|
|
214
|
-
//# sourceMappingURL=chunk-
|
|
214
|
+
//# sourceMappingURL=chunk-E74BMFHI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts","../shared/workspaceAgentProviderLabel.ts"],"sourcesContent":["import {\n createContext,\n useContext,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityActivateSessionResult,\n AgentActivityGoalControlInput,\n AgentActivityGoalControlResult,\n AgentActivityCreateSessionInput,\n AgentActivityDeleteSessionInput,\n AgentActivityDeleteSessionResult,\n AgentActivityMessageOrder,\n AgentActivityMessagePage,\n AgentActivityRenameSessionInput,\n AgentActivitySendInput,\n AgentActivitySendInputResult,\n AgentActivitySession,\n AgentActivitySessionSettings,\n AgentActivitySnapshot,\n AgentActivitySnapshotListener,\n AgentActivitySubmitInteractiveInput,\n AgentActivitySubmitInteractiveResult,\n AgentSessionEngine\n} from \"@tutti-os/agent-activity-core\";\nimport type {\n AgentHostAgentSessionComposerSettings,\n AgentHostUnactivateAgentSessionResult\n} from \"./shared/contracts/dto\";\nimport type { WorkspaceQueryCache } from \"./shared/query/workspaceQueryCache\";\n\nexport interface AgentActivityRuntimeUpdateSessionSettingsResult {\n agentSessionId: string;\n settings: AgentHostAgentSessionComposerSettings;\n session: AgentActivitySession;\n}\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 agentTargetIds?: readonly string[];\n limit?: number;\n query?: string;\n sessionCwd?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionsPageInput {\n agentTargetId?: string | null;\n cursor?: string;\n limit?: number;\n searchQuery?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeSessionPageResult {\n hasMore: boolean;\n nextCursor?: string;\n sessions: AgentActivitySession[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionsInput {\n agentTargetId?: string | null;\n limitPerSection?: number;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionPageInput {\n agentTargetId?: string | null;\n cursor?: string;\n limit?: number;\n sectionKey: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListPinnedSessionsPageInput {\n agentTargetId?: string | null;\n cursor?: string;\n limit?: number;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUserProject {\n createdAtUnixMs: number;\n id: string;\n label: string;\n lastUsedAtUnixMs?: number;\n path: string;\n sectionKey: string;\n updatedAtUnixMs: number;\n}\n\nexport interface AgentActivityRuntimeSessionSection {\n kind: \"conversations\" | \"project\";\n sectionKey: string;\n userProject?: AgentActivityRuntimeUserProject;\n sessions: AgentActivitySession[];\n hasMore: boolean;\n totalCount: number;\n nextCursor?: string;\n}\n\nexport interface AgentActivityRuntimeSessionPage {\n sessions: AgentActivitySession[];\n hasMore: boolean;\n totalCount: number;\n nextCursor?: string;\n}\n\nexport interface AgentActivityRuntimeSessionSectionsResult {\n pinned?: AgentActivityRuntimeSessionPage;\n sections: AgentActivityRuntimeSessionSection[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFile {\n label: string;\n path: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFileList {\n entries: AgentActivityRuntimeGeneratedFile[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeEnsureSessionSynchronizedInput {\n afterVersion?: number;\n agentSessionId: string;\n onError?: (error: unknown) => void;\n workspaceId: string;\n}\n\nexport 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 AgentActivityRuntimeGetComposerOptionsInput {\n agentTargetId: string;\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 AgentActivityRuntimeDiagnosticInput {\n details?: Record<string, unknown>;\n event: string;\n level?: \"debug\" | \"info\" | \"warn\" | \"error\";\n source?: string;\n workspaceId?: string | null;\n}\n\ninterface AgentActivityRuntimeActivateSessionInputBase {\n agentSessionId: string;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n submitDiagnostics?: AgentActivitySendInput[\"submitDiagnostics\"];\n settings?: AgentActivitySessionSettings;\n title?: string;\n visible?: boolean;\n workspaceId: string;\n signal?: AbortSignal;\n}\n\nexport type AgentActivityRuntimeActivateSessionInput =\n | (AgentActivityRuntimeActivateSessionInputBase & {\n agentTargetId: string;\n clientSubmitId: string;\n mode: \"new\";\n })\n | (AgentActivityRuntimeActivateSessionInputBase & {\n agentTargetId?: string | null;\n clientSubmitId?: never;\n mode: \"existing\";\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\n/**\n * Dedicated host boundary for turning an in-memory text paste into a local\n * prompt asset. The runtime owns persistence and returns a sendable host path;\n * AgentGUI must not infer this capability from generic file-upload support.\n */\nexport interface AgentActivityRuntimeStagePastedTextInput {\n name: string;\n text: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeStagePastedTextResult {\n name: string;\n path: string;\n sizeBytes: number;\n}\n\nexport interface AgentActivityRuntimeSessionSectionScopeInput {\n agentTargetId?: string | null;\n excludePinned?: boolean;\n sectionKey: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeSessionSectionDeletionCandidates {\n agentTargetId?: string | null;\n excludePinned: boolean;\n sectionKey: string;\n sessionIds: string[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeDeleteSessionsBatchInput {\n sessionIds: string[];\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeDeleteSessionsBatchResult {\n removedMessages: number;\n removedSessionIds: string[];\n removedSessions: number;\n}\n\nexport interface AgentActivityRuntimeSessionAttachment {\n attachmentId: string;\n mimeType: string;\n name?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntimePromptAsset {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n mimeType: string;\n name?: string;\n path: string;\n uploadStatus?: string;\n uri?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntime {\n /**\n * Stable identity of this runtime instance (e.g. a local origin vs a\n * shared/room origin). The runtime owns one session engine per workspace and\n * that engine verifies this origin as part of its injected identity. Runtime\n * consumers resolve only through the nearest React provider; module-global\n * runtime lookup and last-mounted fallback are forbidden. An absent origin\n * means the canonical local origin.\n */\n origin?: string;\n /**\n * The session cwd is not resolvable on the local filesystem (e.g. a\n * shared/cloud sandbox not mounted locally), so AgentGUI must not run its\n * local stat-based \"working directory missing\" existence check — it would\n * always false-positive. Absent/false (default) => local, legacy behaviour.\n * Only that one guard is gated; project selection/listing is unaffected.\n */\n projectPathIsRemote?: boolean;\n promptContentUploadSupport?: {\n file?: boolean;\n image?: boolean;\n };\n /** Set false to suppress AgentGUI diagnostics in development consoles. */\n devDiagnosticConsoleSink?: boolean;\n goalControl(\n input: AgentActivityGoalControlInput\n ): Promise<AgentActivityGoalControlResult>;\n createSession(\n input: AgentActivityCreateSessionInput\n ): Promise<AgentActivitySession>;\n deleteSession(\n input: AgentActivityDeleteSessionInput\n ): Promise<AgentActivityDeleteSessionResult>;\n activateSession(\n input: AgentActivityRuntimeActivateSessionInput\n ): Promise<AgentActivityActivateSessionResult>;\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<AgentActivityRuntimeUpdateSessionSettingsResult>;\n getSnapshot(workspaceId: string): AgentActivitySnapshot;\n getSessionEngine(workspaceId: string): AgentSessionEngine;\n getSessionSectionsQueryCache?(\n workspaceId: string\n ): WorkspaceQueryCache<unknown>;\n listSessionMessages(\n input: AgentActivityRuntimeListSessionMessagesInput\n ): Promise<AgentActivityMessagePage>;\n listAgentGeneratedFiles?(\n input: AgentActivityRuntimeListGeneratedFilesInput\n ): Promise<AgentActivityRuntimeGeneratedFileList>;\n listSessionsPage?(\n input: AgentActivityRuntimeListSessionsPageInput\n ): Promise<AgentActivityRuntimeSessionPageResult>;\n listSessionSections?(\n input: AgentActivityRuntimeListSessionSectionsInput\n ): Promise<AgentActivityRuntimeSessionSectionsResult>;\n listSessionSectionPage?(\n input: AgentActivityRuntimeListSessionSectionPageInput\n ): Promise<AgentActivityRuntimeSessionSection>;\n listSessionSectionDeletionCandidates?(\n input: AgentActivityRuntimeSessionSectionScopeInput\n ): Promise<AgentActivityRuntimeSessionSectionDeletionCandidates>;\n deleteSessionsBatch?(\n input: AgentActivityRuntimeDeleteSessionsBatchInput\n ): Promise<AgentActivityRuntimeDeleteSessionsBatchResult>;\n listPinnedSessionsPage?(\n input: AgentActivityRuntimeListPinnedSessionsPageInput\n ): Promise<AgentActivityRuntimeSessionPage>;\n load(\n workspaceId: string,\n signal?: AbortSignal\n ): Promise<AgentActivitySnapshot>;\n ensureSessionSynchronized?(\n input: AgentActivityRuntimeEnsureSessionSynchronizedInput\n ): () => void;\n sendInput(\n input: AgentActivitySendInput\n ): Promise<AgentActivitySendInputResult>;\n uploadPromptContent?(\n input: AgentActivityRuntimeUploadPromptContentInput\n ): Promise<AgentActivityRuntimeUploadPromptContentResult>;\n stagePastedText?(\n input: AgentActivityRuntimeStagePastedTextInput\n ): Promise<AgentActivityRuntimeStagePastedTextResult>;\n readSessionAttachment?(\n input: AgentActivityRuntimeReadSessionAttachmentInput\n ): Promise<AgentActivityRuntimeSessionAttachment>;\n readPromptAsset?(\n input: AgentActivityRuntimeReadPromptAssetInput\n ): Promise<AgentActivityRuntimePromptAsset>;\n renameSession(\n input: AgentActivityRenameSessionInput\n ): Promise<AgentActivitySession>;\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<AgentActivitySubmitInteractiveResult>;\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\nfunction createTestAgentActivityRuntimeHolder(): {\n get: () => AgentActivityRuntime | null;\n set: (runtime: AgentActivityRuntime | null) => void;\n} {\n let runtime: AgentActivityRuntime | null = null;\n return {\n get: () => runtime,\n set: (nextRuntime) => {\n runtime = nextRuntime;\n }\n };\n}\n\nconst testAgentActivityRuntimeHolder = createTestAgentActivityRuntimeHolder();\n\nexport interface AgentActivityRuntimeProviderProps extends PropsWithChildren {\n runtime?: AgentActivityRuntime | null;\n}\n\nexport function AgentActivityRuntimeProvider({\n children,\n runtime\n}: AgentActivityRuntimeProviderProps): JSX.Element {\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 resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n testAgentActivityRuntimeHolder.set(null);\n }\n}\n\nexport function setAgentActivityRuntimeForTests(\n runtime: AgentActivityRuntime | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n testAgentActivityRuntimeHolder.set(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 const testRuntimeOverride = testAgentActivityRuntimeHolder.get();\n if (testRuntimeOverride) {\n return testRuntimeOverride;\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 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 AgentHostListWorkspaceAgentProbesInput,\n AgentHostWorkspaceAgentProbesResult,\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;\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};\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 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}\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 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 sectionKey?: 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 getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;\n getState: (input: any) => AgentHostAsyncResult<any>;\n onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\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\nexport interface AgentHostRuntimeApi {\n account?: AgentHostAccountApi;\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 clipboard: hostApi.clipboard,\n debug: hostApi.debug,\n filesystem: hostApi.filesystem,\n meta: hostApi.meta,\n onHostEvent: hostApi.onHostEvent,\n persistence: hostApi.persistence,\n runtime: hostApi.runtime,\n toast: hostApi.toast,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n","import {\n agentGUIProviderIdentityDisplayName,\n resolveMigratedAgentGUIProviderIdentity\n} from \"../providerIdentityCatalog.ts\";\nimport { translate } from \"../i18n/index.ts\";\n\nexport function workspaceAgentProviderLabel(provider: string): string {\n const normalized = provider.trim().toLowerCase();\n const migratedIdentity = resolveMigratedAgentGUIProviderIdentity(normalized);\n if (migratedIdentity) {\n return agentGUIProviderIdentityDisplayName(migratedIdentity, translate);\n }\n return titleCase(provider);\n}\n\nfunction titleCase(value: string): string {\n return value\n .split(/[-_\\s]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\" \");\n}\n"],"mappings":"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","names":["createContext","useContext","jsx","createContext","useContext"]}
|
|
@@ -1,48 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
agentGuiWorkbenchDockIdentityFromIdentifier,
|
|
3
|
+
agentGuiWorkbenchTypeId,
|
|
4
|
+
agentGuiWorkbenchUnifiedDockEntryId,
|
|
5
|
+
createAgentGuiWorkbenchLaunchDescriptor
|
|
6
|
+
} from "./chunk-AY5AFMT2.js";
|
|
1
7
|
import {
|
|
2
8
|
resolveAgentGUIConversationBrowserFreeTitle,
|
|
3
9
|
resolveAgentGUIConversationTitleDisplayPrompt,
|
|
4
10
|
resolveAgentGuiWorkbenchHeaderTitle,
|
|
5
11
|
resolveAgentGuiWorkbenchSessionTitle
|
|
6
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BM3CSFWU.js";
|
|
7
13
|
import {
|
|
8
|
-
agentGuiWorkbenchProviderFromInstanceId,
|
|
9
|
-
agentGuiWorkbenchProviderFromInstanceIdOrNull,
|
|
10
14
|
createAgentGuiWorkbenchNodeStateSource,
|
|
11
15
|
migrateLegacyAgentGuiWorkbenchState,
|
|
12
16
|
normalizeAgentGuiWorkbenchNodeState,
|
|
13
17
|
normalizeAgentGuiWorkbenchState
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
agentGuiWorkbenchDockIdentityFromIdentifier,
|
|
17
|
-
agentGuiWorkbenchProviderFromIdentifier,
|
|
18
|
-
agentGuiWorkbenchTypeId,
|
|
19
|
-
agentGuiWorkbenchUnifiedDockEntryId,
|
|
20
|
-
createAgentGuiWorkbenchLaunchDescriptor
|
|
21
|
-
} from "./chunk-QY22OBJS.js";
|
|
18
|
+
} from "./chunk-JLRPIEIE.js";
|
|
22
19
|
import {
|
|
23
20
|
agentGuiWorkbenchDefaultDockProviders,
|
|
24
21
|
isAgentGuiWorkbenchProvider,
|
|
25
22
|
resolveAgentGuiWorkbenchProviderLabel
|
|
26
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-R2ZADXRB.js";
|
|
27
24
|
import {
|
|
28
25
|
normalizeAgentGUIAgents,
|
|
29
26
|
projectAgentGUIAgentsToInternalTargets
|
|
30
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7OYHDOGG.js";
|
|
31
28
|
import {
|
|
32
29
|
agentGuiDockIconUrls
|
|
33
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-L2GENUG3.js";
|
|
34
31
|
import {
|
|
35
32
|
useEngineSelector
|
|
36
33
|
} from "./chunk-2RQM7PJN.js";
|
|
37
34
|
import {
|
|
38
35
|
normalizeManagedAgentProvider
|
|
39
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-7KVZPJ3O.js";
|
|
40
37
|
import {
|
|
41
38
|
resolveAgentGUIProviderCatalogIdentity
|
|
42
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-6CUELYIF.js";
|
|
43
40
|
import {
|
|
44
41
|
resolveProviderIconAsset
|
|
45
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-YNSXUEIR.js";
|
|
46
43
|
|
|
47
44
|
// workbench/contribution.ts
|
|
48
45
|
import { createElement as createElement3 } from "react";
|
|
@@ -129,6 +126,17 @@ function resolveAgentGUIExpandedWindowFrame(input) {
|
|
|
129
126
|
};
|
|
130
127
|
}
|
|
131
128
|
|
|
129
|
+
// workbench/AgentGuiWorkbenchReactiveHeader.tsx
|
|
130
|
+
import { useMemo } from "react";
|
|
131
|
+
|
|
132
|
+
// workbench/conversationIdentity.ts
|
|
133
|
+
import {
|
|
134
|
+
isPendingActivationViable,
|
|
135
|
+
selectLatestActivationForSession,
|
|
136
|
+
selectSessionMessages,
|
|
137
|
+
selectWorkspaceAgentConsumerSession
|
|
138
|
+
} from "@tutti-os/agent-activity-core";
|
|
139
|
+
|
|
132
140
|
// agentGuiSessionProviderIconUrls.ts
|
|
133
141
|
function resolveAgentGuiSessionProviderIconUrl(provider) {
|
|
134
142
|
const identity = resolveAgentGUIProviderCatalogIdentity(
|
|
@@ -143,15 +151,7 @@ function resolveAgentGuiSessionProviderFlatIconUrl(provider) {
|
|
|
143
151
|
return resolveProviderIconAsset(identity?.iconKey, "sessionFlat");
|
|
144
152
|
}
|
|
145
153
|
|
|
146
|
-
// workbench/AgentGuiWorkbenchReactiveHeader.tsx
|
|
147
|
-
import { useMemo } from "react";
|
|
148
|
-
|
|
149
154
|
// workbench/conversationIdentity.ts
|
|
150
|
-
import {
|
|
151
|
-
selectLatestActivationForSession,
|
|
152
|
-
selectSessionMessages,
|
|
153
|
-
selectWorkspaceAgentConsumerSession
|
|
154
|
-
} from "@tutti-os/agent-activity-core";
|
|
155
155
|
function resolveAgentGuiWorkbenchConversationIdentity(input) {
|
|
156
156
|
const agentSessionId = input.workbenchState?.lastActiveAgentSessionId?.trim() ?? "";
|
|
157
157
|
if (!agentSessionId) {
|
|
@@ -165,7 +165,7 @@ function resolveAgentGuiWorkbenchConversationIdentity(input) {
|
|
|
165
165
|
input.engineState,
|
|
166
166
|
agentSessionId
|
|
167
167
|
);
|
|
168
|
-
const optimisticTitle = activation?.mode === "new" && activation
|
|
168
|
+
const optimisticTitle = activation?.mode === "new" && isPendingActivationViable(activation) ? activation.optimisticTitle : null;
|
|
169
169
|
const agentTargetId = session?.agentTargetId ?? input.workbenchState?.agentTargetId ?? null;
|
|
170
170
|
const agent = agentTargetId ? input.agents.find(
|
|
171
171
|
(candidate) => candidate.agentTargetId === agentTargetId
|
|
@@ -230,7 +230,7 @@ import {
|
|
|
230
230
|
import { CreateChatIcon } from "@tutti-os/ui-system/icons";
|
|
231
231
|
|
|
232
232
|
// app/renderer/assets/icons/open-link-lined.svg
|
|
233
|
-
var open_link_lined_default = "
|
|
233
|
+
var open_link_lined_default = 'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">%0A <path d="M14 3H21V10M20 4L10 14" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>%0A <path d="M19 13V19C19 20.1046 18.1046 21 17 21H5C3.89543 21 3 20.1046 3 19V7C3 5.89543 3.89543 5 5 5H11" stroke="black" stroke-width="2" stroke-linecap="round"/>%0A</svg>%0A';
|
|
234
234
|
|
|
235
235
|
// workbench/bodyRenderErrorRegistry.ts
|
|
236
236
|
import { useSyncExternalStore } from "react";
|
|
@@ -276,7 +276,7 @@ function useAgentGuiWorkbenchBodyRenderError(nodeId) {
|
|
|
276
276
|
|
|
277
277
|
// workbench/header.ts
|
|
278
278
|
var LazyAgentRichTextReadonly = lazy(
|
|
279
|
-
() => import("./AgentRichTextReadonly-
|
|
279
|
+
() => import("./AgentRichTextReadonly-42TUVYX5.js").then((module) => ({
|
|
280
280
|
default: module.AgentRichTextReadonly
|
|
281
281
|
}))
|
|
282
282
|
);
|
|
@@ -317,7 +317,7 @@ function AgentGuiWorkbenchHeader({
|
|
|
317
317
|
const appTitle = _title?.trim() || copy.fallbackAgentLabel;
|
|
318
318
|
const sessionTitle = hasBodyRenderError ? "" : conversationTitle?.trim() || (hasConversation ? copy.untitledConversation?.trim() : "") || "";
|
|
319
319
|
const sessionTitleDisplayPrompt = hasBodyRenderError ? "" : conversationTitleDisplayPrompt?.trim() || "";
|
|
320
|
-
const collapsedTitle = agentTitle?.trim() ||
|
|
320
|
+
const collapsedTitle = sessionTitle || agentTitle?.trim() || "";
|
|
321
321
|
const sessionIconUrl = conversationIconUrl?.trim() || "";
|
|
322
322
|
const sessionIconFallbackUrl = conversationIconFallbackUrl?.trim() || "";
|
|
323
323
|
const hasExpandedIdentity = Boolean(
|
|
@@ -946,13 +946,6 @@ function providerFromState(state) {
|
|
|
946
946
|
const provider = state.provider;
|
|
947
947
|
return isAgentGuiWorkbenchProvider(provider) ? provider : null;
|
|
948
948
|
}
|
|
949
|
-
function providerFromActivation(activation) {
|
|
950
|
-
if (!activation || typeof activation !== "object") {
|
|
951
|
-
return null;
|
|
952
|
-
}
|
|
953
|
-
const payload = activation.payload;
|
|
954
|
-
return providerFromState(payload);
|
|
955
|
-
}
|
|
956
949
|
function resolveAgentGuiWorkbenchLaunchPayload(request, input) {
|
|
957
950
|
if (hasAgentSessionId(request.payload)) {
|
|
958
951
|
return request.payload;
|
|
@@ -1074,8 +1067,10 @@ function createAgentGuiWorkbenchPreviewContent(input) {
|
|
|
1074
1067
|
const { externalNodeState, node } = input.item;
|
|
1075
1068
|
const state = normalizeAgentGuiWorkbenchState(externalNodeState);
|
|
1076
1069
|
const title = input.resolveDockPopupIdentity?.(state)?.title ?? input.resolveDockPopupTitle?.(state) ?? node.title;
|
|
1077
|
-
const
|
|
1078
|
-
const
|
|
1070
|
+
const agentTargetId = state.agentTargetId?.trim() ?? "";
|
|
1071
|
+
const agent = input.agentDirectory.getSnapshot().agents.find((candidate) => candidate.agentTargetId === agentTargetId);
|
|
1072
|
+
const provider = input.provider ?? agent?.provider ?? null;
|
|
1073
|
+
const label = input.label ?? agent?.name ?? (provider ? resolveAgentGuiWorkbenchProviderLabel(provider) : node.title);
|
|
1079
1074
|
const lines = [label, state.lastActiveAgentSessionId].filter(
|
|
1080
1075
|
(line) => Boolean(line?.trim())
|
|
1081
1076
|
);
|
|
@@ -1086,11 +1081,13 @@ function createAgentGuiWorkbenchPreviewContent(input) {
|
|
|
1086
1081
|
agentDirectory: input.agentDirectory,
|
|
1087
1082
|
nodeTypeId: agentGuiWorkbenchTypeId,
|
|
1088
1083
|
onStateChange: () => void 0,
|
|
1084
|
+
agentTargetId: agentTargetId || null,
|
|
1089
1085
|
provider
|
|
1090
1086
|
}
|
|
1091
1087
|
),
|
|
1092
1088
|
kind: "component",
|
|
1093
|
-
revision: `${
|
|
1089
|
+
revision: `${agentTargetId}
|
|
1090
|
+
${provider ?? ""}
|
|
1094
1091
|
${title}
|
|
1095
1092
|
${lines.join("\n")}`
|
|
1096
1093
|
};
|
|
@@ -1145,24 +1142,37 @@ function createAgentGuiWorkbenchContribution(input) {
|
|
|
1145
1142
|
onBodyRenderErrorChange: ({ hasError, node }) => {
|
|
1146
1143
|
setAgentGuiWorkbenchBodyRenderError(node.id, hasError);
|
|
1147
1144
|
},
|
|
1148
|
-
renderBody: (context) =>
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1145
|
+
renderBody: (context) => {
|
|
1146
|
+
const persistedState = normalizeAgentGuiWorkbenchState(
|
|
1147
|
+
context.externalNodeState ?? context.node?.data.snapshotNodeState
|
|
1148
|
+
);
|
|
1149
|
+
const activationAgentTargetId = agentTargetIdFromActivation(
|
|
1150
|
+
context.activation
|
|
1151
|
+
);
|
|
1152
|
+
const state = activationAgentTargetId && !persistedState.agentTargetId ? { ...persistedState, agentTargetId: activationAgentTargetId } : persistedState;
|
|
1153
|
+
const agent = resolveAgentGuiWorkbenchStateAgent(
|
|
1154
|
+
state,
|
|
1155
|
+
input.agentDirectory
|
|
1156
|
+
);
|
|
1157
|
+
return input.renderBody(
|
|
1158
|
+
context,
|
|
1159
|
+
{
|
|
1160
|
+
agentDirectory: input.agentDirectory,
|
|
1161
|
+
agentTargetId: state.agentTargetId ?? null,
|
|
1162
|
+
nodeTypeId: agentGuiWorkbenchTypeId,
|
|
1163
|
+
onStateChange: (nextState) => {
|
|
1164
|
+
nodeStateSource.writeNodeState({
|
|
1165
|
+
instanceId: context.instanceId,
|
|
1166
|
+
nodeId: context.node.id,
|
|
1167
|
+
state: nextState,
|
|
1168
|
+
typeId: agentGuiWorkbenchTypeId
|
|
1169
|
+
});
|
|
1170
|
+
},
|
|
1171
|
+
provider: agent?.provider ?? null
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
},
|
|
1164
1175
|
renderHeader: ({
|
|
1165
|
-
activation,
|
|
1166
1176
|
dragHandleProps,
|
|
1167
1177
|
displayMode,
|
|
1168
1178
|
externalNodeState,
|
|
@@ -1172,13 +1182,17 @@ function createAgentGuiWorkbenchContribution(input) {
|
|
|
1172
1182
|
surfaceSize,
|
|
1173
1183
|
windowActions
|
|
1174
1184
|
}) => {
|
|
1175
|
-
const provider = providerFromActivation(activation) ?? agentGuiWorkbenchProviderFromInstanceId(instanceId);
|
|
1176
1185
|
const headerTitle = copy.nodeTitle;
|
|
1177
1186
|
const rawWorkbenchState = externalNodeState ?? node.data.runtimeNodeState;
|
|
1178
1187
|
const migratedWorkbenchState = migrateLegacyAgentGuiWorkbenchState(rawWorkbenchState);
|
|
1179
1188
|
const workbenchState = normalizeAgentGuiWorkbenchState(
|
|
1180
1189
|
migratedWorkbenchState
|
|
1181
1190
|
);
|
|
1191
|
+
const selectedAgent = resolveAgentGuiWorkbenchStateAgent(
|
|
1192
|
+
workbenchState,
|
|
1193
|
+
input.agentDirectory
|
|
1194
|
+
);
|
|
1195
|
+
const provider = selectedAgent?.provider ?? "unknown";
|
|
1182
1196
|
const nodeState = normalizeAgentGuiWorkbenchNodeState(
|
|
1183
1197
|
migratedWorkbenchState,
|
|
1184
1198
|
provider
|
|
@@ -1191,14 +1205,10 @@ function createAgentGuiWorkbenchContribution(input) {
|
|
|
1191
1205
|
);
|
|
1192
1206
|
const conversationIdentity = input.sessionEngine ? null : input.resolveDockPopupIdentity?.(workbenchState) ?? null;
|
|
1193
1207
|
const conversationTitle = input.sessionEngine ? null : conversationIdentity?.title ?? input.resolveDockPopupTitle?.(workbenchState) ?? null;
|
|
1194
|
-
const iconProvider = providerFromActivation(activation) ?? agentGuiWorkbenchProviderFromInstanceIdOrNull(instanceId);
|
|
1195
1208
|
const hasConversation = Boolean(
|
|
1196
1209
|
workbenchState.lastActiveAgentSessionId?.trim()
|
|
1197
1210
|
);
|
|
1198
|
-
const conversationIconFallbackUrl = hasConversation &&
|
|
1199
|
-
dockIconUrls: input.dockIconUrls,
|
|
1200
|
-
provider: iconProvider
|
|
1201
|
-
}) : null;
|
|
1211
|
+
const conversationIconFallbackUrl = hasConversation && selectedAgent ? selectedAgent.iconUrl : null;
|
|
1202
1212
|
const conversationIconUrl = conversationIdentity?.iconUrl ?? conversationIconFallbackUrl;
|
|
1203
1213
|
const persistConversationRailCollapsed = (collapsed) => {
|
|
1204
1214
|
nodeStateSource.writeNodeState({
|
|
@@ -1253,14 +1263,14 @@ function createAgentGuiWorkbenchContribution(input) {
|
|
|
1253
1263
|
},
|
|
1254
1264
|
...dragHandleProps,
|
|
1255
1265
|
onCreateConversation: announceNewConversation,
|
|
1256
|
-
onOpenDetachedWindow: input.onOpenDetachedWindow ? () => {
|
|
1266
|
+
onOpenDetachedWindow: input.onOpenDetachedWindow ? selectedAgent ? () => {
|
|
1257
1267
|
void input.onOpenDetachedWindow?.({
|
|
1258
1268
|
agentSessionId: workbenchState.lastActiveAgentSessionId,
|
|
1259
|
-
agentTargetId:
|
|
1260
|
-
provider,
|
|
1269
|
+
agentTargetId: selectedAgent.agentTargetId,
|
|
1270
|
+
provider: selectedAgent.provider,
|
|
1261
1271
|
workspaceId: input.workspaceId
|
|
1262
1272
|
});
|
|
1263
|
-
} : void 0,
|
|
1273
|
+
} : void 0 : void 0,
|
|
1264
1274
|
onPointerDown: (event) => {
|
|
1265
1275
|
dragHandleProps.onPointerDown?.(event);
|
|
1266
1276
|
if (!isFocused) {
|
|
@@ -1347,20 +1357,21 @@ function createAgentGuiWorkbenchContribution(input) {
|
|
|
1347
1357
|
instanceId: descriptorInstanceId,
|
|
1348
1358
|
openInNewWindow,
|
|
1349
1359
|
provider,
|
|
1350
|
-
|
|
1351
|
-
reuseExistingSessionNode,
|
|
1360
|
+
reusePolicy,
|
|
1352
1361
|
targetAgentSessionId
|
|
1353
1362
|
} = createAgentGuiWorkbenchLaunchDescriptor({
|
|
1354
1363
|
...request,
|
|
1355
1364
|
payload: launchPayload
|
|
1356
1365
|
});
|
|
1357
|
-
const existingInstanceId = targetAgentSessionId && reuseExistingSessionNode ? nodeStateSource.findInstanceIdByAgentSessionId(targetAgentSessionId) : null;
|
|
1358
|
-
const instanceId = existingInstanceId ?? descriptorInstanceId;
|
|
1359
|
-
const title = copy.nodeTitle;
|
|
1360
1366
|
const providerTarget = providerTargetLaunchPayloadFromRequest(
|
|
1361
1367
|
launchPayload,
|
|
1362
1368
|
provider
|
|
1363
1369
|
);
|
|
1370
|
+
const existingInstanceId = reusePolicy.kind === "current-session" ? nodeStateSource.findInstanceIdByAgentSessionId(
|
|
1371
|
+
reusePolicy.agentSessionId
|
|
1372
|
+
) : null;
|
|
1373
|
+
const instanceId = existingInstanceId ?? descriptorInstanceId;
|
|
1374
|
+
const title = copy.nodeTitle;
|
|
1364
1375
|
const launchAgentTargetId = providerTarget.agentTargetId;
|
|
1365
1376
|
if (targetAgentSessionId) {
|
|
1366
1377
|
const previousState = nodeStateSource.readNodeState({
|
|
@@ -1406,13 +1417,31 @@ function createAgentGuiWorkbenchContribution(input) {
|
|
|
1406
1417
|
// (e.g. clicking a completion notification) should just focus it,
|
|
1407
1418
|
// not reset it back to the default size/position.
|
|
1408
1419
|
preserveExistingNodeFrame: existingInstanceId !== null,
|
|
1409
|
-
reuseDockEntryNode,
|
|
1420
|
+
reuseDockEntryNode: reusePolicy.kind === "dock-entry",
|
|
1410
1421
|
title,
|
|
1411
1422
|
typeId: agentGuiWorkbenchTypeId
|
|
1412
1423
|
};
|
|
1413
1424
|
}
|
|
1414
1425
|
};
|
|
1415
1426
|
}
|
|
1427
|
+
function resolveAgentGuiWorkbenchStateAgent(state, directory) {
|
|
1428
|
+
const agentTargetId = state?.agentTargetId?.trim();
|
|
1429
|
+
if (!agentTargetId) {
|
|
1430
|
+
return null;
|
|
1431
|
+
}
|
|
1432
|
+
return directory.getSnapshot().agents.find((agent) => agent.agentTargetId === agentTargetId) ?? null;
|
|
1433
|
+
}
|
|
1434
|
+
function agentTargetIdFromActivation(activation) {
|
|
1435
|
+
if (!activation || typeof activation !== "object") {
|
|
1436
|
+
return null;
|
|
1437
|
+
}
|
|
1438
|
+
const payload = activation.payload;
|
|
1439
|
+
if (!payload || typeof payload !== "object") {
|
|
1440
|
+
return null;
|
|
1441
|
+
}
|
|
1442
|
+
const agentTargetId = payload.agentTargetId;
|
|
1443
|
+
return typeof agentTargetId === "string" && agentTargetId.trim() ? agentTargetId.trim() : null;
|
|
1444
|
+
}
|
|
1416
1445
|
function hasAgentSessionId2(payload) {
|
|
1417
1446
|
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
1418
1447
|
return false;
|
|
@@ -1451,4 +1480,4 @@ export {
|
|
|
1451
1480
|
AGENT_GUI_WORKBENCH_OPEN_EXTERNAL_IMPORT_EVENT,
|
|
1452
1481
|
createAgentGuiWorkbenchContribution
|
|
1453
1482
|
};
|
|
1454
|
-
//# sourceMappingURL=chunk-
|
|
1483
|
+
//# sourceMappingURL=chunk-EBXOSQ5G.js.map
|