@lesliechan721/aw 0.1.0-beta.10 → 0.1.0-beta.100
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-config.d.mts +1 -50
- package/dist/authoring/assets/aw-config.mjs +58 -928
- package/dist/authoring/assets/aw-config.mjs.map +1 -1
- package/dist/authoring/assets/aw-runtime-config.d.mts +13 -0
- package/dist/authoring/assets/aw-runtime-config.mjs +221 -0
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
- package/dist/authoring/assets/command-runtime-config.d.mts +9 -0
- package/dist/authoring/assets/command-runtime-config.mjs +134 -0
- package/dist/authoring/assets/command-runtime-config.mjs.map +1 -0
- package/dist/authoring/scripts/add-skill.mjs +16 -39
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +43 -71
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-root.mjs +4 -4
- package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +230 -9
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +3 -3
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +5 -8
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/remove-plugin.mjs +1 -1
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +408 -1748
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-skill.mjs +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/native-runtime/reader-runtime.mjs +34 -0
- package/dist/native-runtime/reader.d.mts +6 -0
- package/dist/native-runtime/reader.mjs +11 -0
- package/dist/scripts/aw-skill-eval-materializer.d.ts +11 -1
- package/dist/scripts/aw-skill-eval-materializer.js +119 -114
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
- package/dist/scripts/bundle-plugins.js +32 -7
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +1 -1
- package/dist/scripts/plugin-staging.js +5 -2
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/scripts/plugin-test-context-guard.d.mts +1 -0
- package/dist/scripts/plugin-test-context-guard.mjs +59 -0
- package/dist/scripts/plugin-test-context-guard.mjs.map +1 -0
- package/dist/scripts/plugin-test-reporter.d.mts +2 -0
- package/dist/scripts/plugin-test-reporter.mjs +21 -0
- package/dist/scripts/plugin-test-reporter.mjs.map +1 -0
- package/dist/scripts/test-plugin-scripts.d.ts +5 -0
- package/dist/scripts/test-plugin-scripts.js +343 -58
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/scripts/test-workers.d.mts +24 -0
- package/dist/scripts/test-workers.mjs +59 -0
- package/dist/scripts/test-workers.mjs.map +1 -0
- package/dist/src/adapters/helpers.d.ts +7 -0
- package/dist/src/adapters/helpers.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +3 -0
- package/dist/src/authoring/workspace-commands.js +7 -2
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +48 -19
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/catalog-dev-source.d.ts +40 -3
- package/dist/src/commands/catalog-dev-source.js +333 -42
- package/dist/src/commands/catalog-dev-source.js.map +1 -1
- package/dist/src/commands/catalog-generation.d.ts +5 -0
- package/dist/src/commands/catalog-generation.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.d.ts +11 -3
- package/dist/src/commands/catalog-publication-inspection.js +211 -59
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
- package/dist/src/commands/catalog-publication-journal.d.ts +12 -0
- package/dist/src/commands/catalog-publication-journal.js +78 -1
- package/dist/src/commands/catalog-publication-journal.js.map +1 -1
- package/dist/src/commands/catalog-publish.d.ts +21 -1
- package/dist/src/commands/catalog-publish.js +133 -92
- package/dist/src/commands/catalog-publish.js.map +1 -1
- package/dist/src/commands/catalog-source.d.ts +25 -5
- package/dist/src/commands/catalog-source.js +153 -27
- package/dist/src/commands/catalog-source.js.map +1 -1
- package/dist/src/commands/catalog-status.js +2 -2
- package/dist/src/commands/catalog-status.js.map +1 -1
- package/dist/src/commands/catalog-store.d.ts +31 -7
- package/dist/src/commands/catalog-store.js +379 -42
- package/dist/src/commands/catalog-store.js.map +1 -1
- package/dist/src/commands/catalog-workspace-resolution.d.ts +4 -0
- package/dist/src/commands/catalog-workspace-resolution.js +18 -3
- package/dist/src/commands/catalog-workspace-resolution.js.map +1 -1
- package/dist/src/commands/console.js +33 -20
- package/dist/src/commands/console.js.map +1 -1
- package/dist/src/commands/dependency-operation-plan.d.ts +7 -0
- package/dist/src/commands/dependency-operation-plan.js +66 -30
- package/dist/src/commands/dependency-operation-plan.js.map +1 -1
- package/dist/src/commands/deployment-confirmation.d.ts +11 -0
- package/dist/src/commands/deployment-confirmation.js +101 -0
- package/dist/src/commands/deployment-confirmation.js.map +1 -0
- package/dist/src/commands/init.js +1 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/intent-command.d.ts +34 -0
- package/dist/src/commands/intent-command.js +174 -0
- package/dist/src/commands/intent-command.js.map +1 -0
- package/dist/src/commands/lifecycle-command-package.d.ts +45 -0
- package/dist/src/commands/lifecycle-command-package.js +199 -0
- package/dist/src/commands/lifecycle-command-package.js.map +1 -0
- package/dist/src/commands/managed-commands.d.ts +41 -0
- package/dist/src/commands/managed-commands.js +404 -0
- package/dist/src/commands/managed-commands.js.map +1 -0
- package/dist/src/commands/offline-cleanup-evidence.d.ts +12 -2
- package/dist/src/commands/offline-cleanup-evidence.js +57 -35
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +72 -2
- package/dist/src/commands/operation-plan.js +54 -3
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/operation-planner.d.ts +6 -5
- package/dist/src/commands/operation-planner.js +23 -20
- package/dist/src/commands/operation-planner.js.map +1 -1
- package/dist/src/commands/options.d.ts +11 -16
- package/dist/src/commands/options.js +31 -25
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/permission-batch.d.ts +5 -0
- package/dist/src/commands/permission-batch.js +83 -0
- package/dist/src/commands/permission-batch.js.map +1 -0
- package/dist/src/commands/plugin-capabilities.js +128 -58
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.d.ts +14 -0
- package/dist/src/commands/public-config-confirmation.js +73 -0
- package/dist/src/commands/public-config-confirmation.js.map +1 -0
- package/dist/src/commands/public-interruption.d.ts +9 -0
- package/dist/src/commands/public-interruption.js +23 -0
- package/dist/src/commands/public-interruption.js.map +1 -0
- package/dist/src/commands/public-lifecycle-result.d.ts +106 -0
- package/dist/src/commands/public-lifecycle-result.js +536 -0
- package/dist/src/commands/public-lifecycle-result.js.map +1 -0
- package/dist/src/commands/public-lifecycle.d.ts +27 -0
- package/dist/src/commands/public-lifecycle.js +569 -0
- package/dist/src/commands/public-lifecycle.js.map +1 -0
- package/dist/src/commands/public-plugin-query.d.ts +16 -0
- package/dist/src/commands/public-plugin-query.js +231 -0
- package/dist/src/commands/public-plugin-query.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +177 -16
- package/dist/src/commands/rebuild-command.js +3370 -1559
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +100 -55
- package/dist/src/commands/rebuild-integration.js +866 -3275
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +68 -13
- package/dist/src/commands/rebuild-operations.js +309 -120
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +99 -0
- package/dist/src/commands/rebuild-platform-integration.js +2329 -0
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
- package/dist/src/commands/reconcile-operation-plan.d.ts +14 -9
- package/dist/src/commands/reconcile-operation-plan.js +26 -6
- package/dist/src/commands/reconcile-operation-plan.js.map +1 -1
- package/dist/src/commands/review-inspection.d.ts +60 -0
- package/dist/src/commands/review-inspection.js +437 -0
- package/dist/src/commands/review-inspection.js.map +1 -0
- package/dist/src/commands/review-preparation.d.ts +51 -0
- package/dist/src/commands/review-preparation.js +400 -0
- package/dist/src/commands/review-preparation.js.map +1 -0
- package/dist/src/commands/runtime.d.ts +5 -1
- package/dist/src/commands/runtime.js +41 -8
- package/dist/src/commands/runtime.js.map +1 -1
- package/dist/src/commands/skill-eval.d.ts +8 -0
- package/dist/src/commands/skill-eval.js +126 -73
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +148 -35
- package/dist/src/commands/status-v6.js +1166 -307
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/commands/targets-command.d.ts +38 -0
- package/dist/src/commands/targets-command.js +182 -0
- package/dist/src/commands/targets-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +7 -3
- package/dist/src/commands/wizard.js +7 -4
- package/dist/src/commands/wizard.js.map +1 -1
- package/dist/src/commands/write-commands.d.ts +7 -1
- package/dist/src/commands/write-commands.js +129 -38
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +2 -3
- package/dist/src/constants.js +2 -3
- package/dist/src/constants.js.map +1 -1
- package/dist/src/eval/manifest-v1.d.ts +6 -3
- package/dist/src/eval/manifest-v1.js +44 -33
- package/dist/src/eval/manifest-v1.js.map +1 -1
- package/dist/src/generators/local-plugin.d.ts +4 -2
- package/dist/src/generators/local-plugin.js +319 -353
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/generators/permissions.d.ts +20 -2
- package/dist/src/generators/permissions.js +82 -15
- package/dist/src/generators/permissions.js.map +1 -1
- package/dist/src/index.d.ts +2 -33
- package/dist/src/index.js +1575 -1919
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/deployment-preferences.d.ts +63 -0
- package/dist/src/intent/deployment-preferences.js +170 -0
- package/dist/src/intent/deployment-preferences.js.map +1 -0
- package/dist/src/intent/diagnostics.d.ts +11 -0
- package/dist/src/intent/diagnostics.js +14 -0
- package/dist/src/intent/diagnostics.js.map +1 -0
- package/dist/src/intent/intent-codec.d.ts +19 -0
- package/dist/src/intent/intent-codec.js +117 -0
- package/dist/src/intent/intent-codec.js.map +1 -0
- package/dist/src/intent/intent-store.d.ts +43 -0
- package/dist/src/intent/intent-store.js +118 -0
- package/dist/src/intent/intent-store.js.map +1 -0
- package/dist/src/intent/scope-context.d.ts +35 -0
- package/dist/src/intent/scope-context.js +179 -0
- package/dist/src/intent/scope-context.js.map +1 -0
- package/dist/src/intent/work-context.d.ts +13 -0
- package/dist/src/intent/work-context.js +22 -0
- package/dist/src/intent/work-context.js.map +1 -0
- package/dist/src/output/command-receipt.d.ts +6 -2
- package/dist/src/output/command-receipt.js +67 -32
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/component-delivery.d.ts +28 -0
- package/dist/src/output/component-delivery.js +141 -0
- package/dist/src/output/component-delivery.js.map +1 -0
- package/dist/src/output/public-result.d.ts +69 -0
- package/dist/src/output/public-result.js +403 -0
- package/dist/src/output/public-result.js.map +1 -0
- package/dist/src/output/rebuild-progress.d.ts +3 -0
- package/dist/src/output/rebuild-progress.js +34 -9
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.d.ts +7 -0
- package/dist/src/output/receipt-projection.js +664 -0
- package/dist/src/output/receipt-projection.js.map +1 -0
- package/dist/src/output/skill-invocation-notices.d.ts +18 -0
- package/dist/src/output/skill-invocation-notices.js +84 -0
- package/dist/src/output/skill-invocation-notices.js.map +1 -0
- package/dist/src/platforms/antigravity-permissions.d.ts +50 -0
- package/dist/src/platforms/antigravity-permissions.js +388 -0
- package/dist/src/platforms/antigravity-permissions.js.map +1 -0
- package/dist/src/platforms/capabilities.d.ts +9 -0
- package/dist/src/platforms/capabilities.js +125 -0
- package/dist/src/platforms/capabilities.js.map +1 -0
- package/dist/src/platforms/contracts.d.ts +394 -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 +28 -0
- package/dist/src/platforms/cursor-workspace-hook.js +198 -0
- package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
- package/dist/src/platforms/discovery.d.ts +100 -0
- package/dist/src/platforms/discovery.js +779 -0
- package/dist/src/platforms/discovery.js.map +1 -0
- package/dist/src/platforms/grok-permission-config.d.ts +23 -0
- package/dist/src/platforms/grok-permission-config.js +184 -0
- package/dist/src/platforms/grok-permission-config.js.map +1 -0
- package/dist/src/platforms/grok-permission-document.d.ts +4 -0
- package/dist/src/platforms/grok-permission-document.js +145 -0
- package/dist/src/platforms/grok-permission-document.js.map +1 -0
- package/dist/src/platforms/grok-permissions.d.ts +17 -0
- package/dist/src/platforms/grok-permissions.js +311 -0
- package/dist/src/platforms/grok-permissions.js.map +1 -0
- package/dist/src/platforms/host-permission-policy.d.ts +38 -0
- package/dist/src/platforms/host-permission-policy.js +86 -0
- package/dist/src/platforms/host-permission-policy.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 +380 -0
- package/dist/src/platforms/inspection-grok.js.map +1 -0
- package/dist/src/platforms/inspection-native.d.ts +8 -0
- package/dist/src/platforms/inspection-native.js +584 -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 +98 -0
- package/dist/src/platforms/inspection-opencode.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +9 -0
- package/dist/src/platforms/inspection-pi.js +490 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection-query.d.ts +26 -0
- package/dist/src/platforms/inspection-query.js +118 -0
- package/dist/src/platforms/inspection-query.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +20 -0
- package/dist/src/platforms/inspection.js +259 -0
- package/dist/src/platforms/inspection.js.map +1 -0
- package/dist/src/platforms/layout.d.ts +35 -0
- package/dist/src/platforms/layout.js +332 -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 +213 -0
- package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
- package/dist/src/platforms/lifecycle-native.d.ts +14 -0
- package/dist/src/platforms/lifecycle-native.js +234 -0
- package/dist/src/platforms/lifecycle-native.js.map +1 -0
- package/dist/src/platforms/lifecycle.d.ts +29 -0
- package/dist/src/platforms/lifecycle.js +688 -0
- package/dist/src/platforms/lifecycle.js.map +1 -0
- package/dist/src/platforms/opencode-permission-config.d.ts +13 -0
- package/dist/src/platforms/opencode-permission-config.js +253 -0
- package/dist/src/platforms/opencode-permission-config.js.map +1 -0
- package/dist/src/platforms/opencode-permissions.d.ts +39 -0
- package/dist/src/platforms/opencode-permissions.js +212 -0
- package/dist/src/platforms/opencode-permissions.js.map +1 -0
- package/dist/src/platforms/opencode-related-permissions.d.ts +40 -0
- package/dist/src/platforms/opencode-related-permissions.js +177 -0
- package/dist/src/platforms/opencode-related-permissions.js.map +1 -0
- package/dist/src/platforms/permission-ownership.d.ts +89 -0
- package/dist/src/platforms/permission-ownership.js +543 -0
- package/dist/src/platforms/permission-ownership.js.map +1 -0
- package/dist/src/platforms/permission-sidecar.d.ts +70 -0
- package/dist/src/platforms/permission-sidecar.js +215 -0
- package/dist/src/platforms/permission-sidecar.js.map +1 -0
- package/dist/src/platforms/projection-code-extension.d.ts +8 -0
- package/dist/src/platforms/projection-code-extension.js +126 -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 +28 -0
- package/dist/src/platforms/projection-files.js +113 -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 +13 -0
- package/dist/src/platforms/projection.js +578 -0
- package/dist/src/platforms/projection.js.map +1 -0
- package/dist/src/platforms/read-only-retry-policy.d.ts +34 -0
- package/dist/src/platforms/read-only-retry-policy.js +70 -0
- package/dist/src/platforms/read-only-retry-policy.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/retirement-native.d.ts +6 -0
- package/dist/src/platforms/retirement-native.js +95 -0
- package/dist/src/platforms/retirement-native.js.map +1 -0
- package/dist/src/platforms/supplement-layout.d.ts +20 -0
- package/dist/src/platforms/supplement-layout.js +54 -0
- package/dist/src/platforms/supplement-layout.js.map +1 -0
- package/dist/src/platforms/supplement-state.d.ts +13 -0
- package/dist/src/platforms/supplement-state.js +93 -0
- package/dist/src/platforms/supplement-state.js.map +1 -0
- package/dist/src/portable/commands.d.ts +60 -11
- package/dist/src/portable/commands.js +88 -346
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/historical-materialization.d.ts +25 -0
- package/dist/src/portable/historical-materialization.js +148 -0
- package/dist/src/portable/historical-materialization.js.map +1 -0
- package/dist/src/portable/materializer.d.ts +46 -2
- package/dist/src/portable/materializer.js +262 -259
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.d.ts +17 -0
- package/dist/src/portable/recovery-layout.js +42 -0
- package/dist/src/portable/recovery-layout.js.map +1 -0
- package/dist/src/portable/recovery.d.ts +177 -0
- package/dist/src/portable/recovery.js +597 -0
- package/dist/src/portable/recovery.js.map +1 -0
- package/dist/src/portable/writer.d.ts +67 -0
- package/dist/src/portable/writer.js +321 -0
- package/dist/src/portable/writer.js.map +1 -0
- package/dist/src/recovery/coordinator.d.ts +175 -0
- package/dist/src/recovery/coordinator.js +1624 -0
- package/dist/src/recovery/coordinator.js.map +1 -0
- package/dist/src/recovery/demand.d.ts +53 -0
- package/dist/src/recovery/demand.js +189 -0
- package/dist/src/recovery/demand.js.map +1 -0
- package/dist/src/recovery/install-concurrency.d.ts +48 -0
- package/dist/src/recovery/install-concurrency.js +196 -0
- package/dist/src/recovery/install-concurrency.js.map +1 -0
- package/dist/src/recovery/interruption.d.ts +19 -0
- package/dist/src/recovery/interruption.js +43 -0
- package/dist/src/recovery/interruption.js.map +1 -0
- package/dist/src/recovery/joint-coordinator.d.ts +46 -0
- package/dist/src/recovery/joint-coordinator.js +1723 -0
- package/dist/src/recovery/joint-coordinator.js.map +1 -0
- package/dist/src/recovery/joint-demand.d.ts +72 -0
- package/dist/src/recovery/joint-demand.js +332 -0
- package/dist/src/recovery/joint-demand.js.map +1 -0
- package/dist/src/recovery/joint-install-execution.d.ts +19 -0
- package/dist/src/recovery/joint-install-execution.js +308 -0
- package/dist/src/recovery/joint-install-execution.js.map +1 -0
- package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
- package/dist/src/recovery/joint-install-native-rebase.js +67 -0
- package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
- package/dist/src/recovery/performance.d.ts +4 -0
- package/dist/src/recovery/performance.js +26 -0
- package/dist/src/recovery/performance.js.map +1 -0
- package/dist/src/recovery/receipt.d.ts +131 -0
- package/dist/src/recovery/receipt.js +91 -0
- package/dist/src/recovery/receipt.js.map +1 -0
- package/dist/src/recovery/retirement.d.ts +47 -0
- package/dist/src/recovery/retirement.js +499 -0
- package/dist/src/recovery/retirement.js.map +1 -0
- package/dist/src/recovery/status.d.ts +143 -0
- package/dist/src/recovery/status.js +1528 -0
- package/dist/src/recovery/status.js.map +1 -0
- package/dist/src/recovery/types.d.ts +85 -0
- package/dist/src/recovery/types.js +2 -0
- package/dist/src/recovery/types.js.map +1 -0
- package/dist/src/review/eval-source-input.d.ts +44 -0
- package/dist/src/review/eval-source-input.js +213 -0
- package/dist/src/review/eval-source-input.js.map +1 -0
- package/dist/src/review/platform-profile.d.ts +5 -0
- package/dist/src/review/platform-profile.js +13 -0
- package/dist/src/review/platform-profile.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +20 -0
- package/dist/src/review/review-profile.js +286 -0
- package/dist/src/review/review-profile.js.map +1 -0
- package/dist/src/review/review-selection.d.ts +20 -0
- package/dist/src/review/review-selection.js +502 -0
- package/dist/src/review/review-selection.js.map +1 -0
- package/dist/src/review/review-types.d.ts +71 -0
- package/dist/src/review/review-types.js +16 -0
- package/dist/src/review/review-types.js.map +1 -0
- package/dist/src/review/skill-materialization.d.ts +67 -0
- package/dist/src/review/skill-materialization.js +235 -0
- package/dist/src/review/skill-materialization.js.map +1 -0
- package/dist/src/review/source-binding.d.ts +203 -0
- package/dist/src/review/source-binding.js +791 -0
- package/dist/src/review/source-binding.js.map +1 -0
- package/dist/src/tui/agent-management.d.ts +23 -0
- package/dist/src/tui/agent-management.js +319 -0
- package/dist/src/tui/agent-management.js.map +1 -0
- package/dist/src/tui/agent-settings.d.ts +47 -0
- package/dist/src/tui/agent-settings.js +97 -0
- package/dist/src/tui/agent-settings.js.map +1 -0
- package/dist/src/tui/catalog-generation.d.ts +9 -0
- package/dist/src/tui/catalog-generation.js +96 -6
- package/dist/src/tui/catalog-generation.js.map +1 -1
- package/dist/src/tui/catalog-sources/projection.d.ts +2 -2
- package/dist/src/tui/catalog-sources/screens.js +19 -12
- package/dist/src/tui/catalog-sources/screens.js.map +1 -1
- package/dist/src/tui/catalog-sources/session.d.ts +11 -1
- package/dist/src/tui/catalog-sources/session.js +80 -5
- package/dist/src/tui/catalog-sources/session.js.map +1 -1
- package/dist/src/tui/catalog-sources/types.d.ts +15 -2
- package/dist/src/tui/catalog-store-task.d.ts +16 -0
- package/dist/src/tui/catalog-store-task.js +19 -0
- package/dist/src/tui/catalog-store-task.js.map +1 -0
- package/dist/src/tui/clipboard.d.ts +13 -0
- package/dist/src/tui/clipboard.js +95 -0
- package/dist/src/tui/clipboard.js.map +1 -0
- package/dist/src/tui/components.d.ts +113 -3
- package/dist/src/tui/components.js +201 -34
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/config-array-draft.d.ts +30 -0
- package/dist/src/tui/config-array-draft.js +51 -0
- package/dist/src/tui/config-array-draft.js.map +1 -0
- package/dist/src/tui/config-leaf-editor.d.ts +44 -0
- package/dist/src/tui/config-leaf-editor.js +227 -0
- package/dist/src/tui/config-leaf-editor.js.map +1 -0
- package/dist/src/tui/config-object-suggestions.d.ts +15 -0
- package/dist/src/tui/config-object-suggestions.js +71 -0
- package/dist/src/tui/config-object-suggestions.js.map +1 -0
- package/dist/src/tui/config-references.d.ts +38 -0
- package/dist/src/tui/config-references.js +82 -0
- package/dist/src/tui/config-references.js.map +1 -0
- package/dist/src/tui/config-suggestions.d.ts +27 -0
- package/dist/src/tui/config-suggestions.js +62 -0
- package/dist/src/tui/config-suggestions.js.map +1 -0
- package/dist/src/tui/config-value-presentation.d.ts +23 -0
- package/dist/src/tui/config-value-presentation.js +151 -0
- package/dist/src/tui/config-value-presentation.js.map +1 -0
- package/dist/src/tui/console-app-v4.d.ts +14 -5
- package/dist/src/tui/console-app-v4.js +9779 -2488
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/content-item-card.d.ts +13 -0
- package/dist/src/tui/content-item-card.js +51 -0
- package/dist/src/tui/content-item-card.js.map +1 -0
- package/dist/src/tui/controller-runtime.d.ts +4 -3
- package/dist/src/tui/controller-runtime.js +1610 -590
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +583 -80
- package/dist/src/tui/controller.js +3362 -263
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/dependency-graph-view.d.ts +39 -0
- package/dist/src/tui/dependency-graph-view.js +121 -0
- package/dist/src/tui/dependency-graph-view.js.map +1 -0
- package/dist/src/tui/dependency-graph.d.ts +81 -0
- package/dist/src/tui/dependency-graph.js +452 -0
- package/dist/src/tui/dependency-graph.js.map +1 -0
- package/dist/src/tui/deployment-view.d.ts +14 -0
- package/dist/src/tui/deployment-view.js +175 -0
- package/dist/src/tui/deployment-view.js.map +1 -0
- package/dist/src/tui/diagnostic-projection.d.ts +31 -0
- package/dist/src/tui/diagnostic-projection.js +681 -0
- package/dist/src/tui/diagnostic-projection.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +6 -2
- package/dist/src/tui/diagnostics.js +14 -2
- package/dist/src/tui/diagnostics.js.map +1 -1
- package/dist/src/tui/entity-cards.d.ts +56 -0
- package/dist/src/tui/entity-cards.js +327 -0
- package/dist/src/tui/entity-cards.js.map +1 -0
- package/dist/src/tui/glossary.d.ts +25 -0
- package/dist/src/tui/glossary.js +78 -0
- package/dist/src/tui/glossary.js.map +1 -0
- package/dist/src/tui/guided-setup.d.ts +25 -0
- package/dist/src/tui/guided-setup.js +101 -0
- package/dist/src/tui/guided-setup.js.map +1 -0
- package/dist/src/tui/index.d.ts +4 -1
- package/dist/src/tui/index.js +4 -1
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/input-display.d.ts +1 -0
- package/dist/src/tui/input-display.js +23 -1
- package/dist/src/tui/input-display.js.map +1 -1
- package/dist/src/tui/keys.d.ts +44 -0
- package/dist/src/tui/keys.js +43 -15
- package/dist/src/tui/keys.js.map +1 -1
- package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
- package/dist/src/tui/lifecycle-action-view.js +36 -0
- package/dist/src/tui/lifecycle-action-view.js.map +1 -0
- package/dist/src/tui/model.d.ts +141 -28
- package/dist/src/tui/model.js +968 -285
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.d.ts +8 -0
- package/dist/src/tui/operation-diagnostic-screens.js +76 -0
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
- package/dist/src/tui/operation-history.d.ts +91 -0
- package/dist/src/tui/operation-history.js +167 -0
- package/dist/src/tui/operation-history.js.map +1 -0
- package/dist/src/tui/operation-review-planner.d.ts +7 -0
- package/dist/src/tui/operation-review-planner.js +980 -146
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-content.d.ts +33 -0
- package/dist/src/tui/plugin-content.js +245 -0
- package/dist/src/tui/plugin-content.js.map +1 -0
- package/dist/src/tui/plugin-detail.d.ts +75 -0
- package/dist/src/tui/plugin-detail.js +267 -0
- package/dist/src/tui/plugin-detail.js.map +1 -0
- package/dist/src/tui/plugin-write-task.d.ts +69 -0
- package/dist/src/tui/plugin-write-task.js +286 -0
- package/dist/src/tui/plugin-write-task.js.map +1 -0
- package/dist/src/tui/query-header.d.ts +30 -0
- package/dist/src/tui/query-header.js +40 -0
- package/dist/src/tui/query-header.js.map +1 -0
- package/dist/src/tui/reader.d.ts +38 -0
- package/dist/src/tui/reader.js +49 -0
- package/dist/src/tui/reader.js.map +1 -0
- package/dist/src/tui/router.d.ts +170 -39
- package/dist/src/tui/router.js +338 -50
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/scoped-flow.d.ts +49 -0
- package/dist/src/tui/scoped-flow.js +212 -0
- package/dist/src/tui/scoped-flow.js.map +1 -0
- package/dist/src/tui/scoped-inventory.d.ts +139 -0
- package/dist/src/tui/scoped-inventory.js +295 -0
- package/dist/src/tui/scoped-inventory.js.map +1 -0
- package/dist/src/tui/screen-registry.d.ts +696 -0
- package/dist/src/tui/screen-registry.js +226 -0
- package/dist/src/tui/screen-registry.js.map +1 -0
- package/dist/src/tui/session-console-app.d.ts +8 -0
- package/dist/src/tui/session-console-app.js +24 -0
- package/dist/src/tui/session-console-app.js.map +1 -0
- package/dist/src/tui/session-host.d.ts +45 -0
- package/dist/src/tui/session-host.js +219 -0
- package/dist/src/tui/session-host.js.map +1 -0
- package/dist/src/tui/source-detail-card.d.ts +29 -0
- package/dist/src/tui/source-detail-card.js +45 -0
- package/dist/src/tui/source-detail-card.js.map +1 -0
- package/dist/src/tui/theme.d.ts +12 -0
- package/dist/src/tui/theme.js +12 -0
- package/dist/src/tui/theme.js.map +1 -1
- package/dist/src/tui/viewport.d.ts +1 -0
- package/dist/src/tui/viewport.js +23 -0
- package/dist/src/tui/viewport.js.map +1 -1
- package/dist/src/tui/wizard.js +26 -4
- package/dist/src/tui/wizard.js.map +1 -1
- package/dist/src/types.d.ts +105 -83
- package/dist/src/types.js +1 -1
- 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 +6 -8
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +18 -25
- package/dist/src/utils/artifact-plan.js +59 -445
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +64 -90
- package/dist/src/utils/artifact-renderer.js +202 -303
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +19 -14
- package/dist/src/utils/artifact-request.js +51 -36
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/artifact-sources.d.ts +4 -8
- package/dist/src/utils/artifact-sources.js +15 -6
- package/dist/src/utils/artifact-sources.js.map +1 -1
- package/dist/src/utils/aw-home-mutation-lock.js +2 -1
- package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
- package/dist/src/utils/bundle-layout.d.ts +2 -0
- package/dist/src/utils/bundle-layout.js +88 -158
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
- package/dist/src/utils/catalog-capability-projection.js +14 -0
- package/dist/src/utils/catalog-capability-projection.js.map +1 -0
- package/dist/src/utils/catalog-digests.d.ts +2 -12
- package/dist/src/utils/catalog-digests.js +7 -55
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-generation-resolver.d.ts +28 -4
- package/dist/src/utils/catalog-generation-resolver.js +146 -40
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
- package/dist/src/utils/catalog-generation-service.d.ts +24 -2
- package/dist/src/utils/catalog-generation-service.js +92 -48
- package/dist/src/utils/catalog-generation-service.js.map +1 -1
- package/dist/src/utils/catalog-generation-state.js +1 -1
- package/dist/src/utils/catalog-generation-state.js.map +1 -1
- package/dist/src/utils/catalog-generation-store.d.ts +4 -0
- package/dist/src/utils/catalog-generation-store.js +68 -10
- package/dist/src/utils/catalog-generation-store.js.map +1 -1
- package/dist/src/utils/catalog-operation-context.d.ts +61 -4
- package/dist/src/utils/catalog-operation-context.js +225 -4
- package/dist/src/utils/catalog-operation-context.js.map +1 -1
- package/dist/src/utils/catalog-public-error.js +4 -0
- package/dist/src/utils/catalog-public-error.js.map +1 -1
- package/dist/src/utils/catalog-runtime-projection.d.ts +4 -3
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-snapshot.d.ts +3 -0
- package/dist/src/utils/catalog-snapshot.js +4 -1
- package/dist/src/utils/catalog-snapshot.js.map +1 -1
- package/dist/src/utils/catalog-source-impact.d.ts +3 -2
- package/dist/src/utils/catalog-source-impact.js +142 -20
- package/dist/src/utils/catalog-source-impact.js.map +1 -1
- package/dist/src/utils/catalog-source-references.d.ts +57 -1
- package/dist/src/utils/catalog-source-references.js +755 -162
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/catalog-sources.d.ts +1 -1
- package/dist/src/utils/catalog-sources.js +21 -5
- package/dist/src/utils/catalog-sources.js.map +1 -1
- package/dist/src/utils/codex-config.d.ts +3 -0
- package/dist/src/utils/codex-config.js +7 -0
- package/dist/src/utils/codex-config.js.map +1 -1
- package/dist/src/utils/codex-executable-discovery.d.ts +28 -0
- package/dist/src/utils/codex-executable-discovery.js +431 -0
- package/dist/src/utils/codex-executable-discovery.js.map +1 -0
- package/dist/src/utils/codex-manager.d.ts +23 -42
- package/dist/src/utils/codex-manager.js +79 -767
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +40 -1
- package/dist/src/utils/codex-native-observation.js +172 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/codex-reconciler.d.ts +2 -7
- package/dist/src/utils/codex-reconciler.js +33 -5
- package/dist/src/utils/codex-reconciler.js.map +1 -1
- package/dist/src/utils/codex-shared-native.d.ts +8 -26
- package/dist/src/utils/codex-shared-native.js +63 -83
- 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-skills-root.d.ts +4 -0
- package/dist/src/utils/codex-skills-root.js +29 -0
- package/dist/src/utils/codex-skills-root.js.map +1 -0
- package/dist/src/utils/codex-surface-analysis.d.ts +6 -2
- package/dist/src/utils/codex-surface-analysis.js +31 -56
- package/dist/src/utils/codex-surface-analysis.js.map +1 -1
- package/dist/src/utils/component-agent-binding.d.ts +17 -0
- package/dist/src/utils/component-agent-binding.js +119 -0
- package/dist/src/utils/component-agent-binding.js.map +1 -0
- package/dist/src/utils/component-command-preparation.d.ts +33 -0
- package/dist/src/utils/component-command-preparation.js +129 -0
- package/dist/src/utils/component-command-preparation.js.map +1 -0
- package/dist/src/utils/component-gap.d.ts +4 -0
- package/dist/src/utils/component-gap.js +16 -0
- package/dist/src/utils/component-gap.js.map +1 -0
- package/dist/src/utils/component-resources.d.ts +53 -0
- package/dist/src/utils/component-resources.js +340 -0
- package/dist/src/utils/component-resources.js.map +1 -0
- package/dist/src/utils/config-platforms.d.ts +21 -0
- package/dist/src/utils/config-platforms.js +51 -0
- package/dist/src/utils/config-platforms.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +18 -6
- package/dist/src/utils/dynamic-skill-tree.js +33 -40
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/git-catalog-provider.d.ts +3 -0
- package/dist/src/utils/git-catalog-provider.js +49 -3
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/inventory-recovery-diagnostic.d.ts +4 -0
- package/dist/src/utils/inventory-recovery-diagnostic.js +15 -0
- package/dist/src/utils/inventory-recovery-diagnostic.js.map +1 -0
- package/dist/src/utils/local-marketplace.d.ts +19 -12
- package/dist/src/utils/local-marketplace.js +97 -194
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-cli-review.d.ts +53 -0
- package/dist/src/utils/managed-command-cli-review.js +431 -0
- package/dist/src/utils/managed-command-cli-review.js.map +1 -0
- package/dist/src/utils/managed-command-closure.d.ts +14 -0
- package/dist/src/utils/managed-command-closure.js +156 -0
- package/dist/src/utils/managed-command-closure.js.map +1 -0
- package/dist/src/utils/managed-command-errors.d.ts +5 -0
- package/dist/src/utils/managed-command-errors.js +10 -0
- package/dist/src/utils/managed-command-errors.js.map +1 -0
- package/dist/src/utils/managed-command-materialization.d.ts +90 -0
- package/dist/src/utils/managed-command-materialization.js +375 -0
- package/dist/src/utils/managed-command-materialization.js.map +1 -0
- package/dist/src/utils/managed-command-preparation.d.ts +30 -0
- package/dist/src/utils/managed-command-preparation.js +39 -0
- package/dist/src/utils/managed-command-preparation.js.map +1 -0
- package/dist/src/utils/managed-command-review.d.ts +33 -0
- package/dist/src/utils/managed-command-review.js +80 -0
- package/dist/src/utils/managed-command-review.js.map +1 -0
- package/dist/src/utils/managed-command-runtime.d.ts +36 -0
- package/dist/src/utils/managed-command-runtime.js +126 -0
- package/dist/src/utils/managed-command-runtime.js.map +1 -0
- package/dist/src/utils/managed-command-snapshots.d.ts +24 -0
- package/dist/src/utils/managed-command-snapshots.js +89 -0
- package/dist/src/utils/managed-command-snapshots.js.map +1 -0
- package/dist/src/utils/managed-command-store.d.ts +141 -0
- package/dist/src/utils/managed-command-store.js +839 -0
- package/dist/src/utils/managed-command-store.js.map +1 -0
- package/dist/src/utils/multi-source-catalog.d.ts +6 -1
- package/dist/src/utils/multi-source-catalog.js +9 -4
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli-interruption.d.ts +8 -0
- package/dist/src/utils/native-cli-interruption.js +65 -0
- package/dist/src/utils/native-cli-interruption.js.map +1 -0
- package/dist/src/utils/native-cli.d.ts +37 -6
- package/dist/src/utils/native-cli.js +523 -60
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +29 -0
- package/dist/src/utils/native-demand.js +4 -0
- package/dist/src/utils/native-demand.js.map +1 -0
- package/dist/src/utils/native-tool-context.d.ts +17 -0
- package/dist/src/utils/native-tool-context.js +40 -0
- package/dist/src/utils/native-tool-context.js.map +1 -0
- package/dist/src/utils/native-tool-review.d.ts +8 -0
- package/dist/src/utils/native-tool-review.js +14 -0
- package/dist/src/utils/native-tool-review.js.map +1 -0
- package/dist/src/utils/ownership.d.ts +38 -3
- package/dist/src/utils/ownership.js +118 -11
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/package-content.d.ts +7 -0
- package/dist/src/utils/package-content.js +70 -0
- package/dist/src/utils/package-content.js.map +1 -0
- package/dist/src/utils/path-catalog-provider.js +2 -0
- package/dist/src/utils/path-catalog-provider.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -1
- package/dist/src/utils/paths.js +5 -2
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +69 -0
- package/dist/src/utils/platform-empty-state.js +249 -0
- package/dist/src/utils/platform-empty-state.js.map +1 -0
- package/dist/src/utils/platform-support.d.ts +1 -1
- package/dist/src/utils/platform-support.js +1 -1
- package/dist/src/utils/platform-support.js.map +1 -1
- package/dist/src/utils/plugin-config-command-apply.d.ts +33 -0
- package/dist/src/utils/plugin-config-command-apply.js +142 -0
- package/dist/src/utils/plugin-config-command-apply.js.map +1 -0
- package/dist/src/utils/plugin-config-diagnostics.d.ts +16 -0
- package/dist/src/utils/plugin-config-diagnostics.js +44 -0
- package/dist/src/utils/plugin-config-diagnostics.js.map +1 -0
- package/dist/src/utils/plugin-config-impact.d.ts +76 -0
- package/dist/src/utils/plugin-config-impact.js +359 -0
- package/dist/src/utils/plugin-config-impact.js.map +1 -0
- package/dist/src/utils/plugin-config-references.d.ts +116 -0
- package/dist/src/utils/plugin-config-references.js +379 -0
- package/dist/src/utils/plugin-config-references.js.map +1 -0
- package/dist/src/utils/plugin-config-suggestion-runner.d.ts +83 -0
- package/dist/src/utils/plugin-config-suggestion-runner.js +308 -0
- package/dist/src/utils/plugin-config-suggestion-runner.js.map +1 -0
- package/dist/src/utils/plugin-config-suggestions.d.ts +50 -0
- package/dist/src/utils/plugin-config-suggestions.js +322 -0
- package/dist/src/utils/plugin-config-suggestions.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +108 -19
- package/dist/src/utils/plugin-config-write.js +781 -568
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +122 -43
- package/dist/src/utils/plugin-config.js +574 -610
- 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 +41 -17
- package/dist/src/utils/plugin-scripts.js +586 -123
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-lock.js +14 -5
- package/dist/src/utils/process-lock.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +2 -2
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/src/utils/project-boundary.d.ts +11 -1
- package/dist/src/utils/project-boundary.js +33 -11
- package/dist/src/utils/project-boundary.js.map +1 -1
- package/dist/src/utils/rendered-contract.js +24 -1
- package/dist/src/utils/rendered-contract.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +18 -0
- package/dist/src/utils/runtime-config.js +64 -0
- package/dist/src/utils/runtime-config.js.map +1 -0
- package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
- package/dist/src/utils/runtime-skill-closure.js +50 -7
- package/dist/src/utils/runtime-skill-closure.js.map +1 -1
- package/dist/src/utils/safe-operation-diagnostic.d.ts +15 -0
- package/dist/src/utils/safe-operation-diagnostic.js +33 -0
- package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
- package/dist/src/utils/sensitive-content.d.ts +4 -0
- package/dist/src/utils/sensitive-content.js +36 -0
- package/dist/src/utils/sensitive-content.js.map +1 -0
- package/dist/src/utils/skill-invocation-warning.d.ts +19 -0
- package/dist/src/utils/skill-invocation-warning.js +43 -0
- package/dist/src/utils/skill-invocation-warning.js.map +1 -0
- package/dist/src/utils/skill-validation.js +0 -5
- package/dist/src/utils/skill-validation.js.map +1 -1
- package/dist/src/utils/state-paths.d.ts +8 -3
- package/dist/src/utils/state-paths.js +53 -16
- package/dist/src/utils/state-paths.js.map +1 -1
- package/dist/src/utils/target-eligibility.d.ts +2 -2
- package/dist/src/utils/target-eligibility.js.map +1 -1
- package/dist/src/utils/windows-claude-shim.d.ts +7 -0
- package/dist/src/utils/windows-claude-shim.js +10 -0
- package/dist/src/utils/windows-claude-shim.js.map +1 -0
- package/dist/src/utils/windows-npm-shim.d.ts +16 -0
- package/dist/src/utils/windows-npm-shim.js +155 -0
- package/dist/src/utils/windows-npm-shim.js.map +1 -0
- package/dist/vitest.config.js +109 -9
- package/dist/vitest.config.js.map +1 -1
- package/package.json +20 -12
- package/dist/authoring/templates/aw-config-runtime.d.mts +0 -2
- package/dist/authoring/templates/aw-config-runtime.mjs +0 -407
- package/dist/authoring/templates/aw-config-runtime.mjs.map +0 -1
- package/dist/src/commands/review-publication.d.ts +0 -99
- package/dist/src/commands/review-publication.js +0 -904
- package/dist/src/commands/review-publication.js.map +0 -1
- package/dist/src/commands/sync-command.d.ts +0 -23
- package/dist/src/commands/sync-command.js +0 -242
- package/dist/src/commands/sync-command.js.map +0 -1
- package/dist/src/portable/skills-cli.d.ts +0 -43
- package/dist/src/portable/skills-cli.js +0 -148
- package/dist/src/portable/skills-cli.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/plugin-intent-state.d.ts +0 -34
- package/dist/src/utils/plugin-intent-state.js +0 -289
- package/dist/src/utils/plugin-intent-state.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
|
@@ -1,21 +1,143 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { isCanonicalCodexMarketplaceRegistration } from './codex-shared-native.js';
|
|
3
|
+
import { readIntentReferences } from '../recovery/demand.js';
|
|
4
|
+
import { resolveIntentPath } from '../intent/intent-store.js';
|
|
1
5
|
import path from 'node:path';
|
|
2
6
|
import fs from 'fs-extra';
|
|
7
|
+
import { computeCanonicalDirectoryDigest } from '@lesliechan721/agent-skill-eval';
|
|
8
|
+
import { NATIVE_PLATFORM_TARGETS, isPlatformTarget, resolveBundlePlatformRoot } from '@lesliechan721/aw-plugin-core/manifest';
|
|
3
9
|
import { readClaudeSettings } from '../adapters/helpers.js';
|
|
4
10
|
import { readCodexConfigFile } from './codex-config.js';
|
|
5
11
|
import { readJsonFileIfExists } from './json.js';
|
|
6
12
|
import { getClaudeHome, getCodexHome, canonicalizePathThroughExistingAncestorSync, resolveAwHome, resolveAwHomeCanonical, resolveRepoRootSync, } from './state-paths.js';
|
|
7
|
-
import { OWNED_TEXT_HEADER_PREFIX, SHARED_OWNER_TOKEN_PREFIX, parseSharedOwnerToken, parseOwnedTextHeader, readSkillOwnerMarker, SKILL_OWNER_MARKER, } from './ownership.js';
|
|
13
|
+
import { OWNED_TEXT_HEADER_PREFIX, SHARED_OWNER_TOKEN_PREFIX, inspectOwnedComponents, parseSharedOwnerToken, parseOwnedTextHeader, readSkillOwnerMarker, SKILL_OWNER_MARKER, } from './ownership.js';
|
|
8
14
|
import { sanitizeCatalogSourceErrorMessage } from './catalog-public-error.js';
|
|
9
|
-
import { readStrictNamespacedMarketplaceRoot } from './local-marketplace.js';
|
|
10
|
-
import {
|
|
11
|
-
|
|
15
|
+
import { canonicalMarketplaceRegistrationPath, readStrictNamespacedMarketplaceRoot } from './local-marketplace.js';
|
|
16
|
+
import { getDeploymentLayout, getManagedPlatformRoot, getInvocationPolicyPhysicalKey, isAntigravityProjectDirectory } from '../platforms/layout.js';
|
|
17
|
+
import { deploymentPackageComponent } from '../platforms/inspection.js';
|
|
18
|
+
import { canonicalNamespaceRoot, getPhysicalKey, identityDigest } from '../platforms/identity.js';
|
|
19
|
+
import { offlinePermissionComponents } from '../platforms/permission-ownership.js';
|
|
20
|
+
import { resolvePlatformConfigRoot } from '../platforms/discovery.js';
|
|
21
|
+
import { readPlatformPackageContentDigest } from './platform-empty-state.js';
|
|
22
|
+
export function legacyCanonicalMarketplaceRegistrationNames(references, sourceId) {
|
|
12
23
|
return [...new Set(references.flatMap((reference) => reference.kind === 'namespacedMarketplace'
|
|
13
24
|
&& reference.sourceId === sourceId
|
|
14
25
|
&& reference.pluginName === undefined
|
|
26
|
+
&& reference.platform === undefined
|
|
27
|
+
&& reference.marketplaceRoot
|
|
15
28
|
&& reference.marketplaceName
|
|
16
29
|
? [reference.marketplaceName]
|
|
17
30
|
: []))];
|
|
18
31
|
}
|
|
32
|
+
function isNativeMarketplaceConsumer(reference) {
|
|
33
|
+
return !reference.disabledNativeActivation && !reference.marketplaceManifestEntry;
|
|
34
|
+
}
|
|
35
|
+
/** Raw host consumers and their canonical inventory copies can describe the
|
|
36
|
+
* same registration. Ignore that duplicate only when its binding is resolved. */
|
|
37
|
+
export function scopedCleanupMarketplaceEvidence(options) {
|
|
38
|
+
const { references, pluginName, platform, scope } = options;
|
|
39
|
+
const registrations = references.filter((reference) => reference.kind === 'namespacedMarketplace'
|
|
40
|
+
&& reference.platform === platform && reference.pluginName === undefined
|
|
41
|
+
&& reference.marketplaceRegistrationPath !== undefined
|
|
42
|
+
&& (reference.scope === undefined || reference.scope === 'user' || reference.scope === scope));
|
|
43
|
+
const consumers = references.filter((reference) => reference.kind === 'namespacedMarketplace'
|
|
44
|
+
&& reference.pluginName === pluginName && reference.platform === platform
|
|
45
|
+
&& reference.scope === scope && reference.marketplaceName);
|
|
46
|
+
const nativeConsumers = consumers.filter(isNativeMarketplaceConsumer);
|
|
47
|
+
const unboundConsumers = nativeConsumers.filter((consumer) => {
|
|
48
|
+
if (consumer.sourceId !== undefined)
|
|
49
|
+
return false;
|
|
50
|
+
const boundRoots = new Set(nativeConsumers.flatMap((bound) => bound.sourceId && bound.sourceIdentity && bound.marketplaceRoot
|
|
51
|
+
&& bound.marketplaceName === consumer.marketplaceName && bound.projectKey === consumer.projectKey
|
|
52
|
+
? [bound.marketplaceRoot] : []));
|
|
53
|
+
const observedPaths = new Set(registrations.filter((entry) => entry.marketplaceName === consumer.marketplaceName)
|
|
54
|
+
.map((entry) => entry.marketplaceRegistrationPath));
|
|
55
|
+
return observedPaths.size === 0 ? boundRoots.size !== 1
|
|
56
|
+
: observedPaths.size !== 1 || [...observedPaths].some((location) => !location || !boundRoots.has(location));
|
|
57
|
+
});
|
|
58
|
+
return { registrations, consumers, unboundConsumers };
|
|
59
|
+
}
|
|
60
|
+
/** Resolve the same scope-local identity for offline preview and execution. A root
|
|
61
|
+
* identifies a marketplace, not a package or permission to remove that package. */
|
|
62
|
+
export function resolveCleanupMarketplaceIdentity(options) {
|
|
63
|
+
const { references, sourceId, sourceIdentity, pluginName, platform, scope } = options;
|
|
64
|
+
if (platform !== 'codex' && platform !== 'claude' && platform !== 'copilot')
|
|
65
|
+
return {};
|
|
66
|
+
const { registrations, consumers, unboundConsumers } = scopedCleanupMarketplaceEvidence(options);
|
|
67
|
+
const roots = references.filter((reference) => reference.kind === 'namespacedMarketplace'
|
|
68
|
+
&& reference.pluginName === undefined && reference.marketplaceRoot && reference.marketplaceName
|
|
69
|
+
&& (reference.platform === platform || platform !== 'copilot' && reference.platform === undefined));
|
|
70
|
+
const matchedConsumers = consumers.filter((reference) => reference.sourceId === sourceId);
|
|
71
|
+
const candidates = references.filter((reference) => reference.sourceId === sourceId
|
|
72
|
+
&& reference.sourceIdentity === sourceIdentity && reference.pluginName === pluginName
|
|
73
|
+
&& reference.platform === platform && reference.scope === scope
|
|
74
|
+
&& reference.recoveryCandidate?.evidence === 'verified' && reference.marketplaceRoot);
|
|
75
|
+
const liveNames = new Set(matchedConsumers.map((reference) => reference.marketplaceName));
|
|
76
|
+
const provenNames = new Map();
|
|
77
|
+
const addName = (name, root) => {
|
|
78
|
+
const paths = provenNames.get(name) ?? new Set();
|
|
79
|
+
paths.add(root);
|
|
80
|
+
provenNames.set(name, paths);
|
|
81
|
+
};
|
|
82
|
+
for (const reference of candidates) {
|
|
83
|
+
const candidate = reference.recoveryCandidate;
|
|
84
|
+
const id = candidate.nativeIdentity?.registrationId;
|
|
85
|
+
const separator = id?.lastIndexOf('@') ?? -1;
|
|
86
|
+
if (id && separator > 0 && candidate.binding.platform === platform && candidate.binding.scope.kind === scope
|
|
87
|
+
&& candidate.binding.plugin.sourceId === sourceId && candidate.binding.plugin.sourceIdentity === sourceIdentity
|
|
88
|
+
&& id.slice(0, separator) === pluginName && id.slice(separator + 1)
|
|
89
|
+
&& candidate.nativeIdentity?.sourceLocation === path.join(reference.marketplaceRoot, 'plugins', pluginName)) {
|
|
90
|
+
const name = id.slice(separator + 1);
|
|
91
|
+
liveNames.add(name);
|
|
92
|
+
addName(name, reference.marketplaceRoot);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const hasVerifiedCandidate = provenNames.size > 0;
|
|
96
|
+
for (const root of roots) {
|
|
97
|
+
if (root.sourceId !== sourceId || root.sourceIdentity !== sourceIdentity)
|
|
98
|
+
continue;
|
|
99
|
+
if (liveNames.size === 0 || liveNames.has(root.marketplaceName))
|
|
100
|
+
addName(root.marketplaceName, root.marketplaceRoot);
|
|
101
|
+
}
|
|
102
|
+
const unresolved = () => ({ marketplaceIdentityUnresolved: true });
|
|
103
|
+
if (liveNames.size > 1 || provenNames.size > 1)
|
|
104
|
+
return unresolved();
|
|
105
|
+
if (provenNames.size === 0)
|
|
106
|
+
return unboundConsumers.length > 0 || matchedConsumers.some(isNativeMarketplaceConsumer)
|
|
107
|
+
|| references.some((reference) => reference.sourceId === sourceId
|
|
108
|
+
&& reference.sourceIdentity === sourceIdentity && reference.pluginName === pluginName
|
|
109
|
+
&& reference.platform === platform && reference.scope === scope && reference.recoveryCandidate?.evidence === 'verified')
|
|
110
|
+
? unresolved() : {};
|
|
111
|
+
const [marketplaceName, paths] = [...provenNames][0];
|
|
112
|
+
if (liveNames.size === 1 && !liveNames.has(marketplaceName))
|
|
113
|
+
return unresolved();
|
|
114
|
+
const observed = registrations.filter((registration) => registration.marketplaceName === marketplaceName);
|
|
115
|
+
// An empty canonical root alone does not resolve some other, unbound
|
|
116
|
+
// marketplace's same-name activation. Preserve it and report the ambiguity.
|
|
117
|
+
if (!observed.length && !hasVerifiedCandidate && unboundConsumers.some((consumer) => consumer.marketplaceName !== marketplaceName))
|
|
118
|
+
return unresolved();
|
|
119
|
+
// Multiple physical markets sharing a name cannot be disambiguated by the name alone.
|
|
120
|
+
// An actual host registration can conclusively select one of those roots.
|
|
121
|
+
if (observed.some((registration) => !registration.marketplaceRegistrationPath
|
|
122
|
+
|| !paths.has(registration.marketplaceRegistrationPath)))
|
|
123
|
+
return unresolved();
|
|
124
|
+
const selectedPaths = observed.length ? new Set(observed.map((registration) => registration.marketplaceRegistrationPath)) : paths;
|
|
125
|
+
if (selectedPaths.size !== 1)
|
|
126
|
+
return unresolved();
|
|
127
|
+
const selectedRoot = [...selectedPaths][0];
|
|
128
|
+
if (candidates.some((candidate) => candidate.marketplaceRoot !== selectedRoot))
|
|
129
|
+
return unresolved();
|
|
130
|
+
if (!observed.length && roots.some((root) => root.marketplaceName === marketplaceName
|
|
131
|
+
&& root.marketplaceRoot !== selectedRoot))
|
|
132
|
+
return unresolved();
|
|
133
|
+
if (roots.some((root) => root.marketplaceRoot === selectedRoot
|
|
134
|
+
&& (root.sourceId !== sourceId || root.sourceIdentity !== sourceIdentity || root.marketplaceName !== marketplaceName)))
|
|
135
|
+
return unresolved();
|
|
136
|
+
const matchingActivation = consumers.some((consumer) => isNativeMarketplaceConsumer(consumer) && !consumer.managedNativeRegistration
|
|
137
|
+
&& consumer.marketplaceName === marketplaceName
|
|
138
|
+
&& (consumer.sourceId === undefined || consumer.sourceId === sourceId && consumer.sourceIdentity === sourceIdentity));
|
|
139
|
+
return { marketplaceName, ...(matchingActivation ? { nativeRegistration: true } : {}) };
|
|
140
|
+
}
|
|
19
141
|
function pluginNameFromMarketplaceId(pluginId, marketplaceName) {
|
|
20
142
|
const suffix = `@${marketplaceName}`;
|
|
21
143
|
return pluginId.endsWith(suffix) && pluginId.length > suffix.length
|
|
@@ -26,10 +148,11 @@ function claudeConsumersFromSettings(value, marketplaceName, scope) {
|
|
|
26
148
|
if (!value)
|
|
27
149
|
return [];
|
|
28
150
|
const output = [];
|
|
29
|
-
for (const pluginId of Object.
|
|
151
|
+
for (const [pluginId, enabled] of Object.entries(isRecord(value.enabledPlugins) ? value.enabledPlugins : {})) {
|
|
30
152
|
const pluginName = pluginNameFromMarketplaceId(pluginId, marketplaceName);
|
|
31
153
|
if (pluginName)
|
|
32
|
-
output.push({ pluginName, platform: 'claude', scope
|
|
154
|
+
output.push({ pluginName, platform: 'claude', scope,
|
|
155
|
+
...(enabled === false ? { disabledNativeActivation: true } : {}) });
|
|
33
156
|
}
|
|
34
157
|
const plugins = isRecord(value.plugins) && isRecord(value.plugins.installed)
|
|
35
158
|
? value.plugins.installed
|
|
@@ -44,7 +167,7 @@ function claudeConsumersFromSettings(value, marketplaceName, scope) {
|
|
|
44
167
|
}
|
|
45
168
|
return output;
|
|
46
169
|
}
|
|
47
|
-
function claudeConsumersFromInstalled(value, marketplaceName, currentProject, includeHistoricalProjects = false) {
|
|
170
|
+
function claudeConsumersFromInstalled(value, marketplaceName, currentProject, includeHistoricalProjects = false, includeManaged = false) {
|
|
48
171
|
const output = [];
|
|
49
172
|
if (value !== null && !isRecord(value)) {
|
|
50
173
|
throw new Error('Claude installed_plugins must be a JSON object.');
|
|
@@ -68,12 +191,17 @@ function claudeConsumersFromInstalled(value, marketplaceName, currentProject, in
|
|
|
68
191
|
if (item.scope !== undefined
|
|
69
192
|
&& item.scope !== 'user'
|
|
70
193
|
&& item.scope !== 'project'
|
|
71
|
-
&& item.scope !== 'local'
|
|
194
|
+
&& item.scope !== 'local'
|
|
195
|
+
&& item.scope !== 'managed') {
|
|
72
196
|
throw new Error(`Claude installed_plugins record ${key} has an invalid scope.`);
|
|
73
197
|
}
|
|
74
198
|
if (item.projectPath !== undefined && typeof item.projectPath !== 'string') {
|
|
75
199
|
throw new Error(`Claude installed_plugins record ${key} has an invalid projectPath.`);
|
|
76
200
|
}
|
|
201
|
+
// Managed policy is a host-global residual clue, but is never an AW
|
|
202
|
+
// user registration or an independent project reference.
|
|
203
|
+
if (item.scope === 'managed' && !includeManaged)
|
|
204
|
+
continue;
|
|
77
205
|
const itemMarketplace = typeof item.marketplace === 'string'
|
|
78
206
|
? item.marketplace
|
|
79
207
|
: pluginNameFromMarketplaceId(key, marketplaceName) ? marketplaceName : undefined;
|
|
@@ -92,7 +220,8 @@ function claudeConsumersFromInstalled(value, marketplaceName, currentProject, in
|
|
|
92
220
|
const pluginName = typeof item.name === 'string'
|
|
93
221
|
? item.name
|
|
94
222
|
: pluginNameFromMarketplaceId(key, marketplaceName) ?? key;
|
|
95
|
-
output.push({ pluginName, platform: 'claude', scope, ...(scope === 'project' ? { projectKey } : {})
|
|
223
|
+
output.push({ pluginName, platform: 'claude', scope, ...(scope === 'project' ? { projectKey } : {}),
|
|
224
|
+
...(item.scope === 'managed' ? { managedNativeRegistration: true } : {}) });
|
|
96
225
|
}
|
|
97
226
|
}
|
|
98
227
|
return output;
|
|
@@ -127,6 +256,7 @@ function inventoryErrorRelevance(location, env, cwd) {
|
|
|
127
256
|
[path.join(repoRoot, '.codex'), 'codex'],
|
|
128
257
|
[path.join(repoRoot, '.agents'), 'codex'],
|
|
129
258
|
[path.join(repoRoot, '.claude'), 'claude'],
|
|
259
|
+
[path.join(repoRoot, '.github', 'copilot'), 'copilot'],
|
|
130
260
|
];
|
|
131
261
|
for (const [root, platform] of projectRoots) {
|
|
132
262
|
if (pathSegmentsWithin(root, location) !== null) {
|
|
@@ -144,7 +274,16 @@ function inventoryErrorRelevance(location, env, cwd) {
|
|
|
144
274
|
if (pathSegmentsWithin(getClaudeHome(env), location) !== null) {
|
|
145
275
|
return { global: false, platform: 'claude', scope: 'user' };
|
|
146
276
|
}
|
|
277
|
+
const copilotRoot = resolvePlatformConfigRoot('copilot', { env, cwd });
|
|
278
|
+
if (pathSegmentsWithin(copilotRoot, location) !== null) {
|
|
279
|
+
return { global: false, platform: 'copilot', scope: 'user' };
|
|
280
|
+
}
|
|
147
281
|
for (const root of new Set([awHome, canonicalAwHome])) {
|
|
282
|
+
const platformPath = pathSegmentsWithin(path.join(root, 'platforms'), location);
|
|
283
|
+
if (platformPath && (platformPath.length <= 2 || platformPath[2] === 'marketplaces')
|
|
284
|
+
&& (platformPath[0] === 'codex' || platformPath[0] === 'claude' || platformPath[0] === 'copilot')) {
|
|
285
|
+
return { global: false, platform: platformPath[0], ...(platformPath[3] ? { sourceId: platformPath[3] } : {}) };
|
|
286
|
+
}
|
|
148
287
|
const marketplace = pathSegmentsWithin(path.join(root, 'marketplaces'), location);
|
|
149
288
|
if (marketplace?.[0])
|
|
150
289
|
return { global: false, sourceId: marketplace[0] };
|
|
@@ -178,11 +317,12 @@ function isAbsentState(error) {
|
|
|
178
317
|
}
|
|
179
318
|
function inventoryError(error, location, kind, env, cwd, relevance) {
|
|
180
319
|
const message = error instanceof Error ? error.message : String(error);
|
|
181
|
-
const sensitiveRoots = [getCodexHome(env), getClaudeHome(env), resolveRepoRootSync(cwd)];
|
|
320
|
+
const sensitiveRoots = [getCodexHome(env), getClaudeHome(env), resolvePlatformConfigRoot('copilot', { env, cwd }), resolveRepoRootSync(cwd)];
|
|
182
321
|
return {
|
|
183
322
|
code: 'stateInventoryFailed',
|
|
184
323
|
kind,
|
|
185
324
|
location: sanitizeCatalogSourceErrorMessage(location, env, sensitiveRoots),
|
|
325
|
+
recoveryPath: path.resolve(location),
|
|
186
326
|
message: sanitizeCatalogSourceErrorMessage(message, env, sensitiveRoots),
|
|
187
327
|
relevance: relevance ?? inventoryErrorRelevance(location, env, cwd),
|
|
188
328
|
};
|
|
@@ -274,35 +414,6 @@ async function inventoryPluginConfigRoots(options) {
|
|
|
274
414
|
if (userRoot)
|
|
275
415
|
roots.push({ root: userRoot, scope: 'user' });
|
|
276
416
|
}
|
|
277
|
-
const rawRepoRoot = resolveRepoRootSync(options.cwd);
|
|
278
|
-
const repoRoot = await inventoryRead({
|
|
279
|
-
operation: () => fs.realpath(rawRepoRoot),
|
|
280
|
-
absent: null,
|
|
281
|
-
reportAbsent: true,
|
|
282
|
-
errors: options.errors,
|
|
283
|
-
location: rawRepoRoot,
|
|
284
|
-
kind: 'projectRootRead',
|
|
285
|
-
env: options.env,
|
|
286
|
-
cwd: options.cwd,
|
|
287
|
-
});
|
|
288
|
-
if (repoRoot && await inventoryCanonicalDirectory({
|
|
289
|
-
errors: options.errors,
|
|
290
|
-
location: repoRoot,
|
|
291
|
-
kind: 'projectRootRead',
|
|
292
|
-
env: options.env,
|
|
293
|
-
cwd: options.cwd,
|
|
294
|
-
})) {
|
|
295
|
-
const projectRoot = await inventoryCanonicalDescendantDirectory({
|
|
296
|
-
root: rawRepoRoot,
|
|
297
|
-
segments: ['.agent-workflows', 'plugin-config'],
|
|
298
|
-
errors: options.errors,
|
|
299
|
-
kind: 'configDirectoryRead',
|
|
300
|
-
env: options.env,
|
|
301
|
-
cwd: options.cwd,
|
|
302
|
-
});
|
|
303
|
-
if (projectRoot)
|
|
304
|
-
roots.push({ root: projectRoot, scope: 'project', projectKey: repoRoot });
|
|
305
|
-
}
|
|
306
417
|
return roots;
|
|
307
418
|
}
|
|
308
419
|
export async function inventoryLegacyOwnerReferences(options) {
|
|
@@ -314,7 +425,11 @@ export async function inventoryLegacyOwnerReferences(options) {
|
|
|
314
425
|
const skillRoots = new Set([
|
|
315
426
|
path.join(getCodexHome(env), 'skills'),
|
|
316
427
|
path.join(getClaudeHome(env), 'skills'),
|
|
317
|
-
|
|
428
|
+
...(options.scope !== 'user' && (options.includeProjectAgentSkills ?? options.scope === undefined)
|
|
429
|
+
? [path.join(repoRoot, '.agents', 'skills')] : []),
|
|
430
|
+
...(options.scope === 'user' ? [] : [
|
|
431
|
+
path.join(repoRoot, '.claude', 'skills'),
|
|
432
|
+
]),
|
|
318
433
|
]);
|
|
319
434
|
const legacyPluginsRoot = path.join(awHome, 'plugins');
|
|
320
435
|
const legacyPlugins = await inventoryRead({
|
|
@@ -365,7 +480,8 @@ export async function inventoryLegacyConfigReferences(options) {
|
|
|
365
480
|
const env = options.env ?? process.env;
|
|
366
481
|
const references = [];
|
|
367
482
|
const errors = [];
|
|
368
|
-
for (const configRoot of await inventoryPluginConfigRoots({ errors, env, cwd: options.cwd
|
|
483
|
+
for (const configRoot of await inventoryPluginConfigRoots({ errors, env, cwd: options.cwd,
|
|
484
|
+
scope: options.scope })) {
|
|
369
485
|
const directory = configRoot.root;
|
|
370
486
|
const entries = await inventoryRead({
|
|
371
487
|
operation: () => fs.readdir(directory, { withFileTypes: true }),
|
|
@@ -397,6 +513,15 @@ export async function inventoryLegacyConfigReferences(options) {
|
|
|
397
513
|
return { inventorySchemaVersion: 1, references, errors };
|
|
398
514
|
}
|
|
399
515
|
function ownerReferenceFromRaw(entryPath, raw) {
|
|
516
|
+
if (raw?.schemaVersion === 1 && raw.owner === 'agent-workflows') {
|
|
517
|
+
return {
|
|
518
|
+
kind: 'legacyOwner',
|
|
519
|
+
location: entryPath,
|
|
520
|
+
...(typeof raw.plugin === 'string' ? { pluginName: raw.plugin } : {}),
|
|
521
|
+
...(typeof raw.platform === 'string' ? { platform: raw.platform } : {}),
|
|
522
|
+
...(typeof raw.scope === 'string' ? { scope: raw.scope } : {}),
|
|
523
|
+
};
|
|
524
|
+
}
|
|
400
525
|
if (raw?.schemaVersion === 3 && raw.owner === 'agent-workflows'
|
|
401
526
|
&& typeof raw.sourceId === 'string'
|
|
402
527
|
&& raw.pluginId === `${raw.sourceId}/${raw.plugin}`) {
|
|
@@ -404,6 +529,7 @@ function ownerReferenceFromRaw(entryPath, raw) {
|
|
|
404
529
|
kind: 'namespacedOwner',
|
|
405
530
|
location: entryPath,
|
|
406
531
|
sourceId: raw.sourceId,
|
|
532
|
+
...(typeof raw.sourceIdentity === 'string' ? { sourceIdentity: raw.sourceIdentity } : {}),
|
|
407
533
|
...(typeof raw.plugin === 'string' ? { pluginName: raw.plugin } : {}),
|
|
408
534
|
...(typeof raw.platform === 'string' ? { platform: raw.platform } : {}),
|
|
409
535
|
...(typeof raw.scope === 'string' ? { scope: raw.scope } : {}),
|
|
@@ -411,6 +537,27 @@ function ownerReferenceFromRaw(entryPath, raw) {
|
|
|
411
537
|
}
|
|
412
538
|
return null;
|
|
413
539
|
}
|
|
540
|
+
function legacyOwnedHeaderReference(filePath, content) {
|
|
541
|
+
const normalized = content.replace(/\r\n/gu, '\n');
|
|
542
|
+
const frontmatterEnd = normalized.startsWith('---\n')
|
|
543
|
+
? normalized.indexOf('\n---\n', 4)
|
|
544
|
+
: -1;
|
|
545
|
+
const headerIndex = frontmatterEnd === -1 ? 0 : frontmatterEnd + '\n---\n'.length;
|
|
546
|
+
const lineEnd = normalized.indexOf('\n', headerIndex);
|
|
547
|
+
const line = normalized.slice(headerIndex, lineEnd === -1 ? normalized.length : lineEnd);
|
|
548
|
+
if (!line.startsWith(OWNED_TEXT_HEADER_PREFIX))
|
|
549
|
+
return null;
|
|
550
|
+
const raw = (() => {
|
|
551
|
+
try {
|
|
552
|
+
return JSON.parse(line.slice(OWNED_TEXT_HEADER_PREFIX.length));
|
|
553
|
+
}
|
|
554
|
+
catch {
|
|
555
|
+
return null;
|
|
556
|
+
}
|
|
557
|
+
})();
|
|
558
|
+
const reference = ownerReferenceFromRaw(filePath, raw);
|
|
559
|
+
return reference?.kind === 'legacyOwner' ? reference : null;
|
|
560
|
+
}
|
|
414
561
|
async function readOwnedHeaderReference(filePath, requireGeneratedName, errors, env, cwd) {
|
|
415
562
|
const stats = await inventoryRead({
|
|
416
563
|
operation: () => fs.stat(filePath),
|
|
@@ -436,6 +583,16 @@ async function readOwnedHeaderReference(filePath, requireGeneratedName, errors,
|
|
|
436
583
|
return null;
|
|
437
584
|
if (!content.includes(OWNED_TEXT_HEADER_PREFIX))
|
|
438
585
|
return null;
|
|
586
|
+
const legacyReference = legacyOwnedHeaderReference(filePath, content);
|
|
587
|
+
if (legacyReference) {
|
|
588
|
+
if (requireGeneratedName
|
|
589
|
+
&& legacyReference.pluginName
|
|
590
|
+
&& !path.basename(filePath).startsWith(`aw-${legacyReference.pluginName}-`)) {
|
|
591
|
+
errors.push(inventoryError(new Error('Owned text header path does not match its plugin identity.'), filePath, 'ownerHeaderPathValidation', env, cwd));
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
return legacyReference;
|
|
595
|
+
}
|
|
439
596
|
let parsed;
|
|
440
597
|
try {
|
|
441
598
|
parsed = parseOwnedTextHeader(content);
|
|
@@ -447,20 +604,35 @@ async function readOwnedHeaderReference(filePath, requireGeneratedName, errors,
|
|
|
447
604
|
if (!parsed)
|
|
448
605
|
return null;
|
|
449
606
|
if (requireGeneratedName
|
|
450
|
-
&& !path.basename(filePath).startsWith(
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
607
|
+
&& !path.basename(filePath).startsWith(parsed.identity.sourceId
|
|
608
|
+
? `aw-${parsed.identity.sourceId}-${parsed.identity.plugin}-` : `aw-${parsed.identity.plugin}-`)) {
|
|
609
|
+
const physical = inventoryErrorRelevance(filePath, env, cwd);
|
|
610
|
+
let configKey;
|
|
611
|
+
if (!physical.global && physical.platform === 'codex' && path.extname(filePath) === '.toml') {
|
|
612
|
+
try {
|
|
613
|
+
const configPath = physical.scope === 'project' ? path.join(resolveRepoRootSync(cwd), '.codex/config.toml') : path.join(getCodexHome(env), 'config.toml');
|
|
614
|
+
const config = await readCodexConfigFile(configPath);
|
|
615
|
+
const keys = [];
|
|
616
|
+
for (const [name, value] of Object.entries(config.snapshot.agents)) {
|
|
617
|
+
if (typeof value.configFile === 'string'
|
|
618
|
+
&& path.resolve(path.dirname(configPath), value.configFile) === path.resolve(filePath))
|
|
619
|
+
keys.push(`agents.${name}.config_file`);
|
|
620
|
+
}
|
|
621
|
+
configKey = keys.length === 1 ? keys[0] : keys.length > 1 ? 'agents' : undefined;
|
|
622
|
+
}
|
|
623
|
+
catch { /* Unknown references require manual inspection. */ }
|
|
624
|
+
}
|
|
625
|
+
const issue = inventoryError(new Error('Owned text header path does not match its plugin identity.'), filePath, 'ownerHeaderPathValidation', env, cwd, !physical.global && configKey && configKey !== 'agents' ? { ...physical,
|
|
626
|
+
componentName: configKey.slice('agents.'.length, -'.config_file'.length) } : physical);
|
|
627
|
+
if (configKey)
|
|
628
|
+
issue.configKey = configKey;
|
|
629
|
+
errors.push(issue);
|
|
458
630
|
return null;
|
|
459
631
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
632
|
+
const reference = ownerReferenceFromRaw(filePath, { schemaVersion: 3, ...parsed.identity });
|
|
633
|
+
return reference ? { ...reference, ownedComponent: { kind: 'owned-text-file', path: filePath,
|
|
634
|
+
allowedRoot: path.dirname(filePath), identity: parsed.identity },
|
|
635
|
+
pathEvidence: await offlineOwnedPathEvidence(filePath) } : null;
|
|
464
636
|
}
|
|
465
637
|
async function findOwnedHeadersInDirectory(directory, extensions, requireGeneratedName, errors, env, cwd) {
|
|
466
638
|
const output = [];
|
|
@@ -511,10 +683,17 @@ async function resolveCanonicalPluginSkillRoots(pluginRoot, includeLegacyFallbac
|
|
|
511
683
|
cwd,
|
|
512
684
|
}),
|
|
513
685
|
]);
|
|
514
|
-
const
|
|
515
|
-
|
|
686
|
+
const safePlatformSkills = safeRelativeSkillRoot(platformManifest?.skills);
|
|
687
|
+
const safeSourceSkills = safeRelativeSkillRoot(sourceManifest?.skills);
|
|
688
|
+
const declaredPath = safePlatformSkills
|
|
689
|
+
? path.join(pluginRoot, ...safePlatformSkills.split('/'))
|
|
690
|
+
: await resolveBundlePlatformRoot(pluginRoot, 'codex', {
|
|
691
|
+
skills: './skills',
|
|
692
|
+
}).then((resolved) => (safeSourceSkills
|
|
693
|
+
? path.join(resolved.resourceRoot, ...safeSourceSkills.split('/'))
|
|
694
|
+
: resolved.skillsRoot)).catch(() => path.join(pluginRoot, ...(safeSourceSkills ?? 'skills').split('/')));
|
|
516
695
|
return [...new Set([
|
|
517
|
-
|
|
696
|
+
declaredPath,
|
|
518
697
|
...(includeLegacyFallbacks ? [
|
|
519
698
|
path.join(pluginRoot, 'skills'),
|
|
520
699
|
path.join(pluginRoot, 'codex', 'skills'),
|
|
@@ -553,6 +732,12 @@ async function findDirectSkillOwnerMarkers(root, errors, env, cwd) {
|
|
|
553
732
|
marker = await readSkillOwnerMarker({ skillRoot, allowedRoot: root });
|
|
554
733
|
}
|
|
555
734
|
catch (error) {
|
|
735
|
+
const legacy = await fs.readJson(markerPath).catch(() => null);
|
|
736
|
+
const legacyReference = ownerReferenceFromRaw(markerPath, legacy);
|
|
737
|
+
if (legacyReference?.kind === 'legacyOwner') {
|
|
738
|
+
output.push(legacyReference);
|
|
739
|
+
continue;
|
|
740
|
+
}
|
|
556
741
|
if (!isAbsentState(error)) {
|
|
557
742
|
const code = error.code;
|
|
558
743
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -585,14 +770,17 @@ function sharedOwnerTokenReferences(filePath, tokens, errors, env, cwd) {
|
|
|
585
770
|
kind: 'namespacedOwner',
|
|
586
771
|
location: filePath,
|
|
587
772
|
sourceId: identity.sourceId,
|
|
773
|
+
...(identity.sourceIdentity ? { sourceIdentity: identity.sourceIdentity } : {}),
|
|
588
774
|
pluginName: identity.plugin,
|
|
589
775
|
platform: identity.platform,
|
|
590
776
|
scope: identity.scope,
|
|
777
|
+
...(identity.platform === 'claude' ? { ownedComponent: { kind: 'shared-config', identity, label: filePath,
|
|
778
|
+
locator: { kind: 'claude-permissions', settingsPath: filePath, ownerKey: token } } } : {}),
|
|
591
779
|
});
|
|
592
780
|
}
|
|
593
781
|
return output;
|
|
594
782
|
}
|
|
595
|
-
async function codexSharedOwnerReferences(filePath,
|
|
783
|
+
async function codexSharedOwnerReferences(filePath, scope, errors, env, cwd) {
|
|
596
784
|
const config = await readCodexConfigFile(filePath);
|
|
597
785
|
const ownerValues = [
|
|
598
786
|
...Object.keys(config.snapshot.developerInstructions.managedBlocks).map((value) => ({
|
|
@@ -601,14 +789,42 @@ async function codexSharedOwnerReferences(filePath, _scope, errors, env, cwd) {
|
|
|
601
789
|
})),
|
|
602
790
|
];
|
|
603
791
|
const references = sharedOwnerTokenReferences(filePath, ownerValues.map((entry) => entry.value).filter((value) => value.startsWith(SHARED_OWNER_TOKEN_PREFIX)), errors, env, cwd);
|
|
792
|
+
if (scope === 'user') {
|
|
793
|
+
for (const { value, location } of ownerValues) {
|
|
794
|
+
if (value.startsWith(SHARED_OWNER_TOKEN_PREFIX)
|
|
795
|
+
|| !/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(value))
|
|
796
|
+
continue;
|
|
797
|
+
references.push({
|
|
798
|
+
kind: 'legacyOwner',
|
|
799
|
+
location,
|
|
800
|
+
pluginName: value,
|
|
801
|
+
platform: 'codex',
|
|
802
|
+
scope,
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
}
|
|
604
806
|
return references;
|
|
605
807
|
}
|
|
606
|
-
async function claudeSharedOwnerReferences(filePath,
|
|
808
|
+
async function claudeSharedOwnerReferences(filePath, scope, errors, env, cwd) {
|
|
607
809
|
const settings = await readJsonFileIfExists(filePath);
|
|
608
810
|
const generated = settings && isRecord(settings.awGenerated) ? settings.awGenerated : null;
|
|
609
811
|
const permissions = generated && isRecord(generated.permissions) ? generated.permissions : {};
|
|
610
812
|
const keys = Object.keys(permissions);
|
|
611
813
|
const references = sharedOwnerTokenReferences(filePath, keys.filter((token) => token.startsWith(SHARED_OWNER_TOKEN_PREFIX)), errors, env, cwd);
|
|
814
|
+
if (scope === 'user') {
|
|
815
|
+
for (const key of keys) {
|
|
816
|
+
if (key.startsWith(SHARED_OWNER_TOKEN_PREFIX)
|
|
817
|
+
|| !/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(key))
|
|
818
|
+
continue;
|
|
819
|
+
references.push({
|
|
820
|
+
kind: 'legacyOwner',
|
|
821
|
+
location: filePath,
|
|
822
|
+
pluginName: key,
|
|
823
|
+
platform: 'claude',
|
|
824
|
+
scope,
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
}
|
|
612
828
|
return references;
|
|
613
829
|
}
|
|
614
830
|
function isRecord(value) {
|
|
@@ -616,16 +832,25 @@ function isRecord(value) {
|
|
|
616
832
|
}
|
|
617
833
|
function assertNamespacedConfigEnvelope(value, sourceId, pluginName) {
|
|
618
834
|
if (!isRecord(value)
|
|
619
|
-
|| value.schemaVersion !==
|
|
835
|
+
|| value.schemaVersion !== 6
|
|
620
836
|
|| typeof value.sourceId !== 'string'
|
|
621
|
-
|| typeof value.sourceIdentity !== 'string'
|
|
622
|
-
|| !/^sha256:[0-9a-f]{64}$/u.test(value.sourceIdentity)
|
|
623
837
|
|| typeof value.pluginName !== 'string'
|
|
624
|
-
|| !isRecord(value.
|
|
838
|
+
|| !isRecord(value.binding)
|
|
839
|
+
|| !isRecord(value.common)
|
|
840
|
+
|| !isRecord(value.platforms)
|
|
841
|
+
|| Object.entries(value.platforms).some(([platform, values]) => !isPlatformTarget(platform) || !isRecord(values))
|
|
625
842
|
|| Object.keys(value).some((key) => ![
|
|
626
|
-
'schemaVersion', 'sourceId', '
|
|
843
|
+
'schemaVersion', 'sourceId', 'pluginName', 'binding', 'common', 'platforms',
|
|
627
844
|
].includes(key))) {
|
|
628
|
-
throw new Error('Namespaced plugin config is not a valid schema
|
|
845
|
+
throw new Error('Namespaced plugin config is not a valid schema 6 envelope.');
|
|
846
|
+
}
|
|
847
|
+
const binding = value.binding;
|
|
848
|
+
const validBinding = binding.kind === 'source'
|
|
849
|
+
&& typeof binding.sourceIdentity === 'string'
|
|
850
|
+
&& /^sha256:[0-9a-f]{64}$/u.test(binding.sourceIdentity)
|
|
851
|
+
&& Object.keys(binding).every((key) => ['kind', 'sourceIdentity'].includes(key));
|
|
852
|
+
if (!validBinding) {
|
|
853
|
+
throw new Error('Namespaced user plugin config has an invalid binding.');
|
|
629
854
|
}
|
|
630
855
|
if (value.sourceId !== sourceId || value.pluginName !== pluginName) {
|
|
631
856
|
throw new Error('Namespaced plugin config identity does not match its directory path.');
|
|
@@ -653,6 +878,7 @@ async function oldMarketplaceReferences(env, cwd, errors, includePlatformHistori
|
|
|
653
878
|
const claudeInstalledPath = path.join(getClaudeHome(env), 'plugins', 'installed_plugins.json');
|
|
654
879
|
const output = [];
|
|
655
880
|
const marketplacesRoot = path.join(resolveAwHome(env), 'marketplaces');
|
|
881
|
+
const canonicalLegacyRoot = path.join(await canonicalNamespaceRoot(resolveAwHome(env)), 'marketplaces');
|
|
656
882
|
const namespacedPrimaryRoots = new Set();
|
|
657
883
|
const marketplaceEntries = await inventoryCanonicalDirectoryEntries({
|
|
658
884
|
errors, location: marketplacesRoot, kind: 'marketplaceDirectoryRead', env, cwd,
|
|
@@ -675,6 +901,7 @@ async function oldMarketplaceReferences(env, cwd, errors, includePlatformHistori
|
|
|
675
901
|
});
|
|
676
902
|
if (manifest?.name === 'aw' && config?.schemaVersion === 2 && config.sourceId === entry.name) {
|
|
677
903
|
namespacedPrimaryRoots.add(path.normalize(path.join(marketplacesRoot, entry.name)));
|
|
904
|
+
namespacedPrimaryRoots.add(path.join(canonicalLegacyRoot, entry.name));
|
|
678
905
|
}
|
|
679
906
|
}
|
|
680
907
|
const codex = await inventoryRead({
|
|
@@ -682,9 +909,7 @@ async function oldMarketplaceReferences(env, cwd, errors, includePlatformHistori
|
|
|
682
909
|
location: codexPath, kind: 'nativeStateRead', env, cwd,
|
|
683
910
|
});
|
|
684
911
|
const codexAw = codex?.snapshot.marketplaces.aw;
|
|
685
|
-
const codexAwIsNamespaced = codexAw
|
|
686
|
-
&& !codexAw.sourcePointsToManifest
|
|
687
|
-
&& namespacedPrimaryRoots.has(path.normalize(codexAw.source ?? ''));
|
|
912
|
+
const codexAwIsNamespaced = [...namespacedPrimaryRoots].some((root) => isCanonicalCodexMarketplaceRegistration(codexAw, root));
|
|
688
913
|
if (codex && (Object.hasOwn(codex.snapshot.marketplaces, 'aw') || Object.keys(codex.snapshot.plugins).some(isAwPluginConsumerKey))
|
|
689
914
|
&& !codexAwIsNamespaced) {
|
|
690
915
|
output.push({ kind: 'legacyMarketplace', location: codexPath });
|
|
@@ -716,11 +941,13 @@ async function oldMarketplaceReferences(env, cwd, errors, includePlatformHistori
|
|
|
716
941
|
const claudeAwIsNamespaced = declarationPaths.length > 0
|
|
717
942
|
&& declarationPaths.every((entry) => namespacedPrimaryRoots.has(path.normalize(entry)));
|
|
718
943
|
if ((settings && (Object.hasOwn(settings.extraKnownMarketplaces ?? {}, 'aw')
|
|
719
|
-
||
|
|
944
|
+
|| Object.entries(settings.enabledPlugins ?? {}).some(([key, enabled]) => isAwPluginConsumerKey(key) && enabled !== false)
|
|
720
945
|
|| hasAwPluginConsumerKeys(settings.plugins?.installed)
|
|
721
946
|
|| hasClaudeMarketplaceConsumer(settings.plugins?.installed))) && !claudeAwIsNamespaced) {
|
|
722
947
|
output.push({ kind: 'legacyMarketplace', location: claudeSettingsPath });
|
|
723
948
|
for (const consumer of claudeConsumersFromSettings(settings, 'aw', 'user')) {
|
|
949
|
+
if (consumer.disabledNativeActivation)
|
|
950
|
+
continue;
|
|
724
951
|
output.push({ kind: 'legacyMarketplace', location: claudeSettingsPath, ...consumer });
|
|
725
952
|
}
|
|
726
953
|
}
|
|
@@ -757,6 +984,8 @@ async function oldMarketplaceReferences(env, cwd, errors, includePlatformHistori
|
|
|
757
984
|
});
|
|
758
985
|
if (!claudeAwIsNamespaced) {
|
|
759
986
|
for (const consumer of claudeConsumersFromSettings(projectSettings, 'aw', 'project')) {
|
|
987
|
+
if (consumer.disabledNativeActivation)
|
|
988
|
+
continue;
|
|
760
989
|
output.push({ kind: 'legacyMarketplace', location: projectSettingsPath, ...consumer });
|
|
761
990
|
}
|
|
762
991
|
}
|
|
@@ -796,13 +1025,258 @@ function sourceIdFromCanonicalMarketplacePath(candidate, marketplacesRoot) {
|
|
|
796
1025
|
const sourceId = path.basename(resolved);
|
|
797
1026
|
return sourceId !== '' && sourceId !== '.' && sourceId !== '..' ? sourceId : null;
|
|
798
1027
|
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
}
|
|
1028
|
+
const MARKETPLACE_PLATFORMS = ['codex', 'claude', 'copilot'];
|
|
1029
|
+
async function managedMarketplaceDirectories(awRoot, cwd, env) {
|
|
1030
|
+
const directories = new Map();
|
|
1031
|
+
for (const platform of MARKETPLACE_PLATFORMS) {
|
|
1032
|
+
const configRoot = await canonicalNamespaceRoot(resolvePlatformConfigRoot(platform, { cwd, env }));
|
|
1033
|
+
directories.set(platform, path.join(getManagedPlatformRoot(awRoot, platform, `${platform}-marketplace`, configRoot), 'marketplaces'));
|
|
1034
|
+
}
|
|
1035
|
+
return directories;
|
|
1036
|
+
}
|
|
1037
|
+
function pluginMarketplaceName(pluginId) {
|
|
1038
|
+
const separator = pluginId.lastIndexOf('@');
|
|
1039
|
+
return separator > 0 && separator < pluginId.length - 1 ? pluginId.slice(separator + 1) : undefined;
|
|
1040
|
+
}
|
|
1041
|
+
/** A missing package container is valid after removal; a foreign container is not. */
|
|
1042
|
+
async function assertMarketplacePluginsContainer(root) {
|
|
1043
|
+
const pluginsRoot = path.join(root, 'plugins');
|
|
1044
|
+
const stat = await fs.lstat(pluginsRoot).catch((error) => {
|
|
1045
|
+
if (isAbsentState(error))
|
|
1046
|
+
return null;
|
|
1047
|
+
throw error;
|
|
1048
|
+
});
|
|
1049
|
+
if (stat && (!stat.isDirectory() || stat.isSymbolicLink()))
|
|
1050
|
+
throw new Error('Marketplace plugins container must be a canonical directory.');
|
|
1051
|
+
}
|
|
1052
|
+
async function readEnabledPluginsInventory(location) {
|
|
1053
|
+
const value = await readJsonFileIfExists(location);
|
|
1054
|
+
if (value === null || value === undefined)
|
|
1055
|
+
return {};
|
|
1056
|
+
if (!isRecord(value) || value.enabledPlugins !== undefined && !isRecord(value.enabledPlugins)) {
|
|
1057
|
+
throw new Error('Native settings enabledPlugins must be a JSON object.');
|
|
1058
|
+
}
|
|
1059
|
+
if (isRecord(value.enabledPlugins) && Object.values(value.enabledPlugins).some((enabled) => typeof enabled !== 'boolean')) {
|
|
1060
|
+
throw new Error('Native settings enabledPlugins entries must be boolean.');
|
|
1061
|
+
}
|
|
1062
|
+
return isRecord(value.enabledPlugins) ? value.enabledPlugins : {};
|
|
1063
|
+
}
|
|
1064
|
+
/** Operation-local fingerprints bind reviewed output bytes; they do not confer ownership. */
|
|
1065
|
+
export async function offlineOwnedPathEvidence(location) {
|
|
1066
|
+
const stat = await fs.lstat(location);
|
|
1067
|
+
if (stat.isSymbolicLink())
|
|
1068
|
+
throw new Error('offlineCleanupPathUnsafe');
|
|
1069
|
+
if (stat.isDirectory())
|
|
1070
|
+
return computeCanonicalDirectoryDigest(location);
|
|
1071
|
+
if (!stat.isFile())
|
|
1072
|
+
throw new Error('offlineCleanupPathUnsafe');
|
|
1073
|
+
return `sha256:${crypto.createHash('sha256').update(await fs.readFile(location)).digest('hex')}`;
|
|
1074
|
+
}
|
|
1075
|
+
async function observedProjectReference(options) {
|
|
1076
|
+
const { binding, layout, errors, env, cwd } = options;
|
|
1077
|
+
if (binding.scope.kind !== 'project')
|
|
1078
|
+
return false;
|
|
1079
|
+
const projectRoot = binding.scope.projectRoot;
|
|
1080
|
+
const nativeId = layout.nativeIdentity.registrationId ?? layout.nativeIdentity.packageId;
|
|
1081
|
+
const settingsPath = binding.platform === 'codex' ? path.join(projectRoot, '.codex/config.toml')
|
|
1082
|
+
: binding.platform === 'claude' ? path.join(projectRoot, '.claude/settings.local.json')
|
|
1083
|
+
: binding.platform === 'copilot' ? path.join(projectRoot, '.github/copilot/settings.local.json') : undefined;
|
|
1084
|
+
if (settingsPath) {
|
|
1085
|
+
const recorded = await inventoryRead({ errors, env, cwd, location: settingsPath, kind: 'nativeProjectActivationRead', absent: false,
|
|
1086
|
+
operation: async () => {
|
|
1087
|
+
if (binding.platform === 'codex')
|
|
1088
|
+
return Object.hasOwn((await readCodexConfigFile(settingsPath)).snapshot.plugins, nativeId);
|
|
1089
|
+
const value = await readJsonFileIfExists(settingsPath);
|
|
1090
|
+
if (value == null)
|
|
1091
|
+
return false;
|
|
1092
|
+
if (!isRecord(value) || value.enabledPlugins !== undefined && !isRecord(value.enabledPlugins))
|
|
1093
|
+
throw new Error('nativeProjectActivationInvalid');
|
|
1094
|
+
return isRecord(value.enabledPlugins) && Object.hasOwn(value.enabledPlugins, nativeId);
|
|
1095
|
+
} });
|
|
1096
|
+
if (recorded)
|
|
1097
|
+
return true;
|
|
1098
|
+
}
|
|
1099
|
+
if (binding.platform !== 'codex' && binding.platform !== 'claude')
|
|
1100
|
+
return false;
|
|
1101
|
+
const policyKey = await getInvocationPolicyPhysicalKey({ cwd, env }, binding);
|
|
1102
|
+
const supplementKeys = new Set([policyKey, ...layout.renderUnits.filter((unit) => unit.output === 'supplement').map((unit) => unit.physicalKey)]);
|
|
1103
|
+
const references = binding.platform === 'codex'
|
|
1104
|
+
? [...await findOwnedHeadersInDirectory(path.join(projectRoot, '.codex/agents'), new Set(['.toml']), false, errors, env, cwd),
|
|
1105
|
+
...await findOwnedHeadersInDirectory(path.join(projectRoot, '.codex/rules'), new Set(['.rules']), false, errors, env, cwd)]
|
|
1106
|
+
: await claudeSharedOwnerReferences(path.join(projectRoot, '.claude/settings.local.json'), 'project', errors, env, cwd);
|
|
1107
|
+
if (references.some((reference) => {
|
|
1108
|
+
const identity = reference.ownedComponent?.identity;
|
|
1109
|
+
return identity?.pluginId === binding.plugin.pluginId && identity.sourceIdentity === binding.plugin.sourceIdentity
|
|
1110
|
+
&& identity.platform === binding.platform && identity.scope === 'project' && identity.physicalKey !== undefined
|
|
1111
|
+
&& supplementKeys.has(identity.physicalKey);
|
|
1112
|
+
}))
|
|
1113
|
+
return true;
|
|
1114
|
+
if (binding.platform !== 'claude' || !layout.marketplaceName)
|
|
1115
|
+
return false;
|
|
1116
|
+
const installedPath = path.join(resolvePlatformConfigRoot('claude', { cwd, env }), 'plugins/installed_plugins.json');
|
|
1117
|
+
return inventoryRead({ errors, env, cwd, location: installedPath, kind: 'nativeProjectRegistrationRead', absent: false,
|
|
1118
|
+
operation: async () => {
|
|
1119
|
+
const value = await readJsonFileIfExists(installedPath) ?? null;
|
|
1120
|
+
return claudeConsumersFromInstalled(value, layout.marketplaceName, projectRoot).some((consumer) => consumer.scope === 'project' && consumer.pluginName === binding.plugin.pluginId.split('/').at(-1));
|
|
1121
|
+
} });
|
|
1122
|
+
}
|
|
1123
|
+
async function nativeOwnedReferences(options, errors) {
|
|
1124
|
+
const references = [];
|
|
1125
|
+
const ctx = { cwd: options.cwd, env: options.env };
|
|
1126
|
+
const projectRoot = canonicalizePathThroughExistingAncestorSync(resolveRepoRootSync(options.cwd));
|
|
1127
|
+
const roots = new Map();
|
|
1128
|
+
const add = (root, platform, scope, route, hostRoot, managed = false, sourceId) => roots.set(root, { platform, scope, route, hostRoot, managed, sourceId });
|
|
1129
|
+
for (const platform of NATIVE_PLATFORM_TARGETS) {
|
|
1130
|
+
const hostRoot = resolvePlatformConfigRoot(platform, ctx);
|
|
1131
|
+
if (platform === 'cursor')
|
|
1132
|
+
add(path.join(hostRoot, 'aw-plugins'), platform, 'user', 'cursor-workspace-hook', hostRoot);
|
|
1133
|
+
if (platform === 'opencode' || platform === 'antigravity')
|
|
1134
|
+
add(path.join(hostRoot, 'plugins'), platform, 'user', `${platform}-directory`, hostRoot);
|
|
1135
|
+
if (platform === 'pi')
|
|
1136
|
+
add(path.join(hostRoot, 'aw-packages'), platform, 'user', 'pi-package', hostRoot);
|
|
1137
|
+
if (options.scope !== 'user') {
|
|
1138
|
+
if (platform === 'cursor')
|
|
1139
|
+
add(path.join(projectRoot, '.cursor/aw-plugins'), platform, 'project', 'cursor-workspace-hook', hostRoot);
|
|
1140
|
+
if (platform === 'opencode')
|
|
1141
|
+
add(path.join(projectRoot, '.opencode/plugins'), platform, 'project', 'opencode-directory', hostRoot);
|
|
1142
|
+
if (platform === 'antigravity')
|
|
1143
|
+
add(path.join(projectRoot, '.agents/plugins'), platform, 'project', 'antigravity-directory', hostRoot);
|
|
1144
|
+
if (platform === 'pi')
|
|
1145
|
+
add(path.join(projectRoot, '.pi/aw-packages'), platform, 'project', 'pi-package', hostRoot);
|
|
1146
|
+
if (platform === 'grok')
|
|
1147
|
+
add(path.join(projectRoot, '.grok/plugins'), platform, 'project', 'grok-directory', hostRoot);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
const awRoot = await canonicalNamespaceRoot(resolveAwHome(options.env));
|
|
1151
|
+
const managed = path.join(awRoot, 'platforms');
|
|
1152
|
+
for (const platform of NATIVE_PLATFORM_TARGETS) {
|
|
1153
|
+
const namespaces = await inventoryCanonicalDirectoryEntries({ location: path.join(managed, platform),
|
|
1154
|
+
kind: 'nativeNamespaceRead', errors, env: options.env, cwd: options.cwd });
|
|
1155
|
+
const route = { codex: 'codex-marketplace', claude: 'claude-marketplace',
|
|
1156
|
+
copilot: 'copilot-marketplace', antigravity: 'antigravity-cli', grok: 'grok-cli' };
|
|
1157
|
+
if (!route[platform])
|
|
1158
|
+
continue;
|
|
1159
|
+
for (const namespace of namespaces) {
|
|
1160
|
+
if (!namespace.isDirectory() || namespace.isSymbolicLink())
|
|
1161
|
+
continue;
|
|
1162
|
+
const base = path.join(managed, platform, namespace.name);
|
|
1163
|
+
const sourcesRoot = path.join(base, ['codex', 'claude', 'copilot'].includes(platform) ? 'marketplaces' : 'packages');
|
|
1164
|
+
const sources = await inventoryCanonicalDirectoryEntries({ location: sourcesRoot, kind: 'nativeSourceRead', errors, env: options.env, cwd: options.cwd });
|
|
1165
|
+
for (const source of sources)
|
|
1166
|
+
if (source.isDirectory() && !source.isSymbolicLink()) {
|
|
1167
|
+
add(path.join(sourcesRoot, source.name, ...(['codex', 'claude', 'copilot'].includes(platform) ? ['plugins'] : [])), platform, 'user', route[platform], resolvePlatformConfigRoot(platform, ctx), true, source.name);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
for (const [root, descriptor] of roots) {
|
|
1172
|
+
if (canonicalizePathThroughExistingAncestorSync(root) !== path.resolve(root)) {
|
|
1173
|
+
errors.push(inventoryError(new Error('Native namespace path contains a symbolic link.'), root, 'nativeNamespaceUnsafe', options.env, options.cwd, { global: false, platform: descriptor.platform, scope: descriptor.scope,
|
|
1174
|
+
...(descriptor.sourceId ? { sourceId: descriptor.sourceId } : {}) }));
|
|
1175
|
+
continue;
|
|
1176
|
+
}
|
|
1177
|
+
const entries = await inventoryCanonicalDirectoryEntries({ location: root, kind: 'nativePackageRead', errors, env: options.env, cwd: options.cwd });
|
|
1178
|
+
for (const entry of entries) {
|
|
1179
|
+
if (!entry.isDirectory() || entry.isSymbolicLink())
|
|
1180
|
+
continue;
|
|
1181
|
+
const packageRoot = path.join(root, entry.name);
|
|
1182
|
+
const markerPath = path.join(packageRoot, SKILL_OWNER_MARKER);
|
|
1183
|
+
try {
|
|
1184
|
+
const marker = await readSkillOwnerMarker({ skillRoot: packageRoot, allowedRoot: root });
|
|
1185
|
+
if (!marker)
|
|
1186
|
+
continue;
|
|
1187
|
+
if (!marker.sourceId || !marker.sourceIdentity || !marker.physicalKey || !marker.pluginId
|
|
1188
|
+
|| marker.platform !== descriptor.platform || marker.scope !== descriptor.scope)
|
|
1189
|
+
continue;
|
|
1190
|
+
const { schemaVersion: _schema, nativeProjection: projection, ...identity } = marker;
|
|
1191
|
+
let configRoot = descriptor.hostRoot;
|
|
1192
|
+
const physical = projection?.physicalIdentity;
|
|
1193
|
+
const antigravityCopy = !descriptor.managed && descriptor.platform === 'antigravity' && descriptor.scope === 'user'
|
|
1194
|
+
&& physical?.route === 'antigravity-cli';
|
|
1195
|
+
const route = antigravityCopy ? 'antigravity-cli' : descriptor.route;
|
|
1196
|
+
if (descriptor.managed && physical && physical.platform === descriptor.platform && physical.route === descriptor.route
|
|
1197
|
+
&& physical.sourceIdentity === marker.sourceIdentity && physical.pluginId === marker.pluginId
|
|
1198
|
+
&& getPhysicalKey(physical) === marker.physicalKey)
|
|
1199
|
+
configRoot = physical.namespaceRoot;
|
|
1200
|
+
const binding = { id: '', plugin: { sourceId: marker.sourceId, sourceIdentity: marker.sourceIdentity,
|
|
1201
|
+
pluginId: marker.pluginId, version: '0.0.0' }, platform: descriptor.platform,
|
|
1202
|
+
scope: descriptor.scope === 'user' ? { kind: 'user' } : { kind: 'project', projectRoot }, route,
|
|
1203
|
+
consumers: [{ id: identityDigest({ platform: descriptor.platform, route, configRoot }),
|
|
1204
|
+
product: 'cli', version: null, availability: 'missing', reasonCodes: ['client-missing'],
|
|
1205
|
+
entry: { kind: 'directory', configRoot } }], physicalKey: marker.physicalKey,
|
|
1206
|
+
activationKey: '', renderUnitIds: [] };
|
|
1207
|
+
const layout = await getDeploymentLayout(ctx, binding);
|
|
1208
|
+
const expectedPackageRoot = antigravityCopy
|
|
1209
|
+
? path.join(layout.physicalIdentity.namespaceRoot, 'plugins', layout.nativeIdentity.packageId) : layout.packageRoot;
|
|
1210
|
+
if (canonicalizePathThroughExistingAncestorSync(expectedPackageRoot) !== canonicalizePathThroughExistingAncestorSync(packageRoot)
|
|
1211
|
+
|| getPhysicalKey(layout.physicalIdentity) !== marker.physicalKey)
|
|
1212
|
+
throw new Error('nativeOwnerPlacementMismatch');
|
|
1213
|
+
const projectComponent = isAntigravityProjectDirectory(binding) ? deploymentPackageComponent(binding, layout) : undefined;
|
|
1214
|
+
if (projectComponent) {
|
|
1215
|
+
const owned = await inspectOwnedComponents({ components: [projectComponent] });
|
|
1216
|
+
if (owned.components[0]?.state !== 'present') {
|
|
1217
|
+
errors.push(inventoryError(new Error('The Antigravity project package has unconfirmed content.'), packageRoot, 'nativeOwnerContentUnconfirmed', options.env, options.cwd, { global: false, platform: descriptor.platform,
|
|
1218
|
+
scope: descriptor.scope, sourceId: marker.sourceId, pluginName: marker.plugin }));
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
const inspectCopy = !options.observationPlugins || options.observationPlugins.has(marker.pluginId)
|
|
1223
|
+
|| options.observationPlugins.has(marker.pluginId.slice(marker.pluginId.indexOf('/') + 1));
|
|
1224
|
+
if (antigravityCopy && inspectCopy) {
|
|
1225
|
+
await readSkillOwnerMarker({ skillRoot: packageRoot, allowedRoot: root,
|
|
1226
|
+
expectedIdentity: deploymentPackageComponent(binding, layout).identity });
|
|
1227
|
+
if (!projection || getPhysicalKey(projection.physicalIdentity) !== marker.physicalKey
|
|
1228
|
+
|| await readPlatformPackageContentDigest(packageRoot) !== projection.contentDigest)
|
|
1229
|
+
throw new Error('nativeCopyContentUnconfirmed');
|
|
1230
|
+
}
|
|
1231
|
+
const component = projectComponent ?? { kind: 'owned-directory', path: packageRoot, allowedRoot: root, identity };
|
|
1232
|
+
const scopes = descriptor.scope === 'user' && options.scope !== 'user'
|
|
1233
|
+
&& ['codex', 'claude', 'copilot'].includes(descriptor.platform) ? ['user', 'project'] : [descriptor.scope];
|
|
1234
|
+
const pathEvidence = options.collectPathEvidence === false ? undefined : await offlineOwnedPathEvidence(packageRoot);
|
|
1235
|
+
for (const scope of scopes) {
|
|
1236
|
+
const scopedBinding = { ...binding, scope: scope === 'user' ? { kind: 'user' }
|
|
1237
|
+
: { kind: 'project', projectRoot }, consumers: binding.consumers.map((consumer) => ({ ...consumer })) };
|
|
1238
|
+
const scopedLayout = await getDeploymentLayout(ctx, scopedBinding);
|
|
1239
|
+
if (scope === 'project' && descriptor.scope === 'user'
|
|
1240
|
+
&& !await observedProjectReference({ binding: scopedBinding, layout: scopedLayout, cwd: options.cwd, env: options.env, errors }))
|
|
1241
|
+
continue;
|
|
1242
|
+
scopedBinding.activationKey = identityDigest({ physicalKey: scopedBinding.physicalKey, scope: scopedBinding.scope,
|
|
1243
|
+
activationPath: scopedLayout.activationPath });
|
|
1244
|
+
scopedBinding.id = identityDigest({ sourceIdentity: marker.sourceIdentity, pluginId: marker.pluginId,
|
|
1245
|
+
platform: scopedBinding.platform, scope: scopedBinding.scope, route: scopedBinding.route, physicalKey: scopedBinding.physicalKey });
|
|
1246
|
+
scopedBinding.renderUnitIds = scopedLayout.renderUnits.map((unit) => unit.id);
|
|
1247
|
+
const recoveryCandidate = { binding: scopedBinding, physicalIdentity: scopedLayout.physicalIdentity,
|
|
1248
|
+
nativeIdentity: scopedLayout.nativeIdentity, evidence: antigravityCopy && !inspectCopy ? 'unknown' : 'verified' };
|
|
1249
|
+
// A copied marker is a native recovery clue, never direct filesystem
|
|
1250
|
+
// removal authority for the cache or ownership of the AW source path.
|
|
1251
|
+
const currentMarketplaceRoot = scopedLayout.marketplaceRoot && descriptor.managed
|
|
1252
|
+
? path.join(getManagedPlatformRoot(awRoot, descriptor.platform, descriptor.route, await canonicalNamespaceRoot(descriptor.hostRoot)), 'marketplaces', marker.sourceId) : null;
|
|
1253
|
+
references.push({ kind: antigravityCopy ? 'namespacedMarketplace' : 'namespacedOwner', location: markerPath, sourceId: marker.sourceId,
|
|
1254
|
+
sourceIdentity: marker.sourceIdentity, pluginName: marker.plugin, platform: descriptor.platform, scope,
|
|
1255
|
+
...(!antigravityCopy ? { ownedComponent: component } : {}), recoveryCandidate, pathEvidence,
|
|
1256
|
+
...(currentMarketplaceRoot && scopedLayout.marketplaceRoot === currentMarketplaceRoot
|
|
1257
|
+
? { marketplaceRoot: currentMarketplaceRoot } : {}) });
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
catch (error) {
|
|
1261
|
+
errors.push(inventoryError(error, markerPath, 'nativeOwnerRead', options.env, options.cwd, { global: false, platform: descriptor.platform, scope: descriptor.scope }));
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
// Grok rules are scope-local supplements. Codex supplements and Claude permission tokens use their existing exact readers.
|
|
1266
|
+
for (const scope of options.scope === 'user' ? ['user'] : ['user', 'project']) {
|
|
1267
|
+
for (const platform of ['opencode', 'antigravity', 'grok']) {
|
|
1268
|
+
const permissions = await inventoryRead({ operation: () => offlinePermissionComponents(ctx, scope === 'project' ? projectRoot : undefined, platform),
|
|
1269
|
+
absent: [], errors, cwd: options.cwd, env: options.env, location: path.join(resolveAwHome(options.env), 'platforms', platform, 'permission-ownership'),
|
|
1270
|
+
kind: 'permissionOwnershipRead' });
|
|
1271
|
+
for (const component of permissions)
|
|
1272
|
+
references.push({ kind: 'namespacedOwner', location: component.locator.settingsPath,
|
|
1273
|
+
sourceId: component.identity.sourceId, sourceIdentity: component.identity.sourceIdentity, pluginName: component.identity.plugin,
|
|
1274
|
+
platform, scope, ownedComponent: component });
|
|
1275
|
+
}
|
|
1276
|
+
const root = scope === 'user' ? path.join(resolvePlatformConfigRoot('grok', ctx), 'rules') : path.join(projectRoot, '.grok/rules');
|
|
1277
|
+
references.push(...await findOwnedHeadersInDirectory(root, new Set(['.md', '.rules']), false, errors, options.env, options.cwd));
|
|
1278
|
+
}
|
|
1279
|
+
return references;
|
|
806
1280
|
}
|
|
807
1281
|
export async function inventoryCatalogSourceReferences(options) {
|
|
808
1282
|
const env = options.env ?? process.env;
|
|
@@ -821,10 +1295,21 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
821
1295
|
const legacyConfig = await inventoryLegacyConfigReferences(options);
|
|
822
1296
|
references.push(...legacyConfig.references);
|
|
823
1297
|
errors.push(...legacyConfig.errors);
|
|
824
|
-
for (const scope of ['user', 'project']) {
|
|
825
|
-
|
|
1298
|
+
for (const scope of options.scope === 'user' ? ['user'] : ['user', 'project']) {
|
|
1299
|
+
let location;
|
|
1300
|
+
try {
|
|
1301
|
+
location = await resolveIntentPath({ scope, cwd: options.cwd, env });
|
|
1302
|
+
}
|
|
1303
|
+
catch (error) {
|
|
1304
|
+
if (scope === 'project' && error instanceof Error && error.message.startsWith('projectRootUnavailable'))
|
|
1305
|
+
continue;
|
|
1306
|
+
throw error;
|
|
1307
|
+
}
|
|
826
1308
|
const state = await inventoryRead({
|
|
827
|
-
operation: () =>
|
|
1309
|
+
operation: async () => {
|
|
1310
|
+
const ids = await readIntentReferences({ scope, cwd: options.cwd, env });
|
|
1311
|
+
return { roots: ids.map((pluginId) => ({ pluginId })) };
|
|
1312
|
+
},
|
|
828
1313
|
absent: null,
|
|
829
1314
|
errors,
|
|
830
1315
|
location,
|
|
@@ -834,10 +1319,7 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
834
1319
|
});
|
|
835
1320
|
if (!state)
|
|
836
1321
|
continue;
|
|
837
|
-
for (const pluginId of new Set(
|
|
838
|
-
...state.roots.map((root) => root.pluginId),
|
|
839
|
-
...state.dependencyScopeOverrides.map((override) => override.pluginId),
|
|
840
|
-
])) {
|
|
1322
|
+
for (const pluginId of new Set(state.roots.map((root) => root.pluginId))) {
|
|
841
1323
|
const separator = pluginId.indexOf('/');
|
|
842
1324
|
if (separator <= 0 || separator === pluginId.length - 1)
|
|
843
1325
|
continue;
|
|
@@ -850,7 +1332,8 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
850
1332
|
});
|
|
851
1333
|
}
|
|
852
1334
|
}
|
|
853
|
-
for (const configInventory of await inventoryPluginConfigRoots({ errors, env, cwd: options.cwd
|
|
1335
|
+
for (const configInventory of await inventoryPluginConfigRoots({ errors, env, cwd: options.cwd,
|
|
1336
|
+
scope: options.scope })) {
|
|
854
1337
|
const configRoot = configInventory.root;
|
|
855
1338
|
const sourceEntries = await inventoryRead({
|
|
856
1339
|
operation: () => fs.readdir(configRoot, { withFileTypes: true }),
|
|
@@ -908,6 +1391,7 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
908
1391
|
}
|
|
909
1392
|
}
|
|
910
1393
|
}
|
|
1394
|
+
references.push(...await nativeOwnedReferences({ ...options, env }, errors));
|
|
911
1395
|
const ownerInventory = await inventoryLegacyOwnerReferences(options);
|
|
912
1396
|
references.push(...ownerInventory.references);
|
|
913
1397
|
errors.push(...ownerInventory.errors);
|
|
@@ -915,7 +1399,7 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
915
1399
|
[path.join(getCodexHome(env), 'config.toml'), 'nativeStateRead', () => codexSharedOwnerReferences(path.join(getCodexHome(env), 'config.toml'), 'user', errors, env, options.cwd)],
|
|
916
1400
|
[path.join(getClaudeHome(env), 'settings.json'), 'nativeStateRead', () => claudeSharedOwnerReferences(path.join(getClaudeHome(env), 'settings.json'), 'user', errors, env, options.cwd)],
|
|
917
1401
|
[path.join(resolveRepoRootSync(options.cwd), '.codex', 'config.toml'), 'nativeStateRead', () => codexSharedOwnerReferences(path.join(resolveRepoRootSync(options.cwd), '.codex', 'config.toml'), 'project', errors, env, options.cwd)],
|
|
918
|
-
[path.join(resolveRepoRootSync(options.cwd), '.claude', 'settings.json'), 'nativeStateRead', () => claudeSharedOwnerReferences(path.join(resolveRepoRootSync(options.cwd), '.claude', 'settings.json'), 'project', errors, env, options.cwd)],
|
|
1402
|
+
[path.join(resolveRepoRootSync(options.cwd), '.claude', 'settings.local.json'), 'nativeStateRead', () => claudeSharedOwnerReferences(path.join(resolveRepoRootSync(options.cwd), '.claude', 'settings.local.json'), 'project', errors, env, options.cwd)],
|
|
919
1403
|
]) {
|
|
920
1404
|
references.push(...await inventoryRead({
|
|
921
1405
|
operation, absent: [], errors, location, kind, env, cwd: options.cwd,
|
|
@@ -956,54 +1440,162 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
956
1440
|
const marketplaceEntries = await inventoryCanonicalDirectoryEntries({
|
|
957
1441
|
errors, location: marketplacesRoot, kind: 'marketplaceDirectoryRead', env, cwd: options.cwd,
|
|
958
1442
|
});
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1443
|
+
const canonicalAwRoot = await canonicalNamespaceRoot(awHome);
|
|
1444
|
+
const managedDirectories = await managedMarketplaceDirectories(canonicalAwRoot, options.cwd, env);
|
|
1445
|
+
const canonicalLegacyRoot = path.join(canonicalAwRoot, 'marketplaces');
|
|
1446
|
+
const projectClaudeLocalSettingsPath = path.join(resolveRepoRootSync(options.cwd), '.claude', 'settings.local.json');
|
|
1447
|
+
const projectClaudeLocalSettings = await inventoryRead({
|
|
1448
|
+
operation: () => readJsonFileIfExists(projectClaudeLocalSettingsPath), absent: null, errors,
|
|
1449
|
+
location: projectClaudeLocalSettingsPath, kind: 'nativeStateRead', env, cwd: options.cwd,
|
|
1450
|
+
});
|
|
1451
|
+
const nativeConsumers = [];
|
|
1452
|
+
const addConsumer = (location, marketplaceName, consumer) => {
|
|
1453
|
+
nativeConsumers.push({ kind: 'namespacedMarketplace', location, marketplaceName, ...consumer });
|
|
1454
|
+
};
|
|
1455
|
+
for (const [location, plugins, platform, scope] of [
|
|
1456
|
+
[codexConfigPath, codexConfig?.snapshot.plugins ?? {}, 'codex', 'user'],
|
|
1457
|
+
[projectCodexConfigPath, projectCodexConfig?.snapshot.plugins ?? {}, 'codex', 'project'],
|
|
1458
|
+
...await Promise.all(['user', 'project'].map(async (scope) => {
|
|
1459
|
+
const location = scope === 'user'
|
|
1460
|
+
? path.join(resolvePlatformConfigRoot('copilot', { cwd: options.cwd, env }), 'settings.json')
|
|
1461
|
+
: path.join(resolveRepoRootSync(options.cwd), '.github', 'copilot', 'settings.local.json');
|
|
1462
|
+
const plugins = await inventoryRead({ operation: () => readEnabledPluginsInventory(location), absent: {}, errors,
|
|
1463
|
+
location, kind: 'nativeStateRead', env, cwd: options.cwd });
|
|
1464
|
+
return [location, plugins, 'copilot', scope];
|
|
1465
|
+
})),
|
|
1466
|
+
]) {
|
|
1467
|
+
for (const pluginId of Object.keys(plugins)) {
|
|
1468
|
+
const marketplaceName = pluginMarketplaceName(pluginId);
|
|
1469
|
+
if (marketplaceName)
|
|
1470
|
+
addConsumer(location, marketplaceName, {
|
|
1471
|
+
pluginName: pluginNameFromMarketplaceId(pluginId, marketplaceName), platform, scope,
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
971
1474
|
}
|
|
972
|
-
for (const
|
|
973
|
-
|
|
974
|
-
|
|
1475
|
+
for (const [location, settings, scope] of [
|
|
1476
|
+
[userClaudeSettingsPath, userClaudeSettings, 'user'],
|
|
1477
|
+
[projectClaudeSettingsPath, projectClaudeSettings, 'project'],
|
|
1478
|
+
[projectClaudeLocalSettingsPath, projectClaudeLocalSettings, 'project'],
|
|
1479
|
+
]) {
|
|
1480
|
+
if (!settings)
|
|
975
1481
|
continue;
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1482
|
+
const installed = isRecord(settings.plugins) && isRecord(settings.plugins.installed) ? settings.plugins.installed : {};
|
|
1483
|
+
const names = new Set([
|
|
1484
|
+
...Object.keys(isRecord(settings.enabledPlugins) ? settings.enabledPlugins : {}).map(pluginMarketplaceName),
|
|
1485
|
+
...Object.values(installed).flatMap((entry) => isRecord(entry) && typeof entry.marketplace === 'string' ? [entry.marketplace] : []),
|
|
1486
|
+
].filter((name) => !!name));
|
|
1487
|
+
for (const name of names)
|
|
1488
|
+
for (const consumer of claudeConsumersFromSettings(settings, name, scope))
|
|
1489
|
+
addConsumer(location, name, consumer);
|
|
984
1490
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1491
|
+
const installedClaudeNames = new Set();
|
|
1492
|
+
if (isRecord(claudeInstalled?.plugins))
|
|
1493
|
+
for (const [id, raw] of Object.entries(claudeInstalled.plugins)) {
|
|
1494
|
+
const name = pluginMarketplaceName(id);
|
|
1495
|
+
if (name)
|
|
1496
|
+
installedClaudeNames.add(name);
|
|
1497
|
+
for (const entry of Array.isArray(raw) ? raw : [raw]) {
|
|
1498
|
+
if (isRecord(entry) && typeof entry.marketplace === 'string')
|
|
1499
|
+
installedClaudeNames.add(entry.marketplace);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
try {
|
|
1503
|
+
if (installedClaudeNames.size === 0)
|
|
1504
|
+
claudeConsumersFromInstalled(claudeInstalled, '', path.normalize(canonicalProjectRoot));
|
|
1505
|
+
for (const name of installedClaudeNames)
|
|
1506
|
+
for (const consumer of claudeConsumersFromInstalled(claudeInstalled, name, path.normalize(canonicalProjectRoot), options.includePlatformHistoricalProjects === true, true))
|
|
1507
|
+
addConsumer(claudeInstalledPath, name, consumer);
|
|
1508
|
+
}
|
|
1509
|
+
catch (error) {
|
|
1510
|
+
errors.push(inventoryError(error, claudeInstalledPath, 'nativeStateRead', env, options.cwd));
|
|
1511
|
+
}
|
|
1512
|
+
references.push(...nativeConsumers);
|
|
1513
|
+
// Host paths are matched lexically against only the legacy root and the current
|
|
1514
|
+
// platform/route namespace. Never adopt a host's foreign directory or another namespace.
|
|
1515
|
+
const registrations = [];
|
|
1516
|
+
const appendRegistration = (platform, location, marketplaceName, registrationPath, scope) => {
|
|
1517
|
+
const sourceId = registrationPath
|
|
1518
|
+
? (sourceIdFromCanonicalMarketplacePath(registrationPath, canonicalLegacyRoot)
|
|
1519
|
+
?? sourceIdFromCanonicalMarketplacePath(registrationPath, managedDirectories.get(platform)))
|
|
1520
|
+
: null;
|
|
1521
|
+
registrations.push({ kind: 'namespacedMarketplace', location, platform, marketplaceName,
|
|
1522
|
+
...(sourceId ? { sourceId } : {}), ...(scope ? { scope } : {}), marketplaceRegistrationPath: registrationPath });
|
|
1523
|
+
};
|
|
1524
|
+
for (const [location, config, scope] of [
|
|
1525
|
+
[codexConfigPath, codexConfig, 'user'], [projectCodexConfigPath, projectCodexConfig, 'project'],
|
|
999
1526
|
]) {
|
|
1000
|
-
for (const
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1527
|
+
for (const [name, marketplace] of Object.entries(config?.snapshot.marketplaces ?? {})) {
|
|
1528
|
+
const source = marketplace.sourceType === 'local' && !marketplace.sourcePointsToManifest ? marketplace.source : undefined;
|
|
1529
|
+
appendRegistration('codex', location, name, canonicalMarketplaceRegistrationPath(source, awHome, canonicalAwRoot), scope);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
for (const [location, declarations, scope] of [
|
|
1533
|
+
[userClaudeSettingsPath, userClaudeSettings?.extraKnownMarketplaces, 'user'],
|
|
1534
|
+
[projectClaudeSettingsPath, projectClaudeSettings?.extraKnownMarketplaces, 'project'],
|
|
1535
|
+
[projectClaudeLocalSettingsPath, projectClaudeLocalSettings?.extraKnownMarketplaces, 'project'],
|
|
1536
|
+
[claudeKnownPath, claudeKnown, undefined], [claudeKnownPath, claudeKnown?.marketplaces, undefined],
|
|
1537
|
+
]) {
|
|
1538
|
+
if (!isRecord(declarations))
|
|
1539
|
+
continue;
|
|
1540
|
+
for (const [name, declaration] of Object.entries(declarations)) {
|
|
1541
|
+
if (name === 'marketplaces' && location === claudeKnownPath)
|
|
1542
|
+
continue;
|
|
1543
|
+
const declaredSource = isRecord(declaration) ? declaration.source : undefined;
|
|
1544
|
+
const foreignSource = typeof declaredSource === 'string' && declaredSource !== 'directory' && !path.isAbsolute(declaredSource)
|
|
1545
|
+
|| isRecord(declaredSource) && declaredSource.source !== undefined && declaredSource.source !== 'directory';
|
|
1546
|
+
const paths = [...new Set(collectMarketplaceDeclarationPaths(declaration)
|
|
1547
|
+
.map((candidate) => canonicalMarketplaceRegistrationPath(candidate, awHome, canonicalAwRoot)))];
|
|
1548
|
+
appendRegistration('claude', location, name, !foreignSource && paths.length === 1 ? paths[0] ?? null : null, scope);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
references.push(...registrations);
|
|
1552
|
+
for (const [platform, directory] of managedDirectories) {
|
|
1553
|
+
const root = await inventoryCanonicalDescendantDirectory({ root: canonicalAwRoot,
|
|
1554
|
+
segments: path.relative(canonicalAwRoot, directory).split(path.sep), errors,
|
|
1555
|
+
kind: 'marketplaceDirectoryRead', env, cwd: options.cwd });
|
|
1556
|
+
const entries = root ? await inventoryCanonicalDirectoryEntries({ errors, location: root,
|
|
1557
|
+
kind: 'marketplaceDirectoryRead', env, cwd: options.cwd }) : [];
|
|
1558
|
+
const registeredIds = registrations.filter((registration) => registration.platform === platform && registration.marketplaceRegistrationPath
|
|
1559
|
+
&& sourceIdFromCanonicalMarketplacePath(registration.marketplaceRegistrationPath, directory) !== null)
|
|
1560
|
+
.flatMap((registration) => registration.sourceId ? [registration.sourceId] : []);
|
|
1561
|
+
for (const sourceId of new Set([...entries.map((entry) => entry.name), ...registeredIds])) {
|
|
1562
|
+
const marketplaceRoot = path.join(directory, sourceId);
|
|
1563
|
+
const configPath = path.join(marketplaceRoot, 'config.json');
|
|
1564
|
+
const strictRoot = root ? await inventoryRead({ operation: async () => {
|
|
1565
|
+
if (!await inventoryCanonicalDirectory({ errors, location: marketplaceRoot, kind: 'marketplaceRootValidation', env, cwd: options.cwd }))
|
|
1566
|
+
return null;
|
|
1567
|
+
await assertMarketplacePluginsContainer(marketplaceRoot);
|
|
1568
|
+
const manifestPath = path.join(marketplaceRoot, platform === 'codex' ? '.agents/plugins/marketplace.json'
|
|
1569
|
+
: platform === 'claude' ? '.claude-plugin/marketplace.json' : '.github/plugin/marketplace.json');
|
|
1570
|
+
for (const location of [configPath, manifestPath]) {
|
|
1571
|
+
if (await canonicalNamespaceRoot(location) !== location)
|
|
1572
|
+
throw new Error('Marketplace path contains a symbolic link.');
|
|
1573
|
+
}
|
|
1574
|
+
return readStrictNamespacedMarketplaceRoot({ rootDir: marketplaceRoot, sourceId, platform, trustedMarketplaceRoot: directory });
|
|
1575
|
+
}, absent: null, reportAbsent: true, errors, location: marketplaceRoot, kind: 'marketplaceRootValidation', env, cwd: options.cwd }) : null;
|
|
1576
|
+
const names = new Set(registrations.filter((registration) => registration.platform === platform
|
|
1577
|
+
&& registration.marketplaceRegistrationPath === marketplaceRoot).flatMap((registration) => registration.marketplaceName ? [registration.marketplaceName] : []));
|
|
1578
|
+
if (strictRoot) {
|
|
1579
|
+
const { marketplaceName, sourceIdentity } = strictRoot.config;
|
|
1580
|
+
names.add(marketplaceName);
|
|
1581
|
+
references.push({ kind: 'namespacedMarketplace', sourceId, sourceIdentity, marketplaceName, marketplaceRoot, platform, location: configPath });
|
|
1582
|
+
for (const entry of strictRoot.manifest.plugins) {
|
|
1583
|
+
if (!isRecord(entry) || typeof entry.name !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/u.test(entry.name)
|
|
1584
|
+
|| entry.source !== `./plugins/${entry.name}`)
|
|
1585
|
+
continue;
|
|
1586
|
+
references.push({ kind: 'namespacedMarketplace', sourceId, sourceIdentity, marketplaceName, marketplaceRoot, platform,
|
|
1587
|
+
location: configPath, pluginName: entry.name, scope: 'user', marketplaceManifestEntry: true });
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
for (const consumer of nativeConsumers) {
|
|
1591
|
+
if (consumer.platform !== platform || consumer.disabledNativeActivation
|
|
1592
|
+
|| !consumer.marketplaceName || !names.has(consumer.marketplaceName))
|
|
1593
|
+
continue;
|
|
1594
|
+
const exact = strictRoot?.config.marketplaceName === consumer.marketplaceName;
|
|
1595
|
+
references.push({ ...consumer, location: configPath, sourceId,
|
|
1596
|
+
...(exact ? { sourceIdentity: strictRoot.config.sourceIdentity, marketplaceRoot } : {}) });
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1007
1599
|
}
|
|
1008
1600
|
for (const sourceEntry of marketplaceEntries) {
|
|
1009
1601
|
const marketplaceRoot = path.join(marketplacesRoot, sourceEntry.name);
|
|
@@ -1018,10 +1610,16 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
1018
1610
|
});
|
|
1019
1611
|
const strictRoot = canonicalRoot
|
|
1020
1612
|
? await inventoryRead({
|
|
1021
|
-
operation: () =>
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1613
|
+
operation: async () => {
|
|
1614
|
+
await assertMarketplacePluginsContainer(marketplaceRoot);
|
|
1615
|
+
const expectedRoot = path.join(canonicalLegacyRoot, sourceEntry.name);
|
|
1616
|
+
for (const location of [marketplaceRoot, configPath, agentsManifestPath, path.join(marketplaceRoot, '.claude-plugin/marketplace.json')]) {
|
|
1617
|
+
const expected = path.join(expectedRoot, path.relative(marketplaceRoot, location));
|
|
1618
|
+
if (await canonicalNamespaceRoot(location) !== expected)
|
|
1619
|
+
throw new Error('Marketplace path contains a symbolic link.');
|
|
1620
|
+
}
|
|
1621
|
+
return readStrictNamespacedMarketplaceRoot({ rootDir: marketplaceRoot, sourceId: sourceEntry.name });
|
|
1622
|
+
},
|
|
1025
1623
|
absent: null,
|
|
1026
1624
|
reportAbsent: true,
|
|
1027
1625
|
errors,
|
|
@@ -1050,9 +1648,7 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
1050
1648
|
}
|
|
1051
1649
|
}
|
|
1052
1650
|
for (const [name, marketplace] of Object.entries(codexConfig?.snapshot.marketplaces ?? {})) {
|
|
1053
|
-
if (marketplace
|
|
1054
|
-
&& !marketplace.sourcePointsToManifest
|
|
1055
|
-
&& path.normalize(marketplace.source ?? '') === path.normalize(marketplaceRoot)) {
|
|
1651
|
+
if (isCanonicalCodexMarketplaceRegistration(marketplace, marketplaceRoot)) {
|
|
1056
1652
|
candidateMarketplaceNames.add(name);
|
|
1057
1653
|
}
|
|
1058
1654
|
}
|
|
@@ -1072,31 +1668,11 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
1072
1668
|
const codexMarketplace = marketplaceName
|
|
1073
1669
|
? codexConfig?.snapshot.marketplaces[marketplaceName]
|
|
1074
1670
|
: undefined;
|
|
1075
|
-
const codexMarketplaceIsCanonical = codexMarketplace
|
|
1076
|
-
|
|
1077
|
-
&&
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
for (const pluginId of Object.keys(codexConfig?.snapshot.plugins ?? {})) {
|
|
1081
|
-
const pluginName = pluginNameFromMarketplaceId(pluginId, marketplaceName);
|
|
1082
|
-
if (pluginName)
|
|
1083
|
-
consumers.push({ pluginName, platform: 'codex', scope: 'user' });
|
|
1084
|
-
}
|
|
1085
|
-
for (const pluginId of Object.keys(projectCodexConfig?.snapshot.plugins ?? {})) {
|
|
1086
|
-
const pluginName = pluginNameFromMarketplaceId(pluginId, marketplaceName);
|
|
1087
|
-
if (pluginName)
|
|
1088
|
-
consumers.push({ pluginName, platform: 'codex', scope: 'project' });
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
if (marketplaceName !== null) {
|
|
1092
|
-
consumers.push(...claudeConsumersFromSettings(userClaudeSettings, marketplaceName, 'user'), ...claudeConsumersFromSettings(projectClaudeSettings, marketplaceName, 'project'));
|
|
1093
|
-
try {
|
|
1094
|
-
consumers.push(...claudeConsumersFromInstalled(claudeInstalled, marketplaceName, path.normalize(canonicalProjectRoot), options.includePlatformHistoricalProjects === true));
|
|
1095
|
-
}
|
|
1096
|
-
catch (error) {
|
|
1097
|
-
errors.push(inventoryError(error, claudeInstalledPath, 'nativeStateRead', env, options.cwd));
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1671
|
+
const codexMarketplaceIsCanonical = isCanonicalCodexMarketplaceRegistration(codexMarketplace, marketplaceRoot);
|
|
1672
|
+
const consumers = nativeConsumers.filter((consumer) => consumer.platform !== 'copilot'
|
|
1673
|
+
&& !consumer.disabledNativeActivation
|
|
1674
|
+
&& consumer.marketplaceName === marketplaceName
|
|
1675
|
+
&& (consumer.platform !== 'codex' || strictRoot !== null || codexMarketplaceIsCanonical));
|
|
1100
1676
|
if (marketplaceName !== null && strictRoot !== null) {
|
|
1101
1677
|
references.push({
|
|
1102
1678
|
kind: 'namespacedMarketplace',
|
|
@@ -1104,17 +1680,19 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
1104
1680
|
sourceId: sourceEntry.name,
|
|
1105
1681
|
...(sourceIdentity ? { sourceIdentity } : {}),
|
|
1106
1682
|
marketplaceName,
|
|
1683
|
+
marketplaceRoot: path.join(canonicalLegacyRoot, sourceEntry.name),
|
|
1107
1684
|
});
|
|
1108
1685
|
}
|
|
1109
1686
|
if (marketplaceName !== null) {
|
|
1110
1687
|
for (const consumer of consumers)
|
|
1111
1688
|
references.push({
|
|
1689
|
+
...consumer,
|
|
1112
1690
|
kind: 'namespacedMarketplace',
|
|
1113
1691
|
location: configPath,
|
|
1114
1692
|
sourceId: sourceEntry.name,
|
|
1115
1693
|
...(sourceIdentity ? { sourceIdentity } : {}),
|
|
1116
1694
|
marketplaceName,
|
|
1117
|
-
...
|
|
1695
|
+
...(strictRoot ? { marketplaceRoot: path.join(canonicalLegacyRoot, sourceEntry.name) } : {}),
|
|
1118
1696
|
});
|
|
1119
1697
|
}
|
|
1120
1698
|
}
|
|
@@ -1133,9 +1711,24 @@ export async function inventoryCatalogSourceReferences(options) {
|
|
|
1133
1711
|
reference.scope ?? '',
|
|
1134
1712
|
reference.marketplaceName ?? '',
|
|
1135
1713
|
reference.projectKey ?? '',
|
|
1714
|
+
reference.marketplaceRoot ?? '',
|
|
1715
|
+
reference.marketplaceRegistrationPath ?? '',
|
|
1716
|
+
reference.marketplaceManifestEntry ? 'manifest' : '',
|
|
1717
|
+
reference.managedNativeRegistration ? 'managed' : '',
|
|
1718
|
+
reference.disabledNativeActivation ? 'disabled' : '',
|
|
1136
1719
|
].join('\0'), reference])).values()];
|
|
1137
1720
|
unique.sort((left, right) => left.location.localeCompare(right.location));
|
|
1138
|
-
|
|
1721
|
+
const knownNames = [...new Set([...(options.knownPluginNames ?? []), ...unique.flatMap((reference) => reference.kind.startsWith('namespaced') && reference.pluginName ? [reference.pluginName] : [])])];
|
|
1722
|
+
for (const error of errors) {
|
|
1723
|
+
if (error.kind !== 'ownerHeaderPathValidation' || error.relevance.global || !error.recoveryPath || error.configKey === 'agents')
|
|
1724
|
+
continue;
|
|
1725
|
+
const basename = path.basename(error.recoveryPath);
|
|
1726
|
+
const candidates = knownNames.filter((name) => basename.startsWith(`aw-${name}-`));
|
|
1727
|
+
if (candidates.length === 1)
|
|
1728
|
+
error.relevance = { ...error.relevance, pluginName: candidates[0] };
|
|
1729
|
+
}
|
|
1730
|
+
return { inventorySchemaVersion: 1, references: options.scope === 'user'
|
|
1731
|
+
? unique.filter((reference) => reference.scope !== 'project') : unique, errors };
|
|
1139
1732
|
}
|
|
1140
1733
|
export class LegacyCatalogStateUnsupportedError extends Error {
|
|
1141
1734
|
code = 'legacyStateUnsupported';
|