@lesliechan721/aw 0.1.0-beta.13 → 0.1.0-beta.15

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 (66) hide show
  1. package/dist/src/commands/catalog-dev-source.d.ts +31 -0
  2. package/dist/src/commands/catalog-dev-source.js +165 -5
  3. package/dist/src/commands/catalog-dev-source.js.map +1 -1
  4. package/dist/src/commands/catalog-generation.d.ts +5 -0
  5. package/dist/src/commands/catalog-generation.js.map +1 -1
  6. package/dist/src/commands/catalog-publication-journal.d.ts +12 -0
  7. package/dist/src/commands/catalog-publication-journal.js +77 -0
  8. package/dist/src/commands/catalog-publication-journal.js.map +1 -1
  9. package/dist/src/commands/catalog-store.d.ts +5 -0
  10. package/dist/src/commands/catalog-store.js +19 -1
  11. package/dist/src/commands/catalog-store.js.map +1 -1
  12. package/dist/src/commands/dependency-operation-plan.d.ts +7 -0
  13. package/dist/src/commands/dependency-operation-plan.js +63 -27
  14. package/dist/src/commands/dependency-operation-plan.js.map +1 -1
  15. package/dist/src/commands/rebuild-command.d.ts +22 -8
  16. package/dist/src/commands/rebuild-command.js +562 -250
  17. package/dist/src/commands/rebuild-command.js.map +1 -1
  18. package/dist/src/commands/reconcile-operation-plan.d.ts +11 -9
  19. package/dist/src/commands/reconcile-operation-plan.js +25 -6
  20. package/dist/src/commands/reconcile-operation-plan.js.map +1 -1
  21. package/dist/src/commands/status-v6.d.ts +2 -1
  22. package/dist/src/commands/status-v6.js +7 -1
  23. package/dist/src/commands/status-v6.js.map +1 -1
  24. package/dist/src/commands/write-commands.d.ts +2 -1
  25. package/dist/src/commands/write-commands.js +24 -1
  26. package/dist/src/commands/write-commands.js.map +1 -1
  27. package/dist/src/tui/catalog-management-screens.d.ts +45 -0
  28. package/dist/src/tui/catalog-management-screens.js +25 -0
  29. package/dist/src/tui/catalog-management-screens.js.map +1 -0
  30. package/dist/src/tui/catalog-management.d.ts +240 -0
  31. package/dist/src/tui/catalog-management.js +856 -0
  32. package/dist/src/tui/catalog-management.js.map +1 -0
  33. package/dist/src/tui/catalog-sources/session.d.ts +5 -0
  34. package/dist/src/tui/catalog-sources/session.js +49 -1
  35. package/dist/src/tui/catalog-sources/session.js.map +1 -1
  36. package/dist/src/tui/catalog-sources/types.d.ts +11 -0
  37. package/dist/src/tui/console-app-v4.d.ts +1 -1
  38. package/dist/src/tui/console-app-v4.js +2597 -587
  39. package/dist/src/tui/console-app-v4.js.map +1 -1
  40. package/dist/src/tui/controller-runtime.js +668 -50
  41. package/dist/src/tui/controller-runtime.js.map +1 -1
  42. package/dist/src/tui/controller.d.ts +136 -7
  43. package/dist/src/tui/controller.js +752 -19
  44. package/dist/src/tui/controller.js.map +1 -1
  45. package/dist/src/tui/dependency-graph.d.ts +67 -0
  46. package/dist/src/tui/dependency-graph.js +399 -0
  47. package/dist/src/tui/dependency-graph.js.map +1 -0
  48. package/dist/src/tui/lifecycle-action-view.js +4 -2
  49. package/dist/src/tui/lifecycle-action-view.js.map +1 -1
  50. package/dist/src/tui/model.d.ts +37 -0
  51. package/dist/src/tui/model.js +163 -7
  52. package/dist/src/tui/model.js.map +1 -1
  53. package/dist/src/tui/operation-review-planner.js +266 -9
  54. package/dist/src/tui/operation-review-planner.js.map +1 -1
  55. package/dist/src/tui/plugin-write-task.d.ts +67 -0
  56. package/dist/src/tui/plugin-write-task.js +282 -0
  57. package/dist/src/tui/plugin-write-task.js.map +1 -0
  58. package/dist/src/tui/router.d.ts +39 -2
  59. package/dist/src/tui/router.js +13 -5
  60. package/dist/src/tui/router.js.map +1 -1
  61. package/dist/src/tui/screen-registry.d.ts +125 -6
  62. package/dist/src/tui/screen-registry.js +35 -4
  63. package/dist/src/tui/screen-registry.js.map +1 -1
  64. package/dist/src/utils/catalog-generation-service.d.ts +4 -0
  65. package/dist/src/utils/catalog-generation-service.js.map +1 -1
  66. package/package.json +3 -3
