@quantiya/codevibe-core 2.0.1 → 2.0.3

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 (284) hide show
  1. package/dist/__tests__/prompt-parser.test.d.ts +1 -0
  2. package/dist/adapter/registry.d.ts +69 -2
  3. package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
  4. package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
  5. package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
  6. package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
  7. package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
  8. package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
  9. package/dist/appsync/appsync-client.d.ts +621 -10
  10. package/dist/appsync/event-throttle.d.ts +28 -0
  11. package/dist/appsync/index.d.ts +3 -0
  12. package/dist/appsync/queries.d.ts +19 -0
  13. package/dist/audit-keys/index.d.ts +32 -0
  14. package/dist/auth/auth-service.d.ts +32 -2
  15. package/dist/auth/auth-telemetry.d.ts +19 -1
  16. package/dist/auth/index.d.ts +1 -0
  17. package/dist/companion-mode/__tests__/detect-parallel.test.d.ts +1 -0
  18. package/dist/companion-mode/index.d.ts +4 -3
  19. package/dist/companion-mode/persist-preference.d.ts +1 -1
  20. package/dist/config/config.d.ts +8 -1
  21. package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
  22. package/dist/continuation/__tests__/integration.test.d.ts +1 -0
  23. package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
  24. package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
  25. package/dist/continuation/__tests__/parity.test.d.ts +1 -0
  26. package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
  27. package/dist/continuation/dirty-state-collector.d.ts +46 -0
  28. package/dist/continuation/index.d.ts +8 -0
  29. package/dist/continuation/packet-reader.d.ts +33 -0
  30. package/dist/continuation/packet-writer.d.ts +86 -0
  31. package/dist/continuation/types.d.ts +239 -0
  32. package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
  33. package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
  34. package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
  35. package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
  36. package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
  37. package/dist/credential-broker/audit-sink.d.ts +69 -0
  38. package/dist/credential-broker/broker-config.d.ts +39 -0
  39. package/dist/credential-broker/broker-token.d.ts +123 -0
  40. package/dist/credential-broker/broker.d.ts +165 -0
  41. package/dist/credential-broker/canonical.d.ts +119 -0
  42. package/dist/credential-broker/index.d.ts +15 -0
  43. package/dist/credential-broker/scrubber.d.ts +45 -0
  44. package/dist/credential-broker/types.d.ts +141 -0
  45. package/dist/credential-broker/upstream-client.d.ts +20 -0
  46. package/dist/credential-broker/vendor-key-store.d.ts +54 -0
  47. package/dist/index.d.ts +6 -1
  48. package/dist/index.js +427 -124
  49. package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
  50. package/dist/keychain/keychain-backend.d.ts +82 -0
  51. package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
  52. package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
  53. package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
  54. package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
  55. package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
  56. package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
  57. package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
  58. package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
  59. package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
  60. package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
  61. package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
  62. package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
  63. package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
  64. package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
  65. package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
  66. package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
  67. package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
  68. package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
  69. package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
  70. package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
  71. package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
  72. package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
  73. package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
  74. package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
  75. package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
  76. package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
  77. package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
  78. package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
  79. package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
  80. package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
  81. package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
  82. package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
  83. package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
  84. package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
  85. package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
  86. package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
  87. package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
  88. package/dist/local-executor/agentic-resolve.d.ts +54 -0
  89. package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
  90. package/dist/local-executor/authority.d.ts +33 -1
  91. package/dist/local-executor/class-a-emit.d.ts +3 -1
  92. package/dist/local-executor/class-a-sign.d.ts +57 -0
  93. package/dist/local-executor/class-b-consumer.d.ts +159 -4
  94. package/dist/local-executor/class-b-verify.d.ts +30 -0
  95. package/dist/local-executor/class1-reconcilers.d.ts +58 -0
  96. package/dist/local-executor/class2-resolver.d.ts +74 -0
  97. package/dist/local-executor/confined-model-caller.d.ts +39 -0
  98. package/dist/local-executor/conflict-classifier.d.ts +21 -0
  99. package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
  100. package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
  101. package/dist/local-executor/conflict-types.d.ts +86 -0
  102. package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
  103. package/dist/local-executor/durable-store.d.ts +334 -0
  104. package/dist/local-executor/git-lock-retry.d.ts +40 -0
  105. package/dist/local-executor/hook-bridge.d.ts +1 -1
  106. package/dist/local-executor/implementor-argv.d.ts +183 -0
  107. package/dist/local-executor/index.d.ts +44 -3
  108. package/dist/local-executor/local-executor-impl.d.ts +645 -4
  109. package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
  110. package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
  111. package/dist/local-executor/merge-journal-store.d.ts +311 -0
  112. package/dist/local-executor/merge-train.d.ts +713 -0
  113. package/dist/local-executor/promote-wal-store.d.ts +301 -0
  114. package/dist/local-executor/resolution-set-index.d.ts +51 -0
  115. package/dist/local-executor/revert-reconcile.d.ts +89 -0
  116. package/dist/local-executor/revert-runner.d.ts +17 -0
  117. package/dist/local-executor/shared-contract-detector.d.ts +57 -0
  118. package/dist/local-executor/spawn.d.ts +29 -1
  119. package/dist/local-executor/task-group-types.d.ts +346 -0
  120. package/dist/local-executor/team-execution-flag.d.ts +21 -0
  121. package/dist/local-executor/track-registry.d.ts +50 -0
  122. package/dist/local-executor/types.d.ts +238 -4
  123. package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
  124. package/dist/local-executor/workspace-shadow.d.ts +290 -0
  125. package/dist/local-executor/worktree-merge.d.ts +601 -0
  126. package/dist/local-model/__tests__/installer.test.d.ts +1 -0
  127. package/dist/local-model/__tests__/manager.test.d.ts +1 -0
  128. package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
  129. package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
  130. package/dist/local-model/__tests__/state.test.d.ts +1 -0
  131. package/dist/local-model/manager.d.ts +119 -0
  132. package/dist/local-model/ollama.d.ts +27 -0
  133. package/dist/local-model/runtime.d.ts +27 -0
  134. package/dist/local-model/state.d.ts +32 -0
  135. package/dist/orchestration/detect-agents.d.ts +15 -2
  136. package/dist/orchestration/setup-types.d.ts +2 -1
  137. package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
  138. package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
  139. package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
  140. package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
  141. package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
  142. package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
  143. package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
  144. package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
  145. package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
  146. package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
  147. package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
  148. package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
  149. package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
  150. package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
  151. package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
  152. package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
  153. package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
  154. package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
  155. package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
  156. package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
  157. package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
  158. package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
  159. package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
  160. package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
  161. package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
  162. package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
  163. package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
  164. package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
  165. package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
  166. package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
  167. package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
  168. package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
  169. package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
  170. package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
  171. package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
  172. package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
  173. package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
  174. package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
  175. package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
  176. package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
  177. package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
  178. package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
  179. package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
  180. package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
  181. package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
  182. package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
  183. package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
  184. package/dist/orchestration-shell/attachments.d.ts +152 -0
  185. package/dist/orchestration-shell/audit-browser.d.ts +115 -0
  186. package/dist/orchestration-shell/audit-runner.d.ts +59 -0
  187. package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
  188. package/dist/orchestration-shell/cli.d.ts +336 -1
  189. package/dist/orchestration-shell/cli.js +40580 -4692
  190. package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
  191. package/dist/orchestration-shell/components/ConversationPane.d.ts +7 -1
  192. package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
  193. package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
  194. package/dist/orchestration-shell/components/GatePromptEntry.d.ts +7 -0
  195. package/dist/orchestration-shell/components/InputBar.d.ts +17 -3
  196. package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
  197. package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
  198. package/dist/orchestration-shell/components/OrchestrationApp.d.ts +81 -15
  199. package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
  200. package/dist/orchestration-shell/components/StatusBar.d.ts +15 -2
  201. package/dist/orchestration-shell/context-store.d.ts +389 -0
  202. package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
  203. package/dist/orchestration-shell/emit-shell-event.d.ts +1 -1
  204. package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
  205. package/dist/orchestration-shell/gate-prompts.d.ts +361 -3
  206. package/dist/orchestration-shell/index.d.ts +613 -1
  207. package/dist/orchestration-shell/ink-runtime.d.ts +21 -1
  208. package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
  209. package/dist/orchestration-shell/live-static-order.d.ts +22 -0
  210. package/dist/orchestration-shell/non-tty-fallback.d.ts +21 -0
  211. package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
  212. package/dist/orchestration-shell/root-discovery.d.ts +25 -0
  213. package/dist/orchestration-shell/route-browse.d.ts +20 -0
  214. package/dist/orchestration-shell/slash-router.d.ts +20 -1
  215. package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
  216. package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
  217. package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
  218. package/dist/orchestration-shell/status-format.d.ts +59 -0
  219. package/dist/orchestration-shell/task-progress.d.ts +122 -0
  220. package/dist/orchestration-shell/team-decompose.d.ts +196 -0
  221. package/dist/orchestration-shell/types.d.ts +363 -3
  222. package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
  223. package/dist/orchestration-shell/web/extract.d.ts +11 -0
  224. package/dist/orchestration-shell/web/fetch.d.ts +15 -0
  225. package/dist/orchestration-shell/web/ip.d.ts +26 -0
  226. package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
  227. package/dist/orchestration-shell/web/search.d.ts +16 -0
  228. package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
  229. package/dist/planner/index.d.ts +2 -0
  230. package/dist/planner/local-advisory.d.ts +84 -0
  231. package/dist/planner/local-gemma.d.ts +23 -0
  232. package/dist/planner/types.d.ts +16 -6
  233. package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
  234. package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
  235. package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
  236. package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
  237. package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
  238. package/dist/reviewer/index.d.ts +2 -0
  239. package/dist/reviewer/output-parser.d.ts +48 -12
  240. package/dist/reviewer/provider.d.ts +107 -3
  241. package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
  242. package/dist/reviewer/providers/antigravity.d.ts +49 -0
  243. package/dist/reviewer/providers/claude.d.ts +19 -4
  244. package/dist/reviewer/providers/codex.d.ts +47 -5
  245. package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
  246. package/dist/reviewer/providers/gemini.d.ts +5 -4
  247. package/dist/reviewer/registry.d.ts +5 -5
  248. package/dist/reviewer/subprocess.d.ts +37 -0
  249. package/dist/reviewer/token-usage.d.ts +32 -0
  250. package/dist/reviewer/types.d.ts +5 -5
  251. package/dist/reviewer/verdict-classifier.d.ts +62 -0
  252. package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
  253. package/dist/session/index.d.ts +1 -0
  254. package/dist/session/prepare-event-timestamp.d.ts +30 -0
  255. package/dist/substrate/__tests__/docker.test.d.ts +1 -0
  256. package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
  257. package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
  258. package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
  259. package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
  260. package/dist/substrate/command-runner.d.ts +19 -0
  261. package/dist/substrate/docker.d.ts +134 -0
  262. package/dist/substrate/errors.d.ts +33 -0
  263. package/dist/substrate/forwarder.d.ts +67 -0
  264. package/dist/substrate/git-proxy.d.ts +35 -0
  265. package/dist/substrate/index.d.ts +12 -0
  266. package/dist/substrate/relay-script.d.ts +27 -0
  267. package/dist/substrate/sandbox-exec.d.ts +116 -0
  268. package/dist/substrate/types.d.ts +218 -0
  269. package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
  270. package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
  271. package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
  272. package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
  273. package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
  274. package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
  275. package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
  276. package/dist/substrate-launch/engage-substrate.d.ts +102 -0
  277. package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
  278. package/dist/substrate-launch/index.d.ts +12 -0
  279. package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
  280. package/dist/substrate-launch/sanitized-env.d.ts +73 -0
  281. package/dist/types/auth.d.ts +6 -1
  282. package/dist/types/events.d.ts +3 -1
  283. package/dist/types/reviewer.d.ts +6 -6
  284. package/package.json +7 -3
