@tutti-os/agent-gui 0.0.38 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +40 -0
  2. package/dist/{AgentMessageMarkdown-Cq-7DSV2.d.ts → AgentMessageMarkdown-GDgLA-im.d.ts} +7 -156
  3. package/dist/agent-conversation/index.d.ts +2 -1
  4. package/dist/agent-conversation/index.js +5 -5
  5. package/dist/agent-message-center/index.js +223 -14
  6. package/dist/agent-message-center/index.js.map +1 -1
  7. package/dist/app/renderer/agentactivity.css +67 -0
  8. package/dist/chunk-4K22O34C.js +123 -0
  9. package/dist/chunk-4K22O34C.js.map +1 -0
  10. package/dist/{chunk-7F4M55U3.js → chunk-DO7D7OOL.js} +24 -7
  11. package/dist/chunk-DO7D7OOL.js.map +1 -0
  12. package/dist/{chunk-MUZMBEFO.js → chunk-EFDGMXTB.js} +82 -8
  13. package/dist/chunk-EFDGMXTB.js.map +1 -0
  14. package/dist/{chunk-MKSRP5XS.js → chunk-EQ4RSPQE.js} +5 -5
  15. package/dist/{chunk-JNGYJ7GM.js → chunk-EU7RWKHE.js} +2 -2
  16. package/dist/{chunk-IXIGWLQY.js → chunk-F5DYXCY3.js} +1 -1
  17. package/dist/{chunk-IXIGWLQY.js.map → chunk-F5DYXCY3.js.map} +1 -1
  18. package/dist/{chunk-NCS7X3XY.js → chunk-R7XH3C4Y.js} +16 -4
  19. package/dist/chunk-R7XH3C4Y.js.map +1 -0
  20. package/dist/{chunk-XROBPALT.js → chunk-RE3AHBX6.js} +2 -2
  21. package/dist/{chunk-2ADVHCST.js → chunk-TXXWUG2J.js} +1 -1
  22. package/dist/chunk-TXXWUG2J.js.map +1 -0
  23. package/dist/{chunk-L7FBT3VR.js → chunk-UUM2GZXH.js} +98 -5
  24. package/dist/chunk-UUM2GZXH.js.map +1 -0
  25. package/dist/{chunk-44YASHVW.js → chunk-WC34LVH6.js} +433 -143
  26. package/dist/chunk-WC34LVH6.js.map +1 -0
  27. package/dist/{chunk-JL2WNRYC.js → chunk-WJPEKD3F.js} +17 -1
  28. package/dist/chunk-WJPEKD3F.js.map +1 -0
  29. package/dist/{chunk-WHWZZYBV.js → chunk-Y2DQJPTL.js} +2 -2
  30. package/dist/{chunk-SS5YEVAI.js → chunk-Y5SE2XMU.js} +2 -2
  31. package/dist/context-mention-palette/index.js +6 -6
  32. package/dist/i18n/index.d.ts +16 -0
  33. package/dist/i18n/index.js +1 -1
  34. package/dist/index.d.ts +124 -102
  35. package/dist/index.js +2298 -996
  36. package/dist/index.js.map +1 -1
  37. package/dist/types-xMz0lJWt.d.ts +173 -0
  38. package/dist/workbench/contribution.d.ts +1 -0
  39. package/dist/workbench/contribution.js +5 -4
  40. package/dist/workbench/index.d.ts +3 -1
  41. package/dist/workbench/index.js +5 -4
  42. package/dist/workbench/launch.d.ts +1 -0
  43. package/dist/workbench/launch.js +2 -2
  44. package/dist/workbench/providerCatalog.d.ts +1 -0
  45. package/dist/workbench/state.d.ts +7 -0
  46. package/dist/workbench/state.js +2 -1
  47. package/dist/workbench/types.d.ts +6 -0
  48. package/dist/workbench/types.js +1 -1
  49. package/dist/workspace-agent-generated-files.js +2 -2
  50. package/package.json +13 -12
  51. package/dist/chunk-2ADVHCST.js.map +0 -1
  52. package/dist/chunk-44YASHVW.js.map +0 -1
  53. package/dist/chunk-7F4M55U3.js.map +0 -1
  54. package/dist/chunk-JL2WNRYC.js.map +0 -1
  55. package/dist/chunk-L7FBT3VR.js.map +0 -1
  56. package/dist/chunk-MUZMBEFO.js.map +0 -1
  57. package/dist/chunk-NCS7X3XY.js.map +0 -1
  58. /package/dist/{chunk-MKSRP5XS.js.map → chunk-EQ4RSPQE.js.map} +0 -0
  59. /package/dist/{chunk-JNGYJ7GM.js.map → chunk-EU7RWKHE.js.map} +0 -0
  60. /package/dist/{chunk-XROBPALT.js.map → chunk-RE3AHBX6.js.map} +0 -0
  61. /package/dist/{chunk-WHWZZYBV.js.map → chunk-Y2DQJPTL.js.map} +0 -0
  62. /package/dist/{chunk-SS5YEVAI.js.map → chunk-Y5SE2XMU.js.map} +0 -0
