vibecodingmachine-cli 2026.2.26-1752 → 2026.3.9-1621

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 (74) hide show
  1. package/bin/auth/auth-compliance.js +7 -1
  2. package/bin/commands/agent-commands.js +150 -228
  3. package/bin/commands/command-aliases.js +68 -0
  4. package/bin/vibecodingmachine.js +1 -2
  5. package/package.json +2 -2
  6. package/src/commands/agents/list.js +71 -115
  7. package/src/commands/agents-check.js +16 -4
  8. package/src/commands/analyze-file-sizes.js +1 -1
  9. package/src/commands/auto-direct/auto-provider-manager.js +290 -0
  10. package/src/commands/auto-direct/auto-status-display.js +331 -0
  11. package/src/commands/auto-direct/auto-utils.js +439 -0
  12. package/src/commands/auto-direct/file-operations.js +110 -0
  13. package/src/commands/auto-direct/provider-config.js +1 -1
  14. package/src/commands/auto-direct/provider-manager.js +1 -1
  15. package/src/commands/auto-direct/status-display.js +1 -1
  16. package/src/commands/auto-direct/utils.js +24 -18
  17. package/src/commands/auto-direct-refactored.js +413 -0
  18. package/src/commands/auto-direct.js +594 -188
  19. package/src/commands/requirements/commands.js +353 -0
  20. package/src/commands/requirements/default-handlers.js +272 -0
  21. package/src/commands/requirements/disable.js +97 -0
  22. package/src/commands/requirements/enable.js +97 -0
  23. package/src/commands/requirements/utils.js +194 -0
  24. package/src/commands/requirements-refactored.js +60 -0
  25. package/src/commands/requirements.js +38 -771
  26. package/src/commands/specs/disable.js +96 -0
  27. package/src/commands/specs/enable.js +96 -0
  28. package/src/trui/TruiInterface.js +5 -11
  29. package/src/trui/agents/AgentInterface.js +24 -396
  30. package/src/trui/agents/handlers/CommandHandler.js +93 -0
  31. package/src/trui/agents/handlers/ContextManager.js +117 -0
  32. package/src/trui/agents/handlers/DisplayHandler.js +243 -0
  33. package/src/trui/agents/handlers/HelpHandler.js +51 -0
  34. package/src/utils/auth.js +13 -111
  35. package/src/utils/config.js +4 -0
  36. package/src/utils/interactive/requirements-navigation.js +17 -15
  37. package/src/utils/interactive-broken.js +2 -2
  38. package/src/utils/provider-checker/agent-runner.js +15 -1
  39. package/src/utils/provider-checker/cli-installer.js +149 -7
  40. package/src/utils/provider-checker/opencode-checker.js +588 -0
  41. package/src/utils/provider-checker/provider-validator.js +88 -3
  42. package/src/utils/provider-checker/time-formatter.js +3 -2
  43. package/src/utils/provider-manager.js +28 -20
  44. package/src/utils/provider-registry.js +35 -3
  45. package/src/utils/requirements-navigator/index.js +94 -0
  46. package/src/utils/requirements-navigator/input-handler.js +217 -0
  47. package/src/utils/requirements-navigator/section-loader.js +188 -0
  48. package/src/utils/requirements-navigator/tree-builder.js +105 -0
  49. package/src/utils/requirements-navigator/tree-renderer.js +50 -0
  50. package/src/utils/requirements-navigator.js +2 -583
  51. package/src/utils/trui-clarifications.js +188 -0
  52. package/src/utils/trui-feedback.js +54 -1
  53. package/src/utils/trui-kiro-integration.js +398 -0
  54. package/src/utils/trui-main-handlers.js +194 -0
  55. package/src/utils/trui-main-menu.js +235 -0
  56. package/src/utils/trui-nav-agents.js +178 -25
  57. package/src/utils/trui-nav-requirements.js +203 -27
  58. package/src/utils/trui-nav-settings.js +114 -1
  59. package/src/utils/trui-nav-specifications.js +44 -3
  60. package/src/utils/trui-navigation-backup.js +603 -0
  61. package/src/utils/trui-navigation.js +70 -228
  62. package/src/utils/trui-provider-health.js +274 -0
  63. package/src/utils/trui-provider-manager.js +376 -0
  64. package/src/utils/trui-quick-menu.js +25 -1
  65. package/src/utils/trui-req-actions-backup.js +507 -0
  66. package/src/utils/trui-req-actions.js +148 -216
  67. package/src/utils/trui-req-editor.js +170 -0
  68. package/src/utils/trui-req-file-ops.js +278 -0
  69. package/src/utils/trui-req-tree-old.js +719 -0
  70. package/src/utils/trui-req-tree.js +348 -627
  71. package/src/utils/trui-specifications.js +25 -7
  72. package/src/utils/trui-windsurf.js +231 -10
  73. package/src/utils/welcome-screen-extracted.js +2 -2
  74. package/src/utils/welcome-screen.js +2 -2
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Command Handler for TRUI Agent Interface
3
+ *
4
+ * Handles command parsing and execution.
5
+ * Follows constitutional requirements: <555 lines, test-first approach.
6
+ */
7
+
8
+ /**
9
+ * Command Handler class
10
+ */
11
+ class CommandHandler {
12
+ /**
13
+ * Create command handler instance
14
+ * @param {Object} options - Handler options
15
+ */
16
+ constructor(options = {}) {
17
+ this.agentCommands = options.agentCommands;
18
+ this.contextManager = options.contextManager;
19
+ }
20
+
21
+ /**
22
+ * Execute command using RUI pattern
23
+ * @param {string} commandString - Command string
24
+ * @returns {Promise<Object>} - Command result
25
+ */
26
+ async executeCommand(commandString) {
27
+ // Parse command
28
+ const parsed = this.parseCommand(commandString);
29
+
30
+ if (!parsed.success) {
31
+ throw new Error(parsed.error);
32
+ }
33
+
34
+ // Update context
35
+ if (this.contextManager) {
36
+ this.contextManager.updateContext(parsed);
37
+ }
38
+
39
+ // Execute command
40
+ const result = await this.agentCommands.executeCommand(
41
+ parsed.verb,
42
+ parsed.resource,
43
+ parsed.params
44
+ );
45
+
46
+ return { result, parsed };
47
+ }
48
+
49
+ /**
50
+ * Parse command string
51
+ * @param {string} commandString - Command string
52
+ * @returns {Object} - Parsed command
53
+ */
54
+ parseCommand(commandString) {
55
+ const tokens = commandString.trim().split(/\s+/);
56
+
57
+ if (tokens.length === 0) {
58
+ return { success: false, error: 'Empty command' };
59
+ }
60
+
61
+ // Simple command parsing for TRUI
62
+ const verb = tokens[0].toUpperCase();
63
+ const resource = tokens[1] || '';
64
+ const params = {};
65
+
66
+ // Parse parameters
67
+ for (let i = 2; i < tokens.length; i++) {
68
+ const token = tokens[i];
69
+
70
+ if (token.startsWith('--')) {
71
+ const param = token.substring(2);
72
+ if (param.includes('=')) {
73
+ const [key, value] = param.split('=', 2);
74
+ params[key] = value;
75
+ } else {
76
+ params[param] = true;
77
+ }
78
+ } else if (token.startsWith('-')) {
79
+ const flag = token.substring(1);
80
+ params[flag] = true;
81
+ }
82
+ }
83
+
84
+ return {
85
+ success: true,
86
+ verb,
87
+ resource,
88
+ params
89
+ };
90
+ }
91
+ }
92
+
93
+ module.exports = CommandHandler;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Context Manager for TRUI Agent Interface
3
+ *
4
+ * Manages interface context and navigation state.
5
+ * Follows constitutional requirements: <555 lines, test-first approach.
6
+ */
7
+
8
+ /**
9
+ * Context Manager class
10
+ */
11
+ class ContextManager {
12
+ /**
13
+ * Create context manager instance
14
+ * @param {Object} options - Manager options
15
+ */
16
+ constructor(options = {}) {
17
+ this.context = 'agents';
18
+ this.currentAgent = null;
19
+ this.navigationHistory = [];
20
+ this.maxHistorySize = options.maxHistorySize || 50;
21
+ }
22
+
23
+ /**
24
+ * Update interface context
25
+ * @param {Object} parsedCommand - Parsed command
26
+ */
27
+ updateContext(parsedCommand) {
28
+ this.navigationHistory.push({
29
+ command: `${parsedCommand.verb} ${parsedCommand.resource}`,
30
+ timestamp: new Date().toISOString()
31
+ });
32
+
33
+ // Keep history size limited
34
+ if (this.navigationHistory.length > this.maxHistorySize) {
35
+ this.navigationHistory.shift();
36
+ }
37
+
38
+ // Update current context
39
+ if (parsedCommand.resource === 'agents' || parsedCommand.resource === 'agent') {
40
+ this.context = 'agents';
41
+ } else if (parsedCommand.resource && parsedCommand.resource !== 'agents') {
42
+ this.context = 'agent-details';
43
+ this.currentAgent = parsedCommand.resource;
44
+ } else {
45
+ this.context = 'unknown';
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Get prompt based on current context
51
+ * @returns {string} - Prompt string
52
+ */
53
+ getPrompt() {
54
+ switch (this.context) {
55
+ case 'agents':
56
+ return 'agents> ';
57
+ case 'agent-details':
58
+ return `agents/${this.currentAgent}> `;
59
+ default:
60
+ return 'vibe> ';
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Add command to history
66
+ * @param {string} command - Command to add
67
+ */
68
+ addToHistory(command) {
69
+ // Avoid duplicates
70
+ const lastCommand = this.navigationHistory[this.navigationHistory.length - 1];
71
+ if (lastCommand && lastCommand.command === command) {
72
+ return;
73
+ }
74
+
75
+ this.navigationHistory.push({
76
+ command,
77
+ timestamp: new Date().toISOString()
78
+ });
79
+ }
80
+
81
+ /**
82
+ * Show command history
83
+ */
84
+ showHistory() {
85
+ console.log('\n=== COMMAND HISTORY ===');
86
+ this.navigationHistory.forEach((entry, index) => {
87
+ const timestamp = new Date(entry.timestamp).toLocaleString();
88
+ console.log(`${(index + 1).toString().padStart(2)}. ${entry.command} (${timestamp})`);
89
+ });
90
+ }
91
+
92
+ /**
93
+ * Get current context
94
+ * @returns {string} - Current context
95
+ */
96
+ getContext() {
97
+ return this.context;
98
+ }
99
+
100
+ /**
101
+ * Get current agent
102
+ * @returns {string|null} - Current agent ID
103
+ */
104
+ getCurrentAgent() {
105
+ return this.currentAgent;
106
+ }
107
+
108
+ /**
109
+ * Get history size
110
+ * @returns {number} - History size
111
+ */
112
+ getHistorySize() {
113
+ return this.navigationHistory.length;
114
+ }
115
+ }
116
+
117
+ module.exports = ContextManager;
@@ -0,0 +1,243 @@
1
+ /**
2
+ * Display Handler for TRUI Agent Interface
3
+ *
4
+ * Handles all display operations for agent data, results, and summaries.
5
+ * Follows constitutional requirements: <555 lines, test-first approach.
6
+ */
7
+
8
+ /**
9
+ * Display Handler class
10
+ */
11
+ class DisplayHandler {
12
+ /**
13
+ * Create display handler instance
14
+ * @param {Object} options - Handler options
15
+ */
16
+ constructor(options = {}) {
17
+ this.verbose = options.verbose || false;
18
+ }
19
+
20
+ /**
21
+ * Display command result
22
+ * @param {Object} result - Command result
23
+ * @param {Object} parsedCommand - Parsed command
24
+ * @param {Object} responseFormatter - Response formatter
25
+ * @returns {Promise<void>}
26
+ */
27
+ async displayResult(result, parsedCommand, responseFormatter) {
28
+ const formattedResponse = responseFormatter.format(result, 'trui', {
29
+ verbose: parsedCommand.params.verbose
30
+ });
31
+
32
+ if (formattedResponse.success) {
33
+ await this.displaySuccessResult(formattedResponse, parsedCommand);
34
+ } else {
35
+ await this.displayErrorResult(formattedResponse, parsedCommand);
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Display successful result
41
+ * @param {Object} response - Formatted response
42
+ * @param {Object} parsedCommand - Parsed command
43
+ * @returns {Promise<void>}
44
+ */
45
+ async displaySuccessResult(response, parsedCommand) {
46
+ if (response.data && response.data.agents) {
47
+ await this.displayAgentList(response.data);
48
+ } else if (response.data && response.data.id) {
49
+ await this.displayAgentDetails(response.data);
50
+ } else if (response.data && response.data.summary) {
51
+ await this.displayOperationSummary(response.data);
52
+ } else {
53
+ console.log('Command completed successfully');
54
+ }
55
+
56
+ // Show navigation hints
57
+ if (response.navigation) {
58
+ this.showNavigationHints(response.navigation);
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Display error result
64
+ * @param {Object} response - Formatted response
65
+ * @param {Object} parsedCommand - Parsed command
66
+ * @returns {Promise<void>}
67
+ */
68
+ async displayErrorResult(response, parsedCommand) {
69
+ console.error(`Error: ${response.error}`);
70
+
71
+ if (response.navigation && response.navigation.suggestions) {
72
+ console.log('\nSuggestions:');
73
+ response.navigation.suggestions.forEach(suggestion => {
74
+ console.log(` ${suggestion}`);
75
+ });
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Display agent list
81
+ * @param {Object} data - Agent data
82
+ * @returns {Promise<void>}
83
+ */
84
+ async displayAgentList(data) {
85
+ console.log('\n=== AGENTS ===');
86
+
87
+ if (!data.agents || data.agents.length === 0) {
88
+ console.log('No agents found.');
89
+ return;
90
+ }
91
+
92
+ // Display agents with navigation hints
93
+ data.agents.forEach((agent, agentIndex) => {
94
+ const status = agent.status || 'UNKNOWN';
95
+ const statusIcon = this.getStatusIcon(status);
96
+ const displayIndex = (agentIndex + 1).toString().padStart(2);
97
+
98
+ console.log(`${displayIndex}. ${statusIcon} ${agent.id.padEnd(15)} - ${agent.name}`);
99
+
100
+ if (agent.statusDescription) {
101
+ console.log(` Status: ${agent.statusDescription}`);
102
+ }
103
+ });
104
+
105
+ console.log(`\nTotal: ${data.agents.length} agents`);
106
+ this.showAgentListActions();
107
+ }
108
+
109
+ /**
110
+ * Display agent details
111
+ * @param {Object} data - Agent data
112
+ * @returns {Promise<void>}
113
+ */
114
+ async displayAgentDetails(data) {
115
+ console.log(`\n=== AGENT: ${data.id.toUpperCase()} ===`);
116
+ console.log(`Name: ${data.name}`);
117
+ console.log(`Description: ${data.description || 'No description'}`);
118
+ console.log(`Enabled: ${data.enabled ? 'Yes' : 'No'}`);
119
+ console.log(`Status: ${data.status || 'UNKNOWN'}`);
120
+
121
+ if (data.statusDescription) {
122
+ console.log(`Status Description: ${data.statusDescription}`);
123
+ }
124
+
125
+ if (data.lastChecked) {
126
+ console.log(`Last Checked: ${new Date(data.lastChecked).toLocaleString()}`);
127
+ }
128
+
129
+ if (data.lastVerified) {
130
+ console.log(`Last Verified: ${new Date(data.lastVerified).toLocaleString()}`);
131
+ }
132
+
133
+ // Show sections if available
134
+ if (data.sections) {
135
+ data.sections.forEach(section => {
136
+ console.log(`\n--- ${section.title.toUpperCase()} ---`);
137
+ section.fields.forEach(field => {
138
+ const value = data[field];
139
+ if (value !== undefined && value !== null) {
140
+ console.log(`${field}: ${JSON.stringify(value, null, 2)}`);
141
+ }
142
+ });
143
+ });
144
+ }
145
+
146
+ this.showAgentDetailActions(data);
147
+ }
148
+
149
+ /**
150
+ * Display operation summary
151
+ * @param {Object} data - Summary data
152
+ * @returns {Promise<void>}
153
+ */
154
+ async displayOperationSummary(data) {
155
+ console.log('\n=== OPERATION SUMMARY ===');
156
+ console.log(`Success: ${data.allSuccessful ? 'Yes' : 'No'}`);
157
+ console.log(`Total: ${data.total || 0}`);
158
+ console.log(`Successful: ${data.successful || 0}`);
159
+ console.log(`Failed: ${data.failed || 0}`);
160
+ console.log(`Skipped: ${data.skipped || 0}`);
161
+
162
+ if (data.duration) {
163
+ console.log(`Duration: ${(data.duration / 1000).toFixed(2)}s`);
164
+ }
165
+
166
+ // Show breakdown if available
167
+ if (data.breakdown) {
168
+ console.log('\n--- BREAKDOWN ---');
169
+ Object.entries(data.breakdown).forEach(([key, value]) => {
170
+ console.log(`${key}: ${JSON.stringify(value, null, 2)}`);
171
+ });
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Show agent list actions
177
+ */
178
+ showAgentListActions() {
179
+ console.log('\nAvailable actions:');
180
+ console.log(' <index> - View agent details (e.g., "1")');
181
+ console.log(' get <agent-id> - Get specific agent');
182
+ console.log(' check <agent-id> - Check specific agent');
183
+ console.log(' check agents - Check all agents');
184
+ console.log(' help - Show this help');
185
+ console.log(' exit - Exit interface');
186
+ }
187
+
188
+ /**
189
+ * Show agent detail actions
190
+ * @param {Object} agent - Agent data
191
+ */
192
+ showAgentDetailActions(agent) {
193
+ console.log('\nAvailable actions:');
194
+ console.log(` enable ${agent.id} - Enable agent`);
195
+ console.log(` disable ${agent.id} - Disable agent`);
196
+ console.log(` check ${agent.id} - Check agent`);
197
+ console.log(` remove ${agent.id} - Remove agent`);
198
+ console.log(` logs ${agent.id} - View agent logs`);
199
+ console.log(' back - Return to agent list');
200
+ console.log(' help - Show this help');
201
+ console.log(' exit - Exit interface');
202
+ }
203
+
204
+ /**
205
+ * Show navigation hints
206
+ * @param {Object} navigation - Navigation data
207
+ */
208
+ showNavigationHints(navigation) {
209
+ if (navigation.context) {
210
+ console.log(`\nContext: ${navigation.context}`);
211
+ }
212
+
213
+ if (navigation.availableActions && navigation.availableActions.length > 0) {
214
+ console.log('Available commands:', navigation.availableActions.join(', '));
215
+ }
216
+
217
+ if (navigation.shortcuts && navigation.shortcuts.length > 0) {
218
+ console.log('Shortcuts:', navigation.shortcuts.join(', '));
219
+ }
220
+ }
221
+
222
+ /**
223
+ * Get status icon
224
+ * @param {string} status - Agent status
225
+ * @returns {string} - Status icon
226
+ */
227
+ getStatusIcon(status) {
228
+ const icons = {
229
+ 'VERIFIED': '✅',
230
+ 'INSTALLED': '📦',
231
+ 'INSTALLING': '⏳',
232
+ 'VERIFYING': '🔍',
233
+ 'NOT_INSTALLED': '❌',
234
+ 'ERROR': '🚫',
235
+ 'RATE_LIMITED': '⏱️',
236
+ 'DISABLED': '🚫'
237
+ };
238
+
239
+ return icons[status] || '❓';
240
+ }
241
+ }
242
+
243
+ module.exports = DisplayHandler;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Help Handler for TRUI Agent Interface
3
+ *
4
+ * Handles help display and command information.
5
+ * Follows constitutional requirements: <555 lines, test-first approach.
6
+ */
7
+
8
+ /**
9
+ * Help Handler class
10
+ */
11
+ class HelpHandler {
12
+ /**
13
+ * Create help handler instance
14
+ */
15
+ constructor() {
16
+ // Help handler is stateless
17
+ }
18
+
19
+ /**
20
+ * Show help information
21
+ */
22
+ showHelp() {
23
+ console.log('\n=== HELP ===');
24
+ console.log('Available commands:');
25
+ console.log(' list agents - List all agents');
26
+ console.log(' get <agent-id> - Get agent details');
27
+ console.log(' check agents - Check all agents');
28
+ console.log(' check <agent-id> - Check specific agent');
29
+ console.log(' enable <agent-id> - Enable agent');
30
+ console.log(' disable <agent-id> - Disable agent');
31
+ console.log(' remove <agent-id> - Remove agent');
32
+ console.log(' logs <agent-id> - View agent logs');
33
+ console.log('');
34
+ console.log('Options:');
35
+ console.log(' --includeDisabled - Include disabled agents in list');
36
+ console.log(' --format <format> - Output format (table, json, csv)');
37
+ console.log(' --verbose - Show detailed output');
38
+ console.log(' --force - Force reinstall');
39
+ console.log(' --skip-verification - Skip verification step');
40
+ console.log('');
41
+ console.log('Navigation:');
42
+ console.log(' <number> - Quick select agent from list');
43
+ console.log(' back - Return to agent list');
44
+ console.log(' history - Show command history');
45
+ console.log(' clear - Clear screen');
46
+ console.log(' help - Show this help');
47
+ console.log(' exit - Exit interface');
48
+ }
49
+ }
50
+
51
+ module.exports = HelpHandler;