@lesliechan721/aw 0.1.0-beta.93 → 0.1.0-beta.94

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 (77) hide show
  1. package/dist/src/commands/deployment-confirmation.js +13 -0
  2. package/dist/src/commands/deployment-confirmation.js.map +1 -1
  3. package/dist/src/commands/offline-cleanup-evidence.d.ts +1 -1
  4. package/dist/src/commands/offline-cleanup-evidence.js +30 -31
  5. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
  6. package/dist/src/commands/operation-plan.d.ts +5 -0
  7. package/dist/src/commands/operation-plan.js +2 -0
  8. package/dist/src/commands/operation-plan.js.map +1 -1
  9. package/dist/src/commands/public-lifecycle-result.js +16 -0
  10. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  11. package/dist/src/commands/public-lifecycle.js +3 -1
  12. package/dist/src/commands/public-lifecycle.js.map +1 -1
  13. package/dist/src/commands/rebuild-command.d.ts +9 -16
  14. package/dist/src/commands/rebuild-command.js +149 -92
  15. package/dist/src/commands/rebuild-command.js.map +1 -1
  16. package/dist/src/commands/rebuild-integration.d.ts +1 -0
  17. package/dist/src/commands/rebuild-integration.js.map +1 -1
  18. package/dist/src/commands/rebuild-platform-integration.d.ts +1 -0
  19. package/dist/src/commands/rebuild-platform-integration.js +26 -15
  20. package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
  21. package/dist/src/commands/status-v6.js +7 -4
  22. package/dist/src/commands/status-v6.js.map +1 -1
  23. package/dist/src/platforms/contracts.d.ts +23 -1
  24. package/dist/src/platforms/discovery.d.ts +2 -0
  25. package/dist/src/platforms/discovery.js.map +1 -1
  26. package/dist/src/platforms/inspection-native.d.ts +4 -2
  27. package/dist/src/platforms/inspection-native.js +228 -24
  28. package/dist/src/platforms/inspection-native.js.map +1 -1
  29. package/dist/src/platforms/layout.js +15 -0
  30. package/dist/src/platforms/layout.js.map +1 -1
  31. package/dist/src/platforms/lifecycle-native-services.js +68 -2
  32. package/dist/src/platforms/lifecycle-native-services.js.map +1 -1
  33. package/dist/src/platforms/lifecycle-native.js +12 -1
  34. package/dist/src/platforms/lifecycle-native.js.map +1 -1
  35. package/dist/src/platforms/lifecycle.d.ts +3 -1
  36. package/dist/src/platforms/lifecycle.js +133 -12
  37. package/dist/src/platforms/lifecycle.js.map +1 -1
  38. package/dist/src/platforms/retirement-native.d.ts +6 -0
  39. package/dist/src/platforms/retirement-native.js +95 -0
  40. package/dist/src/platforms/retirement-native.js.map +1 -0
  41. package/dist/src/recovery/receipt.d.ts +2 -0
  42. package/dist/src/recovery/receipt.js.map +1 -1
  43. package/dist/src/recovery/retirement.js +58 -22
  44. package/dist/src/recovery/retirement.js.map +1 -1
  45. package/dist/src/recovery/status.js +12 -2
  46. package/dist/src/recovery/status.js.map +1 -1
  47. package/dist/src/tui/catalog-generation.d.ts +4 -1
  48. package/dist/src/tui/catalog-generation.js +34 -0
  49. package/dist/src/tui/catalog-generation.js.map +1 -1
  50. package/dist/src/tui/console-app-v4.js +50 -13
  51. package/dist/src/tui/console-app-v4.js.map +1 -1
  52. package/dist/src/tui/controller-runtime.js +16 -8
  53. package/dist/src/tui/controller-runtime.js.map +1 -1
  54. package/dist/src/tui/controller.d.ts +2 -1
  55. package/dist/src/tui/controller.js +14 -5
  56. package/dist/src/tui/controller.js.map +1 -1
  57. package/dist/src/tui/deployment-view.d.ts +1 -0
  58. package/dist/src/tui/deployment-view.js +21 -3
  59. package/dist/src/tui/deployment-view.js.map +1 -1
  60. package/dist/src/tui/entity-cards.js +7 -1
  61. package/dist/src/tui/entity-cards.js.map +1 -1
  62. package/dist/src/tui/model.d.ts +6 -1
  63. package/dist/src/tui/model.js +18 -5
  64. package/dist/src/tui/model.js.map +1 -1
  65. package/dist/src/tui/scoped-inventory.d.ts +9 -1
  66. package/dist/src/tui/scoped-inventory.js +16 -1
  67. package/dist/src/tui/scoped-inventory.js.map +1 -1
  68. package/dist/src/utils/catalog-source-references.d.ts +37 -1
  69. package/dist/src/utils/catalog-source-references.js +361 -94
  70. package/dist/src/utils/catalog-source-references.js.map +1 -1
  71. package/dist/src/utils/codex-config.d.ts +3 -0
  72. package/dist/src/utils/codex-config.js +7 -0
  73. package/dist/src/utils/codex-config.js.map +1 -1
  74. package/dist/src/utils/local-marketplace.d.ts +2 -0
  75. package/dist/src/utils/local-marketplace.js +12 -0
  76. package/dist/src/utils/local-marketplace.js.map +1 -1
  77. package/package.json +3 -3
