@andorra-labs/code 0.1.12 → 0.1.13

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 (592) hide show
  1. package/dist/src/account-presentation.d.ts +1 -37
  2. package/dist/src/account-presentation.js +2 -42
  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 +49 -416
  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 +9 -153
  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/anthropic-console-auth.d.ts +0 -24
  18. package/dist/src/anthropic-console-auth.js +0 -37
  19. package/dist/src/anthropic-credentials.d.ts +0 -25
  20. package/dist/src/anthropic-credentials.js +0 -28
  21. package/dist/src/app-server/protocol.d.ts +13 -245
  22. package/dist/src/app-server/protocol.js +1 -132
  23. package/dist/src/app-server/reasoning.d.ts +0 -31
  24. package/dist/src/app-server/reasoning.js +0 -54
  25. package/dist/src/app-server/terminal.d.ts +0 -36
  26. package/dist/src/app-server/terminal.js +3 -39
  27. package/dist/src/app-server/workspace.d.ts +0 -167
  28. package/dist/src/app-server/workspace.js +4 -406
  29. package/dist/src/app-server.d.ts +27 -927
  30. package/dist/src/app-server.js +537 -2992
  31. package/dist/src/artifacts.d.ts +0 -10
  32. package/dist/src/artifacts.js +1 -11
  33. package/dist/src/attachments.d.ts +4 -98
  34. package/dist/src/attachments.js +10 -130
  35. package/dist/src/auth/AuthManager.d.ts +0 -93
  36. package/dist/src/auth/AuthManager.js +3 -165
  37. package/dist/src/auth/callback-page.d.ts +0 -1
  38. package/dist/src/auth/callback-page.js +0 -4
  39. package/dist/src/auth/callback.d.ts +0 -25
  40. package/dist/src/auth/callback.js +1 -29
  41. package/dist/src/auth/deployment.d.ts +0 -16
  42. package/dist/src/auth/deployment.js +0 -16
  43. package/dist/src/auth/index.d.ts +0 -11
  44. package/dist/src/auth/index.js +0 -11
  45. package/dist/src/auth/lock.d.ts +0 -1
  46. package/dist/src/auth/lock.js +0 -1
  47. package/dist/src/auth/store.d.ts +7 -108
  48. package/dist/src/auth/store.js +21 -129
  49. package/dist/src/auth/types.d.ts +0 -8
  50. package/dist/src/auth-commands.d.ts +0 -5
  51. package/dist/src/auth-commands.js +0 -1
  52. package/dist/src/automation-runner.d.ts +0 -9
  53. package/dist/src/automation-runner.js +0 -11
  54. package/dist/src/automation-service.d.ts +0 -10
  55. package/dist/src/automation-service.js +3 -17
  56. package/dist/src/automation-tool.js +0 -5
  57. package/dist/src/automation-worker-shutdown.d.ts +0 -1
  58. package/dist/src/automation-worker-shutdown.js +0 -3
  59. package/dist/src/automations.d.ts +23 -2
  60. package/dist/src/automations.js +91 -12
  61. package/dist/src/background-tasks.d.ts +0 -23
  62. package/dist/src/background-tasks.js +0 -11
  63. package/dist/src/boot-trace.d.ts +0 -13
  64. package/dist/src/boot-trace.js +1 -14
  65. package/dist/src/browser-activity.js +0 -2
  66. package/dist/src/browser-bridge.d.ts +0 -2
  67. package/dist/src/browser-bridge.js +0 -27
  68. package/dist/src/browser-captcha-tool.d.ts +0 -13
  69. package/dist/src/browser-captcha-tool.js +3 -35
  70. package/dist/src/browser-extensions-tool.d.ts +24 -0
  71. package/dist/src/browser-extensions-tool.js +137 -0
  72. package/dist/src/browser-extensions.d.ts +127 -0
  73. package/dist/src/browser-extensions.js +729 -0
  74. package/dist/src/browser-observation.d.ts +0 -15
  75. package/dist/src/browser-observation.js +1 -22
  76. package/dist/src/browser-panel-tool.d.ts +1 -37
  77. package/dist/src/browser-panel-tool.js +3 -73
  78. package/dist/src/browser-runner.d.ts +0 -1
  79. package/dist/src/browser-runner.js +4 -45
  80. package/dist/src/browser-server.d.ts +0 -6
  81. package/dist/src/browser-server.js +6 -229
  82. package/dist/src/browser-session.d.ts +0 -25
  83. package/dist/src/browser-session.js +1 -71
  84. package/dist/src/browser-stealth.d.ts +0 -12
  85. package/dist/src/browser-stealth.js +0 -36
  86. package/dist/src/browser-ui/app.js +7 -174
  87. package/dist/src/browser-ui/style.css +0 -68
  88. package/dist/src/browser-ui/tokens.css +11 -93
  89. package/dist/src/browser-view.d.ts +47 -301
  90. package/dist/src/browser-view.js +333 -582
  91. package/dist/src/capabilities.d.ts +0 -8
  92. package/dist/src/capabilities.js +0 -29
  93. package/dist/src/capsolver.d.ts +0 -13
  94. package/dist/src/capsolver.js +0 -15
  95. package/dist/src/clarification-ui.d.ts +0 -7
  96. package/dist/src/clarification-ui.js +0 -8
  97. package/dist/src/claude-executable.d.ts +0 -1
  98. package/dist/src/claude-executable.js +1 -2
  99. package/dist/src/claude-provider.d.ts +6 -19
  100. package/dist/src/claude-provider.js +155 -63
  101. package/dist/src/cli-executable.d.ts +0 -16
  102. package/dist/src/cli-executable.js +0 -7
  103. package/dist/src/cli-process.d.ts +0 -26
  104. package/dist/src/cli-process.js +0 -18
  105. package/dist/src/cli-sign-in.d.ts +0 -20
  106. package/dist/src/cli-sign-in.js +1 -17
  107. package/dist/src/cli.d.ts +1 -55
  108. package/dist/src/cli.js +80 -721
  109. package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +4 -59
  110. package/dist/src/code-intelligence/CodeIntelligenceManager.js +26 -99
  111. package/dist/src/code-intelligence/ContextLedger.d.ts +0 -4
  112. package/dist/src/code-intelligence/ContextLedger.js +0 -10
  113. package/dist/src/code-intelligence/ContextRouter.d.ts +0 -6
  114. package/dist/src/code-intelligence/ContextRouter.js +0 -8
  115. package/dist/src/code-intelligence/codegraph/CodeGraphProjectSession.d.ts +0 -2
  116. package/dist/src/code-intelligence/codegraph/CodeGraphProjectSession.js +5 -12
  117. package/dist/src/code-intelligence/codegraph/CodeGraphProvider.d.ts +0 -6
  118. package/dist/src/code-intelligence/codegraph/CodeGraphProvider.js +0 -6
  119. package/dist/src/code-intelligence/codegraph/CodeGraphSyncBarrier.d.ts +0 -5
  120. package/dist/src/code-intelligence/codegraph/CodeGraphSyncBarrier.js +1 -17
  121. package/dist/src/code-intelligence/codegraph/repoExploreTool.d.ts +0 -5
  122. package/dist/src/code-intelligence/codegraph/repoExploreTool.js +0 -5
  123. package/dist/src/code-intelligence/repository.d.ts +0 -9
  124. package/dist/src/code-intelligence/repository.js +1 -11
  125. package/dist/src/code-intelligence/types.d.ts +0 -8
  126. package/dist/src/codex-auth.d.ts +0 -44
  127. package/dist/src/codex-auth.js +0 -45
  128. package/dist/src/codex-browser-auth.d.ts +0 -13
  129. package/dist/src/codex-browser-auth.js +3 -20
  130. package/dist/src/codex-errors.js +0 -2
  131. package/dist/src/codex-executable.d.ts +0 -2
  132. package/dist/src/codex-executable.js +1 -7
  133. package/dist/src/codex-provider.d.ts +0 -13
  134. package/dist/src/codex-provider.js +0 -28
  135. package/dist/src/codex-rpc.d.ts +0 -10
  136. package/dist/src/codex-rpc.js +0 -12
  137. package/dist/src/coding-tools.d.ts +4 -26
  138. package/dist/src/coding-tools.js +161 -181
  139. package/dist/src/command-metrics.d.ts +0 -4
  140. package/dist/src/command-output-tap.d.ts +0 -11
  141. package/dist/src/command-output-tap.js +0 -3
  142. package/dist/src/command-screens.d.ts +24 -0
  143. package/dist/src/command-screens.js +132 -100
  144. package/dist/src/commands.d.ts +6 -63
  145. package/dist/src/commands.js +20 -100
  146. package/dist/src/completion-gates.d.ts +0 -47
  147. package/dist/src/completion-gates.js +0 -14
  148. package/dist/src/completion.d.ts +0 -98
  149. package/dist/src/completion.js +2 -239
  150. package/dist/src/config.d.ts +11 -116
  151. package/dist/src/config.js +39 -171
  152. package/dist/src/context-budget.d.ts +0 -22
  153. package/dist/src/context-budget.js +0 -44
  154. package/dist/src/context-compaction.d.ts +29 -6
  155. package/dist/src/context-compaction.js +94 -25
  156. package/dist/src/context-selection.d.ts +0 -24
  157. package/dist/src/context-selection.js +0 -34
  158. package/dist/src/dashboard-view.d.ts +0 -2
  159. package/dist/src/dashboard-view.js +0 -35
  160. package/dist/src/dashboard.d.ts +0 -2
  161. package/dist/src/dashboard.js +0 -9
  162. package/dist/src/deadline.d.ts +0 -45
  163. package/dist/src/deadline.js +0 -54
  164. package/dist/src/decision/ContinuationAdapter.d.ts +0 -5
  165. package/dist/src/decision/ContinuationAdapter.js +0 -5
  166. package/dist/src/decision/DecisionEngine.d.ts +0 -4
  167. package/dist/src/decision/DecisionManager.d.ts +0 -1
  168. package/dist/src/decision/DecisionManager.js +2 -7
  169. package/dist/src/decision/DecisionPolicy.d.ts +0 -1
  170. package/dist/src/decision/DecisionPolicy.js +0 -1
  171. package/dist/src/decision/FactContinuations.d.ts +11 -43
  172. package/dist/src/decision/FactContinuations.js +126 -95
  173. package/dist/src/decision/FactServiceGate.d.ts +0 -1
  174. package/dist/src/decision/FactServiceGate.js +0 -4
  175. package/dist/src/decision/PreparedSteps.d.ts +0 -15
  176. package/dist/src/decision/PreparedSteps.js +0 -10
  177. package/dist/src/decision/applyToolMenu.d.ts +0 -1
  178. package/dist/src/decision/applyToolMenu.js +1 -5
  179. package/dist/src/decision/checks.d.ts +15 -28
  180. package/dist/src/decision/checks.js +118 -49
  181. package/dist/src/decision/facts.d.ts +0 -16
  182. package/dist/src/decision/facts.js +0 -30
  183. package/dist/src/decision/guidancePolicy.js +0 -1
  184. package/dist/src/decision/hostedPolicy.d.ts +0 -6
  185. package/dist/src/decision/hostedPolicy.js +0 -7
  186. package/dist/src/decision/hostedSkills.d.ts +0 -19
  187. package/dist/src/decision/hostedSkills.js +0 -19
  188. package/dist/src/decision/optimizationPolicy.d.ts +0 -3
  189. package/dist/src/decision/optimizationPolicy.js +1 -4
  190. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +0 -7
  191. package/dist/src/decision/providers/AndorraDecisionProvider.js +4 -27
  192. package/dist/src/decision/providers/HttpDecisionProvider.d.ts +0 -2
  193. package/dist/src/decision/providers/HttpDecisionProvider.js +0 -6
  194. package/dist/src/decision/routeTools.d.ts +0 -8
  195. package/dist/src/decision/routeTools.js +1 -8
  196. package/dist/src/decision/toolFamilies.d.ts +0 -1
  197. package/dist/src/decision/toolFamilies.js +0 -1
  198. package/dist/src/decision/toolMenu.d.ts +0 -3
  199. package/dist/src/decision/toolMenu.js +0 -4
  200. package/dist/src/decision/types.d.ts +0 -6
  201. package/dist/src/default-graph.d.ts +0 -9
  202. package/dist/src/default-graph.js +0 -9
  203. package/dist/src/delegation-changes.d.ts +0 -56
  204. package/dist/src/delegation-changes.js +4 -130
  205. package/dist/src/diff-preview.d.ts +0 -1
  206. package/dist/src/diff-preview.js +0 -17
  207. package/dist/src/duration.d.ts +0 -50
  208. package/dist/src/duration.js +0 -50
  209. package/dist/src/efficiency.d.ts +0 -39
  210. package/dist/src/efficiency.js +0 -16
  211. package/dist/src/engine/protocol.d.ts +0 -2
  212. package/dist/src/engine/protocol.js +0 -2
  213. package/dist/src/engine-streams.d.ts +0 -9
  214. package/dist/src/extensions.d.ts +3 -2
  215. package/dist/src/extensions.js +63 -35
  216. package/dist/src/favicons.d.ts +0 -26
  217. package/dist/src/favicons.js +0 -34
  218. package/dist/src/file-diff.d.ts +2 -58
  219. package/dist/src/file-diff.js +0 -32
  220. package/dist/src/file-read-key.d.ts +0 -7
  221. package/dist/src/file-read-key.js +0 -7
  222. package/dist/src/file-read-state.d.ts +0 -1
  223. package/dist/src/file-read-state.js +0 -4
  224. package/dist/src/firefox-cookies.d.ts +0 -34
  225. package/dist/src/firefox-cookies.js +1 -55
  226. package/dist/src/git-identity-audit.d.ts +27 -0
  227. package/dist/src/git-identity-audit.js +286 -0
  228. package/dist/src/git-identity-guard.d.ts +4 -0
  229. package/dist/src/git-identity-guard.js +998 -0
  230. package/dist/src/git-identity-hold.d.ts +12 -0
  231. package/dist/src/git-identity-hold.js +81 -0
  232. package/dist/src/git-summary.d.ts +0 -58
  233. package/dist/src/git-summary.js +2 -212
  234. package/dist/src/goal-completion-verification.d.ts +2 -2
  235. package/dist/src/goal-completion-verification.js +3 -6
  236. package/dist/src/graph-account.d.ts +0 -21
  237. package/dist/src/graph-account.js +0 -17
  238. package/dist/src/graph-editor-session.d.ts +0 -1
  239. package/dist/src/graph-editor-session.js +0 -3
  240. package/dist/src/graph-health.d.ts +0 -63
  241. package/dist/src/graph-health.js +0 -57
  242. package/dist/src/graph-manager-chat.d.ts +5 -155
  243. package/dist/src/graph-manager-chat.js +2 -177
  244. package/dist/src/graph-provider-portability.d.ts +1 -21
  245. package/dist/src/graph-provider-portability.js +6 -45
  246. package/dist/src/graph-quota.d.ts +0 -33
  247. package/dist/src/graph-quota.js +1 -44
  248. package/dist/src/graph-runner.d.ts +0 -1
  249. package/dist/src/graph-runner.js +31 -391
  250. package/dist/src/graph-selection.d.ts +0 -14
  251. package/dist/src/graph-selection.js +0 -14
  252. package/dist/src/graph-server.d.ts +2 -10
  253. package/dist/src/graph-server.js +39 -101
  254. package/dist/src/graph-studio-features.d.ts +0 -5
  255. package/dist/src/graph-studio-features.js +2 -42
  256. package/dist/src/graph-sync.d.ts +0 -78
  257. package/dist/src/graph-sync.js +5 -201
  258. package/dist/src/graph-tool.d.ts +0 -18
  259. package/dist/src/graph-tool.js +0 -27
  260. package/dist/src/graph-ui/app.js +152 -491
  261. package/dist/src/graph-ui/compat.js +0 -7
  262. package/dist/src/graph-ui/controls.css +0 -48
  263. package/dist/src/graph-ui/controls.js +0 -88
  264. package/dist/src/graph-ui/drafts.js +0 -12
  265. package/dist/src/graph-ui/edge-router.js +0 -62
  266. package/dist/src/graph-ui/embed.js +0 -59
  267. package/dist/src/graph-ui/icons.js +0 -8
  268. package/dist/src/graph-ui/library.css +0 -5
  269. package/dist/src/graph-ui/manager-markdown.js +0 -11
  270. package/dist/src/graph-ui/manager-state.js +1 -78
  271. package/dist/src/graph-ui/manager.css +0 -18
  272. package/dist/src/graph-ui/manager.js +3 -180
  273. package/dist/src/graph-ui/model-picker.js +0 -29
  274. package/dist/src/graph-ui/sidebar.js +2 -3
  275. package/dist/src/graph-ui/skill-picker.js +373 -39
  276. package/dist/src/graph-ui/studio-canvas.js +3 -38
  277. package/dist/src/graph-ui/studio.css +0 -18
  278. package/dist/src/graph-ui/studio.js +3 -71
  279. package/dist/src/graph-ui/style.css +11 -134
  280. package/dist/src/graph-ui/theme.js +1 -26
  281. package/dist/src/graph-ui/tokens.css +15 -114
  282. package/dist/src/graphs.d.ts +6 -157
  283. package/dist/src/graphs.js +65 -266
  284. package/dist/src/grep-regex-worker.js +0 -2
  285. package/dist/src/grep-regex.d.ts +1 -5
  286. package/dist/src/grep-regex.js +6 -8
  287. package/dist/src/grok-provider.d.ts +0 -17
  288. package/dist/src/grok-provider.js +1 -26
  289. package/dist/src/handoffs.d.ts +0 -11
  290. package/dist/src/handoffs.js +0 -13
  291. package/dist/src/hardened-runtime.d.ts +0 -10
  292. package/dist/src/hardened-runtime.js +8 -46
  293. package/dist/src/harness-home.d.ts +21 -0
  294. package/dist/src/harness-home.js +87 -0
  295. package/dist/src/host-process-guard.d.ts +0 -50
  296. package/dist/src/host-process-guard.js +0 -641
  297. package/dist/src/limits.d.ts +0 -64
  298. package/dist/src/limits.js +0 -62
  299. package/dist/src/managed-sign-in.d.ts +0 -12
  300. package/dist/src/managed-sign-in.js +0 -16
  301. package/dist/src/markdown.d.ts +0 -28
  302. package/dist/src/markdown.js +1 -175
  303. package/dist/src/mcp.d.ts +0 -99
  304. package/dist/src/mcp.js +4 -170
  305. package/dist/src/membership-errors.d.ts +0 -14
  306. package/dist/src/membership-errors.js +0 -13
  307. package/dist/src/membership.d.ts +2 -60
  308. package/dist/src/membership.js +0 -85
  309. package/dist/src/memory/LocalToolMemory.d.ts +0 -1
  310. package/dist/src/memory/LocalToolMemory.js +2 -7
  311. package/dist/src/memory/MemoryDistiller.js +0 -15
  312. package/dist/src/memory/MemoryManager.d.ts +0 -3
  313. package/dist/src/memory/MemoryManager.js +6 -18
  314. package/dist/src/memory/MemoryPolicy.d.ts +0 -2
  315. package/dist/src/memory/MemoryPolicy.js +0 -2
  316. package/dist/src/memory/MemoryProvider.d.ts +0 -6
  317. package/dist/src/memory/MemoryRetriever.js +0 -7
  318. package/dist/src/memory/PermissionMemoryProvider.d.ts +0 -1
  319. package/dist/src/memory/PermissionMemoryProvider.js +0 -1
  320. package/dist/src/memory/ProjectMemory.d.ts +5 -40
  321. package/dist/src/memory/ProjectMemory.js +22 -47
  322. package/dist/src/memory/ToolFailureLessons.d.ts +0 -3
  323. package/dist/src/memory/ToolFailureLessons.js +0 -6
  324. package/dist/src/memory/providers/NoOpMemoryProvider.d.ts +0 -1
  325. package/dist/src/memory/providers/NoOpMemoryProvider.js +0 -1
  326. package/dist/src/memory/redaction.d.ts +0 -5
  327. package/dist/src/memory/redaction.js +0 -11
  328. package/dist/src/memory/repository.d.ts +0 -6
  329. package/dist/src/memory/repository.js +2 -12
  330. package/dist/src/memory/types.d.ts +0 -1
  331. package/dist/src/model-health-cache.d.ts +0 -38
  332. package/dist/src/model-health-cache.js +1 -49
  333. package/dist/src/model-metadata.d.ts +0 -18
  334. package/dist/src/model-metadata.js +2 -42
  335. package/dist/src/model-override.d.ts +0 -36
  336. package/dist/src/model-override.js +0 -43
  337. package/dist/src/model-tiers.d.ts +0 -13
  338. package/dist/src/model-tiers.js +0 -23
  339. package/dist/src/opencode-catalog.d.ts +0 -2
  340. package/dist/src/opencode-catalog.js +0 -11
  341. package/dist/src/opencode-cli-provider.d.ts +0 -35
  342. package/dist/src/opencode-cli-provider.js +1 -44
  343. package/dist/src/opencode-provider.d.ts +0 -2
  344. package/dist/src/opencode-provider.js +1 -16
  345. package/dist/src/package-name.d.ts +0 -2
  346. package/dist/src/package-name.js +0 -2
  347. package/dist/src/paged-transcript.d.ts +0 -11
  348. package/dist/src/paged-transcript.js +2 -20
  349. package/dist/src/palette.d.ts +0 -63
  350. package/dist/src/palette.js +0 -63
  351. package/dist/src/permissions.d.ts +0 -15
  352. package/dist/src/permissions.js +0 -17
  353. package/dist/src/powershell-pool.d.ts +0 -9
  354. package/dist/src/powershell-pool.js +3 -26
  355. package/dist/src/process-warnings.d.ts +4 -0
  356. package/dist/src/process-warnings.js +103 -0
  357. package/dist/src/profile.d.ts +0 -43
  358. package/dist/src/profile.js +0 -43
  359. package/dist/src/project-reservation.d.ts +11 -0
  360. package/dist/src/project-reservation.js +143 -0
  361. package/dist/src/provider-connection.d.ts +0 -18
  362. package/dist/src/provider-connection.js +0 -39
  363. package/dist/src/provider-engine.d.ts +0 -21
  364. package/dist/src/provider-engine.js +1 -96
  365. package/dist/src/provider-import.d.ts +0 -49
  366. package/dist/src/provider-import.js +0 -60
  367. package/dist/src/provider-keys.d.ts +1 -36
  368. package/dist/src/provider-keys.js +5 -48
  369. package/dist/src/provider-settings.d.ts +0 -2
  370. package/dist/src/provider-settings.js +0 -32
  371. package/dist/src/providers.d.ts +0 -217
  372. package/dist/src/providers.js +0 -315
  373. package/dist/src/pull-requests.d.ts +0 -173
  374. package/dist/src/pull-requests.js +5 -195
  375. package/dist/src/qa/browser/PlaywrightRunner.d.ts +0 -7
  376. package/dist/src/qa/browser/PlaywrightRunner.js +2 -16
  377. package/dist/src/qa/command-policy.d.ts +0 -23
  378. package/dist/src/qa/command-policy.js +0 -30
  379. package/dist/src/qa/guidance.d.ts +0 -21
  380. package/dist/src/qa/guidance.js +0 -20
  381. package/dist/src/qa/profile/ProjectInspector.d.ts +0 -4
  382. package/dist/src/qa/profile/ProjectInspector.js +0 -6
  383. package/dist/src/qa/profile/QaConfigLoader.d.ts +0 -7
  384. package/dist/src/qa/profile/QaConfigLoader.js +0 -6
  385. package/dist/src/qa/profile/QaProfile.d.ts +0 -7
  386. package/dist/src/qa/profile/QaProfile.js +0 -7
  387. package/dist/src/qa/profile/yaml.d.ts +0 -9
  388. package/dist/src/qa/profile/yaml.js +0 -13
  389. package/dist/src/qa/qa-authorize.d.ts +0 -19
  390. package/dist/src/qa/qa-authorize.js +4 -11
  391. package/dist/src/qa/runtime/ProcessManager.d.ts +0 -31
  392. package/dist/src/qa/runtime/ProcessManager.js +4 -41
  393. package/dist/src/qa/runtime/PtyManager.d.ts +0 -4
  394. package/dist/src/qa/runtime/PtyManager.js +1 -7
  395. package/dist/src/qa/runtime/changes.d.ts +0 -11
  396. package/dist/src/qa/runtime/changes.js +1 -3
  397. package/dist/src/qa/tools.d.ts +0 -10
  398. package/dist/src/qa/tools.js +0 -12
  399. package/dist/src/qa/types.d.ts +0 -13
  400. package/dist/src/react-runtime.d.ts +2 -21
  401. package/dist/src/react-runtime.js +95 -415
  402. package/dist/src/read-document-doc.d.ts +0 -6
  403. package/dist/src/read-document-doc.js +0 -55
  404. package/dist/src/read-document-docx.d.ts +0 -16
  405. package/dist/src/read-document-docx.js +2 -69
  406. package/dist/src/read-document-text.d.ts +0 -17
  407. package/dist/src/read-document-text.js +0 -22
  408. package/dist/src/read-document-tool.d.ts +0 -31
  409. package/dist/src/read-document-tool.js +0 -30
  410. package/dist/src/read-document.d.ts +0 -49
  411. package/dist/src/read-document.js +1 -67
  412. package/dist/src/read-image.d.ts +0 -32
  413. package/dist/src/read-image.js +0 -33
  414. package/dist/src/remote/cert.d.ts +0 -18
  415. package/dist/src/remote/cert.js +0 -44
  416. package/dist/src/remote/client.d.ts +0 -70
  417. package/dist/src/remote/client.js +1 -116
  418. package/dist/src/remote/command.js +0 -17
  419. package/dist/src/remote/engine-pool.d.ts +0 -152
  420. package/dist/src/remote/engine-pool.js +17 -335
  421. package/dist/src/remote/errors.d.ts +0 -15
  422. package/dist/src/remote/errors.js +0 -7
  423. package/dist/src/remote/network.d.ts +0 -26
  424. package/dist/src/remote/network.js +1 -34
  425. package/dist/src/remote/pairing.d.ts +16 -51
  426. package/dist/src/remote/pairing.js +50 -57
  427. package/dist/src/remote/pem.d.ts +0 -4
  428. package/dist/src/remote/pem.js +0 -4
  429. package/dist/src/remote/roots.d.ts +0 -20
  430. package/dist/src/remote/roots.js +0 -8
  431. package/dist/src/remote/serve.d.ts +0 -47
  432. package/dist/src/remote/serve.js +0 -30
  433. package/dist/src/remote/server.d.ts +0 -14
  434. package/dist/src/remote/server.js +1 -79
  435. package/dist/src/remote/types.d.ts +1 -32
  436. package/dist/src/remote/types.js +0 -10
  437. package/dist/src/run-control.d.ts +0 -7
  438. package/dist/src/run-control.js +0 -7
  439. package/dist/src/run-progress.d.ts +0 -170
  440. package/dist/src/run-progress.js +0 -285
  441. package/dist/src/run-records.d.ts +0 -443
  442. package/dist/src/run-records.js +14 -687
  443. package/dist/src/run-temp.d.ts +12 -0
  444. package/dist/src/run-temp.js +50 -0
  445. package/dist/src/runtime.d.ts +10 -228
  446. package/dist/src/runtime.js +0 -127
  447. package/dist/src/sandbox-child.js +0 -1
  448. package/dist/src/save-lock.d.ts +0 -12
  449. package/dist/src/save-lock.js +0 -28
  450. package/dist/src/screen-selection.d.ts +0 -23
  451. package/dist/src/screen-selection.js +0 -22
  452. package/dist/src/secret-redaction.d.ts +0 -12
  453. package/dist/src/secret-redaction.js +0 -45
  454. package/dist/src/session-changes.d.ts +4 -80
  455. package/dist/src/session-changes.js +25 -130
  456. package/dist/src/session-goal.d.ts +129 -0
  457. package/dist/src/session-goal.js +230 -0
  458. package/dist/src/session-monitor.d.ts +1 -10
  459. package/dist/src/session-monitor.js +2 -39
  460. package/dist/src/session-reaper.d.ts +0 -15
  461. package/dist/src/session-reaper.js +0 -14
  462. package/dist/src/session-skills.d.ts +15 -44
  463. package/dist/src/session-skills.js +75 -60
  464. package/dist/src/session-summary.d.ts +0 -26
  465. package/dist/src/session-summary.js +0 -32
  466. package/dist/src/session-title.d.ts +0 -1
  467. package/dist/src/session-title.js +0 -2
  468. package/dist/src/sessions.d.ts +2 -122
  469. package/dist/src/sessions.js +7 -178
  470. package/dist/src/shell.d.ts +3 -20
  471. package/dist/src/shell.js +8 -72
  472. package/dist/src/side-panel.d.ts +5 -99
  473. package/dist/src/side-panel.js +76 -133
  474. package/dist/src/sign-in-detection.d.ts +0 -39
  475. package/dist/src/sign-in-detection.js +0 -43
  476. package/dist/src/sign-in-offer.d.ts +1 -19
  477. package/dist/src/sign-in-offer.js +0 -13
  478. package/dist/src/skill-commands.d.ts +0 -1
  479. package/dist/src/skill-commands.js +1 -4
  480. package/dist/src/skills/bundled/control-browser/SKILL.md +1 -1
  481. package/dist/src/skills/bundled/provenance.json +1 -1
  482. package/dist/src/skills/invocable-skills.d.ts +0 -18
  483. package/dist/src/skills/invocable-skills.js +0 -17
  484. package/dist/src/skills/project-skills.d.ts +0 -1
  485. package/dist/src/skills/project-skills.js +0 -3
  486. package/dist/src/skills/prompt-skills.js +0 -14
  487. package/dist/src/skills/runtime-skills.d.ts +0 -13
  488. package/dist/src/skills/runtime-skills.js +0 -37
  489. package/dist/src/stall-recovery.d.ts +0 -25
  490. package/dist/src/stall-recovery.js +0 -38
  491. package/dist/src/stray-files.d.ts +0 -9
  492. package/dist/src/stray-files.js +0 -16
  493. package/dist/src/structured-step.d.ts +0 -22
  494. package/dist/src/structured-step.js +0 -22
  495. package/dist/src/subagent-run.d.ts +0 -163
  496. package/dist/src/subagent-run.js +4 -373
  497. package/dist/src/subagent-tree.d.ts +32 -0
  498. package/dist/src/subagent-tree.js +128 -0
  499. package/dist/src/telemetry/aggregate.d.ts +0 -37
  500. package/dist/src/telemetry/aggregate.js +0 -40
  501. package/dist/src/telemetry/capture-core.d.ts +0 -87
  502. package/dist/src/telemetry/capture-core.js +0 -67
  503. package/dist/src/telemetry/capture.d.ts +0 -1
  504. package/dist/src/telemetry/capture.js +0 -3
  505. package/dist/src/telemetry/classify.d.ts +0 -58
  506. package/dist/src/telemetry/classify.js +0 -60
  507. package/dist/src/telemetry/decision-capture.d.ts +0 -1
  508. package/dist/src/telemetry/emitter.d.ts +0 -30
  509. package/dist/src/telemetry/emitter.js +1 -62
  510. package/dist/src/telemetry/gate.d.ts +0 -29
  511. package/dist/src/telemetry/gate.js +0 -22
  512. package/dist/src/telemetry/identity.d.ts +0 -13
  513. package/dist/src/telemetry/identity.js +0 -29
  514. package/dist/src/telemetry/outbox.d.ts +0 -64
  515. package/dist/src/telemetry/outbox.js +1 -108
  516. package/dist/src/telemetry/schema.d.ts +1 -49
  517. package/dist/src/telemetry/schema.js +1 -82
  518. package/dist/src/telemetry/state.d.ts +0 -53
  519. package/dist/src/telemetry/state.js +0 -64
  520. package/dist/src/telemetry/surface.d.ts +0 -31
  521. package/dist/src/telemetry/surface.js +1 -39
  522. package/dist/src/telemetry/uploader.d.ts +0 -11
  523. package/dist/src/telemetry/uploader.js +0 -46
  524. package/dist/src/telemetry/uploads.d.ts +0 -11
  525. package/dist/src/telemetry/uploads.js +0 -11
  526. package/dist/src/telemetry/version.d.ts +0 -4
  527. package/dist/src/telemetry/version.js +0 -14
  528. package/dist/src/telemetry/workspace.d.ts +0 -7
  529. package/dist/src/telemetry/workspace.js +1 -22
  530. package/dist/src/terminal-ui.d.ts +14 -523
  531. package/dist/src/terminal-ui.js +74 -876
  532. package/dist/src/test-edit-guard.d.ts +74 -0
  533. package/dist/src/test-edit-guard.js +269 -0
  534. package/dist/src/text.d.ts +0 -1
  535. package/dist/src/text.js +0 -1
  536. package/dist/src/time-limit.d.ts +0 -36
  537. package/dist/src/time-limit.js +0 -37
  538. package/dist/src/timers.d.ts +0 -161
  539. package/dist/src/timers.js +0 -126
  540. package/dist/src/todos.d.ts +0 -1
  541. package/dist/src/todos.js +0 -3
  542. package/dist/src/token-rate.d.ts +0 -94
  543. package/dist/src/token-rate.js +0 -154
  544. package/dist/src/tool-activity.d.ts +0 -6
  545. package/dist/src/tool-activity.js +0 -7
  546. package/dist/src/tool-availability.d.ts +0 -13
  547. package/dist/src/tool-availability.js +1 -14
  548. package/dist/src/tool-call-clock.d.ts +1 -4
  549. package/dist/src/tool-call-clock.js +0 -13
  550. package/dist/src/tool-catalog.d.ts +0 -11
  551. package/dist/src/tool-catalog.js +0 -23
  552. package/dist/src/tool-dependencies.d.ts +0 -5
  553. package/dist/src/tool-dependencies.js +0 -4
  554. package/dist/src/tool-diff-stats.d.ts +0 -23
  555. package/dist/src/tool-diff-stats.js +0 -49
  556. package/dist/src/tool-errors.d.ts +9 -7
  557. package/dist/src/tool-errors.js +13 -6
  558. package/dist/src/tool-failure-tracker.d.ts +3 -11
  559. package/dist/src/tool-failure-tracker.js +19 -27
  560. package/dist/src/tool-names.d.ts +0 -16
  561. package/dist/src/tool-names.js +0 -12
  562. package/dist/src/tool-profile.d.ts +6 -0
  563. package/dist/src/tool-profile.js +23 -0
  564. package/dist/src/tool-result-filter.d.ts +0 -19
  565. package/dist/src/tool-result-filter.js +1 -66
  566. package/dist/src/tool-schema-compatibility.d.ts +0 -6
  567. package/dist/src/tool-schema-compatibility.js +0 -9
  568. package/dist/src/tools.d.ts +0 -4
  569. package/dist/src/tools.js +11 -114
  570. package/dist/src/trajectory.d.ts +0 -13
  571. package/dist/src/trajectory.js +23 -79
  572. package/dist/src/transcript.d.ts +0 -41
  573. package/dist/src/transcript.js +2 -60
  574. package/dist/src/types.d.ts +1 -168
  575. package/dist/src/untracked-file-removal.js +0 -20
  576. package/dist/src/update-check.d.ts +0 -14
  577. package/dist/src/update-check.js +1 -15
  578. package/dist/src/update.d.ts +0 -35
  579. package/dist/src/update.js +0 -100
  580. package/dist/src/usage-analytics.d.ts +17 -17
  581. package/dist/src/usage-analytics.js +168 -209
  582. package/dist/src/web-search.d.ts +0 -23
  583. package/dist/src/web-search.js +1 -27
  584. package/dist/src/widgets.d.ts +0 -25
  585. package/dist/src/widgets.js +0 -24
  586. package/dist/src/workspace-facts.d.ts +0 -12
  587. package/dist/src/workspace-facts.js +1 -18
  588. package/dist/src/workspace-git-metadata.d.ts +0 -16
  589. package/dist/src/workspace-git-metadata.js +0 -21
  590. package/dist/src/workspace-instructions.d.ts +3 -15
  591. package/dist/src/workspace-instructions.js +6 -19
  592. package/package.json +2 -2
