@tutti-os/agent-gui 0.0.63 → 0.0.64

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 (88) hide show
  1. package/dist/agent-conversation/index.d.ts +2 -2
  2. package/dist/agent-conversation/index.js +7 -7
  3. package/dist/agent-env/index.js +2 -1
  4. package/dist/agent-env/index.js.map +1 -1
  5. package/dist/agent-message-center/index.js +9 -9
  6. package/dist/{agentGuiNodeTypes-CC52zXAV.d.ts → agentGuiNodeTypes-CCjzXdTe.d.ts} +4 -1
  7. package/dist/app/renderer/agentactivity.css +38 -4
  8. package/dist/app/renderer/assets/icons/agents/agent-colorful.png +0 -0
  9. package/dist/app/renderer/assets/icons/agents/cursor-colorful.png +0 -0
  10. package/dist/app/renderer/assets/icons/agents/cursor-flat-filled.svg +3 -0
  11. package/dist/app/renderer/assets/icons/agents/cursor-rounded.png +0 -0
  12. package/dist/{chunk-IIVHPXAB.js → chunk-2IMBPRKV.js} +1 -1
  13. package/dist/chunk-2IMBPRKV.js.map +1 -0
  14. package/dist/{chunk-4UTWOSHP.js → chunk-3NSUJ7OF.js} +5 -1
  15. package/dist/chunk-3NSUJ7OF.js.map +1 -0
  16. package/dist/{chunk-SGXYVGQT.js → chunk-52VZ54WH.js} +5 -5
  17. package/dist/{chunk-CVSCZ3CK.js → chunk-76GTKO4Q.js} +7 -2
  18. package/dist/chunk-76GTKO4Q.js.map +1 -0
  19. package/dist/{chunk-G6UO6JVM.js → chunk-C465B7WK.js} +2 -2
  20. package/dist/{chunk-22L4VWUR.js → chunk-CKCUEHBW.js} +3 -1
  21. package/dist/chunk-CKCUEHBW.js.map +1 -0
  22. package/dist/{chunk-FRCIPTUD.js → chunk-ERWDRI3F.js} +8 -18
  23. package/dist/chunk-ERWDRI3F.js.map +1 -0
  24. package/dist/{chunk-6MUKWI6Z.js → chunk-F6GDUU4X.js} +167 -113
  25. package/dist/chunk-F6GDUU4X.js.map +1 -0
  26. package/dist/{chunk-FQQDBBNI.js → chunk-FLTLZGIN.js} +3 -3
  27. package/dist/{chunk-5WB3NGIN.js → chunk-FUJ73PTH.js} +29 -2
  28. package/dist/chunk-FUJ73PTH.js.map +1 -0
  29. package/dist/{chunk-RO6KQD3J.js → chunk-IIXCU2UU.js} +2 -2
  30. package/dist/{chunk-CA25GD5Q.js → chunk-MQ6RKXXW.js} +34 -4
  31. package/dist/chunk-MQ6RKXXW.js.map +1 -0
  32. package/dist/{chunk-NZN43XT5.js → chunk-PVVM7MZZ.js} +8 -6
  33. package/dist/chunk-PVVM7MZZ.js.map +1 -0
  34. package/dist/{chunk-V4JGVBUN.js → chunk-R2NGSPQS.js} +32 -1
  35. package/dist/chunk-R2NGSPQS.js.map +1 -0
  36. package/dist/{chunk-QC642RAG.js → chunk-RDRKIMAC.js} +15 -8
  37. package/dist/chunk-RDRKIMAC.js.map +1 -0
  38. package/dist/{chunk-ZUVEBW5T.js → chunk-TFPKI4XJ.js} +2 -2
  39. package/dist/{chunk-SW6JCJCO.js → chunk-TT2YJNEP.js} +3 -3
  40. package/dist/{chunk-K4UUEG7X.js → chunk-YFTQK2G4.js} +113 -34
  41. package/dist/chunk-YFTQK2G4.js.map +1 -0
  42. package/dist/{chunk-3KS22CG2.js → chunk-YUMHFZ5A.js} +3 -3
  43. package/dist/{chunk-7P6CUYQT.js → chunk-ZTZ6STJZ.js} +2 -2
  44. package/dist/context-mention-palette/index.js +8 -8
  45. package/dist/cursor-flat-filled-CL7N3BTZ.svg +3 -0
  46. package/dist/i18n/index.d.ts +33 -3
  47. package/dist/i18n/index.js +2 -2
  48. package/dist/index.d.ts +7 -5
  49. package/dist/index.js +666 -214
  50. package/dist/index.js.map +1 -1
  51. package/dist/queued-prompt-runtime.d.ts +2 -2
  52. package/dist/{types-DSc2ta3s.d.ts → types-BAPEle8b.d.ts} +3 -3
  53. package/dist/workbench/contribution.d.ts +10 -3
  54. package/dist/workbench/contribution.js +10 -8
  55. package/dist/workbench/index.d.ts +4 -2
  56. package/dist/workbench/index.js +11 -11
  57. package/dist/workbench/launch.d.ts +1 -1
  58. package/dist/workbench/launch.js +3 -3
  59. package/dist/workbench/providerCatalog.d.ts +2 -2
  60. package/dist/workbench/providerCatalog.js +1 -1
  61. package/dist/workbench/sessionTitle.d.ts +1 -1
  62. package/dist/workbench/sessionTitle.js +3 -3
  63. package/dist/workbench/state.d.ts +1 -1
  64. package/dist/workbench/state.js +3 -3
  65. package/dist/workbench/types.d.ts +3 -2
  66. package/dist/workbench/types.js +1 -1
  67. package/dist/workspace-agent-generated-files.js +3 -3
  68. package/package.json +12 -12
  69. package/dist/chunk-22L4VWUR.js.map +0 -1
  70. package/dist/chunk-4UTWOSHP.js.map +0 -1
  71. package/dist/chunk-5WB3NGIN.js.map +0 -1
  72. package/dist/chunk-6MUKWI6Z.js.map +0 -1
  73. package/dist/chunk-CA25GD5Q.js.map +0 -1
  74. package/dist/chunk-CVSCZ3CK.js.map +0 -1
  75. package/dist/chunk-FRCIPTUD.js.map +0 -1
  76. package/dist/chunk-IIVHPXAB.js.map +0 -1
  77. package/dist/chunk-K4UUEG7X.js.map +0 -1
  78. package/dist/chunk-NZN43XT5.js.map +0 -1
  79. package/dist/chunk-QC642RAG.js.map +0 -1
  80. package/dist/chunk-V4JGVBUN.js.map +0 -1
  81. /package/dist/{chunk-SGXYVGQT.js.map → chunk-52VZ54WH.js.map} +0 -0
  82. /package/dist/{chunk-G6UO6JVM.js.map → chunk-C465B7WK.js.map} +0 -0
  83. /package/dist/{chunk-FQQDBBNI.js.map → chunk-FLTLZGIN.js.map} +0 -0
  84. /package/dist/{chunk-RO6KQD3J.js.map → chunk-IIXCU2UU.js.map} +0 -0
  85. /package/dist/{chunk-ZUVEBW5T.js.map → chunk-TFPKI4XJ.js.map} +0 -0
  86. /package/dist/{chunk-SW6JCJCO.js.map → chunk-TT2YJNEP.js.map} +0 -0
  87. /package/dist/{chunk-3KS22CG2.js.map → chunk-YUMHFZ5A.js.map} +0 -0
  88. /package/dist/{chunk-7P6CUYQT.js.map → chunk-ZTZ6STJZ.js.map} +0 -0
