@lesliechan721/aw 0.1.0-beta.73 → 0.1.0-beta.74

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 (361) hide show
  1. package/dist/authoring/assets/aw-runtime-config.mjs +65 -43
  2. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
  3. package/dist/authoring/scripts/add-skill.mjs +5 -14
  4. package/dist/authoring/scripts/add-skill.mjs.map +1 -1
  5. package/dist/authoring/scripts/init-plugin.mjs +4 -28
  6. package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
  7. package/dist/authoring/scripts/lib/plugin-version-check.mjs +2 -2
  8. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
  9. package/dist/authoring/scripts/lib/skill-scaffold.mjs +0 -1
  10. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
  11. package/dist/authoring/scripts/validate-plugin.mjs +234 -1422
  12. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  13. package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
  14. package/dist/scripts/aw-skill-eval-materializer.js +19 -80
  15. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  16. package/dist/scripts/bundle-plugins.js.map +1 -1
  17. package/dist/scripts/test-plugin-scripts.js +6 -8
  18. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  19. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  20. package/dist/src/commands/aw-capabilities.js +2 -2
  21. package/dist/src/commands/aw-capabilities.js.map +1 -1
  22. package/dist/src/commands/dependency-operation-plan.js +3 -3
  23. package/dist/src/commands/dependency-operation-plan.js.map +1 -1
  24. package/dist/src/commands/deployment-confirmation.d.ts +4 -0
  25. package/dist/src/commands/deployment-confirmation.js +20 -0
  26. package/dist/src/commands/deployment-confirmation.js.map +1 -0
  27. package/dist/src/commands/managed-commands.js +4 -2
  28. package/dist/src/commands/managed-commands.js.map +1 -1
  29. package/dist/src/commands/offline-cleanup-evidence.d.ts +3 -1
  30. package/dist/src/commands/offline-cleanup-evidence.js +9 -4
  31. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
  32. package/dist/src/commands/operation-plan.d.ts +6 -0
  33. package/dist/src/commands/operation-plan.js +29 -2
  34. package/dist/src/commands/operation-plan.js.map +1 -1
  35. package/dist/src/commands/options.d.ts +6 -2
  36. package/dist/src/commands/options.js +5 -4
  37. package/dist/src/commands/options.js.map +1 -1
  38. package/dist/src/commands/plugin-capabilities.js +29 -41
  39. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  40. package/dist/src/commands/public-config-confirmation.js +5 -5
  41. package/dist/src/commands/public-config-confirmation.js.map +1 -1
  42. package/dist/src/commands/public-lifecycle-result.d.ts +47 -0
  43. package/dist/src/commands/public-lifecycle-result.js +119 -4
  44. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  45. package/dist/src/commands/public-lifecycle.d.ts +1 -0
  46. package/dist/src/commands/public-lifecycle.js +15 -2
  47. package/dist/src/commands/public-lifecycle.js.map +1 -1
  48. package/dist/src/commands/public-plugin-query.d.ts +1 -0
  49. package/dist/src/commands/public-plugin-query.js +28 -8
  50. package/dist/src/commands/public-plugin-query.js.map +1 -1
  51. package/dist/src/commands/rebuild-command.d.ts +12 -11
  52. package/dist/src/commands/rebuild-command.js +529 -769
  53. package/dist/src/commands/rebuild-command.js.map +1 -1
  54. package/dist/src/commands/rebuild-integration.d.ts +21 -43
  55. package/dist/src/commands/rebuild-integration.js +306 -3600
  56. package/dist/src/commands/rebuild-integration.js.map +1 -1
  57. package/dist/src/commands/rebuild-operations.d.ts +13 -0
  58. package/dist/src/commands/rebuild-operations.js +60 -15
  59. package/dist/src/commands/rebuild-operations.js.map +1 -1
  60. package/dist/src/commands/rebuild-platform-integration.d.ts +59 -0
  61. package/dist/src/commands/rebuild-platform-integration.js +1200 -0
  62. package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
  63. package/dist/src/commands/review-inspection.js +41 -4
  64. package/dist/src/commands/review-inspection.js.map +1 -1
  65. package/dist/src/commands/review-preparation.d.ts +2 -0
  66. package/dist/src/commands/review-preparation.js +23 -60
  67. package/dist/src/commands/review-preparation.js.map +1 -1
  68. package/dist/src/commands/skill-eval.js +1 -0
  69. package/dist/src/commands/skill-eval.js.map +1 -1
  70. package/dist/src/commands/status-v6.d.ts +3 -1
  71. package/dist/src/commands/status-v6.js +24 -15
  72. package/dist/src/commands/status-v6.js.map +1 -1
  73. package/dist/src/commands/targets-command.d.ts +9 -0
  74. package/dist/src/commands/targets-command.js +57 -6
  75. package/dist/src/commands/targets-command.js.map +1 -1
  76. package/dist/src/commands/write-commands.js +43 -28
  77. package/dist/src/commands/write-commands.js.map +1 -1
  78. package/dist/src/constants.d.ts +2 -2
  79. package/dist/src/constants.js +2 -2
  80. package/dist/src/constants.js.map +1 -1
  81. package/dist/src/generators/local-plugin.js +59 -248
  82. package/dist/src/generators/local-plugin.js.map +1 -1
  83. package/dist/src/index.js +40 -14
  84. package/dist/src/index.js.map +1 -1
  85. package/dist/src/output/command-receipt.d.ts +1 -1
  86. package/dist/src/output/command-receipt.js +3 -1
  87. package/dist/src/output/command-receipt.js.map +1 -1
  88. package/dist/src/output/native-consent.d.ts +2 -0
  89. package/dist/src/output/native-consent.js +5 -0
  90. package/dist/src/output/native-consent.js.map +1 -0
  91. package/dist/src/output/public-result.js +60 -0
  92. package/dist/src/output/public-result.js.map +1 -1
  93. package/dist/src/output/rebuild-progress.js +5 -5
  94. package/dist/src/output/rebuild-progress.js.map +1 -1
  95. package/dist/src/output/receipt-projection.js +19 -2
  96. package/dist/src/output/receipt-projection.js.map +1 -1
  97. package/dist/src/platforms/capabilities.d.ts +10 -0
  98. package/dist/src/platforms/capabilities.js +158 -0
  99. package/dist/src/platforms/capabilities.js.map +1 -0
  100. package/dist/src/platforms/contracts.d.ts +338 -0
  101. package/dist/src/platforms/contracts.js +2 -0
  102. package/dist/src/platforms/contracts.js.map +1 -0
  103. package/dist/src/platforms/cursor-workspace-hook.d.ts +22 -0
  104. package/dist/src/platforms/cursor-workspace-hook.js +185 -0
  105. package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
  106. package/dist/src/platforms/discovery.d.ts +74 -0
  107. package/dist/src/platforms/discovery.js +582 -0
  108. package/dist/src/platforms/discovery.js.map +1 -0
  109. package/dist/src/platforms/gemini-activation.d.ts +36 -0
  110. package/dist/src/platforms/gemini-activation.js +331 -0
  111. package/dist/src/platforms/gemini-activation.js.map +1 -0
  112. package/dist/src/platforms/gemini-consent.d.ts +8 -0
  113. package/dist/src/platforms/gemini-consent.js +79 -0
  114. package/dist/src/platforms/gemini-consent.js.map +1 -0
  115. package/dist/src/platforms/identity.d.ts +4 -0
  116. package/dist/src/platforms/identity.js +22 -0
  117. package/dist/src/platforms/identity.js.map +1 -0
  118. package/dist/src/platforms/inspection-grok.d.ts +4 -0
  119. package/dist/src/platforms/inspection-grok.js +173 -0
  120. package/dist/src/platforms/inspection-grok.js.map +1 -0
  121. package/dist/src/platforms/inspection-native.d.ts +6 -0
  122. package/dist/src/platforms/inspection-native.js +379 -0
  123. package/dist/src/platforms/inspection-native.js.map +1 -0
  124. package/dist/src/platforms/inspection-pi.d.ts +4 -0
  125. package/dist/src/platforms/inspection-pi.js +212 -0
  126. package/dist/src/platforms/inspection-pi.js.map +1 -0
  127. package/dist/src/platforms/inspection.d.ts +13 -0
  128. package/dist/src/platforms/inspection.js +189 -0
  129. package/dist/src/platforms/inspection.js.map +1 -0
  130. package/dist/src/platforms/layout.d.ts +21 -0
  131. package/dist/src/platforms/layout.js +239 -0
  132. package/dist/src/platforms/layout.js.map +1 -0
  133. package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
  134. package/dist/src/platforms/lifecycle-native-services.js +147 -0
  135. package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
  136. package/dist/src/platforms/lifecycle-native.d.ts +9 -0
  137. package/dist/src/platforms/lifecycle-native.js +252 -0
  138. package/dist/src/platforms/lifecycle-native.js.map +1 -0
  139. package/dist/src/platforms/lifecycle.d.ts +25 -0
  140. package/dist/src/platforms/lifecycle.js +452 -0
  141. package/dist/src/platforms/lifecycle.js.map +1 -0
  142. package/dist/src/platforms/managed-command-placement.d.ts +8 -0
  143. package/dist/src/platforms/managed-command-placement.js +79 -0
  144. package/dist/src/platforms/managed-command-placement.js.map +1 -0
  145. package/dist/src/platforms/projection-code-extension.d.ts +8 -0
  146. package/dist/src/platforms/projection-code-extension.js +121 -0
  147. package/dist/src/platforms/projection-code-extension.js.map +1 -0
  148. package/dist/src/platforms/projection-command-resources.d.ts +7 -0
  149. package/dist/src/platforms/projection-command-resources.js +74 -0
  150. package/dist/src/platforms/projection-command-resources.js.map +1 -0
  151. package/dist/src/platforms/projection-files.d.ts +27 -0
  152. package/dist/src/platforms/projection-files.js +111 -0
  153. package/dist/src/platforms/projection-files.js.map +1 -0
  154. package/dist/src/platforms/projection-marketplace.d.ts +19 -0
  155. package/dist/src/platforms/projection-marketplace.js +42 -0
  156. package/dist/src/platforms/projection-marketplace.js.map +1 -0
  157. package/dist/src/platforms/projection.d.ts +10 -0
  158. package/dist/src/platforms/projection.js +446 -0
  159. package/dist/src/platforms/projection.js.map +1 -0
  160. package/dist/src/platforms/registry.d.ts +4 -0
  161. package/dist/src/platforms/registry.js +30 -0
  162. package/dist/src/platforms/registry.js.map +1 -0
  163. package/dist/src/platforms/supplement-layout.d.ts +16 -0
  164. package/dist/src/platforms/supplement-layout.js +31 -0
  165. package/dist/src/platforms/supplement-layout.js.map +1 -0
  166. package/dist/src/portable/commands.d.ts +7 -5
  167. package/dist/src/portable/commands.js +6 -1
  168. package/dist/src/portable/commands.js.map +1 -1
  169. package/dist/src/portable/materializer.d.ts +8 -6
  170. package/dist/src/portable/materializer.js +47 -245
  171. package/dist/src/portable/materializer.js.map +1 -1
  172. package/dist/src/portable/recovery-layout.js +2 -15
  173. package/dist/src/portable/recovery-layout.js.map +1 -1
  174. package/dist/src/portable/recovery.d.ts +10 -1
  175. package/dist/src/portable/recovery.js +34 -8
  176. package/dist/src/portable/recovery.js.map +1 -1
  177. package/dist/src/recovery/coordinator.d.ts +4 -7
  178. package/dist/src/recovery/coordinator.js +151 -119
  179. package/dist/src/recovery/coordinator.js.map +1 -1
  180. package/dist/src/recovery/demand.d.ts +1 -1
  181. package/dist/src/recovery/demand.js +10 -42
  182. package/dist/src/recovery/demand.js.map +1 -1
  183. package/dist/src/recovery/joint-coordinator.js +112 -52
  184. package/dist/src/recovery/joint-coordinator.js.map +1 -1
  185. package/dist/src/recovery/joint-demand.d.ts +4 -22
  186. package/dist/src/recovery/joint-demand.js +43 -40
  187. package/dist/src/recovery/joint-demand.js.map +1 -1
  188. package/dist/src/recovery/receipt.d.ts +23 -8
  189. package/dist/src/recovery/retirement.d.ts +1 -1
  190. package/dist/src/recovery/retirement.js +122 -29
  191. package/dist/src/recovery/retirement.js.map +1 -1
  192. package/dist/src/recovery/status.d.ts +13 -6
  193. package/dist/src/recovery/status.js +479 -79
  194. package/dist/src/recovery/status.js.map +1 -1
  195. package/dist/src/recovery/types.d.ts +3 -3
  196. package/dist/src/review/platform-profile.d.ts +3 -0
  197. package/dist/src/review/platform-profile.js +16 -0
  198. package/dist/src/review/platform-profile.js.map +1 -0
  199. package/dist/src/review/review-profile.d.ts +1 -0
  200. package/dist/src/review/review-profile.js +8 -2
  201. package/dist/src/review/review-profile.js.map +1 -1
  202. package/dist/src/review/review-selection.d.ts +2 -11
  203. package/dist/src/review/review-selection.js +97 -71
  204. package/dist/src/review/review-selection.js.map +1 -1
  205. package/dist/src/review/review-types.d.ts +3 -0
  206. package/dist/src/review/review-types.js.map +1 -1
  207. package/dist/src/review/skill-materialization.d.ts +44 -9
  208. package/dist/src/review/skill-materialization.js +112 -136
  209. package/dist/src/review/skill-materialization.js.map +1 -1
  210. package/dist/src/review/source-binding.d.ts +8 -5
  211. package/dist/src/review/source-binding.js +99 -41
  212. package/dist/src/review/source-binding.js.map +1 -1
  213. package/dist/src/tui/agent-management.js +112 -10
  214. package/dist/src/tui/agent-management.js.map +1 -1
  215. package/dist/src/tui/agent-settings.d.ts +3 -0
  216. package/dist/src/tui/agent-settings.js +10 -11
  217. package/dist/src/tui/agent-settings.js.map +1 -1
  218. package/dist/src/tui/console-app-v4.js +58 -20
  219. package/dist/src/tui/console-app-v4.js.map +1 -1
  220. package/dist/src/tui/content-item-card.js +2 -2
  221. package/dist/src/tui/content-item-card.js.map +1 -1
  222. package/dist/src/tui/controller-runtime.js +198 -152
  223. package/dist/src/tui/controller-runtime.js.map +1 -1
  224. package/dist/src/tui/controller.d.ts +5 -9
  225. package/dist/src/tui/controller.js +40 -18
  226. package/dist/src/tui/controller.js.map +1 -1
  227. package/dist/src/tui/deployment-view.d.ts +10 -0
  228. package/dist/src/tui/deployment-view.js +91 -0
  229. package/dist/src/tui/deployment-view.js.map +1 -0
  230. package/dist/src/tui/glossary.js +4 -4
  231. package/dist/src/tui/glossary.js.map +1 -1
  232. package/dist/src/tui/model.d.ts +5 -0
  233. package/dist/src/tui/model.js +73 -12
  234. package/dist/src/tui/model.js.map +1 -1
  235. package/dist/src/tui/operation-diagnostic-screens.js +2 -1
  236. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  237. package/dist/src/tui/operation-history.d.ts +5 -4
  238. package/dist/src/tui/operation-history.js.map +1 -1
  239. package/dist/src/tui/operation-review-planner.d.ts +7 -2
  240. package/dist/src/tui/operation-review-planner.js +97 -42
  241. package/dist/src/tui/operation-review-planner.js.map +1 -1
  242. package/dist/src/tui/plugin-content.d.ts +5 -3
  243. package/dist/src/tui/plugin-content.js +70 -508
  244. package/dist/src/tui/plugin-content.js.map +1 -1
  245. package/dist/src/tui/plugin-detail.d.ts +3 -2
  246. package/dist/src/tui/plugin-detail.js +33 -25
  247. package/dist/src/tui/plugin-detail.js.map +1 -1
  248. package/dist/src/tui/scoped-inventory.d.ts +10 -6
  249. package/dist/src/tui/scoped-inventory.js +34 -1
  250. package/dist/src/tui/scoped-inventory.js.map +1 -1
  251. package/dist/src/types.d.ts +4 -63
  252. package/dist/src/types.js.map +1 -1
  253. package/dist/src/utils/agent-version.d.ts +10 -4
  254. package/dist/src/utils/agent-version.js.map +1 -1
  255. package/dist/src/utils/artifact-plan.d.ts +26 -2
  256. package/dist/src/utils/artifact-plan.js +113 -489
  257. package/dist/src/utils/artifact-plan.js.map +1 -1
  258. package/dist/src/utils/artifact-renderer.d.ts +100 -93
  259. package/dist/src/utils/artifact-renderer.js +173 -346
  260. package/dist/src/utils/artifact-renderer.js.map +1 -1
  261. package/dist/src/utils/artifact-request.d.ts +21 -11
  262. package/dist/src/utils/artifact-request.js +56 -80
  263. package/dist/src/utils/artifact-request.js.map +1 -1
  264. package/dist/src/utils/bundle-layout.js +30 -146
  265. package/dist/src/utils/bundle-layout.js.map +1 -1
  266. package/dist/src/utils/catalog-digests.d.ts +2 -12
  267. package/dist/src/utils/catalog-digests.js +0 -39
  268. package/dist/src/utils/catalog-digests.js.map +1 -1
  269. package/dist/src/utils/catalog-source-references.d.ts +7 -0
  270. package/dist/src/utils/catalog-source-references.js +234 -19
  271. package/dist/src/utils/catalog-source-references.js.map +1 -1
  272. package/dist/src/utils/codex-config-observation.d.ts +19 -0
  273. package/dist/src/utils/codex-config-observation.js +145 -0
  274. package/dist/src/utils/codex-config-observation.js.map +1 -0
  275. package/dist/src/utils/codex-executable-discovery.d.ts +2 -0
  276. package/dist/src/utils/codex-executable-discovery.js +47 -13
  277. package/dist/src/utils/codex-executable-discovery.js.map +1 -1
  278. package/dist/src/utils/codex-manager.js +1 -1
  279. package/dist/src/utils/codex-manager.js.map +1 -1
  280. package/dist/src/utils/codex-native-observation.d.ts +3 -0
  281. package/dist/src/utils/codex-native-observation.js +53 -0
  282. package/dist/src/utils/codex-native-observation.js.map +1 -1
  283. package/dist/src/utils/codex-shared-native.d.ts +3 -1
  284. package/dist/src/utils/codex-shared-native.js +46 -5
  285. package/dist/src/utils/codex-shared-native.js.map +1 -1
  286. package/dist/src/utils/codex-skill-staging.d.ts +4 -3
  287. package/dist/src/utils/codex-skill-staging.js.map +1 -1
  288. package/dist/src/utils/codex-surface-analysis.d.ts +5 -2
  289. package/dist/src/utils/codex-surface-analysis.js +28 -57
  290. package/dist/src/utils/codex-surface-analysis.js.map +1 -1
  291. package/dist/src/utils/component-command-preparation.d.ts +34 -0
  292. package/dist/src/utils/component-command-preparation.js +228 -0
  293. package/dist/src/utils/component-command-preparation.js.map +1 -0
  294. package/dist/src/utils/component-resources.d.ts +43 -0
  295. package/dist/src/utils/component-resources.js +304 -0
  296. package/dist/src/utils/component-resources.js.map +1 -0
  297. package/dist/src/utils/dynamic-skill-tree.d.ts +17 -6
  298. package/dist/src/utils/dynamic-skill-tree.js +7 -3
  299. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  300. package/dist/src/utils/local-marketplace.d.ts +11 -44
  301. package/dist/src/utils/local-marketplace.js +11 -638
  302. package/dist/src/utils/local-marketplace.js.map +1 -1
  303. package/dist/src/utils/managed-command-evidence.d.ts +2 -2
  304. package/dist/src/utils/managed-command-evidence.js +5 -81
  305. package/dist/src/utils/managed-command-evidence.js.map +1 -1
  306. package/dist/src/utils/managed-command-materialization.d.ts +5 -2
  307. package/dist/src/utils/managed-command-materialization.js +35 -35
  308. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  309. package/dist/src/utils/managed-command-preparation.d.ts +67 -0
  310. package/dist/src/utils/managed-command-preparation.js +146 -0
  311. package/dist/src/utils/managed-command-preparation.js.map +1 -0
  312. package/dist/src/utils/managed-command-review.d.ts +26 -0
  313. package/dist/src/utils/managed-command-review.js +68 -0
  314. package/dist/src/utils/managed-command-review.js.map +1 -0
  315. package/dist/src/utils/managed-command-store.js +26 -15
  316. package/dist/src/utils/managed-command-store.js.map +1 -1
  317. package/dist/src/utils/native-cli.d.ts +19 -0
  318. package/dist/src/utils/native-cli.js +45 -2
  319. package/dist/src/utils/native-cli.js.map +1 -1
  320. package/dist/src/utils/native-demand.d.ts +20 -1
  321. package/dist/src/utils/native-demand.js.map +1 -1
  322. package/dist/src/utils/native-tool-review.d.ts +3 -6
  323. package/dist/src/utils/native-tool-review.js +25 -11
  324. package/dist/src/utils/native-tool-review.js.map +1 -1
  325. package/dist/src/utils/ownership.d.ts +26 -3
  326. package/dist/src/utils/ownership.js +95 -9
  327. package/dist/src/utils/ownership.js.map +1 -1
  328. package/dist/src/utils/paths.d.ts +1 -1
  329. package/dist/src/utils/paths.js +2 -0
  330. package/dist/src/utils/paths.js.map +1 -1
  331. package/dist/src/utils/platform-empty-state.d.ts +46 -0
  332. package/dist/src/utils/platform-empty-state.js +123 -0
  333. package/dist/src/utils/platform-empty-state.js.map +1 -0
  334. package/dist/src/utils/plugin-config-impact.d.ts +17 -11
  335. package/dist/src/utils/plugin-config-impact.js +46 -62
  336. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  337. package/dist/src/utils/plugin-config-write.js +52 -53
  338. package/dist/src/utils/plugin-config-write.js.map +1 -1
  339. package/dist/src/utils/plugin-config.d.ts +0 -2
  340. package/dist/src/utils/plugin-config.js +0 -6
  341. package/dist/src/utils/plugin-config.js.map +1 -1
  342. package/dist/src/utils/plugin-dependencies.d.ts +1 -1
  343. package/dist/src/utils/plugin-dependencies.js.map +1 -1
  344. package/dist/src/utils/runtime-config.d.ts +5 -7
  345. package/dist/src/utils/runtime-config.js +12 -25
  346. package/dist/src/utils/runtime-config.js.map +1 -1
  347. package/dist/src/utils/windows-npm-shim.js +19 -2
  348. package/dist/src/utils/windows-npm-shim.js.map +1 -1
  349. package/package.json +3 -3
  350. package/dist/src/utils/claude-native-render-receipt.d.ts +0 -14
  351. package/dist/src/utils/claude-native-render-receipt.js +0 -26
  352. package/dist/src/utils/claude-native-render-receipt.js.map +0 -1
  353. package/dist/src/utils/claude-skills-root.d.ts +0 -8
  354. package/dist/src/utils/claude-skills-root.js +0 -87
  355. package/dist/src/utils/claude-skills-root.js.map +0 -1
  356. package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
  357. package/dist/src/utils/codex-native-render-receipt.js +0 -205
  358. package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
  359. package/dist/src/utils/slash-commands.d.ts +0 -1
  360. package/dist/src/utils/slash-commands.js +0 -2
  361. package/dist/src/utils/slash-commands.js.map +0 -1
