@andorra-labs/code 0.1.12 → 0.1.14

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 (617) hide show
  1. package/dist/src/account-presentation.d.ts +1 -37
  2. package/dist/src/account-presentation.js +6 -43
  3. package/dist/src/activity.d.ts +0 -25
  4. package/dist/src/activity.js +1 -23
  5. package/dist/src/agent-definitions.d.ts +0 -26
  6. package/dist/src/agent-definitions.js +0 -43
  7. package/dist/src/agent-execution.d.ts +0 -2
  8. package/dist/src/agent-execution.js +347 -554
  9. package/dist/src/agent-mcp-catalog.d.ts +0 -8
  10. package/dist/src/agent-mcp-catalog.js +0 -2
  11. package/dist/src/agent-mcp.d.ts +0 -56
  12. package/dist/src/agent-mcp.js +11 -155
  13. package/dist/src/agent-modifiers.d.ts +0 -1
  14. package/dist/src/agent-modifiers.js +25 -68
  15. package/dist/src/analytics.d.ts +0 -66
  16. package/dist/src/analytics.js +0 -45
  17. package/dist/src/andorra/endpoint.d.ts +7 -0
  18. package/dist/src/andorra/endpoint.js +46 -0
  19. package/dist/src/andorra/entry.d.ts +21 -0
  20. package/dist/src/andorra/entry.js +100 -0
  21. package/dist/src/andorra/errors.d.ts +2 -0
  22. package/dist/src/andorra/errors.js +39 -0
  23. package/dist/src/andorra/hosted.d.ts +52 -0
  24. package/dist/src/andorra/hosted.js +126 -0
  25. package/dist/src/andorra/monitor.d.ts +151 -0
  26. package/dist/src/andorra/monitor.js +393 -0
  27. package/dist/src/andorra/notices.d.ts +7 -0
  28. package/dist/src/andorra/notices.js +15 -0
  29. package/dist/src/andorra/opt-in.d.ts +58 -0
  30. package/dist/src/andorra/opt-in.js +112 -0
  31. package/dist/src/andorra/request-watch.d.ts +6 -0
  32. package/dist/src/andorra/request-watch.js +10 -0
  33. package/dist/src/andorra/state.d.ts +86 -0
  34. package/dist/src/andorra/state.js +238 -0
  35. package/dist/src/andorra/terminal.d.ts +68 -0
  36. package/dist/src/andorra/terminal.js +125 -0
  37. package/dist/src/andorra/usage-format.d.ts +9 -0
  38. package/dist/src/andorra/usage-format.js +19 -0
  39. package/dist/src/anthropic-console-auth.d.ts +0 -24
  40. package/dist/src/anthropic-console-auth.js +0 -37
  41. package/dist/src/anthropic-credentials.d.ts +0 -25
  42. package/dist/src/anthropic-credentials.js +9 -29
  43. package/dist/src/app-server/protocol.d.ts +18 -246
  44. package/dist/src/app-server/protocol.js +1 -132
  45. package/dist/src/app-server/reasoning.d.ts +0 -31
  46. package/dist/src/app-server/reasoning.js +0 -54
  47. package/dist/src/app-server/terminal.d.ts +0 -36
  48. package/dist/src/app-server/terminal.js +3 -39
  49. package/dist/src/app-server/workspace.d.ts +0 -167
  50. package/dist/src/app-server/workspace.js +4 -406
  51. package/dist/src/app-server.d.ts +52 -925
  52. package/dist/src/app-server.js +828 -3076
  53. package/dist/src/artifacts.d.ts +0 -10
  54. package/dist/src/artifacts.js +1 -11
  55. package/dist/src/attachments.d.ts +4 -98
  56. package/dist/src/attachments.js +10 -130
  57. package/dist/src/auth/AuthManager.d.ts +9 -93
  58. package/dist/src/auth/AuthManager.js +164 -186
  59. package/dist/src/auth/callback-page.d.ts +0 -1
  60. package/dist/src/auth/callback-page.js +0 -4
  61. package/dist/src/auth/callback.d.ts +0 -25
  62. package/dist/src/auth/callback.js +1 -29
  63. package/dist/src/auth/deployment.d.ts +1 -16
  64. package/dist/src/auth/deployment.js +1 -16
  65. package/dist/src/auth/index.d.ts +1 -12
  66. package/dist/src/auth/index.js +1 -12
  67. package/dist/src/auth/lock.d.ts +0 -1
  68. package/dist/src/auth/lock.js +0 -1
  69. package/dist/src/auth/store.d.ts +33 -108
  70. package/dist/src/auth/store.js +55 -130
  71. package/dist/src/auth/types.d.ts +0 -8
  72. package/dist/src/auth-commands.d.ts +0 -5
  73. package/dist/src/auth-commands.js +0 -1
  74. package/dist/src/automation-runner.d.ts +0 -9
  75. package/dist/src/automation-runner.js +0 -11
  76. package/dist/src/automation-service.d.ts +0 -10
  77. package/dist/src/automation-service.js +3 -17
  78. package/dist/src/automation-tool.js +0 -5
  79. package/dist/src/automation-worker-shutdown.d.ts +0 -1
  80. package/dist/src/automation-worker-shutdown.js +0 -3
  81. package/dist/src/automations.d.ts +23 -2
  82. package/dist/src/automations.js +91 -12
  83. package/dist/src/background-tasks.d.ts +0 -23
  84. package/dist/src/background-tasks.js +0 -11
  85. package/dist/src/boot-trace.d.ts +0 -13
  86. package/dist/src/boot-trace.js +1 -14
  87. package/dist/src/browser-activity.js +0 -2
  88. package/dist/src/browser-bridge.d.ts +0 -2
  89. package/dist/src/browser-bridge.js +0 -27
  90. package/dist/src/browser-captcha-tool.d.ts +0 -13
  91. package/dist/src/browser-captcha-tool.js +3 -35
  92. package/dist/src/browser-extensions-tool.d.ts +24 -0
  93. package/dist/src/browser-extensions-tool.js +137 -0
  94. package/dist/src/browser-extensions.d.ts +127 -0
  95. package/dist/src/browser-extensions.js +729 -0
  96. package/dist/src/browser-observation.d.ts +0 -15
  97. package/dist/src/browser-observation.js +1 -22
  98. package/dist/src/browser-panel-tool.d.ts +1 -37
  99. package/dist/src/browser-panel-tool.js +3 -73
  100. package/dist/src/browser-runner.d.ts +0 -1
  101. package/dist/src/browser-runner.js +5 -46
  102. package/dist/src/browser-server.d.ts +0 -6
  103. package/dist/src/browser-server.js +6 -229
  104. package/dist/src/browser-session.d.ts +0 -25
  105. package/dist/src/browser-session.js +1 -71
  106. package/dist/src/browser-stealth.d.ts +19 -13
  107. package/dist/src/browser-stealth.js +22 -38
  108. package/dist/src/browser-ui/app.js +7 -174
  109. package/dist/src/browser-ui/style.css +0 -68
  110. package/dist/src/browser-ui/tokens.css +15 -97
  111. package/dist/src/browser-view.d.ts +106 -295
  112. package/dist/src/browser-view.js +551 -587
  113. package/dist/src/capabilities.d.ts +0 -8
  114. package/dist/src/capabilities.js +0 -29
  115. package/dist/src/capsolver.d.ts +0 -13
  116. package/dist/src/capsolver.js +0 -15
  117. package/dist/src/clarification-ui.d.ts +0 -7
  118. package/dist/src/clarification-ui.js +0 -8
  119. package/dist/src/claude-executable.d.ts +0 -1
  120. package/dist/src/claude-executable.js +1 -2
  121. package/dist/src/claude-provider.d.ts +6 -19
  122. package/dist/src/claude-provider.js +155 -63
  123. package/dist/src/cli-executable.d.ts +0 -16
  124. package/dist/src/cli-executable.js +0 -7
  125. package/dist/src/cli-process.d.ts +0 -26
  126. package/dist/src/cli-process.js +0 -18
  127. package/dist/src/cli-sign-in.d.ts +0 -20
  128. package/dist/src/cli-sign-in.js +1 -17
  129. package/dist/src/cli.d.ts +1 -55
  130. package/dist/src/cli.js +118 -742
  131. package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +4 -59
  132. package/dist/src/code-intelligence/CodeIntelligenceManager.js +26 -99
  133. package/dist/src/code-intelligence/ContextLedger.d.ts +0 -4
  134. package/dist/src/code-intelligence/ContextLedger.js +0 -10
  135. package/dist/src/code-intelligence/ContextRouter.d.ts +0 -6
  136. package/dist/src/code-intelligence/ContextRouter.js +0 -8
  137. package/dist/src/code-intelligence/codegraph/CodeGraphProjectSession.d.ts +0 -2
  138. package/dist/src/code-intelligence/codegraph/CodeGraphProjectSession.js +5 -12
  139. package/dist/src/code-intelligence/codegraph/CodeGraphProvider.d.ts +0 -6
  140. package/dist/src/code-intelligence/codegraph/CodeGraphProvider.js +0 -6
  141. package/dist/src/code-intelligence/codegraph/CodeGraphSyncBarrier.d.ts +0 -5
  142. package/dist/src/code-intelligence/codegraph/CodeGraphSyncBarrier.js +1 -17
  143. package/dist/src/code-intelligence/codegraph/repoExploreTool.d.ts +0 -5
  144. package/dist/src/code-intelligence/codegraph/repoExploreTool.js +0 -5
  145. package/dist/src/code-intelligence/repository.d.ts +0 -9
  146. package/dist/src/code-intelligence/repository.js +1 -11
  147. package/dist/src/code-intelligence/types.d.ts +0 -8
  148. package/dist/src/codex-auth.d.ts +0 -44
  149. package/dist/src/codex-auth.js +0 -45
  150. package/dist/src/codex-browser-auth.d.ts +0 -13
  151. package/dist/src/codex-browser-auth.js +3 -20
  152. package/dist/src/codex-errors.js +0 -2
  153. package/dist/src/codex-executable.d.ts +0 -2
  154. package/dist/src/codex-executable.js +1 -7
  155. package/dist/src/codex-provider.d.ts +0 -13
  156. package/dist/src/codex-provider.js +0 -28
  157. package/dist/src/codex-rpc.d.ts +0 -10
  158. package/dist/src/codex-rpc.js +0 -12
  159. package/dist/src/coding-tools.d.ts +4 -26
  160. package/dist/src/coding-tools.js +161 -181
  161. package/dist/src/command-metrics.d.ts +0 -4
  162. package/dist/src/command-output-tap.d.ts +0 -11
  163. package/dist/src/command-output-tap.js +0 -3
  164. package/dist/src/command-screens.d.ts +41 -1
  165. package/dist/src/command-screens.js +316 -113
  166. package/dist/src/commands.d.ts +12 -63
  167. package/dist/src/commands.js +98 -127
  168. package/dist/src/completion-gates.d.ts +0 -47
  169. package/dist/src/completion-gates.js +0 -14
  170. package/dist/src/completion.d.ts +0 -98
  171. package/dist/src/completion.js +2 -239
  172. package/dist/src/config.d.ts +15 -115
  173. package/dist/src/config.js +123 -172
  174. package/dist/src/context-budget.d.ts +0 -22
  175. package/dist/src/context-budget.js +0 -44
  176. package/dist/src/context-compaction.d.ts +29 -6
  177. package/dist/src/context-compaction.js +94 -25
  178. package/dist/src/context-selection.d.ts +0 -24
  179. package/dist/src/context-selection.js +0 -34
  180. package/dist/src/dashboard-view.d.ts +2 -2
  181. package/dist/src/dashboard-view.js +11 -37
  182. package/dist/src/dashboard.d.ts +0 -2
  183. package/dist/src/dashboard.js +0 -9
  184. package/dist/src/deadline.d.ts +0 -45
  185. package/dist/src/deadline.js +0 -54
  186. package/dist/src/decision/ContinuationAdapter.d.ts +0 -5
  187. package/dist/src/decision/ContinuationAdapter.js +0 -5
  188. package/dist/src/decision/DecisionEngine.d.ts +0 -4
  189. package/dist/src/decision/DecisionManager.d.ts +0 -1
  190. package/dist/src/decision/DecisionManager.js +2 -7
  191. package/dist/src/decision/DecisionPolicy.d.ts +0 -1
  192. package/dist/src/decision/DecisionPolicy.js +0 -1
  193. package/dist/src/decision/FactContinuations.d.ts +11 -43
  194. package/dist/src/decision/FactContinuations.js +126 -95
  195. package/dist/src/decision/FactServiceGate.d.ts +0 -1
  196. package/dist/src/decision/FactServiceGate.js +0 -4
  197. package/dist/src/decision/PreparedSteps.d.ts +0 -15
  198. package/dist/src/decision/PreparedSteps.js +1 -11
  199. package/dist/src/decision/applyToolMenu.d.ts +0 -1
  200. package/dist/src/decision/applyToolMenu.js +2 -6
  201. package/dist/src/decision/checks.d.ts +15 -28
  202. package/dist/src/decision/checks.js +118 -49
  203. package/dist/src/decision/facts.d.ts +0 -16
  204. package/dist/src/decision/facts.js +0 -30
  205. package/dist/src/decision/guidancePolicy.js +0 -1
  206. package/dist/src/decision/hostedPolicy.d.ts +0 -6
  207. package/dist/src/decision/hostedPolicy.js +0 -7
  208. package/dist/src/decision/hostedSkills.d.ts +0 -19
  209. package/dist/src/decision/hostedSkills.js +0 -19
  210. package/dist/src/decision/optimizationPolicy.d.ts +0 -3
  211. package/dist/src/decision/optimizationPolicy.js +1 -4
  212. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +0 -7
  213. package/dist/src/decision/providers/AndorraDecisionProvider.js +4 -27
  214. package/dist/src/decision/providers/HttpDecisionProvider.d.ts +0 -2
  215. package/dist/src/decision/providers/HttpDecisionProvider.js +0 -6
  216. package/dist/src/decision/routeTools.d.ts +0 -8
  217. package/dist/src/decision/routeTools.js +1 -8
  218. package/dist/src/decision/toolFamilies.d.ts +0 -1
  219. package/dist/src/decision/toolFamilies.js +1 -2
  220. package/dist/src/decision/toolMenu.d.ts +0 -3
  221. package/dist/src/decision/toolMenu.js +0 -4
  222. package/dist/src/decision/types.d.ts +1 -6
  223. package/dist/src/default-graph.d.ts +0 -9
  224. package/dist/src/default-graph.js +0 -9
  225. package/dist/src/delegation-changes.d.ts +0 -56
  226. package/dist/src/delegation-changes.js +4 -130
  227. package/dist/src/diff-preview.d.ts +0 -1
  228. package/dist/src/diff-preview.js +0 -17
  229. package/dist/src/duration.d.ts +0 -50
  230. package/dist/src/duration.js +0 -50
  231. package/dist/src/efficiency.d.ts +0 -39
  232. package/dist/src/efficiency.js +0 -16
  233. package/dist/src/engine/protocol.d.ts +0 -2
  234. package/dist/src/engine/protocol.js +0 -2
  235. package/dist/src/engine-streams.d.ts +0 -9
  236. package/dist/src/extensions.d.ts +3 -2
  237. package/dist/src/extensions.js +63 -35
  238. package/dist/src/favicons.d.ts +0 -26
  239. package/dist/src/favicons.js +0 -34
  240. package/dist/src/file-diff.d.ts +2 -58
  241. package/dist/src/file-diff.js +0 -32
  242. package/dist/src/file-read-key.d.ts +0 -7
  243. package/dist/src/file-read-key.js +0 -7
  244. package/dist/src/file-read-state.d.ts +0 -1
  245. package/dist/src/file-read-state.js +0 -4
  246. package/dist/src/firefox-cookies.d.ts +0 -34
  247. package/dist/src/firefox-cookies.js +1 -55
  248. package/dist/src/git-identity-audit.d.ts +27 -0
  249. package/dist/src/git-identity-audit.js +286 -0
  250. package/dist/src/git-identity-guard.d.ts +4 -0
  251. package/dist/src/git-identity-guard.js +998 -0
  252. package/dist/src/git-identity-hold.d.ts +12 -0
  253. package/dist/src/git-identity-hold.js +81 -0
  254. package/dist/src/git-summary.d.ts +0 -58
  255. package/dist/src/git-summary.js +2 -212
  256. package/dist/src/goal-completion-verification.d.ts +2 -2
  257. package/dist/src/goal-completion-verification.js +3 -6
  258. package/dist/src/graph-account.d.ts +0 -21
  259. package/dist/src/graph-account.js +0 -17
  260. package/dist/src/graph-editor-session.d.ts +0 -1
  261. package/dist/src/graph-editor-session.js +0 -3
  262. package/dist/src/graph-health.d.ts +9 -61
  263. package/dist/src/graph-health.js +34 -59
  264. package/dist/src/graph-manager-chat.d.ts +36 -153
  265. package/dist/src/graph-manager-chat.js +161 -182
  266. package/dist/src/graph-provider-portability.d.ts +1 -21
  267. package/dist/src/graph-provider-portability.js +6 -45
  268. package/dist/src/graph-quota.d.ts +0 -33
  269. package/dist/src/graph-quota.js +1 -44
  270. package/dist/src/graph-runner.d.ts +0 -1
  271. package/dist/src/graph-runner.js +58 -391
  272. package/dist/src/graph-selection.d.ts +0 -14
  273. package/dist/src/graph-selection.js +2 -15
  274. package/dist/src/graph-server.d.ts +2 -10
  275. package/dist/src/graph-server.js +39 -101
  276. package/dist/src/graph-studio-features.d.ts +0 -5
  277. package/dist/src/graph-studio-features.js +2 -42
  278. package/dist/src/graph-sync.d.ts +0 -78
  279. package/dist/src/graph-sync.js +5 -201
  280. package/dist/src/graph-tool.d.ts +0 -18
  281. package/dist/src/graph-tool.js +0 -27
  282. package/dist/src/graph-ui/app.js +176 -492
  283. package/dist/src/graph-ui/compat.js +0 -7
  284. package/dist/src/graph-ui/controls.css +0 -48
  285. package/dist/src/graph-ui/controls.js +0 -88
  286. package/dist/src/graph-ui/drafts.js +0 -12
  287. package/dist/src/graph-ui/edge-router.js +0 -62
  288. package/dist/src/graph-ui/embed.js +0 -59
  289. package/dist/src/graph-ui/icons.js +0 -8
  290. package/dist/src/graph-ui/library.css +0 -5
  291. package/dist/src/graph-ui/manager-markdown.js +0 -11
  292. package/dist/src/graph-ui/manager-state.js +1 -78
  293. package/dist/src/graph-ui/manager.css +0 -18
  294. package/dist/src/graph-ui/manager.js +43 -185
  295. package/dist/src/graph-ui/model-picker.js +0 -29
  296. package/dist/src/graph-ui/sidebar.js +2 -3
  297. package/dist/src/graph-ui/skill-picker.js +373 -39
  298. package/dist/src/graph-ui/studio-canvas.js +3 -38
  299. package/dist/src/graph-ui/studio.css +0 -18
  300. package/dist/src/graph-ui/studio.js +3 -71
  301. package/dist/src/graph-ui/style.css +16 -136
  302. package/dist/src/graph-ui/theme.js +1 -26
  303. package/dist/src/graph-ui/tokens.css +19 -118
  304. package/dist/src/graphs.d.ts +6 -157
  305. package/dist/src/graphs.js +66 -269
  306. package/dist/src/grep-regex-worker.js +0 -2
  307. package/dist/src/grep-regex.d.ts +1 -5
  308. package/dist/src/grep-regex.js +6 -8
  309. package/dist/src/grok-provider.d.ts +0 -17
  310. package/dist/src/grok-provider.js +1 -26
  311. package/dist/src/handoffs.d.ts +0 -11
  312. package/dist/src/handoffs.js +0 -13
  313. package/dist/src/hardened-runtime.d.ts +0 -10
  314. package/dist/src/hardened-runtime.js +9 -47
  315. package/dist/src/harness-home.d.ts +21 -0
  316. package/dist/src/harness-home.js +87 -0
  317. package/dist/src/host-process-guard.d.ts +0 -50
  318. package/dist/src/host-process-guard.js +0 -641
  319. package/dist/src/limits.d.ts +0 -64
  320. package/dist/src/limits.js +0 -62
  321. package/dist/src/managed-sign-in.d.ts +0 -12
  322. package/dist/src/managed-sign-in.js +0 -16
  323. package/dist/src/markdown.d.ts +0 -28
  324. package/dist/src/markdown.js +1 -175
  325. package/dist/src/mcp.d.ts +0 -99
  326. package/dist/src/mcp.js +4 -170
  327. package/dist/src/membership-errors.d.ts +0 -14
  328. package/dist/src/membership-errors.js +1 -14
  329. package/dist/src/membership.d.ts +9 -59
  330. package/dist/src/membership.js +20 -91
  331. package/dist/src/memory/LocalToolMemory.d.ts +0 -1
  332. package/dist/src/memory/LocalToolMemory.js +2 -7
  333. package/dist/src/memory/MemoryDistiller.js +0 -15
  334. package/dist/src/memory/MemoryManager.d.ts +0 -3
  335. package/dist/src/memory/MemoryManager.js +6 -18
  336. package/dist/src/memory/MemoryPolicy.d.ts +0 -2
  337. package/dist/src/memory/MemoryPolicy.js +0 -2
  338. package/dist/src/memory/MemoryProvider.d.ts +0 -6
  339. package/dist/src/memory/MemoryRetriever.js +0 -7
  340. package/dist/src/memory/PermissionMemoryProvider.d.ts +0 -1
  341. package/dist/src/memory/PermissionMemoryProvider.js +0 -1
  342. package/dist/src/memory/ProjectMemory.d.ts +5 -40
  343. package/dist/src/memory/ProjectMemory.js +22 -47
  344. package/dist/src/memory/ToolFailureLessons.d.ts +0 -3
  345. package/dist/src/memory/ToolFailureLessons.js +0 -6
  346. package/dist/src/memory/providers/NoOpMemoryProvider.d.ts +0 -1
  347. package/dist/src/memory/providers/NoOpMemoryProvider.js +0 -1
  348. package/dist/src/memory/redaction.d.ts +0 -5
  349. package/dist/src/memory/redaction.js +0 -11
  350. package/dist/src/memory/repository.d.ts +0 -6
  351. package/dist/src/memory/repository.js +2 -12
  352. package/dist/src/memory/types.d.ts +0 -1
  353. package/dist/src/model-context-windows.d.ts +2 -0
  354. package/dist/src/model-context-windows.js +24 -0
  355. package/dist/src/model-health-cache.d.ts +0 -38
  356. package/dist/src/model-health-cache.js +2 -50
  357. package/dist/src/model-metadata.d.ts +1 -18
  358. package/dist/src/model-metadata.js +42 -45
  359. package/dist/src/model-override.d.ts +0 -36
  360. package/dist/src/model-override.js +0 -43
  361. package/dist/src/model-tiers.d.ts +0 -13
  362. package/dist/src/model-tiers.js +0 -23
  363. package/dist/src/opencode-catalog.d.ts +0 -2
  364. package/dist/src/opencode-catalog.js +0 -11
  365. package/dist/src/opencode-cli-provider.d.ts +0 -35
  366. package/dist/src/opencode-cli-provider.js +1 -44
  367. package/dist/src/opencode-provider.d.ts +0 -2
  368. package/dist/src/opencode-provider.js +1 -16
  369. package/dist/src/package-name.d.ts +0 -2
  370. package/dist/src/package-name.js +0 -2
  371. package/dist/src/paged-transcript.d.ts +0 -11
  372. package/dist/src/paged-transcript.js +2 -20
  373. package/dist/src/palette.d.ts +1 -63
  374. package/dist/src/palette.js +1 -64
  375. package/dist/src/permissions.d.ts +0 -15
  376. package/dist/src/permissions.js +17 -21
  377. package/dist/src/powershell-pool.d.ts +0 -9
  378. package/dist/src/powershell-pool.js +3 -26
  379. package/dist/src/process-warnings.d.ts +4 -0
  380. package/dist/src/process-warnings.js +103 -0
  381. package/dist/src/profile.d.ts +0 -43
  382. package/dist/src/profile.js +0 -43
  383. package/dist/src/project-reservation.d.ts +11 -0
  384. package/dist/src/project-reservation.js +143 -0
  385. package/dist/src/provider-connection.d.ts +0 -18
  386. package/dist/src/provider-connection.js +15 -39
  387. package/dist/src/provider-engine.d.ts +0 -21
  388. package/dist/src/provider-engine.js +1 -96
  389. package/dist/src/provider-import.d.ts +0 -49
  390. package/dist/src/provider-import.js +0 -60
  391. package/dist/src/provider-keys.d.ts +1 -36
  392. package/dist/src/provider-keys.js +5 -48
  393. package/dist/src/provider-settings.d.ts +16 -3
  394. package/dist/src/provider-settings.js +36 -52
  395. package/dist/src/providers.d.ts +14 -219
  396. package/dist/src/providers.js +69 -326
  397. package/dist/src/pull-requests.d.ts +0 -173
  398. package/dist/src/pull-requests.js +5 -195
  399. package/dist/src/qa/browser/PlaywrightRunner.d.ts +0 -7
  400. package/dist/src/qa/browser/PlaywrightRunner.js +2 -16
  401. package/dist/src/qa/command-policy.d.ts +0 -23
  402. package/dist/src/qa/command-policy.js +0 -30
  403. package/dist/src/qa/guidance.d.ts +0 -21
  404. package/dist/src/qa/guidance.js +0 -20
  405. package/dist/src/qa/profile/ProjectInspector.d.ts +0 -4
  406. package/dist/src/qa/profile/ProjectInspector.js +0 -6
  407. package/dist/src/qa/profile/QaConfigLoader.d.ts +0 -7
  408. package/dist/src/qa/profile/QaConfigLoader.js +0 -6
  409. package/dist/src/qa/profile/QaProfile.d.ts +0 -7
  410. package/dist/src/qa/profile/QaProfile.js +0 -7
  411. package/dist/src/qa/profile/yaml.d.ts +0 -9
  412. package/dist/src/qa/profile/yaml.js +0 -13
  413. package/dist/src/qa/qa-authorize.d.ts +0 -19
  414. package/dist/src/qa/qa-authorize.js +4 -11
  415. package/dist/src/qa/runtime/ProcessManager.d.ts +0 -31
  416. package/dist/src/qa/runtime/ProcessManager.js +4 -41
  417. package/dist/src/qa/runtime/PtyManager.d.ts +0 -4
  418. package/dist/src/qa/runtime/PtyManager.js +1 -7
  419. package/dist/src/qa/runtime/changes.d.ts +0 -11
  420. package/dist/src/qa/runtime/changes.js +1 -3
  421. package/dist/src/qa/tools.d.ts +0 -10
  422. package/dist/src/qa/tools.js +0 -12
  423. package/dist/src/qa/types.d.ts +0 -13
  424. package/dist/src/react-runtime.d.ts +2 -21
  425. package/dist/src/react-runtime.js +107 -422
  426. package/dist/src/read-document-doc.d.ts +0 -6
  427. package/dist/src/read-document-doc.js +0 -55
  428. package/dist/src/read-document-docx.d.ts +0 -16
  429. package/dist/src/read-document-docx.js +2 -69
  430. package/dist/src/read-document-text.d.ts +0 -17
  431. package/dist/src/read-document-text.js +0 -22
  432. package/dist/src/read-document-tool.d.ts +0 -31
  433. package/dist/src/read-document-tool.js +0 -30
  434. package/dist/src/read-document.d.ts +0 -49
  435. package/dist/src/read-document.js +1 -67
  436. package/dist/src/read-image.d.ts +0 -32
  437. package/dist/src/read-image.js +0 -33
  438. package/dist/src/remote/cert.d.ts +0 -18
  439. package/dist/src/remote/cert.js +0 -44
  440. package/dist/src/remote/client.d.ts +0 -70
  441. package/dist/src/remote/client.js +1 -116
  442. package/dist/src/remote/command.js +0 -17
  443. package/dist/src/remote/engine-pool.d.ts +0 -152
  444. package/dist/src/remote/engine-pool.js +22 -339
  445. package/dist/src/remote/errors.d.ts +0 -15
  446. package/dist/src/remote/errors.js +0 -7
  447. package/dist/src/remote/network.d.ts +0 -26
  448. package/dist/src/remote/network.js +1 -34
  449. package/dist/src/remote/pairing.d.ts +16 -51
  450. package/dist/src/remote/pairing.js +50 -57
  451. package/dist/src/remote/pem.d.ts +0 -4
  452. package/dist/src/remote/pem.js +0 -4
  453. package/dist/src/remote/roots.d.ts +0 -20
  454. package/dist/src/remote/roots.js +0 -8
  455. package/dist/src/remote/serve.d.ts +0 -47
  456. package/dist/src/remote/serve.js +0 -30
  457. package/dist/src/remote/server.d.ts +0 -14
  458. package/dist/src/remote/server.js +1 -79
  459. package/dist/src/remote/types.d.ts +1 -32
  460. package/dist/src/remote/types.js +0 -10
  461. package/dist/src/run-control.d.ts +2 -9
  462. package/dist/src/run-control.js +9 -13
  463. package/dist/src/run-progress.d.ts +0 -170
  464. package/dist/src/run-progress.js +0 -285
  465. package/dist/src/run-records.d.ts +0 -443
  466. package/dist/src/run-records.js +14 -687
  467. package/dist/src/run-temp.d.ts +12 -0
  468. package/dist/src/run-temp.js +50 -0
  469. package/dist/src/runtime.d.ts +12 -228
  470. package/dist/src/runtime.js +2 -128
  471. package/dist/src/sandbox-child.js +0 -1
  472. package/dist/src/save-lock.d.ts +0 -12
  473. package/dist/src/save-lock.js +0 -28
  474. package/dist/src/screen-selection.d.ts +0 -23
  475. package/dist/src/screen-selection.js +0 -22
  476. package/dist/src/secret-redaction.d.ts +0 -12
  477. package/dist/src/secret-redaction.js +0 -45
  478. package/dist/src/session-changes.d.ts +4 -80
  479. package/dist/src/session-changes.js +25 -130
  480. package/dist/src/session-goal.d.ts +129 -0
  481. package/dist/src/session-goal.js +230 -0
  482. package/dist/src/session-monitor.d.ts +1 -10
  483. package/dist/src/session-monitor.js +2 -39
  484. package/dist/src/session-reaper.d.ts +0 -15
  485. package/dist/src/session-reaper.js +0 -14
  486. package/dist/src/session-skills.d.ts +15 -44
  487. package/dist/src/session-skills.js +75 -60
  488. package/dist/src/session-summary.d.ts +0 -26
  489. package/dist/src/session-summary.js +0 -32
  490. package/dist/src/session-title.d.ts +0 -1
  491. package/dist/src/session-title.js +0 -2
  492. package/dist/src/sessions.d.ts +3 -122
  493. package/dist/src/sessions.js +9 -178
  494. package/dist/src/shell.d.ts +3 -20
  495. package/dist/src/shell.js +8 -72
  496. package/dist/src/side-panel.d.ts +5 -99
  497. package/dist/src/side-panel.js +76 -133
  498. package/dist/src/sign-in-detection.d.ts +0 -39
  499. package/dist/src/sign-in-detection.js +0 -43
  500. package/dist/src/sign-in-offer.d.ts +1 -19
  501. package/dist/src/sign-in-offer.js +0 -13
  502. package/dist/src/skill-commands.d.ts +0 -1
  503. package/dist/src/skill-commands.js +1 -4
  504. package/dist/src/skills/bundled/control-browser/SKILL.md +1 -1
  505. package/dist/src/skills/bundled/graph-manager/errors.md +1 -1
  506. package/dist/src/skills/bundled/provenance.json +738 -738
  507. package/dist/src/skills/invocable-skills.d.ts +0 -18
  508. package/dist/src/skills/invocable-skills.js +0 -17
  509. package/dist/src/skills/project-skills.d.ts +0 -1
  510. package/dist/src/skills/project-skills.js +0 -3
  511. package/dist/src/skills/prompt-skills.js +0 -14
  512. package/dist/src/skills/runtime-skills.d.ts +0 -13
  513. package/dist/src/skills/runtime-skills.js +0 -37
  514. package/dist/src/stall-recovery.d.ts +0 -25
  515. package/dist/src/stall-recovery.js +0 -38
  516. package/dist/src/stray-files.d.ts +0 -9
  517. package/dist/src/stray-files.js +0 -16
  518. package/dist/src/structured-step.d.ts +0 -22
  519. package/dist/src/structured-step.js +0 -22
  520. package/dist/src/subagent-run.d.ts +2 -163
  521. package/dist/src/subagent-run.js +18 -376
  522. package/dist/src/subagent-tree.d.ts +32 -0
  523. package/dist/src/subagent-tree.js +128 -0
  524. package/dist/src/telemetry/aggregate.d.ts +0 -37
  525. package/dist/src/telemetry/aggregate.js +0 -40
  526. package/dist/src/telemetry/capture-core.d.ts +0 -87
  527. package/dist/src/telemetry/capture-core.js +0 -67
  528. package/dist/src/telemetry/capture.d.ts +0 -1
  529. package/dist/src/telemetry/capture.js +0 -3
  530. package/dist/src/telemetry/classify.d.ts +0 -58
  531. package/dist/src/telemetry/classify.js +0 -60
  532. package/dist/src/telemetry/decision-capture.d.ts +0 -1
  533. package/dist/src/telemetry/emitter.d.ts +0 -30
  534. package/dist/src/telemetry/emitter.js +1 -62
  535. package/dist/src/telemetry/gate.d.ts +0 -29
  536. package/dist/src/telemetry/gate.js +0 -22
  537. package/dist/src/telemetry/identity.d.ts +0 -13
  538. package/dist/src/telemetry/identity.js +0 -29
  539. package/dist/src/telemetry/outbox.d.ts +0 -64
  540. package/dist/src/telemetry/outbox.js +1 -108
  541. package/dist/src/telemetry/schema.d.ts +1 -49
  542. package/dist/src/telemetry/schema.js +3 -84
  543. package/dist/src/telemetry/state.d.ts +0 -53
  544. package/dist/src/telemetry/state.js +0 -64
  545. package/dist/src/telemetry/surface.d.ts +0 -31
  546. package/dist/src/telemetry/surface.js +1 -39
  547. package/dist/src/telemetry/uploader.d.ts +0 -11
  548. package/dist/src/telemetry/uploader.js +0 -46
  549. package/dist/src/telemetry/uploads.d.ts +0 -11
  550. package/dist/src/telemetry/uploads.js +0 -11
  551. package/dist/src/telemetry/version.d.ts +0 -4
  552. package/dist/src/telemetry/version.js +0 -14
  553. package/dist/src/telemetry/workspace.d.ts +0 -7
  554. package/dist/src/telemetry/workspace.js +1 -22
  555. package/dist/src/terminal-ui.d.ts +33 -521
  556. package/dist/src/terminal-ui.js +145 -884
  557. package/dist/src/test-edit-guard.d.ts +74 -0
  558. package/dist/src/test-edit-guard.js +269 -0
  559. package/dist/src/text.d.ts +0 -1
  560. package/dist/src/text.js +0 -1
  561. package/dist/src/time-limit.d.ts +0 -36
  562. package/dist/src/time-limit.js +0 -37
  563. package/dist/src/timers.d.ts +0 -161
  564. package/dist/src/timers.js +0 -126
  565. package/dist/src/todos.d.ts +0 -1
  566. package/dist/src/todos.js +0 -3
  567. package/dist/src/token-rate.d.ts +0 -94
  568. package/dist/src/token-rate.js +0 -154
  569. package/dist/src/tool-activity.d.ts +0 -6
  570. package/dist/src/tool-activity.js +0 -7
  571. package/dist/src/tool-availability.d.ts +0 -13
  572. package/dist/src/tool-availability.js +1 -14
  573. package/dist/src/tool-call-clock.d.ts +1 -4
  574. package/dist/src/tool-call-clock.js +0 -13
  575. package/dist/src/tool-catalog.d.ts +0 -11
  576. package/dist/src/tool-catalog.js +0 -23
  577. package/dist/src/tool-dependencies.d.ts +0 -5
  578. package/dist/src/tool-dependencies.js +0 -4
  579. package/dist/src/tool-diff-stats.d.ts +0 -23
  580. package/dist/src/tool-diff-stats.js +0 -49
  581. package/dist/src/tool-errors.d.ts +9 -7
  582. package/dist/src/tool-errors.js +13 -6
  583. package/dist/src/tool-failure-tracker.d.ts +3 -11
  584. package/dist/src/tool-failure-tracker.js +19 -27
  585. package/dist/src/tool-names.d.ts +0 -16
  586. package/dist/src/tool-names.js +0 -12
  587. package/dist/src/tool-profile.d.ts +6 -0
  588. package/dist/src/tool-profile.js +23 -0
  589. package/dist/src/tool-result-filter.d.ts +0 -19
  590. package/dist/src/tool-result-filter.js +1 -66
  591. package/dist/src/tool-schema-compatibility.d.ts +0 -6
  592. package/dist/src/tool-schema-compatibility.js +0 -9
  593. package/dist/src/tools.d.ts +0 -4
  594. package/dist/src/tools.js +11 -114
  595. package/dist/src/trajectory.d.ts +0 -13
  596. package/dist/src/trajectory.js +23 -79
  597. package/dist/src/transcript.d.ts +0 -41
  598. package/dist/src/transcript.js +5 -60
  599. package/dist/src/types.d.ts +4 -168
  600. package/dist/src/untracked-file-removal.js +0 -20
  601. package/dist/src/update-check.d.ts +0 -14
  602. package/dist/src/update-check.js +1 -15
  603. package/dist/src/update.d.ts +0 -35
  604. package/dist/src/update.js +0 -100
  605. package/dist/src/usage-analytics.d.ts +17 -17
  606. package/dist/src/usage-analytics.js +168 -209
  607. package/dist/src/web-search.d.ts +0 -23
  608. package/dist/src/web-search.js +1 -27
  609. package/dist/src/widgets.d.ts +0 -25
  610. package/dist/src/widgets.js +0 -24
  611. package/dist/src/workspace-facts.d.ts +0 -12
  612. package/dist/src/workspace-facts.js +1 -18
  613. package/dist/src/workspace-git-metadata.d.ts +0 -16
  614. package/dist/src/workspace-git-metadata.js +0 -21
  615. package/dist/src/workspace-instructions.d.ts +3 -15
  616. package/dist/src/workspace-instructions.js +6 -19
  617. package/package.json +13 -2
