@lesliechan721/aw 0.1.0-beta.83 → 0.1.0-beta.85

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 (250) hide show
  1. package/dist/authoring/assets/aw-runtime-config.mjs +1 -1
  2. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
  3. package/dist/index.js +2 -6
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/commands/console.js +1 -0
  6. package/dist/src/commands/console.js.map +1 -1
  7. package/dist/src/commands/intent-command.d.ts +1 -0
  8. package/dist/src/commands/intent-command.js +6 -2
  9. package/dist/src/commands/intent-command.js.map +1 -1
  10. package/dist/src/commands/plugin-capabilities.js +3 -3
  11. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  12. package/dist/src/commands/public-lifecycle-result.d.ts +14 -13
  13. package/dist/src/commands/public-lifecycle-result.js +204 -64
  14. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  15. package/dist/src/commands/public-lifecycle.d.ts +1 -2
  16. package/dist/src/commands/public-lifecycle.js +56 -34
  17. package/dist/src/commands/public-lifecycle.js.map +1 -1
  18. package/dist/src/commands/public-plugin-query.js +44 -11
  19. package/dist/src/commands/public-plugin-query.js.map +1 -1
  20. package/dist/src/commands/rebuild-command.d.ts +13 -3
  21. package/dist/src/commands/rebuild-command.js +665 -288
  22. package/dist/src/commands/rebuild-command.js.map +1 -1
  23. package/dist/src/commands/rebuild-integration.d.ts +6 -2
  24. package/dist/src/commands/rebuild-integration.js +60 -29
  25. package/dist/src/commands/rebuild-integration.js.map +1 -1
  26. package/dist/src/commands/rebuild-operations.d.ts +1 -0
  27. package/dist/src/commands/rebuild-operations.js +28 -6
  28. package/dist/src/commands/rebuild-operations.js.map +1 -1
  29. package/dist/src/commands/rebuild-platform-integration.d.ts +20 -5
  30. package/dist/src/commands/rebuild-platform-integration.js +752 -182
  31. package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
  32. package/dist/src/generators/permissions.d.ts +7 -1
  33. package/dist/src/generators/permissions.js +56 -0
  34. package/dist/src/generators/permissions.js.map +1 -1
  35. package/dist/src/index.d.ts +1 -0
  36. package/dist/src/index.js +112 -54
  37. package/dist/src/index.js.map +1 -1
  38. package/dist/src/intent/scope-context.d.ts +4 -2
  39. package/dist/src/intent/scope-context.js +37 -7
  40. package/dist/src/intent/scope-context.js.map +1 -1
  41. package/dist/src/output/component-delivery.d.ts +21 -0
  42. package/dist/src/output/component-delivery.js +82 -0
  43. package/dist/src/output/component-delivery.js.map +1 -0
  44. package/dist/src/output/public-result.d.ts +4 -0
  45. package/dist/src/output/public-result.js +85 -15
  46. package/dist/src/output/public-result.js.map +1 -1
  47. package/dist/src/output/rebuild-progress.d.ts +3 -0
  48. package/dist/src/output/rebuild-progress.js +12 -2
  49. package/dist/src/output/rebuild-progress.js.map +1 -1
  50. package/dist/src/output/receipt-projection.js +64 -19
  51. package/dist/src/output/receipt-projection.js.map +1 -1
  52. package/dist/src/output/skill-invocation-notices.d.ts +18 -0
  53. package/dist/src/output/skill-invocation-notices.js +84 -0
  54. package/dist/src/output/skill-invocation-notices.js.map +1 -0
  55. package/dist/src/platforms/capabilities.d.ts +6 -1
  56. package/dist/src/platforms/capabilities.js +161 -38
  57. package/dist/src/platforms/capabilities.js.map +1 -1
  58. package/dist/src/platforms/contracts.d.ts +45 -10
  59. package/dist/src/platforms/discovery.d.ts +11 -7
  60. package/dist/src/platforms/discovery.js +176 -76
  61. package/dist/src/platforms/discovery.js.map +1 -1
  62. package/dist/src/platforms/inspection-grok.js +121 -9
  63. package/dist/src/platforms/inspection-grok.js.map +1 -1
  64. package/dist/src/platforms/inspection-native.js +53 -97
  65. package/dist/src/platforms/inspection-native.js.map +1 -1
  66. package/dist/src/platforms/inspection-pi.d.ts +7 -1
  67. package/dist/src/platforms/inspection-pi.js +295 -95
  68. package/dist/src/platforms/inspection-pi.js.map +1 -1
  69. package/dist/src/platforms/inspection-query.d.ts +6 -5
  70. package/dist/src/platforms/inspection-query.js +30 -25
  71. package/dist/src/platforms/inspection-query.js.map +1 -1
  72. package/dist/src/platforms/inspection.d.ts +4 -1
  73. package/dist/src/platforms/inspection.js +38 -6
  74. package/dist/src/platforms/inspection.js.map +1 -1
  75. package/dist/src/platforms/layout.d.ts +6 -0
  76. package/dist/src/platforms/layout.js +45 -12
  77. package/dist/src/platforms/layout.js.map +1 -1
  78. package/dist/src/platforms/lifecycle-native-services.d.ts +1 -1
  79. package/dist/src/platforms/lifecycle-native-services.js +14 -14
  80. package/dist/src/platforms/lifecycle-native-services.js.map +1 -1
  81. package/dist/src/platforms/lifecycle-native.d.ts +1 -0
  82. package/dist/src/platforms/lifecycle-native.js +29 -89
  83. package/dist/src/platforms/lifecycle-native.js.map +1 -1
  84. package/dist/src/platforms/lifecycle.d.ts +2 -0
  85. package/dist/src/platforms/lifecycle.js +120 -69
  86. package/dist/src/platforms/lifecycle.js.map +1 -1
  87. package/dist/src/platforms/projection-code-extension.js +9 -4
  88. package/dist/src/platforms/projection-code-extension.js.map +1 -1
  89. package/dist/src/platforms/projection.d.ts +3 -0
  90. package/dist/src/platforms/projection.js +152 -72
  91. package/dist/src/platforms/projection.js.map +1 -1
  92. package/dist/src/platforms/supplement-layout.d.ts +5 -1
  93. package/dist/src/platforms/supplement-layout.js +23 -1
  94. package/dist/src/platforms/supplement-layout.js.map +1 -1
  95. package/dist/src/platforms/supplement-state.d.ts +1 -1
  96. package/dist/src/platforms/supplement-state.js +18 -7
  97. package/dist/src/platforms/supplement-state.js.map +1 -1
  98. package/dist/src/portable/commands.js +1 -1
  99. package/dist/src/portable/commands.js.map +1 -1
  100. package/dist/src/portable/materializer.d.ts +4 -0
  101. package/dist/src/portable/materializer.js +9 -2
  102. package/dist/src/portable/materializer.js.map +1 -1
  103. package/dist/src/portable/recovery.d.ts +31 -3
  104. package/dist/src/portable/recovery.js +261 -82
  105. package/dist/src/portable/recovery.js.map +1 -1
  106. package/dist/src/recovery/coordinator.d.ts +19 -5
  107. package/dist/src/recovery/coordinator.js +433 -174
  108. package/dist/src/recovery/coordinator.js.map +1 -1
  109. package/dist/src/recovery/install-concurrency.d.ts +48 -0
  110. package/dist/src/recovery/install-concurrency.js +196 -0
  111. package/dist/src/recovery/install-concurrency.js.map +1 -0
  112. package/dist/src/recovery/interruption.d.ts +19 -0
  113. package/dist/src/recovery/interruption.js +43 -0
  114. package/dist/src/recovery/interruption.js.map +1 -0
  115. package/dist/src/recovery/joint-coordinator.d.ts +18 -4
  116. package/dist/src/recovery/joint-coordinator.js +829 -341
  117. package/dist/src/recovery/joint-coordinator.js.map +1 -1
  118. package/dist/src/recovery/joint-demand.d.ts +22 -2
  119. package/dist/src/recovery/joint-demand.js +104 -6
  120. package/dist/src/recovery/joint-demand.js.map +1 -1
  121. package/dist/src/recovery/joint-install-execution.d.ts +19 -0
  122. package/dist/src/recovery/joint-install-execution.js +307 -0
  123. package/dist/src/recovery/joint-install-execution.js.map +1 -0
  124. package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
  125. package/dist/src/recovery/joint-install-native-rebase.js +67 -0
  126. package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
  127. package/dist/src/recovery/receipt.d.ts +35 -4
  128. package/dist/src/recovery/receipt.js +90 -1
  129. package/dist/src/recovery/receipt.js.map +1 -1
  130. package/dist/src/recovery/retirement.js +1 -1
  131. package/dist/src/recovery/retirement.js.map +1 -1
  132. package/dist/src/recovery/status.d.ts +20 -8
  133. package/dist/src/recovery/status.js +405 -116
  134. package/dist/src/recovery/status.js.map +1 -1
  135. package/dist/src/review/platform-profile.d.ts +4 -1
  136. package/dist/src/review/platform-profile.js +14 -4
  137. package/dist/src/review/platform-profile.js.map +1 -1
  138. package/dist/src/review/skill-materialization.d.ts +2 -0
  139. package/dist/src/review/skill-materialization.js +68 -50
  140. package/dist/src/review/skill-materialization.js.map +1 -1
  141. package/dist/src/review/source-binding.js +11 -5
  142. package/dist/src/review/source-binding.js.map +1 -1
  143. package/dist/src/tui/console-app-v4.d.ts +1 -1
  144. package/dist/src/tui/console-app-v4.js +180 -63
  145. package/dist/src/tui/console-app-v4.js.map +1 -1
  146. package/dist/src/tui/controller-runtime.js +46 -10
  147. package/dist/src/tui/controller-runtime.js.map +1 -1
  148. package/dist/src/tui/controller.d.ts +15 -5
  149. package/dist/src/tui/controller.js +246 -102
  150. package/dist/src/tui/controller.js.map +1 -1
  151. package/dist/src/tui/deployment-view.d.ts +6 -3
  152. package/dist/src/tui/deployment-view.js +43 -9
  153. package/dist/src/tui/deployment-view.js.map +1 -1
  154. package/dist/src/tui/diagnostic-projection.d.ts +11 -3
  155. package/dist/src/tui/diagnostic-projection.js +85 -4
  156. package/dist/src/tui/diagnostic-projection.js.map +1 -1
  157. package/dist/src/tui/entity-cards.d.ts +2 -1
  158. package/dist/src/tui/entity-cards.js +34 -11
  159. package/dist/src/tui/entity-cards.js.map +1 -1
  160. package/dist/src/tui/glossary.js +5 -0
  161. package/dist/src/tui/glossary.js.map +1 -1
  162. package/dist/src/tui/model.js +2 -1
  163. package/dist/src/tui/model.js.map +1 -1
  164. package/dist/src/tui/operation-diagnostic-screens.d.ts +1 -1
  165. package/dist/src/tui/operation-diagnostic-screens.js +6 -2
  166. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  167. package/dist/src/tui/operation-history.d.ts +12 -3
  168. package/dist/src/tui/operation-history.js +34 -3
  169. package/dist/src/tui/operation-history.js.map +1 -1
  170. package/dist/src/tui/plugin-detail.d.ts +4 -1
  171. package/dist/src/tui/plugin-detail.js +9 -2
  172. package/dist/src/tui/plugin-detail.js.map +1 -1
  173. package/dist/src/tui/scoped-flow.d.ts +3 -1
  174. package/dist/src/tui/scoped-flow.js +117 -1
  175. package/dist/src/tui/scoped-flow.js.map +1 -1
  176. package/dist/src/tui/scoped-inventory.d.ts +6 -2
  177. package/dist/src/tui/scoped-inventory.js +29 -7
  178. package/dist/src/tui/scoped-inventory.js.map +1 -1
  179. package/dist/src/tui/session-console-app.d.ts +2 -0
  180. package/dist/src/tui/session-console-app.js +11 -0
  181. package/dist/src/tui/session-console-app.js.map +1 -1
  182. package/dist/src/types.d.ts +10 -2
  183. package/dist/src/types.js.map +1 -1
  184. package/dist/src/utils/artifact-plan.js +5 -1
  185. package/dist/src/utils/artifact-plan.js.map +1 -1
  186. package/dist/src/utils/artifact-renderer.d.ts +1 -1
  187. package/dist/src/utils/artifact-renderer.js +29 -8
  188. package/dist/src/utils/artifact-renderer.js.map +1 -1
  189. package/dist/src/utils/aw-home-mutation-lock.js +2 -1
  190. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
  191. package/dist/src/utils/catalog-source-references.js +14 -17
  192. package/dist/src/utils/catalog-source-references.js.map +1 -1
  193. package/dist/src/utils/codex-native-observation.d.ts +6 -0
  194. package/dist/src/utils/codex-native-observation.js +32 -3
  195. package/dist/src/utils/codex-native-observation.js.map +1 -1
  196. package/dist/src/utils/component-command-preparation.d.ts +2 -0
  197. package/dist/src/utils/component-command-preparation.js +23 -4
  198. package/dist/src/utils/component-command-preparation.js.map +1 -1
  199. package/dist/src/utils/component-gap.d.ts +4 -0
  200. package/dist/src/utils/component-gap.js +20 -0
  201. package/dist/src/utils/component-gap.js.map +1 -0
  202. package/dist/src/utils/component-resources.js +2 -4
  203. package/dist/src/utils/component-resources.js.map +1 -1
  204. package/dist/src/utils/dynamic-skill-tree.js +2 -32
  205. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  206. package/dist/src/utils/managed-command-materialization.d.ts +2 -1
  207. package/dist/src/utils/managed-command-materialization.js +3 -3
  208. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  209. package/dist/src/utils/managed-command-store.d.ts +6 -0
  210. package/dist/src/utils/managed-command-store.js +90 -18
  211. package/dist/src/utils/managed-command-store.js.map +1 -1
  212. package/dist/src/utils/multi-source-catalog.d.ts +2 -0
  213. package/dist/src/utils/multi-source-catalog.js +3 -2
  214. package/dist/src/utils/multi-source-catalog.js.map +1 -1
  215. package/dist/src/utils/native-cli-interruption.d.ts +8 -0
  216. package/dist/src/utils/native-cli-interruption.js +65 -0
  217. package/dist/src/utils/native-cli-interruption.js.map +1 -0
  218. package/dist/src/utils/native-cli.d.ts +5 -19
  219. package/dist/src/utils/native-cli.js +168 -95
  220. package/dist/src/utils/native-cli.js.map +1 -1
  221. package/dist/src/utils/ownership.d.ts +1 -0
  222. package/dist/src/utils/ownership.js +18 -4
  223. package/dist/src/utils/ownership.js.map +1 -1
  224. package/dist/src/utils/package-content.d.ts +7 -0
  225. package/dist/src/utils/package-content.js +70 -0
  226. package/dist/src/utils/package-content.js.map +1 -0
  227. package/dist/src/utils/platform-empty-state.d.ts +32 -9
  228. package/dist/src/utils/platform-empty-state.js +135 -70
  229. package/dist/src/utils/platform-empty-state.js.map +1 -1
  230. package/dist/src/utils/plugin-config-write.d.ts +8 -0
  231. package/dist/src/utils/plugin-config-write.js +93 -25
  232. package/dist/src/utils/plugin-config-write.js.map +1 -1
  233. package/dist/src/utils/plugin-scripts.js +24 -8
  234. package/dist/src/utils/plugin-scripts.js.map +1 -1
  235. package/dist/src/utils/process-tree.d.ts +1 -1
  236. package/dist/src/utils/process-tree.js +1 -1
  237. package/dist/src/utils/process-tree.js.map +1 -1
  238. package/dist/src/utils/skill-invocation-warning.d.ts +20 -0
  239. package/dist/src/utils/skill-invocation-warning.js +68 -0
  240. package/dist/src/utils/skill-invocation-warning.js.map +1 -0
  241. package/package.json +3 -3
  242. package/dist/src/output/native-consent.d.ts +0 -2
  243. package/dist/src/output/native-consent.js +0 -5
  244. package/dist/src/output/native-consent.js.map +0 -1
  245. package/dist/src/platforms/gemini-activation.d.ts +0 -36
  246. package/dist/src/platforms/gemini-activation.js +0 -331
  247. package/dist/src/platforms/gemini-activation.js.map +0 -1
  248. package/dist/src/platforms/gemini-consent.d.ts +0 -8
  249. package/dist/src/platforms/gemini-consent.js +0 -81
  250. package/dist/src/platforms/gemini-consent.js.map +0 -1
