@lesliechan721/aw 0.1.0-beta.73 → 0.1.0-beta.75
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.
- package/dist/authoring/assets/aw-runtime-config.mjs +65 -43
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
- package/dist/authoring/scripts/add-skill.mjs +5 -14
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +4 -28
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +2 -2
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +0 -1
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +234 -1422
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
- package/dist/scripts/aw-skill-eval-materializer.js +19 -80
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.js +6 -8
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +2 -2
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/dependency-operation-plan.js +3 -3
- package/dist/src/commands/dependency-operation-plan.js.map +1 -1
- package/dist/src/commands/deployment-confirmation.d.ts +4 -0
- package/dist/src/commands/deployment-confirmation.js +20 -0
- package/dist/src/commands/deployment-confirmation.js.map +1 -0
- package/dist/src/commands/managed-commands.js +4 -2
- package/dist/src/commands/managed-commands.js.map +1 -1
- package/dist/src/commands/offline-cleanup-evidence.d.ts +3 -1
- package/dist/src/commands/offline-cleanup-evidence.js +9 -4
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +6 -0
- package/dist/src/commands/operation-plan.js +29 -2
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/options.d.ts +6 -2
- package/dist/src/commands/options.js +5 -4
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +29 -41
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.js +5 -5
- package/dist/src/commands/public-config-confirmation.js.map +1 -1
- package/dist/src/commands/public-lifecycle-result.d.ts +47 -0
- package/dist/src/commands/public-lifecycle-result.js +125 -4
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.d.ts +1 -0
- package/dist/src/commands/public-lifecycle.js +15 -2
- package/dist/src/commands/public-lifecycle.js.map +1 -1
- package/dist/src/commands/public-plugin-query.d.ts +1 -0
- package/dist/src/commands/public-plugin-query.js +27 -8
- package/dist/src/commands/public-plugin-query.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +12 -11
- package/dist/src/commands/rebuild-command.js +531 -769
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +21 -43
- package/dist/src/commands/rebuild-integration.js +306 -3600
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +13 -0
- package/dist/src/commands/rebuild-operations.js +60 -15
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +60 -0
- package/dist/src/commands/rebuild-platform-integration.js +1264 -0
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
- package/dist/src/commands/review-inspection.js +41 -4
- package/dist/src/commands/review-inspection.js.map +1 -1
- package/dist/src/commands/review-preparation.d.ts +2 -0
- package/dist/src/commands/review-preparation.js +23 -60
- package/dist/src/commands/review-preparation.js.map +1 -1
- package/dist/src/commands/skill-eval.js +1 -0
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +3 -1
- package/dist/src/commands/status-v6.js +24 -15
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/commands/targets-command.d.ts +9 -0
- package/dist/src/commands/targets-command.js +57 -6
- package/dist/src/commands/targets-command.js.map +1 -1
- package/dist/src/commands/write-commands.js +43 -28
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +2 -2
- package/dist/src/constants.js +2 -2
- package/dist/src/constants.js.map +1 -1
- package/dist/src/generators/local-plugin.js +59 -248
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.js +40 -14
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/command-receipt.d.ts +1 -1
- package/dist/src/output/command-receipt.js +3 -1
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/native-consent.d.ts +2 -0
- package/dist/src/output/native-consent.js +5 -0
- package/dist/src/output/native-consent.js.map +1 -0
- package/dist/src/output/public-result.js +72 -0
- package/dist/src/output/public-result.js.map +1 -1
- package/dist/src/output/rebuild-progress.js +5 -5
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.js +19 -2
- package/dist/src/output/receipt-projection.js.map +1 -1
- package/dist/src/platforms/capabilities.d.ts +10 -0
- package/dist/src/platforms/capabilities.js +158 -0
- package/dist/src/platforms/capabilities.js.map +1 -0
- package/dist/src/platforms/contracts.d.ts +351 -0
- package/dist/src/platforms/contracts.js +2 -0
- package/dist/src/platforms/contracts.js.map +1 -0
- package/dist/src/platforms/cursor-workspace-hook.d.ts +22 -0
- package/dist/src/platforms/cursor-workspace-hook.js +185 -0
- package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
- package/dist/src/platforms/discovery.d.ts +80 -0
- package/dist/src/platforms/discovery.js +604 -0
- package/dist/src/platforms/discovery.js.map +1 -0
- package/dist/src/platforms/gemini-activation.d.ts +36 -0
- package/dist/src/platforms/gemini-activation.js +331 -0
- package/dist/src/platforms/gemini-activation.js.map +1 -0
- package/dist/src/platforms/gemini-consent.d.ts +8 -0
- package/dist/src/platforms/gemini-consent.js +79 -0
- package/dist/src/platforms/gemini-consent.js.map +1 -0
- package/dist/src/platforms/identity.d.ts +4 -0
- package/dist/src/platforms/identity.js +22 -0
- package/dist/src/platforms/identity.js.map +1 -0
- package/dist/src/platforms/inspection-grok.d.ts +4 -0
- package/dist/src/platforms/inspection-grok.js +204 -0
- package/dist/src/platforms/inspection-grok.js.map +1 -0
- package/dist/src/platforms/inspection-native.d.ts +6 -0
- package/dist/src/platforms/inspection-native.js +401 -0
- package/dist/src/platforms/inspection-native.js.map +1 -0
- package/dist/src/platforms/inspection-opencode.d.ts +4 -0
- package/dist/src/platforms/inspection-opencode.js +97 -0
- package/dist/src/platforms/inspection-opencode.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +3 -0
- package/dist/src/platforms/inspection-pi.js +287 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection-query.d.ts +5 -0
- package/dist/src/platforms/inspection-query.js +36 -0
- package/dist/src/platforms/inspection-query.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +13 -0
- package/dist/src/platforms/inspection.js +180 -0
- package/dist/src/platforms/inspection.js.map +1 -0
- package/dist/src/platforms/layout.d.ts +21 -0
- package/dist/src/platforms/layout.js +239 -0
- package/dist/src/platforms/layout.js.map +1 -0
- package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
- package/dist/src/platforms/lifecycle-native-services.js +147 -0
- package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
- package/dist/src/platforms/lifecycle-native.d.ts +13 -0
- package/dist/src/platforms/lifecycle-native.js +276 -0
- package/dist/src/platforms/lifecycle-native.js.map +1 -0
- package/dist/src/platforms/lifecycle.d.ts +25 -0
- package/dist/src/platforms/lifecycle.js +470 -0
- package/dist/src/platforms/lifecycle.js.map +1 -0
- package/dist/src/platforms/managed-command-placement.d.ts +8 -0
- package/dist/src/platforms/managed-command-placement.js +79 -0
- package/dist/src/platforms/managed-command-placement.js.map +1 -0
- package/dist/src/platforms/projection-code-extension.d.ts +8 -0
- package/dist/src/platforms/projection-code-extension.js +121 -0
- package/dist/src/platforms/projection-code-extension.js.map +1 -0
- package/dist/src/platforms/projection-command-resources.d.ts +7 -0
- package/dist/src/platforms/projection-command-resources.js +74 -0
- package/dist/src/platforms/projection-command-resources.js.map +1 -0
- package/dist/src/platforms/projection-files.d.ts +27 -0
- package/dist/src/platforms/projection-files.js +111 -0
- package/dist/src/platforms/projection-files.js.map +1 -0
- package/dist/src/platforms/projection-marketplace.d.ts +19 -0
- package/dist/src/platforms/projection-marketplace.js +42 -0
- package/dist/src/platforms/projection-marketplace.js.map +1 -0
- package/dist/src/platforms/projection.d.ts +10 -0
- package/dist/src/platforms/projection.js +446 -0
- package/dist/src/platforms/projection.js.map +1 -0
- package/dist/src/platforms/registry.d.ts +4 -0
- package/dist/src/platforms/registry.js +30 -0
- package/dist/src/platforms/registry.js.map +1 -0
- package/dist/src/platforms/supplement-layout.d.ts +16 -0
- package/dist/src/platforms/supplement-layout.js +31 -0
- package/dist/src/platforms/supplement-layout.js.map +1 -0
- package/dist/src/portable/commands.d.ts +7 -5
- package/dist/src/portable/commands.js +6 -1
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +8 -6
- package/dist/src/portable/materializer.js +47 -245
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.js +2 -15
- package/dist/src/portable/recovery-layout.js.map +1 -1
- package/dist/src/portable/recovery.d.ts +10 -1
- package/dist/src/portable/recovery.js +34 -8
- package/dist/src/portable/recovery.js.map +1 -1
- package/dist/src/recovery/coordinator.d.ts +4 -7
- package/dist/src/recovery/coordinator.js +151 -119
- package/dist/src/recovery/coordinator.js.map +1 -1
- package/dist/src/recovery/demand.d.ts +1 -1
- package/dist/src/recovery/demand.js +10 -42
- package/dist/src/recovery/demand.js.map +1 -1
- package/dist/src/recovery/joint-coordinator.js +112 -52
- package/dist/src/recovery/joint-coordinator.js.map +1 -1
- package/dist/src/recovery/joint-demand.d.ts +4 -22
- package/dist/src/recovery/joint-demand.js +51 -40
- package/dist/src/recovery/joint-demand.js.map +1 -1
- package/dist/src/recovery/receipt.d.ts +23 -8
- package/dist/src/recovery/retirement.d.ts +1 -1
- package/dist/src/recovery/retirement.js +131 -29
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.d.ts +13 -6
- package/dist/src/recovery/status.js +483 -79
- package/dist/src/recovery/status.js.map +1 -1
- package/dist/src/recovery/types.d.ts +3 -3
- package/dist/src/review/platform-profile.d.ts +3 -0
- package/dist/src/review/platform-profile.js +16 -0
- package/dist/src/review/platform-profile.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +1 -0
- package/dist/src/review/review-profile.js +8 -2
- package/dist/src/review/review-profile.js.map +1 -1
- package/dist/src/review/review-selection.d.ts +2 -11
- package/dist/src/review/review-selection.js +97 -71
- package/dist/src/review/review-selection.js.map +1 -1
- package/dist/src/review/review-types.d.ts +3 -0
- package/dist/src/review/review-types.js.map +1 -1
- package/dist/src/review/skill-materialization.d.ts +44 -9
- package/dist/src/review/skill-materialization.js +112 -136
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/review/source-binding.d.ts +8 -5
- package/dist/src/review/source-binding.js +99 -41
- package/dist/src/review/source-binding.js.map +1 -1
- package/dist/src/tui/agent-management.js +112 -10
- package/dist/src/tui/agent-management.js.map +1 -1
- package/dist/src/tui/agent-settings.d.ts +3 -0
- package/dist/src/tui/agent-settings.js +10 -11
- package/dist/src/tui/agent-settings.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +58 -20
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/content-item-card.js +2 -2
- package/dist/src/tui/content-item-card.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +198 -152
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +5 -9
- package/dist/src/tui/controller.js +40 -18
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/deployment-view.d.ts +10 -0
- package/dist/src/tui/deployment-view.js +103 -0
- package/dist/src/tui/deployment-view.js.map +1 -0
- package/dist/src/tui/glossary.js +4 -4
- package/dist/src/tui/glossary.js.map +1 -1
- package/dist/src/tui/model.d.ts +5 -0
- package/dist/src/tui/model.js +73 -12
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.js +2 -1
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
- package/dist/src/tui/operation-history.d.ts +5 -4
- package/dist/src/tui/operation-history.js.map +1 -1
- package/dist/src/tui/operation-review-planner.d.ts +7 -2
- package/dist/src/tui/operation-review-planner.js +97 -42
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-content.d.ts +5 -3
- package/dist/src/tui/plugin-content.js +70 -508
- package/dist/src/tui/plugin-content.js.map +1 -1
- package/dist/src/tui/plugin-detail.d.ts +3 -2
- package/dist/src/tui/plugin-detail.js +33 -25
- package/dist/src/tui/plugin-detail.js.map +1 -1
- package/dist/src/tui/scoped-inventory.d.ts +10 -6
- package/dist/src/tui/scoped-inventory.js +34 -1
- package/dist/src/tui/scoped-inventory.js.map +1 -1
- package/dist/src/types.d.ts +4 -63
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +10 -4
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +26 -2
- package/dist/src/utils/artifact-plan.js +113 -489
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +100 -93
- package/dist/src/utils/artifact-renderer.js +173 -346
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +21 -11
- package/dist/src/utils/artifact-request.js +56 -80
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +30 -146
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-digests.d.ts +2 -12
- package/dist/src/utils/catalog-digests.js +0 -39
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-source-references.d.ts +7 -0
- package/dist/src/utils/catalog-source-references.js +234 -19
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/codex-config-observation.d.ts +19 -0
- package/dist/src/utils/codex-config-observation.js +145 -0
- package/dist/src/utils/codex-config-observation.js.map +1 -0
- package/dist/src/utils/codex-executable-discovery.d.ts +2 -0
- package/dist/src/utils/codex-executable-discovery.js +47 -13
- package/dist/src/utils/codex-executable-discovery.js.map +1 -1
- package/dist/src/utils/codex-manager.js +1 -1
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +3 -0
- package/dist/src/utils/codex-native-observation.js +53 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/codex-shared-native.d.ts +3 -1
- package/dist/src/utils/codex-shared-native.js +46 -5
- package/dist/src/utils/codex-shared-native.js.map +1 -1
- package/dist/src/utils/codex-skill-staging.d.ts +4 -3
- package/dist/src/utils/codex-skill-staging.js.map +1 -1
- package/dist/src/utils/codex-surface-analysis.d.ts +5 -2
- package/dist/src/utils/codex-surface-analysis.js +28 -57
- package/dist/src/utils/codex-surface-analysis.js.map +1 -1
- package/dist/src/utils/component-command-preparation.d.ts +34 -0
- package/dist/src/utils/component-command-preparation.js +228 -0
- package/dist/src/utils/component-command-preparation.js.map +1 -0
- package/dist/src/utils/component-resources.d.ts +43 -0
- package/dist/src/utils/component-resources.js +304 -0
- package/dist/src/utils/component-resources.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +17 -6
- package/dist/src/utils/dynamic-skill-tree.js +7 -3
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +11 -44
- package/dist/src/utils/local-marketplace.js +11 -638
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-evidence.d.ts +2 -2
- package/dist/src/utils/managed-command-evidence.js +5 -81
- package/dist/src/utils/managed-command-evidence.js.map +1 -1
- package/dist/src/utils/managed-command-materialization.d.ts +5 -2
- package/dist/src/utils/managed-command-materialization.js +35 -35
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-preparation.d.ts +67 -0
- package/dist/src/utils/managed-command-preparation.js +146 -0
- package/dist/src/utils/managed-command-preparation.js.map +1 -0
- package/dist/src/utils/managed-command-review.d.ts +26 -0
- package/dist/src/utils/managed-command-review.js +68 -0
- package/dist/src/utils/managed-command-review.js.map +1 -0
- package/dist/src/utils/managed-command-store.js +26 -15
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +23 -0
- package/dist/src/utils/native-cli.js +51 -2
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +20 -1
- package/dist/src/utils/native-demand.js.map +1 -1
- package/dist/src/utils/native-tool-review.d.ts +3 -6
- package/dist/src/utils/native-tool-review.js +25 -11
- package/dist/src/utils/native-tool-review.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +26 -3
- package/dist/src/utils/ownership.js +95 -9
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -1
- package/dist/src/utils/paths.js +2 -0
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +46 -0
- package/dist/src/utils/platform-empty-state.js +123 -0
- package/dist/src/utils/platform-empty-state.js.map +1 -0
- package/dist/src/utils/plugin-config-impact.d.ts +17 -11
- package/dist/src/utils/plugin-config-impact.js +46 -62
- package/dist/src/utils/plugin-config-impact.js.map +1 -1
- package/dist/src/utils/plugin-config-write.js +52 -53
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +0 -2
- package/dist/src/utils/plugin-config.js +0 -6
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-dependencies.d.ts +1 -1
- package/dist/src/utils/plugin-dependencies.js.map +1 -1
- package/dist/src/utils/plugin-scripts.d.ts +4 -0
- package/dist/src/utils/plugin-scripts.js +11 -0
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +5 -7
- package/dist/src/utils/runtime-config.js +12 -25
- package/dist/src/utils/runtime-config.js.map +1 -1
- package/dist/src/utils/windows-npm-shim.js +19 -2
- package/dist/src/utils/windows-npm-shim.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/utils/claude-native-render-receipt.d.ts +0 -14
- package/dist/src/utils/claude-native-render-receipt.js +0 -26
- package/dist/src/utils/claude-native-render-receipt.js.map +0 -1
- package/dist/src/utils/claude-skills-root.d.ts +0 -8
- package/dist/src/utils/claude-skills-root.js +0 -87
- package/dist/src/utils/claude-skills-root.js.map +0 -1
- package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
- package/dist/src/utils/codex-native-render-receipt.js +0 -205
- package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
- package/dist/src/utils/slash-commands.d.ts +0 -1
- package/dist/src/utils/slash-commands.js +0 -2
- 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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
233
|
-
|
|
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
|
-
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
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
|
|
264
|
-
|
|
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(
|
|
169
|
+
const code = await unconfirmedPathCode(root, skillFile);
|
|
286
170
|
if (code === 'incompleteList') {
|
|
287
|
-
|
|
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
|
-
|
|
305
|
-
?
|
|
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
|
|
320
|
-
const
|
|
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
|
-
|
|
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
|
|
339
|
-
if (!isRecord(
|
|
340
|
-
|
|
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
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
|
|
358
|
-
|
|
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
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
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
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
])
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
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
|
-
|
|
555
|
-
|
|
556
|
-
|
|
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 (
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
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
|
-
|
|
670
|
-
|
|
671
|
-
|
|
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
|