agentplane 0.3.13 → 0.3.15

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 (278) hide show
  1. package/assets/RUNNER.md +1 -1
  2. package/assets/agents/ORCHESTRATOR.json +1 -1
  3. package/assets/agents/SKILL_EXTRACTOR.json +31 -0
  4. package/assets/framework.manifest.json +7 -0
  5. package/assets/policy/incidents.md +5 -3
  6. package/assets/policy/workflow.branch_pr.md +10 -5
  7. package/dist/.build-manifest.json +280 -180
  8. package/dist/cli/output.d.ts +29 -0
  9. package/dist/cli/output.d.ts.map +1 -1
  10. package/dist/cli/output.js +33 -0
  11. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  12. package/dist/cli/run-cli/command-catalog/core.js +29 -87
  13. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
  14. package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
  15. package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
  16. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
  17. package/dist/cli/run-cli/command-catalog/project.js +16 -38
  18. package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
  19. package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
  20. package/dist/cli/run-cli/command-catalog/shared.js +23 -6
  21. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
  22. package/dist/cli/run-cli/command-catalog/task.js +6 -18
  23. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  24. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  25. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
  26. package/dist/cli/run-cli/commands/init/recipes.js +1 -0
  27. package/dist/cli/run-cli.js +1 -1
  28. package/dist/cli/run-cli.test-helpers.d.ts +1 -74
  29. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  30. package/dist/cli/run-cli.test-helpers.js +1 -769
  31. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
  32. package/dist/commands/branch/cleanup-merged.js +5 -9
  33. package/dist/commands/branch/work-start.command.d.ts.map +1 -1
  34. package/dist/commands/branch/work-start.command.js +1 -0
  35. package/dist/commands/commit.spec.d.ts.map +1 -1
  36. package/dist/commands/commit.spec.js +2 -0
  37. package/dist/commands/doctor/branch-pr.d.ts +1 -1
  38. package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
  39. package/dist/commands/doctor/branch-pr.js +5 -2
  40. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  41. package/dist/commands/guard/impl/commands.js +4 -1
  42. package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
  43. package/dist/commands/guard/impl/comment-commit.js +2 -1
  44. package/dist/commands/guard/impl/env.d.ts +6 -0
  45. package/dist/commands/guard/impl/env.d.ts.map +1 -1
  46. package/dist/commands/guard/impl/env.js +41 -0
  47. package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
  48. package/dist/commands/pr/internal/auto-commit.js +2 -1
  49. package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
  50. package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
  51. package/dist/commands/pr/internal/sync-branch.js +113 -0
  52. package/dist/commands/pr/internal/sync-github.d.ts +28 -0
  53. package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
  54. package/dist/commands/pr/internal/sync-github.js +178 -0
  55. package/dist/commands/pr/internal/sync-model.d.ts +36 -0
  56. package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
  57. package/dist/commands/pr/internal/sync-model.js +1 -0
  58. package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
  59. package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
  60. package/dist/commands/pr/internal/sync-open-step.js +128 -0
  61. package/dist/commands/pr/internal/sync-support.d.ts +7 -0
  62. package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
  63. package/dist/commands/pr/internal/sync-support.js +29 -0
  64. package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
  65. package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
  66. package/dist/commands/pr/internal/sync-update-step.js +68 -0
  67. package/dist/commands/pr/internal/sync.d.ts +2 -6
  68. package/dist/commands/pr/internal/sync.d.ts.map +1 -1
  69. package/dist/commands/pr/internal/sync.js +83 -529
  70. package/dist/commands/pr/open.d.ts.map +1 -1
  71. package/dist/commands/pr/open.js +25 -8
  72. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  73. package/dist/commands/pr/pr.command.js +7 -2
  74. package/dist/commands/recipes/impl/apply.d.ts +1 -1
  75. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  76. package/dist/commands/recipes/impl/apply.js +1 -2
  77. package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -1
  78. package/dist/commands/recipes/impl/commands/active.js +6 -5
  79. package/dist/commands/recipes/impl/commands/add.d.ts +1 -0
  80. package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
  81. package/dist/commands/recipes/impl/commands/add.js +32 -27
  82. package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
  83. package/dist/commands/recipes/impl/commands/detach.js +35 -21
  84. package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -1
  85. package/dist/commands/recipes/impl/commands/disable.js +5 -3
  86. package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -1
  87. package/dist/commands/recipes/impl/commands/enable.js +5 -3
  88. package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
  89. package/dist/commands/recipes/impl/commands/explain.js +57 -47
  90. package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
  91. package/dist/commands/recipes/impl/commands/info.js +25 -21
  92. package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
  93. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  94. package/dist/commands/recipes/impl/commands/install.js +3 -13
  95. package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
  96. package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
  97. package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
  98. package/dist/commands/recipes/impl/commands/list.js +7 -6
  99. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
  100. package/dist/commands/recipes/impl/commands/remove.js +12 -7
  101. package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
  102. package/dist/commands/recipes/impl/commands/update.js +38 -24
  103. package/dist/commands/recipes/impl/index.d.ts +1 -1
  104. package/dist/commands/recipes/impl/index.d.ts.map +1 -1
  105. package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
  106. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  107. package/dist/commands/recipes/impl/installed-recipes.js +1 -2
  108. package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
  109. package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
  110. package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
  111. package/dist/commands/recipes/impl/overlay-project.d.ts +19 -3
  112. package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
  113. package/dist/commands/recipes/impl/overlay-project.js +76 -38
  114. package/dist/commands/recipes/impl/paths.d.ts +0 -3
  115. package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
  116. package/dist/commands/recipes/impl/paths.js +0 -3
  117. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +4 -1
  118. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
  119. package/dist/commands/recipes/impl/project-installed-recipes.js +6 -4
  120. package/dist/commands/recipes/impl/project-recipe-state.d.ts +1 -1
  121. package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -1
  122. package/dist/commands/recipes/impl/project-registry.d.ts +5 -1
  123. package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -1
  124. package/dist/commands/recipes/impl/project-registry.js +34 -14
  125. package/dist/commands/recipes/impl/resolver.d.ts +1 -1
  126. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
  127. package/dist/commands/recipes/impl/resolver.js +1 -1
  128. package/dist/commands/recipes/impl/types.d.ts +1 -1
  129. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  130. package/dist/commands/recipes/impl/version.d.ts +5 -0
  131. package/dist/commands/recipes/impl/version.d.ts.map +1 -0
  132. package/dist/commands/recipes/impl/version.js +9 -0
  133. package/dist/commands/recipes.d.ts +5 -4
  134. package/dist/commands/recipes.d.ts.map +1 -1
  135. package/dist/commands/recipes.js +3 -3
  136. package/dist/commands/release/apply.command.d.ts +1 -1
  137. package/dist/commands/release/apply.command.d.ts.map +1 -1
  138. package/dist/commands/release/apply.command.js +15 -379
  139. package/dist/commands/release/apply.mutation.d.ts +1 -0
  140. package/dist/commands/release/apply.mutation.d.ts.map +1 -1
  141. package/dist/commands/release/apply.mutation.js +24 -1
  142. package/dist/commands/release/apply.pipeline.d.ts +22 -0
  143. package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
  144. package/dist/commands/release/apply.pipeline.js +371 -0
  145. package/dist/commands/release/apply.preflight.d.ts +2 -0
  146. package/dist/commands/release/apply.preflight.d.ts.map +1 -1
  147. package/dist/commands/release/apply.preflight.js +13 -4
  148. package/dist/commands/release/apply.types.d.ts +27 -0
  149. package/dist/commands/release/apply.types.d.ts.map +1 -1
  150. package/dist/commands/release.test-helpers.d.ts +4 -0
  151. package/dist/commands/release.test-helpers.d.ts.map +1 -1
  152. package/dist/commands/release.test-helpers.js +7 -0
  153. package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
  154. package/dist/commands/shared/reconcile-check.js +2 -2
  155. package/dist/commands/shared/task-backend.d.ts +6 -1
  156. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  157. package/dist/commands/shared/task-backend.js +34 -2
  158. package/dist/commands/shared/task-mutation.d.ts.map +1 -1
  159. package/dist/commands/shared/task-mutation.js +4 -4
  160. package/dist/commands/shared/task-store/intents.d.ts +34 -0
  161. package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
  162. package/dist/commands/shared/task-store/intents.js +265 -0
  163. package/dist/commands/shared/task-store/readme.d.ts +28 -0
  164. package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
  165. package/dist/commands/shared/task-store/readme.js +125 -0
  166. package/dist/commands/shared/task-store/store.d.ts +26 -0
  167. package/dist/commands/shared/task-store/store.d.ts.map +1 -0
  168. package/dist/commands/shared/task-store/store.js +105 -0
  169. package/dist/commands/shared/task-store/types.d.ts +94 -0
  170. package/dist/commands/shared/task-store/types.d.ts.map +1 -0
  171. package/dist/commands/shared/task-store/types.js +1 -0
  172. package/dist/commands/shared/task-store.d.ts +3 -109
  173. package/dist/commands/shared/task-store.d.ts.map +1 -1
  174. package/dist/commands/shared/task-store.js +2 -493
  175. package/dist/commands/task/block.d.ts.map +1 -1
  176. package/dist/commands/task/block.js +7 -2
  177. package/dist/commands/task/comment.d.ts.map +1 -1
  178. package/dist/commands/task/comment.js +7 -2
  179. package/dist/commands/task/finish-shared.d.ts.map +1 -1
  180. package/dist/commands/task/finish-shared.js +3 -3
  181. package/dist/commands/task/finish.d.ts.map +1 -1
  182. package/dist/commands/task/finish.js +102 -15
  183. package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
  184. package/dist/commands/task/hosted-close.command.js +23 -2
  185. package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
  186. package/dist/commands/task/hosted-merge-sync.js +9 -4
  187. package/dist/commands/task/list.run.d.ts.map +1 -1
  188. package/dist/commands/task/list.run.js +14 -4
  189. package/dist/commands/task/new.command.d.ts.map +1 -1
  190. package/dist/commands/task/new.command.js +16 -2
  191. package/dist/commands/task/new.js +2 -2
  192. package/dist/commands/task/show.d.ts.map +1 -1
  193. package/dist/commands/task/show.js +3 -3
  194. package/dist/commands/task/update.d.ts.map +1 -1
  195. package/dist/commands/task/update.js +11 -3
  196. package/dist/runner/adapters/codex.d.ts.map +1 -1
  197. package/dist/runner/adapters/codex.js +3 -33
  198. package/dist/runner/adapters/custom.d.ts.map +1 -1
  199. package/dist/runner/adapters/custom.js +3 -30
  200. package/dist/runner/adapters/runtime-shared.d.ts +14 -0
  201. package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
  202. package/dist/runner/adapters/runtime-shared.js +36 -0
  203. package/dist/runner/context/base-prompt-sources.d.ts +30 -0
  204. package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
  205. package/dist/runner/context/base-prompt-sources.js +144 -0
  206. package/dist/runner/context/base-prompts.d.ts +3 -22
  207. package/dist/runner/context/base-prompts.d.ts.map +1 -1
  208. package/dist/runner/context/base-prompts.js +6 -450
  209. package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
  210. package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
  211. package/dist/runner/context/overlay-prompt-blocks.js +72 -0
  212. package/dist/runner/context/prompt-block-shared.d.ts +54 -0
  213. package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
  214. package/dist/runner/context/prompt-block-shared.js +106 -0
  215. package/dist/runner/context/recipe-context.d.ts +2 -1
  216. package/dist/runner/context/recipe-context.d.ts.map +1 -1
  217. package/dist/runner/context/recipe-context.js +2 -1
  218. package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
  219. package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
  220. package/dist/runner/context/recipe-prompt-blocks.js +143 -0
  221. package/dist/runner/usecases/scenario-materialize-task.js +2 -2
  222. package/dist/runner/usecases/task-run-inspect.js +2 -2
  223. package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
  224. package/dist/runner/usecases/task-run.d.ts.map +1 -1
  225. package/dist/runner/usecases/task-run.js +4 -2
  226. package/dist/runtime/capabilities/recipe.d.ts +1 -1
  227. package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
  228. package/dist/runtime/execution-context.d.ts +63 -0
  229. package/dist/runtime/execution-context.d.ts.map +1 -0
  230. package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
  231. package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
  232. package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
  233. package/dist/runtime/incidents/advice-strategy.js +54 -0
  234. package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
  235. package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
  236. package/dist/runtime/incidents/plan-strategy.js +205 -0
  237. package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
  238. package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
  239. package/dist/runtime/incidents/registry-strategy.js +280 -0
  240. package/dist/runtime/incidents/resolve.d.ts +3 -25
  241. package/dist/runtime/incidents/resolve.d.ts.map +1 -1
  242. package/dist/runtime/incidents/resolve.js +3 -683
  243. package/dist/runtime/incidents/shared.d.ts +34 -0
  244. package/dist/runtime/incidents/shared.d.ts.map +1 -0
  245. package/dist/runtime/incidents/shared.js +171 -0
  246. package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
  247. package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
  248. package/dist/testing/cli-harness/recipe-archives.js +374 -0
  249. package/dist/testing/cli-harness/stdio.d.ts +26 -0
  250. package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
  251. package/dist/testing/cli-harness/stdio.js +84 -0
  252. package/dist/testing/cli-harness.d.ts +25 -0
  253. package/dist/testing/cli-harness.d.ts.map +1 -0
  254. package/dist/testing/cli-harness.js +313 -0
  255. package/dist/testing/index.d.ts +2 -0
  256. package/dist/testing/index.d.ts.map +1 -0
  257. package/dist/testing/index.js +1 -0
  258. package/package.json +7 -4
  259. package/dist/commands/recipes/impl/manifest.d.ts +0 -4
  260. package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
  261. package/dist/commands/recipes/impl/manifest.js +0 -7
  262. package/dist/commands/recipes/impl/normalize.d.ts +0 -8
  263. package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
  264. package/dist/commands/recipes/impl/normalize.js +0 -54
  265. package/dist/commands/recipes/impl/scenario.d.ts +0 -16
  266. package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
  267. package/dist/commands/recipes/impl/scenario.js +0 -262
  268. package/dist/recipes/bundled-recipes.d.ts +0 -17
  269. package/dist/recipes/bundled-recipes.d.ts.map +0 -1
  270. package/dist/recipes/bundled-recipes.js +0 -15
  271. package/dist/usecases/context/resolve-context.d.ts +0 -68
  272. package/dist/usecases/context/resolve-context.d.ts.map +0 -1
  273. package/dist/usecases/task/task-list-usecase.d.ts +0 -9
  274. package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
  275. package/dist/usecases/task/task-list-usecase.js +0 -17
  276. package/dist/usecases/task/task-new-usecase.d.ts +0 -9
  277. package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
  278. package/dist/usecases/task/task-new-usecase.js +0 -17
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;AAyHtE,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,YAAY,CAAC,CA0BxB;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAGV"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,wBAAwB,CAAC;AAsIlF,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,YAAY,CAAC,CA0BxB;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAGV"}
@@ -1,4 +1,4 @@
1
- import type { InstalledRecipesFile } from "./types.js";
1
+ import { type InstalledRecipesFile } from "@agentplaneorg/recipes";
2
2
  export declare function readInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