@@ -1,38 +1,25 @@
1
- /**
2
- * Every check runner a shell command line contains, each as the command that would run on its own.
3
- * Control flow is unwrapped (`if`, `then`, `do`, `else`, braces, parentheses), so a runner nested in
4
- * a conditional is never missed. Undefined when anything else is in the line (`cd sub`, `FOO=1 npm
5
- * test`, a standalone assertion, another program): the runners' standalone results would then not
6
- * say what the line verified.
7
- */
8
1
  export declare function checkRunners(line: string): string[] | undefined;
9
2
  export declare function commandLine(args: unknown): string | undefined;
10
3
  export declare function isCheckCall(name: string, family: string | undefined, args: unknown): boolean;
11
4
  export declare function isReplaySafeCheck(name: string, family: string | undefined, args: unknown): boolean;
12
- /** A check that can establish a pass on the final workspace, not merely contain a check. */
13
5
  export declare function isVerificationCheck(name: string, family: string | undefined, args: unknown): boolean;
14
- /**
15
- * A declared check without the output filter that would hide its exit status: `pytest -q 2>&1 |
16
- * tail -20` verifies exactly what `pytest -q 2>&1` verifies, and only the second reports it.
17
- */
18
6
  export declare function stripOutputFilter(line: string): string;
7
+ export declare function declaredCheckKind(line: string): 'chain' | 'opaque' | undefined;
8
+ export declare function replayableCheck(line: string): string | undefined;
19
9
  /**
20
- * What a command the model named as its own verification can prove by exiting 0.
21
- *
22
- * `chain`: every step runs only if the one before succeeded (`&&`) and at least one step is a
23
- * recognized check runner, so exit 0 means that runner passed (`cd build && ctest`,
24
- * `PYTHONPATH=. python -m pytest -q`, `gcc -o t t.c && ./t`). `opaque`: the exit status is
25
- * faithful but nothing in the line is a known runner (`./run_tests.sh`), so exit 0 alone does not
26
- * settle it and the output has to be interpreted. One command fed by a here-document (`python3 -
27
- * <<'PY' ... PY`) is opaque too: the script is its input, not more shell. Undefined when the line
28
- * can hide a failure: a pipe, `;`, `||`, a background job, a substitution or a redirect.
10
+ * Reads the verdict a test runner printed, whatever command produced it. A project's own runner
11
+ * (`python tests/runtests.py`, `bin/test`, a Makefile target) is not in the runner table, but its
12
+ * summary line is still evidence that tests ran. Returns true or false when a summary reports the
13
+ * result, and undefined when the output holds no recognisable test summary.
29
14
  */
