@lesliechan721/aw 0.1.0-beta.10

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 (508) hide show
  1. package/dist/authoring/assets/aw-config.d.mts +51 -0
  2. package/dist/authoring/assets/aw-config.mjs +1025 -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/init-plugin.d.mts +2 -0
  8. package/dist/authoring/scripts/init-plugin.mjs +487 -0
  9. package/dist/authoring/scripts/init-plugin.mjs.map +1 -0
  10. package/dist/authoring/scripts/lib/javascript-import-scanner.d.mts +4 -0
  11. package/dist/authoring/scripts/lib/javascript-import-scanner.mjs +261 -0
  12. package/dist/authoring/scripts/lib/javascript-import-scanner.mjs.map +1 -0
  13. package/dist/authoring/scripts/lib/plugin-root.d.mts +26 -0
  14. package/dist/authoring/scripts/lib/plugin-root.mjs +125 -0
  15. package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -0
  16. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +69 -0
  17. package/dist/authoring/scripts/lib/plugin-version-check.mjs +563 -0
  18. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -0
  19. package/dist/authoring/scripts/lib/semver.d.mts +9 -0
  20. package/dist/authoring/scripts/lib/semver.mjs +63 -0
  21. package/dist/authoring/scripts/lib/semver.mjs.map +1 -0
  22. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +111 -0
  23. package/dist/authoring/scripts/lib/skill-scaffold.mjs +353 -0
  24. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -0
  25. package/dist/authoring/scripts/plugin-status.d.mts +2 -0
  26. package/dist/authoring/scripts/plugin-status.mjs +93 -0
  27. package/dist/authoring/scripts/plugin-status.mjs.map +1 -0
  28. package/dist/authoring/scripts/remove-plugin.d.mts +2 -0
  29. package/dist/authoring/scripts/remove-plugin.mjs +367 -0
  30. package/dist/authoring/scripts/remove-plugin.mjs.map +1 -0
  31. package/dist/authoring/scripts/validate-plugin.d.mts +2 -0
  32. package/dist/authoring/scripts/validate-plugin.mjs +3465 -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/authoring/templates/aw-config-runtime.d.mts +2 -0
  38. package/dist/authoring/templates/aw-config-runtime.mjs +407 -0
  39. package/dist/authoring/templates/aw-config-runtime.mjs.map +1 -0
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.js +8 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/scripts/aw-skill-eval-materializer.d.ts +24 -0
  44. package/dist/scripts/aw-skill-eval-materializer.js +309 -0
  45. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
  46. package/dist/scripts/bundle-plugins.d.ts +17 -0
  47. package/dist/scripts/bundle-plugins.js +126 -0
  48. package/dist/scripts/bundle-plugins.js.map +1 -0
  49. package/dist/scripts/plugin-staging.d.ts +26 -0
  50. package/dist/scripts/plugin-staging.js +76 -0
  51. package/dist/scripts/plugin-staging.js.map +1 -0
  52. package/dist/scripts/test-plugin-scripts.d.ts +7 -0
  53. package/dist/scripts/test-plugin-scripts.js +610 -0
  54. package/dist/scripts/test-plugin-scripts.js.map +1 -0
  55. package/dist/src/adapters/helpers.d.ts +44 -0
  56. package/dist/src/adapters/helpers.js +95 -0
  57. package/dist/src/adapters/helpers.js.map +1 -0
  58. package/dist/src/authoring/workspace-commands.d.ts +70 -0
  59. package/dist/src/authoring/workspace-commands.js +158 -0
  60. package/dist/src/authoring/workspace-commands.js.map +1 -0
  61. package/dist/src/commands/aw-capabilities.d.ts +78 -0
  62. package/dist/src/commands/aw-capabilities.js +254 -0
  63. package/dist/src/commands/aw-capabilities.js.map +1 -0
  64. package/dist/src/commands/catalog-dev-source.d.ts +120 -0
  65. package/dist/src/commands/catalog-dev-source.js +434 -0
  66. package/dist/src/commands/catalog-dev-source.js.map +1 -0
  67. package/dist/src/commands/catalog-generation.d.ts +16 -0
  68. package/dist/src/commands/catalog-generation.js +9 -0
  69. package/dist/src/commands/catalog-generation.js.map +1 -0
  70. package/dist/src/commands/catalog-publication-inspection.d.ts +138 -0
  71. package/dist/src/commands/catalog-publication-inspection.js +711 -0
  72. package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
  73. package/dist/src/commands/catalog-publication-journal.d.ts +56 -0
  74. package/dist/src/commands/catalog-publication-journal.js +215 -0
  75. package/dist/src/commands/catalog-publication-journal.js.map +1 -0
  76. package/dist/src/commands/catalog-publication-target.d.ts +18 -0
  77. package/dist/src/commands/catalog-publication-target.js +95 -0
  78. package/dist/src/commands/catalog-publication-target.js.map +1 -0
  79. package/dist/src/commands/catalog-publish.d.ts +103 -0
  80. package/dist/src/commands/catalog-publish.js +804 -0
  81. package/dist/src/commands/catalog-publish.js.map +1 -0
  82. package/dist/src/commands/catalog-source.d.ts +134 -0
  83. package/dist/src/commands/catalog-source.js +377 -0
  84. package/dist/src/commands/catalog-source.js.map +1 -0
  85. package/dist/src/commands/catalog-status.d.ts +56 -0
  86. package/dist/src/commands/catalog-status.js +217 -0
  87. package/dist/src/commands/catalog-status.js.map +1 -0
  88. package/dist/src/commands/catalog-store.d.ts +80 -0
  89. package/dist/src/commands/catalog-store.js +348 -0
  90. package/dist/src/commands/catalog-store.js.map +1 -0
  91. package/dist/src/commands/catalog-workspace-resolution.d.ts +13 -0
  92. package/dist/src/commands/catalog-workspace-resolution.js +42 -0
  93. package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
  94. package/dist/src/commands/console.d.ts +3 -0
  95. package/dist/src/commands/console.js +44 -0
  96. package/dist/src/commands/console.js.map +1 -0
  97. package/dist/src/commands/dependency-operation-plan.d.ts +58 -0
  98. package/dist/src/commands/dependency-operation-plan.js +261 -0
  99. package/dist/src/commands/dependency-operation-plan.js.map +1 -0
  100. package/dist/src/commands/init.d.ts +25 -0
  101. package/dist/src/commands/init.js +42 -0
  102. package/dist/src/commands/init.js.map +1 -0
  103. package/dist/src/commands/offline-cleanup-evidence.d.ts +59 -0
  104. package/dist/src/commands/offline-cleanup-evidence.js +163 -0
  105. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -0
  106. package/dist/src/commands/operation-plan.d.ts +126 -0
  107. package/dist/src/commands/operation-plan.js +47 -0
  108. package/dist/src/commands/operation-plan.js.map +1 -0
  109. package/dist/src/commands/operation-planner.d.ts +46 -0
  110. package/dist/src/commands/operation-planner.js +139 -0
  111. package/dist/src/commands/operation-planner.js.map +1 -0
  112. package/dist/src/commands/options.d.ts +70 -0
  113. package/dist/src/commands/options.js +194 -0
  114. package/dist/src/commands/options.js.map +1 -0
  115. package/dist/src/commands/plugin-capabilities.d.ts +22 -0
  116. package/dist/src/commands/plugin-capabilities.js +159 -0
  117. package/dist/src/commands/plugin-capabilities.js.map +1 -0
  118. package/dist/src/commands/rebuild-command.d.ts +88 -0
  119. package/dist/src/commands/rebuild-command.js +3626 -0
  120. package/dist/src/commands/rebuild-command.js.map +1 -0
  121. package/dist/src/commands/rebuild-integration.d.ts +190 -0
  122. package/dist/src/commands/rebuild-integration.js +4439 -0
  123. package/dist/src/commands/rebuild-integration.js.map +1 -0
  124. package/dist/src/commands/rebuild-operations.d.ts +100 -0
  125. package/dist/src/commands/rebuild-operations.js +625 -0
  126. package/dist/src/commands/rebuild-operations.js.map +1 -0
  127. package/dist/src/commands/reconcile-operation-plan.d.ts +26 -0
  128. package/dist/src/commands/reconcile-operation-plan.js +28 -0
  129. package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
  130. package/dist/src/commands/review-publication.d.ts +99 -0
  131. package/dist/src/commands/review-publication.js +904 -0
  132. package/dist/src/commands/review-publication.js.map +1 -0
  133. package/dist/src/commands/runtime.d.ts +172 -0
  134. package/dist/src/commands/runtime.js +720 -0
  135. package/dist/src/commands/runtime.js.map +1 -0
  136. package/dist/src/commands/skill-eval.d.ts +33 -0
  137. package/dist/src/commands/skill-eval.js +363 -0
  138. package/dist/src/commands/skill-eval.js.map +1 -0
  139. package/dist/src/commands/status-v6.d.ts +206 -0
  140. package/dist/src/commands/status-v6.js +2175 -0
  141. package/dist/src/commands/status-v6.js.map +1 -0
  142. package/dist/src/commands/sync-command.d.ts +23 -0
  143. package/dist/src/commands/sync-command.js +242 -0
  144. package/dist/src/commands/sync-command.js.map +1 -0
  145. package/dist/src/commands/wizard.d.ts +56 -0
  146. package/dist/src/commands/wizard.js +58 -0
  147. package/dist/src/commands/wizard.js.map +1 -0
  148. package/dist/src/commands/write-commands.d.ts +7 -0
  149. package/dist/src/commands/write-commands.js +190 -0
  150. package/dist/src/commands/write-commands.js.map +1 -0
  151. package/dist/src/constants.d.ts +31 -0
  152. package/dist/src/constants.js +32 -0
  153. package/dist/src/constants.js.map +1 -0
  154. package/dist/src/eval/manifest-v1.d.ts +67 -0
  155. package/dist/src/eval/manifest-v1.js +347 -0
  156. package/dist/src/eval/manifest-v1.js.map +1 -0
  157. package/dist/src/generators/agents.d.ts +3 -0
  158. package/dist/src/generators/agents.js +46 -0
  159. package/dist/src/generators/agents.js.map +1 -0
  160. package/dist/src/generators/hooks.d.ts +15 -0
  161. package/dist/src/generators/hooks.js +76 -0
  162. package/dist/src/generators/hooks.js.map +1 -0
  163. package/dist/src/generators/instructions.d.ts +13 -0
  164. package/dist/src/generators/instructions.js +66 -0
  165. package/dist/src/generators/instructions.js.map +1 -0
  166. package/dist/src/generators/local-plugin.d.ts +56 -0
  167. package/dist/src/generators/local-plugin.js +1373 -0
  168. package/dist/src/generators/local-plugin.js.map +1 -0
  169. package/dist/src/generators/permissions.d.ts +10 -0
  170. package/dist/src/generators/permissions.js +37 -0
  171. package/dist/src/generators/permissions.js.map +1 -0
  172. package/dist/src/generators/shared.d.ts +2 -0
  173. package/dist/src/generators/shared.js +15 -0
  174. package/dist/src/generators/shared.js.map +1 -0
  175. package/dist/src/index.d.ts +41 -0
  176. package/dist/src/index.js +3327 -0
  177. package/dist/src/index.js.map +1 -0
  178. package/dist/src/output/command-receipt.d.ts +87 -0
  179. package/dist/src/output/command-receipt.js +302 -0
  180. package/dist/src/output/command-receipt.js.map +1 -0
  181. package/dist/src/output/debug-log.d.ts +4 -0
  182. package/dist/src/output/debug-log.js +97 -0
  183. package/dist/src/output/debug-log.js.map +1 -0
  184. package/dist/src/output/equivalent-command.d.ts +9 -0
  185. package/dist/src/output/equivalent-command.js +39 -0
  186. package/dist/src/output/equivalent-command.js.map +1 -0
  187. package/dist/src/output/model.d.ts +76 -0
  188. package/dist/src/output/model.js +2 -0
  189. package/dist/src/output/model.js.map +1 -0
  190. package/dist/src/output/rebuild-progress.d.ts +21 -0
  191. package/dist/src/output/rebuild-progress.js +128 -0
  192. package/dist/src/output/rebuild-progress.js.map +1 -0
  193. package/dist/src/output/redact.d.ts +3 -0
  194. package/dist/src/output/redact.js +39 -0
  195. package/dist/src/output/redact.js.map +1 -0
  196. package/dist/src/output/reporter.d.ts +9 -0
  197. package/dist/src/output/reporter.js +133 -0
  198. package/dist/src/output/reporter.js.map +1 -0
  199. package/dist/src/portable/commands.d.ts +124 -0
  200. package/dist/src/portable/commands.js +557 -0
  201. package/dist/src/portable/commands.js.map +1 -0
  202. package/dist/src/portable/materializer.d.ts +50 -0
  203. package/dist/src/portable/materializer.js +462 -0
  204. package/dist/src/portable/materializer.js.map +1 -0
  205. package/dist/src/portable/skills-cli.d.ts +43 -0
  206. package/dist/src/portable/skills-cli.js +148 -0
  207. package/dist/src/portable/skills-cli.js.map +1 -0
  208. package/dist/src/tui/catalog-freshness.d.ts +1 -0
  209. package/dist/src/tui/catalog-freshness.js +2 -0
  210. package/dist/src/tui/catalog-freshness.js.map +1 -0
  211. package/dist/src/tui/catalog-generation.d.ts +21 -0
  212. package/dist/src/tui/catalog-generation.js +116 -0
  213. package/dist/src/tui/catalog-generation.js.map +1 -0
  214. package/dist/src/tui/catalog-sources/projection.d.ts +4 -0
  215. package/dist/src/tui/catalog-sources/projection.js +17 -0
  216. package/dist/src/tui/catalog-sources/projection.js.map +1 -0
  217. package/dist/src/tui/catalog-sources/review.d.ts +3 -0
  218. package/dist/src/tui/catalog-sources/review.js +13 -0
  219. package/dist/src/tui/catalog-sources/review.js.map +1 -0
  220. package/dist/src/tui/catalog-sources/screens.d.ts +12 -0
  221. package/dist/src/tui/catalog-sources/screens.js +33 -0
  222. package/dist/src/tui/catalog-sources/screens.js.map +1 -0
  223. package/dist/src/tui/catalog-sources/session.d.ts +22 -0
  224. package/dist/src/tui/catalog-sources/session.js +225 -0
  225. package/dist/src/tui/catalog-sources/session.js.map +1 -0
  226. package/dist/src/tui/catalog-sources/types.d.ts +41 -0
  227. package/dist/src/tui/catalog-sources/types.js +2 -0
  228. package/dist/src/tui/catalog-sources/types.js.map +1 -0
  229. package/dist/src/tui/components.d.ts +102 -0
  230. package/dist/src/tui/components.js +184 -0
  231. package/dist/src/tui/components.js.map +1 -0
  232. package/dist/src/tui/console-app-v4.d.ts +20 -0
  233. package/dist/src/tui/console-app-v4.js +5066 -0
  234. package/dist/src/tui/console-app-v4.js.map +1 -0
  235. package/dist/src/tui/controller-runtime.d.ts +23 -0
  236. package/dist/src/tui/controller-runtime.js +2011 -0
  237. package/dist/src/tui/controller-runtime.js.map +1 -0
  238. package/dist/src/tui/controller.d.ts +557 -0
  239. package/dist/src/tui/controller.js +2120 -0
  240. package/dist/src/tui/controller.js.map +1 -0
  241. package/dist/src/tui/diagnostics.d.ts +30 -0
  242. package/dist/src/tui/diagnostics.js +71 -0
  243. package/dist/src/tui/diagnostics.js.map +1 -0
  244. package/dist/src/tui/index.d.ts +17 -0
  245. package/dist/src/tui/index.js +17 -0
  246. package/dist/src/tui/index.js.map +1 -0
  247. package/dist/src/tui/input-display.d.ts +8 -0
  248. package/dist/src/tui/input-display.js +36 -0
  249. package/dist/src/tui/input-display.js.map +1 -0
  250. package/dist/src/tui/keys.d.ts +12 -0
  251. package/dist/src/tui/keys.js +22 -0
  252. package/dist/src/tui/keys.js.map +1 -0
  253. package/dist/src/tui/layout.d.ts +12 -0
  254. package/dist/src/tui/layout.js +19 -0
  255. package/dist/src/tui/layout.js.map +1 -0
  256. package/dist/src/tui/model.d.ts +424 -0
  257. package/dist/src/tui/model.js +1493 -0
  258. package/dist/src/tui/model.js.map +1 -0
  259. package/dist/src/tui/operation-review-planner.d.ts +21 -0
  260. package/dist/src/tui/operation-review-planner.js +622 -0
  261. package/dist/src/tui/operation-review-planner.js.map +1 -0
  262. package/dist/src/tui/prompt.d.ts +8 -0
  263. package/dist/src/tui/prompt.js +231 -0
  264. package/dist/src/tui/prompt.js.map +1 -0
  265. package/dist/src/tui/router.d.ts +206 -0
  266. package/dist/src/tui/router.js +137 -0
  267. package/dist/src/tui/router.js.map +1 -0
  268. package/dist/src/tui/runner.d.ts +11 -0
  269. package/dist/src/tui/runner.js +71 -0
  270. package/dist/src/tui/runner.js.map +1 -0
  271. package/dist/src/tui/source-ref-presets.d.ts +3 -0
  272. package/dist/src/tui/source-ref-presets.js +11 -0
  273. package/dist/src/tui/source-ref-presets.js.map +1 -0
  274. package/dist/src/tui/theme.d.ts +26 -0
  275. package/dist/src/tui/theme.js +28 -0
  276. package/dist/src/tui/theme.js.map +1 -0
  277. package/dist/src/tui/viewport.d.ts +20 -0
  278. package/dist/src/tui/viewport.js +29 -0
  279. package/dist/src/tui/viewport.js.map +1 -0
  280. package/dist/src/tui/views.d.ts +57 -0
  281. package/dist/src/tui/views.js +201 -0
  282. package/dist/src/tui/views.js.map +1 -0
  283. package/dist/src/tui/wizard.d.ts +11 -0
  284. package/dist/src/tui/wizard.js +323 -0
  285. package/dist/src/tui/wizard.js.map +1 -0
  286. package/dist/src/types.d.ts +474 -0
  287. package/dist/src/types.js +34 -0
  288. package/dist/src/types.js.map +1 -0
  289. package/dist/src/utils/agent-version.d.ts +19 -0
  290. package/dist/src/utils/agent-version.js +205 -0
  291. package/dist/src/utils/agent-version.js.map +1 -0
  292. package/dist/src/utils/artifact-plan.d.ts +27 -0
  293. package/dist/src/utils/artifact-plan.js +453 -0
  294. package/dist/src/utils/artifact-plan.js.map +1 -0
  295. package/dist/src/utils/artifact-renderer.d.ts +129 -0
  296. package/dist/src/utils/artifact-renderer.js +400 -0
  297. package/dist/src/utils/artifact-renderer.js.map +1 -0
  298. package/dist/src/utils/artifact-request.d.ts +16 -0
  299. package/dist/src/utils/artifact-request.js +42 -0
  300. package/dist/src/utils/artifact-request.js.map +1 -0
  301. package/dist/src/utils/artifact-sources.d.ts +8 -0
  302. package/dist/src/utils/artifact-sources.js +10 -0
  303. package/dist/src/utils/artifact-sources.js.map +1 -0
  304. package/dist/src/utils/aw-home-mutation-lock.d.ts +11 -0
  305. package/dist/src/utils/aw-home-mutation-lock.js +83 -0
  306. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -0
  307. package/dist/src/utils/bundle-integrity.d.ts +2 -0
  308. package/dist/src/utils/bundle-integrity.js +63 -0
  309. package/dist/src/utils/bundle-integrity.js.map +1 -0
  310. package/dist/src/utils/bundle-layout.d.ts +4 -0
  311. package/dist/src/utils/bundle-layout.js +531 -0
  312. package/dist/src/utils/bundle-layout.js.map +1 -0
  313. package/dist/src/utils/catalog-digests.d.ts +18 -0
  314. package/dist/src/utils/catalog-digests.js +156 -0
  315. package/dist/src/utils/catalog-digests.js.map +1 -0
  316. package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
  317. package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
  318. package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
  319. package/dist/src/utils/catalog-generation-error.d.ts +16 -0
  320. package/dist/src/utils/catalog-generation-error.js +30 -0
  321. package/dist/src/utils/catalog-generation-error.js.map +1 -0
  322. package/dist/src/utils/catalog-generation-resolver.d.ts +32 -0
  323. package/dist/src/utils/catalog-generation-resolver.js +251 -0
  324. package/dist/src/utils/catalog-generation-resolver.js.map +1 -0
  325. package/dist/src/utils/catalog-generation-service.d.ts +161 -0
  326. package/dist/src/utils/catalog-generation-service.js +1237 -0
  327. package/dist/src/utils/catalog-generation-service.js.map +1 -0
  328. package/dist/src/utils/catalog-generation-state.d.ts +22 -0
  329. package/dist/src/utils/catalog-generation-state.js +192 -0
  330. package/dist/src/utils/catalog-generation-state.js.map +1 -0
  331. package/dist/src/utils/catalog-generation-store.d.ts +57 -0
  332. package/dist/src/utils/catalog-generation-store.js +397 -0
  333. package/dist/src/utils/catalog-generation-store.js.map +1 -0
  334. package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
  335. package/dist/src/utils/catalog-manifest-v7.js +98 -0
  336. package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
  337. package/dist/src/utils/catalog-operation-context.d.ts +20 -0
  338. package/dist/src/utils/catalog-operation-context.js +141 -0
  339. package/dist/src/utils/catalog-operation-context.js.map +1 -0
  340. package/dist/src/utils/catalog-public-error.d.ts +19 -0
  341. package/dist/src/utils/catalog-public-error.js +100 -0
  342. package/dist/src/utils/catalog-public-error.js.map +1 -0
  343. package/dist/src/utils/catalog-runtime-projection.d.ts +33 -0
  344. package/dist/src/utils/catalog-runtime-projection.js +77 -0
  345. package/dist/src/utils/catalog-runtime-projection.js.map +1 -0
  346. package/dist/src/utils/catalog-snapshot.d.ts +10 -0
  347. package/dist/src/utils/catalog-snapshot.js +20 -0
  348. package/dist/src/utils/catalog-snapshot.js.map +1 -0
  349. package/dist/src/utils/catalog-source-identity.d.ts +5 -0
  350. package/dist/src/utils/catalog-source-identity.js +137 -0
  351. package/dist/src/utils/catalog-source-identity.js.map +1 -0
  352. package/dist/src/utils/catalog-source-impact.d.ts +20 -0
  353. package/dist/src/utils/catalog-source-impact.js +222 -0
  354. package/dist/src/utils/catalog-source-impact.js.map +1 -0
  355. package/dist/src/utils/catalog-source-presentation.d.ts +1 -0
  356. package/dist/src/utils/catalog-source-presentation.js +32 -0
  357. package/dist/src/utils/catalog-source-presentation.js.map +1 -0
  358. package/dist/src/utils/catalog-source-references.d.ts +66 -0
  359. package/dist/src/utils/catalog-source-references.js +1180 -0
  360. package/dist/src/utils/catalog-source-references.js.map +1 -0
  361. package/dist/src/utils/catalog-sources.d.ts +53 -0
  362. package/dist/src/utils/catalog-sources.js +456 -0
  363. package/dist/src/utils/catalog-sources.js.map +1 -0
  364. package/dist/src/utils/codex-config.d.ts +126 -0
  365. package/dist/src/utils/codex-config.js +1032 -0
  366. package/dist/src/utils/codex-config.js.map +1 -0
  367. package/dist/src/utils/codex-manager.d.ts +81 -0
  368. package/dist/src/utils/codex-manager.js +810 -0
  369. package/dist/src/utils/codex-manager.js.map +1 -0
  370. package/dist/src/utils/codex-marketplace-path.d.ts +5 -0
  371. package/dist/src/utils/codex-marketplace-path.js +45 -0
  372. package/dist/src/utils/codex-marketplace-path.js.map +1 -0
  373. package/dist/src/utils/codex-native-observation.d.ts +16 -0
  374. package/dist/src/utils/codex-native-observation.js +22 -0
  375. package/dist/src/utils/codex-native-observation.js.map +1 -0
  376. package/dist/src/utils/codex-native-render-receipt.d.ts +40 -0
  377. package/dist/src/utils/codex-native-render-receipt.js +205 -0
  378. package/dist/src/utils/codex-native-render-receipt.js.map +1 -0
  379. package/dist/src/utils/codex-reconciler.d.ts +128 -0
  380. package/dist/src/utils/codex-reconciler.js +294 -0
  381. package/dist/src/utils/codex-reconciler.js.map +1 -0
  382. package/dist/src/utils/codex-roles.d.ts +71 -0
  383. package/dist/src/utils/codex-roles.js +257 -0
  384. package/dist/src/utils/codex-roles.js.map +1 -0
  385. package/dist/src/utils/codex-shared-native.d.ts +63 -0
  386. package/dist/src/utils/codex-shared-native.js +142 -0
  387. package/dist/src/utils/codex-shared-native.js.map +1 -0
  388. package/dist/src/utils/codex-skill-staging.d.ts +11 -0
  389. package/dist/src/utils/codex-skill-staging.js +8 -0
  390. package/dist/src/utils/codex-skill-staging.js.map +1 -0
  391. package/dist/src/utils/codex-surface-analysis.d.ts +45 -0
  392. package/dist/src/utils/codex-surface-analysis.js +245 -0
  393. package/dist/src/utils/codex-surface-analysis.js.map +1 -0
  394. package/dist/src/utils/config-value.d.ts +3 -0
  395. package/dist/src/utils/config-value.js +23 -0
  396. package/dist/src/utils/config-value.js.map +1 -0
  397. package/dist/src/utils/dynamic-skill-tree.d.ts +36 -0
  398. package/dist/src/utils/dynamic-skill-tree.js +466 -0
  399. package/dist/src/utils/dynamic-skill-tree.js.map +1 -0
  400. package/dist/src/utils/file-rules.d.ts +1 -0
  401. package/dist/src/utils/file-rules.js +2 -0
  402. package/dist/src/utils/file-rules.js.map +1 -0
  403. package/dist/src/utils/git-catalog-provider.d.ts +22 -0
  404. package/dist/src/utils/git-catalog-provider.js +497 -0
  405. package/dist/src/utils/git-catalog-provider.js.map +1 -0
  406. package/dist/src/utils/hooks-contract.d.ts +1 -0
  407. package/dist/src/utils/hooks-contract.js +2 -0
  408. package/dist/src/utils/hooks-contract.js.map +1 -0
  409. package/dist/src/utils/json.d.ts +4 -0
  410. package/dist/src/utils/json.js +29 -0
  411. package/dist/src/utils/json.js.map +1 -0
  412. package/dist/src/utils/local-marketplace.d.ts +41 -0
  413. package/dist/src/utils/local-marketplace.js +316 -0
  414. package/dist/src/utils/local-marketplace.js.map +1 -0
  415. package/dist/src/utils/manifest.d.ts +11 -0
  416. package/dist/src/utils/manifest.js +33 -0
  417. package/dist/src/utils/manifest.js.map +1 -0
  418. package/dist/src/utils/marketplace.d.ts +3 -0
  419. package/dist/src/utils/marketplace.js +76 -0
  420. package/dist/src/utils/marketplace.js.map +1 -0
  421. package/dist/src/utils/multi-source-catalog.d.ts +66 -0
  422. package/dist/src/utils/multi-source-catalog.js +345 -0
  423. package/dist/src/utils/multi-source-catalog.js.map +1 -0
  424. package/dist/src/utils/native-cli.d.ts +118 -0
  425. package/dist/src/utils/native-cli.js +518 -0
  426. package/dist/src/utils/native-cli.js.map +1 -0
  427. package/dist/src/utils/orphan-marketplace-cleanup.d.ts +18 -0
  428. package/dist/src/utils/orphan-marketplace-cleanup.js +198 -0
  429. package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -0
  430. package/dist/src/utils/ownership.d.ts +194 -0
  431. package/dist/src/utils/ownership.js +723 -0
  432. package/dist/src/utils/ownership.js.map +1 -0
  433. package/dist/src/utils/path-catalog-provider.d.ts +7 -0
  434. package/dist/src/utils/path-catalog-provider.js +74 -0
  435. package/dist/src/utils/path-catalog-provider.js.map +1 -0
  436. package/dist/src/utils/paths.d.ts +40 -0
  437. package/dist/src/utils/paths.js +137 -0
  438. package/dist/src/utils/paths.js.map +1 -0
  439. package/dist/src/utils/platform-entries.d.ts +1 -0
  440. package/dist/src/utils/platform-entries.js +2 -0
  441. package/dist/src/utils/platform-entries.js.map +1 -0
  442. package/dist/src/utils/platform-support.d.ts +1 -0
  443. package/dist/src/utils/platform-support.js +2 -0
  444. package/dist/src/utils/platform-support.js.map +1 -0
  445. package/dist/src/utils/plugin-config-write.d.ts +110 -0
  446. package/dist/src/utils/plugin-config-write.js +773 -0
  447. package/dist/src/utils/plugin-config-write.js.map +1 -0
  448. package/dist/src/utils/plugin-config.d.ts +389 -0
  449. package/dist/src/utils/plugin-config.js +1642 -0
  450. package/dist/src/utils/plugin-config.js.map +1 -0
  451. package/dist/src/utils/plugin-dependencies.d.ts +12 -0
  452. package/dist/src/utils/plugin-dependencies.js +162 -0
  453. package/dist/src/utils/plugin-dependencies.js.map +1 -0
  454. package/dist/src/utils/plugin-intent-state.d.ts +34 -0
  455. package/dist/src/utils/plugin-intent-state.js +289 -0
  456. package/dist/src/utils/plugin-intent-state.js.map +1 -0
  457. package/dist/src/utils/plugin-script-contract.d.ts +1 -0
  458. package/dist/src/utils/plugin-script-contract.js +2 -0
  459. package/dist/src/utils/plugin-script-contract.js.map +1 -0
  460. package/dist/src/utils/plugin-scripts.d.ts +101 -0
  461. package/dist/src/utils/plugin-scripts.js +253 -0
  462. package/dist/src/utils/plugin-scripts.js.map +1 -0
  463. package/dist/src/utils/process-lock.d.ts +47 -0
  464. package/dist/src/utils/process-lock.js +532 -0
  465. package/dist/src/utils/process-lock.js.map +1 -0
  466. package/dist/src/utils/process-tree.d.ts +2 -0
  467. package/dist/src/utils/process-tree.js +2 -0
  468. package/dist/src/utils/process-tree.js.map +1 -0
  469. package/dist/src/utils/project-boundary.d.ts +9 -0
  470. package/dist/src/utils/project-boundary.js +67 -0
  471. package/dist/src/utils/project-boundary.js.map +1 -0
  472. package/dist/src/utils/rendered-contract.d.ts +8 -0
  473. package/dist/src/utils/rendered-contract.js +134 -0
  474. package/dist/src/utils/rendered-contract.js.map +1 -0
  475. package/dist/src/utils/runtime-skill-closure.d.ts +13 -0
  476. package/dist/src/utils/runtime-skill-closure.js +863 -0
  477. package/dist/src/utils/runtime-skill-closure.js.map +1 -0
  478. package/dist/src/utils/safe-fs.d.ts +21 -0
  479. package/dist/src/utils/safe-fs.js +111 -0
  480. package/dist/src/utils/safe-fs.js.map +1 -0
  481. package/dist/src/utils/skill-authoring.d.ts +1 -0
  482. package/dist/src/utils/skill-authoring.js +2 -0
  483. package/dist/src/utils/skill-authoring.js.map +1 -0
  484. package/dist/src/utils/skill-validation.d.ts +37 -0
  485. package/dist/src/utils/skill-validation.js +326 -0
  486. package/dist/src/utils/skill-validation.js.map +1 -0
  487. package/dist/src/utils/slash-commands.d.ts +1 -0
  488. package/dist/src/utils/slash-commands.js +2 -0
  489. package/dist/src/utils/slash-commands.js.map +1 -0
  490. package/dist/src/utils/state-paths.d.ts +14 -0
  491. package/dist/src/utils/state-paths.js +139 -0
  492. package/dist/src/utils/state-paths.js.map +1 -0
  493. package/dist/src/utils/target-eligibility.d.ts +13 -0
  494. package/dist/src/utils/target-eligibility.js +35 -0
  495. package/dist/src/utils/target-eligibility.js.map +1 -0
  496. package/dist/src/utils/target-order.d.ts +7 -0
  497. package/dist/src/utils/target-order.js +10 -0
  498. package/dist/src/utils/target-order.js.map +1 -0
  499. package/dist/src/utils/template-engine.d.ts +1 -0
  500. package/dist/src/utils/template-engine.js +2 -0
  501. package/dist/src/utils/template-engine.js.map +1 -0
  502. package/dist/src/utils/test-path-fence.d.ts +12 -0
  503. package/dist/src/utils/test-path-fence.js +31 -0
  504. package/dist/src/utils/test-path-fence.js.map +1 -0
  505. package/dist/vitest.config.d.ts +2 -0
  506. package/dist/vitest.config.js +16 -0
  507. package/dist/vitest.config.js.map +1 -0
  508. package/package.json +64 -0
