@quantiya/codevibe-core 2.0.0 → 2.0.2

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 (416) hide show
  1. package/dist/__tests__/cp-5-baseline-invariants.test.d.ts +1 -0
  2. package/dist/__tests__/prompt-parser.test.d.ts +1 -0
  3. package/dist/adapter/__tests__/capabilities.test.d.ts +1 -0
  4. package/dist/adapter/__tests__/contract-conformance.test.d.ts +1 -0
  5. package/dist/adapter/__tests__/packets.test.d.ts +1 -0
  6. package/dist/adapter/__tests__/progress.test.d.ts +1 -0
  7. package/dist/adapter/__tests__/registry.test.d.ts +1 -0
  8. package/dist/adapter/__tests__/smoke/claude.smoke.test.d.ts +1 -0
  9. package/dist/adapter/__tests__/smoke/codex.smoke.test.d.ts +1 -0
  10. package/dist/adapter/__tests__/smoke/gemini.smoke.test.d.ts +1 -0
  11. package/dist/adapter/capabilities.d.ts +68 -0
  12. package/dist/adapter/index.d.ts +7 -0
  13. package/dist/adapter/packets.d.ts +129 -0
  14. package/dist/adapter/progress.d.ts +93 -0
  15. package/dist/adapter/registry.d.ts +91 -0
  16. package/dist/adapter/types.d.ts +22 -0
  17. package/dist/appsync/__tests__/appsync-client-apply-user-decision.test.d.ts +1 -0
  18. package/dist/appsync/__tests__/appsync-client-classb.test.d.ts +1 -0
  19. package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
  20. package/dist/appsync/__tests__/appsync-client-planner.test.d.ts +1 -0
  21. package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
  22. package/dist/appsync/__tests__/appsync-client.test.d.ts +1 -0
  23. package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
  24. package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
  25. package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
  26. package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
  27. package/dist/appsync/appsync-client.d.ts +1025 -2
  28. package/dist/appsync/event-throttle.d.ts +28 -0
  29. package/dist/appsync/index.d.ts +4 -1
  30. package/dist/appsync/queries.d.ts +34 -0
  31. package/dist/audit-keys/index.d.ts +32 -0
  32. package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
  33. package/dist/auth/auth-service.d.ts +32 -2
  34. package/dist/auth/auth-telemetry.d.ts +117 -6
  35. package/dist/auth/index.d.ts +1 -0
  36. package/dist/companion-mode/__tests__/persist-preference.test.d.ts +1 -0
  37. package/dist/companion-mode/__tests__/resolve-agent.test.d.ts +1 -0
  38. package/dist/companion-mode/agent-picker.d.ts +9 -0
  39. package/dist/companion-mode/index.d.ts +55 -0
  40. package/dist/companion-mode/persist-preference.d.ts +24 -0
  41. package/dist/companion-mode/resolve-agent.d.ts +41 -0
  42. package/dist/config/config.d.ts +8 -1
  43. package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
  44. package/dist/continuation/__tests__/integration.test.d.ts +1 -0
  45. package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
  46. package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
  47. package/dist/continuation/__tests__/parity.test.d.ts +1 -0
  48. package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
  49. package/dist/continuation/dirty-state-collector.d.ts +46 -0
  50. package/dist/continuation/index.d.ts +8 -0
  51. package/dist/continuation/packet-reader.d.ts +33 -0
  52. package/dist/continuation/packet-writer.d.ts +86 -0
  53. package/dist/continuation/types.d.ts +239 -0
  54. package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
  55. package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
  56. package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
  57. package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
  58. package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
  59. package/dist/credential-broker/audit-sink.d.ts +69 -0
  60. package/dist/credential-broker/broker-config.d.ts +39 -0
  61. package/dist/credential-broker/broker-token.d.ts +123 -0
  62. package/dist/credential-broker/broker.d.ts +165 -0
  63. package/dist/credential-broker/canonical.d.ts +119 -0
  64. package/dist/credential-broker/index.d.ts +15 -0
  65. package/dist/credential-broker/scrubber.d.ts +45 -0
  66. package/dist/credential-broker/types.d.ts +141 -0
  67. package/dist/credential-broker/upstream-client.d.ts +20 -0
  68. package/dist/credential-broker/vendor-key-store.d.ts +54 -0
  69. package/dist/index.d.ts +17 -4
  70. package/dist/index.js +559 -55
  71. package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
  72. package/dist/keychain/keychain-backend.d.ts +82 -0
  73. package/dist/keychain/keychain-manager.d.ts +16 -2
  74. package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
  75. package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
  76. package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
  77. package/dist/local-executor/__tests__/authority-symlink-fixture.d.ts +15 -0
  78. package/dist/local-executor/__tests__/authority.test.d.ts +1 -0
  79. package/dist/local-executor/__tests__/class-a-emit.test.d.ts +1 -0
  80. package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
  81. package/dist/local-executor/__tests__/class-b-consumer.integration.test.d.ts +1 -0
  82. package/dist/local-executor/__tests__/class-b-consumer.test.d.ts +1 -0
  83. package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
  84. package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
  85. package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
  86. package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
  87. package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
  88. package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
  89. package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
  90. package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
  91. package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
  92. package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
  93. package/dist/local-executor/__tests__/hook-bridge.test.d.ts +1 -0
  94. package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
  95. package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
  96. package/dist/local-executor/__tests__/local-executor.integration.test.d.ts +1 -0
  97. package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
  98. package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
  99. package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
  100. package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
  101. package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
  102. package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
  103. package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
  104. package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
  105. package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
  106. package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
  107. package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
  108. package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
  109. package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
  110. package/dist/local-executor/__tests__/spawn.test.d.ts +1 -0
  111. package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
  112. package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
  113. package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
  114. package/dist/local-executor/__tests__/verification-runner.test.d.ts +1 -0
  115. package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
  116. package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
  117. package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
  118. package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
  119. package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
  120. package/dist/local-executor/agentic-resolve.d.ts +54 -0
  121. package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
  122. package/dist/local-executor/authority.d.ts +61 -0
  123. package/dist/local-executor/class-a-emit.d.ts +140 -0
  124. package/dist/local-executor/class-a-sign.d.ts +57 -0
  125. package/dist/local-executor/class-b-consumer.d.ts +276 -0
  126. package/dist/local-executor/class-b-verify.d.ts +30 -0
  127. package/dist/local-executor/class1-reconcilers.d.ts +58 -0
  128. package/dist/local-executor/class2-resolver.d.ts +74 -0
  129. package/dist/local-executor/confined-model-caller.d.ts +39 -0
  130. package/dist/local-executor/conflict-classifier.d.ts +21 -0
  131. package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
  132. package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
  133. package/dist/local-executor/conflict-types.d.ts +86 -0
  134. package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
  135. package/dist/local-executor/durable-store.d.ts +334 -0
  136. package/dist/local-executor/git-lock-retry.d.ts +40 -0
  137. package/dist/local-executor/hook-bridge.d.ts +36 -0
  138. package/dist/local-executor/implementor-argv.d.ts +183 -0
  139. package/dist/local-executor/index.d.ts +49 -0
  140. package/dist/local-executor/local-executor-impl.d.ts +724 -0
  141. package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
  142. package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
  143. package/dist/local-executor/merge-journal-store.d.ts +311 -0
  144. package/dist/local-executor/merge-train.d.ts +713 -0
  145. package/dist/local-executor/promote-wal-store.d.ts +301 -0
  146. package/dist/local-executor/resolution-set-index.d.ts +51 -0
  147. package/dist/local-executor/revert-reconcile.d.ts +89 -0
  148. package/dist/local-executor/revert-runner.d.ts +17 -0
  149. package/dist/local-executor/shared-contract-detector.d.ts +57 -0
  150. package/dist/local-executor/spawn.d.ts +34 -0
  151. package/dist/local-executor/task-group-types.d.ts +346 -0
  152. package/dist/local-executor/team-execution-flag.d.ts +21 -0
  153. package/dist/local-executor/track-registry.d.ts +50 -0
  154. package/dist/local-executor/types.d.ts +417 -0
  155. package/dist/local-executor/verification-gates/build.d.ts +6 -0
  156. package/dist/local-executor/verification-gates/deploy-preflight.d.ts +6 -0
  157. package/dist/local-executor/verification-gates/diff-sanity.d.ts +6 -0
  158. package/dist/local-executor/verification-gates/hostile-grep.d.ts +6 -0
  159. package/dist/local-executor/verification-gates/lint.d.ts +6 -0
  160. package/dist/local-executor/verification-gates/shell-runner.d.ts +40 -0
  161. package/dist/local-executor/verification-gates/source-traceability.d.ts +6 -0
  162. package/dist/local-executor/verification-gates/tests.d.ts +6 -0
  163. package/dist/local-executor/verification-gates/typecheck.d.ts +6 -0
  164. package/dist/local-executor/verification-runner.d.ts +28 -0
  165. package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
  166. package/dist/local-executor/workspace-shadow.d.ts +290 -0
  167. package/dist/local-executor/worktree-merge.d.ts +601 -0
  168. package/dist/local-model/__tests__/installer.test.d.ts +1 -0
  169. package/dist/local-model/__tests__/manager.test.d.ts +1 -0
  170. package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
  171. package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
  172. package/dist/local-model/__tests__/state.test.d.ts +1 -0
  173. package/dist/local-model/manager.d.ts +119 -0
  174. package/dist/local-model/ollama.d.ts +27 -0
  175. package/dist/local-model/runtime.d.ts +27 -0
  176. package/dist/local-model/state.d.ts +32 -0
  177. package/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +1 -0
  178. package/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +1 -0
  179. package/dist/orchestration/__tests__/setup-save.test.d.ts +1 -0
  180. package/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +1 -0
  181. package/dist/orchestration/__tests__/setup-telemetry.test.d.ts +1 -0
  182. package/dist/orchestration/__tests__/setup-test-agents.test.d.ts +1 -0
  183. package/dist/orchestration/__tests__/setup-types.test.d.ts +1 -0
  184. package/dist/orchestration/__tests__/setup-wizard.test.d.ts +1 -0
  185. package/dist/orchestration/__tests__/v1-options.test.d.ts +1 -0
  186. package/dist/orchestration/detect-agents.d.ts +16 -2
  187. package/dist/orchestration/index.d.ts +1 -0
  188. package/dist/orchestration/orchestration-cli.d.ts +4 -1
  189. package/dist/orchestration/setup-bootstrap.d.ts +146 -0
  190. package/dist/orchestration/setup-failure-recourse.d.ts +23 -0
  191. package/dist/orchestration/setup-save.d.ts +47 -0
  192. package/dist/orchestration/setup-seat-picker.d.ts +72 -0
  193. package/dist/orchestration/setup-telemetry.d.ts +54 -0
  194. package/dist/orchestration/setup-test-agents.d.ts +108 -0
  195. package/dist/orchestration/setup-types.d.ts +141 -0
  196. package/dist/orchestration/setup-wizard.d.ts +57 -0
  197. package/dist/orchestration/v1-options.d.ts +97 -0
  198. package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
  199. package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
  200. package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
  201. package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
  202. package/dist/orchestration-shell/__tests__/cli-authority-bridge.test.d.ts +1 -0
  203. package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
  204. package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
  205. package/dist/orchestration-shell/__tests__/cli-planner-stack.test.d.ts +1 -0
  206. package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
  207. package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
  208. package/dist/orchestration-shell/__tests__/cli-singleton-enforcement.test.d.ts +1 -0
  209. package/dist/orchestration-shell/__tests__/cli-stub-session-adapter.test.d.ts +1 -0
  210. package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
  211. package/dist/orchestration-shell/__tests__/components.test.d.ts +1 -0
  212. package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
  213. package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
  214. package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
  215. package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
  216. package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
  217. package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
  218. package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
  219. package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
  220. package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
  221. package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
  222. package/dist/orchestration-shell/__tests__/emit-shell-event.test.d.ts +1 -0
  223. package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
  224. package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
  225. package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
  226. package/dist/orchestration-shell/__tests__/gate-prompts.test.d.ts +1 -0
  227. package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
  228. package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
  229. package/dist/orchestration-shell/__tests__/hostile-grep.test.d.ts +1 -0
  230. package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
  231. package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
  232. package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
  233. package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
  234. package/dist/orchestration-shell/__tests__/mode-selection.test.d.ts +1 -0
  235. package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
  236. package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
  237. package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
  238. package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
  239. package/dist/orchestration-shell/__tests__/process-markers.test.d.ts +1 -0
  240. package/dist/orchestration-shell/__tests__/reducer.test.d.ts +1 -0
  241. package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
  242. package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
  243. package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
  244. package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
  245. package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
  246. package/dist/orchestration-shell/__tests__/runOrchestrationShell-classify-dispatch.test.d.ts +1 -0
  247. package/dist/orchestration-shell/__tests__/runOrchestrationShell-planner-wiring.test.d.ts +1 -0
  248. package/dist/orchestration-shell/__tests__/runOrchestrationShell-signal.test.d.ts +1 -0
  249. package/dist/orchestration-shell/__tests__/runOrchestrationShell.test.d.ts +1 -0
  250. package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
  251. package/dist/orchestration-shell/__tests__/slash-router.test.d.ts +1 -0
  252. package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
  253. package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
  254. package/dist/orchestration-shell/__tests__/sticky-preference.test.d.ts +1 -0
  255. package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
  256. package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
  257. package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
  258. package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
  259. package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
  260. package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
  261. package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
  262. package/dist/orchestration-shell/attachments.d.ts +152 -0
  263. package/dist/orchestration-shell/audit-browser.d.ts +115 -0
  264. package/dist/orchestration-shell/audit-runner.d.ts +59 -0
  265. package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
  266. package/dist/orchestration-shell/cli.d.ts +431 -0
  267. package/dist/orchestration-shell/cli.js +44191 -0
  268. package/dist/orchestration-shell/cohort-flag.d.ts +16 -0
  269. package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
  270. package/dist/orchestration-shell/components/CodeVibeLogo.d.ts +2 -0
  271. package/dist/orchestration-shell/components/ConversationPane.d.ts +13 -0
  272. package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
  273. package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
  274. package/dist/orchestration-shell/components/GatePromptEntry.d.ts +16 -0
  275. package/dist/orchestration-shell/components/InputBar.d.ts +55 -0
  276. package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
  277. package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
  278. package/dist/orchestration-shell/components/OrchestrationApp.d.ts +129 -0
  279. package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
  280. package/dist/orchestration-shell/components/StatusBar.d.ts +20 -0
  281. package/dist/orchestration-shell/components/nodes/AdvisoryEntry.d.ts +8 -0
  282. package/dist/orchestration-shell/components/nodes/GateStatusNode.d.ts +8 -0
  283. package/dist/orchestration-shell/components/nodes/PlannerDecisionEntry.d.ts +8 -0
  284. package/dist/orchestration-shell/components/nodes/ReviewerQuorumStatusNode.d.ts +8 -0
  285. package/dist/orchestration-shell/components/nodes/SlashOutputEntry.d.ts +8 -0
  286. package/dist/orchestration-shell/components/nodes/SubagentEventEntry.d.ts +8 -0
  287. package/dist/orchestration-shell/components/nodes/UserMessageEntry.d.ts +8 -0
  288. package/dist/orchestration-shell/context-store.d.ts +389 -0
  289. package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
  290. package/dist/orchestration-shell/emit-shell-event.d.ts +64 -0
  291. package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
  292. package/dist/orchestration-shell/gate-prompts.d.ts +481 -0
  293. package/dist/orchestration-shell/index.d.ts +712 -0
  294. package/dist/orchestration-shell/ink-runtime.d.ts +84 -0
  295. package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
  296. package/dist/orchestration-shell/live-static-order.d.ts +22 -0
  297. package/dist/orchestration-shell/mode-selection.d.ts +46 -0
  298. package/dist/orchestration-shell/non-tty-fallback.d.ts +67 -0
  299. package/dist/orchestration-shell/process-markers.d.ts +12 -0
  300. package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
  301. package/dist/orchestration-shell/reducer.d.ts +8 -0
  302. package/dist/orchestration-shell/root-discovery.d.ts +25 -0
  303. package/dist/orchestration-shell/route-browse.d.ts +20 -0
  304. package/dist/orchestration-shell/slash-router.d.ts +64 -0
  305. package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
  306. package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
  307. package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
  308. package/dist/orchestration-shell/status-format.d.ts +59 -0
  309. package/dist/orchestration-shell/sticky-preference.d.ts +24 -0
  310. package/dist/orchestration-shell/store.d.ts +17 -0
  311. package/dist/orchestration-shell/task-progress.d.ts +122 -0
  312. package/dist/orchestration-shell/team-decompose.d.ts +196 -0
  313. package/dist/orchestration-shell/types.d.ts +777 -0
  314. package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
  315. package/dist/orchestration-shell/web/extract.d.ts +11 -0
  316. package/dist/orchestration-shell/web/fetch.d.ts +15 -0
  317. package/dist/orchestration-shell/web/ip.d.ts +26 -0
  318. package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
  319. package/dist/orchestration-shell/web/search.d.ts +16 -0
  320. package/dist/planner/__tests__/cache-clarification-bypass.test.d.ts +1 -0
  321. package/dist/planner/__tests__/cache.test.d.ts +1 -0
  322. package/dist/planner/__tests__/client.test.d.ts +1 -0
  323. package/dist/planner/__tests__/health-machine-transitions.test.d.ts +1 -0
  324. package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
  325. package/dist/planner/__tests__/types-zod.test.d.ts +1 -0
  326. package/dist/planner/adapter.d.ts +16 -0
  327. package/dist/planner/cache.d.ts +35 -0
  328. package/dist/planner/client.d.ts +103 -0
  329. package/dist/planner/health-state.d.ts +24 -0
  330. package/dist/planner/index.d.ts +7 -0
  331. package/dist/planner/local-advisory.d.ts +84 -0
  332. package/dist/planner/local-gemma.d.ts +23 -0
  333. package/dist/planner/types.d.ts +123 -0
  334. package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
  335. package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
  336. package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
  337. package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
  338. package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
  339. package/dist/reviewer/index.d.ts +2 -0
  340. package/dist/reviewer/output-parser.d.ts +48 -12
  341. package/dist/reviewer/provider.d.ts +107 -3
  342. package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
  343. package/dist/reviewer/providers/antigravity.d.ts +49 -0
  344. package/dist/reviewer/providers/claude.d.ts +19 -4
  345. package/dist/reviewer/providers/codex.d.ts +47 -5
  346. package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
  347. package/dist/reviewer/providers/gemini.d.ts +5 -4
  348. package/dist/reviewer/registry.d.ts +5 -5
  349. package/dist/reviewer/subprocess.d.ts +37 -0
  350. package/dist/reviewer/token-usage.d.ts +32 -0
  351. package/dist/reviewer/types.d.ts +5 -5
  352. package/dist/reviewer/verdict-classifier.d.ts +62 -0
  353. package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
  354. package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -0
  355. package/dist/session/index.d.ts +1 -0
  356. package/dist/session/prepare-event-timestamp.d.ts +30 -0
  357. package/dist/session/session-rekey.d.ts +40 -0
  358. package/dist/session/session-resume.d.ts +25 -0
  359. package/dist/structural-summary/__tests__/__fixtures__/fixture-helpers.d.ts +11 -0
  360. package/dist/structural-summary/__tests__/assembler.test.d.ts +1 -0
  361. package/dist/structural-summary/__tests__/generator.test.d.ts +1 -0
  362. package/dist/structural-summary/__tests__/language-detect.test.d.ts +1 -0
  363. package/dist/structural-summary/__tests__/manifest-parsers/cargo.test.d.ts +1 -0
  364. package/dist/structural-summary/__tests__/manifest-parsers/gomod.test.d.ts +1 -0
  365. package/dist/structural-summary/__tests__/manifest-parsers/gradle.test.d.ts +1 -0
  366. package/dist/structural-summary/__tests__/manifest-parsers/index.test.d.ts +1 -0
  367. package/dist/structural-summary/__tests__/manifest-parsers/npm.test.d.ts +1 -0
  368. package/dist/structural-summary/__tests__/manifest-parsers/podfile.test.d.ts +1 -0
  369. package/dist/structural-summary/__tests__/manifest-parsers/pyproject.test.d.ts +1 -0
  370. package/dist/structural-summary/__tests__/opt-in-store.test.d.ts +1 -0
  371. package/dist/structural-summary/__tests__/privacy-filter.test.d.ts +1 -0
  372. package/dist/structural-summary/__tests__/safe-file-read.test.d.ts +1 -0
  373. package/dist/structural-summary/__tests__/user-ignore-matcher.test.d.ts +1 -0
  374. package/dist/structural-summary/__tests__/walker.test.d.ts +1 -0
  375. package/dist/structural-summary/generator.d.ts +8 -0
  376. package/dist/structural-summary/index.d.ts +7 -0
  377. package/dist/structural-summary/manifest-parsers/cargo.d.ts +3 -0
  378. package/dist/structural-summary/manifest-parsers/index.d.ts +7 -0
  379. package/dist/structural-summary/manifest-parsers/npm.d.ts +3 -0
  380. package/dist/structural-summary/manifest-parsers/other.d.ts +17 -0
  381. package/dist/structural-summary/opt-in-store.d.ts +24 -0
  382. package/dist/structural-summary/privacy-filter.d.ts +110 -0
  383. package/dist/structural-summary/safe-file-read.d.ts +11 -0
  384. package/dist/structural-summary/types.d.ts +215 -0
  385. package/dist/structural-summary/user-ignore-matcher.d.ts +9 -0
  386. package/dist/structural-summary/walker.d.ts +20 -0
  387. package/dist/substrate/__tests__/docker.test.d.ts +1 -0
  388. package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
  389. package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
  390. package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
  391. package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
  392. package/dist/substrate/command-runner.d.ts +19 -0
  393. package/dist/substrate/docker.d.ts +134 -0
  394. package/dist/substrate/errors.d.ts +33 -0
  395. package/dist/substrate/forwarder.d.ts +67 -0
  396. package/dist/substrate/git-proxy.d.ts +35 -0
  397. package/dist/substrate/index.d.ts +12 -0
  398. package/dist/substrate/relay-script.d.ts +27 -0
  399. package/dist/substrate/sandbox-exec.d.ts +116 -0
  400. package/dist/substrate/types.d.ts +218 -0
  401. package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
  402. package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
  403. package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
  404. package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
  405. package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
  406. package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
  407. package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
  408. package/dist/substrate-launch/engage-substrate.d.ts +102 -0
  409. package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
  410. package/dist/substrate-launch/index.d.ts +12 -0
  411. package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
  412. package/dist/substrate-launch/sanitized-env.d.ts +73 -0
  413. package/dist/types/auth.d.ts +6 -1
  414. package/dist/types/events.d.ts +19 -2
  415. package/dist/types/reviewer.d.ts +6 -6
  416. package/package.json +21 -3
