@jmanuelcorral/openteam 0.2.2 → 0.9.0

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 (306) hide show
  1. package/.opencode/command/openteam.md +2 -1
  2. package/.opencode/openteam.example.json +27 -8
  3. package/AGENTS.md +5 -2
  4. package/README.es.md +155 -59
  5. package/README.md +418 -62
  6. package/dist/capabilities/types.d.ts +3 -3
  7. package/dist/capabilities/types.d.ts.map +1 -1
  8. package/dist/classifier/localClassifier.d.ts +0 -2
  9. package/dist/classifier/localClassifier.d.ts.map +1 -1
  10. package/dist/cli/consoleServe.d.ts +21 -1
  11. package/dist/cli/consoleServe.d.ts.map +1 -1
  12. package/dist/cli/graphOperator.d.ts +22 -0
  13. package/dist/cli/graphOperator.d.ts.map +1 -0
  14. package/dist/cli/graphStatusSnapshot.d.ts +16 -0
  15. package/dist/cli/graphStatusSnapshot.d.ts.map +1 -0
  16. package/dist/cli/migrateAdapter.d.ts +12 -0
  17. package/dist/cli/migrateAdapter.d.ts.map +1 -0
  18. package/dist/cli/purgeAdapter.d.ts +10 -0
  19. package/dist/cli/purgeAdapter.d.ts.map +1 -0
  20. package/dist/cli/setupAdapters.d.ts.map +1 -1
  21. package/dist/cli.js +13394 -6121
  22. package/dist/commands/agents.d.ts +102 -2
  23. package/dist/commands/agents.d.ts.map +1 -1
  24. package/dist/commands/baseline.d.ts.map +1 -1
  25. package/dist/commands/clearCache.d.ts +23 -0
  26. package/dist/commands/clearCache.d.ts.map +1 -0
  27. package/dist/commands/dispatch.d.ts +196 -4
  28. package/dist/commands/dispatch.d.ts.map +1 -1
  29. package/dist/commands/doctor.d.ts +40 -0
  30. package/dist/commands/doctor.d.ts.map +1 -1
  31. package/dist/commands/frontierCatalog.d.ts +8 -14
  32. package/dist/commands/frontierCatalog.d.ts.map +1 -1
  33. package/dist/commands/graph.d.ts +0 -27
  34. package/dist/commands/graph.d.ts.map +1 -1
  35. package/dist/commands/local.d.ts.map +1 -1
  36. package/dist/commands/migrate.d.ts +11 -0
  37. package/dist/commands/migrate.d.ts.map +1 -0
  38. package/dist/commands/purge.d.ts +132 -0
  39. package/dist/commands/purge.d.ts.map +1 -0
  40. package/dist/commands/report.d.ts +1 -0
  41. package/dist/commands/report.d.ts.map +1 -1
  42. package/dist/commands/setup.d.ts +62 -5
  43. package/dist/commands/setup.d.ts.map +1 -1
  44. package/dist/config/errors.d.ts +10 -0
  45. package/dist/config/errors.d.ts.map +1 -0
  46. package/dist/config/legacyMigration.d.ts +82 -0
  47. package/dist/config/legacyMigration.d.ts.map +1 -0
  48. package/dist/config/legacyPaths.d.ts +105 -0
  49. package/dist/config/legacyPaths.d.ts.map +1 -0
  50. package/dist/config/load.d.ts.map +1 -1
  51. package/dist/config/opencode.d.ts +63 -0
  52. package/dist/config/opencode.d.ts.map +1 -0
  53. package/dist/config/persist.d.ts +8 -0
  54. package/dist/config/persist.d.ts.map +1 -1
  55. package/dist/config/resolve.d.ts +1 -1
  56. package/dist/config/resolve.d.ts.map +1 -1
  57. package/dist/config/runtime.d.ts +62 -0
  58. package/dist/config/runtime.d.ts.map +1 -0
  59. package/dist/config/schema.d.ts +142 -79
  60. package/dist/config/schema.d.ts.map +1 -1
  61. package/dist/console/assets.d.ts +2 -2
  62. package/dist/console/assets.d.ts.map +1 -1
  63. package/dist/console/configView.d.ts +74 -0
  64. package/dist/console/configView.d.ts.map +1 -0
  65. package/dist/console/opencodeClient.d.ts +8 -6
  66. package/dist/console/opencodeClient.d.ts.map +1 -1
  67. package/dist/console/protocol.d.ts +30 -6
  68. package/dist/console/protocol.d.ts.map +1 -1
  69. package/dist/console/render.d.ts +30 -1
  70. package/dist/console/render.d.ts.map +1 -1
  71. package/dist/console/types.d.ts +1 -1
  72. package/dist/console/types.d.ts.map +1 -1
  73. package/dist/context/redaction.d.ts +19 -19
  74. package/dist/context/redaction.d.ts.map +1 -1
  75. package/dist/context/schema.d.ts +26 -26
  76. package/dist/context/schema.d.ts.map +1 -1
  77. package/dist/context/types.d.ts +3 -3
  78. package/dist/contract/opencode.d.ts +39 -23
  79. package/dist/contract/opencode.d.ts.map +1 -1
  80. package/dist/graph/certificate.d.ts +37 -16
  81. package/dist/graph/certificate.d.ts.map +1 -1
  82. package/dist/graph/langgraph/adapter.d.ts +56 -0
  83. package/dist/graph/langgraph/adapter.d.ts.map +1 -0
  84. package/dist/graph/langgraph/certification.d.ts +64 -0
  85. package/dist/graph/langgraph/certification.d.ts.map +1 -0
  86. package/dist/graph/langgraph/checkpointReplay.d.ts +49 -0
  87. package/dist/graph/langgraph/checkpointReplay.d.ts.map +1 -0
  88. package/dist/graph/langgraph/checkpointer.d.ts +49 -0
  89. package/dist/graph/langgraph/checkpointer.d.ts.map +1 -0
  90. package/dist/graph/langgraph/engine.d.ts +34 -0
  91. package/dist/graph/langgraph/engine.d.ts.map +1 -0
  92. package/dist/graph/langgraph/graphModel.d.ts +37 -0
  93. package/dist/graph/langgraph/graphModel.d.ts.map +1 -0
  94. package/dist/graph/langgraph/reducer.d.ts +18 -0
  95. package/dist/graph/langgraph/reducer.d.ts.map +1 -0
  96. package/dist/graph/langgraph/retirement.d.ts +59 -0
  97. package/dist/graph/langgraph/retirement.d.ts.map +1 -0
  98. package/dist/graph/langgraph/types.d.ts +65 -0
  99. package/dist/graph/langgraph/types.d.ts.map +1 -0
  100. package/dist/graph/privacyPolicy.d.ts +7 -0
  101. package/dist/graph/privacyPolicy.d.ts.map +1 -1
  102. package/dist/graph/soakLedger.d.ts.map +1 -1
  103. package/dist/graph/types.d.ts +0 -2
  104. package/dist/graph/types.d.ts.map +1 -1
  105. package/dist/index.d.ts +46 -15
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +11083 -5009
  108. package/dist/local/cacheAdapter.d.ts +7 -0
  109. package/dist/local/cacheAdapter.d.ts.map +1 -0
  110. package/dist/local/concurrency.d.ts +52 -0
  111. package/dist/local/concurrency.d.ts.map +1 -0
  112. package/dist/local/embeddings.d.ts +10 -10
  113. package/dist/local/embeddings.d.ts.map +1 -1
  114. package/dist/local/extractClient.d.ts +13 -10
  115. package/dist/local/extractClient.d.ts.map +1 -1
  116. package/dist/local/lemonade.d.ts +4 -0
  117. package/dist/local/lemonade.d.ts.map +1 -0
  118. package/dist/local/registry.d.ts +16 -0
  119. package/dist/local/registry.d.ts.map +1 -1
  120. package/dist/local/types.d.ts +1 -1
  121. package/dist/local/types.d.ts.map +1 -1
  122. package/dist/mcp/semanticRecall.d.ts +18 -1
  123. package/dist/mcp/semanticRecall.d.ts.map +1 -1
  124. package/dist/mcp/server.d.ts +41 -1
  125. package/dist/mcp/server.d.ts.map +1 -1
  126. package/dist/memory/embedText.d.ts +4 -0
  127. package/dist/memory/embedText.d.ts.map +1 -0
  128. package/dist/memory/extract.d.ts +33 -18
  129. package/dist/memory/extract.d.ts.map +1 -1
  130. package/dist/memory/fold.d.ts +3 -2
  131. package/dist/memory/fold.d.ts.map +1 -1
  132. package/dist/memory/index.d.ts +1 -0
  133. package/dist/memory/index.d.ts.map +1 -1
  134. package/dist/memory/inject.d.ts.map +1 -1
  135. package/dist/memory/log.d.ts +15 -4
  136. package/dist/memory/log.d.ts.map +1 -1
  137. package/dist/memory/merge.d.ts +18 -1
  138. package/dist/memory/merge.d.ts.map +1 -1
  139. package/dist/memory/traverse.d.ts +80 -0
  140. package/dist/memory/traverse.d.ts.map +1 -0
  141. package/dist/memory/types.d.ts +53 -7
  142. package/dist/memory/types.d.ts.map +1 -1
  143. package/dist/messages/commands.d.ts +84 -0
  144. package/dist/messages/commands.d.ts.map +1 -0
  145. package/dist/messages/index.d.ts +46 -0
  146. package/dist/messages/index.d.ts.map +1 -0
  147. package/dist/opencodeArtifacts/index.d.ts +33 -0
  148. package/dist/opencodeArtifacts/index.d.ts.map +1 -0
  149. package/dist/opencodeArtifacts/orchestratorAgent.d.ts +29 -0
  150. package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -0
  151. package/dist/opencodeArtifacts/slashCommand.d.ts +31 -0
  152. package/dist/opencodeArtifacts/slashCommand.d.ts.map +1 -0
  153. package/dist/orchestrator/coordinator.d.ts +152 -1
  154. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  155. package/dist/orchestrator/graphCancellation.d.ts +40 -37
  156. package/dist/orchestrator/graphCancellation.d.ts.map +1 -1
  157. package/dist/orchestrator/graphEffects.d.ts +24 -24
  158. package/dist/orchestrator/graphEffects.d.ts.map +1 -1
  159. package/dist/orchestrator/graphFacade.d.ts +16 -16
  160. package/dist/orchestrator/graphFacade.d.ts.map +1 -1
  161. package/dist/orchestrator/graphIngress.d.ts +49 -45
  162. package/dist/orchestrator/graphIngress.d.ts.map +1 -1
  163. package/dist/orchestrator/graphReview.d.ts +24 -23
  164. package/dist/orchestrator/graphReview.d.ts.map +1 -1
  165. package/dist/orchestrator/graphRuntime.d.ts +27 -26
  166. package/dist/orchestrator/graphRuntime.d.ts.map +1 -1
  167. package/dist/orchestrator/graphShadow.d.ts +70 -69
  168. package/dist/orchestrator/graphShadow.d.ts.map +1 -1
  169. package/dist/orchestrator/opencodeSessionAdapter.d.ts +25 -25
  170. package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
  171. package/dist/orchestrator/permissions.d.ts.map +1 -1
  172. package/dist/orchestrator/ralphLoop.d.ts +57 -0
  173. package/dist/orchestrator/ralphLoop.d.ts.map +1 -0
  174. package/dist/orchestrator/roles.d.ts +50 -8
  175. package/dist/orchestrator/roles.d.ts.map +1 -1
  176. package/dist/orchestrator/roster.d.ts +103 -0
  177. package/dist/orchestrator/roster.d.ts.map +1 -0
  178. package/dist/orchestrator/rosterPersistence.d.ts +22 -0
  179. package/dist/orchestrator/rosterPersistence.d.ts.map +1 -0
  180. package/dist/orchestrator/runtimeSelection.d.ts +46 -0
  181. package/dist/orchestrator/runtimeSelection.d.ts.map +1 -0
  182. package/dist/orchestrator/sddCompiler.d.ts +34 -34
  183. package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
  184. package/dist/orchestrator/sessionReconciler.d.ts +31 -29
  185. package/dist/orchestrator/sessionReconciler.d.ts.map +1 -1
  186. package/dist/orchestrator/shadowComparator.d.ts +23 -23
  187. package/dist/orchestrator/shadowComparator.d.ts.map +1 -1
  188. package/dist/orchestrator/subsessions.d.ts.map +1 -1
  189. package/dist/orchestrator/worktreeAdapter.d.ts +12 -12
  190. package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
  191. package/dist/orchestrator/worktreeDispatch.d.ts +34 -34
  192. package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
  193. package/dist/orchestrator/worktreeReconciler.d.ts +37 -36
  194. package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -1
  195. package/dist/plugin/availability.d.ts.map +1 -1
  196. package/dist/plugin/capture.d.ts +12 -12
  197. package/dist/plugin/capture.d.ts.map +1 -1
  198. package/dist/plugin/commandTool.d.ts +1 -1
  199. package/dist/plugin/commandTool.d.ts.map +1 -1
  200. package/dist/plugin/graphShadowIngress.d.ts +50 -48
  201. package/dist/plugin/graphShadowIngress.d.ts.map +1 -1
  202. package/dist/plugin/graphTool.d.ts +25 -23
  203. package/dist/plugin/graphTool.d.ts.map +1 -1
  204. package/dist/plugin/hooks.d.ts +10 -10
  205. package/dist/plugin/hooks.d.ts.map +1 -1
  206. package/dist/plugin/legacyRunProducer.d.ts +22 -22
  207. package/dist/plugin/legacyRunProducer.d.ts.map +1 -1
  208. package/dist/plugin/memoryInject.d.ts +6 -6
  209. package/dist/plugin/memoryInject.d.ts.map +1 -1
  210. package/dist/plugin/memoryTool.d.ts +36 -0
  211. package/dist/plugin/memoryTool.d.ts.map +1 -0
  212. package/dist/plugin/orchestrateTool.d.ts +35 -2
  213. package/dist/plugin/orchestrateTool.d.ts.map +1 -1
  214. package/dist/plugin/reportRunSchema.d.ts +8 -8
  215. package/dist/plugin/reportRunSchema.d.ts.map +1 -1
  216. package/dist/plugin/sessionTracker.d.ts +15 -15
  217. package/dist/plugin/sessionTracker.d.ts.map +1 -1
  218. package/dist/plugin/shadowPipeline.d.ts +2 -1
  219. package/dist/plugin/shadowPipeline.d.ts.map +1 -1
  220. package/dist/plugin/soakObserver.d.ts +18 -11
  221. package/dist/plugin/soakObserver.d.ts.map +1 -1
  222. package/dist/plugin/toolcalls.d.ts +3 -3
  223. package/dist/router/chooseModel.d.ts.map +1 -1
  224. package/dist/router/frontierBaseline.d.ts +3 -3
  225. package/dist/router/modelSelection.d.ts +12 -4
  226. package/dist/router/modelSelection.d.ts.map +1 -1
  227. package/dist/router/types.d.ts +6 -1
  228. package/dist/router/types.d.ts.map +1 -1
  229. package/dist/storage/graph/snapshot.d.ts.map +1 -1
  230. package/dist/storage/graph/soakRecorder.d.ts +14 -1
  231. package/dist/storage/graph/soakRecorder.d.ts.map +1 -1
  232. package/dist/storage/graph/workspaceLease.d.ts +1 -1
  233. package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
  234. package/dist/storage/graph/worktreeRegistry.d.ts +1 -1
  235. package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
  236. package/dist/storage/httpStorageProvider.d.ts +2 -2
  237. package/dist/storage/index/bunSqlite.d.ts +1 -0
  238. package/dist/storage/index/bunSqlite.d.ts.map +1 -1
  239. package/dist/storage/index/memoryConsolidate.d.ts +2 -0
  240. package/dist/storage/index/memoryConsolidate.d.ts.map +1 -1
  241. package/dist/storage/index/memoryEmbeddings.d.ts +51 -0
  242. package/dist/storage/index/memoryEmbeddings.d.ts.map +1 -0
  243. package/dist/storage/index/memoryIndex.d.ts +36 -4
  244. package/dist/storage/index/memoryIndex.d.ts.map +1 -1
  245. package/dist/storage/index/memoryRecall.d.ts +1 -1
  246. package/dist/storage/index/memoryRecall.d.ts.map +1 -1
  247. package/dist/storage/index/memoryRuntime.d.ts +2 -0
  248. package/dist/storage/index/memoryRuntime.d.ts.map +1 -1
  249. package/dist/storage/index/sqliteIndex.d.ts +18 -1
  250. package/dist/storage/index/sqliteIndex.d.ts.map +1 -1
  251. package/dist/storage/path.d.ts.map +1 -1
  252. package/dist/telemetry/aggregate.d.ts +12 -12
  253. package/dist/telemetry/aggregate.d.ts.map +1 -1
  254. package/dist/telemetry/cost.d.ts.map +1 -1
  255. package/dist/telemetry/decisions.d.ts +11 -11
  256. package/dist/telemetry/decisions.d.ts.map +1 -1
  257. package/dist/telemetry/eventLog.d.ts +41 -25
  258. package/dist/telemetry/eventLog.d.ts.map +1 -1
  259. package/dist/telemetry/events.d.ts +44 -36
  260. package/dist/telemetry/events.d.ts.map +1 -1
  261. package/dist/telemetry/fanout.d.ts +18 -0
  262. package/dist/telemetry/fanout.d.ts.map +1 -0
  263. package/dist/telemetry/graphProjection.d.ts +12 -12
  264. package/dist/telemetry/graphProjection.d.ts.map +1 -1
  265. package/dist/telemetry/graphRuntimeHealth.d.ts +26 -26
  266. package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -1
  267. package/dist/telemetry/graphView.d.ts +20 -20
  268. package/dist/telemetry/graphView.d.ts.map +1 -1
  269. package/dist/telemetry/otel.d.ts +86 -0
  270. package/dist/telemetry/otel.d.ts.map +1 -0
  271. package/dist/telemetry/otelConfig.d.ts +128 -0
  272. package/dist/telemetry/otelConfig.d.ts.map +1 -0
  273. package/dist/telemetry/otelExporter.d.ts +7 -0
  274. package/dist/telemetry/otelExporter.d.ts.map +1 -0
  275. package/dist/telemetry/read.d.ts +18 -4
  276. package/dist/telemetry/read.d.ts.map +1 -1
  277. package/dist/telemetry/types.d.ts +3 -2
  278. package/dist/telemetry/types.d.ts.map +1 -1
  279. package/dist/web/configApi.d.ts +154 -0
  280. package/dist/web/configApi.d.ts.map +1 -0
  281. package/dist/web/configRoute.d.ts +57 -0
  282. package/dist/web/configRoute.d.ts.map +1 -0
  283. package/dist/web/console.d.ts +8 -0
  284. package/dist/web/console.d.ts.map +1 -1
  285. package/dist/web/paths.d.ts +4 -3
  286. package/dist/web/paths.d.ts.map +1 -1
  287. package/dist/web/server.d.ts +30 -1
  288. package/dist/web/server.d.ts.map +1 -1
  289. package/dist/web/start.d.ts +15 -0
  290. package/dist/web/start.d.ts.map +1 -1
  291. package/dist/web/storageRoute.d.ts +2 -2
  292. package/package.json +13 -7
  293. package/dist/cli/tunnel.d.ts +0 -89
  294. package/dist/cli/tunnel.d.ts.map +0 -1
  295. package/dist/commands/orchestratorAgent.d.ts +0 -30
  296. package/dist/commands/orchestratorAgent.d.ts.map +0 -1
  297. package/dist/commands/slashCommand.d.ts +0 -39
  298. package/dist/commands/slashCommand.d.ts.map +0 -1
  299. package/dist/orchestrator/ledger.d.ts +0 -28
  300. package/dist/orchestrator/ledger.d.ts.map +0 -1
  301. package/dist/storage/graph/importLegacy.d.ts +0 -62
  302. package/dist/storage/graph/importLegacy.d.ts.map +0 -1
  303. package/dist/storage/graph/migration.d.ts +0 -91
  304. package/dist/storage/graph/migration.d.ts.map +0 -1
  305. package/dist/storage/graph/projections.d.ts +0 -31
  306. package/dist/storage/graph/projections.d.ts.map +0 -1
