eve 0.7.3 → 0.8.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 (349) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +11 -11
  3. package/dist/src/chunks/{use-eve-agent-DErQj5hs.js → use-eve-agent-BSXZSn-R.js} +6 -1
  4. package/dist/src/chunks/{use-eve-agent-DoR8C4i6.js → use-eve-agent-Dlut2Qzt.js} +6 -1
  5. package/dist/src/cli/commands/init.js +1 -1
  6. package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
  7. package/dist/src/cli/dev/tui/blocks.js +8 -7
  8. package/dist/src/cli/dev/tui/command-typeahead.d.ts +13 -3
  9. package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
  10. package/dist/src/cli/dev/tui/line-editor.d.ts +6 -0
  11. package/dist/src/cli/dev/tui/line-editor.js +1 -1
  12. package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +2 -0
  13. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
  14. package/dist/src/cli/dev/tui/runner.d.ts +10 -0
  15. package/dist/src/cli/dev/tui/runner.js +1 -1
  16. package/dist/src/cli/dev/tui/setup-commands.d.ts +11 -7
  17. package/dist/src/cli/dev/tui/setup-commands.js +2 -2
  18. package/dist/src/cli/dev/tui/setup-flow.d.ts +72 -10
  19. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  20. package/dist/src/cli/dev/tui/setup-panel.d.ts +91 -39
  21. package/dist/src/cli/dev/tui/setup-panel.js +3 -1
  22. package/dist/src/cli/dev/tui/setup-selection-input.d.ts +48 -0
  23. package/dist/src/cli/dev/tui/setup-selection-input.js +1 -0
  24. package/dist/src/cli/dev/tui/status-line.d.ts +13 -7
  25. package/dist/src/cli/dev/tui/status-line.js +1 -1
  26. package/dist/src/cli/dev/tui/stream-format.d.ts +2 -0
  27. package/dist/src/cli/dev/tui/stream-format.js +2 -2
  28. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +4 -2
  29. package/dist/src/cli/dev/tui/terminal-renderer.js +7 -6
  30. package/dist/src/cli/dev/tui/terminal-text.d.ts +1 -0
  31. package/dist/src/cli/dev/tui/terminal-text.js +1 -1
  32. package/dist/src/cli/dev/tui/theme.d.ts +3 -1
  33. package/dist/src/cli/dev/tui/theme.js +1 -1
  34. package/dist/src/cli/dev/tui/tool-format.d.ts +1 -1
  35. package/dist/src/cli/dev/tui/tool-format.js +2 -2
  36. package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
  37. package/dist/src/cli/dev/tui/tui.d.ts +6 -0
  38. package/dist/src/cli/dev/tui/tui.js +1 -1
  39. package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -4
  40. package/dist/src/cli/dev/tui/vercel-status.js +1 -1
  41. package/dist/src/cli/run.d.ts +4 -3
  42. package/dist/src/cli/run.js +2 -2
  43. package/dist/src/cli/ui/output.d.ts +1 -0
  44. package/dist/src/cli/ui/output.js +8 -8
  45. package/dist/src/client/client.js +1 -1
  46. package/dist/src/client/session-utils.d.ts +1 -0
  47. package/dist/src/client/session-utils.js +1 -1
  48. package/dist/src/client/session.d.ts +1 -0
  49. package/dist/src/client/session.js +1 -1
  50. package/dist/src/client/types.d.ts +19 -0
  51. package/dist/src/compiled/.vendor-stamp.json +1 -2
  52. package/dist/src/compiler/compile-from-memory.js +1 -1
  53. package/dist/src/compiler/manifest.d.ts +28 -7
  54. package/dist/src/compiler/manifest.js +1 -1
  55. package/dist/src/compiler/normalize-agent-config.js +1 -1
  56. package/dist/src/compiler/normalize-sandbox.js +1 -1
  57. package/dist/src/context/providers/session.js +1 -1
  58. package/dist/src/evals/cli/eval-client.js +1 -1
  59. package/dist/src/execution/durable-session-store.js +1 -1
  60. package/dist/src/execution/sandbox/bash-tool.js +1 -1
  61. package/dist/src/execution/sandbox/bindings/docker-base-setup.d.ts +9 -0
  62. package/dist/src/execution/sandbox/bindings/docker-base-setup.js +2 -0
  63. package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +77 -0
  64. package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -0
  65. package/dist/src/execution/sandbox/bindings/docker-container.d.ts +16 -0
  66. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -0
  67. package/dist/src/execution/sandbox/bindings/docker-network.d.ts +8 -0
  68. package/dist/src/execution/sandbox/bindings/docker-network.js +1 -0
  69. package/dist/src/execution/sandbox/bindings/docker-options.d.ts +21 -0
  70. package/dist/src/execution/sandbox/bindings/docker-options.js +1 -0
  71. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +7 -0
  72. package/dist/src/execution/sandbox/bindings/docker-session.js +2 -0
  73. package/dist/src/execution/sandbox/bindings/docker-templates.d.ts +35 -0
  74. package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -0
  75. package/dist/src/execution/sandbox/bindings/docker-utils.d.ts +2 -0
  76. package/dist/src/execution/sandbox/bindings/docker-utils.js +1 -0
  77. package/dist/src/execution/sandbox/bindings/docker.d.ts +33 -0
  78. package/dist/src/execution/sandbox/bindings/docker.js +1 -0
  79. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +30 -0
  80. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -0
  81. package/dist/src/execution/sandbox/bindings/just-bash.d.ts +33 -0
  82. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -0
  83. package/dist/src/execution/sandbox/bindings/local-backend-utils.d.ts +23 -0
  84. package/dist/src/execution/sandbox/bindings/local-backend-utils.js +1 -0
  85. package/dist/src/execution/sandbox/bindings/local-template-prune.d.ts +16 -0
  86. package/dist/src/execution/sandbox/bindings/local-template-prune.js +1 -0
  87. package/dist/src/execution/sandbox/bindings/local.d.ts +16 -25
  88. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  89. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +16 -0
  90. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -0
  91. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +21 -0
  92. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -0
  93. package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +18 -0
  94. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -0
  95. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +34 -0
  96. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -0
  97. package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +22 -0
  98. package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +178 -0
  99. package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +3 -0
  100. package/dist/src/execution/sandbox/bindings/microsandbox-process.js +1 -0
  101. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +75 -0
  102. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -0
  103. package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +13 -0
  104. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -0
  105. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +22 -0
  106. package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -0
  107. package/dist/src/execution/sandbox/bindings/vercel-create-api.d.ts +20 -0
  108. package/dist/src/execution/sandbox/bindings/vercel-create-api.js +1 -0
  109. package/dist/src/execution/sandbox/bindings/vercel.d.ts +7 -8
  110. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  111. package/dist/src/execution/sandbox/development-cleanup.d.ts +4 -0
  112. package/dist/src/execution/sandbox/development-cleanup.js +1 -0
  113. package/dist/src/execution/sandbox/development-prewarm.d.ts +11 -0
  114. package/dist/src/execution/sandbox/development-prewarm.js +1 -0
  115. package/dist/src/execution/sandbox/development-run.d.ts +8 -0
  116. package/dist/src/execution/sandbox/development-run.js +1 -0
  117. package/dist/src/execution/sandbox/ensure.js +1 -1
  118. package/dist/src/execution/sandbox/grep-tool.js +1 -1
  119. package/dist/src/execution/sandbox/lazy-backend.d.ts +1 -1
  120. package/dist/src/execution/sandbox/logging-session.d.ts +5 -0
  121. package/dist/src/execution/sandbox/logging-session.js +1 -0
  122. package/dist/src/execution/sandbox/prewarm.js +1 -1
  123. package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +8 -0
  124. package/dist/src/execution/sandbox/template-prewarm-lock.js +1 -0
  125. package/dist/src/execution/workflow-steps.js +1 -1
  126. package/dist/src/harness/step-hooks.js +1 -1
  127. package/dist/src/harness/tool-loop.js +1 -1
  128. package/dist/src/internal/application/optional-package-install.d.ts +40 -0
  129. package/dist/src/internal/application/optional-package-install.js +1 -0
  130. package/dist/src/internal/application/package.js +1 -1
  131. package/dist/src/internal/authored-definition/sandbox.d.ts +1 -1
  132. package/dist/src/internal/authored-definition/sandbox.js +1 -1
  133. package/dist/src/internal/authored-module-loader.js +2 -2
  134. package/dist/src/internal/classify-model-routing.d.ts +24 -0
  135. package/dist/src/internal/classify-model-routing.js +1 -0
  136. package/dist/src/internal/nitro/host/channel-routes.js +2 -2
  137. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +5 -2
  138. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +1 -1
  139. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +10 -0
  140. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  141. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  142. package/dist/src/internal/nitro/host/dev-live-virtual-modules.d.ts +15 -0
  143. package/dist/src/internal/nitro/host/dev-live-virtual-modules.js +1 -0
  144. package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.d.ts +28 -0
  145. package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -0
  146. package/dist/src/internal/nitro/host/start-development-server.js +1 -1
  147. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +2 -0
  148. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
  149. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -0
  150. package/dist/src/internal/nitro/routes/info.js +1 -1
  151. package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
  152. package/dist/src/internal/resolve-model-endpoint-status.d.ts +23 -0
  153. package/dist/src/internal/resolve-model-endpoint-status.js +1 -0
  154. package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
  155. package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
  156. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
  157. package/dist/src/public/definitions/sandbox-backend.js +1 -1
  158. package/dist/src/public/sandbox/backends/default.d.ts +37 -10
  159. package/dist/src/public/sandbox/backends/default.js +1 -1
  160. package/dist/src/public/sandbox/backends/docker.d.ts +14 -0
  161. package/dist/src/public/sandbox/backends/docker.js +1 -0
  162. package/dist/src/public/sandbox/backends/just-bash.d.ts +17 -0
  163. package/dist/src/public/sandbox/backends/just-bash.js +1 -0
  164. package/dist/src/public/sandbox/backends/microsandbox.d.ts +17 -0
  165. package/dist/src/public/sandbox/backends/microsandbox.js +1 -0
  166. package/dist/src/public/sandbox/backends/vercel.d.ts +5 -2
  167. package/dist/src/public/sandbox/backends/vercel.js +1 -1
  168. package/dist/src/public/sandbox/docker-sandbox.d.ts +45 -0
  169. package/dist/src/public/sandbox/index.d.ts +8 -4
  170. package/dist/src/public/sandbox/index.js +1 -1
  171. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +17 -0
  172. package/dist/src/public/sandbox/just-bash-sandbox.js +1 -0
  173. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +54 -0
  174. package/dist/src/public/sandbox/microsandbox-sandbox.js +1 -0
  175. package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
  176. package/dist/src/runtime/compiled-artifacts-source.d.ts +11 -0
  177. package/dist/src/runtime/compiled-artifacts-source.js +1 -1
  178. package/dist/src/runtime/resolve-sandbox.js +1 -1
  179. package/dist/src/runtime/sandbox/keys.js +1 -1
  180. package/dist/src/runtime/sandbox/registry.d.ts +2 -2
  181. package/dist/src/runtime/types.d.ts +1 -1
  182. package/dist/src/runtime/workspace/spec.js +1 -1
  183. package/dist/src/setup/boxes/add-channels.d.ts +3 -2
  184. package/dist/src/setup/boxes/add-channels.js +2 -2
  185. package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
  186. package/dist/src/setup/boxes/deploy-project.js +1 -1
  187. package/dist/src/setup/boxes/link-project.js +1 -1
  188. package/dist/src/setup/boxes/resolve-provisioning.d.ts +6 -0
  189. package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
  190. package/dist/src/setup/boxes/select-model.d.ts +2 -2
  191. package/dist/src/setup/boxes/select-model.js +1 -1
  192. package/dist/src/setup/cli/channel-setup-prompter.d.ts +28 -0
  193. package/dist/src/setup/cli/channel-setup-prompter.js +1 -1
  194. package/dist/src/setup/cli/index.d.ts +2 -2
  195. package/dist/src/setup/cli/index.js +1 -1
  196. package/dist/src/setup/cli/option-row.d.ts +89 -0
  197. package/dist/src/setup/cli/option-row.js +1 -0
  198. package/dist/src/setup/cli/prompt-ui.d.ts +15 -29
  199. package/dist/src/setup/cli/prompt-ui.js +2 -2
  200. package/dist/src/setup/cli/select-component.d.ts +4 -3
  201. package/dist/src/setup/cli/select-component.js +1 -1
  202. package/dist/src/setup/cli/select-state.d.ts +3 -3
  203. package/dist/src/setup/cli/select-state.js +1 -1
  204. package/dist/src/setup/flows/channels.d.ts +29 -14
  205. package/dist/src/setup/flows/channels.js +1 -1
  206. package/dist/src/setup/flows/deploy.d.ts +1 -0
  207. package/dist/src/setup/flows/deploy.js +1 -1
  208. package/dist/src/setup/flows/link.d.ts +1 -0
  209. package/dist/src/setup/flows/link.js +1 -1
  210. package/dist/src/setup/flows/model.d.ts +30 -6
  211. package/dist/src/setup/flows/model.js +1 -1
  212. package/dist/src/setup/flows/vercel.d.ts +4 -1
  213. package/dist/src/setup/flows/vercel.js +2 -2
  214. package/dist/src/setup/index.js +1 -1
  215. package/dist/src/setup/primitives/open-url.d.ts +14 -0
  216. package/dist/src/setup/primitives/open-url.js +1 -0
  217. package/dist/src/setup/primitives/pm/pnpm.d.ts +9 -0
  218. package/dist/src/setup/primitives/pm/pnpm.js +2 -2
  219. package/dist/src/setup/primitives/pm/run.d.ts +12 -4
  220. package/dist/src/setup/primitives/pm/run.js +1 -1
  221. package/dist/src/setup/primitives/pm/types.d.ts +3 -0
  222. package/dist/src/setup/primitives/process-abort.d.ts +7 -0
  223. package/dist/src/setup/primitives/process-abort.js +1 -0
  224. package/dist/src/setup/primitives/run-vercel.d.ts +2 -0
  225. package/dist/src/setup/primitives/run-vercel.js +1 -1
  226. package/dist/src/setup/project-resolution.d.ts +6 -3
  227. package/dist/src/setup/project-resolution.js +1 -1
  228. package/dist/src/setup/prompter.d.ts +63 -6
  229. package/dist/src/setup/prompter.js +1 -1
  230. package/dist/src/setup/run-vercel-link.d.ts +1 -1
  231. package/dist/src/setup/run-vercel-link.js +1 -1
  232. package/dist/src/setup/runner.d.ts +2 -0
  233. package/dist/src/setup/runner.js +1 -1
  234. package/dist/src/setup/scaffold/channels-catalog.d.ts +2 -0
  235. package/dist/src/setup/scaffold/channels-catalog.js +1 -1
  236. package/dist/src/setup/scaffold/create/add-to-project.d.ts +1 -0
  237. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  238. package/dist/src/setup/scaffold/create/project.d.ts +2 -0
  239. package/dist/src/setup/scaffold/create/project.js +6 -3
  240. package/dist/src/setup/scaffold/update/channels.d.ts +2 -0
  241. package/dist/src/setup/scaffold/update/channels.js +3 -3
  242. package/dist/src/setup/slack-connect-lifecycle.d.ts +97 -0
  243. package/dist/src/setup/slack-connect-lifecycle.js +1 -0
  244. package/dist/src/setup/slack-connect.d.ts +51 -0
  245. package/dist/src/setup/slack-connect.js +1 -0
  246. package/dist/src/setup/slackbot.d.ts +60 -47
  247. package/dist/src/setup/slackbot.js +1 -1
  248. package/dist/src/setup/state.d.ts +2 -1
  249. package/dist/src/setup/state.js +1 -1
  250. package/dist/src/setup/step.d.ts +4 -0
  251. package/dist/src/setup/validate-gateway-key.d.ts +30 -0
  252. package/dist/src/setup/validate-gateway-key.js +1 -0
  253. package/dist/src/setup/vercel-project.d.ts +19 -12
  254. package/dist/src/setup/vercel-project.js +1 -1
  255. package/dist/src/shared/agent-definition.d.ts +26 -0
  256. package/dist/src/shared/model-endpoint-status.d.ts +27 -0
  257. package/dist/src/shared/model-endpoint-status.js +1 -0
  258. package/dist/src/shared/sandbox-backend.d.ts +8 -2
  259. package/dist/src/shared/sandbox-definition.d.ts +4 -3
  260. package/dist/src/shared/sandbox-network-policy.d.ts +4 -2
  261. package/dist/src/shared/sandbox-session.d.ts +3 -2
  262. package/dist/src/svelte/index.js +1 -1
  263. package/dist/src/svelte/use-eve-agent.js +1 -1
  264. package/dist/src/vue/index.js +1 -1
  265. package/dist/src/vue/use-eve-agent.js +1 -1
  266. package/{dist/docs/public → docs}/getting-started.mdx +14 -4
  267. package/{dist/docs/public → docs}/guides/deployment.md +3 -3
  268. package/{dist/docs/public → docs}/guides/dev-tui.md +2 -2
  269. package/{dist/docs/public → docs}/reference/cli.md +2 -1
  270. package/{dist/docs/public → docs}/sandbox.mdx +39 -15
  271. package/package.json +11 -1
  272. package/dist/src/compiled/just-bash/LICENSE +0 -201
  273. package/dist/src/compiled/just-bash/index.d.ts +0 -139
  274. package/dist/src/compiled/just-bash/index.js +0 -2200
  275. package/dist/src/compiled/just-bash/network/types.d.ts +0 -155
  276. package/dist/src/public/sandbox/backends/local.d.ts +0 -16
  277. package/dist/src/public/sandbox/backends/local.js +0 -1
  278. package/dist/src/public/sandbox/local-sandbox.d.ts +0 -7
  279. /package/dist/src/public/sandbox/{local-sandbox.js → docker-sandbox.js} +0 -0
  280. /package/{dist/docs/public → docs}/README.md +0 -0
  281. /package/{dist/docs/public → docs}/agent-config.md +0 -0
  282. /package/{dist/docs/public → docs}/channels/custom.mdx +0 -0
  283. /package/{dist/docs/public → docs}/channels/discord.mdx +0 -0
  284. /package/{dist/docs/public → docs}/channels/eve.mdx +0 -0
  285. /package/{dist/docs/public → docs}/channels/github.mdx +0 -0
  286. /package/{dist/docs/public → docs}/channels/linear.mdx +0 -0
  287. /package/{dist/docs/public → docs}/channels/meta.json +0 -0
  288. /package/{dist/docs/public → docs}/channels/overview.mdx +0 -0
  289. /package/{dist/docs/public → docs}/channels/slack.mdx +0 -0
  290. /package/{dist/docs/public → docs}/channels/teams.mdx +0 -0
  291. /package/{dist/docs/public → docs}/channels/telegram.mdx +0 -0
  292. /package/{dist/docs/public → docs}/channels/twilio.mdx +0 -0
  293. /package/{dist/docs/public → docs}/concepts/context-control.md +0 -0
  294. /package/{dist/docs/public → docs}/concepts/default-harness.md +0 -0
  295. /package/{dist/docs/public → docs}/concepts/execution-model-and-durability.md +0 -0
  296. /package/{dist/docs/public → docs}/concepts/meta.json +0 -0
  297. /package/{dist/docs/public → docs}/concepts/security-model.md +0 -0
  298. /package/{dist/docs/public → docs}/concepts/sessions-runs-and-streaming.md +0 -0
  299. /package/{dist/docs/public → docs}/connections.mdx +0 -0
  300. /package/{dist/docs/public → docs}/evals/assertions.mdx +0 -0
  301. /package/{dist/docs/public → docs}/evals/cases.mdx +0 -0
  302. /package/{dist/docs/public → docs}/evals/judge.mdx +0 -0
  303. /package/{dist/docs/public → docs}/evals/meta.json +0 -0
  304. /package/{dist/docs/public → docs}/evals/overview.mdx +0 -0
  305. /package/{dist/docs/public → docs}/evals/reporters.mdx +0 -0
  306. /package/{dist/docs/public → docs}/evals/running.mdx +0 -0
  307. /package/{dist/docs/public → docs}/evals/targets.mdx +0 -0
  308. /package/{dist/docs/public → docs}/guides/auth-and-route-protection.md +0 -0
  309. /package/{dist/docs/public → docs}/guides/client/continuations.mdx +0 -0
  310. /package/{dist/docs/public → docs}/guides/client/messages.mdx +0 -0
  311. /package/{dist/docs/public → docs}/guides/client/meta.json +0 -0
  312. /package/{dist/docs/public → docs}/guides/client/output-schema.mdx +0 -0
  313. /package/{dist/docs/public → docs}/guides/client/overview.mdx +0 -0
  314. /package/{dist/docs/public → docs}/guides/client/streaming.mdx +0 -0
  315. /package/{dist/docs/public → docs}/guides/dynamic-capabilities.md +0 -0
  316. /package/{dist/docs/public → docs}/guides/dynamic-workflows.md +0 -0
  317. /package/{dist/docs/public → docs}/guides/frontend/meta.json +0 -0
  318. /package/{dist/docs/public → docs}/guides/frontend/nextjs.mdx +0 -0
  319. /package/{dist/docs/public → docs}/guides/frontend/nuxt.mdx +0 -0
  320. /package/{dist/docs/public → docs}/guides/frontend/overview.mdx +0 -0
  321. /package/{dist/docs/public → docs}/guides/frontend/sveltekit.mdx +0 -0
  322. /package/{dist/docs/public → docs}/guides/frontend/use-eve-agent-svelte.mdx +0 -0
  323. /package/{dist/docs/public → docs}/guides/frontend/use-eve-agent-vue.mdx +0 -0
  324. /package/{dist/docs/public → docs}/guides/hooks.md +0 -0
  325. /package/{dist/docs/public → docs}/guides/instrumentation.md +0 -0
  326. /package/{dist/docs/public → docs}/guides/meta.json +0 -0
  327. /package/{dist/docs/public → docs}/guides/remote-agents.md +0 -0
  328. /package/{dist/docs/public → docs}/guides/session-context.md +0 -0
  329. /package/{dist/docs/public → docs}/guides/state.md +0 -0
  330. /package/{dist/docs/public → docs}/instructions.mdx +0 -0
  331. /package/{dist/docs/public → docs}/introduction.md +0 -0
  332. /package/{dist/docs/public → docs}/meta.json +0 -0
  333. /package/{dist/docs/public → docs}/reference/meta.json +0 -0
  334. /package/{dist/docs/public → docs}/reference/project-layout.md +0 -0
  335. /package/{dist/docs/public → docs}/reference/typescript-api.md +0 -0
  336. /package/{dist/docs/public → docs}/schedules.mdx +0 -0
  337. /package/{dist/docs/public → docs}/skills.mdx +0 -0
  338. /package/{dist/docs/public → docs}/subagents.mdx +0 -0
  339. /package/{dist/docs/public → docs}/tools.mdx +0 -0
  340. /package/{dist/docs/public → docs}/tutorial/connect-a-warehouse.mdx +0 -0
  341. /package/{dist/docs/public → docs}/tutorial/first-agent.mdx +0 -0
  342. /package/{dist/docs/public → docs}/tutorial/guard-the-spend.mdx +0 -0
  343. /package/{dist/docs/public → docs}/tutorial/how-it-runs.mdx +0 -0
  344. /package/{dist/docs/public → docs}/tutorial/meta.json +0 -0
  345. /package/{dist/docs/public → docs}/tutorial/query-sample-data.mdx +0 -0
  346. /package/{dist/docs/public → docs}/tutorial/remember-definitions.mdx +0 -0
  347. /package/{dist/docs/public → docs}/tutorial/run-analysis.mdx +0 -0
  348. /package/{dist/docs/public → docs}/tutorial/ship-it.mdx +0 -0
  349. /package/{dist/docs/public → docs}/tutorial/team-playbooks.mdx +0 -0
