@lesliechan721/aw 0.1.0-beta.54 → 0.1.0-beta.56

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 (109) hide show
  1. package/dist/authoring/scripts/lib/plugin-version-check.mjs +1 -1
  2. package/dist/authoring/scripts/validate-plugin.mjs +208 -31
  3. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  4. package/dist/scripts/bundle-plugins.js +8 -3
  5. package/dist/scripts/bundle-plugins.js.map +1 -1
  6. package/dist/src/adapters/helpers.d.ts +7 -0
  7. package/dist/src/adapters/helpers.js.map +1 -1
  8. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  9. package/dist/src/commands/aw-capabilities.js +2 -0
  10. package/dist/src/commands/aw-capabilities.js.map +1 -1
  11. package/dist/src/commands/managed-commands.d.ts +26 -0
  12. package/dist/src/commands/managed-commands.js +277 -0
  13. package/dist/src/commands/managed-commands.js.map +1 -0
  14. package/dist/src/commands/operation-plan.d.ts +30 -1
  15. package/dist/src/commands/operation-plan.js.map +1 -1
  16. package/dist/src/commands/operation-planner.d.ts +1 -0
  17. package/dist/src/commands/operation-planner.js +1 -0
  18. package/dist/src/commands/operation-planner.js.map +1 -1
  19. package/dist/src/commands/plugin-capabilities.js +29 -1
  20. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  21. package/dist/src/commands/rebuild-command.d.ts +2 -1
  22. package/dist/src/commands/rebuild-command.js +66 -26
  23. package/dist/src/commands/rebuild-command.js.map +1 -1
  24. package/dist/src/commands/rebuild-integration.d.ts +13 -1
  25. package/dist/src/commands/rebuild-integration.js +535 -61
  26. package/dist/src/commands/rebuild-integration.js.map +1 -1
  27. package/dist/src/commands/rebuild-operations.d.ts +3 -1
  28. package/dist/src/commands/rebuild-operations.js +9 -5
  29. package/dist/src/commands/rebuild-operations.js.map +1 -1
  30. package/dist/src/generators/local-plugin.js +16 -0
  31. package/dist/src/generators/local-plugin.js.map +1 -1
  32. package/dist/src/generators/permissions.d.ts +5 -2
  33. package/dist/src/generators/permissions.js +28 -15
  34. package/dist/src/generators/permissions.js.map +1 -1
  35. package/dist/src/index.js +11 -0
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/output/command-receipt.d.ts +3 -1
  38. package/dist/src/output/command-receipt.js +30 -9
  39. package/dist/src/output/command-receipt.js.map +1 -1
  40. package/dist/src/output/rebuild-progress.js +14 -0
  41. package/dist/src/output/rebuild-progress.js.map +1 -1
  42. package/dist/src/portable/materializer.js +3 -0
  43. package/dist/src/portable/materializer.js.map +1 -1
  44. package/dist/src/review/skill-materialization.d.ts +14 -1
  45. package/dist/src/review/skill-materialization.js +138 -0
  46. package/dist/src/review/skill-materialization.js.map +1 -1
  47. package/dist/src/tui/console-app-v4.js +19 -7
  48. package/dist/src/tui/console-app-v4.js.map +1 -1
  49. package/dist/src/tui/controller-runtime.js +23 -9
  50. package/dist/src/tui/controller-runtime.js.map +1 -1
  51. package/dist/src/tui/controller.d.ts +5 -1
  52. package/dist/src/tui/controller.js +24 -3
  53. package/dist/src/tui/controller.js.map +1 -1
  54. package/dist/src/tui/diagnostic-projection.js +34 -6
  55. package/dist/src/tui/diagnostic-projection.js.map +1 -1
  56. package/dist/src/tui/operation-review-planner.js +102 -16
  57. package/dist/src/tui/operation-review-planner.js.map +1 -1
  58. package/dist/src/types.d.ts +22 -2
  59. package/dist/src/types.js.map +1 -1
  60. package/dist/src/utils/artifact-plan.d.ts +4 -3
  61. package/dist/src/utils/artifact-plan.js +50 -7
  62. package/dist/src/utils/artifact-plan.js.map +1 -1
  63. package/dist/src/utils/artifact-renderer.d.ts +7 -3
  64. package/dist/src/utils/artifact-renderer.js +19 -6
  65. package/dist/src/utils/artifact-renderer.js.map +1 -1
  66. package/dist/src/utils/artifact-request.d.ts +16 -5
  67. package/dist/src/utils/artifact-request.js +27 -15
  68. package/dist/src/utils/artifact-request.js.map +1 -1
  69. package/dist/src/utils/artifact-sources.d.ts +4 -0
  70. package/dist/src/utils/artifact-sources.js +17 -0
  71. package/dist/src/utils/artifact-sources.js.map +1 -1
  72. package/dist/src/utils/bundle-layout.js +7 -0
  73. package/dist/src/utils/bundle-layout.js.map +1 -1
  74. package/dist/src/utils/claude-skills-root.d.ts +8 -0
  75. package/dist/src/utils/claude-skills-root.js +76 -0
  76. package/dist/src/utils/claude-skills-root.js.map +1 -0
  77. package/dist/src/utils/codex-skills-root.d.ts +4 -0
  78. package/dist/src/utils/codex-skills-root.js +25 -0
  79. package/dist/src/utils/codex-skills-root.js.map +1 -0
  80. package/dist/src/utils/dynamic-skill-tree.d.ts +1 -0
  81. package/dist/src/utils/dynamic-skill-tree.js +25 -6
  82. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  83. package/dist/src/utils/local-marketplace.d.ts +9 -0
  84. package/dist/src/utils/local-marketplace.js +170 -90
  85. package/dist/src/utils/local-marketplace.js.map +1 -1
  86. package/dist/src/utils/managed-command-closure.d.ts +3 -0
  87. package/dist/src/utils/managed-command-closure.js +35 -0
  88. package/dist/src/utils/managed-command-closure.js.map +1 -0
  89. package/dist/src/utils/managed-command-evidence.d.ts +7 -0
  90. package/dist/src/utils/managed-command-evidence.js +86 -0
  91. package/dist/src/utils/managed-command-evidence.js.map +1 -0
  92. package/dist/src/utils/managed-command-materialization.d.ts +106 -0
  93. package/dist/src/utils/managed-command-materialization.js +307 -0
  94. package/dist/src/utils/managed-command-materialization.js.map +1 -0
  95. package/dist/src/utils/managed-command-runtime.d.ts +32 -0
  96. package/dist/src/utils/managed-command-runtime.js +110 -0
  97. package/dist/src/utils/managed-command-runtime.js.map +1 -0
  98. package/dist/src/utils/managed-command-store.d.ts +124 -0
  99. package/dist/src/utils/managed-command-store.js +576 -0
  100. package/dist/src/utils/managed-command-store.js.map +1 -0
  101. package/dist/src/utils/ownership.d.ts +2 -0
  102. package/dist/src/utils/plugin-config-impact.d.ts +8 -1
  103. package/dist/src/utils/plugin-config-impact.js +101 -26
  104. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  105. package/dist/src/utils/plugin-config-write.js +142 -60
  106. package/dist/src/utils/plugin-config-write.js.map +1 -1
  107. package/dist/src/utils/rendered-contract.js +18 -1
  108. package/dist/src/utils/rendered-contract.js.map +1 -1
  109. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import type { ConfigReferenceContext, ConfigReferenceDraft } from './config-references.js';
