vigthoria-cli 1.13.20 → 1.13.23

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.
Files changed (187) hide show
  1. package/completions/_vigthoria +49 -0
  2. package/completions/vigthoria.bash +6 -0
  3. package/completions/vigthoria.fish +41 -0
  4. package/dist/commands/auth.d.ts +1 -0
  5. package/dist/commands/auth.js +63 -128
  6. package/dist/commands/background.d.ts +0 -2
  7. package/dist/commands/background.js +26 -34
  8. package/dist/commands/bridge.js +45 -41
  9. package/dist/commands/cancel.d.ts +1 -0
  10. package/dist/commands/cancel.js +22 -16
  11. package/dist/commands/chat.d.ts +3 -42
  12. package/dist/commands/chat.js +378 -1123
  13. package/dist/commands/coding-registration.d.ts +4 -0
  14. package/dist/commands/coding-registration.js +24 -0
  15. package/dist/commands/config.js +23 -29
  16. package/dist/commands/conversation-registration.d.ts +4 -0
  17. package/dist/commands/conversation-registration.js +122 -0
  18. package/dist/commands/deploy.d.ts +8 -2
  19. package/dist/commands/deploy.js +92 -90
  20. package/dist/commands/device.d.ts +1 -2
  21. package/dist/commands/device.js +37 -21
  22. package/dist/commands/doctor-registration.d.ts +4 -0
  23. package/dist/commands/doctor-registration.js +207 -0
  24. package/dist/commands/edit.js +22 -33
  25. package/dist/commands/explain.js +7 -10
  26. package/dist/commands/fork.d.ts +1 -2
  27. package/dist/commands/fork.js +72 -22
  28. package/dist/commands/game.d.ts +1 -1
  29. package/dist/commands/game.js +17 -6
  30. package/dist/commands/generate.js +7 -9
  31. package/dist/commands/history.js +11 -7
  32. package/dist/commands/hub.d.ts +2 -2
  33. package/dist/commands/hub.js +34 -35
  34. package/dist/commands/legion.d.ts +0 -1
  35. package/dist/commands/legion.js +62 -79
  36. package/dist/commands/music.d.ts +1 -2
  37. package/dist/commands/music.js +62 -27
  38. package/dist/commands/platform-registration.d.ts +4 -0
  39. package/dist/commands/platform-registration.js +45 -0
  40. package/dist/commands/preview.d.ts +0 -1
  41. package/dist/commands/preview.js +82 -35
  42. package/dist/commands/product-run-registration.d.ts +4 -0
  43. package/dist/commands/product-run-registration.js +490 -0
  44. package/dist/commands/replay.d.ts +1 -2
  45. package/dist/commands/replay.js +15 -11
  46. package/dist/commands/repo.d.ts +14 -7
  47. package/dist/commands/repo.js +244 -198
  48. package/dist/commands/review.js +9 -12
  49. package/dist/commands/security.d.ts +1 -2
  50. package/dist/commands/security.js +12 -6
  51. package/dist/commands/update-registration.d.ts +3 -0
  52. package/dist/commands/update-registration.js +368 -0
  53. package/dist/commands/v4-registration.d.ts +4 -0
  54. package/dist/commands/v4-registration.js +24 -0
  55. package/dist/commands/v4.d.ts +1 -1
  56. package/dist/commands/v4.js +46 -8
  57. package/dist/commands/wallet.d.ts +1 -3
  58. package/dist/commands/wallet.js +18 -45
  59. package/dist/commands/workflow.d.ts +2 -0
  60. package/dist/commands/workflow.js +52 -39
  61. package/dist/index.js +124 -1589
  62. package/dist/utils/agent-stream-state.d.ts +27 -0
  63. package/dist/utils/agent-stream-state.js +93 -0
  64. package/dist/utils/agentRoute.d.ts +2 -1
  65. package/dist/utils/agentRoute.js +22 -9
  66. package/dist/utils/agentRunOutcome.d.ts +16 -0
  67. package/dist/utils/agentRunOutcome.js +37 -2
  68. package/dist/utils/api-client-factory.d.ts +8 -0
  69. package/dist/utils/api-client-factory.js +8 -0
  70. package/dist/utils/api.d.ts +44 -266
  71. package/dist/utils/api.js +647 -3180
  72. package/dist/utils/auth-session.d.ts +41 -0
  73. package/dist/utils/auth-session.js +224 -0
  74. package/dist/utils/brain-hub-client.d.ts +0 -4
  75. package/dist/utils/brain-hub-client.js +6 -3
  76. package/dist/utils/bridge-client.js +2 -0
  77. package/dist/utils/capability-health-service.d.ts +48 -0
  78. package/dist/utils/capability-health-service.js +64 -0
  79. package/dist/utils/chat-prompt-policy.d.ts +18 -0
  80. package/dist/utils/chat-prompt-policy.js +61 -0
  81. package/dist/utils/chat-tool-call-parser.d.ts +11 -0
  82. package/dist/utils/chat-tool-call-parser.js +71 -0
  83. package/dist/utils/cli-state.d.ts +22 -4
  84. package/dist/utils/cli-state.js +105 -47
  85. package/dist/utils/code-operations-service.d.ts +104 -0
  86. package/dist/utils/code-operations-service.js +837 -0
  87. package/dist/utils/codebase-indexer.d.ts +1 -0
  88. package/dist/utils/codebase-indexer.js +28 -8
  89. package/dist/utils/command-contract.d.ts +61 -0
  90. package/dist/utils/command-contract.js +149 -0
  91. package/dist/utils/command-policy.d.ts +10 -0
  92. package/dist/utils/command-policy.js +54 -0
  93. package/dist/utils/config.d.ts +13 -5
  94. package/dist/utils/config.js +220 -94
  95. package/dist/utils/context-ranker.js +11 -2
  96. package/dist/utils/context-state.d.ts +39 -0
  97. package/dist/utils/context-state.js +52 -0
  98. package/dist/utils/deckEvents.d.ts +0 -5
  99. package/dist/utils/deckEvents.js +3 -2
  100. package/dist/utils/desktop-bridge-client.js +2 -0
  101. package/dist/utils/direct-output-policy.d.ts +3 -0
  102. package/dist/utils/direct-output-policy.js +76 -0
  103. package/dist/utils/durable-json.d.ts +57 -0
  104. package/dist/utils/durable-json.js +319 -0
  105. package/dist/utils/fastAgentRouter.d.ts +5 -6
  106. package/dist/utils/fastAgentRouter.js +17 -25
  107. package/dist/utils/files.js +21 -13
  108. package/dist/utils/frontend-preview-service.d.ts +76 -0
  109. package/dist/utils/frontend-preview-service.js +482 -0
  110. package/dist/utils/goaEvents.d.ts +0 -4
  111. package/dist/utils/goaEvents.js +5 -2
  112. package/dist/utils/logger.d.ts +2 -1
  113. package/dist/utils/logger.js +27 -20
  114. package/dist/utils/mcp-context-client.d.ts +24 -0
  115. package/dist/utils/mcp-context-client.js +58 -0
  116. package/dist/utils/model-governance.d.ts +18 -0
  117. package/dist/utils/model-governance.js +75 -0
  118. package/dist/utils/model-transport-service.d.ts +44 -0
  119. package/dist/utils/model-transport-service.js +111 -0
  120. package/dist/utils/mutation-journal.d.ts +42 -0
  121. package/dist/utils/mutation-journal.js +387 -0
  122. package/dist/utils/network-policy.d.ts +24 -0
  123. package/dist/utils/network-policy.js +202 -0
  124. package/dist/utils/operator-client.d.ts +45 -0
  125. package/dist/utils/operator-client.js +159 -0
  126. package/dist/utils/post-write-validator.js +7 -9
  127. package/dist/utils/preview-screenshot-adapter.d.ts +15 -0
  128. package/dist/utils/preview-screenshot-adapter.js +51 -0
  129. package/dist/utils/process-policy.d.ts +23 -0
  130. package/dist/utils/process-policy.js +284 -0
  131. package/dist/utils/project-memory.d.ts +13 -3
  132. package/dist/utils/project-memory.js +70 -17
  133. package/dist/utils/prompt-workspace-resolver.d.ts +14 -0
  134. package/dist/utils/prompt-workspace-resolver.js +64 -0
  135. package/dist/utils/release-install.d.ts +11 -0
  136. package/dist/utils/release-install.js +155 -0
  137. package/dist/utils/release-policy.d.ts +64 -0
  138. package/dist/utils/release-policy.js +293 -0
  139. package/dist/utils/requestIntent.js +22 -3
  140. package/dist/utils/runtime-capability.d.ts +8 -0
  141. package/dist/utils/runtime-capability.js +16 -0
  142. package/dist/utils/runtime-temp.d.ts +76 -0
  143. package/dist/utils/runtime-temp.js +492 -0
  144. package/dist/utils/secret-policy.d.ts +20 -0
  145. package/dist/utils/secret-policy.js +160 -0
  146. package/dist/utils/session.d.ts +17 -3
  147. package/dist/utils/session.js +354 -110
  148. package/dist/utils/tool-approval-service.d.ts +17 -0
  149. package/dist/utils/tool-approval-service.js +78 -0
  150. package/dist/utils/tool-capability-providers.d.ts +57 -0
  151. package/dist/utils/tool-capability-providers.js +57 -0
  152. package/dist/utils/tools.d.ts +2 -23
  153. package/dist/utils/tools.js +226 -512
  154. package/dist/utils/update-policy.d.ts +18 -0
  155. package/dist/utils/update-policy.js +137 -0
  156. package/dist/utils/v3-agent-client.d.ts +40 -0
  157. package/dist/utils/v3-agent-client.js +165 -0
  158. package/dist/utils/v3-workspace-service.d.ts +28 -0
  159. package/dist/utils/v3-workspace-service.js +279 -0
  160. package/dist/utils/vigflow-client.d.ts +95 -0
  161. package/dist/utils/vigflow-client.js +105 -0
  162. package/dist/utils/workspace-boundary.d.ts +45 -0
  163. package/dist/utils/workspace-boundary.js +377 -0
  164. package/dist/utils/workspace-brain-service.d.ts +2 -0
  165. package/dist/utils/workspace-brain-service.js +11 -1
  166. package/dist/utils/workspace-cache.js +37 -15
  167. package/dist/utils/workspace-stream.js +35 -10
  168. package/install.ps1 +115 -142
  169. package/install.sh +112 -81
  170. package/package.json +43 -9
  171. package/release-policy.json +43 -0
  172. package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
  173. package/scripts/release/generate-completions.mjs +24 -0
  174. package/scripts/release/install-release.mjs +10 -0
  175. package/scripts/release/publish-cli-release.mjs +116 -0
  176. package/scripts/release/publish-cli-release.sh +2 -70
  177. package/scripts/release/resolve-release-manifest.mjs +26 -0
  178. package/scripts/release/test-balanced-model-live.sh +45 -0
  179. package/scripts/release/validate-live-service-gates.sh +93 -0
  180. package/scripts/release/validate-no-go-gates.sh +145 -174
  181. package/scripts/release/verify-runtime-consistency.mjs +4 -1
  182. package/dist/commands/index.d.ts +0 -12
  183. package/dist/commands/index.js +0 -194
  184. package/dist/commands/update.d.ts +0 -9
  185. package/dist/commands/update.js +0 -301
  186. package/dist/utils/templateInstantPath.d.ts +0 -18
  187. package/dist/utils/templateInstantPath.js +0 -228
