@lesliechan721/aw 0.1.0-beta.10 → 0.1.0-beta.101

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 (864) hide show
  1. package/dist/authoring/assets/aw-config.d.mts +1 -50
  2. package/dist/authoring/assets/aw-config.mjs +58 -928
  3. package/dist/authoring/assets/aw-config.mjs.map +1 -1
  4. package/dist/authoring/assets/aw-runtime-config.d.mts +13 -0
  5. package/dist/authoring/assets/aw-runtime-config.mjs +221 -0
  6. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
  7. package/dist/authoring/assets/command-runtime-config.d.mts +9 -0
  8. package/dist/authoring/assets/command-runtime-config.mjs +134 -0
  9. package/dist/authoring/assets/command-runtime-config.mjs.map +1 -0
  10. package/dist/authoring/scripts/add-skill.mjs +16 -39
  11. package/dist/authoring/scripts/add-skill.mjs.map +1 -1
  12. package/dist/authoring/scripts/init-plugin.mjs +43 -71
  13. package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
  14. package/dist/authoring/scripts/lib/plugin-root.mjs +4 -4
  15. package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -1
  16. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
  17. package/dist/authoring/scripts/lib/plugin-version-check.mjs +230 -9
  18. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
  19. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +3 -3
  20. package/dist/authoring/scripts/lib/skill-scaffold.mjs +5 -8
  21. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
  22. package/dist/authoring/scripts/remove-plugin.mjs +1 -1
  23. package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
  24. package/dist/authoring/scripts/validate-plugin.mjs +408 -1748
  25. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  26. package/dist/authoring/scripts/validate-skill.mjs +1 -1
  27. package/dist/index.js +2 -6
  28. package/dist/index.js.map +1 -1
  29. package/dist/native-runtime/reader-runtime.mjs +34 -0
  30. package/dist/native-runtime/reader.d.mts +6 -0
  31. package/dist/native-runtime/reader.mjs +11 -0
  32. package/dist/scripts/aw-skill-eval-materializer.d.ts +11 -1
  33. package/dist/scripts/aw-skill-eval-materializer.js +119 -114
  34. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  35. package/dist/scripts/bundle-plugins.js +32 -7
  36. package/dist/scripts/bundle-plugins.js.map +1 -1
  37. package/dist/scripts/plugin-staging.d.ts +1 -1
  38. package/dist/scripts/plugin-staging.js +5 -2
  39. package/dist/scripts/plugin-staging.js.map +1 -1
  40. package/dist/scripts/plugin-test-context-guard.d.mts +1 -0
  41. package/dist/scripts/plugin-test-context-guard.mjs +59 -0
  42. package/dist/scripts/plugin-test-context-guard.mjs.map +1 -0
  43. package/dist/scripts/plugin-test-reporter.d.mts +2 -0
  44. package/dist/scripts/plugin-test-reporter.mjs +21 -0
  45. package/dist/scripts/plugin-test-reporter.mjs.map +1 -0
  46. package/dist/scripts/test-plugin-scripts.d.ts +5 -0
  47. package/dist/scripts/test-plugin-scripts.js +343 -58
  48. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  49. package/dist/scripts/test-workers.d.mts +24 -0
  50. package/dist/scripts/test-workers.mjs +59 -0
  51. package/dist/scripts/test-workers.mjs.map +1 -0
  52. package/dist/src/adapters/helpers.d.ts +7 -0
  53. package/dist/src/adapters/helpers.js.map +1 -1
  54. package/dist/src/authoring/workspace-commands.d.ts +3 -0
  55. package/dist/src/authoring/workspace-commands.js +7 -2
  56. package/dist/src/authoring/workspace-commands.js.map +1 -1
  57. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  58. package/dist/src/commands/aw-capabilities.js +48 -19
  59. package/dist/src/commands/aw-capabilities.js.map +1 -1
  60. package/dist/src/commands/catalog-dev-source.d.ts +40 -3
  61. package/dist/src/commands/catalog-dev-source.js +333 -42
  62. package/dist/src/commands/catalog-dev-source.js.map +1 -1
  63. package/dist/src/commands/catalog-generation.d.ts +5 -0
  64. package/dist/src/commands/catalog-generation.js.map +1 -1
  65. package/dist/src/commands/catalog-publication-inspection.d.ts +11 -3
  66. package/dist/src/commands/catalog-publication-inspection.js +211 -59
  67. package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
  68. package/dist/src/commands/catalog-publication-journal.d.ts +12 -0
  69. package/dist/src/commands/catalog-publication-journal.js +78 -1
  70. package/dist/src/commands/catalog-publication-journal.js.map +1 -1
  71. package/dist/src/commands/catalog-publish.d.ts +21 -1
  72. package/dist/src/commands/catalog-publish.js +133 -92
  73. package/dist/src/commands/catalog-publish.js.map +1 -1
  74. package/dist/src/commands/catalog-source.d.ts +26 -5
  75. package/dist/src/commands/catalog-source.js +154 -27
  76. package/dist/src/commands/catalog-source.js.map +1 -1
  77. package/dist/src/commands/catalog-status.js +2 -2
  78. package/dist/src/commands/catalog-status.js.map +1 -1
  79. package/dist/src/commands/catalog-store.d.ts +35 -7
  80. package/dist/src/commands/catalog-store.js +469 -79
  81. package/dist/src/commands/catalog-store.js.map +1 -1
  82. package/dist/src/commands/catalog-workspace-resolution.d.ts +4 -0
  83. package/dist/src/commands/catalog-workspace-resolution.js +18 -3
  84. package/dist/src/commands/catalog-workspace-resolution.js.map +1 -1
  85. package/dist/src/commands/console.js +33 -20
  86. package/dist/src/commands/console.js.map +1 -1
  87. package/dist/src/commands/dependency-operation-plan.d.ts +7 -0
  88. package/dist/src/commands/dependency-operation-plan.js +66 -30
  89. package/dist/src/commands/dependency-operation-plan.js.map +1 -1
  90. package/dist/src/commands/deployment-confirmation.d.ts +11 -0
  91. package/dist/src/commands/deployment-confirmation.js +101 -0
  92. package/dist/src/commands/deployment-confirmation.js.map +1 -0
  93. package/dist/src/commands/init.js +1 -1
  94. package/dist/src/commands/init.js.map +1 -1
  95. package/dist/src/commands/intent-command.d.ts +35 -0
  96. package/dist/src/commands/intent-command.js +174 -0
  97. package/dist/src/commands/intent-command.js.map +1 -0
  98. package/dist/src/commands/lifecycle-command-package.d.ts +45 -0
  99. package/dist/src/commands/lifecycle-command-package.js +199 -0
  100. package/dist/src/commands/lifecycle-command-package.js.map +1 -0
  101. package/dist/src/commands/managed-commands.d.ts +41 -0
  102. package/dist/src/commands/managed-commands.js +408 -0
  103. package/dist/src/commands/managed-commands.js.map +1 -0
  104. package/dist/src/commands/offline-cleanup-evidence.d.ts +12 -2
  105. package/dist/src/commands/offline-cleanup-evidence.js +57 -35
  106. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
  107. package/dist/src/commands/operation-plan.d.ts +72 -2
  108. package/dist/src/commands/operation-plan.js +54 -3
  109. package/dist/src/commands/operation-plan.js.map +1 -1
  110. package/dist/src/commands/operation-planner.d.ts +6 -5
  111. package/dist/src/commands/operation-planner.js +23 -20
  112. package/dist/src/commands/operation-planner.js.map +1 -1
  113. package/dist/src/commands/options.d.ts +11 -16
  114. package/dist/src/commands/options.js +31 -25
  115. package/dist/src/commands/options.js.map +1 -1
  116. package/dist/src/commands/permission-batch.d.ts +5 -0
  117. package/dist/src/commands/permission-batch.js +83 -0
  118. package/dist/src/commands/permission-batch.js.map +1 -0
  119. package/dist/src/commands/plugin-capabilities.js +128 -58
  120. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  121. package/dist/src/commands/public-config-confirmation.d.ts +14 -0
  122. package/dist/src/commands/public-config-confirmation.js +73 -0
  123. package/dist/src/commands/public-config-confirmation.js.map +1 -0
  124. package/dist/src/commands/public-interruption.d.ts +9 -0
  125. package/dist/src/commands/public-interruption.js +23 -0
  126. package/dist/src/commands/public-interruption.js.map +1 -0
  127. package/dist/src/commands/public-lifecycle-result.d.ts +107 -0
  128. package/dist/src/commands/public-lifecycle-result.js +536 -0
  129. package/dist/src/commands/public-lifecycle-result.js.map +1 -0
  130. package/dist/src/commands/public-lifecycle.d.ts +28 -0
  131. package/dist/src/commands/public-lifecycle.js +633 -0
  132. package/dist/src/commands/public-lifecycle.js.map +1 -0
  133. package/dist/src/commands/public-plugin-query.d.ts +16 -0
  134. package/dist/src/commands/public-plugin-query.js +235 -0
  135. package/dist/src/commands/public-plugin-query.js.map +1 -0
  136. package/dist/src/commands/rebuild-command.d.ts +177 -16
  137. package/dist/src/commands/rebuild-command.js +3374 -1558
  138. package/dist/src/commands/rebuild-command.js.map +1 -1
  139. package/dist/src/commands/rebuild-integration.d.ts +100 -55
  140. package/dist/src/commands/rebuild-integration.js +866 -3275
  141. package/dist/src/commands/rebuild-integration.js.map +1 -1
  142. package/dist/src/commands/rebuild-operations.d.ts +68 -13
  143. package/dist/src/commands/rebuild-operations.js +309 -120
  144. package/dist/src/commands/rebuild-operations.js.map +1 -1
  145. package/dist/src/commands/rebuild-platform-integration.d.ts +99 -0
  146. package/dist/src/commands/rebuild-platform-integration.js +2329 -0
  147. package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
  148. package/dist/src/commands/reconcile-operation-plan.d.ts +14 -9
  149. package/dist/src/commands/reconcile-operation-plan.js +26 -6
  150. package/dist/src/commands/reconcile-operation-plan.js.map +1 -1
  151. package/dist/src/commands/review-inspection.d.ts +60 -0
  152. package/dist/src/commands/review-inspection.js +437 -0
  153. package/dist/src/commands/review-inspection.js.map +1 -0
  154. package/dist/src/commands/review-preparation.d.ts +51 -0
  155. package/dist/src/commands/review-preparation.js +400 -0
  156. package/dist/src/commands/review-preparation.js.map +1 -0
  157. package/dist/src/commands/runtime.d.ts +7 -1
  158. package/dist/src/commands/runtime.js +41 -8
  159. package/dist/src/commands/runtime.js.map +1 -1
  160. package/dist/src/commands/skill-eval.d.ts +8 -0
  161. package/dist/src/commands/skill-eval.js +126 -73
  162. package/dist/src/commands/skill-eval.js.map +1 -1
  163. package/dist/src/commands/status-v6.d.ts +148 -35
  164. package/dist/src/commands/status-v6.js +1166 -307
  165. package/dist/src/commands/status-v6.js.map +1 -1
  166. package/dist/src/commands/targets-command.d.ts +38 -0
  167. package/dist/src/commands/targets-command.js +210 -0
  168. package/dist/src/commands/targets-command.js.map +1 -0
  169. package/dist/src/commands/wizard.d.ts +7 -3
  170. package/dist/src/commands/wizard.js +7 -4
  171. package/dist/src/commands/wizard.js.map +1 -1
  172. package/dist/src/commands/write-commands.d.ts +7 -1
  173. package/dist/src/commands/write-commands.js +129 -38
  174. package/dist/src/commands/write-commands.js.map +1 -1
  175. package/dist/src/constants.d.ts +2 -3
  176. package/dist/src/constants.js +2 -3
  177. package/dist/src/constants.js.map +1 -1
  178. package/dist/src/eval/manifest-v1.d.ts +6 -3
  179. package/dist/src/eval/manifest-v1.js +44 -33
  180. package/dist/src/eval/manifest-v1.js.map +1 -1
  181. package/dist/src/generators/local-plugin.d.ts +4 -2
  182. package/dist/src/generators/local-plugin.js +319 -353
  183. package/dist/src/generators/local-plugin.js.map +1 -1
  184. package/dist/src/generators/permissions.d.ts +20 -2
  185. package/dist/src/generators/permissions.js +82 -15
  186. package/dist/src/generators/permissions.js.map +1 -1
  187. package/dist/src/index.d.ts +3 -34
  188. package/dist/src/index.js +1711 -1935
  189. package/dist/src/index.js.map +1 -1
  190. package/dist/src/intent/deployment-preferences.d.ts +63 -0
  191. package/dist/src/intent/deployment-preferences.js +170 -0
  192. package/dist/src/intent/deployment-preferences.js.map +1 -0
  193. package/dist/src/intent/diagnostics.d.ts +11 -0
  194. package/dist/src/intent/diagnostics.js +14 -0
  195. package/dist/src/intent/diagnostics.js.map +1 -0
  196. package/dist/src/intent/intent-codec.d.ts +19 -0
  197. package/dist/src/intent/intent-codec.js +117 -0
  198. package/dist/src/intent/intent-codec.js.map +1 -0
  199. package/dist/src/intent/intent-store.d.ts +43 -0
  200. package/dist/src/intent/intent-store.js +118 -0
  201. package/dist/src/intent/intent-store.js.map +1 -0
  202. package/dist/src/intent/scope-context.d.ts +35 -0
  203. package/dist/src/intent/scope-context.js +179 -0
  204. package/dist/src/intent/scope-context.js.map +1 -0
  205. package/dist/src/intent/work-context.d.ts +13 -0
  206. package/dist/src/intent/work-context.js +22 -0
  207. package/dist/src/intent/work-context.js.map +1 -0
  208. package/dist/src/output/cli-progress.d.ts +30 -0
  209. package/dist/src/output/cli-progress.js +424 -0
  210. package/dist/src/output/cli-progress.js.map +1 -0
  211. package/dist/src/output/command-receipt.d.ts +6 -2
  212. package/dist/src/output/command-receipt.js +67 -32
  213. package/dist/src/output/command-receipt.js.map +1 -1
  214. package/dist/src/output/component-delivery.d.ts +28 -0
  215. package/dist/src/output/component-delivery.js +141 -0
  216. package/dist/src/output/component-delivery.js.map +1 -0
  217. package/dist/src/output/model.d.ts +123 -1
  218. package/dist/src/output/model.js +45 -1
  219. package/dist/src/output/model.js.map +1 -1
  220. package/dist/src/output/public-command-ids.d.ts +8 -0
  221. package/dist/src/output/public-command-ids.js +38 -0
  222. package/dist/src/output/public-command-ids.js.map +1 -0
  223. package/dist/src/output/public-result.d.ts +71 -0
  224. package/dist/src/output/public-result.js +40 -0
  225. package/dist/src/output/public-result.js.map +1 -0
  226. package/dist/src/output/rebuild-progress.d.ts +3 -0
  227. package/dist/src/output/rebuild-progress.js +34 -9
  228. package/dist/src/output/rebuild-progress.js.map +1 -1
  229. package/dist/src/output/receipt-projection.d.ts +7 -0
  230. package/dist/src/output/receipt-projection.js +670 -0
  231. package/dist/src/output/receipt-projection.js.map +1 -0
  232. package/dist/src/output/render/document.d.ts +55 -0
  233. package/dist/src/output/render/document.js +176 -0
  234. package/dist/src/output/render/document.js.map +1 -0
  235. package/dist/src/output/render/shared.d.ts +18 -0
  236. package/dist/src/output/render/shared.js +245 -0
  237. package/dist/src/output/render/shared.js.map +1 -0
  238. package/dist/src/output/render/style.d.ts +45 -0
  239. package/dist/src/output/render/style.js +155 -0
  240. package/dist/src/output/render/style.js.map +1 -0
  241. package/dist/src/output/render/views/commands-self.d.ts +6 -0
  242. package/dist/src/output/render/views/commands-self.js +210 -0
  243. package/dist/src/output/render/views/commands-self.js.map +1 -0
  244. package/dist/src/output/render/views/config.d.ts +2 -0
  245. package/dist/src/output/render/views/config.js +203 -0
  246. package/dist/src/output/render/views/config.js.map +1 -0
  247. package/dist/src/output/render/views/dev.d.ts +2 -0
  248. package/dist/src/output/render/views/dev.js +278 -0
  249. package/dist/src/output/render/views/dev.js.map +1 -0
  250. package/dist/src/output/render/views/fallback.d.ts +2 -0
  251. package/dist/src/output/render/views/fallback.js +6 -0
  252. package/dist/src/output/render/views/fallback.js.map +1 -0
  253. package/dist/src/output/render/views/index.d.ts +3 -0
  254. package/dist/src/output/render/views/index.js +79 -0
  255. package/dist/src/output/render/views/index.js.map +1 -0
  256. package/dist/src/output/render/views/lifecycle.d.ts +5 -0
  257. package/dist/src/output/render/views/lifecycle.js +170 -0
  258. package/dist/src/output/render/views/lifecycle.js.map +1 -0
  259. package/dist/src/output/render/views/sources-cache.d.ts +3 -0
  260. package/dist/src/output/render/views/sources-cache.js +322 -0
  261. package/dist/src/output/render/views/sources-cache.js.map +1 -0
  262. package/dist/src/output/render/views/targets.d.ts +2 -0
  263. package/dist/src/output/render/views/targets.js +82 -0
  264. package/dist/src/output/render/views/targets.js.map +1 -0
  265. package/dist/src/output/skill-invocation-notices.d.ts +18 -0
  266. package/dist/src/output/skill-invocation-notices.js +84 -0
  267. package/dist/src/output/skill-invocation-notices.js.map +1 -0
  268. package/dist/src/platforms/antigravity-permissions.d.ts +50 -0
  269. package/dist/src/platforms/antigravity-permissions.js +388 -0
  270. package/dist/src/platforms/antigravity-permissions.js.map +1 -0
  271. package/dist/src/platforms/capabilities.d.ts +9 -0
  272. package/dist/src/platforms/capabilities.js +125 -0
  273. package/dist/src/platforms/capabilities.js.map +1 -0
  274. package/dist/src/platforms/contracts.d.ts +394 -0
  275. package/dist/src/platforms/contracts.js +2 -0
  276. package/dist/src/platforms/contracts.js.map +1 -0
  277. package/dist/src/platforms/cursor-workspace-hook.d.ts +28 -0
  278. package/dist/src/platforms/cursor-workspace-hook.js +198 -0
  279. package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
  280. package/dist/src/platforms/discovery.d.ts +100 -0
  281. package/dist/src/platforms/discovery.js +796 -0
  282. package/dist/src/platforms/discovery.js.map +1 -0
  283. package/dist/src/platforms/grok-permission-config.d.ts +23 -0
  284. package/dist/src/platforms/grok-permission-config.js +184 -0
  285. package/dist/src/platforms/grok-permission-config.js.map +1 -0
  286. package/dist/src/platforms/grok-permission-document.d.ts +4 -0
  287. package/dist/src/platforms/grok-permission-document.js +145 -0
  288. package/dist/src/platforms/grok-permission-document.js.map +1 -0
  289. package/dist/src/platforms/grok-permissions.d.ts +17 -0
  290. package/dist/src/platforms/grok-permissions.js +311 -0
  291. package/dist/src/platforms/grok-permissions.js.map +1 -0
  292. package/dist/src/platforms/host-permission-policy.d.ts +38 -0
  293. package/dist/src/platforms/host-permission-policy.js +86 -0
  294. package/dist/src/platforms/host-permission-policy.js.map +1 -0
  295. package/dist/src/platforms/identity.d.ts +4 -0
  296. package/dist/src/platforms/identity.js +22 -0
  297. package/dist/src/platforms/identity.js.map +1 -0
  298. package/dist/src/platforms/inspection-grok.d.ts +4 -0
  299. package/dist/src/platforms/inspection-grok.js +380 -0
  300. package/dist/src/platforms/inspection-grok.js.map +1 -0
  301. package/dist/src/platforms/inspection-native.d.ts +8 -0
  302. package/dist/src/platforms/inspection-native.js +584 -0
  303. package/dist/src/platforms/inspection-native.js.map +1 -0
  304. package/dist/src/platforms/inspection-opencode.d.ts +4 -0
  305. package/dist/src/platforms/inspection-opencode.js +98 -0
  306. package/dist/src/platforms/inspection-opencode.js.map +1 -0
  307. package/dist/src/platforms/inspection-pi.d.ts +9 -0
  308. package/dist/src/platforms/inspection-pi.js +490 -0
  309. package/dist/src/platforms/inspection-pi.js.map +1 -0
  310. package/dist/src/platforms/inspection-query.d.ts +26 -0
  311. package/dist/src/platforms/inspection-query.js +118 -0
  312. package/dist/src/platforms/inspection-query.js.map +1 -0
  313. package/dist/src/platforms/inspection.d.ts +20 -0
  314. package/dist/src/platforms/inspection.js +259 -0
  315. package/dist/src/platforms/inspection.js.map +1 -0
  316. package/dist/src/platforms/layout.d.ts +35 -0
  317. package/dist/src/platforms/layout.js +332 -0
  318. package/dist/src/platforms/layout.js.map +1 -0
  319. package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
  320. package/dist/src/platforms/lifecycle-native-services.js +213 -0
  321. package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
  322. package/dist/src/platforms/lifecycle-native.d.ts +14 -0
  323. package/dist/src/platforms/lifecycle-native.js +234 -0
  324. package/dist/src/platforms/lifecycle-native.js.map +1 -0
  325. package/dist/src/platforms/lifecycle.d.ts +29 -0
  326. package/dist/src/platforms/lifecycle.js +688 -0
  327. package/dist/src/platforms/lifecycle.js.map +1 -0
  328. package/dist/src/platforms/opencode-permission-config.d.ts +13 -0
  329. package/dist/src/platforms/opencode-permission-config.js +253 -0
  330. package/dist/src/platforms/opencode-permission-config.js.map +1 -0
  331. package/dist/src/platforms/opencode-permissions.d.ts +39 -0
  332. package/dist/src/platforms/opencode-permissions.js +212 -0
  333. package/dist/src/platforms/opencode-permissions.js.map +1 -0
  334. package/dist/src/platforms/opencode-related-permissions.d.ts +40 -0
  335. package/dist/src/platforms/opencode-related-permissions.js +177 -0
  336. package/dist/src/platforms/opencode-related-permissions.js.map +1 -0
  337. package/dist/src/platforms/permission-ownership.d.ts +89 -0
  338. package/dist/src/platforms/permission-ownership.js +543 -0
  339. package/dist/src/platforms/permission-ownership.js.map +1 -0
  340. package/dist/src/platforms/permission-sidecar.d.ts +70 -0
  341. package/dist/src/platforms/permission-sidecar.js +215 -0
  342. package/dist/src/platforms/permission-sidecar.js.map +1 -0
  343. package/dist/src/platforms/projection-code-extension.d.ts +8 -0
  344. package/dist/src/platforms/projection-code-extension.js +126 -0
  345. package/dist/src/platforms/projection-code-extension.js.map +1 -0
  346. package/dist/src/platforms/projection-command-resources.d.ts +7 -0
  347. package/dist/src/platforms/projection-command-resources.js +74 -0
  348. package/dist/src/platforms/projection-command-resources.js.map +1 -0
  349. package/dist/src/platforms/projection-files.d.ts +28 -0
  350. package/dist/src/platforms/projection-files.js +113 -0
  351. package/dist/src/platforms/projection-files.js.map +1 -0
  352. package/dist/src/platforms/projection-marketplace.d.ts +19 -0
  353. package/dist/src/platforms/projection-marketplace.js +42 -0
  354. package/dist/src/platforms/projection-marketplace.js.map +1 -0
  355. package/dist/src/platforms/projection.d.ts +13 -0
  356. package/dist/src/platforms/projection.js +578 -0
  357. package/dist/src/platforms/projection.js.map +1 -0
  358. package/dist/src/platforms/read-only-retry-policy.d.ts +34 -0
  359. package/dist/src/platforms/read-only-retry-policy.js +70 -0
  360. package/dist/src/platforms/read-only-retry-policy.js.map +1 -0
  361. package/dist/src/platforms/registry.d.ts +4 -0
  362. package/dist/src/platforms/registry.js +30 -0
  363. package/dist/src/platforms/registry.js.map +1 -0
  364. package/dist/src/platforms/retirement-native.d.ts +6 -0
  365. package/dist/src/platforms/retirement-native.js +95 -0
  366. package/dist/src/platforms/retirement-native.js.map +1 -0
  367. package/dist/src/platforms/supplement-layout.d.ts +20 -0
  368. package/dist/src/platforms/supplement-layout.js +54 -0
  369. package/dist/src/platforms/supplement-layout.js.map +1 -0
  370. package/dist/src/platforms/supplement-state.d.ts +13 -0
  371. package/dist/src/platforms/supplement-state.js +93 -0
  372. package/dist/src/platforms/supplement-state.js.map +1 -0
  373. package/dist/src/portable/commands.d.ts +60 -11
  374. package/dist/src/portable/commands.js +88 -346
  375. package/dist/src/portable/commands.js.map +1 -1
  376. package/dist/src/portable/historical-materialization.d.ts +25 -0
  377. package/dist/src/portable/historical-materialization.js +148 -0
  378. package/dist/src/portable/historical-materialization.js.map +1 -0
  379. package/dist/src/portable/materializer.d.ts +46 -2
  380. package/dist/src/portable/materializer.js +262 -259
  381. package/dist/src/portable/materializer.js.map +1 -1
  382. package/dist/src/portable/recovery-layout.d.ts +17 -0
  383. package/dist/src/portable/recovery-layout.js +42 -0
  384. package/dist/src/portable/recovery-layout.js.map +1 -0
  385. package/dist/src/portable/recovery.d.ts +177 -0
  386. package/dist/src/portable/recovery.js +597 -0
  387. package/dist/src/portable/recovery.js.map +1 -0
  388. package/dist/src/portable/writer.d.ts +67 -0
  389. package/dist/src/portable/writer.js +321 -0
  390. package/dist/src/portable/writer.js.map +1 -0
  391. package/dist/src/recovery/coordinator.d.ts +175 -0
  392. package/dist/src/recovery/coordinator.js +1629 -0
  393. package/dist/src/recovery/coordinator.js.map +1 -0
  394. package/dist/src/recovery/demand.d.ts +53 -0
  395. package/dist/src/recovery/demand.js +189 -0
  396. package/dist/src/recovery/demand.js.map +1 -0
  397. package/dist/src/recovery/install-concurrency.d.ts +48 -0
  398. package/dist/src/recovery/install-concurrency.js +196 -0
  399. package/dist/src/recovery/install-concurrency.js.map +1 -0
  400. package/dist/src/recovery/interruption.d.ts +19 -0
  401. package/dist/src/recovery/interruption.js +43 -0
  402. package/dist/src/recovery/interruption.js.map +1 -0
  403. package/dist/src/recovery/joint-coordinator.d.ts +46 -0
  404. package/dist/src/recovery/joint-coordinator.js +1728 -0
  405. package/dist/src/recovery/joint-coordinator.js.map +1 -0
  406. package/dist/src/recovery/joint-demand.d.ts +72 -0
  407. package/dist/src/recovery/joint-demand.js +332 -0
  408. package/dist/src/recovery/joint-demand.js.map +1 -0
  409. package/dist/src/recovery/joint-install-execution.d.ts +19 -0
  410. package/dist/src/recovery/joint-install-execution.js +312 -0
  411. package/dist/src/recovery/joint-install-execution.js.map +1 -0
  412. package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
  413. package/dist/src/recovery/joint-install-native-rebase.js +67 -0
  414. package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
  415. package/dist/src/recovery/performance.d.ts +4 -0
  416. package/dist/src/recovery/performance.js +26 -0
  417. package/dist/src/recovery/performance.js.map +1 -0
  418. package/dist/src/recovery/receipt.d.ts +131 -0
  419. package/dist/src/recovery/receipt.js +91 -0
  420. package/dist/src/recovery/receipt.js.map +1 -0
  421. package/dist/src/recovery/retirement.d.ts +47 -0
  422. package/dist/src/recovery/retirement.js +504 -0
  423. package/dist/src/recovery/retirement.js.map +1 -0
  424. package/dist/src/recovery/status.d.ts +143 -0
  425. package/dist/src/recovery/status.js +1528 -0
  426. package/dist/src/recovery/status.js.map +1 -0
  427. package/dist/src/recovery/types.d.ts +85 -0
  428. package/dist/src/recovery/types.js +2 -0
  429. package/dist/src/recovery/types.js.map +1 -0
  430. package/dist/src/review/eval-source-input.d.ts +44 -0
  431. package/dist/src/review/eval-source-input.js +213 -0
  432. package/dist/src/review/eval-source-input.js.map +1 -0
  433. package/dist/src/review/platform-profile.d.ts +5 -0
  434. package/dist/src/review/platform-profile.js +13 -0
  435. package/dist/src/review/platform-profile.js.map +1 -0
  436. package/dist/src/review/review-profile.d.ts +20 -0
  437. package/dist/src/review/review-profile.js +286 -0
  438. package/dist/src/review/review-profile.js.map +1 -0
  439. package/dist/src/review/review-selection.d.ts +20 -0
  440. package/dist/src/review/review-selection.js +502 -0
  441. package/dist/src/review/review-selection.js.map +1 -0
  442. package/dist/src/review/review-types.d.ts +71 -0
  443. package/dist/src/review/review-types.js +16 -0
  444. package/dist/src/review/review-types.js.map +1 -0
  445. package/dist/src/review/skill-materialization.d.ts +67 -0
  446. package/dist/src/review/skill-materialization.js +235 -0
  447. package/dist/src/review/skill-materialization.js.map +1 -0
  448. package/dist/src/review/source-binding.d.ts +203 -0
  449. package/dist/src/review/source-binding.js +791 -0
  450. package/dist/src/review/source-binding.js.map +1 -0
  451. package/dist/src/tui/agent-management.d.ts +23 -0
  452. package/dist/src/tui/agent-management.js +319 -0
  453. package/dist/src/tui/agent-management.js.map +1 -0
  454. package/dist/src/tui/agent-settings.d.ts +47 -0
  455. package/dist/src/tui/agent-settings.js +97 -0
  456. package/dist/src/tui/agent-settings.js.map +1 -0
  457. package/dist/src/tui/catalog-generation.d.ts +9 -0
  458. package/dist/src/tui/catalog-generation.js +96 -6
  459. package/dist/src/tui/catalog-generation.js.map +1 -1
  460. package/dist/src/tui/catalog-sources/projection.d.ts +2 -2
  461. package/dist/src/tui/catalog-sources/screens.js +19 -12
  462. package/dist/src/tui/catalog-sources/screens.js.map +1 -1
  463. package/dist/src/tui/catalog-sources/session.d.ts +11 -1
  464. package/dist/src/tui/catalog-sources/session.js +80 -5
  465. package/dist/src/tui/catalog-sources/session.js.map +1 -1
  466. package/dist/src/tui/catalog-sources/types.d.ts +15 -2
  467. package/dist/src/tui/catalog-store-task.d.ts +16 -0
  468. package/dist/src/tui/catalog-store-task.js +19 -0
  469. package/dist/src/tui/catalog-store-task.js.map +1 -0
  470. package/dist/src/tui/clipboard.d.ts +13 -0
  471. package/dist/src/tui/clipboard.js +95 -0
  472. package/dist/src/tui/clipboard.js.map +1 -0
  473. package/dist/src/tui/components.d.ts +113 -3
  474. package/dist/src/tui/components.js +201 -34
  475. package/dist/src/tui/components.js.map +1 -1
  476. package/dist/src/tui/config-array-draft.d.ts +30 -0
  477. package/dist/src/tui/config-array-draft.js +51 -0
  478. package/dist/src/tui/config-array-draft.js.map +1 -0
  479. package/dist/src/tui/config-leaf-editor.d.ts +44 -0
  480. package/dist/src/tui/config-leaf-editor.js +227 -0
  481. package/dist/src/tui/config-leaf-editor.js.map +1 -0
  482. package/dist/src/tui/config-object-suggestions.d.ts +15 -0
  483. package/dist/src/tui/config-object-suggestions.js +71 -0
  484. package/dist/src/tui/config-object-suggestions.js.map +1 -0
  485. package/dist/src/tui/config-references.d.ts +38 -0
  486. package/dist/src/tui/config-references.js +82 -0
  487. package/dist/src/tui/config-references.js.map +1 -0
  488. package/dist/src/tui/config-suggestions.d.ts +27 -0
  489. package/dist/src/tui/config-suggestions.js +62 -0
  490. package/dist/src/tui/config-suggestions.js.map +1 -0
  491. package/dist/src/tui/config-value-presentation.d.ts +23 -0
  492. package/dist/src/tui/config-value-presentation.js +151 -0
  493. package/dist/src/tui/config-value-presentation.js.map +1 -0
  494. package/dist/src/tui/console-app-v4.d.ts +14 -5
  495. package/dist/src/tui/console-app-v4.js +9779 -2488
  496. package/dist/src/tui/console-app-v4.js.map +1 -1
  497. package/dist/src/tui/content-item-card.d.ts +13 -0
  498. package/dist/src/tui/content-item-card.js +51 -0
  499. package/dist/src/tui/content-item-card.js.map +1 -0
  500. package/dist/src/tui/controller-runtime.d.ts +4 -3
  501. package/dist/src/tui/controller-runtime.js +1610 -590
  502. package/dist/src/tui/controller-runtime.js.map +1 -1
  503. package/dist/src/tui/controller.d.ts +583 -80
  504. package/dist/src/tui/controller.js +3362 -263
  505. package/dist/src/tui/controller.js.map +1 -1
  506. package/dist/src/tui/dependency-graph-view.d.ts +39 -0
  507. package/dist/src/tui/dependency-graph-view.js +121 -0
  508. package/dist/src/tui/dependency-graph-view.js.map +1 -0
  509. package/dist/src/tui/dependency-graph.d.ts +81 -0
  510. package/dist/src/tui/dependency-graph.js +452 -0
  511. package/dist/src/tui/dependency-graph.js.map +1 -0
  512. package/dist/src/tui/deployment-view.d.ts +14 -0
  513. package/dist/src/tui/deployment-view.js +175 -0
  514. package/dist/src/tui/deployment-view.js.map +1 -0
  515. package/dist/src/tui/diagnostic-projection.d.ts +31 -0
  516. package/dist/src/tui/diagnostic-projection.js +681 -0
  517. package/dist/src/tui/diagnostic-projection.js.map +1 -0
  518. package/dist/src/tui/diagnostics.d.ts +6 -2
  519. package/dist/src/tui/diagnostics.js +14 -2
  520. package/dist/src/tui/diagnostics.js.map +1 -1
  521. package/dist/src/tui/entity-cards.d.ts +56 -0
  522. package/dist/src/tui/entity-cards.js +327 -0
  523. package/dist/src/tui/entity-cards.js.map +1 -0
  524. package/dist/src/tui/glossary.d.ts +25 -0
  525. package/dist/src/tui/glossary.js +78 -0
  526. package/dist/src/tui/glossary.js.map +1 -0
  527. package/dist/src/tui/guided-setup.d.ts +25 -0
  528. package/dist/src/tui/guided-setup.js +101 -0
  529. package/dist/src/tui/guided-setup.js.map +1 -0
  530. package/dist/src/tui/index.d.ts +4 -1
  531. package/dist/src/tui/index.js +4 -1
  532. package/dist/src/tui/index.js.map +1 -1
  533. package/dist/src/tui/input-display.d.ts +1 -0
  534. package/dist/src/tui/input-display.js +23 -1
  535. package/dist/src/tui/input-display.js.map +1 -1
  536. package/dist/src/tui/keys.d.ts +44 -0
  537. package/dist/src/tui/keys.js +43 -15
  538. package/dist/src/tui/keys.js.map +1 -1
  539. package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
  540. package/dist/src/tui/lifecycle-action-view.js +36 -0
  541. package/dist/src/tui/lifecycle-action-view.js.map +1 -0
  542. package/dist/src/tui/model.d.ts +141 -28
  543. package/dist/src/tui/model.js +968 -285
  544. package/dist/src/tui/model.js.map +1 -1
  545. package/dist/src/tui/operation-diagnostic-screens.d.ts +8 -0
  546. package/dist/src/tui/operation-diagnostic-screens.js +76 -0
  547. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
  548. package/dist/src/tui/operation-history.d.ts +91 -0
  549. package/dist/src/tui/operation-history.js +167 -0
  550. package/dist/src/tui/operation-history.js.map +1 -0
  551. package/dist/src/tui/operation-review-planner.d.ts +7 -0
  552. package/dist/src/tui/operation-review-planner.js +980 -146
  553. package/dist/src/tui/operation-review-planner.js.map +1 -1
  554. package/dist/src/tui/plugin-content.d.ts +33 -0
  555. package/dist/src/tui/plugin-content.js +245 -0
  556. package/dist/src/tui/plugin-content.js.map +1 -0
  557. package/dist/src/tui/plugin-detail.d.ts +75 -0
  558. package/dist/src/tui/plugin-detail.js +267 -0
  559. package/dist/src/tui/plugin-detail.js.map +1 -0
  560. package/dist/src/tui/plugin-write-task.d.ts +69 -0
  561. package/dist/src/tui/plugin-write-task.js +286 -0
  562. package/dist/src/tui/plugin-write-task.js.map +1 -0
  563. package/dist/src/tui/query-header.d.ts +30 -0
  564. package/dist/src/tui/query-header.js +40 -0
  565. package/dist/src/tui/query-header.js.map +1 -0
  566. package/dist/src/tui/reader.d.ts +38 -0
  567. package/dist/src/tui/reader.js +49 -0
  568. package/dist/src/tui/reader.js.map +1 -0
  569. package/dist/src/tui/router.d.ts +170 -39
  570. package/dist/src/tui/router.js +338 -50
  571. package/dist/src/tui/router.js.map +1 -1
  572. package/dist/src/tui/scoped-flow.d.ts +49 -0
  573. package/dist/src/tui/scoped-flow.js +212 -0
  574. package/dist/src/tui/scoped-flow.js.map +1 -0
  575. package/dist/src/tui/scoped-inventory.d.ts +139 -0
  576. package/dist/src/tui/scoped-inventory.js +295 -0
  577. package/dist/src/tui/scoped-inventory.js.map +1 -0
  578. package/dist/src/tui/screen-registry.d.ts +696 -0
  579. package/dist/src/tui/screen-registry.js +226 -0
  580. package/dist/src/tui/screen-registry.js.map +1 -0
  581. package/dist/src/tui/session-console-app.d.ts +8 -0
  582. package/dist/src/tui/session-console-app.js +24 -0
  583. package/dist/src/tui/session-console-app.js.map +1 -0
  584. package/dist/src/tui/session-host.d.ts +45 -0
  585. package/dist/src/tui/session-host.js +219 -0
  586. package/dist/src/tui/session-host.js.map +1 -0
  587. package/dist/src/tui/source-detail-card.d.ts +29 -0
  588. package/dist/src/tui/source-detail-card.js +45 -0
  589. package/dist/src/tui/source-detail-card.js.map +1 -0
  590. package/dist/src/tui/theme.d.ts +12 -0
  591. package/dist/src/tui/theme.js +12 -0
  592. package/dist/src/tui/theme.js.map +1 -1
  593. package/dist/src/tui/viewport.d.ts +1 -0
  594. package/dist/src/tui/viewport.js +23 -0
  595. package/dist/src/tui/viewport.js.map +1 -1
  596. package/dist/src/tui/wizard.js +26 -4
  597. package/dist/src/tui/wizard.js.map +1 -1
  598. package/dist/src/types.d.ts +105 -83
  599. package/dist/src/types.js +1 -1
  600. package/dist/src/types.js.map +1 -1
  601. package/dist/src/utils/agent-version.d.ts +10 -4
  602. package/dist/src/utils/agent-version.js +6 -8
  603. package/dist/src/utils/agent-version.js.map +1 -1
  604. package/dist/src/utils/artifact-plan.d.ts +18 -25
  605. package/dist/src/utils/artifact-plan.js +59 -445
  606. package/dist/src/utils/artifact-plan.js.map +1 -1
  607. package/dist/src/utils/artifact-renderer.d.ts +64 -90
  608. package/dist/src/utils/artifact-renderer.js +202 -303
  609. package/dist/src/utils/artifact-renderer.js.map +1 -1
  610. package/dist/src/utils/artifact-request.d.ts +19 -14
  611. package/dist/src/utils/artifact-request.js +51 -36
  612. package/dist/src/utils/artifact-request.js.map +1 -1
  613. package/dist/src/utils/artifact-sources.d.ts +4 -8
  614. package/dist/src/utils/artifact-sources.js +15 -6
  615. package/dist/src/utils/artifact-sources.js.map +1 -1
  616. package/dist/src/utils/aw-home-mutation-lock.d.ts +1 -0
  617. package/dist/src/utils/aw-home-mutation-lock.js +28 -6
  618. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
  619. package/dist/src/utils/bundle-layout.d.ts +2 -0
  620. package/dist/src/utils/bundle-layout.js +88 -158
  621. package/dist/src/utils/bundle-layout.js.map +1 -1
  622. package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
  623. package/dist/src/utils/catalog-capability-projection.js +14 -0
  624. package/dist/src/utils/catalog-capability-projection.js.map +1 -0
  625. package/dist/src/utils/catalog-digests.d.ts +2 -12
  626. package/dist/src/utils/catalog-digests.js +7 -55
  627. package/dist/src/utils/catalog-digests.js.map +1 -1
  628. package/dist/src/utils/catalog-generation-resolver.d.ts +28 -4
  629. package/dist/src/utils/catalog-generation-resolver.js +146 -40
  630. package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
  631. package/dist/src/utils/catalog-generation-service.d.ts +25 -2
  632. package/dist/src/utils/catalog-generation-service.js +99 -48
  633. package/dist/src/utils/catalog-generation-service.js.map +1 -1
  634. package/dist/src/utils/catalog-generation-state.js +1 -1
  635. package/dist/src/utils/catalog-generation-state.js.map +1 -1
  636. package/dist/src/utils/catalog-generation-store.d.ts +5 -0
  637. package/dist/src/utils/catalog-generation-store.js +69 -10
  638. package/dist/src/utils/catalog-generation-store.js.map +1 -1
  639. package/dist/src/utils/catalog-operation-context.d.ts +61 -4
  640. package/dist/src/utils/catalog-operation-context.js +225 -4
  641. package/dist/src/utils/catalog-operation-context.js.map +1 -1
  642. package/dist/src/utils/catalog-public-error.js +4 -0
  643. package/dist/src/utils/catalog-public-error.js.map +1 -1
  644. package/dist/src/utils/catalog-runtime-projection.d.ts +4 -3
  645. package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
  646. package/dist/src/utils/catalog-snapshot.d.ts +3 -0
  647. package/dist/src/utils/catalog-snapshot.js +4 -1
  648. package/dist/src/utils/catalog-snapshot.js.map +1 -1
  649. package/dist/src/utils/catalog-source-impact.d.ts +3 -2
  650. package/dist/src/utils/catalog-source-impact.js +142 -20
  651. package/dist/src/utils/catalog-source-impact.js.map +1 -1
  652. package/dist/src/utils/catalog-source-references.d.ts +57 -1
  653. package/dist/src/utils/catalog-source-references.js +755 -162
  654. package/dist/src/utils/catalog-source-references.js.map +1 -1
  655. package/dist/src/utils/catalog-sources.d.ts +1 -1
  656. package/dist/src/utils/catalog-sources.js +21 -5
  657. package/dist/src/utils/catalog-sources.js.map +1 -1
  658. package/dist/src/utils/codex-config.d.ts +3 -0
  659. package/dist/src/utils/codex-config.js +7 -0
  660. package/dist/src/utils/codex-config.js.map +1 -1
  661. package/dist/src/utils/codex-executable-discovery.d.ts +28 -0
  662. package/dist/src/utils/codex-executable-discovery.js +431 -0
  663. package/dist/src/utils/codex-executable-discovery.js.map +1 -0
  664. package/dist/src/utils/codex-manager.d.ts +23 -42
  665. package/dist/src/utils/codex-manager.js +79 -767
  666. package/dist/src/utils/codex-manager.js.map +1 -1
  667. package/dist/src/utils/codex-native-observation.d.ts +40 -1
  668. package/dist/src/utils/codex-native-observation.js +172 -0
  669. package/dist/src/utils/codex-native-observation.js.map +1 -1
  670. package/dist/src/utils/codex-reconciler.d.ts +2 -7
  671. package/dist/src/utils/codex-reconciler.js +33 -5
  672. package/dist/src/utils/codex-reconciler.js.map +1 -1
  673. package/dist/src/utils/codex-shared-native.d.ts +8 -26
  674. package/dist/src/utils/codex-shared-native.js +63 -83
  675. package/dist/src/utils/codex-shared-native.js.map +1 -1
  676. package/dist/src/utils/codex-skill-staging.d.ts +4 -3
  677. package/dist/src/utils/codex-skill-staging.js.map +1 -1
  678. package/dist/src/utils/codex-skills-root.d.ts +4 -0
  679. package/dist/src/utils/codex-skills-root.js +29 -0
  680. package/dist/src/utils/codex-skills-root.js.map +1 -0
  681. package/dist/src/utils/codex-surface-analysis.d.ts +6 -2
  682. package/dist/src/utils/codex-surface-analysis.js +31 -56
  683. package/dist/src/utils/codex-surface-analysis.js.map +1 -1
  684. package/dist/src/utils/component-agent-binding.d.ts +17 -0
  685. package/dist/src/utils/component-agent-binding.js +119 -0
  686. package/dist/src/utils/component-agent-binding.js.map +1 -0
  687. package/dist/src/utils/component-command-preparation.d.ts +33 -0
  688. package/dist/src/utils/component-command-preparation.js +129 -0
  689. package/dist/src/utils/component-command-preparation.js.map +1 -0
  690. package/dist/src/utils/component-gap.d.ts +4 -0
  691. package/dist/src/utils/component-gap.js +16 -0
  692. package/dist/src/utils/component-gap.js.map +1 -0
  693. package/dist/src/utils/component-resources.d.ts +53 -0
  694. package/dist/src/utils/component-resources.js +340 -0
  695. package/dist/src/utils/component-resources.js.map +1 -0
  696. package/dist/src/utils/config-platforms.d.ts +21 -0
  697. package/dist/src/utils/config-platforms.js +51 -0
  698. package/dist/src/utils/config-platforms.js.map +1 -0
  699. package/dist/src/utils/dynamic-skill-tree.d.ts +18 -6
  700. package/dist/src/utils/dynamic-skill-tree.js +33 -40
  701. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  702. package/dist/src/utils/git-catalog-provider.d.ts +3 -0
  703. package/dist/src/utils/git-catalog-provider.js +49 -3
  704. package/dist/src/utils/git-catalog-provider.js.map +1 -1
  705. package/dist/src/utils/inventory-recovery-diagnostic.d.ts +4 -0
  706. package/dist/src/utils/inventory-recovery-diagnostic.js +15 -0
  707. package/dist/src/utils/inventory-recovery-diagnostic.js.map +1 -0
  708. package/dist/src/utils/local-marketplace.d.ts +19 -12
  709. package/dist/src/utils/local-marketplace.js +97 -194
  710. package/dist/src/utils/local-marketplace.js.map +1 -1
  711. package/dist/src/utils/managed-command-cli-review.d.ts +53 -0
  712. package/dist/src/utils/managed-command-cli-review.js +431 -0
  713. package/dist/src/utils/managed-command-cli-review.js.map +1 -0
  714. package/dist/src/utils/managed-command-closure.d.ts +14 -0
  715. package/dist/src/utils/managed-command-closure.js +156 -0
  716. package/dist/src/utils/managed-command-closure.js.map +1 -0
  717. package/dist/src/utils/managed-command-errors.d.ts +5 -0
  718. package/dist/src/utils/managed-command-errors.js +10 -0
  719. package/dist/src/utils/managed-command-errors.js.map +1 -0
  720. package/dist/src/utils/managed-command-materialization.d.ts +90 -0
  721. package/dist/src/utils/managed-command-materialization.js +375 -0
  722. package/dist/src/utils/managed-command-materialization.js.map +1 -0
  723. package/dist/src/utils/managed-command-preparation.d.ts +30 -0
  724. package/dist/src/utils/managed-command-preparation.js +39 -0
  725. package/dist/src/utils/managed-command-preparation.js.map +1 -0
  726. package/dist/src/utils/managed-command-review.d.ts +33 -0
  727. package/dist/src/utils/managed-command-review.js +80 -0
  728. package/dist/src/utils/managed-command-review.js.map +1 -0
  729. package/dist/src/utils/managed-command-runtime.d.ts +36 -0
  730. package/dist/src/utils/managed-command-runtime.js +126 -0
  731. package/dist/src/utils/managed-command-runtime.js.map +1 -0
  732. package/dist/src/utils/managed-command-snapshots.d.ts +24 -0
  733. package/dist/src/utils/managed-command-snapshots.js +89 -0
  734. package/dist/src/utils/managed-command-snapshots.js.map +1 -0
  735. package/dist/src/utils/managed-command-store.d.ts +141 -0
  736. package/dist/src/utils/managed-command-store.js +839 -0
  737. package/dist/src/utils/managed-command-store.js.map +1 -0
  738. package/dist/src/utils/multi-source-catalog.d.ts +6 -1
  739. package/dist/src/utils/multi-source-catalog.js +9 -4
  740. package/dist/src/utils/multi-source-catalog.js.map +1 -1
  741. package/dist/src/utils/native-cli-interruption.d.ts +11 -0
  742. package/dist/src/utils/native-cli-interruption.js +106 -0
  743. package/dist/src/utils/native-cli-interruption.js.map +1 -0
  744. package/dist/src/utils/native-cli.d.ts +37 -6
  745. package/dist/src/utils/native-cli.js +523 -60
  746. package/dist/src/utils/native-cli.js.map +1 -1
  747. package/dist/src/utils/native-demand.d.ts +29 -0
  748. package/dist/src/utils/native-demand.js +4 -0
  749. package/dist/src/utils/native-demand.js.map +1 -0
  750. package/dist/src/utils/native-tool-context.d.ts +17 -0
  751. package/dist/src/utils/native-tool-context.js +40 -0
  752. package/dist/src/utils/native-tool-context.js.map +1 -0
  753. package/dist/src/utils/native-tool-review.d.ts +8 -0
  754. package/dist/src/utils/native-tool-review.js +14 -0
  755. package/dist/src/utils/native-tool-review.js.map +1 -0
  756. package/dist/src/utils/ownership.d.ts +38 -3
  757. package/dist/src/utils/ownership.js +118 -11
  758. package/dist/src/utils/ownership.js.map +1 -1
  759. package/dist/src/utils/package-content.d.ts +7 -0
  760. package/dist/src/utils/package-content.js +70 -0
  761. package/dist/src/utils/package-content.js.map +1 -0
  762. package/dist/src/utils/path-catalog-provider.js +2 -0
  763. package/dist/src/utils/path-catalog-provider.js.map +1 -1
  764. package/dist/src/utils/paths.d.ts +1 -1
  765. package/dist/src/utils/paths.js +5 -2
  766. package/dist/src/utils/paths.js.map +1 -1
  767. package/dist/src/utils/platform-empty-state.d.ts +69 -0
  768. package/dist/src/utils/platform-empty-state.js +249 -0
  769. package/dist/src/utils/platform-empty-state.js.map +1 -0
  770. package/dist/src/utils/platform-support.d.ts +1 -1
  771. package/dist/src/utils/platform-support.js +1 -1
  772. package/dist/src/utils/platform-support.js.map +1 -1
  773. package/dist/src/utils/plugin-config-command-apply.d.ts +33 -0
  774. package/dist/src/utils/plugin-config-command-apply.js +142 -0
  775. package/dist/src/utils/plugin-config-command-apply.js.map +1 -0
  776. package/dist/src/utils/plugin-config-diagnostics.d.ts +16 -0
  777. package/dist/src/utils/plugin-config-diagnostics.js +44 -0
  778. package/dist/src/utils/plugin-config-diagnostics.js.map +1 -0
  779. package/dist/src/utils/plugin-config-impact.d.ts +76 -0
  780. package/dist/src/utils/plugin-config-impact.js +359 -0
  781. package/dist/src/utils/plugin-config-impact.js.map +1 -0
  782. package/dist/src/utils/plugin-config-references.d.ts +116 -0
  783. package/dist/src/utils/plugin-config-references.js +379 -0
  784. package/dist/src/utils/plugin-config-references.js.map +1 -0
  785. package/dist/src/utils/plugin-config-suggestion-runner.d.ts +83 -0
  786. package/dist/src/utils/plugin-config-suggestion-runner.js +308 -0
  787. package/dist/src/utils/plugin-config-suggestion-runner.js.map +1 -0
  788. package/dist/src/utils/plugin-config-suggestions.d.ts +50 -0
  789. package/dist/src/utils/plugin-config-suggestions.js +322 -0
  790. package/dist/src/utils/plugin-config-suggestions.js.map +1 -0
  791. package/dist/src/utils/plugin-config-write.d.ts +108 -19
  792. package/dist/src/utils/plugin-config-write.js +781 -568
  793. package/dist/src/utils/plugin-config-write.js.map +1 -1
  794. package/dist/src/utils/plugin-config.d.ts +122 -43
  795. package/dist/src/utils/plugin-config.js +574 -610
  796. package/dist/src/utils/plugin-config.js.map +1 -1
  797. package/dist/src/utils/plugin-dependencies.d.ts +1 -1
  798. package/dist/src/utils/plugin-dependencies.js.map +1 -1
  799. package/dist/src/utils/plugin-scripts.d.ts +41 -17
  800. package/dist/src/utils/plugin-scripts.js +586 -123
  801. package/dist/src/utils/plugin-scripts.js.map +1 -1
  802. package/dist/src/utils/process-lock.d.ts +1 -0
  803. package/dist/src/utils/process-lock.js +22 -5
  804. package/dist/src/utils/process-lock.js.map +1 -1
  805. package/dist/src/utils/process-tree.d.ts +2 -2
  806. package/dist/src/utils/process-tree.js +1 -1
  807. package/dist/src/utils/process-tree.js.map +1 -1
  808. package/dist/src/utils/project-boundary.d.ts +11 -1
  809. package/dist/src/utils/project-boundary.js +33 -11
  810. package/dist/src/utils/project-boundary.js.map +1 -1
  811. package/dist/src/utils/rendered-contract.js +24 -1
  812. package/dist/src/utils/rendered-contract.js.map +1 -1
  813. package/dist/src/utils/runtime-config.d.ts +18 -0
  814. package/dist/src/utils/runtime-config.js +64 -0
  815. package/dist/src/utils/runtime-config.js.map +1 -0
  816. package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
  817. package/dist/src/utils/runtime-skill-closure.js +50 -7
  818. package/dist/src/utils/runtime-skill-closure.js.map +1 -1
  819. package/dist/src/utils/safe-operation-diagnostic.d.ts +15 -0
  820. package/dist/src/utils/safe-operation-diagnostic.js +33 -0
  821. package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
  822. package/dist/src/utils/sensitive-content.d.ts +4 -0
  823. package/dist/src/utils/sensitive-content.js +36 -0
  824. package/dist/src/utils/sensitive-content.js.map +1 -0
  825. package/dist/src/utils/skill-invocation-warning.d.ts +19 -0
  826. package/dist/src/utils/skill-invocation-warning.js +43 -0
  827. package/dist/src/utils/skill-invocation-warning.js.map +1 -0
  828. package/dist/src/utils/skill-validation.js +0 -5
  829. package/dist/src/utils/skill-validation.js.map +1 -1
  830. package/dist/src/utils/state-paths.d.ts +8 -3
  831. package/dist/src/utils/state-paths.js +53 -16
  832. package/dist/src/utils/state-paths.js.map +1 -1
  833. package/dist/src/utils/target-eligibility.d.ts +2 -2
  834. package/dist/src/utils/target-eligibility.js.map +1 -1
  835. package/dist/src/utils/windows-claude-shim.d.ts +7 -0
  836. package/dist/src/utils/windows-claude-shim.js +10 -0
  837. package/dist/src/utils/windows-claude-shim.js.map +1 -0
  838. package/dist/src/utils/windows-npm-shim.d.ts +16 -0
  839. package/dist/src/utils/windows-npm-shim.js +155 -0
  840. package/dist/src/utils/windows-npm-shim.js.map +1 -0
  841. package/dist/vitest.config.js +109 -9
  842. package/dist/vitest.config.js.map +1 -1
  843. package/package.json +20 -12
  844. package/dist/authoring/templates/aw-config-runtime.d.mts +0 -2
  845. package/dist/authoring/templates/aw-config-runtime.mjs +0 -407
  846. package/dist/authoring/templates/aw-config-runtime.mjs.map +0 -1
  847. package/dist/src/commands/review-publication.d.ts +0 -99
  848. package/dist/src/commands/review-publication.js +0 -904
  849. package/dist/src/commands/review-publication.js.map +0 -1
  850. package/dist/src/commands/sync-command.d.ts +0 -23
  851. package/dist/src/commands/sync-command.js +0 -242
  852. package/dist/src/commands/sync-command.js.map +0 -1
  853. package/dist/src/portable/skills-cli.d.ts +0 -43
  854. package/dist/src/portable/skills-cli.js +0 -148
  855. package/dist/src/portable/skills-cli.js.map +0 -1
  856. package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
  857. package/dist/src/utils/codex-native-render-receipt.js +0 -205
  858. package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
  859. package/dist/src/utils/plugin-intent-state.d.ts +0 -34
  860. package/dist/src/utils/plugin-intent-state.js +0 -289
  861. package/dist/src/utils/plugin-intent-state.js.map +0 -1
  862. package/dist/src/utils/slash-commands.d.ts +0 -1
  863. package/dist/src/utils/slash-commands.js +0 -2
  864. package/dist/src/utils/slash-commands.js.map +0 -1