@@ -17,7 +17,7 @@ import { selectLifecycleRetryAction, } from '../commands/operation-planner.js';
17
17
  import { parseScriptTimeoutMs, SCRIPT_TIMEOUT_DEFAULT_MS, SCRIPT_TIMEOUT_MAX_MS, SCRIPT_TIMEOUT_MIN_MS, } from '../commands/options.js';
18
18
  import { projectCatalogSourceLocation } from '../utils/catalog-source-presentation.js';
19
19
  import { ActionRow, AgentStatusText, ConfigTile, configTileHeight, HomeNavTile, KeyCap, ObjectCardFrame, ObjectCardRow, objectCardRowLayout, pluginListRowLayout, StatusBadge, diagnosticDetailLines, diagnosticDetailText, Callout, ChoiceRow, ContentViewport, DiagnosticSummary, InputCard, PluginListRow, ProgressRow, ResultCard, ResultRow, ReviewCard, ReviewChangeRow, ScreenFrame, SectionCard, SectionRow, StaticRow, StatusCard, TaskRow, TechnicalDetails, ToggleRow, } from './components.js';
20
- import { safeDiagnosticCode, sanitizeDiagnosticText, } from './diagnostics.js';
20
+ import { safeDiagnosticCode, sanitizeDiagnosticDetailText, sanitizeDiagnosticText, } from './diagnostics.js';
21
21
  import { extractPortableError, TuiConfigInvalidStoreError, TuiOperationBlockedError, userIssueKey, } from './controller.js';
