@agent-native/core 0.118.1 → 0.119.0

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 (131) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +11 -0
  3. package/corpus/core/docs/content/a2a-protocol.mdx +15 -0
  4. package/corpus/core/docs/content/template-chat.mdx +1 -1
  5. package/corpus/core/docs/content/template-plan.mdx +3 -3
  6. package/corpus/core/package.json +1 -1
  7. package/corpus/core/src/a2a/activity.ts +371 -0
  8. package/corpus/core/src/a2a/client.ts +3 -1
  9. package/corpus/core/src/a2a/index.ts +21 -0
  10. package/corpus/core/src/a2a/types.ts +8 -0
  11. package/corpus/core/src/agent/model-config.ts +19 -23
  12. package/corpus/core/src/agent/production-agent.ts +167 -100
  13. package/corpus/core/src/agent/types.ts +16 -1
  14. package/corpus/core/src/client/chat/tool-call-display.tsx +190 -35
  15. package/corpus/core/src/client/chat-model-groups.ts +67 -27
  16. package/corpus/core/src/client/sharing/ShareButton.tsx +1 -27
  17. package/corpus/core/src/client/sharing/ShareDialog.tsx +0 -16
  18. package/corpus/core/src/client/sharing/useShareButtonController.ts +0 -7
  19. package/corpus/core/src/client/sharing/useShareDialogController.ts +0 -2
  20. package/corpus/core/src/client/sse-event-processor.ts +85 -1
  21. package/corpus/core/src/localization/default-messages.ts +6 -0
  22. package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +1 -18
  23. package/corpus/core/src/scripts/call-agent.ts +49 -6
  24. package/corpus/core/src/server/agent-chat-plugin.ts +50 -10
  25. package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -0
  26. package/corpus/templates/clips/changelog/2026-07-23-fixed-recordings-failing-to-save-with-a-cancelled-or-cleanup.md +6 -0
  27. package/corpus/templates/clips/server/plugins/db.ts +9 -1
  28. package/dist/a2a/activity.d.ts +50 -0
  29. package/dist/a2a/activity.d.ts.map +1 -0
  30. package/dist/a2a/activity.js +236 -0
  31. package/dist/a2a/activity.js.map +1 -0
  32. package/dist/a2a/client.d.ts +2 -0
  33. package/dist/a2a/client.d.ts.map +1 -1
  34. package/dist/a2a/client.js +1 -1
  35. package/dist/a2a/client.js.map +1 -1
  36. package/dist/a2a/index.d.ts +2 -1
  37. package/dist/a2a/index.d.ts.map +1 -1
  38. package/dist/a2a/index.js +1 -0
  39. package/dist/a2a/index.js.map +1 -1
  40. package/dist/a2a/types.d.ts +1 -0
  41. package/dist/a2a/types.d.ts.map +1 -1
  42. package/dist/a2a/types.js.map +1 -1
  43. package/dist/agent/engine/anthropic-engine.d.ts +1 -1
  44. package/dist/agent/engine/builder-engine.d.ts +2 -2
  45. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  46. package/dist/agent/model-config.d.ts +16 -16
  47. package/dist/agent/model-config.d.ts.map +1 -1
  48. package/dist/agent/model-config.js +19 -23
  49. package/dist/agent/model-config.js.map +1 -1
  50. package/dist/agent/production-agent.d.ts +26 -0
  51. package/dist/agent/production-agent.d.ts.map +1 -1
  52. package/dist/agent/production-agent.js +137 -80
  53. package/dist/agent/production-agent.js.map +1 -1
  54. package/dist/agent/types.d.ts +10 -0
  55. package/dist/agent/types.d.ts.map +1 -1
  56. package/dist/agent/types.js.map +1 -1
  57. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  58. package/dist/client/chat/tool-call-display.js +63 -14
  59. package/dist/client/chat/tool-call-display.js.map +1 -1
  60. package/dist/client/chat-model-groups.d.ts.map +1 -1
  61. package/dist/client/chat-model-groups.js +44 -21
  62. package/dist/client/chat-model-groups.js.map +1 -1
  63. package/dist/client/sharing/ShareButton.d.ts +1 -1
  64. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  65. package/dist/client/sharing/ShareButton.js +3 -4
  66. package/dist/client/sharing/ShareButton.js.map +1 -1
  67. package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
  68. package/dist/client/sharing/ShareDialog.js +1 -2
  69. package/dist/client/sharing/ShareDialog.js.map +1 -1
  70. package/dist/client/sharing/useShareButtonController.d.ts +0 -1
  71. package/dist/client/sharing/useShareButtonController.d.ts.map +1 -1
  72. package/dist/client/sharing/useShareButtonController.js +0 -6
  73. package/dist/client/sharing/useShareButtonController.js.map +1 -1
  74. package/dist/client/sharing/useShareDialogController.d.ts +0 -1
  75. package/dist/client/sharing/useShareDialogController.d.ts.map +1 -1
  76. package/dist/client/sharing/useShareDialogController.js +0 -1
  77. package/dist/client/sharing/useShareDialogController.js.map +1 -1
  78. package/dist/client/sse-event-processor.d.ts +12 -0
  79. package/dist/client/sse-event-processor.d.ts.map +1 -1
  80. package/dist/client/sse-event-processor.js +63 -1
  81. package/dist/client/sse-event-processor.js.map +1 -1
  82. package/dist/collab/awareness.d.ts +2 -2
  83. package/dist/collab/awareness.d.ts.map +1 -1
  84. package/dist/collab/routes.d.ts +1 -1
  85. package/dist/collab/struct-routes.d.ts +1 -1
  86. package/dist/localization/default-messages.d.ts +6 -0
  87. package/dist/localization/default-messages.d.ts.map +1 -1
  88. package/dist/localization/default-messages.js +6 -0
  89. package/dist/localization/default-messages.js.map +1 -1
  90. package/dist/notifications/routes.d.ts +2 -2
  91. package/dist/observability/routes.d.ts +1 -1
  92. package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
  93. package/dist/scripts/agent-engines/list-agent-engines.js +1 -18
  94. package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
  95. package/dist/scripts/call-agent.d.ts.map +1 -1
  96. package/dist/scripts/call-agent.js +49 -6
  97. package/dist/scripts/call-agent.js.map +1 -1
  98. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  99. package/dist/server/agent-chat-plugin.js +38 -10
  100. package/dist/server/agent-chat-plugin.js.map +1 -1
  101. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  102. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -0
  103. package/docs/content/a2a-protocol.mdx +15 -0
  104. package/docs/content/template-chat.mdx +1 -1
  105. package/docs/content/template-plan.mdx +3 -3
  106. package/package.json +1 -1
  107. package/src/a2a/activity.ts +371 -0
  108. package/src/a2a/client.ts +3 -1
  109. package/src/a2a/index.ts +21 -0
  110. package/src/a2a/types.ts +8 -0
  111. package/src/agent/model-config.ts +19 -23
  112. package/src/agent/production-agent.ts +167 -100
  113. package/src/agent/types.ts +16 -1
  114. package/src/client/chat/tool-call-display.tsx +190 -35
  115. package/src/client/chat-model-groups.ts +67 -27
  116. package/src/client/sharing/ShareButton.tsx +1 -27
  117. package/src/client/sharing/ShareDialog.tsx +0 -16
  118. package/src/client/sharing/useShareButtonController.ts +0 -7
  119. package/src/client/sharing/useShareDialogController.ts +0 -2
  120. package/src/client/sse-event-processor.ts +85 -1
  121. package/src/localization/default-messages.ts +6 -0
  122. package/src/scripts/agent-engines/list-agent-engines.ts +1 -18
  123. package/src/scripts/call-agent.ts +49 -6
  124. package/src/server/agent-chat-plugin.ts +50 -10
  125. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -0
  126. package/corpus/core/src/observability/hosted-model-experiment.ts +0 -118
  127. package/dist/observability/hosted-model-experiment.d.ts +0 -39
  128. package/dist/observability/hosted-model-experiment.d.ts.map +0 -1
  129. package/dist/observability/hosted-model-experiment.js +0 -90
  130. package/dist/observability/hosted-model-experiment.js.map +0 -1
  131. package/src/observability/hosted-model-experiment.ts +0 -118
