@lesliechan721/aw 0.1.0-beta.73 → 0.1.0-beta.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring/assets/aw-runtime-config.mjs +65 -43
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
- package/dist/authoring/scripts/add-skill.mjs +5 -14
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +4 -28
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +2 -2
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +0 -1
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +234 -1422
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
- package/dist/scripts/aw-skill-eval-materializer.js +19 -80
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.js +6 -8
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +2 -2
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/dependency-operation-plan.js +3 -3
- package/dist/src/commands/dependency-operation-plan.js.map +1 -1
- package/dist/src/commands/deployment-confirmation.d.ts +4 -0
- package/dist/src/commands/deployment-confirmation.js +20 -0
- package/dist/src/commands/deployment-confirmation.js.map +1 -0
- package/dist/src/commands/managed-commands.js +4 -2
- package/dist/src/commands/managed-commands.js.map +1 -1
- package/dist/src/commands/offline-cleanup-evidence.d.ts +3 -1
- package/dist/src/commands/offline-cleanup-evidence.js +9 -4
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +6 -0
- package/dist/src/commands/operation-plan.js +29 -2
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/options.d.ts +6 -2
- package/dist/src/commands/options.js +5 -4
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +29 -41
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.js +5 -5
- package/dist/src/commands/public-config-confirmation.js.map +1 -1
- package/dist/src/commands/public-lifecycle-result.d.ts +47 -0
- package/dist/src/commands/public-lifecycle-result.js +119 -4
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.d.ts +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 +28 -8
- package/dist/src/commands/public-plugin-query.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +12 -11
- package/dist/src/commands/rebuild-command.js +529 -769
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +21 -43
- package/dist/src/commands/rebuild-integration.js +306 -3600
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +13 -0
- package/dist/src/commands/rebuild-operations.js +60 -15
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +59 -0
- package/dist/src/commands/rebuild-platform-integration.js +1200 -0
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
- package/dist/src/commands/review-inspection.js +41 -4
- package/dist/src/commands/review-inspection.js.map +1 -1
- package/dist/src/commands/review-preparation.d.ts +2 -0
- package/dist/src/commands/review-preparation.js +23 -60
- package/dist/src/commands/review-preparation.js.map +1 -1
- package/dist/src/commands/skill-eval.js +1 -0
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +3 -1
- package/dist/src/commands/status-v6.js +24 -15
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/commands/targets-command.d.ts +9 -0
- package/dist/src/commands/targets-command.js +57 -6
- package/dist/src/commands/targets-command.js.map +1 -1
- package/dist/src/commands/write-commands.js +43 -28
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +2 -2
- package/dist/src/constants.js +2 -2
- package/dist/src/constants.js.map +1 -1
- package/dist/src/generators/local-plugin.js +59 -248
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.js +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 +60 -0
- package/dist/src/output/public-result.js.map +1 -1
- package/dist/src/output/rebuild-progress.js +5 -5
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.js +19 -2
- package/dist/src/output/receipt-projection.js.map +1 -1
- package/dist/src/platforms/capabilities.d.ts +10 -0
- package/dist/src/platforms/capabilities.js +158 -0
- package/dist/src/platforms/capabilities.js.map +1 -0
- package/dist/src/platforms/contracts.d.ts +338 -0
- package/dist/src/platforms/contracts.js +2 -0
- package/dist/src/platforms/contracts.js.map +1 -0
- package/dist/src/platforms/cursor-workspace-hook.d.ts +22 -0
- package/dist/src/platforms/cursor-workspace-hook.js +185 -0
- package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
- package/dist/src/platforms/discovery.d.ts +74 -0
- package/dist/src/platforms/discovery.js +582 -0
- package/dist/src/platforms/discovery.js.map +1 -0
- package/dist/src/platforms/gemini-activation.d.ts +36 -0
- package/dist/src/platforms/gemini-activation.js +331 -0
- package/dist/src/platforms/gemini-activation.js.map +1 -0
- package/dist/src/platforms/gemini-consent.d.ts +8 -0
- package/dist/src/platforms/gemini-consent.js +79 -0
- package/dist/src/platforms/gemini-consent.js.map +1 -0
- package/dist/src/platforms/identity.d.ts +4 -0
- package/dist/src/platforms/identity.js +22 -0
- package/dist/src/platforms/identity.js.map +1 -0
- package/dist/src/platforms/inspection-grok.d.ts +4 -0
- package/dist/src/platforms/inspection-grok.js +173 -0
- package/dist/src/platforms/inspection-grok.js.map +1 -0
- package/dist/src/platforms/inspection-native.d.ts +6 -0
- package/dist/src/platforms/inspection-native.js +379 -0
- package/dist/src/platforms/inspection-native.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +4 -0
- package/dist/src/platforms/inspection-pi.js +212 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +13 -0
- package/dist/src/platforms/inspection.js +189 -0
- package/dist/src/platforms/inspection.js.map +1 -0
- package/dist/src/platforms/layout.d.ts +21 -0
- package/dist/src/platforms/layout.js +239 -0
- package/dist/src/platforms/layout.js.map +1 -0
- package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
- package/dist/src/platforms/lifecycle-native-services.js +147 -0
- package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
- package/dist/src/platforms/lifecycle-native.d.ts +9 -0
- package/dist/src/platforms/lifecycle-native.js +252 -0
- package/dist/src/platforms/lifecycle-native.js.map +1 -0
- package/dist/src/platforms/lifecycle.d.ts +25 -0
- package/dist/src/platforms/lifecycle.js +452 -0
- package/dist/src/platforms/lifecycle.js.map +1 -0
- package/dist/src/platforms/managed-command-placement.d.ts +8 -0
- package/dist/src/platforms/managed-command-placement.js +79 -0
- package/dist/src/platforms/managed-command-placement.js.map +1 -0
- package/dist/src/platforms/projection-code-extension.d.ts +8 -0
- package/dist/src/platforms/projection-code-extension.js +121 -0
- package/dist/src/platforms/projection-code-extension.js.map +1 -0
- package/dist/src/platforms/projection-command-resources.d.ts +7 -0
- package/dist/src/platforms/projection-command-resources.js +74 -0
- package/dist/src/platforms/projection-command-resources.js.map +1 -0
- package/dist/src/platforms/projection-files.d.ts +27 -0
- package/dist/src/platforms/projection-files.js +111 -0
- package/dist/src/platforms/projection-files.js.map +1 -0
- package/dist/src/platforms/projection-marketplace.d.ts +19 -0
- package/dist/src/platforms/projection-marketplace.js +42 -0
- package/dist/src/platforms/projection-marketplace.js.map +1 -0
- package/dist/src/platforms/projection.d.ts +10 -0
- package/dist/src/platforms/projection.js +446 -0
- package/dist/src/platforms/projection.js.map +1 -0
- package/dist/src/platforms/registry.d.ts +4 -0
- package/dist/src/platforms/registry.js +30 -0
- package/dist/src/platforms/registry.js.map +1 -0
- package/dist/src/platforms/supplement-layout.d.ts +16 -0
- package/dist/src/platforms/supplement-layout.js +31 -0
- package/dist/src/platforms/supplement-layout.js.map +1 -0
- package/dist/src/portable/commands.d.ts +7 -5
- package/dist/src/portable/commands.js +6 -1
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +8 -6
- package/dist/src/portable/materializer.js +47 -245
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.js +2 -15
- package/dist/src/portable/recovery-layout.js.map +1 -1
- package/dist/src/portable/recovery.d.ts +10 -1
- package/dist/src/portable/recovery.js +34 -8
- package/dist/src/portable/recovery.js.map +1 -1
- package/dist/src/recovery/coordinator.d.ts +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 +43 -40
- package/dist/src/recovery/joint-demand.js.map +1 -1
- package/dist/src/recovery/receipt.d.ts +23 -8
- package/dist/src/recovery/retirement.d.ts +1 -1
- package/dist/src/recovery/retirement.js +122 -29
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.d.ts +13 -6
- package/dist/src/recovery/status.js +479 -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 +91 -0
- package/dist/src/tui/deployment-view.js.map +1 -0
- package/dist/src/tui/glossary.js +4 -4
- package/dist/src/tui/glossary.js.map +1 -1
- package/dist/src/tui/model.d.ts +5 -0
- package/dist/src/tui/model.js +73 -12
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.js +2 -1
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
- package/dist/src/tui/operation-history.d.ts +5 -4
- package/dist/src/tui/operation-history.js.map +1 -1
- package/dist/src/tui/operation-review-planner.d.ts +7 -2
- package/dist/src/tui/operation-review-planner.js +97 -42
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-content.d.ts +5 -3
- package/dist/src/tui/plugin-content.js +70 -508
- package/dist/src/tui/plugin-content.js.map +1 -1
- package/dist/src/tui/plugin-detail.d.ts +3 -2
- package/dist/src/tui/plugin-detail.js +33 -25
- package/dist/src/tui/plugin-detail.js.map +1 -1
- package/dist/src/tui/scoped-inventory.d.ts +10 -6
- package/dist/src/tui/scoped-inventory.js +34 -1
- package/dist/src/tui/scoped-inventory.js.map +1 -1
- package/dist/src/types.d.ts +4 -63
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +10 -4
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +26 -2
- package/dist/src/utils/artifact-plan.js +113 -489
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +100 -93
- package/dist/src/utils/artifact-renderer.js +173 -346
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +21 -11
- package/dist/src/utils/artifact-request.js +56 -80
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +30 -146
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-digests.d.ts +2 -12
- package/dist/src/utils/catalog-digests.js +0 -39
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-source-references.d.ts +7 -0
- package/dist/src/utils/catalog-source-references.js +234 -19
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/codex-config-observation.d.ts +19 -0
- package/dist/src/utils/codex-config-observation.js +145 -0
- package/dist/src/utils/codex-config-observation.js.map +1 -0
- package/dist/src/utils/codex-executable-discovery.d.ts +2 -0
- package/dist/src/utils/codex-executable-discovery.js +47 -13
- package/dist/src/utils/codex-executable-discovery.js.map +1 -1
- package/dist/src/utils/codex-manager.js +1 -1
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +3 -0
- package/dist/src/utils/codex-native-observation.js +53 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/codex-shared-native.d.ts +3 -1
- package/dist/src/utils/codex-shared-native.js +46 -5
- package/dist/src/utils/codex-shared-native.js.map +1 -1
- package/dist/src/utils/codex-skill-staging.d.ts +4 -3
- package/dist/src/utils/codex-skill-staging.js.map +1 -1
- package/dist/src/utils/codex-surface-analysis.d.ts +5 -2
- package/dist/src/utils/codex-surface-analysis.js +28 -57
- package/dist/src/utils/codex-surface-analysis.js.map +1 -1
- package/dist/src/utils/component-command-preparation.d.ts +34 -0
- package/dist/src/utils/component-command-preparation.js +228 -0
- package/dist/src/utils/component-command-preparation.js.map +1 -0
- package/dist/src/utils/component-resources.d.ts +43 -0
- package/dist/src/utils/component-resources.js +304 -0
- package/dist/src/utils/component-resources.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +17 -6
- package/dist/src/utils/dynamic-skill-tree.js +7 -3
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +11 -44
- package/dist/src/utils/local-marketplace.js +11 -638
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-evidence.d.ts +2 -2
- package/dist/src/utils/managed-command-evidence.js +5 -81
- package/dist/src/utils/managed-command-evidence.js.map +1 -1
- package/dist/src/utils/managed-command-materialization.d.ts +5 -2
- package/dist/src/utils/managed-command-materialization.js +35 -35
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-preparation.d.ts +67 -0
- package/dist/src/utils/managed-command-preparation.js +146 -0
- package/dist/src/utils/managed-command-preparation.js.map +1 -0
- package/dist/src/utils/managed-command-review.d.ts +26 -0
- package/dist/src/utils/managed-command-review.js +68 -0
- package/dist/src/utils/managed-command-review.js.map +1 -0
- package/dist/src/utils/managed-command-store.js +26 -15
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +19 -0
- package/dist/src/utils/native-cli.js +45 -2
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +20 -1
- package/dist/src/utils/native-demand.js.map +1 -1
- package/dist/src/utils/native-tool-review.d.ts +3 -6
- package/dist/src/utils/native-tool-review.js +25 -11
- package/dist/src/utils/native-tool-review.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +26 -3
- package/dist/src/utils/ownership.js +95 -9
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -1
- package/dist/src/utils/paths.js +2 -0
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +46 -0
- package/dist/src/utils/platform-empty-state.js +123 -0
- package/dist/src/utils/platform-empty-state.js.map +1 -0
- package/dist/src/utils/plugin-config-impact.d.ts +17 -11
- package/dist/src/utils/plugin-config-impact.js +46 -62
- package/dist/src/utils/plugin-config-impact.js.map +1 -1
- package/dist/src/utils/plugin-config-write.js +52 -53
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +0 -2
- package/dist/src/utils/plugin-config.js +0 -6
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-dependencies.d.ts +1 -1
- package/dist/src/utils/plugin-dependencies.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +5 -7
- package/dist/src/utils/runtime-config.js +12 -25
- package/dist/src/utils/runtime-config.js.map +1 -1
- package/dist/src/utils/windows-npm-shim.js +19 -2
- package/dist/src/utils/windows-npm-shim.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/utils/claude-native-render-receipt.d.ts +0 -14
- package/dist/src/utils/claude-native-render-receipt.js +0 -26
- package/dist/src/utils/claude-native-render-receipt.js.map +0 -1
- package/dist/src/utils/claude-skills-root.d.ts +0 -8
- package/dist/src/utils/claude-skills-root.js +0 -87
- package/dist/src/utils/claude-skills-root.js.map +0 -1
- package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
- package/dist/src/utils/codex-native-render-receipt.js +0 -205
- package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
- package/dist/src/utils/slash-commands.d.ts +0 -1
- package/dist/src/utils/slash-commands.js +0 -2
- package/dist/src/utils/slash-commands.js.map +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { getCommandPackageId } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
|
+
import { finalizePreparedPlatformRebuildSession } from '../commands/rebuild-integration.js';
|
|
2
3
|
import { addRequirements } from '../commands/intent-command.js';
|
|
3
4
|
import { createEmptyIntent, calculateIntentDigest, removeIntentRoot } from '../intent/intent-codec.js';
|
|
4
5
|
import { observeIntent, writeIntent, resolveIntentPath } from '../intent/intent-store.js';
|
|
5
6
|
import { describeStrongStateProblem } from '../intent/diagnostics.js';
|
|
6
7
|
import { observePreferences, normalizeAgents, writePreferences } from '../intent/deployment-preferences.js';
|
|
8
|
+
import { hasSharedUserPackage } from '../platforms/layout.js';
|
|
7
9
|
import { createScopeContext } from '../intent/scope-context.js';
|
|
8
10
|
import { withAwHomeMutationLock } from '../utils/aw-home-mutation-lock.js';
|
|
9
11
|
import { readSafeOperationError } from '../utils/safe-operation-diagnostic.js';
|
|
@@ -14,12 +16,13 @@ import { validateCatalogSnapshotComplete } from '../utils/catalog-snapshot.js';
|
|
|
14
16
|
import { readCatalogGenerationState } from '../utils/catalog-generation-state.js';
|
|
15
17
|
import { parsePluginId } from '../utils/multi-source-catalog.js';
|
|
16
18
|
import { readDemand } from './demand.js';
|
|
17
|
-
import { readJointDemand, deriveJointDemand,
|
|
18
|
-
import { prepareScopedRecovery, executeScopedRecovery, executeRecoveryPreApply, describeRecoveryPlan } from './coordinator.js';
|
|
19
|
+
import { readJointDemand, deriveJointDemand, deriveSharedReferenceView } from './joint-demand.js';
|
|
20
|
+
import { prepareScopedRecovery, executeScopedRecovery, executeRecoveryPreApply, refreshRecoveryNativePreviews, describeRecoveryPlan } from './coordinator.js';
|
|
19
21
|
import { readScopedRecoveryStatus, readRecoveryStatus } from './status.js';
|
|
20
22
|
import { measureRecoveryPerformanceStage, recordRecoveryPerformanceStage } from './performance.js';
|
|
21
23
|
import { resolvePluginMetaDependencyClosure } from '../utils/plugin-dependencies.js';
|
|
22
24
|
const diagnostic = (code, message = code) => ({ code, message });
|
|
25
|
+
const canReuseProviderAcrossScopes = (target) => target === 'generic' || hasSharedUserPackage(target);
|
|
23
26
|
function intentReceipt(observation) {
|
|
24
27
|
return { state: observation.state,
|
|
25
28
|
roots: observation.state === 'valid' ? observation.value.roots.map((root) => root.pluginId)
|
|
@@ -52,10 +55,20 @@ function mergeReceipts(plan, receipts) {
|
|
|
52
55
|
}
|
|
53
56
|
receipt.requestedTargets = receipt.targetResults.map(({ pluginId, agent, scope, delivery }) => ({ pluginId, agent, scope, delivery }));
|
|
54
57
|
for (const target of receipt.targetResults) {
|
|
55
|
-
const
|
|
58
|
+
const placements = plan.joint?.demand.placements ?? [];
|
|
59
|
+
const activationOnly = plan.joint?.children.some((child) => child.options.nativeActivationOnlyTargets?.some((item) => item.pluginId === target.pluginId && item.platform === target.agent && item.scope === target.scope));
|
|
60
|
+
const placement = placements.find((item) => item.pluginId === target.pluginId && item.target === target.agent && item.scope === target.scope)
|
|
61
|
+
?? (target.scope === 'project' && activationOnly ? placements.find((item) => item.pluginId === target.pluginId && item.target === target.agent && item.scope === 'user'
|
|
62
|
+
&& item.contributions.some((contribution) => contribution.scope === target.scope)) : undefined);
|
|
56
63
|
if (placement) {
|
|
57
|
-
|
|
64
|
+
const contributions = placement.scope === target.scope ? placement.contributions
|
|
65
|
+
: placement.contributions.filter((item) => item.scope === target.scope);
|
|
66
|
+
target.requiredBy = [...new Set(contributions.map((item) => item.root))];
|
|
58
67
|
target.providerScope = placement.scope;
|
|
68
|
+
if (placement.scope !== target.scope) {
|
|
69
|
+
target.requirementScope = target.scope;
|
|
70
|
+
target.relation = contributions.some((item) => item.root === target.pluginId) ? 'root' : 'dependency';
|
|
71
|
+
}
|
|
59
72
|
}
|
|
60
73
|
}
|
|
61
74
|
receipt.remainingTargets = receipts.flatMap((item) => item.remainingTargets);
|
|
@@ -262,21 +275,21 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
262
275
|
errors.push(diagnostic('invalidExactTargets', '精确重试目标不属于当前请求,请重新检查并选择。'));
|
|
263
276
|
}
|
|
264
277
|
const selected = demand.placements.filter((placement) => targets.includes(placement.target)
|
|
265
|
-
&& !demand.conflicts.some((conflict) => [conflict.left, conflict.right].some((position) => position.target === placement.target && position.scope === placement.scope))
|
|
266
278
|
&& (!options.exactTargets || options.exactTargets.some((exact) => exact.agent === placement.target
|
|
267
279
|
&& (command === 'uninstall' ? previousDemand.placements.some((previous) => previous.pluginId === placement.pluginId
|
|
268
280
|
&& previous.target === placement.target && previous.contributions.some((item) => item.path.includes(exact.pluginId)
|
|
269
281
|
&& (!exact.scope || item.scope === exact.scope)))
|
|
270
282
|
: (!exact.scope || placement.contributions.some((item) => item.scope === exact.scope))
|
|
271
283
|
&& (exact.pluginId === placement.pluginId || placement.contributions.some((item) => item.path.includes(exact.pluginId))))))
|
|
272
|
-
&& (command === 'uninstall' ?
|
|
284
|
+
&& (command === 'uninstall' ? canReuseProviderAcrossScopes(placement.target)
|
|
285
|
+
&& !(options.force && requested.includes(placement.pluginId))
|
|
273
286
|
&& previousDemand.placements.some((previous) => previous.pluginId === placement.pluginId && previous.target === placement.target
|
|
274
287
|
&& previous.scope !== placement.scope && previous.contributions.some((item) => item.scope === scope && requested.includes(item.root)))
|
|
275
288
|
: placement.contributions.some((item) => requested.includes(item.root)
|
|
276
289
|
|| options.allowDependencySelectors && item.path.some((id) => requested.includes(id))) || options.existingOnly && requested.includes(placement.pluginId)));
|
|
277
290
|
const activationOnlyTargets = [];
|
|
278
291
|
if (snapshot.project && !errors.length) {
|
|
279
|
-
const sharedNative = selected.filter((item) => item.scope === 'user' &&
|
|
292
|
+
const sharedNative = selected.filter((item) => item.scope === 'user' && ['codex', 'claude', 'gemini', 'copilot'].includes(item.target)
|
|
280
293
|
&& item.contributions.some((entry) => entry.scope === 'project'));
|
|
281
294
|
if (sharedNative.length) {
|
|
282
295
|
const expanded = { ...snapshot.project, roots: [...new Map(sharedNative.map((item) => [item.pluginId, {
|
|
@@ -291,8 +304,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
291
304
|
if (item.target === 'codex') {
|
|
292
305
|
const surface = analyzeCodexSurface(item.plugin.manifest);
|
|
293
306
|
const live = actual?.backend?.live;
|
|
294
|
-
const explicitlyDisabled =
|
|
295
|
-
&& component.key === 'project' && component.state === 'disabled');
|
|
307
|
+
const explicitlyDisabled = actual?.deploymentObservations?.some((observation) => observation.after.consumers.some((consumer) => consumer.activation === 'disabled'));
|
|
296
308
|
const userProvidesComponents = surface.components.every((component) => !component.scopes.includes('project') || component.scopes.includes('user'));
|
|
297
309
|
const retiringProjectComponents = live?.components?.some((component) => component.kind === 'ownership'
|
|
298
310
|
&& component.key !== 'native' && !component.key.startsWith('activation-') && !component.key.startsWith('marketplace-')
|
|
@@ -306,8 +318,8 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
306
318
|
}
|
|
307
319
|
}
|
|
308
320
|
if (actual?.content !== 'satisfied') {
|
|
309
|
-
if (item.target
|
|
310
|
-
activationOnlyTargets.push({ pluginId: item.pluginId, platform:
|
|
321
|
+
if (item.target !== 'generic')
|
|
322
|
+
activationOnlyTargets.push({ pluginId: item.pluginId, platform: item.target, scope: 'project' });
|
|
311
323
|
selected.push({ ...item, scope: 'project' });
|
|
312
324
|
}
|
|
313
325
|
}
|
|
@@ -332,7 +344,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
332
344
|
originalIntent: observationEvidence(original.intent), preferencesEvidence: observationEvidence(snapshot.user.preferences),
|
|
333
345
|
plannedImpact: { declaration: Boolean(declaration), preferences: false, config: false, outputs: false },
|
|
334
346
|
changes: declaration ? [`保存 ${scope} 插件需求。`] : [], warnings: [], nativeGroups: [],
|
|
335
|
-
|
|
347
|
+
portableGroups: [], portableProtectionGroups: [],
|
|
336
348
|
portableResidues: [], sourceRefreshes: [], sourceRefreshFailures: [], runtime, blockExecution: errors.some((error) => ['syncPluginNotDesired', 'pluginIntentRootMissing', 'pluginIntentStateInvalid', 'catalogSnapshotInvalid', 'installTargetSelectionUnsupported', 'invalidExactTargets', 'dependencyStillRequired'].includes(error.code)
|
|
337
349
|
|| error.code === 'targetsNotConfigured' && !options.retireUnselectedTargets)
|
|
338
350
|
|| !snapshot.preferences || snapshot.user.roots === null || snapshot.project?.roots === null, joint };
|
|
@@ -343,16 +355,21 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
343
355
|
try {
|
|
344
356
|
const currentStatus = observedStatus ?? await readRecoveryStatus({ ...options, nativeCliRunner: runtime.nativeCliRunner,
|
|
345
357
|
codexObservationSession: runtime.codexObservationSession, targets: undefined }, savedDemand);
|
|
358
|
+
const sharedReferenceView = deriveSharedReferenceView(snapshot, demand, currentStatus);
|
|
346
359
|
const ownsOutput = (item) => currentStatus.ownedTargets?.some((owned) => owned.pluginId === item.pluginId
|
|
347
360
|
&& owned.agent === item.agent && owned.scope === item.scope) === true;
|
|
348
361
|
const liveConsumers = currentStatus.existingTargets ?? [];
|
|
349
|
-
const sameProvider = (consumer, provider) => consumer.agent === provider.agent && (
|
|
362
|
+
const sameProvider = (consumer, provider) => consumer.agent === provider.agent && (consumer.scope === provider.scope
|
|
363
|
+
|| provider.scope === 'user' && canReuseProviderAcrossScopes(consumer.agent));
|
|
350
364
|
const automaticRetirements = command === 'uninstall' && !options.keepDependencies && demand.complete
|
|
351
365
|
? previousDemand.placements.filter((placement) => placement.scope === scope && targets.includes(placement.target)
|
|
352
|
-
&& (placement.target
|
|
353
|
-
&& !requested.includes(placement.pluginId)
|
|
366
|
+
&& (placement.target !== 'generic' ? currentStatus.coverage.native : currentStatus.coverage.portable)
|
|
367
|
+
&& !requested.includes(placement.pluginId)
|
|
368
|
+
&& !(canReuseProviderAcrossScopes(placement.target) ? rootIds.includes(placement.pluginId)
|
|
369
|
+
: snapshot[placement.scope]?.roots?.some((root) => root.pluginId === placement.pluginId))
|
|
354
370
|
&& placement.contributions.some((item) => explicitlyRemoves({ pluginId: item.root, agent: placement.target, scope: item.scope }))
|
|
355
|
-
&& !demand.placements.some((item) => item.pluginId === placement.pluginId && item.target === placement.target
|
|
371
|
+
&& !demand.placements.some((item) => item.pluginId === placement.pluginId && item.target === placement.target
|
|
372
|
+
&& (item.scope === placement.scope || canReuseProviderAcrossScopes(placement.target)))
|
|
356
373
|
&& ownsOutput({ pluginId: placement.pluginId, agent: placement.target, scope: placement.scope })) : [];
|
|
357
374
|
// A live consumer can outlast its Intent or its Active catalog entry.
|
|
358
375
|
const retainedConsumerFor = (provider) => liveConsumers.find((consumer) => {
|
|
@@ -397,10 +414,9 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
397
414
|
return plan;
|
|
398
415
|
}
|
|
399
416
|
plan.dependencyCleanupTargets = automaticRetirements.map((item) => ({ pluginId: item.pluginId, agent: item.target, scope: item.scope }));
|
|
400
|
-
|
|
401
|
-
const nativeTargets = targets.filter((target) => target === 'codex' || target === 'claude');
|
|
417
|
+
const nativeTargets = targets.filter((target) => target !== 'generic');
|
|
402
418
|
const targetGroups = [...(nativeTargets.length ? [nativeTargets] : []),
|
|
403
|
-
...targets.filter((target) => target
|
|
419
|
+
...targets.filter((target) => target === 'generic').map((target) => [target])];
|
|
404
420
|
for (const currentScope of snapshot.context.scopes) {
|
|
405
421
|
for (const groupTargets of targetGroups) {
|
|
406
422
|
const placements = selected.filter((item) => item.scope === currentScope && groupTargets.includes(item.target)
|
|
@@ -414,7 +430,8 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
414
430
|
...demand.placements.filter((item) => item.scope === currentScope && groupTargets.includes(item.target)),
|
|
415
431
|
...placements,
|
|
416
432
|
];
|
|
417
|
-
const userProviders = demand.placements.filter((item) => item.scope === 'user' && groupTargets.includes(item.target)
|
|
433
|
+
const userProviders = demand.placements.filter((item) => item.scope === 'user' && groupTargets.includes(item.target)
|
|
434
|
+
&& !childPlacements.some((project) => project.scope === 'project' && project.pluginId === item.pluginId && project.target === item.target));
|
|
418
435
|
const childDemand = { ...sourceDemand,
|
|
419
436
|
targetRequirements: childPlacements.map((item) => ({ pluginId: item.pluginId, target: item.target })),
|
|
420
437
|
userProviders: Object.fromEntries(groupTargets.map((target) => [target, userProviders
|
|
@@ -422,6 +439,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
422
439
|
roots: [...new Map(childPlacements.map((item) => [item.pluginId, { pluginId: item.pluginId, sourceId: item.plugin.sourceId,
|
|
423
440
|
sourceState: 'ready', blockers: [], plugin: item.plugin }])).values()] };
|
|
424
441
|
const child = await prepareScopedRecovery(command === 'reinstall' ? 'reinstall' : 'sync', [...new Set(placements.map((item) => item.pluginId))], { ...options, scope: currentScope, targets: groupTargets, all: false,
|
|
442
|
+
sharedReferenceView,
|
|
425
443
|
cwd: snapshot.context.projectRoot ?? options.cwd, demandOverride: childDemand,
|
|
426
444
|
exactTargets: placements.map((item) => ({ pluginId: item.pluginId, agent: item.target })),
|
|
427
445
|
nativeActivationOnlyTargets: activationOnlyTargets.filter((item) => item.scope === currentScope
|
|
@@ -433,7 +451,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
433
451
|
.map((item) => ({ pluginId: item.pluginId, platform: 'codex', scope: 'user' })) : [],
|
|
434
452
|
excludedPluginIds: currentScope === 'project' ? userProviders.map((item) => item.pluginId) : [],
|
|
435
453
|
dependencyScopeOverrides: currentScope === 'project'
|
|
436
|
-
? userProviders.filter((provider) =>
|
|
454
|
+
? userProviders.filter((provider) => provider.target !== 'generic'
|
|
437
455
|
&& !placements.some((item) => item.pluginId === provider.pluginId && item.target === provider.target))
|
|
438
456
|
.map((item) => ({ pluginId: item.pluginId, platform: item.target, scope: 'user' })) : [],
|
|
439
457
|
}, runtime);
|
|
@@ -459,6 +477,11 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
459
477
|
if (left.child.options.scope === right.child.options.scope || left.target.agent !== right.target.agent
|
|
460
478
|
|| left.target.skill !== right.target.skill)
|
|
461
479
|
continue;
|
|
480
|
+
if (left.target.providerPluginId === right.target.providerPluginId
|
|
481
|
+
&& left.prepared.logicalIdentity !== '' && left.prepared.logicalIdentity === right.prepared.logicalIdentity
|
|
482
|
+
&& left.target.physicalPath !== right.target.physicalPath
|
|
483
|
+
&& [left, right].every((item) => item.target.observation === 'absent' || item.target.ownership === 'aw'))
|
|
484
|
+
continue;
|
|
462
485
|
const conflict = diagnostic('crossScopeSkillCollision', `${left.target.providerPluginId}@${left.child.options.scope} (${left.target.physicalPath}) 与 ${right.target.providerPluginId}@${right.child.options.scope} (${right.target.physicalPath}) 占用同一 Agent Skill 名。`);
|
|
463
486
|
for (const item of [left, right]) {
|
|
464
487
|
item.child.receipt.targetResults.find((target) => target.pluginId === item.prepared.options.selector && target.agent === item.target.agent)?.blockers.push(conflict);
|
|
@@ -471,7 +494,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
471
494
|
const scopedExtensions = (backend?.live?.components ?? backend?.components ?? []).some((component) => component.kind === 'ownership' && component.key !== 'native'
|
|
472
495
|
&& !component.key.startsWith('activation-') && !component.key.startsWith('marketplace-')
|
|
473
496
|
&& ['present', 'partial'].includes(component.state));
|
|
474
|
-
if (item.scope !== 'project' ||
|
|
497
|
+
if (item.scope !== 'project' || !item.agent || !['codex', 'claude', 'gemini', 'copilot'].includes(item.agent))
|
|
475
498
|
return false;
|
|
476
499
|
return demand.placements.some((placement) => {
|
|
477
500
|
if (placement.pluginId !== item.pluginId || placement.target !== item.agent)
|
|
@@ -499,10 +522,12 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
499
522
|
const retire = currentStatus.extraObserved.filter((item) => item.agent !== null && !requiredNativeActivation(item) && (options.retireUnselectedTargets && (!snapshot.preferences.targets.includes(item.agent)
|
|
500
523
|
|| snapshot.preferences.exclusions.some((entry) => entry.plugin === item.pluginId && entry.target === item.agent))
|
|
501
524
|
|| command === 'uninstall' && explicitlyRemoves(item)
|
|
502
|
-
|| selected.some((placement) => placement.
|
|
525
|
+
|| selected.some((placement) => canReuseProviderAcrossScopes(placement.target)
|
|
526
|
+
&& placement.pluginId === item.pluginId && placement.target === item.agent && placement.scope !== item.scope
|
|
503
527
|
&& (item.delivery?.kind !== 'agent-skills' || item.backend?.logicalIdentity === placement.plugin.catalogLogicalIdentity))));
|
|
504
528
|
for (const item of currentStatus.observedTargets ?? []) {
|
|
505
|
-
if (ownsOutput(item) && !requiredNativeActivation(item) && selected.some((placement) => placement.
|
|
529
|
+
if (ownsOutput(item) && !requiredNativeActivation(item) && selected.some((placement) => canReuseProviderAcrossScopes(placement.target)
|
|
530
|
+
&& placement.pluginId === item.pluginId
|
|
506
531
|
&& placement.target === item.agent && placement.scope !== item.scope)
|
|
507
532
|
&& !demand.placements.some((placement) => placement.pluginId === item.pluginId
|
|
508
533
|
&& placement.target === item.agent && placement.scope === item.scope))
|
|
@@ -523,28 +548,11 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
523
548
|
continue;
|
|
524
549
|
retire.push(item);
|
|
525
550
|
}
|
|
526
|
-
// Conflicting replacements are filtered before child preparation. Keep the
|
|
527
|
-
// affected plugins' old outputs even when that leaves no deployment child.
|
|
528
|
-
const blockedReplacementPlugins = new Set(demand.conflicts.flatMap((conflict) => [...conflict.left.plugins, ...conflict.right.plugins]));
|
|
529
|
-
const safeRetirements = retire.filter((item) => !blockedReplacementPlugins.has(item.pluginId));
|
|
530
|
-
const retiringKeys = new Set(safeRetirements.map((item) => `${item.pluginId}\0${item.agent}\0${item.scope}`));
|
|
531
|
-
const remainingPositions = currentStatus.extraObserved.filter((item) => item.agent !== null
|
|
532
|
-
&& !retiringKeys.has(`${item.pluginId}\0${item.agent}\0${item.scope}`))
|
|
533
|
-
.map((item) => ({ pluginId: item.pluginId, target: item.agent, scope: item.scope }));
|
|
534
|
-
const remainingConflicts = findPlacementConflicts([...demand.placements, ...remainingPositions]);
|
|
535
|
-
if (remainingConflicts.length) {
|
|
536
|
-
plan.receipt.blockers.push(...remainingConflicts);
|
|
537
|
-
for (const child of children)
|
|
538
|
-
for (const target of child.receipt.targetResults) {
|
|
539
|
-
if (remainingConflicts.some((conflict) => [conflict.left, conflict.right].some((position) => position.target === target.agent && position.scope === target.scope)))
|
|
540
|
-
target.blockers.push(diagnostic('targetPlacementConflict'));
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
551
|
const deploymentBlocked = children.some((child) => child.blockExecution
|
|
544
552
|
|| child.receipt.targetResults.some((item) => item.blockers.length));
|
|
545
553
|
if (!plan.blockExecution && !deploymentBlocked) {
|
|
546
554
|
const cleanups = [];
|
|
547
|
-
const pendingRetirements = [...new Map(
|
|
555
|
+
const pendingRetirements = [...new Map(retire.map((entry) => [`${entry.pluginId}\0${entry.agent}\0${entry.scope}`, entry])).values()];
|
|
548
556
|
const orderedRetirements = [];
|
|
549
557
|
while (pendingRetirements.length) {
|
|
550
558
|
const ready = pendingRetirements.findIndex((candidate) => !pendingRetirements.some((consumer) => consumer !== candidate && consumer.agent === candidate.agent
|
|
@@ -562,6 +570,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
562
570
|
demand.placements.filter((placement) => placement.scope === 'user' && placement.target === target)
|
|
563
571
|
.map((placement) => placement.pluginId)])), } : snapshot.user;
|
|
564
572
|
const cleanup = await prepareScopedRecovery('cleanup', [item.pluginId], { ...options,
|
|
573
|
+
sharedReferenceView,
|
|
565
574
|
scope: item.scope, cwd: snapshot.context.projectRoot ?? options.cwd, targets: [item.agent], all: false,
|
|
566
575
|
// Ordinary remove's force bypasses dependencies, never ownership checks.
|
|
567
576
|
force: false, exactTargets: undefined, demandOverride: cleanupDemand }, runtime);
|
|
@@ -577,6 +586,49 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
|
|
|
577
586
|
}
|
|
578
587
|
children.unshift(...cleanups);
|
|
579
588
|
}
|
|
589
|
+
// The first preview already seals every target in its native group. A lone
|
|
590
|
+
// Gemini/Copilot ensure group has no later sibling contribution to refresh here.
|
|
591
|
+
const onlyChild = children.length === 1 ? children[0] : undefined;
|
|
592
|
+
const onlyGroup = onlyChild?.nativeGroups.length === 1 ? onlyChild.nativeGroups[0] : undefined;
|
|
593
|
+
const singleNativePreviewComplete = !plan.blockExecution && onlyChild !== undefined && !onlyChild.blockExecution
|
|
594
|
+
&& onlyChild.command === 'sync' && (onlyGroup?.platform === 'gemini' || onlyGroup?.platform === 'copilot')
|
|
595
|
+
&& onlyGroup.command === 'sync'
|
|
596
|
+
&& onlyGroup.preview.operationPlan !== undefined
|
|
597
|
+
&& (onlyGroup.preview.operationPlan.deploymentPlans?.length ?? 0) > 0
|
|
598
|
+
&& onlyGroup.preview.operationPlan.deploymentPlans.every((deployment) => deployment.operation === 'ensure')
|
|
599
|
+
&& onlyChild.receipt.targetResults.length > 0
|
|
600
|
+
&& onlyChild.receipt.targetResults.every((target) => target.blockers.length === 0)
|
|
601
|
+
&& onlyChild.portableGroups.length === 0 && onlyChild.portableProtectionGroups.length === 0
|
|
602
|
+
&& onlyChild.portableResidues.length === 0;
|
|
603
|
+
// Other scopes and groups can change shared descriptors, preApply actions
|
|
604
|
+
// or retained packages. Refresh those previews before exposing Review.
|
|
605
|
+
if (!singleNativePreviewComplete)
|
|
606
|
+
for (const child of children)
|
|
607
|
+
await refreshRecoveryNativePreviews(child);
|
|
608
|
+
const preparedNativeTargets = children.flatMap((child) => child.receipt.targetResults)
|
|
609
|
+
.filter((target) => target.delivery?.kind === 'native');
|
|
610
|
+
const failedProviders = preparedNativeTargets.filter((target) => target.blockers.length > 0);
|
|
611
|
+
for (const target of preparedNativeTargets) {
|
|
612
|
+
const placement = demand.placements.find((item) => item.pluginId === target.pluginId
|
|
613
|
+
&& item.target === target.agent && item.scope === target.scope);
|
|
614
|
+
if (!placement)
|
|
615
|
+
continue;
|
|
616
|
+
for (const provider of failedProviders) {
|
|
617
|
+
if (provider === target || provider.agent !== target.agent)
|
|
618
|
+
continue;
|
|
619
|
+
const dependency = demand.placements.find((item) => item.pluginId === provider.pluginId
|
|
620
|
+
&& item.target === provider.agent && item.scope === provider.scope);
|
|
621
|
+
if (!dependency?.contributions.some((contribution) => placement.contributions.some((parent) => parent.root === contribution.root && parent.scope === contribution.scope
|
|
622
|
+
&& parent.path.length < contribution.path.length
|
|
623
|
+
&& parent.path.every((pluginId, index) => pluginId === contribution.path[index]))))
|
|
624
|
+
continue;
|
|
625
|
+
for (const blocker of provider.blockers)
|
|
626
|
+
if (!target.blockers.some((entry) => entry.code === blocker.code && entry.pluginId === provider.pluginId)) {
|
|
627
|
+
target.blockers.push({ ...blocker, pluginId: provider.pluginId });
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
finalizePreparedPlatformRebuildSession(runtime.preparedArtifactRenderResults);
|
|
580
632
|
plan.sourceRefreshes = [...new Map(children.flatMap((child) => child.sourceRefreshes).map((item) => [item.sourceId, item])).values()];
|
|
581
633
|
plan.sourceRefreshFailures = [...new Map(children.flatMap((child) => child.sourceRefreshFailures).map((item) => [item.sourceId, item])).values()];
|
|
582
634
|
plan.changes.push(...children.flatMap((child) => child.changes));
|
|
@@ -678,7 +730,7 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
678
730
|
if (!joint.originalOptions.existingOnly)
|
|
679
731
|
child.demand.intent = currentIntent;
|
|
680
732
|
const fresh = await measureRecoveryPerformanceStage(runtime, 'recovery.child.plan', () => prepareScopedRecovery(child.command, typeof pluginIds === 'string' ? [pluginIds] : pluginIds, {
|
|
681
|
-
...child.options, targets: agent
|
|
733
|
+
...child.options, targets: agent !== 'generic' ? child.options.targets : [agent], all: false,
|
|
682
734
|
exactTargets: child.options.exactTargets?.filter((target) => (typeof pluginIds === 'string' ? [pluginIds] : pluginIds).includes(target.pluginId)),
|
|
683
735
|
}, runtime));
|
|
684
736
|
fresh.originalIntent = observationEvidence(currentIntent);
|
|
@@ -693,10 +745,12 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
693
745
|
target.blockers.push(...(reviewed?.blockers ?? []).filter((error) => reviewed?.execution === 'failed'
|
|
694
746
|
|| ['configApplyRequiresExistingOutput', 'crossScopeSkillCollision', 'targetPlacementConflict',
|
|
695
747
|
'preApplyAuthorizationRequired', 'nativeToolAuthorizationRequired', 'providerSwitchPreApplyFailed', 'dependencyStillRequired'].includes(error.code)));
|
|
696
|
-
if (reviewed?.execution === 'failed')
|
|
748
|
+
if (reviewed?.execution === 'failed') {
|
|
697
749
|
target.execution = 'failed';
|
|
698
|
-
|
|
699
|
-
|
|
750
|
+
if (reviewed.backend)
|
|
751
|
+
target.backend = reviewed.backend;
|
|
752
|
+
}
|
|
753
|
+
if (child.command !== 'cleanup' && failedCleanups.some((failed) => failed.agent === target.agent && (failed.pluginId === target.pluginId || joint.demand.roots.some((root) => root.pluginId === target.pluginId && root.target === target.agent && root.dependencies.includes(failed.pluginId))))) {
|
|
700
754
|
target.blockers.push(diagnostic('providerSwitchCleanupFailed'));
|
|
701
755
|
}
|
|
702
756
|
const dependencies = joint.demand.placements.filter((placement) => placement.target === target.agent
|
|
@@ -731,6 +785,10 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
731
785
|
const replacementFailures = new Set();
|
|
732
786
|
for (const child of joint.children.filter((child) => child.command !== 'cleanup')) {
|
|
733
787
|
for (const target of child.receipt.targetResults) {
|
|
788
|
+
if (replacementFailures.has(`${target.pluginId}\0${target.agent}`)) {
|
|
789
|
+
target.blockers.push(diagnostic('dependencyApplyFailed'));
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
734
792
|
if (child.options.nativeActivationOnlyTargets?.some((item) => item.pluginId === target.pluginId
|
|
735
793
|
&& item.platform === target.agent && item.scope === target.scope))
|
|
736
794
|
continue;
|
|
@@ -789,7 +847,7 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
789
847
|
for (const target of child.receipt.requestedTargets)
|
|
790
848
|
nodeFor(target.pluginId, target.scope).targets.push({ child, agent: target.agent });
|
|
791
849
|
}
|
|
792
|
-
const hasNative = (node) => node.targets.some(({ agent }) => agent
|
|
850
|
+
const hasNative = (node) => node.targets.some(({ agent }) => agent !== 'generic');
|
|
793
851
|
for (const target of packages?.targets ?? []) {
|
|
794
852
|
const sameScope = nodes.get(`${target.pluginId}\0${target.scope}`);
|
|
795
853
|
const native = sameScope && hasNative(sameScope) ? sameScope
|
|
@@ -799,15 +857,17 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
799
857
|
}
|
|
800
858
|
for (const node of nodes.values()) {
|
|
801
859
|
for (const { agent } of node.targets) {
|
|
802
|
-
const plugin = joint.demand.placements.find((item) => item.pluginId === node.pluginId && item.target === agent)?.plugin;
|
|
860
|
+
const plugin = joint.demand.placements.find((item) => item.pluginId === node.pluginId && item.target === agent && item.scope === node.scope)?.plugin;
|
|
803
861
|
for (const name of plugin?.manifest.dependencies ?? []) {
|
|
804
862
|
const pluginId = `${plugin.sourceId}/${name}`;
|
|
805
|
-
const
|
|
863
|
+
const providers = joint.demand.placements.filter((item) => item.pluginId === pluginId && item.target === agent);
|
|
864
|
+
const provider = providers.find((item) => item.scope === node.scope) ?? providers.find((item) => item.scope === 'user');
|
|
806
865
|
if (provider)
|
|
807
866
|
node.dependencies.add(`${pluginId}\0${provider.scope}`);
|
|
808
867
|
}
|
|
809
868
|
}
|
|
810
|
-
if (node.scope === 'project' &&
|
|
869
|
+
if (node.scope === 'project' && node.targets.some(({ agent }) => ['codex', 'claude', 'gemini', 'copilot'].includes(agent))
|
|
870
|
+
&& nodes.has(`${node.pluginId}\0user`))
|
|
811
871
|
node.dependencies.add(`${node.pluginId}\0user`);
|
|
812
872
|
for (const dependency of node.packages?.flatMap((item) => item.dependencies) ?? []) {
|
|
813
873
|
for (const provider of nodes.values())
|
|
@@ -852,7 +912,7 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
852
912
|
};
|
|
853
913
|
while (pending.length) {
|
|
854
914
|
const index = pending.findIndex((node) => {
|
|
855
|
-
const groups = node.targets.filter(({ child, agent }) =>
|
|
915
|
+
const groups = node.targets.filter(({ child, agent }) => agent !== 'generic' && !executedNativeChildren.has(child));
|
|
856
916
|
const members = new Set([node, ...groups.flatMap(({ child }) => pending.filter((candidate) => candidate.targets.some((target) => target.child === child)))]);
|
|
857
917
|
return [...members].every((member) => [...member.dependencies].every((key) => !pending.some((candidate) => !members.has(candidate) && `${candidate.pluginId}\0${candidate.scope}` === key)));
|
|
858
918
|
});
|
|
@@ -891,7 +951,7 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
891
951
|
}
|
|
892
952
|
}
|
|
893
953
|
for (const { child, agent } of node.targets) {
|
|
894
|
-
const native = agent
|
|
954
|
+
const native = agent !== 'generic';
|
|
895
955
|
if (native && executedNativeChildren.has(child))
|
|
896
956
|
continue;
|
|
897
957
|
if (native)
|