@lesliechan721/aw 0.1.0-beta.10 → 0.1.0-beta.12
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.
- package/dist/authoring/assets/aw-config.d.mts +1 -50
- package/dist/authoring/assets/aw-config.mjs +58 -928
- package/dist/authoring/assets/aw-config.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +28 -33
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +229 -8
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +159 -48
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/bundle-plugins.js +18 -4
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.d.ts +2 -0
- package/dist/scripts/test-plugin-scripts.js +21 -5
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +1 -1
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/catalog-dev-source.d.ts +6 -3
- package/dist/src/commands/catalog-dev-source.js +96 -35
- package/dist/src/commands/catalog-dev-source.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.d.ts +1 -1
- package/dist/src/commands/catalog-publication-inspection.js +54 -8
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
- package/dist/src/commands/catalog-publication-journal.js +1 -1
- package/dist/src/commands/catalog-publication-journal.js.map +1 -1
- package/dist/src/commands/catalog-source.d.ts +19 -4
- package/dist/src/commands/catalog-source.js +121 -12
- package/dist/src/commands/catalog-source.js.map +1 -1
- package/dist/src/commands/catalog-store.d.ts +26 -7
- package/dist/src/commands/catalog-store.js +361 -42
- package/dist/src/commands/catalog-store.js.map +1 -1
- package/dist/src/commands/console.js +28 -17
- package/dist/src/commands/console.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +2 -1
- package/dist/src/commands/operation-plan.js +24 -0
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/operation-planner.d.ts +2 -2
- package/dist/src/commands/operation-planner.js +22 -20
- package/dist/src/commands/operation-planner.js.map +1 -1
- package/dist/src/commands/options.d.ts +2 -2
- package/dist/src/commands/options.js +18 -4
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +2 -2
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +19 -0
- package/dist/src/commands/rebuild-command.js +828 -283
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +25 -47
- package/dist/src/commands/rebuild-integration.js +1176 -1016
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +50 -12
- package/dist/src/commands/rebuild-operations.js +207 -101
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +21 -2
- package/dist/src/commands/status-v6.js +163 -31
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/commands/sync-command.d.ts +17 -0
- package/dist/src/commands/sync-command.js +45 -37
- package/dist/src/commands/sync-command.js.map +1 -1
- package/dist/src/commands/write-commands.d.ts +5 -0
- package/dist/src/commands/write-commands.js +50 -3
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/generators/local-plugin.js +14 -4
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.js +260 -91
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/command-receipt.js +1 -3
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/rebuild-progress.js +1 -3
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/portable/materializer.js +10 -8
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/tui/catalog-generation.js +41 -1
- package/dist/src/tui/catalog-generation.js.map +1 -1
- package/dist/src/tui/catalog-sources/session.d.ts +1 -0
- package/dist/src/tui/catalog-sources/session.js +16 -3
- package/dist/src/tui/catalog-sources/session.js.map +1 -1
- package/dist/src/tui/catalog-sources/types.d.ts +3 -2
- package/dist/src/tui/components.d.ts +4 -0
- package/dist/src/tui/components.js +36 -24
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/console-app-v4.d.ts +13 -4
- package/dist/src/tui/console-app-v4.js +2065 -857
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +731 -62
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +156 -10
- package/dist/src/tui/controller.js +1187 -163
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/diagnostic-projection.d.ts +22 -0
- package/dist/src/tui/diagnostic-projection.js +437 -0
- package/dist/src/tui/diagnostic-projection.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +1 -1
- package/dist/src/tui/diagnostics.js +7 -2
- package/dist/src/tui/diagnostics.js.map +1 -1
- package/dist/src/tui/glossary.d.ts +23 -0
- package/dist/src/tui/glossary.js +42 -0
- package/dist/src/tui/glossary.js.map +1 -0
- package/dist/src/tui/index.d.ts +4 -1
- package/dist/src/tui/index.js +4 -1
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/keys.d.ts +44 -0
- package/dist/src/tui/keys.js +43 -15
- package/dist/src/tui/keys.js.map +1 -1
- package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
- package/dist/src/tui/lifecycle-action-view.js +34 -0
- package/dist/src/tui/lifecycle-action-view.js.map +1 -0
- package/dist/src/tui/model.d.ts +12 -2
- package/dist/src/tui/model.js +128 -52
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.d.ts +21 -0
- package/dist/src/tui/operation-diagnostic-screens.js +101 -0
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
- package/dist/src/tui/operation-history.d.ts +80 -0
- package/dist/src/tui/operation-history.js +130 -0
- package/dist/src/tui/operation-history.js.map +1 -0
- package/dist/src/tui/operation-review-planner.js +366 -99
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/router.d.ts +82 -17
- package/dist/src/tui/router.js +186 -38
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/screen-registry.d.ts +546 -0
- package/dist/src/tui/screen-registry.js +179 -0
- package/dist/src/tui/screen-registry.js.map +1 -0
- package/dist/src/tui/session-console-app.d.ts +6 -0
- package/dist/src/tui/session-console-app.js +13 -0
- package/dist/src/tui/session-console-app.js.map +1 -0
- package/dist/src/tui/session-host.d.ts +44 -0
- package/dist/src/tui/session-host.js +197 -0
- package/dist/src/tui/session-host.js.map +1 -0
- package/dist/src/types.d.ts +64 -3
- package/dist/src/types.js +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.js +1 -1
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +2 -2
- package/dist/src/utils/artifact-plan.js +8 -6
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +2 -1
- package/dist/src/utils/artifact-renderer.js +139 -120
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +5 -0
- package/dist/src/utils/artifact-request.js +40 -0
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +4 -4
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
- package/dist/src/utils/catalog-capability-projection.js +14 -0
- package/dist/src/utils/catalog-capability-projection.js.map +1 -0
- package/dist/src/utils/catalog-generation-resolver.d.ts +14 -2
- package/dist/src/utils/catalog-generation-resolver.js +49 -27
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
- package/dist/src/utils/catalog-generation-service.d.ts +8 -1
- package/dist/src/utils/catalog-generation-service.js +81 -47
- package/dist/src/utils/catalog-generation-service.js.map +1 -1
- package/dist/src/utils/catalog-generation-store.d.ts +1 -0
- package/dist/src/utils/catalog-generation-store.js +60 -5
- package/dist/src/utils/catalog-generation-store.js.map +1 -1
- package/dist/src/utils/catalog-operation-context.js +1 -0
- package/dist/src/utils/catalog-operation-context.js.map +1 -1
- package/dist/src/utils/catalog-public-error.js +4 -0
- package/dist/src/utils/catalog-public-error.js.map +1 -1
- package/dist/src/utils/catalog-source-impact.d.ts +3 -2
- package/dist/src/utils/catalog-source-impact.js +142 -20
- package/dist/src/utils/catalog-source-impact.js.map +1 -1
- package/dist/src/utils/catalog-source-references.js +95 -9
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/catalog-sources.d.ts +1 -1
- package/dist/src/utils/catalog-sources.js +19 -3
- package/dist/src/utils/catalog-sources.js.map +1 -1
- package/dist/src/utils/codex-manager.js +8 -0
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +34 -1
- package/dist/src/utils/codex-native-observation.js +132 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/codex-reconciler.d.ts +0 -2
- package/dist/src/utils/codex-reconciler.js.map +1 -1
- package/dist/src/utils/codex-shared-native.d.ts +2 -26
- package/dist/src/utils/codex-shared-native.js +8 -82
- package/dist/src/utils/codex-shared-native.js.map +1 -1
- package/dist/src/utils/git-catalog-provider.d.ts +3 -0
- package/dist/src/utils/git-catalog-provider.js +40 -1
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +1 -0
- package/dist/src/utils/local-marketplace.js +69 -73
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.js +1 -0
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +9 -4
- package/dist/src/utils/native-cli.js +280 -34
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/path-catalog-provider.js +2 -0
- package/dist/src/utils/path-catalog-provider.js.map +1 -1
- package/dist/src/utils/plugin-config-impact.d.ts +33 -0
- package/dist/src/utils/plugin-config-impact.js +298 -0
- package/dist/src/utils/plugin-config-impact.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +36 -14
- package/dist/src/utils/plugin-config-write.js +709 -225
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +58 -4
- package/dist/src/utils/plugin-config.js +328 -60
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-scripts.d.ts +20 -12
- package/dist/src/utils/plugin-scripts.js +389 -114
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +2 -2
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/src/utils/project-boundary.d.ts +11 -1
- package/dist/src/utils/project-boundary.js +33 -11
- package/dist/src/utils/project-boundary.js.map +1 -1
- package/dist/src/utils/safe-operation-diagnostic.d.ts +15 -0
- package/dist/src/utils/safe-operation-diagnostic.js +33 -0
- package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
- package/dist/src/utils/sensitive-content.d.ts +4 -0
- package/dist/src/utils/sensitive-content.js +36 -0
- package/dist/src/utils/sensitive-content.js.map +1 -0
- package/dist/src/utils/windows-claude-shim.d.ts +9 -0
- package/dist/src/utils/windows-claude-shim.js +141 -0
- package/dist/src/utils/windows-claude-shim.js.map +1 -0
- package/dist/vitest.config.js +91 -10
- package/dist/vitest.config.js.map +1 -1
- package/package.json +9 -9
- package/dist/authoring/templates/aw-config-runtime.d.mts +0 -2
- package/dist/authoring/templates/aw-config-runtime.mjs +0 -407
- package/dist/authoring/templates/aw-config-runtime.mjs.map +0 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { hasInstalledPlacement } from './model.js';
|
|
2
|
+
export const TUI_SCREEN_IDS = [
|
|
3
|
+
'G01', 'G02', 'G03', 'G04', 'G05',
|
|
4
|
+
'P01', 'P02', 'P03', 'P04', 'P05', 'P06', 'P07', 'P08', 'P09', 'P10',
|
|
5
|
+
'P11', 'P12', 'P13', 'P14', 'P15', 'P16', 'P17', 'P18', 'P19', 'P20', 'P21',
|
|
6
|
+
'C01', 'C02', 'C03', 'C04', 'C05', 'C06', 'C07', 'C08', 'C09', 'C10',
|
|
7
|
+
'C12', 'C13', 'C14', 'C15', 'C16', 'C17',
|
|
8
|
+
'S01', 'S03', 'S04', 'S05', 'S06', 'S07', 'S08', 'S09',
|
|
9
|
+
'S10', 'S11', 'S12', 'S13', 'S14', 'S15', 'S16', 'S17', 'S18',
|
|
10
|
+
'I01', 'I02', 'I03', 'I04', 'I05', 'I06', 'I07', 'I08', 'I09',
|
|
11
|
+
'I10', 'I11', 'I12', 'I13',
|
|
12
|
+
'D01', 'D02', 'D03', 'D04', 'D05', 'D06', 'D07', 'D08', 'D09',
|
|
13
|
+
'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17',
|
|
14
|
+
'D18', 'D19', 'D20',
|
|
15
|
+
'U01', 'U02', 'U03', 'U04', 'U05', 'U06', 'U07', 'U08', 'U09', 'U10', 'U11',
|
|
16
|
+
'K02', 'B01', 'B02',
|
|
17
|
+
];
|
|
18
|
+
const keep = (route) => route;
|
|
19
|
+
const plugin = (route, state) => 'pluginId' in route && state.hasPlugin(route.pluginId)
|
|
20
|
+
? route
|
|
21
|
+
: { name: 'pluginList', mode: route.name === 'pluginPreview'
|
|
22
|
+
|| route.name === 'pluginDependencies' || route.name === 'installPlacement'
|
|
23
|
+
|| route.name === 'installTargets' || route.name === 'dependencyPlacement'
|
|
24
|
+
|| route.name === 'dependencyPlacementEditor' ? 'browse' : 'installed' };
|
|
25
|
+
const source = (route, state) => state.hasSource(route.sourceId) ? route : { name: 'sourceList' };
|
|
26
|
+
const issue = (route, state) => state.hasIssue(route.issueId) ? route : { name: 'issueList' };
|
|
27
|
+
const activeOperation = (route, state) => state.hasActiveOperation(route) ? route : { name: 'operationHistory' };
|
|
28
|
+
const fixed = (id) => (_route, _context) => id;
|
|
29
|
+
function reviewScreen(context) {
|
|
30
|
+
const review = context.snapshot.activeReview;
|
|
31
|
+
if (review?.originIssue)
|
|
32
|
+
return 'I10';
|
|
33
|
+
const dependencyOperation = review?.operationKind === 'pluginWrite'
|
|
34
|
+
&& review.changes.some((change) => change.relation === 'direct'
|
|
35
|
+
|| change.relation === 'transitive' || change.group === 'dependencies');
|
|
36
|
+
if (dependencyOperation) {
|
|
37
|
+
return review.pluginAction === 'uninstall' || review.pluginAction === 'cleanup' ? 'D11' : 'D05';
|
|
38
|
+
}
|
|
39
|
+
if ((review?.operationKind === 'sourceMutation' || review?.operationKind === 'catalogGeneration')
|
|
40
|
+
&& review.sourceAction) {
|
|
41
|
+
return { add: 'S10', update: 'S15', setPrimary: 'S16', remove: 'S18' }[review.sourceAction];
|
|
42
|
+
}
|
|
43
|
+
return review?.operationKind === 'portableInstall' ? 'U06'
|
|
44
|
+
: review?.operationKind === 'configSave' ? 'C12'
|
|
45
|
+
: review?.operationKind === 'configReset' ? 'C16'
|
|
46
|
+
: review?.operationKind === 'pluginWrite'
|
|
47
|
+
&& (review.pluginAction === 'refreshAndSync' || review.pluginAction === 'reinstall') ? 'P18'
|
|
48
|
+
: review?.operationKind === 'pluginWrite'
|
|
49
|
+
&& (review.pluginAction === 'uninstall' || review.pluginAction === 'cleanup') ? 'P19' : 'P07';
|
|
50
|
+
}
|
|
51
|
+
function progressScreen(context) {
|
|
52
|
+
const review = context.snapshot.activeReview;
|
|
53
|
+
if (context.snapshot.progressTargets.length > 0)
|
|
54
|
+
return 'D06';
|
|
55
|
+
if (review?.originIssue)
|
|
56
|
+
return 'I11';
|
|
57
|
+
if (review?.operationKind === 'sourceMutation' || review?.operationKind === 'catalogGeneration'
|
|
58
|
+
|| review?.operationKind === 'catalogSourcesRecovery')
|
|
59
|
+
return 'S11';
|
|
60
|
+
return review?.operationKind === 'portableInstall' ? 'U07'
|
|
61
|
+
: review?.operationKind === 'configSave' || review?.operationKind === 'configReset' ? 'C13' : 'P08';
|
|
62
|
+
}
|
|
63
|
+
function resultScreen(context) {
|
|
64
|
+
const result = context.snapshot.result;
|
|
65
|
+
if (result) {
|
|
66
|
+
const dependencyTargets = result.state === 'succeeded' || result.state === 'partial'
|
|
67
|
+
? result.summary.targets
|
|
68
|
+
: result.state === 'blocked' && result.code === 'operationFailed' ? result.summary?.targets : undefined;
|
|
69
|
+
if (dependencyTargets?.some((target) => target.relation !== undefined && target.relation !== 'requested')) {
|
|
70
|
+
return result.state === 'succeeded' ? 'D07' : 'D08';
|
|
71
|
+
}
|
|
72
|
+
if (result.originIssue)
|
|
73
|
+
return result.state === 'succeeded' ? 'I12' : 'I13';
|
|
74
|
+
if ('operationKind' in result && (result.operationKind === 'sourceMutation'
|
|
75
|
+
|| result.operationKind === 'catalogGeneration' || result.operationKind === 'catalogSourcesRecovery')) {
|
|
76
|
+
return result.state === 'succeeded' ? 'S12' : 'S13';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result?.operationKind === 'portableInstall' ? 'U08'
|
|
80
|
+
: result?.operationKind === 'configSave' || result?.operationKind === 'configReset'
|
|
81
|
+
? result.state === 'succeeded' ? 'C14' : 'C15'
|
|
82
|
+
: result?.state === 'partial' ? 'P10' : 'P09';
|
|
83
|
+
}
|
|
84
|
+
export const TUI_ROUTE_DEFINITIONS = {
|
|
85
|
+
home: { entity: 'none', rendererFamily: 'home', keymap: 'menu', normalize: keep, screenId: fixed('G02') },
|
|
86
|
+
pluginList: { entity: 'source', rendererFamily: 'pluginList', keymap: 'menuOrTextInput', normalize: (route, state) => route.sourceId && !state.hasSource(route.sourceId) ? { name: 'pluginList', mode: route.mode } : route,
|
|
87
|
+
screenId: (route, { controller, searchMode }) => {
|
|
88
|
+
const items = controller.listPlugins({ mode: route.mode, sourceId: route.sourceId });
|
|
89
|
+
if (route.mode === 'installed' && items.length === 0)
|
|
90
|
+
return 'P12';
|
|
91
|
+
if (route.sourceId && controller.getSourceOverview(route.sourceId).health?.state === 'unavailable')
|
|
92
|
+
return 'P03';
|
|
93
|
+
return route.mode === 'installed' ? 'P11' : searchMode ? 'P02' : 'P01';
|
|
94
|
+
} },
|
|
95
|
+
batchSelection: { entity: 'none', rendererFamily: 'batch', keymap: 'menu', normalize: keep, screenId: fixed('B01') },
|
|
96
|
+
batchPlacement: { entity: 'none', rendererFamily: 'batch', keymap: 'menu', normalize: keep, screenId: fixed('B02') },
|
|
97
|
+
pluginPreview: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: (route, { controller }) => controller.getPluginOverview(route.pluginId)?.dependencySummary?.totalCount ? 'D01' : 'P04' },
|
|
98
|
+
portableSkillSelect: { entity: 'plugin', rendererFamily: 'portable', keymap: 'menu', normalize: plugin, screenId: fixed('U01') },
|
|
99
|
+
portableDependencies: { entity: 'plugin', rendererFamily: 'portable', keymap: 'menu', normalize: plugin, screenId: fixed('U02') },
|
|
100
|
+
portableAgentMode: { entity: 'plugin', rendererFamily: 'portable', keymap: 'menu', normalize: plugin, screenId: fixed('U03') },
|
|
101
|
+
portableAgentInput: { entity: 'plugin', rendererFamily: 'portable', keymap: 'menuOrTextInput', normalize: plugin, screenId: fixed('U04') },
|
|
102
|
+
portableScope: { entity: 'plugin', rendererFamily: 'portable', keymap: 'menu', normalize: plugin, screenId: fixed('U05') },
|
|
103
|
+
portableBlocker: { entity: 'plugin', rendererFamily: 'portable', keymap: 'menu', normalize: plugin, screenId: (route) => route.code === 'requiredConfigMissing' ? 'U09'
|
|
104
|
+
: route.code === 'portableSkillsCliMissing' || route.code === 'portableSkillsCliIncompatible' ? 'U10' : 'U11' },
|
|
105
|
+
pluginDependencies: { entity: 'plugin', rendererFamily: 'dependency', keymap: 'menu', normalize: plugin, screenId: (route, { controller }) => {
|
|
106
|
+
if (route.view === 'removeBlocked')
|
|
107
|
+
return 'D12';
|
|
108
|
+
const item = controller.getPluginOverview(route.pluginId);
|
|
109
|
+
return item && hasInstalledPlacement(item) ? 'D10' : 'D02';
|
|
110
|
+
} },
|
|
111
|
+
installPlacement: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: (route, { controller }) => controller.getPluginOverview(route.pluginId)?.dependencySummary?.totalCount ? 'D03' : 'P05' },
|
|
112
|
+
installTargets: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: (route, { controller }) => route.view === 'blocked' ? 'D16'
|
|
113
|
+
: controller.getPluginOverview(route.pluginId)?.dependencySummary?.totalCount ? 'D04' : 'P06' },
|
|
114
|
+
dependencyPlacement: { entity: 'plugin', rendererFamily: 'dependency', keymap: 'menu', normalize: plugin, screenId: fixed('D03') },
|
|
115
|
+
dependencyPlacementEditor: { entity: 'plugin', rendererFamily: 'dependency', keymap: 'menu', normalize: (route, state) => state.hasPlugin(route.pluginId) && state.hasPlugin(route.dependencyPluginId)
|
|
116
|
+
? route : { name: 'pluginList', mode: 'browse' }, screenId: fixed('D04') },
|
|
117
|
+
pluginDetail: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: (route, { controller }) => controller.getPluginOverview(route.pluginId)?.dependencySummary?.totalCount ? 'D09' : 'P13' },
|
|
118
|
+
platform: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: (route, { controller }) => {
|
|
119
|
+
const item = controller.getPluginOverview(route.pluginId);
|
|
120
|
+
if (item?.aggregateStatus === 'unavailable')
|
|
121
|
+
return 'P17';
|
|
122
|
+
const placement = controller.getPlatformPlacement(route.pluginId, route.platform);
|
|
123
|
+
return !placement || placement.state === 'notInstalled' ? 'P15'
|
|
124
|
+
: placement.state === 'installed' && placement.health === 'ready' ? 'P14' : 'P16';
|
|
125
|
+
} },
|
|
126
|
+
pluginAbout: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: fixed('P20') },
|
|
127
|
+
pluginTechnical: { entity: 'plugin', rendererFamily: 'plugin', keymap: 'menu', normalize: plugin, screenId: fixed('P21') },
|
|
128
|
+
configLayer: { entity: 'plugin', rendererFamily: 'config', keymap: 'menu', normalize: plugin, screenId: fixed('C01') },
|
|
129
|
+
configFields: { entity: 'plugin', rendererFamily: 'config', keymap: 'menu', normalize: plugin, screenId: (route) => route.layer.scope === 'effective' ? 'C02' : 'C03' },
|
|
130
|
+
configFieldEditor: { entity: 'plugin', rendererFamily: 'config', keymap: 'menuOrTextInput', normalize: plugin, screenId: (route) => route.mode === 'choices' ? 'C05' : { boolean: 'C06', number: 'C07', string: 'C08', object: 'C09' }[route.editor] },
|
|
131
|
+
configObjectPropertyEditor: { entity: 'plugin', rendererFamily: 'config', keymap: 'menuOrTextInput', normalize: plugin, screenId: fixed('C10') },
|
|
132
|
+
configFieldAction: { entity: 'plugin', rendererFamily: 'config', keymap: 'menu', normalize: plugin, screenId: fixed('C04') },
|
|
133
|
+
configUnavailable: { entity: 'plugin', rendererFamily: 'config', keymap: 'menu', normalize: plugin, screenId: fixed('C17') },
|
|
134
|
+
sourceList: { entity: 'none', rendererFamily: 'source', keymap: 'menu', normalize: keep, screenId: fixed('S01') },
|
|
135
|
+
sourceDetail: { entity: 'source', rendererFamily: 'source', keymap: 'menu', normalize: source, screenId: fixed('K02') },
|
|
136
|
+
sourceTechnical: { entity: 'source', rendererFamily: 'source', keymap: 'menu', normalize: source, screenId: fixed('S03') },
|
|
137
|
+
sourceAdd: { entity: 'none', rendererFamily: 'source', keymap: 'menuOrTextInput', normalize: keep, screenId: (route) => ({ type: 'S04', id: 'S05', location: 'S06', refPolicy: 'S07', ref: 'S08', subdir: 'S09' }[route.step]) },
|
|
138
|
+
sourceEdit: { entity: 'source', rendererFamily: 'source', keymap: 'menuOrTextInput', normalize: source, screenId: fixed('S14') },
|
|
139
|
+
sourceSave: { entity: 'none', rendererFamily: 'source', keymap: 'menu', normalize: keep, screenId: fixed('S15') },
|
|
140
|
+
configSave: { entity: 'plugin', rendererFamily: 'config', keymap: 'menu', normalize: plugin, screenId: fixed('C12') },
|
|
141
|
+
scriptTimeout: { entity: 'none', rendererFamily: 'operation', keymap: 'menuOrTextInput', normalize: keep, screenId: fixed('P07') },
|
|
142
|
+
sourceRemoveBlocked: { entity: 'source', rendererFamily: 'source', keymap: 'menu', normalize: source, screenId: fixed('S17') },
|
|
143
|
+
issueList: { entity: 'none', rendererFamily: 'issue', keymap: 'menu', normalize: keep, screenId: (_route, { controller }) => {
|
|
144
|
+
const issues = controller.listUserIssues();
|
|
145
|
+
return issues.length === 0 ? 'I02' : issues.some((entry) => entry.category.startsWith('dependency')) ? 'D13' : 'I01';
|
|
146
|
+
} },
|
|
147
|
+
issueDetail: { entity: 'issue', rendererFamily: 'issue', keymap: 'menu', normalize: issue, screenId: (route, { controller }) => {
|
|
148
|
+
const category = controller.listUserIssues().find((entry) => entry.issueId === route.issueId)?.category ?? 'diagnostic';
|
|
149
|
+
return { incompleteInstallation: 'I03', artifactCollision: 'I09', sourceUnavailable: 'I04', sourceMissing: 'I05',
|
|
150
|
+
sourceIdentityChanged: 'I06', requiredConfigMissing: 'I07', configLayerUnsupported: 'I07', scopeConflict: 'I08',
|
|
151
|
+
dependencyMissing: 'D14', dependencyNotReady: 'D15', dependencyTargetUnsupported: 'D16',
|
|
152
|
+
dependencyStillRequired: 'D12', dependencyGraphInvalid: 'D17', legacyState: 'I09', diagnostic: 'I09' }[category] ?? 'I09';
|
|
153
|
+
} },
|
|
154
|
+
operationHistory: { entity: 'none', rendererFamily: 'history', keymap: 'menu', normalize: keep, screenId: fixed('D18') },
|
|
155
|
+
operationDiagnostic: { entity: 'historyRecord', rendererFamily: 'history', keymap: 'menu', normalize: keep, screenId: fixed('D19') },
|
|
156
|
+
operationReportPreview: { entity: 'historyRecord', rendererFamily: 'history', keymap: 'menu', normalize: keep, screenId: fixed('D20') },
|
|
157
|
+
reviewPreparing: { entity: 'activeOperation', rendererFamily: 'operation', keymap: 'menu', normalize: activeOperation, screenId: fixed('P07') },
|
|
158
|
+
review: { entity: 'activeOperation', rendererFamily: 'operation', keymap: 'menu', normalize: activeOperation, screenId: (_route, context) => reviewScreen(context) },
|
|
159
|
+
progress: { entity: 'activeOperation', rendererFamily: 'operation', keymap: 'menu', normalize: activeOperation, screenId: (_route, context) => progressScreen(context) },
|
|
160
|
+
result: { entity: 'activeOperation', rendererFamily: 'operation', keymap: 'menu', normalize: activeOperation, screenId: (_route, context) => resultScreen(context) },
|
|
161
|
+
};
|
|
162
|
+
export function routeDefinition(route) {
|
|
163
|
+
return TUI_ROUTE_DEFINITIONS[route.name];
|
|
164
|
+
}
|
|
165
|
+
export function normalizeTuiRoute(route, state) {
|
|
166
|
+
const definition = routeDefinition(route);
|
|
167
|
+
return definition.normalize(route, state);
|
|
168
|
+
}
|
|
169
|
+
export function routeSupportsCharacterInput(route) {
|
|
170
|
+
return routeDefinition(route).keymap === 'menuOrTextInput';
|
|
171
|
+
}
|
|
172
|
+
export function unreachableTuiRoute(route) {
|
|
173
|
+
throw new Error(`Unhandled TUI route: ${JSON.stringify(route)}`);
|
|
174
|
+
}
|
|
175
|
+
export function resolveRouteScreenId(route, context) {
|
|
176
|
+
const definition = routeDefinition(route);
|
|
177
|
+
return definition.screenId(route, context);
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=screen-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-registry.js","sourceRoot":"","sources":["../../../src/tui/screen-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACjC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,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AK,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { ConsoleAppV4 } from './console-app-v4.js';
|
|
5
|
+
export function SessionConsoleApp(props) {
|
|
6
|
+
const [session, setSession] = useState(props.host.snapshot);
|
|
7
|
+
useEffect(() => props.host.subscribe(setSession), [props.host]);
|
|
8
|
+
if (session.reloading) {
|
|
9
|
+
return _jsx(Box, { flexDirection: "column", children: _jsx(Text, { children: "\u6B63\u5728\u5B89\u5168\u7ED3\u675F\u5F53\u524D\u4F1A\u8BDD\u2026" }) });
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(ConsoleAppV4, { controller: session.controller, ownsController: false, pendingSessionNavigation: session.pendingNavigation, pendingSessionNavigationDrafts: session.pendingNavigationDrafts, onCancelPendingSessionNavigation: () => props.host.cancelPendingNavigation(), onSessionNavigation: (navigation, options) => props.host.requestNavigation(navigation, options), onExit: props.onExit }, session.epoch));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=session-console-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-console-app.js","sourceRoot":"","sources":["../../../src/tui/session-console-app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,YAAY,EAA2B,MAAM,qBAAqB,CAAC;AAG5E,MAAM,UAAU,iBAAiB,CAAC,KAGjC;IACC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAsB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEjF,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhE,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YAAC,KAAC,IAAI,qFAAmB,GAAM,CAAC;IACpE,CAAC;IAED,OAAO,CACL,KAAC,YAAY,IAEX,UAAU,EAAE,OAAO,CAAC,UAAU,EAC9B,cAAc,EAAE,KAAK,EACrB,wBAAwB,EAAE,OAAO,CAAC,iBAAiB,EACnD,8BAA8B,EAAE,OAAO,CAAC,uBAAuB,EAC/D,gCAAgC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAC5E,mBAAmB,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,EAC/F,MAAM,EAAE,KAAK,CAAC,MAAM,IAPf,OAAO,CAAC,KAAK,CAQlB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CommandReporter } from '../commands/runtime.js';
|
|
2
|
+
import type { RebuildProgressFeed } from '../output/rebuild-progress.js';
|
|
3
|
+
import type { ExternalDraftState, OperationExecuteResult, TuiController } from './controller.js';
|
|
4
|
+
import { OperationHistoryStore } from './operation-history.js';
|
|
5
|
+
export type SessionNavigation = 'home' | 'reload';
|
|
6
|
+
export interface SessionResultRecord {
|
|
7
|
+
epoch: number;
|
|
8
|
+
result: OperationExecuteResult;
|
|
9
|
+
}
|
|
10
|
+
export type SessionHistoryOwner = OperationHistoryStore;
|
|
11
|
+
export declare class LatestSessionResultHistory extends OperationHistoryStore {
|
|
12
|
+
#private;
|
|
13
|
+
get latestResult(): SessionResultRecord | undefined;
|
|
14
|
+
recordResult(record: SessionResultRecord): void;
|
|
15
|
+
}
|
|
16
|
+
export interface SessionHostSnapshot {
|
|
17
|
+
epoch: number;
|
|
18
|
+
controller: TuiController;
|
|
19
|
+
pendingNavigation?: SessionNavigation;
|
|
20
|
+
pendingNavigationDrafts?: ExternalDraftState[];
|
|
21
|
+
reloading: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type SessionNavigationResult = 'completed' | 'pending' | 'draftBlocked' | 'busy';
|
|
24
|
+
export declare class SessionHost {
|
|
25
|
+
#private;
|
|
26
|
+
readonly history: SessionHistoryOwner;
|
|
27
|
+
constructor(options: {
|
|
28
|
+
createSession: () => {
|
|
29
|
+
controller: TuiController;
|
|
30
|
+
progressFeed: RebuildProgressFeed;
|
|
31
|
+
};
|
|
32
|
+
history?: SessionHistoryOwner;
|
|
33
|
+
});
|
|
34
|
+
get snapshot(): SessionHostSnapshot;
|
|
35
|
+
readonly reporter: CommandReporter;
|
|
36
|
+
subscribe(listener: (snapshot: SessionHostSnapshot) => void): () => void;
|
|
37
|
+
requestNavigation(navigation: SessionNavigation, options?: {
|
|
38
|
+
discardDrafts?: boolean;
|
|
39
|
+
draftConfirmation?: ExternalDraftState[];
|
|
40
|
+
}): Promise<SessionNavigationResult>;
|
|
41
|
+
cancelPendingNavigation(): boolean;
|
|
42
|
+
dispose(): void;
|
|
43
|
+
shutdown(): Promise<void>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { OperationHistoryStore } from './operation-history.js';
|
|
2
|
+
export class LatestSessionResultHistory extends OperationHistoryStore {
|
|
3
|
+
#latestResult;
|
|
4
|
+
get latestResult() {
|
|
5
|
+
return this.#latestResult ? structuredClone(this.#latestResult) : undefined;
|
|
6
|
+
}
|
|
7
|
+
recordResult(record) {
|
|
8
|
+
this.#latestResult = structuredClone(record);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export class SessionHost {
|
|
12
|
+
#listeners = new Set();
|
|
13
|
+
#createSession;
|
|
14
|
+
history;
|
|
15
|
+
#epoch = 1;
|
|
16
|
+
#controller;
|
|
17
|
+
#progressFeed;
|
|
18
|
+
#controllerUnsubscribe;
|
|
19
|
+
#pendingNavigation;
|
|
20
|
+
#pendingNavigationDrafts;
|
|
21
|
+
#pendingConsumedDraft;
|
|
22
|
+
#reloading = false;
|
|
23
|
+
#disposed = false;
|
|
24
|
+
constructor(options) {
|
|
25
|
+
this.#createSession = options.createSession;
|
|
26
|
+
this.history = options.history ?? new OperationHistoryStore();
|
|
27
|
+
const session = this.#createSession();
|
|
28
|
+
this.#controller = session.controller;
|
|
29
|
+
this.#progressFeed = session.progressFeed;
|
|
30
|
+
this.#attachOperationHistory();
|
|
31
|
+
this.#subscribeController();
|
|
32
|
+
}
|
|
33
|
+
get snapshot() {
|
|
34
|
+
return Object.freeze({
|
|
35
|
+
epoch: this.#epoch,
|
|
36
|
+
controller: this.#controller,
|
|
37
|
+
...(this.#pendingNavigation ? { pendingNavigation: this.#pendingNavigation } : {}),
|
|
38
|
+
...(this.#pendingNavigationDrafts
|
|
39
|
+
? { pendingNavigationDrafts: structuredClone(this.#pendingNavigationDrafts) }
|
|
40
|
+
: {}),
|
|
41
|
+
reloading: this.#reloading,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
reporter = {
|
|
45
|
+
event: (event) => this.#progressFeed.addEvent(event),
|
|
46
|
+
notice: (notice) => this.#progressFeed.addNotice(notice),
|
|
47
|
+
};
|
|
48
|
+
subscribe(listener) {
|
|
49
|
+
this.#listeners.add(listener);
|
|
50
|
+
listener(this.snapshot);
|
|
51
|
+
return () => this.#listeners.delete(listener);
|
|
52
|
+
}
|
|
53
|
+
async requestNavigation(navigation, options = {}) {
|
|
54
|
+
if (this.#disposed || this.#reloading)
|
|
55
|
+
return 'busy';
|
|
56
|
+
if (this.#controller.hasActiveWrite) {
|
|
57
|
+
this.#pendingNavigation = navigation;
|
|
58
|
+
this.#pendingNavigationDrafts = undefined;
|
|
59
|
+
this.#pendingConsumedDraft = undefined;
|
|
60
|
+
this.#publish();
|
|
61
|
+
return 'pending';
|
|
62
|
+
}
|
|
63
|
+
if (this.#controller.hasSessionDraft && !options.discardDrafts)
|
|
64
|
+
return 'draftBlocked';
|
|
65
|
+
if (this.#controller.hasSessionDraft
|
|
66
|
+
&& !this.#draftConfirmationMatches(options.draftConfirmation))
|
|
67
|
+
return 'draftBlocked';
|
|
68
|
+
this.#pendingNavigation = undefined;
|
|
69
|
+
this.#pendingNavigationDrafts = undefined;
|
|
70
|
+
this.#pendingConsumedDraft = undefined;
|
|
71
|
+
if (navigation === 'home') {
|
|
72
|
+
return this.#controller.goHome(options) ? 'completed' : 'draftBlocked';
|
|
73
|
+
}
|
|
74
|
+
return await this.#reload() ? 'completed' : 'busy';
|
|
75
|
+
}
|
|
76
|
+
cancelPendingNavigation() {
|
|
77
|
+
if (!this.#pendingNavigation)
|
|
78
|
+
return false;
|
|
79
|
+
this.#pendingNavigation = undefined;
|
|
80
|
+
this.#pendingNavigationDrafts = undefined;
|
|
81
|
+
this.#pendingConsumedDraft = undefined;
|
|
82
|
+
this.#publish();
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
dispose() {
|
|
86
|
+
if (this.#disposed)
|
|
87
|
+
return;
|
|
88
|
+
this.#disposed = true;
|
|
89
|
+
this.#controllerUnsubscribe?.();
|
|
90
|
+
this.#controller.dispose();
|
|
91
|
+
this.#listeners.clear();
|
|
92
|
+
}
|
|
93
|
+
async shutdown() {
|
|
94
|
+
if (this.#disposed)
|
|
95
|
+
return;
|
|
96
|
+
const controller = this.#controller;
|
|
97
|
+
controller.beginRetirement();
|
|
98
|
+
this.#reloading = true;
|
|
99
|
+
this.#publish();
|
|
100
|
+
await controller.waitForWrites();
|
|
101
|
+
await controller.cancelAndWaitForReads();
|
|
102
|
+
this.dispose();
|
|
103
|
+
}
|
|
104
|
+
async #reload() {
|
|
105
|
+
if (this.#reloading || this.#controller.hasActiveWrite)
|
|
106
|
+
return false;
|
|
107
|
+
this.#reloading = true;
|
|
108
|
+
const previous = this.#controller;
|
|
109
|
+
previous.beginRetirement();
|
|
110
|
+
this.#publish();
|
|
111
|
+
const ready = await previous.cancelAndWaitForReads();
|
|
112
|
+
if (!ready || previous.hasActiveWrite || this.#disposed) {
|
|
113
|
+
this.#reloading = false;
|
|
114
|
+
this.#publish();
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
this.#controllerUnsubscribe?.();
|
|
118
|
+
previous.dispose();
|
|
119
|
+
const next = this.#createSession();
|
|
120
|
+
this.#epoch += 1;
|
|
121
|
+
this.#controller = next.controller;
|
|
122
|
+
this.#progressFeed = next.progressFeed;
|
|
123
|
+
this.#attachOperationHistory();
|
|
124
|
+
this.#pendingNavigation = undefined;
|
|
125
|
+
this.#reloading = false;
|
|
126
|
+
this.#subscribeController();
|
|
127
|
+
this.#publish();
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
#subscribeController() {
|
|
131
|
+
const epoch = this.#epoch;
|
|
132
|
+
const controller = this.#controller;
|
|
133
|
+
this.#controllerUnsubscribe = controller.subscribe((snapshot) => {
|
|
134
|
+
if (this.#disposed || epoch !== this.#epoch || controller !== this.#controller)
|
|
135
|
+
return;
|
|
136
|
+
const pending = this.#pendingNavigation;
|
|
137
|
+
if (!pending || snapshot.router.current.route.name !== 'result' || !snapshot.result)
|
|
138
|
+
return;
|
|
139
|
+
if (controller.hasActiveWrite)
|
|
140
|
+
return;
|
|
141
|
+
if (snapshot.result.state !== 'succeeded') {
|
|
142
|
+
this.#pendingNavigation = undefined;
|
|
143
|
+
this.#pendingNavigationDrafts = undefined;
|
|
144
|
+
this.#pendingConsumedDraft = undefined;
|
|
145
|
+
this.#publish();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (this.history instanceof LatestSessionResultHistory) {
|
|
149
|
+
this.history.recordResult({ epoch, result: snapshot.result });
|
|
150
|
+
}
|
|
151
|
+
const externalDrafts = 'externalDrafts' in controller ? controller.externalDrafts : [];
|
|
152
|
+
if (!this.#pendingConsumedDraft) {
|
|
153
|
+
const consumedKind = snapshot.result.operationKind === 'configSave'
|
|
154
|
+
|| snapshot.result.operationKind === 'configReset' ? 'configDraft'
|
|
155
|
+
: snapshot.result.operationKind === 'sourceMutation'
|
|
156
|
+
|| snapshot.result.operationKind === 'catalogGeneration' ? 'sourceDraft'
|
|
157
|
+
: snapshot.result.operationKind === 'pluginWriteBatch' ? 'batchDraft' : undefined;
|
|
158
|
+
this.#pendingConsumedDraft = externalDrafts.find((draft) => draft.kind === consumedKind);
|
|
159
|
+
if (this.#pendingConsumedDraft)
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
else if (externalDrafts.some((draft) => JSON.stringify(draft) === JSON.stringify(this.#pendingConsumedDraft)))
|
|
163
|
+
return;
|
|
164
|
+
this.#pendingConsumedDraft = undefined;
|
|
165
|
+
if (controller.hasSessionDraft) {
|
|
166
|
+
this.#pendingNavigationDrafts = externalDrafts;
|
|
167
|
+
this.#publish();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
this.#pendingNavigation = undefined;
|
|
171
|
+
this.#pendingNavigationDrafts = undefined;
|
|
172
|
+
if (pending === 'home') {
|
|
173
|
+
controller.goHome();
|
|
174
|
+
this.#publish();
|
|
175
|
+
}
|
|
176
|
+
else
|
|
177
|
+
void this.#reload();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
#draftConfirmationMatches(confirmation) {
|
|
181
|
+
if (!confirmation || !('externalDrafts' in this.#controller))
|
|
182
|
+
return false;
|
|
183
|
+
return JSON.stringify(confirmation) === JSON.stringify(this.#controller.externalDrafts);
|
|
184
|
+
}
|
|
185
|
+
#attachOperationHistory() {
|
|
186
|
+
const controller = this.#controller;
|
|
187
|
+
controller.attachOperationHistory?.(this.history, this.#epoch);
|
|
188
|
+
}
|
|
189
|
+
#publish() {
|
|
190
|
+
if (this.#disposed)
|
|
191
|
+
return;
|
|
192
|
+
const snapshot = this.snapshot;
|
|
193
|
+
for (const listener of this.#listeners)
|
|
194
|
+
listener(snapshot);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=session-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-host.js","sourceRoot":"","sources":["../../../src/tui/session-host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAW/D,MAAM,OAAO,0BAA2B,SAAQ,qBAAqB;IACnE,aAAa,CAAuB;IAEpC,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,CAAC;IAED,YAAY,CAAC,MAA2B;QACtC,IAAI,CAAC,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF;AAYD,MAAM,OAAO,WAAW;IACb,UAAU,GAAG,IAAI,GAAG,EAA2C,CAAC;IAChE,cAAc,CAAyE;IACvF,OAAO,CAAsB;IACtC,MAAM,GAAG,CAAC,CAAC;IACX,WAAW,CAAgB;IAC3B,aAAa,CAAsB;IACnC,sBAAsB,CAAc;IACpC,kBAAkB,CAAqB;IACvC,wBAAwB,CAAwB;IAChD,qBAAqB,CAAsB;IAC3C,UAAU,GAAG,KAAK,CAAC;IACnB,SAAS,GAAG,KAAK,CAAC;IAElB,YAAY,OAGX;QACC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,qBAAqB,EAAE,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;QAC1C,IAAI,CAAC,uBAAuB,EAAE,CAAC;QA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SAAS,CAAC;YACpC,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC;YAC1C,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;gBACvB,UAAU,CAAC,MAAM,EAAE,CAAC;gBACpB,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,CAAC;;gBAAM,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB,CAAC,YAAmC;QAC3D,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,gBAAgB,IAAI,IAAI,CAAC,WAAW,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3E,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC1F,CAAC;IAED,uBAAuB;QACrB,MAAM,UAAU,GAAG,IAAI,CAAC,WAEvB,CAAC;QACF,UAAU,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU;YAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type ArtifactSurface = {
|
|
|
10
10
|
export type PlatformSelection = PlatformName | 'both';
|
|
11
11
|
export type CommandAction = 'install' | 'uninstall' | 'reinstall' | 'cleanup' | 'config' | 'status';
|
|
12
12
|
export type RebuildCommand = 'install' | 'sync' | 'cleanup' | 'reinstall' | 'uninstall';
|
|
13
|
-
export type RebuildActionName = 'preflight.inspect' | 'stale.cleanup' | 'native.write' | 'artifacts.write' | '
|
|
13
|
+
export type RebuildActionName = 'preflight.inspect' | 'stale.cleanup' | 'native.write' | 'artifacts.write' | 'preApply' | 'postcheck.inspect' | 'recovery.cleanup' | 'cleanup.owned';
|
|
14
14
|
export type RebuildActionEventData = {
|
|
15
15
|
name: RebuildActionName;
|
|
16
16
|
phase: 'start';
|
|
@@ -43,6 +43,7 @@ export type ConfigValueState = 'default' | 'configured' | 'invalid';
|
|
|
43
43
|
export type NextStepKind = 'uiAction' | 'cliCommand' | 'manual';
|
|
44
44
|
export type ManualNextStepKind = 'guidance' | 'blocker' | 'documentation';
|
|
45
45
|
export type TargetWriteState = 'completed' | 'failed';
|
|
46
|
+
export type ConfigApplyTargetState = TargetWriteState | 'skipped';
|
|
46
47
|
export type ReceiptOverallState = 'succeeded' | 'failed';
|
|
47
48
|
export type RebuildReceiptOverallState = ReceiptOverallState | 'partial';
|
|
48
49
|
export type CatalogGitRefPolicy = {
|
|
@@ -78,6 +79,7 @@ export interface CatalogSourcesConfig {
|
|
|
78
79
|
export interface CatalogSourceResolution {
|
|
79
80
|
sourceId: CatalogSourceId;
|
|
80
81
|
sourceIdentity: SourceIdentity;
|
|
82
|
+
logicalIdentity: string;
|
|
81
83
|
requestedRef: string;
|
|
82
84
|
resolvedCommit: string;
|
|
83
85
|
rootDir: string;
|
|
@@ -155,6 +157,12 @@ export interface CatalogSourcePluginChanges {
|
|
|
155
157
|
changed: string[];
|
|
156
158
|
newlyIncompatible: string[];
|
|
157
159
|
dependencyChanged: string[];
|
|
160
|
+
platformSupportChanged: CatalogSourcePlatformSupportChange[];
|
|
161
|
+
}
|
|
162
|
+
export interface CatalogSourcePlatformSupportChange {
|
|
163
|
+
pluginId: string;
|
|
164
|
+
removedPlatforms: PlatformName[];
|
|
165
|
+
addedPlatforms: PlatformName[];
|
|
158
166
|
}
|
|
159
167
|
export interface CatalogSourceImpactError {
|
|
160
168
|
code: 'stateInventoryFailed' | 'catalogManifestUnavailable';
|
|
@@ -169,9 +177,14 @@ export interface CatalogSourceImpactError {
|
|
|
169
177
|
scope?: Scope;
|
|
170
178
|
};
|
|
171
179
|
}
|
|
180
|
+
export interface CatalogSourcePrimaryChange {
|
|
181
|
+
fromSourceId: string;
|
|
182
|
+
toSourceId: string;
|
|
183
|
+
}
|
|
172
184
|
export interface CatalogSourceImpact {
|
|
173
|
-
impactSchemaVersion:
|
|
185
|
+
impactSchemaVersion: 3;
|
|
174
186
|
sourceId: string;
|
|
187
|
+
primaryChange: CatalogSourcePrimaryChange | null;
|
|
175
188
|
inventoryComplete: boolean;
|
|
176
189
|
references: CatalogSourceImpactReference[];
|
|
177
190
|
affectedReferences: CatalogSourceImpactReference[];
|
|
@@ -246,12 +259,51 @@ export interface ReceiptTargetResult {
|
|
|
246
259
|
requiredBy?: string[];
|
|
247
260
|
recoveryActions?: string[];
|
|
248
261
|
}
|
|
262
|
+
export interface ConfigApplyTargetIdentity {
|
|
263
|
+
pluginName: string;
|
|
264
|
+
pluginId?: PluginId;
|
|
265
|
+
platform: PlatformName;
|
|
266
|
+
scope: Scope;
|
|
267
|
+
}
|
|
268
|
+
export interface ConfigApplyTargetResult {
|
|
269
|
+
target: ConfigApplyTargetIdentity;
|
|
270
|
+
action: string;
|
|
271
|
+
state: ConfigApplyTargetState;
|
|
272
|
+
message?: string;
|
|
273
|
+
errorCode?: string;
|
|
274
|
+
relation?: 'requested' | 'dependency';
|
|
275
|
+
requiredBy?: string[];
|
|
276
|
+
}
|
|
277
|
+
export interface ConfigApplyError {
|
|
278
|
+
stage: 'schema' | 'source' | 'effectiveConfig' | 'targetDiscovery' | 'targetValidation' | 'apply';
|
|
279
|
+
code: string;
|
|
280
|
+
message: string;
|
|
281
|
+
}
|
|
282
|
+
export type ConfigApplyResult = {
|
|
283
|
+
state: 'skipped';
|
|
284
|
+
reason: 'notRequested' | 'noConfigChange' | 'noEffectiveConfigChange' | 'noVisibleTarget';
|
|
285
|
+
targetResults: [];
|
|
286
|
+
} | {
|
|
287
|
+
state: 'unavailable';
|
|
288
|
+
reason: 'invalidConfig' | 'schemaUnavailable' | 'sourceUnavailable' | 'effectiveConfigUnavailable' | 'targetDiscoveryFailed';
|
|
289
|
+
targetResults: ConfigApplyTargetResult[];
|
|
290
|
+
error?: ConfigApplyError;
|
|
291
|
+
} | {
|
|
292
|
+
state: 'succeeded';
|
|
293
|
+
targetResults: ConfigApplyTargetResult[];
|
|
294
|
+
} | {
|
|
295
|
+
state: 'partial';
|
|
296
|
+
targetResults: ConfigApplyTargetResult[];
|
|
297
|
+
errors?: ConfigApplyError[];
|
|
298
|
+
};
|
|
249
299
|
export interface ConfigFieldEntry {
|
|
250
300
|
key: string;
|
|
251
301
|
title: string;
|
|
252
302
|
kind: ConfigFieldKind;
|
|
253
303
|
reserved: boolean;
|
|
254
304
|
writable: boolean;
|
|
305
|
+
canSet: boolean;
|
|
306
|
+
canUnset: boolean;
|
|
255
307
|
valueState: ConfigValueState;
|
|
256
308
|
effectiveValue: unknown | null;
|
|
257
309
|
sourceLayer: 'default' | 'user' | 'project' | null;
|
|
@@ -262,8 +314,15 @@ export interface ConfigFieldEntry {
|
|
|
262
314
|
issues: unknown[];
|
|
263
315
|
};
|
|
264
316
|
fallback?: {
|
|
317
|
+
state: 'valid';
|
|
265
318
|
effectiveValue: unknown;
|
|
266
319
|
sourceLayer: 'default' | 'user' | 'project';
|
|
320
|
+
} | {
|
|
321
|
+
state: 'invalid';
|
|
322
|
+
sourceLayer: 'default' | 'user' | 'project';
|
|
323
|
+
issues: unknown[];
|
|
324
|
+
} | {
|
|
325
|
+
state: 'missing';
|
|
267
326
|
};
|
|
268
327
|
value: unknown | null;
|
|
269
328
|
source: 'default' | 'user' | 'project' | 'missing';
|
|
@@ -279,14 +338,16 @@ export interface ConfigReceiptFieldEntry {
|
|
|
279
338
|
action: 'set' | 'unset' | 'reset';
|
|
280
339
|
scope: Scope;
|
|
281
340
|
valueState?: ConfigValueState;
|
|
341
|
+
stale?: true;
|
|
282
342
|
}
|
|
283
|
-
export declare const CONFIG_MUTATION_RECEIPT_SCHEMA_VERSION =
|
|
343
|
+
export declare const CONFIG_MUTATION_RECEIPT_SCHEMA_VERSION = 7;
|
|
284
344
|
export type ConfigMutationCommand = 'config:set' | 'config:unset' | 'config:reset';
|
|
285
345
|
export interface ConfigMutationReceiptBase<Command extends ConfigMutationCommand = ConfigMutationCommand> {
|
|
286
346
|
receiptSchemaVersion: typeof CONFIG_MUTATION_RECEIPT_SCHEMA_VERSION;
|
|
287
347
|
command: Command;
|
|
288
348
|
ok: boolean;
|
|
289
349
|
overallState: RebuildReceiptOverallState;
|
|
350
|
+
configWrite: 'notStarted' | 'failed' | 'succeeded';
|
|
290
351
|
}
|
|
291
352
|
export interface ConfigSchemaEvidence {
|
|
292
353
|
source: 'currentCatalog';
|