vigthoria-cli 1.8.11 → 1.8.12

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.
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ForkCommand = void 0;
7
+ const api_js_1 = require("../utils/api.js");
7
8
  /**
8
9
  * fork.ts — Fork from an existing V3 agent run and stream the result.
9
10
  */
@@ -32,7 +33,7 @@ class ForkCommand {
32
33
  }
33
34
  getBaseUrl() {
34
35
  const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
35
- const allowLocal = process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
36
+ const allowLocal = (0, api_js_1.isServerRuntime)() && process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
36
37
  return (process.env.VIGTHORIA_V3_AGENT_URL ||
37
38
  process.env.V3_AGENT_URL ||
38
39
  (allowLocal ? 'http://127.0.0.1:8030' : null) ||
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HistoryCommand = void 0;
7
+ const api_js_1 = require("../utils/api.js");
7
8
  /**
8
9
  * history.ts — List recent V3 agent runs with summaries.
9
10
  */
@@ -32,7 +33,7 @@ class HistoryCommand {
32
33
  }
33
34
  getBaseUrl() {
34
35
  const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
35
- const allowLocal = process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
36
+ const allowLocal = (0, api_js_1.isServerRuntime)() && process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
36
37
  return (process.env.VIGTHORIA_V3_AGENT_URL ||
37
38
  process.env.V3_AGENT_URL ||
38
39
  (allowLocal ? 'http://127.0.0.1:8030' : null) ||
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ReplayCommand = void 0;
7
+ const api_js_1 = require("../utils/api.js");
7
8
  /**
8
9
  * replay.ts — Replay events from a V3 agent run step-by-step.
9
10
  */
@@ -32,7 +33,7 @@ class ReplayCommand {
32
33
  }
33
34
  getBaseUrl() {
34
35
  const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
35
- const allowLocal = process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
36
+ const allowLocal = (0, api_js_1.isServerRuntime)() && process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
36
37
  return (process.env.VIGTHORIA_V3_AGENT_URL ||
37
38
  process.env.V3_AGENT_URL ||
38
39
  (allowLocal ? 'http://127.0.0.1:8030' : null) ||
@@ -57,6 +57,7 @@ const path = __importStar(require("path"));
57
57
  const child_process_1 = require("child_process");
58
58
  const chalk_1 = __importDefault(require("chalk"));
59
59
  const logger_js_1 = require("./logger.js");
60
+ const api_js_1 = require("./api.js");
60
61
  const TOOL_ARG_ALIASES = {
61
62
  read_file: {
62
63
  path: ['file', 'filePath', 'filepath', 'target', 'targetPath'],
@@ -1554,11 +1555,13 @@ class AgenticTools {
1554
1555
  'Authorization': `Bearer ${authToken}`,
1555
1556
  'Content-Type': 'application/json'
1556
1557
  };
1557
- // Try proxy first, then direct Community server
1558
- const pushUrls = [
1559
- `${apiBase}/api/community-repo/push`,
1560
- 'http://localhost:9000/api/repo/push'
1561
- ];
1558
+ // Try proxy first; direct Community server is only reachable when running on the
1559
+ // Vigthoria backend itself (isServerRuntime), never expose this fallback to remote users.
1560
+ const pushUrls = [`${apiBase}/api/community-repo/push`];
1561
+ if ((0, api_js_1.isServerRuntime)()) {
1562
+ const directHost = ['local', 'host'].join('');
1563
+ pushUrls.push(`http://${directHost}:9000/api/repo/push`);
1564
+ }
1562
1565
  let result;
1563
1566
  let lastError = '';
1564
1567
  for (const pushUrl of pushUrls) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigthoria-cli",
3
- "version": "1.8.11",
3
+ "version": "1.8.12",
4
4
  "description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
5
5
  "main": "dist/index.js",
6
6
  "files": [