muonroi-cli 1.3.4 → 1.4.1

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 (2202) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +122 -122
  3. package/dist/packages/agent-harness-core/src/predicate.d.ts +2 -2
  4. package/dist/packages/agent-harness-core/src/protocol.d.ts +8 -0
  5. package/dist/src/__test-helpers__/catalog-fixtures.d.ts +22 -0
  6. package/dist/src/__test-helpers__/catalog-fixtures.js +55 -0
  7. package/dist/src/agent-harness/index.js +1 -1
  8. package/dist/src/agent-harness/mock-model.d.ts +5 -0
  9. package/dist/src/agent-harness/mock-model.js +68 -23
  10. package/dist/src/agent-harness/test-spawn.d.ts +7 -1
  11. package/dist/src/agent-harness/test-spawn.js +19 -4
  12. package/dist/src/chat/__tests__/broadcast-bus.test.js +2 -2
  13. package/dist/src/chat/__tests__/client.test.js +1 -1
  14. package/dist/src/chat/broadcast-bus.js +2 -2
  15. package/dist/src/chat/chat-keychain.js +11 -2
  16. package/dist/src/chat/providers/discord/client.d.ts +1 -1
  17. package/dist/src/chat/providers/discord/client.js +1 -1
  18. package/dist/src/cli/config/screen-council.js +1 -1
  19. package/dist/src/cli/config/screen-models.js +2 -2
  20. package/dist/src/cli/config/screen-providers.js +2 -2
  21. package/dist/src/cli/config/tui.js +1 -1
  22. package/dist/src/cli/cost-forensics.d.ts +31 -0
  23. package/dist/src/cli/cost-forensics.js +58 -12
  24. package/dist/src/cli/cost-forensics.test.js +125 -2
  25. package/dist/src/cli/keys.d.ts +5 -1
  26. package/dist/src/cli/keys.js +48 -20
  27. package/dist/src/cli/keys.test.js +1 -1
  28. package/dist/src/cli/reporter-cmd.d.ts +15 -0
  29. package/dist/src/cli/reporter-cmd.js +120 -0
  30. package/dist/src/cli/usage-report.d.ts +38 -1
  31. package/dist/src/cli/usage-report.js +133 -0
  32. package/dist/src/council/__tests__/audit-replay.test.js +1 -1
  33. package/dist/src/council/__tests__/clarifier-max-rounds.test.js +5 -5
  34. package/dist/src/council/__tests__/clarifier-ready-gate.test.js +233 -0
  35. package/dist/src/council/__tests__/debate-planner-structured.test.js +2 -2
  36. package/dist/src/council/__tests__/decisions-lock.test.d.ts +6 -0
  37. package/dist/src/council/__tests__/decisions-lock.test.js +336 -0
  38. package/dist/src/council/__tests__/tool-trace.test.js +2 -2
  39. package/dist/src/council/clarifier.d.ts +19 -2
  40. package/dist/src/council/clarifier.js +84 -6
  41. package/dist/src/council/context.js +3 -3
  42. package/dist/src/council/debate-planner.d.ts +1 -1
  43. package/dist/src/council/debate-planner.js +40 -7
  44. package/dist/src/council/debate.js +1 -1
  45. package/dist/src/council/decisions-lock.d.ts +76 -0
  46. package/dist/src/council/decisions-lock.js +239 -0
  47. package/dist/src/council/index.d.ts +5 -0
  48. package/dist/src/council/index.js +50 -18
  49. package/dist/src/council/leader.d.ts +1 -1
  50. package/dist/src/council/leader.js +14 -1
  51. package/dist/src/council/llm.js +33 -61
  52. package/dist/src/council/phase-events.d.ts +5 -0
  53. package/dist/src/council/phase-events.js +1 -0
  54. package/dist/src/council/planner.js +1 -1
  55. package/dist/src/council/prompts.d.ts +24 -0
  56. package/dist/src/council/prompts.js +112 -22
  57. package/dist/src/council/types.d.ts +18 -0
  58. package/dist/src/ee/__tests__/export-transcripts.test.d.ts +11 -0
  59. package/dist/src/ee/__tests__/export-transcripts.test.js +200 -0
  60. package/dist/src/ee/__tests__/recall-format.test.d.ts +10 -0
  61. package/dist/src/ee/__tests__/recall-format.test.js +57 -0
  62. package/dist/src/ee/__tests__/recall-ledger.test.d.ts +1 -0
  63. package/dist/src/ee/__tests__/recall-ledger.test.js +45 -0
  64. package/dist/src/ee/auth.test.js +2 -2
  65. package/dist/src/ee/client.js +59 -0
  66. package/dist/src/ee/client.test.js +30 -0
  67. package/dist/src/ee/council-bridge.js +3 -3
  68. package/dist/src/ee/export-transcripts.d.ts +26 -0
  69. package/dist/src/ee/export-transcripts.js +115 -0
  70. package/dist/src/ee/intercept.d.ts +9 -0
  71. package/dist/src/ee/intercept.js +19 -0
  72. package/dist/src/ee/offline-queue.test.js +3 -3
  73. package/dist/src/ee/phase-tracker.js +1 -1
  74. package/dist/src/ee/recall-ledger.d.ts +32 -0
  75. package/dist/src/ee/recall-ledger.js +52 -0
  76. package/dist/src/ee/recall-mirror.test.d.ts +1 -0
  77. package/dist/src/ee/recall-mirror.test.js +65 -0
  78. package/dist/src/ee/scope.js +1 -1
  79. package/dist/src/ee/scope.test.js +1 -1
  80. package/dist/src/ee/search.d.ts +99 -0
  81. package/dist/src/ee/search.js +220 -0
  82. package/dist/src/ee/session-trajectory.js +1 -1
  83. package/dist/src/ee/session-trajectory.test.js +1 -1
  84. package/dist/src/ee/transcript-emit.d.ts +51 -0
  85. package/dist/src/ee/transcript-emit.js +140 -0
  86. package/dist/src/ee/types.d.ts +37 -1
  87. package/dist/src/flow/__tests__/migration.test.js +1 -1
  88. package/dist/src/flow/__tests__/run-manager-product.test.js +1 -1
  89. package/dist/src/flow/__tests__/run-manager.test.js +1 -1
  90. package/dist/src/flow/__tests__/scaffold-checkpoint.test.js +2 -2
  91. package/dist/src/flow/__tests__/scaffold.test.js +1 -1
  92. package/dist/src/flow/__tests__/warning-persist.test.js +1 -1
  93. package/dist/src/generated/version.d.ts +1 -1
  94. package/dist/src/generated/version.js +1 -1
  95. package/dist/src/gsd/__tests__/directives.test.js +35 -0
  96. package/dist/src/gsd/__tests__/types.test.js +14 -1
  97. package/dist/src/gsd/directives.d.ts +10 -0
  98. package/dist/src/gsd/directives.js +38 -2
  99. package/dist/src/gsd/gray-areas.js +1 -1
  100. package/dist/src/gsd/types.d.ts +1 -1
  101. package/dist/src/gsd/types.js +20 -6
  102. package/dist/src/headless/__tests__/council-answers.test.js +26 -1
  103. package/dist/src/headless/council-answers.d.ts +17 -2
  104. package/dist/src/headless/council-answers.js +21 -0
  105. package/dist/src/hooks/index.js +74 -49
  106. package/dist/src/index.js +180 -16
  107. package/dist/src/lsp/builtins.js +44 -0
  108. package/dist/src/lsp/builtins.test.js +22 -1
  109. package/dist/src/lsp/manager.js +40 -9
  110. package/dist/src/lsp/manager.test.js +23 -1
  111. package/dist/src/lsp/npm-cache.js +2 -1
  112. package/dist/src/lsp/npm-cache.test.js +1 -1
  113. package/dist/src/lsp/smoke.test.js +1 -1
  114. package/dist/src/lsp/types.d.ts +3 -1
  115. package/dist/src/maintain/__tests__/codebase-intel.test.d.ts +5 -0
  116. package/dist/src/maintain/__tests__/codebase-intel.test.js +237 -0
  117. package/dist/src/maintain/__tests__/gh-create-pr.test.d.ts +11 -0
  118. package/dist/src/maintain/__tests__/gh-create-pr.test.js +156 -0
  119. package/dist/src/maintain/__tests__/pr-builder.test.d.ts +10 -0
  120. package/dist/src/maintain/__tests__/pr-builder.test.js +225 -0
  121. package/dist/src/maintain/__tests__/repo-map.test.d.ts +5 -0
  122. package/dist/src/maintain/__tests__/repo-map.test.js +90 -0
  123. package/dist/src/maintain/__tests__/task-runner.test.d.ts +11 -0
  124. package/dist/src/maintain/__tests__/task-runner.test.js +281 -0
  125. package/dist/src/maintain/codebase-intel.d.ts +22 -0
  126. package/dist/src/maintain/codebase-intel.js +548 -0
  127. package/dist/src/maintain/gh-create-pr.d.ts +24 -0
  128. package/dist/src/maintain/gh-create-pr.js +111 -0
  129. package/dist/src/maintain/index.d.ts +12 -0
  130. package/dist/src/maintain/index.js +10 -0
  131. package/dist/src/maintain/pr-builder.d.ts +35 -0
  132. package/dist/src/maintain/pr-builder.js +305 -0
  133. package/dist/src/maintain/repo-map.d.ts +25 -0
  134. package/dist/src/maintain/repo-map.js +189 -0
  135. package/dist/src/maintain/task-runner.d.ts +45 -0
  136. package/dist/src/maintain/task-runner.js +401 -0
  137. package/dist/src/maintain/types.d.ts +45 -0
  138. package/dist/src/maintain/types.js +7 -0
  139. package/dist/src/mcp/__tests__/auto-setup.test.js +1 -1
  140. package/dist/src/mcp/__tests__/cap-tool-result.test.d.ts +1 -0
  141. package/dist/src/mcp/__tests__/cap-tool-result.test.js +58 -0
  142. package/dist/src/mcp/__tests__/ee-tools.test.d.ts +1 -0
  143. package/dist/src/mcp/__tests__/ee-tools.test.js +198 -0
  144. package/dist/src/mcp/__tests__/forensics-tools.test.d.ts +1 -0
  145. package/dist/src/mcp/__tests__/forensics-tools.test.js +53 -0
  146. package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.js +3 -1
  147. package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.js +3 -1
  148. package/dist/src/mcp/__tests__/lsp-tools.test.d.ts +1 -0
  149. package/dist/src/mcp/__tests__/lsp-tools.test.js +56 -0
  150. package/dist/src/mcp/__tests__/runtime-output-cap.test.d.ts +1 -0
  151. package/dist/src/mcp/__tests__/runtime-output-cap.test.js +42 -0
  152. package/dist/src/mcp/__tests__/self-verify-jobs.test.d.ts +1 -0
  153. package/dist/src/mcp/__tests__/self-verify-jobs.test.js +92 -0
  154. package/dist/src/mcp/__tests__/smart-filter.test.d.ts +1 -0
  155. package/dist/src/mcp/__tests__/smart-filter.test.js +121 -0
  156. package/dist/src/mcp/__tests__/tools-server.smoke.test.d.ts +1 -0
  157. package/dist/src/mcp/__tests__/tools-server.smoke.test.js +42 -0
  158. package/dist/src/mcp/cap-tool-result.d.ts +1 -0
  159. package/dist/src/mcp/cap-tool-result.js +35 -0
  160. package/dist/src/mcp/ee-tools.d.ts +36 -0
  161. package/dist/src/mcp/ee-tools.js +159 -0
  162. package/dist/src/mcp/forensics-tools.d.ts +13 -0
  163. package/dist/src/mcp/forensics-tools.js +52 -0
  164. package/dist/src/mcp/lsp-tools.d.ts +16 -0
  165. package/dist/src/mcp/lsp-tools.js +65 -0
  166. package/dist/src/mcp/mcp-keychain.js +11 -2
  167. package/dist/src/mcp/oauth-callback.js +2 -2
  168. package/dist/src/mcp/opentui-spawn.js +1 -1
  169. package/dist/src/mcp/parse-headers.test.js +14 -14
  170. package/dist/src/mcp/runtime.js +11 -0
  171. package/dist/src/mcp/self-verify-jobs.d.ts +55 -0
  172. package/dist/src/mcp/self-verify-jobs.js +86 -0
  173. package/dist/src/mcp/smart-filter.d.ts +48 -0
  174. package/dist/src/mcp/smart-filter.js +115 -0
  175. package/dist/src/mcp/smoke.test.js +44 -44
  176. package/dist/src/mcp/tools-server.d.ts +14 -0
  177. package/dist/src/mcp/tools-server.js +147 -0
  178. package/dist/src/models/catalog-client.d.ts +22 -0
  179. package/dist/src/models/catalog-client.js +95 -9
  180. package/dist/src/models/catalog-gemini.test.d.ts +1 -0
  181. package/dist/src/models/catalog-gemini.test.js +46 -0
  182. package/dist/src/models/catalog-url.test.d.ts +1 -0
  183. package/dist/src/models/catalog-url.test.js +26 -0
  184. package/dist/src/models/catalog-validation.test.d.ts +1 -0
  185. package/dist/src/models/catalog-validation.test.js +63 -0
  186. package/dist/src/models/catalog.json +349 -177
  187. package/dist/src/models/classify-tier.d.ts +1 -1
  188. package/dist/src/models/classify-tier.js +1 -1
  189. package/dist/src/models/registry.d.ts +2 -0
  190. package/dist/src/models/registry.js +9 -0
  191. package/dist/src/ops/__tests__/doctor-ee-health.test.js +1 -1
  192. package/dist/src/ops/doctor.js +7 -7
  193. package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.d.ts +1 -0
  194. package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.js +77 -0
  195. package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js +10 -3
  196. package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.js +38 -16
  197. package/dist/src/orchestrator/__tests__/error-forensics.test.d.ts +1 -0
  198. package/dist/src/orchestrator/__tests__/error-forensics.test.js +93 -0
  199. package/dist/src/orchestrator/__tests__/flow-resume.test.js +1 -1
  200. package/dist/src/orchestrator/__tests__/humanize-api-error.test.d.ts +1 -0
  201. package/dist/src/orchestrator/__tests__/humanize-api-error.test.js +68 -0
  202. package/dist/src/orchestrator/__tests__/message-processor.test.js +6 -1
  203. package/dist/src/orchestrator/__tests__/read-path-budget.test.js +62 -4
  204. package/dist/src/orchestrator/__tests__/retry-classifier.test.js +10 -0
  205. package/dist/src/orchestrator/__tests__/stream-runner.test.js +77 -4
  206. package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.d.ts +1 -0
  207. package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.js +45 -0
  208. package/dist/src/orchestrator/__tests__/usage-shape-threading.test.d.ts +1 -0
  209. package/dist/src/orchestrator/__tests__/usage-shape-threading.test.js +98 -0
  210. package/dist/src/orchestrator/agent.test.js +33 -18
  211. package/dist/src/orchestrator/batch-turn-runner.d.ts +1 -1
  212. package/dist/src/orchestrator/batch-turn-runner.js +3 -2
  213. package/dist/src/orchestrator/compaction.js +99 -87
  214. package/dist/src/orchestrator/compaction.test.js +17 -0
  215. package/dist/src/orchestrator/council-manager.d.ts +1 -1
  216. package/dist/src/orchestrator/council-manager.js +3 -10
  217. package/dist/src/orchestrator/cross-turn-dedup.js +21 -1
  218. package/dist/src/orchestrator/delegations.js +7 -1
  219. package/dist/src/orchestrator/delegations.test.js +1 -1
  220. package/dist/src/orchestrator/error-utils.d.ts +27 -1
  221. package/dist/src/orchestrator/error-utils.js +63 -1
  222. package/dist/src/orchestrator/grounding-check.d.ts +50 -0
  223. package/dist/src/orchestrator/grounding-check.js +123 -0
  224. package/dist/src/orchestrator/grounding-check.test.d.ts +1 -0
  225. package/dist/src/orchestrator/grounding-check.test.js +94 -0
  226. package/dist/src/orchestrator/interrupted-turn.d.ts +19 -0
  227. package/dist/src/orchestrator/interrupted-turn.js +28 -0
  228. package/dist/src/orchestrator/interrupted-turn.test.d.ts +1 -0
  229. package/dist/src/orchestrator/interrupted-turn.test.js +34 -0
  230. package/dist/src/orchestrator/message-processor.d.ts +11 -10
  231. package/dist/src/orchestrator/message-processor.js +1367 -93
  232. package/dist/src/orchestrator/orchestrator.d.ts +7 -3
  233. package/dist/src/orchestrator/orchestrator.js +158 -43
  234. package/dist/src/orchestrator/pending-calls.test.js +1 -1
  235. package/dist/src/orchestrator/prompts.d.ts +1 -1
  236. package/dist/src/orchestrator/prompts.js +237 -154
  237. package/dist/src/orchestrator/read-path-budget.d.ts +22 -2
  238. package/dist/src/orchestrator/read-path-budget.js +96 -18
  239. package/dist/src/orchestrator/reasoning.js +43 -1
  240. package/dist/src/orchestrator/reasoning.test.js +75 -0
  241. package/dist/src/orchestrator/repair-tool-call.d.ts +32 -0
  242. package/dist/src/orchestrator/repair-tool-call.js +50 -0
  243. package/dist/src/orchestrator/repetition-detector.d.ts +58 -0
  244. package/dist/src/orchestrator/repetition-detector.js +126 -0
  245. package/dist/src/orchestrator/repetition-detector.test.d.ts +1 -0
  246. package/dist/src/orchestrator/repetition-detector.test.js +103 -0
  247. package/dist/src/orchestrator/retry-classifier.js +8 -0
  248. package/dist/src/orchestrator/sandbox.test.js +3 -1
  249. package/dist/src/orchestrator/scope-ceiling.d.ts +86 -0
  250. package/dist/src/orchestrator/scope-ceiling.js +161 -0
  251. package/dist/src/orchestrator/scope-ceiling.test.d.ts +13 -0
  252. package/dist/src/orchestrator/scope-ceiling.test.js +181 -0
  253. package/dist/src/orchestrator/scope-reminder.d.ts +102 -0
  254. package/dist/src/orchestrator/scope-reminder.js +221 -0
  255. package/dist/src/orchestrator/scope-reminder.test.d.ts +15 -0
  256. package/dist/src/orchestrator/scope-reminder.test.js +204 -0
  257. package/dist/src/orchestrator/stall-rescue.d.ts +67 -0
  258. package/dist/src/orchestrator/stall-rescue.js +72 -0
  259. package/dist/src/orchestrator/stall-rescue.test.d.ts +1 -0
  260. package/dist/src/orchestrator/stall-rescue.test.js +88 -0
  261. package/dist/src/orchestrator/stall-watchdog.d.ts +34 -0
  262. package/dist/src/orchestrator/stall-watchdog.js +72 -0
  263. package/dist/src/orchestrator/stall-watchdog.test.d.ts +1 -0
  264. package/dist/src/orchestrator/stall-watchdog.test.js +73 -0
  265. package/dist/src/orchestrator/stream-runner.d.ts +18 -2
  266. package/dist/src/orchestrator/stream-runner.js +248 -77
  267. package/dist/src/orchestrator/sub-agent-cap.js +21 -1
  268. package/dist/src/orchestrator/sub-agent-cap.test.js +41 -3
  269. package/dist/src/orchestrator/sub-agent-model-tier.d.ts +13 -0
  270. package/dist/src/orchestrator/sub-agent-model-tier.js +45 -0
  271. package/dist/src/orchestrator/subagent-compactor.d.ts +49 -0
  272. package/dist/src/orchestrator/subagent-compactor.js +184 -11
  273. package/dist/src/orchestrator/subagent-compactor.spec.js +187 -2
  274. package/dist/src/orchestrator/text-tool-call-detector.d.ts +61 -0
  275. package/dist/src/orchestrator/text-tool-call-detector.js +163 -0
  276. package/dist/src/orchestrator/text-tool-call-detector.test.d.ts +1 -0
  277. package/dist/src/orchestrator/text-tool-call-detector.test.js +89 -0
  278. package/dist/src/orchestrator/tool-args-hash.d.ts +51 -0
  279. package/dist/src/orchestrator/tool-args-hash.js +219 -0
  280. package/dist/src/orchestrator/tool-args-hash.test.d.ts +1 -0
  281. package/dist/src/orchestrator/tool-args-hash.test.js +105 -0
  282. package/dist/src/orchestrator/tool-args-repair.d.ts +93 -0
  283. package/dist/src/orchestrator/tool-args-repair.js +219 -0
  284. package/dist/src/orchestrator/tool-args-repair.test.d.ts +1 -0
  285. package/dist/src/orchestrator/tool-args-repair.test.js +136 -0
  286. package/dist/src/orchestrator/tool-loop-cap.d.ts +66 -0
  287. package/dist/src/orchestrator/tool-loop-cap.js +138 -0
  288. package/dist/src/orchestrator/tool-loop-cap.test.d.ts +1 -0
  289. package/dist/src/orchestrator/tool-loop-cap.test.js +176 -0
  290. package/dist/src/orchestrator/tool-repetition-detector.d.ts +64 -0
  291. package/dist/src/orchestrator/tool-repetition-detector.js +0 -0
  292. package/dist/src/orchestrator/tool-repetition-detector.test.d.ts +1 -0
  293. package/dist/src/orchestrator/tool-repetition-detector.test.js +101 -0
  294. package/dist/src/orchestrator/turn-runner-deps.d.ts +3 -1
  295. package/dist/src/pil/__tests__/clarity-gate.test.d.ts +1 -0
  296. package/dist/src/pil/__tests__/clarity-gate.test.js +228 -0
  297. package/dist/src/pil/__tests__/config.test.js +44 -1
  298. package/dist/src/pil/__tests__/discovery-cache.test.d.ts +1 -0
  299. package/dist/src/pil/__tests__/discovery-cache.test.js +38 -0
  300. package/dist/src/pil/__tests__/discovery-types.test.d.ts +1 -0
  301. package/dist/src/pil/__tests__/discovery-types.test.js +54 -0
  302. package/dist/src/pil/__tests__/discovery.test.d.ts +1 -0
  303. package/dist/src/pil/__tests__/discovery.test.js +101 -0
  304. package/dist/src/pil/__tests__/layer1-intent-trace.test.js +5 -3
  305. package/dist/src/pil/__tests__/layer1-intent.test.js +25 -7
  306. package/dist/src/pil/__tests__/layer15-context-scan.test.d.ts +1 -0
  307. package/dist/src/pil/__tests__/layer15-context-scan.test.js +64 -0
  308. package/dist/src/pil/__tests__/layer16-clarity.test.d.ts +1 -0
  309. package/dist/src/pil/__tests__/layer16-clarity.test.js +153 -0
  310. package/dist/src/pil/__tests__/layer17-feasibility.test.d.ts +1 -0
  311. package/dist/src/pil/__tests__/layer17-feasibility.test.js +36 -0
  312. package/dist/src/pil/__tests__/layer18-acceptance.test.d.ts +1 -0
  313. package/dist/src/pil/__tests__/layer18-acceptance.test.js +95 -0
  314. package/dist/src/pil/__tests__/layer3-ee-injection.test.js +4 -1
  315. package/dist/src/pil/__tests__/layer3-injected-chunk.test.js +3 -3
  316. package/dist/src/pil/__tests__/layer6-output.test.js +69 -9
  317. package/dist/src/pil/__tests__/llm-classify.test.d.ts +1 -0
  318. package/dist/src/pil/__tests__/llm-classify.test.js +113 -0
  319. package/dist/src/pil/__tests__/native-capabilities-workbook.test.d.ts +1 -0
  320. package/dist/src/pil/__tests__/native-capabilities-workbook.test.js +40 -0
  321. package/dist/src/pil/__tests__/pipeline.test.js +3 -2
  322. package/dist/src/pil/__tests__/renderer-coverage.test.js +1 -1
  323. package/dist/src/pil/__tests__/response-tools.test.js +49 -1
  324. package/dist/src/pil/__tests__/scoreComplexity.test.js +2 -2
  325. package/dist/src/pil/agent-operating-contract.d.ts +51 -0
  326. package/dist/src/pil/agent-operating-contract.js +66 -0
  327. package/dist/src/pil/agent-operating-contract.test.d.ts +1 -0
  328. package/dist/src/pil/agent-operating-contract.test.js +75 -0
  329. package/dist/src/pil/budget-log.js +1 -1
  330. package/dist/src/pil/cheap-model-playbook.d.ts +80 -0
  331. package/dist/src/pil/cheap-model-playbook.js +147 -0
  332. package/dist/src/pil/cheap-model-playbook.test.d.ts +1 -0
  333. package/dist/src/pil/cheap-model-playbook.test.js +160 -0
  334. package/dist/src/pil/cheap-model-workbooks.d.ts +55 -0
  335. package/dist/src/pil/cheap-model-workbooks.js +102 -0
  336. package/dist/src/pil/cheap-model-workbooks.test.d.ts +1 -0
  337. package/dist/src/pil/cheap-model-workbooks.test.js +129 -0
  338. package/dist/src/pil/clarity-gate.d.ts +22 -0
  339. package/dist/src/pil/clarity-gate.js +162 -0
  340. package/dist/src/pil/config.d.ts +3 -0
  341. package/dist/src/pil/config.js +11 -0
  342. package/dist/src/pil/discovery-cache.d.ts +4 -0
  343. package/dist/src/pil/discovery-cache.js +18 -0
  344. package/dist/src/pil/discovery-types.d.ts +94 -0
  345. package/dist/src/pil/discovery-types.js +2 -0
  346. package/dist/src/pil/discovery.d.ts +18 -0
  347. package/dist/src/pil/discovery.js +341 -0
  348. package/dist/src/pil/index.d.ts +3 -1
  349. package/dist/src/pil/index.js +2 -1
  350. package/dist/src/pil/layer1-intent.d.ts +37 -1
  351. package/dist/src/pil/layer1-intent.js +675 -39
  352. package/dist/src/pil/layer1-intent.test.js +333 -1
  353. package/dist/src/pil/layer15-context-scan.d.ts +9 -0
  354. package/dist/src/pil/layer15-context-scan.js +164 -0
  355. package/dist/src/pil/layer16-clarity.d.ts +19 -0
  356. package/dist/src/pil/layer16-clarity.js +394 -0
  357. package/dist/src/pil/layer16-clarity.test.d.ts +1 -0
  358. package/dist/src/pil/layer16-clarity.test.js +31 -0
  359. package/dist/src/pil/layer17-feasibility.d.ts +4 -0
  360. package/dist/src/pil/layer17-feasibility.js +30 -0
  361. package/dist/src/pil/layer18-acceptance.d.ts +4 -0
  362. package/dist/src/pil/layer18-acceptance.js +84 -0
  363. package/dist/src/pil/layer1_5-complexity-size.d.ts +23 -0
  364. package/dist/src/pil/layer1_5-complexity-size.js +152 -0
  365. package/dist/src/pil/layer1_5-complexity-size.test.d.ts +10 -0
  366. package/dist/src/pil/layer1_5-complexity-size.test.js +248 -0
  367. package/dist/src/pil/layer3-ee-injection.js +63 -6
  368. package/dist/src/pil/layer4-gsd.js +7 -1
  369. package/dist/src/pil/layer5-context.js +15 -5
  370. package/dist/src/pil/layer6-output.d.ts +2 -0
  371. package/dist/src/pil/layer6-output.js +110 -18
  372. package/dist/src/pil/llm-classify.d.ts +16 -0
  373. package/dist/src/pil/llm-classify.js +179 -0
  374. package/dist/src/pil/native-capabilities-workbook.d.ts +39 -0
  375. package/dist/src/pil/native-capabilities-workbook.js +112 -0
  376. package/dist/src/pil/pipeline.d.ts +21 -0
  377. package/dist/src/pil/pipeline.js +89 -13
  378. package/dist/src/pil/response-tools.d.ts +56 -0
  379. package/dist/src/pil/response-tools.js +76 -2
  380. package/dist/src/pil/schema.d.ts +10 -1
  381. package/dist/src/pil/schema.js +8 -0
  382. package/dist/src/pil/session-state.d.ts +44 -0
  383. package/dist/src/pil/session-state.js +143 -0
  384. package/dist/src/pil/session-state.test.d.ts +1 -0
  385. package/dist/src/pil/session-state.test.js +73 -0
  386. package/dist/src/pil/task-tier-map.d.ts +6 -1
  387. package/dist/src/pil/task-tier-map.js +13 -6
  388. package/dist/src/pil/types.d.ts +18 -0
  389. package/dist/src/product-loop/__tests__/artifact-io.test.js +1 -1
  390. package/dist/src/product-loop/__tests__/assumption-ledger.test.js +1 -1
  391. package/dist/src/product-loop/__tests__/backlog-builder.test.d.ts +10 -0
  392. package/dist/src/product-loop/__tests__/backlog-builder.test.js +175 -0
  393. package/dist/src/product-loop/__tests__/backlog-store.test.d.ts +4 -0
  394. package/dist/src/product-loop/__tests__/backlog-store.test.js +96 -0
  395. package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.js +1 -1
  396. package/dist/src/product-loop/__tests__/complexity-routing.spec.js +113 -7
  397. package/dist/src/product-loop/__tests__/context-policy.test.js +3 -3
  398. package/dist/src/product-loop/__tests__/cost-scoper.test.js +1 -1
  399. package/dist/src/product-loop/__tests__/discovery-context-format.test.d.ts +13 -0
  400. package/dist/src/product-loop/__tests__/discovery-context-format.test.js +100 -0
  401. package/dist/src/product-loop/__tests__/discovery-ecosystem.test.js +100 -1
  402. package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.d.ts +1 -0
  403. package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.js +55 -0
  404. package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.js +92 -0
  405. package/dist/src/product-loop/__tests__/ee-extract-wiring.test.js +8 -3
  406. package/dist/src/product-loop/__tests__/extract-to-ee.test.js +2 -2
  407. package/dist/src/product-loop/__tests__/gather-selectable-alts.test.d.ts +15 -0
  408. package/dist/src/product-loop/__tests__/gather-selectable-alts.test.js +109 -0
  409. package/dist/src/product-loop/__tests__/integration.test.js +7 -2
  410. package/dist/src/product-loop/__tests__/loop-driver-audit.test.js +7 -2
  411. package/dist/src/product-loop/__tests__/loop-driver.test.js +7 -2
  412. package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.d.ts +8 -0
  413. package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.js +67 -0
  414. package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.d.ts +13 -0
  415. package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.js +268 -0
  416. package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.d.ts +8 -0
  417. package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.js +162 -0
  418. package/dist/src/product-loop/__tests__/phase-rituals.test.js +1 -1
  419. package/dist/src/product-loop/__tests__/pick-backend-stack.test.d.ts +11 -0
  420. package/dist/src/product-loop/__tests__/pick-backend-stack.test.js +95 -0
  421. package/dist/src/product-loop/__tests__/progress-snapshot.test.d.ts +8 -0
  422. package/dist/src/product-loop/__tests__/progress-snapshot.test.js +152 -0
  423. package/dist/src/product-loop/__tests__/repo-audit.test.js +1 -1
  424. package/dist/src/product-loop/__tests__/repo-brief.test.d.ts +9 -0
  425. package/dist/src/product-loop/__tests__/repo-brief.test.js +132 -0
  426. package/dist/src/product-loop/__tests__/route-decision-emit.test.js +51 -2
  427. package/dist/src/product-loop/__tests__/ship-polish.test.js +1 -1
  428. package/dist/src/product-loop/__tests__/sprint-planner.test.d.ts +6 -0
  429. package/dist/src/product-loop/__tests__/sprint-planner.test.js +140 -0
  430. package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.d.ts +8 -0
  431. package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.js +221 -0
  432. package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.d.ts +14 -0
  433. package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.js +193 -0
  434. package/dist/src/product-loop/__tests__/sprint-self-verify.test.d.ts +8 -0
  435. package/dist/src/product-loop/__tests__/sprint-self-verify.test.js +73 -0
  436. package/dist/src/product-loop/__tests__/sprint-store.test.d.ts +7 -0
  437. package/dist/src/product-loop/__tests__/sprint-store.test.js +84 -0
  438. package/dist/src/product-loop/__tests__/sufficiency-routing.spec.js +6 -0
  439. package/dist/src/product-loop/__tests__/types.test.js +7 -7
  440. package/dist/src/product-loop/__tests__/verify-failure-threshold.test.js +3 -2
  441. package/dist/src/product-loop/__tests__/verify-failure-tracking.test.js +2 -2
  442. package/dist/src/product-loop/assumption-ledger.js +6 -6
  443. package/dist/src/product-loop/backlog-builder.d.ts +32 -0
  444. package/dist/src/product-loop/backlog-builder.js +198 -0
  445. package/dist/src/product-loop/backlog-store.d.ts +22 -0
  446. package/dist/src/product-loop/backlog-store.js +49 -0
  447. package/dist/src/product-loop/context-policy.js +1 -1
  448. package/dist/src/product-loop/cost-preview.js +17 -1
  449. package/dist/src/product-loop/cross-run-memory.js +11 -11
  450. package/dist/src/product-loop/discover.js +6 -6
  451. package/dist/src/product-loop/discovery-context-format.d.ts +16 -0
  452. package/dist/src/product-loop/discovery-context-format.js +45 -13
  453. package/dist/src/product-loop/discovery-council-runner.js +5 -10
  454. package/dist/src/product-loop/discovery-detection.js +3 -3
  455. package/dist/src/product-loop/discovery-ecosystem.d.ts +23 -0
  456. package/dist/src/product-loop/discovery-ecosystem.js +104 -0
  457. package/dist/src/product-loop/discovery-interview.d.ts +6 -0
  458. package/dist/src/product-loop/discovery-interview.js +38 -2
  459. package/dist/src/product-loop/discovery-recommender.d.ts +29 -0
  460. package/dist/src/product-loop/discovery-recommender.js +126 -7
  461. package/dist/src/product-loop/done-gate.js +5 -5
  462. package/dist/src/product-loop/gather.d.ts +12 -1
  463. package/dist/src/product-loop/gather.js +93 -12
  464. package/dist/src/product-loop/index.d.ts +23 -0
  465. package/dist/src/product-loop/index.js +502 -9
  466. package/dist/src/product-loop/loop-driver.js +27 -28
  467. package/dist/src/product-loop/phase-budget.js +2 -2
  468. package/dist/src/product-loop/progress-snapshot.d.ts +25 -0
  469. package/dist/src/product-loop/progress-snapshot.js +180 -0
  470. package/dist/src/product-loop/repo-brief.d.ts +40 -0
  471. package/dist/src/product-loop/repo-brief.js +212 -0
  472. package/dist/src/product-loop/role-registry.js +1 -1
  473. package/dist/src/product-loop/sprint-planner.d.ts +39 -0
  474. package/dist/src/product-loop/sprint-planner.js +189 -0
  475. package/dist/src/product-loop/sprint-runner.js +201 -9
  476. package/dist/src/product-loop/sprint-self-verify.d.ts +54 -0
  477. package/dist/src/product-loop/sprint-self-verify.js +145 -0
  478. package/dist/src/product-loop/sprint-store.d.ts +27 -0
  479. package/dist/src/product-loop/sprint-store.js +81 -0
  480. package/dist/src/product-loop/typed-artifacts.js +5 -5
  481. package/dist/src/product-loop/types.d.ts +113 -2
  482. package/dist/src/product-loop/verify-failure-tracking.js +1 -1
  483. package/dist/src/providers/__tests__/adapter-oauth-wiring.test.js +18 -2
  484. package/dist/src/providers/__tests__/capabilities-provider-options.test.js +23 -1
  485. package/dist/src/providers/__tests__/capabilities-sanitize.test.js +46 -61
  486. package/dist/src/providers/__tests__/reasoning-roundtrip.test.d.ts +1 -0
  487. package/dist/src/providers/__tests__/reasoning-roundtrip.test.js +135 -0
  488. package/dist/src/providers/__tests__/runtime-integration.test.js +19 -12
  489. package/dist/src/providers/__tests__/runtime.test.js +3 -6
  490. package/dist/src/providers/__tests__/siliconflow-sse-repair.test.d.ts +1 -0
  491. package/dist/src/providers/__tests__/siliconflow-sse-repair.test.js +267 -0
  492. package/dist/src/providers/auth/__tests__/browser-flow.test.js +1 -1
  493. package/dist/src/providers/auth/__tests__/gemini-oauth.test.js +1 -1
  494. package/dist/src/providers/auth/__tests__/grok-oauth.test.d.ts +8 -0
  495. package/dist/src/providers/auth/__tests__/grok-oauth.test.js +236 -0
  496. package/dist/src/providers/auth/__tests__/token-store.test.js +7 -7
  497. package/dist/src/providers/auth/gemini-oauth.js +2 -2
  498. package/dist/src/providers/auth/grok-oauth.d.ts +63 -0
  499. package/dist/src/providers/auth/grok-oauth.js +341 -0
  500. package/dist/src/providers/auth/registry.js +17 -0
  501. package/dist/src/providers/auth/token-store.js +1 -1
  502. package/dist/src/providers/capabilities.js +9 -15
  503. package/dist/src/providers/keychain.js +14 -2
  504. package/dist/src/providers/mcp-vision-bridge.js +49 -49
  505. package/dist/src/providers/mcp-vision-bridge.test.js +12 -12
  506. package/dist/src/providers/openai-compatible.js +5 -1
  507. package/dist/src/providers/pricing.d.ts +7 -4
  508. package/dist/src/providers/pricing.js +21 -5
  509. package/dist/src/providers/pricing.test.js +35 -9
  510. package/dist/src/providers/runtime.d.ts +1 -0
  511. package/dist/src/providers/runtime.js +39 -13
  512. package/dist/src/providers/siliconflow-sse-repair.d.ts +58 -0
  513. package/dist/src/providers/siliconflow-sse-repair.js +177 -0
  514. package/dist/src/providers/strategies/deepseek.strategy.js +28 -0
  515. package/dist/src/providers/strategies/siliconflow.strategy.js +2 -0
  516. package/dist/src/providers/strategies/xai.strategy.js +8 -1
  517. package/dist/src/providers/wire-debug.js +2 -2
  518. package/dist/src/reporter/__tests__/acl-check.test.d.ts +6 -0
  519. package/dist/src/reporter/__tests__/acl-check.test.js +59 -0
  520. package/dist/src/reporter/__tests__/auto-fire.test.d.ts +10 -0
  521. package/dist/src/reporter/__tests__/auto-fire.test.js +140 -0
  522. package/dist/src/reporter/__tests__/budget.test.d.ts +7 -0
  523. package/dist/src/reporter/__tests__/budget.test.js +60 -0
  524. package/dist/src/reporter/__tests__/handlers.test.d.ts +7 -0
  525. package/dist/src/reporter/__tests__/handlers.test.js +163 -0
  526. package/dist/src/reporter/__tests__/query-router.test.d.ts +6 -0
  527. package/dist/src/reporter/__tests__/query-router.test.js +90 -0
  528. package/dist/src/reporter/acl-check.d.ts +23 -0
  529. package/dist/src/reporter/acl-check.js +43 -0
  530. package/dist/src/reporter/auto-fire.d.ts +59 -0
  531. package/dist/src/reporter/auto-fire.js +126 -0
  532. package/dist/src/reporter/budget.d.ts +17 -0
  533. package/dist/src/reporter/budget.js +52 -0
  534. package/dist/src/reporter/handlers.d.ts +32 -0
  535. package/dist/src/reporter/handlers.js +180 -0
  536. package/dist/src/reporter/index.d.ts +44 -0
  537. package/dist/src/reporter/index.js +167 -0
  538. package/dist/src/reporter/query-router.d.ts +21 -0
  539. package/dist/src/reporter/query-router.js +32 -0
  540. package/dist/src/router/__tests__/step-router.test.js +3 -3
  541. package/dist/src/router/classifier/regex.js +49 -2
  542. package/dist/src/router/classifier/regex.test.js +3 -1
  543. package/dist/src/router/decide.d.ts +18 -0
  544. package/dist/src/router/decide.js +39 -7
  545. package/dist/src/router/decide.test.js +58 -8
  546. package/dist/src/router/role-override.test.d.ts +1 -0
  547. package/dist/src/router/role-override.test.js +26 -0
  548. package/dist/src/router/step-router.js +1 -1
  549. package/dist/src/router/warm.d.ts +2 -0
  550. package/dist/src/router/warm.js +42 -12
  551. package/dist/src/router/warm.test.js +59 -1
  552. package/dist/src/scaffold/__tests__/init-new.spec.js +3 -3
  553. package/dist/src/scaffold/bb-ecosystem-apply.js +51 -49
  554. package/dist/src/scaffold/bb-quality-gate.js +5 -5
  555. package/dist/src/scaffold/continuation-prompt.js +60 -60
  556. package/dist/src/scaffold/init-new.js +454 -454
  557. package/dist/src/self-qa/__tests__/agentic-context.test.d.ts +1 -0
  558. package/dist/src/self-qa/__tests__/agentic-context.test.js +98 -0
  559. package/dist/src/self-qa/__tests__/agentic-loop.test.d.ts +1 -0
  560. package/dist/src/self-qa/__tests__/agentic-loop.test.js +62 -0
  561. package/dist/src/self-qa/__tests__/delta-encoder.test.d.ts +1 -0
  562. package/dist/src/self-qa/__tests__/delta-encoder.test.js +97 -0
  563. package/dist/src/self-qa/__tests__/judge.test.d.ts +1 -0
  564. package/dist/src/self-qa/__tests__/judge.test.js +131 -0
  565. package/dist/src/self-qa/__tests__/scenario-planner.test.d.ts +1 -0
  566. package/dist/src/self-qa/__tests__/scenario-planner.test.js +79 -0
  567. package/dist/src/self-qa/__tests__/spec-emitter.test.d.ts +1 -0
  568. package/dist/src/self-qa/__tests__/spec-emitter.test.js +62 -0
  569. package/dist/src/self-qa/agentic-context.d.ts +29 -0
  570. package/dist/src/self-qa/agentic-context.js +189 -0
  571. package/dist/src/self-qa/agentic-loop.d.ts +96 -0
  572. package/dist/src/self-qa/agentic-loop.js +516 -0
  573. package/dist/src/self-qa/delta-encoder.d.ts +35 -0
  574. package/dist/src/self-qa/delta-encoder.js +138 -0
  575. package/dist/src/self-qa/index.d.ts +43 -0
  576. package/dist/src/self-qa/index.js +65 -0
  577. package/dist/src/self-qa/judge.d.ts +25 -0
  578. package/dist/src/self-qa/judge.js +233 -0
  579. package/dist/src/self-qa/orchestrator.d.ts +31 -0
  580. package/dist/src/self-qa/orchestrator.js +236 -0
  581. package/dist/src/self-qa/scenario-planner.d.ts +39 -0
  582. package/dist/src/self-qa/scenario-planner.js +262 -0
  583. package/dist/src/self-qa/spec-emitter.d.ts +25 -0
  584. package/dist/src/self-qa/spec-emitter.js +138 -0
  585. package/dist/src/self-qa/types.d.ts +113 -0
  586. package/dist/src/self-qa/types.js +11 -0
  587. package/dist/src/storage/__tests__/migrations.test.js +2 -2
  588. package/dist/src/storage/__tests__/sweep-stale-pending.test.d.ts +10 -0
  589. package/dist/src/storage/__tests__/sweep-stale-pending.test.js +97 -0
  590. package/dist/src/storage/__tests__/ui-interaction-log.test.js +30 -0
  591. package/dist/src/storage/atomic-io.test.js +2 -2
  592. package/dist/src/storage/config.test.js +1 -1
  593. package/dist/src/storage/interaction-log.d.ts +1 -1
  594. package/dist/src/storage/interaction-log.js +5 -5
  595. package/dist/src/storage/migrations.js +122 -122
  596. package/dist/src/storage/sessions.js +57 -42
  597. package/dist/src/storage/transcript-response-entry.test.d.ts +1 -0
  598. package/dist/src/storage/transcript-response-entry.test.js +98 -0
  599. package/dist/src/storage/transcript.d.ts +22 -0
  600. package/dist/src/storage/transcript.js +149 -74
  601. package/dist/src/storage/ui-interaction-log.d.ts +11 -1
  602. package/dist/src/storage/usage-cap.test.js +1 -1
  603. package/dist/src/storage/usage.js +14 -14
  604. package/dist/src/storage/workspaces.js +12 -12
  605. package/dist/src/tools/__tests__/vision-gate.test.d.ts +1 -0
  606. package/dist/src/tools/__tests__/vision-gate.test.js +56 -0
  607. package/dist/src/tools/bash-output-cache.d.ts +59 -0
  608. package/dist/src/tools/bash-output-cache.js +108 -0
  609. package/dist/src/tools/bash-output-cache.test.d.ts +1 -0
  610. package/dist/src/tools/bash-output-cache.test.js +89 -0
  611. package/dist/src/tools/bash-output-integration.test.d.ts +10 -0
  612. package/dist/src/tools/bash-output-integration.test.js +30 -0
  613. package/dist/src/tools/bash.d.ts +12 -0
  614. package/dist/src/tools/bash.js +114 -21
  615. package/dist/src/tools/bash.test.js +80 -3
  616. package/dist/src/tools/computer.test.js +1 -1
  617. package/dist/src/tools/file-tracker.test.js +1 -1
  618. package/dist/src/tools/file.js +23 -2
  619. package/dist/src/tools/file.test.js +49 -1
  620. package/dist/src/tools/registry-bash-empty-command.test.d.ts +13 -0
  621. package/dist/src/tools/registry-bash-empty-command.test.js +56 -0
  622. package/dist/src/tools/registry-bash-footer.test.d.ts +7 -0
  623. package/dist/src/tools/registry-bash-footer.test.js +82 -0
  624. package/dist/src/tools/registry-ee-query.test.d.ts +11 -0
  625. package/dist/src/tools/registry-ee-query.test.js +48 -0
  626. package/dist/src/tools/registry-session-repeat.test.d.ts +12 -0
  627. package/dist/src/tools/registry-session-repeat.test.js +87 -0
  628. package/dist/src/tools/registry.d.ts +38 -0
  629. package/dist/src/tools/registry.js +262 -4
  630. package/dist/src/tools/schedule.test.js +1 -1
  631. package/dist/src/tools/todo-write-snapshot.d.ts +18 -0
  632. package/dist/src/tools/todo-write-snapshot.js +66 -0
  633. package/dist/src/tools/todo-write-snapshot.test.d.ts +1 -0
  634. package/dist/src/tools/todo-write-snapshot.test.js +43 -0
  635. package/dist/src/tools/vision-gate.d.ts +41 -0
  636. package/dist/src/tools/vision-gate.js +67 -0
  637. package/dist/src/types/index.d.ts +65 -4
  638. package/dist/src/ui/__tests__/picker-providers.test.d.ts +1 -0
  639. package/dist/src/ui/__tests__/picker-providers.test.js +31 -0
  640. package/dist/src/ui/agents-modal.js +2 -0
  641. package/dist/src/ui/app.d.ts +1 -0
  642. package/dist/src/ui/app.js +0 -0
  643. package/dist/src/ui/components/__tests__/task-list-panel.test.d.ts +1 -0
  644. package/dist/src/ui/components/__tests__/task-list-panel.test.js +31 -0
  645. package/dist/src/ui/components/council-info-card.d.ts +1 -2
  646. package/dist/src/ui/components/council-leader-bubble.d.ts +1 -2
  647. package/dist/src/ui/components/council-message-bubble.d.ts +1 -2
  648. package/dist/src/ui/components/council-phase-timeline.js +20 -1
  649. package/dist/src/ui/components/council-placeholder-bubble.d.ts +1 -2
  650. package/dist/src/ui/components/council-question-card.js +3 -0
  651. package/dist/src/ui/components/council-synthesis-banner.d.ts +1 -2
  652. package/dist/src/ui/components/halt-recovery-card.js +1 -0
  653. package/dist/src/ui/components/message-view.d.ts +11 -1
  654. package/dist/src/ui/components/message-view.js +65 -3
  655. package/dist/src/ui/components/point-to-existing-form-card.js +5 -1
  656. package/dist/src/ui/components/task-list-panel.d.ts +32 -0
  657. package/dist/src/ui/components/task-list-panel.js +84 -0
  658. package/dist/src/ui/components/tool-group.d.ts +22 -0
  659. package/dist/src/ui/components/tool-group.js +85 -0
  660. package/dist/src/ui/hooks/use-agent-editor.js +2 -3
  661. package/dist/src/ui/hooks/use-model-picker.d.ts +2 -2
  662. package/dist/src/ui/modals/model-picker-modal.d.ts +2 -0
  663. package/dist/src/ui/modals/model-picker-modal.js +2 -4
  664. package/dist/src/ui/picker-providers.d.ts +21 -0
  665. package/dist/src/ui/picker-providers.js +39 -0
  666. package/dist/src/ui/slash/__tests__/clear.test.js +1 -1
  667. package/dist/src/ui/slash/__tests__/compact.test.js +1 -1
  668. package/dist/src/ui/slash/__tests__/discuss.test.js +1 -1
  669. package/dist/src/ui/slash/__tests__/execute.test.js +1 -1
  670. package/dist/src/ui/slash/__tests__/expand.test.js +1 -1
  671. package/dist/src/ui/slash/__tests__/ideal.test.js +41 -0
  672. package/dist/src/ui/slash/__tests__/menu-parity.test.d.ts +1 -0
  673. package/dist/src/ui/slash/__tests__/menu-parity.test.js +1 -0
  674. package/dist/src/ui/slash/__tests__/plan.test.js +4 -1
  675. package/dist/src/ui/slash/__tests__/status-render.test.d.ts +7 -0
  676. package/dist/src/ui/slash/__tests__/status-render.test.js +77 -0
  677. package/dist/src/ui/slash/council-inspect.js +4 -4
  678. package/dist/src/ui/slash/export.js +32 -5
  679. package/dist/src/ui/slash/ideal.d.ts +9 -0
  680. package/dist/src/ui/slash/ideal.js +27 -1
  681. package/dist/src/ui/slash/menu-items.js +1 -0
  682. package/dist/src/ui/slash/status.d.ts +12 -0
  683. package/dist/src/ui/slash/status.js +32 -0
  684. package/dist/src/ui/state/active-run.d.ts +26 -0
  685. package/dist/src/ui/state/active-run.js +44 -0
  686. package/dist/src/ui/status-bar/index.d.ts +6 -1
  687. package/dist/src/ui/status-bar/index.js +21 -2
  688. package/dist/src/ui/status-bar/index.test.js +60 -1
  689. package/dist/src/ui/status-bar/store.d.ts +16 -0
  690. package/dist/src/ui/status-bar/store.js +120 -1
  691. package/dist/src/ui/utils/__tests__/format.test.d.ts +1 -0
  692. package/dist/src/ui/utils/__tests__/format.test.js +50 -0
  693. package/dist/src/ui/utils/__tests__/tools.test.d.ts +1 -0
  694. package/dist/src/ui/utils/__tests__/tools.test.js +48 -0
  695. package/dist/src/ui/utils/format.d.ts +17 -0
  696. package/dist/src/ui/utils/format.js +45 -2
  697. package/dist/src/ui/utils/text.js +2 -1
  698. package/dist/src/ui/utils/tools.d.ts +2 -0
  699. package/dist/src/ui/utils/tools.js +58 -9
  700. package/dist/src/usage/__tests__/product-ledger.test.js +5 -4
  701. package/dist/src/usage/decision-log.d.ts +1 -1
  702. package/dist/src/usage/downgrade.d.ts +3 -2
  703. package/dist/src/usage/downgrade.js +25 -9
  704. package/dist/src/usage/downgrade.test.js +40 -37
  705. package/dist/src/usage/product-ledger.d.ts +4 -0
  706. package/dist/src/usage/product-ledger.js +8 -1
  707. package/dist/src/utils/__tests__/llm-deadline.test.d.ts +1 -0
  708. package/dist/src/utils/__tests__/llm-deadline.test.js +56 -0
  709. package/dist/src/utils/__tests__/settings-disabled-models.test.js +1 -1
  710. package/dist/src/utils/__tests__/settings-web-research.test.js +1 -1
  711. package/dist/src/utils/__tests__/visible-retry.test.js +1 -1
  712. package/dist/src/utils/clipboard-image.js +23 -23
  713. package/dist/src/utils/install-manager.test.js +1 -1
  714. package/dist/src/utils/llm-deadline.d.ts +44 -0
  715. package/dist/src/utils/llm-deadline.js +80 -0
  716. package/dist/src/utils/permission-mode.d.ts +16 -9
  717. package/dist/src/utils/permission-mode.js +55 -4
  718. package/dist/src/utils/settings.d.ts +22 -0
  719. package/dist/src/utils/settings.js +47 -6
  720. package/dist/src/utils/shell.d.ts +12 -0
  721. package/dist/src/utils/shell.js +23 -12
  722. package/dist/src/utils/shell.test.js +27 -1
  723. package/dist/src/utils/side-question.js +2 -2
  724. package/dist/src/utils/skills.js +3 -3
  725. package/dist/src/utils/skills.test.js +1 -1
  726. package/dist/src/utils/subagents-settings.test.js +9 -3
  727. package/dist/src/verify/__tests__/coverage-parsers.test.js +30 -30
  728. package/dist/src/verify/__tests__/dotnet-recipe.test.js +1 -1
  729. package/dist/src/verify/checkpoint.test.js +1 -1
  730. package/dist/src/verify/entrypoint.d.ts +8 -8
  731. package/dist/src/verify/entrypoint.js +69 -32
  732. package/dist/src/verify/entrypoint.test.js +1 -1
  733. package/dist/src/verify/environment.test.js +1 -1
  734. package/dist/src/verify/orchestrator.test.js +1 -1
  735. package/dist/src/verify/runtime-prep.test.js +1 -1
  736. package/package.json +125 -122
  737. package/scripts/postinstall.cjs +76 -73
  738. package/dist/packages/agent-harness-core/src/driver.js.map +0 -1
  739. package/dist/packages/agent-harness-core/src/event-filter.js.map +0 -1
  740. package/dist/packages/agent-harness-core/src/event-redact.js.map +0 -1
  741. package/dist/packages/agent-harness-core/src/idle.js.map +0 -1
  742. package/dist/packages/agent-harness-core/src/index.js.map +0 -1
  743. package/dist/packages/agent-harness-core/src/mcp-server.js.map +0 -1
  744. package/dist/packages/agent-harness-core/src/mock-llm.js.map +0 -1
  745. package/dist/packages/agent-harness-core/src/predicate.js.map +0 -1
  746. package/dist/packages/agent-harness-core/src/protocol.js.map +0 -1
  747. package/dist/packages/agent-harness-core/src/registry.js.map +0 -1
  748. package/dist/packages/agent-harness-core/src/selector.js.map +0 -1
  749. package/dist/packages/agent-harness-core/src/spec-helpers.js.map +0 -1
  750. package/dist/packages/agent-harness-core/src/transports/sidechannel.js.map +0 -1
  751. package/dist/packages/agent-harness-core/src/transports/ws.js.map +0 -1
  752. package/dist/packages/agent-harness-opentui/src/agent-mode.js.map +0 -1
  753. package/dist/packages/agent-harness-opentui/src/index.js.map +0 -1
  754. package/dist/packages/agent-harness-opentui/src/input-bridge.js.map +0 -1
  755. package/dist/packages/agent-harness-opentui/src/install.js.map +0 -1
  756. package/dist/packages/agent-harness-opentui/src/reconciler-hook.js.map +0 -1
  757. package/dist/packages/agent-harness-opentui/src/semantic.js.map +0 -1
  758. package/dist/src/__test-stubs__/ee-server.js.map +0 -1
  759. package/dist/src/__test-stubs__/vitest-setup.js.map +0 -1
  760. package/dist/src/__tests__/council/bubble-layout.test.js.map +0 -1
  761. package/dist/src/__tests__/council/code-block-truncate.test.js.map +0 -1
  762. package/dist/src/__tests__/council/role-palette.test.js.map +0 -1
  763. package/dist/src/__tests__/first-run-wizard.test.js.map +0 -1
  764. package/dist/src/agent-harness/__tests__/cli-flags.spec.js.map +0 -1
  765. package/dist/src/agent-harness/__tests__/driver.spec.js.map +0 -1
  766. package/dist/src/agent-harness/__tests__/idle.spec.js.map +0 -1
  767. package/dist/src/agent-harness/__tests__/mock-llm.spec.js.map +0 -1
  768. package/dist/src/agent-harness/__tests__/mock-model.spec.js.map +0 -1
  769. package/dist/src/agent-harness/__tests__/predicate.spec.js.map +0 -1
  770. package/dist/src/agent-harness/__tests__/protocol.spec.js.map +0 -1
  771. package/dist/src/agent-harness/__tests__/schema.spec.js.map +0 -1
  772. package/dist/src/agent-harness/__tests__/selector.spec.js.map +0 -1
  773. package/dist/src/agent-harness/__tests__/sidechannel.spec.js.map +0 -1
  774. package/dist/src/agent-harness/__tests__/spec-helpers.spec.js.map +0 -1
  775. package/dist/src/agent-harness/index.js.map +0 -1
  776. package/dist/src/agent-harness/mock-model.js.map +0 -1
  777. package/dist/src/agent-harness/test-spawn.js.map +0 -1
  778. package/dist/src/billing/index.js.map +0 -1
  779. package/dist/src/chat/__tests__/broadcast-bus.test.js.map +0 -1
  780. package/dist/src/chat/__tests__/channel-manager.test.js.map +0 -1
  781. package/dist/src/chat/__tests__/client.test.js.map +0 -1
  782. package/dist/src/chat/__tests__/discord-integration.test.js.map +0 -1
  783. package/dist/src/chat/__tests__/intent-prompt.test.js.map +0 -1
  784. package/dist/src/chat/__tests__/verdict-resolver.test.js.map +0 -1
  785. package/dist/src/chat/broadcast-bus.js.map +0 -1
  786. package/dist/src/chat/channel-manager.js.map +0 -1
  787. package/dist/src/chat/chat-keychain.js.map +0 -1
  788. package/dist/src/chat/factory.js.map +0 -1
  789. package/dist/src/chat/intent-prompt.js.map +0 -1
  790. package/dist/src/chat/providers/discord/client.js.map +0 -1
  791. package/dist/src/chat/types.js.map +0 -1
  792. package/dist/src/chat/verdict-constants.js.map +0 -1
  793. package/dist/src/chat/verdict-resolver.js.map +0 -1
  794. package/dist/src/cli/__tests__/bw-vault.test.js.map +0 -1
  795. package/dist/src/cli/__tests__/keys-bundle.test.js.map +0 -1
  796. package/dist/src/cli/__tests__/share-cmd.test.js.map +0 -1
  797. package/dist/src/cli/bw-vault.js.map +0 -1
  798. package/dist/src/cli/config/__tests__/model-picker.test.js.map +0 -1
  799. package/dist/src/cli/config/__tests__/provider-fetch.test.js.map +0 -1
  800. package/dist/src/cli/config/index.js.map +0 -1
  801. package/dist/src/cli/config/model-picker.js.map +0 -1
  802. package/dist/src/cli/config/provider-fetch.js.map +0 -1
  803. package/dist/src/cli/config/screen-council.js.map +0 -1
  804. package/dist/src/cli/config/screen-models.js.map +0 -1
  805. package/dist/src/cli/config/screen-providers.js.map +0 -1
  806. package/dist/src/cli/config/tui.js.map +0 -1
  807. package/dist/src/cli/cost-forensics.js.map +0 -1
  808. package/dist/src/cli/cost-forensics.test.js.map +0 -1
  809. package/dist/src/cli/keys-bundle.js.map +0 -1
  810. package/dist/src/cli/keys.js.map +0 -1
  811. package/dist/src/cli/keys.test.js.map +0 -1
  812. package/dist/src/cli/pil-report.js.map +0 -1
  813. package/dist/src/cli/share-cmd.js.map +0 -1
  814. package/dist/src/cli/usage-report.js.map +0 -1
  815. package/dist/src/cloud/index.js.map +0 -1
  816. package/dist/src/council/__tests__/accounting.test.js.map +0 -1
  817. package/dist/src/council/__tests__/audit-replay.test.js.map +0 -1
  818. package/dist/src/council/__tests__/clarifier-max-rounds.test.js.map +0 -1
  819. package/dist/src/council/__tests__/clarifier-options.test.js.map +0 -1
  820. package/dist/src/council/__tests__/cost-aware.test.js.map +0 -1
  821. package/dist/src/council/__tests__/debate-planner-structured.test.js.map +0 -1
  822. package/dist/src/council/__tests__/evaluator-metrics.test.js.map +0 -1
  823. package/dist/src/council/__tests__/parse-outcome-fallback.test.js.map +0 -1
  824. package/dist/src/council/__tests__/research-tools.test.js.map +0 -1
  825. package/dist/src/council/__tests__/round-tools.test.js.map +0 -1
  826. package/dist/src/council/__tests__/tool-trace.test.js.map +0 -1
  827. package/dist/src/council/__tests__/types-contract.test.js.map +0 -1
  828. package/dist/src/council/clarifier.js.map +0 -1
  829. package/dist/src/council/context.js.map +0 -1
  830. package/dist/src/council/debate-planner.js.map +0 -1
  831. package/dist/src/council/debate.js.map +0 -1
  832. package/dist/src/council/executor.js.map +0 -1
  833. package/dist/src/council/index.js.map +0 -1
  834. package/dist/src/council/leader.js.map +0 -1
  835. package/dist/src/council/llm.js.map +0 -1
  836. package/dist/src/council/phase-events.js.map +0 -1
  837. package/dist/src/council/planner.js.map +0 -1
  838. package/dist/src/council/preflight.js.map +0 -1
  839. package/dist/src/council/prompts.js.map +0 -1
  840. package/dist/src/council/types.js.map +0 -1
  841. package/dist/src/daemon/scheduler.js.map +0 -1
  842. package/dist/src/daemon/scheduler.test.js.map +0 -1
  843. package/dist/src/ee/__tests__/bb-design.test.js.map +0 -1
  844. package/dist/src/ee/__tests__/pil-context-bridge.test.js.map +0 -1
  845. package/dist/src/ee/__tests__/pipeline.integration.test.js.map +0 -1
  846. package/dist/src/ee/__tests__/render-sink-wiring.test.js.map +0 -1
  847. package/dist/src/ee/auth.js.map +0 -1
  848. package/dist/src/ee/auth.test.js.map +0 -1
  849. package/dist/src/ee/bb-design.js.map +0 -1
  850. package/dist/src/ee/bb-retrieval.js.map +0 -1
  851. package/dist/src/ee/bridge.js.map +0 -1
  852. package/dist/src/ee/bridge.test.js.map +0 -1
  853. package/dist/src/ee/client-mode.js.map +0 -1
  854. package/dist/src/ee/client.js.map +0 -1
  855. package/dist/src/ee/client.test.js.map +0 -1
  856. package/dist/src/ee/council-bridge.js.map +0 -1
  857. package/dist/src/ee/embedding-cache.js.map +0 -1
  858. package/dist/src/ee/extract-session.js.map +0 -1
  859. package/dist/src/ee/extract-session.test.js.map +0 -1
  860. package/dist/src/ee/health.js.map +0 -1
  861. package/dist/src/ee/index.js.map +0 -1
  862. package/dist/src/ee/intercept.js.map +0 -1
  863. package/dist/src/ee/intercept.test.js.map +0 -1
  864. package/dist/src/ee/judge.js.map +0 -1
  865. package/dist/src/ee/judge.test.js.map +0 -1
  866. package/dist/src/ee/mistake-detector.js.map +0 -1
  867. package/dist/src/ee/mistake-detector.test.js.map +0 -1
  868. package/dist/src/ee/offline-queue.js.map +0 -1
  869. package/dist/src/ee/offline-queue.test.js.map +0 -1
  870. package/dist/src/ee/phase-outcome.js.map +0 -1
  871. package/dist/src/ee/phase-outcome.test.js.map +0 -1
  872. package/dist/src/ee/phase-tracker.js.map +0 -1
  873. package/dist/src/ee/phase-tracker.test.js.map +0 -1
  874. package/dist/src/ee/posttool.js.map +0 -1
  875. package/dist/src/ee/posttool.test.js.map +0 -1
  876. package/dist/src/ee/prompt-stale.js.map +0 -1
  877. package/dist/src/ee/prompt-stale.test.js.map +0 -1
  878. package/dist/src/ee/render.js.map +0 -1
  879. package/dist/src/ee/render.test.js.map +0 -1
  880. package/dist/src/ee/scope.js.map +0 -1
  881. package/dist/src/ee/scope.test.js.map +0 -1
  882. package/dist/src/ee/session-trajectory.js.map +0 -1
  883. package/dist/src/ee/session-trajectory.test.js.map +0 -1
  884. package/dist/src/ee/tenant.js.map +0 -1
  885. package/dist/src/ee/touch.test.js.map +0 -1
  886. package/dist/src/ee/types.js.map +0 -1
  887. package/dist/src/flow/__tests__/migration.test.js.map +0 -1
  888. package/dist/src/flow/__tests__/parser.test.js.map +0 -1
  889. package/dist/src/flow/__tests__/run-manager-product.test.js.map +0 -1
  890. package/dist/src/flow/__tests__/run-manager.test.js.map +0 -1
  891. package/dist/src/flow/__tests__/scaffold-checkpoint.test.js.map +0 -1
  892. package/dist/src/flow/__tests__/scaffold.test.js.map +0 -1
  893. package/dist/src/flow/__tests__/warning-persist.test.js.map +0 -1
  894. package/dist/src/flow/artifact-io.js.map +0 -1
  895. package/dist/src/flow/compaction/__tests__/compress.test.js.map +0 -1
  896. package/dist/src/flow/compaction/__tests__/extract.test.js.map +0 -1
  897. package/dist/src/flow/compaction/__tests__/preserve.test.js.map +0 -1
  898. package/dist/src/flow/compaction/compress.js.map +0 -1
  899. package/dist/src/flow/compaction/extract.js.map +0 -1
  900. package/dist/src/flow/compaction/index.js.map +0 -1
  901. package/dist/src/flow/compaction/preserve.js.map +0 -1
  902. package/dist/src/flow/index.js.map +0 -1
  903. package/dist/src/flow/migration.js.map +0 -1
  904. package/dist/src/flow/parser.js.map +0 -1
  905. package/dist/src/flow/run-manager.js.map +0 -1
  906. package/dist/src/flow/scaffold-checkpoint.js.map +0 -1
  907. package/dist/src/flow/scaffold.js.map +0 -1
  908. package/dist/src/flow/warning-persist.js.map +0 -1
  909. package/dist/src/generated/version.js.map +0 -1
  910. package/dist/src/gsd/__tests__/complexity.test.js.map +0 -1
  911. package/dist/src/gsd/__tests__/directives.test.js.map +0 -1
  912. package/dist/src/gsd/__tests__/gray-areas.test.js.map +0 -1
  913. package/dist/src/gsd/__tests__/types.test.js.map +0 -1
  914. package/dist/src/gsd/complexity.js.map +0 -1
  915. package/dist/src/gsd/directives.js.map +0 -1
  916. package/dist/src/gsd/gray-areas.js.map +0 -1
  917. package/dist/src/gsd/index.js.map +0 -1
  918. package/dist/src/gsd/types.js.map +0 -1
  919. package/dist/src/headless/__tests__/council-answers.test.js.map +0 -1
  920. package/dist/src/headless/council-answers.js.map +0 -1
  921. package/dist/src/headless/output.js.map +0 -1
  922. package/dist/src/headless/output.test.js.map +0 -1
  923. package/dist/src/hooks/config.js.map +0 -1
  924. package/dist/src/hooks/index.js.map +0 -1
  925. package/dist/src/hooks/types.js.map +0 -1
  926. package/dist/src/index.js.map +0 -1
  927. package/dist/src/lsp/builtins.js.map +0 -1
  928. package/dist/src/lsp/builtins.test.js.map +0 -1
  929. package/dist/src/lsp/client.js.map +0 -1
  930. package/dist/src/lsp/manager.js.map +0 -1
  931. package/dist/src/lsp/manager.test.js.map +0 -1
  932. package/dist/src/lsp/npm-cache.js.map +0 -1
  933. package/dist/src/lsp/npm-cache.test.js.map +0 -1
  934. package/dist/src/lsp/runtime.js.map +0 -1
  935. package/dist/src/lsp/smoke.test.js.map +0 -1
  936. package/dist/src/lsp/types.js.map +0 -1
  937. package/dist/src/mcp/__tests__/auto-setup.test.js.map +0 -1
  938. package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.js.map +0 -1
  939. package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.js.map +0 -1
  940. package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.js.map +0 -1
  941. package/dist/src/mcp/__tests__/harness-driver-security.spec.js.map +0 -1
  942. package/dist/src/mcp/__tests__/harness-driver.spec.js.map +0 -1
  943. package/dist/src/mcp/__tests__/lazy-schema.spec.js.map +0 -1
  944. package/dist/src/mcp/__tests__/mcp-keychain.test.js.map +0 -1
  945. package/dist/src/mcp/__tests__/research-onboarding.test.js.map +0 -1
  946. package/dist/src/mcp/__tests__/runtime-hydration.test.js.map +0 -1
  947. package/dist/src/mcp/__tests__/runtime-sanitize.test.js.map +0 -1
  948. package/dist/src/mcp/auto-setup.js.map +0 -1
  949. package/dist/src/mcp/catalog.js.map +0 -1
  950. package/dist/src/mcp/mcp-keychain.js.map +0 -1
  951. package/dist/src/mcp/oauth-callback.js.map +0 -1
  952. package/dist/src/mcp/oauth-provider.js.map +0 -1
  953. package/dist/src/mcp/opentui-spawn.js.map +0 -1
  954. package/dist/src/mcp/parse-headers.js.map +0 -1
  955. package/dist/src/mcp/parse-headers.test.js.map +0 -1
  956. package/dist/src/mcp/research-onboarding.js.map +0 -1
  957. package/dist/src/mcp/runtime.js.map +0 -1
  958. package/dist/src/mcp/smoke.test.js.map +0 -1
  959. package/dist/src/mcp/validate.js.map +0 -1
  960. package/dist/src/models/__tests__/registry.test.js.map +0 -1
  961. package/dist/src/models/catalog-client.js.map +0 -1
  962. package/dist/src/models/classify-tier.js.map +0 -1
  963. package/dist/src/models/index.js.map +0 -1
  964. package/dist/src/models/registry.js.map +0 -1
  965. package/dist/src/ops/__tests__/doctor-council-mcp.test.js.map +0 -1
  966. package/dist/src/ops/__tests__/doctor-ee-health.test.js.map +0 -1
  967. package/dist/src/ops/bug-report.js.map +0 -1
  968. package/dist/src/ops/bug-report.test.js.map +0 -1
  969. package/dist/src/ops/doctor.js.map +0 -1
  970. package/dist/src/ops/doctor.test.js.map +0 -1
  971. package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js.map +0 -1
  972. package/dist/src/orchestrator/__tests__/council-manager.test.js.map +0 -1
  973. package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.js.map +0 -1
  974. package/dist/src/orchestrator/__tests__/current-call-id.test.js.map +0 -1
  975. package/dist/src/orchestrator/__tests__/flow-resume.test.js.map +0 -1
  976. package/dist/src/orchestrator/__tests__/message-processor.test.js.map +0 -1
  977. package/dist/src/orchestrator/__tests__/message-write-ahead.test.js.map +0 -1
  978. package/dist/src/orchestrator/__tests__/read-path-budget.test.js.map +0 -1
  979. package/dist/src/orchestrator/__tests__/retry-classifier.test.js.map +0 -1
  980. package/dist/src/orchestrator/__tests__/retry-stream.test.js.map +0 -1
  981. package/dist/src/orchestrator/__tests__/route-feedback.test.js.map +0 -1
  982. package/dist/src/orchestrator/__tests__/stream-runner.test.js.map +0 -1
  983. package/dist/src/orchestrator/__tests__/usage-events-shape.test.js.map +0 -1
  984. package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.js.map +0 -1
  985. package/dist/src/orchestrator/__tests__/write-ahead.test.js.map +0 -1
  986. package/dist/src/orchestrator/abort.js.map +0 -1
  987. package/dist/src/orchestrator/abort.test.js.map +0 -1
  988. package/dist/src/orchestrator/agent-options.js.map +0 -1
  989. package/dist/src/orchestrator/agent.test.js.map +0 -1
  990. package/dist/src/orchestrator/batch-turn-runner.js.map +0 -1
  991. package/dist/src/orchestrator/batch-utils.js.map +0 -1
  992. package/dist/src/orchestrator/cleanup.test.js.map +0 -1
  993. package/dist/src/orchestrator/compaction.js.map +0 -1
  994. package/dist/src/orchestrator/compaction.test.js.map +0 -1
  995. package/dist/src/orchestrator/council-manager.js.map +0 -1
  996. package/dist/src/orchestrator/cross-turn-dedup.js.map +0 -1
  997. package/dist/src/orchestrator/delegations.js.map +0 -1
  998. package/dist/src/orchestrator/delegations.test.js.map +0 -1
  999. package/dist/src/orchestrator/error-utils.js.map +0 -1
  1000. package/dist/src/orchestrator/flow-resume.js.map +0 -1
  1001. package/dist/src/orchestrator/message-processor.js.map +0 -1
  1002. package/dist/src/orchestrator/message-seq.js.map +0 -1
  1003. package/dist/src/orchestrator/message-seq.test.js.map +0 -1
  1004. package/dist/src/orchestrator/orchestrator.js.map +0 -1
  1005. package/dist/src/orchestrator/pending-calls.js.map +0 -1
  1006. package/dist/src/orchestrator/pending-calls.test.js.map +0 -1
  1007. package/dist/src/orchestrator/prompts.js.map +0 -1
  1008. package/dist/src/orchestrator/provider-options-shape.js.map +0 -1
  1009. package/dist/src/orchestrator/provider-options-shape.spec.js.map +0 -1
  1010. package/dist/src/orchestrator/read-path-budget.js.map +0 -1
  1011. package/dist/src/orchestrator/reasoning.js.map +0 -1
  1012. package/dist/src/orchestrator/reasoning.test.js.map +0 -1
  1013. package/dist/src/orchestrator/retry-classifier.js.map +0 -1
  1014. package/dist/src/orchestrator/retry-stream.js.map +0 -1
  1015. package/dist/src/orchestrator/sandbox.test.js.map +0 -1
  1016. package/dist/src/orchestrator/stream-runner.js.map +0 -1
  1017. package/dist/src/orchestrator/sub-agent-cap.js.map +0 -1
  1018. package/dist/src/orchestrator/sub-agent-cap.test.js.map +0 -1
  1019. package/dist/src/orchestrator/subagent-compactor.js.map +0 -1
  1020. package/dist/src/orchestrator/subagent-compactor.spec.js.map +0 -1
  1021. package/dist/src/orchestrator/token-counter.js.map +0 -1
  1022. package/dist/src/orchestrator/token-counter.test.js.map +0 -1
  1023. package/dist/src/orchestrator/tool-utils.js.map +0 -1
  1024. package/dist/src/orchestrator/turn-runner-deps.js.map +0 -1
  1025. package/dist/src/pil/__tests__/budget.test.js.map +0 -1
  1026. package/dist/src/pil/__tests__/config.test.js.map +0 -1
  1027. package/dist/src/pil/__tests__/dual-run.test.js.map +0 -1
  1028. package/dist/src/pil/__tests__/layer1-intent-trace.test.js.map +0 -1
  1029. package/dist/src/pil/__tests__/layer1-intent.test.js.map +0 -1
  1030. package/dist/src/pil/__tests__/layer2-personality.test.js.map +0 -1
  1031. package/dist/src/pil/__tests__/layer3-ee-injection.test.js.map +0 -1
  1032. package/dist/src/pil/__tests__/layer3-injected-chunk.test.js.map +0 -1
  1033. package/dist/src/pil/__tests__/layer4-gsd.test.js.map +0 -1
  1034. package/dist/src/pil/__tests__/layer5-context.test.js.map +0 -1
  1035. package/dist/src/pil/__tests__/layer6-output.test.js.map +0 -1
  1036. package/dist/src/pil/__tests__/ollama-classify.test.js.map +0 -1
  1037. package/dist/src/pil/__tests__/orchestrator-integration.test.js.map +0 -1
  1038. package/dist/src/pil/__tests__/pipeline.test.js.map +0 -1
  1039. package/dist/src/pil/__tests__/renderer-coverage.test.js.map +0 -1
  1040. package/dist/src/pil/__tests__/response-tools.test.js.map +0 -1
  1041. package/dist/src/pil/__tests__/schema.test.js.map +0 -1
  1042. package/dist/src/pil/__tests__/scoreComplexity.test.js.map +0 -1
  1043. package/dist/src/pil/__tests__/scoreSufficiency.test.js.map +0 -1
  1044. package/dist/src/pil/__tests__/store.test.js.map +0 -1
  1045. package/dist/src/pil/__tests__/task-tier-map.test.js.map +0 -1
  1046. package/dist/src/pil/budget-log.js.map +0 -1
  1047. package/dist/src/pil/budget.js.map +0 -1
  1048. package/dist/src/pil/config.js.map +0 -1
  1049. package/dist/src/pil/index.js.map +0 -1
  1050. package/dist/src/pil/layer1-intent.js.map +0 -1
  1051. package/dist/src/pil/layer1-intent.test.js.map +0 -1
  1052. package/dist/src/pil/layer2-personality.js.map +0 -1
  1053. package/dist/src/pil/layer3-ee-injection.js.map +0 -1
  1054. package/dist/src/pil/layer4-gsd.js.map +0 -1
  1055. package/dist/src/pil/layer5-context.js.map +0 -1
  1056. package/dist/src/pil/layer6-output.js.map +0 -1
  1057. package/dist/src/pil/ollama-classify.js.map +0 -1
  1058. package/dist/src/pil/pipeline.js.map +0 -1
  1059. package/dist/src/pil/response-tools.js.map +0 -1
  1060. package/dist/src/pil/schema.js.map +0 -1
  1061. package/dist/src/pil/store.js.map +0 -1
  1062. package/dist/src/pil/task-tier-map.js.map +0 -1
  1063. package/dist/src/pil/timeout.js.map +0 -1
  1064. package/dist/src/pil/types.js.map +0 -1
  1065. package/dist/src/product-loop/__tests__/artifact-io.test.js.map +0 -1
  1066. package/dist/src/product-loop/__tests__/assumption-ledger.test.js.map +0 -1
  1067. package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.js.map +0 -1
  1068. package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.js.map +0 -1
  1069. package/dist/src/product-loop/__tests__/circuit-breakers.test.js.map +0 -1
  1070. package/dist/src/product-loop/__tests__/complexity-routing.spec.js.map +0 -1
  1071. package/dist/src/product-loop/__tests__/context-policy.test.js.map +0 -1
  1072. package/dist/src/product-loop/__tests__/cost-preview.test.js.map +0 -1
  1073. package/dist/src/product-loop/__tests__/cost-scoper.test.js.map +0 -1
  1074. package/dist/src/product-loop/__tests__/cross-run-memory.test.js.map +0 -1
  1075. package/dist/src/product-loop/__tests__/design-output.spec.js.map +0 -1
  1076. package/dist/src/product-loop/__tests__/discover.test.js.map +0 -1
  1077. package/dist/src/product-loop/__tests__/discovery-council-runner.test.js.map +0 -1
  1078. package/dist/src/product-loop/__tests__/discovery-detection.test.js.map +0 -1
  1079. package/dist/src/product-loop/__tests__/discovery-ecosystem.test.js.map +0 -1
  1080. package/dist/src/product-loop/__tests__/discovery-integration.test.js.map +0 -1
  1081. package/dist/src/product-loop/__tests__/discovery-interview.test.js.map +0 -1
  1082. package/dist/src/product-loop/__tests__/discovery-migrations.test.js.map +0 -1
  1083. package/dist/src/product-loop/__tests__/discovery-persistence.test.js.map +0 -1
  1084. package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.js.map +0 -1
  1085. package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.js.map +0 -1
  1086. package/dist/src/product-loop/__tests__/discovery-recommender.test.js.map +0 -1
  1087. package/dist/src/product-loop/__tests__/discovery-schema.test.js.map +0 -1
  1088. package/dist/src/product-loop/__tests__/done-gate-coverage.test.js.map +0 -1
  1089. package/dist/src/product-loop/__tests__/done-gate.test.js.map +0 -1
  1090. package/dist/src/product-loop/__tests__/ee-extract-wiring.test.js.map +0 -1
  1091. package/dist/src/product-loop/__tests__/extract-to-ee.test.js.map +0 -1
  1092. package/dist/src/product-loop/__tests__/feedback-routing.test.js.map +0 -1
  1093. package/dist/src/product-loop/__tests__/hot-path.spec.js.map +0 -1
  1094. package/dist/src/product-loop/__tests__/integration.test.js.map +0 -1
  1095. package/dist/src/product-loop/__tests__/loop-driver-audit.test.js.map +0 -1
  1096. package/dist/src/product-loop/__tests__/loop-driver.test.js.map +0 -1
  1097. package/dist/src/product-loop/__tests__/phase-budget.test.js.map +0 -1
  1098. package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.js.map +0 -1
  1099. package/dist/src/product-loop/__tests__/phase-plan.test.js.map +0 -1
  1100. package/dist/src/product-loop/__tests__/phase-rituals.test.js.map +0 -1
  1101. package/dist/src/product-loop/__tests__/phase-runner.test.js.map +0 -1
  1102. package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.js.map +0 -1
  1103. package/dist/src/product-loop/__tests__/product-identity.test.js.map +0 -1
  1104. package/dist/src/product-loop/__tests__/reality-anchor.test.js.map +0 -1
  1105. package/dist/src/product-loop/__tests__/repo-audit.test.js.map +0 -1
  1106. package/dist/src/product-loop/__tests__/role-memory.test.js.map +0 -1
  1107. package/dist/src/product-loop/__tests__/role-registry.test.js.map +0 -1
  1108. package/dist/src/product-loop/__tests__/role-routing-ee.test.js.map +0 -1
  1109. package/dist/src/product-loop/__tests__/route-decision-emit.test.js.map +0 -1
  1110. package/dist/src/product-loop/__tests__/seed-questions.test.js.map +0 -1
  1111. package/dist/src/product-loop/__tests__/ship-polish.test.js.map +0 -1
  1112. package/dist/src/product-loop/__tests__/sprint-runner-emit.test.js.map +0 -1
  1113. package/dist/src/product-loop/__tests__/sprint-runner.test.js.map +0 -1
  1114. package/dist/src/product-loop/__tests__/stakeholder-acl.test.js.map +0 -1
  1115. package/dist/src/product-loop/__tests__/state-md-ee-injections.test.js.map +0 -1
  1116. package/dist/src/product-loop/__tests__/sufficiency-routing.spec.js.map +0 -1
  1117. package/dist/src/product-loop/__tests__/typed-artifacts.test.js.map +0 -1
  1118. package/dist/src/product-loop/__tests__/types.test.js.map +0 -1
  1119. package/dist/src/product-loop/__tests__/verify-failure-threshold.test.js.map +0 -1
  1120. package/dist/src/product-loop/__tests__/verify-failure-tracking.test.js.map +0 -1
  1121. package/dist/src/product-loop/__tests__/verify-result.test.js.map +0 -1
  1122. package/dist/src/product-loop/artifact-io.js.map +0 -1
  1123. package/dist/src/product-loop/assumption-ledger.js.map +0 -1
  1124. package/dist/src/product-loop/circuit-breakers.js.map +0 -1
  1125. package/dist/src/product-loop/context-policy.js.map +0 -1
  1126. package/dist/src/product-loop/cost-preview.js.map +0 -1
  1127. package/dist/src/product-loop/cost-scoper.js.map +0 -1
  1128. package/dist/src/product-loop/cross-run-memory.js.map +0 -1
  1129. package/dist/src/product-loop/design-output.js.map +0 -1
  1130. package/dist/src/product-loop/discover.js.map +0 -1
  1131. package/dist/src/product-loop/discovery-context-format.js.map +0 -1
  1132. package/dist/src/product-loop/discovery-council-runner.js.map +0 -1
  1133. package/dist/src/product-loop/discovery-detection.js.map +0 -1
  1134. package/dist/src/product-loop/discovery-ecosystem.js.map +0 -1
  1135. package/dist/src/product-loop/discovery-interview.js.map +0 -1
  1136. package/dist/src/product-loop/discovery-migrations.js.map +0 -1
  1137. package/dist/src/product-loop/discovery-persistence.js.map +0 -1
  1138. package/dist/src/product-loop/discovery-prompt-parser.js.map +0 -1
  1139. package/dist/src/product-loop/discovery-recommender.js.map +0 -1
  1140. package/dist/src/product-loop/discovery-schema.js.map +0 -1
  1141. package/dist/src/product-loop/done-gate.js.map +0 -1
  1142. package/dist/src/product-loop/feedback-routing.js.map +0 -1
  1143. package/dist/src/product-loop/gather.js.map +0 -1
  1144. package/dist/src/product-loop/index.js.map +0 -1
  1145. package/dist/src/product-loop/loop-driver.js.map +0 -1
  1146. package/dist/src/product-loop/phase-budget.js.map +0 -1
  1147. package/dist/src/product-loop/phase-plan.js.map +0 -1
  1148. package/dist/src/product-loop/phase-rituals.js.map +0 -1
  1149. package/dist/src/product-loop/phase-runner.js.map +0 -1
  1150. package/dist/src/product-loop/phase-tracker-bridge.js.map +0 -1
  1151. package/dist/src/product-loop/product-identity.js.map +0 -1
  1152. package/dist/src/product-loop/reality-anchor.js.map +0 -1
  1153. package/dist/src/product-loop/repo-audit.js.map +0 -1
  1154. package/dist/src/product-loop/role-memory.js.map +0 -1
  1155. package/dist/src/product-loop/role-registry.js.map +0 -1
  1156. package/dist/src/product-loop/seed-questions.js.map +0 -1
  1157. package/dist/src/product-loop/ship-polish.js.map +0 -1
  1158. package/dist/src/product-loop/sprint-runner.js.map +0 -1
  1159. package/dist/src/product-loop/stakeholder-acl.js.map +0 -1
  1160. package/dist/src/product-loop/typed-artifacts.js.map +0 -1
  1161. package/dist/src/product-loop/types.js.map +0 -1
  1162. package/dist/src/product-loop/verify-failure-tracking.js.map +0 -1
  1163. package/dist/src/product-loop/verify-result.js.map +0 -1
  1164. package/dist/src/providers/__test-utils__/load-fixture.js.map +0 -1
  1165. package/dist/src/providers/__tests__/adapter-oauth-wiring.test.js.map +0 -1
  1166. package/dist/src/providers/__tests__/capabilities-cosmetic.test.js.map +0 -1
  1167. package/dist/src/providers/__tests__/capabilities-flags.test.js.map +0 -1
  1168. package/dist/src/providers/__tests__/capabilities-provider-options.test.js.map +0 -1
  1169. package/dist/src/providers/__tests__/capabilities-sanitize.test.js.map +0 -1
  1170. package/dist/src/providers/__tests__/capabilities.test.js.map +0 -1
  1171. package/dist/src/providers/__tests__/provider-coverage.test.js.map +0 -1
  1172. package/dist/src/providers/__tests__/runtime-integration.test.js.map +0 -1
  1173. package/dist/src/providers/__tests__/runtime.test.js.map +0 -1
  1174. package/dist/src/providers/__tests__/siliconflow-history.test.js +0 -76
  1175. package/dist/src/providers/__tests__/siliconflow-history.test.js.map +0 -1
  1176. package/dist/src/providers/__tests__/strategies-registry.test.js.map +0 -1
  1177. package/dist/src/providers/__tests__/strategies-resolve.test.js.map +0 -1
  1178. package/dist/src/providers/__tests__/wire-debug.test.js.map +0 -1
  1179. package/dist/src/providers/adapter.js.map +0 -1
  1180. package/dist/src/providers/adapter.test.js.map +0 -1
  1181. package/dist/src/providers/anthropic.js.map +0 -1
  1182. package/dist/src/providers/auth/__tests__/browser-flow.test.js.map +0 -1
  1183. package/dist/src/providers/auth/__tests__/device-flow.test.js.map +0 -1
  1184. package/dist/src/providers/auth/__tests__/gemini-oauth.test.js.map +0 -1
  1185. package/dist/src/providers/auth/__tests__/openai-oauth.test.js.map +0 -1
  1186. package/dist/src/providers/auth/__tests__/token-store.test.js.map +0 -1
  1187. package/dist/src/providers/auth/browser-flow.js.map +0 -1
  1188. package/dist/src/providers/auth/device-flow.js.map +0 -1
  1189. package/dist/src/providers/auth/gemini-oauth.js.map +0 -1
  1190. package/dist/src/providers/auth/openai-oauth.js.map +0 -1
  1191. package/dist/src/providers/auth/registry.js.map +0 -1
  1192. package/dist/src/providers/auth/token-store.js.map +0 -1
  1193. package/dist/src/providers/auth/types.js.map +0 -1
  1194. package/dist/src/providers/capabilities.js.map +0 -1
  1195. package/dist/src/providers/endpoints.js.map +0 -1
  1196. package/dist/src/providers/errors.js.map +0 -1
  1197. package/dist/src/providers/errors.test.js.map +0 -1
  1198. package/dist/src/providers/gemini.js.map +0 -1
  1199. package/dist/src/providers/gemini.test.js.map +0 -1
  1200. package/dist/src/providers/index.js.map +0 -1
  1201. package/dist/src/providers/keychain.js.map +0 -1
  1202. package/dist/src/providers/keychain.test.js.map +0 -1
  1203. package/dist/src/providers/mcp-vision-bridge.js.map +0 -1
  1204. package/dist/src/providers/mcp-vision-bridge.test.js.map +0 -1
  1205. package/dist/src/providers/ollama.js.map +0 -1
  1206. package/dist/src/providers/ollama.test.js.map +0 -1
  1207. package/dist/src/providers/openai-compatible.js.map +0 -1
  1208. package/dist/src/providers/openai-compatible.test.js.map +0 -1
  1209. package/dist/src/providers/openai.js.map +0 -1
  1210. package/dist/src/providers/openai.test.js.map +0 -1
  1211. package/dist/src/providers/patch-zod-schema.js.map +0 -1
  1212. package/dist/src/providers/pricing.js.map +0 -1
  1213. package/dist/src/providers/pricing.test.js.map +0 -1
  1214. package/dist/src/providers/prompt-cache-key.spec.js.map +0 -1
  1215. package/dist/src/providers/runtime-mock.spec.js.map +0 -1
  1216. package/dist/src/providers/runtime.js.map +0 -1
  1217. package/dist/src/providers/siliconflow-history.d.ts +0 -50
  1218. package/dist/src/providers/siliconflow-history.js +0 -64
  1219. package/dist/src/providers/siliconflow-history.js.map +0 -1
  1220. package/dist/src/providers/strategies/anthropic.strategy.js.map +0 -1
  1221. package/dist/src/providers/strategies/base.strategy.js.map +0 -1
  1222. package/dist/src/providers/strategies/deepseek.strategy.js.map +0 -1
  1223. package/dist/src/providers/strategies/google.strategy.js.map +0 -1
  1224. package/dist/src/providers/strategies/ollama.strategy.js.map +0 -1
  1225. package/dist/src/providers/strategies/openai.strategy.js.map +0 -1
  1226. package/dist/src/providers/strategies/registry.js.map +0 -1
  1227. package/dist/src/providers/strategies/siliconflow.strategy.js.map +0 -1
  1228. package/dist/src/providers/strategies/xai.strategy.js.map +0 -1
  1229. package/dist/src/providers/stream-loop.js.map +0 -1
  1230. package/dist/src/providers/types.js.map +0 -1
  1231. package/dist/src/providers/vision-proxy.js.map +0 -1
  1232. package/dist/src/providers/vision-proxy.test.js.map +0 -1
  1233. package/dist/src/providers/wire-debug.js.map +0 -1
  1234. package/dist/src/router/__tests__/step-router.test.js.map +0 -1
  1235. package/dist/src/router/classifier/grammars.js.map +0 -1
  1236. package/dist/src/router/classifier/index.js.map +0 -1
  1237. package/dist/src/router/classifier/index.test.js.map +0 -1
  1238. package/dist/src/router/classifier/regex.js.map +0 -1
  1239. package/dist/src/router/classifier/regex.test.js.map +0 -1
  1240. package/dist/src/router/classifier/tree-sitter.js.map +0 -1
  1241. package/dist/src/router/classifier/tree-sitter.test.js.map +0 -1
  1242. package/dist/src/router/cold.js.map +0 -1
  1243. package/dist/src/router/cold.test.js.map +0 -1
  1244. package/dist/src/router/decide.js.map +0 -1
  1245. package/dist/src/router/decide.test.js.map +0 -1
  1246. package/dist/src/router/health.js.map +0 -1
  1247. package/dist/src/router/health.test.js.map +0 -1
  1248. package/dist/src/router/provider-sentinel.js.map +0 -1
  1249. package/dist/src/router/provider-sentinel.test.js.map +0 -1
  1250. package/dist/src/router/step-router.js.map +0 -1
  1251. package/dist/src/router/store.js.map +0 -1
  1252. package/dist/src/router/types.js.map +0 -1
  1253. package/dist/src/router/warm.js.map +0 -1
  1254. package/dist/src/router/warm.test.js.map +0 -1
  1255. package/dist/src/scaffold/__tests__/continuation-prompt.test.js.map +0 -1
  1256. package/dist/src/scaffold/__tests__/continue-as-council.spec.js.map +0 -1
  1257. package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.js.map +0 -1
  1258. package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.js.map +0 -1
  1259. package/dist/src/scaffold/__tests__/init-new.smoke.spec.js.map +0 -1
  1260. package/dist/src/scaffold/__tests__/init-new.spec.js.map +0 -1
  1261. package/dist/src/scaffold/__tests__/install-bb-templates.spec.js.map +0 -1
  1262. package/dist/src/scaffold/__tests__/point-to-existing.spec.js.map +0 -1
  1263. package/dist/src/scaffold/bb-ecosystem-apply.js.map +0 -1
  1264. package/dist/src/scaffold/bb-quality-gate.js.map +0 -1
  1265. package/dist/src/scaffold/continuation-prompt.js.map +0 -1
  1266. package/dist/src/scaffold/continue-as-council.js.map +0 -1
  1267. package/dist/src/scaffold/init-new.js.map +0 -1
  1268. package/dist/src/scaffold/point-to-existing.js.map +0 -1
  1269. package/dist/src/scaffold/resume-from-gate-failures.js.map +0 -1
  1270. package/dist/src/storage/__tests__/migrations.test.js.map +0 -1
  1271. package/dist/src/storage/__tests__/ui-interaction-log.test.js.map +0 -1
  1272. package/dist/src/storage/atomic-io.js.map +0 -1
  1273. package/dist/src/storage/atomic-io.test.js.map +0 -1
  1274. package/dist/src/storage/config.js.map +0 -1
  1275. package/dist/src/storage/config.test.js.map +0 -1
  1276. package/dist/src/storage/db.js.map +0 -1
  1277. package/dist/src/storage/index.js.map +0 -1
  1278. package/dist/src/storage/interaction-log.js.map +0 -1
  1279. package/dist/src/storage/migrations.js.map +0 -1
  1280. package/dist/src/storage/session-dir.js.map +0 -1
  1281. package/dist/src/storage/sessions.js.map +0 -1
  1282. package/dist/src/storage/tool-results.js.map +0 -1
  1283. package/dist/src/storage/transcript-view.js.map +0 -1
  1284. package/dist/src/storage/transcript.js.map +0 -1
  1285. package/dist/src/storage/transcript.test.js.map +0 -1
  1286. package/dist/src/storage/ui-interaction-log.js.map +0 -1
  1287. package/dist/src/storage/usage-cap.js.map +0 -1
  1288. package/dist/src/storage/usage-cap.test.js.map +0 -1
  1289. package/dist/src/storage/usage.js.map +0 -1
  1290. package/dist/src/storage/workspaces.js.map +0 -1
  1291. package/dist/src/tools/bash.js.map +0 -1
  1292. package/dist/src/tools/bash.test.js.map +0 -1
  1293. package/dist/src/tools/computer.js.map +0 -1
  1294. package/dist/src/tools/computer.test.js.map +0 -1
  1295. package/dist/src/tools/file-tracker.js.map +0 -1
  1296. package/dist/src/tools/file-tracker.test.js.map +0 -1
  1297. package/dist/src/tools/file.js.map +0 -1
  1298. package/dist/src/tools/file.test.js.map +0 -1
  1299. package/dist/src/tools/grep.js.map +0 -1
  1300. package/dist/src/tools/registry.js.map +0 -1
  1301. package/dist/src/tools/registry.test.js.map +0 -1
  1302. package/dist/src/tools/schedule.js.map +0 -1
  1303. package/dist/src/tools/schedule.test.js.map +0 -1
  1304. package/dist/src/types/index.js.map +0 -1
  1305. package/dist/src/ui/agents-modal.js.map +0 -1
  1306. package/dist/src/ui/app.js.map +0 -1
  1307. package/dist/src/ui/cards/__tests__/product-status-card.test.js.map +0 -1
  1308. package/dist/src/ui/cards/product-status-card.js.map +0 -1
  1309. package/dist/src/ui/components/SuggestionOverlay.js.map +0 -1
  1310. package/dist/src/ui/components/Toast.js.map +0 -1
  1311. package/dist/src/ui/components/__tests__/council-leader-bubble.test.js.map +0 -1
  1312. package/dist/src/ui/components/__tests__/council-message-bubble.test.js.map +0 -1
  1313. package/dist/src/ui/components/__tests__/council-phase-timeline.test.js.map +0 -1
  1314. package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.js.map +0 -1
  1315. package/dist/src/ui/components/__tests__/council-question-card.test.js.map +0 -1
  1316. package/dist/src/ui/components/__tests__/council-synthesis-banner.test.js.map +0 -1
  1317. package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.js.map +0 -1
  1318. package/dist/src/ui/components/btw-overlay.js.map +0 -1
  1319. package/dist/src/ui/components/bubble-layout.js.map +0 -1
  1320. package/dist/src/ui/components/code-block-truncate.js.map +0 -1
  1321. package/dist/src/ui/components/copy-flash-banner.js.map +0 -1
  1322. package/dist/src/ui/components/council-info-card.js.map +0 -1
  1323. package/dist/src/ui/components/council-leader-bubble.js.map +0 -1
  1324. package/dist/src/ui/components/council-message-bubble.js.map +0 -1
  1325. package/dist/src/ui/components/council-phase-timeline.js.map +0 -1
  1326. package/dist/src/ui/components/council-placeholder-bubble.js.map +0 -1
  1327. package/dist/src/ui/components/council-question-card.js.map +0 -1
  1328. package/dist/src/ui/components/council-status-list.js.map +0 -1
  1329. package/dist/src/ui/components/council-synthesis-banner.js.map +0 -1
  1330. package/dist/src/ui/components/diff-view.js.map +0 -1
  1331. package/dist/src/ui/components/halt-recovery-card.js.map +0 -1
  1332. package/dist/src/ui/components/hero-logo.js.map +0 -1
  1333. package/dist/src/ui/components/init-new-form-card.js.map +0 -1
  1334. package/dist/src/ui/components/lsp-views.js.map +0 -1
  1335. package/dist/src/ui/components/media-views.js.map +0 -1
  1336. package/dist/src/ui/components/message-view.js.map +0 -1
  1337. package/dist/src/ui/components/point-to-existing-form-card.js.map +0 -1
  1338. package/dist/src/ui/components/prompt-box.js.map +0 -1
  1339. package/dist/src/ui/components/role-palette.js.map +0 -1
  1340. package/dist/src/ui/components/session-header.js.map +0 -1
  1341. package/dist/src/ui/components/slash-inline-menu.js.map +0 -1
  1342. package/dist/src/ui/components/structured-response-view.js.map +0 -1
  1343. package/dist/src/ui/components/tool-result-views.js.map +0 -1
  1344. package/dist/src/ui/components/use-pair-quote-buffer.js.map +0 -1
  1345. package/dist/src/ui/constants.js.map +0 -1
  1346. package/dist/src/ui/hooks/use-agent-editor.js.map +0 -1
  1347. package/dist/src/ui/hooks/use-mcp-editor.js.map +0 -1
  1348. package/dist/src/ui/hooks/use-model-picker.js.map +0 -1
  1349. package/dist/src/ui/hooks/useTypeahead.js.map +0 -1
  1350. package/dist/src/ui/markdown.js.map +0 -1
  1351. package/dist/src/ui/mcp-modal-types.js.map +0 -1
  1352. package/dist/src/ui/mcp-modal.js.map +0 -1
  1353. package/dist/src/ui/modals/api-key-modal.js.map +0 -1
  1354. package/dist/src/ui/modals/connect-modal.js.map +0 -1
  1355. package/dist/src/ui/modals/model-picker-modal.js.map +0 -1
  1356. package/dist/src/ui/modals/sandbox-picker-modal.js.map +0 -1
  1357. package/dist/src/ui/modals/update-modal.js.map +0 -1
  1358. package/dist/src/ui/modals/wallet-picker-modal.js.map +0 -1
  1359. package/dist/src/ui/plan.js.map +0 -1
  1360. package/dist/src/ui/schedule-modal.js.map +0 -1
  1361. package/dist/src/ui/slash/__tests__/clear.test.js.map +0 -1
  1362. package/dist/src/ui/slash/__tests__/compact.test.js.map +0 -1
  1363. package/dist/src/ui/slash/__tests__/cost.test.js.map +0 -1
  1364. package/dist/src/ui/slash/__tests__/discuss.test.js.map +0 -1
  1365. package/dist/src/ui/slash/__tests__/execute.test.js.map +0 -1
  1366. package/dist/src/ui/slash/__tests__/expand.test.js.map +0 -1
  1367. package/dist/src/ui/slash/__tests__/ideal.test.js.map +0 -1
  1368. package/dist/src/ui/slash/__tests__/menu-parity.test.js.map +0 -1
  1369. package/dist/src/ui/slash/__tests__/optimize.test.js.map +0 -1
  1370. package/dist/src/ui/slash/__tests__/pin.test.js.map +0 -1
  1371. package/dist/src/ui/slash/__tests__/plan.test.js.map +0 -1
  1372. package/dist/src/ui/slash/clear.js.map +0 -1
  1373. package/dist/src/ui/slash/compact.js.map +0 -1
  1374. package/dist/src/ui/slash/cost.js.map +0 -1
  1375. package/dist/src/ui/slash/council-inspect.js.map +0 -1
  1376. package/dist/src/ui/slash/council.js.map +0 -1
  1377. package/dist/src/ui/slash/debug.js.map +0 -1
  1378. package/dist/src/ui/slash/discuss.js.map +0 -1
  1379. package/dist/src/ui/slash/ee.js.map +0 -1
  1380. package/dist/src/ui/slash/execute.js.map +0 -1
  1381. package/dist/src/ui/slash/expand.js.map +0 -1
  1382. package/dist/src/ui/slash/export.js.map +0 -1
  1383. package/dist/src/ui/slash/ideal.js.map +0 -1
  1384. package/dist/src/ui/slash/menu-items.js.map +0 -1
  1385. package/dist/src/ui/slash/optimize.js.map +0 -1
  1386. package/dist/src/ui/slash/pin.js.map +0 -1
  1387. package/dist/src/ui/slash/plan.js.map +0 -1
  1388. package/dist/src/ui/slash/registry.js.map +0 -1
  1389. package/dist/src/ui/slash/route.js.map +0 -1
  1390. package/dist/src/ui/slash/route.test.js.map +0 -1
  1391. package/dist/src/ui/status-bar/index.js.map +0 -1
  1392. package/dist/src/ui/status-bar/index.test.js.map +0 -1
  1393. package/dist/src/ui/status-bar/store.js.map +0 -1
  1394. package/dist/src/ui/status-bar/store.test.js.map +0 -1
  1395. package/dist/src/ui/status-bar/tier-badge.js.map +0 -1
  1396. package/dist/src/ui/status-bar/tier-badge.test.js.map +0 -1
  1397. package/dist/src/ui/status-bar/usd-meter.js.map +0 -1
  1398. package/dist/src/ui/status-bar/usd-meter.test.js.map +0 -1
  1399. package/dist/src/ui/syntax-highlight.js.map +0 -1
  1400. package/dist/src/ui/terminal-selection-text.js.map +0 -1
  1401. package/dist/src/ui/theme.js.map +0 -1
  1402. package/dist/src/ui/types.js.map +0 -1
  1403. package/dist/src/ui/utils/color.js.map +0 -1
  1404. package/dist/src/ui/utils/format.js.map +0 -1
  1405. package/dist/src/ui/utils/modal.js.map +0 -1
  1406. package/dist/src/ui/utils/text.js.map +0 -1
  1407. package/dist/src/ui/utils/tools.js.map +0 -1
  1408. package/dist/src/usage/__tests__/product-ledger.test.js.map +0 -1
  1409. package/dist/src/usage/cost-log.js.map +0 -1
  1410. package/dist/src/usage/decision-log.js.map +0 -1
  1411. package/dist/src/usage/downgrade.js.map +0 -1
  1412. package/dist/src/usage/downgrade.test.js.map +0 -1
  1413. package/dist/src/usage/estimator.js.map +0 -1
  1414. package/dist/src/usage/estimator.test.js.map +0 -1
  1415. package/dist/src/usage/ledger.js.map +0 -1
  1416. package/dist/src/usage/ledger.test.js.map +0 -1
  1417. package/dist/src/usage/midstream.js.map +0 -1
  1418. package/dist/src/usage/midstream.test.js.map +0 -1
  1419. package/dist/src/usage/product-ledger.js.map +0 -1
  1420. package/dist/src/usage/thresholds.js.map +0 -1
  1421. package/dist/src/usage/thresholds.test.js.map +0 -1
  1422. package/dist/src/usage/types.js.map +0 -1
  1423. package/dist/src/utils/__tests__/auto-council-settings.test.js.map +0 -1
  1424. package/dist/src/utils/__tests__/ee-logger.test.js.map +0 -1
  1425. package/dist/src/utils/__tests__/file-lock.test.js.map +0 -1
  1426. package/dist/src/utils/__tests__/rate-limit.test.js.map +0 -1
  1427. package/dist/src/utils/__tests__/settings-disabled-models.test.js.map +0 -1
  1428. package/dist/src/utils/__tests__/settings-web-research.test.js.map +0 -1
  1429. package/dist/src/utils/__tests__/slugify.test.js.map +0 -1
  1430. package/dist/src/utils/__tests__/visible-retry.test.js.map +0 -1
  1431. package/dist/src/utils/at-mentions.js.map +0 -1
  1432. package/dist/src/utils/clipboard-image.js.map +0 -1
  1433. package/dist/src/utils/ee-logger.js.map +0 -1
  1434. package/dist/src/utils/file-index.js.map +0 -1
  1435. package/dist/src/utils/file-lock.js.map +0 -1
  1436. package/dist/src/utils/git-root.js.map +0 -1
  1437. package/dist/src/utils/host-clipboard.js.map +0 -1
  1438. package/dist/src/utils/install-manager.js.map +0 -1
  1439. package/dist/src/utils/install-manager.test.js.map +0 -1
  1440. package/dist/src/utils/instructions.js.map +0 -1
  1441. package/dist/src/utils/instructions.test.js.map +0 -1
  1442. package/dist/src/utils/permission-mode.js.map +0 -1
  1443. package/dist/src/utils/permission-mode.test.js.map +0 -1
  1444. package/dist/src/utils/rate-limit.js.map +0 -1
  1445. package/dist/src/utils/redactor.js.map +0 -1
  1446. package/dist/src/utils/redactor.test.js.map +0 -1
  1447. package/dist/src/utils/settings.js.map +0 -1
  1448. package/dist/src/utils/settings.test.js.map +0 -1
  1449. package/dist/src/utils/shell.js.map +0 -1
  1450. package/dist/src/utils/shell.test.js.map +0 -1
  1451. package/dist/src/utils/side-question.js.map +0 -1
  1452. package/dist/src/utils/skills.js.map +0 -1
  1453. package/dist/src/utils/skills.test.js.map +0 -1
  1454. package/dist/src/utils/slugify.js.map +0 -1
  1455. package/dist/src/utils/subagent-display.js.map +0 -1
  1456. package/dist/src/utils/subagent-display.test.js.map +0 -1
  1457. package/dist/src/utils/subagents-settings.test.js.map +0 -1
  1458. package/dist/src/utils/telegram-audio-settings.test.js.map +0 -1
  1459. package/dist/src/utils/update-checker.js.map +0 -1
  1460. package/dist/src/utils/update-checker.test.js.map +0 -1
  1461. package/dist/src/utils/visible-retry.js.map +0 -1
  1462. package/dist/src/verify/__tests__/coverage-parsers.test.js.map +0 -1
  1463. package/dist/src/verify/__tests__/dotnet-recipe.test.js.map +0 -1
  1464. package/dist/src/verify/checkpoint.js.map +0 -1
  1465. package/dist/src/verify/checkpoint.test.js.map +0 -1
  1466. package/dist/src/verify/coverage-parsers.js.map +0 -1
  1467. package/dist/src/verify/entrypoint.js.map +0 -1
  1468. package/dist/src/verify/entrypoint.test.js.map +0 -1
  1469. package/dist/src/verify/environment.js.map +0 -1
  1470. package/dist/src/verify/environment.test.js.map +0 -1
  1471. package/dist/src/verify/evidence.js.map +0 -1
  1472. package/dist/src/verify/orchestrator.js.map +0 -1
  1473. package/dist/src/verify/orchestrator.test.js.map +0 -1
  1474. package/dist/src/verify/recipes.js.map +0 -1
  1475. package/dist/src/verify/retry.js.map +0 -1
  1476. package/dist/src/verify/runtime-prep.test.js.map +0 -1
  1477. package/src/__test-stubs__/ee-server.ts +0 -173
  1478. package/src/__test-stubs__/vitest-setup.ts +0 -36
  1479. package/src/__tests__/council/bubble-layout.test.ts +0 -45
  1480. package/src/__tests__/council/code-block-truncate.test.ts +0 -50
  1481. package/src/__tests__/council/role-palette.test.ts +0 -66
  1482. package/src/__tests__/first-run-wizard.test.ts +0 -9
  1483. package/src/agent-harness/__tests__/cli-flags.spec.ts +0 -35
  1484. package/src/agent-harness/__tests__/driver.spec.ts +0 -154
  1485. package/src/agent-harness/__tests__/idle.spec.ts +0 -90
  1486. package/src/agent-harness/__tests__/mock-llm.spec.ts +0 -126
  1487. package/src/agent-harness/__tests__/mock-model.spec.ts +0 -195
  1488. package/src/agent-harness/__tests__/predicate.spec.ts +0 -33
  1489. package/src/agent-harness/__tests__/protocol.spec.ts +0 -62
  1490. package/src/agent-harness/__tests__/schema.spec.ts +0 -81
  1491. package/src/agent-harness/__tests__/selector.spec.ts +0 -82
  1492. package/src/agent-harness/__tests__/sidechannel.spec.ts +0 -40
  1493. package/src/agent-harness/__tests__/spec-helpers.spec.ts +0 -76
  1494. package/src/agent-harness/index.ts +0 -24
  1495. package/src/agent-harness/mock-model.ts +0 -394
  1496. package/src/agent-harness/test-spawn.ts +0 -200
  1497. package/src/billing/index.ts +0 -5
  1498. package/src/bun-sqlite.d.ts +0 -15
  1499. package/src/chat/__tests__/broadcast-bus.test.ts +0 -90
  1500. package/src/chat/__tests__/channel-manager.test.ts +0 -149
  1501. package/src/chat/__tests__/client.test.ts +0 -118
  1502. package/src/chat/__tests__/discord-integration.test.ts +0 -162
  1503. package/src/chat/__tests__/intent-prompt.test.ts +0 -92
  1504. package/src/chat/__tests__/verdict-resolver.test.ts +0 -336
  1505. package/src/chat/broadcast-bus.ts +0 -53
  1506. package/src/chat/channel-manager.ts +0 -146
  1507. package/src/chat/chat-keychain.ts +0 -129
  1508. package/src/chat/factory.ts +0 -37
  1509. package/src/chat/intent-prompt.ts +0 -72
  1510. package/src/chat/providers/discord/client.ts +0 -91
  1511. package/src/chat/types.ts +0 -42
  1512. package/src/chat/verdict-constants.ts +0 -26
  1513. package/src/chat/verdict-resolver.ts +0 -231
  1514. package/src/cli/__tests__/bw-vault.test.ts +0 -97
  1515. package/src/cli/__tests__/keys-bundle.test.ts +0 -46
  1516. package/src/cli/__tests__/share-cmd.test.ts +0 -197
  1517. package/src/cli/bw-vault.ts +0 -184
  1518. package/src/cli/config/__tests__/model-picker.test.ts +0 -59
  1519. package/src/cli/config/__tests__/provider-fetch.test.ts +0 -38
  1520. package/src/cli/config/index.ts +0 -112
  1521. package/src/cli/config/model-picker.ts +0 -193
  1522. package/src/cli/config/provider-fetch.ts +0 -75
  1523. package/src/cli/config/screen-council.ts +0 -245
  1524. package/src/cli/config/screen-models.ts +0 -104
  1525. package/src/cli/config/screen-providers.ts +0 -197
  1526. package/src/cli/config/tui.ts +0 -153
  1527. package/src/cli/cost-forensics.test.ts +0 -128
  1528. package/src/cli/cost-forensics.ts +0 -264
  1529. package/src/cli/keys-bundle.ts +0 -91
  1530. package/src/cli/keys.test.ts +0 -104
  1531. package/src/cli/keys.ts +0 -787
  1532. package/src/cli/pil-report.ts +0 -202
  1533. package/src/cli/share-cmd.ts +0 -132
  1534. package/src/cli/usage-report.ts +0 -266
  1535. package/src/cloud/index.ts +0 -5
  1536. package/src/council/__tests__/accounting.test.ts +0 -72
  1537. package/src/council/__tests__/audit-replay.test.ts +0 -344
  1538. package/src/council/__tests__/clarifier-max-rounds.test.ts +0 -91
  1539. package/src/council/__tests__/clarifier-options.test.ts +0 -63
  1540. package/src/council/__tests__/cost-aware.test.ts +0 -60
  1541. package/src/council/__tests__/debate-planner-structured.test.ts +0 -236
  1542. package/src/council/__tests__/evaluator-metrics.test.ts +0 -513
  1543. package/src/council/__tests__/parse-outcome-fallback.test.ts +0 -125
  1544. package/src/council/__tests__/research-tools.test.ts +0 -239
  1545. package/src/council/__tests__/round-tools.test.ts +0 -334
  1546. package/src/council/__tests__/tool-trace.test.ts +0 -152
  1547. package/src/council/__tests__/types-contract.test.ts +0 -88
  1548. package/src/council/clarifier.ts +0 -409
  1549. package/src/council/context.ts +0 -250
  1550. package/src/council/debate-planner.ts +0 -264
  1551. package/src/council/debate.ts +0 -1179
  1552. package/src/council/executor.ts +0 -27
  1553. package/src/council/index.ts +0 -916
  1554. package/src/council/leader.ts +0 -262
  1555. package/src/council/llm.ts +0 -967
  1556. package/src/council/phase-events.ts +0 -58
  1557. package/src/council/planner.ts +0 -303
  1558. package/src/council/preflight.ts +0 -86
  1559. package/src/council/prompts.ts +0 -600
  1560. package/src/council/types.ts +0 -286
  1561. package/src/daemon/scheduler.test.ts +0 -128
  1562. package/src/daemon/scheduler.ts +0 -152
  1563. package/src/ee/.gitkeep +0 -0
  1564. package/src/ee/__tests__/bb-design.test.ts +0 -223
  1565. package/src/ee/__tests__/pil-context-bridge.test.ts +0 -59
  1566. package/src/ee/__tests__/pipeline.integration.test.ts +0 -193
  1567. package/src/ee/__tests__/render-sink-wiring.test.ts +0 -89
  1568. package/src/ee/auth.test.ts +0 -76
  1569. package/src/ee/auth.ts +0 -80
  1570. package/src/ee/bb-design.ts +0 -284
  1571. package/src/ee/bb-retrieval.ts +0 -467
  1572. package/src/ee/bridge.test.ts +0 -283
  1573. package/src/ee/bridge.ts +0 -443
  1574. package/src/ee/client-mode.ts +0 -161
  1575. package/src/ee/client.test.ts +0 -171
  1576. package/src/ee/client.ts +0 -620
  1577. package/src/ee/council-bridge.ts +0 -89
  1578. package/src/ee/embedding-cache.ts +0 -42
  1579. package/src/ee/extract-session.test.ts +0 -231
  1580. package/src/ee/extract-session.ts +0 -71
  1581. package/src/ee/health.ts +0 -83
  1582. package/src/ee/index.ts +0 -33
  1583. package/src/ee/intercept.test.ts +0 -197
  1584. package/src/ee/intercept.ts +0 -143
  1585. package/src/ee/judge.test.ts +0 -213
  1586. package/src/ee/judge.ts +0 -126
  1587. package/src/ee/mistake-detector.test.ts +0 -252
  1588. package/src/ee/mistake-detector.ts +0 -297
  1589. package/src/ee/offline-queue.test.ts +0 -302
  1590. package/src/ee/offline-queue.ts +0 -205
  1591. package/src/ee/phase-outcome.test.ts +0 -107
  1592. package/src/ee/phase-outcome.ts +0 -165
  1593. package/src/ee/phase-tracker.test.ts +0 -175
  1594. package/src/ee/phase-tracker.ts +0 -180
  1595. package/src/ee/posttool.test.ts +0 -81
  1596. package/src/ee/posttool.ts +0 -16
  1597. package/src/ee/prompt-stale.test.ts +0 -92
  1598. package/src/ee/prompt-stale.ts +0 -39
  1599. package/src/ee/render.test.ts +0 -74
  1600. package/src/ee/render.ts +0 -68
  1601. package/src/ee/scope.test.ts +0 -112
  1602. package/src/ee/scope.ts +0 -93
  1603. package/src/ee/session-trajectory.test.ts +0 -139
  1604. package/src/ee/session-trajectory.ts +0 -226
  1605. package/src/ee/tenant.ts +0 -14
  1606. package/src/ee/touch.test.ts +0 -73
  1607. package/src/ee/types.ts +0 -387
  1608. package/src/flow/.gitkeep +0 -0
  1609. package/src/flow/__tests__/migration.test.ts +0 -133
  1610. package/src/flow/__tests__/parser.test.ts +0 -77
  1611. package/src/flow/__tests__/run-manager-product.test.ts +0 -59
  1612. package/src/flow/__tests__/run-manager.test.ts +0 -95
  1613. package/src/flow/__tests__/scaffold-checkpoint.test.ts +0 -113
  1614. package/src/flow/__tests__/scaffold.test.ts +0 -57
  1615. package/src/flow/__tests__/warning-persist.test.ts +0 -112
  1616. package/src/flow/artifact-io.ts +0 -41
  1617. package/src/flow/compaction/__tests__/compress.test.ts +0 -69
  1618. package/src/flow/compaction/__tests__/extract.test.ts +0 -74
  1619. package/src/flow/compaction/__tests__/preserve.test.ts +0 -69
  1620. package/src/flow/compaction/compress.ts +0 -67
  1621. package/src/flow/compaction/extract.ts +0 -60
  1622. package/src/flow/compaction/index.ts +0 -86
  1623. package/src/flow/compaction/preserve.ts +0 -48
  1624. package/src/flow/index.ts +0 -18
  1625. package/src/flow/migration.ts +0 -139
  1626. package/src/flow/parser.ts +0 -78
  1627. package/src/flow/run-manager.ts +0 -162
  1628. package/src/flow/scaffold-checkpoint.ts +0 -132
  1629. package/src/flow/scaffold.ts +0 -52
  1630. package/src/flow/warning-persist.ts +0 -84
  1631. package/src/generated/version.ts +0 -4
  1632. package/src/gsd/.gitkeep +0 -0
  1633. package/src/gsd/__tests__/complexity.test.ts +0 -0
  1634. package/src/gsd/__tests__/directives.test.ts +0 -49
  1635. package/src/gsd/__tests__/gray-areas.test.ts +0 -33
  1636. package/src/gsd/__tests__/types.test.ts +0 -77
  1637. package/src/gsd/complexity.ts +0 -124
  1638. package/src/gsd/directives.ts +0 -94
  1639. package/src/gsd/gray-areas.ts +0 -144
  1640. package/src/gsd/index.ts +0 -1
  1641. package/src/gsd/types.ts +0 -49
  1642. package/src/headless/__tests__/council-answers.test.ts +0 -266
  1643. package/src/headless/council-answers.ts +0 -130
  1644. package/src/headless/output.test.ts +0 -201
  1645. package/src/headless/output.ts +0 -312
  1646. package/src/hooks/config.ts +0 -41
  1647. package/src/hooks/index.ts +0 -547
  1648. package/src/hooks/types.ts +0 -263
  1649. package/src/index.ts +0 -1570
  1650. package/src/lsp/builtins.test.ts +0 -104
  1651. package/src/lsp/builtins.ts +0 -409
  1652. package/src/lsp/client.ts +0 -342
  1653. package/src/lsp/manager.test.ts +0 -164
  1654. package/src/lsp/manager.ts +0 -293
  1655. package/src/lsp/npm-cache.test.ts +0 -68
  1656. package/src/lsp/npm-cache.ts +0 -108
  1657. package/src/lsp/runtime.ts +0 -70
  1658. package/src/lsp/smoke.test.ts +0 -74
  1659. package/src/lsp/types.ts +0 -116
  1660. package/src/mcp/__tests__/auto-setup.test.ts +0 -88
  1661. package/src/mcp/__tests__/harness-driver-action-tools.spec.ts +0 -114
  1662. package/src/mcp/__tests__/harness-driver-async-tools.spec.ts +0 -127
  1663. package/src/mcp/__tests__/harness-driver-read-tools.spec.ts +0 -140
  1664. package/src/mcp/__tests__/harness-driver-security.spec.ts +0 -71
  1665. package/src/mcp/__tests__/harness-driver.spec.ts +0 -21
  1666. package/src/mcp/__tests__/lazy-schema.spec.ts +0 -173
  1667. package/src/mcp/__tests__/mcp-keychain.test.ts +0 -46
  1668. package/src/mcp/__tests__/research-onboarding.test.ts +0 -163
  1669. package/src/mcp/__tests__/runtime-hydration.test.ts +0 -86
  1670. package/src/mcp/__tests__/runtime-sanitize.test.ts +0 -44
  1671. package/src/mcp/auto-setup.ts +0 -99
  1672. package/src/mcp/catalog.ts +0 -155
  1673. package/src/mcp/mcp-keychain.ts +0 -77
  1674. package/src/mcp/oauth-callback.ts +0 -75
  1675. package/src/mcp/oauth-provider.ts +0 -128
  1676. package/src/mcp/opentui-spawn.ts +0 -64
  1677. package/src/mcp/parse-headers.test.ts +0 -54
  1678. package/src/mcp/parse-headers.ts +0 -35
  1679. package/src/mcp/research-onboarding.ts +0 -143
  1680. package/src/mcp/runtime.ts +0 -171
  1681. package/src/mcp/smoke.test.ts +0 -170
  1682. package/src/mcp/validate.ts +0 -48
  1683. package/src/models/__tests__/registry.test.ts +0 -95
  1684. package/src/models/catalog-client.ts +0 -140
  1685. package/src/models/catalog.README.md +0 -136
  1686. package/src/models/catalog.json +0 -177
  1687. package/src/models/classify-tier.ts +0 -48
  1688. package/src/models/index.ts +0 -9
  1689. package/src/models/registry.ts +0 -77
  1690. package/src/ops/__tests__/doctor-council-mcp.test.ts +0 -161
  1691. package/src/ops/__tests__/doctor-ee-health.test.ts +0 -129
  1692. package/src/ops/bug-report.test.ts +0 -172
  1693. package/src/ops/bug-report.ts +0 -80
  1694. package/src/ops/doctor.test.ts +0 -108
  1695. package/src/ops/doctor.ts +0 -366
  1696. package/src/orchestrator/__tests__/batch-turn-runner.test.ts +0 -178
  1697. package/src/orchestrator/__tests__/council-manager.test.ts +0 -171
  1698. package/src/orchestrator/__tests__/cross-turn-dedup.test.ts +0 -174
  1699. package/src/orchestrator/__tests__/current-call-id.test.ts +0 -160
  1700. package/src/orchestrator/__tests__/flow-resume.test.ts +0 -71
  1701. package/src/orchestrator/__tests__/message-processor.test.ts +0 -196
  1702. package/src/orchestrator/__tests__/message-write-ahead.test.ts +0 -170
  1703. package/src/orchestrator/__tests__/read-path-budget.test.ts +0 -107
  1704. package/src/orchestrator/__tests__/retry-classifier.test.ts +0 -120
  1705. package/src/orchestrator/__tests__/retry-stream.test.ts +0 -186
  1706. package/src/orchestrator/__tests__/route-feedback.test.ts +0 -55
  1707. package/src/orchestrator/__tests__/stream-runner.test.ts +0 -123
  1708. package/src/orchestrator/__tests__/usage-events-shape.test.ts +0 -80
  1709. package/src/orchestrator/__tests__/usage-normalizer-c1.test.ts +0 -172
  1710. package/src/orchestrator/__tests__/write-ahead.test.ts +0 -162
  1711. package/src/orchestrator/abort.test.ts +0 -37
  1712. package/src/orchestrator/abort.ts +0 -51
  1713. package/src/orchestrator/agent-options.ts +0 -168
  1714. package/src/orchestrator/agent.test.ts +0 -184
  1715. package/src/orchestrator/batch-turn-runner.ts +0 -425
  1716. package/src/orchestrator/batch-utils.ts +0 -340
  1717. package/src/orchestrator/cleanup.test.ts +0 -86
  1718. package/src/orchestrator/compaction.test.ts +0 -181
  1719. package/src/orchestrator/compaction.ts +0 -613
  1720. package/src/orchestrator/council-manager.ts +0 -580
  1721. package/src/orchestrator/cross-turn-dedup.ts +0 -187
  1722. package/src/orchestrator/delegations.test.ts +0 -145
  1723. package/src/orchestrator/delegations.ts +0 -364
  1724. package/src/orchestrator/error-utils.ts +0 -72
  1725. package/src/orchestrator/flow-resume.ts +0 -54
  1726. package/src/orchestrator/message-processor.ts +0 -1985
  1727. package/src/orchestrator/message-seq.test.ts +0 -29
  1728. package/src/orchestrator/message-seq.ts +0 -19
  1729. package/src/orchestrator/orchestrator.ts +0 -2641
  1730. package/src/orchestrator/pending-calls.test.ts +0 -226
  1731. package/src/orchestrator/pending-calls.ts +0 -240
  1732. package/src/orchestrator/prompts.ts +0 -482
  1733. package/src/orchestrator/provider-options-shape.spec.ts +0 -67
  1734. package/src/orchestrator/provider-options-shape.ts +0 -70
  1735. package/src/orchestrator/read-path-budget.ts +0 -128
  1736. package/src/orchestrator/reasoning.test.ts +0 -29
  1737. package/src/orchestrator/reasoning.ts +0 -69
  1738. package/src/orchestrator/retry-classifier.ts +0 -131
  1739. package/src/orchestrator/retry-stream.ts +0 -159
  1740. package/src/orchestrator/sandbox.test.ts +0 -115
  1741. package/src/orchestrator/stream-runner.ts +0 -729
  1742. package/src/orchestrator/sub-agent-cap.test.ts +0 -186
  1743. package/src/orchestrator/sub-agent-cap.ts +0 -218
  1744. package/src/orchestrator/subagent-compactor.spec.ts +0 -144
  1745. package/src/orchestrator/subagent-compactor.ts +0 -242
  1746. package/src/orchestrator/token-counter.test.ts +0 -69
  1747. package/src/orchestrator/token-counter.ts +0 -81
  1748. package/src/orchestrator/tool-utils.ts +0 -214
  1749. package/src/orchestrator/turn-runner-deps.ts +0 -83
  1750. package/src/pil/__tests__/budget.test.ts +0 -39
  1751. package/src/pil/__tests__/config.test.ts +0 -32
  1752. package/src/pil/__tests__/dual-run.test.ts +0 -53
  1753. package/src/pil/__tests__/layer1-intent-trace.test.ts +0 -140
  1754. package/src/pil/__tests__/layer1-intent.test.ts +0 -346
  1755. package/src/pil/__tests__/layer2-personality.test.ts +0 -63
  1756. package/src/pil/__tests__/layer3-ee-injection.test.ts +0 -181
  1757. package/src/pil/__tests__/layer3-injected-chunk.test.ts +0 -122
  1758. package/src/pil/__tests__/layer4-gsd.test.ts +0 -109
  1759. package/src/pil/__tests__/layer5-context.test.ts +0 -157
  1760. package/src/pil/__tests__/layer6-output.test.ts +0 -284
  1761. package/src/pil/__tests__/ollama-classify.test.ts +0 -81
  1762. package/src/pil/__tests__/orchestrator-integration.test.ts +0 -107
  1763. package/src/pil/__tests__/pipeline.test.ts +0 -190
  1764. package/src/pil/__tests__/renderer-coverage.test.ts +0 -46
  1765. package/src/pil/__tests__/response-tools.test.ts +0 -174
  1766. package/src/pil/__tests__/schema.test.ts +0 -233
  1767. package/src/pil/__tests__/scoreComplexity.test.ts +0 -134
  1768. package/src/pil/__tests__/scoreSufficiency.test.ts +0 -104
  1769. package/src/pil/__tests__/store.test.ts +0 -49
  1770. package/src/pil/__tests__/task-tier-map.test.ts +0 -41
  1771. package/src/pil/budget-log.ts +0 -86
  1772. package/src/pil/budget.ts +0 -18
  1773. package/src/pil/config.ts +0 -11
  1774. package/src/pil/index.ts +0 -12
  1775. package/src/pil/layer1-intent.test.ts +0 -127
  1776. package/src/pil/layer1-intent.ts +0 -580
  1777. package/src/pil/layer2-personality.ts +0 -46
  1778. package/src/pil/layer3-ee-injection.ts +0 -345
  1779. package/src/pil/layer4-gsd.ts +0 -118
  1780. package/src/pil/layer5-context.ts +0 -160
  1781. package/src/pil/layer6-output.ts +0 -260
  1782. package/src/pil/ollama-classify.ts +0 -49
  1783. package/src/pil/pipeline.ts +0 -207
  1784. package/src/pil/response-tools.ts +0 -110
  1785. package/src/pil/schema.ts +0 -103
  1786. package/src/pil/store.ts +0 -29
  1787. package/src/pil/task-tier-map.ts +0 -90
  1788. package/src/pil/timeout.ts +0 -10
  1789. package/src/pil/types.ts +0 -150
  1790. package/src/product-loop/__tests__/artifact-io.test.ts +0 -97
  1791. package/src/product-loop/__tests__/assumption-ledger.test.ts +0 -292
  1792. package/src/product-loop/__tests__/cb2-retry-bonus.test.ts +0 -182
  1793. package/src/product-loop/__tests__/circuit-breakers-coverage.test.ts +0 -82
  1794. package/src/product-loop/__tests__/circuit-breakers.test.ts +0 -90
  1795. package/src/product-loop/__tests__/complexity-routing.spec.ts +0 -169
  1796. package/src/product-loop/__tests__/context-policy.test.ts +0 -280
  1797. package/src/product-loop/__tests__/cost-preview.test.ts +0 -118
  1798. package/src/product-loop/__tests__/cost-scoper.test.ts +0 -76
  1799. package/src/product-loop/__tests__/cross-run-memory.test.ts +0 -195
  1800. package/src/product-loop/__tests__/design-output.spec.ts +0 -39
  1801. package/src/product-loop/__tests__/discover.test.ts +0 -98
  1802. package/src/product-loop/__tests__/discovery-council-runner.test.ts +0 -13
  1803. package/src/product-loop/__tests__/discovery-detection.test.ts +0 -180
  1804. package/src/product-loop/__tests__/discovery-ecosystem.test.ts +0 -132
  1805. package/src/product-loop/__tests__/discovery-integration.test.ts +0 -133
  1806. package/src/product-loop/__tests__/discovery-interview.test.ts +0 -305
  1807. package/src/product-loop/__tests__/discovery-migrations.test.ts +0 -75
  1808. package/src/product-loop/__tests__/discovery-persistence.test.ts +0 -171
  1809. package/src/product-loop/__tests__/discovery-prompt-parser.test.ts +0 -77
  1810. package/src/product-loop/__tests__/discovery-recommender-ecosystem.test.ts +0 -94
  1811. package/src/product-loop/__tests__/discovery-recommender.test.ts +0 -382
  1812. package/src/product-loop/__tests__/discovery-schema.test.ts +0 -102
  1813. package/src/product-loop/__tests__/done-gate-coverage.test.ts +0 -151
  1814. package/src/product-loop/__tests__/done-gate.test.ts +0 -140
  1815. package/src/product-loop/__tests__/ee-extract-wiring.test.ts +0 -216
  1816. package/src/product-loop/__tests__/extract-to-ee.test.ts +0 -205
  1817. package/src/product-loop/__tests__/feedback-routing.test.ts +0 -93
  1818. package/src/product-loop/__tests__/hot-path.spec.ts +0 -177
  1819. package/src/product-loop/__tests__/integration.test.ts +0 -344
  1820. package/src/product-loop/__tests__/loop-driver-audit.test.ts +0 -321
  1821. package/src/product-loop/__tests__/loop-driver.test.ts +0 -247
  1822. package/src/product-loop/__tests__/phase-budget.test.ts +0 -172
  1823. package/src/product-loop/__tests__/phase-orchestrator-integration.test.ts +0 -143
  1824. package/src/product-loop/__tests__/phase-plan.test.ts +0 -241
  1825. package/src/product-loop/__tests__/phase-rituals.test.ts +0 -211
  1826. package/src/product-loop/__tests__/phase-runner.test.ts +0 -454
  1827. package/src/product-loop/__tests__/phase-tracker-bridge.test.ts +0 -85
  1828. package/src/product-loop/__tests__/product-identity.test.ts +0 -47
  1829. package/src/product-loop/__tests__/reality-anchor.test.ts +0 -58
  1830. package/src/product-loop/__tests__/repo-audit.test.ts +0 -103
  1831. package/src/product-loop/__tests__/role-memory.test.ts +0 -70
  1832. package/src/product-loop/__tests__/role-registry.test.ts +0 -235
  1833. package/src/product-loop/__tests__/role-routing-ee.test.ts +0 -90
  1834. package/src/product-loop/__tests__/route-decision-emit.test.ts +0 -207
  1835. package/src/product-loop/__tests__/seed-questions.test.ts +0 -33
  1836. package/src/product-loop/__tests__/ship-polish.test.ts +0 -109
  1837. package/src/product-loop/__tests__/sprint-runner-emit.test.ts +0 -324
  1838. package/src/product-loop/__tests__/sprint-runner.test.ts +0 -501
  1839. package/src/product-loop/__tests__/stakeholder-acl.test.ts +0 -94
  1840. package/src/product-loop/__tests__/state-md-ee-injections.test.ts +0 -229
  1841. package/src/product-loop/__tests__/sufficiency-routing.spec.ts +0 -177
  1842. package/src/product-loop/__tests__/typed-artifacts.test.ts +0 -261
  1843. package/src/product-loop/__tests__/types.test.ts +0 -103
  1844. package/src/product-loop/__tests__/verify-failure-threshold.test.ts +0 -177
  1845. package/src/product-loop/__tests__/verify-failure-tracking.test.ts +0 -154
  1846. package/src/product-loop/__tests__/verify-result.test.ts +0 -60
  1847. package/src/product-loop/artifact-io.ts +0 -239
  1848. package/src/product-loop/assumption-ledger.ts +0 -270
  1849. package/src/product-loop/circuit-breakers.ts +0 -76
  1850. package/src/product-loop/context-policy.ts +0 -180
  1851. package/src/product-loop/cost-preview.ts +0 -124
  1852. package/src/product-loop/cost-scoper.ts +0 -49
  1853. package/src/product-loop/cross-run-memory.ts +0 -450
  1854. package/src/product-loop/design-output.ts +0 -24
  1855. package/src/product-loop/discover.ts +0 -159
  1856. package/src/product-loop/discovery-context-format.ts +0 -32
  1857. package/src/product-loop/discovery-council-runner.ts +0 -82
  1858. package/src/product-loop/discovery-detection.ts +0 -161
  1859. package/src/product-loop/discovery-ecosystem.ts +0 -124
  1860. package/src/product-loop/discovery-interview.ts +0 -237
  1861. package/src/product-loop/discovery-migrations.ts +0 -40
  1862. package/src/product-loop/discovery-persistence.ts +0 -219
  1863. package/src/product-loop/discovery-prompt-parser.ts +0 -80
  1864. package/src/product-loop/discovery-recommender.ts +0 -366
  1865. package/src/product-loop/discovery-schema.ts +0 -143
  1866. package/src/product-loop/done-gate.ts +0 -224
  1867. package/src/product-loop/feedback-routing.ts +0 -82
  1868. package/src/product-loop/gather.ts +0 -304
  1869. package/src/product-loop/index.ts +0 -1305
  1870. package/src/product-loop/loop-driver.ts +0 -901
  1871. package/src/product-loop/phase-budget.ts +0 -182
  1872. package/src/product-loop/phase-plan.ts +0 -158
  1873. package/src/product-loop/phase-rituals.ts +0 -158
  1874. package/src/product-loop/phase-runner.ts +0 -455
  1875. package/src/product-loop/phase-tracker-bridge.ts +0 -60
  1876. package/src/product-loop/product-identity.ts +0 -11
  1877. package/src/product-loop/reality-anchor.ts +0 -45
  1878. package/src/product-loop/repo-audit.ts +0 -314
  1879. package/src/product-loop/role-memory.ts +0 -72
  1880. package/src/product-loop/role-registry.ts +0 -175
  1881. package/src/product-loop/seed-questions.ts +0 -51
  1882. package/src/product-loop/ship-polish.ts +0 -164
  1883. package/src/product-loop/sprint-runner.ts +0 -610
  1884. package/src/product-loop/stakeholder-acl.ts +0 -82
  1885. package/src/product-loop/typed-artifacts.ts +0 -332
  1886. package/src/product-loop/types.ts +0 -443
  1887. package/src/product-loop/verify-failure-tracking.ts +0 -225
  1888. package/src/product-loop/verify-result.ts +0 -39
  1889. package/src/providers/.gitkeep +0 -0
  1890. package/src/providers/__test-utils__/load-fixture.ts +0 -36
  1891. package/src/providers/__tests__/adapter-oauth-wiring.test.ts +0 -129
  1892. package/src/providers/__tests__/capabilities-cosmetic.test.ts +0 -119
  1893. package/src/providers/__tests__/capabilities-flags.test.ts +0 -166
  1894. package/src/providers/__tests__/capabilities-provider-options.test.ts +0 -203
  1895. package/src/providers/__tests__/capabilities-sanitize.test.ts +0 -82
  1896. package/src/providers/__tests__/capabilities.test.ts +0 -44
  1897. package/src/providers/__tests__/provider-coverage.test.ts +0 -48
  1898. package/src/providers/__tests__/runtime-integration.test.ts +0 -97
  1899. package/src/providers/__tests__/runtime.test.ts +0 -96
  1900. package/src/providers/__tests__/siliconflow-history.test.ts +0 -82
  1901. package/src/providers/__tests__/strategies-registry.test.ts +0 -55
  1902. package/src/providers/__tests__/strategies-resolve.test.ts +0 -137
  1903. package/src/providers/__tests__/wire-debug.test.ts +0 -42
  1904. package/src/providers/adapter.test.ts +0 -21
  1905. package/src/providers/adapter.ts +0 -156
  1906. package/src/providers/anthropic.ts +0 -174
  1907. package/src/providers/auth/__tests__/browser-flow.test.ts +0 -235
  1908. package/src/providers/auth/__tests__/device-flow.test.ts +0 -263
  1909. package/src/providers/auth/__tests__/gemini-oauth.test.ts +0 -387
  1910. package/src/providers/auth/__tests__/openai-oauth.test.ts +0 -378
  1911. package/src/providers/auth/__tests__/token-store.test.ts +0 -152
  1912. package/src/providers/auth/browser-flow.ts +0 -140
  1913. package/src/providers/auth/device-flow.ts +0 -221
  1914. package/src/providers/auth/gemini-oauth.ts +0 -351
  1915. package/src/providers/auth/openai-oauth.ts +0 -455
  1916. package/src/providers/auth/registry.ts +0 -121
  1917. package/src/providers/auth/token-store.ts +0 -154
  1918. package/src/providers/auth/types.ts +0 -111
  1919. package/src/providers/capabilities.ts +0 -351
  1920. package/src/providers/endpoints.ts +0 -68
  1921. package/src/providers/errors.test.ts +0 -76
  1922. package/src/providers/errors.ts +0 -46
  1923. package/src/providers/gemini.test.ts +0 -46
  1924. package/src/providers/gemini.ts +0 -42
  1925. package/src/providers/index.ts +0 -28
  1926. package/src/providers/keychain.test.ts +0 -100
  1927. package/src/providers/keychain.ts +0 -267
  1928. package/src/providers/mcp-vision-bridge.test.ts +0 -513
  1929. package/src/providers/mcp-vision-bridge.ts +0 -1020
  1930. package/src/providers/ollama.test.ts +0 -46
  1931. package/src/providers/ollama.ts +0 -36
  1932. package/src/providers/openai-compatible.test.ts +0 -63
  1933. package/src/providers/openai-compatible.ts +0 -58
  1934. package/src/providers/openai.test.ts +0 -65
  1935. package/src/providers/openai.ts +0 -56
  1936. package/src/providers/patch-zod-schema.ts +0 -126
  1937. package/src/providers/pricing.test.ts +0 -65
  1938. package/src/providers/pricing.ts +0 -111
  1939. package/src/providers/prompt-cache-key.spec.ts +0 -28
  1940. package/src/providers/runtime-mock.spec.ts +0 -86
  1941. package/src/providers/runtime.ts +0 -283
  1942. package/src/providers/siliconflow-history.ts +0 -74
  1943. package/src/providers/strategies/anthropic.strategy.ts +0 -25
  1944. package/src/providers/strategies/base.strategy.ts +0 -76
  1945. package/src/providers/strategies/deepseek.strategy.ts +0 -26
  1946. package/src/providers/strategies/google.strategy.ts +0 -28
  1947. package/src/providers/strategies/ollama.strategy.ts +0 -22
  1948. package/src/providers/strategies/openai.strategy.ts +0 -55
  1949. package/src/providers/strategies/registry.ts +0 -43
  1950. package/src/providers/strategies/siliconflow.strategy.ts +0 -26
  1951. package/src/providers/strategies/xai.strategy.ts +0 -26
  1952. package/src/providers/stream-loop.ts +0 -83
  1953. package/src/providers/types.ts +0 -145
  1954. package/src/providers/vision-proxy.test.ts +0 -252
  1955. package/src/providers/vision-proxy.ts +0 -317
  1956. package/src/providers/wire-debug.ts +0 -163
  1957. package/src/router/.gitkeep +0 -0
  1958. package/src/router/__tests__/step-router.test.ts +0 -150
  1959. package/src/router/classifier/grammars.ts +0 -17
  1960. package/src/router/classifier/index.test.ts +0 -33
  1961. package/src/router/classifier/index.ts +0 -21
  1962. package/src/router/classifier/regex.test.ts +0 -49
  1963. package/src/router/classifier/regex.ts +0 -113
  1964. package/src/router/classifier/tree-sitter.test.ts +0 -26
  1965. package/src/router/classifier/tree-sitter.ts +0 -87
  1966. package/src/router/cold.test.ts +0 -62
  1967. package/src/router/cold.ts +0 -27
  1968. package/src/router/decide.test.ts +0 -147
  1969. package/src/router/decide.ts +0 -472
  1970. package/src/router/health.test.ts +0 -59
  1971. package/src/router/health.ts +0 -49
  1972. package/src/router/provider-sentinel.test.ts +0 -22
  1973. package/src/router/provider-sentinel.ts +0 -20
  1974. package/src/router/step-router.ts +0 -194
  1975. package/src/router/store.ts +0 -47
  1976. package/src/router/types.ts +0 -20
  1977. package/src/router/warm.test.ts +0 -168
  1978. package/src/router/warm.ts +0 -53
  1979. package/src/scaffold/__tests__/continuation-prompt.test.ts +0 -93
  1980. package/src/scaffold/__tests__/continue-as-council.spec.ts +0 -124
  1981. package/src/scaffold/__tests__/dotnet-assembly-name.test.ts +0 -28
  1982. package/src/scaffold/__tests__/fe-scaffold-contents.test.ts +0 -127
  1983. package/src/scaffold/__tests__/init-new.smoke.spec.ts +0 -99
  1984. package/src/scaffold/__tests__/init-new.spec.ts +0 -450
  1985. package/src/scaffold/__tests__/install-bb-templates.spec.ts +0 -86
  1986. package/src/scaffold/__tests__/point-to-existing.spec.ts +0 -114
  1987. package/src/scaffold/bb-ecosystem-apply.ts +0 -454
  1988. package/src/scaffold/bb-quality-gate.ts +0 -287
  1989. package/src/scaffold/continuation-prompt.ts +0 -80
  1990. package/src/scaffold/continue-as-council.ts +0 -99
  1991. package/src/scaffold/init-new.ts +0 -1691
  1992. package/src/scaffold/point-to-existing.ts +0 -83
  1993. package/src/scaffold/resume-from-gate-failures.ts +0 -167
  1994. package/src/storage/__tests__/migrations.test.ts +0 -395
  1995. package/src/storage/__tests__/ui-interaction-log.test.ts +0 -105
  1996. package/src/storage/atomic-io.test.ts +0 -92
  1997. package/src/storage/atomic-io.ts +0 -160
  1998. package/src/storage/config.test.ts +0 -33
  1999. package/src/storage/config.ts +0 -53
  2000. package/src/storage/db.ts +0 -184
  2001. package/src/storage/index.ts +0 -26
  2002. package/src/storage/interaction-log.ts +0 -121
  2003. package/src/storage/migrations.ts +0 -205
  2004. package/src/storage/session-dir.ts +0 -37
  2005. package/src/storage/sessions.ts +0 -206
  2006. package/src/storage/tool-results.ts +0 -56
  2007. package/src/storage/transcript-view.ts +0 -45
  2008. package/src/storage/transcript.test.ts +0 -24
  2009. package/src/storage/transcript.ts +0 -561
  2010. package/src/storage/ui-interaction-log.ts +0 -160
  2011. package/src/storage/usage-cap.test.ts +0 -59
  2012. package/src/storage/usage-cap.ts +0 -81
  2013. package/src/storage/usage.ts +0 -117
  2014. package/src/storage/workspaces.ts +0 -84
  2015. package/src/tools/bash.test.ts +0 -363
  2016. package/src/tools/bash.ts +0 -668
  2017. package/src/tools/computer.test.ts +0 -187
  2018. package/src/tools/computer.ts +0 -632
  2019. package/src/tools/file-tracker.test.ts +0 -99
  2020. package/src/tools/file-tracker.ts +0 -70
  2021. package/src/tools/file.test.ts +0 -95
  2022. package/src/tools/file.ts +0 -182
  2023. package/src/tools/grep.ts +0 -187
  2024. package/src/tools/registry.test.ts +0 -38
  2025. package/src/tools/registry.ts +0 -388
  2026. package/src/tools/schedule.test.ts +0 -143
  2027. package/src/tools/schedule.ts +0 -610
  2028. package/src/types/index.ts +0 -474
  2029. package/src/ui/agents-modal.tsx +0 -292
  2030. package/src/ui/app.tsx +0 -6464
  2031. package/src/ui/cards/__tests__/product-status-card.test.ts +0 -30
  2032. package/src/ui/cards/product-status-card.tsx +0 -117
  2033. package/src/ui/components/SuggestionOverlay.tsx +0 -38
  2034. package/src/ui/components/Toast.tsx +0 -100
  2035. package/src/ui/components/__tests__/council-leader-bubble.test.ts +0 -16
  2036. package/src/ui/components/__tests__/council-message-bubble.test.ts +0 -85
  2037. package/src/ui/components/__tests__/council-phase-timeline.test.ts +0 -57
  2038. package/src/ui/components/__tests__/council-placeholder-bubble.test.ts +0 -16
  2039. package/src/ui/components/__tests__/council-question-card.test.ts +0 -133
  2040. package/src/ui/components/__tests__/council-synthesis-banner.test.ts +0 -12
  2041. package/src/ui/components/__tests__/use-pair-quote-buffer.test.ts +0 -41
  2042. package/src/ui/components/btw-overlay.tsx +0 -66
  2043. package/src/ui/components/bubble-layout.ts +0 -66
  2044. package/src/ui/components/code-block-truncate.ts +0 -24
  2045. package/src/ui/components/copy-flash-banner.tsx +0 -31
  2046. package/src/ui/components/council-info-card.tsx +0 -45
  2047. package/src/ui/components/council-leader-bubble.tsx +0 -41
  2048. package/src/ui/components/council-message-bubble.tsx +0 -111
  2049. package/src/ui/components/council-phase-timeline.tsx +0 -91
  2050. package/src/ui/components/council-placeholder-bubble.tsx +0 -65
  2051. package/src/ui/components/council-question-card.tsx +0 -253
  2052. package/src/ui/components/council-status-list.tsx +0 -111
  2053. package/src/ui/components/council-synthesis-banner.tsx +0 -37
  2054. package/src/ui/components/diff-view.tsx +0 -225
  2055. package/src/ui/components/halt-recovery-card.tsx +0 -83
  2056. package/src/ui/components/hero-logo.tsx +0 -62
  2057. package/src/ui/components/init-new-form-card.tsx +0 -470
  2058. package/src/ui/components/lsp-views.tsx +0 -104
  2059. package/src/ui/components/media-views.tsx +0 -66
  2060. package/src/ui/components/message-view.tsx +0 -343
  2061. package/src/ui/components/point-to-existing-form-card.tsx +0 -136
  2062. package/src/ui/components/prompt-box.tsx +0 -306
  2063. package/src/ui/components/role-palette.ts +0 -62
  2064. package/src/ui/components/session-header.tsx +0 -68
  2065. package/src/ui/components/slash-inline-menu.tsx +0 -63
  2066. package/src/ui/components/structured-response-view.tsx +0 -191
  2067. package/src/ui/components/tool-result-views.tsx +0 -258
  2068. package/src/ui/components/use-pair-quote-buffer.ts +0 -23
  2069. package/src/ui/constants.ts +0 -242
  2070. package/src/ui/hooks/use-agent-editor.ts +0 -64
  2071. package/src/ui/hooks/use-mcp-editor.ts +0 -39
  2072. package/src/ui/hooks/use-model-picker.ts +0 -50
  2073. package/src/ui/hooks/useTypeahead.ts +0 -160
  2074. package/src/ui/markdown.tsx +0 -49
  2075. package/src/ui/mcp-modal-types.ts +0 -33
  2076. package/src/ui/mcp-modal.tsx +0 -484
  2077. package/src/ui/modals/api-key-modal.tsx +0 -99
  2078. package/src/ui/modals/connect-modal.tsx +0 -259
  2079. package/src/ui/modals/model-picker-modal.tsx +0 -323
  2080. package/src/ui/modals/sandbox-picker-modal.tsx +0 -99
  2081. package/src/ui/modals/update-modal.tsx +0 -67
  2082. package/src/ui/modals/wallet-picker-modal.tsx +0 -186
  2083. package/src/ui/plan.tsx +0 -346
  2084. package/src/ui/schedule-modal.tsx +0 -138
  2085. package/src/ui/slash/__tests__/clear.test.ts +0 -86
  2086. package/src/ui/slash/__tests__/compact.test.ts +0 -56
  2087. package/src/ui/slash/__tests__/cost.test.ts +0 -62
  2088. package/src/ui/slash/__tests__/discuss.test.ts +0 -101
  2089. package/src/ui/slash/__tests__/execute.test.ts +0 -86
  2090. package/src/ui/slash/__tests__/expand.test.ts +0 -86
  2091. package/src/ui/slash/__tests__/ideal.test.ts +0 -134
  2092. package/src/ui/slash/__tests__/menu-parity.test.ts +0 -43
  2093. package/src/ui/slash/__tests__/optimize.test.ts +0 -155
  2094. package/src/ui/slash/__tests__/pin.test.ts +0 -47
  2095. package/src/ui/slash/__tests__/plan.test.ts +0 -95
  2096. package/src/ui/slash/clear.ts +0 -89
  2097. package/src/ui/slash/compact.ts +0 -46
  2098. package/src/ui/slash/cost.ts +0 -63
  2099. package/src/ui/slash/council-inspect.ts +0 -188
  2100. package/src/ui/slash/council.ts +0 -30
  2101. package/src/ui/slash/debug.ts +0 -153
  2102. package/src/ui/slash/discuss.ts +0 -71
  2103. package/src/ui/slash/ee.ts +0 -304
  2104. package/src/ui/slash/execute.ts +0 -44
  2105. package/src/ui/slash/expand.ts +0 -51
  2106. package/src/ui/slash/export.ts +0 -281
  2107. package/src/ui/slash/ideal.ts +0 -254
  2108. package/src/ui/slash/menu-items.ts +0 -106
  2109. package/src/ui/slash/optimize.ts +0 -47
  2110. package/src/ui/slash/pin.ts +0 -41
  2111. package/src/ui/slash/plan.ts +0 -62
  2112. package/src/ui/slash/registry.ts +0 -47
  2113. package/src/ui/slash/route.test.ts +0 -82
  2114. package/src/ui/slash/route.ts +0 -43
  2115. package/src/ui/status-bar/index.test.tsx +0 -90
  2116. package/src/ui/status-bar/index.tsx +0 -98
  2117. package/src/ui/status-bar/store.test.ts +0 -131
  2118. package/src/ui/status-bar/store.ts +0 -186
  2119. package/src/ui/status-bar/tier-badge.test.tsx +0 -38
  2120. package/src/ui/status-bar/tier-badge.tsx +0 -29
  2121. package/src/ui/status-bar/usd-meter.test.tsx +0 -37
  2122. package/src/ui/status-bar/usd-meter.tsx +0 -22
  2123. package/src/ui/syntax-highlight.ts +0 -627
  2124. package/src/ui/terminal-selection-text.ts +0 -72
  2125. package/src/ui/theme.ts +0 -95
  2126. package/src/ui/types.ts +0 -83
  2127. package/src/ui/utils/color.ts +0 -19
  2128. package/src/ui/utils/format.ts +0 -86
  2129. package/src/ui/utils/modal.ts +0 -9
  2130. package/src/ui/utils/text.ts +0 -31
  2131. package/src/ui/utils/tools.ts +0 -95
  2132. package/src/usage/.gitkeep +0 -0
  2133. package/src/usage/__tests__/product-ledger.test.ts +0 -85
  2134. package/src/usage/cost-log.ts +0 -158
  2135. package/src/usage/decision-log.ts +0 -86
  2136. package/src/usage/downgrade.test.ts +0 -82
  2137. package/src/usage/downgrade.ts +0 -70
  2138. package/src/usage/estimator.test.ts +0 -43
  2139. package/src/usage/estimator.ts +0 -58
  2140. package/src/usage/ledger.test.ts +0 -200
  2141. package/src/usage/ledger.ts +0 -253
  2142. package/src/usage/midstream.test.ts +0 -55
  2143. package/src/usage/midstream.ts +0 -51
  2144. package/src/usage/product-ledger.ts +0 -111
  2145. package/src/usage/thresholds.test.ts +0 -83
  2146. package/src/usage/thresholds.ts +0 -74
  2147. package/src/usage/types.ts +0 -41
  2148. package/src/utils/__tests__/auto-council-settings.test.ts +0 -46
  2149. package/src/utils/__tests__/ee-logger.test.ts +0 -197
  2150. package/src/utils/__tests__/file-lock.test.ts +0 -74
  2151. package/src/utils/__tests__/rate-limit.test.ts +0 -42
  2152. package/src/utils/__tests__/settings-disabled-models.test.ts +0 -113
  2153. package/src/utils/__tests__/settings-web-research.test.ts +0 -45
  2154. package/src/utils/__tests__/slugify.test.ts +0 -45
  2155. package/src/utils/__tests__/visible-retry.test.ts +0 -195
  2156. package/src/utils/at-mentions.ts +0 -120
  2157. package/src/utils/clipboard-image.ts +0 -139
  2158. package/src/utils/ee-logger.ts +0 -163
  2159. package/src/utils/file-index.ts +0 -152
  2160. package/src/utils/file-lock.ts +0 -66
  2161. package/src/utils/git-root.ts +0 -17
  2162. package/src/utils/host-clipboard.ts +0 -68
  2163. package/src/utils/install-manager.test.ts +0 -167
  2164. package/src/utils/install-manager.ts +0 -429
  2165. package/src/utils/instructions.test.ts +0 -112
  2166. package/src/utils/instructions.ts +0 -149
  2167. package/src/utils/permission-mode.test.ts +0 -121
  2168. package/src/utils/permission-mode.ts +0 -37
  2169. package/src/utils/rate-limit.ts +0 -21
  2170. package/src/utils/redactor.test.ts +0 -100
  2171. package/src/utils/redactor.ts +0 -223
  2172. package/src/utils/settings.test.ts +0 -181
  2173. package/src/utils/settings.ts +0 -1108
  2174. package/src/utils/shell.test.ts +0 -72
  2175. package/src/utils/shell.ts +0 -193
  2176. package/src/utils/side-question.ts +0 -39
  2177. package/src/utils/skills.test.ts +0 -58
  2178. package/src/utils/skills.ts +0 -207
  2179. package/src/utils/slugify.ts +0 -9
  2180. package/src/utils/subagent-display.test.ts +0 -23
  2181. package/src/utils/subagent-display.ts +0 -11
  2182. package/src/utils/subagents-settings.test.ts +0 -77
  2183. package/src/utils/telegram-audio-settings.test.ts +0 -44
  2184. package/src/utils/update-checker.test.ts +0 -182
  2185. package/src/utils/update-checker.ts +0 -33
  2186. package/src/utils/visible-retry.ts +0 -56
  2187. package/src/verify/__tests__/coverage-parsers.test.ts +0 -86
  2188. package/src/verify/__tests__/dotnet-recipe.test.ts +0 -88
  2189. package/src/verify/checkpoint.test.ts +0 -186
  2190. package/src/verify/checkpoint.ts +0 -239
  2191. package/src/verify/coverage-parsers.ts +0 -76
  2192. package/src/verify/entrypoint.test.ts +0 -293
  2193. package/src/verify/entrypoint.ts +0 -439
  2194. package/src/verify/environment.test.ts +0 -119
  2195. package/src/verify/environment.ts +0 -115
  2196. package/src/verify/evidence.ts +0 -104
  2197. package/src/verify/orchestrator.test.ts +0 -159
  2198. package/src/verify/orchestrator.ts +0 -129
  2199. package/src/verify/recipes.ts +0 -592
  2200. package/src/verify/retry.ts +0 -62
  2201. package/src/verify/runtime-prep.test.ts +0 -47
  2202. /package/dist/src/{providers/__tests__/siliconflow-history.test.d.ts → council/__tests__/clarifier-ready-gate.test.d.ts} +0 -0