@@ -1,11 +1,17 @@
1
- import { isPermissionMode, permissionLabel, workspacePermissionKey } from './permissions.js';
1
+ import { isPermissionMode, permissionLabel, PERMISSION_OPTIONS, workspacePermissionKey } from './permissions.js';
2
+ export function permissionChoices(current) {
3
+ const width = Math.max(...PERMISSION_OPTIONS.map(option => option.id.length));
4
+ const rows = PERMISSION_OPTIONS.map(option => `${option.id === current ? '●' : ' '} ${option.id.padEnd(width)} ${option.label}${option.id === current ? ' (current)' : ''}: ${option.description}`);
5
+ return [`Permissions: ${permissionLabel(current)}`, 'Change with /permissions <mode>:', ...rows].join('\n');
6
+ }
2
7
  import { graphStorageDirectory } from './graph-account.js';
3
8
  import { configuredGraphSelection, currentGraphSubject, saveGraphSelection } from './graph-selection.js';
4
- import { loadAccessibleGraph, requireGraphMembership } from './membership.js';
9
+ import { currentGraphSelection, loadAccessibleGraph, requireGraphMembership } from './membership.js';
5
10
  import { GraphProviderUnavailableError } from './graph-provider-portability.js';
6
11
  import { confirmAndApplyModelOverride } from './model-override.js';