@@ -1,73 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
- # Publish Vigthoria CLI release artifact + manifest entry.
5
- # Usage:
6
- # HOST_DOWNLOADS_DIR=/path/to/downloads \
7
- # HOST_MANIFEST_FILE=/path/to/releases/manifest.json \
8
- # ./scripts/release/publish-cli-release.sh 1.9.0
9
-
10
- VERSION="${1:-}"
11
- if [[ -z "$VERSION" ]]; then
12
- echo "Usage: $0 <version>"
13
- exit 1
14
- fi
15
-
16
- REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
17
- PKG_FILE="$REPO_ROOT/vigthoria-cli-${VERSION}.tgz"
18
- HOST_DOWNLOADS_DIR="${HOST_DOWNLOADS_DIR:-}"
19
- HOST_MANIFEST_FILE="${HOST_MANIFEST_FILE:-}"
20
- PUBLIC_BASE_URL="${PUBLIC_BASE_URL:-https://extension.vigthoria.io/downloads}"
21
- CHANNEL="${CHANNEL:-stable}"
22
-
23
- if [[ ! -f "$PKG_FILE" ]]; then
24
- echo "Artifact not found: $PKG_FILE"
25
- echo "Run: npm pack"
26
- exit 1
27
- fi
28
-
29
- if [[ -z "$HOST_DOWNLOADS_DIR" || -z "$HOST_MANIFEST_FILE" ]]; then
30
- echo "Set HOST_DOWNLOADS_DIR and HOST_MANIFEST_FILE before running."
31
- exit 1
32
- fi
33
-
34
- SHA256="$(sha256sum "$PKG_FILE" | awk '{print $1}')"
35
- URL="$PUBLIC_BASE_URL/vigthoria-cli-${VERSION}.tgz"
36
-
37
- echo "Publishing vigthoria-cli v${VERSION}"
38
- echo "Artifact: $PKG_FILE"
39
- echo "SHA256: $SHA256"
40
- echo "URL: $URL"
41
-
42
- install -d "$HOST_DOWNLOADS_DIR"
43
- cp -f "$PKG_FILE" "$HOST_DOWNLOADS_DIR/"
44
-
45
- echo "Copied artifact to $HOST_DOWNLOADS_DIR"
46
-
47
- if [[ ! -f "$HOST_MANIFEST_FILE" ]]; then
48
- echo "Manifest does not exist at: $HOST_MANIFEST_FILE"
49
- echo "Create it first with {\"channels\":{\"stable\":{}}}"
50
- exit 1
51
- fi
52
-
53
- python3 - << PYEOF
54
- import json, pathlib
55
- manifest_path = pathlib.Path(r"$HOST_MANIFEST_FILE")
56
- data = json.loads(manifest_path.read_text())
57
- data.setdefault("channels", {})
58
- data["channels"].setdefault("$CHANNEL", {})
59
- data["channels"]["$CHANNEL"].update({
60
- "version": "$VERSION",
61
- "url": "$URL",
62
- "sha256": "$SHA256",
63
- "notes": "Automated publish via scripts/release/publish-cli-release.sh"
64
- })
65
- manifest_path.write_text(json.dumps(data, indent=2) + "\n")
66
- print("Manifest updated:", manifest_path)
67
- PYEOF
68
-
69
- echo "Publish complete."
70
- echo "Verification commands:"
71
- echo " curl -I $URL"
72
- echo " curl -fsSL https://coder.vigthoria.io/releases/manifest.json | head -40"
73
- echo " node dist/index.js update --check --manifest https://coder.vigthoria.io/releases/manifest.json --channel $CHANNEL"
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
+ exec node "$ROOT/scripts/release/publish-cli-release.mjs" "$@"
@@ -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,45 @@
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_TEMP_ROOT="${VIGTHORIA_TEMP_DIR:-$HOME/.vigthoria/tmp}/live-tests"
22
+ mkdir -p "$PROBE_TEMP_ROOT"
23
+ chmod 700 "$PROBE_TEMP_ROOT"
24
+ PROBE_TMP="$(mktemp -d "$PROBE_TEMP_ROOT/balanced.XXXXXX")"
25
+ trap 'rm -rf "$PROBE_TMP"' EXIT
26
+
27
+ for attempt in 1 2 3; do
28
+ if node dist/index.js chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >"$PROBE_TMP/balanced.json"; then
29
+ break
30
+ fi
31
+ if [[ "$attempt" == "3" ]]; then
32
+ block "balanced-4b remained unavailable after 3 bounded attempts"
33
+ fi
34
+ echo "[retry] balanced-4b transient failure ($attempt/3)"
35
+ sleep 2
36
+ done
37
+
38
+ BALANCED_RESULT="$PROBE_TMP/balanced.json" node --input-type=module - <<'EOF'
39
+ import fs from 'node:fs';
40
+ const result = JSON.parse(fs.readFileSync(process.env.BALANCED_RESULT, 'utf8'));
41
+ if (result.success !== true) throw new Error(`balanced probe failed: ${JSON.stringify(result)}`);
42
+ const allowed = new Set(['Vigthoria-v4-Assistant-9B', 'vigthoria-balanced-4b', 'vigthoria-v3-balanced-4b']);
43
+ if (!allowed.has(result.model)) throw new Error(`unexpected balanced model: ${result.model}`);
44
+ console.log('[pass] credentialed balanced-4b live probe');
45
+ EOF
@@ -0,0 +1,93 @@
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_TEMP_ROOT="${VIGTHORIA_TEMP_DIR:-$HOME/.vigthoria/tmp}/live-tests"
19
+ mkdir -p "$LIVE_TEMP_ROOT"
20
+ chmod 700 "$LIVE_TEMP_ROOT"
21
+ LIVE_TMP="$(mktemp -d "$LIVE_TEMP_ROOT/services.XXXXXX")"
22
+ trap 'rm -rf "$LIVE_TMP"' EXIT
23
+ export VIGTHORIA_NO_BANNER=1
24
+ export VIGTHORIA_NO_UPDATE_CHECK=1
25
+
26
+ echo "[AUTH PREFLIGHT] invalid session message"
27
+ 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
28
+ AUTH_RESULT="$LIVE_TMP/auth.json" node --input-type=module - <<'EOF'
29
+ import fs from 'node:fs';
30
+ const result = JSON.parse(fs.readFileSync(process.env.AUTH_RESULT, 'utf8'));
31
+ const expected = 'Vigthoria Gate way user authentification failed. Please log out and login again.';
32
+ if (result.success !== false || result.error !== expected) throw new Error(`unexpected auth preflight: ${JSON.stringify(result)}`);
33
+ console.log('[pass] live auth preflight message');
34
+ EOF
35
+
36
+ echo "[6.2] balanced-4b credentialed probe"
37
+ bash scripts/release/test-balanced-model-live.sh
38
+
39
+ echo "[6.9/6.12] live aliases"
40
+ node dist/index.js hyper-loop status >"$LIVE_TMP/hyperloop.txt"
41
+ node dist/index.js devtools status >"$LIVE_TMP/devtools.txt"
42
+
43
+ echo "[7.1/7.3/7.4] configured live service health"
44
+ for url in "${VIGTHORIA_V3_AGENT_URL%/}/health" "${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/health" "${VIGTHORIA_TEMPLATE_SERVICE_URL%/}/health"; do
45
+ if ! code="$(curl --silent --show-error --connect-timeout 5 --max-time 15 --output /dev/null --write-out '%{http_code}' "$url")"; then
46
+ block "live infrastructure is unavailable at $url"
47
+ fi
48
+ echo "$url => $code"
49
+ [[ "$code" == "200" ]] || block "live infrastructure returned HTTP $code at $url"
50
+ done
51
+
52
+ echo "[7.2/7.8/12.3] live models inventory"
53
+ MODELS_INVENTORY="${VIGTHORIA_SELF_HOSTED_MODELS_API_URL%/}/v1/models"
54
+ if ! curl --silent --show-error --fail --connect-timeout 5 --max-time 15 "$MODELS_INVENTORY" >"$LIVE_TMP/models.json"; then
55
+ block "model inventory is unavailable"
56
+ fi
57
+ MODELS_RESULT="$LIVE_TMP/models.json" node --input-type=module - <<'EOF'
58
+ import fs from 'node:fs';
59
+ const ids = new Set((JSON.parse(fs.readFileSync(process.env.MODELS_RESULT, 'utf8')).data || []).map((model) => model.id || ''));
60
+ 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));
61
+ 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));
62
+ const hasCode = ids.has('Vigthoria-v4-Code-27B') || [...ids].some((model) => /^vigthoria-v3(?:\.\d+)?-code-35b(?:-|:|$)/.test(model));
63
+ if (!hasRouter || !hasCreative || !hasCode) throw new Error(`required model families missing: ${JSON.stringify([...ids].sort())}`);
64
+ console.log('[pass] live model inventory gates');
65
+ EOF
66
+
67
+ echo "[7.5 policy] secured hosted HyperLoop endpoint"
68
+ 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
69
+ block "hosted HyperLoop endpoint is unavailable"
70
+ fi
71
+ echo "unauth_hyperloop_code=$code"
72
+ [[ "$code" == "401" || "$code" == "302" ]]
73
+
74
+ echo "[12.1] live no-agent governance fallback"
75
+ for attempt in 1 2 3; do
76
+ if node dist/index.js chat --no-agent --model creative-v4 --prompt "say ok" --json >"$LIVE_TMP/creative.json"; then
77
+ break
78
+ fi
79
+ if [[ "$attempt" == "3" ]]; then
80
+ block "governance fallback remained unavailable after 3 bounded attempts"
81
+ fi
82
+ echo "[retry] governance fallback transient failure ($attempt/3)"
83
+ sleep 2
84
+ done
85
+ CREATIVE_RESULT="$LIVE_TMP/creative.json" node --input-type=module - <<'EOF'
86
+ import fs from 'node:fs';
87
+ const result = JSON.parse(fs.readFileSync(process.env.CREATIVE_RESULT, 'utf8'));
88
+ if (result.success !== true || result.model !== 'Vigthoria-v4-Code-27B') throw new Error(`unexpected governance result: ${JSON.stringify(result)}`);
89
+ if (result.metadata?.modelFallback?.reason !== 'governance-blocked-model') throw new Error(`missing governance fallback metadata: ${JSON.stringify(result)}`);
90
+ console.log('[pass] live governance fallback metadata');
91
+ EOF
92
+
93
+ echo "ALL CREDENTIALED LIVE SERVICE GATES PASSED"
@@ -4,60 +4,122 @@ set -euo pipefail
4
4
  ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