@@ -1,57 +1,73 @@
1
1
  /**
2
- * Contrato con la superficie de extensión de opencode.
2
+ * Contract with opencode's extension surface.
3
3
  *
4
- * openteam depende de un conjunto acotado de tipos y comportamientos de
5
- * `@opencode-ai/plugin` y `@opencode-ai/sdk`. Este módulo es la única fuente de
6
- * verdad, en código, de las versiones soportadas. Los tests de contrato en
7
- * `tests/contract/**` fallan cuando la versión instalada se aleja de esta
8
- * allow-list, forzando una re-verificación manual de la superficie antes de
9
- * mergear un bump.
4
+ * openteam depends on a bounded set of types and behaviors from
5
+ * `@opencode-ai/plugin` and `@opencode-ai/sdk`. This module is the single
6
+ * source of truth, in code, for the supported versions. The contract tests in
7
+ * `tests/contract/**` fail when the installed version moves away from this
8
+ * allow-list, forcing a manual re-verification of the surface before merging a
9
+ * bump.
10
10
  *
11
- * Módulo puro: sin I/O, red, reloj, random ni env vars.
11
+ * Pure module: no I/O, network, clock, random, or env vars.
12
12
  */
13
13
  /**
14
- * Paquetes npm de opencode de los que depende openteam en runtime.
14
+ * opencode npm packages that openteam depends on at runtime.
15
15
  */
