@lesliechan721/aw 0.1.0-beta.72 → 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.
- 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 +119 -4
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.d.ts +2 -0
- package/dist/src/commands/public-lifecycle.js +29 -6
- 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 +28 -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 +529 -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 +59 -0
- package/dist/src/commands/rebuild-platform-integration.js +1200 -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 +45 -16
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/scope-context.js +23 -19
- package/dist/src/intent/scope-context.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 +60 -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 +338 -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 +74 -0
- package/dist/src/platforms/discovery.js +582 -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 +173 -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 +379 -0
- package/dist/src/platforms/inspection-native.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +4 -0
- package/dist/src/platforms/inspection-pi.js +212 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +13 -0
- package/dist/src/platforms/inspection.js +189 -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 +9 -0
- package/dist/src/platforms/lifecycle-native.js +252 -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 +452 -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 +9 -8
- package/dist/src/recovery/coordinator.js +153 -120
- 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.d.ts +1 -0
- package/dist/src/recovery/joint-coordinator.js +278 -84
- 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 +43 -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 +122 -29
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.d.ts +15 -7
- package/dist/src/recovery/status.js +481 -81
- 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 +85 -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 +199 -152
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +6 -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 +91 -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 +19 -0
- package/dist/src/utils/native-cli.js +45 -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/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
|
@@ -5,27 +5,21 @@ import path from 'node:path';
|
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import fs from 'fs-extra';
|
|
7
7
|
import { preparePluginNativeTools, validateManagedCommandSources, PLATFORM_TARGETS } from '@lesliechan721/aw-plugin-core/manifest';
|
|
8
|
-
import { renderResolvedHooksArtifact } from './hooks.js';
|
|
9
|
-
import { buildGeneratedName } from './shared.js';
|
|
10
8
|
import { applyFileRules } from '../utils/file-rules.js';
|
|
11
9
|
import { calculateFileDigest } from '../utils/bundle-integrity.js';
|
|
12
10
|
import { resolveCanonicalRuntimeSourceIdentity } from '../utils/catalog-runtime-projection.js';
|
|
13
|
-
import { getArtifactSourceBundleRelativePath } from '../utils/artifact-sources.js';
|
|
14
11
|
import { validateManagedCommandPackageClosure } from '../utils/managed-command-closure.js';
|
|
15
|
-
import {
|
|
16
|
-
import { assertManifestPlatformSupport, assertPluginInputTree, checkAwCapabilitySupport, computeAwCapabilitySetDigest, createAwPluginRequirementsReceipt, createBundleSourceManifest, createPlatformManifestBase, isIgnoredPluginInputDirectory, normalizePluginRelativePath, normalizeAwCapabilities, readPluginManifest, resolvePluginRequirements, } from '../utils/manifest.js';
|
|
12
|
+
import { assertManifestPlatformSupport, assertPluginInputTree, checkAwCapabilitySupport, computeAwCapabilitySetDigest, createAwPluginRequirementsReceipt, createBundleSourceManifest, createPlatformManifestBase, isIgnoredPluginInputDirectory, normalizeAwCapabilities, readPluginManifest, resolvePluginRequirements, validatePluginManifest, } from '../utils/manifest.js';
|
|
17
13
|
import { AwCapabilityUnsupportedError, IMPLEMENTED_AW_CAPABILITIES, } from '../commands/aw-capabilities.js';
|
|
18
14
|
import { writeJsonFile } from '../utils/json.js';
|
|
19
15
|
import { resolveSupportedPlatforms } from '../utils/platform-support.js';
|
|
20
16
|
import { renderTemplate } from '../utils/template-engine.js';
|
|
21
|
-
import { resolvePlatformEntries } from '../utils/platform-entries.js';
|
|
22
17
|
import { scanNodeImportContract } from '../utils/plugin-script-contract.js';
|
|
23
18
|
import { isSkillAuthorOnlyPath, isSkillCollectionAuthorOnlyPath, } from '../utils/skill-authoring.js';
|
|
24
19
|
import { assertTestWritablePath } from '../utils/test-path-fence.js';
|
|
25
20
|
import { resolveCliPackageRoot } from '../utils/paths.js';
|
|
26
21
|
import { validateRuntimeSkillClosure, validateSkillRuntimeProjectionFreshness, } from '../utils/runtime-skill-closure.js';
|
|
27
22
|
import { AW_PLUGIN_REQUIREMENTS_RECEIPT_PATH, validatePortableSkillDirectory, } from '../utils/dynamic-skill-tree.js';
|
|
28
|
-
import { renderClaudeSlashCommand, renderCodexSlashCommandOpenAiYaml, renderCodexSlashCommandSkillMarkdown, resolveSlashCommands, } from '../utils/slash-commands.js';
|
|
29
23
|
const execFileAsync = promisify(execFile);
|
|
30
24
|
const requireFromCli = createRequire(import.meta.url);
|
|
31
25
|
const NODE_RUNTIME_EXTENSIONS = new Set(['.js', '.mjs', '.cjs']);
|
|
@@ -196,21 +190,6 @@ async function collectFilesForPath(pluginRoot, relativePath) {
|
|
|
196
190
|
}
|
|
197
191
|
return [stripDotSlash(relativePath).split(path.sep).join('/')];
|
|
198
192
|
}
|
|
199
|
-
function renderClaudeAgentContent(agent) {
|
|
200
|
-
const frontmatterLines = ['---', `name: ${JSON.stringify(agent.name)}`, `description: ${JSON.stringify(agent.description)}`];
|
|
201
|
-
if (agent.tools && agent.tools.length > 0) {
|
|
202
|
-
frontmatterLines.push('tools:');
|
|
203
|
-
for (const tool of agent.tools) {
|
|
204
|
-
frontmatterLines.push(` - ${tool}`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
frontmatterLines.push('---', '');
|
|
208
|
-
return `${frontmatterLines.join('\n')}${agent.prompt.trim()}\n`;
|
|
209
|
-
}
|
|
210
|
-
async function writeTextFile(filePath, content) {
|
|
211
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
212
|
-
await fs.writeFile(filePath, content, 'utf8');
|
|
213
|
-
}
|
|
214
193
|
async function copyFileWithTemplateSupport(pluginRoot, outputRoot, sourceRelativePath, platform, templatePatterns, templateVars) {
|
|
215
194
|
const normalizedSource = sourceRelativePath.split(path.sep).join('/');
|
|
216
195
|
const sourcePath = path.join(pluginRoot, normalizedSource);
|
|
@@ -264,31 +243,17 @@ async function assertArtifactSourceTreePortable(rootDir, fieldName, relativeRoot
|
|
|
264
243
|
}
|
|
265
244
|
}
|
|
266
245
|
async function copyArtifactSourceDirectories(plugin, outputRoot) {
|
|
267
|
-
for (const [
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
const sourceRelativePath = path.posix.join(stripDotSlash(sourceDir), relativePath);
|
|
279
|
-
const excluded = plugin.manifest.buildConfig?.fileRules?.[target.platform]?.exclude ?? [];
|
|
280
|
-
if (applyFileRules([sourceRelativePath], ['**/*'], excluded).length === 0)
|
|
281
|
-
continue;
|
|
282
|
-
const destination = path.join(targetRoot, relativePath);
|
|
283
|
-
await fs.ensureDir(path.dirname(destination));
|
|
284
|
-
const templates = plugin.manifest.buildConfig?.templates;
|
|
285
|
-
if (isTextFile(relativePath) && applyFileRules([sourceRelativePath], templates?.include ?? [], []).length > 0) {
|
|
286
|
-
await fs.writeFile(destination, renderTemplate(await fs.readFile(path.join(sourcePath, relativePath), 'utf8'), templates?.vars ?? {}, target.platform));
|
|
287
|
-
}
|
|
288
|
-
else {
|
|
289
|
-
await fs.copyFile(path.join(sourcePath, relativePath), destination);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
246
|
+
for (const [sourceIndex, sourceDir] of (plugin.manifest.artifacts?.sourceDirs ?? []).entries()) {
|
|
247
|
+
const sourcePath = path.join(plugin.rootDir, stripDotSlash(sourceDir));
|
|
248
|
+
await assertArtifactSourceTreePortable(sourcePath, `artifacts.sourceDirs[${sourceIndex}]`);
|
|
249
|
+
const targetRoot = path.join(outputRoot, stripDotSlash(sourceDir));
|
|
250
|
+
await fs.ensureDir(targetRoot);
|
|
251
|
+
for (const relativePath of await listFilesRecursively(sourcePath)) {
|
|
252
|
+
if (isSkillAuthorOnlyPath(relativePath))
|
|
253
|
+
continue;
|
|
254
|
+
const destination = path.join(targetRoot, relativePath);
|
|
255
|
+
await fs.ensureDir(path.dirname(destination));
|
|
256
|
+
await fs.copyFile(path.join(sourcePath, relativePath), destination);
|
|
292
257
|
}
|
|
293
258
|
}
|
|
294
259
|
}
|
|
@@ -309,36 +274,27 @@ async function resolveArtifactRuntimeImports(options) {
|
|
|
309
274
|
const manifest = createBundleSourceManifest(options.plugin);
|
|
310
275
|
const requiredCapabilities = [];
|
|
311
276
|
const projections = [];
|
|
312
|
-
for (const [
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
throw new Error(`Cannot resolve artifacts.targets[${targetIndex}].runtimeImports[${importIndex}]: catalog runtime import resolver is required.`);
|
|
316
|
-
}
|
|
317
|
-
const resolution = await options.resolver.resolve({
|
|
318
|
-
consumer: options.plugin,
|
|
319
|
-
reference: runtimeImport,
|
|
320
|
-
purpose: 'artifact-runtime',
|
|
321
|
-
});
|
|
322
|
-
requiredCapabilities.push(...resolution.requiredCapabilities);
|
|
323
|
-
const relativePath = `./.agents-plugin/runtime-imports/${target.id}/${runtimeImport.name}`;
|
|
324
|
-
const targetPath = path.join(options.outputRoot, stripDotSlash(relativePath));
|
|
325
|
-
const digest = resolution.sourceDigest;
|
|
326
|
-
projections.push({
|
|
327
|
-
sourcePath: resolution.sourcePath,
|
|
328
|
-
targetPath,
|
|
329
|
-
sourceDigest: resolution.sourceDigest,
|
|
330
|
-
label: `${target.id}/${runtimeImport.name}`,
|
|
331
|
-
});
|
|
332
|
-
runtimeImport.resolved = {
|
|
333
|
-
path: relativePath,
|
|
334
|
-
digest,
|
|
335
|
-
providerPluginId: resolution.provider,
|
|
336
|
-
providerVersion: resolution.providerVersion,
|
|
337
|
-
source: resolution.source,
|
|
338
|
-
requiredCapabilities: resolution.requiredCapabilities,
|
|
339
|
-
capabilitySetDigest: resolution.capabilitySetDigest,
|
|
340
|
-
};
|
|
277
|
+
for (const [importIndex, runtimeImport] of (manifest.artifacts?.runtimeImports ?? []).entries()) {
|
|
278
|
+
if (!options.resolver) {
|
|
279
|
+
throw new Error(`Cannot resolve artifacts.runtimeImports[${importIndex}]: catalog runtime import resolver is required.`);
|
|
341
280
|
}
|
|
281
|
+
const resolution = await options.resolver.resolve({
|
|
282
|
+
consumer: options.plugin, reference: runtimeImport, purpose: 'artifact-runtime',
|
|
283
|
+
});
|
|
284
|
+
requiredCapabilities.push(...resolution.requiredCapabilities);
|
|
285
|
+
const relativePath = `./.agents-plugin/runtime-imports/${runtimeImport.name}`;
|
|
286
|
+
projections.push({
|
|
287
|
+
sourcePath: resolution.sourcePath,
|
|
288
|
+
targetPath: path.join(options.outputRoot, stripDotSlash(relativePath)),
|
|
289
|
+
sourceDigest: resolution.sourceDigest,
|
|
290
|
+
label: runtimeImport.name,
|
|
291
|
+
});
|
|
292
|
+
runtimeImport.resolved = {
|
|
293
|
+
path: relativePath, digest: resolution.sourceDigest,
|
|
294
|
+
providerPluginId: resolution.provider, providerVersion: resolution.providerVersion,
|
|
295
|
+
source: resolution.source, requiredCapabilities: resolution.requiredCapabilities,
|
|
296
|
+
capabilitySetDigest: resolution.capabilitySetDigest,
|
|
297
|
+
};
|
|
342
298
|
}
|
|
343
299
|
return {
|
|
344
300
|
manifest,
|
|
@@ -375,12 +331,6 @@ async function injectRequirementsReceipts(options) {
|
|
|
375
331
|
}
|
|
376
332
|
}
|
|
377
333
|
}
|
|
378
|
-
async function copySlashCommandAsset(pluginRoot, outputRoot, skillName, sourceRelativePath, generatedRelativePath) {
|
|
379
|
-
const sourcePath = path.join(pluginRoot, sourceRelativePath);
|
|
380
|
-
const targetPath = path.join(outputRoot, 'codex', 'skills', skillName, stripDotSlash(generatedRelativePath));
|
|
381
|
-
await fs.ensureDir(path.dirname(targetPath));
|
|
382
|
-
await fs.copyFile(sourcePath, targetPath);
|
|
383
|
-
}
|
|
384
334
|
async function addDeclaredPathFiles(plugin, platform, relativePath, targetFiles) {
|
|
385
335
|
if (!relativePath) {
|
|
386
336
|
return undefined;
|
|
@@ -395,18 +345,11 @@ async function addDeclaredSkillPathFiles(plugin, platform, relativePath, targetF
|
|
|
395
345
|
if (!relativePath)
|
|
396
346
|
return undefined;
|
|
397
347
|
const root = stripDotSlash(relativePath);
|
|
398
|
-
const dynamicSkillKeys = new Set((plugin.manifest.artifacts?.targets ?? [])
|
|
399
|
-
.filter((target) => target.platform === platform &&
|
|
400
|
-
(target.target === 'codex.skill' || target.target === 'claude.skill' || target.target === 'agent-skills.skill') &&
|
|
401
|
-
target.skillKey)
|
|
402
|
-
.map((target) => target.skillKey));
|
|
403
348
|
const files = await collectFilesForPath(plugin.rootDir, relativePath);
|
|
404
349
|
let added = false;
|
|
405
350
|
for (const filePath of files) {
|
|
406
351
|
const skillCollectionPath = path.posix.relative(root.split(path.sep).join('/'), filePath.split(path.sep).join('/'));
|
|
407
|
-
|
|
408
|
-
if (!dynamicSkillKeys.has(skillKey ?? '') &&
|
|
409
|
-
!isSkillCollectionAuthorOnlyPath(skillCollectionPath)) {
|
|
352
|
+
if (!isSkillCollectionAuthorOnlyPath(skillCollectionPath)) {
|
|
410
353
|
targetFiles.add(filePath);
|
|
411
354
|
added = true;
|
|
412
355
|
}
|
|
@@ -430,63 +373,13 @@ function isDeclaredSkillAuthorOnlyFile(plugin, filePath) {
|
|
|
430
373
|
if (staticRelative && isSkillCollectionAuthorOnlyPath(staticRelative))
|
|
431
374
|
return true;
|
|
432
375
|
}
|
|
433
|
-
for (const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
continue;
|
|
437
|
-
const dynamicRoot = `skills/${target.skillKey}`;
|
|
438
|
-
const dynamicRelative = relativePathInside(dynamicRoot, normalizedFile);
|
|
439
|
-
if (dynamicRelative && isSkillAuthorOnlyPath(dynamicRelative))
|
|
376
|
+
for (const sourceDir of plugin.manifest.artifacts?.sourceDirs ?? []) {
|
|
377
|
+
const sourceRelative = relativePathInside(stripDotSlash(sourceDir), normalizedFile);
|
|
378
|
+
if (sourceRelative && isSkillAuthorOnlyPath(sourceRelative))
|
|
440
379
|
return true;
|
|
441
|
-
for (const sourceDir of target.sourceDirs ?? []) {
|
|
442
|
-
const sourceRelative = relativePathInside(stripDotSlash(sourceDir).split(path.sep).join('/'), normalizedFile);
|
|
443
|
-
if (sourceRelative && isSkillAuthorOnlyPath(sourceRelative))
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
380
|
}
|
|
447
381
|
return false;
|
|
448
382
|
}
|
|
449
|
-
function isDynamicSkillSourceFile(plugin, platform, filePath) {
|
|
450
|
-
const normalizedFile = filePath.split(path.sep).join('/');
|
|
451
|
-
return (plugin.manifest.artifacts?.targets ?? []).some((target) => {
|
|
452
|
-
if (target.platform !== platform ||
|
|
453
|
-
(target.target !== 'codex.skill' && target.target !== 'claude.skill' && target.target !== 'agent-skills.skill') ||
|
|
454
|
-
!target.skillKey)
|
|
455
|
-
return false;
|
|
456
|
-
return relativePathInside(`skills/${target.skillKey}`, normalizedFile) !== null;
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
async function addDeclaredLspServerFiles(plugin, value, targetFiles) {
|
|
460
|
-
if (value === undefined) {
|
|
461
|
-
return undefined;
|
|
462
|
-
}
|
|
463
|
-
if (typeof value === 'string') {
|
|
464
|
-
const normalized = normalizePluginRelativePath(plugin.rootDir, value, 'buildConfig.manifestOverrides.claude.lspServers');
|
|
465
|
-
const files = await collectFilesForPath(plugin.rootDir, normalized);
|
|
466
|
-
for (const filePath of files) {
|
|
467
|
-
targetFiles.add(filePath);
|
|
468
|
-
}
|
|
469
|
-
return toPlatformRelativePath(normalized, 'claude');
|
|
470
|
-
}
|
|
471
|
-
if (Array.isArray(value)) {
|
|
472
|
-
const rendered = [];
|
|
473
|
-
for (const entry of value) {
|
|
474
|
-
if (typeof entry === 'string') {
|
|
475
|
-
const normalized = normalizePluginRelativePath(plugin.rootDir, entry, 'buildConfig.manifestOverrides.claude.lspServers');
|
|
476
|
-
const files = await collectFilesForPath(plugin.rootDir, normalized);
|
|
477
|
-
for (const filePath of files) {
|
|
478
|
-
targetFiles.add(filePath);
|
|
479
|
-
}
|
|
480
|
-
rendered.push(toPlatformRelativePath(normalized, 'claude'));
|
|
481
|
-
}
|
|
482
|
-
else {
|
|
483
|
-
rendered.push(entry);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
return rendered;
|
|
487
|
-
}
|
|
488
|
-
return value;
|
|
489
|
-
}
|
|
490
383
|
function addPreApplyRuntimeEntry(plugin, rootFiles, nodeEntries) {
|
|
491
384
|
const entry = plugin.manifest.scripts?.preApply;
|
|
492
385
|
if (!entry)
|
|
@@ -557,9 +450,7 @@ async function collectRuntimeClosureFiles(plugin, entryFiles) {
|
|
|
557
450
|
entryFiles,
|
|
558
451
|
dependencies,
|
|
559
452
|
devDependencies,
|
|
560
|
-
runtimeConfigSkillRoots:
|
|
561
|
-
.filter((target) => target.runtimeConfig !== undefined)
|
|
562
|
-
.flatMap((target) => target.sourceDirs ?? []),
|
|
453
|
+
runtimeConfigSkillRoots: plugin.manifest.artifacts?.sourceDirs ?? [],
|
|
563
454
|
});
|
|
564
455
|
if (scan.errors.length > 0) {
|
|
565
456
|
throw new Error(`Invalid scripts.node runtime imports:\n${scan.errors.join('\n')}`);
|
|
@@ -807,11 +698,6 @@ async function assertSkillRuntimeProjectionTargets(plugin) {
|
|
|
807
698
|
const roots = [path.join(plugin.rootDir, stripDotSlash(plugin.manifest.skills ?? './skills'), entry.skill)];
|
|
808
699
|
for (const skillRoot of roots) {
|
|
809
700
|
const skillRootStats = await fs.lstat(skillRoot).catch(() => undefined);
|
|
810
|
-
if (!skillRootStats) {
|
|
811
|
-
const platforms = entry.platforms?.length ? entry.platforms : [...resolveSupportedPlatforms(plugin.manifest)];
|
|
812
|
-
if (platforms.every((platform) => (plugin.manifest.artifacts?.targets ?? []).some((target) => target.platform === platform && target.target === 'agent-skills.skill' && target.skillKey === entry.skill)))
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
701
|
if (!skillRootStats?.isDirectory() || skillRootStats.isSymbolicLink()) {
|
|
816
702
|
throw new Error(`Invalid buildConfig.skillRuntimeFiles[${index}].skill: "${entry.skill}" is not a declared static Skill key.`);
|
|
817
703
|
}
|
|
@@ -819,28 +705,6 @@ async function assertSkillRuntimeProjectionTargets(plugin) {
|
|
|
819
705
|
}
|
|
820
706
|
}
|
|
821
707
|
}
|
|
822
|
-
async function materializeGeneratedPortableSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms) {
|
|
823
|
-
const projections = [];
|
|
824
|
-
for (const [index, entry] of (plugin.manifest.buildConfig?.generatedSkillRuntimeFiles ?? []).entries()) {
|
|
825
|
-
for (const platform of entry.platforms?.length ? entry.platforms : supportedPlatforms) {
|
|
826
|
-
const dynamicTarget = (plugin.manifest.artifacts?.targets ?? []).find((target) => target.platform === platform && target.target === 'agent-skills.skill' && target.skillKey === entry.skill);
|
|
827
|
-
if (!dynamicTarget)
|
|
828
|
-
continue;
|
|
829
|
-
const relativePath = path.posix.join('skills', entry.skill, entry.target);
|
|
830
|
-
const source = await resolveCanonicalRuntimeSourceIdentity(plugin.rootDir, `./${relativePath}`, `buildConfig.generatedSkillRuntimeFiles[${index}]`);
|
|
831
|
-
const stats = await fs.lstat(source.sourceRealPath);
|
|
832
|
-
if (!stats.isFile() || stats.isSymbolicLink()) {
|
|
833
|
-
throw new Error(`Invalid buildConfig.generatedSkillRuntimeFiles[${index}]: build did not create regular source "${relativePath}".`);
|
|
834
|
-
}
|
|
835
|
-
await copyFileWithTemplateSupport(plugin.rootDir, outputRoot, relativePath, platform, plugin.manifest.buildConfig?.templates?.include ?? [], plugin.manifest.buildConfig?.templates?.vars ?? {});
|
|
836
|
-
projections.push({
|
|
837
|
-
platform, skill: entry.skill, target: entry.target, path: `./${platform}/${relativePath}`,
|
|
838
|
-
digest: await calculateFileDigest(path.join(outputRoot, platform, relativePath)),
|
|
839
|
-
});
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
return projections;
|
|
843
|
-
}
|
|
844
708
|
async function validateGeneratedSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms) {
|
|
845
709
|
for (const [index, entry] of (plugin.manifest.buildConfig?.generatedSkillRuntimeFiles ?? []).entries()) {
|
|
846
710
|
const surfaces = entry.platforms?.length ? entry.platforms : [...supportedPlatforms];
|
|
@@ -1166,6 +1030,7 @@ function assertRequiredCapabilitiesSupported(pluginName, requiredCapabilities) {
|
|
|
1166
1030
|
}
|
|
1167
1031
|
export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
1168
1032
|
const historicalComparison = options.runtimeSkillClosureValidation === 'historical';
|
|
1033
|
+
plugin = { ...plugin, manifest: validatePluginManifest(plugin.rootDir, plugin.manifest) };
|
|
1169
1034
|
const buildOptions = {
|
|
1170
1035
|
buildMode: options.buildMode ?? 'build-free',
|
|
1171
1036
|
stagingRunner: options.stagingRunner
|
|
@@ -1246,9 +1111,6 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1246
1111
|
const buildConfig = plugin.manifest.buildConfig;
|
|
1247
1112
|
const templatePatterns = buildConfig?.templates?.include ?? [];
|
|
1248
1113
|
const templateVars = buildConfig?.templates?.vars ?? {};
|
|
1249
|
-
const resolvedSlashCommands = await resolveSlashCommands(plugin.rootDir, plugin.manifest, {
|
|
1250
|
-
targetPlatforms: new Set([...supportedPlatforms].filter((platform) => platform === 'codex' || platform === 'claude')),
|
|
1251
|
-
});
|
|
1252
1114
|
for (const platform of PLATFORM_ORDER) {
|
|
1253
1115
|
if (!supportedPlatforms.has(platform)) {
|
|
1254
1116
|
continue;
|
|
@@ -1266,52 +1128,17 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1266
1128
|
manifest.mcpServers = await addDeclaredPathFiles(plugin, platform, plugin.manifest.mcpServers, files);
|
|
1267
1129
|
}
|
|
1268
1130
|
for (const platform of supportedPlatforms) {
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
if ((plugin.manifest.artifacts?.targets ?? []).some((target) => target.platform === platform && (target.target === 'codex.skill' || target.target === 'claude.skill'))) {
|
|
1272
|
-
manifest.skills = `./${platform}/skills`;
|
|
1273
|
-
await fs.ensureDir(path.join(outputRoot, platform, 'skills'));
|
|
1274
|
-
}
|
|
1131
|
+
await fs.ensureDir(path.join(outputRoot, platform));
|
|
1132
|
+
if (platform === 'codex' || platform === 'claude')
|
|
1275
1133
|
continue;
|
|
1276
|
-
}
|
|
1277
1134
|
const files = new Set();
|
|
1278
1135
|
platformFiles[platform] = files;
|
|
1279
1136
|
if (plugin.manifest.skills)
|
|
1280
1137
|
await fs.ensureDir(path.join(outputRoot, platform, 'skills'));
|
|
1281
1138
|
await addDeclaredSkillPathFiles(plugin, platform, plugin.manifest.skills, files);
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
if (codexManifest && codexFiles) {
|
|
1286
|
-
codexManifest.apps = await addDeclaredPathFiles(plugin, 'codex', plugin.manifest.apps, codexFiles);
|
|
1287
|
-
const hooksArtifact = renderResolvedHooksArtifact(resolvePlatformHookDefinitions(plugin.manifest, 'codex'), 'codex');
|
|
1288
|
-
if (hooksArtifact) {
|
|
1289
|
-
codexManifest.hooks = hooksArtifact.content;
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
const claudeManifest = platformManifests.claude;
|
|
1293
|
-
const claudeFiles = platformFiles.claude;
|
|
1294
|
-
if (claudeManifest && claudeFiles) {
|
|
1295
|
-
const claudeOverrides = buildConfig?.manifestOverrides?.claude;
|
|
1296
|
-
claudeManifest.outputStyles = await addDeclaredPathFiles(plugin, 'claude', claudeOverrides?.outputStyles, claudeFiles);
|
|
1297
|
-
claudeManifest.lspServers = await addDeclaredLspServerFiles(plugin, claudeOverrides?.lspServers, claudeFiles);
|
|
1298
|
-
claudeManifest.userConfig = claudeOverrides?.userConfig;
|
|
1299
|
-
claudeManifest.channels = claudeOverrides?.channels;
|
|
1300
|
-
const hooksArtifact = renderResolvedHooksArtifact(resolvePlatformHookDefinitions(plugin.manifest, 'claude'), 'claude');
|
|
1301
|
-
if (hooksArtifact) {
|
|
1302
|
-
const hooksPath = path.join(outputRoot, 'claude', 'hooks', 'hooks.json');
|
|
1303
|
-
await writeJsonFile(hooksPath, hooksArtifact.content);
|
|
1304
|
-
claudeManifest.hooks = './claude/hooks/hooks.json';
|
|
1305
|
-
}
|
|
1306
|
-
const claudeAgents = resolvePlatformEntries(plugin.manifest.extensions?.agents, 'claude');
|
|
1307
|
-
if (claudeAgents.length > 0) {
|
|
1308
|
-
claudeManifest.agents = [];
|
|
1309
|
-
for (const agent of claudeAgents) {
|
|
1310
|
-
const generatedName = buildGeneratedName(plugin.manifest.name, agent.name);
|
|
1311
|
-
const relativePath = `./claude/agents/${generatedName}.md`;
|
|
1312
|
-
claudeManifest.agents.push(relativePath);
|
|
1313
|
-
await writeTextFile(path.join(outputRoot, stripDotSlash(relativePath)), renderClaudeAgentContent(agent));
|
|
1314
|
-
}
|
|
1139
|
+
if (plugin.manifest.mcpServers) {
|
|
1140
|
+
for (const file of await collectFilesForPath(plugin.rootDir, plugin.manifest.mcpServers))
|
|
1141
|
+
files.add(file);
|
|
1315
1142
|
}
|
|
1316
1143
|
}
|
|
1317
1144
|
const sourceFiles = (await listFilesRecursively(plugin.rootDir)).filter((filePath) => !isDeclaredSkillAuthorOnlyFile(plugin, filePath));
|
|
@@ -1321,10 +1148,7 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1321
1148
|
continue;
|
|
1322
1149
|
const rules = buildConfig?.fileRules?.[platform];
|
|
1323
1150
|
if (rules) {
|
|
1324
|
-
for (const filePath of applyFileRules(sourceFiles
|
|
1325
|
-
const commandsRoot = resolvedSlashCommands && stripDotSlash(resolvedSlashCommands.rootRelativePath);
|
|
1326
|
-
if (commandsRoot && (filePath === commandsRoot || filePath.startsWith(`${commandsRoot}/`)))
|
|
1327
|
-
continue;
|
|
1151
|
+
for (const filePath of applyFileRules(sourceFiles, rules.include, rules.exclude)) {
|
|
1328
1152
|
files.add(filePath);
|
|
1329
1153
|
}
|
|
1330
1154
|
for (const filePath of [...files]) {
|
|
@@ -1336,26 +1160,6 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1336
1160
|
await copyFileWithTemplateSupport(plugin.rootDir, outputRoot, filePath, platform, templatePatterns, templateVars);
|
|
1337
1161
|
}
|
|
1338
1162
|
}
|
|
1339
|
-
if (resolvedSlashCommands) {
|
|
1340
|
-
if (claudeManifest) {
|
|
1341
|
-
claudeManifest.commands = './claude/commands';
|
|
1342
|
-
}
|
|
1343
|
-
if (codexManifest) {
|
|
1344
|
-
codexManifest.skills ??= './codex/skills';
|
|
1345
|
-
}
|
|
1346
|
-
for (const command of resolvedSlashCommands.commands) {
|
|
1347
|
-
if (claudeManifest && command.claude) {
|
|
1348
|
-
await writeTextFile(path.join(outputRoot, 'claude', 'commands', `${command.name}.md`), renderClaudeSlashCommand(command));
|
|
1349
|
-
}
|
|
1350
|
-
if (codexManifest && command.codex) {
|
|
1351
|
-
await writeTextFile(path.join(outputRoot, 'codex', 'skills', command.name, 'SKILL.md'), renderCodexSlashCommandSkillMarkdown(command));
|
|
1352
|
-
await writeTextFile(path.join(outputRoot, 'codex', 'skills', command.name, 'agents', 'openai.yaml'), renderCodexSlashCommandOpenAiYaml(command));
|
|
1353
|
-
for (const asset of command.codex.assets) {
|
|
1354
|
-
await copySlashCommandAsset(plugin.rootDir, outputRoot, command.name, asset.sourceRelativePath, asset.generatedRelativePath);
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
1163
|
await materializeSkillRuntimeFiles(skillRuntimeFileProjections);
|
|
1360
1164
|
if (await fs.pathExists(path.join(plugin.rootDir, 'README.md'))) {
|
|
1361
1165
|
await copyBundleRootFile(plugin.rootDir, outputRoot, 'README.md');
|
|
@@ -1363,8 +1167,19 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1363
1167
|
for (const filePath of await collectAwRuntimeFiles(plugin)) {
|
|
1364
1168
|
await copyBundleRootFile(plugin.rootDir, outputRoot, filePath);
|
|
1365
1169
|
}
|
|
1170
|
+
if (plugin.manifest.skills) {
|
|
1171
|
+
const collection = stripDotSlash(plugin.manifest.skills);
|
|
1172
|
+
for (const file of await collectFilesForPath(plugin.rootDir, collection)) {
|
|
1173
|
+
const relative = path.posix.relative(collection, file);
|
|
1174
|
+
if (isSkillCollectionAuthorOnlyPath(relative))
|
|
1175
|
+
continue;
|
|
1176
|
+
await copyBundleRootFile(plugin.rootDir, outputRoot, file);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
if (plugin.manifest.mcpServers) {
|
|
1180
|
+
await copyBundleRootFile(plugin.rootDir, outputRoot, stripDotSlash(plugin.manifest.mcpServers));
|
|
1181
|
+
}
|
|
1366
1182
|
await copyArtifactSourceDirectories(plugin, outputRoot);
|
|
1367
|
-
portableRuntimeFiles.push(...await materializeGeneratedPortableSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms));
|
|
1368
1183
|
await copyManagedCommandPackages(plugin, outputRoot);
|
|
1369
1184
|
await copyProductionPackageRoot(plugin, outputRoot);
|
|
1370
1185
|
await materializeArtifactRuntimeImports(artifactRuntimeProjection.projections);
|
|
@@ -1390,15 +1205,11 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1390
1205
|
if ((options.runtimeSkillClosureValidation ?? 'current') === 'current') {
|
|
1391
1206
|
for (const platform of supportedPlatforms) {
|
|
1392
1207
|
const root = path.join(outputRoot, platform, 'skills');
|
|
1393
|
-
const dynamicKeys = new Set((plugin.manifest.artifacts?.targets ?? [])
|
|
1394
|
-
.filter((target) => target.platform === platform && target.skillKey !== undefined)
|
|
1395
|
-
.map((target) => target.skillKey));
|
|
1396
1208
|
for (const entry of await fs.readdir(root, { withFileTypes: true }).catch(() => [])) {
|
|
1397
|
-
if (dynamicKeys.has(entry.name))
|
|
1398
|
-
continue;
|
|
1399
1209
|
const skillRoot = path.join(root, entry.name);
|
|
1400
|
-
if (platform !== 'codex' && platform !== 'claude')
|
|
1401
|
-
await validatePortableSkillDirectory(skillRoot);
|
|
1210
|
+
if (platform !== 'codex' && platform !== 'claude') {
|
|
1211
|
+
await validatePortableSkillDirectory(skillRoot, { frontmatterProfile: 'claude-current' });
|
|
1212
|
+
}
|
|
1402
1213
|
await validateRuntimeSkillClosure(skillRoot);
|
|
1403
1214
|
}
|
|
1404
1215
|
}
|