22
22
  import { pluginWriteTaskVersionEvidence } from './plugin-write-task.js';
23
23
  import { catalogSourceFreshnessLabel, catalogSourceListPresentation, } from './catalog-sources/screens.js';
@@ -27,8 +27,11 @@ import { resolveTuiSizePolicy } from './layout.js';
27
27
  import { buildDependencyGraphProjection, buildUnifiedDependencyGraphProjection, } from './dependency-graph.js';
28
28
  import { DependencyGraphView, projectDependencyGraphView } from './dependency-graph-view.js';
29
29
  import { agentLabel, platformLabel, scopeLabel, recoveryReason } from './glossary.js';
30
- import { deploymentPlanLines, deploymentResultLines, deploymentObservationLines, deploymentExclusionLines, componentGapLines } from './deployment-view.js';
31
- import { projectDeploymentReceipt, projectDeploymentObservation } from '../commands/public-lifecycle-result.js';
30
+ import { skillInvocationNotices, skillInvocationProductLabel } from '../output/skill-invocation-notices.js';
31
+ import { hasComponentDeliveryNotice, isDeliveryNoticeCode, isInstallationAdvisory } from '../output/component-delivery.js';
32
+ import { describeSkillInvocationControl, SKILL_INVOCATION_NOTICE } from '../utils/skill-invocation-warning.js';
33
+ import { deploymentPlanLines, deploymentResultLines, deploymentObservationLines, deploymentExclusionLines, componentDeliveryLines, deliveryNoticeText } from './deployment-view.js';
34
+ import { inventoryRecoveryActions, projectDeploymentNotices, projectDeploymentReceipt, projectDeploymentObservation } from '../commands/public-lifecycle-result.js';
32
35
  import { InputDisplay, removeLastGrapheme } from './input-display.js';
33
36
  import { QueryHeader, querySearchWidth } from './query-header.js';
34
37
  import { Pager, Reader, paginateWrappedRows, readerPage } from './reader.js';
@@ -38,6 +41,7 @@ import { SourceDetailCard, sourceDetailCardLayout } from './source-detail-card.j
38
41
  import { catalogRefPolicyForPreset } from './source-ref-presets.js';
39
42
  import { buildPlatformActions, configObjectHasSensitiveChild, hasInstalledPlacement, configValuesEqual, } from './model.js';
40
43
  import { managedCommandRecoveryPlanChanges } from './operation-review-planner.js';
44
+ import { isRecoveryReviewStaleBeforeExecution, recoveryRetryTargets, recoverySummaryErrors } from '../recovery/receipt.js';
41
45
  import { resolveTuiGlobalKeyAction, resolveTuiSessionNavigationKey } from './keys.js';
42
46
  import { tuiTheme } from './theme.js';
43
47
  import { contentRowBudget, rowViewport, wrapDisplayText } from './viewport.js';
@@ -142,18 +146,26 @@ function recoveryPluginLabel(id) {
142
146
  }
