vigthoria-cli 1.11.17 → 1.11.19
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.
|
@@ -13,6 +13,7 @@ export declare function isTrivialHtmlPageRequest(prompt: string): boolean;
|
|
|
13
13
|
export declare function hasCloneBuildIntent(prompt: string): boolean;
|
|
14
14
|
export declare function hasExplicitWriteIntent(prompt: string): boolean;
|
|
15
15
|
export declare function taskRequiresWorkspaceChanges(prompt: string): boolean;
|
|
16
|
+
export declare function hasAnalyzeAndBuildIntent(prompt: string): boolean;
|
|
16
17
|
export declare function inferAgentTaskType(prompt: string): string;
|
|
17
18
|
export declare function shouldSkipAnalysisRescue(liveOutcome: {
|
|
18
19
|
tasksTotal?: number;
|
|
@@ -88,8 +88,23 @@ export function taskRequiresWorkspaceChanges(prompt) {
|
|
|
88
88
|
}
|
|
89
89
|
return explicitWriteIntent;
|
|
90
90
|
}
|
|
91
|
+
export function hasAnalyzeAndBuildIntent(prompt) {
|
|
92
|
+
const text = stripExecutionShaping(prompt);
|
|
93
|
+
return /\b(analy[sz]e|analyse)\b/i.test(text)
|
|
94
|
+
&& /\b(complete|finish|fix|implement|build|repair|missing\s+elements?)\b/i.test(text)
|
|
95
|
+
&& hasExplicitWriteIntent(prompt);
|
|
96
|
+
}
|
|
91
97
|
export function inferAgentTaskType(prompt) {
|
|
92
98
|
const text = stripExecutionShaping(prompt);
|
|
99
|
+
if (hasAnalyzeAndBuildIntent(prompt)) {
|
|
100
|
+
if (hasGameIntent(prompt)) {
|
|
101
|
+
return 'game-build';
|
|
102
|
+
}
|
|
103
|
+
if (hasWebPageIntent(prompt)) {
|
|
104
|
+
return 'web-build';
|
|
105
|
+
}
|
|
106
|
+
return 'implementation';
|
|
107
|
+
}
|
|
93
108
|
if (/\b(inspect|analyze|analyse|audit|review|find|diagnose|debug|trace|compare|diff|check|investigate)\b/i.test(text)
|
|
94
109
|
&& !hasExplicitWriteIntent(prompt)) {
|
|
95
110
|
return 'debugging';
|
|
@@ -142,13 +157,16 @@ export function resolvePlannerAgentTimeoutMs(baseTimeoutMs, agentTaskType, promp
|
|
|
142
157
|
}
|
|
143
158
|
/** V3 workflow mode: suppress write path when the user did not ask for file changes. */
|
|
144
159
|
export function resolveWorkflowType(agentTaskType, prompt) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return 'analysis_only';
|
|
160
|
+
if (hasAnalyzeAndBuildIntent(prompt)) {
|
|
161
|
+
return 'full';
|
|
148
162
|
}
|
|
149
163
|
if (!taskRequiresWorkspaceChanges(prompt)) {
|
|
150
164
|
return 'analysis_only';
|
|
151
165
|
}
|
|
166
|
+
const kind = String(agentTaskType || '').toLowerCase();
|
|
167
|
+
if (kind === 'analysis' || kind === 'debugging' || kind === 'verification') {
|
|
168
|
+
return 'analysis_only';
|
|
169
|
+
}
|
|
152
170
|
return 'full';
|
|
153
171
|
}
|
|
154
172
|
export function buildExecutionHints(agentTaskType, prompt, options = {}) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
+
import { stripExecutionShaping } from './requestIntent.js';
|
|
6
7
|
function ensurePopupScript(html, vision) {
|
|
7
8
|
const text = String(vision || '').toLowerCase();
|
|
8
9
|
if (!/\b(popup|alert|hello\s*world)\b/.test(text)) {
|
|
@@ -89,25 +90,27 @@ function extractPopupMessage(vision) {
|
|
|
89
90
|
export async function runTemplateInstantPath(api, vision, workspacePath, options = {}) {
|
|
90
91
|
const entryPath = options.entryPath || 'index.html';
|
|
91
92
|
const target = path.join(workspacePath, entryPath);
|
|
93
|
+
const cleanVision = stripExecutionShaping(vision);
|
|
94
|
+
const preferMinimal = options.forceMinimalFallback === true;
|
|
92
95
|
let html;
|
|
93
96
|
let usedFallback = false;
|
|
94
97
|
let match = {};
|
|
95
|
-
if (
|
|
96
|
-
html = minimalHelloWorldHtml(extractPopupMessage(
|
|
98
|
+
if (preferMinimal) {
|
|
99
|
+
html = minimalHelloWorldHtml(extractPopupMessage(cleanVision));
|
|
97
100
|
usedFallback = true;
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
100
|
-
match = await fetchTemplateMatch(api,
|
|
103
|
+
match = await fetchTemplateMatch(api, cleanVision);
|
|
101
104
|
html = match.html;
|
|
102
105
|
if (!html && options.allowFallback !== false) {
|
|
103
|
-
html = minimalHelloWorldHtml(extractPopupMessage(
|
|
106
|
+
html = minimalHelloWorldHtml(extractPopupMessage(cleanVision));
|
|
104
107
|
usedFallback = true;
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
if (!html) {
|
|
108
111
|
return { ok: false, error: match.error || 'Template match failed' };
|
|
109
112
|
}
|
|
110
|
-
html = ensurePopupScript(html,
|
|
113
|
+
html = ensurePopupScript(html, cleanVision);
|
|
111
114
|
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
112
115
|
fs.writeFileSync(target, html, 'utf8');
|
|
113
116
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vigthoria-cli",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.19",
|
|
4
4
|
"description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"test:agent:smoke": "npm run build && node scripts/test-agent-smoke.js",
|
|
43
43
|
"test:agent:routing": "npm run build && node scripts/test-agent-routing-policy.js",
|
|
44
44
|
"test:agent:route": "npm run build && node scripts/test-request-intent.js && node scripts/test-agent-route.js && node scripts/test-local-use-cases.js",
|
|
45
|
+
"test:template:remote": "node scripts/test-template-service-remote.js",
|
|
45
46
|
"test:agent:context": "npm run build && node scripts/test-agent-context-trace-e2e.js",
|
|
46
47
|
"test:mcp:context": "npm run build && node scripts/test-mcp-context-session-e2e.js",
|
|
47
48
|
"test:workflow:surface": "npm run build && node scripts/test-workflow-surface-e2e.js",
|