vigthoria-cli 1.9.10 → 1.9.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.
- package/README.md +4 -4
- package/dist/commands/auth.js +48 -65
- package/dist/commands/bridge.js +12 -19
- package/dist/commands/cancel.js +15 -22
- package/dist/commands/chat.d.ts +11 -0
- package/dist/commands/chat.js +404 -248
- package/dist/commands/config.js +31 -71
- package/dist/commands/deploy.js +83 -123
- package/dist/commands/device.d.ts +35 -0
- package/dist/commands/device.js +239 -0
- package/dist/commands/edit.js +32 -39
- package/dist/commands/explain.js +18 -25
- package/dist/commands/fork.js +22 -27
- package/dist/commands/generate.js +37 -44
- package/dist/commands/history.js +20 -25
- package/dist/commands/hub.js +95 -102
- package/dist/commands/index.js +41 -46
- package/dist/commands/legion.d.ts +1 -0
- package/dist/commands/legion.js +162 -209
- package/dist/commands/preview.js +60 -98
- package/dist/commands/replay.js +27 -32
- package/dist/commands/repo.js +103 -141
- package/dist/commands/review.js +29 -36
- package/dist/commands/security.js +5 -12
- package/dist/commands/update.js +15 -49
- package/dist/commands/workflow.d.ts +8 -1
- package/dist/commands/workflow.js +53 -19
- package/dist/index.js +409 -234
- package/dist/utils/api.d.ts +5 -0
- package/dist/utils/api.js +373 -166
- package/dist/utils/bridge-client.js +11 -52
- package/dist/utils/cli-state.d.ts +54 -0
- package/dist/utils/cli-state.js +185 -0
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.js +35 -14
- package/dist/utils/context-ranker.js +15 -21
- package/dist/utils/files.js +5 -42
- package/dist/utils/logger.js +42 -50
- package/dist/utils/post-write-validator.js +22 -29
- package/dist/utils/project-memory.d.ts +56 -0
- package/dist/utils/project-memory.js +289 -0
- package/dist/utils/session.d.ts +29 -3
- package/dist/utils/session.js +137 -85
- package/dist/utils/task-display.js +13 -20
- package/dist/utils/tools.d.ts +19 -0
- package/dist/utils/tools.js +84 -87
- package/dist/utils/workspace-cache.js +18 -26
- package/dist/utils/workspace-stream.js +26 -64
- package/install.ps1 +14 -0
- package/package.json +5 -3
- package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
- package/scripts/release/validate-no-go-gates.sh +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Workspace Stream — Real-time bidirectional file sync between CLI and V3.
|
|
4
3
|
*
|
|
@@ -18,51 +17,12 @@
|
|
|
18
17
|
* {"type": "file_sync", "path": "rel/path", "content": "...", "action": "write"|"delete"}
|
|
19
18
|
* {"type": "file_batch", "files": [{path, content}, ...]}
|
|
20
19
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Object.defineProperty(o, k2, desc);
|
|
28
|
-
}) : (function(o, m, k, k2) {
|
|
29
|
-
if (k2 === undefined) k2 = k;
|
|
30
|
-
o[k2] = m[k];
|
|
31
|
-
}));
|
|
32
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
-
}) : function(o, v) {
|
|
35
|
-
o["default"] = v;
|
|
36
|
-
});
|
|
37
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
38
|
-
var ownKeys = function(o) {
|
|
39
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
-
var ar = [];
|
|
41
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
-
return ar;
|
|
43
|
-
};
|
|
44
|
-
return ownKeys(o);
|
|
45
|
-
};
|
|
46
|
-
return function (mod) {
|
|
47
|
-
if (mod && mod.__esModule) return mod;
|
|
48
|
-
var result = {};
|
|
49
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
-
__setModuleDefault(result, mod);
|
|
51
|
-
return result;
|
|
52
|
-
};
|
|
53
|
-
})();
|
|
54
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
55
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
56
|
-
};
|
|
57
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.WorkspaceWSClient = exports.WorkspaceWatcher = void 0;
|
|
59
|
-
exports.applyFileMutation = applyFileMutation;
|
|
60
|
-
const chokidar = __importStar(require("chokidar"));
|
|
61
|
-
const fs_1 = __importDefault(require("fs"));
|
|
62
|
-
const path_1 = __importDefault(require("path"));
|
|
63
|
-
const ws_1 = __importDefault(require("ws"));
|
|
64
|
-
const logger_js_1 = require("./logger.js");
|
|
65
|
-
const logger = new logger_js_1.Logger();
|
|
20
|
+
import * as chokidar from 'chokidar';
|
|
21
|
+
import fs from 'fs';
|
|
22
|
+
import path from 'path';
|
|
23
|
+
import WebSocket from 'ws';
|
|
24
|
+
import { Logger } from './logger.js';
|
|
25
|
+
const logger = new Logger();
|
|
66
26
|
logger.setVerbose(!!process.env.VIGTHORIA_DEBUG);
|
|
67
27
|
// Files/dirs to ignore in the watcher
|
|
68
28
|
const IGNORE_PATTERNS = [
|
|
@@ -98,27 +58,27 @@ const _v3MuteTimeout = 2000; // 2s mute window after V3 writes a file
|
|
|
98
58
|
* Apply a file_mutation event from V3's SSE stream to the local workspace.
|
|
99
59
|
* Call this from the SSE event handler for real-time file application.
|
|
100
60
|
*/
|
|
101
|
-
function applyFileMutation(event, workspaceRoot) {
|
|
61
|
+
export function applyFileMutation(event, workspaceRoot) {
|
|
102
62
|
if (event.type !== 'file_mutation')
|
|
103
63
|
return false;
|
|
104
64
|
if (!event.path || !workspaceRoot)
|
|
105
65
|
return false;
|
|
106
|
-
const absPath =
|
|
66
|
+
const absPath = path.resolve(workspaceRoot, event.path);
|
|
107
67
|
// Safety: ensure the resolved path is within the workspace
|
|
108
|
-
if (!absPath.startsWith(
|
|
68
|
+
if (!absPath.startsWith(path.resolve(workspaceRoot) + path.sep) && absPath !== path.resolve(workspaceRoot)) {
|
|
109
69
|
logger.warn(`Refusing to apply mutation outside workspace: ${event.path}`);
|
|
110
70
|
return false;
|
|
111
71
|
}
|
|
112
72
|
try {
|
|
113
73
|
if (event.action === 'delete') {
|
|
114
|
-
if (
|
|
115
|
-
|
|
74
|
+
if (fs.existsSync(absPath)) {
|
|
75
|
+
fs.unlinkSync(absPath);
|
|
116
76
|
logger.debug(`Deleted: ${event.path}`);
|
|
117
77
|
}
|
|
118
78
|
}
|
|
119
79
|
else if (typeof event.content === 'string') {
|
|
120
|
-
|
|
121
|
-
|
|
80
|
+
fs.mkdirSync(path.dirname(absPath), { recursive: true });
|
|
81
|
+
fs.writeFileSync(absPath, event.content, 'utf8');
|
|
122
82
|
// Mute the watcher for this file to prevent echo
|
|
123
83
|
_v3MutatedFiles.add(absPath);
|
|
124
84
|
setTimeout(() => _v3MutatedFiles.delete(absPath), _v3MuteTimeout);
|
|
@@ -131,13 +91,13 @@ function applyFileMutation(event, workspaceRoot) {
|
|
|
131
91
|
return false;
|
|
132
92
|
}
|
|
133
93
|
}
|
|
134
|
-
class WorkspaceWatcher {
|
|
94
|
+
export class WorkspaceWatcher {
|
|
135
95
|
watcher = null;
|
|
136
96
|
workspaceRoot;
|
|
137
97
|
onFileChange;
|
|
138
98
|
_ready = false;
|
|
139
99
|
constructor(options) {
|
|
140
|
-
this.workspaceRoot =
|
|
100
|
+
this.workspaceRoot = path.resolve(options.workspaceRoot);
|
|
141
101
|
this.onFileChange = options.onFileChange;
|
|
142
102
|
}
|
|
143
103
|
start() {
|
|
@@ -172,10 +132,10 @@ class WorkspaceWatcher {
|
|
|
172
132
|
// Skip if this file was just written by V3 (echo prevention)
|
|
173
133
|
if (_v3MutatedFiles.has(filePath))
|
|
174
134
|
return;
|
|
175
|
-
const ext =
|
|
135
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
176
136
|
if (BINARY_EXTENSIONS.has(ext))
|
|
177
137
|
return;
|
|
178
|
-
const relativePath =
|
|
138
|
+
const relativePath = path.relative(this.workspaceRoot, filePath);
|
|
179
139
|
if (relativePath.startsWith('..'))
|
|
180
140
|
return; // safety
|
|
181
141
|
if (action === 'delete') {
|
|
@@ -183,10 +143,10 @@ class WorkspaceWatcher {
|
|
|
183
143
|
return;
|
|
184
144
|
}
|
|
185
145
|
try {
|
|
186
|
-
const stat =
|
|
146
|
+
const stat = fs.statSync(filePath);
|
|
187
147
|
if (stat.size > MAX_SYNC_FILE_BYTES)
|
|
188
148
|
return;
|
|
189
|
-
const content =
|
|
149
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
190
150
|
this.onFileChange?.(relativePath, content, 'write');
|
|
191
151
|
}
|
|
192
152
|
catch {
|
|
@@ -194,8 +154,7 @@ class WorkspaceWatcher {
|
|
|
194
154
|
}
|
|
195
155
|
}
|
|
196
156
|
}
|
|
197
|
-
|
|
198
|
-
class WorkspaceWSClient {
|
|
157
|
+
export class WorkspaceWSClient {
|
|
199
158
|
ws = null;
|
|
200
159
|
opts;
|
|
201
160
|
reconnectTimer = null;
|
|
@@ -208,10 +167,14 @@ class WorkspaceWSClient {
|
|
|
208
167
|
connect() {
|
|
209
168
|
if (this.ws)
|
|
210
169
|
return;
|
|
211
|
-
const url = `${this.opts.serverUrl}/ws/workspace
|
|
212
|
-
this.ws = new
|
|
170
|
+
const url = `${this.opts.serverUrl}/ws/workspace`;
|
|
171
|
+
this.ws = new WebSocket(url);
|
|
213
172
|
this.ws.on('open', () => {
|
|
214
173
|
this._connected = true;
|
|
174
|
+
this._send({
|
|
175
|
+
type: 'auth',
|
|
176
|
+
token: this.opts.token,
|
|
177
|
+
});
|
|
215
178
|
// Bind to workspace
|
|
216
179
|
this._send({
|
|
217
180
|
type: 'bind',
|
|
@@ -298,4 +261,3 @@ class WorkspaceWSClient {
|
|
|
298
261
|
}
|
|
299
262
|
}
|
|
300
263
|
}
|
|
301
|
-
exports.WorkspaceWSClient = WorkspaceWSClient;
|
package/install.ps1
CHANGED
|
@@ -11,6 +11,20 @@ $NPM_PACKAGE = "vigthoria-cli"
|
|
|
11
11
|
$GIT_PACKAGE_URL = "git+https://market.vigthoria.io/vigthoria/vigthoria-cli.git"
|
|
12
12
|
$HOSTED_TARBALL_URL = "https://coder.vigthoria.io/releases/vigthoria-cli-$CLI_VERSION.tgz"
|
|
13
13
|
|
|
14
|
+
function Resolve-ReleaseTruth {
|
|
15
|
+
try {
|
|
16
|
+
$truth = Invoke-WebRequest -Uri $RELEASE_TRUTH_URL -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop | Select-Object -ExpandProperty Content | ConvertFrom-Json
|
|
17
|
+
if ($truth.products.vigthoriaCli.version -and $truth.products.vigthoriaCli.url) {
|
|
18
|
+
$script:CLI_VERSION = $truth.products.vigthoriaCli.version
|
|
19
|
+
$script:HOSTED_TARBALL_URL = $truth.products.vigthoriaCli.url
|
|
20
|
+
}
|
|
21
|
+
} catch {
|
|
22
|
+
Write-Host "Release truth unavailable, using bundled fallback $CLI_VERSION" -ForegroundColor Yellow
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Resolve-ReleaseTruth
|
|
27
|
+
|
|
14
28
|
function Write-Banner {
|
|
15
29
|
Write-Host ""
|
|
16
30
|
Write-Host " ╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vigthoria-cli",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.19",
|
|
4
4
|
"description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"files": [
|
|
7
8
|
"dist",
|
|
@@ -63,7 +64,8 @@
|
|
|
63
64
|
"precheck:services": "node scripts/precheck-local-services.js",
|
|
64
65
|
"test:model:governance": "npm run build && node scripts/test-model-governance-no-agent.js",
|
|
65
66
|
"validate:no-go": "bash scripts/release/validate-no-go-gates.sh",
|
|
66
|
-
"test:legion:billing:e2e": "npm run build && node scripts/test-legion-godmode-billing-e2e.js"
|
|
67
|
+
"test:legion:billing:e2e": "npm run build && node scripts/test-legion-godmode-billing-e2e.js",
|
|
68
|
+
"test:windows:v3-sync": "npm run build && node scripts/test-windows-v3-sync-recovery.js"
|
|
67
69
|
},
|
|
68
70
|
"keywords": [
|
|
69
71
|
"ai",
|
|
@@ -80,7 +82,7 @@
|
|
|
80
82
|
"archiver": "^6.0.1",
|
|
81
83
|
"axios": "^1.6.0",
|
|
82
84
|
"chalk": "^5.3.0",
|
|
83
|
-
"chokidar": "^
|
|
85
|
+
"chokidar": "^4.0.0",
|
|
84
86
|
"commander": "^11.1.0",
|
|
85
87
|
"conf": "^12.0.0",
|
|
86
88
|
"diff": "^5.1.0",
|
|
@@ -71,7 +71,7 @@ vigthoria agent --prompt "Read one file and summarize it" --auto-approve
|
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Expected:
|
|
74
|
-
- balanced output model: `vigthoria-balanced-4b`
|
|
74
|
+
- balanced output model: `vigthoria-v3-balanced-4b`
|
|
75
75
|
- creative output model: `vigthoria-v3-code-35b`
|
|
76
76
|
- agent run shows direct prompt execution and tool activity
|
|
77
77
|
|
|
@@ -65,7 +65,7 @@ python3 - << 'PY'
|
|
|
65
65
|
import json
|
|
66
66
|
j=json.load(open('/tmp/vig-balanced.json'))
|
|
67
67
|
assert j.get('success') is True
|
|
68
|
-
assert j.get('model') == 'vigthoria-balanced-4b', j
|
|
68
|
+
assert j.get('model') == 'vigthoria-v3-balanced-4b', j
|
|
69
69
|
print('[pass] balanced-4b')
|
|
70
70
|
PY
|
|
71
71
|
|
|
@@ -94,7 +94,7 @@ curl -s http://localhost:4009/v1/models >/tmp/vig-models.json
|
|
|
94
94
|
python3 - << 'PY'
|
|
95
95
|
import json
|
|
96
96
|
ids={m.get('id','') for m in json.load(open('/tmp/vig-models.json')).get('data',[])}
|
|
97
|
-
assert ('vigthoria-balanced-4b' in ids) or ('vigthoria-balanced-4b:latest' in ids)
|
|
97
|
+
assert ('vigthoria-v3-balanced-4b' in ids) or ('vigthoria-v3-balanced-4b:latest' in ids)
|
|
98
98
|
assert 'vigthoria-creative-9b-v4' in ids
|
|
99
99
|
assert any('vigthoria-v3-code-35b' in i for i in ids)
|
|
100
100
|
print('[pass] model inventory gates')
|