5
  cd "$ROOT"
6
6
 
7
- CLI="node dist/index.js"
8
- SERVICE_IDENTITY_MODE="${VIGTHORIA_TEST_SERVICE_IDENTITY:-0}"
9
- unset V3_SERVICE_KEY
10
- unset HYPERLOOP_SERVICE_KEY
11
- # Release validation runs against local model-router in this environment
12
- export VIGTHORIA_SELF_HOSTED_MODELS_API_URL="http://127.0.0.1:4009"
13
-
14
- echo "[0.1-0.6] source/dist consistency"
15
- node scripts/release/verify-runtime-consistency.mjs >/tmp/vig-verify-runtime.json
16
- cat /tmp/vig-verify-runtime.json
17
-
18
- echo "[0.2] build exits 0"
19
- npm run build >/tmp/vig-build.log 2>&1
20
-
21
- echo "[0.3] dist/index.js exists"
22
- [[ -x dist/index.js ]]
23
-
24
- echo "[AUTH PREFLIGHT] invalid session message"
25
- AUTH_JSON=$(VIGTHORIA_AUTH_TOKEN=invalid-token-for-preflight $CLI chat --no-agent --model balanced-4b --prompt "ok" --json 2>/dev/null || true)
26
- echo "$AUTH_JSON"
27
- printf '%s
28
- ' "$AUTH_JSON" > /tmp/vig-auth-preflight.json
29
- python3 - << 'PY'
30
- import json
31
- import re
32
- with open('/tmp/vig-auth-preflight.json','r',encoding='utf-8') as f:
33
- j=json.load(f)
34
- msg='Vigthoria Gate way user authentification failed. Please log out and login again.'
35
- assert j.get('success') is False, 'expected success=false for invalid token preflight'
36
- assert j.get('error') == msg, f"unexpected auth message: {j.get('error')}"
37
- print('[pass] auth preflight message')
38
- PY
39
-
40
- if [[ "$SERVICE_IDENTITY_MODE" == "1" ]]; then
41
- # From this point onward the no-go suite exercises server-local model and
42
- # tool routes without borrowing a human account session. The invalid-token
43
- # gateway assertion above always runs against the canonical public boundary.
44
- export VIGTHORIA_LOCAL_TEST_MODE=1
45
- export VIGTHORIA_LOCAL_TEST_TOKEN="vigthoria-release-service-identity"
46
- export VIGTHORIA_AUTH_TOKEN="$VIGTHORIA_LOCAL_TEST_TOKEN"
47
- fi
48
-
49
- echo "[1.1] ranker includes agent.py top10 for SSE prompt"
50
- node - << 'EOF2'
51
- import('./dist/utils/context-ranker.js').then((m)=>{
52
- const r=m.buildSemanticContext('/var/www/V3-Code-Agent','fix the streaming SSE event handler',10);
53
- const idx=r.topFiles.findIndex((f)=>f.path==='agent.py');
54
- console.log('agent_idx_top10=' + idx);
55
- if (idx < 0) process.exit(1);
56
- });
57
- EOF2
58
-
59
- echo "[2.1/2.4] tsc validator emits passing result"
60
- node --input-type=module - << 'EOF2'
7
+ VALIDATION_TEMP_ROOT="${VIGTHORIA_VALIDATION_TEMP_DIR:-$(dirname "$ROOT")/.vigthoria-cli-validation}"
8
+ mkdir -p "$VALIDATION_TEMP_ROOT"
9
+ chmod 700 "$VALIDATION_TEMP_ROOT"
10
+ find "$VALIDATION_TEMP_ROOT" -mindepth 1 -maxdepth 1 -type d -name 'run.*' -mmin +1440 -user "$(id -un)" -exec rm -rf -- {} +
11
+ VALIDATION_TMP="$(mktemp -d "$VALIDATION_TEMP_ROOT/run.XXXXXX")"
12
+ trap 'rm -rf "$VALIDATION_TMP"' EXIT
13
+ mkdir -p "$VALIDATION_TMP/home"
14
+ mkdir -p "$VALIDATION_TMP/runtime-tmp"
15
+ chmod 700 "$VALIDATION_TMP/runtime-tmp"
16
+
17
+ export HOME="$VALIDATION_TMP/home"
18
+ export USERPROFILE="$HOME"
19
+ export TMPDIR="$VALIDATION_TMP/runtime-tmp"
20
+ export TMP="$TMPDIR"
21
+ export TEMP="$TMPDIR"
22
+ export npm_config_cache="$VALIDATION_TMP/npm-cache"
23
+ export npm_config_update_notifier=false
24
+ export VIGTHORIA_NO_BANNER=1
25
+ export VIGTHORIA_NO_UPDATE_CHECK=1
26
+ export VIGTHORIA_OFFLINE=1
27
+ unset VIGTHORIA_AUTH_TOKEN VIGTHORIA_TOKEN VIGTHORIA_LOCAL_TEST_MODE
28
+ unset VIGTHORIA_LOCAL_TEST_TOKEN V3_SERVICE_KEY HYPERLOOP_SERVICE_KEY
29
+ unset VIGTHORIA_API_URL VIGTHORIA_MODELS_API_URL
30
+ unset VIGTHORIA_SELF_HOSTED_MODELS_API_URL VIGTHORIA_V3_AGENT_URL
31
+
32
+ echo "[0.1] clean build"
33
+ npm run build >"$VALIDATION_TMP/build.log" 2>&1
34
+
35
+ echo "[0.2] source/dist consistency"
36
+ node scripts/release/verify-runtime-consistency.mjs >"$VALIDATION_TMP/runtime.json"
37
+ cat "$VALIDATION_TMP/runtime.json"
38
+
39
+ echo "[0.3] package, lockfile, and runtime identity"
40
+ node --input-type=module - <<'EOF'
41
+ import fs from 'node:fs';
42
+ import { spawnSync } from 'node:child_process';
43
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
44
+ const lock = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'));
45
+ const runtime = spawnSync(process.execPath, ['dist/index.js', '--version'], { encoding: 'utf8' });
46
+ if (runtime.status !== 0) throw new Error(runtime.stderr || 'runtime --version failed');
47
+ const versions = [pkg.version, lock.version, lock.packages?.['']?.version, runtime.stdout.trim()];
48
+ if (new Set(versions).size !== 1) throw new Error(`identity mismatch: ${versions.join(', ')}`);
49
+ console.log(`[pass] identity ${versions[0]}`);
50
+ EOF
51
+
52
+ echo "[0.4] strict TypeScript compilation"
53
+ ./node_modules/.bin/tsc --noEmit
54
+
55
+ echo "[0.5] source, import, command, JSON, and golden contracts"
56
+ node scripts/run-test-suite.mjs check
57
+ node scripts/architecture/verify-source-boundaries.mjs
58
+ node scripts/architecture/verify-import-graph.mjs --check
59
+ node scripts/architecture/capture-command-manifest.mjs --check
60
+ node scripts/architecture/verify-json-contracts.mjs
61
+ node scripts/architecture/capture-golden-contracts.mjs --check
62
+
63
+ echo "[0.6] package hygiene"
64
+ node scripts/verify-package-hygiene.js
65
+
66
+ echo "[0.7] authoritative Phase 1 security contracts"
67
+ node scripts/test-dependency-security.mjs
68
+ node scripts/test-network-policy.mjs
69
+ node scripts/test-installer-trust-policy.mjs
70
+ node scripts/test-workspace-archive-containment.mjs
71
+ node scripts/test-public-repo-clone.mjs
72
+ node scripts/test-process-approval-safety.mjs
73
+ node scripts/test-mutation-preview-transaction.mjs
74
+ node scripts/test-preview-screenshot-adapter.mjs
75
+ node scripts/test-frontend-preview-service.mjs
76
+ node scripts/test-prompt-workspace-resolver.mjs
77
+ node scripts/test-context-secret-hygiene.mjs
78
+ node scripts/test-vigflow-client.mjs
79
+ node scripts/test-operator-client.mjs
80
+ node scripts/test-mcp-context-client.mjs
81
+ node scripts/test-code-operations-service.mjs
82
+ node scripts/test-capability-health-service.mjs
83
+ node scripts/test-model-transport-service.mjs
84
+ node scripts/test-chat-tool-call-parser.mjs
85
+ node scripts/test-chat-prompt-policy.mjs
86
+ node scripts/test-tool-capability-providers.mjs
87
+ node scripts/test-agent-stream-state.mjs
88
+ node scripts/test-direct-output-policy.mjs
89
+ node scripts/test-runtime-temp.mjs
90
+
91
+ echo "[0.8] authoritative Phase 2 state/auth/session contracts"
92
+ node scripts/test-durable-json-state.mjs
93
+ node scripts/test-auth-state.mjs
94
+ node scripts/test-session-durable-lifecycle.mjs
95
+ node scripts/test-session-project-match.mjs
96
+ node scripts/test-external-client-resume.mjs
97
+ node scripts/test-context-state-ownership.mjs
98
+ node scripts/test-game-command.mjs
99
+
100
+ echo "[0.9] Phase 3 command error/exit/JSON foundation"
101
+ node scripts/test-command-contract.mjs
102
+ node scripts/test-update-policy.mjs
103
+ node scripts/test-release-delivery.mjs
104
+ node scripts/test-timeout-cancellation.mjs
105
+
106
+ echo "[1.1] ranker includes agent.py in top 10 for an SSE prompt"
107
+ RANKER_FIXTURE="$VALIDATION_TMP/ranker" node --input-type=module - <<'EOF'
108
+ import fs from 'node:fs';
109
+ import path from 'node:path';
110
+ import { buildSemanticContext } from './dist/utils/context-ranker.js';
111
+ const fixture = process.env.RANKER_FIXTURE;
112
+ fs.mkdirSync(fixture, { recursive: true });
113
+ fs.writeFileSync(path.join(fixture, 'agent.py'), 'def stream_sse_event():\n return "event: done"\n');
114
+ fs.writeFileSync(path.join(fixture, 'unrelated.txt'), 'static documentation\n');
115
+ const result = buildSemanticContext(fixture, 'fix the streaming SSE event handler', 10);
116
+ const index = result.topFiles.findIndex((file) => file.path === 'agent.py');
117
+ console.log(`agent_idx_top10=${index}`);
118
+ if (index < 0) process.exit(1);
119
+ EOF
120
+
121
+ echo "[2.1/2.4] TypeScript post-write validator"
122
+ node --input-type=module - <<'EOF'
61
123
  import fs from 'node:fs';