@@ -0,0 +1,400 @@
1
+ import path from 'node:path';
2
+ import fs from 'fs-extra';
3
+ import { assertReadyPluginConfigStore, readPluginConfigStore, resolveEffectivePluginConfig, resolvePluginConfigStorePath, } from './plugin-config.js';
4
+ import { buildNodeScriptInvocation, buildPluginScriptSpawnEnv, calculateFileDigest, collectSensitivePluginConfigValues, defaultPluginProcessRunner, resolveBundledPluginFilePath, resolvePluginScriptTimeoutMs, summarizePluginScriptOutput, truncatePluginScriptOutput, } from './plugin-scripts.js';
5
+ import { resolveAwHome } from './paths.js';
6
+ import { getArtifactSourceBundleRelativePath } from './artifact-sources.js';
7
+ import { resolveArtifactRequest } from './artifact-request.js';
8
+ import { validateArtifactPlan } from './artifact-plan.js';
9
+ const SUPPORTED_ARTIFACT_RENDER_EVENTS = new Set([
10
+ 'install',
11
+ 'refresh',
12
+ 'materialize',
13
+ ]);
14
+ function artifactRendererCodexHome(env) {
15
+ return env.AW_CODEX_HOME || path.join(resolveAwHome(env), 'isolated-codex-home');
16
+ }
17
+ function artifactRendererClaudeHome(env) {
18
+ return env.AW_CLAUDE_HOME || path.join(resolveAwHome(env), 'isolated-claude-home');
19
+ }
20
+ function isRecord(value) {
21
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
22
+ }
23
+ function assertArtifactRenderEvent(value) {
24
+ if (!SUPPORTED_ARTIFACT_RENDER_EVENTS.has(value)) {
25
+ throw new Error(`Artifact renderer only supports install, refresh, and materialize events; received "${value}".`);
26
+ }
27
+ return value;
28
+ }
29
+ export async function resolveArtifactRenderConfig(options) {
30
+ const pluginName = options.pluginName ?? options.manifest.name;
31
+ const schema = options.manifest.config?.fields;
32
+ if (!schema) {
33
+ const userStore = await readPluginConfigStore({
34
+ sourceId: options.sourceId,
35
+ sourceIdentity: options.sourceIdentity,
36
+ pluginName,
37
+ scope: 'user',
38
+ cwd: options.cwd,
39
+ env: options.env,
40
+ });
41
+ const projectStore = options.scope === 'user'
42
+ ? undefined
43
+ : await readPluginConfigStore({
44
+ sourceId: options.sourceId,
45
+ sourceIdentity: options.sourceIdentity,
46
+ pluginName,
47
+ scope: 'project',
48
+ cwd: options.cwd,
49
+ env: options.env,
50
+ });
51
+ assertReadyPluginConfigStore(userStore);
52
+ if (projectStore)
53
+ assertReadyPluginConfigStore(projectStore);
54
+ return {
55
+ mode: 'artifact-render',
56
+ targetScope: options.scope,
57
+ schema: undefined,
58
+ values: {},
59
+ sources: {},
60
+ issues: [],
61
+ stores: {
62
+ user: userStore,
63
+ ...(projectStore ? { project: projectStore } : {}),
64
+ },
65
+ };
66
+ }
67
+ const effective = await resolveEffectivePluginConfig({
68
+ sourceId: options.sourceId,
69
+ sourceIdentity: options.sourceIdentity,
70
+ pluginName,
71
+ manifest: options.manifest,
72
+ targetScope: options.scope,
73
+ cwd: options.cwd,
74
+ env: options.env,
75
+ });
76
+ return {
77
+ mode: 'artifact-render',
78
+ targetScope: options.scope,
79
+ schema,
80
+ values: effective.values,
81
+ sources: effective.sources,
82
+ issues: effective.issues,
83
+ stores: effective.stores,
84
+ };
85
+ }
86
+ export async function resolveArtifactRendererTarget(plugin) {
87
+ const entry = plugin.manifest.scripts?.artifacts?.render;
88
+ const bundleRoot = await fs.realpath(plugin.rootDir);
89
+ const manifestPath = await fs.realpath(plugin.manifestPath);
90
+ const manifestDigest = await calculateFileDigest(manifestPath);
91
+ if (!entry) {
92
+ return {
93
+ noOp: true,
94
+ bundleRoot,
95
+ sourceManifest: plugin.manifest,
96
+ manifestPath,
97
+ manifestDigest,
98
+ };
99
+ }
100
+ const entryPath = await resolveBundledPluginFilePath({
101
+ bundleRoot,
102
+ pluginRelativePath: entry.path,
103
+ fieldName: 'Artifact renderer',
104
+ });
105
+ return {
106
+ noOp: false,
107
+ entry,
108
+ entryPath,
109
+ bundleRoot,
110
+ sourceManifest: plugin.manifest,
111
+ manifestPath,
112
+ manifestDigest,
113
+ rendererDigest: await calculateFileDigest(entryPath),
114
+ };
115
+ }
116
+ export async function writeArtifactRendererContext(options) {
117
+ const event = assertArtifactRenderEvent(options.event);
118
+ if (options.target.noOp ||
119
+ !options.target.entry ||
120
+ !options.target.entryPath ||
121
+ !options.target.bundleRoot ||
122
+ !options.target.sourceManifest ||
123
+ !options.target.manifestPath ||
124
+ !options.target.manifestDigest ||
125
+ !options.target.rendererDigest) {
126
+ throw new Error('Cannot write artifact renderer context for a no-op target.');
127
+ }
128
+ const config = await resolveArtifactRenderConfig({
129
+ sourceId: options.sourceId,
130
+ sourceIdentity: options.sourceIdentity,
131
+ pluginName: options.target.sourceManifest.name,
132
+ manifest: options.target.sourceManifest,
133
+ scope: options.configScope ?? options.scope,
134
+ cwd: options.cwd,
135
+ env: options.commandEnv,
136
+ });
137
+ const distribution = options.platform === 'agent-skills' ? options.platform : undefined;
138
+ const platform = distribution ? undefined : options.platform;
139
+ const request = resolveArtifactRequest({
140
+ manifest: options.target.sourceManifest,
141
+ platform: options.platform,
142
+ scope: options.scope,
143
+ requestedArtifactIds: options.requestedArtifactIds,
144
+ });
145
+ const artifactSources = await Promise.all(request.declarations
146
+ .map(async (target) => ({
147
+ id: target.id,
148
+ target: target.target,
149
+ sourceDirs: await Promise.all((target.sourceDirs ?? []).map((_, index) => resolveBundledPluginFilePath({
150
+ bundleRoot: options.target.bundleRoot,
151
+ pluginRelativePath: `./${getArtifactSourceBundleRelativePath({
152
+ platform: target.platform,
153
+ distribution: target.distribution,
154
+ artifactId: target.id,
155
+ index,
156
+ })}`,
157
+ fieldName: `Artifact source ${target.id}[${index}]`,
158
+ }))),
159
+ })));
160
+ const context = {
161
+ event,
162
+ surface: distribution
163
+ ? { kind: 'distribution', name: distribution }
164
+ : { kind: 'platform', name: platform },
165
+ platform,
166
+ distribution,
167
+ scope: options.scope,
168
+ plugin: {
169
+ name: options.target.sourceManifest.name,
170
+ version: options.target.sourceManifest.version,
171
+ rootDir: options.target.bundleRoot,
172
+ },
173
+ config: {
174
+ mode: config.mode,
175
+ targetScope: config.targetScope,
176
+ schema: config.schema,
177
+ values: config.values,
178
+ sources: config.sources,
179
+ issues: config.issues,
180
+ },
181
+ changedConfigKeys: options.changedConfigKeys ?? [],
182
+ requestedArtifactIds: request.requestedArtifactIds,
183
+ previousArtifacts: options.previousArtifacts ?? [],
184
+ artifactSources,
185
+ runtimeImports: request.declarations
186
+ .flatMap((target) => (target.runtimeImports ?? []).map((runtimeImport) => {
187
+ if (!runtimeImport.resolved) {
188
+ throw new Error(`Artifact runtime import "${target.id}/${runtimeImport.name}" is not resolved in the bundle.`);
189
+ }
190
+ return {
191
+ artifactId: target.id,
192
+ name: runtimeImport.name,
193
+ providerPluginId: runtimeImport.resolved.providerPluginId,
194
+ exportName: runtimeImport.export,
195
+ path: path.join(options.target.bundleRoot, runtimeImport.resolved.path.replace(/^\.\//u, '')),
196
+ digest: runtimeImport.resolved.digest,
197
+ };
198
+ })),
199
+ paths: {
200
+ awHome: resolveAwHome(options.commandEnv),
201
+ codexHome: artifactRendererCodexHome(options.commandEnv),
202
+ claudeHome: artifactRendererClaudeHome(options.commandEnv),
203
+ manifestPath: options.target.manifestPath,
204
+ configStores: {
205
+ user: resolvePluginConfigStorePath({
206
+ sourceId: options.sourceId,
207
+ pluginName: options.target.sourceManifest.name,
208
+ scope: 'user',
209
+ cwd: options.cwd,
210
+ env: options.commandEnv,
211
+ }),
212
+ project: resolvePluginConfigStorePath({
213
+ sourceId: options.sourceId,
214
+ pluginName: options.target.sourceManifest.name,
215
+ scope: 'project',
216
+ cwd: options.cwd,
217
+ env: options.commandEnv,
218
+ }),
219
+ },
220
+ },
221
+ renderer: {
222
+ runner: options.target.entry.runner,
223
+ path: options.target.entryPath,
224
+ args: options.target.entry.args ?? [],
225
+ manifestDigest: options.target.manifestDigest,
226
+ rendererDigest: options.target.rendererDigest,
227
+ },
228
+ };
229
+ const tempRoot = path.join(resolveAwHome(options.commandEnv), 'tmp');
230
+ await fs.ensureDir(tempRoot);
231
+ const tempDir = await fs.mkdtemp(path.join(tempRoot, 'plugin-artifact-render-'));
232
+ const contextPath = path.join(tempDir, 'context.json');
233
+ await fs.writeJson(contextPath, context, { spaces: 2 });
234
+ try {
235
+ await fs.chmod(contextPath, 0o600);
236
+ }
237
+ catch {
238
+ // Best effort on non-POSIX filesystems.
239
+ }
240
+ return {
241
+ context,
242
+ contextPath,
243
+ tempDir,
244
+ sensitiveValues: collectSensitivePluginConfigValues(options.target.sourceManifest, config.values),
245
+ cleanup: async () => {
246
+ await fs.remove(tempDir);
247
+ },
248
+ };
249
+ }
250
+ function summarizeRenderOutput(value, sensitiveValues) {
251
+ const summary = summarizePluginScriptOutput(value, sensitiveValues);
252
+ return summary === '' ? '<empty>' : summary;
253
+ }
254
+ function assertArtifactPlanEnvelope(value, output) {
255
+ if (!isRecord(value)) {
256
+ throw new Error(`Artifact renderer must write a JSON object to stdout. stdout: ${output.stdoutSummary}. stderr: ${output.stderrSummary}`);
257
+ }
258
+ if (value.version !== 2) {
259
+ const migrationHint = value.version === 1
260
+ ? ' ArtifactPlan V1 is not supported by AW 1.0.0-beta.30; upgrade or reinstall the plugin.'
261
+ : '';
262
+ throw new Error(`Artifact renderer returned unsupported plan version "${String(value.version)}".${migrationHint} stderr: ${output.stderrSummary}`);
263
+ }
264
+ if (!Array.isArray(value.artifacts)) {
265
+ throw new Error(`Artifact renderer returned an invalid plan: "artifacts" must be an array. stdout: ${output.stdoutSummary}. stderr: ${output.stderrSummary}`);
266
+ }
267
+ return value;
268
+ }
269
+ function buildArtifactRendererInvocation(options) {
270
+ return buildNodeScriptInvocation({
271
+ entryPath: options.entryPath,
272
+ cwd: options.cwd,
273
+ env: options.env,
274
+ args: options.entry.args,
275
+ });
276
+ }
277
+ function assertRefreshKeysForEvent(event, changedConfigKeys) {
278
+ assertArtifactRenderEvent(event);
279
+ const keys = changedConfigKeys ? [...changedConfigKeys] : [];
280
+ if (event === 'refresh' && keys.length === 0) {
281
+ throw new Error('Artifact renderer refresh requires changedConfigKeys.');
282
+ }
283
+ return keys;
284
+ }
285
+ async function runArtifactRendererProcess(options) {
286
+ const runOptions = {
287
+ timeoutMs: options.timeoutMs,
288
+ ...(options.signal ? { signal: options.signal } : {}),
289
+ };
290
+ return options.runner
291
+ ? options.runner.run(options.invocation, runOptions)
292
+ : defaultPluginProcessRunner.run(options.invocation, {
293
+ ...runOptions,
294
+ sensitiveValues: options.sensitiveValues,
295
+ });
296
+ }
297
+ export async function runArtifactRenderer(options) {
298
+ options.signal?.throwIfAborted();
299
+ const event = assertArtifactRenderEvent(options.event);
300
+ const commandEnv = options.commandEnv ?? process.env;
301
+ const changedConfigKeys = assertRefreshKeysForEvent(event, options.changedConfigKeys);
302
+ const target = await resolveArtifactRendererTarget(options.plugin);
303
+ if (target.noOp) {
304
+ throw new Error(`Plugin "${options.plugin.manifest.name}" does not declare scripts.artifacts.render.`);
305
+ }
306
+ const writtenContext = await writeArtifactRendererContext({
307
+ sourceId: options.plugin.sourceId,
308
+ sourceIdentity: options.plugin.sourceIdentity,
309
+ target,
310
+ event,
311
+ platform: options.platform,
312
+ scope: options.scope,
313
+ ...(options.configScope ? { configScope: options.configScope } : {}),
314
+ cwd: options.cwd,
315
+ commandEnv,
316
+ changedConfigKeys,
317
+ previousArtifacts: options.previousArtifacts,
318
+ requestedArtifactIds: options.requestedArtifactIds,
319
+ });
320
+ try {
321
+ if (writtenContext.context.config.issues.length > 0) {
322
+ throw new Error(`Invalid AW config for ${writtenContext.context.plugin.name}: ${writtenContext.context.config.issues.map((issue) => `${issue.key} (${issue.type})`).join(', ')}.`);
323
+ }
324
+ await fs.ensureDir(path.join(writtenContext.tempDir, 'home'));
325
+ await fs.ensureDir(path.join(writtenContext.tempDir, 'tmp'));
326
+ const timeoutMs = resolvePluginScriptTimeoutMs({
327
+ cliTimeoutMs: options.scriptTimeoutMs,
328
+ manifestTimeoutMs: undefined,
329
+ });
330
+ const spawnEnv = buildPluginScriptSpawnEnv({
331
+ commandEnv,
332
+ contextPath: writtenContext.contextPath,
333
+ tempDir: writtenContext.tempDir,
334
+ plugin: writtenContext.context.plugin,
335
+ event,
336
+ ...(options.platform === 'agent-skills'
337
+ ? { distribution: options.platform }
338
+ : { platform: options.platform }),
339
+ scope: options.scope,
340
+ bundleRoot: writtenContext.context.plugin.rootDir,
341
+ });
342
+ const invocation = buildArtifactRendererInvocation({
343
+ entry: target.entry,
344
+ entryPath: target.entryPath,
345
+ cwd: options.cwd,
346
+ env: spawnEnv,
347
+ });
348
+ const result = await runArtifactRendererProcess({
349
+ invocation,
350
+ timeoutMs,
351
+ sensitiveValues: writtenContext.sensitiveValues,
352
+ signal: options.signal,
353
+ runner: options.runner,
354
+ });
355
+ const stdoutSummary = summarizeRenderOutput(result.stdout, writtenContext.sensitiveValues);
356
+ const stderrSummary = summarizeRenderOutput(result.stderr, writtenContext.sensitiveValues);
357
+ if (result.timedOut) {
358
+ throw new Error(`Artifact renderer timed out after ${timeoutMs} ms. stderr: ${stderrSummary}`);
359
+ }
360
+ if (result.exitCode !== 0) {
361
+ throw new Error(`Artifact renderer failed with exit code ${result.exitCode}. stderr: ${stderrSummary}`);
362
+ }
363
+ const rawStdout = truncatePluginScriptOutput(result.stdout).trim();
364
+ let parsed;
365
+ try {
366
+ parsed = JSON.parse(rawStdout);
367
+ }
368
+ catch {
369
+ throw new Error(`Artifact renderer must write JSON to stdout. stdout: ${stdoutSummary}. stderr: ${stderrSummary}`);
370
+ }
371
+ const plan = assertArtifactPlanEnvelope(parsed, {
372
+ stdoutSummary,
373
+ stderrSummary,
374
+ });
375
+ validateArtifactPlan({
376
+ manifest: options.plugin.manifest,
377
+ plan,
378
+ platform: options.platform,
379
+ scope: options.scope,
380
+ requestedArtifactIds: writtenContext.context.requestedArtifactIds,
381
+ renderConfig: writtenContext.context.config,
382
+ rendererDigest: target.rendererDigest,
383
+ manifestDigest: target.manifestDigest,
384
+ });
385
+ return {
386
+ plan,
387
+ target,
388
+ context: writtenContext.context,
389
+ exitCode: result.exitCode,
390
+ signal: result.signal,
391
+ stdout: stdoutSummary,
392
+ stderr: stderrSummary,
393
+ timedOut: result.timedOut,
394
+ };
395
+ }
396
+ finally {
397
+ await writtenContext.cleanup();
398
+ }
399
+ }
400
+ //# 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,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,kCAAkC,EAClC,0BAA0B,EAC1B,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,GAI3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AA+F1D,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAsB;IACpE,SAAS;IACT,SAAS;IACT,aAAa;CACd,CAAC,CAAC;AAEH,SAAS,yBAAyB,CAAC,GAAsB;IACvD,OAAO,GAAG,C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CAAC,OAAO,CAAC,MAAM;YAC3C,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,cAAc,EAAE,MAAM,CAAC,cAAc;SACtC,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,16 @@
1
+ import type { DistributionName, NormalizedPluginManifest, PlatformName, PluginArtifactTargetDefinition, Scope } from '../types.js';
2
+ export interface ResolvedArtifactRequest {
3
+ requestedArtifactIds: string[];
4
+ declarations: PluginArtifactTargetDefinition[];
5
+ }
6
+ export declare function resolveAwDeliveredArtifactIds(options: {
7
+ manifest: NormalizedPluginManifest;
8
+ platform: PlatformName | DistributionName;
9
+ scope: Scope;
10
+ }): string[];
11
+ export declare function resolveArtifactRequest(options: {
12
+ manifest: NormalizedPluginManifest;
13
+ platform: PlatformName | DistributionName;
14
+ scope: Scope;
15
+ requestedArtifactIds: readonly string[];
16
+ }): ResolvedArtifactRequest;
@@ -0,0 +1,42 @@
1
+ export function resolveAwDeliveredArtifactIds(options) {
2
+ return (options.manifest.artifacts?.targets ?? [])
3
+ .filter((target) => (target.platform ?? target.distribution) === options.platform
4
+ && target.scopes.includes(options.scope)
5
+ && target.delivery?.mode !== 'codex-native')
6
+ .map((target) => target.id);
7
+ }
8
+ export function resolveArtifactRequest(options) {
9
+ if (options.requestedArtifactIds.length === 0) {
10
+ throw new Error('Artifact renderer requires at least one requested artifact ID.');
11
+ }
12
+ const requested = new Set();
13
+ for (const [index, value] of options.requestedArtifactIds.entries()) {
14
+ if (typeof value !== 'string' || value.trim() === '') {
15
+ throw new Error(`Invalid requestedArtifactIds[${index}]: expected a non-empty artifact ID.`);
16
+ }
17
+ if (requested.has(value)) {
18
+ throw new Error(`Invalid requestedArtifactIds[${index}]: duplicate artifact ID "${value}".`);
19
+ }
20
+ requested.add(value);
21
+ }
22
+ const allowedDeclarations = (options.manifest.artifacts?.targets ?? []).filter((target) => (target.platform ?? target.distribution) === options.platform
23
+ && target.scopes.includes(options.scope));
24
+ const allowedById = new Map();
25
+ for (const declaration of allowedDeclarations) {
26
+ if (allowedById.has(declaration.id)) {
27
+ throw new Error(`Artifact renderer request is ambiguous because artifact ID "${declaration.id}" is declared more than once for ${options.platform}/${options.scope}.`);
28
+ }
29
+ allowedById.set(declaration.id, declaration);
30
+ }
31
+ for (const id of requested) {
32
+ if (!allowedById.has(id)) {
33
+ throw new Error(`Requested artifact ID "${id}" is not declared for ${options.platform}/${options.scope}.`);
34
+ }
35
+ }
36
+ const declarations = allowedDeclarations.filter((target) => requested.has(target.id));
37
+ return {
38
+ requestedArtifactIds: declarations.map((target) => target.id),
39
+ declarations,
40
+ };
41
+ }
42
+ //# sourceMappingURL=artifact-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-request.js","sourceRoot":"","sources":["../../../src/utils/artifact-request.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,6BAA6B,CAAC,OAI7C;IACC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,IAAI,EAAE,CAAC;SAC/C,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CACjB,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,QAAQ;WAC1D,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;WACrC,MAAM,CAAC,QAAQ,EAAE,IAAI,KAAK,cAAc,CAAC;SAC7C,GAAG,CAAC,CAAC,MAAM,EAA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YACpC,MAAM,IAAI,KAAK,CACb,+DAA+D,WAAW,CAAC,EAAE,oCAAoC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,KAAK,GAAG,CACtJ,CAAC;QACJ,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,0BAA0B,EAAE,yBAAyB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,KAAK,GAAG,CAC1F,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACtF,OAAO;QACL,oBAAoB,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7D,YAAY;KACb,CAAC;AACJ,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,11 @@
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
+ signal?: AbortSignal;
9
+ action: (token: AwHomeMutationToken) => Promise<T>;
10
+ }): Promise<T>;
11
+ export {};
@@ -0,0 +1,83 @@
1
+ import crypto from 'node:crypto';
2
+ import path from 'node:path';
3
+ import { acquireProcessLock } from './process-lock.js';
4
+ import { canonicalizePathThroughExistingAncestorSync, ensureRegularDirectoryPath, resolveAwHome, } from './state-paths.js';
5
+ import { assertTestWritablePath } from './test-path-fence.js';
6
+ const AW_HOME_MUTATION_LOCK_TIMEOUT_MS = 600_000;
7
+ const tokenRoots = new WeakMap();
8
+ function resolveAwHomeMutationCoordinationRoot(env = process.env) {
9
+ const awHome = canonicalizePathThroughExistingAncestorSync(resolveAwHome(env));
10
+ const identity = crypto.createHash('sha256')
11
+ .update(awHome)
12
+ .digest('hex')
13
+ .slice(0, 16);
14
+ return assertTestWritablePath(path.join(path.dirname(awHome), '.aw-local-marketplace-staging', `.runtime-state-${identity}`), 'AW_HOME mutation coordination root', '用 createIsolatedTestEnv() 生成默认 AW_HOME,或登记 AW_HOME 同盘 sibling lock 路径。');
15
+ }
16
+ async function releaseMutationLease(lease) {
17
+ let lastError;
18
+ for (let attempt = 0; attempt < 3; attempt += 1) {
19
+ try {
20
+ await lease.release();
21
+ return;
22
+ }
23
+ catch (error) {
24
+ lastError = error;
25
+ if (!new Set(['EACCES', 'EBUSY', 'EINTR', 'EIO', 'ENOTEMPTY', 'EPERM']).has(error.code ?? '')) {
26
+ throw error;
27
+ }
28
+ }
29
+ }
30
+ await lease.release().catch(() => undefined);
31
+ throw lastError;
32
+ }
33
+ function releaseWarning() {
34
+ try {
35
+ process.emitWarning('AW_HOME mutation completed, but its lock release failed.', { code: 'AW_HOME_MUTATION_LOCK_RELEASE_FAILED' });
36
+ }
37
+ catch {
38
+ // Diagnostics cannot replace the action result.
39
+ }
40
+ }
41
+ export async function withAwHomeMutationLock(options) {
42
+ const coordinationRoot = resolveAwHomeMutationCoordinationRoot(options.env);
43
+ if (options.token !== undefined) {
44
+ options.signal?.throwIfAborted();
45
+ const tokenRoot = tokenRoots.get(options.token);
46
+ if (tokenRoot === undefined) {
47
+ throw new Error('Invalid AW_HOME mutation token.');
48
+ }
49
+ if (tokenRoot !== coordinationRoot) {
50
+ throw new Error('AW_HOME mutation token belongs to a different coordination root.');
51
+ }
52
+ return options.action(options.token);
53
+ }
54
+ await ensureRegularDirectoryPath(coordinationRoot, 'AW_HOME mutation coordination root');
55
+ const lease = await acquireProcessLock({
56
+ lockPath: path.join(coordinationRoot, 'aw-home-mutation.lock'),
57
+ timeoutMs: AW_HOME_MUTATION_LOCK_TIMEOUT_MS,
58
+ signal: options.signal,
59
+ });
60
+ const token = Object.freeze({});
61
+ tokenRoots.set(token, coordinationRoot);
62
+ let result;
63
+ let actionError;
64
+ let succeeded = false;
65
+ try {
66
+ result = await options.action(token);
67
+ succeeded = true;
68
+ }
69
+ catch (error) {
70
+ actionError = error;
71
+ }
72
+ tokenRoots.delete(token);
73
+ try {
74
+ await releaseMutationLease(lease);
75
+ }
76
+ catch {
77
+ releaseWarning();
78
+ }
79
+ if (!succeeded)
80
+ throw actionError;
81
+ return result;
82
+ }
83
+ //# 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,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAyB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EACL,2CAA2C,EAC3C,0BAA0B,EAC1B,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,gCAAgC,GAAG,OAAO,CAAC;AACjD,MAAM,UAAU,GAAG,IAAI,OAAO,EAAkB,CAAC;AAQjD,SAAS,qCAAqC,CAC5C,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,MAAM,GAAG,2CAA2C,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/E,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;SACzC,MAAM,CAAC,MAAM,CAAC;SACd,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,OAAO,sBAAsB,CAC3B,IAAI,CAAC,IAAI,CACP,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EACpB,+BAA+B,EAC/B,kBAAkB,QAAQ,EAA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@
1
+ export declare function calculateFileDigest(filePath: string): Promise<string>;
2
+ export declare function calculatePluginBundleFingerprint(bundleRoot: string): Promise<string>;