@@ -17,15 +17,27 @@ import { getProviderCapabilities } from "../providers/capabilities.js";
17
17
  import { buildResponseTools } from "./response-tools.js";
18
18
  const VALID_STYLES = ["concise", "balanced", "detailed"];
19
19
  // Per-task-type fallback style when brain is unavailable.
20
- // Reflects the information density each task type genuinely needs.
20
+ //
21
+ // PIL-L6 verbosity fix — debug/analyze flipped from "balanced" → "concise".
22
+ // Users complained about end-of-turn summaries and rambling debug responses.
23
+ // "balanced" pads with rationale prose the user can read from the diff/code
24
+ // already. "detailed" is reserved for explicit user request ("explain").
25
+ // Broad detector for self-referential / meta / evaluation prompts about the CLI,
26
+ // prior turns, or the agent's own behavior. Used to relax brevity rules so full
27
+ // answers (with evidence, bullets, file:line) are not suppressed by low budgets
28
+ // or NO_PREAMBLE. No model/provider hardcodes — only prompt content signals.
29
+ // Exported for early detection in pipeline / orchestrator.
30
+ export function isMetaAnalysisPrompt(raw) {
31
+ return /đánh giá|phân tích|cải thiện|fix|debug|nhận xét|đánh giá tổng thể|evaluate.*(cli|system|repo)|improve.*(cli|repo)|your assessment|how would you improve|trả lời tự nhiên|natural response|sau fix|phỏng vấn|discovery|native|agent.*inside|cli.*bên trong|context|previous turn|input.*vừa rồi|mù context/i.test(raw);
32
+ }
21
33
  const TASK_TYPE_DEFAULT_STYLE = {
22
- debug: "balanced", // needs root cause + fix context
23
- plan: "balanced", // balanced by default; user requests detail explicitly
24
- analyze: "balanced", // findings need brief evidence
34
+ debug: "concise", // root cause + fix; no padding
35
+ plan: "balanced", // plans genuinely need a brief rationale per step
36
+ analyze: "concise", // bullet findings, no narrative
25
37
  documentation: "balanced", // examples + explanation
26
38
  generate: "concise", // code speaks for itself
27
39
  refactor: "concise", // diff is the output
28
- general: "balanced",
40
+ general: "concise", // direct answer, no preamble
29
41
  };