@@ -6,7 +6,8 @@ import { createRequire } from 'node:module';
6
6
  import * as os from 'node:os';
7
7
  import * as path from 'node:path';
8
8
  import { fileURLToPath, pathToFileURL } from 'node:url';
9
- import { getPluginAuthoringAcceptedValues as getCorePluginAuthoringAcceptedValues, getSkillFrontmatterCapabilityRegistry, normalizePluginConfigDefinition, } from '@lesliechan721/aw-plugin-core/manifest';
9
+ import { assertPluginConfigReferenceSchemas, assertPluginConfigSuggestionProviders, AW_RUNTIME_CONFIG_READER_PATH, createNativeToolReaderSource, getCommandPackageInjectedReaders, getPluginConfigSuggestions, isInjectedCommandReaderImport, getPluginAuthoringAcceptedValues as getCorePluginAuthoringAcceptedValues, getSkillFrontmatterCapabilityRegistry, normalizePluginConfigDefinition, compilePluginConfigDefinition, validatePluginConfigCandidate, renderTemplate, resolveSupportedPlatforms, PLATFORM_TARGETS, isPortablePlatformTarget, isAuthorOnlySkillDirectory, SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION, } from '@lesliechan721/aw-plugin-core/manifest';
10
+ import { readCatalogWorkspace } from '@lesliechan721/aw-plugin-core';
10
11
  import { checkPluginVersions } from './lib/plugin-version-check.mjs';
