@lesliechan721/aw 0.1.0-beta.84 → 0.1.0-beta.86
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/command-runtime-config.d.mts +9 -0
- package/dist/authoring/assets/command-runtime-config.mjs +106 -0
- package/dist/authoring/assets/command-runtime-config.mjs.map +1 -0
- package/dist/authoring/scripts/validate-plugin.mjs +17 -22
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +4 -0
- package/dist/scripts/aw-skill-eval-materializer.js +27 -0
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
- package/dist/scripts/bundle-plugins.js +1 -1
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.js +13 -2
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +2 -2
- package/dist/src/commands/catalog-source.d.ts +2 -1
- package/dist/src/commands/catalog-source.js +8 -7
- package/dist/src/commands/catalog-source.js.map +1 -1
- package/dist/src/commands/deployment-confirmation.d.ts +8 -1
- package/dist/src/commands/deployment-confirmation.js +79 -11
- package/dist/src/commands/deployment-confirmation.js.map +1 -1
- package/dist/src/commands/lifecycle-command-package.d.ts +44 -0
- package/dist/src/commands/lifecycle-command-package.js +195 -0
- package/dist/src/commands/lifecycle-command-package.js.map +1 -0
- package/dist/src/commands/managed-commands.d.ts +6 -0
- package/dist/src/commands/managed-commands.js +203 -152
- package/dist/src/commands/managed-commands.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +22 -21
- package/dist/src/commands/operation-plan.js +2 -5
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/permission-batch.d.ts +5 -0
- package/dist/src/commands/permission-batch.js +80 -0
- package/dist/src/commands/permission-batch.js.map +1 -0
- package/dist/src/commands/plugin-capabilities.js +17 -13
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.d.ts +8 -2
- package/dist/src/commands/public-config-confirmation.js +22 -5
- package/dist/src/commands/public-config-confirmation.js.map +1 -1
- package/dist/src/commands/public-lifecycle-result.d.ts +7 -12
- package/dist/src/commands/public-lifecycle-result.js +136 -40
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.js +49 -8
- package/dist/src/commands/public-lifecycle.js.map +1 -1
- package/dist/src/commands/public-plugin-query.js +21 -5
- package/dist/src/commands/public-plugin-query.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +4 -0
- package/dist/src/commands/rebuild-command.js +150 -48
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +12 -3
- package/dist/src/commands/rebuild-integration.js +52 -164
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +2 -1
- package/dist/src/commands/rebuild-operations.js +7 -2
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +12 -5
- package/dist/src/commands/rebuild-platform-integration.js +691 -186
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
- package/dist/src/commands/skill-eval.js +10 -1
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/generators/local-plugin.js +14 -15
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/generators/permissions.d.ts +18 -4
- package/dist/src/generators/permissions.js +76 -22
- package/dist/src/generators/permissions.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +84 -44
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/scope-context.d.ts +4 -2
- package/dist/src/intent/scope-context.js +37 -7
- package/dist/src/intent/scope-context.js.map +1 -1
- package/dist/src/output/command-receipt.js +7 -8
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/component-delivery.d.ts +28 -0
- package/dist/src/output/component-delivery.js +138 -0
- package/dist/src/output/component-delivery.js.map +1 -0
- package/dist/src/output/public-result.d.ts +17 -0
- package/dist/src/output/public-result.js +121 -25
- package/dist/src/output/public-result.js.map +1 -1
- package/dist/src/output/rebuild-progress.js +7 -4
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.js +51 -31
- package/dist/src/output/receipt-projection.js.map +1 -1
- package/dist/src/output/skill-invocation-notices.d.ts +2 -0
- package/dist/src/output/skill-invocation-notices.js +40 -4
- package/dist/src/output/skill-invocation-notices.js.map +1 -1
- package/dist/src/platforms/antigravity-permissions.d.ts +50 -0
- package/dist/src/platforms/antigravity-permissions.js +388 -0
- package/dist/src/platforms/antigravity-permissions.js.map +1 -0
- package/dist/src/platforms/capabilities.d.ts +4 -1
- package/dist/src/platforms/capabilities.js +93 -9
- package/dist/src/platforms/capabilities.js.map +1 -1
- package/dist/src/platforms/contracts.d.ts +46 -2
- package/dist/src/platforms/discovery.d.ts +13 -0
- package/dist/src/platforms/discovery.js +170 -30
- package/dist/src/platforms/discovery.js.map +1 -1
- package/dist/src/platforms/grok-permission-config.d.ts +22 -0
- package/dist/src/platforms/grok-permission-config.js +184 -0
- package/dist/src/platforms/grok-permission-config.js.map +1 -0
- package/dist/src/platforms/grok-permission-document.d.ts +4 -0
- package/dist/src/platforms/grok-permission-document.js +145 -0
- package/dist/src/platforms/grok-permission-document.js.map +1 -0
- package/dist/src/platforms/grok-permissions.d.ts +17 -0
- package/dist/src/platforms/grok-permissions.js +311 -0
- package/dist/src/platforms/grok-permissions.js.map +1 -0
- package/dist/src/platforms/host-permission-policy.d.ts +38 -0
- package/dist/src/platforms/host-permission-policy.js +86 -0
- package/dist/src/platforms/host-permission-policy.js.map +1 -0
- package/dist/src/platforms/inspection-grok.js +165 -11
- package/dist/src/platforms/inspection-grok.js.map +1 -1
- package/dist/src/platforms/inspection-native.js +53 -18
- package/dist/src/platforms/inspection-native.js.map +1 -1
- package/dist/src/platforms/inspection-pi.d.ts +7 -1
- package/dist/src/platforms/inspection-pi.js +295 -95
- package/dist/src/platforms/inspection-pi.js.map +1 -1
- package/dist/src/platforms/inspection-query.d.ts +4 -2
- package/dist/src/platforms/inspection-query.js +24 -8
- package/dist/src/platforms/inspection-query.js.map +1 -1
- package/dist/src/platforms/inspection.d.ts +4 -1
- package/dist/src/platforms/inspection.js +36 -4
- package/dist/src/platforms/inspection.js.map +1 -1
- package/dist/src/platforms/layout.d.ts +13 -0
- package/dist/src/platforms/layout.js +90 -12
- package/dist/src/platforms/layout.js.map +1 -1
- package/dist/src/platforms/lifecycle-native.d.ts +1 -0
- package/dist/src/platforms/lifecycle-native.js +25 -1
- package/dist/src/platforms/lifecycle-native.js.map +1 -1
- package/dist/src/platforms/lifecycle.d.ts +2 -0
- package/dist/src/platforms/lifecycle.js +98 -25
- package/dist/src/platforms/lifecycle.js.map +1 -1
- package/dist/src/platforms/opencode-permission-config.d.ts +13 -0
- package/dist/src/platforms/opencode-permission-config.js +253 -0
- package/dist/src/platforms/opencode-permission-config.js.map +1 -0
- package/dist/src/platforms/opencode-permissions.d.ts +39 -0
- package/dist/src/platforms/opencode-permissions.js +212 -0
- package/dist/src/platforms/opencode-permissions.js.map +1 -0
- package/dist/src/platforms/opencode-related-permissions.d.ts +40 -0
- package/dist/src/platforms/opencode-related-permissions.js +177 -0
- package/dist/src/platforms/opencode-related-permissions.js.map +1 -0
- package/dist/src/platforms/permission-ownership.d.ts +89 -0
- package/dist/src/platforms/permission-ownership.js +543 -0
- package/dist/src/platforms/permission-ownership.js.map +1 -0
- package/dist/src/platforms/permission-sidecar.d.ts +70 -0
- package/dist/src/platforms/permission-sidecar.js +215 -0
- package/dist/src/platforms/permission-sidecar.js.map +1 -0
- package/dist/src/platforms/projection-code-extension.js +2 -1
- package/dist/src/platforms/projection-code-extension.js.map +1 -1
- package/dist/src/platforms/projection.js +127 -29
- package/dist/src/platforms/projection.js.map +1 -1
- package/dist/src/platforms/supplement-layout.d.ts +5 -1
- package/dist/src/platforms/supplement-layout.js +23 -1
- package/dist/src/platforms/supplement-layout.js.map +1 -1
- package/dist/src/platforms/supplement-state.d.ts +1 -1
- package/dist/src/platforms/supplement-state.js +18 -7
- package/dist/src/platforms/supplement-state.js.map +1 -1
- package/dist/src/portable/commands.js +1 -1
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +4 -0
- package/dist/src/portable/materializer.js +8 -1
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery.d.ts +2 -0
- package/dist/src/portable/recovery.js +45 -8
- package/dist/src/portable/recovery.js.map +1 -1
- package/dist/src/recovery/coordinator.d.ts +3 -1
- package/dist/src/recovery/coordinator.js +101 -37
- package/dist/src/recovery/coordinator.js.map +1 -1
- package/dist/src/recovery/install-concurrency.js +3 -2
- package/dist/src/recovery/install-concurrency.js.map +1 -1
- package/dist/src/recovery/joint-coordinator.d.ts +7 -0
- package/dist/src/recovery/joint-coordinator.js +270 -64
- package/dist/src/recovery/joint-coordinator.js.map +1 -1
- package/dist/src/recovery/joint-demand.d.ts +14 -2
- package/dist/src/recovery/joint-demand.js +54 -7
- package/dist/src/recovery/joint-demand.js.map +1 -1
- package/dist/src/recovery/joint-install-execution.js +2 -1
- package/dist/src/recovery/joint-install-execution.js.map +1 -1
- package/dist/src/recovery/receipt.d.ts +15 -4
- package/dist/src/recovery/receipt.js +23 -0
- package/dist/src/recovery/receipt.js.map +1 -1
- package/dist/src/recovery/retirement.js +11 -17
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.d.ts +20 -8
- package/dist/src/recovery/status.js +411 -91
- package/dist/src/recovery/status.js.map +1 -1
- package/dist/src/review/eval-source-input.d.ts +1 -0
- package/dist/src/review/eval-source-input.js +7 -1
- package/dist/src/review/eval-source-input.js.map +1 -1
- package/dist/src/review/platform-profile.js +2 -1
- package/dist/src/review/platform-profile.js.map +1 -1
- package/dist/src/review/review-selection.js +12 -5
- package/dist/src/review/review-selection.js.map +1 -1
- package/dist/src/review/skill-materialization.d.ts +2 -1
- package/dist/src/review/skill-materialization.js +45 -43
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/review/source-binding.js +5 -1
- package/dist/src/review/source-binding.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +101 -57
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +72 -7
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +6 -2
- package/dist/src/tui/controller.js +17 -4
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/deployment-view.d.ts +6 -3
- package/dist/src/tui/deployment-view.js +52 -10
- package/dist/src/tui/deployment-view.js.map +1 -1
- package/dist/src/tui/diagnostic-projection.d.ts +7 -1
- package/dist/src/tui/diagnostic-projection.js +55 -5
- package/dist/src/tui/diagnostic-projection.js.map +1 -1
- package/dist/src/tui/entity-cards.d.ts +2 -1
- package/dist/src/tui/entity-cards.js +34 -11
- package/dist/src/tui/entity-cards.js.map +1 -1
- package/dist/src/tui/glossary.js +5 -0
- package/dist/src/tui/glossary.js.map +1 -1
- package/dist/src/tui/model.js +2 -1
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.js +3 -1
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
- package/dist/src/tui/operation-history.d.ts +6 -0
- package/dist/src/tui/operation-history.js +20 -2
- package/dist/src/tui/operation-history.js.map +1 -1
- package/dist/src/tui/operation-review-planner.js +130 -70
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-detail.d.ts +4 -1
- package/dist/src/tui/plugin-detail.js +9 -2
- package/dist/src/tui/plugin-detail.js.map +1 -1
- package/dist/src/tui/scoped-flow.js +34 -16
- package/dist/src/tui/scoped-flow.js.map +1 -1
- package/dist/src/tui/scoped-inventory.d.ts +6 -2
- package/dist/src/tui/scoped-inventory.js +29 -7
- package/dist/src/tui/scoped-inventory.js.map +1 -1
- package/dist/src/types.d.ts +10 -21
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +3 -36
- package/dist/src/utils/artifact-plan.js +16 -78
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +1 -60
- package/dist/src/utils/artifact-renderer.js +31 -57
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +3 -26
- package/dist/src/utils/artifact-request.js +13 -36
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/artifact-sources.d.ts +0 -8
- package/dist/src/utils/artifact-sources.js +0 -8
- package/dist/src/utils/artifact-sources.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +2 -7
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-source-references.js +22 -3
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +6 -0
- package/dist/src/utils/codex-native-observation.js +32 -3
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/component-command-preparation.d.ts +8 -11
- package/dist/src/utils/component-command-preparation.js +110 -210
- package/dist/src/utils/component-command-preparation.js.map +1 -1
- package/dist/src/utils/component-gap.d.ts +4 -0
- package/dist/src/utils/component-gap.js +20 -0
- package/dist/src/utils/component-gap.js.map +1 -0
- package/dist/src/utils/component-resources.js +2 -4
- package/dist/src/utils/component-resources.js.map +1 -1
- package/dist/src/utils/dynamic-skill-tree.js +2 -32
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/managed-command-cli-review.d.ts +43 -0
- package/dist/src/utils/managed-command-cli-review.js +389 -0
- package/dist/src/utils/managed-command-cli-review.js.map +1 -0
- package/dist/src/utils/managed-command-closure.d.ts +14 -3
- package/dist/src/utils/managed-command-closure.js +144 -23
- package/dist/src/utils/managed-command-closure.js.map +1 -1
- package/dist/src/utils/managed-command-errors.d.ts +5 -0
- package/dist/src/utils/managed-command-errors.js +10 -0
- package/dist/src/utils/managed-command-errors.js.map +1 -0
- package/dist/src/utils/managed-command-materialization.d.ts +77 -113
- package/dist/src/utils/managed-command-materialization.js +324 -323
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-preparation.d.ts +28 -65
- package/dist/src/utils/managed-command-preparation.js +33 -140
- package/dist/src/utils/managed-command-preparation.js.map +1 -1
- package/dist/src/utils/managed-command-review.d.ts +11 -4
- package/dist/src/utils/managed-command-review.js +33 -21
- package/dist/src/utils/managed-command-review.js.map +1 -1
- package/dist/src/utils/managed-command-runtime.d.ts +1 -0
- package/dist/src/utils/managed-command-runtime.js +6 -3
- package/dist/src/utils/managed-command-runtime.js.map +1 -1
- package/dist/src/utils/managed-command-snapshots.d.ts +17 -0
- package/dist/src/utils/managed-command-snapshots.js +84 -0
- package/dist/src/utils/managed-command-snapshots.js.map +1 -0
- package/dist/src/utils/managed-command-store.d.ts +65 -78
- package/dist/src/utils/managed-command-store.js +446 -383
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.d.ts +2 -0
- package/dist/src/utils/multi-source-catalog.js +3 -1
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli-interruption.d.ts +8 -0
- package/dist/src/utils/native-cli-interruption.js +65 -0
- package/dist/src/utils/native-cli-interruption.js.map +1 -0
- package/dist/src/utils/native-cli.d.ts +5 -0
- package/dist/src/utils/native-cli.js +166 -53
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-tool-context.d.ts +6 -3
- package/dist/src/utils/native-tool-context.js +3 -1
- package/dist/src/utils/native-tool-context.js.map +1 -1
- package/dist/src/utils/native-tool-review.d.ts +2 -12
- package/dist/src/utils/native-tool-review.js +6 -108
- package/dist/src/utils/native-tool-review.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +8 -0
- package/dist/src/utils/ownership.js +17 -3
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/package-content.d.ts +7 -0
- package/dist/src/utils/package-content.js +70 -0
- package/dist/src/utils/package-content.js.map +1 -0
- package/dist/src/utils/platform-empty-state.d.ts +32 -6
- package/dist/src/utils/platform-empty-state.js +146 -75
- package/dist/src/utils/platform-empty-state.js.map +1 -1
- package/dist/src/utils/plugin-config-command-apply.d.ts +33 -0
- package/dist/src/utils/plugin-config-command-apply.js +134 -0
- package/dist/src/utils/plugin-config-command-apply.js.map +1 -0
- package/dist/src/utils/plugin-config-impact.d.ts +19 -9
- package/dist/src/utils/plugin-config-impact.js +56 -37
- package/dist/src/utils/plugin-config-impact.js.map +1 -1
- package/dist/src/utils/plugin-config-write.d.ts +19 -19
- package/dist/src/utils/plugin-config-write.js +196 -770
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-scripts.js +19 -8
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +1 -1
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/src/utils/rendered-contract.js +12 -6
- package/dist/src/utils/rendered-contract.js.map +1 -1
- package/dist/src/utils/skill-invocation-warning.d.ts +8 -3
- package/dist/src/utils/skill-invocation-warning.js +27 -1
- package/dist/src/utils/skill-invocation-warning.js.map +1 -1
- package/package.json +4 -3
- package/dist/src/platforms/managed-command-placement.d.ts +0 -8
- package/dist/src/platforms/managed-command-placement.js +0 -79
- package/dist/src/platforms/managed-command-placement.js.map +0 -1
- package/dist/src/utils/managed-command-evidence.d.ts +0 -7
- package/dist/src/utils/managed-command-evidence.js +0 -10
- package/dist/src/utils/managed-command-evidence.js.map +0 -1
package/dist/src/index.js
CHANGED
|
@@ -11,11 +11,12 @@ import fs from 'node:fs';
|
|
|
11
11
|
import path from 'node:path';
|
|
12
12
|
import { defaultPluginProcessRunner } from './utils/plugin-scripts.js';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { withNativeCliInterruption } from './utils/native-cli-interruption.js';
|
|
14
15
|
import { Command, CommanderError, InvalidArgumentError, Option } from 'commander';
|
|
15
16
|
import { doctorEvalProviders } from '@lesliechan721/agent-skill-eval';
|
|
16
17
|
import { compilePluginConfigDefinition, selectPluginConfigProfile, PLATFORM_TARGETS } from '@lesliechan721/aw-plugin-core/manifest';
|
|
17
18
|
import { CatalogWorkspaceMissingError, resolveCatalogWorkspaceRoot } from './commands/catalog-workspace-resolution.js';
|
|
18
|
-
import { addCatalogSourceCommand, preflightCatalogSourceMutation, explicitRefPolicy, listCatalogSources, removeCatalogSourceCommand, updateCatalogSourceCommand, } from './commands/catalog-source.js';
|
|
19
|
+
import { addCatalogSourceCommand, describeSourceCommandRebinding, preflightCatalogSourceMutation, explicitRefPolicy, listCatalogSources, removeCatalogSourceCommand, updateCatalogSourceCommand, } from './commands/catalog-source.js';
|
|
19
20
|
import { catalogSourceStatusCommand, syncCatalogSourceCommand, } from './commands/catalog-generation.js';
|
|
20
21
|
import { catalogStoreErrorCode, catalogStorePrune, catalogStoreStatus, } from './commands/catalog-store.js';
|
|
21
22
|
import { WizardExecutionError, } from './commands/wizard.js';
|
|
@@ -25,7 +26,7 @@ import { createNoopReporter, formatWarnings } from './output/reporter.js';
|
|
|
25
26
|
import { redactString, redactValue } from './output/redact.js';
|
|
26
27
|
import { resolveCliPackageRoot } from './utils/paths.js';
|
|
27
28
|
import { coercePluginConfigUpdates, assertPluginConfigMutationCandidate, findConfigFieldEntry, formatPluginConfigSetRecoveryCommand, listNamespacedPluginConfigStores, readPluginConfigStore, renderPluginConfigValueForDisplay, resolveConfigRead, } from './utils/plugin-config.js';
|
|
28
|
-
import { applyPluginConfigWrite, ConfigApplyInterruptedError, applyPluginConfig, buildConfigMutationReceipt, configWriteStateForError, resetPluginConfigWithHelper, } from './utils/plugin-config-write.js';
|
|
29
|
+
import { applyPluginConfigWrite, ConfigApplyInterruptedError, applyPluginConfig, buildConfigMutationReceipt, configActiveAvailabilityError, configWriteStateForError, resetPluginConfigWithHelper, } from './utils/plugin-config-write.js';
|
|
29
30
|
import { assertStrictSemVer } from './utils/manifest.js';
|
|
30
31
|
import { assertCatalogSourceReferencesSupported, inventoryLegacyConfigReferences, } from './utils/catalog-source-references.js';
|
|
31
32
|
import { CatalogLeaseEscapeError, parsePluginId, withResolvedCatalogPlugin, withResolvedMultiSourceCatalog, } from './utils/multi-source-catalog.js';
|
|
@@ -359,8 +360,7 @@ function renderRecoveryReceipt(write, value) {
|
|
|
359
360
|
writeLine(write, `${target.pluginId} / ${target.agent} [${target.scope}]: ${target.execution}; ${target.content ?? target.observation}`);
|
|
360
361
|
}
|
|
361
362
|
for (const result of value.commandResults ?? []) {
|
|
362
|
-
|
|
363
|
-
writeLine(write, `托管命令 ${producer.sourceId}/${producer.pluginName}/${producer.key} [${producer.scope}]: ${result.state}`);
|
|
363
|
+
writeLine(write, `托管命令 ${result.selector} [${result.packageId}] ${result.action} / ${result.availability} (${result.state})`);
|
|
364
364
|
}
|
|
365
365
|
for (const change of value.nativeToolChanges ?? []) {
|
|
366
366
|
for (const phase of ['before', 'after']) {
|
|
@@ -565,6 +565,14 @@ function writeConfigApplyNotice(write, receipt) {
|
|
|
565
565
|
writeLine(write, `配置已保存。已刷新 ${completed} 个当前可见目标;${partialSummary}失败 ${failed} 个;跳过 ${skipped} 个。`);
|
|
566
566
|
writeTargetFailures();
|
|
567
567
|
}
|
|
568
|
+
if (receipt.apply.state !== 'skipped')
|
|
569
|
+
for (const entry of receipt.apply.commandResults ?? []) {
|
|
570
|
+
writeLine(write, `托管命令 ${entry.selector} [${entry.packageId}] ${entry.action} / ${entry.availability} (${entry.state})`);
|
|
571
|
+
for (const error of entry.errors)
|
|
572
|
+
writeLine(write, `[${error.code}] ${sanitizeMessage(error.message)}`);
|
|
573
|
+
for (const action of entry.recoveryActions)
|
|
574
|
+
writeLine(write, action);
|
|
575
|
+
}
|
|
568
576
|
writeWarnings(write, receipt.warnings);
|
|
569
577
|
}
|
|
570
578
|
function renderConfigFieldState(field) {
|
|
@@ -2078,12 +2086,14 @@ export function buildProgram(options = {}) {
|
|
|
2078
2086
|
throw error;
|
|
2079
2087
|
}
|
|
2080
2088
|
const mutation = command === 'unset' ? { kind: 'patch', removeKeys: [key] } : { kind: 'patch', updates: { [key]: inputValue } };
|
|
2081
|
-
const
|
|
2089
|
+
const reviewed = rawOptions.apply ? await preparePublicConfigConfirmation({ plugin, scope: work.context,
|
|
2082
2090
|
context: work.context, platform, cwd: context.cwd, env: context.env, cliVersion: resolveCliVersion(),
|
|
2083
2091
|
nativeCliRunner: context.nativeCliRunner, awHomeMutationToken, yes: rawOptions.yes, mutation,
|
|
2084
2092
|
rebuildRuntime: { ...context, awHomeMutationToken, catalogOperationContext,
|
|
2085
|
-
expectedGenerationSetDigest: catalogOperationContext.generationSetDigest
|
|
2086
|
-
|
|
2093
|
+
expectedGenerationSetDigest: catalogOperationContext.generationSetDigest,
|
|
2094
|
+
...(scriptTimeoutMs === undefined ? {} : { scriptTimeoutMs }) } })
|
|
2095
|
+
: undefined;
|
|
2096
|
+
const confirmation = reviewed?.confirmation ?? { required: false, provided: rawOptions.yes === true, effects: [] };
|
|
2087
2097
|
const writeReceipt = await applyPluginConfigWrite({ plugin, pluginName: plugin.manifest.name,
|
|
2088
2098
|
scope: work.context, context: work.context, platform, cliVersion: resolveCliVersion(),
|
|
2089
2099
|
cwd: context.cwd, env: context.env, nativeCliRunner: context.nativeCliRunner,
|
|
@@ -2091,6 +2101,8 @@ export function buildProgram(options = {}) {
|
|
|
2091
2101
|
expectedGenerationSetDigest: catalogOperationContext.generationSetDigest,
|
|
2092
2102
|
...(scriptTimeoutMs === undefined ? {} : { scriptTimeoutMs }) },
|
|
2093
2103
|
awHomeMutationToken, request: command === 'unset' ? { removeKeys: [key] } : { updates: { [key]: inputValue } },
|
|
2104
|
+
expectedCommandPackageEvidence: reviewed?.commandPackageEvidence,
|
|
2105
|
+
expectedHostPermissionEffects: reviewed?.hostPermissionEffects,
|
|
2094
2106
|
apply: rawOptions.apply === true, sharedNativeApplyConfirmed: rawOptions.yes === true,
|
|
2095
2107
|
preApplyConfirmed: rawOptions.yes === true });
|
|
2096
2108
|
return buildConfigMutationReceipt(`config:${command}`, {
|
|
@@ -2132,30 +2144,39 @@ export function buildProgram(options = {}) {
|
|
|
2132
2144
|
return;
|
|
2133
2145
|
}
|
|
2134
2146
|
const located = await resolveStoredConfigResetIdentity({ selector, context, scope: 'user' });
|
|
2135
|
-
const resetStore = async (plugin, pluginError
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2147
|
+
const resetStore = async (plugin, pluginError, awHomeMutationToken, catalogOperationContext) => {
|
|
2148
|
+
const rebuildRuntime = { ...context, awHomeMutationToken, catalogOperationContext,
|
|
2149
|
+
expectedGenerationSetDigest: catalogOperationContext?.generationSetDigest, scriptTimeoutMs: resolveScriptTimeoutMs(rawOptions) };
|
|
2150
|
+
const reviewed = plugin && rawOptions.apply ? await preparePublicConfigConfirmation({ plugin,
|
|
2151
|
+
scope: work.context, context: work.context, platform, cwd: context.cwd, env: context.env,
|
|
2152
|
+
cliVersion: resolveCliVersion(), nativeCliRunner: context.nativeCliRunner, awHomeMutationToken,
|
|
2153
|
+
yes: rawOptions.yes, mutation: { kind: 'reset' }, rebuildRuntime }) : null;
|
|
2154
|
+
const receipt = await resetPluginConfigWithHelper({ ...located, plugin, pluginError, platform, scope: work.context,
|
|
2155
|
+
context: work.context, cliVersion: resolveCliVersion(), cwd: context.cwd, env: context.env, awHomeMutationToken,
|
|
2156
|
+
nativeCliRunner: context.nativeCliRunner, apply: rawOptions.apply === true,
|
|
2157
|
+
expectedCommandPackageEvidence: reviewed?.commandPackageEvidence, expectedHostPermissionEffects: reviewed?.hostPermissionEffects, rebuildRuntime,
|
|
2158
|
+
sharedNativeApplyConfirmed: true, preApplyConfirmed: rawOptions.yes === true });
|
|
2159
|
+
return { ...receipt, confirmation: reviewed?.confirmation ?? null };
|
|
2160
|
+
};
|
|
2161
|
+
const resetReceipt = await runActionWithContext(context, () => withAwHomeMutationLock({
|
|
2162
|
+
env: context.env, signal: context.signal, action: async (token) => {
|
|
2163
|
+
let started = false;
|
|
2164
|
+
try {
|
|
2165
|
+
const operationContext = await resolveCatalogOperationContext({ sourceIds: [located.sourceId],
|
|
2166
|
+
env: context.env, signal: context.signal });
|
|
2167
|
+
return await withResolvedCatalogPlugin({ selector: located.pluginId, cliVersion: resolveCliVersion(),
|
|
2168
|
+
operationContext, env: context.env, signal: context.signal, consume: ({ plugin }) => {
|
|
2169
|
+
started = true;
|
|
2170
|
+
return resetStore(plugin, null, token, operationContext);
|
|
2171
|
+
} });
|
|
2172
|
+
}
|
|
2173
|
+
catch (error) {
|
|
2174
|
+
if (started || context.signal?.aborted || error instanceof CatalogLeaseEscapeError)
|
|
2175
|
+
throw error;
|
|
2176
|
+
return resetStore(null, error instanceof Error ? error : new Error(String(error)), token);
|
|
2177
|
+
}
|
|
2178
|
+
},
|
|
2179
|
+
}));
|
|
2159
2180
|
const receipt = buildConfigMutationReceipt('config:reset', { ...resetReceipt,
|
|
2160
2181
|
ok: resetReceipt.overallState === 'succeeded', ...located, plugin: located.pluginName,
|
|
2161
2182
|
context: work, platform: platform ?? 'common' });
|
|
@@ -2172,24 +2193,32 @@ export function buildProgram(options = {}) {
|
|
|
2172
2193
|
}
|
|
2173
2194
|
});
|
|
2174
2195
|
contextualCommand(config.command('apply').argument('<plugin>'))
|
|
2196
|
+
.addOption(strictValueOption('--platform <target>', 'apply the selected configuration profile', PLATFORM_TARGETS))
|
|
2175
2197
|
.option('--target <target>', 'limit existing-output refresh to this platform target', collectUniqueOption)
|
|
2176
2198
|
.option('-y, --yes', 'confirm reviewed output changes', false)
|
|
2177
2199
|
.option('--script-timeout <ms>', 'override plugin preApply timeout in milliseconds')
|
|
2178
2200
|
.action(async (selector, rawOptions) => {
|
|
2179
2201
|
const context = createActionContext('config:apply', rawOptions);
|
|
2180
2202
|
const work = await configContext(context, rawOptions, true);
|
|
2203
|
+
const platform = configPlatform(rawOptions);
|
|
2181
2204
|
const targets = rawOptions.target?.map((target) => normalizeWriteRequest(() => parsePlatformTargetValue(target)));
|
|
2182
2205
|
let resolved;
|
|
2183
2206
|
let confirmed;
|
|
2184
|
-
const receipt = await runActionWithContext(context, () => withResolvedConfigMutationPlugin(context, selector, async ({ plugin, pluginId, source }, awHomeMutationToken) => {
|
|
2207
|
+
const receipt = await runActionWithContext(context, () => withResolvedConfigMutationPlugin(context, selector, async ({ plugin, pluginId, source }, awHomeMutationToken, catalogOperationContext) => {
|
|
2185
2208
|
const identity = { plugin: plugin.manifest.name, pluginId, sourceId: source.sourceId };
|
|
2186
2209
|
resolved = identity;
|
|
2187
|
-
const
|
|
2188
|
-
|
|
2189
|
-
const
|
|
2210
|
+
const rebuildRuntime = { ...context, catalogOperationContext,
|
|
2211
|
+
expectedGenerationSetDigest: catalogOperationContext.generationSetDigest, scriptTimeoutMs: resolveScriptTimeoutMs(rawOptions) };
|
|
2212
|
+
const reviewed = await preparePublicConfigConfirmation({ plugin, scope: work.context, context: work.context, platform, targets,
|
|
2213
|
+
cwd: context.cwd, env: context.env, cliVersion: resolveCliVersion(), nativeCliRunner: context.nativeCliRunner,
|
|
2214
|
+
awHomeMutationToken, yes: rawOptions.yes, rebuildRuntime });
|
|
2215
|
+
confirmed = reviewed.confirmation;
|
|
2216
|
+
const applied = await applyPluginConfig({ plugin, scope: work.context, context: work.context, platform, targets,
|
|
2217
|
+
expectedEvidence: reviewed.evidence,
|
|
2218
|
+
expectedHostPermissionEffects: reviewed.hostPermissionEffects,
|
|
2190
2219
|
cliVersion: resolveCliVersion(), cwd: context.cwd, env: context.env, awHomeMutationToken,
|
|
2191
2220
|
nativeCliRunner: context.nativeCliRunner, sharedNativeApplyConfirmed: rawOptions.yes === true,
|
|
2192
|
-
preApplyConfirmed: rawOptions.yes === true, rebuildRuntime
|
|
2221
|
+
preApplyConfirmed: rawOptions.yes === true, rebuildRuntime,
|
|
2193
2222
|
}).catch((error) => {
|
|
2194
2223
|
if (!(error instanceof ConfigApplyInterruptedError))
|
|
2195
2224
|
throw error;
|
|
@@ -2197,10 +2226,15 @@ export function buildProgram(options = {}) {
|
|
|
2197
2226
|
return { configWrite: error.configWrite, overallState: 'partial',
|
|
2198
2227
|
apply: error.apply, errors: [{ code, message }] };
|
|
2199
2228
|
});
|
|
2200
|
-
return { ...applied, ...identity, confirmation, context: work };
|
|
2229
|
+
return { ...applied, ...identity, confirmation: reviewed.confirmation, context: work, platform: platform ?? 'common' };
|
|
2201
2230
|
}, { retainCompletedResultOnAbort: true })).catch((error) => {
|
|
2202
2231
|
if (error instanceof CatalogLeaseEscapeError)
|
|
2203
2232
|
throw error;
|
|
2233
|
+
const sourceError = configActiveAvailabilityError(error);
|
|
2234
|
+
if (!resolved && sourceError) {
|
|
2235
|
+
return { plugin: selector, confirmation: null, context: work, configWrite: 'notStarted',
|
|
2236
|
+
overallState: 'failed', errors: [sourceError] };
|
|
2237
|
+
}
|
|
2204
2238
|
const code = recoveryInterruptionCode(error, context.signal);
|
|
2205
2239
|
if (!code)
|
|
2206
2240
|
throw error;
|
|
@@ -2307,7 +2341,9 @@ async function runAuthoringCliAdapter(argv, options) {
|
|
|
2307
2341
|
}
|
|
2308
2342
|
function sourceConfirmation(sourceId, yes, preview) {
|
|
2309
2343
|
const required = preview !== undefined && (preview.identityChanged || !preview.references.inventoryComplete || preview.references.references.length > 0);
|
|
2310
|
-
|
|
2344
|
+
const message = preview?.identityChanged ? describeSourceCommandRebinding(sourceId)
|
|
2345
|
+
: 'Change the source used by the affected or unobserved plugin references.';
|
|
2346
|
+
return { required, provided: yes === true, effects: required ? [{ code: 'changeSource', message, subject: { sourceId }, impact: preview?.references.inventoryComplete ? 'shared' : 'unknown' }] : [] };
|
|
2311
2347
|
}
|
|
2312
2348
|
function commandId(command) {
|
|
2313
2349
|
const names = [];
|
|
@@ -2570,8 +2606,10 @@ export async function runCli(argv, options = {}) {
|
|
|
2570
2606
|
commandOptions.signal = id === 'plugin.config.apply' && options.signal
|
|
2571
2607
|
? AbortSignal.any([options.signal, interruption.signal]) : interruption.signal;
|
|
2572
2608
|
}
|
|
2573
|
-
if (id === 'command.run' && !
|
|
2574
|
-
|
|
2609
|
+
if (id === 'command.run' && !awArgs.some((arg) => arg === '--help' || arg === '-h')) {
|
|
2610
|
+
const prefix = argv.slice(0, resolvedCommand.index).filter((arg) => arg !== 'command');
|
|
2611
|
+
return runManagedCommandCli(['run', ...prefix, ...argv.slice(resolvedCommand.index + 1)], { ...context, interactive: false }, { cliEntry: fileURLToPath(import.meta.url), cliVersion: resolveCliVersion() });
|
|
2612
|
+
}
|
|
2575
2613
|
let confirmation = null;
|
|
2576
2614
|
const emit = (result, invalid = false) => {
|
|
2577
2615
|
if (result.diagnostics.some((diagnostic) => diagnostic.code === 'catalogWorkspaceMissing')) {
|
|
@@ -2764,13 +2802,15 @@ export async function runCli(argv, options = {}) {
|
|
|
2764
2802
|
export async function main(argv = process.argv.slice(2), options = {}) {
|
|
2765
2803
|
return runCli(argv, options);
|
|
2766
2804
|
}
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
if (invokedPath === currentEntryPath) {
|
|
2770
|
-
void main().then((exitCode) => {
|
|
2805
|
+
export function runExecutableCli() {
|
|
2806
|
+
void withNativeCliInterruption(() => main()).then((exitCode) => {
|
|
2771
2807
|
if (exitCode !== 0) {
|
|
2772
2808
|
process.exitCode = exitCode;
|
|
2773
2809
|
}
|
|
2774
2810
|
});
|
|
2775
2811
|
}
|
|
2812
|
+
const currentEntryPath = fileURLToPath(import.meta.url);
|
|
2813
|
+
const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : null;
|
|
2814
|
+
if (invokedPath === currentEntryPath)
|
|
2815
|
+
runExecutableCli();
|
|
2776
2816
|
//# sourceMappingURL=index.js.map
|