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
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GIT_READ_MAX_BUFFER = void 0;
4
+ exports.runGitRead = runGitRead;
5
+ exports.runGitReadBytes = runGitReadBytes;
6
+ exports.requireCommitName = requireCommitName;
7
+ /**
8
+ * The one helper every **read-only** `git` invocation of the Memory pillar goes through
9
+ * (`task-142-run-memory-git-read-through-helper-captures-stderr`).
10
+ *
11
+ * Three defects of the same class led here, each written by a different task because nothing said
12
+ * how a Memory git read must be made:
13
+ *
14
+ * - **No `maxBuffer`** (`bug-072`): Node's 1 MiB default applied, a larger `git log` threw `ENOBUFS`,
15
+ * and a `catch` folded it into "this document has no history".
16
+ * - **Inherited stderr** (`bug-071`, `bug-093`): without `stdio`, the child writes git's own
17
+ * `fatal:` straight to the operator's terminal, beside the message WingFoil meant to print.
18
+ * - **Failures swallowed**: "git could not answer" read as an empty answer.
19
+ *
20
+ * {@link runGitRead} settles all three in one place: stderr is piped (never inherited) and carried
21
+ * inside the error, the buffer is {@link GIT_READ_MAX_BUFFER}, and any exit status the caller did not
22
+ * declare as an answer throws {@link StorageError} `E_GIT_READ_FAILED`. A caller that expects a
23
+ * failure — a path absent at a commit — names that exit status in `accepted` and decides what it
24
+ * means; nothing else is absorbed. `test/memory/git-read.test.ts` pins that no `src/memory` module
25
+ * spawns git any other way.
26
+ */
27
+ const child_process_1 = require("child_process");
28
+ const errors_1 = require("./errors");
29
+ /**
30
+ * Large enough for any answer a Memory read asks of git — a whole tree's path list, a full history
31
+ * walk; an answer past it fails loudly ({@link runGitRead}), it is never truncated.
32
+ */
33
+ exports.GIT_READ_MAX_BUFFER = 256 * 1024 * 1024;
34
+ function spawnGit(root, args, options, encoding) {
35
+ return (0, child_process_1.spawnSync)('git', ['-C', root, ...args], {
36
+ // `undefined` returns Buffers; Node rejects the literal 'buffer' once `input` is given.
37
+ encoding: encoding === 'buffer' ? undefined : encoding,
38
+ env: options.env ? { ...process.env, ...options.env } : process.env,
39
+ maxBuffer: exports.GIT_READ_MAX_BUFFER,
40
+ input: options.input,
41
+ stdio: [options.input === undefined ? 'ignore' : 'pipe', 'pipe', 'pipe'],
42
+ });
43
+ }
44
+ function failure(root, args, detail) {
45
+ return new errors_1.StorageError(errors_1.E_GIT_READ_FAILED, `git ${args.join(' ')} failed in ${root}: ${detail}`);
46
+ }
47
+ /**
48
+ * Run `git -C <root> <args>` for its answer, with stdout decoded as UTF-8.
49
+ *
50
+ * @param root - The repository to read.
51
+ * @param args - git's arguments, passed verbatim (never through a shell).
52
+ * @param options - {@link GitReadOptions}.
53
+ * @returns The exit status, stdout and the captured stderr.
54
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` — carrying git's stderr, or the spawn error — when
55
+ * git cannot be spawned, its output exceeds {@link GIT_READ_MAX_BUFFER}, it is killed, or it exits
56
+ * with a status outside `accepted`.
57
+ */
58
+ function runGitRead(root, args, options = {}) {
59
+ const run = spawnGit(root, args, options, 'utf-8');
60
+ const accepted = options.accepted ?? [0];
61
+ if (run.error !== undefined || run.status === null || !accepted.includes(run.status)) {
62
+ throw failure(root, args, run.error !== undefined ? run.error.message : run.stderr.trim());
63
+ }
64
+ return { status: run.status, stdout: run.stdout, stderr: run.stderr };
65
+ }
66
+ /**
67
+ * {@link runGitRead} for an answer that is bytes, not text — `git cat-file --batch`, whose object
68
+ * sizes are byte counts and whose tree objects are binary.
69
+ *
70
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` on the same conditions as {@link runGitRead}.
71
+ */
72
+ function runGitReadBytes(root, args, options = {}) {
73
+ const run = spawnGit(root, args, options, 'buffer');
74
+ const accepted = options.accepted ?? [0];
75
+ const stderr = run.stderr?.toString('utf-8') ?? '';
76
+ if (run.error !== undefined || run.status === null || !accepted.includes(run.status)) {
77
+ throw failure(root, args, run.error !== undefined ? run.error.message : stderr.trim());
78
+ }
79
+ return { status: run.status, stdout: run.stdout, stderr };
80
+ }
81
+ /** A full commit name: 40 hexadecimal digits (SHA-1), or 64 (SHA-256). */
82
+ const FULL_COMMIT_NAME_RE = /^[0-9a-f]{40}([0-9a-f]{24})?$/;
83
+ /**
84
+ * `name`, checked to be a full commit name, as a reader of `git log --format=%H` output takes it
85
+ * (`task-268`, `bug-291`).
86
+ *
87
+ * Every `git log` reader passes `--no-show-signature`, so a `log.showSignature` configuration cannot
88
+ * print signature text ("No signature", "Good … signature for …") among the formatted lines. This is
89
+ * the second half: whatever still arrives where a name was expected is refused, never used — a
90
+ * garbled name used as a sha silently drops the commit it should have named (a phase record left
91
+ * uncounted) or surfaces as an unrelated error ("creation commit No signature is not present …").
92
+ * `agent show` makes the same check on its own reader (`task-220` review F1).
93
+ *
94
+ * @param name - The text the reader parsed as a commit name.
95
+ * @param command - The git command that printed it, for the message (e.g. `git log --follow`).
96
+ * @returns `name`, unchanged.
97
+ * @throws {@link StorageError} `E_GIT_READ_FAILED` — `IO` at the core boundary — when `name` is not a
98
+ * full commit name: `<command> printed "<name>" where a commit name was expected`, `name` quoted as a
99
+ * JSON string so a line break in it stays visible.
100
+ */
101
+ function requireCommitName(name, command) {
102
+ if (!FULL_COMMIT_NAME_RE.test(name)) {
103
+ throw new errors_1.StorageError(errors_1.E_GIT_READ_FAILED, `${command} printed ${JSON.stringify(name)} where a commit name was expected`);
104
+ }
105
+ return name;
106
+ }
107
+ //# sourceMappingURL=git-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-read.js","sourceRoot":"","sources":["../../src/storage/git-read.ts"],"names":[],"mappings":";;;AA8EA,gCAOC;AAQD,0CAQC;AAuBD,8CAKC;AAjID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iDAA0C;AAE1C,qCAA2D;AAE3D;;;GAGG;AACU,QAAA,mBAAmB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAwBrD,SAAS,QAAQ,CAAC,IAAY,EAAE,IAAuB,EAAE,OAAuB,EAAE,QAA4B;IAC5G,OAAO,IAAA,yBAAS,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE;QAC7C,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,CAAC,0BAAiB,EAAE,GAAG,OAAO,YAAY,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAC3H,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -6,24 +6,32 @@
6
6
  * computing the whole-project state snapshot the REQ-SYS-01 fit criterion is stated in terms of.
