@lesliechan721/aw 0.1.0-beta.63 → 0.1.0-beta.65

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.
Files changed (302) hide show
  1. package/dist/authoring/assets/aw-runtime-config.mjs +3 -3
  2. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
  3. package/dist/authoring/scripts/add-skill.mjs +3 -17
  4. package/dist/authoring/scripts/add-skill.mjs.map +1 -1
  5. package/dist/authoring/scripts/init-plugin.mjs +1 -0
  6. package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
  7. package/dist/authoring/scripts/lib/plugin-version-check.mjs +1 -1
  8. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +2 -0
  9. package/dist/authoring/scripts/lib/skill-scaffold.mjs +2 -0
  10. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
  11. package/dist/authoring/scripts/validate-plugin.mjs +95 -698
  12. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  13. package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
  14. package/dist/scripts/aw-skill-eval-materializer.js +74 -44
  15. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  16. package/dist/scripts/bundle-plugins.js +10 -2
  17. package/dist/scripts/bundle-plugins.js.map +1 -1
  18. package/dist/scripts/plugin-staging.d.ts +1 -1
  19. package/dist/scripts/plugin-staging.js +1 -1
  20. package/dist/scripts/plugin-staging.js.map +1 -1
  21. package/dist/scripts/test-plugin-scripts.js +31 -31
  22. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  23. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  24. package/dist/src/commands/aw-capabilities.js +2 -0
  25. package/dist/src/commands/aw-capabilities.js.map +1 -1
  26. package/dist/src/commands/console.js +4 -3
  27. package/dist/src/commands/console.js.map +1 -1
  28. package/dist/src/commands/intent-command.d.ts +30 -0
  29. package/dist/src/commands/intent-command.js +164 -0
  30. package/dist/src/commands/intent-command.js.map +1 -0
  31. package/dist/src/commands/operation-plan.d.ts +2 -0
  32. package/dist/src/commands/operation-plan.js +2 -1
  33. package/dist/src/commands/operation-plan.js.map +1 -1
  34. package/dist/src/commands/options.d.ts +3 -11
  35. package/dist/src/commands/options.js +11 -17
  36. package/dist/src/commands/options.js.map +1 -1
  37. package/dist/src/commands/plugin-capabilities.js +27 -33
  38. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  39. package/dist/src/commands/rebuild-command.d.ts +108 -6
  40. package/dist/src/commands/rebuild-command.js +617 -1549
  41. package/dist/src/commands/rebuild-command.js.map +1 -1
  42. package/dist/src/commands/rebuild-integration.d.ts +19 -3
  43. package/dist/src/commands/rebuild-integration.js +500 -459
  44. package/dist/src/commands/rebuild-integration.js.map +1 -1
  45. package/dist/src/commands/rebuild-operations.js +1 -2
  46. package/dist/src/commands/rebuild-operations.js.map +1 -1
  47. package/dist/src/commands/review-inspection.d.ts +2 -2
  48. package/dist/src/commands/review-inspection.js +30 -86
  49. package/dist/src/commands/review-inspection.js.map +1 -1
  50. package/dist/src/commands/review-preparation.js +16 -7
  51. package/dist/src/commands/review-preparation.js.map +1 -1
  52. package/dist/src/commands/skill-eval.d.ts +2 -0
  53. package/dist/src/commands/skill-eval.js +15 -9
  54. package/dist/src/commands/skill-eval.js.map +1 -1
  55. package/dist/src/commands/status-v6.d.ts +38 -5
  56. package/dist/src/commands/status-v6.js +269 -102
  57. package/dist/src/commands/status-v6.js.map +1 -1
  58. package/dist/src/commands/targets-command.d.ts +27 -0
  59. package/dist/src/commands/targets-command.js +77 -0
  60. package/dist/src/commands/targets-command.js.map +1 -0
  61. package/dist/src/commands/write-commands.js +5 -5
  62. package/dist/src/commands/write-commands.js.map +1 -1
  63. package/dist/src/eval/manifest-v1.d.ts +2 -0
  64. package/dist/src/eval/manifest-v1.js +7 -2
  65. package/dist/src/eval/manifest-v1.js.map +1 -1
  66. package/dist/src/generators/local-plugin.d.ts +2 -1
  67. package/dist/src/generators/local-plugin.js +111 -108
  68. package/dist/src/generators/local-plugin.js.map +1 -1
  69. package/dist/src/index.d.ts +10 -17
  70. package/dist/src/index.js +585 -1349
  71. package/dist/src/index.js.map +1 -1
  72. package/dist/src/intent/deployment-preferences.d.ts +63 -0
  73. package/dist/src/intent/deployment-preferences.js +170 -0
  74. package/dist/src/intent/deployment-preferences.js.map +1 -0
  75. package/dist/src/intent/diagnostics.d.ts +11 -0
  76. package/dist/src/intent/diagnostics.js +14 -0
  77. package/dist/src/intent/diagnostics.js.map +1 -0
  78. package/dist/src/intent/intent-codec.d.ts +19 -0
  79. package/dist/src/intent/intent-codec.js +117 -0
  80. package/dist/src/intent/intent-codec.js.map +1 -0
  81. package/dist/src/intent/intent-store.d.ts +43 -0
  82. package/dist/src/intent/intent-store.js +118 -0
  83. package/dist/src/intent/intent-store.js.map +1 -0
  84. package/dist/src/intent/scope-context.d.ts +33 -0
  85. package/dist/src/intent/scope-context.js +145 -0
  86. package/dist/src/intent/scope-context.js.map +1 -0
  87. package/dist/src/intent/work-context.d.ts +13 -0
  88. package/dist/src/intent/work-context.js +22 -0
  89. package/dist/src/intent/work-context.js.map +1 -0
  90. package/dist/src/output/command-receipt.js +16 -9
  91. package/dist/src/output/command-receipt.js.map +1 -1
  92. package/dist/src/portable/commands.d.ts +18 -8
  93. package/dist/src/portable/commands.js +46 -562
  94. package/dist/src/portable/commands.js.map +1 -1
  95. package/dist/src/portable/historical-materialization.d.ts +22 -0
  96. package/dist/src/portable/historical-materialization.js +124 -0
  97. package/dist/src/portable/historical-materialization.js.map +1 -0
  98. package/dist/src/portable/materializer.d.ts +8 -0
  99. package/dist/src/portable/materializer.js +75 -44
  100. package/dist/src/portable/materializer.js.map +1 -1
  101. package/dist/src/portable/recovery-layout.d.ts +17 -0
  102. package/dist/src/portable/recovery-layout.js +55 -0
  103. package/dist/src/portable/recovery-layout.js.map +1 -0
  104. package/dist/src/portable/recovery.d.ts +143 -0
  105. package/dist/src/portable/recovery.js +339 -0
  106. package/dist/src/portable/recovery.js.map +1 -0
  107. package/dist/src/portable/writer.d.ts +64 -0
  108. package/dist/src/portable/writer.js +316 -0
  109. package/dist/src/portable/writer.js.map +1 -0
  110. package/dist/src/recovery/coordinator.d.ts +137 -0
  111. package/dist/src/recovery/coordinator.js +1198 -0
  112. package/dist/src/recovery/coordinator.js.map +1 -0
  113. package/dist/src/recovery/demand.d.ts +44 -0
  114. package/dist/src/recovery/demand.js +178 -0
  115. package/dist/src/recovery/demand.js.map +1 -0
  116. package/dist/src/recovery/joint-coordinator.d.ts +24 -0
  117. package/dist/src/recovery/joint-coordinator.js +770 -0
  118. package/dist/src/recovery/joint-coordinator.js.map +1 -0
  119. package/dist/src/recovery/joint-demand.d.ts +68 -0
  120. package/dist/src/recovery/joint-demand.js +166 -0
  121. package/dist/src/recovery/joint-demand.js.map +1 -0
  122. package/dist/src/recovery/receipt.d.ts +81 -0
  123. package/dist/src/recovery/receipt.js +2 -0
  124. package/dist/src/recovery/receipt.js.map +1 -0
  125. package/dist/src/recovery/retirement.d.ts +45 -0
  126. package/dist/src/recovery/retirement.js +366 -0
  127. package/dist/src/recovery/retirement.js.map +1 -0
  128. package/dist/src/recovery/status.d.ts +108 -0
  129. package/dist/src/recovery/status.js +417 -0
  130. package/dist/src/recovery/status.js.map +1 -0
  131. package/dist/src/recovery/types.d.ts +86 -0
  132. package/dist/src/recovery/types.js +2 -0
  133. package/dist/src/recovery/types.js.map +1 -0
  134. package/dist/src/review/review-profile.d.ts +2 -1
  135. package/dist/src/review/review-profile.js +15 -15
  136. package/dist/src/review/review-profile.js.map +1 -1
  137. package/dist/src/review/review-selection.d.ts +1 -2
  138. package/dist/src/review/review-selection.js +40 -114
  139. package/dist/src/review/review-selection.js.map +1 -1
  140. package/dist/src/review/review-types.d.ts +4 -4
  141. package/dist/src/review/review-types.js.map +1 -1
  142. package/dist/src/review/skill-materialization.js +15 -6
  143. package/dist/src/review/skill-materialization.js.map +1 -1
  144. package/dist/src/review/source-binding.d.ts +14 -4
  145. package/dist/src/review/source-binding.js +62 -117
  146. package/dist/src/review/source-binding.js.map +1 -1
  147. package/dist/src/tui/agent-management.d.ts +23 -0
  148. package/dist/src/tui/agent-management.js +217 -0
  149. package/dist/src/tui/agent-management.js.map +1 -0
  150. package/dist/src/tui/agent-settings.d.ts +44 -0
  151. package/dist/src/tui/agent-settings.js +98 -0
  152. package/dist/src/tui/agent-settings.js.map +1 -0
  153. package/dist/src/tui/components.d.ts +3 -0
  154. package/dist/src/tui/components.js +10 -1
  155. package/dist/src/tui/components.js.map +1 -1
  156. package/dist/src/tui/config-references.d.ts +6 -3
  157. package/dist/src/tui/config-references.js +17 -12
  158. package/dist/src/tui/config-references.js.map +1 -1
  159. package/dist/src/tui/console-app-v4.d.ts +1 -2
  160. package/dist/src/tui/console-app-v4.js +1533 -1047
  161. package/dist/src/tui/console-app-v4.js.map +1 -1
  162. package/dist/src/tui/controller-runtime.d.ts +2 -1
  163. package/dist/src/tui/controller-runtime.js +457 -1634
  164. package/dist/src/tui/controller-runtime.js.map +1 -1
  165. package/dist/src/tui/controller.d.ts +131 -81
  166. package/dist/src/tui/controller.js +307 -227
  167. package/dist/src/tui/controller.js.map +1 -1
  168. package/dist/src/tui/entity-cards.d.ts +2 -2
  169. package/dist/src/tui/entity-cards.js +98 -20
  170. package/dist/src/tui/entity-cards.js.map +1 -1
  171. package/dist/src/tui/glossary.d.ts +2 -0
  172. package/dist/src/tui/glossary.js +20 -0
  173. package/dist/src/tui/glossary.js.map +1 -1
  174. package/dist/src/tui/model.d.ts +28 -10
  175. package/dist/src/tui/model.js +41 -41
  176. package/dist/src/tui/model.js.map +1 -1
  177. package/dist/src/tui/operation-review-planner.d.ts +2 -0
  178. package/dist/src/tui/operation-review-planner.js +58 -122
  179. package/dist/src/tui/operation-review-planner.js.map +1 -1
  180. package/dist/src/tui/plugin-content.js +7 -4
  181. package/dist/src/tui/plugin-content.js.map +1 -1
  182. package/dist/src/tui/plugin-detail.d.ts +22 -3
  183. package/dist/src/tui/plugin-detail.js +113 -26
  184. package/dist/src/tui/plugin-detail.js.map +1 -1
  185. package/dist/src/tui/reader.d.ts +1 -0
  186. package/dist/src/tui/reader.js +3 -1
  187. package/dist/src/tui/reader.js.map +1 -1
  188. package/dist/src/tui/router.d.ts +23 -33
  189. package/dist/src/tui/router.js.map +1 -1
  190. package/dist/src/tui/scoped-flow.d.ts +45 -0
  191. package/dist/src/tui/scoped-flow.js +96 -0
  192. package/dist/src/tui/scoped-flow.js.map +1 -0
  193. package/dist/src/tui/scoped-inventory.d.ts +122 -0
  194. package/dist/src/tui/scoped-inventory.js +225 -0
  195. package/dist/src/tui/scoped-inventory.js.map +1 -0
  196. package/dist/src/tui/screen-registry.d.ts +25 -25
  197. package/dist/src/tui/screen-registry.js +3 -7
  198. package/dist/src/tui/screen-registry.js.map +1 -1
  199. package/dist/src/tui/session-console-app.js +1 -1
  200. package/dist/src/tui/session-console-app.js.map +1 -1
  201. package/dist/src/tui/session-host.js +12 -2
  202. package/dist/src/tui/session-host.js.map +1 -1
  203. package/dist/src/types.d.ts +15 -12
  204. package/dist/src/types.js.map +1 -1
  205. package/dist/src/utils/agent-version.js +2 -0
  206. package/dist/src/utils/agent-version.js.map +1 -1
  207. package/dist/src/utils/artifact-plan.js +13 -6
  208. package/dist/src/utils/artifact-plan.js.map +1 -1
  209. package/dist/src/utils/artifact-renderer.d.ts +6 -3
  210. package/dist/src/utils/artifact-renderer.js +27 -32
  211. package/dist/src/utils/artifact-renderer.js.map +1 -1
  212. package/dist/src/utils/artifact-request.d.ts +1 -0
  213. package/dist/src/utils/artifact-request.js +22 -12
  214. package/dist/src/utils/artifact-request.js.map +1 -1
  215. package/dist/src/utils/artifact-sources.d.ts +2 -2
  216. package/dist/src/utils/bundle-layout.js +18 -16
  217. package/dist/src/utils/bundle-layout.js.map +1 -1
  218. package/dist/src/utils/catalog-digests.js +2 -0
  219. package/dist/src/utils/catalog-digests.js.map +1 -1
  220. package/dist/src/utils/catalog-runtime-projection.d.ts +4 -3
  221. package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
  222. package/dist/src/utils/catalog-source-references.d.ts +5 -0
  223. package/dist/src/utils/catalog-source-references.js +42 -57
  224. package/dist/src/utils/catalog-source-references.js.map +1 -1
  225. package/dist/src/utils/claude-native-render-receipt.d.ts +14 -0
  226. package/dist/src/utils/claude-native-render-receipt.js +26 -0
  227. package/dist/src/utils/claude-native-render-receipt.js.map +1 -0
  228. package/dist/src/utils/claude-skills-root.js +14 -3
  229. package/dist/src/utils/claude-skills-root.js.map +1 -1
  230. package/dist/src/utils/codex-manager.js +6 -12
  231. package/dist/src/utils/codex-manager.js.map +1 -1
  232. package/dist/src/utils/codex-native-observation.js +29 -13
  233. package/dist/src/utils/codex-native-observation.js.map +1 -1
  234. package/dist/src/utils/codex-reconciler.d.ts +2 -5
  235. package/dist/src/utils/codex-reconciler.js +25 -1
  236. package/dist/src/utils/codex-reconciler.js.map +1 -1
  237. package/dist/src/utils/codex-surface-analysis.js +5 -3
  238. package/dist/src/utils/codex-surface-analysis.js.map +1 -1
  239. package/dist/src/utils/local-marketplace.d.ts +14 -2
  240. package/dist/src/utils/local-marketplace.js +209 -42
  241. package/dist/src/utils/local-marketplace.js.map +1 -1
  242. package/dist/src/utils/managed-command-evidence.js +1 -1
  243. package/dist/src/utils/managed-command-evidence.js.map +1 -1
  244. package/dist/src/utils/managed-command-materialization.d.ts +4 -0
  245. package/dist/src/utils/managed-command-materialization.js +15 -6
  246. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  247. package/dist/src/utils/managed-command-store.d.ts +15 -0
  248. package/dist/src/utils/managed-command-store.js +73 -8
  249. package/dist/src/utils/managed-command-store.js.map +1 -1
  250. package/dist/src/utils/native-cli.d.ts +2 -0
  251. package/dist/src/utils/native-cli.js +22 -0
  252. package/dist/src/utils/native-cli.js.map +1 -1
  253. package/dist/src/utils/native-demand.d.ts +10 -0
  254. package/dist/src/utils/native-demand.js +4 -0
  255. package/dist/src/utils/native-demand.js.map +1 -0
  256. package/dist/src/utils/ownership.js +2 -0
  257. package/dist/src/utils/ownership.js.map +1 -1
  258. package/dist/src/utils/paths.js +1 -1
  259. package/dist/src/utils/paths.js.map +1 -1
  260. package/dist/src/utils/platform-support.d.ts +1 -1
  261. package/dist/src/utils/platform-support.js +1 -1
  262. package/dist/src/utils/platform-support.js.map +1 -1
  263. package/dist/src/utils/plugin-config-impact.d.ts +3 -0
  264. package/dist/src/utils/plugin-config-impact.js +115 -273
  265. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  266. package/dist/src/utils/plugin-config-references.d.ts +11 -2
  267. package/dist/src/utils/plugin-config-references.js +85 -90
  268. package/dist/src/utils/plugin-config-references.js.map +1 -1
  269. package/dist/src/utils/plugin-config-write.d.ts +58 -1
  270. package/dist/src/utils/plugin-config-write.js +756 -809
  271. package/dist/src/utils/plugin-config-write.js.map +1 -1
  272. package/dist/src/utils/plugin-config.d.ts +47 -46
  273. package/dist/src/utils/plugin-config.js +292 -833
  274. package/dist/src/utils/plugin-config.js.map +1 -1
  275. package/dist/src/utils/plugin-scripts.d.ts +11 -6
  276. package/dist/src/utils/plugin-scripts.js +52 -35
  277. package/dist/src/utils/plugin-scripts.js.map +1 -1
  278. package/dist/src/utils/runtime-config.js +5 -4
  279. package/dist/src/utils/runtime-config.js.map +1 -1
  280. package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
  281. package/dist/src/utils/runtime-skill-closure.js.map +1 -1
  282. package/dist/src/utils/state-paths.d.ts +8 -3
  283. package/dist/src/utils/state-paths.js +53 -16
  284. package/dist/src/utils/state-paths.js.map +1 -1
  285. package/dist/src/utils/windows-npm-shim.d.ts +2 -0
  286. package/dist/src/utils/windows-npm-shim.js +5 -7
  287. package/dist/src/utils/windows-npm-shim.js.map +1 -1
  288. package/dist/vitest.config.js +1 -0
  289. package/dist/vitest.config.js.map +1 -1
  290. package/package.json +3 -3
  291. package/dist/src/commands/sync-command.d.ts +0 -40
  292. package/dist/src/commands/sync-command.js +0 -254
  293. package/dist/src/commands/sync-command.js.map +0 -1
  294. package/dist/src/portable/skills-cli.d.ts +0 -51
  295. package/dist/src/portable/skills-cli.js +0 -202
  296. package/dist/src/portable/skills-cli.js.map +0 -1
  297. package/dist/src/tui/project-inventory.d.ts +0 -68
  298. package/dist/src/tui/project-inventory.js +0 -203
  299. package/dist/src/tui/project-inventory.js.map +0 -1
  300. package/dist/src/utils/plugin-intent-state.d.ts +0 -49
  301. package/dist/src/utils/plugin-intent-state.js +0 -320
  302. package/dist/src/utils/plugin-intent-state.js.map +0 -1
