@tutti-os/agent-gui 0.0.67 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +8 -8
- package/dist/agent-env/index.js +2 -1
- package/dist/agent-env/index.js.map +1 -1
- package/dist/agent-message-center/index.js +10 -10
- package/dist/{agentGuiNodeTypes-DNXndXhV.d.ts → agentGuiNodeTypes-BipgG2ib.d.ts} +9 -1
- package/dist/app/renderer/agentactivity.css +107 -9
- package/dist/app/renderer/assets/icons/agents/opencode-flat-filled.svg +4 -0
- package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
- package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
- package/dist/{chunk-OEJQJP65.js → chunk-4I2VCAMW.js} +14 -1
- package/dist/chunk-4I2VCAMW.js.map +1 -0
- package/dist/{chunk-IL2ORY23.js → chunk-4US2YHBY.js} +3 -1
- package/dist/chunk-4US2YHBY.js.map +1 -0
- package/dist/{chunk-JGU2VMDA.js → chunk-547R2HOD.js} +3 -3
- package/dist/{chunk-PFKY5W76.js → chunk-6XRTDIDR.js} +13 -28
- package/dist/chunk-6XRTDIDR.js.map +1 -0
- package/dist/{chunk-NCAVJEHI.js → chunk-ATEZXUHK.js} +1 -1
- package/dist/chunk-ATEZXUHK.js.map +1 -0
- package/dist/{chunk-RNFP7CUO.js → chunk-BHNJN2TR.js} +5 -2
- package/dist/chunk-BHNJN2TR.js.map +1 -0
- package/dist/{chunk-CTYXJGSW.js → chunk-DAPKF2SN.js} +3 -3
- package/dist/{chunk-XBR7D7X2.js → chunk-EHLJL76A.js} +2 -2
- package/dist/{chunk-YYAP6IK7.js → chunk-ERBUQOIL.js} +3 -3
- package/dist/{chunk-UAXKJNM2.js → chunk-FRAG4UFU.js} +74 -24
- package/dist/chunk-FRAG4UFU.js.map +1 -0
- package/dist/{chunk-YU3XLPLC.js → chunk-HAKNLXW7.js} +2 -2
- package/dist/{chunk-QZYGCZNQ.js → chunk-JA6Z3QA7.js} +4 -4
- package/dist/{chunk-MA254MXR.js → chunk-KAPBUKIT.js} +33 -15
- package/dist/chunk-KAPBUKIT.js.map +1 -0
- package/dist/{chunk-JWWHS34V.js → chunk-KTIHLBCN.js} +12 -3
- package/dist/chunk-KTIHLBCN.js.map +1 -0
- package/dist/{chunk-ZABN3POD.js → chunk-KTIKZNGS.js} +6 -2
- package/dist/chunk-KTIKZNGS.js.map +1 -0
- package/dist/{chunk-SKWDZTEV.js → chunk-N37A62BK.js} +21 -1
- package/dist/chunk-N37A62BK.js.map +1 -0
- package/dist/{chunk-KS4ULVGM.js → chunk-NH3XBJTZ.js} +2 -2
- package/dist/{chunk-DQTBWOIK.js → chunk-NROZAN34.js} +16 -4
- package/dist/chunk-NROZAN34.js.map +1 -0
- package/dist/{chunk-VIJQ5C33.js → chunk-S32FLJRP.js} +5 -5
- package/dist/{chunk-DP2X4J2D.js → chunk-UAAXRSW2.js} +3 -3
- package/dist/{chunk-BX4UBTOI.js → chunk-ZZBLWZJR.js} +12 -6
- package/dist/chunk-ZZBLWZJR.js.map +1 -0
- package/dist/context-mention-palette/index.js +9 -9
- package/dist/i18n/index.d.ts +32 -14
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +22 -6
- package/dist/index.js +1895 -998
- package/dist/index.js.map +1 -1
- package/dist/opencode-flat-filled-CYAJPX45.svg +4 -0
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/{types-BxOwnK7K.d.ts → types-DZ79b8Zn.d.ts} +8 -3
- package/dist/workbench/contribution.d.ts +1 -1
- package/dist/workbench/contribution.js +8 -8
- package/dist/workbench/index.d.ts +3 -2
- package/dist/workbench/index.js +11 -11
- package/dist/workbench/launch.d.ts +1 -1
- package/dist/workbench/launch.js +3 -3
- package/dist/workbench/providerCatalog.d.ts +3 -3
- package/dist/workbench/providerCatalog.js +1 -1
- package/dist/workbench/sessionTitle.d.ts +1 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +11 -2
- package/dist/workbench/state.js +5 -3
- package/dist/workbench/types.d.ts +2 -2
- package/dist/workbench/types.js +1 -1
- package/dist/workspace-agent-generated-files.js +4 -4
- package/package.json +12 -12
- package/dist/chunk-BX4UBTOI.js.map +0 -1
- package/dist/chunk-DQTBWOIK.js.map +0 -1
- package/dist/chunk-IL2ORY23.js.map +0 -1
- package/dist/chunk-JWWHS34V.js.map +0 -1
- package/dist/chunk-MA254MXR.js.map +0 -1
- package/dist/chunk-NCAVJEHI.js.map +0 -1
- package/dist/chunk-OEJQJP65.js.map +0 -1
- package/dist/chunk-PFKY5W76.js.map +0 -1
- package/dist/chunk-RNFP7CUO.js.map +0 -1
- package/dist/chunk-SKWDZTEV.js.map +0 -1
- package/dist/chunk-UAXKJNM2.js.map +0 -1
- package/dist/chunk-ZABN3POD.js.map +0 -1
- /package/dist/{chunk-JGU2VMDA.js.map → chunk-547R2HOD.js.map} +0 -0
- /package/dist/{chunk-CTYXJGSW.js.map → chunk-DAPKF2SN.js.map} +0 -0
- /package/dist/{chunk-XBR7D7X2.js.map → chunk-EHLJL76A.js.map} +0 -0
- /package/dist/{chunk-YYAP6IK7.js.map → chunk-ERBUQOIL.js.map} +0 -0
- /package/dist/{chunk-YU3XLPLC.js.map → chunk-HAKNLXW7.js.map} +0 -0
- /package/dist/{chunk-QZYGCZNQ.js.map → chunk-JA6Z3QA7.js.map} +0 -0
- /package/dist/{chunk-KS4ULVGM.js.map → chunk-NH3XBJTZ.js.map} +0 -0
- /package/dist/{chunk-VIJQ5C33.js.map → chunk-S32FLJRP.js.map} +0 -0
- /package/dist/{chunk-DP2X4J2D.js.map → chunk-UAAXRSW2.js.map} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3.41382 0.991348C3.8204 1.02608 4.73175 1.00009 5.1687 1.00014H8.70679L20.2244 1.00209L20.2205 22.9904L9.71069 22.9757H5.87476C5.06579 22.9757 4.22438 22.9637 3.4187 22.9913C3.38439 22.0528 3.40898 20.9887 3.40894 20.0402V14.632L3.41382 0.991348ZM7.29272 4.87807C7.28438 6.53493 7.27638 8.21526 7.29272 9.87123L7.29663 19.0988C8.53026 19.1177 9.7903 19.1055 11.0261 19.1056L16.3337 19.0997L16.3347 14.004C16.3345 12.4565 16.3505 10.8828 16.3337 9.33803C16.3388 7.86364 16.3492 6.34738 16.3337 4.87416L7.29272 4.87807Z" fill="black"/>
|
|
3
|
+
<rect opacity="0.3" x="7.28322" y="10.0502" width="9.05882" height="9.05882" fill="black"/>
|
|
4
|
+
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as AgentGUIQueuedPromptVM } from './agentGuiNodeTypes-
|
|
1
|
+
import { d as AgentGUIQueuedPromptVM } from './agentGuiNodeTypes-BipgG2ib.js';
|
|
2
2
|
import '@tutti-os/agent-activity-core';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-DZ79b8Zn.js';
|
|
4
4
|
import './workspaceAgentActivityListViewModel-DJvAqZso.js';
|
|
5
5
|
import './agentConversationVM-DPAgUJlR.js';
|
|
6
6
|
import '@tutti-os/workspace-user-project/contracts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AgentHostAgentSessionProvider = "claude-code" | "codex" | "tutti-agent" | "cursor" | "nexight" | "gemini" | "hermes" | "openclaw";
|
|
1
|
+
type AgentHostAgentSessionProvider = "claude-code" | "codex" | "tutti-agent" | "cursor" | "nexight" | "gemini" | "hermes" | "opencode" | "openclaw";
|
|
2
2
|
type AgentHostAgentSessionPermissionModeSemantic = "ask-before-write" | "accept-edits" | "locked-down" | "auto" | "full-access" | "unconfigurable";
|
|
3
3
|
type AgentHostAgentSessionReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | string;
|
|
4
4
|
type AgentHostAgentSessionSpeed = "standard" | "fast" | string;
|
|
@@ -147,12 +147,16 @@ interface AgentGUINodeData {
|
|
|
147
147
|
composerOverridesByAgentTargetId?: Record<string, AgentHostAgentSessionComposerSettings | null> | null;
|
|
148
148
|
composerOverridesByProvider?: Partial<Record<AgentGUIProvider, AgentHostAgentSessionComposerSettings | null>> | null;
|
|
149
149
|
}
|
|
150
|
-
type AgentGUIProvider = Extract<AgentProvider, "claude-code" | "codex" | "tutti-agent" | "cursor" | "nexight" | "gemini" | "hermes" | "openclaw">;
|
|
150
|
+
type AgentGUIProvider = Extract<AgentProvider, "claude-code" | "codex" | "tutti-agent" | "cursor" | "nexight" | "gemini" | "hermes" | "openclaw" | "opencode">;
|
|
151
151
|
interface AgentGUIProviderTargetRef {
|
|
152
152
|
kind: string;
|
|
153
153
|
provider: AgentGUIProvider;
|
|
154
154
|
[key: string]: unknown;
|
|
155
155
|
}
|
|
156
|
+
interface AgentGUIProviderTargetBadge {
|
|
157
|
+
iconUrl: string;
|
|
158
|
+
label?: string;
|
|
159
|
+
}
|
|
156
160
|
interface AgentGUIProviderTarget {
|
|
157
161
|
targetId: string;
|
|
158
162
|
agentTargetId?: string | null;
|
|
@@ -161,6 +165,7 @@ interface AgentGUIProviderTarget {
|
|
|
161
165
|
label: string;
|
|
162
166
|
description?: string;
|
|
163
167
|
iconUrl?: string | null;
|
|
168
|
+
badge?: AgentGUIProviderTargetBadge | null;
|
|
164
169
|
ownerLabel?: string;
|
|
165
170
|
disabled?: boolean;
|
|
166
171
|
unavailableReason?: string;
|
|
@@ -198,4 +203,4 @@ interface NodeFrame {
|
|
|
198
203
|
size: Size;
|
|
199
204
|
}
|
|
200
205
|
|
|
201
|
-
export type { AgentGUINodeData as A, NodeFrame as N, Point as P, AgentGUIProvider as a, AgentGUIProviderRailMode as b, AgentGUIProviderReadinessGate as c, AgentGUIProviderReadinessGateAction as d, AgentGUIProviderReadinessGateStatus as e, AgentGUIProviderTarget as f,
|
|
206
|
+
export type { AgentGUINodeData as A, NodeFrame as N, Point as P, AgentGUIProvider as a, AgentGUIProviderRailMode as b, AgentGUIProviderReadinessGate as c, AgentGUIProviderReadinessGateAction as d, AgentGUIProviderReadinessGateStatus as e, AgentGUIProviderTarget as f, AgentGUIProviderTargetBadge as g, AgentGUIProviderTargetRef as h, AgentHostActivateAgentSessionResult as i, AgentHostAgentSessionCommand as j, AgentHostAgentSessionComposerSettings as k, AgentHostAgentSessionPermissionConfig as l, AgentHostAgentSessionReasoningEffort as m, AgentHostAgentSessionSpeed as n, AgentHostAgentSessionState as o, AgentHostUnactivateAgentSessionResult as p, AgentHostUpdateAgentSessionSettingsResult as q, AgentPromptContentBlock as r, AgentProvider as s };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { WorkbenchFrame, WorkbenchHostNodeBodyContext, WorkbenchHostLaunchRequest, WorkbenchHostDockEntry, WorkbenchContribution } from '@tutti-os/workbench-surface';
|
|
3
3
|
import { AgentGuiWorkbenchProvider, AgentGuiWorkbenchState } from './types.js';
|
|
4
|
-
import { f as AgentGUIProviderTarget,
|
|
4
|
+
import { f as AgentGUIProviderTarget, h as AgentGUIProviderTargetRef } from '../types-DZ79b8Zn.js';
|
|
5
5
|
|
|
6
6
|
declare const agentGuiWorkbenchDefaultNodeFrame: WorkbenchFrame;
|
|
7
7
|
declare const agentGuiWorkbenchDefaultUsableWidthRatio = 0.8;
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
resolveAgentGuiUnifiedDockLaunchPayload,
|
|
14
14
|
resolveAgentGuiWorkbenchContributionCopy,
|
|
15
15
|
resolveAgentGuiWorkbenchDefaultLaunchFrame
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-FRAG4UFU.js";
|
|
17
|
+
import "../chunk-KTIHLBCN.js";
|
|
18
|
+
import "../chunk-UAAXRSW2.js";
|
|
19
|
+
import "../chunk-ATEZXUHK.js";
|
|
20
|
+
import "../chunk-BHNJN2TR.js";
|
|
21
|
+
import "../chunk-NROZAN34.js";
|
|
22
|
+
import "../chunk-N37A62BK.js";
|
|
23
|
+
import "../chunk-4I2VCAMW.js";
|
|
24
24
|
export {
|
|
25
25
|
AGENT_GUI_WORKBENCH_CONVERSATION_RAIL_TOGGLE_EVENT,
|
|
26
26
|
AGENT_GUI_WORKBENCH_NEW_CONVERSATION_EVENT,
|
|
@@ -6,7 +6,7 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
6
6
|
import { WorkbenchDisplayMode, WorkbenchHostNodeHeaderWindowActions } from '@tutti-os/workbench-surface';
|
|
7
7
|
export { AgentGuiSessionTitleFormatOptions, AgentGuiWorkbenchSessionTitleResult, ResolveAgentGuiWorkbenchSessionTitleInput, formatAgentGuiConversationPlainTitle, formatAgentGuiSessionPlainTitle, resolveAgentGuiWorkbenchSessionTitle } from './sessionTitle.js';
|
|
8
8
|
export { AgentGuiWorkbenchComposerOverrides, AgentGuiWorkbenchNodeState, AgentGuiWorkbenchPrefillPromptPayload, AgentGuiWorkbenchProvider, AgentGuiWorkbenchState, AgentGuiWorkbenchWorkspaceState, agentGuiWorkbenchOpenSessionActivationType, agentGuiWorkbenchPrefillPromptActivationType } from './types.js';
|
|
9
|
-
import '../types-
|
|
9
|
+
import '../types-DZ79b8Zn.js';
|
|
10
10
|
import '@tutti-os/agent-activity-core';
|
|
11
11
|
import '../uiSettings-BQS9r2eo.js';
|
|
12
12
|
|
|
@@ -28,6 +28,7 @@ interface AgentGuiWorkbenchHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
|
28
28
|
isConversationRailCollapsed: boolean;
|
|
29
29
|
conversationRailWidthPx?: number | null;
|
|
30
30
|
conversationIconUrl?: string | null;
|
|
31
|
+
conversationIconFallbackUrl?: string | null;
|
|
31
32
|
providerRailWidthPx?: number | null;
|
|
32
33
|
conversationTitle?: string | null;
|
|
33
34
|
nodeId: string;
|
|
@@ -36,6 +37,6 @@ interface AgentGuiWorkbenchHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
|
36
37
|
title?: string;
|
|
37
38
|
windowActions?: Pick<WorkbenchHostNodeHeaderWindowActions, "close" | "minimize" | "toggleDisplayMode">;
|
|
38
39
|
}
|
|
39
|
-
declare function AgentGuiWorkbenchHeader({ className, copy, defaultActions: _defaultActions, displayMode, isConversationRailAutoCollapsed, isConversationRailCollapsed, conversationRailWidthPx, conversationIconUrl, providerRailWidthPx, conversationTitle, nodeId, onCreateConversation, onToggleConversationRail, title: _title, windowActions, ...headerProps }: AgentGuiWorkbenchHeaderProps): ReactNode;
|
|
40
|
+
declare function AgentGuiWorkbenchHeader({ className, copy, defaultActions: _defaultActions, displayMode, isConversationRailAutoCollapsed, isConversationRailCollapsed, conversationRailWidthPx, conversationIconUrl, conversationIconFallbackUrl, providerRailWidthPx, conversationTitle, nodeId, onCreateConversation, onToggleConversationRail, title: _title, windowActions, ...headerProps }: AgentGuiWorkbenchHeaderProps): ReactNode;
|
|
40
41
|
|
|
41
42
|
export { AgentGuiWorkbenchHeader, type AgentGuiWorkbenchHeaderCopy, type AgentGuiWorkbenchHeaderProps };
|
package/dist/workbench/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createAgentGuiWorkbenchContribution,
|
|
9
9
|
resolveAgentGuiUnifiedDockLaunchPayload,
|
|
10
10
|
resolveAgentGuiWorkbenchContributionCopy
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-FRAG4UFU.js";
|
|
12
12
|
import {
|
|
13
13
|
agentGuiWorkbenchProviderFromInstanceId,
|
|
14
14
|
areAgentGuiWorkbenchNodeStatesEqual,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
normalizeAgentGuiWorkbenchNodeState,
|
|
19
19
|
normalizeAgentGuiWorkbenchState,
|
|
20
20
|
projectAgentGuiWorkbenchState
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-KTIHLBCN.js";
|
|
22
22
|
import {
|
|
23
23
|
agentGuiWorkbenchDockEntryId,
|
|
24
24
|
agentGuiWorkbenchDockIdentityFromIdentifier,
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
createAgentGuiWorkbenchInstanceId,
|
|
32
32
|
createAgentGuiWorkbenchLaunchDescriptor,
|
|
33
33
|
createAgentGuiWorkbenchSessionLaunchRequest
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-UAAXRSW2.js";
|
|
35
35
|
import {
|
|
36
36
|
agentGuiWorkbenchOpenSessionActivationType,
|
|
37
37
|
agentGuiWorkbenchPrefillPromptActivationType
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-ATEZXUHK.js";
|
|
39
39
|
import {
|
|
40
40
|
agentGuiWorkbenchComingSoonProviders,
|
|
41
41
|
agentGuiWorkbenchDefaultDockProviders,
|
|
@@ -48,17 +48,17 @@ import {
|
|
|
48
48
|
isAgentGuiWorkbenchProvider,
|
|
49
49
|
normalizeAgentGuiWorkbenchProvider,
|
|
50
50
|
resolveAgentGuiWorkbenchProviderLabel
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import "../chunk-
|
|
53
|
-
import "../chunk-
|
|
51
|
+
} from "../chunk-BHNJN2TR.js";
|
|
52
|
+
import "../chunk-NROZAN34.js";
|
|
53
|
+
import "../chunk-N37A62BK.js";
|
|
54
54
|
import {
|
|
55
55
|
formatAgentGuiConversationPlainTitle,
|
|
56
56
|
formatAgentGuiSessionPlainTitle,
|
|
57
57
|
resolveAgentGuiWorkbenchSessionTitle
|
|
58
|
-
} from "../chunk-
|
|
59
|
-
import "../chunk-
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-
|
|
58
|
+
} from "../chunk-EHLJL76A.js";
|
|
59
|
+
import "../chunk-KTIKZNGS.js";
|
|
60
|
+
import "../chunk-4I2VCAMW.js";
|
|
61
|
+
import "../chunk-KAPBUKIT.js";
|
|
62
62
|
import "../chunk-GCBDIQDX.js";
|
|
63
63
|
export {
|
|
64
64
|
AGENT_GUI_WORKBENCH_CONVERSATION_RAIL_TOGGLE_EVENT,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkbenchHostLaunchRequest } from '@tutti-os/workbench-surface';
|
|
2
2
|
import { agentGuiWorkbenchOpenSessionActivationType, AgentGuiWorkbenchPrefillPromptPayload, agentGuiWorkbenchPrefillPromptActivationType, AgentGuiWorkbenchProvider } from './types.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-DZ79b8Zn.js';
|
|
4
4
|
|
|
5
5
|
type AgentGuiWorkbenchLaunchRequestInput = Pick<WorkbenchHostLaunchRequest, "payload" | "typeId"> & {
|
|
6
6
|
dockEntryId?: string | null;
|
package/dist/workbench/launch.js
CHANGED
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
createAgentGuiWorkbenchSessionLaunchRequest,
|
|
13
13
|
resolveAgentGuiWorkbenchLaunchDockEntryId,
|
|
14
14
|
shouldReuseAgentGuiWorkbenchDockEntryNode
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-UAAXRSW2.js";
|
|
16
16
|
import {
|
|
17
17
|
agentGuiWorkbenchPrefillPromptActivationType
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-ATEZXUHK.js";
|
|
19
|
+
import "../chunk-BHNJN2TR.js";
|
|
20
20
|
export {
|
|
21
21
|
agentGuiWorkbenchDockEntryId,
|
|
22
22
|
agentGuiWorkbenchDockIdentityFromIdentifier,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AgentGuiWorkbenchProvider } from './types.js';
|
|
2
|
-
import '../types-
|
|
2
|
+
import '../types-DZ79b8Zn.js';
|
|
3
3
|
|
|
4
|
-
declare const agentGuiWorkbenchProviders: readonly ["claude-code", "codex", "cursor", "tutti-agent", "hermes", "gemini", "openclaw"];
|
|
4
|
+
declare const agentGuiWorkbenchProviders: readonly ["claude-code", "codex", "cursor", "tutti-agent", "opencode", "hermes", "gemini", "openclaw"];
|
|
5
5
|
declare const agentGuiWorkbenchDefaultDockProviders: readonly ["codex", "claude-code", "tutti-agent"];
|
|
6
|
-
declare const agentGuiWorkbenchDockSuppressedProviders: readonly ["hermes", "gemini"];
|
|
6
|
+
declare const agentGuiWorkbenchDockSuppressedProviders: readonly ["hermes", "gemini", "opencode"];
|
|
7
7
|
declare const agentGuiWorkbenchComingSoonProviders: readonly [];
|
|
8
8
|
declare const agentGuiWorkbenchProviderLabels: Record<AgentGuiWorkbenchProvider, string>;
|
|
9
9
|
declare function resolveAgentGuiWorkbenchProviderLabel(provider: AgentGuiWorkbenchProvider): string;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isAgentGuiWorkbenchProvider,
|
|
11
11
|
normalizeAgentGuiWorkbenchProvider,
|
|
12
12
|
resolveAgentGuiWorkbenchProviderLabel
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-BHNJN2TR.js";
|
|
14
14
|
export {
|
|
15
15
|
agentGuiWorkbenchComingSoonProviders,
|
|
16
16
|
agentGuiWorkbenchDefaultDockProviders,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentActivitySnapshot } from '@tutti-os/agent-activity-core';
|
|
2
2
|
import { U as UiLanguage } from '../uiSettings-BQS9r2eo.js';
|
|
3
3
|
import { AgentGuiWorkbenchProvider } from './types.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DZ79b8Zn.js';
|
|
5
5
|
|
|
6
6
|
interface AgentGuiSessionTitleFormatOptions {
|
|
7
7
|
fallbackAgentLabel?: string;
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
formatAgentGuiConversationPlainTitle,
|
|
3
3
|
formatAgentGuiSessionPlainTitle,
|
|
4
4
|
resolveAgentGuiWorkbenchSessionTitle
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-EHLJL76A.js";
|
|
6
|
+
import "../chunk-KTIKZNGS.js";
|
|
7
|
+
import "../chunk-KAPBUKIT.js";
|
|
8
8
|
import "../chunk-GCBDIQDX.js";
|
|
9
9
|
export {
|
|
10
10
|
formatAgentGuiConversationPlainTitle,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkbenchHostExternalStateSource, WorkbenchHostExternalStateLookupInput } from '@tutti-os/workbench-surface';
|
|
2
2
|
import { AgentGuiWorkbenchProvider, AgentGuiWorkbenchNodeState, AgentGuiWorkbenchState, AgentGuiWorkbenchWorkspaceState } from './types.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-DZ79b8Zn.js';
|
|
4
4
|
|
|
5
5
|
type AgentGuiWorkbenchStateLookupRequest = Pick<WorkbenchHostExternalStateLookupInput, "instanceId" | "typeId"> & Partial<Pick<WorkbenchHostExternalStateLookupInput, "nodeId">>;
|
|
6
6
|
declare function createDefaultAgentGuiWorkbenchNodeState(provider?: AgentGuiWorkbenchProvider): AgentGuiWorkbenchNodeState;
|
|
@@ -10,6 +10,15 @@ declare function areAgentGuiWorkbenchStatesEqual(left: AgentGuiWorkbenchState, r
|
|
|
10
10
|
declare function normalizeAgentGuiWorkbenchNodeState(state: Partial<AgentGuiWorkbenchNodeState> | null | undefined, fallbackProvider?: AgentGuiWorkbenchProvider): AgentGuiWorkbenchNodeState;
|
|
11
11
|
declare function areAgentGuiWorkbenchNodeStatesEqual(left: AgentGuiWorkbenchNodeState, right: AgentGuiWorkbenchNodeState): boolean;
|
|
12
12
|
declare function agentGuiWorkbenchProviderFromInstanceId(instanceId: string | null | undefined): AgentGuiWorkbenchProvider;
|
|
13
|
+
/**
|
|
14
|
+
* Like {@link agentGuiWorkbenchProviderFromInstanceId} but returns `null`
|
|
15
|
+
* instead of defaulting to `"codex"` when the provider cannot be determined
|
|
16
|
+
* yet (e.g. a freshly created session whose instanceId does not encode a
|
|
17
|
+
* provider). Callers that render a provider icon use this so they can show a
|
|
18
|
+
* neutral placeholder during that transient window instead of flashing the
|
|
19
|
+
* wrong provider's icon.
|
|
20
|
+
*/
|
|
21
|
+
declare function agentGuiWorkbenchProviderFromInstanceIdOrNull(instanceId: string | null | undefined): AgentGuiWorkbenchProvider | null;
|
|
13
22
|
declare function createAgentGuiWorkbenchNodeStateSource(input: {
|
|
14
23
|
typeId?: string;
|
|
15
24
|
workspaceId: string;
|
|
@@ -27,4 +36,4 @@ declare function createAgentGuiWorkbenchNodeStateSource(input: {
|
|
|
27
36
|
findInstanceIdByAgentSessionId: (agentSessionId: string) => string | null;
|
|
28
37
|
};
|
|
29
38
|
|
|
30
|
-
export { agentGuiWorkbenchProviderFromInstanceId, areAgentGuiWorkbenchNodeStatesEqual, areAgentGuiWorkbenchStatesEqual, createAgentGuiWorkbenchNodeStateSource, createDefaultAgentGuiWorkbenchNodeState, normalizeAgentGuiWorkbenchNodeState, normalizeAgentGuiWorkbenchState, projectAgentGuiWorkbenchState };
|
|
39
|
+
export { agentGuiWorkbenchProviderFromInstanceId, agentGuiWorkbenchProviderFromInstanceIdOrNull, areAgentGuiWorkbenchNodeStatesEqual, areAgentGuiWorkbenchStatesEqual, createAgentGuiWorkbenchNodeStateSource, createDefaultAgentGuiWorkbenchNodeState, normalizeAgentGuiWorkbenchNodeState, normalizeAgentGuiWorkbenchState, projectAgentGuiWorkbenchState };
|
package/dist/workbench/state.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
agentGuiWorkbenchProviderFromInstanceId,
|
|
3
|
+
agentGuiWorkbenchProviderFromInstanceIdOrNull,
|
|
3
4
|
areAgentGuiWorkbenchNodeStatesEqual,
|
|
4
5
|
areAgentGuiWorkbenchStatesEqual,
|
|
5
6
|
createAgentGuiWorkbenchNodeStateSource,
|
|
@@ -7,11 +8,12 @@ import {
|
|
|
7
8
|
normalizeAgentGuiWorkbenchNodeState,
|
|
8
9
|
normalizeAgentGuiWorkbenchState,
|
|
9
10
|
projectAgentGuiWorkbenchState
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-KTIHLBCN.js";
|
|
12
|
+
import "../chunk-BHNJN2TR.js";
|
|
13
|
+
import "../chunk-N37A62BK.js";
|
|
13
14
|
export {
|
|
14
15
|
agentGuiWorkbenchProviderFromInstanceId,
|
|
16
|
+
agentGuiWorkbenchProviderFromInstanceIdOrNull,
|
|
15
17
|
areAgentGuiWorkbenchNodeStatesEqual,
|
|
16
18
|
areAgentGuiWorkbenchStatesEqual,
|
|
17
19
|
createAgentGuiWorkbenchNodeStateSource,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as AgentGUIProviderTargetRef } from '../types-DZ79b8Zn.js';
|
|
2
2
|
|
|
3
|
-
type AgentGuiWorkbenchProvider = "claude-code" | "codex" | "tutti-agent" | "cursor" | "nexight" | "gemini" | "hermes" | "openclaw";
|
|
3
|
+
type AgentGuiWorkbenchProvider = "claude-code" | "codex" | "tutti-agent" | "cursor" | "nexight" | "gemini" | "hermes" | "openclaw" | "opencode";
|
|
4
4
|
declare const agentGuiWorkbenchOpenSessionActivationType = "agent-gui:open-session";
|
|
5
5
|
declare const agentGuiWorkbenchPrefillPromptActivationType = "agent-gui:prefill-prompt";
|
|
6
6
|
interface AgentGuiWorkbenchPrefillPromptPayload {
|
package/dist/workbench/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
agentGuiWorkbenchOpenSessionActivationType,
|
|
3
3
|
agentGuiWorkbenchPrefillPromptActivationType
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ATEZXUHK.js";
|
|
5
5
|
export {
|
|
6
6
|
agentGuiWorkbenchOpenSessionActivationType,
|
|
7
7
|
agentGuiWorkbenchPrefillPromptActivationType
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
resolveWorkspaceAgentActivityStatus,
|
|
5
5
|
resolveWorkspaceAgentActivityTitle,
|
|
6
6
|
reuseWorkspaceAgentActivityListViewModelIfUnchanged
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ERBUQOIL.js";
|
|
8
8
|
import "./chunk-IBIMGLCD.js";
|
|
9
9
|
import "./chunk-Y35GDLP2.js";
|
|
10
10
|
import {
|
|
11
11
|
workspaceAgentProviderLabel
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-4US2YHBY.js";
|
|
13
|
+
import "./chunk-NH3XBJTZ.js";
|
|
14
|
+
import "./chunk-KAPBUKIT.js";
|
|
15
15
|
import "./chunk-GCBDIQDX.js";
|
|
16
16
|
export {
|
|
17
17
|
buildWorkspaceAgentActivityListViewModel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tutti-os/agent-gui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.69",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -94,17 +94,17 @@
|
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@monaco-editor/react": "^4.7.0",
|
|
97
|
-
"@tutti-os/agent-activity-core": "0.0.
|
|
98
|
-
"@tutti-os/ui-i18n-runtime": "0.0.
|
|
99
|
-
"@tutti-os/ui-rich-text": "0.0.
|
|
100
|
-
"@tutti-os/ui-react-hooks": "0.0.
|
|
101
|
-
"@tutti-os/ui-system": "0.0.
|
|
102
|
-
"@tutti-os/workbench-surface": "0.0.
|
|
103
|
-
"@tutti-os/workspace-external-core": "0.0.
|
|
104
|
-
"@tutti-os/workspace-file-manager": "0.0.
|
|
105
|
-
"@tutti-os/workspace-file-reference": "0.0.
|
|
106
|
-
"@tutti-os/workspace-issue-manager": "0.0.
|
|
107
|
-
"@tutti-os/workspace-user-project": "0.0.
|
|
97
|
+
"@tutti-os/agent-activity-core": "0.0.69",
|
|
98
|
+
"@tutti-os/ui-i18n-runtime": "0.0.69",
|
|
99
|
+
"@tutti-os/ui-rich-text": "0.0.69",
|
|
100
|
+
"@tutti-os/ui-react-hooks": "0.0.69",
|
|
101
|
+
"@tutti-os/ui-system": "0.0.69",
|
|
102
|
+
"@tutti-os/workbench-surface": "0.0.69",
|
|
103
|
+
"@tutti-os/workspace-external-core": "0.0.69",
|
|
104
|
+
"@tutti-os/workspace-file-manager": "0.0.69",
|
|
105
|
+
"@tutti-os/workspace-file-reference": "0.0.69",
|
|
106
|
+
"@tutti-os/workspace-issue-manager": "0.0.69",
|
|
107
|
+
"@tutti-os/workspace-user-project": "0.0.69",
|
|
108
108
|
"@tanstack/react-virtual": "^3.13.12",
|
|
109
109
|
"@tiptap/core": "^3.11.1",
|
|
110
110
|
"@tiptap/pm": "^3.23.6",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../shared/agentCustomMentionKinds.ts","../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts","../shared/managedAgentIcons.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\n// 自定义 mention kind 注册表:让宿主(如 tsh)从外部注册 mention://<kind>/... 链接的\n// 解析与 composer 内 chip 渲染,包内不内置任何具体业务 kind。\n//\n// 管线接点:\n// - 解析:agentFileMentionExtension.parseMentionItemFromHref 命中注册 kind 时产出\n// AgentMentionCustomItem(展示字段由 present() 提取;href 是完整信息源,round-trip 无损)\n// - 渲染:AgentMentionNodeView 对 kind===\"custom\" 调 renderChip(),缺省用包内通用双行卡\n// - 点击:clickable 的 kind 经 resolveWorkspaceMentionLinkAction 上抛\n// open-custom-mention 链接动作(携带原始 href,宿主自行二次解析)\n//\n// 注册时机:宿主渲染进程 bootstrap(早于首个 composer 挂载);模块级单例,重复注册以\n// 后者为准(HMR 友好)。\n\nexport interface AgentCustomMentionIdentity {\n entityId: string;\n label: string;\n scope?: Readonly<Record<string, string>>;\n}\n\nexport interface AgentCustomMentionPresentation {\n /** chip 第一行(缺省用链接 label)。 */\n name: string;\n /** chip 第二行(可选,通用双行卡的次要文案)。 */\n summary?: string;\n /** 所属 workspace(可选;custom kind 的 scope 键由注册方约定)。 */\n workspaceId?: string;\n}\n\nexport interface AgentCustomMentionChipContext {\n href: string;\n name: string;\n summary?: string;\n isEditable: boolean;\n /** 可编辑态的移除按钮,由 NodeView 注入;自定义渲染需自行摆放。 */\n removeAction?: ReactNode;\n}\n\nexport interface AgentCustomMentionKindDefinition {\n /** mention://<kind>/... 的 providerId(URL hostname,小写)。 */\n kind: string;\n /**\n * 从 canonical mention 链接提取展示字段;返回 null 表示链接无效,\n * 退化为普通链接/字面文本。\n */\n present(\n mention: AgentCustomMentionIdentity,\n href: string\n ): AgentCustomMentionPresentation | null;\n /** 自定义 chip 渲染;缺省用包内通用双行卡(name + summary)。 */\n renderChip?(context: AgentCustomMentionChipContext): ReactNode;\n /** 点击是否上抛 open-custom-mention 链接动作;缺省 false(chip 只展示)。 */\n clickable?: boolean;\n}\n\nconst registry = new Map<string, AgentCustomMentionKindDefinition>();\n\n// 包内管线已内置处理的 providerId(agentFileMentionExtension /\n// resolveWorkspaceMentionLinkAction),以及宿主侧沿用的 legacy 短名与内部 kind。\n// 注册表查找在部分链路先于内置分支执行,若放行同名注册会静默劫持内置 mention\n// 的解析——注册发生在宿主 bootstrap,直接抛错 fail-fast。\nconst RESERVED_AGENT_MENTION_PROVIDER_IDS = new Set([\n \"agent-session\",\n \"agent-target\",\n \"custom\",\n \"file\",\n \"issue\",\n \"session\",\n \"task\",\n \"workspace-app\",\n \"workspace-app-factory\",\n \"workspace-issue\",\n \"workspace-reference\"\n]);\n\nexport function registerAgentCustomMentionKind(\n definition: AgentCustomMentionKindDefinition\n): void {\n const kind = definition.kind.trim().toLowerCase();\n if (!kind) {\n throw new Error(\n \"[agent-gui] custom mention kind must be a non-empty provider id\"\n );\n }\n if (RESERVED_AGENT_MENTION_PROVIDER_IDS.has(kind)) {\n throw new Error(\n `[agent-gui] custom mention kind \"${kind}\" collides with a built-in provider id`\n );\n }\n registry.set(kind, definition);\n}\n\nexport function getAgentCustomMentionKind(\n kind: string\n): AgentCustomMentionKindDefinition | undefined {\n return registry.get(kind.trim().toLowerCase());\n}\n\nexport function resetAgentCustomMentionKindsForTests(): void {\n registry.clear();\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityCancelSessionInput,\n AgentActivityCancelSessionResult,\n AgentActivityGoalControlInput,\n AgentActivityGoalControlResult,\n AgentActivityCreateSessionInput,\n AgentActivityDeleteSessionInput,\n AgentActivityDeleteSessionResult,\n AgentActivityMessageOrder,\n AgentActivityMessagePage,\n AgentActivitySendInput,\n AgentActivitySendInputResult,\n AgentActivitySession,\n AgentActivitySnapshot,\n AgentActivitySnapshotListener,\n AgentActivitySubmitInteractiveInput\n} from \"@tutti-os/agent-activity-core\";\nimport type {\n AgentHostAgentSessionComposerSettings,\n AgentHostActivateAgentSessionResult,\n AgentHostRuntimeOpenclawGatewayWarmupResult,\n AgentHostUpdateAgentSessionSettingsResult,\n AgentHostUnactivateAgentSessionResult,\n AgentHostAgentSessionState\n} from \"./shared/contracts/dto\";\nimport type { AgentGUIProviderTargetRef } from \"./types\";\nimport { WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN } from \"./shared/workspaceAgentActivityTypes\";\n\nexport interface AgentActivityRuntimeListSessionMessagesInput {\n afterVersion?: number;\n beforeVersion?: number;\n cache?: boolean;\n agentSessionId: string;\n limit?: number;\n order?: AgentActivityMessageOrder;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListGeneratedFilesInput {\n limit?: number;\n query?: string;\n sessionCwd?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionsPageInput {\n limit?: number;\n searchQuery?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeSessionPageResult {\n hasMore: boolean;\n nextCursor?: string;\n sessions: AgentActivitySession[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionsInput {\n agentTargetId?: string | null;\n limitPerSection?: number;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionPageInput {\n agentTargetId?: string | null;\n cursor?: string;\n limit?: number;\n sectionKey: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUserProject {\n createdAtUnixMs: number;\n id: string;\n label: string;\n lastUsedAtUnixMs?: number;\n path: string;\n sectionKey: string;\n updatedAtUnixMs: number;\n}\n\nexport interface AgentActivityRuntimeSessionSection {\n kind: \"conversations\" | \"project\";\n sectionKey: string;\n userProject?: AgentActivityRuntimeUserProject;\n sessions: AgentActivitySession[];\n hasMore: boolean;\n nextCursor?: string;\n}\n\nexport interface AgentActivityRuntimeSessionSectionsResult {\n sections: AgentActivityRuntimeSessionSection[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFile {\n label: string;\n path: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFileList {\n entries: AgentActivityRuntimeGeneratedFile[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeEnsureSessionSynchronizedInput {\n afterVersion?: number;\n agentSessionId: string;\n onError?: (error: unknown) => void;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimeRetainSessionEventsInput =\n AgentActivityRuntimeEnsureSessionSynchronizedInput;\n\nexport interface AgentActivityRuntimeSetSessionPinnedInput {\n agentSessionId: string;\n pinned: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackSettingsProjectChangeInput {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetSessionControlStateInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetComposerOptionsInput {\n agentTargetId?: string | null;\n cwd?: string | null;\n force?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUpdateSessionSettingsInput {\n agentSessionId: string;\n settings: AgentHostAgentSessionComposerSettings;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput {\n nextSettings: AgentHostAgentSessionComposerSettings;\n previousSettings: AgentHostAgentSessionComposerSettings;\n provider: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeWarmupOpenclawGatewayInput {\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeDiagnosticInput {\n details?: Record<string, unknown>;\n event: string;\n level?: \"debug\" | \"info\" | \"warn\" | \"error\";\n source?: string;\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeActivateSessionInput {\n agentSessionId: string;\n agentTargetId?: string | null;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n metadata?: Record<string, unknown>;\n mode: \"existing\" | \"new\";\n openclawGatewayReady?: boolean;\n provider?: string;\n /**\n * Opaque host-owned target reference. AgentGUI passes this through only; hosts\n * must not treat it as authority and must re-authenticate before launch.\n */\n providerTargetRef?: AgentGUIProviderTargetRef | null;\n settings?: AgentHostAgentSessionComposerSettings;\n title?: string;\n visible?: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUnactivateSessionInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadSessionAttachmentInput {\n agentSessionId: string;\n attachmentId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadPromptAssetInput {\n agentSessionId?: string | null;\n assetId?: string | null;\n hostPath?: string | null;\n kind?: string | null;\n mimeType: string;\n name?: string | null;\n path?: string | null;\n sha256?: string | null;\n uploadStatus?: string | null;\n uri?: string | null;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimePromptContentBlock =\n AgentActivitySendInput[\"content\"][number] & {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n path?: string;\n sizeBytes?: number;\n uploadStatus?: string;\n uri?: string;\n };\n\nexport interface AgentActivityRuntimeUploadPromptContentInput {\n content: AgentActivityRuntimePromptContentBlock[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUploadPromptContentResult {\n content: AgentActivityRuntimePromptContentBlock[];\n}\n\nexport interface AgentActivityRuntimeSessionAttachment {\n attachmentId: string;\n mimeType: string;\n name?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntimePromptAsset {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n mimeType: string;\n name?: string;\n path: string;\n uploadStatus?: string;\n uri?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntime {\n /**\n * Stable identity of this runtime instance (e.g. a local origin vs a\n * shared/room origin). When present, the conversation-list and session-view\n * stores key their query state, runtime resolution, and subscriptions by this\n * value, so multiple runtimes can coexist for the same workspace without\n * fighting over a single module-global slot. Absent => legacy single-runtime\n * behaviour resolved via the module-global.\n */\n origin?: string;\n promptContentUploadSupport?: {\n file?: boolean;\n image?: boolean;\n };\n cancelSession(\n input: AgentActivityCancelSessionInput\n ): Promise<AgentActivityCancelSessionResult>;\n goalControl(\n input: AgentActivityGoalControlInput\n ): Promise<AgentActivityGoalControlResult>;\n createSession(\n input: AgentActivityCreateSessionInput\n ): Promise<AgentActivitySession>;\n deleteSession(\n input: AgentActivityDeleteSessionInput\n ): Promise<AgentActivityDeleteSessionResult>;\n activateSession(\n input: AgentActivityRuntimeActivateSessionInput\n ): Promise<AgentHostActivateAgentSessionResult>;\n getSession(\n workspaceId: string,\n agentSessionId: string\n ): Promise<AgentActivitySession>;\n getComposerOptions(\n input: AgentActivityRuntimeGetComposerOptionsInput\n ): Promise<unknown>;\n updateSessionSettings(\n input: AgentActivityRuntimeUpdateSessionSettingsInput\n ): Promise<AgentHostUpdateAgentSessionSettingsResult>;\n warmupOpenclawGateway?(\n input?: AgentActivityRuntimeWarmupOpenclawGatewayInput\n ): Promise<AgentHostRuntimeOpenclawGatewayWarmupResult>;\n getSessionControlState(\n input: AgentActivityRuntimeGetSessionControlStateInput\n ): Promise<AgentHostAgentSessionState>;\n getSnapshot(workspaceId: string): AgentActivitySnapshot;\n listSessionMessages(\n input: AgentActivityRuntimeListSessionMessagesInput\n ): Promise<AgentActivityMessagePage>;\n listAgentGeneratedFiles?(\n input: AgentActivityRuntimeListGeneratedFilesInput\n ): Promise<AgentActivityRuntimeGeneratedFileList>;\n listSessionsPage?(\n input: AgentActivityRuntimeListSessionsPageInput\n ): Promise<AgentActivityRuntimeSessionPageResult>;\n listSessionSections?(\n input: AgentActivityRuntimeListSessionSectionsInput\n ): Promise<AgentActivityRuntimeSessionSectionsResult>;\n listSessionSectionPage?(\n input: AgentActivityRuntimeListSessionSectionPageInput\n ): Promise<AgentActivityRuntimeSessionSection>;\n load(\n workspaceId: string,\n signal?: AbortSignal\n ): Promise<AgentActivitySnapshot>;\n ensureSessionSynchronized?(\n input: AgentActivityRuntimeEnsureSessionSynchronizedInput\n ): () => void;\n /** @deprecated Use ensureSessionSynchronized. */\n retainSessionEvents(\n input: AgentActivityRuntimeRetainSessionEventsInput\n ): () => void;\n sendInput(\n input: AgentActivitySendInput\n ): Promise<AgentActivitySendInputResult>;\n uploadPromptContent?(\n input: AgentActivityRuntimeUploadPromptContentInput\n ): Promise<AgentActivityRuntimeUploadPromptContentResult>;\n readSessionAttachment?(\n input: AgentActivityRuntimeReadSessionAttachmentInput\n ): Promise<AgentActivityRuntimeSessionAttachment>;\n readPromptAsset?(\n input: AgentActivityRuntimeReadPromptAssetInput\n ): Promise<AgentActivityRuntimePromptAsset>;\n setSessionPinned(\n input: AgentActivityRuntimeSetSessionPinnedInput\n ): Promise<AgentActivitySession>;\n trackSettingsProjectChange?(\n input: AgentActivityRuntimeTrackSettingsProjectChangeInput\n ): Promise<void>;\n trackDraftComposerSettingsChange?(\n input: AgentActivityRuntimeTrackDraftComposerSettingsChangeInput\n ): Promise<void>;\n reportDiagnostic?(\n input: AgentActivityRuntimeDiagnosticInput\n ): Promise<void> | void;\n unactivateSession(\n input: AgentActivityRuntimeUnactivateSessionInput\n ): Promise<AgentHostUnactivateAgentSessionResult>;\n submitInteractive(\n input: AgentActivitySubmitInteractiveInput\n ): Promise<unknown>;\n subscribeSessionEvents(\n workspaceId: string,\n listener: (event: unknown) => void\n ): () => void;\n subscribe(\n workspaceId: string,\n listener: AgentActivitySnapshotListener\n ): () => void;\n}\n\nconst AgentActivityRuntimeContext = createContext<AgentActivityRuntime | null>(\n null\n);\n\nlet currentAgentActivityRuntime: AgentActivityRuntime | null = null;\n\n// Registry of runtimes indexed by their stable `origin`. Non-React module\n// singletons (the conversation-list and session-view stores) resolve the\n// correct runtime for a query's origin from here instead of reading the\n// last-mounted module-global — the single slot two runtimes used to fight over.\nconst runtimesByOrigin = new Map<string, AgentActivityRuntime>();\n\n// A runtime without an explicit origin is the default (local) runtime. It\n// registers under this canonical origin — the same value the conversation-list\n// query and session-view refs fall back to — so the local window resolves to it\n// by origin instead of depending on the last-mounted module-global. A shared/\n// room runtime opts in by setting a distinct `origin`; no host wiring needed for\n// the local case.\nfunction normalizeRuntimeOrigin(origin: string | null | undefined): string {\n return origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;\n}\n\nexport interface AgentActivityRuntimeProviderProps extends PropsWithChildren {\n runtime?: AgentActivityRuntime | null;\n}\n\nexport function AgentActivityRuntimeProvider({\n children,\n runtime\n}: AgentActivityRuntimeProviderProps): JSX.Element {\n currentAgentActivityRuntime = runtime ?? null;\n const origin = normalizeRuntimeOrigin(runtime?.origin);\n // Register during render to close the gap before the effect runs (parity with\n // the module-global write above); the effect owns cleanup on unmount.\n if (origin && runtime) {\n runtimesByOrigin.set(origin, runtime);\n }\n useEffect(() => {\n if (!origin || !runtime) {\n return;\n }\n runtimesByOrigin.set(origin, runtime);\n return () => {\n // Only clear if a newer provider hasn't already re-registered this origin.\n if (runtimesByOrigin.get(origin) === runtime) {\n runtimesByOrigin.delete(origin);\n }\n };\n }, [origin, runtime]);\n return (\n <AgentActivityRuntimeContext.Provider value={runtime ?? null}>\n {children}\n </AgentActivityRuntimeContext.Provider>\n );\n}\n\nexport function useAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function useOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime()\n );\n}\n\nexport function useAgentActivitySnapshot(\n workspaceId: string\n): AgentActivitySnapshot {\n const runtime = useAgentActivityRuntime();\n const normalizedWorkspaceId = workspaceId.trim();\n return useSyncExternalStore(\n (listener) => runtime.subscribe(normalizedWorkspaceId, listener),\n () => runtime.getSnapshot(normalizedWorkspaceId),\n () => runtime.getSnapshot(normalizedWorkspaceId)\n );\n}\n\nexport function getAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime()\n );\n}\n\n/**\n * Resolve the runtime for a given origin. When the origin is registered (two\n * runtimes coexisting for one workspace), returns that exact instance.\n *\n * Only the default (local) origin falls back to legacy single-runtime\n * resolution. An explicit non-default origin that is not registered returns null\n * rather than cross-routing to a different runtime via the module-global slot —\n * e.g. a shared query must never silently load from the local runtime.\n */\nexport function getAgentActivityRuntimeByOrigin(\n origin: string | null | undefined\n): AgentActivityRuntime | null {\n const normalizedOrigin = normalizeRuntimeOrigin(origin);\n const runtime = runtimesByOrigin.get(normalizedOrigin);\n if (runtime) {\n return runtime;\n }\n if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {\n return getOptionalAgentActivityRuntime();\n }\n return null;\n}\n\nexport function resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = null;\n runtimesByOrigin.clear();\n }\n}\n\nexport function setAgentActivityRuntimeForTests(\n runtime: AgentActivityRuntime | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = runtime;\n }\n}\n\nfunction getTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitRuntime = getExplicitWindowTestAgentActivityRuntime();\n if (explicitRuntime) {\n return explicitRuntime;\n }\n if (currentAgentActivityRuntime) {\n return currentAgentActivityRuntime;\n }\n const testRuntime = (\n window as unknown as Window & {\n agentActivityRuntime?: AgentActivityRuntime;\n }\n ).agentActivityRuntime;\n return testRuntime ?? null;\n}\n\nfunction getExplicitWindowTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentActivityRuntime\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n return (testDescriptor.value as AgentActivityRuntime | undefined) ?? null;\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport {\n toAgentHostRuntimeApi,\n type AgentHostInputApi,\n type AgentHostRuntimeApi\n} from \"./host/agentHostApi\";\nimport {\n AgentActivityRuntimeProvider,\n type AgentActivityRuntime\n} from \"./agentActivityRuntime\";\nimport { WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN } from \"./shared/workspaceAgentActivityTypes\";\n\nconst AgentActivityHostContext = createContext<AgentHostRuntimeApi | null>(\n null\n);\n\nlet currentAgentHostApi: AgentHostRuntimeApi | null = null;\n\n// Host APIs indexed by their runtime origin, mirroring the runtime registry.\n// Read-state persistence resolves the host API by the query's origin so a\n// local window persists to the local host and a shared/cloud window persists to\n// its own cloud host — each backend keyed by (roomId, userId) with no origin\n// needed on the record itself.\nconst hostApiByOrigin = new Map<string, AgentHostRuntimeApi>();\n\nfunction resolveHostOrigin(\n runtime: AgentActivityRuntime | null | undefined\n): string {\n return (\n runtime?.origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN\n );\n}\n\nexport interface AgentActivityHostProviderProps extends PropsWithChildren {\n agentActivityRuntime?: AgentActivityRuntime | null;\n agentHostApi?: AgentHostInputApi | null;\n}\n\nexport function AgentActivityHostProvider({\n agentActivityRuntime,\n agentHostApi,\n children\n}: AgentActivityHostProviderProps): JSX.Element {\n const resolvedAgentHostApi = useMemo(\n () => (agentHostApi ? toAgentHostRuntimeApi(agentHostApi) : null),\n [agentHostApi]\n );\n currentAgentHostApi = resolvedAgentHostApi;\n const origin = resolveHostOrigin(agentActivityRuntime);\n // Register during render to close the gap before the effect runs; the effect\n // owns cleanup on unmount.\n if (resolvedAgentHostApi) {\n hostApiByOrigin.set(origin, resolvedAgentHostApi);\n }\n useEffect(() => {\n if (!resolvedAgentHostApi) {\n return;\n }\n hostApiByOrigin.set(origin, resolvedAgentHostApi);\n return () => {\n if (hostApiByOrigin.get(origin) === resolvedAgentHostApi) {\n hostApiByOrigin.delete(origin);\n }\n };\n }, [origin, resolvedAgentHostApi]);\n return (\n <AgentActivityRuntimeProvider runtime={agentActivityRuntime}>\n <AgentActivityHostContext.Provider value={resolvedAgentHostApi}>\n {children}\n </AgentActivityHostContext.Provider>\n </AgentActivityRuntimeProvider>\n );\n}\n\nexport function useAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function useOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n}\n\nexport function getOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return (\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi()\n );\n}\n\n/**\n * Resolve the host API for a given runtime origin. When the origin is registered\n * (local vs shared/cloud host), returns that exact host API so its persistence\n * (read-state, etc.) targets the matching backend; otherwise falls back to\n * legacy single-host resolution.\n */\nexport function getAgentHostApiByOrigin(\n origin: string | null | undefined\n): AgentHostRuntimeApi | null {\n const normalizedOrigin =\n origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;\n const hostApi = hostApiByOrigin.get(normalizedOrigin);\n if (hostApi) {\n return hostApi;\n }\n // Only the default (local) origin falls back to the legacy single-host slot.\n // An explicit non-default origin that is not registered returns null so its\n // persistence never lands in a different host's store (e.g. shared read-state\n // must not be written to the local backend).\n if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {\n return getOptionalAgentHostApi();\n }\n return null;\n}\n\nexport function resetAgentHostApiForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = null;\n hostApiByOrigin.clear();\n }\n}\n\nexport function setAgentHostApiForTests(\n agentHostApi: AgentHostInputApi | AgentHostRuntimeApi | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = agentHostApi\n ? toAgentHostRuntimeApi(agentHostApi)\n : null;\n }\n}\n\nfunction getTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitAgentHostApi = getExplicitWindowTestAgentHostApi();\n if (explicitAgentHostApi) {\n return explicitAgentHostApi;\n }\n if (currentAgentHostApi) {\n return currentAgentHostApi;\n }\n const testAgentHostApi = (\n window as unknown as Window & {\n agentHostApi?: AgentHostInputApi | AgentHostRuntimeApi;\n }\n ).agentHostApi;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n\nfunction getExplicitWindowTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentHostApi\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n const testAgentHostApi = testDescriptor.value as\n | AgentHostInputApi\n | AgentHostRuntimeApi\n | undefined;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n","import type {\n AgentHostBatchUserInfoInput,\n AgentHostBatchUserInfoResult,\n AgentHostDeleteWorkspaceAgentSessionInput,\n AgentHostWorkspaceAgentListInput as AgentHostListWorkspaceAgentsInput,\n AgentHostListWorkspaceAgentProbesInput,\n AgentHostWorkspaceAgentSessionMessages,\n AgentHostWorkspaceAgentSessionMessagesInput,\n AgentHostWorkspaceAgentSessionSummary,\n AgentHostWorkspaceAgentSessionSummaryInput,\n AgentHostWorkspaceAgentProbesResult,\n AgentHostWorkspaceAgentSnapshot,\n PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n ReadWorkspaceFileResult as AgentHostReadWorkspaceFileResult,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\n} from \"../shared/contracts/dto\";\nimport type { WorkspaceUserProjectService } from \"@tutti-os/workspace-user-project/contracts\";\n\ntype AgentHostAsyncResult<T = any> = Promise<T>;\ntype AgentHostRecord = Record<string, unknown>;\ntype AgentHostUnsubscribe = () => void;\ntype AgentHostWorkspaceScopedInput<\n T extends {\n workspaceId?: string | null;\n }\n> = Omit<T, \"workspaceId\"> & {\n workspaceId: string;\n};\ntype AgentHostWorkspaceAgentsListInput =\n AgentHostWorkspaceScopedInput<AgentHostListWorkspaceAgentsInput>;\ntype AgentHostWorkspaceAgentSessionMessagesRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionMessagesInput>;\ntype AgentHostWorkspaceAgentSessionSummaryRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionSummaryInput>;\ntype AgentHostDeleteWorkspaceAgentSessionRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostDeleteWorkspaceAgentSessionInput>;\n\nexport type AgentHostClipboardApi = {\n writeImage?: (input: {\n data: string;\n mimeType: \"image/png\";\n }) => AgentHostAsyncResult<void>;\n writeText: (text: string) => AgentHostAsyncResult<void>;\n};\n\nexport type AgentHostDebugApi = {\n logRuntimeDiagnostics: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n logTerminalDiagnostics?: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n};\n\nexport type AgentHostFilesystemApi = AgentHostRecord & {\n readFileText: (payload: {\n path?: string;\n uri?: string;\n }) => AgentHostAsyncResult<{\n content: string;\n name?: string;\n path?: string;\n }>;\n};\n\nexport type AgentHostMetaApi = AgentHostRecord & {\n appVersion?: string | null;\n isPackaged?: boolean;\n isTest?: boolean;\n mainPid?: number | null;\n platform?: string;\n workspaceId?: string;\n};\n\nexport type AgentHostEnvironmentApi = AgentHostRecord & {\n getBaseUrl?: () => AgentHostAsyncResult<string>;\n warmupOpenclawGateway?: (input?: unknown) => AgentHostAsyncResult<unknown>;\n};\n\nexport type AgentHostPersistenceApi = AgentHostRecord & {\n readWorkspaceAgentReadState: (\n input: ReadWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<WorkspaceAgentReadStateSnapshot>;\n writeWorkspaceAgentReadState: (\n input: WriteWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<PersistWriteResult>;\n};\n\nexport type AgentHostToastApi = AgentHostRecord & {\n error: (title: string, description?: string) => void;\n info?: (title: string, description?: string) => void;\n success?: (title: string, description?: string) => void;\n};\n\nexport interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport interface AgentHostSelectFilesInput {\n allowDirectories?: boolean;\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchInput {\n allowBinary?: boolean;\n atomic?: boolean;\n cwd: string;\n diff: string;\n revert?: boolean;\n target?: \"unstaged\" | \"staged\" | \"staged-and-unstaged\";\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchResult {\n status: \"success\" | \"partial-success\" | \"error\";\n appliedPaths: string[];\n skippedPaths: string[];\n conflictedPaths: string[];\n errorCode?: \"not-git-repo\" | string;\n execOutput?: {\n command: string;\n stdout: string;\n stderr: string;\n };\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportInput {\n cwd: string;\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportResult {\n supported: boolean;\n root?: string;\n errorCode?: \"not-git-repo\" | string;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n applyGitPatch?: (\n input: AgentHostApplyWorkspaceGitPatchInput\n ) => AgentHostAsyncResult<AgentHostApplyWorkspaceGitPatchResult>;\n resolveGitPatchSupport?: (\n input: AgentHostResolveWorkspaceGitPatchSupportInput\n ) => AgentHostAsyncResult<AgentHostResolveWorkspaceGitPatchSupportResult>;\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getReferenceForFile?: (file: File) => {\n kind: \"file\" | \"folder\";\n path: string;\n };\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: (\n input?: AgentHostSelectFilesInput\n ) => AgentHostAsyncResult<AgentHostSelectedFile[]>;\n writeFileText: (input: {\n content: string;\n path: string;\n }) => AgentHostAsyncResult<unknown>;\n};\n\nexport interface AgentHostInputApi {\n account?: AgentHostAccountApi;\n agentGuiBatch?: AgentHostAgentGuiBatchApi;\n agentSessions?: AgentHostAgentSessionsApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n workspaceAgents?: AgentHostWorkspaceAgentsApi;\n}\n\nexport type AgentHostApi = AgentHostInputApi;\n\nexport type AgentHostAccountApi = AgentHostRecord & {\n batchGetUserInfo: (\n input: AgentHostBatchUserInfoInput\n ) => AgentHostAsyncResult<AgentHostBatchUserInfoResult>;\n ensureProfiles?: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostAgentGuiBatchApi = AgentHostRecord & {\n exportRun: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & {\n list: (\n input: AgentHostListWorkspaceAgentProbesInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentProbesResult>;\n};\n\nexport type AgentProviderProbeListInput =\n AgentHostListWorkspaceAgentProbesInput;\nexport type AgentProviderProbeListResult = AgentHostWorkspaceAgentProbesResult;\n\nexport interface AgentHostUserProject {\n id: string;\n path: string;\n label: string;\n createdAtUnixMs?: number;\n updatedAtUnixMs?: number;\n lastUsedAtUnixMs?: number;\n}\n\nexport type AgentHostUserProjectsApi = AgentHostRecord & {\n service?: WorkspaceUserProjectService;\n checkPath?: (input: { path: string }) => AgentHostAsyncResult<{\n exists: boolean;\n isDirectory: boolean;\n path: string;\n }>;\n create?: (input: {\n name: string;\n }) => AgentHostAsyncResult<AgentHostUserProject>;\n getDefaultSelection?: () => AgentHostAsyncResult<{\n path: string | null;\n } | null>;\n list: () => AgentHostAsyncResult<{\n projects: AgentHostUserProject[];\n }>;\n subscribe?: (listener: () => void) => AgentHostUnsubscribe;\n prepareSelection?: (input: {\n projectLocked: boolean;\n selectedPath: string | null;\n }) => AgentHostAsyncResult<{\n isSelectedPathMissing: boolean;\n projects: AgentHostUserProject[];\n selection:\n | {\n kind: \"clear\";\n suppressedPath: string;\n }\n | {\n kind: \"none\";\n }\n | {\n kind: \"select\";\n path: string;\n };\n }>;\n remove?: (input: { path: string }) => AgentHostAsyncResult<void>;\n isNoProjectPath?: (input: { path: string }) => boolean;\n rememberDefaultSelection?: (input: {\n path: string | null;\n }) => AgentHostAsyncResult<void>;\n use: (input: { path: string }) => AgentHostAsyncResult<AgentHostUserProject>;\n};\n\nexport type AgentHostAgentSessionsApi = AgentHostRecord & {\n activate: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.cancelSession.\n */\n cancel: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.sendInput.\n */\n exec: (input: any) => AgentHostAsyncResult<any>;\n getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;\n getState: (input: any) => AgentHostAsyncResult<any>;\n onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.setSessionPinned.\n */\n pinSession?: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n releaseEventStream?: (input?: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n retainEventStream?: (input: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.submitInteractive.\n */\n submitInteractive: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production UI must derive events from AgentActivityRuntime snapshots.\n */\n trackSettingsProjectChange?: (input: {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n }) => AgentHostAsyncResult<void>;\n subscribeEvents: (\n input: any,\n listener: (event: any) => void\n ) => AgentHostUnsubscribe;\n unactivate: (input: any) => AgentHostAsyncResult<any>;\n updateSettings: (input: any) => AgentHostAsyncResult<any>;\n};\n\n/**\n * @deprecated Legacy host DTO projection. AgentGUI production reads and writes\n * must use AgentActivityRuntime and AgentActivity* models.\n */\nexport type AgentHostWorkspaceAgentsApi = AgentHostRecord & {\n /**\n * @deprecated Use AgentActivityRuntime.deleteSession.\n */\n deleteSession: (\n input: AgentHostDeleteWorkspaceAgentSessionRuntimeInput\n ) => AgentHostAsyncResult<any>;\n /**\n * @deprecated Derive summaries from AgentActivitySnapshot/session messages.\n */\n getSessionSummary: (\n input: AgentHostWorkspaceAgentSessionSummaryRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionSummary>;\n /**\n * @deprecated Use AgentActivityRuntime.load/getSnapshot.\n */\n list: (\n input: string | AgentHostWorkspaceAgentsListInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSnapshot>;\n /**\n * @deprecated Use AgentActivityRuntime.listSessionMessages.\n */\n listSessionMessages: (\n input: AgentHostWorkspaceAgentSessionMessagesRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionMessages>;\n};\n\nexport interface AgentHostRuntimeApi {\n account?: AgentHostAccountApi;\n agentGuiBatch: AgentHostAgentGuiBatchApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n}\n\nexport function toAgentHostRuntimeApi(\n hostApi: AgentHostInputApi | AgentHostRuntimeApi\n): AgentHostRuntimeApi {\n return {\n account: hostApi.account,\n agentGuiBatch: hostApi.agentGuiBatch ?? ({} as AgentHostAgentGuiBatchApi),\n clipboard: hostApi.clipboard,\n debug: hostApi.debug,\n filesystem: hostApi.filesystem,\n meta: hostApi.meta,\n onHostEvent: hostApi.onHostEvent,\n persistence: hostApi.persistence,\n runtime: hostApi.runtime,\n toast: hostApi.toast,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n","import { normalizeManagedAgentProvider } from \"./managedAgentProviders\";\nimport {\n claudeRoundedUrl,\n codexRoundedUrl,\n cursorColorfulUrl,\n cursorRoundedUrl,\n geminiRoundedUrl,\n hermesRoundedUrl,\n manageAgentClaudeCodeUrl,\n manageAgentCodexUrl,\n manageAgentGeminiUrl,\n manageAgentHermesUrl,\n manageAgentTuttiUrl,\n manageAgentOpenclawUrl,\n providerRailClaudeCodeColorfulUrl,\n providerRailCodexColorfulUrl,\n providerRailHermesColorfulUrl,\n providerRailTuttiUrl,\n tuttiDocRoundedUrl,\n openclawRoundedUrl\n} from \"../managedAgentIconAssets\";\n\n/** Square avatar art for the managed toolchain agents (used by Manage Agents and Launch home Agents floor). */\nexport const MANAGED_AGENT_ICON_URLS: Record<string, string> = {\n \"claude-code\": manageAgentClaudeCodeUrl,\n codex: manageAgentCodexUrl,\n cursor: cursorRoundedUrl,\n gemini: manageAgentGeminiUrl,\n hermes: manageAgentHermesUrl,\n tutti: manageAgentTuttiUrl,\n openclaw: manageAgentOpenclawUrl\n};\n\n/** Colorful provider rail icons used by AgentGUI's left provider filter. */\nexport const MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS: Record<string, string> = {\n \"claude-code\": providerRailClaudeCodeColorfulUrl,\n codex: providerRailCodexColorfulUrl,\n cursor: cursorColorfulUrl,\n hermes: providerRailHermesColorfulUrl,\n tutti: providerRailTuttiUrl\n};\n\n/** Rounded avatars for Room status / room activity panel only. */\nexport const MANAGED_AGENT_ICON_ROUNDED_URLS: Record<string, string> = {\n \"claude-code\": claudeRoundedUrl,\n codex: codexRoundedUrl,\n cursor: cursorColorfulUrl,\n gemini: geminiRoundedUrl,\n hermes: hermesRoundedUrl,\n tutti: tuttiDocRoundedUrl,\n openclaw: openclawRoundedUrl\n};\n\n/** 与 Manage Agents 列表用的方图区分;房间预览弹幕条等仅用圆图 */\nconst MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL = tuttiDocRoundedUrl;\n\nexport const MANAGED_AGENT_ICON_FALLBACK_URL = manageAgentTuttiUrl;\n\nexport function managedAgentRoundedIconUrl(\n provider: string | undefined\n): string {\n return (\n MANAGED_AGENT_ICON_ROUNDED_URLS[normalizeManagedAgentProvider(provider)] ??\n MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAM,WAAW,oBAAI,IAA8C;AAMnE,IAAM,sCAAsC,oBAAI,IAAI;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAA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;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;;;AEjKO,IAAM,0BAAkD;AAAA,EAC7D,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ;AAGO,IAAM,wCAAgE;AAAA,EAC3E,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AACT;AAGO,IAAM,kCAA0D;AAAA,EACrE,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ;AAGA,IAAM,0CAA0C;AAEzC,IAAM,kCAAkC;AAExC,SAAS,2BACd,UACQ;AACR,SACE,gCAAgC,8BAA8B,QAAQ,CAAC,KACvE;AAEJ;","names":["createContext","useContext","useEffect","jsx","createContext","useEffect","useContext"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../agentGuiSessionProviderIconUrls.ts","../agent-gui/agentGuiNode/model/agentGuiRailLayout.ts","../dockIcons.ts"],"sourcesContent":["import claudeCodeFlatFilledIconUrl from \"./app/renderer/assets/icons/agents/claudecode-flat-filled.svg\";\nimport codexFlatFilledIconUrl from \"./app/renderer/assets/icons/agents/codex-flat-filled.svg\";\nimport cursorFlatFilledIconUrl from \"./app/renderer/assets/icons/agents/cursor-flat-filled.svg\";\nimport tuttiFlatFilledIconUrl from \"./app/renderer/assets/icons/agents/tutti-flat-filled.svg\";\nimport { cursorColorfulUrl } from \"./managedAgentIconAssets\";\nimport { normalizeManagedAgentProvider } from \"./shared/managedAgentProviders\";\n\nexport {\n claudeCodeFlatFilledIconUrl,\n codexFlatFilledIconUrl,\n cursorColorfulUrl,\n cursorFlatFilledIconUrl,\n tuttiFlatFilledIconUrl\n};\n\n/**\n * Colorful session icons, used where the icon renders as a real <img> avatar\n * (collapsed workbench header, dock popup). Colorful assets keep their fill.\n */\nexport function resolveAgentGuiSessionProviderIconUrl(\n provider: string | undefined\n): string | null {\n switch (normalizeManagedAgentProvider(provider)) {\n case \"claude-code\":\n return claudeCodeFlatFilledIconUrl;\n case \"codex\":\n return codexFlatFilledIconUrl;\n case \"cursor\":\n return cursorColorfulUrl;\n default:\n return null;\n }\n}\n\n/**\n * Flat monochrome session icons, used where the icon renders through a CSS\n * mask (e.g. the conversation rail rows). Colorful assets would collapse to a\n * solid square under a mask, so these must be single-color glyphs with a\n * transparent background.\n */\nexport function resolveAgentGuiSessionProviderFlatIconUrl(\n provider: string | undefined\n): string | null {\n switch (normalizeManagedAgentProvider(provider)) {\n case \"claude-code\":\n return claudeCodeFlatFilledIconUrl;\n case \"codex\":\n return codexFlatFilledIconUrl;\n case \"cursor\":\n return cursorFlatFilledIconUrl;\n case \"tutti\":\n return tuttiFlatFilledIconUrl;\n default:\n return null;\n }\n}\n","function clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\n// Keep aligned with the issue manager task-list rail dimensions.\nexport const AGENT_GUI_CONVERSATION_RAIL_DEFAULT_WIDTH_PX = 280;\nexport const AGENT_GUI_CONVERSATION_RAIL_MIN_WIDTH_PX = 248;\nexport const AGENT_GUI_CONVERSATION_RAIL_MAX_WIDTH_PX = 520;\nexport const AGENT_GUI_DETAIL_MIN_WIDTH_PX = 220;\nexport const AGENT_GUI_RAIL_RESIZE_HANDLE_WIDTH_PX = 10;\nexport const AGENT_GUI_COLLAPSED_MIN_WIDTH_PX = 460;\nexport const AGENT_GUI_EXPANDED_MIN_WIDTH_PX =\n AGENT_GUI_CONVERSATION_RAIL_MIN_WIDTH_PX +\n AGENT_GUI_DETAIL_MIN_WIDTH_PX +\n AGENT_GUI_RAIL_RESIZE_HANDLE_WIDTH_PX;\nexport const AGENT_GUI_AUTO_COLLAPSE_WIDTH_PX = 610;\nexport const AGENT_GUI_EXPANDED_TARGET_WIDTH_PX = 800;\n\nexport interface AgentGUIExpandedWindowFrameInput {\n position: { x: number; y: number };\n width: number;\n height: number;\n desktopSize: { width: number; height: number };\n conversationRailWidthPx: number | null | undefined;\n}\n\nexport function shouldAutoCollapseAgentGUIConversationRail(\n containerWidthPx: number\n): boolean {\n return (\n Number.isFinite(containerWidthPx) &&\n containerWidthPx > 0 &&\n containerWidthPx <= AGENT_GUI_AUTO_COLLAPSE_WIDTH_PX\n );\n}\n\nexport function resolveAgentGUIConversationRailMaxWidthPx(\n containerWidthPx: number\n): number {\n const safeContainerWidth =\n Number.isFinite(containerWidthPx) && containerWidthPx > 0\n ? containerWidthPx\n : AGENT_GUI_CONVERSATION_RAIL_DEFAULT_WIDTH_PX +\n AGENT_GUI_DETAIL_MIN_WIDTH_PX +\n AGENT_GUI_RAIL_RESIZE_HANDLE_WIDTH_PX;\n\n return Math.max(\n AGENT_GUI_CONVERSATION_RAIL_MIN_WIDTH_PX,\n Math.min(\n AGENT_GUI_CONVERSATION_RAIL_MAX_WIDTH_PX,\n safeContainerWidth -\n AGENT_GUI_DETAIL_MIN_WIDTH_PX -\n AGENT_GUI_RAIL_RESIZE_HANDLE_WIDTH_PX\n )\n );\n}\n\nexport function clampAgentGUIConversationRailWidthPx(\n widthPx: number | null | undefined,\n containerWidthPx: number\n): number {\n const preferredWidthPx =\n typeof widthPx === \"number\" && Number.isFinite(widthPx)\n ? Math.round(widthPx)\n : null;\n\n return clamp(\n preferredWidthPx ?? AGENT_GUI_CONVERSATION_RAIL_DEFAULT_WIDTH_PX,\n AGENT_GUI_CONVERSATION_RAIL_MIN_WIDTH_PX,\n resolveAgentGUIConversationRailMaxWidthPx(containerWidthPx)\n );\n}\n\nexport function resolveNextAgentGUIConversationRailWidthPx(input: {\n currentWidthPx: number | null | undefined;\n requestedWidthPx: number;\n containerWidthPx: number;\n}): number | null {\n const nextWidthPx = clampAgentGUIConversationRailWidthPx(\n input.requestedWidthPx,\n input.containerWidthPx\n );\n if (input.currentWidthPx === nextWidthPx) {\n return input.currentWidthPx;\n }\n\n if (input.currentWidthPx === null || input.currentWidthPx === undefined) {\n const defaultWidthPx = clampAgentGUIConversationRailWidthPx(\n null,\n input.containerWidthPx\n );\n if (nextWidthPx === defaultWidthPx) {\n return null;\n }\n }\n\n return nextWidthPx;\n}\n\nexport function resolveAgentGUIExpandedWindowFrame(\n input: AgentGUIExpandedWindowFrameInput\n): {\n position: { x: number; y: number };\n size: { width: number; height: number };\n} {\n const desiredRailWidthPx = clampAgentGUIConversationRailWidthPx(\n input.conversationRailWidthPx,\n AGENT_GUI_CONVERSATION_RAIL_MAX_WIDTH_PX +\n AGENT_GUI_DETAIL_MIN_WIDTH_PX +\n AGENT_GUI_RAIL_RESIZE_HANDLE_WIDTH_PX\n );\n const desiredWidthPx = Math.max(\n Math.round(input.width),\n desiredRailWidthPx +\n AGENT_GUI_DETAIL_MIN_WIDTH_PX +\n AGENT_GUI_RAIL_RESIZE_HANDLE_WIDTH_PX,\n AGENT_GUI_EXPANDED_MIN_WIDTH_PX,\n AGENT_GUI_EXPANDED_TARGET_WIDTH_PX\n );\n const desktopWidthPx =\n Number.isFinite(input.desktopSize.width) && input.desktopSize.width > 0\n ? Math.round(input.desktopSize.width)\n : desiredWidthPx;\n const nextWidthPx = Math.min(desiredWidthPx, desktopWidthPx);\n const maxX = Math.max(0, desktopWidthPx - nextWidthPx);\n const nextX = clamp(Math.round(input.position.x), 0, maxX);\n\n return {\n position: {\n x: nextX,\n y: input.position.y\n },\n size: {\n width: nextWidthPx,\n height: input.height\n }\n };\n}\n","import {\n codexRoundedUrl,\n cursorRoundedUrl,\n geminiRoundedUrl,\n hermesRoundedUrl,\n manageAgentClaudeCodeUrl,\n manageAgentTuttiUrl,\n openclawRoundedUrl,\n tuttiAgentRoundedUrl\n} from \"./managedAgentIconAssets.ts\";\n\nexport const agentGuiDockIconUrl = codexRoundedUrl;\n\nexport const agentGuiDockIconUrls = {\n \"claude-code\": manageAgentClaudeCodeUrl,\n codex: codexRoundedUrl,\n cursor: cursorRoundedUrl,\n gemini: geminiRoundedUrl,\n hermes: hermesRoundedUrl,\n nexight: manageAgentTuttiUrl,\n openclaw: openclawRoundedUrl,\n \"tutti-agent\": tuttiAgentRoundedUrl\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAAS,sCACd,UACe;AACf,UAAQ,8BAA8B,QAAQ,GAAG;AAAA,IAC/C,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAQO,SAAS,0CACd,UACe;AACf,UAAQ,8BAA8B,QAAQ,GAAG;AAAA,IAC/C,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;;;ACvDA,SAAS,MAAM,OAAe,KAAa,KAAqB;AAC9D,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;AAGO,IAAM,+CAA+C;AACrD,IAAM,2CAA2C;AACjD,IAAM,2CAA2C;AACjD,IAAM,gCAAgC;AACtC,IAAM,wCAAwC;AAC9C,IAAM,mCAAmC;AACzC,IAAM,kCACX,2CACA,gCACA;AACK,IAAM,mCAAmC;AACzC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AAc;AAC3D,QAAM,OAAO,KAAK,IAAI,GAAG,iBAAiB,WAAW;AACrD,QAAM,QAAQ,MAAM,KAAK,MAAM,MAAM,SAAS,CAAC,GAAG,GAAG,IAAI;AAEzD,SAAO;AAAA,IACL,UAAU;AAAA,MACR,GAAG;AAAA,MACH,GAAG,MAAM,SAAS;AAAA,IACpB;AAAA,IACA,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,QAAQ,MAAM;AAAA,IAChB;AAAA,EACF;AACF;;;AC9HO,IAAM,sBAAsB;AAE5B,IAAM,uBAAuB;AAAA,EAClC,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,eAAe;AACjB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../shared/workspaceAgentProviderLabel.ts","../shared/workspaceAgentActivityTypes.ts"],"sourcesContent":["export function workspaceAgentProviderLabel(provider: string): string {\n const normalized = provider.trim().toLowerCase();\n switch (normalized) {\n case \"codex\":\n return \"Codex\";\n case \"claude-code\":\n return \"Claude Code\";\n case \"gemini\":\n return \"Gemini\";\n case \"openclaw\":\n return \"OpenClaw\";\n case \"hermes\":\n return \"Hermes\";\n case \"nexight\":\n return \"Nexight\";\n case \"unknown\":\n return \"Unknown\";\n default:\n return titleCase(provider);\n }\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","import {\n mergeAgentActivityMessages,\n AgentActivityMessage,\n AgentActivityMessageSemantics,\n AgentActivityPresence,\n AgentActivitySession,\n AgentActivitySnapshot,\n AgentActivitySubmitAvailability,\n AgentActivityTurnLifecycle\n} from \"@tutti-os/agent-activity-core\";\n\nexport type WorkspaceAgentActivityProvider = \"codex\" | \"claude-code\" | string;\n\nexport interface WorkspaceAgentActivityComposerSettings {\n model?: string | null;\n reasoningEffort?: string | null;\n speed?: string | null;\n planMode?: boolean;\n browserUse?: boolean;\n computerUse?: boolean;\n permissionModeId?: string | null;\n}\n\nexport const WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN =\n \"WORKSPACE_AGENT_SESSION_ORIGIN_RUNTIME\";\n\nexport type WorkspaceAgentActivitySessionOrigin =\n | typeof WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN\n | string;\n\nexport function isWorkspaceAgentActivityRuntimeSessionOrigin(\n sessionOrigin: string | null | undefined\n): boolean {\n const normalized = sessionOrigin?.trim() ?? \"\";\n // Core-native AgentActivitySession does not carry the legacy host origin DTO.\n return (\n normalized === \"\" ||\n normalized === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN\n );\n}\n\nexport function createWorkspaceAgentActivityUserMessageIdFromClientSubmitId(\n clientSubmitId: string\n): string | null {\n const normalized = clientSubmitId.trim();\n return normalized ? `client-submit:user:${normalized}` : null;\n}\n\nexport type WorkspaceAgentActivitySyncStatus =\n | \"pending\"\n | \"synced\"\n | \"failed\"\n | string;\n\nexport interface WorkspaceAgentActivitySyncState {\n workspaceId?: string;\n agentSessionId?: string;\n status: WorkspaceAgentActivitySyncStatus;\n pendingTimelineItemCount?: number;\n pendingStatePatchCount?: number;\n attemptCount?: number;\n failedReportCount?: number;\n lastError?: string;\n lastAttemptAtUnixMs?: number;\n lastSyncedAtUnixMs?: number;\n updatedAtUnixMs?: number;\n}\n\nexport interface WorkspaceAgentActivityPresence extends Omit<\n AgentActivityPresence,\n \"id\" | \"provider\" | \"status\"\n> {\n id: string | number;\n provider: WorkspaceAgentActivityProvider;\n status: string;\n userId?: string | null;\n}\n\nexport interface WorkspaceAgentActivitySession extends Omit<\n AgentActivitySession,\n | \"provider\"\n | \"providerSessionId\"\n | \"pinnedAtUnixMs\"\n | \"status\"\n | \"title\"\n | \"workspaceId\"\n> {\n id?: number;\n workspaceId?: string;\n presenceId?: string | number;\n userId?: string;\n provider?: WorkspaceAgentActivityProvider;\n providerSessionId?: string | null;\n resumable?: boolean;\n sessionOrigin?: WorkspaceAgentActivitySessionOrigin;\n lifecycleStatus?: string;\n turnPhase?: string;\n endedAtUnixMs?: number;\n effectiveStatus?: string;\n status?: string;\n turnLifecycle?: AgentActivityTurnLifecycle | null;\n submitAvailability?: AgentActivitySubmitAvailability | null;\n title?: string;\n pinnedAtUnixMs?: number | null;\n syncState?: WorkspaceAgentActivitySyncState;\n}\n\nexport interface WorkspaceAgentActivityFileChange {\n path: string;\n change?: \"added\" | \"modified\" | \"deleted\" | \"moved\" | string;\n tools?: string[];\n}\n\nexport interface WorkspaceAgentActivityFileChanges {\n coverage?: string;\n files?: WorkspaceAgentActivityFileChange[];\n}\n\nexport interface WorkspaceAgentActivityTimelineItem {\n id: number;\n workspaceId?: string;\n agentSessionId: string;\n seq?: number;\n turnId?: string;\n eventSource?: string;\n eventId: string;\n actorType: string;\n actorId: string;\n itemType: \"message\" | \"call\" | \"event\" | \"error\" | \"lifecycle\" | string;\n role?: string;\n callType?: \"tool\" | \"skill\" | \"subagent\" | \"approval\" | \"workflow\" | string;\n callId?: string;\n name?: string;\n status?: string | null;\n content?: string;\n payload?: Record<string, unknown> & {\n content?: unknown;\n text?: unknown;\n fileChanges?: WorkspaceAgentActivityFileChanges;\n };\n occurredAtUnixMs?: number;\n createdAtUnixMs?: number;\n}\n\nexport interface WorkspaceAgentActivityMessage extends Omit<\n AgentActivityMessage,\n \"id\" | \"status\"\n> {\n id?: number;\n status?: string | null;\n semantics?: AgentActivityMessageSemantics;\n}\n\nexport interface WorkspaceAgentActivitySnapshot extends Omit<\n AgentActivitySnapshot,\n \"sessions\" | \"presences\" | \"sessionMessagesById\" | \"workspaceId\"\n> {\n workspaceId?: string;\n presences: WorkspaceAgentActivityPresence[];\n sessions: WorkspaceAgentActivitySession[];\n sessionMessagesById?: Record<string, WorkspaceAgentActivityMessage[]>;\n}\n\nexport interface WorkspaceAgentActivityTurnStatePatch {\n turnId: string;\n phase?: string;\n outcome?: string;\n fileChanges?: Record<string, unknown>;\n startedAtUnixMs?: number;\n completedAtUnixMs?: number;\n activeTurnId?: string | null;\n settling?: boolean;\n completedCommand?: {\n kind: string;\n status: string;\n } | null;\n submitAvailability?: AgentActivitySubmitAvailability;\n}\n\nexport interface WorkspaceAgentActivityEntityStatePatch {\n callId: string;\n turnId?: string;\n callType?: string;\n name?: string;\n status?: string;\n input?: Record<string, unknown>;\n output?: Record<string, unknown>;\n error?: Record<string, unknown>;\n startedAtUnixMs?: number;\n completedAtUnixMs?: number;\n}\n\nexport interface WorkspaceAgentActivityStatePatch {\n workspaceId?: string;\n agentSessionId: string;\n provider?: string;\n providerSessionId?: string;\n model?: string;\n permissionModeId?: string;\n settings?: WorkspaceAgentActivityComposerSettings;\n runtimeContext?: Record<string, unknown>;\n pendingInteractive?: AgentActivitySession[\"pendingInteractive\"];\n cwd?: string;\n title?: string;\n lifecycleStatus?: string;\n currentPhase?: string;\n lastError?: string;\n occurredAtUnixMs?: number;\n submitAvailability?: AgentActivitySubmitAvailability;\n turn?: WorkspaceAgentActivityTurnStatePatch;\n entities?: WorkspaceAgentActivityEntityStatePatch[];\n}\n\nexport interface WorkspaceAgentActivitySessionSummaryItem {\n id?: number;\n turnId?: string;\n actorType?: string;\n actorId?: string;\n itemType?: string;\n role?: string;\n content?: string;\n title?: string;\n status?: string;\n callType?: string;\n name?: string;\n payload?: Record<string, unknown>;\n occurredAtUnixMs?: number;\n}\n\nexport interface WorkspaceAgentActivitySessionSummaryTurn {\n turnId: string;\n userItems?: WorkspaceAgentActivitySessionSummaryItem[];\n agentItems?: WorkspaceAgentActivitySessionSummaryItem[];\n}\n\nexport interface WorkspaceAgentActivitySessionExecutionStatus {\n currentOrFinalStatus?: string;\n updatedAtUnixMs?: number;\n}\n\nexport interface WorkspaceAgentActivitySessionSummary {\n agentSessionId: string;\n latestUserRequirement?: string;\n initialUserRequirement?: string;\n latestTurn?: WorkspaceAgentActivitySessionSummaryTurn;\n recentAgentReplies?: string[];\n recentTurns?: WorkspaceAgentActivitySessionSummaryTurn[];\n currentOrFinalStatus?: string;\n executionStatus?: WorkspaceAgentActivitySessionExecutionStatus;\n}\n\nexport function isWorkspaceAgentActivityOptimisticMessage(\n message: WorkspaceAgentActivityMessage\n): boolean {\n return message.payload?.__agentGuiOptimisticPrompt === true;\n}\n\nexport function selectWorkspaceAgentActivityOverlayMessages(input: {\n durableMessages?: readonly WorkspaceAgentActivityMessage[] | null;\n localMessages?: readonly WorkspaceAgentActivityMessage[] | null;\n}): WorkspaceAgentActivityMessage[] {\n const durableMessages = input.durableMessages ?? [];\n const localMessages = input.localMessages ?? [];\n if (localMessages.length === 0) {\n return [];\n }\n const durableIdentities = new Set(\n durableMessages\n .map(workspaceAgentActivityMessageIdentity)\n .filter((identity): identity is string => identity !== null)\n );\n const durableClientSubmitIds = new Set(\n durableMessages\n .map(workspaceAgentActivityClientSubmitId)\n .filter(\n (clientSubmitId): clientSubmitId is string => clientSubmitId !== null\n )\n );\n const durableUserPromptSignatures = new Set(\n durableMessages\n .map(workspaceAgentActivityUserPromptSignature)\n .filter((signature): signature is string => signature !== null)\n );\n return localMessages.filter((message) => {\n const identity = workspaceAgentActivityMessageIdentity(message);\n if (identity !== null && durableIdentities.has(identity)) {\n return false;\n }\n if (isWorkspaceAgentActivityOptimisticMessage(message)) {\n const clientSubmitId = workspaceAgentActivityClientSubmitId(message);\n if (\n clientSubmitId !== null &&\n durableClientSubmitIds.has(clientSubmitId)\n ) {\n return false;\n }\n if (clientSubmitId !== null) {\n return true;\n }\n const signature = workspaceAgentActivityUserPromptSignature(message);\n return signature === null || !durableUserPromptSignatures.has(signature);\n }\n return true;\n });\n}\n\nexport function mergeWorkspaceAgentActivityDurableAndOverlayMessages(input: {\n durableMessages?: readonly WorkspaceAgentActivityMessage[] | null;\n localMessages?: readonly WorkspaceAgentActivityMessage[] | null;\n}): WorkspaceAgentActivityMessage[] {\n const durableMessages = input.durableMessages ?? [];\n const overlayMessages = selectWorkspaceAgentActivityOverlayMessages(input);\n if (overlayMessages.length === 0) {\n return [...durableMessages];\n }\n // Optimistic echoes carry version 0 (outside the durable version domain),\n // so they cannot participate in a version sort. Durable-domain overlay rows\n // merge by version as usual; surviving echoes append after all durable\n // rows, ordered among themselves by when the user submitted.\n const overlayDurableMessages = overlayMessages.filter(\n (message) => !isWorkspaceAgentActivityOptimisticMessage(message)\n );\n const optimisticMessages = overlayMessages\n .filter(isWorkspaceAgentActivityOptimisticMessage)\n .slice()\n .sort(\n (left, right) =>\n left.occurredAtUnixMs - right.occurredAtUnixMs ||\n left.messageId.localeCompare(right.messageId)\n );\n const merged =\n overlayDurableMessages.length === 0\n ? [...durableMessages]\n : mergeAgentActivityMessages(durableMessages, overlayDurableMessages);\n return optimisticMessages.length === 0\n ? merged\n : [...merged, ...optimisticMessages];\n}\n\nfunction workspaceAgentActivityMessageIdentity(\n message: WorkspaceAgentActivityMessage\n): string | null {\n const messageId = message.messageId?.trim() ?? \"\";\n if (messageId) {\n return `message:${messageId}`;\n }\n if (typeof message.version === \"number\" && Number.isFinite(message.version)) {\n return `version:${message.version}`;\n }\n return null;\n}\n\nfunction workspaceAgentActivityClientSubmitId(\n message: WorkspaceAgentActivityMessage\n): string | null {\n const clientSubmitId = message.payload?.clientSubmitId;\n return typeof clientSubmitId === \"string\" && clientSubmitId.trim()\n ? `${message.agentSessionId}\\u0000${clientSubmitId.trim()}`\n : null;\n}\n\nfunction workspaceAgentActivityUserPromptSignature(\n message: WorkspaceAgentActivityMessage\n): string | null {\n if (message.role !== \"user\") {\n return null;\n }\n const text = workspaceAgentActivityPayloadText(message.payload).trim();\n const content = workspaceAgentActivityPayloadContentSignature(\n message.payload\n );\n if (!text && content === null) {\n return null;\n }\n return [message.agentSessionId, text, content ?? \"\"].join(\"\\u0000\");\n}\n\nfunction workspaceAgentActivityPayloadText(\n payload: Record<string, unknown> | undefined\n): string {\n const text = payload?.text;\n return typeof text === \"string\" ? text : \"\";\n}\n\nfunction workspaceAgentActivityPayloadContentSignature(\n payload: Record<string, unknown> | undefined\n): string | null {\n if (!payload || !Object.prototype.hasOwnProperty.call(payload, \"content\")) {\n return null;\n }\n const content = payload.content;\n if (!Array.isArray(content)) {\n return null;\n }\n const parts: string[] = [];\n for (const block of content) {\n const signature = workspaceAgentActivityPromptBlockSignature(block);\n if (signature === null) {\n return null;\n }\n parts.push(signature);\n }\n return parts.join(\"\\u0001\");\n}\n\nfunction workspaceAgentActivityPromptBlockSignature(\n block: unknown\n): string | null {\n if (!block || typeof block !== \"object\") {\n return null;\n }\n const record = block as Record<string, unknown>;\n const type = workspaceAgentActivityStringField(record, \"type\");\n if (!type) {\n return null;\n }\n const fields = [\n \"text\",\n \"mimeType\",\n \"data\",\n \"url\",\n \"attachmentId\",\n \"name\",\n \"path\",\n \"uri\",\n \"hostPath\",\n \"uploadStatus\",\n \"assetId\",\n \"kind\"\n ];\n const parts = [`type=${type}`];\n for (const field of fields) {\n const value = workspaceAgentActivityStringField(record, field);\n if (value) {\n parts.push(`${field}=${value}`);\n }\n }\n const sizeBytes = record.sizeBytes;\n if (typeof sizeBytes === \"number\" && Number.isFinite(sizeBytes)) {\n parts.push(`sizeBytes=${sizeBytes}`);\n }\n return parts.join(\"\\u0002\");\n}\n\nfunction workspaceAgentActivityStringField(\n record: Record<string, unknown>,\n field: string\n): string {\n const value = record[field];\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n"],"mappings":";AAAO,SAAS,4BAA4B,UAA0B;AACpE,QAAM,aAAa,SAAS,KAAK,EAAE,YAAY;AAC/C,UAAQ,YAAY;AAAA,IAClB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IAC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