7
7
  */
8
8
  export declare const MODULE_NAME: "storage";
9
- export { StorageError, E_NO_GIT_ROOT, E_NOT_AT_GIT_ROOT, E_MISSING_PATH_VALUE } from './errors';
9
+ export { StorageError, E_COMMIT_FAILED, E_GIT_READ_FAILED, E_INVALID_REVISION, E_NO_GIT_ROOT, E_NOT_AT_GIT_ROOT, E_MISSING_PATH_VALUE } from './errors';
10
10
  export { findGitRoot, resolveProjectRoot } from './git-root';
11
11
  export { detectInitState } from './init-state';
12
12
  export type { InitState } from './init-state';
13
- export { renderMemoryPath, resolveMemoryPath } from './memory-path';
13
+ export { renderMemoryPath } from './memory-path';
14
14
  export { escapesRoot, resolveRealPathInRoot } from './confinement';
15
15
  export type { RealPathResolution } from './confinement';
16
16
  export { extractFrontmatter, splitFrontmatter } from './frontmatter';
17
17
  export type { FrontmatterSplit } from './frontmatter';
18
18
  export { readDocument, documentExists, removeDocument, writeDocument } from './document';
19
- export { changedPathsBetween, commitParent, commitPaths, EMPTY_TREE_SHA, listPathsAtRev, pathPorcelainStatus, readPathAtRev } from './commit';
20
- export type { CommitOptions } from './commit';
19
+ export { changedPathsBetween, CommitFailure, commitFailureSummary, commitEmpty, commitParent, commitPaths, committedBlobMatches, stagedPaths, writeAndCommit, EMPTY_TREE_SHA, listBlobEntriesAtRev, listBlobsAtRevs, listPathsAtRev, listPathsAtRevs, mergeBasesWith, pathPorcelainStatus, readBlobs, readPathAtRev, readPathsAtRev, readRevisionPaths, resolveCommitAtRev, storesAsBlob } from './commit';
20
+ export type { BlobAtRev, BlobEntry, RevisionPath } from './commit';
21
+ export type { CommitOptions, PathChange } from './commit';
22
+ export { captureDryRun, isDryRunActive, planDiff } from './dry-run';
23
+ export type { DryRunOutcome, DryRunPlan } from './dry-run';
24
+ export { formatVersionTrailer, readBuildStamp, WINGFOIL_VERSION_TRAILER_KEY } from './build-stamp';
25
+ export { GIT_READ_MAX_BUFFER, requireCommitName, runGitRead, runGitReadBytes } from './git-read';
26
+ export type { GitReadOptions, GitReadResult } from './git-read';
21
27
  export { initStorage, scaffoldFiles, WINGFOIL_DIR, INIT_COMMIT_MESSAGE } from './layout';
22
28
  export type { ScaffoldFile } from './layout';
23
- export { TEMPLATES, TEMPLATE_NAMES, DEFAULT_TEMPLATE, resolveTemplate, templateScaffold, initProjectCommitMessage, builtinTemplateSources, BUILTIN_DIRECTIVES_DIR, BUILTIN_WORKFLOWS_DIR, } from './templates';
29
+ export { TEMPLATES, TEMPLATE_NAMES, DEFAULT_TEMPLATE, resolveTemplate, templateScaffold, initProjectCommitMessage, builtinTemplateSources, BUILTIN_DIRECTIVES_DIR, BUILTIN_WORKFLOWS_DIR, BUILTIN_ADAPTERS_DIR, CUSTOM_ADAPTERS_DIR, } from './templates';
24
30
  export type { TemplateDefinition, BuiltinTemplateKind, BuiltinTemplateSource } from './templates';
25
31
  export { BUILTIN_DIRECTIVE_TEMPLATES, BUILTIN_DIRECTIVE_IDS, builtinDirectiveMd } from './builtin-directives';
26
32
  export type { BuiltinDirectiveTemplate } from './builtin-directives';
33
+ export { BUILTIN_ADAPTERS } from './builtin-adapters';
34
+ export type { BuiltinAdapterManifest } from './builtin-adapters';
27
35
  export { computeStateSnapshot, serializeSnapshot } from './snapshot';
28
36
  export type { SnapshotEntry } from './snapshot';