30
- export declare function declaredCheckKind(line: string): 'chain' | 'opaque' | undefined;
15
+ export declare function testRunVerdict(output: string): boolean | undefined;
31
16
  /**
32
- * The form of a check the model ran in which the runtime may run it again after an edit, or
33
- * undefined when it may not. Every step is a known runner or a `cd`, chained with `&&` only, so
34
- * running it twice does what running it once did and its exit status reports the result. An output
35
- * filter and the no-op `cd "$(pwd)" &&` are dropped; a mutating mode (`--fix`, `-u`) or anything
36
- * else in the line (setup, cleanup, a script) leaves the next run to the model.
17
+ * The command to run again for a test run the model made itself, or undefined when replaying it is
18
+ * not plainly the same test run: the stages after the first pipe may only trim what is shown (tail,
19
+ * head, grep, cat), and what is left is one command, optionally after `cd <dir> &&`, with no redirect,
20
+ * substitution, heredoc, `;`, `||` or file-changing mode, and not a program that changes the workspace. The display stages are dropped, so a failing rerun
21
+ * returns the runner's own output and exit status.
37
22
  */
38
- export declare function replayableCheck(line: string): string | undefined;
23
+ export declare function replayableTestRun(line: string): string | undefined;
24
+ /** True for a command that only shows existing output, such as `cat /tmp/test-output.log`: a summary it prints is not a test run. */
25
+ export declare function onlyDisplaysOutput(line: string): boolean;
@@ -1,18 +1,9 @@
1
- /** Recognition is deliberately broader than replay/verification authority. */
2
- /** A directory in front of an executable: `.venv/bin/`, `/tmp/qa-venv/bin/`, `./node_modules/.bin/`. */
3
1
  const BIN = String.raw `(?:[\w.~@+\-\\/:]*[\\/])?`;
