muonroi-cli 1.8.1 → 1.8.4

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 (946) hide show
  1. package/LICENSE +5 -17
  2. package/README.md +20 -9
  3. package/dist/src/generated/version.d.ts +1 -1
  4. package/dist/src/generated/version.js +1 -1
  5. package/dist/src/mcp/setup-guide-text.d.ts +1 -1
  6. package/dist/src/mcp/setup-guide-text.js +8 -5
  7. package/dist/src/orchestrator/orchestrator.js +22 -13
  8. package/dist/src/orchestrator/tool-engine.d.ts +4 -0
  9. package/dist/src/orchestrator/tool-engine.js +49 -0
  10. package/dist/src/ui/use-app-logic.js +0 -0
  11. package/dist/src/utils/install-manager.d.ts +1 -0
  12. package/dist/src/utils/install-manager.js +41 -10
  13. package/dist/src/utils/update-checker.js +12 -2
  14. package/package.json +9 -2
  15. package/dist/src/__test-helpers__/catalog-fixtures.d.ts +0 -22
  16. package/dist/src/__test-helpers__/catalog-fixtures.js +0 -55
  17. package/dist/src/__test-stubs__/ee-server.d.ts +0 -27
  18. package/dist/src/__test-stubs__/ee-server.js +0 -138
  19. package/dist/src/__test-stubs__/vitest-setup.d.ts +0 -1
  20. package/dist/src/__test-stubs__/vitest-setup.js +0 -38
  21. package/dist/src/__tests__/council/bubble-layout.test.d.ts +0 -1
  22. package/dist/src/__tests__/council/bubble-layout.test.js +0 -39
  23. package/dist/src/__tests__/council/code-block-truncate.test.d.ts +0 -1
  24. package/dist/src/__tests__/council/code-block-truncate.test.js +0 -45
  25. package/dist/src/__tests__/council/role-palette.test.d.ts +0 -1
  26. package/dist/src/__tests__/council/role-palette.test.js +0 -59
  27. package/dist/src/__tests__/first-run-wizard.test.d.ts +0 -1
  28. package/dist/src/__tests__/first-run-wizard.test.js +0 -9
  29. package/dist/src/agent-harness/__tests__/cli-flags.spec.d.ts +0 -1
  30. package/dist/src/agent-harness/__tests__/cli-flags.spec.js +0 -33
  31. package/dist/src/agent-harness/__tests__/driver.spec.d.ts +0 -1
  32. package/dist/src/agent-harness/__tests__/driver.spec.js +0 -141
  33. package/dist/src/agent-harness/__tests__/idle.spec.d.ts +0 -1
  34. package/dist/src/agent-harness/__tests__/idle.spec.js +0 -84
  35. package/dist/src/agent-harness/__tests__/mock-llm.spec.d.ts +0 -1
  36. package/dist/src/agent-harness/__tests__/mock-llm.spec.js +0 -91
  37. package/dist/src/agent-harness/__tests__/mock-model.spec.d.ts +0 -5
  38. package/dist/src/agent-harness/__tests__/mock-model.spec.js +0 -270
  39. package/dist/src/agent-harness/__tests__/predicate.spec.d.ts +0 -1
  40. package/dist/src/agent-harness/__tests__/predicate.spec.js +0 -27
  41. package/dist/src/agent-harness/__tests__/protocol.spec.d.ts +0 -1
  42. package/dist/src/agent-harness/__tests__/protocol.spec.js +0 -56
  43. package/dist/src/agent-harness/__tests__/schema.spec.d.ts +0 -1
  44. package/dist/src/agent-harness/__tests__/schema.spec.js +0 -76
  45. package/dist/src/agent-harness/__tests__/selector.spec.d.ts +0 -1
  46. package/dist/src/agent-harness/__tests__/selector.spec.js +0 -70
  47. package/dist/src/agent-harness/__tests__/sidechannel.spec.d.ts +0 -1
  48. package/dist/src/agent-harness/__tests__/sidechannel.spec.js +0 -29
  49. package/dist/src/agent-harness/__tests__/spec-helpers.spec.d.ts +0 -1
  50. package/dist/src/agent-harness/__tests__/spec-helpers.spec.js +0 -68
  51. package/dist/src/chat/__tests__/broadcast-bus.test.d.ts +0 -1
  52. package/dist/src/chat/__tests__/broadcast-bus.test.js +0 -81
  53. package/dist/src/chat/__tests__/channel-manager.test.d.ts +0 -1
  54. package/dist/src/chat/__tests__/channel-manager.test.js +0 -133
  55. package/dist/src/chat/__tests__/client.test.d.ts +0 -1
  56. package/dist/src/chat/__tests__/client.test.js +0 -109
  57. package/dist/src/chat/__tests__/discord-integration.test.d.ts +0 -1
  58. package/dist/src/chat/__tests__/discord-integration.test.js +0 -153
  59. package/dist/src/chat/__tests__/intent-prompt.test.d.ts +0 -1
  60. package/dist/src/chat/__tests__/intent-prompt.test.js +0 -80
  61. package/dist/src/chat/__tests__/verdict-resolver.test.d.ts +0 -1
  62. package/dist/src/chat/__tests__/verdict-resolver.test.js +0 -308
  63. package/dist/src/cli/__tests__/bw-vault.test.d.ts +0 -1
  64. package/dist/src/cli/__tests__/bw-vault.test.js +0 -87
  65. package/dist/src/cli/__tests__/keys-bundle.test.d.ts +0 -1
  66. package/dist/src/cli/__tests__/keys-bundle.test.js +0 -40
  67. package/dist/src/cli/__tests__/share-cmd.test.d.ts +0 -1
  68. package/dist/src/cli/__tests__/share-cmd.test.js +0 -175
  69. package/dist/src/cli/config/__tests__/model-picker.test.d.ts +0 -1
  70. package/dist/src/cli/config/__tests__/model-picker.test.js +0 -56
  71. package/dist/src/cli/config/__tests__/provider-fetch.test.d.ts +0 -1
  72. package/dist/src/cli/config/__tests__/provider-fetch.test.js +0 -38
  73. package/dist/src/cli/cost-forensics.test.d.ts +0 -1
  74. package/dist/src/cli/cost-forensics.test.js +0 -223
  75. package/dist/src/cli/experience-report.test.d.ts +0 -5
  76. package/dist/src/cli/experience-report.test.js +0 -63
  77. package/dist/src/cli/keys.test.d.ts +0 -1
  78. package/dist/src/cli/keys.test.js +0 -86
  79. package/dist/src/council/__tests__/abort-threading.test.d.ts +0 -1
  80. package/dist/src/council/__tests__/abort-threading.test.js +0 -193
  81. package/dist/src/council/__tests__/accounting.test.d.ts +0 -1
  82. package/dist/src/council/__tests__/accounting.test.js +0 -66
  83. package/dist/src/council/__tests__/audit-replay.test.d.ts +0 -1
  84. package/dist/src/council/__tests__/audit-replay.test.js +0 -241
  85. package/dist/src/council/__tests__/clarification-prompt.test.d.ts +0 -1
  86. package/dist/src/council/__tests__/clarification-prompt.test.js +0 -71
  87. package/dist/src/council/__tests__/clarifier-max-rounds.test.d.ts +0 -1
  88. package/dist/src/council/__tests__/clarifier-max-rounds.test.js +0 -46
  89. package/dist/src/council/__tests__/clarifier-options.test.d.ts +0 -1
  90. package/dist/src/council/__tests__/clarifier-options.test.js +0 -54
  91. package/dist/src/council/__tests__/clarifier-ready-gate.test.d.ts +0 -1
  92. package/dist/src/council/__tests__/clarifier-ready-gate.test.js +0 -265
  93. package/dist/src/council/__tests__/cost-aware.test.d.ts +0 -1
  94. package/dist/src/council/__tests__/cost-aware.test.js +0 -49
  95. package/dist/src/council/__tests__/council-turn-length-emit.test.d.ts +0 -1
  96. package/dist/src/council/__tests__/council-turn-length-emit.test.js +0 -130
  97. package/dist/src/council/__tests__/debate-planner-structured.test.d.ts +0 -1
  98. package/dist/src/council/__tests__/debate-planner-structured.test.js +0 -209
  99. package/dist/src/council/__tests__/debate-round-budget.test.d.ts +0 -1
  100. package/dist/src/council/__tests__/debate-round-budget.test.js +0 -45
  101. package/dist/src/council/__tests__/decisions-lock.test.d.ts +0 -6
  102. package/dist/src/council/__tests__/decisions-lock.test.js +0 -352
  103. package/dist/src/council/__tests__/evaluator-metrics.test.d.ts +0 -1
  104. package/dist/src/council/__tests__/evaluator-metrics.test.js +0 -463
  105. package/dist/src/council/__tests__/oauth-reachable.test.d.ts +0 -1
  106. package/dist/src/council/__tests__/oauth-reachable.test.js +0 -31
  107. package/dist/src/council/__tests__/parse-outcome-fallback.test.d.ts +0 -1
  108. package/dist/src/council/__tests__/parse-outcome-fallback.test.js +0 -114
  109. package/dist/src/council/__tests__/post-debate-recommendation.test.d.ts +0 -1
  110. package/dist/src/council/__tests__/post-debate-recommendation.test.js +0 -58
  111. package/dist/src/council/__tests__/research-tools.test.d.ts +0 -1
  112. package/dist/src/council/__tests__/research-tools.test.js +0 -214
  113. package/dist/src/council/__tests__/round-tools.test.d.ts +0 -1
  114. package/dist/src/council/__tests__/round-tools.test.js +0 -306
  115. package/dist/src/council/__tests__/tool-trace.test.d.ts +0 -1
  116. package/dist/src/council/__tests__/tool-trace.test.js +0 -131
  117. package/dist/src/council/__tests__/types-contract.test.d.ts +0 -9
  118. package/dist/src/council/__tests__/types-contract.test.js +0 -82
  119. package/dist/src/council/clarifier-question-cap.test.d.ts +0 -12
  120. package/dist/src/council/clarifier-question-cap.test.js +0 -73
  121. package/dist/src/daemon/scheduler.test.d.ts +0 -1
  122. package/dist/src/daemon/scheduler.test.js +0 -103
  123. package/dist/src/ee/__tests__/bb-design.test.d.ts +0 -14
  124. package/dist/src/ee/__tests__/bb-design.test.js +0 -180
  125. package/dist/src/ee/__tests__/ee-onboarding.test.d.ts +0 -1
  126. package/dist/src/ee/__tests__/ee-onboarding.test.js +0 -32
  127. package/dist/src/ee/__tests__/export-transcripts.test.d.ts +0 -11
  128. package/dist/src/ee/__tests__/export-transcripts.test.js +0 -200
  129. package/dist/src/ee/__tests__/pil-context-bridge.test.d.ts +0 -1
  130. package/dist/src/ee/__tests__/pil-context-bridge.test.js +0 -54
  131. package/dist/src/ee/__tests__/pipeline.integration.test.d.ts +0 -14
  132. package/dist/src/ee/__tests__/pipeline.integration.test.js +0 -151
  133. package/dist/src/ee/__tests__/recall-format.test.d.ts +0 -10
  134. package/dist/src/ee/__tests__/recall-format.test.js +0 -57
  135. package/dist/src/ee/__tests__/recall-ledger.test.d.ts +0 -1
  136. package/dist/src/ee/__tests__/recall-ledger.test.js +0 -45
  137. package/dist/src/ee/__tests__/render-sink-wiring.test.d.ts +0 -1
  138. package/dist/src/ee/__tests__/render-sink-wiring.test.js +0 -74
  139. package/dist/src/ee/artifact-cache.test.d.ts +0 -1
  140. package/dist/src/ee/artifact-cache.test.js +0 -69
  141. package/dist/src/ee/auth.test.d.ts +0 -1
  142. package/dist/src/ee/auth.test.js +0 -59
  143. package/dist/src/ee/bridge.test.d.ts +0 -1
  144. package/dist/src/ee/bridge.test.js +0 -230
  145. package/dist/src/ee/client.test.d.ts +0 -1
  146. package/dist/src/ee/client.test.js +0 -181
  147. package/dist/src/ee/extract-session.test.d.ts +0 -1
  148. package/dist/src/ee/extract-session.test.js +0 -192
  149. package/dist/src/ee/intercept.test.d.ts +0 -1
  150. package/dist/src/ee/intercept.test.js +0 -171
  151. package/dist/src/ee/judge.test.d.ts +0 -1
  152. package/dist/src/ee/judge.test.js +0 -190
  153. package/dist/src/ee/mistake-detector.test.d.ts +0 -1
  154. package/dist/src/ee/mistake-detector.test.js +0 -221
  155. package/dist/src/ee/offline-queue.test.d.ts +0 -1
  156. package/dist/src/ee/offline-queue.test.js +0 -246
  157. package/dist/src/ee/phase-outcome.test.d.ts +0 -1
  158. package/dist/src/ee/phase-outcome.test.js +0 -94
  159. package/dist/src/ee/phase-tracker.test.d.ts +0 -1
  160. package/dist/src/ee/phase-tracker.test.js +0 -142
  161. package/dist/src/ee/posttool.test.d.ts +0 -1
  162. package/dist/src/ee/posttool.test.js +0 -70
  163. package/dist/src/ee/prompt-stale.test.d.ts +0 -8
  164. package/dist/src/ee/prompt-stale.test.js +0 -76
  165. package/dist/src/ee/recall-mirror.test.d.ts +0 -1
  166. package/dist/src/ee/recall-mirror.test.js +0 -65
  167. package/dist/src/ee/render.test.d.ts +0 -1
  168. package/dist/src/ee/render.test.js +0 -63
  169. package/dist/src/ee/scope.test.d.ts +0 -1
  170. package/dist/src/ee/scope.test.js +0 -97
  171. package/dist/src/ee/search.test.d.ts +0 -1
  172. package/dist/src/ee/search.test.js +0 -23
  173. package/dist/src/ee/session-trajectory.test.d.ts +0 -1
  174. package/dist/src/ee/session-trajectory.test.js +0 -120
  175. package/dist/src/ee/touch.test.d.ts +0 -1
  176. package/dist/src/ee/touch.test.js +0 -62
  177. package/dist/src/ee/who-am-i.test.d.ts +0 -1
  178. package/dist/src/ee/who-am-i.test.js +0 -101
  179. package/dist/src/flow/__tests__/migration.test.d.ts +0 -1
  180. package/dist/src/flow/__tests__/migration.test.js +0 -105
  181. package/dist/src/flow/__tests__/parser.test.d.ts +0 -1
  182. package/dist/src/flow/__tests__/parser.test.js +0 -68
  183. package/dist/src/flow/__tests__/run-manager-product.test.d.ts +0 -1
  184. package/dist/src/flow/__tests__/run-manager-product.test.js +0 -49
  185. package/dist/src/flow/__tests__/run-manager.test.d.ts +0 -1
  186. package/dist/src/flow/__tests__/run-manager.test.js +0 -83
  187. package/dist/src/flow/__tests__/scaffold-checkpoint.test.d.ts +0 -1
  188. package/dist/src/flow/__tests__/scaffold-checkpoint.test.js +0 -93
  189. package/dist/src/flow/__tests__/scaffold.test.d.ts +0 -1
  190. package/dist/src/flow/__tests__/scaffold.test.js +0 -47
  191. package/dist/src/flow/__tests__/warning-persist.test.d.ts +0 -5
  192. package/dist/src/flow/__tests__/warning-persist.test.js +0 -96
  193. package/dist/src/flow/compaction/__tests__/compress.test.d.ts +0 -1
  194. package/dist/src/flow/compaction/__tests__/compress.test.js +0 -63
  195. package/dist/src/flow/compaction/__tests__/extract.test.d.ts +0 -1
  196. package/dist/src/flow/compaction/__tests__/extract.test.js +0 -66
  197. package/dist/src/flow/compaction/__tests__/preserve.test.d.ts +0 -1
  198. package/dist/src/flow/compaction/__tests__/preserve.test.js +0 -62
  199. package/dist/src/gsd/__tests__/gray-areas.test.d.ts +0 -1
  200. package/dist/src/gsd/__tests__/gray-areas.test.js +0 -29
  201. package/dist/src/gsd/__tests__/types.test.d.ts +0 -1
  202. package/dist/src/gsd/__tests__/types.test.js +0 -78
  203. package/dist/src/headless/__tests__/council-answers.test.d.ts +0 -1
  204. package/dist/src/headless/__tests__/council-answers.test.js +0 -251
  205. package/dist/src/headless/output.test.d.ts +0 -1
  206. package/dist/src/headless/output.test.js +0 -239
  207. package/dist/src/lsp/builtins.test.d.ts +0 -1
  208. package/dist/src/lsp/builtins.test.js +0 -112
  209. package/dist/src/lsp/client-normalize.test.d.ts +0 -12
  210. package/dist/src/lsp/client-normalize.test.js +0 -34
  211. package/dist/src/lsp/manager.test.d.ts +0 -1
  212. package/dist/src/lsp/manager.test.js +0 -194
  213. package/dist/src/lsp/npm-cache.test.d.ts +0 -1
  214. package/dist/src/lsp/npm-cache.test.js +0 -53
  215. package/dist/src/lsp/smoke.test.d.ts +0 -1
  216. package/dist/src/lsp/smoke.test.js +0 -56
  217. package/dist/src/maintain/__tests__/codebase-intel.test.d.ts +0 -5
  218. package/dist/src/maintain/__tests__/codebase-intel.test.js +0 -237
  219. package/dist/src/maintain/__tests__/gh-create-pr.test.d.ts +0 -11
  220. package/dist/src/maintain/__tests__/gh-create-pr.test.js +0 -160
  221. package/dist/src/maintain/__tests__/pr-builder.test.d.ts +0 -10
  222. package/dist/src/maintain/__tests__/pr-builder.test.js +0 -229
  223. package/dist/src/maintain/__tests__/repo-map.test.d.ts +0 -5
  224. package/dist/src/maintain/__tests__/repo-map.test.js +0 -90
  225. package/dist/src/maintain/__tests__/task-runner.test.d.ts +0 -11
  226. package/dist/src/maintain/__tests__/task-runner.test.js +0 -281
  227. package/dist/src/mcp/__tests__/auto-setup.test.d.ts +0 -1
  228. package/dist/src/mcp/__tests__/auto-setup.test.js +0 -155
  229. package/dist/src/mcp/__tests__/cap-tool-result.test.d.ts +0 -1
  230. package/dist/src/mcp/__tests__/cap-tool-result.test.js +0 -58
  231. package/dist/src/mcp/__tests__/client-pool.spec.d.ts +0 -1
  232. package/dist/src/mcp/__tests__/client-pool.spec.js +0 -169
  233. package/dist/src/mcp/__tests__/ee-tools.test.d.ts +0 -1
  234. package/dist/src/mcp/__tests__/ee-tools.test.js +0 -226
  235. package/dist/src/mcp/__tests__/forensics-tools.test.d.ts +0 -1
  236. package/dist/src/mcp/__tests__/forensics-tools.test.js +0 -54
  237. package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.d.ts +0 -1
  238. package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.js +0 -103
  239. package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.d.ts +0 -1
  240. package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.js +0 -112
  241. package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.d.ts +0 -1
  242. package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.js +0 -124
  243. package/dist/src/mcp/__tests__/harness-driver-security.spec.d.ts +0 -1
  244. package/dist/src/mcp/__tests__/harness-driver-security.spec.js +0 -61
  245. package/dist/src/mcp/__tests__/harness-driver.spec.d.ts +0 -1
  246. package/dist/src/mcp/__tests__/harness-driver.spec.js +0 -20
  247. package/dist/src/mcp/__tests__/lazy-schema.spec.d.ts +0 -1
  248. package/dist/src/mcp/__tests__/lazy-schema.spec.js +0 -152
  249. package/dist/src/mcp/__tests__/lsp-tools.test.d.ts +0 -1
  250. package/dist/src/mcp/__tests__/lsp-tools.test.js +0 -56
  251. package/dist/src/mcp/__tests__/mcp-keychain.test.d.ts +0 -1
  252. package/dist/src/mcp/__tests__/mcp-keychain.test.js +0 -40
  253. package/dist/src/mcp/__tests__/parallel-build.spec.d.ts +0 -1
  254. package/dist/src/mcp/__tests__/parallel-build.spec.js +0 -67
  255. package/dist/src/mcp/__tests__/research-onboarding.test.d.ts +0 -1
  256. package/dist/src/mcp/__tests__/research-onboarding.test.js +0 -148
  257. package/dist/src/mcp/__tests__/runtime-hydration.test.d.ts +0 -1
  258. package/dist/src/mcp/__tests__/runtime-hydration.test.js +0 -78
  259. package/dist/src/mcp/__tests__/runtime-output-cap.test.d.ts +0 -1
  260. package/dist/src/mcp/__tests__/runtime-output-cap.test.js +0 -42
  261. package/dist/src/mcp/__tests__/runtime-sanitize.test.d.ts +0 -1
  262. package/dist/src/mcp/__tests__/runtime-sanitize.test.js +0 -40
  263. package/dist/src/mcp/__tests__/self-verify-jobs.test.d.ts +0 -1
  264. package/dist/src/mcp/__tests__/self-verify-jobs.test.js +0 -92
  265. package/dist/src/mcp/__tests__/smart-filter.test.d.ts +0 -1
  266. package/dist/src/mcp/__tests__/smart-filter.test.js +0 -177
  267. package/dist/src/mcp/__tests__/tools-server.smoke.test.d.ts +0 -1
  268. package/dist/src/mcp/__tests__/tools-server.smoke.test.js +0 -42
  269. package/dist/src/mcp/parse-headers.test.d.ts +0 -1
  270. package/dist/src/mcp/parse-headers.test.js +0 -43
  271. package/dist/src/mcp/smoke.test.d.ts +0 -1
  272. package/dist/src/mcp/smoke.test.js +0 -159
  273. package/dist/src/models/__tests__/registry.test.d.ts +0 -1
  274. package/dist/src/models/__tests__/registry.test.js +0 -74
  275. package/dist/src/models/catalog-gemini.test.d.ts +0 -1
  276. package/dist/src/models/catalog-gemini.test.js +0 -48
  277. package/dist/src/models/catalog-url.test.d.ts +0 -1
  278. package/dist/src/models/catalog-url.test.js +0 -26
  279. package/dist/src/models/catalog-validation.test.d.ts +0 -1
  280. package/dist/src/models/catalog-validation.test.js +0 -63
  281. package/dist/src/ops/__tests__/doctor-council-mcp.test.d.ts +0 -1
  282. package/dist/src/ops/__tests__/doctor-council-mcp.test.js +0 -139
  283. package/dist/src/ops/__tests__/doctor-ee-health.test.d.ts +0 -1
  284. package/dist/src/ops/__tests__/doctor-ee-health.test.js +0 -134
  285. package/dist/src/ops/bug-report.test.d.ts +0 -1
  286. package/dist/src/ops/bug-report.test.js +0 -148
  287. package/dist/src/ops/doctor.test.d.ts +0 -1
  288. package/dist/src/ops/doctor.test.js +0 -97
  289. package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.d.ts +0 -1
  290. package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.js +0 -77
  291. package/dist/src/orchestrator/__tests__/auto-commit.test.d.ts +0 -1
  292. package/dist/src/orchestrator/__tests__/auto-commit.test.js +0 -142
  293. package/dist/src/orchestrator/__tests__/batch-turn-runner.test.d.ts +0 -1
  294. package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js +0 -164
  295. package/dist/src/orchestrator/__tests__/council-manager.test.d.ts +0 -1
  296. package/dist/src/orchestrator/__tests__/council-manager.test.js +0 -148
  297. package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.d.ts +0 -1
  298. package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.js +0 -175
  299. package/dist/src/orchestrator/__tests__/current-call-id.test.d.ts +0 -16
  300. package/dist/src/orchestrator/__tests__/current-call-id.test.js +0 -138
  301. package/dist/src/orchestrator/__tests__/delegations.test.d.ts +0 -1
  302. package/dist/src/orchestrator/__tests__/delegations.test.js +0 -96
  303. package/dist/src/orchestrator/__tests__/error-forensics.test.d.ts +0 -1
  304. package/dist/src/orchestrator/__tests__/error-forensics.test.js +0 -93
  305. package/dist/src/orchestrator/__tests__/flow-resume.test.d.ts +0 -5
  306. package/dist/src/orchestrator/__tests__/flow-resume.test.js +0 -61
  307. package/dist/src/orchestrator/__tests__/humanize-api-error.test.d.ts +0 -1
  308. package/dist/src/orchestrator/__tests__/humanize-api-error.test.js +0 -68
  309. package/dist/src/orchestrator/__tests__/mcp-capability-block.test.d.ts +0 -1
  310. package/dist/src/orchestrator/__tests__/mcp-capability-block.test.js +0 -39
  311. package/dist/src/orchestrator/__tests__/message-processor.test.d.ts +0 -1
  312. package/dist/src/orchestrator/__tests__/message-processor.test.js +0 -189
  313. package/dist/src/orchestrator/__tests__/message-write-ahead.test.d.ts +0 -22
  314. package/dist/src/orchestrator/__tests__/message-write-ahead.test.js +0 -149
  315. package/dist/src/orchestrator/__tests__/project-stack.test.d.ts +0 -1
  316. package/dist/src/orchestrator/__tests__/project-stack.test.js +0 -65
  317. package/dist/src/orchestrator/__tests__/prompts.test.d.ts +0 -1
  318. package/dist/src/orchestrator/__tests__/prompts.test.js +0 -88
  319. package/dist/src/orchestrator/__tests__/read-path-budget.test.d.ts +0 -1
  320. package/dist/src/orchestrator/__tests__/read-path-budget.test.js +0 -156
  321. package/dist/src/orchestrator/__tests__/retry-classifier.test.d.ts +0 -1
  322. package/dist/src/orchestrator/__tests__/retry-classifier.test.js +0 -112
  323. package/dist/src/orchestrator/__tests__/retry-stream.test.d.ts +0 -1
  324. package/dist/src/orchestrator/__tests__/retry-stream.test.js +0 -151
  325. package/dist/src/orchestrator/__tests__/route-feedback.test.d.ts +0 -1
  326. package/dist/src/orchestrator/__tests__/route-feedback.test.js +0 -47
  327. package/dist/src/orchestrator/__tests__/stream-runner.test.d.ts +0 -1
  328. package/dist/src/orchestrator/__tests__/stream-runner.test.js +0 -202
  329. package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.d.ts +0 -1
  330. package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.js +0 -45
  331. package/dist/src/orchestrator/__tests__/sub-session-delegation.test.d.ts +0 -1
  332. package/dist/src/orchestrator/__tests__/sub-session-delegation.test.js +0 -507
  333. package/dist/src/orchestrator/__tests__/usage-events-shape.test.d.ts +0 -8
  334. package/dist/src/orchestrator/__tests__/usage-events-shape.test.js +0 -58
  335. package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.d.ts +0 -21
  336. package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.js +0 -155
  337. package/dist/src/orchestrator/__tests__/usage-shape-threading.test.d.ts +0 -1
  338. package/dist/src/orchestrator/__tests__/usage-shape-threading.test.js +0 -98
  339. package/dist/src/orchestrator/__tests__/write-ahead.test.d.ts +0 -20
  340. package/dist/src/orchestrator/__tests__/write-ahead.test.js +0 -134
  341. package/dist/src/orchestrator/abort.test.d.ts +0 -1
  342. package/dist/src/orchestrator/abort.test.js +0 -34
  343. package/dist/src/orchestrator/agent.test.d.ts +0 -1
  344. package/dist/src/orchestrator/agent.test.js +0 -178
  345. package/dist/src/orchestrator/cleanup.test.d.ts +0 -1
  346. package/dist/src/orchestrator/cleanup.test.js +0 -67
  347. package/dist/src/orchestrator/compaction.test.d.ts +0 -1
  348. package/dist/src/orchestrator/compaction.test.js +0 -187
  349. package/dist/src/orchestrator/delegations.test.d.ts +0 -1
  350. package/dist/src/orchestrator/delegations.test.js +0 -107
  351. package/dist/src/orchestrator/grounding-check.test.d.ts +0 -1
  352. package/dist/src/orchestrator/grounding-check.test.js +0 -94
  353. package/dist/src/orchestrator/interrupted-turn.test.d.ts +0 -1
  354. package/dist/src/orchestrator/interrupted-turn.test.js +0 -34
  355. package/dist/src/orchestrator/message-seq.test.d.ts +0 -1
  356. package/dist/src/orchestrator/message-seq.test.js +0 -24
  357. package/dist/src/orchestrator/pending-calls.test.d.ts +0 -1
  358. package/dist/src/orchestrator/pending-calls.test.js +0 -188
  359. package/dist/src/orchestrator/provider-options-shape.spec.d.ts +0 -1
  360. package/dist/src/orchestrator/provider-options-shape.spec.js +0 -63
  361. package/dist/src/orchestrator/reasoning.test.d.ts +0 -1
  362. package/dist/src/orchestrator/reasoning.test.js +0 -101
  363. package/dist/src/orchestrator/repetition-detector.test.d.ts +0 -1
  364. package/dist/src/orchestrator/repetition-detector.test.js +0 -103
  365. package/dist/src/orchestrator/sandbox.test.d.ts +0 -1
  366. package/dist/src/orchestrator/sandbox.test.js +0 -99
  367. package/dist/src/orchestrator/scope-ceiling.test.d.ts +0 -13
  368. package/dist/src/orchestrator/scope-ceiling.test.js +0 -181
  369. package/dist/src/orchestrator/scope-reminder.test.d.ts +0 -15
  370. package/dist/src/orchestrator/scope-reminder.test.js +0 -225
  371. package/dist/src/orchestrator/session-experience.test.d.ts +0 -6
  372. package/dist/src/orchestrator/session-experience.test.js +0 -72
  373. package/dist/src/orchestrator/stall-rescue.test.d.ts +0 -1
  374. package/dist/src/orchestrator/stall-rescue.test.js +0 -117
  375. package/dist/src/orchestrator/stall-watchdog.test.d.ts +0 -1
  376. package/dist/src/orchestrator/stall-watchdog.test.js +0 -153
  377. package/dist/src/orchestrator/steer-inbox.test.d.ts +0 -1
  378. package/dist/src/orchestrator/steer-inbox.test.js +0 -33
  379. package/dist/src/orchestrator/sub-agent-cap.test.d.ts +0 -1
  380. package/dist/src/orchestrator/sub-agent-cap.test.js +0 -208
  381. package/dist/src/orchestrator/subagent-compactor.spec.d.ts +0 -1
  382. package/dist/src/orchestrator/subagent-compactor.spec.js +0 -636
  383. package/dist/src/orchestrator/text-tool-call-detector.test.d.ts +0 -1
  384. package/dist/src/orchestrator/text-tool-call-detector.test.js +0 -147
  385. package/dist/src/orchestrator/token-counter.test.d.ts +0 -1
  386. package/dist/src/orchestrator/token-counter.test.js +0 -57
  387. package/dist/src/orchestrator/tool-args-hash.test.d.ts +0 -1
  388. package/dist/src/orchestrator/tool-args-hash.test.js +0 -105
  389. package/dist/src/orchestrator/tool-args-repair.test.d.ts +0 -1
  390. package/dist/src/orchestrator/tool-args-repair.test.js +0 -136
  391. package/dist/src/orchestrator/tool-loop-askcard.test.d.ts +0 -1
  392. package/dist/src/orchestrator/tool-loop-askcard.test.js +0 -71
  393. package/dist/src/orchestrator/tool-loop-cap.test.d.ts +0 -1
  394. package/dist/src/orchestrator/tool-loop-cap.test.js +0 -176
  395. package/dist/src/orchestrator/tool-repetition-detector.test.d.ts +0 -1
  396. package/dist/src/orchestrator/tool-repetition-detector.test.js +0 -101
  397. package/dist/src/pil/__tests__/budget.test.d.ts +0 -1
  398. package/dist/src/pil/__tests__/budget.test.js +0 -33
  399. package/dist/src/pil/__tests__/clarity-gate.test.d.ts +0 -1
  400. package/dist/src/pil/__tests__/clarity-gate.test.js +0 -37
  401. package/dist/src/pil/__tests__/config.test.d.ts +0 -1
  402. package/dist/src/pil/__tests__/config.test.js +0 -57
  403. package/dist/src/pil/__tests__/discovery-cache.test.d.ts +0 -1
  404. package/dist/src/pil/__tests__/discovery-cache.test.js +0 -38
  405. package/dist/src/pil/__tests__/discovery-types.test.d.ts +0 -1
  406. package/dist/src/pil/__tests__/discovery-types.test.js +0 -65
  407. package/dist/src/pil/__tests__/discovery.test.d.ts +0 -1
  408. package/dist/src/pil/__tests__/discovery.test.js +0 -178
  409. package/dist/src/pil/__tests__/dual-run.test.d.ts +0 -1
  410. package/dist/src/pil/__tests__/dual-run.test.js +0 -51
  411. package/dist/src/pil/__tests__/layer1-intent-trace.test.d.ts +0 -1
  412. package/dist/src/pil/__tests__/layer1-intent-trace.test.js +0 -138
  413. package/dist/src/pil/__tests__/layer1-intent.test.d.ts +0 -1
  414. package/dist/src/pil/__tests__/layer1-intent.test.js +0 -329
  415. package/dist/src/pil/__tests__/layer15-context-scan.test.d.ts +0 -1
  416. package/dist/src/pil/__tests__/layer15-context-scan.test.js +0 -64
  417. package/dist/src/pil/__tests__/layer16-clarity.test.d.ts +0 -1
  418. package/dist/src/pil/__tests__/layer16-clarity.test.js +0 -72
  419. package/dist/src/pil/__tests__/layer17-feasibility.test.d.ts +0 -1
  420. package/dist/src/pil/__tests__/layer17-feasibility.test.js +0 -36
  421. package/dist/src/pil/__tests__/layer18-acceptance.test.d.ts +0 -1
  422. package/dist/src/pil/__tests__/layer18-acceptance.test.js +0 -18
  423. package/dist/src/pil/__tests__/layer2-personality.test.d.ts +0 -1
  424. package/dist/src/pil/__tests__/layer2-personality.test.js +0 -57
  425. package/dist/src/pil/__tests__/layer2_5-ponytail.test.d.ts +0 -1
  426. package/dist/src/pil/__tests__/layer2_5-ponytail.test.js +0 -53
  427. package/dist/src/pil/__tests__/layer3-ee-injection.test.d.ts +0 -1
  428. package/dist/src/pil/__tests__/layer3-ee-injection.test.js +0 -221
  429. package/dist/src/pil/__tests__/layer3-injected-chunk.test.d.ts +0 -1
  430. package/dist/src/pil/__tests__/layer3-injected-chunk.test.js +0 -134
  431. package/dist/src/pil/__tests__/layer4-gsd.test.d.ts +0 -1
  432. package/dist/src/pil/__tests__/layer4-gsd.test.js +0 -191
  433. package/dist/src/pil/__tests__/layer5-context.test.d.ts +0 -1
  434. package/dist/src/pil/__tests__/layer5-context.test.js +0 -175
  435. package/dist/src/pil/__tests__/layer6-output.test.d.ts +0 -1
  436. package/dist/src/pil/__tests__/layer6-output.test.js +0 -465
  437. package/dist/src/pil/__tests__/llm-classify.test.d.ts +0 -1
  438. package/dist/src/pil/__tests__/llm-classify.test.js +0 -275
  439. package/dist/src/pil/__tests__/native-capabilities-workbook.test.d.ts +0 -1
  440. package/dist/src/pil/__tests__/native-capabilities-workbook.test.js +0 -40
  441. package/dist/src/pil/__tests__/ollama-classify.test.d.ts +0 -1
  442. package/dist/src/pil/__tests__/ollama-classify.test.js +0 -68
  443. package/dist/src/pil/__tests__/orchestrator-integration.test.d.ts +0 -10
  444. package/dist/src/pil/__tests__/orchestrator-integration.test.js +0 -100
  445. package/dist/src/pil/__tests__/pipeline.test.d.ts +0 -1
  446. package/dist/src/pil/__tests__/pipeline.test.js +0 -188
  447. package/dist/src/pil/__tests__/renderer-coverage.test.d.ts +0 -7
  448. package/dist/src/pil/__tests__/renderer-coverage.test.js +0 -42
  449. package/dist/src/pil/__tests__/response-tools.test.d.ts +0 -1
  450. package/dist/src/pil/__tests__/response-tools.test.js +0 -242
  451. package/dist/src/pil/__tests__/schema.test.d.ts +0 -1
  452. package/dist/src/pil/__tests__/schema.test.js +0 -202
  453. package/dist/src/pil/__tests__/scoreComplexity.test.d.ts +0 -1
  454. package/dist/src/pil/__tests__/scoreComplexity.test.js +0 -119
  455. package/dist/src/pil/__tests__/scoreSufficiency.test.d.ts +0 -8
  456. package/dist/src/pil/__tests__/scoreSufficiency.test.js +0 -89
  457. package/dist/src/pil/__tests__/store.test.d.ts +0 -1
  458. package/dist/src/pil/__tests__/store.test.js +0 -44
  459. package/dist/src/pil/__tests__/surface-compaction-artifacts.test.d.ts +0 -1
  460. package/dist/src/pil/__tests__/surface-compaction-artifacts.test.js +0 -112
  461. package/dist/src/pil/__tests__/task-tier-map.test.d.ts +0 -1
  462. package/dist/src/pil/__tests__/task-tier-map.test.js +0 -33
  463. package/dist/src/pil/agent-operating-contract.test.d.ts +0 -1
  464. package/dist/src/pil/agent-operating-contract.test.js +0 -80
  465. package/dist/src/pil/cheap-model-playbook.test.d.ts +0 -1
  466. package/dist/src/pil/cheap-model-playbook.test.js +0 -160
  467. package/dist/src/pil/cheap-model-workbooks.test.d.ts +0 -1
  468. package/dist/src/pil/cheap-model-workbooks.test.js +0 -129
  469. package/dist/src/pil/layer1-intent.test.d.ts +0 -1
  470. package/dist/src/pil/layer1-intent.test.js +0 -764
  471. package/dist/src/pil/layer1_5-complexity-size.test.d.ts +0 -10
  472. package/dist/src/pil/layer1_5-complexity-size.test.js +0 -248
  473. package/dist/src/pil/session-experience-injection.test.d.ts +0 -6
  474. package/dist/src/pil/session-experience-injection.test.js +0 -79
  475. package/dist/src/pil/session-state.test.d.ts +0 -1
  476. package/dist/src/pil/session-state.test.js +0 -73
  477. package/dist/src/playbook/__tests__/directives.test.d.ts +0 -1
  478. package/dist/src/playbook/__tests__/directives.test.js +0 -115
  479. package/dist/src/product-loop/__tests__/artifact-io.test.d.ts +0 -1
  480. package/dist/src/product-loop/__tests__/artifact-io.test.js +0 -83
  481. package/dist/src/product-loop/__tests__/assumption-ledger.test.d.ts +0 -1
  482. package/dist/src/product-loop/__tests__/assumption-ledger.test.js +0 -261
  483. package/dist/src/product-loop/__tests__/backlog-builder.test.d.ts +0 -10
  484. package/dist/src/product-loop/__tests__/backlog-builder.test.js +0 -175
  485. package/dist/src/product-loop/__tests__/backlog-store.test.d.ts +0 -4
  486. package/dist/src/product-loop/__tests__/backlog-store.test.js +0 -96
  487. package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.d.ts +0 -13
  488. package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.js +0 -158
  489. package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.d.ts +0 -1
  490. package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.js +0 -67
  491. package/dist/src/product-loop/__tests__/circuit-breakers.test.d.ts +0 -1
  492. package/dist/src/product-loop/__tests__/circuit-breakers.test.js +0 -79
  493. package/dist/src/product-loop/__tests__/complexity-routing.spec.d.ts +0 -11
  494. package/dist/src/product-loop/__tests__/complexity-routing.spec.js +0 -240
  495. package/dist/src/product-loop/__tests__/context-policy.test.d.ts +0 -1
  496. package/dist/src/product-loop/__tests__/context-policy.test.js +0 -266
  497. package/dist/src/product-loop/__tests__/cost-preview.test.d.ts +0 -1
  498. package/dist/src/product-loop/__tests__/cost-preview.test.js +0 -111
  499. package/dist/src/product-loop/__tests__/cost-scoper.test.d.ts +0 -1
  500. package/dist/src/product-loop/__tests__/cost-scoper.test.js +0 -50
  501. package/dist/src/product-loop/__tests__/cross-run-memory.test.d.ts +0 -1
  502. package/dist/src/product-loop/__tests__/cross-run-memory.test.js +0 -168
  503. package/dist/src/product-loop/__tests__/design-output.spec.d.ts +0 -1
  504. package/dist/src/product-loop/__tests__/design-output.spec.js +0 -36
  505. package/dist/src/product-loop/__tests__/discover.test.d.ts +0 -1
  506. package/dist/src/product-loop/__tests__/discover.test.js +0 -83
  507. package/dist/src/product-loop/__tests__/discovery-context-format.test.d.ts +0 -13
  508. package/dist/src/product-loop/__tests__/discovery-context-format.test.js +0 -100
  509. package/dist/src/product-loop/__tests__/discovery-council-runner.test.d.ts +0 -1
  510. package/dist/src/product-loop/__tests__/discovery-council-runner.test.js +0 -13
  511. package/dist/src/product-loop/__tests__/discovery-detection.test.d.ts +0 -1
  512. package/dist/src/product-loop/__tests__/discovery-detection.test.js +0 -151
  513. package/dist/src/product-loop/__tests__/discovery-ecosystem.test.d.ts +0 -8
  514. package/dist/src/product-loop/__tests__/discovery-ecosystem.test.js +0 -209
  515. package/dist/src/product-loop/__tests__/discovery-integration.test.d.ts +0 -1
  516. package/dist/src/product-loop/__tests__/discovery-integration.test.js +0 -126
  517. package/dist/src/product-loop/__tests__/discovery-interview.test.d.ts +0 -1
  518. package/dist/src/product-loop/__tests__/discovery-interview.test.js +0 -394
  519. package/dist/src/product-loop/__tests__/discovery-migrations.test.d.ts +0 -1
  520. package/dist/src/product-loop/__tests__/discovery-migrations.test.js +0 -69
  521. package/dist/src/product-loop/__tests__/discovery-persistence.test.d.ts +0 -1
  522. package/dist/src/product-loop/__tests__/discovery-persistence.test.js +0 -146
  523. package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.d.ts +0 -1
  524. package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.js +0 -65
  525. package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.d.ts +0 -1
  526. package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.js +0 -55
  527. package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.d.ts +0 -9
  528. package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.js +0 -178
  529. package/dist/src/product-loop/__tests__/discovery-recommender.test.d.ts +0 -1
  530. package/dist/src/product-loop/__tests__/discovery-recommender.test.js +0 -316
  531. package/dist/src/product-loop/__tests__/discovery-schema.test.d.ts +0 -1
  532. package/dist/src/product-loop/__tests__/discovery-schema.test.js +0 -77
  533. package/dist/src/product-loop/__tests__/done-gate-coverage.test.d.ts +0 -1
  534. package/dist/src/product-loop/__tests__/done-gate-coverage.test.js +0 -135
  535. package/dist/src/product-loop/__tests__/done-gate.test.d.ts +0 -1
  536. package/dist/src/product-loop/__tests__/done-gate.test.js +0 -122
  537. package/dist/src/product-loop/__tests__/ee-extract-wiring.test.d.ts +0 -8
  538. package/dist/src/product-loop/__tests__/ee-extract-wiring.test.js +0 -186
  539. package/dist/src/product-loop/__tests__/extract-to-ee.test.d.ts +0 -1
  540. package/dist/src/product-loop/__tests__/extract-to-ee.test.js +0 -161
  541. package/dist/src/product-loop/__tests__/feedback-routing.test.d.ts +0 -1
  542. package/dist/src/product-loop/__tests__/feedback-routing.test.js +0 -83
  543. package/dist/src/product-loop/__tests__/gather-selectable-alts.test.d.ts +0 -15
  544. package/dist/src/product-loop/__tests__/gather-selectable-alts.test.js +0 -143
  545. package/dist/src/product-loop/__tests__/hot-path.spec.d.ts +0 -11
  546. package/dist/src/product-loop/__tests__/hot-path.spec.js +0 -146
  547. package/dist/src/product-loop/__tests__/integration.test.d.ts +0 -7
  548. package/dist/src/product-loop/__tests__/integration.test.js +0 -301
  549. package/dist/src/product-loop/__tests__/loop-driver-audit.test.d.ts +0 -1
  550. package/dist/src/product-loop/__tests__/loop-driver-audit.test.js +0 -269
  551. package/dist/src/product-loop/__tests__/loop-driver.test.d.ts +0 -1
  552. package/dist/src/product-loop/__tests__/loop-driver.test.js +0 -225
  553. package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.d.ts +0 -8
  554. package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.js +0 -67
  555. package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.d.ts +0 -13
  556. package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.js +0 -268
  557. package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.d.ts +0 -8
  558. package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.js +0 -162
  559. package/dist/src/product-loop/__tests__/phase-budget.test.d.ts +0 -1
  560. package/dist/src/product-loop/__tests__/phase-budget.test.js +0 -149
  561. package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.d.ts +0 -1
  562. package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.js +0 -138
  563. package/dist/src/product-loop/__tests__/phase-plan.test.d.ts +0 -1
  564. package/dist/src/product-loop/__tests__/phase-plan.test.js +0 -208
  565. package/dist/src/product-loop/__tests__/phase-rituals.test.d.ts +0 -1
  566. package/dist/src/product-loop/__tests__/phase-rituals.test.js +0 -174
  567. package/dist/src/product-loop/__tests__/phase-runner.test.d.ts +0 -1
  568. package/dist/src/product-loop/__tests__/phase-runner.test.js +0 -414
  569. package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.d.ts +0 -1
  570. package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.js +0 -67
  571. package/dist/src/product-loop/__tests__/pick-backend-stack.test.d.ts +0 -11
  572. package/dist/src/product-loop/__tests__/pick-backend-stack.test.js +0 -95
  573. package/dist/src/product-loop/__tests__/product-identity.test.d.ts +0 -1
  574. package/dist/src/product-loop/__tests__/product-identity.test.js +0 -40
  575. package/dist/src/product-loop/__tests__/progress-snapshot.test.d.ts +0 -8
  576. package/dist/src/product-loop/__tests__/progress-snapshot.test.js +0 -152
  577. package/dist/src/product-loop/__tests__/reality-anchor.test.d.ts +0 -1
  578. package/dist/src/product-loop/__tests__/reality-anchor.test.js +0 -49
  579. package/dist/src/product-loop/__tests__/repo-audit.test.d.ts +0 -1
  580. package/dist/src/product-loop/__tests__/repo-audit.test.js +0 -97
  581. package/dist/src/product-loop/__tests__/repo-brief.test.d.ts +0 -9
  582. package/dist/src/product-loop/__tests__/repo-brief.test.js +0 -132
  583. package/dist/src/product-loop/__tests__/role-memory.test.d.ts +0 -1
  584. package/dist/src/product-loop/__tests__/role-memory.test.js +0 -56
  585. package/dist/src/product-loop/__tests__/role-registry.test.d.ts +0 -1
  586. package/dist/src/product-loop/__tests__/role-registry.test.js +0 -222
  587. package/dist/src/product-loop/__tests__/role-routing-ee.test.d.ts +0 -1
  588. package/dist/src/product-loop/__tests__/role-routing-ee.test.js +0 -79
  589. package/dist/src/product-loop/__tests__/route-decision-emit.test.d.ts +0 -10
  590. package/dist/src/product-loop/__tests__/route-decision-emit.test.js +0 -222
  591. package/dist/src/product-loop/__tests__/seed-questions.test.d.ts +0 -1
  592. package/dist/src/product-loop/__tests__/seed-questions.test.js +0 -30
  593. package/dist/src/product-loop/__tests__/ship-polish.test.d.ts +0 -1
  594. package/dist/src/product-loop/__tests__/ship-polish.test.js +0 -96
  595. package/dist/src/product-loop/__tests__/sprint-planner.test.d.ts +0 -6
  596. package/dist/src/product-loop/__tests__/sprint-planner.test.js +0 -140
  597. package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.d.ts +0 -8
  598. package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.js +0 -221
  599. package/dist/src/product-loop/__tests__/sprint-runner-emit.test.d.ts +0 -14
  600. package/dist/src/product-loop/__tests__/sprint-runner-emit.test.js +0 -279
  601. package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.d.ts +0 -14
  602. package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.js +0 -193
  603. package/dist/src/product-loop/__tests__/sprint-runner.test.d.ts +0 -1
  604. package/dist/src/product-loop/__tests__/sprint-runner.test.js +0 -432
  605. package/dist/src/product-loop/__tests__/sprint-self-verify.test.d.ts +0 -8
  606. package/dist/src/product-loop/__tests__/sprint-self-verify.test.js +0 -73
  607. package/dist/src/product-loop/__tests__/sprint-store.test.d.ts +0 -7
  608. package/dist/src/product-loop/__tests__/sprint-store.test.js +0 -84
  609. package/dist/src/product-loop/__tests__/stakeholder-acl.test.d.ts +0 -1
  610. package/dist/src/product-loop/__tests__/stakeholder-acl.test.js +0 -83
  611. package/dist/src/product-loop/__tests__/state-md-ee-injections.test.d.ts +0 -8
  612. package/dist/src/product-loop/__tests__/state-md-ee-injections.test.js +0 -182
  613. package/dist/src/product-loop/__tests__/sufficiency-routing.spec.d.ts +0 -12
  614. package/dist/src/product-loop/__tests__/sufficiency-routing.spec.js +0 -140
  615. package/dist/src/product-loop/__tests__/typed-artifacts.test.d.ts +0 -1
  616. package/dist/src/product-loop/__tests__/typed-artifacts.test.js +0 -222
  617. package/dist/src/product-loop/__tests__/types.test.d.ts +0 -1
  618. package/dist/src/product-loop/__tests__/types.test.js +0 -79
  619. package/dist/src/product-loop/__tests__/verify-failure-threshold.test.d.ts +0 -9
  620. package/dist/src/product-loop/__tests__/verify-failure-threshold.test.js +0 -146
  621. package/dist/src/product-loop/__tests__/verify-failure-tracking.test.d.ts +0 -4
  622. package/dist/src/product-loop/__tests__/verify-failure-tracking.test.js +0 -122
  623. package/dist/src/product-loop/__tests__/verify-result.test.d.ts +0 -1
  624. package/dist/src/product-loop/__tests__/verify-result.test.js +0 -53
  625. package/dist/src/providers/__tests__/adapter-oauth-wiring.test.d.ts +0 -8
  626. package/dist/src/providers/__tests__/adapter-oauth-wiring.test.js +0 -125
  627. package/dist/src/providers/__tests__/capabilities-cosmetic.test.d.ts +0 -1
  628. package/dist/src/providers/__tests__/capabilities-cosmetic.test.js +0 -109
  629. package/dist/src/providers/__tests__/capabilities-flags.test.d.ts +0 -1
  630. package/dist/src/providers/__tests__/capabilities-flags.test.js +0 -145
  631. package/dist/src/providers/__tests__/capabilities-provider-options.test.d.ts +0 -1
  632. package/dist/src/providers/__tests__/capabilities-provider-options.test.js +0 -201
  633. package/dist/src/providers/__tests__/capabilities-sanitize.test.d.ts +0 -1
  634. package/dist/src/providers/__tests__/capabilities-sanitize.test.js +0 -60
  635. package/dist/src/providers/__tests__/capabilities.test.d.ts +0 -1
  636. package/dist/src/providers/__tests__/capabilities.test.js +0 -41
  637. package/dist/src/providers/__tests__/provider-coverage.test.d.ts +0 -1
  638. package/dist/src/providers/__tests__/provider-coverage.test.js +0 -45
  639. package/dist/src/providers/__tests__/reasoning-roundtrip.test.d.ts +0 -1
  640. package/dist/src/providers/__tests__/reasoning-roundtrip.test.js +0 -216
  641. package/dist/src/providers/__tests__/runtime-integration.test.d.ts +0 -1
  642. package/dist/src/providers/__tests__/runtime-integration.test.js +0 -93
  643. package/dist/src/providers/__tests__/runtime.test.d.ts +0 -1
  644. package/dist/src/providers/__tests__/runtime.test.js +0 -80
  645. package/dist/src/providers/__tests__/siliconflow-sse-repair.test.d.ts +0 -1
  646. package/dist/src/providers/__tests__/siliconflow-sse-repair.test.js +0 -267
  647. package/dist/src/providers/__tests__/strategies-registry.test.d.ts +0 -8
  648. package/dist/src/providers/__tests__/strategies-registry.test.js +0 -49
  649. package/dist/src/providers/__tests__/strategies-resolve.test.d.ts +0 -12
  650. package/dist/src/providers/__tests__/strategies-resolve.test.js +0 -128
  651. package/dist/src/providers/__tests__/wire-debug.test.d.ts +0 -1
  652. package/dist/src/providers/__tests__/wire-debug.test.js +0 -39
  653. package/dist/src/providers/adapter.test.d.ts +0 -1
  654. package/dist/src/providers/adapter.test.js +0 -19
  655. package/dist/src/providers/auth/__tests__/browser-flow.test.d.ts +0 -8
  656. package/dist/src/providers/auth/__tests__/browser-flow.test.js +0 -186
  657. package/dist/src/providers/auth/__tests__/device-flow.test.d.ts +0 -6
  658. package/dist/src/providers/auth/__tests__/device-flow.test.js +0 -219
  659. package/dist/src/providers/auth/__tests__/gemini-oauth.test.d.ts +0 -4
  660. package/dist/src/providers/auth/__tests__/gemini-oauth.test.js +0 -306
  661. package/dist/src/providers/auth/__tests__/grok-oauth.test.d.ts +0 -8
  662. package/dist/src/providers/auth/__tests__/grok-oauth.test.js +0 -236
  663. package/dist/src/providers/auth/__tests__/openai-oauth.test.d.ts +0 -7
  664. package/dist/src/providers/auth/__tests__/openai-oauth.test.js +0 -309
  665. package/dist/src/providers/auth/__tests__/token-store.test.d.ts +0 -7
  666. package/dist/src/providers/auth/__tests__/token-store.test.js +0 -125
  667. package/dist/src/providers/errors.test.d.ts +0 -1
  668. package/dist/src/providers/errors.test.js +0 -66
  669. package/dist/src/providers/gemini.test.d.ts +0 -1
  670. package/dist/src/providers/gemini.test.js +0 -37
  671. package/dist/src/providers/keychain.test.d.ts +0 -1
  672. package/dist/src/providers/keychain.test.js +0 -84
  673. package/dist/src/providers/mcp-vision-bridge.test.d.ts +0 -1
  674. package/dist/src/providers/mcp-vision-bridge.test.js +0 -381
  675. package/dist/src/providers/ollama.test.d.ts +0 -1
  676. package/dist/src/providers/ollama.test.js +0 -37
  677. package/dist/src/providers/openai-compatible.test.d.ts +0 -1
  678. package/dist/src/providers/openai-compatible.test.js +0 -53
  679. package/dist/src/providers/openai.test.d.ts +0 -1
  680. package/dist/src/providers/openai.test.js +0 -53
  681. package/dist/src/providers/pricing.test.d.ts +0 -1
  682. package/dist/src/providers/pricing.test.js +0 -81
  683. package/dist/src/providers/prompt-cache-key.spec.d.ts +0 -5
  684. package/dist/src/providers/prompt-cache-key.spec.js +0 -24
  685. package/dist/src/providers/runtime-mock.spec.d.ts +0 -8
  686. package/dist/src/providers/runtime-mock.spec.js +0 -69
  687. package/dist/src/providers/vision-proxy.test.d.ts +0 -1
  688. package/dist/src/providers/vision-proxy.test.js +0 -212
  689. package/dist/src/reporter/__tests__/acl-check.test.d.ts +0 -6
  690. package/dist/src/reporter/__tests__/acl-check.test.js +0 -59
  691. package/dist/src/reporter/__tests__/auto-fire.test.d.ts +0 -10
  692. package/dist/src/reporter/__tests__/auto-fire.test.js +0 -140
  693. package/dist/src/reporter/__tests__/budget.test.d.ts +0 -7
  694. package/dist/src/reporter/__tests__/budget.test.js +0 -60
  695. package/dist/src/reporter/__tests__/handlers.test.d.ts +0 -7
  696. package/dist/src/reporter/__tests__/handlers.test.js +0 -163
  697. package/dist/src/reporter/__tests__/query-router.test.d.ts +0 -6
  698. package/dist/src/reporter/__tests__/query-router.test.js +0 -90
  699. package/dist/src/router/__tests__/step-router.test.d.ts +0 -4
  700. package/dist/src/router/__tests__/step-router.test.js +0 -131
  701. package/dist/src/router/classifier/index.test.d.ts +0 -1
  702. package/dist/src/router/classifier/index.test.js +0 -29
  703. package/dist/src/router/classifier/regex.test.d.ts +0 -1
  704. package/dist/src/router/classifier/regex.test.js +0 -44
  705. package/dist/src/router/classifier/tree-sitter.test.d.ts +0 -1
  706. package/dist/src/router/classifier/tree-sitter.test.js +0 -23
  707. package/dist/src/router/cold.test.d.ts +0 -1
  708. package/dist/src/router/cold.test.js +0 -56
  709. package/dist/src/router/decide.test.d.ts +0 -1
  710. package/dist/src/router/decide.test.js +0 -198
  711. package/dist/src/router/health.test.d.ts +0 -1
  712. package/dist/src/router/health.test.js +0 -52
  713. package/dist/src/router/provider-sentinel.test.d.ts +0 -1
  714. package/dist/src/router/provider-sentinel.test.js +0 -20
  715. package/dist/src/router/role-override.test.d.ts +0 -1
  716. package/dist/src/router/role-override.test.js +0 -26
  717. package/dist/src/router/warm.test.d.ts +0 -1
  718. package/dist/src/router/warm.test.js +0 -202
  719. package/dist/src/scaffold/__tests__/continuation-prompt.test.d.ts +0 -4
  720. package/dist/src/scaffold/__tests__/continuation-prompt.test.js +0 -79
  721. package/dist/src/scaffold/__tests__/continue-as-council.spec.d.ts +0 -10
  722. package/dist/src/scaffold/__tests__/continue-as-council.spec.js +0 -102
  723. package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.d.ts +0 -1
  724. package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.js +0 -27
  725. package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.d.ts +0 -1
  726. package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.js +0 -106
  727. package/dist/src/scaffold/__tests__/init-new.smoke.spec.d.ts +0 -15
  728. package/dist/src/scaffold/__tests__/init-new.smoke.spec.js +0 -81
  729. package/dist/src/scaffold/__tests__/init-new.spec.d.ts +0 -5
  730. package/dist/src/scaffold/__tests__/init-new.spec.js +0 -378
  731. package/dist/src/scaffold/__tests__/install-bb-templates.spec.d.ts +0 -1
  732. package/dist/src/scaffold/__tests__/install-bb-templates.spec.js +0 -77
  733. package/dist/src/scaffold/__tests__/point-to-existing.spec.d.ts +0 -7
  734. package/dist/src/scaffold/__tests__/point-to-existing.spec.js +0 -94
  735. package/dist/src/self-qa/__tests__/agentic-context.test.d.ts +0 -1
  736. package/dist/src/self-qa/__tests__/agentic-context.test.js +0 -98
  737. package/dist/src/self-qa/__tests__/agentic-loop.test.d.ts +0 -1
  738. package/dist/src/self-qa/__tests__/agentic-loop.test.js +0 -62
  739. package/dist/src/self-qa/__tests__/delta-encoder.test.d.ts +0 -1
  740. package/dist/src/self-qa/__tests__/delta-encoder.test.js +0 -97
  741. package/dist/src/self-qa/__tests__/judge.test.d.ts +0 -1
  742. package/dist/src/self-qa/__tests__/judge.test.js +0 -131
  743. package/dist/src/self-qa/__tests__/scenario-planner.test.d.ts +0 -1
  744. package/dist/src/self-qa/__tests__/scenario-planner.test.js +0 -79
  745. package/dist/src/self-qa/__tests__/spec-emitter.test.d.ts +0 -1
  746. package/dist/src/self-qa/__tests__/spec-emitter.test.js +0 -62
  747. package/dist/src/storage/__tests__/hierarchical-session.test.d.ts +0 -1
  748. package/dist/src/storage/__tests__/hierarchical-session.test.js +0 -161
  749. package/dist/src/storage/__tests__/migrations.test.d.ts +0 -12
  750. package/dist/src/storage/__tests__/migrations.test.js +0 -357
  751. package/dist/src/storage/__tests__/sweep-stale-pending.test.d.ts +0 -10
  752. package/dist/src/storage/__tests__/sweep-stale-pending.test.js +0 -97
  753. package/dist/src/storage/__tests__/ui-interaction-log.test.d.ts +0 -7
  754. package/dist/src/storage/__tests__/ui-interaction-log.test.js +0 -127
  755. package/dist/src/storage/atomic-io.test.d.ts +0 -1
  756. package/dist/src/storage/atomic-io.test.js +0 -74
  757. package/dist/src/storage/config.test.d.ts +0 -1
  758. package/dist/src/storage/config.test.js +0 -29
  759. package/dist/src/storage/session-experience-store.test.d.ts +0 -5
  760. package/dist/src/storage/session-experience-store.test.js +0 -86
  761. package/dist/src/storage/tool-results.test.d.ts +0 -1
  762. package/dist/src/storage/tool-results.test.js +0 -48
  763. package/dist/src/storage/transcript-response-entry.test.d.ts +0 -1
  764. package/dist/src/storage/transcript-response-entry.test.js +0 -111
  765. package/dist/src/storage/transcript.test.d.ts +0 -1
  766. package/dist/src/storage/transcript.test.js +0 -22
  767. package/dist/src/storage/usage-cap.test.d.ts +0 -1
  768. package/dist/src/storage/usage-cap.test.js +0 -51
  769. package/dist/src/tools/__tests__/native-tools.test.d.ts +0 -1
  770. package/dist/src/tools/__tests__/native-tools.test.js +0 -59
  771. package/dist/src/tools/__tests__/vision-gate.test.d.ts +0 -1
  772. package/dist/src/tools/__tests__/vision-gate.test.js +0 -56
  773. package/dist/src/tools/bash-output-cache.test.d.ts +0 -1
  774. package/dist/src/tools/bash-output-cache.test.js +0 -89
  775. package/dist/src/tools/bash-output-integration.test.d.ts +0 -10
  776. package/dist/src/tools/bash-output-integration.test.js +0 -30
  777. package/dist/src/tools/bash.test.d.ts +0 -1
  778. package/dist/src/tools/bash.test.js +0 -90
  779. package/dist/src/tools/computer.test.d.ts +0 -1
  780. package/dist/src/tools/computer.test.js +0 -142
  781. package/dist/src/tools/file-tracker.test.d.ts +0 -1
  782. package/dist/src/tools/file-tracker.test.js +0 -77
  783. package/dist/src/tools/file.test.d.ts +0 -1
  784. package/dist/src/tools/file.test.js +0 -106
  785. package/dist/src/tools/git-safety.test.d.ts +0 -1
  786. package/dist/src/tools/git-safety.test.js +0 -155
  787. package/dist/src/tools/registry-bash-empty-command.test.d.ts +0 -13
  788. package/dist/src/tools/registry-bash-empty-command.test.js +0 -57
  789. package/dist/src/tools/registry-bash-footer.test.d.ts +0 -7
  790. package/dist/src/tools/registry-bash-footer.test.js +0 -82
  791. package/dist/src/tools/registry-ee-query.test.d.ts +0 -11
  792. package/dist/src/tools/registry-ee-query.test.js +0 -71
  793. package/dist/src/tools/registry-git-safety.test.d.ts +0 -7
  794. package/dist/src/tools/registry-git-safety.test.js +0 -103
  795. package/dist/src/tools/registry-session-repeat.test.d.ts +0 -12
  796. package/dist/src/tools/registry-session-repeat.test.js +0 -87
  797. package/dist/src/tools/registry.test.d.ts +0 -1
  798. package/dist/src/tools/registry.test.js +0 -34
  799. package/dist/src/tools/schedule.test.d.ts +0 -1
  800. package/dist/src/tools/schedule.test.js +0 -118
  801. package/dist/src/tools/todo-write-snapshot.test.d.ts +0 -1
  802. package/dist/src/tools/todo-write-snapshot.test.js +0 -43
  803. package/dist/src/ui/__tests__/markdown-render.test.d.ts +0 -1
  804. package/dist/src/ui/__tests__/markdown-render.test.js +0 -65
  805. package/dist/src/ui/__tests__/picker-providers.test.d.ts +0 -1
  806. package/dist/src/ui/__tests__/picker-providers.test.js +0 -31
  807. package/dist/src/ui/cards/__tests__/product-status-card.test.d.ts +0 -1
  808. package/dist/src/ui/cards/__tests__/product-status-card.test.js +0 -27
  809. package/dist/src/ui/components/__tests__/council-leader-bubble.test.d.ts +0 -1
  810. package/dist/src/ui/components/__tests__/council-leader-bubble.test.js +0 -14
  811. package/dist/src/ui/components/__tests__/council-message-bubble.test.d.ts +0 -1
  812. package/dist/src/ui/components/__tests__/council-message-bubble.test.js +0 -74
  813. package/dist/src/ui/components/__tests__/council-phase-timeline.test.d.ts +0 -1
  814. package/dist/src/ui/components/__tests__/council-phase-timeline.test.js +0 -51
  815. package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.d.ts +0 -1
  816. package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.js +0 -14
  817. package/dist/src/ui/components/__tests__/council-question-card.test.d.ts +0 -1
  818. package/dist/src/ui/components/__tests__/council-question-card.test.js +0 -121
  819. package/dist/src/ui/components/__tests__/council-synthesis-banner.test.d.ts +0 -1
  820. package/dist/src/ui/components/__tests__/council-synthesis-banner.test.js +0 -11
  821. package/dist/src/ui/components/__tests__/task-list-panel.test.d.ts +0 -1
  822. package/dist/src/ui/components/__tests__/task-list-panel.test.js +0 -31
  823. package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.d.ts +0 -1
  824. package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.js +0 -37
  825. package/dist/src/ui/slash/__tests__/clear.test.d.ts +0 -1
  826. package/dist/src/ui/slash/__tests__/clear.test.js +0 -58
  827. package/dist/src/ui/slash/__tests__/compact.test.d.ts +0 -1
  828. package/dist/src/ui/slash/__tests__/compact.test.js +0 -43
  829. package/dist/src/ui/slash/__tests__/cost.test.d.ts +0 -1
  830. package/dist/src/ui/slash/__tests__/cost.test.js +0 -54
  831. package/dist/src/ui/slash/__tests__/discuss.test.d.ts +0 -1
  832. package/dist/src/ui/slash/__tests__/discuss.test.js +0 -83
  833. package/dist/src/ui/slash/__tests__/execute.test.d.ts +0 -1
  834. package/dist/src/ui/slash/__tests__/execute.test.js +0 -71
  835. package/dist/src/ui/slash/__tests__/expand.test.d.ts +0 -1
  836. package/dist/src/ui/slash/__tests__/expand.test.js +0 -67
  837. package/dist/src/ui/slash/__tests__/ideal.test.d.ts +0 -1
  838. package/dist/src/ui/slash/__tests__/ideal.test.js +0 -158
  839. package/dist/src/ui/slash/__tests__/menu-parity.test.d.ts +0 -17
  840. package/dist/src/ui/slash/__tests__/menu-parity.test.js +0 -43
  841. package/dist/src/ui/slash/__tests__/optimize.test.d.ts +0 -1
  842. package/dist/src/ui/slash/__tests__/optimize.test.js +0 -130
  843. package/dist/src/ui/slash/__tests__/pin.test.d.ts +0 -1
  844. package/dist/src/ui/slash/__tests__/pin.test.js +0 -38
  845. package/dist/src/ui/slash/__tests__/plan.test.d.ts +0 -1
  846. package/dist/src/ui/slash/__tests__/plan.test.js +0 -82
  847. package/dist/src/ui/slash/__tests__/ponytail.test.d.ts +0 -1
  848. package/dist/src/ui/slash/__tests__/ponytail.test.js +0 -37
  849. package/dist/src/ui/slash/__tests__/status-render.test.d.ts +0 -7
  850. package/dist/src/ui/slash/__tests__/status-render.test.js +0 -77
  851. package/dist/src/ui/slash/route.test.d.ts +0 -1
  852. package/dist/src/ui/slash/route.test.js +0 -70
  853. package/dist/src/ui/status-bar/index.test.d.ts +0 -1
  854. package/dist/src/ui/status-bar/index.test.js +0 -139
  855. package/dist/src/ui/status-bar/store.test.d.ts +0 -1
  856. package/dist/src/ui/status-bar/store.test.js +0 -116
  857. package/dist/src/ui/status-bar/tier-badge.test.d.ts +0 -1
  858. package/dist/src/ui/status-bar/tier-badge.test.js +0 -34
  859. package/dist/src/ui/status-bar/usd-meter.test.d.ts +0 -1
  860. package/dist/src/ui/status-bar/usd-meter.test.js +0 -32
  861. package/dist/src/ui/utils/__tests__/format.test.d.ts +0 -1
  862. package/dist/src/ui/utils/__tests__/format.test.js +0 -50
  863. package/dist/src/ui/utils/__tests__/tools.test.d.ts +0 -1
  864. package/dist/src/ui/utils/__tests__/tools.test.js +0 -48
  865. package/dist/src/ui/utils/relaunch.test.d.ts +0 -1
  866. package/dist/src/ui/utils/relaunch.test.js +0 -133
  867. package/dist/src/ui/utils/text.test.d.ts +0 -1
  868. package/dist/src/ui/utils/text.test.js +0 -47
  869. package/dist/src/usage/__tests__/product-ledger.test.d.ts +0 -1
  870. package/dist/src/usage/__tests__/product-ledger.test.js +0 -60
  871. package/dist/src/usage/downgrade.test.d.ts +0 -1
  872. package/dist/src/usage/downgrade.test.js +0 -70
  873. package/dist/src/usage/estimator.test.d.ts +0 -1
  874. package/dist/src/usage/estimator.test.js +0 -38
  875. package/dist/src/usage/ledger.test.d.ts +0 -1
  876. package/dist/src/usage/ledger.test.js +0 -171
  877. package/dist/src/usage/midstream.test.d.ts +0 -1
  878. package/dist/src/usage/midstream.test.js +0 -47
  879. package/dist/src/usage/thresholds.test.d.ts +0 -1
  880. package/dist/src/usage/thresholds.test.js +0 -77
  881. package/dist/src/utils/__tests__/auto-council-settings.test.d.ts +0 -1
  882. package/dist/src/utils/__tests__/auto-council-settings.test.js +0 -41
  883. package/dist/src/utils/__tests__/compaction-caps.test.d.ts +0 -21
  884. package/dist/src/utils/__tests__/compaction-caps.test.js +0 -187
  885. package/dist/src/utils/__tests__/ee-logger.test.d.ts +0 -11
  886. package/dist/src/utils/__tests__/ee-logger.test.js +0 -165
  887. package/dist/src/utils/__tests__/file-lock.test.d.ts +0 -1
  888. package/dist/src/utils/__tests__/file-lock.test.js +0 -66
  889. package/dist/src/utils/__tests__/footprint-gitignore.test.d.ts +0 -1
  890. package/dist/src/utils/__tests__/footprint-gitignore.test.js +0 -50
  891. package/dist/src/utils/__tests__/llm-deadline-abort.test.d.ts +0 -1
  892. package/dist/src/utils/__tests__/llm-deadline-abort.test.js +0 -33
  893. package/dist/src/utils/__tests__/llm-deadline.test.d.ts +0 -1
  894. package/dist/src/utils/__tests__/llm-deadline.test.js +0 -68
  895. package/dist/src/utils/__tests__/logger.test.d.ts +0 -1
  896. package/dist/src/utils/__tests__/logger.test.js +0 -115
  897. package/dist/src/utils/__tests__/rate-limit.test.d.ts +0 -1
  898. package/dist/src/utils/__tests__/rate-limit.test.js +0 -38
  899. package/dist/src/utils/__tests__/settings-agent-first.test.d.ts +0 -1
  900. package/dist/src/utils/__tests__/settings-agent-first.test.js +0 -48
  901. package/dist/src/utils/__tests__/settings-disabled-models.test.d.ts +0 -7
  902. package/dist/src/utils/__tests__/settings-disabled-models.test.js +0 -99
  903. package/dist/src/utils/__tests__/settings-web-research.test.d.ts +0 -1
  904. package/dist/src/utils/__tests__/settings-web-research.test.js +0 -46
  905. package/dist/src/utils/__tests__/slugify.test.d.ts +0 -1
  906. package/dist/src/utils/__tests__/slugify.test.js +0 -37
  907. package/dist/src/utils/__tests__/visible-retry.test.d.ts +0 -1
  908. package/dist/src/utils/__tests__/visible-retry.test.js +0 -143
  909. package/dist/src/utils/install-manager.test.d.ts +0 -1
  910. package/dist/src/utils/install-manager.test.js +0 -169
  911. package/dist/src/utils/instructions.test.d.ts +0 -1
  912. package/dist/src/utils/instructions.test.js +0 -93
  913. package/dist/src/utils/open-url.test.d.ts +0 -1
  914. package/dist/src/utils/open-url.test.js +0 -86
  915. package/dist/src/utils/permission-mode.test.d.ts +0 -1
  916. package/dist/src/utils/permission-mode.test.js +0 -188
  917. package/dist/src/utils/redactor.test.d.ts +0 -1
  918. package/dist/src/utils/redactor.test.js +0 -84
  919. package/dist/src/utils/settings.test.d.ts +0 -1
  920. package/dist/src/utils/settings.test.js +0 -212
  921. package/dist/src/utils/shell.test.d.ts +0 -1
  922. package/dist/src/utils/shell.test.js +0 -97
  923. package/dist/src/utils/skills.test.d.ts +0 -1
  924. package/dist/src/utils/skills.test.js +0 -45
  925. package/dist/src/utils/subagent-display.test.d.ts +0 -1
  926. package/dist/src/utils/subagent-display.test.js +0 -21
  927. package/dist/src/utils/subagents-settings.test.d.ts +0 -1
  928. package/dist/src/utils/subagents-settings.test.js +0 -64
  929. package/dist/src/utils/telegram-audio-settings.test.d.ts +0 -1
  930. package/dist/src/utils/telegram-audio-settings.test.js +0 -39
  931. package/dist/src/utils/update-checker.test.d.ts +0 -1
  932. package/dist/src/utils/update-checker.test.js +0 -142
  933. package/dist/src/verify/__tests__/coverage-parsers.test.d.ts +0 -1
  934. package/dist/src/verify/__tests__/coverage-parsers.test.js +0 -69
  935. package/dist/src/verify/__tests__/dotnet-recipe.test.d.ts +0 -10
  936. package/dist/src/verify/__tests__/dotnet-recipe.test.js +0 -70
  937. package/dist/src/verify/checkpoint.test.d.ts +0 -1
  938. package/dist/src/verify/checkpoint.test.js +0 -160
  939. package/dist/src/verify/entrypoint.test.d.ts +0 -1
  940. package/dist/src/verify/entrypoint.test.js +0 -233
  941. package/dist/src/verify/environment.test.d.ts +0 -1
  942. package/dist/src/verify/environment.test.js +0 -94
  943. package/dist/src/verify/orchestrator.test.d.ts +0 -1
  944. package/dist/src/verify/orchestrator.test.js +0 -126
  945. package/dist/src/verify/runtime-prep.test.d.ts +0 -1
  946. package/dist/src/verify/runtime-prep.test.js +0 -38
