@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,17 +1,33 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
|
+
import { resolveWorkContext } from '../intent/work-context.js';
|
|
3
|
+
import { observePreferences } from '../intent/deployment-preferences.js';
|
|
2
4
|
import * as nodeFs from 'node:fs/promises';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import fs from 'fs-extra';
|
|
5
|
-
import { canonicalizePluginConfigValues, formatPluginConfigIssue, matchPluginConfigPreset, redactPluginConfigValue, stablePluginConfigStringify, validatePluginConfigDocument, validatePluginConfigValue as validateCorePluginConfigValue, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
6
|
-
import { assertTestReadablePath, assertTestWritablePath, } from './test-path-fence.js';
|
|
7
|
+
import { canonicalizePluginConfigValues, selectPluginConfigProfile, PLATFORM_TARGETS, formatPluginConfigIssue, getPluginConfigDependencyKeys, getPluginConfigDependencyFields, getStrippedPlatformOnlyProperties, matchPluginConfigPreset, redactPluginConfigValue, resolvePluginConfigObjectProperties, stablePluginConfigStringify, validatePluginConfigCandidate, validatePluginConfigDocument, validatePluginConfigValue as validateCorePluginConfigValue, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
7
8
|
import { canonicalizePathThroughExistingAncestor, resolveAwHome, resolveRepoRootSync, } from './paths.js';
|
|
8
9
|
import { assertRealFileParentWithinRoot, assertSafeFileMutationPath, atomicReplaceSafeFile, } from './safe-fs.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { pluginConfigHasExternalReferences, resolvePluginConfigReferenceContext, } from './plugin-config-references.js';
|
|
11
|
+
import { assertConfigLayerWritable, resolveConfigurableLayers } from './config-platforms.js';
|
|
12
|
+
export { resolvePluginConfigReferenceContext } from './plugin-config-references.js';
|
|
13
|
+
function readPluginConfigBinding(value) {
|
|
14
|
+
return isRecord(value) && value.kind === 'source'
|
|
15
|
+
&& typeof value.sourceIdentity === 'string'
|
|
16
|
+
&& /^sha256:[0-9a-f]{64}$/u.test(value.sourceIdentity)
|
|
17
|
+
&& Object.keys(value).every((key) => ['kind', 'sourceIdentity'].includes(key))
|
|
18
|
+
? { kind: 'source', sourceIdentity: value.sourceIdentity } : null;
|
|
19
|
+
}
|
|
20
|
+
function readPluginConfigEnvelopeV6(value, _scope) {
|
|
21
|
+
if (!isRecord(value) || value.schemaVersion !== 6
|
|
22
|
+
|| typeof value.sourceId !== 'string' || typeof value.pluginName !== 'string'
|
|
23
|
+
|| !isRecord(value.common) || !isRecord(value.platforms)
|
|
24
|
+
|| Object.keys(value).some((key) => !['schemaVersion', 'sourceId', 'pluginName', 'binding', 'common', 'platforms'].includes(key))
|
|
25
|
+
|| Object.keys(value.platforms).some((key) => !PLATFORM_TARGETS.includes(key)))
|
|
26
|
+
return null;
|
|
27
|
+
const binding = readPluginConfigBinding(value.binding);
|
|
28
|
+
return binding ? { schemaVersion: 6, sourceId: value.sourceId, pluginName: value.pluginName,
|
|
29
|
+
binding, common: value.common,
|
|
30
|
+
platforms: value.platforms } : null;
|
|
15
31
|
}
|
|
16
32
|
export class PluginConfigResetError extends Error {
|
|
17
33
|
code;
|
|
@@ -186,7 +202,7 @@ function formatValue(value) {
|
|
|
186
202
|
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
187
203
|
return stablePluginConfigStringify(value);
|
|
188
204
|
}
|
|
189
|
-
if (isRecord(value)) {
|
|
205
|
+
if (isRecord(value) || Array.isArray(value)) {
|
|
190
206
|
return stablePluginConfigStringify(value);
|
|
191
207
|
}
|
|
192
208
|
return JSON.stringify(value);
|
|
@@ -204,10 +220,11 @@ async function calculateConfigSchemaManifestDigestForPlugin(plugin) {
|
|
|
204
220
|
hash.update(JSON.stringify(plugin.manifest));
|
|
205
221
|
return `sha256:${hash.digest('hex')}`;
|
|
206
222
|
}
|
|
207
|
-
function createConfigSchemaEvidenceFromCurrentCatalog(plugin, manifestDigest) {
|
|
223
|
+
function createConfigSchemaEvidenceFromCurrentCatalog(plugin, manifestDigest, platform) {
|
|
208
224
|
return {
|
|
209
225
|
source: 'currentCatalog',
|
|
210
|
-
identity: createPluginConfigSchemaIdentity(plugin.manifest),
|
|
226
|
+
identity: createPluginConfigSchemaIdentity(plugin.manifest, platform),
|
|
227
|
+
platform,
|
|
211
228
|
pluginVersion: plugin.manifest.version,
|
|
212
229
|
manifestDigest,
|
|
213
230
|
};
|
|
@@ -235,52 +252,45 @@ export function resolveAwProjectRoot(cwd) {
|
|
|
235
252
|
return path.resolve(resolveRepoRootSync(cwd));
|
|
236
253
|
}
|
|
237
254
|
function resolvePluginConfigAllowedRoot(options) {
|
|
238
|
-
return options.
|
|
239
|
-
? resolveAwHome(options.env)
|
|
240
|
-
: path.join(resolveAwProjectRoot(options.cwd), '.agent-workflows');
|
|
255
|
+
return resolveAwHome(options.env);
|
|
241
256
|
}
|
|
257
|
+
/** Scope selects source context. All config values belong to the user document. */
|
|
242
258
|
export function resolvePluginConfigStorePath(options) {
|
|
243
259
|
const pluginName = assertSafePluginConfigSegment(options.pluginName);
|
|
244
|
-
const sourceId = options.sourceId === undefined
|
|
245
|
-
|
|
246
|
-
: assertSafePluginConfigSegment(options.sourceId);
|
|
247
|
-
const root = options.scope === 'user'
|
|
248
|
-
? resolveAwHome(options.env)
|
|
249
|
-
: path.join(resolveAwProjectRoot(options.cwd), '.agent-workflows');
|
|
250
|
-
const filePath = path.join(root, CONFIG_DIR, ...(sourceId ? [sourceId] : []), pluginName, CONFIG_FILE);
|
|
251
|
-
if (options.scope !== 'project') {
|
|
252
|
-
return filePath;
|
|
253
|
-
}
|
|
254
|
-
if (options.access === 'read') {
|
|
255
|
-
return assertTestReadablePath(filePath, 'project plugin config store (.agent-workflows/plugin-config)', '用 registerReadonlyFixtureRoot() 或 runWithRepositoryCwdAsReadOnly() 登记只读 project fixture 根;需要写入时改用 withSafeTestCwd() 或 registerWritableStateRoot()。');
|
|
256
|
-
}
|
|
257
|
-
if (options.access === 'write') {
|
|
258
|
-
return assertTestWritablePath(filePath, 'project plugin config store (.agent-workflows/plugin-config)', '用 withSafeTestCwd() 切到测试可写 cwd,或通过 registerWritableStateRoot() 登记 project fixture 根。');
|
|
259
|
-
}
|
|
260
|
-
return filePath;
|
|
260
|
+
const sourceId = options.sourceId === undefined ? undefined : assertSafePluginConfigSegment(options.sourceId);
|
|
261
|
+
return path.join(resolveAwHome(options.env), CONFIG_DIR, ...(sourceId ? [sourceId] : []), pluginName, CONFIG_FILE);
|
|
261
262
|
}
|
|
262
263
|
export function resolvePluginConfigStoreTargets(options) {
|
|
263
|
-
|
|
264
|
-
return [{
|
|
265
|
-
storeKind: 'user',
|
|
266
|
-
path: resolvePluginConfigStorePath(options),
|
|
267
|
-
}];
|
|
268
|
-
}
|
|
269
|
-
return [{
|
|
270
|
-
storeKind: 'project',
|
|
271
|
-
path: resolvePluginConfigStorePath(options),
|
|
272
|
-
}];
|
|
264
|
+
return [{ storeKind: 'user', path: resolvePluginConfigStorePath(options) }];
|
|
273
265
|
}
|
|
274
|
-
function
|
|
266
|
+
function isPluginConfigScalar(value) {
|
|
275
267
|
if (typeof value === 'string' || typeof value === 'boolean')
|
|
276
268
|
return true;
|
|
277
|
-
|
|
278
|
-
|
|
269
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
270
|
+
}
|
|
271
|
+
function isPluginConfigObject(value, objectArrayLevels) {
|
|
279
272
|
if (!isRecord(value))
|
|
280
273
|
return false;
|
|
281
|
-
return Object.values(value).every((
|
|
282
|
-
|
|
283
|
-
|
|
274
|
+
return Object.values(value).every((property) => {
|
|
275
|
+
if (isPluginConfigScalar(property))
|
|
276
|
+
return true;
|
|
277
|
+
if (Array.isArray(property))
|
|
278
|
+
return isPluginConfigArray(property, objectArrayLevels);
|
|
279
|
+
return isRecord(property) && Object.values(property).every(isPluginConfigScalar);
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function isPluginConfigArray(value, objectArrayLevels) {
|
|
283
|
+
if (Object.keys(value).length !== value.length)
|
|
284
|
+
return false;
|
|
285
|
+
const elementType = typeof value[0];
|
|
286
|
+
return value.every((item, index) => Object.hasOwn(value, index)
|
|
287
|
+
&& typeof item === elementType
|
|
288
|
+
&& (isPluginConfigScalar(item) || (objectArrayLevels > 0 && isPluginConfigObject(item, objectArrayLevels - 1))));
|
|
289
|
+
}
|
|
290
|
+
function isPluginConfigValue(value) {
|
|
291
|
+
return isPluginConfigScalar(value) || (Array.isArray(value)
|
|
292
|
+
? isPluginConfigArray(value, 2)
|
|
293
|
+
: isPluginConfigObject(value, 1));
|
|
284
294
|
}
|
|
285
295
|
function invalidStore(filePath, code, message, rawDigest) {
|
|
286
296
|
return {
|
|
@@ -345,60 +355,75 @@ function validateStoreValues(options) {
|
|
|
345
355
|
? invalidStore(options.filePath, 'invalidValues', issues.join(' '), options.rawDigest)
|
|
346
356
|
: readyStore(options.filePath, values, options.rawDigest);
|
|
347
357
|
}
|
|
348
|
-
|
|
358
|
+
function documentStore(options) {
|
|
359
|
+
const common = validateStoreValues({ filePath: options.filePath, values: options.common, rawDigest: options.rawDigest });
|
|
360
|
+
if (common.state === 'invalid')
|
|
361
|
+
return common;
|
|
362
|
+
if (!isRecord(options.platforms) || Object.keys(options.platforms).some((key) => !PLATFORM_TARGETS.includes(key))) {
|
|
363
|
+
return invalidStore(options.filePath, 'invalidValues', 'The platforms field must contain known platform objects.', options.rawDigest);
|
|
364
|
+
}
|
|
365
|
+
const platforms = {};
|
|
366
|
+
for (const [platform, values] of Object.entries(options.platforms)) {
|
|
367
|
+
const store = validateStoreValues({ filePath: options.filePath, values, rawDigest: options.rawDigest });
|
|
368
|
+
if (store.state === 'invalid')
|
|
369
|
+
return store;
|
|
370
|
+
platforms[platform] = store.values;
|
|
371
|
+
}
|
|
372
|
+
return { ...common, common: common.values, platforms, ...(options.platform ? { platform: options.platform } : {}),
|
|
373
|
+
values: options.platform ? platforms[options.platform] ?? {} : common.values };
|
|
374
|
+
}
|
|
375
|
+
export function pluginConfigStoreForProfile(store, platform) {
|
|
376
|
+
return { ...store, platform, values: platform ? store.platforms?.[platform] ?? {} : store.common ?? store.values };
|
|
377
|
+
}
|
|
378
|
+
/** Replace one layer in memory without changing any other profile. */
|
|
379
|
+
export function replacePluginConfigStoreLayer(store, values, platform) {
|
|
380
|
+
const common = platform ? store.common ?? store.values : canonicalizePluginConfigValues(values);
|
|
381
|
+
const platforms = { ...store.platforms };
|
|
382
|
+
if (platform) {
|
|
383
|
+
if (Object.keys(values).length)
|
|
384
|
+
platforms[platform] = canonicalizePluginConfigValues(values);
|
|
385
|
+
else
|
|
386
|
+
delete platforms[platform];
|
|
387
|
+
}
|
|
388
|
+
const exists = Object.keys(common).length > 0 || Object.keys(platforms).length > 0;
|
|
389
|
+
return { ...store, common, platforms, platform, values: platform ? platforms[platform] ?? {} : common,
|
|
390
|
+
exists, state: exists ? 'ready' : 'missing', issues: [], rawDigest: undefined };
|
|
391
|
+
}
|
|
392
|
+
async function readStoreFile(filePath, platform) {
|
|
349
393
|
const parsed = await parseStoreJson(filePath);
|
|
350
394
|
if (parsed.state === 'invalidJson')
|
|
351
395
|
return parsed.store;
|
|
352
|
-
|
|
396
|
+
const raw = parsed.value;
|
|
397
|
+
if (!isRecord(raw) || raw.schemaVersion !== 6
|
|
398
|
+
|| Object.keys(raw).some((key) => !['schemaVersion', 'common', 'platforms'].includes(key))) {
|
|
399
|
+
return invalidStore(filePath, 'schemaVersionUnsupported', 'Only plugin config store schemaVersion 6 is supported. Reset the old document, then save the required values.', parsed.rawDigest);
|
|
400
|
+
}
|
|
401
|
+
return documentStore({ filePath, common: raw.common, platforms: raw.platforms, rawDigest: parsed.rawDigest, platform });
|
|
353
402
|
}
|
|
354
403
|
async function readNamespacedStoreFile(options) {
|
|
355
404
|
const parsed = await parseStoreJson(options.filePath);
|
|
356
405
|
if (parsed.state === 'invalidJson')
|
|
357
406
|
return parsed.store;
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
return invalidStore(options.filePath, 'schemaVersionUnsupported', 'Only plugin config store schemaVersion
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|| raw.sourceIdentity !== options.sourceIdentity) {
|
|
365
|
-
return invalidStore(options.filePath, 'identityMismatch', 'The store identity does not match its source and namespaced path.', parsed.rawDigest);
|
|
407
|
+
const envelope = readPluginConfigEnvelopeV6(parsed.value);
|
|
408
|
+
if (!envelope)
|
|
409
|
+
return invalidStore(options.filePath, 'schemaVersionUnsupported', 'Only a valid plugin config store schemaVersion 6 is supported. Reset the old document, then save the required values.', parsed.rawDigest);
|
|
410
|
+
if (envelope.sourceId !== options.sourceId || envelope.pluginName !== options.pluginName
|
|
411
|
+
|| !options.sourceIdentity || envelope.binding.sourceIdentity !== options.sourceIdentity) {
|
|
412
|
+
return invalidStore(options.filePath, 'identityMismatch', 'The user store is not bound to the requested source and plugin identity.', parsed.rawDigest);
|
|
366
413
|
}
|
|
367
|
-
return
|
|
368
|
-
|
|
369
|
-
values: raw.values,
|
|
370
|
-
rawDigest: parsed.rawDigest,
|
|
371
|
-
});
|
|
414
|
+
return documentStore({ filePath: options.filePath, common: envelope.common, platforms: envelope.platforms,
|
|
415
|
+
rawDigest: parsed.rawDigest, platform: options.platform });
|
|
372
416
|
}
|
|
373
417
|
function namespacedConfigContent(options) {
|
|
374
|
-
const
|
|
418
|
+
const document = { schemaVersion: 6, common: canonicalizePluginConfigValues(options.common),
|
|
419
|
+
platforms: Object.fromEntries(Object.entries(options.platforms).sort(([a], [b]) => a.localeCompare(b, 'en'))
|
|
420
|
+
.map(([platform, values]) => [platform, canonicalizePluginConfigValues(values)])) };
|
|
375
421
|
if (!options.sourceId)
|
|
376
|
-
return `${JSON.stringify(
|
|
377
|
-
if (!options.sourceIdentity)
|
|
378
|
-
throw new Error('sourceChanged:
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
schemaVersion: 3,
|
|
382
|
-
sourceId: options.sourceId,
|
|
383
|
-
sourceIdentity: options.sourceIdentity,
|
|
384
|
-
pluginName: options.pluginName,
|
|
385
|
-
values,
|
|
386
|
-
};
|
|
387
|
-
return `${JSON.stringify(envelope, null, 2)}\n`;
|
|
388
|
-
}
|
|
389
|
-
async function assertNoLegacyConfigCoexistence(options) {
|
|
390
|
-
if (!options.sourceId)
|
|
391
|
-
return;
|
|
392
|
-
const legacyPath = resolvePluginConfigStorePath({
|
|
393
|
-
pluginName: options.pluginName,
|
|
394
|
-
scope: options.scope,
|
|
395
|
-
cwd: options.cwd,
|
|
396
|
-
env: options.env,
|
|
397
|
-
...(options.scope === 'project' ? { access: 'read' } : {}),
|
|
398
|
-
});
|
|
399
|
-
if (await lstatIfExists(legacyPath)) {
|
|
400
|
-
throw new Error('legacyStateUnsupported: legacy and namespaced plugin config stores cannot coexist.');
|
|
401
|
-
}
|
|
422
|
+
return `${JSON.stringify(document, null, 2)}\n`;
|
|
423
|
+
if (!options.sourceIdentity)
|
|
424
|
+
throw new Error('sourceChanged: user plugin config requires a source identity.');
|
|
425
|
+
return `${JSON.stringify({ ...document, sourceId: options.sourceId, pluginName: options.pluginName,
|
|
426
|
+
binding: { kind: 'source', sourceIdentity: options.sourceIdentity } }, null, 2)}\n`;
|
|
402
427
|
}
|
|
403
428
|
export async function readPluginConfigStore(options) {
|
|
404
429
|
const filePath = resolvePluginConfigStorePath({
|
|
@@ -431,10 +456,13 @@ export async function readPluginConfigStore(options) {
|
|
|
431
456
|
? readNamespacedStoreFile({
|
|
432
457
|
filePath,
|
|
433
458
|
sourceId: options.sourceId,
|
|
459
|
+
scope: options.scope,
|
|
434
460
|
sourceIdentity: options.sourceIdentity,
|
|
461
|
+
logicalIdentity: options.logicalIdentity,
|
|
435
462
|
pluginName: options.pluginName,
|
|
463
|
+
platform: options.platform,
|
|
436
464
|
})
|
|
437
|
-
: readStoreFile(filePath);
|
|
465
|
+
: readStoreFile(filePath, options.platform);
|
|
438
466
|
}
|
|
439
467
|
export async function readNamespacedPluginConfigStoreIdentity(options) {
|
|
440
468
|
const filePath = resolvePluginConfigStorePath({
|
|
@@ -447,16 +475,16 @@ export async function readNamespacedPluginConfigStoreIdentity(options) {
|
|
|
447
475
|
if (parsed.state === 'invalidJson') {
|
|
448
476
|
throw new Error(`${parsed.store.invalidCode}: invalid namespaced plugin config store.`);
|
|
449
477
|
}
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
452
|
-
||
|
|
453
|
-
||
|
|
478
|
+
const envelope = readPluginConfigEnvelopeV6(parsed.value, options.scope);
|
|
479
|
+
if (!envelope
|
|
480
|
+
|| envelope.sourceId !== options.sourceId
|
|
481
|
+
|| envelope.pluginName !== options.pluginName) {
|
|
454
482
|
throw new Error('schemaVersionUnsupported: invalid namespaced plugin config store.');
|
|
455
483
|
}
|
|
456
|
-
const store =
|
|
484
|
+
const store = documentStore({ filePath, common: envelope.common, platforms: envelope.platforms, platform: options.platform });
|
|
457
485
|
assertReadyPluginConfigStore(store);
|
|
458
486
|
return {
|
|
459
|
-
|
|
487
|
+
binding: envelope.binding,
|
|
460
488
|
store,
|
|
461
489
|
};
|
|
462
490
|
}
|
|
@@ -484,29 +512,75 @@ async function listConfigStoreDirectoryPluginNames(storeRoot) {
|
|
|
484
512
|
return pluginNames;
|
|
485
513
|
}
|
|
486
514
|
export async function listPluginConfigStorePluginNames(options) {
|
|
487
|
-
const
|
|
488
|
-
const storeRoots = options.scope === 'user'
|
|
489
|
-
? [path.join(resolveAwHome(options.env), CONFIG_DIR)]
|
|
490
|
-
: options.scope === 'project'
|
|
491
|
-
? [path.join(projectRoot, '.agent-workflows', CONFIG_DIR)]
|
|
492
|
-
: [
|
|
493
|
-
path.join(resolveAwHome(options.env), CONFIG_DIR),
|
|
494
|
-
path.join(projectRoot, '.agent-workflows', CONFIG_DIR),
|
|
495
|
-
];
|
|
515
|
+
const storeRoots = [path.join(resolveAwHome(options.env), CONFIG_DIR)];
|
|
496
516
|
const pluginNames = (await Promise.all(storeRoots.map((storeRoot) => listConfigStoreDirectoryPluginNames(storeRoot)))).flat();
|
|
497
517
|
return [...new Set(pluginNames)].sort((left, right) => left.localeCompare(right));
|
|
498
518
|
}
|
|
519
|
+
export async function listNamespacedPluginConfigStoreIdentities(options) {
|
|
520
|
+
const boundaryRoot = resolveAwHome(options.env);
|
|
521
|
+
if (options.scope === 'user') {
|
|
522
|
+
await canonicalizePathThroughExistingAncestor(boundaryRoot);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
await fs.realpath(boundaryRoot);
|
|
526
|
+
}
|
|
527
|
+
const storeRoot = path.join(boundaryRoot, CONFIG_DIR);
|
|
528
|
+
if (!await inspectConfigInventoryStoreRoot(boundaryRoot, storeRoot))
|
|
529
|
+
return [];
|
|
530
|
+
const output = [];
|
|
531
|
+
for (const sourceEntry of await fs.readdir(storeRoot, { withFileTypes: true })) {
|
|
532
|
+
if (!sourceEntry.isDirectory() || sourceEntry.isSymbolicLink())
|
|
533
|
+
continue;
|
|
534
|
+
let sourceId;
|
|
535
|
+
try {
|
|
536
|
+
sourceId = assertSafePluginConfigSegment(sourceEntry.name);
|
|
537
|
+
}
|
|
538
|
+
catch {
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
const sourceRoot = path.join(storeRoot, sourceId);
|
|
542
|
+
let pluginEntries;
|
|
543
|
+
try {
|
|
544
|
+
await assertNoConfigSymlink(boundaryRoot, sourceRoot);
|
|
545
|
+
pluginEntries = await fs.readdir(sourceRoot, { withFileTypes: true });
|
|
546
|
+
}
|
|
547
|
+
catch {
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
for (const pluginEntry of pluginEntries) {
|
|
551
|
+
if (!pluginEntry.isDirectory() || pluginEntry.isSymbolicLink())
|
|
552
|
+
continue;
|
|
553
|
+
let pluginName;
|
|
554
|
+
try {
|
|
555
|
+
pluginName = assertSafePluginConfigSegment(pluginEntry.name);
|
|
556
|
+
await assertNoConfigSymlink(boundaryRoot, path.join(sourceRoot, pluginName));
|
|
557
|
+
}
|
|
558
|
+
catch {
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
let target;
|
|
562
|
+
try {
|
|
563
|
+
target = await lstatIfExists(path.join(sourceRoot, pluginName, CONFIG_FILE));
|
|
564
|
+
}
|
|
565
|
+
catch {
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
if (!target)
|
|
569
|
+
continue;
|
|
570
|
+
output.push({ sourceId, pluginName, pluginId: `${sourceId}/${pluginName}` });
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return output.sort((left, right) => left.pluginId.localeCompare(right.pluginId));
|
|
574
|
+
}
|
|
499
575
|
export async function listNamespacedPluginConfigStores(options) {
|
|
500
|
-
const boundaryRoot = options.
|
|
501
|
-
? resolveAwHome(options.env)
|
|
502
|
-
: resolveAwProjectRoot(options.cwd);
|
|
576
|
+
const boundaryRoot = resolveAwHome(options.env);
|
|
503
577
|
if (options.scope === 'user') {
|
|
504
578
|
await canonicalizePathThroughExistingAncestor(boundaryRoot);
|
|
505
579
|
}
|
|
506
580
|
else {
|
|
507
581
|
await fs.realpath(boundaryRoot);
|
|
508
582
|
}
|
|
509
|
-
const storeRoot = path.join(boundaryRoot,
|
|
583
|
+
const storeRoot = path.join(boundaryRoot, CONFIG_DIR);
|
|
510
584
|
const output = [];
|
|
511
585
|
if (!await inspectConfigInventoryStoreRoot(boundaryRoot, storeRoot))
|
|
512
586
|
return output;
|
|
@@ -532,17 +606,17 @@ export async function listNamespacedPluginConfigStores(options) {
|
|
|
532
606
|
if (parsed.state === 'invalidJson') {
|
|
533
607
|
throw new Error(`${parsed.store.invalidCode}: invalid namespaced plugin config store "${filePath}".`);
|
|
534
608
|
}
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
537
|
-
||
|
|
538
|
-
||
|
|
609
|
+
const envelope = readPluginConfigEnvelopeV6(parsed.value, options.scope);
|
|
610
|
+
if (!envelope
|
|
611
|
+
|| envelope.sourceId !== sourceId
|
|
612
|
+
|| envelope.pluginName !== pluginName) {
|
|
539
613
|
throw new Error(`schemaVersionUnsupported: invalid namespaced plugin config store "${filePath}".`);
|
|
540
614
|
}
|
|
541
|
-
const store =
|
|
615
|
+
const store = documentStore({ filePath, common: envelope.common, platforms: envelope.platforms });
|
|
542
616
|
assertReadyPluginConfigStore(store);
|
|
543
617
|
output.push({
|
|
544
618
|
sourceId,
|
|
545
|
-
|
|
619
|
+
binding: envelope.binding,
|
|
546
620
|
pluginName,
|
|
547
621
|
pluginId: `${sourceId}/${pluginName}`,
|
|
548
622
|
values: store.values,
|
|
@@ -552,90 +626,51 @@ export async function listNamespacedPluginConfigStores(options) {
|
|
|
552
626
|
return output.sort((left, right) => left.pluginId.localeCompare(right.pluginId));
|
|
553
627
|
}
|
|
554
628
|
export async function writePluginConfigStore(options) {
|
|
555
|
-
await
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
...(options.scope === 'project' ? { access: 'write' } : {}),
|
|
559
|
-
});
|
|
560
|
-
const allowedRoot = resolvePluginConfigAllowedRoot(options);
|
|
561
|
-
const validated = validateStoreValues({ filePath, values: options.values });
|
|
629
|
+
const current = await readPluginConfigStore(options);
|
|
630
|
+
assertReadyPluginConfigStore(current);
|
|
631
|
+
const validated = validateStoreValues({ filePath: current.path, values: options.values });
|
|
562
632
|
assertReadyPluginConfigStore(validated);
|
|
563
|
-
|
|
564
|
-
filePath,
|
|
565
|
-
allowedRoot,
|
|
566
|
-
action: async () => Object.keys(validated.values).length === 0
|
|
567
|
-
? atomicRemoveConfigFile({ filePath, allowedRoot })
|
|
568
|
-
: atomicReplaceConfigFile({
|
|
569
|
-
filePath,
|
|
570
|
-
allowedRoot,
|
|
571
|
-
content: namespacedConfigContent({ ...options, values: validated.values }),
|
|
572
|
-
mode: 0o600,
|
|
573
|
-
}),
|
|
574
|
-
});
|
|
575
|
-
return {
|
|
576
|
-
pluginName: options.pluginName,
|
|
577
|
-
scope: options.scope,
|
|
578
|
-
path: filePath,
|
|
579
|
-
};
|
|
633
|
+
return commitPluginConfigLayer(options, current, validated.values);
|
|
580
634
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
const filePath = resolvePluginConfigStorePath({
|
|
584
|
-
...options,
|
|
585
|
-
...(options.scope === 'project' ? { access: 'write' } : {}),
|
|
586
|
-
});
|
|
635
|
+
async function commitPluginConfigLayer(options, current, values) {
|
|
636
|
+
const next = replacePluginConfigStoreLayer(current, values, options.platform);
|
|
587
637
|
const allowedRoot = resolvePluginConfigAllowedRoot(options);
|
|
638
|
+
await withConfigFileMutation({ filePath: current.path, allowedRoot, action: async () => {
|
|
639
|
+
if (!next.exists)
|
|
640
|
+
await atomicRemoveConfigFile({ filePath: current.path, allowedRoot });
|
|
641
|
+
else
|
|
642
|
+
await atomicReplaceConfigFile({ filePath: current.path, allowedRoot,
|
|
643
|
+
content: namespacedConfigContent({ ...options, common: next.common, platforms: next.platforms }), mode: 0o600 });
|
|
644
|
+
} });
|
|
645
|
+
return { pluginName: options.pluginName, scope: 'user', platform: options.platform, path: current.path, warnings: [] };
|
|
646
|
+
}
|
|
647
|
+
export async function patchPluginConfigStore(options) {
|
|
648
|
+
await options.reviewPreflight?.();
|
|
649
|
+
const current = await readPluginConfigStore(options);
|
|
650
|
+
assertReadyPluginConfigStore(current);
|
|
588
651
|
const removedKeys = options.removeKeys ?? [];
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
: await readStoreFile(filePath)
|
|
603
|
-
: readyStore(filePath, {});
|
|
604
|
-
assertReadyPluginConfigStore(current);
|
|
605
|
-
if (options.requireExistingRemoveKeys) {
|
|
606
|
-
const missingKey = removedKeys.find((key) => !Object.hasOwn(current.values, key));
|
|
607
|
-
if (missingKey)
|
|
608
|
-
throw new Error(`Unknown config key "${missingKey}".`);
|
|
609
|
-
}
|
|
610
|
-
const next = { ...current.values };
|
|
611
|
-
for (const key of removedKeys) {
|
|
612
|
-
delete next[key];
|
|
613
|
-
}
|
|
614
|
-
for (const [key, value] of Object.entries(options.updates)) {
|
|
615
|
-
next[key] = value;
|
|
616
|
-
}
|
|
617
|
-
if (Object.keys(next).length === 0) {
|
|
618
|
-
await atomicRemoveConfigFile({ filePath, allowedRoot });
|
|
619
|
-
}
|
|
620
|
-
else {
|
|
621
|
-
await atomicReplaceConfigFile({
|
|
622
|
-
filePath,
|
|
623
|
-
allowedRoot,
|
|
624
|
-
content: namespacedConfigContent({ ...options, values: next }),
|
|
625
|
-
mode: 0o600,
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
},
|
|
629
|
-
});
|
|
630
|
-
return {
|
|
631
|
-
pluginName: options.pluginName,
|
|
632
|
-
scope: options.scope,
|
|
633
|
-
path: filePath,
|
|
634
|
-
updatedKeys: Object.keys(options.updates),
|
|
635
|
-
removedKeys,
|
|
636
|
-
};
|
|
652
|
+
if (options.requireExistingRemoveKeys) {
|
|
653
|
+
const missing = removedKeys.find((key) => !Object.hasOwn(current.values, key));
|
|
654
|
+
if (missing)
|
|
655
|
+
throw new Error(`Unknown config key "${missing}".`);
|
|
656
|
+
}
|
|
657
|
+
const next = Object.assign(Object.create(null), current.values);
|
|
658
|
+
for (const key of removedKeys)
|
|
659
|
+
delete next[key];
|
|
660
|
+
for (const [key, value] of Object.entries(options.updates))
|
|
661
|
+
next[key] = value;
|
|
662
|
+
const validated = validateStoreValues({ filePath: current.path, values: next });
|
|
663
|
+
assertReadyPluginConfigStore(validated);
|
|
664
|
+
return { ...await commitPluginConfigLayer(options, current, validated.values), updatedKeys: Object.keys(options.updates), removedKeys };
|
|
637
665
|
}
|
|
638
666
|
export async function resetPluginConfigStore(options) {
|
|
667
|
+
return resetPluginConfigStoreTarget(options, false);
|
|
668
|
+
}
|
|
669
|
+
/** Delete the plugin's complete user document, including every platform profile. */
|
|
670
|
+
export async function deletePluginConfigStore(options) {
|
|
671
|
+
return resetPluginConfigStoreTarget(options, true);
|
|
672
|
+
}
|
|
673
|
+
async function resetPluginConfigStoreTarget(options, wholeDocument) {
|
|
639
674
|
const filePath = resolvePluginConfigStorePath({
|
|
640
675
|
...options,
|
|
641
676
|
...(options.scope === 'project' ? { access: 'write' } : {}),
|
|
@@ -654,8 +689,8 @@ export async function resetPluginConfigStore(options) {
|
|
|
654
689
|
if (!stats) {
|
|
655
690
|
return {
|
|
656
691
|
pluginName: options.pluginName,
|
|
657
|
-
scope:
|
|
658
|
-
storeKind:
|
|
692
|
+
scope: 'user',
|
|
693
|
+
storeKind: 'user',
|
|
659
694
|
path: filePath,
|
|
660
695
|
existed: false,
|
|
661
696
|
deleted: false,
|
|
@@ -671,8 +706,8 @@ export async function resetPluginConfigStore(options) {
|
|
|
671
706
|
if (!parentStats) {
|
|
672
707
|
return {
|
|
673
708
|
pluginName: options.pluginName,
|
|
674
|
-
scope:
|
|
675
|
-
storeKind:
|
|
709
|
+
scope: 'user',
|
|
710
|
+
storeKind: 'user',
|
|
676
711
|
path: filePath,
|
|
677
712
|
existed: false,
|
|
678
713
|
deleted: false,
|
|
@@ -687,21 +722,35 @@ export async function resetPluginConfigStore(options) {
|
|
|
687
722
|
if (!target) {
|
|
688
723
|
return {
|
|
689
724
|
pluginName: options.pluginName,
|
|
690
|
-
scope:
|
|
691
|
-
storeKind:
|
|
725
|
+
scope: 'user',
|
|
726
|
+
storeKind: 'user',
|
|
692
727
|
path: filePath,
|
|
693
728
|
existed: false,
|
|
694
729
|
deleted: false,
|
|
695
730
|
resetDisposition: 'absent',
|
|
696
731
|
};
|
|
697
732
|
}
|
|
733
|
+
let store;
|
|
734
|
+
if (target.isFile()) {
|
|
735
|
+
try {
|
|
736
|
+
store = await readPluginConfigStore(options);
|
|
737
|
+
}
|
|
738
|
+
catch {
|
|
739
|
+
// A broken document still has the schema-independent reset recovery below.
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
if (!wholeDocument && store && store.state !== 'invalid' && replacePluginConfigStoreLayer(store, {}, options.platform).exists) {
|
|
743
|
+
await commitPluginConfigLayer(options, store, {});
|
|
744
|
+
return { pluginName: options.pluginName, scope: 'user', platform: options.platform, storeKind: 'user',
|
|
745
|
+
path: filePath, existed: true, deleted: false, resetDisposition: 'clearedLayer' };
|
|
746
|
+
}
|
|
698
747
|
if (target.isFile() || target.isSymbolicLink()) {
|
|
699
748
|
await assertNoConfigSymlink(allowedRoot, path.dirname(filePath));
|
|
700
749
|
await nodeFs.unlink(filePath);
|
|
701
750
|
return {
|
|
702
751
|
pluginName: options.pluginName,
|
|
703
|
-
scope:
|
|
704
|
-
storeKind:
|
|
752
|
+
scope: 'user',
|
|
753
|
+
storeKind: 'user',
|
|
705
754
|
path: filePath,
|
|
706
755
|
existed: true,
|
|
707
756
|
deleted: true,
|
|
@@ -715,8 +764,8 @@ export async function resetPluginConfigStore(options) {
|
|
|
715
764
|
await nodeFs.rename(filePath, path.join(path.dirname(filePath), quarantineBasename));
|
|
716
765
|
return {
|
|
717
766
|
pluginName: options.pluginName,
|
|
718
|
-
scope:
|
|
719
|
-
storeKind:
|
|
767
|
+
scope: 'user',
|
|
768
|
+
storeKind: 'user',
|
|
720
769
|
path: filePath,
|
|
721
770
|
existed: true,
|
|
722
771
|
deleted: true,
|
|
@@ -790,41 +839,43 @@ function resetTargetInspection(kind, stats) {
|
|
|
790
839
|
};
|
|
791
840
|
}
|
|
792
841
|
export async function resetPluginConfigStores(options) {
|
|
793
|
-
await
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
const existing = [];
|
|
801
|
-
for (const target of targets) {
|
|
802
|
-
await prepareConfigFileParent(target.path, allowedRoot);
|
|
803
|
-
await assertNoConfigSymlink(allowedRoot, target.path);
|
|
804
|
-
const stats = await lstatIfExists(target.path);
|
|
805
|
-
existing.push(stats !== null);
|
|
806
|
-
if (!stats)
|
|
807
|
-
continue;
|
|
808
|
-
if (!stats.isFile() || stats.isSymbolicLink()) {
|
|
809
|
-
throw new Error(`Config target must be a regular file: ${target.path}`);
|
|
810
|
-
}
|
|
842
|
+
return [await resetPluginConfigStore(options)];
|
|
843
|
+
}
|
|
844
|
+
export class PluginConfigValueValidationError extends Error {
|
|
845
|
+
publicMessage;
|
|
846
|
+
constructor(issue, publicMessage) {
|
|
847
|
+
super(formatPluginConfigIssue(issue));
|
|
848
|
+
this.publicMessage = publicMessage;
|
|
811
849
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
850
|
+
}
|
|
851
|
+
function configValueIssuePublicMessage(initialField, input, issue) {
|
|
852
|
+
const segments = issue.path.segments;
|
|
853
|
+
if (segments === undefined || segments.length < 2 || initialField.sensitive === true)
|
|
854
|
+
return undefined;
|
|
855
|
+
let field = initialField;
|
|
856
|
+
let value = input;
|
|
857
|
+
// User-supplied object keys may contain private text. Only report declared properties and row positions.
|
|
858
|
+
for (const [index, segment] of segments.slice(1).entries()) {
|
|
859
|
+
if (typeof segment === 'number' && field.type === 'array' && Array.isArray(value)) {
|
|
860
|
+
field = field.items;
|
|
861
|
+
value = value[segment];
|
|
862
|
+
}
|
|
863
|
+
else if (typeof segment === 'string' && field.type === 'object' && isRecord(value)) {
|
|
864
|
+
if (!/^[A-Za-z0-9_-]+$/u.test(segment))
|
|
865
|
+
return undefined;
|
|
866
|
+
if (issue.code === 'platformOnlyProperty' && index === segments.length - 2) {
|
|
867
|
+
return getStrippedPlatformOnlyProperties(field, value).has(segment) ? formatPluginConfigIssue(issue) : undefined;
|
|
868
|
+
}
|
|
869
|
+
const { properties } = resolvePluginConfigObjectProperties(field, value);
|
|
870
|
+
if (!Object.hasOwn(properties, segment))
|
|
871
|
+
return undefined;
|
|
872
|
+
field = properties[segment];
|
|
873
|
+
value = Object.hasOwn(value, segment) ? value[segment] : undefined;
|
|
874
|
+
}
|
|
875
|
+
else
|
|
876
|
+
return undefined;
|
|
826
877
|
}
|
|
827
|
-
return
|
|
878
|
+
return formatPluginConfigIssue(issue);
|
|
828
879
|
}
|
|
829
880
|
function coerceConfigValue(key, field, value) {
|
|
830
881
|
let coerced = value;
|
|
@@ -840,7 +891,8 @@ function coerceConfigValue(key, field, value) {
|
|
|
840
891
|
}
|
|
841
892
|
const issues = validateCorePluginConfigValue(field, coerced, key);
|
|
842
893
|
if (issues.length > 0) {
|
|
843
|
-
|
|
894
|
+
const issue = issues[0];
|
|
895
|
+
throw new PluginConfigValueValidationError(issue, configValueIssuePublicMessage(field, coerced, issue));
|
|
844
896
|
}
|
|
845
897
|
return coerced;
|
|
846
898
|
}
|
|
@@ -850,16 +902,16 @@ export async function coercePluginConfigValue(options) {
|
|
|
850
902
|
function redactValue(field, value) {
|
|
851
903
|
return redactPluginConfigValue(field, value);
|
|
852
904
|
}
|
|
853
|
-
function sourceForStoreLayer(scope) {
|
|
854
|
-
return scope === 'user' ? 'user' : 'project';
|
|
855
|
-
}
|
|
856
905
|
async function applyConfigLayer(options) {
|
|
857
906
|
for (const [key, field] of Object.entries(options.schema)) {
|
|
858
907
|
if (!Object.hasOwn(options.entries, key)) {
|
|
859
908
|
continue;
|
|
860
909
|
}
|
|
861
910
|
const value = options.entries[key];
|
|
862
|
-
|
|
911
|
+
// Inherited values must be legal in their originating common profile as well as this platform.
|
|
912
|
+
const commonField = options.commonSchema?.[key];
|
|
913
|
+
const commonIssues = commonField ? validateCorePluginConfigValue(commonField, value, key) : [];
|
|
914
|
+
const validationIssues = commonIssues.length > 0 ? commonIssues : validateCorePluginConfigValue(field, value, key);
|
|
863
915
|
if (validationIssues.length === 0) {
|
|
864
916
|
const redactedValue = redactValue(field, value);
|
|
865
917
|
options.values[key] = value;
|
|
@@ -888,38 +940,31 @@ async function applyConfigLayer(options) {
|
|
|
888
940
|
}
|
|
889
941
|
}
|
|
890
942
|
export async function resolveEffectivePluginConfig(options) {
|
|
943
|
+
const workContext = options.context ? await resolveWorkContext({ cwd: options.cwd, context: options.context }) : undefined;
|
|
891
944
|
const pluginName = assertSafePluginConfigSegment(options.pluginName ?? options.manifest.name);
|
|
892
|
-
const
|
|
945
|
+
const user = await readPluginConfigStore({ ...options, pluginName, scope: 'user' });
|
|
946
|
+
assertReadyPluginConfigStore(user);
|
|
947
|
+
const references = !options.referenceContext && pluginConfigHasExternalReferences(options.manifest)
|
|
948
|
+
? await resolvePluginConfigReferenceContext({ ...options, scope: options.context ?? options.targetScope ?? 'user', plugins: options.referencePlugins }) : undefined;
|
|
949
|
+
return resolveEffectivePluginConfigFromStores({ ...options, pluginName, projectRoot: workContext?.projectRoot ?? ((options.context ?? options.targetScope) === 'project' ? resolveAwProjectRoot(options.cwd) : ''),
|
|
950
|
+
referenceContext: options.referenceContext ?? references?.context, referenceEvidence: references?.evidence,
|
|
951
|
+
stores: { user } });
|
|
952
|
+
}
|
|
953
|
+
export async function resolveEffectivePluginConfigFromStores(options) {
|
|
954
|
+
const pluginName = assertSafePluginConfigSegment(options.pluginName ?? options.manifest.name);
|
|
955
|
+
const definition = options.manifest.config ? selectPluginConfigProfile(options.manifest.config, options.platform) : undefined;
|
|
956
|
+
const schema = definition?.fields;
|
|
893
957
|
if (!schema) {
|
|
894
|
-
throw new
|
|
958
|
+
throw new PluginConfigSchemaResolutionError('configSchemaUnavailable', `Plugin "${pluginName}" does not declare an AW config schema.`);
|
|
895
959
|
}
|
|
896
|
-
const
|
|
897
|
-
const userStore = await readPluginConfigStore({
|
|
898
|
-
sourceId: options.sourceId,
|
|
899
|
-
sourceIdentity: options.sourceIdentity,
|
|
900
|
-
pluginName,
|
|
901
|
-
scope: 'user',
|
|
902
|
-
cwd: options.cwd,
|
|
903
|
-
env: options.env,
|
|
904
|
-
});
|
|
905
|
-
const projectStore = options.targetScope === 'user'
|
|
906
|
-
? undefined
|
|
907
|
-
: await readPluginConfigStore({
|
|
908
|
-
sourceId: options.sourceId,
|
|
909
|
-
sourceIdentity: options.sourceIdentity,
|
|
910
|
-
pluginName,
|
|
911
|
-
scope: 'project',
|
|
912
|
-
cwd: options.cwd,
|
|
913
|
-
env: options.env,
|
|
914
|
-
});
|
|
960
|
+
const userStore = options.stores.user;
|
|
915
961
|
assertReadyPluginConfigStore(userStore);
|
|
916
|
-
if (projectStore)
|
|
917
|
-
assertReadyPluginConfigStore(projectStore);
|
|
918
962
|
const values = {};
|
|
919
963
|
const redactedValues = {};
|
|
920
964
|
const sources = {};
|
|
921
965
|
const fieldStates = {};
|
|
922
966
|
const ignoredUnknownKeys = [];
|
|
967
|
+
const unsupportedLayerOverrides = [];
|
|
923
968
|
const dangerousKeyIssues = [];
|
|
924
969
|
const schemaKeys = new Set(Object.keys(schema));
|
|
925
970
|
for (const key of schemaKeys) {
|
|
@@ -939,33 +984,34 @@ export async function resolveEffectivePluginConfig(options) {
|
|
|
939
984
|
source: 'default',
|
|
940
985
|
});
|
|
941
986
|
}
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
:
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
987
|
+
const commonFields = selectPluginConfigProfile(options.manifest.config, undefined).fields;
|
|
988
|
+
const layers = [
|
|
989
|
+
{ entries: options.platform
|
|
990
|
+
? Object.fromEntries(Object.entries(userStore.common ?? (userStore.platform ? {} : userStore.values))
|
|
991
|
+
.filter(([key]) => {
|
|
992
|
+
// Unknown keys remain available to the existing dangerous-key check and
|
|
993
|
+
// unknown-key reporting; only declared, platform-specific values are isolated.
|
|
994
|
+
if (!Object.hasOwn(schema, key))
|
|
995
|
+
return true;
|
|
996
|
+
const field = schema[key];
|
|
997
|
+
return Object.hasOwn(commonFields, key) && !('platformOnly' in field && field.platformOnly);
|
|
998
|
+
}))
|
|
999
|
+
: userStore.common ?? userStore.values, source: 'common' },
|
|
1000
|
+
...(options.platform ? [{ entries: userStore.platforms?.[options.platform] ?? {}, source: 'platform' }] : []),
|
|
1001
|
+
];
|
|
1002
|
+
for (const { entries, source } of layers) {
|
|
1003
|
+
const plainEntries = getStoreEntries(entries);
|
|
1004
|
+
const dangerousIssues = new Map(validatePluginConfigDocument(definition, plainEntries)
|
|
1005
|
+
.filter((issue) => issue.code === 'dangerousKey').map((issue) => [issue.path.field, issue]));
|
|
953
1006
|
for (const key of Object.keys(plainEntries)) {
|
|
954
|
-
if (
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
message: formatPluginConfigIssue(dangerousIssue),
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
else {
|
|
966
|
-
ignoredUnknownKeys.push({ scope, source, key });
|
|
967
|
-
}
|
|
968
|
-
}
|
|
1007
|
+
if (schemaKeys.has(key))
|
|
1008
|
+
continue;
|
|
1009
|
+
const dangerousIssue = dangerousIssues.get(key);
|
|
1010
|
+
if (dangerousIssue)
|
|
1011
|
+
dangerousKeyIssues.push({ type: 'invalid-config', code: dangerousIssue.code,
|
|
1012
|
+
key, source, message: formatPluginConfigIssue(dangerousIssue) });
|
|
1013
|
+
else
|
|
1014
|
+
ignoredUnknownKeys.push({ scope: 'user', source, key });
|
|
969
1015
|
}
|
|
970
1016
|
await applyConfigLayer({
|
|
971
1017
|
values,
|
|
@@ -973,13 +1019,108 @@ export async function resolveEffectivePluginConfig(options) {
|
|
|
973
1019
|
sources,
|
|
974
1020
|
fieldStates,
|
|
975
1021
|
schema,
|
|
1022
|
+
...(options.platform !== undefined && source === 'common' ? { commonSchema: commonFields } : {}),
|
|
976
1023
|
entries: plainEntries,
|
|
977
1024
|
source,
|
|
978
1025
|
});
|
|
979
1026
|
}
|
|
1027
|
+
const candidateValues = {};
|
|
1028
|
+
for (const [key, field] of Object.entries(schema)) {
|
|
1029
|
+
const source = sources[key];
|
|
1030
|
+
if (source === 'default')
|
|
1031
|
+
candidateValues[key] = field.default;
|
|
1032
|
+
if (source === 'common')
|
|
1033
|
+
candidateValues[key] = ownStoreValue(userStore.common ?? userStore.values, key);
|
|
1034
|
+
if (source === 'platform' && options.platform)
|
|
1035
|
+
candidateValues[key] = ownStoreValue(userStore.platforms?.[options.platform] ?? {}, key);
|
|
1036
|
+
}
|
|
1037
|
+
const candidateIssues = validatePluginConfigCandidate(definition, candidateValues, undefined, options.referenceContext);
|
|
1038
|
+
const referenceIssues = candidateIssues.filter((issue) => issue.code.startsWith('valueRef')
|
|
1039
|
+
&& (!issue.path.plugin || issue.path.plugin === pluginName));
|
|
1040
|
+
const missingReferenceIssues = [];
|
|
1041
|
+
for (const issue of referenceIssues) {
|
|
1042
|
+
const key = issue.path.field;
|
|
1043
|
+
const source = sources[key];
|
|
1044
|
+
const state = fieldStates[key];
|
|
1045
|
+
const configIssue = {
|
|
1046
|
+
type: 'invalid-config', code: issue.code, key, source,
|
|
1047
|
+
message: formatPluginConfigIssue(issue),
|
|
1048
|
+
};
|
|
1049
|
+
if (source === 'missing') {
|
|
1050
|
+
missingReferenceIssues.push(configIssue);
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
delete values[key];
|
|
1054
|
+
delete redactedValues[key];
|
|
1055
|
+
fieldStates[key] = {
|
|
1056
|
+
invalidOverride: { source, issues: [...(state?.invalidOverride?.issues ?? []), configIssue] },
|
|
1057
|
+
...(state?.fallback ? { fallback: state.fallback } : {}),
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
// Provider errors stay private, while each field that reads them remains unusable.
|
|
1061
|
+
if (options.referenceContext) {
|
|
1062
|
+
for (const foreign of candidateIssues.filter((issue) => issue.code.startsWith('valueRef')
|
|
1063
|
+
&& issue.path.plugin && issue.path.plugin !== pluginName)) {
|
|
1064
|
+
for (const key of schemaKeys) {
|
|
1065
|
+
let dependencies;
|
|
1066
|
+
try {
|
|
1067
|
+
dependencies = getPluginConfigDependencyFields(definition, [key], options.referenceContext);
|
|
1068
|
+
}
|
|
1069
|
+
catch {
|
|
1070
|
+
continue; // The local association issue already reports the invalid schema.
|
|
1071
|
+
}
|
|
1072
|
+
if (!dependencies.some((entry) => entry.plugin === foreign.path.plugin && entry.field === foreign.path.field))
|
|
1073
|
+
continue;
|
|
1074
|
+
const source = sources[key];
|
|
1075
|
+
const state = fieldStates[key];
|
|
1076
|
+
const configIssue = { type: 'invalid-config', code: 'valueRefSource', key, source,
|
|
1077
|
+
message: `Config "${key}" depends on invalid config "${foreign.path.plugin}/${foreign.path.field}". Fix the dependency before using this field.` };
|
|
1078
|
+
if (state?.invalidOverride?.issues.some((issue) => issue.code === configIssue.code && issue.message === configIssue.message))
|
|
1079
|
+
continue;
|
|
1080
|
+
delete values[key];
|
|
1081
|
+
delete redactedValues[key];
|
|
1082
|
+
if (source === 'missing')
|
|
1083
|
+
missingReferenceIssues.push(configIssue);
|
|
1084
|
+
else
|
|
1085
|
+
fieldStates[key] = { invalidOverride: { source, issues: [...(state?.invalidOverride?.issues ?? []), configIssue] },
|
|
1086
|
+
...(state?.fallback ? { fallback: state.fallback } : {}) };
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
// Consumers must retain dependency failures after invalid source values are omitted.
|
|
1091
|
+
const invalidKeys = new Set([
|
|
1092
|
+
...Object.entries(fieldStates).filter(([, state]) => state.invalidOverride !== undefined).map(([key]) => key),
|
|
1093
|
+
...missingReferenceIssues.map((issue) => issue.key),
|
|
1094
|
+
]);
|
|
1095
|
+
for (const key of schemaKeys) {
|
|
1096
|
+
if (invalidKeys.has(key))
|
|
1097
|
+
continue;
|
|
1098
|
+
const dependency = getPluginConfigDependencyKeys(definition, [key])
|
|
1099
|
+
.find((dependencyKey) => dependencyKey !== key && invalidKeys.has(dependencyKey));
|
|
1100
|
+
if (dependency === undefined)
|
|
1101
|
+
continue;
|
|
1102
|
+
const source = sources[key];
|
|
1103
|
+
const configIssue = {
|
|
1104
|
+
type: 'invalid-config', code: 'valueRefSource', key, source,
|
|
1105
|
+
message: `Config "${key}" depends on invalid config "${dependency}". Fix the dependency before using this field.`,
|
|
1106
|
+
};
|
|
1107
|
+
delete values[key];
|
|
1108
|
+
delete redactedValues[key];
|
|
1109
|
+
if (source === 'missing') {
|
|
1110
|
+
missingReferenceIssues.push(configIssue);
|
|
1111
|
+
}
|
|
1112
|
+
else {
|
|
1113
|
+
const state = fieldStates[key];
|
|
1114
|
+
fieldStates[key] = {
|
|
1115
|
+
invalidOverride: { source, issues: [configIssue] },
|
|
1116
|
+
...(state?.fallback ? { fallback: state.fallback } : {}),
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
980
1120
|
const issues = [
|
|
981
1121
|
...Object.values(fieldStates).flatMap((state) => state.invalidOverride?.issues ?? []),
|
|
982
1122
|
...dangerousKeyIssues,
|
|
1123
|
+
...missingReferenceIssues,
|
|
983
1124
|
];
|
|
984
1125
|
for (const [key, field] of Object.entries(schema)) {
|
|
985
1126
|
if (field.required && values[key] === undefined && !fieldStates[key]?.invalidOverride) {
|
|
@@ -993,20 +1134,65 @@ export async function resolveEffectivePluginConfig(options) {
|
|
|
993
1134
|
}
|
|
994
1135
|
return {
|
|
995
1136
|
pluginName,
|
|
996
|
-
|
|
1137
|
+
platform: options.platform,
|
|
1138
|
+
context: options.context ?? options.targetScope ?? 'user',
|
|
1139
|
+
definition: definition,
|
|
1140
|
+
projectRoot: options.projectRoot,
|
|
997
1141
|
values,
|
|
998
1142
|
redactedValues,
|
|
999
1143
|
sources,
|
|
1000
1144
|
fieldStates,
|
|
1001
1145
|
issues,
|
|
1146
|
+
unsupportedLayerOverrides,
|
|
1002
1147
|
ignoredUnknownKeys,
|
|
1003
1148
|
schema,
|
|
1004
1149
|
stores: {
|
|
1005
1150
|
user: userStore,
|
|
1006
|
-
...(projectStore ? { project: projectStore } : {}),
|
|
1007
1151
|
},
|
|
1152
|
+
...(options.referenceContext ? { referenceContext: options.referenceContext } : {}),
|
|
1153
|
+
...(options.referenceEvidence ? { referenceEvidence: options.referenceEvidence } : {}),
|
|
1008
1154
|
};
|
|
1009
1155
|
}
|
|
1156
|
+
function ownStoreValue(values, key) {
|
|
1157
|
+
return Object.hasOwn(values, key) ? values[key] : undefined;
|
|
1158
|
+
}
|
|
1159
|
+
/** Check cross-field relations before saving one complete layer candidate. */
|
|
1160
|
+
export async function assertPluginConfigMutationCandidate(options) {
|
|
1161
|
+
const pluginId = options.sourceId ? `${options.sourceId}/${options.pluginName}` : options.pluginName;
|
|
1162
|
+
const preferences = await observePreferences(options);
|
|
1163
|
+
if (Object.keys(options.updates).length) {
|
|
1164
|
+
assertConfigLayerWritable(pluginId, options.manifest, preferences, options.platform);
|
|
1165
|
+
}
|
|
1166
|
+
const user = await readPluginConfigStore({ ...options, scope: 'user' });
|
|
1167
|
+
assertReadyPluginConfigStore(user);
|
|
1168
|
+
// Unsetting an unknown (stale) key has no effective profile to validate.
|
|
1169
|
+
const selectedFields = options.manifest.config ? selectPluginConfigProfile(options.manifest.config, options.platform).fields : {};
|
|
1170
|
+
if (!Object.keys(options.updates).length && options.removeKeys.every((key) => !Object.hasOwn(selectedFields, key)))
|
|
1171
|
+
return;
|
|
1172
|
+
const layers = resolveConfigurableLayers(pluginId, options.manifest, preferences);
|
|
1173
|
+
if (!layers.includes(options.platform ?? 'common'))
|
|
1174
|
+
return;
|
|
1175
|
+
const values = { ...user.values };
|
|
1176
|
+
for (const key of options.removeKeys)
|
|
1177
|
+
delete values[key];
|
|
1178
|
+
for (const [key, value] of Object.entries(options.updates))
|
|
1179
|
+
values[key] = value;
|
|
1180
|
+
const candidate = replacePluginConfigStoreLayer(user, values, options.platform);
|
|
1181
|
+
const profiles = options.platform ? [options.platform] : layers.map((layer) => layer === 'common' ? undefined : layer);
|
|
1182
|
+
for (const platform of profiles) {
|
|
1183
|
+
const references = pluginConfigHasExternalReferences(options.manifest)
|
|
1184
|
+
? await resolvePluginConfigReferenceContext({ ...options, platform, plugins: options.referencePlugins }) : undefined;
|
|
1185
|
+
const resolve = (store) => resolveEffectivePluginConfigFromStores({ ...options, platform,
|
|
1186
|
+
targetScope: options.scope, projectRoot: options.scope === 'project' ? resolveAwProjectRoot(options.cwd) : '', stores: { user: store }, referenceContext: references?.context });
|
|
1187
|
+
const [before, after] = await Promise.all([resolve(user), resolve(candidate)]);
|
|
1188
|
+
const existing = new Set(before.issues.map((issue) => `${issue.key}\0${issue.code}\0${issue.message}`));
|
|
1189
|
+
const selectedSource = options.platform ? 'platform' : 'common';
|
|
1190
|
+
const issues = after.issues.filter((issue) => (Object.hasOwn(options.updates, issue.key) && after.sources[issue.key] === selectedSource)
|
|
1191
|
+
|| !existing.has(`${issue.key}\0${issue.code}\0${issue.message}`));
|
|
1192
|
+
if (issues.length)
|
|
1193
|
+
throw Object.assign(new Error(`configReferenceInvalid: ${platform ?? 'common'}: ${issues.map((issue) => issue.message).join(' ')}`), { code: 'configReferenceInvalid' });
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1010
1196
|
export async function coercePluginConfigUpdates(options) {
|
|
1011
1197
|
const output = {};
|
|
1012
1198
|
for (const [key, value] of Object.entries(options.updates)) {
|
|
@@ -1026,35 +1212,28 @@ export async function coercePluginConfigUpdates(options) {
|
|
|
1026
1212
|
export async function resolveProjectArtifactRenderConfig(options) {
|
|
1027
1213
|
if (!options.manifest.config?.fields) {
|
|
1028
1214
|
const pluginName = assertSafePluginConfigSegment(options.pluginName ?? options.manifest.name);
|
|
1029
|
-
const [userStore
|
|
1215
|
+
const [userStore] = await Promise.all([
|
|
1030
1216
|
readPluginConfigStore({
|
|
1031
1217
|
sourceId: options.sourceId,
|
|
1032
1218
|
sourceIdentity: options.sourceIdentity,
|
|
1219
|
+
logicalIdentity: options.logicalIdentity,
|
|
1033
1220
|
pluginName,
|
|
1034
1221
|
scope: 'user',
|
|
1035
1222
|
cwd: options.cwd,
|
|
1036
1223
|
env: options.env,
|
|
1037
1224
|
}),
|
|
1038
|
-
readPluginConfigStore({
|
|
1039
|
-
sourceId: options.sourceId,
|
|
1040
|
-
sourceIdentity: options.sourceIdentity,
|
|
1041
|
-
pluginName,
|
|
1042
|
-
scope: 'project',
|
|
1043
|
-
cwd: options.cwd,
|
|
1044
|
-
env: options.env,
|
|
1045
|
-
}),
|
|
1046
1225
|
]);
|
|
1047
1226
|
assertReadyPluginConfigStore(userStore);
|
|
1048
|
-
assertReadyPluginConfigStore(projectStore);
|
|
1049
1227
|
return {
|
|
1050
1228
|
pluginName,
|
|
1051
1229
|
projectRoot: resolveAwProjectRoot(options.cwd),
|
|
1052
1230
|
values: {},
|
|
1053
1231
|
sources: {},
|
|
1054
1232
|
issues: [],
|
|
1233
|
+
unsupportedLayerOverrides: [],
|
|
1055
1234
|
ignoredUnknownKeys: [],
|
|
1056
1235
|
schema: {},
|
|
1057
|
-
stores: { user: userStore
|
|
1236
|
+
stores: { user: userStore },
|
|
1058
1237
|
};
|
|
1059
1238
|
}
|
|
1060
1239
|
const effective = await resolveEffectivePluginConfig({
|
|
@@ -1067,108 +1246,16 @@ export async function resolveProjectArtifactRenderConfig(options) {
|
|
|
1067
1246
|
values: effective.values,
|
|
1068
1247
|
sources: effective.sources,
|
|
1069
1248
|
issues: effective.issues,
|
|
1249
|
+
unsupportedLayerOverrides: effective.unsupportedLayerOverrides,
|
|
1070
1250
|
ignoredUnknownKeys: effective.ignoredUnknownKeys,
|
|
1071
1251
|
schema: effective.schema,
|
|
1072
1252
|
stores: {
|
|
1073
1253
|
user: effective.stores.user,
|
|
1074
|
-
project: effective.stores.project,
|
|
1075
1254
|
},
|
|
1076
1255
|
};
|
|
1077
1256
|
}
|
|
1078
|
-
async function resolveRedactedLayerValue(options) {
|
|
1079
|
-
try {
|
|
1080
|
-
const coerced = await coercePluginConfigValue({
|
|
1081
|
-
key: options.key,
|
|
1082
|
-
field: options.field,
|
|
1083
|
-
value: options.value,
|
|
1084
|
-
});
|
|
1085
|
-
return {
|
|
1086
|
-
value: redactValue(options.field, coerced),
|
|
1087
|
-
};
|
|
1088
|
-
}
|
|
1089
|
-
catch (error) {
|
|
1090
|
-
return {
|
|
1091
|
-
issue: {
|
|
1092
|
-
type: 'invalid-config',
|
|
1093
|
-
key: options.key,
|
|
1094
|
-
source: options.source,
|
|
1095
|
-
message: error instanceof Error ? error.message : String(error),
|
|
1096
|
-
},
|
|
1097
|
-
};
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
export async function resolveProjectScopedPluginConfigView(options) {
|
|
1101
|
-
const effective = await resolveEffectivePluginConfig(options);
|
|
1102
|
-
const entries = {};
|
|
1103
|
-
for (const [key, field] of Object.entries(effective.schema)) {
|
|
1104
|
-
const entry = {
|
|
1105
|
-
key,
|
|
1106
|
-
effectiveValue: effective.redactedValues[key],
|
|
1107
|
-
effectiveSource: effective.sources[key] ?? 'missing',
|
|
1108
|
-
};
|
|
1109
|
-
if (field.default !== undefined) {
|
|
1110
|
-
const resolvedDefault = await resolveRedactedLayerValue({
|
|
1111
|
-
key,
|
|
1112
|
-
field,
|
|
1113
|
-
source: 'default',
|
|
1114
|
-
value: field.default,
|
|
1115
|
-
});
|
|
1116
|
-
if (resolvedDefault.value !== undefined) {
|
|
1117
|
-
entry.defaultValue = resolvedDefault.value;
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
const userPlainEntries = getStoreEntries(effective.stores.user.values);
|
|
1121
|
-
if (Object.hasOwn(userPlainEntries, key)) {
|
|
1122
|
-
const resolvedUser = await resolveRedactedLayerValue({
|
|
1123
|
-
key,
|
|
1124
|
-
field,
|
|
1125
|
-
source: 'user',
|
|
1126
|
-
value: userPlainEntries[key],
|
|
1127
|
-
});
|
|
1128
|
-
if (resolvedUser.value !== undefined) {
|
|
1129
|
-
entry.userValue = resolvedUser.value;
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
const projectPlainEntries = getStoreEntries(effective.stores.project.values);
|
|
1133
|
-
if (Object.hasOwn(projectPlainEntries, key)) {
|
|
1134
|
-
const resolvedProject = await resolveRedactedLayerValue({
|
|
1135
|
-
key,
|
|
1136
|
-
field,
|
|
1137
|
-
source: 'project',
|
|
1138
|
-
value: projectPlainEntries[key],
|
|
1139
|
-
});
|
|
1140
|
-
if (resolvedProject.value !== undefined) {
|
|
1141
|
-
entry.projectValue = resolvedProject.value;
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
entries[key] = entry;
|
|
1145
|
-
}
|
|
1146
|
-
return {
|
|
1147
|
-
pluginName: effective.pluginName,
|
|
1148
|
-
projectRoot: effective.projectRoot,
|
|
1149
|
-
schema: effective.schema,
|
|
1150
|
-
stores: {
|
|
1151
|
-
user: effective.stores.user,
|
|
1152
|
-
project: effective.stores.project,
|
|
1153
|
-
},
|
|
1154
|
-
redactedValues: effective.redactedValues,
|
|
1155
|
-
sources: effective.sources,
|
|
1156
|
-
entries,
|
|
1157
|
-
issues: effective.issues,
|
|
1158
|
-
ignoredUnknownKeys: effective.ignoredUnknownKeys,
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
1257
|
function toConfigSourceLayer(source) {
|
|
1162
|
-
|
|
1163
|
-
return 'default';
|
|
1164
|
-
}
|
|
1165
|
-
if (source === 'user') {
|
|
1166
|
-
return 'user';
|
|
1167
|
-
}
|
|
1168
|
-
if (source === 'project') {
|
|
1169
|
-
return 'project';
|
|
1170
|
-
}
|
|
1171
|
-
return null;
|
|
1258
|
+
return source === undefined || source === 'missing' ? null : source;
|
|
1172
1259
|
}
|
|
1173
1260
|
function configFieldProjection(options) {
|
|
1174
1261
|
const source = options.source ?? 'missing';
|
|
@@ -1189,216 +1276,74 @@ function configFieldProjection(options) {
|
|
|
1189
1276
|
};
|
|
1190
1277
|
}
|
|
1191
1278
|
async function buildManifestFieldEntries(options) {
|
|
1192
|
-
const schema = options.plugin.manifest.config?.fields;
|
|
1193
|
-
if (!schema) {
|
|
1194
|
-
return [];
|
|
1195
|
-
}
|
|
1196
|
-
const userStore = await readPluginConfigStore({
|
|
1197
|
-
sourceId: options.plugin.sourceId,
|
|
1198
|
-
sourceIdentity: options.plugin.sourceIdentity,
|
|
1199
|
-
pluginName: options.plugin.manifest.name,
|
|
1200
|
-
scope: 'user',
|
|
1201
|
-
cwd: options.cwd,
|
|
1202
|
-
env: options.env,
|
|
1203
|
-
schema,
|
|
1204
|
-
});
|
|
1205
|
-
const projectStore = options.scope === 'user'
|
|
1206
|
-
? undefined
|
|
1207
|
-
: await readPluginConfigStore({
|
|
1208
|
-
sourceId: options.plugin.sourceId,
|
|
1209
|
-
sourceIdentity: options.plugin.sourceIdentity,
|
|
1210
|
-
pluginName: options.plugin.manifest.name,
|
|
1211
|
-
scope: 'project',
|
|
1212
|
-
cwd: options.cwd,
|
|
1213
|
-
env: options.env,
|
|
1214
|
-
schema,
|
|
1215
|
-
});
|
|
1216
|
-
assertReadyPluginConfigStore(userStore);
|
|
1217
|
-
if (projectStore)
|
|
1218
|
-
assertReadyPluginConfigStore(projectStore);
|
|
1219
|
-
const userPlainEntries = getStoreEntries(userStore.values);
|
|
1220
|
-
const projectPlainEntries = projectStore ? getStoreEntries(projectStore.values) : {};
|
|
1221
1279
|
const effective = await resolveEffectivePluginConfig({
|
|
1222
1280
|
sourceId: options.plugin.sourceId,
|
|
1223
1281
|
sourceIdentity: options.plugin.sourceIdentity,
|
|
1224
|
-
|
|
1282
|
+
logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
1225
1283
|
manifest: options.plugin.manifest,
|
|
1226
|
-
|
|
1284
|
+
platform: options.platform,
|
|
1285
|
+
targetScope: options.context ?? (options.scope === 'project' ? 'project' : 'user'),
|
|
1227
1286
|
cwd: options.cwd,
|
|
1228
1287
|
env: options.env,
|
|
1229
1288
|
});
|
|
1230
|
-
const
|
|
1231
|
-
const
|
|
1232
|
-
const
|
|
1233
|
-
const
|
|
1234
|
-
const
|
|
1235
|
-
const
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1289
|
+
const stored = pluginConfigStoreForProfile(effective.stores.user, options.platform).values;
|
|
1290
|
+
const fields = await Promise.all(Object.entries(effective.schema).map(async ([key, field]) => {
|
|
1291
|
+
const state = effective.fieldStates[key];
|
|
1292
|
+
const source = effective.sources[key] ?? 'missing';
|
|
1293
|
+
const issues = effective.issues.filter((issue) => issue.key === key);
|
|
1294
|
+
const hasStored = Object.hasOwn(stored, key);
|
|
1295
|
+
const storedSourceLayer = options.platform ? 'platform' : 'common';
|
|
1296
|
+
let fallback;
|
|
1297
|
+
if (hasStored) {
|
|
1298
|
+
const inherited = { ...stored };
|
|
1299
|
+
delete inherited[key];
|
|
1300
|
+
const withoutOverride = await resolveEffectivePluginConfigFromStores({
|
|
1301
|
+
manifest: options.plugin.manifest,
|
|
1302
|
+
platform: options.platform,
|
|
1303
|
+
projectRoot: effective.projectRoot,
|
|
1304
|
+
stores: { user: replacePluginConfigStoreLayer(effective.stores.user, inherited, options.platform) },
|
|
1305
|
+
referenceContext: effective.referenceContext,
|
|
1306
|
+
});
|
|
1307
|
+
const fallbackIssues = withoutOverride.issues.filter((issue) => issue.key === key);
|
|
1308
|
+
const fallbackSource = withoutOverride.sources[key];
|
|
1309
|
+
fallback = fallbackSource === 'missing' || fallbackSource === undefined
|
|
1310
|
+
? { state: 'missing' }
|
|
1311
|
+
: fallbackIssues.length
|
|
1312
|
+
? { state: 'invalid', sourceLayer: fallbackSource, issues: fallbackIssues }
|
|
1313
|
+
: { state: 'valid', sourceLayer: fallbackSource, effectiveValue: withoutOverride.redactedValues[key] };
|
|
1244
1314
|
}
|
|
1245
|
-
const issue = fieldIssues.find((entry) => entry.source === source);
|
|
1246
1315
|
return {
|
|
1247
|
-
valueState: issue ? 'invalid' : source === 'default' ? 'default' : 'configured',
|
|
1248
|
-
effectiveValue: issue ? null : effective.redactedValues[key] ?? null,
|
|
1249
|
-
sourceLayer,
|
|
1250
|
-
...(fieldState?.invalidOverride ? {
|
|
1251
|
-
invalidOverride: {
|
|
1252
|
-
sourceLayer: fieldState.invalidOverride.source,
|
|
1253
|
-
issues: fieldState.invalidOverride.issues,
|
|
1254
|
-
},
|
|
1255
|
-
} : {}),
|
|
1256
|
-
...(fieldState?.fallback ? {
|
|
1257
|
-
fallback: {
|
|
1258
|
-
effectiveValue: fieldState.fallback.redactedValue,
|
|
1259
|
-
sourceLayer: fieldState.fallback.source,
|
|
1260
|
-
},
|
|
1261
|
-
} : {}),
|
|
1262
|
-
...configFieldProjection({
|
|
1263
|
-
field,
|
|
1264
|
-
value: issue ? undefined : effective.values[key],
|
|
1265
|
-
source,
|
|
1266
|
-
issues: fieldIssues,
|
|
1267
|
-
}),
|
|
1268
|
-
};
|
|
1269
|
-
};
|
|
1270
|
-
const fields = [];
|
|
1271
|
-
for (const [key, field] of Object.entries(schema)) {
|
|
1272
|
-
const base = {
|
|
1273
1316
|
key,
|
|
1274
1317
|
title: field.title ?? key,
|
|
1275
1318
|
kind: 'manifest',
|
|
1276
1319
|
reserved: false,
|
|
1277
|
-
writable:
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1320
|
+
writable: true,
|
|
1321
|
+
canSet: true,
|
|
1322
|
+
canUnset: hasStored,
|
|
1323
|
+
valueState: issues.length ? 'invalid' : source === 'default' || source === 'missing' ? 'default' : 'configured',
|
|
1324
|
+
effectiveValue: effective.redactedValues[key] ?? null,
|
|
1325
|
+
sourceLayer: toConfigSourceLayer(source),
|
|
1326
|
+
...(hasStored ? { storedSourceLayer, ...(validateCorePluginConfigValue(field, stored[key], key).length
|
|
1327
|
+
? {} : { storedValue: redactValue(field, stored[key]) }) } : {}),
|
|
1328
|
+
...(state?.invalidOverride ? { invalidOverride: { sourceLayer: state.invalidOverride.source, issues: state.invalidOverride.issues } } : {}),
|
|
1329
|
+
...(fallback ? { fallback } : {}),
|
|
1330
|
+
...configFieldProjection({ field, value: effective.values[key], source, issues }),
|
|
1282
1331
|
};
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
value: userPlainEntries[key],
|
|
1290
|
-
});
|
|
1291
|
-
fields.push({
|
|
1292
|
-
...base,
|
|
1293
|
-
valueState: 'configured',
|
|
1294
|
-
effectiveValue: redactValue(field, value),
|
|
1295
|
-
sourceLayer: 'user',
|
|
1296
|
-
storedValue: redactValue(field, value),
|
|
1297
|
-
storedSourceLayer: 'user',
|
|
1298
|
-
...configFieldProjection({ field, value, source: 'user' }),
|
|
1299
|
-
});
|
|
1300
|
-
}
|
|
1301
|
-
catch {
|
|
1302
|
-
fields.push({
|
|
1303
|
-
...base,
|
|
1304
|
-
valueState: 'invalid',
|
|
1305
|
-
sourceLayer: 'user',
|
|
1306
|
-
storedSourceLayer: 'user',
|
|
1307
|
-
valid: false,
|
|
1308
|
-
issues: [{ type: 'invalid-config', key, source: 'user' }],
|
|
1309
|
-
});
|
|
1310
|
-
}
|
|
1311
|
-
continue;
|
|
1312
|
-
}
|
|
1313
|
-
if (field.default !== undefined) {
|
|
1314
|
-
try {
|
|
1315
|
-
const value = await coercePluginConfigValue({
|
|
1316
|
-
key,
|
|
1317
|
-
field,
|
|
1318
|
-
value: field.default,
|
|
1319
|
-
});
|
|
1320
|
-
fields.push({
|
|
1321
|
-
...base,
|
|
1322
|
-
effectiveValue: redactValue(field, value),
|
|
1323
|
-
sourceLayer: 'default',
|
|
1324
|
-
...configFieldProjection({ field, value, source: 'default' }),
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
catch {
|
|
1328
|
-
fields.push({
|
|
1329
|
-
...base,
|
|
1330
|
-
valueState: 'invalid',
|
|
1331
|
-
sourceLayer: 'default',
|
|
1332
|
-
source: 'default',
|
|
1333
|
-
valid: false,
|
|
1334
|
-
issues: [{ type: 'invalid-config', key, source: 'default' }],
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
continue;
|
|
1338
|
-
}
|
|
1339
|
-
fields.push(base);
|
|
1340
|
-
continue;
|
|
1341
|
-
}
|
|
1342
|
-
let storedProjectValue;
|
|
1343
|
-
if (options.scope === 'project' && Object.hasOwn(projectPlainEntries, key)) {
|
|
1344
|
-
try {
|
|
1345
|
-
const value = await coercePluginConfigValue({
|
|
1346
|
-
key,
|
|
1347
|
-
field,
|
|
1348
|
-
value: projectPlainEntries[key],
|
|
1349
|
-
});
|
|
1350
|
-
storedProjectValue = {
|
|
1351
|
-
storedValue: redactValue(field, value),
|
|
1352
|
-
storedSourceLayer: 'project',
|
|
1353
|
-
};
|
|
1354
|
-
}
|
|
1355
|
-
catch {
|
|
1356
|
-
storedProjectValue = { storedSourceLayer: 'project' };
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
fields.push({ ...base, ...effectiveFieldState(key), ...storedProjectValue });
|
|
1332
|
+
}));
|
|
1333
|
+
for (const key of Object.keys(stored).filter((key) => !Object.hasOwn(effective.schema, key)).sort()) {
|
|
1334
|
+
const source = options.platform ? 'platform' : 'common';
|
|
1335
|
+
fields.push({ key, title: key, kind: 'manifest', reserved: false, writable: false, canSet: false, canUnset: true,
|
|
1336
|
+
valueState: 'configured', effectiveValue: '[redacted]', sourceLayer: source, storedSourceLayer: source,
|
|
1337
|
+
value: '[redacted]', source, matchedPreset: null, valid: false, issues: [] });
|
|
1360
1338
|
}
|
|
1361
1339
|
return fields;
|
|
1362
1340
|
}
|
|
1363
1341
|
async function buildLegacyStoreFieldEntries(options) {
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
]
|
|
1369
|
-
: [{
|
|
1370
|
-
scope: options.scope,
|
|
1371
|
-
sourceLayer: options.scope === 'user' ? 'user' : 'project',
|
|
1372
|
-
}];
|
|
1373
|
-
const fields = new Map();
|
|
1374
|
-
for (const location of locations) {
|
|
1375
|
-
const store = await readPluginConfigStore({
|
|
1376
|
-
sourceId: options.sourceId,
|
|
1377
|
-
sourceIdentity: options.sourceIdentity,
|
|
1378
|
-
pluginName: options.pluginName,
|
|
1379
|
-
scope: location.scope,
|
|
1380
|
-
cwd: options.cwd,
|
|
1381
|
-
env: options.env,
|
|
1382
|
-
});
|
|
1383
|
-
for (const key of Object.keys(store.values)) {
|
|
1384
|
-
fields.set(key, {
|
|
1385
|
-
key,
|
|
1386
|
-
title: key,
|
|
1387
|
-
kind: 'manifest',
|
|
1388
|
-
reserved: false,
|
|
1389
|
-
writable: false,
|
|
1390
|
-
valueState: 'configured',
|
|
1391
|
-
effectiveValue: '[redacted]',
|
|
1392
|
-
sourceLayer: location.sourceLayer,
|
|
1393
|
-
value: '[redacted]',
|
|
1394
|
-
source: location.sourceLayer,
|
|
1395
|
-
matchedPreset: null,
|
|
1396
|
-
valid: true,
|
|
1397
|
-
issues: [],
|
|
1398
|
-
});
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
return [...fields.values()].sort((left, right) => left.key.localeCompare(right.key));
|
|
1342
|
+
const store = await readPluginConfigStore({ ...options, scope: 'user' });
|
|
1343
|
+
const source = options.platform ? 'platform' : 'common';
|
|
1344
|
+
return Object.keys(store.values).sort().map((key) => ({ key, title: key, kind: 'manifest', reserved: false,
|
|
1345
|
+
writable: false, canSet: false, canUnset: true, valueState: 'configured', effectiveValue: '[redacted]',
|
|
1346
|
+
sourceLayer: source, value: '[redacted]', source, matchedPreset: null, valid: true, issues: [] }));
|
|
1402
1347
|
}
|
|
1403
1348
|
export async function resolvePluginConfigSchemaAccess(options) {
|
|
1404
1349
|
const pluginName = assertSafePluginConfigSegment(options.pluginName);
|
|
@@ -1414,38 +1359,50 @@ export async function resolvePluginConfigSchemaAccess(options) {
|
|
|
1414
1359
|
return {
|
|
1415
1360
|
pluginName,
|
|
1416
1361
|
plugin: options.currentPlugin,
|
|
1417
|
-
schema: createConfigSchemaEvidenceFromCurrentCatalog(options.currentPlugin, await calculateConfigSchemaManifestDigestForPlugin(options.currentPlugin)),
|
|
1362
|
+
schema: createConfigSchemaEvidenceFromCurrentCatalog(options.currentPlugin, await calculateConfigSchemaManifestDigestForPlugin(options.currentPlugin), options.platform),
|
|
1418
1363
|
};
|
|
1419
1364
|
}
|
|
1420
1365
|
export async function resolveConfigRead(options) {
|
|
1366
|
+
if (options.context)
|
|
1367
|
+
await resolveWorkContext({ cwd: options.cwd, context: options.context });
|
|
1421
1368
|
const pluginName = assertSafePluginConfigSegment(options.pluginName);
|
|
1422
1369
|
const schemaAccess = await resolvePluginConfigSchemaAccess({
|
|
1423
1370
|
pluginName,
|
|
1424
1371
|
currentPlugin: options.plugin,
|
|
1425
1372
|
currentPluginError: options.pluginError,
|
|
1373
|
+
platform: options.platform,
|
|
1426
1374
|
scope: options.scope,
|
|
1427
1375
|
cwd: options.cwd,
|
|
1428
1376
|
env: options.env,
|
|
1429
1377
|
});
|
|
1430
|
-
const manifestFields = schemaAccess.plugin
|
|
1378
|
+
const manifestFields = options.schemaOnly ? [] : schemaAccess.plugin?.manifest.config
|
|
1431
1379
|
? await buildManifestFieldEntries({
|
|
1432
1380
|
plugin: schemaAccess.plugin,
|
|
1381
|
+
context: options.context,
|
|
1382
|
+
platform: options.platform,
|
|
1433
1383
|
scope: options.scope,
|
|
1434
1384
|
cwd: options.cwd,
|
|
1435
1385
|
env: options.env,
|
|
1436
1386
|
})
|
|
1437
1387
|
: await buildLegacyStoreFieldEntries({
|
|
1438
|
-
sourceId: options.sourceId,
|
|
1439
|
-
sourceIdentity: options.sourceIdentity,
|
|
1388
|
+
sourceId: schemaAccess.plugin?.sourceId ?? options.sourceId,
|
|
1389
|
+
sourceIdentity: schemaAccess.plugin?.sourceIdentity ?? options.sourceIdentity,
|
|
1390
|
+
logicalIdentity: schemaAccess.plugin?.catalogLogicalIdentity ?? options.logicalIdentity,
|
|
1440
1391
|
pluginName,
|
|
1441
1392
|
scope: options.scope,
|
|
1393
|
+
platform: options.platform,
|
|
1442
1394
|
cwd: options.cwd,
|
|
1443
1395
|
env: options.env,
|
|
1444
1396
|
});
|
|
1445
1397
|
return {
|
|
1446
1398
|
pluginName,
|
|
1399
|
+
platform: options.platform,
|
|
1400
|
+
context: options.context ?? 'user',
|
|
1447
1401
|
scope: options.scope,
|
|
1448
1402
|
...(schemaAccess.schema ? { schema: schemaAccess.schema } : {}),
|
|
1403
|
+
...(schemaAccess.plugin?.manifest.config?.fields
|
|
1404
|
+
? { fieldDefinitions: selectPluginConfigProfile(schemaAccess.plugin.manifest.config, options.platform).fields }
|
|
1405
|
+
: {}),
|
|
1449
1406
|
fields: manifestFields,
|
|
1450
1407
|
};
|
|
1451
1408
|
}
|
|
@@ -1472,13 +1429,14 @@ export function summarizeEffectivePluginConfig(config) {
|
|
|
1472
1429
|
ignoredUnknownKeys: config.ignoredUnknownKeys,
|
|
1473
1430
|
};
|
|
1474
1431
|
}
|
|
1475
|
-
export function createPluginConfigSchemaIdentity(manifest) {
|
|
1432
|
+
export function createPluginConfigSchemaIdentity(manifest, platform) {
|
|
1476
1433
|
const hash = crypto
|
|
1477
1434
|
.createHash('sha256')
|
|
1478
1435
|
.update(JSON.stringify({
|
|
1479
1436
|
name: manifest.name,
|
|
1480
1437
|
version: manifest.version,
|
|
1481
|
-
|
|
1438
|
+
platform: platform ?? null,
|
|
1439
|
+
config: manifest.config ? selectPluginConfigProfile(manifest.config, platform) : null,
|
|
1482
1440
|
}))
|
|
1483
1441
|
.digest('hex');
|
|
1484
1442
|
return `${manifest.name}:${hash}`;
|
|
@@ -1502,7 +1460,7 @@ function cliConfigPromptEnumValues(field) {
|
|
|
1502
1460
|
export function toCliConfigPromptSchema(schema) {
|
|
1503
1461
|
const promptSchema = {};
|
|
1504
1462
|
for (const [key, field] of Object.entries(schema)) {
|
|
1505
|
-
if (field.type === 'object')
|
|
1463
|
+
if (field.type === 'object' || field.type === 'array')
|
|
1506
1464
|
continue;
|
|
1507
1465
|
promptSchema[key] = {
|
|
1508
1466
|
type: field.type,
|
|
@@ -1519,15 +1477,15 @@ export function toCliConfigPromptSchema(schema) {
|
|
|
1519
1477
|
return promptSchema;
|
|
1520
1478
|
}
|
|
1521
1479
|
export function createPluginConfigFormModel(options) {
|
|
1522
|
-
const schema = options.
|
|
1480
|
+
const schema = options.effective.schema;
|
|
1523
1481
|
if (!schema) {
|
|
1524
|
-
throw new
|
|
1482
|
+
throw new PluginConfigSchemaResolutionError('configSchemaUnavailable', `Plugin "${options.pluginName ?? options.manifest.name}" does not declare an AW config schema.`);
|
|
1525
1483
|
}
|
|
1526
1484
|
const requiredKeys = [...new Set(options.effective.issues
|
|
1527
1485
|
.filter((issue) => issue.type === 'missing-required' || issue.type === 'invalid-config')
|
|
1528
1486
|
.map((issue) => issue.key))];
|
|
1529
1487
|
const fields = Object.entries(schema).flatMap(([key, field]) => {
|
|
1530
|
-
if (field.type === 'object')
|
|
1488
|
+
if (field.type === 'object' || field.type === 'array')
|
|
1531
1489
|
return [];
|
|
1532
1490
|
return [{
|
|
1533
1491
|
key,
|
|
@@ -1548,8 +1506,8 @@ export function createPluginConfigFormModel(options) {
|
|
|
1548
1506
|
});
|
|
1549
1507
|
return {
|
|
1550
1508
|
pluginName: options.pluginName ?? options.manifest.name,
|
|
1551
|
-
allowedScopes:
|
|
1552
|
-
initialScope:
|
|
1509
|
+
allowedScopes: ['user'],
|
|
1510
|
+
initialScope: 'user',
|
|
1553
1511
|
requiredKeys,
|
|
1554
1512
|
fields,
|
|
1555
1513
|
};
|
|
@@ -1588,13 +1546,17 @@ export function toCliConfigPromptOptions(model) {
|
|
|
1588
1546
|
requiredKeys: [...model.requiredKeys],
|
|
1589
1547
|
};
|
|
1590
1548
|
}
|
|
1591
|
-
function
|
|
1549
|
+
export function formatPluginConfigSetRecoveryCommand(pluginName, key, field, context, platform) {
|
|
1550
|
+
const command = `aw plugin config set ${pluginName} ${key} --context ${context}`
|
|
1551
|
+
+ (platform ? ` --platform ${platform}` : '');
|
|
1552
|
+
return field.sensitive === true ? `${command} --value-stdin` : `${command} --value-json '<json>'`;
|
|
1553
|
+
}
|
|
1554
|
+
function formatRequiredConfigSetCommands(pluginName, issues, context, schema, platform) {
|
|
1592
1555
|
const commands = new Set();
|
|
1593
1556
|
for (const issue of issues) {
|
|
1594
|
-
const
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
commands.add(`aw config set ${pluginName} ${issue.key} --scope ${scope} --value-json '<json>'`);
|
|
1557
|
+
const field = schema[issue.key];
|
|
1558
|
+
if (field)
|
|
1559
|
+
commands.add(formatPluginConfigSetRecoveryCommand(pluginName, issue.key, field, context, platform));
|
|
1598
1560
|
}
|
|
1599
1561
|
return [...commands].map((command) => `\`${command}\``).join(' 或 ');
|
|
1600
1562
|
}
|
|
@@ -1607,8 +1569,8 @@ export async function preflightRequiredPluginConfigs(options) {
|
|
|
1607
1569
|
};
|
|
1608
1570
|
for (const target of options.targets) {
|
|
1609
1571
|
const pluginName = target.pluginName ?? target.manifest.name;
|
|
1610
|
-
const identity = target.schemaSourceIdentity ?? createPluginConfigSchemaIdentity(target.manifest);
|
|
1611
|
-
const dedupeKey = `${pluginName}\0${identity}`;
|
|
1572
|
+
const identity = target.schemaSourceIdentity ?? createPluginConfigSchemaIdentity(target.manifest, target.platform);
|
|
1573
|
+
const dedupeKey = `${pluginName}\0${target.platform ?? 'common'}\0${identity}`;
|
|
1612
1574
|
if (visited.has(dedupeKey)) {
|
|
1613
1575
|
continue;
|
|
1614
1576
|
}
|
|
@@ -1617,11 +1579,13 @@ export async function preflightRequiredPluginConfigs(options) {
|
|
|
1617
1579
|
if (!target.manifest.config?.fields) {
|
|
1618
1580
|
continue;
|
|
1619
1581
|
}
|
|
1620
|
-
|
|
1582
|
+
const effective = await resolveEffectivePluginConfig({
|
|
1621
1583
|
sourceId: target.sourceId,
|
|
1622
1584
|
sourceIdentity: target.sourceIdentity,
|
|
1585
|
+
logicalIdentity: target.logicalIdentity,
|
|
1623
1586
|
pluginName,
|
|
1624
1587
|
manifest: target.manifest,
|
|
1588
|
+
platform: target.platform,
|
|
1625
1589
|
cwd: options.cwd,
|
|
1626
1590
|
env: options.context.env,
|
|
1627
1591
|
});
|
|
@@ -1630,7 +1594,7 @@ export async function preflightRequiredPluginConfigs(options) {
|
|
|
1630
1594
|
continue;
|
|
1631
1595
|
}
|
|
1632
1596
|
const details = blockingIssues.map((issue) => issue.key).join(', ');
|
|
1633
|
-
const setCommands = formatRequiredConfigSetCommands(pluginName, blockingIssues, options.defaultScope);
|
|
1597
|
+
const setCommands = formatRequiredConfigSetCommands(target.sourceId ? `${target.sourceId}/${pluginName}` : pluginName, blockingIssues, options.defaultScope, effective.schema, target.platform);
|
|
1634
1598
|
throw new Error(`${pluginName} requires valid AW config before install/upgrade: ${details}. ` +
|
|
1635
1599
|
`Run ${setCommands}, or open \`aw\` to complete setup.`);
|
|
1636
1600
|
}
|