2
- import type { CatalogActivationMode, CatalogSource, CatalogGenerationActiveV1, CatalogGenerationCandidateEvidence, CatalogGenerationSyncResult, CatalogSourceImpact, DependencyScopeOverride, PlatformName, Scope } from '../types.js';
2
+ import type { CatalogActivationMode, CatalogSource, CatalogGenerationActiveV1, CatalogGenerationCandidateEvidence, CatalogGenerationSyncResult, CatalogSourceImpact, CommandProducerResult, DependencyScopeOverride, PlatformName, Scope } from '../types.js';
3
3
  import type { PortableReview, PortableInstallReceipt, PortableRetryReview } from '../portable/commands.js';
4
4
  import type { CatalogSourceUpdate } from '../utils/catalog-sources.js';
5
5
  import type { CatalogGenerationFreshnessState, CatalogGenerationFreshnessResult } from '../utils/catalog-generation-service.js';
@@ -8,6 +8,7 @@ import type { ReconcileOperationPlan } from '../commands/reconcile-operation-pla
8
8
  import type { PreApplyAuthorizationTarget, RebuildCommandResult } from '../commands/rebuild-command.js';
9
9
  import type { OfflineCleanupTargetEvidence } from '../commands/offline-cleanup-evidence.js';
10
10
  import type { CodexReconcilePlan } from '../utils/codex-reconciler.js';
