@quantiya/codevibe-core 2.0.1 → 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 (282) 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/persist-preference.d.ts +1 -1
  18. package/dist/config/config.d.ts +8 -1
  19. package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
  20. package/dist/continuation/__tests__/integration.test.d.ts +1 -0
  21. package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
  22. package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
  23. package/dist/continuation/__tests__/parity.test.d.ts +1 -0
  24. package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
  25. package/dist/continuation/dirty-state-collector.d.ts +46 -0
  26. package/dist/continuation/index.d.ts +8 -0
  27. package/dist/continuation/packet-reader.d.ts +33 -0
  28. package/dist/continuation/packet-writer.d.ts +86 -0
  29. package/dist/continuation/types.d.ts +239 -0
  30. package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
  31. package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
  32. package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
  33. package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
  34. package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
  35. package/dist/credential-broker/audit-sink.d.ts +69 -0
  36. package/dist/credential-broker/broker-config.d.ts +39 -0
  37. package/dist/credential-broker/broker-token.d.ts +123 -0
  38. package/dist/credential-broker/broker.d.ts +165 -0
  39. package/dist/credential-broker/canonical.d.ts +119 -0
  40. package/dist/credential-broker/index.d.ts +15 -0
  41. package/dist/credential-broker/scrubber.d.ts +45 -0
  42. package/dist/credential-broker/types.d.ts +141 -0
  43. package/dist/credential-broker/upstream-client.d.ts +20 -0
  44. package/dist/credential-broker/vendor-key-store.d.ts +54 -0
  45. package/dist/index.d.ts +6 -1
  46. package/dist/index.js +427 -124
  47. package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
  48. package/dist/keychain/keychain-backend.d.ts +82 -0
  49. package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
  50. package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
  51. package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
  52. package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
  53. package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
  54. package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
  55. package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
  56. package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
  57. package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
  58. package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
  59. package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
  60. package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
  61. package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
  62. package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
  63. package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
  64. package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
  65. package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
  66. package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
  67. package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
  68. package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
  69. package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
  70. package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
  71. package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
  72. package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
  73. package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
  74. package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
  75. package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
  76. package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
  77. package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
  78. package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
  79. package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
  80. package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
  81. package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
  82. package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
  83. package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
  84. package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
  85. package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
  86. package/dist/local-executor/agentic-resolve.d.ts +54 -0
  87. package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
  88. package/dist/local-executor/authority.d.ts +33 -1
  89. package/dist/local-executor/class-a-emit.d.ts +3 -1
  90. package/dist/local-executor/class-a-sign.d.ts +57 -0
  91. package/dist/local-executor/class-b-consumer.d.ts +159 -4
  92. package/dist/local-executor/class-b-verify.d.ts +30 -0
  93. package/dist/local-executor/class1-reconcilers.d.ts +58 -0
  94. package/dist/local-executor/class2-resolver.d.ts +74 -0
  95. package/dist/local-executor/confined-model-caller.d.ts +39 -0
  96. package/dist/local-executor/conflict-classifier.d.ts +21 -0
  97. package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
  98. package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
  99. package/dist/local-executor/conflict-types.d.ts +86 -0
  100. package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
  101. package/dist/local-executor/durable-store.d.ts +334 -0
  102. package/dist/local-executor/git-lock-retry.d.ts +40 -0
  103. package/dist/local-executor/hook-bridge.d.ts +1 -1
  104. package/dist/local-executor/implementor-argv.d.ts +183 -0
  105. package/dist/local-executor/index.d.ts +44 -3
  106. package/dist/local-executor/local-executor-impl.d.ts +645 -4
  107. package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
  108. package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
  109. package/dist/local-executor/merge-journal-store.d.ts +311 -0
  110. package/dist/local-executor/merge-train.d.ts +713 -0
  111. package/dist/local-executor/promote-wal-store.d.ts +301 -0
  112. package/dist/local-executor/resolution-set-index.d.ts +51 -0
  113. package/dist/local-executor/revert-reconcile.d.ts +89 -0
  114. package/dist/local-executor/revert-runner.d.ts +17 -0
  115. package/dist/local-executor/shared-contract-detector.d.ts +57 -0
  116. package/dist/local-executor/spawn.d.ts +29 -1
  117. package/dist/local-executor/task-group-types.d.ts +346 -0
  118. package/dist/local-executor/team-execution-flag.d.ts +21 -0
  119. package/dist/local-executor/track-registry.d.ts +50 -0
  120. package/dist/local-executor/types.d.ts +238 -4
  121. package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
  122. package/dist/local-executor/workspace-shadow.d.ts +290 -0
  123. package/dist/local-executor/worktree-merge.d.ts +601 -0
  124. package/dist/local-model/__tests__/installer.test.d.ts +1 -0
  125. package/dist/local-model/__tests__/manager.test.d.ts +1 -0
  126. package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
  127. package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
  128. package/dist/local-model/__tests__/state.test.d.ts +1 -0
  129. package/dist/local-model/manager.d.ts +119 -0
  130. package/dist/local-model/ollama.d.ts +27 -0
  131. package/dist/local-model/runtime.d.ts +27 -0
  132. package/dist/local-model/state.d.ts +32 -0
  133. package/dist/orchestration/detect-agents.d.ts +15 -2
  134. package/dist/orchestration/setup-types.d.ts +2 -1
  135. package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
  136. package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
  137. package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
  138. package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
  139. package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
  140. package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
  141. package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
  142. package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
  143. package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
  144. package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
  145. package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
  146. package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
  147. package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
  148. package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
  149. package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
  150. package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
  151. package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
  152. package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
  153. package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
  154. package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
  155. package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
  156. package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
  157. package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
  158. package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
  159. package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
  160. package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
  161. package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
  162. package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
  163. package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
  164. package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
  165. package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
  166. package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
  167. package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
  168. package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
  169. package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
  170. package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
  171. package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
  172. package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
  173. package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
  174. package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
  175. package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
  176. package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
  177. package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
  178. package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
  179. package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
  180. package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
  181. package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
  182. package/dist/orchestration-shell/attachments.d.ts +152 -0
  183. package/dist/orchestration-shell/audit-browser.d.ts +115 -0
  184. package/dist/orchestration-shell/audit-runner.d.ts +59 -0
  185. package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
  186. package/dist/orchestration-shell/cli.d.ts +336 -1
  187. package/dist/orchestration-shell/cli.js +39318 -3436
  188. package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
  189. package/dist/orchestration-shell/components/ConversationPane.d.ts +7 -1
  190. package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
  191. package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
  192. package/dist/orchestration-shell/components/GatePromptEntry.d.ts +7 -0
  193. package/dist/orchestration-shell/components/InputBar.d.ts +17 -3
  194. package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
  195. package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
  196. package/dist/orchestration-shell/components/OrchestrationApp.d.ts +81 -15
  197. package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
  198. package/dist/orchestration-shell/components/StatusBar.d.ts +15 -2
  199. package/dist/orchestration-shell/context-store.d.ts +389 -0
  200. package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
  201. package/dist/orchestration-shell/emit-shell-event.d.ts +1 -1
  202. package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
  203. package/dist/orchestration-shell/gate-prompts.d.ts +361 -3
  204. package/dist/orchestration-shell/index.d.ts +613 -1
  205. package/dist/orchestration-shell/ink-runtime.d.ts +21 -1
  206. package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
  207. package/dist/orchestration-shell/live-static-order.d.ts +22 -0
  208. package/dist/orchestration-shell/non-tty-fallback.d.ts +21 -0
  209. package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
  210. package/dist/orchestration-shell/root-discovery.d.ts +25 -0
  211. package/dist/orchestration-shell/route-browse.d.ts +20 -0
  212. package/dist/orchestration-shell/slash-router.d.ts +20 -1
  213. package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
  214. package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
  215. package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
  216. package/dist/orchestration-shell/status-format.d.ts +59 -0
  217. package/dist/orchestration-shell/task-progress.d.ts +122 -0
  218. package/dist/orchestration-shell/team-decompose.d.ts +196 -0
  219. package/dist/orchestration-shell/types.d.ts +363 -3
  220. package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
  221. package/dist/orchestration-shell/web/extract.d.ts +11 -0
  222. package/dist/orchestration-shell/web/fetch.d.ts +15 -0
  223. package/dist/orchestration-shell/web/ip.d.ts +26 -0
  224. package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
  225. package/dist/orchestration-shell/web/search.d.ts +16 -0
  226. package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
  227. package/dist/planner/index.d.ts +2 -0
  228. package/dist/planner/local-advisory.d.ts +84 -0
  229. package/dist/planner/local-gemma.d.ts +23 -0
  230. package/dist/planner/types.d.ts +16 -6
  231. package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
  232. package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
  233. package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
  234. package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
  235. package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
  236. package/dist/reviewer/index.d.ts +2 -0
  237. package/dist/reviewer/output-parser.d.ts +48 -12
  238. package/dist/reviewer/provider.d.ts +107 -3
  239. package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
  240. package/dist/reviewer/providers/antigravity.d.ts +49 -0
  241. package/dist/reviewer/providers/claude.d.ts +19 -4
  242. package/dist/reviewer/providers/codex.d.ts +47 -5
  243. package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
  244. package/dist/reviewer/providers/gemini.d.ts +5 -4
  245. package/dist/reviewer/registry.d.ts +5 -5
  246. package/dist/reviewer/subprocess.d.ts +37 -0
  247. package/dist/reviewer/token-usage.d.ts +32 -0
  248. package/dist/reviewer/types.d.ts +5 -5
  249. package/dist/reviewer/verdict-classifier.d.ts +62 -0
  250. package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
  251. package/dist/session/index.d.ts +1 -0
  252. package/dist/session/prepare-event-timestamp.d.ts +30 -0
  253. package/dist/substrate/__tests__/docker.test.d.ts +1 -0
  254. package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
  255. package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
  256. package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
  257. package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
  258. package/dist/substrate/command-runner.d.ts +19 -0
  259. package/dist/substrate/docker.d.ts +134 -0
  260. package/dist/substrate/errors.d.ts +33 -0
  261. package/dist/substrate/forwarder.d.ts +67 -0
  262. package/dist/substrate/git-proxy.d.ts +35 -0
  263. package/dist/substrate/index.d.ts +12 -0
  264. package/dist/substrate/relay-script.d.ts +27 -0
  265. package/dist/substrate/sandbox-exec.d.ts +116 -0
  266. package/dist/substrate/types.d.ts +218 -0
  267. package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
  268. package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
  269. package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
  270. package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
  271. package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
  272. package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
  273. package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
  274. package/dist/substrate-launch/engage-substrate.d.ts +102 -0
  275. package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
  276. package/dist/substrate-launch/index.d.ts +12 -0
  277. package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
  278. package/dist/substrate-launch/sanitized-env.d.ts +73 -0
  279. package/dist/types/auth.d.ts +6 -1
  280. package/dist/types/events.d.ts +3 -1
  281. package/dist/types/reviewer.d.ts +6 -6
  282. package/package.json +7 -3