16
16
  export declare const OPENCODE_PACKAGES: readonly ["@opencode-ai/plugin", "@opencode-ai/sdk"];
17
17
  export type OpencodePackage = (typeof OPENCODE_PACKAGES)[number];
18
18
  /**
19
- * Versión mínima de los paquetes `@opencode-ai/*` verificada contra la
20
- * superficie que usa openteam.
19
+ * Minimum version of the `@opencode-ai/*` packages verified against the
20
+ * surface used by openteam.
21
21
  */
22
22
  export declare const MIN_SUPPORTED_OPENCODE_VERSION = "1.17.13";
23
23
  /**
24
- * Versiones exactas cuya superficie de contrato ha sido verificada. Al subir a
25
- * una versión nueva hay que añadirla aquí **después** de revisar los puntos de
26
- * integración documentados en {@link OPENCODE_CONTRACT_SURFACES}.
24
+ * Exact versions whose contract surface has been verified. When moving to a
25
+ * new version, it must be added here **after** reviewing the integration points
26
+ * documented in {@link OPENCODE_CONTRACT_SURFACES}.
27
27
  */
28
- export declare const SUPPORTED_OPENCODE_VERSIONS: readonly ["1.17.13", "1.18.18"];
28
+ export declare const SUPPORTED_OPENCODE_VERSIONS: readonly ["1.17.13", "1.18.18", "1.18.19"];
29
29
  export type SupportedOpencodeVersion = (typeof SUPPORTED_OPENCODE_VERSIONS)[number];
