wingfoil 0.2.2 → 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 (454) hide show
  1. package/README.md +83 -43
  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 +1 -1
  48. package/dist/cli/index.d.ts.map +1 -1
  49. package/dist/cli/index.js +2 -1
  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 +4 -2
  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 +162 -40
  65. package/dist/cli/program.js.map +1 -1
  66. package/dist/cli/registrar.d.ts +1 -1
  67. package/dist/cli/registrar.d.ts.map +1 -1
  68. package/dist/cli/registrar.js +67 -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.d.ts.map +1 -1
  137. package/dist/core/exit-code.js +6 -7
  138. package/dist/core/exit-code.js.map +1 -1
  139. package/dist/core/git-identity.d.ts +46 -11
  140. package/dist/core/git-identity.d.ts.map +1 -1
  141. package/dist/core/git-identity.js +140 -27
  142. package/dist/core/git-identity.js.map +1 -1
  143. package/dist/core/index.d.ts +184 -10
  144. package/dist/core/index.d.ts.map +1 -1
  145. package/dist/core/index.js +1045 -185
  146. package/dist/core/index.js.map +1 -1
  147. package/dist/core/init.d.ts +45 -5
  148. package/dist/core/init.d.ts.map +1 -1
  149. package/dist/core/init.js +134 -24
  150. package/dist/core/init.js.map +1 -1
  151. package/dist/core/loaders.d.ts +170 -14
  152. package/dist/core/loaders.d.ts.map +1 -1
  153. package/dist/core/loaders.js +570 -89
  154. package/dist/core/loaders.js.map +1 -1
  155. package/dist/core/memory-add-link.d.ts +28 -0
  156. package/dist/core/memory-add-link.d.ts.map +1 -0
  157. package/dist/core/memory-add-link.js +67 -0
  158. package/dist/core/memory-add-link.js.map +1 -0
  159. package/dist/core/memory-add-type.d.ts +25 -1
  160. package/dist/core/memory-add-type.d.ts.map +1 -1
  161. package/dist/core/memory-add-type.js +59 -1
  162. package/dist/core/memory-add-type.js.map +1 -1
  163. package/dist/core/memory-amend.d.ts +80 -0
  164. package/dist/core/memory-amend.d.ts.map +1 -0
  165. package/dist/core/memory-amend.js +160 -0
  166. package/dist/core/memory-amend.js.map +1 -0
  167. package/dist/core/memory-supersede.d.ts +28 -0
  168. package/dist/core/memory-supersede.d.ts.map +1 -0
  169. package/dist/core/memory-supersede.js +79 -0
  170. package/dist/core/memory-supersede.js.map +1 -0
  171. package/dist/core/memory-transition.d.ts +190 -30
  172. package/dist/core/memory-transition.d.ts.map +1 -1
  173. package/dist/core/memory-transition.js +480 -59
  174. package/dist/core/memory-transition.js.map +1 -1
  175. package/dist/core/registry.d.ts +82 -10
  176. package/dist/core/registry.d.ts.map +1 -1
  177. package/dist/core/registry.js +50 -0
  178. package/dist/core/registry.js.map +1 -1
  179. package/dist/core/relevance.d.ts +74 -12
  180. package/dist/core/relevance.d.ts.map +1 -1
  181. package/dist/core/relevance.js +45 -27
  182. package/dist/core/relevance.js.map +1 -1
  183. package/dist/core/require-reason.d.ts.map +1 -1
  184. package/dist/core/require-reason.js +6 -5
  185. package/dist/core/require-reason.js.map +1 -1
  186. package/dist/core/required-fields.d.ts +28 -0
  187. package/dist/core/required-fields.d.ts.map +1 -0
  188. package/dist/core/required-fields.js +60 -0
  189. package/dist/core/required-fields.js.map +1 -0
  190. package/dist/core/revision.d.ts +82 -0
  191. package/dist/core/revision.d.ts.map +1 -0
  192. package/dist/core/revision.js +144 -0
  193. package/dist/core/revision.js.map +1 -0
  194. package/dist/core/types.d.ts +28 -2
  195. package/dist/core/types.d.ts.map +1 -1
  196. package/dist/core/types.js +12 -3
  197. package/dist/core/types.js.map +1 -1
  198. package/dist/core/workflow-core-checks.d.ts +34 -0
  199. package/dist/core/workflow-core-checks.d.ts.map +1 -0
  200. package/dist/core/workflow-core-checks.js +403 -0
  201. package/dist/core/workflow-core-checks.js.map +1 -0
  202. package/dist/core/workflow-create-remove.d.ts +65 -0
  203. package/dist/core/workflow-create-remove.d.ts.map +1 -0
  204. package/dist/core/workflow-create-remove.js +277 -0
  205. package/dist/core/workflow-create-remove.js.map +1 -0
  206. package/dist/core/workflow-deduction.d.ts +48 -0
  207. package/dist/core/workflow-deduction.d.ts.map +1 -0
  208. package/dist/core/workflow-deduction.js +523 -0
  209. package/dist/core/workflow-deduction.js.map +1 -0
  210. package/dist/core/workflow-diagnostics.d.ts +83 -0
  211. package/dist/core/workflow-diagnostics.d.ts.map +1 -0
  212. package/dist/core/workflow-diagnostics.js +375 -0
  213. package/dist/core/workflow-diagnostics.js.map +1 -0
  214. package/dist/core/workflow-exit-state.d.ts +125 -0
  215. package/dist/core/workflow-exit-state.d.ts.map +1 -0
  216. package/dist/core/workflow-exit-state.js +243 -0
  217. package/dist/core/workflow-exit-state.js.map +1 -0
  218. package/dist/core/workflow-finalize.d.ts +37 -0
  219. package/dist/core/workflow-finalize.d.ts.map +1 -0
  220. package/dist/core/workflow-finalize.js +153 -0
  221. package/dist/core/workflow-finalize.js.map +1 -0
  222. package/dist/core/workflow-list-show.d.ts +176 -0
  223. package/dist/core/workflow-list-show.d.ts.map +1 -0
  224. package/dist/core/workflow-list-show.js +268 -0
  225. package/dist/core/workflow-list-show.js.map +1 -0
  226. package/dist/core/workflow-next.d.ts +268 -0
  227. package/dist/core/workflow-next.d.ts.map +1 -0
  228. package/dist/core/workflow-next.js +503 -0
  229. package/dist/core/workflow-next.js.map +1 -0
  230. package/dist/core/workflow-registry.d.ts +52 -0
  231. package/dist/core/workflow-registry.d.ts.map +1 -0
  232. package/dist/core/workflow-registry.js +158 -0
  233. package/dist/core/workflow-registry.js.map +1 -0
  234. package/dist/core/workflow-start-end.d.ts +71 -0
  235. package/dist/core/workflow-start-end.d.ts.map +1 -0
  236. package/dist/core/workflow-start-end.js +298 -0
  237. package/dist/core/workflow-start-end.js.map +1 -0
  238. package/dist/core/workflow-status.d.ts +83 -0
  239. package/dist/core/workflow-status.d.ts.map +1 -0
  240. package/dist/core/workflow-status.js +125 -0
  241. package/dist/core/workflow-status.js.map +1 -0
  242. package/dist/core/write-guard.d.ts +51 -8
  243. package/dist/core/write-guard.d.ts.map +1 -1
  244. package/dist/core/write-guard.js +139 -9
  245. package/dist/core/write-guard.js.map +1 -1
  246. package/dist/directives/index.d.ts +3 -2
  247. package/dist/directives/index.d.ts.map +1 -1
  248. package/dist/directives/index.js +5 -3
  249. package/dist/directives/index.js.map +1 -1
  250. package/dist/directives/schema.d.ts +34 -29
  251. package/dist/directives/schema.d.ts.map +1 -1
  252. package/dist/directives/schema.js +35 -29
  253. package/dist/directives/schema.js.map +1 -1
  254. package/dist/directives/version.d.ts +28 -0
  255. package/dist/directives/version.d.ts.map +1 -0
  256. package/dist/directives/version.js +51 -0
  257. package/dist/directives/version.js.map +1 -0
  258. package/dist/dna/edit.d.ts +7 -6
  259. package/dist/dna/edit.d.ts.map +1 -1
  260. package/dist/dna/edit.js +96 -41
  261. package/dist/dna/edit.js.map +1 -1
  262. package/dist/dna/mutate.js +18 -3
  263. package/dist/dna/mutate.js.map +1 -1
  264. package/dist/dna/path.d.ts +2 -2
  265. package/dist/dna/roles.d.ts +1 -1
  266. package/dist/dna/schema.d.ts +61 -3
  267. package/dist/dna/schema.d.ts.map +1 -1
  268. package/dist/dna/schema.js +121 -6
  269. package/dist/dna/schema.js.map +1 -1
  270. package/dist/mcp/dna-resource.d.ts.map +1 -1
  271. package/dist/mcp/dna-resource.js +4 -4
  272. package/dist/mcp/dna-resource.js.map +1 -1
  273. package/dist/mcp/index.d.ts +8 -4
  274. package/dist/mcp/index.d.ts.map +1 -1
  275. package/dist/mcp/index.js +13 -2
  276. package/dist/mcp/index.js.map +1 -1
  277. package/dist/mcp/memory-resource.d.ts.map +1 -1
  278. package/dist/mcp/memory-resource.js +30 -19
  279. package/dist/mcp/memory-resource.js.map +1 -1
  280. package/dist/mcp/prompt.d.ts +61 -24
  281. package/dist/mcp/prompt.d.ts.map +1 -1
  282. package/dist/mcp/prompt.js +176 -47
  283. package/dist/mcp/prompt.js.map +1 -1
  284. package/dist/mcp/read-only.d.ts +39 -0
  285. package/dist/mcp/read-only.d.ts.map +1 -1
  286. package/dist/mcp/read-only.js +61 -0
  287. package/dist/mcp/read-only.js.map +1 -1
  288. package/dist/mcp/registrar.d.ts +10 -0
  289. package/dist/mcp/registrar.d.ts.map +1 -1
  290. package/dist/mcp/registrar.js +48 -12
  291. package/dist/mcp/registrar.js.map +1 -1
  292. package/dist/mcp/server.d.ts +21 -14
  293. package/dist/mcp/server.d.ts.map +1 -1
  294. package/dist/mcp/server.js +41 -15
  295. package/dist/mcp/server.js.map +1 -1
  296. package/dist/mcp/session-resource.d.ts +13 -0
  297. package/dist/mcp/session-resource.d.ts.map +1 -0
  298. package/dist/mcp/session-resource.js +65 -0
  299. package/dist/mcp/session-resource.js.map +1 -0
  300. package/dist/mcp/workflow-resource.d.ts +18 -0
  301. package/dist/mcp/workflow-resource.d.ts.map +1 -1
  302. package/dist/mcp/workflow-resource.js +37 -8
  303. package/dist/mcp/workflow-resource.js.map +1 -1
  304. package/dist/memory/add.d.ts +110 -24
  305. package/dist/memory/add.d.ts.map +1 -1
  306. package/dist/memory/add.js +251 -64
  307. package/dist/memory/add.js.map +1 -1
  308. package/dist/memory/audit.d.ts +152 -39
  309. package/dist/memory/audit.d.ts.map +1 -1
  310. package/dist/memory/audit.js +257 -103
  311. package/dist/memory/audit.js.map +1 -1
  312. package/dist/memory/commit-message.d.ts +60 -38
  313. package/dist/memory/commit-message.d.ts.map +1 -1
  314. package/dist/memory/commit-message.js +167 -21
  315. package/dist/memory/commit-message.js.map +1 -1
  316. package/dist/memory/entry.d.ts.map +1 -1
  317. package/dist/memory/entry.js +1 -2
  318. package/dist/memory/entry.js.map +1 -1
  319. package/dist/memory/frontmatter-edit.d.ts +16 -4
  320. package/dist/memory/frontmatter-edit.d.ts.map +1 -1
  321. package/dist/memory/frontmatter-edit.js +13 -1
  322. package/dist/memory/frontmatter-edit.js.map +1 -1
  323. package/dist/memory/git-log.d.ts +18 -6
  324. package/dist/memory/git-log.d.ts.map +1 -1
  325. package/dist/memory/git-log.js +40 -13
  326. package/dist/memory/git-log.js.map +1 -1
  327. package/dist/memory/history.d.ts +73 -12
  328. package/dist/memory/history.d.ts.map +1 -1
  329. package/dist/memory/history.js +128 -44
  330. package/dist/memory/history.js.map +1 -1
  331. package/dist/memory/index.d.ts +13 -11
  332. package/dist/memory/index.d.ts.map +1 -1
  333. package/dist/memory/index.js +34 -3
  334. package/dist/memory/index.js.map +1 -1
  335. package/dist/memory/query.d.ts +161 -19
  336. package/dist/memory/query.d.ts.map +1 -1
  337. package/dist/memory/query.js +435 -55
  338. package/dist/memory/query.js.map +1 -1
  339. package/dist/memory/schema.d.ts +52 -3
  340. package/dist/memory/schema.d.ts.map +1 -1
  341. package/dist/memory/schema.js +132 -8
  342. package/dist/memory/schema.js.map +1 -1
  343. package/dist/memory/state-machine.d.ts +65 -10
  344. package/dist/memory/state-machine.d.ts.map +1 -1
  345. package/dist/memory/state-machine.js +134 -46
  346. package/dist/memory/state-machine.js.map +1 -1
  347. package/dist/memory/submit.d.ts +52 -3
  348. package/dist/memory/submit.d.ts.map +1 -1
  349. package/dist/memory/submit.js +118 -11
  350. package/dist/memory/submit.js.map +1 -1
  351. package/dist/storage/build-stamp.d.ts +18 -0
  352. package/dist/storage/build-stamp.d.ts.map +1 -0
  353. package/dist/storage/build-stamp.js +68 -0
  354. package/dist/storage/build-stamp.js.map +1 -0
  355. package/dist/storage/builtin-adapters.d.ts +32 -0
  356. package/dist/storage/builtin-adapters.d.ts.map +1 -0
  357. package/dist/storage/builtin-adapters.js +100 -0
  358. package/dist/storage/builtin-adapters.js.map +1 -0
  359. package/dist/storage/builtin-directives.d.ts +0 -29
  360. package/dist/storage/builtin-directives.d.ts.map +1 -1
  361. package/dist/storage/builtin-directives.js +9 -4
  362. package/dist/storage/builtin-directives.js.map +1 -1
  363. package/dist/storage/commit.d.ts +310 -3
  364. package/dist/storage/commit.d.ts.map +1 -1
  365. package/dist/storage/commit.js +807 -33
  366. package/dist/storage/commit.js.map +1 -1
  367. package/dist/storage/document.d.ts +6 -0
  368. package/dist/storage/document.d.ts.map +1 -1
  369. package/dist/storage/document.js +10 -1
  370. package/dist/storage/document.js.map +1 -1
  371. package/dist/storage/dry-run.d.ts +65 -0
  372. package/dist/storage/dry-run.d.ts.map +1 -0
  373. package/dist/storage/dry-run.js +150 -0
  374. package/dist/storage/dry-run.js.map +1 -0
  375. package/dist/storage/errors.d.ts +26 -0
  376. package/dist/storage/errors.d.ts.map +1 -1
  377. package/dist/storage/errors.js +27 -1
  378. package/dist/storage/errors.js.map +1 -1
  379. package/dist/storage/frontmatter.d.ts +1 -1
  380. package/dist/storage/frontmatter.js +1 -1
  381. package/dist/storage/git-read.d.ts +64 -0
  382. package/dist/storage/git-read.d.ts.map +1 -0
  383. package/dist/storage/git-read.js +107 -0
  384. package/dist/storage/git-read.js.map +1 -0
  385. package/dist/storage/index.d.ts +13 -5
  386. package/dist/storage/index.d.ts.map +1 -1
  387. package/dist/storage/index.js +39 -2
  388. package/dist/storage/index.js.map +1 -1
  389. package/dist/storage/layout.d.ts +2 -2
  390. package/dist/storage/layout.d.ts.map +1 -1
  391. package/dist/storage/layout.js +2 -7
  392. package/dist/storage/layout.js.map +1 -1
  393. package/dist/storage/memory-path.d.ts +18 -5
  394. package/dist/storage/memory-path.d.ts.map +1 -1
  395. package/dist/storage/memory-path.js +41 -5
  396. package/dist/storage/memory-path.js.map +1 -1
  397. package/dist/storage/snapshot.js +1 -1
  398. package/dist/storage/templates.d.ts +33 -6
  399. package/dist/storage/templates.d.ts.map +1 -1
  400. package/dist/storage/templates.js +170 -16
  401. package/dist/storage/templates.js.map +1 -1
  402. package/dist/validation/config-version.d.ts +19 -0
  403. package/dist/validation/config-version.d.ts.map +1 -0
  404. package/dist/validation/config-version.js +53 -0
  405. package/dist/validation/config-version.js.map +1 -0
  406. package/dist/validation/diagnostic.d.ts +40 -0
  407. package/dist/validation/diagnostic.d.ts.map +1 -0
  408. package/dist/validation/diagnostic.js +41 -0
  409. package/dist/validation/diagnostic.js.map +1 -0
  410. package/dist/validation/format.d.ts +74 -0
  411. package/dist/validation/format.d.ts.map +1 -0
  412. package/dist/validation/format.js +104 -0
  413. package/dist/validation/format.js.map +1 -0
  414. package/dist/validation/id.d.ts +14 -0
  415. package/dist/validation/id.d.ts.map +1 -1
  416. package/dist/validation/id.js +35 -11
  417. package/dist/validation/id.js.map +1 -1
  418. package/dist/validation/identity.d.ts +40 -0
  419. package/dist/validation/identity.d.ts.map +1 -0
  420. package/dist/validation/identity.js +78 -0
  421. package/dist/validation/identity.js.map +1 -0
  422. package/dist/validation/index.d.ts +9 -3
  423. package/dist/validation/index.d.ts.map +1 -1
  424. package/dist/validation/index.js +30 -1
  425. package/dist/validation/index.js.map +1 -1
  426. package/dist/validation/secret-scan.d.ts +3 -2
  427. package/dist/validation/secret-scan.d.ts.map +1 -1
  428. package/dist/validation/secret-scan.js +32 -11
  429. package/dist/validation/secret-scan.js.map +1 -1
  430. package/dist/validation/warning.d.ts +30 -16
  431. package/dist/validation/warning.d.ts.map +1 -1
  432. package/dist/validation/warning.js +74 -7
  433. package/dist/validation/warning.js.map +1 -1
  434. package/dist/workflow/bindings.d.ts +152 -0
  435. package/dist/workflow/bindings.d.ts.map +1 -0
  436. package/dist/workflow/bindings.js +249 -0
  437. package/dist/workflow/bindings.js.map +1 -0
  438. package/dist/workflow/create.d.ts +13 -0
  439. package/dist/workflow/create.d.ts.map +1 -0
  440. package/dist/workflow/create.js +41 -0
  441. package/dist/workflow/create.js.map +1 -0
  442. package/dist/workflow/deduce.d.ts +400 -0
  443. package/dist/workflow/deduce.d.ts.map +1 -0
  444. package/dist/workflow/deduce.js +1109 -0
  445. package/dist/workflow/deduce.js.map +1 -0
  446. package/dist/workflow/manifest-edit.d.ts +19 -0
  447. package/dist/workflow/manifest-edit.d.ts.map +1 -0
  448. package/dist/workflow/manifest-edit.js +124 -0
  449. package/dist/workflow/manifest-edit.js.map +1 -0
  450. package/dist/workflow/schema.d.ts +158 -19
  451. package/dist/workflow/schema.d.ts.map +1 -1
  452. package/dist/workflow/schema.js +163 -15
  453. package/dist/workflow/schema.js.map +1 -1
  454. package/package.json +18 -8