11
12
  import { scanJavaScriptImportSpecifiers } from './lib/javascript-import-scanner.mjs';
12
13
  import { assertAuthoringPluginPathFence, assertCanonicalAuthoringPluginRoot, } from './lib/plugin-root.mjs';
@@ -18,7 +19,6 @@ const CLI_PACKAGE_ROOT = path.basename(authoringRuntimeRoot) === 'dist'
18
19
  : authoringRuntimeRoot;
19
20
  const errors = [];
20
21
  const warnings = [];
21
- const SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION = 11;
22
22
  let capabilityDiagnostic = null;
23
23
  const MAX_SKILL_NAME_LEN = 64;
24
24
  const MAX_SKILL_DESCRIPTION_LEN = 1024;
@@ -26,8 +26,6 @@ const MAX_SKILL_COMPATIBILITY_LEN = 500;
26
26
  const MAX_SKILL_SHORT_DESCRIPTION_LEN = 1024;
27
27
  const MAX_SKILL_LINES = 500;
28
28
  const MAX_OPENAI_INTERFACE_NAME_LEN = 64;
29
- const MIN_OPENAI_INTERFACE_DESCRIPTION_LEN = 25;
30
- const MAX_OPENAI_INTERFACE_DESCRIPTION_LEN = 64;
31
29
  const MAX_OPENAI_DEFAULT_PROMPT_LEN = 1024;
32
30
  const MAX_OPENAI_DEPENDENCY_TYPE_LEN = 64;
33
31
  const MAX_OPENAI_DEPENDENCY_TRANSPORT_LEN = 64;
@@ -36,13 +34,6 @@ const MAX_OPENAI_DEPENDENCY_DESCRIPTION_LEN = 1024;
36
34
  const MAX_OPENAI_DEPENDENCY_COMMAND_LEN = 1024;
37
35
  const MAX_OPENAI_DEPENDENCY_URL_LEN = 1024;
38
36
  const CLAUDE_FRONTMATTER_SHELLS = new Set(['bash', 'powershell']);
39
- const CLAUDE_SLASH_COMMAND_ONLY_FIELDS = new Set([
40
- 'allowed-tools',
41
- 'model',
42
- 'argument-hint',
43
- 'disable-model-invocation',
44
- 'shell',
45
- ]);
46
37
  const CODEX_POLICY_PRODUCTS = new Set([
47
38
  'atlas',
48
39
  'ATLAS',
@@ -51,99 +42,13 @@ const CODEX_POLICY_PRODUCTS = new Set([
51
42
  'codex',
52
43
  'CODEX',
53
44
  ]);
54
- const MANIFEST_POLICY_PRODUCTS = new Set(getPluginAuthoringAcceptedValues('manifest', 'marketplace.policy.products'));
45
+ const MANIFEST_PLATFORMS = new Set(getPluginAuthoringAcceptedValues('manifest', 'platforms'));
55
46
  const MARKETPLACE_AUTHENTICATION_POLICIES = new Set(getPluginAuthoringAcceptedValues('manifest', 'marketplace.policy.authentication'));
56
47
  const MARKETPLACE_INSTALLATION_POLICIES = new Set(getPluginAuthoringAcceptedValues('manifest', 'marketplace.policy.installation'));
57
- const PUBLIC_HOOK_EVENTS = new Set(['before_tool', 'after_tool', 'session_start']);
58
- const PUBLIC_SESSION_START_SOURCES = new Set(['startup', 'resume', 'clear']);
59
- const PUBLIC_SESSION_START_DEFAULT_MATCHER = 'startup|resume|clear';
60
- const PUBLIC_HOOK_RENDER_MAP = {
61
- claude: {
62
- before_tool: 'PreToolUse',
63
- after_tool: 'PostToolUse',
64
- session_start: 'SessionStart',
65
- },
66
- codex: {
67
- before_tool: 'PreToolUse',
68
- after_tool: 'PostToolUse',
69
- session_start: 'SessionStart',
70
- },
71
- };
72
- const NATIVE_HOOK_EVENTS = {
73
- claude: new Set([
74
- 'PreToolUse',
75
- 'PostToolUse',
76
- 'PostToolUseFailure',
77
- 'Notification',
78
- 'UserPromptSubmit',
79
- 'SessionStart',
80
- 'SessionEnd',
81
- 'Stop',
82
- 'StopFailure',
83
- 'SubagentStart',
84
- 'SubagentStop',
85
- 'PreCompact',
86
- 'PostCompact',
87
- 'PermissionRequest',
88
- 'PermissionDenied',
89
- 'Setup',
90
- 'TeammateIdle',
91
- 'TaskCreated',
92
- 'TaskCompleted',
93
- 'Elicitation',
94
- 'ElicitationResult',
95
- 'ConfigChange',
96
- 'WorktreeCreate',
97
- 'WorktreeRemove',
98
- 'InstructionsLoaded',
99
- 'CwdChanged',
100
- 'FileChanged',
101
- ]),
102
- codex: new Set([
103
- 'PreToolUse',
104
- 'PermissionRequest',
105
- 'PostToolUse',
106
- 'SessionStart',
107
- 'UserPromptSubmit',
108
- 'Stop',
109
- ]),
110
- };
111
- const MATCHERLESS_NATIVE_HOOK_EVENTS = {
112
- claude: new Set([
113
- 'UserPromptSubmit',
114
- 'Stop',
115
- 'TeammateIdle',
116
- 'TaskCreated',
117
- 'TaskCompleted',
118
- 'WorktreeCreate',
119
- 'WorktreeRemove',
120
- 'CwdChanged',
121
- ]),
122
- codex: new Set(['UserPromptSubmit', 'Stop']),
123
- };
124
48
  const TEMPLATE_TEXT_FILE_EXTENSIONS = /\.(md|markdown|txt|json|yaml|yml|toml|rules)$/i;
125
- const SLASH_COMMAND_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
126
- const DEFAULT_SLASH_COMMANDS_DIR = 'slash-commands';
127
49
  const SCRIPT_NODE_EXTENSIONS = new Set(['.js', '.mjs', '.cjs']);
128
50
  const SCRIPT_TIMEOUT_MIN_MS = 1000;
129
- const SCRIPT_TIMEOUT_MAX_MS = 300000;
130
- const ARTIFACT_TARGETS = new Set(getPluginAuthoringAcceptedValues('artifacts', 'artifacts.targets[].target'));
131
- const ARTIFACT_STATES = new Set(getPluginAuthoringAcceptedValues('artifacts', 'artifacts.targets[].states'));
132
- const ARTIFACT_SCOPES = new Set(['user', 'project']);
133
- const ARTIFACT_KINDS = new Set(['instruction', 'codexRole', 'skill']);
134
- const ARTIFACT_PROJECT_MANAGED_KINDS = new Set(['instruction', 'agent', 'skill']);
135
- const ARTIFACT_KIND_BY_TARGET = {
136
- 'codex.developerInstructionsBlock': 'instruction',
137
- 'codex.agentRole': 'codexRole',
138
- 'codex.skill': 'skill',
139
- 'claude.skill': 'skill',
140
- 'agent-skills.skill': 'skill',
141
- };
142
- const ARTIFACT_PROJECT_MANAGED_KIND_BY_TARGET = {
143
- 'codex.developerInstructionsBlock': 'instruction',
144
- 'codex.agentRole': 'agent',
145
- 'codex.skill': 'skill',
146
- };
51
+ const SCRIPT_TIMEOUT_MAX_MS = 1800000;
147
52
  const PLUGIN_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
148
53
  let yamlParser = null;
149
54
  let pluginVersionCheckResult = null;
@@ -224,56 +129,12 @@ function templateIncludesPath(manifest, relativePath) {
224
129
  return false;
225
130
  return include.some((pattern) => matchesGlob(normalized, pattern));
226
131
  }
227
- function resolveTemplateValue(vars, platform) {
228
- const resolved = {};
229
- for (const [key, entry] of Object.entries(vars)) {
230
- if (entry && typeof entry === 'object' && !Array.isArray(entry)) {
231
- resolved[key] = entry[platform];
232
- }
233
- }
234
- return resolved;
235
- }
236
- function replaceConditionalBlocks(input, resolvedVars, tagName) {
237
- const pattern = new RegExp(`{{#${tagName}\\s+([a-zA-Z0-9_]+)}}([\\s\\S]*?){{\\/${tagName}}}`, 'g');
238
- return input.replace(pattern, (_match, rawKey, blockContent) => {
239
- const truthy = resolvedVars[rawKey] === true;
240
- if (tagName === 'if') {
241
- return truthy ? blockContent : '';
242
- }
243
- return truthy ? '' : blockContent;
244
- });
245
- }
246
- function renderTemplate(content, vars, platform) {
247
- const resolvedVars = resolveTemplateValue(vars, platform);
248
- const withConditionals = replaceConditionalBlocks(replaceConditionalBlocks(content, resolvedVars, 'if'), resolvedVars, 'unless');
249
- return withConditionals.replace(/{{([a-zA-Z0-9_]+)}}/g, (_match, rawKey) => {
250
- const value = resolvedVars[rawKey];
251
- if (value === undefined)
252
- return '';
253
- return String(value);
254
- });
255
- }
256
132
  function renderTemplateForPlatform(manifest, relativePath, content, platform) {
257
133
  if (!templateIncludesPath(manifest, relativePath))
258
134
  return content;
259
135
  const vars = manifest.buildConfig?.templates?.vars ?? {};
260
136
  return renderTemplate(content, vars, platform);
261
137
  }
262
- function renderedContentVariants(manifest, relativePath, content, platforms) {
263
- if (!templateIncludesPath(manifest, relativePath)) {
264
- return [{ content, platform: null }];
265
- }
266
- const seen = new Set();
267
- const variants = [];
268
- for (const platform of platforms) {
269
- const rendered = renderTemplateForPlatform(manifest, relativePath, content, platform);
270
- if (seen.has(rendered))
271
- continue;
272
- seen.add(rendered);
273
- variants.push({ content: rendered, platform });
274
- }
275
- return variants;
276
- }
277
138
  function formatYamlError(parseError, lineCounter, sourceName) {
278
139
  let location = '';
279
140
  if (Array.isArray(parseError.pos) && Number.isInteger(parseError.pos[0])) {
@@ -315,28 +176,38 @@ async function tryLoadCliManifestTools() {
315
176
  const manifestModulePath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'manifest.js');
316
177
  const runtimeProjectionModulePath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'catalog-runtime-projection.js');
317
178
  const capabilityModulePath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'commands', 'aw-capabilities.js');
179
+ const materializationPath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'review', 'skill-materialization.js');
180
+ const commandMaterializationPath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'managed-command-materialization.js');
318
181
  if (!fs.existsSync(manifestModulePath)
319
182
  || !fs.existsSync(runtimeProjectionModulePath)
320
183
  || !fs.existsSync(capabilityModulePath))
321
184
  return null;
