@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
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { InstalledCommandProducer } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
|
+
import type { PreparedManagedCommandPackage } from '../utils/managed-command-materialization.js';
|
|
3
|
+
import { type ClaudePermissions } from '../generators/permissions.js';
|
|
2
4
|
import type { CommandReporter, DebugLogger } from '../output/model.js';
|
|
3
5
|
import type { CatalogResolution, CommandProducerResult, PlatformName, PluginMeta, Scope } from '../types.js';
|
|
4
6
|
import { type CodexNativeObservationSession, type CodexNativePluginObservation } from '../utils/codex-native-observation.js';
|
|
@@ -11,10 +13,12 @@ import type { OperationAction } from './operation-plan.js';
|
|
|
11
13
|
import type { DesiredTarget, RebuildTargetDriver, RebuildTargetIdentity } from './rebuild-operations.js';
|
|
12
14
|
import { PlatformRebuildSession } from './rebuild-platform-integration.js';
|
|
13
15
|
export declare function finalizePreparedPlatformRebuildSession(results: Map<string, PluginProcessResult>): void;
|
|
16
|
+
export declare function recordPreparedGrokProjectRetirement(results: Map<string, PluginProcessResult>, ...retirement: Parameters<PlatformRebuildSession['recordGrokProjectRetirement']>): void;
|
|
14
17
|
export declare function disposePreparedPlatformRebuildSession(results: Map<string, PluginProcessResult>): Promise<void>;
|
|
15
18
|
export interface RebuildIntegration {
|
|
16
19
|
resolvePlatformTargets(inputs: readonly Parameters<RebuildIntegration['buildTarget']>[0][]): Promise<void>;
|
|
17
20
|
sealMarketplaceGenerations(targets: readonly DesiredTarget[]): Promise<void>;
|
|
21
|
+
pendingOpenCodeProjectNotices(interrupted: boolean): import('../platforms/contracts.js').Diagnostic[];
|
|
18
22
|
driver: RebuildTargetDriver;
|
|
19
23
|
setNativeMarketplaceEligibleTargets(targets: readonly DesiredTarget[]): void;
|
|
20
24
|
prepareNativeMarketplaceGroup(target: DesiredTarget): Promise<void>;
|
|
@@ -32,6 +36,7 @@ export interface RebuildIntegration {
|
|
|
32
36
|
cwd: string;
|
|
33
37
|
command: 'install' | 'sync' | 'reinstall' | 'cleanup' | 'uninstall';
|
|
34
38
|
catalog: CatalogResolution;
|
|
39
|
+
commandRecord?: InstalledCommandProducer | null;
|
|
35
40
|
readOnlyInspectionPlan?: boolean;
|
|
36
41
|
/** Fresh read window for peers undergoing the same placement check or plan verification. */
|
|
37
42
|
observationBatch?: import('../platforms/inspection-query.js').NativeObservationBatch;
|
|
@@ -53,11 +58,16 @@ export declare class CodexActivationPostcheckError extends Error {
|
|
|
53
58
|
constructor(codexPluginIds: string | readonly string[], detail: string);
|
|
54
59
|
}
|
|
55
60
|
export interface RebuildExecutionContext {
|
|
61
|
+
removeHostPermissions?: (locator: import('../platforms/permission-ownership.js').PermissionLocator) => Promise<void>;
|
|
62
|
+
invocationCwd?: string;
|
|
56
63
|
recoveryCandidates?: readonly import('../platforms/contracts.js').RecoveryCandidate[];
|
|
57
64
|
sharedReferenceView?: import('../utils/native-demand.js').NativeSharedReferenceView;
|
|
58
65
|
platformRebuildSession?: PlatformRebuildSession;
|
|
59
66
|
/** Concurrent native groups share a session across scopes of the same platform. */
|
|
60
67
|
batchInstallPlatform?: PlatformName;
|
|
68
|
+
configApply?: boolean;
|
|
69
|
+
retainCommandPackages?: boolean;
|
|
70
|
+
commandPackagePlatforms?: ReadonlyMap<string, readonly PlatformName[]>;
|
|
61
71
|
packagePreparationCache?: Map<string, Promise<PreparedManagedCommandPackage>>;
|
|
62
72
|
interruption?: import('./public-interruption.js').PublicCommandInterruption;
|
|
63
73
|
/** Validated renderer process output shared only by preparations of this operation. */
|
|
@@ -85,7 +95,6 @@ export interface RebuildExecutionContext {
|
|
|
85
95
|
scope: Scope;
|
|
86
96
|
}[];
|
|
87
97
|
commandResults?: CommandProducerResult[];
|
|
88
|
-
managedCommandCandidates?: Map<string, ManagedCommandCandidate[]>;
|
|
89
98
|
}
|
|
90
99
|
export declare function executeCodexReconcileActivations(options: {
|
|
91
100
|
plans: readonly CodexReconcilePlan[];
|
|
@@ -179,7 +188,7 @@ export declare function inspectNativeMarketplaceRegistrations(options: {
|
|
|
179
188
|
cwd: string;
|
|
180
189
|
env: NodeJS.ProcessEnv;
|
|
181
190
|
}): Promise<Record<'codex' | 'claude', 'absent' | 'canonical' | 'foreign'>>;
|
|
182
|
-
export declare function applyPlannedOperationAction(action: OperationAction): Promise<
|
|
191
|
+
export declare function applyPlannedOperationAction(action: OperationAction): Promise<ClaudePermissions>;
|
|
183
192
|
export declare function isNativeActivationOnlyTarget(context: Pick<RebuildExecutionContext, 'nativeActivationOnlyTargets'>, identity: Pick<RebuildTargetIdentity, 'pluginId' | 'platform' | 'scope'>): boolean;
|
|
184
193
|
export declare function createRebuildIntegration(options: {
|
|
185
194
|
context: RebuildExecutionContext;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { captureNativeToolChanges } from '../utils/native-tool-review.js';
|
|
4
3
|
import { catalogFileMode } from '@lesliechan721/aw-plugin-core';
|
|
5
|
-
import { getCommandPackageId } from '@lesliechan721/aw-plugin-core/manifest';
|
|
6
4
|
import fs from 'fs-extra';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { assertManagedCommandBindingIdentities, listManagedCommands, managedCommandDiagnostic, ManagedCommandError, revokeManagedCommandBindings, syncManagedCommandPackage } from '../utils/managed-command-store.js';
|
|
5
|
+
import { ManagedCommandError } from '../utils/managed-command-store.js';
|
|
6
|
+
import { prepareLifecycleCommandPackage, publishLifecycleCommandPackages, retainedManagedCommandPackageResult } from './lifecycle-command-package.js';
|
|
10
7
|
import { readClaudeSettings, writeClaudeSettings } from '../adapters/helpers.js';
|
|
11
8
|
import { buildGeneratedName } from '../generators/shared.js';
|
|
12
9
|
import { readCatalogSourcesConfigSnapshot } from '../utils/catalog-sources.js';
|
|
@@ -25,16 +22,21 @@ import { runPreApplyScript } from '../utils/plugin-scripts.js';
|
|
|
25
22
|
import { assertCanonicalProjectManagedRoots } from '../utils/project-boundary.js';
|
|
26
23
|
import { attachSafeOperationError, readSafeOperationError } from '../utils/safe-operation-diagnostic.js';
|
|
27
24
|
import { createProjectLocationKey, resolveRequiredCanonicalRepoRoot, resolveClaudeProjectKey, resolveCodexProjectKey } from '../utils/state-paths.js';
|
|
25
|
+
import { hasPermissionOwner, updateHostPermissions } from '../platforms/permission-ownership.js';
|
|
28
26
|
import { platformOwnership, PlatformRebuildSession } from './rebuild-platform-integration.js';
|
|
29
27
|
const MARKETPLACE_NAME = 'aw';
|
|
30
28
|
const LEGACY_MCP_OWNER_ENV = 'AW_AGENT_WORKFLOWS_OWNER';
|
|
31
|
-
const commandPackagePreparationCaches = new WeakMap();
|
|
32
29
|
const platformRebuildSessions = new WeakMap();
|
|
33
30
|
const commandPackageCandidates = new WeakMap();
|
|
34
31
|
export function finalizePreparedPlatformRebuildSession(results) {
|
|
35
32
|
for (const session of platformRebuildSessions.get(results)?.values() ?? [])
|
|
36
33
|
session.freezeMarketplaceCandidates();
|
|
37
34
|
}
|
|
35
|
+
export function recordPreparedGrokProjectRetirement(results, ...retirement) {
|
|
36
|
+
const sessions = platformRebuildSessions.get(results);
|
|
37
|
+
sessions?.get('grok')?.recordGrokProjectRetirement(...retirement);
|
|
38
|
+
sessions?.get(undefined)?.recordGrokProjectRetirement(...retirement);
|
|
39
|
+
}
|
|
38
40
|
export async function disposePreparedPlatformRebuildSession(results) {
|
|
39
41
|
const sessions = platformRebuildSessions.get(results);
|
|
40
42
|
platformRebuildSessions.delete(results);
|
|
@@ -51,65 +53,6 @@ export async function disposePreparedPlatformRebuildSession(results) {
|
|
|
51
53
|
}));
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
async function commandPackageActions(options) {
|
|
55
|
-
const actions = [];
|
|
56
|
-
const candidates = [];
|
|
57
|
-
const packageCache = options.context.packagePreparationCache ??= new Map();
|
|
58
|
-
let cache = commandPackagePreparationCaches.get(options.context);
|
|
59
|
-
if (!cache) {
|
|
60
|
-
cache = new Map();
|
|
61
|
-
commandPackagePreparationCaches.set(options.context, cache);
|
|
62
|
-
}
|
|
63
|
-
for (const declaration of options.plugin.manifest.managedCommands?.packages ?? []) {
|
|
64
|
-
if (!declaration.platforms.includes(options.platform) || options.scope === 'user' && declaration.scope === 'project')
|
|
65
|
-
continue;
|
|
66
|
-
const producer = await managedCommandProducerIdentity({ ...options, scope: declaration.scope,
|
|
67
|
-
producer: { kind: 'package', packageKey: declaration.key } });
|
|
68
|
-
const key = getCommandPackageId(producer);
|
|
69
|
-
let preparation = cache.get(key);
|
|
70
|
-
if (!preparation) {
|
|
71
|
-
preparation = (async () => {
|
|
72
|
-
let candidate = packageCache.get(key);
|
|
73
|
-
if (!candidate) {
|
|
74
|
-
candidate = prepareManagedCommandPackage({ ...options, referencePlugins: options.context.referencePlugins,
|
|
75
|
-
packageKey: declaration.key, scope: declaration.scope, signal: options.context.signal,
|
|
76
|
-
scriptTimeoutMs: options.context.scriptTimeoutMs });
|
|
77
|
-
packageCache.set(key, candidate);
|
|
78
|
-
}
|
|
79
|
-
const prepared = await candidate;
|
|
80
|
-
const files = [];
|
|
81
|
-
async function visit(directory, prefix) {
|
|
82
|
-
for (const entry of await fs.readdir(directory, { withFileTypes: true })) {
|
|
83
|
-
const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
84
|
-
const absolute = path.join(directory, entry.name);
|
|
85
|
-
if (entry.isDirectory()) {
|
|
86
|
-
await visit(absolute, relativePath);
|
|
87
|
-
}
|
|
88
|
-
else if (entry.isFile()) {
|
|
89
|
-
const content = await fs.readFile(absolute);
|
|
90
|
-
files.push({ relativePath, contentBase64: content.toString('base64'),
|
|
91
|
-
contentDigest: `sha256:${crypto.createHash('sha256').update(content).digest('hex')}`,
|
|
92
|
-
mode: (await fs.stat(absolute)).mode & 0o777 });
|
|
93
|
-
}
|
|
94
|
-
else
|
|
95
|
-
throw new ManagedCommandError('commandResourceInvalid', 'The prepared package contains an unsafe resource.');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
await visit(prepared.resourceRoot, '');
|
|
99
|
-
files.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
|
|
100
|
-
return { action: { kind: 'syncManagedCommandPackage', pluginId: pluginActionId(options.plugin),
|
|
101
|
-
scope: declaration.scope, producer: prepared.producer, sets: prepared.sets, nativeTools: prepared.nativeTools,
|
|
102
|
-
files, contentDigest: `sha256:${crypto.createHash('sha256').update(JSON.stringify(files)).digest('hex')}` },
|
|
103
|
-
candidate: { producer: prepared.producer, sets: prepared.sets, nativeTools: prepared.nativeTools } };
|
|
104
|
-
})();
|
|
105
|
-
cache.set(key, preparation);
|
|
106
|
-
}
|
|
107
|
-
const prepared = await preparation;
|
|
108
|
-
actions.push(prepared.action);
|
|
109
|
-
candidates.push(prepared.candidate);
|
|
110
|
-
}
|
|
111
|
-
return { actions, candidates };
|
|
112
|
-
}
|
|
113
56
|
export class CodexActivationPostcheckError extends Error {
|
|
114
57
|
code = 'codexActivationPostcheckFailed';
|
|
115
58
|
codexPluginIds;
|
|
@@ -1022,77 +965,17 @@ export async function applyPlannedOperationAction(action) {
|
|
|
1022
965
|
throw new Error('platformContributionUnsupported: expected a Claude permissions contribution.');
|
|
1023
966
|
}
|
|
1024
967
|
const settings = await readClaudeSettings(action.locator.settingsPath);
|
|
968
|
+
const before = settings.permissions;
|
|
1025
969
|
rebuildClaudePermissions(settings, action.locator.ownerKey, action.mutation.permissions);
|
|
1026
970
|
await writeClaudeSettings(action.locator.settingsPath, settings);
|
|
971
|
+
return {
|
|
972
|
+
allow: (settings.permissions?.allow ?? []).filter((rule) => !before?.allow?.includes(rule)),
|
|
973
|
+
ask: (settings.permissions?.ask ?? []).filter((rule) => !before?.ask?.includes(rule)),
|
|
974
|
+
deny: (settings.permissions?.deny ?? []).filter((rule) => !before?.deny?.includes(rule)),
|
|
975
|
+
};
|
|
1027
976
|
}
|
|
1028
977
|
function createNativeDriver(options) {
|
|
1029
978
|
const runner = options.context.nativeCliRunner;
|
|
1030
|
-
const revokeAtRoot = async (root, recursive = false, platform) => {
|
|
1031
|
-
const listed = await listManagedCommands(options.context.env);
|
|
1032
|
-
const producers = new Map();
|
|
1033
|
-
for (const command of listed.commands) {
|
|
1034
|
-
if (command.owner.kind !== 'plugin' || !command.resourceRoot)
|
|
1035
|
-
continue;
|
|
1036
|
-
if (platform && command.owner.producer.platform !== platform)
|
|
1037
|
-
continue;
|
|
1038
|
-
const relative = path.relative(path.resolve(root), path.resolve(command.resourceRoot));
|
|
1039
|
-
if (relative !== '' && (!recursive || relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)))
|
|
1040
|
-
continue;
|
|
1041
|
-
producers.set(getCommandPackageId(command.owner.producer), command.owner.producer);
|
|
1042
|
-
}
|
|
1043
|
-
for (const producer of producers.values()) {
|
|
1044
|
-
const removedCommandIds = await revokeManagedCommandBindings(producer, options.context.env);
|
|
1045
|
-
options.context.commandResults ??= [];
|
|
1046
|
-
options.context.commandResults.push({ producer, state: 'completed', commandIds: [], removedCommandIds, errors: [], recoveryActions: [] });
|
|
1047
|
-
}
|
|
1048
|
-
};
|
|
1049
|
-
const publishPackages = async (target) => {
|
|
1050
|
-
const cache = options.context.managedCommandProducerCache ??= new Map();
|
|
1051
|
-
for (const action of target.operationActions ?? []) {
|
|
1052
|
-
if (action.kind !== 'syncManagedCommandPackage')
|
|
1053
|
-
continue;
|
|
1054
|
-
const key = getCommandPackageId(action.producer);
|
|
1055
|
-
let publication = cache.get(key);
|
|
1056
|
-
if (!publication) {
|
|
1057
|
-
publication = (async () => {
|
|
1058
|
-
await options.context.reporter.event({ type: 'managed-command:producer', source: { plugin: action.producer.pluginName, scope: action.producer.scope }, data: { packageKey: action.producer.key, phase: 'start' } });
|
|
1059
|
-
const temporary = await fs.mkdtemp(path.join(os.tmpdir(), 'aw-command-publish-'));
|
|
1060
|
-
try {
|
|
1061
|
-
const digest = `sha256:${crypto.createHash('sha256').update(JSON.stringify(action.files)).digest('hex')}`;
|
|
1062
|
-
if (digest !== action.contentDigest)
|
|
1063
|
-
throw new ManagedCommandError('commandResourceInvalid', 'The prepared command package digest changed.');
|
|
1064
|
-
const resourceRoot = path.join(temporary, 'resource');
|
|
1065
|
-
await fs.ensureDir(resourceRoot);
|
|
1066
|
-
for (const file of action.files) {
|
|
1067
|
-
const content = Buffer.from(file.contentBase64, 'base64');
|
|
1068
|
-
if (`sha256:${crypto.createHash('sha256').update(content).digest('hex')}` !== file.contentDigest)
|
|
1069
|
-
throw new ManagedCommandError('commandResourceInvalid', 'The prepared command package file digest changed.');
|
|
1070
|
-
const destination = path.join(resourceRoot, ...file.relativePath.split('/'));
|
|
1071
|
-
await fs.outputFile(destination, content);
|
|
1072
|
-
await fs.chmod(destination, file.mode);
|
|
1073
|
-
}
|
|
1074
|
-
const result = await syncManagedCommandPackage({ producer: action.producer, sourceDirectory: resourceRoot, sets: action.sets, nativeTools: action.nativeTools, env: options.context.env });
|
|
1075
|
-
await options.context.reporter.event({ type: 'managed-command:producer', source: { plugin: action.producer.pluginName, scope: action.producer.scope }, data: { packageKey: action.producer.key, phase: 'success' } });
|
|
1076
|
-
return { producer: action.producer, state: 'completed', commandIds: result.commandIds, removedCommandIds: result.removedCommandIds, errors: [], recoveryActions: [] };
|
|
1077
|
-
}
|
|
1078
|
-
catch (error) {
|
|
1079
|
-
await options.context.reporter.event({ type: 'managed-command:producer', source: { plugin: action.producer.pluginName, scope: action.producer.scope }, data: { packageKey: action.producer.key, phase: 'failure' } });
|
|
1080
|
-
return { producer: action.producer, state: 'failed', commandIds: [], removedCommandIds: [], errors: [managedCommandDiagnostic(error)], recoveryActions: [`aw command package sync ${action.producer.sourceId}/${action.producer.pluginName} ${action.producer.key} --scope ${action.producer.scope} --yes`] };
|
|
1081
|
-
}
|
|
1082
|
-
finally {
|
|
1083
|
-
await fs.remove(temporary);
|
|
1084
|
-
}
|
|
1085
|
-
})();
|
|
1086
|
-
cache.set(key, publication);
|
|
1087
|
-
}
|
|
1088
|
-
const result = await publication;
|
|
1089
|
-
options.context.commandResults ??= [];
|
|
1090
|
-
if (!options.context.commandResults.some((entry) => getCommandPackageId(entry.producer) === key))
|
|
1091
|
-
options.context.commandResults.push(result);
|
|
1092
|
-
if (result.state !== 'completed')
|
|
1093
|
-
throw new Error('commandPackagePublishFailed: sync the command package and retry the plugin operation.');
|
|
1094
|
-
}
|
|
1095
|
-
};
|
|
1096
979
|
const currentCodexManager = () => options.context.codexManager;
|
|
1097
980
|
const codexNativeStates = new Map();
|
|
1098
981
|
const pendingCodexNativeStates = new Map();
|
|
@@ -1259,6 +1142,8 @@ function createNativeDriver(options) {
|
|
|
1259
1142
|
inspectShared: async (component) => {
|
|
1260
1143
|
const locator = component.locator;
|
|
1261
1144
|
switch (locator.kind) {
|
|
1145
|
+
case 'host-permissions':
|
|
1146
|
+
return await hasPermissionOwner(options.context.env, locator) ? 'present' : 'absent';
|
|
1262
1147
|
case 'cursor-workspace-hook':
|
|
1263
1148
|
return platformOwnership.inspectShared(component);
|
|
1264
1149
|
case 'claude-permissions':
|
|
@@ -1311,6 +1196,11 @@ function createNativeDriver(options) {
|
|
|
1311
1196
|
removeShared: async (component) => {
|
|
1312
1197
|
const locator = component.locator;
|
|
1313
1198
|
switch (locator.kind) {
|
|
1199
|
+
case 'host-permissions':
|
|
1200
|
+
if (options.context.removeHostPermissions)
|
|
1201
|
+
return options.context.removeHostPermissions(locator);
|
|
1202
|
+
await updateHostPermissions({ env: options.context.env, cwd: locator.projectRoot ?? locator.hostConfigRoot, invocationCwd: options.context.invocationCwd }, locator);
|
|
1203
|
+
return;
|
|
1314
1204
|
case 'cursor-workspace-hook':
|
|
1315
1205
|
return platformOwnership.removeShared(component);
|
|
1316
1206
|
case 'claude-permissions': {
|
|
@@ -1434,10 +1324,6 @@ function createNativeDriver(options) {
|
|
|
1434
1324
|
};
|
|
1435
1325
|
return {
|
|
1436
1326
|
ownership,
|
|
1437
|
-
beforeCleanupMutation: async (component) => {
|
|
1438
|
-
if (component.kind === 'skill-directory')
|
|
1439
|
-
await revokeAtRoot(component.path);
|
|
1440
|
-
},
|
|
1441
1327
|
setNativeMarketplaceEligibleTargets: (eligibleTargets) => {
|
|
1442
1328
|
nativeMarketplaceEligibleTargets = new Set(eligibleTargets);
|
|
1443
1329
|
},
|
|
@@ -1518,10 +1404,6 @@ function createNativeDriver(options) {
|
|
|
1518
1404
|
? 'both'
|
|
1519
1405
|
: 'user'))));
|
|
1520
1406
|
},
|
|
1521
|
-
preflightMutation: async (target) => {
|
|
1522
|
-
await assertManagedCommandBindingIdentities({ producers: (target.operationActions ?? []).flatMap((action) => action.kind === 'syncManagedCommandPackage' ? [{ producer: action.producer, sets: action.sets, nativeTools: action.nativeTools }] : []),
|
|
1523
|
-
env: options.context.env });
|
|
1524
|
-
},
|
|
1525
1407
|
preflightMaterialize: async (target) => {
|
|
1526
1408
|
if (target.identity.sourceId && options.context.expectedCatalogConfigDigest) {
|
|
1527
1409
|
const current = await readCatalogSourcesConfigSnapshot(options.context.env);
|
|
@@ -1539,7 +1421,7 @@ function createNativeDriver(options) {
|
|
|
1539
1421
|
if (action.kind !== 'retainManagedCommandPackage')
|
|
1540
1422
|
continue;
|
|
1541
1423
|
options.context.commandResults ??= [];
|
|
1542
|
-
if (!options.context.commandResults.some((result) =>
|
|
1424
|
+
if (!options.context.commandResults.some((result) => result.packageId === action.packageId))
|
|
1543
1425
|
options.context.commandResults.push(retainedManagedCommandPackageResult(action));
|
|
1544
1426
|
}
|
|
1545
1427
|
},
|
|
@@ -1632,10 +1514,8 @@ function createNativeDriver(options) {
|
|
|
1632
1514
|
throw new Error('codexNativeObservationUnavailable: native group precheck is missing.');
|
|
1633
1515
|
}
|
|
1634
1516
|
const removalRequired = before === 'present';
|
|
1635
|
-
if (!removalRequired)
|
|
1636
|
-
await revokeAtRoot(path.join(target.identity.marketplaceRoot ?? resolveAwHome(options.context.env), 'plugins', target.identity.pluginName), true, 'codex');
|
|
1517
|
+
if (!removalRequired)
|
|
1637
1518
|
return;
|
|
1638
|
-
}
|
|
1639
1519
|
try {
|
|
1640
1520
|
codexMutationMarketplaces.add(marketplaceName);
|
|
1641
1521
|
await runObservedCodexMutation({
|
|
@@ -1672,8 +1552,6 @@ function createNativeDriver(options) {
|
|
|
1672
1552
|
? `codexNativeRemoveIncomplete: ${CODEX_REMOVE_RECOVERY}`
|
|
1673
1553
|
: `codexNativeInstallIncomplete: ${component.pluginId} is absent from Codex plugin list.`);
|
|
1674
1554
|
}
|
|
1675
|
-
if (expected === 'absent')
|
|
1676
|
-
await revokeAtRoot(path.join(target.identity.marketplaceRoot ?? resolveAwHome(options.context.env), 'plugins', target.identity.pluginName), true, 'codex');
|
|
1677
1555
|
};
|
|
1678
1556
|
if (options.operationScopedNativePhases) {
|
|
1679
1557
|
deferredPostchecks.push({ target, postcheck });
|
|
@@ -1708,7 +1586,7 @@ function createNativeDriver(options) {
|
|
|
1708
1586
|
}
|
|
1709
1587
|
}
|
|
1710
1588
|
},
|
|
1711
|
-
applyManagedCommands:
|
|
1589
|
+
applyManagedCommands: (target) => publishLifecycleCommandPackages(target, options.context),
|
|
1712
1590
|
writeNative: async () => { throw new Error('platformDeploymentRequired: native writes require a frozen platform deployment.'); },
|
|
1713
1591
|
writeArtifacts: async (target) => {
|
|
1714
1592
|
if (target.artifacts.length > 0)
|
|
@@ -1785,39 +1663,49 @@ export function createRebuildIntegration(options) {
|
|
|
1785
1663
|
options.context.platformRebuildSession = platformSession;
|
|
1786
1664
|
platformSession.updateContext(options.context);
|
|
1787
1665
|
platformSession.setOwnershipExecutor(driver.ownership);
|
|
1666
|
+
const targetPlatforms = new Map();
|
|
1788
1667
|
return {
|
|
1789
|
-
resolvePlatformTargets: (inputs) =>
|
|
1668
|
+
resolvePlatformTargets: async (inputs) => {
|
|
1669
|
+
await platformSession.resolveAll(inputs);
|
|
1670
|
+
for (const input of inputs) {
|
|
1671
|
+
const id = input.pluginId ?? pluginActionId(input.plugin);
|
|
1672
|
+
const platforms = targetPlatforms.get(id) ?? [];
|
|
1673
|
+
if (!platforms.includes(input.platform))
|
|
1674
|
+
platforms.push(input.platform);
|
|
1675
|
+
targetPlatforms.set(id, platforms);
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1790
1678
|
sealMarketplaceGenerations: (eligible) => platformSession.sealMarketplaceGenerations(eligible),
|
|
1679
|
+
pendingOpenCodeProjectNotices: (interrupted) => platformSession.pendingOpenCodeProjectNotices(interrupted),
|
|
1791
1680
|
driver,
|
|
1792
1681
|
setNativeMarketplaceEligibleTargets: driver.setNativeMarketplaceEligibleTargets,
|
|
1793
1682
|
prepareNativeMarketplaceGroup: driver.prepareNativeMarketplaceGroup,
|
|
1794
1683
|
postcheckCodexProvider: driver.postcheckCodexProvider,
|
|
1795
1684
|
captureCodexPostMutationSnapshots: driver.captureCodexPostMutationSnapshots,
|
|
1796
1685
|
buildTarget: async (input) => {
|
|
1797
|
-
const
|
|
1686
|
+
const removed = input.command === 'cleanup' || input.command === 'uninstall';
|
|
1687
|
+
const id = input.pluginId ?? pluginActionId(input.plugin);
|
|
1688
|
+
const platforms = options.context.commandPackagePlatforms?.get(id) ?? targetPlatforms.get(id) ?? [input.platform];
|
|
1689
|
+
let commands;
|
|
1798
1690
|
if (!input.readOnlyInspectionPlan) {
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1691
|
+
try {
|
|
1692
|
+
commands = await prepareLifecycleCommandPackage({ ...input, removing: removed, platforms, context: options.context });
|
|
1693
|
+
}
|
|
1694
|
+
catch (error) {
|
|
1695
|
+
if (error instanceof ManagedCommandError)
|
|
1696
|
+
throw new Error(`${error.code}: ${error.message}`, { cause: error });
|
|
1697
|
+
throw error;
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
const target = await platformSession.buildTarget({ ...input, commandRecord: commands?.record });
|
|
1701
|
+
if (commands) {
|
|
1702
|
+
const operationActions = commands.actions;
|
|
1811
1703
|
const preApply = input.plugin.manifest.scripts?.preApply;
|
|
1812
1704
|
if (preApply && !removed && !isNativeActivationOnlyTarget(options.context, target.identity))
|
|
1813
1705
|
operationActions.push({ kind: 'runPreApply',
|
|
1814
1706
|
pluginId: input.pluginId ?? pluginActionId(input.plugin), platform: input.platform, scope: input.scope,
|
|
1815
1707
|
script: preApply.path, scriptDigest: `sha256:${crypto.createHash('sha256')
|
|
1816
1708
|
.update(await fs.readFile(path.resolve(input.plugin.rootDir, preApply.path.replace(/^\.\//u, '')))).digest('hex')}` });
|
|
1817
|
-
const nativeToolChanges = await captureNativeToolChanges({ actions: operationActions,
|
|
1818
|
-
producers: commands.candidates.map((candidate) => candidate.producer), removed, env: options.context.env });
|
|
1819
|
-
if (nativeToolChanges.length)
|
|
1820
|
-
operationActions[0].nativeToolChanges = nativeToolChanges;
|
|
1821
1709
|
target.operationActions = operationActions;
|
|
1822
1710
|
}
|
|
1823
1711
|
targets.push(target);
|