@@ -2,6 +2,7 @@
2
2
  var agentGuiWorkbenchProviders = [
3
3
  "claude-code",
4
4
  "codex",
5
+ "cursor",
5
6
  "nexight",
6
7
  "hermes",
7
8
  "gemini",
@@ -30,6 +31,7 @@ var comingSoonProviderSet = new Set(
30
31
  var agentGuiWorkbenchProviderLabels = {
31
32
  "claude-code": "Claude Code",
32
33
  codex: "Codex",
34
+ cursor: "Cursor",
33
35
  gemini: "Gemini CLI",
34
36
  hermes: "Hermes Agent",
35
37
  nexight: "Nexight",
@@ -67,4 +69,4 @@ export {
67
69
  isAgentGuiWorkbenchProvider,
68
70
  normalizeAgentGuiWorkbenchProvider
69
71
  };
70
- //# sourceMappingURL=chunk-22L4VWUR.js.map
72
+ //# sourceMappingURL=chunk-CKCUEHBW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../workbench/providerCatalog.ts"],"sourcesContent":["import type { AgentGuiWorkbenchProvider } from \"./types.ts\";\n\nexport const agentGuiWorkbenchProviders = [\n \"claude-code\",\n \"codex\",\n \"cursor\",\n \"nexight\",\n \"hermes\",\n \"gemini\",\n \"openclaw\"\n] as const satisfies readonly AgentGuiWorkbenchProvider[];\n\nexport const agentGuiWorkbenchDefaultDockProviders = [\n \"codex\",\n \"claude-code\"\n] as const satisfies readonly AgentGuiWorkbenchProvider[];\n\nexport const agentGuiWorkbenchDockSuppressedProviders = [\n \"hermes\",\n \"gemini\"\n] as const satisfies readonly AgentGuiWorkbenchProvider[];\n\nexport const agentGuiWorkbenchComingSoonProviders = [\n \"nexight\"\n] as const satisfies readonly AgentGuiWorkbenchProvider[];\n\nconst defaultDockProviderSet = new Set<AgentGuiWorkbenchProvider>(\n agentGuiWorkbenchDefaultDockProviders\n);\nconst dockSuppressedProviderSet = new Set<AgentGuiWorkbenchProvider>(\n agentGuiWorkbenchDockSuppressedProviders\n);\nconst comingSoonProviderSet = new Set<AgentGuiWorkbenchProvider>(\n agentGuiWorkbenchComingSoonProviders\n);\n\n// i18n-check-ignore: provider brand names.\nexport const agentGuiWorkbenchProviderLabels: Record<\n AgentGuiWorkbenchProvider,\n string\n> = {\n \"claude-code\": \"Claude Code\",\n codex: \"Codex\",\n cursor: \"Cursor\",\n gemini: \"Gemini CLI\",\n hermes: \"Hermes Agent\",\n nexight: \"Nexight\",\n openclaw: \"OpenClaw\"\n};\n\nexport function resolveAgentGuiWorkbenchProviderLabel(\n provider: AgentGuiWorkbenchProvider\n): string {\n return agentGuiWorkbenchProviderLabels[provider];\n}\n\nexport function isAgentGuiWorkbenchDefaultDockProvider(\n provider: AgentGuiWorkbenchProvider\n): boolean {\n return defaultDockProviderSet.has(provider);\n}\n\nexport function isAgentGuiWorkbenchDockSuppressedProvider(\n provider: AgentGuiWorkbenchProvider\n): boolean {\n return dockSuppressedProviderSet.has(provider);\n}\n\nexport function isAgentGuiWorkbenchComingSoonProvider(\n provider: AgentGuiWorkbenchProvider\n): boolean {\n return comingSoonProviderSet.has(provider);\n}\n\nexport function isAgentGuiWorkbenchProvider(\n value: unknown\n): value is AgentGuiWorkbenchProvider {\n return (\n typeof value === \"string\" &&\n agentGuiWorkbenchProviders.includes(value as AgentGuiWorkbenchProvider)\n );\n}\n\nexport function normalizeAgentGuiWorkbenchProvider(\n value: unknown,\n fallbackProvider: AgentGuiWorkbenchProvider = \"codex\"\n): AgentGuiWorkbenchProvider {\n return isAgentGuiWorkbenchProvider(value) ? value : fallbackProvider;\n}\n"],"mappings":";AAEO,IAAM,6BAA6B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,wCAAwC;AAAA,EACnD;AAAA,EACA;AACF;AAEO,IAAM,2CAA2C;AAAA,EACtD;AAAA,EACA;AACF;AAEO,IAAM,uCAAuC;AAAA,EAClD;AACF;AAEA,IAAM,yBAAyB,IAAI;AAAA,EACjC;AACF;AACA,IAAM,4BAA4B,IAAI;AAAA,EACpC;AACF;AACA,IAAM,wBAAwB,IAAI;AAAA,EAChC;AACF;AAGO,IAAM,kCAGT;AAAA,EACF,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,SAAS,sCACd,UACQ;AACR,SAAO,gCAAgC,QAAQ;AACjD;AAEO,SAAS,uCACd,UACS;AACT,SAAO,uBAAuB,IAAI,QAAQ;AAC5C;AAEO,SAAS,0CACd,UACS;AACT,SAAO,0BAA0B,IAAI,QAAQ;AAC/C;AAEO,SAAS,sCACd,UACS;AACT,SAAO,sBAAsB,IAAI,QAAQ;AAC3C;AAEO,SAAS,4BACd,OACoC;AACpC,SACE,OAAO,UAAU,YACjB,2BAA2B,SAAS,KAAkC;AAE1E;AAEO,SAAS,mCACd,OACA,mBAA8C,SACnB;AAC3B,SAAO,4BAA4B,KAAK,IAAI,QAAQ;AACtD;","names":[]}
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  claudeRoundedUrl,
3
3
  codexRoundedUrl,
4
+ cursorColorfulUrl,
5
+ cursorRoundedUrl,
4
6
  geminiRoundedUrl,
5
7
  hermesRoundedUrl,
6
8
  manageAgentClaudeCodeUrl,
@@ -9,13 +11,14 @@ import {
9
11
  manageAgentHermesUrl,
10
12
  manageAgentOpenclawUrl,
11
13
  manageAgentTuttiUrl,
14
+ normalizeManagedAgentProvider,
12
15
  openclawRoundedUrl,
13
16
  providerRailClaudeCodeColorfulUrl,
14
17
  providerRailCodexColorfulUrl,
15
18
  providerRailHermesColorfulUrl,
16
19
  providerRailTuttiUrl,
17
20
  tuttiDocRoundedUrl
18
- } from "./chunk-V4JGVBUN.js";
21
+ } from "./chunk-R2NGSPQS.js";
19
22
 
20
23
  // shared/agentCustomMentionKinds.ts
21
24
  var registry = /* @__PURE__ */ new Map();
@@ -236,25 +239,11 @@ function getExplicitWindowTestAgentHostApi() {
236
239
  return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;
237
240
  }
238
241
 
239
- // shared/managedAgentProviders.ts
240
- function normalizeManagedAgentProvider(provider) {
241
- const normalized = provider?.trim().toLowerCase().replace(/[_\s]+/gu, "-") ?? "";
242
- switch (normalized) {
243
- case "claude":
244
- case "claude-code":
245
- return "claude-code";
246
- case "nexight":
247
- case "tutti-doc":
248
- return "tutti";
249
- default:
250
- return normalized;
251
- }
252
- }
253
-
254
242
  // shared/managedAgentIcons.ts
255
243
  var MANAGED_AGENT_ICON_URLS = {
256
244
  "claude-code": manageAgentClaudeCodeUrl,
257
245
  codex: manageAgentCodexUrl,
246
+ cursor: cursorRoundedUrl,
258
247
  gemini: manageAgentGeminiUrl,
259
248
  hermes: manageAgentHermesUrl,
260
249
  tutti: manageAgentTuttiUrl,
@@ -263,12 +252,14 @@ var MANAGED_AGENT_ICON_URLS = {
263
252
  var MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS = {
264
253
  "claude-code": providerRailClaudeCodeColorfulUrl,
265
254
  codex: providerRailCodexColorfulUrl,
255
+ cursor: cursorColorfulUrl,
266
256
  hermes: providerRailHermesColorfulUrl,
267
257
  tutti: providerRailTuttiUrl
268
258
  };
269
259
  var MANAGED_AGENT_ICON_ROUNDED_URLS = {
270
260
  "claude-code": claudeRoundedUrl,
271
261
  codex: codexRoundedUrl,
262
+ cursor: cursorRoundedUrl,
272
263
  gemini: geminiRoundedUrl,
273
264
  hermes: hermesRoundedUrl,
274
265
  tutti: tuttiDocRoundedUrl,
@@ -296,10 +287,9 @@ export {
296
287
  useAgentHostApi,
297
288
  useOptionalAgentHostApi,
298
289
  getOptionalAgentHostApi,
299
- normalizeManagedAgentProvider,
300
290
  MANAGED_AGENT_ICON_URLS,
301
291
  MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS,
302
292
  MANAGED_AGENT_ICON_FALLBACK_URL,
303
293
  managedAgentRoundedIconUrl
304
294
  };
305
- //# sourceMappingURL=chunk-FRCIPTUD.js.map
295
+ //# sourceMappingURL=chunk-ERWDRI3F.js.map
@@ -0,0 +1 @@
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 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\";\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 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\nexport interface AgentActivityRuntimeProviderProps extends PropsWithChildren {\n runtime?: AgentActivityRuntime | null;\n}\n\nexport function AgentActivityRuntimeProvider({\n children,\n runtime\n}: AgentActivityRuntimeProviderProps): JSX.Element {\n currentAgentActivityRuntime = runtime ?? null;\n return (\n <AgentActivityRuntimeContext.Provider value={runtime ?? null}>\n {children}\n </AgentActivityRuntimeContext.Provider>\n );\n}\n\nexport function useAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function useOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime()\n );\n}\n\nexport function useAgentActivitySnapshot(\n workspaceId: string\n): AgentActivitySnapshot {\n const runtime = useAgentActivityRuntime();\n const normalizedWorkspaceId = workspaceId.trim();\n return useSyncExternalStore(\n (listener) => runtime.subscribe(normalizedWorkspaceId, listener),\n () => runtime.getSnapshot(normalizedWorkspaceId),\n () => runtime.getSnapshot(normalizedWorkspaceId)\n );\n}\n\nexport function getAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime()\n );\n}\n\nexport function resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = null;\n }\n}\n\nexport function setAgentActivityRuntimeForTests(\n runtime: AgentActivityRuntime | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = runtime;\n }\n}\n\nfunction getTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitRuntime = getExplicitWindowTestAgentActivityRuntime();\n if (explicitRuntime) {\n return explicitRuntime;\n }\n if (currentAgentActivityRuntime) {\n return currentAgentActivityRuntime;\n }\n const testRuntime = (\n window as unknown as Window & {\n agentActivityRuntime?: AgentActivityRuntime;\n }\n ).agentActivityRuntime;\n return testRuntime ?? null;\n}\n\nfunction getExplicitWindowTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentActivityRuntime\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n return (testDescriptor.value as AgentActivityRuntime | undefined) ?? null;\n}\n","import {\n createContext,\n useContext,\n useMemo,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport {\n toAgentHostRuntimeApi,\n type AgentHostInputApi,\n type AgentHostRuntimeApi\n} from \"./host/agentHostApi\";\nimport {\n AgentActivityRuntimeProvider,\n type AgentActivityRuntime\n} from \"./agentActivityRuntime\";\n\nconst AgentActivityHostContext = createContext<AgentHostRuntimeApi | null>(\n null\n);\n\nlet currentAgentHostApi: AgentHostRuntimeApi | null = null;\n\nexport interface AgentActivityHostProviderProps extends PropsWithChildren {\n agentActivityRuntime?: AgentActivityRuntime | null;\n agentHostApi?: AgentHostInputApi | null;\n}\n\nexport function AgentActivityHostProvider({\n agentActivityRuntime,\n agentHostApi,\n children\n}: AgentActivityHostProviderProps): JSX.Element {\n const resolvedAgentHostApi = useMemo(\n () => (agentHostApi ? toAgentHostRuntimeApi(agentHostApi) : null),\n [agentHostApi]\n );\n currentAgentHostApi = resolvedAgentHostApi;\n return (\n <AgentActivityRuntimeProvider runtime={agentActivityRuntime}>\n <AgentActivityHostContext.Provider value={resolvedAgentHostApi}>\n {children}\n </AgentActivityHostContext.Provider>\n </AgentActivityRuntimeProvider>\n );\n}\n\nexport function useAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function useOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n}\n\nexport function getAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function getOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return (\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi()\n );\n}\n\nexport function resetAgentHostApiForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = null;\n }\n}\n\nexport function setAgentHostApiForTests(\n agentHostApi: AgentHostInputApi | AgentHostRuntimeApi | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = agentHostApi\n ? toAgentHostRuntimeApi(agentHostApi)\n : null;\n }\n}\n\nfunction getTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitAgentHostApi = getExplicitWindowTestAgentHostApi();\n if (explicitAgentHostApi) {\n return explicitAgentHostApi;\n }\n if (currentAgentHostApi) {\n return currentAgentHostApi;\n }\n const testAgentHostApi = (\n window as unknown as Window & {\n agentHostApi?: AgentHostInputApi | AgentHostRuntimeApi;\n }\n ).agentHostApi;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n\nfunction getExplicitWindowTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentHostApi\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n const testAgentHostApi = testDescriptor.value as\n | AgentHostInputApi\n | AgentHostRuntimeApi\n | undefined;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n","import type {\n AgentHostBatchUserInfoInput,\n AgentHostBatchUserInfoResult,\n AgentHostDeleteWorkspaceAgentSessionInput,\n AgentHostWorkspaceAgentListInput as AgentHostListWorkspaceAgentsInput,\n AgentHostListWorkspaceAgentProbesInput,\n AgentHostWorkspaceAgentSessionMessages,\n AgentHostWorkspaceAgentSessionMessagesInput,\n AgentHostWorkspaceAgentSessionSummary,\n AgentHostWorkspaceAgentSessionSummaryInput,\n AgentHostWorkspaceAgentProbesResult,\n AgentHostWorkspaceAgentSnapshot,\n PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n ReadWorkspaceFileResult as AgentHostReadWorkspaceFileResult,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\n} from \"../shared/contracts/dto\";\nimport type { WorkspaceUserProjectService } from \"@tutti-os/workspace-user-project/contracts\";\n\ntype AgentHostAsyncResult<T = any> = Promise<T>;\ntype AgentHostRecord = Record<string, unknown>;\ntype AgentHostUnsubscribe = () => void;\ntype AgentHostWorkspaceScopedInput<\n T extends {\n workspaceId?: string | null;\n }\n> = Omit<T, \"workspaceId\"> & {\n workspaceId: string;\n};\ntype AgentHostWorkspaceAgentsListInput =\n AgentHostWorkspaceScopedInput<AgentHostListWorkspaceAgentsInput>;\ntype AgentHostWorkspaceAgentSessionMessagesRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionMessagesInput>;\ntype AgentHostWorkspaceAgentSessionSummaryRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionSummaryInput>;\ntype AgentHostDeleteWorkspaceAgentSessionRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostDeleteWorkspaceAgentSessionInput>;\n\nexport type AgentHostClipboardApi = {\n writeImage?: (input: {\n data: string;\n mimeType: \"image/png\";\n }) => AgentHostAsyncResult<void>;\n writeText: (text: string) => AgentHostAsyncResult<void>;\n};\n\nexport type AgentHostDebugApi = {\n logRuntimeDiagnostics: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n logTerminalDiagnostics?: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n};\n\nexport type AgentHostFilesystemApi = AgentHostRecord & {\n readFileText: (payload: {\n path?: string;\n uri?: string;\n }) => AgentHostAsyncResult<{\n content: string;\n name?: string;\n path?: string;\n }>;\n};\n\nexport type AgentHostMetaApi = AgentHostRecord & {\n appVersion?: string | null;\n isPackaged?: boolean;\n isTest?: boolean;\n mainPid?: number | null;\n platform?: string;\n workspaceId?: string;\n};\n\nexport type AgentHostEnvironmentApi = AgentHostRecord & {\n getBaseUrl?: () => AgentHostAsyncResult<string>;\n warmupOpenclawGateway?: (input?: unknown) => AgentHostAsyncResult<unknown>;\n};\n\nexport type AgentHostPersistenceApi = AgentHostRecord & {\n readWorkspaceAgentReadState: (\n input: ReadWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<WorkspaceAgentReadStateSnapshot>;\n writeWorkspaceAgentReadState: (\n input: WriteWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<PersistWriteResult>;\n};\n\nexport type AgentHostToastApi = AgentHostRecord & {\n error: (title: string, description?: string) => void;\n info?: (title: string, description?: string) => void;\n success?: (title: string, description?: string) => void;\n};\n\nexport interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport interface AgentHostSelectFilesInput {\n allowDirectories?: boolean;\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchInput {\n allowBinary?: boolean;\n atomic?: boolean;\n cwd: string;\n diff: string;\n revert?: boolean;\n target?: \"unstaged\" | \"staged\" | \"staged-and-unstaged\";\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchResult {\n status: \"success\" | \"partial-success\" | \"error\";\n appliedPaths: string[];\n skippedPaths: string[];\n conflictedPaths: string[];\n errorCode?: \"not-git-repo\" | string;\n execOutput?: {\n command: string;\n stdout: string;\n stderr: string;\n };\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportInput {\n cwd: string;\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportResult {\n supported: boolean;\n root?: string;\n errorCode?: \"not-git-repo\" | string;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n applyGitPatch?: (\n input: AgentHostApplyWorkspaceGitPatchInput\n ) => AgentHostAsyncResult<AgentHostApplyWorkspaceGitPatchResult>;\n resolveGitPatchSupport?: (\n input: AgentHostResolveWorkspaceGitPatchSupportInput\n ) => AgentHostAsyncResult<AgentHostResolveWorkspaceGitPatchSupportResult>;\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getReferenceForFile?: (file: File) => {\n kind: \"file\" | \"folder\";\n path: string;\n };\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: (\n input?: AgentHostSelectFilesInput\n ) => AgentHostAsyncResult<AgentHostSelectedFile[]>;\n writeFileText: (input: {\n content: string;\n path: string;\n }) => AgentHostAsyncResult<unknown>;\n};\n\nexport interface AgentHostInputApi {\n account?: AgentHostAccountApi;\n agentGuiBatch?: AgentHostAgentGuiBatchApi;\n agentSessions?: AgentHostAgentSessionsApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n workspaceAgents?: AgentHostWorkspaceAgentsApi;\n}\n\nexport type AgentHostApi = AgentHostInputApi;\n\nexport type AgentHostAccountApi = AgentHostRecord & {\n batchGetUserInfo: (\n input: AgentHostBatchUserInfoInput\n ) => AgentHostAsyncResult<AgentHostBatchUserInfoResult>;\n ensureProfiles?: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostAgentGuiBatchApi = AgentHostRecord & {\n exportRun: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & {\n list: (\n input: AgentHostListWorkspaceAgentProbesInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentProbesResult>;\n};\n\nexport type AgentProviderProbeListInput =\n AgentHostListWorkspaceAgentProbesInput;\nexport type AgentProviderProbeListResult = AgentHostWorkspaceAgentProbesResult;\n\nexport interface AgentHostUserProject {\n id: string;\n path: string;\n label: string;\n createdAtUnixMs?: number;\n updatedAtUnixMs?: number;\n lastUsedAtUnixMs?: number;\n}\n\nexport type AgentHostUserProjectsApi = AgentHostRecord & {\n service?: WorkspaceUserProjectService;\n checkPath?: (input: { path: string }) => AgentHostAsyncResult<{\n exists: boolean;\n isDirectory: boolean;\n path: string;\n }>;\n create?: (input: {\n name: string;\n }) => AgentHostAsyncResult<AgentHostUserProject>;\n getDefaultSelection?: () => AgentHostAsyncResult<{\n path: string | null;\n } | null>;\n list: () => AgentHostAsyncResult<{\n projects: AgentHostUserProject[];\n }>;\n subscribe?: (listener: () => void) => AgentHostUnsubscribe;\n prepareSelection?: (input: {\n projectLocked: boolean;\n selectedPath: string | null;\n }) => AgentHostAsyncResult<{\n isSelectedPathMissing: boolean;\n projects: AgentHostUserProject[];\n selection:\n | {\n kind: \"clear\";\n suppressedPath: string;\n }\n | {\n kind: \"none\";\n }\n | {\n kind: \"select\";\n path: string;\n };\n }>;\n remove?: (input: { path: string }) => AgentHostAsyncResult<void>;\n isNoProjectPath?: (input: { path: string }) => boolean;\n rememberDefaultSelection?: (input: {\n path: string | null;\n }) => AgentHostAsyncResult<void>;\n use: (input: { path: string }) => AgentHostAsyncResult<AgentHostUserProject>;\n};\n\nexport type AgentHostAgentSessionsApi = AgentHostRecord & {\n activate: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.cancelSession.\n */\n cancel: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.sendInput.\n */\n exec: (input: any) => AgentHostAsyncResult<any>;\n getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;\n getState: (input: any) => AgentHostAsyncResult<any>;\n onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.setSessionPinned.\n */\n pinSession?: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n releaseEventStream?: (input?: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n retainEventStream?: (input: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.submitInteractive.\n */\n submitInteractive: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production UI must derive events from AgentActivityRuntime snapshots.\n */\n trackSettingsProjectChange?: (input: {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n }) => AgentHostAsyncResult<void>;\n subscribeEvents: (\n input: any,\n listener: (event: any) => void\n ) => AgentHostUnsubscribe;\n unactivate: (input: any) => AgentHostAsyncResult<any>;\n updateSettings: (input: any) => AgentHostAsyncResult<any>;\n};\n\n/**\n * @deprecated Legacy host DTO projection. AgentGUI production reads and writes\n * must use AgentActivityRuntime and AgentActivity* models.\n */\nexport type AgentHostWorkspaceAgentsApi = AgentHostRecord & {\n /**\n * @deprecated Use AgentActivityRuntime.deleteSession.\n */\n deleteSession: (\n input: AgentHostDeleteWorkspaceAgentSessionRuntimeInput\n ) => AgentHostAsyncResult<any>;\n /**\n * @deprecated Derive summaries from AgentActivitySnapshot/session messages.\n */\n getSessionSummary: (\n input: AgentHostWorkspaceAgentSessionSummaryRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionSummary>;\n /**\n * @deprecated Use AgentActivityRuntime.load/getSnapshot.\n */\n list: (\n input: string | AgentHostWorkspaceAgentsListInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSnapshot>;\n /**\n * @deprecated Use AgentActivityRuntime.listSessionMessages.\n */\n listSessionMessages: (\n input: AgentHostWorkspaceAgentSessionMessagesRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionMessages>;\n};\n\nexport interface AgentHostRuntimeApi {\n account?: AgentHostAccountApi;\n agentGuiBatch: AgentHostAgentGuiBatchApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n}\n\nexport function toAgentHostRuntimeApi(\n hostApi: AgentHostInputApi | AgentHostRuntimeApi\n): AgentHostRuntimeApi {\n return {\n account: hostApi.account,\n agentGuiBatch: hostApi.agentGuiBatch ?? ({} as AgentHostAgentGuiBatchApi),\n clipboard: hostApi.clipboard,\n debug: hostApi.debug,\n filesystem: hostApi.filesystem,\n meta: hostApi.meta,\n onHostEvent: hostApi.onHostEvent,\n persistence: hostApi.persistence,\n runtime: hostApi.runtime,\n toast: hostApi.toast,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n","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: cursorRoundedUrl,\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":"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","names":["createContext","useContext","jsx","createContext","useContext"]}
@@ -15,7 +15,7 @@ import {
15
15
  resolveWorkspaceFilePathCandidate,
16
16
  resolveWorkspaceLinkAction,
17
17
  useAgentTargetPresentations
18
- } from "./chunk-SW6JCJCO.js";
18
+ } from "./chunk-TT2YJNEP.js";
19
19
  import {
20
20
  classifyFailedAgentMessage,
21
21
  openAgentEnvPanel,
@@ -28,7 +28,7 @@ import {
28
28
  formatAgentMentionMarkdown,
29
29
  mentionItemToAttrs,
30
30
  parseAgentMentionMarkdown
31
- } from "./chunk-FQQDBBNI.js";
31
+ } from "./chunk-FLTLZGIN.js";
32
32
  import {
33
33
  fileChangeCountFromChanges,
34
34
  fileChangeEntriesFromChanges,
@@ -38,14 +38,14 @@ import {
38
38
  import {
39
39
  getOptionalAgentActivityRuntime,
40
40
  useOptionalAgentHostApi
41
- } from "./chunk-FRCIPTUD.js";
41
+ } from "./chunk-ERWDRI3F.js";
42
42
  import {
43
43
  workspaceAgentProviderLabel
44
44
  } from "./chunk-TYGL25EL.js";
45
45
  import {
46
46
  getActiveUiLanguage,
47
47
  translate
48
- } from "./chunk-RO6KQD3J.js";
48
+ } from "./chunk-IIXCU2UU.js";
49
49
 
50
50
  // shared/workspaceAgentTimelineCanonical.ts
51
51
  import { isLiveTurnLifecyclePhase } from "@tutti-os/agent-activity-core";
@@ -228,6 +228,83 @@ function stringRecordValue(record, key) {
228
228
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
229
229
  }
230
230
 
231
+ // shared/workspaceAgentToolCallLabels.ts
232
+ var TOOL_ACTIVITY_KIND_TRANSLATION_KEYS = {
233
+ run_command: "agentHost.agentTool.labels.runCommand",
234
+ read_file: "agentHost.agentTool.labels.readFile",
235
+ write_file: "agentHost.agentTool.labels.writeFile",
236
+ edit_file: "agentHost.agentTool.labels.editFile",
237
+ list_files: "agentHost.agentTool.labels.listFiles",
238
+ search_files: "agentHost.agentTool.labels.searchFiles",
239
+ web_search: "agentHost.agentTool.labels.webSearch",
240
+ web_fetch: "agentHost.agentTool.labels.webFetch",
241
+ apply_patch: "agentHost.agentTool.labels.applyPatch",
242
+ use_tool: "agentHost.agentTool.labels.useTool",
243
+ find_files: "agentHost.agentTool.labels.findFiles",
244
+ read_command_output: "agentHost.agentTool.labels.readCommandOutput",
245
+ stop_command: "agentHost.agentTool.labels.stopCommand",
246
+ read_notebook: "agentHost.agentTool.labels.readNotebook",
247
+ edit_notebook: "agentHost.agentTool.labels.editNotebook",
248
+ update_todos: "agentHost.agentTool.labels.updateTodos",
249
+ delegate_agent: "agentHost.agentTool.labels.delegateAgent",
250
+ thinking: "agentHost.agentTool.labels.thinking",
251
+ responding: "agentHost.agentTool.labels.responding",
252
+ notification: "agentHost.agentTool.labels.notification"
253
+ };
254
+ var AGENT_ACTIVITY_KINDS = /* @__PURE__ */ new Set([
255
+ "thinking",
256
+ "responding",
257
+ "notification"
258
+ ]);
259
+ var TOOL_NAME_TRANSLATION_KEYS = {
260
+ bash: "agentHost.agentTool.labels.runCommand",
261
+ read: "agentHost.agentTool.labels.readFile",
262
+ write: "agentHost.agentTool.labels.writeFile",
263
+ edit: "agentHost.agentTool.labels.editFile",
264
+ glob: "agentHost.agentTool.labels.findFiles",
265
+ grep: "agentHost.agentTool.labels.searchFiles",
266
+ websearch: "agentHost.agentTool.labels.webSearch",
267
+ webfetch: "agentHost.agentTool.labels.webFetch",
268
+ todowrite: "agentHost.agentTool.labels.updateTodos",
269
+ task: "agentHost.agentTool.labels.delegateAgent",
270
+ currenttask: "agentHost.agentTool.labels.currentIssue",
271
+ agent: "agentHost.agentTool.labels.delegateAgent",
272
+ closeagent: "agentHost.agentTool.labels.closeAgent",
273
+ wait: "agentHost.agentTool.labels.waitAgent"
274
+ };
275
+ function legacyKindToToolName(kind) {
276
+ switch (kind) {
277
+ case "run_command":
278
+ case "read_command_output":
279
+ case "stop_command":
280
+ return "Bash";
281
+ case "read_file":
282
+ case "read_notebook":
283
+ case "list_files":
284
+ return "Read";
285
+ case "write_file":
286
+ return "Write";
287
+ case "edit_file":
288
+ case "edit_notebook":
289
+ case "apply_patch":
290
+ return "Edit";
291
+ case "find_files":
292
+ return "Glob";
293
+ case "search_files":
294
+ return "Grep";
295
+ case "web_search":
296
+ return "WebSearch";
297
+ case "web_fetch":
298
+ return "WebFetch";
299
+ case "update_todos":
300
+ return "TodoWrite";
301
+ case "delegate_agent":
302
+ return "Task";
303
+ default:
304
+ return null;
305
+ }
306
+ }
307
+
231
308
  // shared/workspaceAgentToolCallCanonical.ts
232
309
  function resolveCanonicalToolName(toolName) {
233
310
  const normalized = normalizeToolNameToken2(toolName);
@@ -280,9 +357,16 @@ function resolveCanonicalToolName(toolName) {
280
357
  case "agent":
281
358
  return "Agent";
282
359
  default:
283
- return null;
360
+ return resolveLegacySnakeCaseToolName(toolName);
284
361
  }
285
362
  }
363
+ function resolveLegacySnakeCaseToolName(toolName) {
364
+ const trimmed = toolName?.trim() ?? "";
365
+ if (!trimmed || !(trimmed in TOOL_ACTIVITY_KIND_TRANSLATION_KEYS)) {
366
+ return null;
367
+ }
368
+ return legacyKindToToolName(trimmed);
369
+ }
286
370
  function resolveLiveCanonicalToolName(item, rawPayloadToolName, legacyACPToolName) {
287
371
  const itemName = (item.name ?? "").trim();
288
372
  if (rawPayloadToolName && looksLikeOpaqueToolCallID(rawPayloadToolName, item)) {
@@ -383,7 +467,7 @@ function stringPayloadValue(value, key) {
383
467
  }
384
468
 
385
469
  // shared/workspaceAgentToolCallAgentActivity.ts
386
- var AGENT_ACTIVITY_KINDS = /* @__PURE__ */ new Set([
470
+ var AGENT_ACTIVITY_KINDS2 = /* @__PURE__ */ new Set([
387
471
  "thinking",
388
472
  "responding",
389
473
  "notification"
@@ -402,7 +486,7 @@ function isAgentActivityTimelineItem(item) {
402
486
  stringRecordValue2(metadata, "activity_kind")
403
487
  )
404
488
  );
405
- if (AGENT_ACTIVITY_KINDS.has(normalizedKind)) {
489
+ if (AGENT_ACTIVITY_KINDS2.has(normalizedKind)) {
406
490
  return true;
407
491
  }
408
492
  const normalizedName = (item.name ?? "").trim().toLowerCase().replace(/[.\-\s]+/gu, "_");
@@ -434,83 +518,6 @@ function firstPresentString2(...values) {
434
518
  ) ?? "";
435
519
  }
436
520
 
437
- // shared/workspaceAgentToolCallLabels.ts
438
- var TOOL_ACTIVITY_KIND_TRANSLATION_KEYS = {
439
- run_command: "agentHost.agentTool.labels.runCommand",
440
- read_file: "agentHost.agentTool.labels.readFile",
441
- write_file: "agentHost.agentTool.labels.writeFile",
442
- edit_file: "agentHost.agentTool.labels.editFile",
443
- list_files: "agentHost.agentTool.labels.listFiles",
444
- search_files: "agentHost.agentTool.labels.searchFiles",
445
- web_search: "agentHost.agentTool.labels.webSearch",
446
- web_fetch: "agentHost.agentTool.labels.webFetch",
447
- apply_patch: "agentHost.agentTool.labels.applyPatch",
448
- use_tool: "agentHost.agentTool.labels.useTool",
449
- find_files: "agentHost.agentTool.labels.findFiles",
450
- read_command_output: "agentHost.agentTool.labels.readCommandOutput",
451
- stop_command: "agentHost.agentTool.labels.stopCommand",
452
- read_notebook: "agentHost.agentTool.labels.readNotebook",
453
- edit_notebook: "agentHost.agentTool.labels.editNotebook",
454
- update_todos: "agentHost.agentTool.labels.updateTodos",
455
- delegate_agent: "agentHost.agentTool.labels.delegateAgent",
456
- thinking: "agentHost.agentTool.labels.thinking",
457
- responding: "agentHost.agentTool.labels.responding",
458
- notification: "agentHost.agentTool.labels.notification"
459
- };
460
- var AGENT_ACTIVITY_KINDS2 = /* @__PURE__ */ new Set([
461
- "thinking",
462
- "responding",
463
- "notification"
464
- ]);
465
- var TOOL_NAME_TRANSLATION_KEYS = {
466
- bash: "agentHost.agentTool.labels.runCommand",
467
- read: "agentHost.agentTool.labels.readFile",
468
- write: "agentHost.agentTool.labels.writeFile",
469
- edit: "agentHost.agentTool.labels.editFile",
470
- glob: "agentHost.agentTool.labels.findFiles",
471
- grep: "agentHost.agentTool.labels.searchFiles",
472
- websearch: "agentHost.agentTool.labels.webSearch",
473
- webfetch: "agentHost.agentTool.labels.webFetch",
474
- todowrite: "agentHost.agentTool.labels.updateTodos",
475
- task: "agentHost.agentTool.labels.delegateAgent",
476
- currenttask: "agentHost.agentTool.labels.currentIssue",
477
- agent: "agentHost.agentTool.labels.delegateAgent",
478
- closeagent: "agentHost.agentTool.labels.closeAgent",
479
- wait: "agentHost.agentTool.labels.waitAgent"
480
- };
481
- function legacyKindToToolName(kind) {
482
- switch (kind) {
483
- case "run_command":
484
- case "read_command_output":
485
- case "stop_command":
486
- return "Bash";
487
- case "read_file":
488
- case "read_notebook":
489
- case "list_files":
490
- return "Read";
491
- case "write_file":
492
- return "Write";
493
- case "edit_file":
494
- case "edit_notebook":
495
- case "apply_patch":
496
- return "Edit";
497
- case "find_files":
498
- return "Glob";
499
- case "search_files":
500
- return "Grep";
501
- case "web_search":
502
- return "WebSearch";
503
- case "web_fetch":
504
- return "WebFetch";
505
- case "update_todos":
506
- return "TodoWrite";
507
- case "delegate_agent":
508
- return "Task";
509
- default:
510
- return null;
511
- }
512
- }
513
-
514
521
  // shared/workspaceAgentToolCallDisplay.ts
515
522
  function isWorkspaceAgentToolCallItem(item) {
516
523
  const itemType = item.itemType.trim().toLowerCase();
@@ -626,7 +633,7 @@ function resolveLegacyToolName(item) {
626
633
  const metadata = recordValue3(item.payload, "metadata");
627
634
  const rawKind = stringRecordValue3(item.payload, "activityKind") ?? stringRecordValue3(item.payload, "activity_kind") ?? stringRecordValue3(metadata, "activityKind") ?? stringRecordValue3(metadata, "activity_kind");
628
635
  const normalizedKind = normalizeToolToken2(rawKind);
629
- if (AGENT_ACTIVITY_KINDS2.has(normalizedKind)) {
636
+ if (AGENT_ACTIVITY_KINDS.has(normalizedKind)) {
630
637
  return null;
631
638
  }
632
639
  if (isToolActivityKind(normalizedKind)) {
@@ -5385,6 +5392,10 @@ function selectPendingApproval(rows) {
5385
5392
  continue;
5386
5393
  }
5387
5394
  for (const call of toolCallsFromRow(row).reverse()) {
5395
+ const nestedApproval = pendingApprovalFromNestedTask(call);
5396
+ if (nestedApproval) {
5397
+ return nestedApproval;
5398
+ }
5388
5399
  const approval = call.approval ?? fallbackApprovalFromCall(call);
5389
5400
  if (approval && normalizeApprovalPendingStatus(
5390
5401
  approval.status ?? call.status,
@@ -5396,41 +5407,81 @@ function selectPendingApproval(rows) {
5396
5407
  }
5397
5408
  return null;
5398
5409
  }
5410
+ function pendingApprovalFromNestedTask(call) {
5411
+ if (!call.task) {
5412
+ return null;
5413
+ }
5414
+ for (const step of [...call.task.steps].reverse()) {
5415
+ const stepCall = step.tool;
5416
+ if (!stepCall) {
5417
+ continue;
5418
+ }
5419
+ const nestedApproval = pendingApprovalFromNestedTask(stepCall);
5420
+ if (nestedApproval) {
5421
+ return nestedApproval;
5422
+ }
5423
+ const approval = stepCall.approval ?? fallbackApprovalFromCall(stepCall);
5424
+ if (approval && normalizeApprovalPendingStatus(
5425
+ approval.status ?? stepCall.status,
5426
+ stepCall.statusKind
5427
+ ) && !approval.output) {
5428
+ return approval;
5429
+ }
5430
+ }
5431
+ return null;
5432
+ }
5399
5433
  function selectPendingInteractivePrompt(rows) {
5400
5434
  for (const row of [...rows].reverse()) {
5401
5435
  if (row.kind !== "tool-group") {
5402
5436
  continue;
5403
5437
  }
5404
5438
  for (const call of toolCallsFromRow(row).reverse()) {
5405
- if (call.askUserQuestion && normalizeInteractivePendingStatus(
5406
- call.askUserQuestion.status ?? call.status,
5407
- call.statusKind
5408
- ) && call.askUserQuestion.questions.some(
5409
- (question) => question.answer === null
5410
- )) {
5411
- return {
5412
- kind: "ask-user",
5413
- requestId: call.askUserQuestion.requestId,
5414
- title: call.askUserQuestion.title,
5415
- questions: call.askUserQuestion.questions
5416
- };
5417
- }
5418
- if (call.planMode?.kind === "exit" && normalizeInteractivePendingStatus(
5419
- call.planMode.status ?? call.status,
5420
- call.statusKind
5421
- )) {
5422
- return {
5423
- kind: "exit-plan",
5424
- requestId: call.planMode.requestId ?? call.id.replace(/^call:/, ""),
5425
- title: call.planMode.title,
5426
- options: call.planMode.options ?? [],
5427
- ...call.planMode.keepPlanningOptionId ? { keepPlanningOptionId: call.planMode.keepPlanningOptionId } : {}
5428
- };
5439
+ const prompt = pendingInteractivePromptFromCall(call);
5440
+ if (prompt) {
5441
+ return prompt;
5429
5442
  }
5430
5443
  }
5431
5444
  }
5432
5445
  return null;
5433
5446
  }
5447
+ function pendingInteractivePromptFromCall(call) {
5448
+ if (call.askUserQuestion && normalizeInteractivePendingStatus(
5449
+ call.askUserQuestion.status ?? call.status,
5450
+ call.statusKind
5451
+ ) && call.askUserQuestion.questions.some((question) => question.answer === null)) {
5452
+ return {
5453
+ kind: "ask-user",
5454
+ requestId: call.askUserQuestion.requestId,
5455
+ title: call.askUserQuestion.title,
5456
+ questions: call.askUserQuestion.questions
5457
+ };
5458
+ }
5459
+ if (call.planMode?.kind === "exit" && normalizeInteractivePendingStatus(
5460
+ call.planMode.status ?? call.status,
5461
+ call.statusKind
5462
+ )) {
5463
+ return {
5464
+ kind: "exit-plan",
5465
+ requestId: call.planMode.requestId ?? call.id.replace(/^call:/, ""),
5466
+ title: call.planMode.title,
5467
+ options: call.planMode.options ?? [],
5468
+ ...call.planMode.keepPlanningOptionId ? { keepPlanningOptionId: call.planMode.keepPlanningOptionId } : {}
5469
+ };
5470
+ }
5471
+ if (!call.task) {
5472
+ return null;
5473
+ }
5474
+ for (const step of [...call.task.steps].reverse()) {
5475
+ if (!step.tool) {
5476
+ continue;
5477
+ }
5478
+ const prompt = pendingInteractivePromptFromCall(step.tool);
5479
+ if (prompt) {
5480
+ return prompt;
5481
+ }
5482
+ }
5483
+ return null;
5484
+ }
5434
5485
  function toolCallsFromRow(row) {
5435
5486
  return row.calls.length > 0 ? [...row.calls] : row.entries.flatMap(
5436
5487
  (entry) => entry.kind === "tool-call" ? [entry.call] : []
@@ -10820,7 +10871,7 @@ function fileNameFromPath2(path) {
10820
10871
  }
10821
10872
  function flatLineClassName(kind) {
10822
10873
  if (kind === "add") {
10823
- return "agent-tool-diff__line grid grid-cols-[48px_minmax(0,1fr)] border-l-[2px] border-l-[var(--state-success)] font-[var(--tsh-font-mono)] text-[11px] leading-6";
10874
+ return "grid grid-cols-[48px_minmax(0,1fr)] border-l-[2px] border-l-[var(--state-success)] bg-[color:color-mix(in_srgb,var(--state-success)_10%,transparent)] font-[var(--tsh-font-mono)] text-[11px] leading-6";
10824
10875
  }
10825
10876
  if (kind === "remove") {
10826
10877
  return "grid grid-cols-[48px_minmax(0,1fr)] border-l-[2px] border-l-[var(--state-danger)] bg-[color:color-mix(in_srgb,var(--state-danger)_10%,transparent)] font-[var(--tsh-font-mono)] text-[11px] leading-6";
@@ -12889,8 +12940,11 @@ function subAgentStatusLabel(status) {
12889
12940
  return translate("agentHost.agentTool.statusWorking");
12890
12941
  }
12891
12942
  }
12943
+ function isSubAgentActivelyRunning(subAgent) {
12944
+ return subAgent.status === "running" && !subAgent.queued;
12945
+ }
12892
12946
  function useRunningSubAgentNowUnixMs(subAgent) {
12893
- const shouldTick = subAgent.status === "running" && typeof subAgent.startedAtUnixMs === "number";
12947
+ const shouldTick = isSubAgentActivelyRunning(subAgent) && typeof subAgent.startedAtUnixMs === "number";
12894
12948
  const [nowUnixMs, setNowUnixMs] = useState14(
12895
12949
  () => shouldTick ? Date.now() : null
12896
12950
  );
@@ -12913,7 +12967,7 @@ function subAgentElapsedText(subAgent, runningNowUnixMs) {
12913
12967
  }
12914
12968
  const terminal = subAgent.terminalAtUnixMs;
12915
12969
  const latest = subAgent.latestActivityAtUnixMs;
12916
- const ended = typeof terminal === "number" ? terminal : subAgent.status === "running" && typeof runningNowUnixMs === "number" ? Math.max(latest ?? started, runningNowUnixMs) : latest;
12970
+ const ended = typeof terminal === "number" ? terminal : isSubAgentActivelyRunning(subAgent) && typeof runningNowUnixMs === "number" ? Math.max(latest ?? started, runningNowUnixMs) : latest;
12917
12971
  if (typeof ended !== "number" || ended <= started) {
12918
12972
  return null;
12919
12973
  }
@@ -15053,4 +15107,4 @@ export {
15053
15107
  AgentConversationFlow,
15054
15108
  useProjectedAgentConversation
15055
15109
  };
15056
- //# sourceMappingURL=chunk-6MUKWI6Z.js.map
15110
+ //# sourceMappingURL=chunk-F6GDUU4X.js.map