30
30
  /**
31
- * Puntos de integración concretos que openteam asume estables. Sirve como
32
- * checklist ejecutable/documental cuando se verifica una versión nueva.
31
+ * The opencode version this repo currently develops against. Equals the newest
32
+ * entry in `SUPPORTED_OPENCODE_VERSIONS` and the version pinned in
33
+ * `package.json` for `@opencode-ai/plugin`.
34
+ *
35
+ * Release certificates are stamped with this value. At startup,
36
+ * `parseReleaseCertificate` and `parseShadowCertificate` verify that the
37
+ * live server version matches this constant exactly — a mismatch means the
38
+ * evidence was gathered under a different opencode version.
39
+ *
40
+ * **When to bump:** when a new opencode version is added to
41
+ * `SUPPORTED_OPENCODE_VERSIONS` AND set as the dependency in `package.json`,
42
+ * update this constant to match. Re-run `bun run certify:release` and
43
+ * `bun run certify:shadow` afterwards to emit fresh v2 artifacts.
44
+ */
45
+ export declare const CURRENT_OPENCODE_VERSION: SupportedOpencodeVersion;
46
+ /**
47
+ * Concrete integration points that openteam assumes are stable. Serves as an
48
+ * executable/documentary checklist when verifying a new version.
33
49
  */
34
- export declare const OPENCODE_CONTRACT_SURFACES: readonly ['Hooks["chat.message"] permite mutar output.message.model', 'Hooks["chat.message"] permite mutar output.parts[].text (inyección de contexto)', "tool() + tool.schema (zod) para custom tools", "PluginModule = { id?, server } con server: (input, options?) => Promise<Hooks>", "SDK session.create / session.prompt aceptan body.model = { providerID, modelID }", 'Hooks["tool.execute.before"] / Hooks["tool.execute.after"] reciben { tool, sessionID, callID }', 'Hooks["event"] con message.updated trae properties.info (AssistantMessage) con cost:number y tokens{input,output,reasoning,cache{read,write}} y time{created,completed}', 'El frontmatter `permission` de un agente (`.opencode/agent/*.md`) ANULA el `permission` global de `opencode.json`; el catch-all `"*": allow` concede todos los permisos (base del modo YOLO)'];
50
+ export declare const OPENCODE_CONTRACT_SURFACES: readonly ['Hooks["chat.message"] allows mutating output.message.model', 'Hooks["chat.message"] allows mutating output.parts[].text (context injection)', "tool() + tool.schema (zod) for custom tools", "PluginModule = { id?, server } with server: (input, options?) => Promise<Hooks>", "SDK session.create accepts parentID/title; session.prompt accepts body.model = { providerID, modelID }", 'Hooks["tool.execute.before"] / Hooks["tool.execute.after"] receive { tool, sessionID, callID }', 'Hooks["event"] with message.updated brings properties.info (AssistantMessage) with cost:number and tokens{input,output,reasoning,cache{read,write}} and time{created,completed}', 'A per-agent `permission` frontmatter (`.opencode/agent/*.md`) OVERRIDES the global `permission` in `opencode.json`; the catch-all `"*": allow` grants all permissions (basis of YOLO mode)'];
35
51
  export type Semver = {
36
52
  readonly major: number;
37
53
  readonly minor: number;
38
54
  readonly patch: number;
39
55
  };
40
56
  /**
41
- * Parsea una versión semver, tolerando prefijos de rango habituales en
42
- * `package.json` (`^`, `~`, `=`, `v`). Ignora sufijos de pre-release/build.
57
+ * Parses a semver version, tolerating common range prefixes in `package.json`
58
+ * (`^`, `~`, `=`, `v`). Ignores pre-release/build suffixes.
43
59
  */
44
60
  export declare function parseSemver(version: string): Semver;
45
61
  /**
46
- * Compara dos versiones semver. Devuelve -1 si a<b, 0 si iguales, 1 si a>b.
62
+ * Compares two semver versions. Returns -1 if a<b, 0 if equal, 1 if a>b.
47
63
  */
48
64
  export declare function compareSemver(a: Semver, b: Semver): -1 | 0 | 1;
49
65
  /**
50
- * true si la versión exacta está en la allow-list verificada.
66
+ * true if the exact version is in the verified allow-list.
51
67
  */
52
68
  export declare function isSupportedOpencodeVersion(version: string): version is SupportedOpencodeVersion;
53
69
  /**
54
- * true si la versión cumple el piso mínimo soportado.
70
+ * true if the version meets the minimum supported floor.
55
71
  */
56
72
  export declare function meetsMinimumOpencodeVersion(version: string): boolean;
57
73
  //# sourceMappingURL=opencode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/contract/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,YAC5B,qBAAqB,EACrB,kBAAkB,CACV,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,8BAA8B,YAAY,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,YAAI,SAAS,EAAE,SAAS,CAAU,CAAC;AAE3E,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,YACrC,0DAA0D,EAC1D,iFAAiF,EACjF,8CAA8C,EAC9C,gFAAgF,EAChF,kFAAkF,EAClF,gGAAgG,EAChG,yKAAyK,EACzK,8LAA8L,CACtL,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CA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MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAIF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAanD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAc9D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GACd,OAAO,IAAI,wBAAwB,CAErC;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOpE"}