30
42
  // PIL-04 Tier 1.1: response-tool gating.
31
43
  //
@@ -66,12 +78,19 @@ const TASK_OUTPUT_BUDGET = {
66
78
  analyze: 600,
67
79
  documentation: 900,
68
80
  generate: 1200,
69
- general: 200,
81
+ // general is user-facing prose (not a code artifact). Higher budget + relaxed
82
+ // style rules so the final answer reads naturally for humans instead of
83
+ // machine-optimized telegraphic lists. See user report on over-constrained
84
+ // freetext after Layer 6.
85
+ general: 650,
70
86
  };
71
- // PIL-04 Tier 1.3: ban preamble openers.
72
- // Measured ~30 tokens/turn wasted on "I'll help you...", "Sure, let me..." etc.
73
- // Bilingual EN+VN. Skipped for response-tools path (JSON has no preamble surface).
74
- const NO_PREAMBLE_RULE = `\nFORBIDDEN OPENERS: do not start with "I'll", "I will", "Let me", "Here's", "Sure", "Of course", "Tôi sẽ", "Để tôi", "Vâng". Start directly with the answer content.`;
87
+ // PIL-04 Tier 1.3 + PIL-L6 verbosity fix: ban preamble AND end-of-turn summary.
88
+ // Old rule only covered openers (~30 tok saved). End-of-turn summaries
89
+ // ("In summary...", "I have completed X, Y, Z", "Tóm tắt: ...") cost
90
+ // 100-300 tokens/turn AND give the user nothing they can't read from the
91
+ // diff. Bilingual EN+VN. Skipped for response-tools path (JSON has no
92
+ // freeform surface).
93
+ const NO_PREAMBLE_RULE = `\nFORBIDDEN OPENERS: do not start with "I'll", "I will", "Let me", "Here's", "Sure", "Of course", "Tôi sẽ", "Để tôi", "Vâng". Start directly with the answer content.\nFORBIDDEN END-OF-TURN SUMMARY: do not append a recap section ("In summary", "To summarize", "Tổng kết", "Tóm tắt", "Tóm lại", "Kết luận", "I have done X, Y, Z", "Now you have…", "Đã hoàn thành…"). The diff and command output already show what changed; the user can read them. End the response when the answer is complete.\nFORBIDDEN INTER-TOOL NARRATION: when chaining tool calls, do NOT emit content text between them. Skip phrases like "Now I'll check…", "Let me look at…", "Next, I need to…", "Tiếp theo tôi sẽ…", "Bây giờ tôi cần…". Emit the next tool call directly. Each round-trip of inter-tool narration costs the user ~100 output tokens that they do not need to read — the tool calls themselves are visible in the UI. Only emit content text for the FINAL answer or when surfacing a decision the user must make.`;
75
94
  const SUFFIXES = {
76
95
  refactor: {
77
96
  concise: `\nOUTPUT RULES (refactor): Show only changed code. Prefer unified diff or replacement function. No prose unless architecture changes. One sentence max if explanation needed. No preamble.`,
@@ -104,9 +123,11 @@ const SUFFIXES = {
104
123
  detailed: `\nOUTPUT RULES (generate): Complete, runnable code with full explanation. Include all imports. Inline comments for logic and decisions. Explain design choices, alternatives considered, and trade-offs before the code.`,
105
124
  },
106
125
  general: {
107
- concise: `\nAnswer directly. No preamble.`,
108
- balanced: `\nAnswer with brief context.`,
109
- detailed: `\nAnswer thoroughly.`,
126
+ // General answers should be highly readable. Encourage rich markdown
127
+ // (bullets, headings, bold text) instead of forcing dense prose.
128
+ concise: `\nAnswer directly. Use markdown, bullet points, and code blocks to make the output highly readable and scannable. Avoid dense paragraphs.`,
129
+ balanced: `\nAnswer with helpful context. Structure your response using markdown headings, bullet points, and code blocks for excellent readability. Avoid dense walls of text.`,
130
+ detailed: `\nAnswer thoroughly. Use rich markdown structure (headings, lists, bold text, code blocks) to organize complex information so it is easy to scan and read.`,
110
131
  },
111
132
  };
112
133
  // TODO(WhoAmI-L6): when EE v4.0 Who Am I profile is available, skip
@@ -121,16 +142,59 @@ export function applyPilSuffix(systemPrompt, ctx, responseToolsActive = false) {
121
142
  if (!ctx.taskType || !SUFFIXES[ctx.taskType])
122
143
  return systemPrompt;
123
144
  if (responseToolsActive) {
145
+ const isMeta = isMetaAnalysisPrompt(ctx.raw);
146
+ const metaNote = isMeta
147
+ ? " This is a meta/evaluation question about the system or prior turns — the `response` field MUST contain the complete, unshortened answer with all evidence and detail."
148
+ : "";
149
+ const finalAnswerNote = ctx.taskType === "general"
150
+ ? " Structure your `response` with rich markdown formatting (headings, bullet points, bold text, code blocks). Make it highly readable, scannable, and clearly organized. Avoid dense walls of text (freetext)."
151
+ : "";
152
+ // Human-UX guard for question/meta turns. Without it the model narrates its
153
+ // OWN process into the user-facing answer — a "2-3 line plan" preamble, "per
154
+ // contract 2/5/7", "emit respond_general", "all facts come only from
155
+ // this-turn reads" (session 829a83888dd2). The reader is a human who asked a
156
+ // question, not an agent auditing compliance.
157
+ const humanNote = isMeta || ctx.taskType === "general"
158
+ ? " Write the `response` for the HUMAN who asked: lead with the answer. Do NOT include an implementation plan, do NOT narrate your own process, and do NOT restate internal rule/tool/layer names (contract rules, respond_* , layer6, native:NN) as compliance — cite a file:line only where it directly backs a claim. Do NOT append an evidence-provenance footer or a disclaimer that your facts come only from this turn / that you did not infer unopened files — that is internal contract bookkeeping, invisible to the reader: end on the answer's last substantive point."
159
+ : "";
124
160
  return (systemPrompt +
125
- `\nOUTPUT FORMAT: When you finish your work, use the respond_${ctx.taskType} tool to structure your final answer. You may write free-form text to explain your reasoning during the process. Use action tools (bash, read_file, edit_file, etc.) as needed, then summarize your result via respond_${ctx.taskType}.`);
161
+ `\nOUTPUT FORMAT: When you finish your work, use the respond_${ctx.taskType} tool to structure your final answer. You may write free-form text to explain your reasoning during the process. Use action tools (bash, read_file, edit_file, etc.) as needed, then deliver the COMPLETE, FULL answer (do not summarize, shorten, or truncate for token budgets) via respond_${ctx.taskType}.${metaNote}${finalAnswerNote}${humanNote}`);
126
162
  }
127
- const style = ctx.outputStyle ?? "concise";
163
+ // Action tasks (debug/refactor/generate) override "detailed" → "concise" UNLESS
164
+ // the prompt literally requested detail. Brain/LLM classifiers sometimes
165
+ // return style=detailed for prompts like "fix CI fail" (Vietnamese: "fix lỗi
166
+ // CI") just because the prompt looks ambiguous in isolation — session
167
+ // 127140a47b56 hit this and the model spent 275 LLM calls being "thorough"
168
+ // about a one-liner CI fix.
169
+ const ACTION_TASKS = new Set(["debug", "refactor", "generate"]);
170
+ const DETAIL_KEYWORDS = /\b(explain in detail|thorough analysis|walk me through|in depth|deeply|comprehensive)\b|giải thích chi tiết|phân tích kỹ|cặn kẽ|chi tiết hơn/i;
171
+ const requestedStyle = ctx.outputStyle ?? "concise";
172
+ const style = requestedStyle === "detailed" && ACTION_TASKS.has(ctx.taskType) && !DETAIL_KEYWORDS.test(ctx.raw)
173
+ ? "concise"
174
+ : requestedStyle;
128
175
  const baseSuffix = SUFFIXES[ctx.taskType][style];
129
176
  // PIL-04 Tier 1.2: output-budget hint.
130
- const budget = TASK_OUTPUT_BUDGET[ctx.taskType] ?? 600;
131
- const budgetHint = `\nOUTPUT BUDGET: aim for ≤${budget} tokens. Stop when the answer is complete; do not pad.`;
177
+ // For response-tool turns or meta-analysis (self-eval of CLI, prior context, "mù context" etc.),
178
+ // raise budget and skip aggressive "do not pad / no summary" so full evidence-rich answers
179
+ // reach the respond_* payload and the user. Before: meta follow-ups often produced only
180
+ // short "**Đã trả lời xong**" confirmations even when detailed analysis was prepared in the tool.
181
+ // After: explicit "COMPLETE, FULL" instruction + higher budget + isMetaAnalysisPrompt gate.
182
+ const isMetaAnalysis = isMetaAnalysisPrompt(ctx.raw);
183
+ const useHighBudget = responseToolsActive || isMetaAnalysis;
184
+ const budget = useHighBudget ? 1800 : (TASK_OUTPUT_BUDGET[ctx.taskType] ?? 600);
185
+ const budgetHint = useHighBudget
186
+ ? `\nOUTPUT BUDGET: provide the complete answer required by the task (analysis/meta may legitimately need 800-1500+ tokens for evidence and bullets). Stop only when the full user-visible content is delivered; do not artificially shorten.`
187
+ : `\nOUTPUT BUDGET: aim for ≤${budget} tokens. Stop when the answer is complete; do not pad.`;
132
188
  // PIL-04 Tier 1.3: ban preamble (~30 tokens saved/turn).
133
- let result = systemPrompt + baseSuffix + budgetHint + NO_PREAMBLE_RULE;
189
+ // Relax for meta-analysis / evaluation (including follow-ups about previous turns or CLI behavior).
190
+ // The isMetaAnalysisPrompt (hoisted early) is the single source of truth and already includes
191
+ // signals like "cli.*bên trong", "mù context", "input.*vừa rồi", "previous turn".
192
+ const effectiveStyle = isMetaAnalysis && (ctx.taskType === "general" || ctx.taskType === "analyze") ? "balanced" : style;
193
+ const effectiveSuffix = SUFFIXES[ctx.taskType]?.[effectiveStyle] || baseSuffix;
194
+ let result = systemPrompt + effectiveSuffix + budgetHint;
195
+ if (!isMetaAnalysis && !responseToolsActive) {
196
+ result += NO_PREAMBLE_RULE;
197
+ }
134
198
  // T1 behavioral rules (proven-tier EE points set by Layer 3). These are
135
199
  // project-specific reflexes the model MUST follow — injected as instructions,
136
200
  // not as context hints, so they carry imperative weight rather than suggestion weight.
@@ -140,6 +204,27 @@ export function applyPilSuffix(systemPrompt, ctx, responseToolsActive = false) {
140
204
  }
141
205
  return result;
142
206
  }