29
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,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AAa,EAAE,MAAM,YAAY,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeSnapshot = exports.computeStateSnapshot = exports.builtinDirectiveMd = exports.BUILTIN_DIRECTIVE_IDS = exports.BUILTIN_DIRECTIVE_TEMPLATES = exports.BUILTIN_WORKFLOWS_DIR = exports.BUILTIN_DIRECTIVES_DIR = exports.builtinTemplateSources = exports.initProjectCommitMessage = exports.templateScaffold = exports.resolveTemplate = exports.DEFAULT_TEMPLATE = exports.TEMPLATE_NAMES = exports.TEMPLATES = exports.INIT_COMMIT_MESSAGE = exports.WINGFOIL_DIR = exports.scaffoldFiles = exports.initStorage = exports.readPathAtRev = exports.pathPorcelainStatus = exports.listPathsAtRev = exports.EMPTY_TREE_SHA = exports.commitPaths = exports.commitParent = exports.changedPathsBetween = exports.writeDocument = exports.removeDocument = exports.documentExists = exports.readDocument = exports.splitFrontmatter = exports.extractFrontmatter = exports.resolveRealPathInRoot = exports.escapesRoot = exports.resolveMemoryPath = exports.renderMemoryPath = exports.detectInitState = exports.resolveProjectRoot = exports.findGitRoot = exports.E_MISSING_PATH_VALUE = exports.E_NOT_AT_GIT_ROOT = exports.E_NO_GIT_ROOT = exports.StorageError = exports.MODULE_NAME = void 0;
3
+ exports.requireCommitName = exports.GIT_READ_MAX_BUFFER = exports.WINGFOIL_VERSION_TRAILER_KEY = exports.readBuildStamp = exports.formatVersionTrailer = exports.planDiff = exports.isDryRunActive = exports.captureDryRun = exports.storesAsBlob = exports.resolveCommitAtRev = exports.readRevisionPaths = exports.readPathsAtRev = exports.readPathAtRev = exports.readBlobs = exports.pathPorcelainStatus = exports.mergeBasesWith = exports.listPathsAtRevs = exports.listPathsAtRev = exports.listBlobsAtRevs = exports.listBlobEntriesAtRev = exports.EMPTY_TREE_SHA = exports.writeAndCommit = exports.stagedPaths = exports.committedBlobMatches = exports.commitPaths = exports.commitParent = exports.commitEmpty = exports.commitFailureSummary = exports.CommitFailure = exports.changedPathsBetween = exports.writeDocument = exports.removeDocument = exports.documentExists = exports.readDocument = exports.splitFrontmatter = exports.extractFrontmatter = exports.resolveRealPathInRoot = exports.escapesRoot = exports.renderMemoryPath = exports.detectInitState = exports.resolveProjectRoot = exports.findGitRoot = exports.E_MISSING_PATH_VALUE = exports.E_NOT_AT_GIT_ROOT = exports.E_NO_GIT_ROOT = exports.E_INVALID_REVISION = exports.E_GIT_READ_FAILED = exports.E_COMMIT_FAILED = exports.StorageError = exports.MODULE_NAME = void 0;
4
+ exports.serializeSnapshot = exports.computeStateSnapshot = exports.BUILTIN_ADAPTERS = exports.builtinDirectiveMd = exports.BUILTIN_DIRECTIVE_IDS = exports.BUILTIN_DIRECTIVE_TEMPLATES = exports.CUSTOM_ADAPTERS_DIR = exports.BUILTIN_ADAPTERS_DIR = exports.BUILTIN_WORKFLOWS_DIR = exports.BUILTIN_DIRECTIVES_DIR = exports.builtinTemplateSources = exports.initProjectCommitMessage = exports.templateScaffold = exports.resolveTemplate = exports.DEFAULT_TEMPLATE = exports.TEMPLATE_NAMES = exports.TEMPLATES = exports.INIT_COMMIT_MESSAGE = exports.WINGFOIL_DIR = exports.scaffoldFiles = exports.initStorage = exports.runGitReadBytes = exports.runGitRead = void 0;
4
5
  /**
5
6
  * `storage` module — git-backed file storage (YAML + Markdown); single source of truth
6
7
  * (REQ-SYS-01, task-003-git-backed-sot). Single entry point for: resolving the WingFoil project
@@ -11,6 +12,9 @@ exports.serializeSnapshot = exports.computeStateSnapshot = exports.builtinDirect
11
12
  exports.MODULE_NAME = 'storage';
12
13
  var errors_1 = require("./errors");
13
14
  Object.defineProperty(exports, "StorageError", { enumerable: true, get: function () { return errors_1.StorageError; } });
15
+ Object.defineProperty(exports, "E_COMMIT_FAILED", { enumerable: true, get: function () { return errors_1.E_COMMIT_FAILED; } });
16
+ Object.defineProperty(exports, "E_GIT_READ_FAILED", { enumerable: true, get: function () { return errors_1.E_GIT_READ_FAILED; } });
17
+ Object.defineProperty(exports, "E_INVALID_REVISION", { enumerable: true, get: function () { return errors_1.E_INVALID_REVISION; } });
14
18
  Object.defineProperty(exports, "E_NO_GIT_ROOT", { enumerable: true, get: function () { return errors_1.E_NO_GIT_ROOT; } });
15
19
  Object.defineProperty(exports, "E_NOT_AT_GIT_ROOT", { enumerable: true, get: function () { return errors_1.E_NOT_AT_GIT_ROOT; } });
16
20
  Object.defineProperty(exports, "E_MISSING_PATH_VALUE", { enumerable: true, get: function () { return errors_1.E_MISSING_PATH_VALUE; } });
@@ -19,9 +23,10 @@ Object.defineProperty(exports, "findGitRoot", { enumerable: true, get: function
19
23
  Object.defineProperty(exports, "resolveProjectRoot", { enumerable: true, get: function () { return git_root_1.resolveProjectRoot; } });
20
24
  var init_state_1 = require("./init-state");
21
25
  Object.defineProperty(exports, "detectInitState", { enumerable: true, get: function () { return init_state_1.detectInitState; } });
26
+ // `resolveMemoryPath` (the unconfined resolver) is deliberately NOT re-exported (task-131, `bug-122`);
27
+ // the guarded `resolveConfinedMemoryPath` is imported from `./memory-path` by its callers.
22
28
  var memory_path_1 = require("./memory-path");
23
29
  Object.defineProperty(exports, "renderMemoryPath", { enumerable: true, get: function () { return memory_path_1.renderMemoryPath; } });
24
- Object.defineProperty(exports, "resolveMemoryPath", { enumerable: true, get: function () { return memory_path_1.resolveMemoryPath; } });
25
30
  var confinement_1 = require("./confinement");
26
31
  Object.defineProperty(exports, "escapesRoot", { enumerable: true, get: function () { return confinement_1.escapesRoot; } });
27
32
  Object.defineProperty(exports, "resolveRealPathInRoot", { enumerable: true, get: function () { return confinement_1.resolveRealPathInRoot; } });
@@ -35,12 +40,40 @@ Object.defineProperty(exports, "removeDocument", { enumerable: true, get: functi
35
40
  Object.defineProperty(exports, "writeDocument", { enumerable: true, get: function () { return document_1.writeDocument; } });
36
41
  var commit_1 = require("./commit");
37
42
  Object.defineProperty(exports, "changedPathsBetween", { enumerable: true, get: function () { return commit_1.changedPathsBetween; } });
43
+ Object.defineProperty(exports, "CommitFailure", { enumerable: true, get: function () { return commit_1.CommitFailure; } });
44
+ Object.defineProperty(exports, "commitFailureSummary", { enumerable: true, get: function () { return commit_1.commitFailureSummary; } });
45
+ Object.defineProperty(exports, "commitEmpty", { enumerable: true, get: function () { return commit_1.commitEmpty; } });
38
46
  Object.defineProperty(exports, "commitParent", { enumerable: true, get: function () { return commit_1.commitParent; } });
39
47
  Object.defineProperty(exports, "commitPaths", { enumerable: true, get: function () { return commit_1.commitPaths; } });
48
+ Object.defineProperty(exports, "committedBlobMatches", { enumerable: true, get: function () { return commit_1.committedBlobMatches; } });
49
+ Object.defineProperty(exports, "stagedPaths", { enumerable: true, get: function () { return commit_1.stagedPaths; } });
50
+ Object.defineProperty(exports, "writeAndCommit", { enumerable: true, get: function () { return commit_1.writeAndCommit; } });
40
51
  Object.defineProperty(exports, "EMPTY_TREE_SHA", { enumerable: true, get: function () { return commit_1.EMPTY_TREE_SHA; } });
52
+ Object.defineProperty(exports, "listBlobEntriesAtRev", { enumerable: true, get: function () { return commit_1.listBlobEntriesAtRev; } });
53
+ Object.defineProperty(exports, "listBlobsAtRevs", { enumerable: true, get: function () { return commit_1.listBlobsAtRevs; } });
41
54
  Object.defineProperty(exports, "listPathsAtRev", { enumerable: true, get: function () { return commit_1.listPathsAtRev; } });
55
+ Object.defineProperty(exports, "listPathsAtRevs", { enumerable: true, get: function () { return commit_1.listPathsAtRevs; } });
56
+ Object.defineProperty(exports, "mergeBasesWith", { enumerable: true, get: function () { return commit_1.mergeBasesWith; } });
42
57
  Object.defineProperty(exports, "pathPorcelainStatus", { enumerable: true, get: function () { return commit_1.pathPorcelainStatus; } });
58
+ Object.defineProperty(exports, "readBlobs", { enumerable: true, get: function () { return commit_1.readBlobs; } });
43
59
  Object.defineProperty(exports, "readPathAtRev", { enumerable: true, get: function () { return commit_1.readPathAtRev; } });
60
+ Object.defineProperty(exports, "readPathsAtRev", { enumerable: true, get: function () { return commit_1.readPathsAtRev; } });
61
+ Object.defineProperty(exports, "readRevisionPaths", { enumerable: true, get: function () { return commit_1.readRevisionPaths; } });
62
+ Object.defineProperty(exports, "resolveCommitAtRev", { enumerable: true, get: function () { return commit_1.resolveCommitAtRev; } });
63
+ Object.defineProperty(exports, "storesAsBlob", { enumerable: true, get: function () { return commit_1.storesAsBlob; } });
64
+ var dry_run_1 = require("./dry-run");
65
+ Object.defineProperty(exports, "captureDryRun", { enumerable: true, get: function () { return dry_run_1.captureDryRun; } });
66
+ Object.defineProperty(exports, "isDryRunActive", { enumerable: true, get: function () { return dry_run_1.isDryRunActive; } });
67
+ Object.defineProperty(exports, "planDiff", { enumerable: true, get: function () { return dry_run_1.planDiff; } });
68
+ var build_stamp_1 = require("./build-stamp");
69
+ Object.defineProperty(exports, "formatVersionTrailer", { enumerable: true, get: function () { return build_stamp_1.formatVersionTrailer; } });
70
+ Object.defineProperty(exports, "readBuildStamp", { enumerable: true, get: function () { return build_stamp_1.readBuildStamp; } });
71
+ Object.defineProperty(exports, "WINGFOIL_VERSION_TRAILER_KEY", { enumerable: true, get: function () { return build_stamp_1.WINGFOIL_VERSION_TRAILER_KEY; } });
72
+ var git_read_1 = require("./git-read");
73
+ Object.defineProperty(exports, "GIT_READ_MAX_BUFFER", { enumerable: true, get: function () { return git_read_1.GIT_READ_MAX_BUFFER; } });
74
+ Object.defineProperty(exports, "requireCommitName", { enumerable: true, get: function () { return git_read_1.requireCommitName; } });
75
+ Object.defineProperty(exports, "runGitRead", { enumerable: true, get: function () { return git_read_1.runGitRead; } });
76
+ Object.defineProperty(exports, "runGitReadBytes", { enumerable: true, get: function () { return git_read_1.runGitReadBytes; } });
44
77
  var layout_1 = require("./layout");
45
78
  Object.defineProperty(exports, "initStorage", { enumerable: true, get: function () { return layout_1.initStorage; } });
46
79
  Object.defineProperty(exports, "scaffoldFiles", { enumerable: true, get: function () { return layout_1.scaffoldFiles; } });
@@ -56,10 +89,14 @@ Object.defineProperty(exports, "initProjectCommitMessage", { enumerable: true, g
56
89
  Object.defineProperty(exports, "builtinTemplateSources", { enumerable: true, get: function () { return templates_1.builtinTemplateSources; } });
57
90
  Object.defineProperty(exports, "BUILTIN_DIRECTIVES_DIR", { enumerable: true, get: function () { return templates_1.BUILTIN_DIRECTIVES_DIR; } });
58
91
  Object.defineProperty(exports, "BUILTIN_WORKFLOWS_DIR", { enumerable: true, get: function () { return templates_1.BUILTIN_WORKFLOWS_DIR; } });
92
+ Object.defineProperty(exports, "BUILTIN_ADAPTERS_DIR", { enumerable: true, get: function () { return templates_1.BUILTIN_ADAPTERS_DIR; } });
93
+ Object.defineProperty(exports, "CUSTOM_ADAPTERS_DIR", { enumerable: true, get: function () { return templates_1.CUSTOM_ADAPTERS_DIR; } });
59
94
  var builtin_directives_1 = require("./builtin-directives");
60
95
  Object.defineProperty(exports, "BUILTIN_DIRECTIVE_TEMPLATES", { enumerable: true, get: function () { return builtin_directives_1.BUILTIN_DIRECTIVE_TEMPLATES; } });
61
96
  Object.defineProperty(exports, "BUILTIN_DIRECTIVE_IDS", { enumerable: true, get: function () { return builtin_directives_1.BUILTIN_DIRECTIVE_IDS; } });
62
97
  Object.defineProperty(exports, "builtinDirectiveMd", { enumerable: true, get: function () { return builtin_directives_1.builtinDirectiveMd; } });
98
+ var builtin_adapters_1 = require("./builtin-adapters");
99
+ Object.defineProperty(exports, "BUILTIN_ADAPTERS", { enumerable: true, get: function () { return builtin_adapters_1.BUILTIN_ADAPTERS; } });
63
100
  var snapshot_1 = require("./snapshot");
64
101
  Object.defineProperty(exports, "computeStateSnapshot", { enumerable: true, get: function () { return snapshot_1.computeStateSnapshot; } });
65
102
  Object.defineProperty(exports, "serializeSnapshot", { enumerable: true, get: function () { return snapshot_1.serializeSnapshot; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACU,QAAA,WAAW,GAAG,SAAkB,CAAC;AAE9C,mCAAgG;AAAvF,sGAAA,YAAY,OAAA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always under `.wingfoil/`, POSIX-separated. */