@@ -140,6 +140,32 @@ export declare class ShadowCertificateError extends Error {
140
140
  readonly detail: string;
141
141
  constructor(code: ShadowCertificateErrorCode, detail: string);
142
142
  }
143
+ /**
144
+ * Computes a stable chain-binding digest for a shadow certificate's evidence.
145
+ *
146
+ * The binding digest covers all structural evidence fields — parity counts,
147
+ * privacy results, overhead budget and sample count, provenance, and the
148
+ * opencode version — but intentionally excludes `overhead.p95Millis`.
149
+ *
150
+ * WHY: `p95Millis` is a wall-clock measurement that varies between runs of
151
+ * identical code (different CPU load, timer resolution, scheduler jitter). The
152
+ * shadow certificate's own `digest` covers it for tamper-evidence on the
153
+ * stored artifact, but the *chain binding* that links a release certificate to
154
+ * a particular shadow run must be stable across runs of the same code. Using
155
+ * `cert.digest` for the chain binding therefore makes the release certificate
156
+ * unverifiable at startup: `certify:release` captures one timing value, a
157
+ * separately run `certify:shadow` captures a different timing value, and the
158
+ * two digests never match.
159
+ *
160
+ * The binding digest answers "is this the shadow evidence produced for THIS
161
+ * version and configuration?" — a question that wall-clock measurements cannot
162
+ * help answer, and including them only introduces spurious inequality.
163
+ *
164
+ * `overhead.budgetMillis` and `overhead.samples` ARE included: the budget is a
165
+ * configuration constant and the sample count is determined by the fixture, so
166
+ * both are stable across runs.
167
+ */
168
+ export declare function shadowCertificateBindingDigest(evidence: ShadowCertificateEvidence): string;
143
169
  /**
144
170
  * Construye el certificado a partir de la evidencia. El veredicto **no es un
145
171
  * parámetro**: se deriva de las puertas, de modo que no existe un camino para
@@ -157,8 +183,12 @@ export declare function parseShadowCertificate(value: unknown, opencodeVersion:
157
183
  * Puertas del certificado de release. Cada una es condición **necesaria**: una
158
184
  * puerta que corrió cero casos falla por vacuidad, y la ausencia de evidencia
159
185
  * es fracaso, no éxito.
186
+ *
187
+ * La puerta `migration` fue eliminada en v2: no existe ninguna instalación con
188
+ * datos en formato legacy que necesite migración, y certificar código
189
+ * inalcanzable era teatro, no evidencia real.
160
190
  */