@@ -0,0 +1,173 @@
1
+ type AgentHostAgentSessionProvider = "claude-code" | "codex" | "nexight" | "gemini" | "hermes" | "openclaw";
2
+ type AgentHostAgentSessionPermissionModeSemantic = "ask-before-write" | "accept-edits" | "locked-down" | "auto" | "full-access" | "unconfigurable";
3
+ type AgentHostAgentSessionReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | string;
4
+ type AgentHostAgentSessionSpeed = "standard" | "fast" | string;
5
+ interface AgentHostAgentSessionPermissionModeOption {
6
+ id: string;
7
+ label?: string;
8
+ description?: string;
9
+ semantic: AgentHostAgentSessionPermissionModeSemantic;
10
+ }
11
+ interface AgentHostAgentSessionPermissionConfig {
12
+ configurable: boolean;
13
+ defaultValue?: string | null;
14
+ modes: AgentHostAgentSessionPermissionModeOption[];
15
+ }
16
+ interface AgentHostAgentSessionComposerSettings {
17
+ model?: string | null;
18
+ reasoningEffort?: AgentHostAgentSessionReasoningEffort | null;
19
+ speed?: AgentHostAgentSessionSpeed | null;
20
+ planMode?: boolean;
21
+ browserUse?: boolean;
22
+ computerUse?: boolean;
23
+ permissionModeId?: string | null;
24
+ }
25
+ interface AgentHostAgentSession {
26
+ workspaceId: string;
27
+ agentSessionId: string;
28
+ provider: AgentHostAgentSessionProvider;
29
+ providerSessionId: string;
30
+ resumable?: boolean;
31
+ cwd?: string;
32
+ status: "ready" | "working" | "canceled" | "failed" | "completed" | string;
33
+ title?: string;
34
+ pinnedAtUnixMs?: number | null;
35
+ visible?: boolean;
36
+ permissionModeId?: string;
37
+ permissionConfig?: AgentHostAgentSessionPermissionConfig;
38
+ settings?: AgentHostAgentSessionComposerSettings;
39
+ createdAtUnixMs: number;
40
+ updatedAtUnixMs: number;
41
+ }
42
+ interface AgentHostAgentSessionInteractivePrompt {
43
+ kind: string;
44
+ requestId?: string;
45
+ toolName?: string;
46
+ status?: string;
47
+ input?: Record<string, unknown>;
48
+ output?: Record<string, unknown>;
49
+ error?: Record<string, unknown>;
50
+ metadata?: Record<string, unknown>;
51
+ }
52
+ interface AgentHostAgentSessionState {
53
+ workspaceId: string;
54
+ agentSessionId: string;
55
+ provider: AgentHostAgentSessionProvider;
56
+ providerSessionId?: string;
57
+ resumable?: boolean;
58
+ status: AgentHostAgentSession["status"];
59
+ turnLifecycle?: AgentHostAgentActivityTurnLifecycle | null;
60
+ submitAvailability?: AgentHostAgentActivitySubmitAvailability | null;
61
+ permissionModeId?: string;
62
+ permissionConfig?: AgentHostAgentSessionPermissionConfig;
63
+ settings?: AgentHostAgentSessionComposerSettings;
64
+ authState?: string;
65
+ runtimeContext?: Record<string, unknown>;
66
+ pinnedAtUnixMs?: number | null;
67
+ pendingInteractive?: AgentHostAgentSessionInteractivePrompt | null;
68
+ updatedAtUnixMs: number;
69
+ }
70
+ interface AgentHostAgentActivityCompletedCommand {
71
+ kind: string;
72
+ status: string;
73
+ }
74
+ interface AgentHostAgentActivityTurnLifecycle {
75
+ activeTurnId: string | null;
76
+ phase: string;
77
+ settling?: boolean;
78
+ outcome?: string | null;
79
+ completedCommand?: AgentHostAgentActivityCompletedCommand | null;
80
+ }
81
+ interface AgentHostAgentActivitySubmitAvailability {
82
+ state: string;
83
+ reason?: string;
84
+ }
85
+ type AgentHostAgentSessionActivationMode = "new" | "existing";
86
+ type AgentHostAgentSessionActivationStatus = "attached" | "already_attached" | "failed";
87
+ interface AgentHostActivateAgentSessionResult {
88
+ session: AgentHostAgentSession;
89
+ activation: {
90
+ mode: AgentHostAgentSessionActivationMode;
91
+ status: AgentHostAgentSessionActivationStatus;
92
+ };
93
+ error?: {
94
+ code: string;
95
+ message: string;
96
+ debugMessage?: string;
97
+ };
98
+ }
99
+ interface AgentHostUnactivateAgentSessionResult {
100
+ agentSessionId: string;
101
+ buffered: boolean;
102
+ }
103
+ interface AgentPromptContentBlock {
104
+ type: "text" | "image" | "file" | "skill" | "mention";
105
+ text?: string;
106
+ mimeType?: "image/png" | "image/jpeg" | "image/webp" | string;
107
+ data?: string;
108
+ url?: string;
109
+ attachmentId?: string;
110
+ name?: string;
111
+ path?: string;
112
+ uri?: string;
113
+ hostPath?: string;
114
+ uploadStatus?: string;
115
+ assetId?: string;
116
+ kind?: string;
117
+ sizeBytes?: number;
118
+ }
119
+ interface AgentHostUpdateAgentSessionSettingsResult {
120
+ agentSessionId: string;
121
+ settings: AgentHostAgentSessionComposerSettings;
122
+ }
123
+ interface AgentHostAgentSessionCommand {
124
+ name: string;
125
+ description?: string;
126
+ inputHint?: string;
127
+ }
128
+
129
+ declare const AGENT_PROVIDERS: readonly ["claude-code", "codex", "nexight", "opencode", "gemini", "openclaw", "hermes"];
130
+ type AgentProvider = (typeof AGENT_PROVIDERS)[number];
131
+
132
+ interface AgentGUINodeData {
133
+ provider: AgentGUIProvider;
134
+ providerTargetId?: string | null;
135
+ providerTargetRef?: AgentGUIProviderTargetRef | null;
136
+ lastActiveAgentSessionId: string | null;
137
+ lastActiveConversationTitle?: string | null;
138
+ conversationCount?: number | null;
139
+ conversationRailWidthPx?: number | null;
140
+ conversationRailCollapsed?: boolean | null;
141
+ composerOverrides?: AgentHostAgentSessionComposerSettings | null;
142
+ composerOverridesByProvider?: Partial<Record<AgentGUIProvider, AgentHostAgentSessionComposerSettings | null>> | null;
143
+ }
144
+ type AgentGUIProvider = Extract<AgentProvider, "claude-code" | "codex" | "nexight" | "gemini" | "hermes" | "openclaw">;
145
+ interface AgentGUIProviderTargetRef {
146
+ kind: string;
147
+ provider: AgentGUIProvider;
148
+ [key: string]: unknown;
149
+ }
150
+ interface AgentGUIProviderTarget {
151
+ targetId: string;
152
+ provider: AgentGUIProvider;
153
+ ref: AgentGUIProviderTargetRef;
154
+ label: string;
155
+ description?: string;
156
+ ownerLabel?: string;
157
+ disabled?: boolean;
158
+ unavailableReason?: string;
159
+ }
160
+ interface Size {
161
+ width: number;
162
+ height: number;
163
+ }
164
+ interface Point {
165
+ x: number;
166
+ y: number;
167
+ }
168
+ interface NodeFrame {
169
+ position: Point;
170
+ size: Size;
171
+ }
172
+
173
+ export type { AgentGUINodeData as A, NodeFrame as N, Point as P, AgentGUIProvider as a, AgentGUIProviderTarget as b, AgentGUIProviderTargetRef as c, AgentHostActivateAgentSessionResult as d, AgentHostAgentSessionCommand as e, AgentHostAgentSessionComposerSettings as f, AgentHostAgentSessionPermissionConfig as g, AgentHostAgentSessionReasoningEffort as h, AgentHostAgentSessionSpeed as i, AgentHostAgentSessionState as j, AgentHostUnactivateAgentSessionResult as k, AgentHostUpdateAgentSessionSettingsResult as l, AgentPromptContentBlock as m, AgentProvider as n };
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { WorkbenchFrame, WorkbenchHostNodeBodyContext, WorkbenchHostDockEntry, WorkbenchContribution, WorkbenchHostLaunchRequest } from '@tutti-os/workbench-surface';
3
3
  import { AgentGuiWorkbenchState, AgentGuiWorkbenchProvider } from './types.js';
