vibecodingmachine-cli 2026.3.14-1537 → 2026.6.17-1956
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 -7
- package/bin/commands/agent-commands.js +15 -15
- package/bin/commands/auto-commands.js +3 -3
- package/bin/commands/command-aliases.js +13 -4
- package/bin/config/cli-config.js +15 -5
- package/bin/update/update-checker.js +5 -5
- package/bin/vibecodingmachine.js +2 -2
- package/package.json +2 -2
- package/src/commands/agents/add.js +5 -5
- package/src/commands/agents/check.js +19 -19
- package/src/commands/agents/list.js +24 -24
- package/src/commands/agents/remove.js +4 -4
- package/src/commands/agents-check.js +1 -1
- package/src/commands/analyze-file-sizes.js +43 -43
- package/src/commands/auto-direct/auto-provider-manager.js +19 -19
- package/src/commands/auto-direct/auto-start-phases.js +493 -0
- package/src/commands/auto-direct/auto-status-display.js +35 -35
- package/src/commands/auto-direct/auto-utils.js +50 -50
- package/src/commands/auto-direct/cline-installer.js +56 -0
- package/src/commands/auto-direct/code-processor.js +27 -27
- package/src/commands/auto-direct/file-scanner.js +19 -19
- package/src/commands/auto-direct/ide-completion-waiter.js +485 -0
- package/src/commands/auto-direct/ide-fallback-runner.js +226 -0
- package/src/commands/auto-direct/ide-provider-runner.js +103 -0
- package/src/commands/auto-direct/iteration-handlers.js +189 -0
- package/src/commands/auto-direct/iteration-runner.js +485 -0
- package/src/commands/auto-direct/provider-config.js +38 -7
- package/src/commands/auto-direct/provider-manager.js +132 -6
- package/src/commands/auto-direct/requirement-manager.js +169 -104
- package/src/commands/auto-direct/requirement-mover.js +350 -0
- package/src/commands/auto-direct/spec-handlers.js +155 -0
- package/src/commands/auto-direct/spec-ide-runner.js +318 -0
- package/src/commands/auto-direct/spec-processing.js +203 -0
- package/src/commands/auto-direct/status-display.js +9 -9
- package/src/commands/auto-direct/utils.js +83 -1
- package/src/commands/auto-direct-refactored.js +1 -413
- package/src/commands/auto-direct.js +127 -4119
- package/src/commands/auto-execution.js +21 -21
- package/src/commands/auto-status-helpers.js +0 -2
- package/src/commands/auto.js +22 -22
- package/src/commands/check-compliance.js +65 -65
- package/src/commands/computers.js +39 -39
- package/src/commands/continuous-scan.js +19 -19
- package/src/commands/ide.js +4 -4
- package/src/commands/locale.js +7 -7
- package/src/commands/refactor-file.js +59 -59
- package/src/commands/requirements/commands.js +17 -17
- package/src/commands/requirements/default-handlers.js +30 -30
- package/src/commands/requirements/disable.js +3 -3
- package/src/commands/requirements/enable.js +3 -3
- package/src/commands/requirements/utils.js +6 -6
- package/src/commands/requirements-refactored.js +3 -3
- package/src/commands/requirements-remote.js +38 -38
- package/src/commands/requirements.js +3 -3
- package/src/commands/settings.js +111 -0
- package/src/commands/specs/count.js +60 -0
- package/src/commands/specs/disable.js +3 -3
- package/src/commands/specs/enable.js +3 -3
- package/src/commands/status.js +10 -10
- package/src/commands/sync.js +25 -25
- package/src/commands/timeout.js +35 -35
- package/src/trui/TruiInterface.js +2 -2
- package/src/trui/agents/AgentInterface.js +4 -4
- package/src/trui/agents/handlers/CommandHandler.js +4 -4
- package/src/trui/agents/handlers/ContextManager.js +1 -1
- package/src/trui/agents/handlers/DisplayHandler.js +11 -11
- package/src/trui/agents/handlers/HelpHandler.js +1 -1
- package/src/utils/agent-selector.js +6 -6
- package/src/utils/antigravity-installer.js +4 -4
- package/src/utils/asset-cleanup.js +1 -1
- package/src/utils/auth.js +9 -12
- package/src/utils/clarification-actions.js +4 -4
- package/src/utils/cline-js-handler.js +5 -5
- package/src/utils/compliance-check.js +6 -6
- package/src/utils/config.js +12 -12
- package/src/utils/display-formatters-complete.js +2 -2
- package/src/utils/display-formatters-extracted.js +2 -2
- package/src/utils/display-formatters.js +2 -2
- package/src/utils/feedback-handler.js +2 -2
- package/src/utils/first-run.js +7 -7
- package/src/utils/ide-detection.js +1 -1
- package/src/utils/ide-handlers.js +6 -6
- package/src/utils/interactive/clarification-actions.js +3 -3
- package/src/utils/interactive/core-ui.js +7 -7
- package/src/utils/interactive/file-backup.js +6 -6
- package/src/utils/interactive/file-import-export.js +49 -49
- package/src/utils/interactive/file-operations.js +3 -3
- package/src/utils/interactive/file-validation.js +41 -41
- package/src/utils/interactive/interactive-prompts.js +41 -41
- package/src/utils/interactive/requirement-actions.js +5 -5
- package/src/utils/interactive/requirement-crud.js +4 -4
- package/src/utils/interactive/requirements-navigation.js +10 -10
- package/src/utils/interactive-broken.js +6 -6
- package/src/utils/interactive.js +37 -37
- package/src/utils/keyboard-handler.js +4 -4
- package/src/utils/prompt-helper.js +6 -6
- package/src/utils/provider-checker/agent-checker.js +1 -1
- package/src/utils/provider-checker/agent-runner.js +203 -314
- package/src/utils/provider-checker/agents-file-lock.js +134 -0
- package/src/utils/provider-checker/agents-manager.js +224 -36
- package/src/utils/provider-checker/cli-installer.js +28 -28
- package/src/utils/provider-checker/cli-utils.js +2 -2
- package/src/utils/provider-checker/cursor-approval-clicker.js +108 -0
- package/src/utils/provider-checker/format-utils.js +4 -4
- package/src/utils/provider-checker/ide-installer-helper.js +96 -0
- package/src/utils/provider-checker/ide-manager.js +19 -8
- package/src/utils/provider-checker/ide-quota-checker.js +120 -0
- package/src/utils/provider-checker/ide-utils.js +2 -2
- package/src/utils/provider-checker/node-detector.js +4 -4
- package/src/utils/provider-checker/node-utils.js +5 -5
- package/src/utils/provider-checker/opencode-checker.js +107 -73
- package/src/utils/provider-checker/process-utils.js +1 -1
- package/src/utils/provider-checker/provider-validator.js +11 -11
- package/src/utils/provider-checker/quota-checker.js +5 -5
- package/src/utils/provider-checker/quota-detector.js +5 -5
- package/src/utils/provider-checker/requirements-manager.js +6 -6
- package/src/utils/provider-checker/test-requirements.js +1 -1
- package/src/utils/provider-checker/vscode-approval-clicker.js +328 -0
- package/src/utils/provider-checker-new.js +6 -6
- package/src/utils/provider-checker.js +6 -6
- package/src/utils/provider-checkers/ide-manager.js +13 -13
- package/src/utils/provider-checkers/node-executable-finder.js +4 -4
- package/src/utils/provider-checkers/provider-checker-core.js +5 -5
- package/src/utils/provider-checkers/provider-checker-main.js +17 -17
- package/src/utils/provider-registry.js +5 -6
- package/src/utils/provider-utils.js +12 -12
- package/src/utils/quota-detectors.js +32 -32
- package/src/utils/requirement-action-handlers.js +12 -12
- package/src/utils/requirement-actions/requirement-operations.js +3 -3
- package/src/utils/requirement-actions.js +1 -1
- package/src/utils/requirement-file-operations.js +5 -5
- package/src/utils/requirement-helpers.js +1 -1
- package/src/utils/requirement-management.js +5 -5
- package/src/utils/requirement-navigation.js +2 -2
- package/src/utils/requirement-organization.js +3 -3
- package/src/utils/rui-trui-adapter.js +14 -14
- package/src/utils/simple-trui.js +3 -3
- package/src/utils/status-helpers-extracted.js +3 -3
- package/src/utils/trui-clarifications.js +11 -11
- package/src/utils/trui-debug.js +3 -2
- package/src/utils/trui-devin.js +217 -0
- package/src/utils/trui-feedback.js +7 -7
- package/src/utils/trui-kiro-integration.js +34 -34
- package/src/utils/trui-main-handlers.js +20 -21
- package/src/utils/trui-main-menu.js +19 -19
- package/src/utils/trui-nav-agents.js +59 -8
- package/src/utils/trui-nav-requirements.js +3 -3
- package/src/utils/trui-nav-settings.js +10 -10
- package/src/utils/trui-nav-specifications.js +1 -1
- package/src/utils/trui-navigation-backup.js +11 -11
- package/src/utils/trui-navigation.js +9 -9
- package/src/utils/trui-provider-health.js +25 -25
- package/src/utils/trui-provider-manager.js +28 -28
- package/src/utils/trui-quick-menu.js +2 -2
- package/src/utils/trui-req-actions-backup.js +21 -21
- package/src/utils/trui-req-actions.js +20 -20
- package/src/utils/trui-req-editor.js +10 -10
- package/src/utils/trui-req-file-ops.js +3 -3
- package/src/utils/trui-req-tree.js +7 -7
- package/src/utils/trui-windsurf.js +103 -103
- package/src/utils/user-tracking.js +15 -15
- package/src/utils/trui-req-tree-old.js +0 -719
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quota Detectors Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Handles quota limit detection for various AI providers.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -18,31 +18,31 @@ function checkQuotaInOutput(providerId, output, errorMessage) {
|
|
|
18
18
|
} catch (_) {}
|
|
19
19
|
console.log(`[AGENT CHECK] ${msg}`);
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
debugLog(`Checking for ${providerId} quota limit...`);
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
// Check process output first for quota error keywords
|
|
25
25
|
const lowerOutput = output.toLowerCase();
|
|
26
26
|
const lowerErrorMsg = errorMessage.toLowerCase();
|
|
27
27
|
debugLog('Checking process output length: ' + output.length);
|
|
28
28
|
debugLog('Process output sample: ' + output.substring(0, 300));
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
// Check both output and error message for quota keywords
|
|
31
31
|
const quotaKeywords = [
|
|
32
|
-
'quota',
|
|
33
|
-
'rate limit',
|
|
34
|
-
'resource_exhausted',
|
|
35
|
-
'usage limit',
|
|
36
|
-
'model quota',
|
|
37
|
-
'limit exceeded',
|
|
38
|
-
'spending cap',
|
|
39
|
-
'usage cap',
|
|
40
|
-
'you\'ve reached your monthly chat messages quota',
|
|
41
|
-
'upgrade to copilot pro',
|
|
32
|
+
'quota',
|
|
33
|
+
'rate limit',
|
|
34
|
+
'resource_exhausted',
|
|
35
|
+
'usage limit',
|
|
36
|
+
'model quota',
|
|
37
|
+
'limit exceeded',
|
|
38
|
+
'spending cap',
|
|
39
|
+
'usage cap',
|
|
40
|
+
'you\'ve reached your monthly chat messages quota',
|
|
41
|
+
'upgrade to copilot pro',
|
|
42
42
|
'wait for your allowance to renew'
|
|
43
43
|
];
|
|
44
44
|
const hasQuotaKeyword = quotaKeywords.some(kw => lowerOutput.includes(kw) || lowerErrorMsg.includes(kw));
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
if (hasQuotaKeyword) {
|
|
47
47
|
debugLog(`🚨 Quota keywords found in process output or message for ${providerId}`);
|
|
48
48
|
return {
|
|
@@ -51,7 +51,7 @@ function checkQuotaInOutput(providerId, output, errorMessage) {
|
|
|
51
51
|
providerSpecific: setProviderSpecificFlags(providerId, {})
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
debugLog(`No quota keywords in process output or message for ${providerId}`);
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
@@ -64,8 +64,8 @@ function setProviderSpecificFlags(providerId, result) {
|
|
|
64
64
|
case 'antigravity':
|
|
65
65
|
result.antigravityRateLimited = true;
|
|
66
66
|
break;
|
|
67
|
-
case '
|
|
68
|
-
result.
|
|
67
|
+
case 'devin':
|
|
68
|
+
result.devinRateLimited = true;
|
|
69
69
|
break;
|
|
70
70
|
case 'cursor':
|
|
71
71
|
result.cursorRateLimited = true;
|
|
@@ -98,14 +98,14 @@ async function checkQuotaWithAppleScript(providerId) {
|
|
|
98
98
|
const { AppleScriptManager } = require('vibecodingmachine-core');
|
|
99
99
|
const appleScriptManager = new AppleScriptManager();
|
|
100
100
|
let quotaCheck = null;
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
// Use specific quota detection methods for each IDE
|
|
103
103
|
switch (providerId) {
|
|
104
104
|
case 'antigravity':
|
|
105
105
|
quotaCheck = await appleScriptManager.checkAntigravityQuotaLimit();
|
|
106
106
|
break;
|
|
107
|
-
case '
|
|
108
|
-
quotaCheck = await appleScriptManager.
|
|
107
|
+
case 'devin':
|
|
108
|
+
quotaCheck = await appleScriptManager.checkDevinRateLimit?.();
|
|
109
109
|
break;
|
|
110
110
|
case 'cursor':
|
|
111
111
|
quotaCheck = await appleScriptManager.checkCursorQuotaLimit();
|
|
@@ -118,9 +118,9 @@ async function checkQuotaWithAppleScript(providerId) {
|
|
|
118
118
|
debugLog(`No specific quota detection method available for ${providerId}`);
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
debugLog(`${providerId} quota check result: ` + JSON.stringify(quotaCheck));
|
|
123
|
-
|
|
123
|
+
|
|
124
124
|
if (quotaCheck && (quotaCheck.isRateLimited || quotaCheck.hasQuotaWarning)) {
|
|
125
125
|
debugLog(`🚨 ${providerId} quota limit detected via AppleScript`);
|
|
126
126
|
const result = {
|
|
@@ -128,18 +128,18 @@ async function checkQuotaWithAppleScript(providerId) {
|
|
|
128
128
|
rateLimitMessage: quotaCheck.message || quotaCheck.matchedText || `${providerId} quota limit detected`,
|
|
129
129
|
providerSpecific: {}
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
if (quotaCheck.resumeAt) {
|
|
133
133
|
result.rateLimitResume = quotaCheck.resumeAt;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
|
|
136
136
|
setProviderSpecificFlags(providerId, result.providerSpecific);
|
|
137
137
|
return result;
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
debugLog(`No quota limit detected via AppleScript for ${providerId}`);
|
|
141
141
|
return null;
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
} catch (error) {
|
|
144
144
|
debugLog(`AppleScript quota check failed for ${providerId}: ${error.message}`);
|
|
145
145
|
return null;
|
|
@@ -155,13 +155,13 @@ async function detectQuotaLimit(providerId, output, errorMessage) {
|
|
|
155
155
|
if (outputCheck) {
|
|
156
156
|
return outputCheck;
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
// Then try AppleScript UI scraping as fallback (macOS only)
|
|
160
160
|
const appleScriptCheck = await checkQuotaWithAppleScript(providerId);
|
|
161
161
|
if (appleScriptCheck) {
|
|
162
162
|
return appleScriptCheck;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
// No quota limit detected
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
@@ -173,7 +173,7 @@ function isRateLimited(errorResult) {
|
|
|
173
173
|
return !!(errorResult && (
|
|
174
174
|
errorResult.rateLimited ||
|
|
175
175
|
errorResult.antigravityRateLimited ||
|
|
176
|
-
errorResult.
|
|
176
|
+
errorResult.devinRateLimited ||
|
|
177
177
|
errorResult.cursorRateLimited ||
|
|
178
178
|
errorResult.githubCopilotRateLimited
|
|
179
179
|
));
|
|
@@ -184,7 +184,7 @@ function isRateLimited(errorResult) {
|
|
|
184
184
|
*/
|
|
185
185
|
function getRateLimitMessage(errorResult) {
|
|
186
186
|
if (!errorResult) return null;
|
|
187
|
-
|
|
187
|
+
|
|
188
188
|
return errorResult.rateLimitMessage ||
|
|
189
189
|
errorResult.message ||
|
|
190
190
|
'Rate limit detected';
|
|
@@ -195,7 +195,7 @@ function getRateLimitMessage(errorResult) {
|
|
|
195
195
|
*/
|
|
196
196
|
function getRateLimitResume(errorResult) {
|
|
197
197
|
if (!errorResult) return null;
|
|
198
|
-
|
|
198
|
+
|
|
199
199
|
return errorResult.rateLimitResume ||
|
|
200
200
|
errorResult.resumeAt ||
|
|
201
201
|
null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Requirement Action Handlers Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Contains main action handlers for requirements.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -8,17 +8,17 @@ const chalk = require('chalk');
|
|
|
8
8
|
const inquirer = require('inquirer');
|
|
9
9
|
const fs = require('fs-extra');
|
|
10
10
|
const { t, getRequirementsPath } = require('vibecodingmachine-core');
|
|
11
|
-
const {
|
|
12
|
-
getRequirementList,
|
|
13
|
-
getSectionTitle,
|
|
14
|
-
confirmAction,
|
|
11
|
+
const {
|
|
12
|
+
getRequirementList,
|
|
13
|
+
getSectionTitle,
|
|
14
|
+
confirmAction,
|
|
15
15
|
confirmAndExit,
|
|
16
16
|
validateRequirementTitle
|
|
17
17
|
} = require('./requirement-helpers');
|
|
18
|
-
const {
|
|
19
|
-
editClarificationResponses,
|
|
20
|
-
moveClarificationToTodo,
|
|
21
|
-
deleteClarification
|
|
18
|
+
const {
|
|
19
|
+
editClarificationResponses,
|
|
20
|
+
moveClarificationToTodo,
|
|
21
|
+
deleteClarification
|
|
22
22
|
} = require('./requirement-file-operations');
|
|
23
23
|
const {
|
|
24
24
|
moveRequirementDown,
|
|
@@ -162,7 +162,7 @@ async function renameRequirement(req, sectionKey, tree, loadSection) {
|
|
|
162
162
|
|
|
163
163
|
await fs.writeFile(reqPath, lines.join('\n'));
|
|
164
164
|
console.log(chalk.green('\n✓ Requirement renamed!'));
|
|
165
|
-
|
|
165
|
+
|
|
166
166
|
if (loadSection) await loadSection();
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -186,7 +186,7 @@ async function deleteRequirement(req, sectionKey, tree, loadSection) {
|
|
|
186
186
|
await moveRequirementToRecycled(reqPath, req.title, sectionTitle);
|
|
187
187
|
|
|
188
188
|
console.log(chalk.green('\n✓ Requirement moved to recycled!'));
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
if (loadSection) await loadSection();
|
|
191
191
|
}
|
|
192
192
|
|
|
@@ -234,7 +234,7 @@ async function permanentlyDeleteRequirement(req, sectionKey, tree, loadSection)
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
console.log(chalk.green('\n✓ Requirement permanently deleted!'));
|
|
237
|
-
|
|
237
|
+
|
|
238
238
|
if (loadSection) await loadSection();
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -302,7 +302,7 @@ async function saveRequirementsOrder(reqPath, sectionTitle, requirements) {
|
|
|
302
302
|
|
|
303
303
|
// Rebuild the section with reordered requirements
|
|
304
304
|
const newSection = [lines[sectionStart]]; // Keep the section header
|
|
305
|
-
|
|
305
|
+
|
|
306
306
|
// Add reordered requirements
|
|
307
307
|
requirements.forEach(req => {
|
|
308
308
|
newSection.push(`- ${req.title}`);
|
|
@@ -314,9 +314,9 @@ async function saveRequirementsOrder(reqPath, sectionTitle, requirements) {
|
|
|
314
314
|
// Replace the section in the file
|
|
315
315
|
const beforeSection = lines.slice(0, sectionStart);
|
|
316
316
|
const afterSection = lines.slice(sectionEnd + 1);
|
|
317
|
-
|
|
317
|
+
|
|
318
318
|
const newContent = [...beforeSection, ...newSection, ...afterSection];
|
|
319
|
-
|
|
319
|
+
|
|
320
320
|
await fs.writeFile(reqPath, newContent.join('\n'));
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Requirement File Operations Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Contains file reading/writing operations for requirement management.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ async function editClarificationResponses(req, tree) {
|
|
|
40
40
|
// Extract current responses
|
|
41
41
|
const reqLines = lines.slice(startIdx, endIdx);
|
|
42
42
|
const currentResponses = [];
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
for (const line of reqLines) {
|
|
45
45
|
if (line.startsWith('- **Response:**')) {
|
|
46
46
|
currentResponses.push(line.replace('- **Response:**', '').trim());
|
|
@@ -55,7 +55,7 @@ async function editClarificationResponses(req, tree) {
|
|
|
55
55
|
// Add new responses
|
|
56
56
|
const inquirer = require('inquirer');
|
|
57
57
|
const { confirmAction } = require('./requirement-helpers');
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
let addMore = true;
|
|
60
60
|
while (addMore) {
|
|
61
61
|
const { newResponse } = await inquirer.prompt([
|
|
@@ -77,7 +77,7 @@ async function editClarificationResponses(req, tree) {
|
|
|
77
77
|
// Update the requirement with new responses
|
|
78
78
|
const newReqLines = [];
|
|
79
79
|
let inResponses = false;
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
for (const line of reqLines) {
|
|
82
82
|
if (line.startsWith('- **Response:**')) {
|
|
83
83
|
if (!inResponses) {
|
|
@@ -152,7 +152,7 @@ async function moveClarificationToTodo(req, tree) {
|
|
|
152
152
|
while (insertIdx < lines.length && lines[insertIdx].trim() === '') {
|
|
153
153
|
insertIdx++;
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
lines.splice(insertIdx, 0, ...reqContent);
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Requirement Management Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Handles basic requirement management actions like rename, delete, promote, demote.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ async function showRequirementActions(req, sectionKey, tree) {
|
|
|
40
40
|
|
|
41
41
|
console.log(chalk.bold.cyan(`\n📋 ${sectionTitle}\n`));
|
|
42
42
|
console.log(chalk.bold(`${reqIndex + 1}. ${req.title}`));
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
if (req.details && req.details.length > 0) {
|
|
45
45
|
console.log(chalk.gray('Description:'));
|
|
46
46
|
req.details.forEach(detail => {
|
|
@@ -236,7 +236,7 @@ async function deleteRequirement(req, sectionKey, tree) {
|
|
|
236
236
|
while (endIdx < lines.length && !lines[endIdx].startsWith('###') && !lines[endIdx].startsWith('##')) {
|
|
237
237
|
endIdx++;
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
lines.splice(i, endIdx - i);
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
@@ -252,7 +252,7 @@ async function deleteRequirement(req, sectionKey, tree) {
|
|
|
252
252
|
*/
|
|
253
253
|
async function promoteRequirement(req, sectionKey, tree) {
|
|
254
254
|
console.log(chalk.cyan(`\n👍 Promoting: ${req.title}`));
|
|
255
|
-
|
|
255
|
+
|
|
256
256
|
// Implementation would depend on specific promotion logic
|
|
257
257
|
// This is a placeholder for the actual promotion functionality
|
|
258
258
|
console.log(chalk.yellow('Promotion functionality not yet implemented'));
|
|
@@ -263,7 +263,7 @@ async function promoteRequirement(req, sectionKey, tree) {
|
|
|
263
263
|
*/
|
|
264
264
|
async function demoteRequirement(title, sectionKey, tree) {
|
|
265
265
|
console.log(chalk.cyan(`\n👎 Demoting: ${title}`));
|
|
266
|
-
|
|
266
|
+
|
|
267
267
|
// Implementation would depend on specific demotion logic
|
|
268
268
|
// This is a placeholder for the actual demotion functionality
|
|
269
269
|
console.log(chalk.yellow('Demotion functionality not yet implemented'));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Requirement Navigation Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Contains movement and ordering functions for requirements.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -130,7 +130,7 @@ async function moveRequirementToRecycled(reqPath, requirementTitle, fromSection)
|
|
|
130
130
|
while (insertIdx < lines.length && lines[insertIdx].trim() === '') {
|
|
131
131
|
insertIdx++;
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
|
|
134
134
|
lines.splice(insertIdx, 0, ...reqContent);
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Requirement Organization Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Handles requirement reordering, promotion, demotion, and organizational actions.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -198,7 +198,7 @@ async function moveRequirementToRecycled(reqPath, requirementTitle, fromSection)
|
|
|
198
198
|
if (startIdx !== -1) {
|
|
199
199
|
// Extract the requirement content
|
|
200
200
|
const reqContent = lines.slice(startIdx, endIdx);
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
// Remove from original section
|
|
203
203
|
lines.splice(startIdx, endIdx - startIdx);
|
|
204
204
|
|
|
@@ -249,7 +249,7 @@ async function permanentlyDeleteRequirement(req, tree) {
|
|
|
249
249
|
while (endIdx < lines.length && !lines[endIdx].startsWith('###') && !lines[endIdx].startsWith('##')) {
|
|
250
250
|
endIdx++;
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
|
|
253
253
|
lines.splice(i, endIdx - i);
|
|
254
254
|
break;
|
|
255
255
|
}
|
|
@@ -63,7 +63,7 @@ class RUITRUIAdapter {
|
|
|
63
63
|
for (const resource of resources) {
|
|
64
64
|
const command = `${verb} ${resource}`;
|
|
65
65
|
const resolution = this.resolver.resolve(command);
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
if (resolution.success) {
|
|
68
68
|
verbItem.children.push({
|
|
69
69
|
type: 'action',
|
|
@@ -101,16 +101,16 @@ class RUITRUIAdapter {
|
|
|
101
101
|
} catch (_) {}
|
|
102
102
|
|
|
103
103
|
if (autoStatus.running) {
|
|
104
|
-
items.push({
|
|
105
|
-
type: 'setting',
|
|
106
|
-
name: `Auto Mode: Running ✓`,
|
|
107
|
-
value: 'setting:auto'
|
|
104
|
+
items.push({
|
|
105
|
+
type: 'setting',
|
|
106
|
+
name: `Auto Mode: Running ✓`,
|
|
107
|
+
value: 'setting:auto'
|
|
108
108
|
});
|
|
109
109
|
} else {
|
|
110
|
-
items.push({
|
|
111
|
-
type: 'setting',
|
|
112
|
-
name: `Auto Mode: Stopped ○`,
|
|
113
|
-
value: 'setting:auto'
|
|
110
|
+
items.push({
|
|
111
|
+
type: 'setting',
|
|
112
|
+
name: `Auto Mode: Stopped ○`,
|
|
113
|
+
value: 'setting:auto'
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -121,11 +121,11 @@ class RUITRUIAdapter {
|
|
|
121
121
|
if (counts) {
|
|
122
122
|
const total = (counts.todoCount || 0) + (counts.toVerifyCount || 0) + (counts.verifiedCount || 0);
|
|
123
123
|
const pct = n => total > 0 ? Math.round((n / total) * 100) : 0;
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
const reqLine = `Requirements: ${counts.todoCount} (${pct(counts.todoCount)}% todo), ` +
|
|
126
126
|
`${counts.toVerifyCount} (${pct(counts.toVerifyCount)}% verify), ` +
|
|
127
127
|
`${counts.verifiedCount} (${pct(counts.verifiedCount)}% done)`;
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
items.push({ type: 'setting', name: reqLine, value: 'setting:requirements' });
|
|
130
130
|
}
|
|
131
131
|
} catch (_) {}
|
|
@@ -189,7 +189,7 @@ class RUITRUIAdapter {
|
|
|
189
189
|
|
|
190
190
|
// Handle RUI commands
|
|
191
191
|
const resolution = this.resolver.resolve(action);
|
|
192
|
-
|
|
192
|
+
|
|
193
193
|
if (!resolution.success) {
|
|
194
194
|
return {
|
|
195
195
|
success: false,
|
|
@@ -283,7 +283,7 @@ class RUITRUIAdapter {
|
|
|
283
283
|
// getByVerb returns full command objects; extract resource names
|
|
284
284
|
const commands = this.registry.getByVerb ? this.registry.getByVerb(verb) : [];
|
|
285
285
|
const resources = commands.map(c => c.resource);
|
|
286
|
-
|
|
286
|
+
|
|
287
287
|
return {
|
|
288
288
|
success: true,
|
|
289
289
|
data: {
|
|
@@ -300,7 +300,7 @@ class RUITRUIAdapter {
|
|
|
300
300
|
* @returns {string} Equivalent command
|
|
301
301
|
*/
|
|
302
302
|
getEquivalentCommand(action) {
|
|
303
|
-
if (action.startsWith('setting:') || action.startsWith('category:') ||
|
|
303
|
+
if (action.startsWith('setting:') || action.startsWith('category:') ||
|
|
304
304
|
action === 'help' || action === 'exit') {
|
|
305
305
|
return action;
|
|
306
306
|
}
|
package/src/utils/simple-trui.js
CHANGED
|
@@ -173,7 +173,7 @@ class SimpleTRUI {
|
|
|
173
173
|
|
|
174
174
|
async showRequirementsMenu() {
|
|
175
175
|
console.log(chalk.blue('\n📋 Requirements Management\n'));
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
const { action } = await inquirer.prompt([
|
|
178
178
|
{
|
|
179
179
|
type: 'list',
|
|
@@ -193,7 +193,7 @@ class SimpleTRUI {
|
|
|
193
193
|
|
|
194
194
|
async showSettingsMenu() {
|
|
195
195
|
console.log(chalk.blue('\n⚙️ Settings Management\n'));
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
const { action } = await inquirer.prompt([
|
|
198
198
|
{
|
|
199
199
|
type: 'list',
|
|
@@ -235,7 +235,7 @@ class SimpleTRUI {
|
|
|
235
235
|
|
|
236
236
|
console.log(chalk.green('\n📋 Requirements:\n'));
|
|
237
237
|
requirements.forEach(req => {
|
|
238
|
-
const status = req.status === 'completed' ? chalk.green('✓') :
|
|
238
|
+
const status = req.status === 'completed' ? chalk.green('✓') :
|
|
239
239
|
req.status === 'in-progress' ? chalk.yellow('⟳') : chalk.gray('○');
|
|
240
240
|
console.log(` ${status} ${req.id}: ${req.title}`);
|
|
241
241
|
});
|
|
@@ -97,14 +97,14 @@ async function getAgentConnectivityStatus() {
|
|
|
97
97
|
try {
|
|
98
98
|
const { checkAllProviders } = require('./provider-checker');
|
|
99
99
|
const result = await checkAllProviders();
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
if (!result || !result.results) {
|
|
102
102
|
return '[Agents unavailable]';
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
const total = Object.keys(result.results).length;
|
|
106
106
|
const reachable = Object.values(result.results).filter(r => r.status === 'success').length;
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
if (reachable === total) {
|
|
109
109
|
return `[Agents: ✓ ${reachable}/${total}]`;
|
|
110
110
|
} else if (reachable > 0) {
|
|
@@ -24,7 +24,7 @@ async function editClarificationResponse(requirement, saveCallback) {
|
|
|
24
24
|
try {
|
|
25
25
|
// Extract current clarification response
|
|
26
26
|
const currentResponse = extractClarificationResponse(requirement);
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
if (!currentResponse) {
|
|
29
29
|
console.log(chalk.yellow('No clarification response found for this requirement.'));
|
|
30
30
|
await inquirer.prompt([{ type: 'input', name: 'c', message: chalk.gray('Press Enter to continue...') }]);
|
|
@@ -86,7 +86,7 @@ async function editClarificationResponse(requirement, saveCallback) {
|
|
|
86
86
|
// Update the requirement with the new response
|
|
87
87
|
const updatedRequirement = updateClarificationResponse(requirement, editedResponse);
|
|
88
88
|
await saveCallback(updatedRequirement);
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
console.log(chalk.green('\n✓ Clarification response updated successfully.'));
|
|
91
91
|
debugLogger.info('Clarification response updated', { requirementId: requirement.id });
|
|
92
92
|
} else {
|
|
@@ -105,19 +105,19 @@ async function editClarificationResponse(requirement, saveCallback) {
|
|
|
105
105
|
*/
|
|
106
106
|
function extractClarificationResponse(requirement) {
|
|
107
107
|
const content = requirement.content || requirement.description || '';
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
// Look for clarification response section
|
|
110
110
|
const clarificationMatch = content.match(/##\s*Clarification\s*Response\s*\n([\s\S]*?)(?=\n##|\n---|$)/i);
|
|
111
111
|
if (clarificationMatch) {
|
|
112
112
|
return clarificationMatch[1].trim();
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
// Look for response section
|
|
116
116
|
const responseMatch = content.match(/###\s*Response\s*\n([\s\S]*?)(?=\n###|\n##|\n---|$)/i);
|
|
117
117
|
if (responseMatch) {
|
|
118
118
|
return responseMatch[1].trim();
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
return null;
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -126,7 +126,7 @@ function extractClarificationResponse(requirement) {
|
|
|
126
126
|
*/
|
|
127
127
|
function updateClarificationResponse(requirement, newResponse) {
|
|
128
128
|
const content = requirement.content || requirement.description || '';
|
|
129
|
-
|
|
129
|
+
|
|
130
130
|
// Update existing clarification response section
|
|
131
131
|
if (content.match(/##\s*Clarification\s*Response\s*\n/i)) {
|
|
132
132
|
const updatedContent = content.replace(
|
|
@@ -135,7 +135,7 @@ function updateClarificationResponse(requirement, newResponse) {
|
|
|
135
135
|
);
|
|
136
136
|
return { ...requirement, content: updatedContent };
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
// Update existing response section
|
|
140
140
|
if (content.match(/###\s*Response\s*\n/i)) {
|
|
141
141
|
const updatedContent = content.replace(
|
|
@@ -144,7 +144,7 @@ function updateClarificationResponse(requirement, newResponse) {
|
|
|
144
144
|
);
|
|
145
145
|
return { ...requirement, content: updatedContent };
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
// Add new clarification response section at the end
|
|
149
149
|
const updatedContent = content + `\n\n## Clarification Response\n${newResponse}`;
|
|
150
150
|
return { ...requirement, content: updatedContent };
|
|
@@ -157,7 +157,7 @@ async function showFormattedPreview(response) {
|
|
|
157
157
|
console.clear();
|
|
158
158
|
console.log(chalk.bold.cyan('\n📋 Formatted Preview\n'));
|
|
159
159
|
console.log(chalk.gray('This is how the response will appear when rendered:\n'));
|
|
160
|
-
|
|
160
|
+
|
|
161
161
|
// Simple markdown-like formatting for preview
|
|
162
162
|
const formatted = response
|
|
163
163
|
.replace(/\*\*(.*?)\*\*/g, chalk.bold('$1'))
|
|
@@ -166,9 +166,9 @@ async function showFormattedPreview(response) {
|
|
|
166
166
|
.replace(/^### (.*?)$/gm, chalk.bold.underline('$1'))
|
|
167
167
|
.replace(/^## (.*?)$/gm, chalk.bold.cyan.underline('$1'))
|
|
168
168
|
.replace(/^# (.*?)$/gm, chalk.bold.white.underline('$1'));
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
console.log(formatted);
|
|
171
|
-
|
|
171
|
+
|
|
172
172
|
await inquirer.prompt([{ type: 'input', name: 'c', message: chalk.gray('Press Enter to continue...') }]);
|
|
173
173
|
}
|
|
174
174
|
|
package/src/utils/trui-debug.js
CHANGED
|
@@ -33,6 +33,7 @@ class DebugLogger {
|
|
|
33
33
|
|
|
34
34
|
// File output (no colors)
|
|
35
35
|
try {
|
|
36
|
+
// eslint-disable-next-line no-control-regex
|
|
36
37
|
fs.appendFileSync(this.logFile, logEntry.replace(/\x1b\[[0-9;]*m/g, ''));
|
|
37
38
|
} catch (e) {
|
|
38
39
|
// Ignore file write errors
|
|
@@ -237,13 +238,13 @@ const stateTracker = new MenuStateTracker();
|
|
|
237
238
|
const errorHandler = new ErrorHandler();
|
|
238
239
|
|
|
239
240
|
// Register default recovery strategies
|
|
240
|
-
errorHandler.registerStrategy('TypeError', (
|
|
241
|
+
errorHandler.registerStrategy('TypeError', (_error, _context) => {
|
|
241
242
|
debugLogger.warn('TypeError recovery: checking for undefined/null values');
|
|
242
243
|
// Add recovery logic here
|
|
243
244
|
return null;
|
|
244
245
|
});
|
|
245
246
|
|
|
246
|
-
errorHandler.registerStrategy('RangeError', (
|
|
247
|
+
errorHandler.registerStrategy('RangeError', (_error, _context) => {
|
|
247
248
|
debugLogger.warn('RangeError recovery: checking array bounds');
|
|
248
249
|
// Add recovery logic here
|
|
249
250
|
return null;
|