nextclaw 0.6.24 → 0.6.26

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/dist/cli/index.js CHANGED
@@ -2128,10 +2128,21 @@ var GatewayControllerImpl = class {
2128
2128
  };
2129
2129
  }
2130
2130
  async updateRun(params) {
2131
+ const versionBefore = getPackageVersion();
2131
2132
  const result = runSelfUpdate({ timeoutMs: params.timeoutMs });
2132
2133
  if (!result.ok) {
2133
- return { ok: false, error: result.error ?? "update failed", steps: result.steps };
2134
+ return {
2135
+ ok: false,
2136
+ error: result.error ?? "update failed",
2137
+ steps: result.steps,
2138
+ version: {
2139
+ before: versionBefore,
2140
+ after: getPackageVersion(),
2141
+ changed: false
2142
+ }
2143
+ };
2134
2144
  }
2145
+ const versionAfter = getPackageVersion();
2135
2146
  const delayMs = params.restartDelayMs ?? 0;
2136
2147
  const sentinelPath = await this.writeRestartSentinelPayload({
2137
2148
  kind: "update.run",
@@ -2148,6 +2159,11 @@ var GatewayControllerImpl = class {
2148
2159
  restart: { scheduled: true, delayMs },
2149
2160
  strategy: result.strategy,
2150
2161
  steps: result.steps,
2162
+ version: {
2163
+ before: versionBefore,
2164
+ after: versionAfter,
2165
+ changed: versionBefore !== versionAfter
2166
+ },
2151
2167
  sentinel: sentinelPath ? { path: sentinelPath } : null
2152
2168
  };
2153
2169
  }
@@ -3605,6 +3621,8 @@ ${this.logo} ${APP_NAME4} is ready! (${source})`);
3605
3621
  }
3606
3622
  timeoutMs = parsed;
3607
3623
  }
3624
+ const versionBefore = getPackageVersion();
3625
+ console.log(`Current version: ${versionBefore}`);
3608
3626
  const result = runSelfUpdate({ timeoutMs, cwd: process.cwd() });
3609
3627
  const printSteps = () => {
3610
3628
  for (const step of result.steps) {
@@ -3624,7 +3642,13 @@ ${this.logo} ${APP_NAME4} is ready! (${source})`);
3624
3642
  }
3625
3643
  process.exit(1);
3626
3644
  }
3645
+ const versionAfter = getPackageVersion();
3627
3646
  console.log(`\u2713 Update complete (${result.strategy})`);
3647
+ if (versionAfter === versionBefore) {
3648
+ console.log(`Version unchanged: ${versionBefore}`);
3649
+ } else {
3650
+ console.log(`Version updated: ${versionBefore} -> ${versionAfter}`);
3651
+ }
3628
3652
  const state = readServiceState();
