vigthoria-cli 1.10.47 → 1.10.49

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 (60) hide show
  1. package/dist/commands/agent-session-menu.js +2 -8
  2. package/dist/commands/auth.js +51 -68
  3. package/dist/commands/bridge.js +42 -22
  4. package/dist/commands/cancel.js +15 -22
  5. package/dist/commands/chat.d.ts +3 -0
  6. package/dist/commands/chat.js +326 -295
  7. package/dist/commands/config.js +33 -73
  8. package/dist/commands/deploy.js +83 -123
  9. package/dist/commands/device.js +21 -61
  10. package/dist/commands/edit.js +32 -39
  11. package/dist/commands/explain.js +18 -25
  12. package/dist/commands/fork.d.ts +17 -0
  13. package/dist/commands/fork.js +164 -0
  14. package/dist/commands/generate.js +37 -44
  15. package/dist/commands/history.d.ts +17 -0
  16. package/dist/commands/history.js +113 -0
  17. package/dist/commands/hub.js +95 -102
  18. package/dist/commands/index.js +41 -46
  19. package/dist/commands/legion.js +146 -186
  20. package/dist/commands/preview.d.ts +55 -0
  21. package/dist/commands/preview.js +467 -0
  22. package/dist/commands/replay.d.ts +18 -0
  23. package/dist/commands/replay.js +156 -0
  24. package/dist/commands/repo.d.ts +97 -0
  25. package/dist/commands/repo.js +773 -0
  26. package/dist/commands/review.js +29 -36
  27. package/dist/commands/security.js +5 -12
  28. package/dist/commands/update.d.ts +9 -0
  29. package/dist/commands/update.js +201 -0
  30. package/dist/commands/wallet.js +28 -35
  31. package/dist/commands/workflow.js +13 -20
  32. package/dist/index.d.ts +21 -0
  33. package/dist/index.js +1652 -0
  34. package/dist/utils/api.d.ts +544 -0
  35. package/dist/utils/api.js +5486 -0
  36. package/dist/utils/brain-hub-client.js +1 -5
  37. package/dist/utils/bridge-client.js +11 -52
  38. package/dist/utils/cli-state.d.ts +54 -0
  39. package/dist/utils/cli-state.js +185 -0
  40. package/dist/utils/codebase-indexer.js +4 -41
  41. package/dist/utils/config.d.ts +82 -0
  42. package/dist/utils/config.js +269 -0
  43. package/dist/utils/context-ranker.js +15 -21
  44. package/dist/utils/desktop-bridge-client.d.ts +12 -0
  45. package/dist/utils/desktop-bridge-client.js +30 -0
  46. package/dist/utils/files.js +5 -42
  47. package/dist/utils/logger.js +42 -50
  48. package/dist/utils/persona.js +3 -8
  49. package/dist/utils/post-write-validator.js +26 -33
  50. package/dist/utils/project-memory.js +16 -23
  51. package/dist/utils/session.d.ts +118 -0
  52. package/dist/utils/session.js +423 -0
  53. package/dist/utils/task-display.js +13 -20
  54. package/dist/utils/tools.d.ts +269 -0
  55. package/dist/utils/tools.js +3450 -0
  56. package/dist/utils/workspace-brain-service.js +8 -45
  57. package/dist/utils/workspace-cache.js +18 -26
  58. package/dist/utils/workspace-stream.js +21 -63
  59. package/package.json +2 -1
  60. package/scripts/release/validate-no-go-gates.sh +7 -4
