vigthoria-cli 1.6.23 → 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
@@ -990,6 +990,9 @@ class APIClient {
990
990
  let json = JSON.stringify(payload);
991
991
  if (json.length <= LIMIT)
992
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
+ }
993
996
  // Phase 1 — shrink workspaceFiles to fit
994
997
  const summary = payload.localWorkspaceSummary;
995
998
  if (summary?.workspaceFiles && typeof summary.workspaceFiles === 'object') {
@@ -3712,7 +3715,8 @@ document.addEventListener('DOMContentLoaded', () => {
3712
3715
  };
3713
3716
  }
3714
3717
  async getHyperLoopHealth() {
3715
- 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`;
3716
3720
  try {
3717
3721
  const token = this.getAccessToken();
3718
3722
  const response = await fetch(endpoint, {
@@ -3741,8 +3745,9 @@ document.addEventListener('DOMContentLoaded', () => {
3741
3745
  }
3742
3746
  }
3743
3747
  async getRepoMemoryHealth(context = {}) {
3744
- const endpoint = process.env.VIGTHORIA_HYPERLOOP_EXECUTE_URL || 'http://127.0.0.1:8020/api/hyperloop/execute';
3745
- 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`;
3746
3751
  const token = this.getAccessToken();
3747
3752
  const projectPath = this.resolveAgentTargetPath(context);
3748
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.23",
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": [