@lesliechan721/aw 0.1.0-beta.85 → 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/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 +131 -45
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +11 -3
- package/dist/src/commands/rebuild-integration.js +47 -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 +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 +7 -0
- package/dist/src/platforms/layout.js +46 -5
- 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
|
@@ -4,6 +4,8 @@ import { configReferenceKey, configReferenceScalars } from './config-references.
|
|
|
4
4
|
import crypto from 'node:crypto';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { managedCommandRecoveryPlanChanges } from './operation-review-planner.js';
|
|
7
|
+
import { recoveryHostPermissionEffects } from '../commands/deployment-confirmation.js';
|
|
8
|
+
import { isPermissionHost } from '../platforms/host-permission-policy.js';
|
|
7
9
|
import { resolveWorkContext } from '../intent/work-context.js';
|
|
8
10
|
import { flattenStatusTargets, statusTargetHasLiveConfigConsumer, } from '../commands/status-v6.js';
|
|
9
11
|
import { addCatalogSourceCommand, listCatalogSources, preflightCatalogSourceMutation, removeCatalogSourceCommand, setPrimaryCatalogSourceCommand, updateCatalogSourceCommand, } from '../commands/catalog-source.js';
|
|
@@ -21,6 +23,7 @@ import { prepareRetire, executeRetire } from '../recovery/retirement.js';
|
|
|
21
23
|
import { prepareTargetsPlan, executeTargetsPlan, prepareIntentPlan, executeIntentPlan } from './scoped-flow.js';
|
|
22
24
|
import { applyPluginConfigWrite, applyPluginConfig, ConfigApplyInterruptedError, preparePluginConfigApply, disposePluginConfigApply, resolveConfigPreApplyAuthorization, resetPluginConfigWithHelper, } from '../utils/plugin-config-write.js';
|
|
23
25
|
import { analyzePluginConfigMutationImpact, discoverPluginConfigManagedCommandPackages, pluginConfigTargetRenderScopes, pluginSharedNativeConfigRenderUnits } from '../utils/plugin-config-impact.js';
|
|
26
|
+
import { describeConfigCommandPackageReviews } from '../utils/plugin-config-command-apply.js';
|
|
24
27
|
import { collectPluginConfigReferenceEvidence, pluginConfigHasExternalReferences, resolvePluginConfigReferenceConsumers, resolvePluginConfigReferencePlugins } from '../utils/plugin-config-references.js';
|
|
25
28
|
import { inventoryCatalogSourceReferences } from '../utils/catalog-source-references.js';
|
|
26
29
|
import { operationEvidenceMatches, operationEvidenceFingerprint, configApplyHasCompletedWork, TuiConfigInvalidStoreError, TuiController, TuiOperationBlockedError, } from './controller.js';
|
|
@@ -255,6 +258,35 @@ async function configRetrySharedNativeRenderUnits(plugin, targets, env, referenc
|
|
|
255
258
|
return plugins.flatMap((consumer) => pluginSharedNativeConfigRenderUnits(consumer).filter((shared) => targets.some((target) => (target.pluginName ?? plugin.manifest.name) === consumer.manifest.name
|
|
256
259
|
&& target.platform === shared.platform)));
|
|
257
260
|
}
|
|
261
|
+
function configPackageReviewChanges(plan, reviews) {
|
|
262
|
+
return [
|
|
263
|
+
...describeConfigCommandPackageReviews(reviews).map((description) => ({
|
|
264
|
+
kind: 'change', group: 'configImpact', title: '命令包影响', description,
|
|
265
|
+
})),
|
|
266
|
+
...managedCommandRecoveryPlanChanges(plan).map((change) => ({ ...change, group: 'configImpact' })),
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
async function reviewConfigMutationApply(options, reviewed, fresh) {
|
|
270
|
+
const mayChangeHostPermissions = options.applyTargets?.some(({ platform }) => isPermissionHost(platform) || platform === 'claude');
|
|
271
|
+
// The writer revalidates the frozen command package candidate before saving.
|
|
272
|
+
if (fresh && !mayChangeHostPermissions)
|
|
273
|
+
return {
|
|
274
|
+
commandPackageEvidence: reviewed?.commandPackageEvidence,
|
|
275
|
+
commandReviewChanges: reviewed?.commandReviewChanges,
|
|
276
|
+
};
|
|
277
|
+
if (!options.applyCommandPackages?.length && !mayChangeHostPermissions)
|
|
278
|
+
return { commandPackageEvidence: [] };
|
|
279
|
+
const prepared = await preparePluginConfigApply(options);
|
|
280
|
+
try {
|
|
281
|
+
const hostPermissionEffects = recoveryHostPermissionEffects(prepared.plan);
|
|
282
|
+
return { commandPackageEvidence: prepared.commandPackageEvidence,
|
|
283
|
+
commandReviewChanges: configPackageReviewChanges(prepared.plan, prepared.commandPackageReviews),
|
|
284
|
+
...(hostPermissionEffects.length ? { hostPermissionEffects } : {}) };
|
|
285
|
+
}
|
|
286
|
+
finally {
|
|
287
|
+
await disposePluginConfigApply(prepared.plan);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
258
290
|
async function configRetryStoreDigest(options) {
|
|
259
291
|
const plugins = await resolvePluginConfigReferencePlugins({ sourceId: options.plugin.sourceId,
|
|
260
292
|
sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
@@ -267,8 +299,8 @@ async function configRetryStoreDigest(options) {
|
|
|
267
299
|
throw operationReviewStale('重试目标的插件定义已变化。');
|
|
268
300
|
return pluginConfigTargetRenderScopes(plugin, target).map((scope) => ({ pluginName: target.pluginName, scope, platform: target.platform }));
|
|
269
301
|
}),
|
|
270
|
-
...options.commandPackages.
|
|
271
|
-
platform: producer.
|
|
302
|
+
...options.commandPackages.flatMap(({ producer, runtimeConfigPlatforms }) => [undefined, ...runtimeConfigPlatforms]
|
|
303
|
+
.map((platform) => ({ pluginName: producer.pluginName, scope: 'user', platform }))),
|
|
272
304
|
...options.preApplyAuthorization.map(({ pluginName, scope }) => ({ pluginName, scope, platform: options.platform }))];
|
|
273
305
|
return digest(await collectPluginConfigReferenceEvidence({ ...options, profiles, plugins }));
|
|
274
306
|
}
|
|
@@ -893,7 +925,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
893
925
|
};
|
|
894
926
|
}
|
|
895
927
|
};
|
|
896
|
-
const captureEvidence = async (intent, signal, preparation, operationInventory = createOperationInventoryReader(), freshCatalog = false, reusableCandidate) => {
|
|
928
|
+
const captureEvidence = async (intent, signal, preparation, operationInventory = createOperationInventoryReader(), freshCatalog = false, reusableCandidate, reviewedEvidence) => {
|
|
897
929
|
if (intent.kind === 'pluginWrite' || intent.kind === 'pluginWriteBatch'
|
|
898
930
|
|| intent.kind === 'pluginWriteTask') {
|
|
899
931
|
throw new TuiOperationBlockedError('useScopedRecovery', '请使用统一范围恢复任务。');
|
|
@@ -920,7 +952,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
920
952
|
let batchBase;
|
|
921
953
|
let batchCatalogOperation;
|
|
922
954
|
for (const group of intent.groups) {
|
|
923
|
-
const current = await captureEvidence(configSaveBatchGroupIntent(intent, group), signal, preparation, operationInventory, freshCatalog, reusableCandidate);
|
|
955
|
+
const current = await captureEvidence(configSaveBatchGroupIntent(intent, group), signal, preparation, operationInventory, freshCatalog, reusableCandidate, { config: reviewedEvidence?.configBatch?.groups.find((item) => item.platform === group.platform)?.config });
|
|
924
956
|
if (!current.config || !current.source || !current.targetFingerprint) {
|
|
925
957
|
throw operationReviewStale('设置批次缺少单层证据。');
|
|
926
958
|
}
|
|
@@ -1340,6 +1372,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1340
1372
|
sourceWrite: {
|
|
1341
1373
|
configDigest: preview.configDigest,
|
|
1342
1374
|
proposedConfigDigest: preview.proposedConfigDigest,
|
|
1375
|
+
...(preview.identityChanged ? { identityChanged: true } : {}),
|
|
1343
1376
|
...(preview.sourceIdentity ? { sourceIdentity: preview.sourceIdentity } : {}),
|
|
1344
1377
|
inventoryDigest: digest({ references: preview.references.references, errors: preview.references.errors }),
|
|
1345
1378
|
impactDigest: preview.impactDigest,
|
|
@@ -1462,6 +1495,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1462
1495
|
...(intent.targets ? { targets: intent.targets } : {}),
|
|
1463
1496
|
cwd: context.cwd, env: context.env, cliVersion: packageInfo.version,
|
|
1464
1497
|
nativeCliRunner: context.nativeCliRunner,
|
|
1498
|
+
expectedCommandPackageEvidence: reviewedEvidence?.config?.commandPackageEvidence,
|
|
1465
1499
|
rebuildRuntime: {
|
|
1466
1500
|
...context,
|
|
1467
1501
|
referencePlugins,
|
|
@@ -1492,9 +1526,12 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1492
1526
|
impactState: 'known', affectedTargets: targets,
|
|
1493
1527
|
commandPackages: prepared.commandPackages,
|
|
1494
1528
|
applyEvidence: prepared.evidence, applyChanges: prepared.plan.changes,
|
|
1495
|
-
|
|
1529
|
+
commandPackageEvidence: prepared.commandPackageEvidence,
|
|
1530
|
+
commandReviewChanges: configPackageReviewChanges(prepared.plan, prepared.commandPackageReviews),
|
|
1531
|
+
hostPermissionEffects: recoveryHostPermissionEffects(prepared.plan),
|
|
1496
1532
|
applyWarnings: prepared.plan.warnings,
|
|
1497
1533
|
applyBlockers: [...new Map([
|
|
1534
|
+
...prepared.commandPackageEvidence.flatMap(({ blocker }) => blocker ? [blocker] : []),
|
|
1498
1535
|
...prepared.plan.receipt.blockers, ...prepared.plan.receipt.errors,
|
|
1499
1536
|
...prepared.plan.receipt.targetResults.flatMap((target) => target.blockers),
|
|
1500
1537
|
].map((item) => [`${item.code}\0${item.message}`, item])).values()],
|
|
@@ -1608,12 +1645,22 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1608
1645
|
},
|
|
1609
1646
|
})).targets
|
|
1610
1647
|
: [];
|
|
1648
|
+
const commandReview = configIntentRequestsApply(intent) ? await reviewConfigMutationApply({
|
|
1649
|
+
plugin, scope: 'user', context: intent.context ?? 'user', platform: intent.platform,
|
|
1650
|
+
cwd: context.cwd, env: context.env, cliVersion: packageInfo.version, nativeCliRunner: context.nativeCliRunner,
|
|
1651
|
+
applyTargets: affectedTargets, applyCommandPackages: commandPackages.map(({ packageId }) => packageId),
|
|
1652
|
+
mutation: { kind: 'patch', updates: intent.updates, removeKeys: intent.removeKeys },
|
|
1653
|
+
rebuildRuntime: { ...context, signal, referencePlugins, catalogOperationContext: preparedCatalogOperation,
|
|
1654
|
+
expectedGenerationSetDigest: preparedCatalogOperation.generationSetDigest,
|
|
1655
|
+
scriptTimeoutMs: reviewedScriptTimeoutMs(intent), inventoryCatalogSourceReferences: operationInventory },
|
|
1656
|
+
}, reviewedEvidence?.config, freshCatalog) : {};
|
|
1611
1657
|
return {
|
|
1612
1658
|
pluginName: plugin.manifest.name,
|
|
1613
1659
|
source: sourceEvidenceForPlugin(source, plugin.manifest.name),
|
|
1614
1660
|
schemaIdentity: configSchemaIdentity(plugin, source.manifestDigest, intent.platform),
|
|
1615
1661
|
impact,
|
|
1616
1662
|
commandPackages,
|
|
1663
|
+
commandReview,
|
|
1617
1664
|
preApplyAuthorization,
|
|
1618
1665
|
retryStoreDigest: intent.retryApply ? await configRetryStoreDigest({ plugin, scope: intent.context ?? 'user', platform: intent.platform,
|
|
1619
1666
|
targets: affectedTargets, commandPackages, preApplyAuthorization, cwd: context.cwd, env: context.env, plugins: referencePlugins }) : undefined,
|
|
@@ -1641,6 +1688,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1641
1688
|
impactState: selected.impact?.impactState ?? 'known',
|
|
1642
1689
|
...(selected.impact?.noEffectiveChange ? { noEffectiveChange: true } : {}),
|
|
1643
1690
|
...(selected.commandPackages.length ? { commandPackages: selected.commandPackages } : {}),
|
|
1691
|
+
...selected.commandReview,
|
|
1644
1692
|
affectedTargets: (selected.impact?.affectedTargets
|
|
1645
1693
|
?? relevantTargets).map(({ pluginName, platform, scope }) => ({ pluginName, platform, scope })),
|
|
1646
1694
|
...(selected.preApplyAuthorization.length > 0
|
|
@@ -1756,12 +1804,22 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1756
1804
|
},
|
|
1757
1805
|
})).targets
|
|
1758
1806
|
: [];
|
|
1807
|
+
const commandReview = intent.kind === 'configSave' && configIntentRequestsApply(intent) ? await reviewConfigMutationApply({
|
|
1808
|
+
plugin, scope: 'user', context: intent.context ?? 'user', platform: intent.platform,
|
|
1809
|
+
cwd: context.cwd, env: context.env, cliVersion: packageInfo.version, nativeCliRunner: context.nativeCliRunner,
|
|
1810
|
+
applyTargets: affectedTargets, applyCommandPackages: commandPackages.map(({ packageId }) => packageId),
|
|
1811
|
+
mutation: { kind: 'patch', updates: intent.updates, removeKeys: intent.removeKeys },
|
|
1812
|
+
rebuildRuntime: { ...context, signal, referencePlugins, catalogOperationContext: catalogOperation,
|
|
1813
|
+
expectedGenerationSetDigest: catalogOperation?.generationSetDigest,
|
|
1814
|
+
scriptTimeoutMs: reviewedScriptTimeoutMs(intent), inventoryCatalogSourceReferences: operationInventory },
|
|
1815
|
+
}, reviewedEvidence?.config, freshCatalog) : {};
|
|
1759
1816
|
return {
|
|
1760
1817
|
pluginName: plugin.manifest.name,
|
|
1761
1818
|
source: sourceEvidenceForPlugin(source, plugin.manifest.name),
|
|
1762
1819
|
schemaIdentity: configSchemaIdentity(plugin, source.manifestDigest, intent.platform),
|
|
1763
1820
|
impact,
|
|
1764
1821
|
commandPackages,
|
|
1822
|
+
commandReview,
|
|
1765
1823
|
preApplyAuthorization,
|
|
1766
1824
|
retryStoreDigest: intent.kind === 'configSave' && intent.retryApply
|
|
1767
1825
|
? await configRetryStoreDigest({ plugin, scope: intent.context ?? 'user', platform: intent.platform, targets: affectedTargets,
|
|
@@ -1802,6 +1860,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1802
1860
|
...(impact?.noEffectiveChange ? { noEffectiveChange: true } : {}),
|
|
1803
1861
|
...('commandPackages' in selected && selected.commandPackages.length
|
|
1804
1862
|
? { commandPackages: selected.commandPackages } : {}),
|
|
1863
|
+
...('commandReview' in selected ? selected.commandReview : {}),
|
|
1805
1864
|
affectedTargets: (impact?.affectedTargets
|
|
1806
1865
|
?? evidenceTargets).map(({ pluginName, platform, scope }) => ({ pluginName, platform, scope })),
|
|
1807
1866
|
...('sharedNativeRenderUnits' in selected
|
|
@@ -2634,7 +2693,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2634
2693
|
action: async (awHomeMutationToken) => {
|
|
2635
2694
|
await tuiControllerRuntimeTestHooks?.beforeMutationEvidenceCapture?.();
|
|
2636
2695
|
const operationInventory = createOperationInventoryReader();
|
|
2637
|
-
const currentEvidence = await captureEvidence(intent, undefined, undefined, operationInventory, true);
|
|
2696
|
+
const currentEvidence = await captureEvidence(intent, undefined, undefined, operationInventory, true, undefined, expectedEvidence);
|
|
2638
2697
|
if (!operationEvidenceMatches(expectedEvidence, currentEvidence)) {
|
|
2639
2698
|
throw new TuiOperationBlockedError('operationReviewStale', '确认后状态发生变化。');
|
|
2640
2699
|
}
|
|
@@ -2747,6 +2806,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2747
2806
|
...(applyTargets.length ? { applyTargets } : {}),
|
|
2748
2807
|
request: { updates: group.updates, removeKeys: group.removeKeys },
|
|
2749
2808
|
sharedNativeApplyConfirmed: true,
|
|
2809
|
+
expectedCommandPackageEvidence: reviewedGroup.config.commandPackageEvidence,
|
|
2810
|
+
expectedHostPermissionEffects: reviewedGroup.config.hostPermissionEffects,
|
|
2750
2811
|
preApplyConfirmed: true,
|
|
2751
2812
|
preApplyAuthorizedTargets: approvedPreApplyTargets,
|
|
2752
2813
|
});
|
|
@@ -2889,6 +2950,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2889
2950
|
},
|
|
2890
2951
|
awHomeMutationToken,
|
|
2891
2952
|
expectedEvidence: expectedEvidence.config?.applyEvidence,
|
|
2953
|
+
expectedCommandPackageEvidence: expectedEvidence.config?.commandPackageEvidence,
|
|
2954
|
+
expectedHostPermissionEffects: expectedEvidence.config?.hostPermissionEffects,
|
|
2892
2955
|
sharedNativeApplyConfirmed: true,
|
|
2893
2956
|
preApplyConfirmed: true,
|
|
2894
2957
|
preApplyAuthorizedTargets: expectedEvidence.config?.preApplyAuthorization ?? [],
|
|
@@ -2918,6 +2981,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
2918
2981
|
...(applyTargets.length ? { applyTargets } : {}),
|
|
2919
2982
|
request: { updates: intent.updates, removeKeys: intent.removeKeys },
|
|
2920
2983
|
sharedNativeApplyConfirmed: true,
|
|
2984
|
+
expectedCommandPackageEvidence: expectedEvidence.config?.commandPackageEvidence,
|
|
2985
|
+
expectedHostPermissionEffects: expectedEvidence.config?.hostPermissionEffects,
|
|
2921
2986
|
preApplyConfirmed: true,
|
|
2922
2987
|
preApplyAuthorizedTargets: expectedEvidence.config?.preApplyAuthorization ?? [],
|
|
2923
2988
|
});
|