12
+ import { applyGoalCommand } from './session-goal.js';
7
13
  import { changeConfigFile, configDirectory, loadConfig, loadSavedAnalytics } from './config.js';
8
- import { applyModelContextWindow, providerLabel, recordProviderModel, REASONING_EFFORTS } from './providers.js';
14
+ import { applyModelContextWindow, modelDisplayName, modelIdForDisplayName, providerLabel, recordProviderModel, REASONING_EFFORTS } from './providers.js';
9
15
  import { resolveRepositoryId } from './code-intelligence/repository.js';
10
16
  import { logoutCodex } from './codex-auth.js';
11
17
  import { codexAccountHome } from './codex-rpc.js';
@@ -15,6 +21,7 @@ import { telemetryDirectory } from './telemetry/identity.js';
15
21
  import { purgeOutbox } from './telemetry/outbox.js';
16
22
  import { recordPreference } from './telemetry/state.js';
17
23
  import { telemetryGate } from './telemetry/gate.js';
24
+ import { formatWeekReset } from './andorra/usage-format.js';
18
25
  const MAX_CODEINTEL_REPO_OVERRIDES = 100;
19
26
  const REASONING_USAGE = 'Usage: /reasoning default|none|minimal|low|medium|high|xhigh|max';
20
27
  export const HELP = `Commands:
@@ -23,7 +30,7 @@ export const HELP = `Commands:
23
30
  /login [--no-browser] Sign in or create an Andorra account (prints the address over SSH)