8
8
  readonly path: string;
9
- /** Initial file content written verbatim (bytes-only — see {@link writeDocument}). */
9
+ /** Initial file content written verbatim (bytes-only, written by {@link writeAndCommit}). */
10
10
  readonly content: string;
11
11
  }
12
12
  /**
@@ -40,7 +40,7 @@ export interface ScaffoldFile {
40
40
  export declare function scaffoldFiles(): ScaffoldFile[];
41
41
  /**
42
42
  * Write every file in `files` (default: {@link scaffoldFiles}) under `root` and stage exactly those
43
- * paths as a **single** commit (via {@link commitPaths}), returning the new commit's sha.
43
+ * paths as a **single** commit (via {@link writeAndCommit}, which also puts the files back when git refuses that commit — task-210, `bug-217`), returning the new commit's sha.
44
44
  *
45
45
  * Pure mechanism: it assumes `root` is already a validated git root (the "not a git repository" guard
46
46
  * and the git-identity pre-flight live in the `CoreResult` wrapper, `src/core/init.ts`, so both the
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/storage/layout.ts"],"names":[],"mappings":"AAkBA,sGAAsG;AACtG,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,0DAA0D,CAAC;AAE3F,qGAAqG;AACrG,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAS9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,SAAS,YAAY,EAAoB,EAChD,OAAO,GAAE,MAA4B,GACpC,MAAM,CAKR"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/storage/layout.ts"],"names":[],"mappings":"AAeA,sGAAsG;AACtG,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,0DAA0D,CAAC;AAE3F,qGAAqG;AACrG,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAS9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,SAAS,YAAY,EAAoB,EAChD,OAAO,GAAE,MAA4B,GACpC,MAAM,CAER"}
@@ -16,9 +16,7 @@ exports.initStorage = initStorage;
16
16
  * task-029's wizard can pass its own richer, spec-011-complete file set (with real content) through
17
17
  * the exact same write+commit path.
18
18
  */