3
3
  export declare function writeInstalledRecipesFile(filePath: string, file: InstalledRecipesFile): Promise<void>;
4
4
  //# sourceMappingURL=installed-recipes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAoCvD,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
1
+ {"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAwChC,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -1,10 +1,9 @@
1
1
  import { mkdir, readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import { normalizeRecipeTags, validateRecipeManifest, } from "@agentplaneorg/recipes";
3
4
  import { invalidFieldMessage } from "../../../cli/output.js";
4
5
  import { isRecord } from "../../../shared/guards.js";
5
6
  import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
6
- import { validateRecipeManifest } from "./manifest.js";
7
- import { normalizeRecipeTags } from "./normalize.js";
8
7
  function validateInstalledRecipesFile(raw) {
9
8
  if (!isRecord(raw))
10
9
  throw new Error(invalidFieldMessage("recipes.json", "object"));
@@ -0,0 +1,7 @@
1
+ export declare function runVendoredRecipeMutation<T>(opts: {
2
+ targetDir: string;
3
+ mode: "create" | "replace" | "remove";
4
+ materialize?: (targetDir: string) => Promise<void>;
5
+ commit: () => Promise<T>;
6
+ }): Promise<T>;
7
+ //# sourceMappingURL=mutation-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-transaction.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/mutation-transaction.ts"],"names":[],"mappings":"AAmBA,wBAAsB,yBAAyB,CAAC,CAAC,EAAE,IAAI,EAAE;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;CAC1B,GAAG,OAAO,CAAC,CAAC,CAAC,CA8Bb"}
@@ -0,0 +1,47 @@
1
+ import { lstat, rename, rm } from "node:fs/promises";
2
+ let recipeMutationNonce = 0;
3
+ async function pathExists(filePath) {
4
+ try {
5
+ await lstat(filePath);
6
+ return true;
7
+ }
8
+ catch (err) {
9
+ const code = err?.code;
10
+ if (code === "ENOENT")
11
+ return false;
12
+ throw err;
13
+ }
14
+ }
15
+ function backupPath(targetDir) {
16
+ return `${targetDir}.agentplane-backup-${process.pid}-${Date.now()}-${recipeMutationNonce++}`;
17
+ }
18
+ export async function runVendoredRecipeMutation(opts) {
19
+ const existed = await pathExists(opts.targetDir);
20
+ const backupDir = existed && (opts.mode === "replace" || opts.mode === "remove")
21
+ ? backupPath(opts.targetDir)
22
+ : null;
23
+ if (backupDir) {
24
+ await rename(opts.targetDir, backupDir);
25
+ }
26
+ try {
27
+ if (opts.mode !== "remove") {
28
+ if (!opts.materialize)
29
+ throw new Error("materialize callback is required for create/replace");
30
+ await opts.materialize(opts.targetDir);
31
+ }
32
+ const result = await opts.commit();
33
+ if (backupDir) {
34
+ await rm(backupDir, { recursive: true, force: true });
35
+ }
36
+ return result;
37
+ }
38
+ catch (err) {
39
+ if (opts.mode !== "remove") {
40
+ await rm(opts.targetDir, { recursive: true, force: true }).catch((_error) => null);
41
+ }
42
+ if (backupDir) {
43
+ await rename(backupDir, opts.targetDir).catch((_error) => null);
44
+ }
45
+ throw err;
46
+ }
47
+ }
@@ -1,7 +1,9 @@
1
- import { type CompiledRecipeAssetRegistry, type CompiledOverlayBundle, type ProjectRecipesLockFile } from "@agentplaneorg/recipes";
1
+ import { type CompiledRecipeAssetRegistry, type CompiledOverlayBundle } from "@agentplaneorg/recipes";
2
+ import type { ProjectRecipesRegistryFile } from "./types.js";
2
3
  export declare function readActiveRecipeIds(project: {
3
4
  agentplaneDir: string;
4
5
  }): Promise<string[]>;
6
+ export declare function readActiveRecipeIdsFromRegistry(registry: ProjectRecipesRegistryFile): string[];
5
7
  export declare function setRecipeActive(opts: {
6
8
  project: {
7
9
  agentplaneDir: string;
@@ -9,18 +11,32 @@ export declare function setRecipeActive(opts: {
9
11
  recipeId: string;
10
12
  active: boolean;
11
13
  }): Promise<string[]>;
14
+ export declare function compileProjectOverlayArtifactsFromRegistry(project: {
15
+ agentplaneDir: string;
16
+ }, registry: ProjectRecipesRegistryFile): Promise<{
17
+ bundle: CompiledOverlayBundle;
18
+ assets: CompiledRecipeAssetRegistry;
19
+ }>;
12
20
  export declare function compileProjectOverlayArtifacts(project: {
13
21
  agentplaneDir: string;
14
22
  }): Promise<{
15
23
  bundle: CompiledOverlayBundle;
16
- lock: ProjectRecipesLockFile;
24
+ assets: CompiledRecipeAssetRegistry;
25
+ }>;
26
+ export declare function publishProjectRecipesState(opts: {
27
+ project: {
28
+ agentplaneDir: string;
29
+ };
30
+ registry: ProjectRecipesRegistryFile;
31
+ }): Promise<{
32
+ registry: ProjectRecipesRegistryFile;
33
+ bundle: CompiledOverlayBundle;
17
34
  assets: CompiledRecipeAssetRegistry;
18
35
  }>;
19
36
  export declare function refreshProjectOverlayArtifacts(project: {
20
37
  agentplaneDir: string;
21
38
  }): Promise<{
22
39
  bundle: CompiledOverlayBundle;
23
- lock: ProjectRecipesLockFile;
24
40
  assets: CompiledRecipeAssetRegistry;
25
41
  }>;
26
42
  export declare function readProjectOverlayBundle(project: {
@@ -1 +1 @@
1
- {"version":3,"file":"overlay-project.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/overlay-project.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAiJhC,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAM/F;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAepB;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAChG,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI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a,EAAE,MAAM,CAAA;CAAE,EAClC,QAAQ,EAAE,0BAA0B,GACnC,OAAO,CAAC;IACT,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAqGD;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAChG,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAGD;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,0BAA0B,CAAC;CACtC,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,0BAA0B,CAAC;IACrC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CASD;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAChG,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAQD;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAUxC;AAED,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAC5D,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAU9C"}
@@ -1,10 +1,12 @@
1
- import { mkdir, readFile } from "node:fs/promises";
1
+ import { lstat, mkdir, readFile, rename, rm } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { createEmptyOverlayBundle, hashOverlayInputs, } from "@agentplaneorg/recipes";
3
+ import { createEmptyOverlayBundle, hashOverlayInputs, validateCompiledOverlayBundle, validateCompiledRecipeAssetRegistry, } from "@agentplaneorg/recipes";
4
+ import { atomicWriteFile, canonicalizeJson } from "@agentplaneorg/core";
4
5
  import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
5
- import { readProjectInstalledRecipes } from "./project-installed-recipes.js";
6
- import { readProjectRecipesRegistry, writeProjectRecipesRegistry } from "./project-registry.js";
7
- import { resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir, resolveProjectRecipesLockPath, } from "./paths.js";
6
+ import { readProjectInstalledRecipesFromRegistry } from "./project-installed-recipes.js";
7
+ import { readProjectRecipesRegistry, setProjectRecipeActiveInFile, stampProjectRecipesRegistry, writeProjectRecipesRegistry, } from "./project-registry.js";
8
+ import { resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir, resolveProjectRecipesRegistryPath, } from "./paths.js";
9
+ let projectRecipePublishNonce = 0;
8
10
  function ensureTrailingNewline(text) {
9
11
  return text.endsWith("\n") ? text : `${text}\n`;
10
12
  }
@@ -33,6 +35,49 @@ function uniqueById(items) {
33
35
  }
34
36
  return result;
35
37
  }
38
+ function jsonText(value) {
39
+ return `${JSON.stringify(canonicalizeJson(value), null, 2)}\n`;
40
+ }
41
+ async function pathExists(filePath) {
42
+ try {
43
+ await lstat(filePath);
44
+ return true;
45
+ }
46
+ catch (err) {
47
+ const code = err?.code;
48
+ if (code === "ENOENT")
49
+ return false;
50
+ throw err;
51
+ }
52
+ }
53
+ async function publishJsonFilesTransactional(files) {
54
+ const backups = [];
55
+ try {
56
+ for (const file of files) {
57
+ if (!(await pathExists(file.path)))
58
+ continue;
59
+ const backup = `${file.path}.bak-${process.pid}-${Date.now()}-${projectRecipePublishNonce++}`;
60
+ await rename(file.path, backup);
61
+ backups.push({ path: file.path, backup });
62
+ }
63
+ for (const file of files) {
64
+ await mkdir(path.dirname(file.path), { recursive: true });
65
+ await atomicWriteFile(file.path, jsonText(file.value), "utf8");
66
+ }
67
+ for (const entry of backups) {
68
+ await rm(entry.backup, { recursive: true, force: true });
69
+ }
70
+ }
71
+ catch (err) {
72
+ for (const file of files) {
73
+ await rm(file.path, { recursive: true, force: true }).catch((_error) => null);
74
+ }
75
+ for (const entry of backups.toReversed()) {
76
+ await rename(entry.backup, entry.path).catch((_error) => null);
77
+ }
78
+ throw err;
79
+ }
80
+ }
36
81
  function recipeAssetId(recipeId, kind, assetId) {
37
82
  return `recipe:${recipeId}/${kind}:${assetId}`;
38
83
  }
@@ -123,6 +168,9 @@ async function compileProjectRecipeAssets(opts) {
123
168
  }
124
169
  export async function readActiveRecipeIds(project) {
125
170
  const registry = await readProjectRecipesRegistry(project);
171
+ return readActiveRecipeIdsFromRegistry(registry);
172
+ }
173
+ export function readActiveRecipeIdsFromRegistry(registry) {
126
174
  return registry.recipes
127
175
  .filter((entry) => entry.active)
128
176
  .map((entry) => entry.id)
@@ -130,28 +178,14 @@ export async function readActiveRecipeIds(project) {
130
178
  }
131
179
  export async function setRecipeActive(opts) {
132
180
  const registry = await readProjectRecipesRegistry(opts.project);
133
- const current = new Set();
134
- const recipes = registry.recipes.map((entry) => {
135
- const isTarget = entry.id === opts.recipeId;
136
- const active = isTarget ? opts.active : entry.active;
137
- if (active)
138
- current.add(entry.id);
139
- return isTarget ? { ...entry, active } : entry;
140
- });
141
- await writeProjectRecipesRegistry(opts.project, {
142
- schema_version: 1,
143
- updated_at: registry.updated_at,
144
- recipes,
145
- });
146
- return [...current].toSorted();
181
+ const next = setProjectRecipeActiveInFile(registry, opts.recipeId, opts.active);
182
+ await writeProjectRecipesRegistry(opts.project, next);
183
+ return readActiveRecipeIdsFromRegistry(next);
147
184
  }
148
- export async function compileProjectOverlayArtifacts(project) {
149
- const [activeIds, installed] = await Promise.all([
150
- readActiveRecipeIds(project),
151
- readProjectInstalledRecipes(project),
152
- ]);
185
+ export async function compileProjectOverlayArtifactsFromRegistry(project, registry) {
186
+ const activeIds = readActiveRecipeIdsFromRegistry(registry);
187
+ const installed = await readProjectInstalledRecipesFromRegistry(project, registry);
153
188
  const bundle = createEmptyOverlayBundle();
154
- const lock = { schema_version: 1, active: [] };
155
189
  for (const recipeId of activeIds) {
156
190
  const entry = installed.recipes.find((candidate) => candidate.id === recipeId);
157
191
  if (!entry) {
@@ -225,13 +259,7 @@ export async function compileProjectOverlayArtifacts(project) {
225
259
  bundle.agents.push(...(manifest.agents ?? []));
226
260
  bundle.tools.push(...(manifest.tools ?? []));
227
261
  Object.assign(bundle.templates, manifest.templates ?? {});
228
- lock.active.push({
229
- id: manifest.id,
230
- version: manifest.version,
231
- kind: manifest.kind,
232
- source: entry.source,
233
- hash: hashOverlayInputs({ manifest, prompts: promptInputs }),
234
- });
262
+ void hashOverlayInputs({ manifest, prompts: promptInputs });
235
263
  }
236
264
  bundle.agents = uniqueById(bundle.agents);
237
265
  bundle.tools = uniqueById(bundle.tools);
@@ -240,27 +268,37 @@ export async function compileProjectOverlayArtifacts(project) {
240
268
  left.recipe_id.localeCompare(right.recipe_id) ||
241
269
  left.id.localeCompare(right.id));
242
270
  }
243
- lock.active = lock.active.toSorted((left, right) => left.id.localeCompare(right.id));
244
271
  return {
245
272
  bundle,
246
- lock,
247
273
  assets: await compileProjectRecipeAssets({ project, installed }),
248
274
  };
249
275
  }
276
+ export async function compileProjectOverlayArtifacts(project) {
277
+ const registry = await readProjectRecipesRegistry(project);
278
+ return await compileProjectOverlayArtifactsFromRegistry(project, registry);
279
+ }
280
+ export async function publishProjectRecipesState(opts) {
281
+ const registry = stampProjectRecipesRegistry(opts.registry);
282
+ const compiled = await compileProjectOverlayArtifactsFromRegistry(opts.project, registry);
283
+ await publishJsonFilesTransactional([
284
+ { path: resolveProjectOverlayBundlePath(opts.project), value: compiled.bundle },
285
+ { path: resolveProjectRecipeAssetsPath(opts.project), value: compiled.assets },
286
+ { path: resolveProjectRecipesRegistryPath(opts.project), value: registry },
287
+ ]);
288
+ return { registry, ...compiled };
289
+ }
250
290
  export async function refreshProjectOverlayArtifacts(project) {
251
291
  const compiled = await compileProjectOverlayArtifacts(project);
252
292
  const bundlePath = resolveProjectOverlayBundlePath(project);
253
- const lockPath = resolveProjectRecipesLockPath(project);
254
293
  const assetsPath = resolveProjectRecipeAssetsPath(project);
255
294
  await mkdir(path.dirname(bundlePath), { recursive: true });
256
295
  await writeJsonStableIfChanged(bundlePath, compiled.bundle);
257
- await writeJsonStableIfChanged(lockPath, compiled.lock);
258
296
  await writeJsonStableIfChanged(assetsPath, compiled.assets);
259
297
  return compiled;
260
298
  }
261
299
  export async function readProjectOverlayBundle(project) {
262
300
  try {
263
- return JSON.parse(await readFile(resolveProjectOverlayBundlePath(project), "utf8"));
301
+ return validateCompiledOverlayBundle(JSON.parse(await readFile(resolveProjectOverlayBundlePath(project), "utf8")));
264
302
  }
265
303
  catch (err) {
266
304
  const code = err?.code;
@@ -271,7 +309,7 @@ export async function readProjectOverlayBundle(project) {
271
309
  }
272
310
  export async function readProjectRecipeAssetRegistry(project) {
273
311
  try {
274
- return JSON.parse(await readFile(resolveProjectRecipeAssetsPath(project), "utf8"));
312
+ return validateCompiledRecipeAssetRegistry(JSON.parse(await readFile(resolveProjectRecipeAssetsPath(project), "utf8")));
275
313
  }
276
314
  catch (err) {
277
315
  const code = err?.code;
@@ -25,9 +25,6 @@ export declare function resolveProjectInstalledRecipeDir(resolved: {
25
25
  export declare function resolveProjectRecipesCacheDir(resolved: {
26
26
  agentplaneDir: string;
27
27
  }): string;
28
- export declare function resolveProjectRecipesLockPath(resolved: {
29
- agentplaneDir: string;
30
- }): string;
31
28
  export declare function resolveProjectGeneratedDir(resolved: {
32
29
  agentplaneDir: string;
33
30
  }): string;
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/paths.ts"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C;AAED,wBA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aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE3F;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE1F"}
@@ -40,9 +40,6 @@ export function resolveProjectInstalledRecipeDir(resolved, recipeId) {
40
40
  export function resolveProjectRecipesCacheDir(resolved) {
41
41
  return path.join(resolved.agentplaneDir, PROJECT_RECIPES_CACHE_DIR_NAME);
42
42
  }
43
- export function resolveProjectRecipesLockPath(resolved) {
44
- return path.join(resolved.agentplaneDir, "recipes.lock.json");
45
- }
46
43
  export function resolveProjectGeneratedDir(resolved) {
47
44
  return path.join(resolved.agentplaneDir, "generated");
48
45
  }
@@ -1,4 +1,7 @@
1
- import type { ProjectInstalledRecipesFile } from "./types.js";
1
+ import { type ProjectInstalledRecipesFile, type ProjectRecipesRegistryFile } from "@agentplaneorg/recipes";
2
+ export declare function readProjectInstalledRecipesFromRegistry(opts: {
3
+ agentplaneDir: string;
4
+ }, registry: ProjectRecipesRegistryFile): Promise<ProjectInstalledRecipesFile>;
2
5
  export declare function readProjectInstalledRecipes(opts: {
3
6
  agentplaneDir: string;
4
7
  }): Promise<ProjectInstalledRecipesFile>;
@@ -1 +1 @@
1
- {"version":3,"file":"project-installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-installed-recipes.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAA+B,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAiB3F,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CA8CvC"}
1
+ {"version":3,"file":"project-installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-installed-recipes.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAChC,MAAM,wBAAwB,CAAC;AAqBhC,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAC/B,QAAQ,EAAE,0BAA0B,GACnC,OAAO,CAAC,2BAA2B,CAAC,CA6CtC;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAGvC"}
@@ -1,9 +1,8 @@
1
1
  import { stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import { normalizeRecipeTags, readRecipeManifest, } from "@agentplaneorg/recipes";
3
4
  import { invalidFieldMessage, missingFileMessage } from "../../../cli/output.js";
4
- import { normalizeRecipeTags } from "./normalize.js";
5
5
  import { readProjectRecipesRegistry } from "./project-registry.js";
6
- import { readRecipeManifest } from "./manifest.js";
7
6
  import { resolveProjectRecipesDir } from "./paths.js";
8
7
  function sortInstalledRecipes(entries) {
9
8
  return [...entries].toSorted((left, right) => left.id.localeCompare(right.id));
@@ -17,8 +16,7 @@ async function pathExistsAsKind(filePath, kind) {
17
16
  return false;
18
17
  }
19
18
  }
20
- export async function readProjectInstalledRecipes(opts) {
21
- const registry = await readProjectRecipesRegistry(opts);
19
+ export async function readProjectInstalledRecipesFromRegistry(opts, registry) {
22
20
  if (registry.recipes.length === 0) {
23
21
  return { schema_version: 1, updated_at: "", recipes: [] };
24
22
  }
@@ -56,3 +54,7 @@ export async function readProjectInstalledRecipes(opts) {
56
54
  recipes: sortInstalledRecipes(entries),
57
55
  };
58
56
  }
57
+ export async function readProjectInstalledRecipes(opts) {
58
+ const registry = await readProjectRecipesRegistry(opts);
59
+ return await readProjectInstalledRecipesFromRegistry(opts, registry);
60
+ }
@@ -1,4 +1,4 @@
1
- import type { ProjectInstalledRecipeEntry, ProjectRecipeState } from "./types.js";
1
+ import type { ProjectInstalledRecipeEntry, ProjectRecipeState } from "@agentplaneorg/recipes";
2
2
  export declare function hashRecipeTree(rootDir: string): Promise<string>;
3
3
  export type ProjectRecipeInspection = {
4
4
  entry: ProjectInstalledRecipeEntry;
@@ -1 +1 @@
1
- {"version":3,"file":"project-recipe-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-recipe-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA+BlF,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAIrE;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AA2BF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAwCnC"}
1
+ {"version":3,"file":"project-recipe-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-recipe-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AA+B9F,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAIrE;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AA2BF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAwCnC"}
@@ -1,4 +1,8 @@
1
- import type { ProjectRecipeRegistryEntry, ProjectRecipesRegistryFile } from "./types.js";
1
+ import { type ProjectRecipeRegistryEntry, type ProjectRecipesRegistryFile } from "@agentplaneorg/recipes";
2
+ export declare function stampProjectRecipesRegistry(file: ProjectRecipesRegistryFile, updatedAt?: string): ProjectRecipesRegistryFile;
3
+ export declare function replaceProjectRecipeRegistryEntry(registry: ProjectRecipesRegistryFile, entry: ProjectRecipeRegistryEntry): ProjectRecipesRegistryFile;
4
+ export declare function removeProjectRecipeRegistryEntryFromFile(registry: ProjectRecipesRegistryFile, recipeId: string): ProjectRecipesRegistryFile;
5
+ export declare function setProjectRecipeActiveInFile(registry: ProjectRecipesRegistryFile, recipeId: string, active: boolean): ProjectRecipesRegistryFile;
2
6
  export declare function readProjectRecipesRegistry(opts: {
3
7
  agentplaneDir: string;
4
8
  }): Promise<ProjectRecipesRegistryFile>;
@@ -1 +1 @@
1
- {"version":3,"file":"project-registry.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAEV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAsDpB,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAwBtC;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAC/B,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,0BAA0B,CAAC;CACnC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAOtC;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAStC"}
1
+ {"version":3,"file":"project-registry.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/project-registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAChC,MAAM,wBAAwB,CAAC;AA2DhC,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,0BAA0B,EAChC,SAAS,SAA2B,GACnC,0BAA0B,CAM5B;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,0BAA0B,EACpC,KAAK,EAAE,0BAA0B,GAChC,0BAA0B,CAQ5B;AAED,wBAAgB,wCAAwC,CACtD,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,MAAM,GACf,0BAA0B,CAM5B;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,GACd,0BAA0B,CAQ5B;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAwBtC;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAC/B,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,0BAA0B,CAAC;CACnC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAKtC;AAED,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAKtC"}
@@ -1,9 +1,9 @@
1
1
  import { mkdir, readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import { normalizeRecipeId, normalizeRecipeTags, } from "@agentplaneorg/recipes";
3
4
  import { invalidFieldMessage } from "../../../cli/output.js";
4
5
  import { isRecord } from "../../../shared/guards.js";
5
6
  import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
6
- import { normalizeRecipeId, normalizeRecipeTags } from "./normalize.js";
7
7
  import { resolveProjectRecipesRegistryPath } from "./paths.js";
8
8
  function validateMaterialization(raw) {
9
9
  if (raw === "copy" || raw === "link")
@@ -49,6 +49,36 @@ function sortRegistry(file) {
49
49
  recipes: [...file.recipes].toSorted((left, right) => left.id.localeCompare(right.id)),
50
50
  };
51
51
  }
52
+ export function stampProjectRecipesRegistry(file, updatedAt = new Date().toISOString()) {
53
+ return sortRegistry({
54
+ schema_version: 1,
55
+ updated_at: updatedAt,
56
+ recipes: file.recipes,
57
+ });
58
+ }
59
+ export function replaceProjectRecipeRegistryEntry(registry, entry) {
60
+ const recipes = registry.recipes.filter((candidate) => candidate.id !== entry.id);
61
+ recipes.push(entry);
62
+ return sortRegistry({
63
+ schema_version: 1,
64
+ updated_at: registry.updated_at,
65
+ recipes,
66
+ });
67
+ }
68
+ export function removeProjectRecipeRegistryEntryFromFile(registry, recipeId) {
69
+ return sortRegistry({
70
+ schema_version: 1,
71
+ updated_at: registry.updated_at,
72
+ recipes: registry.recipes.filter((entry) => entry.id !== recipeId),
73
+ });
74
+ }
75
+ export function setProjectRecipeActiveInFile(registry, recipeId, active) {
76
+ return sortRegistry({
77
+ schema_version: 1,
78
+ updated_at: registry.updated_at,
79
+ recipes: registry.recipes.map((entry) => entry.id === recipeId ? { ...entry, active } : entry),
80
+ });
81
+ }
52
82
  export async function readProjectRecipesRegistry(opts) {
53
83
  try {
54
84
  const raw = JSON.parse(await readFile(resolveProjectRecipesRegistryPath(opts), "utf8"));
@@ -75,30 +105,20 @@ export async function readProjectRecipesRegistry(opts) {
75
105
  }
76
106
  }
77
107
  export async function writeProjectRecipesRegistry(opts, file) {
78
- const sorted = sortRegistry({
79
- schema_version: 1,
80
- updated_at: new Date().toISOString(),
81
- recipes: file.recipes,
82
- });
108
+ const sorted = stampProjectRecipesRegistry(file);
83
109
  const filePath = resolveProjectRecipesRegistryPath(opts);
84
110
  await mkdir(path.dirname(filePath), { recursive: true });
85
111
  await writeJsonStableIfChanged(filePath, sorted);
86
112
  }
87
113
  export async function upsertProjectRecipeRegistryEntry(opts) {
88
114
  const registry = await readProjectRecipesRegistry(opts.project);
89
- const recipes = registry.recipes.filter((entry) => entry.id !== opts.entry.id);
90
- recipes.push(opts.entry);
91
- const next = { schema_version: 1, updated_at: registry.updated_at, recipes };
115
+ const next = replaceProjectRecipeRegistryEntry(registry, opts.entry);
92
116
  await writeProjectRecipesRegistry(opts.project, next);
93
117
  return readProjectRecipesRegistry(opts.project);
94
118
  }
95
119
  export async function removeProjectRecipeRegistryEntry(opts) {
96
120
  const registry = await readProjectRecipesRegistry(opts.project);
97
- const next = {
98
- schema_version: 1,
99
- updated_at: registry.updated_at,
100
- recipes: registry.recipes.filter((entry) => entry.id !== opts.recipeId),
101
- };
121
+ const next = removeProjectRecipeRegistryEntryFromFile(registry, opts.recipeId);
102
122
  await writeProjectRecipesRegistry(opts.project, next);
103
123
  return readProjectRecipesRegistry(opts.project);
104
124
  }
@@ -1,5 +1,5 @@
1
1
  import type { ResolvedProject } from "@agentplaneorg/core";
2
- import { type RecipeCompatibility, type RecipeResolverCompatibility, type RecipeResolverContext, type RecipeScenarioDescriptor, type ResolveRecipeScenarioSelectionFlags, type ResolvedRecipeRunProfile, type ResolvedRecipeScenario, type ResolvedRecipeScenarioSelection } from "./types.js";
2
+ import { type RecipeCompatibility, type RecipeResolverCompatibility, type RecipeResolverContext, type RecipeScenarioDescriptor, type ResolveRecipeScenarioSelectionFlags, type ResolvedRecipeRunProfile, type ResolvedRecipeScenario, type ResolvedRecipeScenarioSelection } from "@agentplaneorg/recipes";
3
3
  export declare function buildRecipeResolverContext(opts: {
4
4
  project: ResolvedProject;
5
5
  }): Promise<RecipeResolverContext>;
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/resolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAEhC,KAAK,qBAAqB,EAE1B,KAAK,wBAAwB,EAE7B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACrC,MAAM,YAAY,CAAC;AA+BpB,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,OAAO,EAAE,eAAe,CAAC;CAC1B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CASjC;AAYD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,OAAO,EAAE,qBAAqB,CAAC;CAChC,GAAG,2BAA2B,CAkG9B;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,wBAAwB,GACjC,wBAAwB,CAO1B;AAqDD,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,MAA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AmC,CAAC;CAC5C,GAAG,OAAO,CAAC,+BAA+B,CAAC,CA6D3C"}
@@ -1,11 +1,11 @@
1
1
  import path from "node:path";
2
+ import { readScenarioDefinition, } from "@agentplaneorg/recipes";
2
3
  import { fileExists } from "../../../cli/fs-utils.js";
3
4
  import { getVersion } from "../../../meta/version.js";
4
5
  import { dedupeStrings } from "../../../shared/strings.js";
5
6
  import { compareVersions } from "../../../shared/version-compare.js";
6
7
  import { resolveProjectRecipesDir, resolveProjectInstalledRecipeDir } from "./paths.js";
7
8
  import { readProjectInstalledRecipes } from "./project-installed-recipes.js";
8
- import { readScenarioDefinition } from "./scenario.js";
9
9
  const SUPPORTED_MANIFEST_API_VERSION = "1";
10
10
  const SUPPORTED_SCENARIO_API_VERSION = "1";
11
11
  const SUPPORTED_RUNTIME_API_VERSION = "1";
@@ -1,4 +1,4 @@
1
- export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, CompiledOverlayPromptFragment, CompiledOverlayTraceEntry, CompiledOverlayValidator, InstalledRecipeEntry, InstalledRecipesFile, OverlayPromptFragment, OverlayStrength, OverlaySurface, OverlayValidator, OverlayWhen, ProjectOverlayManifestV2, ProjectInstalledRecipeEntry, ProjectInstalledRecipesFile, ProjectRecipeMaterialization, ProjectRecipeRegistryEntry, ProjectRecipesRegistryFile, ProjectRecipeState, ProjectRecipesLockEntry, ProjectRecipesLockFile, RecipeAgentDefinition, RecipeCompatibility, RecipeConflictMode, RecipeInstallSource, RecipeKind, RecipeManifest, RecipeResolverCompatibility, RecipeResolverCompatibilityFailure, RecipeResolverContext, RecipeRunProfile, RecipeScenarioDescriptor, RecipeScenarioDetail, RecipeSkillDefinition, RecipeTaskTemplate, RecipeTaskTemplateDoc, RecipeToolDefinition, RecipesIndex, RecipesIndexSignature, ResolveRecipeScenarioSelectionFlags, ResolvedRecipeRunProfile, ResolvedRecipeScenario, ResolvedRecipeScenarioSelection, ScenarioDefinition, } from "@agentplaneorg/recipes";
1
+ export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, CompiledOverlayPromptFragment, CompiledOverlayTraceEntry, CompiledOverlayValidator, InstalledRecipeEntry, InstalledRecipesFile, OverlayPromptFragment, OverlayStrength, OverlaySurface, OverlayValidator, OverlayWhen, ProjectOverlayManifestV2, ProjectInstalledRecipeEntry, ProjectInstalledRecipesFile, ProjectRecipeMaterialization, ProjectRecipeRegistryEntry, ProjectRecipesRegistryFile, ProjectRecipeState, RecipeAgentDefinition, RecipeCompatibility, RecipeConflictMode, RecipeInstallSource, RecipeKind, RecipeManifest, RecipeResolverCompatibility, RecipeResolverCompatibilityFailure, RecipeResolverContext, RecipeRunProfile, RecipeScenarioDescriptor, RecipeScenarioDetail, RecipeSkillDefinition, RecipeTaskTemplate, RecipeTaskTemplateDoc, RecipeToolDefinition, RecipesIndex, RecipesIndexSignature, ResolveRecipeScenarioSelectionFlags, ResolvedRecipeRunProfile, ResolvedRecipeScenario, ResolvedRecipeScenarioSelection, ScenarioDefinition, } from "@agentplaneorg/recipes";
2
2
  export type RecipeCachePruneFlags = {
3
3
  dryRun: boolean;
4
4
  all: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,2BAA2B,EAC3B,kCAAkC,EAClC,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,mCAAmC,EACnC,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;CACd,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,2BAA2B,EAC3B,kCAAkC,EAClC,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,mCAAmC,EACnC,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;CACd,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function compareRecipeVersions(left: string, right: string): number;
2
+ export declare function pickLatestRecipeVersion<T extends {
3
+ version: string;
4
+ }>(entries: readonly T[]): T | undefined;
5
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/version.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EACnE,OAAO,EAAE,SAAS,CAAC,EAAE,GACpB,CAAC,GAAG,SAAS,CAIf"}
@@ -0,0 +1,9 @@
1
+ import { compareVersions } from "../../../shared/version-compare.js";
2
+ export function compareRecipeVersions(left, right) {
3
+ return compareVersions(left, right);
4
+ }
5
+ export function pickLatestRecipeVersion(entries) {
6
+ return [...entries]
7
+ .toSorted((left, right) => compareRecipeVersions(left.version, right.version))
8
+ .at(-1);
9
+ }
@@ -1,13 +1,14 @@
1
1
  export { RECIPES_DIR_NAME, RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME, RECIPE_RUNS_DIR_NAME, } from "./recipes/impl/constants.js";
2
- export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, RecipeCachePruneFlags, RecipeConflictMode, RecipeInstallSource, RecipeKind, RecipeListFlags, RecipeListRemoteFlags, RecipeResolverCompatibility, RecipeResolverCompatibilityFailure, RecipeResolverContext, ProjectOverlayManifestV2, ResolveRecipeScenarioSelectionFlags, ResolvedRecipeRunProfile, ResolvedRecipeScenario, ResolvedRecipeScenarioSelection, ScenarioDefinition, } from "./recipes/impl/types.js";
3
- export { readRecipeManifest } from "./recipes/impl/manifest.js";
2
+ export type { CompiledRecipeAssetEntry, CompiledRecipeAssetRegistry, CompiledOverlayBundle, RecipeConflictMode, RecipeInstallSource, RecipeKind, RecipeResolverCompatibility, RecipeResolverCompatibilityFailure, RecipeResolverContext, ProjectOverlayManifestV2, ResolveRecipeScenarioSelectionFlags, ResolvedRecipeRunProfile, ResolvedRecipeScenario, ResolvedRecipeScenarioSelection, ScenarioDefinition, } from "@agentplaneorg/recipes";
3
+ export type { RecipeCachePruneFlags, RecipeListFlags, RecipeListRemoteFlags, } from "./recipes/impl/types.js";
4
+ export { readRecipeManifest, validateRecipeManifest } from "@agentplaneorg/recipes";
4
5
  export { readInstalledRecipesFile } from "./recipes/impl/installed-recipes.js";
5
6
  export { readProjectInstalledRecipes } from "./recipes/impl/project-installed-recipes.js";
6
7
  export { readProjectRecipesRegistry, removeProjectRecipeRegistryEntry, upsertProjectRecipeRegistryEntry, writeProjectRecipesRegistry, } from "./recipes/impl/project-registry.js";
7
8
  export { hashRecipeTree, inspectProjectRecipe } from "./recipes/impl/project-recipe-state.js";
8
9
  export { compileProjectOverlayArtifacts, readActiveRecipeIds, readProjectOverlayBundle, readProjectRecipeAssetRegistry, refreshProjectOverlayArtifacts, setRecipeActive, } from "./recipes/impl/overlay-project.js";
9
- export { resolveProjectRecipesPackagesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesLockPath, resolveProjectRecipesDir, resolveProjectRecipesCacheDir, resolveProjectRecipesRegistryPath, resolveProjectVendoredRecipeDir, } from "./recipes/impl/paths.js";
10
- export { collectRecipeScenarioDetails, normalizeScenarioToolStep, readScenarioDefinition, readScenarioIndex, } from "./recipes/impl/scenario.js";
10
+ export { resolveProjectRecipesPackagesDir, resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectInstalledRecipeDir, resolveProjectOverlayBundlePath, resolveProjectRecipeAssetsPath, resolveProjectRecipesDir, resolveProjectRecipesCacheDir, resolveProjectRecipesRegistryPath, resolveProjectVendoredRecipeDir, } from "./recipes/impl/paths.js";
11
+ export { collectRecipeScenarioDetails, normalizeScenarioToolStep, readScenarioDefinition, readScenarioIndex, } from "@agentplaneorg/recipes";
11
12
  export { buildRecipeResolverContext, listResolvedRecipeScenarios, normalizeResolvedRecipeRunProfile, resolveRecipeCompatibility, resolveRecipeScenarioSelection, } from "./recipes/impl/resolver.js";
12
13
  export { cmdRecipeAddParsed, cmdRecipeActiveParsed, cmdRecipeCachePruneParsed, cmdRecipeDisableParsed, cmdRecipeEnableParsed, cmdRecipeExplainActiveParsed, cmdRecipeExplainParsed, cmdRecipeInfoParsed, cmdRecipeInstall, cmdRecipeListParsed, cmdRecipeListRemoteParsed, cmdRecipeDetachParsed, cmdRecipeRemoveParsed, cmdRecipeUpdateParsed, } from "./recipes/impl/commands.js";
13
14
  //# sourceMappingURL=recipes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/commands/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,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