24
31
  /auth logout Remove this machine's saved Andorra account session
25
32
  /auth status Show Andorra account session status
26
- /model [model-id] Open model selection or select a model directly; with a graph that pins node models, asks whether to override them
33
+ /model [model-id] Open the provider/model tree (→ expands, ← collapses) or select a model directly; with a graph that pins node models, asks whether to override them
27
34
  /model list Discover models from the active provider
28
35
  /providers [id] Choose providers; Right/e edits; Add provider configures
29
36
  /subagent [id [model]] Set the provider/model external hosts (Claude/Codex CLI) must use for Andorra subagent runs; off clears it
@@ -34,7 +41,8 @@ export const HELP = `Commands:
34
41
  /attach <path> Attach a file or folder to your next task (large pastes and dropped files attach automatically)
35
42
  /usage Open session usage (Escape to return)
36
43
  /permissions [mode] Choose and remember workspace permissions
37
- /jev <on|off|status> Turn Jev on or off for nodes that enable it, or show its setting
44
+ /jev <on|off|status> Turn Jev on or off for this session, or show its setting
45
+ /jev global <on|off> Turn the Global Jev switch on or off; off stops Jev in every session and agent
38
46
  /feedback <on|off|status> Show the anonymous-feedback setting; Paid accounts can turn it off
39
47
  /yolo <on|off> Turn session-wide Full Access on or off (host files and network)
40
48
  /tools List available coding tools
@@ -49,6 +57,7 @@ export const HELP = `Commands:
49
57
  /status Show workspace and current settings
