vigthoria-cli 1.13.20 → 1.13.22
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/completions/_vigthoria +49 -0
- package/completions/vigthoria.bash +6 -0
- package/completions/vigthoria.fish +41 -0
- package/dist/commands/auth.d.ts +1 -0
- package/dist/commands/auth.js +63 -128
- package/dist/commands/background.d.ts +0 -2
- package/dist/commands/background.js +26 -34
- package/dist/commands/bridge.js +45 -41
- package/dist/commands/cancel.d.ts +1 -0
- package/dist/commands/cancel.js +22 -16
- package/dist/commands/chat.d.ts +3 -42
- package/dist/commands/chat.js +378 -1123
- package/dist/commands/coding-registration.d.ts +4 -0
- package/dist/commands/coding-registration.js +24 -0
- package/dist/commands/config.js +23 -29
- package/dist/commands/conversation-registration.d.ts +4 -0
- package/dist/commands/conversation-registration.js +122 -0
- package/dist/commands/deploy.d.ts +8 -2
- package/dist/commands/deploy.js +92 -90
- package/dist/commands/device.d.ts +1 -2
- package/dist/commands/device.js +37 -21
- package/dist/commands/doctor-registration.d.ts +4 -0
- package/dist/commands/doctor-registration.js +200 -0
- package/dist/commands/edit.js +22 -33
- package/dist/commands/explain.js +7 -10
- package/dist/commands/fork.d.ts +1 -2
- package/dist/commands/fork.js +72 -22
- package/dist/commands/game.d.ts +1 -1
- package/dist/commands/game.js +17 -6
- package/dist/commands/generate.js +7 -9
- package/dist/commands/history.js +11 -7
- package/dist/commands/hub.d.ts +2 -2
- package/dist/commands/hub.js +34 -35
- package/dist/commands/legion.d.ts +0 -1
- package/dist/commands/legion.js +62 -79
- package/dist/commands/music.d.ts +1 -2
- package/dist/commands/music.js +62 -27
- package/dist/commands/platform-registration.d.ts +4 -0
- package/dist/commands/platform-registration.js +45 -0
- package/dist/commands/preview.d.ts +0 -1
- package/dist/commands/preview.js +82 -35
- package/dist/commands/product-run-registration.d.ts +4 -0
- package/dist/commands/product-run-registration.js +490 -0
- package/dist/commands/replay.d.ts +1 -2
- package/dist/commands/replay.js +15 -11
- package/dist/commands/repo.d.ts +14 -7
- package/dist/commands/repo.js +245 -196
- package/dist/commands/review.js +9 -12
- package/dist/commands/security.d.ts +1 -2
- package/dist/commands/security.js +12 -6
- package/dist/commands/update-registration.d.ts +3 -0
- package/dist/commands/update-registration.js +338 -0
- package/dist/commands/v4-registration.d.ts +4 -0
- package/dist/commands/v4-registration.js +24 -0
- package/dist/commands/v4.d.ts +1 -1
- package/dist/commands/v4.js +46 -8
- package/dist/commands/wallet.d.ts +1 -3
- package/dist/commands/wallet.js +18 -45
- package/dist/commands/workflow.d.ts +2 -0
- package/dist/commands/workflow.js +52 -39
- package/dist/index.js +122 -1589
- package/dist/utils/agent-stream-state.d.ts +27 -0
- package/dist/utils/agent-stream-state.js +93 -0
- package/dist/utils/agentRoute.d.ts +2 -1
- package/dist/utils/agentRoute.js +22 -9
- package/dist/utils/agentRunOutcome.d.ts +16 -0
- package/dist/utils/agentRunOutcome.js +37 -2
- package/dist/utils/api-client-factory.d.ts +8 -0
- package/dist/utils/api-client-factory.js +8 -0
- package/dist/utils/api.d.ts +44 -266
- package/dist/utils/api.js +647 -3180
- package/dist/utils/auth-session.d.ts +41 -0
- package/dist/utils/auth-session.js +224 -0
- package/dist/utils/brain-hub-client.d.ts +0 -4
- package/dist/utils/brain-hub-client.js +6 -3
- package/dist/utils/bridge-client.js +2 -0
- package/dist/utils/capability-health-service.d.ts +48 -0
- package/dist/utils/capability-health-service.js +64 -0
- package/dist/utils/chat-prompt-policy.d.ts +18 -0
- package/dist/utils/chat-prompt-policy.js +61 -0
- package/dist/utils/chat-tool-call-parser.d.ts +11 -0
- package/dist/utils/chat-tool-call-parser.js +71 -0
- package/dist/utils/cli-state.d.ts +22 -4
- package/dist/utils/cli-state.js +105 -47
- package/dist/utils/code-operations-service.d.ts +104 -0
- package/dist/utils/code-operations-service.js +837 -0
- package/dist/utils/codebase-indexer.d.ts +1 -0
- package/dist/utils/codebase-indexer.js +28 -8
- package/dist/utils/command-contract.d.ts +61 -0
- package/dist/utils/command-contract.js +149 -0
- package/dist/utils/command-policy.d.ts +10 -0
- package/dist/utils/command-policy.js +54 -0
- package/dist/utils/config.d.ts +13 -5
- package/dist/utils/config.js +220 -94
- package/dist/utils/context-ranker.js +11 -2
- package/dist/utils/context-state.d.ts +39 -0
- package/dist/utils/context-state.js +52 -0
- package/dist/utils/deckEvents.d.ts +0 -5
- package/dist/utils/deckEvents.js +3 -2
- package/dist/utils/desktop-bridge-client.js +2 -0
- package/dist/utils/direct-output-policy.d.ts +3 -0
- package/dist/utils/direct-output-policy.js +76 -0
- package/dist/utils/durable-json.d.ts +57 -0
- package/dist/utils/durable-json.js +319 -0
- package/dist/utils/fastAgentRouter.d.ts +5 -6
- package/dist/utils/fastAgentRouter.js +17 -25
- package/dist/utils/files.js +21 -13
- package/dist/utils/frontend-preview-service.d.ts +76 -0
- package/dist/utils/frontend-preview-service.js +482 -0
- package/dist/utils/goaEvents.d.ts +0 -4
- package/dist/utils/goaEvents.js +5 -2
- package/dist/utils/logger.d.ts +2 -1
- package/dist/utils/logger.js +27 -20
- package/dist/utils/mcp-context-client.d.ts +24 -0
- package/dist/utils/mcp-context-client.js +58 -0
- package/dist/utils/model-governance.d.ts +18 -0
- package/dist/utils/model-governance.js +75 -0
- package/dist/utils/model-transport-service.d.ts +44 -0
- package/dist/utils/model-transport-service.js +111 -0
- package/dist/utils/mutation-journal.d.ts +42 -0
- package/dist/utils/mutation-journal.js +387 -0
- package/dist/utils/network-policy.d.ts +24 -0
- package/dist/utils/network-policy.js +202 -0
- package/dist/utils/operator-client.d.ts +45 -0
- package/dist/utils/operator-client.js +159 -0
- package/dist/utils/post-write-validator.js +7 -9
- package/dist/utils/preview-screenshot-adapter.d.ts +13 -0
- package/dist/utils/preview-screenshot-adapter.js +36 -0
- package/dist/utils/process-policy.d.ts +23 -0
- package/dist/utils/process-policy.js +284 -0
- package/dist/utils/project-memory.d.ts +13 -3
- package/dist/utils/project-memory.js +70 -17
- package/dist/utils/prompt-workspace-resolver.d.ts +14 -0
- package/dist/utils/prompt-workspace-resolver.js +64 -0
- package/dist/utils/release-install.d.ts +11 -0
- package/dist/utils/release-install.js +155 -0
- package/dist/utils/release-policy.d.ts +64 -0
- package/dist/utils/release-policy.js +293 -0
- package/dist/utils/requestIntent.js +22 -3
- package/dist/utils/runtime-capability.d.ts +8 -0
- package/dist/utils/runtime-capability.js +16 -0
- package/dist/utils/secret-policy.d.ts +20 -0
- package/dist/utils/secret-policy.js +160 -0
- package/dist/utils/session.d.ts +17 -3
- package/dist/utils/session.js +354 -110
- package/dist/utils/tool-approval-service.d.ts +17 -0
- package/dist/utils/tool-approval-service.js +78 -0
- package/dist/utils/tool-capability-providers.d.ts +57 -0
- package/dist/utils/tool-capability-providers.js +57 -0
- package/dist/utils/tools.d.ts +2 -23
- package/dist/utils/tools.js +216 -508
- package/dist/utils/update-policy.d.ts +18 -0
- package/dist/utils/update-policy.js +137 -0
- package/dist/utils/v3-agent-client.d.ts +40 -0
- package/dist/utils/v3-agent-client.js +165 -0
- package/dist/utils/v3-workspace-service.d.ts +28 -0
- package/dist/utils/v3-workspace-service.js +279 -0
- package/dist/utils/vigflow-client.d.ts +95 -0
- package/dist/utils/vigflow-client.js +105 -0
- package/dist/utils/workspace-boundary.d.ts +45 -0
- package/dist/utils/workspace-boundary.js +377 -0
- package/dist/utils/workspace-brain-service.d.ts +2 -0
- package/dist/utils/workspace-brain-service.js +11 -1
- package/dist/utils/workspace-cache.js +37 -15
- package/dist/utils/workspace-stream.js +35 -10
- package/install.ps1 +85 -142
- package/install.sh +75 -80
- package/package.json +43 -9
- package/release-policy.json +43 -0
- package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
- package/scripts/release/generate-completions.mjs +24 -0
- package/scripts/release/install-release.mjs +10 -0
- package/scripts/release/publish-cli-release.mjs +116 -0
- package/scripts/release/publish-cli-release.sh +2 -70
- package/scripts/release/resolve-release-manifest.mjs +26 -0
- package/scripts/release/test-balanced-model-live.sh +42 -0
- package/scripts/release/validate-live-service-gates.sh +90 -0
- package/scripts/release/validate-no-go-gates.sh +135 -174
- package/scripts/release/verify-runtime-consistency.mjs +4 -1
- package/dist/commands/index.d.ts +0 -12
- package/dist/commands/index.js +0 -194
- package/dist/commands/update.d.ts +0 -9
- package/dist/commands/update.js +0 -301
- package/dist/utils/templateInstantPath.d.ts +0 -18
- package/dist/utils/templateInstantPath.js +0 -228
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
assertReleaseUrl,
|
|
4
|
+
getReleasePolicy,
|
|
5
|
+
parseReleaseManifestText,
|
|
6
|
+
verifyReleaseSignature,
|
|
7
|
+
} from '../../dist/utils/release-policy.js';
|
|
8
|
+
|
|
9
|
+
const policy = getReleasePolicy();
|
|
10
|
+
const manifestUrl = process.argv[2] || policy.origins.manifest;
|
|
11
|
+
const channel = process.argv[3] || 'stable';
|
|
12
|
+
async function read(url, accept) {
|
|
13
|
+
assertReleaseUrl(url, url === manifestUrl ? 'manifest' : 'signature');
|
|
14
|
+
const response = await fetch(url, {
|
|
15
|
+
redirect: 'manual',
|
|
16
|
+
signal: AbortSignal.timeout(15_000),
|
|
17
|
+
headers: { Accept: accept },
|
|
18
|
+
});
|
|
19
|
+
if (!response.ok || [301, 302, 303, 307, 308].includes(response.status)) throw new Error(`Release resource returned HTTP ${response.status}; redirects are prohibited.`);
|
|
20
|
+
return response.text();
|
|
21
|
+
}
|
|
22
|
+
const manifestText = await read(manifestUrl, 'application/json');
|
|
23
|
+
const entry = parseReleaseManifestText(manifestText, channel);
|
|
24
|
+
const detached = await read(entry.signature.url, 'application/octet-stream');
|
|
25
|
+
verifyReleaseSignature(channel, entry, detached);
|
|
26
|
+
process.stdout.write(`${JSON.stringify(entry)}\n`);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
+
cd "$ROOT"
|
|
6
|
+
|
|
7
|
+
block() {
|
|
8
|
+
echo "BLOCKED: $*" >&2
|
|
9
|
+
exit 2
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[[ -n "${VIGTHORIA_AUTH_TOKEN:-}" ]] || block "VIGTHORIA_AUTH_TOKEN is required for the credentialed balanced-model probe"
|
|
13
|
+
[[ -n "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL:-}" ]] || block "VIGTHORIA_SELF_HOSTED_MODELS_API_URL is required for the live model infrastructure"
|
|
14
|
+
[[ -x dist/index.js ]] || block "dist/index.js is unavailable; build the candidate first"
|
|
15
|
+
|
|
16
|
+
MODELS_HEALTH="${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/health"
|
|
17
|
+
if ! curl --silent --show-error --fail --connect-timeout 5 --max-time 15 "$MODELS_HEALTH" >/dev/null; then
|
|
18
|
+
block "balanced-model infrastructure is unavailable at the configured endpoint"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
PROBE_TMP="$(mktemp -d "${TMPDIR:-/tmp}/vigthoria-balanced-live.XXXXXX")"
|
|
22
|
+
trap 'rm -rf "$PROBE_TMP"' EXIT
|
|
23
|
+
|
|
24
|
+
for attempt in 1 2 3; do
|
|
25
|
+
if node dist/index.js chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >"$PROBE_TMP/balanced.json"; then
|
|
26
|
+
break
|
|
27
|
+
fi
|
|
28
|
+
if [[ "$attempt" == "3" ]]; then
|
|
29
|
+
block "balanced-4b remained unavailable after 3 bounded attempts"
|
|
30
|
+
fi
|
|
31
|
+
echo "[retry] balanced-4b transient failure ($attempt/3)"
|
|
32
|
+
sleep 2
|
|
33
|
+
done
|
|
34
|
+
|
|
35
|
+
BALANCED_RESULT="$PROBE_TMP/balanced.json" node --input-type=module - <<'EOF'
|
|
36
|
+
import fs from 'node:fs';
|
|
37
|
+
const result = JSON.parse(fs.readFileSync(process.env.BALANCED_RESULT, 'utf8'));
|
|
38
|
+
if (result.success !== true) throw new Error(`balanced probe failed: ${JSON.stringify(result)}`);
|
|
39
|
+
const allowed = new Set(['Vigthoria-v4-Assistant-9B', 'vigthoria-balanced-4b', 'vigthoria-v3-balanced-4b']);
|
|
40
|
+
if (!allowed.has(result.model)) throw new Error(`unexpected balanced model: ${result.model}`);
|
|
41
|
+
console.log('[pass] credentialed balanced-4b live probe');
|
|
42
|
+
EOF
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
+
cd "$ROOT"
|
|
6
|
+
|
|
7
|
+
block() {
|
|
8
|
+
echo "BLOCKED: $*" >&2
|
|
9
|
+
exit 2
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[[ -n "${VIGTHORIA_AUTH_TOKEN:-}" ]] || block "an authorized live-test credential is required"
|
|
13
|
+
[[ -n "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL:-}" ]] || block "the live models endpoint is not configured"
|
|
14
|
+
[[ -n "${VIGTHORIA_V3_AGENT_URL:-}" ]] || block "the live V3 endpoint is not configured"
|
|
15
|
+
[[ -n "${VIGTHORIA_TEMPLATE_SERVICE_URL:-}" ]] || block "the live Template Service endpoint is not configured"
|
|
16
|
+
[[ -x dist/index.js ]] || block "dist/index.js is unavailable; build the candidate first"
|
|
17
|
+
|
|
18
|
+
LIVE_TMP="$(mktemp -d "${TMPDIR:-/tmp}/vigthoria-live-services.XXXXXX")"
|
|
19
|
+
trap 'rm -rf "$LIVE_TMP"' EXIT
|
|
20
|
+
export VIGTHORIA_NO_BANNER=1
|
|
21
|
+
export VIGTHORIA_NO_UPDATE_CHECK=1
|
|
22
|
+
|
|
23
|
+
echo "[AUTH PREFLIGHT] invalid session message"
|
|
24
|
+
VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight node dist/index.js chat --no-agent --model balanced-4b --prompt "ok" --json >"$LIVE_TMP/auth.json" 2>/dev/null || true
|
|
25
|
+
AUTH_RESULT="$LIVE_TMP/auth.json" node --input-type=module - <<'EOF'
|
|
26
|
+
import fs from 'node:fs';
|
|
27
|
+
const result = JSON.parse(fs.readFileSync(process.env.AUTH_RESULT, 'utf8'));
|
|
28
|
+
const expected = 'Vigthoria Gate way user authentification failed. Please log out and login again.';
|
|
29
|
+
if (result.success !== false || result.error !== expected) throw new Error(`unexpected auth preflight: ${JSON.stringify(result)}`);
|
|
30
|
+
console.log('[pass] live auth preflight message');
|
|
31
|
+
EOF
|
|
32
|
+
|
|
33
|
+
echo "[6.2] balanced-4b credentialed probe"
|
|
34
|
+
bash scripts/release/test-balanced-model-live.sh
|
|
35
|
+
|
|
36
|
+
echo "[6.9/6.12] live aliases"
|
|
37
|
+
node dist/index.js hyper-loop status >"$LIVE_TMP/hyperloop.txt"
|
|
38
|
+
node dist/index.js devtools status >"$LIVE_TMP/devtools.txt"
|
|
39
|
+
|
|
40
|
+
echo "[7.1/7.3/7.4] configured live service health"
|
|
41
|
+
for url in "${VIGTHORIA_V3_AGENT_URL%/}/health" "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/health" "${VIGTHORIA_TEMPLATE_SERVICE_URL%/}/health"; do
|
|
42
|
+
if ! code="$(curl --silent --show-error --connect-timeout 5 --max-time 15 --output /dev/null --write-out '%{http_code}' "$url")"; then
|
|
43
|
+
block "live infrastructure is unavailable at $url"
|
|
44
|
+
fi
|
|
45
|
+
echo "$url => $code"
|
|
46
|
+
[[ "$code" == "200" ]] || block "live infrastructure returned HTTP $code at $url"
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
echo "[7.2/7.8/12.3] live models inventory"
|
|
50
|
+
MODELS_INVENTORY="${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/v1/models"
|
|
51
|
+
if ! curl --silent --show-error --fail --connect-timeout 5 --max-time 15 "$MODELS_INVENTORY" >"$LIVE_TMP/models.json"; then
|
|
52
|
+
block "model inventory is unavailable"
|
|
53
|
+
fi
|
|
54
|
+
MODELS_RESULT="$LIVE_TMP/models.json" node --input-type=module - <<'EOF'
|
|
55
|
+
import fs from 'node:fs';
|
|
56
|
+
const ids = new Set((JSON.parse(fs.readFileSync(process.env.MODELS_RESULT, 'utf8')).data || []).map((model) => model.id || ''));
|
|
57
|
+
const hasRouter = ['Vigthoria-v4-Assistant-9B', 'vigthoria-balanced-4b', 'vigthoria-balanced-4b:latest', 'vigthoria-v3-balanced-4b', 'vigthoria-v3-balanced-4b:latest', 'vigthoria-fast-9b', 'vigthoria-fast-9b:latest'].some((model) => ids.has(model));
|
|
58
|
+
const hasCreative = ['Vigthoria-v4-Creative-27B', 'vigthoria-creative-9b-v4', 'vigthoria-creative-9b-v4:latest', 'vigthoria-fast-9b', 'vigthoria-fast-9b:latest'].some((model) => ids.has(model));
|
|
59
|
+
const hasCode = ids.has('Vigthoria-v4-Code-27B') || [...ids].some((model) => /^vigthoria-v3(?:\.\d+)?-code-35b(?:-|:|$)/.test(model));
|
|
60
|
+
if (!hasRouter || !hasCreative || !hasCode) throw new Error(`required model families missing: ${JSON.stringify([...ids].sort())}`);
|
|
61
|
+
console.log('[pass] live model inventory gates');
|
|
62
|
+
EOF
|
|
63
|
+
|
|
64
|
+
echo "[7.5 policy] secured hosted HyperLoop endpoint"
|
|
65
|
+
if ! code="$(curl --silent --show-error --connect-timeout 5 --max-time 15 --output /dev/null --write-out '%{http_code}' https://coder.vigthoria.io/api/hyperloop/health)"; then
|
|
66
|
+
block "hosted HyperLoop endpoint is unavailable"
|
|
67
|
+
fi
|
|
68
|
+
echo "unauth_hyperloop_code=$code"
|
|
69
|
+
[[ "$code" == "401" || "$code" == "302" ]]
|
|
70
|
+
|
|
71
|
+
echo "[12.1] live no-agent governance fallback"
|
|
72
|
+
for attempt in 1 2 3; do
|
|
73
|
+
if node dist/index.js chat --no-agent --model creative-v4 --prompt "say ok" --json >"$LIVE_TMP/creative.json"; then
|
|
74
|
+
break
|
|
75
|
+
fi
|
|
76
|
+
if [[ "$attempt" == "3" ]]; then
|
|
77
|
+
block "governance fallback remained unavailable after 3 bounded attempts"
|
|
78
|
+
fi
|
|
79
|
+
echo "[retry] governance fallback transient failure ($attempt/3)"
|
|
80
|
+
sleep 2
|
|
81
|
+
done
|
|
82
|
+
CREATIVE_RESULT="$LIVE_TMP/creative.json" node --input-type=module - <<'EOF'
|
|
83
|
+
import fs from 'node:fs';
|
|
84
|
+
const result = JSON.parse(fs.readFileSync(process.env.CREATIVE_RESULT, 'utf8'));
|
|
85
|
+
if (result.success !== true || result.model !== 'Vigthoria-v4-Code-27B') throw new Error(`unexpected governance result: ${JSON.stringify(result)}`);
|
|
86
|
+
if (result.metadata?.modelFallback?.reason !== 'governance-blocked-model') throw new Error(`missing governance fallback metadata: ${JSON.stringify(result)}`);
|
|
87
|
+
console.log('[pass] live governance fallback metadata');
|
|
88
|
+
EOF
|
|
89
|
+
|
|
90
|
+
echo "ALL CREDENTIALED LIVE SERVICE GATES PASSED"
|
|
@@ -4,60 +4,112 @@ set -euo pipefail
|
|
|
4
4
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
5
|
cd "$ROOT"
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
echo "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
node -
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
node
|
|
7
|
+
VALIDATION_TMP="$(mktemp -d "${TMPDIR:-/tmp}/vigthoria-no-go.XXXXXX")"
|
|
8
|
+
trap 'rm -rf "$VALIDATION_TMP"' EXIT
|
|
9
|
+
mkdir -p "$VALIDATION_TMP/home"
|
|
10
|
+
|
|
11
|
+
export HOME="$VALIDATION_TMP/home"
|
|
12
|
+
export USERPROFILE="$HOME"
|
|
13
|
+
export npm_config_cache="$VALIDATION_TMP/npm-cache"
|
|
14
|
+
export npm_config_update_notifier=false
|
|
15
|
+
export VIGTHORIA_NO_BANNER=1
|
|
16
|
+
export VIGTHORIA_NO_UPDATE_CHECK=1
|
|
17
|
+
export VIGTHORIA_OFFLINE=1
|
|
18
|
+
unset VIGTHORIA_AUTH_TOKEN VIGTHORIA_TOKEN VIGTHORIA_LOCAL_TEST_MODE
|
|
19
|
+
unset VIGTHORIA_LOCAL_TEST_TOKEN V3_SERVICE_KEY HYPERLOOP_SERVICE_KEY
|
|
20
|
+
unset VIGTHORIA_API_URL VIGTHORIA_MODELS_API_URL
|
|
21
|
+
unset VIGTHORIA_SELF_HOSTED_MODELS_API_URL VIGTHORIA_V3_AGENT_URL
|
|
22
|
+
|
|
23
|
+
echo "[0.1] clean build"
|
|
24
|
+
npm run build >"$VALIDATION_TMP/build.log" 2>&1
|
|
25
|
+
|
|
26
|
+
echo "[0.2] source/dist consistency"
|
|
27
|
+
node scripts/release/verify-runtime-consistency.mjs >"$VALIDATION_TMP/runtime.json"
|
|
28
|
+
cat "$VALIDATION_TMP/runtime.json"
|
|
29
|
+
|
|
30
|
+
echo "[0.3] package, lockfile, and runtime identity"
|
|
31
|
+
node --input-type=module - <<'EOF'
|
|
32
|
+
import fs from 'node:fs';
|
|
33
|
+
import { spawnSync } from 'node:child_process';
|
|
34
|
+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
35
|
+
const lock = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'));
|
|
36
|
+
const runtime = spawnSync(process.execPath, ['dist/index.js', '--version'], { encoding: 'utf8' });
|
|
37
|
+
if (runtime.status !== 0) throw new Error(runtime.stderr || 'runtime --version failed');
|
|
38
|
+
const versions = [pkg.version, lock.version, lock.packages?.['']?.version, runtime.stdout.trim()];
|
|
39
|
+
if (new Set(versions).size !== 1) throw new Error(`identity mismatch: ${versions.join(', ')}`);
|
|
40
|
+
console.log(`[pass] identity ${versions[0]}`);
|
|
41
|
+
EOF
|
|
42
|
+
|
|
43
|
+
echo "[0.4] strict TypeScript compilation"
|
|
44
|
+
./node_modules/.bin/tsc --noEmit
|
|
45
|
+
|
|
46
|
+
echo "[0.5] source, import, command, JSON, and golden contracts"
|
|
47
|
+
node scripts/run-test-suite.mjs check
|
|
48
|
+
node scripts/architecture/verify-source-boundaries.mjs
|
|
49
|
+
node scripts/architecture/verify-import-graph.mjs --check
|
|
50
|
+
node scripts/architecture/capture-command-manifest.mjs --check
|
|
51
|
+
node scripts/architecture/verify-json-contracts.mjs
|
|
52
|
+
node scripts/architecture/capture-golden-contracts.mjs --check
|
|
53
|
+
|
|
54
|
+
echo "[0.6] package hygiene"
|
|
55
|
+
node scripts/verify-package-hygiene.js
|
|
56
|
+
|
|
57
|
+
echo "[0.7] authoritative Phase 1 security contracts"
|
|
58
|
+
node scripts/test-dependency-security.mjs
|
|
59
|
+
node scripts/test-network-policy.mjs
|
|
60
|
+
node scripts/test-installer-trust-policy.mjs
|
|
61
|
+
node scripts/test-workspace-archive-containment.mjs
|
|
62
|
+
node scripts/test-public-repo-clone.mjs
|
|
63
|
+
node scripts/test-process-approval-safety.mjs
|
|
64
|
+
node scripts/test-mutation-preview-transaction.mjs
|
|
65
|
+
node scripts/test-preview-screenshot-adapter.mjs
|
|
66
|
+
node scripts/test-frontend-preview-service.mjs
|
|
67
|
+
node scripts/test-prompt-workspace-resolver.mjs
|
|
68
|
+
node scripts/test-context-secret-hygiene.mjs
|
|
69
|
+
node scripts/test-vigflow-client.mjs
|
|
70
|
+
node scripts/test-operator-client.mjs
|
|
71
|
+
node scripts/test-mcp-context-client.mjs
|
|
72
|
+
node scripts/test-code-operations-service.mjs
|
|
73
|
+
node scripts/test-capability-health-service.mjs
|
|
74
|
+
node scripts/test-model-transport-service.mjs
|
|
75
|
+
node scripts/test-chat-tool-call-parser.mjs
|
|
76
|
+
node scripts/test-chat-prompt-policy.mjs
|
|
77
|
+
node scripts/test-tool-capability-providers.mjs
|
|
78
|
+
node scripts/test-agent-stream-state.mjs
|
|
79
|
+
node scripts/test-direct-output-policy.mjs
|
|
80
|
+
|
|
81
|
+
echo "[0.8] authoritative Phase 2 state/auth/session contracts"
|
|
82
|
+
node scripts/test-durable-json-state.mjs
|
|
83
|
+
node scripts/test-auth-state.mjs
|
|
84
|
+
node scripts/test-session-durable-lifecycle.mjs
|
|
85
|
+
node scripts/test-session-project-match.mjs
|
|
86
|
+
node scripts/test-external-client-resume.mjs
|
|
87
|
+
node scripts/test-context-state-ownership.mjs
|
|
88
|
+
node scripts/test-game-command.mjs
|
|
89
|
+
|
|
90
|
+
echo "[0.9] Phase 3 command error/exit/JSON foundation"
|
|
91
|
+
node scripts/test-command-contract.mjs
|
|
92
|
+
node scripts/test-update-policy.mjs
|
|
93
|
+
node scripts/test-release-delivery.mjs
|
|
94
|
+
node scripts/test-timeout-cancellation.mjs
|
|
95
|
+
|
|
96
|
+
echo "[1.1] ranker includes agent.py in top 10 for an SSE prompt"
|
|
97
|
+
RANKER_FIXTURE="$VALIDATION_TMP/ranker" node --input-type=module - <<'EOF'
|
|
98
|
+
import fs from 'node:fs';
|
|
99
|
+
import path from 'node:path';
|
|
100
|
+
import { buildSemanticContext } from './dist/utils/context-ranker.js';
|
|
101
|
+
const fixture = process.env.RANKER_FIXTURE;
|
|
102
|
+
fs.mkdirSync(fixture, { recursive: true });
|
|
103
|
+
fs.writeFileSync(path.join(fixture, 'agent.py'), 'def stream_sse_event():\n return "event: done"\n');
|
|
104
|
+
fs.writeFileSync(path.join(fixture, 'unrelated.txt'), 'static documentation\n');
|
|
105
|
+
const result = buildSemanticContext(fixture, 'fix the streaming SSE event handler', 10);
|
|
106
|
+
const index = result.topFiles.findIndex((file) => file.path === 'agent.py');
|
|
107
|
+
console.log(`agent_idx_top10=${index}`);
|
|
108
|
+
if (index < 0) process.exit(1);
|
|
109
|
+
EOF
|
|
110
|
+
|
|
111
|
+
echo "[2.1/2.4] TypeScript post-write validator"
|
|
112
|
+
node --input-type=module - <<'EOF'
|
|
61
113
|
import fs from 'node:fs';
|
|
62
114
|
import os from 'node:os';
|
|
63
115
|
import path from 'node:path';
|
|
@@ -66,127 +118,36 @@ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'vig-tsc-'));
|
|
|
66
118
|
fs.mkdirSync(path.join(tmp, 'src'));
|
|
67
119
|
fs.writeFileSync(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { target: 'ES2020', module: 'ESNext' }, include: ['src/**/*.ts'] }));
|
|
68
120
|
fs.writeFileSync(path.join(tmp, 'src', 'index.ts'), 'export const ok:number = 1;\n');
|
|
69
|
-
const
|
|
70
|
-
const tsc =
|
|
121
|
+
const results = await runPostWriteValidation(tmp);
|
|
122
|
+
const tsc = results.find((result) => result.tool === 'tsc');
|
|
71
123
|
console.log(JSON.stringify(tsc || null));
|
|
72
124
|
if (!tsc || !tsc.ran || !tsc.passed) process.exit(1);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
echo "[6.2]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
print('[pass] balanced-4b')
|
|
93
|
-
PY
|
|
94
|
-
|
|
95
|
-
echo "[6.9/6.12] aliases available"
|
|
96
|
-
$CLI hyper-loop status >/tmp/vig-hyperloop.txt
|
|
97
|
-
$CLI devtools connect >/tmp/vig-devtools.txt
|
|
98
|
-
|
|
99
|
-
echo "[6.11] operator flow"
|
|
100
|
-
if [[ "$SERVICE_IDENTITY_MODE" == "1" ]]; then
|
|
101
|
-
echo "[skip] paid-user operator probe (isolated release service identity)"
|
|
102
|
-
else
|
|
103
|
-
$CLI operator --prompt "reply with exactly: OK" --json >/tmp/vig-operator.json
|
|
104
|
-
python3 - << 'PY'
|
|
105
|
-
import json
|
|
106
|
-
j=json.load(open('/tmp/vig-operator.json'))
|
|
107
|
-
assert j.get('success') is True, j
|
|
108
|
-
print('[pass] operator flow')
|
|
109
|
-
PY
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
echo "[7.1/7.3/7.4] local service health"
|
|
113
|
-
for u in http://localhost:8030/health http://localhost:4009/health http://localhost:4011/health; do
|
|
114
|
-
code=$(curl -s -o /dev/null -w "%{http_code}" "$u")
|
|
115
|
-
echo "$u => $code"
|
|
116
|
-
[[ "$code" == "200" ]]
|
|
117
|
-
done
|
|
118
|
-
|
|
119
|
-
echo "[7.2/7.8/12.3] models inventory"
|
|
120
|
-
curl -s http://localhost:4009/v1/models >/tmp/vig-models.json
|
|
121
|
-
python3 - << 'PY'
|
|
122
|
-
import json
|
|
123
|
-
import re
|
|
124
|
-
ids={m.get('id','') for m in json.load(open('/tmp/vig-models.json')).get('data',[])}
|
|
125
|
-
if ids:
|
|
126
|
-
has_router = any(
|
|
127
|
-
m in ids for m in (
|
|
128
|
-
'Vigthoria-v4-Assistant-9B',
|
|
129
|
-
'vigthoria-balanced-4b', 'vigthoria-balanced-4b:latest',
|
|
130
|
-
'vigthoria-v3-balanced-4b', 'vigthoria-v3-balanced-4b:latest',
|
|
131
|
-
'vigthoria-fast-9b', 'vigthoria-fast-9b:latest',
|
|
132
|
-
)
|
|
133
|
-
)
|
|
134
|
-
has_creative = any(
|
|
135
|
-
m in ids for m in (
|
|
136
|
-
'Vigthoria-v4-Creative-27B',
|
|
137
|
-
'vigthoria-creative-9b-v4', 'vigthoria-creative-9b-v4:latest',
|
|
138
|
-
'vigthoria-fast-9b', 'vigthoria-fast-9b:latest',
|
|
139
|
-
)
|
|
140
|
-
)
|
|
141
|
-
has_code = 'Vigthoria-v4-Code-27B' in ids or any(re.search(r'^vigthoria-v3(?:\.\d+)?-code-35b(?:-|:|$)', i) for i in ids)
|
|
142
|
-
assert has_router, f'missing router model in inventory: {sorted(ids)}'
|
|
143
|
-
assert has_creative, f'missing creative/fast model in inventory: {sorted(ids)}'
|
|
144
|
-
assert has_code, f'missing code model in inventory: {sorted(ids)}'
|
|
145
|
-
else:
|
|
146
|
-
print('[warn] model inventory empty on this host; route proof above is authoritative')
|
|
147
|
-
print('[pass] model inventory gates')
|
|
148
|
-
PY
|
|
149
|
-
|
|
150
|
-
echo "[7.5 policy] secured hyperloop endpoint"
|
|
151
|
-
code=$(curl -s -o /dev/null -w "%{http_code}" https://coder.vigthoria.io/api/hyperloop/health)
|
|
152
|
-
echo "unauth_hyperloop_code=$code"
|
|
153
|
-
# 401 = correct JSON auth error for API callers. 302 (redirect to /login) is
|
|
154
|
-
# also acceptable defense-in-depth: it still requires auth, just via the
|
|
155
|
-
# browser-session redirect path some legacy middleware uses.
|
|
156
|
-
[[ "$code" == "401" || "$code" == "302" ]]
|
|
125
|
+
EOF
|
|
126
|
+
|
|
127
|
+
echo "[6.2/12.1] deterministic routing and model-governance contracts"
|
|
128
|
+
node scripts/test-request-intent.js
|
|
129
|
+
VIGTHORIA_AGENT_LLM_ROUTER=0 node scripts/test-agent-route.js
|
|
130
|
+
VIGTHORIA_AGENT_LLM_ROUTER=0 node scripts/test-local-use-cases.js
|
|
131
|
+
node scripts/test-fast-router-capability.js
|
|
132
|
+
node scripts/test-agent-routing-policy.js
|
|
133
|
+
node scripts/test-model-governance-no-agent.js
|
|
134
|
+
node scripts/test-model-governance.mjs
|
|
135
|
+
|
|
136
|
+
echo "[context] deterministic budget, path, stream, error, and outcome contracts"
|
|
137
|
+
node scripts/test-context-budget.js
|
|
138
|
+
node scripts/test-v3-workspace-path.js
|
|
139
|
+
node scripts/test-v3-stream-events.js
|
|
140
|
+
node scripts/test-v3-agent-client.mjs
|
|
141
|
+
node scripts/test-v3-workspace-service.mjs
|
|
142
|
+
node scripts/test-error-wording.mjs
|
|
143
|
+
node scripts/test-agent-run-outcome.js
|
|
157
144
|
|
|
158
145
|
echo "[8.2] runtime symlink guard signals"
|
|
159
|
-
rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js
|
|
160
|
-
cat /
|
|
161
|
-
|
|
162
|
-
echo "[9.5/9.7/9.16] release URL consistency"
|
|
163
|
-
rg -n "
|
|
164
|
-
cat /
|
|
165
|
-
|
|
166
|
-
echo "
|
|
167
|
-
for attempt in 1 2 3; do
|
|
168
|
-
if $CLI chat --no-agent --model creative-v4 --prompt "say ok" --json >/tmp/vig-creative.json; then
|
|
169
|
-
break
|
|
170
|
-
fi
|
|
171
|
-
if [[ "$attempt" == "3" ]]; then
|
|
172
|
-
echo "[fail] governance fallback remained unavailable after 3 attempts"
|
|
173
|
-
exit 1
|
|
174
|
-
fi
|
|
175
|
-
echo "[retry] governance fallback transient failure ($attempt/3)"
|
|
176
|
-
sleep 2
|
|
177
|
-
done
|
|
178
|
-
python3 - << 'PY'
|
|
179
|
-
import json
|
|
180
|
-
j=json.load(open('/tmp/vig-creative.json'))
|
|
181
|
-
assert j.get('success') is True
|
|
182
|
-
assert j.get('model') == 'Vigthoria-v4-Code-27B', j
|
|
183
|
-
md=j.get('metadata') or {}
|
|
184
|
-
fb=md.get('modelFallback') or {}
|
|
185
|
-
assert fb.get('reason') == 'governance-blocked-model', j
|
|
186
|
-
print('[pass] governance fallback metadata')
|
|
187
|
-
PY
|
|
188
|
-
|
|
189
|
-
echo "[outcome-truth] agent run outcome regression"
|
|
190
|
-
npm run test:agent:outcome
|
|
191
|
-
|
|
192
|
-
echo "ALL NO-GO GATES PASSED"
|
|
146
|
+
rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >"$VALIDATION_TMP/ranker-signals.txt"
|
|
147
|
+
cat "$VALIDATION_TMP/ranker-signals.txt"
|
|
148
|
+
|
|
149
|
+
echo "[9.5/9.7/9.16] release policy and canonical URL consistency"
|
|
150
|
+
rg -n "extension.vigthoria.io/downloads/manifest.json|release-policy.json|resolve-release-manifest" release-policy.json install.ps1 install.sh src/utils/release-policy.ts scripts/release >"$VALIDATION_TMP/release-urls.txt"
|
|
151
|
+
cat "$VALIDATION_TMP/release-urls.txt"
|
|
152
|
+
|
|
153
|
+
echo "ALL HERMETIC NO-GO GATES PASSED"
|
|
@@ -38,6 +38,8 @@ const requiredDist = ['context-ranker.js', 'post-write-validator.js', 'task-disp
|
|
|
38
38
|
const sourceSnapshotExpected = !isNodeModulesInstall && exists(srcUtils);
|
|
39
39
|
const missingSrc = sourceSnapshotExpected ? requiredSrc.filter((f) => !exists(path.join(srcUtils, f))) : [];
|
|
40
40
|
const missingDist = requiredDist.filter((f) => !exists(path.join(distUtils, f)));
|
|
41
|
+
const requiredDelivery = ['release-policy.json', 'completions/vigthoria.bash', 'completions/_vigthoria', 'completions/vigthoria.fish'];
|
|
42
|
+
const missingDelivery = requiredDelivery.filter((file) => !exists(path.join(projectRoot, file)));
|
|
41
43
|
|
|
42
44
|
const report = {
|
|
43
45
|
targetVersion,
|
|
@@ -48,6 +50,7 @@ const report = {
|
|
|
48
50
|
distUtils,
|
|
49
51
|
missingSrc,
|
|
50
52
|
missingDist,
|
|
53
|
+
missingDelivery,
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
console.log(JSON.stringify(report, null, 2));
|
|
@@ -56,7 +59,7 @@ if (report.packageVersion !== targetVersion) {
|
|
|
56
59
|
console.error(`[verify] FAIL: version mismatch (${report.packageVersion} != ${targetVersion})`);
|
|
57
60
|
process.exit(1);
|
|
58
61
|
}
|
|
59
|
-
if (missingSrc.length > 0 || missingDist.length > 0) {
|
|
62
|
+
if (missingSrc.length > 0 || missingDist.length > 0 || missingDelivery.length > 0) {
|
|
60
63
|
console.error('[verify] FAIL: required utility modules missing');
|
|
61
64
|
process.exit(1);
|
|
62
65
|
}
|
package/dist/commands/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
export interface CommandRegistrationResult {
|
|
3
|
-
name: string;
|
|
4
|
-
registered: boolean;
|
|
5
|
-
error?: Error;
|
|
6
|
-
}
|
|
7
|
-
export type CommandRegistrar = (program: Command) => void;
|
|
8
|
-
export declare function resolveCommand(name: string): CommandRegistrar | null;
|
|
9
|
-
export declare function registerCommands(cli: any): void;
|
|
10
|
-
export declare const setupCommands: typeof registerCommands;
|
|
11
|
-
export declare const configureCommands: typeof registerCommands;
|
|
12
|
-
export default registerCommands;
|