@nanhara/hara 0.125.3 → 0.126.0
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/CHANGELOG.md +40 -1
- package/README.md +6 -3
- package/dist/agent/limits.js +2 -2
- package/dist/agent/loop.js +270 -98
- package/dist/config.js +172 -4
- package/dist/gateway/flows-pending.js +14 -36
- package/dist/gateway/wecom.js +9 -1
- package/dist/index.js +359 -153
- package/dist/mcp/client.js +1 -0
- package/dist/providers/bounded-turn.js +6 -0
- package/dist/providers/factory.js +54 -0
- package/dist/providers/openai.js +6 -1
- package/dist/providers/registry.js +1 -0
- package/dist/providers/target.js +98 -0
- package/dist/security/guardian.js +6 -1
- package/dist/security/private-state.js +1 -1
- package/dist/security/secrets.js +19 -0
- package/dist/serve/protocol.js +7 -2
- package/dist/serve/server.js +139 -35
- package/dist/serve/sessions.js +11 -2
- package/dist/session/operation-drain.js +45 -0
- package/dist/tools/agent.js +1 -0
- package/dist/tools/all.js +1 -0
- package/dist/tools/ask_user.js +8 -3
- package/dist/tools/builtin.js +19 -1
- package/dist/tools/codebase.js +1 -0
- package/dist/tools/computer.js +1 -0
- package/dist/tools/cron.js +10 -0
- package/dist/tools/external_agent.js +1 -0
- package/dist/tools/memory.js +2 -0
- package/dist/tools/registry.js +95 -4
- package/dist/tools/result-limit.js +172 -2
- package/dist/tools/runtime.js +67 -0
- package/dist/tools/search.js +3 -0
- package/dist/tools/skill.js +1 -0
- package/dist/tools/task.js +5 -0
- package/dist/tools/todo.js +3 -2
- package/dist/tools/web.js +4 -0
- package/dist/tui/App.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ All notable changes to `@nanhara/hara`.
|
|
|
5
5
|
> Versioning (pre-1.0, SemVer-style): the **minor** (middle) number bumps for a **new feature**; the
|
|
6
6
|
> **patch** (last) number bumps for **optimizations/fixes of existing features**.
|
|
7
7
|
|
|
8
|
+
## 0.126.0 — 2026-07-19 — provider control plane, bounded tools, and honest execution time
|
|
9
|
+
|
|
10
|
+
- **Desktop can configure providers through an authenticated, redacted Serve control plane.** The shared
|
|
11
|
+
catalog distinguishes cloud, local, OAuth, and managed routes; settings can list, test, and save a Personal
|
|
12
|
+
route without returning credentials to the UI. Switching provider or endpoint requires a matching new key
|
|
13
|
+
instead of replaying another vendor's credential, named/managed profiles remain explicit, and launch-time
|
|
14
|
+
environment overrides stay immutable from Desktop.
|
|
15
|
+
- **Ollama and LM Studio are first-class local providers.** They require no fake API key, accept only
|
|
16
|
+
loopback HTTP endpoints, omit the Authorization header on the wire, and can discover installed models
|
|
17
|
+
through the same bounded connection-test path. Cloud custom endpoints continue to require HTTPS except
|
|
18
|
+
for an explicit loopback target.
|
|
19
|
+
- **Tool execution has conservative runtime traits.** Tools without a complete declaration default to
|
|
20
|
+
side-effect-capable and serial; input-level classification can narrow a real read but cannot turn a
|
|
21
|
+
mutating call into an inherited read approval. Parallel calls share an aggregate result budget so one
|
|
22
|
+
round cannot flood the next model request.
|
|
23
|
+
- **Long-tail tool schemas and large results are demand-loaded.** `tool_search` activates only matched,
|
|
24
|
+
role-allowed capabilities for the next model round. Oversized, redacted tool output is kept in a
|
|
25
|
+
quota/TTL-bounded private store and exposed only through opaque `tool_result_read` continuation IDs, never
|
|
26
|
+
arbitrary filesystem paths.
|
|
27
|
+
|
|
28
|
+
- Human clarification and approval waits no longer consume `runTimeoutMs`. The non-renewable budget now
|
|
29
|
+
measures active model/tool execution, resumes with the exact remaining time after an answer, and still
|
|
30
|
+
stops genuinely stuck providers, tools, and loops. Esc, shutdown, and explicit cancellation continue to
|
|
31
|
+
dismiss a waiting prompt immediately.
|
|
32
|
+
- The TUI distinguishes this state as `waiting for your answer · task timer paused`; five-minute and 80%
|
|
33
|
+
lifecycle notices no longer fire while Hara is waiting for a person.
|
|
34
|
+
- `hara serve` now exposes authenticated `server.shutdown` so Desktop can gracefully release sessions and
|
|
35
|
+
locks before relaunching after an update.
|
|
36
|
+
- Timed-out or interrupted provider/tool calls retain their Serve session lease until the underlying
|
|
37
|
+
operation physically settles. A second turn, session deletion, or updater shutdown receives `BUSY`
|
|
38
|
+
instead of overlapping a non-cooperative request or releasing its lock early.
|
|
39
|
+
- Headless resumed sessions use the same physical-lifetime rule for dynamically nested sub-agents and
|
|
40
|
+
automatic compaction, so a late child request cannot escape a cleanup snapshot and release the
|
|
41
|
+
cross-process lock early.
|
|
42
|
+
- The WeCom gateway now uses the bundled `ws` transport because Node 22's native WebSocket handshake is
|
|
43
|
+
rejected by WeCom's production endpoint before authentication. A late authentication frame can no longer
|
|
44
|
+
revive an already-aborted connection or install a heartbeat after cleanup.
|
|
45
|
+
- Upgrade with `npm i -g @nanhara/hara@0.126.0`.
|
|
46
|
+
|
|
8
47
|
## 0.125.3 — 2026-07-18 — conversation/task boundary and deliberate execution
|
|
9
48
|
|
|
10
49
|
- **Chat delivery is now separate from task execution.** Slash controls such as `/model` no longer create a
|
|
@@ -38,7 +77,7 @@ All notable changes to `@nanhara/hara`.
|
|
|
38
77
|
unless `HARA_ALLOW_TRUSTED_EXTENSIONS=1` was set before launch.
|
|
39
78
|
- MCP stderr now drops only npm 11's repeated `Unknown user config "always-auth"` and `"home"` deprecation
|
|
40
79
|
lines. Other npm warnings and all actual server errors remain visible and redacted. Hara does not read,
|
|
41
|
-
rewrite, or weaken the user's `.npmrc`. Esc, interruption, and the
|
|
80
|
+
rewrite, or weaken the user's `.npmrc`. Esc, interruption, and the active-execution deadline now also cancel a
|
|
42
81
|
lazy MCP startup/tool call and close an unresponsive child instead of leaving it behind.
|
|
43
82
|
- Upgrade with `npm i -g @nanhara/hara@0.125.3`.
|
|
44
83
|
|
package/README.md
CHANGED
|
@@ -286,9 +286,12 @@ checkpointed in its own model/tool round. Mixed tools are classified by action (
|
|
|
286
286
|
a brief revision cannot share its round with a side effect. `/task` shows the current execution identity and brief. See
|
|
287
287
|
[`docs/conversation-task-execution.md`](docs/conversation-task-execution.md).
|
|
288
288
|
**Notifications**: `hara config set notify bell` (terminal bell) or `notify system` (OS notification) pings you when a turn finishes — handy for long runs you've stepped away from. Gated on elapsed time so quick turns stay quiet; off by default.
|
|
289
|
-
**Run limits and loop alarms**: every agent turn has a non-renewable 30-minute
|
|
290
|
-
model/tool cap.
|
|
291
|
-
|
|
289
|
+
**Run limits and loop alarms**: every agent turn has a non-renewable 30-minute active-execution budget and a
|
|
290
|
+
64-round model/tool cap. Time spent waiting for an engine-owned question or approval does not consume that
|
|
291
|
+
budget; the status row says the task timer is paused, while Esc, shutdown, and explicit cancellation still
|
|
292
|
+
take effect immediately. Answering resumes the remaining budget rather than resetting it. Hara warns after
|
|
293
|
+
five active minutes or at 75% of the round budget, stops the third identical failing tool call, and surfaces
|
|
294
|
+
the final reason in CLI, Desktop, or gateway output. Tune intentional long work with
|
|
292
295
|
`hara config set runTimeoutMs 45m` (1s..2h) and `hara config set maxAgentRounds 96` (1..256), or
|
|
293
296
|
`HARA_RUN_TIMEOUT_MS` / `HARA_MAX_AGENT_ROUNDS`; neither boundary can be disabled. Sub-agents are capped at
|
|
294
297
|
8 minutes/24 rounds and inherit the parent's cancellation. Auxiliary model work (planning, verification,
|
package/dist/agent/limits.js
CHANGED
|
@@ -19,8 +19,8 @@ export function parseAgentRunTimeoutMs(value) {
|
|
|
19
19
|
const parsed = amount * multiplier;
|
|
20
20
|
return Number.isFinite(parsed) ? parsed : undefined;
|
|
21
21
|
}
|
|
22
|
-
/** Parse
|
|
23
|
-
* as `30m`, `90s`, and `1h` are accepted in config; HARA_RUN_TIMEOUT_MS also accepts plain milliseconds. */
|
|
22
|
+
/** Parse the active execution deadline. Invalid/zero values cannot disable the safety boundary. Human values
|
|
23
|
+
* such as `30m`, `90s`, and `1h` are accepted in config; HARA_RUN_TIMEOUT_MS also accepts plain milliseconds. */
|
|
24
24
|
export function agentRunTimeoutMs(value = process.env.HARA_RUN_TIMEOUT_MS) {
|
|
25
25
|
const parsed = parseAgentRunTimeoutMs(value);
|
|
26
26
|
if (parsed === undefined || parsed <= 0)
|