50
58
  /clear Clear the conversation on screen and the retained context (session usage is retained)
51
59
  /compact Compact retained conversation history to free context
60
+ /goal [text|clear] Set, show or clear the session goal; a run keeps working until a completion check agrees the goal is met
52
61
  /help Show commands
53
62
  /exit Quit
54
63
  Selection screens: Up/Down to browse, Enter or Space to select, Escape to return.
@@ -56,17 +65,28 @@ Ctrl+B toggles dashboard; Ctrl+G pages its graph; Ctrl+N cycles dashboard model
56
65
  Ctrl+T expands/collapses todos; Ctrl+O expands/collapses tool details; Ctrl+Y collapses/expands live thinking.
57
66
  Shift+Arrow/Home/End selects prompt text; Ctrl+C copies and Ctrl+X cuts a selection. The wheel scrolls; Up/Down recall prompts. Drag selects and copies transcript text; double-click copies a word.
58
67
  Ctrl+C stops an interactive run; send direction to resume, or press Ctrl+C again to exit (idle Ctrl+C exits too). /yolo on|off applies immediately, including at approvals. /exit quits. Headless Ctrl+C cancels the run; a second press exits.`;
59
- /**
60
- * Collapse retained turns into a single summary entry so the next request sends one
61
- * condensed user/assistant pair instead of every full completion.
62
- *
63
- * Compaction is deterministic and local: each turn keeps its task and outcome summary
64
- * (clipped) and loses test lists and structured detail. A continued turn also keeps its
65
- * direction as its own clipped part — folding it into the task's clip could cut it away
66
- * entirely, and `/compact` erasing what the user sent after a stop is exactly what a
67
- * summary must not do. The caller still holds the turns; replacing them is the CLI's
68
- * decision, reported through the `compact` result flag.
69
- */
68
+ /** `name (id)` when the model has a display name, else the id. */
69
+ function modelWithName(provider, id) {
70
+ const name = modelDisplayName(provider, id);
71
+ return name === id ? id : `${name} (${id})`;
72
+ }
73
+ /** The /status line for Andorra's hosted models, with its leading line break; empty while there is nothing to show. */
74
+ function andorraUsageLine(state) {
75
+ const usage = state.andorra?.usage?.();
76
+ if (!usage)
77
+ return '';
78
+ if (usage.kind === 'not-available')
79
+ return '\nAndorra models: Not available at the moment.';
80
+ const resets = formatWeekReset(usage.resetsAt);
81
+ return `\nAndorra models, this week: ${usage.usedPercent}% used${resets ? `, resets ${resets}` : ''}`;
82
+ }
83
+ /** The message refusing a switch to this provider, or undefined when it may be selected. An absent `state.andorra` counts as available. */
84
+ export function andorraRefusal(state, providerId) {
85
+ if (state.config.providers.find(item => item.id === providerId)?.type !== 'andorra')
86
+ return undefined;
87
+ const availability = state.andorra?.availability();
88
+ return availability && !availability.available ? availability.message : undefined;
89
+ }
70
90
  export function compactHistory(turns) {
71
91
  const clip = (text, limit) => { const flat = text.replace(/\s+/g, ' ').trim(); return flat.length > limit ? flat.slice(0, limit - 1) + '…' : flat; };
72
92
  const lines = turns.map((turn, index) => `${index + 1}. ${clip(turn.task, 160)}${turn.direction === undefined ? '' : ` (continued with: ${clip(turn.direction, 160)})`} → ${clip(turn.completion.summary, 240)}`);
@@ -75,20 +95,10 @@ export function compactHistory(turns) {
75
95
  completion: { summary: lines.join('\n'), tests: [] },
76
96
  }];
77
97
  }
78
- /**
79
- * Estimate the context the compacted history will occupy, in tokens, so the footer can
80
- * drop the moment `/compact` runs. This is a character-based approximation (the same
81
- * seed text measured at ~4 characters per token); the next model request replaces it with
82
- * the provider-reported input size.
83
- */
84
98
  export function compactedContextEstimate(turns) {
85
99
  return Math.ceil(JSON.stringify(turns).length / 4);
86
100
  }
87
101
  const CODEGRAPH_USAGE = 'Usage: /codegraph status|enable|disable|rebuild. Add --global to enable|disable to set the saved default for every project (this clears per-repository overrides).';
88
- /**
89
- * `/codegraph`. `enable|disable` alone records an override for the current repository; with
90
- * `--global` it sets the saved default that every project and every later session starts from.
91
- */
92
102
  async function codegraphCommand(action, scope, state, signal) {
93
103
  const manager = state.codeIntel;
94
104
  if (!manager)
@@ -100,7 +110,7 @@ async function codegraphCommand(action, scope, state, signal) {
100
110
  const status = await manager.getStatus();
101
111
  const indexed = status.stats?.lastIndexedAt ? new Date(status.stats.lastIndexedAt).toLocaleString() : 'never';
102
112
  const repositoryId = await resolveRepositoryId(state.workspace).catch(() => undefined);
103
- const saved = state.config.codeIntel?.enabled !== false;
113
+ const saved = state.config.codeIntel?.enabled === true;
104
114
  const override = !repositoryId ? ''
105
115
  : (state.config.codeIntel?.enabledRepos ?? []).includes(repositoryId) ? '; this repository is enabled by override'
106
116
  : (state.config.codeIntel?.disabledRepos ?? []).includes(repositoryId) ? '; this repository is disabled by override'
@@ -111,17 +121,12 @@ async function codegraphCommand(action, scope, state, signal) {
111
121
  case 'disable': {
112
122
  const enable = action === 'enable';
113
123
  if (scope === 'global') {
114
- // The global toggle is the newest statement of intent, so it resets the per-repository
115
- // exceptions: after it, every project follows the saved default until a plain
116
- // `/codegraph enable|disable` records a new override.
117
124
  const cleared = (state.config.codeIntel?.enabledRepos?.length ?? 0) + (state.config.codeIntel?.disabledRepos?.length ?? 0);
118
125
  state.config.codeIntel = { ...state.config.codeIntel, enabled: enable, enabledRepos: [], disabledRepos: [] };
119
126
  return { text: `Code intelligence ${enable ? 'enabled' : 'disabled'} for every project; new sessions in other projects start with it ${enable ? 'on' : 'off'}.${cleared ? ` ${cleared} per-repository override${cleared === 1 ? ' was' : 's were'} cleared.` : ''} /codegraph ${enable ? 'disable' : 'enable'} without --global overrides this for one repository.`, save: true };
120
127
  }
121
128
  const repositoryId = await resolveRepositoryId(state.workspace).catch(() => undefined);
122
129
  if (repositoryId) {
123
- // Per-repository override: never touch the global enabled flag, so a
124
- // global disable survives enabling one repository (and vice versa).
125
130
  const disabled = new Set(state.config.codeIntel?.disabledRepos ?? []);
126
131
  const enabledRepos = new Set(state.config.codeIntel?.enabledRepos ?? []);
127
132
  const target = enable ? enabledRepos : disabled;
@@ -141,7 +146,6 @@ async function codegraphCommand(action, scope, state, signal) {
141
146
  else {
142
147
  state.config.codeIntel = { ...state.config.codeIntel, enabled: enable };
143
148
  }
144
- // The live manager is updated by executeCommand only after persistence succeeds.
145
149
  return { text: `Code intelligence ${enable ? 'enabled' : 'disabled'}${repositoryId ? ' for this repository' : ''}.`, save: true };
146
150
  }
147
151
  case 'rebuild':
@@ -160,12 +164,6 @@ async function codegraphCommand(action, scope, state, signal) {
160
164
  return { text: CODEGRAPH_USAGE };
161
165
  }
162
166
  }
163
- /**
164
- * Copy a configuration over the live one, deletions included.
165
- *
166
- * `Object.assign` only adds and replaces, so a setting another writer deleted would stay in the
167
- * live configuration and be resurrected by the next command that saves the whole snapshot.
168
- */
169
167
  function syncConfig(target, source) {
170
168
  for (const key of Object.keys(target)) {
171
169
  if (!(key in source))
@@ -173,11 +171,9 @@ function syncConfig(target, source) {
173
171
  }
174
172
  Object.assign(target, source);
175
173
  }
176
- /** What the command says after it changed the preference. */
177
174
  function feedbackChangedText(enabled) {
178
175
  return `Anonymous feedback ${enabled ? 'on' : 'off'}. Setting saved for this machine.${enabled ? ' It never includes your code, prompts, or API keys.' : ' No anonymous product data will be reported from this installation.'}`;
179
176
  }
180
- /** The line shown for a plan that collects as a condition of the plan. */
181
177
  function includedWithPlanText(plan) {
182
178
  if (plan === 'legacy')
183
179
  return 'on (included with the Legacy plan)';
@@ -185,33 +181,20 @@ function includedWithPlanText(plan) {
185
181
  return 'on (included with the Free plan)';
186
182
  return 'on (included with your plan until this account\'s plan is confirmed)';
187
183
  }
188
- /** Why a plan that cannot opt out refuses `/feedback off`. */
189
184
  function optOutRefusedText(plan) {
190
185
  const named = plan === 'free' ? 'Free' : plan === 'legacy' ? 'Legacy' : 'current';
191
186
  return `Anonymous feedback stays on: collection is included with the ${named} plan. Upgrade to Paid to turn it off.`;
192
187
  }
193
- /**
194
- * Whether a `/subagent off` invocation clears the saved pair.
195
- *
196
- * A provider may legally be named "off", and a selection of a real provider must not delete the
197
- * configuration: the clear applies only when nothing is configured under that name.
198
- */
199
188
  export function subagentClearRequested(line, providers) {
200
189
  return /^\/subagent\s+off\s*$/.test(line.trim()) && !providers.some(provider => provider.id === 'off');
201
190
  }
202
- /** Commit selection changes only after persistence succeeds; callers render the returned result afterward. */
203
191
  export async function executeCommand(line, state, persist, signal, graphAccess = { load: loadAccessibleGraph, requirePaid: requireGraphMembership }, graphSubject = currentGraphSubject, logout = logoutCodex) {
204
- // `/logout` is the Andorra account's sign-out, the counterpart of `/login`; a provider's managed
205
- // sign-in is named explicitly, so signing out of the account never touches provider sessions.
206
192
  if (/^\/logout\s+\S/.test(line.trim()) && !/^\/logout\s+--all$/.test(line.trim())) {
207
193
  if (!/^\/logout\s+codex$/.test(line.trim()))
208
194
  return { text: 'Usage: /logout [--all] | /logout codex' };
209
195
  const codex = state.config.providers.filter(candidate => candidate.type === 'codex');
210
196
  if (!codex.length)
211
197
  return { text: 'No Codex provider is configured, so there is no Codex sign-in to log out of. Use /logout to sign out of your Andorra account.' };
212
- // Each configured account has its own home, so all of them leave together: signing out one
213
- // alone would leave the others' sessions live under entries the person believes are gone.
214
- // Slot-less providers share the default home, which is signed out once.
215
198
  const homes = [];
216
199
  for (const item of codex) {
217
200
  const home = codexAccountHome(item.codexAccount);
@@ -234,23 +217,14 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
234
217
  return { text: 'Signed out of every configured Codex account. Provider settings are retained; use /providers to sign in again.', exit: true, clear: true };
235
218
  }
236
219
  const draft = { ...state, config: structuredClone(state.config) };
237
- // The feedback preference belongs to the installation rather than to this process: the desktop
238
- // app and another CLI write the same file, so the answer this command reports and the value it
239
- // changes are the ones saved now, not the snapshot this process loaded when it started. The bare
240
- // form only reports, like `status`.
241
220
  const feedbackWrite = /^\/feedback(?:\s+(?:on|off|status))?$/.test(line.trim());
242
221
  if (feedbackWrite)
243
222
  draft.config.analytics = await loadSavedAnalytics();
244
- // The plan gate is resolved before the command runs, so `/feedback off` refuses rather than
245
- // writes a value that only looks stored.
246
223
  if (feedbackWrite) {
247
- // Read the preference from the file, not this process's snapshot: another writer may have
248
- // changed it since the run started.
249
224
  const gate = await telemetryGate({ home: configDirectory(), config: await loadConfig(configDirectory()), subject: await graphSubject().catch(() => undefined) });
250
225
  draft.analytics = { plan: gate.plan, canOptOut: gate.canOptOut };
251
226
  }
252
227
  const graphCommand = /^\/graph\s+(\S+)\s*$/.exec(line.trim());
253
- // A second word is only ever `--global`; a bare `/codegraph --global` or a misspelt flag reaches the usage text.
254
228
  const codegraph = /^\/codegraph(?:\s+(\S+))?(?:\s+(\S+))?\s*$/.exec(line.trim());
255
229
  const codegraphScope = codegraph?.[2] === undefined ? 'repository' : codegraph[2] === '--global' ? 'global' : undefined;
256
230
  let result;
@@ -261,20 +235,17 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
261
235
  if (action === 'logout' || action === 'login') {
262
236
  delete draft.graph;
263
237
  result.clear = true;
238
+ state.andorra?.accountChanged?.();
264
239
  }
265
240
  }
266
241
  else if (codegraph) {
267
242
  result = codegraphScope ? await codegraphCommand(codegraph[1] ?? 'status', codegraphScope, draft, signal) : { text: CODEGRAPH_USAGE };
268
243
  }
269
244
  else if (graphCommand) {
270
- const id = graphCommand[1];
245
+ const id = currentGraphSelection(graphCommand[1]);
271
246
  try {
272
247
  signal?.throwIfAborted();
273
248
  const subject = await graphSubject();
274
- // A graph that cannot bind to this machine's providers stays selectable: the choice names
275
- // what a task will run, and it is the run that refuses those references. The graph is read
276
- // once more without binding so the answer can still name it; membership and storage errors
277
- // keep refusing the selection outright.
278
249
  let graph;
279
250
  let unavailable;
280
251
  try {
@@ -297,8 +268,6 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
297
268
  delete draft.graph;
298
269
  else
299
270
  draft.graph = id;
300
- // This form has no UI to confirm on, so the warning that the switch starts fresh travels
301
- // in the returned text; an unchanged graph clears nothing and carries no warning.
302
271
  result = { text: `Graph: ${id === 'default' ? 'Default' : graph.name} (${id === 'default' ? 'Andorra Agent only' : `${graph.id}@${graph.revision}`})${changed ? ". This session's context is cleared and the new graph starts fresh." : ''}${unavailable ? ` ${unavailable} The graph is selected anyway; a task on it starts only once it can run on this machine, or after /model overrides every node with one provider you have.` : ''}`, clear: changed, save };
303
272
  }
304
273
  catch (error) {
@@ -311,13 +280,10 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
311
280
  const modelDirect = /^\/model\s+(\S+)$/.exec(line.trim());
312
281
  const activeProvider = draft.config.providers.find(p => p.id === draft.config.provider);
313
282
  if (modelDirect && modelDirect[1] !== 'list' && draft.graph && activeProvider && state.confirmModelOverride) {
314
- // The graph is saved before the config: a declined or failed override leaves both untouched.
315
283
  const outcome = await confirmAndApplyModelOverride({
316
284
  graphId: draft.graph,
317
285
  target: { provider: activeProvider.id, model: modelDirect[1] },
318
286
  configProviders: draft.config.providers.map(p => ({ id: p.id, type: p.type, model: p.model })),
319
- // Same rule as the /model screen: the override rewrites every provider reference, so the
320
- // graph is read without binding — binding is what refuses a graph whose providers are gone.
321
287
  loadGraph: (id, graphSignal) => graphAccess.load(id, graphSignal, undefined, { bindProviders: false }),
322
288
  resolveDirectory: async () => graphStorageDirectory(undefined, await graphSubject()),
323
289
  confirm: state.confirmModelOverride,
@@ -335,53 +301,41 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
335
301
  result = handleCommand(line, draft);
336
302
  }
337
303
  const permissionsChanged = draft.permissions !== state.permissions;
338
- // Cache writes must stop before Read Only or Plan is persisted or exposed to the run.
339
304
  if (permissionsChanged && (draft.permissions === 'read-only' || draft.permissions === 'plan'))
340
305
  await state.codeIntel?.setPermissions(draft.permissions);
341
306
  if (result.save && feedbackWrite) {
342
- // The preference belongs to the installation, so its change is written to the file's current
343
- // content under the configuration's lock: saving this process's snapshot would revert a
344
- // provider, a limit or a permission that another writer changed while it was running.
345
- // Every event already queued under the old preference is discarded only when reporting actually
346
- // turns off. Repeating `/feedback off` on an installation that is already off keeps the
347
- // generation, so purging again would delete events another process legitimately queued since —
348
- // on a shared home, a plan that cannot opt out still reports. The purge is decided inside the
349
- // locked update so it sees the state the write replaced.
350
307
  let preferenceTurnedOff = false;
351
308
  const saved = await changeConfigFile(configDirectory(), current => {
352
309
  const enabled = draft.config.analytics?.enabled !== false;
353
310
  preferenceTurnedOff = resolveAnalyticsConfig(current).enabled && !enabled;
354
311
  return { ...current, analytics: { ...draft.config.analytics, generation: analyticsGenerationFor(current.analytics, enabled) } };
355
312
  });
356
- // The generation bump closes the race against a task engine that appends just after this purge.
357
313
  if (preferenceTurnedOff)
358
314
  await purgeOutbox(telemetryDirectory());
359
315
  if (saved.analytics !== undefined) {
360
316
  await recordPreference({ subject: await graphSubject().catch(() => undefined), preference: saved.analytics.enabled === false ? 'off' : 'on' }).catch(() => { });
361
317
  }
362
- // The live configuration follows the file, not the snapshot this process started with.
363
318
  draft.config = saved;
364
319
  }
365
320
  else if (result.save)
366
321
  await persist(draft.config);
367
- // Preserve the config object shared by the CLI's run callback, and the deletions another writer
368
- // made in it: a setting that is gone from the file must be gone from the live configuration too.
369
322
  syncConfig(state.config, draft.config);
370
323
  if (graphCommand && result.save)
371
324
  delete state.config.graph;
372
- // A cleared subagent pair is a delete on the draft, which Object.assign cannot carry back. A
373
- // provider named "off" is a selection, not a clear, so it leaves the setting alone.
374
325
  if (subagentClearRequested(line, state.config.providers) && result.save)
375
326
  delete state.config.externalSubagent;
376
327
  state.yolo = draft.yolo;
377
328
  state.permissions = draft.permissions;
329
+ if (result.goalChanged)
330
+ state.goal = draft.goal;
331
+ if (draft.jev !== undefined)
332
+ state.jev = draft.jev;
378
333
  if (permissionsChanged && draft.permissions !== 'read-only' && draft.permissions !== 'plan')
379
334
  await state.codeIntel?.setPermissions(draft.permissions);
380
335
  if (draft.graph === undefined)
381
336
  delete state.graph;
382
337
  else
383
338
  state.graph = draft.graph;
384
- // Live manager changes follow persistence, never precede it.
385
339
  if (codegraph && result.save && (codegraph[1] === 'enable' || codegraph[1] === 'disable')) {
386
340
  await state.codeIntel?.setEnabled(codegraph[1] === 'enable');
387
341
  }
@@ -404,27 +358,45 @@ export function handleCommand(line, state) {
404
358
  return { text: 'Nothing to compact: no conversation history is retained yet.' };
405
359
  return { text: `Compacted ${turns.length} retained turn${turns.length === 1 ? '' : 's'} into one summary entry. The next request sends the condensed history; session usage totals are unchanged.`, compact: true };
406
360
  }
361
+ case '/goal': {
362
+ const outcome = applyGoalCommand(line, state.goal);
363
+ if (outcome.changed)
364
+ state.goal = outcome.goal;
365
+ return { text: outcome.text, ...(outcome.changed ? { goalChanged: true } : {}) };
366
+ }
407
367
  case '/model':
408
368
  if (arg === 'list')
409
369
  return { text: '', discover: true };
410
370
  if (!arg)
411
- return { text: `${provider.id}: ${provider.model}` };
412
- if (args.length !== 1)
413
- return { text: 'Usage: /model <model-id>' };
414
- if (provider.model !== arg) {
415
- applyModelContextWindow(provider, arg);
416
- delete provider.reasoningEffort;
371
+ return { text: `${provider.id}: ${modelWithName(provider, provider.model)}` };
372
+ { // An Andorra model may also be named by its exact display name; the id is what is saved.
373
+ const chosen = modelIdForDisplayName(provider, arg) ?? (args.length === 1 ? arg : undefined);
374
+ if (chosen === undefined)
375
+ return { text: 'Usage: /model <model-id>' };
376
+ if (provider.model !== chosen) {
377
+ applyModelContextWindow(provider, chosen);
378
+ delete provider.reasoningEffort;
379
+ }
380
+ recordProviderModel(provider, chosen);
381
+ provider.model = chosen;
382
+ return { text: `Model: ${provider.id}/${modelWithName(provider, chosen)}`, save: true, clear: true };
417
383
  }
418
- recordProviderModel(provider, arg);
419
- provider.model = arg;
420
- return { text: `Model: ${provider.id}/${arg}`, save: true, clear: true };
421
384
  case '/providers':
422
385
  if (!arg && !provider)
423
386
  return { text: 'No providers configured. Open /providers and choose Add provider.' };
424
- if (!arg)
425
- return { text: state.config.providers.map(p => `${p.id === provider.id ? '*' : ' '} ${providerLabel(p, state.config.providers)} (${p.type}) — ${p.model}`).join('\n') };
387
+ if (!arg) {
388
+ // Andorra listed by default and not saved yet reads like any provider, first. Naming it here saves nothing.
389
+ const listed = state.andorra?.listed?.();
390
+ const shown = listed ? [listed, ...state.config.providers] : state.config.providers;
391
+ return { text: shown.map(p => `${p !== listed && p.id === provider.id ? '*' : ' '} ${providerLabel(p, shown)} (${p.type}) — ${modelDisplayName(p, p.model)}`).join('\n') };
392
+ }
426
393
  if (!state.config.providers.some(p => p.id === arg))
427
394
  return { text: `Unknown provider: ${arg}. Use /providers to browse configured providers.` };
395
+ {
396
+ const refusal = andorraRefusal(state, arg);
397
+ if (refusal)
398
+ return { text: refusal };
399
+ }
428
400
  state.config.provider = arg;
429
401
  return { text: `Provider: ${arg}. Conversation cleared for the new provider.`, save: true, clear: true };
430
402
  case '/subagent': {
@@ -433,8 +405,6 @@ export function handleCommand(line, state) {
433
405
  return { text: setting
434
406
  ? `External subagent: ${setting.provider}/${setting.model}. Claude CLI and Codex CLI subagent runs use this pair.`
435
407
  : 'External subagent: not set. External hosts cannot start an Andorra subagent run until a provider/model is picked; they receive a PROVIDER_NOT_SET error listing the options. Use /subagent <provider> [model], or /subagent to pick.' };
436
- // A provider may legally be named "off", so the clear applies only when nothing is
437
- // configured under that name: a selection of a real provider must not delete the setting.
438
408
  if (arg === 'off' && !state.config.providers.some(provider => provider.id === 'off')) {
439
409
  if (!setting)
440
410
  return { text: 'External subagent: already not set.' };
@@ -474,18 +444,17 @@ export function handleCommand(line, state) {
474
444
  if (changed)
475
445
  return { text: 'Graph: Default (Andorra Agent)', clear: true };
476
446
  }
477
- return { text: 'Graph: Default - Andorra Agent only. Use the graph selector for the paid Andorra graph or custom graphs.' };
447
+ return { text: 'Graph: Default - Andorra Agent only. Use the graph selector for custom graphs.' };
478
448
  case '/permissions':
479
449
  if (!arg)
480
- return { text: `Permissions: ${permissionLabel(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}` };
450
+ return { text: permissionChoices(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval')) };
481
451
  if (!isPermissionMode(arg))
482
- return { text: 'Usage: /permissions read-only|plan|ask-for-approval|approve-for-me|full-access' };
452
+ return { text: `Unknown permission mode "${arg}".\n${permissionChoices(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}` };
483
453
  state.config.workspacePermissions = { ...state.config.workspacePermissions, [workspacePermissionKey(state.workspace)]: arg };
484
454
  state.permissions = arg;
485
455
  state.yolo = arg === 'full-access';
486
456
  return { text: `Permissions: ${permissionLabel(arg)} (remembered for this workspace).`, save: true };
487
457
  case '/yolo':
488
- // The bare form reports and changes nothing: a stray Enter must never flip approvals.
489
458
  if (!arg)
490
459
  return { text: `YOLO: ${state.yolo ? 'on' : 'off'}.\nUsage: /yolo on|off` };
491
460
  if (!['on', 'off'].includes(arg))
@@ -496,30 +465,37 @@ export function handleCommand(line, state) {
496
465
  ? 'YOLO on: session-wide Full Access. Host files, shell, Git, QA, MCP and network operations are automatically approved.'
497
466
  : 'YOLO off: session permissions restored to Ask for approval.' };
498
467
  case '/jev': {
499
- if (args.length > 1 || (arg && !['on', 'off', 'status'].includes(arg)))
500
- return { text: 'Usage: /jev on|off|status' };
501
- const jevStatus = `Jev: ${state.config.jevEnabled === false ? 'disabled' : 'enabled'} (saved preference). Applies to Agent nodes with Jev turned on. Requires sign-in and available quota.`;
468
+ const jevUsage = 'Usage: /jev on|off|status, or /jev global on|off';
469
+ const global = args[0] === 'global';
470
+ const globalArg = global ? args[1] : undefined;
471
+ if (global ? args.length !== 2 || !['on', 'off'].includes(globalArg ?? '') : args.length > 1 || (arg && !['on', 'off', 'status'].includes(arg)))
472
+ return { text: jevUsage };
473
+ const jevStatus = () => {
474
+ const globalOn = state.config.jevEnabled !== false;
475
+ const sessionOn = state.jev !== false;
476
+ return `Jev: ${globalOn && sessionOn ? 'on' : 'off'} for this session (session ${sessionOn ? 'on' : 'off'}, Global Jev switch ${globalOn ? 'on' : 'off'}).`
477
+ + (globalOn ? ' Applies to Agent nodes with Jev turned on. Requires sign-in and available quota.' : ' The Global Jev switch is off, so no session and no Agent node uses Jev. Turn it on with /jev global on.');
478
+ };
502
479
  if (arg === 'status')
503
- return { text: jevStatus };
480
+ return { text: jevStatus() };
504
481
  if (!arg)
505
- return { text: `${jevStatus}\nUsage: /jev on|off|status` };
506
- state.config.jevEnabled = arg === 'on';
507
- const saved = `Jev ${state.config.jevEnabled ? 'enabled' : 'disabled'}. Setting saved for this machine.`;
508
- if (state.running)
509
- return { text: `${saved} The current run keeps its setting; the change applies after it ends or you interrupt it.`, save: true };
510
- return { text: `${saved}${state.config.jevEnabled ? ' It applies to Agent nodes with Jev turned on and requires sign-in and available quota.' : ''}`, save: true };
482
+ return { text: `${jevStatus()}\n${jevUsage}` };
483
+ const kept = state.running ? ' The current run keeps its setting; the change applies after it ends or you interrupt it.' : '';
484
+ if (global) {
485
+ state.config.jevEnabled = globalArg === 'on';
486
+ return { text: `Global Jev switch ${state.config.jevEnabled ? 'on' : 'off'}. Setting saved for this machine.${kept}${state.config.jevEnabled ? ` Each session keeps its own setting; this session is ${state.jev === false ? 'off' : 'on'}.` : ' No session and no Agent node uses Jev until it is turned back on.'}`, save: true };
487
+ }
488
+ state.jev = arg === 'on';
489
+ if (state.config.jevEnabled === false)
490
+ return { text: `Jev ${state.jev ? 'on' : 'off'} for this session, but the Global Jev switch is off, so Jev stays off. Turn it on with /jev global on.` };
491
+ return { text: `Jev ${state.jev ? 'on' : 'off'} for this session.${kept}${state.jev && !state.running ? ' It applies to Agent nodes with Jev turned on and requires sign-in and available quota.' : ''}` };
511
492
  }
512
493
  case '/feedback': {
513
494
  if (args.length > 1 || (arg && !['on', 'off', 'status'].includes(arg)))
514
495
  return { text: 'Usage: /feedback on|off|status' };
515
- // The saved answer is the effective one, not the raw stored field: a configuration that
516
- // never mentioned the setting still reports on, and the status line has to say so.
517
- // The stored preference, not the effective reporting answer: a never-confirmed installation
518
- // collects even with the preference off, and the status line still has to say what was saved.
519
496
  const enabled = resolveAnalyticsConfig(state.config).enabled;
520
497
  const plan = state.analytics?.plan ?? 'unknown';
521
498
  const canOptOut = state.analytics?.canOptOut ?? true;
522
- // The bare form reports, like `status`: a stray Enter must never change the preference.
523
499
  if (arg === 'status' || !arg) {
524
500
  const usage = arg ? '' : '\nUsage: /feedback on|off|status';
525
501
  if (!canOptOut)
@@ -527,17 +503,12 @@ export function handleCommand(line, state) {
527
503
  return { text: `Anonymous feedback: ${enabled ? 'on' : 'off'} (saved preference). It never includes your code, prompts, or API keys.${usage}` };
528
504
  }
529
505
  const next = arg === 'on';
530
- // A switch that silently does nothing is worse than one that is not offered: a plan that
531
- // cannot opt out refuses the change and says why.
532
506
  if (!next && !canOptOut)
533
507
  return { text: optOutRefusedText(plan) };
534
508
  state.config.analytics = { ...state.config.analytics, enabled: next };
535
509
  return { text: feedbackChangedText(next), save: true };
536
510
  }
537
511
  case '/usage': {
538
- // Cache traffic renders only when reported, mirroring the usage screen: an
539
- // unreported read is omitted rather than shown as a measured zero, and the
540
- // hit-rate percentage needs a positive input total to mean anything.
541
512
  const read = state.usage.cacheRead ?? 0, write = state.usage.cacheWrite ?? 0;
542
513
  const cache = read > 0 || write > 0
543
514
  ? `, ${[read > 0 ? `${read} cache-read${state.usage.inputTokens > 0 ? ` (${Math.round(read / state.usage.inputTokens * 100)}% of input)` : ''}` : '',
@@ -545,7 +516,7 @@ export function handleCommand(line, state) {
545
516
  : '';
546
517
  return { text: `Session: ${state.usage.requests} model requests, ${state.usage.inputTokens} input + ${state.usage.outputTokens} output tokens${cache} (provider-reported; missing usage is not estimated).\nCost: unavailable; no pricing assumptions.${state.lastRun ? `\nLast run: ${state.lastRun.id} — ${state.lastRun.status}, ${state.lastRun.toolCalls} tool calls` : ''}` };
547
518
  }
548
- case '/status': return { text: `Workspace: ${state.workspace}\nProvider/model: ${provider.id}/${provider.model}\nThinking: ${provider.reasoningEffort ?? 'provider default'}\nContext window: ${provider.contextWindow?.toLocaleString() ?? 'unknown'}\nGraph: ${state.graph ?? 'Default'}\nPermissions: ${permissionLabel(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}\nYOLO: ${state.yolo ? 'on' : 'off'}` };
519
+ case '/status': return { text: `Workspace: ${state.workspace}\nProvider/model: ${provider.id}/${modelWithName(provider, provider.model)}\nThinking: ${provider.reasoningEffort ?? 'provider default'}\nContext window: ${provider.contextWindow?.toLocaleString() ?? 'unknown'}\nGraph: ${state.graph ?? 'Default'}\nPermissions: ${permissionLabel(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}\nYOLO: ${state.yolo ? 'on' : 'off'}${andorraUsageLine(state)}` };
549
520
  case '/tools': return { text: 'Read, Write, Edit, Glob, Grep, Bash, PowerShell; repo_explore (when CodeGraph is enabled), git_read, qa.*, memory_search and artifact/control tools as permitted.\nEnabled skills add read_skill_resource. Enabled MCP servers and plugins discover namespaced tools at each task start; connection status reports availability. External tools require an agent with shell permission.\nWrites and shell commands obey /permissions; unsupported strict sandboxes fail closed. Host/network escalation and MCP connections/calls require approval unless Full Access is selected. Existing graph configs using retired read_file/search_files/Pi lowercase names are translated internally and are not advertised to models.' };
550
521
  default: return { text: `Unknown command: ${command}. Use /help.` };
551
522
  }
@@ -1,70 +1,23 @@
1
1
  import type { TodoItem } from './todos.js';
2
- /**
3
- * Checks on the completion that ends a run, made by the host before it accepts the handoff.
4
- *
5
- * A model's own `complete_agent` call was the only thing that ended a run on the default graph: no
6
- * guard, no verifier. A live run ended that way with its plan still "in progress" and an envelope
7
- * that carried no summary, so the transcript closed on the raw output object and a finished-looking
8
- * turn read as a run cut off halfway. Both conditions are facts the host already holds, so they are
9
- * checked in code rather than left to the prompt.
10
- *
11
- * The `summary` and `todos` gates each send the handoff back at most `MAX_GATE_ASKS` times and are
12
- * waived after that. A gate never spends a completion repair and never fails the run.
13
- *
14
- * The `unfinished` gate is different in kind. It fires when the completion itself says the task is
15
- * not done: a non-empty `remaining` list, or a "Not done" section in the summary. A run must not end
16
- * on its own with work it can still do. In a benchmark trial with a fifteen-minute limit the agent
17
- * had a build that booted but drew no frame, was told a quarter of its time was left, and completed
18
- * two steps later with "frame output still missing" in its own summary and two minutes unused; the
19
- * host accepted it, and the trial failed. So a completion that reports unfinished work is sent back
20
- * to keep working for as long as the agent does work in between, with no cap on how often. It is
21
- * accepted only when sending it back cannot help: the agent has twice in a row answered the
22
- * send-back with the same report and no tool call (there is nothing more it can do without the
23
- * user), the attempt's clock has all but run out, or it is on its last allowed iteration. Each of
24
- * those is recorded as a waiver with its reason.
25
- *
26
- * Earlier the "Not done" section was the way a completion with open plan items got through at once.
27
- * That made the honest report an exit, and the trial above took it.
28
- */
29
2
  export type FinalAnswerGateId = 'summary' | 'todos' | 'unfinished';
30
3
  export declare const MAX_GATE_ASKS = 2;
31
- /** Consecutive send-backs the agent may answer with no tool call before an unfinished report is accepted. */
32
4
  export declare const MAX_IDLE_UNFINISHED_ASKS = 2;
33
- /** With less than this left on the attempt's clock, another turn could not do any work. */
34
5
  export declare const UNFINISHED_MIN_TIME_MS = 20000;
35
6
  export type UnfinishedWaiver = 'noFurtherWork' | 'outOfTime';
36
7
  export interface FinalAnswerGateInput {
37
- /** The envelope had no summary, so the serialized output is what the user would read. */
38
8
  summaryStoodIn: boolean;
39
- /** The run's plan as it stands after any update sent beside the completion. */
40
9
  todos: readonly TodoItem[];
41
- /** The summary as the user will read it; a "Not done" section in it reports unfinished work. */
42
10
  summary?: string;
43
- /** The completion's own list of what the task still lacks; empty or absent when it claims to be done. */
44
11
  remaining?: readonly string[];
45
- /** How many times the summary and plan gates have already sent a handoff back in this run. */
46
12
  asked?: Partial<Record<FinalAnswerGateId, number>>;
47
- /** Send-backs for unfinished work, in a row, that the agent answered without running any tool. */
48
13
  idleUnfinishedAsks?: number;
49
- /** Time left on the attempt's wall clock; undefined when the attempt has none. */
50
14
  timeLeftMs?: number;
51
15
  }
52
16
  export interface FinalAnswerGateResult {
53
- /** Gates that send this handoff back. Empty when every failed gate is waived. */
54
17
  gates: FinalAnswerGateId[];
55
- /** Gates that failed but let the handoff through; the handoff is accepted despite them. */
56
18
  waived: FinalAnswerGateId[];
57
- /** What the model is told. Empty when nothing is sent back. */
58
19
  message: string;
59
- /** Why an unfinished report was let through, when `waived` includes `unfinished`. */
60
20
  unfinishedWaiver?: UnfinishedWaiver;
61
21
  }
62
- /**
63
- * Whether the summary has a section that reports unfinished work: a markdown heading, or a line
64
- * that is only a bold or plain label, reading "Not done" (also "Not completed", "Not finished",
65
- * "Unfinished", "Remaining work", "Incomplete"). A sentence that merely contains the words does not
66
- * count: a summary may say "nothing was left not done".
67
- */
68
22
  export declare function declaresUnfinishedWork(summary: string | undefined): boolean;
69
- /** Undefined when the handoff passes every gate. */
70
23
  export declare function finalAnswerGate(input: FinalAnswerGateInput): FinalAnswerGateResult | undefined;
@@ -1,19 +1,10 @@
1
1
  export const MAX_GATE_ASKS = 2;
2
- /** Consecutive send-backs the agent may answer with no tool call before an unfinished report is accepted. */
3
2
  export const MAX_IDLE_UNFINISHED_ASKS = 2;
4
- /** With less than this left on the attempt's clock, another turn could not do any work. */
5
3
  export const UNFINISHED_MIN_TIME_MS = 20_000;
6
- /** Plan items and remaining items named in the message; a longer list is counted, not listed. */
7
4
  const MAX_NAMED_TODOS = 8;
8
5
  const MAX_NAMED_REMAINING = 5;
9
6
  const MAX_REMAINING_CHARS = 160;
10
7
  const UNFINISHED_SECTION = /^[ \t]*(?:#{1,6}[ \t]+|\*\*|__)?(?:not (?:done|completed?|finished)|unfinished(?: work)?|remaining work|incomplete)(?:\*\*|__)?[ \t]*:?[ \t]*(?:\*\*|__)?[ \t]*$/im;
11
- /**
12
- * Whether the summary has a section that reports unfinished work: a markdown heading, or a line
13
- * that is only a bold or plain label, reading "Not done" (also "Not completed", "Not finished",
14
- * "Unfinished", "Remaining work", "Incomplete"). A sentence that merely contains the words does not
15
- * count: a summary may say "nothing was left not done".
16
- */
17
8
  export function declaresUnfinishedWork(summary) {
18
9
  return !!summary && UNFINISHED_SECTION.test(summary);
19
10
  }
@@ -24,14 +15,10 @@ function timeLeftPhrase(ms) {
24
15
  const minutes = Math.round(seconds / 60);
25
16
  return minutes < 90 ? `about ${minutes} minutes` : `about ${Math.round(minutes / 6) / 10} hours`;
26
17
  }
27
- /** Undefined when the handoff passes every gate. */
28
18
  export function finalAnswerGate(input) {
29
19
  const open = input.todos.filter(todo => todo.status !== 'completed');
30
20
  const remaining = (input.remaining ?? []).filter(item => item.trim());
31
- // A stand-in summary is the serialized output, never the model's own account of the work.
32
21
  const reportsUnfinished = !input.summaryStoodIn && (remaining.length > 0 || declaresUnfinishedWork(input.summary));
33
- // Open plan items the completion accounts for as unfinished belong to the unfinished gate; the
34
- // plan gate is for a plan left open under a completion that claims to be done.
35
22
  const failed = [
36
23
  ...(input.summaryStoodIn ? ['summary'] : []),
37
24
  ...(reportsUnfinished ? ['unfinished'] : open.length ? ['todos'] : []),
@@ -51,7 +38,6 @@ export function finalAnswerGate(input) {
51
38
  parts.push('It has no summary. The summary is the final answer the user reads; without one they see only the raw output object. Send summary as markdown (the outcome first, then what changed, how it was verified, and anything not done) and tests as one line per check that ran, or [] when none did, beside outcome and output.');
52
39
  }
53
40
  if (gates.includes('todos')) {
54
- // Ids and statuses only: the plan's text is model-authored and is already in the todo snapshot.
55
41
  const named = open.slice(0, MAX_NAMED_TODOS).map(todo => `${todo.id} (${todo.status})`).join(', ');
56
42
  const more = open.length > MAX_NAMED_TODOS ? `, and ${open.length - MAX_NAMED_TODOS} more` : '';
57
43
  parts.push(`The plan still lists ${open.length} unfinished ${open.length === 1 ? 'item' : 'items'}: ${named}${more}. Do the work that is left, using tools. For work that is already done, send update_todos with the true statuses in the same batch as complete_agent. Do not close an item, or ship a change you do not believe in, only to make the plan read as finished.`);