3629
3653
  if (state && isProcessRunning(state.pid)) {
3630
3654
  console.log(`Tip: restart ${APP_NAME4} to apply the update.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextclaw",
3
- "version": "0.6.24",
3
+ "version": "0.6.26",
4
4
  "description": "Lightweight personal AI assistant with CLI, multi-provider routing, and channel integrations.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -38,9 +38,9 @@
38
38
  "dependencies": {
39
39
  "chokidar": "^3.6.0",
40
40
  "commander": "^12.1.0",
41
- "@nextclaw/core": "^0.6.22",
42
- "@nextclaw/server": "^0.4.8",
43
- "@nextclaw/openclaw-compat": "^0.1.15"
41
+ "@nextclaw/core": "^0.6.23",
42
+ "@nextclaw/server": "^0.4.9",
43
+ "@nextclaw/openclaw-compat": "^0.1.16"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^20.17.6",
@@ -23,6 +23,7 @@ When NextClaw AI needs to operate the product itself (status/doctor/channels/con
23
23
  - [AI Self-Management Contract](#ai-self-management-contract)
24
24
  - [Quick Start](#quick-start)
25
25
  - [Configuration](#configuration)
26
+ - [Multi-agent routing & session isolation](#multi-agent-routing--session-isolation-openclaw-aligned)
26
27
  - [Workspace](#workspace)
27
28
  - [Commands](#commands)
28
29
  - [Channels](#channels)
@@ -140,6 +141,64 @@ Restart is still required for:
140
141
 
141
142
  To confirm hot reload succeeded, check gateway console logs or `${NEXTCLAW_HOME:-~/.nextclaw}/logs/service.log` for messages like `Config reload: ... applied.`
142
143
 
144
+ ### Multi-agent routing & session isolation (OpenClaw-aligned)
145
+
146
+ You can now configure OpenClaw-style multi-agent runtime behavior directly in the UI (**Routing & Runtime**) or in `config.json`:
147
+
148
+ - `agents.list`: run multiple resident agent roles in one gateway process
149
+ - `bindings`: route inbound messages by `channel + accountId (+peer)` to a target `agentId`
150
+ - `session.dmScope`: DM isolation strategy (`main` / `per-peer` / `per-channel-peer` / `per-account-channel-peer`)
151
+ - `session.agentToAgent.maxPingPongTurns`: cap cross-agent ping-pong loops (`0` means block auto ping-pong)
152
+
153
+ Example:
154
+
155
+ ```json
156
+ {
157
+ "agents": {
158
+ "defaults": { "model": "openai/gpt-5.2-codex" },
159
+ "list": [
160
+ { "id": "main", "default": true },
161
+ {
162
+ "id": "engineer",
163
+ "workspace": "~/workspace-engineer",
164
+ "model": "openai/gpt-5.2-codex",
165
+ "maxTokens": 12000,
166
+ "maxToolIterations": 24
167
+ }
168
+ ]
169
+ },
170
+ "bindings": [
171
+ {
172
+ "agentId": "engineer",
173
+ "match": {
174
+ "channel": "discord",
175
+ "accountId": "zongzhihui",
176
+ "peer": { "kind": "channel", "id": "dev-room" }
177
+ }
178
+ }
179
+ ],
180
+ "session": {
181
+ "dmScope": "per-account-channel-peer",
182
+ "agentToAgent": { "maxPingPongTurns": 0 }
183
+ }
184
+ }
185
+ ```
186
+
187
+ CLI equivalents:
188
+
189
+ ```bash
190
+ nextclaw config set agents.list '[{"id":"main","default":true},{"id":"engineer"}]' --json
191
+ nextclaw config set bindings '[{"agentId":"engineer","match":{"channel":"discord","accountId":"zongzhihui"}}]' --json
192
+ nextclaw config set session.dmScope '"per-account-channel-peer"' --json
193
+ nextclaw config set session.agentToAgent.maxPingPongTurns 0 --json
194
+ ```
195
+
196
+ For internal AI operations (same as other built-in capabilities):
197
+
198
+ - Yes, the runtime registers the `gateway` tool (`config.get` / `config.schema` / `config.apply` / `config.patch`).
199
+ - The AI can use it to manage the same config surface when you explicitly ask.
200
+ - As with all config mutations, it follows the explicit-request rule (no silent self-mutation).
201
+
143
202
  ---
144
203
 
145
204
  ## Workspace
@@ -262,6 +321,7 @@ Behavior:
262
321
 
263
322
  - If `NEXTCLAW_UPDATE_COMMAND` is set, the CLI executes it (useful for custom update flows).
264
323
  - Otherwise it falls back to `npm i -g nextclaw`.
324
+ - `nextclaw update` now prints version progress explicitly: `Current version: x.y.z`, then either `Version updated: x.y.z -> a.b.c` or `Version unchanged: x.y.z`.
265
325
  - If the background service is running, restart it after the update to apply changes.
266
326
  - When update is triggered from the running gateway (agent `update.run`), NextClaw arms a self-relaunch helper before exiting, so the service comes back automatically (like an OS reboot flow).
267
327
  - After restart, NextClaw automatically pings the last active session with restart/update status (including note when provided).
@@ -292,7 +352,19 @@ Configure channels in the UI at http://127.0.0.1:18791 or in `~/.nextclaw/config
292
352
  "enabled": true,
293
353
  "token": "YOUR_BOT_TOKEN",
294
354
  "allowBots": false,
295
- "allowFrom": []
355
+ "allowFrom": [],
356
+ "accountId": "zongzhihui",
357
+ "dmPolicy": "open",
358
+ "groupPolicy": "allowlist",
359
+ "groupAllowFrom": ["dev-room"],
360
+ "requireMention": true,
361
+ "mentionPatterns": ["@工程师", "@engineer"],
362
+ "groups": {
363
+ "dev-room": {
364
+ "requireMention": true,
365
+ "mentionPatterns": ["@engineer"]
366
+ }
367
+ }
296
368
  }
297
369
  }
298
370
  }
@@ -312,7 +384,19 @@ Configure channels in the UI at http://127.0.0.1:18791 or in `~/.nextclaw/config
312
384
  "telegram": {
313
385
  "enabled": true,
314
386
  "token": "YOUR_BOT_TOKEN",
315
- "allowFrom": ["YOUR_USER_ID"]
387
+ "allowFrom": ["YOUR_USER_ID"],
388
+ "accountId": "zongzhihui",
389
+ "dmPolicy": "open",
390
+ "groupPolicy": "allowlist",
391
+ "groupAllowFrom": ["GROUP_ID"],
392
+ "requireMention": true,
393
+ "mentionPatterns": ["@工程师", "@engineer"],
394
+ "groups": {
395
+ "GROUP_ID": {
396
+ "requireMention": true,
397
+ "mentionPatterns": ["@engineer"]
398
+ }
399
+ }
316
400
  }
317
401
  }
318
402
  }