@@ -1,8 +1,9 @@
1
+ import { type CatalogDevManagementViewModel, type CatalogManagementIntent, type CatalogManagementReviewEvidence, type CatalogManagementService, type CatalogPublicationManagementViewModel, type CatalogStoreManagementViewModel, type CatalogValidationViewModel, type CatalogWorkspaceManagementViewModel } from './catalog-management.js';
1
2
  import type { CatalogActivationMode, CatalogSource, CatalogGenerationActiveV1, CatalogGenerationCandidateEvidence, CatalogGenerationSyncResult, CatalogSourceImpact, DependencyScopeOverride, PlatformName, Scope } from '../types.js';
2
3
  import type { PortableReview } from '../portable/commands.js';
3
4
  import type { CatalogSourceUpdate } from '../utils/catalog-sources.js';
4
5
  import type { CatalogGenerationFreshnessState, CatalogGenerationFreshnessResult } from '../utils/catalog-generation-service.js';
5
- import type { StatusV7Payload, StatusV7PluginSummary, StatusTargetRevision } from '../commands/status-v6.js';
6
+ import type { StatusV7Payload, StatusV7PluginSummary, StatusV7Target, StatusTargetRevision } from '../commands/status-v6.js';
6
7
  import type { ReconcileOperationPlan } from '../commands/reconcile-operation-plan.js';
7
8
  import type { RebuildCommandResult } from '../commands/rebuild-command.js';
8
9
  import type { OfflineCleanupTargetEvidence } from '../commands/offline-cleanup-evidence.js';