@@ -0,0 +1,42 @@
1
+ /** Key names that are NOT printable text — `input` is blanked for these. */
2
+ export declare const nonAlphanumericKeys: string[];
3
+ export interface ParsedKeypress {
4
+ name: string;
5
+ ctrl: boolean;
6
+ meta: boolean;
7
+ shift: boolean;
8
+ option: boolean;
9
+ sequence: string;
10
+ raw: string | undefined;
11
+ code?: string;
12
+ }
13
+ /** Verbatim port of Ink 5.2.1 `parseKeypress` (string input — Ink sets utf8). */
14
+ export declare const parseKeypress: (s?: string | undefined) => ParsedKeypress;
15
+ /** The `key` object shape Ink's `useInput` hands to its handler. */
16
+ export interface InkKey {
17
+ upArrow: boolean;
18
+ downArrow: boolean;
19
+ leftArrow: boolean;
20
+ rightArrow: boolean;
21
+ pageDown: boolean;
22
+ pageUp: boolean;
23
+ return: boolean;
24
+ escape: boolean;
25
+ ctrl: boolean;
26
+ shift: boolean;
27
+ tab: boolean;
28
+ backspace: boolean;
29
+ delete: boolean;
30
+ meta: boolean;
31
+ }
32
+ /**
33
+ * Mirror of `ink/build/hooks/use-input.js` (5.2.1) lines 46-80: derive the
34
+ * `(input, key)` pair `useInput` would deliver for a raw data chunk. The Ctrl+C
35
+ * gate + `reconciler.batchedUpdates` dispatch from use-input.js are intentionally
36
+ * NOT here — the caller owns dispatch (Ctrl+C is already handled by Ink's
37
+ * `App.handleInput` before the chunk is emitted).
38
+ */
39
+ export declare function toInkKey(data: string): {
40
+ input: string;
41
+ key: InkKey;
42
+ };
@@ -0,0 +1,11 @@
1
+ export interface ExtractResult {
2
+ title: string;
3
+ text: string;
4
+ }
5
+ /** Test seam: drop the cached parse5 load so a re-stubbed ESM loader takes effect. */
6
+ export declare function __resetExtractCacheForTest(): void;
7
+ /**
8
+ * Extract a page title + visible body text from HTML via parse5. Async (parse5 is ESM-only) and
9
+ * NEVER throws — returns `{ title:'', text:'' }` on the size cap / load / parse failure.
10
+ */
11
+ export declare function htmlToText(html: string): Promise<ExtractResult>;
@@ -0,0 +1,15 @@
1
+ export type FetchFailureKind = 'blocked' | 'too_large' | 'timeout' | 'network' | 'bad_content' | 'too_many_redirects' | 'http_error';
2
+ export declare class FetchError extends Error {
3
+ readonly kind: FetchFailureKind;
4
+ constructor(kind: FetchFailureKind, message: string);
5
+ }
6
+ export interface FetchResult {
7
+ finalUrl: string;
8
+ contentType: string;
9
+ body: string;
10
+ }
11
+ /**
12
+ * Guarded GET with manual redirect following (full guard re-run per hop). Returns
13
+ * decoded text or throws FetchError. `signal` lets the caller (Esc) abort.
14
+ */
15
+ export declare function guardedFetch(rawUrl: string, signal?: AbortSignal): Promise<FetchResult>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Canonicalize + classify an address string. Accepts only a real IPv4/IPv6
3
+ * literal (the fetch guard passes addresses from `dns.lookup`, which are
4
+ * already canonical). Returns false for anything not provably public unicast
5
+ * (fail closed). Decimal/hex/octal "IP" host forms are NOT valid `net.isIP`
6
+ * literals, so they never reach here as a resolved address — and the host-level
7
+ * guard rejects non-IP, non-DNS hosts separately.
8
+ */
9
+ export declare function isGlobalUnicastIp(addr: string): boolean;
10
+ /**
11
+ * Reject hostnames that are obviously local even before DNS, and normalize a
12
+ * literal-IP host given in a non-canonical encoding (decimal `2130706433`, hex
13
+ * `0x7f000001`, dotted-hex/octal). Returns:
14
+ * - { kind:'ip', addr } when the host is a literal IP (any encoding) → caller
15
+ * validates `isGlobalUnicastIp(addr)` directly (no DNS).
16
+ * - { kind:'name' } when it's a DNS name to resolve.
17
+ * - { kind:'reject' } for `localhost` / `*.local` / unparseable.
18
+ */
19
+ export declare function classifyHost(rawHost: string): {
20
+ kind: 'ip';
21
+ addr: string;
22
+ } | {
23
+ kind: 'name';
24
+ } | {
25
+ kind: 'reject';
26
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Strip terminal control / escape sequences from untrusted text, preserving
3
+ * only printable characters + deliberate whitespace (`\n`, `\t`, space, and CR
4
+ * which is normalized to `\n` by callers). Linear-time, single pass.
5
+ *
6
+ * Removed:
7
+ * - CSI `ESC [ … final` (cursor/screen/SGR manipulation)
8
+ * - OSC `ESC ] … (BEL | ESC \)` (e.g. OSC-52 clipboard, window title)
9
+ * - DCS/SOS/PM/APC `ESC (P|X|^|_) … ST`
10
+ * - two-char escapes `ESC <byte>` (incl. a lone trailing ESC)
11
+ * - C0 controls 0x00–0x1f EXCEPT \t (0x09) and \n (0x0a) (CR 0x0d dropped — callers normalize EOL first)
12
+ * - DEL 0x7f and C1 controls 0x80–0x9f (incl. 8-bit CSI 0x9b / OSC 0x9d)
13
+ */
14
+ export declare function sanitizeForTerminal(input: string): string;
@@ -0,0 +1,16 @@
1
+ export interface SearchResult {
2
+ url: string;
3
+ title: string;
4
+ }
5
+ /**
6
+ * Parse DDG HTML result anchors. DDG wraps targets as
7
+ * `//duckduckgo.com/l/?uddg=<encoded-target>&...`; we decode `uddg` to the real
8
+ * URL. Linear scan over anchor tags; tolerant of markup drift. Returns ≤limit
9
+ * http(s) results. NEVER throws.
10
+ */
11
+ export declare function parseDdgResults(html: string, limit?: number): SearchResult[];
12
+ /**
13
+ * Run a keyless web search. Returns ≤limit results, or [] on any failure
14
+ * (network/parse) — the caller decides the advisory. `signal` lets Esc abort.
15
+ */
16
+ export declare function webSearch(query: string, signal?: AbortSignal, limit?: number): Promise<SearchResult[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ export type { PlannerInput, PlannerDecision, PlannerProbeResult, SessionContext, BudgetHint, Clarification, CachedClassification, ClassificationKind, Tier, PlannerHealthState, PlannerHealthTransition, } from './types';
2
+ import type { PlannerInput, PlannerDecision, PlannerProbeResult } from './types';
3
+ export interface PlannerAdapter {
4
+ classify(input: PlannerInput): Promise<PlannerDecision>;
5
+ probe(): Promise<PlannerProbeResult>;
6
+ /**
7
+ * CP-1.b IMPL r2 H-3 — Bind the active session for subsequent
8
+ * `probe()` calls. Stage 2 r1 added this to `BackendPlannerClient`
9
+ * but missed declaring it on the interface, so callers — notably
10
+ * `runOrchestrationShell` — never invoked it and `probe()` threw
11
+ * "no active session" unconditionally in production.
12
+ *
13
+ * Pass `null` on session teardown to clear the binding.
14
+ */
15
+ setActiveSession(sessionId: string | null): void;
16
+ }
@@ -0,0 +1,35 @@
1
+ import type { CachedClassification } from './types';
2
+ export declare class PlannerCacheLayer {
3
+ private workflowCache;
4
+ private signatureCache;
5
+ private hydrated;
6
+ private mutex;
7
+ private cacheRoot;
8
+ constructor(cacheRoot?: string);
9
+ getWorkflowClassification(userId: string, prompt: string): Promise<CachedClassification | null>;
10
+ setWorkflowClassification(userId: string, prompt: string, c: CachedClassification): Promise<void>;
11
+ /**
12
+ * CP-1.b Stage 2 r2 M-2 — Explicit lazy-persist flush for callers
13
+ * that need to durably commit pending in-memory inserts (e.g.
14
+ * orchestration-shell on session end). LOCK #18 permits this
15
+ * trigger.
16
+ */
17
+ flush(): Promise<void>;
18
+ getSignatureClassification(userId: string, sigHash: string): CachedClassification | null;
19
+ setSignatureClassification(userId: string, sigHash: string, c: CachedClassification): void;
20
+ flushForTier(userId: string): Promise<void>;
21
+ flushAll(): Promise<void>;
22
+ purgeOnUserSwitch(newUserId: string): Promise<void>;
23
+ private hydrateWorkflowIfNeeded;
24
+ private rotateCorrupt;
25
+ private persistWorkflow;
26
+ private cacheDir;
27
+ private userIdPrefix;
28
+ private workflowFilePath;
29
+ private canonicalize;
30
+ private assertNoActionJson;
31
+ private evictLru;
32
+ private ensureCacheRoot;
33
+ private ensureDir;
34
+ private rmRecursiveSafe;
35
+ }
@@ -0,0 +1,103 @@
1
+ import type { PlannerInput, PlannerDecision, PlannerProbeResult, Tier } from './types';
2
+ import type { PlannerAdapter } from './adapter';
3
+ import type { PlannerCacheLayer } from './cache';
4
+ import type { PlannerHealthMachine } from './health-state';
5
+ /**
6
+ * AppSync transport interface. Minimal shape so unit tests can inject
7
+ * a stub without mounting the full @quantiya/codevibe-core AppSyncClient.
8
+ */
9
+ export interface PlannerAppSyncTransport {
10
+ classifyPlannerPrompt(input: {
11
+ sessionId: string;
12
+ prompt: string;
13
+ clarifications: string;
14
+ sessionContext: string;
15
+ budgetHint: string;
16
+ }): Promise<{
17
+ decision: string;
18
+ cacheHit: boolean;
19
+ cacheKind: string | null;
20
+ serverLatencyMs: number;
21
+ providerUsed: string;
22
+ }>;
23
+ pingPlanner(input: {
24
+ sessionId: string;
25
+ }): Promise<{
26
+ ok: boolean;
27
+ ms: number;
28
+ }>;
29
+ }
30
+ /**
31
+ * Crypto bridge — `encryptString` + `encryptJson` + `decryptJson`
32
+ * variants the adapter needs. Mirrors the existing
33
+ * codevibe-core CryptoService surface; injectable for tests.
34
+ */
35
+ export interface PlannerCryptoBridge {
36
+ /** Encrypt a UTF-8 string to base64 AES-GCM ciphertext. */
37
+ encryptString(plaintext: string, sessionKeyB64: string): string;
38
+ /** Decrypt base64 AES-GCM → UTF-8 string. */
39
+ decryptString(ciphertextB64: string, sessionKeyB64: string): string;
40
+ /** Encrypt JSON-serializable value → base64 ciphertext. */
41
+ encryptJson(obj: unknown, sessionKeyB64: string): string;
42
+ }
43
+ export interface SessionKeyResolver {
44
+ getSessionKey(sessionId: string): Promise<string | null>;
45
+ }
46
+ export interface ShellEventEmit {
47
+ sessionId: string;
48
+ type: 'PLANNER_DECISION' | 'PLANNER_CACHE_HIT' | 'PLANNER_DEGRADED' | 'PLANNER_OUTAGE' | 'PLANNER_RECOVERED';
49
+ metadata?: Record<string, unknown>;
50
+ }
51
+ export type EmitShellEventFn = (args: ShellEventEmit) => Promise<void>;
52
+ /**
53
+ * CP-1.b Stage 2 r2 M-3 — Typed errors that must NOT degrade health.
54
+ *
55
+ * The Lambda surfaces tier-gate / budget rejections as named-error
56
+ * GraphQL responses. Stage 2 r1's catch block recorded EVERY failure
57
+ * as a provider-health failure via `health.recordCall(elapsed, false)`,
58
+ * incorrectly driving the health machine toward Degraded/Outage on
59
+ * what are user-tier policy events (not provider outages). The
60
+ * client now classifies errors and ONLY records provider failures
61
+ * against health; tier/budget rejections emit NOTIFICATION events
62
+ * and throw without touching the machine.
63
+ */
64
+ export declare class PlannerBudgetExceededError extends Error {
65
+ constructor(msg: string);
66
+ }
67
+ export declare class PlannerTierGateRejectedError extends Error {
68
+ constructor(msg: string);
69
+ }
70
+ export declare class BackendPlannerClient implements PlannerAdapter {
71
+ private transport;
72
+ private cache;
73
+ private health;
74
+ private crypto;
75
+ private sessionKeyResolver;
76
+ private emitShellEvent;
77
+ /** Shell-side tier-change detection (LOCK #30). */
78
+ lastClassifyTier: Tier | null;
79
+ /**
80
+ * CP-1.b Stage 2 r2 M-4 — Active session for probe(). The probe
81
+ * mutation requires a sessionId for ownership check; carrying the
82
+ * session in client state lets callers use the canonical
83
+ * `PlannerAdapter.probe()` contract. Set via `setActiveSession()`
84
+ * by orchestration-shell on session start.
85
+ */
86
+ private activeSessionId;
87
+ constructor(transport: PlannerAppSyncTransport, cache: PlannerCacheLayer, health: PlannerHealthMachine, crypto: PlannerCryptoBridge, sessionKeyResolver: SessionKeyResolver, emitShellEvent: EmitShellEventFn);
88
+ /**
89
+ * CP-1.b Stage 2 r2 M-4 — Set the active session ID used by
90
+ * `probe()`. Called by the orchestration-shell on session start
91
+ * (and cleared to `null` on session end).
92
+ */
93
+ setActiveSession(sessionId: string | null): void;
94
+ classify(input: PlannerInput): Promise<PlannerDecision>;
95
+ /**
96
+ * CP-1.b Stage 2 r2 M-4 — Honor the `PlannerAdapter.probe()`
97
+ * contract by reading the session from client state (set via
98
+ * `setActiveSession()`). Stage 2 r1 threw unconditionally and
99
+ * required callers to use the now-removed `probeWithSession()`
100
+ * method, which violated the adapter interface.
101
+ */
102
+ probe(): Promise<PlannerProbeResult>;
103
+ }
@@ -0,0 +1,24 @@
1
+ import type { PlannerHealthState, PlannerHealthTransition } from './types';
2
+ export type { PlannerHealthState, PlannerHealthTransition };
3
+ export declare class PlannerHealthMachine {
4
+ private emitFn;
5
+ state: PlannerHealthState;
6
+ consecutiveFailures: number;
7
+ consecutiveSuccesses: number;
8
+ recentLatenciesMs: number[];
9
+ private readonly URGENT_FAILURE_FOR_DEGRADE;
10
+ private readonly P95_DEGRADE_THRESHOLD_MS;
11
+ private readonly P95_RECOVER_THRESHOLD_MS;
12
+ private readonly DEGRADED_TO_OUTAGE_FAILURES;
13
+ private readonly RECOVER_SUCCESSES_NEEDED;
14
+ private readonly RING_BUFFER_SIZE;
15
+ private readonly DEGRADED_PROBE_INTERVAL_MS;
16
+ private readonly OUTAGE_PROBE_INTERVAL_MS;
17
+ private lastProbeAt;
18
+ constructor(emitFn: (transition: PlannerHealthTransition) => void);
19
+ recordCall(latencyMs: number, success: boolean): PlannerHealthState;
20
+ shouldProbe(): boolean;
21
+ markProbeFired(): void;
22
+ private deriveNextState;
23
+ private p95Of;
24
+ }
@@ -0,0 +1,7 @@
1
+ export * from './types';
2
+ export * from './adapter';
3
+ export { PlannerCacheLayer } from './cache';
4
+ export { PlannerHealthMachine } from './health-state';
5
+ export { BackendPlannerClient, PlannerBudgetExceededError, PlannerTierGateRejectedError, type PlannerAppSyncTransport, type PlannerCryptoBridge, type SessionKeyResolver, type ShellEventEmit, type EmitShellEventFn, } from './client';
6
+ export { LocalGemmaPlannerAdapter, parseLocalGemmaPlannerDecision, renderLocalGemmaPlannerPrompt, type LocalGemmaPlannerRunner, } from './local-gemma';
7
+ export { parseLocalGemmaAdvisorySummary, renderLocalGemmaFamiliarizePrompt, type LocalGemmaAdvisoryRunner, } from './local-advisory';
@@ -0,0 +1,84 @@
1
+ import type { StructuralSummary } from '../structural-summary/types';
2
+ export interface LocalGemmaAdvisoryRunner {
3
+ generateAdvisory(promptText: string, options?: LocalGemmaAdvisoryOptions): Promise<string>;
4
+ runtimeLabel: string;
5
+ }
6
+ export type LocalGemmaAdvisoryResponseFormat = 'json' | 'text';
7
+ export interface LocalGemmaAdvisoryOptions {
8
+ responseFormat?: LocalGemmaAdvisoryResponseFormat;
9
+ numPredict?: number;
10
+ /**
11
+ * RAW base64 images (NO `data:` prefix) for the MULTIMODAL local answerer
12
+ * (IMAGE-ATTACHMENT-DESIGN.md §6). Set ONLY by the shell's `routeAdvisory` /
13
+ * image-brainstorm with `responseFormat:'text'`. The Ollama runtime forwards
14
+ * these to `/api/generate images[]`; the subprocess `LocalGemmaProcessRunner`
15
+ * has no image channel and IGNORES them (documented no-op, §6 Role B). NEVER set
16
+ * on the classifier (forced-JSON) or on `browse`/`familiarize`.
17
+ */
18
+ images?: string[];
19
+ }
20
+ export declare function redactAbsoluteLocalPaths(text: string): string;
21
+ export declare function renderLocalGemmaFamiliarizePrompt(args: {
22
+ userPrompt: string;
23
+ summary: StructuralSummary;
24
+ }): string;
25
+ /**
26
+ * WEB-BROWSING (docs/WEB-BROWSING-DESIGN.md): build the advisory prompt for a
27
+ * fetched web page. The model ANSWERS THE USER'S QUESTION grounded in the fetched
28
+ * content. `content`/`title`/`url` are ALREADY terminal-sanitized by the caller;
29
+ * here we additionally treat them as untrusted DATA in the prompt.
30
+ *
31
+ * Dogfood-tuned against the real local model (see MAX_BROWSE_CONTENT_CHARS): the prompt
32
+ * is deliberately CONCISE + title-pointing — a long, heavily-instructed prompt makes the
33
+ * small model WORSE (it ignores the answer and over-cautiously refuses or invents). The
34
+ * model answers in PROSE (caller uses responseFormat:'text'); `parseLocalGemmaBrowseSummary`
35
+ * tolerates either prose or JSON. The title/content stay in the JSON DATA payload (escaped
36
+ * — also defeats label-spoofing) and are NEVER interpolated into the instruction prose.
37
+ *
38
+ * Budget: cap title/url/userPrompt + content (lead), then SHRINK on ACTUAL rendered length
39
+ * (JSON.stringify can expand quote/backslash-heavy text) so the emitted JSON stays valid.
40
+ */
41
+ export declare function renderLocalGemmaBrowsePrompt(args: {
42
+ userPrompt: string;
43
+ source: {
44
+ url: string;
45
+ title: string;
46
+ };
47
+ content: string;
48
+ }): string;
49
+ /**
50
+ * WEB-BROWSING (search-route): turn the user's request + recent conversation into a
51
+ * concise web-search QUERY. The local model resolves acronyms/pronouns from context
52
+ * (e.g. "do a web search on ACP" + a prior turn defining "Agent Client Protocol" →
53
+ * "ACP Agent Client Protocol") — replacing the old brittle regex that searched the raw
54
+ * command sentence. Dogfood-validated against the real local model (gemma4 8B): produces
55
+ * context-aware terms, and clean terms when there's no useful context.
56
+ *
57
+ * The output is a short keyword string used ONLY as a DDG search query — the caller
58
+ * sanitizes + path-redacts + caps it. Prior turns are the user's OWN conversation (already
59
+ * sanitized at ingest); the prompt asks for a query only and is framed as untrusted data.
60
+ */
61
+ export declare function renderLocalGemmaSearchQueryPrompt(args: {
62
+ userPrompt: string;
63
+ priorTurns?: string[];
64
+ }): string;
65
+ export declare function renderLocalGemmaBrainstormPrompt(args: {
66
+ userPrompt: string;
67
+ summary?: StructuralSummary | null;
68
+ priorTurns?: string[];
69
+ }): string;
70
+ export declare function brainstormPromptRequestsCommandGuidance(text: string): boolean;
71
+ /**
72
+ * WEB-BROWSING (search-route hardening): a LENIENT summary parse for the browse
73
+ * route. Unlike `parseLocalGemmaAdvisorySummary` (which hard-rejects any key
74
+ * besides `summary`), the model summarizing a content-rich page often adds extra
75
+ * keys (`version`, `key_points`, …) — that should NOT hard-fail the answer. We
76
+ * extract `summary` if present, else the longest string field, else the
77
+ * stringified object as a last resort; then redact + cap. Throws only if there's
78
+ * genuinely no usable text. The browse caller now uses `{responseFormat:'text'}`, so
79
+ * PROSE (the raw-text fallback) is the common path; a JSON object is still tolerated if
80
+ * the model emits one.
81
+ */
82
+ export declare function parseLocalGemmaBrowseSummary(raw: string): string;
83
+ export declare function parseLocalGemmaAdvisorySummary(raw: string): string;
84
+ export declare function parseLocalGemmaBrainstormSummary(raw: string): string;
@@ -0,0 +1,23 @@
1
+ import type { PlannerAdapter } from './adapter';
2
+ import type { LocalGemmaAdvisoryRunner } from './local-advisory';
3
+ import type { PlannerDecision, PlannerInput, PlannerProbeResult } from './types';
4
+ export interface LocalGemmaPlannerRunner {
5
+ classify(promptText: string): Promise<string>;
6
+ generateAdvisory?: LocalGemmaAdvisoryRunner['generateAdvisory'];
7
+ probe?(): Promise<PlannerProbeResult>;
8
+ runtimeLabel: string;
9
+ }
10
+ /**
11
+ * Text-only route classifier prompt. It intentionally excludes repository
12
+ * paths, summaries, source snippets, file bodies, and the raw structural digest.
13
+ */
14
+ export declare function renderLocalGemmaPlannerPrompt(input: PlannerInput): string;
15
+ export declare function parseLocalGemmaPlannerDecision(raw: string): PlannerDecision;
16
+ export declare class LocalGemmaPlannerAdapter implements PlannerAdapter {
17
+ private readonly runner;
18
+ private activeSessionId;
19
+ constructor(runner: LocalGemmaPlannerRunner);
20
+ classify(input: PlannerInput): Promise<PlannerDecision>;
21
+ probe(): Promise<PlannerProbeResult>;
22
+ setActiveSession(sessionId: string | null): void;
23
+ }
@@ -0,0 +1,123 @@
1
+ import { z } from 'zod';
2
+ export type Tier = 'FREE' | 'PRO' | 'MAX';
3
+ export interface SessionContext {
4
+ sessionId: string;
5
+ userId: string;
6
+ tier: Tier;
7
+ currentTaskState: 'none' | 'in_progress' | 'awaiting_user' | 'awaiting_review' | 'merge_gate_pending';
8
+ structuralSummaryDigest: string;
9
+ recentEventCount: number;
10
+ }
11
+ export declare const SessionContextSchema: z.ZodObject<{
12
+ sessionId: z.ZodString;
13
+ userId: z.ZodString;
14
+ tier: z.ZodEnum<["FREE", "PRO", "MAX"]>;
15
+ currentTaskState: z.ZodEnum<["none", "in_progress", "awaiting_user", "awaiting_review", "merge_gate_pending"]>;
16
+ structuralSummaryDigest: z.ZodString;
17
+ recentEventCount: z.ZodNumber;
18
+ }, "strip", z.ZodTypeAny, {
19
+ sessionId: string;
20
+ userId: string;
21
+ tier: "FREE" | "PRO" | "MAX";
22
+ currentTaskState: "none" | "merge_gate_pending" | "in_progress" | "awaiting_user" | "awaiting_review";
23
+ structuralSummaryDigest: string;
24
+ recentEventCount: number;
25
+ }, {
26
+ sessionId: string;
27
+ userId: string;
28
+ tier: "FREE" | "PRO" | "MAX";
29
+ currentTaskState: "none" | "merge_gate_pending" | "in_progress" | "awaiting_user" | "awaiting_review";
30
+ structuralSummaryDigest: string;
31
+ recentEventCount: number;
32
+ }>;
33
+ export interface BudgetHint {
34
+ wallClockMsRemaining: number;
35
+ reviseAttempts: number;
36
+ }
37
+ export declare const BudgetHintSchema: z.ZodObject<{
38
+ wallClockMsRemaining: z.ZodNumber;
39
+ reviseAttempts: z.ZodNumber;
40
+ }, "strip", z.ZodTypeAny, {
41
+ wallClockMsRemaining: number;
42
+ reviseAttempts: number;
43
+ }, {
44
+ wallClockMsRemaining: number;
45
+ reviseAttempts: number;
46
+ }>;
47
+ export interface Clarification {
48
+ question: string;
49
+ answer: string;
50
+ }
51
+ export declare const ClarificationSchema: z.ZodObject<{
52
+ question: z.ZodString;
53
+ answer: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ question: string;
56
+ answer: string;
57
+ }, {
58
+ question: string;
59
+ answer: string;
60
+ }>;
61
+ export interface PlannerInput {
62
+ prompt: string;
63
+ clarifications: Clarification[];
64
+ sessionContext: SessionContext;
65
+ budgetHint: BudgetHint;
66
+ }
67
+ export interface PlannerDecision {
68
+ action: 'start_task' | 'summarize_current_status' | 'advisory_response' | 'ask_user' | 'refuse' | 'team_decompose' | 'familiarize' | 'brainstorm' | 'browse';
69
+ rationale: string;
70
+ clarifying_question?: string;
71
+ advisory_summary?: string;
72
+ /** WEB-BROWSING — explicit http(s) URLs to read (validated/guarded downstream). */
73
+ browseUrls?: string[];
74
+ /** WEB-BROWSING — a web-search query when no explicit URL is given. */
75
+ browseQuery?: string;
76
+ /** Opaque per parent §6 lines 967-972; CP-1 NEVER inspects fields. */
77
+ gateRequest?: Record<string, unknown>;
78
+ }
79
+ export declare const PlannerDecisionSchema: z.ZodObject<{
80
+ action: z.ZodEnum<["start_task", "summarize_current_status", "advisory_response", "ask_user", "refuse", "team_decompose", "familiarize", "brainstorm", "browse"]>;
81
+ rationale: z.ZodString;
82
+ clarifying_question: z.ZodOptional<z.ZodString>;
83
+ advisory_summary: z.ZodOptional<z.ZodString>;
84
+ browseUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
85
+ browseQuery: z.ZodOptional<z.ZodString>;
86
+ gateRequest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ action: "start_task" | "summarize_current_status" | "advisory_response" | "ask_user" | "refuse" | "team_decompose" | "familiarize" | "brainstorm" | "browse";
89
+ rationale: string;
90
+ clarifying_question?: string | undefined;
91
+ advisory_summary?: string | undefined;
92
+ browseUrls?: string[] | undefined;
93
+ browseQuery?: string | undefined;
94
+ gateRequest?: Record<string, unknown> | undefined;
95
+ }, {
96
+ action: "start_task" | "summarize_current_status" | "advisory_response" | "ask_user" | "refuse" | "team_decompose" | "familiarize" | "brainstorm" | "browse";
97
+ rationale: string;
98
+ clarifying_question?: string | undefined;
99
+ advisory_summary?: string | undefined;
100
+ browseUrls?: string[] | undefined;
101
+ browseQuery?: string | undefined;
102
+ gateRequest?: Record<string, unknown> | undefined;
103
+ }>;
104
+ export interface PlannerProbeResult {
105
+ ok: boolean;
106
+ latencyMs: number;
107
+ errorClass?: 'timeout' | 'rate_limited' | 'unreachable' | 'malformed_response' | 'auth_failed';
108
+ }
109
+ export type ClassificationKind = 'workflow_status_query' | 'workflow_audit_query' | 'workflow_review_query' | 'workflow_continuation_query' | 'advisory_response_safe' | 'ask_user_clarification';
110
+ export interface CachedClassification {
111
+ kind: ClassificationKind;
112
+ clarifyingQuestion?: string;
113
+ advisorySummary?: string;
114
+ }
115
+ export type PlannerHealthState = 'Available' | 'Degraded' | 'Outage';
116
+ export interface PlannerHealthTransition {
117
+ newState: PlannerHealthState;
118
+ fromState: PlannerHealthState;
119
+ reason: string;
120
+ consecutiveFailures: number;
121
+ consecutiveSuccesses: number;
122
+ p95Ms: number;
123
+ }
@@ -11,5 +11,7 @@ export type { GeminiEnvelope, GeminiModelStats, GeminiReviewerProviderOptions, G
11
11
  export { GeminiReviewerProvider } from './providers/gemini.js';
12
12
  export type { CodexReviewerProviderOptions } from './providers/codex.js';
13
13
  export { CodexReviewerProvider } from './providers/codex.js';
14
+ export type { AntigravityReviewerProviderOptions } from './providers/antigravity.js';
15
+ export { AntigravityReviewerProvider } from './providers/antigravity.js';
14
16
  export { ReviewerRegistry, createSubprocessReviewerRegistry, } from './registry.js';
15
17
  export { MockReviewerSpawner, StaticReviewerMock } from './mocks.js';