19
- const path_1 = require("path");
20
19
  const commit_1 = require("./commit");
21
- const document_1 = require("./document");
22
20
  /** The WingFoil root directory name, relative to the project (git) root (spec-011-storage-layout). */
23
21
  exports.WINGFOIL_DIR = '.wingfoil';
24
22
  /** Default git subject for the one commit `initStorage` produces (overridable via `initStorage`). */
@@ -72,7 +70,7 @@ function scaffoldFiles() {
72
70
  }
73
71
  /**
74
72
  * Write every file in `files` (default: {@link scaffoldFiles}) under `root` and stage exactly those
75
- * paths as a **single** commit (via {@link commitPaths}), returning the new commit's sha.
73
+ * paths as a **single** commit (via {@link writeAndCommit}, which also puts the files back when git refuses that commit — task-210, `bug-217`), returning the new commit's sha.
76
74
  *
77
75
  * Pure mechanism: it assumes `root` is already a validated git root (the "not a git repository" guard
78
76
  * and the git-identity pre-flight live in the `CoreResult` wrapper, `src/core/init.ts`, so both the
@@ -80,9 +78,6 @@ function scaffoldFiles() {
80
78
  * `git add -A`, so no unrelated working-tree change is swept into the init commit.
81
79
  */
82
80
  function initStorage(root, files = scaffoldFiles(), message = exports.INIT_COMMIT_MESSAGE) {
83
- for (const file of files) {
84
- (0, document_1.writeDocument)((0, path_1.join)(root, file.path), file.content);
85
- }
86
- return (0, commit_1.commitPaths)(root, files.map((file) => file.path), message);
81
+ return (0, commit_1.writeAndCommit)(root, files.map((file) => ({ path: file.path, content: file.content })), message);
87
82
  }
88
83
  //# sourceMappingURL=layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/storage/layout.ts"],"names":[],"mappings":";;;AAsEA,sCASC;AAWD,kCASC;AAnGD;;;;;;;;;;;;GAYG;AACH,+BAA4B;AAE5B,qCAAuC;AACvC,yCAA2C;AAE3C,sGAAsG;AACzF,QAAA,YAAY,GAAG,WAAW,CAAC;AAExC,qGAAqG;AACxF,QAAA,mBAAmB,GAAG,uDAAuD,CAAC;AAU3F,qGAAqG;AACrG,oGAAoG;AACpG,MAAM,QAAQ,GAAG,+EAA+E,CAAC;AACjG,MAAM,WAAW,GAAG,6EAA6E,CAAC;AAClG,MAAM,cAAc,GAAG,+EAA+E,CAAC;AACvG,qGAAqG;AACrG,oGAAoG;AACpG,4FAA4F;AAC5F,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,aAAa;IAC3B,OAAO;QACL,EAAE,IAAI,EAAE,GAAG,oBAAY,+BAA+B,EAAE,OAAO,EAAE,OAAO,EAAE;QAC1E,EAAE,IAAI,EAAE,GAAG,oBAAY,6BAA6B,EAAE,OAAO,EAAE,OAAO,EAAE;QACxE,EAAE,IAAI,EAAE,GAAG,oBAAY,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE;QACvD,EAAE,IAAI,EAAE,GAAG,oBAAY,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE;QAC7D,EAAE,IAAI,EAAE,GAAG,oBAAY,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE;QAC7D,EAAE,IAAI,EAAE,GAAG,oBAAY,iBAAiB,E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,OAAO,EAAE,QAAQ,EAAE;QACvD,EAAE,IAAI,EAAE,GAAG,oBAAY,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE;QAC7D,EAAE,IAAI,EAAE,GAAG,oBAAY,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE;QAC7D,EAAE,IAAI,EAAE,GAAG,oBAAY,iBAAiB,EAAE,OAAO,EAAE,cAAc,EAAE;KACpE,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,WAAW,CACzB,IAAY,EACZ,QAAiC,aAAa,EAAE,EAChD,UAAkB,2BAAmB;IAErC,OAAO,IAAA,uBAAc,EAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC1G,CAAC"}
