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.
- package/bin/auth/auth-compliance.js +7 -1
- package/bin/commands/agent-commands.js +150 -228
- package/bin/commands/command-aliases.js +68 -0
- package/bin/vibecodingmachine.js +1 -2
- package/package.json +2 -2
- package/src/commands/agents/list.js +71 -115
- package/src/commands/agents-check.js +16 -4
- package/src/commands/analyze-file-sizes.js +1 -1
- package/src/commands/auto-direct/auto-provider-manager.js +290 -0
- package/src/commands/auto-direct/auto-status-display.js +331 -0
- package/src/commands/auto-direct/auto-utils.js +439 -0
- package/src/commands/auto-direct/file-operations.js +110 -0
- package/src/commands/auto-direct/provider-config.js +1 -1
- package/src/commands/auto-direct/provider-manager.js +1 -1
- package/src/commands/auto-direct/status-display.js +1 -1
- package/src/commands/auto-direct/utils.js +24 -18
- package/src/commands/auto-direct-refactored.js +413 -0
- package/src/commands/auto-direct.js +594 -188
- package/src/commands/requirements/commands.js +353 -0
- package/src/commands/requirements/default-handlers.js +272 -0
- package/src/commands/requirements/disable.js +97 -0
- package/src/commands/requirements/enable.js +97 -0
- package/src/commands/requirements/utils.js +194 -0
- package/src/commands/requirements-refactored.js +60 -0
- package/src/commands/requirements.js +38 -771
- package/src/commands/specs/disable.js +96 -0
- package/src/commands/specs/enable.js +96 -0
- package/src/trui/TruiInterface.js +5 -11
- package/src/trui/agents/AgentInterface.js +24 -396
- package/src/trui/agents/handlers/CommandHandler.js +93 -0
- package/src/trui/agents/handlers/ContextManager.js +117 -0
- package/src/trui/agents/handlers/DisplayHandler.js +243 -0
- package/src/trui/agents/handlers/HelpHandler.js +51 -0
- package/src/utils/auth.js +13 -111
- package/src/utils/config.js +4 -0
- package/src/utils/interactive/requirements-navigation.js +17 -15
- package/src/utils/interactive-broken.js +2 -2
- package/src/utils/provider-checker/agent-runner.js +15 -1
- package/src/utils/provider-checker/cli-installer.js +149 -7
- package/src/utils/provider-checker/opencode-checker.js +588 -0
- package/src/utils/provider-checker/provider-validator.js +88 -3
- package/src/utils/provider-checker/time-formatter.js +3 -2
- package/src/utils/provider-manager.js +28 -20
- package/src/utils/provider-registry.js +35 -3
- package/src/utils/requirements-navigator/index.js +94 -0
- package/src/utils/requirements-navigator/input-handler.js +217 -0
- package/src/utils/requirements-navigator/section-loader.js +188 -0
- package/src/utils/requirements-navigator/tree-builder.js +105 -0
- package/src/utils/requirements-navigator/tree-renderer.js +50 -0
- package/src/utils/requirements-navigator.js +2 -583
- package/src/utils/trui-clarifications.js +188 -0
- package/src/utils/trui-feedback.js +54 -1
- package/src/utils/trui-kiro-integration.js +398 -0
- package/src/utils/trui-main-handlers.js +194 -0
- package/src/utils/trui-main-menu.js +235 -0
- package/src/utils/trui-nav-agents.js +178 -25
- package/src/utils/trui-nav-requirements.js +203 -27
- package/src/utils/trui-nav-settings.js +114 -1
- package/src/utils/trui-nav-specifications.js +44 -3
- package/src/utils/trui-navigation-backup.js +603 -0
- package/src/utils/trui-navigation.js +70 -228
- package/src/utils/trui-provider-health.js +274 -0
- package/src/utils/trui-provider-manager.js +376 -0
- package/src/utils/trui-quick-menu.js +25 -1
- package/src/utils/trui-req-actions-backup.js +507 -0
- package/src/utils/trui-req-actions.js +148 -216
- package/src/utils/trui-req-editor.js +170 -0
- package/src/utils/trui-req-file-ops.js +278 -0
- package/src/utils/trui-req-tree-old.js +719 -0
- package/src/utils/trui-req-tree.js +348 -627
- package/src/utils/trui-specifications.js +25 -7
- package/src/utils/trui-windsurf.js +231 -10
- package/src/utils/welcome-screen-extracted.js +2 -2
- package/src/utils/welcome-screen.js +2 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Command: Enable Requirement
|
|
3
|
+
*
|
|
4
|
+
* Implements "app enable requirement" command for CLI interface.
|
|
5
|
+
* Follows constitutional requirements: <800 lines, test-first approach.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { enableRequirement } = require('@vibecodingmachine/core/src/utils/requirement-enable-disable');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* CLI enable requirement command implementation
|
|
12
|
+
*/
|
|
13
|
+
class EnableRequirementCommand {
|
|
14
|
+
/**
|
|
15
|
+
* Create command instance
|
|
16
|
+
* @param {Object} options - Command options
|
|
17
|
+
*/
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this.options = options;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Execute enable requirement command
|
|
24
|
+
* @param {Array} args - Command arguments [requirementText]
|
|
25
|
+
* @param {Object} options - Command options
|
|
26
|
+
* @returns {Promise<Object>} - Command result
|
|
27
|
+
*/
|
|
28
|
+
async execute(args = [], options = {}) {
|
|
29
|
+
try {
|
|
30
|
+
// Parse arguments - requirement text can contain spaces
|
|
31
|
+
const requirementText = args.join(' ');
|
|
32
|
+
if (!requirementText) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
error: 'Missing required argument: requirementText',
|
|
36
|
+
usage: 'app enable requirement <requirementText>',
|
|
37
|
+
examples: [
|
|
38
|
+
'app enable requirement "Add user authentication"',
|
|
39
|
+
'app enable requirement "Implement OAuth2 login"'
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Call core enable function
|
|
45
|
+
const result = await enableRequirement(requirementText);
|
|
46
|
+
|
|
47
|
+
if (!result.success) {
|
|
48
|
+
return {
|
|
49
|
+
success: false,
|
|
50
|
+
error: result.message
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
success: true,
|
|
56
|
+
message: result.message,
|
|
57
|
+
data: {
|
|
58
|
+
requirementText,
|
|
59
|
+
status: 'enabled',
|
|
60
|
+
enabledAt: new Date().toISOString()
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
} catch (error) {
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
error: `Failed to enable requirement: ${error.message}`
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get command help
|
|
73
|
+
* @returns {string} - Help text
|
|
74
|
+
*/
|
|
75
|
+
getHelp() {
|
|
76
|
+
return `
|
|
77
|
+
Enable a requirement
|
|
78
|
+
|
|
79
|
+
Usage:
|
|
80
|
+
app enable requirement <requirementText>
|
|
81
|
+
|
|
82
|
+
Arguments:
|
|
83
|
+
requirementText Exact text of the requirement to enable
|
|
84
|
+
|
|
85
|
+
Examples:
|
|
86
|
+
app enable requirement "Add user authentication"
|
|
87
|
+
app enable requirement "Implement OAuth2 login"
|
|
88
|
+
app enable requirement "Create user registration page"
|
|
89
|
+
|
|
90
|
+
Description:
|
|
91
|
+
Enables a requirement that was previously disabled by removing the DISABLED: prefix.
|
|
92
|
+
Enabled requirements will be processed by auto-mode when running "start auto".
|
|
93
|
+
`.trim();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
module.exports = EnableRequirementCommand;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requirements Command Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared utilities for requirements command operations
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const fs = require('fs-extra');
|
|
9
|
+
const chalk = require('chalk');
|
|
10
|
+
const { getRepoPath, setRepoPath } = require('../../utils/config');
|
|
11
|
+
const { getRequirementsPath } = require('vibecodingmachine-core');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get requirements path or exit
|
|
15
|
+
* @returns {Promise<Object>} Repository and requirements paths
|
|
16
|
+
*/
|
|
17
|
+
async function getReqPathOrExit() {
|
|
18
|
+
let repoPath = await getRepoPath();
|
|
19
|
+
|
|
20
|
+
// Auto-detect and initialize if we're in a git repository
|
|
21
|
+
if (!repoPath) {
|
|
22
|
+
const currentDir = process.cwd();
|
|
23
|
+
if (fs.existsSync(path.join(currentDir, '.git'))) {
|
|
24
|
+
console.log(chalk.yellow('No repository configured. Auto-detecting git repository...'));
|
|
25
|
+
repoPath = currentDir;
|
|
26
|
+
await setRepoPath(repoPath);
|
|
27
|
+
console.log(chalk.green(`Repository set to: ${repoPath}`));
|
|
28
|
+
} else {
|
|
29
|
+
console.error(chalk.red('No repository configured. Run "app init" first.'));
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const reqPath = getRequirementsPath(repoPath);
|
|
35
|
+
return { repoPath, reqPath };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Ensure requirements file exists
|
|
40
|
+
* @param {string} reqPath - Requirements file path
|
|
41
|
+
*/
|
|
42
|
+
async function ensureRequirementsFile(reqPath) {
|
|
43
|
+
await fs.ensureFile(reqPath);
|
|
44
|
+
|
|
45
|
+
// Check if file is empty and create initial structure
|
|
46
|
+
const content = await fs.readFile(reqPath, 'utf8');
|
|
47
|
+
if (!content.trim()) {
|
|
48
|
+
await fs.writeJson(reqPath, {
|
|
49
|
+
requirements: [],
|
|
50
|
+
current: null,
|
|
51
|
+
created: new Date().toISOString(),
|
|
52
|
+
version: '1.0'
|
|
53
|
+
}, { spaces: 2 });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Load requirements from file
|
|
59
|
+
* @param {string} reqPath - Requirements file path
|
|
60
|
+
* @returns {Promise<Object>} Requirements data
|
|
61
|
+
*/
|
|
62
|
+
async function loadRequirements(reqPath) {
|
|
63
|
+
try {
|
|
64
|
+
if (!await fs.pathExists(reqPath)) {
|
|
65
|
+
return { requirements: [], current: null };
|
|
66
|
+
}
|
|
67
|
+
return await fs.readJson(reqPath);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error(chalk.red('Error loading requirements:'), error.message);
|
|
70
|
+
return { requirements: [], current: null };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Save requirements to file
|
|
76
|
+
* @param {string} reqPath - Requirements file path
|
|
77
|
+
* @param {Object} data - Requirements data
|
|
78
|
+
*/
|
|
79
|
+
async function saveRequirements(reqPath, data) {
|
|
80
|
+
try {
|
|
81
|
+
data.updated = new Date().toISOString();
|
|
82
|
+
await fs.writeJson(reqPath, data, { spaces: 2 });
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error(chalk.red('Error saving requirements:'), error.message);
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Find requirement by title
|
|
91
|
+
* @param {Array} requirements - Requirements array
|
|
92
|
+
* @param {string} title - Requirement title
|
|
93
|
+
* @returns {Object|null} Found requirement
|
|
94
|
+
*/
|
|
95
|
+
function findRequirementByTitle(requirements, title) {
|
|
96
|
+
return requirements.find(req => req.title === title);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Find requirement by ID
|
|
101
|
+
* @param {Array} requirements - Requirements array
|
|
102
|
+
* @param {string} id - Requirement ID
|
|
103
|
+
* @returns {Object|null} Found requirement
|
|
104
|
+
*/
|
|
105
|
+
function findRequirementById(requirements, id) {
|
|
106
|
+
return requirements.find(req => req.id === id);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Generate unique requirement ID
|
|
111
|
+
* @param {Array} requirements - Existing requirements
|
|
112
|
+
* @returns {string} Unique ID
|
|
113
|
+
*/
|
|
114
|
+
function generateRequirementId(requirements) {
|
|
115
|
+
const maxId = requirements.reduce((max, req) => {
|
|
116
|
+
const match = req.id && req.id.match(/^R(\d+)$/);
|
|
117
|
+
return match ? Math.max(max, parseInt(match[1])) : max;
|
|
118
|
+
}, 0);
|
|
119
|
+
|
|
120
|
+
return `R${maxId + 1}`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Validate requirement data
|
|
125
|
+
* @param {Object} requirement - Requirement object
|
|
126
|
+
* @returns {boolean} Whether requirement is valid
|
|
127
|
+
*/
|
|
128
|
+
function validateRequirement(requirement) {
|
|
129
|
+
return (
|
|
130
|
+
requirement &&
|
|
131
|
+
typeof requirement.title === 'string' &&
|
|
132
|
+
requirement.title.trim().length > 0 &&
|
|
133
|
+
typeof requirement.description === 'string' &&
|
|
134
|
+
requirement.description.trim().length > 0
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Format requirement for display
|
|
140
|
+
* @param {Object} requirement - Requirement object
|
|
141
|
+
* @param {boolean} showCurrent - Whether to show current indicator
|
|
142
|
+
* @returns {string} Formatted requirement string
|
|
143
|
+
*/
|
|
144
|
+
function formatRequirement(requirement, showCurrent = false) {
|
|
145
|
+
const current = showCurrent && requirement.current ? ' (CURRENT)' : '';
|
|
146
|
+
const status = requirement.status ? ` [${requirement.status}]` : '';
|
|
147
|
+
const id = requirement.id ? `${requirement.id}: ` : '';
|
|
148
|
+
|
|
149
|
+
return `${chalk.cyan(id)}${chalk.white(requirement.title)}${status}${current}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Open file in default editor
|
|
154
|
+
* @param {string} filePath - File path to open
|
|
155
|
+
*/
|
|
156
|
+
async function openInEditor(filePath) {
|
|
157
|
+
const { exec } = require('child_process');
|
|
158
|
+
const platform = process.platform;
|
|
159
|
+
|
|
160
|
+
let command;
|
|
161
|
+
switch (platform) {
|
|
162
|
+
case 'darwin':
|
|
163
|
+
command = `open "${filePath}"`;
|
|
164
|
+
break;
|
|
165
|
+
case 'win32':
|
|
166
|
+
command = `start "" "${filePath}"`;
|
|
167
|
+
break;
|
|
168
|
+
default:
|
|
169
|
+
command = `xdg-open "${filePath}"`;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return new Promise((resolve, reject) => {
|
|
173
|
+
exec(command, (error) => {
|
|
174
|
+
if (error) {
|
|
175
|
+
reject(error);
|
|
176
|
+
} else {
|
|
177
|
+
resolve();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
module.exports = {
|
|
184
|
+
getReqPathOrExit,
|
|
185
|
+
ensureRequirementsFile,
|
|
186
|
+
loadRequirements,
|
|
187
|
+
saveRequirements,
|
|
188
|
+
findRequirementByTitle,
|
|
189
|
+
findRequirementById,
|
|
190
|
+
generateRequirementId,
|
|
191
|
+
validateRequirement,
|
|
192
|
+
formatRequirement,
|
|
193
|
+
openInEditor
|
|
194
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refactored Requirements Commands
|
|
3
|
+
*
|
|
4
|
+
* Splits monolithic requirements command into modular components
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Import command modules
|
|
8
|
+
const {
|
|
9
|
+
list,
|
|
10
|
+
add,
|
|
11
|
+
current,
|
|
12
|
+
next,
|
|
13
|
+
edit,
|
|
14
|
+
watch,
|
|
15
|
+
rename,
|
|
16
|
+
working,
|
|
17
|
+
numberAll
|
|
18
|
+
} = require('./requirements/commands');
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
createDefault,
|
|
22
|
+
editDefault,
|
|
23
|
+
deleteDefault,
|
|
24
|
+
showDefault,
|
|
25
|
+
pauseDefault,
|
|
26
|
+
resumeDefault,
|
|
27
|
+
setMaxIterations
|
|
28
|
+
} = require('./requirements/default-handlers');
|
|
29
|
+
|
|
30
|
+
// Export all commands for compatibility
|
|
31
|
+
module.exports = {
|
|
32
|
+
// Basic requirement commands
|
|
33
|
+
list,
|
|
34
|
+
add,
|
|
35
|
+
current,
|
|
36
|
+
next,
|
|
37
|
+
edit,
|
|
38
|
+
watch,
|
|
39
|
+
rename,
|
|
40
|
+
working,
|
|
41
|
+
numberAll,
|
|
42
|
+
|
|
43
|
+
// Default requirement commands
|
|
44
|
+
'default:create': createDefault,
|
|
45
|
+
'default:edit': editDefault,
|
|
46
|
+
'default:delete': deleteDefault,
|
|
47
|
+
'default:show': showDefault,
|
|
48
|
+
'default:pause': pauseDefault,
|
|
49
|
+
'default:resume': resumeDefault,
|
|
50
|
+
'default:max-iterations': setMaxIterations,
|
|
51
|
+
|
|
52
|
+
// Aliases for backward compatibility
|
|
53
|
+
createDefault,
|
|
54
|
+
editDefault,
|
|
55
|
+
deleteDefault,
|
|
56
|
+
showDefault,
|
|
57
|
+
pauseDefault,
|
|
58
|
+
resumeDefault,
|
|
59
|
+
setMaxIterations
|
|
60
|
+
};
|