@melaya/runner 1.1.35 → 1.1.36

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/pythonEnv.js +24 -3
  2. package/package.json +1 -1
package/dist/pythonEnv.js CHANGED
@@ -73,7 +73,15 @@ const PIP_DEPS = [
73
73
  "filetype",
74
74
  "json5",
75
75
  "json_repair",
76
- "mcp>=1.13",
76
+ // PINNED <2: mcp 2.x renamed `streamablehttp_client` →
77
+ // `streamable_http_client` in mcp.client.streamable_http, which the in-house
78
+ // agentscope imports by the OLD name (agentscope/mcp/_http_state*_client.py).
79
+ // Unpinned `mcp>=1.13` let a FRESH venv pull 2.x → `import agentscope` fails
80
+ // with "cannot import name 'streamablehttp_client'", so the assistant host
81
+ // never boots. Old cached venvs kept 1.x and worked, which is why this only
82
+ // bit fresh installs (e.g. the Mac 3.14→3.12 rebuild). Keep on the 1.x line
83
+ // until agentscope is updated to the 2.x API.
84
+ "mcp>=1.13,<2",
77
85
  "numpy",
78
86
  "openai",
79
87
  "python-datauri",
@@ -440,14 +448,27 @@ export async function ensurePythonEnv(systemPython, expectedVersion, onProgress
440
448
  }
441
449
  // Step 2: upgrade pip + wheel so wheel-based deps install cleanly.
442
450
  onProgress("upgrading pip / wheel inside the venv");
443
- await runProc(venvPython(), ["-m", "pip", "install", "--quiet", "--upgrade", "pip", "wheel"], onProgress);
451
+ // --use-feature=truststore makes pip verify TLS against the OS trust store
452
+ // instead of its bundled roots — required behind TLS-intercepting proxies /
453
+ // antivirus (else "CERTIFICATE_VERIFY_FAILED: unable to get local issuer
454
+ // certificate" and the whole venv build fails → agentscope import breaks).
455
+ // Same fix as uv's UV_SYSTEM_CERTS. Needs pip>=23.2, which every Python we
456
+ // provision (uv-managed 3.12) or accept (3.11/3.12) bundles.
457
+ await runProc(venvPython(), ["-m", "pip", "install", "--use-feature=truststore", "--quiet", "--upgrade", "pip", "wheel"], onProgress);
444
458
  // Step 3: install agentscope's transitive deps + tool extras directly.
445
459
  // We do NOT pip-install agentscope itself — the shared bundle ships
446
460
  // only *.py files (no pyproject.toml), so PYTHONPATH-based import is
447
461
  // the only path. The cached agentscope source under
448
462
  // ~/.melaya-runner/agentscope/ resolves via PYTHONPATH at spawn time.
449
463
  onProgress(`installing ${PIP_DEPS.length} python deps (anthropic, openai, opentelemetry, …) — first run can take 1-2 min`);
450
- const acode = await runProc(venvPython(), ["-m", "pip", "install", "--quiet", "--disable-pip-version-check", ...PIP_DEPS], onProgress);
464
+ const acode = await runProc(venvPython(),
465
+ // --no-cache-dir: skip pip's on-disk HTTP/wheel cache. It silences the
466
+ // "Cache entry deserialization failed, entry ignored" warning flood (stale
467
+ // entries left by other Python versions in the shared user cache) and, more
468
+ // importantly, guarantees a corrupt cached wheel can never install a subtly
469
+ // broken package into a fresh runner venv. Costs a re-download on rebuild,
470
+ // which is rare (only on a deps change or a manual clear).
471
+ ["-m", "pip", "install", "--use-feature=truststore", "--no-cache-dir", "--quiet", "--disable-pip-version-check", ...PIP_DEPS], onProgress);
451
472
  if (acode !== 0) {
452
473
  return {
453
474
  ok: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melaya/runner",
3
- "version": "1.1.35",
3
+ "version": "1.1.36",
4
4
  "description": "Run Melaya AI pipelines locally with your own LM Studio or Ollama models",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,