wingfoil 0.2.1 → 0.3.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 (452) hide show
  1. package/README.md +88 -42
  2. package/dist/agent/discovery.d.ts +72 -0
  3. package/dist/agent/discovery.d.ts.map +1 -0
  4. package/dist/agent/discovery.js +210 -0
  5. package/dist/agent/discovery.js.map +1 -0
  6. package/dist/agent/execute.d.ts +206 -0
  7. package/dist/agent/execute.d.ts.map +1 -0
  8. package/dist/agent/execute.js +581 -0
  9. package/dist/agent/execute.js.map +1 -0
  10. package/dist/agent/index.d.ts +23 -0
  11. package/dist/agent/index.d.ts.map +1 -0
  12. package/dist/agent/index.js +85 -0
  13. package/dist/agent/index.js.map +1 -0
  14. package/dist/agent/launch.d.ts +133 -0
  15. package/dist/agent/launch.d.ts.map +1 -0
  16. package/dist/agent/launch.js +380 -0
  17. package/dist/agent/launch.js.map +1 -0
  18. package/dist/agent/manifest.d.ts +30 -0
  19. package/dist/agent/manifest.d.ts.map +1 -0
  20. package/dist/agent/manifest.js +93 -0
  21. package/dist/agent/manifest.js.map +1 -0
  22. package/dist/agent/placeholders.d.ts +49 -0
  23. package/dist/agent/placeholders.d.ts.map +1 -0
  24. package/dist/agent/placeholders.js +177 -0
  25. package/dist/agent/placeholders.js.map +1 -0
  26. package/dist/agent/run-log.d.ts +254 -0
  27. package/dist/agent/run-log.d.ts.map +1 -0
  28. package/dist/agent/run-log.js +612 -0
  29. package/dist/agent/run-log.js.map +1 -0
  30. package/dist/agent/schema.d.ts +100 -0
  31. package/dist/agent/schema.d.ts.map +1 -0
  32. package/dist/agent/schema.js +89 -0
  33. package/dist/agent/schema.js.map +1 -0
  34. package/dist/agent/step.d.ts +41 -0
  35. package/dist/agent/step.d.ts.map +1 -0
  36. package/dist/agent/step.js +95 -0
  37. package/dist/agent/step.js.map +1 -0
  38. package/dist/build-info.json +4 -0
  39. package/dist/cli/error.d.ts +11 -2
  40. package/dist/cli/error.d.ts.map +1 -1
  41. package/dist/cli/error.js +27 -6
  42. package/dist/cli/error.js.map +1 -1
  43. package/dist/cli/exit.d.ts +33 -3
  44. package/dist/cli/exit.d.ts.map +1 -1
  45. package/dist/cli/exit.js +54 -3
  46. package/dist/cli/exit.js.map +1 -1
  47. package/dist/cli/index.d.ts +2 -2
  48. package/dist/cli/index.d.ts.map +1 -1
  49. package/dist/cli/index.js +3 -2
  50. package/dist/cli/index.js.map +1 -1
  51. package/dist/cli/init-command.d.ts.map +1 -1
  52. package/dist/cli/init-command.js +6 -3
  53. package/dist/cli/init-command.js.map +1 -1
  54. package/dist/cli/mcp-command.d.ts +13 -4
  55. package/dist/cli/mcp-command.d.ts.map +1 -1
  56. package/dist/cli/mcp-command.js +25 -8
  57. package/dist/cli/mcp-command.js.map +1 -1
  58. package/dist/cli/output.d.ts +12 -4
  59. package/dist/cli/output.d.ts.map +1 -1
  60. package/dist/cli/output.js +15 -4
  61. package/dist/cli/output.js.map +1 -1
  62. package/dist/cli/program.d.ts +1 -1
  63. package/dist/cli/program.d.ts.map +1 -1
  64. package/dist/cli/program.js +270 -60
  65. package/dist/cli/program.js.map +1 -1
  66. package/dist/cli/registrar.d.ts +16 -7
  67. package/dist/cli/registrar.d.ts.map +1 -1
  68. package/dist/cli/registrar.js +71 -6
  69. package/dist/cli/registrar.js.map +1 -1
  70. package/dist/cli/suggest.d.ts +20 -0
  71. package/dist/cli/suggest.d.ts.map +1 -0
  72. package/dist/cli/suggest.js +49 -0
  73. package/dist/cli/suggest.js.map +1 -0
  74. package/dist/cli/warning.d.ts +26 -0
  75. package/dist/cli/warning.d.ts.map +1 -0
  76. package/dist/cli/warning.js +66 -0
  77. package/dist/cli/warning.js.map +1 -0
  78. package/dist/cli.js +11 -2
  79. package/dist/cli.js.map +1 -1
  80. package/dist/core/agent-execute.d.ts +44 -0
  81. package/dist/core/agent-execute.d.ts.map +1 -0
  82. package/dist/core/agent-execute.js +71 -0
  83. package/dist/core/agent-execute.js.map +1 -0
  84. package/dist/core/agent-list.d.ts +95 -0
  85. package/dist/core/agent-list.d.ts.map +1 -0
  86. package/dist/core/agent-list.js +207 -0
  87. package/dist/core/agent-list.js.map +1 -0
  88. package/dist/core/agent-show.d.ts +44 -0
  89. package/dist/core/agent-show.d.ts.map +1 -0
  90. package/dist/core/agent-show.js +188 -0
  91. package/dist/core/agent-show.js.map +1 -0
  92. package/dist/core/approval-authority.d.ts +17 -14
  93. package/dist/core/approval-authority.d.ts.map +1 -1
  94. package/dist/core/approval-authority.js +9 -9
  95. package/dist/core/approval-authority.js.map +1 -1
  96. package/dist/core/builtin-asset.d.ts +18 -15
  97. package/dist/core/builtin-asset.d.ts.map +1 -1
  98. package/dist/core/builtin-asset.js +17 -14
  99. package/dist/core/builtin-asset.js.map +1 -1
  100. package/dist/core/builtin-integrity.d.ts +12 -2
  101. package/dist/core/builtin-integrity.d.ts.map +1 -1
  102. package/dist/core/builtin-integrity.js +85 -9
  103. package/dist/core/builtin-integrity.js.map +1 -1
  104. package/dist/core/confinement.d.ts +3 -1
  105. package/dist/core/confinement.d.ts.map +1 -1
  106. package/dist/core/confinement.js +7 -4
  107. package/dist/core/confinement.js.map +1 -1
  108. package/dist/core/context.d.ts +150 -98
  109. package/dist/core/context.d.ts.map +1 -1
  110. package/dist/core/context.js +602 -66
  111. package/dist/core/context.js.map +1 -1
  112. package/dist/core/directive-assign.d.ts +33 -7
  113. package/dist/core/directive-assign.d.ts.map +1 -1
  114. package/dist/core/directive-assign.js +67 -27
  115. package/dist/core/directive-assign.js.map +1 -1
  116. package/dist/core/directive-scope.d.ts +36 -0
  117. package/dist/core/directive-scope.d.ts.map +1 -0
  118. package/dist/core/directive-scope.js +34 -0
  119. package/dist/core/directive-scope.js.map +1 -0
  120. package/dist/core/directives-list.d.ts +13 -3
  121. package/dist/core/directives-list.d.ts.map +1 -1
  122. package/dist/core/directives-list.js +18 -6
  123. package/dist/core/directives-list.js.map +1 -1
  124. package/dist/core/dry-run.d.ts +33 -0
  125. package/dist/core/dry-run.d.ts.map +1 -0
  126. package/dist/core/dry-run.js +45 -0
  127. package/dist/core/dry-run.js.map +1 -0
  128. package/dist/core/element-ref.d.ts +23 -0
  129. package/dist/core/element-ref.d.ts.map +1 -0
  130. package/dist/core/element-ref.js +24 -0
  131. package/dist/core/element-ref.js.map +1 -0
  132. package/dist/core/error-details.d.ts +20 -0
  133. package/dist/core/error-details.d.ts.map +1 -0
  134. package/dist/core/error-details.js +65 -0
  135. package/dist/core/error-details.js.map +1 -0
  136. package/dist/core/exit-code.js +6 -6
  137. package/dist/core/git-identity.d.ts +46 -11
  138. package/dist/core/git-identity.d.ts.map +1 -1
  139. package/dist/core/git-identity.js +140 -27
  140. package/dist/core/git-identity.js.map +1 -1
  141. package/dist/core/index.d.ts +189 -14
  142. package/dist/core/index.d.ts.map +1 -1
  143. package/dist/core/index.js +1241 -238
  144. package/dist/core/index.js.map +1 -1
  145. package/dist/core/init.d.ts +50 -8
  146. package/dist/core/init.d.ts.map +1 -1
  147. package/dist/core/init.js +139 -27
  148. package/dist/core/init.js.map +1 -1
  149. package/dist/core/loaders.d.ts +170 -14
  150. package/dist/core/loaders.d.ts.map +1 -1
  151. package/dist/core/loaders.js +570 -89
  152. package/dist/core/loaders.js.map +1 -1
  153. package/dist/core/memory-add-link.d.ts +28 -0
  154. package/dist/core/memory-add-link.d.ts.map +1 -0
  155. package/dist/core/memory-add-link.js +67 -0
  156. package/dist/core/memory-add-link.js.map +1 -0
  157. package/dist/core/memory-add-type.d.ts +25 -1
  158. package/dist/core/memory-add-type.d.ts.map +1 -1
  159. package/dist/core/memory-add-type.js +59 -1
  160. package/dist/core/memory-add-type.js.map +1 -1
  161. package/dist/core/memory-amend.d.ts +80 -0
  162. package/dist/core/memory-amend.d.ts.map +1 -0
  163. package/dist/core/memory-amend.js +160 -0
  164. package/dist/core/memory-amend.js.map +1 -0
  165. package/dist/core/memory-supersede.d.ts +28 -0
  166. package/dist/core/memory-supersede.d.ts.map +1 -0
  167. package/dist/core/memory-supersede.js +79 -0
  168. package/dist/core/memory-supersede.js.map +1 -0
  169. package/dist/core/memory-transition.d.ts +190 -30
  170. package/dist/core/memory-transition.d.ts.map +1 -1
  171. package/dist/core/memory-transition.js +480 -59
  172. package/dist/core/memory-transition.js.map +1 -1
  173. package/dist/core/registry.d.ts +147 -23
  174. package/dist/core/registry.d.ts.map +1 -1
  175. package/dist/core/registry.js +50 -0
  176. package/dist/core/registry.js.map +1 -1
  177. package/dist/core/relevance.d.ts +74 -12
  178. package/dist/core/relevance.d.ts.map +1 -1
  179. package/dist/core/relevance.js +45 -27
  180. package/dist/core/relevance.js.map +1 -1
  181. package/dist/core/require-reason.d.ts.map +1 -1
  182. package/dist/core/require-reason.js +6 -5
  183. package/dist/core/require-reason.js.map +1 -1
  184. package/dist/core/required-fields.d.ts +28 -0
  185. package/dist/core/required-fields.d.ts.map +1 -0
  186. package/dist/core/required-fields.js +60 -0
  187. package/dist/core/required-fields.js.map +1 -0
  188. package/dist/core/revision.d.ts +82 -0
  189. package/dist/core/revision.d.ts.map +1 -0
  190. package/dist/core/revision.js +144 -0
  191. package/dist/core/revision.js.map +1 -0
  192. package/dist/core/types.d.ts +28 -2
  193. package/dist/core/types.d.ts.map +1 -1
  194. package/dist/core/types.js +12 -3
  195. package/dist/core/types.js.map +1 -1
  196. package/dist/core/workflow-core-checks.d.ts +34 -0
  197. package/dist/core/workflow-core-checks.d.ts.map +1 -0
  198. package/dist/core/workflow-core-checks.js +403 -0
  199. package/dist/core/workflow-core-checks.js.map +1 -0
  200. package/dist/core/workflow-create-remove.d.ts +65 -0
  201. package/dist/core/workflow-create-remove.d.ts.map +1 -0
  202. package/dist/core/workflow-create-remove.js +277 -0
  203. package/dist/core/workflow-create-remove.js.map +1 -0
  204. package/dist/core/workflow-deduction.d.ts +48 -0
  205. package/dist/core/workflow-deduction.d.ts.map +1 -0
  206. package/dist/core/workflow-deduction.js +523 -0
  207. package/dist/core/workflow-deduction.js.map +1 -0
  208. package/dist/core/workflow-diagnostics.d.ts +83 -0
  209. package/dist/core/workflow-diagnostics.d.ts.map +1 -0
  210. package/dist/core/workflow-diagnostics.js +375 -0
  211. package/dist/core/workflow-diagnostics.js.map +1 -0
  212. package/dist/core/workflow-exit-state.d.ts +125 -0
  213. package/dist/core/workflow-exit-state.d.ts.map +1 -0
  214. package/dist/core/workflow-exit-state.js +243 -0
  215. package/dist/core/workflow-exit-state.js.map +1 -0
  216. package/dist/core/workflow-finalize.d.ts +37 -0
  217. package/dist/core/workflow-finalize.d.ts.map +1 -0
  218. package/dist/core/workflow-finalize.js +153 -0
  219. package/dist/core/workflow-finalize.js.map +1 -0
  220. package/dist/core/workflow-list-show.d.ts +176 -0
  221. package/dist/core/workflow-list-show.d.ts.map +1 -0
  222. package/dist/core/workflow-list-show.js +268 -0
  223. package/dist/core/workflow-list-show.js.map +1 -0
  224. package/dist/core/workflow-next.d.ts +268 -0
  225. package/dist/core/workflow-next.d.ts.map +1 -0
  226. package/dist/core/workflow-next.js +503 -0
  227. package/dist/core/workflow-next.js.map +1 -0
  228. package/dist/core/workflow-registry.d.ts +52 -0
  229. package/dist/core/workflow-registry.d.ts.map +1 -0
  230. package/dist/core/workflow-registry.js +158 -0
  231. package/dist/core/workflow-registry.js.map +1 -0
  232. package/dist/core/workflow-start-end.d.ts +71 -0
  233. package/dist/core/workflow-start-end.d.ts.map +1 -0
  234. package/dist/core/workflow-start-end.js +298 -0
  235. package/dist/core/workflow-start-end.js.map +1 -0
  236. package/dist/core/workflow-status.d.ts +83 -0
  237. package/dist/core/workflow-status.d.ts.map +1 -0
  238. package/dist/core/workflow-status.js +125 -0
  239. package/dist/core/workflow-status.js.map +1 -0
  240. package/dist/core/write-guard.d.ts +51 -8
  241. package/dist/core/write-guard.d.ts.map +1 -1
  242. package/dist/core/write-guard.js +139 -9
  243. package/dist/core/write-guard.js.map +1 -1
  244. package/dist/directives/index.d.ts +3 -2
  245. package/dist/directives/index.d.ts.map +1 -1
  246. package/dist/directives/index.js +5 -3
  247. package/dist/directives/index.js.map +1 -1
  248. package/dist/directives/schema.d.ts +35 -30
  249. package/dist/directives/schema.d.ts.map +1 -1
  250. package/dist/directives/schema.js +36 -30
  251. package/dist/directives/schema.js.map +1 -1
  252. package/dist/directives/version.d.ts +28 -0
  253. package/dist/directives/version.d.ts.map +1 -0
  254. package/dist/directives/version.js +51 -0
  255. package/dist/directives/version.js.map +1 -0
  256. package/dist/dna/edit.d.ts +7 -6
  257. package/dist/dna/edit.d.ts.map +1 -1
  258. package/dist/dna/edit.js +96 -41
  259. package/dist/dna/edit.js.map +1 -1
  260. package/dist/dna/mutate.js +18 -3
  261. package/dist/dna/mutate.js.map +1 -1
  262. package/dist/dna/path.d.ts +2 -2
  263. package/dist/dna/roles.d.ts +1 -1
  264. package/dist/dna/schema.d.ts +61 -3
  265. package/dist/dna/schema.d.ts.map +1 -1
  266. package/dist/dna/schema.js +121 -6
  267. package/dist/dna/schema.js.map +1 -1
  268. package/dist/mcp/dna-resource.d.ts.map +1 -1
  269. package/dist/mcp/dna-resource.js +4 -4
  270. package/dist/mcp/dna-resource.js.map +1 -1
  271. package/dist/mcp/index.d.ts +9 -5
  272. package/dist/mcp/index.d.ts.map +1 -1
  273. package/dist/mcp/index.js +13 -2
  274. package/dist/mcp/index.js.map +1 -1
  275. package/dist/mcp/memory-resource.d.ts.map +1 -1
  276. package/dist/mcp/memory-resource.js +30 -19
  277. package/dist/mcp/memory-resource.js.map +1 -1
  278. package/dist/mcp/prompt.d.ts +61 -24
  279. package/dist/mcp/prompt.d.ts.map +1 -1
  280. package/dist/mcp/prompt.js +176 -47
  281. package/dist/mcp/prompt.js.map +1 -1
  282. package/dist/mcp/read-only.d.ts +39 -0
  283. package/dist/mcp/read-only.d.ts.map +1 -1
  284. package/dist/mcp/read-only.js +61 -0
  285. package/dist/mcp/read-only.js.map +1 -1
  286. package/dist/mcp/registrar.d.ts +10 -0
  287. package/dist/mcp/registrar.d.ts.map +1 -1
  288. package/dist/mcp/registrar.js +48 -12
  289. package/dist/mcp/registrar.js.map +1 -1
  290. package/dist/mcp/server.d.ts +21 -14
  291. package/dist/mcp/server.d.ts.map +1 -1
  292. package/dist/mcp/server.js +41 -15
  293. package/dist/mcp/server.js.map +1 -1
  294. package/dist/mcp/session-resource.d.ts +13 -0
  295. package/dist/mcp/session-resource.d.ts.map +1 -0
  296. package/dist/mcp/session-resource.js +65 -0
  297. package/dist/mcp/session-resource.js.map +1 -0
  298. package/dist/mcp/workflow-resource.d.ts +18 -0
  299. package/dist/mcp/workflow-resource.d.ts.map +1 -1
  300. package/dist/mcp/workflow-resource.js +37 -8
  301. package/dist/mcp/workflow-resource.js.map +1 -1
  302. package/dist/memory/add.d.ts +160 -17
  303. package/dist/memory/add.d.ts.map +1 -1
  304. package/dist/memory/add.js +361 -51
  305. package/dist/memory/add.js.map +1 -1
  306. package/dist/memory/audit.d.ts +165 -32
  307. package/dist/memory/audit.d.ts.map +1 -1
  308. package/dist/memory/audit.js +267 -97
  309. package/dist/memory/audit.js.map +1 -1
  310. package/dist/memory/commit-message.d.ts +60 -38
  311. package/dist/memory/commit-message.d.ts.map +1 -1
  312. package/dist/memory/commit-message.js +167 -21
  313. package/dist/memory/commit-message.js.map +1 -1
  314. package/dist/memory/entry.d.ts.map +1 -1
  315. package/dist/memory/entry.js +1 -2
  316. package/dist/memory/entry.js.map +1 -1
  317. package/dist/memory/frontmatter-edit.d.ts +16 -4
  318. package/dist/memory/frontmatter-edit.d.ts.map +1 -1
  319. package/dist/memory/frontmatter-edit.js +13 -1
  320. package/dist/memory/frontmatter-edit.js.map +1 -1
  321. package/dist/memory/git-log.d.ts +18 -6
  322. package/dist/memory/git-log.d.ts.map +1 -1
  323. package/dist/memory/git-log.js +40 -13
  324. package/dist/memory/git-log.js.map +1 -1
  325. package/dist/memory/history.d.ts +74 -13
  326. package/dist/memory/history.d.ts.map +1 -1
  327. package/dist/memory/history.js +129 -45
  328. package/dist/memory/history.js.map +1 -1
  329. package/dist/memory/index.d.ts +13 -11
  330. package/dist/memory/index.d.ts.map +1 -1
  331. package/dist/memory/index.js +38 -3
  332. package/dist/memory/index.js.map +1 -1
  333. package/dist/memory/query.d.ts +161 -19
  334. package/dist/memory/query.d.ts.map +1 -1
  335. package/dist/memory/query.js +435 -55
  336. package/dist/memory/query.js.map +1 -1
  337. package/dist/memory/schema.d.ts +52 -3
  338. package/dist/memory/schema.d.ts.map +1 -1
  339. package/dist/memory/schema.js +132 -8
  340. package/dist/memory/schema.js.map +1 -1
  341. package/dist/memory/state-machine.d.ts +65 -10
  342. package/dist/memory/state-machine.d.ts.map +1 -1
  343. package/dist/memory/state-machine.js +136 -48
  344. package/dist/memory/state-machine.js.map +1 -1
  345. package/dist/memory/submit.d.ts +52 -3
  346. package/dist/memory/submit.d.ts.map +1 -1
  347. package/dist/memory/submit.js +118 -11
  348. package/dist/memory/submit.js.map +1 -1
  349. package/dist/storage/build-stamp.d.ts +18 -0
  350. package/dist/storage/build-stamp.d.ts.map +1 -0
  351. package/dist/storage/build-stamp.js +68 -0
  352. package/dist/storage/build-stamp.js.map +1 -0
  353. package/dist/storage/builtin-adapters.d.ts +32 -0
  354. package/dist/storage/builtin-adapters.d.ts.map +1 -0
  355. package/dist/storage/builtin-adapters.js +100 -0
  356. package/dist/storage/builtin-adapters.js.map +1 -0
  357. package/dist/storage/builtin-directives.d.ts +0 -29
  358. package/dist/storage/builtin-directives.d.ts.map +1 -1
  359. package/dist/storage/builtin-directives.js +9 -4
  360. package/dist/storage/builtin-directives.js.map +1 -1
  361. package/dist/storage/commit.d.ts +310 -3
  362. package/dist/storage/commit.d.ts.map +1 -1
  363. package/dist/storage/commit.js +807 -33
  364. package/dist/storage/commit.js.map +1 -1
  365. package/dist/storage/document.d.ts +6 -0
  366. package/dist/storage/document.d.ts.map +1 -1
  367. package/dist/storage/document.js +10 -1
  368. package/dist/storage/document.js.map +1 -1
  369. package/dist/storage/dry-run.d.ts +65 -0
  370. package/dist/storage/dry-run.d.ts.map +1 -0
  371. package/dist/storage/dry-run.js +150 -0
  372. package/dist/storage/dry-run.js.map +1 -0
  373. package/dist/storage/errors.d.ts +26 -0
  374. package/dist/storage/errors.d.ts.map +1 -1
  375. package/dist/storage/errors.js +27 -1
  376. package/dist/storage/errors.js.map +1 -1
  377. package/dist/storage/frontmatter.d.ts +1 -1
  378. package/dist/storage/frontmatter.js +1 -1
  379. package/dist/storage/git-read.d.ts +64 -0
  380. package/dist/storage/git-read.d.ts.map +1 -0
  381. package/dist/storage/git-read.js +107 -0
  382. package/dist/storage/git-read.js.map +1 -0
  383. package/dist/storage/index.d.ts +13 -5
  384. package/dist/storage/index.d.ts.map +1 -1
  385. package/dist/storage/index.js +39 -2
  386. package/dist/storage/index.js.map +1 -1
  387. package/dist/storage/layout.d.ts +2 -2
  388. package/dist/storage/layout.d.ts.map +1 -1
  389. package/dist/storage/layout.js +2 -7
  390. package/dist/storage/layout.js.map +1 -1
  391. package/dist/storage/memory-path.d.ts +18 -5
  392. package/dist/storage/memory-path.d.ts.map +1 -1
  393. package/dist/storage/memory-path.js +41 -5
  394. package/dist/storage/memory-path.js.map +1 -1
  395. package/dist/storage/snapshot.js +1 -1
  396. package/dist/storage/templates.d.ts +33 -6
  397. package/dist/storage/templates.d.ts.map +1 -1
  398. package/dist/storage/templates.js +182 -17
  399. package/dist/storage/templates.js.map +1 -1
  400. package/dist/validation/config-version.d.ts +19 -0
  401. package/dist/validation/config-version.d.ts.map +1 -0
  402. package/dist/validation/config-version.js +53 -0
  403. package/dist/validation/config-version.js.map +1 -0
  404. package/dist/validation/diagnostic.d.ts +40 -0
  405. package/dist/validation/diagnostic.d.ts.map +1 -0
  406. package/dist/validation/diagnostic.js +41 -0
  407. package/dist/validation/diagnostic.js.map +1 -0
  408. package/dist/validation/format.d.ts +74 -0
  409. package/dist/validation/format.d.ts.map +1 -0
  410. package/dist/validation/format.js +104 -0
  411. package/dist/validation/format.js.map +1 -0
  412. package/dist/validation/id.d.ts +40 -0
  413. package/dist/validation/id.d.ts.map +1 -1
  414. package/dist/validation/id.js +99 -12
  415. package/dist/validation/id.js.map +1 -1
  416. package/dist/validation/identity.d.ts +40 -0
  417. package/dist/validation/identity.d.ts.map +1 -0
  418. package/dist/validation/identity.js +78 -0
  419. package/dist/validation/identity.js.map +1 -0
  420. package/dist/validation/index.d.ts +9 -3
  421. package/dist/validation/index.d.ts.map +1 -1
  422. package/dist/validation/index.js +33 -1
  423. package/dist/validation/index.js.map +1 -1
  424. package/dist/validation/secret-scan.d.ts +10 -7
  425. package/dist/validation/secret-scan.d.ts.map +1 -1
  426. package/dist/validation/secret-scan.js +39 -16
  427. package/dist/validation/secret-scan.js.map +1 -1
  428. package/dist/validation/warning.d.ts +30 -16
  429. package/dist/validation/warning.d.ts.map +1 -1
  430. package/dist/validation/warning.js +74 -7
  431. package/dist/validation/warning.js.map +1 -1
  432. package/dist/workflow/bindings.d.ts +152 -0
  433. package/dist/workflow/bindings.d.ts.map +1 -0
  434. package/dist/workflow/bindings.js +249 -0
  435. package/dist/workflow/bindings.js.map +1 -0
  436. package/dist/workflow/create.d.ts +13 -0
  437. package/dist/workflow/create.d.ts.map +1 -0
  438. package/dist/workflow/create.js +41 -0
  439. package/dist/workflow/create.js.map +1 -0
  440. package/dist/workflow/deduce.d.ts +400 -0
  441. package/dist/workflow/deduce.d.ts.map +1 -0
  442. package/dist/workflow/deduce.js +1109 -0
  443. package/dist/workflow/deduce.js.map +1 -0
  444. package/dist/workflow/manifest-edit.d.ts +19 -0
  445. package/dist/workflow/manifest-edit.d.ts.map +1 -0
  446. package/dist/workflow/manifest-edit.js +124 -0
  447. package/dist/workflow/manifest-edit.js.map +1 -0
  448. package/dist/workflow/schema.d.ts +158 -19
  449. package/dist/workflow/schema.d.ts.map +1 -1
  450. package/dist/workflow/schema.js +190 -16
  451. package/dist/workflow/schema.js.map +1 -1
  452. package/package.json +37 -13
