@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,33 @@
1
+ export class CommandWarningError extends Error {
2
+ warnings;
3
+ exitCode;
4
+ constructor(message, options = {}) {
5
+ super(message);
6
+ this.name = 'CommandWarningError';
7
+ this.warnings = [...new Set(options.warnings ?? [])];
8
+ this.exitCode = options.exitCode ?? 1;
9
+ }
10
+ }
11
+ export function isCommandWarningError(error) {
12
+ return (error instanceof Error &&
13
+ error.name === 'CommandWarningError' &&
14
+ Array.isArray(error.warnings) &&
15
+ typeof error.exitCode === 'number');
16
+ }
17
+ export class AgentVersionGateError extends Error {
18
+ code = 'AGENT_VERSION_GATE_FAILED';
19
+ payload;
20
+ constructor(message, payload) {
21
+ super(message);
22
+ this.name = 'AgentVersionGateError';
23
+ this.payload = payload;
24
+ }
25
+ }
26
+ export function isAgentVersionGateError(error) {
27
+ return (error instanceof Error &&
28
+ error.name === 'AgentVersionGateError' &&
29
+ typeof error.code === 'string' &&
30
+ typeof error.payload === 'object' &&
31
+ Array.isArray(error.payload.failures));
32
+ }
33
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAuXA,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,QAAQ,CAAW;IACnB,QAAQ,CAAS;IAE1B,YACE,OAAe,EACf,UAGI,EAAE;QAEN,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,KAAK,CAAC,IAAI,KAAK,qBAAqB;QACpC,KAAK,CAAC,OAAO,CAAE,KAA6B,CAAC,QAAQ,CAAC;QACtD,OAAQ,KAA6B,CAAC,QAAQ,KAAK,QAAQ,CAC5D,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,IAAI,GAAG,2BAA2B,CAAC;IACnC,OAAO,CAA+B;IAE/C,YACE,OAAe,EACf,OAAqC;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,KAAK,CAAC,IAAI,KAAK,uBAAuB;QACtC,OAAQ,KAA+B,CAAC,IAAI,KAAK,QAAQ;QACzD,OAAQ,KAA+B,CAAC,OAAO,KAAK,QAAQ;QAC5D,KAAK,CAAC,OAAO,CAAE,KAA+B,CAAC,OAAO,CAAC,QAAQ,CAAC,CACjE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ProcessLockLease } from './process-lock.js';
2
+ export declare function markActiveMarketplaceDurableCommit(): void;
3
+ export declare function setActiveMarketplaceLifecycleBeforeAcquireHookForTests(hook: ((coordinationRoot: string) => Promise<void>) | undefined): void;
4
+ export declare function setActiveMarketplaceCoordinationBeforeReleaseHookForTests(hook: ((lockPath: string, attempt: number) => Promise<void>) | undefined): void;
5
+ export declare function resolveActiveMarketplaceRuntimeCoordinationRoot(env?: NodeJS.ProcessEnv): string;
6
+ export declare function acquireActiveMarketplaceRuntimeLease(env?: NodeJS.ProcessEnv): Promise<ProcessLockLease>;
7
+ export declare function acquireActiveMarketplaceRuntimeLeaseAtRoot(coordinationRoot: string): Promise<ProcessLockLease>;
8
+ export declare function acquireActiveMarketplaceLifecycleLease(env?: NodeJS.ProcessEnv): Promise<ProcessLockLease>;
9
+ export declare function acquireActiveMarketplaceLifecycleLeaseAtRoot(coordinationRoot: string): Promise<ProcessLockLease>;
10
+ export declare function releaseActiveMarketplaceCoordinationLease(lease: ProcessLockLease): Promise<void>;
11
+ export declare function withActiveMarketplaceRuntimeLease<T>(env: NodeJS.ProcessEnv | undefined, action: () => Promise<T>): Promise<T>;
12
+ export declare function withActiveMarketplaceLifecycleLease<T>(env: NodeJS.ProcessEnv | undefined, action: () => Promise<T>): Promise<T>;
@@ -0,0 +1,133 @@
1
+ import crypto from 'node:crypto';
2
+ import { AsyncLocalStorage } from 'node:async_hooks';
3
+ import path from 'node:path';
4
+ import { acquireProcessLock } from './process-lock.js';
5
+ import { canonicalizePathThroughExistingAncestorSync, ensureRegularDirectoryPath, resolveAwHome, } from './state-paths.js';
6
+ import { assertTestWritablePath } from './test-path-fence.js';
7
+ const ACTIVE_MARKETPLACE_RUNTIME_LOCK_TIMEOUT_MS = 600_000;
8
+ const ACTIVE_MARKETPLACE_RUNTIME_LOCK_FILE = 'runtime-state.lock';
9
+ const RETRYABLE_RELEASE_ERROR_CODES = new Set([
10
+ 'EACCES',
11
+ 'EBUSY',
12
+ 'EINTR',
13
+ 'EIO',
14
+ 'ENOTEMPTY',
15
+ 'EPERM',
16
+ ]);
17
+ let activeMarketplaceLifecycleBeforeAcquireHookForTests;
18
+ let activeMarketplaceCoordinationBeforeReleaseHookForTests;
19
+ const coordinationCommitStorage = new AsyncLocalStorage();
20
+ export function markActiveMarketplaceDurableCommit() {
21
+ let context = coordinationCommitStorage.getStore();
22
+ while (context) {
23
+ context.durableCommit = true;
24
+ context = context.parent;
25
+ }
26
+ }
27
+ export function setActiveMarketplaceLifecycleBeforeAcquireHookForTests(hook) {
28
+ activeMarketplaceLifecycleBeforeAcquireHookForTests = hook;
29
+ }
30
+ export function setActiveMarketplaceCoordinationBeforeReleaseHookForTests(hook) {
31
+ activeMarketplaceCoordinationBeforeReleaseHookForTests = hook;
32
+ }
33
+ export function resolveActiveMarketplaceRuntimeCoordinationRoot(env = process.env) {
34
+ const awHome = canonicalizePathThroughExistingAncestorSync(resolveAwHome(env));
35
+ const identity = crypto.createHash('sha256')
36
+ .update(awHome)
37
+ .digest('hex')
38
+ .slice(0, 16);
39
+ return assertTestWritablePath(path.join(path.dirname(awHome), '.aw-local-marketplace-staging', `.runtime-state-${identity}`), 'active marketplace runtime coordination root', '用 createIsolatedTestEnv() 生成默认 AW_HOME,或登记 AW_HOME 同盘 sibling lock 路径。');
40
+ }
41
+ export async function acquireActiveMarketplaceRuntimeLease(env = process.env) {
42
+ const coordinationRoot = resolveActiveMarketplaceRuntimeCoordinationRoot(env);
43
+ return acquireActiveMarketplaceRuntimeLeaseAtRoot(coordinationRoot);
44
+ }
45
+ export async function acquireActiveMarketplaceRuntimeLeaseAtRoot(coordinationRoot) {
46
+ await ensureRegularDirectoryPath(coordinationRoot, 'Active marketplace coordination root');
47
+ return acquireProcessLock({
48
+ lockPath: path.join(coordinationRoot, ACTIVE_MARKETPLACE_RUNTIME_LOCK_FILE),
49
+ timeoutMs: ACTIVE_MARKETPLACE_RUNTIME_LOCK_TIMEOUT_MS,
50
+ });
51
+ }
52
+ export async function acquireActiveMarketplaceLifecycleLease(env = process.env) {
53
+ const coordinationRoot = resolveActiveMarketplaceRuntimeCoordinationRoot(env);
54
+ return acquireActiveMarketplaceLifecycleLeaseAtRoot(coordinationRoot);
55
+ }
56
+ export async function acquireActiveMarketplaceLifecycleLeaseAtRoot(coordinationRoot) {
57
+ await ensureRegularDirectoryPath(coordinationRoot, 'Active marketplace coordination root');
58
+ await activeMarketplaceLifecycleBeforeAcquireHookForTests?.(coordinationRoot);
59
+ return acquireProcessLock({
60
+ lockPath: path.join(coordinationRoot, 'lifecycle-state.lock'),
61
+ timeoutMs: ACTIVE_MARKETPLACE_RUNTIME_LOCK_TIMEOUT_MS,
62
+ });
63
+ }
64
+ export async function releaseActiveMarketplaceCoordinationLease(lease) {
65
+ let lastError;
66
+ for (let attempt = 0; attempt < 3; attempt += 1) {
67
+ try {
68
+ await activeMarketplaceCoordinationBeforeReleaseHookForTests?.(lease.lockPath, attempt + 1);
69
+ await lease.release();
70
+ return;
71
+ }
72
+ catch (error) {
73
+ lastError = error;
74
+ const code = error.code ?? '';
75
+ if (!RETRYABLE_RELEASE_ERROR_CODES.has(code))
76
+ throw error;
77
+ }
78
+ }
79
+ await lease.release().catch(() => undefined);
80
+ throw lastError;
81
+ }
82
+ async function withCoordinationLease(lease, label, action) {
83
+ let result;
84
+ let actionError;
85
+ let actionSucceeded = false;
86
+ const commitContext = {
87
+ parent: coordinationCommitStorage.getStore(),
88
+ durableCommit: false,
89
+ };
90
+ try {
91
+ result = await coordinationCommitStorage.run(commitContext, action);
92
+ actionSucceeded = true;
93
+ }
94
+ catch (error) {
95
+ actionError = error;
96
+ }
97
+ try {
98
+ await releaseActiveMarketplaceCoordinationLease(lease);
99
+ }
100
+ catch (releaseError) {
101
+ if (!actionSucceeded) {
102
+ try {
103
+ process.emitWarning(`${label} action failed, and its lease release also failed.`, { code: 'AW_COORDINATION_LOCK_RELEASE_FAILED' });
104
+ }
105
+ catch {
106
+ // Diagnostics cannot replace the primary action error.
107
+ }
108
+ throw actionError;
109
+ }
110
+ if (commitContext.durableCommit) {
111
+ try {
112
+ process.emitWarning(`${label} committed its durable result, but its lease release failed.`, { code: 'AW_COORDINATION_LOCK_RELEASE_FAILED' });
113
+ }
114
+ catch {
115
+ // Diagnostics cannot replace a durable result.
116
+ }
117
+ return result;
118
+ }
119
+ throw releaseError;
120
+ }
121
+ if (!actionSucceeded)
122
+ throw actionError;
123
+ return result;
124
+ }
125
+ export async function withActiveMarketplaceRuntimeLease(env, action) {
126
+ const lease = await acquireActiveMarketplaceRuntimeLease(env);
127
+ return withCoordinationLease(lease, 'Active marketplace runtime', action);
128
+ }
129
+ export async function withActiveMarketplaceLifecycleLease(env, action) {
130
+ const lease = await acquireActiveMarketplaceLifecycleLease(env);
131
+ return withCoordinationLease(lease, 'Active marketplace lifecycle', action);
132
+ }
133
+ //# sourceMappingURL=active-marketplace-runtime-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-marketplace-runtime-lock.js","sourceRoot":"","sources":["../../../src/utils/active-marketplace-runtime-lock.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,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,0CAA0C,GAAG,OAAO,CAAC;AAC3D,MAAM,oCAAoC,GAAG,oBAAoB,CAAC;AAClE,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC;IAC5C,QAAQ;IACR,OAAO;IACP,OAAO;IACP,KAAK;IACL,WAAW;IACX,OAAO;CACR,CAAC,CAAC;AACH,IAAI,mDAES,CAAC;AACd,IAAI,sDAES,CAAC;AAKd,MAAM,yBAAyB,GAAG,IAAI,iBAAiB,EAA6B,CAAC;AAErF,MAAM,UAAU,kCAAkC;IAChD,IAAI,OAAO,GAAG,yBAAyB,CAAC,QAAQ,EAAE,CAAC;IACnD,OAAO,OAAO,EAAE,CAAC;QACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;QAC7B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sDAAsD,CACpE,IAA+D;IAE/D,mDAAmD,GAAG,IAAI,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,yDAAyD,CACvE,IAAwE;IAExE,sDAAsD,GAAG,IAAI,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,+CAA+C,CAC7D,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,MA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,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { AgentVersionProbeResult, AgentVersionRequirement, PlatformName } from '../types.js';
2
+ import { type NativeCliRunner } from './native-cli.js';
3
+ export interface ProbeAgentVersionOptions {
4
+ cwd?: string;
5
+ env?: NodeJS.ProcessEnv;
6
+ runner?: NativeCliRunner;
7
+ timeoutMs?: number;
8
+ }
9
+ export declare function getMinimumAgentVersion(platform: PlatformName): string;
10
+ export declare function getAgentVersionRequirement(platform: PlatformName): AgentVersionRequirement;
11
+ export declare function extractStrictSemVerTokenFromVersionOutput(output: string): string | null;
12
+ export declare function probeAgentVersion(platform: PlatformName, options?: ProbeAgentVersionOptions): Promise<AgentVersionProbeResult>;
13
+ export declare function clearAgentVersionProbeCacheForTests(): void;
@@ -0,0 +1,172 @@
1
+ import crypto from 'node:crypto';
2
+ import { AGENT_VERSION_DISPLAY_NAMES, AGENT_VERSION_PROBE_COMMANDS, DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS, MINIMUM_AGENT_VERSIONS, } from '../constants.js';
3
+ import { compareStrictSemVer, tryParseStrictSemVer } from './manifest.js';
4
+ import { getDefaultNativeCliRunner, isNativeCliExecutableMissingError, runNativeCli, summarizeNativeCliFailure, } from './native-cli.js';
5
+ const VERSION_ARGUMENTS = ['--version'];
6
+ let probeCacheByRunner = new WeakMap();
7
+ export function getMinimumAgentVersion(platform) {
8
+ return MINIMUM_AGENT_VERSIONS[platform];
9
+ }
10
+ export function getAgentVersionRequirement(platform) {
11
+ return {
12
+ platform,
13
+ command: AGENT_VERSION_PROBE_COMMANDS[platform],
14
+ displayName: AGENT_VERSION_DISPLAY_NAMES[platform],
15
+ minVersion: getMinimumAgentVersion(platform),
16
+ };
17
+ }
18
+ export function extractStrictSemVerTokenFromVersionOutput(output) {
19
+ for (const token of output.split(/\s+/u)) {
20
+ if (token && tryParseStrictSemVer(token)) {
21
+ return token;
22
+ }
23
+ }
24
+ return null;
25
+ }
26
+ function combineProbeOutput(stdout, stderr) {
27
+ return [stdout, stderr]
28
+ .filter((value) => value.length > 0)
29
+ .join('\n');
30
+ }
31
+ function createEnvFingerprint(env) {
32
+ const entries = Object.keys(env)
33
+ .sort()
34
+ .map((key) => [key, env[key] ?? '']);
35
+ return crypto
36
+ .createHash('sha256')
37
+ .update(JSON.stringify(entries))
38
+ .digest('hex');
39
+ }
40
+ function buildProbeCacheKey(platform, requirement, options) {
41
+ const env = options.env ?? process.env;
42
+ return JSON.stringify({
43
+ platform,
44
+ command: requirement.command,
45
+ args: VERSION_ARGUMENTS,
46
+ cwd: options.cwd ?? process.cwd(),
47
+ timeoutMs: options.timeoutMs ?? DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS,
48
+ minVersion: requirement.minVersion,
49
+ envFingerprint: createEnvFingerprint(env),
50
+ });
51
+ }
52
+ function cloneProbeResult(result) {
53
+ return { ...result };
54
+ }
55
+ function createFailureProbeResult(requirement, status, options = {}) {
56
+ const reasonCode = {
57
+ missing: 'agentVersionMissing',
58
+ probeFailed: 'agentVersionProbeFailed',
59
+ unparseable: 'agentVersionUnparseable',
60
+ tooOld: 'agentVersionTooLow',
61
+ };
62
+ return {
63
+ platform: requirement.platform,
64
+ command: requirement.command,
65
+ status,
66
+ requiredMinVersion: requirement.minVersion,
67
+ detectedVersion: options.detectedVersion,
68
+ reasonCode: reasonCode[status],
69
+ stdout: options.stdout ?? '',
70
+ stderr: options.stderr ?? '',
71
+ rawOutput: options.rawOutput ?? '',
72
+ exitCode: options.exitCode,
73
+ details: options.details,
74
+ };
75
+ }
76
+ export async function probeAgentVersion(platform, options = {}) {
77
+ const requirement = getAgentVersionRequirement(platform);
78
+ const runner = options.runner ?? getDefaultNativeCliRunner();
79
+ const cacheKey = buildProbeCacheKey(platform, requirement, options);
80
+ let runnerCache = probeCacheByRunner.get(runner);
81
+ if (!runnerCache) {
82
+ runnerCache = new Map();
83
+ probeCacheByRunner.set(runner, runnerCache);
84
+ }
85
+ const cached = runnerCache.get(cacheKey);
86
+ if (cached) {
87
+ return cloneProbeResult(await cached);
88
+ }
89
+ const probe = probeAgentVersionUncached(requirement, runner, options)
90
+ .catch((error) => {
91
+ runnerCache.delete(cacheKey);
92
+ throw error;
93
+ });
94
+ runnerCache.set(cacheKey, probe);
95
+ return cloneProbeResult(await probe);
96
+ }
97
+ async function probeAgentVersionUncached(requirement, runner, options) {
98
+ try {
99
+ const result = await runNativeCli({
100
+ command: requirement.command,
101
+ args: VERSION_ARGUMENTS,
102
+ cwd: options.cwd,
103
+ env: options.env,
104
+ timeoutMs: options.timeoutMs ?? DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS,
105
+ }, runner);
106
+ const rawOutput = combineProbeOutput(result.stdout, result.stderr);
107
+ if (result.exitCode !== 0) {
108
+ return createFailureProbeResult(requirement, 'probeFailed', {
109
+ exitCode: result.exitCode,
110
+ stdout: result.stdout,
111
+ stderr: result.stderr,
112
+ rawOutput,
113
+ details: rawOutput.trim() || `Command exited with code ${result.exitCode}.`,
114
+ });
115
+ }
116
+ const detectedVersion = extractStrictSemVerTokenFromVersionOutput(rawOutput);
117
+ if (!detectedVersion) {
118
+ return createFailureProbeResult(requirement, 'unparseable', {
119
+ stdout: result.stdout,
120
+ stderr: result.stderr,
121
+ rawOutput,
122
+ details: `Unable to parse a strict SemVer token from ${requirement.command} --version output.`,
123
+ });
124
+ }
125
+ if (compareStrictSemVer(detectedVersion, requirement.minVersion) < 0) {
126
+ return createFailureProbeResult(requirement, 'tooOld', {
127
+ detectedVersion,
128
+ stdout: result.stdout,
129
+ stderr: result.stderr,
130
+ rawOutput,
131
+ details: `${requirement.displayName} ${detectedVersion} is lower than required ${requirement.minVersion}.`,
132
+ });
133
+ }
134
+ return {
135
+ platform: requirement.platform,
136
+ command: requirement.command,
137
+ status: 'supported',
138
+ requiredMinVersion: requirement.minVersion,
139
+ detectedVersion,
140
+ stdout: result.stdout,
141
+ stderr: result.stderr,
142
+ rawOutput,
143
+ exitCode: result.exitCode,
144
+ };
145
+ }
146
+ catch (error) {
147
+ const nativeError = error;
148
+ const stdout = typeof nativeError.stdout === 'string' ? nativeError.stdout : '';
149
+ const stderr = typeof nativeError.stderr === 'string' ? nativeError.stderr : '';
150
+ const rawOutput = combineProbeOutput(stdout, stderr);
151
+ if (isNativeCliExecutableMissingError(error)) {
152
+ return createFailureProbeResult(requirement, 'missing', {
153
+ exitCode: typeof nativeError.exitCode === 'number' ? nativeError.exitCode : undefined,
154
+ stdout,
155
+ stderr,
156
+ rawOutput,
157
+ details: summarizeNativeCliFailure(error),
158
+ });
159
+ }
160
+ return createFailureProbeResult(requirement, 'probeFailed', {
161
+ exitCode: typeof nativeError.exitCode === 'number' ? nativeError.exitCode : undefined,
162
+ stdout,
163
+ stderr,
164
+ rawOutput,
165
+ details: summarizeNativeCliFailure(error),
166
+ });
167
+ }
168
+ }
169
+ export function clearAgentVersionProbeCacheForTests() {
170
+ probeCacheByRunner = new WeakMap();
171
+ }
172
+ //# sourceMappingURL=agent-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-version.js","sourceRoot":"","sources":["../../../src/utils/agent-version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,YAAY,EACZ,yBAAyB,GAE1B,MAAM,iBAAiB,CAAC;AASzB,MAAM,iBAAiB,GAAG,CAAC,WAAW,CAAC,CAAC;AAExC,IAAI,kBAAkB,GAAG,IAAI,OAAO,EAAkE,CAAC;AAEvG,MAAM,UAAU,sBAAsB,CAAC,QAAsB;IAC3D,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,Q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 import type { ArtifactPlanArtifact, PlatformName, DistributionName, PluginArtifactTargetDefinition, PluginManifestSource, Scope } from '../types.js';
2
+ import type { ResolvedArtifactRenderConfig } from './artifact-renderer.js';
3
+ export type ValidatedArtifactPlanArtifact = ArtifactPlanArtifact & {
4
+ declaration: PluginArtifactTargetDefinition;
5
+ logicalIdentity: string;
6
+ configDigest: string;
7
+ };
8
+ export interface ValidatedArtifactPlan {
9
+ version: 2;
10
+ artifacts: ValidatedArtifactPlanArtifact[];
11
+ }
12
+ export declare function createArtifactConfigDigest(options: {
13
+ artifact: Pick<ArtifactPlanArtifact, 'id' | 'platform' | 'distribution' | 'target' | 'refreshKeys'>;
14
+ configValues: Record<string, unknown>;
15
+ digestSalt: string;
16
+ }): string;
17
+ export declare function validateArtifactPlan(options: {
18
+ pluginName?: string;
19
+ manifest: PluginManifestSource;
20
+ plan: unknown;
21
+ platform: PlatformName | DistributionName;
22
+ scope: Scope;
23
+ renderConfig: Pick<ResolvedArtifactRenderConfig, 'values'>;
24
+ rendererDigest?: string;
25
+ manifestDigest?: string;
26
+ }): ValidatedArtifactPlan;