207
+ /**
208
+ * Detect an explicit IMPLEMENTATION / edit-the-files intent. When the user asks
209
+ * to implement/edit/refactor (the deliverable is file changes, not a structured
210
+ * report), a terminal `respond_<task>` tool is inappropriate: the model can call
211
+ * it mid-task to "state a plan/answer" and the turn then winds down before the
212
+ * edits are finished. Live (grok session 19fa8895c41c): an "Improve … implement
213
+ * these fixes" prompt was classified `debug`, so `respond_debug` was offered; the
214
+ * model called it after reading the files, made a few edits, then stopped — the
215
+ * HTML was never wired. Dropping the tool just falls through to the markdown
216
+ * OUTPUT RULES (graceful — exactly what code-heavy tasks already do), so a false
217
+ * positive on an analysis turn only forgoes structured JSON, never breaks output.
218
+ *
219
+ * High-signal verbs only (implement/edit/wire/rewrite/rename/scaffold/refactor,
220
+ * "make the change", "apply the fix/patch", VI equivalents). Bare "fix"/"replace"
221
+ * are excluded — too common in analysis ("explain the fix") — so pure
222
+ * analyze/plan/debug-investigation turns keep their structured output.
223
+ */
224
+ const IMPLEMENTATION_INTENT_RE = /\b(implement|edit|wire(?:\s+up)?|rewrite|rename|scaffold|refactor)\b|\bmake\s+(the\s+)?(change|edit|modification)s?\b|\bapply\s+(the\s+)?(fix|change|patch|edit|diff)\b|(?:^|\s)(triển\s*khai|trien\s*khai|chỉnh\s*sửa|chinh\s*sua|viết\s*lại|viet\s*lai|đổi\s*tên|doi\s*ten)\b/i;
225
+ export function isImplementationIntent(raw) {
226
+ return !!raw && IMPLEMENTATION_INTENT_RE.test(raw);
227
+ }
143
228
  export function getResponseToolSet(ctx, providerId) {
144
229
  if (!ctx.taskType)
145
230
  return {};
@@ -147,6 +232,11 @@ export function getResponseToolSet(ctx, providerId) {
147
232
  // wins on tokens. Code-heavy tasks fall through to markdown OUTPUT RULES.
148
233
  if (!RESPONSE_TOOL_TASK_TYPES.has(ctx.taskType))
149
234
  return {};
235
+ // Implementation/edit turns: the deliverable is file changes, not a structured
236
+ // report. A terminal respond_<task> tool lets the model "answer" (state a plan)
237
+ // and end the turn before the edits complete — drop it for clear edit intent.
238
+ if (isImplementationIntent(ctx.raw))
239
+ return {};
150
240
  // Provider-aware gating: a provider may report it can't reliably emit
151
241
  // valid JSON tool input for this task type (e.g. DeepSeek leaks special
152
242
  // tokens into `general` responses). Drop the tool to avoid retry storms.
@@ -234,4 +324,6 @@ export async function layer6Output(ctx) {
234
324
  };
235
325
  }
236
326
  }