@@ -1,7 +1,39 @@
1
+ import { StorageError } from './errors';
1
2
  /** Options for {@link commitPaths} — carries the git-author/env override used by callers (e.g. task-029's wizard). */
2
3
  export interface CommitOptions {
3
4
  /** Additional environment for the git invocations (merged over `process.env`). */
4
5
  readonly env?: NodeJS.ProcessEnv;
6
+ /**
7
+ * The commit's author, passed to git as `GIT_AUTHOR_NAME` / `GIT_AUTHOR_EMAIL` in its environment,
8
+ * over `process.env` and over any `GIT_AUTHOR_*` in {@link CommitOptions.env}. Set by a caller that
9
+ * has already checked an identity and must record exactly that one (task-132, `bug-149`); absent,
10
+ * git resolves the author itself. The environment, not `--author "<name> <<email>>"`: git re-parses
11
+ * that string, so a `<` in the name moved the email it recorded (task-132 review, finding 2).
12
+ */
13
+ readonly author?: {
14
+ readonly name: string;
15
+ readonly email: string;
16
+ };
17
+ /**
18
+ * The success warnings the operation has collected before it commits (task-210 review, F4). The real
19
+ * run ignores them — the operation reports them itself — while a dry run, which stops at the commit,
20
+ * carries them into its result, so `--dry-run` warns about what the real run would warn about.
21
+ */
22
+ readonly warnings?: readonly string[];
23
+ /**
24
+ * {@link CommitOptions.warnings} as a dry run words them, when a warning reports something done ("was
25
+ * rewritten") that a plan only intends ("would be rewritten"). Absent, a dry run carries `warnings`.
26
+ */
27
+ readonly plannedWarnings?: readonly string[];
28
+ /**
29
+ * Trailer lines (`Key: value`) the commit records in its **final** paragraph, before the
30
+ * `WingFoil-Version:` line ({@link stampedMessage}) — the one paragraph git reads trailers from
31
+ * (`%(trailers)`). `workflow finalize`'s phase-record trailers (`spec-003` § "Evidence", task-226) and
32
+ * `memory add --workflow`'s step linkage (task-227, `spec-017` §4.8) ride here: in a paragraph of their
33
+ * own before the signature, git would not read them. Absent or empty, the message is exactly what it was
34
+ * before.
35
+ */
36
+ readonly trailers?: readonly string[];
5
37
  }