@@ -1,507 +0,0 @@
1
- import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
2
- import { installMockModel, textOnlyStream } from "../../agent-harness/mock-model.js";
3
- import { loadCatalog } from "../../models/registry.js";
4
- import { Agent } from "../orchestrator.js";
5
- // Mock generateText from 'ai'
6
- const mockGenerateText = vi.fn().mockResolvedValue({ text: "Mocked parent advice response" });
7
- vi.mock("ai", () => {
8
- return {
9
- generateText: (...args) => mockGenerateText(...args),
10
- };
11
- });
12
- // 1. Mock classifySubSessionAction
13
- const mockClassifySubSessionAction = vi.fn();
14
- vi.mock("../../pil/llm-classify.js", () => {
15
- return {
16
- classifySubSessionAction: (...args) => mockClassifySubSessionAction.apply(null, args),
17
- };
18
- });
19
- // Mock deliberateCompact
20
- const mockDeliberateCompact = vi.fn().mockResolvedValue({
21
- summary: "Compact summary",
22
- tokensBeforeCompress: 100,
23
- });
24
- vi.mock("../../flow/compaction/index.js", () => {
25
- return {
26
- deliberateCompact: (...args) => mockDeliberateCompact.apply(null, args),
27
- };
28
- });
29
- // 2. Mock DB
30
- const mockDb = {
31
- prepare: vi.fn().mockReturnValue({
32
- run: vi.fn().mockReturnValue({ changes: 1 }),
33
- get: vi.fn(),
34
- all: vi.fn().mockReturnValue([]),
35
- }),
36
- };
37
- vi.mock("../../storage/db.js", () => {
38
- return {
39
- getDatabase: () => mockDb,
40
- };
41
- });
42
- // 3. Mock Storage/Transcript module functions
43
- const mockLoadLatestCompaction = vi.fn();
44
- const mockGetNextMessageSequence = vi.fn(() => 1);
45
- const mockAppendCompaction = vi.fn();
46
- const mockLoadTranscriptState = vi.fn();
47
- const mockAppendMessages = vi.fn((sessId, msgs) => msgs.map((_, idx) => idx + 100));
48
- const mockMarkMessageCompleted = vi.fn();
49
- vi.mock("../../storage/transcript.js", () => {
50
- return {
51
- loadLatestCompaction: (...args) => mockLoadLatestCompaction.apply(null, args),
52
- getNextMessageSequence: (...args) => mockGetNextMessageSequence.apply(null, args),
53
- appendCompaction: (...args) => mockAppendCompaction.apply(null, args),
54
- loadTranscriptState: (...args) => mockLoadTranscriptState.apply(null, args),
55
- appendMessages: (...args) => mockAppendMessages.apply(null, args),
56
- markMessageCompleted: (...args) => mockMarkMessageCompleted.apply(null, args),
57
- buildChatEntries: vi.fn(() => []),
58
- getLastTodoWriteArgs: vi.fn(() => null),
59
- loadTranscript: vi.fn(() => []),
60
- };
61
- });
62
- // 4. Mock the main storage index barrel file
63
- const parentSessionState = {
64
- messages: [{ role: "user", content: "Hello parent" }],
65
- seqs: [1],
66
- };
67
- vi.mock("../../storage/index.js", () => {
68
- return {
69
- appendCompaction: (...args) => mockAppendCompaction.apply(null, args),
70
- appendMessages: (...args) => mockAppendMessages.apply(null, args),
71
- getNextMessageSequence: (...args) => mockGetNextMessageSequence.apply(null, args),
72
- loadTranscriptState: (...args) => mockLoadTranscriptState.apply(null, args),
73
- loadTranscript: vi.fn(() => []),
74
- buildChatEntries: vi.fn(() => []),
75
- getLastTodoWriteArgs: vi.fn(() => null),
76
- markMessageCompleted: (...args) => mockMarkMessageCompleted.apply(null, args),
77
- appendSystemMessage: vi.fn(() => 0),
78
- getSessionTotalTokens: vi.fn(() => ({ inputTokens: 0, outputTokens: 0 })),
79
- logInteraction: vi.fn(),
80
- recordUsageEvent: vi.fn(),
81
- SessionStore: class {
82
- getWorkspace() {
83
- return { id: "workspace-1", rootPath: "/dummy" };
84
- }
85
- openSession(selector, model, mode, cwd) {
86
- return {
87
- id: "session-parent",
88
- workspaceId: "workspace-1",
89
- model,
90
- mode,
91
- cwdAtStart: cwd,
92
- cwdLast: cwd,
93
- status: "active",
94
- createdAt: new Date(),
95
- updatedAt: new Date(),
96
- };
97
- }
98
- createSession(model, mode, cwd) {
99
- return {
100
- id: "session-child",
101
- workspaceId: "workspace-1",
102
- model,
103
- mode,
104
- cwdAtStart: cwd,
105
- cwdLast: cwd,
106
- status: "active",
107
- createdAt: new Date(),
108
- updatedAt: new Date(),
109
- };
110
- }
111
- getRequiredSession(id) {
112
- return {
113
- id,
114
- workspaceId: "workspace-1",
115
- model: "dummy-model",
116
- mode: "agent",
117
- cwdAtStart: "/dummy",
118
- cwdLast: "/dummy",
119
- status: "active",
120
- createdAt: new Date(),
121
- updatedAt: new Date(),
122
- };
123
- }
124
- touchSession() { }
125
- setMode() { }
126
- setStatus() { }
127
- setModel() { }
128
- setTitle() { }
129
- getLatestSession() {
130
- return null;
131
- }
132
- getSessionById() {
133
- return null;
134
- }
135
- },
136
- };
137
- });
138
- // 5. Mock MessageProcessor so we can simulate the messages it writes
139
- vi.mock("../message-processor.js", () => {
140
- return {
141
- MessageProcessor: class {
142
- deps;
143
- constructor(deps) {
144
- this.deps = deps;
145
- }
146
- async *run(userMessage) {
147
- if (userMessage === "trigger error") {
148
- throw new Error("Simulated MessageProcessor crash");
149
- }
150
- if (userMessage === "trigger transient error") {
151
- globalThis.__transientAttempts = (globalThis.__transientAttempts || 0) + 1;
152
- if (globalThis.__transientAttempts < 3) {
153
- throw new Error("fetch failed");
154
- }
155
- this.deps.messages.push({ role: "assistant", content: "Sub-session final structured response after retry" }, { role: "tool", content: "Final tool outcome (should be copied)" });
156
- yield { type: "content", content: "processing after retry..." };
157
- return;
158
- }
159
- if (userMessage === "test consult") {
160
- if (this.deps.consultParentSession) {
161
- const advice = await this.deps.consultParentSession("How to handle this error?");
162
- this.deps.messages.push({ role: "assistant", content: `Advice: ${advice}` }, { role: "tool", content: "Final tool outcome (should be copied)" });
163
- }
164
- yield { type: "content", content: "consulting..." };
165
- return;
166
- }
167
- // Simulating writing messages during turn execution
168
- // Under a sub-session, we want to write intermediate clutter,
169
- // and check that only final assistant response gets absorbed.
170
- this.deps.messages.push({ role: "assistant", content: "Intermediate assistant prompt analysis" }, { role: "tool", content: "Intermediate tool result that should be ignored" }, { role: "assistant", content: "Sub-session final structured response" }, { role: "tool", content: "Final tool outcome (should be copied)" });
171
- yield { type: "content", content: "processing..." };
172
- }
173
- },
174
- };
175
- });
176
- describe("Agent - Sub-Session Delegation & Absorption", () => {
177
- let cleanup = null;
178
- beforeAll(async () => {
179
- await loadCatalog();
180
- });
181
- beforeEach(() => {
182
- process.env.MUONROI_FORCE_ROUTING_CLASSIFY = "1";
183
- vi.clearAllMocks();
184
- globalThis.__transientAttempts = 0;
185
- parentSessionState.messages = [{ role: "user", content: "Hello parent" }];
186
- parentSessionState.seqs = [1];
187
- mockLoadTranscriptState.mockReturnValue(parentSessionState);
188
- const mockModelHandle = installMockModel({ fixture: { stream: textOnlyStream("ignored mock stream") } });
189
- cleanup = () => {
190
- delete process.env.MUONROI_FORCE_ROUTING_CLASSIFY;
191
- mockModelHandle.uninstall();
192
- };
193
- });
194
- afterEach(() => {
195
- cleanup?.();
196
- });
197
- it("routes DIRECT_ANSWER directly without spawning a sub-session", async () => {
198
- mockClassifySubSessionAction.mockResolvedValue({
199
- action: "DIRECT_ANSWER",
200
- confidence: 0.95,
201
- reason: "simple question",
202
- });
203
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
204
- persistSession: true,
205
- session: "session-parent",
206
- });
207
- // Clear initial messages
208
- agent.messages = [];
209
- const generator = agent.processMessage("What is 2+2?");
210
- const chunks = [];
211
- for await (const chunk of generator) {
212
- chunks.push(chunk);
213
- }
214
- // Since it's DIRECT_ANSWER, it should NOT try to insert child sub-sessions
215
- expect(mockDb.prepare).not.toHaveBeenCalledWith(expect.stringContaining("parent_session_id"));
216
- expect(agent.getSessionId()).toBe("session-parent");
217
- });
218
- it("routes SPAWN_SUB_SESSION: creates child session, injects overlay prompt, runs in isolation, and absorbs final outcome", async () => {
219
- mockClassifySubSessionAction.mockResolvedValue({
220
- action: "SPAWN_SUB_SESSION",
221
- confidence: 0.98,
222
- reason: "requires multi-step tool execution",
223
- });
224
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
225
- persistSession: true,
226
- session: "session-parent",
227
- });
228
- // Start with empty messages in parent
229
- agent.messages = [];
230
- const generator = agent.processMessage("Implement auth and write tests");
231
- const chunks = [];
232
- for await (const chunk of generator) {
233
- chunks.push(chunk);
234
- }
235
- // 1. Verify DB parent session link update is triggered
236
- expect(mockDb.prepare).toHaveBeenCalledWith("UPDATE sessions SET parent_session_id = ? WHERE id = ?");
237
- // 2. Verify parent session was restored at the end
238
- expect(agent.getSessionId()).toBe("session-parent");
239
- // 3. Verify final messages in parent contain the absorbed outcome
240
- // We expect the final messages list to have absorbed:
241
- // - last assistant message: "Sub-session final structured response"
242
- // - subsequent tool message(s): "Final tool outcome (should be copied)"
243
- // It should NOT contain:
244
- // - intermediate assistant: "Intermediate assistant prompt analysis"
245
- // - intermediate tool: "Intermediate tool result that should be ignored"
246
- expect(agent.messages).toHaveLength(3); // Hello parent + absorbed assistant + absorbed tool
247
- expect(agent.messages[1]).toEqual({
248
- role: "assistant",
249
- content: "Sub-session final structured response",
250
- });
251
- expect(agent.messages[2]).toEqual({
252
- role: "tool",
253
- content: "Final tool outcome (should be copied)",
254
- });
255
- // 4. Verify appendMessages was called to persist the absorbed turn in the parent
256
- expect(mockAppendMessages).toHaveBeenCalledWith("session-parent", expect.arrayContaining([
257
- expect.objectContaining({ role: "user", content: "Implement auth and write tests" }),
258
- expect.objectContaining({ role: "assistant", content: "Sub-session final structured response" }),
259
- expect.objectContaining({ role: "tool", content: "Final tool outcome (should be copied)" }),
260
- ]));
261
- });
262
- it("restores parent session if sub-session execution crashes", async () => {
263
- mockClassifySubSessionAction.mockResolvedValue({
264
- action: "SPAWN_SUB_SESSION",
265
- confidence: 0.98,
266
- reason: "requires sub-session",
267
- });
268
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
269
- persistSession: true,
270
- session: "session-parent",
271
- });
272
- // Start with empty messages in parent
273
- agent.messages = [];
274
- // Run a turn that will crash
275
- let threw = false;
276
- try {
277
- const generator = agent.processMessage("trigger error");
278
- for await (const chunk of generator) {
279
- // consume stream
280
- }
281
- }
282
- catch (err) {
283
- expect(err.message).toBe("Simulated MessageProcessor crash");
284
- threw = true;
285
- }
286
- expect(threw).toBe(true);
287
- // Verify parent session is restored even after crash
288
- expect(agent.getSessionId()).toBe("session-parent");
289
- });
290
- it("resumes an existing active sub-session if found in database", async () => {
291
- mockClassifySubSessionAction.mockResolvedValue({
292
- action: "SPAWN_SUB_SESSION",
293
- confidence: 0.98,
294
- reason: "requires sub-session",
295
- });
296
- // Mock active sub-session row lookup
297
- mockDb.prepare.mockImplementation((sql) => {
298
- if (sql.includes("status = 'active'")) {
299
- return {
300
- get: () => ({ id: "session-active-child" }),
301
- run: () => ({ changes: 1 }),
302
- all: () => [],
303
- };
304
- }
305
- return {
306
- run: () => ({ changes: 1 }),
307
- get: () => undefined,
308
- all: () => [],
309
- };
310
- });
311
- // Mock loadTranscriptState to return a state for the child session or parent session depending on input
312
- mockLoadTranscriptState.mockImplementation((sessId) => {
313
- if (sessId === "session-parent") {
314
- return parentSessionState;
315
- }
316
- return {
317
- messages: [{ role: "user", content: "Previous attempt" }],
318
- seqs: [1],
319
- };
320
- });
321
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
322
- persistSession: true,
323
- session: "session-parent",
324
- });
325
- // Start with empty messages in parent
326
- agent.messages = [];
327
- const generator = agent.processMessage("Implement auth and write tests");
328
- const chunks = [];
329
- for await (const chunk of generator) {
330
- chunks.push(chunk);
331
- }
332
- // 1. Verify that we yielded the resumption status message
333
- const hasResumeMessage = chunks.some((c) => c.type === "content" && c.content?.includes("Phát hiện sub-session trước đó bị gián đoạn"));
334
- expect(hasResumeMessage).toBe(true);
335
- // 2. Verify that the agent restored parent session at the end
336
- expect(agent.getSessionId()).toBe("session-parent");
337
- // 3. Verify that loadTranscriptState was called with the resumed sub-session ID
338
- expect(mockLoadTranscriptState).toHaveBeenCalledWith("session-active-child");
339
- });
340
- it("triggers session rotation if the model decides ROTATE_SESSION", async () => {
341
- mockClassifySubSessionAction.mockResolvedValue({
342
- action: "ROTATE_SESSION",
343
- confidence: 0.9,
344
- reason: "New topic",
345
- });
346
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
347
- persistSession: true,
348
- session: "session-parent",
349
- });
350
- agent.messages = [{ role: "user", content: "Switch topics" }];
351
- const generator = agent.processMessage("switch topic");
352
- const chunks = [];
353
- for await (const chunk of generator) {
354
- chunks.push(chunk);
355
- }
356
- // Verify deliberateCompact was called
357
- expect(mockDeliberateCompact).toHaveBeenCalled();
358
- // Verify a new session was created (the active session ID changes)
359
- expect(agent.getSessionId()).toBe("session-child");
360
- });
361
- it("triggers session rotation if currentChars exceeds the hard safety threshold (threshold * 2)", async () => {
362
- process.env.MUONROI_SILENT_ROTATION_THRESHOLD = "100";
363
- mockClassifySubSessionAction.mockResolvedValue({
364
- action: "DIRECT_ANSWER",
365
- confidence: 0.95,
366
- reason: "simple answer",
367
- });
368
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
369
- persistSession: true,
370
- session: "session-parent",
371
- });
372
- agent.messages = [{ role: "user", content: "A".repeat(250) }];
373
- try {
374
- const generator = agent.processMessage("short message");
375
- const chunks = [];
376
- for await (const chunk of generator) {
377
- chunks.push(chunk);
378
- }
379
- // Verify deliberateCompact was called
380
- expect(mockDeliberateCompact).toHaveBeenCalled();
381
- // Verify it rotated to session-child
382
- expect(agent.getSessionId()).toBe("session-child");
383
- }
384
- finally {
385
- delete process.env.MUONROI_SILENT_ROTATION_THRESHOLD;
386
- }
387
- });
388
- it("does not resume a stale active sub-session (timeout), marks it as abandoned, and forks a new child session", async () => {
389
- mockClassifySubSessionAction.mockResolvedValue({
390
- action: "SPAWN_SUB_SESSION",
391
- confidence: 0.98,
392
- reason: "requires sub-session",
393
- });
394
- const twentyMinsAgo = new Date(Date.now() - 20 * 60 * 1000).toISOString();
395
- // Mock active sub-session row lookup returning a stale row
396
- mockDb.prepare.mockImplementation((sql) => {
397
- if (sql.includes("status = 'active'")) {
398
- return {
399
- get: () => ({ id: "session-stale-child", updated_at: twentyMinsAgo }),
400
- run: () => ({ changes: 1 }),
401
- all: () => [],
402
- };
403
- }
404
- return {
405
- run: () => ({ changes: 1 }),
406
- get: () => undefined,
407
- all: () => [],
408
- };
409
- });
410
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
411
- persistSession: true,
412
- session: "session-parent",
413
- });
414
- // Start with empty messages in parent
415
- agent.messages = [];
416
- const generator = agent.processMessage("Implement auth and write tests");
417
- const chunks = [];
418
- for await (const chunk of generator) {
419
- chunks.push(chunk);
420
- }
421
- // 1. Verify that we did NOT yield the resumption message
422
- const hasResumeMessage = chunks.some((c) => c.type === "content" && c.content?.includes("Phát hiện sub-session trước đó bị gián đoạn"));
423
- expect(hasResumeMessage).toBe(false);
424
- // 2. Verify that we marked the stale sub-session as abandoned
425
- expect(mockDb.prepare).toHaveBeenCalledWith("UPDATE sessions SET status = 'abandoned', updated_at = ? WHERE id = ?");
426
- // 3. Verify that we created a new session
427
- expect(agent.getSessionId()).toBe("session-parent");
428
- });
429
- it("registers and successfully executes consultParentSession tool in sub-session", async () => {
430
- mockClassifySubSessionAction.mockResolvedValue({
431
- action: "SPAWN_SUB_SESSION",
432
- confidence: 0.98,
433
- reason: "requires sub-session for consultation test",
434
- });
435
- mockDb.prepare.mockImplementation((sql) => {
436
- if (sql.includes("SELECT parent_session_id")) {
437
- return {
438
- get: () => ({ parent_session_id: "session-parent" }),
439
- run: () => ({ changes: 1 }),
440
- all: () => [],
441
- };
442
- }
443
- if (sql.includes("SELECT model_id")) {
444
- return {
445
- get: () => ({ model_id: "deepseek-v4-flash" }),
446
- run: () => ({ changes: 1 }),
447
- all: () => [],
448
- };
449
- }
450
- return {
451
- run: () => ({ changes: 1 }),
452
- get: () => undefined,
453
- all: () => [],
454
- };
455
- });
456
- mockLoadTranscriptState.mockReturnValue({
457
- messages: [{ role: "user", content: "Hello parent" }],
458
- seqs: [1],
459
- });
460
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
461
- persistSession: true,
462
- session: "session-parent",
463
- });
464
- // Start with empty messages in parent
465
- agent.messages = [];
466
- const generator = agent.processMessage("test consult");
467
- const chunks = [];
468
- for await (const chunk of generator) {
469
- chunks.push(chunk);
470
- }
471
- // Verify that generateText was called to advice the sub-session
472
- expect(mockGenerateText).toHaveBeenCalled();
473
- // Verify parent session is restored
474
- expect(agent.getSessionId()).toBe("session-parent");
475
- // The parent's final messages should have absorbed the assistant message which contains Advice
476
- expect(agent.messages).toHaveLength(3); // Hello parent + absorbed assistant (advice) + absorbed tool
477
- expect(agent.messages[1].content).toContain("Advice: Mocked parent advice response");
478
- });
479
- it("automatically retries transient errors in sub-session before succeeding", async () => {
480
- mockClassifySubSessionAction.mockResolvedValue({
481
- action: "SPAWN_SUB_SESSION",
482
- confidence: 0.98,
483
- reason: "requires sub-session for transient error test",
484
- });
485
- const agent = new Agent("sk-dummy", undefined, "deepseek-v4-flash", undefined, {
486
- persistSession: true,
487
- session: "session-parent",
488
- });
489
- // Start with empty messages in parent
490
- agent.messages = [];
491
- const generator = agent.processMessage("trigger transient error");
492
- const chunks = [];
493
- for await (const chunk of generator) {
494
- chunks.push(chunk);
495
- }
496
- // Verify parent session is restored
497
- expect(agent.getSessionId()).toBe("session-parent");
498
- console.log("TEST MESSAGES: ", JSON.stringify(agent.messages, null, 2));
499
- // The sub-session should have succeeded on the 3rd attempt and its output should be absorbed
500
- expect(agent.messages).toHaveLength(3); // Hello parent + absorbed assistant (after retry) + absorbed tool
501
- expect(agent.messages[1].content).toContain("Sub-session final structured response after retry");
502
- // Verify warning chunks were emitted
503
- const warningChunks = chunks.filter((c) => c.type === "content" && c.content?.includes("Có lỗi mạng hoặc rate limit xảy ra trong sub-session"));
504
- expect(warningChunks.length).toBe(2);
505
- });
506
- });
507
- //# sourceMappingURL=sub-session-delegation.test.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * src/orchestrator/__tests__/usage-events-shape.test.ts
3
- *
4
- * Phase O1 — integration check that `recordUsageEvent` threads
5
- * `providerOptionsShape` through to the INSERT statement on `usage_events`.
6
- * Mirrors the mock-db pattern from write-ahead.test.ts.
7
- */
8
- export {};
@@ -1,58 +0,0 @@
1
- /**
2
- * src/orchestrator/__tests__/usage-events-shape.test.ts
3
- *
4
- * Phase O1 — integration check that `recordUsageEvent` threads
5
- * `providerOptionsShape` through to the INSERT statement on `usage_events`.
6
- * Mirrors the mock-db pattern from write-ahead.test.ts.
7
- */
8
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
9
- const preparedCalls = [];
10
- vi.mock("../../storage/db", () => {
11
- const makeDb = () => ({
12
- prepare: (sql) => ({
13
- run: (...args) => {
14
- preparedCalls.push({ sql, runArgs: args });
15
- return undefined;
16
- },
17
- get: () => undefined,
18
- all: () => [],
19
- }),
20
- exec: () => undefined,
21
- pragma: () => undefined,
22
- transaction: (fn) => fn,
23
- close: () => undefined,
24
- });
25
- return {
26
- getDatabase: () => makeDb(),
27
- withTransaction: (fn) => fn(makeDb()),
28
- };
29
- });
30
- // Import AFTER the mock so usage.ts picks up the mocked db.
31
- import { recordUsageEvent } from "../../storage/usage.js";
32
- describe("O1: usage_events INSERT carries provider_options_shape", () => {
33
- beforeEach(() => {
34
- preparedCalls.length = 0;
35
- });
36
- afterEach(() => {
37
- preparedCalls.length = 0;
38
- });
39
- it("includes provider_options_shape column in INSERT and passes shape JSON as the trailing param", () => {
40
- const shape = JSON.stringify({ openai: { store: "boolean", promptCacheKey: "string" } });
41
- recordUsageEvent("sess-1", "message", "gpt-5.4", { inputTokens: 100, outputTokens: 50, totalTokens: 150 }, 7, false, 0, shape);
42
- expect(preparedCalls).toHaveLength(1);
43
- const call = preparedCalls[0];
44
- expect(call.sql).toMatch(/INSERT INTO usage_events/);
45
- expect(call.sql).toMatch(/provider_options_shape/);
46
- // 14 columns now: 13 prior + provider_options_shape. The shape value
47
- // should be the LAST runArg.
48
- expect(call.runArgs).toHaveLength(14);
49
- expect(call.runArgs[call.runArgs.length - 1]).toBe(shape);
50
- });
51
- it("defaults provider_options_shape to null when caller omits it (backwards compat)", () => {
52
- recordUsageEvent("sess-2", "title", "gpt-5.4", { inputTokens: 10, outputTokens: 5, totalTokens: 15 }, null);
53
- expect(preparedCalls).toHaveLength(1);
54
- const call = preparedCalls[0];
55
- expect(call.runArgs[call.runArgs.length - 1]).toBeNull();
56
- });
57
- });
58
- //# sourceMappingURL=usage-events-shape.test.js.map
@@ -1,21 +0,0 @@
1
- /**
2
- * src/orchestrator/__tests__/usage-normalizer-c1.test.ts
3
- *
4
- * Phase C1 — DeepSeek cache-token field reading.
5
- *
6
- * Before the fix, `getUsage()` and `getBatchUsage()` only consulted
7
- * `event.usage.cachedInputTokens`, `event.usage.inputTokenDetails.*`, and
8
- * `event.usage.raw.cache_creation_input_tokens`. DeepSeek goes through
9
- * `@ai-sdk/openai-compatible`, which exposes its cache split via
10
- * `providerMetadata.deepseek.{promptCacheHitTokens, promptCacheMissTokens}`
11
- * (streaming events) or raw `prompt_cache_hit_tokens` / `prompt_cache_miss_tokens`
12
- * fields (batch responses). Neither path was being read, so every DeepSeek
13
- * request recorded `cache_read_tokens = 0` — flagged by `usage forensics`
14
- * as "zero cache_creation across deepseek route — Phase C1 still open".
15
- *
16
- * This spec pins the new behavior:
17
- * - DeepSeek-shaped batch usage → cacheReadTokens=700, noCacheInputTokens=300
18
- * - DeepSeek-shaped streaming event (providerMetadata path) → same
19
- * - OpenAI-shaped usage → unchanged (no DeepSeek-specific fields read)
20
- */
21
- export {};