vigthoria-cli 1.6.13 → 1.6.15
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/dist/utils/api.d.ts +1 -1
- package/dist/utils/api.js +21 -4
- package/package.json +4 -4
package/dist/utils/api.d.ts
CHANGED
|
@@ -244,7 +244,7 @@ export declare class APIClient {
|
|
|
244
244
|
};
|
|
245
245
|
waitForAgentWorkspaceSettle(context?: Record<string, any>, options?: Record<string, any>): Promise<void>;
|
|
246
246
|
extractExpectedWorkspaceFiles(message?: string, context?: Record<string, any>): string[];
|
|
247
|
-
captureV3AgentStreamMutation(event: any, streamedFiles: Record<string, string
|
|
247
|
+
captureV3AgentStreamMutation(event: any, streamedFiles: Record<string, string>, serverRoot?: string | null): void;
|
|
248
248
|
recoverAgentWorkspaceFiles(context?: Record<string, any>, streamedFiles?: Record<string, string>, expectedFiles?: string[]): void;
|
|
249
249
|
normalizeAgentWorkspaceRelativePath(rawPath: string, rootPath?: string): string;
|
|
250
250
|
ensureAgentFrontendPolish(message?: string, context?: Record<string, any>): Promise<void>;
|
package/dist/utils/api.js
CHANGED
|
@@ -1684,13 +1684,13 @@ menu {
|
|
|
1684
1684
|
addMatches(context.agentPrompt);
|
|
1685
1685
|
return Array.from(candidates);
|
|
1686
1686
|
}
|
|
1687
|
-
captureV3AgentStreamMutation(event, streamedFiles) {
|
|
1687
|
+
captureV3AgentStreamMutation(event, streamedFiles, serverRoot) {
|
|
1688
1688
|
if (!event || event.type !== 'tool_call' || !streamedFiles) {
|
|
1689
1689
|
return;
|
|
1690
1690
|
}
|
|
1691
1691
|
const args = event.arguments || {};
|
|
1692
1692
|
if ((event.name === 'write_file' || event.name === 'edit_file') && typeof args.path === 'string') {
|
|
1693
|
-
const filePath = this.normalizeAgentWorkspaceRelativePath(args.path);
|
|
1693
|
+
const filePath = this.normalizeAgentWorkspaceRelativePath(args.path, serverRoot || undefined);
|
|
1694
1694
|
if (!filePath) {
|
|
1695
1695
|
return;
|
|
1696
1696
|
}
|
|
@@ -1708,9 +1708,21 @@ menu {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
recoverAgentWorkspaceFiles(context = {}, streamedFiles = {}, expectedFiles = []) {
|
|
1710
1710
|
const rootPath = this.resolveAgentTargetPath(context);
|
|
1711
|
-
if (!rootPath ||
|
|
1711
|
+
if (!rootPath || Object.keys(streamedFiles).length === 0) {
|
|
1712
1712
|
return;
|
|
1713
1713
|
}
|
|
1714
|
+
// Create the local workspace directory if it doesn't exist yet.
|
|
1715
|
+
// This is needed for remote CLI clients where the user specified a
|
|
1716
|
+
// path (e.g., C:\vigthoria\Apps\pacman_rogue) that may not have
|
|
1717
|
+
// been created before the V3 run.
|
|
1718
|
+
if (!fs_1.default.existsSync(rootPath)) {
|
|
1719
|
+
try {
|
|
1720
|
+
fs_1.default.mkdirSync(rootPath, { recursive: true });
|
|
1721
|
+
}
|
|
1722
|
+
catch {
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1714
1726
|
const targets = expectedFiles.length > 0 ? expectedFiles : Object.keys(streamedFiles);
|
|
1715
1727
|
for (const targetPath of targets) {
|
|
1716
1728
|
const relativePath = this.normalizeAgentWorkspaceRelativePath(targetPath, rootPath);
|
|
@@ -2142,6 +2154,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
2142
2154
|
const events = [];
|
|
2143
2155
|
let final = null;
|
|
2144
2156
|
let contextId = response.headers.get('x-context-id') || String(context.contextId || '').trim() || null;
|
|
2157
|
+
let serverWorkspaceRoot = null;
|
|
2145
2158
|
const streamedFiles = {};
|
|
2146
2159
|
const idleTimeoutMs = context.agentIdleTimeoutMs || DEFAULT_V3_AGENT_IDLE_TIMEOUT_MS;
|
|
2147
2160
|
while (true) {
|
|
@@ -2208,7 +2221,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
2208
2221
|
if (!contextId && typeof event.context_id === 'string' && event.context_id.trim()) {
|
|
2209
2222
|
contextId = event.context_id.trim();
|
|
2210
2223
|
}
|
|
2211
|
-
|
|
2224
|
+
if (!serverWorkspaceRoot && event.type === 'context' && typeof event.workspace_root === 'string' && event.workspace_root.trim()) {
|
|
2225
|
+
serverWorkspaceRoot = event.workspace_root.trim();
|
|
2226
|
+
}
|
|
2227
|
+
this.captureV3AgentStreamMutation(event, streamedFiles, serverWorkspaceRoot);
|
|
2212
2228
|
if (typeof context.onStreamEvent === 'function') {
|
|
2213
2229
|
try {
|
|
2214
2230
|
context.onStreamEvent(event);
|
|
@@ -2241,6 +2257,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
2241
2257
|
result: final,
|
|
2242
2258
|
events,
|
|
2243
2259
|
files: streamedFiles,
|
|
2260
|
+
serverWorkspaceRoot: serverWorkspaceRoot || null,
|
|
2244
2261
|
};
|
|
2245
2262
|
}
|
|
2246
2263
|
async runV3AgentWorkflow(message, context = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vigthoria-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.15",
|
|
4
4
|
"description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"CLI_DIRECT_API_ARCHITECTURE.md"
|
|
11
11
|
],
|
|
12
12
|
"bin": {
|
|
13
|
-
"vigthoria": "
|
|
14
|
-
"vig": "
|
|
15
|
-
"vigthoria-chat": "
|
|
13
|
+
"vigthoria": "dist/index.js",
|
|
14
|
+
"vig": "dist/index.js",
|
|
15
|
+
"vigthoria-chat": "dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|