@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,442 @@
1
+ import path from 'node:path';
2
+ import fs from 'fs-extra';
3
+ import { coercePluginConfigValue, readPluginConfigStore, resolveProjectArtifactRenderConfig, resolveAwProjectRoot, } from './plugin-config.js';
4
+ import { buildLifecycleScriptInvocation, buildPluginScriptSpawnEnv, calculateFileDigest, collectSensitivePluginConfigValues, defaultPluginProcessRunner, resolveBundledPluginFilePath, resolveLifecycleScriptTimeoutMs, summarizePluginScriptOutput, } from './plugin-scripts.js';
5
+ import { resolveAwHome } from './paths.js';
6
+ import { getArtifactSourceBundleRelativePath } from './artifact-sources.js';
7
+ const SUPPORTED_ARTIFACT_RENDER_EVENTS = new Set([
8
+ 'install',
9
+ 'upgrade',
10
+ 'refresh',
11
+ 'materialize',
12
+ ]);
13
+ function artifactRendererCodexHome(env) {
14
+ return env.AW_CODEX_HOME || path.join(resolveAwHome(env), 'isolated-codex-home');
15
+ }
16
+ function artifactRendererClaudeHome(env) {
17
+ return env.AW_CLAUDE_HOME || path.join(resolveAwHome(env), 'isolated-claude-home');
18
+ }
19
+ function isRecord(value) {
20
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
21
+ }
22
+ function assertArtifactRenderEvent(value) {
23
+ if (!SUPPORTED_ARTIFACT_RENDER_EVENTS.has(value)) {
24
+ throw new Error(`Artifact renderer only supports install, upgrade, refresh, and materialize events; received "${value}".`);
25
+ }
26
+ return value;
27
+ }
28
+ function createIssueMap() {
29
+ return new Map();
30
+ }
31
+ async function applyArtifactConfigLayer(options) {
32
+ for (const [key, field] of Object.entries(options.schema)) {
33
+ if (!Object.hasOwn(options.entries, key)) {
34
+ continue;
35
+ }
36
+ try {
37
+ const coerced = await coercePluginConfigValue({
38
+ key,
39
+ field,
40
+ value: options.entries[key],
41
+ projectRoot: options.projectRoot,
42
+ });
43
+ options.values[key] = coerced;
44
+ options.sources[key] = options.source;
45
+ options.invalidIssues.delete(key);
46
+ }
47
+ catch (error) {
48
+ delete options.values[key];
49
+ options.sources[key] = options.source;
50
+ options.invalidIssues.set(key, {
51
+ type: 'invalid-config',
52
+ key,
53
+ source: options.source,
54
+ message: error instanceof Error ? error.message : String(error),
55
+ });
56
+ }
57
+ }
58
+ }
59
+ export async function resolveArtifactRenderConfig(options) {
60
+ const pluginName = options.pluginName ?? options.manifest.name;
61
+ if (options.scope === 'project') {
62
+ const projectConfig = await resolveProjectArtifactRenderConfig({
63
+ sourceId: options.sourceId,
64
+ sourceIdentity: options.sourceIdentity,
65
+ pluginName,
66
+ manifest: options.manifest,
67
+ cwd: options.cwd,
68
+ env: options.env,
69
+ });
70
+ return {
71
+ mode: 'artifact-render',
72
+ targetScope: options.scope,
73
+ schema: Object.keys(projectConfig.schema).length > 0 ? projectConfig.schema : undefined,
74
+ values: projectConfig.values,
75
+ sources: projectConfig.sources,
76
+ issues: projectConfig.issues,
77
+ stores: {
78
+ user: projectConfig.stores.user,
79
+ project: projectConfig.stores.project,
80
+ },
81
+ };
82
+ }
83
+ const schema = options.manifest.config?.schema;
84
+ const projectRoot = resolveAwProjectRoot(options.cwd);
85
+ const [userStore, projectStore] = await Promise.all([
86
+ readPluginConfigStore({
87
+ sourceId: options.sourceId,
88
+ sourceIdentity: options.sourceIdentity,
89
+ pluginName,
90
+ scope: 'user',
91
+ cwd: options.cwd,
92
+ env: options.env,
93
+ }),
94
+ readPluginConfigStore({
95
+ sourceId: options.sourceId,
96
+ sourceIdentity: options.sourceIdentity,
97
+ pluginName,
98
+ scope: 'project',
99
+ cwd: options.cwd,
100
+ env: options.env,
101
+ }),
102
+ ]);
103
+ if (!schema) {
104
+ return {
105
+ mode: 'artifact-render',
106
+ targetScope: options.scope,
107
+ schema: undefined,
108
+ values: {},
109
+ sources: {},
110
+ issues: [],
111
+ stores: {
112
+ user: userStore,
113
+ project: projectStore,
114
+ },
115
+ };
116
+ }
117
+ const values = {};
118
+ const sources = {};
119
+ const invalidIssues = createIssueMap();
120
+ for (const key of Object.keys(schema)) {
121
+ sources[key] = 'missing';
122
+ }
123
+ for (const [key, field] of Object.entries(schema)) {
124
+ if (field.default === undefined) {
125
+ continue;
126
+ }
127
+ await applyArtifactConfigLayer({
128
+ values,
129
+ sources,
130
+ invalidIssues,
131
+ schema: { [key]: field },
132
+ entries: { [key]: field.default },
133
+ source: 'default',
134
+ projectRoot,
135
+ });
136
+ }
137
+ await applyArtifactConfigLayer({
138
+ values,
139
+ sources,
140
+ invalidIssues,
141
+ schema,
142
+ entries: userStore.values,
143
+ source: 'user',
144
+ projectRoot,
145
+ });
146
+ const issues = [...invalidIssues.values()];
147
+ for (const [key, field] of Object.entries(schema)) {
148
+ if (field.required && values[key] === undefined) {
149
+ issues.push({
150
+ type: 'missing-required',
151
+ key,
152
+ source: sources[key],
153
+ message: `Config "${key}" is required.`,
154
+ });
155
+ }
156
+ }
157
+ return {
158
+ mode: 'artifact-render',
159
+ targetScope: options.scope,
160
+ schema,
161
+ values,
162
+ sources,
163
+ issues,
164
+ stores: {
165
+ user: userStore,
166
+ project: projectStore,
167
+ },
168
+ };
169
+ }
170
+ export async function resolveArtifactRendererTarget(plugin) {
171
+ const entry = plugin.manifest.scripts?.artifacts?.render;
172
+ const bundleRoot = await fs.realpath(plugin.rootDir);
173
+ const manifestPath = await fs.realpath(plugin.manifestPath);
174
+ const manifestDigest = await calculateFileDigest(manifestPath);
175
+ if (!entry) {
176
+ return {
177
+ noOp: true,
178
+ bundleRoot,
179
+ sourceManifest: plugin.manifest,
180
+ manifestPath,
181
+ manifestDigest,
182
+ };
183
+ }
184
+ const entryPath = await resolveBundledPluginFilePath({
185
+ bundleRoot,
186
+ pluginRelativePath: entry.path,
187
+ fieldName: 'Artifact renderer',
188
+ });
189
+ return {
190
+ noOp: false,
191
+ entry,
192
+ entryPath,
193
+ bundleRoot,
194
+ sourceManifest: plugin.manifest,
195
+ manifestPath,
196
+ manifestDigest,
197
+ rendererDigest: await calculateFileDigest(entryPath),
198
+ };
199
+ }
200
+ export async function writeArtifactRendererContext(options) {
201
+ const event = assertArtifactRenderEvent(options.event);
202
+ if (options.target.noOp ||
203
+ !options.target.entry ||
204
+ !options.target.entryPath ||
205
+ !options.target.bundleRoot ||
206
+ !options.target.sourceManifest ||
207
+ !options.target.manifestPath ||
208
+ !options.target.manifestDigest ||
209
+ !options.target.rendererDigest) {
210
+ throw new Error('Cannot write artifact renderer context for a no-op target.');
211
+ }
212
+ const config = await resolveArtifactRenderConfig({
213
+ sourceId: options.sourceId,
214
+ sourceIdentity: options.sourceIdentity,
215
+ pluginName: options.target.sourceManifest.name,
216
+ manifest: options.target.sourceManifest,
217
+ scope: options.scope,
218
+ cwd: options.cwd,
219
+ env: options.commandEnv,
220
+ });
221
+ const distribution = options.platform === 'agent-skills' ? options.platform : undefined;
222
+ const platform = distribution ? undefined : options.platform;
223
+ const artifactSources = await Promise.all((options.target.sourceManifest.artifacts?.targets ?? [])
224
+ .filter((target) => (distribution ? target.distribution === distribution : target.platform === platform)
225
+ && target.scopes.includes(options.scope))
226
+ .map(async (target) => ({
227
+ id: target.id,
228
+ target: target.target,
229
+ sourceDirs: await Promise.all((target.sourceDirs ?? []).map((_, index) => resolveBundledPluginFilePath({
230
+ bundleRoot: options.target.bundleRoot,
231
+ pluginRelativePath: `./${getArtifactSourceBundleRelativePath({
232
+ platform: target.platform,
233
+ distribution: target.distribution,
234
+ artifactId: target.id,
235
+ index,
236
+ })}`,
237
+ fieldName: `Artifact source ${target.id}[${index}]`,
238
+ }))),
239
+ })));
240
+ const context = {
241
+ event,
242
+ surface: distribution
243
+ ? { kind: 'distribution', name: distribution }
244
+ : { kind: 'platform', name: platform },
245
+ platform,
246
+ distribution,
247
+ scope: options.scope,
248
+ plugin: {
249
+ name: options.target.sourceManifest.name,
250
+ version: options.target.sourceManifest.version,
251
+ rootDir: options.target.bundleRoot,
252
+ },
253
+ config: {
254
+ mode: config.mode,
255
+ targetScope: config.targetScope,
256
+ schema: config.schema,
257
+ values: config.values,
258
+ sources: config.sources,
259
+ issues: config.issues,
260
+ },
261
+ changedConfigKeys: options.changedConfigKeys ?? [],
262
+ previousArtifacts: options.previousArtifacts ?? [],
263
+ artifactSources,
264
+ runtimeImports: (options.target.sourceManifest.artifacts?.targets ?? [])
265
+ .filter((target) => (distribution ? target.distribution === distribution : target.platform === platform)
266
+ && target.scopes.includes(options.scope))
267
+ .flatMap((target) => (target.runtimeImports ?? []).map((runtimeImport) => {
268
+ if (!runtimeImport.resolved) {
269
+ throw new Error(`Artifact runtime import "${target.id}/${runtimeImport.name}" is not resolved in the bundle.`);
270
+ }
271
+ return {
272
+ artifactId: target.id,
273
+ name: runtimeImport.name,
274
+ providerPluginId: runtimeImport.resolved.providerPluginId,
275
+ exportName: runtimeImport.export,
276
+ path: path.join(options.target.bundleRoot, runtimeImport.resolved.path.replace(/^\.\//u, '')),
277
+ digest: runtimeImport.resolved.digest,
278
+ };
279
+ })),
280
+ paths: {
281
+ awHome: resolveAwHome(options.commandEnv),
282
+ codexHome: artifactRendererCodexHome(options.commandEnv),
283
+ claudeHome: artifactRendererClaudeHome(options.commandEnv),
284
+ manifestPath: options.target.manifestPath,
285
+ configStores: {
286
+ user: config.stores.user.path,
287
+ project: config.stores.project.path,
288
+ },
289
+ },
290
+ renderer: {
291
+ runner: options.target.entry.runner,
292
+ path: options.target.entryPath,
293
+ args: options.target.entry.args ?? [],
294
+ manifestDigest: options.target.manifestDigest,
295
+ rendererDigest: options.target.rendererDigest,
296
+ },
297
+ };
298
+ const tempRoot = path.join(resolveAwHome(options.commandEnv), 'tmp');
299
+ await fs.ensureDir(tempRoot);
300
+ const tempDir = await fs.mkdtemp(path.join(tempRoot, 'plugin-artifact-render-'));
301
+ const contextPath = path.join(tempDir, 'context.json');
302
+ await fs.writeJson(contextPath, context, { spaces: 2 });
303
+ try {
304
+ await fs.chmod(contextPath, 0o600);
305
+ }
306
+ catch {
307
+ // Best effort on non-POSIX filesystems.
308
+ }
309
+ return {
310
+ context,
311
+ contextPath,
312
+ tempDir,
313
+ sensitiveValues: collectSensitivePluginConfigValues(options.target.sourceManifest, config.values),
314
+ cleanup: async () => {
315
+ await fs.remove(tempDir);
316
+ },
317
+ };
318
+ }
319
+ function summarizeRenderOutput(value, sensitiveValues) {
320
+ const summary = summarizePluginScriptOutput(value, sensitiveValues);
321
+ return summary === '' ? '<empty>' : summary;
322
+ }
323
+ function assertArtifactPlanEnvelope(value, output) {
324
+ if (!isRecord(value)) {
325
+ throw new Error(`Artifact renderer must write a JSON object to stdout. stdout: ${output.stdoutSummary}. stderr: ${output.stderrSummary}`);
326
+ }
327
+ if (value.version !== 2) {
328
+ const migrationHint = value.version === 1
329
+ ? ' ArtifactPlan V1 is not supported by AW 1.0.0-beta.30; upgrade or reinstall the plugin.'
330
+ : '';
331
+ throw new Error(`Artifact renderer returned unsupported plan version "${String(value.version)}".${migrationHint} stderr: ${output.stderrSummary}`);
332
+ }
333
+ if (!Array.isArray(value.artifacts)) {
334
+ throw new Error(`Artifact renderer returned an invalid plan: "artifacts" must be an array. stdout: ${output.stdoutSummary}. stderr: ${output.stderrSummary}`);
335
+ }
336
+ return value;
337
+ }
338
+ function buildArtifactRendererInvocation(options) {
339
+ return buildLifecycleScriptInvocation(options);
340
+ }
341
+ function assertRefreshKeysForEvent(event, changedConfigKeys) {
342
+ assertArtifactRenderEvent(event);
343
+ const keys = changedConfigKeys ? [...changedConfigKeys] : [];
344
+ if (event === 'refresh' && keys.length === 0) {
345
+ throw new Error('Artifact renderer refresh requires changedConfigKeys.');
346
+ }
347
+ return keys;
348
+ }
349
+ async function runArtifactRendererProcess(options) {
350
+ return (options.runner ?? defaultPluginProcessRunner).run(options.invocation, {
351
+ timeoutMs: options.timeoutMs,
352
+ ...(options.signal ? { signal: options.signal } : {}),
353
+ });
354
+ }
355
+ export async function runArtifactRenderer(options) {
356
+ options.signal?.throwIfAborted();
357
+ const event = assertArtifactRenderEvent(options.event);
358
+ const commandEnv = options.commandEnv ?? process.env;
359
+ const changedConfigKeys = assertRefreshKeysForEvent(event, options.changedConfigKeys);
360
+ const target = await resolveArtifactRendererTarget(options.plugin);
361
+ if (target.noOp) {
362
+ throw new Error(`Plugin "${options.plugin.manifest.name}" does not declare scripts.artifacts.render.`);
363
+ }
364
+ const writtenContext = await writeArtifactRendererContext({
365
+ sourceId: options.plugin.sourceId,
366
+ sourceIdentity: options.plugin.sourceIdentity,
367
+ target,
368
+ event,
369
+ platform: options.platform,
370
+ scope: options.scope,
371
+ cwd: options.cwd,
372
+ commandEnv,
373
+ changedConfigKeys,
374
+ previousArtifacts: options.previousArtifacts,
375
+ });
376
+ try {
377
+ await fs.ensureDir(path.join(writtenContext.tempDir, 'home'));
378
+ await fs.ensureDir(path.join(writtenContext.tempDir, 'tmp'));
379
+ const timeoutMs = resolveLifecycleScriptTimeoutMs({
380
+ cliTimeoutMs: options.scriptTimeoutMs,
381
+ manifest: target.sourceManifest,
382
+ });
383
+ const spawnEnv = buildPluginScriptSpawnEnv({
384
+ commandEnv,
385
+ contextPath: writtenContext.contextPath,
386
+ tempDir: writtenContext.tempDir,
387
+ plugin: writtenContext.context.plugin,
388
+ event,
389
+ ...(options.platform === 'agent-skills'
390
+ ? { distribution: options.platform }
391
+ : { platform: options.platform }),
392
+ scope: options.scope,
393
+ bundleRoot: writtenContext.context.plugin.rootDir,
394
+ });
395
+ const invocation = buildArtifactRendererInvocation({
396
+ entry: target.entry,
397
+ entryPath: target.entryPath,
398
+ cwd: options.cwd,
399
+ env: spawnEnv,
400
+ });
401
+ const result = await runArtifactRendererProcess({
402
+ invocation,
403
+ timeoutMs,
404
+ signal: options.signal,
405
+ runner: options.runner,
406
+ });
407
+ const stdoutSummary = summarizeRenderOutput(result.stdout, writtenContext.sensitiveValues);
408
+ const stderrSummary = summarizeRenderOutput(result.stderr, writtenContext.sensitiveValues);
409
+ if (result.timedOut) {
410
+ throw new Error(`Artifact renderer timed out after ${timeoutMs} ms. stderr: ${stderrSummary}`);
411
+ }
412
+ if (result.exitCode !== 0) {
413
+ throw new Error(`Artifact renderer failed with exit code ${result.exitCode}. stderr: ${stderrSummary}`);
414
+ }
415
+ const rawStdout = result.stdout.trim();
416
+ let parsed;
417
+ try {
418
+ parsed = JSON.parse(rawStdout);
419
+ }
420
+ catch {
421
+ throw new Error(`Artifact renderer must write JSON to stdout. stdout: ${stdoutSummary}. stderr: ${stderrSummary}`);
422
+ }
423
+ const plan = assertArtifactPlanEnvelope(parsed, {
424
+ stdoutSummary,
425
+ stderrSummary,
426
+ });
427
+ return {
428
+ plan,
429
+ target,
430
+ context: writtenContext.context,
431
+ exitCode: result.exitCode,
432
+ signal: result.signal,
433
+ stdout: stdoutSummary,
434
+ stderr: stderrSummary,
435
+ timedOut: result.timedOut,
436
+ };
437
+ }
438
+ finally {
439
+ await writtenContext.cleanup();
440
+ }
441
+ }
442
+ //# sourceMappingURL=artifact-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-renderer.js","sourceRoot":"","sources":["../../../src/utils/artifact-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAmB1B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,kCAAkC,EAClC,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,mBAAmB,EACnB,kCAAkC,EAClC,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,GAI5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AA8F5E,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAsB;IACpE,SAAS;IACT,SAAS;IACT,SAAS;IACT,aAAa;CACd,CAAC,CAAC;AAEH,SAAS,yBAAyB,CAAC,GAAsB;IACvD,OAAO,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,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pB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,wDAAwD,aAAa,aAAa,aAAa,EAAE,CAClG,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,0BAA0B,CAAC,MAAM,EAAE;YAC9C,aAAa;YACb,aAAa;SACd,CAAC,CAAC;QAEH,OAAO;YACL,IAAI;YACJ,MAAM;YACN,OAAO,EAAE,cAAc,CAAC,OAAO;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { DistributionName, PlatformName } from '../types.js';
2
+ export declare const ARTIFACT_SOURCES_ROOT: string;
3
+ export declare function getArtifactSourceBundleRelativePath(options: {
4
+ platform?: PlatformName;
5
+ distribution?: DistributionName;
6
+ artifactId: string;
7
+ index: number;
8
+ }): string;
@@ -0,0 +1,10 @@
1
+ import path from 'node:path';
2
+ export const ARTIFACT_SOURCES_ROOT = path.posix.join('.agents-plugin', 'artifact-sources');
3
+ export function getArtifactSourceBundleRelativePath(options) {
4
+ const surface = options.platform ?? options.distribution;
5
+ if (!surface) {
6
+ throw new Error('Artifact source surface is required.');
7
+ }
8
+ return path.posix.join(ARTIFACT_SOURCES_ROOT, surface, options.artifactId, String(options.index));
9
+ }
10
+ //# sourceMappingURL=artifact-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-sources.js","sourceRoot":"","sources":["../../../src/utils/artifact-sources.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;AAE3F,MAAM,UAAU,mCAAmC,CAAC,OAKnD;IACC,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IACzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CACpB,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,UAAU,EAClB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare const awHomeMutationTokenBrand: unique symbol;
2
+ export type AwHomeMutationToken = Readonly<{
3
+ [awHomeMutationTokenBrand]: true;
4
+ }>;
5
+ export declare function withAwHomeMutationLock<T>(options: {
6
+ env?: NodeJS.ProcessEnv;
7
+ token?: AwHomeMutationToken;
8
+ action: (token: AwHomeMutationToken) => Promise<T>;
9
+ }): Promise<T>;
10
+ export {};
@@ -0,0 +1,55 @@
1
+ import path from 'node:path';
2
+ import { releaseActiveMarketplaceCoordinationLease, resolveActiveMarketplaceRuntimeCoordinationRoot, } from './active-marketplace-runtime-lock.js';
3
+ import { acquireProcessLock } from './process-lock.js';
4
+ import { ensureRegularDirectoryPath } from './state-paths.js';
5
+ const AW_HOME_MUTATION_LOCK_TIMEOUT_MS = 600_000;
6
+ const tokenRoots = new WeakMap();
7
+ function releaseWarning() {
8
+ try {
9
+ process.emitWarning('AW_HOME mutation completed, but its lock release failed.', { code: 'AW_HOME_MUTATION_LOCK_RELEASE_FAILED' });
10
+ }
11
+ catch {
12
+ // Diagnostics cannot replace the action result.
13
+ }
14
+ }
15
+ export async function withAwHomeMutationLock(options) {
16
+ const coordinationRoot = resolveActiveMarketplaceRuntimeCoordinationRoot(options.env);
17
+ if (options.token !== undefined) {
18
+ const tokenRoot = tokenRoots.get(options.token);
19
+ if (tokenRoot === undefined) {
20
+ throw new Error('Invalid AW_HOME mutation token.');
21
+ }
22
+ if (tokenRoot !== coordinationRoot) {
23
+ throw new Error('AW_HOME mutation token belongs to a different coordination root.');
24
+ }
25
+ return options.action(options.token);
26
+ }
27
+ await ensureRegularDirectoryPath(coordinationRoot, 'AW_HOME mutation coordination root');
28
+ const lease = await acquireProcessLock({
29
+ lockPath: path.join(coordinationRoot, 'aw-home-mutation.lock'),
30
+ timeoutMs: AW_HOME_MUTATION_LOCK_TIMEOUT_MS,
31
+ });
32
+ const token = Object.freeze({});
33
+ tokenRoots.set(token, coordinationRoot);
34
+ let result;
35
+ let actionError;
36
+ let succeeded = false;
37
+ try {
38
+ result = await options.action(token);
39
+ succeeded = true;
40
+ }
41
+ catch (error) {
42
+ actionError = error;
43
+ }
44
+ tokenRoots.delete(token);
45
+ try {
46
+ await releaseActiveMarketplaceCoordinationLease(lease);
47
+ }
48
+ catch {
49
+ releaseWarning();
50
+ }
51
+ if (!succeeded)
52
+ throw actionError;
53
+ return result;
54
+ }
55
+ //# sourceMappingURL=aw-home-mutation-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aw-home-mutation-lock.js","sourceRoot":"","sources":["../../../src/utils/aw-home-mutation-lock.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,yCAAyC,EACzC,+CAA+C,GAChD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,gCAAgC,GAAG,OAAO,CAAC;AACjD,MAAM,UAAU,GAAG,IAAI,OAAO,EAAkB,CAAC;AAQjD,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,CAAC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C;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,yCAAyC,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,cAAc,EAAE,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,SAAS;QAAE,MAAM,WAAW,CAAC;IAClC,OAAO,MAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function calculateFileDigest(filePath: string): Promise<string>;
2
+ export declare function calculatePluginBundleFingerprint(bundleRoot: string): Promise<string>;
3
+ export declare function calculatePluginBundleFingerprintV2(bundleRoot: string): Promise<string>;
@@ -0,0 +1,88 @@
1
+ import crypto from 'node:crypto';
2
+ import path from 'node:path';
3
+ import fs from 'fs-extra';
4
+ export async function calculateFileDigest(filePath) {
5
+ const hash = crypto.createHash('sha256');
6
+ hash.update(await fs.readFile(filePath));
7
+ return `sha256:${hash.digest('hex')}`;
8
+ }
9
+ async function collectBundleEntries(rootDir, relativeDir = '') {
10
+ const absoluteDir = relativeDir ? path.join(rootDir, relativeDir) : rootDir;
11
+ const entries = await fs.readdir(absoluteDir, { withFileTypes: true });
12
+ const output = [];
13
+ for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
14
+ const relativePath = relativeDir
15
+ ? path.join(relativeDir, entry.name).split(path.sep).join('/')
16
+ : entry.name;
17
+ const absolutePath = path.join(rootDir, ...relativePath.split('/'));
18
+ const stat = await fs.lstat(absolutePath);
19
+ if (stat.isSymbolicLink()) {
20
+ output.push({
21
+ type: 'symlink',
22
+ relativePath,
23
+ payload: Buffer.from(await fs.readlink(absolutePath)),
24
+ });
25
+ continue;
26
+ }
27
+ if (stat.isDirectory()) {
28
+ output.push({ type: 'directory', relativePath, payload: Buffer.alloc(0) });
29
+ output.push(...await collectBundleEntries(rootDir, relativePath));
30
+ continue;
31
+ }
32
+ if (stat.isFile()) {
33
+ output.push({ type: 'file', relativePath, payload: await fs.readFile(absolutePath) });
34
+ continue;
35
+ }
36
+ throw new Error(`Plugin bundle contains an unsupported entry: ${absolutePath}`);
37
+ }
38
+ return output;
39
+ }
40
+ function updateLength(hash, value) {
41
+ const encoded = Buffer.allocUnsafe(8);
42
+ encoded.writeBigUInt64BE(BigInt(value));
43
+ hash.update(encoded);
44
+ }
45
+ export async function calculatePluginBundleFingerprint(bundleRoot) {
46
+ const hash = crypto.createHash('sha256');
47
+ const files = [];
48
+ async function listFiles(relativeDir = '') {
49
+ const entries = await fs.readdir(path.join(bundleRoot, relativeDir), { withFileTypes: true })
50
+ .catch(() => []);
51
+ for (const entry of entries) {
52
+ const relativePath = relativeDir ? path.join(relativeDir, entry.name) : entry.name;
53
+ if (entry.isDirectory()) {
54
+ await listFiles(relativePath);
55
+ }
56
+ else {
57
+ files.push(relativePath.split(path.sep).join('/'));
58
+ }
59
+ }
60
+ }
61
+ await listFiles();
62
+ for (const relativePath of files.sort()) {
63
+ hash.update(relativePath);
64
+ hash.update('\0');
65
+ hash.update(await fs.readFile(path.join(bundleRoot, relativePath)));
66
+ hash.update('\0');
67
+ }
68
+ return `sha256:${hash.digest('hex')}`;
69
+ }
70
+ export async function calculatePluginBundleFingerprintV2(bundleRoot) {
71
+ const rootStat = await fs.lstat(bundleRoot);
72
+ if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) {
73
+ throw new Error(`Plugin bundle root must be a regular directory: ${bundleRoot}`);
74
+ }
75
+ const hash = crypto.createHash('sha256');
76
+ hash.update('agent-workflows-plugin-bundle\0v2\0');
77
+ for (const entry of await collectBundleEntries(bundleRoot)) {
78
+ const type = entry.type === 'directory' ? 0x44 : entry.type === 'file' ? 0x46 : 0x4c;
79
+ const pathBytes = Buffer.from(entry.relativePath);
80
+ hash.update(Buffer.from([type]));
81
+ updateLength(hash, pathBytes.length);
82
+ hash.update(pathBytes);
83
+ updateLength(hash, entry.payload.length);
84
+ hash.update(entry.payload);
85
+ }
86
+ return `sha256:${hash.digest('hex')}`;
87
+ }
88
+ //# sourceMappingURL=bundle-integrity.js.map