6
38
  /**
7
39
  * Stage exactly `paths` (root-relative or absolute; each passed verbatim after `--` so a path that
@@ -10,16 +42,103 @@ export interface CommitOptions {
10
42
  * neither committed nor unstaged (bug-027) — this also holds for the first commit of an empty
11
43
  * repository (`wingfoil init`).
12
44
  *
45
+ * **What the commit records is `message` plus the build signature** (task-192, `dl-111`): a final
46
+ * trailer paragraph `WingFoil-Version: <semver> (<sha>)` ({@link stampedMessage}), so every commit
47
+ * WingFoil writes says which build wrote it and a hand-written one carries no such line. The body is
48
+ * normalized by `--cleanup=whitespace`, pinned rather than inherited from `commit.cleanup`
49
+ * (`bug-051`). Callers keep returning their own `message` in `CoreResult.commit`; the signature is
50
+ * this primitive's, not the operation's.
51
+ *
13
52
  * Determinism note (REQ-SYS-07): a git commit's sha necessarily incorporates the author/commit
14
53
  * timestamp, so two runs produce different shas — that is inherent to *creating* history and is not
15
54
  * a context-building read path (the determinism rule targets read/derivation paths, e.g.
16
55
  * `computeStateSnapshot`), so it is correct and intended here.
17
56
  *
57
+ * A mutating operation commits through {@link writeAndCommit}, which writes, commits and undoes a
58
+ * refused commit in one place; during a dry run this function throws instead of committing (task-210).
59
+ *
18
60
  * @throws whatever `git` raises (via `execFileSync`) — e.g. nothing staged to commit, or `root` is
19
61
  * not a git repository. Callers that must translate those into a `CoreResult` do so at their layer
20
62
  * (see `src/core/init.ts`); this primitive stays a thin, throwing mechanism by design.
21
63
  */