143
147
  function recoveryTargetLines(receipt, result) {
144
148
  const groups = new Map();
149
+ const advisories = result ? projectDeploymentNotices(receipt.targetResults) : [];
145
150
  let unchanged = 0;
146
151
  for (const target of receipt.targetResults) {
147
152
  let action;
148
153
  if (result) {
149
- action = target.satisfaction === 'unsupported' || target.satisfaction === 'excluded' ? '! 已跳过'
150
- : target.execution === 'applied' || target.execution === 'no-op' ? '✓ 完成'
151
- : target.execution === 'partial' ? '! 部分完成' : target.execution === 'failed' ? '× 执行失败'
152
- : target.blockers.length ? '! 已跳过' : '? 尚未确认';
154
+ const advised = advisories.some(({ code, subject, severity }) => severity === 'warning' && isInstallationAdvisory(code) && subject?.pluginId === target.pluginId
155
+ && subject.target === target.agent && subject.scope === target.scope);
156
+ action = target.execution === 'partial' ? '! 部分完成' : target.execution === 'failed' ? '× 执行失败'
157
+ : target.satisfaction === 'not-applicable' ? '✓ 当前平台无适用组件'
158
+ : target.satisfaction === 'unsupported' || target.satisfaction === 'excluded' ? '! 已跳过'
159
+ : target.execution === 'applied' || target.execution === 'no-op'
160
+ ? (hasComponentDeliveryNotice(target) || advised) && target.content === 'satisfied' ? '✓ 已安装 · 有提示' : '✓ 完成'
161
+ : target.blockers.length ? '! 已跳过' : '? 尚未确认';
153
162
  }
154
163
  else if (target.blockers.length || target.satisfaction === 'excluded' || target.satisfaction === 'unsupported') {
155
164
  action = '! 跳过';
156
165
  }
166
+ else if (target.satisfaction === 'not-applicable') {
167
+ action = '✓ 当前平台无适用组件';
168
+ }
157
169
  else if (receipt.command === 'cleanup' || receipt.command === 'uninstall' || receipt.command === 'retire') {
158
170
  action = '− 移除';
159
171
  }
@@ -166,7 +178,8 @@ function recoveryTargetLines(receipt, result) {
166
178
  }
167
179
  else
168
180
  action = target.content === 'absent' || target.observation === 'missing' ? '+ 新增安装' : '↻ 同步并修复';
169
- const reason = target.blockers[0] || target.reasons?.[0] ? recoveryReason((target.blockers[0] ?? target.reasons[0]).code)
181
+ const diagnostic = target.blockers[0] ?? target.reasons?.find(({ code }) => code !== SKILL_INVOCATION_NOTICE && !isDeliveryNoticeCode(code));
182
+ const reason = diagnostic ? recoveryReason(diagnostic.code)
170
183
  : target.satisfaction === 'excluded' ? '已关闭此 Agent'
171
184
  : target.satisfaction === 'unsupported' ? '插件不支持此 Agent' : undefined;
172
185
  const label = `${action} ${recoveryPluginLabel(target.pluginId)} ${scopeLabel(target.scope)}`;
@@ -174,10 +187,10 @@ function recoveryTargetLines(receipt, result) {
174
187
  const group = groups.get(key) ?? { label: `→ ${agentLabel(target.agent)}`, targets: [] };
175
188
  group.targets.push(`${label}${reason ? ` · ${reason}` : ''}`);
176
189
  if (result && target.deploymentReceipts)
177
- group.targets.push(...deploymentResultLines(target.deploymentReceipts.map(projectDeploymentReceipt)));
190
+ group.targets.push(...deploymentResultLines(target.deploymentReceipts.map((deployment) => projectDeploymentReceipt(deployment, { receipt, target })), false, target.installedComponentIds));
178
191
  else if (result && target.deploymentObservations)
179
192
  group.targets.push(...deploymentObservationLines(target.deploymentObservations.map(projectDeploymentObservation)));
180
- group.targets.push(...deploymentExclusionLines(target.deploymentExclusions ?? []), ...componentGapLines(target.componentGaps ?? []));
193
+ group.targets.push(...deploymentExclusionLines(target.deploymentExclusions ?? []), ...componentDeliveryLines(target));
181
194
  groups.set(key, group);
182
195
  }
183
196
  return [...groups.values()].flatMap((group) => [group.label, ...group.targets])
@@ -231,12 +244,59 @@ function scopedPlanSummary(plan) {
231
244
  lines.push(`! ${recoveryReason(diagnostic.code)}`);
232
245
  return [...new Set(lines)].join('\n');
233
246
  }
247
+ const skillInvocationExplanations = {
248
+ noBoundExecutor: () => '通用输出没有绑定执行客户端,无法保证',
249
+ invocationControlUnsupported: (reader) => `${reader ?? '该客户端'}不支持`,
250
+ invocationControlUnverified: (reader) => `尚未验证${reader ? ` ${reader} ` : '该客户端'}能否保证`,
251
+ invocationControlDegraded: (reader) => `观察到${reader ? ` ${reader}` : '该客户端'}未执行`,
252
+ };
253
+ function skillInvocationControlLabel({ feature, values }) {
254
+ if (feature === 'skill.invocation.manual' || feature === 'skill.invocation.model') {
255
+ const invocation = feature === 'skill.invocation.manual' ? '用户显式调用' : '模型自动调用';
256
+ return values?.length ? values.map((value) => `${value === 'true' ? '允许' : '禁止'}${invocation}`).join('、') : invocation;
257
+ }
258
+ return values?.length ? values.map((value) => `${value === 'visible' ? '显示' : '隐藏'} Skill`).join('、') : 'Skill 可见性';
259
+ }
260
+ function skillInvocationResultLines(diagnostics, technical = false) {
261
+ return skillInvocationNotices(diagnostics).flatMap(({ skill, pluginId, platform, scope, reasonCode, controls, message }) => {
262
+ const position = `! ${pluginId} · ${agentLabel(platform)} · ${scopeLabel(scope)} · ${skill} 已安装。`;
263
+ if (!controls.length) {
264
+ return [`${position}${skillInvocationExplanations[reasonCode]()}声明的调用限制。`, ` ${sanitizeDiagnosticDetailText(message)}`,
265
+ ...(technical ? [` ${SKILL_INVOCATION_NOTICE} · ${reasonCode}`] : [])];
266
+ }
267
+ const groups = new Map();
268
+ for (const control of controls) {
269
+ const reader = control.product ? platform === 'codex' ? 'Codex 桌面 App'
270
+ : skillInvocationProductLabel(platform, control.product) : undefined;
271
+ const explanation = skillInvocationExplanations[control.reasonCode](reader);
272
+ groups.set(explanation, [...(groups.get(explanation) ?? []), skillInvocationControlLabel(control)]);
273
+ }
274
+ const explanations = [...groups].map(([explanation, affected]) => `${explanation}「${affected.join('、')}」。`);
275
+ return [`${position}${explanations.join('')}`,
276
+ ...(technical ? [` ${SKILL_INVOCATION_NOTICE} · ${reasonCode}`, ...controls.map((control) => ` ${describeSkillInvocationControl(control)} · ${control.reasonCode}${control.product
277
+ ? ` · ${platform === 'codex' ? 'Codex 桌面 App' : skillInvocationProductLabel(platform, control.product)}` : ''}`)] : [])];
278
+ });
279
+ }
280
+ function deliveryAdvisoryLines(diagnostics, technical = false) {
281
+ return diagnostics.filter(({ code }) => isDeliveryNoticeCode(code)).flatMap(({ code, subject, detail, severity }) => {
282
+ const position = [subject?.pluginId, subject?.target ? agentLabel(subject.target) : undefined,
283
+ subject?.scope ? scopeLabel(subject.scope) : undefined].filter(Boolean).join(' · ');
284
+ return [`${severity === 'error' ? '×' : '!'} ${position} · ${deliveryNoticeText(code, detail, subject?.field)}`,
285
+ ...(technical ? [` ${code}${detail?.reasonCode ? ` · ${detail.reasonCode}` : ''}${detail?.path ? ` · ${detail.path}` : ''}`] : [])];
286
+ });
287
+ }
234
288
  function scopedResultSummary(receipt) {
235
- return [receipt.coverage?.scopes.length === 2 ? '所有项目 + 当前项目' : scopeLabel(receipt.scope), ...recoveryTargetLines(receipt, true),
236
- ...(receipt.declarationChanged ? ['插件清单已保存。'] : []),
237
- ...(receipt.preferencesChanged ? ['Agent 选择已保存。'] : []),
289
+ const notices = projectDeploymentNotices(receipt.targetResults);
290
+ return [receipt.coverage?.scopes.length === 2 ? '所有项目 + 当前项目' : scopeLabel(receipt.scope),
291
+ ...skillInvocationResultLines(notices),
292
+ ...deliveryAdvisoryLines(notices),
293
+ ...recoveryTargetLines(receipt, true),
294
+ ...(receipt.unconfirmedSavedState === 'intent' ? ['插件清单写入后的内容需要重新检查。']
295
+ : receipt.declarationChanged ? ['插件清单已保存。'] : []),
296
+ ...(receipt.unconfirmedSavedState === 'preferences' ? ['Agent 选择写入后的内容需要重新检查。']
297
+ : receipt.preferencesChanged ? ['Agent 选择已保存。'] : []),
238
298
  ...(receipt.configChanged ? ['插件设置已保存。'] : []),
239
- ...[...new Set([...receipt.errors, ...receipt.blockers].map((entry) => recoveryReason(entry.code)))]
299
+ ...[...new Set([...recoverySummaryErrors(receipt), ...receipt.blockers].map((entry) => recoveryReason(entry.code)))]
240
300
  .map((reason) => `! ${reason}`),
241
301
  ...(receipt.commandResults?.length ? [`命令包:${receipt.commandResults.filter((entry) => entry.errors.length === 0).length} 项完成,${receipt.commandResults.filter((entry) => entry.errors.length > 0).length} 项需处理;详情中可查看恢复方法。`] : []),
242
302
  ].join('\n');
@@ -294,11 +354,14 @@ function scopedResultText(receipt, technical = false) {
294
354
  if (!technical)
295
355
  return scopedResultSummary(receipt);
296
356
  const diagnostics = [...new Map([
297
- ...receipt.errors.map((entry) => [`${entry.code}:${entry.message}`, `全局错误:${entry.code} · ${entry.message}`]),
357
+ ...recoverySummaryErrors(receipt).map((entry) => [`${entry.code}:${entry.message}`, `全局错误:${entry.code} · ${entry.message}`]),
298
358
  ...receipt.blockers.map((entry) => [`${entry.code}:${entry.message}`, `全局受阻:${entry.code} · ${entry.message}`]),
299
359
  ]).values()];
300
- const reviewStale = [...receipt.blockers, ...receipt.errors]
301
- .some((entry) => entry.code === 'operationReviewStale');
360
+ const nativeRecovery = inventoryRecoveryActions(receipt.targetResults.filter((target) => !target.deploymentReceipts?.length)
361
+ .flatMap((target) => [...target.blockers, ...(target.reasons ?? [])])
362
+ .filter((entry) => entry.subject?.field === 'nativeSource' || entry.subject?.field === 'workspace'
363
+ || entry.subject?.field === 'nativeConfigRoot'), receipt);
364
+ const notices = projectDeploymentNotices(receipt.targetResults);
302
365
  return [
303
366
  `范围:${receipt.scope === 'user' ? '个人(所有项目)' : '当前项目'}`,
304
367
  `完整请求:${receipt.requestedRoots.join('、') || '无'}`,
@@ -307,12 +370,20 @@ function scopedResultText(receipt, technical = false) {
307
370
  `配置变更:${receipt.configChanged ? '是' : '无'}`,
308
371
  `输出可能改变:${receipt.outputsMayHaveChanged ? '是' : '否'}`,
309
372
  ...diagnostics,
310
- ...receipt.targetResults.flatMap((target) => target.reasons?.map((reason) => `${reason.code} · ${reason.message}`) ?? []),
311
- ...(reviewStale ? ['本次未执行,需要重新准备。'] : []),
373
+ ...skillInvocationResultLines(notices, true),
374
+ ...deliveryAdvisoryLines(notices, true),
375
+ ...receipt.targetResults.flatMap((target) => (target.reasons ?? []).filter(({ code }) => code !== SKILL_INVOCATION_NOTICE && !isDeliveryNoticeCode(code))
376
+ .map((reason) => `${reason.code} · ${reason.message}`)),
377
+ ...(isRecoveryReviewStaleBeforeExecution(receipt) ? ['本次未执行,需要重新准备。'] : []),
312
378
  ...receipt.targetResults.map((target) => `${target.pluginId} · ${agentLabel(target.agent)} [${target.scope === 'user' ? '个人' : '当前项目'}] · ${target.delivery?.kind === 'native' ? '原生' : target.delivery?.kind === 'agent-skills' ? 'Skills' : '无交付'} · ${target.execution} · ${target.observation}${target.blockers.length ? ` · 受阻 ${target.blockers.map((blocker) => blocker.code).join('、')}` : ''}`),
313
- ...receipt.targetResults.flatMap((target) => target.deploymentReceipts ? deploymentResultLines(target.deploymentReceipts.map(projectDeploymentReceipt), true)
379
+ ...receipt.targetResults.flatMap((target) => [
380
+ ...(target.satisfaction === 'not-applicable' ? [`${target.pluginId} · ${agentLabel(target.agent)} · ${scopeLabel(target.scope)} · 当前平台无适用组件`] : []),
381
+ ...componentDeliveryLines(target),
382
+ ]),
383
+ ...receipt.targetResults.flatMap((target) => target.deploymentReceipts ? deploymentResultLines(target.deploymentReceipts.map((deployment) => projectDeploymentReceipt(deployment, { receipt, target })), true, target.installedComponentIds)
314
384
  : target.deploymentObservations ? deploymentObservationLines(target.deploymentObservations.map(projectDeploymentObservation), true) : []),
315
385
  ...receipt.targetResults.flatMap((target) => target.recoveryActions?.map((action) => `${target.pluginId} · ${target.agent}:${action}`) ?? []),
386
+ ...nativeRecovery.flatMap((action) => action.kind === 'manual' ? [action.message] : []),
316
387
  ...(receipt.commandResults ?? []).flatMap((result) => [
317
388
  `命令${result.producer.kind === 'package' ? '包' : '生产者'} ${result.producer.key} · ${result.producer.sourceId}/${result.producer.pluginName} · ${scopeLabel(result.producer.scope)}${result.producer.platform ? ` · ${platformLabel(result.producer.platform)}` : ''} · ${result.state}`,
318
389
  ...(result.recoveryActions.some((action) => action.startsWith('aw command package remove '))
@@ -322,7 +393,7 @@ function scopedResultText(receipt, technical = false) {
322
393
  ...result.errors.map((error) => `命令错误:${error.code} · ${error.message}`),
323
394
  ...result.recoveryActions.map((action) => `命令恢复:${action}`),
324
395
  ]),
325
- ...receipt.remainingTargets.map((target) => `未完成:${target.pluginId} · ${target.agent}`),
396
+ ...receipt.remainingTargets.map((target) => `未完成:${target.pluginId} · ${target.agent} · ${scopeLabel(target.scope)}`),
326
397
  ...receipt.recoveryActions.map((action) => `恢复:${action}`),
327
398
  ].join('\n');
328
399
  }
@@ -2266,7 +2337,8 @@ export function ConsoleAppV4(props) {
2266
2337
  || Boolean(route.name === 'portableBlocker' && plugin)
2267
2338
  || Boolean(route.name === 'configUnavailable' && plugin)
2268
2339
  || Boolean(route.name === 'result' && snapshot.result && 'operationKind' in snapshot.result
2269
- && snapshot.result.operationKind === 'portableInstall'));
2340
+ && (snapshot.result.operationKind === 'portableInstall'
2341
+ || ('summary' in snapshot.result && snapshot.result.summary?.configDiagnostics?.length))));
2270
2342
  const characterInput = !activeVariantPreview && !activeFieldIsConst && !activePropertyIsConst && isCharacterInputMode(route, searchFocus)
2271
2343
  || route.name === 'operationReportPreview' && reportSaveMode;
2272
2344
  const canOpenHelp = !tooSmall && !characterInput && !preparationRunning;
@@ -4240,6 +4312,7 @@ export function ConsoleAppV4(props) {
4240
4312
  title = flow.stage === 'preparing' ? '正在准备操作汇总' : '正在执行恢复';
4241
4313
  description = flow.stage === 'preparing' ? '正在检查当前证据。Esc 可取消准备。'
4242
4314
  : '操作已开始。完成后显示每个目标结果。';
4315
+ const installProgress = flow.stage === 'progress' ? snapshot.progress.installProgress : undefined;
4243
4316
  readingText = flow.stage === 'progress' ? [
4244
4317
  ...(snapshot.progress.current
4245
4318
  ? [`${snapshot.progress.current.target} · ${snapshot.progress.current.phase}`] : []),
@@ -4247,7 +4320,7 @@ export function ConsoleAppV4(props) {
4247
4320
  ...(flow.plan.kind === 'recovery' ? scopedCommandPlanText(flow.plan) : []),
4248
4321
  ...deploymentPlanLines(scopedDeploymentPlans(flow.plan)),
4249
4322
  ].join('\n') : undefined;
4250
- content = _jsxs(Box, { flexDirection: "column", children: [_jsx(ProgressRow, { title: title, state: "active" }), readingText ? readingPage(readingText, size.columns - 6, Math.max(1, pageActionBudget(4))) : null] });
4323
+ content = _jsxs(Box, { flexDirection: "column", children: [_jsx(ProgressRow, { title: title, state: "active" }), installProgress ? _jsxs(_Fragment, { children: [_jsx(StaticRow, { title: `已完成 ${installProgress.completed} · 正在执行 ${installProgress.running}`, compact: true }), _jsx(StaticRow, { title: `等待依赖 ${installProgress.waitingForDependencies} · 待执行 ${installProgress.waiting}`, compact: true })] }) : null, readingText ? readingPage(readingText, size.columns - 6, Math.max(1, pageActionBudget(installProgress ? 6 : 4))) : null] });
4251
4324
  }
4252
4325
  else if (flow.stage === 'timeout') {
4253
4326
  title = '设置脚本超时';
@@ -4308,15 +4381,14 @@ export function ConsoleAppV4(props) {
4308
4381
  : '本机工具已保存。';
4309
4382
  readingText = flow.receipt ? scopedResultText(flow.receipt, showTechnical)
4310
4383
  : (flow.errorCode ? showTechnical ? flow.errorCode : recoveryReason(flow.errorCode) : undefined) ?? (flow.changed ? '本机工具已保存。' : '本机工具没有变化。');
4311
- const retryTargets = flow.receipt?.targetResults.filter((target) => (target.execution === 'failed' || target.execution === 'partial')
4384
+ const failedPositions = flow.receipt?.targetResults.filter((target) => (target.execution === 'failed' || target.execution === 'partial')
4312
4385
  && (target.observation === 'missing' || target.content === 'absent')) ?? [];
4313
- const retryKeys = new Set(retryTargets.map((target) => `${target.pluginId}\0${target.agent}\0${target.scope}`));
4386
+ const retryTargets = flow.receipt ? recoveryRetryTargets(flow.receipt, failedPositions) : [];
4387
+ const originalCommand = flow.plan?.kind === 'recovery' ? flow.plan.plan.command : undefined;
4388
+ const retryKeys = new Set(failedPositions.map((target) => `${target.pluginId}\0${target.agent}\0${target.scope}`));
4314
4389
  const unknownTargets = flow.receipt?.targetResults.filter((target) => target.observation === 'unknown'
4315
4390
  && !retryKeys.has(`${target.pluginId}\0${target.agent}\0${target.scope}`)) ?? [];
4316
- const reviewStale = flow.receipt
4317
- ? [...flow.receipt.blockers, ...flow.receipt.errors]
4318
- .some((entry) => entry.code === 'operationReviewStale')
4319
- : false;
4391
+ const reviewStale = flow.receipt && isRecoveryReviewStaleBeforeExecution(flow.receipt);
4320
4392
  actions = [
4321
4393
  { label: route.name === 'issueDetail' ? '返回问题详情'
4322
4394
  : route.name === 'pluginWriteTask' ? '返回插件任务'
@@ -4330,13 +4402,15 @@ export function ConsoleAppV4(props) {
4330
4402
  }) }] : []),
4331
4403
  ...(unknownTargets.length ? [{ label: `检查未确认项(${unknownTargets.length})`, run: () => {
4332
4404
  closeScopedFlow();
4333
- void props.controller.refreshScopedInventory(flow.scope);
4405
+ for (const scope of new Set(unknownTargets.map((target) => target.scope))) {
4406
+ void props.controller.refreshScopedInventory(scope);
4407
+ }
4334
4408
  } }] : []),
4335
4409
  ...(retryTargets.length ? [{ label: `重试明确失败项(${retryTargets.length})`, run: () => beginScopedTask({
4336
- kind: 'recovery', scope: flow.scope, command: flow.receipt.command,
4410
+ kind: 'recovery', scope: flow.scope, command: originalCommand === 'install' ? 'sync' : originalCommand ?? 'sync',
4337
4411
  selectors: [...new Set(retryTargets.map((target) => target.pluginId))],
4338
4412
  targets: [...new Set(retryTargets.map((target) => target.agent))],
4339
- exactTargets: retryTargets.map((target) => ({ pluginId: target.pluginId, agent: target.agent, scope: target.scope })),
4413
+ exactTargets: retryTargets,
4340
4414
  }) }] : []),
4341
4415
  ];
4342
4416
  content = _jsxs(ResultSurface, { status: flow.errorCode || flow.receipt && !flow.receipt.ok ? 'warning' : 'success', title: description, children: [readingPage(readingText, size.columns - 6, Math.max(1, pageActionBudget(actions.length + (showTechnical ? 5 : 4)))), _jsx(SemanticRows, { actions: actions, focus: flow.focus, kind: "action", compact: true })] });
@@ -8034,7 +8108,9 @@ export function ConsoleAppV4(props) {
8034
8108
  : [])).values()].map((target) => ({
8035
8109
  label: `处理 ${props.controller.getPluginOverview(target.pluginId).displayName}`,
8036
8110
  description: '查看这个依赖的问题和可用的恢复操作',
8037
- run: () => go({ name: 'platform', pluginId: target.pluginId, platform: target.platform }),
8111
+ run: () => go(target.platform === 'generic'
8112
+ ? { name: 'pluginDetail', pluginId: target.pluginId }
8113
+ : { name: 'platform', pluginId: target.pluginId, platform: target.platform }),
8038
8114
  })),
8039
8115
  { label: '重试', description: '重新读取和验证当前状态', run: () => {
8040
8116
  props.controller.retryReviewPreparation();
@@ -8718,11 +8794,18 @@ export function ConsoleAppV4(props) {
8718
8794
  : '✓ 来源配置已保存'
8719
8795
  : configOperation
8720
8796
  ? blocked
8721
- ? '× 设置未确认保存'
8797
+ ? resultSummary?.configRetryApply ? '× 插件应用未完成' : '× 设置未确认保存'
8722
8798
  : partial ? resultSummary?.configApplySkippedReason === 'invalidConfig'
8723
- ? '! 设置已保存,但未应用'
8724
- : '! 设置已保存,但部分应用失败'
8725
- : resultSummary?.configApplied ? '✓ 设置已保存并应用' : '✓ 设置已保存'
8799
+ ? resultSummary.configRetryApply ? '! 配置无效,应用未完成' : '! 设置已保存,但未应用'
8800
+ : resultSummary?.configRetryApply
8801
+ ? resultSummary.configApplied ? '! 部分插件内容已就绪' : '! 插件应用未完成'
8802
+ : resultSummary?.configApplied && (resultSummary.configApplyRetryTargets !== undefined
8803
+ || resultSummary.configGroups?.some((group) => group.applyStatus === 'partial'))
8804
+ ? '! 设置已保存,部分插件内容已就绪'
8805
+ : '! 设置已保存,但部分应用失败'
8806
+ : resultSummary?.configRetryApply
8807
+ ? resultSummary.configApplied ? '✓ 已应用已保存的设置' : '✓ 应用检查完成'
8808
+ : resultSummary?.configApplied ? '✓ 设置已保存并应用' : '✓ 设置已保存'
8726
8809
  : partial ? '! 插件操作只完成了一部分'
8727
8810
  : blocked ? result.code === 'operationFailed' ? '× 插件操作没有完成' : '× 插件操作未完成'
8728
8811
  : completedTitle;
@@ -8771,7 +8854,7 @@ export function ConsoleAppV4(props) {
8771
8854
  : configOperation
8772
8855
  ? partial
8773
8856
  ? resultSummary?.message ?? '设置层已经保存;平台应用失败不会回滚设置。'
8774
- : '设置层已经更新。'
8857
+ : resultSummary?.configRetryApply ? '状态已刷新。' : '设置层已经更新。'
8775
8858
  : '状态已刷新。';
8776
8859
  if (taskOperation && splitTaskReview?.currentScope === 'user') {
8777
8860
  if (!blocked && !partial)
@@ -8785,11 +8868,15 @@ export function ConsoleAppV4(props) {
8785
8868
  && 'pluginId' in result.returnRoute
8786
8869
  ? result.returnRoute.pluginId
8787
8870
  : undefined);
8788
- const configRetryProfiles = configResultPluginId === undefined ? []
8871
+ const configRetries = configResultPluginId === undefined ? []
8789
8872
  : operationKind === 'configSaveBatch'
8790
- ? resultSummary?.configGroups?.filter((group) => group.configSaved && group.applyStatus === 'failed'
8791
- && group.errorCode !== 'invalidConfig').map((group) => group.platform ?? 'common') ?? []
8792
- : resultSummary?.configApplyRetryAvailable === true ? [resultSummary.configPlatform ?? 'common'] : [];
8873
+ ? resultSummary?.configGroups?.filter((group) => group.configSaved
8874
+ && (group.applyStatus === 'failed' || group.applyStatus === 'partial')
8875
+ && group.errorCode !== 'invalidConfig' && group.retryTargets?.length !== 0)
8876
+ .map((group) => ({ profile: group.platform ?? 'common', targets: group.retryTargets })) ?? []
8877
+ : resultSummary?.configApplyRetryAvailable === true
8878
+ ? [{ profile: resultSummary.configPlatform ?? 'common', targets: resultSummary.configApplyRetryTargets }]
8879
+ : [];
8793
8880
  const configOrigin = successfulConfigOperation && pluginId
8794
8881
  ? props.controller.configOrigin(pluginId)
8795
8882
  : undefined;
@@ -9019,8 +9106,8 @@ export function ConsoleAppV4(props) {
9019
9106
  label: '返回首页', run: () => requestSessionNavigation('home') }]
9020
9107
  : configOperation && partial
9021
9108
  ? [
9022
- ...configRetryProfiles.map((profile) => ({
9023
- label: configRetryProfiles.length > 1 ? `重试应用 · ${configLayerLabel({ profile })}` : '重试应用',
9109
+ ...configRetries.map(({ profile, targets }) => ({
9110
+ label: configRetries.length > 1 ? `重试应用 · ${configLayerLabel({ profile })}` : '重试应用',
9024
9111
  description: '先重新显示操作汇总,并重新读取当前状态',
9025
9112
  run: () => beginReview({
9026
9113
  kind: 'configSave',
@@ -9029,6 +9116,7 @@ export function ConsoleAppV4(props) {
9029
9116
  ...configReadOptions({ profile, context: resultSummary?.configContext }),
9030
9117
  apply: true,
9031
9118
  retryApply: true,
9119
+ ...(targets ? { targets } : {}),
9032
9120
  updates: {},
9033
9121
  removeKeys: [],
9034
9122
  }),
@@ -9122,6 +9210,21 @@ export function ConsoleAppV4(props) {
9122
9210
  const resultStatus = blocked ? 'error' : partial ? 'warning' : 'success';
9123
9211
  const resultTargets = configOperation ? resultSummary?.configTargets ?? resultSummary?.targets ?? []
9124
9212
  : resultSummary?.targets ?? [];
9213
+ const configDiagnostics = resultSummary?.configDiagnostics ?? [];
9214
+ const configInvocationLines = [...skillInvocationResultLines(configDiagnostics, showTechnical),
9215
+ ...deliveryAdvisoryLines(configDiagnostics, showTechnical)];
9216
+ const configInvocationRows = configInvocationLines.flatMap((line) => wrapDisplayText(line, size.columns - 6))
9217
+ .map((line, index) => _jsx(Text, { color: tuiTheme.statusColors.warning, children: line }, `config-skill:${index}`));
9218
+ const configGroupRows = resultSummary?.configGroups?.map((group) => {
9219
+ const status = group.notStarted ? 'muted' : !group.configSaved ? 'error'
9220
+ : group.applyStatus === 'failed' || group.applyStatus === 'partial' ? 'warning' : 'success';
9221
+ const outcome = group.notStarted ? '尚未保存' : !group.configSaved ? '保存失败'
9222
+ : group.applyStatus === 'failed' ? '已保存 · 应用失败'
9223
+ : group.applyStatus === 'partial' ? '已保存 · 部分应用'
9224
+ : group.applyStatus === 'succeeded' ? '已保存 · 已应用'
9225
+ : '已保存';
9226
+ return _jsx(ResultRow, { title: configLayerLabel({ profile: group.platform ?? 'common' }), description: group.errorCode, meta: outcome, status: status, compact: true }, `config:${group.platform ?? 'common'}`);
9227
+ }) ?? [];
9125
9228
  const commandResults = resultSummary?.commandResults ?? [];
9126
9229
  const retainedCommandPackage = (result) => result.producer.kind === 'package' && (resultSummary?.action === 'cleanup' || resultSummary?.action === 'uninstall');
9127
9230
  const commandResultRows = commandResults.map((result, index) => _jsx(ResultRow, { title: `${retainedCommandPackage(result) ? '保留' : ''}命令${result.producer.kind === 'package' ? '包' : '生产者'} ${result.producer.key}`, description: `${result.producer.sourceId}/${result.producer.pluginName} · ${scopeLabel(result.producer.scope)} · ${retainedCommandPackage(result) ? result.producer.scope === 'user' ? '所有项目共用 · ' : '当前项目内共用 · ' : ''}${result.commandIds.length} 个命令${result.removedCommandIds.length ? ` · 撤销 ${result.removedCommandIds.length} 个` : ''}${result.errors[0] ? ` · ${result.errors[0].code}` : ''}`, meta: retainedCommandPackage(result) ? '保留' : result.state === 'completed' ? '完成' : result.state === 'partial' ? '部分完成' : '失败', status: result.state === 'completed' ? 'success' : result.state === 'partial' ? 'warning' : 'error', compact: policy.mode === 'compact' }, `command:${index}`));
@@ -9131,7 +9234,24 @@ export function ConsoleAppV4(props) {
9131
9234
  : target.state === 'skipped' ? 1 : target.relation === 'requested' ? 2 : 3;
9132
9235
  return priority(left) - priority(right);
9133
9236
  });
9134
- const baseResultPaginationTotal = Math.max(resultTargets.length + commandResults.length, taskSummary?.rootResults.reduce((count, root) => count + 1 + (taskSummary.requestedTargets.filter((target) => target.pluginId === root.pluginId).length), 0) ?? 0, (resultSummary?.batch?.rootResults.length ?? 0) + resultTargets.length);
9237
+ const targetResultRows = prioritizedTargets.flatMap((target) => {
9238
+ const advisory = configDiagnostics.some(({ code, subject, severity }) => severity === 'warning' && isInstallationAdvisory(code)
9239
+ && subject?.pluginId === target.pluginId && subject?.target === target.platform && subject?.scope === target.scope);
9240
+ const state = target.partialDelivery ? { label: '部分完成', status: 'warning' }
9241
+ : target.state !== 'failed' && !target.errorCode && target.satisfaction === 'not-applicable' ? { label: '当前平台无适用组件', status: 'success' }
9242
+ : (target.state === 'completed' || target.state === 'kept') && (advisory || hasComponentDeliveryNotice(target))
9243
+ ? { label: '已安装 · 有提示', status: 'success' } : operationTargetStateLabel(target.state);
9244
+ const relation = target.relation === 'requested' ? '你选择的插件'
9245
+ : target.relation === 'direct' ? '直接依赖' : target.relation === 'transitive' ? '间接依赖' : undefined;
9246
+ const targetDescription = configOperation
9247
+ ? [agentLabel(target.platform), scopeLabel(target.scope), target.errorCode].filter(Boolean).join(' · ')
9248
+ : relation;
9249
+ const key = `${target.pluginId ?? ''}:${target.platform}:${target.scope}`;
9250
+ return [_jsx(ResultRow, { title: resultTargetName(target), description: targetDescription, meta: state.label, status: state.status ?? 'muted', compact: policy.mode === 'compact' }, key), ...componentDeliveryLines(target).flatMap((line) => wrapDisplayText(line, size.columns - 6))
9251
+ .map((line, index) => _jsx(Text, { color: tuiTheme.statusColors.muted, children: line }, `${key}:component:${index}`))];
9252
+ });
9253
+ const generalResultRows = [...configInvocationRows, ...configGroupRows, ...targetResultRows, ...commandResultRows];
9254
+ const baseResultPaginationTotal = Math.max(generalResultRows.length, taskSummary?.rootResults.reduce((count, root) => count + 1 + (taskSummary.requestedTargets.filter((target) => target.pluginId === root.pluginId).length), 0) ?? 0, (resultSummary?.batch?.rootResults.length ?? 0) + resultTargets.length);
9135
9255
  const resultExtraRows = (resultSummary?.elapsedMs !== undefined ? 1 : 0)
9136
9256
  + visibleMessages.length
9137
9257
  + visibleChanges.length
@@ -9204,11 +9324,12 @@ export function ConsoleAppV4(props) {
9204
9324
  ].join('\n') : '当前结果已变化。请返回结果摘要。' : [
9205
9325
  ...(taskOperation && splitTaskReview ? splitTaskLines(splitTaskReview) : []),
9206
9326
  resultSummary?.message ?? (blocked ? result.message : '操作结果'),
9327
+ ...configInvocationLines,
9207
9328
  ...(resultSummary?.messages ?? []).map(productResultMessage),
9208
9329
  ...(resultSummary?.changes ?? []),
9209
9330
  ...(resultSummary?.warnings ?? []),
9210
9331
  ...(resultSummary?.recoveryActions ?? []),
9211
- ...prioritizedTargets.map((target) => `${resultTargetName(target)} · ${agentLabel(target.platform)} · ${scopeLabel(target.scope)} · ${operationTargetStateLabel(target.state).label}`),
9332
+ ...prioritizedTargets.map((target) => `${resultTargetName(target)} · ${agentLabel(target.platform)} · ${scopeLabel(target.scope)} · ${target.partialDelivery ? '部分完成' : operationTargetStateLabel(target.state).label}`),
9212
9333
  ...commandResults.flatMap((result) => [
9213
9334
  `命令生产者 ${result.producer.key} · ${scopeLabel(result.producer.scope)} · ${result.state}`,
9214
9335
  ...(retainedCommandPackage(result) ? [`保留命令包 ${getCommandPackageId(result.producer)} · ${result.producer.scope === 'user' ? '所有项目共用' : '当前项目内共用'}`] : []),
@@ -9274,11 +9395,9 @@ export function ConsoleAppV4(props) {
9274
9395
  : portableFixedRows
9275
9396
  : resultPaginationTotal > 1 ? 7 : 8);
9276
9397
  const resultActionViewport = actionViewport(actions, true, focus, scrollOffset, currentActionViewportLineBudget);
9277
- const resultTargetLimit = Math.max(1, prefixRowLimit([...prioritizedTargets, ...commandResults].map(() => policy.mode === 'compact' ? 1 : 2), pageActionBudget() - 3 - resultActionViewport.limit - resultExtraRows));
9278
- const resultTargetPage = pagedItems(prioritizedTargets.length + commandResults.length, resultTargetLimit);
9279
- const resultTargetOffset = resultTargetPage.offset;
9280
- const visibleResultTargets = prioritizedTargets.slice(resultTargetOffset, resultTargetOffset + resultTargetLimit);
9281
- const visibleCommandResultRows = commandResultRows.slice(Math.max(0, resultTargetOffset - prioritizedTargets.length), Math.max(0, resultTargetOffset + resultTargetLimit - prioritizedTargets.length));
9398
+ const resultTargetLimit = Math.max(1, prefixRowLimit(generalResultRows.map(() => policy.mode === 'compact' ? 1 : 2), pageActionBudget() - 3 - resultActionViewport.limit - resultExtraRows));
9399
+ const resultTargetPage = pagedItems(generalResultRows.length, resultTargetLimit);
9400
+ const visibleResultRows = generalResultRows.slice(resultTargetPage.offset, resultTargetPage.offset + resultTargetLimit);
9282
9401
  const portableTechnicalSummary = showTechnical;
9283
9402
  const portableRows = visiblePortablePairs.map((pair) => {
9284
9403
  const status = blocked || pair.state !== 'verified' ? 'warning' : 'success';
@@ -9312,15 +9431,6 @@ export function ConsoleAppV4(props) {
9312
9431
  : resultSummary?.resetDisposition === 'quarantinedDirectory'
9313
9432
  ? `设置路径是目录;已隔离为 ${resultSummary.quarantineBasename ?? '安全隔离目录'}`
9314
9433
  : undefined;
9315
- const configGroupRows = resultSummary?.configGroups?.map((group) => {
9316
- const status = !group.configSaved ? 'error'
9317
- : group.applyStatus === 'failed' ? 'warning' : 'success';
9318
- const outcome = !group.configSaved ? '保存失败'
9319
- : group.applyStatus === 'failed' ? '已保存 · 应用失败'
9320
- : group.applyStatus === 'succeeded' ? '已保存 · 已应用'
9321
- : '已保存';
9322
- return _jsx(ResultRow, { title: configLayerLabel({ profile: group.platform ?? 'common' }), description: group.errorCode, meta: outcome, status: status, compact: true }, `config:${group.platform ?? 'common'}`);
9323
- }) ?? [];
9324
9434
  const taskRootResults = taskSummary?.rootResults ?? [];
9325
9435
  const blockedTaskTargets = new Map((taskSummary?.blockedTargets ?? []).map((entry) => [
9326
9436
  [entry.target.pluginId, entry.target.platform, entry.target.scope].join('\0'), entry,
@@ -9398,7 +9508,7 @@ export function ConsoleAppV4(props) {
9398
9508
  const locationResultRows = [...(taskOperation ? taskLocationRows : batchLocationResultRows), ...commandResultRows];
9399
9509
  const combinedResultRows = [...pluginResultRows, ...locationResultRows];
9400
9510
  const actualResultRows = taskOperation || batchOperation ? combinedResultRows.length
9401
- : portableOperation ? prioritizedPortablePairs.length : prioritizedTargets.length + commandResults.length;
9511
+ : portableOperation ? prioritizedPortablePairs.length : generalResultRows.length;
9402
9512
  const actualResultPageRows = taskOperation || batchOperation ? taskResultLimit
9403
9513
  : portableOperation ? portableSkillLimit : resultTargetLimit;
9404
9514
  if (!portableResultDetailOpen && actualResultRows > actualResultPageRows) {
@@ -9411,7 +9521,7 @@ export function ConsoleAppV4(props) {
9411
9521
  const visibleLocationStart = Math.max(0, taskResultOffset - pluginResultRows.length);
9412
9522
  const remainingResultRows = taskResultLimit - visiblePluginResultRows.length;
9413
9523
  const visibleLocationResultRows = locationResultRows.slice(visibleLocationStart, visibleLocationStart + remainingResultRows);
9414
- if (taskOperation || batchOperation || resultTargets.length > resultTargetLimit
9524
+ if (taskOperation || batchOperation || resultTargetPage.pageCount > 1
9415
9525
  || prioritizedPortablePairs.length > portableSkillLimit) {
9416
9526
  help = '←→ 查看全部项目 · ↑↓ 移动 · Enter 选择 · Esc 返回';
9417
9527
  }
@@ -9425,7 +9535,14 @@ export function ConsoleAppV4(props) {
9425
9535
  ? _jsx(StaticRow, { title: "Agent", meta: "\u81EA\u52A8\u9009\u62E9\u53EF\u7528 Agent", compact: true }) : null, portableReceipt?.recovery
9426
9536
  ? _jsx(StaticRow, { title: `安全恢复:${portableReceipt.recovery}`, status: "warning", compact: true })
9427
9537
  : null] }) }), !portableResultDetailOpen && portableSkillPage.pageCount > 1
9428
- ? _jsx(Pager, { page: portableSkillPage.page, pageCount: portableSkillPage.pageCount, columns: size.columns - 2 }) : null, _jsx(SemanticRows, { actions: actions, focus: focus, kind: "action", compact: true, offset: resultActionViewport.offset, limit: resultActionViewport.limit })] }) : _jsxs(Box, { flexDirection: "column", children: [_jsxs(ResultCard, { status: resultStatus, title: blockedDependencyFailure ? '依赖安装没有完成' : blocked ? result.writeMayHaveCompleted ? '结果未确认' : '操作未完成' : sourceOperation ? '来源配置写入已完成' : dependencyTargets ? partial ? '依赖安装没有全部完成' : '操作已完成' : resultSummary?.message ?? '状态已变化,请重新确认', meta: resultTargets.length > 0 ? `${resultTargets.length} 个目标` : undefined, children: [resetDispositionText ? _jsx(StaticRow, { title: resetDispositionText, status: "success", compact: true }) : null, configGroupRows, visibleResultTargets.map((target) => { const state = operationTargetStateLabel(target.state); const relation = target.relation === 'requested' ? '你选择的插件' : target.relation === 'direct' ? '直接依赖' : target.relation === 'transitive' ? '间接依赖' : undefined; return _jsx(ResultRow, { title: resultTargetName(target), description: relation, meta: state.label, status: state.status ?? 'muted', compact: policy.mode === 'compact' }, `${target.pluginId ?? ''}:${target.platform}:${target.scope}`); }), visibleCommandResultRows, resultTargetPage.pageCount > 1 ? _jsx(Pager, { page: resultTargetPage.page, pageCount: resultTargetPage.pageCount, columns: size.columns - 6 }) : null, partial && hasPreservedTarget && resultTargets.some((target) => target.state === 'skipped') ? _jsx(StaticRow, { title: "\u672A\u6267\u884C\u7684\u76EE\u6807\u6CA1\u6709\u5199\u5165\uFF1B\u5DF2\u5B8C\u6210\u6216\u5DF2\u4FDD\u7559\u7684\u76EE\u6807\u4FDD\u6301\u53EF\u7528\u3002", status: "muted", compact: true }) : null, configOperation && partial && !invalidConfigResult ? _jsx(Callout, { status: "warning", title: "\u6062\u590D\u6307\u5F15", description: "\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\u5C42\u4E0D\u4F1A\u91CD\u5199\u3002\u5931\u8D25\u7684\u4FDD\u5B58\u5C42\u4FDD\u7559\u8349\u7A3F\uFF1B\u5E94\u7528\u5931\u8D25\u65F6\u53EA\u91CD\u8BD5\u5E94\u7528\u3002" }) : null, resultSummary?.elapsedMs !== undefined ? _jsx(StaticRow, { title: "\u5DF2\u7528\u65F6", meta: `${Math.floor(resultSummary.elapsedMs / 1_000)}s` }) : null, visibleMessages.map((message, index) => _jsx(StaticRow, { title: productResultMessage(message), status: "muted", compact: true }, `${index}:${message}`))] }), _jsx(SemanticRows, { actions: actions, focus: focus, kind: "action", compact: true, offset: resultActionViewport.offset, limit: resultActionViewport.limit })] });
9538
+ ? _jsx(Pager, { page: portableSkillPage.page, pageCount: portableSkillPage.pageCount, columns: size.columns - 2 }) : null, _jsx(SemanticRows, { actions: actions, focus: focus, kind: "action", compact: true, offset: resultActionViewport.offset, limit: resultActionViewport.limit })] }) : _jsxs(Box, { flexDirection: "column", children: [_jsxs(ResultCard, { status: resultStatus, title: blockedDependencyFailure ? '依赖安装没有完成'
9539
+ : blocked ? result.writeMayHaveCompleted ? '结果未确认' : '操作未完成'
9540
+ : sourceOperation ? '来源配置写入已完成'
9541
+ : dependencyTargets ? partial ? '依赖安装没有全部完成' : '操作已完成'
9542
+ : resultSummary?.message ?? '状态已变化,请重新确认', meta: resultTargets.length > 0 ? `${resultTargets.length} 个目标` : undefined, children: [resetDispositionText ? _jsx(StaticRow, { title: resetDispositionText, status: "success", compact: true }) : null, visibleResultRows, resultTargetPage.pageCount > 1 ? _jsx(Pager, { page: resultTargetPage.page, pageCount: resultTargetPage.pageCount, columns: size.columns - 6 }) : null, partial && hasPreservedTarget && resultTargets.some((target) => target.state === 'skipped')
9543
+ ? _jsx(StaticRow, { title: "\u672A\u6267\u884C\u7684\u76EE\u6807\u6CA1\u6709\u5199\u5165\uFF1B\u5DF2\u5B8C\u6210\u6216\u5DF2\u4FDD\u7559\u7684\u76EE\u6807\u4FDD\u6301\u53EF\u7528\u3002", status: "muted", compact: true }) : null, configOperation && partial && !invalidConfigResult && configRetries.length > 0
9544
+ ? _jsx(Callout, { status: "warning", title: "\u6062\u590D\u6307\u5F15", description: "\u9009\u62E9\u201C\u91CD\u8BD5\u5E94\u7528\u201D\u53EF\u4EE5\u91CD\u65B0\u5BA1\u9605\u672A\u5B8C\u6210\u7684\u5E73\u53F0\u3002" }) : null, resultSummary?.elapsedMs !== undefined
9545
+ ? _jsx(StaticRow, { title: "\u5DF2\u7528\u65F6", meta: `${Math.floor(resultSummary.elapsedMs / 1_000)}s` }) : null, visibleMessages.map((message, index) => _jsx(StaticRow, { title: productResultMessage(message), status: "muted", compact: true }, `${index}:${message}`))] }), _jsx(SemanticRows, { actions: actions, focus: focus, kind: "action", compact: true, offset: resultActionViewport.offset, limit: resultActionViewport.limit })] });
9429
9546
  }
9430
9547
  else if (route.name === 'pluginContent' && plugin) {
9431
9548
  const overview = props.controller.getPluginContentOverview(plugin.pluginId);