@@ -2,11 +2,12 @@ import path from 'node:path';
2
2
  import { open } from 'node:fs/promises';
3
3
  import { stripVTControlCharacters } from 'node:util';
4
4
  import fs from 'fs-extra';
5
- import YAML from 'yaml';
5
+ import { isPlatformTarget } from '@lesliechan721/aw-plugin-core';
6
+ import { TARGET_DISPLAY_NAMES } from '../platforms/discovery.js';
6
7
  import { parseSkillFrontmatter } from '../utils/skill-validation.js';
7
8
  import { resolveSupportedPlatforms } from '../utils/platform-support.js';
8
9
  const MAX_FRONTMATTER_BYTES = 16 * 1024;
9
- const TOOL_ORDER = ['Codex', 'Claude Code', 'Agent Skills'];
10
+ const TOOL_ORDER = Object.values(TARGET_DISPLAY_NAMES);
10
11
  function safeSummary(description, short) {
11
12
  const safeDescription = stripVTControlCharacters(description)
12
13
  .replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/gu, ' ')
@@ -139,545 +140,106 @@ async function readFrontmatterDescription(root, skillFile) {
139
140
  await handle.close();
140
141
  }
141
142
  }
142
- async function readCodexCommandDescription(root, skillRoot) {
143
- const metadataFile = path.join(skillRoot, 'agents', 'openai.yaml');
144
- const safeFile = await regularPathWithin(root, metadataFile, 'file');
145
- if (!safeFile) {
146
- const code = await unconfirmedPathCode(root, metadataFile);
147
- return { description: null, issue: {
148
- code, message: 'Slash command 简介文件不可安全确认。请检查内容目录。',
149
- } };
150
- }
151
- let handle;
152
- try {
153
- handle = await open(safeFile, 'r');
154
- }
155
- catch {
156
- return { description: null, issue: {
157
- code: 'unreadable', message: 'Slash command 简介文件无法读取。请检查内容目录。',
158
- } };
159
- }
160
- try {
161
- const size = (await handle.stat()).size;
162
- if (size > MAX_FRONTMATTER_BYTES)
163
- return { description: null, issue: {
164
- code: 'invalidMetadata', message: 'Slash command 简介元信息超过读取预算。请检查内容文件。',
165
- } };
166
- const buffer = Buffer.alloc(size);
167
- let total = 0;
168
- while (total < size) {
169
- const { bytesRead } = await handle.read(buffer, total, size - total, total);
170
- if (bytesRead === 0)
171
- return { description: null, issue: {
172
- code: 'unreadable', message: 'Slash command 简介文件无法完整读取。请检查内容目录。',
173
- } };
174
- total += bytesRead;
175
- }
176
- let metadata;
177
- try {
178
- const document = YAML.parseDocument(buffer.toString('utf8'), { prettyErrors: false });
179
- if (document.errors.length > 0)
180
- throw new Error('Invalid YAML');
181
- metadata = document.toJS({ maxAliasCount: 0 });
182
- }
183
- catch {
184
- return { description: null, issue: {
185
- code: 'invalidMetadata', message: 'Slash command 简介元信息无法解析。请检查内容文件。',
186
- } };
187
- }
188
- if (!isRecord(metadata) || (metadata.interface !== undefined && !isRecord(metadata.interface))) {
189
- return { description: null, issue: {
190
- code: 'invalidMetadata', message: 'Slash command 简介元信息无效。请检查内容文件。',
191
- } };
192
- }
193
- const short = isRecord(metadata.interface) ? metadata.interface.short_description : undefined;
194
- if (short === undefined)
195
- return { description: null };
196
- if (typeof short !== 'string' || !short.trim())
197
- return { description: null, issue: {
198
- code: 'invalidMetadata', message: 'Slash command 简短用途元信息无效。请检查内容文件。',
199
- } };
200
- const description = safeSummary(short, true);
201
- return description ? { description } : { description: null, issue: {
202
- code: 'invalidMetadata', message: 'Slash command 简短用途元信息无效。请检查内容文件。',
203
- } };
204
- }
205
- catch {
206
- return { description: null, issue: {
207
- code: 'unreadable', message: 'Slash command 简介文件无法读取。请检查内容目录。',
208
- } };
209
- }
210
- finally {
211
- await handle.close();
212
- }
213
- }
214
143
  function addItem(items, item) {
215
- const key = `${item.type}:${item.name}`;
216
- const current = items.get(key);
217
- if (!current) {
218
- items.set(key, item);
219
- return;
220
- }
221
- current.tools = sortTools([...current.tools, ...item.tools]);
222
- if (current.description === null && item.description !== null)
223
- current.description = item.description;
224
- if (item.issue) {
225
- current.descriptionState = 'issue';
226
- current.issue = item.issue;
227
- }
228
- else if (current.descriptionState !== 'issue' && current.description !== null) {
229
- current.descriptionState = 'available';
230
- }
144
+ items.set(item.id, { ...item, tools: sortTools(item.tools) });
231
145
  }