22
64
  export declare function commitPaths(root: string, paths: readonly string[], message: string, options?: CommitOptions): string;
65
+ /**
66
+ * The root-relative paths the index holds a change to, against `HEAD` (`git diff --cached --name-only`),
67
+ * in git's order — what a plain `git commit` would record. Empty when the index matches `HEAD`.
68
+ */
69
+ export declare function stagedPaths(root: string, options?: CommitOptions): string[];
70
+ /**
71
+ * Make one commit that changes **no file** — `workflow finalize`'s phase record (`spec-017` §7.9, task-226) —
72
+ * with `message`, {@link CommitOptions.trailers} and the build signature in its final paragraph, returning
73
+ * its sha. The commit primitive's third form, beside {@link writeAndCommit}:
74
+ *
75
+ * - **`git commit --only --allow-empty`, no pathspec** — git's documented form for an empty commit that
76
+ * records nothing the index holds: a change the operator staged is neither committed nor unstaged
77
+ * (`bug-027`, `dl-106`), even when a caller skipped the dirty-index guard (`requireCleanIndex`,
78
+ * `src/core/write-guard.ts`) that refuses it first.
79
+ * - **`--cleanup=whitespace`** pinned over `commit.cleanup` (`bug-051`), as for every tool commit.
80
+ * - **Dry run** (`dl-106` W2): inside `captureDryRun` nothing is committed; the plan is the subject, the
81
+ * full message, no paths and no diff.
82
+ *
83
+ * @throws {@link CommitFailure} (`E_COMMIT_FAILED`) when git does not make the commit (a refusing hook);
84
+ * nothing was written, so there is nothing to put back.
85
+ */
86
+ export declare function commitEmpty(root: string, message: string, options?: CommitOptions): string;
87
+ /**
88
+ * One path a write changes: its new `content`, or `null` to delete it. `path` is root-relative or
89
+ * absolute, as {@link commitPaths} accepts it.
90
+ */
91
+ export interface PathChange {
92
+ readonly path: string;
93
+ readonly content: string | null;
94
+ }
95
+ /**
96
+ * Write `changes` and commit exactly those paths as one commit with `message`, returning its sha — the
97
+ * single primitive every mutating operation writes through (task-210), so that two behaviours are
98
+ * implemented once for all of them:
99
+ *
100
+ * - **Dry run** (`dl-106` W2, `spec-008` §2 `--dry-run`). Inside `captureDryRun` (`./dry-run`), nothing
101
+ * is written: the commit the call would make — subject, full message with the `WingFoil-Version:`
102
+ * trailer, sorted root-relative paths, and the diff from `HEAD` to the blobs it would record
103
+ * (`planDiff`) — is recorded with {@link CommitOptions.warnings}, and the operation stops here. Every
104
+ * guard and refusal the operation runs before its write has already run, so a dry run of a refused
105
+ * operation is refused the same way.
106
+ * - **A failed commit leaves nothing behind** (`bug-217`). When writing a file or git's `add`/`commit`
107
+ * fails (a refusing hook, a full disk, an unparseable author date, a held `index.lock`), the working
108
+ * tree is put back first — a created file is deleted, then every directory the write created, deepest
109
+ * first across all paths; an overwritten or deleted file gets its bytes back — and then, when it
110
+ * differs from what it was, the index entry of every path, whatever the operator had staged there. So
111
+ * a retry of `memory add` gets the same id and nothing rides into the operator's next commit. A git
112
+ * failure is then reported as {@link CommitFailure} (`E_COMMIT_FAILED`), naming the paths repository-
113
+ * relative and quoting git's explanation with the project root removed — and, if the index could not
114
+ * be put back, saying so. A filesystem failure is rethrown as it was raised (the index is untouched by
115
+ * then).
116
+ *
117
+ * Callers run their confinement and dirty-target guards before calling: this primitive writes where it
118
+ * is told.
119
+ */
120
+ export declare function writeAndCommit(root: string, changes: readonly PathChange[], message: string, options?: CommitOptions): string;
121
+ /**
122
+ * `E_COMMIT_FAILED` (task-210, `bug-217`): git did not make the commit of a write, and
123
+ * {@link writeAndCommit} has put the working tree back. Carries its parts so a caller that must word
124
+ * the failure differently (approve's supersede recovery) does not parse the message.
125
+ */
126
+ export declare class CommitFailure extends StorageError {
127
+ /** The repository-relative paths the commit would have contained. */
128
+ readonly paths: readonly string[];
129
+ /** git's explanation, on one line, with the project root removed. */
130
+ readonly gitDetail: string;
131
+ /** Why the index entries could not be put back, when they could not; `undefined` when they were. */
132
+ readonly indexProblem: string | undefined;
133
+ constructor(root: string, paths: readonly string[], raw: string, indexProblem: string | undefined);
134
+ }
135
+ /**
136
+ * The reason a caller quotes for a failed write it reports in its own words (approve's supersede
137
+ * recovery, task-210 review F5): for a {@link CommitFailure}, `E_COMMIT_FAILED: git did not commit
138
+ * <paths>: <explanation>` — without the clause saying the working tree is as it was, which such a caller
139
+ * is about to make untrue — plus the index problem, if any; for anything else, `String(error)`.
140
+ */
141
+ export declare function commitFailureSummary(error: unknown): string;
23
142
  /**
24
143
  * git's canonical empty tree object, the same on every repository (`git hash-object -t tree
25
144
  * /dev/null`). Used as the parent of a **root** commit so "what changed between this commit and its
@@ -27,15 +146,49 @@ export declare function commitPaths(root: string, paths: readonly string[], mess
27
146
  */