62
124
  import os from 'node:os';
63
125
  import path from 'node:path';
@@ -66,127 +128,36 @@ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'vig-tsc-'));
66
128
  fs.mkdirSync(path.join(tmp, 'src'));
67
129
  fs.writeFileSync(path.join(tmp, 'tsconfig.json'), JSON.stringify({ compilerOptions: { target: 'ES2020', module: 'ESNext' }, include: ['src/**/*.ts'] }));
68
130
  fs.writeFileSync(path.join(tmp, 'src', 'index.ts'), 'export const ok:number = 1;\n');
69
- const res = await runPostWriteValidation(tmp);
70
- const tsc = res.find((r)=>r.tool==='tsc');
131
+ const results = await runPostWriteValidation(tmp);
132
+ const tsc = results.find((result) => result.tool === 'tsc');
71
133
  console.log(JSON.stringify(tsc || null));
72
134
  if (!tsc || !tsc.ran || !tsc.passed) process.exit(1);
73
- EOF2
74
-
75
- echo "[6.2] balanced-4b no-agent path"
76
- for attempt in 1 2 3; do
77
- if $CLI chat --no-agent --model balanced-4b --prompt "reply exactly: ok" --json >/tmp/vig-balanced.json; then
78
- break
79
- fi
80
- if [[ "$attempt" == "3" ]]; then
81
- echo "[fail] balanced-4b remained unavailable after 3 attempts"
82
- exit 1
83
- fi
84
- echo "[retry] balanced-4b transient failure ($attempt/3)"
85
- sleep 2
86
- done
87
- python3 - << 'PY'
88
- import json
89
- j=json.load(open('/tmp/vig-balanced.json'))
90
- assert j.get('success') is True
91
- assert j.get('model') in ('Vigthoria-v4-Assistant-9B', 'vigthoria-balanced-4b', 'vigthoria-v3-balanced-4b'), j
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" ]]
135
+ EOF
136
+
137
+ echo "[6.2/12.1] deterministic routing and model-governance contracts"
138
+ node scripts/test-request-intent.js
139
+ VIGTHORIA_AGENT_LLM_ROUTER=0 node scripts/test-agent-route.js
140
+ VIGTHORIA_AGENT_LLM_ROUTER=0 node scripts/test-local-use-cases.js
141
+ node scripts/test-fast-router-capability.js
142
+ node scripts/test-agent-routing-policy.js
143
+ node scripts/test-model-governance-no-agent.js
144
+ node scripts/test-model-governance.mjs
145
+
146
+ echo "[context] deterministic budget, path, stream, error, and outcome contracts"
147
+ node scripts/test-context-budget.js
148
+ node scripts/test-v3-workspace-path.js
149
+ node scripts/test-v3-stream-events.js
150
+ node scripts/test-v3-agent-client.mjs
151
+ node scripts/test-v3-workspace-service.mjs
152
+ node scripts/test-error-wording.mjs
153
+ node scripts/test-agent-run-outcome.js
157
154
 
158
155
  echo "[8.2] runtime symlink guard signals"
159
- rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >/tmp/vig-ranker-signals.txt
160
- cat /tmp/vig-ranker-signals.txt
161
-
162
- echo "[9.5/9.7/9.16] release URL consistency"
163
- rg -n "coder.vigthoria.io/releases" install.ps1 install.sh README.md >/tmp/vig-release-urls.txt
164
- cat /tmp/vig-release-urls.txt
165
-
166
- echo "[12.1] no-agent governance fallback"
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"
156
+ rg -n "realpathSync|results.length >= maxFiles|pattern = kw.length <= 4" dist/utils/context-ranker.js >"$VALIDATION_TMP/ranker-signals.txt"
157
+ cat "$VALIDATION_TMP/ranker-signals.txt"
158
+
159
+ echo "[9.5/9.7/9.16] release policy and canonical URL consistency"
160
+ 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"
161
+ cat "$VALIDATION_TMP/release-urls.txt"
162
+
163
+ 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
  }
@@ -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;