4
- /** Wrappers that run the same check under a deadline or inside a project environment (`timeout 120 uv run --with pytest ...`). */
5
2
  const LAUNCH = String.raw `(?:time\s+)?(?:timeout\s+(?:-[\w-]+\s+)*\d+[smh]?\s+)?(?:(?:uv|poetry|pipenv|pdm|hatch|rye)\s+run\s+(?:(?:--with(?:-[\w-]+)?|--python|-p|--extra|--group|--project|--directory)[=\s]\S+\s+|--(?:frozen|locked|no-sync|no-project|isolated|quiet|offline|all-extras|no-dev|dev)\s+|-q\s+)*(?:--\s+)?)?`;
6
3
  const PYTHON = String.raw `(?:${BIN}python[\d.]*\s+(?:-[BEIOsSuX]+\s+)*-m\s+)?`;
7
4
  const RUNNER = String.raw `${LAUNCH}(?:${BIN}node\s+--test\b|${PYTHON}${BIN}(?:pytest|py\.test|unittest|mypy|compileall|py_compile)\b|(?:(?:npx|bunx)\s+(?:--no-install\s+|--yes\s+|-y\s+)?|pnpm\s+exec\s+)?${BIN}(?:jest|vitest|tsc|eslint|mocha|ava|ruff|ctest)\b|npx\s+playwright\s+test\b|(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:test|build|lint|typecheck|type-check|check|verify)\b|cargo\s+(?:\+[\w.-]+\s+)?(?:test|build|check|clippy)\b|go\s+(?:test|build|vet)\b|dotnet\s+(?:test|build)\b|mvn\s+(?:test|verify)\b|\.?[\\/]?gradlew?(?:\.bat)?\s+(?:test|build|check)\b|make\s+(?:test|check)\b|make(?:\s+-C\s+\S+|\s+-j\s*\d*)*\s*$|cmake\s+--build\b|${BIN}(?:gcc|g\+\+|cc|c\+\+|clang|clang\+\+)\s)`;