322
185
  try {
323
- const [manifestModule, runtimeProjectionModule, capabilityModule] = await Promise.all([
186
+ const [manifestModule, runtimeProjectionModule, capabilityModule, materializationModule, commandModule] = await Promise.all([
324
187
  import(pathToFileURL(manifestModulePath).href),
325
188
  import(pathToFileURL(runtimeProjectionModulePath).href),
326
189
  import(pathToFileURL(capabilityModulePath).href),
190
+ import(pathToFileURL(materializationPath).href),
191
+ import(pathToFileURL(commandMaterializationPath).href),
327
192
  ]);
328
193
  if (manifestModule.SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION
329
- !== SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION) {
194
+ !== SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION
195
+ || typeof materializationModule.materializeProfilePluginComponents !== 'function') {
330
196
  return null;
331
197
  }
332
198
  return {
333
199
  assertPluginInputTree: manifestModule.assertPluginInputTree ?? null,
334
200
  validateSourcePluginManifest: manifestModule.validateSourcePluginManifest ?? null,
201
+ reservedImports: manifestModule.CLI_RESERVED_IMPORTS,
335
202
  readPluginManifest: manifestModule.readPluginManifest ?? null,
336
203
  discoverPlugins: manifestModule.discoverPlugins ?? null,
337
204
  resolvePluginRequirements: manifestModule.resolvePluginRequirements ?? null,
338
205
  implementedCapabilities: capabilityModule.IMPLEMENTED_AW_CAPABILITIES ?? null,
339
206
  createRuntimeResolver: runtimeProjectionModule.createCatalogRuntimeImportResolver ?? null,
207
+ materializeProfilePluginComponents: materializationModule.materializeProfilePluginComponents,
208
+ createIsolatedSkillEnv: materializationModule.createIsolatedSkillEnv,
209
+ prepareManagedCommandPackage: commandModule.prepareManagedCommandPackage,
210
+ validateRuntimeSkillClosure: (await import(pathToFileURL(path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'runtime-skill-closure.js')).href)).validateRuntimeSkillClosure,
340
211
  };
341
212
  }
342
213
  catch {
@@ -479,166 +350,11 @@ function validateStrictSemVerString(value, fieldName) {
479
350
  }
480
351
  return value;
481
352
  }
482
- function validateManifestLightweight(manifest) {
483
- const input = expectRecord(manifest, 'plugin manifest');
484
- if (!input)
485
- return;
486
- if (Object.prototype.hasOwnProperty.call(input, 'commands')) {
487
- error('top-level "commands" has been removed; use "slashCommands" instead');
488
- }
489
- validateAllowedKeys(input, 'plugin manifest', [
490
- 'schemaVersion',
491
- 'name',
492
- 'version',
493
- 'description',
494
- 'dependencies',
495
- 'requires',
496
- 'skills',
497
- 'slashCommands',
498
- 'mcpServers',
499
- 'apps',
500
- 'distributions',
501
- 'marketplace',
502
- 'interface',
503
- 'extensions',
504
- 'buildConfig',
505
- 'scripts',
506
- 'config',
507
- 'artifacts',
508
- ]);
509
- if (manifest.dependencies !== undefined) {
510
- if (!Array.isArray(manifest.dependencies)) {
511
- error('dependencies must be an array');
512
- }
513
- else if (manifest.dependencies.length > 64) {
514
- error('dependencies must contain at most 64 direct plugin dependencies');
515
- }
516
- else {
517
- const seen = new Set();
518
- for (const [index, dependency] of manifest.dependencies.entries()) {
519
- if (typeof dependency !== 'string' || !PLUGIN_NAME_PATTERN.test(dependency)) {
520
- error(`dependencies[${index}] must be an ASCII lowercase hyphen-case plugin name`);
521
- continue;
522
- }
523
- if (dependency === manifest.name) {
524
- error(`plugin "${manifest.name}" cannot depend on itself`);
525
- }
526
- if (seen.has(dependency)) {
527
- error(`dependencies contains duplicate plugin "${dependency}"`);
528
- }
529
- seen.add(dependency);
530
- }
531
- }
532
- }
533
- for (const field of ['name', 'version', 'description', 'marketplace']) {
534
- if (!manifest[field]) {
535
- error(`Missing required field: ${field}`);
536
- }
537
- }
538
- if (manifest.name && !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(manifest.name)) {
539
- error(`manifest name "${manifest.name}" is not lowercase-hyphen-case`);
540
- }
541
- if (manifest.version) {
542
- const pluginVersion = parseStrictSemVer(manifest.version);
543
- if (!pluginVersion) {
544
- error(`manifest.version must be a strict SemVer 2.0.0 string, got "${manifest.version}"`);
545
- }
546
- else if (pluginVersion.prerelease.length > 0 || pluginVersion.build.length > 0) {
547
- error('manifest.version must be a stable SemVer without prerelease or build metadata');
548
- }
549
- }
550
- if (manifest.marketplace) {
551
- const mp = manifest.marketplace;
552
- if (!mp.category)
553
- error('marketplace.category is required');
554
- if (typeof mp.strict !== 'boolean')
555
- error('marketplace.strict must be a boolean');
556
- if (!mp.policy || !mp.policy.installation)
557
- error('marketplace.policy.installation is required');
558
- else if (!MARKETPLACE_INSTALLATION_POLICIES.has(mp.policy.installation))
559
- error(`marketplace.policy.installation must be one of ${[...MARKETPLACE_INSTALLATION_POLICIES].map((value) => JSON.stringify(value)).join(', ')}`);
560
- if (!mp.policy || !mp.policy.authentication)
561
- error('marketplace.policy.authentication is required');
562
- else if (!MARKETPLACE_AUTHENTICATION_POLICIES.has(mp.policy.authentication))
563
- error('marketplace.policy.authentication must be "ON_INSTALL" or "ON_USE"');
564
- validateManifestPolicyProducts(mp.policy?.products);
565
- }
566
- for (const field of ['skills', 'slashCommands', 'mcpServers', 'apps']) {
567
- if (manifest[field] && !manifest[field].startsWith('./')) {
568
- error(`${field} path must start with "./", got "${manifest[field]}"`);
569
- }
570
- }
571
- const claudeCommands = manifest.buildConfig?.manifestOverrides?.claude?.commands;
572
- if (claudeCommands !== undefined) {
573
- error('buildConfig.manifestOverrides.claude.commands has been removed; use "slashCommands" instead');
574
- }
575
- for (const platform of ['claude', 'codex']) {
576
- const rules = manifest.buildConfig?.fileRules?.[platform];
577
- if (!rules)
578
- continue;
579
- for (const pattern of [...(rules.include ?? []), ...(rules.exclude ?? [])]) {
580
- const normalized = String(pattern).replace(/\\/g, '/').replace(/^\.\//, '');
581
- if (normalized === 'commands' || normalized.startsWith('commands/')) {
582
- error(`buildConfig.fileRules.${platform} no longer accepts legacy "commands/**" source rules; use "slashCommands" instead`);
583
- }
584
- }
585
- }
586
- validateExtensionsLightweight(manifest.extensions);
587
- validatePlatformFieldSupport(manifest);
588
- }
589
- function validatePortableNativeArtifactCapabilityLightweight(manifest) {
590
- if (manifest.distributions?.agentSkills === undefined)
591
- return;
592
- const hasOtherNativeDeclaration = Boolean(manifest.skills
593
- || manifest.slashCommands
594
- || manifest.mcpServers
595
- || manifest.apps
596
- || (manifest.extensions?.instructions?.length ?? 0) > 0
597
- || (manifest.extensions?.permissions?.length ?? 0) > 0
598
- || (manifest.extensions?.hooks?.length ?? 0) > 0
599
- || (manifest.extensions?.nativeHooks?.claude?.length ?? 0) > 0
600
- || (manifest.extensions?.nativeHooks?.codex?.length ?? 0) > 0
601
- || (manifest.extensions?.agents?.length ?? 0) > 0);
602
- const hasPresentNativeArtifact = (manifest.artifacts?.targets ?? []).some((target) => (target?.platform === 'claude' || target?.platform === 'codex')
603
- && Array.isArray(target.states)
604
- && target.states.includes('present'));
605
- if (!hasOtherNativeDeclaration && !hasPresentNativeArtifact) {
606
- const message = 'Invalid plugin manifest: portable-only plugins are not supported. Declare at least one non-empty native capability.';
607
- if (!errors.includes(message))
608
- error(message);
609
- }
610
- }
611
- function normalizeManifestProductToken(value) {
612
- return String(value).trim().toUpperCase().replace(/[\s-]+/g, '_');
613
- }
614
- function resolveSupportedPlatforms(manifest) {
615
- const products = manifest.marketplace?.policy?.products;
616
- if (!Array.isArray(products) || products.length === 0) {
617
- return new Set(['claude', 'codex']);
618
- }
619
- const supported = new Set();
620
- for (const product of products) {
621
- const normalized = normalizeManifestProductToken(product);
622
- if (normalized === 'CLAUDE')
623
- supported.add('claude');
624
- if (normalized === 'CODEX')
625
- supported.add('codex');
626
- }
627
- return supported;
628
- }
629
353
  function supportsManifestPlatform(manifest, platform) {
630
354
  return resolveSupportedPlatforms(manifest).has(platform);
631
355
  }
632
- function formatManifestProductsForError(manifest) {
633
- const products = manifest.marketplace?.policy?.products;
634
- if (!Array.isArray(products) || products.length === 0) {
635
- return 'marketplace.policy.products=[]';
636
- }
637
- const normalized = [...new Set(products.map(normalizeManifestProductToken))];
638
- return `marketplace.policy.products=[${normalized.join(', ')}]`;
639
- }
640
- function platformProductName(platform) {
641
- return platform === 'claude' ? 'CLAUDE' : 'CODEX';
356
+ function formatManifestPlatformsForError(manifest) {
357
+ return `platforms=[${[...resolveSupportedPlatforms(manifest)].join(', ')}]`;
642
358
  }
643
359
  function pluginNameForError(manifest) {
644
360
  return typeof manifest.name === 'string' && manifest.name.trim()
@@ -648,77 +364,27 @@ function pluginNameForError(manifest) {
648
364
  function assertPlatformFieldSupported(manifest, fieldPath, requiredPlatform) {
649
365
  if (supportsManifestPlatform(manifest, requiredPlatform))
650
366
  return;
651
- error(`Invalid plugin "${pluginNameForError(manifest)}": ${fieldPath} requires ${platformProductName(requiredPlatform)} support, but ${formatManifestProductsForError(manifest)}.`);
367
+ error(`Invalid plugin "${pluginNameForError(manifest)}": ${fieldPath} requires ${requiredPlatform} support, but ${formatManifestPlatformsForError(manifest)}.`);
652
368
  }
653
369
  function hasNonEmptyOverride(value) {
654
370
  return isRecord(value) && Object.keys(value).length > 0;
655
371
  }
656
- function validateManifestPolicyProducts(products) {
657
- if (products === undefined)
658
- return;
659
- if (!Array.isArray(products)) {
660
- error('marketplace.policy.products must be an array');
661
- return;
662
- }
663
- for (const [index, product] of products.entries()) {
664
- const fieldName = `marketplace.policy.products[${index}]`;
665
- if (typeof product !== 'string' || product.trim() === '') {
666
- error(`${fieldName} must be a non-empty string`);
667
- continue;
372
+ function validatePlatformFieldSupport(manifest) {
373
+ for (const platform of PLATFORM_TARGETS) {
374
+ if (manifest.buildConfig?.fileRules?.[platform] !== undefined) {
375
+ assertPlatformFieldSupported(manifest, `buildConfig.fileRules.${platform}`, platform);
668
376
  }
669
- const normalized = normalizeManifestProductToken(product);
670
- if (!MANIFEST_POLICY_PRODUCTS.has(normalized)) {
671
- error(`${fieldName} must be one of "CODEX" or "CLAUDE"`);
377
+ if ((manifest.extensions?.nativeHooks?.[platform]?.length ?? 0) > 0) {
378
+ assertPlatformFieldSupported(manifest, `extensions.nativeHooks.${platform}`, platform);
672
379
  }
673
- }
674
- }
675
- function validatePlatformFieldSupport(manifest) {
676
- if (manifest.buildConfig?.fileRules?.claude !== undefined) {
677
- assertPlatformFieldSupported(manifest, 'buildConfig.fileRules.claude', 'claude');
678
- }
679
- if (manifest.buildConfig?.fileRules?.codex !== undefined) {
680
- assertPlatformFieldSupported(manifest, 'buildConfig.fileRules.codex', 'codex');
681
- }
682
- if (manifest.buildConfig?.manifestOverrides?.claude !== undefined) {
683
- assertPlatformFieldSupported(manifest, 'buildConfig.manifestOverrides.claude', 'claude');
684
- }
685
- if (manifest.buildConfig?.manifestOverrides?.codex !== undefined) {
686
- assertPlatformFieldSupported(manifest, 'buildConfig.manifestOverrides.codex', 'codex');
687
- }
688
- if (manifest.apps) {
689
- assertPlatformFieldSupported(manifest, 'apps', 'codex');
690
- }
691
- if (Array.isArray(manifest.extensions?.nativeHooks?.claude) && manifest.extensions.nativeHooks.claude.length > 0) {
692
- assertPlatformFieldSupported(manifest, 'extensions.nativeHooks.claude', 'claude');
693
- }
694
- if (Array.isArray(manifest.extensions?.nativeHooks?.codex) && manifest.extensions.nativeHooks.codex.length > 0) {
695
- assertPlatformFieldSupported(manifest, 'extensions.nativeHooks.codex', 'codex');
696
- }
697
- for (const [fieldName, entries] of [
698
- ['extensions.instructions', manifest.extensions?.instructions],
699
- ['extensions.permissions', manifest.extensions?.permissions],
700
- ['extensions.hooks', manifest.extensions?.hooks],
701
- ['extensions.agents', manifest.extensions?.agents],
702
- ]) {
703
- if (!Array.isArray(entries))
704
- continue;
705
- entries.forEach((entry, index) => {
706
- if (!isRecord(entry.agentOverrides))
707
- return;
708
- for (const platform of ['claude', 'codex']) {
709
- if (hasNonEmptyOverride(entry.agentOverrides[platform])) {
710
- assertPlatformFieldSupported(manifest, `${fieldName}[${index}].agentOverrides.${platform}`, platform);
380
+ for (const fieldName of ['instructions', 'permissions', 'hooks', 'agents']) {
381
+ for (const [index, entry] of (manifest.extensions?.[fieldName] ?? []).entries()) {
382
+ if (hasNonEmptyOverride(entry.agentOverrides?.[platform])) {
383
+ assertPlatformFieldSupported(manifest, `extensions.${fieldName}[${index}].agentOverrides.${platform}`, platform);
711
384
  }
712
385
  }
713
- });
714
- }
715
- if (!Array.isArray(manifest.artifacts?.targets))
716
- return;
717
- manifest.artifacts.targets.forEach((target, index) => {
718
- if (target?.platform === 'claude' || target?.platform === 'codex') {
719
- assertPlatformFieldSupported(manifest, `artifacts.targets[${index}].platform`, target.platform);
720
386
  }
721
- });
387
+ }
722
388
  }
723
389
  function isTemplateAsset(manifest, relativePath) {
724
390
  return templateIncludesPath(manifest, relativePath);
@@ -738,185 +404,7 @@ function validateManifestString(value, fieldName) {
738
404
  error(`${fieldName} must be a non-empty string`);
739
405
  return null;
740
406
  }
741
- return value;
742
- }
743
- function validatePublicHookEvent(value, fieldName) {
744
- const event = validateManifestString(value, fieldName);
745
- if (!event)
746
- return null;
747
- if (event === 'session_stop') {
748
- error(`${fieldName}: public event "session_stop" has been removed; use extensions.nativeHooks.claude[].event = "Stop" or "SessionEnd", or extensions.nativeHooks.codex[].event = "Stop"`);
749
- return null;
750
- }
751
- if (!PUBLIC_HOOK_EVENTS.has(event)) {
752
- error(`${fieldName}: unsupported public hook event "${event}"`);
753
- return null;
754
- }
755
- return event;
756
- }
757
- function normalizePublicSessionStartMatcher(matcher, fieldName) {
758
- if (matcher === undefined)
759
- return PUBLIC_SESSION_START_DEFAULT_MATCHER;
760
- if (typeof matcher !== 'string' || matcher.trim() === '') {
761
- error(`${fieldName} must be a non-empty string`);
762
- return null;
763
- }
764
- const selected = new Set();
765
- for (const part of matcher.split('|')) {
766
- if (!PUBLIC_SESSION_START_SOURCES.has(part)) {
767
- error(`${fieldName}: public session_start only allows startup, resume, clear, or their "|" union`);
768
- return null;
769
- }
770
- selected.add(part);
771
- }
772
- return ['startup', 'resume', 'clear'].filter((part) => selected.has(part)).join('|');
773
- }
774
- function validatePublicHookMatcher(event, matcher, fieldName) {
775
- if (matcher === undefined)
776
- return event === 'session_start' ? PUBLIC_SESSION_START_DEFAULT_MATCHER : undefined;
777
- if (typeof matcher !== 'string' || matcher.trim() === '') {
778
- error(`${fieldName} must be a non-empty string`);
779
- return null;
780
- }
781
- if (event === 'session_start') {
782
- return normalizePublicSessionStartMatcher(matcher, fieldName);
783
- }
784
- return matcher;
785
- }
786
- function validateNativeHookEvent(value, platform, fieldName) {
787
- const event = validateManifestString(value, fieldName);
788
- if (!event)
789
- return null;
790
- if (!NATIVE_HOOK_EVENTS[platform].has(event)) {
791
- error(`${fieldName}: unsupported ${platform} hook event "${event}"`);
792
- return null;
793
- }
794
- return event;
795
- }
796
- function validateNativeHookMatcher(event, platform, matcher, fieldName) {
797
- if (matcher === undefined)
798
- return undefined;
799
- if (typeof matcher !== 'string' || matcher.trim() === '') {
800
- error(`${fieldName} must be a non-empty string`);
801
- return null;
802
- }
803
- if (MATCHERLESS_NATIVE_HOOK_EVENTS[platform].has(event)) {
804
- error(`${fieldName}: ${platform} event "${event}" does not allow matcher`);
805
- return null;
806
- }
807
- return matcher;
808
- }
809
- function validateHookAgentOverrides(value, baseHook, fieldName, duplicateCollector) {
810
- if (value === undefined) {
811
- for (const platform of ['claude', 'codex']) {
812
- duplicateCollector(platform, baseHook);
813
- }
814
- return;
815
- }
816
- const overrides = expectRecord(value, fieldName);
817
- if (!overrides)
818
- return;
819
- validateAllowedKeys(overrides, fieldName, ['claude', 'codex']);
820
- for (const platform of ['claude', 'codex']) {
821
- const override = overrides[platform];
822
- if (override === null)
823
- continue;
824
- if (override === undefined) {
825
- duplicateCollector(platform, baseHook);
826
- continue;
827
- }
828
- const overrideRecord = expectRecord(override, `${fieldName}.${platform}`);
829
- if (!overrideRecord)
830
- continue;
831
- validateAllowedKeys(overrideRecord, `${fieldName}.${platform}`, ['event', 'matcher', 'command']);
832
- const event = overrideRecord.event === undefined
833
- ? baseHook.event
834
- : validatePublicHookEvent(overrideRecord.event, `${fieldName}.${platform}.event`);
835
- const matcherValue = overrideRecord.matcher === undefined
836
- ? baseHook.matcher
837
- : overrideRecord.matcher;
838
- const matcher = event
839
- ? validatePublicHookMatcher(event, matcherValue, `${fieldName}.${platform}.matcher`)
840
- : null;
841
- const command = overrideRecord.command === undefined
842
- ? baseHook.command
843
- : validateManifestString(overrideRecord.command, `${fieldName}.${platform}.command`);
844
- if (event && matcher !== null && command) {
845
- duplicateCollector(platform, { event, matcher, command });
846
- }
847
- }
848
- }
849
- function validateHookEntryLightweight(entry, fieldName, duplicateCollector) {
850
- const input = expectRecord(entry, fieldName);
851
- if (!input)
852
- return;
853
- validateAllowedKeys(input, fieldName, ['event', 'matcher', 'command', 'agentOverrides']);
854
- const event = validatePublicHookEvent(input.event, `${fieldName}.event`);
855
- const matcher = event
856
- ? validatePublicHookMatcher(event, input.matcher, `${fieldName}.matcher`)
857
- : null;
858
- const command = validateManifestString(input.command, `${fieldName}.command`);
859
- if (!event || matcher === null || !command)
860
- return;
861
- validateHookAgentOverrides(input.agentOverrides, { event, matcher, command }, `${fieldName}.agentOverrides`, duplicateCollector);
862
- }
863
- function validateNativeHookEntryLightweight(entry, platform, fieldName, duplicateCollector) {
864
- const input = expectRecord(entry, fieldName);
865
- if (!input)
866
- return;
867
- validateAllowedKeys(input, fieldName, ['event', 'matcher', 'command']);
868
- const event = validateNativeHookEvent(input.event, platform, `${fieldName}.event`);
869
- const matcher = event
870
- ? validateNativeHookMatcher(event, platform, input.matcher, `${fieldName}.matcher`)
871
- : null;
872
- const command = validateManifestString(input.command, `${fieldName}.command`);
873
- if (!event || matcher === null || !command)
874
- return;
875
- duplicateCollector(platform, { event, matcher, command, native: true });
876
- }
877
- function validateExtensionsLightweight(extensions) {
878
- if (extensions === undefined)
879
- return;
880
- const input = expectRecord(extensions, 'extensions');
881
- if (!input)
882
- return;
883
- validateAllowedKeys(input, 'extensions', ['instructions', 'permissions', 'hooks', 'nativeHooks', 'agents']);
884
- const seenHooks = {
885
- claude: new Set(),
886
- codex: new Set(),
887
- };
888
- const collectHook = (platform, hook) => {
889
- const event = hook.native ? hook.event : PUBLIC_HOOK_RENDER_MAP[platform][hook.event];
890
- const matcher = hook.matcher === '*' ? undefined : hook.matcher;
891
- const key = JSON.stringify([event, matcher ?? null, hook.command]);
892
- if (seenHooks[platform].has(key)) {
893
- error(`extensions has duplicate ${platform} hook for event "${event}" and command "${hook.command}"`);
894
- }
895
- seenHooks[platform].add(key);
896
- };
897
- if (input.hooks !== undefined) {
898
- if (!Array.isArray(input.hooks)) {
899
- error('extensions.hooks must be an array');
900
- }
901
- else {
902
- input.hooks.forEach((entry, index) => validateHookEntryLightweight(entry, `extensions.hooks[${index}]`, collectHook));
903
- }
904
- }
905
- if (input.nativeHooks !== undefined) {
906
- const nativeHooks = expectRecord(input.nativeHooks, 'extensions.nativeHooks');
907
- if (nativeHooks) {
908
- validateAllowedKeys(nativeHooks, 'extensions.nativeHooks', ['claude', 'codex']);
909
- for (const platform of ['claude', 'codex']) {
910
- if (nativeHooks[platform] === undefined)
911
- continue;
912
- if (!Array.isArray(nativeHooks[platform])) {
913
- error(`extensions.nativeHooks.${platform} must be an array`);
914
- continue;
915
- }
916
- nativeHooks[platform].forEach((entry, index) => validateNativeHookEntryLightweight(entry, platform, `extensions.nativeHooks.${platform}[${index}]`, collectHook));
917
- }
918
- }
919
- }
407
+ return value.trim();
920
408
  }
921
409
  function expectRecord(value, fieldName) {
922
410
  if (!isRecord(value)) {
@@ -957,9 +445,9 @@ async function validatePluginEvalManifest(pluginDir, pluginManifest) {
957
445
  if (fs.existsSync(legacyRoot)) {
958
446
  error('Plugin-root evals/ is legacy; put evals/ inside its owning static or dynamic Skill directory.');
959
447
  }
960
- const skillRoots = [...collectDeclaredSkillNames(pluginDir, pluginManifest).all]
961
- .sort()
962
- .map((skill) => ({ skill, root: path.join(pluginDir, 'skills', skill) }));
448
+ const sourceSkills = path.join(pluginDir, 'skills');
449
+ const skillRoots = fs.existsSync(sourceSkills) ? fs.readdirSync(sourceSkills, { withFileTypes: true })
450
+ .filter((entry) => entry.isDirectory()).map((entry) => ({ skill: entry.name, root: path.join(sourceSkills, entry.name) })) : [];
963
451
  const seenSkills = new Set();
964
452
  let manifestTools = null;
965
453
  for (const owner of skillRoots) {
@@ -1026,14 +514,6 @@ function validateCodexMetadataString(record, key, fieldName, maxLength, required
1026
514
  }
1027
515
  return sanitized;
1028
516
  }
1029
- function validateCodexShortDescription(record, fieldName) {
1030
- const sanitized = validateCodexMetadataString(record, 'short_description', fieldName, MAX_OPENAI_INTERFACE_DESCRIPTION_LEN);
1031
- if (sanitized !== null &&
1032
- countCharacters(sanitized) < MIN_OPENAI_INTERFACE_DESCRIPTION_LEN) {
1033
- error(`${fieldName}.short_description must be >= ${MIN_OPENAI_INTERFACE_DESCRIPTION_LEN} characters`);
1034
- }
1035
- return sanitized;
1036
- }
1037
517
  function validateCodexDefaultPrompt(record, key, fieldName, maxLength, skillReference, required = false) {
1038
518
  const sanitized = validateCodexMetadataString(record, key, fieldName, maxLength, required);
1039
519
  if (sanitized === null)
@@ -1263,7 +743,7 @@ function targetedPlatforms(manifest) {
1263
743
  platforms.push('claude');
1264
744
  if (isCodexTargeted(manifest))
1265
745
  platforms.push('codex');
1266
- return platforms.length > 0 ? platforms : ['claude', 'codex'];
746
+ return platforms;
1267
747
  }
1268
748
  // ---------------------------------------------------------------------------
1269
749
  // Supplemental checks (always run — not covered by CLI validator)
@@ -1283,7 +763,7 @@ function validateNoBuildOutputDirs(pluginDir) {
1283
763
  }
1284
764
  }
1285
765
  function validateDeclaredPathsExist(pluginDir, manifest) {
1286
- for (const field of ['skills', 'slashCommands', 'mcpServers', 'apps']) {
766
+ for (const field of ['skills', 'mcpServers']) {
1287
767
  if (!manifest[field])
1288
768
  continue;
1289
769
  const resolved = path.join(pluginDir, manifest[field]);
@@ -1292,7 +772,7 @@ function validateDeclaredPathsExist(pluginDir, manifest) {
1292
772
  }
1293
773
  }
1294
774
  }
1295
- function validateCanonicalSkillLayout(pluginDir, manifest) {
775
+ async function validateCanonicalSkillLayout(pluginDir, manifest) {
1296
776
  if (manifest.skills && normalizeRelativePath(manifest.skills) !== 'skills') {
1297
777
  error('skills must be "./skills"');
1298
778
  }
@@ -1305,18 +785,8 @@ function validateCanonicalSkillLayout(pluginDir, manifest) {
1305
785
  if (content.trim() === '')
1306
786
  error('Plugin root README.md must not be empty');
1307
787
  }
1308
- const declared = collectDeclaredSkillNames(pluginDir, manifest);
1309
- const sourceBackedDynamicSkills = (Array.isArray(manifest.artifacts?.targets)
1310
- ? manifest.artifacts.targets
1311
- : [])
1312
- .filter((target) => target &&
1313
- typeof target === 'object' &&
1314
- (target.target === 'codex.skill' || target.target === 'claude.skill') &&
1315
- typeof target.skillKey === 'string' &&
1316
- Array.isArray(target.sourceDirs) &&
1317
- target.sourceDirs.length > 0)
1318
- .map((target) => target.skillKey.trim());
1319
- for (const skill of new Set([...declared.static, ...sourceBackedDynamicSkills])) {
788
+ const declared = await collectDeclaredSkillNames(pluginDir, manifest);
789
+ for (const skill of declared.static) {
1320
790
  const skillRoot = path.join(pluginDir, 'skills', skill);
1321
791
  if (!fs.statSync(skillRoot, { throwIfNoEntry: false })?.isDirectory()) {
1322
792
  error(`Skill ${JSON.stringify(skill)} must use source root "./skills/${skill}"`);
@@ -1332,94 +802,32 @@ function validateCanonicalSkillLayout(pluginDir, manifest) {
1332
802
  error(`skills/${skill}/README.md must not be empty`);
1333
803
  }
1334
804
  }
1335
- const portableRoot = manifest.distributions?.agentSkills?.skills;
1336
- for (const skill of declared.portable) {
1337
- const skillRoot = path.join(pluginDir, portableRoot, skill);
1338
- const skillReadme = path.join(skillRoot, 'README.md');
1339
- if (!fs.statSync(skillReadme, { throwIfNoEntry: false })?.isFile()) {
1340
- error(`${normalizeRelativePath(path.join(portableRoot, skill, 'README.md'))} is required`);
1341
- continue;
1342
- }
1343
- if (fs.readFileSync(skillReadme, 'utf8').trim() === '') {
1344
- error(`${normalizeRelativePath(path.join(portableRoot, skill, 'README.md'))} must not be empty`);
1345
- }
1346
- }
1347
805
  }
1348
806
  function validateDeclaredNativeAssets(pluginDir, manifest) {
1349
- const defaults = [
1350
- ['skills', 'skills'],
1351
- [DEFAULT_SLASH_COMMANDS_DIR, 'slashCommands'],
1352
- ['.mcp.json', 'mcpServers'],
1353
- ['.app.json', 'apps'],
1354
- ];
1355
- for (const [filename, field] of defaults) {
807
+ for (const [filename, field] of [['skills', 'skills'], ['.mcp.json', 'mcpServers']]) {
1356
808
  const fullPath = path.join(pluginDir, filename);
1357
- if (fs.existsSync(fullPath) && !manifest[field]) {
1358
- if (field === 'skills') {
1359
- const dynamicSkills = new Set((Array.isArray(manifest.artifacts?.targets) ? manifest.artifacts.targets : [])
1360
- .filter((target) => {
1361
- if (!target ||
1362
- typeof target !== 'object' ||
1363
- (target.target !== 'codex.skill' && target.target !== 'claude.skill') ||
1364
- typeof target.skillKey !== 'string' ||
1365
- !Array.isArray(target.sourceDirs) ||
1366
- target.sourceDirs.length === 0)
1367
- return false;
1368
- return target.sourceDirs.every((sourceDir) => typeof sourceDir === 'string' &&
1369
- (normalizeRelativePath(sourceDir) === `skills/${target.skillKey}` ||
1370
- normalizeRelativePath(sourceDir).startsWith(`skills/${target.skillKey}/`)));
1371
- })
1372
- .map((target) => target.skillKey));
1373
- const entries = fs.readdirSync(fullPath, { withFileTypes: true });
1374
- if (entries.length > 0 &&
1375
- entries.every((entry) => entry.isDirectory() && dynamicSkills.has(entry.name))) {
1376
- continue;
1377
- }
1378
- }
1379
- error(`"${filename}" exists but manifest does not declare "${field}" — declare it or remove the file`);
809
+ if (!fs.existsSync(fullPath) || manifest[field])
810
+ continue;
811
+ if (field === 'skills') {
812
+ const sources = (manifest.artifacts?.sourceDirs ?? []).map(normalizeRelativePath);
813
+ const entries = fs.readdirSync(fullPath, { withFileTypes: true });
814
+ if (entries.length && entries.every((entry) => entry.isDirectory() && sources.some((source) => source === 'skills' || source === `skills/${entry.name}`)))
815
+ continue;
1380
816
  }
817
+ error(`"${filename}" exists but manifest does not declare "${field}" or an artifacts.sourceDirs input`);
1381
818
  }
1382
819
  }
1383
- function collectDeclaredSkillNames(pluginDir, manifest) {
1384
- const skillsRoot = typeof manifest.skills === 'string'
1385
- ? path.join(pluginDir, manifest.skills)
1386
- : null;
1387
- const staticSkillNames = skillsRoot && fs.existsSync(skillsRoot)
1388
- ? fs.readdirSync(skillsRoot, { withFileTypes: true })
1389
- .filter((entry) => entry.isDirectory())
1390
- .map((entry) => entry.name)
1391
- .sort()
1392
- : [];
1393
- const staticSkillNameSet = new Set(staticSkillNames);
1394
- const artifactTargets = Array.isArray(manifest.artifacts?.targets)
1395
- ? manifest.artifacts.targets
1396
- : [];
1397
- const dynamicSkillNames = artifactTargets
1398
- .filter((target) => target
1399
- && typeof target === 'object'
1400
- && (target.target === 'codex.skill' || target.target === 'claude.skill')
1401
- && typeof target.skillKey === 'string'
1402
- && target.skillKey.trim() !== '')
1403
- .map((target) => target.skillKey.trim())
1404
- .sort();
1405
- const dynamicSkillNameSet = new Set(dynamicSkillNames);
1406
- const portableRoot = typeof manifest.distributions?.agentSkills?.skills === 'string'
1407
- ? path.join(pluginDir, manifest.distributions.agentSkills.skills)
1408
- : null;
1409
- const portableRootStats = portableRoot
1410
- ? fs.lstatSync(portableRoot, { throwIfNoEntry: false })
1411
- : null;
1412
- const portableSkillNameSet = new Set(portableRootStats?.isDirectory() && !portableRootStats.isSymbolicLink()
1413
- ? fs.readdirSync(portableRoot, { withFileTypes: true })
1414
- .filter((entry) => entry.isDirectory())
1415
- .map((entry) => entry.name)
1416
- : []);
1417
- return {
1418
- static: staticSkillNameSet,
1419
- dynamic: dynamicSkillNameSet,
1420
- portable: portableSkillNameSet,
1421
- all: new Set([...staticSkillNames, ...dynamicSkillNames]),
1422
- };
820
+ async function collectDeclaredSkillNames(pluginDir, manifest) {
821
+ const root = manifest.skills && path.join(pluginDir, manifest.skills);
822
+ const names = [];
823
+ if (root && fs.existsSync(root)) {
824
+ for (const entry of fs.readdirSync(root, { withFileTypes: true })) {
825
+ if (entry.isDirectory() && !await isAuthorOnlySkillDirectory(path.join(root, entry.name)))
826
+ names.push(entry.name);
827
+ }
828
+ }
829
+ names.sort();
830
+ return { static: new Set(names), dynamic: new Set(), all: new Set(names) };
1423
831
  }
1424
832
  function isNodeRunnablePath(relativePath) {
1425
833
  return SCRIPT_NODE_EXTENSIONS.has(path.posix.extname(normalizeRelativePath(relativePath)));
@@ -1631,6 +1039,14 @@ function scanNodeImportContract(pluginDir, entryPaths, options) {
1631
1039
  continue;
1632
1040
  }
1633
1041
  if (!resolved.path) {
1042
+ const requested = path.posix.normalize(path.posix.join(path.posix.dirname(relativePath), specifier));
1043
+ if (options.nativeToolReader && requested === options.nativeToolReader)
1044
+ continue;
1045
+ if (isInjectedCommandReaderImport(options.injectedCommandReaders, relativePath, requested))
1046
+ continue;
1047
+ if ((options.runtimeConfigSkillRoots ?? []).some((root) => (relativePath.startsWith(`${root}/`)
1048
+ && requested === path.posix.join(root, AW_RUNTIME_CONFIG_READER_PATH))))
1049
+ continue;
1634
1050
  error(`${options.label}: unable to resolve relative import "${specifier}" from "${relativePath}"`);
1635
1051
  continue;
1636
1052
  }
@@ -1680,403 +1096,78 @@ function listFilesRecursive(rootDir) {
1680
1096
  walk(rootDir);
1681
1097
  return output;
1682
1098
  }
1683
- function validateConfigSchemaLightweight(config) {
1099
+ function validateConfigSchemaLightweight(config, manifest) {
1684
1100
  if (config === undefined)
1685
1101
  return;
1686
1102
  try {
1687
- normalizePluginConfigDefinition(config);
1103
+ normalizePluginConfigDefinition(config, 'config', {
1104
+ plugin: manifest.name, dependencies: manifest.dependencies ?? [],
1105
+ });
1688
1106
  }
1689
1107
  catch (validationError) {
1690
1108
  error(validationError instanceof Error ? validationError.message : String(validationError));
1691
1109
  }
1692
1110
  }
1693
- function configSchemaKeys(manifest) {
1694
- const schema = manifest.config?.fields;
1695
- return isRecord(schema) ? new Set(Object.keys(schema)) : new Set();
1696
- }
1697
- function defaultConfigValues(manifest) {
1698
- const schema = manifest.config?.fields;
1111
+ function defaultConfigValues(manifest, platform) {
1112
+ const schema = compilePluginConfigDefinition(manifest.config ?? { fields: {} }, platform).fields;
1699
1113
  const values = {};
1700
1114
  if (!isRecord(schema))
1701
1115
  return values;
1702
1116
  for (const [key, field] of Object.entries(schema)) {
1703
- if (isRecord(field) && Object.prototype.hasOwnProperty.call(field, 'default')) {
1117
+ if (isRecord(field) && field.default !== undefined) {
1704
1118
  values[key] = field.default;
1705
1119
  }
1706
1120
  }
1707
1121
  return values;
1708
1122
  }
1709
- function validateArtifactId(value, fieldName) {
1710
- const id = validateManifestString(value, fieldName);
1711
- if (!id)
1712
- return null;
1713
- if (!/^[A-Za-z][A-Za-z0-9_.-]*$/.test(id)) {
1714
- error(`${fieldName}: expected a stable id using letters, numbers, ".", "_" or "-"`);
1715
- }
1716
- return id;
1717
- }
1718
- function validateCodexRoleKey(value, fieldName) {
1719
- const roleKey = validateManifestString(value, fieldName);
1720
- if (!roleKey)
1721
- return null;
1722
- if (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(roleKey)) {
1723
- error(`${fieldName}: expected a valid Codex role key`);
1724
- }
1725
- return roleKey;
1726
- }
1727
- function validateCodexSkillKey(value, fieldName) {
1728
- const skillKey = validateManifestString(value, fieldName);
1729
- if (!skillKey)
1730
- return null;
1731
- if (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(skillKey)) {
1732
- error(`${fieldName}: expected a valid Codex skill key`);
1733
- }
1734
- return skillKey;
1735
- }
1736
- function validatePortableSkillKey(value, fieldName) {
1737
- const skillKey = validateManifestString(value, fieldName);
1738
- if (!skillKey)
1739
- return null;
1740
- if (skillKey.length > MAX_SKILL_NAME_LEN || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(skillKey)) {
1741
- error(`${fieldName}: expected at most 64 ASCII lowercase hyphen-case characters`);
1742
- }
1743
- return skillKey;
1744
- }
1745
- function validateStringArray(value, fieldName, options = {}) {
1746
- if (!Array.isArray(value)) {
1747
- error(`${fieldName} must be an array`);
1748
- return [];
1749
- }
1750
- const output = [];
1751
- for (const [index, entry] of value.entries()) {
1752
- const itemFieldName = `${fieldName}[${index}]`;
1753
- if (typeof entry !== 'string' || entry.trim() === '') {
1754
- error(`${itemFieldName} must be a non-empty string`);
1755
- continue;
1756
- }
1757
- if (options.allowed && !options.allowed.has(entry)) {
1758
- error(`${itemFieldName}: unsupported ${options.label ?? 'value'} "${entry}"`);
1759
- continue;
1760
- }
1761
- if (!output.includes(entry))
1762
- output.push(entry);
1763
- }
1764
- if (options.requireNonEmpty && output.length === 0) {
1765
- error(`${fieldName} must contain at least one value`);
1766
- }
1767
- return output;
1768
- }
1769
- function validateArtifactTargetEntry(entry, index, manifest, pluginDir) {
1770
- const fieldName = `artifacts.targets[${index}]`;
1771
- const target = expectRecord(entry, fieldName);
1772
- if (!target)
1773
- return null;
1774
- validateAllowedKeys(target, fieldName, [
1775
- 'id',
1776
- 'platform',
1777
- 'distribution',
1778
- 'scopes',
1779
- 'target',
1780
- 'kind',
1781
- 'projectManagedKind',
1782
- 'states',
1783
- 'refreshKeys',
1784
- 'delivery',
1785
- 'requiresCodexProjectConfig',
1786
- 'roleKey',
1787
- 'skillKey',
1788
- 'sourceDirs',
1789
- 'runtimeImports',
1790
- ]);
1791
- const id = validateArtifactId(target.id, `${fieldName}.id`);
1792
- const artifactTarget = validateManifestString(target.target, `${fieldName}.target`);
1793
- if (artifactTarget && !ARTIFACT_TARGETS.has(artifactTarget)) {
1794
- error(`${fieldName}.target: unsupported artifact target "${artifactTarget}"`);
1795
- }
1796
- const portable = artifactTarget === 'agent-skills.skill';
1797
- let delivery;
1798
- if (artifactTarget === 'codex.skill') {
1799
- delivery = expectRecord(target.delivery, `${fieldName}.delivery`);
1800
- if (delivery) {
1801
- if (delivery.mode === 'aw-extension') {
1802
- validateAllowedKeys(delivery, `${fieldName}.delivery`, ['mode']);
1803
- }
1804
- else if (delivery.mode === 'codex-native') {
1805
- validateAllowedKeys(delivery, `${fieldName}.delivery`, ['mode', 'identity', 'renderProfile']);
1806
- if (delivery.identity !== 'shared') {
1807
- error(`${fieldName}.delivery.identity: expected "shared"`);
1808
- }
1809
- if (delivery.renderProfile !== 'user') {
1810
- error(`${fieldName}.delivery.renderProfile: expected "user"`);
1811
- }
1812
- }
1813
- else {
1814
- error(`${fieldName}.delivery.mode: expected "codex-native" or "aw-extension"`);
1815
- }
1816
- }
1817
- }
1818
- else if (target.delivery !== undefined) {
1819
- error(`${fieldName}.delivery: delivery is only supported for codex.skill targets`);
1820
- }
1821
- const platform = portable || target.platform === undefined
1822
- ? undefined
1823
- : validateManifestString(target.platform, `${fieldName}.platform`);
1824
- const distribution = portable || target.distribution !== undefined
1825
- ? validateManifestString(target.distribution, `${fieldName}.distribution`)
1826
- : undefined;
1827
- if (portable) {
1828
- if (distribution !== 'agent-skills') {
1829
- error(`${fieldName}.distribution: expected "agent-skills"`);
1830
- }
1831
- if (target.platform !== undefined) {
1832
- error(`${fieldName}.platform: distribution targets do not support platform`);
1833
- }
1834
- }
1835
- else {
1836
- const expectedPlatform = artifactTarget === 'claude.skill' ? 'claude' : 'codex';
1837
- if (platform && artifactTarget && platform !== expectedPlatform) {
1838
- error(`${fieldName}.platform: target "${artifactTarget}" must use "${expectedPlatform}"`);
1839
- }
1840
- if (target.distribution !== undefined) {
1841
- error(`${fieldName}.distribution: platform targets do not support distribution`);
1842
- }
1843
- }
1844
- const expectedKind = ARTIFACT_KIND_BY_TARGET[artifactTarget];
1845
- const kind = target.kind === undefined
1846
- ? expectedKind
1847
- : validateManifestString(target.kind, `${fieldName}.kind`);
1848
- if (kind && !ARTIFACT_KINDS.has(kind)) {
1849
- error(`${fieldName}.kind: unsupported artifact kind "${kind}"`);
1850
- }
1851
- if (expectedKind && kind && kind !== expectedKind) {
1852
- error(`${fieldName}.kind: target "${artifactTarget}" requires kind "${expectedKind}"`);
1853
- }
1854
- const expectedProjectManagedKind = ARTIFACT_PROJECT_MANAGED_KIND_BY_TARGET[artifactTarget];
1855
- const projectManagedKind = target.projectManagedKind === undefined
1856
- ? expectedProjectManagedKind
1857
- : validateManifestString(target.projectManagedKind, `${fieldName}.projectManagedKind`);
1858
- if (projectManagedKind && !ARTIFACT_PROJECT_MANAGED_KINDS.has(projectManagedKind)) {
1859
- error(`${fieldName}.projectManagedKind: unsupported Codex project managed kind "${projectManagedKind}"`);
1860
- }
1861
- if (expectedProjectManagedKind &&
1862
- projectManagedKind &&
1863
- projectManagedKind !== expectedProjectManagedKind) {
1864
- error(`${fieldName}.projectManagedKind: target "${artifactTarget}" must map to "${expectedProjectManagedKind}"`);
1865
- }
1866
- if (!expectedProjectManagedKind && projectManagedKind) {
1867
- error(`${fieldName}.projectManagedKind: target "${artifactTarget}" does not support projectManagedKind`);
1868
- }
1869
- const scopes = validateStringArray(target.scopes, `${fieldName}.scopes`, {
1870
- allowed: ARTIFACT_SCOPES,
1871
- label: 'artifact scope',
1872
- requireNonEmpty: true,
1873
- });
1874
- const states = validateStringArray(target.states, `${fieldName}.states`, {
1875
- allowed: ARTIFACT_STATES,
1876
- label: 'artifact state',
1877
- requireNonEmpty: true,
1878
- });
1879
- const refreshKeys = validateStringArray(target.refreshKeys, `${fieldName}.refreshKeys`);
1880
- const schemaKeys = configSchemaKeys(manifest);
1881
- for (const [refreshIndex, refreshKey] of refreshKeys.entries()) {
1882
- if (!schemaKeys.has(refreshKey)) {
1883
- error(`${fieldName}.refreshKeys[${refreshIndex}]: unknown config key "${refreshKey}"`);
1123
+ function componentFixtureConfig(manifest, platform, definition, referenceContext) {
1124
+ const values = defaultConfigValues(manifest, platform);
1125
+ const sources = Object.fromEntries(Object.keys(values).map((key) => [key, 'default']));
1126
+ // A required container can be configured without inventing a user choice if
1127
+ // its empty value is valid. This is fixture input, never a manifest default.
1128
+ const emptyContainers = {};
1129
+ for (const [key, field] of Object.entries(definition.fields)) {
1130
+ if (!field.required || Object.hasOwn(values, key))
1884
1131
  continue;
1885
- }
1886
- }
1887
- if (target.requiresCodexProjectConfig !== undefined &&
1888
- typeof target.requiresCodexProjectConfig !== 'boolean') {
1889
- error(`${fieldName}.requiresCodexProjectConfig must be a boolean`);
1890
- }
1891
- if (artifactTarget === 'codex.skill' && target.requiresCodexProjectConfig === true) {
1892
- error(`${fieldName}.requiresCodexProjectConfig: codex.skill writes the skill runtime and must not require Codex project config preflight`);
1893
- }
1894
- if ((platform === 'claude' || portable) && target.requiresCodexProjectConfig !== undefined) {
1895
- error(`${fieldName}.requiresCodexProjectConfig: this target does not support the field`);
1896
- }
1897
- let roleKey;
1898
- let skillKey;
1899
- if (artifactTarget === 'codex.agentRole') {
1900
- roleKey = validateCodexRoleKey(target.roleKey, `${fieldName}.roleKey`);
1901
- if (!roleKey) {
1902
- error(`${fieldName}.roleKey: codex.agentRole targets must declare a static roleKey`);
1903
- }
1904
- }
1905
- else if (target.roleKey !== undefined) {
1906
- error(`${fieldName}.roleKey: roleKey is only supported for codex.agentRole targets`);
1907
- }
1908
- if (artifactTarget === 'codex.skill' || artifactTarget === 'claude.skill' || portable) {
1909
- skillKey = portable
1910
- ? validatePortableSkillKey(target.skillKey, `${fieldName}.skillKey`)
1911
- : validateCodexSkillKey(target.skillKey, `${fieldName}.skillKey`);
1912
- if (!skillKey) {
1913
- error(`${fieldName}.skillKey: ${artifactTarget} targets must declare a static skillKey`);
1914
- }
1915
- }
1916
- else if (target.skillKey !== undefined) {
1917
- error(`${fieldName}.skillKey: skillKey is only supported for skill targets`);
1918
- }
1919
- const normalizedSourceDirs = Array.isArray(target.sourceDirs)
1920
- ? target.sourceDirs
1921
- .filter((sourceDir) => typeof sourceDir === 'string' && sourceDir.trim() !== '')
1922
- .map((sourceDir) => path.posix.normalize(sourceDir))
1923
- : [];
1924
- if (new Set(normalizedSourceDirs).size !== normalizedSourceDirs.length) {
1925
- error(`${fieldName}.sourceDirs must not contain duplicate directories`);
1926
- }
1927
- const sourceDirs = target.sourceDirs === undefined
1928
- ? []
1929
- : validateStringArray(target.sourceDirs, `${fieldName}.sourceDirs`);
1930
- if (sourceDirs.length > 0 && artifactTarget !== 'codex.skill' && artifactTarget !== 'claude.skill' && !portable) {
1931
- error(`${fieldName}.sourceDirs: sourceDirs are only supported for skill targets`);
1932
- }
1933
- for (const [sourceIndex, sourceDir] of sourceDirs.entries()) {
1934
- const sourceField = `${fieldName}.sourceDirs[${sourceIndex}]`;
1935
- if (!sourceDir.startsWith('./') || path.posix.isAbsolute(sourceDir)) {
1936
- error(`${sourceField} must start with "./" and stay inside the plugin root`);
1132
+ if (field.type === 'object')
1133
+ emptyContainers[key] = {};
1134
+ else if (field.type === 'array')
1135
+ emptyContainers[key] = [];
1136
+ }
1137
+ const candidate = { ...values, ...emptyContainers };
1138
+ for (const [key, value] of Object.entries(emptyContainers)) {
1139
+ if (validatePluginConfigCandidate(definition, candidate, [key], referenceContext).length !== 0)
1937
1140
  continue;
1938
- }
1939
- const normalized = path.posix.normalize(sourceDir);
1940
- if (normalized === '.' || normalized === '..' || normalized.startsWith('../')) {
1941
- error(`${sourceField} must stay inside the plugin root`);
1942
- continue;
1943
- }
1944
- const stats = fs.lstatSync(path.join(pluginDir, normalized), { throwIfNoEntry: false });
1945
- if (!stats?.isDirectory() || stats.isSymbolicLink()) {
1946
- error(`${sourceField} must point to an existing directory`);
1947
- }
1948
- if (skillKey && !portable &&
1949
- normalized !== `skills/${skillKey}` &&
1950
- !normalized.startsWith(`skills/${skillKey}/`)) {
1951
- error(`${sourceField} must stay inside "./skills/${skillKey}"`);
1952
- }
1953
- if (skillKey && !portable &&
1954
- isSkillAuthorOnlyPath(path.posix.relative(`skills/${skillKey}`, normalized))) {
1955
- error(`${sourceField} must not point inside an author-only Skill directory`);
1956
- }
1957
- }
1958
- if (skillKey && !portable &&
1959
- sourceDirs.length > 0 &&
1960
- !normalizedSourceDirs.includes(`skills/${skillKey}`)) {
1961
- error(`${fieldName}.sourceDirs must include "./skills/${skillKey}" so README.md is published`);
1141
+ values[key] = value;
1142
+ sources[key] = definition.fields[key].platformOnly ? 'platform' : 'common';
1962
1143
  }
1963
- return {
1964
- id,
1965
- platform,
1966
- distribution,
1967
- scopes,
1968
- target: artifactTarget,
1969
- kind,
1970
- projectManagedKind,
1971
- states,
1972
- refreshKeys,
1973
- delivery,
1974
- roleKey,
1975
- skillKey,
1976
- sourceDirs,
1977
- runtimeImports: Array.isArray(target.runtimeImports) ? target.runtimeImports : [],
1978
- };
1144
+ return { values, sources };
1979
1145
  }
1980
- function validateArtifactsConfigLightweight(pluginDir, manifest) {
1981
- if (manifest.artifacts === undefined)
1982
- return [];
1983
- const artifacts = expectRecord(manifest.artifacts, 'artifacts');
1984
- if (!artifacts)
1985
- return [];
1986
- validateAllowedKeys(artifacts, 'artifacts', ['targets']);
1987
- if (artifacts.targets === undefined)
1988
- return [];
1989
- if (!Array.isArray(artifacts.targets)) {
1990
- error('artifacts.targets must be an array');
1991
- return [];
1992
- }
1993
- const declarations = artifacts.targets
1994
- .map((entry, index) => validateArtifactTargetEntry(entry, index, manifest, pluginDir))
1995
- .filter(Boolean);
1996
- const idsBySurfaceScope = new Map();
1997
- const nativeIds = new Map();
1998
- const nativeSkillKeys = new Map();
1999
- for (const [declarationIndex, declaration] of declarations.entries()) {
2000
- for (const scope of declaration.scopes) {
2001
- const surface = declaration.platform ?? declaration.distribution;
2002
- const key = `${surface}:${scope}:${declaration.id}`;
2003
- const existing = idsBySurfaceScope.get(key);
2004
- if (existing !== undefined) {
2005
- error(`artifacts.targets has duplicate artifact id "${declaration.id}" for surface/scope "${surface}:${scope}" in targets[${existing}] and targets[${declarationIndex}]`);
2006
- }
2007
- else {
2008
- idsBySurfaceScope.set(key, declarationIndex);
2009
- }
2010
- }
2011
- if (declaration.delivery?.mode === 'codex-native') {
2012
- const existingId = nativeIds.get(declaration.id);
2013
- if (existingId !== undefined) {
2014
- error(`artifacts.targets has duplicate codex-native artifact id "${declaration.id}" in the shared projection at targets[${existingId}] and targets[${declarationIndex}]`);
2015
- }
2016
- else {
2017
- nativeIds.set(declaration.id, declarationIndex);
2018
- }
2019
- const existingSkillKey = nativeSkillKeys.get(declaration.skillKey);
2020
- if (existingSkillKey !== undefined) {
2021
- error(`artifacts.targets has duplicate codex-native skillKey "${declaration.skillKey}" in the shared projection at targets[${existingSkillKey}] and targets[${declarationIndex}]`);
2022
- }
2023
- else {
2024
- nativeSkillKeys.set(declaration.skillKey, declarationIndex);
2025
- }
2026
- }
2027
- }
2028
- const staticSkillNames = new Set(collectDeclaredSkillNames(pluginDir, manifest).static);
2029
- for (const [index, declaration] of declarations.entries()) {
2030
- if (declaration.target === 'codex.skill'
2031
- && declaration.delivery?.mode === 'codex-native'
2032
- && staticSkillNames.has(declaration.skillKey)) {
2033
- error(`artifacts.targets[${index}].skillKey: native dynamic Skill "${declaration.skillKey}" conflicts with a static Skill of the same name`);
2034
- }
2035
- }
2036
- const owners = new Map();
2037
- for (const declaration of declarations) {
2038
- if ((declaration.target !== 'codex.skill' && declaration.target !== 'claude.skill' && declaration.target !== 'agent-skills.skill') ||
2039
- !declaration.skillKey) {
2040
- continue;
2041
- }
2042
- for (const scope of declaration.scopes) {
2043
- const ownerKey = `${declaration.platform ?? declaration.distribution}:${scope}:${declaration.skillKey}`;
2044
- const existing = owners.get(ownerKey);
2045
- if (existing) {
2046
- error(`artifacts.targets has duplicate skill ownership "${ownerKey}" in artifacts "${existing}" and "${declaration.id}"`);
2047
- }
2048
- else {
2049
- owners.set(ownerKey, declaration.id);
2050
- }
2051
- }
2052
- }
2053
- return declarations;
2054
- }
2055
- function validateArtifactPlanRefreshKeys(refreshKeys, declaration, fieldName) {
2056
- const keys = validateStringArray(refreshKeys, `${fieldName}.refreshKeys`);
2057
- for (const [index, key] of keys.entries()) {
2058
- if (!declaration.refreshKeys.includes(key)) {
2059
- error(`${fieldName}.refreshKeys[${index}]: "${key}" is not declared for artifact "${declaration.id}"`);
2060
- }
2061
- }
2062
- for (const declaredKey of declaration.refreshKeys) {
2063
- if (!keys.includes(declaredKey)) {
2064
- error(`${fieldName}: artifact "${declaration.id}" must preserve declared refresh key "${declaredKey}"`);
2065
- }
2066
- }
1146
+ function hasCrossPluginValueRef(value) {
1147
+ if (!isRecord(value))
1148
+ return false;
1149
+ if (isRecord(value.valueRef) && value.valueRef.plugin !== undefined)
1150
+ return true;
1151
+ return Object.values(value).some((child) => Array.isArray(child)
1152
+ ? child.some(hasCrossPluginValueRef) : hasCrossPluginValueRef(child));
2067
1153
  }
2068
- function isValidArtifactFilePath(relativePath) {
2069
- return (relativePath.trim() !== '' &&
2070
- !relativePath.includes('\\') &&
2071
- !relativePath.startsWith('/') &&
2072
- path.posix.normalize(relativePath) === relativePath &&
2073
- !relativePath.split('/').some((segment) => segment === '' || segment === '.' || segment === '..'));
1154
+ function configFieldContainsSensitiveValue(field) {
1155
+ if (!isRecord(field))
1156
+ return false;
1157
+ if (field.sensitive === true)
1158
+ return true;
1159
+ if (field.type !== 'object')
1160
+ return false;
1161
+ return ((isRecord(field.properties)
1162
+ && Object.values(field.properties).some((child) => isRecord(child) && child.sensitive === true))
1163
+ || (isRecord(field.additionalProperties)
1164
+ && field.additionalProperties.sensitive === true));
2074
1165
  }
2075
1166
  function isSkillAuthorOnlyPath(relativePath) {
2076
1167
  const [topLevel] = relativePath.split('/').filter(Boolean);
2077
1168
  return topLevel === 'evals' || topLevel === 'reports';
2078
1169
  }
2079
- function collectArtifactSourceFiles(rootDir, fieldName, files) {
1170
+ function collectArtifactSourceFiles(rootDir, fieldName, files, transform = (_relative, bytes) => bytes) {
2080
1171
  const rootStats = fs.lstatSync(rootDir, { throwIfNoEntry: false });
2081
1172
  if (!rootStats?.isDirectory() || rootStats.isSymbolicLink())
2082
1173
  return;
@@ -2100,39 +1191,21 @@ function collectArtifactSourceFiles(rootDir, fieldName, files) {
2100
1191
  error(`${fieldName} contains unsupported non-regular file "${relativePath}"`);
2101
1192
  continue;
2102
1193
  }
2103
- files.set(relativePath, fs.readFileSync(absolutePath));
1194
+ files.set(relativePath, transform(relativePath, fs.readFileSync(absolutePath)));
2104
1195
  }
2105
1196
  };
2106
1197
  visit(rootDir, '');
2107
1198
  }
2108
- function findArtifactFilePrefixConflict(files) {
2109
- const paths = [...files.keys()].sort();
2110
- for (const [index, relativePath] of paths.entries()) {
2111
- const prefix = paths.slice(0, index).find((candidate) => relativePath.startsWith(`${candidate}/`));
2112
- if (prefix)
2113
- return [prefix, relativePath];
2114
- }
2115
- return null;
2116
- }
2117
- function authorRuntimeImportKey(artifactId, importIndex) {
2118
- return `${artifactId}\0${importIndex}`;
2119
- }
2120
1199
  async function resolveAuthorRuntimeImports(options) {
2121
- const artifactImports = (options.manifest.artifacts?.targets ?? []).flatMap((target) => (target.runtimeImports ?? []).map((reference, importIndex) => ({
2122
- key: authorRuntimeImportKey(target.id, importIndex),
2123
- label: `artifacts target ${JSON.stringify(target.id)} runtime import ${JSON.stringify(reference.name)}`,
2124
- purpose: 'artifact-runtime',
2125
- reference,
2126
- })));
1200
+ const artifactImports = (options.manifest.artifacts?.runtimeImports ?? []).map((reference) => ({
1201
+ key: reference.name,
1202
+ label: `artifacts.runtimeImports ${JSON.stringify(reference.name)}`,
1203
+ purpose: 'artifact-runtime', platforms: [...resolveSupportedPlatforms(options.manifest)], reference,
1204
+ }));
2127
1205
  const skillRuntimeImports = (options.manifest.buildConfig?.skillRuntimeFiles ?? []).flatMap((entry, importIndex) => {
2128
1206
  if (!isRecord(entry.import))
2129
1207
  return [];
2130
- const platforms = [
2131
- ...(entry.platforms !== undefined || entry.distributions === undefined
2132
- ? (entry.platforms ?? [...resolveSupportedPlatforms(options.manifest)])
2133
- : []),
2134
- ...(entry.distributions?.includes('agent-skills') ? [undefined] : []),
2135
- ];
1208
+ const platforms = entry.platforms?.length ? entry.platforms : [...resolveSupportedPlatforms(options.manifest)];
2136
1209
  return platforms.length > 0 ? [{
2137
1210
  key: importIndex,
2138
1211
  label: `buildConfig.skillRuntimeFiles[${importIndex}].import`,
@@ -2149,25 +1222,28 @@ async function resolveAuthorRuntimeImports(options) {
2149
1222
  || typeof options.cliManifestTools?.readPluginManifest !== 'function'
2150
1223
  || typeof options.cliManifestTools?.discoverPlugins !== 'function'
2151
1224
  || typeof options.cliManifestTools?.createRuntimeResolver !== 'function') {
2152
- error('Portable runtime imports require a complete built CLI and canonical same-source Git workspace.');
1225
+ error('Runtime imports require a complete built CLI and canonical same-source Git workspace.');
2153
1226
  return null;
2154
1227
  }
2155
1228
  let consumer;
2156
1229
  let resolver;
1230
+ let referencePlugins;
2157
1231
  try {
2158
1232
  const sourceSet = await options.cliManifestTools.discoverPlugins(options.repoRoot);
2159
1233
  consumer = await options.cliManifestTools.readPluginManifest(options.pluginDir);
2160
1234
  if (!sourceSet.some((candidate) => candidate.manifest.name === consumer.manifest.name)) {
2161
1235
  sourceSet.push(consumer);
2162
1236
  }
1237
+ referencePlugins = sourceSet;
2163
1238
  resolver = options.cliManifestTools.createRuntimeResolver(sourceSet);
2164
1239
  }
2165
1240
  catch {
2166
- error('Portable runtime imports could not load the canonical same-source plugin set.');
1241
+ error('Runtime imports could not load the canonical same-source plugin set.');
2167
1242
  return null;
2168
1243
  }
2169
1244
  const resolvedArtifacts = new Map();
2170
1245
  const resolvedSkillRuntimeFiles = new Map();
1246
+ let unresolved = false;
2171
1247
  for (const request of requested) {
2172
1248
  let value;
2173
1249
  try {
@@ -2189,6 +1265,9 @@ async function resolveAuthorRuntimeImports(options) {
2189
1265
  providerVersion: resolution.providerVersion,
2190
1266
  exportName: resolution.name,
2191
1267
  source: resolution.source,
1268
+ requiredCapabilities: resolution.requiredCapabilities,
1269
+ capabilitySetDigest: resolution.capabilitySetDigest,
1270
+ mode: fs.statSync(resolution.sourcePath).mode & 0o111 ? 0o755 : 0o644,
2192
1271
  };
2193
1272
  if (value && (value.digest !== current.digest
2194
1273
  || value.providerPluginId !== current.providerPluginId
@@ -2208,6 +1287,7 @@ async function resolveAuthorRuntimeImports(options) {
2208
1287
  ? JSON.stringify(request.reference.export)
2209
1288
  : '<invalid-export>';
2210
1289
  error(`Cannot resolve ${request.label} from provider ${provider} export ${exportName}.`);
1290
+ unresolved = true;
2211
1291
  continue;
2212
1292
  }
2213
1293
  if (request.purpose === 'artifact-runtime')
@@ -2215,15 +1295,16 @@ async function resolveAuthorRuntimeImports(options) {
2215
1295
  else
2216
1296
  resolvedSkillRuntimeFiles.set(request.key, value);
2217
1297
  }
2218
- return {
1298
+ return unresolved ? null : {
2219
1299
  artifactImports: resolvedArtifacts,
2220
1300
  skillRuntimeImports: resolvedSkillRuntimeFiles,
1301
+ referencePlugins,
2221
1302
  };
2222
1303
  }
2223
- function overlayPortableRuntimeFiles(files, manifest, pluginDir, skillKey, runtimeImports) {
1304
+ function overlayPortableRuntimeFiles(files, manifest, pluginDir, skillKey, runtimeImports, platform) {
2224
1305
  for (const [runtimeIndex, runtimeFile] of (manifest.buildConfig?.skillRuntimeFiles ?? []).entries()) {
2225
1306
  if (runtimeFile.skill !== skillKey
2226
- || !runtimeFile.distributions?.includes('agent-skills'))
1307
+ || (runtimeFile.platforms?.length && !runtimeFile.platforms.includes(platform)))
2227
1308
  continue;
2228
1309
  if (typeof runtimeFile.source === 'string') {
2229
1310
  const sourcePath = path.join(pluginDir, normalizeRelativePath(runtimeFile.source));
@@ -2245,439 +1326,192 @@ function overlayPortableRuntimeFiles(files, manifest, pluginDir, skillKey, runti
2245
1326
  }
2246
1327
  }
2247
1328
  }
2248
- function validateRenderedSkillTree(options) {
2249
- const { entry, declaration, fieldName, pluginDir, manifest, materializedRoot, skillValidationTools, } = options;
2250
- if (entry.state !== 'present' || !isRecord(entry.content) || !isRecord(entry.content.files)) {
2251
- return;
2252
- }
2253
- const files = new Map();
2254
- declaration.sourceDirs.forEach((sourceDir, index) => {
2255
- collectArtifactSourceFiles(path.join(pluginDir, normalizeRelativePath(sourceDir)), `artifacts.targets sourceDirs[${index}] for artifact "${declaration.id}"`, files);
2256
- });
2257
- if (declaration.target === 'agent-skills.skill') {
2258
- overlayPortableRuntimeFiles(files, manifest, pluginDir, declaration.skillKey, options.runtimeImports);
2259
- }
2260
- for (const [relativePath, content] of Object.entries(entry.content.files)) {
2261
- if (isSkillAuthorOnlyPath(relativePath)) {
2262
- error(`${fieldName}.content.files path "${relativePath}" uses an author-only Skill directory`);
1329
+ async function prepareSourceComponentFixture(root, pluginDir, manifest, runtimeImports, tools) {
1330
+ const packageRoot = manifest.scripts?.node?.packageRoot;
1331
+ if (packageRoot) {
1332
+ const installedModules = path.join(pluginDir, packageRoot, 'node_modules');
1333
+ if (fs.statSync(installedModules, { throwIfNoEntry: false })?.isDirectory()) {
1334
+ const destination = path.join(root, packageRoot, 'node_modules');
1335
+ fs.mkdirSync(path.dirname(destination), { recursive: true });
1336
+ // Source validation uses already installed declared dependencies. It does
1337
+ // not install packages or publish this temporary dependency link.
1338
+ fs.symlinkSync(installedModules, destination, 'junction');
1339
+ }
1340
+ }
1341
+ const fixtureManifest = structuredClone(manifest);
1342
+ for (const reference of fixtureManifest.artifacts?.runtimeImports ?? []) {
1343
+ const input = runtimeImports?.artifactImports.get(reference.name);
1344
+ if (!input)
1345
+ throw new Error(`Unresolved runtime input: ${reference.name}`);
1346
+ const relative = `./.agents-plugin/runtime-imports/${reference.name}`;
1347
+ const destination = path.join(root, relative);
1348
+ fs.mkdirSync(path.dirname(destination), { recursive: true });
1349
+ fs.writeFileSync(destination, input.bytes, { mode: input.mode });
1350
+ reference.resolved = { path: relative, digest: input.digest, providerPluginId: input.providerPluginId,
1351
+ providerVersion: input.providerVersion, source: input.source, requiredCapabilities: input.requiredCapabilities,
1352
+ capabilitySetDigest: input.capabilitySetDigest };
1353
+ }
1354
+ if (manifest.nativeTools) {
1355
+ const reader = path.join(root, normalizeRelativePath(manifest.nativeTools.reader ?? './.aw/native-tool-reader.mjs'));
1356
+ fs.mkdirSync(path.dirname(reader), { recursive: true });
1357
+ fs.writeFileSync(reader, createNativeToolReaderSource());
1358
+ }
1359
+ // Apply the declared static source projection before the shared normalizer reads it.
1360
+ for (const platform of resolveSupportedPlatforms(manifest)) {
1361
+ if (manifest.mcpServers) {
1362
+ const relative = normalizeRelativePath(manifest.mcpServers);
1363
+ const input = fs.readFileSync(path.join(pluginDir, relative), 'utf8');
1364
+ const output = path.join(root, platform, relative);
1365
+ fs.mkdirSync(path.dirname(output), { recursive: true });
1366
+ fs.writeFileSync(output, renderTemplateForPlatform(manifest, relative, input, platform));
1367
+ }
1368
+ const sourceRoot = manifest.skills && path.join(pluginDir, manifest.skills);
1369
+ if (!sourceRoot || !fs.existsSync(sourceRoot))
2263
1370
  continue;
2264
- }
2265
- if (isValidArtifactFilePath(relativePath) && typeof content === 'string') {
2266
- files.set(relativePath, Buffer.from(content, 'utf8'));
2267
- }
2268
- }
2269
- const conflict = findArtifactFilePrefixConflict(files);
2270
- if (conflict) {
2271
- error(`${fieldName} final file tree path "${conflict[0]}" conflicts with "${conflict[1]}"`);
2272
- return;
2273
- }
2274
- const skillFile = files.get('SKILL.md');
2275
- if (!skillFile || skillFile.toString('utf8').trim() === '') {
2276
- error(`${fieldName} final file tree must contain a non-empty SKILL.md`);
2277
- }
2278
- else if (!skillValidationTools) {
2279
- error(`${fieldName} final SKILL.md cannot be validated because the shared CLI Skill validator is unavailable`);
2280
- }
2281
- else {
2282
- const sourcePath = `${fieldName} final SKILL.md`;
2283
- const parsed = skillValidationTools.parseSkillFrontmatter(skillFile.toString('utf8'), sourcePath);
2284
- for (const diagnostic of parsed.errors) {
2285
- error(`${diagnostic.path} [${diagnostic.code}] ${diagnostic.message}`);
2286
- }
2287
- if (parsed.frontmatter) {
2288
- const diagnostics = skillValidationTools.validateSkillFrontmatter(parsed.frontmatter, {
2289
- profile: declaration.platform === 'claude' ? 'claude-2.1.88' : 'portable-agent-skills',
2290
- expectedName: declaration.skillKey,
2291
- sourcePath,
2292
- });
2293
- for (const diagnostic of diagnostics) {
2294
- error(`${diagnostic.path} [${diagnostic.code}] ${diagnostic.message}`);
2295
- }
2296
- }
2297
- }
2298
- const readme = files.get('README.md');
2299
- if (!readme || readme.toString('utf8').trim() === '') {
2300
- error(`${fieldName} final file tree must contain a non-empty README.md`);
2301
- }
2302
- const sensitiveValues = Object.entries(manifest.config?.fields ?? {})
2303
- .filter(([, field]) => isRecord(field) && field.sensitive === true)
2304
- .map(([key, field]) => Object.prototype.hasOwnProperty.call(field, 'default')
2305
- ? String(field.default)
2306
- : String(defaultConfigValues(manifest)[key] ?? ''))
2307
- .filter(Boolean);
2308
- for (const [relativePath, content] of files) {
2309
- const text = content.toString('utf8');
2310
- if (/\{\{[^{}]+\}\}/u.test(text)) {
2311
- error(`${fieldName} final file tree contains an unresolved template in "${relativePath}"`);
2312
- }
2313
- if (sensitiveValues.some((value) => text.includes(value))) {
2314
- error(`${fieldName} final file tree exposes sensitive config in "${relativePath}"`);
2315
- }
2316
- }
2317
- if (declaration.target === 'codex.skill') {
2318
- const openAiYaml = files.get('agents/openai.yaml');
2319
- if (!openAiYaml || openAiYaml.toString('utf8').trim() === '') {
2320
- error(`${fieldName} final file tree must contain a non-empty agents/openai.yaml`);
2321
- }
2322
- }
2323
- fs.rmSync(materializedRoot, { recursive: true, force: true });
2324
- for (const [relativePath, content] of files) {
2325
- const targetPath = path.join(materializedRoot, ...relativePath.split('/'));
2326
- fs.mkdirSync(path.dirname(targetPath), { recursive: true });
2327
- fs.writeFileSync(targetPath, content);
2328
- }
2329
- if (declaration.target === 'codex.skill' && files.has('agents/openai.yaml')) {
2330
- validateOpenAiYaml(path.join(materializedRoot, 'agents', 'openai.yaml'), declaration.skillKey, true, manifest, materializedRoot, skillValidationTools);
2331
- }
2332
- }
2333
- function validateStaticPortableFinalTrees(pluginDir, manifest, runtimeImports, skillValidationTools) {
2334
- const portableRoot = manifest.distributions?.agentSkills?.skills;
2335
- if (typeof portableRoot !== 'string')
2336
- return;
2337
- const rootDir = path.join(pluginDir, normalizeRelativePath(portableRoot));
2338
- const rootStats = fs.lstatSync(rootDir, { throwIfNoEntry: false });
2339
- if (!rootStats?.isDirectory() || rootStats.isSymbolicLink())
2340
- return;
2341
- const dynamicKeys = new Set((manifest.artifacts?.targets ?? [])
2342
- .filter((target) => target.target === 'agent-skills.skill' && typeof target.skillKey === 'string')
2343
- .map((target) => target.skillKey));
2344
- const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'aw-static-portable-final-'));
2345
- try {
2346
- for (const entry of fs.readdirSync(rootDir, { withFileTypes: true })) {
2347
- if (!entry.isDirectory() || dynamicKeys.has(entry.name))
1371
+ for (const entry of fs.readdirSync(sourceRoot, { withFileTypes: true })) {
1372
+ if (!entry.isDirectory() || await isAuthorOnlySkillDirectory(path.join(sourceRoot, entry.name)))
2348
1373
  continue;
2349
- validateRenderedSkillTree({
2350
- entry: { state: 'present', content: { files: {} } },
2351
- declaration: {
2352
- id: `static:${entry.name}`,
2353
- distribution: 'agent-skills',
2354
- target: 'agent-skills.skill',
2355
- skillKey: entry.name,
2356
- sourceDirs: [`${portableRoot}/${entry.name}`],
2357
- },
2358
- fieldName: `static portable Skill "${entry.name}"`,
2359
- pluginDir,
2360
- manifest,
2361
- runtimeImports,
2362
- materializedRoot: path.join(tempRoot, entry.name),
2363
- skillValidationTools,
2364
- });
1374
+ const files = new Map();
1375
+ collectArtifactSourceFiles(path.join(sourceRoot, entry.name), `static Skill ${entry.name}`, files, (relative, bytes) => isTemplateTextFile(relative)
1376
+ ? Buffer.from(renderTemplateForPlatform(manifest, `${normalizeRelativePath(manifest.skills)}/${entry.name}/${relative}`, bytes.toString('utf8'), platform)) : bytes);
1377
+ overlayPortableRuntimeFiles(files, manifest, pluginDir, entry.name, runtimeImports, platform);
1378
+ for (const [relative, bytes] of files) {
1379
+ const output = path.join(root, platform, 'skills', entry.name, relative);
1380
+ fs.mkdirSync(path.dirname(output), { recursive: true });
1381
+ const original = path.join(sourceRoot, entry.name, relative);
1382
+ const projection = (manifest.buildConfig?.skillRuntimeFiles ?? []).find((file) => file.skill === entry.name && file.target === relative && (!file.platforms?.length || file.platforms.includes(platform)));
1383
+ const mode = projection?.source ? fs.statSync(path.join(pluginDir, projection.source)).mode
1384
+ : fs.existsSync(original) ? fs.statSync(original).mode : 0o644;
1385
+ fs.writeFileSync(output, bytes, { mode: mode & 0o111 ? 0o755 : 0o644 });
1386
+ }
1387
+ }
1388
+ }
1389
+ for (const platform of resolveSupportedPlatforms(manifest)) {
1390
+ const skillsRoot = path.join(root, platform, 'skills');
1391
+ if (!fs.existsSync(skillsRoot))
1392
+ continue;
1393
+ for (const entry of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
1394
+ if (!entry.isDirectory())
1395
+ continue;
1396
+ const generated = (manifest.buildConfig?.generatedSkillRuntimeFiles ?? [])
1397
+ .filter((file) => file.skill === entry.name && (!file.platforms?.length || file.platforms.includes(platform)))
1398
+ .map((file) => file.target);
1399
+ await tools.validateRuntimeSkillClosure(path.join(skillsRoot, entry.name), { declaredGeneratedFiles: new Set(generated) });
2365
1400
  }
2366
1401
  }
2367
- finally {
2368
- fs.rmSync(tempRoot, { recursive: true, force: true });
2369
- }
1402
+ const manifestPath = path.join(root, '.agents-plugin', 'plugin.json');
1403
+ fs.writeFileSync(manifestPath, JSON.stringify(fixtureManifest));
1404
+ return { rootDir: root, manifestPath, manifest: fixtureManifest };
2370
1405
  }
2371
- function validateRenderedArtifactPlan(plan, declarations, scopeLabel, options) {
2372
- const planField = `scripts.artifacts.render fixture (${scopeLabel})`;
2373
- const root = expectRecord(plan, planField);
2374
- if (!root)
1406
+ async function validateAuthorComponentFixtures(pluginDir, sourceManifest, runtimeImports, tools, referenceContext, referencePlugins, skillValidationTools, validationOptions) {
1407
+ const builtBundle = validationOptions.builtBundle;
1408
+ if (!builtBundle && !sourceManifest.skills && !sourceManifest.artifacts && !sourceManifest.command)
2375
1409
  return;
2376
- validateAllowedKeys(root, planField, ['version', 'artifacts']);
2377
- if (root.version !== 2) {
2378
- error(`${planField}.version must be 2`);
2379
- }
2380
- if (!Array.isArray(root.artifacts)) {
2381
- error(`${planField}.artifacts must be an array`);
1410
+ if (runtimeImports === null)
2382
1411
  return;
2383
- }
2384
- const byKey = new Map(declarations.map((target) => [`${target.id}:${target.target}`, target]));
2385
- const returned = new Set();
2386
- root.artifacts.forEach((artifact, index) => {
2387
- const fieldName = `${planField}.artifacts[${index}]`;
2388
- const entry = expectRecord(artifact, fieldName);
2389
- if (!entry)
2390
- return;
2391
- validateAllowedKeys(entry, fieldName, [
2392
- 'id',
2393
- 'platform',
2394
- 'distribution',
2395
- 'target',
2396
- 'kind',
2397
- 'state',
2398
- 'refreshKeys',
2399
- 'disabledReason',
2400
- 'roleKey',
2401
- 'skillKey',
2402
- 'content',
2403
- ]);
2404
- const id = validateArtifactId(entry.id, `${fieldName}.id`);
2405
- const target = validateManifestString(entry.target, `${fieldName}.target`);
2406
- const key = id && target ? `${id}:${target}` : null;
2407
- const declaration = key ? byKey.get(key) : null;
2408
- if (!declaration) {
2409
- error(`${fieldName}: artifact "${key ?? '<unknown>'}" is not declared for ${scopeLabel}`);
2410
- return;
2411
- }
2412
- if (returned.has(key)) {
2413
- error(`${fieldName}: duplicate artifact id + target "${key}"`);
2414
- }
2415
- returned.add(key);
2416
- if (declaration.distribution) {
2417
- if (entry.distribution !== declaration.distribution) {
2418
- error(`${fieldName}.distribution: expected "${declaration.distribution}"`);
2419
- }
2420
- if (entry.platform !== undefined) {
2421
- error(`${fieldName}.platform: distribution artifacts do not support platform`);
2422
- }
2423
- }
2424
- else if (entry.platform !== declaration.platform) {
2425
- error(`${fieldName}.platform: expected "${declaration.platform}"`);
2426
- }
2427
- if (entry.kind !== declaration.kind) {
2428
- error(`${fieldName}.kind: expected "${declaration.kind}"`);
2429
- }
2430
- if (!declaration.states.includes(entry.state)) {
2431
- error(`${fieldName}.state: "${entry.state}" is not declared for artifact "${declaration.id}"`);
2432
- }
2433
- validateArtifactPlanRefreshKeys(entry.refreshKeys, declaration, fieldName);
2434
- if (entry.state === 'present' && entry.content === undefined) {
2435
- error(`${fieldName}.content is required when state is "present"`);
2436
- }
2437
- if (entry.disabledReason !== undefined &&
2438
- (typeof entry.disabledReason !== 'string' || entry.disabledReason.trim() === '')) {
2439
- error(`${fieldName}.disabledReason must be a non-empty string`);
2440
- }
2441
- if (declaration.target === 'codex.agentRole') {
2442
- if (entry.roleKey !== declaration.roleKey) {
2443
- error(`${fieldName}.roleKey: expected "${declaration.roleKey}" from static metadata`);
2444
- }
2445
- if (isRecord(entry.content)) {
2446
- const registration = entry.content.registration;
2447
- if (isRecord(registration) && registration.config_file !== undefined) {
2448
- error(`${fieldName}.content.registration.config_file must be generated by AW, not renderer`);
2449
- }
2450
- const roleFile = entry.content.roleFile;
2451
- if (isRecord(roleFile) && roleFile.name !== declaration.roleKey) {
2452
- error(`${fieldName}.content.roleFile.name: expected "${declaration.roleKey}"`);
2453
- }
2454
- }
1412
+ const tempRoot = fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), 'aw-author-components-'));
1413
+ let commandPackage;
1414
+ try {
1415
+ const root = path.join(tempRoot, 'plugin');
1416
+ if (builtBundle) {
1417
+ // Preserve the renderer's shipped dependencies without exposing the publication snapshot to writes.
1418
+ fs.cpSync(builtBundle, root, { recursive: true });
2455
1419
  }
2456
- else if (entry.roleKey !== undefined) {
2457
- error(`${fieldName}.roleKey is only supported for codex.agentRole artifacts`);
1420
+ else {
1421
+ fs.cpSync(pluginDir, root, {
1422
+ recursive: true, filter: (source) => !['.git', 'node_modules'].includes(path.basename(source)),
1423
+ });
2458
1424
  }
2459
- if (declaration.target === 'codex.skill' || declaration.target === 'claude.skill' || declaration.target === 'agent-skills.skill') {
2460
- if (entry.skillKey !== declaration.skillKey) {
2461
- error(`${fieldName}.skillKey: expected "${declaration.skillKey}" from static metadata`);
2462
- }
2463
- if (entry.state === 'present') {
2464
- if (!isRecord(entry.content)) {
2465
- error(`${fieldName}.content must be an object for dynamic skill artifacts`);
2466
- }
2467
- else {
2468
- validateAllowedKeys(entry.content, `${fieldName}.content`, ['files']);
2469
- const files = expectRecord(entry.content.files, `${fieldName}.content.files`);
2470
- if (files) {
2471
- const filePaths = Object.keys(files).sort();
2472
- for (const [relativePath, content] of Object.entries(files)) {
2473
- if (!isValidArtifactFilePath(relativePath)) {
2474
- error(`${fieldName}.content.files path "${relativePath}" must be a normalized POSIX relative path`);
2475
- }
2476
- if (typeof content !== 'string') {
2477
- error(`${fieldName}.content.files.${relativePath} must be a string`);
2478
- }
1425
+ const fixture = builtBundle
1426
+ ? await tools.readPluginManifest(root, { mode: 'bundle' })
1427
+ : await prepareSourceComponentFixture(root, pluginDir, sourceManifest, runtimeImports, tools);
1428
+ const { manifest } = fixture;
1429
+ if (manifest.name !== sourceManifest.name)
1430
+ throw new Error('Built bundle plugin does not match the source plugin.');
1431
+ const plugin = { ...fixture, sourceId: 'authoring',
1432
+ sourceIdentity: `sha256:${createHash('sha256').update(fs.realpathSync(pluginDir)).digest('hex')}` };
1433
+ const plugins = [plugin, ...(referencePlugins ?? runtimeImports?.referencePlugins ?? []).filter((entry) => entry.manifest.name !== manifest.name)];
1434
+ const env = await tools.createIsolatedSkillEnv(process.env, path.join(tempRoot, 'state'));
1435
+ if (manifest.command) {
1436
+ commandPackage = await tools.prepareManagedCommandPackage({ plugin, referencePlugins: plugins,
1437
+ operation: { kind: 'materialize' }, cwd: pluginDir, env });
1438
+ }
1439
+ for (const platform of resolveSupportedPlatforms(manifest)) {
1440
+ for (const scope of ['user', 'project']) {
1441
+ const definition = compilePluginConfigDefinition(manifest.config ?? { fields: {} }, platform);
1442
+ const references = referenceContext ? { ...referenceContext, platform, plugins: Object.fromEntries(Object.entries(referenceContext.plugins).map(([name, entry]) => [name, { ...entry,
1443
+ definition: compilePluginConfigDefinition(entry.definition, platform),
1444
+ values: defaultConfigValues({ config: entry.definition }, platform) }])) } : undefined;
1445
+ const { values, sources } = componentFixtureConfig(manifest, platform, definition, references);
1446
+ const config = { mode: 'artifact-render', targetScope: scope, definition, schema: definition.fields, values,
1447
+ sources, issues: [], stores: {}, referenceContext: references };
1448
+ try {
1449
+ // Both scopes use the same isolated fixture inputs. Preserve their Workspace
1450
+ // reference context when Codex renders the shared User package.
1451
+ const prepared = await tools.materializeProfilePluginComponents({ plugin, plugins, platform, scope,
1452
+ cwd: pluginDir, env, outputRoot: path.join(tempRoot, `${platform}-${scope}`), config,
1453
+ userConfig: { ...config, targetScope: 'user' },
1454
+ commandRecord: manifest.command?.platforms.includes(platform) ? commandPackage?.record : null });
1455
+ if (prepared.skills.length && !skillValidationTools)
1456
+ throw new Error('Prepared Skills require the shared CLI Skill validator.');
1457
+ for (const skill of prepared.skills) {
1458
+ // These directories retain the component's logical name. Native host
1459
+ // namespacing belongs to the separate platform projection.
1460
+ const sourceName = `component ${skill.id} (${platform}/${scope}) SKILL.md`;
1461
+ const parsed = skillValidationTools.parseSkillFrontmatter(fs.readFileSync(path.join(skill.path, 'SKILL.md'), 'utf8'), sourceName);
1462
+ for (const entry of parsed.errors)
1463
+ error(`${entry.path} [${entry.code}] ${entry.message}`);
1464
+ if (parsed.frontmatter) {
1465
+ for (const entry of skillValidationTools.validateSkillFrontmatter(parsed.frontmatter, {
1466
+ profile: selectSkillFrontmatterProfile(validationOptions, platform), expectedName: skill.name, sourcePath: sourceName,
1467
+ }))
1468
+ error(`${entry.path} [${entry.code}] ${entry.message}`);
2479
1469
  }
2480
- for (const [pathIndex, relativePath] of filePaths.entries()) {
2481
- const conflict = filePaths.slice(0, pathIndex).find((candidate) => relativePath.startsWith(`${candidate}/`));
2482
- if (conflict) {
2483
- error(`${fieldName}.content.files path "${conflict}" conflicts with "${relativePath}"`);
2484
- }
1470
+ }
1471
+ for (const unit of prepared.preparation)
1472
+ for (const gap of unit.unmet) {
1473
+ warn(`component unmet (${platform}/${unit.renderScope}): ${gap.id} [${gap.reasonCode}] ${JSON.stringify(gap.requiredFeatures)}`);
2485
1474
  }
1475
+ }
1476
+ catch (cause) {
1477
+ const pending = (manifest.buildConfig?.generatedSkillRuntimeFiles ?? []).filter((file) => (!file.platforms?.length || file.platforms.includes(platform))
1478
+ && !fs.existsSync(path.join(root, platform, 'skills', file.skill, file.target)));
1479
+ if (!builtBundle && cause.message.startsWith('Invalid runtime Skill closure:') && cause.message.endsWith(' is missing.')
1480
+ && pending.some((file) => cause.message.includes(JSON.stringify(file.target)))) {
1481
+ warn(`component profile unverified (${platform}/${scope}): declared generated runtime files require a staging build; ${cause.message}`);
2486
1482
  }
1483
+ else
1484
+ error(`component profile fixture (${platform}/${scope}): ${cause.message}`);
2487
1485
  }
2488
- validateRenderedSkillTree({
2489
- entry,
2490
- declaration,
2491
- fieldName,
2492
- pluginDir: options.pluginDir,
2493
- manifest: options.manifest,
2494
- runtimeImports: options.runtimeImports,
2495
- materializedRoot: path.join(options.tempRoot, `${declaration.platform ?? declaration.distribution}-${scopeLabel.split('/')[1]}-${index}`),
2496
- skillValidationTools: options.skillValidationTools,
2497
- });
2498
1486
  }
2499
1487
  }
2500
- else if (entry.skillKey !== undefined) {
2501
- error(`${fieldName}.skillKey is only supported for dynamic skill artifacts`);
2502
- }
2503
- });
2504
- for (const declaration of declarations) {
2505
- const key = `${declaration.id}:${declaration.target}`;
2506
- if (!returned.has(key)) {
2507
- error(`${planField}: renderer must return artifact "${declaration.id}" target "${declaration.target}"`);
2508
- }
2509
1488
  }
2510
- }
2511
- function runArtifactRendererFixture(pluginDir, manifest, renderEntry, declarations, resolvedRuntimeImports, skillValidationTools) {
2512
- if (!renderEntry || declarations.length === 0)
2513
- return;
2514
- const surfaceScopes = [...new Set(declarations.flatMap((target) => target.scopes.map((scope) => `${target.platform ?? target.distribution}:${scope}`)))];
2515
- const values = defaultConfigValues(manifest);
2516
- const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'aw-artifact-render-'));
2517
- try {
2518
- for (const surfaceScope of surfaceScopes) {
2519
- const [surface, scope] = surfaceScope.split(':');
2520
- const distribution = surface === 'agent-skills' ? surface : undefined;
2521
- const platform = distribution ? undefined : surface;
2522
- const event = distribution ? 'materialize' : 'install';
2523
- const scopedDeclarations = declarations.filter((target) => (distribution ? target.distribution === distribution : target.platform === platform)
2524
- && target.scopes.includes(scope));
2525
- const contextPath = path.join(tempRoot, `context-${surface}-${scope}.json`);
2526
- const runtimeImports = scopedDeclarations.flatMap((target) => target.runtimeImports.map((runtimeImport, importIndex) => {
2527
- const resolved = resolvedRuntimeImports?.artifactImports.get(authorRuntimeImportKey(target.id, importIndex));
2528
- if (!resolved)
2529
- return null;
2530
- const importPath = path.join(tempRoot, `runtime-${target.id}-${importIndex}`);
2531
- fs.writeFileSync(importPath, resolved.bytes);
2532
- return {
2533
- artifactId: target.id,
2534
- name: runtimeImport.name,
2535
- providerPluginId: resolved.providerPluginId,
2536
- exportName: resolved.exportName,
2537
- path: importPath,
2538
- digest: resolved.digest,
2539
- };
2540
- }).filter(Boolean));
2541
- fs.writeFileSync(contextPath, JSON.stringify({
2542
- event,
2543
- surface: distribution
2544
- ? { kind: 'distribution', name: distribution }
2545
- : { kind: 'platform', name: platform },
2546
- ...(platform ? { platform } : {}),
2547
- ...(distribution ? { distribution } : {}),
2548
- scope,
2549
- plugin: {
2550
- name: manifest.name,
2551
- version: manifest.version,
2552
- rootDir: pluginDir,
2553
- },
2554
- config: {
2555
- mode: 'artifact-render',
2556
- targetScope: scope,
2557
- schema: manifest.config?.fields ?? {},
2558
- values,
2559
- sources: Object.fromEntries(Object.keys(values).map((key) => [key, 'default'])),
2560
- issues: [],
2561
- },
2562
- changedConfigKeys: [],
2563
- requestedArtifactIds: scopedDeclarations.map((target) => target.id),
2564
- previousArtifacts: [],
2565
- artifactSources: scopedDeclarations.map((target) => ({
2566
- id: target.id,
2567
- target: target.target,
2568
- sourceDirs: target.sourceDirs.map((sourceDir) => path.join(pluginDir, normalizeRelativePath(sourceDir))),
2569
- })),
2570
- runtimeImports,
2571
- paths: {
2572
- awHome: path.join(tempRoot, 'aw-home'),
2573
- codexHome: path.join(tempRoot, 'codex-home'),
2574
- claudeHome: path.join(tempRoot, 'claude-home'),
2575
- manifestPath: path.join(pluginDir, '.agents-plugin', 'plugin.json'),
2576
- configStores: {
2577
- user: path.join(tempRoot, 'config-user.json'),
2578
- project: path.join(tempRoot, 'config-project.json'),
2579
- },
2580
- },
2581
- renderer: {
2582
- runner: renderEntry.runner,
2583
- path: renderEntry.path,
2584
- args: renderEntry.args ?? [],
2585
- manifestDigest: 'author-validator-fixture',
2586
- rendererDigest: 'author-validator-fixture',
2587
- },
2588
- }), 'utf8');
2589
- const rendererHome = path.join(tempRoot, 'home');
2590
- const rendererTemp = path.join(tempRoot, 'tmp');
2591
- fs.mkdirSync(rendererHome, { recursive: true });
2592
- fs.mkdirSync(rendererTemp, { recursive: true });
2593
- const rendererEnv = {
2594
- AW_HOME: path.join(tempRoot, 'aw-home'),
2595
- AW_CODEX_HOME: path.join(tempRoot, 'codex-home'),
2596
- AW_CLAUDE_HOME: path.join(tempRoot, 'claude-home'),
2597
- PATH: process.env.PATH ?? process.env.Path ?? '',
2598
- AW_PLUGIN_CONTEXT: contextPath,
2599
- AW_PLUGIN_ROOT: pluginDir,
2600
- AW_PLUGIN_NAME: typeof manifest.name === 'string' ? manifest.name : '',
2601
- AW_PLUGIN_VERSION: typeof manifest.version === 'string' ? manifest.version : '',
2602
- AW_PLUGIN_EVENT: event,
2603
- ...(platform ? { AW_PLUGIN_PLATFORM: platform } : {}),
2604
- ...(distribution ? { AW_PLUGIN_DISTRIBUTION: distribution } : {}),
2605
- AW_PLUGIN_SCOPE: scope,
2606
- };
2607
- if (process.platform === 'win32') {
2608
- rendererEnv.USERPROFILE = rendererHome;
2609
- rendererEnv.TEMP = rendererTemp;
2610
- rendererEnv.TMP = rendererTemp;
2611
- if (process.env.SystemRoot)
2612
- rendererEnv.SystemRoot = process.env.SystemRoot;
2613
- if (process.env.ComSpec)
2614
- rendererEnv.ComSpec = process.env.ComSpec;
2615
- }
2616
- else {
2617
- rendererEnv.HOME = rendererHome;
2618
- rendererEnv.TMPDIR = rendererTemp;
2619
- }
2620
- const result = spawnSync(process.execPath, [path.join(pluginDir, renderEntry.path), ...(renderEntry.args ?? [])], {
2621
- cwd: pluginDir,
2622
- env: rendererEnv,
2623
- encoding: 'utf8',
2624
- timeout: 5000,
2625
- maxBuffer: 1024 * 1024,
2626
- });
2627
- const fieldName = `scripts.artifacts.render fixture (${surface}/${scope})`;
2628
- if (result.error) {
2629
- error(`${fieldName} failed: ${result.error.message}`);
2630
- continue;
2631
- }
2632
- if (result.status !== 0) {
2633
- const stderr = String(result.stderr ?? '').trim().split('\n')[0] ?? '';
2634
- error(`${fieldName} exited with code ${result.status}${stderr ? `: ${stderr}` : ''}`);
2635
- continue;
2636
- }
2637
- let plan;
2638
- try {
2639
- plan = JSON.parse(result.stdout);
2640
- }
2641
- catch (e) {
2642
- error(`${fieldName} stdout must be JSON ArtifactPlan: ${e.message}`);
2643
- continue;
2644
- }
2645
- validateRenderedArtifactPlan(plan, scopedDeclarations, `${surface}/${scope}`, {
2646
- pluginDir,
2647
- manifest,
2648
- runtimeImports: resolvedRuntimeImports,
2649
- tempRoot,
2650
- skillValidationTools,
2651
- });
2652
- }
1489
+ catch (cause) {
1490
+ error(`author component preparation: ${cause.message}`);
2653
1491
  }
2654
1492
  finally {
1493
+ try {
1494
+ await commandPackage?.cleanup();
1495
+ }
1496
+ catch (cause) {
1497
+ error(`author component cleanup: ${cause.message}`);
1498
+ }
2655
1499
  fs.rmSync(tempRoot, { recursive: true, force: true });
2656
1500
  }
2657
1501
  }
2658
- function validateDynamicArtifactsLightweight(pluginDir, manifest, renderEntry, runtimeImports, skillValidationTools) {
2659
- const declarations = validateArtifactsConfigLightweight(pluginDir, manifest);
2660
- const hasTargets = declarations.length > 0;
2661
- const hasRenderer = Boolean(manifest.scripts?.artifacts?.render);
2662
- if (hasTargets && !hasRenderer) {
2663
- error('artifacts.targets requires scripts.artifacts.render');
2664
- }
2665
- if (hasRenderer && !hasTargets) {
2666
- error('scripts.artifacts.render requires artifacts.targets');
2667
- }
2668
- runArtifactRendererFixture(pluginDir, manifest, renderEntry, declarations, runtimeImports, skillValidationTools);
2669
- }
2670
1502
  function validateScriptsLightweight(pluginDir, manifest) {
2671
- validateConfigSchemaLightweight(manifest.config);
1503
+ validateConfigSchemaLightweight(manifest.config, manifest);
2672
1504
  if (manifest.scripts === undefined)
2673
1505
  return null;
2674
1506
  const scripts = expectRecord(manifest.scripts, 'scripts');
2675
1507
  if (!scripts)
2676
1508
  return null;
2677
- validateAllowedKeys(scripts, 'scripts', ['postApply', 'helpers', 'node', 'artifacts', 'tests']);
1509
+ validateAllowedKeys(scripts, 'scripts', ['preApply', 'helpers', 'node', 'artifacts', 'config', 'tests']);
2678
1510
  const runtimeNodeEntries = [];
2679
1511
  let artifactRenderEntry = null;
2680
1512
  let packageMeta = null;
1513
+ const nativeToolReader = manifest.nativeTools ? normalizeRelativePath(manifest.nativeTools.reader ?? './.aw/native-tool-reader.mjs') : undefined;
1514
+ const runtimeConfigSkillRoots = (manifest.artifacts?.sourceDirs ?? []).map(normalizeRelativePath);
2681
1515
  if (scripts.helpers !== undefined) {
2682
1516
  const helpers = expectRecord(scripts.helpers, 'scripts.helpers');
2683
1517
  if (helpers) {
@@ -2691,23 +1525,30 @@ function validateScriptsLightweight(pluginDir, manifest) {
2691
1525
  runtimeNodeEntries.push({ path: helperPath, fieldName: 'scripts.helpers.config' });
2692
1526
  }
2693
1527
  }
2694
- if (scripts.postApply !== undefined) {
2695
- const postApply = expectRecord(scripts.postApply, 'scripts.postApply');
2696
- if (postApply) {
2697
- validateAllowedKeys(postApply, 'scripts.postApply', ['path', 'timeoutMs']);
2698
- const postApplyPath = normalizePluginScriptPath(pluginDir, postApply.path, 'scripts.postApply.path');
2699
- validateDeclaredScriptFile(pluginDir, postApplyPath, 'scripts.postApply.path');
2700
- if (postApplyPath && !isNodeRunnablePath(postApplyPath)) {
2701
- error('scripts.postApply.path must use a Node runnable extension (.js, .mjs, or .cjs)');
1528
+ if (scripts.preApply !== undefined) {
1529
+ const preApply = expectRecord(scripts.preApply, 'scripts.preApply');
1530
+ if (preApply) {
1531
+ validateAllowedKeys(preApply, 'scripts.preApply', ['path', 'timeoutMs']);
1532
+ const preApplyPath = normalizePluginScriptPath(pluginDir, preApply.path, 'scripts.preApply.path');
1533
+ validateDeclaredScriptFile(pluginDir, preApplyPath, 'scripts.preApply.path');
1534
+ if (preApplyPath && !isNodeRunnablePath(preApplyPath)) {
1535
+ error('scripts.preApply.path must use a Node runnable extension (.js, .mjs, or .cjs)');
2702
1536
  }
2703
- if (postApply.timeoutMs !== undefined && (!Number.isInteger(postApply.timeoutMs)
2704
- || postApply.timeoutMs < SCRIPT_TIMEOUT_MIN_MS || postApply.timeoutMs > SCRIPT_TIMEOUT_MAX_MS)) {
2705
- error(`scripts.postApply.timeoutMs must be an integer between ${SCRIPT_TIMEOUT_MIN_MS} and ${SCRIPT_TIMEOUT_MAX_MS}`);
1537
+ if (preApply.timeoutMs !== undefined && (!Number.isInteger(preApply.timeoutMs)
1538
+ || preApply.timeoutMs < SCRIPT_TIMEOUT_MIN_MS || preApply.timeoutMs > SCRIPT_TIMEOUT_MAX_MS)) {
1539
+ error(`scripts.preApply.timeoutMs must be an integer between ${SCRIPT_TIMEOUT_MIN_MS} and ${SCRIPT_TIMEOUT_MAX_MS}`);
2706
1540
  }
2707
- if (postApplyPath)
2708
- runtimeNodeEntries.push({ path: postApplyPath, fieldName: 'scripts.postApply.path' });
1541
+ if (preApplyPath)
1542
+ runtimeNodeEntries.push({ path: preApplyPath, fieldName: 'scripts.preApply.path' });
2709
1543
  }
2710
1544
  }
1545
+ const configSuggestions = scripts.config?.suggestions;
1546
+ if (configSuggestions) {
1547
+ // Core owns the shape, timeout and path contract for this normalized declaration.
1548
+ const fieldName = 'scripts.config.suggestions.path';
1549
+ validateDeclaredScriptFile(pluginDir, configSuggestions.path, fieldName);
1550
+ runtimeNodeEntries.push({ path: configSuggestions.path, fieldName });
1551
+ }
2711
1552
  if (scripts.node !== undefined) {
2712
1553
  const node = expectRecord(scripts.node, 'scripts.node');
2713
1554
  if (node) {
@@ -2725,6 +1566,8 @@ function validateScriptsLightweight(pluginDir, manifest) {
2725
1566
  label: 'scripts.node.build import contract',
2726
1567
  packageMeta,
2727
1568
  allowDevDependencies: true,
1569
+ runtimeConfigSkillRoots,
1570
+ nativeToolReader,
2728
1571
  });
2729
1572
  }
2730
1573
  }
@@ -2774,6 +1617,9 @@ function validateScriptsLightweight(pluginDir, manifest) {
2774
1617
  label: 'scripts.tests.node import contract',
2775
1618
  packageMeta,
2776
1619
  allowDevDependencies: true,
1620
+ runtimeConfigSkillRoots,
1621
+ nativeToolReader,
1622
+ injectedCommandReaders: getCommandPackageInjectedReaders(manifest),
2777
1623
  });
2778
1624
  }
2779
1625
  }
@@ -2783,6 +1629,8 @@ function validateScriptsLightweight(pluginDir, manifest) {
2783
1629
  label: 'runtime Node import contract',
2784
1630
  packageMeta,
2785
1631
  allowDevDependencies: false,
1632
+ runtimeConfigSkillRoots,
1633
+ nativeToolReader,
2786
1634
  });
2787
1635
  return artifactRenderEntry;
2788
1636
  }
@@ -2804,55 +1652,6 @@ function validateMcpContent(pluginDir, manifest) {
2804
1652
  error(`${manifest.mcpServers} is not valid JSON: ${e.message}`);
2805
1653
  }
2806
1654
  }
2807
- function validateAppsContent(pluginDir, manifest) {
2808
- if (!manifest.apps)
2809
- return;
2810
- if (isTemplateAsset(manifest, manifest.apps))
2811
- return;
2812
- const appsPath = path.join(pluginDir, manifest.apps);
2813
- if (!fs.existsSync(appsPath))
2814
- return;
2815
- try {
2816
- const content = JSON.parse(fs.readFileSync(appsPath, 'utf8'));
2817
- if (!content.apps || typeof content.apps !== 'object') {
2818
- error(`${manifest.apps} must have an "apps" top-level key`);
2819
- }
2820
- }
2821
- catch (e) {
2822
- error(`${manifest.apps} is not valid JSON: ${e.message}`);
2823
- }
2824
- }
2825
- function hasCodexRepoManagedSurface(manifest) {
2826
- if (manifest.skills || manifest.slashCommands || manifest.mcpServers) {
2827
- return true;
2828
- }
2829
- if ((manifest.artifacts?.targets ?? []).some((target) => target?.platform === 'codex' &&
2830
- Array.isArray(target.scopes) &&
2831
- target.scopes.includes('project') &&
2832
- typeof target.projectManagedKind === 'string')) {
2833
- return true;
2834
- }
2835
- const extensions = manifest.extensions;
2836
- if (!extensions || typeof extensions !== 'object' || Array.isArray(extensions)) {
2837
- return false;
2838
- }
2839
- return ['instructions', 'permissions', 'hooks', 'agents'].some((key) => Array.isArray(extensions[key]) && extensions[key].length > 0) || (extensions.nativeHooks &&
2840
- typeof extensions.nativeHooks === 'object' &&
2841
- !Array.isArray(extensions.nativeHooks) &&
2842
- Array.isArray(extensions.nativeHooks.codex) &&
2843
- extensions.nativeHooks.codex.length > 0);
2844
- }
2845
- function warnCodexProjectScopeLimitations(manifest) {
2846
- if (!isCodexTargeted(manifest)) {
2847
- return;
2848
- }
2849
- if (manifest.apps) {
2850
- warn('Codex project scope does not support apps; users must install this app surface with `aw install <plugin> -p codex -s user` or split the plugin.');
2851
- }
2852
- if (!hasCodexRepoManagedSurface(manifest)) {
2853
- warn('This Codex-targeted plugin has no repo-managed project surface; Codex project scope will fail fast and only Codex user native install is applicable.');
2854
- }
2855
- }
2856
1655
  function validateExtensionNameUniqueness(manifest) {
2857
1656
  if (!manifest.extensions)
2858
1657
  return;
@@ -2906,14 +1705,17 @@ function validateOpenAiYaml(openaiYamlPath, skillName, required, manifest, plugi
2906
1705
  error(`${fieldName} shared validation failed: ${e.message}`);
2907
1706
  }
2908
1707
  }
2909
- function validateSkills(pluginDir, manifest, options, skillValidationTools) {
1708
+ function selectSkillFrontmatterProfile(options, platform) {
1709
+ return options.strictAgentSkills ? 'portable-agent-skills'
1710
+ : platform === 'claude' && options.claudeSkillProfile === 'minimum'
1711
+ ? 'claude-2.1.88' : 'claude-current';
1712
+ }
1713
+ async function validateSkills(pluginDir, manifest, options, skillValidationTools) {
2910
1714
  if (!manifest.skills)
2911
1715
  return;
2912
1716
  const skillsDir = path.join(pluginDir, manifest.skills);
2913
1717
  if (!fs.existsSync(skillsDir))
2914
1718
  return;
2915
- const requiresCodexMetadata = isCodexTargeted(manifest);
2916
- const targetsClaude = isClaudeTargeted(manifest);
2917
1719
  const skillDirs = fs
2918
1720
  .readdirSync(skillsDir, { withFileTypes: true })
2919
1721
  .filter((d) => d.isDirectory());
@@ -2921,6 +1723,12 @@ function validateSkills(pluginDir, manifest, options, skillValidationTools) {
2921
1723
  error('skills directory exists but contains no skill subdirectories');
2922
1724
  }
2923
1725
  for (const dir of skillDirs) {
1726
+ if (await isAuthorOnlySkillDirectory(path.join(skillsDir, dir.name)))
1727
+ continue;
1728
+ const staticPlatforms = [...resolveSupportedPlatforms(manifest)];
1729
+ if (staticPlatforms.length === 0)
1730
+ continue;
1731
+ const requiresCodexMetadata = staticPlatforms.includes('codex');
2924
1732
  const skillPath = path.join(skillsDir, dir.name);
2925
1733
  const skillMdPath = path.join(skillPath, 'SKILL.md');
2926
1734
  const openaiYamlPath = path.join(skillPath, 'agents', 'openai.yaml');
@@ -2934,9 +1742,23 @@ function validateSkills(pluginDir, manifest, options, skillValidationTools) {
2934
1742
  if (lineCount >= MAX_SKILL_LINES) {
2935
1743
  warn(`skills/${dir.name}/SKILL.md has ${lineCount} lines; Agent Skills recommends keeping SKILL.md under ${MAX_SKILL_LINES} lines`);
2936
1744
  }
2937
- const variants = renderedContentVariants(manifest, skillMdRelativePath, content, targetedPlatforms(manifest));
1745
+ const variants = [];
1746
+ for (const platform of staticPlatforms) {
1747
+ try {
1748
+ variants.push({ platform, content: renderTemplateForPlatform(manifest, skillMdRelativePath, content, platform) });
1749
+ }
1750
+ catch (cause) {
1751
+ error(`${skillMdRelativePath} (${platform} render): ${cause.message}`);
1752
+ }
1753
+ }
1754
+ const validatedVariants = new Set();
2938
1755
  for (const variant of variants) {
2939
- const sourceName = variant.platform
1756
+ const profile = selectSkillFrontmatterProfile(options, variant.platform);
1757
+ const key = JSON.stringify([profile, variant.content]);
1758
+ if (validatedVariants.has(key))
1759
+ continue;
1760
+ validatedVariants.add(key);
1761
+ const sourceName = templateIncludesPath(manifest, skillMdRelativePath)
2940
1762
  ? `skills/${dir.name}/SKILL.md (${variant.platform} render)`
2941
1763
  : `skills/${dir.name}/SKILL.md`;
2942
1764
  if (!skillValidationTools) {
@@ -2948,11 +1770,8 @@ function validateSkills(pluginDir, manifest, options, skillValidationTools) {
2948
1770
  error(`${entry.path} [${entry.code}] ${entry.message}`);
2949
1771
  }
2950
1772
  if (parsed.frontmatter) {
2951
- const profile = options.strictAgentSkills || !targetsClaude
2952
- ? 'portable-agent-skills'
2953
- : options.claudeSkillProfile === 'current'
2954
- ? 'claude-current'
2955
- : 'claude-2.1.88';
1773
+ // Source metadata preserves requested behavior. Host support is checked
1774
+ // later by the selected component profile, including explicit unmet.
2956
1775
  const diagnostics = skillValidationTools.validateSkillFrontmatter(parsed.frontmatter, {
2957
1776
  profile,
2958
1777
  expectedName: dir.name,
@@ -2970,223 +1789,17 @@ function validateSkills(pluginDir, manifest, options, skillValidationTools) {
2970
1789
  }
2971
1790
  }
2972
1791
  }
2973
- function detectCodexSlashCommandForbiddenSyntax(content) {
2974
- const checks = [
2975
- [/\$ARGUMENTS\b/, '$ARGUMENTS'],
2976
- [/\$\d+\b/, '$1'],
2977
- [/```!/, '```!'],
2978
- [/!`[^`\r\n]+`/, '!`command`'],
2979
- ];
2980
- for (const [pattern, label] of checks) {
2981
- if (pattern.test(content)) {
2982
- return label;
2983
- }
2984
- }
2985
- return null;
2986
- }
2987
- function validateSlashCommandAssetReference(commandRoot, commandRelativePath, value, fieldName) {
2988
- if (value === undefined)
2989
- return;
2990
- validateCodexIconPath({ [fieldName]: value }, fieldName, `${commandRelativePath}.codex.interface`);
2991
- if (typeof value !== 'string' || value.trim().length === 0)
2992
- return;
2993
- const normalized = normalizeRelativePath(stripDotSlash(value));
2994
- const absolutePath = path.join(commandRoot, normalized);
2995
- const stats = fs.statSync(absolutePath, { throwIfNoEntry: false });
2996
- if (!stats) {
2997
- error(`${commandRelativePath}.codex.interface.${fieldName} references missing asset "${value}"`);
2998
- return;
2999
- }
3000
- if (!stats.isFile()) {
3001
- error(`${commandRelativePath}.codex.interface.${fieldName} must reference a file, got "${value}"`);
3002
- }
3003
- }
3004
- function validateSlashCommandFrontmatter(commandRoot, commandRelativePath, frontmatter, platform) {
3005
- const fieldName = `${commandRelativePath} frontmatter`;
3006
- const fm = expectRecord(frontmatter, fieldName);
3007
- if (!fm)
3008
- return;
3009
- for (const key of Object.keys(fm)) {
3010
- if (CLAUDE_SLASH_COMMAND_ONLY_FIELDS.has(key)) {
3011
- error(`${fieldName}: "${key}" must be nested under "claude"`);
3012
- }
3013
- }
3014
- validateAllowedKeys(fm, fieldName, ['description', 'claude', 'codex']);
3015
- validateNonEmptyString(fm.description, `${fieldName}.description`, MAX_SKILL_DESCRIPTION_LEN);
3016
- if (platform === 'claude' && fm.claude !== undefined) {
3017
- const claudeBlock = expectRecord(fm.claude, `${fieldName}.claude`);
3018
- if (claudeBlock) {
3019
- validateAllowedKeys(claudeBlock, `${fieldName}.claude`, [
3020
- 'description',
3021
- 'allowed-tools',
3022
- 'model',
3023
- 'argument-hint',
3024
- 'shell',
3025
- ]);
3026
- if (claudeBlock.description !== undefined) {
3027
- validateNonEmptyString(claudeBlock.description, `${fieldName}.claude.description`, MAX_SKILL_DESCRIPTION_LEN);
3028
- }
3029
- if (claudeBlock['allowed-tools'] !== undefined) {
3030
- validateAllowedTools(claudeBlock['allowed-tools'], `${fieldName}.claude.allowed-tools`, { allowArray: true });
3031
- }
3032
- if (claudeBlock.model !== undefined) {
3033
- validateNonEmptyString(claudeBlock.model, `${fieldName}.claude.model`);
3034
- }
3035
- if (claudeBlock['argument-hint'] !== undefined) {
3036
- validateNonEmptyString(claudeBlock['argument-hint'], `${fieldName}.claude.argument-hint`);
3037
- }
3038
- if (claudeBlock.shell !== undefined) {
3039
- if (typeof claudeBlock.shell !== 'string') {
3040
- error(`${fieldName}.claude.shell must be a string`);
3041
- }
3042
- else if (!CLAUDE_FRONTMATTER_SHELLS.has(claudeBlock.shell.trim().toLowerCase())) {
3043
- error(`${fieldName}.claude.shell must be "bash" or "powershell"`);
3044
- }
3045
- }
3046
- }
3047
- }
3048
- if (platform === 'codex' && fm.codex !== undefined) {
3049
- const codexBlock = expectRecord(fm.codex, `${fieldName}.codex`);
3050
- if (codexBlock) {
3051
- if (codexBlock.policy !== undefined) {
3052
- error(`${fieldName}.codex.policy is not supported; generated slashCommands skills are always manual-only`);
3053
- }
3054
- validateAllowedKeys(codexBlock, `${fieldName}.codex`, ['description', 'interface']);
3055
- if (codexBlock.description !== undefined) {
3056
- validateNonEmptyString(codexBlock.description, `${fieldName}.codex.description`, MAX_SKILL_DESCRIPTION_LEN);
3057
- }
3058
- if (codexBlock.interface !== undefined) {
3059
- const interfaceBlock = expectRecord(codexBlock.interface, `${fieldName}.codex.interface`);
3060
- if (interfaceBlock) {
3061
- validateAllowedKeys(interfaceBlock, `${fieldName}.codex.interface`, [
3062
- 'display_name',
3063
- 'short_description',
3064
- 'icon_small',
3065
- 'icon_large',
3066
- 'brand_color',
3067
- 'default_prompt',
3068
- ]);
3069
- validateCodexMetadataString(interfaceBlock, 'display_name', `${fieldName}.codex.interface`, MAX_OPENAI_INTERFACE_NAME_LEN);
3070
- validateCodexShortDescription(interfaceBlock, `${fieldName}.codex.interface`);
3071
- validateCodexDefaultPrompt(interfaceBlock, 'default_prompt', `${fieldName}.codex.interface`, MAX_OPENAI_DEFAULT_PROMPT_LEN, path.basename(commandRelativePath, path.extname(commandRelativePath)));
3072
- validateCodexBrandColor(interfaceBlock, 'brand_color', `${fieldName}.codex.interface`);
3073
- validateSlashCommandAssetReference(commandRoot, commandRelativePath, interfaceBlock.icon_small, 'icon_small');
3074
- validateSlashCommandAssetReference(commandRoot, commandRelativePath, interfaceBlock.icon_large, 'icon_large');
3075
- }
3076
- }
3077
- }
3078
- }
3079
- }
3080
- function validateSlashCommands(pluginDir, manifest) {
3081
- const defaultSlashCommandsDir = path.join(pluginDir, DEFAULT_SLASH_COMMANDS_DIR);
3082
- if (fs.existsSync(defaultSlashCommandsDir) && !manifest.slashCommands) {
3083
- error(`"${DEFAULT_SLASH_COMMANDS_DIR}" exists but manifest does not declare "slashCommands"`);
3084
- }
3085
- if (!manifest.slashCommands)
3086
- return;
3087
- const targetPlatforms = resolveSupportedPlatforms(manifest);
3088
- const slashCommandsRoot = path.join(pluginDir, manifest.slashCommands);
3089
- const stats = fs.statSync(slashCommandsRoot, { throwIfNoEntry: false });
3090
- if (!stats) {
3091
- error(`slashCommands points to "${manifest.slashCommands}" but path does not exist`);
3092
- return;
3093
- }
3094
- if (!stats.isDirectory()) {
3095
- error(`slashCommands must point to a directory, got "${manifest.slashCommands}"`);
3096
- return;
3097
- }
3098
- const skillNames = new Set();
3099
- if (manifest.skills) {
3100
- const skillsRoot = path.join(pluginDir, manifest.skills);
3101
- if (fs.existsSync(skillsRoot)) {
3102
- for (const entry of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
3103
- if (entry.isDirectory()) {
3104
- skillNames.add(entry.name);
3105
- }
3106
- }
3107
- }
3108
- }
3109
- const seenCommands = new Set();
3110
- const commandFiles = [];
3111
- for (const entry of fs.readdirSync(slashCommandsRoot, { withFileTypes: true })) {
3112
- const relativePath = normalizeRelativePath(path.join(stripDotSlash(manifest.slashCommands), entry.name));
3113
- if (entry.isDirectory()) {
3114
- if (entry.name !== 'assets') {
3115
- error(`slashCommands does not support nested directory "${relativePath}"; only root *.md files and assets/ are allowed`);
3116
- }
3117
- continue;
3118
- }
3119
- if (!entry.isFile()) {
3120
- error(`slashCommands has unsupported entry "${relativePath}"`);
3121
- continue;
3122
- }
3123
- if (path.posix.extname(entry.name) !== '.md') {
3124
- error(`slashCommands only accepts root *.md files; found "${relativePath}"`);
3125
- continue;
3126
- }
3127
- commandFiles.push(entry.name);
3128
- }
3129
- if (commandFiles.length === 0) {
3130
- error(`slashCommands "${manifest.slashCommands}" must contain at least one root *.md command file`);
3131
- return;
3132
- }
3133
- for (const fileName of commandFiles.sort()) {
3134
- const commandName = path.posix.basename(fileName, '.md');
3135
- const commandRelativePath = normalizeRelativePath(path.join(stripDotSlash(manifest.slashCommands), fileName));
3136
- if (commandName.length === 0 ||
3137
- commandName.length > 64 ||
3138
- !SLASH_COMMAND_NAME_PATTERN.test(commandName)) {
3139
- error(`${commandRelativePath} command name must use lowercase hyphen-case and be <= 64 characters`);
3140
- continue;
3141
- }
3142
- if (seenCommands.has(commandName)) {
3143
- error(`slashCommands has duplicate command name "${commandName}"`);
3144
- continue;
3145
- }
3146
- if (skillNames.has(commandName)) {
3147
- error(`slashCommands command "${commandName}" conflicts with source skill "${commandName}"`);
3148
- continue;
3149
- }
3150
- seenCommands.add(commandName);
3151
- const absolutePath = path.join(slashCommandsRoot, fileName);
3152
- const rawContent = fs.readFileSync(absolutePath, 'utf8');
3153
- for (const platform of ['claude', 'codex']) {
3154
- if (!targetPlatforms.has(platform))
3155
- continue;
3156
- const rendered = renderTemplateForPlatform(manifest, commandRelativePath, rawContent, platform);
3157
- if (platform === 'codex') {
3158
- const codexForbiddenSyntax = detectCodexSlashCommandForbiddenSyntax(rendered);
3159
- if (codexForbiddenSyntax) {
3160
- error(`${commandRelativePath} Codex render still contains Claude-only syntax "${codexForbiddenSyntax}"`);
3161
- }
3162
- }
3163
- let frontmatter;
3164
- try {
3165
- frontmatter = parseFrontmatter(rendered, `${commandRelativePath} (${platform} render)`);
3166
- }
3167
- catch (parseError) {
3168
- error(`${commandRelativePath} (${platform} render) has invalid YAML frontmatter: ${parseError.message}`);
3169
- continue;
3170
- }
3171
- if (!frontmatter) {
3172
- error(`${commandRelativePath} (${platform} render) is missing YAML frontmatter`);
3173
- continue;
3174
- }
3175
- validateSlashCommandFrontmatter(slashCommandsRoot, commandRelativePath, frontmatter, platform);
3176
- }
3177
- }
3178
- }
3179
1792
  // ---------------------------------------------------------------------------
3180
1793
  // Main
3181
1794
  // ---------------------------------------------------------------------------
3182
1795
  function printUsage() {
3183
1796
  console.log(`Usage:
3184
- aw plugin validate <plugin-directory> [options]
1797
+ aw dev plugin validate <plugin-directory> [options]
3185
1798
 
3186
1799
  Options:
3187
1800
  --strict-agent-skills Allow only Agent Skills portable core frontmatter.
3188
1801
  --claude-skill-profile <minimum|current>
3189
- Validate Claude fields at AW minimum 2.1.88 (default) or current docs.
1802
+ Validate current source fields (default), or explicitly require Claude 2.1.88 fields.
3190
1803
  --version-base <git-ref> Compare the production bundle against this Git base. Default: HEAD.
3191
1804
  --workspace-root <path> Workspace root. Default: current directory.
3192
1805
  --json Emit one machine-readable JSON result to stdout.
@@ -3252,8 +1865,45 @@ async function validatePluginDir(pluginDir, options) {
3252
1865
  }
3253
1866
  }
3254
1867
  const skillValidationTools = await tryLoadCliSkillValidationTools();
1868
+ const sourceConfig = manifest.config;
1869
+ let normalizedManifest;
1870
+ let referenceContext;
1871
+ let referencePlugins;
3255
1872
  try {
3256
- const normalizedManifest = await cliManifestTools.validateSourcePluginManifest(pluginDir, manifest);
1873
+ normalizedManifest = await cliManifestTools.validateSourcePluginManifest(pluginDir, manifest);
1874
+ manifest = normalizedManifest;
1875
+ // The Workspace is the sole source of dependency definitions and defaults.
1876
+ // No installed plugin or user config can complete an author fixture.
1877
+ if (manifest.config) {
1878
+ let plugins = [{ manifest, rootDir: pluginDir }];
1879
+ const hasCrossPluginSuggestions = getPluginConfigSuggestions(manifest.config, sourceConfig)
1880
+ .some((declaration) => declaration.plugin !== undefined);
1881
+ if (hasCrossPluginValueRef(sourceConfig) || hasCrossPluginSuggestions) {
1882
+ if (!options.repoRoot)
1883
+ throw new Error('Cross-plugin config validation requires the canonical same-source Workspace.');
1884
+ const workspace = await readCatalogWorkspace(options.repoRoot, {
1885
+ reservedImports: cliManifestTools.reservedImports,
1886
+ });
1887
+ if (!workspace.plugins.some((plugin) => plugin.manifest.name === manifest.name
1888
+ && plugin.rootDir === fs.realpathSync(pluginDir))) {
1889
+ throw new Error('Cross-plugin config validation requires the canonical same-source Workspace plugin.');
1890
+ }
1891
+ plugins = workspace.plugins;
1892
+ }
1893
+ referencePlugins = plugins;
1894
+ if (hasCrossPluginSuggestions)
1895
+ assertPluginConfigSuggestionProviders(manifest, plugins, sourceConfig);
1896
+ referenceContext = {
1897
+ plugin: manifest.name,
1898
+ dependencies: manifest.dependencies ?? [],
1899
+ plugins: Object.fromEntries(plugins.map((plugin) => [plugin.manifest.name, {
1900
+ definition: plugin.manifest.config ?? { fields: {} },
1901
+ dependencies: plugin.manifest.dependencies ?? [],
1902
+ values: defaultConfigValues(plugin.manifest),
1903
+ }])),
1904
+ };
1905
+ assertPluginConfigReferenceSchemas(manifest.config, referenceContext, sourceConfig);
1906
+ }
3257
1907
  const requirements = await cliManifestTools.resolvePluginRequirements({
3258
1908
  pluginRoot: pluginDir,
3259
1909
  manifest: normalizedManifest,
@@ -3277,29 +1927,34 @@ async function validatePluginDir(pluginDir, options) {
3277
1927
  }
3278
1928
  catch (e) {
3279
1929
  error(e.message);
1930
+ return;
1931
+ }
1932
+ if (options.builtBundle) {
1933
+ await validateAuthorComponentFixtures(pluginDir, manifest, undefined, cliManifestTools, referenceContext, referencePlugins, skillValidationTools, options);
1934
+ return;
3280
1935
  }
3281
1936
  validatePlatformFieldSupport(manifest);
3282
- validatePortableNativeArtifactCapabilityLightweight(manifest);
3283
1937
  validateNameMatchesDirectory(pluginDir, manifest);
3284
1938
  validateNoBuildOutputDirs(pluginDir);
3285
1939
  validateDeclaredNativeAssets(pluginDir, manifest);
3286
- validateCanonicalSkillLayout(pluginDir, manifest);
1940
+ await validateCanonicalSkillLayout(pluginDir, manifest);
3287
1941
  await validatePluginEvalManifest(pluginDir, manifest);
3288
- const artifactRenderEntry = validateScriptsLightweight(pluginDir, manifest);
1942
+ validateScriptsLightweight(pluginDir, manifest);
3289
1943
  const runtimeImports = await resolveAuthorRuntimeImports({
3290
1944
  pluginDir,
3291
1945
  manifest,
3292
1946
  repoRoot: options.repoRoot,
3293
1947
  cliManifestTools,
3294
1948
  });
3295
- validateStaticPortableFinalTrees(pluginDir, manifest, runtimeImports, skillValidationTools);
3296
- validateDynamicArtifactsLightweight(pluginDir, manifest, artifactRenderEntry, runtimeImports, skillValidationTools);
1949
+ if (manifest.scripts?.node?.build && manifest.scripts?.artifacts?.render) {
1950
+ warn('Component profiles require a staging build; source validation has not verified them.');
1951
+ }
1952
+ else {
1953
+ await validateAuthorComponentFixtures(pluginDir, manifest, runtimeImports, cliManifestTools, referenceContext, referencePlugins, skillValidationTools, options);
1954
+ }
3297
1955
  validateMcpContent(pluginDir, manifest);
3298
- validateAppsContent(pluginDir, manifest);
3299
- warnCodexProjectScopeLimitations(manifest);
3300
1956
  validateExtensionNameUniqueness(manifest);
3301
- validateSkills(pluginDir, manifest, options, skillValidationTools);
3302
- validateSlashCommands(pluginDir, manifest);
1957
+ await validateSkills(pluginDir, manifest, options, skillValidationTools);
3303
1958
  if (errors.length === 0) {
3304
1959
  const repoRoot = resolveCanonicalRepoRoot(pluginDir, manifest.name ?? '', options.gitRoot);
3305
1960
  if (repoRoot) {
@@ -3335,9 +1990,10 @@ function parseArgs(argv) {
3335
1990
  const options = {
3336
1991
  pluginDir: null,
3337
1992
  strictAgentSkills: false,
3338
- claudeSkillProfile: 'minimum',
1993
+ claudeSkillProfile: 'current',
3339
1994
  versionBase: 'HEAD',
3340
1995
  workspaceRoot: null,
1996
+ builtBundle: null,
3341
1997
  json: args.includes('--json'),
3342
1998
  };
3343
1999
  for (let index = 0; index < args.length; index += 1) {
@@ -3374,13 +2030,16 @@ function parseArgs(argv) {
3374
2030
  options.versionBase = value;
3375
2031
  continue;
3376
2032
  }
3377
- if (arg === '--workspace-root') {
2033
+ if (arg === '--workspace-root' || arg === '--built-bundle') {
3378
2034
  const value = args[index + 1];
3379
2035
  if (!value || value.startsWith('--')) {
3380
- exitCliError('--workspace-root requires a value.', options.json);
2036
+ exitCliError(`${arg} requires a value.`, options.json);
3381
2037
  }
3382
2038
  index += 1;
3383
- options.workspaceRoot = value;
2039
+ if (arg === '--workspace-root')
2040
+ options.workspaceRoot = value;
2041
+ else
2042
+ options.builtBundle = path.resolve(value);
3384
2043
  continue;
3385
2044
  }
3386
2045
  if (!arg.startsWith('--')) {
@@ -3427,6 +2086,7 @@ async function main() {
3427
2086
  repoRoot,
3428
2087
  gitRoot,
3429
2088
  enforceCanonicalRoot: requestedWorkspaceRoot !== null,
2089
+ builtBundle: args.builtBundle,
3430
2090
  });
3431
2091
  if (args.json) {
3432
2092
  console.log(JSON.stringify({