@@ -34,7 +34,7 @@ import { agentLabel, platformLabel, scopeLabel, recoveryReason } from './glossar
34
34
  import { skillInvocationNotices, skillInvocationProductLabel } from '../output/skill-invocation-notices.js';
35
35
  import { hasComponentDeliveryNotice, isDeliveryNoticeCode, isInstallationAdvisory } from '../output/component-delivery.js';
36
36
  import { describeSkillInvocationControl, SKILL_INVOCATION_NOTICE } from '../utils/skill-invocation-warning.js';
37
- import { deploymentPlanLines, deploymentResultLines, deploymentObservationLines, deploymentExclusionLines, componentDeliveryLines, deliveryNoticeText } from './deployment-view.js';
37
+ import { deploymentPlanLines, deploymentResultLines, deploymentObservationLines, deploymentExclusionLines, componentDeliveryLines, deliveryNoticeText, sharedNativeRetirementImpact } from './deployment-view.js';
38
38
  import { inventoryRecoveryActions, projectDeploymentNotices, projectDeploymentReceipt, projectDeploymentObservation } from '../commands/public-lifecycle-result.js';
39
39
  import { InputDisplay, removeLastGrapheme } from './input-display.js';
40
40
  import { QueryHeader, querySearchWidth } from './query-header.js';
@@ -88,6 +88,10 @@ function scopedRiskReasons(plan) {
88
88
  if (plan.kind === 'retire')
89
89
  return [
90
90
  ...(plan.plan.options.deleteConfig ? ['本次会删除此插件的全部本机设置(通用与各 Agent),影响所有项目。'] : []),
91
+ ...new Set(scopedDeploymentPlans(plan).flatMap((deployment) => {
92
+ const impact = sharedNativeRetirementImpact(deployment);
93
+ return impact ? [impact] : [];
94
+ })),
91
95
  ...(plan.scope === 'user' && plan.plan.plannedImpact.outputs
92
96
  ? ['本次会清理个人原生输出,可能影响其他项目。'] : []),
93
97
  ];
@@ -4704,10 +4708,14 @@ export function ConsoleAppV4(props) {
4704
4708
  }
4705
4709
  else if (flow.stage === 'recoveryScope') {
4706
4710
  title = flow.command === 'uninstall' ? '选择卸载范围' : '选择清理范围';
4707
- description = '确认变化后处理此范围,保留其他范围仍需要的内容。';
4711
+ description = flow.command === 'retire'
4712
+ ? '选择要清理的范围;共享影响将在操作汇总中列出。'
4713
+ : '确认变化后处理此范围,保留其他范围仍需要的内容。';
4708
4714
  actions = flow.scopes.map((selectedScope) => ({ label: scopeLabel(selectedScope),
4709
- status: 'error', run: () => beginScopedTask({ kind: 'recovery', command: flow.command,
4710
- scope: selectedScope, selectors: flow.selectors ?? [flow.selector] }) }));
4715
+ status: 'error', run: () => flow.command === 'retire'
4716
+ ? beginScopedTask({ kind: 'retire', selector: flow.selector, scope: selectedScope, deleteConfig: flow.deleteConfig })
4717
+ : beginScopedTask({ kind: 'recovery', command: flow.command,
4718
+ scope: selectedScope, selectors: flow.selectors ?? [flow.selector] }) }));
4711
4719
  content = _jsx(SemanticRows, { actions: actions, focus: flow.focus, kind: "action", compact: true });