@@ -1,11 +1,8 @@
1
- "use strict";
2
1
  /**
3
2
  * Brain Hub client — sync workspace index + fetch account brain context
4
3
  * via coder.vigthoria.io (JWT-authenticated).
5
4
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.BrainHubClient = void 0;
8
- class BrainHubClient {
5
+ export class BrainHubClient {
9
6
  apiBase;
10
7
  getAuthToken;
11
8
  constructor(options) {
@@ -49,4 +46,3 @@ class BrainHubClient {
49
46
  return data;
50
47
  }
51
48
  }
52
- exports.BrainHubClient = BrainHubClient;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * Vigthoria CLI → DevTools Bridge Telemetry Client
4
3
  *
@@ -12,57 +11,18 @@
12
11
  * - Opt-in via --bridge <url> flag
13
12
  * - Sensitive data (API keys, tokens) is never transmitted
14
13
  */
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- var desc = Object.getOwnPropertyDescriptor(m, k);
18
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
- desc = { enumerable: true, get: function() { return m[k]; } };
20
- }
21
- Object.defineProperty(o, k2, desc);
22
- }) : (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- o[k2] = m[k];
25
- }));
26
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
- Object.defineProperty(o, "default", { enumerable: true, value: v });
28
- }) : function(o, v) {
29
- o["default"] = v;
30
- });
31
- var __importStar = (this && this.__importStar) || (function () {
32
- var ownKeys = function(o) {
33
- ownKeys = Object.getOwnPropertyNames || function (o) {
34
- var ar = [];
35
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
- return ar;
37
- };
38
- return ownKeys(o);
39
- };
40
- return function (mod) {
41
- if (mod && mod.__esModule) return mod;
42
- var result = {};
43
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
- __setModuleDefault(result, mod);
45
- return result;
46
- };
47
- })();
48
- var __importDefault = (this && this.__importDefault) || function (mod) {
49
- return (mod && mod.__esModule) ? mod : { "default": mod };
50
- };
51
- Object.defineProperty(exports, "__esModule", { value: true });
52
- exports.BridgeClient = void 0;
53
- exports.getBridgeClient = getBridgeClient;
54
- const ws_1 = __importDefault(require("ws"));
55
- const os = __importStar(require("os"));
56
- const chalk_1 = __importDefault(require("chalk"));
57
- const logger_js_1 = require("./logger.js");
14
+ import WebSocket from 'ws';
15
+ import * as os from 'os';
16
+ import chalk from 'chalk';
17
+ import { CH } from './logger.js';
58
18
  // ── Singleton accessor ───────────────────────────────────────────────
59
19
  let _instance = null;
60
20
  /** Get the active bridge client (may be null if --bridge was not used). */