@@ -1,35 +1,97 @@
1
+ import type { ChannelSetupChoice, ChannelSetupChoiceOptions } from "#setup/cli/index.js";
1
2
  import type { SelectNotice } from "#setup/prompter.js";
2
3
  import type { SetupPanelOption } from "./setup-panel.js";
4
+ export type SetupEditableSelectResult = {
5
+ kind: "selected";
6
+ value: string;
7
+ } | {
8
+ kind: "edited";
9
+ value: string;
10
+ text: string;
11
+ };
12
+ interface SetupSelectRequestBase {
13
+ message: string;
14
+ options: readonly SetupPanelOption[];
15
+ notices?: readonly SelectNotice[];
16
+ }
17
+ interface SetupSingleSelectRequest extends SetupSelectRequestBase {
18
+ kind: "single" | "stacked" | "task-list";
19
+ initialValue?: string;
20
+ }
21
+ interface SetupSearchSelectRequest extends SetupSelectRequestBase {
22
+ kind: "search";
23
+ initialValue?: string;
24
+ placeholder?: string;
25
+ }
26
+ interface SetupMultiSelectRequest extends SetupSelectRequestBase {
27
+ kind: "multi";
28
+ initialValues?: readonly string[];
29
+ required: boolean;
30
+ }
31
+ interface SetupSearchableMultiSelectRequest extends SetupSelectRequestBase {
32
+ kind: "searchable-multi";
33
+ initialValues?: readonly string[];
34
+ placeholder?: string;
35
+ required: boolean;
36
+ }
37
+ /**
38
+ * A setup select's complete interaction grammar. The discriminant prevents
39
+ * callers from combining incompatible modes such as multi-select plus a
40
+ * single-select layout.
41
+ */
42
+ export type SetupSelectRequest = SetupSingleSelectRequest | SetupSearchSelectRequest | SetupMultiSelectRequest | SetupSearchableMultiSelectRequest;
3
43
  export interface SetupFlowRenderer {
4
44
  begin(title: string): void;
5
45
  end(options?: {
6
46
  preserveDiagnostics?: boolean;
7
47
  }): void;
8
- readSelect(options: {
48
+ readSelect(options: SetupSelectRequest): Promise<readonly string[] | undefined>;
49
+ readEditableSelect(options: {
9
50
  message: string;
10
51
  options: readonly SetupPanelOption[];
11
- multiple: boolean;
12
- search: boolean;
13
- required: boolean;
14
52
  initialValue?: string;
15
- initialValues?: readonly string[];
16
- placeholder?: string;
17
- layout?: "stacked";
18
- notices?: readonly SelectNotice[];
19
- }): Promise<readonly string[] | undefined>;
53
+ editable: {
54
+ value: string;
55
+ defaultValue: string;
56
+ formatHint: (value: string) => string;
57
+ validate?: (value: string) => string | undefined;
58
+ };
59
+ }): Promise<SetupEditableSelectResult | undefined>;
20
60
  readText(options: {
21
61
  message: string;
22
62
  placeholder?: string;
23
63
  defaultValue?: string;
24
64
  mask?: boolean;
25
65
  validate?: (value: string) => string | undefined;
66
+ notices?: readonly SelectNotice[];
26
67
  }): Promise<string | undefined>;
27
68
  readAcknowledge(options: {
28
69
  message: string;
29
70
  lines: readonly string[];
30
71
  }): Promise<void>;
72
+ /**
73
+ * Presents an inert context row and a separate action menu beside the live
74
+ * flow spinner. Returns the choice plus a `close()` that dismisses the menu
75
+ * when a concurrent wait resolves first. Used by the Slack install wait for
76
+ * "Try again" / "Cancel": the poll keeps running while the prompt is up, and
77
+ * whichever settles first wins.
78
+ */
79
+ readChoice(options: ChannelSetupChoiceOptions): ChannelSetupChoice;
31
80
  setStatus(text: string | undefined): void;
32
81
  renderLine(text: string, tone: "info" | "success" | "warning" | "error"): void;
33
82
  renderOutput(text: string): void;
83
+ /**
84
+ * Arms a key trap for the flow's working state — the status spinner between
85
+ * questions, where no prompt is consuming keys. Ctrl-C or Esc resolves the
86
+ * promise so the command can abandon an in-flight flow (e.g. a parked
87
+ * `vercel connect create` browser OAuth). Open questions own their keys; the
88
+ * trap covers only the gaps. `dispose` releases the trap; the promise then
89
+ * never resolves.
90
+ */
91
+ waitForInterrupt(): {
92
+ promise: Promise<void>;
93
+ dispose(): void;
94
+ };
34
95
  }
