vgxness 1.3.0 → 1.4.0

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 (36) hide show
  1. package/README.md +16 -16
  2. package/dist/agents/agent-activation-service.js +9 -5
  3. package/dist/cli/commands/interactive-entrypoint-dispatcher.js +4 -4
  4. package/dist/cli/commands/setup-dispatcher.js +4 -4
  5. package/dist/cli/doctor-renderer.js +1 -1
  6. package/dist/cli/sdd-renderer.js +7 -7
  7. package/dist/cli/setup-status-renderer.js +1 -0
  8. package/dist/cli/tui/main-menu/main-menu-read-model.js +8 -0
  9. package/dist/cli/tui/main-menu/main-menu-render-shape.js +14 -1
  10. package/dist/cli/tui/opentui/code/index.js +4 -4
  11. package/dist/cli/tui/opentui/main-menu/screen.js +6 -0
  12. package/dist/cli/tui/opentui/setup/screen.js +1 -1
  13. package/dist/cli/tui/opentui/setup/smoke.js +1 -1
  14. package/dist/cli/tui/setup/setup-tui-read-model.js +3 -3
  15. package/dist/cli/tui/setup/setup-tui-render-shape.js +8 -9
  16. package/dist/cli/tui/setup/setup-tui-state.js +1 -1
  17. package/dist/code/runtime/sdd-context.js +2 -2
  18. package/dist/mcp/validation.js +6 -2
  19. package/dist/orchestrator/natural-language-planner.js +1 -1
  20. package/dist/sdd/sdd-workflow-service.js +1 -1
  21. package/dist/setup/backup-rollback-service.js +2 -2
  22. package/dist/setup/setup-lifecycle-service.js +6 -6
  23. package/dist/setup/setup-plan.js +3 -3
  24. package/dist/verification/verification-plan-service.js +1 -1
  25. package/docs/architecture.md +39 -38
  26. package/docs/cli.md +134 -127
  27. package/docs/funcionamiento-del-sistema.md +16 -16
  28. package/docs/harness-gap-analysis.md +15 -1
  29. package/docs/prd.md +10 -10
  30. package/docs/vgxcode.md +20 -9
  31. package/docs/vgxness-code.md +6 -4
  32. package/package.json +1 -1
  33. package/dist/cli/guided-main-menu.js +0 -470
  34. package/dist/cli/setup-wizard-read-model.js +0 -72
  35. package/dist/cli/setup-wizard-renderer.js +0 -155
  36. package/dist/cli/setup-wizard-state.js +0 -82