@@ -15,9 +16,11 @@ import { type ConfigInvalidStoreEvidence, type PluginInstallFilter, type Portabl
15
16
  import { type CatalogSourceGenerationViewModel } from './catalog-generation.js';
16
17
  import type { CatalogSourceFreshnessViewModel } from './catalog-freshness.js';
17
18
  import type { CatalogSessionReusableCandidate } from './catalog-sources/types.js';
18
- type CatalogActivationBlockReason = 'configDraft' | 'sourceDraft' | 'batchDraft' | 'portableDraft' | 'activeReview' | 'reviewPreparation' | 'writeProgress';
19
+ import { type PluginWriteTaskBlockedTarget, type PluginWriteTaskCandidate, type PluginWriteTaskCause, type PluginWriteTaskGoal, type PluginWriteTaskIntent, type PluginWriteTaskTarget } from './plugin-write-task.js';
20
+ export type { PluginWriteTaskBlockReason, PluginWriteTaskCandidate, PluginWriteTaskExpectedUpdate, PluginWriteTaskGoal, PluginWriteTaskIntent, PluginWriteTaskMethod, PluginWriteTaskTarget, } from './plugin-write-task.js';
21
+ type CatalogActivationBlockReason = 'configDraft' | 'sourceDraft' | 'batchDraft' | 'catalogDraft' | 'portableDraft' | 'activeReview' | 'reviewPreparation' | 'writeProgress';
19
22
  export interface ExternalDraftState {
20
- kind: 'configDraft' | 'sourceDraft' | 'batchDraft';
23
+ kind: 'configDraft' | 'sourceDraft' | 'batchDraft' | 'catalogDraft';
21
24
  owner: string;
22
25
  flowId?: string;
23
26
  revision: number;
@@ -39,6 +42,7 @@ export interface PluginWriteBatchTarget {
39
42
  platform: PlatformName;
40
43
  scope: Scope;
41
44
  }
45
+ export declare function pluginWriteBatchTargets(action: Exclude<BatchPluginWriteAction, 'install'>, pluginIds: readonly string[], statusTargets: readonly StatusV7Target[]): PluginWriteBatchTarget[];
42
46
  export interface PluginWriteBatchIntent {
43
47
  kind: 'pluginWriteBatch';
44
48
  action: BatchPluginWriteAction;
@@ -59,6 +63,11 @@ export interface PluginWriteBatchGroupEvidence {
59
63
  export interface PluginWriteBatchEvidence extends OperationEvidence {
60
64
  requestedPluginIds: string[];
61
65
  groups: PluginWriteBatchGroupEvidence[];
66
+ targetVersions?: Array<PluginWriteBatchTarget & {
67
+ presence: 'new' | 'installed' | 'unknown';
68
+ installedVersion?: string;
69
+ availableVersion?: string;
70
+ }>;
62
71
  }
63
72
  export interface PluginWriteBatchGroupResult {
64
73
  groupId: string;
@@ -72,6 +81,36 @@ export interface PluginWriteBatchExecutionResult extends RebuildCommandResult {
72
81
  requestedPluginIds: string[];
73
82
  groupResults: PluginWriteBatchGroupResult[];
74
83
  }
84
+ export interface PluginWriteTaskSourceEvidence {
85
+ sourceId: string;
86
+ sourceIdentity: string;
87
+ requestedTargets: PluginWriteTaskTarget[];
88
+ causes: PluginWriteTaskCause[];
89
+ preview: RebuildCommandResult;
90
+ executable: boolean;
91
+ }
92
+ export interface PluginWriteTaskEvidence extends OperationEvidence {
93
+ taskPlan: {
94
+ goal: PluginWriteTaskGoal;
95
+ requestedTargets: PluginWriteTaskTarget[];
96
+ executableTargets: PluginWriteTaskTarget[];
97
+ causes: PluginWriteTaskCause[];
98
+ blockedTargets: PluginWriteTaskBlockedTarget[];
99
+ sources: PluginWriteTaskSourceEvidence[];
100
+ targetFingerprint: string;
101
+ planFingerprint: string;
102
+ };
103
+ }
104
+ export interface PluginWriteTaskSourceResult {
105
+ sourceId: string;
106
+ sourceIdentity: string;
107
+ requestedTargets: PluginWriteTaskTarget[];
108
+ result: RebuildCommandResult;
109
+ }
110
+ export interface PluginWriteTaskExecutionResult extends RebuildCommandResult {
111
+ taskPlan: PluginWriteTaskEvidence['taskPlan'];
112
+ sourceResults: PluginWriteTaskSourceResult[];
113
+ }
75
114
  export type OperationKind = OperationIntent['kind'];
76
115
  export interface IssueOrigin {
77
116
  issueId: string;
@@ -94,11 +133,17 @@ export type OperationIntent = {
94
133
  platform: PlatformName | 'both';
95
134
  scope: Scope;
96
135
  dependencyScopeOverrides?: DependencyScopeOverride[];
136
+ expectedUpdate?: {
137
+ installedVersion: string;
138
+ activeVersion: string;
139
+ sourceIdentity: string;
140
+ generationKey: string;
141
+ };
97
142
  recoveryDescription?: string;
98
143
  force?: boolean;
99
144
  scriptTimeoutMs?: number;
100
145
  originIssue?: IssueOrigin;
101
- } | PluginWriteBatchIntent | {
146
+ } | PluginWriteBatchIntent | PluginWriteTaskIntent | {
102
147
  kind: 'portableInstall';
103
148
  pluginId: string;
104
149
  scope: Scope;
@@ -170,7 +215,7 @@ export type OperationIntent = {
170
215
  setPrimaryAfterActivation?: boolean;
171
216
  } | {
172
217
  kind: 'catalogSourcesRecovery';
173
- };
218
+ } | CatalogManagementIntent;
174
219
  export interface OperationEvidence {
175
220
  catalog: {
176
221
  configDigest: string;
@@ -261,6 +306,7 @@ export interface OperationEvidence {
261
306
  }>['sourceMutation'];
262
307
  setPrimaryAfterActivation?: boolean;
263
308
  };
309
+ catalogManagement?: CatalogManagementReviewEvidence;
264
310
  portable?: PortableReview;
265
311
  }
266
312
  export interface OperationReviewChange {
@@ -282,6 +328,7 @@ export interface OperationReviewModel {
282
328
  kind: 'sourceMutation';
283
329
  }>['action'];
284
330
  pluginAction?: PluginWriteOperation;
331
+ taskGoal?: PluginWriteTaskGoal;
285
332
  originIssue?: IssueOrigin;
286
333
  title: string;
287
334
  description: string;
@@ -311,6 +358,13 @@ export interface OperationReviewModel {
311
358
  groupCount: number;
312
359
  executableGroupCount: number;
313
360
  };
361
+ task?: {
362
+ goal: PluginWriteTaskGoal;
363
+ requestedTargetCount: number;
364
+ executableTargetCount: number;
365
+ blockedTargetCount: number;
366
+ causeCount: number;
367
+ };
314
368
  }
315
369
  export type ReviewPreparationStageId = 'refresh' | 'validate' | 'status' | 'catalog' | 'inventory' | 'dependencyPlan' | 'config' | 'portable' | 'evidence';
316
370
  export interface ReviewPreparationStage {
@@ -395,6 +449,24 @@ export interface OperationResultSummary {
395
449
  catalogAction?: Extract<OperationIntent, {
396
450
  kind: 'catalogGeneration';
397
451
  }>['action'];
452
+ catalogManagement?: {
453
+ action: CatalogManagementIntent['action'];
454
+ state: 'succeeded' | 'partial';
455
+ catalogVersion?: string;
456
+ planDigest?: string;
457
+ store?: {
458
+ deletedEntries: number;
459
+ deletedBytes: number;
460
+ retainedEntries: number;
461
+ };
462
+ publication?: {
463
+ catalogVersion: string;
464
+ planDigest: string;
465
+ state: 'prepared' | 'uncertain' | 'published';
466
+ remote: string;
467
+ branch: string;
468
+ };
469
+ };
398
470
  catalogGeneration?: Pick<CatalogGenerationSyncResult, 'activeChanged' | 'outcome'> & {
399
471
  catalogVersion: string;
400
472
  };
@@ -415,9 +487,17 @@ export interface OperationResultSummary {
415
487
  batch?: {
416
488
  requestedPluginIds: string[];
417
489
  failedRequestedPluginIds: string[];
490
+ rootResults: PluginWriteBatchRootResult[];
418
491
  retryTargets?: PluginWriteBatchTarget[];
419
492
  groupCount: number;
420
493
  };
494
+ task?: {
495
+ goal: PluginWriteTaskGoal;
496
+ requestedTargets: PluginWriteTaskTarget[];
497
+ rootResults: PluginWriteTaskRootResult[];
498
+ retryTargets?: PluginWriteTaskTarget[];
499
+ blockedTargets: PluginWriteTaskBlockedTarget[];
500
+ };
421
501
  portable?: {
422
502
  selectedSkills: string[];
423
503
  agentMode: 'automatic' | 'explicit';
@@ -445,6 +525,31 @@ export interface OperationResultSummary {
445
525
  effects?: OperationEffectFacts;
446
526
  }>;
447
527
  }
528
+ export interface PluginWriteTaskRootResult {
529
+ pluginId: string;
530
+ state: 'completed' | 'kept' | 'partial' | 'failed' | 'notStarted' | 'blocked';
531
+ causeKeys: string[];
532
+ targets: Array<{
533
+ pluginId?: string;
534
+ platform: PlatformName;
535
+ scope: Scope;
536
+ state: 'completed' | 'kept' | 'failed' | 'skipped';
537
+ relation?: 'requested' | 'direct' | 'transitive';
538
+ errorCode?: string;
539
+ }>;
540
+ }
541
+ export interface PluginWriteBatchRootResult {
542
+ pluginId: string;
543
+ state: 'completed' | 'kept' | 'partial' | 'failed' | 'notStarted';
544
+ targets: Array<{
545
+ pluginId: string;
546
+ platform: PlatformName;
547
+ scope: Scope;
548
+ state: 'completed' | 'kept' | 'failed' | 'skipped';
549
+ relation: 'requested';
550
+ errorCode?: string;
551
+ }>;
552
+ }
448
553
  export interface PluginOperationProgressLine {
449
554
  pluginId: string;
450
555
  platform: PlatformName;
@@ -492,6 +597,7 @@ export interface SourceReferenceSummaryViewModel {
492
597
  }>;
493
598
  }
494
599
  export interface TuiControllerDependencies {
600
+ catalogManagement?: CatalogManagementService;
495
601
  beginCatalogSession?: (options?: {
496
602
  reuseValidatedGenerations?: boolean;
497
603
  }) => void;
@@ -579,6 +685,7 @@ export declare class TuiConfigInvalidStoreError extends Error {
579
685
  }
580
686
  export declare function pluginWriteBatchFailedRequestedTargets(execution: PluginWriteBatchExecutionResult): PluginWriteBatchTarget[];
581
687
  export declare function pluginWriteBatchFailedRequestedPluginIds(execution: PluginWriteBatchExecutionResult): string[];
688
+ export declare function pluginWriteTaskFailedRequestedTargets(execution: PluginWriteTaskExecutionResult): PluginWriteTaskTarget[];
582
689
  export declare function operationEvidenceFingerprint(evidence: OperationEvidence): string;
583
690
  export declare function operationEvidenceMatches(expected: OperationEvidence, current: OperationEvidence): boolean;
584
691
  export declare function userIssueKey(issue: Pick<UserIssueViewModel, 'category' | 'pluginId' | 'dependencyPluginId' | 'dependencyPlatform' | 'dependencyScope' | 'dependencyProject' | 'sourceId' | 'sourceIdentity' | 'platform' | 'scope'>): string;
@@ -656,7 +763,10 @@ export declare class TuiController {
656
763
  installFilter?: PluginInstallFilter;
657
764
  }): PluginListItemViewModel[];
658
765
  getPluginOverview(pluginId: string): PluginListItemViewModel | undefined;
766
+ listCurrentProjectIntentRoots(): string[];
767
+ listPluginWriteBatchTargets(action: Exclude<BatchPluginWriteAction, 'install'>, pluginIds: readonly string[]): PluginWriteBatchTarget[];
659
768
  getPluginDependencyOverview(pluginId: string): PluginDependencyOverviewViewModel | undefined;
769
+ listPluginDependencyOverviews(): PluginDependencyOverviewViewModel[];
660
770
  getBlockingDependents(pluginId: string, platform: PlatformName, scope: Scope): PluginDependencyOverviewViewModel['dependents'];
661
771
  getPlatformPlacement(pluginId: string, platform: PlatformName): PluginListItemViewModel['installedPlacements'][number] | undefined;
662
772
  listInstallTargets(pluginId: string, scope: Scope): InstallTargetOption[];
@@ -676,9 +786,19 @@ export declare class TuiController {
676
786
  setExternalDraftState(states?: ExternalDraftState[]): void;
677
787
  beginPluginWriteBatch(): void;
678
788
  startPluginWriteBatchReview(intent: PluginWriteBatchIntent): ReviewPreparationSnapshot;
789
+ startPluginWriteTaskReview(intent: PluginWriteTaskIntent, returnRoute?: TuiRoute): ReviewPreparationSnapshot;
790
+ beginNestedPluginWriteTask(route: Extract<TuiRoute, {
791
+ name: 'pluginWriteTask';
792
+ }>): void;
793
+ pluginWriteTaskReturnRoute(route: Extract<TuiRoute, {
794
+ name: 'pluginWriteTask';
795
+ }>): TuiRoute;
679
796
  retryFailedPluginWriteBatch(): ReviewPreparationSnapshot | undefined;
797
+ retryFailedPluginWriteTask(): ReviewPreparationSnapshot | undefined;
680
798
  catalogActivationBlockReason(): CatalogActivationBlockReason | undefined;
681
- catalogSourceRecoveryBlockReason(): CatalogActivationBlockReason | undefined;
799
+ catalogSourceRecoveryBlockReason(intent?: Extract<OperationIntent, {
800
+ kind: 'catalogGeneration';
801
+ }>): CatalogActivationBlockReason | undefined;
682
802
  getSessionCatalogVersion(sourceId: string): string | undefined;
683
803
  reloadCatalog(options: {
684
804
  sourceId: string;
@@ -690,14 +810,23 @@ export declare class TuiController {
690
810
  getConfigPage(pluginId: string, layer: {
691
811
  scope: Scope | 'effective';
692
812
  }, signal?: AbortSignal): Promise<ConfigPageViewModel>;
813
+ selectCatalogWorkspace(workspaceRoot?: string): Promise<CatalogWorkspaceManagementViewModel>;
814
+ getCatalogWorkspaceManagement(): Promise<CatalogWorkspaceManagementViewModel>;
815
+ validateCatalogWorkspace(): Promise<CatalogValidationViewModel>;
816
+ getCatalogDevManagement(): Promise<CatalogDevManagementViewModel>;
817
+ getCatalogStoreManagement(): Promise<CatalogStoreManagementViewModel>;
818
+ getCatalogPublicationManagement(): Promise<CatalogPublicationManagementViewModel>;
819
+ previewConfigSaveImpact(intent: Extract<OperationIntent, {
820
+ kind: 'configSave';
821
+ }>, signal?: AbortSignal): Promise<NonNullable<OperationEvidence['config']>>;
693
822
  getConfigResetAvailability(pluginId: string, layer: {
694
823
  scope: Scope;
695
824
  }): Promise<ConfigResetAvailability>;
696
825
  listUserIssues(): UserIssueViewModel[];
826
+ listPluginWriteTaskCandidates(goal: PluginWriteTaskGoal): PluginWriteTaskCandidate[];
697
827
  buildOperationReview(intent: OperationIntent, returnRoute?: TuiRoute): Promise<OperationReviewModel>;
698
828
  startReviewPreparation(intent: OperationIntent, returnRoute?: TuiRoute): ReviewPreparationSnapshot;
699
829
  retryReviewPreparation(): ReviewPreparationSnapshot | undefined;
700
830
  executeOperation(reviewToken: string): Promise<OperationExecuteResult>;
701
831
  dispose(): void;
702
832
  }
703
- export {};