vigthoria-cli 1.9.2 → 1.9.8
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 +15 -5
- package/dist/commands/auth.d.ts +28 -38
- package/dist/commands/auth.js +461 -313
- package/dist/commands/bridge.js +3 -8
- package/dist/commands/chat.d.ts +3 -0
- package/dist/commands/chat.js +97 -34
- package/dist/commands/index.js +1 -1
- package/dist/commands/legion.d.ts +22 -19
- package/dist/commands/legion.js +561 -134
- package/dist/commands/preview.js +32 -7
- package/dist/commands/repo.js +19 -13
- package/dist/commands/security.d.ts +20 -0
- package/dist/commands/security.js +98 -0
- package/dist/commands/update.d.ts +9 -0
- package/dist/commands/update.js +235 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +147 -40
- package/dist/utils/api.d.ts +25 -70
- package/dist/utils/api.js +875 -693
- package/dist/utils/config.js +1 -1
- package/dist/utils/tools.d.ts +11 -0
- package/dist/utils/tools.js +251 -5
- package/install.ps1 +322 -0
- package/install.sh +314 -0
- package/package.json +18 -3
- package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +159 -0
- package/scripts/release/publish-cli-release.sh +73 -0
- package/scripts/release/validate-no-go-gates.sh +129 -0
- package/scripts/release/verify-runtime-consistency.mjs +64 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT="/var/www/vigthoria-coder/VigthoriaCoderMain/vigthoria-cli"
|
|
5
|
+
cd "$ROOT"
|
|
6
|
+
|
|
7
|
+
CLI="node dist/index.js"
|
|
8
|
+
unset V3_SERVICE_KEY
|
|
9
|
+
unset HYPERLOOP_SERVICE_KEY
|
|
10
|
+
|
|
11
|
+
echo "[0.1-0.6] source/dist consistency"
|
|
12
|
+
node scripts/release/verify-runtime-consistency.mjs >/tmp/vig-verify-runtime.json
|
|
13
|
+
cat /tmp/vig-verify-runtime.json
|
|
14
|
+
|
|
15
|
+
echo "[0.2] build exits 0"
|
|
16
|
+
npm run build >/tmp/vig-build.log 2>&1
|
|
17
|
+
|
|
18
|
+
echo "[0.3] dist/index.js exists"
|
|
19
|
+
[[ -x dist/index.js ]]
|
|
20
|
+
|
|
21
|
+
echo "[AUTH PREFLIGHT] invalid session message"
|
|
22
|
+
AUTH_JSON=$(VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight $CLI chat --no-agent --model balanced-4b --prompt "ok" --json 2>/dev/null || true)
|
|
23
|
+
echo "$AUTH_JSON"
|
|
24
|
+
printf '%s
|
|
25
|
+
' "$AUTH_JSON" > /tmp/vig-auth-preflight.json
|
|
26
|
+
python3 - << 'PY'
|
|
27
|
+
import json
|
|
28
|
+
with open('/tmp/vig-auth-preflight.json','r',encoding='utf-8') as f:
|
|
29
|
+
j=json.load(f)
|
|
30
|
+
msg='Vigthoria Gate way user authentification failed. Please log out and login again.'
|
|
31
|
+
assert j.get('success') is False, 'expected success=false for invalid token preflight'
|
|
32
|
+
assert j.get('error') == msg, f"unexpected auth message: {j.get('error')}"
|
|
33
|
+
print('[pass] auth preflight message')
|
|
34
|
+
PY
|
|
35
|
+
|
|
36
|
+
echo "[1.1] ranker includes agent.py top10 for SSE prompt"
|
|
37
|
+
node - << 'EOF2'
|
|
38
|
+
import('./dist/utils/context-ranker.js').then((m)=>{
|
|
39
|
+
const r=m.buildSemanticContext('/var/www/V3-Code-Agent','fix the streaming SSE event handler',10);
|
|
40
|
+
const idx=r.topFiles.findIndex((f)=>f.path==='agent.py');
|
|
41
|
+
console.log('agent_idx_top10=' + idx);
|
|
42
|
+
if (idx < 0) process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
EOF2
|
|
45
|
+
|
|
46
|
+
echo "[2.1/2.4] tsc validator emits passing result"
|
|
47
|
+
node - << 'EOF2'
|
|
48
|
+
import fs from 'node:fs';
|
|
49
|
+
import os from 'node:os';
|
|
50
|
+
import path from 'node:path';
|
|
51
|
+
import { runPostWriteValidation } from './dist/utils/post-write-validator.js';
|
|
52
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'vig-tsc-'));
|
|
53
|
+
fs.mkdirSync(path.join(tmp, 'src'));
|
|
54
|
+
fs.writeFileSync(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { target: 'ES2020', module: 'ESNext' }, include: ['src/**/*.ts'] }));
|
|
55
|
+
fs.writeFileSync(path.join(tmp, 'src', 'index.ts'), 'export const ok:number = 1;\n');
|
|
56
|
+
const res = await runPostWriteValidation(tmp);
|
|
57
|
+
const tsc = res.find((r)=>r.tool==='tsc');
|
|
58
|
+
console.log(JSON.stringify(tsc || null));
|
|
59
|
+
if (!tsc || !tsc.ran || !tsc.passed) process.exit(1);
|
|
60
|
+
EOF2
|
|
61
|
+
|
|
62
|
+
echo "[6.2] balanced-4b no-agent path"
|
|
63
|
+
$CLI chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >/tmp/vig-balanced.json
|
|
64
|
+
python3 - << 'PY'
|
|
65
|
+
import json
|
|
66
|
+
j=json.load(open('/tmp/vig-balanced.json'))
|
|
67
|
+
assert j.get('success') is True
|
|
68
|
+
assert j.get('model') == 'vigthoria-balanced-4b', j
|
|
69
|
+
print('[pass] balanced-4b')
|
|
70
|
+
PY
|
|
71
|
+
|
|
72
|
+
echo "[6.9/6.12] aliases available"
|
|
73
|
+
$CLI hyper-loop status >/tmp/vig-hyperloop.txt
|
|
74
|
+
$CLI devtools connect >/tmp/vig-devtools.txt
|
|
75
|
+
|
|
76
|
+
echo "[6.11] operator flow"
|
|
77
|
+
$CLI operator --prompt "status check" --json >/tmp/vig-operator.json
|
|
78
|
+
python3 - << 'PY'
|
|
79
|
+
import json
|
|
80
|
+
j=json.load(open('/tmp/vig-operator.json'))
|
|
81
|
+
assert j.get('success') is True, j
|
|
82
|
+
print('[pass] operator flow')
|
|
83
|
+
PY
|
|
84
|
+
|
|
85
|
+
echo "[7.1/7.3/7.4] local service health"
|
|
86
|
+
for u in http://localhost:8030/health http://localhost:4008/health http://localhost:4011/health; do
|
|
87
|
+
code=$(curl -s -o /dev/null -w "%{http_code}" "$u")
|
|
88
|
+
echo "$u => $code"
|
|
89
|
+
[[ "$code" == "200" ]]
|
|
90
|
+
done
|
|
91
|
+
|
|
92
|
+
echo "[7.2/7.8/12.3] models inventory"
|
|
93
|
+
curl -s http://localhost:4009/v1/models >/tmp/vig-models.json
|
|
94
|
+
python3 - << 'PY'
|
|
95
|
+
import json
|
|
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)
|
|
98
|
+
assert 'vigthoria-creative-9b-v4' in ids
|
|
99
|
+
assert any('vigthoria-v3-code-35b' in i for i in ids)
|
|
100
|
+
print('[pass] model inventory gates')
|
|
101
|
+
PY
|
|
102
|
+
|
|
103
|
+
echo "[7.5 policy] secured hyperloop endpoint"
|
|
104
|
+
code=$(curl -s -o /dev/null -w "%{http_code}" https://coder.vigthoria.io/api/hyperloop/health)
|
|
105
|
+
echo "unauth_hyperloop_code=$code"
|
|
106
|
+
[[ "$code" == "401" ]]
|
|
107
|
+
|
|
108
|
+
echo "[8.2] runtime symlink guard signals"
|
|
109
|
+
rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >/tmp/vig-ranker-signals.txt
|
|
110
|
+
cat /tmp/vig-ranker-signals.txt
|
|
111
|
+
|
|
112
|
+
echo "[9.5/9.7/9.16] release URL consistency"
|
|
113
|
+
rg -n "coder.vigthoria.io/releases" install.ps1 install.sh README.md >/tmp/vig-release-urls.txt
|
|
114
|
+
cat /tmp/vig-release-urls.txt
|
|
115
|
+
|
|
116
|
+
echo "[12.1] no-agent governance fallback"
|
|
117
|
+
$CLI chat --no-agent --model creative --prompt "say ok" --json >/tmp/vig-creative.json
|
|
118
|
+
python3 - << 'PY'
|
|
119
|
+
import json
|
|
120
|
+
j=json.load(open('/tmp/vig-creative.json'))
|
|
121
|
+
assert j.get('success') is True
|
|
122
|
+
assert j.get('model') == 'vigthoria-v3-code-35b', j
|
|
123
|
+
md=j.get('metadata') or {}
|
|
124
|
+
fb=md.get('modelFallback') or {}
|
|
125
|
+
assert fb.get('reason') == 'governance-blocked-model', j
|
|
126
|
+
print('[pass] governance fallback metadata')
|
|
127
|
+
PY
|
|
128
|
+
|
|
129
|
+
echo "ALL NO-GO GATES PASSED"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
function findPackageJson() {
|
|
6
|
+
const candidates = [
|
|
7
|
+
path.join(process.cwd(), 'package.json'),
|
|
8
|
+
path.join(process.cwd(), 'node_modules', 'vigthoria-cli', 'package.json'),
|
|
9
|
+
path.join(process.env.APPDATA || '', 'npm', 'node_modules', 'vigthoria-cli', 'package.json'),
|
|
10
|
+
];
|
|
11
|
+
for (const p of candidates) {
|
|
12
|
+
if (p && fs.existsSync(p)) return p;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function exists(p) {
|
|
18
|
+
try { return fs.existsSync(p); } catch { return false; }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const pkgPath = findPackageJson();
|
|
22
|
+
if (!pkgPath) {
|
|
23
|
+
console.error('[verify] FAIL: package.json not found in expected locations');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
28
|
+
const targetVersion = process.argv[2] || String(pkg.version || '');
|
|
29
|
+
const baseDir = path.dirname(pkgPath);
|
|
30
|
+
const isNodeModulesInstall = baseDir.endsWith(path.join('node_modules', 'vigthoria-cli'));
|
|
31
|
+
const projectRoot = isNodeModulesInstall ? baseDir : process.cwd();
|
|
32
|
+
|
|
33
|
+
const srcUtils = path.join(projectRoot, 'src', 'utils');
|
|
34
|
+
const distUtils = path.join(projectRoot, 'dist', 'utils');
|
|
35
|
+
const requiredSrc = ['context-ranker.ts', 'post-write-validator.ts', 'task-display.ts', 'workspace-cache.ts'];
|
|
36
|
+
const requiredDist = ['context-ranker.js', 'post-write-validator.js', 'task-display.js', 'workspace-cache.js'];
|
|
37
|
+
|
|
38
|
+
const sourceSnapshotExpected = !isNodeModulesInstall && exists(srcUtils);
|
|
39
|
+
const missingSrc = sourceSnapshotExpected ? requiredSrc.filter((f) => !exists(path.join(srcUtils, f))) : [];
|
|
40
|
+
const missingDist = requiredDist.filter((f) => !exists(path.join(distUtils, f)));
|
|
41
|
+
|
|
42
|
+
const report = {
|
|
43
|
+
targetVersion,
|
|
44
|
+
packageVersion: String(pkg.version || ''),
|
|
45
|
+
packageJsonPath: pkgPath,
|
|
46
|
+
projectRoot,
|
|
47
|
+
srcUtils,
|
|
48
|
+
distUtils,
|
|
49
|
+
missingSrc,
|
|
50
|
+
missingDist,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
console.log(JSON.stringify(report, null, 2));
|
|
54
|
+
|
|
55
|
+
if (report.packageVersion !== targetVersion) {
|
|
56
|
+
console.error(`[verify] FAIL: version mismatch (${report.packageVersion} != ${targetVersion})`);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
if (missingSrc.length > 0 || missingDist.length > 0) {
|
|
60
|
+
console.error('[verify] FAIL: required utility modules missing');
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log('[verify] PASS: runtime/source snapshot is consistent');
|