open-agents-ai 0.185.36 → 0.185.38

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 +20 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -35970,7 +35970,22 @@ let opusEncoder = null, opusDecoder = null;
35970
35970
  let agentText = '';
35971
35971
 
35972
35972
  function connectPP() {
35973
- const url = PP_WS_URL + '/api/chat?text_prompt=' + encodeURIComponent(TEXT_PROMPT) +
35973
+ // If PersonaPlex is on localhost but we're accessed via a tunnel,
35974
+ // proxy through the tunnel's origin instead of connecting directly to localhost
35975
+ let wsBase = PP_WS_URL;
35976
+ if (wsBase.includes('127.0.0.1') || wsBase.includes('localhost')) {
35977
+ // Check if we're behind a tunnel \u2014 if window.location.hostname isn't localhost,
35978
+ // we can't reach the PersonaPlex daemon directly. Build URL from current origin.
35979
+ const host = window.location.hostname;
35980
+ if (host !== 'localhost' && host !== '127.0.0.1' && !host.startsWith('192.168.')) {
35981
+ // We're on a tunnel \u2014 PersonaPlex needs to be reachable at the same origin
35982
+ // This requires the PersonaPlex server to be tunneled separately or proxied
35983
+ // For now, try the PP port via same hostname
35984
+ const proto = window.location.protocol === 'https:' ? 'wss' : 'ws';
35985
+ wsBase = proto + '://' + host + ':8998';
35986
+ }
35987
+ }
35988
+ const url = wsBase + '/api/chat?text_prompt=' + encodeURIComponent(TEXT_PROMPT) +
35974
35989
  '&voice_prompt=' + encodeURIComponent(VOICE_PROMPT) + '&seed=-1';
35975
35990
  statusEl.textContent = 'connecting to PersonaPlex...';
35976
35991
  ppWs = new WebSocket(url);
@@ -36402,14 +36417,15 @@ var init_voice_session = __esm({
36402
36417
  }
36403
36418
  // ── HTTP handler ──────────────────────────────────────────────────────
36404
36419
  handleHTTP(req, res) {
36405
- if (req.url === "/" || req.url === "/index.html") {
36420
+ const pathname = (req.url ?? "/").split("?")[0];
36421
+ if (pathname === "/" || pathname === "/index.html") {
36406
36422
  res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
36407
36423
  if (this.personaPlexWsUrl) {
36408
36424
  res.end(generatePersonaPlexHTML(this.personaPlexWsUrl, this.personaPlexTextPrompt, this.personaPlexVoicePrompt));
36409
36425
  } else {
36410
36426
  res.end(generateFrontendHTML());
36411
36427
  }
36412
- } else if (req.url === "/health") {
36428
+ } else if (pathname === "/health") {
36413
36429
  res.writeHead(200, { "Content-Type": "application/json" });
36414
36430
  res.end(JSON.stringify({
36415
36431
  active: this.state.active,
@@ -41545,7 +41561,7 @@ async function installPersonaPlex(onInfo, weightTier) {
41545
41561
  log("ARM64: Installing remaining moshi dependencies...");
41546
41562
  await execAsync(`"${pip}" install --quiet "numpy>=1.26,<2.2" "safetensors>=0.4.0,<0.5" "huggingface-hub>=0.24,<0.25" "einops==0.7" "sentencepiece==0.2" "sounddevice==0.5" "aiohttp>=3.10.5,<3.11"`, { timeout: 3e5 });
41547
41563
  } else {
41548
- await execAsync(`"${pip}" install --quiet "${join54(repoDir, "moshi")}/."`, { timeout: 3e5 });
41564
+ await execAsync(`"${pip}" install --quiet "${join54(repoDir, "moshi")}/."`, { timeout: 6e5 });
41549
41565
  }
41550
41566
  } catch (err) {
41551
41567
  log(`Moshi install failed: ${err instanceof Error ? err.message : String(err)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.185.36",
3
+ "version": "0.185.38",
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",