open-agents-ai 0.187.339 → 0.187.341

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 (2) hide show
  1. package/dist/index.js +75 -59
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -278214,63 +278214,39 @@ var init_listen = __esm({
278214
278214
  return this._ready;
278215
278215
  }
278216
278216
  async start() {
278217
+ let pyPath = "python3";
278218
+ try {
278219
+ const mod2 = await Promise.resolve().then(() => (init_py_embed(), py_embed_exports));
278220
+ const ensure = mod2.ensureEmbedDeps;
278221
+ const getPy = mod2.getVenvPython;
278222
+ if (typeof ensure === "function") {
278223
+ try {
278224
+ const res = ensure();
278225
+ if (res?.log) this.emit("status", res.log.slice(-500));
278226
+ } catch {
278227
+ }
278228
+ }
278229
+ if (typeof getPy === "function") {
278230
+ pyPath = getPy();
278231
+ }
278232
+ } catch {
278233
+ }
278234
+ this.process = spawn18(pyPath, [
278235
+ this.scriptPath,
278236
+ "--model",
278237
+ this.model,
278238
+ "--chunk-seconds",
278239
+ "3",
278240
+ "--window-seconds",
278241
+ "10"
278242
+ ], {
278243
+ stdio: ["pipe", "pipe", "pipe"],
278244
+ env: { ...process.env }
278245
+ });
278217
278246
  return new Promise((resolve40, reject) => {
278218
278247
  const timeout2 = setTimeout(() => {
278219
278248
  reject(new Error("Whisper fallback: model load timeout (5 min). First run downloads the model."));
278220
278249
  }, 3e5);
278221
- (async () => {
278222
- try {
278223
- const mod2 = await Promise.resolve().then(() => (init_py_embed(), py_embed_exports));
278224
- const ensure = mod2.ensureEmbedDeps;
278225
- const getPy = mod2.getVenvPython;
278226
- if (typeof ensure === "function" && typeof getPy === "function") {
278227
- try {
278228
- const res = ensure();
278229
- if (res?.log) this.emit("status", res.log.slice(-500));
278230
- } catch {
278231
- }
278232
- const pyPath = getPy();
278233
- this.process = spawn18(pyPath, [
278234
- this.scriptPath,
278235
- "--model",
278236
- this.model,
278237
- "--chunk-seconds",
278238
- "3",
278239
- "--window-seconds",
278240
- "10"
278241
- ], {
278242
- stdio: ["pipe", "pipe", "pipe"],
278243
- env: { ...process.env }
278244
- });
278245
- } else {
278246
- this.process = spawn18("python3", [
278247
- this.scriptPath,
278248
- "--model",
278249
- this.model,
278250
- "--chunk-seconds",
278251
- "3",
278252
- "--window-seconds",
278253
- "10"
278254
- ], {
278255
- stdio: ["pipe", "pipe", "pipe"],
278256
- env: { ...process.env }
278257
- });
278258
- }
278259
- } catch {
278260
- this.process = spawn18("python3", [
278261
- this.scriptPath,
278262
- "--model",
278263
- this.model,
278264
- "--chunk-seconds",
278265
- "3",
278266
- "--window-seconds",
278267
- "10"
278268
- ], {
278269
- stdio: ["pipe", "pipe", "pipe"],
278270
- env: { ...process.env }
278271
- });
278272
- }
278273
- })();
278274
278250
  const rl = createInterface2({ input: this.process.stdout });
278275
278251
  rl.on("line", (line) => {
278276
278252
  try {
@@ -278464,6 +278440,33 @@ var init_listen = __esm({
278464
278440
  if (tc) {
278465
278441
  const TranscribeLive = tc.TranscribeLive;
278466
278442
  if (TranscribeLive) {
278443
+ let tcUpToDate = false;
278444
+ try {
278445
+ const tcPkgPath = join69(dirname18(__require.resolve?.("transcribe-cli/package.json") || ""), "package.json");
278446
+ if (existsSync53(tcPkgPath)) {
278447
+ const tcPkg = JSON.parse(__require("fs").readFileSync(tcPkgPath, "utf8"));
278448
+ tcUpToDate = tcPkg.version && tcPkg.version >= "2.0.1";
278449
+ }
278450
+ } catch {
278451
+ try {
278452
+ const out = execSync44("npm list -g transcribe-cli --depth=0 --json", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 1e4 });
278453
+ const parsed = JSON.parse(out);
278454
+ const ver = parsed?.dependencies?.["transcribe-cli"]?.version || "";
278455
+ tcUpToDate = ver >= "2.0.1";
278456
+ } catch {
278457
+ }
278458
+ }
278459
+ if (!tcUpToDate) {
278460
+ try {
278461
+ execSync44("npm i -g transcribe-cli@latest", { stdio: "pipe", timeout: 12e4 });
278462
+ this.transcribeCliAvailable = null;
278463
+ const reloaded = await this.loadTranscribeCli();
278464
+ if (reloaded?.TranscribeLive) {
278465
+ tc = reloaded;
278466
+ }
278467
+ } catch {
278468
+ }
278469
+ }
278467
278470
  const venvReady = ensureVenvForTranscribeCli();
278468
278471
  if (!venvReady) {
278469
278472
  transcribeCliError = "venv Python missing numpy (required by transcribe-cli) — using whisper fallback";
@@ -325580,9 +325583,24 @@ function textResponse(res, status, body, contentType = "text/plain") {
325580
325583
  }
325581
325584
  function isOriginAllowed(origin) {
325582
325585
  if (!origin) return true;
325583
- if (_corsOrigins.includes("*")) return true;
325584
- if (_corsLocalOnly) return /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin);
325585
- return _corsOrigins.some((p2) => origin === p2 || p2.includes("*") && new RegExp("^" + p2.replace(/\*/g, ".*") + "$").test(origin));
325586
+ const accessMode = (process.env["OA_ACCESS"] || "").toLowerCase().trim();
325587
+ if (accessMode === "any") return true;
325588
+ if (accessMode === "lan") {
325589
+ try {
325590
+ const u = new URL(origin);
325591
+ const host = u.hostname;
325592
+ if (/^(localhost|127\.\d+\.\d+\.\d+|::1|\[::1\])$/.test(host)) return true;
325593
+ if (/^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.|169\.254\.)/.test(host)) return true;
325594
+ if (/^f[cd][0-9a-f]{2}:/i.test(host) || /^fe[89ab][0-9a-f]:/i.test(host)) return true;
325595
+ } catch {
325596
+ }
325597
+ }
325598
+ const corsOrigins = (process.env["OA_CORS_ORIGINS"] || "").split(",").filter(Boolean);
325599
+ if (corsOrigins.includes("*")) return true;
325600
+ if (corsOrigins.length > 0) {
325601
+ return corsOrigins.some((p2) => origin === p2 || p2.includes("*") && new RegExp("^" + p2.replace(/\*/g, ".*") + "$").test(origin));
325602
+ }
325603
+ return /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin);
325586
325604
  }
325587
325605
  function corsHeaders(req2, res) {
325588
325606
  const origin = req2.headers["origin"];
@@ -330436,7 +330454,7 @@ function setTimerEnabled(name11, enabled2) {
330436
330454
  return false;
330437
330455
  }
330438
330456
  }
330439
- var endpointRegistry, modelRouteMap, endpointUsage, metrics, startedAt, _corsOrigins, _corsLocalOnly, runningProcesses, perKeyUsage, CRON_MARKER2;
330457
+ var endpointRegistry, modelRouteMap, endpointUsage, metrics, startedAt, runningProcesses, perKeyUsage, CRON_MARKER2;
330440
330458
  var init_serve = __esm({
330441
330459
  "packages/cli/src/api/serve.ts"() {
330442
330460
  "use strict";
@@ -330469,8 +330487,6 @@ var init_serve = __esm({
330469
330487
  totalErrors: 0
330470
330488
  };
330471
330489
  startedAt = Date.now();
330472
- _corsOrigins = (process.env["OA_CORS_ORIGINS"] || "").split(",").filter(Boolean);
330473
- _corsLocalOnly = _corsOrigins.length === 0;
330474
330490
  runningProcesses = /* @__PURE__ */ new Map();
330475
330491
  perKeyUsage = /* @__PURE__ */ new Map();
330476
330492
  CRON_MARKER2 = "# OPEN-AGENTS-SCHEDULED:";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.339",
3
+ "version": "0.187.341",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -83,6 +83,7 @@
83
83
  "ignore": "^6.0.2",
84
84
  "nats.ws": "^1.30.3",
85
85
  "open-agents-nexus": "^1.17.3",
86
+ "transcribe-cli": "^2.0.1",
86
87
  "ws": "^8.20.0",
87
88
  "zod": "^3.24.1"
88
89
  },