61
- function getBridgeClient() {
21
+ export function getBridgeClient() {
62
22
  return _instance;
63
23
  }
64
24
  // ── BridgeClient ─────────────────────────────────────────────────────
65
- class BridgeClient {
25
+ export class BridgeClient {
66
26
  ws = null;
67
27
  url;
68
28
  apiKey;
@@ -93,7 +53,7 @@ class BridgeClient {
93
53
  return;
94
54
  return new Promise((resolve) => {
95
55
  try {
96
- this.ws = new ws_1.default(this.url, { handshakeTimeout: 8000 });
56
+ this.ws = new WebSocket(this.url, { handshakeTimeout: 8000 });
97
57
  this.ws.on('open', () => {
98
58
  this.connected = true;
99
59
  this.reconnectDelay = 2000;
@@ -137,7 +97,7 @@ class BridgeClient {
137
97
  this.stopHeartbeat();
138
98
  this.scheduleReconnect();
139
99
  if (process.env.DEBUG || process.env.VIGTHORIA_DEBUG) {
140
- console.log(chalk_1.default.yellow(`${logger_js_1.CH.warn} Bridge: connection failed, will retry in background.`));
100
+ console.log(chalk.yellow(`${CH.warn} Bridge: connection failed, will retry in background.`));
141
101
  }
142
102
  resolve(); // resolve even on failure – must never block CLI
143
103
  });
@@ -225,7 +185,7 @@ class BridgeClient {
225
185
  clientId: this.clientId,
226
186
  };
227
187
  const json = JSON.stringify(event);
228
- if (this.connected && this.ws?.readyState === ws_1.default.OPEN) {
188
+ if (this.connected && this.ws?.readyState === WebSocket.OPEN) {
229
189
  try {
230
190
  this.ws.send(json);
231
191
  }
@@ -238,7 +198,7 @@ class BridgeClient {
238
198
  }
239
199
  }
240
200
  sendRaw(obj) {
241
- if (this.ws?.readyState === ws_1.default.OPEN) {
201
+ if (this.ws?.readyState === WebSocket.OPEN) {
242
202
  this.ws.send(JSON.stringify(obj));
243
203
  }
244
204
  }
@@ -249,7 +209,7 @@ class BridgeClient {
249
209
  this.queue.push(json);
250
210
  }
251
211
  flushQueue() {
252
- while (this.queue.length > 0 && this.ws?.readyState === ws_1.default.OPEN) {
212
+ while (this.queue.length > 0 && this.ws?.readyState === WebSocket.OPEN) {
253
213
  const msg = this.queue.shift();
254
214
  try {
255
215
  this.ws.send(msg);
@@ -280,4 +240,3 @@ class BridgeClient {
280
240
  }
281
241
  }
282
242
  }
283
- exports.BridgeClient = BridgeClient;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Vigthoria CLI — shared local-state helpers.
3
+ *
4
+ * Single source for:
5
+ * • Offline-mode detection (VIGTHORIA_OFFLINE=1) — suppresses every
6
+ * background network call (update checks, gateway preflights, etc.).
7
+ * • Telemetry opt-out (VIGTHORIA_TELEMETRY_DISABLED=1).
8
+ * • Update-check cache, so `npm view` is not invoked on every CLI start.
9
+ * • Cross-platform safe file mode enforcement for tokens / sessions.
10
+ *
11
+ * No external network calls — pure local helpers. Safe to import from
12
+ * any command module.
13
+ */
14
+ /** 24h is plenty for an update-check ping. */
15
+ export declare const UPDATE_CHECK_TTL_MS: number;
16
+ /** 60s gateway-preflight cache so back-to-back CLI invocations stay fast. */
17
+ export declare const GATEWAY_PREFLIGHT_TTL_MS: number;
18
+ export interface CliStateShape {
19
+ updateCheck?: {
20
+ checkedAt: number;
21
+ latestVersion: string;
22
+ notifiedFor?: string;
23
+ };
24
+ gatewayPreflight?: {
25
+ checkedAt: number;
26
+ valid: boolean;
27
+ };
28
+ /** Last-seen version — used to render release notes on upgrade. */
29
+ lastSeenVersion?: string;
30
+ }
31
+ export declare function ensureStateDir(): void;
32
+ /** Best-effort lock-down: `0o600` on POSIX, no-op on Windows (NTFS ACL ≠ chmod). */
33
+ export declare function secureFileMode(filePath: string): void;
34
+ /** Atomic write helper — write to temp then rename, never half-written JSON. */
35
+ export declare function atomicWriteJson(targetPath: string, value: unknown, mode?: number): void;
36
+ export declare function loadCliState(): CliStateShape;
37
+ export declare function saveCliState(state: CliStateShape): void;
38
+ export declare function getCliStateFile(): string;
39
+ /**
40
+ * Offline mode — set VIGTHORIA_OFFLINE=1 to skip every non-essential
41
+ * outbound HTTP call. Useful for restricted networks, air-gapped runs,
42
+ * and deterministic CI.
43
+ */
44
+ export declare function isOfflineMode(): boolean;
45
+ /** Telemetry opt-out (also implied when offline mode is on). */
46
+ export declare function isTelemetryDisabled(): boolean;
47
+ /** When true the startup update check is suppressed (env override or offline). */
48
+ export declare function isUpdateCheckSuppressed(): boolean;
49
+ /** Cached read for the latest known version — null when stale or absent. */
50
+ export declare function readCachedLatestVersion(maxAgeMs?: number): string | null;
51
+ export declare function writeCachedLatestVersion(latestVersion: string, notifiedFor?: string): void;
52
+ export declare function readGatewayPreflightCache(maxAgeMs?: number): boolean | null;
53
+ export declare function writeGatewayPreflightCache(valid: boolean): void;
54
+ export declare function isSafeNpmPackageSpec(spec: string): boolean;
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Vigthoria CLI — shared local-state helpers.
3
+ *
4
+ * Single source for:
5
+ * • Offline-mode detection (VIGTHORIA_OFFLINE=1) — suppresses every
6
+ * background network call (update checks, gateway preflights, etc.).
7
+ * • Telemetry opt-out (VIGTHORIA_TELEMETRY_DISABLED=1).
8
+ * • Update-check cache, so `npm view` is not invoked on every CLI start.
9
+ * • Cross-platform safe file mode enforcement for tokens / sessions.
10
+ *
11
+ * No external network calls — pure local helpers. Safe to import from
12
+ * any command module.
13
+ */
14
+ import * as fs from 'fs';
15
+ import * as os from 'os';
16
+ import * as path from 'path';
17
+ const STATE_DIR = path.join(os.homedir(), '.vigthoria');
18
+ const STATE_FILE = path.join(STATE_DIR, 'cli-state.json');
19
+ /** 24h is plenty for an update-check ping. */
20
+ export const UPDATE_CHECK_TTL_MS = 24 * 60 * 60 * 1000;
21
+ /** 60s gateway-preflight cache so back-to-back CLI invocations stay fast. */
22
+ export const GATEWAY_PREFLIGHT_TTL_MS = 60 * 1000;
23
+ function readStateUnchecked() {
24
+ try {
25
+ if (!fs.existsSync(STATE_FILE)) {
26
+ return {};
27
+ }
28
+ const text = fs.readFileSync(STATE_FILE, 'utf8');
29
+ if (!text.trim()) {
30
+ return {};
31
+ }
32
+ const parsed = JSON.parse(text);
33
+ return parsed && typeof parsed === 'object' ? parsed : {};
34
+ }
35
+ catch {
36
+ // Corrupt state file should never crash the CLI — treat as empty.
37
+ return {};
38
+ }
39
+ }
40
+ export function ensureStateDir() {
41
+ try {
42
+ if (!fs.existsSync(STATE_DIR)) {
43
+ fs.mkdirSync(STATE_DIR, { recursive: true, mode: 0o700 });
44
+ }
45
+ if (process.platform !== 'win32') {
46
+ try {
47
+ fs.chmodSync(STATE_DIR, 0o700);
48
+ }
49
+ catch { /* best-effort */ }
50
+ }
51
+ }
52
+ catch {
53
+ // Best-effort — caller will see write failure later if it matters.
54
+ }
55
+ }
56
+ /** Best-effort lock-down: `0o600` on POSIX, no-op on Windows (NTFS ACL ≠ chmod). */
57
+ export function secureFileMode(filePath) {
58
+ if (process.platform === 'win32') {
59
+ return;
60
+ }
61
+ try {
62
+ fs.chmodSync(filePath, 0o600);
63
+ }
64
+ catch {
65
+ // File may not exist yet, or filesystem may not support chmod.
66
+ }
67
+ }
68
+ /** Atomic write helper — write to temp then rename, never half-written JSON. */
69
+ export function atomicWriteJson(targetPath, value, mode = 0o600) {
70
+ ensureStateDir();
71
+ const parent = path.dirname(targetPath);
72
+ try {
73
+ if (!fs.existsSync(parent))
74
+ fs.mkdirSync(parent, { recursive: true });
75
+ }
76
+ catch { /* ignore */ }
77
+ const tmpPath = `${targetPath}.${process.pid}.${Date.now()}.tmp`;
78
+ fs.writeFileSync(tmpPath, JSON.stringify(value, null, 2), 'utf8');
79
+ if (process.platform !== 'win32') {
80
+ try {
81
+ fs.chmodSync(tmpPath, mode);
82
+ }
83
+ catch { /* ignore */ }
84
+ }
85
+ fs.renameSync(tmpPath, targetPath);
86
+ }
87
+ export function loadCliState() {
88
+ return readStateUnchecked();
89
+ }
90
+ export function saveCliState(state) {
91
+ atomicWriteJson(STATE_FILE, state);
92
+ }
93
+ export function getCliStateFile() {
94
+ return STATE_FILE;
95
+ }
96
+ /**
97
+ * Offline mode — set VIGTHORIA_OFFLINE=1 to skip every non-essential
98
+ * outbound HTTP call. Useful for restricted networks, air-gapped runs,
99
+ * and deterministic CI.
100
+ */
101
+ export function isOfflineMode() {
102
+ const flag = String(process.env.VIGTHORIA_OFFLINE || '').trim().toLowerCase();
103
+ return flag === '1' || flag === 'true' || flag === 'yes';
104
+ }
105
+ /** Telemetry opt-out (also implied when offline mode is on). */
106
+ export function isTelemetryDisabled() {
107
+ if (isOfflineMode())
108
+ return true;
109
+ const flag = String(process.env.VIGTHORIA_TELEMETRY_DISABLED || '').trim().toLowerCase();
110
+ return flag === '1' || flag === 'true' || flag === 'yes';
111
+ }
112
+ /** When true the startup update check is suppressed (env override or offline). */
113
+ export function isUpdateCheckSuppressed() {
114
+ if (isOfflineMode())
115
+ return true;
116
+ const flag = String(process.env.VIGTHORIA_NO_UPDATE_CHECK || '').trim();
117
+ return flag === '1';
118
+ }
119
+ /** Cached read for the latest known version — null when stale or absent. */
120
+ export function readCachedLatestVersion(maxAgeMs = UPDATE_CHECK_TTL_MS) {
121
+ const state = readStateUnchecked();
122
+ const entry = state.updateCheck;
123
+ if (!entry || !entry.latestVersion || typeof entry.checkedAt !== 'number') {
124
+ return null;
125
+ }
126
+ if (Date.now() - entry.checkedAt > maxAgeMs) {
127
+ return null;
128
+ }
129
+ return entry.latestVersion;
130
+ }
131
+ export function writeCachedLatestVersion(latestVersion, notifiedFor) {
132
+ try {
133
+ const state = readStateUnchecked();
134
+ state.updateCheck = {
135
+ checkedAt: Date.now(),
136
+ latestVersion,
137
+ notifiedFor: notifiedFor || state.updateCheck?.notifiedFor,
138
+ };
139
+ saveCliState(state);
140
+ }
141
+ catch {
142
+ // Caching is a nice-to-have, never block CLI on write failure.
143
+ }
144
+ }
145
+ export function readGatewayPreflightCache(maxAgeMs = GATEWAY_PREFLIGHT_TTL_MS) {
146
+ const state = readStateUnchecked();
147
+ const entry = state.gatewayPreflight;
148
+ if (!entry || typeof entry.checkedAt !== 'number' || typeof entry.valid !== 'boolean') {
149
+ return null;
150
+ }
151
+ if (Date.now() - entry.checkedAt > maxAgeMs) {
152
+ return null;
153
+ }
154
+ return entry.valid;
155
+ }
156
+ export function writeGatewayPreflightCache(valid) {
157
+ try {
158
+ const state = readStateUnchecked();
159
+ state.gatewayPreflight = { checkedAt: Date.now(), valid };
160
+ saveCliState(state);
161
+ }
162
+ catch {
163
+ // Best-effort.
164
+ }
165
+ }
166
+ /**
167
+ * Validate an npm package spec used by `vigthoria update --from <spec>`.
168
+ * Returns `true` when the spec is acceptable. Rejects whitespace and
169
+ * shell metacharacters so the spec can never break out of `execFile` /
170
+ * a Windows `shell:true` fallback into command injection.
171
+ */
172
+ const NPM_SPEC_ALLOWLIST = /^[A-Za-z0-9_./@:+\\=-]+$/;
173
+ const DISALLOWED_SHELL_CHARS = /[;&|`$<>(){}\[\]"'\s]/;
174
+ export function isSafeNpmPackageSpec(spec) {
175
+ const candidate = String(spec || '').trim();
176
+ if (!candidate)
177
+ return false;
178
+ if (candidate.length > 512)
179
+ return false;
180
+ if (DISALLOWED_SHELL_CHARS.test(candidate))
181
+ return false;
182
+ if (!NPM_SPEC_ALLOWLIST.test(candidate))
183
+ return false;
184
+ return true;
185
+ }
@@ -1,46 +1,10 @@
1
- "use strict";
2
1
  /**
3
2
  * Local TF-IDF codebase indexer for CLI (mirrors Vigthoria Code extension indexer).
4
3
  */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.CodebaseIndexer = void 0;
40
- const crypto = __importStar(require("crypto"));
41
- const fs = __importStar(require("fs"));
42
- const path = __importStar(require("path"));
43
- class CodebaseIndexer {
4
+ import * as crypto from 'crypto';
5
+ import * as fs from 'fs';
6
+ import * as path from 'path';
7
+ export class CodebaseIndexer {
44
8
  workspaceRoot;
45
9
  index = new Map();
46
10
  invertedIndex = new Map();
@@ -348,4 +312,3 @@ class CodebaseIndexer {
348
312
  return this.ignorePatterns.some((pattern) => lowerPath.includes(pattern));
349
313
  }
350
314
  }
351
- exports.CodebaseIndexer = CodebaseIndexer;
@@ -0,0 +1,82 @@
1
+ export interface VigthoriaCLIConfig {
2
+ apiUrl: string;
3
+ modelsApiUrl: string;
4
+ wsUrl: string;
5
+ selfHostedModelsApiUrl: string | null;
6
+ authToken: string | null;
7
+ refreshToken: string | null;
8
+ userId: string | null;
9
+ email: string | null;
10
+ v3ServiceKey: string | null;
11
+ subscription: {
12
+ plan: string | null;
13
+ status: string | null;
14
+ expiresAt: string | null;
15
+ };
16
+ preferences: {
17
+ defaultModel: string;
18
+ theme: 'dark' | 'light';
19
+ autoApplyFixes: boolean;
20
+ showDiffs: boolean;
21
+ contextLines: number;
22
+ maxTokens: number;
23
+ };
24
+ project: {
25
+ rootPath: string | null;
26
+ ignorePatterns: string[];
27
+ };
28
+ persona: 'default' | 'wiener_grant';
29
+ hubModelPrefs?: {
30
+ enabledCloudModels: string[];
31
+ defaultCloudModel?: string;
32
+ defaultLocalModel?: string;
33
+ balance?: number;
34
+ fetchedAt?: string;
35
+ };
36
+ }
37
+ export interface AvailableModelDescriptor {
38
+ id: string;
39
+ name: string;
40
+ description: string;
41
+ tier: string;
42
+ backendModel: string;
43
+ }
44
+ export declare class Config {
45
+ private store;
46
+ private static readonly OPERATOR_PLANS;
47
+ private static readonly CLOUD_PLANS;
48
+ constructor();
49
+ /**
50
+ * Re-apply secure POSIX permissions to the on-disk config file. Safe
51
+ * to call repeatedly; no-op on Windows.
52
+ */
53
+ secureOnDisk(): void;
54
+ get<K extends keyof VigthoriaCLIConfig>(key: K): VigthoriaCLIConfig[K];
55
+ set<K extends keyof VigthoriaCLIConfig>(key: K, value: VigthoriaCLIConfig[K]): void;
56
+ getAll(): VigthoriaCLIConfig;
57
+ reset(): void;
58
+ isAuthenticated(): boolean;
59
+ hasValidSubscription(): boolean;
60
+ getNormalizedPlan(): string;
61
+ hasOperatorAccess(): boolean;
62
+ hasCloudAccess(): boolean;
63
+ getConfigPath(): string;
64
+ setAuth(data: {
65
+ token: string;
66
+ refreshToken?: string;
67
+ userId: string;
68
+ email: string;
69
+ }): void;
70
+ clearAuth(): void;
71
+ setSubscription(data: {
72
+ plan: string;
73
+ status: string;
74
+ expiresAt?: string;
75
+ }): void;
76
+ getAvailableModels(): AvailableModelDescriptor[];
77
+ refreshHubModelPreferences(): Promise<void>;
78
+ isCloudModel(modelId: string): boolean;
79
+ filterModelsByHubPreferences(models: AvailableModelDescriptor[], enabledCloudModels?: string[]): AvailableModelDescriptor[];
80
+ isComplexTask(prompt: string): boolean;
81
+ shouldUseCloudForHeavyTask(prompt: string): boolean;
82
+ }