28
147
  export declare const EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
29
148
  /**
30
- * The content of `path` at revision `rev`, or `null` when the path does not exist there (git exits
31
- * non-zero, which `execFileSync` raises).
149
+ * The content of `path` at revision `rev`, or `null` when git answers with its `fatal:` exit `128`:
150
+ * the path is absent there, or `rev` does not resolve (or `root` is no repository).
151
+ *
152
+ * Read through `runGitRead` (`./git-read`, task-142 review): stderr is captured, never inherited, and
153
+ * the buffer is `GIT_READ_MAX_BUFFER`. Before, a document past Node's 1 MiB default made
154
+ * `execFileSync` throw `ENOBUFS` and a blanket `catch` answered `null` — "absent" for a document that
155
+ * is there, which `memory amend`, the loaders and the write guard turned into a wrong refusal. A
156
+ * failure that is not git's answer — git that cannot be spawned, an answer past the buffer — now
157
+ * throws `StorageError` `E_GIT_READ_FAILED`. Exit `128` stays `null`: git gives it to an absent path
158
+ * and to an unreadable object alike, and this read does not tell them apart.
32
159
  *
33
160
  * `rev` is any revision git accepts before a `:` — a sha, `HEAD`, or the index stage `:0`, which is
34
161
  * how a caller reads what the user has **staged** as opposed to what is in the working tree. The two
35
162
  * can disagree, and the difference is load-bearing: `git add` would silently replace a staged version
36
163
  * with the working-tree one.
164
+ *
165
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` when git cannot be spawned or its answer exceeds
166
+ * the read buffer (task-142 review).
37
167
  */
