vigthoria-cli 1.6.22 → 1.6.24

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.
@@ -199,11 +199,20 @@ class AuthCommand {
199
199
  console.log(chalk_1.default.gray(' Self-hosted Models: ') + chalk_1.default.gray('disabled'));
200
200
  }
201
201
  const capabilitySpinner = (0, logger_js_1.createSpinner)('Checking live capability truth...').start();
202
- const capabilityStatus = await this.api.getCapabilityTruthStatus({
203
- workspacePath: process.cwd(),
204
- projectPath: process.cwd(),
205
- targetPath: process.cwd(),
206
- });
202
+ const capabilityStatus = await Promise.race([
203
+ this.api.getCapabilityTruthStatus({
204
+ workspacePath: process.cwd(),
205
+ projectPath: process.cwd(),
206
+ targetPath: process.cwd(),
207
+ }),
208
+ new Promise(resolve => setTimeout(() => resolve({
209
+ overallOk: false,
210
+ v3Agent: { name: 'V3 Agent', endpoint: '', ok: false, error: 'Timed out (8s)' },
211
+ hyperLoop: { name: 'Hyper Loop', endpoint: '', ok: false, error: 'Timed out (8s)' },
212
+ repoMemory: { name: 'Repo Memory', endpoint: '', ok: false, error: 'Timed out (8s)' },
213
+ devtoolsBridge: { name: 'DevTools Bridge', endpoint: '', ok: false, error: 'Timed out (8s)' },
214
+ }), 8000)),
215
+ ]);
207
216
  capabilitySpinner.stop();
208
217
  console.log();
209
218
  console.log(chalk_1.default.white('Capability Truth:'));
@@ -486,7 +486,37 @@ class ChatCommand {
486
486
  if (options.newProject) {
487
487
  return true;
488
488
  }
489
- return Boolean(options.prompt) && (options.agent === true || options.operator === true);
489
+ // Only use managed workspace when --prompt is given AND the CWD looks
490
+ // like a home/root directory (no project signals). When the user runs
491
+ // `vigthoria agent --prompt "..."` inside an actual project folder we
492
+ // should use that folder, not invent a new managed workspace.
493
+ if (Boolean(options.prompt) && (options.agent === true || options.operator === true)) {
494
+ const cwd = process.cwd();
495
+ const homeDir = os.homedir();
496
+ // If CWD is home dir, root, or a system temp dir → use managed workspace
497
+ if (cwd === homeDir || cwd === '/' || cwd === 'C:\\' || cwd.toLowerCase().includes('temp')) {
498
+ return true;
499
+ }
500
+ // If CWD has any project signals → use CWD
501
+ const projectSignals = ['.git', 'package.json', 'Cargo.toml', 'go.mod', 'pom.xml', 'requirements.txt', 'pyproject.toml', '.vigthoria', 'Makefile', 'CMakeLists.txt', 'tsconfig.json'];
502
+ for (const signal of projectSignals) {
503
+ if (fs.existsSync(path.join(cwd, signal))) {
504
+ return false;
505
+ }
506
+ }
507
+ // If CWD has files (not just an empty dir) → use CWD
508
+ try {
509
+ const entries = fs.readdirSync(cwd);
510
+ if (entries.length > 0) {
511
+ return false;
512
+ }
513
+ }
514
+ catch {
515
+ // Cannot read CWD — fall through to managed workspace
516
+ }
517
+ return true;
518
+ }
519
+ return false;
490
520
  }