package/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  <p align="center"><img src="docs/assets/wingfoil-mark.svg" width="140" alt="WingFoil logo"></p>
2
2
 
3
+ <p align="center"><a href="https://glama.ai/mcp/servers/wingfoil/wingfoil"><img src="https://glama.ai/mcp/servers/wingfoil/wingfoil/badges/score.svg" alt="WingFoil MCP server on Glama"></a></p>
4
+
3
5
  # WingFoil
4
6
 
5
- **A structured harness for deterministic AI-assisted software development.**
7
+ [![npm version](https://img.shields.io/npm/v/wingfoil)](https://www.npmjs.com/package/wingfoil)
8
+ [![licence](https://img.shields.io/npm/l/wingfoil)](https://github.com/wingfoil/wingfoil/blob/main/LICENSE)
9
+ [![node](https://img.shields.io/node/v/wingfoil)](https://www.npmjs.com/package/wingfoil)
10
+ [![publish](https://github.com/wingfoil/wingfoil/actions/workflows/publish.yml/badge.svg)](https://github.com/wingfoil/wingfoil/actions/workflows/publish.yml)
11
+
12
+ **A structured harness for AI-assisted software development, built to make it deterministic.**
6
13
 
7
14
  WingFoil solves a critical problem: as your software project grows, AI agents lose consistency and control. Context gets
8
15
  scattered, conventions drift, and decisions made in one session don't carry forward to the next.
@@ -10,6 +17,13 @@ scattered, conventions drift, and decisions made in one session don't carry forw
10
17
  WingFoil centralizes your project's **memory, DNA, and directives** in a structured, git-backed format — giving both
11
18
  humans and AI agents a shared source of truth.
12
19
 
20
+ ![WingFoil in a terminal: init, configure an approver, add a task, submit and approve it, then show its git log](docs/assets/wingfoil-demo-first-project.gif)
21
+
22
+ *The first example, [`docs/examples/01-first-project`](docs/examples/01-first-project/run.sh), recorded from
23
+ [`docs/examples/01-first-project/demo.tape`](docs/examples/01-first-project/demo.tape). The example checks its own
24
+ results, and the recording stops if a check fails, so if WingFoil stops matching the example the recording fails
25
+ instead of going stale.*
26
+
13
27
  ---
14
28
 
15
29
  ## The Problem
@@ -35,7 +49,8 @@ WingFoil provides a **structured, authoritative interface** to your project:
35
49
  - **Workflow State Management** — Unified tracking and communication of project flow, progress, and blockers
36
50
  - **Interaction Layer** — CLI for humans, MCP for agents
37
51
 
38
- This keeps everything synchronized and deterministic.
52
+ This keeps everything synchronized, so that two runs from the same specs and configuration can produce
53
+ equivalent software: the goal the *Determinism Index* measures (see *Success Metric* below).
39
54
 
40
55
  ---
41
56
 
@@ -65,19 +80,21 @@ real-time tracking of project state.
65
80
 
66
81
  ## Key Features
67
82
 
68
- ### Five Pillars — status in 0.2.2
83
+ ### Five Pillars — status in 0.3
69
84
 
70
85
  - ✓ **Project Memory** — Git-backed documents (tasks, ADRs, decision-logs, bugs, specs…) with per-type
71
86
  state machines, approval gates and an audit trail (**shipped**: create, search, submit, approve,
72
- reject, deprecate, history)
87
+ reject, deprecate, history; **new in 0.3**: amend, park, work-in-progress limits)
73
88
  - ✓ **Project DNA** — Structured config: modules, tech stack, team & roles, resource paths
74
89
  (**shipped**: show, set, add, update, remove)
75
90
  - ✓ **Project Directives** — Role-scoped rules: six built-in templates installed by `init`, your own
76
91
  custom directives, role assignments (**shipped in 0.2**)
77
92
  - ✓ **Interaction Layer** — CLI for humans and agents; MCP server for agents with read-only Resources
78
- and one Prompt per role (**shipped**)
79
- - **Workflow State Management** — workflows are declared and listable today; the engine that starts
80
- and tracks them is planned for 0.3
93
+ and one Prompt per role (**shipped**); `agent execute` launches Claude Code or Codex CLI on a Memory
94
+ element with its context assembled and checked first, and records the run (**new in 0.3**)
95
+ - ✓ **Workflow State Management** — start, follow and end workflows: the next step and its role,
96
+ the open workflows, approvals routed to the approver, checkpoints (**new in 0.3**). WingFoil records
97
+ and routes the steps; people and agents carry them out
81
98
 
82
99
  ### CLI at a glance
83
100
 
@@ -85,17 +102,21 @@ real-time tracking of project state.
85
102
  |---|---|
86
103
  | Setup | `wingfoil init [--template Scrum\|Kanban]` · `wingfoil mcp` |
87
104
  | DNA | `wingfoil dna show [section]` · `dna set <path> --value <v>` · `dna add` · `dna update` · `dna remove` · `wingfoil paths [category]` |
88
- | Memory | `wingfoil memory add --type <t> --title <t> [--set <name>=<value>]` · `submit <id>` · `approve <id> --reason <r>` · `reject <id> --reason <r>` · `deprecate <id>` · `history <id>` · `search [keyword]` |
105
+ | Memory | `wingfoil memory add --type <t> --title <t> [--set <name>=<value>]` · `submit <id>` · `approve <id> --reason <r>` · `reject <id> --reason <r>` · `amend <id> --reason <r>` · `park <id> --reason <r>` · `deprecate <id>` · `history <id>` · `search [keyword]` |
89
106
  | Directives | `wingfoil directive create --name <n>` · `directive assign --directive <n> --role <r>` · `directive remove <n>` · `wingfoil directives list [--role <r>]` |
90
- | Workflow | `wingfoil workflow list` |
107
+ | Workflow | `wingfoil workflow list` · `show <name>` · `start <name>` · `next` · `status` · `finalize` · `end` · `create <name>` · `remove <name>` |
108
+ | Agent | `wingfoil agent execute --element <type:id> \| --next` · `agent list` · `agent show <run-id>` |
91
109
 
92
110
  Every command accepts `--format console|json|yaml` and ends with exit code `0` (success), `1` (refused)
93
- or `2` (bad command line). Full details: **[CLI reference](docs/cli-reference.md)**.
111
+ or `2` (bad command line); every command that commits accepts `--dry-run`, except `init`. Full details: **[CLI reference](docs/cli-reference.md)**.
94
112
 
95
113
  ### For AI Agents
96
114
 
97
- - ✓ **MCP server** (`wingfoil mcp`, stdio) — DNA, Memory and workflows as read-only Resources, plus a
98
- `<role>-session` Prompt per role that embeds the role's directives
115
+ - ✓ **MCP server** (`wingfoil mcp`, stdio) — DNA, Memory and workflows as read-only Resources, the
116
+ workflow state as `wingfoil://workflows/-/next` and `wingfoil://workflows/-/status`, plus a
117
+ `<role>-session` Prompt per role that embeds the role's directives; given an `element` and a `state`
118
+ (a commit), the Prompt — and the Resource `wingfoil://session/{role}/{element}/{state}` — return the
119
+ agent's execution context for that element
99
120
  - ✓ **Read-only by construction** — the MCP surface has no Tools; changes go through the CLI, and
100
121
  approvals belong to a human holding the `approver` role
101
122
  - ✓ **[`docs/agents.md`](docs/agents.md)** — the same knowledge as a document an agent can read from a
@@ -129,6 +150,8 @@ workflows) and commits it:
129
150
  $ wingfoil init --template Scrum
130
151
  ```
131
152
 
153
+ It also installs the built-in agent adapters (`claude-code`, `codex-cli`) under `.wingfoil/agents/`.
154
+
132
155
  **2. Name the project and register yourself as the approver** — approvals need a team member holding
133
156
  the `approver` role, with your git email:
134
157
 
@@ -179,6 +202,8 @@ wf(task): approve task-001-my-first-task [pending → approved]
179
202
 
180
203
  Approver: Ada Lovelace <ada@example.com> (approver)
181
204
  Reason: Scope is clear.
205
+
206
+ WingFoil-Version: 0.3.0 (6ca54978a01dc29c81e395d363efcdeac8a513fd)
182
207
  ```
183
208
 
184
209
  **5. Connect your AI agent** — for Claude Code, add `.mcp.json` at the repository root:
@@ -195,6 +220,8 @@ Reason: Scope is clear.
195
220
  | **[CLI reference](docs/cli-reference.md)** | Every command: arguments, output, exit codes, the commit it writes |
196
221
  | **[Examples](docs/examples/)** | Runnable, self-checking scripts for the main scenarios |
197
222
  | **[Guide for AI agents](docs/agents.md)** | What an agent needs to operate in a WingFoil project |
223
+ | **[Comparison](docs/comparison.md)** | WingFoil beside agent-rule files, spec-driven development tools, coding agents and IDEs |
224
+ | **[Case study](docs/case-study.md)** | How WingFoil develops WingFoil, with the release-health figures of v0.1 and v0.2 |
198
225
  | **[Changelog](CHANGELOG.md)** | What changed in each release |
199
226
 
200
227
  ---
@@ -202,24 +229,34 @@ Reason: Scope is clear.
202
229
  ## Value Proposition
203
230
 
204
231
  **For** developers and teams already using AI agents
205
- **WingFoil** makes the development process **deterministic**
232
+ **WingFoil** is built to make the development process **deterministic**, and measures how far it does
206
233
  **By** centralizing memory, conventions, and directives — keeping them synchronized across all actors
207
234
 
208
235
  ### Success Metric: Determinism Index
209
236
 
210
237
  Two independent development runs from the same specs + WingFoil config using different AI agents should produce
211
238
  substantially equivalent software, with all team members and agents maintaining shared understanding of project workflow
212
- state, progress, and alignment.
239
+ state, progress, and alignment. This is the goal WingFoil is measured against, not a property it already has.
240
+
241
+ *Substantially equivalent* means **behaviourally equivalent**: both codebases pass the same acceptance contracts. The
242
+ Index has three components:
243
+
244
+ - **Input** — the context WingFoil assembles is identical for identical inputs: guaranteed, by tests.
245
+ - **Process conformance** — the run followed its workflow (well-formed commits, legal transitions, phase outputs
246
+ present, roles respected): measured on every run.
247
+ - **Outcome equivalence** — the two runs' software behaves the same: the agents and models write the code, so this is
248
+ measured, never promised.
213
249
 
214
250
  ---
215
251
 
216
252
  ## What Comes Later
217
253
 
218
- **0.3 — Project Workflow:** the workflow engine (`workflow start|next|status|show|end`…), approval
219
- routing by role, agent execution with directives and Memory context auto-loaded, reference workflow
220
- templates, notifications when an approval is required.
254
+ **0.4 — Interaction Layer + Polish** (planned): adopting WingFoil in a project already
255
+ under way (`init --mode infer`, `dna infer`, `memory import`, `audit`), MCP Tools through which agents
256
+ submit their work, reference workflow templates (Scrum, Kanban, Lean Inception, Trunk-Based), and
257
+ polished CLI help, errors and console output.
221
258
 
222
- **0.4 — Interaction Layer + Polish** · **1.0 — MVP complete**, all five pillars integrated.
259
+ **1.0 — MVP complete**, all five pillars integrated.
223
260
 
224
261
  Later, based on early adopter feedback: semantic search, IDE integrations beyond MCP, notification
225
262
  routing (email, Slack), multi-project management.
@@ -235,16 +272,18 @@ WingFoil is built one pillar per release until all five are integrated in 1.0.
235
272
  | Lean Inception · Requirements | Product vision, USM · BDD · SARD · backlog | ✓ Complete |
236
273
  | **0.1** | Project Memory + DNA | ✓ Released (not published to npm) |
237
274
  | **0.2** | + Project Directives, Memory approvals, DNA editing, MCP role Prompts | ✓ Released (`wingfoil@0.2.1` on npm) |
238
- | **0.2.2** | Patch: configuration at the repository root, staged npm publishing, first-use fixes | 🔄 Being released |
239
- | **0.3** | + Project Workflow | Planned |
275
+ | **0.2.2** | Patch: configuration at the repository root, staged npm publishing, first-use fixes | ✓ Released (`wingfoil@0.2.2` on npm) |
276
+ | **0.3** | + Project Workflow: workflow state, approval routing, agent execution | ✓ Released (`wingfoil@0.3.0` on npm) |
240
277
  | **0.4** | + Interaction Layer polish | Planned |
241
278
  | **1.0** | MVP complete | Planned |
242
279
 
243
280
  **Dogfooding:** WingFoil's own development is managed with WingFoil — its configuration lives in
244
- `.wingfoil/` and its Memory in `docs/04_memory/`, at the repository root. From there the Memory verbs
245
- (`add`, `submit`, `approve`, `reject`, `deprecate`, `history`, `search`) run on WingFoil's own Memory,
246
- through a published, pinned build of WingFoil (`npm run -s wingfoil -- <command>`), whose MCP server
247
- is registered in `.mcp.json`. See [COLLABORATION.md](COLLABORATION.md).
281
+ `.wingfoil/` and its Memory in `docs/04_memory/`, at the repository root. Every verb that writes a
282
+ `wf()` commit there (`add`, `submit`, `approve`, `reject`, `deprecate`, `amend`, `park`) runs on the
283
+ build compiled from the checkout (`npm run build`, then `node dist/cli.js <command>`); the read commands
284
+ and the MCP server registered in `.mcp.json` run on a published, pinned build of WingFoil
285
+ (`npm run -s wingfoil -- <command>`), so they answer as the version users have. See
286
+ [COLLABORATION.md](COLLABORATION.md).
248
287
 
249
288
  ---
250
289
 
@@ -264,13 +303,15 @@ is registered in `.mcp.json`. See [COLLABORATION.md](COLLABORATION.md).
264
303
  └─────────────────────────────────────────────────┘
265
304
  ```
266
305
 
267
- - **CLI**: Humans (and agents) use `wingfoil` commands to manage Memory, DNA and Directives, and to read Workflows
268
- - **MCP Server**: Agents connect via Model Context Protocol to query Memory/DNA, receive Directives, and view Workflow
269
- definitions
306
+ - **CLI**: Humans (and agents) use `wingfoil` commands to manage Memory, DNA and Directives, to start, follow and end
307
+ Workflows, and to launch an agent on an element
308
+ - **MCP Server**: Agents connect via Model Context Protocol to query Memory/DNA, receive Directives and their execution
309
+ context, and read Workflow definitions, the next step and the open workflows
270
310
  - **Git Backend**: All changes (memory, decisions, workflow state) are versioned and auditable
271
311
  - **Read-Only MCP**: The MCP surface is read-only; state changes go through the CLI, and approvals belong to a
272
312
  human holding the `approver` role
273
- - **Workflow Synchronization** *(0.3)*: All team members and agents stay aligned on current progress and blockers
313
+ - **Workflow Synchronization**: All team members and agents read the same workflow state, deduced from the
314
+ repository: the next step, its role, and the approvals waiting
274
315
 
275
316
  ---
276
317
 
@@ -297,11 +338,11 @@ docs/
297
338
  | Layer | Artifact | Count |
298
339
  |----------------|-------------------------------------------------------------|----------|
299
340
  | Vision | User journeys | 8 |
300
- | Vision | MVP features (5 pillars + notifications) | 63 |
301
- | User Story Map | Journey files · edge-case / interruption stories | 7 · 14 |
302
- | BDD | Gherkin feature files / scenarios | 63 / 190 |
303
- | SARD | Architecture & NFR requirements (measurable Fit Criteria) | 43 |
304
- | Backlog | Implementation-ready tasks (63 user stories + 43 technical) | 106 |
341
+ | Vision | MVP features (5 pillars + notifications) | 66 |
342
+ | User Story Map | Journey files · edge-case / interruption stories | 7 · 15 |
343
+ | BDD | Gherkin feature files / scenarios | 66 / 267 |
344
+ | SARD | Architecture & NFR requirements (measurable Fit Criteria) | 46 |
345
+ | Backlog | Implementation-ready tasks, as imported (63 stories + 43 technical) | 106 |
305
346
 
306
347
  All artifacts are scheduled across 5 release waves (v0.1 → v1.0), sequenced by risk in
307
348
  `docs/01_vision/07_sequencer.md`.
@@ -316,25 +357,24 @@ MIT — open source and free to use.
316
357
 
317
358
  ## Contributing
318
359
 
319
- Early feedback is welcome. Please open issues on GitHub to share:
320
-
321
- - Use cases and pain points
322
- - Feature requests
323
- - Bug reports
360
+ Early feedback is welcome. Open a GitHub issue with the **Bug report** or the **Proposal** form: each is
361
+ captured as a Memory element (a `bug`, a `decision-log`, or a `change-proposal` for a feature request)
362
+ without asking you again.
324
363
 
325
364
  See **[`COLLABORATION.md`](COLLABORATION.md)** — how to contribute through Memory artifacts
326
- (Bug / Decision-Log / ADR / Tech-Spec) instead of code, with credit for the AI-generated work
327
- derived from your contribution.
365
+ (Bug / Decision-Log / Change-Proposal / ADR / Tech-Spec) instead of code, with credit for the AI-generated work
366
+ derived from your contribution. Everyone follows the [Code of Conduct](CODE_OF_CONDUCT.md); report a
367
+ vulnerability privately, as [`SECURITY.md`](SECURITY.md) explains, never in a public issue.
328
368
 
329
369
  ---
330
370
 
331
371
  ## Questions?
332
372
 
333
- - **GitHub Issues:** Bug reports, feature requests
373
+ - **GitHub Issues:** bug reports and proposals, through the issue forms
334
374
  - **Documentation:** Start from the [user guide](docs/user-guide.md); WingFoil's own specifications (vision, USM · BDD ·
335
375
  SARD, backlog) are under [`docs/`](docs/)
336
- - **Community:** Join discussions (links coming soon)
376
+ - **Community:** ask and share in [GitHub Discussions](https://github.com/wingfoil/wingfoil/discussions)
337
377
 
338
378
  ---
339
379
 
340
- **WingFoil: Making AI-assisted development deterministic, not chaotic.**
380
+ **WingFoil: governing AI-assisted development toward determinism, not chaos.**
@@ -0,0 +1,72 @@
1
+ import { type Diagnostic } from '../validation';
2
+ import { type CoreResult } from '../core/types';
3
+ import { type AdapterKind } from './manifest';
4
+ import type { AdapterManifest } from './schema';
5
+ /** Root-relative POSIX path of the adapter tree (`spec-016` §2.1). */
6
+ export declare const ADAPTERS_DIR_PATH: ".wingfoil/agents";
7
+ /** The `E_*` code of a name declared in both adapter directories. */
8
+ export declare const E_ADAPTER_DUPLICATE = "E_ADAPTER_DUPLICATE";
9
+ /** The `W_*` code of an entry under the adapter tree that is not an adapter (`bug-290`). */
10
+ export declare const W_ADAPTER_IGNORED = "W_ADAPTER_IGNORED";
11
+ /** An adapter found at a revision: its name (the file basename), its directory and its path. */
12
+ export interface AdapterEntry {
13
+ readonly name: string;
14
+ readonly kind: AdapterKind;
15
+ /** Root-relative POSIX path, e.g. `.wingfoil/agents/custom/fake.yaml`. */
16
+ readonly path: string;
17
+ }
18
+ /** A selected adapter, its manifest parsed and validated. */
19
+ export interface LoadedAdapter extends AdapterEntry {
20
+ readonly manifest: AdapterManifest;
21
+ }
22
+ /**
23
+ * Every entry under `.wingfoil/agents/` at `rev` that is not an adapter (`bug-290`, `spec-016` §2.1): a
24
+ * file of another extension, a nested file, a file outside `built-in/` and `custom/`, or a `.yaml`
25
+ * basename outside `spec-009`'s ID class — one `W_ADAPTER_IGNORED` warning each, naming the path in
26
+ * `file`, in path order (byte order). A `.gitkeep` is not reported. Nothing is parsed.
27
+ *
28
+ * @param rev - A revision naming one commit; `HEAD` for the gating read. At `HEAD`, a repository with
29
+ * no commit has no entry and no diagnostic.
30
+ * @throws `RevisionError` when `rev`, other than `HEAD`, names no commit.
31
+ */
32
+ export declare function adapterTreeDiagnosticsAtRev(root: string, rev: string): Diagnostic[];
33
+ /**
34
+ * Every adapter commit `rev` declares, sorted by name (byte order): only the names {@link loadAdapter}
35
+ * can select; {@link adapterTreeDiagnosticsAtRev} reports the rest. Nothing is parsed.
36
+ *
37
+ * @param rev - A revision naming one commit; `HEAD` for the gating read.
38
+ * @throws `ValidationError` (`E_ADAPTER_DUPLICATE`) when a name is in both `built-in/` and `custom/`;
39
+ * `RevisionError` when `rev` names no commit.
40
+ */
41
+ export declare function listAdaptersAtRev(root: string, rev: string): AdapterEntry[];
42
+ /**
43
+ * The refusal of a name declared in both adapter directories at `rev` (§2.1), in {@link loadAdapter}'s
44
+ * shape — `adapter '<first name>': declared in both …`, every duplicated name a `dl-055` detail line —
45
+ * or `undefined` when every name is unique. `agent execute` asks it where it lists the adapter tree
46
+ * (§3.3 step 2), before it resolves the element, the role or the agent.
47
+ *
48
+ * @param rev - A revision naming one commit (a sha, or `HEAD`; at `HEAD` a repository with no commit has
49
+ * no adapter).
50
+ * @param label - How the refusal spells the revision; defaults to `rev`. A caller that resolved `HEAD`
51
+ * to a sha once, to read everything at that one commit, passes the sha as `rev` and `HEAD` here
52
+ * (task-235's review F3).
53
+ */
54
+ export declare function duplicateAdapterRefusal(root: string, rev: string, label?: string): CoreResult<never> | undefined;
55
+ /**
56
+ * Select, read and validate the adapter `name` at `rev` (`spec-016` §3.2 step 5): the gating read
57
+ * `agent execute` makes. Only that manifest is parsed.
58
+ *
59
+ * Refusals, each `adapter '<name>': …`:
60
+ * - `VALIDATION` — `name` is not an id (`spec-009` §1); a name is in both directories (the first such
61
+ * name is the one named, and every duplicated name is a `dl-055` detail line); the manifest is invalid (§3.7: the first issue in the message, every issue
62
+ * a `dl-055` detail line with its file);
63
+ * - `NOT_FOUND` — no `built-in/<name>.yaml` or `custom/<name>.yaml` at `rev` (at `HEAD`, a repository
64
+ * with no commit has no adapter);
65
+ * - a `RevisionError`'s own code and message when `rev`, other than `HEAD`, names no commit.
66
+ *
67
+ * @param rev - Defaults to `HEAD` (`dl-080` (B)).
68
+ * @param label - How refusals and issue paths spell the revision; defaults to `rev` (see
69
+ * {@link duplicateAdapterRefusal}).
70
+ */
71
+ export declare function loadAdapter(root: string, name: string, rev?: string, label?: string): CoreResult<LoadedAdapter>;
72
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/agent/discovery.ts"],"names":[],"mappings":"AAoBA,OAAO,EAA8B,KAAK,UAAU,EAAuC,MAAM,eAAe,CAAC;AAEjH,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAG,kBAA2B,CAAC;AAE7D,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,gGAAgG;AAChG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,6DAA6D;AAC7D,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;CACpC;AAoCD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CASnF;AAqBD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,EAAE,CAK3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAW7G;AAOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,KAAK,SAAM,GAAG,UAAU,CAAC,aAAa,CAAC,CA6C5G"}
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.W_ADAPTER_IGNORED = exports.E_ADAPTER_DUPLICATE = exports.ADAPTERS_DIR_PATH = void 0;
4
+ exports.adapterTreeDiagnosticsAtRev = adapterTreeDiagnosticsAtRev;
5
+ exports.listAdaptersAtRev = listAdaptersAtRev;
6
+ exports.duplicateAdapterRefusal = duplicateAdapterRefusal;
7
+ exports.loadAdapter = loadAdapter;
8
+ /**
9
+ * Discovering and loading adapter manifests (`spec-016` §2.1, §3.2 step 5, §3.3 step 2, task-177).
10
+ *
11
+ * - **Where:** `.wingfoil/agents/built-in/<name>.yaml` and `.wingfoil/agents/custom/<name>.yaml`. Any
12
+ * other entry under `.wingfoil/agents/` (a `.gitkeep`, a nested directory, another extension) is
13
+ * not an adapter.
14
+ * - **Baseline:** a revision, `HEAD` by default. Manifests gate what `agent execute` launches, so they
15
+ * are a gating read (`dl-080` (B), the `command-baseline` directive, `spec-006` §6): an uncommitted
16
+ * edit, or an untracked manifest, changes nothing.
17
+ * - **Discovery lists, it does not parse.** A name in both directories is refused here, because the
18
+ * run record could not say which one launched (§2.1). Only the adapter a caller selects is then read
19
+ * and validated (§3.2 step 5), so a broken manifest blocks nobody but its own agents.
20
+ * - **What is not an adapter is said, not skipped** (`bug-290`). The listing offers only names
21
+ * {@link loadAdapter} can select — a basename in `spec-009`'s ID class — and
22
+ * {@link adapterTreeDiagnosticsAtRev} reports every other entry under `.wingfoil/agents/` (another
23
+ * extension, a nested file, a file outside the two directories, a basename outside the ID class) as a
24
+ * `W_ADAPTER_IGNORED` warning naming its path, except the `.gitkeep` `wingfoil init` reserves the
25
+ * directories with. `agent execute` prints them where it lists the adapter tree (§3.3 step 2).
26
+ */
27
+ const storage_1 = require("../storage");
28
+ const validation_1 = require("../validation");
29
+ const revision_1 = require("../core/revision");
30
+ const types_1 = require("../core/types");
31
+ const manifest_1 = require("./manifest");
32
+ /** Root-relative POSIX path of the adapter tree (`spec-016` §2.1). */
33
+ exports.ADAPTERS_DIR_PATH = '.wingfoil/agents';
34
+ /** The `E_*` code of a name declared in both adapter directories. */
35
+ exports.E_ADAPTER_DUPLICATE = 'E_ADAPTER_DUPLICATE';
36
+ /** The `W_*` code of an entry under the adapter tree that is not an adapter (`bug-290`). */
37
+ exports.W_ADAPTER_IGNORED = 'W_ADAPTER_IGNORED';
38
+ /** `.wingfoil/agents/<kind>/<basename>.yaml`, directly inside one of the two directories. */
39
+ const ENTRY_RE = /^\.wingfoil\/agents\/(built-in|custom)\/([^/]+)\.yaml$/;
40
+ /** Byte order, never locale order (REQ-SYS-07). */
41
+ const byteOrder = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
42
+ /** The placeholder `wingfoil init` reserves an empty adapter directory with: never reported. */
43
+ const GITKEEP = '.gitkeep';
44
+ /** Why the entry at `path` is not an adapter, or `null` when it is one (or is a `.gitkeep`). */
45
+ function notAnAdapter(path) {
46
+ const match = ENTRY_RE.exec(path);
47
+ if (match === null) {
48
+ return path.endsWith(`/${GITKEEP}`)
49
+ ? null
50
+ : `not an adapter: an adapter is a .yaml file directly inside ${exports.ADAPTERS_DIR_PATH}/built-in/ or ${exports.ADAPTERS_DIR_PATH}/custom/ (spec-016 §2.1)`;
51
+ }
52
+ const name = match[2];
53
+ return (0, validation_1.isIdPiece)(name)
54
+ ? null
55
+ : `not an adapter: its name '${name}' is not an id, characters [${validation_1.ID_CHAR_CLASS}] only (spec-009 §1), so no agent can select it`;
56
+ }
57
+ /** The adapters commit `sha` holds, by name then kind, duplicates included; only names that are ids. */
58
+ function entriesAtCommit(root, sha) {
59
+ const entries = [];
60
+ for (const path of (0, revision_1.listPathsAtCommit)(root, sha, exports.ADAPTERS_DIR_PATH)) {
61
+ const match = ENTRY_RE.exec(path);
62
+ if (match === null || !(0, validation_1.isIdPiece)(match[2]))
63
+ continue;
64
+ entries.push({ name: match[2], kind: match[1], path });
65
+ }
66
+ return entries.sort((a, b) => byteOrder(a.name, b.name) || byteOrder(a.kind, b.kind));
67
+ }
68
+ /**
69
+ * Every entry under `.wingfoil/agents/` at `rev` that is not an adapter (`bug-290`, `spec-016` §2.1): a
70
+ * file of another extension, a nested file, a file outside `built-in/` and `custom/`, or a `.yaml`
71
+ * basename outside `spec-009`'s ID class — one `W_ADAPTER_IGNORED` warning each, naming the path in
72
+ * `file`, in path order (byte order). A `.gitkeep` is not reported. Nothing is parsed.
73
+ *
74
+ * @param rev - A revision naming one commit; `HEAD` for the gating read. At `HEAD`, a repository with
75
+ * no commit has no entry and no diagnostic.
76
+ * @throws `RevisionError` when `rev`, other than `HEAD`, names no commit.
77
+ */
78
+ function adapterTreeDiagnosticsAtRev(root, rev) {
79
+ const sha = rev === 'HEAD' ? (0, revision_1.atHeadOr)(root, () => (0, revision_1.resolveRevision)(root, rev), null) : (0, revision_1.resolveRevision)(root, rev);
80
+ if (sha === null)
81
+ return [];
82
+ const diagnostics = [];
83
+ for (const path of [...(0, revision_1.listPathsAtCommit)(root, sha, exports.ADAPTERS_DIR_PATH)].sort(byteOrder)) {
84
+ const message = notAnAdapter(path);
85
+ if (message !== null)
86
+ diagnostics.push({ code: exports.W_ADAPTER_IGNORED, severity: 'warning', file: path, path: '', message });
87
+ }
88
+ return diagnostics;
89
+ }
90
+ /** One issue per name declared in both directories, in name order, paired with that name. */
91
+ function duplicateIssues(entries, file) {
92
+ const issues = [];
93
+ for (let i = 1; i < entries.length; i += 1) {
94
+ const [previous, entry] = [entries[i - 1], entries[i]];
95
+ if (previous.name !== entry.name)
96
+ continue;
97
+ issues.push({
98
+ name: entry.name,
99
+ issue: {
100
+ code: exports.E_ADAPTER_DUPLICATE,
101
+ path: '',
102
+ file,
103
+ message: `declared in both ${previous.path} and ${entry.path}: an adapter name is unique across built-in/ and custom/, it is not an override (spec-016 §2.1)`,
104
+ },
105
+ });
106
+ }
107
+ return issues;
108
+ }
109
+ /**
110
+ * Every adapter commit `rev` declares, sorted by name (byte order): only the names {@link loadAdapter}
111
+ * can select; {@link adapterTreeDiagnosticsAtRev} reports the rest. Nothing is parsed.
112
+ *
113
+ * @param rev - A revision naming one commit; `HEAD` for the gating read.
114
+ * @throws `ValidationError` (`E_ADAPTER_DUPLICATE`) when a name is in both `built-in/` and `custom/`;
115
+ * `RevisionError` when `rev` names no commit.
116
+ */
117
+ function listAdaptersAtRev(root, rev) {
118
+ const entries = entriesAtCommit(root, (0, revision_1.resolveRevision)(root, rev));
119
+ const duplicates = duplicateIssues(entries, `${rev}:${exports.ADAPTERS_DIR_PATH}`);
120
+ if (duplicates.length > 0)
121
+ throw new validation_1.ValidationError(duplicates.map(({ issue }) => issue));
122
+ return entries;
123
+ }
124
+ /**
125
+ * The refusal of a name declared in both adapter directories at `rev` (§2.1), in {@link loadAdapter}'s
126
+ * shape — `adapter '<first name>': declared in both …`, every duplicated name a `dl-055` detail line —
127
+ * or `undefined` when every name is unique. `agent execute` asks it where it lists the adapter tree
128
+ * (§3.3 step 2), before it resolves the element, the role or the agent.
129
+ *
130
+ * @param rev - A revision naming one commit (a sha, or `HEAD`; at `HEAD` a repository with no commit has
131
+ * no adapter).
132
+ * @param label - How the refusal spells the revision; defaults to `rev`. A caller that resolved `HEAD`
133
+ * to a sha once, to read everything at that one commit, passes the sha as `rev` and `HEAD` here
134
+ * (task-235's review F3).
135
+ */
136
+ function duplicateAdapterRefusal(root, rev, label = rev) {
137
+ const sha = rev === 'HEAD' ? (0, revision_1.atHeadOr)(root, () => (0, revision_1.resolveRevision)(root, rev), null) : (0, revision_1.resolveRevision)(root, rev);
138
+ if (sha === null)
139
+ return undefined;
140
+ const duplicates = duplicateIssues(entriesAtCommit(root, sha), `${label}:${exports.ADAPTERS_DIR_PATH}`);
141
+ if (duplicates.length === 0)
142
+ return undefined;
143
+ const [first] = duplicates;
144
+ return (0, types_1.coreErr)({
145
+ code: 'VALIDATION',
146
+ message: `adapter '${first.name}': ${first.issue.message}`,
147
+ details: { issues: duplicates.map(({ issue }) => ({ ...issue, detail: render(issue) })) },
148
+ });
149
+ }
150
+ /** An issue in the form a refusal shows it: `<path>: <message>`, or the message alone at the root. */
151
+ function render(issue) {
152
+ return issue.path === '' ? issue.message : `${issue.path}: ${issue.message}`;
153
+ }
154
+ /**
155
+ * Select, read and validate the adapter `name` at `rev` (`spec-016` §3.2 step 5): the gating read
156
+ * `agent execute` makes. Only that manifest is parsed.
157
+ *
158
+ * Refusals, each `adapter '<name>': …`:
159
+ * - `VALIDATION` — `name` is not an id (`spec-009` §1); a name is in both directories (the first such
160
+ * name is the one named, and every duplicated name is a `dl-055` detail line); the manifest is invalid (§3.7: the first issue in the message, every issue
161
+ * a `dl-055` detail line with its file);
162
+ * - `NOT_FOUND` — no `built-in/<name>.yaml` or `custom/<name>.yaml` at `rev` (at `HEAD`, a repository
163
+ * with no commit has no adapter);
164
+ * - a `RevisionError`'s own code and message when `rev`, other than `HEAD`, names no commit.
165
+ *
166
+ * @param rev - Defaults to `HEAD` (`dl-080` (B)).
167
+ * @param label - How refusals and issue paths spell the revision; defaults to `rev` (see
168
+ * {@link duplicateAdapterRefusal}).
169
+ */
170
+ function loadAdapter(root, name, rev = 'HEAD', label = rev) {
171
+ const refuse = (code, reason, issues, subject = name) => (0, types_1.coreErr)({
172
+ code,
173
+ message: `adapter '${subject}': ${reason}`,
174
+ ...(issues === undefined ? {} : { details: { issues: issues.map((issue) => ({ ...issue, detail: render(issue) })) } }),
175
+ });
176
+ if (!(0, validation_1.isIdPiece)(name)) {
177
+ return refuse('VALIDATION', `not an adapter name: an adapter name is an id, characters [${validation_1.ID_CHAR_CLASS}] only (spec-009 §1)`);
178
+ }
179
+ let sha;
180
+ try {
181
+ sha = rev === 'HEAD' ? (0, revision_1.atHeadOr)(root, () => (0, revision_1.resolveRevision)(root, rev), null) : (0, revision_1.resolveRevision)(root, rev);
182
+ }
183
+ catch (error) {
184
+ if (error instanceof revision_1.RevisionError)
185
+ return (0, types_1.coreErr)(error.toCoreError());
186
+ throw error;
187
+ }
188
+ const entries = sha === null ? [] : entriesAtCommit(root, sha);
189
+ // Every duplicated name is a dl-055 detail line; the message names the first (task-177 review F2).
190
+ const duplicates = duplicateIssues(entries, `${label}:${exports.ADAPTERS_DIR_PATH}`);
191
+ if (duplicates.length > 0) {
192
+ const [first] = duplicates;
193
+ return refuse('VALIDATION', first.issue.message, duplicates.map(({ issue }) => issue), first.name);
194
+ }
195
+ const entry = entries.find((candidate) => candidate.name === name);
196
+ const text = entry === undefined || sha === null ? null : (0, storage_1.readPathAtRev)(root, sha, entry.path);
197
+ if (entry === undefined || text === null) {
198
+ return refuse('NOT_FOUND', `no ${exports.ADAPTERS_DIR_PATH}/built-in/${name}.yaml or ${exports.ADAPTERS_DIR_PATH}/custom/${name}.yaml at ${label}`);
199
+ }
200
+ try {
201
+ const manifest = (0, manifest_1.parseAdapterManifest)(text, { name, kind: entry.kind, file: `${label}:${entry.path}` });
202
+ return (0, types_1.coreOk)({ ...entry, manifest });
203
+ }
204
+ catch (error) {
205
+ if (!(error instanceof validation_1.ValidationError))
206
+ throw error;
207
+ return refuse('VALIDATION', render(error.issues[0]), error.issues);
208
+ }
209
+ }
210
+ //# sourceMappingURL=discovery.js.map
@@ -0,0 +1 @@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