@@ -6,6 +6,15 @@
6
6
  * the first).
7
7
  */
8
8
  export declare function renderMemoryPath(pattern: string, values: Record<string, string>): string;
9
+ /**
10
+ * The folder a type's `path` pattern confines its documents to — its **static prefix** (task-281, `bug-325`):
11
+ * the pattern up to and including the last `/` before its first `{`; the directory part of the pattern when
12
+ * it holds no `{`; `''` when the first `{` lies in the first segment (no folder narrower than the root).
13
+ *
14
+ * `docs/05_plans/{scope}/{id}.md` → `docs/05_plans/`; `docs/04_memory/planning/rl-{release-line}/{id}.md` →
15
+ * `docs/04_memory/planning/`; `{scope}/{id}.md` → `''`; `docs/fixed.md` → `docs/`.
16
+ */
17
+ export declare function pathPatternFolder(pattern: string): string;
9
18
  /** Render `pattern` (see {@link renderMemoryPath}) and resolve it to an absolute path under `root`. */
10
19
  export declare function resolveMemoryPath(root: string, pattern: string, values: Record<string, string>): string;
11
20
  /**
@@ -38,11 +47,11 @@ export declare function resolveMemoryPath(root: string, pattern: string, values:
38
47
  * yet created: `resolveRealPathInRoot` resolves as far as the filesystem goes and keeps the
39
48
  * missing tail verbatim, which is exactly this case — the document is about to be created.
40
49
  *
41
- * The second read resolves against the **working tree** rather than `HEAD`, deliberately and against
42
- * `command-baseline`'s general rule for a gating read. The argument is `task-102`'s, recorded in
43
- * `dl-086-a-guard-over-a-filesystem-effect-resolves-on-the-filesystem` (`in-discussion`) and not
44
- * re-derived here: what this predicts is where `writeFileSync` will land, and it follows the symlinks
45
- * that are on disk, not the ones a commit records.
50
+ * The second read resolves against the **working tree** rather than `HEAD`, deliberately: it is the
51
+ * filesystem-effect read `command-baseline` and `spec-006-core-domain-api` §6 declare, ratified in
52
+ * `dl-086-a-guard-over-a-filesystem-effect-resolves-on-the-filesystem` from `task-102`'s argument,
53
+ * which is not re-derived here: what this predicts is where `writeFileSync` will land, and it follows
54
+ * the symlinks that are on disk, not the ones a commit records.
46
55
  *
47
56
  * **The target's parent is resolved; its own name is not** — the asymmetry is
48
57
  * {@link resolveRealPathInRoot}'s contract (see that function), and it is the reason this returns a
@@ -64,6 +73,10 @@ export declare function resolveMemoryPath(root: string, pattern: string, values:
64
73
  * @throws {@link StorageError} `E_PATH_ESCAPES_ROOT` (message: {@link CONFINEMENT_MESSAGE} plus the
65
74
  * two spellings of the path, since the two differing is the finding) when the resolved path is the
66
75
  * root itself, escapes it textually, or lands outside it on the filesystem.
76
+ * @throws {@link StorageError} `E_PATH_OUTSIDE_TYPE_FOLDER` when the path, normalized, stays inside the root but
77
+ * not under {@link pathPatternFolder} of `pattern` — the type's folder (task-281, `bug-325`). Checked after
78
+ * the two root checks, so a root escape keeps `E_PATH_ESCAPES_ROOT`; the message names every token of the
79
+ * pattern with its value.
67
80
  * @throws {@link StorageError} `E_TARGET_IS_SYMLINK` (message: `symlinkTargetRefusal`, shared with
68
81
  * the transition verbs' `CoreResult` refusal) when the target itself is a symbolic link —
69
82
  * including a **dangling** one, which `existsSync` cannot see.
@@ -1 +1 @@
1
- {"version":3,"file":"memory-path.d.ts","sourceRoot":"","sources":["../../src/storage/memory-path.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAiBxF;AAED,uGAAuG;AACvG,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAsBR"}
1
+ {"version":3,"file":"memory-path.d.ts","sourceRoot":"","sources":["../../src/storage/memory-path.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAiBxF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIzD;AAaD,uGAAuG;AACvG,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAgCR"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderMemoryPath = renderMemoryPath;
4
+ exports.pathPatternFolder = pathPatternFolder;
4
5
  exports.resolveMemoryPath = resolveMemoryPath;
5
6
  exports.resolveConfinedMemoryPath = resolveConfinedMemoryPath;
6
7
  /**
@@ -43,6 +44,30 @@ function renderMemoryPath(pattern, values) {
43
44
  }
44
45
  return rendered;
45
46
  }
47
+ /**
48
+ * The folder a type's `path` pattern confines its documents to — its **static prefix** (task-281, `bug-325`):
49
+ * the pattern up to and including the last `/` before its first `{`; the directory part of the pattern when
50
+ * it holds no `{`; `''` when the first `{` lies in the first segment (no folder narrower than the root).
51
+ *
52
+ * `docs/05_plans/{scope}/{id}.md` → `docs/05_plans/`; `docs/04_memory/planning/rl-{release-line}/{id}.md` →
53
+ * `docs/04_memory/planning/`; `{scope}/{id}.md` → `''`; `docs/fixed.md` → `docs/`.
54
+ */
55
+ function pathPatternFolder(pattern) {
56
+ const brace = pattern.indexOf('{');
57
+ const end = brace === -1 ? pattern.length : brace;
58
+ return pattern.slice(0, pattern.lastIndexOf('/', end - 1) + 1);
59
+ }
60
+ /**
61
+ * Whether the normalized root-relative `path` lies strictly under `folder`. An empty folder confines nothing
62
+ * beyond the root: a path that climbs out of it or is absolute was already refused by the root checks, which
63
+ * run first.
64
+ */
65
+ function liesUnder(path, folder) {
66
+ if (folder === '')
67
+ return true;
68
+ const prefix = path_1.posix.normalize(folder);
69
+ return path.startsWith(prefix) && path.length > prefix.length;
70
+ }
46
71
  /** Render `pattern` (see {@link renderMemoryPath}) and resolve it to an absolute path under `root`. */
