@lesliechan721/aw 0.1.0-beta.10 → 0.1.0-beta.101
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 +26 -5
- package/dist/src/commands/catalog-source.js +154 -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 +35 -7
- package/dist/src/commands/catalog-store.js +469 -79
- 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 +35 -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 +408 -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 +107 -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 +28 -0
- package/dist/src/commands/public-lifecycle.js +633 -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 +235 -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 +3374 -1558
- 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 +7 -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 +210 -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 +3 -34
- package/dist/src/index.js +1711 -1935
- 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/cli-progress.d.ts +30 -0
- package/dist/src/output/cli-progress.js +424 -0
- package/dist/src/output/cli-progress.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/model.d.ts +123 -1
- package/dist/src/output/model.js +45 -1
- package/dist/src/output/model.js.map +1 -1
- package/dist/src/output/public-command-ids.d.ts +8 -0
- package/dist/src/output/public-command-ids.js +38 -0
- package/dist/src/output/public-command-ids.js.map +1 -0
- package/dist/src/output/public-result.d.ts +71 -0
- package/dist/src/output/public-result.js +40 -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 +670 -0
- package/dist/src/output/receipt-projection.js.map +1 -0
- package/dist/src/output/render/document.d.ts +55 -0
- package/dist/src/output/render/document.js +176 -0
- package/dist/src/output/render/document.js.map +1 -0
- package/dist/src/output/render/shared.d.ts +18 -0
- package/dist/src/output/render/shared.js +245 -0
- package/dist/src/output/render/shared.js.map +1 -0
- package/dist/src/output/render/style.d.ts +45 -0
- package/dist/src/output/render/style.js +155 -0
- package/dist/src/output/render/style.js.map +1 -0
- package/dist/src/output/render/views/commands-self.d.ts +6 -0
- package/dist/src/output/render/views/commands-self.js +210 -0
- package/dist/src/output/render/views/commands-self.js.map +1 -0
- package/dist/src/output/render/views/config.d.ts +2 -0
- package/dist/src/output/render/views/config.js +203 -0
- package/dist/src/output/render/views/config.js.map +1 -0
- package/dist/src/output/render/views/dev.d.ts +2 -0
- package/dist/src/output/render/views/dev.js +278 -0
- package/dist/src/output/render/views/dev.js.map +1 -0
- package/dist/src/output/render/views/fallback.d.ts +2 -0
- package/dist/src/output/render/views/fallback.js +6 -0
- package/dist/src/output/render/views/fallback.js.map +1 -0
- package/dist/src/output/render/views/index.d.ts +3 -0
- package/dist/src/output/render/views/index.js +79 -0
- package/dist/src/output/render/views/index.js.map +1 -0
- package/dist/src/output/render/views/lifecycle.d.ts +5 -0
- package/dist/src/output/render/views/lifecycle.js +170 -0
- package/dist/src/output/render/views/lifecycle.js.map +1 -0
- package/dist/src/output/render/views/sources-cache.d.ts +3 -0
- package/dist/src/output/render/views/sources-cache.js +322 -0
- package/dist/src/output/render/views/sources-cache.js.map +1 -0
- package/dist/src/output/render/views/targets.d.ts +2 -0
- package/dist/src/output/render/views/targets.js +82 -0
- package/dist/src/output/render/views/targets.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 +796 -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 +1629 -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 +1728 -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 +312 -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 +504 -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.d.ts +1 -0
- package/dist/src/utils/aw-home-mutation-lock.js +28 -6
- 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 +25 -2
- package/dist/src/utils/catalog-generation-service.js +99 -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 +5 -0
- package/dist/src/utils/catalog-generation-store.js +69 -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 +11 -0
- package/dist/src/utils/native-cli-interruption.js +106 -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.d.ts +1 -0
- package/dist/src/utils/process-lock.js +22 -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,12 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { catalogGenerationErrorCode } from './catalog-generation-error.js';
|
|
2
|
+
import { CatalogPluginNotFoundError } from './multi-source-catalog.js';
|
|
3
|
+
import { resolveWorkContext } from '../intent/work-context.js';
|
|
4
|
+
import { observePreferences } from '../intent/deployment-preferences.js';
|
|
5
|
+
import { assertConfigLayerWritable, ConfigLayerError, resolveActiveConfigPlatforms } from './config-platforms.js';
|
|
6
|
+
import { RecoveryInterruptedError, recoveryInterruptionCode } from '../recovery/interruption.js';
|
|
7
|
+
import { readDemand, demandNativeProjection } from '../recovery/demand.js';
|
|
8
|
+
import { createScopeContext } from '../intent/scope-context.js';
|
|
9
|
+
import { nativeDeploymentHasVerifiedComponentWrite } from '../commands/rebuild-platform-integration.js';
|
|
10
|
+
import { projectDeploymentNotices, projectRelatedProjectPermissionFailures } from '../commands/public-lifecycle-result.js';
|
|
11
|
+
import { recoveryHostPermissionEffects } from '../commands/deployment-confirmation.js';
|
|
12
|
+
import { projectComponentDelivery } from '../output/component-delivery.js';
|
|
13
|
+
import { canonicalizeIdentityValue, selectPluginConfigProfile } from '@lesliechan721/aw-plugin-core/manifest';
|
|
3
14
|
import { syncWriteCommand } from '../commands/write-commands.js';
|
|
15
|
+
import { skillInvocationDiagnostics } from '../output/skill-invocation-notices.js';
|
|
4
16
|
import { CONFIG_MUTATION_RECEIPT_SCHEMA_VERSION, } from '../types.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
17
|
+
import { assertPluginConfigMutationCandidate, assertSafePluginConfigSegment, coercePluginConfigUpdates, patchPluginConfigStore, PluginConfigSchemaResolutionError, readPluginConfigStore, readNamespacedPluginConfigStoreIdentity, resetPluginConfigStore, resolveConfigRead, resolveEffectivePluginConfig, resolvePluginConfigStorePath, resolvePluginConfigSchemaAccess, summarizeEffectivePluginConfig, } from './plugin-config.js';
|
|
18
|
+
import { analyzePluginConfigMutationImpact, discoverPluginConfigManagedCommandPackages, pluginSharedNativeConfigRenderUnits } from './plugin-config-impact.js';
|
|
19
|
+
import { collectPluginConfigReferenceEvidence, resolvePluginConfigReferencePlugins, resolvePluginConfigReferenceConsumers, formatPluginConfigReferenceBlocker, PluginConfigReferenceBlockedError } from './plugin-config-references.js';
|
|
20
|
+
import { resolvePluginMetaDependencyClosure } from './plugin-dependencies.js';
|
|
21
|
+
import { publishPreparedManagedCommandPackage } from './managed-command-materialization.js';
|
|
22
|
+
import { ManagedCommandError, managedCommandDiagnostic } from './managed-command-store.js';
|
|
23
|
+
import { configPackageResult, inspectConfigCommandPackageReview, prepareConfigCommandPackages } from './plugin-config-command-apply.js';
|
|
7
24
|
import { collectSensitivePluginConfigValues, redactPluginScriptOutput, } from './plugin-scripts.js';
|
|
8
|
-
import {
|
|
25
|
+
import { resolveCliPackageRoot } from './paths.js';
|
|
26
|
+
import { readSafeOperationError } from './safe-operation-diagnostic.js';
|
|
9
27
|
import { withAwHomeMutationLock, } from './aw-home-mutation-lock.js';
|
|
28
|
+
import fs from 'fs-extra';
|
|
29
|
+
import path from 'node:path';
|
|
10
30
|
export function buildConfigMutationReceipt(command, receipt) {
|
|
11
31
|
return {
|
|
12
32
|
...receipt,
|
|
@@ -14,6 +34,55 @@ export function buildConfigMutationReceipt(command, receipt) {
|
|
|
14
34
|
command,
|
|
15
35
|
};
|
|
16
36
|
}
|
|
37
|
+
export function configWriteStateForError(error) {
|
|
38
|
+
return error?.configWrite === 'failed'
|
|
39
|
+
? 'failed'
|
|
40
|
+
: 'notStarted';
|
|
41
|
+
}
|
|
42
|
+
function markConfigWriteFailed(error) {
|
|
43
|
+
const failure = error instanceof Error ? error : new Error(String(error));
|
|
44
|
+
return Object.assign(failure, { configWrite: 'failed' });
|
|
45
|
+
}
|
|
46
|
+
function skippedApply(reason) {
|
|
47
|
+
return { state: 'skipped', reason, targetResults: [] };
|
|
48
|
+
}
|
|
49
|
+
async function observeConfigLayerError(options) {
|
|
50
|
+
const { plugin } = options;
|
|
51
|
+
try {
|
|
52
|
+
assertConfigLayerWritable(plugin.pluginId ?? (plugin.sourceId ? `${plugin.sourceId}/${plugin.manifest.name}` : plugin.manifest.name), plugin.manifest, await observePreferences(options), options.platform);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (!(error instanceof ConfigLayerError))
|
|
56
|
+
throw error;
|
|
57
|
+
return error;
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
export function configApplyLayerFailure(error) {
|
|
62
|
+
return { state: 'unavailable', reason: 'targetDiscoveryFailed', targetResults: [],
|
|
63
|
+
error: { stage: 'targetValidation', code: error.code, message: error.message } };
|
|
64
|
+
}
|
|
65
|
+
export function configActiveAvailabilityError(error) {
|
|
66
|
+
if (error instanceof CatalogPluginNotFoundError)
|
|
67
|
+
return { code: 'pluginUnavailable',
|
|
68
|
+
message: 'The plugin is absent from the active catalog. Run aw source sync and check the selector.' };
|
|
69
|
+
if (['catalogGenerationUnavailable', 'catalogGenerationSourceMissing', 'catalogGenerationIdentityMismatch',
|
|
70
|
+
'catalogGenerationStateInvalid', 'catalogGenerationMetadataInvalid'].includes(catalogGenerationErrorCode(error))) {
|
|
71
|
+
return { code: 'sourceActiveUnavailable',
|
|
72
|
+
message: 'The active catalog is unavailable. Run aw source sync, then retry configuration apply.' };
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
function unavailableApply(reason, stage) {
|
|
77
|
+
const messages = {
|
|
78
|
+
invalidConfig: 'The effective config is invalid for every visible target.',
|
|
79
|
+
schemaUnavailable: 'The config schema is unavailable after the config commit.',
|
|
80
|
+
sourceUnavailable: 'The plugin source is unavailable after the config commit.',
|
|
81
|
+
effectiveConfigUnavailable: 'The effective config cannot be read after the config commit.',
|
|
82
|
+
targetDiscoveryFailed: 'Visible config apply targets cannot be discovered after the config commit.',
|
|
83
|
+
};
|
|
84
|
+
return { state: 'unavailable', reason, targetResults: [], error: { stage, code: reason, message: messages[reason] } };
|
|
85
|
+
}
|
|
17
86
|
function uniqueInOrder(values) {
|
|
18
87
|
return [...new Set(values)];
|
|
19
88
|
}
|
|
@@ -21,7 +90,7 @@ function collectRemovedConfigKeys(values) {
|
|
|
21
90
|
return uniqueInOrder(Object.keys(values));
|
|
22
91
|
}
|
|
23
92
|
function targetKey(target) {
|
|
24
|
-
return `${target.platform}:${target.scope}:${target.projectKey ?? '-'}`;
|
|
93
|
+
return `${target.pluginName}:${target.platform}:${target.scope}:${target.projectKey ?? '-'}`;
|
|
25
94
|
}
|
|
26
95
|
function dedupeTargets(targets) {
|
|
27
96
|
const deduped = new Map();
|
|
@@ -29,218 +98,158 @@ function dedupeTargets(targets) {
|
|
|
29
98
|
deduped.set(targetKey(target), target);
|
|
30
99
|
return [...deduped.values()];
|
|
31
100
|
}
|
|
32
|
-
async function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
pluginName: options.pluginName,
|
|
40
|
-
platform: options.platform,
|
|
41
|
-
scope: options.scope,
|
|
42
|
-
...(options.scope === 'project'
|
|
43
|
-
? { projectKey: await resolveProjectKey(options.platform, options.cwd) }
|
|
44
|
-
: {}),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
async function discoverVisibleTargets(options) {
|
|
48
|
-
const targets = [];
|
|
49
|
-
const failures = [];
|
|
50
|
-
const selector = options.plugin.pluginId ?? options.pluginName;
|
|
51
|
-
const status = await statusCommandV7({
|
|
52
|
-
plugins: [selector],
|
|
53
|
-
cwd: options.cwd,
|
|
54
|
-
env: options.env,
|
|
55
|
-
nativeCliRunner: options.nativeCliRunner,
|
|
56
|
-
...(options.scope === 'project' ? { scope: 'project' } : {}),
|
|
57
|
-
...(options.rebuildRuntime?.catalogOperationContext
|
|
58
|
-
? { catalogOperationContext: options.rebuildRuntime.catalogOperationContext }
|
|
59
|
-
: {}),
|
|
60
|
-
});
|
|
61
|
-
for (const statusTarget of status.payload.targets) {
|
|
62
|
-
const intent = statusTargetIntent(statusTarget);
|
|
63
|
-
if ((statusTarget.pluginId !== selector && statusTarget.pluginName !== options.pluginName)
|
|
64
|
-
|| !intent.enabled)
|
|
65
|
-
continue;
|
|
66
|
-
for (const scope of intent.scopes) {
|
|
67
|
-
if (options.scope === 'project' && scope !== 'project')
|
|
101
|
+
async function configApplyHasValidSharedNativeTarget(options) {
|
|
102
|
+
const plugins = await resolvePluginConfigReferenceConsumers({ plugin: options.plugin, env: options.env, plugins: options.plugins });
|
|
103
|
+
for (const plugin of plugins) {
|
|
104
|
+
for (const target of options.targets.filter((target) => target.pluginName === plugin.manifest.name)) {
|
|
105
|
+
const shared = pluginSharedNativeConfigRenderUnits(plugin);
|
|
106
|
+
if (!shared.some((entry) => entry.platform === target.platform))
|
|
68
107
|
continue;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
platform:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
108
|
+
const effective = await resolveEffectivePluginConfig({ sourceId: plugin.sourceId,
|
|
109
|
+
sourceIdentity: plugin.sourceIdentity, logicalIdentity: plugin.catalogLogicalIdentity,
|
|
110
|
+
manifest: plugin.manifest, platform: target.platform, targetScope: 'user',
|
|
111
|
+
cwd: options.cwd, env: options.env, referencePlugins: options.plugins });
|
|
112
|
+
if (!effective.issues.length)
|
|
113
|
+
return true;
|
|
75
114
|
}
|
|
76
115
|
}
|
|
77
|
-
return
|
|
116
|
+
return false;
|
|
78
117
|
}
|
|
79
|
-
async function
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
plugin: options.plugin,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
118
|
+
export async function resolveConfigPreApplyAuthorization(options) {
|
|
119
|
+
const applyTargets = dedupeTargets(options.applyTargets).filter((target) => !options.rebuildRuntime?.configApplyPackages?.targets.some((entry) => entry.blocker
|
|
120
|
+
&& entry.pluginId === (target.pluginId ?? options.plugin.pluginId) && entry.platforms.includes(target.platform)));
|
|
121
|
+
if (applyTargets.some((target) => target.pluginName !== options.plugin.manifest.name)) {
|
|
122
|
+
const plugins = await resolvePluginConfigReferencePlugins({ sourceId: options.plugin.sourceId,
|
|
123
|
+
sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
124
|
+
env: options.env, plugins: options.rebuildRuntime?.referencePlugins });
|
|
125
|
+
const results = await Promise.all(plugins.map((plugin) => resolveConfigPreApplyAuthorization({ ...options, plugin,
|
|
126
|
+
applyTargets: applyTargets.filter((target) => target.pluginName === plugin.manifest.name) })));
|
|
127
|
+
return { targets: results.flatMap((result) => result.targets),
|
|
128
|
+
availableApplyTargets: results.flatMap((result) => result.availableApplyTargets),
|
|
129
|
+
unavailableTargetResults: results.flatMap((result) => result.unavailableTargetResults) };
|
|
130
|
+
}
|
|
131
|
+
if (applyTargets.length === 0 || !pluginMayRunPreApply(options.plugin)) {
|
|
132
|
+
return { targets: [], availableApplyTargets: applyTargets, unavailableTargetResults: [] };
|
|
133
|
+
}
|
|
95
134
|
if (options.plugin.sourceId && !options.plugin.pluginId) {
|
|
96
|
-
|
|
135
|
+
return {
|
|
136
|
+
targets: [],
|
|
137
|
+
availableApplyTargets: [],
|
|
138
|
+
unavailableTargetResults: applyTargets.map((target) => ({
|
|
139
|
+
target,
|
|
140
|
+
action: 'reinstall',
|
|
141
|
+
state: 'failed',
|
|
142
|
+
errorCode: 'sourceUnavailable',
|
|
143
|
+
message: 'The preApply authorization scope cannot be resolved for this target.',
|
|
144
|
+
})),
|
|
145
|
+
};
|
|
97
146
|
}
|
|
98
147
|
const selector = options.plugin.sourceId
|
|
99
148
|
? options.plugin.pluginId
|
|
100
149
|
: options.plugin.manifest.name;
|
|
101
|
-
const
|
|
102
|
-
|
|
150
|
+
const groups = new Map();
|
|
151
|
+
for (const target of applyTargets) {
|
|
152
|
+
const key = `${target.scope}\0${target.platform}`;
|
|
153
|
+
const targets = groups.get(key) ?? [];
|
|
154
|
+
targets.push(target);
|
|
155
|
+
groups.set(key, targets);
|
|
156
|
+
}
|
|
157
|
+
const authorization = [];
|
|
158
|
+
const availableApplyTargets = [];
|
|
159
|
+
const unavailableTargetResults = [];
|
|
160
|
+
const resolveGroup = async (targets) => {
|
|
161
|
+
const platform = targets[0].platform;
|
|
162
|
+
let context;
|
|
103
163
|
try {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
env:
|
|
164
|
+
context = await createScopeContext({ scope: targets[0].scope, cwd: options.cwd, env: options.env });
|
|
165
|
+
const demand = await readDemand({ scope: targets[0].scope,
|
|
166
|
+
cwd: context.executionCwd, env: context.env });
|
|
167
|
+
const preview = await (options.reinstallCommandImpl ?? syncWriteCommand)([selector], {
|
|
168
|
+
cwd: context.executionCwd,
|
|
169
|
+
platform,
|
|
170
|
+
scope: targets[0].scope,
|
|
171
|
+
}, {
|
|
172
|
+
...options.rebuildRuntime,
|
|
173
|
+
env: context.env,
|
|
174
|
+
nativeCliRunner: options.nativeCliRunner ?? options.rebuildRuntime?.nativeCliRunner,
|
|
175
|
+
previewOperationPlan: true,
|
|
176
|
+
resolvePreApplyAuthorization: true,
|
|
177
|
+
executionInput: {
|
|
178
|
+
context, requirements: demandNativeProjection(demand),
|
|
179
|
+
selectedTargets: targets.map((target) => ({ pluginId: selector,
|
|
180
|
+
platform: target.platform, scope: target.scope })),
|
|
181
|
+
preserveOtherObservedTargets: true,
|
|
182
|
+
},
|
|
114
183
|
});
|
|
115
|
-
|
|
184
|
+
if (preview.overallState !== 'succeeded' || !preview.preApplyAuthorization)
|
|
185
|
+
return false;
|
|
186
|
+
authorization.push(...preview.preApplyAuthorization);
|
|
187
|
+
availableApplyTargets.push(...targets);
|
|
188
|
+
return true;
|
|
116
189
|
}
|
|
117
190
|
catch {
|
|
118
|
-
|
|
191
|
+
return false;
|
|
119
192
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const configPath = resolvePluginConfigStorePath({
|
|
123
|
-
sourceId: options.plugin.sourceId,
|
|
124
|
-
pluginName: options.plugin.manifest.name,
|
|
125
|
-
scope,
|
|
126
|
-
cwd: options.cwd,
|
|
127
|
-
env: options.env,
|
|
128
|
-
});
|
|
129
|
-
const safeTarget = `${scope}/plugin-config/${[
|
|
130
|
-
options.plugin.sourceId,
|
|
131
|
-
options.plugin.manifest.name,
|
|
132
|
-
'config.json',
|
|
133
|
-
].filter(Boolean).join('/')}`;
|
|
134
|
-
sanitized = sanitized.split(configPath).join(safeTarget);
|
|
193
|
+
finally {
|
|
194
|
+
await context?.dispose();
|
|
135
195
|
}
|
|
136
|
-
return sanitized;
|
|
137
196
|
};
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
return Object.fromEntries(await Promise.all(Object.entries(value).map(async ([key, entry]) => [
|
|
147
|
-
key,
|
|
148
|
-
await sanitizeProjection(entry, target, typeof entry === 'string'
|
|
149
|
-
? /^(?:message|error|stack|stdout|stderr|output|warning)$/u.test(key)
|
|
150
|
-
: Array.isArray(entry) && /^(?:messages|warnings)$/u.test(key)),
|
|
151
|
-
])));
|
|
152
|
-
};
|
|
153
|
-
for (const target of discovered.targets) {
|
|
154
|
-
try {
|
|
155
|
-
const debugLogger = options.rebuildRuntime?.debugLogger;
|
|
156
|
-
const reporter = options.rebuildRuntime?.reporter;
|
|
157
|
-
const result = await reinstall([selector], {
|
|
158
|
-
cwd: options.cwd,
|
|
159
|
-
platform: target.platform,
|
|
160
|
-
scope: target.scope,
|
|
161
|
-
}, {
|
|
162
|
-
...options.rebuildRuntime,
|
|
163
|
-
env: options.env,
|
|
164
|
-
nativeCliRunner,
|
|
165
|
-
...(debugLogger ? {
|
|
166
|
-
debugLogger: {
|
|
167
|
-
...debugLogger,
|
|
168
|
-
log: async (value) => debugLogger.log(await sanitizeProjection(value, target)),
|
|
169
|
-
},
|
|
170
|
-
} : {}),
|
|
171
|
-
...(reporter ? {
|
|
172
|
-
reporter: {
|
|
173
|
-
event: async (value) => reporter.event(await sanitizeProjection(value, target)),
|
|
174
|
-
notice: async (value) => reporter.notice(await sanitizeProjection(value, target)),
|
|
175
|
-
},
|
|
176
|
-
} : {}),
|
|
177
|
-
});
|
|
178
|
-
if (result.overallState === 'failed')
|
|
179
|
-
runtimeFailed = true;
|
|
180
|
-
targetResults.push(...await Promise.all(result.targetResults.map(async (entry) => ({
|
|
181
|
-
...entry,
|
|
182
|
-
...(entry.message ? { message: await sanitizeFailure(entry.message, entry.target) } : {}),
|
|
183
|
-
}))));
|
|
184
|
-
}
|
|
185
|
-
catch (error) {
|
|
186
|
-
runtimeFailed = true;
|
|
187
|
-
const message = await sanitizeFailure(error instanceof Error ? error.message : String(error), target);
|
|
188
|
-
targetResults.push({
|
|
197
|
+
for (const targets of groups.values()) {
|
|
198
|
+
if (await resolveGroup(targets))
|
|
199
|
+
continue;
|
|
200
|
+
for (const target of targets) {
|
|
201
|
+
if (targets.length > 1 && await resolveGroup([target]))
|
|
202
|
+
continue;
|
|
203
|
+
unavailableTargetResults.push({
|
|
189
204
|
target,
|
|
190
205
|
action: 'reinstall',
|
|
191
206
|
state: 'failed',
|
|
192
|
-
|
|
207
|
+
errorCode: 'sourceUnavailable',
|
|
208
|
+
message: 'The preApply authorization scope cannot be resolved for this target.',
|
|
193
209
|
});
|
|
194
210
|
}
|
|
195
211
|
}
|
|
196
|
-
const overallState = runtimeFailed || targetResults.some((entry) => entry.state === 'failed')
|
|
197
|
-
? 'partial' : 'succeeded';
|
|
198
212
|
return {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
targets: [...new Map(authorization.map((target) => [[
|
|
214
|
+
target.pluginId,
|
|
215
|
+
target.platform,
|
|
216
|
+
target.scope,
|
|
217
|
+
].join('\0'), target])).values()],
|
|
218
|
+
availableApplyTargets: dedupeTargets(availableApplyTargets),
|
|
219
|
+
unavailableTargetResults,
|
|
204
220
|
};
|
|
205
221
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
return discoverVisibleTargets({
|
|
211
|
-
pluginName: options.plugin.manifest.name,
|
|
212
|
-
plugin: options.plugin,
|
|
213
|
-
scope: options.scope,
|
|
214
|
-
cwd: options.cwd,
|
|
215
|
-
env: options.env,
|
|
216
|
-
nativeCliRunner: options.nativeCliRunner ?? getDefaultNativeCliRunner(),
|
|
217
|
-
rebuildRuntime: options.rebuildRuntime,
|
|
218
|
-
});
|
|
222
|
+
function pluginMayRunPreApply(plugin) {
|
|
223
|
+
return plugin.manifest.scripts?.preApply !== undefined
|
|
224
|
+
|| (plugin.manifest.dependencies?.length ?? 0) > 0;
|
|
219
225
|
}
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
226
|
+
function throwPreApplyAuthorizationRequired(targets) {
|
|
227
|
+
const plugins = [...new Set(targets.map((target) => target.pluginId))].join(', ');
|
|
228
|
+
const error = new Error(`preApplyAuthorizationRequired: Applying this config runs plugin preApply for ${plugins}. Re-run with --yes.`);
|
|
229
|
+
error.code = 'preApplyAuthorizationRequired';
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
function preApplyAuthorizationIsConfirmed(options) {
|
|
233
|
+
if (options.confirmed !== true)
|
|
234
|
+
return false;
|
|
235
|
+
if (options.authorizedTargets === undefined)
|
|
236
|
+
return true;
|
|
237
|
+
const authorized = new Set(options.authorizedTargets.map((target) => [
|
|
238
|
+
target.pluginId,
|
|
239
|
+
target.sourceIdentity,
|
|
240
|
+
target.platform,
|
|
241
|
+
target.scope,
|
|
242
|
+
].join('\0')));
|
|
243
|
+
return options.required.every((target) => authorized.has([
|
|
244
|
+
target.pluginId,
|
|
245
|
+
target.sourceIdentity,
|
|
246
|
+
target.platform,
|
|
247
|
+
target.scope,
|
|
248
|
+
].join('\0')));
|
|
240
249
|
}
|
|
241
250
|
function otherProjectsWarning(scope) {
|
|
242
251
|
return scope === 'user'
|
|
243
|
-
? ['
|
|
252
|
+
? ['其它项目不会由本次命令扫描或更新,可能需要在对应项目目录中运行 aw plugin sync --context project。']
|
|
244
253
|
: [];
|
|
245
254
|
}
|
|
246
255
|
function buildReceiptFieldEntry(options) {
|
|
@@ -255,247 +264,460 @@ function buildReceiptFieldEntry(options) {
|
|
|
255
264
|
};
|
|
256
265
|
}
|
|
257
266
|
export async function replayConfigRuntimeWrites(options) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const discovered = await resolveConfigApplyTargets({
|
|
265
|
-
plugin: options.plugin,
|
|
266
|
-
scope: options.scope,
|
|
267
|
-
cwd: options.cwd,
|
|
268
|
-
env,
|
|
269
|
-
applyTargets: options.applyTargets,
|
|
270
|
-
nativeCliRunner: options.nativeCliRunner,
|
|
271
|
-
rebuildRuntime,
|
|
272
|
-
});
|
|
273
|
-
const applied = await configApplyHasIssues({
|
|
274
|
-
plugin: options.plugin,
|
|
275
|
-
targets: discovered.targets,
|
|
276
|
-
cwd: options.cwd,
|
|
277
|
-
env,
|
|
278
|
-
}) ? {
|
|
279
|
-
overallState: 'partial',
|
|
280
|
-
targetResults: [],
|
|
281
|
-
applySkippedReason: 'invalidConfig',
|
|
282
|
-
} : await reinstallVisibleTargets({
|
|
283
|
-
plugin: options.plugin,
|
|
284
|
-
scope: options.scope,
|
|
285
|
-
cwd: options.cwd,
|
|
286
|
-
env,
|
|
287
|
-
applyTargets: options.applyTargets,
|
|
288
|
-
nativeCliRunner: options.nativeCliRunner,
|
|
289
|
-
reinstallCommandImpl: options.reinstallCommandImpl,
|
|
290
|
-
rebuildRuntime,
|
|
291
|
-
discovered,
|
|
292
|
-
});
|
|
293
|
-
return {
|
|
294
|
-
configWrite: 'succeeded',
|
|
295
|
-
overallState: applied.overallState,
|
|
296
|
-
targetResults: applied.targetResults,
|
|
297
|
-
...(applied.applySkippedReason ? { applySkippedReason: applied.applySkippedReason } : {}),
|
|
298
|
-
otherProjectsRequireReinstall: options.scope === 'user',
|
|
299
|
-
};
|
|
300
|
-
},
|
|
301
|
-
});
|
|
267
|
+
if (options.scope === 'user' && options.sharedNativeApplyConfirmed !== true && await configApplyHasValidSharedNativeTarget({
|
|
268
|
+
...options, plugins: options.rebuildRuntime?.referencePlugins, targets: options.applyTargets ?? [],
|
|
269
|
+
}))
|
|
270
|
+
throwSharedNativeApplyConfirmationRequired();
|
|
271
|
+
const result = await applyPluginConfig(options);
|
|
272
|
+
return { ...result, configWrite: 'succeeded', otherProjectsMayRequireSync: false };
|
|
302
273
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
274
|
+
const commandCandidateCleanup = new WeakMap();
|
|
275
|
+
function configApplyRequestedTargets(plan) {
|
|
276
|
+
const targets = plan.joint
|
|
277
|
+
? plan.joint.children.filter((child) => child.command !== 'cleanup' && child.command !== 'uninstall')
|
|
278
|
+
.flatMap((child) => configApplyRequestedTargets(child))
|
|
279
|
+
: plan.receipt.requestedTargets;
|
|
280
|
+
return targets.filter((target) => !plan.receipt.targetResults.some((result) => result.pluginId === target.pluginId && result.agent === target.agent && result.scope === target.scope
|
|
281
|
+
&& (result.satisfaction === 'unsupported' || result.satisfaction === 'excluded')));
|
|
309
282
|
}
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
283
|
+
function configApplyPackageHook(options, entries, referencePlugins) {
|
|
284
|
+
const env = options.env ?? process.env;
|
|
285
|
+
const targets = entries.map(({ target, plugin, evidence }) => ({
|
|
286
|
+
pluginId: plugin.pluginId ?? plugin.manifest.name,
|
|
287
|
+
scope: 'user',
|
|
288
|
+
packageId: target.packageId,
|
|
289
|
+
platforms: evidence.review?.routeChanges.length || evidence.blocker
|
|
290
|
+
? [...plugin.manifest.command?.platforms ?? target.runtimeConfigPlatforms] : [],
|
|
291
|
+
...(evidence.blocker && ['nativeToolSyncRequired', 'configApplyVersionMismatch'].includes(evidence.blocker.code)
|
|
292
|
+
? { blocker: evidence.blocker } : {}),
|
|
293
|
+
dependencies: resolvePluginMetaDependencyClosure(referencePlugins, [plugin.manifest.name])
|
|
294
|
+
.filter((entry) => entry.manifest.name !== plugin.manifest.name).map((entry) => entry.pluginId ?? entry.manifest.name),
|
|
295
|
+
}));
|
|
296
|
+
const selected = (pluginId, packageId) => entries.filter(({ target, plugin }) => (plugin.pluginId ?? plugin.manifest.name) === pluginId && (!packageId || target.packageId === packageId));
|
|
297
|
+
return { targets, evidence: entries.map(({ evidence }) => evidence),
|
|
298
|
+
blocked: (pluginId, _scope, code, packageId) => selected(pluginId, packageId).map(({ target, candidate, evidence }) => configPackageResult(target, [evidence.blocker ?? { code, message: 'The command package refresh did not complete.' }], candidate)),
|
|
299
|
+
execute: async (pluginId, _scope, _token, packageId) => {
|
|
300
|
+
const results = [];
|
|
301
|
+
for (const { target, plugin, candidate, evidence } of selected(pluginId, packageId)) {
|
|
302
|
+
if (evidence.blocker || !candidate) {
|
|
303
|
+
results.push(configPackageResult(target, [evidence.blocker ?? {
|
|
304
|
+
code: 'commandPackageApplyFailed', message: 'The command package could not be prepared.',
|
|
305
|
+
}]));
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
try {
|
|
309
|
+
options.rebuildRuntime?.signal?.throwIfAborted();
|
|
310
|
+
if (canonicalizeIdentityValue(evidence.review) !== canonicalizeIdentityValue(await inspectConfigCommandPackageReview(options, target, candidate))) {
|
|
311
|
+
throw new ManagedCommandError('operationReviewStale', 'Permissions affecting the reviewed routes changed. Prepare a new Review.');
|
|
312
|
+
}
|
|
313
|
+
const published = await publishPreparedManagedCommandPackage({ plugin, candidate, cwd: options.cwd, env, referencePlugins });
|
|
314
|
+
results.push(configPackageResult(target, [], candidate, published));
|
|
315
|
+
}
|
|
316
|
+
catch (error) {
|
|
317
|
+
if (recoveryInterruptionCode(error, options.rebuildRuntime?.signal) || readSafeOperationError(error))
|
|
318
|
+
throw error;
|
|
319
|
+
results.push(configPackageResult(target, [managedCommandDiagnostic(error)], candidate));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return results;
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
/** Prepare the same existing-output plan used by apply, without saving config or output. */
|
|
327
|
+
export async function preparePluginConfigApply(options, { inspectOnly = false } = {}) {
|
|
328
|
+
const { prepareRecovery, describeRecoveryPlan } = await import('../recovery/coordinator.js');
|
|
329
|
+
const context = options.context ?? options.scope;
|
|
330
|
+
const referencePlugins = await resolvePluginConfigReferencePlugins({ sourceId: options.plugin.sourceId,
|
|
331
|
+
sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
332
|
+
env: options.env, plugins: options.rebuildRuntime?.referencePlugins,
|
|
333
|
+
operationContext: options.rebuildRuntime?.catalogOperationContext }).catch((error) => {
|
|
334
|
+
if (recoveryInterruptionCode(error, options.rebuildRuntime?.signal))
|
|
335
|
+
throw error;
|
|
336
|
+
throw Object.assign(new Error('The selected source has no usable Active Catalog.'), { code: 'sourceActiveUnavailable' });
|
|
337
|
+
});
|
|
338
|
+
if (options.plugin.sourceId) {
|
|
339
|
+
const activePlugin = referencePlugins.find((entry) => entry.manifest.name === options.plugin.manifest.name);
|
|
340
|
+
if (activePlugin)
|
|
341
|
+
options = { ...options, plugin: activePlugin };
|
|
342
|
+
else if (options.plugin.manifest.command) {
|
|
343
|
+
throw Object.assign(new Error('The plugin is unavailable in Active Catalog.'), { code: 'pluginUnavailable' });
|
|
344
|
+
}
|
|
324
345
|
}
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
346
|
+
const pluginId = options.plugin.pluginId ?? (options.plugin.sourceId
|
|
347
|
+
? `${options.plugin.sourceId}/${options.plugin.manifest.name}` : options.plugin.manifest.name);
|
|
348
|
+
const preferences = await observePreferences(options);
|
|
349
|
+
resolveActiveConfigPlatforms(pluginId, options.plugin.manifest, preferences);
|
|
350
|
+
for (const selected of [...(options.platform ? [options.platform] : []), ...(options.targets ?? [])]) {
|
|
351
|
+
assertConfigLayerWritable(pluginId, options.plugin.manifest, preferences, selected);
|
|
352
|
+
}
|
|
353
|
+
const plugins = await resolvePluginConfigReferenceConsumers({ plugin: options.plugin, env: options.env,
|
|
354
|
+
plugins: referencePlugins });
|
|
355
|
+
const selectors = plugins.map((plugin) => plugin.pluginId ?? plugin.manifest.name);
|
|
356
|
+
const version = options.cliVersion
|
|
357
|
+
?? (await fs.readJson(path.join(resolveCliPackageRoot(), 'package.json'))).version;
|
|
358
|
+
let exactTargets = options.applyTargets?.map((target) => ({
|
|
359
|
+
pluginId: target.pluginId ?? plugins.find((plugin) => plugin.manifest.name === target.pluginName)?.pluginId ?? target.pluginName,
|
|
360
|
+
agent: target.platform,
|
|
361
|
+
scope: target.scope,
|
|
362
|
+
}));
|
|
363
|
+
const retainedLegacyTargets = [];
|
|
364
|
+
if (exactTargets?.length) {
|
|
365
|
+
const { readRecoveryStatus } = await import('../recovery/status.js');
|
|
366
|
+
const observed = await readRecoveryStatus({ context, cwd: options.cwd, env: options.env, cliVersion: version,
|
|
367
|
+
nativeCliRunner: options.nativeCliRunner ?? options.rebuildRuntime?.nativeCliRunner,
|
|
368
|
+
codexObservationSession: options.rebuildRuntime?.codexObservationSession });
|
|
369
|
+
const key = (target) => `${target.pluginId}\0${target.agent}\0${target.scope}`;
|
|
370
|
+
const live = new Set(observed.existingTargets?.map(key));
|
|
371
|
+
const owned = new Set(observed.ownedTargets?.map(key));
|
|
372
|
+
exactTargets = exactTargets.filter((target, index) => {
|
|
373
|
+
if (owned.has(key(target)) && !live.has(key(target))) {
|
|
374
|
+
retainedLegacyTargets.push(options.applyTargets[index]);
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
return true;
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
const env = options.env ?? process.env;
|
|
381
|
+
const commands = await discoverPluginConfigManagedCommandPackages({ plugin: options.plugin, scope: context,
|
|
382
|
+
cwd: options.cwd, env, referencePlugins });
|
|
383
|
+
let selectedPackages = commands.packages.filter((target) => {
|
|
384
|
+
if (options.applyCommandPackages && !options.applyCommandPackages.includes(target.packageId))
|
|
385
|
+
return false;
|
|
386
|
+
const plugin = plugins.find((entry) => entry.manifest.name === target.producer.pluginName);
|
|
387
|
+
const platforms = plugin?.manifest.command?.platforms ?? target.runtimeConfigPlatforms;
|
|
388
|
+
if (options.platform)
|
|
389
|
+
return options.platform !== 'generic' && platforms.includes(options.platform) && target.runtimeConfigKeys.length > 0;
|
|
390
|
+
return (target.refreshKeys.length > 0 || target.runtimeConfigKeys.length > 0)
|
|
391
|
+
&& (!options.targets || platforms.some((platform) => options.targets.includes(platform)));
|
|
332
392
|
});
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
393
|
+
if (options.mutation) {
|
|
394
|
+
const impact = await analyzePluginConfigMutationImpact({ ...options, scope: context, visibleTargets: [],
|
|
395
|
+
mutation: options.mutation, commandDiscovery: { ...commands, packages: selectedPackages }, referencePlugins });
|
|
396
|
+
selectedPackages = impact.affectedCommandPackages;
|
|
397
|
+
}
|
|
398
|
+
const entries = await prepareConfigCommandPackages(options, selectedPackages, plugins, referencePlugins, { inspectOnly });
|
|
399
|
+
const cleanup = () => Promise.all(entries.map(({ candidate }) => candidate?.cleanup()));
|
|
400
|
+
const packagePreparationCache = new Map();
|
|
401
|
+
for (const { target, candidate } of entries) {
|
|
402
|
+
if (candidate)
|
|
403
|
+
packagePreparationCache.set(target.packageId, Promise.resolve(candidate));
|
|
404
|
+
}
|
|
405
|
+
let plan;
|
|
406
|
+
try {
|
|
407
|
+
plan = await prepareRecovery('sync', selectors, {
|
|
408
|
+
scope: context,
|
|
409
|
+
context,
|
|
343
410
|
cwd: options.cwd,
|
|
344
411
|
env: options.env,
|
|
345
|
-
|
|
412
|
+
signal: options.rebuildRuntime?.signal,
|
|
413
|
+
cliVersion: version,
|
|
414
|
+
existingOnly: true,
|
|
415
|
+
...(exactTargets ? { exactTargets } : {}),
|
|
416
|
+
...(options.platform ? { targets: [options.platform] } : options.targets ? { targets: options.targets } : {}),
|
|
417
|
+
}, {
|
|
418
|
+
...options.rebuildRuntime,
|
|
419
|
+
configApply: true,
|
|
420
|
+
packagePreparationCache,
|
|
421
|
+
configApplyPackages: configApplyPackageHook(options, entries, referencePlugins),
|
|
422
|
+
referencePlugins,
|
|
423
|
+
nativeCliRunner: options.nativeCliRunner ?? options.rebuildRuntime?.nativeCliRunner,
|
|
424
|
+
awHomeMutationToken: options.awHomeMutationToken,
|
|
425
|
+
preApplyConfirmed: options.preApplyConfirmed,
|
|
346
426
|
});
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
error.code = 'sharedNativeConfigUserScopeRequired';
|
|
359
|
-
throw error;
|
|
427
|
+
commandCandidateCleanup.set(plan, cleanup);
|
|
428
|
+
plan.warnings.push(...retainedLegacyTargets.map((target) => `${target.pluginId ?? target.pluginName}/${target.platform}/${target.scope}:保留已停用的历史输出;配置 apply 不创建激活。`));
|
|
429
|
+
const profiles = configApplyRequestedTargets(plan).map((target) => ({
|
|
430
|
+
pluginName: target.pluginId.split('/').at(-1), scope: target.scope, platform: target.agent,
|
|
431
|
+
}));
|
|
432
|
+
for (const { target, candidate } of entries) {
|
|
433
|
+
for (const platform of candidate?.runtimeConfigEvidence.keys() ?? []) {
|
|
434
|
+
profiles.push({ pluginName: target.producer.pluginName, scope: 'user', platform });
|
|
435
|
+
}
|
|
436
|
+
if (candidate?.routeConfigEvidence)
|
|
437
|
+
profiles.push({ pluginName: target.producer.pluginName, scope: 'user' });
|
|
360
438
|
}
|
|
439
|
+
const references = await collectPluginConfigReferenceEvidence({ plugin: options.plugin, plugins: referencePlugins,
|
|
440
|
+
profiles, cwd: options.cwd, env: options.env });
|
|
441
|
+
const authorization = await resolveConfigPreApplyAuthorization({
|
|
442
|
+
plugin: options.plugin, scope: context, cwd: options.cwd, env: options.env,
|
|
443
|
+
applyTargets: configApplyRequestedTargets(plan).flatMap((target) => target.agent !== 'generic'
|
|
444
|
+
? [{ pluginName: target.pluginId.split('/').at(-1), pluginId: target.pluginId, platform: target.agent, scope: target.scope }] : []),
|
|
445
|
+
nativeCliRunner: options.nativeCliRunner ?? options.rebuildRuntime?.nativeCliRunner,
|
|
446
|
+
rebuildRuntime: { ...plan.runtime, referencePlugins },
|
|
447
|
+
});
|
|
448
|
+
const portableAuthorization = (current) => [
|
|
449
|
+
...current.preApplyAuthorization ?? [],
|
|
450
|
+
...(current.joint?.children ?? []).flatMap(portableAuthorization),
|
|
451
|
+
];
|
|
452
|
+
const preApplyAuthorization = [...new Map([...authorization.targets, ...portableAuthorization(plan)]
|
|
453
|
+
.map((target) => [[target.pluginId, target.platform, target.scope].join('\0'), target])).values()];
|
|
454
|
+
const commandPackageEvidence = entries.map(({ evidence }) => evidence);
|
|
455
|
+
return { plan, retainedLegacyTargets, commandPackages: commands.packages, commandDiscoveryErrors: commands.errors,
|
|
456
|
+
commandPackageEvidence, commandPackageReviews: commandPackageEvidence.flatMap(({ review }) => review ? [review] : []),
|
|
457
|
+
preApplyAuthorization,
|
|
458
|
+
evidence: { recovery: describeRecoveryPlan(plan), references, commandPackageEvidence,
|
|
459
|
+
preApplyAuthorization, retainedLegacyTargets } };
|
|
361
460
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
461
|
+
catch (error) {
|
|
462
|
+
if (plan)
|
|
463
|
+
await disposePluginConfigApply(plan);
|
|
464
|
+
else
|
|
465
|
+
await cleanup();
|
|
466
|
+
throw error;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
export async function disposePluginConfigApply(plan) {
|
|
470
|
+
const cleanup = commandCandidateCleanup.get(plan);
|
|
471
|
+
commandCandidateCleanup.delete(plan);
|
|
472
|
+
await cleanup?.();
|
|
473
|
+
for (const child of plan.joint?.children ?? [])
|
|
474
|
+
await disposePluginConfigApply(child);
|
|
475
|
+
await plan.context.dispose();
|
|
476
|
+
}
|
|
477
|
+
export class ConfigApplyInterruptedError extends Error {
|
|
478
|
+
apply;
|
|
479
|
+
code;
|
|
480
|
+
operationDiagnostic;
|
|
481
|
+
configWrite = 'notStarted';
|
|
482
|
+
constructor(error, apply, signal) {
|
|
483
|
+
super(error.code === 'operationInterrupted' && signal?.reason instanceof Error ? signal.reason.message : error.message);
|
|
484
|
+
this.apply = apply;
|
|
485
|
+
this.code = error.code;
|
|
486
|
+
this.operationDiagnostic = readSafeOperationError(error.cause) ?? error.operationDiagnostic;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
function configApplyHasPartialDelivery(target) {
|
|
490
|
+
if (target.execution !== 'partial')
|
|
491
|
+
return false;
|
|
492
|
+
if (skillInvocationDiagnostics([target]).some(({ subject }) => subject?.pluginId === target.pluginId
|
|
493
|
+
&& subject.target === target.agent && subject.scope === target.scope))
|
|
494
|
+
return true;
|
|
495
|
+
if (target.delivery?.kind === 'native') {
|
|
496
|
+
return target.deploymentReceipts?.some((receipt) => {
|
|
497
|
+
const plan = target.deploymentPlans?.find(({ binding }) => binding.id === receipt.bindingId);
|
|
498
|
+
return plan && nativeDeploymentHasVerifiedComponentWrite(plan, receipt);
|
|
499
|
+
}) ?? false;
|
|
500
|
+
}
|
|
501
|
+
if (target.delivery?.kind !== 'agent-skills' || !Array.isArray(target.backend))
|
|
502
|
+
return false;
|
|
503
|
+
return target.backend.some((entry) => {
|
|
504
|
+
if (!entry || typeof entry !== 'object')
|
|
505
|
+
return false;
|
|
506
|
+
const outcome = entry;
|
|
507
|
+
return typeof outcome.skill === 'string' && outcome.observation === 'satisfied'
|
|
508
|
+
&& (outcome.execution === 'applied' || outcome.execution === 'no-op')
|
|
509
|
+
&& Array.isArray(outcome.blockers) && outcome.blockers.length === 0;
|
|
383
510
|
});
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
511
|
+
}
|
|
512
|
+
export async function applyPluginConfig(options) {
|
|
513
|
+
return withAwHomeMutationLock({ env: options.env, token: options.awHomeMutationToken, action: async (token) => {
|
|
514
|
+
await options.reviewPreflight?.();
|
|
515
|
+
let prepared;
|
|
516
|
+
try {
|
|
517
|
+
const { executeRecovery } = await import('../recovery/coordinator.js');
|
|
518
|
+
const expectedCommands = options.expectedCommandPackageEvidence
|
|
519
|
+
?? options.expectedEvidence?.commandPackageEvidence;
|
|
520
|
+
prepared = await preparePluginConfigApply({ ...options, awHomeMutationToken: token,
|
|
521
|
+
expectedCommandPackageEvidence: expectedCommands });
|
|
522
|
+
if (options.expectedEvidence !== undefined
|
|
523
|
+
&& JSON.stringify(options.expectedEvidence) !== JSON.stringify(prepared.evidence)) {
|
|
524
|
+
throw Object.assign(new Error('Configuration apply inputs changed. Prepare a new Review.'), { code: 'operationReviewStale' });
|
|
525
|
+
}
|
|
526
|
+
const authorizedEffects = new Set(options.expectedHostPermissionEffects?.map((effect) => JSON.stringify(effect)));
|
|
527
|
+
if (recoveryHostPermissionEffects(prepared.plan).some((effect) => !authorizedEffects.has(JSON.stringify(effect)))) {
|
|
528
|
+
throw Object.assign(new Error('Host permission effects changed after Review. Prepare a new Review.'), { code: 'operationReviewStale' });
|
|
529
|
+
}
|
|
530
|
+
const authorization = prepared.preApplyAuthorization;
|
|
531
|
+
if (authorization.length && !preApplyAuthorizationIsConfirmed({ required: authorization,
|
|
532
|
+
confirmed: options.preApplyConfirmed, authorizedTargets: options.preApplyAuthorizedTargets })) {
|
|
533
|
+
throwPreApplyAuthorizationRequired(authorization);
|
|
534
|
+
}
|
|
535
|
+
if (options.sharedNativeApplyConfirmed !== true && await configApplyHasValidSharedNativeTarget({
|
|
536
|
+
plugin: options.plugin, cwd: options.cwd, env: options.env, plugins: options.rebuildRuntime?.referencePlugins,
|
|
537
|
+
targets: configApplyRequestedTargets(prepared.plan).flatMap((target) => target.agent !== 'generic'
|
|
538
|
+
? [{ pluginName: target.pluginId.split('/').at(-1), pluginId: target.pluginId, platform: target.agent, scope: target.scope }] : []),
|
|
539
|
+
}))
|
|
540
|
+
throwSharedNativeApplyConfirmationRequired();
|
|
541
|
+
const discoveryErrors = prepared.commandDiscoveryErrors.map((error) => ({
|
|
542
|
+
stage: 'targetDiscovery', code: error.code, message: error.message,
|
|
543
|
+
}));
|
|
544
|
+
let interruption;
|
|
545
|
+
const receipt = await executeRecovery(prepared.plan, {
|
|
546
|
+
yes: options.sharedNativeApplyConfirmed === true || options.preApplyConfirmed === true,
|
|
547
|
+
runtime: { ...options.rebuildRuntime, awHomeMutationToken: token, preApplyConfirmed: options.preApplyConfirmed },
|
|
548
|
+
}).catch((error) => {
|
|
549
|
+
if (!(error instanceof RecoveryInterruptedError))
|
|
550
|
+
throw error;
|
|
551
|
+
interruption = error;
|
|
552
|
+
return error.receipt;
|
|
553
|
+
});
|
|
554
|
+
const retainedLegacyTargets = prepared.retainedLegacyTargets.filter((target) => !receipt.targetResults.some((result) => (target.pluginId ? result.pluginId === target.pluginId : result.pluginId.split('/').at(-1) === target.pluginName)
|
|
555
|
+
&& result.agent === target.platform && result.scope === target.scope));
|
|
556
|
+
const ok = receipt.ok && discoveryErrors.length === 0;
|
|
557
|
+
const errors = [...discoveryErrors, ...receipt.blockers, ...receipt.errors].map((error) => ({
|
|
558
|
+
stage: 'stage' in error ? error.stage : 'apply', code: error.code, message: error.message,
|
|
559
|
+
}));
|
|
560
|
+
const diagnostics = [...projectDeploymentNotices(receipt.targetResults), ...projectRelatedProjectPermissionFailures(receipt.targetResults)];
|
|
561
|
+
const apply = {
|
|
562
|
+
state: ok ? 'succeeded' : 'partial',
|
|
563
|
+
targetResults: [...receipt.targetResults.filter((target) => target.satisfaction !== 'unsupported' && target.satisfaction !== 'excluded').map((target) => ({
|
|
564
|
+
target: { pluginName: target.pluginId.split('/').at(-1), pluginId: target.pluginId,
|
|
565
|
+
platform: target.agent, scope: target.scope },
|
|
566
|
+
action: 'refresh',
|
|
567
|
+
state: target.execution === 'applied' || target.execution === 'no-op' ? 'completed'
|
|
568
|
+
: target.execution === 'not-run' ? 'skipped' : 'failed',
|
|
569
|
+
...projectComponentDelivery(target),
|
|
570
|
+
...(target.relation === 'root' ? { relation: 'requested' } : target.relation === 'dependency' ? { relation: 'dependency' } : {}),
|
|
571
|
+
...(target.requiredBy.length ? { requiredBy: target.requiredBy } : {}),
|
|
572
|
+
...(configApplyHasPartialDelivery(target) ? { partialDelivery: true } : {}),
|
|
573
|
+
...(target.blockers.length ? { errorCode: target.blockers[0].code,
|
|
574
|
+
message: target.blockers.map((item) => item.message).join(' ') } : {}),
|
|
575
|
+
})), ...retainedLegacyTargets.map((target) => ({
|
|
576
|
+
target, action: 'refresh', state: 'skipped',
|
|
577
|
+
message: 'The inactive legacy output was preserved. Configuration apply does not create an activation.',
|
|
578
|
+
}))],
|
|
579
|
+
commandResults: receipt.commandResults,
|
|
580
|
+
...(receipt.reviewedUserRoots !== undefined ? { reviewedUserRoots: receipt.reviewedUserRoots } : {}),
|
|
581
|
+
...(errors.length ? { errors } : {}),
|
|
582
|
+
...(diagnostics.length ? { diagnostics } : {}),
|
|
583
|
+
};
|
|
584
|
+
if (interruption)
|
|
585
|
+
throw new ConfigApplyInterruptedError(interruption, apply, options.rebuildRuntime?.signal);
|
|
586
|
+
return { configWrite: 'notStarted', overallState: ok ? 'succeeded' : 'partial', apply,
|
|
587
|
+
otherProjectsMayRequireSync: true };
|
|
588
|
+
}
|
|
589
|
+
catch (error) {
|
|
590
|
+
if (recoveryInterruptionCode(error, options.rebuildRuntime?.signal)
|
|
591
|
+
|| readSafeOperationError(error))
|
|
592
|
+
throw error;
|
|
593
|
+
if (error instanceof ConfigLayerError)
|
|
594
|
+
return { configWrite: 'notStarted', overallState: 'failed',
|
|
595
|
+
apply: configApplyLayerFailure(error), otherProjectsMayRequireSync: false };
|
|
596
|
+
const apply = unavailableApply('targetDiscoveryFailed', 'targetDiscovery');
|
|
597
|
+
const code = error?.code;
|
|
598
|
+
if (code === 'sourceActiveUnavailable' || code === 'pluginUnavailable') {
|
|
599
|
+
return { configWrite: 'notStarted', overallState: 'partial', apply: {
|
|
600
|
+
...unavailableApply('sourceUnavailable', 'source'),
|
|
601
|
+
error: { stage: 'source', code, message: error instanceof Error ? error.message : 'The Active Catalog plugin is unavailable.' },
|
|
602
|
+
}, otherProjectsMayRequireSync: true };
|
|
603
|
+
}
|
|
604
|
+
if (typeof code === 'string')
|
|
605
|
+
apply.error = { stage: 'apply', code,
|
|
606
|
+
message: code === 'operationReviewStale' ? 'Configuration apply inputs changed. Prepare a new Review.'
|
|
607
|
+
: 'The existing outputs cannot be refreshed with the current authorization.' };
|
|
608
|
+
return { configWrite: 'notStarted', overallState: 'partial', apply, otherProjectsMayRequireSync: true };
|
|
609
|
+
}
|
|
610
|
+
finally {
|
|
611
|
+
if (prepared)
|
|
612
|
+
await disposePluginConfigApply(prepared.plan);
|
|
613
|
+
}
|
|
614
|
+
} });
|
|
615
|
+
}
|
|
616
|
+
function throwSharedNativeApplyConfirmationRequired() {
|
|
617
|
+
const error = new Error('sharedNativeConfigApplyConfirmationRequired: Applying this user config changes a shared native artifact. Re-run with --yes.');
|
|
618
|
+
error.code = 'sharedNativeConfigApplyConfirmationRequired';
|
|
619
|
+
throw error;
|
|
620
|
+
}
|
|
621
|
+
async function applyPluginConfigWriteUnlocked(options) {
|
|
622
|
+
const pluginName = assertSafePluginConfigSegment(options.pluginName ?? options.plugin?.manifest.name ?? '');
|
|
623
|
+
const identity = options.plugin?.sourceId ? { sourceId: options.plugin.sourceId,
|
|
624
|
+
sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity } : {};
|
|
625
|
+
const requestedUpdates = options.request.updates ?? {};
|
|
626
|
+
const removeKeys = uniqueInOrder(options.request.removeKeys ?? []);
|
|
627
|
+
const duplicateKeys = removeKeys.filter((key) => Object.hasOwn(requestedUpdates, key));
|
|
628
|
+
if (duplicateKeys.length)
|
|
629
|
+
throw new Error(`Config write cannot update and remove the same key: ${duplicateKeys.join(', ')}.`);
|
|
630
|
+
const schemaAccess = await resolvePluginConfigSchemaAccess({ pluginName, currentPlugin: options.plugin,
|
|
631
|
+
currentPluginError: options.pluginError, scope: options.scope, platform: options.platform, cwd: options.cwd, env: options.env });
|
|
632
|
+
const plugin = schemaAccess.plugin;
|
|
633
|
+
const definition = plugin?.manifest.config ? selectPluginConfigProfile(plugin.manifest.config, options.platform) : undefined;
|
|
634
|
+
if (!plugin || !definition && (Object.keys(requestedUpdates).length > 0 || removeKeys.length === 0)) {
|
|
635
|
+
throw new PluginConfigSchemaResolutionError('configSchemaUnavailable', `Plugin "${pluginName}" does not declare an AW config schema.`);
|
|
636
|
+
}
|
|
637
|
+
const updates = await coercePluginConfigUpdates({ schema: definition?.fields ?? {}, updates: requestedUpdates, cwd: options.cwd });
|
|
638
|
+
const impact = await analyzePluginConfigMutationImpact({ plugin, scope: options.scope, platform: options.platform,
|
|
639
|
+
cwd: options.cwd, env: options.env, visibleTargets: [], commandDiscovery: { packages: [], errors: [] },
|
|
640
|
+
referencePlugins: options.rebuildRuntime?.referencePlugins, mutation: { kind: 'patch', updates, removeKeys } });
|
|
641
|
+
await assertPluginConfigMutationCandidate({ ...identity, pluginName, manifest: plugin.manifest,
|
|
642
|
+
scope: options.scope, platform: options.platform, cwd: options.cwd, env: options.env, updates, removeKeys,
|
|
643
|
+
referencePlugins: options.rebuildRuntime?.referencePlugins });
|
|
644
|
+
if (impact.referenceBlockers?.length)
|
|
645
|
+
throw new PluginConfigReferenceBlockedError(impact.referenceBlockers);
|
|
646
|
+
if (impact.storeChanged) {
|
|
647
|
+
try {
|
|
648
|
+
await patchPluginConfigStore({ ...identity, pluginName, scope: 'user', platform: options.platform,
|
|
649
|
+
cwd: options.cwd, env: options.env, updates: Object.fromEntries(impact.updatedKeys.map((key) => [key, updates[key]])), removeKeys });
|
|
650
|
+
}
|
|
651
|
+
catch (error) {
|
|
652
|
+
throw markConfigWriteFailed(error);
|
|
401
653
|
}
|
|
402
654
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
env: options.env,
|
|
410
|
-
updates: Object.fromEntries(updatedKeys.map((key) => [key, updates[key]])),
|
|
411
|
-
removeKeys: requestedRemoveKeys,
|
|
412
|
-
schema,
|
|
413
|
-
});
|
|
655
|
+
const warnings = [...impact.referenceWarnings ?? []];
|
|
656
|
+
let effective;
|
|
657
|
+
try {
|
|
658
|
+
effective = summarizeEffectivePluginConfig(await resolveEffectivePluginConfig({ ...identity, pluginName,
|
|
659
|
+
manifest: plugin.manifest, platform: options.platform, targetScope: options.scope, cwd: options.cwd, env: options.env,
|
|
660
|
+
referencePlugins: options.rebuildRuntime?.referencePlugins }));
|
|
414
661
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
pluginName,
|
|
418
|
-
manifest: schemaPlugin.manifest,
|
|
419
|
-
targetScope: options.scope,
|
|
420
|
-
cwd: options.cwd,
|
|
421
|
-
env: options.env,
|
|
422
|
-
}));
|
|
423
|
-
let applied;
|
|
424
|
-
if (changedKeys.length === 0) {
|
|
425
|
-
applied = {
|
|
426
|
-
overallState: 'succeeded',
|
|
427
|
-
targetResults: [],
|
|
428
|
-
applySkippedReason: 'noConfigChange',
|
|
429
|
-
};
|
|
662
|
+
catch {
|
|
663
|
+
warnings.push('The saved configuration cannot be previewed. Check its schema and reference sources before applying it.');
|
|
430
664
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
665
|
+
if (impact.storeChanged)
|
|
666
|
+
warnings.push(...otherProjectsWarning('user'));
|
|
667
|
+
return { plugin: pluginName, scope: 'user', context: options.scope, platform: options.platform,
|
|
668
|
+
...(schemaAccess.schema ? { schema: schemaAccess.schema } : {}), updatedKeys: impact.updatedKeys,
|
|
669
|
+
removedKeys: impact.removedKeys, staleRemovedKeys: impact.staleRemovedKeys, effective,
|
|
670
|
+
configWrite: 'succeeded', overallState: 'succeeded',
|
|
671
|
+
apply: skippedApply(impact.storeChanged ? 'notRequested' : 'noConfigChange'),
|
|
672
|
+
otherProjectsMayRequireSync: impact.storeChanged, warnings };
|
|
673
|
+
}
|
|
674
|
+
async function prepareConfigMutationApplySelection(options) {
|
|
675
|
+
if (options.apply !== true || !options.plugin)
|
|
676
|
+
return undefined;
|
|
677
|
+
let prepared;
|
|
678
|
+
try {
|
|
679
|
+
prepared = await preparePluginConfigApply({ ...options, plugin: options.plugin }, { inspectOnly: true });
|
|
680
|
+
const requestedTargets = configApplyRequestedTargets(prepared.plan);
|
|
681
|
+
const hasGeneric = requestedTargets.some((target) => target.agent === 'generic');
|
|
682
|
+
const visibleTargets = requestedTargets.flatMap((target) => target.agent === 'generic' ? [] : [{
|
|
683
|
+
pluginName: target.pluginId.split('/').at(-1), pluginId: target.pluginId,
|
|
684
|
+
platform: target.agent, scope: target.scope,
|
|
685
|
+
}]);
|
|
686
|
+
const impact = await analyzePluginConfigMutationImpact({ plugin: options.plugin, scope: options.context ?? options.scope,
|
|
687
|
+
platform: options.platform, cwd: options.cwd, env: options.env, visibleTargets,
|
|
688
|
+
commandDiscovery: { packages: prepared.commandPackages, errors: prepared.commandDiscoveryErrors },
|
|
689
|
+
referencePlugins: options.rebuildRuntime?.referencePlugins,
|
|
690
|
+
mutation: 'request' in options ? { kind: 'patch', ...options.request } : { kind: 'reset' } });
|
|
691
|
+
if (options.expectedCommandPackageEvidence) {
|
|
692
|
+
const referencePlugins = prepared.plan.runtime.referencePlugins ?? [];
|
|
693
|
+
const plugins = await resolvePluginConfigReferenceConsumers({ plugin: options.plugin, env: options.env, plugins: referencePlugins });
|
|
694
|
+
const entries = await prepareConfigCommandPackages({ ...options, plugin: options.plugin,
|
|
695
|
+
mutation: 'request' in options ? { kind: 'patch', ...options.request } : { kind: 'reset' } }, impact.affectedCommandPackages, plugins, referencePlugins);
|
|
696
|
+
await Promise.all(entries.map(({ candidate }) => candidate?.cleanup()));
|
|
697
|
+
}
|
|
698
|
+
if (!hasGeneric && !visibleTargets.length && !prepared.commandPackages.length && !prepared.commandDiscoveryErrors.length) {
|
|
699
|
+
if (prepared.plan.blockExecution || prepared.plan.receipt.blockers.length || prepared.plan.receipt.errors.length)
|
|
700
|
+
return undefined;
|
|
701
|
+
return { skipReason: 'noVisibleTarget' };
|
|
702
|
+
}
|
|
703
|
+
return { applyTargets: hasGeneric ? undefined : impact.affectedTargets,
|
|
704
|
+
applyCommandPackages: impact.affectedCommandPackages.map((target) => target.packageId),
|
|
705
|
+
...(!hasGeneric && impact.noEffectiveChange ? { skipReason: 'noEffectiveConfigChange' } : {}) };
|
|
437
706
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
};
|
|
707
|
+
catch (error) {
|
|
708
|
+
if (error?.code === 'operationReviewStale' || recoveryInterruptionCode(error, options.rebuildRuntime?.signal))
|
|
709
|
+
throw error;
|
|
710
|
+
// A failed output discovery must not prevent a valid configuration save.
|
|
711
|
+
return undefined;
|
|
444
712
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
scope: options.scope,
|
|
449
|
-
cwd: options.cwd,
|
|
450
|
-
env: options.env ?? process.env,
|
|
451
|
-
applyTargets: options.applyTargets,
|
|
452
|
-
nativeCliRunner: options.nativeCliRunner,
|
|
453
|
-
rebuildRuntime: options.rebuildRuntime,
|
|
454
|
-
});
|
|
455
|
-
applied = await configApplyHasIssues({
|
|
456
|
-
plugin: schemaPlugin,
|
|
457
|
-
targets: discovered.targets,
|
|
458
|
-
cwd: options.cwd,
|
|
459
|
-
env: options.env,
|
|
460
|
-
knownValidScopes: [options.scope],
|
|
461
|
-
}) ? {
|
|
462
|
-
overallState: 'partial',
|
|
463
|
-
targetResults: [],
|
|
464
|
-
applySkippedReason: 'invalidConfig',
|
|
465
|
-
} : await reinstallVisibleTargets({
|
|
466
|
-
plugin: schemaPlugin,
|
|
467
|
-
scope: options.scope,
|
|
468
|
-
cwd: options.cwd,
|
|
469
|
-
env: options.env ?? process.env,
|
|
470
|
-
applyTargets,
|
|
471
|
-
nativeCliRunner: options.nativeCliRunner,
|
|
472
|
-
reinstallCommandImpl: options.reinstallCommandImpl,
|
|
473
|
-
rebuildRuntime: options.rebuildRuntime,
|
|
474
|
-
discovered,
|
|
475
|
-
});
|
|
713
|
+
finally {
|
|
714
|
+
if (prepared)
|
|
715
|
+
await disposePluginConfigApply(prepared.plan);
|
|
476
716
|
}
|
|
477
|
-
const otherProjectsRequireReinstall = options.scope === 'user'
|
|
478
|
-
&& changedKeys.length > 0
|
|
479
|
-
&& effective.issues.length === 0
|
|
480
|
-
&& applied.applySkippedReason !== 'invalidConfig';
|
|
481
|
-
if (otherProjectsRequireReinstall)
|
|
482
|
-
warnings.push(...otherProjectsWarning(options.scope));
|
|
483
|
-
return {
|
|
484
|
-
plugin: pluginName,
|
|
485
|
-
scope: options.scope,
|
|
486
|
-
...(schemaAccess.schema ? { schema: schemaAccess.schema } : {}),
|
|
487
|
-
updatedKeys,
|
|
488
|
-
removedKeys,
|
|
489
|
-
effective,
|
|
490
|
-
configWrite: 'succeeded',
|
|
491
|
-
overallState: applied.overallState,
|
|
492
|
-
targetResults: applied.targetResults,
|
|
493
|
-
...(applied.applySkippedReason ? { applySkippedReason: applied.applySkippedReason } : {}),
|
|
494
|
-
otherProjectsRequireReinstall,
|
|
495
|
-
warnings,
|
|
496
|
-
};
|
|
497
717
|
}
|
|
498
718
|
export async function applyPluginConfigWrite(options) {
|
|
719
|
+
if (options.context)
|
|
720
|
+
await resolveWorkContext({ cwd: options.cwd, context: options.context });
|
|
499
721
|
const requestedPluginName = options.pluginName ?? options.plugin?.manifest.name;
|
|
500
722
|
if (!requestedPluginName)
|
|
501
723
|
throw new Error('Plugin name is required for config write.');
|
|
@@ -505,16 +727,31 @@ export async function applyPluginConfigWrite(options) {
|
|
|
505
727
|
token: options.awHomeMutationToken,
|
|
506
728
|
action: async (awHomeMutationToken) => {
|
|
507
729
|
await options.reviewPreflight?.();
|
|
730
|
+
const hasUpdates = Object.keys(options.request.updates ?? {}).length > 0;
|
|
731
|
+
const layerError = options.plugin && (hasUpdates || options.apply)
|
|
732
|
+
? await observeConfigLayerError({ ...options, plugin: options.plugin }) : undefined;
|
|
733
|
+
if (layerError && hasUpdates)
|
|
734
|
+
throw layerError;
|
|
735
|
+
let configCommitted = false;
|
|
508
736
|
try {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
awHomeMutationToken,
|
|
512
|
-
|
|
513
|
-
|
|
737
|
+
const selection = layerError ? undefined : await prepareConfigMutationApplySelection({ ...options, awHomeMutationToken });
|
|
738
|
+
const saved = await applyPluginConfigWriteUnlocked({ ...options, scope: options.context ?? options.scope,
|
|
739
|
+
apply: false, awHomeMutationToken, rebuildRuntime: { ...options.rebuildRuntime, awHomeMutationToken } });
|
|
740
|
+
configCommitted = true;
|
|
741
|
+
if (options.apply !== true || !options.plugin)
|
|
742
|
+
return saved;
|
|
743
|
+
if (layerError)
|
|
744
|
+
return { ...saved, overallState: 'partial', apply: configApplyLayerFailure(layerError) };
|
|
745
|
+
if (saved.apply.state === 'skipped' && saved.apply.reason === 'noConfigChange')
|
|
746
|
+
return saved;
|
|
747
|
+
if (selection?.skipReason)
|
|
748
|
+
return { ...saved, apply: skippedApply(selection.skipReason) };
|
|
749
|
+
const applied = await applyPluginConfig({ ...options, ...selection, plugin: options.plugin, awHomeMutationToken });
|
|
750
|
+
return { ...saved, overallState: applied.overallState, apply: applied.apply };
|
|
514
751
|
}
|
|
515
752
|
catch (error) {
|
|
516
753
|
let sensitiveValues = options.plugin
|
|
517
|
-
? collectSensitivePluginConfigValues(options.plugin.manifest, (options.request.updates ?? {}))
|
|
754
|
+
? collectSensitivePluginConfigValues(options.plugin.manifest, (options.request.updates ?? {}), options.platform)
|
|
518
755
|
: [];
|
|
519
756
|
if (options.plugin) {
|
|
520
757
|
try {
|
|
@@ -522,40 +759,73 @@ export async function applyPluginConfigWrite(options) {
|
|
|
522
759
|
...(options.plugin.sourceId ? {
|
|
523
760
|
sourceId: options.plugin.sourceId,
|
|
524
761
|
sourceIdentity: options.plugin.sourceIdentity,
|
|
762
|
+
logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
525
763
|
} : {}),
|
|
526
764
|
pluginName: options.plugin.manifest.name,
|
|
527
765
|
manifest: options.plugin.manifest,
|
|
766
|
+
referencePlugins: options.rebuildRuntime?.referencePlugins,
|
|
528
767
|
targetScope: options.scope,
|
|
768
|
+
platform: options.platform,
|
|
529
769
|
cwd: options.cwd,
|
|
530
770
|
env: options.env,
|
|
531
771
|
});
|
|
532
772
|
sensitiveValues = [
|
|
533
773
|
...sensitiveValues,
|
|
534
|
-
...collectSensitivePluginConfigValues(options.plugin.manifest, effective.values),
|
|
774
|
+
...collectSensitivePluginConfigValues(options.plugin.manifest, effective.values, options.platform),
|
|
535
775
|
];
|
|
536
776
|
}
|
|
537
777
|
catch {
|
|
538
778
|
// Requested sensitive values and generic credential redaction remain available.
|
|
539
779
|
}
|
|
540
780
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
const configPath = resolvePluginConfigStorePath({
|
|
781
|
+
const configPaths = ['user', 'project'].map((scope) => ({
|
|
782
|
+
path: resolvePluginConfigStorePath({
|
|
544
783
|
sourceId: options.plugin?.sourceId,
|
|
545
784
|
pluginName: requestedPluginName,
|
|
546
785
|
scope,
|
|
547
786
|
cwd: options.cwd,
|
|
548
787
|
env: options.env,
|
|
549
|
-
})
|
|
550
|
-
|
|
788
|
+
}),
|
|
789
|
+
label: `${scope}/plugin-config/${[
|
|
551
790
|
options.plugin?.sourceId,
|
|
552
791
|
requestedPluginName,
|
|
553
792
|
'config.json',
|
|
554
|
-
].filter(Boolean).join('/')}
|
|
793
|
+
].filter(Boolean).join('/')}`,
|
|
794
|
+
}));
|
|
795
|
+
const redactText = (text) => {
|
|
796
|
+
let safe = redactPluginScriptOutput(text, sensitiveValues).split(options.cwd).join('<project>');
|
|
797
|
+
for (const { path, label } of configPaths)
|
|
798
|
+
safe = safe.split(path).join(label);
|
|
799
|
+
return safe;
|
|
800
|
+
};
|
|
801
|
+
const message = redactText(error instanceof Error ? error.message : String(error));
|
|
802
|
+
if (error instanceof ConfigApplyInterruptedError) {
|
|
803
|
+
error.message = message;
|
|
804
|
+
if (configCommitted)
|
|
805
|
+
error.configWrite = 'succeeded';
|
|
806
|
+
throw error;
|
|
555
807
|
}
|
|
556
|
-
|
|
808
|
+
// Preserve reference classification through the same redaction boundary as the
|
|
809
|
+
// public error text; saved credentials may not be present in the TUI draft.
|
|
810
|
+
const safeError = (error instanceof PluginConfigReferenceBlockedError
|
|
811
|
+
? new PluginConfigReferenceBlockedError(error.blockers.map((blocker) => blocker.kind === 'unreadable'
|
|
812
|
+
? { kind: 'unreadable', location: redactText(blocker.location) }
|
|
813
|
+
: { kind: 'validation', provider: redactText(blocker.provider), key: redactText(blocker.key),
|
|
814
|
+
consumer: redactText(blocker.consumer), issueCode: blocker.issueCode,
|
|
815
|
+
issuePath: redactText(blocker.issuePath), issueMessage: redactText(blocker.issueMessage) }))
|
|
816
|
+
: new Error(message));
|
|
817
|
+
safeError.message = message;
|
|
557
818
|
const code = error.code;
|
|
558
|
-
safeError.code = typeof code === 'string' ? code
|
|
819
|
+
safeError.code = typeof code === 'string' ? code
|
|
820
|
+
: message.startsWith('schemaVersionUnsupported:') ? 'schemaVersionUnsupported'
|
|
821
|
+
: 'configApplyFailed';
|
|
822
|
+
const configWrite = error.configWrite;
|
|
823
|
+
if (configCommitted || configWrite === 'succeeded' || configWriteStateForError(error) === 'failed') {
|
|
824
|
+
safeError.configWrite = configCommitted || configWrite === 'succeeded' ? 'succeeded' : 'failed';
|
|
825
|
+
}
|
|
826
|
+
if (error && typeof error === 'object' && 'operationDiagnostic' in error) {
|
|
827
|
+
safeError.operationDiagnostic = error.operationDiagnostic;
|
|
828
|
+
}
|
|
559
829
|
throw safeError;
|
|
560
830
|
}
|
|
561
831
|
},
|
|
@@ -563,166 +833,102 @@ export async function applyPluginConfigWrite(options) {
|
|
|
563
833
|
}
|
|
564
834
|
async function resetPluginConfigWithHelperUnlocked(options) {
|
|
565
835
|
const pluginName = assertSafePluginConfigSegment(options.pluginName);
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
cwd: options.cwd,
|
|
571
|
-
env: options.env,
|
|
572
|
-
}) : undefined;
|
|
573
|
-
let configIdentity = options.plugin?.sourceId ? {
|
|
574
|
-
sourceId: options.plugin.sourceId,
|
|
575
|
-
sourceIdentity: options.plugin.sourceIdentity,
|
|
576
|
-
} : options.sourceId ? {
|
|
577
|
-
sourceId: options.sourceId,
|
|
578
|
-
sourceIdentity: options.sourceIdentity,
|
|
579
|
-
} : {};
|
|
580
|
-
if (options.sourceId && !options.sourceIdentity) {
|
|
836
|
+
let identity = options.plugin?.sourceId ? { sourceId: options.plugin.sourceId,
|
|
837
|
+
sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity }
|
|
838
|
+
: { sourceId: options.sourceId, sourceIdentity: options.sourceIdentity, logicalIdentity: options.logicalIdentity };
|
|
839
|
+
if (identity.sourceId && !identity.sourceIdentity) {
|
|
581
840
|
try {
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
cwd: options.cwd,
|
|
587
|
-
env: options.env,
|
|
588
|
-
});
|
|
589
|
-
if (identity)
|
|
590
|
-
configIdentity = {
|
|
591
|
-
sourceId: options.sourceId,
|
|
592
|
-
sourceIdentity: identity.sourceIdentity,
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
catch {
|
|
596
|
-
// Reset does not require a readable or valid envelope.
|
|
841
|
+
const stored = await readNamespacedPluginConfigStoreIdentity({ sourceId: identity.sourceId, pluginName,
|
|
842
|
+
scope: 'user', platform: options.platform, cwd: options.cwd, env: options.env });
|
|
843
|
+
if (stored)
|
|
844
|
+
identity = { ...identity, sourceIdentity: stored.binding.sourceIdentity };
|
|
597
845
|
}
|
|
846
|
+
catch { /* Reset remains available for unreadable identity metadata. */ }
|
|
598
847
|
}
|
|
599
848
|
let removedKeys = [];
|
|
600
849
|
try {
|
|
601
|
-
const store = await readPluginConfigStore({
|
|
602
|
-
|
|
603
|
-
pluginName,
|
|
604
|
-
scope: options.scope,
|
|
605
|
-
cwd: options.cwd,
|
|
606
|
-
env: options.env,
|
|
607
|
-
});
|
|
850
|
+
const store = await readPluginConfigStore({ ...identity, pluginName, scope: 'user', platform: options.platform,
|
|
851
|
+
cwd: options.cwd, env: options.env });
|
|
608
852
|
removedKeys = collectRemovedConfigKeys(store.values);
|
|
609
853
|
}
|
|
610
|
-
catch {
|
|
611
|
-
// Reset is the final recovery boundary and does not require a readable store.
|
|
612
|
-
}
|
|
854
|
+
catch { /* Broken stores still have the path-based reset boundary. */ }
|
|
613
855
|
const warnings = [];
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
let applied = {
|
|
622
|
-
overallState: 'succeeded',
|
|
623
|
-
targetResults: [],
|
|
624
|
-
applySkippedReason: reset.deleted ? 'notRequested' : 'noConfigChange',
|
|
625
|
-
};
|
|
626
|
-
let effective;
|
|
627
|
-
if (schemaAccess?.plugin) {
|
|
628
|
-
if (schemaAccess.plugin.manifest.config?.fields) {
|
|
629
|
-
try {
|
|
630
|
-
effective = summarizeEffectivePluginConfig(await resolveEffectivePluginConfig({
|
|
631
|
-
...configIdentity,
|
|
632
|
-
pluginName,
|
|
633
|
-
manifest: schemaAccess.plugin.manifest,
|
|
634
|
-
targetScope: options.scope,
|
|
635
|
-
cwd: options.cwd,
|
|
636
|
-
env: options.env,
|
|
637
|
-
}));
|
|
638
|
-
}
|
|
639
|
-
catch {
|
|
640
|
-
if (options.apply !== false) {
|
|
641
|
-
applied = {
|
|
642
|
-
overallState: 'partial',
|
|
643
|
-
targetResults: [],
|
|
644
|
-
applySkippedReason: 'invalidConfig',
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
}
|
|
856
|
+
if (options.plugin) {
|
|
857
|
+
try {
|
|
858
|
+
const impact = await analyzePluginConfigMutationImpact({ plugin: options.plugin, scope: options.scope,
|
|
859
|
+
platform: options.platform, cwd: options.cwd, env: options.env, visibleTargets: [],
|
|
860
|
+
commandDiscovery: { packages: [], errors: [] }, referencePlugins: options.rebuildRuntime?.referencePlugins,
|
|
861
|
+
mutation: { kind: 'reset' } });
|
|
862
|
+
warnings.push(...impact.referenceWarnings ?? [], ...(impact.referenceBlockers ?? []).map(formatPluginConfigReferenceBlocker));
|
|
648
863
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
overallState: 'partial',
|
|
652
|
-
targetResults: [],
|
|
653
|
-
applySkippedReason: 'invalidConfig',
|
|
654
|
-
};
|
|
864
|
+
catch {
|
|
865
|
+
warnings.push('Configuration references could not be checked. Reset will still clear the selected layer.');
|
|
655
866
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
env: options.env
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
plugin: schemaAccess.plugin,
|
|
678
|
-
scope: options.scope,
|
|
679
|
-
cwd: options.cwd,
|
|
680
|
-
env: options.env ?? process.env,
|
|
681
|
-
applyTargets: options.applyTargets,
|
|
682
|
-
nativeCliRunner: options.nativeCliRunner,
|
|
683
|
-
reinstallCommandImpl: options.reinstallCommandImpl,
|
|
684
|
-
rebuildRuntime: options.rebuildRuntime,
|
|
685
|
-
discovered,
|
|
686
|
-
});
|
|
867
|
+
}
|
|
868
|
+
let reset;
|
|
869
|
+
try {
|
|
870
|
+
reset = await resetPluginConfigStore({ ...identity, pluginName, scope: 'user', platform: options.platform,
|
|
871
|
+
cwd: options.cwd, env: options.env });
|
|
872
|
+
}
|
|
873
|
+
catch (error) {
|
|
874
|
+
throw markConfigWriteFailed(error);
|
|
875
|
+
}
|
|
876
|
+
let effective;
|
|
877
|
+
let schema;
|
|
878
|
+
if (options.plugin) {
|
|
879
|
+
try {
|
|
880
|
+
schema = (await resolvePluginConfigSchemaAccess({ pluginName, currentPlugin: options.plugin,
|
|
881
|
+
scope: options.scope, platform: options.platform, cwd: options.cwd, env: options.env })).schema;
|
|
882
|
+
effective = summarizeEffectivePluginConfig(await resolveEffectivePluginConfig({ ...identity, pluginName,
|
|
883
|
+
manifest: options.plugin.manifest, platform: options.platform, targetScope: options.scope, cwd: options.cwd,
|
|
884
|
+
env: options.env, referencePlugins: options.rebuildRuntime?.referencePlugins }));
|
|
885
|
+
}
|
|
886
|
+
catch {
|
|
887
|
+
warnings.push('The cleared configuration cannot be previewed. Check its schema and references before applying it.');
|
|
687
888
|
}
|
|
688
889
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
warnings
|
|
696
|
-
return {
|
|
697
|
-
plugin: pluginName,
|
|
698
|
-
scope: options.scope,
|
|
699
|
-
...(schemaAccess?.schema ? { schema: schemaAccess.schema } : {}),
|
|
700
|
-
existed: reset.existed,
|
|
701
|
-
deleted: reset.deleted,
|
|
702
|
-
resetDisposition: reset.resetDisposition,
|
|
703
|
-
...(reset.quarantineBasename ? { quarantineBasename: reset.quarantineBasename } : {}),
|
|
704
|
-
removedKeys,
|
|
705
|
-
...(effective ? { effective } : {}),
|
|
706
|
-
configWrite: 'succeeded',
|
|
707
|
-
overallState: applied.overallState,
|
|
708
|
-
targetResults: applied.targetResults,
|
|
709
|
-
...(applied.applySkippedReason ? { applySkippedReason: applied.applySkippedReason } : {}),
|
|
710
|
-
otherProjectsRequireReinstall,
|
|
711
|
-
warnings,
|
|
712
|
-
};
|
|
890
|
+
if (reset.existed)
|
|
891
|
+
warnings.push(...otherProjectsWarning('user'));
|
|
892
|
+
return { plugin: pluginName, scope: 'user', context: options.scope, platform: options.platform, schema,
|
|
893
|
+
existed: reset.existed, deleted: reset.deleted, resetDisposition: reset.resetDisposition,
|
|
894
|
+
...(reset.quarantineBasename ? { quarantineBasename: reset.quarantineBasename } : {}), removedKeys, effective,
|
|
895
|
+
configWrite: 'succeeded', overallState: 'succeeded', apply: skippedApply(reset.existed ? 'notRequested' : 'noConfigChange'),
|
|
896
|
+
otherProjectsMayRequireSync: reset.existed, warnings };
|
|
713
897
|
}
|
|
714
898
|
export async function resetPluginConfigWithHelper(options) {
|
|
899
|
+
if (options.context)
|
|
900
|
+
await resolveWorkContext({ cwd: options.cwd, context: options.context });
|
|
715
901
|
assertSafePluginConfigSegment(options.pluginName);
|
|
716
902
|
return withAwHomeMutationLock({
|
|
717
903
|
env: options.env,
|
|
718
904
|
token: options.awHomeMutationToken,
|
|
719
905
|
action: async (awHomeMutationToken) => {
|
|
720
906
|
await options.reviewPreflight?.();
|
|
721
|
-
|
|
722
|
-
...options,
|
|
723
|
-
|
|
724
|
-
|
|
907
|
+
const layerError = options.plugin && options.apply
|
|
908
|
+
? await observeConfigLayerError({ ...options, plugin: options.plugin }) : undefined;
|
|
909
|
+
const selection = layerError ? undefined : await prepareConfigMutationApplySelection({ ...options, awHomeMutationToken });
|
|
910
|
+
const saved = await resetPluginConfigWithHelperUnlocked({ ...options, scope: options.context ?? options.scope,
|
|
911
|
+
apply: false, awHomeMutationToken, rebuildRuntime: { ...options.rebuildRuntime, awHomeMutationToken } });
|
|
912
|
+
if (options.apply !== true)
|
|
913
|
+
return saved;
|
|
914
|
+
if (layerError)
|
|
915
|
+
return { ...saved, overallState: 'partial', apply: configApplyLayerFailure(layerError) };
|
|
916
|
+
if (!options.plugin) {
|
|
917
|
+
const apply = unavailableApply('sourceUnavailable', 'source');
|
|
918
|
+
const cause = configActiveAvailabilityError(options.pluginError);
|
|
919
|
+
return { ...saved, overallState: 'partial', apply: cause ? { ...apply, error: { stage: 'source', ...cause } } : apply };
|
|
920
|
+
}
|
|
921
|
+
if (saved.apply.state === 'skipped' && saved.apply.reason === 'noConfigChange')
|
|
922
|
+
return saved;
|
|
923
|
+
if (selection?.skipReason)
|
|
924
|
+
return { ...saved, apply: skippedApply(selection.skipReason) };
|
|
925
|
+
const applied = await applyPluginConfig({ ...options, ...selection, plugin: options.plugin, awHomeMutationToken })
|
|
926
|
+
.catch((error) => {
|
|
927
|
+
if (error instanceof ConfigApplyInterruptedError)
|
|
928
|
+
error.configWrite = 'succeeded';
|
|
929
|
+
throw error;
|
|
725
930
|
});
|
|
931
|
+
return { ...saved, overallState: applied.overallState, apply: applied.apply };
|
|
726
932
|
},
|
|
727
933
|
});
|
|
728
934
|
}
|
|
@@ -733,6 +939,8 @@ export async function describeResetAffectedFields(options) {
|
|
|
733
939
|
plugin: options.plugin,
|
|
734
940
|
...(options.pluginError ? { pluginError: options.pluginError } : {}),
|
|
735
941
|
scope: options.scope,
|
|
942
|
+
context: options.context,
|
|
943
|
+
platform: options.platform,
|
|
736
944
|
cwd: options.cwd,
|
|
737
945
|
env: options.env,
|
|
738
946
|
});
|
|
@@ -742,7 +950,8 @@ export async function describeResetAffectedFields(options) {
|
|
|
742
950
|
kind: field.kind,
|
|
743
951
|
reserved: field.reserved,
|
|
744
952
|
action: 'reset',
|
|
745
|
-
scope:
|
|
953
|
+
scope: 'user',
|
|
954
|
+
platform: options.platform,
|
|
746
955
|
valueState: field.valueState,
|
|
747
956
|
}));
|
|
748
957
|
}
|
|
@@ -751,12 +960,15 @@ export async function describeResetAffectedFields(options) {
|
|
|
751
960
|
...(options.plugin?.sourceId ? {
|
|
752
961
|
sourceId: options.plugin.sourceId,
|
|
753
962
|
sourceIdentity: options.plugin.sourceIdentity,
|
|
963
|
+
logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
754
964
|
} : options.sourceId ? {
|
|
755
965
|
sourceId: options.sourceId,
|
|
756
966
|
sourceIdentity: options.sourceIdentity,
|
|
967
|
+
logicalIdentity: options.logicalIdentity,
|
|
757
968
|
} : {}),
|
|
758
969
|
pluginName: options.pluginName,
|
|
759
|
-
scope:
|
|
970
|
+
scope: 'user',
|
|
971
|
+
platform: options.platform,
|
|
760
972
|
cwd: options.cwd,
|
|
761
973
|
env: options.env,
|
|
762
974
|
});
|
|
@@ -766,7 +978,8 @@ export async function describeResetAffectedFields(options) {
|
|
|
766
978
|
kind: 'manifest',
|
|
767
979
|
reserved: false,
|
|
768
980
|
action: 'reset',
|
|
769
|
-
scope:
|
|
981
|
+
scope: 'user',
|
|
982
|
+
platform: options.platform,
|
|
770
983
|
}));
|
|
771
984
|
}
|
|
772
985
|
}
|