@@ -0,0 +1,28 @@
1
+ /** Exposed for the single log line in createEvent. */
2
+ export declare const CLIENT_THROTTLE_EVENTS_PER_WINDOW: number;
3
+ interface RateWindow {
4
+ windowStartMs: number;
5
+ count: number;
6
+ toolUseAboveThreshold: number;
7
+ suppressed: number;
8
+ logged: boolean;
9
+ }
10
+ /**
11
+ * Decide whether this outbound event should be suppressed (not sent).
12
+ * Deterministic given (sessionId, type, now) and prior counter state.
13
+ * Exported for unit tests; resetThrottleState() clears the module map.
14
+ */
15
+ export declare function shouldSuppressEvent(sessionId: string, type: string, now: number): boolean;
16
+ /**
17
+ * Returns the session's rate window exactly once per window — the first time the
18
+ * throttle engages — for a single log line; later calls in the same window
19
+ * return undefined. Keeps logging out of the hot path.
20
+ */
21
+ export declare function consumeThrottleLogOnce(sessionId: string): RateWindow | undefined;
22
+ /** Test-only: clears the per-process rate map. */
23
+ export declare function resetThrottleState(): void;
24
+ /** Test-only: current size of the per-process rate map (eviction-bound check). */
25
+ export declare function throttleMapSize(): number;
26
+ /** Test-only: whether a session is currently tracked (eviction assertions). */
27
+ export declare function throttleMapHas(sessionId: string): boolean;
28
+ export {};
@@ -1,2 +1,5 @@
1
1
  export { AppSyncClient, AppSyncGraphQLError, DownloadUrlResponse } from './appsync-client';