@@ -1,3 +1,4 @@
1
+ import type { A2AAgentActivitySnapshot } from "../a2a/activity.js";
1
2
  import type { ActionChatUIConfig } from "../action-ui.js";
2
3
  import type { AgentMcpAppPayload } from "../mcp-client/app-result.js";
3
4
  import type { ReasoningEffort } from "../shared/reasoning-effort.js";
@@ -255,6 +256,8 @@ export type AgentChatEvent = {
255
256
  type: "agent_call";
256
257
  agent: string;
257
258
  status: "start" | "done" | "error";
259
+ agentCallId?: string;
260
+ durationMs?: number;
258
261
  } | {
259
262
  /**
260
263
  * Periodic liveness for an in-flight cross-app A2A call. Emitted by the
@@ -277,10 +280,17 @@ export type AgentChatEvent = {
277
280
  elapsedSeconds: number;
278
281
  /** Optional short text surfaced from the remote poll, when present. */
279
282
  detail?: string;
283
+ agentCallId?: string;
280
284
  } | {
281
285
  type: "agent_call_text";
282
286
  agent: string;
283
287
  text: string;
288
+ agentCallId?: string;
289
+ } | {
290
+ type: "agent_call_activity";
291
+ agent: string;
292
+ snapshot: A2AAgentActivitySnapshot;
293
+ agentCallId?: string;
284
294
  } | {
285
295
  type: "agent_task";
286
296
  taskId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC;IACvD,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,KAAK,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,qBAAqB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB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;IACH,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EACF,aAAa,GACb,YAAY,GACZ,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,qBAAqB,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACD;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ActionChatUIConfig } from \"../action-ui.js\";\nimport type { AgentMcpAppPayload } from \"../mcp-client/app-result.js\";\nimport type { ReasoningEffort } from \"../shared/reasoning-effort.js\";\n\nexport interface AgentNativeJsonSchema {\n type?: string | string[];\n description?: string;\n enum?: unknown[];\n const?: unknown;\n properties?: Record<string, AgentNativeJsonSchema>;\n required?: string[];\n additionalProperties?: boolean | AgentNativeJsonSchema;\n items?: AgentNativeJsonSchema;\n oneOf?: AgentNativeJsonSchema[];\n anyOf?: AgentNativeJsonSchema[];\n allOf?: AgentNativeJsonSchema[];\n not?: AgentNativeJsonSchema;\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n minimum?: number;\n maximum?: number;\n minItems?: number;\n maxItems?: number;\n}\n\nexport interface ActionTool {\n description: string;\n parameters?: AgentNativeJsonSchema & {\n type: \"object\";\n properties: Record<string, AgentNativeJsonSchema>;\n required?: string[];\n };\n}\n\n/** @deprecated Use `ActionTool` instead */\nexport type ScriptTool = ActionTool;\n\nexport interface AgentMessage {\n role: \"user\" | \"assistant\";\n content: string;\n}\n\nexport type AgentChatStructuredContentPart =\n | { type: \"text\"; text: string }\n | {\n type: \"tool-call\";\n id?: string;\n toolCallId?: string;\n name?: string;\n toolName?: string;\n input?: unknown;\n args?: unknown;\n }\n | {\n type: \"tool-result\";\n toolCallId: string;\n /** Persisted for replay; omitted in older rows is backfilled server-side. */\n toolName?: string;\n toolInput?: string;\n content: string;\n isError?: boolean;\n };\n\nexport interface AgentChatStructuredMessage {\n role: \"user\" | \"assistant\";\n content: AgentChatStructuredContentPart[];\n}\n\nexport interface AgentChatReference {\n type: \"file\" | \"skill\" | \"mention\" | \"agent\" | \"custom-agent\";\n path: string;\n name: string;\n source: string;\n refType?: string;\n refId?: string;\n slotKey?: string;\n slotLabel?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface MentionProviderItem {\n id: string;\n label: string;\n description?: string;\n icon?: string;\n refType: string;\n refId?: string;\n refPath?: string;\n slotKey?: string;\n slotLabel?: string;\n metadata?: Record<string, unknown>;\n clearsSlots?: string[];\n relatedReferences?: MentionProviderReference[];\n}\n\nexport interface MentionProviderReference {\n label: string;\n icon?: string;\n source?: string;\n refType: string;\n refId?: string | null;\n refPath?: string | null;\n slotKey?: string;\n slotLabel?: string;\n metadata?: Record<string, unknown>;\n clearsSlots?: string[];\n relatedReferences?: MentionProviderReference[];\n}\n\nexport interface MentionProvider {\n label: string;\n icon?: string;\n search: (\n query: string,\n /** The H3 event for the current request — use to make internal API calls */\n event?: any,\n ) => MentionProviderItem[] | Promise<MentionProviderItem[]>;\n}\n\nexport interface AgentChatAttachment {\n type: string;\n name: string;\n data?: string;\n contentType?: string;\n text?: string;\n}\n\nexport interface AgentChatScope {\n type: string;\n id: string;\n label?: string;\n}\n\nexport interface AgentChatRequest {\n message: string;\n /**\n * User-visible text to persist in chat history. `message` may be normalized\n * for the model (for example mention markup or internal continuation text).\n */\n displayMessage?: string;\n history?: AgentMessage[];\n /**\n * Provider-neutral transcript used for run recovery. Unlike `history`,\n * this preserves assistant tool calls and matching tool results so\n * continuation turns do not re-run completed read-only tools.\n */\n structuredHistory?: AgentChatStructuredMessage[];\n references?: AgentChatReference[];\n threadId?: string;\n attachments?: AgentChatAttachment[];\n /** Internal retry/continuation requests should not create visible user turns. */\n internalContinuation?: boolean;\n /**\n * Internal marker set ONLY by the durable-background self-dispatch (see\n * `AGENT_CHAT_BACKGROUND_RUN_FIELD`). Present when the agent-chat handler is\n * re-entered as the background worker: it carries the pre-claimed `runId` and\n * logical `turnId` so the worker runs the loop inline with the background\n * soft-timeout instead of re-claiming the slot or re-dispatching. Untrusted\n * on its own — the `_process-run` route HMAC-verifies the dispatch before\n * invoking the handler. Absent on every normal client request.\n */\n __backgroundRun?: {\n runId: string;\n turnId?: string;\n continuationReason?:\n | \"run_timeout\"\n | \"loop_limit\"\n | \"no_progress\"\n | \"stream_ended\"\n | \"gateway_timeout\"\n | \"network_interrupted\";\n actionPreparationTool?: string;\n /**\n * Number of server-driven background→background continuations already\n * chained into this logical turn (0 on the first chunk). The worker\n * increments this when it re-fires `_process-run` at a soft-timeout\n * boundary and refuses to chain past `MAX_BACKGROUND_RUN_CONTINUATIONS`.\n */\n continuationCount?: number;\n /**\n * True when the dispatcher expects the self-POST to land in a real\n * Netlify `-background` function rather than the ~60s synchronous function.\n * This is diagnostic only; the 15-minute budget is unlocked by the worker's\n * actual runtime marker.\n */\n backgroundFunctionRuntimeExpected?: boolean;\n /**\n * True when the dispatch body carries ONLY this marker and the worker\n * must rehydrate the full request body from the run row's\n * `dispatch_payload` column (`readRunDispatchPayload`). Keeps the\n * self-POST under Netlify's 256KB background-function body cap.\n */\n payloadRef?: boolean;\n };\n /**\n * Stable identity for the logical assistant turn this request belongs to.\n * The client sends the SAME turnId for the initial POST and every\n * auto-continuation re-POST of one turn, so the server can fold each\n * continuation run's output onto a single durable assistant message instead\n * of dropping the earlier chunks. Defaults to the run id when absent.\n */\n turnId?: string;\n /** Execution mode for this turn. Plan mode is read-only and proposes before acting. */\n mode?: \"act\" | \"plan\";\n /** Per-request model override (ephemeral, from the composer model picker). */\n model?: string;\n /** Per-request engine override (sent alongside model for cross-provider switches). */\n engine?: string;\n /** Per-request reasoning effort override (ephemeral, from the composer picker). */\n effort?: ReasoningEffort;\n /** Usage-tracking label for this call (e.g. \"chat\", \"summarize\"). Default: \"chat\". */\n usageLabel?: string;\n /** Stable browser tab id so screen/url context and navigation commands are tab-scoped. */\n browserTabId?: string;\n /** Resource scope for this chat thread, e.g. the deck currently bound to the tab. */\n scope?: AgentChatScope | null;\n /** When true, expose this chat turn as a user-visible run in RunsTray. */\n trackInRunsTray?: boolean;\n /**\n * Approval grants for human-in-the-loop actions. Each entry is a stable\n * approval key (see the `approval_required` event's `approvalKey`). When the\n * agent calls an action declared `needsApproval`, the loop pauses and emits\n * `approval_required`; the client re-issues the turn (typically an empty\n * continuation) with the approved call's key here so the gate lets it run.\n * Keys not present here keep the action paused. The model never sees or sets\n * this — it is supplied by the human's approve affordance.\n */\n approvedToolCalls?: string[];\n}\n\nexport type AgentToolInput = Record<string, unknown>;\n\nexport type AgentChatEvent =\n | { type: \"text\"; text: string }\n | { type: \"thinking\"; text: string }\n | {\n type: \"activity\";\n label: string;\n tool?: string;\n id?: string;\n progressBytes?: number;\n }\n | { type: \"stream_keepalive\" }\n | { type: \"tool_start\"; tool: string; id?: string; input: AgentToolInput }\n | {\n type: \"tool_done\";\n tool: string;\n id?: string;\n input?: AgentToolInput;\n result: string;\n isError?: boolean;\n completedSideEffect?: boolean;\n mcpApp?: AgentMcpAppPayload;\n chatUI?: ActionChatUIConfig;\n }\n | {\n /**\n * The agent tried to call an action declared `needsApproval` and the loop\n * paused instead of executing it. The client should surface an\n * approve/deny affordance; on approve, re-issue the turn with\n * `approvedToolCalls: [approvalKey]` so the gate lets this call run.\n */\n type: \"approval_required\";\n tool: string;\n input: Record<string, string>;\n /** Stable key the client echoes back in `approvedToolCalls` to approve. */\n approvalKey: string;\n /** The model-side tool-call id for this paused call, when available. */\n toolCallId?: string;\n }\n | {\n type: \"agent_call\";\n agent: string;\n status: \"start\" | \"done\" | \"error\";\n }\n | {\n /**\n * Periodic liveness for an in-flight cross-app A2A call. Emitted by the\n * `call-agent` action once per throttle window ONLY when a real poll\n * round-trip to the remote agent succeeds and reports a non-terminal\n * state — never on a timer, so a hung/dead remote emits nothing and the\n * stuck-detector can still fire. Counts as real progress in\n * `run-manager`'s `shouldBumpProgressForEvent` (any non-special event\n * type does), which keeps `last_progress_at` fresh so a slow-but-healthy\n * sub-agent call doesn't trip the client's stuck banner. A distinct\n * event type (not an `agent_call` status) so existing `agent_call`\n * consumers that treat \"not start/done\" as a failure don't render an\n * in-flight tick as an error.\n */\n type: \"agent_call_progress\";\n agent: string;\n /** Remote A2A task state for this poll, e.g. \"working\" | \"processing\". */\n state: string;\n /** Elapsed wall-clock seconds since the cross-app call began. */\n elapsedSeconds: number;\n /** Optional short text surfaced from the remote poll, when present. */\n detail?: string;\n }\n | { type: \"agent_call_text\"; agent: string; text: string }\n | {\n type: \"agent_task\";\n taskId: string;\n threadId: string;\n description: string;\n status: \"running\" | \"completed\" | \"errored\";\n }\n | {\n type: \"agent_task_update\";\n taskId: string;\n preview: string;\n currentStep?: string;\n }\n | {\n type: \"agent_task_complete\";\n taskId: string;\n summary: string;\n }\n | { type: \"done\" }\n | {\n type: \"error\";\n error: string;\n /**\n * Optional machine-readable error code. Builder gateway uses codes\n * like \"credits-limit-monthly\" / \"unauthorized\" / \"gateway_not_enabled\"\n * so the chat UI can render a structured CTA (e.g. upgrade button).\n */\n errorCode?: string;\n /** Optional link paired with errorCode — e.g. Builder billing page. */\n upgradeUrl?: string;\n /** Optional details for expandable UI/debugging. */\n details?: string;\n /** True when the user can reasonably continue/retry from partial work. */\n recoverable?: boolean;\n }\n /**\n * Legacy SSE terminal event. New streams emit\n * `{ type: \"error\", errorCode: \"missing_credentials\" }` instead.\n */\n | { type: \"missing_api_key\" }\n | { type: \"loop_limit\"; maxIterations?: number }\n | {\n /**\n * An in-loop `Processor` aborted the run via `abort()` (which throws a\n * `TripWire`). The loop catches it, emits this event, stops cleanly, and\n * surfaces the reason as a final assistant message. Structural hook for\n * real-time guardrails and a proof-of-done / coverage gate.\n */\n type: \"tripwire\";\n reason: string;\n /** Name of the processor that aborted, when it declared one. */\n processor?: string;\n }\n | {\n type: \"auto_continue\";\n reason:\n | \"run_timeout\"\n | \"loop_limit\"\n | \"no_progress\"\n | \"stream_ended\"\n | \"gateway_timeout\"\n | \"network_interrupted\";\n maxIterations?: number;\n }\n | { type: \"clear\" };\n\nexport interface RunEvent {\n seq: number;\n event: AgentChatEvent;\n}\n\nexport type RunStatus = \"running\" | \"completed\" | \"errored\" | \"aborted\";\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { A2AAgentActivitySnapshot } from \"../a2a/activity.js\";\nimport type { ActionChatUIConfig } from \"../action-ui.js\";\nimport type { AgentMcpAppPayload } from \"../mcp-client/app-result.js\";\nimport type { ReasoningEffort } from \"../shared/reasoning-effort.js\";\n\nexport interface AgentNativeJsonSchema {\n type?: string | string[];\n description?: string;\n enum?: unknown[];\n const?: unknown;\n properties?: Record<string, AgentNativeJsonSchema>;\n required?: string[];\n additionalProperties?: boolean | AgentNativeJsonSchema;\n items?: AgentNativeJsonSchema;\n oneOf?: AgentNativeJsonSchema[];\n anyOf?: AgentNativeJsonSchema[];\n allOf?: AgentNativeJsonSchema[];\n not?: AgentNativeJsonSchema;\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n minimum?: number;\n maximum?: number;\n minItems?: number;\n maxItems?: number;\n}\n\nexport interface ActionTool {\n description: string;\n parameters?: AgentNativeJsonSchema & {\n type: \"object\";\n properties: Record<string, AgentNativeJsonSchema>;\n required?: string[];\n };\n}\n\n/** @deprecated Use `ActionTool` instead */\nexport type ScriptTool = ActionTool;\n\nexport interface AgentMessage {\n role: \"user\" | \"assistant\";\n content: string;\n}\n\nexport type AgentChatStructuredContentPart =\n | { type: \"text\"; text: string }\n | {\n type: \"tool-call\";\n id?: string;\n toolCallId?: string;\n name?: string;\n toolName?: string;\n input?: unknown;\n args?: unknown;\n }\n | {\n type: \"tool-result\";\n toolCallId: string;\n /** Persisted for replay; omitted in older rows is backfilled server-side. */\n toolName?: string;\n toolInput?: string;\n content: string;\n isError?: boolean;\n };\n\nexport interface AgentChatStructuredMessage {\n role: \"user\" | \"assistant\";\n content: AgentChatStructuredContentPart[];\n}\n\nexport interface AgentChatReference {\n type: \"file\" | \"skill\" | \"mention\" | \"agent\" | \"custom-agent\";\n path: string;\n name: string;\n source: string;\n refType?: string;\n refId?: string;\n slotKey?: string;\n slotLabel?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface MentionProviderItem {\n id: string;\n label: string;\n description?: string;\n icon?: string;\n refType: string;\n refId?: string;\n refPath?: string;\n slotKey?: string;\n slotLabel?: string;\n metadata?: Record<string, unknown>;\n clearsSlots?: string[];\n relatedReferences?: MentionProviderReference[];\n}\n\nexport interface MentionProviderReference {\n label: string;\n icon?: string;\n source?: string;\n refType: string;\n refId?: string | null;\n refPath?: string | null;\n slotKey?: string;\n slotLabel?: string;\n metadata?: Record<string, unknown>;\n clearsSlots?: string[];\n relatedReferences?: MentionProviderReference[];\n}\n\nexport interface MentionProvider {\n label: string;\n icon?: string;\n search: (\n query: string,\n /** The H3 event for the current request — use to make internal API calls */\n event?: any,\n ) => MentionProviderItem[] | Promise<MentionProviderItem[]>;\n}\n\nexport interface AgentChatAttachment {\n type: string;\n name: string;\n data?: string;\n contentType?: string;\n text?: string;\n}\n\nexport interface AgentChatScope {\n type: string;\n id: string;\n label?: string;\n}\n\nexport interface AgentChatRequest {\n message: string;\n /**\n * User-visible text to persist in chat history. `message` may be normalized\n * for the model (for example mention markup or internal continuation text).\n */\n displayMessage?: string;\n history?: AgentMessage[];\n /**\n * Provider-neutral transcript used for run recovery. Unlike `history`,\n * this preserves assistant tool calls and matching tool results so\n * continuation turns do not re-run completed read-only tools.\n */\n structuredHistory?: AgentChatStructuredMessage[];\n references?: AgentChatReference[];\n threadId?: string;\n attachments?: AgentChatAttachment[];\n /** Internal retry/continuation requests should not create visible user turns. */\n internalContinuation?: boolean;\n /**\n * Internal marker set ONLY by the durable-background self-dispatch (see\n * `AGENT_CHAT_BACKGROUND_RUN_FIELD`). Present when the agent-chat handler is\n * re-entered as the background worker: it carries the pre-claimed `runId` and\n * logical `turnId` so the worker runs the loop inline with the background\n * soft-timeout instead of re-claiming the slot or re-dispatching. Untrusted\n * on its own — the `_process-run` route HMAC-verifies the dispatch before\n * invoking the handler. Absent on every normal client request.\n */\n __backgroundRun?: {\n runId: string;\n turnId?: string;\n continuationReason?:\n | \"run_timeout\"\n | \"loop_limit\"\n | \"no_progress\"\n | \"stream_ended\"\n | \"gateway_timeout\"\n | \"network_interrupted\";\n actionPreparationTool?: string;\n /**\n * Number of server-driven background→background continuations already\n * chained into this logical turn (0 on the first chunk). The worker\n * increments this when it re-fires `_process-run` at a soft-timeout\n * boundary and refuses to chain past `MAX_BACKGROUND_RUN_CONTINUATIONS`.\n */\n continuationCount?: number;\n /**\n * True when the dispatcher expects the self-POST to land in a real\n * Netlify `-background` function rather than the ~60s synchronous function.\n * This is diagnostic only; the 15-minute budget is unlocked by the worker's\n * actual runtime marker.\n */\n backgroundFunctionRuntimeExpected?: boolean;\n /**\n * True when the dispatch body carries ONLY this marker and the worker\n * must rehydrate the full request body from the run row's\n * `dispatch_payload` column (`readRunDispatchPayload`). Keeps the\n * self-POST under Netlify's 256KB background-function body cap.\n */\n payloadRef?: boolean;\n };\n /**\n * Stable identity for the logical assistant turn this request belongs to.\n * The client sends the SAME turnId for the initial POST and every\n * auto-continuation re-POST of one turn, so the server can fold each\n * continuation run's output onto a single durable assistant message instead\n * of dropping the earlier chunks. Defaults to the run id when absent.\n */\n turnId?: string;\n /** Execution mode for this turn. Plan mode is read-only and proposes before acting. */\n mode?: \"act\" | \"plan\";\n /** Per-request model override (ephemeral, from the composer model picker). */\n model?: string;\n /** Per-request engine override (sent alongside model for cross-provider switches). */\n engine?: string;\n /** Per-request reasoning effort override (ephemeral, from the composer picker). */\n effort?: ReasoningEffort;\n /** Usage-tracking label for this call (e.g. \"chat\", \"summarize\"). Default: \"chat\". */\n usageLabel?: string;\n /** Stable browser tab id so screen/url context and navigation commands are tab-scoped. */\n browserTabId?: string;\n /** Resource scope for this chat thread, e.g. the deck currently bound to the tab. */\n scope?: AgentChatScope | null;\n /** When true, expose this chat turn as a user-visible run in RunsTray. */\n trackInRunsTray?: boolean;\n /**\n * Approval grants for human-in-the-loop actions. Each entry is a stable\n * approval key (see the `approval_required` event's `approvalKey`). When the\n * agent calls an action declared `needsApproval`, the loop pauses and emits\n * `approval_required`; the client re-issues the turn (typically an empty\n * continuation) with the approved call's key here so the gate lets it run.\n * Keys not present here keep the action paused. The model never sees or sets\n * this — it is supplied by the human's approve affordance.\n */\n approvedToolCalls?: string[];\n}\n\nexport type AgentToolInput = Record<string, unknown>;\n\nexport type AgentChatEvent =\n | { type: \"text\"; text: string }\n | { type: \"thinking\"; text: string }\n | {\n type: \"activity\";\n label: string;\n tool?: string;\n id?: string;\n progressBytes?: number;\n }\n | { type: \"stream_keepalive\" }\n | { type: \"tool_start\"; tool: string; id?: string; input: AgentToolInput }\n | {\n type: \"tool_done\";\n tool: string;\n id?: string;\n input?: AgentToolInput;\n result: string;\n isError?: boolean;\n completedSideEffect?: boolean;\n mcpApp?: AgentMcpAppPayload;\n chatUI?: ActionChatUIConfig;\n }\n | {\n /**\n * The agent tried to call an action declared `needsApproval` and the loop\n * paused instead of executing it. The client should surface an\n * approve/deny affordance; on approve, re-issue the turn with\n * `approvedToolCalls: [approvalKey]` so the gate lets this call run.\n */\n type: \"approval_required\";\n tool: string;\n input: Record<string, string>;\n /** Stable key the client echoes back in `approvedToolCalls` to approve. */\n approvalKey: string;\n /** The model-side tool-call id for this paused call, when available. */\n toolCallId?: string;\n }\n | {\n type: \"agent_call\";\n agent: string;\n status: \"start\" | \"done\" | \"error\";\n agentCallId?: string;\n durationMs?: number;\n }\n | {\n /**\n * Periodic liveness for an in-flight cross-app A2A call. Emitted by the\n * `call-agent` action once per throttle window ONLY when a real poll\n * round-trip to the remote agent succeeds and reports a non-terminal\n * state — never on a timer, so a hung/dead remote emits nothing and the\n * stuck-detector can still fire. Counts as real progress in\n * `run-manager`'s `shouldBumpProgressForEvent` (any non-special event\n * type does), which keeps `last_progress_at` fresh so a slow-but-healthy\n * sub-agent call doesn't trip the client's stuck banner. A distinct\n * event type (not an `agent_call` status) so existing `agent_call`\n * consumers that treat \"not start/done\" as a failure don't render an\n * in-flight tick as an error.\n */\n type: \"agent_call_progress\";\n agent: string;\n /** Remote A2A task state for this poll, e.g. \"working\" | \"processing\". */\n state: string;\n /** Elapsed wall-clock seconds since the cross-app call began. */\n elapsedSeconds: number;\n /** Optional short text surfaced from the remote poll, when present. */\n detail?: string;\n agentCallId?: string;\n }\n | {\n type: \"agent_call_text\";\n agent: string;\n text: string;\n agentCallId?: string;\n }\n | {\n type: \"agent_call_activity\";\n agent: string;\n snapshot: A2AAgentActivitySnapshot;\n agentCallId?: string;\n }\n | {\n type: \"agent_task\";\n taskId: string;\n threadId: string;\n description: string;\n status: \"running\" | \"completed\" | \"errored\";\n }\n | {\n type: \"agent_task_update\";\n taskId: string;\n preview: string;\n currentStep?: string;\n }\n | {\n type: \"agent_task_complete\";\n taskId: string;\n summary: string;\n }\n | { type: \"done\" }\n | {\n type: \"error\";\n error: string;\n /**\n * Optional machine-readable error code. Builder gateway uses codes\n * like \"credits-limit-monthly\" / \"unauthorized\" / \"gateway_not_enabled\"\n * so the chat UI can render a structured CTA (e.g. upgrade button).\n */\n errorCode?: string;\n /** Optional link paired with errorCode — e.g. Builder billing page. */\n upgradeUrl?: string;\n /** Optional details for expandable UI/debugging. */\n details?: string;\n /** True when the user can reasonably continue/retry from partial work. */\n recoverable?: boolean;\n }\n /**\n * Legacy SSE terminal event. New streams emit\n * `{ type: \"error\", errorCode: \"missing_credentials\" }` instead.\n */\n | { type: \"missing_api_key\" }\n | { type: \"loop_limit\"; maxIterations?: number }\n | {\n /**\n * An in-loop `Processor` aborted the run via `abort()` (which throws a\n * `TripWire`). The loop catches it, emits this event, stops cleanly, and\n * surfaces the reason as a final assistant message. Structural hook for\n * real-time guardrails and a proof-of-done / coverage gate.\n */\n type: \"tripwire\";\n reason: string;\n /** Name of the processor that aborted, when it declared one. */\n processor?: string;\n }\n | {\n type: \"auto_continue\";\n reason:\n | \"run_timeout\"\n | \"loop_limit\"\n | \"no_progress\"\n | \"stream_ended\"\n | \"gateway_timeout\"\n | \"network_interrupted\";\n maxIterations?: number;\n }\n | { type: \"clear\" };\n\nexport interface RunEvent {\n seq: number;\n event: AgentChatEvent;\n}\n\nexport type RunStatus = \"running\" | \"completed\" | \"errored\" | \"aborted\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tool-call-display.d.ts","sourceRoot":"","sources":["../../../src/client/chat/tool-call-display.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAgBpE,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAUzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAIL,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAwBhC,eAAO,MAAM,kBAAkB,wBAA6B,CAAC;AAC7D,eAAO,MAAM,sBAAsB,8BAA2C,CAAC;AAC/E,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,8DAA8D;IAC9D,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;;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,GACR,EAAE;IACD,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,qBA+GA;AA+ED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,WAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAoB,EACpB,oBAA4B,EAC5B,UAAU,GACX,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,4BA0EA;AAID,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAevD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,WAAmB,EACnB,YAAoB,EACpB,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAyCA;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAyBA;AAKD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"tool-call-display.d.ts","sourceRoot":"","sources":["../../../src/client/chat/tool-call-display.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAgBp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,GAAG,IAAI,CAAC;IAC3B,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAyCA;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAyBA;AAKD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -5,12 +5,13 @@ import { AgentTaskCard } from "../AgentTaskCard.js";
5
5
  import { writeClipboardText } from "../clipboard.js";
6
6
  import { Popover, PopoverContent, PopoverTrigger, } from "../components/ui/popover.js";
7
7
  import { ConnectBuilderCard } from "../ConnectBuilderCard.js";
8
+ import { useT } from "../i18n.js";
8
9
  import { McpAppRenderer } from "../mcp-apps/McpAppRenderer.js";
9
10
  import { BashCell, EditCell, WriteCell, FilesChangedSummary, } from "../tool-cells/index.js";
10
11
  import { humanizeToolName, isCallAgentToolCallShadowed, } from "../tool-display.js";
11
12
  import { cn } from "../utils.js";
12
13
  import { ActionChatUiSurface } from "./action-chat-ui-surface.js";
13
- import { SmoothMarkdownText, HighlightedCodeBlock, markdownComponents, markdownModule, remarkGfmFn, markdownUrlTransform, useSmoothStreamingText, } from "./markdown-renderer.js";
14
+ import { SmoothMarkdownText, HighlightedCodeBlock, useSmoothStreamingText, } from "./markdown-renderer.js";
14
15
  import { resolveToolRenderer } from "./tool-render-registry.js";
15
16
  import { isBuiltinDataWidgetActionRenderer, resolveBuiltinActionChatRenderer, resolveBuiltinFallbackToolRenderer, } from "./widgets/builtin-tool-renderers.js";
16
17
  // Exported so AssistantChatInner can provide a context value.
@@ -252,24 +253,28 @@ export function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, chat
252
253
  if (toolKind === "write") {
253
254
  return wrapToolDisplay(_jsx(WriteCell, { meta: structuredMeta, isRunning: isRunning }));
254
255
  }
255
- return wrapToolDisplay(_jsx(ToolCallDisplayGeneric, { toolName: toolName, argsText: argsText, args: args, result: result, mcpApp: mcpApp, chatUI: chatUI, isRunning: isRunning, isActiveTail: showActiveTail, approval: approval, repeatCount: repeatCount }));
256
+ return wrapToolDisplay(_jsx(ToolCallDisplayGeneric, { toolName: toolName, argsText: argsText, args: args, result: result, mcpApp: mcpApp, chatUI: chatUI, isRunning: isRunning, isActiveTail: showActiveTail, structuredMeta: structuredMeta, approval: approval, repeatCount: repeatCount }));
256
257
  }
