@lesliechan721/aw 0.1.0-beta.73 → 0.1.0-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring/assets/aw-runtime-config.mjs +65 -43
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
- package/dist/authoring/scripts/add-skill.mjs +5 -14
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +4 -28
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +2 -2
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +0 -1
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +234 -1422
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
- package/dist/scripts/aw-skill-eval-materializer.js +19 -80
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.js +6 -8
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +2 -2
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/dependency-operation-plan.js +3 -3
- package/dist/src/commands/dependency-operation-plan.js.map +1 -1
- package/dist/src/commands/deployment-confirmation.d.ts +4 -0
- package/dist/src/commands/deployment-confirmation.js +20 -0
- package/dist/src/commands/deployment-confirmation.js.map +1 -0
- package/dist/src/commands/managed-commands.js +4 -2
- package/dist/src/commands/managed-commands.js.map +1 -1
- package/dist/src/commands/offline-cleanup-evidence.d.ts +3 -1
- package/dist/src/commands/offline-cleanup-evidence.js +9 -4
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +6 -0
- package/dist/src/commands/operation-plan.js +29 -2
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/options.d.ts +6 -2
- package/dist/src/commands/options.js +5 -4
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +29 -41
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.js +5 -5
- package/dist/src/commands/public-config-confirmation.js.map +1 -1
- package/dist/src/commands/public-lifecycle-result.d.ts +47 -0
- package/dist/src/commands/public-lifecycle-result.js +125 -4
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.d.ts +1 -0
- package/dist/src/commands/public-lifecycle.js +15 -2
- package/dist/src/commands/public-lifecycle.js.map +1 -1
- package/dist/src/commands/public-plugin-query.d.ts +1 -0
- package/dist/src/commands/public-plugin-query.js +27 -8
- package/dist/src/commands/public-plugin-query.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +12 -11
- package/dist/src/commands/rebuild-command.js +531 -769
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +21 -43
- package/dist/src/commands/rebuild-integration.js +306 -3600
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +13 -0
- package/dist/src/commands/rebuild-operations.js +60 -15
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +60 -0
- package/dist/src/commands/rebuild-platform-integration.js +1264 -0
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
- package/dist/src/commands/review-inspection.js +41 -4
- package/dist/src/commands/review-inspection.js.map +1 -1
- package/dist/src/commands/review-preparation.d.ts +2 -0
- package/dist/src/commands/review-preparation.js +23 -60
- package/dist/src/commands/review-preparation.js.map +1 -1
- package/dist/src/commands/skill-eval.js +1 -0
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +3 -1
- package/dist/src/commands/status-v6.js +24 -15
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/commands/targets-command.d.ts +9 -0
- package/dist/src/commands/targets-command.js +57 -6
- package/dist/src/commands/targets-command.js.map +1 -1
- package/dist/src/commands/write-commands.js +43 -28
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +2 -2
- package/dist/src/constants.js +2 -2
- package/dist/src/constants.js.map +1 -1
- package/dist/src/generators/local-plugin.js +59 -248
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.js +40 -14
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/command-receipt.d.ts +1 -1
- package/dist/src/output/command-receipt.js +3 -1
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/native-consent.d.ts +2 -0
- package/dist/src/output/native-consent.js +5 -0
- package/dist/src/output/native-consent.js.map +1 -0
- package/dist/src/output/public-result.js +72 -0
- package/dist/src/output/public-result.js.map +1 -1
- package/dist/src/output/rebuild-progress.js +5 -5
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.js +19 -2
- package/dist/src/output/receipt-projection.js.map +1 -1
- package/dist/src/platforms/capabilities.d.ts +10 -0
- package/dist/src/platforms/capabilities.js +158 -0
- package/dist/src/platforms/capabilities.js.map +1 -0
- package/dist/src/platforms/contracts.d.ts +351 -0
- package/dist/src/platforms/contracts.js +2 -0
- package/dist/src/platforms/contracts.js.map +1 -0
- package/dist/src/platforms/cursor-workspace-hook.d.ts +22 -0
- package/dist/src/platforms/cursor-workspace-hook.js +185 -0
- package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
- package/dist/src/platforms/discovery.d.ts +80 -0
- package/dist/src/platforms/discovery.js +604 -0
- package/dist/src/platforms/discovery.js.map +1 -0
- package/dist/src/platforms/gemini-activation.d.ts +36 -0
- package/dist/src/platforms/gemini-activation.js +331 -0
- package/dist/src/platforms/gemini-activation.js.map +1 -0
- package/dist/src/platforms/gemini-consent.d.ts +8 -0
- package/dist/src/platforms/gemini-consent.js +79 -0
- package/dist/src/platforms/gemini-consent.js.map +1 -0
- package/dist/src/platforms/identity.d.ts +4 -0
- package/dist/src/platforms/identity.js +22 -0
- package/dist/src/platforms/identity.js.map +1 -0
- package/dist/src/platforms/inspection-grok.d.ts +4 -0
- package/dist/src/platforms/inspection-grok.js +204 -0
- package/dist/src/platforms/inspection-grok.js.map +1 -0
- package/dist/src/platforms/inspection-native.d.ts +6 -0
- package/dist/src/platforms/inspection-native.js +401 -0
- package/dist/src/platforms/inspection-native.js.map +1 -0
- package/dist/src/platforms/inspection-opencode.d.ts +4 -0
- package/dist/src/platforms/inspection-opencode.js +97 -0
- package/dist/src/platforms/inspection-opencode.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +3 -0
- package/dist/src/platforms/inspection-pi.js +287 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection-query.d.ts +5 -0
- package/dist/src/platforms/inspection-query.js +36 -0
- package/dist/src/platforms/inspection-query.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +13 -0
- package/dist/src/platforms/inspection.js +180 -0
- package/dist/src/platforms/inspection.js.map +1 -0
- package/dist/src/platforms/layout.d.ts +21 -0
- package/dist/src/platforms/layout.js +239 -0
- package/dist/src/platforms/layout.js.map +1 -0
- package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
- package/dist/src/platforms/lifecycle-native-services.js +147 -0
- package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
- package/dist/src/platforms/lifecycle-native.d.ts +13 -0
- package/dist/src/platforms/lifecycle-native.js +276 -0
- package/dist/src/platforms/lifecycle-native.js.map +1 -0
- package/dist/src/platforms/lifecycle.d.ts +25 -0
- package/dist/src/platforms/lifecycle.js +470 -0
- package/dist/src/platforms/lifecycle.js.map +1 -0
- package/dist/src/platforms/managed-command-placement.d.ts +8 -0
- package/dist/src/platforms/managed-command-placement.js +79 -0
- package/dist/src/platforms/managed-command-placement.js.map +1 -0
- package/dist/src/platforms/projection-code-extension.d.ts +8 -0
- package/dist/src/platforms/projection-code-extension.js +121 -0
- package/dist/src/platforms/projection-code-extension.js.map +1 -0
- package/dist/src/platforms/projection-command-resources.d.ts +7 -0
- package/dist/src/platforms/projection-command-resources.js +74 -0
- package/dist/src/platforms/projection-command-resources.js.map +1 -0
- package/dist/src/platforms/projection-files.d.ts +27 -0
- package/dist/src/platforms/projection-files.js +111 -0
- package/dist/src/platforms/projection-files.js.map +1 -0
- package/dist/src/platforms/projection-marketplace.d.ts +19 -0
- package/dist/src/platforms/projection-marketplace.js +42 -0
- package/dist/src/platforms/projection-marketplace.js.map +1 -0
- package/dist/src/platforms/projection.d.ts +10 -0
- package/dist/src/platforms/projection.js +446 -0
- package/dist/src/platforms/projection.js.map +1 -0
- package/dist/src/platforms/registry.d.ts +4 -0
- package/dist/src/platforms/registry.js +30 -0
- package/dist/src/platforms/registry.js.map +1 -0
- package/dist/src/platforms/supplement-layout.d.ts +16 -0
- package/dist/src/platforms/supplement-layout.js +31 -0
- package/dist/src/platforms/supplement-layout.js.map +1 -0
- package/dist/src/portable/commands.d.ts +7 -5
- package/dist/src/portable/commands.js +6 -1
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +8 -6
- package/dist/src/portable/materializer.js +47 -245
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.js +2 -15
- package/dist/src/portable/recovery-layout.js.map +1 -1
- package/dist/src/portable/recovery.d.ts +10 -1
- package/dist/src/portable/recovery.js +34 -8
- package/dist/src/portable/recovery.js.map +1 -1
- package/dist/src/recovery/coordinator.d.ts +4 -7
- package/dist/src/recovery/coordinator.js +151 -119
- package/dist/src/recovery/coordinator.js.map +1 -1
- package/dist/src/recovery/demand.d.ts +1 -1
- package/dist/src/recovery/demand.js +10 -42
- package/dist/src/recovery/demand.js.map +1 -1
- package/dist/src/recovery/joint-coordinator.js +112 -52
- package/dist/src/recovery/joint-coordinator.js.map +1 -1
- package/dist/src/recovery/joint-demand.d.ts +4 -22
- package/dist/src/recovery/joint-demand.js +51 -40
- package/dist/src/recovery/joint-demand.js.map +1 -1
- package/dist/src/recovery/receipt.d.ts +23 -8
- package/dist/src/recovery/retirement.d.ts +1 -1
- package/dist/src/recovery/retirement.js +131 -29
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.d.ts +13 -6
- package/dist/src/recovery/status.js +483 -79
- package/dist/src/recovery/status.js.map +1 -1
- package/dist/src/recovery/types.d.ts +3 -3
- package/dist/src/review/platform-profile.d.ts +3 -0
- package/dist/src/review/platform-profile.js +16 -0
- package/dist/src/review/platform-profile.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +1 -0
- package/dist/src/review/review-profile.js +8 -2
- package/dist/src/review/review-profile.js.map +1 -1
- package/dist/src/review/review-selection.d.ts +2 -11
- package/dist/src/review/review-selection.js +97 -71
- package/dist/src/review/review-selection.js.map +1 -1
- package/dist/src/review/review-types.d.ts +3 -0
- package/dist/src/review/review-types.js.map +1 -1
- package/dist/src/review/skill-materialization.d.ts +44 -9
- package/dist/src/review/skill-materialization.js +112 -136
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/review/source-binding.d.ts +8 -5
- package/dist/src/review/source-binding.js +99 -41
- package/dist/src/review/source-binding.js.map +1 -1
- package/dist/src/tui/agent-management.js +112 -10
- package/dist/src/tui/agent-management.js.map +1 -1
- package/dist/src/tui/agent-settings.d.ts +3 -0
- package/dist/src/tui/agent-settings.js +10 -11
- package/dist/src/tui/agent-settings.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +58 -20
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/content-item-card.js +2 -2
- package/dist/src/tui/content-item-card.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +198 -152
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +5 -9
- package/dist/src/tui/controller.js +40 -18
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/deployment-view.d.ts +10 -0
- package/dist/src/tui/deployment-view.js +103 -0
- package/dist/src/tui/deployment-view.js.map +1 -0
- package/dist/src/tui/glossary.js +4 -4
- package/dist/src/tui/glossary.js.map +1 -1
- package/dist/src/tui/model.d.ts +5 -0
- package/dist/src/tui/model.js +73 -12
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.js +2 -1
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
- package/dist/src/tui/operation-history.d.ts +5 -4
- package/dist/src/tui/operation-history.js.map +1 -1
- package/dist/src/tui/operation-review-planner.d.ts +7 -2
- package/dist/src/tui/operation-review-planner.js +97 -42
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-content.d.ts +5 -3
- package/dist/src/tui/plugin-content.js +70 -508
- package/dist/src/tui/plugin-content.js.map +1 -1
- package/dist/src/tui/plugin-detail.d.ts +3 -2
- package/dist/src/tui/plugin-detail.js +33 -25
- package/dist/src/tui/plugin-detail.js.map +1 -1
- package/dist/src/tui/scoped-inventory.d.ts +10 -6
- package/dist/src/tui/scoped-inventory.js +34 -1
- package/dist/src/tui/scoped-inventory.js.map +1 -1
- package/dist/src/types.d.ts +4 -63
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +10 -4
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +26 -2
- package/dist/src/utils/artifact-plan.js +113 -489
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +100 -93
- package/dist/src/utils/artifact-renderer.js +173 -346
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +21 -11
- package/dist/src/utils/artifact-request.js +56 -80
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +30 -146
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-digests.d.ts +2 -12
- package/dist/src/utils/catalog-digests.js +0 -39
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-source-references.d.ts +7 -0
- package/dist/src/utils/catalog-source-references.js +234 -19
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/codex-config-observation.d.ts +19 -0
- package/dist/src/utils/codex-config-observation.js +145 -0
- package/dist/src/utils/codex-config-observation.js.map +1 -0
- package/dist/src/utils/codex-executable-discovery.d.ts +2 -0
- package/dist/src/utils/codex-executable-discovery.js +47 -13
- package/dist/src/utils/codex-executable-discovery.js.map +1 -1
- package/dist/src/utils/codex-manager.js +1 -1
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +3 -0
- package/dist/src/utils/codex-native-observation.js +53 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/codex-shared-native.d.ts +3 -1
- package/dist/src/utils/codex-shared-native.js +46 -5
- package/dist/src/utils/codex-shared-native.js.map +1 -1
- package/dist/src/utils/codex-skill-staging.d.ts +4 -3
- package/dist/src/utils/codex-skill-staging.js.map +1 -1
- package/dist/src/utils/codex-surface-analysis.d.ts +5 -2
- package/dist/src/utils/codex-surface-analysis.js +28 -57
- package/dist/src/utils/codex-surface-analysis.js.map +1 -1
- package/dist/src/utils/component-command-preparation.d.ts +34 -0
- package/dist/src/utils/component-command-preparation.js +228 -0
- package/dist/src/utils/component-command-preparation.js.map +1 -0
- package/dist/src/utils/component-resources.d.ts +43 -0
- package/dist/src/utils/component-resources.js +304 -0
- package/dist/src/utils/component-resources.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +17 -6
- package/dist/src/utils/dynamic-skill-tree.js +7 -3
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +11 -44
- package/dist/src/utils/local-marketplace.js +11 -638
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-evidence.d.ts +2 -2
- package/dist/src/utils/managed-command-evidence.js +5 -81
- package/dist/src/utils/managed-command-evidence.js.map +1 -1
- package/dist/src/utils/managed-command-materialization.d.ts +5 -2
- package/dist/src/utils/managed-command-materialization.js +35 -35
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-preparation.d.ts +67 -0
- package/dist/src/utils/managed-command-preparation.js +146 -0
- package/dist/src/utils/managed-command-preparation.js.map +1 -0
- package/dist/src/utils/managed-command-review.d.ts +26 -0
- package/dist/src/utils/managed-command-review.js +68 -0
- package/dist/src/utils/managed-command-review.js.map +1 -0
- package/dist/src/utils/managed-command-store.js +26 -15
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +23 -0
- package/dist/src/utils/native-cli.js +51 -2
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +20 -1
- package/dist/src/utils/native-demand.js.map +1 -1
- package/dist/src/utils/native-tool-review.d.ts +3 -6
- package/dist/src/utils/native-tool-review.js +25 -11
- package/dist/src/utils/native-tool-review.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +26 -3
- package/dist/src/utils/ownership.js +95 -9
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -1
- package/dist/src/utils/paths.js +2 -0
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +46 -0
- package/dist/src/utils/platform-empty-state.js +123 -0
- package/dist/src/utils/platform-empty-state.js.map +1 -0
- package/dist/src/utils/plugin-config-impact.d.ts +17 -11
- package/dist/src/utils/plugin-config-impact.js +46 -62
- package/dist/src/utils/plugin-config-impact.js.map +1 -1
- package/dist/src/utils/plugin-config-write.js +52 -53
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +0 -2
- package/dist/src/utils/plugin-config.js +0 -6
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-dependencies.d.ts +1 -1
- package/dist/src/utils/plugin-dependencies.js.map +1 -1
- package/dist/src/utils/plugin-scripts.d.ts +4 -0
- package/dist/src/utils/plugin-scripts.js +11 -0
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +5 -7
- package/dist/src/utils/runtime-config.js +12 -25
- package/dist/src/utils/runtime-config.js.map +1 -1
- package/dist/src/utils/windows-npm-shim.js +19 -2
- package/dist/src/utils/windows-npm-shim.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/utils/claude-native-render-receipt.d.ts +0 -14
- package/dist/src/utils/claude-native-render-receipt.js +0 -26
- package/dist/src/utils/claude-native-render-receipt.js.map +0 -1
- package/dist/src/utils/claude-skills-root.d.ts +0 -8
- package/dist/src/utils/claude-skills-root.js +0 -87
- package/dist/src/utils/claude-skills-root.js.map +0 -1
- package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
- package/dist/src/utils/codex-native-render-receipt.js +0 -205
- package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
- package/dist/src/utils/slash-commands.d.ts +0 -1
- package/dist/src/utils/slash-commands.js +0 -2
- package/dist/src/utils/slash-commands.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { readAgentSettings, previewAgentSettings, saveAgentSettings } from './agent-settings.js';
|
|
2
|
-
import { selectPluginConfigProfile, getPluginConfigReferenceChoices, PLATFORM_TARGETS, resolveSupportedPlatforms } from '@lesliechan721/aw-plugin-core';
|
|
2
|
+
import { selectPluginConfigProfile, getPluginConfigReferenceChoices, PLATFORM_TARGETS, NATIVE_PLATFORM_TARGETS, resolveSupportedPlatforms } from '@lesliechan721/aw-plugin-core';
|
|
3
3
|
import { configReferenceKey, configReferenceScalars } from './config-references.js';
|
|
4
4
|
import crypto from 'node:crypto';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
+
import { managedCommandRecoveryPlanChanges } from './operation-review-planner.js';
|
|
6
7
|
import { resolveWorkContext } from '../intent/work-context.js';
|
|
7
|
-
import { flattenStatusTargets,
|
|
8
|
+
import { flattenStatusTargets, statusTargetHasLiveConfigConsumer, } from '../commands/status-v6.js';
|
|
8
9
|
import { addCatalogSourceCommand, listCatalogSources, preflightCatalogSourceMutation, removeCatalogSourceCommand, setPrimaryCatalogSourceCommand, updateCatalogSourceCommand, } from '../commands/catalog-source.js';
|
|
9
10
|
import { parseScriptTimeoutMs, SCRIPT_TIMEOUT_DEFAULT_MS, } from '../commands/options.js';
|
|
10
11
|
import { readCliPackageInfo } from '../utils/local-marketplace.js';
|
|
@@ -12,15 +13,17 @@ import { readCatalogSourcesConfigSnapshot, recoverInvalidCatalogSourcesConfig, }
|
|
|
12
13
|
import { withResolvedCatalogPlugin, withResolvedMultiSourceCatalog, formatPluginId, parsePluginId, } from '../utils/multi-source-catalog.js';
|
|
13
14
|
import { coercePluginConfigUpdates, inspectPluginConfigResetTarget, listNamespacedPluginConfigStoreIdentities, readPluginConfigStore, replacePluginConfigStoreLayer, resolveConfigRead, resolveEffectivePluginConfig, resolveEffectivePluginConfigFromStores, resolvePluginConfigReferenceContext, } from '../utils/plugin-config.js';
|
|
14
15
|
import { readRecoveryStatus } from '../recovery/status.js';
|
|
16
|
+
import { readJointDemand } from '../recovery/joint-demand.js';
|
|
17
|
+
import { catalogSourceErrorCode, sanitizeCatalogSourceError } from '../utils/catalog-public-error.js';
|
|
15
18
|
import { activateRecoverySourcesAndReprepare, prepareRecovery, executeRecovery, } from '../recovery/coordinator.js';
|
|
16
19
|
import { prepareRetire, executeRetire } from '../recovery/retirement.js';
|
|
17
20
|
import { prepareTargetsPlan, executeTargetsPlan, prepareIntentPlan, executeIntentPlan } from './scoped-flow.js';
|
|
18
21
|
import { applyPluginConfigWrite, applyPluginConfig, preparePluginConfigApply, disposePluginConfigApply, resolveConfigPreApplyAuthorization, resetPluginConfigWithHelper, } from '../utils/plugin-config-write.js';
|
|
19
|
-
import { analyzePluginConfigMutationImpact, discoverPluginConfigManagedCommandPackages, pluginConfigTargetRenderScopes,
|
|
22
|
+
import { analyzePluginConfigMutationImpact, discoverPluginConfigManagedCommandPackages, pluginConfigTargetRenderScopes, pluginSharedNativeConfigRenderUnits } from '../utils/plugin-config-impact.js';
|
|
20
23
|
import { collectPluginConfigReferenceEvidence, pluginConfigHasExternalReferences, resolvePluginConfigReferenceConsumers, resolvePluginConfigReferencePlugins } from '../utils/plugin-config-references.js';
|
|
21
24
|
import { inventoryCatalogSourceReferences } from '../utils/catalog-source-references.js';
|
|
22
25
|
import { operationEvidenceMatches, operationEvidenceFingerprint, TuiConfigInvalidStoreError, TuiController, TuiOperationBlockedError, } from './controller.js';
|
|
23
|
-
import { buildConfigPage,
|
|
26
|
+
import { buildConfigPage, } from './model.js';
|
|
24
27
|
import { projectCatalogSourceLocation } from '../utils/catalog-source-presentation.js';
|
|
25
28
|
import { calculateCatalogSourceConfigFingerprint, calculateCatalogSourceIdentity, } from '../utils/catalog-source-identity.js';
|
|
26
29
|
import { checkAwCapabilitySupport, readPluginManifest } from '../utils/manifest.js';
|
|
@@ -66,12 +69,12 @@ async function loadPortablePluginIds(options) {
|
|
|
66
69
|
? item.resolution.manifest.entries.flatMap((entry) => {
|
|
67
70
|
const support = checkAwCapabilitySupport(entry.requires.aw.capabilities ?? [], IMPLEMENTED_AW_CAPABILITIES);
|
|
68
71
|
return support.supported
|
|
69
|
-
? [readPluginManifest(path.join(item.resolution.rootDir, 'plugins', entry.name), { mode: 'bundle' }).then((plugin) =>
|
|
72
|
+
? [readPluginManifest(path.join(item.resolution.rootDir, 'plugins', entry.name), { mode: 'bundle' }).then((plugin) => resolveSupportedPlatforms(plugin.manifest).has('generic')
|
|
70
73
|
? formatPluginId({
|
|
71
74
|
sourceId: item.resolution.sourceId,
|
|
72
75
|
pluginName: entry.name,
|
|
73
76
|
})
|
|
74
|
-
: null)]
|
|
77
|
+
: null).catch(() => { options.signal.throwIfAborted(); return null; })]
|
|
75
78
|
: [];
|
|
76
79
|
})
|
|
77
80
|
: []))).filter((pluginId) => pluginId !== null),
|
|
@@ -131,15 +134,104 @@ export function configAffectedStatusTargets(targets, pluginId, configContext, co
|
|
|
131
134
|
.sort((left, right) => `${left.pluginId}\0${left.platform}\0${left.scope}`
|
|
132
135
|
.localeCompare(`${right.pluginId}\0${right.platform}\0${right.scope}`, 'en'));
|
|
133
136
|
}
|
|
137
|
+
function currentConfigTargets(status, pluginId, configContext, consumers = [], platform) {
|
|
138
|
+
const selected = new Set([pluginId, ...consumers]);
|
|
139
|
+
const observations = [...(status.observedTargets ?? []), ...(status.inventory ?? []).flatMap((root) => root.targetResults)];
|
|
140
|
+
return [...new Map((status.existingTargets ?? []).flatMap((target) => {
|
|
141
|
+
if (target.agent === 'generic' || !selected.has(target.pluginId)
|
|
142
|
+
|| configContext === 'user' && target.scope !== 'user'
|
|
143
|
+
|| platform && target.agent !== platform)
|
|
144
|
+
return [];
|
|
145
|
+
return [{ pluginId: target.pluginId, pluginName: parsePluginId(target.pluginId).pluginName,
|
|
146
|
+
platform: target.agent, scope: target.scope,
|
|
147
|
+
observation: observations.find((item) => item.pluginId === target.pluginId
|
|
148
|
+
&& item.agent === target.agent && item.scope === target.scope) }];
|
|
149
|
+
}).map((target) => [`${target.pluginId}\0${target.platform}\0${target.scope}`, target])).values()]
|
|
150
|
+
.sort((left, right) => `${left.pluginId}\0${left.platform}\0${left.scope}`.localeCompare(`${right.pluginId}\0${right.platform}\0${right.scope}`, 'en'));
|
|
151
|
+
}
|
|
152
|
+
function currentTargetFingerprint(status, targets) {
|
|
153
|
+
return digest({ intent: status.intent, selection: status.selection, targets: targets.map((target) => ({
|
|
154
|
+
pluginId: target.pluginId, platform: target.platform, scope: target.scope,
|
|
155
|
+
observation: target.observation ? { observation: target.observation.observation,
|
|
156
|
+
content: target.observation.content, blockers: target.observation.blockers,
|
|
157
|
+
expectedVersion: target.observation.expectedVersion, installedVersion: target.observation.installedVersion,
|
|
158
|
+
deployments: target.observation.deploymentObservations,
|
|
159
|
+
exclusions: target.observation.deploymentExclusions,
|
|
160
|
+
gaps: target.observation.componentGaps } : null,
|
|
161
|
+
})) });
|
|
162
|
+
}
|
|
163
|
+
function scopedCurrentStatus(status, snapshot, scope) {
|
|
164
|
+
const demand = scope === 'project' ? snapshot.project : snapshot.user;
|
|
165
|
+
const inventory = demand.roots === null ? null : demand.roots.map((root) => ({
|
|
166
|
+
pluginId: root.pluginId, source: root.sourceId, sourceState: root.sourceState,
|
|
167
|
+
blockers: root.blockers.map((code) => ({ code, message: `来源需要处理:${code}。` })),
|
|
168
|
+
targetResults: (status.inventory ?? []).filter((entry) => entry.pluginId === root.pluginId)
|
|
169
|
+
.flatMap((entry) => entry.targetResults.filter((target) => target.scope === scope)),
|
|
170
|
+
}));
|
|
171
|
+
const targets = inventory?.flatMap((root) => root.targetResults) ?? [];
|
|
172
|
+
const counts = { blocked: targets.filter((target) => target.blockers.length > 0).length,
|
|
173
|
+
pending: targets.filter((target) => ['absent', 'drifted'].includes(target.content ?? '')).length,
|
|
174
|
+
unconfirmed: targets.filter((target) => target.content === 'unknown').length,
|
|
175
|
+
ready: targets.filter((target) => target.content === 'satisfied').length };
|
|
176
|
+
return { ...status, scope, intent: { state: demand.intent.state,
|
|
177
|
+
...('digest' in demand.intent ? { digest: demand.intent.digest } : {}) }, inventory, counts,
|
|
178
|
+
extraObserved: status.extraObserved.filter((target) => target.scope === scope),
|
|
179
|
+
allSatisfied: counts.blocked || counts.pending ? false : counts.unconfirmed || inventory === null
|
|
180
|
+
|| !['valid', 'absent'].includes(demand.intent.state) ? null : true };
|
|
181
|
+
}
|
|
182
|
+
/** Source metadata only. Actual installation facts are supplied by RecoveryStatus. */
|
|
183
|
+
async function loadCatalogView(options) {
|
|
184
|
+
return withResolvedMultiSourceCatalog({ cliVersion: options.cliVersion, env: options.context.env,
|
|
185
|
+
signal: options.signal, operationContext: options.catalogOperationContext,
|
|
186
|
+
consume: async (catalog) => ({
|
|
187
|
+
payload: { schemaVersion: 8, catalog: { primarySourceId: catalog.primarySourceId,
|
|
188
|
+
configDigest: catalog.configDigest, compositeDigest: catalog.compositeDigest,
|
|
189
|
+
...(options.catalogOperationContext ? { generationSetDigest: options.catalogOperationContext.generationSetDigest } : {}),
|
|
190
|
+
sources: catalog.sources.map((item) => ({ id: item.sourceId,
|
|
191
|
+
identity: item.resolution?.sourceIdentity ?? '', type: item.resolution?.transport ?? 'path',
|
|
192
|
+
primary: item.sourceId === catalog.primarySourceId,
|
|
193
|
+
requestedRef: item.resolution?.requestedRef ?? 'AW channel',
|
|
194
|
+
...(item.resolution ? { resolvedCommit: item.resolution.resolvedCommit,
|
|
195
|
+
catalogVersion: item.resolution.manifest.catalogVersion, channel: item.resolution.manifest.channel,
|
|
196
|
+
freshness: 'active' } : {}),
|
|
197
|
+
...(item.error ? { error: sanitizeCatalogSourceError(item.error).message, errorCode: catalogSourceErrorCode(item.error) } : {}), })) }, filters: { plugins: [], platform: 'both', cwd: options.context.cwd }, targets: [], errors: [] },
|
|
198
|
+
pluginSummaries: (await Promise.all(catalog.sources.flatMap((item) => item.resolution
|
|
199
|
+
? item.resolution.manifest.entries.map(async (entry) => {
|
|
200
|
+
const support = checkAwCapabilitySupport(entry.requires.aw.capabilities ?? [], IMPLEMENTED_AW_CAPABILITIES);
|
|
201
|
+
const metadata = { pluginName: entry.name,
|
|
202
|
+
pluginId: formatPluginId({ sourceId: item.sourceId, pluginName: entry.name }),
|
|
203
|
+
displayName: entry.interface?.displayName ?? entry.name, description: entry.description, version: entry.version };
|
|
204
|
+
// Future definitions may use a schema this CLI cannot parse. The source
|
|
205
|
+
// index is the boundary for deciding whether that definition can be read.
|
|
206
|
+
if (!support.supported)
|
|
207
|
+
return { ...metadata, missingCapabilities: support.missing };
|
|
208
|
+
try {
|
|
209
|
+
const manifest = await readPluginManifest(path.join(item.resolution.rootDir, 'plugins', entry.name), { mode: 'bundle' });
|
|
210
|
+
options.signal.throwIfAborted();
|
|
211
|
+
const platforms = [...resolveSupportedPlatforms(manifest.manifest)];
|
|
212
|
+
return { ...metadata, platforms, supportedTargets: Object.fromEntries(platforms.filter((platform) => platform !== 'generic')
|
|
213
|
+
.map((platform) => [platform, ['user', 'project']])),
|
|
214
|
+
configFieldCount: new Set(manifest.manifest.config ? [undefined, ...PLATFORM_TARGETS]
|
|
215
|
+
.flatMap((platform) => Object.keys(selectPluginConfigProfile(manifest.manifest.config, platform).fields)) : []).size,
|
|
216
|
+
...(manifest.manifest.config ? { configSchema: manifest.manifest.config.fields } : {}) };
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
options.signal.throwIfAborted();
|
|
220
|
+
return { ...metadata, definitionUnavailable: true };
|
|
221
|
+
}
|
|
222
|
+
}) : []))),
|
|
223
|
+
}),
|
|
224
|
+
});
|
|
225
|
+
}
|
|
134
226
|
function configNeedsReferencePlugins(plugin) {
|
|
135
227
|
return pluginConfigHasExternalReferences(plugin.manifest)
|
|
136
228
|
|| (plugin.manifest.config !== undefined && [undefined, ...PLATFORM_TARGETS].some((platform) => Object.values(selectPluginConfigProfile(plugin.manifest.config, platform).fields)
|
|
137
229
|
.some((field) => field.type === 'array' && field.items.type === 'object')));
|
|
138
230
|
}
|
|
139
|
-
async function
|
|
231
|
+
async function configRetrySharedNativeRenderUnits(plugin, targets, env, referencePlugins) {
|
|
140
232
|
const plugins = await resolvePluginConfigReferenceConsumers({ plugin, env, plugins: referencePlugins });
|
|
141
|
-
return plugins.flatMap((consumer) =>
|
|
142
|
-
&& target.platform ===
|
|
233
|
+
return plugins.flatMap((consumer) => pluginSharedNativeConfigRenderUnits(consumer).filter((shared) => targets.some((target) => (target.pluginName ?? plugin.manifest.name) === consumer.manifest.name
|
|
234
|
+
&& target.platform === shared.platform)));
|
|
143
235
|
}
|
|
144
236
|
async function configRetryStoreDigest(options) {
|
|
145
237
|
const plugins = await resolvePluginConfigReferencePlugins({ sourceId: options.plugin.sourceId,
|
|
@@ -290,7 +382,7 @@ async function loadDependencyOverviews(options) {
|
|
|
290
382
|
}),
|
|
291
383
|
});
|
|
292
384
|
const nodes = new Map(graph.nodes.map((node) => [node.pluginId, node]));
|
|
293
|
-
const summaryById = new Map(options.
|
|
385
|
+
const summaryById = new Map(options.pluginSummaries.map((summary) => [summary.pluginId, summary]));
|
|
294
386
|
const displayName = (pluginId) => nodes.get(pluginId)?.displayName
|
|
295
387
|
?? parsePluginId(pluginId).pluginName;
|
|
296
388
|
const reverse = new Map();
|
|
@@ -300,71 +392,52 @@ async function loadDependencyOverviews(options) {
|
|
|
300
392
|
}
|
|
301
393
|
}
|
|
302
394
|
const targetsByPlugin = new Map();
|
|
303
|
-
for (const target of
|
|
395
|
+
for (const target of options.status.observedTargets ?? []) {
|
|
304
396
|
targetsByPlugin.set(target.pluginId, [...(targetsByPlugin.get(target.pluginId) ?? []), target]);
|
|
305
397
|
}
|
|
306
|
-
const unsupportedPluginIds = new Set(options.
|
|
307
|
-
.filter((summary) => (summary.missingCapabilities?.length ?? 0) > 0)
|
|
398
|
+
const unsupportedPluginIds = new Set(options.pluginSummaries.filter((summary) => (summary.missingCapabilities?.length ?? 0) > 0)
|
|
308
399
|
.map((summary) => summary.pluginId));
|
|
309
|
-
const availableReferencesFor = (
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|| !nodes.get(consumerPluginId)?.dependencies.includes(dependencyPluginId))
|
|
316
|
-
return [];
|
|
317
|
-
return (targetsByPlugin.get(consumerPluginId) ?? []).flatMap((consumer) => {
|
|
318
|
-
if (!hasActualScopeEvidence(consumer)
|
|
319
|
-
|| consumer.sourceId !== consumerSourceId
|
|
320
|
-
|| consumer.sourceIdentity !== consumerNode?.sourceIdentity)
|
|
400
|
+
const availableReferencesFor = (rootId, dependencyId) => {
|
|
401
|
+
const references = (targetsByPlugin.get(dependencyId) ?? []).flatMap((dependency) => {
|
|
402
|
+
if (dependency.agent === 'generic' || dependency.content !== 'satisfied' || dependency.observation !== 'verified'
|
|
403
|
+
|| dependency.providerScope !== dependency.scope
|
|
404
|
+
|| !options.status.existingTargets?.some((item) => item.pluginId === dependencyId
|
|
405
|
+
&& item.agent === dependency.agent && item.scope === dependency.scope))
|
|
321
406
|
return [];
|
|
322
|
-
return
|
|
323
|
-
if (
|
|
324
|
-
|| component.key !== dependencyPluginId
|
|
325
|
-
|| component.state !== 'ready')
|
|
326
|
-
return [];
|
|
327
|
-
const platform = component.metadata?.platform;
|
|
328
|
-
const scope = component.metadata?.scope;
|
|
329
|
-
const project = component.metadata?.project;
|
|
330
|
-
if ((platform !== 'codex' && platform !== 'claude')
|
|
331
|
-
|| (scope !== 'user' && scope !== 'project')
|
|
332
|
-
|| project !== (scope === 'project' ? 'current' : 'none'))
|
|
407
|
+
return (dependency.contributions ?? []).flatMap((contribution) => {
|
|
408
|
+
if (contribution.root !== rootId || contribution.path.at(-1) !== dependencyId || contribution.path.length < 2)
|
|
333
409
|
return [];
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
&& target.sourceIdentity === dependencyNode?.sourceIdentity
|
|
338
|
-
&& target.sourceIdentity === consumer.sourceIdentity);
|
|
339
|
-
if (!dependency)
|
|
410
|
+
const parentId = contribution.path.at(-2);
|
|
411
|
+
if (!nodes.get(parentId)?.dependencies.includes(dependencyId)
|
|
412
|
+
|| nodes.get(parentId)?.sourceIdentity !== nodes.get(dependencyId)?.sourceIdentity)
|
|
340
413
|
return [];
|
|
341
|
-
return [
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
scope,
|
|
352
|
-
project: scope === 'project' ? 'current' : null,
|
|
353
|
-
},
|
|
354
|
-
}];
|
|
414
|
+
return (targetsByPlugin.get(parentId) ?? []).filter((consumer) => consumer.agent === dependency.agent
|
|
415
|
+
&& consumer.providerScope === consumer.scope
|
|
416
|
+
&& consumer.contributions?.some((entry) => entry.root === contribution.root && entry.scope === contribution.scope
|
|
417
|
+
&& JSON.stringify(entry.path) === JSON.stringify(contribution.path.slice(0, -1)))
|
|
418
|
+
&& options.status.existingTargets?.some((item) => item.pluginId === parentId && item.agent === consumer.agent && item.scope === consumer.scope))
|
|
419
|
+
.map((consumer) => ({ requirementScope: contribution.scope,
|
|
420
|
+
consumer: { pluginId: parentId, platform: dependency.agent, scope: consumer.scope,
|
|
421
|
+
project: consumer.scope === 'project' ? 'current' : null },
|
|
422
|
+
dependency: { pluginId: dependencyId, platform: dependency.agent, scope: dependency.scope,
|
|
423
|
+
project: dependency.scope === 'project' ? 'current' : null } }));
|
|
355
424
|
});
|
|
356
425
|
});
|
|
426
|
+
return [...new Map(references.map((reference) => [JSON.stringify(reference), reference])).values()];
|
|
357
427
|
};
|
|
358
|
-
const placementsFor = (pluginId) => {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
428
|
+
const placementsFor = (pluginId) => (targetsByPlugin.get(pluginId) ?? []).flatMap((target) => {
|
|
429
|
+
if (target.agent === 'generic')
|
|
430
|
+
return [];
|
|
431
|
+
const exists = options.status.existingTargets?.some((item) => item.pluginId === pluginId
|
|
432
|
+
&& item.agent === target.agent && item.scope === target.scope);
|
|
433
|
+
if (!exists)
|
|
434
|
+
return [{ platform: target.agent, state: 'notInstalled', supportedScopes: ['user', 'project'] }];
|
|
435
|
+
return [{ platform: target.agent, state: 'installed', scope: target.scope,
|
|
436
|
+
health: target.content === 'satisfied' && !target.blockers.length ? 'ready'
|
|
437
|
+
: target.blockers.length || target.content === 'conflict' ? 'error' : 'incomplete',
|
|
438
|
+
revision: { state: 'unknown', ...(target.expectedVersion ? { availableVersion: target.expectedVersion } : {}),
|
|
439
|
+
...(target.installedVersion ? { installedVersion: target.installedVersion } : {}) }, relation: target.relation === 'dependency' ? 'dependency' : 'root' }];
|
|
440
|
+
});
|
|
368
441
|
const aggregateFor = (pluginId, placements) => {
|
|
369
442
|
const sourceId = parsePluginId(pluginId).sourceId;
|
|
370
443
|
if (graph.sourceErrors.some((error) => error.sourceId === sourceId)
|
|
@@ -445,7 +518,7 @@ async function loadDependencyOverviews(options) {
|
|
|
445
518
|
availablePlacementReferences: availableReferencesFor(dependentId, pluginId),
|
|
446
519
|
};
|
|
447
520
|
});
|
|
448
|
-
const targetBlockers = (targetsByPlugin.get(pluginId) ?? []).flatMap((target) => target.
|
|
521
|
+
const targetBlockers = (targetsByPlugin.get(pluginId) ?? []).flatMap((target) => target.blockers.filter((error) => error.code.startsWith('dependency') || error.code === 'sourceChanged')
|
|
449
522
|
.map((error) => ({
|
|
450
523
|
code: error.code,
|
|
451
524
|
title: '依赖关系需要处理',
|
|
@@ -456,7 +529,7 @@ async function loadDependencyOverviews(options) {
|
|
|
456
529
|
const dependencyTargets = summaryById.get(dependency.pluginId)?.supportedTargets;
|
|
457
530
|
if (!consumerTargets || !dependencyTargets)
|
|
458
531
|
return true;
|
|
459
|
-
return
|
|
532
|
+
return NATIVE_PLATFORM_TARGETS.some((platform) => (consumerTargets[platform]?.length ?? 0) > 0 && (dependencyTargets[platform]?.length ?? 0) === 0);
|
|
460
533
|
});
|
|
461
534
|
const sourceId = parsePluginId(pluginId).sourceId;
|
|
462
535
|
const blockers = [
|
|
@@ -558,6 +631,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
558
631
|
const catalogOperationByEvidence = new WeakMap();
|
|
559
632
|
let sessionCatalogOperationContext;
|
|
560
633
|
let sessionStatusResult;
|
|
634
|
+
let sessionRecoveryStatus;
|
|
561
635
|
const sessionContextForPlugin = (pluginId) => {
|
|
562
636
|
const sourceId = parsePluginId(pluginId).sourceId;
|
|
563
637
|
if (!sourceId || !sessionCatalogOperationContext)
|
|
@@ -640,25 +714,23 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
640
714
|
if (catalogOperationContext)
|
|
641
715
|
sessionCatalogOperationContext = catalogOperationContext;
|
|
642
716
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
643
|
-
const result = await
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
cliVersion: packageInfo.version,
|
|
648
|
-
verbose: context.diagnostics.verbose,
|
|
649
|
-
...(catalogOperationContext ? { catalogOperationContext } : {}),
|
|
650
|
-
inventoryCatalogSourceReferences: readInventory,
|
|
651
|
-
});
|
|
717
|
+
const result = await loadCatalogView({ context, cliVersion: packageInfo.version, signal,
|
|
718
|
+
...(catalogOperationContext ? { catalogOperationContext } : {}) });
|
|
719
|
+
const snapshot = await readJointDemand({ cwd: context.cwd, env: context.env, signal, catalogOperationContext });
|
|
720
|
+
const current = await readRecoveryStatus({ cwd: context.cwd, env: context.env, signal,
|
|
721
|
+
cliVersion: packageInfo.version, nativeCliRunner: context.nativeCliRunner, catalogOperationContext }, snapshot);
|
|
652
722
|
signal.throwIfAborted();
|
|
653
723
|
const configured = await listCatalogSources({ env: context.env });
|
|
654
724
|
signal.throwIfAborted();
|
|
655
725
|
if (result.payload.catalog.configDigest !== configured.configDigest)
|
|
656
726
|
continue;
|
|
657
727
|
sessionStatusResult = result;
|
|
728
|
+
sessionRecoveryStatus = current;
|
|
658
729
|
const dependencyOverviews = await loadDependencyOverviews({
|
|
659
730
|
context,
|
|
660
731
|
cliVersion: packageInfo.version,
|
|
661
|
-
status:
|
|
732
|
+
status: current,
|
|
733
|
+
pluginSummaries: result.pluginSummaries,
|
|
662
734
|
signal,
|
|
663
735
|
...(catalogOperationContext ? { catalogOperationContext } : {}),
|
|
664
736
|
});
|
|
@@ -696,11 +768,12 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
696
768
|
const statusById = new Map(result.payload.catalog.sources.map((source) => [source.id, source]));
|
|
697
769
|
return {
|
|
698
770
|
cliChannel: packageInfo.version.includes('-') ? 'beta' : 'latest',
|
|
699
|
-
...(
|
|
771
|
+
...(current.coverage.projectRoot ? { projectRoot: current.coverage.projectRoot } : {}),
|
|
772
|
+
scopedRecovery: { user: { ...scopedCurrentStatus(current, snapshot, 'user'), dependencyOverviews },
|
|
773
|
+
...(snapshot.project ? { project: { ...scopedCurrentStatus(current, snapshot, 'project'), dependencyOverviews } } : {}) },
|
|
700
774
|
configuredSources: structuredClone(configured.sources),
|
|
701
775
|
payload: result.payload,
|
|
702
776
|
pluginSummaries: result.pluginSummaries,
|
|
703
|
-
targetRevisions: result.targetRevisions,
|
|
704
777
|
dependencyOverviews,
|
|
705
778
|
portablePluginIds,
|
|
706
779
|
configStoreInventory,
|
|
@@ -880,12 +953,9 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
880
953
|
if (target.kind === 'special') {
|
|
881
954
|
throw new TuiOperationBlockedError('configResetTargetUnsupported', '设置目标是特殊文件系统节点,不能自动重置。请手动移动后重试。');
|
|
882
955
|
}
|
|
883
|
-
const relevantTargets =
|
|
884
|
-
?
|
|
956
|
+
const relevantTargets = sessionRecoveryStatus
|
|
957
|
+
? currentConfigTargets(sessionRecoveryStatus, intent.pluginId, intent.context ?? 'user', [], intent.platform)
|
|
885
958
|
: [];
|
|
886
|
-
const relevantRevisions = (sessionStatusResult?.targetRevisions ?? []).filter((revision) => relevantTargets.some((statusTarget) => statusTarget.platform === revision.platform
|
|
887
|
-
&& statusTarget.scope === revision.scope
|
|
888
|
-
&& statusTarget.pluginId === revision.pluginId));
|
|
889
959
|
let selected;
|
|
890
960
|
try {
|
|
891
961
|
const packageInfo = await readCliPackageInfo();
|
|
@@ -927,7 +997,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
927
997
|
},
|
|
928
998
|
...(selected ? { source: selected.source } : {}),
|
|
929
999
|
...(sessionStatusResult ? {
|
|
930
|
-
targetFingerprint:
|
|
1000
|
+
targetFingerprint: currentTargetFingerprint(sessionRecoveryStatus, relevantTargets),
|
|
931
1001
|
} : {}),
|
|
932
1002
|
config: {
|
|
933
1003
|
scope: 'user', platform: intent.platform, context: intent.context ?? 'user',
|
|
@@ -938,8 +1008,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
938
1008
|
? { commandPackages: selected.impact.affectedCommandPackages } : {}),
|
|
939
1009
|
affectedTargets: (selected?.impact.affectedTargets
|
|
940
1010
|
?? relevantTargets).map(({ platform, scope }) => ({ platform, scope })),
|
|
941
|
-
...((selected?.impact.
|
|
942
|
-
? {
|
|
1011
|
+
...((selected?.impact.sharedNativeRenderUnits.length ?? 0) > 0
|
|
1012
|
+
? { sharedNativeRenderUnits: selected.impact.sharedNativeRenderUnits }
|
|
943
1013
|
: {}),
|
|
944
1014
|
},
|
|
945
1015
|
resetTarget: {
|
|
@@ -1382,13 +1452,14 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1382
1452
|
impactState: 'known', affectedTargets: targets,
|
|
1383
1453
|
commandPackages: prepared.commandPackages,
|
|
1384
1454
|
applyEvidence: prepared.evidence, applyChanges: prepared.plan.changes,
|
|
1455
|
+
commandReviewChanges: managedCommandRecoveryPlanChanges(prepared.plan),
|
|
1385
1456
|
applyWarnings: prepared.plan.warnings,
|
|
1386
1457
|
applyBlockers: [...new Map([
|
|
1387
1458
|
...prepared.plan.receipt.blockers, ...prepared.plan.receipt.errors,
|
|
1388
1459
|
...prepared.plan.receipt.targetResults.flatMap((target) => target.blockers),
|
|
1389
1460
|
].map((item) => [`${item.code}\0${item.message}`, item])).values()],
|
|
1390
1461
|
preApplyAuthorization: prepared.preApplyAuthorization,
|
|
1391
|
-
|
|
1462
|
+
sharedNativeRenderUnits: await configRetrySharedNativeRenderUnits(plugin, targets.filter((target) => NATIVE_PLATFORM_TARGETS.includes(target.platform)), context.env, referencePlugins),
|
|
1392
1463
|
},
|
|
1393
1464
|
};
|
|
1394
1465
|
}
|
|
@@ -1425,8 +1496,9 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1425
1496
|
})).map((entry) => entry.pluginId ?? `${entry.sourceId}/${entry.manifest.name}`),
|
|
1426
1497
|
})
|
|
1427
1498
|
: [];
|
|
1428
|
-
if (preparation && intent.kind === 'configSave'
|
|
1429
|
-
|
|
1499
|
+
if (preparation && intent.kind === 'configSave'
|
|
1500
|
+
&& sessionRecoveryStatus?.scope === (intent.context ?? 'user')) {
|
|
1501
|
+
if (!sessionStatusResult || !sessionRecoveryStatus || !catalogOperation) {
|
|
1430
1502
|
throw operationReviewStale('当前 TUI session 没有可复用的设置证据。');
|
|
1431
1503
|
}
|
|
1432
1504
|
await preparation.reporter.emit('config');
|
|
@@ -1435,7 +1507,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1435
1507
|
if (configSnapshot.digest !== sessionStatusResult.payload.catalog.configDigest) {
|
|
1436
1508
|
throw operationReviewStale('准备设置确认期间来源配置发生变化。');
|
|
1437
1509
|
}
|
|
1438
|
-
const relevantTargets =
|
|
1510
|
+
const relevantTargets = currentConfigTargets(sessionRecoveryStatus, intent.pluginId, intent.context ?? 'user', configReferencePluginIds, intent.platform);
|
|
1439
1511
|
const preparedCatalogOperation = catalogOperation;
|
|
1440
1512
|
const selected = await withResolvedCatalogPlugin({
|
|
1441
1513
|
selector: intent.pluginId,
|
|
@@ -1505,16 +1577,13 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1505
1577
|
preApplyAuthorization,
|
|
1506
1578
|
retryStoreDigest: intent.retryApply ? await configRetryStoreDigest({ plugin, scope: intent.context ?? 'user', platform: intent.platform,
|
|
1507
1579
|
targets: affectedTargets, commandPackages, preApplyAuthorization, cwd: context.cwd, env: context.env, plugins: referencePlugins }) : undefined,
|
|
1508
|
-
|
|
1509
|
-
? await
|
|
1510
|
-
: impact.
|
|
1580
|
+
sharedNativeRenderUnits: intent.retryApply
|
|
1581
|
+
? await configRetrySharedNativeRenderUnits(plugin, affectedTargets, context.env, referencePlugins)
|
|
1582
|
+
: impact.sharedNativeRenderUnits,
|
|
1511
1583
|
};
|
|
1512
1584
|
},
|
|
1513
1585
|
});
|
|
1514
1586
|
signal?.throwIfAborted();
|
|
1515
|
-
const relevantRevisions = (sessionStatusResult.targetRevisions ?? []).filter((revision) => relevantTargets.some((target) => target.platform === revision.platform
|
|
1516
|
-
&& target.scope === revision.scope
|
|
1517
|
-
&& target.pluginId === revision.pluginId));
|
|
1518
1587
|
await preparation.reporter.emit('evidence');
|
|
1519
1588
|
const evidence = {
|
|
1520
1589
|
catalog: {
|
|
@@ -1523,7 +1592,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1523
1592
|
...(catalogOperation ? { generationSetDigest: catalogOperation.generationSetDigest } : {}),
|
|
1524
1593
|
},
|
|
1525
1594
|
...(selected.source ? { source: selected.source } : {}),
|
|
1526
|
-
targetFingerprint:
|
|
1595
|
+
targetFingerprint: currentTargetFingerprint(sessionRecoveryStatus, relevantTargets),
|
|
1527
1596
|
config: {
|
|
1528
1597
|
scope: 'user', context: intent.context ?? 'user', platform: intent.platform,
|
|
1529
1598
|
schemaIdentity: selected.schemaIdentity,
|
|
@@ -1537,8 +1606,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1537
1606
|
...(selected.preApplyAuthorization.length > 0
|
|
1538
1607
|
? { preApplyAuthorization: selected.preApplyAuthorization }
|
|
1539
1608
|
: {}),
|
|
1540
|
-
...(selected.
|
|
1541
|
-
? {
|
|
1609
|
+
...(selected.sharedNativeRenderUnits.length > 0
|
|
1610
|
+
? { sharedNativeRenderUnits: selected.sharedNativeRenderUnits }
|
|
1542
1611
|
: {}),
|
|
1543
1612
|
},
|
|
1544
1613
|
};
|
|
@@ -1550,20 +1619,16 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1550
1619
|
await preparation?.reporter.emit('status');
|
|
1551
1620
|
const statusCatalogOperation = catalogOperation
|
|
1552
1621
|
?? (!freshCatalog ? sessionCatalogOperationContext : undefined);
|
|
1553
|
-
const status = await
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
env: context.env,
|
|
1558
|
-
nativeCliRunner: context.nativeCliRunner,
|
|
1559
|
-
cliVersion: packageInfo.version,
|
|
1622
|
+
const status = await readRecoveryStatus({
|
|
1623
|
+
context: intent.context ?? 'user', cwd: context.cwd, env: context.env,
|
|
1624
|
+
nativeCliRunner: context.nativeCliRunner, cliVersion: packageInfo.version,
|
|
1625
|
+
...(signal ? { signal } : {}),
|
|
1560
1626
|
...(statusCatalogOperation ? { catalogOperationContext: statusCatalogOperation } : {}),
|
|
1561
|
-
inventoryCatalogSourceReferences: operationInventory,
|
|
1562
1627
|
});
|
|
1563
1628
|
signal?.throwIfAborted();
|
|
1564
1629
|
const configSnapshot = await readCatalogSourcesConfigSnapshot(context.env);
|
|
1565
1630
|
signal?.throwIfAborted();
|
|
1566
|
-
if (configSnapshot.digest !==
|
|
1631
|
+
if (statusCatalogOperation && configSnapshot.digest !== statusCatalogOperation.catalog.configDigest) {
|
|
1567
1632
|
throw operationReviewStale('准备确认信息期间来源配置发生变化。');
|
|
1568
1633
|
}
|
|
1569
1634
|
if (catalogOperationError)
|
|
@@ -1579,7 +1644,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1579
1644
|
}
|
|
1580
1645
|
await preparation?.reporter.emit('catalog');
|
|
1581
1646
|
const configVisibleTargets = intent.kind === 'configSave'
|
|
1582
|
-
?
|
|
1647
|
+
? currentConfigTargets(status, intent.pluginId, intent.context ?? 'user', configReferencePluginIds, intent.platform)
|
|
1583
1648
|
: [];
|
|
1584
1649
|
const selected = await withResolvedCatalogPlugin({
|
|
1585
1650
|
selector: intent.pluginId,
|
|
@@ -1661,34 +1726,27 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1661
1726
|
retryStoreDigest: intent.kind === 'configSave' && intent.retryApply
|
|
1662
1727
|
? await configRetryStoreDigest({ plugin, scope: intent.context ?? 'user', platform: intent.platform, targets: affectedTargets,
|
|
1663
1728
|
commandPackages, preApplyAuthorization, cwd: context.cwd, env: context.env, plugins: referencePlugins }) : undefined,
|
|
1664
|
-
|
|
1729
|
+
sharedNativeRenderUnits: intent.kind === 'configSave'
|
|
1665
1730
|
? intent.retryApply
|
|
1666
|
-
? await
|
|
1667
|
-
: impact.
|
|
1731
|
+
? await configRetrySharedNativeRenderUnits(plugin, configImpactVisibleTargets(plugin.manifest.name, configVisibleTargets), context.env, referencePlugins)
|
|
1732
|
+
: impact.sharedNativeRenderUnits
|
|
1668
1733
|
: [],
|
|
1669
1734
|
};
|
|
1670
1735
|
},
|
|
1671
1736
|
});
|
|
1672
1737
|
await preparation?.reporter.emit('evidence');
|
|
1673
1738
|
signal?.throwIfAborted();
|
|
1674
|
-
const evidenceTargets =
|
|
1675
|
-
? configVisibleTargets
|
|
1676
|
-
: flattenStatusTargets(status.payload.targets);
|
|
1677
|
-
const evidenceRevisions = intent.kind === 'configSave'
|
|
1678
|
-
? (status.targetRevisions ?? []).filter((revision) => evidenceTargets.some((target) => target.platform === revision.platform
|
|
1679
|
-
&& target.scope === revision.scope
|
|
1680
|
-
&& target.pluginId === revision.pluginId))
|
|
1681
|
-
: (status.targetRevisions ?? []);
|
|
1739
|
+
const evidenceTargets = configVisibleTargets;
|
|
1682
1740
|
const evidence = {
|
|
1683
1741
|
catalog: {
|
|
1684
|
-
configDigest:
|
|
1685
|
-
compositeDigest:
|
|
1742
|
+
configDigest: configSnapshot.digest,
|
|
1743
|
+
compositeDigest: catalogOperation.catalog.compositeDigest,
|
|
1686
1744
|
...(catalogOperation
|
|
1687
1745
|
? { generationSetDigest: catalogOperation.generationSetDigest }
|
|
1688
1746
|
: {}),
|
|
1689
1747
|
},
|
|
1690
1748
|
source: selected.source,
|
|
1691
|
-
targetFingerprint:
|
|
1749
|
+
targetFingerprint: currentTargetFingerprint(status, evidenceTargets),
|
|
1692
1750
|
};
|
|
1693
1751
|
if (intent.kind === 'configSave') {
|
|
1694
1752
|
const impact = 'impact' in selected ? selected.impact : undefined;
|
|
@@ -1706,9 +1764,9 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1706
1764
|
? { commandPackages: selected.commandPackages } : {}),
|
|
1707
1765
|
affectedTargets: (impact?.affectedTargets
|
|
1708
1766
|
?? evidenceTargets).map(({ pluginName, platform, scope }) => ({ pluginName, platform, scope })),
|
|
1709
|
-
...('
|
|
1710
|
-
&& selected.
|
|
1711
|
-
? {
|
|
1767
|
+
...('sharedNativeRenderUnits' in selected
|
|
1768
|
+
&& selected.sharedNativeRenderUnits.length > 0
|
|
1769
|
+
? { sharedNativeRenderUnits: selected.sharedNativeRenderUnits }
|
|
1712
1770
|
: {}),
|
|
1713
1771
|
...('preApplyAuthorization' in selected
|
|
1714
1772
|
&& selected.preApplyAuthorization.length > 0
|
|
@@ -1745,25 +1803,16 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1745
1803
|
throw new TuiOperationBlockedError('catalogSessionReloadRequired', 'Catalog 已变化。请按 H 重新加载,再检查清单。');
|
|
1746
1804
|
}
|
|
1747
1805
|
const catalogOperationContext = sessionCatalogOperationContext ?? currentCatalog;
|
|
1748
|
-
|
|
1749
|
-
const status = await readRecoveryStatus({
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
cliVersion: packageInfo.version, status: native, signal,
|
|
1757
|
-
catalogOperationContext: demand.catalogOperationContext,
|
|
1758
|
-
});
|
|
1759
|
-
nativeSnapshot = { payload: native.payload, pluginSummaries: native.pluginSummaries, targetRevisions: native.targetRevisions,
|
|
1760
|
-
dependencyOverviews };
|
|
1761
|
-
},
|
|
1762
|
-
});
|
|
1806
|
+
const snapshot = await readJointDemand({ scope, cwd: context.cwd, env: context.env, signal, catalogOperationContext });
|
|
1807
|
+
const status = await readRecoveryStatus({ scope, cwd: context.cwd, env: context.env, cliVersion: packageInfo.version,
|
|
1808
|
+
nativeCliRunner: context.nativeCliRunner, catalogOperationContext, signal }, snapshot);
|
|
1809
|
+
signal.throwIfAborted();
|
|
1810
|
+
sessionRecoveryStatus = status;
|
|
1811
|
+
const source = sessionStatusResult ?? await loadCatalogView({ context, cliVersion: packageInfo.version, signal, catalogOperationContext });
|
|
1812
|
+
const dependencyOverviews = await loadDependencyOverviews({ context, cliVersion: packageInfo.version, status,
|
|
1813
|
+
pluginSummaries: source.pluginSummaries, signal, catalogOperationContext });
|
|
1763
1814
|
signal.throwIfAborted();
|
|
1764
|
-
|
|
1765
|
-
throw new Error('nativeObservationUnavailable');
|
|
1766
|
-
return { ...status, nativeSnapshot };
|
|
1815
|
+
return { ...scopedCurrentStatus(status, snapshot, scope), dependencyOverviews };
|
|
1767
1816
|
},
|
|
1768
1817
|
async prepareScopedTask(request, signal) {
|
|
1769
1818
|
signal.throwIfAborted();
|
|
@@ -2072,10 +2121,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2072
2121
|
...(userStore.platforms ?? {}),
|
|
2073
2122
|
},
|
|
2074
2123
|
effectiveRawValues: effectiveRaw.values,
|
|
2075
|
-
sharedNativeRefreshKeys: new Set(
|
|
2076
|
-
&& (!config.platform || target.platform === config.platform)
|
|
2077
|
-
? target.refreshKeys
|
|
2078
|
-
: [])),
|
|
2124
|
+
sharedNativeRefreshKeys: new Set(plugin.manifest.artifacts?.configKeys ?? []),
|
|
2079
2125
|
});
|
|
2080
2126
|
return { ...page, editEvidence: {
|
|
2081
2127
|
platform: config.platform,
|
|
@@ -2594,7 +2640,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2594
2640
|
operationContext: groupCatalogOperation,
|
|
2595
2641
|
}) : undefined;
|
|
2596
2642
|
const applyTargets = intent.apply
|
|
2597
|
-
? freshConfig.affectedTargets.filter((target) =>
|
|
2643
|
+
? freshConfig.affectedTargets.filter((target) => NATIVE_PLATFORM_TARGETS.includes(target.platform)).map((target) => ({
|
|
2598
2644
|
pluginName: target.pluginName ?? plugin.manifest.name,
|
|
2599
2645
|
platform: target.platform,
|
|
2600
2646
|
scope: target.scope,
|
|
@@ -2727,7 +2773,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2727
2773
|
operationContext: catalogOperation,
|
|
2728
2774
|
}) : undefined;
|
|
2729
2775
|
const applyTargets = intent.retryApply || intent.apply
|
|
2730
|
-
? currentEvidence.config?.affectedTargets.filter((target) =>
|
|
2776
|
+
? currentEvidence.config?.affectedTargets.filter((target) => NATIVE_PLATFORM_TARGETS.includes(target.platform)).map((target) => ({
|
|
2731
2777
|
pluginName: target.pluginName ?? plugin.manifest.name,
|
|
2732
2778
|
platform: target.platform,
|
|
2733
2779
|
scope: target.scope,
|