47
72
  function resolveMemoryPath(root, pattern, values) {
48
73
  return (0, path_1.join)(root, renderMemoryPath(pattern, values));
@@ -77,11 +102,11 @@ function resolveMemoryPath(root, pattern, values) {
77
102
  * yet created: `resolveRealPathInRoot` resolves as far as the filesystem goes and keeps the
78
103
  * missing tail verbatim, which is exactly this case — the document is about to be created.
79
104
  *
80
- * The second read resolves against the **working tree** rather than `HEAD`, deliberately and against
81
- * `command-baseline`'s general rule for a gating read. The argument is `task-102`'s, recorded in
82
- * `dl-086-a-guard-over-a-filesystem-effect-resolves-on-the-filesystem` (`in-discussion`) and not
83
- * re-derived here: what this predicts is where `writeFileSync` will land, and it follows the symlinks
84
- * that are on disk, not the ones a commit records.
105
+ * The second read resolves against the **working tree** rather than `HEAD`, deliberately: it is the
106
+ * filesystem-effect read `command-baseline` and `spec-006-core-domain-api` §6 declare, ratified in
107
+ * `dl-086-a-guard-over-a-filesystem-effect-resolves-on-the-filesystem` from `task-102`'s argument,
108
+ * which is not re-derived here: what this predicts is where `writeFileSync` will land, and it follows
109
+ * the symlinks that are on disk, not the ones a commit records.
85
110
  *
86
111
  * **The target's parent is resolved; its own name is not** — the asymmetry is
87
112
  * {@link resolveRealPathInRoot}'s contract (see that function), and it is the reason this returns a
@@ -103,6 +128,10 @@ function resolveMemoryPath(root, pattern, values) {
103
128
  * @throws {@link StorageError} `E_PATH_ESCAPES_ROOT` (message: {@link CONFINEMENT_MESSAGE} plus the
104
129
  * two spellings of the path, since the two differing is the finding) when the resolved path is the
105
130
  * root itself, escapes it textually, or lands outside it on the filesystem.
131
+ * @throws {@link StorageError} `E_PATH_OUTSIDE_TYPE_FOLDER` when the path, normalized, stays inside the root but
132
+ * not under {@link pathPatternFolder} of `pattern` — the type's folder (task-281, `bug-325`). Checked after
133
+ * the two root checks, so a root escape keeps `E_PATH_ESCAPES_ROOT`; the message names every token of the
134
+ * pattern with its value.
106
135
  * @throws {@link StorageError} `E_TARGET_IS_SYMLINK` (message: `symlinkTargetRefusal`, shared with
107
136
  * the transition verbs' `CoreResult` refusal) when the target itself is a symbolic link —
108
137
  * including a **dangling** one, which `existsSync` cannot see.
@@ -119,6 +148,13 @@ function resolveConfinedMemoryPath(root, pattern, values) {
119
148
  throw new errors_1.StorageError(errors_1.E_PATH_ESCAPES_ROOT, `${CONFINEMENT_MESSAGE}: '${rendered}' resolves to '${onDisk.real}', outside the project root — ` +
120
149
  'a directory on the way to it is a symlink leaving the project.');
121
150
  }
151
+ const normalized = path_1.posix.normalize(rendered);
152
+ const folder = pathPatternFolder(pattern);
153
+ if (!liesUnder(normalized, folder)) {
154
+ const tokens = [...new Set([...pattern.matchAll(PLACEHOLDER_RE)].map((match) => match[1]))];
155
+ const listed = tokens.map((token) => `{${token}}=${JSON.stringify(values[token])}`).join(', ');
156
+ throw new errors_1.StorageError(errors_1.E_PATH_OUTSIDE_TYPE_FOLDER, `Memory entries must reside in their type's folder: '${rendered}' resolves to '${normalized}', outside '${folder}' (path '${pattern}': ${listed})`);
157
+ }
122
158
  if ((0, confinement_1.targetIsSymlink)(target)) {
123
159
  throw new errors_1.StorageError(errors_1.E_TARGET_IS_SYMLINK, (0, confinement_1.symlinkTargetRefusal)('create', rendered));
124
160
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memory-path.js","sourceRoot":"","sources":["../../src/storage/memory-path.ts"],"names":[],"mappings":";;AA6BA,4CAiBC;AAGD,8CAMC;AA8DD,8DA0BC;AA/ID;;;;;;;;;;;GAWG;AACH,+BAAqC;AAErC,+CAA0G;AAC1G,qCAAwG;AAExG,kGAAkG;AAClG,MAAM,mBAAmB,GAAG,oDAAoD,CAAC;AAEjF,MAAM,cAAc,GAAG,eAAe,CAAC;AAEvC;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,OAAe,EAAE,MAA8B;IAC9E,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE;QACzE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD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QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -12,7 +12,7 @@ exports.serializeSnapshot = serializeSnapshot;
12
12
  * `computeStateSnapshot` is a pure function of what's on disk under `root`: every file under
13
13
  * `.wingfoil/` in full (DNA/Directives/Workflow config, per spec-011-storage-layout's directory
14
14
  * layout) plus every `docs/04_memory/**\/*.md` document's frontmatter only (Memory content — state
15
- * lives in frontmatter, CLAUDE.md §5 / REQ-STATE-01/-02, so the body text isn't part of "state").
15
+ * lives in frontmatter, AGENTS.md §5 / REQ-STATE-01/-02, so the body text isn't part of "state").
16
16
  * It holds no module-level cache and consults nothing outside `root`, so recomputing it — from the
17
17
  * original working copy, from a fresh clone, or from a freshly re-imported module — always yields
18
18
  * the same result for the same on-disk bytes.
@@ -1,3 +1,21 @@
1
+ /**
2
+ * Methodology templates for `wingfoil init` (task-029-implement-wingfoil-init, P5.1.1,
3
+ * spec-011-storage-layout). task-018 delivered only the minimal committed skeleton
4
+ * (`scaffoldFiles()` in ./layout) and EXPLICITLY deferred the complete spec-011 layout — `roles.yaml`,
5
+ * the `workflows/{built-in,custom}` split, `memory/templates/`, and real starter content — to this
6
+ * module. `templateScaffold(def)` returns that complete layout as a `ScaffoldFile[]` the same
7
+ * `initStorage(root, files, message)` write+commit path consumes. (The `directives/{built-in,custom}`
8
+ * split was deferred here too, until `task-054-project-directives` pulled it back into the minimal
9
+ * skeleton as well: P3.5 requires it after init, on whichever path ran.)
10
+ *
11
+ * A "template" (Scrum, Kanban — the names the P5.1.1 BDD uses as examples) is an AUTHORING starter:
12
+ * it selects the project's methodologies (written into `dna.yaml` `stacks.methodologies`) and a
13
+ * methodology-flavoured delivery sub-workflow; it is not a spec-mandated schema. All generated content
14
+ * is a pure function of the `TemplateDefinition` — no wall-clock, no randomness, no environment read —
15
+ * so `wingfoil init --template X` is byte-identical run to run (REQ-SYS-07), and the returned list is
16
+ * sorted by path so callers may diff the set safely.
17
+ */
18
+ import { type BuiltinAdapterManifest } from './builtin-adapters';
1
19
  import { type ScaffoldFile } from './layout';
2
20
  /** A methodology starter template: the methodologies it seeds and the delivery sub-workflow it adds. */
3
21
  export interface TemplateDefinition {
@@ -24,11 +42,12 @@ export declare function resolveTemplate(name: string): TemplateDefinition | null
24
42
  export declare function initProjectCommitMessage(def: TemplateDefinition): string;
25
43
  /**
26
44
  * Which pillar a {@link BuiltinTemplateSource} belongs to — `directive` for a P3.8 built-in directive
27
- * `.md` file, `workflow` for a P4.17 built-in workflow `.yaml` file. Drives which pillar schema
28
- * `core/builtin-integrity.ts`'s `verifyBuiltinTemplates` checks the source against, and which of
29
- * REQ-SEC-10's two exact abort-message shapes a failure produces.
45
+ * `.md` file, `workflow` for a P4.17 built-in workflow `.yaml` file, `adapter` for a built-in agent
46
+ * adapter manifest (`spec-016` §2.1, task-196). Drives which schema `core/builtin-integrity.ts`'s
47
+ * `verifyBuiltinTemplates` checks the source against, and which REQ-SEC-10 abort message a failure
48
+ * produces.
30
49
  */
31
- export type BuiltinTemplateKind = 'directive' | 'workflow';
50
+ export type BuiltinTemplateKind = 'directive' | 'workflow' | 'adapter';
32
51
  /**
33
52
  * One shipped built-in template asset, as raw content — a directive's full `.md` text (frontmatter +
34
53
  * body) or a workflow's full `.yaml` text, exactly as it would be written under `.wingfoil/directives/
@@ -46,6 +65,10 @@ export interface BuiltinTemplateSource {
46
65
  export declare const BUILTIN_DIRECTIVES_DIR = ".wingfoil/directives/built-in";
47
66
  /** Scaffold directory holding the P4.17 built-in workflow templates (spec-011 storage layout). */
48
67
  export declare const BUILTIN_WORKFLOWS_DIR = ".wingfoil/workflows/built-in";
68
+ /** Scaffold directory holding the built-in agent adapter manifests (`spec-016` §2.1, task-196). */
69
+ export declare const BUILTIN_ADAPTERS_DIR = ".wingfoil/agents/built-in";
70
+ /** Scaffold directory for the project's own adapter manifests, scaffolded empty (`spec-016` §2.1). */
71
+ export declare const CUSTOM_ADAPTERS_DIR = ".wingfoil/agents/custom";
49
72
  /**
50
73
  * Derive the built-in template assets to schema-check (REQ-SEC-10) from the very `ScaffoldFile[]`
51
74
  * that `initStorage` is about to write — so the CHECKED set and the INSTALLED set are the same set by
@@ -73,7 +96,8 @@ export declare const BUILTIN_WORKFLOWS_DIR = ".wingfoil/workflows/built-in";
73
96
  *
74
97
  * What it returns is a fact about the scaffold CONTENT, not a property of this function: for
75
98
  * {@link templateScaffold} it is the six P3.8 built-in directives `task-057-builtin-directive-templates`
76
- * ships (`./builtin-directives`, rendered by `builtinDirectiveMd`), for `scaffoldFiles` it is `[]` (a
99
+ * ships (`./builtin-directives`, rendered by `builtinDirectiveMd`) plus one `adapter` source per shipped
100
+ * built-in adapter manifest (`./builtin-adapters`: `claude-code` since task-236), for `scaffoldFiles` it is `[]` (a
77
101
  * `.gitkeep` only), and the workflows built-in directory still holds a `.gitkeep` only. Any asset added
78
102
  * later is checked with no edit here. Each shipped built-in must satisfy its pillar schema on its own —
79
103
  * `test/storage/builtin-directives.test.ts` runs every directive template through the real guard.
@@ -83,6 +107,9 @@ export declare function builtinTemplateSources(files: readonly ScaffoldFile[]):
83
107
  * The COMPLETE spec-011 `.wingfoil/` layout for `def`, as a `ScaffoldFile[]` sorted by path
84
108
  * (deterministic — REQ-SYS-07). Consumed by `initStorage(root, files, message)`; every path is under
85
109
  * `.wingfoil/` so init never writes outside the WingFoil root.
110
+ *
111
+ * @param adapters - the built-in adapter manifests to install; {@link BUILTIN_ADAPTERS} (the shipped
112
+ * list) unless a test passes a fixture list, since no real built-in ships yet (task-196).
86
113
  */
87
- export declare function templateScaffold(def: TemplateDefinition): ScaffoldFile[];
114
+ export declare function templateScaffold(def: TemplateDefinition, adapters?: readonly BuiltinAdapterManifest[]): ScaffoldFile[];
88
115
  //# sourceMappingURL=templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/storage/templates.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA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