2
+ export { coerceAwsJsonObject } from './appsync-client';
3
+ export type { ClassBPacketEnvelopeMeta } from './appsync-client';
4
+ export type { TaskReviewSummary, TaskReviewSummaryRound, TaskReviewSummaryReviewer, TaskGroupStatusResult, } from './appsync-client';
2
5
  export { queries, mutations, subscriptions } from './queries';
@@ -12,6 +12,15 @@ export declare const queries: {
12
12
  */
13
13
  listSessions: string;
14
14
  getSubscriptionStatus: string;
15
+ queryAudit: string;
16
+ verifyContinuationPacketWritten: string;
17
+ getReviewerPrompt: string;
18
+ getClassBSigningPublicKey: string;
19
+ getInReviewAssignments: string;
20
+ getTaskGroupTracks: string;
21
+ getInFlightTeamTracks: string;
22
+ getTaskGroupStatus: string;
23
+ getTaskReviewSummary: string;
15
24
  };
16
25
  export declare const mutations: {
17
26
  createSession: string;
@@ -27,9 +36,19 @@ export declare const mutations: {
27
36
  classifyPlannerPrompt: string;
28
37
  pingPlanner: string;
29
38
  applyUserDecision: string;
39
+ recordContinuationPacketWritten: string;
40
+ createTaskGroup: string;
41
+ submitMergeGateVerdict: string;
42
+ submitTrackVerificationOutcome: string;
43
+ claimGroupDecision: string;
44
+ startTask: string;
45
+ submitImplementorOutput: string;
46
+ submitReviewerVerdict: string;
30
47
  };
31
48
  export declare const subscriptions: {
32
49
  onEventCreated: string;
33
50
  onDeviceKeyRegistered: string;
34
51
  onSessionUpdated: string;
52
+ onClassBPacket: string;
53
+ onApplyUserDecision: string;
35
54
  };
@@ -39,3 +39,35 @@ export declare function dedupKeyForDestructiveActionEscalated(gateId: Uuid, acti
39
39
  * passed alongside).
40
40
  */
41
41
  export declare function dedupKeyForFlagBadApproval(flaggedEntryId: Uuid): string;
42
+ /**
43
+ * `ModelCall` (CP-7 §3.5) — pre-forward strict audit row.
44
+ * Identity: `(task_id, "model_call", model_call_id)`.
45
+ */
46
+ export declare function dedupKeyForModelCall(taskId: Uuid, modelCallId: string): string;
47
+ /**
48
+ * `ModelCallResult` (CP-7 §3.5) — post-response enrichment row.
49
+ * Identity: `(task_id, "model_call_result", model_call_id)`. Shares the
50
+ * `model_call_id` FK with its pre-forward {@link dedupKeyForModelCall}
51
+ * row; framing keeps the two rows on DISTINCT keys despite the prefix
52
+ * overlap.
53
+ */
54
+ export declare function dedupKeyForModelCallResult(taskId: Uuid, modelCallId: string): string;
55
+ /**
56
+ * `EgressDenied` (CP-7 §3.5) — egress-proxy deny row.
57
+ * Identity: `(task_id, "egress_denied", caller_event_id)`.
58
+ */
59
+ export declare function dedupKeyForEgressDenied(taskId: Uuid, callerEventId: string): string;
60
+ /**
61
+ * `ModelContextScrubbed` (CP-7 §3.5) — I2 scrub row.
62
+ * Identity: `(task_id, "model_context_scrubbed", model_call_id, field,
63
+ * pattern_class)`. `field` is a canonical JSONPath; `patternClass` lets
64
+ * one field tripping two heuristics record both. This multi-string
65
+ * identity is exactly what the legacy unframed concatenation could not
66
+ * encode injectively.
67
+ */
68
+ export declare function dedupKeyForModelContextScrubbed(taskId: Uuid, modelCallId: string, field: string, patternClass: string): string;
69
+ /**
70
+ * `BrokerCredentialLoaded` (CP-7 §3.5) — keychain vendor-key load row.
71
+ * Identity: `(task_id, "broker_credential_loaded", credential_issuance_id)`.
72
+ */
73
+ export declare function dedupKeyForBrokerCredentialLoaded(taskId: Uuid, credentialIssuanceId: string): string;
@@ -1,4 +1,28 @@
1
+ import * as http from 'http';
1
2
  import { TokenData } from '../types';
3
+ export declare const PRIMARY_PORT = 8080;
4
+ export declare const PORT_RANGE_SIZE = 20;
5
+ /**
6
+ * Bind an HTTP server to the first available port in
7
+ * PRIMARY_PORT..PRIMARY_PORT+PORT_RANGE_SIZE-1.
8
+ *
9
+ * Retries at the `.listen()` level (no separate probe) to avoid TOCTOU races.
10
+ * Installs a persistent post-bind error listener to prevent process crash on
11
+ * later server errors (e.g., EMFILE during connection accept).
12
+ *
13
+ * @param handler - the request handler
14
+ * @returns { server, port } once the server is successfully listening
15
+ * @throws Error with code='EADDRINUSE_ALL' if ALL ports in range are in use
16
+ * @throws Original error if a non-EADDRINUSE error fires (EACCES, etc.)
17
+ *
18
+ * Callers MUST wrap this in try/catch to fire the appropriate auth-failure
19
+ * beacon BEFORE rejecting — otherwise the outer auth-cli fallback downgrades
20
+ * the failure to `unknown` and we lose port_range_exhausted telemetry.
21
+ */
22
+ export declare function bindOAuthServer(handler: http.RequestListener): Promise<{
23
+ server: http.Server;
24
+ port: number;
25
+ }>;
2
26
  /**
3
27
  * Authentication service for OAuth flows
4
28
  */
@@ -51,11 +75,17 @@ export declare class AuthService {
51
75
  */
52
76
  private generateState;
53
77
  /**
54
- * Build authorization URL
78
+ * Build authorization URL with dynamic redirect_uri (port-range fix).
55
79
  */
56
80
  private buildAuthUrl;
57
81
  /**
58
- * Exchange authorization code for tokens
82
+ * Exchange authorization code for tokens.
83
+ *
84
+ * `redirectUri` MUST match the one passed to buildAuthUrl earlier — Cognito
85
+ * compares them at the token endpoint and rejects mismatches. This is the
86
+ * load-bearing change for the port-range fix to work end-to-end: if the
87
+ * authorize URL used port 8081 and the token POST uses 8080, Cognito
88
+ * returns redirect_uri_mismatch.
59
89
  */
60
90
  private exchangeCodeForTokens;
61
91
  /**
@@ -14,7 +14,7 @@
14
14
  * Keep values snake_case to match GA4 custom-dimension conventions
15
15
  * used elsewhere in the codebase (`step`, `source`, `reason`).
16
16
  */
17
- export type AuthFailureReason = 'port_in_use' | 'server_listen_failed' | 'browser_open_failed' | 'login_timeout' | 'cognito_rejected' | 'state_mismatch' | 'no_authorization_code' | 'token_exchange_failed' | 'token_exchange_network_error' | 'keychain_write_failed' | 'user_aborted' | 'unknown';
17
+ export type AuthFailureReason = 'port_in_use' | 'port_range_exhausted' | 'server_listen_failed' | 'browser_open_failed' | 'login_timeout' | 'cognito_rejected' | 'state_mismatch' | 'no_authorization_code' | 'token_exchange_failed' | 'token_exchange_network_error' | 'keychain_write_failed' | 'user_aborted' | 'unknown';
18
18
  /**
19
19
  * Auth flow stage the failure occurred in. Useful for GA4 faceting;
20
20
  * each reason has an implicit stage but keeping it as a distinct
@@ -82,6 +82,24 @@ export declare function fireAuthFailedBeacon(reason: AuthFailureReason, extra?:
82
82
  stage?: AuthStage;
83
83
  errorFragment?: string;
84
84
  }): Promise<void>;
85
+ /**
86
+ * Coarse reason a machine fell back to file-based credential storage.
87
+ * - `no_keyring_service`: keytar's native addon LOADED but there's no OS
88
+ * keyring service to talk to (structurally-headless Linux — no D-Bus session).
89
+ * - `keytar_load_failed`: keytar's native addon failed to load AND the machine
90
+ * is structurally headless (libsecret absent on a no-keyring box).
91
+ */
92
+ export type KeychainFallbackReason = 'no_keyring_service' | 'keytar_load_failed';
93
+ /**
94
+ * Fire the `keychain_file_fallback` beacon when keychain-backend auto-selects
95
+ * the file backend on a structurally-headless machine. Deliberately a DISTINCT
96
+ * event from `auth_failed` — this is a successful, working fallback, not a
97
+ * failure. Lets analytics see the headless cohort and confirm the headless fix
98
+ * is reaching the field (the old `keychain_write_failed` signal goes quiet for
99
+ * these users, so we need a positive beacon, not just an absence). No PII: only
100
+ * platform / source / the coarse reason literal.
101
+ */
102
+ export declare function fireKeychainFileFallbackBeacon(reason: KeychainFallbackReason): Promise<void>;
85
103
  /**
86
104
  * Attach the reason + beaconed marker to an Error. Non-enumerable so
87
105
  * the symbols don't serialize if the error object is ever JSON'd.
@@ -1,3 +1,4 @@
1
1
  export { AuthService, authService } from './auth-service';
2
+ export { bindOAuthServer, PRIMARY_PORT, PORT_RANGE_SIZE } from './auth-service';
2
3
  export { runAuthCli } from './auth-cli';
3
4
  export { fireAuthCompletedBeacon, fireAuthFailedBeacon, markErrorBeaconed, errorWasBeaconed, getErrorReason, type AuthFailureReason, type AuthStage, } from './auth-telemetry';
@@ -33,9 +33,10 @@ export interface CompanionArgs {
33
33
  /** Test seam — override bin-path resolver (real impl uses `command -v`). */
34
34
  resolveBinPath?: (kind: DetectableAgent) => string | null;
35
35
  /**
36
- * Test seam — override the `<wrapper> --version` 2s health-probe
37
- * (§4 line 280). Real impl spawns the wrapper with a SIGKILL on
38
- * timeout. Per Stage 2 r1 Codex MEDIUM-2.
36
+ * Test seam — override the `<wrapper> --version` health-probe
37
+ * (§4 line 280; timeout AGENT_VERSION_PROBE_TIMEOUT_MS). Real impl
38
+ * spawns the wrapper with a SIGKILL on timeout. Per Stage 2 r1 Codex
39
+ * MEDIUM-2.
39
40
  */
40
41
  versionProbe?: (binPath: string) => Promise<boolean>;
41
42
  }
@@ -1,6 +1,6 @@
1
1
  export declare function companionPreferenceFilePath(): string;
2
2
  export interface CompanionPreference {
3
- lastAgent: 'CLAUDE' | 'GEMINI' | 'CODEX';
3
+ lastAgent: 'CLAUDE' | 'GEMINI' | 'CODEX' | 'ANTIGRAVITY';
4
4
  lastUsedAt: string;
5
5
  }
6
6
  /**
@@ -1,7 +1,14 @@
1
1
  /**
2
2
  * Environment type
3
+ *
4
+ * 'experiment' is a separate AWS environment for CodeVibe 2.0 testing —
5
+ * isolated DDB/Cognito/AppSync/Lambda stacks in us-east-1, manual-deploy
6
+ * only (NOT in the codevibe-backend pipeline). Plugins/mobile clients
7
+ * opt in by setting `ENVIRONMENT=experiment`. See
8
+ * `codevibe-backend/docs/2.0/PHASE-INFRA-EXPERIMENT-ENV-DESIGN.md`
9
+ * LOCK #IE-5.
3
10
  */
4
- export type Environment = 'development' | 'production';
11
+ export type Environment = 'development' | 'production' | 'experiment';
5
12
  /**
6
13
  * Configuration interface
7
14
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ import type { AuthorityScope } from '../local-executor/authority';
2
+ import type { RepoState } from './types';
3
+ export interface KnownRepo {
4
+ /** repo basename (e.g., `codevibe-backend`). */
5
+ repo: string;
6
+ /** absolute filesystem path of repo root. */
7
+ path: string;
8
+ }
9
+ export interface GitExecOptions {
10
+ /** `cwd` for the git invocation. */
11
+ cwd: string;
12
+ /** Wall-clock timeout in milliseconds. */
13
+ timeoutMs?: number;
14
+ }
15
+ export type GitExecFn = (args: string[], options: GitExecOptions) => Promise<string>;
16
+ /**
17
+ * Default `git` executor. Honors `cwd` + timeout, scrubs the env.
18
+ * Returns stdout as utf8. Throws on non-zero exit / timeout / spawn
19
+ * failure — caller catches and emits the `"unknown"` sentinel row.
20
+ */
21
+ export declare const defaultGitExec: GitExecFn;
22
+ export interface DirtyStateCollector {
23
+ collect(): Promise<RepoState[]>;
24
+ }
25
+ export interface DirtyStateCollectorOptions {
26
+ gitExec?: GitExecFn;
27
+ timeoutMs?: number;
28
+ }
29
+ /**
30
+ * §4.7 LOCK #C6-A-7 — enumerate `knownRepos`, clamp to authority,
31
+ * collect git metadata for each in-scope repo. Sentinel-friendly:
32
+ * missing git, non-git dirs, and timeouts each produce a row with
33
+ * `"unknown"` strings instead of throwing.
34
+ */
35
+ export declare function collectRepoStates(authority: AuthorityScope, knownRepos: KnownRepo[], options?: DirtyStateCollectorOptions): Promise<RepoState[]>;
36
+ /**
37
+ * Factory that produces a `DirtyStateCollector` bound to a known-repo
38
+ * snapshot + authority scope. Used by `createContinuationPacketWriter`
39
+ * to inject the collector as a dependency (test seam).
40
+ */
41
+ export declare function createDirtyStateCollector(deps: {
42
+ authority: AuthorityScope;
43
+ knownRepos: KnownRepo[];
44
+ gitExec?: GitExecFn;
45
+ timeoutMs?: number;
46
+ }): DirtyStateCollector;
@@ -0,0 +1,8 @@
1
+ export type { AgentKind, HandoffReason, GateState, RepoState, ContinuationPacket, PacketWriteInput, PacketWriteResult, PacketListEntry, ContinuationPacketReadResult, } from './types';
2
+ export { PacketFidelityError, PacketIoError, PacketHashMismatch, PacketAuditEmitError, PacketNotFound, PacketUnverified, FrontmatterMalformed, SchemaInvalid, PacketPermissionsLoose, } from './types';
3
+ export { createContinuationPacketWriter, buildContinuationPacket, computePacketHash, renderPacketMarkdown, getPacketFilePath, getTaskDirectoryPath, } from './packet-writer';
4
+ export type { ContinuationPacketWriter, ContinuationPacketWriterDeps, } from './packet-writer';
5
+ export { createContinuationPacketReader, splitFrontmatter, validatePacketSchema, } from './packet-reader';
6
+ export type { ContinuationPacketReader, ContinuationPacketReaderDeps, } from './packet-reader';
7
+ export { collectRepoStates, createDirtyStateCollector, defaultGitExec, } from './dirty-state-collector';
8
+ export type { DirtyStateCollector, DirtyStateCollectorOptions, GitExecFn, GitExecOptions, KnownRepo, } from './dirty-state-collector';
@@ -0,0 +1,33 @@
1
+ import type { AppSyncClient } from '../appsync/appsync-client';
2
+ import type { ContinuationPacket, PacketListEntry, RepoState } from './types';
3
+ export interface ContinuationPacketReaderDeps {
4
+ appsync: AppSyncClient;
5
+ /** Test seam — override the home directory. Defaults to `os.homedir()`. */
6
+ homeDir?: string;
7
+ }
8
+ export interface ContinuationPacketReader {
9
+ read(taskId: string, expectedHash?: string): Promise<ContinuationPacket>;
10
+ list(): Promise<PacketListEntry[]>;
11
+ }
12
+ /**
13
+ * Split a markdown body into YAML frontmatter + prose body. Returns
14
+ * `null` for the frontmatter when the body is missing the leading
15
+ * `---` fence.
16
+ */
17
+ export declare function splitFrontmatter(body: string): {
18
+ yaml: string | null;
19
+ prose: string;
20
+ };
21
+ /**
22
+ * Validate that a parsed YAML object matches the 17-field
23
+ * `ContinuationPacket` schema per LOCK #C6-A-1. Returns the typed
24
+ * packet on success; throws `SchemaInvalid` with a list of issues
25
+ * otherwise.
26
+ */
27
+ export declare function validatePacketSchema(parsed: unknown): ContinuationPacket;
28
+ /**
29
+ * Factory for the CP-6 packet reader.
30
+ */
31
+ export declare function createContinuationPacketReader(deps: ContinuationPacketReaderDeps): ContinuationPacketReader;
32
+ export { getPacketFilePath, getTaskDirectoryPath } from './packet-writer';
33
+ export type { RepoState };
@@ -0,0 +1,86 @@
1
+ import type { AppSyncClient } from '../appsync/appsync-client';
2
+ import type { AuthorityScope } from '../local-executor/authority';
3
+ import type { ContinuationPacket, PacketWriteInput, PacketWriteResult, RepoState } from './types';
4
+ import { type DirtyStateCollector } from './dirty-state-collector';
5
+ export interface ContinuationPacketWriterDeps {
6
+ /** Direct mutation invocation per LOCK #C6-A-10.4.10.2 — NOT routed via emitShellEvent. */
7
+ appsync: AppSyncClient;
8
+ /** Authority scope for dirty-state clamp per LOCK #C6-A-7. */
9
+ authority: AuthorityScope;
10
+ /**
11
+ * Optional INFORMATIONAL Class A timeline mirror. Failure is swallowed;
12
+ * the AUTHORITATIVE audit row is what `recordContinuationPacketWritten`
13
+ * produced.
14
+ */
15
+ shellEmit?: (event: {
16
+ type: string;
17
+ taskId: string;
18
+ packetHash: string;
19
+ }) => Promise<void>;
20
+ /** Test seam — override the dirty-state collector. */
21
+ dirtyStateCollector?: DirtyStateCollector;
22
+ /** Test seam — override the home directory. Defaults to `os.homedir()`. */
23
+ homeDir?: string;
24
+ /** Test seam — clock injection. */
25
+ clock?: () => number;
26
+ /** Test seam — random tmp-suffix injection. */
27
+ randomHex?: () => string;
28
+ }
29
+ export interface ContinuationPacketWriter {
30
+ write(input: PacketWriteInput): Promise<PacketWriteResult>;
31
+ /** Test-only — exposes the per-task mutex map size for assertions. */
32
+ readonly mutexMapSizeForTests: number;
33
+ }
34
+ /**
35
+ * §8.1 AUTO-SENTINEL placeholders — the values `buildContinuationPacket` writes
36
+ * for `completedWork` / `remainingWork` / `verification` when the source
37
+ * implementor did NOT enumerate its progress (e.g. a HARD quota cap where the
38
+ * agent never produced a structured continuation output — the realistic case
39
+ * the quota fork covers). Exported so the resume path
40
+ * (`QuorumLoop.buildResumeBrief`) can DETECT the sentinel-only case and frame
41
+ * the task summary as the full actionable work, instead of echoing "unknown"
42
+ * back to the resumed agent (which reads it as "nothing to do" and no-ops).
43
+ */
44
+ export declare const WORK_NOT_ENUMERATED_SENTINEL = "unknown \u2014 implementor did not enumerate";
45
+ export declare const VERIFICATION_NOT_RECORDED_SENTINEL = "not_checked \u2014 no verification recorded by source implementor";
46
+ /**
47
+ * Build the canonical 17-field `ContinuationPacket` from the caller-
48
+ * supplied `PacketWriteInput`. Applies the §8.1 sentinel taxonomy:
49
+ * - 8 STRICT-REQUIRED fields → throw `PacketFidelityError` on
50
+ * undefined.
51
+ * - 1 CALLER-OR-COLLECTOR field (`repoStates`) → fall through to
52
+ * `repoStatesFromCollector` (which the caller pre-resolved).
53
+ * - 7 AUTO-SENTINEL fields → default per §8.1 table.
54
+ * - 1 WRITER-CONSTANT field (`packetVersion`) → always `1`.
55
+ */
56
+ export declare function buildContinuationPacket(input: PacketWriteInput, repoStatesFromCollector: RepoState[]): ContinuationPacket;
57
+ /**
58
+ * §4.2 LOCK #C6-A-2 — compute the JCS-canonical-JSON SHA-256 hash of
59
+ * the typed packet struct. Library pin: `json-freeze@^1.x` (RFC 8785
60
+ * conformant). The TS-side hash MUST match the Rust `serde_jcs` hash
61
+ * byte-for-byte (P1 parity test).
62
+ */
63
+ export declare function computePacketHash(packet: ContinuationPacket): string;
64
+ /**
65
+ * §4.2 LOCK #C6-A-2 — render the YAML frontmatter + prose-body
66
+ * markdown body. The YAML frontmatter is the human-readable
67
+ * serialization; the JCS-canonical-JSON is the cross-impl hash input.
68
+ * Both are derived from the same parsed struct.
69
+ */
70
+ export declare function renderPacketMarkdown(packet: ContinuationPacket): string;
71
+ /**
72
+ * §4.3 LOCK #C6-A-3 — resolve the absolute path to a task's directory.
73
+ * Exported for use by the reader + status CLI.
74
+ */
75
+ export declare function getTaskDirectoryPath(taskId: string, homeDir?: string): string;
76
+ /**
77
+ * §4.3 LOCK #C6-A-3 — resolve the absolute path to a task's
78
+ * CONTINUATION.md.
79
+ */
80
+ export declare function getPacketFilePath(taskId: string, homeDir?: string): string;
81
+ /**
82
+ * Factory for the CP-6 packet writer. Per-task `Mutex` map is owned by
83
+ * the returned instance (one map per writer instance — production
84
+ * code wires a single writer per LE process).
85
+ */
86
+ export declare function createContinuationPacketWriter(deps: ContinuationPacketWriterDeps): ContinuationPacketWriter;