35
- export type SetupFlowPrompterRenderer = Pick<SetupFlowRenderer, "readSelect" | "readText" | "readAcknowledge" | "setStatus" | "renderLine" | "renderOutput">;
96
+ export type SetupFlowPrompterRenderer = Pick<SetupFlowRenderer, "readSelect" | "readEditableSelect" | "readText" | "readAcknowledge" | "readChoice" | "setStatus" | "renderLine" | "renderOutput">;
97
+ export {};
@@ -1 +1 @@
1
- import{join}from"node:path";import{pathExists}from"#setup/path-exists.js";const BOOT_DETECTIONS=[{id:`model-provider`,async detect({appRoot:n,env:r}){return r.AI_GATEWAY_API_KEY||r.VERCEL_OIDC_TOKEN?[]:await pathExists(join(n,`.vercel`,`project.json`))?[{label:`AI Gateway credentials missing`,command:`/model`}]:[{label:`model provider not linked`,command:`/model`}]}}];async function detectSetupIssues(e,t=BOOT_DETECTIONS){return(await Promise.all(t.map(async t=>{try{return await t.detect(e)}catch{return[]}}))).flat()}function formatSetupIssuesLine(e){let t=e.length===1?`setup issue`:`setup issues`,n=e.map(e=>`${e.label} · ${e.command}`).join(`, `);return`${e.length} ${t}: ${n}`}export{BOOT_DETECTIONS,detectSetupIssues,formatSetupIssuesLine};
1
+ import{join}from"node:path";import{pathExists}from"#setup/path-exists.js";const BOOT_DETECTIONS=[{id:`model-provider`,async detect({appRoot:n,env:r,info:i}){return i?.agent.model.routing?.kind===`external`||r.AI_GATEWAY_API_KEY||r.VERCEL_OIDC_TOKEN?[]:await pathExists(join(n,`.vercel`,`project.json`))?[{label:`AI Gateway credentials missing`,command:`/model`}]:[{label:`model provider not linked`,command:`/model`}]}}];async function detectSetupIssues(e,t=BOOT_DETECTIONS){return(await Promise.all(t.map(async t=>{try{return await t.detect(e)}catch{return[]}}))).flat()}function formatSetupIssuesLine(e){let t=e.length===1?`setup issue`:`setup issues`,n=e.map(e=>`${e.label} · ${e.command}`).join(`, `);return`${e.length} ${t}: ${n}`}export{BOOT_DETECTIONS,detectSetupIssues,formatSetupIssuesLine};
@@ -9,38 +9,79 @@
9
9
  * assert on strings.
