@lesliechan721/aw 0.1.0-beta.85 → 0.1.0-beta.87
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/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 +4 -4
- package/dist/src/commands/public-lifecycle-result.js +55 -14
- 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/rebuild-command.d.ts +4 -0
- package/dist/src/commands/rebuild-command.js +160 -101
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +17 -6
- package/dist/src/commands/rebuild-integration.js +76 -183
- 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 +2 -0
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +5 -3
- package/dist/src/commands/rebuild-platform-integration.js +166 -135
- 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 +14 -6
- package/dist/src/generators/permissions.js +59 -61
- package/dist/src/generators/permissions.js.map +1 -1
- package/dist/src/index.js +77 -40
- package/dist/src/index.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 +7 -0
- package/dist/src/output/component-delivery.js +59 -3
- package/dist/src/output/component-delivery.js.map +1 -1
- package/dist/src/output/public-result.d.ts +15 -0
- package/dist/src/output/public-result.js +75 -12
- 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 +39 -27
- package/dist/src/output/receipt-projection.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/contracts.d.ts +10 -1
- package/dist/src/platforms/discovery.d.ts +2 -0
- 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 +47 -5
- package/dist/src/platforms/inspection-grok.js.map +1 -1
- package/dist/src/platforms/layout.d.ts +8 -0
- package/dist/src/platforms/layout.js +53 -8
- package/dist/src/platforms/layout.js.map +1 -1
- package/dist/src/platforms/lifecycle.js +39 -17
- 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.js +58 -8
- package/dist/src/platforms/projection.js.map +1 -1
- package/dist/src/recovery/coordinator.d.ts +2 -0
- package/dist/src/recovery/coordinator.js +24 -27
- package/dist/src/recovery/coordinator.js.map +1 -1
- package/dist/src/recovery/joint-coordinator.js +103 -47
- package/dist/src/recovery/joint-coordinator.js.map +1 -1
- package/dist/src/recovery/joint-demand.js +1 -1
- 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/retirement.js +11 -17
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.js +32 -2
- 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/review-selection.js +12 -5
- package/dist/src/review/review-selection.js.map +1 -1
- package/dist/src/review/skill-materialization.d.ts +1 -1
- package/dist/src/review/skill-materialization.js +3 -7
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +37 -30
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +71 -6
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +4 -1
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/deployment-view.d.ts +1 -1
- package/dist/src/tui/deployment-view.js +16 -3
- package/dist/src/tui/deployment-view.js.map +1 -1
- package/dist/src/tui/diagnostic-projection.js +11 -6
- package/dist/src/tui/diagnostic-projection.js.map +1 -1
- package/dist/src/tui/entity-cards.js +1 -1
- package/dist/src/tui/entity-cards.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/types.d.ts +8 -20
- 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 +11 -77
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +0 -59
- package/dist/src/utils/artifact-renderer.js +2 -49
- 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 +10 -0
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/component-command-preparation.d.ts +6 -11
- package/dist/src/utils/component-command-preparation.js +109 -228
- package/dist/src/utils/component-command-preparation.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-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 +7 -0
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +2 -1
- package/dist/src/utils/platform-empty-state.js +13 -12
- 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 +194 -772
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/rendered-contract.js +12 -6
- package/dist/src/utils/rendered-contract.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,5 +1,6 @@
|
|
|
1
|
-
import { getCommandPackageId } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
1
|
import { finalizePreparedPlatformRebuildSession, recordPreparedGrokProjectRetirement } from '../commands/rebuild-integration.js';
|
|
2
|
+
import { commandPackageProviderSatisfied, preparePortableCommandWithdrawal, publishLifecycleCommandPackage } from '../commands/lifecycle-command-package.js';
|
|
3
|
+
import { operationPlanNativeToolChanges } from '../commands/operation-plan.js';
|
|
3
4
|
import { addRequirements } from '../commands/intent-command.js';
|
|
4
5
|
import { createEmptyIntent, calculateIntentDigest, removeIntentRoot } from '../intent/intent-codec.js';
|
|
5
6
|
import { observeIntent, writeIntent, resolveIntentPath } from '../intent/intent-store.js';
|
|
@@ -162,6 +163,9 @@ function mergeReceipts(plan, receipts) {
|
|
|
162
163
|
receipt.outputsMayHaveChanged = receipts.some((item) => item.outputsMayHaveChanged);
|
|
163
164
|
receipt.commandResults = receipts.flatMap((item) => item.commandResults ?? []);
|
|
164
165
|
receipt.nativeToolChanges = receipts.flatMap((item) => item.nativeToolChanges ?? []);
|
|
166
|
+
if (plan.portableCommandWithdrawals?.length) {
|
|
167
|
+
receipt.nativeToolChanges = operationPlanNativeToolChanges({ actions: plan.portableCommandWithdrawals, nativeToolChanges: receipt.nativeToolChanges });
|
|
168
|
+
}
|
|
165
169
|
receipt.recoveryActions = [...new Set(actions)];
|
|
166
170
|
receipt.ok = receipt.blockers.length === 0 && receipts.every((item) => item.ok);
|
|
167
171
|
return receipt;
|
|
@@ -231,7 +235,7 @@ async function readJointPreparation(command, options, locked = false, suppliedRe
|
|
|
231
235
|
/** Complete requirements determine placement before execution selectors are applied. */
|
|
232
236
|
export async function prepareJointRecovery(command, selectors, options, runtime, preparation) {
|
|
233
237
|
const originalRunner = runtime.nativeCliRunner ?? getDefaultNativeCliRunner();
|
|
234
|
-
runtime = { ...runtime, ...(isInstallBatch(command) ? { nativeCliRunner: limitInstallNativeRunner(originalRunner) } : {}),
|
|
238
|
+
runtime = { ...runtime, invocationCwd: runtime.invocationCwd ?? options.cwd, ...(isInstallBatch(command) ? { nativeCliRunner: limitInstallNativeRunner(originalRunner) } : {}),
|
|
235
239
|
preparedArtifactRenderResults: runtime.preparedArtifactRenderResults ?? new Map() };
|
|
236
240
|
const { snapshot, catalogReadScope, manifestReads } = preparation ?? await readJointPreparation(command, options, false, runtime.catalogReadScope);
|
|
237
241
|
const prepare = async (current) => {
|
|
@@ -700,37 +704,50 @@ async function prepareJointRecoveryInSession(command, selectors, { checkInstallC
|
|
|
700
704
|
const batch = isInstallBatch(command);
|
|
701
705
|
const hasSelectedScripts = selected.some((item) => item.plugin.manifest.scripts?.preApply);
|
|
702
706
|
if (batch && nativeObservationBatch && [...demand.placements, ...selected].every(({ plugin }) => {
|
|
703
|
-
const scripts = plugin.manifest
|
|
704
|
-
return !scripts?.artifacts?.render && !scripts?.preApply && !scripts?.node?.build;
|
|
707
|
+
const { command, scripts } = plugin.manifest;
|
|
708
|
+
return command?.mode !== 'dynamic' && !scripts?.artifacts?.render && !scripts?.preApply && !scripts?.node?.build;
|
|
705
709
|
}))
|
|
706
710
|
nativeObservationBatch.scriptFreePlacement = true;
|
|
707
711
|
const portableGenerations = new Map();
|
|
708
712
|
const targetGroups = batch ? [...nativeTargets, ...targets.filter((target) => target === 'generic')].map((target) => [target])
|
|
709
713
|
: [...(nativeTargets.length ? [nativeTargets] : []), ...targets.filter((target) => target === 'generic').map((target) => [target])];
|
|
714
|
+
const inheritedScripts = command === 'sync' && !options.existingOnly ? new Set(selected.filter((item) => {
|
|
715
|
+
if (item.scope !== 'user' || !item.plugin.manifest.scripts?.preApply)
|
|
716
|
+
return false;
|
|
717
|
+
const contributions = selectedContributions.get(item);
|
|
718
|
+
return !contributions.some((entry) => entry.scope === 'user')
|
|
719
|
+
&& contributions.some((entry) => entry.scope === 'project' && entry.root !== item.pluginId)
|
|
720
|
+
&& !(requestedIds.has(item.pluginId) && (!options.exactTargets || options.exactTargets.some((exact) => exact.pluginId === item.pluginId && exact.agent === item.target && contributions.some((entry) => entry.scope === exact.scope))));
|
|
721
|
+
})) : new Set();
|
|
722
|
+
const preparedPlacements = selected.filter((item) => !(item.scope === 'user' && !canReuseProviderAcrossScopes(item.target)
|
|
723
|
+
&& selectedContributions.get(item)?.every((entry) => entry.scope === 'project')
|
|
724
|
+
&& currentStatus.observedTargets?.some((actual) => actual.pluginId === item.pluginId
|
|
725
|
+
&& actual.agent === item.target && isInstalledSkillProvider(actual)))
|
|
726
|
+
&& !(command === 'install' && scope === 'project' && item.scope === 'user'
|
|
727
|
+
&& currentStatus.observedTargets?.some((observed) => observed.pluginId === item.pluginId
|
|
728
|
+
&& observed.agent === item.target && observed.scope === 'user' && observed.content === 'satisfied'))
|
|
729
|
+
&& !(hasSharedUserPackage(item.target) && inheritedScripts.has(item)
|
|
730
|
+
&& currentStatus.observedTargets?.some((observed) => observed.pluginId === item.pluginId
|
|
731
|
+
&& observed.agent === item.target && observed.scope === 'user' && observed.providerScope === 'user'
|
|
732
|
+
&& observed.observation === 'verified' && observed.content === 'satisfied' && !observed.blockers.length)));
|
|
733
|
+
// Split provider and host groups must publish the same shared revision.
|
|
734
|
+
const commandPackagePlatforms = new Map();
|
|
735
|
+
for (const { pluginId, plugin, target, scope } of preparedPlacements) {
|
|
736
|
+
if (target === 'generic' || !plugin.manifest.command?.platforms.includes(target)
|
|
737
|
+
|| activationOnlyTargets.some((entry) => entry.pluginId === pluginId && entry.platform === target && entry.scope === scope))
|
|
738
|
+
continue;
|
|
739
|
+
const platforms = commandPackagePlatforms.get(pluginId) ?? [];
|
|
740
|
+
if (!platforms.includes(target))
|
|
741
|
+
platforms.push(target);
|
|
742
|
+
commandPackagePlatforms.set(pluginId, platforms);
|
|
743
|
+
}
|
|
744
|
+
runtime = { ...runtime, commandPackagePlatforms, retainCommandPackages: command === 'uninstall' };
|
|
745
|
+
plan.runtime = runtime;
|
|
710
746
|
for (const currentScope of snapshot.context.scopes) {
|
|
711
747
|
const prepareGroup = async (groupTargets) => {
|
|
712
|
-
const
|
|
713
|
-
?
|
|
714
|
-
|
|
715
|
-
return false;
|
|
716
|
-
const contributions = selectedContributions.get(item);
|
|
717
|
-
return !contributions.some((entry) => entry.scope === 'user')
|
|
718
|
-
&& contributions.some((entry) => entry.scope === 'project' && entry.root !== item.pluginId)
|
|
719
|
-
&& !(requestedIds.has(item.pluginId) && (!options.exactTargets || options.exactTargets.some((exact) => exact.pluginId === item.pluginId && exact.agent === item.target && contributions.some((entry) => entry.scope === exact.scope))));
|
|
720
|
-
}) : [];
|
|
721
|
-
const inheritedPortableProviderIds = inheritedScripts.filter((item) => item.target === 'generic').map((item) => item.pluginId);
|
|
722
|
-
const placements = selected.filter((item) => item.scope === currentScope && groupTargets.includes(item.target)
|
|
723
|
-
&& !(item.scope === 'user' && !canReuseProviderAcrossScopes(item.target)
|
|
724
|
-
&& selectedContributions.get(item)?.every((entry) => entry.scope === 'project')
|
|
725
|
-
&& currentStatus.observedTargets?.some((actual) => actual.pluginId === item.pluginId
|
|
726
|
-
&& actual.agent === item.target && isInstalledSkillProvider(actual)))
|
|
727
|
-
&& !(command === 'install' && scope === 'project' && currentScope === 'user'
|
|
728
|
-
&& currentStatus.observedTargets?.some((observed) => observed.pluginId === item.pluginId
|
|
729
|
-
&& observed.agent === item.target && observed.scope === 'user' && observed.content === 'satisfied'))
|
|
730
|
-
&& !(hasSharedUserPackage(item.target) && inheritedScripts.includes(item)
|
|
731
|
-
&& currentStatus.observedTargets?.some((observed) => observed.pluginId === item.pluginId
|
|
732
|
-
&& observed.agent === item.target && observed.scope === 'user' && observed.providerScope === 'user'
|
|
733
|
-
&& observed.observation === 'verified' && observed.content === 'satisfied' && !observed.blockers.length)));
|
|
748
|
+
const inheritedPortableProviderIds = currentScope === 'user' && groupTargets.includes('generic')
|
|
749
|
+
? [...inheritedScripts].filter((item) => item.target === 'generic').map((item) => item.pluginId) : [];
|
|
750
|
+
const placements = preparedPlacements.filter((item) => item.scope === currentScope && groupTargets.includes(item.target));
|
|
734
751
|
if (!placements.length)
|
|
735
752
|
return;
|
|
736
753
|
const sourceDemand = currentScope === 'project' ? snapshot.project : snapshot.user;
|
|
@@ -1046,6 +1063,28 @@ async function prepareJointRecoveryInSession(command, selectors, { checkInstallC
|
|
|
1046
1063
|
}
|
|
1047
1064
|
}
|
|
1048
1065
|
}
|
|
1066
|
+
if ((batch || command === 'reinstall') && !options.existingOnly) {
|
|
1067
|
+
const eligible = children.filter((child) => child.command !== 'cleanup').flatMap((child) => child.receipt.targetResults.filter((target) => target.agent === 'generic' && target.delivery?.kind === 'agent-skills'
|
|
1068
|
+
&& !target.blockers.length));
|
|
1069
|
+
const eligiblePositions = new Set(eligible.map(targetKey));
|
|
1070
|
+
const candidates = [...new Map(preparedPlacements.filter((item) => item.target === 'generic'
|
|
1071
|
+
&& !item.plugin.manifest.command && eligiblePositions.has(targetKey({ ...item, agent: item.target })))
|
|
1072
|
+
.map((item) => [item.pluginId, item.plugin])).entries()];
|
|
1073
|
+
const reviewCwd = snapshot.context.projectRoot ?? context.executionCwd;
|
|
1074
|
+
const prepared = await mapInstallReads(candidates, async ([pluginId, plugin]) => {
|
|
1075
|
+
try {
|
|
1076
|
+
return await preparePortableCommandWithdrawal(plugin, reviewCwd, context.env);
|
|
1077
|
+
}
|
|
1078
|
+
catch (error) {
|
|
1079
|
+
if (recoveryInterruptionCode(error, options.signal))
|
|
1080
|
+
throw error;
|
|
1081
|
+
for (const target of eligible.filter((item) => item.pluginId === pluginId)) {
|
|
1082
|
+
target.blockers.push(diagnostic(errorCode(error, 'commandPackagePreparationFailed')));
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}, { signal: options.signal });
|
|
1086
|
+
plan.portableCommandWithdrawals = prepared.filter((entry) => entry !== undefined);
|
|
1087
|
+
}
|
|
1049
1088
|
finalizePreparedPlatformRebuildSession(runtime.preparedArtifactRenderResults);
|
|
1050
1089
|
plan.sourceRefreshes = [...new Map(children.flatMap((child) => child.sourceRefreshes).map((item) => [item.sourceId, item])).values()];
|
|
1051
1090
|
plan.sourceRefreshFailures = [...new Map(children.flatMap((child) => child.sourceRefreshFailures).map((item) => [item.sourceId, item])).values()];
|
|
@@ -1086,6 +1125,9 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1086
1125
|
let completedReceipt;
|
|
1087
1126
|
let lockWaitStartedAt;
|
|
1088
1127
|
try {
|
|
1128
|
+
if (plan.portableCommandWithdrawals?.length && (execution.yes ?? plan.options.yes) !== true) {
|
|
1129
|
+
return blockedBeforeDeployment(plan, diagnostic('confirmationRequired'));
|
|
1130
|
+
}
|
|
1089
1131
|
if (plan.sourceRefreshes.length) {
|
|
1090
1132
|
plan.receipt.blockers.push(diagnostic('sourceRefreshConfirmationRequired'));
|
|
1091
1133
|
const receipt = mergeReceipts(plan, joint.children.map((child) => child.receipt));
|
|
@@ -1162,7 +1204,9 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1162
1204
|
const failedPackages = new Set();
|
|
1163
1205
|
const failedNodes = new Set();
|
|
1164
1206
|
const packageResults = [];
|
|
1165
|
-
const runtime = { ...performanceRuntime, awHomeMutationToken: token
|
|
1207
|
+
const runtime = { ...performanceRuntime, awHomeMutationToken: token,
|
|
1208
|
+
commandPackagePlatforms: checked.runtime.commandPackagePlatforms,
|
|
1209
|
+
retainCommandPackages: checked.runtime.retainCommandPackages };
|
|
1166
1210
|
runtime.preApplyExecutionCache ??= new Map();
|
|
1167
1211
|
runtime.managedCommandProducerCache ??= new Map();
|
|
1168
1212
|
let interrupted;
|
|
@@ -1173,9 +1217,6 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1173
1217
|
results.push(...installed.receipts);
|
|
1174
1218
|
packageResults.push(...installed.commands);
|
|
1175
1219
|
plan.receipt.blockers.push(...installed.blockers);
|
|
1176
|
-
for (const result of installed.commands)
|
|
1177
|
-
if (result.state !== 'completed')
|
|
1178
|
-
failedPackages.add(getCommandPackageId(result.producer));
|
|
1179
1220
|
}
|
|
1180
1221
|
else {
|
|
1181
1222
|
const packages = runtime.configApplyPackages;
|
|
@@ -1373,11 +1414,11 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1373
1414
|
for (const target of child.receipt.requestedTargets)
|
|
1374
1415
|
nodeFor(target.pluginId, target.scope).targets.push({ child, agent: target.agent });
|
|
1375
1416
|
}
|
|
1376
|
-
const
|
|
1417
|
+
const consumesPackage = (node, target) => !target.blocker && node.targets.some(({ agent }) => agent !== 'generic' && target.platforms.includes(agent));
|
|
1377
1418
|
for (const target of packages?.targets ?? []) {
|
|
1378
1419
|
const sameScope = nodes.get(`${target.pluginId}\0${target.scope}`);
|
|
1379
|
-
const native = sameScope &&
|
|
1380
|
-
: [...nodes.values()].find((node) => node.pluginId === target.pluginId &&
|
|
1420
|
+
const native = sameScope && consumesPackage(sameScope, target) ? sameScope
|
|
1421
|
+
: [...nodes.values()].find((node) => node.pluginId === target.pluginId && consumesPackage(node, target));
|
|
1381
1422
|
const node = native ?? nodeFor(target.pluginId, target.scope);
|
|
1382
1423
|
(node.packages ??= []).push(target);
|
|
1383
1424
|
}
|
|
@@ -1404,7 +1445,7 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1404
1445
|
const key = `${pluginId}\0${scope}`;
|
|
1405
1446
|
completedPackages.set(key, produced);
|
|
1406
1447
|
packageResults.push(...produced);
|
|
1407
|
-
if (produced.
|
|
1448
|
+
if (!produced.every(commandPackageProviderSatisfied)) {
|
|
1408
1449
|
failedPackages.add(key);
|
|
1409
1450
|
failedNodes.add(key);
|
|
1410
1451
|
}
|
|
@@ -1419,17 +1460,19 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1419
1460
|
};
|
|
1420
1461
|
const blockPackages = (pluginId, scope, code) => completedPackages.get(`${pluginId}\0${scope}`)
|
|
1421
1462
|
?? recordPackages(pluginId, scope, packages?.blocked?.(pluginId, scope, code) ?? []);
|
|
1463
|
+
const nativePackages = (identity) => packages?.targets.filter((target) => target.pluginId === identity.pluginId
|
|
1464
|
+
&& target.platforms.includes(identity.platform)
|
|
1465
|
+
&& (target.scope === 'user' || target.scope === identity.scope)) ?? [];
|
|
1422
1466
|
if (packages)
|
|
1423
1467
|
runtime.nativeTargetExecution = {
|
|
1468
|
+
produces: (identity) => nativePackages(identity).length > 0,
|
|
1424
1469
|
beforeApply: async (identity) => {
|
|
1425
1470
|
const results = [];
|
|
1426
|
-
for (const target of
|
|
1427
|
-
&& (target.scope === 'user' || target.scope === identity.scope)))
|
|
1471
|
+
for (const target of nativePackages(identity))
|
|
1428
1472
|
results.push(...await applyPackages(target.pluginId, target.scope));
|
|
1429
1473
|
return results;
|
|
1430
1474
|
},
|
|
1431
|
-
blocked: (identity, code) =>
|
|
1432
|
-
&& (target.scope === 'user' || target.scope === identity.scope)).flatMap((target) => blockPackages(target.pluginId, target.scope, code === 'dependencyInstallFailed' ? 'dependencyApplyFailed' : code)),
|
|
1475
|
+
blocked: (identity, code) => nativePackages(identity).flatMap((target) => blockPackages(target.pluginId, target.scope, code === 'dependencyInstallFailed' ? 'dependencyApplyFailed' : code)),
|
|
1433
1476
|
};
|
|
1434
1477
|
while (pending.length) {
|
|
1435
1478
|
const index = pending.findIndex((node) => {
|
|
@@ -1447,20 +1490,21 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1447
1490
|
retiredProjectCopies = true;
|
|
1448
1491
|
}
|
|
1449
1492
|
const key = `${node.pluginId}\0${node.scope}`;
|
|
1450
|
-
|
|
1493
|
+
const standalonePackages = node.packages?.filter((target) => !consumesPackage(node, target)) ?? [];
|
|
1494
|
+
if (standalonePackages.length && packages) {
|
|
1451
1495
|
if (failedNodes.has(key) || [...node.dependencies].some((dependency) => failedNodes.has(dependency))) {
|
|
1452
1496
|
failedPackages.add(key);
|
|
1453
1497
|
failedNodes.add(key);
|
|
1454
|
-
for (const target of
|
|
1498
|
+
for (const target of standalonePackages)
|
|
1455
1499
|
blockPackages(target.pluginId, target.scope, 'dependencyApplyFailed');
|
|
1456
1500
|
plan.receipt.blockers.push(diagnostic('commandPackageProviderNotSatisfied', node.pluginId));
|
|
1457
1501
|
}
|
|
1458
1502
|
else {
|
|
1459
1503
|
try {
|
|
1460
1504
|
const produced = [];
|
|
1461
|
-
for (const target of
|
|
1505
|
+
for (const target of standalonePackages)
|
|
1462
1506
|
produced.push(...await applyPackages(target.pluginId, target.scope));
|
|
1463
|
-
if (produced.
|
|
1507
|
+
if (!produced.every(commandPackageProviderSatisfied)) {
|
|
1464
1508
|
failedPackages.add(key);
|
|
1465
1509
|
failedNodes.add(key);
|
|
1466
1510
|
}
|
|
@@ -1494,16 +1538,28 @@ export async function executeJointRecovery(plan, execution) {
|
|
|
1494
1538
|
await retireVerified('user');
|
|
1495
1539
|
}
|
|
1496
1540
|
const receipt = mergeReceipts(plan, results);
|
|
1497
|
-
|
|
1498
|
-
|
|
1541
|
+
completedReceipt = receipt;
|
|
1542
|
+
const commandResults = new Map([...packageResults, ...(receipt.commandResults ?? [])].map((result) => [result.packageId, result]));
|
|
1543
|
+
for (const action of plan.portableCommandWithdrawals ?? []) {
|
|
1544
|
+
if (interrupted || runtime.signal?.aborted)
|
|
1545
|
+
break;
|
|
1546
|
+
if (!receipt.targetResults.some((target) => target.pluginId === action.pluginId && target.agent === 'generic'
|
|
1547
|
+
&& target.delivery?.kind === 'agent-skills' && !target.blockers.length && target.observation === 'verified'
|
|
1548
|
+
&& ['applied', 'no-op'].includes(target.execution)))
|
|
1549
|
+
continue;
|
|
1550
|
+
const result = await runtime.managedCommandProducerCache.get(action.packageId)
|
|
1551
|
+
?? await publishLifecycleCommandPackage(action, { cwd: joint.snapshot.context.projectRoot ?? plan.context.executionCwd }, { env: plan.context.env, reporter: runtime.reporter });
|
|
1552
|
+
commandResults.set(result.packageId, result);
|
|
1553
|
+
receipt.outputsMayHaveChanged ||= result.action === 'removed' || result.state === 'partial';
|
|
1554
|
+
}
|
|
1555
|
+
receipt.commandResults = [...commandResults.values()];
|
|
1499
1556
|
receipt.recoveryActions = [...new Set([...receipt.recoveryActions,
|
|
1500
1557
|
...receipt.commandResults.flatMap((result) => result.recoveryActions)])];
|
|
1501
|
-
receipt.ok &&= failedPackages.size === 0;
|
|
1502
|
-
receipt.outputsMayHaveChanged ||= packageResults.some((
|
|
1558
|
+
receipt.ok &&= failedPackages.size === 0 && receipt.commandResults.every((result) => result.state === 'completed');
|
|
1559
|
+
receipt.outputsMayHaveChanged ||= packageResults.some(({ action, state }) => action !== 'unchanged' || state === 'partial');
|
|
1503
1560
|
receipt.errors.push(...results.flatMap((result) => result.targetResults.flatMap((target) => target.blockers)));
|
|
1504
1561
|
if (!receipt.ok && retriesFromRequestedRoots(receipt))
|
|
1505
1562
|
useDeclaredRetryRoots(receipt);
|
|
1506
|
-
completedReceipt = receipt;
|
|
1507
1563
|
if (interrupted)
|
|
1508
1564
|
throw interrupted;
|
|
1509
1565
|
runtime.signal?.throwIfAborted();
|