11
+ import type { PluginConfigMutationImpact } from '../utils/plugin-config-impact.js';
11
12
  import type { OperationPlan } from '../commands/operation-plan.js';
12
13
  import type { RebuildProgressFeed, RebuildProgressSnapshot } from '../output/rebuild-progress.js';
13
14
  import { type ConfigPageViewModel, type ConfigGroupViewModel, type InstallPlacementDraftViewModel, type PluginListItemViewModel, type PluginDependencyOverviewViewModel, type PortableSkillSelectionViewModel, type SourceHealthViewModel, type SourceDetailViewModel, type TuiViewModel, type UserIssueCategory, type UserIssueViewModel } from './model.js';
@@ -264,11 +265,13 @@ export interface ConfigOperationEvidence {
264
265
  platform: PlatformName;
265
266
  scope: Scope;
266
267
  }>;
268
+ commandPackages?: PluginConfigMutationImpact['affectedCommandPackages'];
267
269
  preApplyAuthorization?: PreApplyAuthorizationTarget[];
268
270
  sharedNativeRenderTargets?: Array<{
269
271
  id: string;
270
272
  skillKey: string;
271
273
  refreshKeys: string[];
274
+ platform?: PlatformName;
272
275
  }>;
273
276
  shareability?: 'verified' | 'unverified';
274
277
  }
