@intentius/chant 0.49.0 → 0.51.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 (294) hide show
  1. package/dist/audit/catalog.d.ts +13 -3
  2. package/dist/audit/catalog.d.ts.map +1 -1
  3. package/dist/audit/core.d.ts +9 -0
  4. package/dist/audit/core.d.ts.map +1 -1
  5. package/dist/audit/discover.d.ts +6 -0
  6. package/dist/audit/discover.d.ts.map +1 -1
  7. package/dist/audit/fetch.d.ts.map +1 -1
  8. package/dist/audit/report-html.d.ts.map +1 -1
  9. package/dist/audit/report-model.d.ts +6 -0
  10. package/dist/audit/report-model.d.ts.map +1 -1
  11. package/dist/audit/report.d.ts.map +1 -1
  12. package/dist/audit/rules-doc.d.ts.map +1 -1
  13. package/dist/audit/secrets.d.ts +95 -0
  14. package/dist/audit/secrets.d.ts.map +1 -0
  15. package/dist/audit/wrangler.d.ts +33 -0
  16. package/dist/audit/wrangler.d.ts.map +1 -0
  17. package/dist/build.d.ts.map +1 -1
  18. package/dist/cli/commands/audit.d.ts +7 -0
  19. package/dist/cli/commands/audit.d.ts.map +1 -1
  20. package/dist/cli/commands/build.d.ts +23 -0
  21. package/dist/cli/commands/build.d.ts.map +1 -1
  22. package/dist/cli/handlers/build.d.ts.map +1 -1
  23. package/dist/cli/handlers/components.d.ts +31 -0
  24. package/dist/cli/handlers/components.d.ts.map +1 -1
  25. package/dist/cli/handlers/lifecycle.d.ts +11 -0
  26. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  27. package/dist/cli/handlers/op-progress.d.ts +57 -0
  28. package/dist/cli/handlers/op-progress.d.ts.map +1 -0
  29. package/dist/cli/handlers/operator.d.ts +32 -0
  30. package/dist/cli/handlers/operator.d.ts.map +1 -0
  31. package/dist/cli/handlers/run-client.d.ts +21 -1
  32. package/dist/cli/handlers/run-client.d.ts.map +1 -1
  33. package/dist/cli/handlers/run-report.d.ts.map +1 -1
  34. package/dist/cli/handlers/run.d.ts.map +1 -1
  35. package/dist/cli/handlers/scenario.d.ts +39 -0
  36. package/dist/cli/handlers/scenario.d.ts.map +1 -0
  37. package/dist/cli/handlers/search.d.ts +22 -0
  38. package/dist/cli/handlers/search.d.ts.map +1 -1
  39. package/dist/cli/main.d.ts.map +1 -1
  40. package/dist/cli/mcp/op-tools.d.ts.map +1 -1
  41. package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
  42. package/dist/cli/mcp/server.d.ts +35 -2
  43. package/dist/cli/mcp/server.d.ts.map +1 -1
  44. package/dist/cli/mcp/types.d.ts +29 -1
  45. package/dist/cli/mcp/types.d.ts.map +1 -1
  46. package/dist/cli/registry.d.ts +47 -3
  47. package/dist/cli/registry.d.ts.map +1 -1
  48. package/dist/codegen/docs-rule-scanning.d.ts.map +1 -1
  49. package/dist/components/capability.d.ts +17 -2
  50. package/dist/components/capability.d.ts.map +1 -1
  51. package/dist/components/cli-support.d.ts +7 -0
  52. package/dist/components/cli-support.d.ts.map +1 -1
  53. package/dist/components/component.d.ts +15 -0
  54. package/dist/components/component.d.ts.map +1 -1
  55. package/dist/components/driver.d.ts.map +1 -1
  56. package/dist/components/run-progress.d.ts +7 -5
  57. package/dist/components/run-progress.d.ts.map +1 -1
  58. package/dist/components/verbs/index.d.ts +6 -1
  59. package/dist/components/verbs/index.d.ts.map +1 -1
  60. package/dist/components/verbs/run-agent.d.ts +499 -0
  61. package/dist/components/verbs/run-agent.d.ts.map +1 -0
  62. package/dist/components/verbs/sign.d.ts +30 -0
  63. package/dist/components/verbs/sign.d.ts.map +1 -1
  64. package/dist/composite.d.ts +6 -1
  65. package/dist/composite.d.ts.map +1 -1
  66. package/dist/discovery/collect.d.ts.map +1 -1
  67. package/dist/discovery/fold-import.d.ts +15 -1
  68. package/dist/discovery/fold-import.d.ts.map +1 -1
  69. package/dist/discovery/fold-rank.d.ts +66 -0
  70. package/dist/discovery/fold-rank.d.ts.map +1 -0
  71. package/dist/discovery/index.d.ts +15 -0
  72. package/dist/discovery/index.d.ts.map +1 -1
  73. package/dist/discovery/param-deps.d.ts +17 -0
  74. package/dist/discovery/param-deps.d.ts.map +1 -0
  75. package/dist/fold/fold.d.ts +55 -2
  76. package/dist/fold/fold.d.ts.map +1 -1
  77. package/dist/fold/subset.d.ts +21 -14
  78. package/dist/fold/subset.d.ts.map +1 -1
  79. package/dist/lexicon-schema.d.ts +2 -0
  80. package/dist/lexicon-schema.d.ts.map +1 -1
  81. package/dist/lexicon.d.ts +134 -0
  82. package/dist/lexicon.d.ts.map +1 -1
  83. package/dist/lifecycle/assert-live.d.ts +77 -0
  84. package/dist/lifecycle/assert-live.d.ts.map +1 -0
  85. package/dist/lifecycle/change-set.d.ts +17 -0
  86. package/dist/lifecycle/change-set.d.ts.map +1 -1
  87. package/dist/lifecycle/converge-ledger.d.ts +90 -0
  88. package/dist/lifecycle/converge-ledger.d.ts.map +1 -0
  89. package/dist/lifecycle/deep-diff.d.ts +18 -0
  90. package/dist/lifecycle/deep-diff.d.ts.map +1 -1
  91. package/dist/lifecycle/deep-observe.d.ts +9 -1
  92. package/dist/lifecycle/deep-observe.d.ts.map +1 -1
  93. package/dist/lifecycle/disruption.d.ts +96 -0
  94. package/dist/lifecycle/disruption.d.ts.map +1 -0
  95. package/dist/lifecycle/gate-ledger.d.ts +33 -0
  96. package/dist/lifecycle/gate-ledger.d.ts.map +1 -0
  97. package/dist/lifecycle/git.d.ts +145 -21
  98. package/dist/lifecycle/git.d.ts.map +1 -1
  99. package/dist/lifecycle/index.d.ts +6 -0
  100. package/dist/lifecycle/index.d.ts.map +1 -1
  101. package/dist/lifecycle/lease.d.ts +113 -0
  102. package/dist/lifecycle/lease.d.ts.map +1 -0
  103. package/dist/lifecycle/replay.d.ts +2 -0
  104. package/dist/lifecycle/replay.d.ts.map +1 -1
  105. package/dist/lifecycle/scenario-eval.d.ts +42 -0
  106. package/dist/lifecycle/scenario-eval.d.ts.map +1 -0
  107. package/dist/lifecycle/scenario.d.ts +163 -0
  108. package/dist/lifecycle/scenario.d.ts.map +1 -0
  109. package/dist/lifecycle/symptoms.d.ts +63 -0
  110. package/dist/lifecycle/symptoms.d.ts.map +1 -0
  111. package/dist/lint/output-docs.d.ts +94 -0
  112. package/dist/lint/output-docs.d.ts.map +1 -0
  113. package/dist/lint/post-synth.d.ts +29 -0
  114. package/dist/lint/post-synth.d.ts.map +1 -1
  115. package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.d.ts +11 -0
  116. package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.d.ts.map +1 -0
  117. package/dist/lsp/lexicon-providers.d.ts +7 -0
  118. package/dist/lsp/lexicon-providers.d.ts.map +1 -1
  119. package/dist/op/activity-contract.d.ts +139 -0
  120. package/dist/op/activity-contract.d.ts.map +1 -0
  121. package/dist/op/builders.d.ts +42 -2
  122. package/dist/op/builders.d.ts.map +1 -1
  123. package/dist/op/converge-rule.d.ts +161 -0
  124. package/dist/op/converge-rule.d.ts.map +1 -0
  125. package/dist/op/generate-pipeline.d.ts +39 -0
  126. package/dist/op/generate-pipeline.d.ts.map +1 -0
  127. package/dist/op/index.d.ts +14 -0
  128. package/dist/op/index.d.ts.map +1 -1
  129. package/dist/op/local-executor.d.ts +7 -1
  130. package/dist/op/local-executor.d.ts.map +1 -1
  131. package/dist/op/op-verb-class.d.ts +42 -0
  132. package/dist/op/op-verb-class.d.ts.map +1 -0
  133. package/dist/op/operator.d.ts +128 -0
  134. package/dist/op/operator.d.ts.map +1 -0
  135. package/dist/op/step-output-ref.d.ts +187 -0
  136. package/dist/op/step-output-ref.d.ts.map +1 -0
  137. package/dist/op/types.d.ts +18 -1
  138. package/dist/op/types.d.ts.map +1 -1
  139. package/dist/provenance.d.ts +73 -3
  140. package/dist/provenance.d.ts.map +1 -1
  141. package/dist/runtime-adapter.d.ts +7 -1
  142. package/dist/runtime-adapter.d.ts.map +1 -1
  143. package/dist/serializer.d.ts +18 -0
  144. package/dist/serializer.d.ts.map +1 -1
  145. package/dist/testing.d.ts +23 -2
  146. package/dist/testing.d.ts.map +1 -1
  147. package/dist/toml.d.ts +40 -5
  148. package/dist/toml.d.ts.map +1 -1
  149. package/package.json +1 -1
  150. package/src/audit/catalog.test.ts +1 -1
  151. package/src/audit/catalog.ts +75 -3
  152. package/src/audit/core.ts +9 -0
  153. package/src/audit/discover.ts +29 -2
  154. package/src/audit/fetch.test.ts +216 -3
  155. package/src/audit/fetch.ts +270 -59
  156. package/src/audit/report-html.ts +5 -2
  157. package/src/audit/report-model.ts +9 -0
  158. package/src/audit/report.test.ts +22 -0
  159. package/src/audit/report.ts +3 -2
  160. package/src/audit/rules-doc.ts +2 -0
  161. package/src/audit/secrets.test.ts +303 -0
  162. package/src/audit/secrets.ts +406 -0
  163. package/src/audit/wrangler.test.ts +230 -0
  164. package/src/audit/wrangler.ts +290 -0
  165. package/src/build.ts +8 -3
  166. package/src/cli/command-group.ts +1 -1
  167. package/src/cli/commands/__fixtures__/schemas/sarif-2.1.0.schema.json +2882 -0
  168. package/src/cli/commands/audit.test.ts +215 -1
  169. package/src/cli/commands/audit.ts +86 -17
  170. package/src/cli/commands/build.test.ts +167 -2
  171. package/src/cli/commands/build.ts +114 -23
  172. package/src/cli/handlers/build.ts +2 -0
  173. package/src/cli/handlers/components.test.ts +199 -1
  174. package/src/cli/handlers/components.ts +160 -3
  175. package/src/cli/handlers/graph.test.ts +20 -0
  176. package/src/cli/handlers/graph.ts +10 -1
  177. package/src/cli/handlers/lifecycle.test.ts +90 -0
  178. package/src/cli/handlers/lifecycle.ts +30 -5
  179. package/src/cli/handlers/op-progress.test.ts +202 -0
  180. package/src/cli/handlers/op-progress.ts +192 -0
  181. package/src/cli/handlers/operator.test.ts +255 -0
  182. package/src/cli/handlers/operator.ts +240 -0
  183. package/src/cli/handlers/run-client.test.ts +82 -0
  184. package/src/cli/handlers/run-client.ts +85 -2
  185. package/src/cli/handlers/run-report.test.ts +62 -0
  186. package/src/cli/handlers/run-report.ts +20 -58
  187. package/src/cli/handlers/run.test.ts +144 -0
  188. package/src/cli/handlers/run.ts +40 -18
  189. package/src/cli/handlers/scenario.test.ts +456 -0
  190. package/src/cli/handlers/scenario.ts +330 -0
  191. package/src/cli/handlers/search-drift.test.ts +263 -0
  192. package/src/cli/handlers/search.ts +150 -1
  193. package/src/cli/main.test.ts +23 -0
  194. package/src/cli/main.ts +81 -1
  195. package/src/cli/mcp/op-tools.ts +17 -6
  196. package/src/cli/mcp/resource-handlers.ts +13 -5
  197. package/src/cli/mcp/server.test.ts +265 -2
  198. package/src/cli/mcp/server.ts +84 -7
  199. package/src/cli/mcp/types.ts +27 -1
  200. package/src/cli/registry.ts +47 -3
  201. package/src/codegen/docs-rule-scanning.test.ts +42 -0
  202. package/src/codegen/docs-rule-scanning.ts +25 -2
  203. package/src/components/README.md +7 -0
  204. package/src/components/capability.ts +17 -2
  205. package/src/components/cli-support.test.ts +17 -0
  206. package/src/components/cli-support.ts +13 -1
  207. package/src/components/component-schema.test.ts +32 -0
  208. package/src/components/component.schema.json +6 -0
  209. package/src/components/component.test.ts +21 -0
  210. package/src/components/component.ts +15 -0
  211. package/src/components/driver.ts +12 -4
  212. package/src/components/run-progress.ts +9 -5
  213. package/src/components/verbs/index.ts +6 -1
  214. package/src/components/verbs/run-agent.test.ts +683 -0
  215. package/src/components/verbs/run-agent.ts +786 -0
  216. package/src/components/verbs/sign.test.ts +19 -0
  217. package/src/components/verbs/sign.ts +34 -2
  218. package/src/composite.ts +31 -2
  219. package/src/discovery/collect.ts +11 -2
  220. package/src/discovery/fold-import.test.ts +54 -0
  221. package/src/discovery/fold-import.ts +178 -38
  222. package/src/discovery/fold-rank.test.ts +197 -0
  223. package/src/discovery/fold-rank.ts +346 -0
  224. package/src/discovery/index.ts +16 -1
  225. package/src/discovery/param-deps.test.ts +118 -0
  226. package/src/discovery/param-deps.ts +170 -0
  227. package/src/fold/fold.test.ts +6 -2
  228. package/src/fold/fold.ts +184 -3
  229. package/src/fold/subset.test.ts +82 -19
  230. package/src/fold/subset.ts +79 -41
  231. package/src/lexicon-schema.ts +3 -0
  232. package/src/lexicon.ts +154 -2
  233. package/src/lifecycle/assert-live.test.ts +125 -0
  234. package/src/lifecycle/assert-live.ts +154 -0
  235. package/src/lifecycle/change-set.ts +35 -3
  236. package/src/lifecycle/converge-ledger.test.ts +199 -0
  237. package/src/lifecycle/converge-ledger.ts +179 -0
  238. package/src/lifecycle/deep-diff.test.ts +79 -1
  239. package/src/lifecycle/deep-diff.ts +23 -0
  240. package/src/lifecycle/deep-observe.ts +13 -2
  241. package/src/lifecycle/disruption.test.ts +186 -0
  242. package/src/lifecycle/disruption.ts +224 -0
  243. package/src/lifecycle/gate-ledger.test.ts +103 -0
  244. package/src/lifecycle/gate-ledger.ts +140 -0
  245. package/src/lifecycle/git.test.ts +430 -0
  246. package/src/lifecycle/git.ts +446 -84
  247. package/src/lifecycle/index.ts +6 -0
  248. package/src/lifecycle/lease.test.ts +343 -0
  249. package/src/lifecycle/lease.ts +270 -0
  250. package/src/lifecycle/replay.test.ts +25 -0
  251. package/src/lifecycle/replay.ts +11 -3
  252. package/src/lifecycle/scenario-eval.test.ts +199 -0
  253. package/src/lifecycle/scenario-eval.ts +158 -0
  254. package/src/lifecycle/scenario.test.ts +195 -0
  255. package/src/lifecycle/scenario.ts +321 -0
  256. package/src/lifecycle/symptoms.test.ts +116 -0
  257. package/src/lifecycle/symptoms.ts +126 -0
  258. package/src/lint/output-docs.test.ts +220 -0
  259. package/src/lint/output-docs.ts +204 -0
  260. package/src/lint/post-synth.test.ts +97 -0
  261. package/src/lint/post-synth.ts +45 -0
  262. package/src/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.ts +26 -0
  263. package/src/lint/rules/comp/comp.test.ts +49 -1
  264. package/src/lint/rules/evl001-non-literal-expression.test.ts +8 -3
  265. package/src/lint/rules/evl001-non-literal-expression.ts +6 -6
  266. package/src/lsp/lexicon-providers.test.ts +44 -0
  267. package/src/lsp/lexicon-providers.ts +11 -1
  268. package/src/op/activity-contract.test.ts +180 -0
  269. package/src/op/activity-contract.ts +278 -0
  270. package/src/op/builders-exports.test.ts +17 -1
  271. package/src/op/builders.ts +59 -5
  272. package/src/op/converge-rule.test.ts +179 -0
  273. package/src/op/converge-rule.ts +311 -0
  274. package/src/op/generate-pipeline.test.ts +53 -0
  275. package/src/op/generate-pipeline.ts +99 -0
  276. package/src/op/index.ts +30 -0
  277. package/src/op/local-executor.test.ts +92 -0
  278. package/src/op/local-executor.ts +52 -10
  279. package/src/op/local-output.ts +1 -1
  280. package/src/op/op-verb-class.test.ts +126 -0
  281. package/src/op/op-verb-class.ts +115 -0
  282. package/src/op/operator.test.ts +346 -0
  283. package/src/op/operator.ts +213 -0
  284. package/src/op/step-output-ref.test.ts +334 -0
  285. package/src/op/step-output-ref.ts +453 -0
  286. package/src/op/types.ts +18 -1
  287. package/src/provenance.test.ts +151 -4
  288. package/src/provenance.ts +118 -4
  289. package/src/runtime-adapter.ts +31 -10
  290. package/src/serializer.ts +18 -0
  291. package/src/testing.test.ts +89 -2
  292. package/src/testing.ts +63 -3
  293. package/src/toml.test.ts +157 -384
  294. package/src/toml.ts +371 -5
