eve 0.68.0 → 0.70.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 (1196) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/bin/eve.js +15 -0
  3. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  4. package/dist/src/acp/adapter.js +1 -1
  5. package/dist/src/approval/definition.d.ts +19 -5
  6. package/dist/src/channel/adapter.d.ts +2 -0
  7. package/dist/src/channel/auth/oidc.js +1 -1
  8. package/dist/src/channel/channel-address.d.ts +1 -4
  9. package/dist/src/channel/channel-address.js +1 -1
  10. package/dist/src/channel/channel-operations.d.ts +4 -11
  11. package/dist/src/channel/channel-operations.js +1 -1
  12. package/dist/src/channel/compiled-channel.d.ts +0 -2
  13. package/dist/src/channel/compiled-channel.js +2 -2
  14. package/dist/src/channel/cross-channel-receive.d.ts +1 -3
  15. package/dist/src/channel/cross-channel-receive.js +1 -1
  16. package/dist/src/channel/forwarded-principal.js +1 -1
  17. package/dist/src/channel/schedule-auth.d.ts +16 -0
  18. package/dist/src/channel/schedule-auth.js +1 -1
  19. package/dist/src/channel/session-callback.js +1 -1
  20. package/dist/src/channel/session.d.ts +3 -8
  21. package/dist/src/channel/session.js +1 -1
  22. package/dist/src/channel/task-card.d.ts +121 -0
  23. package/dist/src/channel/task-card.js +1 -0
  24. package/dist/src/channel/types.d.ts +30 -57
  25. package/dist/src/chunks/{use-eve-agent-D4HVZBjn.js → use-eve-agent-CJQeE7-t.js} +2058 -1331
  26. package/dist/src/chunks/{use-eve-agent-DXcE_8Ja.js → use-eve-agent-DdemtY6C.js} +2061 -1331
  27. package/dist/src/cli/commands/info.d.ts +11 -0
  28. package/dist/src/cli/commands/info.js +1 -1
  29. package/dist/src/cli/commands/init-agent-workspace.js +1 -1
  30. package/dist/src/cli/commands/init.js +1 -1
  31. package/dist/src/cli/dev/command-options.d.ts +2 -2
  32. package/dist/src/cli/dev/command.js +1 -1
  33. package/dist/src/cli/dev/console-records-preload.d.ts +1 -0
  34. package/dist/src/cli/dev/console-records-preload.js +1 -0
  35. package/dist/src/cli/dev/console-records.d.ts +17 -0
  36. package/dist/src/cli/dev/console-records.js +3 -0
  37. package/dist/src/cli/dev/diagnostic-sink.d.ts +1 -0
  38. package/dist/src/cli/dev/local-server-process.js +1 -1
  39. package/dist/src/cli/dev/tui/blocks.d.ts +21 -19
  40. package/dist/src/cli/dev/tui/blocks.js +4 -4
  41. package/dist/src/cli/dev/tui/command-typeahead.d.ts +3 -6
  42. package/dist/src/cli/dev/tui/conversation-view.d.ts +54 -0
  43. package/dist/src/cli/dev/tui/conversation-view.js +1 -0
  44. package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +10 -0
  45. package/dist/src/cli/dev/tui/diagnostic-presentation.js +3 -2
  46. package/dist/src/cli/dev/tui/flow-drawer.d.ts +5 -2
  47. package/dist/src/cli/dev/tui/flow-drawer.js +1 -1
  48. package/dist/src/cli/dev/tui/log-display-mode.d.ts +4 -10
  49. package/dist/src/cli/dev/tui/log-display-mode.js +1 -1
  50. package/dist/src/cli/dev/tui/message-queue.d.ts +7 -63
  51. package/dist/src/cli/dev/tui/message-queue.js +3 -1
  52. package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
  53. package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +2 -0
  54. package/dist/src/cli/dev/tui/prompt-placeholder.js +1 -0
  55. package/dist/src/cli/dev/tui/question-panel.d.ts +3 -1
  56. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  57. package/dist/src/cli/dev/tui/rail.d.ts +1 -1
  58. package/dist/src/cli/dev/tui/runner.d.ts +60 -174
  59. package/dist/src/cli/dev/tui/runner.js +3 -3
  60. package/dist/src/cli/dev/tui/status-line.d.ts +4 -2
  61. package/dist/src/cli/dev/tui/status-line.js +1 -1
  62. package/dist/src/cli/dev/tui/task-activity.d.ts +59 -0
  63. package/dist/src/cli/dev/tui/task-activity.js +1 -0
  64. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +18 -57
  65. package/dist/src/cli/dev/tui/terminal-renderer.js +10 -13
  66. package/dist/src/cli/dev/tui/terminal-tool-part.d.ts +2 -0
  67. package/dist/src/cli/dev/tui/terminal-tool-part.js +1 -0
  68. package/dist/src/cli/dev/tui/test/fake-eve-server.d.ts +34 -0
  69. package/dist/src/cli/dev/tui/test/fake-eve-server.js +1 -0
  70. package/dist/src/cli/dev/tui/test/index.d.ts +1 -0
  71. package/dist/src/cli/dev/tui/test/index.js +1 -1
  72. package/dist/src/cli/dev/tui/theme.d.ts +1 -1
  73. package/dist/src/cli/dev/tui/theme.js +1 -1
  74. package/dist/src/cli/dev/tui/tool-block-groups.d.ts +6 -9
  75. package/dist/src/cli/dev/tui/tool-block-groups.js +1 -1
  76. package/dist/src/cli/dev/tui/tool-presentation.d.ts +17 -3
  77. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  78. package/dist/src/cli/dev/tui/tool-rows.d.ts +1 -0
  79. package/dist/src/cli/dev/tui/tool-rows.js +2 -2
  80. package/dist/src/cli/dev/tui/traces/trace-conversation.js +3 -1
  81. package/dist/src/cli/dev/tui/traces/trace-view.js +1 -1
  82. package/dist/src/cli/dev/tui/transcript-parts.d.ts +73 -0
  83. package/dist/src/cli/dev/tui/transcript-parts.js +3 -0
  84. package/dist/src/cli/dev/tui/transcript.d.ts +47 -0
  85. package/dist/src/cli/dev/tui/transcript.js +1 -0
  86. package/dist/src/cli/dev/tui/tui.js +1 -1
  87. package/dist/src/cli/dev/tui/turn-clock.d.ts +11 -26
  88. package/dist/src/cli/dev/tui/turn-clock.js +1 -1
  89. package/dist/src/cli/dev/tui/types.d.ts +13 -9
  90. package/dist/src/cli/dev/ui-options.d.ts +2 -2
  91. package/dist/src/cli/dev/ui-options.js +1 -1
  92. package/dist/src/cli/option-parsers.d.ts +3 -1
  93. package/dist/src/cli/option-parsers.js +1 -1
  94. package/dist/src/cli/ui/terminal-text.js +1 -1
  95. package/dist/src/client/agent-info-schema.d.ts +150 -9
  96. package/dist/src/client/agent-info-schema.js +1 -1
  97. package/dist/src/client/agent-session.d.ts +28 -0
  98. package/dist/src/client/agent-session.js +1 -0
  99. package/dist/src/client/agent-stream-follower.d.ts +26 -0
  100. package/dist/src/client/agent-stream-follower.js +1 -0
  101. package/dist/src/client/authorization-message-parts.js +1 -1
  102. package/dist/src/client/conversation-client.d.ts +40 -0
  103. package/dist/src/client/conversation-client.js +1 -0
  104. package/dist/src/client/conversation-reducer.d.ts +29 -0
  105. package/dist/src/client/conversation-reducer.js +1 -0
  106. package/dist/src/client/conversation-state.d.ts +110 -0
  107. package/dist/src/client/conversation-state.js +1 -0
  108. package/dist/src/client/eve-agent-projection.d.ts +24 -7
  109. package/dist/src/client/eve-agent-projection.js +1 -1
  110. package/dist/src/client/eve-agent-store-helpers.d.ts +20 -1
  111. package/dist/src/client/eve-agent-store-helpers.js +2 -2
  112. package/dist/src/client/eve-agent-store-state.d.ts +15 -3
  113. package/dist/src/client/eve-agent-store.d.ts +10 -1
  114. package/dist/src/client/eve-agent-store.js +1 -1
  115. package/dist/src/client/index.d.ts +5 -1
  116. package/dist/src/client/index.js +1 -1
  117. package/dist/src/client/message-action-parts.js +1 -1
  118. package/dist/src/client/message-reducer-primitives.d.ts +1 -2
  119. package/dist/src/client/message-reducer-primitives.js +1 -1
  120. package/dist/src/client/message-reducer-types.d.ts +9 -2
  121. package/dist/src/client/message-reducer.js +1 -1
  122. package/dist/src/client/message-response.js +1 -1
  123. package/dist/src/client/message-run-parts.d.ts +10 -6
  124. package/dist/src/client/message-run-parts.js +1 -1
  125. package/dist/src/client/message-task-parts.d.ts +8 -0
  126. package/dist/src/client/message-task-parts.js +1 -0
  127. package/dist/src/client/optimistic-message-submissions.d.ts +6 -4
  128. package/dist/src/client/optimistic-message-submissions.js +1 -1
  129. package/dist/src/client/reducer.d.ts +5 -1
  130. package/dist/src/client/session-controls.d.ts +0 -1
  131. package/dist/src/client/session-turn-dispatch.d.ts +15 -0
  132. package/dist/src/client/session-turn-dispatch.js +1 -0
  133. package/dist/src/client/session-utils.d.ts +29 -2
  134. package/dist/src/client/session-utils.js +1 -1
  135. package/dist/src/client/session.d.ts +8 -16
  136. package/dist/src/client/session.js +1 -1
  137. package/dist/src/client/stream-version.js +1 -1
  138. package/dist/src/client/types.d.ts +4 -5
  139. package/dist/src/compiled/.vendor-stamp.json +3 -2
  140. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  141. package/dist/src/compiled/@vercel/connect/LICENSE +202 -0
  142. package/dist/src/compiled/@vercel/connect/authorization-details.d.ts +11 -0
  143. package/dist/src/compiled/@vercel/connect/authorization.d.ts +47 -0
  144. package/dist/src/compiled/@vercel/connect/connector.d.ts +32 -0
  145. package/dist/src/compiled/@vercel/connect/index.d.ts +5 -0
  146. package/dist/src/compiled/@vercel/connect/index.js +26 -0
  147. package/dist/src/compiled/@vercel/connect/installation.d.ts +48 -0
  148. package/dist/src/compiled/@vercel/connect/token.d.ts +137 -0
  149. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  150. package/dist/src/compiler/bundled-extension.d.ts +7 -1
  151. package/dist/src/compiler/bundled-extension.js +1 -1
  152. package/dist/src/compiler/default-tool-policy.d.ts +2 -2
  153. package/dist/src/compiler/default-tool-policy.js +1 -1
  154. package/dist/src/compiler/development-extensions.js +1 -1
  155. package/dist/src/compiler/extension-compatibility.d.ts +54 -18
  156. package/dist/src/compiler/extension-compatibility.js +1 -1
  157. package/dist/src/compiler/extension-mount-bindings.d.ts +5 -0
  158. package/dist/src/compiler/extension-mount-bindings.js +1 -0
  159. package/dist/src/compiler/load-binding-namespace.d.ts +10 -2
  160. package/dist/src/compiler/load-binding-namespace.js +1 -1
  161. package/dist/src/compiler/manifest.d.ts +19 -17
  162. package/dist/src/compiler/manifest.js +1 -1
  163. package/dist/src/compiler/module-lifecycle.d.ts +2 -2
  164. package/dist/src/compiler/module-lifecycle.js +1 -1
  165. package/dist/src/compiler/module-map.d.ts +1 -1
  166. package/dist/src/compiler/module-map.js +3 -3
  167. package/dist/src/compiler/normalize-manifest-helpers.d.ts +18 -1
  168. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  169. package/dist/src/compiler/normalize-manifest-types.d.ts +2 -0
  170. package/dist/src/compiler/normalize-manifest.js +1 -1
  171. package/dist/src/compiler/normalize-subagent.js +1 -1
  172. package/dist/src/compiler/normalize-tool.js +1 -1
  173. package/dist/src/compiler/project-sources.d.ts +4 -0
  174. package/dist/src/compiler/project-sources.js +1 -1
  175. package/dist/src/compiler/remote-agent-node.js +1 -1
  176. package/dist/src/compiler/source-graph.d.ts +5 -0
  177. package/dist/src/compiler/source-graph.js +1 -1
  178. package/dist/src/computer-use/extension/lib/computer-use-sandbox.d.ts +8 -0
  179. package/dist/src/computer-use/extension/lib/computer-use-sandbox.js +3 -3
  180. package/dist/src/computer-use/extension/lib/computer-use.d.ts +2 -0
  181. package/dist/src/computer-use/extension/lib/computer-use.js +2 -1
  182. package/dist/src/computer-use/extension/tools/computer_use.js +1 -1
  183. package/dist/src/context/build-dynamic-tools.js +1 -1
  184. package/dist/src/context/dynamic-subagent-lifecycle.d.ts +5 -0
  185. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  186. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  187. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -1
  188. package/dist/src/context/key-names.d.ts +0 -1
  189. package/dist/src/context/key-names.js +1 -1
  190. package/dist/src/context/keys.d.ts +12 -15
  191. package/dist/src/context/keys.js +1 -1
  192. package/dist/src/context/memory-lifecycle.js +1 -1
  193. package/dist/src/context/memory-tools.d.ts +0 -1
  194. package/dist/src/context/provider.d.ts +5 -11
  195. package/dist/src/context/run-step.d.ts +5 -6
  196. package/dist/src/context/run-step.js +1 -1
  197. package/dist/src/context/serialize.js +1 -1
  198. package/dist/src/discover/bundled-extension.js +1 -1
  199. package/dist/src/discover/discover-agent.js +1 -1
  200. package/dist/src/discover/extensions.d.ts +0 -7
  201. package/dist/src/discover/extensions.js +1 -1
  202. package/dist/src/discover/manifest.d.ts +4 -0
  203. package/dist/src/evals/assertions/run.d.ts +4 -3
  204. package/dist/src/evals/assertions/run.js +1 -1
  205. package/dist/src/evals/index.d.ts +1 -1
  206. package/dist/src/evals/match.d.ts +4 -4
  207. package/dist/src/evals/mock-model.js +1 -1
  208. package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
  209. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  210. package/dist/src/evals/runner/execute-task.js +1 -1
  211. package/dist/src/evals/runner/reporters/assertion-scores.d.ts +19 -0
  212. package/dist/src/evals/runner/reporters/assertion-scores.js +1 -0
  213. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  214. package/dist/src/evals/runner/reporters/datadog-client.d.ts +123 -0
  215. package/dist/src/evals/runner/reporters/datadog-client.js +4 -0
  216. package/dist/src/evals/runner/reporters/datadog.d.ts +9 -98
  217. package/dist/src/evals/runner/reporters/datadog.js +2 -3
  218. package/dist/src/evals/session-content.js +1 -1
  219. package/dist/src/evals/session.d.ts +4 -4
  220. package/dist/src/evals/session.js +2 -2
  221. package/dist/src/evals/types.d.ts +34 -15
  222. package/dist/src/eve-channel/create-request.d.ts +5 -4
  223. package/dist/src/eve-channel/create-request.js +1 -1
  224. package/dist/src/eve-channel/index.d.ts +0 -9
  225. package/dist/src/eve-channel/index.js +1 -1
  226. package/dist/src/eve-channel/request.d.ts +3 -7
  227. package/dist/src/eve-channel/request.js +1 -1
  228. package/dist/src/eve-channel/support.d.ts +15 -5
  229. package/dist/src/eve-channel/support.js +1 -1
  230. package/dist/src/eve-channel/turn-policy-request.d.ts +2 -0
  231. package/dist/src/eve-channel/turn-policy-request.js +1 -0
  232. package/dist/src/eve-channel/types.d.ts +4 -0
  233. package/dist/src/execution/agent-sessions/context.d.ts +62 -0
  234. package/dist/src/execution/agent-sessions/context.js +1 -0
  235. package/dist/src/{subagents/remote-dispatch.d.ts → execution/agent-sessions/remote.d.ts} +17 -40
  236. package/dist/src/execution/agent-sessions/remote.js +1 -0
  237. package/dist/src/execution/agent-sessions/requests.d.ts +20 -0
  238. package/dist/src/execution/agent-sessions/requests.js +1 -0
  239. package/dist/src/execution/agent-sessions/session.d.ts +12 -0
  240. package/dist/src/execution/agent-sessions/session.js +1 -0
  241. package/dist/src/execution/agent-sessions/steps.d.ts +59 -0
  242. package/dist/src/execution/agent-sessions/steps.js +1 -0
  243. package/dist/src/execution/agent-sessions/target.d.ts +45 -0
  244. package/dist/src/execution/agent-sessions/target.js +1 -0
  245. package/dist/src/execution/agent-sessions/usage.d.ts +18 -0
  246. package/dist/src/execution/agent-sessions/usage.js +1 -0
  247. package/dist/src/execution/authorization-callback-match.d.ts +2 -4
  248. package/dist/src/execution/authorization-callback-match.js +1 -1
  249. package/dist/src/execution/cancel-descendant-turns-step.d.ts +1 -5
  250. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  251. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  252. package/dist/src/execution/connection-announcement.d.ts +7 -0
  253. package/dist/src/execution/connection-announcement.js +4 -0
  254. package/dist/src/execution/continuation-conflict-step.d.ts +2 -3
  255. package/dist/src/execution/continuation-conflict-step.js +1 -1
  256. package/dist/src/execution/coordination-dispatch-shared.d.ts +12 -28
  257. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  258. package/dist/src/execution/coordination-dispatch-step.d.ts +3 -2
  259. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  260. package/dist/src/execution/create-session-step.d.ts +4 -3
  261. package/dist/src/execution/create-session-step.js +1 -1
  262. package/dist/src/execution/deliver-payloads.js +1 -1
  263. package/dist/src/execution/durable-session-store.d.ts +10 -5
  264. package/dist/src/execution/durable-session-store.js +1 -1
  265. package/dist/src/execution/dynamic-connections.js +1 -1
  266. package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
  267. package/dist/src/execution/dynamic-workflow/schema.d.ts +1 -3
  268. package/dist/src/execution/dynamic-workflow/schema.js +1 -1
  269. package/dist/src/execution/dynamic-workflow/tool.d.ts +1 -1
  270. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  271. package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
  272. package/dist/src/execution/forward-session-input.d.ts +4 -0
  273. package/dist/src/execution/forward-session-input.js +1 -0
  274. package/dist/src/execution/legacy-remote-agent/protocol.d.ts +41 -0
  275. package/dist/src/execution/legacy-remote-agent/protocol.js +1 -0
  276. package/dist/src/execution/legacy-session/authorization.js +1 -1
  277. package/dist/src/execution/legacy-session/completion-step.d.ts +2 -0
  278. package/dist/src/execution/legacy-session/completion-step.js +1 -1
  279. package/dist/src/execution/legacy-session/inbox.js +1 -1
  280. package/dist/src/execution/legacy-session/input.js +1 -1
  281. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  282. package/dist/src/execution/legacy-session/prepare-step.d.ts +1 -0
  283. package/dist/src/execution/legacy-session/prepare-step.js +1 -1
  284. package/dist/src/execution/legacy-session/snapshot.d.ts +8 -4
  285. package/dist/src/execution/legacy-session/snapshot.js +1 -1
  286. package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
  287. package/dist/src/execution/model-call-batching.js +1 -1
  288. package/dist/src/execution/node-step.d.ts +1 -1
  289. package/dist/src/execution/node-step.js +1 -1
  290. package/dist/src/execution/proxied-deliver-step.d.ts +9 -6
  291. package/dist/src/execution/proxied-deliver-step.js +1 -1
  292. package/dist/src/execution/publish-session-events.d.ts +150 -0
  293. package/dist/src/execution/publish-session-events.js +1 -0
  294. package/dist/src/execution/reconcile-session-continuation-token.d.ts +2 -2
  295. package/dist/src/execution/route-child-delivery.d.ts +5 -4
  296. package/dist/src/execution/route-child-delivery.js +1 -3
  297. package/dist/src/execution/runtime-context.js +1 -1
  298. package/dist/src/execution/sandbox/prewarm.js +1 -1
  299. package/dist/src/execution/session/active-turn.d.ts +97 -0
  300. package/dist/src/execution/session/active-turn.js +1 -0
  301. package/dist/src/execution/session/admission.d.ts +1 -12
  302. package/dist/src/execution/session/admission.js +1 -1
  303. package/dist/src/execution/session/entry-input.d.ts +0 -2
  304. package/dist/src/execution/session/entry.js +1 -1
  305. package/dist/src/execution/session/finalization.js +1 -1
  306. package/dist/src/execution/session/handoff-steps.d.ts +13 -2
  307. package/dist/src/execution/session/handoff-steps.js +1 -1
  308. package/dist/src/execution/session/handoff.d.ts +21 -5
  309. package/dist/src/execution/session/handoff.js +1 -1
  310. package/dist/src/execution/session/input-queue.d.ts +44 -39
  311. package/dist/src/execution/session/input-queue.js +1 -1
  312. package/dist/src/execution/session/next-input.d.ts +7 -10
  313. package/dist/src/execution/session/next-input.js +1 -1
  314. package/dist/src/execution/session/pending-turn-state.d.ts +2 -0
  315. package/dist/src/execution/session/pending-turn-state.js +1 -1
  316. package/dist/src/execution/session/principal.d.ts +14 -0
  317. package/dist/src/execution/session/principal.js +1 -0
  318. package/dist/src/execution/session/program.d.ts +2 -0
  319. package/dist/src/execution/session/program.js +1 -1
  320. package/dist/src/execution/session/route-selected-delivery.js +1 -1
  321. package/dist/src/execution/session/state-cursor.d.ts +26 -18
  322. package/dist/src/execution/session/state-cursor.js +1 -1
  323. package/dist/src/execution/session/state-delta.d.ts +40 -0
  324. package/dist/src/execution/session/state-delta.js +1 -0
  325. package/dist/src/execution/session/timeout-steps.js +1 -1
  326. package/dist/src/execution/session/turn-event-handler.d.ts +2 -2
  327. package/dist/src/execution/session/turn-event-handler.js +1 -1
  328. package/dist/src/execution/session/turn-step-result.d.ts +1 -3
  329. package/dist/src/execution/session/turn-step-result.js +1 -1
  330. package/dist/src/execution/session/turn-step-types.d.ts +37 -19
  331. package/dist/src/execution/session/turn-step.d.ts +2 -2
  332. package/dist/src/execution/session/turn-step.js +1 -1
  333. package/dist/src/execution/session/turn-waiting-step.d.ts +4 -0
  334. package/dist/src/execution/session/turn-waiting-step.js +1 -0
  335. package/dist/src/execution/session/turn.d.ts +41 -3
  336. package/dist/src/execution/session/turn.js +1 -1
  337. package/dist/src/execution/session-callback-request.js +1 -1
  338. package/dist/src/execution/session-event-stream.d.ts +33 -0
  339. package/dist/src/execution/session-event-stream.js +1 -0
  340. package/dist/src/execution/session-inbox/inbox.d.ts +2 -0
  341. package/dist/src/execution/session-inbox/inbox.js +1 -1
  342. package/dist/src/execution/session-inbox/protocol.js +1 -1
  343. package/dist/src/execution/session-inbox/release-step.js +1 -1
  344. package/dist/src/execution/session-inbox/resume.js +1 -1
  345. package/dist/src/execution/session-workflow-tool-run.d.ts +11 -2
  346. package/dist/src/execution/session-workflow-tool-run.js +1 -1
  347. package/dist/src/execution/session.d.ts +5 -6
  348. package/dist/src/execution/session.js +2 -2
  349. package/dist/src/execution/settle-cancelled-turn-step.d.ts +23 -10
  350. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  351. package/dist/src/execution/stable-workflow-names.d.ts +0 -1
  352. package/dist/src/execution/stable-workflow-names.js +1 -1
  353. package/dist/src/execution/tasks/calls.d.ts +42 -0
  354. package/dist/src/execution/tasks/calls.js +1 -0
  355. package/dist/src/execution/tasks/model-step.d.ts +58 -0
  356. package/dist/src/execution/tasks/model-step.js +1 -0
  357. package/dist/src/execution/tasks/render.d.ts +66 -0
  358. package/dist/src/execution/tasks/render.js +8 -0
  359. package/dist/src/execution/tasks/session.d.ts +19 -0
  360. package/dist/src/execution/tasks/session.js +1 -0
  361. package/dist/src/execution/tasks/start.d.ts +34 -0
  362. package/dist/src/execution/tasks/start.js +1 -0
  363. package/dist/src/execution/tasks/steps.d.ts +31 -0
  364. package/dist/src/execution/tasks/steps.js +1 -0
  365. package/dist/src/execution/tasks/table.d.ts +192 -0
  366. package/dist/src/execution/tasks/table.js +1 -0
  367. package/dist/src/execution/tasks/task-id-input.d.ts +19 -0
  368. package/dist/src/execution/tasks/task-id-input.js +1 -0
  369. package/dist/src/execution/tasks/tool-entry-point.d.ts +11 -0
  370. package/dist/src/execution/tasks/tool-entry-point.js +1 -0
  371. package/dist/src/execution/tasks/workflow-target.d.ts +2 -0
  372. package/dist/src/execution/tasks/workflow-target.js +1 -1
  373. package/dist/src/execution/terminal-session-completion-step.d.ts +2 -0
  374. package/dist/src/execution/terminal-session-completion-step.js +1 -1
  375. package/dist/src/execution/terminal-session-failure-step.d.ts +2 -0
  376. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  377. package/dist/src/execution/terminate-child-sessions-step.d.ts +2 -9
  378. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  379. package/dist/src/execution/tool-auth.js +1 -1
  380. package/dist/src/execution/tools/agent-router-workflow.d.ts +1 -1
  381. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  382. package/dist/src/execution/tools/agent-router.d.ts +1 -1
  383. package/dist/src/execution/tools/agent-router.js +1 -1
  384. package/dist/src/execution/tools/connection-approval.d.ts +25 -0
  385. package/dist/src/execution/tools/connection-approval.js +1 -0
  386. package/dist/src/execution/tools/connection-search-rank.d.ts +21 -0
  387. package/dist/src/execution/tools/connection-search-rank.js +1 -0
  388. package/dist/src/execution/tools/connection-target.d.ts +18 -0
  389. package/dist/src/execution/tools/connection-target.js +1 -0
  390. package/dist/src/execution/tools/connection-tools.d.ts +10 -0
  391. package/dist/src/execution/tools/connection-tools.js +2 -0
  392. package/dist/src/execution/tools/load-skill.js +1 -1
  393. package/dist/src/execution/tools/workflow/answer.d.ts +7 -4
  394. package/dist/src/execution/tools/workflow/answer.js +1 -1
  395. package/dist/src/execution/tools/workflow/ask.d.ts +73 -10
  396. package/dist/src/execution/tools/workflow/ask.js +1 -1
  397. package/dist/src/execution/tools/workflow/body.d.ts +60 -19
  398. package/dist/src/execution/tools/workflow/body.js +1 -1
  399. package/dist/src/execution/tools/workflow/cancel.d.ts +7 -2
  400. package/dist/src/execution/tools/workflow/cancel.js +1 -1
  401. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +10 -4
  402. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
  403. package/dist/src/execution/tools/workflow/{background.d.ts → harness-definition.d.ts} +6 -6
  404. package/dist/src/execution/tools/workflow/harness-definition.js +1 -0
  405. package/dist/src/execution/tools/workflow/interrupt.d.ts +6 -0
  406. package/dist/src/execution/tools/workflow/interrupt.js +1 -0
  407. package/dist/src/execution/tools/workflow/messages.d.ts +135 -10
  408. package/dist/src/execution/tools/workflow/messages.js +1 -1
  409. package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
  410. package/dist/src/execution/tools/workflow/owner.d.ts +15 -4
  411. package/dist/src/execution/tools/workflow/owner.js +1 -1
  412. package/dist/src/execution/tools/workflow/serve.d.ts +3 -0
  413. package/dist/src/execution/tools/workflow/serve.js +1 -0
  414. package/dist/src/execution/tools/workflow/start.d.ts +18 -11
  415. package/dist/src/execution/tools/workflow/start.js +1 -1
  416. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  417. package/dist/src/execution/tools/workflow/step.js +1 -1
  418. package/dist/src/execution/tools/workflow/types.d.ts +0 -10
  419. package/dist/src/execution/tools/workflow/withdraw-step.d.ts +31 -0
  420. package/dist/src/execution/tools/workflow/withdraw-step.js +1 -0
  421. package/dist/src/execution/tools/workflow/workflow-owner-blocking.d.ts +3 -5
  422. package/dist/src/execution/tools/workflow/workflow-owner-blocking.js +1 -1
  423. package/dist/src/execution/tools/workflow/workflow.d.ts +3 -3
  424. package/dist/src/execution/tools/workflow/workflow.js +1 -1
  425. package/dist/src/execution/web-fetch/request.js +1 -1
  426. package/dist/src/execution/workflow-callback-url.d.ts +0 -5
  427. package/dist/src/execution/workflow-callback-url.js +1 -1
  428. package/dist/src/execution/workflow-runtime.d.ts +3 -5
  429. package/dist/src/execution/workflow-runtime.js +1 -1
  430. package/dist/src/execution/workflow-webhook-route.js +1 -1
  431. package/dist/src/extensions/code/extension/lib/connect-authentication.js +1 -1
  432. package/dist/src/extensions/code/extension/lib/github-shell.js +1 -1
  433. package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
  434. package/dist/src/framework/sources/modules/agent.d.ts +1 -0
  435. package/dist/src/framework/sources/modules/agent.js +1 -1
  436. package/dist/src/framework/sources/registry.js +1 -1
  437. package/dist/src/harness/action-presentation.js +1 -1
  438. package/dist/src/harness/action-result-helpers.d.ts +1 -0
  439. package/dist/src/harness/action-result-helpers.js +1 -1
  440. package/dist/src/harness/advertised-tools.d.ts +1 -1
  441. package/dist/src/harness/advertised-tools.js +1 -1
  442. package/dist/src/harness/announcements.d.ts +22 -0
  443. package/dist/src/harness/announcements.js +1 -0
  444. package/dist/src/harness/approval-candidates.d.ts +10 -2
  445. package/dist/src/harness/approval-candidates.js +1 -1
  446. package/dist/src/harness/approval-delivery-coordinator.d.ts +4 -5
  447. package/dist/src/harness/approval-delivery-coordinator.js +1 -1
  448. package/dist/src/harness/approval-recheck.d.ts +7 -0
  449. package/dist/src/harness/approval-recheck.js +1 -0
  450. package/dist/src/harness/authorization-event-fields.d.ts +13 -0
  451. package/dist/src/harness/authorization-event-fields.js +1 -0
  452. package/dist/src/harness/authorization.d.ts +17 -3
  453. package/dist/src/harness/authorization.js +1 -1
  454. package/dist/src/harness/cancelled-turn-emission.d.ts +2 -1
  455. package/dist/src/harness/cancelled-turn-emission.js +1 -1
  456. package/dist/src/harness/coordination.d.ts +36 -30
  457. package/dist/src/harness/coordination.js +1 -1
  458. package/dist/src/harness/current-messages.d.ts +6 -1
  459. package/dist/src/harness/current-messages.js +1 -1
  460. package/dist/src/harness/emission.d.ts +11 -2
  461. package/dist/src/harness/emission.js +1 -1
  462. package/dist/src/harness/execute-tool.d.ts +4 -15
  463. package/dist/src/harness/held-requests.d.ts +18 -0
  464. package/dist/src/harness/held-requests.js +1 -0
  465. package/dist/src/harness/hitl/approval-input-requests.d.ts +16 -0
  466. package/dist/src/harness/hitl/approval-input-requests.js +1 -1
  467. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +2 -0
  468. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
  469. package/dist/src/harness/input-extraction.js +1 -1
  470. package/dist/src/harness/input-request-resolution.d.ts +5 -2
  471. package/dist/src/harness/input-request-resolution.js +1 -1
  472. package/dist/src/harness/input-requests.d.ts +0 -4
  473. package/dist/src/harness/input-requests.js +1 -1
  474. package/dist/src/harness/messages.d.ts +11 -3
  475. package/dist/src/harness/messages.js +1 -1
  476. package/dist/src/harness/model-call-error.js +1 -1
  477. package/dist/src/harness/nested-actions.d.ts +23 -0
  478. package/dist/src/harness/nested-actions.js +1 -0
  479. package/dist/src/harness/pending-input-batches.d.ts +8 -6
  480. package/dist/src/harness/pending-input-batches.js +1 -1
  481. package/dist/src/harness/provider-tool-history.d.ts +7 -2
  482. package/dist/src/harness/provider-tool-history.js +1 -1
  483. package/dist/src/harness/proxy-input-requests.d.ts +45 -40
  484. package/dist/src/harness/proxy-input-requests.js +1 -1
  485. package/dist/src/harness/session-limit-enforcement.js +1 -1
  486. package/dist/src/harness/stale-input-responses.js +1 -1
  487. package/dist/src/harness/step-hooks.js +1 -1
  488. package/dist/src/harness/tool-loop.js +2 -2
  489. package/dist/src/harness/tool-model-output.js +1 -1
  490. package/dist/src/harness/tool-presentation.js +1 -1
  491. package/dist/src/harness/tools.d.ts +1 -5
  492. package/dist/src/harness/tools.js +1 -1
  493. package/dist/src/harness/turn-tag-state.d.ts +8 -5
  494. package/dist/src/harness/turn-tag-state.js +1 -1
  495. package/dist/src/harness/types.d.ts +25 -21
  496. package/dist/src/harness/workflow-dispatch.d.ts +30 -0
  497. package/dist/src/harness/workflow-dispatch.js +1 -0
  498. package/dist/src/harness/workflow-tool-runs.d.ts +5 -65
  499. package/dist/src/harness/workflow-tool-runs.js +1 -1
  500. package/dist/src/instrumentation/channel-delivery.d.ts +1 -0
  501. package/dist/src/instrumentation/channel-delivery.js +1 -1
  502. package/dist/src/instrumentation/lifecycle.d.ts +7 -0
  503. package/dist/src/instrumentation/memory.d.ts +2 -0
  504. package/dist/src/instrumentation/memory.js +1 -1
  505. package/dist/src/instrumentation/native-events.d.ts +1 -7
  506. package/dist/src/instrumentation/native-events.js +1 -1
  507. package/dist/src/instrumentation/runtime.d.ts +5 -7
  508. package/dist/src/instrumentation/runtime.js +1 -1
  509. package/dist/src/instrumentation/session-init.js +1 -1
  510. package/dist/src/instrumentation/state.d.ts +0 -6
  511. package/dist/src/instrumentation/state.js +1 -1
  512. package/dist/src/internal/application/package.js +1 -1
  513. package/dist/src/internal/authored-definition/schema-backed.d.ts +10 -0
  514. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  515. package/dist/src/internal/authored-module-loader.d.ts +20 -6
  516. package/dist/src/internal/authored-module-loader.js +2 -2
  517. package/dist/src/internal/authored-module-map-loader.js +1 -1
  518. package/dist/src/internal/authored-package-boundary.d.ts +3 -0
  519. package/dist/src/internal/authored-package-boundary.js +1 -1
  520. package/dist/src/internal/bundler/extension-mount-plugin.d.ts +14 -0
  521. package/dist/src/internal/bundler/extension-mount-plugin.js +1 -0
  522. package/dist/src/internal/bundler/extension-scope-plugin.d.ts +8 -11
  523. package/dist/src/internal/bundler/extension-scope-plugin.js +2 -3
  524. package/dist/src/internal/invocation/workflow-execution.d.ts +2 -2
  525. package/dist/src/internal/invocation/workflow-execution.js +1 -1
  526. package/dist/src/internal/mount-state.d.ts +1 -0
  527. package/dist/src/internal/mount-state.js +1 -0
  528. package/dist/src/internal/nitro/host/build-application.js +1 -1
  529. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  530. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  531. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  532. package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
  533. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
  534. package/dist/src/internal/node-esm-compat-banner.js +1 -1
  535. package/dist/src/internal/workflow/development-world-client.js +1 -1
  536. package/dist/src/internal/workflow-bundle/authored-workflow-directives.d.ts +4 -3
  537. package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
  538. package/dist/src/internal/workflow-bundle/builder.js +1 -1
  539. package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.js +1 -1
  540. package/dist/src/internal/workflow-bundle/dynamic-remote-agent-transform.js +1 -1
  541. package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.d.ts +27 -1
  542. package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.js +1 -1
  543. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +2 -2
  544. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  545. package/dist/src/models/auto.d.ts +6 -0
  546. package/dist/src/models/auto.js +2 -2
  547. package/dist/src/protocol/message-version.d.ts +1 -0
  548. package/dist/src/protocol/message-version.js +1 -1
  549. package/dist/src/protocol/message.d.ts +166 -69
  550. package/dist/src/protocol/message.js +2 -2
  551. package/dist/src/protocol/remote-agent-protocol.d.ts +16 -0
  552. package/dist/src/protocol/remote-agent-protocol.js +1 -0
  553. package/dist/src/protocol/routes.d.ts +0 -6
  554. package/dist/src/protocol/routes.js +1 -1
  555. package/dist/src/protocol/task-tools.d.ts +21 -0
  556. package/dist/src/protocol/task-tools.js +1 -0
  557. package/dist/src/public/channels/auth.js +1 -1
  558. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +25 -16
  559. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  560. package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
  561. package/dist/src/public/channels/chat-sdk/input-actions.d.ts +8 -0
  562. package/dist/src/public/channels/chat-sdk/input-actions.js +1 -0
  563. package/dist/src/public/channels/index.d.ts +1 -1
  564. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  565. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  566. package/dist/src/public/channels/slack/action-status.d.ts +11 -12
  567. package/dist/src/public/channels/slack/action-status.js +1 -1
  568. package/dist/src/public/channels/slack/api.js +1 -1
  569. package/dist/src/public/channels/slack/approval-cards.d.ts +15 -0
  570. package/dist/src/public/channels/slack/approval-cards.js +2 -0
  571. package/dist/src/public/channels/slack/attachments.js +1 -1
  572. package/dist/src/public/channels/slack/auth.d.ts +5 -0
  573. package/dist/src/public/channels/slack/auth.js +1 -1
  574. package/dist/src/public/channels/slack/connections.d.ts +20 -16
  575. package/dist/src/public/channels/slack/connections.js +1 -1
  576. package/dist/src/public/channels/slack/defaults.d.ts +13 -33
  577. package/dist/src/public/channels/slack/defaults.js +3 -4
  578. package/dist/src/public/channels/slack/hitl.d.ts +22 -13
  579. package/dist/src/public/channels/slack/hitl.js +2 -2
  580. package/dist/src/public/channels/slack/inbound.d.ts +10 -2
  581. package/dist/src/public/channels/slack/inbound.js +1 -1
  582. package/dist/src/public/channels/slack/index.d.ts +6 -3
  583. package/dist/src/public/channels/slack/index.js +1 -1
  584. package/dist/src/public/channels/slack/input-response.d.ts +1 -5
  585. package/dist/src/public/channels/slack/input-response.js +1 -1
  586. package/dist/src/public/channels/slack/interaction-cards.js +1 -1
  587. package/dist/src/public/channels/slack/interactions.js +1 -1
  588. package/dist/src/public/channels/slack/limits.d.ts +5 -3
  589. package/dist/src/public/channels/slack/private-approval-delivery.js +1 -1
  590. package/dist/src/public/channels/slack/renderers.d.ts +76 -0
  591. package/dist/src/public/channels/slack/renderers.js +1 -0
  592. package/dist/src/public/channels/slack/reply-delivery.d.ts +72 -0
  593. package/dist/src/public/channels/slack/reply-delivery.js +1 -0
  594. package/dist/src/public/channels/slack/session-operations.d.ts +6 -0
  595. package/dist/src/public/channels/slack/session-operations.js +1 -1
  596. package/dist/src/public/channels/slack/sign-in-cancel.d.ts +20 -0
  597. package/dist/src/public/channels/slack/sign-in-cancel.js +1 -0
  598. package/dist/src/public/channels/slack/slackChannel.d.ts +62 -103
  599. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  600. package/dist/src/public/channels/slack/task-card.d.ts +24 -0
  601. package/dist/src/public/channels/slack/task-card.js +1 -0
  602. package/dist/src/public/channels/teams/defaults.d.ts +1 -1
  603. package/dist/src/public/channels/teams/defaults.js +2 -2
  604. package/dist/src/public/channels/telegram/hitl.d.ts +7 -1
  605. package/dist/src/public/channels/telegram/hitl.js +2 -1
  606. package/dist/src/public/channels/telegram/state.js +1 -1
  607. package/dist/src/public/channels/telegram/telegramChannel.d.ts +5 -0
  608. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  609. package/dist/src/public/definitions/channel.d.ts +7 -1
  610. package/dist/src/public/definitions/channel.js +1 -1
  611. package/dist/src/public/definitions/connections/mcp.d.ts +4 -6
  612. package/dist/src/public/definitions/connections/openapi.d.ts +7 -8
  613. package/dist/src/public/definitions/extension.d.ts +2 -2
  614. package/dist/src/public/definitions/extension.js +1 -1
  615. package/dist/src/public/definitions/hook.d.ts +4 -4
  616. package/dist/src/public/definitions/state.d.ts +4 -2
  617. package/dist/src/public/definitions/state.js +1 -1
  618. package/dist/src/public/memory/index.d.ts +0 -1
  619. package/dist/src/public/models/openai/index.d.ts +1 -1
  620. package/dist/src/public/models/openai/index.js +1 -1
  621. package/dist/src/public/next/index.js +1 -1
  622. package/dist/src/public/next/server.d.ts +2 -0
  623. package/dist/src/public/next/server.js +1 -2
  624. package/dist/src/public/nuxt/module.d.ts +6 -0
  625. package/dist/src/public/nuxt/module.js +1 -1
  626. package/dist/src/public/schedules/index.d.ts +1 -0
  627. package/dist/src/public/schedules/index.js +1 -1
  628. package/dist/src/public/server/index.d.ts +28 -0
  629. package/dist/src/public/server/index.js +1 -0
  630. package/dist/src/public/tools/index.d.ts +3 -2
  631. package/dist/src/public/tools/index.js +1 -1
  632. package/dist/src/public/tools/no-reply.d.ts +1 -0
  633. package/dist/src/public/tools/no-reply.js +1 -0
  634. package/dist/src/react/index.d.ts +3 -0
  635. package/dist/src/react/index.js +1 -1
  636. package/dist/src/react/use-eve-agent.d.ts +7 -5
  637. package/dist/src/react/use-eve-agent.js +1 -1
  638. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +6 -7
  639. package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
  640. package/dist/src/runtime/agent/bootstrap.d.ts +0 -1
  641. package/dist/src/runtime/agent/bootstrap.js +1 -1
  642. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  643. package/dist/src/runtime/agent/mock-model-fixtures.d.ts +1 -1
  644. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  645. package/dist/src/runtime/channels/registry.js +1 -1
  646. package/dist/src/runtime/connections/mcp-client.d.ts +1 -9
  647. package/dist/src/runtime/connections/mcp-client.js +1 -1
  648. package/dist/src/runtime/connections/openapi-client.js +1 -1
  649. package/dist/src/runtime/connections/scoped-authorization.d.ts +3 -1
  650. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  651. package/dist/src/runtime/connections/tool-result.d.ts +27 -0
  652. package/dist/src/runtime/connections/tool-result.js +2 -0
  653. package/dist/src/runtime/connections/tool-signature.d.ts +14 -0
  654. package/dist/src/runtime/connections/tool-signature.js +1 -0
  655. package/dist/src/runtime/local-dev-capability.js +1 -1
  656. package/dist/src/runtime/prompt/compose.d.ts +1 -3
  657. package/dist/src/runtime/prompt/compose.js +3 -3
  658. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  659. package/dist/src/runtime/resolve-tool.js +1 -1
  660. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  661. package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
  662. package/dist/src/runtime/sessions/turn.d.ts +1 -16
  663. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  664. package/dist/src/runtime/subagents/registry.js +1 -1
  665. package/dist/src/runtime/subagents/workflow-reference.d.ts +6 -3
  666. package/dist/src/runtime/subagents/workflow-reference.js +1 -1
  667. package/dist/src/runtime/subagents/workflow.d.ts +12 -6
  668. package/dist/src/runtime/subagents/workflow.js +1 -1
  669. package/dist/src/runtime/tools/registry.js +1 -1
  670. package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -0
  671. package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
  672. package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
  673. package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
  674. package/dist/src/self-modification/extension/subagents/agent/instructions.js +7 -7
  675. package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
  676. package/dist/src/self-modification/extension/subagents/agent/tools/search_registry.d.ts +2 -0
  677. package/dist/src/self-modification/extension/subagents/agent/tools/search_registry.js +1 -1
  678. package/dist/src/self-modification/scaffold.d.ts +2 -0
  679. package/dist/src/self-modification/scaffold.js +7 -0
  680. package/dist/src/self-modification/setup.js +1 -7
  681. package/dist/src/setup/boxes/deploy-project.js +1 -1
  682. package/dist/src/setup/boxes/select-model.js +1 -1
  683. package/dist/src/setup/integrations/shopify/templates.d.ts +1 -1
  684. package/dist/src/setup/integrations/shopify/templates.js +31 -19
  685. package/dist/src/setup/integrations/web/setup.js +6 -2
  686. package/dist/src/setup/scaffold/create/agent-paths.d.ts +5 -0
  687. package/dist/src/setup/scaffold/create/agent-paths.js +1 -0
  688. package/dist/src/setup/scaffold/create/instructions-template.d.ts +1 -0
  689. package/dist/src/setup/scaffold/create/instructions-template.js +8 -0
  690. package/dist/src/setup/scaffold/create/project.js +3 -10
  691. package/dist/src/setup/scaffold/create/web-template.d.ts +2 -2
  692. package/dist/src/setup/scaffold/create/web-template.js +28 -9
  693. package/dist/src/setup/vercel-project-framework.js +1 -1
  694. package/dist/src/shared/action-request-name.d.ts +3 -0
  695. package/dist/src/shared/action-request-name.js +1 -0
  696. package/dist/src/shared/action-types.d.ts +49 -21
  697. package/dist/src/shared/action-types.js +1 -1
  698. package/dist/src/shared/agent-definition.d.ts +0 -7
  699. package/dist/src/shared/chatgpt-model.d.ts +1 -1
  700. package/dist/src/shared/chatgpt-model.js +1 -1
  701. package/dist/src/shared/connection-types.d.ts +2 -8
  702. package/dist/src/shared/default-agent-model.d.ts +10 -1
  703. package/dist/src/shared/default-agent-model.js +1 -1
  704. package/dist/src/shared/display-name.d.ts +15 -0
  705. package/dist/src/shared/display-name.js +1 -0
  706. package/dist/src/shared/extension-mount.d.ts +2 -0
  707. package/dist/src/shared/extension-mount.js +1 -0
  708. package/dist/src/shared/format-duration.d.ts +2 -0
  709. package/dist/src/shared/format-duration.js +1 -0
  710. package/dist/src/shared/framework-eve-server.d.ts +43 -0
  711. package/dist/src/shared/framework-eve-server.js +2 -0
  712. package/dist/src/shared/input.d.ts +1 -0
  713. package/dist/src/shared/memory-state.d.ts +1 -0
  714. package/dist/src/shared/memory-state.js +1 -1
  715. package/dist/src/shared/model-helper.d.ts +2 -2
  716. package/dist/src/shared/model-helper.js +1 -1
  717. package/dist/src/shared/model-summary.d.ts +2 -6
  718. package/dist/src/shared/model-summary.js +1 -1
  719. package/dist/src/shared/presentation-text.d.ts +5 -0
  720. package/dist/src/shared/presentation-text.js +1 -1
  721. package/dist/src/shared/serialized-observability-state.d.ts +0 -4
  722. package/dist/src/shared/serialized-observability-state.js +1 -1
  723. package/dist/src/shared/token-usage.d.ts +2 -0
  724. package/dist/src/shared/token-usage.js +1 -1
  725. package/dist/src/shared/trace-root.d.ts +8 -0
  726. package/dist/src/shared/trace-root.js +1 -0
  727. package/dist/src/shared/value-delta.d.ts +39 -0
  728. package/dist/src/shared/value-delta.js +1 -0
  729. package/dist/src/subagents/adapter-state.d.ts +0 -2
  730. package/dist/src/subagents/adapter-state.js +1 -1
  731. package/dist/src/subagents/adapter.js +1 -1
  732. package/dist/src/subagents/callback-route.js +1 -1
  733. package/dist/src/subagents/event-proxy-step.d.ts +16 -29
  734. package/dist/src/subagents/event-proxy-step.js +1 -1
  735. package/dist/src/subagents/hitl-proxy.d.ts +38 -20
  736. package/dist/src/subagents/hitl-proxy.js +1 -1
  737. package/dist/src/subagents/invocation.d.ts +4 -3
  738. package/dist/src/subagents/parent-notification.d.ts +2 -1
  739. package/dist/src/subagents/parent-notification.js +1 -1
  740. package/dist/src/subagents/token-budget.d.ts +8 -9
  741. package/dist/src/subagents/token-budget.js +1 -1
  742. package/dist/src/subagents/tool.d.ts +6 -12
  743. package/dist/src/subagents/tool.js +1 -1
  744. package/dist/src/svelte/index.d.ts +3 -0
  745. package/dist/src/svelte/index.js +2 -2
  746. package/dist/src/svelte/use-eve-agent.d.ts +7 -4
  747. package/dist/src/svelte/use-eve-agent.js +1 -1
  748. package/dist/src/tools/behavior.d.ts +5 -5
  749. package/dist/src/tools/definition.d.ts +50 -14
  750. package/dist/src/tools/definition.js +1 -1
  751. package/dist/src/tools/durable-callbacks.d.ts +1 -1
  752. package/dist/src/tools/dynamic.d.ts +6 -0
  753. package/dist/src/tools/framework/agent-contract.d.ts +2 -5
  754. package/dist/src/tools/framework/agent-contract.js +1 -1
  755. package/dist/src/tools/framework/agent.d.ts +2 -5
  756. package/dist/src/tools/framework/agent.js +1 -1
  757. package/dist/src/tools/framework/connection-tools.d.ts +3 -0
  758. package/dist/src/tools/framework/connection-tools.js +1 -0
  759. package/dist/src/tools/provided/agent-router.d.ts +6 -3
  760. package/dist/src/tools/provided/agent-router.js +1 -1
  761. package/dist/src/{execution/tools → tools/provided}/ask-question-workflow.d.ts +3 -4
  762. package/dist/src/tools/provided/ask-question-workflow.js +1 -0
  763. package/dist/src/tools/provided/ask-question.d.ts +20 -5
  764. package/dist/src/tools/provided/ask-question.js +2 -1
  765. package/dist/src/tools/provided/interrupted.d.ts +18 -0
  766. package/dist/src/tools/provided/interrupted.js +1 -0
  767. package/dist/src/tools/provided/load-skill.js +1 -1
  768. package/dist/src/tools/provided/no-reply.d.ts +19 -0
  769. package/dist/src/tools/provided/no-reply.js +1 -0
  770. package/dist/src/tools/provided/sleep-workflow.d.ts +4 -0
  771. package/dist/src/tools/provided/sleep-workflow.js +1 -0
  772. package/dist/src/tools/provided/sleep.d.ts +11 -5
  773. package/dist/src/tools/provided/sleep.js +1 -1
  774. package/dist/src/tools/provided/task-cancel.d.ts +6 -0
  775. package/dist/src/tools/provided/task-cancel.js +1 -0
  776. package/dist/src/tools/provided/task-wait.d.ts +9 -0
  777. package/dist/src/tools/provided/task-wait.js +1 -0
  778. package/dist/src/tools/provided/workflow.d.ts +2 -2
  779. package/dist/src/tools/provided/workflow.js +1 -1
  780. package/dist/src/tools/schema-emission.d.ts +23 -0
  781. package/dist/src/tools/schema-emission.js +1 -0
  782. package/dist/src/tools/schema.d.ts +22 -8
  783. package/dist/src/tools/schema.js +1 -1
  784. package/dist/src/tools/workflow-definition.d.ts +187 -85
  785. package/dist/src/tools/workflow-definition.js +1 -1
  786. package/dist/src/tools/workflow-entry-point.d.ts +3 -0
  787. package/dist/src/tools/workflow-entry-point.js +1 -0
  788. package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -3
  789. package/dist/src/tracing/agent-action-instrumentation.js +1 -1
  790. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  791. package/dist/src/tracing/agent-invocation-coordinator.d.ts +9 -18
  792. package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
  793. package/dist/src/tracing/agent-memory-instrumentation.js +1 -1
  794. package/dist/src/tracing/agent-otel-attributes.d.ts +6 -0
  795. package/dist/src/tracing/agent-otel-attributes.js +1 -1
  796. package/dist/src/tracing/agent-otel-content.d.ts +0 -2
  797. package/dist/src/tracing/agent-otel-content.js +3 -3
  798. package/dist/src/tracing/agent-otel-provider.js +2 -2
  799. package/dist/src/tracing/agent-otel-runtime-context.d.ts +20 -0
  800. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  801. package/dist/src/tracing/agent-otel-session-context.js +1 -1
  802. package/dist/src/tracing/agent-otel-usage.js +1 -1
  803. package/dist/src/tracing/agent-span-contract.d.ts +1 -1
  804. package/dist/src/tracing/agent-span-contract.js +1 -1
  805. package/dist/src/tracing/agent-span-id-generator.d.ts +0 -1
  806. package/dist/src/tracing/agent-span-id-generator.js +1 -1
  807. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  808. package/dist/src/tracing/agent-trace-context-codec.d.ts +5 -2
  809. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  810. package/dist/src/tracing/agent-trace-context-store.d.ts +2 -27
  811. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  812. package/dist/src/tracing/agent-trace-span-processor.js +1 -1
  813. package/dist/src/tracing/agent-trace-state.d.ts +4 -19
  814. package/dist/src/tracing/content-attributes.js +1 -1
  815. package/dist/src/tracing/conversation-context.d.ts +10 -0
  816. package/dist/src/tracing/conversation-context.js +1 -1
  817. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  818. package/dist/src/tracing/otel-registration.js +1 -1
  819. package/dist/src/vue/index.d.ts +3 -0
  820. package/dist/src/vue/index.js +2 -2
  821. package/dist/src/vue/use-eve-agent.d.ts +7 -3
  822. package/dist/src/vue/use-eve-agent.js +1 -1
  823. package/docs/agent-config.md +36 -13
  824. package/docs/channels/chat-sdk.mdx +15 -4
  825. package/docs/channels/custom.mdx +89 -17
  826. package/docs/channels/eve.mdx +1 -1
  827. package/docs/channels/mcp.mdx +1 -1
  828. package/docs/channels/overview.mdx +14 -56
  829. package/docs/channels/slack.mdx +287 -45
  830. package/docs/channels/telegram.mdx +2 -0
  831. package/docs/concepts/built-in-tools.md +37 -28
  832. package/docs/concepts/context-control.md +2 -2
  833. package/docs/concepts/execution-model-and-durability.mdx +10 -11
  834. package/docs/concepts/sessions-runs-and-streaming.md +69 -49
  835. package/docs/connections/mcp.mdx +4 -4
  836. package/docs/connections/openapi.mdx +2 -2
  837. package/docs/connections/overview.mdx +11 -5
  838. package/docs/evals/assertions.mdx +5 -5
  839. package/docs/evals/cases.mdx +1 -1
  840. package/docs/evals/reporters.mdx +10 -4
  841. package/docs/extensions.md +22 -2
  842. package/docs/guides/client/streaming.mdx +33 -12
  843. package/docs/guides/deployment/vercel.mdx +2 -1
  844. package/docs/guides/dev-tui.md +26 -16
  845. package/docs/guides/dynamic-capabilities.md +6 -4
  846. package/docs/guides/evaluate.md +29 -2
  847. package/docs/guides/frontend/nuxt.mdx +24 -4
  848. package/docs/guides/frontend/overview.mdx +45 -41
  849. package/docs/guides/frontend/use-eve-agent-svelte.mdx +4 -10
  850. package/docs/guides/frontend/use-eve-agent-vue.mdx +4 -10
  851. package/docs/guides/hooks.md +16 -12
  852. package/docs/guides/instrumentation/instrumentation.mdx +2 -0
  853. package/docs/guides/instrumentation/otel.mdx +24 -6
  854. package/docs/guides/remote-agents.md +38 -22
  855. package/docs/guides/self-modification.md +10 -0
  856. package/docs/instructions.mdx +1 -1
  857. package/docs/patterns/multi-tenant-approvals.md +1 -1
  858. package/docs/protocols/ucp.mdx +20 -16
  859. package/docs/reference/cli.md +64 -11
  860. package/docs/reference/typescript-api.md +43 -41
  861. package/docs/schedules.mdx +14 -34
  862. package/docs/subagents/index.mdx +24 -56
  863. package/docs/tools/human-in-the-loop.md +50 -15
  864. package/docs/tools/meta.json +1 -1
  865. package/docs/tools/overview.mdx +80 -60
  866. package/docs/tools/tasks-upgrade.md +201 -0
  867. package/docs/tools/tasks.md +315 -0
  868. package/docs/tools/workflows.mdx +368 -154
  869. package/package.json +18 -12
  870. package/dist/src/channel/activity-renderer.d.ts +0 -21
  871. package/dist/src/channel/activity-renderer.js +0 -1
  872. package/dist/src/channel/activity-sink.d.ts +0 -2
  873. package/dist/src/channel/activity-sink.js +0 -1
  874. package/dist/src/cli/dev/tui/steering-stream.d.ts +0 -15
  875. package/dist/src/cli/dev/tui/steering-stream.js +0 -1
  876. package/dist/src/cli/dev/tui/subagent-pump.d.ts +0 -142
  877. package/dist/src/cli/dev/tui/subagent-pump.js +0 -1
  878. package/dist/src/eve-channel/activity-observer-request.d.ts +0 -7
  879. package/dist/src/eve-channel/activity-observer-request.js +0 -1
  880. package/dist/src/eve-channel/delivery-policy-request.d.ts +0 -4
  881. package/dist/src/eve-channel/delivery-policy-request.js +0 -1
  882. package/dist/src/execution/activity-cohort.d.ts +0 -20
  883. package/dist/src/execution/activity-cohort.js +0 -1
  884. package/dist/src/execution/activity-collector.d.ts +0 -12
  885. package/dist/src/execution/activity-collector.js +0 -1
  886. package/dist/src/execution/activity-events.d.ts +0 -8
  887. package/dist/src/execution/activity-events.js +0 -1
  888. package/dist/src/execution/activity-route.d.ts +0 -2
  889. package/dist/src/execution/activity-route.js +0 -1
  890. package/dist/src/execution/activity-work-id.d.ts +0 -9
  891. package/dist/src/execution/activity-work-id.js +0 -1
  892. package/dist/src/execution/activity-work.d.ts +0 -30
  893. package/dist/src/execution/activity-work.js +0 -1
  894. package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +0 -7
  895. package/dist/src/execution/cancel-indexed-session-tasks-step.js +0 -1
  896. package/dist/src/execution/dispatch-action-failures.d.ts +0 -8
  897. package/dist/src/execution/dispatch-action-failures.js +0 -1
  898. package/dist/src/execution/dispatch-start-operation.d.ts +0 -15
  899. package/dist/src/execution/dispatch-start-operation.js +0 -1
  900. package/dist/src/execution/publish-channel-event.d.ts +0 -23
  901. package/dist/src/execution/publish-channel-event.js +0 -1
  902. package/dist/src/execution/scheduled-launch-delivery.d.ts +0 -7
  903. package/dist/src/execution/scheduled-launch-delivery.js +0 -1
  904. package/dist/src/execution/session/event-sink.d.ts +0 -26
  905. package/dist/src/execution/session/event-sink.js +0 -1
  906. package/dist/src/execution/session-activity-projection.d.ts +0 -16
  907. package/dist/src/execution/session-activity-projection.js +0 -1
  908. package/dist/src/execution/session-activity-renderer-step.d.ts +0 -15
  909. package/dist/src/execution/session-activity-renderer-step.js +0 -1
  910. package/dist/src/execution/session-activity.d.ts +0 -3
  911. package/dist/src/execution/session-activity.js +0 -1
  912. package/dist/src/execution/submit-activity.d.ts +0 -7
  913. package/dist/src/execution/submit-activity.js +0 -1
  914. package/dist/src/execution/task-event-callback.d.ts +0 -12
  915. package/dist/src/execution/task-event-callback.js +0 -1
  916. package/dist/src/execution/task-input-capability.d.ts +0 -4
  917. package/dist/src/execution/task-input-capability.js +0 -1
  918. package/dist/src/execution/task-input-response-route.d.ts +0 -2
  919. package/dist/src/execution/task-input-response-route.js +0 -1
  920. package/dist/src/execution/tasks/child/notify.d.ts +0 -44
  921. package/dist/src/execution/tasks/child/notify.js +0 -1
  922. package/dist/src/execution/tasks/parent/control-shared.d.ts +0 -23
  923. package/dist/src/execution/tasks/parent/control-shared.js +0 -1
  924. package/dist/src/execution/tasks/parent/delegate.d.ts +0 -35
  925. package/dist/src/execution/tasks/parent/delegate.js +0 -1
  926. package/dist/src/execution/tasks/parent/dispatch.d.ts +0 -22
  927. package/dist/src/execution/tasks/parent/dispatch.js +0 -1
  928. package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +0 -27
  929. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +0 -1
  930. package/dist/src/execution/tasks/parent/run-parent.d.ts +0 -58
  931. package/dist/src/execution/tasks/parent/run-parent.js +0 -1
  932. package/dist/src/execution/tasks/parent/subagent-task-projection.d.ts +0 -26
  933. package/dist/src/execution/tasks/parent/subagent-task-projection.js +0 -1
  934. package/dist/src/execution/tasks/parent/task-cancel.d.ts +0 -12
  935. package/dist/src/execution/tasks/parent/task-cancel.js +0 -1
  936. package/dist/src/execution/tasks/parent/tool-execution.d.ts +0 -45
  937. package/dist/src/execution/tasks/parent/tool-execution.js +0 -1
  938. package/dist/src/execution/terminal-session-event.d.ts +0 -13
  939. package/dist/src/execution/terminal-session-event.js +0 -1
  940. package/dist/src/execution/tools/ask-question-workflow.js +0 -1
  941. package/dist/src/execution/tools/ask-question.d.ts +0 -19
  942. package/dist/src/execution/tools/ask-question.js +0 -2
  943. package/dist/src/execution/tools/connection-search.d.ts +0 -2
  944. package/dist/src/execution/tools/connection-search.js +0 -2
  945. package/dist/src/execution/tools/sleep-workflow.d.ts +0 -3
  946. package/dist/src/execution/tools/sleep-workflow.js +0 -1
  947. package/dist/src/execution/tools/sleep.d.ts +0 -10
  948. package/dist/src/execution/tools/sleep.js +0 -1
  949. package/dist/src/execution/tools/subagent/accept-event-step.d.ts +0 -7
  950. package/dist/src/execution/tools/subagent/accept-event-step.js +0 -1
  951. package/dist/src/execution/tools/subagent/emit-event-step.d.ts +0 -12
  952. package/dist/src/execution/tools/subagent/emit-event-step.js +0 -1
  953. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +0 -42
  954. package/dist/src/execution/tools/subagent/invoke-agent.js +0 -1
  955. package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +0 -44
  956. package/dist/src/execution/tools/subagent/invoke-preparation.js +0 -1
  957. package/dist/src/execution/tools/subagent/invoke-step.d.ts +0 -64
  958. package/dist/src/execution/tools/subagent/invoke-step.js +0 -1
  959. package/dist/src/execution/tools/subagent/receipt-identity.d.ts +0 -11
  960. package/dist/src/execution/tools/subagent/receipt-identity.js +0 -1
  961. package/dist/src/execution/tools/subagent/start.d.ts +0 -51
  962. package/dist/src/execution/tools/subagent/start.js +0 -1
  963. package/dist/src/execution/tools/subagent/steer.d.ts +0 -13
  964. package/dist/src/execution/tools/subagent/steer.js +0 -1
  965. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +0 -24
  966. package/dist/src/execution/tools/subagent/task-agent-requests.js +0 -1
  967. package/dist/src/execution/tools/subagent/task-cancel.d.ts +0 -10
  968. package/dist/src/execution/tools/subagent/task-cancel.js +0 -1
  969. package/dist/src/execution/tools/tasks.d.ts +0 -3
  970. package/dist/src/execution/tools/tasks.js +0 -1
  971. package/dist/src/execution/tools/workflow/background.js +0 -1
  972. package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +0 -14
  973. package/dist/src/execution/tools/workflow/workflow-owner-background.js +0 -1
  974. package/dist/src/harness/background-tools.d.ts +0 -45
  975. package/dist/src/harness/background-tools.js +0 -1
  976. package/dist/src/instrumentation/background-task-runtime.d.ts +0 -18
  977. package/dist/src/instrumentation/background-task-runtime.js +0 -1
  978. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.3.0/node_modules/@vercel/cli-config/dist/index.js +0 -21
  979. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
  980. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
  981. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
  982. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
  983. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
  984. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/index.js +0 -1
  985. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
  986. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
  987. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/authorization.js +0 -1
  988. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/connector.js +0 -1
  989. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/index.js +0 -1
  990. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/installation.js +0 -1
  991. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/base-url.js +0 -1
  992. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/default-scopes.js +0 -1
  993. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/env.js +0 -1
  994. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/url-validation.js +0 -1
  995. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/token.js +0 -1
  996. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
  997. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
  998. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-context.js +0 -1
  999. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
  1000. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
  1001. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/index.js +0 -1
  1002. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/oauth.js +0 -1
  1003. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-error.js +0 -1
  1004. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-io.js +0 -1
  1005. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-util.js +0 -2
  1006. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token.js +0 -1
  1007. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
  1008. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/version.js +0 -1
  1009. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
  1010. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
  1011. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
  1012. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
  1013. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
  1014. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
  1015. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
  1016. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
  1017. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
  1018. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
  1019. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
  1020. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
  1021. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
  1022. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
  1023. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
  1024. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
  1025. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
  1026. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
  1027. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
  1028. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
  1029. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
  1030. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
  1031. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
  1032. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
  1033. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
  1034. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
  1035. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
  1036. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
  1037. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
  1038. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
  1039. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
  1040. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
  1041. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
  1042. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
  1043. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
  1044. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
  1045. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
  1046. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
  1047. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
  1048. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
  1049. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
  1050. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
  1051. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
  1052. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
  1053. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
  1054. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
  1055. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
  1056. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
  1057. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
  1058. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
  1059. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
  1060. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
  1061. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
  1062. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
  1063. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
  1064. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
  1065. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
  1066. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
  1067. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
  1068. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
  1069. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
  1070. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
  1071. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
  1072. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
  1073. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
  1074. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
  1075. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
  1076. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
  1077. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
  1078. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
  1079. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
  1080. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
  1081. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
  1082. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
  1083. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
  1084. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
  1085. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
  1086. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
  1087. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
  1088. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
  1089. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
  1090. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
  1091. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
  1092. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
  1093. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
  1094. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
  1095. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
  1096. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
  1097. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
  1098. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
  1099. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
  1100. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
  1101. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
  1102. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
  1103. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
  1104. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
  1105. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
  1106. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
  1107. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
  1108. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
  1109. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
  1110. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
  1111. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
  1112. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
  1113. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
  1114. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
  1115. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
  1116. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
  1117. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
  1118. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
  1119. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
  1120. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
  1121. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
  1122. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
  1123. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
  1124. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
  1125. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
  1126. package/dist/src/protocol/activity.d.ts +0 -112
  1127. package/dist/src/protocol/activity.js +0 -1
  1128. package/dist/src/protocol/agent-handle-error.d.ts +0 -13
  1129. package/dist/src/protocol/agent-handle-error.js +0 -1
  1130. package/dist/src/public/channels/slack/activity-plan.d.ts +0 -5
  1131. package/dist/src/public/channels/slack/activity-plan.js +0 -1
  1132. package/dist/src/public/channels/slack/activity.d.ts +0 -63
  1133. package/dist/src/public/channels/slack/activity.js +0 -2
  1134. package/dist/src/public/nuxt/dev-server.d.ts +0 -25
  1135. package/dist/src/public/nuxt/dev-server.js +0 -1
  1136. package/dist/src/public/tools/connection-search.d.ts +0 -1
  1137. package/dist/src/public/tools/connection-search.js +0 -1
  1138. package/dist/src/public/tools/task-cancel.d.ts +0 -1
  1139. package/dist/src/public/tools/task-cancel.js +0 -1
  1140. package/dist/src/runtime/prompt/connections.d.ts +0 -9
  1141. package/dist/src/runtime/prompt/connections.js +0 -2
  1142. package/dist/src/shared/empty-delivery.d.ts +0 -3
  1143. package/dist/src/shared/empty-delivery.js +0 -1
  1144. package/dist/src/subagents/agent-handle-errors.d.ts +0 -25
  1145. package/dist/src/subagents/agent-handle-errors.js +0 -1
  1146. package/dist/src/subagents/callback-step.d.ts +0 -11
  1147. package/dist/src/subagents/callback-step.js +0 -1
  1148. package/dist/src/subagents/continuation-bundle.d.ts +0 -13
  1149. package/dist/src/subagents/continuation-bundle.js +0 -1
  1150. package/dist/src/subagents/handle-dispatch.d.ts +0 -65
  1151. package/dist/src/subagents/handle-dispatch.js +0 -1
  1152. package/dist/src/subagents/handles/operation-id.d.ts +0 -15
  1153. package/dist/src/subagents/handles/operation-id.js +0 -1
  1154. package/dist/src/subagents/handles/prompt.d.ts +0 -52
  1155. package/dist/src/subagents/handles/prompt.js +0 -3
  1156. package/dist/src/subagents/handles/query.d.ts +0 -41
  1157. package/dist/src/subagents/handles/query.js +0 -1
  1158. package/dist/src/subagents/handles/state-key.d.ts +0 -8
  1159. package/dist/src/subagents/handles/state-key.js +0 -1
  1160. package/dist/src/subagents/handles/store.d.ts +0 -217
  1161. package/dist/src/subagents/handles/store.js +0 -1
  1162. package/dist/src/subagents/handles/transitions.d.ts +0 -103
  1163. package/dist/src/subagents/handles/transitions.js +0 -1
  1164. package/dist/src/subagents/remote-dispatch.js +0 -1
  1165. package/dist/src/subagents/start-local.d.ts +0 -29
  1166. package/dist/src/subagents/start-local.js +0 -1
  1167. package/dist/src/subagents/start-remote.d.ts +0 -21
  1168. package/dist/src/subagents/start-remote.js +0 -1
  1169. package/dist/src/tasks/delivery-context.d.ts +0 -32
  1170. package/dist/src/tasks/delivery-context.js +0 -4
  1171. package/dist/src/tasks/delivery-policy.d.ts +0 -14
  1172. package/dist/src/tasks/delivery-policy.js +0 -1
  1173. package/dist/src/tasks/json.d.ts +0 -88
  1174. package/dist/src/tasks/json.js +0 -1
  1175. package/dist/src/tasks/notification.d.ts +0 -10
  1176. package/dist/src/tasks/notification.js +0 -1
  1177. package/dist/src/tasks/task-id.d.ts +0 -31
  1178. package/dist/src/tasks/task-id.js +0 -1
  1179. package/dist/src/tasks/task-inbox-token.d.ts +0 -2
  1180. package/dist/src/tasks/task-inbox-token.js +0 -1
  1181. package/dist/src/tasks/transitions.d.ts +0 -17
  1182. package/dist/src/tasks/transitions.js +0 -1
  1183. package/dist/src/tasks/types.d.ts +0 -138
  1184. package/dist/src/tasks/types.js +0 -1
  1185. package/dist/src/tools/framework/connection-search.d.ts +0 -3
  1186. package/dist/src/tools/framework/connection-search.js +0 -1
  1187. package/dist/src/tools/framework/task-cancel.d.ts +0 -4
  1188. package/dist/src/tools/framework/task-cancel.js +0 -1
  1189. package/dist/src/tools/framework/task-contract.d.ts +0 -19
  1190. package/dist/src/tools/framework/task-contract.js +0 -1
  1191. package/dist/src/tools/native-definition.d.ts +0 -7
  1192. package/dist/src/tools/native-definition.js +0 -1
  1193. package/dist/src/tracing/agent-invocation-terminal.d.ts +0 -18
  1194. package/dist/src/tracing/agent-invocation-terminal.js +0 -1
  1195. /package/dist/src/execution/{tools/subagent → agent-sessions}/metadata.d.ts +0 -0
  1196. /package/dist/src/execution/{tools/subagent → agent-sessions}/metadata.js +0 -0