38
168
  export declare function readPathAtRev(root: string, rev: string, path: string, options?: CommitOptions): string | null;
169
+ /**
170
+ * Whether `content`, put through the filters git applies when it stores `path` (`core.autocrlf`,
171
+ * `.gitattributes` `eol`/`text`/`filter`), is exactly the blob `rev` holds at `path` — git's own
172
+ * answer to "is this what was committed", rather than a byte comparison with `git show`, which on a
173
+ * machine that normalizes line endings sees an LF blob where the working tree holds CRLF (task-193
174
+ * review). Compares object ids: `git hash-object --path=<path> --stdin` of the bytes against
175
+ * `git rev-parse <rev>:<path>`. `false` when `rev` does not hold `path`.
176
+ *
177
+ * @param root - The repository.
178
+ * @param rev - The revision whose blob is compared (a commit sha).
179
+ * @param path - Root-relative path, which selects the filters as well as the blob.
180
+ * @param content - The text as it was written to the working tree.
181
+ * @param options - {@link CommitOptions} (the environment git runs with).
182
+ */
183
+ export declare function committedBlobMatches(root: string, rev: string, path: string, content: string, options?: CommitOptions): boolean;
184
+ /**
185
+ * Whether git would store `content`, written to the working tree at `path`, as exactly the blob
186
+ * `blob` — `content` put through the filters git applies to `path` (`core.autocrlf`, `.gitattributes`),
187
+ * `blob` taken as-is. The counterpart of {@link committedBlobMatches} for a blob that exists only in
188
+ * memory (`memory submit`'s rendering of the committed document, task-209 review F1): it compares
189
+ * `git hash-object --path=<path> --stdin` with `git hash-object --no-filters --stdin`.
190
+ */
191
+ export declare function storesAsBlob(root: string, path: string, content: string, blob: string, options?: CommitOptions): boolean;
39
192
  /**
40
193
  * The two-character `git status --porcelain` code for `path` (index status, then working-tree
41
194
  * status), or the empty string when the path is clean — unmodified in both, and tracked.
@@ -86,7 +239,161 @@ export declare function changedPathsBetween(root: string, from: string, to: stri
86
239
  * @param prefix - Root-relative directory to limit the listing to; **omitted or empty lists the whole
87
240
  * tree**, because `git ls-tree -- ''` is an error rather than a match-all. Passed verbatim after
88
241
  * `--`, so a path that looks like a flag is never misread.
89
- * @returns The paths, or `null` when `rev` does not resolve.
242
+ * @returns The paths, or `null` when `rev` does not resolve (git's exit `128`).
243
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` when git cannot be spawned or its answer exceeds
244
+ * the read buffer (task-142 review).
90
245
  */
