@lesliechan721/aw 0.1.0-beta.3

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 (429) hide show
  1. package/dist/authoring/assets/aw-config.d.mts +2 -0
  2. package/dist/authoring/assets/aw-config.mjs +556 -0
  3. package/dist/authoring/assets/aw-config.mjs.map +1 -0
  4. package/dist/authoring/scripts/add-skill.d.mts +2 -0
  5. package/dist/authoring/scripts/add-skill.mjs +355 -0
  6. package/dist/authoring/scripts/add-skill.mjs.map +1 -0
  7. package/dist/authoring/scripts/check-plugin-versions.d.mts +2 -0
  8. package/dist/authoring/scripts/check-plugin-versions.mjs +5 -0
  9. package/dist/authoring/scripts/check-plugin-versions.mjs.map +1 -0
  10. package/dist/authoring/scripts/init-plugin.d.mts +2 -0
  11. package/dist/authoring/scripts/init-plugin.mjs +512 -0
  12. package/dist/authoring/scripts/init-plugin.mjs.map +1 -0
  13. package/dist/authoring/scripts/lib/javascript-import-scanner.d.mts +4 -0
  14. package/dist/authoring/scripts/lib/javascript-import-scanner.mjs +261 -0
  15. package/dist/authoring/scripts/lib/javascript-import-scanner.mjs.map +1 -0
  16. package/dist/authoring/scripts/lib/plugin-root.d.mts +26 -0
  17. package/dist/authoring/scripts/lib/plugin-root.mjs +125 -0
  18. package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -0
  19. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +55 -0
  20. package/dist/authoring/scripts/lib/plugin-version-check.mjs +777 -0
  21. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -0
  22. package/dist/authoring/scripts/lib/semver.d.mts +9 -0
  23. package/dist/authoring/scripts/lib/semver.mjs +63 -0
  24. package/dist/authoring/scripts/lib/semver.mjs.map +1 -0
  25. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +124 -0
  26. package/dist/authoring/scripts/lib/skill-scaffold.mjs +374 -0
  27. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -0
  28. package/dist/authoring/scripts/plugin-status.d.mts +2 -0
  29. package/dist/authoring/scripts/plugin-status.mjs +96 -0
  30. package/dist/authoring/scripts/plugin-status.mjs.map +1 -0
  31. package/dist/authoring/scripts/validate-plugin.d.mts +2 -0
  32. package/dist/authoring/scripts/validate-plugin.mjs +4442 -0
  33. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -0
  34. package/dist/authoring/scripts/validate-skill.d.mts +2 -0
  35. package/dist/authoring/scripts/validate-skill.mjs +126 -0
  36. package/dist/authoring/scripts/validate-skill.mjs.map +1 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.js +8 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/scripts/aw-skill-eval-engine.d.ts +13 -0
  41. package/dist/scripts/aw-skill-eval-engine.js +31 -0
  42. package/dist/scripts/aw-skill-eval-engine.js.map +1 -0
  43. package/dist/scripts/bundle-plugins.d.ts +18 -0
  44. package/dist/scripts/bundle-plugins.js +123 -0
  45. package/dist/scripts/bundle-plugins.js.map +1 -0
  46. package/dist/scripts/codex-eval-app-server.d.ts +89 -0
  47. package/dist/scripts/codex-eval-app-server.js +1228 -0
  48. package/dist/scripts/codex-eval-app-server.js.map +1 -0
  49. package/dist/scripts/codex-eval-isolation.d.ts +61 -0
  50. package/dist/scripts/codex-eval-isolation.js +318 -0
  51. package/dist/scripts/codex-eval-isolation.js.map +1 -0
  52. package/dist/scripts/codex-eval-process-management.d.ts +8 -0
  53. package/dist/scripts/codex-eval-process-management.js +69 -0
  54. package/dist/scripts/codex-eval-process-management.js.map +1 -0
  55. package/dist/scripts/codex-eval-process-tree.d.ts +38 -0
  56. package/dist/scripts/codex-eval-process-tree.js +803 -0
  57. package/dist/scripts/codex-eval-process-tree.js.map +1 -0
  58. package/dist/scripts/codex-eval-runtime-config.d.ts +62 -0
  59. package/dist/scripts/codex-eval-runtime-config.js +843 -0
  60. package/dist/scripts/codex-eval-runtime-config.js.map +1 -0
  61. package/dist/scripts/codex-trigger-eval.d.ts +84 -0
  62. package/dist/scripts/codex-trigger-eval.js +968 -0
  63. package/dist/scripts/codex-trigger-eval.js.map +1 -0
  64. package/dist/scripts/eval-plugin-skills-audited.d.ts +6 -0
  65. package/dist/scripts/eval-plugin-skills-audited.js +261 -0
  66. package/dist/scripts/eval-plugin-skills-audited.js.map +1 -0
  67. package/dist/scripts/eval-plugin-skills.d.ts +45 -0
  68. package/dist/scripts/eval-plugin-skills.js +1586 -0
  69. package/dist/scripts/eval-plugin-skills.js.map +1 -0
  70. package/dist/scripts/eval-run-layout.d.ts +17 -0
  71. package/dist/scripts/eval-run-layout.js +26 -0
  72. package/dist/scripts/eval-run-layout.js.map +1 -0
  73. package/dist/scripts/plugin-eval-contract.d.ts +185 -0
  74. package/dist/scripts/plugin-eval-contract.js +695 -0
  75. package/dist/scripts/plugin-eval-contract.js.map +1 -0
  76. package/dist/scripts/plugin-eval-materializer.d.ts +13 -0
  77. package/dist/scripts/plugin-eval-materializer.js +421 -0
  78. package/dist/scripts/plugin-eval-materializer.js.map +1 -0
  79. package/dist/scripts/plugin-staging.d.ts +43 -0
  80. package/dist/scripts/plugin-staging.js +196 -0
  81. package/dist/scripts/plugin-staging.js.map +1 -0
  82. package/dist/scripts/skill-reporting.d.ts +212 -0
  83. package/dist/scripts/skill-reporting.js +922 -0
  84. package/dist/scripts/skill-reporting.js.map +1 -0
  85. package/dist/scripts/test-plugin-scripts.d.ts +7 -0
  86. package/dist/scripts/test-plugin-scripts.js +674 -0
  87. package/dist/scripts/test-plugin-scripts.js.map +1 -0
  88. package/dist/src/adapters/helpers.d.ts +44 -0
  89. package/dist/src/adapters/helpers.js +95 -0
  90. package/dist/src/adapters/helpers.js.map +1 -0
  91. package/dist/src/authoring/workspace-commands.d.ts +46 -0
  92. package/dist/src/authoring/workspace-commands.js +133 -0
  93. package/dist/src/authoring/workspace-commands.js.map +1 -0
  94. package/dist/src/commands/catalog-publish.d.ts +33 -0
  95. package/dist/src/commands/catalog-publish.js +374 -0
  96. package/dist/src/commands/catalog-publish.js.map +1 -0
  97. package/dist/src/commands/catalog-source.d.ts +111 -0
  98. package/dist/src/commands/catalog-source.js +266 -0
  99. package/dist/src/commands/catalog-source.js.map +1 -0
  100. package/dist/src/commands/console.d.ts +3 -0
  101. package/dist/src/commands/console.js +44 -0
  102. package/dist/src/commands/console.js.map +1 -0
  103. package/dist/src/commands/dependency-operation-plan.d.ts +28 -0
  104. package/dist/src/commands/dependency-operation-plan.js +15 -0
  105. package/dist/src/commands/dependency-operation-plan.js.map +1 -0
  106. package/dist/src/commands/init.d.ts +31 -0
  107. package/dist/src/commands/init.js +63 -0
  108. package/dist/src/commands/init.js.map +1 -0
  109. package/dist/src/commands/options.d.ts +68 -0
  110. package/dist/src/commands/options.js +146 -0
  111. package/dist/src/commands/options.js.map +1 -0
  112. package/dist/src/commands/rebuild-command.d.ts +77 -0
  113. package/dist/src/commands/rebuild-command.js +1681 -0
  114. package/dist/src/commands/rebuild-command.js.map +1 -0
  115. package/dist/src/commands/rebuild-integration.d.ts +94 -0
  116. package/dist/src/commands/rebuild-integration.js +3289 -0
  117. package/dist/src/commands/rebuild-integration.js.map +1 -0
  118. package/dist/src/commands/rebuild-operations.d.ts +110 -0
  119. package/dist/src/commands/rebuild-operations.js +791 -0
  120. package/dist/src/commands/rebuild-operations.js.map +1 -0
  121. package/dist/src/commands/review-publication.d.ts +99 -0
  122. package/dist/src/commands/review-publication.js +904 -0
  123. package/dist/src/commands/review-publication.js.map +1 -0
  124. package/dist/src/commands/runtime.d.ts +176 -0
  125. package/dist/src/commands/runtime.js +746 -0
  126. package/dist/src/commands/runtime.js.map +1 -0
  127. package/dist/src/commands/status-v4.d.ts +102 -0
  128. package/dist/src/commands/status-v4.js +844 -0
  129. package/dist/src/commands/status-v4.js.map +1 -0
  130. package/dist/src/commands/status.d.ts +93 -0
  131. package/dist/src/commands/status.js +442 -0
  132. package/dist/src/commands/status.js.map +1 -0
  133. package/dist/src/commands/wizard.d.ts +57 -0
  134. package/dist/src/commands/wizard.js +58 -0
  135. package/dist/src/commands/wizard.js.map +1 -0
  136. package/dist/src/commands/write-commands.d.ts +7 -0
  137. package/dist/src/commands/write-commands.js +167 -0
  138. package/dist/src/commands/write-commands.js.map +1 -0
  139. package/dist/src/constants.d.ts +25 -0
  140. package/dist/src/constants.js +26 -0
  141. package/dist/src/constants.js.map +1 -0
  142. package/dist/src/generators/agents.d.ts +3 -0
  143. package/dist/src/generators/agents.js +46 -0
  144. package/dist/src/generators/agents.js.map +1 -0
  145. package/dist/src/generators/hooks.d.ts +15 -0
  146. package/dist/src/generators/hooks.js +76 -0
  147. package/dist/src/generators/hooks.js.map +1 -0
  148. package/dist/src/generators/instructions.d.ts +13 -0
  149. package/dist/src/generators/instructions.js +66 -0
  150. package/dist/src/generators/instructions.js.map +1 -0
  151. package/dist/src/generators/local-plugin.d.ts +53 -0
  152. package/dist/src/generators/local-plugin.js +1268 -0
  153. package/dist/src/generators/local-plugin.js.map +1 -0
  154. package/dist/src/generators/permissions.d.ts +10 -0
  155. package/dist/src/generators/permissions.js +37 -0
  156. package/dist/src/generators/permissions.js.map +1 -0
  157. package/dist/src/generators/shared.d.ts +2 -0
  158. package/dist/src/generators/shared.js +15 -0
  159. package/dist/src/generators/shared.js.map +1 -0
  160. package/dist/src/index.d.ts +35 -0
  161. package/dist/src/index.js +2344 -0
  162. package/dist/src/index.js.map +1 -0
  163. package/dist/src/output/command-receipt.d.ts +90 -0
  164. package/dist/src/output/command-receipt.js +129 -0
  165. package/dist/src/output/command-receipt.js.map +1 -0
  166. package/dist/src/output/debug-log.d.ts +4 -0
  167. package/dist/src/output/debug-log.js +97 -0
  168. package/dist/src/output/debug-log.js.map +1 -0
  169. package/dist/src/output/equivalent-command.d.ts +9 -0
  170. package/dist/src/output/equivalent-command.js +39 -0
  171. package/dist/src/output/equivalent-command.js.map +1 -0
  172. package/dist/src/output/model.d.ts +117 -0
  173. package/dist/src/output/model.js +145 -0
  174. package/dist/src/output/model.js.map +1 -0
  175. package/dist/src/output/rebuild-progress.d.ts +21 -0
  176. package/dist/src/output/rebuild-progress.js +138 -0
  177. package/dist/src/output/rebuild-progress.js.map +1 -0
  178. package/dist/src/output/redact.d.ts +3 -0
  179. package/dist/src/output/redact.js +39 -0
  180. package/dist/src/output/redact.js.map +1 -0
  181. package/dist/src/output/reporter.d.ts +9 -0
  182. package/dist/src/output/reporter.js +133 -0
  183. package/dist/src/output/reporter.js.map +1 -0
  184. package/dist/src/portable/commands.d.ts +120 -0
  185. package/dist/src/portable/commands.js +506 -0
  186. package/dist/src/portable/commands.js.map +1 -0
  187. package/dist/src/portable/materializer.d.ts +50 -0
  188. package/dist/src/portable/materializer.js +408 -0
  189. package/dist/src/portable/materializer.js.map +1 -0
  190. package/dist/src/portable/skills-cli.d.ts +43 -0
  191. package/dist/src/portable/skills-cli.js +148 -0
  192. package/dist/src/portable/skills-cli.js.map +1 -0
  193. package/dist/src/tui/components.d.ts +32 -0
  194. package/dist/src/tui/components.js +42 -0
  195. package/dist/src/tui/components.js.map +1 -0
  196. package/dist/src/tui/console-app-v4.d.ts +20 -0
  197. package/dist/src/tui/console-app-v4.js +2613 -0
  198. package/dist/src/tui/console-app-v4.js.map +1 -0
  199. package/dist/src/tui/controller-runtime.d.ts +11 -0
  200. package/dist/src/tui/controller-runtime.js +902 -0
  201. package/dist/src/tui/controller-runtime.js.map +1 -0
  202. package/dist/src/tui/controller.d.ts +367 -0
  203. package/dist/src/tui/controller.js +1724 -0
  204. package/dist/src/tui/controller.js.map +1 -0
  205. package/dist/src/tui/index.d.ts +13 -0
  206. package/dist/src/tui/index.js +14 -0
  207. package/dist/src/tui/index.js.map +1 -0
  208. package/dist/src/tui/keys.d.ts +12 -0
  209. package/dist/src/tui/keys.js +22 -0
  210. package/dist/src/tui/keys.js.map +1 -0
  211. package/dist/src/tui/layout.d.ts +12 -0
  212. package/dist/src/tui/layout.js +19 -0
  213. package/dist/src/tui/layout.js.map +1 -0
  214. package/dist/src/tui/model.d.ts +279 -0
  215. package/dist/src/tui/model.js +652 -0
  216. package/dist/src/tui/model.js.map +1 -0
  217. package/dist/src/tui/prompt.d.ts +8 -0
  218. package/dist/src/tui/prompt.js +242 -0
  219. package/dist/src/tui/prompt.js.map +1 -0
  220. package/dist/src/tui/router.d.ts +153 -0
  221. package/dist/src/tui/router.js +102 -0
  222. package/dist/src/tui/router.js.map +1 -0
  223. package/dist/src/tui/runner.d.ts +11 -0
  224. package/dist/src/tui/runner.js +71 -0
  225. package/dist/src/tui/runner.js.map +1 -0
  226. package/dist/src/tui/theme.d.ts +18 -0
  227. package/dist/src/tui/theme.js +20 -0
  228. package/dist/src/tui/theme.js.map +1 -0
  229. package/dist/src/tui/views.d.ts +57 -0
  230. package/dist/src/tui/views.js +173 -0
  231. package/dist/src/tui/views.js.map +1 -0
  232. package/dist/src/tui/wizard.d.ts +11 -0
  233. package/dist/src/tui/wizard.js +321 -0
  234. package/dist/src/tui/wizard.js.map +1 -0
  235. package/dist/src/types.d.ts +313 -0
  236. package/dist/src/types.js +33 -0
  237. package/dist/src/types.js.map +1 -0
  238. package/dist/src/utils/active-marketplace-runtime-lock.d.ts +12 -0
  239. package/dist/src/utils/active-marketplace-runtime-lock.js +133 -0
  240. package/dist/src/utils/active-marketplace-runtime-lock.js.map +1 -0
  241. package/dist/src/utils/agent-version.d.ts +13 -0
  242. package/dist/src/utils/agent-version.js +172 -0
  243. package/dist/src/utils/agent-version.js.map +1 -0
  244. package/dist/src/utils/artifact-plan.d.ts +26 -0
  245. package/dist/src/utils/artifact-plan.js +444 -0
  246. package/dist/src/utils/artifact-plan.js.map +1 -0
  247. package/dist/src/utils/artifact-renderer.d.ts +124 -0
  248. package/dist/src/utils/artifact-renderer.js +442 -0
  249. package/dist/src/utils/artifact-renderer.js.map +1 -0
  250. package/dist/src/utils/artifact-sources.d.ts +8 -0
  251. package/dist/src/utils/artifact-sources.js +10 -0
  252. package/dist/src/utils/artifact-sources.js.map +1 -0
  253. package/dist/src/utils/aw-home-mutation-lock.d.ts +10 -0
  254. package/dist/src/utils/aw-home-mutation-lock.js +55 -0
  255. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -0
  256. package/dist/src/utils/bundle-integrity.d.ts +3 -0
  257. package/dist/src/utils/bundle-integrity.js +88 -0
  258. package/dist/src/utils/bundle-integrity.js.map +1 -0
  259. package/dist/src/utils/bundle-layout.d.ts +4 -0
  260. package/dist/src/utils/bundle-layout.js +546 -0
  261. package/dist/src/utils/bundle-layout.js.map +1 -0
  262. package/dist/src/utils/catalog-digests.d.ts +8 -0
  263. package/dist/src/utils/catalog-digests.js +108 -0
  264. package/dist/src/utils/catalog-digests.js.map +1 -0
  265. package/dist/src/utils/catalog-manifest-v3.d.ts +2 -0
  266. package/dist/src/utils/catalog-manifest-v3.js +3 -0
  267. package/dist/src/utils/catalog-manifest-v3.js.map +1 -0
  268. package/dist/src/utils/catalog-manifest-v4.d.ts +5 -0
  269. package/dist/src/utils/catalog-manifest-v4.js +106 -0
  270. package/dist/src/utils/catalog-manifest-v4.js.map +1 -0
  271. package/dist/src/utils/catalog-public-error.d.ts +15 -0
  272. package/dist/src/utils/catalog-public-error.js +84 -0
  273. package/dist/src/utils/catalog-public-error.js.map +1 -0
  274. package/dist/src/utils/catalog-runtime-projection.d.ts +36 -0
  275. package/dist/src/utils/catalog-runtime-projection.js +172 -0
  276. package/dist/src/utils/catalog-runtime-projection.js.map +1 -0
  277. package/dist/src/utils/catalog-snapshot.d.ts +8 -0
  278. package/dist/src/utils/catalog-snapshot.js +12 -0
  279. package/dist/src/utils/catalog-snapshot.js.map +1 -0
  280. package/dist/src/utils/catalog-source-cache.d.ts +61 -0
  281. package/dist/src/utils/catalog-source-cache.js +276 -0
  282. package/dist/src/utils/catalog-source-cache.js.map +1 -0
  283. package/dist/src/utils/catalog-source-identity.d.ts +4 -0
  284. package/dist/src/utils/catalog-source-identity.js +118 -0
  285. package/dist/src/utils/catalog-source-identity.js.map +1 -0
  286. package/dist/src/utils/catalog-source-presentation.d.ts +1 -0
  287. package/dist/src/utils/catalog-source-presentation.js +32 -0
  288. package/dist/src/utils/catalog-source-presentation.js.map +1 -0
  289. package/dist/src/utils/catalog-source-references.d.ts +65 -0
  290. package/dist/src/utils/catalog-source-references.js +1418 -0
  291. package/dist/src/utils/catalog-source-references.js.map +1 -0
  292. package/dist/src/utils/catalog-sources.d.ts +39 -0
  293. package/dist/src/utils/catalog-sources.js +293 -0
  294. package/dist/src/utils/catalog-sources.js.map +1 -0
  295. package/dist/src/utils/codex-config.d.ts +124 -0
  296. package/dist/src/utils/codex-config.js +1011 -0
  297. package/dist/src/utils/codex-config.js.map +1 -0
  298. package/dist/src/utils/codex-project-surface.d.ts +3 -0
  299. package/dist/src/utils/codex-project-surface.js +49 -0
  300. package/dist/src/utils/codex-project-surface.js.map +1 -0
  301. package/dist/src/utils/codex-roles.d.ts +71 -0
  302. package/dist/src/utils/codex-roles.js +257 -0
  303. package/dist/src/utils/codex-roles.js.map +1 -0
  304. package/dist/src/utils/codex-skill-staging.d.ts +9 -0
  305. package/dist/src/utils/codex-skill-staging.js +8 -0
  306. package/dist/src/utils/codex-skill-staging.js.map +1 -0
  307. package/dist/src/utils/config-value.d.ts +3 -0
  308. package/dist/src/utils/config-value.js +23 -0
  309. package/dist/src/utils/config-value.js.map +1 -0
  310. package/dist/src/utils/dynamic-skill-tree.d.ts +32 -0
  311. package/dist/src/utils/dynamic-skill-tree.js +436 -0
  312. package/dist/src/utils/dynamic-skill-tree.js.map +1 -0
  313. package/dist/src/utils/file-rules.d.ts +1 -0
  314. package/dist/src/utils/file-rules.js +2 -0
  315. package/dist/src/utils/file-rules.js.map +1 -0
  316. package/dist/src/utils/git-catalog-provider.d.ts +7 -0
  317. package/dist/src/utils/git-catalog-provider.js +510 -0
  318. package/dist/src/utils/git-catalog-provider.js.map +1 -0
  319. package/dist/src/utils/hooks-contract.d.ts +1 -0
  320. package/dist/src/utils/hooks-contract.js +2 -0
  321. package/dist/src/utils/hooks-contract.js.map +1 -0
  322. package/dist/src/utils/json.d.ts +4 -0
  323. package/dist/src/utils/json.js +29 -0
  324. package/dist/src/utils/json.js.map +1 -0
  325. package/dist/src/utils/lifecycle-active-store.d.ts +175 -0
  326. package/dist/src/utils/lifecycle-active-store.js +1276 -0
  327. package/dist/src/utils/lifecycle-active-store.js.map +1 -0
  328. package/dist/src/utils/local-marketplace.d.ts +41 -0
  329. package/dist/src/utils/local-marketplace.js +317 -0
  330. package/dist/src/utils/local-marketplace.js.map +1 -0
  331. package/dist/src/utils/manifest.d.ts +14 -0
  332. package/dist/src/utils/manifest.js +36 -0
  333. package/dist/src/utils/manifest.js.map +1 -0
  334. package/dist/src/utils/marketplace.d.ts +3 -0
  335. package/dist/src/utils/marketplace.js +76 -0
  336. package/dist/src/utils/marketplace.js.map +1 -0
  337. package/dist/src/utils/multi-source-catalog.d.ts +72 -0
  338. package/dist/src/utils/multi-source-catalog.js +402 -0
  339. package/dist/src/utils/multi-source-catalog.js.map +1 -0
  340. package/dist/src/utils/native-cli.d.ts +75 -0
  341. package/dist/src/utils/native-cli.js +435 -0
  342. package/dist/src/utils/native-cli.js.map +1 -0
  343. package/dist/src/utils/orphan-marketplace-cleanup.d.ts +18 -0
  344. package/dist/src/utils/orphan-marketplace-cleanup.js +202 -0
  345. package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -0
  346. package/dist/src/utils/ownership.d.ts +130 -0
  347. package/dist/src/utils/ownership.js +766 -0
  348. package/dist/src/utils/ownership.js.map +1 -0
  349. package/dist/src/utils/path-catalog-provider.d.ts +7 -0
  350. package/dist/src/utils/path-catalog-provider.js +87 -0
  351. package/dist/src/utils/path-catalog-provider.js.map +1 -0
  352. package/dist/src/utils/paths.d.ts +41 -0
  353. package/dist/src/utils/paths.js +138 -0
  354. package/dist/src/utils/paths.js.map +1 -0
  355. package/dist/src/utils/platform-entries.d.ts +1 -0
  356. package/dist/src/utils/platform-entries.js +2 -0
  357. package/dist/src/utils/platform-entries.js.map +1 -0
  358. package/dist/src/utils/platform-support.d.ts +1 -0
  359. package/dist/src/utils/platform-support.js +2 -0
  360. package/dist/src/utils/platform-support.js.map +1 -0
  361. package/dist/src/utils/plugin-authoring-capabilities.d.ts +23 -0
  362. package/dist/src/utils/plugin-authoring-capabilities.js +37 -0
  363. package/dist/src/utils/plugin-authoring-capabilities.js.map +1 -0
  364. package/dist/src/utils/plugin-authoring-capabilities.json +92 -0
  365. package/dist/src/utils/plugin-config-write.d.ts +107 -0
  366. package/dist/src/utils/plugin-config-write.js +565 -0
  367. package/dist/src/utils/plugin-config-write.js.map +1 -0
  368. package/dist/src/utils/plugin-config.d.ts +396 -0
  369. package/dist/src/utils/plugin-config.js +1898 -0
  370. package/dist/src/utils/plugin-config.js.map +1 -0
  371. package/dist/src/utils/plugin-dependencies.d.ts +12 -0
  372. package/dist/src/utils/plugin-dependencies.js +162 -0
  373. package/dist/src/utils/plugin-dependencies.js.map +1 -0
  374. package/dist/src/utils/plugin-release.d.ts +2 -0
  375. package/dist/src/utils/plugin-release.js +2 -0
  376. package/dist/src/utils/plugin-release.js.map +1 -0
  377. package/dist/src/utils/plugin-script-contract.d.ts +1 -0
  378. package/dist/src/utils/plugin-script-contract.js +2 -0
  379. package/dist/src/utils/plugin-script-contract.js.map +1 -0
  380. package/dist/src/utils/plugin-scripts.d.ts +172 -0
  381. package/dist/src/utils/plugin-scripts.js +585 -0
  382. package/dist/src/utils/plugin-scripts.js.map +1 -0
  383. package/dist/src/utils/process-lock.d.ts +47 -0
  384. package/dist/src/utils/process-lock.js +532 -0
  385. package/dist/src/utils/process-lock.js.map +1 -0
  386. package/dist/src/utils/process-tree.d.ts +2 -0
  387. package/dist/src/utils/process-tree.js +2 -0
  388. package/dist/src/utils/process-tree.js.map +1 -0
  389. package/dist/src/utils/project-boundary.d.ts +21 -0
  390. package/dist/src/utils/project-boundary.js +95 -0
  391. package/dist/src/utils/project-boundary.js.map +1 -0
  392. package/dist/src/utils/rendered-contract.d.ts +8 -0
  393. package/dist/src/utils/rendered-contract.js +134 -0
  394. package/dist/src/utils/rendered-contract.js.map +1 -0
  395. package/dist/src/utils/runtime-skill-closure.d.ts +13 -0
  396. package/dist/src/utils/runtime-skill-closure.js +863 -0
  397. package/dist/src/utils/runtime-skill-closure.js.map +1 -0
  398. package/dist/src/utils/skill-authoring.d.ts +1 -0
  399. package/dist/src/utils/skill-authoring.js +2 -0
  400. package/dist/src/utils/skill-authoring.js.map +1 -0
  401. package/dist/src/utils/skill-frontmatter-capabilities.d.ts +201 -0
  402. package/dist/src/utils/skill-frontmatter-capabilities.js +5 -0
  403. package/dist/src/utils/skill-frontmatter-capabilities.js.map +1 -0
  404. package/dist/src/utils/skill-frontmatter-capabilities.json +200 -0
  405. package/dist/src/utils/skill-validation.d.ts +37 -0
  406. package/dist/src/utils/skill-validation.js +326 -0
  407. package/dist/src/utils/skill-validation.js.map +1 -0
  408. package/dist/src/utils/slash-commands.d.ts +1 -0
  409. package/dist/src/utils/slash-commands.js +2 -0
  410. package/dist/src/utils/slash-commands.js.map +1 -0
  411. package/dist/src/utils/state-paths.d.ts +13 -0
  412. package/dist/src/utils/state-paths.js +129 -0
  413. package/dist/src/utils/state-paths.js.map +1 -0
  414. package/dist/src/utils/target-eligibility.d.ts +7 -0
  415. package/dist/src/utils/target-eligibility.js +26 -0
  416. package/dist/src/utils/target-eligibility.js.map +1 -0
  417. package/dist/src/utils/target-order.d.ts +7 -0
  418. package/dist/src/utils/target-order.js +10 -0
  419. package/dist/src/utils/target-order.js.map +1 -0
  420. package/dist/src/utils/template-engine.d.ts +1 -0
  421. package/dist/src/utils/template-engine.js +2 -0
  422. package/dist/src/utils/template-engine.js.map +1 -0
  423. package/dist/src/utils/test-path-fence.d.ts +12 -0
  424. package/dist/src/utils/test-path-fence.js +31 -0
  425. package/dist/src/utils/test-path-fence.js.map +1 -0
  426. package/dist/vitest.config.d.ts +2 -0
  427. package/dist/vitest.config.js +16 -0
  428. package/dist/vitest.config.js.map +1 -0
  429. package/package.json +61 -0