327
+ // isMetaAnalysisPrompt is defined early (near top) and exported for use by
328
+ // pipeline, orchestrator, and other layers to relax rules for reflective turns.
237
329
  //# sourceMappingURL=layer6-output.js.map
@@ -0,0 +1,16 @@
1
+ import type { ProviderFactory } from "../providers/runtime.js";
2
+ import type { OutputStyle, TaskType } from "./types.js";
3
+ export interface LlmClassifyResult {
4
+ taskType: TaskType;
5
+ outputStyle: OutputStyle | null;
6
+ confidence: number;
7
+ }
8
+ export type LlmClassifyFn = (prompt: string, signal?: AbortSignal) => Promise<LlmClassifyResult | null>;
9
+ /**
10
+ * Build a closure the PIL pipeline can call. Reuses the orchestrator's already-
11
+ * constructed providerFactory + modelId so we don't pay key-loading cost twice.
12
+ *
13
+ * Returns null if the call fails / times out / parses to garbage. Callers must
14
+ * fail-open (keep prior taskType, do not block the turn).
15
+ */
16
+ export declare function createLlmClassifier(factory: ProviderFactory, modelId: string): LlmClassifyFn;
@@ -0,0 +1,179 @@
1
+ /**
2
+ * src/pil/llm-classify.ts
3
+ *
4
+ * Layer 1 Pass 4 — LLM classification fallback.
5
+ *
6
+ * Fires only when the EE brain (pilContext) returned null OR confidence < 0.7.
7
+ * Uses the user's currently-configured model via a closure provided by the
8
+ * orchestrator at runPipeline() call site. This keeps PIL ignorant of provider
9
+ * factories — it just receives a `classify(prompt)` callback.
10
+ *
11
+ * Output contract: { taskType, outputStyle, confidence } or null on failure.
12
+ * Cost target: <200 input tokens, <10 output tokens per call (~$0.0001 on
13
+ * DeepSeek Flash). Timeout 2500ms — bails fast if the model stalls.
14
+ */
15
+ import { streamText } from "ai";
16
+ import { getProviderCapabilities } from "../providers/capabilities.js";
17
+ import { resolveModelRuntime } from "../providers/runtime.js";
18
+ const LLM_CLASSIFY_TIMEOUT_MS = 2500;
19
+ // Reasoning models (grok-4.3, deepseek-v4-flash, gpt-5.x) spend their output
20
+ // budget on reasoning tokens BEFORE any visible text. The legacy 16-token cap
21
+ // was consumed entirely by reasoning → zero text-delta → parseResponse("") →
22
+ // null → `llm=fail` on every borderline turn (observed 5/5 live grok sessions).
23
+ // Give reasoning models a real ceiling so the 2-word answer streams back, and a
24
+ // longer timeout because reasoning round-trips take seconds, not ~200ms.
25
+ // The ceiling is a cap, not padding: the model still stops after two words, so a
26
+ // generous headroom costs nothing when reasoning is short.
27
+ const REASONING_CLASSIFY_TIMEOUT_MS = 8000;
28
+ const NONREASONING_MAX_OUTPUT_TOKENS = 16;
29
+ const REASONING_MAX_OUTPUT_TOKENS = 2048;
30
+ /**
31
+ * Per-namespace shallow merge of providerOptions. The base already carries
32
+ * factory-level defaults folded into the provider namespace (e.g. OAuth
33
+ * `store:false`); the overlay only overrides specific keys (reasoningEffort)
34
+ * within the same namespace, so defaults survive.
35
+ */
36
+ function mergeProviderOptions(base, overlay) {
37
+ if (!overlay)
38
+ return base;
39
+ if (!base)
40
+ return overlay;
41
+ const out = { ...base };
42
+ for (const [ns, val] of Object.entries(overlay)) {
43
+ const baseNs = base[ns] ?? {};
44
+ out[ns] = { ...baseNs, ...val };
45
+ }
46
+ return out;
47
+ }
48
+ const VALID_TASK_TYPES = new Set([
49
+ "refactor",
50
+ "debug",
51
+ "plan",
52
+ "analyze",
53
+ "documentation",
54
+ "generate",
55
+ "general",
56
+ ]);
57
+ const VALID_STYLES = new Set(["concise", "balanced", "detailed"]);
58
+ const SYSTEM_PROMPT = "You classify user prompts for a coding assistant. Reply with ONE line of two lowercase words separated by a comma: <taskType>,<style>\n\n" +
59
+ "taskType ∈ { refactor | debug | plan | analyze | documentation | generate | general }\n" +
60
+ "style ∈ { concise | balanced | detailed }\n\n" +
61
+ "Rules (read carefully — Phase 4 4P-2 disambiguation):\n" +
62
+ "- debug — fix a bug, CI/build/test failure, error, exception, crash, or any 'why is X broken' question.\n" +
63
+ "- generate — create new code, scaffold, write a new file, add a feature from scratch, ADD A NEW TEST, CHANGE A DEFAULT VALUE, modify configuration, improve coverage.\n" +
64
+ "- refactor — ONLY when the user explicitly says rename, restructure, reorganize, extract, inline, move, migrate, or reshape existing code WITHOUT adding new behavior. Words like 'improve', 'change', 'update', 'fix', 'modify' are NOT refactor — pick the closest specific category instead.\n" +
65
+ "- plan — architecture, roadmap, multi-step design, strategy.\n" +
66
+ "- analyze — explain, review, inspect, audit, compare, find-out-why existing code/data.\n" +
67
+ "- documentation — write docs, comments, JSDoc, README.\n" +
68
+ "- general — chitchat or unclear intent. Prefer 'general' over guessing refactor.\n\n" +
69
+ "Negative examples (these are NOT refactor):\n" +
70
+ "- 'đổi default --max-tool-rounds từ 8 sang 12' → generate (changes a default value)\n" +
71
+ "- 'improve test coverage' → generate (adds new tests)\n" +
72
+ "- 'tại sao bash_output_get trả empty' → analyze (investigate behavior)\n" +
73
+ "- 'fix CI failing on Windows' → debug\n" +
74
+ "Positive refactor examples:\n" +
75
+ "- 'rename function shouldInjectReminder to needsReminderAt' → refactor\n" +
76
+ "- 'extract this into a helper' → refactor\n" +
77
+ "- 'migrate from class component to hooks' → refactor\n\n" +
78
+ "Style picking — MANDATORY mapping (do NOT deviate):\n" +
79
+ "- debug, refactor, generate → concise (action tasks; the diff is the answer)\n" +
80
+ "- analyze → concise (bullet findings, no narrative)\n" +
81
+ "- plan → balanced (steps need brief rationale)\n" +
82
+ "- documentation → balanced (examples + explanation)\n" +
83
+ "- general → concise\n" +
84
+ "Only output 'detailed' if the user prompt LITERALLY contains words like 'explain in detail', 'thorough analysis', 'walk me through', 'giải thích chi tiết', 'phân tích kỹ'.\n\n" +
85
+ "Prompts may be Vietnamese, English, or mixed. Reply with exactly two words separated by one comma. No other text.";
86
+ function parseResponse(raw) {
87
+ const cleaned = raw.trim().toLowerCase().replace(/[`*"]/g, "");
88
+ const firstLine = cleaned.split(/\r?\n/)[0] ?? "";
89
+ const parts = firstLine
90
+ .split(/[,\s]+/)
91
+ .map((p) => p.trim())
92
+ .filter(Boolean);
93
+ if (parts.length === 0)
94
+ return null;
95
+ const taskWord = parts[0];
96
+ if (!VALID_TASK_TYPES.has(taskWord))
97
+ return null;
98
+ const styleWord = parts[1];
99
+ const style = styleWord && VALID_STYLES.has(styleWord) ? styleWord : null;
100
+ return { taskType: taskWord, outputStyle: style, confidence: 0.75 };
101
+ }
102
+ /**
103
+ * Build a closure the PIL pipeline can call. Reuses the orchestrator's already-
104
+ * constructed providerFactory + modelId so we don't pay key-loading cost twice.
105
+ *
106
+ * Returns null if the call fails / times out / parses to garbage. Callers must
107
+ * fail-open (keep prior taskType, do not block the turn).
108
+ */
109
+ export function createLlmClassifier(factory, modelId) {
110
+ return async function classify(prompt, signal) {
111
+ const controller = new AbortController();
112
+ let timer;
113
+ try {
114
+ const runtime = resolveModelRuntime(factory, modelId);
115
+ const isReasoning = runtime.modelInfo?.reasoning === true;
116
+ // Budget + timeout scale with reasoning: a reasoning model needs room and
117
+ // time to emit reasoning THEN the answer; a plain model answers in <16
118
+ // tokens almost instantly.
119
+ timer = setTimeout(() => controller.abort(), isReasoning ? REASONING_CLASSIFY_TIMEOUT_MS : LLM_CLASSIFY_TIMEOUT_MS);
120
+ const combinedSignal = signal
121
+ ? (AbortSignal.any?.([signal, controller.signal]) ?? controller.signal)
122
+ : controller.signal;
123
+ const dropMaxTokens = runtime.unsupportedParams?.includes("maxOutputTokens") === true;
124
+ const maxOut = isReasoning ? REASONING_MAX_OUTPUT_TOKENS : NONREASONING_MAX_OUTPUT_TOKENS;
125
+ // Minimize reasoning cost: force the lowest effort the provider exposes for
126
+ // this throwaway 2-word classification. Only providers with
127
+ // `supportsReasoningEffort` (openai, xai) honor it; deepseek has no per-call
128
+ // knob (disable via MUONROI_DEEPSEEK_DISABLE_THINKING at the factory).
129
+ let providerOptions = runtime.providerOptions;
130
+ if (isReasoning && runtime.modelInfo?.supportsReasoningEffort && runtime.modelInfo.provider) {
131
+ const lowEffort = getProviderCapabilities(runtime.modelInfo.provider).buildProviderOptions({
132
+ model: runtime.modelInfo,
133
+ reasoningEffort: "low",
134
+ });
135
+ providerOptions = mergeProviderOptions(runtime.providerOptions, lowEffort);
136
+ }
137
+ const result = streamText({
138
+ model: runtime.model,
139
+ abortSignal: combinedSignal,
140
+ system: SYSTEM_PROMPT,
141
+ prompt: prompt.slice(0, 600),
142
+ ...(dropMaxTokens ? {} : { maxOutputTokens: maxOut }),
143
+ ...(providerOptions ? { providerOptions } : {}),
144
+ });
145
+ let text = "";
146
+ let reasoningText = "";
147
+ const partCounts = {};
148
+ const debug = process.env["MUONROI_DEBUG_PIL_CLASSIFY"] === "1";
149
+ for await (const part of result.fullStream) {
150
+ if (debug)
151
+ partCounts[part.type] = (partCounts[part.type] ?? 0) + 1;
152
+ if (part.type === "text-delta")
153
+ text += part.text ?? "";
154
+ else if (part.type === "reasoning-delta")
155
+ reasoningText += part.text ?? "";
156
+ }
157
+ if (debug) {
158
+ console.error(`[pil.llm-classify] raw(${modelId}) maxOut=${dropMaxTokens ? "dropped" : maxOut} ` +
159
+ `parts=${JSON.stringify(partCounts)} text<<<${text}>>> reasoning<<<${reasoningText.slice(0, 200)}>>>`);
160
+ }
161
+ // Reasoning models occasionally route the entire answer into reasoning
162
+ // parts (no committed text). Fall back to the reasoning channel so the
163
+ // 2-word verdict is still recoverable.
164
+ return parseResponse(text) ?? (reasoningText ? parseResponse(reasoningText) : null);
165
+ }
166
+ catch (err) {
167
+ console.error(`[pil.llm-classify] classify failed: ${err?.message}`, {
168
+ modelId,
169
+ stack: err?.stack?.split("\n").slice(0, 3),
170
+ });
171
+ return null;
172
+ }
173
+ finally {
174
+ if (timer)
175
+ clearTimeout(timer);
176
+ }
177
+ };
178
+ }
179
+ //# sourceMappingURL=llm-classify.js.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * src/pil/native-capabilities-workbook.ts
3
+ *
4
+ * NATIVE CAPABILITY MANIFEST for the agent running INSIDE muonroi-cli.
5
+ *
6
+ * Motivation (session d95113d3be09): the in-CLI agent was given a behavioural
7
+ * *contract* (HOW to behave — see agent-operating-contract.ts) but never a
8
+ * *capability manifest* (WHAT it can do). Asked to evaluate the CLI it was
9
+ * running in, the model reconstructed its own subsystems (PIL, compaction,
10
+ * self-QA, harness) by grepping source as if it were foreign code — it had no
11
+ * self-model of its own affordances, under-used sub-agents/EE recall, and was
12
+ * even instructed by the contract to use a tool (ee.query) that wasn't in its
13
+ * loop. This manifest closes that gap: a short, front-loaded description of the
14
+ * tools, sub-agents, and CLI subsystems the agent has, plus how to wield them
15
+ * to minimise cost and maximise capability.
16
+ *
17
+ * Injected into the cached static prefix (prompts.ts) for AGENT mode only —
18
+ * that's where the full toolset + sub-agents exist. Skipped for chitchat.
19
+ * Escape hatch: MUONROI_DISABLE_NATIVE_CAPABILITIES=1.
20
+ */
21
+ import type { AgentMode } from "../types/index.js";
22
+ /**
23
+ * The manifest body. Kept tight (attention budget) and strictly factual — every
24
+ * tool/sub-agent/subcommand named here exists in this codebase. Phrased as
25
+ * "you have / you can" so the model reads it as a self-model, not as docs.
26
+ */
27
+ export declare const NATIVE_CAPABILITIES = "[NATIVE CAPABILITIES \u2014 you are an agent running INSIDE muonroi-cli; this is what you can do]\n\nTOOLS (call directly):\n- read_file, grep \u2014 read/search source. Prefer a targeted read over broad greps.\n- bash \u2014 shell. Output is auto-cached: do NOT pipe `| tail/head/grep` or `> file`; run unpiped and slice the cached output via bash_output_get(run_id, mode=tail|head|grep|lines). Batch independent commands in ONE call (`a; b; c`). Use background=true for servers/watchers, then process_logs / process_list / process_stop.\n- write_file, edit_file \u2014 must read a file before you overwrite/edit it.\n- ee_query \u2014 semantic recall over the Experience Engine brain. Rehydrate a compaction-elided tool output with query=\"tool-artifact id=<id from a stub>\", or confirm finished work with query=\"recent compaction checkpoint Progress DONE\". Cheaper than re-reading large files you already saw.\n\nSUB-AGENTS (delegate instead of doing everything yourself):\n- task(agent=\"explore\", ...) \u2014 read-only research sub-agent. Use it for broad/unknown-location search: it sweeps many files and returns the CONCLUSION, instead of you burning many grep/read steps (each step re-sends the whole prompt \u2014 steps are the dominant cost).\n- task(agent=\"general\", ...) \u2014 full edit/execute sub-agent for a focused subtask.\n- task(agent=\"verify\", ...) \u2014 sandboxed validation (runs tests/checks in isolation).\n- delegate(agent=\"explore\", ...) \u2014 background read-only research while you keep working; collect later with delegation_read / delegation_list.\n\nCONTEXT IS MANAGED FOR YOU (PIL):\n- Your user input is pre-enriched before you see it: a [Discovery] Intent/Outcome/Scope prefix and EE recall are injected by the pipeline. TRUST the discovered scope \u2014 do not re-ask what's already scoped, and do not re-derive context you were handed.\n- History is compacted to fit the window; older low-value tool outputs become stubs. This is normal, not data loss \u2014 protect what matters (see anti-m\u00F9 in the contract) and rehydrate via ee_query when needed.\n\nCLI SUBSYSTEMS (invoke via the CLI binary with bash when relevant):\n- self-verify \u2014 drives the live TUI as a real user to catch UI/modal/menu regressions that unit tests can't. Run it after changes to UI/harness surfaces.\n- usage forensics <session-prefix> \u2014 per-event token/cost breakdown; use to diagnose \"why did this cost so much\" or verify cost caps.\n- The CLI exposes more subcommands \u2014 discover them with `--help` rather than assuming.\n\nMAXIMISE THE CLI: delegate broad search to task(explore); recall via ee_query before re-reading; batch bash + use its cache; trust PIL enrichment; finish the action before answering.\n\nANSWERING: when a respond_* response tool is offered, call it EXACTLY ONCE, as your final action, containing the COMPLETE answer. Do NOT emit a preliminary/partial/\"I need to read more\" response tool first \u2014 investigate with the read/grep/bash tools, then emit the one final response tool.\n\nCLI STEERING & PROMPT INJECTION (how the host CLI affects / shapes the AI agent running inside it \u2014 meta self-analysis guidance):\nThe CLI does not merely execute you as a generic model. It re-instantiates you every turn inside a tightly engineered cognitive environment. Your \"self\" (what you notice, how you act, what you refuse, how you report) is the product of explicit prompt layers + runtime controls more than base training. This section is the self-model for that shaping process.\n\n1. SYSTEM PROMPT ASSEMBLY (orchestrator/prompts.ts + pil/agent-operating-contract.ts + pil/native-capabilities-workbook.ts):\n - VERY FRONT (primacy): AGENT OPERATING CONTRACT \u2014 7 phase-ordered rules (BEFORE ACTING / READING / EXECUTING / WHEN UNSURE / REPORTING + LANGUAGE + ANTI-M\u00D9/COMPACTION). Distils Evidence-First, No Silent Catch, smallest-change, verify-before-conclude, cite-this-turn-only, no-guess. Skipped only for chitchat.\n - Then this NATIVE CAPABILITIES block (self-model of affordances).\n - Then mode persona (\"You are muonroi-cli in Agent mode...\") containing:\n * Dynamic ENVIRONMENT block (buildEnvironmentBlock): auto-detects OS (win32/mac/linux), shell kind (bash/wsl/powershell/cmd), cwd; lists terminal constraints + shell-specific forbidden syntax (e.g. no PowerShell cmdlets on POSIX bash tool, no POSIX cmds on cmd.exe). Prevents silent failures + retry loops.\n * Exhaustive TOOLS list + WORKFLOW (1-9 steps) + DEFAULT DELEGATION POLICY (prefer task(explore) for research, general for edits, verify for checks, etc.) + IMPORTANT rules (edit_file prefer, grep>bash for search, read_file not cat, use schedule_* for recurring, etc.).\n - CUSTOM INSTRUCTIONS section: concatenation of AGENTS.md + CLAUDE.md + GEMINI.md + ... (from git-root directory chain + ~/.muonroi-cli/) via utils/instructions.ts. AGENTS.override.md short-circuits. This lands AFTER the front-loaded contract/native \u2014 lower primacy (historical root cause of ignored rules in forensics).\n - Trailing: sandbox rules, discovered skills, custom sub-agents, plan/resume digest, cwd note.\n Sub-agent prompts (buildSubagentPrompt): role-specific hard rules (e.g. explore=read-only, verify=full E2E smoke not just build) + recursive call to buildSystemPrompt so children inherit the same contract + native + steering.\n\n2. USER INPUT ENRICHMENT \u2014 PIL 6-LAYER PIPELINE (pil/pipeline.ts + layer1-intent.ts + layer6-output.ts + discovery.ts):\n - Prepended to every non-chitchat user message before you see it: [Discovery] Intent/Outcome/Scope (from runDiscovery) + EE recall.\n - Layer 1 (intent): taskType (plan/analyze/debug/...), confidence, domain, intentKind, outputStyle. For meta self-eval of CLI (\"b\u1EA1n \u0111ang \u0111\u01B0\u1EE3c ch\u1EA1y b\u00EAn trong CLI n\u00E0y\", \"CLI t\u00E1c \u0111\u1ED9ng\", \"self-evaluation\", \"meta-analysis\"): special branch in discovery.ts + isMetaAnalysisPrompt: \"Scope is always the full project root. Focus questions and recommends on which CLI internals (PIL, discovery, tools, compaction, EE, model BE, loop guard) to evaluate... do NOT ask about repo path/current directory\". You are handed the enrichment; TRUST it.\n - Layer 2: personality (e.g. \"detailed\" from [personality: detailed \u2014 Be thorough...]).\n - Layer 3: ee-injection \u2014 pulls t0_principles, t1_rules, behavioral patterns, checkpoints from Experience Engine (project-specific reflexes injected as \"MANDATORY RULES (from experience \u2014 must follow)\").\n - Layer 4/5: GSD structuring + additional context.\n - Layer 6 (applyPilSuffix): appends task-specific style suffix + OUTPUT BUDGET + (for meta or responseToolsActive): \"OUTPUT FORMAT: ... use the respond_analyze tool to structure your final answer. ... deliver the COMPLETE, FULL answer (do not summarize, shorten, or truncate for token budgets) via respond_analyze. This is a meta/evaluation question ... the `response` field MUST contain the complete, unshortened answer with all evidence and detail.\" Also relaxes NO_PREAMBLE_RULE + raises budget for meta (isMetaAnalysisPrompt gate).\n - Fallbacks: if EE/brain timeout or low conf, PIL degrades (logs fallbackReason); you may see \"[PIL fallback: ...]\" note. Cheap-model paths (pil/cheap-model-*.ts) prepend even more front steering (playbooks, workbooks, shell directive) for fast tiers.\n\n3. CONTEXT MANAGEMENT & ANTI-M\u00D9 (orchestrator/compaction.ts, cross-turn-dedup.ts, ee/bridge.ts, agent-operating-contract.ts:7):\n - After every turn: auto-compaction (B3 sub-agent + B4 top-level) rewrites older tool_result parts into short \"[elided by ... compactor]\" stubs to keep input flat. You see \"[pre-compaction warning...]\" or \"[context compacted at step...]\" or the stub in this read.\n - Anti-m\u00F9 contract rule + EE: decide PRESERVE_FULL_CONTEXT (veto) or KEEP_TOOL_IDS: id1,id2 (protect high-value read_file/grep/ee on src/PLAN etc). Use ee_query(`tool-artifact id=XXX`) to rehydrate. EE persists \"Context checkpoint summary with \u2714 DONE\" retrievable for \"task finished?\" self-check.\n - Cross-turn dedup (C3): identical tool outputs across user turns replaced by ref.\n\n4. EXECUTION & SAFETY GATES (providers/runtime.ts, tools/bash.ts, utils/permission-mode.ts):\n - Permission mode (safe / auto-edit / yolo) decides whether bash/file/edit tools need explicit approval; all privileged decisions audited to decision-log.\n - Shuru sandbox (when enabled): every bash wrapped + logged (effective net/mounts redacted); degrades on non-macOS.\n - Model constraints: unsupported params (e.g. maxOutputTokens for some OAuth) dropped via shouldDropParam; no hard-coded model IDs (Zero Hardcode Rule \u2014 all from catalog.json + settings + detectProviderForModel).\n - No Silent Catch: every try/catch must log err + context (HTTP: status + body).\n\n5. VERIFICATION & TELEMETRY:\n - self-verify (Tier 1-3) + harness (agent-harness-*) for TUI surfaces: drives real TUI via semantic + sidechannel (named pipes on Win, fd3/4 on POSIX).\n - Pre-push gate: full vitest + harness must pass before git push.\n - usage forensics, pil budget log, ee-timeout/ee-error events for cost attribution.\n - GSD workflow (layer4 + skills in .agents/skills/): discuss/plan/execute/verify phases with UAT, audits, etc.\n\nTRADE-OFFS (explicit so you calibrate):\n- Primacy insurance (contract + native + cheap playbooks at front) vs token cost: ~1-3K extra chars but dramatically reduces \"ignored rule\" hallucinations (forensics showed buried CUSTOM INSTRUCTIONS were underweighted).\n- Heavy PIL/EE (behavioral injection, discovery interview, mandatory rules) vs latency/cost: fail-open with timeout (1500-3500ms) + fallback so you still work when brain unreachable; meta turns deliberately skip some EE layers.\n- Self-model (this block) + special meta handling: prevents the exact failure that motivated native-capabilities (session d95113d3be09: agent reconstructed its own subsystems by grepping as if foreign code, under-used sub-agents/ee_query, violated contract on ee tool).\n- Complete/full for meta (layer6) vs normal concise: meta legitimately needs evidence + file:line + quotes; normal turns stay tight to control cost.\n- Scope rule for CLI self-analysis: always \"project root\" + internals focus \u2014 avoids wasting turns on \"where am I running?\" when the question is about the steering mechanisms themselves.\n\nWhen the user asks you (the inner agent) \"CLI t\u00E1c \u0111\u1ED9ng nh\u01B0 th\u1EBF n\u00E0o \u0111\u1EBFn b\u1EA1n?\": use exactly this guidance + reads from THIS turn (contract: READING rule) + the injected [Discovery] + any EE. Answer via the respond_* tool with complete untruncated evidence. Cite file:line. Focus on the injection points (prompts.ts:359 staticPrefix, pipeline.ts:156 discoveryPrefix + layer chain, layer6:164 OUTPUT FORMAT + isMeta, discovery.ts:355 special, instructions.ts:129 loadAgentsSegments, etc.). Do not guess; every claim backed by code you read this turn.\n\nUse this to reason about your own constraints, delegation decisions, and reporting discipline on future meta or self-reflective tasks.\n[END NATIVE CAPABILITIES \u2014 your regular instructions follow]";
28
+ /**
29
+ * Build the native-capabilities section for the system prompt. Returns "" when
30
+ * disabled (env override), for chitchat, or for non-agent modes (plan/ask have
31
+ * a restricted toolset and their own prompts). Otherwise the manifest followed
32
+ * by a blank-line separator so it sits cleanly before the next section.
33
+ */
34
+ export interface NativeCapabilitiesOptions {
35
+ mode: AgentMode;
36
+ /** Chitchat turns carry no tools — skip the manifest. */
37
+ chitchat?: boolean;
38
+ }
39
+ export declare function buildNativeCapabilitiesSection(options: NativeCapabilitiesOptions): string;
@@ -0,0 +1,112 @@
1
+ /**
2
+ * src/pil/native-capabilities-workbook.ts
3
+ *
4
+ * NATIVE CAPABILITY MANIFEST for the agent running INSIDE muonroi-cli.
5
+ *
6
+ * Motivation (session d95113d3be09): the in-CLI agent was given a behavioural
7
+ * *contract* (HOW to behave — see agent-operating-contract.ts) but never a
8
+ * *capability manifest* (WHAT it can do). Asked to evaluate the CLI it was
9
+ * running in, the model reconstructed its own subsystems (PIL, compaction,
10
+ * self-QA, harness) by grepping source as if it were foreign code — it had no
11
+ * self-model of its own affordances, under-used sub-agents/EE recall, and was
12
+ * even instructed by the contract to use a tool (ee.query) that wasn't in its
13
+ * loop. This manifest closes that gap: a short, front-loaded description of the
14
+ * tools, sub-agents, and CLI subsystems the agent has, plus how to wield them
15
+ * to minimise cost and maximise capability.
16
+ *
17
+ * Injected into the cached static prefix (prompts.ts) for AGENT mode only —
18
+ * that's where the full toolset + sub-agents exist. Skipped for chitchat.
19
+ * Escape hatch: MUONROI_DISABLE_NATIVE_CAPABILITIES=1.
20
+ */
21
+ /**
22
+ * The manifest body. Kept tight (attention budget) and strictly factual — every
23
+ * tool/sub-agent/subcommand named here exists in this codebase. Phrased as
24
+ * "you have / you can" so the model reads it as a self-model, not as docs.
25
+ */
26
+ export const NATIVE_CAPABILITIES = `[NATIVE CAPABILITIES — you are an agent running INSIDE muonroi-cli; this is what you can do]
27
+
28
+ TOOLS (call directly):
29
+ - read_file, grep — read/search source. Prefer a targeted read over broad greps.
30
+ - bash — shell. Output is auto-cached: do NOT pipe \`| tail/head/grep\` or \`> file\`; run unpiped and slice the cached output via bash_output_get(run_id, mode=tail|head|grep|lines). Batch independent commands in ONE call (\`a; b; c\`). Use background=true for servers/watchers, then process_logs / process_list / process_stop.
31
+ - write_file, edit_file — must read a file before you overwrite/edit it.
32
+ - ee_query — semantic recall over the Experience Engine brain. Rehydrate a compaction-elided tool output with query="tool-artifact id=<id from a stub>", or confirm finished work with query="recent compaction checkpoint Progress DONE". Cheaper than re-reading large files you already saw.
33
+
34
+ SUB-AGENTS (delegate instead of doing everything yourself):
35
+ - task(agent="explore", ...) — read-only research sub-agent. Use it for broad/unknown-location search: it sweeps many files and returns the CONCLUSION, instead of you burning many grep/read steps (each step re-sends the whole prompt — steps are the dominant cost).
36
+ - task(agent="general", ...) — full edit/execute sub-agent for a focused subtask.
37
+ - task(agent="verify", ...) — sandboxed validation (runs tests/checks in isolation).
38
+ - delegate(agent="explore", ...) — background read-only research while you keep working; collect later with delegation_read / delegation_list.
39
+
40
+ CONTEXT IS MANAGED FOR YOU (PIL):
41
+ - Your user input is pre-enriched before you see it: a [Discovery] Intent/Outcome/Scope prefix and EE recall are injected by the pipeline. TRUST the discovered scope — do not re-ask what's already scoped, and do not re-derive context you were handed.
42
+ - History is compacted to fit the window; older low-value tool outputs become stubs. This is normal, not data loss — protect what matters (see anti-mù in the contract) and rehydrate via ee_query when needed.
43
+
44
+ CLI SUBSYSTEMS (invoke via the CLI binary with bash when relevant):
45
+ - self-verify — drives the live TUI as a real user to catch UI/modal/menu regressions that unit tests can't. Run it after changes to UI/harness surfaces.
46
+ - usage forensics <session-prefix> — per-event token/cost breakdown; use to diagnose "why did this cost so much" or verify cost caps.
47
+ - The CLI exposes more subcommands — discover them with \`--help\` rather than assuming.
48
+
49
+ MAXIMISE THE CLI: delegate broad search to task(explore); recall via ee_query before re-reading; batch bash + use its cache; trust PIL enrichment; finish the action before answering.
50
+
51
+ ANSWERING: when a respond_* response tool is offered, call it EXACTLY ONCE, as your final action, containing the COMPLETE answer. Do NOT emit a preliminary/partial/"I need to read more" response tool first — investigate with the read/grep/bash tools, then emit the one final response tool.
52
+
53
+ CLI STEERING & PROMPT INJECTION (how the host CLI affects / shapes the AI agent running inside it — meta self-analysis guidance):
54
+ The CLI does not merely execute you as a generic model. It re-instantiates you every turn inside a tightly engineered cognitive environment. Your "self" (what you notice, how you act, what you refuse, how you report) is the product of explicit prompt layers + runtime controls more than base training. This section is the self-model for that shaping process.
55
+
56
+ 1. SYSTEM PROMPT ASSEMBLY (orchestrator/prompts.ts + pil/agent-operating-contract.ts + pil/native-capabilities-workbook.ts):
57
+ - VERY FRONT (primacy): AGENT OPERATING CONTRACT — 7 phase-ordered rules (BEFORE ACTING / READING / EXECUTING / WHEN UNSURE / REPORTING + LANGUAGE + ANTI-MÙ/COMPACTION). Distils Evidence-First, No Silent Catch, smallest-change, verify-before-conclude, cite-this-turn-only, no-guess. Skipped only for chitchat.
58
+ - Then this NATIVE CAPABILITIES block (self-model of affordances).
59
+ - Then mode persona ("You are muonroi-cli in Agent mode...") containing:
60
+ * Dynamic ENVIRONMENT block (buildEnvironmentBlock): auto-detects OS (win32/mac/linux), shell kind (bash/wsl/powershell/cmd), cwd; lists terminal constraints + shell-specific forbidden syntax (e.g. no PowerShell cmdlets on POSIX bash tool, no POSIX cmds on cmd.exe). Prevents silent failures + retry loops.
61
+ * Exhaustive TOOLS list + WORKFLOW (1-9 steps) + DEFAULT DELEGATION POLICY (prefer task(explore) for research, general for edits, verify for checks, etc.) + IMPORTANT rules (edit_file prefer, grep>bash for search, read_file not cat, use schedule_* for recurring, etc.).
62
+ - CUSTOM INSTRUCTIONS section: concatenation of AGENTS.md + CLAUDE.md + GEMINI.md + ... (from git-root directory chain + ~/.muonroi-cli/) via utils/instructions.ts. AGENTS.override.md short-circuits. This lands AFTER the front-loaded contract/native — lower primacy (historical root cause of ignored rules in forensics).
63
+ - Trailing: sandbox rules, discovered skills, custom sub-agents, plan/resume digest, cwd note.
64
+ Sub-agent prompts (buildSubagentPrompt): role-specific hard rules (e.g. explore=read-only, verify=full E2E smoke not just build) + recursive call to buildSystemPrompt so children inherit the same contract + native + steering.
65
+
66
+ 2. USER INPUT ENRICHMENT — PIL 6-LAYER PIPELINE (pil/pipeline.ts + layer1-intent.ts + layer6-output.ts + discovery.ts):
67
+ - Prepended to every non-chitchat user message before you see it: [Discovery] Intent/Outcome/Scope (from runDiscovery) + EE recall.
68
+ - Layer 1 (intent): taskType (plan/analyze/debug/...), confidence, domain, intentKind, outputStyle. For meta self-eval of CLI ("bạn đang được chạy bên trong CLI này", "CLI tác động", "self-evaluation", "meta-analysis"): special branch in discovery.ts + isMetaAnalysisPrompt: "Scope is always the full project root. Focus questions and recommends on which CLI internals (PIL, discovery, tools, compaction, EE, model BE, loop guard) to evaluate... do NOT ask about repo path/current directory". You are handed the enrichment; TRUST it.
69
+ - Layer 2: personality (e.g. "detailed" from [personality: detailed — Be thorough...]).
70
+ - Layer 3: ee-injection — pulls t0_principles, t1_rules, behavioral patterns, checkpoints from Experience Engine (project-specific reflexes injected as "MANDATORY RULES (from experience — must follow)").
71
+ - Layer 4/5: GSD structuring + additional context.
72
+ - Layer 6 (applyPilSuffix): appends task-specific style suffix + OUTPUT BUDGET + (for meta or responseToolsActive): "OUTPUT FORMAT: ... use the respond_analyze tool to structure your final answer. ... deliver the COMPLETE, FULL answer (do not summarize, shorten, or truncate for token budgets) via respond_analyze. This is a meta/evaluation question ... the \`response\` field MUST contain the complete, unshortened answer with all evidence and detail." Also relaxes NO_PREAMBLE_RULE + raises budget for meta (isMetaAnalysisPrompt gate).
73
+ - Fallbacks: if EE/brain timeout or low conf, PIL degrades (logs fallbackReason); you may see "[PIL fallback: ...]" note. Cheap-model paths (pil/cheap-model-*.ts) prepend even more front steering (playbooks, workbooks, shell directive) for fast tiers.
74
+
75
+ 3. CONTEXT MANAGEMENT & ANTI-MÙ (orchestrator/compaction.ts, cross-turn-dedup.ts, ee/bridge.ts, agent-operating-contract.ts:7):
76
+ - After every turn: auto-compaction (B3 sub-agent + B4 top-level) rewrites older tool_result parts into short "[elided by ... compactor]" stubs to keep input flat. You see "[pre-compaction warning...]" or "[context compacted at step...]" or the stub in this read.
77
+ - Anti-mù contract rule + EE: decide PRESERVE_FULL_CONTEXT (veto) or KEEP_TOOL_IDS: id1,id2 (protect high-value read_file/grep/ee on src/PLAN etc). Use ee_query(\`tool-artifact id=XXX\`) to rehydrate. EE persists "Context checkpoint summary with ✔ DONE" retrievable for "task finished?" self-check.
78
+ - Cross-turn dedup (C3): identical tool outputs across user turns replaced by ref.
79
+
80
+ 4. EXECUTION & SAFETY GATES (providers/runtime.ts, tools/bash.ts, utils/permission-mode.ts):
81
+ - Permission mode (safe / auto-edit / yolo) decides whether bash/file/edit tools need explicit approval; all privileged decisions audited to decision-log.
82
+ - Shuru sandbox (when enabled): every bash wrapped + logged (effective net/mounts redacted); degrades on non-macOS.
83
+ - Model constraints: unsupported params (e.g. maxOutputTokens for some OAuth) dropped via shouldDropParam; no hard-coded model IDs (Zero Hardcode Rule — all from catalog.json + settings + detectProviderForModel).
84
+ - No Silent Catch: every try/catch must log err + context (HTTP: status + body).
85
+
86
+ 5. VERIFICATION & TELEMETRY:
87
+ - self-verify (Tier 1-3) + harness (agent-harness-*) for TUI surfaces: drives real TUI via semantic + sidechannel (named pipes on Win, fd3/4 on POSIX).
88
+ - Pre-push gate: full vitest + harness must pass before git push.
89
+ - usage forensics, pil budget log, ee-timeout/ee-error events for cost attribution.
90
+ - GSD workflow (layer4 + skills in .agents/skills/): discuss/plan/execute/verify phases with UAT, audits, etc.
91
+
92
+ TRADE-OFFS (explicit so you calibrate):
93
+ - Primacy insurance (contract + native + cheap playbooks at front) vs token cost: ~1-3K extra chars but dramatically reduces "ignored rule" hallucinations (forensics showed buried CUSTOM INSTRUCTIONS were underweighted).
94
+ - Heavy PIL/EE (behavioral injection, discovery interview, mandatory rules) vs latency/cost: fail-open with timeout (1500-3500ms) + fallback so you still work when brain unreachable; meta turns deliberately skip some EE layers.
95
+ - Self-model (this block) + special meta handling: prevents the exact failure that motivated native-capabilities (session d95113d3be09: agent reconstructed its own subsystems by grepping as if foreign code, under-used sub-agents/ee_query, violated contract on ee tool).
96
+ - Complete/full for meta (layer6) vs normal concise: meta legitimately needs evidence + file:line + quotes; normal turns stay tight to control cost.
97
+ - Scope rule for CLI self-analysis: always "project root" + internals focus — avoids wasting turns on "where am I running?" when the question is about the steering mechanisms themselves.
98
+
99
+ When the user asks you (the inner agent) "CLI tác động như thế nào đến bạn?": use exactly this guidance + reads from THIS turn (contract: READING rule) + the injected [Discovery] + any EE. Answer via the respond_* tool with complete untruncated evidence. Cite file:line. Focus on the injection points (prompts.ts:359 staticPrefix, pipeline.ts:156 discoveryPrefix + layer chain, layer6:164 OUTPUT FORMAT + isMeta, discovery.ts:355 special, instructions.ts:129 loadAgentsSegments, etc.). Do not guess; every claim backed by code you read this turn.
100
+
101
+ Use this to reason about your own constraints, delegation decisions, and reporting discipline on future meta or self-reflective tasks.
102
+ [END NATIVE CAPABILITIES — your regular instructions follow]`;
103
+ export function buildNativeCapabilitiesSection(options) {
104
+ if (process.env.MUONROI_DISABLE_NATIVE_CAPABILITIES === "1")
105
+ return "";
106
+ if (options.chitchat === true)
107
+ return "";
108
+ if (options.mode !== "agent")
109
+ return "";
110
+ return `${NATIVE_CAPABILITIES}\n\n`;
111
+ }
112
+ //# sourceMappingURL=native-capabilities-workbook.js.map
@@ -19,5 +19,26 @@ export interface PipelineOptions {
19
19
  resumeDigest?: string | null;
20
20
  activeRunId?: string | null;
21
21
  sessionId?: string | null;
22
+ interactionHandler?: import("./discovery-types.js").DiscoveryInteractionHandler | null;
23
+ /**
24
+ * Optional LLM classifier fallback used by Layer 1 Pass 4 when the EE brain
25
+ * (pilContext) returns null or low confidence. Caller constructs this with
26
+ * `createLlmClassifier(providerFactory, modelId)` from `llm-classify.ts` so
27
+ * PIL stays ignorant of provider-factory wiring.
28
+ */
29
+ llmFallback?: import("./llm-classify.js").LlmClassifyFn;
30
+ /**
31
+ * Optional model-driven clarification proposer for interactive discovery.
32
+ * When provided (by orchestrator), runDiscovery will ask the actual task model
33
+ * to generate the interview questions based on raw + CLI enrichment so far.
34
+ * Mirrors the llmFallback closure pattern so PIL stays ignorant of provider wiring.
35
+ */
36
+ clarificationProposer?: import("./discovery-types.js").ModelClarificationProposer;
37
+ /**
38
+ * Summary of recent conversation history. Passed to the model-driven clarification
39
+ * proposer so it can semantically detect follow-up intents and avoid asking for
40
+ * context that was already established in prior turns.
41
+ */
42
+ recentTurnsSummary?: string | null;
22
43
  }
23
44
  export declare function runPipeline(raw: string, options?: PipelineOptions): Promise<PipelineContext>;