@@ -0,0 +1,119 @@
1
+ import { spawn } from 'child_process';
2
+ import type { Tier } from '../orchestration-shell/types';
3
+ import { type LocalModelState, type LocalModelStateStore } from './state';
4
+ import type { LocalGemmaPlannerRunner } from '../planner/local-gemma';
5
+ export type LocalModelCommand = 'install' | 'status' | 'remove' | 'enable' | 'warm' | 'health-check';
6
+ export type LocalModelEntitlementSource = 'backend' | 'unauthenticated' | 'unavailable';
7
+ export interface LocalModelEntitlement {
8
+ tier: Tier | 'UNKNOWN';
9
+ source: LocalModelEntitlementSource;
10
+ }
11
+ export interface LocalModelArtifactConfig {
12
+ artifactId: string | null;
13
+ downloadUrl: string | null;
14
+ sha256: string | null;
15
+ expectedBytes?: number | null;
16
+ cacheDir: string;
17
+ ollamaModel?: string | null;
18
+ }
19
+ export interface LocalModelStore {
20
+ artifactExists(config: LocalModelArtifactConfig): Promise<boolean>;
21
+ removeArtifact(config: LocalModelArtifactConfig): Promise<boolean>;
22
+ }
23
+ export interface LocalModelInstaller {
24
+ install(config: LocalModelArtifactConfig): Promise<void>;
25
+ }
26
+ export interface LocalModelDownloadTransport {
27
+ downloadToFile(url: URL, destinationPath: string, expectedBytes: number): Promise<void>;
28
+ }
29
+ export interface LocalModelRuntimeFactory {
30
+ createRunner(config: LocalModelArtifactConfig): Promise<LocalGemmaPlannerRunner | null>;
31
+ }
32
+ export interface RunLocalModelCommandOptions {
33
+ command: LocalModelCommand;
34
+ entitlement: LocalModelEntitlement;
35
+ config?: LocalModelArtifactConfig;
36
+ store?: LocalModelStore;
37
+ stateStore?: LocalModelStateStore;
38
+ installer?: LocalModelInstaller;
39
+ runtimeFactory?: LocalModelRuntimeFactory;
40
+ stdout?: (s: string) => void;
41
+ stderr?: (s: string) => void;
42
+ /** TEST SEAM — the capability-aware default model for a BARE install. Defaults to
43
+ * {@link resolveDefaultOllamaModelForInstall}; tests inject a deterministic thunk. */
44
+ resolveInstallModel?: () => Promise<string>;
45
+ }
46
+ export declare function loadLocalModelArtifactConfigFromEnv(env?: NodeJS.ProcessEnv): LocalModelArtifactConfig;
47
+ /** The curated local-planner Ollama models (benchmarked 2026-07-02, gemma4 family). */
48
+ export declare const CAPABLE_OLLAMA_MODEL = "gemma4:12b-it-qat";
49
+ export declare const BASELINE_OLLAMA_MODEL = "gemma4:latest";
50
+ /** True iff the Ollama version string (e.g. "0.31.1", tolerating a leading "v") is ≥ MIN_OLLAMA_MAJOR.MINOR. */
51
+ export declare function ollamaVersionAtLeast(version: string | undefined, major?: number, minor?: number): boolean;
52
+ /**
53
+ * The DEFAULT Ollama model for `codevibe model install` when the user set neither
54
+ * `CODEVIBE_LOCAL_MODEL_OLLAMA_MODEL` nor a pinned artifact — CAPABILITY-AWARE per the
55
+ * CP-4 plan (2026-07-02 benchmark): the stronger 12B QAT (`gemma4:12b-it-qat`) ONLY when
56
+ * the host has enough RAM (~16 GB) AND Ollama ≥ 0.31 (the 12B tags need it — 0.24 rejects
57
+ * the pull); otherwise the broadly-compatible 8B (`gemma4:latest`). Fails SOFT to the 8B
58
+ * on any uncertainty (Ollama unreachable / unparseable version) so install never breaks.
59
+ */
60
+ export declare function resolveDefaultOllamaModelForInstall(deps?: {
61
+ ollamaHost?: string;
62
+ totalMemBytes?: number;
63
+ fetchImpl?: typeof fetch;
64
+ log?: (s: string) => void;
65
+ }): Promise<string>;
66
+ export declare function isLocalModelEntitled(entitlement: LocalModelEntitlement): entitlement is LocalModelEntitlement & {
67
+ tier: 'PRO' | 'MAX';
68
+ };
69
+ export declare function localModelArtifactPath(config: LocalModelArtifactConfig): string | null;
70
+ export declare const defaultLocalModelStore: LocalModelStore;
71
+ export declare const defaultLocalModelDownloadTransport: LocalModelDownloadTransport;
72
+ export interface LocalModelProcessPuller {
73
+ pull(model: string, localOllamaHost?: string): Promise<void>;
74
+ }
75
+ type SpawnOllamaPull = typeof spawn;
76
+ export declare class OllamaProcessPuller implements LocalModelProcessPuller {
77
+ private readonly command;
78
+ private readonly spawnPull;
79
+ constructor(command?: string, spawnPull?: SpawnOllamaPull);
80
+ pull(model: string, localOllamaHost?: string): Promise<void>;
81
+ }
82
+ /**
83
+ * Build the Ollama runtime config for a pull that HONORS the caller's `model` argument
84
+ * (the config/CLI is authoritative), sourcing host + timeout from env. Without this, the
85
+ * pullers re-read `CODEVIBE_LOCAL_MODEL_OLLAMA_MODEL` from env — which is UNSET on a bare
86
+ * `codevibe model install`, so the capability-resolved default (12B/8B) would never reach
87
+ * the puller and the install would throw. For an explicit install the arg equals the env
88
+ * model → identical result. Host (default 127.0.0.1) + timeout (default) resolve when unset.
89
+ */
90
+ export declare function ollamaEnvForModel(model: string, baseEnv?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
91
+ /**
92
+ * Fill an env-derived artifact config's `ollamaModel` + `artifactId` from PERSISTED state
93
+ * when env didn't supply them — so a bare `codevibe model install` (which recorded the
94
+ * resolved model in state) is usable by the shell + status/enable/warm without the user
95
+ * setting `CODEVIBE_LOCAL_MODEL_OLLAMA_MODEL`. Env ALWAYS wins (explicit override); state
96
+ * only fills the gaps, and only when a model was actually installed (`choice === 'enabled'`).
97
+ */
98
+ export declare function applyPersistedSelection(config: LocalModelArtifactConfig, state: Pick<LocalModelState, 'choice' | 'artifactId' | 'ollamaModel'>): LocalModelArtifactConfig;
99
+ export declare class DefaultOllamaPuller implements LocalModelProcessPuller {
100
+ private readonly httpPuller;
101
+ private readonly processPuller;
102
+ constructor(httpPuller?: LocalModelProcessPuller, processPuller?: LocalModelProcessPuller);
103
+ pull(model: string): Promise<void>;
104
+ }
105
+ export declare class OllamaLocalModelInstaller implements LocalModelInstaller {
106
+ private readonly puller;
107
+ constructor(puller?: LocalModelProcessPuller);
108
+ install(config: LocalModelArtifactConfig): Promise<void>;
109
+ }
110
+ export declare class HttpsLocalModelInstaller implements LocalModelInstaller {
111
+ private readonly transport;
112
+ constructor(transport?: LocalModelDownloadTransport);
113
+ install(config: LocalModelArtifactConfig): Promise<void>;
114
+ private tryDigestExistingArtifact;
115
+ }
116
+ export declare const defaultLocalModelInstaller: LocalModelInstaller;
117
+ export declare const defaultLocalModelRuntimeFactory: LocalModelRuntimeFactory;
118
+ export declare function runLocalModelCommand(options: RunLocalModelCommandOptions): Promise<number>;
119
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { PlannerProbeResult } from '../planner/adapter';
2
+ import type { LocalGemmaAdvisoryOptions } from '../planner/local-advisory';
3
+ import type { LocalGemmaPlannerRunner } from '../planner/local-gemma';
4
+ export interface OllamaRuntimeConfig {
5
+ model: string;
6
+ host: string;
7
+ timeoutMs: number;
8
+ }
9
+ export type OllamaRuntimeConfigResult = {
10
+ ok: true;
11
+ config: OllamaRuntimeConfig;
12
+ } | {
13
+ ok: false;
14
+ reason: string;
15
+ };
16
+ export declare function isSafeOllamaModelName(model: string | null | undefined): model is string;
17
+ export declare function parseLocalOllamaHost(raw: string | undefined): string | null;
18
+ export declare function loadOllamaRuntimeConfigFromEnv(env?: NodeJS.ProcessEnv): OllamaRuntimeConfigResult;
19
+ export declare function requestOllamaPull(config: OllamaRuntimeConfig): Promise<void>;
20
+ export declare class OllamaGemmaPlannerRunner implements LocalGemmaPlannerRunner {
21
+ private readonly config;
22
+ readonly runtimeLabel: string;
23
+ constructor(config: OllamaRuntimeConfig);
24
+ classify(promptText: string): Promise<string>;
25
+ generateAdvisory(promptText: string, options?: LocalGemmaAdvisoryOptions): Promise<string>;
26
+ probe(): Promise<PlannerProbeResult>;
27
+ }
@@ -0,0 +1,27 @@
1
+ import type { PlannerProbeResult } from '../planner/adapter';
2
+ import type { LocalGemmaAdvisoryOptions } from '../planner/local-advisory';
3
+ import type { LocalGemmaPlannerRunner } from '../planner/local-gemma';
4
+ export interface LocalGemmaRuntimeConfig {
5
+ command: string;
6
+ args: string[];
7
+ modelPath: string;
8
+ timeoutMs: number;
9
+ env: NodeJS.ProcessEnv;
10
+ }
11
+ export type LocalGemmaRuntimeConfigResult = {
12
+ ok: true;
13
+ config: LocalGemmaRuntimeConfig;
14
+ } | {
15
+ ok: false;
16
+ reason: string;
17
+ };
18
+ export declare function loadLocalGemmaRuntimeConfigFromEnv(modelPath: string, env?: NodeJS.ProcessEnv): LocalGemmaRuntimeConfigResult;
19
+ export declare class LocalGemmaProcessRunner implements LocalGemmaPlannerRunner {
20
+ private readonly config;
21
+ readonly runtimeLabel: string;
22
+ constructor(config: LocalGemmaRuntimeConfig);
23
+ classify(promptText: string): Promise<string>;
24
+ generateAdvisory(promptText: string, options?: LocalGemmaAdvisoryOptions): Promise<string>;
25
+ probe(): Promise<PlannerProbeResult>;
26
+ private invoke;
27
+ }
@@ -0,0 +1,32 @@
1
+ export type LocalModelChoice = 'not_configured' | 'skipped' | 'enabled';
2
+ export interface LocalModelState {
3
+ schemaVersion: 1;
4
+ choice: LocalModelChoice;
5
+ artifactId: string | null;
6
+ /**
7
+ * The installed Ollama model tag (e.g. `gemma4:12b-it-qat`), persisted so a BARE
8
+ * `codevibe model install` (which resolves the model dynamically, not from env) is
9
+ * usable afterward — the shell + status/enable/warm resolve it from here when
10
+ * `CODEVIBE_LOCAL_MODEL_OLLAMA_MODEL` is unset. Null for non-Ollama / legacy state.
11
+ */
12
+ ollamaModel: string | null;
13
+ updatedAt: string;
14
+ }
15
+ export interface LocalModelStateStore {
16
+ read(): Promise<LocalModelState>;
17
+ write(state: LocalModelState): Promise<void>;
18
+ clear(): Promise<void>;
19
+ }
20
+ export declare function defaultLocalModelState(): LocalModelState;
21
+ export declare function localModelStateFilePath(env?: NodeJS.ProcessEnv): string;
22
+ export declare class FileSystemLocalModelStateStore implements LocalModelStateStore {
23
+ private readonly filePath;
24
+ constructor(filePath?: string);
25
+ read(): Promise<LocalModelState>;
26
+ write(state: LocalModelState): Promise<void>;
27
+ clear(): Promise<void>;
28
+ }
29
+ export declare const defaultLocalModelStateStore: LocalModelStateStore;
30
+ export declare function readLocalModelState(store?: LocalModelStateStore): Promise<LocalModelState>;
31
+ export declare function markLocalModelEnabled(artifactId: string | null, ollamaModel?: string | null, store?: LocalModelStateStore): Promise<void>;
32
+ export declare function markLocalModelSkipped(store?: LocalModelStateStore): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import { Logger } from '../logger';
2
2
  import { AppSyncClient } from '../appsync';
3
3
  import { CapabilityRegistry } from '../adapter/capabilities';
4
- export type DetectableAgent = 'CLAUDE' | 'GEMINI' | 'CODEX';
4
+ export type DetectableAgent = 'CLAUDE' | 'GEMINI' | 'CODEX' | 'ANTIGRAVITY';
5
5
  /**
6
6
  * Returns the subset of agents present on PATH. Uses `command -v`
7
7
  * (POSIX-standard) rather than `which` for portability across macOS
@@ -22,12 +22,25 @@ export declare function detectInstalledAgents(): DetectableAgent[];
22
22
  * and log but not abort startup — Quorum 2.0 auto-enable degrades
23
23
  * to "use last-pushed agent set" when the mutation fails).
24
24
  *
25
+ * CP-1.f LOCK RP-3 — `replace` semantics. `User.availableAgents` is a
26
+ * cross-device UNION by default (`replace=false`), which never removes a
27
+ * stale agent (a `GEMINI` from a prior device/install would linger and
28
+ * get composed into the reviewer panel → `spawn gemini ENOENT`). The
29
+ * orchestration shell passes `replace=true` so the stored set is EXACTLY
30
+ * the current orchestration host's installed agents, AND — also per
31
+ * RP-3 — always writes even on zero detection (no skip-on-empty) so a
32
+ * stale set cannot linger. The 1.x companion-daemon callers keep the
33
+ * default `replace=false` (union) path, preserving their contract.
34
+ *
25
35
  * @param client AppSyncClient that's already been authenticated via
26
36
  * authenticateWithStoredTokens()
27
37
  * @param log Logger — warn-level when no agents detected, info
28
38
  * on success
39
+ * @param replace When true (orchestration shell), REPLACE the stored set
40
+ * with exactly the detected set and write even when empty.
41
+ * Default false (1.x companion union path).
29
42
  */
30
- export declare function pushDetectedAgents(client: AppSyncClient, log: Pick<Logger, 'info' | 'warn'>, capabilityRegistry?: CapabilityRegistry, detectFn?: () => DetectableAgent[]): Promise<void>;
43
+ export declare function pushDetectedAgents(client: AppSyncClient, log: Pick<Logger, 'info' | 'warn'>, capabilityRegistry?: CapabilityRegistry, detectFn?: () => DetectableAgent[], replace?: boolean): Promise<void>;
31
44
  /**
32
45
  * Quorum 2.0 (2f.0.a.6) per-session orchestration CLI override applier.
33
46
  * All three plugin wrappers (`codevibe-claude`, `codevibe-gemini`,
@@ -42,7 +42,8 @@ export declare const DEFAULT_ROLE_BY_SEAT: WizardRole[];
42
42
  /**
43
43
  * Canonical agent ordering used for wizard defaults. The first
44
44
  * installed agent in this order is the default for each seat unless
45
- * the user picks otherwise.
45
+ * the user picks otherwise. AGY-2.0: antigravity ranks LAST (weakest —
46
+ * defaulted only on an agy-only host), mirroring TIER2_REVIEWER_RANK.
46
47
  */
47
48
  export declare const AGENT_PRIORITY: AgentKind[];
48
49
  /**
@@ -0,0 +1,152 @@
1
+ import type { ImageAttachment } from './types';
2
+ /** Per-file on-disk cap (§10.5). */
3
+ export declare const MAX_IMAGE_BYTES: number;
4
+ /** Max attachments on the FINAL accumulated+deduped task set (§5). */
5
+ export declare const MAX_ATTACHMENTS = 8;
6
+ /** Sniff the raster MIME from the first bytes. Returns null if not a known raster. */
7
+ export declare function sniffImageMime(head: Buffer): {
8
+ mime: string;
9
+ ext: string;
10
+ } | null;
11
+ /**
12
+ * Extract candidate image-path SPANS from the raw text. Two passes:
13
+ * 1. single/double-quoted spans ending in an image extension;
14
+ * 2. on the remaining text (quoted spans masked out), bare / backslash-escaped
15
+ * / `file://` / `~`-relative spans ending in an image extension.
16
+ * Returns the EXACT matched span (`rawToken`, incl. quotes/escapes) — the brief
17
+ * replacement (§8) rewrites this exact span.
18
+ */
19
+ export declare function extractImagePathSpans(text: string): Array<{
20
+ rawToken: string;
21
+ }>;
22
+ export interface IngestReject {
23
+ token: string;
24
+ reason: string;
25
+ }
26
+ export interface IngestResult {
27
+ attachments: ImageAttachment[];
28
+ rejects: IngestReject[];
29
+ }
30
+ export interface IngestOptions {
31
+ cwd: string;
32
+ homedir: string;
33
+ /** ID minter (default `randomUUID`); injectable for deterministic tests. */
34
+ newId?: () => string;
35
+ /** Already-accumulated attachments (clarification loop) — for the FINAL count cap + sourcePath dedup (§5). */
36
+ existing?: ImageAttachment[];
37
+ }
38
+ /**
39
+ * Detect + validate image attachments in `text` (§4). UX-level validation
40
+ * (existsSync + regular-file + size + magic-sniff); the fd-safe `O_NOFOLLOW`
41
+ * re-validation at copy/base64 time (§7.3/§6) is the security boundary. Dedups by
42
+ * `sourcePath` (merging `rawTokens`) and enforces `MAX_ATTACHMENTS` on the FINAL
43
+ * accumulated set (`existing` ∪ newly-detected).
44
+ */
45
+ export declare function detectImageAttachments(text: string, opts: IngestOptions): IngestResult;
46
+ /**
47
+ * Build validated `ImageAttachment`s DIRECTLY from resolved absolute paths — no text
48
+ * tokenization (Stage-1 R2 M-1). Used for the §13 Option-2 InputBar chip: the paths
49
+ * are carried out-of-band, so re-serializing them through the text detector would
50
+ * mangle paths containing `"`/`\`. Each path is `path.resolve`d + validated via the
51
+ * SAME `promoteLexicalImagePath` (authoritative re-validation of the InputBar's
52
+ * optimistic check). Deduped by resolved path; `MAX_ATTACHMENTS` enforced.
53
+ */
54
+ export declare function attachmentsFromPaths(paths: string[], opts?: {
55
+ newId?: () => string;
56
+ existing?: ImageAttachment[];
57
+ }): IngestResult;
58
+ /** Human advisory for a set of rejects (§4/§9) — a clear, actionable line per reject. */
59
+ export declare function formatIngestRejects(rejects: IngestReject[]): string | null;
60
+ /** The in-worktree attachments dir (§7). Excluded from BOTH diff-capture paths + promote. */
61
+ export declare const SHADOW_ATTACHMENTS_DIR = ".codevibe-attachments";
62
+ /** The AGENT-NEUTRAL in-worktree relative ref for an attachment (§7.2/§8). */
63
+ export declare function attachmentRelPath(a: ImageAttachment): string;
64
+ export interface CopiedAttachment {
65
+ id: string;
66
+ relPath: string;
67
+ mime: string;
68
+ }
69
+ export interface PreparedAttachments {
70
+ copiedAttachments: CopiedAttachment[];
71
+ failedAttachments: ImageAttachment[];
72
+ /** The brief with FAILED-copy refs rewritten to a neutral marker (no dangling ref). */
73
+ roundBrief: string;
74
+ }
75
+ /**
76
+ * Per-round copy + failure-rewrite in ONE step (§7.3, rev-7). For each attachment,
77
+ * fd-copy (the §6/§7.3 `O_NOFOLLOW` + byte-ceiling + re-sniff re-validation) into
78
+ * `<shadowDir>/.codevibe-attachments/<id>.<ext>` via a temp + atomic rename; for a
79
+ * FAILED copy, unlink the partial dest AND rewrite that attachment's neutral rel-ref
80
+ * in `roundBrief` to `[attached image skipped]` (so no dangling ref survives). The
81
+ * returned `roundBrief` (failures neutralized) feeds BOTH the per-agent stdin AND
82
+ * the execute-first payload. Never throws / never hard-blocks.
83
+ */
84
+ export declare function prepareAttachmentsForSpawn(roundBrief: string, attachments: ImageAttachment[], shadowDir: string): PreparedAttachments;
85
+ /**
86
+ * Per-agent rendering of the copied-attachment refs, appended to the brief at spawn
87
+ * (§7.2). The stored/canonical brief is agent-NEUTRAL (`.codevibe-attachments/<id>.<ext>`);
88
+ * this adds the agent-specific pointer: Claude/Codex → an `Attached images:` list of
89
+ * relative paths (read via their Read tool); Gemini → the `@./…` form.
90
+ */
91
+ export declare function renderAttachmentsForAgent(agent: string, copied: CopiedAttachment[], workdir?: string): string;
92
+ /**
93
+ * The TEAM-DECOMPOSER brief transform (§7.5). The decomposition implementor runs
94
+ * in the REAL repo (no shadow, no copy), so it must NOT see an in-worktree ref OR
95
+ * an absolute path — replace every typed image token with a text-only marker. The
96
+ * ACTUAL images flow to the implementing track(s) via the group attachment set;
97
+ * the decomposer only needs to know an image exists so it routes work sensibly.
98
+ */
99
+ export declare function stripAttachmentsForDecomposer(brief: string, attachments: ImageAttachment[]): string;
100
+ /**
101
+ * Replace every typed image rawToken span (across the turn + clarification answers)
102
+ * with the AGENT-NEUTRAL in-worktree relative ref (§8) so no absolute `/Users/…`
103
+ * path leaks into a brief that gets stored / encrypted / sent to an implementor.
104
+ * Used by `composeImplementationBrief` AND (Stage-2 R1 HIGH-2) by the team-launch
105
+ * path to sanitize the manual `/team` per-track briefs, which never pass through
106
+ * `composeImplementationBrief`.
107
+ */
108
+ export declare function rewriteAttachmentTokensToRefs(brief: string, attachments: ImageAttachment[]): string;
109
+ /**
110
+ * §13 Option-2 — replace each `[Image #N]` chip token with the ref of the attachment
111
+ * for the N-th CARRIED PATH. `orderedPaths` is the ordered-with-DUPLICATES resolved
112
+ * carried-path list aligned 1:1 with the chip numbers in `brief` (the InputBar
113
+ * renumbers chips densely in reading order at submit, and the shell accumulates +
114
+ * cross-turn-renumbers across a clarification so numbers are globally unique). Keying
115
+ * on the carried PATH (then resolving to the deduped attachment) — rather than a
116
+ * deduped `attachments[N-1]` index — is what makes a DUPLICATE same-file drag
117
+ * (`images=[A,A,B]` → dedup `[A,B]`) map `#1→A #2→A #3→B` correctly (Stage-2 R5), and
118
+ * a cross-turn accumulation map each turn's image to its own ref (the multi-turn case).
119
+ * An out-of-range N or an unknown path (a typed literal `[Image #99]`) degrades to a
120
+ * neutral marker — never a wrong ref. Run AFTER `rewriteAttachmentTokensToRefs`; the
121
+ * two token classes (typed raw-path spans vs `[Image #N]` chips) are disjoint.
122
+ */
123
+ export declare function rewriteChipTokensByNumber(brief: string, orderedPaths: string[], attachments: ImageAttachment[]): string;
124
+ /** Per-model-call total base64-source cap (§6): base64 inflates ~33%; distinct from the 10 MB per-file copy cap. */
125
+ export declare const MAX_BASE64_SOURCE_BYTES: number;
126
+ /**
127
+ * The SECURITY-boundary read (§4/§6/§7.3): open the LEXICAL absolute path with
128
+ * `O_RDONLY | O_NOFOLLOW` (refuses if the final component is a symlink — defeats a
129
+ * post-ingest swap to a symlink-to-`/etc/…`), `fstat` the FD (re-check
130
+ * regular-file), read with a running byte ceiling (defends a file that grew after
131
+ * ingest), and re-sniff the magic bytes from the FD. NEVER a naive
132
+ * `fs.readFile(sourcePath)`. Throws on any violation. Shared by the base64 read
133
+ * (§6) and the copy-into-shadow path (§7.3).
134
+ */
135
+ export declare function readImageFdSafe(sourcePath: string, maxBytes?: number): {
136
+ buf: Buffer;
137
+ mime: string;
138
+ };
139
+ /**
140
+ * Shell-layer helper (§6): read the attachments fd-safe and return RAW base64
141
+ * (NO `data:` prefix — Ollama's `images[]` wants raw base64) for the LOCAL model,
142
+ * under a per-call total-source-bytes cap + a count cap (first-N-under-cap). Any
143
+ * attachment that fails the fd-safe read is returned in `failed` — callers
144
+ * proceed text-only with a content-free advisory, never block/throw.
145
+ */
146
+ export declare function attachmentsToBase64(attachments: ImageAttachment[], opts?: {
147
+ maxTotalBytes?: number;
148
+ maxCount?: number;
149
+ }): {
150
+ images: string[];
151
+ failed: ImageAttachment[];
152
+ };