257
- function ToolCallDisplayGeneric({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, isActiveTail, approval, repeatCount, }) {
258
- const streamRef = useRef(null);
259
- const isAgentCall = toolName.startsWith("agent:");
258
+ function ToolCallDisplayGeneric({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, isActiveTail, structuredMeta, approval, repeatCount, }) {
259
+ const isRawCallAgent = toolName === "call-agent";
260
+ const isAgentCall = toolName.startsWith("agent:") || isRawCallAgent;
260
261
  const [expanded, setExpanded] = useState(isAgentCall);
261
262
  const [outputOpen, setOutputOpen] = useState(false);
262
- const agentName = isAgentCall ? toolName.slice(6) : null;
263
+ const agentName = toolName.startsWith("agent:")
264
+ ? toolName.slice(6)
265
+ : typeof args.agent === "string"
266
+ ? args.agent
267
+ : null;
263
268
  const isAgentError = isAgentCall && result === "Error calling agent";
264
- const agentStreamText = isAgentCall ? (argsText ?? "") : "";
269
+ const agentStreamText = isRawCallAgent
270
+ ? (result ?? "")
271
+ : isAgentCall
272
+ ? (argsText ?? "")
273
+ : "";
274
+ const agentActivity = structuredMeta?.agentActivity;
275
+ const agentProgress = structuredMeta?.agentProgress;
265
276
  const hasStreamText = agentStreamText.length > 0;
266
277
  const hasArgs = !isAgentCall && Object.keys(args).length > 0;
267
- // NOTE: All hooks must be above any conditional returns
268
- useEffect(() => {
269
- if (isAgentCall && isRunning && streamRef.current) {
270
- streamRef.current.scrollTop = streamRef.current.scrollHeight;
271
- }
272
- }, [agentStreamText, isAgentCall, isRunning]);
273
278
  // Render connect-builder as ConnectBuilderCard once the result is available
274
279
  if (toolName === "connect-builder" && result) {
275
280
  try {
@@ -346,7 +351,51 @@ function ToolCallDisplayGeneric({ toolName, argsText, args, result, mcpApp, chat
346
351
  const isExpanded = isAgentCall ? hasStreamText && expanded : expanded;
347
352
  const ToolIcon = resolveToolIcon(toolName);
348
353
  const outputTitle = `Raw ${toolName} tool call output`;
349
- return (_jsxs("div", { className: "group/tool my-0.5 w-full overflow-hidden", children: [mcpApp && _jsx(McpAppRenderer, { app: mcpApp, className: "mb-1.5" }), _jsxs("button", { type: "button", onClick: () => canExpand && setExpanded(!isExpanded), "aria-expanded": canExpand ? isExpanded : undefined, className: cn("flex w-full items-center gap-1.5 rounded-md py-0.5 text-left text-[13px] text-muted-foreground transition-colors", canExpand && "hover:text-foreground", isRunning && "text-muted-foreground"), children: [_jsx("span", { className: "relative flex size-4 shrink-0 items-center justify-center", children: isRunning ? (_jsx(IconLoader2, { className: "size-3.5 animate-spin" })) : isAgentError ? (_jsx(IconCircleX, { className: "size-3.5 text-destructive" })) : (_jsxs(_Fragment, { children: [_jsx(ToolIcon, { className: cn("size-3.5 transition-opacity", canExpand && "group-hover/tool:opacity-0") }), canExpand && (_jsx(IconChevronRight, { className: cn("absolute size-3.5 opacity-0 transition-[opacity,transform] group-hover/tool:opacity-100", isExpanded && "rotate-90") }))] })) }), _jsx("span", { className: cn("min-w-0 truncate font-normal", isActiveTail && "agent-running-shimmer"), children: displayName }), repeatCount && repeatCount > 1 && (_jsxs("span", { className: "shrink-0 rounded border border-border/60 px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground", title: `Repeated ${repeatCount} times`, children: [repeatCount, "x"] }))] }), _jsx(AnimatedCollapse, { open: isExpanded && isAgentCall && hasStreamText, children: _jsx("div", { ref: streamRef, className: "mt-1 rounded-md bg-muted/50 px-3 py-2 text-xs text-muted-foreground break-words max-h-48 overflow-y-auto agent-markdown prose prose-sm prose-invert max-w-none", children: markdownModule?.default && remarkGfmFn ? (_jsx(markdownModule.default, { remarkPlugins: [remarkGfmFn], components: markdownComponents, urlTransform: markdownUrlTransform, children: agentStreamText })) : (_jsx("span", { style: { whiteSpace: "pre-wrap" }, children: agentStreamText })) }) }), _jsx(AnimatedCollapse, { open: isExpanded && !isAgentCall && (hasArgs || result !== undefined), children: _jsxs("div", { className: "mt-1 space-y-2 pl-5", children: [inputPayload && (_jsx(SimpleCodeViewer, { text: inputPayload.text, lang: inputPayload.lang })), resultPayload && (_jsx(ToolOutputPopover, { open: outputOpen, onOpenChange: setOutputOpen, title: outputTitle, payload: resultPayload, children: _jsx("button", { type: "button", "aria-label": `View ${toolName} output`, className: "inline-flex size-6 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground", children: _jsx(IconCode, { className: "size-3.5" }) }) }))] }) }), approval && (_jsx(ApprovalAffordance, { toolName: toolName, approval: approval }))] }));
354
+ if (isAgentCall) {
355
+ return (_jsx(AgentCallCell, { agentName: agentName ?? "agent", activity: agentActivity, progress: agentProgress, responseText: agentStreamText, isRunning: isRunning, isError: isAgentError, durationMs: typeof structuredMeta?.agentDurationMs === "number"
356
+ ? structuredMeta.agentDurationMs
357
+ : agentActivity?.durationMs }));
358
+ }
359
+ return (_jsxs("div", { className: "group/tool my-0.5 w-full overflow-hidden", children: [mcpApp && _jsx(McpAppRenderer, { app: mcpApp, className: "mb-1.5" }), _jsxs("button", { type: "button", onClick: () => canExpand && setExpanded(!isExpanded), "aria-expanded": canExpand ? isExpanded : undefined, className: cn("flex w-full items-center gap-1.5 rounded-md py-0.5 text-left text-[13px] text-muted-foreground transition-colors", canExpand && "hover:text-foreground", isRunning && "text-muted-foreground"), children: [_jsx("span", { className: "relative flex size-4 shrink-0 items-center justify-center", children: isRunning ? (_jsx(IconLoader2, { className: "size-3.5 animate-spin" })) : isAgentError ? (_jsx(IconCircleX, { className: "size-3.5 text-destructive" })) : (_jsxs(_Fragment, { children: [_jsx(ToolIcon, { className: cn("size-3.5 transition-opacity", canExpand && "group-hover/tool:opacity-0") }), canExpand && (_jsx(IconChevronRight, { className: cn("absolute size-3.5 opacity-0 transition-[opacity,transform] group-hover/tool:opacity-100", isExpanded && "rotate-90") }))] })) }), _jsx("span", { className: cn("min-w-0 truncate font-normal", isActiveTail && "agent-running-shimmer"), children: displayName }), repeatCount && repeatCount > 1 && (_jsxs("span", { className: "shrink-0 rounded border border-border/60 px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground", title: `Repeated ${repeatCount} times`, children: [repeatCount, "x"] }))] }), _jsx(AnimatedCollapse, { open: isExpanded && !isAgentCall && (hasArgs || result !== undefined), children: _jsxs("div", { className: "mt-1 space-y-2 pl-5", children: [inputPayload && (_jsx(SimpleCodeViewer, { text: inputPayload.text, lang: inputPayload.lang })), resultPayload && (_jsx(ToolOutputPopover, { open: outputOpen, onOpenChange: setOutputOpen, title: outputTitle, payload: resultPayload, children: _jsx("button", { type: "button", "aria-label": `View ${toolName} output`, className: "inline-flex size-6 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground", children: _jsx(IconCode, { className: "size-3.5" }) }) }))] }) }), approval && (_jsx(ApprovalAffordance, { toolName: toolName, approval: approval }))] }));
360
+ }
361
+ function AgentCallCell({ agentName, activity, progress, responseText, isRunning, isError, durationMs, }) {
362
+ const t = useT();
363
+ const [open, setOpen] = useState(true);
364
+ const finalText = isRunning
365
+ ? activity?.responseText || responseText
366
+ : responseText || activity?.responseText;
367
+ const work = activity?.reasoning?.length || activity?.toolCalls?.length;
368
+ const workItemCount = Math.max(activity?.reasoning?.length ?? 0, activity?.toolCalls?.length ?? 0);
369
+ const label = isRunning
370
+ ? t("agentPanel.delegatedAgent.asking", { name: agentName })
371
+ : isError
372
+ ? t("agentPanel.delegatedAgent.error", { name: agentName })
373
+ : t("agentPanel.delegatedAgent.asked", { name: agentName });
374
+ const workContent = work ? (_jsx("div", { className: "space-y-1 ps-5", children: Array.from({ length: workItemCount }, (_, index) => {
375
+ const reasoningText = activity?.reasoning?.[index];
376
+ const tool = activity?.toolCalls?.[index];
377
+ return (_jsxs(React.Fragment, { children: [reasoningText && (_jsx(ReasoningCell, { text: reasoningText, isStreaming: isRunning &&
378
+ activity.activePhase === "reasoning" &&
379
+ index === activity.reasoning.length - 1, defaultOpen: index === activity.reasoning.length - 1, collapseWhenReplaced: index < activity.toolCalls.length })), tool && (_jsx(ToolCallDisplay, { toolName: tool.name, args: {}, argsText: "", isRunning: tool.status === "running", result: tool.status === "failed"
380
+ ? "Failed"
381
+ : tool.status === "completed"
382
+ ? "Done"
383
+ : undefined, isActiveTail: isRunning && index === activity.toolCalls.length - 1 }))] }, `activity-${index}`));
384
+ }) })) : null;
385
+ const progressState = progress?.state.replaceAll(/[-_]+/g, " ");
386
+ const progressText = isRunning && !activity && progress && progressState
387
+ ? [
388
+ progressState.charAt(0).toUpperCase() + progressState.slice(1),
389
+ t("agentPanel.delegatedAgent.elapsed", {
390
+ duration: formatWorkedDuration(progress.elapsedSeconds * 1000),
391
+ }),
392
+ progress.detail,
393
+ ]
394
+ .filter(Boolean)
395
+ .join(" · ")
396
+ : null;
397
+ return (_jsxs("div", { className: "group/tool my-0.5 w-full", children: [_jsxs("button", { type: "button", onClick: () => setOpen((value) => !value), "aria-expanded": open, className: "flex w-full items-center gap-1.5 rounded-md py-0.5 text-left text-[13px] text-muted-foreground transition-colors hover:text-foreground", children: [isRunning ? (_jsx(IconLoader2, { className: "size-3.5 animate-spin" })) : isError ? (_jsx(IconCircleX, { className: "size-3.5 text-destructive" })) : (_jsx(IconChevronRight, { className: cn("size-3.5 transition-transform", open && "rotate-90") })), _jsx("span", { className: cn("min-w-0 truncate font-normal", isRunning && "agent-running-shimmer"), children: label })] }), _jsx(AnimatedCollapse, { open: open, children: _jsxs("div", { className: "ms-1 border-s border-border/50 ps-2 pt-1", children: [workContent &&
398
+ (isRunning ? (workContent) : (_jsx(WorkedForSummary, { durationMs: durationMs, children: workContent }))), progressText && (_jsx("p", { className: "ps-5 pb-1 text-xs text-muted-foreground", "data-testid": "agent-call-progress", "aria-live": "polite", children: progressText })), finalText && (_jsx("div", { className: "ps-5 pb-1", children: _jsx(SmoothMarkdownText, { text: finalText, streaming: isRunning, resetKey: `agent-response-${agentName}`, statusType: isRunning ? "running" : "complete" }) }))] }) })] }));
350
399
  }
351
400
  // ─── ToolCallFallback ──────────────────────────────────────────────────────────
352
401
  export function ToolCallFallback({ toolName, args, argsText, result, ...rest }) {