@lesliechan721/aw 0.1.0-beta.8 → 0.1.0-beta.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring/assets/aw-config.mjs +100 -501
- package/dist/authoring/assets/aw-config.mjs.map +1 -1
- package/dist/authoring/assets/aw-runtime-config.d.mts +13 -0
- package/dist/authoring/assets/aw-runtime-config.mjs +221 -0
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
- package/dist/authoring/scripts/add-skill.mjs +17 -40
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +74 -98
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-root.mjs +4 -4
- package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +230 -9
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +79 -92
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +103 -127
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/remove-plugin.mjs +2 -2
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +490 -2841
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-skill.mjs +1 -1
- package/dist/native-runtime/reader-runtime.mjs +34 -0
- package/dist/native-runtime/reader.d.mts +6 -0
- package/dist/native-runtime/reader.mjs +11 -0
- package/dist/scripts/aw-skill-eval-materializer.d.ts +30 -0
- package/dist/scripts/aw-skill-eval-materializer.js +278 -0
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
- package/dist/scripts/bundle-plugins.d.ts +1 -0
- package/dist/scripts/bundle-plugins.js +27 -8
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +7 -8
- package/dist/scripts/plugin-staging.js +16 -15
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/scripts/plugin-test-reporter.d.mts +2 -0
- package/dist/scripts/plugin-test-reporter.mjs +21 -0
- package/dist/scripts/plugin-test-reporter.mjs.map +1 -0
- package/dist/scripts/test-plugin-scripts.d.ts +5 -0
- package/dist/scripts/test-plugin-scripts.js +273 -78
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/scripts/test-workers.d.mts +24 -0
- package/dist/scripts/test-workers.mjs +59 -0
- package/dist/scripts/test-workers.mjs.map +1 -0
- package/dist/src/adapters/helpers.d.ts +7 -0
- package/dist/src/adapters/helpers.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +5 -1
- package/dist/src/authoring/workspace-commands.js +7 -2
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +2 -2
- package/dist/src/commands/aw-capabilities.js +41 -29
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/catalog-dev-source.d.ts +58 -13
- package/dist/src/commands/catalog-dev-source.js +549 -305
- package/dist/src/commands/catalog-dev-source.js.map +1 -1
- package/dist/src/commands/catalog-generation.d.ts +14 -19
- package/dist/src/commands/catalog-generation.js +5 -10
- package/dist/src/commands/catalog-generation.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.d.ts +70 -30
- package/dist/src/commands/catalog-publication-inspection.js +511 -91
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
- package/dist/src/commands/catalog-publication-journal.d.ts +68 -0
- package/dist/src/commands/catalog-publication-journal.js +292 -0
- package/dist/src/commands/catalog-publication-journal.js.map +1 -0
- package/dist/src/commands/catalog-publication-target.d.ts +2 -1
- package/dist/src/commands/catalog-publication-target.js +37 -2
- package/dist/src/commands/catalog-publication-target.js.map +1 -1
- package/dist/src/commands/catalog-publish.d.ts +82 -15
- package/dist/src/commands/catalog-publish.js +722 -219
- package/dist/src/commands/catalog-publish.js.map +1 -1
- package/dist/src/commands/catalog-source.d.ts +55 -35
- package/dist/src/commands/catalog-source.js +298 -148
- package/dist/src/commands/catalog-source.js.map +1 -1
- package/dist/src/commands/catalog-status.d.ts +6 -26
- package/dist/src/commands/catalog-status.js +9 -147
- package/dist/src/commands/catalog-status.js.map +1 -1
- package/dist/src/commands/catalog-store.d.ts +104 -0
- package/dist/src/commands/catalog-store.js +685 -0
- package/dist/src/commands/catalog-store.js.map +1 -0
- package/dist/src/commands/catalog-workspace-resolution.d.ts +17 -0
- package/dist/src/commands/catalog-workspace-resolution.js +57 -0
- package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
- package/dist/src/commands/console.js +32 -20
- package/dist/src/commands/console.js.map +1 -1
- package/dist/src/commands/dependency-operation-plan.d.ts +52 -15
- package/dist/src/commands/dependency-operation-plan.js +289 -7
- 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/init.d.ts +5 -11
- package/dist/src/commands/init.js +30 -51
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/intent-command.d.ts +32 -0
- package/dist/src/commands/intent-command.js +171 -0
- package/dist/src/commands/intent-command.js.map +1 -0
- package/dist/src/commands/managed-commands.d.ts +35 -0
- package/dist/src/commands/managed-commands.js +361 -0
- package/dist/src/commands/managed-commands.js.map +1 -0
- package/dist/src/commands/offline-cleanup-evidence.d.ts +46 -0
- package/dist/src/commands/offline-cleanup-evidence.js +158 -10
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +190 -0
- package/dist/src/commands/operation-plan.js +99 -0
- package/dist/src/commands/operation-plan.js.map +1 -0
- package/dist/src/commands/operation-planner.d.ts +47 -0
- package/dist/src/commands/operation-planner.js +142 -0
- package/dist/src/commands/operation-planner.js.map +1 -0
- package/dist/src/commands/options.d.ts +16 -20
- package/dist/src/commands/options.js +94 -41
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +88 -45
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.d.ts +8 -0
- package/dist/src/commands/public-config-confirmation.js +56 -0
- package/dist/src/commands/public-config-confirmation.js.map +1 -0
- package/dist/src/commands/public-interruption.d.ts +9 -0
- package/dist/src/commands/public-interruption.js +23 -0
- package/dist/src/commands/public-interruption.js.map +1 -0
- package/dist/src/commands/public-lifecycle-result.d.ts +102 -0
- package/dist/src/commands/public-lifecycle-result.js +307 -0
- package/dist/src/commands/public-lifecycle-result.js.map +1 -0
- package/dist/src/commands/public-lifecycle.d.ts +28 -0
- package/dist/src/commands/public-lifecycle.js +492 -0
- package/dist/src/commands/public-lifecycle.js.map +1 -0
- package/dist/src/commands/public-plugin-query.d.ts +16 -0
- package/dist/src/commands/public-plugin-query.js +193 -0
- package/dist/src/commands/public-plugin-query.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +166 -28
- package/dist/src/commands/rebuild-command.js +3745 -813
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +137 -25
- package/dist/src/commands/rebuild-integration.js +1343 -2535
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +73 -22
- package/dist/src/commands/rebuild-operations.js +313 -216
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +62 -0
- package/dist/src/commands/rebuild-platform-integration.js +1317 -0
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
- package/dist/src/commands/reconcile-operation-plan.d.ts +28 -0
- package/dist/src/commands/reconcile-operation-plan.js +47 -0
- package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
- package/dist/src/commands/review-inspection.d.ts +60 -0
- package/dist/src/commands/review-inspection.js +436 -0
- package/dist/src/commands/review-inspection.js.map +1 -0
- package/dist/src/commands/review-preparation.d.ts +51 -0
- package/dist/src/commands/review-preparation.js +400 -0
- package/dist/src/commands/review-preparation.js.map +1 -0
- package/dist/src/commands/runtime.d.ts +6 -6
- package/dist/src/commands/runtime.js +44 -24
- package/dist/src/commands/runtime.js.map +1 -1
- package/dist/src/commands/skill-eval.d.ts +41 -0
- package/dist/src/commands/skill-eval.js +407 -0
- package/dist/src/commands/skill-eval.js.map +1 -0
- package/dist/src/commands/status-v6.d.ts +319 -0
- package/dist/src/commands/status-v6.js +2979 -0
- package/dist/src/commands/status-v6.js.map +1 -0
- package/dist/src/commands/targets-command.d.ts +38 -0
- package/dist/src/commands/targets-command.js +182 -0
- package/dist/src/commands/targets-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +8 -5
- package/dist/src/commands/wizard.js +7 -4
- package/dist/src/commands/wizard.js.map +1 -1
- package/dist/src/commands/write-commands.d.ts +9 -3
- package/dist/src/commands/write-commands.js +143 -85
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +6 -6
- package/dist/src/constants.js +6 -6
- package/dist/src/constants.js.map +1 -1
- package/dist/src/eval/manifest-v1.d.ts +70 -0
- package/dist/src/eval/manifest-v1.js +358 -0
- package/dist/src/eval/manifest-v1.js.map +1 -0
- package/dist/src/generators/local-plugin.d.ts +7 -2
- package/dist/src/generators/local-plugin.js +313 -389
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/generators/permissions.d.ts +5 -2
- package/dist/src/generators/permissions.js +28 -15
- package/dist/src/generators/permissions.js.map +1 -1
- package/dist/src/index.d.ts +2 -31
- package/dist/src/index.js +1666 -1827
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/deployment-preferences.d.ts +63 -0
- package/dist/src/intent/deployment-preferences.js +170 -0
- package/dist/src/intent/deployment-preferences.js.map +1 -0
- package/dist/src/intent/diagnostics.d.ts +11 -0
- package/dist/src/intent/diagnostics.js +14 -0
- package/dist/src/intent/diagnostics.js.map +1 -0
- package/dist/src/intent/intent-codec.d.ts +19 -0
- package/dist/src/intent/intent-codec.js +117 -0
- package/dist/src/intent/intent-codec.js.map +1 -0
- package/dist/src/intent/intent-store.d.ts +43 -0
- package/dist/src/intent/intent-store.js +118 -0
- package/dist/src/intent/intent-store.js.map +1 -0
- package/dist/src/intent/scope-context.d.ts +33 -0
- package/dist/src/intent/scope-context.js +149 -0
- package/dist/src/intent/scope-context.js.map +1 -0
- package/dist/src/intent/work-context.d.ts +13 -0
- package/dist/src/intent/work-context.js +22 -0
- package/dist/src/intent/work-context.js.map +1 -0
- package/dist/src/output/command-receipt.d.ts +47 -46
- package/dist/src/output/command-receipt.js +286 -79
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/model.d.ts +3 -11
- 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.d.ts +49 -0
- package/dist/src/output/public-result.js +240 -0
- package/dist/src/output/public-result.js.map +1 -0
- package/dist/src/output/rebuild-progress.js +20 -15
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.d.ts +7 -0
- package/dist/src/output/receipt-projection.js +592 -0
- package/dist/src/output/receipt-projection.js.map +1 -0
- package/dist/src/platforms/capabilities.d.ts +12 -0
- package/dist/src/platforms/capabilities.js +205 -0
- package/dist/src/platforms/capabilities.js.map +1 -0
- package/dist/src/platforms/contracts.d.ts +358 -0
- package/dist/src/platforms/contracts.js +2 -0
- package/dist/src/platforms/contracts.js.map +1 -0
- package/dist/src/platforms/cursor-workspace-hook.d.ts +28 -0
- package/dist/src/platforms/cursor-workspace-hook.js +198 -0
- package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
- package/dist/src/platforms/discovery.d.ts +91 -0
- package/dist/src/platforms/discovery.js +653 -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 +81 -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 +212 -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 +406 -0
- package/dist/src/platforms/inspection-native.js.map +1 -0
- package/dist/src/platforms/inspection-opencode.d.ts +4 -0
- package/dist/src/platforms/inspection-opencode.js +98 -0
- package/dist/src/platforms/inspection-opencode.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +3 -0
- package/dist/src/platforms/inspection-pi.js +282 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection-query.d.ts +12 -0
- package/dist/src/platforms/inspection-query.js +96 -0
- package/dist/src/platforms/inspection-query.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +17 -0
- package/dist/src/platforms/inspection.js +227 -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 +283 -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 +494 -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/platforms/supplement-state.d.ts +13 -0
- package/dist/src/platforms/supplement-state.js +82 -0
- package/dist/src/platforms/supplement-state.js.map +1 -0
- package/dist/src/portable/commands.d.ts +58 -11
- package/dist/src/portable/commands.js +94 -350
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/historical-materialization.d.ts +22 -0
- package/dist/src/portable/historical-materialization.js +124 -0
- package/dist/src/portable/historical-materialization.js.map +1 -0
- package/dist/src/portable/materializer.d.ts +24 -4
- package/dist/src/portable/materializer.js +189 -259
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.d.ts +17 -0
- package/dist/src/portable/recovery-layout.js +42 -0
- package/dist/src/portable/recovery-layout.js.map +1 -0
- package/dist/src/portable/recovery.d.ts +153 -0
- package/dist/src/portable/recovery.js +367 -0
- package/dist/src/portable/recovery.js.map +1 -0
- package/dist/src/portable/writer.d.ts +67 -0
- package/dist/src/portable/writer.js +321 -0
- package/dist/src/portable/writer.js.map +1 -0
- package/dist/src/recovery/coordinator.d.ts +141 -0
- package/dist/src/recovery/coordinator.js +1254 -0
- package/dist/src/recovery/coordinator.js.map +1 -0
- package/dist/src/recovery/demand.d.ts +51 -0
- package/dist/src/recovery/demand.js +159 -0
- package/dist/src/recovery/demand.js.map +1 -0
- package/dist/src/recovery/joint-coordinator.d.ts +25 -0
- package/dist/src/recovery/joint-coordinator.js +991 -0
- package/dist/src/recovery/joint-coordinator.js.map +1 -0
- package/dist/src/recovery/joint-demand.d.ts +50 -0
- package/dist/src/recovery/joint-demand.js +197 -0
- package/dist/src/recovery/joint-demand.js.map +1 -0
- package/dist/src/recovery/performance.d.ts +4 -0
- package/dist/src/recovery/performance.js +26 -0
- package/dist/src/recovery/performance.js.map +1 -0
- package/dist/src/recovery/receipt.d.ts +98 -0
- package/dist/src/recovery/receipt.js +2 -0
- package/dist/src/recovery/receipt.js.map +1 -0
- package/dist/src/recovery/retirement.d.ts +47 -0
- package/dist/src/recovery/retirement.js +469 -0
- package/dist/src/recovery/retirement.js.map +1 -0
- package/dist/src/recovery/status.d.ts +126 -0
- package/dist/src/recovery/status.js +1073 -0
- package/dist/src/recovery/status.js.map +1 -0
- package/dist/src/recovery/types.d.ts +85 -0
- package/dist/src/recovery/types.js +2 -0
- package/dist/src/recovery/types.js.map +1 -0
- package/dist/src/review/eval-source-input.d.ts +43 -0
- package/dist/src/review/eval-source-input.js +207 -0
- package/dist/src/review/eval-source-input.js.map +1 -0
- package/dist/src/review/platform-profile.d.ts +3 -0
- package/dist/src/review/platform-profile.js +14 -0
- package/dist/src/review/platform-profile.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +20 -0
- package/dist/src/review/review-profile.js +276 -0
- package/dist/src/review/review-profile.js.map +1 -0
- package/dist/src/review/review-selection.d.ts +20 -0
- package/dist/src/review/review-selection.js +495 -0
- package/dist/src/review/review-selection.js.map +1 -0
- package/dist/src/review/review-types.d.ts +71 -0
- package/dist/src/review/review-types.js +16 -0
- package/dist/src/review/review-types.js.map +1 -0
- package/dist/src/review/skill-materialization.d.ts +62 -0
- package/dist/src/review/skill-materialization.js +205 -0
- package/dist/src/review/skill-materialization.js.map +1 -0
- package/dist/src/review/source-binding.d.ts +201 -0
- package/dist/src/review/source-binding.js +773 -0
- package/dist/src/review/source-binding.js.map +1 -0
- package/dist/src/tui/agent-management.d.ts +23 -0
- package/dist/src/tui/agent-management.js +319 -0
- package/dist/src/tui/agent-management.js.map +1 -0
- package/dist/src/tui/agent-settings.d.ts +47 -0
- package/dist/src/tui/agent-settings.js +97 -0
- package/dist/src/tui/agent-settings.js.map +1 -0
- package/dist/src/tui/catalog-freshness.d.ts +1 -0
- package/dist/src/tui/catalog-freshness.js +2 -0
- package/dist/src/tui/catalog-freshness.js.map +1 -0
- package/dist/src/tui/catalog-generation.d.ts +18 -53
- package/dist/src/tui/catalog-generation.js +136 -224
- package/dist/src/tui/catalog-generation.js.map +1 -1
- package/dist/src/tui/catalog-sources/projection.d.ts +4 -0
- package/dist/src/tui/catalog-sources/projection.js +17 -0
- package/dist/src/tui/catalog-sources/projection.js.map +1 -0
- package/dist/src/tui/catalog-sources/review.d.ts +3 -0
- package/dist/src/tui/catalog-sources/review.js +13 -0
- package/dist/src/tui/catalog-sources/review.js.map +1 -0
- package/dist/src/tui/catalog-sources/screens.d.ts +12 -0
- package/dist/src/tui/catalog-sources/screens.js +40 -0
- package/dist/src/tui/catalog-sources/screens.js.map +1 -0
- package/dist/src/tui/catalog-sources/session.d.ts +32 -0
- package/dist/src/tui/catalog-sources/session.js +300 -0
- package/dist/src/tui/catalog-sources/session.js.map +1 -0
- package/dist/src/tui/catalog-sources/types.d.ts +54 -0
- package/dist/src/tui/catalog-sources/types.js +2 -0
- package/dist/src/tui/catalog-sources/types.js.map +1 -0
- package/dist/src/tui/catalog-store-task.d.ts +16 -0
- package/dist/src/tui/catalog-store-task.js +19 -0
- package/dist/src/tui/catalog-store-task.js.map +1 -0
- package/dist/src/tui/clipboard.d.ts +13 -0
- package/dist/src/tui/clipboard.js +95 -0
- package/dist/src/tui/clipboard.js.map +1 -0
- package/dist/src/tui/components.d.ts +113 -3
- package/dist/src/tui/components.js +201 -36
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/config-array-draft.d.ts +29 -0
- package/dist/src/tui/config-array-draft.js +48 -0
- package/dist/src/tui/config-array-draft.js.map +1 -0
- package/dist/src/tui/config-leaf-editor.d.ts +43 -0
- package/dist/src/tui/config-leaf-editor.js +224 -0
- package/dist/src/tui/config-leaf-editor.js.map +1 -0
- package/dist/src/tui/config-references.d.ts +38 -0
- package/dist/src/tui/config-references.js +82 -0
- package/dist/src/tui/config-references.js.map +1 -0
- package/dist/src/tui/config-value-presentation.d.ts +20 -0
- package/dist/src/tui/config-value-presentation.js +104 -0
- package/dist/src/tui/config-value-presentation.js.map +1 -0
- package/dist/src/tui/console-app-v4.d.ts +13 -4
- package/dist/src/tui/console-app-v4.js +9764 -2210
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/content-item-card.d.ts +13 -0
- package/dist/src/tui/content-item-card.js +51 -0
- package/dist/src/tui/content-item-card.js.map +1 -0
- package/dist/src/tui/controller-runtime.d.ts +7 -4
- package/dist/src/tui/controller-runtime.js +2064 -779
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +669 -106
- package/dist/src/tui/controller.js +3617 -971
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/dependency-graph-view.d.ts +39 -0
- package/dist/src/tui/dependency-graph-view.js +121 -0
- package/dist/src/tui/dependency-graph-view.js.map +1 -0
- package/dist/src/tui/dependency-graph.d.ts +81 -0
- package/dist/src/tui/dependency-graph.js +452 -0
- package/dist/src/tui/dependency-graph.js.map +1 -0
- package/dist/src/tui/deployment-view.d.ts +10 -0
- package/dist/src/tui/deployment-view.js +108 -0
- package/dist/src/tui/deployment-view.js.map +1 -0
- package/dist/src/tui/diagnostic-projection.d.ts +23 -0
- package/dist/src/tui/diagnostic-projection.js +595 -0
- package/dist/src/tui/diagnostic-projection.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +6 -3
- package/dist/src/tui/diagnostics.js +14 -2
- package/dist/src/tui/diagnostics.js.map +1 -1
- package/dist/src/tui/entity-cards.d.ts +55 -0
- package/dist/src/tui/entity-cards.js +298 -0
- package/dist/src/tui/entity-cards.js.map +1 -0
- package/dist/src/tui/glossary.d.ts +25 -0
- package/dist/src/tui/glossary.js +72 -0
- package/dist/src/tui/glossary.js.map +1 -0
- package/dist/src/tui/index.d.ts +6 -2
- package/dist/src/tui/index.js +5 -2
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/input-display.d.ts +1 -0
- package/dist/src/tui/input-display.js +23 -1
- package/dist/src/tui/input-display.js.map +1 -1
- package/dist/src/tui/keys.d.ts +44 -0
- package/dist/src/tui/keys.js +43 -15
- package/dist/src/tui/keys.js.map +1 -1
- package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
- package/dist/src/tui/lifecycle-action-view.js +36 -0
- package/dist/src/tui/lifecycle-action-view.js.map +1 -0
- package/dist/src/tui/model.d.ts +243 -45
- package/dist/src/tui/model.js +1402 -415
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.d.ts +8 -0
- package/dist/src/tui/operation-diagnostic-screens.js +72 -0
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
- package/dist/src/tui/operation-history.d.ts +82 -0
- package/dist/src/tui/operation-history.js +136 -0
- package/dist/src/tui/operation-history.js.map +1 -0
- package/dist/src/tui/operation-review-planner.d.ts +28 -0
- package/dist/src/tui/operation-review-planner.js +1396 -0
- package/dist/src/tui/operation-review-planner.js.map +1 -0
- package/dist/src/tui/plugin-content.d.ts +33 -0
- package/dist/src/tui/plugin-content.js +245 -0
- package/dist/src/tui/plugin-content.js.map +1 -0
- package/dist/src/tui/plugin-detail.d.ts +72 -0
- package/dist/src/tui/plugin-detail.js +260 -0
- package/dist/src/tui/plugin-detail.js.map +1 -0
- package/dist/src/tui/plugin-write-task.d.ts +69 -0
- package/dist/src/tui/plugin-write-task.js +286 -0
- package/dist/src/tui/plugin-write-task.js.map +1 -0
- package/dist/src/tui/prompt.js +4 -15
- package/dist/src/tui/prompt.js.map +1 -1
- package/dist/src/tui/query-header.d.ts +30 -0
- package/dist/src/tui/query-header.js +40 -0
- package/dist/src/tui/query-header.js.map +1 -0
- package/dist/src/tui/reader.d.ts +38 -0
- package/dist/src/tui/reader.js +49 -0
- package/dist/src/tui/reader.js.map +1 -0
- package/dist/src/tui/router.d.ts +186 -35
- package/dist/src/tui/router.js +338 -50
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/scoped-flow.d.ts +45 -0
- package/dist/src/tui/scoped-flow.js +96 -0
- package/dist/src/tui/scoped-flow.js.map +1 -0
- package/dist/src/tui/scoped-inventory.d.ts +126 -0
- package/dist/src/tui/scoped-inventory.js +258 -0
- package/dist/src/tui/scoped-inventory.js.map +1 -0
- package/dist/src/tui/screen-registry.d.ts +701 -0
- package/dist/src/tui/screen-registry.js +226 -0
- package/dist/src/tui/screen-registry.js.map +1 -0
- package/dist/src/tui/session-console-app.d.ts +6 -0
- package/dist/src/tui/session-console-app.js +13 -0
- package/dist/src/tui/session-console-app.js.map +1 -0
- package/dist/src/tui/session-host.d.ts +45 -0
- package/dist/src/tui/session-host.js +219 -0
- package/dist/src/tui/session-host.js.map +1 -0
- package/dist/src/tui/source-detail-card.d.ts +29 -0
- package/dist/src/tui/source-detail-card.js +45 -0
- package/dist/src/tui/source-detail-card.js.map +1 -0
- package/dist/src/tui/theme.d.ts +12 -0
- package/dist/src/tui/theme.js +12 -0
- package/dist/src/tui/theme.js.map +1 -1
- package/dist/src/tui/viewport.d.ts +1 -0
- package/dist/src/tui/viewport.js +23 -0
- package/dist/src/tui/viewport.js.map +1 -1
- package/dist/src/tui/wizard.js +37 -13
- package/dist/src/tui/wizard.js.map +1 -1
- package/dist/src/types.d.ts +220 -118
- package/dist/src/types.js +1 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +13 -4
- package/dist/src/utils/agent-version.js +27 -4
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +33 -7
- package/dist/src/utils/artifact-plan.js +115 -430
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +114 -83
- package/dist/src/utils/artifact-renderer.js +213 -364
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +44 -0
- package/dist/src/utils/artifact-request.js +80 -0
- package/dist/src/utils/artifact-request.js.map +1 -0
- package/dist/src/utils/artifact-sources.d.ts +6 -2
- package/dist/src/utils/artifact-sources.js +17 -0
- package/dist/src/utils/artifact-sources.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +57 -173
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
- package/dist/src/utils/catalog-capability-projection.js +14 -0
- package/dist/src/utils/catalog-capability-projection.js.map +1 -0
- package/dist/src/utils/catalog-digests.d.ts +2 -2
- package/dist/src/utils/catalog-digests.js +7 -18
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
- package/dist/src/utils/catalog-generation-error.d.ts +5 -1
- package/dist/src/utils/catalog-generation-error.js +14 -0
- package/dist/src/utils/catalog-generation-error.js.map +1 -1
- package/dist/src/utils/catalog-generation-resolver.d.ts +36 -5
- package/dist/src/utils/catalog-generation-resolver.js +221 -77
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
- package/dist/src/utils/catalog-generation-service.d.ts +159 -28
- package/dist/src/utils/catalog-generation-service.js +1186 -525
- package/dist/src/utils/catalog-generation-service.js.map +1 -1
- package/dist/src/utils/catalog-generation-state.d.ts +9 -0
- package/dist/src/utils/catalog-generation-state.js +97 -106
- package/dist/src/utils/catalog-generation-state.js.map +1 -1
- package/dist/src/utils/catalog-generation-store.d.ts +38 -24
- package/dist/src/utils/catalog-generation-store.js +337 -272
- package/dist/src/utils/catalog-generation-store.js.map +1 -1
- package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
- package/dist/src/utils/{catalog-manifest-v5.js → catalog-manifest-v7.js} +23 -35
- package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
- package/dist/src/utils/catalog-operation-context.d.ts +6 -14
- package/dist/src/utils/catalog-operation-context.js +69 -169
- package/dist/src/utils/catalog-operation-context.js.map +1 -1
- package/dist/src/utils/catalog-public-error.js +8 -4
- package/dist/src/utils/catalog-public-error.js.map +1 -1
- package/dist/src/utils/catalog-runtime-projection.d.ts +7 -3
- package/dist/src/utils/catalog-runtime-projection.js +5 -40
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-snapshot.d.ts +2 -2
- package/dist/src/utils/catalog-source-impact.d.ts +21 -0
- package/dist/src/utils/catalog-source-impact.js +344 -0
- package/dist/src/utils/catalog-source-impact.js.map +1 -0
- package/dist/src/utils/catalog-source-references.d.ts +23 -2
- package/dist/src/utils/catalog-source-references.js +456 -382
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/catalog-sources.d.ts +14 -1
- package/dist/src/utils/catalog-sources.js +178 -18
- package/dist/src/utils/catalog-sources.js.map +1 -1
- package/dist/src/utils/codex-config.d.ts +2 -0
- package/dist/src/utils/codex-config.js +22 -1
- package/dist/src/utils/codex-config.js.map +1 -1
- package/dist/src/utils/codex-executable-discovery.d.ts +28 -0
- package/dist/src/utils/codex-executable-discovery.js +431 -0
- package/dist/src/utils/codex-executable-discovery.js.map +1 -0
- package/dist/src/utils/codex-manager.d.ts +47 -18
- package/dist/src/utils/codex-manager.js +88 -622
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-marketplace-path.d.ts +5 -0
- package/dist/src/utils/codex-marketplace-path.js +45 -0
- package/dist/src/utils/codex-marketplace-path.js.map +1 -0
- package/dist/src/utils/codex-native-observation.d.ts +49 -0
- package/dist/src/utils/codex-native-observation.js +169 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -0
- package/dist/src/utils/codex-reconciler.d.ts +123 -0
- package/dist/src/utils/codex-reconciler.js +322 -0
- package/dist/src/utils/codex-reconciler.js.map +1 -0
- package/dist/src/utils/codex-shared-native.d.ts +45 -0
- package/dist/src/utils/codex-shared-native.js +122 -0
- package/dist/src/utils/codex-shared-native.js.map +1 -0
- package/dist/src/utils/codex-skill-staging.d.ts +4 -3
- package/dist/src/utils/codex-skill-staging.js.map +1 -1
- package/dist/src/utils/codex-skills-root.d.ts +4 -0
- package/dist/src/utils/codex-skills-root.js +25 -0
- package/dist/src/utils/codex-skills-root.js.map +1 -0
- package/dist/src/utils/codex-surface-analysis.d.ts +49 -0
- package/dist/src/utils/codex-surface-analysis.js +220 -0
- package/dist/src/utils/codex-surface-analysis.js.map +1 -0
- 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 +51 -0
- package/dist/src/utils/component-resources.js +322 -0
- package/dist/src/utils/component-resources.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +18 -6
- package/dist/src/utils/dynamic-skill-tree.js +32 -9
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/git-catalog-provider.d.ts +16 -0
- package/dist/src/utils/git-catalog-provider.js +167 -120
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/inventory-recovery-diagnostic.d.ts +4 -0
- package/dist/src/utils/inventory-recovery-diagnostic.js +15 -0
- package/dist/src/utils/inventory-recovery-diagnostic.js.map +1 -0
- package/dist/src/utils/local-marketplace.d.ts +17 -12
- package/dist/src/utils/local-marketplace.js +85 -195
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-closure.d.ts +3 -0
- package/dist/src/utils/managed-command-closure.js +35 -0
- package/dist/src/utils/managed-command-closure.js.map +1 -0
- package/dist/src/utils/managed-command-evidence.d.ts +7 -0
- package/dist/src/utils/managed-command-evidence.js +10 -0
- package/dist/src/utils/managed-command-evidence.js.map +1 -0
- package/dist/src/utils/managed-command-materialization.d.ts +124 -0
- package/dist/src/utils/managed-command-materialization.js +369 -0
- package/dist/src/utils/managed-command-materialization.js.map +1 -0
- 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-runtime.d.ts +33 -0
- package/dist/src/utils/managed-command-runtime.js +121 -0
- package/dist/src/utils/managed-command-runtime.js.map +1 -0
- package/dist/src/utils/managed-command-store.d.ts +143 -0
- package/dist/src/utils/managed-command-store.js +665 -0
- package/dist/src/utils/managed-command-store.js.map +1 -0
- package/dist/src/utils/manifest.d.ts +1 -3
- package/dist/src/utils/manifest.js +1 -3
- package/dist/src/utils/manifest.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.d.ts +1 -10
- package/dist/src/utils/multi-source-catalog.js +9 -175
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +74 -5
- package/dist/src/utils/native-cli.js +479 -31
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +29 -0
- package/dist/src/utils/native-demand.js +4 -0
- package/dist/src/utils/native-demand.js.map +1 -0
- package/dist/src/utils/native-tool-context.d.ts +14 -0
- package/dist/src/utils/native-tool-context.js +38 -0
- package/dist/src/utils/native-tool-context.js.map +1 -0
- package/dist/src/utils/native-tool-review.d.ts +18 -0
- package/dist/src/utils/native-tool-review.js +116 -0
- package/dist/src/utils/native-tool-review.js.map +1 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js +0 -1
- package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +103 -21
- package/dist/src/utils/ownership.js +232 -210
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/path-catalog-provider.d.ts +1 -1
- package/dist/src/utils/path-catalog-provider.js +47 -62
- package/dist/src/utils/path-catalog-provider.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -2
- package/dist/src/utils/paths.js +5 -3
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +45 -0
- package/dist/src/utils/platform-empty-state.js +159 -0
- package/dist/src/utils/platform-empty-state.js.map +1 -0
- package/dist/src/utils/platform-support.d.ts +1 -1
- package/dist/src/utils/platform-support.js +1 -1
- package/dist/src/utils/platform-support.js.map +1 -1
- package/dist/src/utils/plugin-config-impact.d.ts +64 -0
- package/dist/src/utils/plugin-config-impact.js +307 -0
- package/dist/src/utils/plugin-config-impact.js.map +1 -0
- package/dist/src/utils/plugin-config-references.d.ts +89 -0
- package/dist/src/utils/plugin-config-references.js +335 -0
- package/dist/src/utils/plugin-config-references.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +109 -27
- package/dist/src/utils/plugin-config-write.js +1242 -348
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +187 -109
- package/dist/src/utils/plugin-config.js +916 -1147
- 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 +78 -127
- package/dist/src/utils/plugin-scripts.js +566 -524
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-lock.js +14 -5
- package/dist/src/utils/process-lock.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +2 -2
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/src/utils/project-boundary.d.ts +11 -13
- package/dist/src/utils/project-boundary.js +28 -34
- package/dist/src/utils/project-boundary.js.map +1 -1
- package/dist/src/utils/rendered-contract.js +18 -1
- package/dist/src/utils/rendered-contract.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +18 -0
- package/dist/src/utils/runtime-config.js +64 -0
- package/dist/src/utils/runtime-config.js.map +1 -0
- package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
- package/dist/src/utils/runtime-skill-closure.js +47 -6
- package/dist/src/utils/runtime-skill-closure.js.map +1 -1
- package/dist/src/utils/safe-fs.d.ts +21 -0
- package/dist/src/utils/safe-fs.js +111 -0
- package/dist/src/utils/safe-fs.js.map +1 -0
- package/dist/src/utils/safe-operation-diagnostic.d.ts +15 -0
- package/dist/src/utils/safe-operation-diagnostic.js +33 -0
- package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
- package/dist/src/utils/sensitive-content.d.ts +4 -0
- package/dist/src/utils/sensitive-content.js +36 -0
- package/dist/src/utils/sensitive-content.js.map +1 -0
- package/dist/src/utils/state-paths.d.ts +8 -3
- package/dist/src/utils/state-paths.js +53 -16
- package/dist/src/utils/state-paths.js.map +1 -1
- package/dist/src/utils/target-eligibility.d.ts +4 -3
- package/dist/src/utils/target-eligibility.js +12 -6
- package/dist/src/utils/target-eligibility.js.map +1 -1
- package/dist/src/utils/windows-claude-shim.d.ts +7 -0
- package/dist/src/utils/windows-claude-shim.js +10 -0
- package/dist/src/utils/windows-claude-shim.js.map +1 -0
- package/dist/src/utils/windows-npm-shim.d.ts +16 -0
- package/dist/src/utils/windows-npm-shim.js +155 -0
- package/dist/src/utils/windows-npm-shim.js.map +1 -0
- package/dist/vitest.config.js +105 -9
- package/dist/vitest.config.js.map +1 -1
- package/package.json +30 -21
- package/dist/scripts/aw-skill-eval-engine.d.ts +0 -13
- package/dist/scripts/aw-skill-eval-engine.js +0 -31
- package/dist/scripts/aw-skill-eval-engine.js.map +0 -1
- package/dist/scripts/codex-eval-app-server.d.ts +0 -91
- package/dist/scripts/codex-eval-app-server.js +0 -1334
- package/dist/scripts/codex-eval-app-server.js.map +0 -1
- package/dist/scripts/codex-eval-isolation.d.ts +0 -61
- package/dist/scripts/codex-eval-isolation.js +0 -318
- package/dist/scripts/codex-eval-isolation.js.map +0 -1
- package/dist/scripts/codex-eval-process-management.d.ts +0 -8
- package/dist/scripts/codex-eval-process-management.js +0 -69
- package/dist/scripts/codex-eval-process-management.js.map +0 -1
- package/dist/scripts/codex-eval-process-tree.d.ts +0 -38
- package/dist/scripts/codex-eval-process-tree.js +0 -803
- package/dist/scripts/codex-eval-process-tree.js.map +0 -1
- package/dist/scripts/codex-eval-runtime-config.d.ts +0 -62
- package/dist/scripts/codex-eval-runtime-config.js +0 -843
- package/dist/scripts/codex-eval-runtime-config.js.map +0 -1
- package/dist/scripts/codex-trigger-eval.d.ts +0 -84
- package/dist/scripts/codex-trigger-eval.js +0 -968
- package/dist/scripts/codex-trigger-eval.js.map +0 -1
- package/dist/scripts/eval-plugin-skills-audited.d.ts +0 -6
- package/dist/scripts/eval-plugin-skills-audited.js +0 -261
- package/dist/scripts/eval-plugin-skills-audited.js.map +0 -1
- package/dist/scripts/eval-plugin-skills.d.ts +0 -45
- package/dist/scripts/eval-plugin-skills.js +0 -1589
- package/dist/scripts/eval-plugin-skills.js.map +0 -1
- package/dist/scripts/eval-run-layout.d.ts +0 -17
- package/dist/scripts/eval-run-layout.js +0 -26
- package/dist/scripts/eval-run-layout.js.map +0 -1
- package/dist/scripts/plugin-eval-contract.d.ts +0 -189
- package/dist/scripts/plugin-eval-contract.js +0 -745
- package/dist/scripts/plugin-eval-contract.js.map +0 -1
- package/dist/scripts/plugin-eval-materializer.d.ts +0 -13
- package/dist/scripts/plugin-eval-materializer.js +0 -421
- package/dist/scripts/plugin-eval-materializer.js.map +0 -1
- package/dist/scripts/skill-reporting.d.ts +0 -212
- package/dist/scripts/skill-reporting.js +0 -922
- package/dist/scripts/skill-reporting.js.map +0 -1
- package/dist/src/commands/catalog-context.d.ts +0 -52
- package/dist/src/commands/catalog-context.js +0 -156
- package/dist/src/commands/catalog-context.js.map +0 -1
- package/dist/src/commands/review-publication.d.ts +0 -99
- package/dist/src/commands/review-publication.js +0 -904
- package/dist/src/commands/review-publication.js.map +0 -1
- package/dist/src/commands/status-v5.d.ts +0 -169
- package/dist/src/commands/status-v5.js +0 -1135
- package/dist/src/commands/status-v5.js.map +0 -1
- package/dist/src/portable/skills-cli.d.ts +0 -43
- package/dist/src/portable/skills-cli.js +0 -148
- package/dist/src/portable/skills-cli.js.map +0 -1
- package/dist/src/utils/catalog-manifest-v5.d.ts +0 -5
- package/dist/src/utils/catalog-manifest-v5.js.map +0 -1
- package/dist/src/utils/catalog-source-cache.d.ts +0 -62
- package/dist/src/utils/catalog-source-cache.js +0 -321
- package/dist/src/utils/catalog-source-cache.js.map +0 -1
- package/dist/src/utils/codex-project-surface.d.ts +0 -3
- package/dist/src/utils/codex-project-surface.js +0 -49
- package/dist/src/utils/codex-project-surface.js.map +0 -1
- package/dist/src/utils/lifecycle-active-store.d.ts +0 -147
- package/dist/src/utils/lifecycle-active-store.js +0 -1064
- package/dist/src/utils/lifecycle-active-store.js.map +0 -1
- package/dist/src/utils/plugin-release.d.ts +0 -2
- package/dist/src/utils/plugin-release.js +0 -2
- package/dist/src/utils/plugin-release.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
|
@@ -0,0 +1,1073 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { isPlatformTarget, normalizeStaticPluginComponents } from '@lesliechan721/aw-plugin-core/manifest';
|
|
3
|
+
import { selectAgents } from '../intent/deployment-preferences.js';
|
|
4
|
+
import { createScopeContext } from '../intent/scope-context.js';
|
|
5
|
+
import { parsePluginId } from '../utils/multi-source-catalog.js';
|
|
6
|
+
import { inspectPortableExtraInstalled, inspectPortableRecovery, portablePreparationDiagnostic } from '../portable/recovery.js';
|
|
7
|
+
import { readJointDemand, deriveJointDemand } from './joint-demand.js';
|
|
8
|
+
import { readDemand, resolveDelivery } from './demand.js';
|
|
9
|
+
import { runNativeCli } from '../utils/native-cli.js';
|
|
10
|
+
import { rethrowFatalError } from '../utils/codex-executable-discovery.js';
|
|
11
|
+
import { createCodexNativeObservationSession } from '../utils/codex-native-observation.js';
|
|
12
|
+
import { getAgentPluginAdapter } from '../platforms/registry.js';
|
|
13
|
+
import { getQualifiedPlatformProfile } from '../platforms/capabilities.js';
|
|
14
|
+
import { inspectPlatformSupplementState } from '../platforms/supplement-state.js';
|
|
15
|
+
import { resolveArtifactRenderConfig } from '../utils/artifact-renderer.js';
|
|
16
|
+
import { createPlatformInputEvidence, matchesPlatformEmptyState, platformPackageInputDigest, readPlatformPackageContentDigest } from '../utils/platform-empty-state.js';
|
|
17
|
+
import { getDeploymentLayout, hasSharedUserPackage } from '../platforms/layout.js';
|
|
18
|
+
import { deploymentPackageComponent, inspectStaticSupplements, requiredDeploymentActivation } from '../platforms/inspection.js';
|
|
19
|
+
import { resolveStaticPlatformResourceRoot } from '../utils/component-resources.js';
|
|
20
|
+
import { readSkillOwnerMarker } from '../utils/ownership.js';
|
|
21
|
+
import { inventoryCatalogSourceReferences } from '../utils/catalog-source-references.js';
|
|
22
|
+
import { resolvePartialCatalogOperationContext } from '../utils/catalog-operation-context.js';
|
|
23
|
+
import { checkAwCapabilitySupport, readPluginManifest } from '../utils/manifest.js';
|
|
24
|
+
import { IMPLEMENTED_AW_CAPABILITIES } from '../commands/aw-capabilities.js';
|
|
25
|
+
import { resolvePluginMetaDependencyClosure } from '../utils/plugin-dependencies.js';
|
|
26
|
+
import { installationInvocation, selectNativeProduct } from '../platforms/discovery.js';
|
|
27
|
+
import { DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS } from '../constants.js';
|
|
28
|
+
import { inventoryRecoveryDiagnostic } from '../utils/inventory-recovery-diagnostic.js';
|
|
29
|
+
import { measureRecoveryPerformanceStage } from './performance.js';
|
|
30
|
+
import { createNativeQuerySession } from '../platforms/inspection-query.js';
|
|
31
|
+
import { readCatalogSourcesConfigSnapshot } from '../utils/catalog-sources.js';
|
|
32
|
+
const NATIVE_READ_ERRORS = new Set(['nativeStateUnreadable', 'stateInventoryFailed', 'configReadFailed',
|
|
33
|
+
'configInvalid', 'componentInspectionFailed', 'targetInspectionFailed', 'codexNativeObservationFailed',
|
|
34
|
+
'nativeObservationFailed', 'nativeObservationUnavailable']);
|
|
35
|
+
function diagnostic(code) { return { code, message: `目标尚未满足:${code}。` }; }
|
|
36
|
+
async function readAdapterObservations(options, context, demand) {
|
|
37
|
+
const observations = [];
|
|
38
|
+
const existing = [];
|
|
39
|
+
const owned = [];
|
|
40
|
+
let selected;
|
|
41
|
+
try {
|
|
42
|
+
selected = selectAgents({ preferences: demand.preferences, targets: options.targets }).agents
|
|
43
|
+
.filter((agent) => agent !== 'generic');
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return { observations, existing, owned };
|
|
47
|
+
}
|
|
48
|
+
const ctx = { cwd: context.executionCwd, env: context.env, signal: options.signal, runner: options.nativeCliRunner,
|
|
49
|
+
discoveryCache: options.discoveryCache, nativeQuerySession: options.nativeQuerySession,
|
|
50
|
+
codexObservationSession: options.codexObservationSession, observeNative: options.observeNative };
|
|
51
|
+
for (const platform of selected) {
|
|
52
|
+
options.signal?.throwIfAborted();
|
|
53
|
+
const roots = (demand.roots ?? []).filter((root) => root.plugin
|
|
54
|
+
&& resolveDelivery(root.plugin.manifest, platform, demand.scope)?.kind === 'native'
|
|
55
|
+
&& (!demand.targetRequirements || demand.targetRequirements.some((item) => item.pluginId === root.pluginId && item.target === platform)));
|
|
56
|
+
if (!roots.length)
|
|
57
|
+
continue;
|
|
58
|
+
const adapter = getAgentPluginAdapter(platform);
|
|
59
|
+
let ownedSession;
|
|
60
|
+
try {
|
|
61
|
+
const discovery = await measureRecoveryPerformanceStage(options, 'status.discovery', () => adapter.discover(ctx));
|
|
62
|
+
if (platform === 'codex') {
|
|
63
|
+
const product = selectNativeProduct(discovery.installations);
|
|
64
|
+
if (product) {
|
|
65
|
+
const invocation = await installationInvocation(product, ctx, []);
|
|
66
|
+
const manager = { kind: product.product === 'app' ? 'app' : 'system', version: product.version ?? 'unknown',
|
|
67
|
+
command: invocation.command, argsPrefix: invocation.args };
|
|
68
|
+
if (ctx.codexObservationSession)
|
|
69
|
+
ctx.codexObservationSession.setManager(manager);
|
|
70
|
+
else {
|
|
71
|
+
ownedSession = await createCodexNativeObservationSession({ exactCwd: context.executionCwd, env: context.env, manager,
|
|
72
|
+
runner: async (request) => {
|
|
73
|
+
const result = await runNativeCli({ ...request, signal: options.signal, timeoutMs: DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS }, options.nativeCliRunner);
|
|
74
|
+
if (Buffer.byteLength(result.stdout) + Buffer.byteLength(result.stderr) > 1024 * 1024)
|
|
75
|
+
throw new Error('nativeObservationOutputLimit');
|
|
76
|
+
return result;
|
|
77
|
+
} });
|
|
78
|
+
ctx.codexObservationSession = ownedSession;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const root of roots) {
|
|
83
|
+
options.signal?.throwIfAborted();
|
|
84
|
+
const observation = { pluginId: root.pluginId, expectedVersion: root.plugin?.manifest.version, platform, content: 'unknown', blockers: [], reasons: [], deploymentObservations: [] };
|
|
85
|
+
observations.push(observation);
|
|
86
|
+
try {
|
|
87
|
+
const plugin = root.plugin;
|
|
88
|
+
const resolution = await adapter.resolve(ctx, { plugin: {
|
|
89
|
+
sourceId: plugin.sourceId ?? root.sourceId, sourceIdentity: plugin.sourceIdentity,
|
|
90
|
+
pluginId: root.pluginId, version: plugin.manifest.version,
|
|
91
|
+
}, scope: demand.scope === 'project' ? { kind: 'project', projectRoot: context.projectRoot } : { kind: 'user' },
|
|
92
|
+
operation: 'ensure', discovery, recoveryCandidates: [] });
|
|
93
|
+
observation.deploymentExclusions = resolution.exclusions.flatMap((entry) => entry.productId ? [{
|
|
94
|
+
platform, pluginId: root.pluginId,
|
|
95
|
+
scope: demand.scope === 'project' ? { kind: 'project', projectRoot: context.projectRoot } : { kind: 'user' },
|
|
96
|
+
productId: entry.productId, product: discovery.installations.find((product) => product.id === entry.productId) ?? null,
|
|
97
|
+
reasonCode: entry.reasonCode, execution: 'not-run',
|
|
98
|
+
recoveryActions: ['aw target list', `aw plugin sync ${root.pluginId} --context ${demand.scope} --target ${platform}`],
|
|
99
|
+
}] : []);
|
|
100
|
+
observation.blockers.push(...resolution.diagnostics.map((entry) => ({ ...entry })));
|
|
101
|
+
if (!resolution.bindings.length) {
|
|
102
|
+
observation.blockers.push(...resolution.exclusions.map((entry) => diagnostic(entry.reasonCode)));
|
|
103
|
+
observation.blockers.push(...discovery.diagnostics.map((entry) => ({ code: entry.code, message: entry.message })));
|
|
104
|
+
if (!observation.blockers.length)
|
|
105
|
+
observation.blockers.push(diagnostic(discovery.availability === 'missing' ? 'client-missing' : 'nativeObservationUnavailable'));
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const states = [];
|
|
109
|
+
const emptyMatches = [];
|
|
110
|
+
const currentMatches = [];
|
|
111
|
+
const versions = [];
|
|
112
|
+
const staticResourceRoot = await resolveStaticPlatformResourceRoot(plugin.rootDir, platform);
|
|
113
|
+
for (const binding of resolution.bindings) {
|
|
114
|
+
const subject = { pluginId: root.pluginId, target: platform, scope: binding.scope.kind };
|
|
115
|
+
const warn = (code) => observation.reasons.push({ ...diagnostic(code), subject });
|
|
116
|
+
const block = (code) => observation.blockers.push({ ...diagnostic(code), subject });
|
|
117
|
+
const live = await measureRecoveryPerformanceStage(options, 'status.adapter.inspect', () => adapter.inspect(ctx, binding));
|
|
118
|
+
versions.push(live.packageVersion);
|
|
119
|
+
options.signal?.throwIfAborted();
|
|
120
|
+
observation.deploymentObservations.push({ bindingId: binding.id, products: binding.consumers, after: live });
|
|
121
|
+
const shared = ['codex-marketplace', 'claude-marketplace', 'gemini-extension', 'copilot-marketplace'].includes(binding.route);
|
|
122
|
+
const scopedNativeConsumer = shared ? live.registration === 'present'
|
|
123
|
+
&& live.consumers.some((consumer) => consumer.activation === 'enabled')
|
|
124
|
+
: live.package === 'present' && live.ownership === 'aw';
|
|
125
|
+
if (scopedNativeConsumer && (live.ownership === 'aw' || live.ownership === 'shared')) {
|
|
126
|
+
owned.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
|
|
127
|
+
existing.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
|
|
128
|
+
}
|
|
129
|
+
const unmet = [];
|
|
130
|
+
const staticSupplements = [];
|
|
131
|
+
const dynamicUnits = new Set();
|
|
132
|
+
const inputUnits = [];
|
|
133
|
+
const profile = getQualifiedPlatformProfile(platform);
|
|
134
|
+
let expectedCount = 0;
|
|
135
|
+
let packageExpectedCount = 0;
|
|
136
|
+
for (const unit of resolution.renderUnits.filter((unit) => binding.renderUnitIds.includes(unit.id))) {
|
|
137
|
+
const artifacts = plugin.manifest.artifacts;
|
|
138
|
+
if (artifacts && unit.kinds.length && (!artifacts.scopes || artifacts.scopes.includes(unit.renderScope.kind))) {
|
|
139
|
+
dynamicUnits.add(unit.output);
|
|
140
|
+
}
|
|
141
|
+
const capabilities = adapter.capabilities({ binding, renderUnit: unit, observation: live,
|
|
142
|
+
profile });
|
|
143
|
+
const expected = await normalizeStaticPluginComponents({ pluginRoot: plugin.rootDir, staticResourceRoot,
|
|
144
|
+
manifest: plugin.manifest, platform, capabilities, allowedOutputKinds: unit.kinds });
|
|
145
|
+
expectedCount += expected.components.length;
|
|
146
|
+
if (unit.output === 'supplement')
|
|
147
|
+
staticSupplements.push(...expected.components);
|
|
148
|
+
else
|
|
149
|
+
packageExpectedCount += expected.components.length;
|
|
150
|
+
unmet.push(...expected.unmet);
|
|
151
|
+
inputUnits.push({ renderUnit: unit, capabilities,
|
|
152
|
+
config: await resolveArtifactRenderConfig({ pluginName: plugin.manifest.name, sourceId: binding.plugin.sourceId,
|
|
153
|
+
sourceIdentity: binding.plugin.sourceIdentity, logicalIdentity: plugin.catalogLogicalIdentity,
|
|
154
|
+
manifest: plugin.manifest, platform, scope: unit.renderScope.kind,
|
|
155
|
+
cwd: unit.renderScope.kind === 'project' ? unit.renderScope.projectRoot : context.executionCwd,
|
|
156
|
+
env: context.env, referencePlugins: demand.plugins }) });
|
|
157
|
+
}
|
|
158
|
+
const supplements = await inspectStaticSupplements(ctx, binding, staticSupplements);
|
|
159
|
+
const inputEvidence = await createPlatformInputEvidence({ plugin, binding, units: inputUnits });
|
|
160
|
+
const supplementInput = inputEvidence.units.find((unit) => unit.output === 'supplement');
|
|
161
|
+
const recordedSupplements = dynamicUnits.has('supplement') && supplementInput
|
|
162
|
+
? await inspectPlatformSupplementState(ctx, binding, supplementInput.inputDigest) : null;
|
|
163
|
+
if (recordedSupplements) {
|
|
164
|
+
const staticIds = new Set(supplements.components.map((component) => component.id));
|
|
165
|
+
const dynamicComponents = recordedSupplements.components.filter((component) => !staticIds.has(component.id));
|
|
166
|
+
supplements.components.push(...dynamicComponents);
|
|
167
|
+
expectedCount += dynamicComponents.length;
|
|
168
|
+
}
|
|
169
|
+
const supplementConflict = supplements.components.some((component) => component.reasonCodes.includes('supplementOwnershipConflict'));
|
|
170
|
+
const supplementMissing = supplements.components.some((component) => component.presence === 'absent');
|
|
171
|
+
const supplementDrift = supplements.components.some((component) => component.reasonCodes.includes('componentContentDrift'));
|
|
172
|
+
const supplementUnknown = supplements.components.some((component) => component.presence === 'unknown');
|
|
173
|
+
const supplementInputDrift = Boolean(recordedSupplements && !recordedSupplements.inputMatches
|
|
174
|
+
&& recordedSupplements.components.every((component) => component.presence === 'present'));
|
|
175
|
+
if (supplementConflict)
|
|
176
|
+
block('supplementOwnershipConflict');
|
|
177
|
+
if (supplementDrift)
|
|
178
|
+
warn('platformContentDrift');
|
|
179
|
+
if (supplementInputDrift)
|
|
180
|
+
warn('platformInputDrift');
|
|
181
|
+
if (supplementMissing)
|
|
182
|
+
warn('componentOutputMissing');
|
|
183
|
+
if (supplementUnknown && !supplementConflict)
|
|
184
|
+
warn('componentOutputUnconfirmed');
|
|
185
|
+
if (supplements.owned && !existing.some((target) => target.pluginId === root.pluginId && target.agent === platform && target.scope === demand.scope)) {
|
|
186
|
+
owned.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
|
|
187
|
+
existing.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
|
|
188
|
+
}
|
|
189
|
+
const confirmedEmpty = Boolean(plugin.manifest.artifacts && expectedCount === 0 && unmet.length === 0
|
|
190
|
+
&& await matchesPlatformEmptyState({ state: { ...inputEvidence, kind: 'aw-platform-empty-state', result: 'intentional-empty' }, env: context.env }));
|
|
191
|
+
const confirmedEmptyPackage = binding.route === 'codex-marketplace' && recordedSupplements !== null
|
|
192
|
+
&& dynamicUnits.has('package') && packageExpectedCount === 0
|
|
193
|
+
&& await matchesPlatformEmptyState({ state: { ...inputEvidence, kind: 'aw-platform-empty-state', result: 'intentional-empty',
|
|
194
|
+
units: inputEvidence.units.filter((unit) => unit.output === 'package') }, env: context.env });
|
|
195
|
+
const dynamicSupplementsUnconfirmed = dynamicUnits.has('supplement') && !confirmedEmpty
|
|
196
|
+
&& !recordedSupplements?.inputMatches && !supplementInputDrift;
|
|
197
|
+
if (dynamicSupplementsUnconfirmed)
|
|
198
|
+
warn('dynamicExpectationUnconfirmed');
|
|
199
|
+
const hasPackageExpectation = packageExpectedCount > 0 || dynamicUnits.has('package') && !confirmedEmpty && !confirmedEmptyPackage;
|
|
200
|
+
const inheritsUserNative = demand.targetRequirements?.find((item) => item.pluginId === root.pluginId
|
|
201
|
+
&& item.target === platform)?.inheritsUserNative;
|
|
202
|
+
const requiredActivation = requiredDeploymentActivation(binding, live, !inheritsUserNative);
|
|
203
|
+
for (const entry of live.diagnostics) {
|
|
204
|
+
if (entry.code === 'codexProjectActivationUnconfirmed' && inheritsUserNative && requiredActivation === 'enabled')
|
|
205
|
+
continue;
|
|
206
|
+
const destination = entry.severity === 'error' || (hasPackageExpectation || confirmedEmpty || confirmedEmptyPackage) && NATIVE_READ_ERRORS.has(entry.code)
|
|
207
|
+
? observation.blockers : observation.reasons;
|
|
208
|
+
destination.push({ code: entry.code, message: entry.message, subject: { ...subject, ...entry.subject }, detail: entry.detail });
|
|
209
|
+
}
|
|
210
|
+
const requiresScopeRegistration = binding.route === 'claude-marketplace' && !inheritsUserNative;
|
|
211
|
+
const registration = requiresScopeRegistration ? live.scopeRegistration ?? 'unknown' : live.registration;
|
|
212
|
+
const ownershipConflict = live.ownership === 'foreign' || live.ownership === 'shared';
|
|
213
|
+
if (ownershipConflict)
|
|
214
|
+
block('deploymentOwnershipConflict');
|
|
215
|
+
const missing = hasPackageExpectation && (live.package === 'absent' && packageExpectedCount > 0
|
|
216
|
+
|| registration === 'absent' && (packageExpectedCount > 0 || live.package === 'present')
|
|
217
|
+
|| live.nativePackage === 'absent');
|
|
218
|
+
if (missing) {
|
|
219
|
+
if (live.package === 'absent')
|
|
220
|
+
warn('platformPackageMissing');
|
|
221
|
+
if (registration === 'absent')
|
|
222
|
+
warn('nativeRegistrationMissing');
|
|
223
|
+
if (live.nativePackage === 'absent')
|
|
224
|
+
warn('nativePackageMissing');
|
|
225
|
+
}
|
|
226
|
+
let inputDrift = false;
|
|
227
|
+
let packageExpectationConfirmed = false;
|
|
228
|
+
let projectionUnconfirmed = false;
|
|
229
|
+
let componentMissing = false;
|
|
230
|
+
let componentUnknown = false;
|
|
231
|
+
let nativeContentDrift = false;
|
|
232
|
+
let nativeContentUnconfirmed = false;
|
|
233
|
+
if (hasPackageExpectation && live.package === 'present' && live.ownership === 'aw' && !missing) {
|
|
234
|
+
const layout = await getDeploymentLayout(ctx, binding);
|
|
235
|
+
const marker = await readSkillOwnerMarker({ skillRoot: layout.packageRoot, allowedRoot: path.dirname(layout.packageRoot),
|
|
236
|
+
expectedIdentity: deploymentPackageComponent(binding, layout).identity });
|
|
237
|
+
const projection = marker?.nativeProjection;
|
|
238
|
+
const contentDigest = projection ? await readPlatformPackageContentDigest(layout.packageRoot) : undefined;
|
|
239
|
+
if (['grok-cli', 'gemini-extension', 'antigravity-cli'].includes(binding.route) && live.registration === 'present') {
|
|
240
|
+
nativeContentUnconfirmed = !contentDigest || !live.nativePackageContentDigest;
|
|
241
|
+
nativeContentDrift = Boolean(contentDigest && live.nativePackageContentDigest
|
|
242
|
+
&& contentDigest !== live.nativePackageContentDigest);
|
|
243
|
+
if (nativeContentUnconfirmed)
|
|
244
|
+
warn('nativePackageContentUnconfirmed');
|
|
245
|
+
if (nativeContentDrift)
|
|
246
|
+
warn('nativePackageContentDrift');
|
|
247
|
+
}
|
|
248
|
+
projectionUnconfirmed = !projection || projection.preparation !== 'complete' || !contentDigest;
|
|
249
|
+
const packageInputDigest = platformPackageInputDigest(inputEvidence);
|
|
250
|
+
inputDrift = Boolean(projection && (projection.inputDigest !== packageInputDigest
|
|
251
|
+
|| contentDigest && projection.contentDigest !== contentDigest));
|
|
252
|
+
if (projectionUnconfirmed)
|
|
253
|
+
warn(projection?.preparation === 'partial'
|
|
254
|
+
? 'platformPreparationPartial' : 'platformExpectationUnconfirmed');
|
|
255
|
+
else if (inputDrift)
|
|
256
|
+
warn(projection.inputDigest !== packageInputDigest
|
|
257
|
+
? 'platformInputDrift' : 'platformContentDrift');
|
|
258
|
+
componentMissing = live.components.some((component) => component.presence === 'absent');
|
|
259
|
+
componentUnknown = live.components.some((component) => component.presence === 'unknown'
|
|
260
|
+
&& !component.reasonCodes.includes('nativePackageContentDrift'));
|
|
261
|
+
if (componentMissing)
|
|
262
|
+
warn('componentOutputMissing');
|
|
263
|
+
if (componentUnknown && !nativeContentUnconfirmed)
|
|
264
|
+
warn('componentOutputUnconfirmed');
|
|
265
|
+
packageExpectationConfirmed = Boolean(!projectionUnconfirmed && projection.inputDigest === packageInputDigest
|
|
266
|
+
&& projection.components.length > 0);
|
|
267
|
+
if (packageExpectationConfirmed)
|
|
268
|
+
expectedCount = Math.max(expectedCount, projection.components.length);
|
|
269
|
+
}
|
|
270
|
+
live.components.push(...supplements.components);
|
|
271
|
+
currentMatches.push(!dynamicUnits.size || confirmedEmpty || packageExpectationConfirmed || missing
|
|
272
|
+
|| recordedSupplements !== null && !hasPackageExpectation);
|
|
273
|
+
emptyMatches.push(confirmedEmpty);
|
|
274
|
+
for (const entry of unmet)
|
|
275
|
+
block(entry.reasonCode);
|
|
276
|
+
const inactiveScope = live.registration === 'absent'
|
|
277
|
+
|| live.package === 'absent' && live.registration === 'not-applicable'
|
|
278
|
+
|| live.scopeRegistration === 'absent'
|
|
279
|
+
|| binding.scope.kind === 'project' && shared && live.configuration?.activation === 'absent'
|
|
280
|
+
|| live.consumers.every((consumer) => ['disabled', 'not-applicable'].includes(consumer.activation));
|
|
281
|
+
if (confirmedEmpty) {
|
|
282
|
+
states.push(ownershipConflict ? 'conflict' : live.package === 'unknown' || live.registration === 'unknown'
|
|
283
|
+
|| live.ownership === 'unknown' || observation.blockers.length || !inactiveScope ? 'unknown'
|
|
284
|
+
: live.package === 'absent' || shared ? 'satisfied' : 'drifted');
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (hasPackageExpectation && !missing) {
|
|
288
|
+
if (registration === 'unknown')
|
|
289
|
+
warn('nativeRegistrationUnconfirmed');
|
|
290
|
+
if (requiredActivation === 'unknown')
|
|
291
|
+
warn('nativeActivationUnconfirmed');
|
|
292
|
+
if (requiredActivation === 'disabled')
|
|
293
|
+
warn('nativeActivationDisabled');
|
|
294
|
+
if (requiredActivation === 'blocked')
|
|
295
|
+
block(binding.route === 'grok-directory'
|
|
296
|
+
? 'grokProjectAuthorizationDenied' : 'nativeActivationBlocked');
|
|
297
|
+
if (binding.route === 'cursor-workspace-hook') {
|
|
298
|
+
if (live.workspaceOpen === 'absent')
|
|
299
|
+
warn('cursorWorkspaceOpenMissing');
|
|
300
|
+
if (live.workspaceOpen === 'unknown')
|
|
301
|
+
warn('cursorWorkspaceOpenUnconfirmed');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (ownershipConflict || supplementConflict)
|
|
305
|
+
states.push('conflict');
|
|
306
|
+
else if (confirmedEmptyPackage && (live.package === 'unknown' || live.registration === 'unknown' || live.ownership === 'unknown'))
|
|
307
|
+
states.push('unknown');
|
|
308
|
+
else if (confirmedEmptyPackage && !inactiveScope) {
|
|
309
|
+
warn('platformContentDrift');
|
|
310
|
+
states.push('drifted');
|
|
311
|
+
}
|
|
312
|
+
else if (unmet.length || hasPackageExpectation && registration === 'unknown')
|
|
313
|
+
states.push('unknown');
|
|
314
|
+
else if (missing)
|
|
315
|
+
states.push('absent');
|
|
316
|
+
else if (supplementUnknown || hasPackageExpectation && (live.package === 'unknown' || live.ownership === 'unknown'
|
|
317
|
+
|| requiredActivation === 'unknown' || live.workspaceOpen === 'unknown'
|
|
318
|
+
|| componentUnknown || nativeContentUnconfirmed || projectionUnconfirmed))
|
|
319
|
+
states.push('unknown');
|
|
320
|
+
else if (componentMissing || supplementMissing && !dynamicSupplementsUnconfirmed)
|
|
321
|
+
states.push('absent');
|
|
322
|
+
else if (hasPackageExpectation && ['disabled', 'blocked'].includes(requiredActivation)
|
|
323
|
+
|| live.workspaceOpen === 'absent' && live.package === 'present' || inputDrift || supplementDrift || supplementInputDrift || nativeContentDrift)
|
|
324
|
+
states.push('drifted');
|
|
325
|
+
else if (dynamicSupplementsUnconfirmed || hasPackageExpectation && !packageExpectationConfirmed)
|
|
326
|
+
states.push('unknown');
|
|
327
|
+
else if (!expectedCount)
|
|
328
|
+
states.push(live.package === 'absent' && ['absent', 'not-applicable'].includes(live.registration) ? 'satisfied' : 'drifted');
|
|
329
|
+
else
|
|
330
|
+
states.push('satisfied');
|
|
331
|
+
}
|
|
332
|
+
observation.intentionalEmpty = emptyMatches.length === resolution.bindings.length && emptyMatches.every(Boolean);
|
|
333
|
+
observation.expectationConfirmed = currentMatches.length === resolution.bindings.length && currentMatches.every(Boolean);
|
|
334
|
+
if (versions.length && versions[0] && versions.every((version) => version === versions[0]))
|
|
335
|
+
observation.installedVersion = versions[0];
|
|
336
|
+
observation.content = ['conflict', 'drifted', 'absent', 'unknown']
|
|
337
|
+
.find((state) => states.includes(state)) ?? 'satisfied';
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
rethrowFatalError(error);
|
|
341
|
+
options.signal?.throwIfAborted();
|
|
342
|
+
observation.content = 'unknown';
|
|
343
|
+
observation.blockers.push(diagnostic('nativeObservationFailed'));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
rethrowFatalError(error);
|
|
349
|
+
options.signal?.throwIfAborted();
|
|
350
|
+
for (const root of roots)
|
|
351
|
+
observations.push({ pluginId: root.pluginId, platform, content: 'unknown', blockers: [diagnostic('nativeObservationFailed')] });
|
|
352
|
+
}
|
|
353
|
+
finally {
|
|
354
|
+
if (ownedSession) {
|
|
355
|
+
try {
|
|
356
|
+
await ownedSession.dispose();
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
ctx.codexObservationSession = undefined;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return { observations, existing, owned };
|
|
365
|
+
}
|
|
366
|
+
function safeNativePlacement(target) {
|
|
367
|
+
const component = ({ kind, key, state, metadata }) => ({
|
|
368
|
+
kind, key, state,
|
|
369
|
+
...(metadata ? { metadata: Object.fromEntries(Object.entries(metadata).filter(([name]) => ['enabled', 'scopes', 'relation', 'errorCode', 'shared', 'version', 'desiredVersion',
|
|
370
|
+
'staleCacheObserved', 'effective', 'requiredMinVersion', 'detectedVersion', 'code',
|
|
371
|
+
'kinds', 'platform', 'scope', 'project', 'rootIssueId', 'rootIssueCode'].includes(name)
|
|
372
|
+
|| (kind === 'systemConsumer' && name === 'diagnostics'))) } : {}),
|
|
373
|
+
});
|
|
374
|
+
const reason = ({ code, severity, dependencyPluginId, dependencyPlatform, dependencyScope, dependencyProject, rootIssueId, rootIssueCode }) => ({
|
|
375
|
+
code, severity, dependencyPluginId, dependencyPlatform, dependencyScope, dependencyProject,
|
|
376
|
+
rootIssueId, rootIssueCode,
|
|
377
|
+
});
|
|
378
|
+
return {
|
|
379
|
+
pluginId: target.pluginId, platform: target.platform, scope: target.scope,
|
|
380
|
+
state: target.state,
|
|
381
|
+
components: target.components.map(component), reasons: target.reasons.map(reason),
|
|
382
|
+
recoveryActions: target.recoveryActions.map(({ command, scope }) => ({ command, scope })),
|
|
383
|
+
...(target.sharedComponents ? { sharedComponents: target.sharedComponents.map(component) } : {}),
|
|
384
|
+
...(target.sharedReasons ? { sharedReasons: target.sharedReasons.map(reason) } : {}),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
export async function statusFromObservations(options) {
|
|
388
|
+
options.signal?.throwIfAborted();
|
|
389
|
+
const { demand } = options;
|
|
390
|
+
const errors = [...demand.errors, ...(options.nativeReadErrors ?? [])];
|
|
391
|
+
let selection;
|
|
392
|
+
try {
|
|
393
|
+
selection = selectAgents({ preferences: demand.preferences, targets: options.targets });
|
|
394
|
+
}
|
|
395
|
+
catch {
|
|
396
|
+
selection = { agents: [], origin: 'none', preferences: demand.preferences.state };
|
|
397
|
+
errors.push(diagnostic('targetSelectionInvalid'));
|
|
398
|
+
}
|
|
399
|
+
const inventory = demand.roots === null ? null : [];
|
|
400
|
+
for (const root of demand.roots ?? []) {
|
|
401
|
+
options.signal?.throwIfAborted();
|
|
402
|
+
const blockers = root.blockers.map(diagnostic);
|
|
403
|
+
if (root.plugin) {
|
|
404
|
+
try {
|
|
405
|
+
const closure = root.plugin.manifest.dependencies?.length
|
|
406
|
+
? resolvePluginMetaDependencyClosure(demand.plugins.filter((plugin) => plugin.sourceId === root.sourceId), [root.plugin.manifest.name])
|
|
407
|
+
: [root.plugin];
|
|
408
|
+
for (const plugin of closure) {
|
|
409
|
+
const support = checkAwCapabilitySupport(plugin.manifest.requires?.aw.capabilities ?? [], IMPLEMENTED_AW_CAPABILITIES);
|
|
410
|
+
if (!support.supported)
|
|
411
|
+
blockers.push({ ...diagnostic('awCapabilityUnsupported'), pluginId: plugin.pluginId });
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
catch {
|
|
415
|
+
blockers.push(diagnostic('dependencyContractInvalid'));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (!selection.agents.length)
|
|
419
|
+
blockers.push(diagnostic('localTargetsRequired'));
|
|
420
|
+
const targetResults = [];
|
|
421
|
+
for (const agent of selection.agents) {
|
|
422
|
+
if (demand.targetRequirements && !demand.targetRequirements.some((item) => item.pluginId === root.pluginId && item.target === agent))
|
|
423
|
+
continue;
|
|
424
|
+
options.signal?.throwIfAborted();
|
|
425
|
+
const delivery = root.plugin ? resolveDelivery(root.plugin.manifest, agent, options.scope) ?? null : null;
|
|
426
|
+
const target = { pluginId: root.pluginId, agent, scope: options.scope, delivery,
|
|
427
|
+
execution: 'not-run', observation: 'unknown', content: 'unknown', blockers: [...blockers],
|
|
428
|
+
requiredBy: [root.pluginId], relation: 'root',
|
|
429
|
+
...(root.plugin?.manifest.version ? { expectedVersion: root.plugin.manifest.version } : {}) };
|
|
430
|
+
if (blockers.length) {
|
|
431
|
+
targetResults.push(target);
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
if (!delivery)
|
|
435
|
+
target.blockers.push(diagnostic('deliveryUnsupported'));
|
|
436
|
+
else if (delivery.kind === 'native') {
|
|
437
|
+
const native = options.nativeObservations.find((entry) => entry.pluginId === root.pluginId
|
|
438
|
+
&& entry.platform === delivery.platform);
|
|
439
|
+
if (native) {
|
|
440
|
+
target.content = native.content;
|
|
441
|
+
if (native.installedVersion)
|
|
442
|
+
target.installedVersion = native.installedVersion;
|
|
443
|
+
if (native.deploymentObservations)
|
|
444
|
+
target.deploymentObservations = native.deploymentObservations;
|
|
445
|
+
if (native.deploymentExclusions)
|
|
446
|
+
target.deploymentExclusions = native.deploymentExclusions;
|
|
447
|
+
target.blockers.push(...native.blockers);
|
|
448
|
+
if (native.reasons?.length)
|
|
449
|
+
target.reasons = [...native.reasons];
|
|
450
|
+
errors.push(...native.blockers.filter((entry) => NATIVE_READ_ERRORS.has(entry.code))
|
|
451
|
+
.map((entry) => ({ ...entry, pluginId: root.pluginId })));
|
|
452
|
+
target.backend = { ...(native.assumedActivation ? { assumedActivation: true } : {}),
|
|
453
|
+
...(native.backend ? { live: safeNativePlacement(native.backend) } : {}) };
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
target.blockers.push(diagnostic('nativeObservationUnavailable'));
|
|
457
|
+
errors.push({ ...diagnostic('nativeObservationUnavailable'), pluginId: root.pluginId });
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
try {
|
|
462
|
+
const portable = await inspectPortableRecovery({ scope: options.scope, context: options.context,
|
|
463
|
+
selector: root.pluginId, agents: [agent], env: options.env, signal: options.signal,
|
|
464
|
+
cliVersion: options.cliVersion ?? '0.0.0', catalogOperationContext: demand.catalogOperationContext,
|
|
465
|
+
excludedPluginIds: demand.userProviders?.[agent] });
|
|
466
|
+
options.signal?.throwIfAborted();
|
|
467
|
+
target.blockers.push(...portable.blockers.map((code) => portablePreparationDiagnostic(portable, diagnostic(code), agent)));
|
|
468
|
+
const gaps = (portable.unmet ?? []).filter((gap) => gap.agent === agent);
|
|
469
|
+
if (gaps.length) {
|
|
470
|
+
target.componentGaps = gaps;
|
|
471
|
+
if (!target.blockers.some((entry) => entry.code === 'portableComponentsUnmet'))
|
|
472
|
+
target.blockers.push(diagnostic('portableComponentsUnmet'));
|
|
473
|
+
}
|
|
474
|
+
const observed = portable.targets.filter((entry) => entry.agent === agent);
|
|
475
|
+
target.blockers.push(...observed.flatMap((entry) => entry.blocker ? [diagnostic(entry.blocker)] : []));
|
|
476
|
+
target.content = ['conflict', 'drifted', 'absent', 'unknown']
|
|
477
|
+
.find((state) => observed.some((entry) => entry.observation === state))
|
|
478
|
+
?? (!portable.blockers.length && (observed.length || portable.intentionalEmpty && gaps.length === 0) ? 'satisfied' : 'unknown');
|
|
479
|
+
if (observed.length === 0 && portable.blockers.includes('needs-preparation') && options.portableCoverage === true
|
|
480
|
+
&& options.portableInstalled && !options.portableInstalled.some((item) => item.pluginId === root.pluginId && item.agent === agent)) {
|
|
481
|
+
target.content = 'absent';
|
|
482
|
+
target.blockers = target.blockers.filter((item) => item.code !== 'needs-preparation');
|
|
483
|
+
}
|
|
484
|
+
if (gaps.length && target.content !== 'conflict')
|
|
485
|
+
target.content = 'unknown';
|
|
486
|
+
target.backend = observed.map((entry) => ({ skill: entry.skill, agent: entry.agent,
|
|
487
|
+
ownership: entry.ownership, observation: entry.observation, associatedAgents: entry.associatedAgents }));
|
|
488
|
+
if (target.blockers.some((entry) => /(?:VerificationFailed|ReadFailed|LockInvalid)/u.test(entry.code))) {
|
|
489
|
+
errors.push({ ...diagnostic('portableObservationFailed'), pluginId: root.pluginId });
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
rethrowFatalError(error);
|
|
494
|
+
options.signal?.throwIfAborted();
|
|
495
|
+
target.blockers.push(diagnostic('portableObservationFailed'));
|
|
496
|
+
errors.push({ ...diagnostic('portableObservationFailed'), pluginId: root.pluginId });
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
const dynamicExpectationConfirmed = delivery?.kind === 'native' && options.nativeObservations.some((entry) => entry.pluginId === root.pluginId && entry.platform === delivery.platform && (entry.intentionalEmpty === true || entry.expectationConfirmed === true));
|
|
500
|
+
if (delivery?.kind === 'native' && root.plugin?.manifest.artifacts && !dynamicExpectationConfirmed) {
|
|
501
|
+
if (target.content === 'satisfied' || target.content === 'absent')
|
|
502
|
+
target.content = 'unknown';
|
|
503
|
+
if (target.content === 'unknown' && !target.reasons?.some((entry) => entry.code === 'dynamicExpectationUnconfirmed')) {
|
|
504
|
+
target.reasons = [...target.reasons ?? [], diagnostic('dynamicExpectationUnconfirmed')];
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
target.observation = target.content === 'satisfied' ? 'verified'
|
|
508
|
+
: target.content === 'absent' ? 'missing' : 'unknown';
|
|
509
|
+
targetResults.push(target);
|
|
510
|
+
}
|
|
511
|
+
inventory.push({ pluginId: root.pluginId, source: root.sourceId, sourceState: root.sourceState,
|
|
512
|
+
blockers, targetResults });
|
|
513
|
+
}
|
|
514
|
+
const counts = { blocked: 0, unconfirmed: 0, pending: 0, ready: 0 };
|
|
515
|
+
let definiteFailure = false;
|
|
516
|
+
let uncertain = inventory === null;
|
|
517
|
+
for (const root of inventory ?? []) {
|
|
518
|
+
const targets = root.targetResults;
|
|
519
|
+
if (root.blockers.length || targets.some((target) => target.blockers.length || target.content === 'conflict'
|
|
520
|
+
|| target.delivery === null)) {
|
|
521
|
+
counts.blocked++;
|
|
522
|
+
}
|
|
523
|
+
else if (!targets.length || targets.some((target) => target.content === 'unknown')) {
|
|
524
|
+
counts.unconfirmed++;
|
|
525
|
+
uncertain = true;
|
|
526
|
+
}
|
|
527
|
+
else if (targets.some((target) => target.content === 'absent' || target.content === 'drifted'))
|
|
528
|
+
counts.pending++;
|
|
529
|
+
else
|
|
530
|
+
counts.ready++;
|
|
531
|
+
if (!targets.length || root.blockers.some((entry) => !/^(?:pluginUnavailable|sourceMissing|sourceIdentityMismatch)$/u.test(entry.code))) {
|
|
532
|
+
uncertain = true;
|
|
533
|
+
}
|
|
534
|
+
if (root.blockers.some((entry) => /^(?:pluginUnavailable|sourceMissing|sourceIdentityMismatch)$/u.test(entry.code))) {
|
|
535
|
+
definiteFailure = true;
|
|
536
|
+
}
|
|
537
|
+
for (const target of targets) {
|
|
538
|
+
if (target.content === 'absent' || target.content === 'drifted' || target.content === 'conflict'
|
|
539
|
+
|| target.blockers.some((entry) => entry.code === 'deliveryUnsupported')) {
|
|
540
|
+
definiteFailure = true;
|
|
541
|
+
}
|
|
542
|
+
else if (target.blockers.some((entry) => entry.code === 'awCapabilityUnsupported'))
|
|
543
|
+
definiteFailure = true;
|
|
544
|
+
else if (target.content === 'unknown' || target.observation === 'unknown' || target.blockers.length)
|
|
545
|
+
uncertain = true;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
const allSatisfied = definiteFailure ? false : uncertain ? null : true;
|
|
549
|
+
options.signal?.throwIfAborted();
|
|
550
|
+
return { schemaVersion: 1, kind: 'aw-recovery-status', scope: options.scope, ok: errors.length === 0,
|
|
551
|
+
intent: { state: demand.intent.state, ...('digest' in demand.intent ? { digest: demand.intent.digest } : {}) },
|
|
552
|
+
selection, inventory, extraObserved: options.extraObserved ?? [],
|
|
553
|
+
coverage: { native: (options.nativeReadErrors?.length ?? 0) === 0, portable: options.portableCoverage ?? true },
|
|
554
|
+
counts, allSatisfied, inSync: aggregateConvergence(allSatisfied, (options.extraObserved?.length ?? 0) > 0 ? 'present' : options.portableCoverage === false ? 'unknown' : 'absent'), errors };
|
|
555
|
+
}
|
|
556
|
+
export async function readScopedRecoveryStatus(options) {
|
|
557
|
+
options.signal?.throwIfAborted();
|
|
558
|
+
const context = await createScopeContext({ scope: options.scope, cwd: options.cwd, env: options.env, readOnly: true });
|
|
559
|
+
try {
|
|
560
|
+
options.signal?.throwIfAborted();
|
|
561
|
+
const demand = options.demandOverride ?? await readDemand({ scope: options.scope, cwd: context.executionCwd, env: context.env,
|
|
562
|
+
catalogOperationContext: options.catalogOperationContext, signal: options.signal });
|
|
563
|
+
options.signal?.throwIfAborted();
|
|
564
|
+
options.onDemand?.(demand);
|
|
565
|
+
options.signal?.throwIfAborted();
|
|
566
|
+
const ownerInventory = options.nativeObservations ? { references: [], errors: [] }
|
|
567
|
+
: await measureRecoveryPerformanceStage(options, 'status.inventory', () => inventoryCatalogSourceReferences({ cwd: context.executionCwd, env: context.env, scope: options.scope,
|
|
568
|
+
knownPluginNames: demand.plugins.map((plugin) => plugin.manifest.name), collectPathEvidence: false,
|
|
569
|
+
observationPlugins: options.observationPlugins }));
|
|
570
|
+
options.signal?.throwIfAborted();
|
|
571
|
+
const candidates = ownerInventory.references.filter((entry) => entry.scope === options.scope
|
|
572
|
+
&& entry.sourceId && entry.pluginName && isPlatformTarget(entry.platform) && entry.platform !== 'generic'
|
|
573
|
+
&& (!options.observationPlugins || options.observationPlugins.has(`${entry.sourceId}/${entry.pluginName}`)
|
|
574
|
+
|| options.observationPlugins.has(entry.pluginName))
|
|
575
|
+
&& (!options.targets || options.targets.includes(entry.platform)));
|
|
576
|
+
const observedPlugins = new Map(demand.plugins.map((plugin) => [plugin.pluginId, plugin]));
|
|
577
|
+
const catalog = demand.catalogOperationContext ?? options.catalogOperationContext;
|
|
578
|
+
const catalogSources = options.catalogSources ?? new Map();
|
|
579
|
+
for (const source of catalog?.catalog.sources ?? [])
|
|
580
|
+
if (!catalogSources.has(source.sourceId))
|
|
581
|
+
catalogSources.set(source.sourceId, source);
|
|
582
|
+
if (candidates.some((entry) => !observedPlugins.has(`${entry.sourceId}/${entry.pluginName}`))) {
|
|
583
|
+
try {
|
|
584
|
+
const missing = [...new Set(candidates.map((entry) => entry.sourceId))].filter((id) => !catalogSources.has(id));
|
|
585
|
+
if (missing.length) {
|
|
586
|
+
const config = await readCatalogSourcesConfigSnapshot(context.env);
|
|
587
|
+
const configured = new Set(config.config.sources.map((source) => source.id));
|
|
588
|
+
const sourceIds = missing.filter((id) => configured.has(id));
|
|
589
|
+
if (sourceIds.length) {
|
|
590
|
+
const additional = await resolvePartialCatalogOperationContext({ env: context.env, signal: options.signal,
|
|
591
|
+
configSnapshot: config, sourceIds });
|
|
592
|
+
for (const source of additional.catalog.sources)
|
|
593
|
+
catalogSources.set(source.sourceId, source);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
catch (error) {
|
|
598
|
+
rethrowFatalError(error);
|
|
599
|
+
options.signal?.throwIfAborted();
|
|
600
|
+
}
|
|
601
|
+
for (const candidate of candidates) {
|
|
602
|
+
const pluginId = `${candidate.sourceId}/${candidate.pluginName}`;
|
|
603
|
+
if (observedPlugins.has(pluginId))
|
|
604
|
+
continue;
|
|
605
|
+
const source = catalogSources.get(candidate.sourceId)?.resolution;
|
|
606
|
+
if (!source?.manifest.entries.some((entry) => entry.name === candidate.pluginName))
|
|
607
|
+
continue;
|
|
608
|
+
try {
|
|
609
|
+
const plugin = await readPluginManifest(path.join(source.rootDir, 'plugins', candidate.pluginName), { mode: 'bundle' });
|
|
610
|
+
Object.assign(plugin, { pluginId, sourceId: candidate.sourceId, sourceIdentity: source.sourceIdentity,
|
|
611
|
+
catalogLogicalIdentity: source.logicalIdentity });
|
|
612
|
+
observedPlugins.set(pluginId, plugin);
|
|
613
|
+
}
|
|
614
|
+
catch (error) {
|
|
615
|
+
rethrowFatalError(error);
|
|
616
|
+
options.signal?.throwIfAborted();
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
let selectedAgents = [];
|
|
621
|
+
try {
|
|
622
|
+
selectedAgents = selectAgents({ preferences: demand.preferences, targets: options.targets }).agents;
|
|
623
|
+
}
|
|
624
|
+
catch { /* The status result reports invalid strong state without extending observations. */ }
|
|
625
|
+
const observationDemand = { ...demand, plugins: [...observedPlugins.values()],
|
|
626
|
+
roots: [...new Map([...(demand.roots ?? []), ...candidates.flatMap((candidate) => {
|
|
627
|
+
const pluginId = `${candidate.sourceId}/${candidate.pluginName}`;
|
|
628
|
+
const plugin = observedPlugins.get(pluginId);
|
|
629
|
+
return plugin ? [{ pluginId, sourceId: candidate.sourceId, plugin, sourceState: 'ready', blockers: [] }] : [];
|
|
630
|
+
})].map((root) => [root.pluginId, root])).values()],
|
|
631
|
+
targetRequirements: demand.targetRequirements ? [...demand.targetRequirements,
|
|
632
|
+
...candidates.map((entry) => ({ pluginId: `${entry.sourceId}/${entry.pluginName}`, target: entry.platform }))] : undefined };
|
|
633
|
+
const adapters = options.nativeObservations ? { observations: [], existing: [], owned: [] }
|
|
634
|
+
: await readAdapterObservations({ ...options, targets: [...new Set([...selectedAgents, ...candidates.map((entry) => entry.platform)])] }, context, observationDemand);
|
|
635
|
+
const roots = new Set(demand.roots?.map((root) => root.pluginId) ?? []);
|
|
636
|
+
const queue = [...(demand.roots ?? []).map((root) => root.plugin).filter((plugin) => plugin !== undefined)];
|
|
637
|
+
const byId = new Map(demand.plugins.map((plugin) => [plugin.pluginId, plugin]));
|
|
638
|
+
while (queue.length) {
|
|
639
|
+
const plugin = queue.shift();
|
|
640
|
+
for (const name of plugin.manifest.dependencies ?? []) {
|
|
641
|
+
const id = `${plugin.sourceId}/${name}`;
|
|
642
|
+
if (roots.has(id))
|
|
643
|
+
continue;
|
|
644
|
+
roots.add(id);
|
|
645
|
+
const dependency = byId.get(id);
|
|
646
|
+
if (dependency)
|
|
647
|
+
queue.push(dependency);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
const expected = (pluginId, agent) => demand.targetRequirements
|
|
651
|
+
? demand.targetRequirements.some((item) => item.pluginId === pluginId && item.target === agent)
|
|
652
|
+
: roots.has(pluginId) && agent !== null && demand.preferences.state === 'valid' && demand.preferences.value.targets.includes(agent);
|
|
653
|
+
const nativeExtraObserved = adapters.owned
|
|
654
|
+
.filter((entry) => !expected(entry.pluginId, entry.agent))
|
|
655
|
+
.map((entry) => ({ ...entry,
|
|
656
|
+
expectedVersion: adapters.observations.find((item) => item.pluginId === entry.pluginId && item.platform === entry.agent)?.expectedVersion,
|
|
657
|
+
installedVersion: adapters.observations.find((item) => item.pluginId === entry.pluginId && item.platform === entry.agent)?.installedVersion,
|
|
658
|
+
delivery: { kind: 'native', platform: entry.agent },
|
|
659
|
+
observation: 'unknown', content: 'unknown', deploymentObservations: adapters.observations.find((observation) => observation.pluginId === entry.pluginId && observation.platform === entry.agent)?.deploymentObservations }));
|
|
660
|
+
const inventoryOwned = candidates.flatMap((entry) => {
|
|
661
|
+
// A verified Antigravity copy remains a native retirement candidate when
|
|
662
|
+
// its AW source is gone. Execution still verifies the live registration;
|
|
663
|
+
// the copy is not an owned filesystem output or AW source authority.
|
|
664
|
+
const nativeCopy = entry.platform === 'antigravity' && entry.scope === 'user'
|
|
665
|
+
&& entry.kind === 'namespacedMarketplace' && entry.recoveryCandidate?.evidence === 'verified'
|
|
666
|
+
&& entry.recoveryCandidate.binding.route === 'antigravity-cli';
|
|
667
|
+
return nativeCopy || entry.ownedComponent && !['codex', 'claude', 'gemini', 'copilot'].includes(entry.platform)
|
|
668
|
+
? [{ pluginId: `${entry.sourceId}/${entry.pluginName}`, agent: entry.platform, scope: options.scope }] : [];
|
|
669
|
+
});
|
|
670
|
+
for (const entry of inventoryOwned) {
|
|
671
|
+
if (!expected(entry.pluginId, entry.agent) && !nativeExtraObserved.some((target) => target.pluginId === entry.pluginId && target.agent === entry.agent)) {
|
|
672
|
+
nativeExtraObserved.push({ ...entry, delivery: { kind: 'native', platform: entry.agent }, observation: 'unknown', content: 'unknown' });
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
for (const entry of candidates) {
|
|
676
|
+
const component = entry.ownedComponent;
|
|
677
|
+
if (component?.kind !== 'owned-directory' || !['codex', 'claude', 'gemini', 'copilot'].includes(entry.platform)
|
|
678
|
+
|| component.identity.scope !== options.scope || entry.recoveryCandidate?.evidence !== 'verified'
|
|
679
|
+
|| component.identity.sourceId !== entry.sourceId || component.identity.sourceIdentity !== entry.sourceIdentity
|
|
680
|
+
|| component.identity.platform !== entry.platform || component.identity.pluginId !== `${entry.sourceId}/${entry.pluginName}`
|
|
681
|
+
|| component.identity.physicalKey !== entry.recoveryCandidate.binding.physicalKey)
|
|
682
|
+
continue;
|
|
683
|
+
const pluginId = component.identity.pluginId;
|
|
684
|
+
if (observedPlugins.get(pluginId)?.sourceIdentity === component.identity.sourceIdentity)
|
|
685
|
+
continue;
|
|
686
|
+
nativeExtraObserved.push({ pluginId, agent: entry.platform, scope: component.identity.scope,
|
|
687
|
+
delivery: { kind: 'native', platform: entry.platform }, observation: 'unknown', content: 'unknown',
|
|
688
|
+
backend: { retainedPackage: true, ownedComponents: [{ ...component, state: 'present' }] } });
|
|
689
|
+
}
|
|
690
|
+
const portableExtra = options.targets && !options.targets.includes('generic') ? { targets: [], complete: true }
|
|
691
|
+
: await inspectPortableExtraInstalled({
|
|
692
|
+
scope: options.scope, context, env: context.env, signal: options.signal, plugins: options.observationPlugins,
|
|
693
|
+
});
|
|
694
|
+
options.signal?.throwIfAborted();
|
|
695
|
+
const portableObserved = portableExtra.targets
|
|
696
|
+
.filter((entry) => !expected(entry.pluginId, entry.agent))
|
|
697
|
+
.map((entry) => ({ pluginId: entry.pluginId, agent: entry.agent, scope: options.scope,
|
|
698
|
+
delivery: { kind: 'agent-skills', provider: 'aw', agentId: 'generic' },
|
|
699
|
+
observation: entry.observation, content: entry.content,
|
|
700
|
+
backend: { skill: entry.skill, logicalIdentity: entry.logicalIdentity } }));
|
|
701
|
+
const extraObserved = [...nativeExtraObserved, ...portableObserved];
|
|
702
|
+
const relevantErrors = ownerInventory.errors.filter((error) => {
|
|
703
|
+
const relevance = error.relevance;
|
|
704
|
+
if (relevance.global)
|
|
705
|
+
return true;
|
|
706
|
+
if (options.targets && relevance.platform && !options.targets.includes(relevance.platform))
|
|
707
|
+
return false;
|
|
708
|
+
if (!options.observationPlugins)
|
|
709
|
+
return true;
|
|
710
|
+
if (!relevance.pluginName && !relevance.sourceId)
|
|
711
|
+
return true;
|
|
712
|
+
return [...options.observationPlugins].some((id) => {
|
|
713
|
+
const parsed = parsePluginId(id);
|
|
714
|
+
const plugin = observedPlugins.get(id);
|
|
715
|
+
return (!relevance.sourceId || !parsed.sourceId || relevance.sourceId === parsed.sourceId)
|
|
716
|
+
&& (!relevance.pluginName || relevance.pluginName === parsed.pluginName
|
|
717
|
+
|| relevance.componentName && plugin?.manifest.extensions?.agents?.some((agent) => agent.name === relevance.componentName));
|
|
718
|
+
});
|
|
719
|
+
});
|
|
720
|
+
const result = await statusFromObservations({ ...options, context, demand,
|
|
721
|
+
nativeObservations: options.nativeObservations ?? adapters.observations, extraObserved,
|
|
722
|
+
portableCoverage: portableExtra.complete, portableInstalled: portableExtra.targets,
|
|
723
|
+
nativeReadErrors: [
|
|
724
|
+
...relevantErrors.map(inventoryRecoveryDiagnostic),
|
|
725
|
+
...adapters.observations.flatMap((entry) => entry.blockers.filter((error) => NATIVE_READ_ERRORS.has(error.code))),
|
|
726
|
+
] });
|
|
727
|
+
result.coverage.requestComplete = result.coverage.native && result.coverage.portable;
|
|
728
|
+
result.coverage.native &&= ownerInventory.errors.length === 0;
|
|
729
|
+
for (const target of result.inventory?.flatMap((entry) => entry.targetResults) ?? []) {
|
|
730
|
+
for (const error of relevantErrors) {
|
|
731
|
+
const relevance = error.relevance;
|
|
732
|
+
const identity = parsePluginId(target.pluginId);
|
|
733
|
+
if (!relevance.global && (relevance.platform && relevance.platform !== target.agent
|
|
734
|
+
|| relevance.sourceId && relevance.sourceId !== identity.sourceId
|
|
735
|
+
|| relevance.scope && relevance.scope !== target.scope
|
|
736
|
+
&& !(relevance.scope === 'user' && target.scope === 'project' && ['codex', 'claude', 'gemini', 'copilot'].includes(target.agent))
|
|
737
|
+
|| relevance.projectLocationKey && relevance.projectLocationKey !== context.projectKey
|
|
738
|
+
|| relevance.pluginName && relevance.pluginName !== identity.pluginName
|
|
739
|
+
&& !(relevance.componentName && observedPlugins.get(target.pluginId)?.manifest.extensions?.agents?.some((agent) => agent.name === relevance.componentName))))
|
|
740
|
+
continue;
|
|
741
|
+
target.blockers.push(inventoryRecoveryDiagnostic(error));
|
|
742
|
+
if (target.content === 'satisfied') {
|
|
743
|
+
target.content = 'unknown';
|
|
744
|
+
target.observation = 'unknown';
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
result.existingTargets = [
|
|
749
|
+
...adapters.existing,
|
|
750
|
+
...portableExtra.targets.map((target) => ({ pluginId: target.pluginId, agent: target.agent, scope: options.scope })),
|
|
751
|
+
];
|
|
752
|
+
result.ownedTargets = [
|
|
753
|
+
...adapters.owned, ...inventoryOwned,
|
|
754
|
+
...portableExtra.targets.map((target) => ({ pluginId: target.pluginId, agent: target.agent, scope: options.scope })),
|
|
755
|
+
];
|
|
756
|
+
await options.onNativeStatus?.(result, demand);
|
|
757
|
+
options.signal?.throwIfAborted();
|
|
758
|
+
return result;
|
|
759
|
+
}
|
|
760
|
+
finally {
|
|
761
|
+
await context.dispose();
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
export async function checkRecovery(selectors, options) {
|
|
765
|
+
const status = await readRecoveryStatus(options);
|
|
766
|
+
const blockers = [];
|
|
767
|
+
const roots = [...new Set(status.inventory?.map((root) => root.pluginId) ?? [])];
|
|
768
|
+
const requested = [];
|
|
769
|
+
if (options.all && selectors.length)
|
|
770
|
+
blockers.push(diagnostic('syncSelectorConflict'));
|
|
771
|
+
else if (!selectors.length)
|
|
772
|
+
requested.push(...roots);
|
|
773
|
+
else
|
|
774
|
+
for (const selector of selectors) {
|
|
775
|
+
const parsed = parsePluginId(selector);
|
|
776
|
+
const matches = roots.filter((id) => parsed.sourceId ? id === selector : parsePluginId(id).pluginName === parsed.pluginName);
|
|
777
|
+
if (matches.length !== 1)
|
|
778
|
+
blockers.push(diagnostic('syncPluginNotDesired'));
|
|
779
|
+
else if (!requested.includes(matches[0]))
|
|
780
|
+
requested.push(matches[0]);
|
|
781
|
+
}
|
|
782
|
+
const selectedRoots = status.inventory?.filter((root) => requested.includes(root.pluginId)) ?? [];
|
|
783
|
+
blockers.push(...selectedRoots.flatMap((root) => root.blockers));
|
|
784
|
+
if (requested.length && status.selection.agents.length === 0)
|
|
785
|
+
blockers.push(diagnostic('targetsNotConfigured'));
|
|
786
|
+
const targetResults = selectedRoots.flatMap((root) => root.targetResults)
|
|
787
|
+
.filter((target) => !options.targets || options.targets.includes(target.agent));
|
|
788
|
+
const remainingTargets = targetResults.filter((target) => target.blockers.length || target.observation !== 'verified')
|
|
789
|
+
.map(({ pluginId, agent, scope, delivery }) => ({ pluginId, agent, scope, delivery }));
|
|
790
|
+
if (status.intent.state !== 'valid' && status.intent.state !== 'absent')
|
|
791
|
+
blockers.push(diagnostic('pluginIntentStateInvalid'));
|
|
792
|
+
const errors = status.errors;
|
|
793
|
+
const ok = blockers.length === 0 && remainingTargets.length === 0 && errors.length === 0
|
|
794
|
+
&& !(requested.length === 0 && status.allSatisfied === null);
|
|
795
|
+
return { schemaVersion: 1, kind: 'aw-recovery', scope: status.scope, command: 'sync:check', ok,
|
|
796
|
+
intent: { ...status.intent, roots: status.inventory === null ? null : roots },
|
|
797
|
+
requestedRoots: requested, requestedTargets: targetResults.map(({ pluginId, agent, scope, delivery }) => ({ pluginId, agent, scope, delivery })), selection: status.selection, blockers, errors,
|
|
798
|
+
targetResults, remainingTargets, recoveryActions: ok ? [] : ['aw plugin status --json'],
|
|
799
|
+
allSatisfied: status.allSatisfied, inSync: status.inSync,
|
|
800
|
+
coverage: { scopes: status.coverage.scopes ?? [status.scope], ...(status.coverage.projectRoot ? { projectRoot: status.coverage.projectRoot } : {}) },
|
|
801
|
+
declarationChanged: false, preferencesChanged: false, configChanged: false, outputsMayHaveChanged: false };
|
|
802
|
+
}
|
|
803
|
+
export function aggregateConvergence(allSatisfied, residue) {
|
|
804
|
+
return allSatisfied === false || residue === 'present' ? false
|
|
805
|
+
: allSatisfied === null || residue === 'unknown' ? null : true;
|
|
806
|
+
}
|
|
807
|
+
export async function readRecoveryStatus(options, preparedDemand) {
|
|
808
|
+
const nativeQuerySession = createNativeQuerySession();
|
|
809
|
+
try {
|
|
810
|
+
return await readRecoveryStatusWithQueries({ ...options, nativeQuerySession }, preparedDemand);
|
|
811
|
+
}
|
|
812
|
+
finally {
|
|
813
|
+
await nativeQuerySession.dispose();
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
async function readRecoveryStatusWithQueries(options, preparedDemand) {
|
|
817
|
+
options = { ...options, discoveryCache: new Map(), catalogSources: new Map() };
|
|
818
|
+
const snapshot = preparedDemand ?? await measureRecoveryPerformanceStage(options, 'status.demand', () => readJointDemand(options));
|
|
819
|
+
if (options.codexObservationSession || options.nativeObservations) {
|
|
820
|
+
return readRecoveryStatusInSession(options, snapshot);
|
|
821
|
+
}
|
|
822
|
+
const context = await createScopeContext({ scope: snapshot.context.context,
|
|
823
|
+
cwd: snapshot.context.projectRoot ?? options.cwd, env: options.env, readOnly: true });
|
|
824
|
+
let session;
|
|
825
|
+
try {
|
|
826
|
+
options.signal?.throwIfAborted();
|
|
827
|
+
session = await createCodexNativeObservationSession({ exactCwd: context.executionCwd, env: context.env,
|
|
828
|
+
runner: async (request) => {
|
|
829
|
+
const result = await runNativeCli({ ...request, signal: options.signal,
|
|
830
|
+
timeoutMs: DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS }, options.nativeCliRunner);
|
|
831
|
+
if (Buffer.byteLength(result.stdout) + Buffer.byteLength(result.stderr) > 1024 * 1024)
|
|
832
|
+
throw new Error('nativeObservationOutputLimit');
|
|
833
|
+
return result;
|
|
834
|
+
} });
|
|
835
|
+
// User reads use only this session's neutral cwd. Project reads add the
|
|
836
|
+
// exact project snapshot without repeating the same neutral observation.
|
|
837
|
+
return await readRecoveryStatusInSession({ ...options, codexObservationSession: session }, snapshot);
|
|
838
|
+
}
|
|
839
|
+
finally {
|
|
840
|
+
try {
|
|
841
|
+
await session?.dispose();
|
|
842
|
+
}
|
|
843
|
+
finally {
|
|
844
|
+
await context.dispose();
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
/** An empty demand or inventory does not establish that the selected Catalog is readable. */
|
|
849
|
+
async function checkUndeclaredSelection(options, snapshot) {
|
|
850
|
+
const demands = [snapshot.user, ...(snapshot.project ? [snapshot.project] : [])];
|
|
851
|
+
const known = new Set(demands.flatMap((demand) => demand.plugins.map((plugin) => plugin.pluginId)));
|
|
852
|
+
const selectors = (options.plugins ?? []).filter((selector) => ![...known].some((id) => id === selector || !selector.includes('/') && parsePluginId(id).pluginName === selector));
|
|
853
|
+
if (!selectors.length)
|
|
854
|
+
return [];
|
|
855
|
+
const sources = options.catalogSources ?? new Map();
|
|
856
|
+
for (const source of [options.catalogOperationContext, ...demands.map((demand) => demand.catalogOperationContext)]
|
|
857
|
+
.flatMap((context) => context?.catalog.sources ?? []))
|
|
858
|
+
if (!sources.has(source.sourceId))
|
|
859
|
+
sources.set(source.sourceId, source);
|
|
860
|
+
const errors = [];
|
|
861
|
+
try {
|
|
862
|
+
const config = await readCatalogSourcesConfigSnapshot(options.env);
|
|
863
|
+
const configured = new Set(config.config.sources.map((source) => source.id));
|
|
864
|
+
const wanted = new Set(selectors.flatMap((selector) => parsePluginId(selector).sourceId
|
|
865
|
+
? [parsePluginId(selector).sourceId] : [...configured]));
|
|
866
|
+
const missing = [...wanted].filter((id) => configured.has(id) && !sources.has(id));
|
|
867
|
+
if (missing.length) {
|
|
868
|
+
const context = await resolvePartialCatalogOperationContext({ sourceIds: missing, configSnapshot: config,
|
|
869
|
+
env: options.env, signal: options.signal });
|
|
870
|
+
for (const source of context.catalog.sources)
|
|
871
|
+
sources.set(source.sourceId, source);
|
|
872
|
+
}
|
|
873
|
+
for (const selector of selectors) {
|
|
874
|
+
const { sourceId, pluginName } = parsePluginId(selector);
|
|
875
|
+
const candidates = sourceId ? [sourceId] : [...configured];
|
|
876
|
+
const code = sourceId && !configured.has(sourceId) ? 'sourceMissing'
|
|
877
|
+
: candidates.some((id) => !sources.get(id)?.resolution) ? 'sourceActiveUnavailable'
|
|
878
|
+
: !candidates.some((id) => sources.get(id)?.resolution?.manifest.entries.some((entry) => entry.name === pluginName))
|
|
879
|
+
? 'pluginUnavailable' : undefined;
|
|
880
|
+
if (code)
|
|
881
|
+
errors.push({ code, message: 'The selected plugin or its Catalog source could not be confirmed.',
|
|
882
|
+
...(sourceId ? { pluginId: selector, subject: { pluginId: selector, sourceId } } : {}) });
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
catch (error) {
|
|
886
|
+
rethrowFatalError(error);
|
|
887
|
+
options.signal?.throwIfAborted();
|
|
888
|
+
errors.push({ code: 'catalogReadFailed', message: 'The selected Catalog source could not be read.' });
|
|
889
|
+
}
|
|
890
|
+
return errors;
|
|
891
|
+
}
|
|
892
|
+
async function readRecoveryStatusInSession(options, snapshot) {
|
|
893
|
+
const selectionErrors = await checkUndeclaredSelection(options, snapshot);
|
|
894
|
+
const globalPlan = deriveJointDemand(snapshot);
|
|
895
|
+
const plan = options.targets ? deriveJointDemand({ ...snapshot, preferences: snapshot.preferences
|
|
896
|
+
? { ...snapshot.preferences, targets: [...new Set([...snapshot.preferences.targets, ...options.targets])] } : null }) : globalPlan;
|
|
897
|
+
const matchesPlugin = (id) => !options.plugins?.length || options.plugins.some((selector) => selector === id || !selector.includes('/') && parsePluginId(id).pluginName === selector);
|
|
898
|
+
const selected = Boolean(options.plugins?.length || options.targets);
|
|
899
|
+
const observationPlugins = options.plugins?.length ? new Set(plan.placements.filter((item) => matchesPlugin(item.pluginId)
|
|
900
|
+
|| item.contributions.some((contribution) => matchesPlugin(contribution.root))).map((item) => item.pluginId)) : undefined;
|
|
901
|
+
if (observationPlugins) {
|
|
902
|
+
const plugins = [...new Map([snapshot.user, ...(snapshot.project ? [snapshot.project] : [])]
|
|
903
|
+
.flatMap((demand) => demand.plugins).map((plugin) => [plugin.pluginId, plugin])).values()];
|
|
904
|
+
for (const id of observationPlugins) {
|
|
905
|
+
const plugin = plugins.find((entry) => entry.pluginId === id);
|
|
906
|
+
if (!plugin)
|
|
907
|
+
continue;
|
|
908
|
+
for (const dependency of plugin.manifest.dependencies ?? [])
|
|
909
|
+
observationPlugins.add(`${plugin.sourceId}/${dependency}`);
|
|
910
|
+
const slots = new Set(plugin.manifest.extensions?.agents?.map((agent) => agent.name) ?? []);
|
|
911
|
+
for (const candidate of plugins)
|
|
912
|
+
if (candidate.manifest.extensions?.agents?.some((agent) => slots.has(agent.name))) {
|
|
913
|
+
observationPlugins.add(candidate.pluginId);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (observationPlugins)
|
|
918
|
+
for (const plugin of options.plugins ?? [])
|
|
919
|
+
observationPlugins.add(plugin);
|
|
920
|
+
const selectedPlacement = (item) => (!options.targets || options.targets.includes(item.target)) && (!observationPlugins || observationPlugins.has(item.pluginId));
|
|
921
|
+
const scopes = [snapshot.user, ...(snapshot.project ? [snapshot.project] : [])];
|
|
922
|
+
const observed = [];
|
|
923
|
+
for (const demand of scopes) {
|
|
924
|
+
const nodes = plan.placements.filter((item) => selectedPlacement(item) && (item.scope === demand.scope
|
|
925
|
+
|| demand.scope === 'project' && ['codex', 'claude', 'gemini', 'copilot'].includes(item.target)
|
|
926
|
+
&& item.contributions.some((contribution) => contribution.scope === 'project')));
|
|
927
|
+
const expanded = { ...demand,
|
|
928
|
+
plugins: [...new Map([...demand.plugins, ...nodes.map((item) => item.plugin)]
|
|
929
|
+
.map((plugin) => [plugin.pluginId, plugin])).values()],
|
|
930
|
+
catalogOperationContext: demand.catalogOperationContext ?? snapshot.user.catalogOperationContext
|
|
931
|
+
?? snapshot.project?.catalogOperationContext,
|
|
932
|
+
userProviders: demand.scope === 'project' ? Object.fromEntries((snapshot.preferences?.targets ?? []).map((target) => [target,
|
|
933
|
+
plan.placements.filter((item) => item.scope === 'user' && item.target === target
|
|
934
|
+
&& !nodes.some((project) => project.scope === 'project' && project.pluginId === item.pluginId && project.target === item.target)).map((item) => item.pluginId)])) : {},
|
|
935
|
+
targetRequirements: nodes.map((item) => ({ pluginId: item.pluginId, target: item.target,
|
|
936
|
+
...(item.scope === 'user' && demand.scope === 'project' ? { inheritsUserNative: true } : {}) })),
|
|
937
|
+
roots: demand.roots === null ? null : [...new Map(nodes.map((item) => [item.pluginId, {
|
|
938
|
+
pluginId: item.pluginId, sourceId: item.plugin.sourceId, sourceState: 'ready',
|
|
939
|
+
blockers: [], plugin: item.plugin,
|
|
940
|
+
}])).values()] };
|
|
941
|
+
observed.push(await readScopedRecoveryStatus({ ...options, onNativeStatus: undefined, scope: demand.scope,
|
|
942
|
+
cwd: snapshot.context.projectRoot ?? options.cwd, observationPlugins, targets: options.targets, demandOverride: expanded }));
|
|
943
|
+
}
|
|
944
|
+
const allTargets = observed.flatMap((status) => status.inventory?.flatMap((item) => item.targetResults) ?? []).map((target) => {
|
|
945
|
+
const providers = plan.placements.filter((placement) => placement.pluginId === target.pluginId && placement.target === target.agent
|
|
946
|
+
&& (placement.scope === target.scope || target.scope === 'project'
|
|
947
|
+
&& ['codex', 'claude', 'gemini', 'copilot'].includes(target.agent) && placement.scope === 'user'
|
|
948
|
+
&& placement.contributions.some((entry) => entry.scope === 'project')));
|
|
949
|
+
const contributions = providers.flatMap((provider) => provider.contributions
|
|
950
|
+
.filter((entry) => provider.scope === target.scope || entry.scope === target.scope));
|
|
951
|
+
return { ...target, contributions: contributions.map((entry) => ({ root: entry.root, scope: entry.scope, path: [...entry.path] })),
|
|
952
|
+
requiredBy: [...new Set(contributions.map((entry) => entry.root))], providerScope: providers[0]?.scope,
|
|
953
|
+
relation: contributions.some((entry) => entry.path.length === 1 && entry.scope === target.scope) ? 'root' : 'dependency' };
|
|
954
|
+
});
|
|
955
|
+
const inventory = scopes.some((demand) => demand.roots !== null) ? [] : null;
|
|
956
|
+
const visibleInventory = [];
|
|
957
|
+
for (const demand of scopes)
|
|
958
|
+
for (const root of demand.roots ?? []) {
|
|
959
|
+
const targetResults = [];
|
|
960
|
+
for (const requirement of plan.roots.filter((entry) => entry.scope === demand.scope && entry.pluginId === root.pluginId)) {
|
|
961
|
+
const placement = plan.placements.find((item) => item.pluginId === root.pluginId && item.target === requirement.target
|
|
962
|
+
&& item.contributions.some((contribution) => contribution.scope === demand.scope && contribution.root === root.pluginId));
|
|
963
|
+
const target = { pluginId: root.pluginId, agent: requirement.target, scope: demand.scope,
|
|
964
|
+
requirementScope: demand.scope, providerScope: placement?.scope,
|
|
965
|
+
delivery: root.plugin ? resolveDelivery(root.plugin.manifest, requirement.target, demand.scope) ?? null : null,
|
|
966
|
+
execution: 'not-run', observation: 'unknown', content: 'unknown', requiredBy: [root.pluginId], relation: 'root',
|
|
967
|
+
...(root.plugin?.manifest.version ? { expectedVersion: root.plugin.manifest.version } : {}), blockers: [...requirement.blockers] };
|
|
968
|
+
if (requirement.state === 'excluded' || requirement.state === 'unsupported') {
|
|
969
|
+
target.satisfaction = requirement.state;
|
|
970
|
+
target.content = 'satisfied';
|
|
971
|
+
target.observation = 'verified';
|
|
972
|
+
if (requirement.reasons?.length)
|
|
973
|
+
target.reasons = requirement.reasons;
|
|
974
|
+
}
|
|
975
|
+
else if (requirement.state === 'required') {
|
|
976
|
+
const providers = requirement.dependencies.map((id) => {
|
|
977
|
+
const provider = plan.placements.find((item) => item.pluginId === id && item.target === requirement.target
|
|
978
|
+
&& item.contributions.some((contribution) => contribution.scope === demand.scope && contribution.root === root.pluginId));
|
|
979
|
+
if (!provider)
|
|
980
|
+
return undefined;
|
|
981
|
+
// These observations check the same physical package and the demand's own effective scope.
|
|
982
|
+
const scope = hasSharedUserPackage(requirement.target) ? demand.scope : provider.scope;
|
|
983
|
+
return allTargets.find((item) => item.pluginId === id && item.agent === requirement.target && item.scope === scope);
|
|
984
|
+
});
|
|
985
|
+
const ownProvider = providers.find((provider) => provider?.pluginId === root.pluginId);
|
|
986
|
+
if (ownProvider?.installedVersion)
|
|
987
|
+
target.installedVersion = ownProvider.installedVersion;
|
|
988
|
+
target.blockers.push(...providers.flatMap((item) => item?.blockers ?? []));
|
|
989
|
+
const reasons = providers.flatMap((item) => item?.reasons ?? []);
|
|
990
|
+
if (reasons.length)
|
|
991
|
+
target.reasons = reasons;
|
|
992
|
+
const componentGaps = providers.flatMap((item) => item?.componentGaps ?? []);
|
|
993
|
+
if (componentGaps.length)
|
|
994
|
+
target.componentGaps = [...new Map(componentGaps.map((gap) => [JSON.stringify([gap.providerPluginId, gap.agent, gap.renderScope, gap.id]), gap])).values()];
|
|
995
|
+
const exclusions = providers.flatMap((item) => item?.deploymentExclusions ?? []);
|
|
996
|
+
if (exclusions.length)
|
|
997
|
+
target.deploymentExclusions = [...new Map(exclusions.map((exclusion) => [JSON.stringify([exclusion.pluginId, exclusion.platform, exclusion.scope, exclusion.productId, exclusion.reasonCode]), exclusion])).values()];
|
|
998
|
+
const deployments = providers.flatMap((item) => item?.deploymentObservations ?? []);
|
|
999
|
+
if (deployments.length)
|
|
1000
|
+
target.deploymentObservations = [...new Map(deployments.map((item) => [item.bindingId, item])).values()];
|
|
1001
|
+
target.content = ['conflict', 'drifted', 'absent', 'unknown'].find((state) => providers.some((item) => (item?.content ?? 'unknown') === state)) ?? 'satisfied';
|
|
1002
|
+
target.observation = target.content === 'satisfied' ? 'verified' : target.content === 'absent' ? 'missing' : 'unknown';
|
|
1003
|
+
target.satisfaction = target.content === 'satisfied' ? demand.scope === 'project' && placement?.scope === 'user' ? 'inherited-user' : 'installed'
|
|
1004
|
+
: target.content === 'unknown' ? 'unknown' : 'pending';
|
|
1005
|
+
target.backend = providers.map((provider) => ({ pluginId: provider?.pluginId, scope: provider?.scope, content: provider?.content, live: provider?.backend }));
|
|
1006
|
+
}
|
|
1007
|
+
targetResults.push(target);
|
|
1008
|
+
}
|
|
1009
|
+
visibleInventory.push({ pluginId: root.pluginId, source: root.sourceId, sourceState: root.sourceState,
|
|
1010
|
+
blockers: root.blockers.map(diagnostic), targetResults });
|
|
1011
|
+
}
|
|
1012
|
+
const expected = new Set(plan.placements.map((item) => `${item.pluginId}\0${item.target}\0${item.scope}`));
|
|
1013
|
+
const extraObserved = observed.flatMap((status) => status.extraObserved)
|
|
1014
|
+
.filter((item) => !expected.has(`${item.pluginId}\0${item.agent}\0${item.scope}`));
|
|
1015
|
+
const targets = visibleInventory.flatMap((item) => item.targetResults);
|
|
1016
|
+
const globalTargets = targets.filter((target) => globalPlan.roots.some((root) => root.pluginId === target.pluginId && root.target === target.agent && root.scope === target.scope));
|
|
1017
|
+
const fullObservation = !selected || globalPlan.placements.every(selectedPlacement);
|
|
1018
|
+
const knownFailure = globalPlan.errors.some((error) => ['targetsNotConfigured', 'dependencyExcluded', 'dependencyContractInvalid', 'targetPlacementConflict'].includes(error.code))
|
|
1019
|
+
|| globalTargets.some((target) => ['absent', 'drifted', 'conflict'].includes(target.content ?? 'unknown')
|
|
1020
|
+
|| target.blockers.some((entry) => entry.code === 'awCapabilityUnsupported'));
|
|
1021
|
+
const uncertain = !fullObservation || !globalPlan.complete || globalTargets.some((target) => target.content === 'unknown' || target.blockers.length > 0);
|
|
1022
|
+
const allSatisfied = knownFailure ? false : uncertain ? null : true;
|
|
1023
|
+
const nativeCoverage = !selected && observed.every((status) => status.coverage.native);
|
|
1024
|
+
const portableCoverage = !selected && observed.every((status) => status.coverage.portable);
|
|
1025
|
+
const errors = [...new Map([...selectionErrors, ...plan.errors.filter((error) => !selected || !error.pluginId
|
|
1026
|
+
|| !observationPlugins || observationPlugins.has(error.pluginId)), ...observed.flatMap((status) => status.errors)]
|
|
1027
|
+
.map((error) => [JSON.stringify(error), error])).values()];
|
|
1028
|
+
const result = { schemaVersion: 1, kind: 'aw-recovery-status', scope: snapshot.context.context, ok: errors.length === 0,
|
|
1029
|
+
intent: { state: scopes.some((demand) => demand.intent.state === 'invalid') ? 'invalid'
|
|
1030
|
+
: scopes.some((demand) => demand.intent.state === 'unreadable') ? 'unreadable'
|
|
1031
|
+
: scopes.some((demand) => demand.intent.state === 'unsupported-version') ? 'unsupported-version'
|
|
1032
|
+
: scopes.some((demand) => demand.intent.state === 'valid') ? 'valid' : 'absent' },
|
|
1033
|
+
selection: { agents: snapshot.preferences?.targets ?? [], origin: snapshot.preferences?.targets.length ? 'preference' : 'none', preferences: snapshot.user.preferences.state },
|
|
1034
|
+
inventory: inventory === null ? null : visibleInventory, extraObserved, observedTargets: allTargets,
|
|
1035
|
+
existingTargets: observed.flatMap((status) => status.existingTargets ?? []), ownedTargets: observed.flatMap((status) => status.ownedTargets ?? []),
|
|
1036
|
+
coverage: { native: nativeCoverage, portable: portableCoverage, scopes: snapshot.context.scopes,
|
|
1037
|
+
...(snapshot.context.projectRoot ? { projectRoot: snapshot.context.projectRoot } : {}) },
|
|
1038
|
+
counts: { blocked: targets.filter((target) => target.blockers.length).length,
|
|
1039
|
+
pending: targets.filter((target) => target.satisfaction === 'pending').length,
|
|
1040
|
+
unconfirmed: targets.filter((target) => target.content === 'unknown').length,
|
|
1041
|
+
ready: targets.filter((target) => target.content === 'satisfied').length },
|
|
1042
|
+
allSatisfied, inSync: aggregateConvergence(allSatisfied, extraObserved.length ? 'present' : nativeCoverage && portableCoverage ? 'absent' : 'unknown'), errors };
|
|
1043
|
+
if (options.plugins?.length) {
|
|
1044
|
+
for (const target of allTargets.filter((target) => matchesPlugin(target.pluginId))) {
|
|
1045
|
+
if (visibleInventory.some((entry) => entry.pluginId === target.pluginId))
|
|
1046
|
+
continue;
|
|
1047
|
+
visibleInventory.push({ pluginId: target.pluginId, source: parsePluginId(target.pluginId).sourceId, sourceState: 'ready', blockers: [],
|
|
1048
|
+
targetResults: allTargets.filter((entry) => entry.pluginId === target.pluginId).map((entry) => ({ ...entry,
|
|
1049
|
+
requirementScope: entry.contributions?.[0]?.scope,
|
|
1050
|
+
satisfaction: entry.content === 'satisfied' ? entry.scope === 'user' && entry.contributions?.some((contribution) => contribution.scope === 'project')
|
|
1051
|
+
? 'inherited-user' : 'installed' : entry.content === 'unknown' ? 'unknown' : 'pending' })) });
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
if (selected) {
|
|
1055
|
+
result.inventory = result.inventory?.filter((entry) => matchesPlugin(entry.pluginId)).map((entry) => ({ ...entry,
|
|
1056
|
+
targetResults: entry.targetResults.filter((target) => !options.targets || options.targets.includes(target.agent)) })) ?? null;
|
|
1057
|
+
const requested = result.inventory?.flatMap((entry) => entry.targetResults) ?? [];
|
|
1058
|
+
result.coverage.requestComplete = observed.every((status) => status.coverage.requestComplete ?? (status.coverage.native && status.coverage.portable))
|
|
1059
|
+
&& result.errors.length === 0 && result.inventory !== null
|
|
1060
|
+
&& result.inventory.every((entry) => entry.sourceState === 'ready' && entry.blockers.length === 0)
|
|
1061
|
+
&& allTargets.every((target) => target.content !== 'unknown'
|
|
1062
|
+
&& target.blockers.every((blocker) => blocker.code === 'needs-preparation' && ['absent', 'drifted'].includes(target.content ?? '')))
|
|
1063
|
+
&& requested.every((target) => target.content !== 'unknown');
|
|
1064
|
+
result.counts = { blocked: requested.filter((target) => target.blockers.length).length,
|
|
1065
|
+
pending: requested.filter((target) => target.satisfaction === 'pending').length,
|
|
1066
|
+
unconfirmed: requested.filter((target) => target.content === 'unknown').length,
|
|
1067
|
+
ready: requested.filter((target) => target.content === 'satisfied').length };
|
|
1068
|
+
}
|
|
1069
|
+
await options.onNativeStatus?.(result, snapshot.context.context === 'project' ? snapshot.project : snapshot.user);
|
|
1070
|
+
options.signal?.throwIfAborted();
|
|
1071
|
+
return result;
|
|
1072
|
+
}
|
|
1073
|
+
//# sourceMappingURL=status.js.map
|