4712
4720
  }
4713
4721
  else if (flow.stage === 'intentScope') {
@@ -4926,8 +4934,8 @@ export function ConsoleAppV4(props) {
4926
4934
  ? [{ actionId: 'inventory-remove-demand', label: '移除此插件需求(保留安装)',
4927
4935
  run: () => beginScopedTask({ kind: 'intent', action: 'remove', scope: route.scope,
4928
4936
  selector: activeRoot.pluginId }) }] : []),
4929
- ...(activeRoot && activeRoot.sourceState === 'ready'
4930
- && activeRoot.blockers?.some((blocker) => blocker.code === 'pluginUnavailable')
4937
+ ...(activeRoot?.retirementCandidate && (section === 'extraInstalled'
4938
+ || activeRoot.sourceState === 'ready' && activeRoot.blockers?.some((blocker) => blocker.code === 'pluginUnavailable'))
4931
4939
  ? [{ actionId: 'inventory-retire', label: '停用已移除插件(保留设置)',
4932
4940
  run: () => beginScopedTask({ kind: 'retire', scope: route.scope,
4933
4941
  selector: activeRoot.pluginId, deleteConfig: false }) },
@@ -5110,7 +5118,8 @@ export function ConsoleAppV4(props) {
5110
5118
  name: item.displayName,
5111
5119
  sourceLabel: item.sourceLabel,
5112
5120
  description: item.configOnly
5113
- ? '来源当前没有这个插件;可以查看已保存设置或定点重置设置层。'
5121
+ ? item.retirementCandidate ? '插件已下架;可以查看或显式清理已保存设置。'
5122
+ : '来源当前没有这个插件;可以查看已保存设置或定点重置设置层。'
5114
5123
  : item.description,
5115
5124
  placementSummary: (() => {
5116
5125
  const subject = props.controller.getPluginDetailSubject(item.pluginId);
@@ -6424,10 +6433,10 @@ export function ConsoleAppV4(props) {
6424
6433
  context = `${plugin.sourceLabel}${plugin.version ? ` · ${plugin.version}` : ''}`;
6425
6434
  title = plugin.displayName;
6426
6435
  description = '';
6427
- const updateTaskCandidates = plugin.configOnly ? []
6436
+ const updateTaskCandidates = plugin.configOnly || plugin.retirementCandidate ? []
6428
6437
  : props.controller.listPluginWriteTaskCandidates('update')
6429
6438
  .filter((candidate) => candidate.target.pluginId === plugin.pluginId);
6430
- const restoreTaskCandidates = plugin.configOnly ? []
6439
+ const restoreTaskCandidates = plugin.configOnly || plugin.retirementCandidate ? []
6431
6440
  : props.controller.listPluginWriteTaskCandidates('restore')
6432
6441
  .filter((candidate) => candidate.target.pluginId === plugin.pluginId);
6433
6442
  const updateAction = updateTaskCandidates.length > 0 ? {
@@ -6477,7 +6486,7 @@ export function ConsoleAppV4(props) {
6477
6486
  description: '当前插件设置问题需要先完成或修正设置',
6478
6487
  status: 'warning',
6479
6488
  run: () => go({ name: 'issueDetail', issueId: configIssue.issueId }),
6480
- } : plugin.aggregateStatus === 'unavailable'
6489
+ } : plugin.retirementCandidate ? undefined : plugin.aggregateStatus === 'unavailable'
6481
6490
  ? plugin.capabilityUnsupported && !plugin.sourceUnavailable ? {
6482
6491
  label: '需要升级 AW CLI',
6483
6492
  description: '查看缺少的功能和安全恢复方向',
@@ -6556,7 +6565,7 @@ export function ConsoleAppV4(props) {
6556
6565
  : '当前没有已声明的所需插件或使用者',
6557
6566
  run: () => go({ name: 'pluginDependencies', pluginId: plugin.pluginId }),
6558
6567
  } : undefined;
6559
- const uninstallAction = installed ? {
6568
+ const uninstallAction = installed && !plugin.retirementCandidate ? {
6560
6569
  actionId: 'uninstall',
6561
6570
  label: '卸载',
6562
6571
  description: plugin.installedPlacements.length === 1
@@ -6585,7 +6594,32 @@ export function ConsoleAppV4(props) {
6585
6594
  go({ name: 'uninstallTargets', pluginId: plugin.pluginId });
6586
6595
  },
6587
6596
  } : undefined;
6588
- const cleanupAction = plugin.configOnly
6597
+ const retirementScopes = plugin.retirementCandidate ? ['user', 'project'].filter((candidate) => {
6598
+ const inventory = snapshot.scopedInventories[candidate];
6599
+ return detailSubject.declarations[candidate].state === 'declared'
6600
+ || detailSubject.placements.some((placement) => placement.scope === candidate)
6601
+ || [...(inventory?.declaredRoots ?? []), ...(inventory?.extraInstalledRoots ?? [])].some((root) => root.pluginId === plugin.pluginId)
6602
+ || props.controller.listPluginWriteBatchTargets('cleanup', [plugin.pluginId]).some((target) => target.scope === candidate);
6603
+ }) : [];
6604
+ const cleanupScopes = retirementScopes.length ? retirementScopes : plugin.savedConfigScopes;
6605
+ const beginRetirement = (deleteConfig) => {
6606
+ if (cleanupScopes.length === 1) {
6607
+ beginScopedTask({ kind: 'retire', selector: plugin.pluginId, scope: cleanupScopes[0], deleteConfig });
6608
+ }
6609
+ else {
6610
+ setScopedFlow({ stage: 'recoveryScope', scope, selector: plugin.pluginId, command: 'retire',
6611
+ deleteConfig, scopes: cleanupScopes, focus: 0 });
6612
+ }
6613
+ };
6614
+ const cleanupAction = plugin.retirementCandidate ? {
6615
+ actionId: 'cleanup',
6616
+ label: plugin.configOnly ? '清理已删除插件并删除设置' : '清理已删除插件',
6617
+ description: plugin.configOnly ? '显式删除全部本机设置;确认前不会写入'
6618
+ : '预览所选范围的全部残留;默认保留设置',
6619
+ disabled: cleanupScopes.length ? undefined : '当前无法确认残留范围,请重新检查',
6620
+ status: 'error',
6621
+ run: () => beginRetirement(plugin.configOnly === true),
6622
+ } : plugin.configOnly
6589
6623
  || plugin.removedPluginCleanupRequired ? {
6590
6624
  actionId: 'cleanup',
6591
6625
  label: plugin.removedPluginCleanupRequired ? '清理已删除插件' : '检查并清理插件残留',
@@ -6605,7 +6639,7 @@ export function ConsoleAppV4(props) {
6605
6639
  actions = dedupeActions([
6606
6640
  ...(exceptionalAction ? [{ ...exceptionalAction, actionId: 'exceptional' }] : []),
6607
6641
  ...(restoreAction ? [{ ...restoreAction, actionId: 'restore' }] : []),
6608
- ...(hasPortablePlacement && !restoreAction ? [{ actionId: 'sync', label: '同步并修复…',
6642
+ ...(hasPortablePlacement && !plugin.retirementCandidate && !restoreAction ? [{ actionId: 'sync', label: '同步并修复…',
6609
6643
  run: () => beginScopedTask({ kind: 'recovery', command: 'sync',
6610
6644
  scope: detailSubject.placements.some((placement) => placement.scope === 'project')
6611
6645
  || detailSubject.declarations.project.state === 'declared' ? 'project' : 'user',
@@ -6639,6 +6673,9 @@ export function ConsoleAppV4(props) {
6639
6673
  ...(dependencyAction ? [dependencyAction] : []),
6640
6674
  ...(uninstallAction ? [uninstallAction] : []),
6641
6675
  ...(cleanupAction ? [cleanupAction] : []),
6676
+ ...(plugin.retirementCandidate && !plugin.configOnly && plugin.savedConfigScopes.length > 0
6677
+ ? [{ actionId: 'cleanup-config', label: '清理已删除插件并删除设置', status: 'error',
6678
+ run: () => beginRetirement(true) }] : []),
6642
6679
  {
6643
6680
  actionId: 'more',
6644
6681
  label: '更多操作',