@@ -0,0 +1,374 @@
1
+ import crypto from 'node:crypto';
2
+ import { execFile } from 'node:child_process';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ import { promisify } from 'node:util';
6
+ import fs from 'fs-extra';
7
+ import { assertStrictSemVer, preparePublishedWorkspaceCatalog, readPluginWorkspace, validatePublishedCatalogSnapshot, } from '@lesliechan721/aw-plugin-core';
8
+ import { bundleLocalPlugin, createCatalogRuntimeImportResolver } from '../../scripts/plugin-staging.js';
9
+ import { CLI_RESERVED_IMPORTS } from '../utils/manifest.js';
10
+ import { resolveCliPackageRoot } from '../utils/paths.js';
11
+ const execFileAsync = promisify(execFile);
12
+ const LEGACY_ATTEMPTED_MARKER = path.join('.aw', 'publish', 'attempted.json');
13
+ const INHERITED_GIT_AUTH_ENV = new Set([
14
+ 'GIT_ASKPASS',
15
+ 'GIT_HTTP_USER_AGENT',
16
+ 'GIT_SSH',
17
+ 'GIT_SSH_COMMAND',
18
+ 'GIT_SSH_VARIANT',
19
+ 'GIT_SSL_CAINFO',
20
+ 'GIT_SSL_NO_VERIFY',
21
+ 'GIT_TERMINAL_PROMPT',
22
+ ]);
23
+ function digest(value) {
24
+ return `sha256:${crypto.createHash('sha256').update(value).digest('hex')}`;
25
+ }
26
+ export function sanitizedGitEnvironment(source) {
27
+ return Object.fromEntries(Object.entries(source).filter(([key]) => !key.startsWith('GIT_') || INHERITED_GIT_AUTH_ENV.has(key)));
28
+ }
29
+ export function safeRemoteIdentity(value) {
30
+ if (/^[a-z][a-z\d+.-]*:\/\//iu.test(value)) {
31
+ try {
32
+ const url = new URL(value);
33
+ url.username = '';
34
+ url.password = '';
35
+ url.search = '';
36
+ url.hash = '';
37
+ return url.toString();
38
+ }
39
+ catch {
40
+ // Fall through to conservative display sanitization for malformed URLs.
41
+ }
42
+ }
43
+ const withoutQuery = value.split(/[?#]/u, 1)[0];
44
+ return withoutQuery
45
+ .replace(/^([^/@\s:]+):([^/@\s]+)@/u, '')
46
+ .replace(/^[^@\s]+@(?=[^:/\s]+[/:])/u, '');
47
+ }
48
+ function attemptPath(workspaceRoot, catalogVersion) {
49
+ return path.join(workspaceRoot, '.aw', 'publish', 'attempts', `${catalogVersion}.json`);
50
+ }
51
+ async function migrateLegacyAttempt(workspaceRoot, catalogVersion) {
52
+ const legacyPath = path.join(workspaceRoot, LEGACY_ATTEMPTED_MARKER);
53
+ if (!(await fs.pathExists(legacyPath)))
54
+ return;
55
+ let recordedVersion = catalogVersion;
56
+ try {
57
+ const legacy = await fs.readJson(legacyPath);
58
+ if (legacy.schemaVersion === 1 && typeof legacy.catalogVersion === 'string') {
59
+ recordedVersion = assertStrictSemVer(legacy.catalogVersion, 'legacy attempted Catalog version');
60
+ }
61
+ }
62
+ catch {
63
+ // Bind an unreadable legacy marker to the current version. A later version uses a new file.
64
+ }
65
+ const destination = attemptPath(workspaceRoot, recordedVersion);
66
+ await fs.ensureDir(path.dirname(destination));
67
+ if (await fs.pathExists(destination))
68
+ return;
69
+ await fs.rename(legacyPath, destination);
70
+ }
71
+ async function git(cwd, args, env, label) {
72
+ try {
73
+ const result = await execFileAsync('git', [...args], {
74
+ cwd,
75
+ env,
76
+ encoding: 'utf8',
77
+ maxBuffer: 16 * 1024 * 1024,
78
+ });
79
+ return result.stdout.trim();
80
+ }
81
+ catch (error) {
82
+ throw new Error(label, { cause: error });
83
+ }
84
+ }
85
+ async function gitExit(cwd, args, env) {
86
+ try {
87
+ await execFileAsync('git', [...args], { cwd, env, encoding: 'utf8' });
88
+ return true;
89
+ }
90
+ catch {
91
+ return false;
92
+ }
93
+ }
94
+ function parseRemoteRefs(output) {
95
+ return new Map(output.split('\n').filter(Boolean).map((line) => {
96
+ const [objectId, ref] = line.split(/\s+/u);
97
+ return [ref, objectId];
98
+ }));
99
+ }
100
+ async function writeJsonAtomic(filePath, value) {
101
+ await fs.ensureDir(path.dirname(filePath));
102
+ const temporary = path.join(path.dirname(filePath), `.${path.basename(filePath)}.${crypto.randomUUID()}.tmp`);
103
+ await fs.writeFile(temporary, `${JSON.stringify(value, null, 2)}\n`, { flag: 'wx', mode: 0o600 });
104
+ try {
105
+ await fs.rename(temporary, filePath);
106
+ }
107
+ catch (error) {
108
+ await fs.remove(temporary);
109
+ throw error;
110
+ }
111
+ }
112
+ async function clearWorktree(repositoryRoot) {
113
+ for (const name of await fs.readdir(repositoryRoot)) {
114
+ if (name !== '.git')
115
+ await fs.remove(path.join(repositoryRoot, name));
116
+ }
117
+ }
118
+ async function materializeSourceHead(options) {
119
+ const archivePath = path.join(options.temporaryRoot, 'source-head.tar');
120
+ await fs.ensureDir(options.outputRoot);
121
+ await git(options.repoRoot, [
122
+ 'archive', '--format=tar', `--output=${archivePath}`, options.sourceHead,
123
+ ], options.env, 'Could not archive the committed source HEAD.');
124
+ const tarEnv = { ...options.env };
125
+ delete tarEnv.TAR_OPTIONS;
126
+ try {
127
+ await execFileAsync('tar', ['-xf', archivePath, '-C', options.outputRoot], {
128
+ env: tarEnv,
129
+ encoding: 'utf8',
130
+ maxBuffer: 16 * 1024 * 1024,
131
+ });
132
+ }
133
+ catch (error) {
134
+ throw new Error('Could not materialize the committed source HEAD.', { cause: error });
135
+ }
136
+ finally {
137
+ await fs.remove(archivePath);
138
+ }
139
+ }
140
+ async function validatePublishedSourceWorkspace(workspace, env) {
141
+ const validator = path.join(resolveCliPackageRoot(), 'dist', 'authoring', 'scripts', 'validate-plugin.mjs');
142
+ for (const plugin of workspace.plugins) {
143
+ try {
144
+ await execFileAsync(process.execPath, [
145
+ validator,
146
+ plugin.rootDir,
147
+ '--workspace-root', workspace.workspaceRoot,
148
+ '--json',
149
+ ], {
150
+ cwd: workspace.workspaceRoot,
151
+ env,
152
+ encoding: 'utf8',
153
+ maxBuffer: 16 * 1024 * 1024,
154
+ });
155
+ }
156
+ catch (error) {
157
+ let details = '';
158
+ if (typeof error === 'object' && error !== null && 'stdout' in error && typeof error.stdout === 'string') {
159
+ try {
160
+ const result = JSON.parse(error.stdout);
161
+ details = (result.errors ?? [])
162
+ .map((entry) => typeof entry.message === 'string' ? entry.message : '')
163
+ .filter(Boolean)
164
+ .join('; ');
165
+ }
166
+ catch {
167
+ // Keep the public validator failure bounded to its plugin identity.
168
+ }
169
+ }
170
+ throw new Error(`Plugin ${plugin.manifest.name} failed public source validation before Catalog publication${details ? `: ${details}` : '.'}`);
171
+ }
172
+ }
173
+ }
174
+ const publishBuildAdapter = {
175
+ async build(options) {
176
+ await bundleLocalPlugin(options.plugin, options.outputRoot, {
177
+ buildMode: 'staging',
178
+ runtimeResolver: createCatalogRuntimeImportResolver(options.plugins),
179
+ });
180
+ },
181
+ };
182
+ export async function runCatalogPublishCommand(options) {
183
+ if (options.json && !options.yes)
184
+ throw new Error('Catalog publish with --json requires --yes.');
185
+ if (!options.interactive && !options.yes)
186
+ throw new Error('Non-interactive Catalog publish requires --yes.');
187
+ const remote = options.remote ?? 'origin';
188
+ const branch = options.branch ?? 'catalog';
189
+ const env = sanitizedGitEnvironment(options.env);
190
+ const workspaceRoot = await fs.realpath(path.resolve(options.workspaceRoot));
191
+ const repoRoot = await git(workspaceRoot, ['rev-parse', '--show-toplevel'], env, 'Workspace must be inside a real Git worktree.');
192
+ const sourceHead = await git(repoRoot, ['rev-parse', '--verify', 'HEAD'], env, 'Workspace Git HEAD must be committed and not unborn.');
193
+ const status = await git(repoRoot, [
194
+ 'status', '--porcelain=v1', '--untracked-files=all', '--ignore-submodules=none',
195
+ ], env, 'Could not inspect the source worktree.');
196
+ if (status !== '')
197
+ throw new Error('Catalog publish requires the complete source Git worktree to be clean.');
198
+ const temporaryRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'aw-public-catalog-'));
199
+ let fetchUrl = '';
200
+ let pushUrl = '';
201
+ let safeFetchUrl = '';
202
+ let safePushUrl = '';
203
+ try {
204
+ const sourceRoot = path.join(temporaryRoot, 'source');
205
+ await materializeSourceHead({ repoRoot, sourceHead, outputRoot: sourceRoot, temporaryRoot, env });
206
+ const workspaceRelative = path.relative(repoRoot, workspaceRoot);
207
+ if (workspaceRelative === '..' || workspaceRelative.startsWith(`..${path.sep}`) || path.isAbsolute(workspaceRelative)) {
208
+ throw new Error('Catalog workspace must stay inside its Git worktree root.');
209
+ }
210
+ const sourceWorkspaceRoot = path.join(sourceRoot, workspaceRelative);
211
+ await git(repoRoot, ['check-ref-format', '--branch', branch], env, 'Invalid Catalog publication branch name.');
212
+ const workspace = await readPluginWorkspace(sourceWorkspaceRoot, { reservedImports: CLI_RESERVED_IMPORTS });
213
+ await validatePublishedSourceWorkspace(workspace, env);
214
+ const catalogVersion = workspace.metadata.catalog.version;
215
+ const tag = `catalog-v${catalogVersion}`;
216
+ await git(repoRoot, ['check-ref-format', `refs/tags/${tag}`], env, 'Invalid Catalog publication tag.');
217
+ const markerPath = attemptPath(workspaceRoot, catalogVersion);
218
+ if (!(await gitExit(repoRoot, ['check-ignore', '-q', markerPath], env))) {
219
+ throw new Error('Catalog publish state under .aw/publish must be ignored by Git. Add .aw/ to .gitignore.');
220
+ }
221
+ await migrateLegacyAttempt(workspaceRoot, catalogVersion);
222
+ if (await fs.pathExists(markerPath)) {
223
+ throw new Error(`Catalog ${catalogVersion} already has an attempted publication record. `
224
+ + 'Run aw catalog version <higher> before publishing again.');
225
+ }
226
+ fetchUrl = await git(repoRoot, ['remote', 'get-url', remote], env, `Git remote ${JSON.stringify(remote)} is not configured.`);
227
+ pushUrl = await git(repoRoot, ['remote', 'get-url', '--push', remote], env, `Git remote ${JSON.stringify(remote)} has no push URL.`);
228
+ safeFetchUrl = safeRemoteIdentity(fetchUrl);
229
+ safePushUrl = safeRemoteIdentity(pushUrl);
230
+ const remoteIdentityDigest = digest(JSON.stringify({ fetchUrl, pushUrl }));
231
+ const branchRef = `refs/heads/${branch}`;
232
+ const tagRef = `refs/tags/${tag}`;
233
+ const repositoryRoot = path.join(temporaryRoot, 'repository');
234
+ await fs.ensureDir(repositoryRoot);
235
+ await git(repositoryRoot, ['init', '--quiet'], env, 'Could not create the isolated publication repository.');
236
+ await git(repositoryRoot, ['config', 'core.hooksPath', path.join(temporaryRoot, 'disabled-hooks')], env, 'Could not disable publication hooks.');
237
+ await git(repositoryRoot, ['config', 'core.symlinks', 'true'], env, 'Could not configure the isolated publication repository.');
238
+ await git(repositoryRoot, ['remote', 'add', 'publish', pushUrl], env, 'Could not configure the publication remote.');
239
+ const initialRefs = parseRemoteRefs(await git(repositoryRoot, [
240
+ 'ls-remote', 'publish', branchRef, tagRef, `${tagRef}^{}`,
241
+ ], env, 'Could not inspect the Catalog publication remote.'));
242
+ if (initialRefs.has(tagRef) || initialRefs.has(`${tagRef}^{}`)) {
243
+ throw new Error(`Remote Catalog tag ${tag} already exists. Increase the Catalog version.`);
244
+ }
245
+ const parent = initialRefs.get(branchRef) ?? null;
246
+ let previousSnapshotRoot;
247
+ if (parent) {
248
+ await git(repositoryRoot, ['fetch', '--quiet', '--no-tags', 'publish', `${branchRef}:refs/remotes/publish/catalog`], env, 'Could not fetch the published Catalog branch.');
249
+ previousSnapshotRoot = path.join(temporaryRoot, 'previous');
250
+ await fs.ensureDir(previousSnapshotRoot);
251
+ await git(repositoryRoot, ['--work-tree', previousSnapshotRoot, 'checkout', '--quiet', 'refs/remotes/publish/catalog', '--', '.'], env, 'Could not read the published Catalog snapshot.');
252
+ await validatePublishedCatalogSnapshot(previousSnapshotRoot);
253
+ }
254
+ const prepared = await preparePublishedWorkspaceCatalog({
255
+ workspaceRoot: sourceWorkspaceRoot,
256
+ sourceHead,
257
+ previousSnapshotRoot,
258
+ adapter: publishBuildAdapter,
259
+ reservedImports: CLI_RESERVED_IMPORTS,
260
+ });
261
+ const preparedHead = await git(repoRoot, ['rev-parse', '--verify', 'HEAD'], env, 'Could not recheck the source Git HEAD.');
262
+ const preparedStatus = await git(repoRoot, [
263
+ 'status', '--porcelain=v1', '--untracked-files=all', '--ignore-submodules=none',
264
+ ], env, 'Could not recheck the source worktree.');
265
+ if (preparedHead !== sourceHead || preparedStatus !== '') {
266
+ throw new Error('Source HEAD or worktree changed during Catalog preparation. Commit or clean it before publishing.');
267
+ }
268
+ if (!options.yes) {
269
+ options.io.stderr([
270
+ `Source HEAD: ${sourceHead}`,
271
+ `Catalog: ${prepared.catalogVersion} (${prepared.channel})`,
272
+ `Push remote: ${remote} (${safePushUrl})`,
273
+ `Branch: ${branchRef}`,
274
+ `Tag: ${tagRef}`,
275
+ `Plugins: ${prepared.pluginNames.length}`,
276
+ 'One atomic push will publish the branch and annotated tag.',
277
+ ].join('\n') + '\n');
278
+ if (!options.confirm || !(await options.confirm('Publish this Catalog snapshot?'))) {
279
+ options.io.stderr('Catalog publication cancelled.\n');
280
+ return null;
281
+ }
282
+ }
283
+ if (parent)
284
+ await git(repositoryRoot, ['checkout', '--quiet', '--detach', 'refs/remotes/publish/catalog'], env, 'Could not select the publication parent.');
285
+ else
286
+ await git(repositoryRoot, ['checkout', '--quiet', '--orphan', 'catalog-publication'], env, 'Could not create the initial Catalog publication.');
287
+ await clearWorktree(repositoryRoot);
288
+ await fs.copy(prepared.outputRoot, repositoryRoot, { dereference: false });
289
+ await git(repositoryRoot, ['add', '--force', '--all'], env, 'Could not stage the Catalog publication tree.');
290
+ await git(repositoryRoot, [
291
+ '-c', 'user.name=AW Catalog Publisher',
292
+ '-c', 'user.email=catalog-publisher@agent-workflows.invalid',
293
+ 'commit', '--quiet', '-m', `Catalog ${catalogVersion}`,
294
+ ], env, 'Could not create the Catalog publication commit.');
295
+ const commit = await git(repositoryRoot, ['rev-parse', 'HEAD'], env, 'Could not resolve the Catalog publication commit.');
296
+ const parents = (await git(repositoryRoot, ['show', '-s', '--format=%P', commit], env, 'Could not verify the Catalog publication parent.')).split(/\s+/u).filter(Boolean);
297
+ if ((parent && (parents.length !== 1 || parents[0] !== parent)) || (!parent && parents.length !== 0)) {
298
+ throw new Error('Catalog publication commit has an invalid parent.');
299
+ }
300
+ const verificationRoot = path.join(temporaryRoot, 'verification');
301
+ await fs.ensureDir(verificationRoot);
302
+ await git(repositoryRoot, ['--work-tree', verificationRoot, 'checkout', '--quiet', commit, '--', '.'], env, 'Could not verify the Catalog publication commit tree.');
303
+ const committed = await validatePublishedCatalogSnapshot(verificationRoot);
304
+ if (committed.snapshotDigest !== prepared.snapshotDigest)
305
+ throw new Error('Catalog publication commit tree differs from the prepared snapshot.');
306
+ await git(repositoryRoot, [
307
+ '-c', 'user.name=AW Catalog Publisher',
308
+ '-c', 'user.email=catalog-publisher@agent-workflows.invalid',
309
+ 'tag', '--annotate', tag, '--message', `Catalog ${catalogVersion}`,
310
+ ], env, 'Could not create the annotated Catalog tag.');
311
+ const attemptedAt = new Date().toISOString();
312
+ const attempted = {
313
+ schemaVersion: 1,
314
+ state: 'attempted',
315
+ workspaceIdentity: digest(JSON.stringify({ repoRoot, workspaceRelative: path.relative(repoRoot, workspaceRoot) })),
316
+ catalogVersion,
317
+ sourceHead,
318
+ remote: { name: remote, identityDigest: remoteIdentityDigest },
319
+ branch,
320
+ tag,
321
+ preparedSnapshotDigest: prepared.snapshotDigest,
322
+ attemptedAt,
323
+ };
324
+ await writeJsonAtomic(markerPath, attempted);
325
+ const liveRefs = parseRemoteRefs(await git(repositoryRoot, [
326
+ 'ls-remote', 'publish', branchRef, tagRef, `${tagRef}^{}`,
327
+ ], env, 'Could not recheck the Catalog publication remote.'));
328
+ if ((liveRefs.get(branchRef) ?? null) !== parent || liveRefs.has(tagRef) || liveRefs.has(`${tagRef}^{}`)) {
329
+ throw new Error('Catalog remote changed during preparation. Increase the Catalog version before publishing again.');
330
+ }
331
+ try {
332
+ await git(repositoryRoot, [
333
+ 'push', '--atomic', 'publish', `${commit}:${branchRef}`, `${tagRef}:${tagRef}`,
334
+ ], env, `Catalog atomic push failed or its result is uncertain. Do not retry ${catalogVersion}; increase the Catalog version.`);
335
+ }
336
+ catch {
337
+ throw new Error(`Catalog atomic push failed or its result is uncertain. Do not retry ${catalogVersion}; run aw catalog version <higher>.`);
338
+ }
339
+ const publishedRefs = parseRemoteRefs(await git(repositoryRoot, [
340
+ 'ls-remote', 'publish', branchRef, tagRef, `${tagRef}^{}`,
341
+ ], env, `Catalog publication result is uncertain. Do not retry ${catalogVersion}; increase the Catalog version.`));
342
+ if (publishedRefs.get(branchRef) !== commit || publishedRefs.get(`${tagRef}^{}`) !== commit) {
343
+ throw new Error(`Catalog publication result is uncertain. Do not retry ${catalogVersion}; run aw catalog version <higher>.`);
344
+ }
345
+ await writeJsonAtomic(markerPath, { ...attempted, state: 'published', commit, publishedAt: new Date().toISOString() });
346
+ return {
347
+ command: 'catalog:publish',
348
+ ok: true,
349
+ catalogVersion,
350
+ channel: prepared.channel,
351
+ remote,
352
+ remoteUrl: safeFetchUrl,
353
+ fetchUrl: safeFetchUrl,
354
+ pushUrl: safePushUrl,
355
+ branch,
356
+ tag,
357
+ commit,
358
+ sourceHead,
359
+ pluginCount: prepared.pluginNames.length,
360
+ snapshotDigest: prepared.snapshotDigest,
361
+ };
362
+ }
363
+ catch (error) {
364
+ const message = error instanceof Error ? error.message : String(error);
365
+ throw new Error(message
366
+ .replaceAll(temporaryRoot, '<temporary Catalog state>')
367
+ .replaceAll(fetchUrl, safeFetchUrl)
368
+ .replaceAll(pushUrl, safePushUrl));
369
+ }
370
+ finally {
371
+ await fs.remove(temporaryRoot);
372
+ }
373
+ }
374
+ //# sourceMappingURL=catalog-publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-publish.js","sourceRoot":"","sources":["../../../src/commands/catalog-publish.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,mBAAmB,EACnB,gCAAgC,GAEjC,MAAM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AAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,OAAO;aACpB,UAAU,CAAC,aAAa,EAAE,2BAA2B,CAAC;aACtD,UAAU,CAAC,QAAQ,EAAE,YAAY,CAAC;aAClC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IACvC,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
@@ -0,0 +1,111 @@
1
+ import type { CatalogGitRefPolicy, CatalogSource } from '../types.js';
2
+ import type { CatalogSourceInventoryError, CatalogSourceReference, CatalogSourceReferenceInventory } from '../utils/catalog-source-references.js';
3
+ import { type CatalogSourceUpdate } from '../utils/catalog-sources.js';
4
+ import { type AwHomeMutationToken } from '../utils/aw-home-mutation-lock.js';
5
+ export interface CatalogSourceEvidence {
6
+ sourceId: string;
7
+ sourceIdentity: string;
8
+ requestedRef: string;
9
+ resolvedCommit: string;
10
+ catalogVersion: string;
11
+ channel: string;
12
+ freshness: 'remote' | 'cache' | 'path';
13
+ }
14
+ export interface CatalogSourceMutationReceipt {
15
+ receiptSchemaVersion: 4;
16
+ command: 'catalog:source:add' | 'catalog:source:update' | 'catalog:source:set-primary' | 'catalog:source:remove';
17
+ ok: boolean;
18
+ changed: boolean;
19
+ sourceId: string;
20
+ primarySourceId?: string;
21
+ source?: CatalogSourceEvidence;
22
+ configDigest?: string;
23
+ references: CatalogSourceReferenceInventory['references'];
24
+ errors: Array<{
25
+ code: string;
26
+ message: string;
27
+ }>;
28
+ }
29
+ export interface CatalogSourceListPayload {
30
+ catalogSourcesSchemaVersion: 1;
31
+ primarySourceId: string;
32
+ configDigest: string;
33
+ sources: Array<CatalogSource & {
34
+ sourceIdentity: string;
35
+ }>;
36
+ }
37
+ export type CatalogSourceCommandRuntime = {
38
+ beforeRefresh?: () => Promise<void> | void;
39
+ onProgress?: (event: CatalogSourceMutationProgress) => Promise<void> | void;
40
+ awHomeMutationToken?: AwHomeMutationToken;
41
+ };
42
+ export type CatalogSourceMutationProgressStage = 'refreshingCatalog' | 'catalogReady' | 'savingConfig';
43
+ export interface CatalogSourceMutationProgress {
44
+ action: CatalogSourceMutationRequest['action'];
45
+ stage: CatalogSourceMutationProgressStage;
46
+ }
47
+ export type CatalogSourceMutationRequest = {
48
+ action: 'add';
49
+ source: CatalogSource;
50
+ } | {
51
+ action: 'update';
52
+ sourceId: string;
53
+ update: CatalogSourceUpdate;
54
+ } | {
55
+ action: 'setPrimary' | 'remove';
56
+ sourceId: string;
57
+ };
58
+ export interface CatalogSourceMutationPreflight {
59
+ sourceId: string;
60
+ configDigest: string;
61
+ candidateDigest: string;
62
+ sourceIdentity?: string;
63
+ identityChanged: boolean;
64
+ references: CatalogSourcePreflightInventory;
65
+ }
66
+ export interface CatalogSourcePreflightInventory {
67
+ inventorySchemaVersion: 1;
68
+ references: Array<Omit<CatalogSourceReference, 'location'>>;
69
+ errors: Array<Pick<CatalogSourceInventoryError, 'code' | 'kind' | 'relevance'>>;
70
+ }
71
+ export declare function preflightCatalogSourceMutation(options: {
72
+ request: CatalogSourceMutationRequest;
73
+ cwd: string;
74
+ env?: NodeJS.ProcessEnv;
75
+ runtime?: CatalogSourceCommandRuntime;
76
+ }): Promise<CatalogSourceMutationPreflight>;
77
+ export declare function listCatalogSources(options?: {
78
+ env?: NodeJS.ProcessEnv;
79
+ }): Promise<CatalogSourceListPayload>;
80
+ export declare function addCatalogSourceCommand(options: {
81
+ source: CatalogSource;
82
+ cliVersion: string;
83
+ cwd: string;
84
+ env?: NodeJS.ProcessEnv;
85
+ runtime?: CatalogSourceCommandRuntime;
86
+ expectedConfigDigest?: string;
87
+ }): Promise<CatalogSourceMutationReceipt>;
88
+ export declare function updateCatalogSourceCommand(options: {
89
+ sourceId: string;
90
+ update: CatalogSourceUpdate;
91
+ cliVersion: string;
92
+ cwd: string;
93
+ env?: NodeJS.ProcessEnv;
94
+ runtime?: CatalogSourceCommandRuntime;
95
+ expectedConfigDigest?: string;
96
+ }): Promise<CatalogSourceMutationReceipt>;
97
+ export declare function setPrimaryCatalogSourceCommand(options: {
98
+ sourceId: string;
99
+ cwd: string;
100
+ env?: NodeJS.ProcessEnv;
101
+ runtime?: CatalogSourceCommandRuntime;
102
+ expectedConfigDigest?: string;
103
+ }): Promise<CatalogSourceMutationReceipt>;
104
+ export declare function removeCatalogSourceCommand(options: {
105
+ sourceId: string;
106
+ cwd: string;
107
+ env?: NodeJS.ProcessEnv;
108
+ runtime?: CatalogSourceCommandRuntime;
109
+ expectedConfigDigest?: string;
110
+ }): Promise<CatalogSourceMutationReceipt>;
111
+ export declare function explicitRefPolicy(ref: string | undefined, defaultRef: boolean): CatalogGitRefPolicy;