4
+ import '../types-xMz0lJWt.js';
4
5
 
5
6
  declare const agentGuiWorkbenchDefaultNodeFrame: WorkbenchFrame;
6
7
  declare const agentGuiWorkbenchDefaultUsableHeightRatio = 0.7;
@@ -8,12 +8,13 @@ import {
8
8
  createAgentGuiWorkbenchContribution,
9
9
  resolveAgentGuiWorkbenchContributionCopy,
10
10
  resolveAgentGuiWorkbenchDefaultLaunchFrame
11
- } from "../chunk-NCS7X3XY.js";
12
- import "../chunk-JNGYJ7GM.js";
13
- import "../chunk-MUZMBEFO.js";
11
+ } from "../chunk-R7XH3C4Y.js";
12
+ import "../chunk-EU7RWKHE.js";
13
+ import "../chunk-EFDGMXTB.js";
14
14
  import "../chunk-22L4VWUR.js";
15
- import "../chunk-IXIGWLQY.js";
15
+ import "../chunk-F5DYXCY3.js";
16
16
  import "../chunk-Q75AK47T.js";
17
+ import "../chunk-4K22O34C.js";
17
18
  import "../chunk-MTFSQWZ6.js";
18
19
  export {
19
20
  AGENT_GUI_WORKBENCH_CONVERSATION_RAIL_TOGGLE_EVENT,
@@ -5,6 +5,7 @@ export { agentGuiWorkbenchProviderFromInstanceId, areAgentGuiWorkbenchNodeStates
5
5
  import { HTMLAttributes, ReactNode } from 'react';
6
6
  export { AgentGuiWorkbenchComposerOverrides, AgentGuiWorkbenchNodeState, AgentGuiWorkbenchPrefillPromptPayload, AgentGuiWorkbenchProvider, AgentGuiWorkbenchState, AgentGuiWorkbenchWorkspaceState, agentGuiWorkbenchOpenSessionActivationType, agentGuiWorkbenchPrefillPromptActivationType } from './types.js';
7
7
  import '@tutti-os/workbench-surface';
8
+ import '../types-xMz0lJWt.js';
8
9
 
9
10
  interface AgentGuiWorkbenchHeaderCopy {
10
11
  collapseConversationRail: string;
@@ -18,10 +19,11 @@ interface AgentGuiWorkbenchHeaderProps extends HTMLAttributes<HTMLElement> {
18
19
  isConversationRailAutoCollapsed: boolean;
19
20
  isConversationRailCollapsed: boolean;
20
21
  conversationTitle?: string | null;
22
+ iconUrl?: string | null;
21
23
  onCreateConversation?: () => void;
22
24
  onToggleConversationRail: (nextCollapsed: boolean) => void;
23
25
  title?: string;
24
26
  }
25
- declare function AgentGuiWorkbenchHeader({ className, copy, defaultActions, isConversationRailAutoCollapsed, isConversationRailCollapsed, conversationTitle, onCreateConversation, onToggleConversationRail, title, ...headerProps }: AgentGuiWorkbenchHeaderProps): ReactNode;
27
+ declare function AgentGuiWorkbenchHeader({ className, copy, defaultActions, isConversationRailAutoCollapsed, isConversationRailCollapsed, conversationTitle, iconUrl, onCreateConversation, onToggleConversationRail, title, ...headerProps }: AgentGuiWorkbenchHeaderProps): ReactNode;
26
28
 
27
29
  export { AgentGuiWorkbenchHeader, type AgentGuiWorkbenchHeaderCopy, type AgentGuiWorkbenchHeaderProps };
@@ -6,7 +6,7 @@ import {
6
6
  agentGuiWorkbenchDefaultNodeFrame,
7
7
  createAgentGuiWorkbenchContribution,
8
8
  resolveAgentGuiWorkbenchContributionCopy
9
- } from "../chunk-NCS7X3XY.js";
9
+ } from "../chunk-R7XH3C4Y.js";
10
10
  import {
11
11
  agentGuiWorkbenchDockEntryId,
12
12
  agentGuiWorkbenchInstanceId,
@@ -17,7 +17,7 @@ import {
17
17
  createAgentGuiWorkbenchInstanceId,
18
18
  createAgentGuiWorkbenchLaunchDescriptor,
19
19
  createAgentGuiWorkbenchSessionLaunchRequest
20
- } from "../chunk-JNGYJ7GM.js";
20
+ } from "../chunk-EU7RWKHE.js";
21
21
  import {
22
22
  agentGuiWorkbenchProviderFromInstanceId,
23
23
  areAgentGuiWorkbenchNodeStatesEqual,
@@ -27,7 +27,7 @@ import {
27
27
  normalizeAgentGuiWorkbenchNodeState,
28
28
  normalizeAgentGuiWorkbenchState,
29
29
  projectAgentGuiWorkbenchState
30
- } from "../chunk-MUZMBEFO.js";
30
+ } from "../chunk-EFDGMXTB.js";
31
31
  import {
32
32
  agentGuiWorkbenchComingSoonProviders,
33
33
  agentGuiWorkbenchDefaultDockProviders,
@@ -44,8 +44,9 @@ import {
44
44
  import {
45
45
  agentGuiWorkbenchOpenSessionActivationType,
46
46
  agentGuiWorkbenchPrefillPromptActivationType
47
- } from "../chunk-IXIGWLQY.js";
47
+ } from "../chunk-F5DYXCY3.js";
48
48
  import "../chunk-Q75AK47T.js";
49
+ import "../chunk-4K22O34C.js";
49
50
  import "../chunk-MTFSQWZ6.js";
50
51
  export {
51
52
  AGENT_GUI_WORKBENCH_CONVERSATION_RAIL_TOGGLE_EVENT,
@@ -1,5 +1,6 @@
1
1
  import { WorkbenchHostLaunchRequest } from '@tutti-os/workbench-surface';
2
2
  import { agentGuiWorkbenchOpenSessionActivationType, AgentGuiWorkbenchPrefillPromptPayload, agentGuiWorkbenchPrefillPromptActivationType, AgentGuiWorkbenchProvider } from './types.js';
3
+ import '../types-xMz0lJWt.js';
3
4
 
4
5
  type AgentGuiWorkbenchLaunchRequestInput = Pick<WorkbenchHostLaunchRequest, "payload" | "typeId"> & {
5
6
  dockEntryId?: string | null;
@@ -8,11 +8,11 @@ import {
8
8
  createAgentGuiWorkbenchInstanceId,
9
9
  createAgentGuiWorkbenchLaunchDescriptor,
10
10
  createAgentGuiWorkbenchSessionLaunchRequest
11
- } from "../chunk-JNGYJ7GM.js";
11
+ } from "../chunk-EU7RWKHE.js";
12
12
  import "../chunk-22L4VWUR.js";
13
13
  import {
14
14
  agentGuiWorkbenchPrefillPromptActivationType
15
- } from "../chunk-IXIGWLQY.js";
15
+ } from "../chunk-F5DYXCY3.js";
16
16
  export {
17
17
  agentGuiWorkbenchDockEntryId,
18
18
  agentGuiWorkbenchInstanceId,
@@ -1,4 +1,5 @@
1
1
  import { AgentGuiWorkbenchProvider } from './types.js';
2
+ import '../types-xMz0lJWt.js';
2
3
 
3
4
  declare const agentGuiWorkbenchProviders: readonly ["claude-code", "codex", "nexight", "hermes", "gemini", "openclaw"];
4
5
  declare const agentGuiWorkbenchDefaultDockProviders: readonly ["codex", "claude-code"];
@@ -1,5 +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-xMz0lJWt.js';
3
4
 
4
5
  type AgentGuiWorkbenchStateLookupRequest = Pick<WorkbenchHostExternalStateLookupInput, "instanceId" | "typeId"> & Partial<Pick<WorkbenchHostExternalStateLookupInput, "nodeId">>;
5
6
  declare function createDefaultAgentGuiWorkbenchNodeState(provider?: AgentGuiWorkbenchProvider): AgentGuiWorkbenchNodeState;
@@ -18,6 +19,12 @@ declare function createAgentGuiWorkbenchNodeStateSource(input: {
18
19
  writeNodeState: (request: AgentGuiWorkbenchStateLookupRequest & {
19
20
  state: AgentGuiWorkbenchState;
20
21
  }) => void;
22
+ /**
23
+ * Returns the launch instanceId of an open node currently showing the given
24
+ * agent session, or null when none is found. Used to focus an existing
25
+ * conversation instead of launching a duplicate node.
26
+ */
27
+ findInstanceIdByAgentSessionId: (agentSessionId: string) => string | null;
21
28
  };
22
29
 
23
30
  export { agentGuiWorkbenchProviderFromInstanceId, areAgentGuiWorkbenchNodeStatesEqual, areAgentGuiWorkbenchStatesEqual, createAgentGuiWorkbenchNodeStateSource, createDefaultAgentGuiWorkbenchNodeState, normalizeAgentGuiWorkbenchNodeState, normalizeAgentGuiWorkbenchState, projectAgentGuiWorkbenchState };
@@ -7,8 +7,9 @@ import {
7
7
  normalizeAgentGuiWorkbenchNodeState,
8
8
  normalizeAgentGuiWorkbenchState,
9
9
  projectAgentGuiWorkbenchState
10
- } from "../chunk-MUZMBEFO.js";
10
+ } from "../chunk-EFDGMXTB.js";
11
11
  import "../chunk-22L4VWUR.js";
12
+ import "../chunk-4K22O34C.js";
12
13
  export {
13
14
  agentGuiWorkbenchProviderFromInstanceId,
14
15
  areAgentGuiWorkbenchNodeStatesEqual,
@@ -1,3 +1,5 @@
1
+ import { c as AgentGUIProviderTargetRef } from '../types-xMz0lJWt.js';
2
+
1
3
  type AgentGuiWorkbenchProvider = "claude-code" | "codex" | "nexight" | "gemini" | "hermes" | "openclaw";
2
4
  declare const agentGuiWorkbenchOpenSessionActivationType = "agent-gui:open-session";
3
5
  declare const agentGuiWorkbenchPrefillPromptActivationType = "agent-gui:prefill-prompt";
@@ -23,6 +25,8 @@ interface AgentGuiWorkbenchNodeState {
23
25
  /** @deprecated Conversation titles are derived from the active session id. */
24
26
  lastActiveConversationTitle?: string | null;
25
27
  provider: AgentGuiWorkbenchProvider;
28
+ providerTargetId?: string | null;
29
+ providerTargetRef?: AgentGUIProviderTargetRef | null;
26
30
  }
27
31
  interface AgentGuiWorkbenchState {
28
32
  composerOverrides?: AgentGuiWorkbenchComposerOverrides | null;
@@ -32,6 +36,8 @@ interface AgentGuiWorkbenchState {
32
36
  lastActiveAgentSessionId: string | null;
33
37
  /** @deprecated Conversation titles are derived from the active session id. */
34
38
  lastActiveConversationTitle?: string | null;
39
+ providerTargetId?: string | null;
40
+ providerTargetRef?: AgentGUIProviderTargetRef | null;
35
41
  }
36
42
  interface AgentGuiWorkbenchWorkspaceState {
37
43
  workspaceId: string;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  agentGuiWorkbenchOpenSessionActivationType,
3
3
  agentGuiWorkbenchPrefillPromptActivationType
4
- } from "../chunk-IXIGWLQY.js";
4
+ } from "../chunk-F5DYXCY3.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-SS5YEVAI.js";
7
+ } from "./chunk-Y5SE2XMU.js";
8
8
  import "./chunk-IBIMGLCD.js";
9
9
  import "./chunk-Y35GDLP2.js";
10
10
  import {
11
11
  workspaceAgentProviderLabel
12
12
  } from "./chunk-TYGL25EL.js";
13
13
  import "./chunk-GCBDIQDX.js";
14
- import "./chunk-JL2WNRYC.js";
14
+ import "./chunk-WJPEKD3F.js";
15
15
  export {
16
16
  buildWorkspaceAgentActivityListViewModel,
17
17
  collectWorkspaceAgentGeneratedFiles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tutti-os/agent-gui",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -82,17 +82,17 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@monaco-editor/react": "^4.7.0",
85
- "@tutti-os/agent-activity-core": "0.0.38",
86
- "@tutti-os/ui-i18n-runtime": "0.0.38",
87
- "@tutti-os/ui-rich-text": "0.0.38",
88
- "@tutti-os/ui-react-hooks": "0.0.38",
89
- "@tutti-os/ui-system": "0.0.38",
90
- "@tutti-os/workbench-surface": "0.0.38",
91
- "@tutti-os/workspace-external-core": "0.0.38",
92
- "@tutti-os/workspace-file-manager": "0.0.38",
93
- "@tutti-os/workspace-file-reference": "0.0.38",
94
- "@tutti-os/workspace-issue-manager": "0.0.38",
95
- "@tutti-os/workspace-user-project": "0.0.38",
85
+ "@tutti-os/agent-activity-core": "0.0.40",
86
+ "@tutti-os/ui-i18n-runtime": "0.0.40",
87
+ "@tutti-os/ui-rich-text": "0.0.40",
88
+ "@tutti-os/ui-react-hooks": "0.0.40",
89
+ "@tutti-os/ui-system": "0.0.40",
90
+ "@tutti-os/workbench-surface": "0.0.40",
91
+ "@tutti-os/workspace-external-core": "0.0.40",
92
+ "@tutti-os/workspace-file-manager": "0.0.40",
93
+ "@tutti-os/workspace-file-reference": "0.0.40",
94
+ "@tutti-os/workspace-issue-manager": "0.0.40",
95
+ "@tutti-os/workspace-user-project": "0.0.40",
96
96
  "@tanstack/react-virtual": "^3.13.12",
97
97
  "@tiptap/core": "^3.11.1",
98
98
  "@tiptap/pm": "^3.23.6",
@@ -123,6 +123,7 @@
123
123
  "typescript": "^5.8.3",
124
124
  "vite": "^6.4.2",
125
125
  "vitest": "^4.0.13",
126
+ "@tutti-os/client-tuttid-ts": "0.0.0",
126
127
  "@tutti-os/config-tsconfig": "0.0.0"
127
128
  },
128
129
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts"],"sourcesContent":["import {\n createContext,\n useContext,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityCancelSessionInput,\n AgentActivityCancelSessionResult,\n AgentActivityCreateSessionInput,\n AgentActivityDeleteSessionInput,\n AgentActivityDeleteSessionResult,\n AgentActivityMessageOrder,\n AgentActivityMessagePage,\n AgentActivitySendInput,\n AgentActivitySendInputResult,\n AgentActivitySession,\n AgentActivitySnapshot,\n AgentActivitySnapshotListener,\n AgentActivitySubmitInteractiveInput\n} from \"@tutti-os/agent-activity-core\";\nimport type {\n AgentHostAgentSessionComposerSettings,\n AgentHostActivateAgentSessionResult,\n AgentHostRuntimeOpenclawGatewayWarmupResult,\n AgentHostUpdateAgentSessionSettingsResult,\n AgentHostUnactivateAgentSessionResult,\n AgentHostAgentSessionState\n} from \"./shared/contracts/dto\";\n\nexport interface AgentActivityRuntimeListSessionMessagesInput {\n afterVersion?: number;\n beforeVersion?: number;\n cache?: boolean;\n agentSessionId: string;\n limit?: number;\n order?: AgentActivityMessageOrder;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListGeneratedFilesInput {\n limit?: number;\n query?: string;\n sessionCwd?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFile {\n label: string;\n path: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFileList {\n entries: AgentActivityRuntimeGeneratedFile[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeEnsureSessionSynchronizedInput {\n afterVersion?: number;\n agentSessionId: string;\n onError?: (error: unknown) => void;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimeRetainSessionEventsInput =\n AgentActivityRuntimeEnsureSessionSynchronizedInput;\n\nexport interface AgentActivityRuntimeSetSessionPinnedInput {\n agentSessionId: string;\n pinned: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackSettingsProjectChangeInput {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetSessionControlStateInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetComposerOptionsInput {\n cwd?: string | null;\n force?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUpdateSessionSettingsInput {\n agentSessionId: string;\n settings: AgentHostAgentSessionComposerSettings;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput {\n nextSettings: AgentHostAgentSessionComposerSettings;\n previousSettings: AgentHostAgentSessionComposerSettings;\n provider: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeWarmupOpenclawGatewayInput {\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeDiagnosticInput {\n details?: Record<string, unknown>;\n event: string;\n level?: \"debug\" | \"info\" | \"warn\" | \"error\";\n source?: string;\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeActivateSessionInput {\n agentSessionId: string;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n metadata?: Record<string, unknown>;\n mode: \"existing\" | \"new\";\n openclawGatewayReady?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings;\n title?: string;\n visible?: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUnactivateSessionInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadSessionAttachmentInput {\n agentSessionId: string;\n attachmentId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadPromptAssetInput {\n agentSessionId?: string | null;\n assetId?: string | null;\n hostPath?: string | null;\n kind?: string | null;\n mimeType: string;\n name?: string | null;\n path?: string | null;\n sha256?: string | null;\n uploadStatus?: string | null;\n uri?: string | null;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimePromptContentBlock =\n AgentActivitySendInput[\"content\"][number] & {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n path?: string;\n sizeBytes?: number;\n uploadStatus?: string;\n uri?: string;\n };\n\nexport interface AgentActivityRuntimeUploadPromptContentInput {\n content: AgentActivityRuntimePromptContentBlock[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUploadPromptContentResult {\n content: AgentActivityRuntimePromptContentBlock[];\n}\n\nexport interface AgentActivityRuntimeSessionAttachment {\n attachmentId: string;\n mimeType: string;\n name?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntimePromptAsset {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n mimeType: string;\n name?: string;\n path: string;\n uploadStatus?: string;\n uri?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntime {\n cancelSession(\n input: AgentActivityCancelSessionInput\n ): Promise<AgentActivityCancelSessionResult>;\n createSession(\n input: AgentActivityCreateSessionInput\n ): Promise<AgentActivitySession>;\n deleteSession(\n input: AgentActivityDeleteSessionInput\n ): Promise<AgentActivityDeleteSessionResult>;\n activateSession(\n input: AgentActivityRuntimeActivateSessionInput\n ): Promise<AgentHostActivateAgentSessionResult>;\n getSession(\n workspaceId: string,\n agentSessionId: string\n ): Promise<AgentActivitySession>;\n getComposerOptions(\n input: AgentActivityRuntimeGetComposerOptionsInput\n ): Promise<unknown>;\n updateSessionSettings(\n input: AgentActivityRuntimeUpdateSessionSettingsInput\n ): Promise<AgentHostUpdateAgentSessionSettingsResult>;\n warmupOpenclawGateway?(\n input?: AgentActivityRuntimeWarmupOpenclawGatewayInput\n ): Promise<AgentHostRuntimeOpenclawGatewayWarmupResult>;\n getSessionControlState(\n input: AgentActivityRuntimeGetSessionControlStateInput\n ): Promise<AgentHostAgentSessionState>;\n getSnapshot(workspaceId: string): AgentActivitySnapshot;\n listSessionMessages(\n input: AgentActivityRuntimeListSessionMessagesInput\n ): Promise<AgentActivityMessagePage>;\n listAgentGeneratedFiles?(\n input: AgentActivityRuntimeListGeneratedFilesInput\n ): Promise<AgentActivityRuntimeGeneratedFileList>;\n load(\n workspaceId: string,\n signal?: AbortSignal\n ): Promise<AgentActivitySnapshot>;\n ensureSessionSynchronized?(\n input: AgentActivityRuntimeEnsureSessionSynchronizedInput\n ): () => void;\n /** @deprecated Use ensureSessionSynchronized. */\n retainSessionEvents(\n input: AgentActivityRuntimeRetainSessionEventsInput\n ): () => void;\n sendInput(\n input: AgentActivitySendInput\n ): Promise<AgentActivitySendInputResult>;\n uploadPromptContent?(\n input: AgentActivityRuntimeUploadPromptContentInput\n ): Promise<AgentActivityRuntimeUploadPromptContentResult>;\n readSessionAttachment?(\n input: AgentActivityRuntimeReadSessionAttachmentInput\n ): Promise<AgentActivityRuntimeSessionAttachment>;\n readPromptAsset?(\n input: AgentActivityRuntimeReadPromptAssetInput\n ): Promise<AgentActivityRuntimePromptAsset>;\n setSessionPinned(\n input: AgentActivityRuntimeSetSessionPinnedInput\n ): Promise<AgentActivitySession>;\n trackSettingsProjectChange?(\n input: AgentActivityRuntimeTrackSettingsProjectChangeInput\n ): Promise<void>;\n trackDraftComposerSettingsChange?(\n input: AgentActivityRuntimeTrackDraftComposerSettingsChangeInput\n ): Promise<void>;\n reportDiagnostic?(\n input: AgentActivityRuntimeDiagnosticInput\n ): Promise<void> | void;\n unactivateSession(\n input: AgentActivityRuntimeUnactivateSessionInput\n ): Promise<AgentHostUnactivateAgentSessionResult>;\n submitInteractive(\n input: AgentActivitySubmitInteractiveInput\n ): Promise<unknown>;\n subscribeSessionEvents(\n workspaceId: string,\n listener: (event: unknown) => void\n ): () => void;\n subscribe(\n workspaceId: string,\n listener: AgentActivitySnapshotListener\n ): () => void;\n}\n\nconst AgentActivityRuntimeContext = createContext<AgentActivityRuntime | null>(\n null\n);\n\nlet currentAgentActivityRuntime: AgentActivityRuntime | null = null;\n\nexport interface AgentActivityRuntimeProviderProps extends PropsWithChildren {\n runtime?: AgentActivityRuntime | null;\n}\n\nexport function AgentActivityRuntimeProvider({\n children,\n runtime\n}: AgentActivityRuntimeProviderProps): JSX.Element {\n currentAgentActivityRuntime = runtime ?? null;\n return (\n <AgentActivityRuntimeContext.Provider value={runtime ?? null}>\n {children}\n </AgentActivityRuntimeContext.Provider>\n );\n}\n\nexport function useAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function useOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime()\n );\n}\n\nexport function useAgentActivitySnapshot(\n workspaceId: string\n): AgentActivitySnapshot {\n const runtime = useAgentActivityRuntime();\n const normalizedWorkspaceId = workspaceId.trim();\n return useSyncExternalStore(\n (listener) => runtime.subscribe(normalizedWorkspaceId, listener),\n () => runtime.getSnapshot(normalizedWorkspaceId),\n () => runtime.getSnapshot(normalizedWorkspaceId)\n );\n}\n\nexport function getAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime()\n );\n}\n\nexport function resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = null;\n }\n}\n\nexport function setAgentActivityRuntimeForTests(\n runtime: AgentActivityRuntime | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = runtime;\n }\n}\n\nfunction getTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitRuntime = getExplicitWindowTestAgentActivityRuntime();\n if (explicitRuntime) {\n return explicitRuntime;\n }\n if (currentAgentActivityRuntime) {\n return currentAgentActivityRuntime;\n }\n const testRuntime = (\n window as unknown as Window & {\n agentActivityRuntime?: AgentActivityRuntime;\n }\n ).agentActivityRuntime;\n return testRuntime ?? null;\n}\n\nfunction getExplicitWindowTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentActivityRuntime\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n return (testDescriptor.value as AgentActivityRuntime | undefined) ?? null;\n}\n","import {\n createContext,\n useContext,\n useMemo,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport {\n toAgentHostRuntimeApi,\n type AgentHostInputApi,\n type AgentHostRuntimeApi\n} from \"./host/agentHostApi\";\nimport {\n AgentActivityRuntimeProvider,\n type AgentActivityRuntime\n} from \"./agentActivityRuntime\";\n\nconst AgentActivityHostContext = createContext<AgentHostRuntimeApi | null>(\n null\n);\n\nlet currentAgentHostApi: AgentHostRuntimeApi | null = null;\n\nexport interface AgentActivityHostProviderProps extends PropsWithChildren {\n agentActivityRuntime?: AgentActivityRuntime | null;\n agentHostApi?: AgentHostInputApi | null;\n}\n\nexport function AgentActivityHostProvider({\n agentActivityRuntime,\n agentHostApi,\n children\n}: AgentActivityHostProviderProps): JSX.Element {\n const resolvedAgentHostApi = useMemo(\n () => (agentHostApi ? toAgentHostRuntimeApi(agentHostApi) : null),\n [agentHostApi]\n );\n currentAgentHostApi = resolvedAgentHostApi;\n return (\n <AgentActivityRuntimeProvider runtime={agentActivityRuntime}>\n <AgentActivityHostContext.Provider value={resolvedAgentHostApi}>\n {children}\n </AgentActivityHostContext.Provider>\n </AgentActivityRuntimeProvider>\n );\n}\n\nexport function useAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function useOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n}\n\nexport function getAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function getOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return (\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi()\n );\n}\n\nexport function resetAgentHostApiForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = null;\n }\n}\n\nexport function setAgentHostApiForTests(\n agentHostApi: AgentHostInputApi | AgentHostRuntimeApi | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = agentHostApi\n ? toAgentHostRuntimeApi(agentHostApi)\n : null;\n }\n}\n\nfunction getTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitAgentHostApi = getExplicitWindowTestAgentHostApi();\n if (explicitAgentHostApi) {\n return explicitAgentHostApi;\n }\n if (currentAgentHostApi) {\n return currentAgentHostApi;\n }\n const testAgentHostApi = (\n window as unknown as Window & {\n agentHostApi?: AgentHostInputApi | AgentHostRuntimeApi;\n }\n ).agentHostApi;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n\nfunction getExplicitWindowTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentHostApi\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n const testAgentHostApi = testDescriptor.value as\n | AgentHostInputApi\n | AgentHostRuntimeApi\n | undefined;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n","import type {\n AgentHostBatchUserInfoInput,\n AgentHostBatchUserInfoResult,\n AgentHostDeleteWorkspaceAgentSessionInput,\n AgentHostWorkspaceAgentListInput as AgentHostListWorkspaceAgentsInput,\n AgentHostListWorkspaceAgentProbesInput,\n AgentHostWorkspaceAgentSessionMessages,\n AgentHostWorkspaceAgentSessionMessagesInput,\n AgentHostWorkspaceAgentSessionSummary,\n AgentHostWorkspaceAgentSessionSummaryInput,\n AgentHostWorkspaceAgentProbesResult,\n AgentHostWorkspaceAgentSnapshot,\n PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n ReadWorkspaceFileResult as AgentHostReadWorkspaceFileResult,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\n} from \"../shared/contracts/dto\";\nimport type { WorkspaceUserProjectService } from \"@tutti-os/workspace-user-project/contracts\";\n\ntype AgentHostAsyncResult<T = any> = Promise<T>;\ntype AgentHostRecord = Record<string, unknown>;\ntype AgentHostUnsubscribe = () => void;\ntype AgentHostWorkspaceScopedInput<\n T extends {\n workspaceId?: string | null;\n }\n> = Omit<T, \"workspaceId\"> & {\n workspaceId: string;\n};\ntype AgentHostWorkspaceAgentsListInput =\n AgentHostWorkspaceScopedInput<AgentHostListWorkspaceAgentsInput>;\ntype AgentHostWorkspaceAgentSessionMessagesRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionMessagesInput>;\ntype AgentHostWorkspaceAgentSessionSummaryRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionSummaryInput>;\ntype AgentHostDeleteWorkspaceAgentSessionRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostDeleteWorkspaceAgentSessionInput>;\n\nexport type AgentHostClipboardApi = {\n writeText: (text: string) => AgentHostAsyncResult<void>;\n};\n\nexport type AgentHostDebugApi = {\n logRuntimeDiagnostics: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n logTerminalDiagnostics?: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n};\n\nexport type AgentHostFilesystemApi = AgentHostRecord & {\n readFileText: (payload: {\n path?: string;\n uri?: string;\n }) => AgentHostAsyncResult<{\n content: string;\n name?: string;\n path?: string;\n }>;\n};\n\nexport type AgentHostMetaApi = AgentHostRecord & {\n appVersion?: string | null;\n isPackaged?: boolean;\n isTest?: boolean;\n mainPid?: number | null;\n platform?: string;\n workspaceId?: string;\n};\n\nexport type AgentHostEnvironmentApi = AgentHostRecord & {\n getBaseUrl?: () => AgentHostAsyncResult<string>;\n warmupOpenclawGateway?: (input?: unknown) => AgentHostAsyncResult<unknown>;\n};\n\nexport type AgentHostPersistenceApi = AgentHostRecord & {\n readWorkspaceAgentReadState: (\n input: ReadWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<WorkspaceAgentReadStateSnapshot>;\n writeWorkspaceAgentReadState: (\n input: WriteWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<PersistWriteResult>;\n};\n\nexport interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport interface AgentHostSelectFilesInput {\n allowDirectories?: boolean;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getPathForFile: (file: File) => string;\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: (\n input?: AgentHostSelectFilesInput\n ) => AgentHostAsyncResult<AgentHostSelectedFile[]>;\n writeFileText: (input: {\n content: string;\n path: string;\n }) => AgentHostAsyncResult<unknown>;\n};\n\nexport interface AgentHostInputApi {\n account?: AgentHostAccountApi;\n agentGuiBatch?: AgentHostAgentGuiBatchApi;\n agentSessions?: AgentHostAgentSessionsApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n workspaceAgents?: AgentHostWorkspaceAgentsApi;\n}\n\nexport type AgentHostApi = AgentHostInputApi;\n\nexport type AgentHostAccountApi = AgentHostRecord & {\n batchGetUserInfo: (\n input: AgentHostBatchUserInfoInput\n ) => AgentHostAsyncResult<AgentHostBatchUserInfoResult>;\n ensureProfiles?: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostAgentGuiBatchApi = AgentHostRecord & {\n exportRun: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & {\n list: (\n input: AgentHostListWorkspaceAgentProbesInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentProbesResult>;\n};\n\nexport type AgentProviderProbeListInput =\n AgentHostListWorkspaceAgentProbesInput;\nexport type AgentProviderProbeListResult = AgentHostWorkspaceAgentProbesResult;\n\nexport interface AgentHostUserProject {\n id: string;\n path: string;\n label: string;\n createdAtUnixMs?: number;\n updatedAtUnixMs?: number;\n lastUsedAtUnixMs?: number;\n}\n\nexport type AgentHostUserProjectsApi = AgentHostRecord & {\n service?: WorkspaceUserProjectService;\n checkPath?: (input: { path: string }) => AgentHostAsyncResult<{\n exists: boolean;\n isDirectory: boolean;\n path: string;\n }>;\n create?: (input: {\n name: string;\n }) => AgentHostAsyncResult<AgentHostUserProject>;\n getDefaultSelection?: () => AgentHostAsyncResult<{\n path: string | null;\n } | null>;\n list: () => AgentHostAsyncResult<{\n projects: AgentHostUserProject[];\n }>;\n subscribe?: (listener: () => void) => AgentHostUnsubscribe;\n prepareSelection?: (input: {\n projectLocked: boolean;\n selectedPath: string | null;\n }) => AgentHostAsyncResult<{\n isSelectedPathMissing: boolean;\n projects: AgentHostUserProject[];\n selection:\n | {\n kind: \"clear\";\n suppressedPath: string;\n }\n | {\n kind: \"none\";\n }\n | {\n kind: \"select\";\n path: string;\n };\n }>;\n remove?: (input: { path: string }) => AgentHostAsyncResult<void>;\n isNoProjectPath?: (input: { path: string }) => boolean;\n rememberDefaultSelection?: (input: {\n path: string | null;\n }) => AgentHostAsyncResult<void>;\n use: (input: { path: string }) => AgentHostAsyncResult<AgentHostUserProject>;\n};\n\nexport type AgentHostAgentSessionsApi = AgentHostRecord & {\n activate: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.cancelSession.\n */\n cancel: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.sendInput.\n */\n exec: (input: any) => AgentHostAsyncResult<any>;\n getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;\n getState: (input: any) => AgentHostAsyncResult<any>;\n onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.setSessionPinned.\n */\n pinSession?: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n releaseEventStream?: (input?: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n retainEventStream?: (input: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.submitInteractive.\n */\n submitInteractive: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production UI must derive events from AgentActivityRuntime snapshots.\n */\n trackSettingsProjectChange?: (input: {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n }) => AgentHostAsyncResult<void>;\n subscribeEvents: (\n input: any,\n listener: (event: any) => void\n ) => AgentHostUnsubscribe;\n unactivate: (input: any) => AgentHostAsyncResult<any>;\n updateSettings: (input: any) => AgentHostAsyncResult<any>;\n};\n\n/**\n * @deprecated Legacy host DTO projection. AgentGUI production reads and writes\n * must use AgentActivityRuntime and AgentActivity* models.\n */\nexport type AgentHostWorkspaceAgentsApi = AgentHostRecord & {\n /**\n * @deprecated Use AgentActivityRuntime.deleteSession.\n */\n deleteSession: (\n input: AgentHostDeleteWorkspaceAgentSessionRuntimeInput\n ) => AgentHostAsyncResult<any>;\n /**\n * @deprecated Derive summaries from AgentActivitySnapshot/session messages.\n */\n getSessionSummary: (\n input: AgentHostWorkspaceAgentSessionSummaryRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionSummary>;\n /**\n * @deprecated Use AgentActivityRuntime.load/getSnapshot.\n */\n list: (\n input: string | AgentHostWorkspaceAgentsListInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSnapshot>;\n /**\n * @deprecated Use AgentActivityRuntime.listSessionMessages.\n */\n listSessionMessages: (\n input: AgentHostWorkspaceAgentSessionMessagesRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionMessages>;\n};\n\nexport interface AgentHostRuntimeApi {\n account?: AgentHostAccountApi;\n agentGuiBatch: AgentHostAgentGuiBatchApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n}\n\nexport function toAgentHostRuntimeApi(\n hostApi: AgentHostInputApi | AgentHostRuntimeApi\n): AgentHostRuntimeApi {\n return {\n account: hostApi.account,\n agentGuiBatch: hostApi.agentGuiBatch ?? ({} as AgentHostAgentGuiBatchApi),\n clipboard: hostApi.clipboard,\n debug: hostApi.debug,\n filesystem: hostApi.filesystem,\n meta: hostApi.meta,\n onHostEvent: hostApi.onHostEvent,\n persistence: hostApi.persistence,\n runtime: hostApi.runtime,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n"],"mappings":"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","names":["createContext","useContext","jsx","createContext","useContext"]}