@asobacloud/nehanda 0.6.0 → 0.6.1

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.
package/README.md CHANGED
@@ -497,6 +497,10 @@ node tests/unit/ui_legibility_behavioral.mjs
497
497
 
498
498
  ## Changelog
499
499
 
500
+ ### 0.6.1
501
+
502
+ - **Fix: Laya provisioning smoke test (`lib/scripts/ensure-laya-env.sh`):** The `Router()` constructibility check was missing `import sys`, causing `npm install` to fail with `NameError: name 'sys' is not defined` even when all packages installed successfully. The marker file was never written, leaving the CLI in a permanently broken state despite a complete venv. Fixed.
503
+
500
504
  ### 0.6.0
501
505
 
502
506
  - **Provider API Key Management (`lib/auth.mjs`, `lib/orchestrate.mjs`, `bin/nehanda-ui.mjs`):** OpenRouter, ZhipuAI (z.ai), and generic OpenAI-compatible providers can now be configured entirely from within the REPL. `/key openrouter sk-or-v1-...` saves the key to the secure file and auto-sets `base_url`. `/key zhipu sk-zai-...` saves the ZhipuAI key. `/config` now shows compat and Zhipu key status (masked). Fixes a pre-existing gap where `resolveZhipuApiKey()` existed in `lib/auth.mjs` but was never called by the orchestrator — the `zhipu` provider fell through to `OPENAI_API_KEY`. Closes #1.
@@ -54,6 +54,10 @@ function attachChild(c) {
54
54
  }
55
55
  }
56
56
  })
57
+ // Unref after listener attachment — adding a 'data' listener re-refs the stream,
58
+ // so unref must come after to actually take effect. This prevents the stdout pipe
59
+ // from holding the Node event loop open when the sidecar runs as a background daemon.
60
+ c.stdout.unref()
57
61
  c.on('error', err => {
58
62
  process.stderr.write(`[laya-sidecar] worker error: ${err.message}\n`)
59
63
  child = null
@@ -88,9 +92,8 @@ function ensureChild() {
88
92
  env: { ...process.env },
89
93
  })
90
94
  child.unref()
91
- // Unref stdio streams so they don't prevent Node from exiting.
92
- // The sidecar is a background daemon — its pipes must not hold the event loop.
93
- child.stdout.unref()
95
+ // stdin and stderr unreffed here; stdout is unreffed inside attachChild
96
+ // after its 'data' listener is attached (re-ref order matters).
94
97
  child.stdin.unref()
95
98
  child.stderr.unref()
96
99
  restartCount += 1
@@ -46,6 +46,7 @@ PY
46
46
 
47
47
  # Smoke: Router constructible (model weights download on first predict/load)
48
48
  "$PY" - <<'PY'
49
+ import sys
49
50
  from laya import Router
50
51
  Router()
51
52
  print("[laya-env] Router() constructible", file=sys.stderr)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asobacloud/nehanda",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "description": "Agentic terminal REPL and single-process engine for governed AI deep research and software development. Connects to Nehanda v3, OpenRouter, Ollama, LM Studio, ZhipuAI, or any OpenAI-compatible API. Includes Laya System-1 control plane for memory management, pre-execution safety gating, and intent-driven instruction shaping.",
6
6
  "keywords": [