@@ -4,7 +4,7 @@ import { requestedIntentAction } from '../output/command-receipt.js';
4
4
  import { catalogSourceAutoCheckOnlyValue } from './catalog-sources/review.js';
5
5
  import { parseScriptTimeoutMs, SCRIPT_TIMEOUT_DEFAULT_MS, } from '../commands/options.js';
6
6
  import { MANAGED_CODEX_VERSION } from '../utils/codex-manager.js';
7
- import { platformLabel, scopeLabel } from './glossary.js';
7
+ import { agentLabel, platformLabel, scopeLabel } from './glossary.js';
8
8
  import { getCommandPackageId } from '@lesliechan721/aw-plugin-core/manifest';
9
9
  import { normalizeInstalledCommandProducer } from '../utils/managed-command-store.js';
10
10
  function plannerError(code, message) {
@@ -20,16 +20,16 @@ function configCommandPackageChanges(evidence, apply) {
20
20
  group: 'configImpact',
21
21
  pluginId: `${target.producer.sourceId}/${target.producer.pluginName}`,
22
22
  title: `${target.declared ? apply ? '刷新' : '需同步' : '保留残留'}命令包 ${target.packageKey}`,
23
- description: `${target.producer.sourceId}/${target.producer.pluginName} · ${scopeLabel(target.producer.scope)} · ${target.producer.scope === 'user'
24
- ? '平台共用一份个人默认配置,更新会影响全部引用者' : '当前项目配置'}${target.declared ? ''
23
+ description: `${target.producer.sourceId}/${target.producer.pluginName} · ${scopeLabel(target.producer.scope)} · ${target.producer.platform
24
+ ? `${agentLabel(target.producer.platform)} 平台配置` : '公共配置'}${target.declared ? ''
25
25
  : ` · 声明已删除;aw command package remove ${target.packageId} --yes`}`,
26
26
  }));
27
27
  }
28
- function managedCommandPlanChanges(evidence) {
28
+ export function managedCommandPlanChanges(actions) {
29
29
  const changes = [];
30
30
  const producers = new Map();
31
31
  const retained = new Set();
32
- for (const action of evidence?.operationPlan?.actions ?? []) {
32
+ for (const action of actions) {
33
33
  for (const change of action.nativeToolChanges ?? []) {
34
34
  const pluginId = `${change.producer.sourceId}/${change.producer.pluginName}`;
35
35
  for (const [kind, closure] of [['remove', change.before], ['add', change.after]]) {
@@ -46,7 +46,7 @@ function managedCommandPlanChanges(evidence) {
46
46
  retained.add(action.packageId);
47
47
  changes.push({ kind: 'keep', group: 'preserved', pluginId: action.pluginId,
48
48
  title: `保留命令包 ${action.producer.key}`,
49
- description: `${action.packageId} · ${scopeLabel(action.producer.scope)} · ${action.producer.scope === 'user' ? '所有项目共用' : '当前项目内共用'} · ${action.commandIds.length} 个命令 · ${action.availability} · ${action.recoveryAction}` });
49
+ description: `${action.producer.sourceId}/${action.producer.pluginName} · ${action.packageId} · ${scopeLabel(action.producer.scope)} · ${action.producer.scope === 'user' ? '所有项目共用' : '当前项目内共用'} · ${action.commandIds.length} 个命令 · ${action.availability} · ${action.recoveryAction}` });
50
50
  }
51
51
  else if (action.kind === 'syncManagedCommandPackage') {
52
52
  producers.set(getCommandPackageId(action.producer), { schemaVersion: 1, producer: action.producer, sets: action.sets, ...(action.nativeTools ? { nativeTools: action.nativeTools } : {}) });
@@ -131,7 +131,7 @@ function preApplyScopeChanges(targets) {
131
131
  pluginId: target.pluginId,
132
132
  ...(target.relation ? { relation: target.relation } : {}),
133
133
  title: `运行 ${target.pluginId} preApply`,
134
- description: `${platformLabel(target.platform)} · ${scopeLabel(target.scope)}`,
134
+ description: `${agentLabel(target.platform)} · ${scopeLabel(target.scope)}`,
135
135
  }));
136
136
  }
137
137
  function operationPreApplyTargets(evidence) {
@@ -150,16 +150,10 @@ function offlineCleanupPlans(evidence) {
150
150
  return evidence.offlineCleanupPlans
151
151
  ?? (evidence.offlineCleanup ? [evidence.offlineCleanup] : []);
152
152
  }
153
- function removesOfflineCleanupIntent(plan, target) {
154
- return plan.changes.includes(`${target.pluginId}:${target.platform}:${target.scope}:removeIntent`);
155
- }
156
153
  function offlineCleanupReviewChanges(evidence) {
157
- const operationPlan = evidence.operationPlan;
158
- const removed = new Set(evidence.removedPluginCleanupIds ?? []);
159
- const plans = offlineCleanupPlans(evidence).filter((target) => !removed.has(target.pluginId));
154
+ const plans = offlineCleanupPlans(evidence);
160
155
  return plans.flatMap((target) => {
161
156
  const targetDescription = `${platformLabel(target.platform)} · ${scopeLabel(target.scope)}`;
162
- const removesIntent = operationPlan !== undefined && removesOfflineCleanupIntent(operationPlan, target);
163
157
  const actions = target.plan.actions.length;
164
158
  return [
165
159
  {
@@ -170,14 +164,6 @@ function offlineCleanupReviewChanges(evidence) {
170
164
  title: '核验当前 AW 管理现场',
171
165
  description: targetDescription,
172
166
  },
173
- ...(removesIntent ? [{
174
- kind: 'remove',
175
- group: 'requested',
176
- pluginId: target.pluginId,
177
- relation: 'requested',
178
- title: '取消已保存的使用设置',
179
- description: targetDescription,
180
- }] : []),
181
167
  actions > 0 ? {
182
168
  kind: 'remove',
183
169
  group: 'requested',
@@ -191,16 +177,13 @@ function offlineCleanupReviewChanges(evidence) {
191
177
  pluginId: target.pluginId,
192
178
  relation: 'requested',
193
179
  title: '没有可验证的 AW 输出',
194
- description: removesIntent
195
- ? `${targetDescription} · 仍会取消此位置的使用设置`
196
- : `${targetDescription} · 不会删除现场内容`,
180
+ description: `${targetDescription} · 不会删除现场内容`,
197
181
  },
198
182
  ];
199
183
  });
200
184
  }
201
185
  function offlineCleanupPreservedChanges(evidence) {
202
- const removed = new Set(evidence.removedPluginCleanupIds ?? []);
203
- const plans = offlineCleanupPlans(evidence).filter((target) => !removed.has(target.pluginId));
186
+ const plans = offlineCleanupPlans(evidence);
204
187
  if (plans.length === 0)
205
188
  return [];
206
189
  const warnings = evidence.operationPlan?.warnings ?? [];
@@ -223,30 +206,6 @@ function offlineCleanupPreservedChanges(evidence) {
223
206
  },
224
207
  ];
225
208
  }
226
- function removedPluginCleanupReviewChanges(evidence) {
227
- return (evidence.removedPluginCleanupIds ?? []).flatMap((pluginId) => [
228
- {
229
- kind: 'remove', group: 'requested', pluginId, relation: 'requested',
230
- title: `${pluginNameFromId(pluginId)} · 已从当前目录删除`,
231
- description: '整体清理 Codex、Claude Code 的用户与当前项目位置;即使初始选择只有一个平台或范围。',
232
- },
233
- ...['codex', 'claude'].flatMap((platform) => ['user', 'project'].map((scope) => ({
234
- kind: 'remove', group: 'requested', pluginId, relation: 'requested',
235
- title: `${platformLabel(platform)} · ${scopeLabel(scope)}`,
236
- description: '清理安装、激活、使用意图及可验证的专属输出。',
237
- }))),
238
- {
239
- kind: 'remove', group: 'requested', pluginId, relation: 'requested',
240
- title: '删除已保存的插件设置',
241
- description: '删除用户与当前项目的插件设置记录;不读取已删除的配置 schema。',
242
- },
243
- {
244
- kind: 'warning', group: 'requested', pluginId, relation: 'requested',
245
- title: '移除 Codex 共享原生安装会影响其他项目',
246
- description: '其他项目可能无法继续使用此插件;不会扫描或改写它们的本地记录。',
247
- },
248
- ]);
249
- }
250
209
  function sourceMutationReviewChanges(mutation) {
251
210
  if (mutation.action === 'add') {
252
211
  const source = mutation.source;
@@ -357,14 +316,6 @@ function operationLabels(intent, evidence) {
357
316
  };
358
317
  }
359
318
  if (intent.kind === 'pluginWrite') {
360
- if (intent.action === 'cleanup' && (evidence?.removedPluginCleanupIds?.length ?? 0) > 0) {
361
- return {
362
- title: '整体清理已删除插件',
363
- description: '清理两个平台的用户与当前项目位置、保存设置及共享原生安装。',
364
- primaryLabel: '确认整体清理',
365
- destructive: true,
366
- };
367
- }
368
319
  if (intent.originIssue) {
369
320
  if (intent.action === 'cleanup') {
370
321
  return {
@@ -410,17 +361,17 @@ function operationLabels(intent, evidence) {
410
361
  if (intent.kind === 'configSave') {
411
362
  if (intent.retryApply) {
412
363
  return {
413
- title: '重试应用插件设置',
414
- description: '重新读取当前设置和安装证据;不会恢复或重写历史值。',
415
- primaryLabel: '重试应用',
364
+ title: '更新已有插件内容',
365
+ description: `使用已保存的用户配置,刷新${intent.context === 'project' ? '用户和当前项目' : '用户'}范围内已有的插件内容。`,
366
+ primaryLabel: '更新插件',
416
367
  destructive: false,
417
368
  };
418
369
  }
419
370
  return {
420
371
  title: intent.apply ? '保存并应用插件设置' : '保存插件设置',
421
372
  description: intent.apply
422
- ? '保存所选设置层,并重新应用可见安装。'
423
- : '只保存所选设置层;当前安装保持不变。',
373
+ ? '保存所选用户配置,并更新已有插件内容。'
374
+ : '保存所选用户配置。',
424
375
  primaryLabel: intent.apply ? '保存并应用' : '保存',
425
376
  destructive: false,
426
377
  };
@@ -429,8 +380,8 @@ function operationLabels(intent, evidence) {
429
380
  return {
430
381
  title: '确认保存设置',
431
382
  description: intent.apply
432
- ? '按当前项目、个人默认的顺序保存设置,并应用实际受影响的安装位置。'
433
- : '按当前项目、个人默认的顺序保存设置。',
383
+ ? '保存所选公共和平台配置,并更新已有插件内容。'
384
+ : '保存所选公共和平台配置。',
434
385
  primaryLabel: intent.apply ? '保存并应用设置' : '保存设置',
435
386
  destructive: false,
436
387
  };
@@ -554,7 +505,7 @@ function reviewChanges(intent, evidence, dependencyOverview) {
554
505
  const desiredIntentKind = requestedIntentAction(intent.action === 'refreshAndSync' ? 'sync' : intent.action);
555
506
  const runtimeChanges = [
556
507
  ...scriptTimeoutChanges(intent),
557
- ...managedCommandPlanChanges(evidence),
508
+ ...managedCommandPlanChanges(evidence?.operationPlan?.actions ?? []),
558
509
  ...preApplyScopeChanges(operationPreApplyTargets(evidence)),
559
510
  ...(evidence?.codexManager
560
511
  ? [{
@@ -636,10 +587,9 @@ function reviewChanges(intent, evidence, dependencyOverview) {
636
587
  }
637
588
  if (intent.action === 'cleanup' && evidence) {
638
589
  const cleanupChanges = offlineCleanupReviewChanges(evidence);
639
- if (cleanupChanges.length > 0 || (evidence.removedPluginCleanupIds?.length ?? 0) > 0) {
590
+ if (cleanupChanges.length > 0) {
640
591
  const changes = [
641
592
  ...cleanupChanges,
642
- ...removedPluginCleanupReviewChanges(evidence),
643
593
  ...offlineCleanupPreservedChanges(evidence),
644
594
  ];
645
595
  if (intent.force === true)
@@ -695,9 +645,8 @@ function reviewChanges(intent, evidence, dependencyOverview) {
695
645
  return [...changes, ...codexChanges, ...runtimeChanges];
696
646
  }
697
647
  if (intent.kind === 'configReset') {
698
- const layerLabel = intent.scope === 'user'
699
- ? '个人默认'
700
- : '当前项目';
648
+ const layerLabel = intent.expectedStoreState === 'invalid' ? '无效用户配置文档'
649
+ : intent.platform ? `${agentLabel(intent.platform)} 平台配置` : '公共配置';
701
650
  const impact = evidence?.config;
702
651
  const impactChanges = impact?.impactState === 'unknown'
703
652
  ? [{
@@ -709,7 +658,7 @@ function reviewChanges(intent, evidence, dependencyOverview) {
709
658
  : (impact?.affectedTargets ?? []).length > 0
710
659
  ? impact.affectedTargets.map((target) => ({
711
660
  kind: 'warning', group: 'configImpact',
712
- title: `重置后需同步 ${target.platform === 'codex' ? 'Codex' : 'Claude Code'} · ${target.scope === 'user' ? '所有项目' : '当前项目'}`,
661
+ title: `重置后需同步 ${agentLabel(target.platform)} · ${scopeLabel(target.scope)}`,
713
662
  }))
714
663
  : [{ kind: 'keep', group: 'configImpact', title: '只删除设置层;当前安装保持不变' }];
715
664
  return [
@@ -721,7 +670,8 @@ function reviewChanges(intent, evidence, dependencyOverview) {
721
670
  })) ?? [{ kind: 'remove', group: 'configChanges', title: `删除${layerLabel}中的已存值`, description: '删除整个设置层且不创建备份;有效值将恢复为继承值或默认值。' }]),
722
671
  ...impactChanges,
723
672
  ...configCommandPackageChanges(evidence, false),
724
- { kind: 'keep', group: 'preserved', title: intent.scope === 'user' ? '当前项目设置保持不变' : '个人默认保持不变' },
673
+ ...(intent.expectedStoreState === 'invalid' ? []
674
+ : [{ kind: 'keep', group: 'preserved', title: '其他公共和平台配置保持不变' }]),
725
675
  ];
726
676
  }
727
677
  if (intent.kind === 'sourceMutation') {
@@ -842,14 +792,14 @@ function reviewChanges(intent, evidence, dependencyOverview) {
842
792
  return [
843
793
  ...scriptTimeoutChanges(intent),
844
794
  ...intent.groups.flatMap((group) => {
845
- const groupEvidence = evidence.configBatch.groups.find((item) => item.scope === group.scope);
795
+ const groupEvidence = evidence.configBatch.groups.find((item) => item.platform === group.platform);
846
796
  if (!groupEvidence) {
847
797
  throw plannerError('configBatchPrepareFailed', '设置层 Review 证据不完整。');
848
798
  }
849
799
  return reviewChanges({
850
800
  kind: 'configSave',
851
801
  pluginId: intent.pluginId,
852
- scope: group.scope,
802
+ scope: 'user', platform: group.platform, context: intent.context ?? 'user',
853
803
  apply: intent.apply,
854
804
  ...(group.updates ? { updates: group.updates } : {}),
855
805
  ...(group.removeKeys ? { removeKeys: group.removeKeys } : {}),
@@ -870,22 +820,27 @@ function reviewChanges(intent, evidence, dependencyOverview) {
870
820
  }
871
821
  const privateKeys = new Set([...(intent.sensitiveKeys ?? []), ...(intent.privateKeys ?? [])]);
872
822
  const removeKeys = new Set(intent.removeKeys ?? []);
873
- const layerLabel = intent.scope === 'user' ? '个人默认' : '当前项目';
823
+ const layerLabel = intent.platform ? `${agentLabel(intent.platform)} 平台配置` : '公共配置';
874
824
  if (intent.retryApply) {
875
825
  return [
876
826
  ...scriptTimeoutChanges(intent),
877
827
  ...preApplyScopeChanges(evidence?.config?.preApplyAuthorization ?? []),
878
828
  ...configCommandPackageChanges(evidence, true),
829
+ ...(evidence?.config?.applyChanges ?? []).map((title) => ({ kind: 'change', group: 'configImpact', title })),
830
+ ...(evidence?.config?.applyWarnings ?? []).map((title) => ({ kind: 'warning', group: 'configImpact', title })),
831
+ ...(evidence?.config?.applyBlockers ?? []).map((item) => ({
832
+ kind: 'warning', group: 'configImpact', title: item.code, description: item.message,
833
+ })),
879
834
  ...(evidence?.config?.sharedNativeRenderTargets ?? []).filter((shared) => evidence?.config?.affectedTargets
880
835
  .some((target) => (!shared.pluginName || shared.pluginName === target.pluginName)
881
836
  && target.platform === (shared.platform ?? 'codex'))).map((shared) => ({
882
837
  kind: 'change', group: 'configImpact', title: `重新生成 ${shared.skillKey} 原生 Skill`,
883
- description: `配置来源为个人默认;更新 ${platformLabel(shared.platform ?? 'codex')} 由平台共用的内容会影响所有启用项目。`,
838
+ description: `配置来源为用户配置;更新 ${platformLabel(shared.platform ?? 'codex')} 由平台共用的内容会影响所有启用项目。`,
884
839
  })),
885
840
  ...(evidence?.config?.affectedTargets.map((target) => ({
886
841
  kind: 'change',
887
842
  group: 'configImpact',
888
- title: `重新应用 ${target.pluginName ? `${target.pluginName} · ` : ''}${target.platform === 'codex' ? 'Codex' : 'Claude Code'} · ${target.scope === 'user' ? '所有项目' : '当前项目'}`,
843
+ title: `重新应用 ${target.pluginName ? `${target.pluginName} · ` : ''}${agentLabel(target.platform)} · ${scopeLabel(target.scope)}`,
889
844
  })) ?? []),
890
845
  { kind: 'keep', group: 'preserved', title: `${layerLabel}中的当前值保持不变` },
891
846
  { kind: 'keep', group: 'preserved', title: '不会恢复历史设置值' },
@@ -898,8 +853,6 @@ function reviewChanges(intent, evidence, dependencyOverview) {
898
853
  const sharedPlatforms = [...new Set(sharedNativeTargets.map((target) => target.platform ?? 'codex'))];
899
854
  const sharedPlatformLabel = sharedPlatforms.map(platformLabel).join('、');
900
855
  const sharedSkillLabel = sharedPlatforms.includes('claude') ? '原生 Skill' : '动态 Skill';
901
- const sharedCodexRole = sharedPlatforms.includes('codex')
902
- ? [{ kind: 'keep', group: 'preserved', title: '当前项目 Agent role 继续使用当前项目配置' }] : [];
903
856
  const sharedNativeImpact = noEffectiveChange || sharedNativeTargets.length === 0
904
857
  ? []
905
858
  : intent.apply
@@ -907,29 +860,21 @@ function reviewChanges(intent, evidence, dependencyOverview) {
907
860
  {
908
861
  kind: 'change', group: 'configImpact',
909
862
  title: `重新生成 ${sharedNativeTargets.map((target) => target.skillKey).join('、')} ${sharedSkillLabel}`,
910
- description: `配置来源为个人默认;更新 ${sharedPlatformLabel} 由平台共用的内容会影响所有启用项目。`,
863
+ description: `配置来源为用户配置;更新 ${sharedPlatformLabel} 由平台共用的内容会影响所有启用项目。`,
911
864
  },
912
865
  { kind: 'keep', group: 'preserved', title: '保留所有项目和当前项目的启用位置' },
913
- ...sharedCodexRole,
914
866
  ]
915
867
  : [
916
868
  {
917
869
  kind: 'warning', group: 'configImpact',
918
870
  title: `${sharedPlatformLabel} 由平台共用的内容待同步`,
919
- description: `个人默认已保存;${sharedSkillLabel} 尚未重新生成。`,
871
+ description: `用户配置已保存;${sharedSkillLabel} 尚未重新生成。`,
920
872
  },
921
873
  { kind: 'keep', group: 'preserved', title: '当前由平台共用的内容和启用位置保持不变' },
922
- ...sharedCodexRole,
923
874
  ];
924
875
  return [
925
876
  ...scriptTimeoutChanges(intent),
926
877
  ...preApplyScopeChanges(evidence?.config?.preApplyAuthorization ?? []),
927
- ...(evidence?.config?.shareability === 'unverified' ? [{
928
- kind: 'warning',
929
- group: 'configImpact',
930
- title: 'Git 无法验证 project config 可共享',
931
- description: '可以继续写入,但不要将该路径视为已验证可提交。',
932
- }] : []),
933
878
  ...intent.changes.map((change) => ({
934
879
  kind: removeKeys.has(change.key) ? 'remove' : 'change',
935
880
  group: 'configChanges',
@@ -957,11 +902,11 @@ function reviewChanges(intent, evidence, dependencyOverview) {
957
902
  ? []
958
903
  : intent.apply && (evidence?.config?.affectedTargets.length ?? 0) > 0
959
904
  ? evidence.config.affectedTargets.map((target) => ({
960
- kind: 'change', group: 'configImpact', title: `重新应用 ${target.pluginName ? `${target.pluginName} · ` : ''}${target.platform === 'codex' ? 'Codex' : 'Claude Code'} · ${target.scope === 'user' ? '所有项目' : '当前项目'}`,
905
+ kind: 'change', group: 'configImpact', title: `重新应用 ${target.pluginName ? `${target.pluginName} · ` : ''}${agentLabel(target.platform)} · ${scopeLabel(target.scope)}`,
961
906
  }))
962
907
  : !intent.apply && (evidence?.config?.affectedTargets.length ?? 0) > 0
963
908
  ? evidence.config.affectedTargets.map((target) => ({
964
- kind: 'warning', group: 'configImpact', title: `保存后需同步 ${target.pluginName ? `${target.pluginName} · ` : ''}${target.platform === 'codex' ? 'Codex' : 'Claude Code'} · ${target.scope === 'user' ? '所有项目' : '当前项目'}`,
909
+ kind: 'warning', group: 'configImpact', title: `保存后需同步 ${target.pluginName ? `${target.pluginName} · ` : ''}${agentLabel(target.platform)} · ${scopeLabel(target.scope)}`,
965
910
  }))
966
911
  : (evidence?.config?.commandPackages?.length ?? 0) > 0 ? []
967
912
  : [{ kind: 'keep', group: 'configImpact', title: '当前没有可见安装;只保存设置' }]),
@@ -991,9 +936,6 @@ function batchGroupEvidence(evidence, group) {
991
936
  ...(group.preview.offlineCleanupPlans
992
937
  ? { offlineCleanupPlans: group.preview.offlineCleanupPlans }
993
938
  : {}),
994
- ...(group.preview.removedPluginCleanupIds
995
- ? { removedPluginCleanupIds: group.preview.removedPluginCleanupIds }
996
- : {}),
997
939
  ...(group.preview.dependencyPlan ? { dependencyPlan: group.preview.dependencyPlan } : {}),
998
940
  ...(group.preview.codexReconcilePlans ? { codexReconcilePlans: group.preview.codexReconcilePlans } : {}),
999
941
  ...(group.preview.operationPlan ? { operationPlan: group.preview.operationPlan } : {}),
@@ -1106,8 +1048,7 @@ function batchReviewChanges(intent, evidence) {
1106
1048
  };
1107
1049
  });
1108
1050
  const selectedTargetChanges = group.preview.targetResults.length === 0
1109
- && (intent.selection.kind === 'targets'
1110
- || intent.selection.kind === 'currentProjectIntentTargets')
1051
+ && intent.selection.kind === 'targets'
1111
1052
  ? intent.selection.targets.filter((target) => target.pluginId.startsWith(`${group.sourceId}/`)
1112
1053
  && target.platform === group.platform
1113
1054
  && target.scope === group.scope).map((target) => ({
@@ -1166,19 +1107,8 @@ function batchReviewChanges(intent, evidence) {
1166
1107
  }] : []),
1167
1108
  ];
1168
1109
  });
1169
- const projectPreApplyCount = intent.action === 'sync'
1170
- && intent.selection.kind === 'currentProjectIntentTargets'
1171
- ? changes.filter((change) => change.title.startsWith('运行 ')
1172
- && change.title.endsWith(' preApply')).length
1173
- : 0;
1174
1110
  return [
1175
1111
  ...scriptTimeoutChanges(intent),
1176
- ...(projectPreApplyCount > 0 ? [{
1177
- kind: 'warning',
1178
- group: 'runtime',
1179
- title: `${projectPreApplyCount} 个当前项目同步目标将运行 preApply`,
1180
- description: '脚本在同步写入前运行;范围只限本次确认的当前项目位置。',
1181
- }] : []),
1182
1112
  ...changes,
1183
1113
  { kind: 'keep', group: 'preserved', title: '插件设置保持不变' },
1184
1114
  ];
@@ -1232,9 +1162,9 @@ function technicalDetails(evidence) {
1232
1162
  if (evidence.dependencyPlan)
1233
1163
  details.push(`安装计划:${evidence.dependencyPlan.resolvedPluginIds.length} 个插件`);
1234
1164
  if (evidence.config)
1235
- details.push(`设置层:${evidence.config.scope} · ${short(evidence.config.storeDigest)}`);
1165
+ details.push(`用户配置:${evidence.config.platform ?? 'common'} · context=${evidence.config.context ?? 'user'} · ${short(evidence.config.storeDigest)}`);
1236
1166
  for (const group of evidence.configBatch?.groups ?? []) {
1237
- details.push(`设置层:${group.scope} · ${short(group.config.storeDigest)}`);
1167
+ details.push(`用户配置:${group.platform ?? 'common'} · context=${group.config.context ?? 'user'} · ${short(group.config.storeDigest)}`);
1238
1168
  }
1239
1169
  if (evidence.sourceWrite) {
1240
1170
  details.push(`新配置:${short(evidence.sourceWrite.proposedConfigDigest)}`);
@@ -1308,10 +1238,6 @@ export function buildOperationReviewProjection(options) {
1308
1238
  ? evidence.configBatch?.groups.some((group) => (group.config.preApplyAuthorization?.length ?? 0) > 0) === true
1309
1239
  : operationPreApplyTargets(evidence).length > 0
1310
1240
  || (evidence.config?.preApplyAuthorization?.length ?? 0) > 0;
1311
- const projectPreApplyConfirmation = hasPreApply
1312
- && intent.kind === 'pluginWriteBatch'
1313
- && intent.action === 'sync'
1314
- && intent.selection.kind === 'currentProjectIntentTargets';
1315
1241
  const sharedNativeConfigApply = (intent.kind === 'configSave'
1316
1242
  && intent.apply
1317
1243
  && (evidence.config?.sharedNativeRenderTargets?.some((shared) => evidence.config?.affectedTargets
@@ -1322,14 +1248,11 @@ export function buildOperationReviewProjection(options) {
1322
1248
  && (evidence.configBatch?.groups.some((group) => group.config.sharedNativeRenderTargets?.some((shared) => group.config.affectedTargets
1323
1249
  .some((target) => (!shared.pluginName || shared.pluginName === target.pluginName)
1324
1250
  && target.platform === (shared.platform ?? 'codex')))) ?? false));
1325
- const requiresConfirmation = projectPreApplyConfirmation
1326
- || sharedNativeConfigApply
1251
+ const requiresConfirmation = sharedNativeConfigApply
1327
1252
  || intent.kind === 'catalogStorePrune'
1328
1253
  || Boolean(batchEvidence?.groups.some((group) => (group.preview.codexReconcilePlans ?? []).some((plan) => plan.review.requiresConfirmation)))
1329
1254
  || Boolean(taskEvidence?.taskPlan.sources.some((source) => (source.preview.codexReconcilePlans ?? []).some((plan) => plan.review.requiresConfirmation)))
1330
1255
  || (evidence.codexReconcilePlans ?? []).some((plan) => plan.review.requiresConfirmation)
1331
- || (evidence.removedPluginCleanupIds?.length ?? 0) > 0
1332
- || Boolean(batchEvidence?.groups.some((group) => (group.preview.removedPluginCleanupIds?.length ?? 0) > 0))
1333
1256
  || Boolean(evidence.sourceWrite
1334
1257
  && (!evidence.sourceWrite.inventoryComplete || evidence.sourceWrite.referenceCount > 0))
1335
1258
  || Boolean(evidence.catalogGeneration?.impact
@@ -1349,6 +1272,21 @@ export function buildOperationReviewProjection(options) {
1349
1272
  title: '来源刷新失败;本次使用旧 Active',
1350
1273
  description: '同步可以继续。再次刷新并同步时会重试来源刷新。',
1351
1274
  }));
1275
+ let equivalentCommand;
1276
+ if (intent.kind === 'pluginWrite') {
1277
+ const sync = intent.action === 'sync' || intent.action === 'refreshAndSync' || intent.action === 'reinstall';
1278
+ const action = sync ? 'sync' : intent.action === 'uninstall' ? 'remove' : intent.action;
1279
+ const agents = intent.platform === 'both' ? ['codex', 'claude'] : [intent.platform];
1280
+ const targets = intent.action === 'cleanup' ? agents.map((agent) => ` --target ${agent}`)
1281
+ : [sync ? agents.map((agent) => ` --target ${agent}`).join('') : ''];
1282
+ equivalentCommand = targets.map((target) => `aw plugin ${action} ${intent.pluginId} --${sync ? 'context' : 'scope'} ${intent.scope}${target}`
1283
+ + (intent.action === 'reinstall' ? ' --rebuild' : '')
1284
+ + (intent.action === 'refreshAndSync' ? ' --refresh' : '')
1285
+ + (scriptTimeoutChanges(intent).length > 0 ? ` --script-timeout ${parseScriptTimeoutMs(intent.scriptTimeoutMs ?? SCRIPT_TIMEOUT_DEFAULT_MS)}` : '')
1286
+ + (intent.action === 'cleanup' && intent.force === true ? ' --force' : '')
1287
+ + (evidence.codexManager?.state === 'requires-install' ? ' --allow-managed-codex-install' : '')
1288
+ + (requiresConfirmation || hasPreApply ? ' --yes' : '')).join(' && ');
1289
+ }
1352
1290
  return {
1353
1291
  title: labels.title,
1354
1292
  description: labels.description,
@@ -1361,9 +1299,7 @@ export function buildOperationReviewProjection(options) {
1361
1299
  : reviewChanges(intent, evidence, options.dependencyOverview)),
1362
1300
  ],
1363
1301
  technicalDetails: technicalDetails(evidence),
1364
- ...(intent.kind === 'pluginWrite'
1365
- ? { equivalentCommand: `aw ${intent.action === 'refreshAndSync' ? 'sync' : intent.action} ${intent.pluginId} --platform ${intent.platform} --scope ${intent.scope}${intent.action === 'refreshAndSync' ? ' --refresh' : ''}${scriptTimeoutChanges(intent).length > 0 ? ` --script-timeout ${parseScriptTimeoutMs(intent.scriptTimeoutMs ?? SCRIPT_TIMEOUT_DEFAULT_MS)}` : ''}${(intent.dependencyScopeOverrides ?? []).map((override) => ` --dependency-scope ${override.pluginId}#${override.platform}=${override.scope}`).join('')}${intent.action === 'cleanup' && intent.force === true ? ' --force' : ''}${evidence.codexManager?.state === 'requires-install' ? ' --allow-managed-codex-install' : ''}${requiresConfirmation || hasPreApply ? ' --yes' : ''}` }
1366
- : {}),
1302
+ ...(equivalentCommand ? { equivalentCommand } : {}),
1367
1303
  primaryLabel: intent.kind === 'pluginWriteBatch'
1368
1304
  ? `${labels.primaryLabel} ${batchEvidence.requestedPluginIds.length} 个插件`
1369
1305
  : intent.kind === 'pluginWriteTask'