@lesliechan721/aw 0.1.0-beta.19 → 0.1.0-beta.20

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.
@@ -1489,7 +1489,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
1489
1489
  if (blockedPlanTargets.length === 0)
1490
1490
  break;
1491
1491
  const requestedKeys = new Set(draft.executableTargets.map(pluginWriteTaskTargetKey));
1492
- const errorCodesByRoot = new Map();
1492
+ const blockedPlansByRoot = new Map();
1493
1493
  for (const blockedPlanTarget of blockedPlanTargets) {
1494
1494
  const pending = [blockedPlanTarget];
1495
1495
  const visited = new Set();
@@ -1533,25 +1533,45 @@ export function createTuiControllerDependencies(context, progressFeed, options =
1533
1533
  throw new TuiOperationBlockedError('taskPlanConsumerMissing', '任务计划中的阻止项无法映射到请求目标。');
1534
1534
  }
1535
1535
  for (const key of mappedRoots) {
1536
- const codes = errorCodesByRoot.get(key) ?? new Set();
1537
- codes.add(blockedPlanTarget.errorCode ?? 'writePlanBlocked');
1538
- errorCodesByRoot.set(key, codes);
1536
+ const plans = blockedPlansByRoot.get(key) ?? [];
1537
+ plans.push(blockedPlanTarget);
1538
+ blockedPlansByRoot.set(key, plans);
1539
1539
  }
1540
1540
  }
1541
1541
  blockedTargets.push(...draft.executableTargets.flatMap((target) => {
1542
- const codes = errorCodesByRoot.get(pluginWriteTaskTargetKey(target));
1543
- return codes ? [{
1542
+ const plans = blockedPlansByRoot.get(pluginWriteTaskTargetKey(target));
1543
+ return plans ? [{
1544
1544
  target,
1545
1545
  reason: 'targetUnavailable',
1546
1546
  issueIds: draft.causes.filter((cause) => cause.consumers.some((consumer) => pluginWriteTaskTargetKey(consumer) === pluginWriteTaskTargetKey(target)))
1547
1547
  .map((cause) => cause.issueId),
1548
- errorCodes: [...codes].sort((left, right) => left.localeCompare(right, 'en')),
1548
+ errorCodes: [...new Set(plans.map((plan) => plan.errorCode ?? 'writePlanBlocked'))]
1549
+ .sort((left, right) => left.localeCompare(right, 'en')),
1550
+ diagnostics: plans.map((plan, index) => ({
1551
+ id: `task-plan:${sourceId}:${target.pluginId}:${target.platform}:${target.scope}:${index}`,
1552
+ code: plan.errorCode ?? 'writePlanBlocked',
1553
+ stage: 'dependencyPlan',
1554
+ sourceId,
1555
+ target: {
1556
+ pluginId: plan.pluginId, platform: plan.platform,
1557
+ scope: plan.requestedScope ?? plan.resolvedScope,
1558
+ },
1559
+ causes: [],
1560
+ detailLines: [],
1561
+ safeMessage: plan.errorCode === 'artifactCollision'
1562
+ ? '输出位置存在外来内容,无法覆盖。'
1563
+ : plan.errorCode === 'exclusiveOwnerEvidenceInvalid'
1564
+ ? '独立扩展的归属标记缺失或损坏。'
1565
+ : plan.errorCode === 'dependencyNotReady'
1566
+ ? '依赖安装状态无法读取。'
1567
+ : '依赖计划阻止了此目标。',
1568
+ })),
1549
1569
  }] : [];
1550
1570
  }));
1551
- draft.executableTargets = draft.executableTargets.filter((target) => !errorCodesByRoot.has(pluginWriteTaskTargetKey(target)));
1571
+ draft.executableTargets = draft.executableTargets.filter((target) => !blockedPlansByRoot.has(pluginWriteTaskTargetKey(target)));
1552
1572
  draft.causes = draft.causes.map((cause) => ({
1553
1573
  ...cause,
1554
- consumers: cause.consumers.filter((consumer) => !errorCodesByRoot.has(pluginWriteTaskTargetKey(consumer))),
1574
+ consumers: cause.consumers.filter((consumer) => !blockedPlansByRoot.has(pluginWriteTaskTargetKey(consumer))),
1555
1575
  })).filter((cause) => cause.consumers.length > 0);
1556
1576
  }
1557
1577
  if (!preview?.operationPlan || draft.executableTargets.length === 0)