@@ -541,6 +544,7 @@ export interface OperationResultSummary {
541
544
  changes?: string[];
542
545
  warnings?: string[];
543
546
  recoveryActions?: string[];
547
+ commandResults?: CommandProducerResult[];
544
548
  planFingerprint?: string;
545
549
  diagnosticIds?: string[];
546
550
  effects?: OperationEffectFacts;
@@ -480,6 +480,11 @@ function sanitizeOperationSummary(summary, sensitiveValues) {
480
480
  ...(summary.changes ? { changes: summary.changes.map(text) } : {}),
481
481
  ...(summary.warnings ? { warnings: summary.warnings.map(text) } : {}),
482
482
  ...(summary.recoveryActions ? { recoveryActions: summary.recoveryActions.map(text) } : {}),
483
+ ...(summary.commandResults ? { commandResults: summary.commandResults.map((result) => ({
484
+ ...result,
485
+ errors: result.errors.map((error) => ({ ...error, message: text(error.message) })),
486
+ recoveryActions: result.recoveryActions.map(text),
487
+ })) } : {}),
483
488
  ...(summary.quarantineBasename ? { quarantineBasename: text(summary.quarantineBasename) } : {}),
484
489
  ...(summary.portable ? {
485
490
  portable: {
@@ -3437,7 +3442,9 @@ export class TuiController {
3437
3442
  const configImpact = configEvidence ? {
3438
3443
  state: configEvidence.some((group) => group.impactState !== 'known') ? 'unknown' : 'known',
3439
3444
  affectedTargetCount: new Set(configEvidence.flatMap((group) => group.affectedTargets
3440
- .map((target) => `${target.platform}\0${target.scope}`))).size,
3445
+ .map((target) => `${target.platform}\0${target.scope}`))).size
3446
+ + new Set(configEvidence.flatMap((group) => (group.commandPackages ?? [])
3447
+ .map((target) => target.packageId))).size,
3441
3448
  } : undefined;
3442
3449
  const projection = buildOperationReviewProjection({
3443
3450
  intent,
@@ -4464,14 +4471,19 @@ function operationResultSummaryUnsafe(intent, execution) {
4464
4471
  || root.state === 'kept' || root.state === 'partial').length;
4465
4472
  const failedCount = roots.filter((root) => root.state === 'failed' || root.state === 'partial'
4466
4473
  || root.state === 'notStarted' || root.state === 'blocked').length;
4467
- const code = failedCount === 0 ? 'operationSucceeded'
4474
+ const commandFailed = taskExecution.commandResults?.some((result) => result.state !== 'completed') === true;
4475
+ const code = failedCount === 0 && !commandFailed ? 'operationSucceeded'
4468
4476
  : completedCount > 0 ? 'operationPartial' : 'operationFailed';
4469
4477
  return {
4470
4478
  code,
4471
4479
  message: code === 'operationSucceeded' ? '任务已完成。'
4472
4480
  : code === 'operationPartial' ? '任务只完成了一部分。' : '任务没有完成。',
4473
4481
  warnings: taskExecution.warnings,
4474
- recoveryActions: [...new Set(taskExecution.targetResults.flatMap((entry) => entry.recoveryActions ?? []))],
4482
+ recoveryActions: [...new Set([
4483
+ ...taskExecution.targetResults.flatMap((entry) => entry.recoveryActions ?? []),
4484
+ ...(taskExecution.commandResults ?? []).flatMap((result) => result.recoveryActions),
4485
+ ])],
4486
+ ...(taskExecution.commandResults ? { commandResults: taskExecution.commandResults } : {}),
4475
4487
  ...(taskExecution.operationPlan?.planFingerprint
4476
4488
  ? { planFingerprint: taskExecution.operationPlan.planFingerprint } : {}),
4477
4489
  task: {
@@ -4615,6 +4627,7 @@ function operationResultSummaryUnsafe(intent, execution) {
4615
4627
  requiredBy: entry.requiredBy,
4616
4628
  ...(entry.errorCode ? { errorCode: safeDiagnosticCode(entry.errorCode, 'writeFailed') } : {}),
4617
4629
  })),
4630
+ ...(result.commandResults ? { commandResults: result.commandResults } : {}),
4618
4631
  };
4619
4632
  }
4620
4633
  if (intent.kind === 'configSaveBatch') {
@@ -4657,6 +4670,10 @@ function operationResultSummaryUnsafe(intent, execution) {
4657
4670
  applyStatus: group.applyStatus,
4658
4671
  ...(group.errorCode ? { errorCode: safeDiagnosticCode(group.errorCode, 'configWriteFailed') } : {}),
4659
4672
  })),
4673
+ commandResults: batch.groups.flatMap((group) => group.execution
4674
+ && typeof group.execution === 'object'
4675
+ ? (group.execution.apply?.commandResults ?? [])
4676
+ : []),
4660
4677
  messages: [
4661
4678
  ...batch.groups.map((group) => {
4662
4679
  const label = group.scope === 'project' ? '当前项目' : '个人默认';
@@ -4682,6 +4699,8 @@ function operationResultSummaryUnsafe(intent, execution) {
4682
4699
  const rawTargets = Array.isArray(rawApply.targetResults)
4683
4700
  ? rawApply.targetResults
4684
4701
  : [];
4702
+ const commandResults = Array.isArray(rawApply.commandResults)
4703
+ ? rawApply.commandResults : [];
4685
4704
  const targets = rawTargets.flatMap((entry) => {
4686
4705
  const target = typeof entry.target === 'object' && entry.target !== null
4687
4706
  ? entry.target
@@ -4764,6 +4783,8 @@ function operationResultSummaryUnsafe(intent, execution) {
4764
4783
  }
4765
4784
  : {}),
4766
4785
  ...(targets.length > 0 ? { targets } : {}),
4786
+ ...(commandResults.length > 0 ? { commandResults,
4787
+ recoveryActions: [...new Set(commandResults.flatMap((result) => result.recoveryActions))] } : {}),
4767
4788
  };
4768
4789
  }
4769
4790
  const sourceWarnings = intent.kind === 'sourceMutation'