@@ -30,7 +30,11 @@
30
30
  * ./wrangler.ts) and `r2-sync` (#1293, ./r2-sync.ts) are the Cloudflare
31
31
  * Workers apply leaves — real implementations over the same injectable
32
32
  * `ProcessRunner` `sign` uses, shelling to `wrangler`/`rclone` rather than an
33
- * AWS-shaped SDK client.
33
+ * AWS-shaped SDK client. `run-agent` (#1941, epic #1564 phase 1, ./run-agent.ts)
34
+ * is the typed schema + registry entry for a bounded, attested agent-turn
35
+ * capability over a fly Sprite — a typed stub for now (`run`/`rollback`
36
+ * reject with `CapabilityNotImplementedError`), `rollbackPolicy: "native"`
37
+ * declared up front; the real sprite-lifecycle implementation is #1942.
34
38
  */
35
39
  export * from "./build-archive.js";
36
40
  export * from "./build.js";
@@ -43,6 +47,7 @@ export * from "./component-bom.js";
43
47
  export * from "./reproducibility.js";
44
48
  export * from "./sign.js";
45
49
  export * from "./verify.js";
50
+ export * from "./run-agent.js";
46
51
  export * from "./wrangler.js";
47
52
  export * from "./r2-sync.js";
48
53
  export * from "./vuln-scan.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,499 @@
1
+ /**
2
+ * `run-agent` — phase 1 design: capability schema + registry entry (#1941,
3
+ * epic #1564 "run-agent as a bounded, attested component capability").
4
+ *
5
+ * **Decided (2026-08-25, maintainer comment on #1564).** The agent turn
6
+ * executes on a fly [Sprite](https://sprites.dev), via chant's own sprite
7
+ * lifecycle activities (`lexicons/fly/src/op/activities/sprites.ts` —
8
+ * `spriteCreate`/`spriteCheckpoint`/`spriteExec`/`spriteRestore`/`spriteDestroy`,
9
+ * plus the filesystem activities in `sprite-fs.ts` —
10
+ * `spriteWriteFile`/`spriteReadFile`), **not** fountain's hosted `fountainRun`
11
+ * path (`lexicons/fountain/src/op/activities/fountain-run.ts`): `fountainRun`
12
+ * polls a fountain-managed `Conversation` to a terminal HTTP status and gives
13
+ * chant no checkpoint control, but the epic's compensation story needs chant
14
+ * to own the sprite directly. Compensation is checkpoint-before/restore-on-unwind
15
+ * — "the environment is the transaction," no hand-written inverse action — the
16
+ * same pattern `examples/sprites-agent-task/ops/guarded-task.op.ts` already
17
+ * demonstrates at the Op layer. The offline path is `sprites-fake`/
18
+ * `sprites-emulator` (spritzer), the same `SPRITES_BASE_URL` endpoint-override
19
+ * story `sprites.ts` documents.
20
+ *
21
+ * **Input tracks fountain's `Agent` surface as it stands today**
22
+ * (`lexicons/fountain/src/spec/fountain-openapi.snapshot.json`): `agent` is
23
+ * resolved the same way `fountainRun`'s `resolveAgentId` resolves a name/id
24
+ * against `/api/agents`; `task` is `PromptRequest`-shaped (`prompt` +
25
+ * optional `images`, `ImageInput`'s exact shape). The output's `turn` facts
26
+ * track `Turn`'s shape (`status`/`exit_code`/`started_at`/`ended_at`), even
27
+ * though the turn runs on a chant-owned sprite rather than a fountain-managed
28
+ * `Sandbox` — fountain supplies the *declarative* facts (which model, which
29
+ * runtime, which egress policy via `Environment`), chant drives the
30
+ * *imperative* execution. Revisit only if `BinaryBourbon/fountain#586` (the
31
+ * `Estate` proposal) lands a breaking shape.
32
+ *
33
+ * **Placement.** Registered the same way `docker-build` is (./build.ts) — a
34
+ * factory over an injectable executor seam (`SpriteActivities` below, the
35
+ * `run-agent` analogue of ./cloud-executor.ts's `CloudExecutor`) — so core
36
+ * carries the typed schema without a hard package dependency on
37
+ * `@intentius/chant-lexicon-fly` (core stays cloud/vendor-agnostic in its
38
+ * dependency graph, see docs/components/cloud-boundary; the same reasoning
39
+ * that keeps the AWS leaves in `@intentius/chant-lexicon-aws` rather than
40
+ * here). Unlike the AWS leaves, there is today no fly-lexicon capability
41
+ * plugin for this verb to live in instead, and `run-agent` is a foundational,
42
+ * pipeline-level primitive in the same vein as `docker-build` or
43
+ * `wrangler-deploy` (./wrangler.ts) rather than a swappable per-cloud leaf —
44
+ * the same tradeoff `wrangler.ts`'s module doc weighs for the Cloudflare
45
+ * Workers verbs. Revisit if a broader agent-execution lexicon ever owns this
46
+ * seam instead.
47
+ *
48
+ * **Scope across phases.** Phase 1 (#1941) shipped the typed contract only —
49
+ * `run`/`rollback` were stubs throwing `CapabilityNotImplementedError`, per
50
+ * ../capability.ts's own module doc ("Verb implementations live under
51
+ * `./verbs/*` as typed stubs — no cloud calls, no side effects. Cloud
52
+ * implementations are a later phase"). `rollbackPolicy: "native"` was declared
53
+ * from phase 1 (so COMP003, ../lint/rules/comp/comp003-mutating-no-rollback.ts,
54
+ * never requires a `noRollback` opt-out for this verb once it composes into a
55
+ * component) even before the paired `rollback` body was real — the *policy*
56
+ * was the phase 1 design commitment, the *implementation* is phase 2 (#1942,
57
+ * below). This capability is deliberately not yet registered in any
58
+ * `CapabilityPlugin`'s `STARTER_VERB_FAMILIES`-equivalent set — the fly
59
+ * lexicon's own plugin (`lexicons/fly/src/components/capability-plugin.ts`)
60
+ * registers it under its own `FLY_VERB_FAMILIES`, but that is a separate,
61
+ * later decision from "does core's sequencing logic actually work," which
62
+ * this module answers. #1943 ("Provenance + attestation") owns the
63
+ * `provenance.sourceRef` transcript-hash basis and verify-gate interop; #1944
64
+ * owns the conformance/contract test suite (saga-unwind restore, COMP003
65
+ * refusal) beyond this module's own unit tests.
66
+ *
67
+ * **#1942 (phase 2, this module's `run`/`rollback` body) resolved the
68
+ * following:**
69
+ * - **The exec-throw finding** (pre-merge review of #1946, recorded on
70
+ * #1942): the real `spriteExec` (`lexicons/fly/src/op/activities/sprites.ts`)
71
+ * throws on any non-zero exit, so a *thin* `SpriteActivities.exec` adapter
72
+ * can only ever produce `turn.status: "failed"` without throwing if it
73
+ * reclassifies that throw itself. That reclassification is the fly
74
+ * lexicon adapter's job (`lexicons/fly/src/components/run-agent.ts`,
75
+ * option (a) from the review comment) — `SpriteActivities.exec`'s
76
+ * contract, as this module consumes it, is: **resolve** with `exitCode`
77
+ * for any ordinary command outcome (zero or non-zero), **reject** only for
78
+ * a genuine transport/infra failure. `run()` below trusts that contract
79
+ * completely: it never wraps `sprites.exec` in a try/catch, so a rejection
80
+ * from the injected `sprites` always propagates as a genuine `run()`
81
+ * failure (triggering saga rollback in ../driver.ts), while an ordinary
82
+ * non-zero exit becomes `turn.status: "failed"` on a normal return —
83
+ * exactly the non-throwing first-class result the type already declared.
84
+ * - **Rollback identity (#1944 closes the durable-path gap left open here).**
85
+ * `rollback(ctx, input, output)` receives the identical `input` object
86
+ * `run(ctx, input)` was called with, plus (since #1944) the exact `output`
87
+ * `run()` returned — `../capability.ts`'s `Capability.rollback` grew an
88
+ * optional third parameter for precisely this, and ../driver.ts's saga
89
+ * unwind (both the local in-process path and, via
90
+ * `lexicons/temporal/src/component-op/{activities,serializer}.ts`, the
91
+ * durable Temporal path) always threads it through. `run()` records the
92
+ * sprite id and exact pre-run checkpoint id two ways: in a private
93
+ * `WeakMap` keyed by the exact `input` object (works only when `rollback`
94
+ * is called with that same object — true in-process, e.g. this module's
95
+ * own tests calling `rollback()` directly after `run()`), and — the
96
+ * durable-safe channel — as `output.spriteId`/`output.checkpointId`,
97
+ * already part of `RunAgentOutput` (#1943). `rollback()` prefers `output`'s
98
+ * fields when present, falling back to the `WeakMap` only when a caller
99
+ * never threads `output` through (backward-compatible for any capability
100
+ * caller not yet passing it). **The checkpoint id, not the comment, is
101
+ * what `rollback()` restores by** when either source has one:
102
+ * `sprites.restore({ id, checkpoint: checkpointId })`, which
103
+ * `spriteRestore`'s explicit-id resolution wins over comment on
104
+ * (`lexicons/fly/src/op/activities/sprites.ts`). Restoring by comment alone
105
+ * is unsafe on a reused sprite — two `run()` calls sharing the default
106
+ * `"pre-run"` comment would make a comment-based restore always resolve to
107
+ * the *newest* matching checkpoint, so rolling back the first run would
108
+ * restore the second run's checkpoint (which already contains the first
109
+ * run's mutation) instead of undoing it. Comment-based restore
110
+ * (`workspace.checkpointComment`, default `"pre-run"`) is therefore only a
111
+ * **fallback**, used when no checkpoint id is available from either source
112
+ * (the `workspace.spriteName`-only path below). When there is no sprite id
113
+ * to restore at all (no `output`, no `WeakMap` record, no
114
+ * `workspace.spriteName`), `rollback()` degrades with an explicit,
115
+ * commented no-op return — the same pattern
116
+ * `../../lexicons/aws/src/components/host-delivery.ts`'s `code-deploy`
117
+ * rollback uses (`if (!deploymentId) return;`) — rather than throwing.
118
+ * **Before #1944**, the Temporal durable path (`run` and `rollback`
119
+ * executing as separate Activities, each rebuilding `input` fresh via
120
+ * `resolveStepInput`) never gave the `WeakMap` a hit, so a fresh sprite's
121
+ * rollback there silently degraded to that no-op; passing `output` through
122
+ * (this revision) closes that gap directly, without redesigning the
123
+ * component-op wire format — see #1944's PR description for why this was
124
+ * chosen over the "make the degrade loud" alternative. The generated
125
+ * workflow's saga-unwind loop (`lexicons/temporal/src/component-op/
126
+ * serializer.ts`) also no longer swallows a rollback failure silently
127
+ * (any capability's, not just this one) — it now logs it and surfaces it
128
+ * via a `RollbackFailed` search attribute, defense in depth for a rollback
129
+ * failure unrelated to identity (e.g. the sprite backend itself erroring).
130
+ * - **Destroy vs. leave-alive.** `run()` destroys a freshly created (not
131
+ * `workspace.spriteName`-reused) sprite only when `turn.status ===
132
+ * "completed"`. An ordinary failed turn leaves the sprite alive — it
133
+ * returned normally, so no saga rollback runs, but the failure is exactly
134
+ * when a caller (or this module's own tests) most wants to inspect the
135
+ * sprite or explicitly call `rollback()` to restore it, per this issue's
136
+ * acceptance criteria.
137
+ *
138
+ * **Still open, left for later phases:**
139
+ * - Runtime invocation inside the sprite — `buildRuntimeCommand` below picks
140
+ * a real one-shot CLI invocation for each known `Agent.runtime` value,
141
+ * reading the staged prompt file; whether the sprite image already carries
142
+ * that CLI (vs. `run()` needing a setup step) is unresolved. `RunAgentInput`
143
+ * (frozen by #1941) has no separate `runtime` field, so `input.agent`
144
+ * doubles as the runtime selector for phase 2 — an unrecognized value is
145
+ * passed through verbatim as a literal command (a documented escape hatch
146
+ * for a custom binary already present in the image, and how this module's
147
+ * own tests exercise a scripted failure against the offline fake). Real
148
+ * `agent` name/id -> `Agent.runtime` resolution against fountain's
149
+ * `/api/agents` (`resolveAgentId`, `lexicons/fountain/.../fountain-run.ts`)
150
+ * is out of this issue's scope (and would need a network call the offline
151
+ * path forbids).
152
+ * - Output artifact encoding — `run()` reads one conventional path
153
+ * (`/work/output`) as the sole `artifacts.files` entry when present;
154
+ * individual `spriteReadFile` calls per changed path vs. one tarred
155
+ * snapshot folded into a `BuildArchiveManifest` entry (./build-archive.ts)
156
+ * remains an open question, as does `artifacts.diff`, which `run()` never
157
+ * populates (the real Sprites API has no built-in diff endpoint).
158
+ * - Interrupted turns — `turn.status: "interrupted"` stays in the type but
159
+ * is unreachable from this implementation: any `sprites.exec` rejection
160
+ * (including one caused by an aborted signal) propagates as a genuine
161
+ * `run()` failure rather than being classified as an interrupted turn.
162
+ * Distinguishing "deadline hit mid-run" from "the sprite backend errored"
163
+ * well enough to surface `"interrupted"` safely is left for #1944.
164
+ *
165
+ * **#1943 (this revision) resolved the transcript-hash basis and
166
+ * sign/verify-gate interop, closing #1941's open "transcript hash basis"
167
+ * question:**
168
+ * - **Hash basis.** `provenance.sourceRef`'s digest component is
169
+ * `sha256Digest(JSON.stringify(basis))` over a fixed-key-order object —
170
+ * `{ agent, promptDigest, images, status, exitCode, stdoutDigest,
171
+ * stderrDigest, artifacts, diffDigest }` — built fresh by
172
+ * `computeTranscriptDigest` below every call, never re-ordered from a
173
+ * caller-supplied object, so key order (and therefore the digest) never
174
+ * drifts by construction. Every free-text field (`prompt`, `stdout`,
175
+ * `stderr`, `diff`, each image's `data`) is folded in as its own
176
+ * `sha256Digest`, not embedded verbatim — this keeps a (possibly large,
177
+ * possibly secret-bearing) prompt or transcript out of the digest input's
178
+ * own byte stream while the digest remains exactly as sensitive to those
179
+ * bytes as embedding them would be, and it is *why* this module never
180
+ * needs to retain raw stdout/stderr past computing their digest inline
181
+ * (closing #1941's "is the raw transcript retained anywhere beyond the
182
+ * attested digest" sub-question: no, not even internally). `startedAt`/
183
+ * `endedAt` are deliberately excluded — including wall-clock time would
184
+ * make "the same turn" (same prompt, same exec outcome, same artifacts)
185
+ * hash differently on every real run, defeating the determinism property
186
+ * (`same turn -> same sourceRef`) a verifier actually needs: identity is
187
+ * about *what happened*, not *when*. `artifacts.files` is sorted by
188
+ * `path` before hashing so collection order (never semantically
189
+ * meaningful — there is exactly one conventional artifact today, see
190
+ * `OUTPUT_PATH`) can't perturb the digest.
191
+ * - **`sourceRef` folding.** `RunAgentInput.sourceRef`'s own doc comment
192
+ * promises it is "folded into the output's `provenance.sourceRef`
193
+ * alongside the transcript hash." Concretely: `sourceRef =
194
+ * input.sourceRef ? \`${input.sourceRef}@${transcriptDigest}\` :
195
+ * transcriptDigest` — an `"<sha>@sha256:<hex>"` shape when a source ref is
196
+ * known, reading like the `repo@sha256:...` convention already used
197
+ * throughout this codebase (./sign.ts, ./publish.ts's `uri`), or the bare
198
+ * `sha256:<hex>` transcript digest alone when it is not. `@` (not `:`,
199
+ * which `DockerBuildInput.sourceRef`'s own `"<sha>:<path>"` convention
200
+ * already uses for a different purpose) keeps the split unambiguous.
201
+ * `extractTranscriptDigest` below recovers the trailing
202
+ * `sha256:<hex>` deterministically regardless of what `input.sourceRef`
203
+ * contains, by anchoring on the fixed `sha256:[0-9a-f]{64}` pattern at the
204
+ * very end of the string.
205
+ * - **Attestation interop, decided.** `RunAgentOutput` gained one field,
206
+ * `attestationRef` — a `"<component>/run-agent@sha256:<hex>"` string
207
+ * already shaped like the digest-qualified `repo@sha256:...` reference
208
+ * `./sign.ts`'s `assertDigestRef`/`./verify.ts` already require, built
209
+ * from `ctx.component` and the transcript digest, so a `sign`/
210
+ * `attest-provenance`/`verify` step composed after `run-agent` wires
211
+ * `imageRef: "@RunAgent.attestationRef"` and needs **zero code changes**
212
+ * to any of those three verbs — resolving design point 4 of #1943 exactly
213
+ * as anticipated. The honest caveat, stated plainly rather than left
214
+ * implicit: `attestationRef` is *shaped* like an OCI digest reference, but
215
+ * is not by itself a real, registry-resolvable one — `run-agent`'s turn
216
+ * output is never pushed anywhere by this module. A deployment that wants
217
+ * a genuine `cosign sign`/`cosign verify` round trip against real
218
+ * Rekor/Fulcio needs a registry-backed publish step ahead of `sign`
219
+ * (mirroring `publish-image`'s `uri`, ./publish.ts) — out of this issue's
220
+ * scope, and not needed for the offline contract this issue asks for
221
+ * (injected `ProcessRunner`, no real `cosign`/registry ever touched).
222
+ * `toRunAgentArchiveEntry` below folds the same digest into a
223
+ * `BuildArchiveEntry` (`kind: "asset"`, ./build-archive.ts) per design
224
+ * point 2, for a caller building a full archive manifest.
225
+ * - **Predicate-type decision, made (not left open).** Reuses the existing
226
+ * `predicateType: "https://slsa.dev/provenance/v1"` unchanged — does
227
+ * *not* mint a `run-agent`-specific predicate type. `buildDefinition
228
+ * .buildType` is the field SLSA v1 actually designates for "what kind of
229
+ * recipe produced this" (`RUN_AGENT_BUILD_TYPE` below,
230
+ * `"https://chant.dev/agent-turn/v1"`, the same role
231
+ * `./sign.ts`'s `DEFAULT_BUILD_TYPE` plays for `docker-build`), so a
232
+ * second, parallel `predicateType` taxonomy would duplicate what
233
+ * `buildType` already discriminates. This is also what makes the "zero
234
+ * code changes to `verify.ts`" claim above literally true:
235
+ * `buildVerifyAttestationArgs` hardcodes `--type slsaprovenance1` — a
236
+ * minted `predicateType` would have broken that interop outright, forcing
237
+ * a `verify.ts` change this issue's design point 4 explicitly hoped to
238
+ * avoid.
239
+ * - **Fountain-supplied facts, honestly scoped.** `buildRunAgentProvenanceStatement`
240
+ * below folds `input.agent` into `externalParameters` (the one *declared*
241
+ * fact `RunAgentInput` actually carries today) and `spriteId`/
242
+ * `checkpointId`/`turn.status`/`turn.exitCode` into `internalParameters`
243
+ * (what actually happened). `model`/`runtime`/`Environment.networking_type`
244
+ * /`allowed_hosts` are not included — populating them honestly needs
245
+ * fountain `Agent`/`Environment` resolution against `/api/agents`, which
246
+ * this module's own doc comment already marks out of scope ("Real `agent`
247
+ * name/id -> `Agent.runtime` resolution ... is out of this issue's
248
+ * scope"). Adding those keys later is additive (merged into
249
+ * `externalParameters`, never replacing it), not a shape break.
250
+ */
251
+ import type { Capability } from "../capability.js";
252
+ import type { ProvenanceLink } from "./reproducibility.js";
253
+ import type { BuildArchiveEntry } from "./build-archive.js";
254
+ import { type InTotoProvenanceStatement } from "./sign.js";
255
+ /** fountain's `ImageInput` (`PromptRequest.images[]`) — a base64-encoded image attached to a prompt. */
256
+ export interface RunAgentImageInput {
257
+ /** Base64-encoded image bytes. */
258
+ data: string;
259
+ media_type: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
260
+ }
261
+ /** fountain's `Agent.runtime` — the CLI the turn runs inside the sprite. */
262
+ export type RunAgentRuntime = "claude" | "codex" | "gemini" | "opencode";
263
+ export interface RunAgentInput {
264
+ /** fountain `Agent` name or id — resolved like `fountainRun`'s `resolveAgentId` (`lexicons/fountain/src/op/activities/fountain-run.ts`) against `/api/agents`. */
265
+ agent: string;
266
+ task: {
267
+ prompt: string;
268
+ /** fountain's `ImageInput` shape (`PromptRequest.images`). */
269
+ images?: RunAgentImageInput[];
270
+ };
271
+ workspace: {
272
+ /** Reuse an existing sprite (warm start). Omit to create a fresh sprite for this turn. */
273
+ spriteName?: string;
274
+ /** Base image for a freshly created sprite. Ignored when reusing `spriteName`. */
275
+ image?: string;
276
+ /** Checkpoint comment for the pre-run checkpoint `rollback()` restores to. Default: `"pre-run"`. */
277
+ checkpointComment?: string;
278
+ };
279
+ /** Folded into the output's `provenance.sourceRef` alongside the transcript hash — same field name `DockerBuildInput.sourceRef` already uses (#614, ./build.ts). Omit when unknown; no `provenance` basis beyond the transcript hash in that case. */
280
+ sourceRef?: string;
281
+ }
282
+ /** Mirrors fountain's `Turn` shape (`status`/`exit_code`/`started_at`/`ended_at`), even though the turn itself runs on a chant-owned sprite rather than a fountain-managed `Sandbox`. */
283
+ export interface RunAgentTurn {
284
+ status: "completed" | "failed" | "interrupted";
285
+ exitCode: number | null;
286
+ startedAt: string;
287
+ endedAt: string | null;
288
+ }
289
+ /** One artifact file the turn produced, content-addressed the same way a `BuildArchiveEntry` is (./build-archive.ts). */
290
+ export interface RunAgentArtifactFile {
291
+ path: string;
292
+ digest: string;
293
+ }
294
+ export interface RunAgentOutput {
295
+ /** The sprite this turn ran on — the same id `rollback()` restores. */
296
+ spriteId: string;
297
+ /** The pre-run checkpoint id — the same id `rollback()` restores to. */
298
+ checkpointId: string;
299
+ turn: RunAgentTurn;
300
+ artifacts: {
301
+ files: RunAgentArtifactFile[];
302
+ /** Unified diff of the workspace against its pre-run checkpoint, when applicable. */
303
+ diff?: string;
304
+ };
305
+ /** #614's shape (./reproducibility.ts) — `sourceRef` is the prompt/transcript hash, folded with `input.sourceRef` when supplied (see this module's doc comment, "sourceRef folding"). */
306
+ provenance: ProvenanceLink;
307
+ /**
308
+ * A `"<component>/run-agent@sha256:<hex>"` reference, digest-qualified the
309
+ * same shape `./sign.ts`'s `assertDigestRef`/`./verify.ts` require (#1943)
310
+ * — wire a `sign`/`attest-provenance`/`verify` step composed after
311
+ * `run-agent` with `imageRef: "@RunAgent.attestationRef"` and none of those
312
+ * three verbs need any code change. See this module's doc comment,
313
+ * "Attestation interop, decided" for the honest caveat (shaped like an OCI
314
+ * digest reference, not itself a registry-resolvable one) and
315
+ * `extractTranscriptDigest`/`toRunAgentArchiveEntry`/
316
+ * `buildRunAgentProvenanceStatement` below for the rest of the interop
317
+ * surface built on top of it.
318
+ */
319
+ attestationRef: string;
320
+ }
321
+ /**
322
+ * The subset of `lexicons/fly/src/op/activities/sprites.ts` +
323
+ * `sprite-fs.ts`'s activity contracts `run-agent` needs, restated
324
+ * structurally here (rather than imported) so this module carries no hard
325
+ * package dependency on `@intentius/chant-lexicon-fly` — the same
326
+ * injectable-seam shape ./cloud-executor.ts's `CloudExecutor`/`DockerClient`
327
+ * use to keep ./build.ts's `docker-build` testable with no real `docker`
328
+ * daemon. A real implementation (#1942) is structurally compatible with
329
+ * `spriteCreate`/`spriteCheckpoint`/`spriteExec`/`spriteRestore`/
330
+ * `spriteDestroy`/`spriteWriteFile`/`spriteReadFile`'s existing signatures —
331
+ * adapting them is a thin wrapper, not a rewrite.
332
+ */
333
+ export interface SpriteActivities {
334
+ create(args: {
335
+ name: string;
336
+ image?: string;
337
+ }, signal?: AbortSignal): Promise<{
338
+ id: string;
339
+ url: string;
340
+ }>;
341
+ checkpoint(args: {
342
+ id: string;
343
+ comment?: string;
344
+ }, signal?: AbortSignal): Promise<{
345
+ checkpointId: string;
346
+ }>;
347
+ exec(args: {
348
+ id: string;
349
+ cmd: string;
350
+ timeoutMs?: number;
351
+ }, signal?: AbortSignal): Promise<{
352
+ stdout: string;
353
+ stderr: string;
354
+ exitCode: number;
355
+ }>;
356
+ restore(args: {
357
+ id: string;
358
+ checkpoint?: string;
359
+ comment?: string;
360
+ }, signal?: AbortSignal): Promise<void>;
361
+ destroy(args: {
362
+ id: string;
363
+ }, signal?: AbortSignal): Promise<void>;
364
+ writeFile(args: {
365
+ id: string;
366
+ path: string;
367
+ content: string;
368
+ mkdir?: boolean;
369
+ }, signal?: AbortSignal): Promise<void>;
370
+ readFile(args: {
371
+ id: string;
372
+ path: string;
373
+ }, signal?: AbortSignal): Promise<{
374
+ content: string;
375
+ }>;
376
+ }
377
+ /**
378
+ * Thrown by `defaultSpriteActivities()`'s methods when a caller never injects
379
+ * a real (or fake) `SpriteActivities` — the default remains this
380
+ * not-wired-yet placeholder even after #1942 wires `run()`/`rollback()`'s
381
+ * sequencing logic, because *some* concrete backend still has to be supplied
382
+ * for that logic to have anything to call. `lexicons/fly/src/components/
383
+ * run-agent.ts`'s adapter (the real backend, over this lexicon's own sprite
384
+ * lifecycle activities) or the offline `sprites-fake`/`sprites-emulator` path
385
+ * are what a caller injects instead. A caller that supplies its own
386
+ * `SpriteActivities` never hits this class.
387
+ */
388
+ export declare class SpriteActivitiesNotWiredError extends Error {
389
+ readonly method: keyof SpriteActivities;
390
+ constructor(method: keyof SpriteActivities);
391
+ }
392
+ /** Phase 1's placeholder default: every method throws `SpriteActivitiesNotWiredError`. See that class's doc comment. */
393
+ export declare function defaultSpriteActivities(): SpriteActivities;
394
+ /**
395
+ * Build the `run-agent` capability. `sprites` is the injectable
396
+ * `SpriteActivities` seam (default: `defaultSpriteActivities()`, the
397
+ * not-wired-yet placeholder — see that function's doc comment) so unit tests
398
+ * never touch a real/emulated sprite, mirroring `createDockerBuildCapability`'s
399
+ * `executor: CloudExecutor` parameter (./build.ts). The fly lexicon's
400
+ * `flyRunAgentCapability` (`lexicons/fly/src/components/run-agent.ts`) is
401
+ * this same factory called with its real `SpriteActivities` adapter.
402
+ *
403
+ * `run()`: `sprites.create` (skipped when reusing `workspace.spriteName`) ->
404
+ * `sprites.checkpoint` (`comment: workspace.checkpointComment ?? "pre-run"`)
405
+ * -> `sprites.writeFile` to stage the prompt -> `sprites.exec` the runtime
406
+ * command (`buildRuntimeCommand`) -> `sprites.readFile` to collect the sole
407
+ * artifact -> `sprites.destroy`, only for a freshly created sprite whose turn
408
+ * completed. See this module's doc comment for the exec-throw resolution,
409
+ * the destroy-vs-leave-alive rule, and the rollback-identity design.
410
+ *
411
+ * `rollback()`: `sprites.restore({ id: spriteId, checkpoint: checkpointId })`
412
+ * — the sole compensation, restoring to the exact pre-run checkpoint `run()`
413
+ * recorded (see this module's doc comment, "Rollback identity"). Prefers the
414
+ * `output` parameter's `spriteId`/`checkpointId` (the durable-safe channel,
415
+ * #1944) over the in-process `WeakMap`, falls back to
416
+ * `sprites.restore({ id: spriteId, comment })` only when neither source has a
417
+ * checkpoint id, and degrades to an explicit no-op when there is no sprite id
418
+ * to restore at all. No hand-written inverse action otherwise; "the
419
+ * environment is the transaction."
420
+ *
421
+ * `rollbackPolicy: "native"` is set explicitly (not left to
422
+ * ../capability.ts's `rollback`-method inference) so the design commitment
423
+ * reads directly off this capability's declaration: a mutating `run-agent`
424
+ * step never needs a `noRollback` opt-out for COMP003
425
+ * (../lint/rules/comp/comp003-mutating-no-rollback.ts).
426
+ */
427
+ export declare function createRunAgentCapability(sprites?: SpriteActivities): Capability<RunAgentInput, RunAgentOutput>;
428
+ /**
429
+ * Compute the transcript digest that becomes (the digest component of)
430
+ * `provenance.sourceRef` and `attestationRef` — see this module's doc
431
+ * comment, "Hash basis," for the precise field list/order and the rationale
432
+ * for hashing rather than embedding each free-text field. Exported so a
433
+ * caller (or a test) can independently recompute/verify the same digest from
434
+ * the same run() inputs/outputs, without reaching into this module's private
435
+ * `run()` closure.
436
+ */
437
+ export declare function computeTranscriptDigest(params: {
438
+ agent: string;
439
+ prompt: string;
440
+ images?: RunAgentImageInput[];
441
+ turn: RunAgentTurn;
442
+ stdout: string;
443
+ stderr: string;
444
+ artifacts: RunAgentOutput["artifacts"];
445
+ }): string;
446
+ /**
447
+ * Recover the bare transcript digest (`sha256:<hex>`) from a
448
+ * `provenance.sourceRef` or `attestationRef` string, regardless of what (if
449
+ * anything) precedes it — see this module's doc comment, "sourceRef
450
+ * folding," for why anchoring on the fixed `sha256:[0-9a-f]{64}` suffix
451
+ * pattern is unambiguous even when `input.sourceRef` itself contains `@`/`:`.
452
+ */
453
+ export declare function extractTranscriptDigest(sourceRef: string): string;
454
+ /**
455
+ * `run-agent`'s SLSA `buildDefinition.buildType` — the recipe-kind URI this
456
+ * module's doc comment ("Predicate-type decision, made") settles on in place
457
+ * of minting a new `predicateType`. Mirrors ./sign.ts's own
458
+ * `DEFAULT_BUILD_TYPE` for `docker-build`.
459
+ */
460
+ export declare const RUN_AGENT_BUILD_TYPE = "https://chant.dev/agent-turn/v1";
461
+ /**
462
+ * Fold a `RunAgentOutput` into a `BuildArchiveEntry` (#1943 design point 2,
463
+ * ./build-archive.ts) — `kind: "asset"`, content-addressed by the same
464
+ * transcript digest `attestationRef` carries. Returns a bare entry (no
465
+ * `reproducibility` assigned); pass it through `addArchiveEntry` for the
466
+ * kind-appropriate `"best-effort"` default (./reproducibility.ts), the same
467
+ * as any other `asset` entry.
468
+ */
469
+ export declare function toRunAgentArchiveEntry(component: string, output: RunAgentOutput): BuildArchiveEntry;
470
+ /**
471
+ * Build the in-toto SLSA provenance statement for a completed turn, reusing
472
+ * ./sign.ts's `buildProvenanceStatement` unmodified in behavior for every
473
+ * existing (image) caller — `predicateType` stays
474
+ * `"https://slsa.dev/provenance/v1"`, only `buildType` and the
475
+ * `external`/`internalParameters` merge fields (#1943's minimal, documented
476
+ * extension to `BuildProvenanceStatementInput`) differ. See this module's
477
+ * doc comment, "Fountain-supplied facts, honestly scoped," for exactly what
478
+ * is (and is not yet) folded in. The returned statement's `subject` is
479
+ * `output.attestationRef` — sign+attach it the same way `attest-provenance`
480
+ * already does for any other digest-qualified reference.
481
+ */
482
+ export declare function buildRunAgentProvenanceStatement(input: RunAgentInput, output: RunAgentOutput, builderId: string, opts?: {
483
+ finishedOn?: string;
484
+ invocationId?: string;
485
+ }): InTotoProvenanceStatement;
486
+ /**
487
+ * Map `RunAgentInput.agent` to the one-shot, non-interactive command that
488
+ * reads the staged prompt (`PROMPT_PATH`) and runs it inside the sprite. Each
489
+ * known `RunAgentRuntime` gets its real CLI invocation; any other value is
490
+ * passed through verbatim as a literal command — a real-world escape hatch
491
+ * for a custom binary already present in the sprite image, and how this
492
+ * module's own tests drive a scripted failure/success against the offline
493
+ * fake without needing a real CLI. See this module's doc comment ("Still
494
+ * open, left for later phases") for why no fountain resolution happens here.
495
+ */
496
+ export declare function buildRuntimeCommand(agent: string): string;
497
+ /** Default `run-agent` capability, backed by the not-wired-yet placeholder `SpriteActivities`. */
498
+ export declare const runAgentCapability: Capability<RunAgentInput, RunAgentOutput>;
499
+ //# sourceMappingURL=run-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-agent.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/run-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyPG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAA4B,KAAK,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AAIlF,wGAAwG;AACxG,MAAM,WA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AAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAQnG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD,yBAAyB,CAgB3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAazD;AAiDD,kGAAkG;AAClG,eAAO,MAAM,kBAAkB,EAAE,UAAU,CAAC,aAAa,EAAE,cAAc,CAA8B,CAAC"}
@@ -40,6 +40,19 @@
40
40
  * `requireTool` throws `ToolNotAvailableError` with an actionable message if
41
41
  * `cosign` is absent, and no test here ever spawns a real process or talks
42
42
  * to Rekor/Fulcio.
43
+ *
44
+ * **#1943 extension (`run-agent` interop).** `BuildProvenanceStatementInput`
45
+ * gained two optional merge fields, `externalParameters`/`internalParameters`
46
+ * — additive only, every existing call site's statement is byte-identical
47
+ * without them. `run-agent` (./run-agent.ts's `buildRunAgentProvenanceStatement`)
48
+ * is the first caller to use them, plus `buildType` (already overridable,
49
+ * unchanged here) set to a `run-agent`-specific recipe URI. `predicateType`
50
+ * stays `"https://slsa.dev/provenance/v1"` for every caller, `run-agent`
51
+ * included — see ./run-agent.ts's own doc comment ("Attestation interop")
52
+ * for why a turn is attested as an SLSA-shaped provenance predicate rather
53
+ * than under a minted `run-agent`-specific `predicateType`, and why that
54
+ * decision means `sign`/`attestProvenance`/`../verbs/verify.ts` needed zero
55
+ * changes to their `cosign` invocations to attest/verify a turn.
43
56
  */
44
57
  import type { Capability } from "../capability.js";
45
58
  import { type ProcessRunner } from "./process-runner.js";
@@ -170,6 +183,23 @@ export interface BuildProvenanceStatementInput {
170
183
  finishedOn?: string;
171
184
  /** CI invocation/run id, when available (e.g. a GitHub Actions run id). */
172
185
  invocationId?: string;
186
+ /**
187
+ * Additional `buildDefinition.externalParameters` merged in alongside the
188
+ * `{ sourceRef }` default (#1943: `run-agent`'s provenance statement folds
189
+ * in the fountain-supplied *declared* facts — the agent selector today,
190
+ * more once fountain `Agent` resolution lands — without run-agent needing
191
+ * its own predicate builder). `sourceRef` is reserved by this function: a
192
+ * caller-supplied `sourceRef` is overridden, never signed; any other key
193
+ * name is the caller's choice.
194
+ */
195
+ externalParameters?: Record<string, unknown>;
196
+ /**
197
+ * Additional `buildDefinition.internalParameters` merged in alongside the
198
+ * `{ artifactDigest }` default (#1943: `run-agent` folds in what actually
199
+ * happened — sprite id, checkpoint id, turn status/exit code — the
200
+ * *imperative* facts a build's `internalParameters` are for).
201
+ */
202
+ internalParameters?: Record<string, unknown>;
173
203
  }
174
204
  /**
175
205
  * Build an in-toto SLSA provenance statement for `input.imageRef`, reusing
@@ -1 +1 @@
1
- {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/sign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;aAE/B,GAAG,EAAE,MAAM;aACX,IAAI,EAAE,MAAM,GAAG,QAAQ;gBADvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,QAAQ;CAQ1C;AAcD;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,wGAAwG;IACxG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,UAAU,CAA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BAAyB,CAwBxG;AAED,MAAM,WAAW,qBAAsB,SAAQ,6BAA6B;IAC1E,yEAAyE;IACzE,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,wEAAwE;IACxE,GAAG,CAAC,EAAE,qBAAqB,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,SAAS,EAAE,yBAAyB,CAAC;IACrC,yDAAyD;IACzD,QAAQ,EAAE,IAAI,CAAC;IACf,kEAAkE;IAClE,MAAM,EAAE,SAAS,GAAG,KAAK,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,qBAAqB,EAC5B,aAAa,EAAE,MAAM,GACpB,MAAM,CAKR;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC9C,aAAa,GAAE,aAAsC,GACpD,UAAU,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAgB3D;AAED,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,EAAE,UAAU,CAAC,qBAAqB,EAAE,sBAAsB,CAC7D,CAAC"}
@@ -73,8 +73,13 @@ export declare function Composite<P, M extends CompositeFactoryMembers = Composi
73
73
  /**
74
74
  * Expands a CompositeInstance into a flat Map of prefixed entity names to Declarables.
75
75
  * Handles nested composites recursively.
76
+ *
77
+ * @param instanceName - The composite INSTANCE every member belongs to (chant
78
+ * #1443), which at the top call is the export name and stays that name
79
+ * through nesting — `prefix` grows per member and is not an instance
80
+ * identity. Defaults to `prefix` so the top call needs no extra argument.
76
81
  */
77
- export declare function expandComposite(prefix: string, instance: CompositeInstance): Map<string, Declarable>;
82
+ export declare function expandComposite(prefix: string, instance: CompositeInstance, instanceName?: string): Map<string, Declarable>;
78
83
  /**
79
84
  * Type helpers for withDefaults.
80
85
  */
@@ -1 +1 @@
1
- {"version":3,"file":"composite.d.ts","sourceRoot":"","sources":["../src/composite.ts"],"names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AK,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,EAC/D,KAAK,EAAE,CAAC,EACR,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,CAAC,CAEH;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,IAAI,EAAE,CAAC,EACP,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GACrB,CAAC,CAqBH"}
@@ -1 +1 @@
1
- {"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/discovery/collect.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAgH9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,EAClE,SAAS,CAAC,EAAE,MAAM,GACjB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAiEzB"}
1
+ {"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/discovery/collect.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAyH9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,EAClE,SAAS,CAAC,EAAE,MAAM,GACjB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAiEzB"}