@@ -1,155 +0,0 @@
1
- import { badge, joinSections, renderActionLine, renderPanel } from './tui-render-helpers.js';
2
- export function renderSetupWizard(readModel, state, options = {}) {
3
- if (readModel === undefined) {
4
- return joinSections([
5
- renderPanel('Setup · Loading', [`${badge('loading')} Setup status is not loaded yet.`, 'Provider details will appear after setup status is loaded. Press r to refresh.'], { ...options, status: 'loading' }),
6
- renderFallbackProgress(state, options),
7
- ]);
8
- }
9
- return joinSections([
10
- renderSetupSummary(readModel, state, options),
11
- renderProgress(readModel.steps, state, options),
12
- renderProviderCards(readModel.providerCards, state, options),
13
- renderExternalActionsPanel(readModel.providerCards, state, options),
14
- renderPanel('Setup safety', [shortSafetySummary(readModel.safetySummary)], options),
15
- ]);
16
- }
17
- function renderSetupSummary(readModel, state, options) {
18
- const activeIndex = Math.max(0, readModel.steps.findIndex((step) => step.id === state.activeStep));
19
- const activeStep = readModel.steps[activeIndex] ?? readModel.steps[0];
20
- const title = `Setup · Step ${activeIndex + 1}/5 · ${activeStep?.label ?? 'Unknown'}`;
21
- return renderPanel(title, [
22
- `Status: ${badge(readModel.status)}`,
23
- `Summary: ${readModel.summary}`,
24
- `Project mode: ${readModel.projectMode}${readModel.project === undefined ? '' : ` (${readModel.project})`}`,
25
- 'Next safe action: review setup status here, then run any provider commands outside the TUI after review.',
26
- ], { ...options, status: readModel.status });
27
- }
28
- function renderProgress(steps, state, options) {
29
- return renderPanel('Setup steps', steps.map((step, index) => {
30
- const current = step.id === state.activeStep ? '› [current]' : ' ';
31
- const ordinal = `${index + 1}/5`;
32
- return `${current} ${ordinal} ${step.label} ${badge(step.status)} — ${step.summary}`;
33
- }), options);
34
- }
35
- function renderFallbackProgress(state, options) {
36
- const labels = ['Environment', 'Project', 'Providers', 'Agents', 'Verification'];
37
- const ids = ['environment', 'project', 'providers', 'agents', 'verification'];
38
- return renderPanel('Setup steps', labels.map((label, index) => {
39
- const current = ids[index] === state.activeStep ? '› [current]' : ' ';
40
- return `${current} ${index + 1}/5 ${label} ${badge('loading')}`;
41
- }), options);
42
- }
43
- function renderProviderCards(cards, state, options) {
44
- if (cards.length === 0)
45
- return renderPanel('Providers', ['Providers: none available yet.'], { ...options, status: 'empty' });
46
- return renderPanel('Provider cards', [...cards.map((card) => renderProviderRow(card, state)), ...renderFocusedProviderDetails(cards, state)], options);
47
- }
48
- function renderProviderRow(card, state) {
49
- const focused = state.focusedProviderId === card.id ? '› [focused]' : ' ';
50
- const selected = state.selectedProviderIds.includes(card.id) ? '[x]' : '[ ]';
51
- const support = supportLabel(card.supportLevel);
52
- const safetyLabels = setupSafetyLabels(card);
53
- return `${focused} ${selected} ${card.label} ${badge(card.status)} — ${support} ${safetyLabels.map(displaySafetyBadge).join(' ')} — ${card.summary}`;
54
- }
55
- function renderFocusedProviderDetails(cards, state) {
56
- const focusedCard = cards.find((card) => card.id === state.focusedProviderId) ?? cards[state.focusedIndex] ?? cards[0];
57
- if (focusedCard === undefined)
58
- return [];
59
- const targets = focusedCard.targets.length === 0
60
- ? 'Targets: none'
61
- : `Targets: ${focusedCard.targets.map((target) => `${target.label} (${target.kind}${target.path === undefined ? '' : `: ${target.path}`}; TUI-write: no)`).join('; ')}`;
62
- const safetyLabels = setupSafetyLabels(focusedCard);
63
- return [
64
- '',
65
- 'Focused provider details:',
66
- ` ${focusedCard.label}: ${focusedCard.summary}`,
67
- ` Safety: ${safetyLabels.map(displaySafetyBadge).join(' ')}`,
68
- ` ${targets}`,
69
- ` Capabilities: ${focusedCard.capabilities.length === 0 ? 'none' : focusedCard.capabilities.join(', ')}`,
70
- ...renderFocusedProviderPreview(focusedCard),
71
- ...(focusedCard.guidance.length === 0 ? [] : [` Guidance: ${focusedCard.guidance.join(' ')}`]),
72
- ...(state.expandedProviderId === focusedCard.id && focusedCard.evidence.length > 0
73
- ? [' Evidence (presentational only):', ...focusedCard.evidence.map((item) => ` - ${item}`)]
74
- : []),
75
- ];
76
- }
77
- function renderFocusedProviderPreview(card) {
78
- if (card.preview === undefined)
79
- return [];
80
- return [
81
- ' Plan preview (read-only):',
82
- ` - ${card.preview.action}: ${card.preview.summary}`,
83
- ...(card.preview.targetPath === undefined ? [] : [` - Target: ${card.preview.targetPath}`]),
84
- ...(card.preview.backupRequired === undefined ? [] : [` - Backup required: ${String(card.preview.backupRequired)}`]),
85
- ...(card.preview.confirmationRequired === undefined ? [] : [` - Confirmation required: ${String(card.preview.confirmationRequired)}`]),
86
- ...(card.preview.risks.length === 0 ? [] : [` - Risks: ${card.preview.risks.join(' ')}`]),
87
- ...(card.preview.warnings.length === 0 ? [] : [` - Warnings: ${card.preview.warnings.join(' ')}`]),
88
- ];
89
- }
90
- function renderExternalActionsPanel(cards, state, options) {
91
- const focusedCard = cards.find((card) => card.id === state.focusedProviderId) ?? cards[state.focusedIndex] ?? cards[0];
92
- const focusedAction = focusedCard?.actions[0];
93
- const actionLines = cards.flatMap((card) => card.actions.flatMap((action) => renderActionLine(`${card.label}: ${action.label}`, {
94
- ...options,
95
- labels: action.safetyLabels.map(normalizeSafetyLabel),
96
- description: compactActionDescription(action.kind),
97
- })));
98
- return renderPanel('External actions', [
99
- 'Compact external-only guidance: [external] [no TUI writes]; provider config writes require confirmation outside the TUI.',
100
- ...(actionLines.length === 0 ? ['- No external actions available.'] : actionLines),
101
- ...(focusedCard === undefined || focusedAction === undefined ? [] : renderFocusedActionDetails(focusedCard, focusedAction)),
102
- ], options);
103
- }
104
- function renderFocusedActionDetails(card, action) {
105
- return [
106
- '',
107
- `Focused action details: ${card.label}: ${action.label} ${action.safetyLabels.map(displaySafetyBadge).join(' ')}`,
108
- ` Details: ${action.description.length === 0 ? `${action.kind}; run outside the TUI after review.` : action.description}`,
109
- ...(action.command === undefined || action.command.length === 0 ? [] : [` Command: ${action.command.join(' ')}`]),
110
- ];
111
- }
112
- function compactActionDescription(kind) {
113
- return `${kind}; external guidance only; no TUI writes.`;
114
- }
115
- function shortSafetySummary(items) {
116
- if (items.length === 0)
117
- return 'Read-only setup preview: [no TUI writes]; external actions are [external] and require review.';
118
- return 'Read-only setup preview: [no TUI writes]; external actions are [external] and require review outside the TUI.';
119
- }
120
- function supportLabel(level) {
121
- if (level === 'supported-primary')
122
- return 'Supported primary';
123
- if (level === 'preview-only')
124
- return 'Preview-only';
125
- if (level === 'placeholder')
126
- return 'Placeholder';
127
- if (level === 'extension-point')
128
- return 'Extension point';
129
- return 'Unsupported';
130
- }
131
- function setupSafetyLabels(card) {
132
- return unique(['No TUI writes', ...card.actions.flatMap((action) => action.safetyLabels)].map(normalizeSafetyLabel));
133
- }
134
- function unique(values) {
135
- return [...new Set(values)];
136
- }
137
- function displaySafetyBadge(value) {
138
- return badge(normalizeSafetyLabel(value));
139
- }
140
- function normalizeSafetyLabel(value) {
141
- const normalized = value.trim().toLowerCase();
142
- if (normalized === 'external')
143
- return 'external';
144
- if (normalized === 'mutating')
145
- return 'mutating';
146
- if (normalized === 'writes provider config')
147
- return 'writes provider config';
148
- if (normalized === 'no tui writes')
149
- return 'no TUI writes';
150
- if (normalized === 'requires explicit confirmation')
151
- return 'requires confirmation';
152
- if (normalized === 'no provider writes')
153
- return 'no TUI writes';
154
- return value;
155
- }
@@ -1,82 +0,0 @@
1
- export const setupWizardSteps = ['environment', 'project', 'providers', 'agents', 'verification'];
2
- export const defaultSetupProviderIds = ['opencode', 'claude', 'antigravity', 'custom'];
3
- export function createSetupWizardState(input = {}) {
4
- const selectedProviderIds = [...(input.selectedProviderIds ?? ['opencode'])];
5
- const focusedProviderId = input.focusedProviderId ?? defaultSetupProviderIds[0];
6
- return {
7
- activeStep: input.activeStep ?? 'environment',
8
- focusedIndex: clampFocus(input.focusedIndex ?? 0),
9
- projectMode: input.projectMode ?? 'none',
10
- selectedProviderIds,
11
- ...(input.selectedProject === undefined ? {} : { selectedProject: input.selectedProject }),
12
- ...(focusedProviderId === undefined ? {} : { focusedProviderId }),
13
- ...(input.expandedProviderId === undefined ? {} : { expandedProviderId: input.expandedProviderId }),
14
- };
15
- }
16
- export function setupWizardKeyFromInput(input) {
17
- if (input === 'n')
18
- return 'next';
19
- if (input === 'b')
20
- return 'back';
21
- if (input === ' ')
22
- return 'toggle';
23
- if (input === '\r' || input === '\n')
24
- return 'details';
25
- if (input === '\u001B')
26
- return 'escape';
27
- if (input === 'k' || input === '\u001B[A')
28
- return 'up';
29
- if (input === 'j' || input === '\u001B[B')
30
- return 'down';
31
- return undefined;
32
- }
33
- export function reduceSetupWizardKey(state, key) {
34
- if (key === 'next')
35
- return moveStep(state, 1);
36
- if (key === 'back')
37
- return moveStep(state, -1);
38
- if (key === 'up')
39
- return moveFocus(state, -1);
40
- if (key === 'down')
41
- return moveFocus(state, 1);
42
- if (key === 'toggle')
43
- return state.activeStep === 'providers' ? toggleFocusedProvider(state) : state;
44
- if (key === 'details')
45
- return state.activeStep === 'providers' ? toggleExpandedProvider(state) : state;
46
- if (key === 'escape')
47
- return state.expandedProviderId === undefined ? moveStep(state, -1) : withoutExpandedProvider(state);
48
- return state;
49
- }
50
- function moveStep(state, delta) {
51
- const index = setupWizardSteps.indexOf(state.activeStep);
52
- const nextIndex = Math.max(0, Math.min(index + delta, setupWizardSteps.length - 1));
53
- const activeStep = setupWizardSteps[nextIndex] ?? state.activeStep;
54
- return activeStep === state.activeStep ? state : { ...state, activeStep };
55
- }
56
- function moveFocus(state, delta) {
57
- const focusedIndex = clampFocus(state.focusedIndex + delta);
58
- if (state.activeStep !== 'providers')
59
- return focusedIndex === state.focusedIndex ? state : { ...state, focusedIndex };
60
- const focusedProviderId = defaultSetupProviderIds[focusedIndex] ?? state.focusedProviderId;
61
- return { ...state, focusedIndex, ...(focusedProviderId === undefined ? {} : { focusedProviderId }) };
62
- }
63
- function toggleFocusedProvider(state) {
64
- const providerId = state.focusedProviderId ?? defaultSetupProviderIds[state.focusedIndex];
65
- if (providerId === undefined)
66
- return state;
67
- const selected = state.selectedProviderIds.includes(providerId);
68
- return { ...state, selectedProviderIds: selected ? state.selectedProviderIds.filter((id) => id !== providerId) : [...state.selectedProviderIds, providerId] };
69
- }
70
- function toggleExpandedProvider(state) {
71
- const providerId = state.focusedProviderId ?? defaultSetupProviderIds[state.focusedIndex];
72
- if (providerId === undefined)
73
- return state;
74
- return state.expandedProviderId === providerId ? withoutExpandedProvider(state) : { ...state, expandedProviderId: providerId };
75
- }
76
- function withoutExpandedProvider(state) {
77
- const { expandedProviderId: _expandedProviderId, ...rest } = state;
78
- return rest;
79
- }
80
- function clampFocus(index) {
81
- return Math.max(0, Math.min(index, defaultSetupProviderIds.length - 1));
82
- }