161
- export type ReleaseCertificateGate = "shadow-valid" | "determinism" | "crash-recovery" | "replay-equivalence" | "privacy" | "contract" | "migration" | "health" | "performance";
191
+ export type ReleaseCertificateGate = "shadow-valid" | "determinism" | "crash-recovery" | "replay-equivalence" | "privacy" | "contract" | "health" | "performance";
162
192
  declare const ReleaseEvidenceSchema: z.ZodObject<{
163
193
  opencodeVersion: z.ZodString;
164
194
  platform: z.ZodEnum<{
@@ -186,10 +216,6 @@ declare const ReleaseEvidenceSchema: z.ZodObject<{
186
216
  roundTrips: z.ZodNumber;
187
217
  allSettled: z.ZodBoolean;
188
218
  }, z.core.$strict>;
189
- migration: z.ZodObject<{
190
- cases: z.ZodNumber;
191
- allSucceeded: z.ZodBoolean;
192
- }, z.core.$strict>;
193
219
  health: z.ZodObject<{
194
220
  samples: z.ZodNumber;
195
221
  bounded: z.ZodBoolean;
@@ -204,7 +230,7 @@ declare const ReleaseEvidenceSchema: z.ZodObject<{
204
230
  /** Evidencia bruta que alimenta el certificado de release. */
205
231
  export type ReleaseCertificateEvidence = z.infer<typeof ReleaseEvidenceSchema>;
206
232
  declare const ReleaseCertificateSchema: z.ZodObject<{
207
- version: z.ZodLiteral<1>;
233
+ version: z.ZodLiteral<2>;
208
234
  certificate: z.ZodLiteral<"graph-release">;
209
235
  platform: z.ZodEnum<{
210
236
  linux: "linux";
@@ -239,10 +265,6 @@ declare const ReleaseCertificateSchema: z.ZodObject<{
239
265
  roundTrips: z.ZodNumber;
240
266
  allSettled: z.ZodBoolean;
241
267
  }, z.core.$strict>;
242
- migration: z.ZodObject<{
243
- cases: z.ZodNumber;
244
- allSucceeded: z.ZodBoolean;
245
- }, z.core.$strict>;
246
268
  health: z.ZodObject<{
247
269
  samples: z.ZodNumber;
248
270
  bounded: z.ZodBoolean;
@@ -263,7 +285,6 @@ declare const ReleaseCertificateSchema: z.ZodObject<{
263
285
  "crash-recovery": "crash-recovery";
264
286
  determinism: "determinism";
265
287
  health: "health";
266
- migration: "migration";
267
288
  performance: "performance";
268
289
  privacy: "privacy";
269
290
  "replay-equivalence": "replay-equivalence";
@@ -271,8 +292,8 @@ declare const ReleaseCertificateSchema: z.ZodObject<{
271
292
  }>>;
272
293
  digest: z.ZodString;
273
294
  }, z.core.$strict>;
274
- /** Certificado machine-readable de release del grafo. */
275
- export type GraphReleaseCertificateV1 = z.infer<typeof ReleaseCertificateSchema>;
295
+ /** Certificado machine-readable de release del grafo (v2). */
296
+ export type GraphReleaseCertificateV2 = z.infer<typeof ReleaseCertificateSchema>;
276
297
  /** Motivo tipado por el que un certificado de release no es aceptable. */
277
298
  export type ReleaseCertificateErrorCode = "invalid-certificate" | "field-inconsistency" | "verdict-mismatch" | "digest-mismatch" | "opencode-mismatch";
278
299
  /** Error fail-closed del certificado de release. */
@@ -290,7 +311,7 @@ export declare class ReleaseCertificateError extends Error {
290
311
  * coincide, la puerta `shadow-valid` falla. Es obligatorio: un certificado
291
312
  * nunca puede ser su propio testigo.
292
313
  */
293
- export declare function buildReleaseCertificate(evidence: ReleaseCertificateEvidence, expectedShadowDigest: string): GraphReleaseCertificateV1;
314
+ export declare function buildReleaseCertificate(evidence: ReleaseCertificateEvidence, expectedShadowDigest: string): GraphReleaseCertificateV2;
294
315
  /**
295
316
  * Valida un certificado de release de procedencia no confiable. Fail-closed:
296
317
  * `invalid-certificate` → `field-inconsistency` → `verdict-mismatch` →
@@ -300,7 +321,7 @@ export declare function buildReleaseCertificate(evidence: ReleaseCertificateEvid
300
321
  * espera — impide que un certificado forjado declare un digest falso y pase
301
322
  * la puerta `shadow-valid` por autocomparación.
302
323
  */
303
- export declare function parseReleaseCertificate(value: unknown, opencodeVersion: string, expectedShadowDigest: string): GraphReleaseCertificateV1;
324
+ export declare function parseReleaseCertificate(value: unknown, opencodeVersion: string, expectedShadowDigest: string): GraphReleaseCertificateV2;
304
325
  /**
305
326
  * Puertas del certificado soak. Cada una es condición **necesaria**; cero
306
327
  * observaciones fallan cerrado por la puerta `minimum-observations`, no por
@@ -311,7 +332,7 @@ export type SoakCertificateGate = "minimum-observations" | "minimum-duration" |
311
332
  * Shadow divergence codes that the soak mechanism can classify as critical.
312
333
  * Defined here (not imported from orchestrator) to keep the graph module pure.
313
334
  */
314
- export declare const ShadowDivergenceCodeSchema: z.ZodEnum<{
335
+ declare const ShadowDivergenceCodeSchema: z.ZodEnum<{
315
336
  fixes: "fixes";
316
337
  models: "models";
317
338
  order: "order";
@@ -1 +1 @@
1
- {"version":3,"file":"certificate.d.ts","sourceRoot":"","sources":["../../src/graph/certificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,2EAA2E;AAC3E,MAAM,MAAM,qBAAqB,GAC7B,QAAQ,GACR,QAAQ,GACR,sBAAsB,GACtB,SAAS,GACT,UAAU,CAAC;AAEf,0CAA0C;AAC1C,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAkBvD,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,OAAO,kBAAkB,CAAC,CAAC;AAEzE,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwBhB,CAAC;AAEZ,uDAAuD;AACvD,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE3E,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAChC,qBAAqB,GACrB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB,8CAA8C;AAC9C,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,IAAI,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,EAKzD;CACF;AAgJD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,EAC/C,MAAM,EAAE,UAAU,GACjB,sBAAsB,CA0BxB;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,UAAU,EAC1B,oBAAoB,EAAE,MAAM,GAC3B,sBAAsB,CAqDxB"}
@@ -0,0 +1,56 @@
1
+ import type { PrivacyClass } from "../../context/schema";
2
+ import { type PrivacyMode } from "../privacyPolicy";
3
+ import type { AdapterDeps, AdapterInput, AdapterState, NodeFn, NodeName, RouteKind } from "./types";
4
+ /**
5
+ * LangGraph runtime adapter (W4-S03, #177) — engine-agnostic decision core.
6
+ *
7
+ * `@langchain/langgraph@1.4.12` is now a declared dependency (W4-S01/W4-S02),
8
+ * marked `--external` in the build flags, but this module deliberately still
9
+ * does not import the library: it stays an engine-agnostic decision core so the
10
+ * six release gates certify deterministic semantics rather than a library
11
+ * version, and because runtime resolution under Node (Bun's resolver is more
12
+ * forgiving) is not yet proven. Instead it defines the
13
+ * StateGraph the binding will build — a route node, a dispatch node, an
14
+ * accumulating `visited` channel and a conditional edge — and a deterministic
15
+ * reference runner (`invokeStateGraph`) that executes those semantics. The
16
+ * eventual binding is a thin, mechanical mapping:
17
+ *
18
+ * const g = new StateGraph(Annotation.Root({ ...channels, visited: reducer }))
19
+ * .addNode("route", routeNode)
20
+ * .addNode("dispatch", dispatchNode)
21
+ * .addConditionalEdges("route", next)
22
+ * .addEdge("dispatch", END);
23
+ * return g.compile().invoke(input);
24
+ *
25
+ * The determinism, latency and privacy-routing properties proven against this
26
+ * runner are exactly what that binding preserves. Like the in-house facade
27
+ * (`orchestrator/graphFacade.ts`), the adapter is contained: it governs only
28
+ * routing/reduction and drives effects through the injected executor.
29
+ */
30
+ /** Terminal marker, mirroring LangGraph's `END`. */
31
+ declare const GRAPH_END: "__end__";
32
+ /** Static description of the two-node StateGraph the binding will compile. */
33
+ export type StateGraphDefinition = {
34
+ readonly entry: NodeName;
35
+ readonly nodes: Readonly<Record<NodeName, NodeFn>>;
36
+ readonly next: (state: AdapterState, current: NodeName) => NodeName | typeof GRAPH_END;
37
+ };
38
+ /**
39
+ * Resolves the effective dispatch route. Delegates to the shared GE-037 rule
40
+ * `frontierAllowed` (`../privacyPolicy`) — the single source of truth also used
41
+ * by `orchestrator/resolveDispatchRoute`. The privacy rule is reused, not
42
+ * forked: a `sensitive` node under `forceLocalOnSensitive` degrades a preferred
43
+ * `frontier` route to `local` (zero frontier dispatches) rather than throwing.
44
+ */
45
+ export declare function resolveNodeRoute(privacyClass: PrivacyClass, mode: PrivacyMode, preferred: RouteKind): RouteKind;
46
+ /** Builds the two-node StateGraph definition: route -> dispatch -> END. */
47
+ export declare function buildAdapterDefinition(): StateGraphDefinition;
48
+ /**
49
+ * Deterministic reference runner for a `StateGraphDefinition`. Executes each
50
+ * node, merges its update through the pure reducer, and follows the conditional
51
+ * edge until `END`. Given a deterministic executor, the same input yields the
52
+ * same final state on every invocation.
53
+ */
54
+ export declare function invokeStateGraph(definition: StateGraphDefinition, input: AdapterInput, deps: AdapterDeps): Promise<AdapterState>;
55
+ export {};
56
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,SAAS,EAEV,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,oDAAoD;AACpD,QAAA,MAAM,SAAS,EAAG,SAAkB,CAAC;AAErC,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,CACb,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,QAAQ,KACd,QAAQ,GAAG,OAAO,SAAS,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,SAAS,GACnB,SAAS,CAIX;AA8BD,2EAA2E;AAC3E,wBAAgB,sBAAsB,IAAI,oBAAoB,CAM7D;AAKD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,oBAAoB,EAChC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,YAAY,CAAC,CAoBvB"}
@@ -0,0 +1,64 @@
1
+ import type { ReleaseCertificateEvidence } from "../certificate";
2
+ import { type StateGraphDefinition } from "./adapter";
3
+ import { type CheckpointerSelection, type ReferenceOnlySaver } from "./checkpointer";
4
+ import type { AdapterReceipt, NodeExecutor } from "./types";
5
+ /**
6
+ * Serializes a receipt and parses it back through the wire schema. The contract
7
+ * gate is satisfied only when the reconstructed receipt equals the original, so
8
+ * a codec that drops or corrupts a field turns the gate red.
9
+ */
10
+ export declare function roundTripReceipt(receipt: AdapterReceipt): AdapterReceipt;
11
+ /** Options for gathering release evidence. Counts and clock are injectable so
12
+ * tests can drive fault cases deterministically; defaults exercise the engine. */
13
+ export type LangGraphEvidenceOptions = {
14
+ readonly executor: NodeExecutor;
15
+ readonly opencodeVersion: string;
16
+ readonly platform: "linux" | "win32";
17
+ readonly shadowCertificateDigest: string;
18
+ readonly now?: () => number;
19
+ readonly determinismRuns?: number;
20
+ readonly performanceSamples?: number;
21
+ readonly performanceBudgetMillis?: number;
22
+ readonly crashScenarios?: number;
23
+ readonly replayChecks?: number;
24
+ readonly privacySurfaces?: number;
25
+ readonly contractRoundTrips?: number;
26
+ readonly healthSamples?: number;
27
+ };
28
+ export declare function determinismEvidence(definition: StateGraphDefinition, executor: NodeExecutor, runs: number): Promise<{
29
+ runs: number;
30
+ allMatch: boolean;
31
+ }>;
32
+ export declare function performanceEvidence(definition: StateGraphDefinition, executor: NodeExecutor, samples: number, budgetMillis: number, now: () => number): Promise<{
33
+ p95Millis: number;
34
+ budgetMillis: number;
35
+ samples: number;
36
+ }>;
37
+ export declare function crashRecoveryEvidence(definition: StateGraphDefinition, executor: NodeExecutor, scenarios: number): Promise<{
38
+ scenarios: number;
39
+ allConverge: boolean;
40
+ }>;
41
+ export declare function replayEquivalenceEvidence(definition: StateGraphDefinition, executor: NodeExecutor, checks: number): Promise<{
42
+ checks: number;
43
+ allEquivalent: boolean;
44
+ }>;
45
+ export declare function requireReferenceOnlySaver(selection: CheckpointerSelection): ReferenceOnlySaver;
46
+ export declare function privacyEvidence(definition: StateGraphDefinition, executor: NodeExecutor, surfaces: number): Promise<{
47
+ surfacesScanned: number;
48
+ rawFindings: number;
49
+ }>;
50
+ export declare function contractEvidence(definition: StateGraphDefinition, executor: NodeExecutor, roundTrips: number): Promise<{
51
+ roundTrips: number;
52
+ allSettled: boolean;
53
+ }>;
54
+ export declare function healthEvidence(definition: StateGraphDefinition, executor: NodeExecutor, samples: number, nodeCount: number): Promise<{
55
+ samples: number;
56
+ bounded: boolean;
57
+ idempotent: boolean;
58
+ }>;
59
+ /**
60
+ * Runs the LangGraph adapter and reconstructed primitives to produce a complete
61
+ * `ReleaseCertificateEvidence` object. Feed the result to `buildReleaseCertificate`.
62
+ */
63
+ export declare function gatherLangGraphReleaseEvidence(options: LangGraphEvidenceOptions): Promise<ReleaseCertificateEvidence>;
64
+ //# sourceMappingURL=certification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certification.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/certification.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAGV,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AA2BjB;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAQxE;AAED;kFACkF;AAClF,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,uBAAuB,EAAE,MAA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MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC,CAcrD;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,qBAAqB,GAC/B,kBAAkB,CAKpB;AAED,wBAAsB,eAAe,CACnC,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CA4B3D;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAatD;AAED,wBAAsB,cAAc,CAClC,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAWrE;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,0BAA0B,CAAC,CA0CrC"}
@@ -0,0 +1,49 @@
1
+ import type { StateGraphDefinition } from "./adapter";
2
+ import type { AdapterDeps, AdapterInput, AdapterState, StateUpdate } from "./types";
3
+ /**
4
+ * Reconstructed journal / snapshot / replay / recovery primitives over the
5
+ * LangGraph adapter (W4-S05, #179).
6
+ *
7
+ * The retired in-house kernel exposed a deterministic reducer, a filesystem
8
+ * journal, per-step snapshots, replay equivalence and recovery. LangGraph
9
+ * exposes none of those natively, only a checkpointer. Rather than redefine the
10
+ * six certificate gates around what LangGraph happens to offer (which would make
11
+ * the gates unfalsifiable), this module **reconstructs** those primitives from
12
+ * the checkpoint sequence — the approved option (a). It is bespoke, but bounded,
13
+ * pure (no clock/random/I/O beyond the injected executor) and testable, so the
14
+ * crash-recovery and replay-equivalence gates keep their original meaning when
15
+ * measured against the new engine.
16
+ */
17
+ /** One recorded super-step: the node that ran, the update it produced, the
18
+ * reduced state after it, and a digest of that state (the snapshot). */
19
+ export type Checkpoint = {
20
+ readonly step: number;
21
+ readonly node: string;
22
+ readonly update: StateUpdate;
23
+ readonly state: AdapterState;
24
+ readonly stateHash: string;
25
+ };
26
+ /** A run plus its full checkpoint sequence. */
27
+ export type RecordedRun = {
28
+ readonly final: AdapterState;
29
+ readonly checkpoints: readonly Checkpoint[];
30
+ };
31
+ /** Digest (snapshot id) of an adapter state. */
32
+ export declare function hashState(state: AdapterState): string;
33
+ /** Runs the graph, recording a checkpoint (journal entry + snapshot) after each
34
+ * super-step. This is the reconstructed journal. */
35
+ export declare function runRecordingCheckpoints(definition: StateGraphDefinition, input: AdapterInput, deps: AdapterDeps): Promise<RecordedRun>;
36
+ /**
37
+ * Crash recovery: given the checkpoint the run had reached before a simulated
38
+ * crash (in-memory state lost), resume purely from that persisted snapshot and
39
+ * drive to completion. A correct engine converges to the same final state a
40
+ * crash-free run would reach.
41
+ */
42
+ export declare function resumeFromCheckpoint(definition: StateGraphDefinition, checkpoint: Checkpoint, deps: AdapterDeps): Promise<AdapterState>;
43
+ /**
44
+ * Replay equivalence: reconstruct the final state purely by folding the recorded
45
+ * updates through the deterministic reducer, independent of the live run. A
46
+ * replay-equivalent engine reproduces the live final state exactly.
47
+ */
48
+ export declare function replayCheckpoints(input: AdapterInput, checkpoints: readonly Checkpoint[]): AdapterState;
49
+ //# sourceMappingURL=checkpointReplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpointReplay.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/checkpointReplay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;GAaG;AAEH;wEACwE;AACxE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C,CAAC;AAmBF,gDAAgD;AAChD,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAErD;AAkDD;oDACoD;AACpD,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,oBAAoB,EAChC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,WAAW,CAAC,CAEtB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,oBAAoB,EAChC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,YAAY,CAAC,CAavB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,SAAS,UAAU,EAAE,GACjC,YAAY,CAMd"}
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ /** Where a graph run's state lives, which decides the checkpointer. */
3
+ export type CheckpointStateLocation = "ephemeral" | "committed";
4
+ /**
5
+ * The only fields a committed checkpoint may carry: identifiers, the resolved
6
+ * route and a state digest. `.strict()` REJECTS any other key rather than
7
+ * stripping it. This is load-bearing for the option (a) certification story: a
8
+ * checkpoint whose shape drifts (e.g. under a LangGraph version bump) must fail
9
+ * loudly instead of parsing "successfully" with fields silently dropped, which
10
+ * would leave the reconstructed primitives wrong while every gate stayed green —
11
+ * an unfalsifiable certificate. `assertReferenceOnly` enforces no-raw-content
12
+ * first; strict parsing then pins the persisted record to exactly this
13
+ * allow-list.
14
+ */
15
+ declare const PersistedCheckpointSchema: z.ZodObject<{
16
+ runID: z.ZodString;
17
+ nodeID: z.ZodString;
18
+ route: z.ZodEnum<{
19
+ frontier: "frontier";
20
+ local: "local";
21
+ }>;
22
+ stateHash: z.ZodString;
23
+ }, z.core.$strict>;
24
+ /** Allow-listed, reference-only persisted checkpoint. */
25
+ export type PersistedCheckpoint = z.infer<typeof PersistedCheckpointSchema>;
26
+ /** A saver that persists only reference fields, rejecting raw content. */
27
+ export interface ReferenceOnlySaver {
28
+ readonly location: string;
29
+ /** Validates an untrusted checkpoint payload and returns the allow-listed
30
+ * record. Throws `RedactionError` on any raw content field. */
31
+ save(payload: unknown): PersistedCheckpoint;
32
+ }
33
+ /** The selected checkpointer for a run, by state location. */
34
+ export type CheckpointerSelection = {
35
+ readonly kind: "off-the-shelf";
36
+ readonly location: string;
37
+ } | {
38
+ readonly kind: "reference-only";
39
+ readonly location: string;
40
+ readonly saver: ReferenceOnlySaver;
41
+ };
42
+ /**
43
+ * Selects the checkpointer for a run by where its state lives. Ephemeral state
44
+ * uses the off-the-shelf checkpointer under the machine-local path; committed
45
+ * state uses the reference-only saver.
46
+ */
47
+ export declare function selectCheckpointer(location: CheckpointStateLocation): CheckpointerSelection;
48
+ export {};
49
+ //# sourceMappingURL=checkpointer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpointer.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/checkpointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB,uEAAuE;AACvE,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;kBAOpB,CAAC;AAEZ,yDAAyD;AACzD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;mEAC+D;IAC/D,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAAC;CAC7C;AAgBD,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC7D;IACE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;CACpC,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,uBAAuB,GAChC,qBAAqB,CASvB"}
@@ -0,0 +1,34 @@
1
+ import type { OpenTeamConfig } from "../../config/schema";
2
+ import type { GraphEffectExecutor } from "../../orchestrator/graphEffects";
3
+ import type { NodeExecutor } from "./types";
4
+ /**
5
+ * Engine selection seam (W4-S03, #177).
6
+ *
7
+ * The bespoke `src/graph/` runtime and the LangGraph adapter coexist behind a
8
+ * single configuration switch. `resolveGraphEngine` reads `graph.engine`, which
9
+ * defaults to `builtin`, so a fresh clone keeps the current engine and the
10
+ * LangGraph path is strictly opt-in. This module is the ONLY production wiring
11
+ * that reaches the adapter, which is what makes the six release gates
12
+ * (`certification.ts`, #179) meaningful: they certify exactly the engine a user
13
+ * can select here, not an isolated module no entrypoint reaches.
14
+ */
15
+ /** Which graph runtime a run uses. */
16
+ export type GraphEngineKind = "builtin" | "langgraph";
17
+ /** Resolves the selected engine, defaulting to the current bespoke runtime. */
18
+ export declare function resolveGraphEngine(config: OpenTeamConfig): GraphEngineKind;
19
+ /**
20
+ * A `GraphEffectExecutor` backed by the LangGraph adapter. The adapter's
21
+ * deterministic reference runner (`invokeStateGraph`) stands in for
22
+ * `@langchain/langgraph`, which is now a declared dependency but is
23
+ * intentionally not bound here until runtime resolution under Node is proven;
24
+ * the routing, reduction and reference-only checkpoint semantics are identical
25
+ * to what the eventual library binding preserves.
26
+ *
27
+ * The dispatch effect is produced by the injected `NodeExecutor`. When none is
28
+ * configured — the current state, because the opencode session adapter is not
29
+ * wired and the library is intentionally not bound here yet — invoking the
30
+ * effect throws, exactly as the builtin `inertGraphEffects` does, rather than
31
+ * silently succeeding.
32
+ */
33
+ export declare function createLangGraphEffects(nodeExecutor?: NodeExecutor): GraphEffectExecutor;
34
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;;;GAUG;AAEH,sCAAsC;AACtC,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,CAAC;AAEtD,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,CAAC,EAAE,YAAY,GAC1B,mBAAmB,CAwDrB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Salvaged, dependency-free graph model (W4-S06, #180).
3
+ *
4
+ * The retired kernel described a run's structure in `../schema.ts` as Zod
5
+ * schemas fused to the in-house event log, journal and reducer. The LangGraph
6
+ * engine only needs the *structural* shape of a run — its nodes and their
7
+ * dependency edges — so this module re-expresses the reusable node/edge types
8
+ * as plain TypeScript, with no Zod, no events, no reducer and no I/O. W5 can
9
+ * build the LangGraph `StateGraph` topology from these types without importing
10
+ * the legacy kernel.
11
+ *
12
+ * It is purely additive: `../schema.ts` and its consumers are untouched. This
13
+ * file is type-only; it declares no runtime value.
14
+ */
15
+ /** Who executes a node's effect. Mirrors the retired `NodeRole`. */
16
+ export type GraphModelRole = "implementer" | "reviewer";
17
+ /**
18
+ * A node in a run's dependency DAG. A `reviewer` names, via `reviews`, the node
19
+ * whose artifact it reviews; an `implementer` never carries `reviews`.
20
+ */
21
+ export type GraphModelNode = {
22
+ readonly id: string;
23
+ readonly role: GraphModelRole;
24
+ readonly dependsOn: readonly string[];
25
+ readonly reviews?: string;
26
+ };
27
+ /** A directed dependency edge: `from` must complete before `to` may run. */
28
+ export type GraphModelEdge = {
29
+ readonly from: string;
30
+ readonly to: string;
31
+ };
32
+ /** A run as plain structure: an identifier and its nodes. */
33
+ export type GraphModel = {
34
+ readonly runID: string;
35
+ readonly nodes: readonly GraphModelNode[];
36
+ };
37
+ //# sourceMappingURL=graphModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphModel.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/graphModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,UAAU,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;CAC3C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AdapterState, StateUpdate } from "./types";
2
+ /**
3
+ * Pure channel reducer for the LangGraph adapter state (W4-S03, #177).
4
+ *
5
+ * This is the adapter's decision core: it merges a node's partial channel
6
+ * update into the reduced state exactly as a LangGraph `Annotation.Root`
7
+ * reducer would — scalar/reference channels (`input`, `route`, `receipt`)
8
+ * overwrite, while `visited` accumulates in dispatch order. It is a pure
9
+ * function of its inputs: no clock, randomness, filesystem, network or
10
+ * environment access, so a graph built on it is deterministic and the
11
+ * router-purity contract is preserved.
12
+ */
13
+ /**
14
+ * Applies one channel update to the reduced state, returning a fresh state.
15
+ * Overwrite channels take the update when present; `visited` concatenates.
16
+ */
17
+ export declare function reduceAdapterState(current: AdapterState, update: StateUpdate): AdapterState;
18
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/graph/langgraph/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,WAAW,GAClB,YAAY,CAad"}