10
10
  *
11
11
  * Column grammar: the panel adds a one-space left margin to every row under
12
- * the rule, so gutter glyphs (cursor, spinner, tone marks) sit at column 1
13
- * and written text always starts at column 3. The question renderers stay
14
- * margin-free (glyphs 0, text 2) — the margin is applied once, in
15
- * {@link renderFlowPanel}, so every question variant lines up by
16
- * construction.
12
+ * the rule, while each section contributes two more spaces. Titles, spinners,
13
+ * notices, filter prompts, and option-state glyphs therefore all begin at
14
+ * column 3.
17
15
  */
18
- import type { PromptOption } from "#setup/cli/index.js";
16
+ import type { ChannelSetupAction, PromptOption } from "#setup/cli/index.js";
19
17
  import { type SelectState } from "#setup/cli/select-state.js";
20
18
  import type { SelectNotice } from "#setup/prompter.js";
21
19
  import { type LineState } from "./line-editor.js";
22
20
  import type { Theme } from "./theme.js";
23
21
  /** One row of a setup select panel; the shared prompt-option shape. */
24
22
  export type SetupPanelOption = PromptOption<string>;
25
- export interface SetupSelectPanelState {
23
+ interface SetupQuestionPanelBase {
26
24
  message: string;
27
- options: readonly SetupPanelOption[];
28
- multiple: boolean;
29
- search: boolean;
30
- placeholder?: string;
31
- select: SelectState;
32
25
  error?: string;
33
- /** "stacked" puts each hint on its own line with blank rows between options. */
34
- layout?: "stacked";
35
26
  /** Outcome lines from earlier menu laps, shown beneath the options. */
36
27
  notices?: readonly SelectNotice[];
37
28
  }
29
+ interface SetupSelectPanelBase extends SetupQuestionPanelBase {
30
+ options: readonly SetupPanelOption[];
31
+ select: SelectState;
32
+ }
33
+ interface SetupEditableRow {
34
+ /**
35
+ * The row whose hint is a live rename field. Hovering it (cursor on the row)
36
+ * makes it editable directly — typing and backspace edit the name in place —
37
+ * so the editor's text and a blinking caret render only on that row.
38
+ */
39
+ optionValue: string;
40
+ editor: LineState;
41
+ defaultValue: string;
42
+ formatHint: (value: string) => string;
43
+ caretVisible: boolean;
44
+ }
45
+ /**
46
+ * Select presentation variants. The discriminant owns the interaction grammar
47
+ * so feature combinations are deliberate rather than resolved by conditional
48
+ * precedence inside the renderer.
49
+ */
50
+ type SetupOptionSelectPanelState = (SetupSelectPanelBase & {
51
+ kind: "single";
52
+ }) | (SetupSelectPanelBase & {
53
+ kind: "search";
54
+ placeholder?: string;
55
+ }) | (SetupSelectPanelBase & {
56
+ kind: "multi";
57
+ }) | (SetupSelectPanelBase & {
58
+ kind: "searchable-multi";
59
+ placeholder?: string;
60
+ }) | (SetupSelectPanelBase & {
61
+ kind: "stacked";
62
+ }) | (SetupSelectPanelBase & {
63
+ kind: "task-list";
64
+ }) | (SetupSelectPanelBase & {
65
+ kind: "editable";
66
+ edit: SetupEditableRow;
67
+ });
68
+ interface SetupActionsPanelState {
69
+ kind: "actions";
70
+ /** Inert explanation rendered above, and separately from, the action group. */
71
+ context: string;
72
+ actions: readonly ChannelSetupAction[];
73
+ /** No action is focused until the user moves into the action group. */
74
+ cursor: number | undefined;
75
+ }
76
+ export type SetupSelectPanelState = SetupOptionSelectPanelState | SetupActionsPanelState;
38
77
  export interface SetupTextPanelState {
39
78
  message: string;
40
79
  editor: LineState;
41
80
  placeholder?: string;
42
81
  mask: boolean;
43
82
  error?: string;
83
+ /** Context lines shown above the message; gone once the question settles. */
84
+ notices?: readonly SelectNotice[];
44
85
  }
45
86
  export interface SetupAcknowledgePanelState {
46
87
  message: string;
@@ -50,27 +91,43 @@ export interface SetupAcknowledgePanelState {
50
91
  export interface FlowPanelLine {
51
92
  text: string;
52
93
  tone: "info" | "success" | "warning" | "error";
94
+ /**
95
+ * Subprocess output a warning/error settle pulled in as its evidence.
96
+ * Renders like any info line in the panel, but survives the panel close
97
+ * alongside the diagnostic it explains (a plain info line does not).
98
+ */
99
+ evidence?: boolean;
53
100
  }
54
- /** The whole bordered section: title, recent progress, question or status. */
55
- export interface FlowPanelState {
56
- /** The invoked command, e.g. "/deploy". Empty renders no title row. */
57
- title: string;
58
- lines: readonly FlowPanelLine[];
59
- /** Ephemeral status shown when no question is active. */
101
+ export type FlowPanelContent = {
102
+ kind: "question";
103
+ rows: readonly string[];
104
+ /** The install wait keeps its spinner above the concurrent actions. */
60
105
  status?: {
61
106
  text: string;
62
107
  frame: string;
63
108
  };
64
- /**
65
- * The latest subprocess output line — a transient preview replaced on every
66
- * write, mirroring the rail-log's command preview. Shown dim under the
67
- * status (or alone behind the spinner) and never persisted.
68
- */
109
+ } | {
110
+ kind: "status";
111
+ status: {
112
+ text: string;
113
+ frame: string;
114
+ };
115
+ /** Latest child-process output shown transiently beneath the status. */
69
116
  preview?: string;
70
- /** The current spinner frame, for the preview/idle pulse rows. */
71
- frame?: string;
72
- /** The active question's rows (a select or text section). */
73
- question?: readonly string[];
117
+ } | {
118
+ kind: "preview";
119
+ text: string;
120
+ frame: string;
121
+ } | {
122
+ kind: "idle";
123
+ frame: string;
124
+ };
125
+ /** The whole bordered section: title, recent progress, and one explicit mode. */
126
+ export interface FlowPanelState {
127
+ /** The invoked command, e.g. "/deploy". Empty renders no title row. */
128
+ title: string;
129
+ lines: readonly FlowPanelLine[];
130
+ content: FlowPanelContent;
74
131
  }
75
132
  /**
76
133
  * Paints the bordered flow panel. Everything a running command produces lives
@@ -80,18 +137,12 @@ export interface FlowPanelState {
80
137
  */
81
138
  export declare function renderFlowPanel(state: FlowPanelState, theme: Theme, width: number): string[];
82
139
  /**
83
- * Paints a select question section (for the flow panel). The cursor row's
84
- * `description` rides on a dim line beneath it; a searchable question windows
85
- * the option list around the cursor (a leading run of `featured` options
86
- * sizes the unfiltered viewport) and advertises the rest with a count footer.
140
+ * Paints a selection section for the flow panel. Ordinary selects use the
141
+ * shared option reducer; concurrent actions render an explicit context row and
142
+ * independent action group. A searchable select windows the option list around
143
+ * the cursor and advertises the rest with a count footer.
87
144
  */
88
145
  export declare function renderSelectQuestion(state: SetupSelectPanelState, theme: Theme, width: number): string[];
89
- /** True when a select question numbers its rows (and accepts digit jumps). */
90
- export declare function numbersSelectRows(state: {
91
- multiple: boolean;
92
- search: boolean;
93
- options: readonly SetupPanelOption[];
94
- }): boolean;
95
146
  /** Paints a text question section: message, a caret-bearing input line, hints. */
96
147
  export declare function renderTextQuestion(state: SetupTextPanelState, theme: Theme, width: number, caretVisible: boolean): string[];
97
148
  /**
@@ -101,3 +152,4 @@ export declare function renderTextQuestion(state: SetupTextPanelState, theme: Th
101
152
  * footer advertises only enter.
102
153
  */
103
154
  export declare function renderAcknowledgeQuestion(state: SetupAcknowledgePanelState, theme: Theme, width: number): string[];
155
+ export {};
@@ -1 +1,3 @@
1
- import{sliceVisible,visibleLength}from"./terminal-text.js";import{visibleLine}from"./line-editor.js";import{filterOptions,submitRowIndex}from"#setup/cli/select-state.js";function clip(n,r){return visibleLength(n)>r?sliceVisible(n,r):n}function questionFooter(e,t){let n=t.colors;return[``,` ${n.dim(n.italic(e.join(` ${t.glyph.dot} `)))}`]}const BOLD_OR_DIM_CLOSE=`\x1B[22m`;function dimWithEmphasis(e,t){return t.colors.dim(e.replaceAll(BOLD_OR_DIM_CLOSE,`${BOLD_OR_DIM_CLOSE}`))}function toneGlyph(e,t){let n=t.colors;switch(e){case`success`:return n.green(t.glyph.success);case`warning`:return n.yellow(t.glyph.warning);case`error`:return n.red(t.glyph.error);case`info`:return n.dim(t.glyph.dot)}}function renderFlowPanel(e,t,n){let r=t.colors,i=[r.dim(t.glyph.hrule.repeat(Math.max(1,n)))];e.title.length>0&&i.push(` ${r.blue(r.bold(e.title))}`),i.push(``);let a=e.lines.slice(-6);for(let e of a){let n=e.tone===`info`?r.dim(e.text):e.text;i.push(`${toneGlyph(e.tone,t)} ${n}`)}return a.length>0&&i.push(``),e.question===void 0?e.status===void 0?e.preview===void 0?i.push(`${r.yellow(e.frame??``)} ${r.dim(`Working…`)}`):i.push(`${r.yellow(e.frame??``)} ${r.dim(e.preview)}`):(i.push(`${r.yellow(e.status.frame)} ${r.dim(e.status.text)}`),e.preview!==void 0&&i.push(` ${r.dim(e.preview)}`)):i.push(...e.question),i.map((e,t)=>t===0||e.length===0?clip(e,n):clip(` ${e}`,n))}function optionRow(e){let{option:t,theme:n}=e,r=n.colors,i=e.isCursor?r.cyan(n.glyph.prompt):` `,a=e.number===void 0?``:`${e.number}. `,o=e.checkbox?`${t.locked?r.dim(`◼`):e.isChecked?r.green(`◼`):r.dim(`◻`)} `:``,s=t.label;t.disabled?s=r.dim(`${s}${t.disabledReason?` (${t.disabledReason})`:``}`):t.locked?s=r.dim(`${s}${t.lockedReason?` (${t.lockedReason})`:``}`):e.isCursor&&(s=r.blue(s));let c=t.hint?r.dim(` ${n.glyph.dot} ${t.hint}`):``;return`${i} ${a}${o}${s}${c}`}function renderSelectQuestion(e,t,n){let a=t.colors,o=e.search?filterOptions(e.options,e.select.filter):e.options,s=e.multiple?submitRowIndex(o):-1,c=e.select.cursor,l=[` ${a.bold(e.message)}`,``],u=numbersSelectRows(e);if(e.search){let n=e.select.filter.length>0?e.select.filter+a.dim(t.glyph.caret):e.placeholder===void 0?a.dim(t.glyph.caret):a.dim(e.placeholder);l.push(` ${n}`,``)}let d=0;for(;o[d]?.featured;)d+=1;let f=e.search&&e.select.filter===``&&d>0?Math.min(d,8):e.search?8:o.length,p=Math.max(0,Math.min(c-Math.floor(f/2),Math.max(0,o.length-f))),m=Math.min(p+f,o.length);o.length===0&&l.push(` ${a.dim(`(no matches)`)}`);for(let n=p;n<m;n+=1){let r=o[n],i=n===c,s=e.layout===`stacked`,d=r;if(s&&r.hint!==void 0){let{hint:e,...t}=r;d=t}let f={option:d,isCursor:i,isChecked:e.multiple&&e.select.selected.has(r.value),checkbox:e.multiple,theme:t};if(u&&(f.number=n+1),l.push(optionRow(f)),s&&r.hint!==void 0){let e=` `.repeat(2+(u?`${n+1}. `.length:0));l.push(`${e}${dimWithEmphasis(r.hint,t)}`)}i&&r.description&&!r.disabled&&l.push(` ${a.dim(r.description)}`),s&&n<m-1&&l.push(``)}if(e.multiple&&s>=0){let e=c===s,n=e?a.cyan(t.glyph.prompt):` `,r=e?a.blue(a.bold(`Submit`)):`Submit`;l.push(``,`${n} ${r}`)}if(o.length>m-p&&l.push(` ${a.dim(`↑↓ ${o.length} options, showing ${p+1}–${m}`)}`),e.notices!==void 0&&e.notices.length>0){l.push(``);for(let n of e.notices){let e=n.tone===`info`?a.dim(n.text):n.text;l.push(` ${toneGlyph(n.tone,t)} ${e}`)}}e.error!==void 0&&l.push(``,` ${a.red(e.error)}`);let h=[];return e.search&&h.push(`type to filter`),h.push(`↑/↓ move`),h.push(e.multiple?`space to toggle`:`enter to select`),e.multiple&&h.push(`enter on Submit to confirm`),h.push(`esc to cancel`),l.push(...questionFooter(h,t)),l.map(e=>clip(e,n))}function numbersSelectRows(e){return!e.multiple&&!e.search&&e.options.length>1}function renderTextQuestion(e,t,r,i){let a=t.colors,o=[` ${a.bold(e.message)}`,``],s=Math.max(4,r-4),{before:c,after:l}=visibleLine(e.mask?{text:`•`.repeat(e.editor.text.length),cursor:e.editor.cursor}:{text:e.editor.text,cursor:e.editor.cursor},s,t.glyph.ellipsis),u=i?a.cyan(t.glyph.caret):` `,d=e.editor.text.length===0&&e.placeholder!==void 0?`${u}${a.dim(e.placeholder)}`:`${c}${u}${l}`;return o.push(` ${d}`),e.error!==void 0&&o.push(``,` ${a.red(e.error)}`),o.push(...questionFooter([`enter to submit`,`esc to cancel`],t)),o.map(e=>clip(e,r))}function renderAcknowledgeQuestion(e,t,n){let r=t.colors,i=[` ${r.bold(e.message)}`];if(e.lines.length>0){i.push(``);for(let t of e.lines)i.push(` ${r.dim(t)}`)}return i.push(...questionFooter([`enter to continue`],t)),i.map(e=>clip(e,n))}export{numbersSelectRows,renderAcknowledgeQuestion,renderFlowPanel,renderSelectQuestion,renderTextQuestion};
1
+ import{sliceVisible,visibleLength,wrapVisibleLine}from"./terminal-text.js";import{visibleLine}from"./line-editor.js";import{renderOptionRow,resolveOptionRowState}from"#setup/cli/option-row.js";import{filterOptions,submitRowIndex}from"#setup/cli/select-state.js";function clip(n,r){if(visibleLength(n)<=r)return n;let i=sliceVisible(n,r);return i.includes(`\x1B[`)?`${i}\x1b[0m`:i}function questionFooter(e,t){let n=t.colors;return[``,` ${n.dim(n.italic(e.join(` ${t.glyph.dot} `)))}`]}const BOLD_OR_DIM_CLOSE=`\x1B[22m`;function dimWithEmphasis(e,t){return t.colors.dim(e.replaceAll(BOLD_OR_DIM_CLOSE,`${BOLD_OR_DIM_CLOSE}`))}function toneGlyph(e,t){let n=t.colors;switch(e){case`success`:return n.green(t.glyph.success);case`warning`:return n.yellow(t.glyph.warning);case`error`:return n.red(t.glyph.error);case`info`:return n.dim(t.glyph.dot)}}function renderFlowPanel(e,t,n){let r=t.colors,i=[r.dim(t.glyph.hrule.repeat(Math.max(1,n)))];e.title.length>0&&i.push(` ${r.bold(e.title)}`),i.push(``);let a=e.lines.slice(-6);for(let e of a){let n=e.tone===`info`?r.dim(e.text):e.text;i.push(` ${toneGlyph(e.tone,t)} ${n}`)}switch(a.length>0&&i.push(``),e.content.kind){case`question`:e.content.status!==void 0&&i.push(` ${r.yellow(e.content.status.frame)} ${r.dim(e.content.status.text)}`,``),i.push(...e.content.rows);break;case`status`:i.push(` ${r.yellow(e.content.status.frame)} ${r.dim(e.content.status.text)}`),e.content.preview!==void 0&&i.push(` ${r.dim(e.content.preview)}`);break;case`preview`:i.push(` ${r.yellow(e.content.frame)} ${r.dim(e.content.text)}`);break;case`idle`:i.push(` ${r.yellow(e.content.frame)} ${r.dim(`Working…`)}`);break}return i.map((e,t)=>t===0||e.length===0?clip(e,n):clip(` ${e}`,n))}function optionRow(e){let{option:t,theme:n}=e;return renderOptionRow({colors:n.colors,glyphs:{pointer:n.glyph.pointer,success:n.glyph.success,placeholder:n.glyph.option,dot:n.glyph.dot},label:t.label,hint:t.hint,focusHint:t.focusHint,accent:t.accent,isCursor:e.isCursor,state:resolveOptionRowState(t,e.isChecked),placeholder:e.placeholder,hintPadding:e.hintPadding})}function selectPresentation(e){switch(e.kind){case`single`:return{selection:`single`,filter:void 0,layout:`plain`,edit:void 0};case`search`:return{selection:`single`,filter:{placeholder:e.placeholder},layout:`plain`,edit:void 0};case`multi`:return{selection:`multiple`,filter:void 0,layout:`plain`,edit:void 0};case`searchable-multi`:return{selection:`multiple`,filter:{placeholder:e.placeholder},layout:`plain`,edit:void 0};case`stacked`:return{selection:`single`,filter:void 0,layout:`stacked`,edit:void 0};case`task-list`:return{selection:`single`,filter:void 0,layout:`task-list`,edit:void 0};case`editable`:return{selection:`single`,filter:void 0,layout:`task-list`,edit:e.edit}}}function selectMessageRows(e,t,n){if(e===``)return[];let r=e.split(`
2
+ `).map((e,r)=>` ${t===`stacked`||r>0?n.colors.bold(e):e}`);return r.push(``),r}function searchFilter(e,t,n){return e.length>0?e+n.colors.dim(n.glyph.caret):t===void 0?n.colors.dim(n.glyph.caret):n.colors.dim(`> ${t}`)}function selectViewSize(e){return e.search?e.filter===``&&e.featuredLead>0?Math.min(e.featuredLead,8):8:e.optionCount}function noticeBody(e,t,n){return e.tone===`info`?n.colors.dim(e.text):e.tone===`success`&&t===`task-list`?n.colors.bold(e.text):e.text}function editableOption(e,t,n,r){if(!t||n?.optionValue!==e.value)return e;let i=n.editor.text||n.defaultValue,a=n.editor.text.length===0?i.length:n.editor.cursor,o=n.caretVisible?r.colors.cyan(r.glyph.caret):``,s=`${i.slice(0,a)}${o}${i.slice(a)}`;return{...e,hint:n.formatHint(s)}}function optionWithoutStackedHint(e,t){if(t!==`stacked`||e.hint===void 0)return{option:e,stackedHint:void 0};let{hint:n,...r}=e;return{option:r,stackedHint:n}}function optionUsesPlaceholder(e,t,n){let r=e.filter!==void 0,i=e.layout===`task-list`&&t===n-1,a=e.selection===`multiple`,o=e.layout!==`plain`;return!r&&!i&&(a||o)}function appendSelectOptionRows(e){let{rows:t,state:n,presentation:r,visible:i,start:a,end:o,cursor:s,visibleLabelWidth:c,theme:l}=e,u=l.colors;for(let e=a;e<o;e+=1){let d=i[e],f=e===s;r.layout===`task-list`&&e===o-1&&e>a&&t.push(``);let{option:p,stackedHint:m}=optionWithoutStackedHint(editableOption(d,f,r.edit,l),r.layout);t.push(` ${optionRow({option:p,isCursor:f,isChecked:r.selection===`multiple`&&n.select.selected.has(d.value),placeholder:optionUsesPlaceholder(r,e,i.length),hintPadding:c-d.label.length,theme:l})}`),m!==void 0&&t.push(`${` `.repeat(4)}${dimWithEmphasis(m,l)}`),d.description!==void 0&&(d.disabled===!0||f)&&t.push(` ${u.dim(d.description)}`),r.layout===`stacked`&&e<o-1&&t.push(``)}}function appendSubmitRow(e,t,n,r){if(n<0)return;let i=t===n,a=i?r.colors.cyan(r.glyph.pointer):` `,o=i?r.colors.cyan(r.colors.bold(`Submit`)):`Submit`;e.push(``,` ${a} ${o}`)}function appendSelectNotices(e,r,i,a,o){if(!(r===void 0||r.length===0)){e.push(``);for(let s of r){let r=toneGlyph(s.tone,a),c=` `.repeat(visibleLength(r)+1),l=Math.max(1,o-2-visibleLength(r)-1),u=wrapVisibleLine(s.text,l);for(let[t,n]of u.entries()){let o=noticeBody({...s,text:n},i,a);e.push(t===0?` ${r} ${o}`:` ${c}${o}`)}}}}function selectFooterHints(e,t,n){let r=[];return e.edit!==void 0&&t[n]?.value===e.edit.optionValue&&r.push(`type to rename`),e.filter!==void 0&&r.push(`type to filter`),r.push(`↑/↓ move`),r.push(e.selection===`multiple`?`space to toggle`:`enter to select`),e.selection===`multiple`&&r.push(`enter on Submit to confirm`),r.push(`esc to cancel`),r}function renderActionQuestion(e,t,n){let r=[` ${t.colors.dim(`${t.glyph.dot} ${e.context}`)}`,``];for(let[n,i]of e.actions.entries())r.push(` ${optionRow({option:i,isCursor:n===e.cursor,isChecked:!1,placeholder:!0,hintPadding:0,theme:t})}`);return r.push(...questionFooter([`↑/↓ move`,`enter to select`,`esc to cancel`],t)),r.map(e=>clip(e,n))}function renderSelectQuestion(e,t,n){if(e.kind===`actions`)return renderActionQuestion(e,t,n);let r=t.colors,i=selectPresentation(e),a=i.filter?filterOptions(e.options,e.select.filter):e.options,c=i.selection===`multiple`?submitRowIndex(a):-1,l=e.select.cursor,u=selectMessageRows(e.message,i.layout,t);i.filter!==void 0&&u.push(` ${searchFilter(e.select.filter,i.filter.placeholder,t)}`);let d=0;for(;a[d]?.featured;)d+=1;let f=selectViewSize({search:i.filter!==void 0,filter:e.select.filter,featuredLead:d,optionCount:a.length}),p=Math.max(0,Math.min(l-Math.floor(f/2),Math.max(0,a.length-f))),m=Math.min(p+f,a.length),h=a.slice(p,m).filter(e=>e.hint!==void 0||e.focusHint!==void 0).reduce((e,t)=>Math.max(e,t.label.length),0);return a.length===0&&u.push(` ${r.dim(`(no matches)`)}`),appendSelectOptionRows({rows:u,state:e,presentation:i,visible:a,start:p,end:m,cursor:l,visibleLabelWidth:h,theme:t}),appendSubmitRow(u,l,c,t),a.length>m-p&&u.push(` ${r.dim(`↑↓ ${a.length} options, showing ${p+1}–${m}`)}`),appendSelectNotices(u,e.notices,i.layout,t,n),e.error!==void 0&&u.push(``,` ${r.red(e.error)}`),u.push(...questionFooter(selectFooterHints(i,a,l),t)),u.map(e=>clip(e,n))}function renderTextQuestion(e,t,n,i){let a=t.colors,o=[];for(let n of e.notices??[]){let e=n.tone===`info`?a.dim(n.text):n.text;o.push(`${toneGlyph(n.tone,t)} ${e}`)}o.push(...e.message.split(`
3
+ `).map(e=>` ${a.bold(e)}`));let s=Math.max(4,n-4),{before:c,after:l}=visibleLine(e.mask?{text:`•`.repeat(e.editor.text.length),cursor:e.editor.cursor}:{text:e.editor.text,cursor:e.editor.cursor},s,t.glyph.ellipsis),u=i?a.cyan(t.glyph.caret):` `,d=e.editor.text.length===0&&e.placeholder!==void 0?`${u}${a.dim(e.placeholder)}`:`${c}${u}${l}`;return o.push(` ${d}`),e.error!==void 0&&o.push(``,` ${a.red(e.error)}`),o.push(...questionFooter([`enter to submit`,`esc to cancel`],t)),o.map(e=>clip(e,n))}function renderAcknowledgeQuestion(e,t,n){let r=t.colors,i=[` ${r.bold(e.message)}`];if(e.lines.length>0){i.push(``);for(let t of e.lines)i.push(` ${r.dim(t)}`)}return i.push(...questionFooter([`enter to continue`],t)),i.map(e=>clip(e,n))}export{renderAcknowledgeQuestion,renderFlowPanel,renderSelectQuestion,renderTextQuestion};
@@ -0,0 +1,48 @@
1
+ import type { PromptOption } from "#setup/cli/index.js";
2
+ import { type SelectState } from "#setup/cli/select-state.js";
3
+ import type { TerminalKey } from "./stream-format.js";
4
+ /** Shared navigation grammar for setup selects, actions, and editable selects. */
5
+ export type SetupSelectionIntent = {
6
+ kind: "cancel";
7
+ } | {
8
+ kind: "move";
9
+ direction: "up" | "down";
10
+ } | {
11
+ kind: "repaint";
12
+ } | {
13
+ kind: "submit";
14
+ };
15
+ /** Maps terminal keys to the intents every setup selection surface shares. */
16
+ export declare function setupSelectionIntent(key: TerminalKey): SetupSelectionIntent | undefined;
17
+ export type SetupSelectInputResult = {
18
+ kind: "cancel";
19
+ } | {
20
+ kind: "repaint";
21
+ } | {
22
+ kind: "update";
23
+ select: SelectState;
24
+ } | {
25
+ kind: "submit";
26
+ values: readonly string[];
27
+ } | {
28
+ kind: "error";
29
+ message: string;
30
+ } | {
31
+ kind: "ignore";
32
+ };
33
+ interface SetupSelectInput {
34
+ key: TerminalKey;
35
+ options: readonly PromptOption<string>[];
36
+ select: SelectState;
37
+ }
38
+ type SetupSingleSelectInput = SetupSelectInput & {
39
+ kind: "single" | "stacked" | "task-list" | "search";
40
+ };
41
+ type SetupMultiSelectInput = SetupSelectInput & {
42
+ kind: "multi" | "searchable-multi";
43
+ required: boolean;
44
+ };
45
+ type SetupSelectInputState = SetupSingleSelectInput | SetupMultiSelectInput;
46
+ /** Pure key transition for a setup select; rendering and lifecycle stay outside. */
47
+ export declare function reduceSetupSelectInput(input: SetupSelectInputState): SetupSelectInputResult;
48
+ export {};
@@ -0,0 +1 @@
1
+ import{filterOptions,orderedSelection,reduceSelect,selectValueAtCursor,submitRowIndex}from"#setup/cli/select-state.js";function setupSelectionIntent(e){switch(e.type){case`ctrl-c`:case`escape`:return{kind:`cancel`};case`up`:return{kind:`move`,direction:`up`};case`down`:return{kind:`move`,direction:`down`};case`ctrl-r`:return{kind:`repaint`};case`enter`:return{kind:`submit`};default:return}}function isMultiSelect(e){return e.kind===`multi`||e.kind===`searchable-multi`}function isSearchableSelect(e){return e.kind===`search`||e.kind===`searchable-multi`}function updatedSelect(e,t){return{kind:`update`,select:reduceSelect(e.select,t,{options:e.options,submitRow:isMultiSelect(e)})}}function submitSetupSelect(n){let a=isSearchableSelect(n)?filterOptions(n.options,n.select.filter):[...n.options];if(isMultiSelect(n))return n.select.cursor===submitRowIndex(a)?n.required&&n.select.selected.size===0?{kind:`error`,message:`Select at least one option, then submit.`}:{kind:`submit`,values:orderedSelection(n.options,n.select.selected)}:updatedSelect(n,{type:`toggle`});let o=selectValueAtCursor(a,n.select.cursor);return o===void 0?a[n.select.cursor]?.completed?{kind:`ignore`}:{kind:`error`,message:`Type to match an option, then press enter.`}:{kind:`submit`,values:[o]}}function editSetupSelect(e){switch(e.key.type){case`backspace`:return isSearchableSelect(e)?updatedSelect(e,{type:`backspace`}):{kind:`ignore`};case`character`:{if(isMultiSelect(e)&&e.key.value===` `)return updatedSelect(e,{type:`toggle`});if(!isSearchableSelect(e))return{kind:`ignore`};let t=e.select,r={options:e.options,submitRow:isMultiSelect(e)};for(let i of e.key.value)i>=` `&&i!==``&&(t=reduceSelect(t,{type:`char`,char:i},r));return{kind:`update`,select:t}}default:return{kind:`ignore`}}}function reduceSetupSelectInput(e){let t=setupSelectionIntent(e.key);switch(t?.kind){case`cancel`:return{kind:`cancel`};case`repaint`:return{kind:`repaint`};case`move`:return updatedSelect(e,{type:t.direction});case`submit`:return submitSetupSelect(e);case void 0:return editSetupSelect(e)}}export{reduceSetupSelectInput,setupSelectionIntent};
@@ -1,10 +1,13 @@
1
1
  import type { Theme } from "./theme.js";
2
2
  import type { VercelStatusSnapshot } from "./vercel-status.js";
3
+ import type { ModelEndpointStatus } from "#shared/model-endpoint-status.js";
3
4
  export interface StatusLineInput {
4
5
  /** Resolved model slug, e.g. "anthropic/claude-sonnet-4-6"; absent when `/eve/v1/info` failed. */
5
6
  model?: string;
6
7
  /** Preformatted token-flow segment (formatTokenFlow output), e.g. `⁕ ↑ 394.4K ↓ 4.3K`. */
7
8
  tokens?: string;
9
+ /** Model endpoint readiness: external, or AI Gateway connected/not-connected. */
10
+ endpoint?: ModelEndpointStatus;
8
11
  /** Workspace-scoped Vercel state; identity absent while unlinked or still resolving. */
9
12
  vercel?: VercelStatusSnapshot;
10
13
  theme: Theme;
@@ -13,13 +16,16 @@ export interface StatusLineInput {
13
16
  /**
14
17
  * Builds the dev TUI's persistent one-row status line:
15
18
  *
16
- * `model · tokens · project (team) · deploy pending`
19
+ * `model · tokens · AI Gateway (project) · /deploy pending`
17
20
  *
18
- * Everything renders dim except the yellow pending-deploy marker the one
19
- * segment that asks for action. On narrow widths segments degrade in a fixed
20
- * order team suffix, then the project segment, then the model keeping the
21
- * live, actionable signals (tokens, pending deploy) longest; the model and
22
- * project identity remain recoverable from the agent header in scrollback.
23
- * Returns undefined when no segment has content so callers skip the row.
21
+ * The model-endpoint segment folds in the linked project name when connected
22
+ * (`AI Gateway (project)`), drops to a bare `AI Gateway` when connected without
23
+ * a linked project, and goes yellow with a `⚠` when the gateway has no usable
24
+ * credential. Everything else renders dim except the yellow action signals (a
25
+ * pending deploy, the not-connected gateway). On narrow widths segments degrade
26
+ * in order, the endpoint first and then the model, keeping tokens and the
27
+ * pending-deploy marker longest. Both stay recoverable from the agent header in
28
+ * scrollback. Returns undefined when no segment has content so callers skip the
29
+ * row.
24
30
  */
25
31
  export declare function buildStatusLine(input: StatusLineInput): string | undefined;
@@ -1 +1 @@
1
- import{sliceVisible,visibleLength}from"./terminal-text.js";function buildStatusLine(t){let{theme:n,width:r}=t,i=n.colors,a=t.model===void 0?void 0:i.dim(t.model),o=t.tokens===void 0?void 0:i.dim(t.tokens),s=t.vercel?.pendingDeploy?i.yellow(`deploy pending`):void 0,c=t.vercel?.identity,l=c===void 0?void 0:i.dim(`${n.glyph.brand} ${c.projectName}`),u=c?.teamName===void 0?l:i.dim(`${n.glyph.brand} ${c.projectName} (${c.teamName})`),d=` ${i.dim(n.glyph.dot)} `,compose=e=>e.filter(e=>e!==void 0).join(d),f=[compose([a,o,u,s]),compose([a,o,l,s]),compose([a,o,s]),compose([o,s])];if(f[0].length!==0){for(let e of f)if(e.length>0&&visibleLength(e)<=r)return e;return sliceVisible(f.findLast(e=>e.length>0),r)}}export{buildStatusLine};
1
+ import{sliceVisible,visibleLength}from"./terminal-text.js";function buildStatusLine(t){let{theme:n,width:r}=t,i=n.colors,a=t.model===void 0?void 0:i.dim(t.model),o=t.tokens===void 0?void 0:i.dim(t.tokens),s=t.vercel?.pendingDeploy?i.yellow(`/deploy pending`):void 0,c=t.vercel?.identity?.projectName,l=t.endpoint===void 0?void 0:t.endpoint.kind===`external`?i.dim(`External endpoint`):t.endpoint.connected?i.dim(c===void 0?`AI Gateway`:`AI Gateway (${c})`):i.yellow(`${n.glyph.warning} AI Gateway`),u=` ${i.dim(n.glyph.dot)} `,compose=e=>e.filter(e=>e!==void 0).join(u),d=[compose([a,o,l,s]),compose([a,o,s]),compose([o,s])];if(d[0].length!==0){for(let e of d)if(e.length>0&&visibleLength(e)<=r)return e;return sliceVisible(d.findLast(e=>e.length>0),r)}}export{buildStatusLine};
@@ -57,6 +57,8 @@ export interface KeyToken {
57
57
  /** The buffer ends mid-sequence; wait for more bytes before decoding. */
58
58
  incomplete?: boolean;
59
59
  }
60
+ /** Removes C0 control characters and DEL from text intended for the prompt. */
61
+ export declare function stripPromptControlCharacters(text: string): string;
60
62
  /**
61
63
  * Decodes the next key from a raw input buffer, returning how many characters
62
64
  * it consumed so a caller can reassemble escape sequences that arrive split
@@ -1,2 +1,2 @@
1
- const CSI_FINAL=/[\u0040-\u007e]/u;function nextKey(t){let n=t[0];if(n===void 0)return{consumed:0,incomplete:!0};if(n===`\x1B`){if(t.length===1)return{consumed:0,incomplete:!0};let n=t[1];if(n===`O`)return t.length<3?{consumed:0,incomplete:!0}:{key:parseKey(Buffer.from(t.slice(0,3))),consumed:3};if(n===`[`){for(let n=2;n<t.length;n+=1)if(CSI_FINAL.test(t[n]))return{key:parseKey(Buffer.from(t.slice(0,n+1))),consumed:n+1};return{consumed:0,incomplete:!0}}return{key:{type:`escape`},consumed:1}}if(n<` `||n===``)return{key:parseKey(Buffer.from(n)),consumed:1};let r=1;for(;r<t.length;){let e=t[r];if(e===`\x1B`||e<` `||e===``)break;r+=1}return{key:parseKey(Buffer.from(t.slice(0,r))),consumed:r}}function parseKey(e){let t=e.toString(`utf8`);switch(t){case``:return{type:`ctrl-a`};case``:return{type:`ctrl-e`};case``:return{type:`ctrl-d`};case`\v`:return{type:`ctrl-k`};case`\f`:return{type:`ctrl-l`};case``:return{type:`ctrl-r`};case``:return{type:`ctrl-u`};case``:return{type:`ctrl-w`};case``:return{type:`ctrl-c`};case`\r`:case`
2
- `:return{type:`enter`};case``:case`\b`:return{type:`backspace`};case`\x1B[A`:case`\x1BOA`:return{type:`up`};case`\x1B[B`:case`\x1BOB`:return{type:`down`};case`\x1B[C`:case`\x1BOC`:return{type:`right`};case`\x1B[D`:case`\x1BOD`:return{type:`left`};case`\x1B[H`:case`\x1BOH`:case`\x1B[1~`:return{type:`home`};case`\x1B[F`:case`\x1BOF`:case`\x1B[4~`:return{type:`end`};case`\x1B[3~`:return{type:`delete`};case` `:return{type:`tab`};case`\x1B`:return{type:`escape`};default:{let e=``;for(let n of t)n>=` `&&n!==``&&(e+=n);return e.length>0?{type:`character`,value:e}:{type:`ignore`}}}}async function*takeUntil(e,t){let n=e[Symbol.asyncIterator](),r=t.then(()=>({done:!0,value:void 0}));try{for(;;){let e=n.next();e.catch(()=>{});let t=await Promise.race([e,r]);if(t.done)break;yield t.value}}finally{n.return?.()?.catch(()=>{})}}function formatCompactTokenCount(e){if(e<1e3)return`${e}`;let t=e<1e6?e/1e3:e/1e6,n=e<1e6?`K`:`M`;return`${t.toFixed(1).replace(/\.0$/,``)}${n}`}function formatTokenFlow(e,t){let n=formatCompactTokenCount(e.inputTokens),r=formatCompactTokenCount(e.outputTokens),i=`${t.tokens} ${t.arrowUp} ${n} ${t.arrowDown} ${r}`,a=formatContextPercentage(e.inputTokens,e.contextSize);return a==null?i:`${i} ${a}`}function formatContextPercentage(e,t){if(!(t==null||t<=0||!Number.isFinite(t)))return`${Math.round(e/t*100).toLocaleString()}%`}function formatAssistantResponseStats(e,t){if(t===`tokensPerSecond`)return formatTokensPerSecond(e.tokensPerSecond);if(e.outputTokens!=null)return`${e.outputTokens.toLocaleString()} output tokens`}function formatTokensPerSecond(e){if(e!=null)return`${formatNumber(e)} tok/s`}function formatNumber(e){return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:1})}export{formatAssistantResponseStats,formatCompactTokenCount,formatTokenFlow,nextKey,parseKey,takeUntil};
1
+ const CSI_FINAL=/[\u0040-\u007e]/u;function stripPromptControlCharacters(e){let t=``;for(let n of e)n>=` `&&n!==``&&(t+=n);return t}function nextKey(t){let n=t[0];if(n===void 0)return{consumed:0,incomplete:!0};if(n===`\x1B`){if(t.length===1)return{consumed:0,incomplete:!0};let n=t[1];if(n===`O`)return t.length<3?{consumed:0,incomplete:!0}:{key:parseKey(Buffer.from(t.slice(0,3))),consumed:3};if(n===`[`){for(let n=2;n<t.length;n+=1)if(CSI_FINAL.test(t[n]))return{key:parseKey(Buffer.from(t.slice(0,n+1))),consumed:n+1};return{consumed:0,incomplete:!0}}return{key:{type:`escape`},consumed:1}}if(n<` `||n===``)return{key:parseKey(Buffer.from(n)),consumed:1};let r=1;for(;r<t.length;){let e=t[r];if(e===`\x1B`||e<` `||e===``)break;r+=1}return{key:parseKey(Buffer.from(t.slice(0,r))),consumed:r}}function parseKey(e){let t=e.toString(`utf8`);switch(t){case``:return{type:`ctrl-a`};case``:return{type:`ctrl-e`};case``:return{type:`ctrl-d`};case`\v`:return{type:`ctrl-k`};case`\f`:return{type:`ctrl-l`};case``:return{type:`ctrl-r`};case``:return{type:`ctrl-u`};case``:return{type:`ctrl-w`};case``:return{type:`ctrl-c`};case`\r`:case`
2
+ `:return{type:`enter`};case``:case`\b`:return{type:`backspace`};case`\x1B[A`:case`\x1BOA`:return{type:`up`};case`\x1B[B`:case`\x1BOB`:return{type:`down`};case`\x1B[C`:case`\x1BOC`:return{type:`right`};case`\x1B[D`:case`\x1BOD`:return{type:`left`};case`\x1B[H`:case`\x1BOH`:case`\x1B[1~`:return{type:`home`};case`\x1B[F`:case`\x1BOF`:case`\x1B[4~`:return{type:`end`};case`\x1B[3~`:return{type:`delete`};case` `:return{type:`tab`};case`\x1B`:return{type:`escape`};default:{let e=stripPromptControlCharacters(t);return e.length>0?{type:`character`,value:e}:{type:`ignore`}}}}async function*takeUntil(e,t){let n=e[Symbol.asyncIterator](),r=t.then(()=>({done:!0,value:void 0}));try{for(;;){let e=n.next();e.catch(()=>{});let t=await Promise.race([e,r]);if(t.done)break;yield t.value}}finally{n.return?.()?.catch(()=>{})}}function formatCompactTokenCount(e){if(e<1e3)return`${e}`;let t=e<1e6?e/1e3:e/1e6,n=e<1e6?`K`:`M`;return`${t.toFixed(1).replace(/\.0$/,``)}${n}`}function formatTokenFlow(e,t){let n=formatCompactTokenCount(e.inputTokens),r=formatCompactTokenCount(e.outputTokens),i=`${t.tokens} ${t.arrowUp} ${n} ${t.arrowDown} ${r}`,a=formatContextPercentage(e.inputTokens,e.contextSize);return a==null?i:`${i} ${a}`}function formatContextPercentage(e,t){if(!(t==null||t<=0||!Number.isFinite(t)))return`${Math.round(e/t*100).toLocaleString()}%`}function formatAssistantResponseStats(e,t){if(t===`tokensPerSecond`)return formatTokensPerSecond(e.tokensPerSecond);if(e.outputTokens!=null)return`${e.outputTokens.toLocaleString()} output tokens`}function formatTokensPerSecond(e){if(e!=null)return`${formatNumber(e)} tok/s`}function formatNumber(e){return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:1})}export{formatAssistantResponseStats,formatCompactTokenCount,formatTokenFlow,nextKey,parseKey,stripPromptControlCharacters,takeUntil};
@@ -47,8 +47,10 @@ export declare class TerminalRenderer implements AgentTUIRenderer {
47
47
  /**
48
48
  * Commits the startup agent header (brand mark + resolved configuration) to
49
49
  * scrollback before the first prompt. Later calls (dev HMR refreshing fields
50
- * such as the resolved model) commit a fresh header beneath the existing
51
- * transcript; committed scrollback is never cleared or replayed.
50
+ * such as the agent name) commit a fresh header beneath the existing
51
+ * transcript only when the rendered header actually changed — every source
52
+ * reload re-sends it, and an identical banner repeated per reload is noise.
53
+ * Committed scrollback is never cleared or replayed.
52
54
  */
53
55
  renderAgentHeader(options: AgentHeaderOptions): void;
54
56
  readPrompt(options?: AgentTUISessionOptions): Promise<string>;