@@ -1 +1,3 @@
1
- import{formatCompactTokenCount}from"../stream-format.js";import{formatPayloadContent,wrapPlainText}from"./trace-content.js";import{SURFACE_CLOSE}from"./trace-surfaces.js";import{formatElapsed}from"#cli/format-elapsed.js";import{clipVisible,stripTerminalControls,visibleLength}from"#cli/ui/terminal-text.js";import{localTraceSpanCostUsd}from"#tracing/local-trace-summary.js";import{formatCostUsd}from"#cli/commands/trace-detail.js";import{compareLocalTraceSpans,isAgentTurnSpan}from"#tracing/local-trace-reader.js";import{agentTurnIdentity}from"#tracing/agent-span-contract.js";function buildConversationItems(e){let t=new Map(e.spans.map(e=>[e.spanId,e])),n=new Map;for(let r of e.spans){if(!isAgentTurnSpan(r))continue;let e=agentTurnIdentity(r),i=turnSubagent(r,t);e!==void 0&&i!==void 0&&n.set(e,i)}let r=[],i=[...e.spans].sort(compareLocalTraceSpans).find(e=>isModelSpan(e)&&typeof e.attributes[`ai.prompt.system`]==`string`),a=i?.attributes[`ai.prompt.system`];i!==void 0&&typeof a==`string`&&a.length>0&&r.push({item:{kind:`system`,durationMs:0,error:!1,span:i,subagent:subagentFor(i,n,t),text:a},order:0n});for(let i of e.spans){let e=subagentFor(i,n,t),a=stringAttribute(i,`agent.channel.delivery.input`);if(a!==void 0){let t=deliveryText(a);if(t===void 0)continue;r.push({item:{kind:`user`,durationMs:0,error:!1,span:i,subagent:e,text:t},order:i.startTimeNs});continue}if(isModelSpan(i)){let n=stringAttribute(i,`ai.response.text`),a=stringAttribute(i,`ai.response.reasoning`),o=numberAttribute(i,`agent.usage.input_tokens`)!==void 0||numberAttribute(i,`agent.usage.output_tokens`)!==void 0,s=i.attributes[`ai.response.tool_calls`]!==void 0;if((n===void 0||n.trim().length===0)&&(a===void 0||a.trim().length===0)&&!o&&!s&&i.statusCode!==2)continue;r.push({item:{kind:`assistant`,costUsd:stepCostUsd(i,t),durationMs:spanDurationMs(i),error:i.statusCode===2,inputTokens:numberAttribute(i,`agent.usage.input_tokens`),model:stringAttribute(i,`gen_ai.request.model`),outputTokens:numberAttribute(i,`agent.usage.output_tokens`),reasoning:a,span:i,subagent:e,text:n,toolCallNames:s?parseToolCallNames(stringAttribute(i,`ai.response.tool_calls`)):void 0},order:i.startTimeNs});for(let t of parseProviderToolResults(stringAttribute(i,`ai.response.tool_results`)))r.push({item:{kind:`tool`,args:t.args,durationMs:0,error:t.error,name:stripTerminalControls(t.name),result:t.result,span:i,subagent:e},order:i.startTimeNs});continue}(i.name===`agent.action`||stringAttribute(i,`gen_ai.operation.name`)===`invoke_workflow`)&&r.push({item:{kind:`tool`,args:stringAttribute(i,`gen_ai.tool.call.arguments`),durationMs:spanDurationMs(i),error:i.statusCode===2,name:stripTerminalControls(stringAttribute(i,`agent.action.name`)??stringAttribute(i,`gen_ai.workflow.name`)??`action`),result:unwrapJsonString(stringAttribute(i,`gen_ai.tool.call.result`)),span:i,subagent:e},order:i.startTimeNs})}return r.sort((e,t)=>e.order===t.order?0:e.order<t.order?-1:1).map(e=>e.item)}function subagentFor(e,t,n){let r=e;for(;r!==void 0;){let e=agentTurnIdentity(r);if(e!==void 0)return t.get(e);r=r.parentSpanId===void 0?void 0:n.get(r.parentSpanId)}}function turnSubagent(e,t){let n=stringAttribute(e,`agent.subagent.name`);if(n!==void 0){let t=n??stringAttribute(e,`gen_ai.agent.name`);return{name:t===void 0?void 0:stripTerminalControls(t)}}let r=e.parentSpanId===void 0?void 0:t.get(e.parentSpanId);if(r===void 0||r.name!==`agent.action`)return;let i=stringAttribute(r,`agent.action.kind`);if(i!==`subagent-call`&&i!==`remote-agent-call`)return;let a=stringAttribute(r,`agent.turn.id`);if(a===void 0)return;let o=stringAttribute(r,`agent.action.name`);return{name:o===void 0?void 0:stripTerminalControls(o),parentCallId:stringAttribute(r,`agent.action.call_id`),parentTurnId:a}}function renderConversationItem(e,t,n,r,i,a){let{colors:o,glyph:s}=n,c=Math.max(8,t-8),l=conversationItemExpandable(e,t),u=n.color?a:void 0,d=u?.primaryText??o.white,f,p,m=[];if(e.kind===`tool`){let t=o.bold(d(e.name??`tool`));f=`${foldMarker(i,l,n)}${t}`,p=e.durationMs>0?o.dim(formatElapsed(e.durationMs)):``;let r=e.args===void 0?[]:formatPayloadContent(e.args,c),a=e.result===void 0?[]:formatPayloadContent(e.result,c),s=i?r:capLines(r,c),u=i?a:capLines(a,c);s.length>0&&m.push(``,o.dim(`Input:`),``,...s),u.length>0&&m.push(``,o.dim(`Output:`),``,...u)}else if(e.kind===`system`){f=`${foldMarker(i,l,n)}${o.bold(d(`system`))}`,p=o.dim(`~${formatCompactTokenCount(estimateTokens(e.text??``))} tokens`);let t=wrapPlainText(e.text??``,c);m.push(...i?t:capLines(t,c))}else if(e.kind===`assistant`){f=`${foldMarker(i,l,n)}${o.bold(d(`assistant`))}${e.model===void 0?``:o.dim(` · ${stripTerminalControls(e.model)}`)}`,p=assistantMetrics(e,s,o);let t=e.reasoning===void 0||e.reasoning.trim().length===0?[]:wrapPlainText(e.reasoning,c),r=e.text===void 0||e.text.trim().length===0?[]:wrapPlainText(e.text,c),a=(i?t:capLines(t,c)).map(e=>o.dim(e)),u=i?r:capLines(r,c);if(a.length>0&&(m.push(o.dim(`Thought:`),``,...a),u.length>0&&m.push(``)),m.push(...u),(e.text===void 0||e.text.trim().length===0)&&e.toolCallNames!==void 0&&e.toolCallNames.length>0){a.length>0&&m.push(``);for(let t of e.toolCallNames)m.push(o.dim(`→ ${t}`))}}else{let t=e.kind===`user`&&e.subagent!==void 0?`task`:e.kind;f=`${foldMarker(i,l,n)}${o.bold(d(t))}`,p=``;let r=e.text===void 0||e.text.trim().length===0?[]:wrapPlainText(e.text,c);m.push(...i?r:capLines(r,c))}if(e.subagent!==void 0){let t=e.subagent.name===void 0?`subagent`:`subagent:${e.subagent.name}`;f+=o.dim(` · ${t}`)}e.error&&(f+=` ${o.red(s.error)}`),!i&&l?m.push(`…`,``,o.dim(`Click to expand`)):i&&l&&m.push(``,o.dim(`Click to collapse`));let h=u===void 0?void 0:e.error?u.errorHeader:u.header,g=u===void 0?void 0:e.error?u.errorBody:u.body,_=railCell(n,r,e.error,u);return[cardRow(``,t,n,_,h),cardSplitRow(f,p,t,n,_,h),cardRow(``,t,n,_,h),cardRow(``,t,n,_,g),...m.map(e=>cardRow(e,t,n,_,g)),cardRow(``,t,n,_,g)]}function cardRow(e,t,n,r,i){let a=clipVisible(e,Math.max(1,t-8)),o=` `.repeat(Math.max(0,t-8-visibleLength(a)));return i===void 0||!n.color?` ${r} ${a}${o} `:` ${r}${i} ${a.replaceAll(`\x1B[0m`,`\x1b[0m${i}`)}\x1b[0m${i}${o} ${SURFACE_CLOSE} `}function railCell(e,t,n,r){let{colors:i,glyph:a}=e;if(t){let t=e.unicode?`▌`:a.rule;return r===void 0?i.white(t):r.primaryText(t)}return r===void 0?n?i.red(a.rule):i.dim(a.rule):` `}function cardSplitRow(e,t,n,r,i,a){if(visibleLength(t)===0)return cardRow(e,n,r,i,a);let o=Math.max(1,n-8),s=visibleLength(t),c=Math.max(1,o-s-2),l=clipVisible(e,c);return cardRow(`${l}${` `.repeat(Math.max(2,o-visibleLength(l)-s))}${t}`,n,r,i,a)}function assistantMetrics(e,t,n){let r=[];return e.durationMs>0&&r.push(formatElapsed(e.durationMs)),e.inputTokens!==void 0&&r.push(`${t.arrowUp}${formatCompactTokenCount(e.inputTokens)}`),e.outputTokens!==void 0&&r.push(`${t.arrowDown}${formatCompactTokenCount(e.outputTokens)}`),e.costUsd!==void 0&&r.push(formatCostUsd(e.costUsd)),r.length===0?``:n.dim(r.join(` · `))}function stepCostUsd(e,t){let n=e;for(;n.parentSpanId!==void 0;){if(n=t.get(n.parentSpanId),n===void 0)return;if(n.name===`agent.step`)return localTraceSpanCostUsd(n)}}function foldMarker(e,t,n){return e?`${n.colors.dim(`▾`)} `:t?`${n.colors.dim(`▸`)} `:``}function capLines(e,t){return e.length<=3?[...e]:[...e.slice(0,2),clipVisible(e[2],Math.max(1,t))]}function conversationItemLineCount(e,t,n,r){return renderConversationItem(e,t,n,!1,r).length}function conversationItemExpandable(e,t){let n=Math.max(8,t-8);if(e.kind===`tool`){let t=e.args===void 0?0:formatPayloadContent(e.args,n-2).length,r=e.result===void 0?0:formatPayloadContent(e.result,n-2).length;return t>3||r>3}if(e.kind===`system`)return wrapPlainText(e.text??``,n).length>3;if(e.kind===`user`)return(e.text===void 0||e.text.trim().length===0?0:wrapPlainText(e.text,n).length)>3;let r=e.reasoning===void 0||e.reasoning.trim().length===0?0:wrapPlainText(e.reasoning,n).length,i=e.text===void 0||e.text.trim().length===0?0:wrapPlainText(e.text,n).length;return r>3||i>3}function estimateTokens(e){return Math.ceil(e.length/4)}function deliveryText(e){if(e!==void 0)try{let t=JSON.parse(e);return isRecord(t)&&typeof t.message==`string`?t.message:void 0}catch{return e}}function unwrapJsonString(e){if(e!==void 0)try{let t=JSON.parse(e);return typeof t==`string`?t:e}catch{return e}}function isModelSpan(e){return e.name.startsWith(`ai.`)&&e.name.includes(`do`)||e.attributes[`gen_ai.operation.name`]===`chat`}function parseToolCallNames(e){if(e!==void 0)try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>isRecord(e)&&typeof e.toolName==`string`).map(e=>e.toolName):void 0}catch{return}}function parseProviderToolResults(e){if(e===void 0)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let asText=e=>typeof e==`string`?e:e===void 0?void 0:JSON.stringify(e);return t.filter(isRecord).map(e=>{let t=`error`in e;return{args:asText(e.input),error:t,name:typeof e.toolName==`string`?e.toolName:`tool`,result:asText(t?e.error:e.output)}})}catch{return[]}}function stringAttribute(e,t){let n=e.attributes[t];return typeof n==`string`?n:void 0}function numberAttribute(e,t){let n=e.attributes[t];return typeof n==`number`?n:void 0}function spanDurationMs(e){return Math.max(0,Number(e.endTimeNs-e.startTimeNs)/1e6)}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{buildConversationItems,conversationItemExpandable,conversationItemLineCount,renderConversationItem};
1
+ import{formatCompactTokenCount}from"../stream-format.js";import{formatPayloadContent,wrapPlainText}from"./trace-content.js";import{SURFACE_CLOSE}from"./trace-surfaces.js";import{formatElapsed}from"#cli/format-elapsed.js";import{clipVisible,stripTerminalControls,visibleLength}from"#cli/ui/terminal-text.js";import{localTraceSpanCostUsd}from"#tracing/local-trace-summary.js";import{formatCostUsd}from"#cli/commands/trace-detail.js";import{compareLocalTraceSpans,isAgentTurnSpan}from"#tracing/local-trace-reader.js";import{agentTurnIdentity}from"#tracing/agent-span-contract.js";function buildConversationItems(e){let t=new Map(e.spans.map(e=>[e.spanId,e])),n=new Map;for(let r of e.spans){if(!isAgentTurnSpan(r))continue;let e=agentTurnIdentity(r),i=turnSubagent(r,t);e!==void 0&&i!==void 0&&n.set(e,i)}let r=[],i;for(let t of[...e.spans].sort(compareLocalTraceSpans)){let e=isModelSpan(t)?systemInstructionsText(t.attributes):void 0;if(e!==void 0){i={span:t,text:e};break}}i!==void 0&&r.push({item:{kind:`system`,durationMs:0,error:!1,span:i.span,subagent:subagentFor(i.span,n,t),text:i.text},order:0n});for(let i of e.spans){let e=subagentFor(i,n,t),a=stringAttribute(i,`agent.channel.delivery.input`);if(a!==void 0){let t=deliveryText(a);if(t===void 0)continue;r.push({item:{kind:`user`,durationMs:0,error:!1,span:i,subagent:e,text:t},order:i.startTimeNs});continue}if(isModelSpan(i)){let n=stringAttribute(i,`ai.response.text`),a=stringAttribute(i,`ai.response.reasoning`),o=numberAttribute(i,`agent.usage.input_tokens`)!==void 0||numberAttribute(i,`agent.usage.output_tokens`)!==void 0,s=i.attributes[`ai.response.tool_calls`]!==void 0;if((n===void 0||n.trim().length===0)&&(a===void 0||a.trim().length===0)&&!o&&!s&&i.statusCode!==2)continue;r.push({item:{kind:`assistant`,costUsd:stepCostUsd(i,t),durationMs:spanDurationMs(i),error:i.statusCode===2,inputTokens:numberAttribute(i,`agent.usage.input_tokens`),model:stringAttribute(i,`gen_ai.request.model`),outputTokens:numberAttribute(i,`agent.usage.output_tokens`),reasoning:a,span:i,subagent:e,text:n,toolCallNames:s?parseToolCallNames(stringAttribute(i,`ai.response.tool_calls`)):void 0},order:i.startTimeNs});for(let t of parseProviderToolResults(stringAttribute(i,`ai.response.tool_results`)))r.push({item:{kind:`tool`,args:t.args,durationMs:0,error:t.error,name:stripTerminalControls(t.name),result:t.result,span:i,subagent:e},order:i.startTimeNs});continue}i.name===`agent.action`&&r.push({item:{kind:`tool`,args:stringAttribute(i,`gen_ai.tool.call.arguments`),durationMs:spanDurationMs(i),error:i.statusCode===2,name:stripTerminalControls(stringAttribute(i,`agent.action.name`)??`action`),result:unwrapJsonString(stringAttribute(i,`gen_ai.tool.call.result`)),span:i,subagent:e},order:i.startTimeNs})}return r.sort((e,t)=>e.order===t.order?0:e.order<t.order?-1:1).map(e=>e.item)}function systemInstructionsText(e){let t=e[`gen_ai.system_instructions`];if(typeof t==`string`)try{let e=JSON.parse(t);if(!Array.isArray(e))return;let n=e.flatMap(e=>typeof e!=`object`||!e||!(`type`in e)||e.type!==`text`||!(`content`in e)||typeof e.content!=`string`?[]:[e.content]).join(`
2
+
3
+ `);return n.length>0?n:void 0}catch{return}}function subagentFor(e,t,n){let r=e;for(;r!==void 0;){let e=agentTurnIdentity(r);if(e!==void 0)return t.get(e);r=r.parentSpanId===void 0?void 0:n.get(r.parentSpanId)}}function turnSubagent(e,t){let n=stringAttribute(e,`agent.subagent.name`);if(n!==void 0){let t=n??stringAttribute(e,`gen_ai.agent.name`);return{name:t===void 0?void 0:stripTerminalControls(t)}}let r=e.parentSpanId===void 0?void 0:t.get(e.parentSpanId);if(r===void 0||r.name!==`agent.action`)return;let i=stringAttribute(r,`agent.action.kind`);if(i!==`subagent-call`&&i!==`remote-agent-call`)return;let a=stringAttribute(r,`agent.turn.id`);if(a===void 0)return;let o=stringAttribute(r,`agent.action.name`);return{name:o===void 0?void 0:stripTerminalControls(o),parentCallId:stringAttribute(r,`agent.action.call_id`),parentTurnId:a}}function renderConversationItem(e,t,n,r,i,a){let{colors:o,glyph:s}=n,c=Math.max(8,t-8),l=conversationItemExpandable(e,t),u=n.color?a:void 0,d=u?.primaryText??o.white,f,p,m=[];if(e.kind===`tool`){let t=o.bold(d(e.name??`tool`));f=`${foldMarker(i,l,n)}${t}`,p=e.durationMs>0?o.dim(formatElapsed(e.durationMs)):``;let r=e.args===void 0?[]:formatPayloadContent(e.args,c),a=e.result===void 0?[]:formatPayloadContent(e.result,c),s=i?r:capLines(r,c),u=i?a:capLines(a,c);s.length>0&&m.push(``,o.dim(`Input:`),``,...s),u.length>0&&m.push(``,o.dim(`Output:`),``,...u)}else if(e.kind===`system`){f=`${foldMarker(i,l,n)}${o.bold(d(`system`))}`,p=o.dim(`~${formatCompactTokenCount(estimateTokens(e.text??``))} tokens`);let t=wrapPlainText(e.text??``,c);m.push(...i?t:capLines(t,c))}else if(e.kind===`assistant`){f=`${foldMarker(i,l,n)}${o.bold(d(`assistant`))}${e.model===void 0?``:o.dim(` · ${stripTerminalControls(e.model)}`)}`,p=assistantMetrics(e,s,o);let t=e.reasoning===void 0||e.reasoning.trim().length===0?[]:wrapPlainText(e.reasoning,c),r=e.text===void 0||e.text.trim().length===0?[]:wrapPlainText(e.text,c),a=(i?t:capLines(t,c)).map(e=>o.dim(e)),u=i?r:capLines(r,c);if(a.length>0&&(m.push(o.dim(`Thought:`),``,...a),u.length>0&&m.push(``)),m.push(...u),(e.text===void 0||e.text.trim().length===0)&&e.toolCallNames!==void 0&&e.toolCallNames.length>0){a.length>0&&m.push(``);for(let t of e.toolCallNames)m.push(o.dim(`→ ${t}`))}}else{let t=e.kind===`user`&&e.subagent!==void 0?`task`:e.kind;f=`${foldMarker(i,l,n)}${o.bold(d(t))}`,p=``;let r=e.text===void 0||e.text.trim().length===0?[]:wrapPlainText(e.text,c);m.push(...i?r:capLines(r,c))}if(e.subagent!==void 0){let t=e.subagent.name===void 0?`subagent`:`subagent:${e.subagent.name}`;f+=o.dim(` · ${t}`)}e.error&&(f+=` ${o.red(s.error)}`),!i&&l?m.push(`…`,``,o.dim(`Click to expand`)):i&&l&&m.push(``,o.dim(`Click to collapse`));let h=u===void 0?void 0:e.error?u.errorHeader:u.header,g=u===void 0?void 0:e.error?u.errorBody:u.body,_=railCell(n,r,e.error,u);return[cardRow(``,t,n,_,h),cardSplitRow(f,p,t,n,_,h),cardRow(``,t,n,_,h),cardRow(``,t,n,_,g),...m.map(e=>cardRow(e,t,n,_,g)),cardRow(``,t,n,_,g)]}function cardRow(e,t,n,r,i){let a=clipVisible(e,Math.max(1,t-8)),o=` `.repeat(Math.max(0,t-8-visibleLength(a)));return i===void 0||!n.color?` ${r} ${a}${o} `:` ${r}${i} ${a.replaceAll(`\x1B[0m`,`\x1b[0m${i}`)}\x1b[0m${i}${o} ${SURFACE_CLOSE} `}function railCell(e,t,n,r){let{colors:i,glyph:a}=e;if(t){let t=e.unicode?`▌`:a.rule;return r===void 0?i.white(t):r.primaryText(t)}return r===void 0?n?i.red(a.rule):i.dim(a.rule):` `}function cardSplitRow(e,t,n,r,i,a){if(visibleLength(t)===0)return cardRow(e,n,r,i,a);let o=Math.max(1,n-8),s=visibleLength(t),c=Math.max(1,o-s-2),l=clipVisible(e,c);return cardRow(`${l}${` `.repeat(Math.max(2,o-visibleLength(l)-s))}${t}`,n,r,i,a)}function assistantMetrics(e,t,n){let r=[];return e.durationMs>0&&r.push(formatElapsed(e.durationMs)),e.inputTokens!==void 0&&r.push(`${t.arrowUp}${formatCompactTokenCount(e.inputTokens)}`),e.outputTokens!==void 0&&r.push(`${t.arrowDown}${formatCompactTokenCount(e.outputTokens)}`),e.costUsd!==void 0&&r.push(formatCostUsd(e.costUsd)),r.length===0?``:n.dim(r.join(` · `))}function stepCostUsd(e,t){let n=e;for(;n.parentSpanId!==void 0;){if(n=t.get(n.parentSpanId),n===void 0)return;if(n.name===`agent.step`)return localTraceSpanCostUsd(n)}}function foldMarker(e,t,n){return e?`${n.colors.dim(`▾`)} `:t?`${n.colors.dim(`▸`)} `:``}function capLines(e,t){return e.length<=3?[...e]:[...e.slice(0,2),clipVisible(e[2],Math.max(1,t))]}function conversationItemLineCount(e,t,n,r){return renderConversationItem(e,t,n,!1,r).length}function conversationItemExpandable(e,t){let n=Math.max(8,t-8);if(e.kind===`tool`){let t=e.args===void 0?0:formatPayloadContent(e.args,n-2).length,r=e.result===void 0?0:formatPayloadContent(e.result,n-2).length;return t>3||r>3}if(e.kind===`system`)return wrapPlainText(e.text??``,n).length>3;if(e.kind===`user`)return(e.text===void 0||e.text.trim().length===0?0:wrapPlainText(e.text,n).length)>3;let r=e.reasoning===void 0||e.reasoning.trim().length===0?0:wrapPlainText(e.reasoning,n).length,i=e.text===void 0||e.text.trim().length===0?0:wrapPlainText(e.text,n).length;return r>3||i>3}function estimateTokens(e){return Math.ceil(e.length/4)}function deliveryText(e){if(e!==void 0)try{let t=JSON.parse(e);return isRecord(t)&&typeof t.message==`string`?t.message:void 0}catch{return e}}function unwrapJsonString(e){if(e!==void 0)try{let t=JSON.parse(e);return typeof t==`string`?t:e}catch{return e}}function isModelSpan(e){return e.name.startsWith(`ai.`)&&e.name.includes(`do`)||e.attributes[`gen_ai.operation.name`]===`chat`}function parseToolCallNames(e){if(e!==void 0)try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>isRecord(e)&&typeof e.toolName==`string`).map(e=>e.toolName):void 0}catch{return}}function parseProviderToolResults(e){if(e===void 0)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let asText=e=>typeof e==`string`?e:e===void 0?void 0:JSON.stringify(e);return t.filter(isRecord).map(e=>{let t=`error`in e;return{args:asText(e.input),error:t,name:typeof e.toolName==`string`?e.toolName:`tool`,result:asText(t?e.error:e.output)}})}catch{return[]}}function stringAttribute(e,t){let n=e.attributes[t];return typeof n==`string`?n:void 0}function numberAttribute(e,t){let n=e.attributes[t];return typeof n==`number`?n:void 0}function spanDurationMs(e){return Math.max(0,Number(e.endTimeNs-e.startTimeNs)/1e6)}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{buildConversationItems,conversationItemExpandable,conversationItemLineCount,renderConversationItem};
@@ -1,2 +1,2 @@
1
- import{formatAttributeContent}from"./trace-content.js";import{renderConversationItem}from"./trace-conversation.js";import{orderedTextSelection,selectedTraceViewerSpan}from"./trace-viewer-state.js";import{formatElapsed}from"#cli/format-elapsed.js";import{clipVisible,sliceVisible,stripAnsi,stripTerminalControls,visibleLength,wrapVisibleLine}from"#cli/ui/terminal-text.js";import{describeLocalTraceSpan}from"#tracing/local-trace-reader.js";function renderTraceViewer(e,t){let{width:n,height:r,theme:i}=t,a=chromeStyles(i,t.surfaces),o=Math.max(1,r-3-3),s=e.panelOpen?panelWidthFor(n):0,c=Math.max(20,n-(s===0?0:s+1)),l=panelDetailLines(e,s,i,t.surfaces),u=o,d=[];if(d.push(...renderHeader(e,t)),e.traces.length===0)d.push(...renderEmptyState(t,i,o));else if(e.trace===void 0)d.push(...center(o,a.muted(`Loading trace…`)));else{let r=renderConversation(e,t,c,o);for(let t=0;t<o;t+=1){let i=r[t]??``;if(s===0){d.push(i);continue}let a=l[e.panelScroll+t]??``;e.textSelection!==void 0&&e.textSelection.region===`panel`&&(a=highlightSelection(a,e.panelScroll+t,e.textSelection,s)),d.push(joinPanels(i,c,a,n))}}return d.push(...renderFooter(e,n,i,t.surfaces)),t.toast!==void 0&&overlayToast(d,t.toast,n,i,t.surfaces),{rows:d,panelTotalRows:l.length,timelineViewportRows:o,panelViewportRows:u,contentWidth:c}}function chromeStyles(e,t){let n=e.color?t:void 0;return{muted:n?.mutedText??e.colors.dim,primary:n?.primaryText??(e=>e)}}function overlayToast(e,t,n,r,i){let a=` ${stripTerminalControls(t)} `,o=visibleLength(a),s=r.unicode?`▌`:r.glyph.rule,c=r.color?i:void 0,l=c===void 0?``:c.body,u=c?.primaryText??r.colors.white,d=r.color?`\x1B[0m`:``,f=[`${l}${u(s)}${` `.repeat(o)}${d}`,`${l}${u(s)}${u(a)}${d}`,`${l}${u(s)}${` `.repeat(o)}${d}`];for(let[t,r]of f.entries()){let i=2+t;if(i>=e.length)break;e[i]=overlayRight(e[i],r,n,1)}}function overlayRight(e,t,n,r){let i=Math.max(0,n-r-visibleLength(t)),a=visibleLength(e),o=a<i?e+` `.repeat(i-a):e;return`${sliceVisible(o,i)}\x1b[0m${t}`}const CONVERSATION_CONTENT_KEYS=new Set([`gen_ai.input.messages`,`ai.prompt.system`,`ai.response.reasoning`,`ai.response.text`,`ai.response.tool_calls`,`ai.response.tool_results`,`gen_ai.tool.call.arguments`,`gen_ai.tool.call.result`]);function renderSpanDetail(e,t,n,r){let{colors:i}=n,{muted:a,primary:o}=chromeStyles(n,r?.surfaces),s=[],c=stripTerminalControls(e.name);s.push(...wrapVisibleLine(i.bold(o(c)),t));let l=describeLocalTraceSpan(e).map(stripTerminalControls);l.length>0&&s.push(a(l.join(`, `))),s.push(``);let fact=(e,t)=>`${a(e.padEnd(10))}${t}`,u=e.statusCode===2;s.push(fact(`status`,u?i.red(`ERROR`):i.green(`ok`))),s.push(fact(`duration`,formatElapsed(durationMs(e.startTimeNs,e.endTimeNs)))),s.push(fact(`started`,clockTime(e.startTimeNs))),s.push(fact(`span`,e.spanId)),e.parentSpanId!==void 0&&s.push(fact(`parent`,e.parentSpanId)),e.scope!==void 0&&s.push(fact(`scope`,stripTerminalControls(e.scope))),s.push(``);let d=Object.keys(e.attributes).filter(e=>r?.excludeKeys?.has(e)!==!0).sort();if(d.length===0)s.push(a(`no attributes`));else{s.push(a(`attributes (${d.length})`));for(let n of d){let r=formatAttributeContent(n,e.attributes[n],i.dim,t-2),o=stripTerminalControls(n);if(r.length===1)s.push(...wrapVisibleLine(`${a(o)} ${r[0]}`,t));else{s.push(a(o));for(let e of r)s.push(` ${e}`)}}}return s.map(e=>clipVisible(e,t))}function renderHeader(e,t){let{theme:n,width:r}=t,{colors:i,glyph:a}=n,{muted:o,primary:s}=chromeStyles(n,t.surfaces),c=[];if(e.trace?.agentName!==void 0&&c.push(stripTerminalControls(e.trace.agentName)),e.trace?.conversationId!==void 0&&c.push(`conversation ${stripTerminalControls(e.trace.conversationId)}`),e.trace!==void 0){let n=t.activeWindowEndNs!==void 0&&t.activeWindowEndNs>e.trace.endTimeNs?t.activeWindowEndNs:e.trace.endTimeNs;c.push(clockTime(e.trace.startTimeNs),`${e.trace.spans.length} span${e.trace.spans.length===1?``:`s`}`,formatElapsed(durationMs(e.trace.startTimeNs,n)))}let l=`${i.bold(s(`${a.brand} traces`))}${c.length===0?``:o(` · ${c.join(` · `)}`)}`,u=e.traces.length===0?``:o(`[${e.traceIndex+1}/${e.traces.length}]`),d=[t.activeWindowEndNs===void 0?``:i.green(`● live`),u].filter(e=>e.length>0).join(` `),f=joinRight(` ${clipVisible(l,Math.max(0,r-visibleLength(d)-2))}`,d,r);return[``,clipVisible(f,r),``]}function renderConversation(e,t,n,r){let{theme:i}=t;if(e.conversationItems.length===0)return[chromeStyles(i,t.surfaces).muted(` No conversation content in this trace; its export policy may have redacted it.`)];let a=conversationLines(e,n,i,t.surfaces).slice(e.scrollRow,e.scrollRow+r);return e.textSelection===void 0||e.textSelection.region!==`conversation`?a:a.map((t,r)=>highlightSelection(t,e.scrollRow+r,e.textSelection,n))}function conversationLines(e,t,n,r){let i=[];for(let a=0;a<e.conversationItems.length;a+=1)i.push(...renderConversationItem(e.conversationItems[a],t,n,a===e.selectedRow,e.expandedItems.has(a),r),``);return i}function panelDetailLines(e,t,n,r){let i=selectedTraceViewerSpan(e);return!e.panelOpen||t<=0||i===void 0?[]:[``,...renderSpanDetail(i,Math.max(16,t-3),n,{excludeKeys:CONVERSATION_CONTENT_KEYS,surfaces:r}).map(e=>` ${e}`)]}function conversationSelectionText(e,t,n,r,i){return selectionText(conversationLines(e,t,n,i),r)}function panelSelectionText(e,t,n,r){return selectionText(panelDetailLines(e,e.panelOpen?panelWidthFor(t):0,n),r)}function selectionText(e,t){let{start:n,end:r}=orderedTextSelection(t),i=[];for(let t=Math.max(0,n.line);t<=r.line&&t<e.length;t+=1){let a=stripAnsi(e[t]),o=t===n.line?n.column:0,s=t===r.line?r.column+1:1/0,c=s===1/0?a:sliceVisible(a,s),l=sliceVisible(a,o).length;i.push(c.slice(l).trimEnd())}return i.join(`
1
+ import{formatAttributeContent}from"./trace-content.js";import{renderConversationItem}from"./trace-conversation.js";import{orderedTextSelection,selectedTraceViewerSpan}from"./trace-viewer-state.js";import{formatElapsed}from"#cli/format-elapsed.js";import{clipVisible,sliceVisible,stripAnsi,stripTerminalControls,visibleLength,wrapVisibleLine}from"#cli/ui/terminal-text.js";import{describeLocalTraceSpan}from"#tracing/local-trace-reader.js";function renderTraceViewer(e,t){let{width:n,height:r,theme:i}=t,a=chromeStyles(i,t.surfaces),o=Math.max(1,r-3-3),s=e.panelOpen?panelWidthFor(n):0,c=Math.max(20,n-(s===0?0:s+1)),l=panelDetailLines(e,s,i,t.surfaces),u=o,d=[];if(d.push(...renderHeader(e,t)),e.traces.length===0)d.push(...renderEmptyState(t,i,o));else if(e.trace===void 0)d.push(...center(o,a.muted(`Loading trace…`)));else{let r=renderConversation(e,t,c,o);for(let t=0;t<o;t+=1){let i=r[t]??``;if(s===0){d.push(i);continue}let a=l[e.panelScroll+t]??``;e.textSelection!==void 0&&e.textSelection.region===`panel`&&(a=highlightSelection(a,e.panelScroll+t,e.textSelection,s)),d.push(joinPanels(i,c,a,n))}}return d.push(...renderFooter(e,n,i,t.surfaces)),t.toast!==void 0&&overlayToast(d,t.toast,n,i,t.surfaces),{rows:d,panelTotalRows:l.length,timelineViewportRows:o,panelViewportRows:u,contentWidth:c}}function chromeStyles(e,t){let n=e.color?t:void 0;return{muted:n?.mutedText??e.colors.dim,primary:n?.primaryText??(e=>e)}}function overlayToast(e,t,n,r,i){let a=` ${stripTerminalControls(t)} `,o=visibleLength(a),s=r.unicode?`▌`:r.glyph.rule,c=r.color?i:void 0,l=c===void 0?``:c.body,u=c?.primaryText??r.colors.white,d=r.color?`\x1B[0m`:``,f=[`${l}${u(s)}${` `.repeat(o)}${d}`,`${l}${u(s)}${u(a)}${d}`,`${l}${u(s)}${` `.repeat(o)}${d}`];for(let[t,r]of f.entries()){let i=2+t;if(i>=e.length)break;e[i]=overlayRight(e[i],r,n,1)}}function overlayRight(e,t,n,r){let i=Math.max(0,n-r-visibleLength(t)),a=visibleLength(e),o=a<i?e+` `.repeat(i-a):e;return`${sliceVisible(o,i)}\x1b[0m${t}`}const CONVERSATION_CONTENT_KEYS=new Set([`gen_ai.input.messages`,`gen_ai.system_instructions`,`ai.response.reasoning`,`ai.response.text`,`ai.response.tool_calls`,`ai.response.tool_results`,`gen_ai.tool.call.arguments`,`gen_ai.tool.call.result`]);function renderSpanDetail(e,t,n,r){let{colors:i}=n,{muted:a,primary:o}=chromeStyles(n,r?.surfaces),s=[],c=stripTerminalControls(e.name);s.push(...wrapVisibleLine(i.bold(o(c)),t));let l=describeLocalTraceSpan(e).map(stripTerminalControls);l.length>0&&s.push(a(l.join(`, `))),s.push(``);let fact=(e,t)=>`${a(e.padEnd(10))}${t}`,u=e.statusCode===2;s.push(fact(`status`,u?i.red(`ERROR`):i.green(`ok`))),s.push(fact(`duration`,formatElapsed(durationMs(e.startTimeNs,e.endTimeNs)))),s.push(fact(`started`,clockTime(e.startTimeNs))),s.push(fact(`span`,e.spanId)),e.parentSpanId!==void 0&&s.push(fact(`parent`,e.parentSpanId)),e.scope!==void 0&&s.push(fact(`scope`,stripTerminalControls(e.scope))),s.push(``);let d=Object.keys(e.attributes).filter(e=>r?.excludeKeys?.has(e)!==!0).sort();if(d.length===0)s.push(a(`no attributes`));else{s.push(a(`attributes (${d.length})`));for(let n of d){let r=formatAttributeContent(n,e.attributes[n],i.dim,t-2),o=stripTerminalControls(n);if(r.length===1)s.push(...wrapVisibleLine(`${a(o)} ${r[0]}`,t));else{s.push(a(o));for(let e of r)s.push(` ${e}`)}}}return s.map(e=>clipVisible(e,t))}function renderHeader(e,t){let{theme:n,width:r}=t,{colors:i,glyph:a}=n,{muted:o,primary:s}=chromeStyles(n,t.surfaces),c=[];if(e.trace?.agentName!==void 0&&c.push(stripTerminalControls(e.trace.agentName)),e.trace?.conversationId!==void 0&&c.push(`conversation ${stripTerminalControls(e.trace.conversationId)}`),e.trace!==void 0){let n=t.activeWindowEndNs!==void 0&&t.activeWindowEndNs>e.trace.endTimeNs?t.activeWindowEndNs:e.trace.endTimeNs;c.push(clockTime(e.trace.startTimeNs),`${e.trace.spans.length} span${e.trace.spans.length===1?``:`s`}`,formatElapsed(durationMs(e.trace.startTimeNs,n)))}let l=`${i.bold(s(`${a.brand} traces`))}${c.length===0?``:o(` · ${c.join(` · `)}`)}`,u=e.traces.length===0?``:o(`[${e.traceIndex+1}/${e.traces.length}]`),d=[t.activeWindowEndNs===void 0?``:i.green(`● live`),u].filter(e=>e.length>0).join(` `),f=joinRight(` ${clipVisible(l,Math.max(0,r-visibleLength(d)-2))}`,d,r);return[``,clipVisible(f,r),``]}function renderConversation(e,t,n,r){let{theme:i}=t;if(e.conversationItems.length===0)return[chromeStyles(i,t.surfaces).muted(` No conversation content in this trace; its export policy may have redacted it.`)];let a=conversationLines(e,n,i,t.surfaces).slice(e.scrollRow,e.scrollRow+r);return e.textSelection===void 0||e.textSelection.region!==`conversation`?a:a.map((t,r)=>highlightSelection(t,e.scrollRow+r,e.textSelection,n))}function conversationLines(e,t,n,r){let i=[];for(let a=0;a<e.conversationItems.length;a+=1)i.push(...renderConversationItem(e.conversationItems[a],t,n,a===e.selectedRow,e.expandedItems.has(a),r),``);return i}function panelDetailLines(e,t,n,r){let i=selectedTraceViewerSpan(e);return!e.panelOpen||t<=0||i===void 0?[]:[``,...renderSpanDetail(i,Math.max(16,t-3),n,{excludeKeys:CONVERSATION_CONTENT_KEYS,surfaces:r}).map(e=>` ${e}`)]}function conversationSelectionText(e,t,n,r,i){return selectionText(conversationLines(e,t,n,i),r)}function panelSelectionText(e,t,n,r){return selectionText(panelDetailLines(e,e.panelOpen?panelWidthFor(t):0,n),r)}function selectionText(e,t){let{start:n,end:r}=orderedTextSelection(t),i=[];for(let t=Math.max(0,n.line);t<=r.line&&t<e.length;t+=1){let a=stripAnsi(e[t]),o=t===n.line?n.column:0,s=t===r.line?r.column+1:1/0,c=s===1/0?a:sliceVisible(a,s),l=sliceVisible(a,o).length;i.push(c.slice(l).trimEnd())}return i.join(`
2
2
  `)}function highlightSelection(e,t,n,r){let{start:i,end:a}=orderedTextSelection(n);if(t<i.line||t>a.line)return e;let o=t===i.line?i.column:0,s=t===a.line?a.column+1:r,c=visibleLength(e),l=c<s?e+` `.repeat(s-c):e,u=sliceVisible(l,o),d=sliceVisible(l,s),f=d.slice(u.length),p=l.slice(d.length);return f.length===0?e:`${u}\x1b[7m${f.replaceAll(`\x1B[0m`,`\x1B[0m\x1B[7m`)}\x1b[27m${p}`}function renderFooter(e,t,n,r){let{colors:i}=n,{muted:a}=chromeStyles(n,r),[o,s]=n.unicode?[`↑↓`,`←→`]:[`^/v`,`</>`],c=e.panelFocus?`${o} scroll · tab cards · esc back`:`${o} select · ${s} expand · enter attrs · tab focus · [ ] traces · q close`,l=e.conversationItems.length,u=l===0?``:a(`item ${e.selectedRow+1}/${l}`),d=[e.notice===void 0?``:i.yellow(e.notice),u].filter(e=>e.length>0).join(a(` · `));return[``,clipVisible(` ${a(c)}`,t),clipVisible(d.length===0?``:` ${d}`,t)]}function renderEmptyState(e,t,n){let{muted:r,primary:i}=chromeStyles(t,e.surfaces),[a,o]=e.tracingDisabled===!0?[`Tracing is disabled (EVE_TRACES=off).`,`Re-enable it and spans stream in live.`]:[`No local traces yet.`,`Chat with your agent — spans stream in live.`];return center(n,t.colors.bold(i(a)),r(o))}function center(e,...t){let n=Array.from({length:e},()=>``),r=Math.max(0,Math.floor(e/2)-1);return t.forEach((t,i)=>{r+i<e&&(n[r+i]=t)}),n}function joinPanels(e,t,n,r){let i=Math.max(0,r-t-1);return`${padTo(e,t)} ${clipVisible(n,i)}`}function joinRight(e,t,n){if(t.length===0)return e;let r=Math.max(1,n-visibleLength(e)-visibleLength(t));return`${e}${` `.repeat(r)}${t}`}function padTo(e,t){let n=visibleLength(e);return n>=t?clipVisible(e,t):e+` `.repeat(t-n)}function panelWidthFor(e){return e<42?0:Math.min(64,Math.max(20,Math.floor(e*.42)),e-20-1)}function durationMs(e,t){return Math.max(0,Number(t-e)/1e6)}function clockTime(e){let t=new Date(Number(e/1000000n)),pad=(e,t=2)=>String(e).padStart(t,`0`);return`${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}.${pad(t.getMilliseconds(),3)}`}export{conversationSelectionText,panelSelectionText,renderSpanDetail,renderTraceViewer};
@@ -0,0 +1,73 @@
1
+ /** Pure pieces of the transcript projection: tool rows, task lines, and agent steps. */
2
+ import type { TaskEntry } from "./task-activity.js";
3
+ import type { ConversationState, ConversationTaskCall, ConversationTask } from "#client/conversation-state.js";
4
+ import type { EveAuthorizationPart, EveDynamicToolPart, EveMessage, EveMessagePart } from "#client/message-reducer-types.js";
5
+ import type { Block, ToolStatus } from "./blocks.js";
6
+ import { type ToolPresentationContext } from "./tool-presentation.js";
7
+ export type ToolState = {
8
+ readonly status: ToolStatus;
9
+ readonly output?: unknown;
10
+ readonly errorText?: string;
11
+ };
12
+ /** A task whose start line is written, named once and never renamed. */
13
+ export interface TaskRecord {
14
+ readonly callId: string;
15
+ readonly kind: "agent" | "tool";
16
+ readonly name: string;
17
+ readonly toolName: string;
18
+ readonly input: unknown;
19
+ readonly label: string | undefined;
20
+ readonly purpose?: string;
21
+ readonly startedAtMs: number;
22
+ settledAtMs?: number;
23
+ ended: boolean;
24
+ }
25
+ export interface AgentActivity {
26
+ tools: Block[];
27
+ rows: Block[];
28
+ children?: TaskEntry[];
29
+ omittedTasks?: number;
30
+ omittedAttention?: boolean;
31
+ step?: string;
32
+ pending: boolean;
33
+ }
34
+ export declare function taskNeedsApproval(conversation: ConversationState, task: ConversationTask): boolean;
35
+ export declare function uniqueTaskName(baseName: string, records: Iterable<TaskRecord>): string;
36
+ export declare function startLine(record: TaskRecord): Block;
37
+ export declare function nestedTaskRecord(callId: string, part: EveDynamicToolPart, task: ConversationTask, block: Block): TaskRecord;
38
+ export declare function toolState(part: EveDynamicToolPart, conversation: ConversationState, working: boolean, taskWorking: boolean): ToolState;
39
+ export declare function isActive(status: ToolStatus): boolean;
40
+ export declare function toolBlock(part: EveDynamicToolPart, state: ToolState, context: ToolPresentationContext | undefined): Omit<Block, "kind">;
41
+ /** A task's end line: how long it took and what it did, or why it failed, or that it stopped. */
42
+ export declare function endLine(record: TaskRecord, call: Pick<ConversationTaskCall, "status" | "output" | "error">, childTools: readonly Block[] | undefined,
43
+ /** The theme's `·`, which separates the line's facts. */
44
+ separator: string): Block;
45
+ export declare function labelContext(label: string | undefined): ToolPresentationContext | undefined;
46
+ /** The first line of an agent call's message: what the agent was asked to do. */
47
+ export declare function agentTaskSummary(input: unknown): string;
48
+ export declare function firstLine(text: string): string | undefined;
49
+ export type SubagentStep = {
50
+ readonly key: string;
51
+ /** Where the step ends among its messages' parts, to order it among the agent's tool calls. */
52
+ readonly order: number;
53
+ readonly reasoning: string;
54
+ readonly message: string;
55
+ readonly finalized: boolean;
56
+ };
57
+ /** Pairs each child reply with the reasoning that preceded it. */
58
+ export declare function subagentSteps(messages: readonly EveMessage[]): SubagentStep[];
59
+ export declare function childToolCallIds(conversation: ConversationState): Set<string>;
60
+ /** A tool call, including one whose input is still streaming and so has no kind yet. */
61
+ export declare function isToolCallRow(part: EveMessagePart): part is EveDynamicToolPart;
62
+ /** Every call that started or reached a task, by call ID. */
63
+ export declare function taskCallsById(conversation: ConversationState): Map<string, {
64
+ task: ConversationTask;
65
+ call: ConversationTaskCall;
66
+ }>;
67
+ /** Tools a step runs in parallel settle together, so a finished one waits for its siblings. */
68
+ export declare function activeToolSteps(states: ReadonlyMap<EveDynamicToolPart, ToolState>): Set<number | undefined>;
69
+ export declare function userText(message: EveMessage): string;
70
+ export declare function authorizationTerminalMessage(state: string): string | undefined;
71
+ export declare function formatAuthorization(part: EveAuthorizationPart, terminalMessage: string | undefined): string;
72
+ /** Reads the shared write-file result's `existed` flag, whatever the tool. */
73
+ export declare function writeExistedFlag(output: unknown): boolean | undefined;
@@ -0,0 +1,3 @@
1
+ import{agentDisplayName,agentTaskLabel,presentPreparingTool,presentTool}from"./tool-presentation.js";import{isTerminalToolCallPart}from"./terminal-tool-part.js";import{formatTurnDuration}from"./stream-format.js";import{summarizeChildTools}from"./tool-block-groups.js";import{stripTerminalControls}from"#cli/ui/terminal-text.js";import{agentToolSession}from"#client/conversation-state.js";function taskNeedsApproval(e,t){if(Object.values(e.inputs).some(e=>e.taskId===t.taskId&&e.status===`open`&&e.request.kind===`tool-approval`))return!0;let n=agentToolSession(e,t),r=n?.observation.status===`not-followed`?void 0:n?.observation.conversation;return r!==void 0&&Object.values(r.inputs).some(e=>e.status===`open`&&e.request.kind===`tool-approval`)}function uniqueTaskName(e,t){let n=new Set([...t].filter(e=>!e.ended).map(e=>e.name));if(!n.has(e))return e;for(let t=2;;t+=1){let r=`${e}:${t}`;if(!n.has(r))return r}}function startLine(e){let t=presentTool(e.toolName,e.input,{...labelContext(e.label),isSubagent:e.kind===`agent`});return{kind:`task`,taskKind:e.kind,title:e.kind===`agent`?`Delegate ${agentTaskLabel(e.name)}`:e.name,subtitle:stripTerminalControls(t.subtitle),live:!1}}function nestedTaskRecord(e,t,n,r){return{callId:e,kind:n.kind,name:n.kind===`agent`?agentDisplayName(stripTerminalControls(t.toolName)):stripTerminalControls(t.toolName),toolName:t.toolName,input:t.input,label:void 0,purpose:n.kind===`agent`?agentTaskSummary(t.input):r.subtitle||(r.title===t.toolName?void 0:r.title),startedAtMs:Date.now(),ended:!1}}function toolState(e,t,n,r){if(r)return{status:`running`};let i=settledToolState(e,t);return i.status===`running`&&!n?{status:`error`,errorText:`interrupted`}:i}function settledToolState(e,t){switch(e.state){case`approval-requested`:{let n=t.inputs[e.approval.id];return n?.status===`responded`?n.response?.optionId===`approve`?{status:`running`}:{status:`denied`,errorText:`Denied by user.`}:{status:`approval`}}case`approval-responded`:return e.approval.approved===!1?{status:`denied`,errorText:e.approval.reason??`Denied by user.`}:{status:`running`};case`output-available`:return e.partial===!0?{status:`running`}:{status:`done`,output:e.output};case`output-error`:return{status:`error`,errorText:e.errorText};case`output-denied`:return{status:`denied`,errorText:e.approval.reason??`Tool execution was cancelled.`};default:return{status:`running`}}}function isActive(e){return e===`running`||e===`approval`}function toolBlock(e,t,n){let{toolName:r,input:i}=e,a=e.state===`input-streaming`?presentPreparingTool(r,n):presentTool(r,i,n),o={title:stripTerminalControls(a.title),subtitle:stripTerminalControls(a.subtitle),status:t.status,toolInput:i,toolName:r,toolGroup:a.group};return a.doneTitle!==void 0&&(o.doneTitle=stripTerminalControls(a.doneTitle)),a.detail!==void 0&&(o.detailLines=a.detail,o.keepDetailWhenDone=a.keepDetailWhenDone===!0),t.output===void 0?t.errorText!==void 0&&(o.result=stripTerminalControls(t.errorText)):(o.result=a.summarizeResult(t.output),o.toolOutput=t.output),o}function endLine(e,t,n,r){let i=` ${r} `,a={id:`task:${e.callId}:end`,kind:`task`,taskKind:e.kind,title:e.kind===`agent`?agentTaskLabel(e.name):e.name,live:!1};switch(t.status){case`completed`:{let r=`finished in ${formatTurnDuration((e.settledAtMs??Date.now())-e.startedAtMs)}`,o=e.kind===`agent`?summarizeChildTools(n??[]):presentTool(e.toolName,e.input,labelContext(e.label)).summarizeResult(t.output);a.status=`done`,a.body=o===void 0||o.length===0?r:`${r}${i}${o}`;break}case`failed`:{let e=firstLine(stripTerminalControls(t.error?.message??``));a.status=`error`,a.body=e===void 0?`failed`:`failed${i}${e}`;break}default:a.status=`denied`,a.body=`stopped`}return a}function labelContext(e){return e===void 0?void 0:{label:e}}function agentTaskSummary(e){if(typeof e!=`object`||!e)return``;let t=Reflect.get(e,`message`);return typeof t==`string`?firstLine(stripTerminalControls(t))??``:``}function firstLine(e){return e.split(/\r?\n/u).find(e=>e.trim().length>0)?.trim()}function subagentSteps(e){let t=[],n=0;for(let r of e){let e=``;for(let[i,a]of r.parts.entries())n+=1,a.type===`reasoning`&&(e+=a.text),a.type===`text`&&(t.push({key:a.id??`${r.id}:${i}`,order:n,reasoning:e,message:a.text,finalized:a.state===`done`}),e=``),a.type===`dynamic-tool`&&e&&(t.push({key:`${r.id}:${i}:reasoning`,order:n-.5,reasoning:e,message:``,finalized:!0}),e=``);e&&t.push({key:`${r.id}:reasoning:${r.parts.length}`,order:n,reasoning:e,message:``,finalized:r.metadata?.status===`complete`})}return t.map(e=>({...e,reasoning:stripTerminalControls(e.reasoning).trim(),message:stripTerminalControls(e.message).trim()})).filter(e=>e.reasoning.length>0||e.message.length>0)}function childToolCallIds(e){let t=new Set;for(let n of Object.values(e.agents))if(n.observation.status!==`not-followed`)for(let e of n.observation.conversation?.messages??[])for(let n of e.parts)n.type===`dynamic-tool`&&t.add(n.toolCallId);return t}function isToolCallRow(e){return e.type===`dynamic-tool`&&(e.state===`input-streaming`||isTerminalToolCallPart(e))}function taskCallsById(e){let t=new Map;for(let n of Object.values(e.tasks))for(let e of Object.values(n.calls))t.set(e.callId,{task:n,call:e});return t}function activeToolSteps(e){let t=new Set;for(let[n,r]of e)isActive(r.status)&&t.add(n.stepIndex);return t}function userText(e){return e.parts.map(e=>e.type===`text`?e.text:e.type===`file`?`[file${e.filename===void 0?``:`: ${e.filename}`}]`:``).filter(e=>e.length>0).join(`
2
+ `)}function authorizationTerminalMessage(e){switch(e){case`authorized`:return`Authorization complete`;case`declined`:return`Authorization declined`;case`failed`:return`Authorization failed`;case`timed-out`:return`Authorization timed out`;default:return}}function formatAuthorization(e,t){let n=[];if(t!==void 0)n.push(t);else{let t=stripTerminalControls(e.description);t.length>0&&n.push(t);let r=e.authorization;r?.url&&n.push(`URL: ${stripTerminalControls(r.url)}`),r?.userCode&&n.push(`Code: ${stripTerminalControls(r.userCode)}`),r?.expiresAt&&n.push(`Expires: ${stripTerminalControls(r.expiresAt)}`),r?.instructions&&n.push(stripTerminalControls(r.instructions))}if(e.state===`completed`&&e.reason!==void 0){let t=stripTerminalControls(e.reason);t.length>0&&n.push(`Reason: ${t}`)}return n.join(`
3
+ `)}function writeExistedFlag(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e.existed;return typeof t==`boolean`?t:void 0}export{activeToolSteps,agentTaskSummary,authorizationTerminalMessage,childToolCallIds,endLine,firstLine,formatAuthorization,isActive,isToolCallRow,labelContext,nestedTaskRecord,startLine,subagentSteps,taskCallsById,taskNeedsApproval,toolBlock,toolState,uniqueTaskName,userText,writeExistedFlag};
@@ -0,0 +1,47 @@
1
+ import { type ConversationState } from "#client/conversation-state.js";
2
+ import type { Block } from "./blocks.js";
3
+ import type { AgentTUIConversationView } from "./conversation-view.js";
4
+ import { type TaskEntry } from "./task-activity.js";
5
+ import type { SubagentDisplayMode, TerminalPartDisplayMode } from "./types.js";
6
+ export interface TranscriptOptions {
7
+ readonly tools: TerminalPartDisplayMode;
8
+ readonly reasoning: TerminalPartDisplayMode;
9
+ readonly subagents: SubagentDisplayMode;
10
+ readonly connectionAuth: TerminalPartDisplayMode;
11
+ /** Names of the agent's local subagents, whose tools read as delegations. */
12
+ readonly subagentNames?: readonly string[];
13
+ /** Where full failure detail is recorded, shown instead of the raw dump. */
14
+ readonly diagnosticsPath?: string;
15
+ /** Separates a task end line's facts; the theme's `·`. */
16
+ readonly dot?: string;
17
+ }
18
+ /** How long a settled agent task waits for its own last events before writing its end line. */
19
+ export declare const TASK_END_GRACE_MS = 2000;
20
+ /**
21
+ * Projects one session's conversation into transcript blocks. Each block's
22
+ * `live` flag says whether its part can still change; the renderer commits a
23
+ * settled prefix to scrollback. Built blocks are reused while their inputs are
24
+ * unchanged, so file-diff bases observe each tool call once, in order.
25
+ *
26
+ * A task writes one line when it starts, at its call, and one when it ends, where the transcript
27
+ * had reached by then; what it does in between is {@link ConversationTranscript.tasks}, which the
28
+ * renderer shows in the task panel above the prompt.
29
+ */
30
+ export declare class ConversationTranscript {
31
+ #private;
32
+ reset(): void;
33
+ /** The tasks between their start and end lines as of the last projection, in start order. */
34
+ get tasks(): readonly TaskEntry[];
35
+ /** Whether a settled agent task is waiting for its own last events. */
36
+ get finishing(): boolean;
37
+ /** How input requests name the task that asked: as its task lines do. */
38
+ taskLabel(conversation: ConversationState, taskId: string): string | undefined;
39
+ /** End lines for the tasks still working when their session ends; they read as stopped. */
40
+ stopWorking(options: TranscriptOptions): Block[];
41
+ project(view: AgentTUIConversationView, options: TranscriptOptions): Block[];
42
+ }
43
+ /**
44
+ * Running tools and the live turn's model activity, for the turn bar. A session parked on a
45
+ * sign-in names its connections, and a turn parked on its tasks names them.
46
+ */
47
+ export declare function turnActivity(view: AgentTUIConversationView, tasks: readonly TaskEntry[]): string;
@@ -0,0 +1 @@
1
+ import{FileContentCache}from"./file-content-cache.js";import{agentDisplayName,agentTaskLabel,isPanelRoutedTool,presentTool,readWriteFileInput,toolBaseName}from"./tool-presentation.js";import{isTerminalToolCallPart}from"./terminal-tool-part.js";import{activeToolSteps,agentTaskSummary,authorizationTerminalMessage,childToolCallIds,endLine,firstLine,formatAuthorization,isActive,isToolCallRow,labelContext,nestedTaskRecord,startLine,subagentSteps,taskCallsById,taskNeedsApproval,toolBlock,toolState,uniqueTaskName,userText,writeExistedFlag}from"./transcript-parts.js";import{signInLabel,waitingLabel}from"./task-activity.js";import{isTaskControlTool}from"#protocol/task-tools.js";import{stripTerminalControls}from"#cli/ui/terminal-text.js";import{agentCallTurns,agentToolSession,conversationAuthorizations,isAgentCallContentPending}from"#client/conversation-state.js";import{authorizationKey}from"#client/session-utils.js";const TASK_END_GRACE_MS=2e3;var ConversationTranscript=class{#e=new Map;#t=new FileContentCache;#n=new Map;#r=new Map;#i=new Set;#a=new Map;#o=new Map;#s=[];#c=new Set;#l=[];reset(){this.#e=new Map,this.#t.clear(),this.#n.clear(),this.#r=new Map,this.#i.clear(),this.#a.clear(),this.#o.clear(),this.#s=[],this.#c.clear(),this.#l=[]}get tasks(){return this.#l}get finishing(){return this.#l.some(e=>e.finishing===!0)}taskLabel(e,t){let n=e.tasks[t];if(n===void 0)return;let r=Object.values(n.calls),i=r.findLast(e=>e.status===`working`)??r.at(-1),a=i===void 0?void 0:this.#a.get(i.callId);return a===void 0?n.kind===`agent`?agentTaskLabel(agentDisplayName(stripTerminalControls(n.name))):stripTerminalControls(n.name):a.kind===`agent`?agentTaskLabel(a.name):a.name}stopWorking(e){let t=[];for(let n of this.#a.values())n.ended||(n.ended=!0,t.push(endLine(n,{status:`cancelled`},void 0,e.dot??`·`)));return this.#l=[],t}project(e,t){let{conversation:n,working:r}=e,i=Date.now(),a=[];this.#h(n.messages);let o=childToolCallIds(n),s=taskCallsById(n),c=new Set(e.data.withdrawnCallIds),l=e.data.toolLabels;for(let e of n.messages){if(e.role===`user`){let t=this.#g(e);t!==void 0&&a.push(t);continue}let u=e.parts.filter(e=>isToolCallRow(e)&&(e.state!==`input-streaming`||r)&&!isTaskControlTool(e.toolName)&&!c.has(e.toolCallId)&&e.toolMetadata?.eve?.inputRequest?.kind!==`session-limit`&&!s.has(e.toolCallId)&&!o.has(e.toolCallId)&&!isPanelRoutedTool(e.toolName)),d=new Map(u.map(e=>[e,toolState(e,n,r,!1)])),f=activeToolSteps(d);for(let[n,o]of e.parts.entries())if(o.type===`text`||o.type===`reasoning`){let i=this.#_(e,n,t,r);i!==void 0&&a.push(i)}else if(o.type===`authorization`)t.connectionAuth!==`hidden`&&a.push(this.#v(o));else if(o.type===`dynamic-tool`){let e=s.get(o.toolCallId);if(e!==void 0){let n=this.#d(o,e.task,l,t,i);n!==void 0&&a.push(n);continue}let n=d.get(o);if(n===void 0||t.tools===`hidden`)continue;let r=l[o.toolCallId];a.push(this.#y(o,n,f.has(o.stepIndex),r,t))}let p=e.metadata?.turnId;p!==void 0&&n.turns[p]?.status===`cancelled`&&a.push(this.#m(`cancelled:${p}`,[],()=>({kind:`notice`,body:`Cancelled.`,live:!1})))}for(let[n,r]of e.failures.entries())a.push(this.#b(n,r,t));let u=this.#u(a),d=this.#f(e,s,t,i);for(let e of d){let t=u.slice(-8).map(e=>e.id);this.#s.push({block:e,after:t}),this.#c.add(e.id),u.push(e)}return u}#u(e){let t=[...e];for(let{block:e,after:n}of this.#s){let r=t.length;for(let e=n.length-1;e>=0;--e){let i=t.findIndex(t=>t.id===n[e]);if(i!==-1){r=i+1;break}}t.splice(r,0,e)}return t}#d(e,t,n,r,i){if(!(t.kind===`agent`?r.subagents!==`hidden`:r.tools!==`hidden`))return;let a=e.toolCallId,o=n[a]?.start,s=this.#a.get(a),c=agentTaskSummary(e.input),l=agentDisplayName(stripTerminalControls(e.toolName));if(t.kind===`tool`){let t=presentTool(e.toolName,e.input,labelContext(o));l=stripTerminalControls(t.title),c=stripTerminalControls(t.subtitle)}return s===void 0&&(s={callId:a,kind:t.kind,name:uniqueTaskName(l,this.#a.values()),toolName:e.toolName,input:e.input,label:o,purpose:c||o,startedAtMs:i,ended:!1},this.#a.set(a,s)),this.#m(`task:${a}:start`,[s],()=>startLine(s))}#f(e,t,n,r){let{conversation:i,working:a}=e,o=Object.values(i.turns).at(-1),s=!a&&(e.data.sessionFailed||o?.status===`cancelled`||o?.status===`failed`),c=[],l=[],u={remaining:128};for(let e of this.#a.values()){if(e.ended)continue;let o=t.get(e.callId);if(o===void 0)continue;let{task:d,call:f}=o,p=this.#p(e,d,f,i,n,u);if(n.subagents===`full`)for(let e of p.rows)this.#c.has(e.id)||c.push(e);let m=f.status!==`working`;m&&(e.settledAtMs??=r);let h=m&&p.pending&&a&&r-(e.settledAtMs??r)<2e3;if(m&&!h||!m&&s){e.ended=!0,c.push(endLine(e,m?f:{status:`cancelled`},p.tools,n.dot??`·`));continue}let g={callId:e.callId,kind:e.kind,name:e.name,toolName:e.toolName,input:e.input,label:e.label,purpose:e.purpose,children:p.children,omittedTasks:p.omittedTasks,omittedAttention:p.omittedAttention,startedAtMs:e.startedAtMs,childTools:new Map(p.tools.map(e=>[e.id,e]))};p.step!==void 0&&(g.step=p.step),h&&(g.finishing=!0),l.push(g)}return this.#l=l,c}#p(e,t,n,r,i,a,o=0){let s=t.kind===`agent`?agentToolSession(r,t):void 0,c=s===void 0||s.observation.status===`not-followed`?void 0:s.observation.conversation;if(s===void 0||c===void 0)return{tools:[],rows:[],pending:!1};let l=s.observation.status===`following`&&isAgentCallContentPending(t,n,c),u=new Set(agentCallTurns(t,c).get(n.callId)??[]),d=c.messages.filter(e=>e.role===`assistant`&&e.metadata?.turnId!==void 0&&u.has(e.metadata.turnId)),f=n.status===`working`||l,p=taskCallsById(c),m=[],h=[],g=[],_=0,v=!1,y=0;for(let t of d)for(let n of t.parts){if(y+=1,!isToolCallRow(n)||isTaskControlTool(n.toolName))continue;let t=p.get(n.toolCallId),r=toolState(n,c,f,t?.call.status===`working`),s=`subagent:${e.callId}:tool:${n.toolCallId}`,l=this.#m(s,[n,r.status,e.name],()=>{let a=this.#x(n.toolCallId,n,r,i,{isSubagent:t?.task.kind===`agent`});return{...toolBlock(n,r,a),kind:`subagent-tool`,subagentCallId:e.callId,agentName:e.name,depth:1,live:!1}}),u=t?.task.kind===`agent`?i.subagents!==`hidden`:i.tools!==`hidden`;if(t?.call.status===`working`&&u){if(o>=8||a.remaining<=0){_+=1,v||=r.status===`approval`||taskNeedsApproval(c,t.task);continue}--a.remaining;let s=`${e.callId}/${n.toolCallId}`,u=this.#o.get(s);u===void 0&&(u=nestedTaskRecord(s,n,t.task,l),this.#o.set(s,u));let d=this.#p(u,t.task,t.call,c,i,a,o+1);g.push({...u,step:d.step,children:d.children,omittedTasks:d.omittedTasks,omittedAttention:d.omittedAttention,childTools:new Map(d.tools.map(e=>[e.id,e]))})}else h.push(l);m.push({order:y,block:l,settled:!isActive(r.status)})}let b=subagentSteps(d);for(let t of b){if(!t.finalized)continue;let n=`subagent:${e.callId}:step:${t.key}`,r=this.#m(n,[t.reasoning,t.message,e.name],()=>{let n={kind:`subagent-step`,subagentCallId:e.callId,agentName:e.name,depth:1,body:t.message,live:!1};return t.reasoning.length>0&&(n.reasoning=t.reasoning),n});m.push({order:t.order,block:r,settled:!0})}let x=m.filter(e=>e.settled).sort((e,t)=>e.order-t.order).map(e=>e.block),S=b.at(-1),C={tools:h,rows:x,children:g,omittedTasks:_,omittedAttention:v,pending:l};return S!==void 0&&(C.step=firstLine(S.message)??`Thinking`),C}#m(e,t,n){let r=this.#e.get(e);if(r!==void 0&&sameKey(r.key,t))return r.block;let i={...n(),id:e};return this.#e.set(e,{key:t,block:i}),i}#h(e){let t=new Map;for(let n of e)n.role===`user`&&n.metadata?.optimistic===!0&&t.set(n.id,userText(n));let n=[...this.#r].filter(([e])=>!t.has(e)),r=new Set(t.values());for(let t of e){if(t.role!==`user`||t.metadata?.optimistic===!0||this.#i.has(t.id))continue;let e=userText(t),i=n.findIndex(([,t])=>t===e);i===-1&&r.has(e)||(this.#i.add(t.id),i!==-1&&(this.#n.set(t.id,n[i][0]),n.splice(i,1)))}this.#r=t}#g(e){if(e.metadata?.optimistic!==!0&&!this.#i.has(e.id))return;let t=stripTerminalControls(userText(e));if(t.trim().length===0)return;let n=`user:${this.#n.get(e.id)??e.id}`;return this.#m(n,[t],()=>({kind:`user`,body:t,live:!1}))}#_(e,t,n,r){let i=e.parts[t];if(i?.type!==`text`&&i?.type!==`reasoning`||i.type===`reasoning`&&n.reasoning!==`full`)return;let a=stripTerminalControls(i.text).trim();if(a.length===0)return;let o=i.state===`streaming`&&r,s=`${i.type}:${i.id??`${e.id}:${t}`}`;return this.#m(s,[a,o],()=>i.type===`text`?{kind:`assistant`,body:a,live:o}:{kind:`reasoning`,body:a,collapsed:!1,live:o})}#v(e){return this.#m(`connection-auth:${authorizationKey(e)}`,[e],()=>{let t=e.state===`completed`?e.outcome:e.state,n=authorizationTerminalMessage(t);return{kind:`connection-auth`,title:`${stripTerminalControls(e.name)} · authorization · ${t}`,body:formatAuthorization(e,n),preformatted:!0,live:n===void 0}})}#y(e,t,n,r,i){let a=n||isActive(t.status);return this.#m(`tool:${e.toolCallId}`,[e,t.status,a,i.tools,i.subagentNames,r],()=>{let n=this.#x(e.toolCallId,e,t,i,{label:r?.start,completeLabel:r?.complete});return{...toolBlock(e,t,n),kind:`tool`,live:a,expanded:i.tools===`full`}})}#b(e,t,n){let{message:r,hint:i,detail:a}=t;return this.#m(`failure:${e}`,[r,i,a],()=>{let e={kind:`error`,title:`Error`,body:stripTerminalControls(r),live:!1};return i!==void 0&&(e.hint=stripTerminalControls(i)),a!==void 0&&(e.detail=n.diagnosticsPath===void 0?stripTerminalControls(a):`details: ${n.diagnosticsPath}`),e})}#x(e,t,n,r,i={}){n.output!==void 0&&this.#t.observeRead(n.output);let a={};(i.isSubagent===!0||r.subagentNames?.includes(toolBaseName(t.toolName))===!0)&&(a.isSubagent=!0),i.label!==void 0&&(a.label=i.label),i.completeLabel!==void 0&&(a.completeLabel=i.completeLabel);let o=readWriteFileInput(t.toolName,t.input);if(o!==void 0){let t=this.#t.observeWrite({...o,callId:e});t!==void 0&&(a.previousContent=t);let r=writeExistedFlag(n.output);r!==void 0&&(a.existed=r)}return Object.keys(a).length>0?a:void 0}};function turnActivity(e,t){let{conversation:n}=e,r=n.activeTurnId===void 0?void 0:n.turns[n.activeTurnId],i=e.conversation.messages.findLast(e=>e.role===`assistant`),a=taskCallsById(n);if(i?.parts.some(e=>isTerminalToolCallPart(e)&&!isTaskControlTool(e.toolName)&&!a.has(e.toolCallId)&&(e.state===`input-available`||e.state===`approval-responded`))===!0)return`Running`;if(r===void 0||r.waiting===!0){let e=conversationAuthorizations(n).filter(e=>e.state===`required`&&e.awaitsCallback===!0);if(e.length>0)return signInLabel(e.map(e=>e.displayName))}if(r?.waiting===!0&&t.length>0)return waitingLabel(t);if(i===void 0)return`Thinking`;let o=i.parts.findLast(e=>e.type!==`step-start`);return o?.type===`text`&&o.state===`streaming`||o?.type===`dynamic-tool`&&o.state===`input-streaming`?`Generating`:`Thinking`}function sameKey(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{ConversationTranscript,TASK_END_GRACE_MS,turnActivity};
@@ -1 +1 @@
1
- import{remoteHost}from"./target.js";import{createDevDiagnostics}from"../diagnostics.js";import{promptCommandsFor}from"./prompt-commands.js";import{probeMcpConnection}from"./mcp-connection-status.js";import{createPromptCommandHandler}from"./prompt-command-handler.js";import{formatRemoteAuthChallengeMessage}from"./remote-auth-result.js";import{TerminalRenderer}from"./terminal-renderer.js";import{EveTUIRunner}from"./runner.js";import{Client}from"#client/index.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{LOGIN_CONNECTION_COMMAND_OPTIONS}from"#setup/flows/model-login-options.js";import{toErrorMessage}from"#shared/errors.js";import{resolveDevelopmentOidcToken,resolveLinkedDevelopmentOidcToken}from"#services/dev-client/request-headers.js";import{isVercelAuthChallenge}from"#services/dev-client/vercel-auth-error.js";import{resolveVercelDeployment}from"#setup/vercel-deployment.js";import{appendUserAgentProduct}from"#internal/user-agent.js";import{resolveLocalDevelopmentClientOptions,resolveRemoteDevelopmentClientOptions}from"#services/dev-client/client-options.js";import{createDevelopmentCredentialGate}from"#services/dev-client/credential-gate.js";function inlineArgumentSuggestions(e){return async t=>{if(t===`loglevel`)return[{value:`all`,label:`all`,hint:`Show all captured logs`},{value:`stderr`,label:`stderr`,hint:`Show stderr logs only`},{value:`sandbox`,label:`sandbox`,hint:`Show sandbox logs only`},{value:`none`,label:`none`,hint:`Hide captured logs`}];if(t===`login`)return LOGIN_CONNECTION_COMMAND_OPTIONS.map(e=>({value:e.command,label:e.label}));if(t===`model`){let{gatewayModelCapabilities:e}=await import(`#setup/boxes/model-capabilities.js`),{fetchGatewayCatalog:t,modelOptionsFromCatalog:n}=await import(`#setup/boxes/select-model.js`),r=await t().catch(()=>void 0);return n(r).map(t=>{let n=e(r,t.value);return{value:t.value,label:t.value,hint:t.hint,...n?.reasoning?{next:[{value:`default`,label:`default`},...n.reasoningLevels.map(e=>({value:e,label:e}))]}:{}}})}let{browseRegistryCatalog:n}=await import(`#cli/commands/registry.js`);return(await n(e)).items.map(e=>({value:e.address,label:e.name,hint:e.description??e.address}))}}async function startDevelopmentTuiStartup(e){let t=await createDevDiagnostics(e.appRoot).catch(()=>void 0),n=new TerminalRenderer({...e,diagnostics:t,argumentSuggestions:inlineArgumentSuggestions(e.appRoot),onExitRequest:e.onExitRequest});return n.beginStartupDraft({initialDraft:e.initialInput,title:e.name??`eve`}),{diagnostics:t,renderer:n,finish:()=>n.finishStartupDraft(),async shutdown(){n.shutdown(),await t?.close()}}}function prepareRemoteTarget(e){return{target:e,credentials:createDevelopmentCredentialGate(e.serverUrl),resolveOidcToken:resolveDevelopmentOidcToken,resolveDeployment:t=>resolveVercelDeployment({workspaceRoot:e.workspaceRoot,host:remoteHost(e),signal:t})}}function prepareDevelopmentTarget(e){return e.kind===`local`?{kind:`local`,target:e}:{kind:`remote`,target:e,remote:prepareRemoteTarget(e)}}function withTuiUserAgent(e){let t=new Headers(e);return appendUserAgentProduct(t,`eve-tui/${resolveInstalledPackageInfo().version}`),Object.fromEntries(t.entries())}async function runDevelopmentTui(e){let{target:t,headers:n,initialInput:r,onboard:i,onOnboardingStep:a,onOnboardingTerminal:o,onBootProgress:s,lifecycle:c,startup:l,withExclusiveTerminal:u,...d}=e,f=prepareDevelopmentTarget(t),{serverUrl:p}=t,m={headers:withTuiUserAgent(n)},h=new Client(f.kind===`local`?resolveLocalDevelopmentClientOptions({...m,interactiveClient:!0,serverUrl:p,token:()=>resolveLinkedDevelopmentOidcToken(f.target.workspaceRoot)}):resolveRemoteDevelopmentClientOptions({...m,serverUrl:p,credentials:f.remote.credentials})),g={...d,client:h,serverUrl:p,promptCommandHandler:createPromptCommandHandler({target:t}),availablePromptCommands:promptCommandsFor(t.kind),...t.kind===`local`?{argumentSuggestions:inlineArgumentSuggestions(t.workspaceRoot)}:{},formatTransportError:e=>isVercelAuthChallenge(e)?formatRemoteAuthChallengeMessage(p):toErrorMessage(e)};f.kind===`local`?(g.appRoot=f.target.workspaceRoot,g.probeMcpConnection=probeMcpConnection):g.remote=f.remote,r!==void 0&&(g.initialInput=r),l!==void 0&&(g.renderer=l.renderer,g.startup=l),i!==void 0&&(g.onboard=i),a!==void 0&&(g.onOnboardingStep=a),o!==void 0&&(g.onOnboardingTerminal=o),s!==void 0&&(g.onBootProgress=s),c!==void 0&&(g.lifecycle=c),u!==void 0&&(g.withExclusiveTerminal=u);let _=l?.diagnostics??(f.kind===`local`?await createDevDiagnostics(f.target.workspaceRoot).catch(()=>void 0):void 0);_!==void 0&&(g.diagnostics=_);try{await new EveTUIRunner(g).run()}finally{await _?.close()}}export{runDevelopmentTui,startDevelopmentTuiStartup};
1
+ import{remoteHost}from"./target.js";import{createDevDiagnostics}from"../diagnostics.js";import{promptCommandsFor}from"./prompt-commands.js";import{probeMcpConnection}from"./mcp-connection-status.js";import{createPromptCommandHandler}from"./prompt-command-handler.js";import{formatRemoteAuthChallengeMessage}from"./remote-auth-result.js";import{TerminalRenderer}from"./terminal-renderer.js";import{EveTUIRunner}from"./runner.js";import{Client}from"#client/index.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{LOGIN_CONNECTION_COMMAND_OPTIONS}from"#setup/flows/model-login-options.js";import{toErrorMessage}from"#shared/errors.js";import{resolveDevelopmentOidcToken,resolveLinkedDevelopmentOidcToken}from"#services/dev-client/request-headers.js";import{isVercelAuthChallenge}from"#services/dev-client/vercel-auth-error.js";import{resolveVercelDeployment}from"#setup/vercel-deployment.js";import{appendUserAgentProduct}from"#internal/user-agent.js";import{resolveLocalDevelopmentClientOptions,resolveRemoteDevelopmentClientOptions}from"#services/dev-client/client-options.js";import{createDevelopmentCredentialGate}from"#services/dev-client/credential-gate.js";function inlineArgumentSuggestions(e){return async t=>{if(t===`loglevel`)return[{value:`none`,label:`none`,hint:`Hide logs`},{value:`error`,label:`error`,hint:`Errors only (default)`},{value:`warn`,label:`warn`,hint:`Warnings and errors`},{value:`debug`,label:`debug`,hint:`All severity-tagged logs`},{value:`all`,label:`all`,hint:`Include raw stdout and sandbox output`}];if(t===`login`)return LOGIN_CONNECTION_COMMAND_OPTIONS.map(e=>({value:e.command,label:e.label}));if(t===`model`){let{gatewayModelCapabilities:e}=await import(`#setup/boxes/model-capabilities.js`),{fetchGatewayCatalog:t,modelOptionsFromCatalog:n}=await import(`#setup/boxes/select-model.js`),r=await t().catch(()=>void 0);return n(r).map(t=>{let n=e(r,t.value);return{value:t.value,label:t.value,hint:t.hint,...n?.reasoning?{next:[{value:`default`,label:`default`},...n.reasoningLevels.map(e=>({value:e,label:e}))]}:{}}})}let{browseRegistryCatalog:n}=await import(`#cli/commands/registry.js`);return(await n(e)).items.map(e=>({value:e.address,label:e.name,hint:e.description??e.address}))}}async function startDevelopmentTuiStartup(e){let t=await createDevDiagnostics(e.appRoot).catch(()=>void 0),n=new TerminalRenderer({...e,diagnostics:t,argumentSuggestions:inlineArgumentSuggestions(e.appRoot),onExitRequest:e.onExitRequest});return n.beginStartupDraft({initialDraft:e.initialInput,title:e.name??`eve`}),{diagnostics:t,renderer:n,finish:()=>n.finishStartupDraft(),async shutdown(){n.shutdown(),await t?.close()}}}function prepareRemoteTarget(e){return{target:e,credentials:createDevelopmentCredentialGate(e.serverUrl),resolveOidcToken:resolveDevelopmentOidcToken,resolveDeployment:t=>resolveVercelDeployment({workspaceRoot:e.workspaceRoot,host:remoteHost(e),signal:t})}}function prepareDevelopmentTarget(e){return e.kind===`local`?{kind:`local`,target:e}:{kind:`remote`,target:e,remote:prepareRemoteTarget(e)}}function withTuiUserAgent(e){let t=new Headers(e);return appendUserAgentProduct(t,`eve-tui/${resolveInstalledPackageInfo().version}`),Object.fromEntries(t.entries())}async function runDevelopmentTui(e){let{target:t,headers:n,initialInput:r,onboard:i,onOnboardingStep:a,onOnboardingTerminal:o,onBootProgress:s,lifecycle:c,startup:l,withExclusiveTerminal:u,...d}=e,f=prepareDevelopmentTarget(t),{serverUrl:p}=t,m={headers:withTuiUserAgent(n)},h=new Client(f.kind===`local`?resolveLocalDevelopmentClientOptions({...m,interactiveClient:!0,serverUrl:p,token:()=>resolveLinkedDevelopmentOidcToken(f.target.workspaceRoot)}):resolveRemoteDevelopmentClientOptions({...m,serverUrl:p,credentials:f.remote.credentials})),g={...d,client:h,serverUrl:p,promptCommandHandler:createPromptCommandHandler({target:t}),availablePromptCommands:promptCommandsFor(t.kind),...t.kind===`local`?{argumentSuggestions:inlineArgumentSuggestions(t.workspaceRoot)}:{},formatTransportError:e=>isVercelAuthChallenge(e)?formatRemoteAuthChallengeMessage(p):toErrorMessage(e)};f.kind===`local`?(g.appRoot=f.target.workspaceRoot,g.probeMcpConnection=probeMcpConnection):g.remote=f.remote,r!==void 0&&(g.initialInput=r),l!==void 0&&(g.renderer=l.renderer,g.startup=l),i!==void 0&&(g.onboard=i),a!==void 0&&(g.onOnboardingStep=a),o!==void 0&&(g.onOnboardingTerminal=o),s!==void 0&&(g.onBootProgress=s),c!==void 0&&(g.lifecycle=c),u!==void 0&&(g.withExclusiveTerminal=u);let _=l?.diagnostics??(f.kind===`local`?await createDevDiagnostics(f.target.workspaceRoot).catch(()=>void 0):void 0);_!==void 0&&(g.diagnostics=_);try{await new EveTUIRunner(g).run()}finally{await _?.close()}}export{runDevelopmentTui,startDevelopmentTuiStartup};
@@ -1,36 +1,21 @@
1
+ import type { TokenUsage } from "./conversation-view.js";
1
2
  /**
2
- * One turn's wall clock and summed token flow. "When did this turn start"
3
- * is a single fact; this object is its single representation — armed once
4
- * per turn (a prompt submit, or an `--input` turn arming itself), fed by
5
- * step usage reports, and consumed exactly once by the end-of-turn coda.
6
- * Multi-pass turns (question answers, connection authorizations) re-stream
7
- * without re-arming, so one turn gets one coda.
3
+ * One turn's wall clock and token flow, measured against the session's summed
4
+ * step usage when work started. Armed when work starts and consumed once by
5
+ * the end-of-turn coda, so answering an approval or question mid-turn does
6
+ * not split the turn.
8
7
  */
9
8
  export declare class TurnClock {
10
9
  #private;
11
- /** Starts the turn: resets the summed flow and stamps the clock. */
12
- arm(): void;
10
+ arm(usage: TokenUsage): void;
13
11
  get armed(): boolean;
14
12
  get startedAtMs(): number | undefined;
15
- get usage(): {
16
- readonly inputTokens: number;
17
- readonly outputTokens: number;
18
- };
19
- addUsage(usage: {
20
- inputTokens?: number;
21
- outputTokens?: number;
22
- }): void;
23
- /**
24
- * Consumes the armed clock, returning the turn's elapsed time and summed
25
- * flow — or `undefined` when no turn was armed (the coda's "already
26
- * settled" signal). The flow survives the settle so a repaint between the
27
- * coda and the next arm still reads the last turn's numbers.
28
- */
29
- settle(): {
13
+ /** Token flow since the clock was armed. */
14
+ usage(current: TokenUsage): TokenUsage;
15
+ /** Consumes the armed clock, or returns `undefined` when no turn was armed. */
16
+ settle(current: TokenUsage): ({
30
17
  elapsedMs: number;
31
- inputTokens: number;
32
- outputTokens: number;
33
- } | undefined;
18
+ } & TokenUsage) | undefined;
34
19
  /** Drops the clock without a coda (conversation boundaries). */
35
20
  reset(): void;
36
21
  }
@@ -1 +1 @@
1
- var TurnClock=class{#e;#t={inputTokens:0,outputTokens:0};arm(){this.#e=Date.now(),this.#t={inputTokens:0,outputTokens:0}}get armed(){return this.#e!==void 0}get startedAtMs(){return this.#e}get usage(){return this.#t}addUsage(e){this.#t.inputTokens+=e.inputTokens??0,this.#t.outputTokens+=e.outputTokens??0}settle(){let e=this.#e;if(e!==void 0)return this.#e=void 0,{elapsedMs:Date.now()-e,...this.#t}}reset(){this.#e=void 0,this.#t={inputTokens:0,outputTokens:0}}};export{TurnClock};
1
+ var TurnClock=class{#e;#t={inputTokens:0,outputTokens:0};arm(e){this.#e=Date.now(),this.#t=e}get armed(){return this.#e!==void 0}get startedAtMs(){return this.#e}usage(e){return{inputTokens:Math.max(0,e.inputTokens-this.#t.inputTokens),outputTokens:Math.max(0,e.outputTokens-this.#t.outputTokens)}}settle(e){let t=this.#e;if(t!==void 0)return this.#e=void 0,{elapsedMs:Date.now()-t,...this.usage(e)}}reset(){this.#e=void 0,this.#t={inputTokens:0,outputTokens:0}}};export{TurnClock};
@@ -4,6 +4,13 @@ export type { LogDisplayMode };
4
4
  * Controls how terminal UI sections for stream parts are displayed.
5
5
  */
6
6
  export type TerminalPartDisplayMode = "full" | "collapsed" | "auto-collapsed" | "hidden";
7
+ /**
8
+ * Controls how subagent tasks render. `collapsed` writes a line when a
9
+ * subagent task starts and when it ends, and shows its current activity in
10
+ * the task panel above the prompt; `full` also writes each finished child
11
+ * message and tool call; `hidden` shows neither lines nor panel rows.
12
+ */
13
+ export type SubagentDisplayMode = "full" | "collapsed" | "hidden";
7
14
  /**
8
15
  * Controls which usage statistic is shown for assistant responses.
9
16
  */
@@ -25,12 +32,11 @@ export type TuiDisplayOptions = {
25
32
  */
26
33
  reasoning?: TerminalPartDisplayMode;
27
34
  /**
28
- * How subagent sections should render. `full` shows every nested child
29
- * event line and the subagent's output; `auto-collapsed` collapses the
30
- * section once the subagent reaches `done`; `collapsed` always shows
31
- * only the header; `hidden` skips the section entirely.
35
+ * How subagent tasks render.
36
+ *
37
+ * @default "collapsed"
32
38
  */
33
- subagents?: TerminalPartDisplayMode;
39
+ subagents?: SubagentDisplayMode;
34
40
  /**
35
41
  * How MCP connection authorization sections should render. `full`
36
42
  * shows the challenge URL and any user code; `auto-collapsed`
@@ -55,12 +61,10 @@ export type TuiDisplayOptions = {
55
61
  */
56
62
  contextSize?: number;
57
63
  /**
58
- * Which captured output (stdout, stderr, sandbox lifecycle lines) to
59
- * surface as inline regions. Output is always captured and buffered so it
64
+ * Minimum log severity to surface as inline regions. Output is always captured and buffered so it
60
65
  * cannot corrupt the frame; this only controls what is rendered. The
61
66
  * `/loglevel` command switches the mode at runtime, retroactively hiding or
62
- * restoring buffered lines. `TerminalRenderer` defaults to `none`; the
63
- * `eve dev` CLI defaults to `stderr`.
67
+ * restoring buffered lines. Defaults to `error`. Only `all` includes unclassified raw output.
64
68
  */
65
69
  logs?: LogDisplayMode;
66
70
  };
@@ -1,4 +1,4 @@
1
- import type { AssistantResponseStatsMode, LogDisplayMode, TerminalPartDisplayMode, TuiDisplayOptions } from "#cli/dev/tui/types.js";
1
+ import type { AssistantResponseStatsMode, LogDisplayMode, SubagentDisplayMode, TerminalPartDisplayMode, TuiDisplayOptions } from "#cli/dev/tui/types.js";
2
2
  /** Parsed `eve dev` options that control terminal-UI behavior. */
3
3
  interface DevelopmentTuiOptions {
4
4
  readonly assistantResponseStats?: AssistantResponseStatsMode;
@@ -6,7 +6,7 @@ interface DevelopmentTuiOptions {
6
6
  readonly contextSize?: number;
7
7
  readonly logs?: LogDisplayMode;
8
8
  readonly reasoning?: TerminalPartDisplayMode;
9
- readonly subagents?: TerminalPartDisplayMode;
9
+ readonly subagents?: SubagentDisplayMode;
10
10
  readonly tools?: TerminalPartDisplayMode;
11
11
  readonly ui?: boolean;
12
12
  }
@@ -1 +1 @@
1
- function resolveDevUiMode(e){return e.options.ui===!1||!e.interactive?`headless`:`tui`}function resolveTuiDisplayOptions(e){let t={logs:e.logs??`stderr`,reasoning:e.reasoning??`auto-collapsed`,tools:e.tools??`auto-collapsed`};return e.subagents!==void 0&&(t.subagents=e.subagents),e.connectionAuth!==void 0&&(t.connectionAuth=e.connectionAuth),e.assistantResponseStats!==void 0&&(t.assistantResponseStats=e.assistantResponseStats),e.contextSize!==void 0&&(t.contextSize=e.contextSize),t}export{resolveDevUiMode,resolveTuiDisplayOptions};
1
+ function resolveDevUiMode(e){return e.options.ui===!1||!e.interactive?`headless`:`tui`}function resolveTuiDisplayOptions(e){let t={logs:e.logs??`error`,reasoning:e.reasoning??`auto-collapsed`,tools:e.tools??`auto-collapsed`};return e.subagents!==void 0&&(t.subagents=e.subagents),e.connectionAuth!==void 0&&(t.connectionAuth=e.connectionAuth),e.assistantResponseStats!==void 0&&(t.assistantResponseStats=e.assistantResponseStats),e.contextSize!==void 0&&(t.contextSize=e.contextSize),t}export{resolveDevUiMode,resolveTuiDisplayOptions};
@@ -1,9 +1,11 @@
1
1
  import type { AgentReasoningDefinition } from "#shared/agent-definition.js";
2
- import type { AssistantResponseStatsMode, LogDisplayMode, TerminalPartDisplayMode } from "#cli/dev/tui/types.js";
2
+ import type { AssistantResponseStatsMode, LogDisplayMode, SubagentDisplayMode, TerminalPartDisplayMode } from "#cli/dev/tui/types.js";
3
3
  /** Parses a TCP port accepted by the CLI. */
4
4
  export declare function parsePortOption(value: string): number;
5
5
  /** Parses a terminal part display mode. */
6
6
  export declare function parseDisplayMode(value: string): TerminalPartDisplayMode;
7
+ /** Parses a subagent task display mode. */
8
+ export declare function parseSubagentDisplayMode(value: string): SubagentDisplayMode;
7
9
  /** Parses an assistant response statistics mode. */
8
10
  export declare function parseStatsMode(value: string): AssistantResponseStatsMode;
9
11
  /** Parses a server log display mode. */
@@ -1 +1 @@
1
- import{InvalidArgumentError}from"#compiled/commander/index.js";import{LOG_DISPLAY_MODES,parseLogDisplayMode}from"#cli/dev/tui/log-display-mode.js";import{ALL_REASONING_LEVELS}from"#setup/boxes/model-capabilities.js";function parsePortOption(e){if(!/^-?\d+$/.test(e))throw new InvalidArgumentError(`Expected a numeric port, received "${e}".`);let t=Number(e);if(t<0||t>65535)throw new InvalidArgumentError(`Expected a port between 0 and 65535, received "${e}".`);return t}const DISPLAY_MODES=new Set([`full`,`collapsed`,`auto-collapsed`,`hidden`]),STATS_MODES=new Set([`tokens`,`tokensPerSecond`]);function parseDisplayMode(e){if(!DISPLAY_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...DISPLAY_MODES].join(`, `)}, received "${e}".`);return e}function parseStatsMode(e){if(!STATS_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...STATS_MODES].join(`, `)}, received "${e}".`);return e}function parseLogsMode(e){let t=parseLogDisplayMode(e);if(t===void 0)throw new InvalidArgumentError(`Expected one of ${LOG_DISPLAY_MODES.join(`, `)}, received "${e}".`);return t}function parseContextSizeOption(e){let t=Number(e);if(!Number.isFinite(t)||t<=0)throw new InvalidArgumentError(`Expected a positive number, received "${e}".`);return t}const REASONING_VALUES=[`provider-default`,...ALL_REASONING_LEVELS];function parseAgentNamesOption(e){let t=e.split(`,`).map(e=>e.trim());if(t.length===0||t.some(e=>e===``))throw new InvalidArgumentError(`--agents requires a comma-separated list of at least one agent name.`);return t}function parseReasoningOption(e){if(!REASONING_VALUES.some(t=>t===e))throw new InvalidArgumentError(`Expected one of ${REASONING_VALUES.join(`, `)}, received "${e}".`);return e}export{parseAgentNamesOption,parseContextSizeOption,parseDisplayMode,parseLogsMode,parsePortOption,parseReasoningOption,parseStatsMode};
1
+ import{InvalidArgumentError}from"#compiled/commander/index.js";import{LOG_DISPLAY_MODES,parseLogDisplayMode}from"#cli/dev/tui/log-display-mode.js";import{ALL_REASONING_LEVELS}from"#setup/boxes/model-capabilities.js";function parsePortOption(e){if(!/^-?\d+$/.test(e))throw new InvalidArgumentError(`Expected a numeric port, received "${e}".`);let t=Number(e);if(t<0||t>65535)throw new InvalidArgumentError(`Expected a port between 0 and 65535, received "${e}".`);return t}const DISPLAY_MODES=new Set([`full`,`collapsed`,`auto-collapsed`,`hidden`]),STATS_MODES=new Set([`tokens`,`tokensPerSecond`]);function parseDisplayMode(e){if(!DISPLAY_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...DISPLAY_MODES].join(`, `)}, received "${e}".`);return e}const SUBAGENT_DISPLAY_MODES=new Set([`full`,`collapsed`,`hidden`]);function parseSubagentDisplayMode(e){if(!SUBAGENT_DISPLAY_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...SUBAGENT_DISPLAY_MODES].join(`, `)}, received "${e}".`);return e}function parseStatsMode(e){if(!STATS_MODES.has(e))throw new InvalidArgumentError(`Expected one of ${[...STATS_MODES].join(`, `)}, received "${e}".`);return e}function parseLogsMode(e){let t=parseLogDisplayMode(e);if(t===void 0)throw new InvalidArgumentError(`Expected one of ${LOG_DISPLAY_MODES.join(`, `)}, received "${e}".`);return t}function parseContextSizeOption(e){let t=Number(e);if(!Number.isFinite(t)||t<=0)throw new InvalidArgumentError(`Expected a positive number, received "${e}".`);return t}const REASONING_VALUES=[`provider-default`,...ALL_REASONING_LEVELS];function parseAgentNamesOption(e){let t=e.split(`,`).map(e=>e.trim());if(t.length===0||t.some(e=>e===``))throw new InvalidArgumentError(`--agents requires a comma-separated list of at least one agent name.`);return t}function parseReasoningOption(e){if(!REASONING_VALUES.some(t=>t===e))throw new InvalidArgumentError(`Expected one of ${REASONING_VALUES.join(`, `)}, received "${e}".`);return e}export{parseAgentNamesOption,parseContextSizeOption,parseDisplayMode,parseLogsMode,parsePortOption,parseReasoningOption,parseStatsMode,parseSubagentDisplayMode};
@@ -1 +1 @@
1
- import{graphemes}from"#shared/text-boundaries.js";const ansiPattern=RegExp(`\x1B\\[[0-?]*[ -/]*[@-~]`,`g`),ansiPrefixPattern=RegExp(`^\x1B\\[[0-?]*[ -/]*[@-~]`),oscPattern=RegExp(`\x1B\\][^\x1B\\x07]*(?:\\x07|\x1B\\\\)`,`g`),oscPrefixPattern=RegExp(`^\x1B\\][^\x1B\\x07]*(?:\\x07|\x1B\\\\)`),emojiPresentationPattern=/\p{Emoji_Presentation}/u,extendedPictographicPattern=/\p{Extended_Pictographic}/u,keycapPattern=/^[#*0-9]\u{fe0f}?\u{20e3}$/u;function stripAnsi(e){return stripTerminalControls(e.replaceAll(ansiPattern,``).replaceAll(oscPattern,``))}function stripTerminalControls(e){let t=``,n=0;for(;n<e.length;){let r=e.codePointAt(n);if(r==null)break;let i=String.fromCodePoint(r);n+=i.length,!isUnsafeTerminalControlCodePoint(r)&&(t+=i)}return t}function visibleLength(e){let t=0;for(let n of terminalTextUnits(e))t+=n.width;return t}function sliceVisible(e,t){return sliceUnits(terminalTextUnits(e),0,t)}function sliceUnits(e,t,n){if(n<=0)return``;let r=``,i=0,a=t;for(;a<e.length&&i<n;){let t=e[a];if(t.width>0&&i+t.width>n)break;r+=t.text,i+=t.width,a+=1}for(;e[a]?.ansi===!0;)r+=e[a].text,a+=1;return r}function clipVisible(e,t){if(visibleLength(e)<=t)return e;let n=sliceVisible(e,t);return n.includes(`\x1B`)?`${n}`:n}function inputTextWidth(e){let t=0;for(let n of graphemes(e))t+=terminalGraphemeWidth(n.text);return t}function renderInputText(e){return e.replaceAll(` `,` `)}function renderInputWithBlockCursor(e){let t=e.render??renderInputText,n=e.under.length>0?e.under:` `,r=e.visible?e.inverse(renderInputText(n)):t(n);return`${t(e.before)}${r}${t(e.after)}`}function offsetAtVisibleColumn(e,t){if(t<=0)return 0;let n=0;for(let r of graphemes(e)){let e=n+terminalGraphemeWidth(r.text);if(e>t)return r.start;if(e===t)return r.end;n=e}return e.length}function terminalGraphemeWidth(e){let t=0;for(let n of e){let e=n.codePointAt(0);e!==void 0&&(t=Math.max(t,codePointWidth(e)))}return emojiPresentationPattern.test(e)||keycapPattern.test(e)||e.includes(`️`)&&extendedPictographicPattern.test(e)?Math.max(2,t):t}function terminalTextUnits(e){let t=[],n=0;for(;n<e.length;){let r=e.slice(n),i=terminalControlPrefix(r);if(i!==void 0){t.push({text:i,width:0,ansi:!0}),n+=i.length;continue}let a=r.search(ansiPattern),o=r.search(oscPattern),s=a===-1?o:o===-1?a:Math.min(a,o),c=r.slice(0,s===-1?r.length:s);for(let e of graphemes(c))t.push({text:e.text,width:terminalGraphemeWidth(e.text),ansi:!1});n+=c.length}return t}function terminalControlPrefix(e){return e.match(ansiPrefixPattern)?.[0]??e.match(oscPrefixPattern)?.[0]}function wrapVisibleLine(e,t){if(t<=0)return[e];let n=terminalTextUnits(e),r=0;for(let e of n)r+=e.width;let i=[],a=0,o=0,consume=()=>{let e=n[a];o+=e.text.length,r-=e.width,a+=1};for(;r>t;){let r=findVisibleBreakPoint(n,a,t);i.push(e.slice(o,o+r).trimEnd());let s=o+r;for(;o<s&&a<n.length;)consume();for(;a<n.length;){let e=n[a];if(e.ansi||e.text.trimStart().length>0)break;consume()}}let s=e.slice(o);return(s.length>0||i.length===0)&&i.push(s),i}function findVisibleBreakPoint(e,t,n){let r=sliceUnits(e,t,n+1).lastIndexOf(` `);if(r>0)return r;let i=sliceUnits(e,t,n);if(visibleLength(i)>0)return i.length;let a=0,o=!1;for(let n=t;n<e.length;n+=1){let t=e[n];if(o&&t.width>0)return a;a+=t.text.length,t.width>0&&(o=!0)}return a}function codePointWidth(e){return e===9?4:e<32||e>=127&&e<160||isZeroWidthCodePoint(e)?0:isWideCodePoint(e)?2:1}function isUnsafeTerminalControlCodePoint(e){return e>=0&&e<=8||e>=11&&e<=31||e>=127&&e<=159}function isZeroWidthCodePoint(e){return e>=768&&e<=879||e>=1155&&e<=1161||e>=1425&&e<=1469||e===1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e===1479||e>=1552&&e<=1562||e>=1611&&e<=1631||e===1648||e>=1750&&e<=1756||e>=1759&&e<=1764||e>=1767&&e<=1768||e>=1770&&e<=1773||e===1809||e>=1840&&e<=1866||e>=1958&&e<=1968||e>=2027&&e<=2035||e>=2070&&e<=2073||e>=2075&&e<=2083||e>=2085&&e<=2087||e>=2089&&e<=2093||e>=2137&&e<=2139||e>=2259&&e<=2306||e===2362||e===2364||e>=2369&&e<=2376||e===2381||e>=2385&&e<=2391||e===8205||e>=65024&&e<=65039||e>=917760&&e<=917999}function isWideCodePoint(e){return e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744&&e<=128591||e>=129280&&e<=129535||e>=131072&&e<=262141)}export{clipVisible,inputTextWidth,offsetAtVisibleColumn,renderInputText,renderInputWithBlockCursor,sliceVisible,stripAnsi,stripTerminalControls,visibleLength,wrapVisibleLine};
1
+ import{graphemes}from"#shared/text-boundaries.js";const ansiPattern=RegExp(`\x1B\\[[0-?]*[ -/]*[@-~]`,`g`),ansiPrefixPattern=RegExp(`^\x1B\\[[0-?]*[ -/]*[@-~]`),oscPattern=RegExp(`\x1B\\][^\x1B\\x07]*(?:\\x07|\x1B\\\\)`,`g`),oscPrefixPattern=RegExp(`^\x1B\\][^\x1B\\x07]*(?:\\x07|\x1B\\\\)`),emojiPresentationPattern=/\p{Emoji_Presentation}/u,extendedPictographicPattern=/\p{Extended_Pictographic}/u,keycapPattern=/^[#*0-9]\u{fe0f}?\u{20e3}$/u;function stripAnsi(e){return stripTerminalControls(e.replaceAll(ansiPattern,``).replaceAll(oscPattern,``))}function stripTerminalControls(e){let t=``,n=0;for(;n<e.length;){let r=e.codePointAt(n);if(r==null)break;let i=String.fromCodePoint(r);n+=i.length,!isUnsafeTerminalControlCodePoint(r)&&(t+=i)}return t}function visibleLength(e){let t=0;for(let n of terminalTextUnits(e))t+=n.width;return t}function sliceVisible(e,t){return sliceUnits(terminalTextUnits(e),0,t)}function sliceUnits(e,t,n){if(n<=0)return``;let r=``,i=0,a=t;for(;a<e.length&&i<n;){let t=e[a];if(t.width>0&&i+t.width>n)break;r+=t.text,i+=t.width,a+=1}for(;e[a]?.ansi===!0;)r+=e[a].text,a+=1;return r}function clipVisible(e,t){if(visibleLength(e)<=t)return e;let n=sliceVisible(e,t);return n.includes(`\x1B`)?`${n}`:n}function inputTextWidth(e){let t=0;for(let n of graphemes(e))t+=terminalGraphemeWidth(n.text);return t}function renderInputText(e){return e.replaceAll(` `,` `)}function renderInputWithBlockCursor(e){let t=e.render??renderInputText,n=e.under.length>0?e.under:` `,r=e.visible?e.inverse(renderInputText(n)):t(n);return`${t(e.before)}${r}${t(e.after)}`}function offsetAtVisibleColumn(e,t){if(t<=0)return 0;let n=0;for(let r of graphemes(e)){let e=n+terminalGraphemeWidth(r.text);if(e>t)return r.start;if(e===t)return r.end;n=e}return e.length}function terminalGraphemeWidth(e){let t=0;for(let n of e){let e=n.codePointAt(0);e!==void 0&&(t=Math.max(t,codePointWidth(e)))}return emojiPresentationPattern.test(e)&&!e.includes(`︎`)||keycapPattern.test(e)||e.includes(`️`)&&extendedPictographicPattern.test(e)?Math.max(2,t):t}function terminalTextUnits(e){let t=[],n=0;for(;n<e.length;){let r=e.slice(n),i=terminalControlPrefix(r);if(i!==void 0){t.push({text:i,width:0,ansi:!0}),n+=i.length;continue}let a=r.search(ansiPattern),o=r.search(oscPattern),s=a===-1?o:o===-1?a:Math.min(a,o),c=r.slice(0,s===-1?r.length:s);for(let e of graphemes(c))t.push({text:e.text,width:terminalGraphemeWidth(e.text),ansi:!1});n+=c.length}return t}function terminalControlPrefix(e){return e.match(ansiPrefixPattern)?.[0]??e.match(oscPrefixPattern)?.[0]}function wrapVisibleLine(e,t){if(t<=0)return[e];let n=terminalTextUnits(e),r=0;for(let e of n)r+=e.width;let i=[],a=0,o=0,consume=()=>{let e=n[a];o+=e.text.length,r-=e.width,a+=1};for(;r>t;){let r=findVisibleBreakPoint(n,a,t);i.push(e.slice(o,o+r).trimEnd());let s=o+r;for(;o<s&&a<n.length;)consume();for(;a<n.length;){let e=n[a];if(e.ansi||e.text.trimStart().length>0)break;consume()}}let s=e.slice(o);return(s.length>0||i.length===0)&&i.push(s),i}function findVisibleBreakPoint(e,t,n){let r=sliceUnits(e,t,n+1).lastIndexOf(` `);if(r>0)return r;let i=sliceUnits(e,t,n);if(visibleLength(i)>0)return i.length;let a=0,o=!1;for(let n=t;n<e.length;n+=1){let t=e[n];if(o&&t.width>0)return a;a+=t.text.length,t.width>0&&(o=!0)}return a}function codePointWidth(e){return e===9?4:e<32||e>=127&&e<160||isZeroWidthCodePoint(e)?0:isWideCodePoint(e)?2:1}function isUnsafeTerminalControlCodePoint(e){return e>=0&&e<=8||e>=11&&e<=31||e>=127&&e<=159}function isZeroWidthCodePoint(e){return e>=768&&e<=879||e>=1155&&e<=1161||e>=1425&&e<=1469||e===1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e===1479||e>=1552&&e<=1562||e>=1611&&e<=1631||e===1648||e>=1750&&e<=1756||e>=1759&&e<=1764||e>=1767&&e<=1768||e>=1770&&e<=1773||e===1809||e>=1840&&e<=1866||e>=1958&&e<=1968||e>=2027&&e<=2035||e>=2070&&e<=2073||e>=2075&&e<=2083||e>=2085&&e<=2087||e>=2089&&e<=2093||e>=2137&&e<=2139||e>=2259&&e<=2306||e===2362||e===2364||e>=2369&&e<=2376||e===2381||e>=2385&&e<=2391||e===8205||e>=65024&&e<=65039||e>=917760&&e<=917999}function isWideCodePoint(e){return e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=42191&&e!==12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744&&e<=128591||e>=129280&&e<=129535||e>=131072&&e<=262141)}export{clipVisible,inputTextWidth,offsetAtVisibleColumn,renderInputText,renderInputWithBlockCursor,sliceVisible,stripAnsi,stripTerminalControls,visibleLength,wrapVisibleLine};