8
5
  const RUNNER_AT_START = new RegExp(`^${RUNNER}`, 'i');
9
- /** A known check runner at the start of a command. `pytest --version` or `tsc --help` starts like one and checks nothing. */
10
6
  const runner = (part) => RUNNER_AT_START.test(part) && !/(?:^|\s)(?:--version|-V|--help)(?:\s|$)/.test(part);
11
- /**
12
- * Glue that can sit between runners without changing what they verify: messages, exit, block ends,
13
- * output filters, and a test only as the condition of if/elif/while/until. On its own a test is an
14
- * assertion (`[ -f dist/cli.js ]`) whose failure must count.
15
- */
16
7
  function inert(part, condition) {
17
8
  if (!part || /^(?:fi|done|esac|then|do|else)$/i.test(part) || outputFilter(part))
18
9
  return true;
@@ -20,16 +11,9 @@ function inert(part, condition) {
20
11
  return true;
21
12
  return condition && /^(?:\[\[?\s.*\]\]?|\$LASTEXITCODE\b.*|\$\?.*|-not\s+\$\?.*)$/i.test(part);
22
13
  }
23
- /**
24
- * Every check runner a shell command line contains, each as the command that would run on its own.
25
- * Control flow is unwrapped (`if`, `then`, `do`, `else`, braces, parentheses), so a runner nested in
26
- * a conditional is never missed. Undefined when anything else is in the line (`cd sub`, `FOO=1 npm
27
- * test`, a standalone assertion, another program): the runners' standalone results would then not
28
- * say what the line verified.
29
- */
30
14
  export function checkRunners(line) {
31
15
  const runners = [];
32
- let guard = false; // The previous fragment was a bare if/elif/while/until, as in PowerShell's `if (...)`.
16
+ let guard = false;
33
17
  for (const raw of line.split(/&&|\|\||[;|\n\r{}()]/)) {
34
18
  const condition = guard || /^(?:if|elif|while|until)\s/i.test(raw.trim());
35
19
  guard = false;
@@ -40,7 +24,6 @@ export function checkRunners(line) {
40
24
  }
41
25
  const negated = /^!\s*/.test(part);
42
26
  part = part.replace(/^!\s*/, '');
43
- // `! npm run build` expects a failure: a standalone pass of the same command cannot stand in for it.
44
27
  if (runner(part)) {
45
28
  if (negated)
46
29
  return undefined;
@@ -73,7 +56,6 @@ export function isCheckCall(name, family, args) {
73
56
  const line = commandLine(args);
74
57
  return !!line && line.split(/&&|\|\||[;|\n\r]/).some(part => runner(part.trim()));
75
58
  }
76
- /** Closed, argument-aware output filters. In particular, sort -o and sort /O write files. */
77
59
  function outputFilter(stage) {
78
60
  return /^(?:tail\s+(?:-\d+|-n\s+\d+)|select-object\s+-last\s+\d+|out-string(?:\s+-width\s+\d+)?)$/i.test(stage.trim());
79
61
  }
@@ -85,7 +67,6 @@ export function isReplaySafeCheck(name, family, args) {
85
67
  const line = commandLine(args);
86
68
  if (!line)
87
69
  return false;
88
- // Check runners can have explicitly mutating modes. They remain model-executable, not replayable.
89
70
  if (/(?:^|\s)(?:--(?:fix|write|update(?:-snapshots?)?|eval|require|import)(?:[=\s]|$)|-u(?:\s|$))/.test(line))
90
71
  return false;
91
72
  if (typeof args.program === 'string' && args.command === undefined && args.cmd === undefined) {
@@ -97,7 +78,6 @@ export function isReplaySafeCheck(name, family, args) {
97
78
  const [check, ...stages] = folded.split('|').map(s => s.trim());
98
79
  return runner(check) && stages.every(outputFilter);
99
80
  }
100
- /** A check that can establish a pass on the final workspace, not merely contain a check. */
101
81
  export function isVerificationCheck(name, family, args) {
102
82
  if (!isReplaySafeCheck(name, family, args))
103
83
  return false;
@@ -105,44 +85,23 @@ export function isVerificationCheck(name, family, args) {
105
85
  return true;
106
86
  if (object(args) && typeof args.program === 'string' && args.command === undefined && args.cmd === undefined)
107
87
  return true;
108
- // A shell pipeline may hide the runner's exit status. It can be replayed, but cannot authorize
109
- // automatic completion; let the model inspect it or use a plain/native check instead.
110
88
  return !commandLine(args)?.replace(/2>&1/g, '').includes('|');
111
89
  }
112
90
  const ENV_PREFIX = /^(?:env\s+)?(?:[A-Za-z_]\w*=(?:"[^"]*"|'[^']*'|[^\s"'`$;&|<>()]*)\s+)+/;
113
- /** Output-only suffixes the shell tool makes redundant (its output is already tail-bounded). */
114
91
  const OUTPUT_FILTER = /\s*(?:2>&1\s*)?\|\s*(?:tail|head)(?:\s+-n\s*\d+|\s+-\d+)?\s*$|\s*(?:2>&1\s*)?\|\s*cat\s*$/i;
115
- /**
116
- * A declared check without the output filter that would hide its exit status: `pytest -q 2>&1 |
117
- * tail -20` verifies exactly what `pytest -q 2>&1` verifies, and only the second reports it.
118
- */
119
92
  export function stripOutputFilter(line) {
120
93
  let next = line.trim();
121
94
  for (let i = 0; i < 2 && OUTPUT_FILTER.test(next); i++)
122
95
  next = next.replace(OUTPUT_FILTER, '').trim();
123
96
  return next;
124
97
  }
125
- /**
126
- * What a command the model named as its own verification can prove by exiting 0.
127
- *
128
- * `chain`: every step runs only if the one before succeeded (`&&`) and at least one step is a
129
- * recognized check runner, so exit 0 means that runner passed (`cd build && ctest`,
130
- * `PYTHONPATH=. python -m pytest -q`, `gcc -o t t.c && ./t`). `opaque`: the exit status is
131
- * faithful but nothing in the line is a known runner (`./run_tests.sh`), so exit 0 alone does not
132
- * settle it and the output has to be interpreted. One command fed by a here-document (`python3 -
133
- * <<'PY' ... PY`) is opaque too: the script is its input, not more shell. Undefined when the line
134
- * can hide a failure: a pipe, `;`, `||`, a background job, a substitution or a redirect.
135
- */
136
98
  export function declaredCheckKind(line) {
137
99
  // A mode that rewrites files (`eslint --fix`, `jest -u`) is an edit, not a check: admitting it
138
- // would leave the passes recorded before it standing for a workspace it then changed.
139
100
  if (MUTATING_FLAG.test(line))
140
101
  return undefined;
141
102
  const heredoc = /^([^\n]*?)<<-?\s*(['"]?)([A-Za-z_]\w*)\2([^\n]*)\n[\s\S]*\n\3\s*$/.exec(line.trim());
142
103
  if (heredoc)
143
104
  return declaredCheckKind(`${heredoc[1]} ${heredoc[4]}`) ? 'opaque' : undefined;
144
- // Quoted text is an argument, not shell syntax: `python3 -c "import m; m.run()"` is one command.
145
- // A double-quoted string that can expand (`$`, a backtick) is left in place and judged as written.
146
105
  const folded = line.replace(/'[^']*'/g, "''").replace(/"(?:[^"\\$`]|\\.)*"/g, '""')
147
106
  .replace(/\d?>&\d|(?:\d|&)?>\s*\/dev\/null/g, ' ').trim();
148
107
  if (!folded || /[;\n\r`<>|]|\$\(/.test(folded) || /&/.test(folded.replace(/&&/g, ' ')))
@@ -153,13 +112,6 @@ export function declaredCheckKind(line) {
153
112
  return parts.some(part => runner(part)) ? 'chain' : 'opaque';
154
113
  }
155
114
  const MUTATING_FLAG = /(?:^|\s)(?:--(?:fix|write|update(?:-snapshots?)?|eval|require|import)(?:[=\s]|$)|-u(?:\s|$))/;
156
- /**
157
- * The form of a check the model ran in which the runtime may run it again after an edit, or
158
- * undefined when it may not. Every step is a known runner or a `cd`, chained with `&&` only, so
159
- * running it twice does what running it once did and its exit status reports the result. An output
160
- * filter and the no-op `cd "$(pwd)" &&` are dropped; a mutating mode (`--fix`, `-u`) or anything
161
- * else in the line (setup, cleanup, a script) leaves the next run to the model.
162
- */
163
115
  export function replayableCheck(line) {
164
116
  const next = stripOutputFilter(line.trim().replace(/^cd\s+"?\$\(pwd\)"?\s*&&\s*/, ''));
165
117
  if (MUTATING_FLAG.test(next) || next.includes('<<'))
@@ -173,3 +125,120 @@ export function replayableCheck(line) {
173
125
  return undefined;
174
126
  return parts.every(part => runner(part) || /^cd\s+\S+$/.test(part)) ? next : undefined;
175
127
  }
128
+ const ANSI = /\x1b\[[0-9;]*m/g;
129
+ /**
130
+ * Reads the verdict a test runner printed, whatever command produced it. A project's own runner
131
+ * (`python tests/runtests.py`, `bin/test`, a Makefile target) is not in the runner table, but its
132
+ * summary line is still evidence that tests ran. Returns true or false when a summary reports the
133
+ * result, and undefined when the output holds no recognisable test summary.
134
+ */
135
+ export function testRunVerdict(output) {
136
+ const text = output.replace(ANSI, '').replace(/\r\n?/g, '\n');
137
+ const verdicts = [];
138
+ const unittest = /^Ran (\d+) tests? in [\d.]+s\s*$/m.exec(text);
139
+ if (unittest) {
140
+ if (/^FAILED\b/m.test(text))
141
+ verdicts.push(false);
142
+ else if (/^OK\b/m.test(text) && Number(unittest[1]) > 0)
143
+ verdicts.push(true);
144
+ }
145
+ for (const match of text.matchAll(/^(?:=+ )?((?:\d+ [a-z]+(?:, )?)+) in [\d.]+s(?: \([\d:]+\))?(?: =+)?\s*$/gm)) {
146
+ const counts = Object.fromEntries([...match[1].matchAll(/(\d+) ([a-z]+)/g)].map(count => [count[2], Number(count[1])]));
147
+ if ((counts.failed ?? 0) + (counts.error ?? 0) + (counts.errors ?? 0) > 0)
148
+ verdicts.push(false);
149
+ else if ((counts.passed ?? 0) > 0)
150
+ verdicts.push(true);
151
+ }
152
+ const sympy = /tests finished: (\d+) passed(?:, (\d+) failed)?[^\n]* in [\d.]+ seconds/.exec(text);
153
+ if (sympy)
154
+ verdicts.push(!Number(sympy[2] ?? 0) && !/DO \*NOT\* COMMIT/.test(text) && Number(sympy[1]) > 0);
155
+ // A runner that drives several suites prints one summary per suite: every one of them is read.
156
+ const nodeFails = [...text.matchAll(/^[ℹ#] fail (\d+)\s*$/gm)].map(match => Number(match[1]));
157
+ const nodePasses = [...text.matchAll(/^[ℹ#] pass (\d+)\s*$/gm)].map(match => Number(match[1]));
158
+ if (nodeFails.length && nodePasses.length) {
159
+ if (nodeFails.some(count => count > 0))
160
+ verdicts.push(false);
161
+ else if (nodePasses.some(count => count > 0))
162
+ verdicts.push(true);
163
+ }
164
+ // A Jest suite that fails to load fails the run although every test that did run passed.
165
+ if (/^Test Suites:\s+.*\b[1-9]\d* failed\b/m.test(text))
166
+ verdicts.push(false);
167
+ for (const jest of text.matchAll(/^Tests:\s+(.*)$/gm)) {
168
+ if (/\b[1-9]\d* failed\b/.test(jest[1]))
169
+ verdicts.push(false);
170
+ else if (/\b[1-9]\d* passed\b/.test(jest[1]))
171
+ verdicts.push(true);
172
+ }
173
+ for (const match of text.matchAll(/^test result: (ok|FAILED)\. (\d+) passed; (\d+) failed/gm)) {
174
+ // `ok. 0 passed` is a filter that matched nothing: no failure, but no test ran either.
175
+ if (match[1] !== 'ok' || Number(match[3]) > 0)
176
+ verdicts.push(false);
177
+ else if (Number(match[2]) > 0)
178
+ verdicts.push(true);
179
+ }
180
+ if (/^FAIL\s+\S+/m.test(text) && /^(?:ok|FAIL)\s+\S+\s+[\d.]+s/m.test(text))
181
+ verdicts.push(false);
182
+ else if (/^ok\s+\S+\s+[\d.]+s/m.test(text))
183
+ verdicts.push(true);
184
+ if (!verdicts.length)
185
+ return undefined;
186
+ return verdicts.every(Boolean);
187
+ }
188
+ const DISPLAY_STAGE = /^(?:tail|head)(?:\s+-n\s*\d+|\s+-\d+|\s+-c\s*\d+)?$|^cat$|^select-object\s+-(?:last|first)\s+\d+$|^out-string(?:\s+-width\s+\d+)?$|^e?grep(?:\s+-[A-Za-z]+)*\s+(?:-e\s+)?(?:''|""|[\w.^$*+?()\[\]{}|\:=/-]+)(?:\s+-[A-Za-z]+)*$/i;
189
+ /**
190
+ * The command to run again for a test run the model made itself, or undefined when replaying it is
191
+ * not plainly the same test run: the stages after the first pipe may only trim what is shown (tail,
192
+ * head, grep, cat), and what is left is one command, optionally after `cd <dir> &&`, with no redirect,
193
+ * substitution, heredoc, `;`, `||` or file-changing mode, and not a program that changes the workspace. The display stages are dropped, so a failing rerun
194
+ * returns the runner's own output and exit status.
195
+ */
196
+ export function replayableTestRun(line) {
197
+ const source = line.trim().replace(/^cd\s+"?\$\(pwd\)"?\s*&&\s*/, '');
198
+ if (!source || MUTATING_FLAG.test(source) || source.includes('<<'))
199
+ return undefined;
200
+ const masked = source.replace(/'[^']*'/g, quoted => `'${'_'.repeat(quoted.length - 2)}'`).replace(/"(?:[^"\$`]|\.)*"/g, quoted => `"${'_'.repeat(quoted.length - 2)}"`);
201
+ let cut = -1;
202
+ for (let index = 0; index < masked.length; index++) {
203
+ if (masked[index] !== '|')
204
+ continue;
205
+ if (masked[index + 1] === '|' || masked[index - 1] === '|')
206
+ return undefined;
207
+ cut = index;
208
+ break;
209
+ }
210
+ const stages = cut < 0 ? [] : masked.slice(cut + 1).split('|').map(stage => stage.replace(/\d?>&\d/g, ' ').trim());
211
+ if (stages.some(stage => !DISPLAY_STAGE.test(stage.replace(/'_*'/g, "''").replace(/"_*"/g, '""'))))
212
+ return undefined;
213
+ const command = (cut < 0 ? source : source.slice(0, cut)).replace(/\s*\d?>&\d\s*$/, '').trim();
214
+ const folded = (cut < 0 ? masked : masked.slice(0, cut)).replace(/\d?>&\d|(?:\d|&)?>\s*\/dev\/null/g, ' ').trim();
215
+ if (!folded || /[;\n\r`<>|]|\$\(/.test(folded) || /&/.test(folded.replace(/&&/g, ' ')))
216
+ return undefined;
217
+ const parts = folded.split('&&').map(part => part.trim().replace(ENV_PREFIX, ''));
218
+ // Only directory changes may precede the test command: a setup stage (`git restore f && runtests`) would be
219
+ // repeated after the model's edit and could undo it.
220
+ const run = parts.at(-1);
221
+ if (parts.some(part => !part) || parts.slice(0, -1).some(part => !/^cd\s+\S+$/.test(part)) || /^cd\s/.test(run) || CHANGES_WORKSPACE.test(run) || ONLY_DISPLAYS.test(run))
222
+ return undefined;
223
+ return command;
224
+ }
225
+ /** True for a command that only shows existing output, such as `cat /tmp/test-output.log`: a summary it prints is not a test run. */
226
+ export function onlyDisplaysOutput(line) {
227
+ // A substitution runs another program whatever the outer command is (`echo "$(python update.py)"`), and
228
+ // double quotes do not stop it; a heredoc or a background job is not a plain display either.
229
+ const expandable = line.replace(/'[^']*'/g, "''");
230
+ if (/\$\(|\$\{|`|[<>]\(|<<|&\s*\(|\binvoke-expression\b|\biex\b/i.test(expandable) || /&/.test(expandable.replace(/&&/g, ' ').replace(/\d?>&\d/g, ' ')))
231
+ return false;
232
+ const masked = line.trim().replace(/'[^']*'/g, "''").replace(/"(?:[^"\\$`]|\\.)*"/g, '""');
233
+ // Every stage of every pipeline has to be a display: `cat data.json | node update-source.js` is not one.
234
+ const stages = masked.replace(/\d?>&\d/g, ' ').split(/&&|\|\||[;|\n\r]/).map(stage => stage.trim().replace(ENV_PREFIX, '')).filter(stage => stage && !/^cd\s+\S+$/.test(stage));
235
+ // `sed -i` and a redirect into a file write; they are not displays.
236
+ if (/\bsed\s+(?:-[a-hj-zA-Z]*i|--in-place)|\bawk\s+-i\s+inplace/.test(masked) || />/.test(masked.replace(/\d?>&\d|(?:\d|&)?>\s*\/dev\/null/g, ' ')))
237
+ return false;
238
+ return stages.length > 0 && stages.every(stage => ONLY_DISPLAYS.test(stage));
239
+ }
240
+ // Showing a saved log (`cat /tmp/test-output.log`) prints a test summary without running anything. Only
241
+ // programs that cannot write are listed: find (-delete, -exec), sed and awk (in place), sort (-o) and
242
+ // uniq (an output file) can, so a command using them is treated like any other that may change files.
243
+ const ONLY_DISPLAYS = /^(?:cat|tail|head|less|more|bat|type|e?grep|rg|cut|wc|nl|echo|printf|ls|dir|get-content|gc|select-string|select-object|out-string|write-output|write-host)\b/i;
244
+ const CHANGES_WORKSPACE = /^(?:sudo\s+)?(?:git|rm|mv|cp|sed|awk|find|sort|uniq|patch|touch|chmod|chown|mkdir|rmdir|ln|tee|dd|truncate|curl|wget|pip[\d.]*|conda|apt(?:-get)?|brew|npm\s+(?:i|install|ci|update|uninstall)|yarn\s+(?:add|install|remove)|pnpm\s+(?:add|install|remove)|remove-item|move-item|copy-item|set-content|new-item)\b/i;
@@ -34,14 +34,8 @@ export declare const FACT_WORDING: Record<FactId, {
34
34
  false: string;
35
35
  };
36
36
  }>;
37
- /**
38
- * The bar each fact must reach before the runtime acts on it: yes at p >= bar, no at p <= 1 - bar.
39
- * "Checks passed" can end a run, so it keeps the strict 0.95 the CLI already applies to post-tool
40
- * answers; a wrong answer to the other two costs at most one extra check or one skipped retry.
41
- */
42
37
  export declare const FACT_THRESHOLDS: Record<FactId, number>;
43
38
  export declare function factAnswer(id: FactId, probability: number | undefined): boolean | undefined;
44
- /** Field limits, in UTF-8 bytes, for what one fact request may carry (the hosted body is capped at 32 KiB). */
45
39
  export declare const FACT_LIMITS: {
46
40
  readonly task: 3000;
47
41
  readonly command: 512;
@@ -49,16 +43,6 @@ export declare const FACT_LIMITS: {
49
43
  readonly error: 1500;
50
44
  readonly entries: 8;
51
45
  };
52
- /**
53
- * Keep 70% head and 30% tail, as the hosted provider's routing snapshot does and as the prompt eval
54
- * measured: a test summary ("ℹ fail 0", "Tests: 3 failed") sits at the end of its output.
55
- */
56
46
  export declare function clipFactText(text: string, bytes: number): string;
57
- /**
58
- * The text "does the task ask for checks" is judged on: the task (a confirmed handoff's instruction
59
- * when there is one) and the node's own instruction, which can require checks the user never named.
60
- * Each part is clipped on its own so a long task cannot crowd the instruction out.
61
- */
62
47
  export declare function factTaskText(task: string, nodeInstruction?: string): string;
63
- /** Validate an answer at the provider boundary: a probability in [0, 1] or nothing. */
64
48
  export declare function factProbability(value: unknown): number;
@@ -1,15 +1,3 @@
1
- /**
2
- * Literal facts Jev answers after a tool batch, one request per fact with only the state it needs.
3
- *
4
- * Whole-decision questions ("is the task likely complete?") stayed below 77% confident-and-right on
5
- * real sessions because their answer depends on what the agent will do next. These facts are visible
6
- * in the state, so Jev answers them at p >= 0.95 or <= 0.05, and rightly, on 97.1% of held-out decision points
7
- * (eval/jev-prompt/FINDINGS.md). The runtime answers everything it knows exactly itself (a call
8
- * failed, files were written, a command is a check) and combines the facts in code.
9
- *
10
- * The hosted proxy owns the wording it sends (infra/andorra-auth/proxy.py FACTS); this copy is what a
11
- * direct provider sends, and the two are kept identical.
12
- */
13
1
  import { redactSecrets } from '../memory/redaction.js';
14
2
  import { boundedDecisionText } from './PreparedSteps.js';
15
3
  export const FACT_IDS = ['task_needs_checks', 'checks_passed', 'temporary_failure'];
@@ -36,28 +24,16 @@ export const FACT_WORDING = {
36
24
  },
37
25
  },
38
26
  };
39
- /**
40
- * The bar each fact must reach before the runtime acts on it: yes at p >= bar, no at p <= 1 - bar.
41
- * "Checks passed" can end a run, so it keeps the strict 0.95 the CLI already applies to post-tool
42
- * answers; a wrong answer to the other two costs at most one extra check or one skipped retry.
43
- */
44
27
  export const FACT_THRESHOLDS = { checks_passed: 0.95, task_needs_checks: 0.9, temporary_failure: 0.9 };
45
28
  export function factAnswer(id, probability) {
46
29
  if (probability === undefined || !Number.isFinite(probability))
47
30
  return undefined;
48
- // Answers arrive with two decimals; the tolerance keeps 1 - 0.9 (0.0999…) from missing 0.1.
49
31
  const bar = FACT_THRESHOLDS[id], tolerance = 1e-9;
50
32
  return probability >= bar - tolerance ? true : probability <= 1 - bar + tolerance ? false : undefined;
51
33
  }
52
- /** Field limits, in UTF-8 bytes, for what one fact request may carry (the hosted body is capped at 32 KiB). */
53
34
  export const FACT_LIMITS = { task: 3000, command: 512, output: 2000, error: 1500, entries: 8 };
54
35
  const CLIP_MARKER = '\n…[Jev routing context clipped]…\n';
55
- /**
56
- * Keep 70% head and 30% tail, as the hosted provider's routing snapshot does and as the prompt eval
57
- * measured: a test summary ("ℹ fail 0", "Tests: 3 failed") sits at the end of its output.
58
- */
59
36
  export function clipFactText(text, bytes) {
60
- // Redact before clipping so neither the head nor the tail can carry a secret.
61
37
  const normalized = redactSecrets(text).text.replace(/\r\n?/g, '\n').replace(/[ \t]+/g, ' ').replace(/\n{3,}/g, '\n\n').trim();
62
38
  if (Buffer.byteLength(normalized, 'utf8') <= bytes)
63
39
  return normalized;
@@ -72,17 +48,11 @@ export function clipFactText(text, bytes) {
72
48
  start++;
73
49
  return head + CLIP_MARKER + raw.subarray(start).toString('utf8');
74
50
  }
75
- /**
76
- * The text "does the task ask for checks" is judged on: the task (a confirmed handoff's instruction
77
- * when there is one) and the node's own instruction, which can require checks the user never named.
78
- * Each part is clipped on its own so a long task cannot crowd the instruction out.
79
- */
80
51
  export function factTaskText(task, nodeInstruction) {
81
52
  if (!nodeInstruction?.trim())
82
53
  return clipFactText(task, FACT_LIMITS.task);
83
54
  return `${clipFactText(task, 1900)}\n\nNode instruction (also part of the task):\n${clipFactText(nodeInstruction, 1000)}`;
84
55
  }
85
- /** Validate an answer at the provider boundary: a probability in [0, 1] or nothing. */
86
56
  export function factProbability(value) {
87
57
  if (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > 1)
88
58
  throw new Error('invalid_response');
@@ -1,4 +1,3 @@
1
- /** Runtime-owned metadata, never a provider answer or part of the wire/telemetry payload. */
2
1
  const FACT_GUIDANCE = Symbol('fact-guidance');
3
2
  export function markFactGuidance(batch) {
4
3
  const marked = { ...batch };
@@ -1,13 +1,7 @@
1
1
  import type { Membership } from '../membership.js';
2
2
  import { DecisionManager } from './DecisionManager.js';
3
3
  import type { DecisionConfig } from './types.js';
4
- /**
5
- * The decision service a run may use. Every service, the hosted one and a local one this
6
- * installation configured, needs a signed-in account, and the installation-wide switch stays
7
- * authoritative over either.
8
- */
9
4
  export declare function resolveDecisionConfig(membership: Membership, enabled?: boolean, decisions?: DecisionConfig): DecisionConfig;
10
- /** CLI policy: account entitlement is fetched from the hosted service for each run. */
11
5
  export declare function hostedDecisionPolicy(membership: Membership, enabled?: boolean, decisions?: DecisionConfig): {
12
6
  decisionManager: DecisionManager;
13
7
  decisionNodeOptIn: boolean;
@@ -1,9 +1,4 @@
1
1
  import { DecisionManager } from './DecisionManager.js';
2
- /**
3
- * The decision service a run may use. Every service, the hosted one and a local one this
4
- * installation configured, needs a signed-in account, and the installation-wide switch stays
5
- * authoritative over either.
6
- */
7
2
  export function resolveDecisionConfig(membership, enabled = true, decisions) {
8
3
  if (!enabled || !membership.subject)
9
4
  return { provider: 'none', mode: 'off' };
@@ -11,11 +6,9 @@ export function resolveDecisionConfig(membership, enabled = true, decisions) {
11
6
  return decisions;
12
7
  return { ...decisions, provider: 'andorra', mode: decisions?.mode ?? 'active', requestTimeoutMs: decisions?.requestTimeoutMs ?? 15000 };
13
8
  }
14
- /** CLI policy: account entitlement is fetched from the hosted service for each run. */
15
9
  export function hostedDecisionPolicy(membership, enabled = true, decisions) {
16
10
  return {
17
11
  decisionManager: new DecisionManager({ config: resolveDecisionConfig(membership, enabled, decisions) }),
18
- // Only Agent nodes that turn Jev on receive the run's decision service.
19
12
  decisionNodeOptIn: true,
20
13
  };
21
14
  }
@@ -1,37 +1,18 @@
1
1
  import type { DecisionResult } from './types.js';
2
- /** Skills one hosted request may describe: the proxy's 32-choice limit less the `none` choice. */
3
2
  export declare const HOSTED_SKILLS_PER_REQUEST = 31;
4
- /** Proxies deployed before the 31-skill contract reject a request describing more than 16 skills. */
5
3
  export declare const LEGACY_HOSTED_SKILLS_PER_REQUEST = 16;
6
- /** Parallel skill requests per preflight; each one counts against the account's daily decisions. */
7
4
  export declare const HOSTED_SKILL_BATCHES = 4;
8
5
  export declare const HOSTED_SKILL_LIMIT: number;
9
6
  type ChoiceAnswer = Extract<DecisionResult, {
10
7
  type: 'choice';
11
8
  }>;
12
- /**
13
- * The skills Jev considers when more are installed than it can evaluate: the ones whose name and
14
- * description share the most words with the task, ties kept in discovery order.
15
- */
16
9
  export declare function rankHostedSkills<T extends {
17
10
  id: string;
18
11
  description: string;
19
12
  }>(skills: T[], task: string, limit?: number): T[];
20
- /** The one-time warning when more skills are installed than Jev evaluates; the CLI and desktop show it as written. */
21
13
  export declare function hostedSkillLimitNotice(installed: number): string;
22
- /**
23
- * Batches covering the first HOSTED_SKILL_LIMIT skills. At the contract size that is HOSTED_SKILL_BATCHES
24
- * requests; against a proxy still limited to 16 it takes more, so no skill below the limit is dropped.
25
- */
26
14
  export declare function chunkSkills(ids: string[], size: number): string[][];
27
- /** A batch's answer restated over every original choice; skills it did not see score zero. */
28
15
  export declare function expandSkillAnswer(answer: ChoiceAnswer, choices: string[]): ChoiceAnswer;
29
- /**
30
- * When no batch picked a skill: `none` keeps the least certain batch's probability, and the rest is
31
- * shared across the skills in proportion to their batch scores, so the routing threshold still sees
32
- * the weakest batch's doubt.
33
- */
34
16
  export declare function mergeNoSkill(answers: ChoiceAnswer[], choices: string[]): ChoiceAnswer;
35
- /** No skill, stated with zero confidence so routing never acts on it. */
36
17
  export declare function abstainSkill(choices: string[]): ChoiceAnswer;
37
18
  export {};
@@ -1,15 +1,8 @@
1
- /** Skills one hosted request may describe: the proxy's 32-choice limit less the `none` choice. */
2
1
  export const HOSTED_SKILLS_PER_REQUEST = 31;
3
- /** Proxies deployed before the 31-skill contract reject a request describing more than 16 skills. */
4
2
  export const LEGACY_HOSTED_SKILLS_PER_REQUEST = 16;
5
- /** Parallel skill requests per preflight; each one counts against the account's daily decisions. */
6
3
  export const HOSTED_SKILL_BATCHES = 4;
7
4
  export const HOSTED_SKILL_LIMIT = HOSTED_SKILLS_PER_REQUEST * HOSTED_SKILL_BATCHES;
8
5
  const words = (text) => new Set(text.toLowerCase().match(/[\p{L}\p{N}]{3,}/gu) ?? []);
9
- /**
10
- * The skills Jev considers when more are installed than it can evaluate: the ones whose name and
11
- * description share the most words with the task, ties kept in discovery order.
12
- */
13
6
  export function rankHostedSkills(skills, task, limit = HOSTED_SKILL_LIMIT) {
14
7
  if (skills.length <= limit)
15
8
  return skills;
@@ -20,32 +13,21 @@ export function rankHostedSkills(skills, task, limit = HOSTED_SKILL_LIMIT) {
20
13
  return skills.map((skill, index) => ({ skill, index, score: score(skill) }))
21
14
  .sort((a, b) => b.score - a.score || a.index - b.index).slice(0, limit).map(entry => entry.skill);
22
15
  }
23
- /** The one-time warning when more skills are installed than Jev evaluates; the CLI and desktop show it as written. */
24
16
  export function hostedSkillLimitNotice(installed) {
25
17
  return `[Jev] ${installed} skills are installed, but Jev evaluates at most ${HOSTED_SKILL_LIMIT} `
26
18
  + `(${HOSTED_SKILL_BATCHES} batches of ${HOSTED_SKILLS_PER_REQUEST}). It uses the ${HOSTED_SKILL_LIMIT} that best match the task; `
27
19
  + `the other ${installed - HOSTED_SKILL_LIMIT} are not considered.`;
28
20
  }
29
- /**
30
- * Batches covering the first HOSTED_SKILL_LIMIT skills. At the contract size that is HOSTED_SKILL_BATCHES
31
- * requests; against a proxy still limited to 16 it takes more, so no skill below the limit is dropped.
32
- */
33
21
  export function chunkSkills(ids, size) {
34
22
  const covered = ids.slice(0, HOSTED_SKILL_LIMIT), chunks = [];
35
23
  for (let start = 0; start < covered.length; start += size)
36
24
  chunks.push(covered.slice(start, start + size));
37
25
  return chunks;
38
26
  }
39
- /** A batch's answer restated over every original choice; skills it did not see score zero. */
40
27
  export function expandSkillAnswer(answer, choices) {
41
28
  return { type: 'choice', choice: answer.choice, confidence: answer.confidence,
42
29
  probabilities: Object.fromEntries(choices.map(choice => [choice, answer.probabilities[choice] ?? 0])) };
43
30
  }
44
- /**
45
- * When no batch picked a skill: `none` keeps the least certain batch's probability, and the rest is
46
- * shared across the skills in proportion to their batch scores, so the routing threshold still sees
47
- * the weakest batch's doubt.
48
- */
49
31
  export function mergeNoSkill(answers, choices) {
50
32
  const none = Math.min(...answers.map(answer => answer.probabilities.none ?? 0));
51
33
  const scores = new Map();
@@ -58,7 +40,6 @@ export function mergeNoSkill(answers, choices) {
58
40
  return { type: 'choice', choice: 'none', confidence: Math.min(...answers.map(answer => answer.confidence)),
59
41
  probabilities: Object.fromEntries(choices.map(choice => [choice, choice === 'none' ? (total > 0 ? none : 1) : total > 0 ? rest * (scores.get(choice) ?? 0) / total : 0])) };
60
42
  }
61
- /** No skill, stated with zero confidence so routing never acts on it. */
62
43
  export function abstainSkill(choices) {
63
44
  return { type: 'choice', choice: 'none', confidence: 0, probabilities: Object.fromEntries(choices.map(choice => [choice, choice === 'none' ? 1 : 0])) };
64
45
  }
@@ -1,7 +1,5 @@
1
- /** Host-only optimization eligibility. These predicates never authorize a tool. */
2
1
  export declare function answerOnlyTask(task: string): boolean;
3
2
  export interface PreflightConsumers {
4
- /** Must reflect available, unpinned, configured alternatives for this attempt. */
5
3
  adaptiveRouting?: boolean;
6
4
  answerOnly?: boolean;
7
5
  }
@@ -9,7 +7,6 @@ export declare function actionablePreflightQuestion(id: string, facts: boolean,
9
7
  codeGraphAvailable: boolean;
10
8
  memoryAvailable: boolean;
11
9
  }, roles: readonly string[]): boolean;
12
- /** No semantic classification unless a different, configured model can actually be selected. */
13
10
  export declare function hasAdaptiveAlternative(routing: {
14
11
  enabled?: boolean;
15
12
  tiers?: Record<string, {
@@ -1,6 +1,4 @@
1
- /** Host-only optimization eligibility. These predicates never authorize a tool. */
2
1
  export function answerOnlyTask(task) {
3
- // Only explicit constraints, not a learned classifier or guessed task complexity.
4
2
  return /\b(?:do not|don't|never)\s+(?:use|call|invoke|run)\s+(?:any\s+)?tools?\b|\bwithout\s+(?:using\s+)?(?:any\s+)?tools?\b|\bno\s+tool\s+calls?\b/i.test(task);
5
3
  }
6
4
  export function actionablePreflightQuestion(id, facts, consumers, availability, roles) {
@@ -11,7 +9,7 @@ export function actionablePreflightQuestion(id, facts, consumers, availability,
11
9
  if (id === 'needs_memory')
12
10
  return availability.memoryAvailable;
13
11
  if (!facts)
14
- return true; // Keep explicitly selected legacy questions mode compatible.
12
+ return true;
15
13
  if (id.startsWith('tool_family_') || ['needs_external_docs', 'verification_tier'].includes(id))
16
14
  return false;
17
15
  if (['task_complexity', 'security_sensitive', 'architecture_affecting'].includes(id))
@@ -20,7 +18,6 @@ export function actionablePreflightQuestion(id, facts, consumers, availability,
20
18
  return roles.length > 0;
21
19
  return true;
22
20
  }
23
- /** No semantic classification unless a different, configured model can actually be selected. */
24
21
  export function hasAdaptiveAlternative(routing, baseline, configured) {
25
22
  if (!routing.enabled || !routing.tiers)
26
23
  return false;
@@ -2,7 +2,6 @@ import type { DecisionProvider, DecisionObserver, DecisionRequestOptions } from
2
2
  import type { DecisionBatch, DecisionQuestion, DecisionState } from '../types.js';
3
3
  import { type FactRequest } from '../facts.js';
4
4
  import { type ToolRouteRequest, type ToolRouteEvidence } from '../routeTools.js';
5
- /** Shared Jev credentials never enter the harness; only user access tokens cross this boundary. */
6
5
  export declare class AndorraDecisionProvider implements DecisionProvider {
7
6
  private readonly dependencies?;
8
7
  constructor(dependencies?: {
@@ -11,12 +10,6 @@ export declare class AndorraDecisionProvider implements DecisionProvider {
11
10
  fetch: typeof fetch;
12
11
  } | undefined);
13
12
  evaluate(state: DecisionState, questions: DecisionQuestion[], signal?: AbortSignal, observe?: DecisionObserver, options?: DecisionRequestOptions): Promise<DecisionBatch>;
14
- /**
15
- * The skill question split into parallel requests of `size` skills, covering at most HOSTED_SKILL_LIMIT
16
- * skills. The first request also carries every other question and runs on the caller's signal; the
17
- * skill-only ones run on `skillSignal`. Each batch's probabilities only compare the skills it saw, so
18
- * when two or more batches pick a skill their winners go to one final request.
19
- */
20
13
  private evaluateBatched;
21
14
  private evaluateOnce;
22
15
  evaluateFact(fact: FactRequest, signal?: AbortSignal, observe?: DecisionObserver): Promise<number>;