91
246
  export declare function listPathsAtRev(root: string, rev: string, prefix?: string, options?: CommitOptions): string[] | null;
247
+ /** One blob {@link listBlobEntriesAtRev} lists: its path, and whether git records it as a symbolic link. */
248
+ export interface BlobEntry {
249
+ readonly path: string;
250
+ /** Mode `120000`: the blob holds the link's target text, not a file's content (task-171, `bug-189`). */
251
+ readonly symlink: boolean;
252
+ }
253
+ /**
254
+ * {@link listPathsAtRev} with each blob's kind: the same paths, in the same order, each marked when git
255
+ * records it as a **symbolic link** (mode `120000`). A link is a blob, so `listPathsAtRev` lists it and
256
+ * `readPathAtRev` reads back its target text; a reader that must not take that text for a document
257
+ * (the Memory scan, task-171, `bug-189`) asks here instead. Same `null` and same errors as
258
+ * {@link listPathsAtRev}.
259
+ */
260
+ export declare function listBlobEntriesAtRev(root: string, rev: string, prefix: string, options?: CommitOptions): BlobEntry[] | null;
261
+ /**
262
+ * The full 40-hex sha of the **commit** `rev` names, or `null` when it names none: an unknown name, an
263
+ * unborn `HEAD` in a repository with no commits, a tree or a blob (`git rev-parse --verify --quiet`
264
+ * exits `1` for all of them).
265
+ *
266
+ * The `…AtRev` readers (`src/core/loaders.ts`, `src/memory/query.ts`) resolve their revision through
267
+ * this **once**, then read every byte at the sha, so one read cannot mix two commits when a ref moves
268
+ * while it runs. `^{commit}` peels a tag to its commit and refuses anything that is not one.
269
+ *
270
+ * **A failure is not "no such commit"** (task-137 review): a `root` git cannot read as a repository
271
+ * (exit `128`) or a `git` that cannot be spawned throws {@link StorageError} `E_GIT_READ_FAILED`, so a
272
+ * caller never reports a broken environment as a missing revision.
273
+ *
274
+ * The syntax of `rev` is the caller's to check — the core resolver (`resolveRevision`,
275
+ * `src/core/revision.ts`) refuses a malformed one before it gets here, so that nothing shaped like a
276
+ * flag ever reaches git's argument list.
277
+ *
278
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` when git cannot answer at all.
279
+ */
280
+ export declare function resolveCommitAtRev(root: string, rev: string, options?: CommitOptions): string | null;
281
+ /**
282
+ * The content of each of `paths` at revision `rev`, in input order — the bytes as UTF-8, or `null` when
283
+ * the revision does not hold that path as a **file** — read through **one** `git cat-file --batch`
284
+ * process instead of one `git show` per path. For a file or an absent path that is what
285
+ * {@link readPathAtRev} answers; for a directory it is `null`, where `git show` would print the tree's
286
+ * listing, which is no file's content.
287
+ *
288
+ * Why it exists (task-137): `spec-017` §1.1 reads every Memory document at `HEAD` on every workflow
289
+ * read, and `spec-012` builds an agent context from a commit. On this repository's 664 Memory and plan
290
+ * documents one `git show` per file took 5.49 s, the batch 0.39 s (task-137 design notes).
291
+ *
292
+ * **Fails closed.** A batch that cannot run, exits non-zero or answers past
293
+ * {@link BATCH_READ_MAX_BUFFER} throws {@link StorageError} `E_GIT_READ_FAILED`: a failed read must not
294
+ * pass for "every path is absent". `null` is reserved for a path the revision really does not hold.
295
+ *
296
+ * A path holding a newline or a carriage return cannot travel on the line-based batch protocol (git
297
+ * ends the request at the newline and strips a trailing CR); it is read on its own with
298
+ * {@link readPathAtRev}, which gives the same answer. Pass a resolved sha as `rev` when several calls
299
+ * must see one commit.
300
+ *
301
+ * @param root - Project root (the git repository).
302
+ * @param rev - A revision naming one commit — best a sha already resolved (`resolveCommitAtRev`). It
303
+ * travels inside each request line, so a rev holding a newline, a carriage return, a `:` or a NUL is
304
+ * refused with {@link StorageError} `E_INVALID_REVISION`: a newline would shift every answer onto
305
+ * the wrong path, and a `:` would change which path is read.
306
+ * @param paths - Root-relative POSIX paths.
307
+ * @returns One entry per path, in the same order.
308
+ * @throws {@link StorageError} `E_INVALID_REVISION` for such a rev; `E_GIT_READ_FAILED` when the
309
+ * batch read fails.
310
+ */
311
+ export declare function readPathsAtRev(root: string, rev: string, paths: readonly string[], options?: CommitOptions): (string | null)[];
312
+ /** One `<rev>:<path>` read of {@link readRevisionPaths}. */
313
+ export interface RevisionPath {
314
+ /** A revision naming one commit: a sha, or an expression over one (`<sha>^1`). */
315
+ readonly rev: string;
316
+ /** Root-relative POSIX path. */
317
+ readonly path: string;
318
+ }
319
+ /**
320
+ * The content of each `<rev>:<path>` request — each at its OWN revision — in input order: the bytes as
321
+ * UTF-8, or `null` when that revision does not hold that path as a file, a revision that names no
322
+ * commit included (the first parent of a root commit, `<sha>^1`). The many-revision counterpart of
323
+ * {@link readPathsAtRev}, with its answers and its refusals, in **one** `git cat-file --batch`.
324
+ *
325
+ * Why it exists (`task-278`, `bug-308`): `reconstructMemoryTransitions` (`src/memory/audit.ts`) reads
326
+ * a document at every commit of its history AND at each commit's first parent; one `git show` per
327
+ * read would double the spawns of the governance check's slowest path, a batch replaces them all.
328
+ *
329
+ * @param root - Project root (the git repository).
330
+ * @param requests - The revisions and paths to read.
331
+ * @param options - {@link CommitOptions} (the environment git runs with).
332
+ * @returns One entry per request, in the same order.
333
+ * @throws {@link StorageError} `E_INVALID_REVISION` for a rev holding a newline, a carriage return, a
334
+ * `:` or a NUL; `E_GIT_READ_FAILED` when the batch read fails.
335
+ */
336
+ export declare function readRevisionPaths(root: string, requests: readonly RevisionPath[], options?: CommitOptions): (string | null)[];
337
+ /**
338
+ * Every **file** any of `revs` holds under `prefix`, as one sorted, de-duplicated list of
339
+ * root-relative POSIX paths — the union of {@link listPathsAtRev} over `revs`, read in a number of git
340
+ * processes that does not depend on how many revisions there are (`bug-178`, absorbed by `task-142`).
341
+ *
342
+ * `memory add`'s id counter reads every local branch and remote-tracking ref (`dl-101` §2 (a)); one
343
+ * `git ls-tree` per ref made its cost grow with the clone's branch count. Here one
344
+ * `git cat-file --batch` resolves every revision's tree at `prefix`, and each further level of the
345
+ * directory costs one more batch, asking only for the subtrees no earlier answer already held — so the
346
+ * process count is the depth of the directory under `prefix` plus one, and branches that share a
347
+ * subtree (most of them, most of the time) read it once.
348
+ *
349
+ * It answers what {@link listPathsAtRev} answers, unioned — compared case by case in
350
+ * `test/storage/list-paths-at-revs.test.ts` rather than claimed by construction: blobs only (a symbolic
351
+ * link is a blob, a gitlink is not a file), a subtree recognised by its mode's **type bits** so a
352
+ * legacy zero-padded `040000` is still a directory, the path bytes as UTF-8, sorted (REQ-SYS-07). The
353
+ * prefix is taken in canonical spelling — leading `./` segments and trailing `/` are dropped — and a
354
+ * prefix naming a file lists that file unless it ends in `/`. Other non-canonical spellings (`..`,
355
+ * `//` inside) are not normalised, and `ls-tree`'s pathspec matching may answer them differently.
356
+ *
357
+ * @param root - Project root (the git repository).
358
+ * @param revs - Revisions naming commits — best full shas. One that names no commit fails the read.
359
+ * @param prefix - Root-relative directory or file, canonical spelling (see above); empty lists whole trees.
360
+ * @returns The union of the paths, sorted.
361
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` when a revision names no commit or tree, or the
362
+ * batch read fails; `E_INVALID_REVISION` for a revision that cannot travel on the batch protocol.
363
+ */
364
+ export declare function listPathsAtRevs(root: string, revs: readonly string[], prefix?: string, options?: CommitOptions): string[];
365
+ /** A blob a revision holds under a directory: its path, its object name, and whether it is a link. */
366
+ export interface BlobAtRev extends BlobEntry {
367
+ /** The blob's object name: equal oids are equal bytes, so a reader parses each distinct one once. */
368
+ readonly oid: string;
369
+ }
370
+ /**
371
+ * The blobs each of `revs` holds under `directory`, one sorted list per revision, in input order —
372
+ * {@link listPathsAtRevs}' batched walk (task-142, `bug-178`), keeping per revision what it holds and
373
+ * each blob's oid. The walk asks one `git cat-file --batch` per directory level for the trees no earlier
374
+ * answer held, so revisions that share a subtree read it once, and the process count is the directory's
375
+ * depth plus one whatever the number of revisions (task-274, the WIP-limit count across refs).
376
+ *
377
+ * A revision without `directory` holds nothing there. Gitlinks are skipped; a symbolic link is listed,
378
+ * marked. `directory` is root-relative, without a trailing `/`; empty means the whole tree.
379
+ *
380
+ * @throws {@link StorageError} `E_INVALID_REVISION` for a revision that cannot travel on the batch
381
+ * protocol; `E_GIT_READ_FAILED` when a revision names no commit or tree, or the batch read fails.
382
+ */
383
+ export declare function listBlobsAtRevs(root: string, revs: readonly string[], directory: string, options?: CommitOptions): BlobAtRev[][];
384
+ /**
385
+ * The content of each blob `oids` names, as UTF-8, read through one `git cat-file --batch` (task-274).
386
+ * Duplicates are read once.
387
+ *
388
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` when an oid names no blob or the batch read fails.
389
+ */
390
+ export declare function readBlobs(root: string, oids: readonly string[], options?: CommitOptions): Map<string, string>;
391
+ /**
392
+ * The best common ancestor of `base` with each of `revs` (`git merge-base`), in input order, or `null`
393
+ * for a revision that shares no history with `base` (task-274: a ref's copy of an element counts only
394
+ * when the ref changed it since this commit). One `git merge-base` per revision.
395
+ *
396
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` when git fails for another reason.
397
+ */
398
+ export declare function mergeBasesWith(root: string, base: string, revs: readonly string[], options?: CommitOptions): (string | null)[];
92
399
  //# sourceMappingURL=commit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/storage/commit.ts"],"names":[],"mappings":"AAoBA,sHAAsH;A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