232
- function addCoverageIssue(issues, issue) {
233
- issues.push(issue);
234
- }
235
- async function addSkillDirectory(options) {
236
- const directory = await regularPathWithin(options.root, path.join(options.root, options.relativePath), 'directory');
146
+ async function addSkills(root, relativePath, tools, items, issues) {
147
+ const requested = path.join(root, relativePath);
148
+ const directory = await regularPathWithin(root, requested, 'directory');
237
149
  if (!directory) {
238
- const code = await unconfirmedPathCode(options.root, path.join(options.root, options.relativePath));
239
- addCoverageIssue(options.coverageIssues, {
240
- code, message: `${options.tool} Skill 清单无法确认。请检查目录。`,
241
- });
150
+ issues.push({ code: await unconfirmedPathCode(root, requested), message: '静态 Skill 清单无法安全确认。请检查来源目录。' });
242
151
  return;
243
152
  }
244
- let entries;
245
- try {
246
- entries = await fs.readdir(directory, { withFileTypes: true });
247
- }
248
- catch {
249
- addCoverageIssue(options.coverageIssues, {
250
- code: 'unreadable', message: `${options.tool} Skill 清单无法读取。请检查目录后重试。`,
251
- });
153
+ const entries = await fs.readdir(directory, { withFileTypes: true }).catch(() => undefined);
154
+ if (!entries) {
155
+ issues.push({ code: 'unreadable', message: '静态 Skill 清单无法读取。' });
252
156
  return;
253
157
  }
254
158
  for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
255
159
  if (entry.isSymbolicLink()) {
256
- addCoverageIssue(options.coverageIssues, {
257
- code: 'unsafePath', message: `${options.tool} Skill 清单含不安全路径。请检查目录。`,
258
- });
160
+ issues.push({ code: 'unsafePath', message: '静态 Skill 目录含不安全的符号链接。' });
259
161
  continue;
260
162
  }
261
163
  if (!entry.isDirectory())
262
164
  continue;
263
- const skillRoot = await regularPathWithin(options.root, path.join(directory, entry.name), 'directory');
264
- if (!skillRoot) {
265
- const code = await unconfirmedPathCode(options.root, path.join(directory, entry.name));
266
- addCoverageIssue(options.coverageIssues, {
267
- code, message: `${options.tool} Skill 清单含无法确认的条目。请检查目录。`,
268
- });
269
- continue;
270
- }
271
- if (options.tool === 'Codex'
272
- && options.items.get(`command:${entry.name}`)?.tools.includes('Codex'))
273
- continue;
274
- const skillFile = path.join(skillRoot, 'SKILL.md');
275
- const hasClaudeCommand = options.items.has(`command:${entry.name}`);
276
- const hasClaudeSkill = options.checkClaudeCommand
277
- && options.items.get(`skill:${entry.name}`)?.tools.includes('Claude Code')
278
- && await regularPathWithin(options.root, path.join(options.root, 'claude', 'skills', entry.name, 'SKILL.md'), 'file');
279
- const uncertainSource = options.checkClaudeCommand && !hasClaudeCommand && !hasClaudeSkill;
280
- const skill = options.readDescription === false || (uncertainSource && options.type !== 'command')
281
- ? { exists: Boolean(await regularPathWithin(options.root, skillFile, 'file')), description: null }
282
- : await readFrontmatterDescription(options.root, skillFile);
165
+ const skillFile = path.join(directory, entry.name, 'SKILL.md');
166
+ const skill = await readFrontmatterDescription(root, skillFile);
283
167
  let issue = skill.issue;
284
168
  if (!skill.exists) {
285
- const code = await unconfirmedPathCode(options.root, skillFile);
169
+ const code = await unconfirmedPathCode(root, skillFile);
286
170
  if (code === 'incompleteList') {
287
- addCoverageIssue(options.coverageIssues, {
288
- code, message: `${options.tool} Skill 清单有无法确认的条目。请检查目录。`,
289
- });
171
+ issues.push({ code, message: '静态 Skill 目录存在未完成的条目。' });
290
172
  continue;
291
173
  }
292
- issue = { code, message: 'Skill 元信息文件不可安全读取。请检查内容目录后重试。' };
293
- }
294
- const type = options.type === 'command' && issue?.code === 'unsafePath'
295
- ? 'skill' : options.type ?? 'skill';
296
- if (uncertainSource) {
297
- addCoverageIssue(options.coverageIssues, {
298
- code: 'incompleteList',
299
- message: options.type === 'command'
300
- ? 'Slash command 的 Claude Code 组件无法确认。请检查内容目录。'
301
- : 'Codex 内容名称已确认,但缺少可安全确认的 Claude Code 对应项,不能区分普通 Skill 与 Slash command。请检查内容目录。',
302
- });
174
+ issue = { code, message: 'Skill 元信息文件不可安全读取。请检查来源目录。' };
303
175
  }
304
- const command = type === 'command' && skill.exists
305
- ? await readCodexCommandDescription(options.root, skillRoot) : undefined;
306
- issue ??= command?.issue;
307
- const description = command?.description ?? skill.description;
308
- addItem(options.items, {
309
- id: `${type}:${entry.name}`,
310
- name: entry.name,
311
- type,
312
- description,
313
- tools: [options.tool],
314
- descriptionState: issue ? 'issue' : description ? 'available' : 'absent',
315
- ...(issue ? { issue } : {}),
316
- });
176
+ addItem(items, { id: `skill:${entry.name}`, name: entry.name, type: 'skill', description: skill.description, tools,
177
+ descriptionState: issue ? 'issue' : skill.description ? 'available' : 'absent', ...(issue ? { issue } : {}) });
317
178
  }
318
179
  }
319
- async function addJsonComponents(options) {
320
- const file = await regularPathWithin(options.root, path.join(options.root, options.relativePath), 'file');
180
+ async function addMcp(root, relativePath, tools, items, issues) {
181
+ const requested = path.join(root, relativePath);
182
+ const file = await regularPathWithin(root, requested, 'file');
321
183
  if (!file) {
322
- const code = await unconfirmedPathCode(options.root, path.join(options.root, options.relativePath));
323
- addCoverageIssue(options.coverageIssues, {
324
- code, message: `${options.tool} ${options.type} 清单无法确认。请检查目录。`,
325
- });
326
- return;
327
- }
328
- let value;
329
- try {
330
- value = await fs.readJson(file);
331
- }
332
- catch {
333
- addCoverageIssue(options.coverageIssues, {
334
- code: 'unreadable', message: `${options.tool} ${options.type} 清单无法读取。请检查内容文件。`,
335
- });
184
+ issues.push({ code: await unconfirmedPathCode(root, requested), message: '静态 MCP 清单无法安全确认。' });
336
185
  return;
337
186
  }
338
- const collection = isRecord(value) ? value[options.property] : undefined;
339
- if (!isRecord(collection)) {
340
- addCoverageIssue(options.coverageIssues, {
341
- code: 'incompleteList', message: `${options.tool} ${options.type} 清单格式无效。请检查内容文件。`,
342
- });
187
+ const value = await fs.readJson(file).catch(() => undefined);
188
+ if (!isRecord(value) || !isRecord(value.mcpServers)) {
189
+ issues.push({ code: 'invalidMetadata', message: '静态 MCP 清单无法读取或格式无效。' });
343
190
  return;
344
191
  }
345
- const entries = Object.keys(collection).sort();
346
- for (const name of entries) {
347
- addItem(options.items, {
348
- id: `${options.type}:${name}`,
349
- name,
350
- type: options.type,
351
- description: null,
352
- tools: [options.tool],
353
- descriptionState: 'absent',
354
- });
355
- }
192
+ for (const name of Object.keys(value.mcpServers).sort())
193
+ addItem(items, { id: `mcpServer:${name}`, name,
194
+ type: 'mcpServer', description: null, tools, descriptionState: 'absent' });
356
195
  }
357
- async function addSlashCommands(options) {
358
- const directory = await regularPathWithin(options.root, path.join(options.root, 'claude', 'commands'), 'directory');
359
- if (!directory) {
360
- const code = await unconfirmedPathCode(options.root, path.join(options.root, 'claude', 'commands'));
361
- addCoverageIssue(options.coverageIssues, {
362
- code, message: 'Slash command 清单无法确认。请检查目录。',
363
- });
364
- return;
365
- }
366
- let entries;
367
- try {
368
- entries = await fs.readdir(directory, { withFileTypes: true });
369
- }
370
- catch {
371
- addCoverageIssue(options.coverageIssues, {
372
- code: 'unreadable', message: 'Slash command 清单无法读取。请检查目录后重试。',
373
- });
374
- return;
375
- }
376
- for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
377
- if (path.extname(entry.name) !== '.md')
378
- continue;
379
- if (entry.isSymbolicLink() || !entry.isFile()) {
380
- addCoverageIssue(options.coverageIssues, {
381
- code: 'unsafePath', message: 'Slash command 清单含无法确认的条目。请检查目录。',
382
- });
383
- continue;
384
- }
385
- if (!await regularPathWithin(options.root, path.join(directory, entry.name), 'file')) {
386
- addCoverageIssue(options.coverageIssues, {
387
- code: 'unsafePath', message: 'Slash command 清单含不安全路径。请检查目录。',
388
- });
389
- continue;
390
- }
391
- const name = path.basename(entry.name, '.md');
392
- const tools = ['Claude Code'];
393
- const codexSkillFile = path.join(options.root, 'codex', 'skills', name, 'SKILL.md');
394
- const codexCommand = options.hasCodex
395
- && await regularPathWithin(options.root, codexSkillFile, 'file');
396
- if (options.hasCodex && !codexCommand) {
397
- const code = await unconfirmedPathCode(options.root, codexSkillFile);
398
- addCoverageIssue(options.coverageIssues, {
399
- code, message: 'Slash command 的 Codex 组件无法安全确认。请检查内容目录。',
400
- });
401
- }
402
- if (options.hasCodex && !codexCommand && await fs.lstat(codexSkillFile).catch(() => undefined)) {
403
- if (await regularPathWithin(options.root, path.dirname(codexSkillFile), 'directory')) {
404
- addItem(options.items, {
405
- id: `skill:${name}`,
406
- name,
407
- type: 'skill',
408
- description: null,
409
- tools: ['Codex'],
410
- descriptionState: 'issue',
411
- issue: { code: 'unsafePath', message: 'Skill 元信息文件不可安全读取。请检查内容目录后重试。' },
412
- });
413
- }
414
- }
415
- const command = await readFrontmatterDescription(options.root, path.join(directory, entry.name));
416
- const codexDescription = codexCommand
417
- ? await readCodexCommandDescription(options.root, path.dirname(codexSkillFile)) : undefined;
418
- const description = codexDescription?.description ?? command.description;
419
- const issue = codexDescription?.issue ?? command.issue;
420
- if (codexCommand)
421
- tools.unshift('Codex');
422
- addItem(options.items, {
423
- id: `command:${name}`,
424
- name,
425
- type: 'command',
426
- description,
427
- tools,
428
- descriptionState: issue ? 'issue' : description ? 'available' : 'absent',
429
- ...(issue ? { issue } : {}),
430
- });
431
- }
432
- }
433
- function targetTool(target) {
434
- if (target.startsWith('codex.'))
435
- return 'Codex';
436
- if (target.startsWith('claude.'))
437
- return 'Claude Code';
438
- if (target.startsWith('agent-skills.'))
439
- return 'Agent Skills';
440
- return null;
441
- }
442
- function targetType(target) {
443
- if (target.endsWith('.skill'))
444
- return 'skill';
445
- if (target === 'codex.agentRole')
446
- return 'role';
447
- if (target === 'codex.developerInstructionsBlock')
448
- return 'instruction';
449
- return null;
450
- }
451
- function toolsForOverrides(tools, overrides) {
452
- return tools.filter((tool) => {
453
- if (tool === 'Codex')
454
- return overrides?.codex !== null;
455
- if (tool === 'Claude Code')
456
- return overrides?.claude !== null;
457
- return true;
458
- });
459
- }
460
- async function projectedPlatforms(root) {
461
- const tools = [];
462
- if (await regularPathWithin(root, path.join(root, '.codex-plugin', 'plugin.json'), 'file'))
463
- tools.push('Codex');
464
- if (await regularPathWithin(root, path.join(root, '.claude-plugin', 'plugin.json'), 'file'))
465
- tools.push('Claude Code');
466
- return tools;
196
+ function declaredTools(platforms, overrides) {
197
+ return platforms.filter((platform) => overrides?.[platform] !== null).map((platform) => TARGET_DISPLAY_NAMES[platform]);
467
198
  }
199
+ /** Catalog content describes source declarations. Native package output is prepared per client and configuration. */
468
200
  export async function projectPluginContentOverview(options) {
469
- let root;
470
- try {
471
- root = await fs.realpath(options.plugin.rootDir);
472
- }
473
- catch {
474
- const message = '当前无法安全读取这个插件的目录内容。请检查来源状态后重试。';
475
- return {
476
- pluginId: options.pluginId,
477
- pluginVersion: options.plugin.manifest.version,
478
- catalogVersion: options.catalogVersion,
479
- evidence: 'unavailable',
480
- items: [],
481
- notices: [message],
482
- coverage: 'unavailable',
483
- coverageIssue: { code: 'unreadable', message },
484
- };
485
- }
201
+ const root = await fs.realpath(options.plugin.rootDir).catch(() => undefined);
202
+ if (!root) {
203
+ const message = '当前无法安全读取这个插件的来源内容。请检查来源状态后重试。';
204
+ return { pluginId: options.pluginId, pluginVersion: options.plugin.manifest.version, catalogVersion: options.catalogVersion,
205
+ evidence: 'unavailable', items: [], notices: [message], coverage: 'unavailable', coverageIssue: { code: 'unreadable', message } };
206
+ }
207
+ const manifest = options.plugin.manifest;
208
+ const platforms = [...resolveSupportedPlatforms(manifest)];
209
+ const tools = declaredTools(platforms);
486
210
  const items = new Map();
487
- const coverageIssues = [];
488
- const platforms = await projectedPlatforms(root);
489
- const supportedPlatforms = resolveSupportedPlatforms(options.plugin.manifest);
490
- for (const [platform, tool] of [
491
- ['codex', 'Codex'], ['claude', 'Claude Code'],
492
- ]) {
493
- if (!supportedPlatforms.has(platform) || platforms.includes(tool))
494
- continue;
495
- const marker = path.join(root, `.${platform}-plugin`, 'plugin.json');
496
- const code = await unconfirmedPathCode(root, marker);
497
- addCoverageIssue(coverageIssues, {
498
- code, message: `${tool} 平台清单无法安全确认。请检查目录。`,
499
- });
500
- }
501
- const codexOnlyCommands = Boolean(options.plugin.manifest.slashCommands)
502
- && platforms.includes('Codex') && !platforms.includes('Claude Code');
503
- const mixedCodexSkills = Boolean(options.plugin.manifest.slashCommands)
504
- && platforms.includes('Codex')
505
- && Boolean(options.plugin.manifest.skills || options.plugin.manifest.buildConfig?.fileRules?.codex);
506
- if (mixedCodexSkills && codexOnlyCommands) {
507
- addCoverageIssue(coverageIssues, {
508
- code: 'incompleteList',
509
- message: 'Codex 内容名称已确认,但当前目录不能安全区分普通 Skill 与 Slash command。请查看来源定义。',
510
- });
511
- }
512
- if (options.plugin.manifest.slashCommands && platforms.includes('Claude Code')) {
513
- await addSlashCommands({
514
- root,
515
- hasCodex: platforms.includes('Codex'),
516
- items,
517
- coverageIssues,
518
- });
519
- }
520
- if (options.plugin.manifest.skills) {
521
- if (platforms.includes('Claude Code')) {
522
- await addSkillDirectory({
523
- root, relativePath: 'claude/skills', tool: 'Claude Code', items, coverageIssues,
524
- });
525
- }
526
- if (platforms.includes('Codex')) {
527
- await addSkillDirectory({
528
- root, relativePath: 'codex/skills', tool: 'Codex', items, coverageIssues,
529
- ...(codexOnlyCommands ? { readDescription: false } : {}),
530
- checkClaudeCommand: Boolean(options.plugin.manifest.slashCommands)
531
- && platforms.includes('Claude Code'),
532
- });
533
- }
534
- }
535
- if (codexOnlyCommands && !options.plugin.manifest.skills) {
536
- await addSkillDirectory({
537
- root, relativePath: 'codex/skills', tool: 'Codex', items, coverageIssues,
538
- type: mixedCodexSkills ? 'skill' : 'command',
539
- readDescription: false,
540
- });
541
- }
542
- if (options.plugin.manifest.slashCommands && platforms.includes('Codex')
543
- && platforms.includes('Claude Code') && !options.plugin.manifest.skills) {
544
- await addSkillDirectory({
545
- root, relativePath: 'codex/skills', tool: 'Codex', items, coverageIssues,
546
- type: mixedCodexSkills ? 'skill' : 'command',
547
- readDescription: false,
548
- checkClaudeCommand: true,
549
- });
550
- }
551
- for (const target of resolveSupportedPlatforms(options.plugin.manifest)) {
552
- if (target === 'codex' || target === 'claude')
211
+ const issues = [];
212
+ if (manifest.skills)
213
+ await addSkills(root, manifest.skills, tools, items, issues);
214
+ if (manifest.mcpServers)
215
+ await addMcp(root, manifest.mcpServers, tools, items, issues);
216
+ for (const agent of manifest.extensions?.agents ?? [])
217
+ addItem(items, { id: `agent:${agent.name}`, name: agent.name, type: 'agent',
218
+ description: safeSummary(agent.description, true), tools: declaredTools(platforms, agent.agentOverrides), descriptionState: agent.description.trim() ? 'available' : 'absent' });
219
+ for (const instruction of manifest.extensions?.instructions ?? [])
220
+ addItem(items, { id: `instruction:${instruction.name}`,
221
+ name: instruction.title, type: 'instruction', description: null, tools: declaredTools(platforms, instruction.agentOverrides), descriptionState: 'absent' });
222
+ for (const permission of manifest.extensions?.permissions ?? [])
223
+ addItem(items, { id: `permission:${permission.name}`, name: permission.name,
224
+ type: 'permission', description: null, tools: declaredTools(platforms, permission.agentOverrides), descriptionState: 'absent' });
225
+ for (const hook of manifest.extensions?.hooks ?? [])
226
+ addItem(items, { id: `hook:${hook.id}`, name: hook.matcher ? `${hook.event} · ${hook.matcher}` : hook.event,
227
+ type: 'hook', description: null, tools: declaredTools(platforms, hook.agentOverrides), descriptionState: 'absent' });
228
+ for (const [platform, hooks] of Object.entries(manifest.extensions?.nativeHooks ?? {})) {
229
+ if (!isPlatformTarget(platform) || !platforms.includes(platform))
553
230
  continue;
554
- if (options.plugin.manifest.skills)
555
- await addSkillDirectory({
556
- root, relativePath: `${target}/skills`, tool: 'Agent Skills', items, coverageIssues,
557
- });
231
+ for (const hook of hooks ?? [])
232
+ addItem(items, { id: `hook:${platform}:${hook.id}`, name: hook.matcher ? `${hook.event} · ${hook.matcher}` : hook.event,
233
+ type: 'hook', description: null, tools: [TARGET_DISPLAY_NAMES[platform]], descriptionState: 'absent' });
558
234
  }
559
- if (options.plugin.manifest.mcpServers) {
560
- for (const tool of platforms) {
561
- await addJsonComponents({
562
- root,
563
- relativePath: `${tool === 'Codex' ? 'codex' : 'claude'}/${options.plugin.manifest.mcpServers.replace(/^\.\//u, '')}`,
564
- property: 'mcpServers',
565
- type: 'mcpServer',
566
- tool,
567
- items,
568
- coverageIssues,
569
- });
570
- }
571
- }
572
- if (options.plugin.manifest.apps && platforms.includes('Codex')) {
573
- await addJsonComponents({
574
- root,
575
- relativePath: `codex/${options.plugin.manifest.apps.replace(/^\.\//u, '')}`,
576
- property: 'apps',
577
- type: 'app',
578
- tool: 'Codex',
579
- items,
580
- coverageIssues,
581
- });
582
- }
583
- for (const agent of options.plugin.manifest.extensions?.agents ?? []) {
584
- addItem(items, {
585
- id: `agent:${agent.name}`,
586
- name: agent.name,
587
- type: 'agent',
588
- description: agent.description.trim() || null,
589
- tools: toolsForOverrides(platforms, agent.agentOverrides),
590
- descriptionState: agent.description.trim() ? 'available' : 'absent',
591
- });
592
- }
593
- for (const instruction of options.plugin.manifest.extensions?.instructions ?? []) {
594
- addItem(items, {
595
- id: `instruction:${instruction.name}`,
596
- name: instruction.title,
597
- type: 'instruction',
598
- description: null,
599
- tools: toolsForOverrides(platforms, instruction.agentOverrides),
600
- descriptionState: 'absent',
601
- });
602
- }
603
- for (const permission of options.plugin.manifest.extensions?.permissions ?? []) {
604
- addItem(items, {
605
- id: `permission:${permission.name}`,
606
- name: permission.name,
607
- type: 'permission',
608
- description: null,
609
- tools: toolsForOverrides(platforms, permission.agentOverrides),
610
- descriptionState: 'absent',
611
- });
612
- }
613
- for (const hook of options.plugin.manifest.extensions?.hooks ?? []) {
614
- const name = hook.matcher ? `${hook.event} · ${hook.matcher}` : hook.event;
615
- addItem(items, {
616
- id: `hook:${hook.event}:${hook.matcher ?? ''}`,
617
- name,
618
- type: 'hook',
619
- description: null,
620
- tools: toolsForOverrides(platforms, hook.agentOverrides),
621
- descriptionState: 'absent',
622
- });
623
- }
624
- for (const [platform, hooks] of Object.entries(options.plugin.manifest.extensions?.nativeHooks ?? {})) {
625
- const tool = platform === 'codex' ? 'Codex' : 'Claude Code';
626
- for (const hook of hooks ?? []) {
627
- const name = hook.matcher ? `${hook.event} · ${hook.matcher}` : hook.event;
628
- addItem(items, {
629
- id: `hook:${platform}:${hook.event}:${hook.matcher ?? ''}`,
630
- name,
631
- type: 'hook',
632
- description: null,
633
- tools: [tool],
634
- descriptionState: 'absent',
635
- });
636
- }
637
- }
638
- for (const target of options.plugin.manifest.artifacts?.targets ?? []) {
639
- const tool = targetTool(target.target);
640
- const type = targetType(target.target);
641
- if (!tool || !type)
642
- continue;
643
- const name = target.skillKey ?? target.roleKey ?? target.id;
644
- let description = null;
645
- let issue;
646
- if (type === 'skill' && target.platform) {
647
- const skill = await readFrontmatterDescription(root, path.join(root, '.agents-plugin', 'artifact-sources', target.platform, target.id, '0', 'SKILL.md'));
648
- description = skill.description;
649
- issue = skill.issue;
650
- if (!skill.exists) {
651
- const code = await unconfirmedPathCode(root, path.join(root, '.agents-plugin', 'artifact-sources', target.platform, target.id, '0', 'SKILL.md'));
652
- if (code !== 'incompleteList')
653
- issue = {
654
- code, message: '简介文件不可安全读取。请检查内容目录。',
655
- };
656
- }
657
- }
658
- addItem(items, {
659
- id: `artifact:${target.id}`,
660
- name,
661
- type,
662
- description,
663
- tools: [tool],
664
- descriptionState: issue ? 'issue' : description ? 'available' : 'absent',
665
- ...(issue ? { issue } : {}),
666
- });
235
+ if (manifest.scripts?.artifacts?.render) {
236
+ addItem(items, { id: 'renderer:components', name: '动态组件', type: 'renderer', tools,
237
+ description: '组件名称、类别和数量由配置及平台能力决定;准备安装后可查看本次实际集合。', descriptionState: 'available' });
238
+ issues.push({ code: 'incompleteList', message: '此列表只显示静态声明。动态组件集合尚未准备,不能据此判断完整组件数量。' });
667
239
  }
668
240
  const result = [...items.values()].sort((left, right) => left.type.localeCompare(right.type) || left.name.localeCompare(right.name));
669
- const coverage = coverageIssues.length === 0
670
- ? 'complete' : result.length > 0 ? 'partial' : 'unavailable';
671
- const notices = [...new Set(coverageIssues.map((issue) => issue.message))];
672
- return {
673
- pluginId: options.pluginId,
674
- pluginVersion: options.plugin.manifest.version,
675
- catalogVersion: options.catalogVersion,
676
- evidence: 'catalogBundle',
677
- items: result,
678
- notices,
679
- coverage,
680
- ...(coverageIssues[0] ? { coverageIssue: coverageIssues[0] } : {}),
681
- };
241
+ return { pluginId: options.pluginId, pluginVersion: manifest.version, catalogVersion: options.catalogVersion, evidence: 'catalogBundle',
242
+ items: result, notices: ['内容来自作者静态声明;平台标签不证明客户端已安装或已加载。', ...new Set(issues.map((issue) => issue.message))],
243
+ coverage: issues.length ? result.length ? 'partial' : 'unavailable' : 'complete', ...(issues[0] ? { coverageIssue: issues[0] } : {}) };
682
244
  }
683
245
  //# sourceMappingURL=plugin-content.js.map