491
521
  getManagedWorkspaceRoot() {
492
522
  const envRoot = String(process.env.VIGTHORIA_DEFAULT_WORKSPACE_ROOT || '').trim();
package/dist/index.js CHANGED
@@ -98,7 +98,7 @@ function getVersion() {
98
98
  catch (e) {
99
99
  // Fallback to hardcoded version
100
100
  }
101
- return '1.6.22';
101
+ return '1.6.24';
102
102
  }
103
103
  const VERSION = getVersion();
104
104
  /**
package/dist/utils/api.js CHANGED
@@ -341,8 +341,9 @@ class APIClient {
341
341
  }
342
342
  const prompt = String(message || '');
343
343
  const expectedFiles = this.extractExpectedWorkspaceFiles(message, context);
344
+ const hasHtmlEntry = expectedFiles.some((filePath) => /\.html?$/i.test(filePath));
344
345
  return /(premium|polished|landing|site|page|dashboard|saas|frontend|ui|pricing|showcase|hero|responsive)/i.test(prompt)
345
- || expectedFiles.some((filePath) => /\.(html|css|js)$/i.test(filePath));
346
+ || hasHtmlEntry;
346
347
  }
347
348
  /**
348
349
  * Returns true when the prompt describes a read-only / analysis task.
@@ -940,7 +941,7 @@ class APIClient {
940
941
  // When the server cannot directly access the workspace (e.g. Windows
941
942
  // client), use the local path as a hint and flag that the workspace
942
943
  // files are provided inline in localWorkspaceSummary.workspaceFiles.
943
- const effectiveWorkspacePath = serverWorkspacePath || localWorkspacePath || null;
944
+ const effectiveWorkspacePath = serverWorkspacePath || null;
944
945
  const needsHydration = !serverWorkspacePath && !!localWorkspacePath;
945
946
  const payload = {
946
947
  workspace: resolvedContext.workspace || null,
@@ -989,6 +990,9 @@ class APIClient {
989
990
  let json = JSON.stringify(payload);
990
991
  if (json.length <= LIMIT)
991
992
  return json;
993
+ if (process.env.DEBUG || process.env.VIGTHORIA_DEBUG) {
994
+ console.log(`[context] Payload ${json.length} chars exceeds ${LIMIT} limit, compacting...`);
995
+ }
992
996
  // Phase 1 — shrink workspaceFiles to fit
993
997
  const summary = payload.localWorkspaceSummary;
994
998
  if (summary?.workspaceFiles && typeof summary.workspaceFiles === 'object') {
@@ -3711,7 +3715,8 @@ document.addEventListener('DOMContentLoaded', () => {
3711
3715
  };
3712
3716
  }
3713
3717
  async getHyperLoopHealth() {
3714
- const endpoint = process.env.VIGTHORIA_HYPERLOOP_URL || 'http://127.0.0.1:8020/api/hyperloop/health';
3718
+ const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
3719
+ const endpoint = process.env.VIGTHORIA_HYPERLOOP_URL || `${configuredApiUrl}/api/hyperloop/health`;
3715
3720
  try {
3716
3721
  const token = this.getAccessToken();
3717
3722
  const response = await fetch(endpoint, {
@@ -3740,8 +3745,9 @@ document.addEventListener('DOMContentLoaded', () => {
3740
3745
  }
3741
3746
  }
3742
3747
  async getRepoMemoryHealth(context = {}) {
3743
- const endpoint = process.env.VIGTHORIA_HYPERLOOP_EXECUTE_URL || 'http://127.0.0.1:8020/api/hyperloop/execute';
3744
- const modulesEndpoint = process.env.VIGTHORIA_HYPERLOOP_MODULES_URL || 'http://127.0.0.1:8020/api/hyperloop/modules';
3748
+ const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
3749
+ const endpoint = process.env.VIGTHORIA_HYPERLOOP_EXECUTE_URL || `${configuredApiUrl}/api/hyperloop/execute`;
3750
+ const modulesEndpoint = process.env.VIGTHORIA_HYPERLOOP_MODULES_URL || `${configuredApiUrl}/api/hyperloop/modules`;
3745
3751
  const token = this.getAccessToken();
3746
3752
  const projectPath = this.resolveAgentTargetPath(context);
3747
3753
  try {
@@ -53,6 +53,7 @@ exports.BridgeClient = void 0;
53
53
  exports.getBridgeClient = getBridgeClient;
54
54
  const ws_1 = __importDefault(require("ws"));
55
55
  const os = __importStar(require("os"));
56
+ const chalk_1 = __importDefault(require("chalk"));
56
57
  // ── Singleton accessor ───────────────────────────────────────────────
57
58
  let _instance = null;
58
59
  /** Get the active bridge client (may be null if --bridge was not used). */
@@ -134,6 +135,9 @@ class BridgeClient {
134
135
  this.connected = false;
135
136
  this.stopHeartbeat();
136
137
  this.scheduleReconnect();
138
+ if (process.env.DEBUG || process.env.VIGTHORIA_DEBUG) {
139
+ console.log(chalk_1.default.yellow('⚠ Bridge: connection failed, will retry in background.'));
140
+ }
137
141
  resolve(); // resolve even on failure – must never block CLI
138
142
  });
139
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigthoria-cli",
3
- "version": "1.6.22",
3
+ "version": "1.6.24",
4
4
  "description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
5
5
  "main": "dist/index.js",
6
6
  "files": [