nextclaw 0.16.20 → 0.16.21
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 +84 -52
- package/package.json +9 -9
package/dist/cli/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
loadConfig as loadConfig21,
|
|
11
11
|
saveConfig as saveConfig11,
|
|
12
12
|
getConfigPath as getConfigPath11,
|
|
13
|
-
getDataDir as
|
|
13
|
+
getDataDir as getDataDir11,
|
|
14
14
|
getWorkspacePath as getWorkspacePath13,
|
|
15
15
|
expandHome as expandHome2,
|
|
16
16
|
MessageBus as MessageBus3,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
setPluginRuntimeBridge as setPluginRuntimeBridge3
|
|
29
29
|
} from "@nextclaw/openclaw-compat";
|
|
30
30
|
import { existsSync as existsSync13, mkdirSync as mkdirSync7, readFileSync as readFileSync10, writeFileSync as writeFileSync6 } from "fs";
|
|
31
|
-
import { join as join9, resolve as
|
|
31
|
+
import { join as join9, resolve as resolve15 } from "path";
|
|
32
32
|
import { createInterface as createInterface3 } from "readline";
|
|
33
33
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
34
34
|
import { spawn as spawn4 } from "child_process";
|
|
@@ -456,8 +456,8 @@ function isRecord(value) {
|
|
|
456
456
|
var MARKETPLACE_NETWORK_RETRY_ATTEMPTS = 5;
|
|
457
457
|
var MARKETPLACE_NETWORK_RETRY_BASE_MS = 350;
|
|
458
458
|
function sleepMs(ms) {
|
|
459
|
-
return new Promise((
|
|
460
|
-
setTimeout(
|
|
459
|
+
return new Promise((resolve16) => {
|
|
460
|
+
setTimeout(resolve16, ms);
|
|
461
461
|
});
|
|
462
462
|
}
|
|
463
463
|
function isRetryableMarketplaceNetworkError(error) {
|
|
@@ -853,6 +853,7 @@ function isRecord2(value) {
|
|
|
853
853
|
// src/cli/update/runner.ts
|
|
854
854
|
import { spawnSync } from "child_process";
|
|
855
855
|
import { resolve as resolve5 } from "path";
|
|
856
|
+
import { createExternalCommandEnv as createExternalCommandEnv2 } from "@nextclaw/core";
|
|
856
857
|
|
|
857
858
|
// src/cli/utils.ts
|
|
858
859
|
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3, rmSync as rmSync3 } from "fs";
|
|
@@ -860,7 +861,11 @@ import { join as join2, resolve as resolve4 } from "path";
|
|
|
860
861
|
import { spawn } from "child_process";
|
|
861
862
|
import { isIP } from "net";
|
|
862
863
|
import { fileURLToPath } from "url";
|
|
863
|
-
import {
|
|
864
|
+
import {
|
|
865
|
+
createExternalCommandEnv,
|
|
866
|
+
getDataDir as getDataDir2,
|
|
867
|
+
getPackageVersion as getCorePackageVersion
|
|
868
|
+
} from "@nextclaw/core";
|
|
864
869
|
function resolveUiConfig(config2, overrides) {
|
|
865
870
|
const base = config2.ui ?? { enabled: false, host: "127.0.0.1", port: 55667, open: false };
|
|
866
871
|
return { ...base, ...overrides ?? {} };
|
|
@@ -960,7 +965,7 @@ async function waitForExit(pid, timeoutMs) {
|
|
|
960
965
|
if (!isProcessRunning(pid)) {
|
|
961
966
|
return true;
|
|
962
967
|
}
|
|
963
|
-
await new Promise((
|
|
968
|
+
await new Promise((resolve16) => setTimeout(resolve16, 200));
|
|
964
969
|
}
|
|
965
970
|
return !isProcessRunning(pid);
|
|
966
971
|
}
|
|
@@ -991,7 +996,11 @@ function openBrowser(url) {
|
|
|
991
996
|
command = "xdg-open";
|
|
992
997
|
args = [url];
|
|
993
998
|
}
|
|
994
|
-
const child = spawn(command, args, {
|
|
999
|
+
const child = spawn(command, args, {
|
|
1000
|
+
stdio: "ignore",
|
|
1001
|
+
detached: true,
|
|
1002
|
+
env: createExternalCommandEnv(process.env)
|
|
1003
|
+
});
|
|
995
1004
|
child.unref();
|
|
996
1005
|
}
|
|
997
1006
|
function normalizePathEntries(rawPath, platform) {
|
|
@@ -1087,8 +1096,8 @@ function printAgentResponse(response) {
|
|
|
1087
1096
|
async function prompt(rl, question) {
|
|
1088
1097
|
rl.setPrompt(question);
|
|
1089
1098
|
rl.prompt();
|
|
1090
|
-
return new Promise((
|
|
1091
|
-
rl.once("line", (line) =>
|
|
1099
|
+
return new Promise((resolve16) => {
|
|
1100
|
+
rl.once("line", (line) => resolve16(line));
|
|
1092
1101
|
});
|
|
1093
1102
|
}
|
|
1094
1103
|
|
|
@@ -1108,6 +1117,7 @@ function runSelfUpdate(options = {}) {
|
|
|
1108
1117
|
const runStep = (cmd, args, cwd) => {
|
|
1109
1118
|
const result = spawnSync(cmd, args, {
|
|
1110
1119
|
cwd,
|
|
1120
|
+
env: createExternalCommandEnv2(process.env),
|
|
1111
1121
|
encoding: "utf-8",
|
|
1112
1122
|
timeout: timeoutMs,
|
|
1113
1123
|
stdio: "pipe"
|
|
@@ -1888,8 +1898,8 @@ var PluginCommands = class {
|
|
|
1888
1898
|
input: process.stdin,
|
|
1889
1899
|
output: process.stdout
|
|
1890
1900
|
});
|
|
1891
|
-
const answer = await new Promise((
|
|
1892
|
-
rl.question(`${question} [y/N] `, (line) =>
|
|
1901
|
+
const answer = await new Promise((resolve16) => {
|
|
1902
|
+
rl.question(`${question} [y/N] `, (line) => resolve16(line));
|
|
1893
1903
|
});
|
|
1894
1904
|
rl.close();
|
|
1895
1905
|
const normalized = answer.trim().toLowerCase();
|
|
@@ -4172,17 +4182,17 @@ var DiagnosticsCommands = class {
|
|
|
4172
4182
|
}
|
|
4173
4183
|
}
|
|
4174
4184
|
async checkPortAvailability(params) {
|
|
4175
|
-
return await new Promise((
|
|
4185
|
+
return await new Promise((resolve16) => {
|
|
4176
4186
|
const server = createNetServer();
|
|
4177
4187
|
server.once("error", (error) => {
|
|
4178
|
-
|
|
4188
|
+
resolve16({
|
|
4179
4189
|
available: false,
|
|
4180
4190
|
detail: `bind failed on ${params.host}:${params.port} (${String(error)})`
|
|
4181
4191
|
});
|
|
4182
4192
|
});
|
|
4183
4193
|
server.listen(params.port, params.host, () => {
|
|
4184
4194
|
server.close(() => {
|
|
4185
|
-
|
|
4195
|
+
resolve16({
|
|
4186
4196
|
available: true,
|
|
4187
4197
|
detail: `bind ok on ${params.host}:${params.port}`
|
|
4188
4198
|
});
|
|
@@ -4200,13 +4210,13 @@ import {
|
|
|
4200
4210
|
stopPluginChannelGateways as stopPluginChannelGateways2
|
|
4201
4211
|
} from "@nextclaw/openclaw-compat";
|
|
4202
4212
|
import { appendFileSync, closeSync as closeSync2, cpSync as cpSync2, existsSync as existsSync11, mkdirSync as mkdirSync5, openSync as openSync2 } from "fs";
|
|
4203
|
-
import { dirname as dirname3, join as join7, resolve as
|
|
4213
|
+
import { dirname as dirname3, join as join7, resolve as resolve13 } from "path";
|
|
4204
4214
|
import { spawn as spawn3 } from "child_process";
|
|
4205
4215
|
import { request as httpRequest } from "http";
|
|
4206
4216
|
import { request as httpsRequest } from "https";
|
|
4207
4217
|
import { createServer as createNetServer2 } from "net";
|
|
4208
4218
|
import { setImmediate as waitForNextTick } from "timers/promises";
|
|
4209
|
-
import
|
|
4219
|
+
import chokidar2 from "chokidar";
|
|
4210
4220
|
|
|
4211
4221
|
// src/cli/missing-provider.ts
|
|
4212
4222
|
import { LLMProvider } from "@nextclaw/core";
|
|
@@ -4461,6 +4471,8 @@ var ServiceMarketplaceInstaller = class {
|
|
|
4461
4471
|
};
|
|
4462
4472
|
|
|
4463
4473
|
// src/cli/commands/service-startup-support.ts
|
|
4474
|
+
import chokidar from "chokidar";
|
|
4475
|
+
import { resolve as resolve9 } from "path";
|
|
4464
4476
|
var pluginGatewayLogger = {
|
|
4465
4477
|
info: (message) => console.log(`[plugins] ${message}`),
|
|
4466
4478
|
warn: (message) => console.warn(`[plugins] ${message}`),
|
|
@@ -4488,16 +4500,35 @@ async function startGatewaySupportServices(params) {
|
|
|
4488
4500
|
await params.startCron();
|
|
4489
4501
|
await params.startHeartbeat();
|
|
4490
4502
|
}
|
|
4503
|
+
function watchCronStoreFile(params) {
|
|
4504
|
+
const cronStorePath = resolve9(params.cronStorePath);
|
|
4505
|
+
const watcher = chokidar.watch(cronStorePath, {
|
|
4506
|
+
ignoreInitial: true,
|
|
4507
|
+
awaitWriteFinish: { stabilityThreshold: 200, pollInterval: 50 }
|
|
4508
|
+
});
|
|
4509
|
+
watcher.on("all", (event, changedPath) => {
|
|
4510
|
+
if (resolve9(changedPath) !== cronStorePath) {
|
|
4511
|
+
return;
|
|
4512
|
+
}
|
|
4513
|
+
if (event === "add" || event === "change" || event === "unlink") {
|
|
4514
|
+
try {
|
|
4515
|
+
params.reloadCronStore();
|
|
4516
|
+
} catch (error) {
|
|
4517
|
+
console.error(`Cron store reload failed (${event}): ${String(error)}`);
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
});
|
|
4521
|
+
}
|
|
4491
4522
|
|
|
4492
4523
|
// src/cli/commands/cli-subcommand-launch.ts
|
|
4493
4524
|
import { createRequire } from "module";
|
|
4494
|
-
import { extname, resolve as
|
|
4525
|
+
import { extname, resolve as resolve10 } from "path";
|
|
4495
4526
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
4496
4527
|
var require2 = createRequire(import.meta.url);
|
|
4497
4528
|
var resolveCliSubcommandEntry = (params) => {
|
|
4498
4529
|
const argvEntry = params.argvEntry?.trim();
|
|
4499
4530
|
if (argvEntry) {
|
|
4500
|
-
return
|
|
4531
|
+
return resolve10(argvEntry);
|
|
4501
4532
|
}
|
|
4502
4533
|
return fileURLToPath3(new URL("../index.js", params.importMetaUrl));
|
|
4503
4534
|
};
|
|
@@ -4514,10 +4545,10 @@ import {
|
|
|
4514
4545
|
unlinkSync,
|
|
4515
4546
|
writeFileSync as writeFileSync4
|
|
4516
4547
|
} from "fs";
|
|
4517
|
-
import { dirname as dirname2, resolve as
|
|
4548
|
+
import { dirname as dirname2, resolve as resolve11 } from "path";
|
|
4518
4549
|
import { getDataDir as getDataDir6 } from "@nextclaw/core";
|
|
4519
4550
|
function resolveRemoteOwnershipLockPath() {
|
|
4520
|
-
return
|
|
4551
|
+
return resolve11(getDataDir6(), "run", "remote-owner.lock.json");
|
|
4521
4552
|
}
|
|
4522
4553
|
function readRemoteOwnershipRecord(lockPath) {
|
|
4523
4554
|
try {
|
|
@@ -5051,7 +5082,7 @@ import {
|
|
|
5051
5082
|
} from "@nextclaw/ncp-toolkit";
|
|
5052
5083
|
|
|
5053
5084
|
// src/cli/commands/ncp/ncp-asset-tools.ts
|
|
5054
|
-
import { resolve as
|
|
5085
|
+
import { resolve as resolve12 } from "path";
|
|
5055
5086
|
import {
|
|
5056
5087
|
buildAssetContentPath
|
|
5057
5088
|
} from "@nextclaw/ncp-agent-runtime";
|
|
@@ -5167,7 +5198,7 @@ var AssetExportTool = class {
|
|
|
5167
5198
|
if (!assetUri || !targetPath) {
|
|
5168
5199
|
throw new Error("asset_export requires assetUri and targetPath.");
|
|
5169
5200
|
}
|
|
5170
|
-
const exportedPath = await this.assetStore.export({ uri: assetUri },
|
|
5201
|
+
const exportedPath = await this.assetStore.export({ uri: assetUri }, resolve12(targetPath));
|
|
5171
5202
|
return {
|
|
5172
5203
|
ok: true,
|
|
5173
5204
|
assetUri,
|
|
@@ -9040,6 +9071,7 @@ var ServiceCommands = class {
|
|
|
9040
9071
|
startHeartbeat: () => gateway.heartbeat.start()
|
|
9041
9072
|
})
|
|
9042
9073
|
);
|
|
9074
|
+
watchCronStoreFile({ cronStorePath: resolve13(join7(NextclawCore3.getDataDir(), "cron", "jobs.json")), reloadCronStore: () => gateway.cron.reloadFromStore() });
|
|
9043
9075
|
const deferredGatewayStartupHooks = createDeferredGatewayStartupHooks({
|
|
9044
9076
|
uiStartup,
|
|
9045
9077
|
gateway,
|
|
@@ -9105,13 +9137,13 @@ var ServiceCommands = class {
|
|
|
9105
9137
|
return trimmed || void 0;
|
|
9106
9138
|
}
|
|
9107
9139
|
watchConfigFile(reloader) {
|
|
9108
|
-
const configPath =
|
|
9109
|
-
const watcher =
|
|
9140
|
+
const configPath = resolve13(getConfigPath10());
|
|
9141
|
+
const watcher = chokidar2.watch(configPath, {
|
|
9110
9142
|
ignoreInitial: true,
|
|
9111
9143
|
awaitWriteFinish: { stabilityThreshold: 200, pollInterval: 50 }
|
|
9112
9144
|
});
|
|
9113
9145
|
watcher.on("all", (event, changedPath) => {
|
|
9114
|
-
if (
|
|
9146
|
+
if (resolve13(changedPath) !== configPath) {
|
|
9115
9147
|
return;
|
|
9116
9148
|
}
|
|
9117
9149
|
if (event === "add") {
|
|
@@ -9180,7 +9212,7 @@ var ServiceCommands = class {
|
|
|
9180
9212
|
if (!sentinel) {
|
|
9181
9213
|
return;
|
|
9182
9214
|
}
|
|
9183
|
-
await new Promise((
|
|
9215
|
+
await new Promise((resolve16) => setTimeout(resolve16, 750));
|
|
9184
9216
|
const payload = sentinel.payload;
|
|
9185
9217
|
const summary = formatRestartSentinelMessage(payload);
|
|
9186
9218
|
const sentinelSessionKey = this.normalizeOptionalString(payload.sessionKey);
|
|
@@ -9299,7 +9331,7 @@ var ServiceCommands = class {
|
|
|
9299
9331
|
return;
|
|
9300
9332
|
}
|
|
9301
9333
|
const logPath = resolveServiceLogPath();
|
|
9302
|
-
const logDir =
|
|
9334
|
+
const logDir = resolve13(logPath, "..");
|
|
9303
9335
|
mkdirSync5(logDir, { recursive: true });
|
|
9304
9336
|
const logFd = openSync2(logPath, "a");
|
|
9305
9337
|
const readinessTimeoutMs = this.resolveStartupTimeoutMs(options.startupTimeoutMs);
|
|
@@ -9441,14 +9473,14 @@ var ServiceCommands = class {
|
|
|
9441
9473
|
const probe = await this.probeHealthEndpoint(params.healthUrl);
|
|
9442
9474
|
if (!probe.healthy) {
|
|
9443
9475
|
lastProbeError = probe.error;
|
|
9444
|
-
await new Promise((
|
|
9476
|
+
await new Promise((resolve16) => setTimeout(resolve16, 200));
|
|
9445
9477
|
continue;
|
|
9446
9478
|
}
|
|
9447
|
-
await new Promise((
|
|
9479
|
+
await new Promise((resolve16) => setTimeout(resolve16, 300));
|
|
9448
9480
|
if (isProcessRunning(params.pid)) {
|
|
9449
9481
|
return { ready: true, lastProbeError: null };
|
|
9450
9482
|
}
|
|
9451
|
-
await new Promise((
|
|
9483
|
+
await new Promise((resolve16) => setTimeout(resolve16, 200));
|
|
9452
9484
|
}
|
|
9453
9485
|
return { ready: false, lastProbeError };
|
|
9454
9486
|
}
|
|
@@ -9519,17 +9551,17 @@ var ServiceCommands = class {
|
|
|
9519
9551
|
};
|
|
9520
9552
|
}
|
|
9521
9553
|
async checkPortAvailability(params) {
|
|
9522
|
-
return await new Promise((
|
|
9554
|
+
return await new Promise((resolve16) => {
|
|
9523
9555
|
const server = createNetServer2();
|
|
9524
9556
|
server.once("error", (error) => {
|
|
9525
|
-
|
|
9557
|
+
resolve16({
|
|
9526
9558
|
available: false,
|
|
9527
9559
|
detail: `bind failed on ${params.host}:${params.port} (${String(error)})`
|
|
9528
9560
|
});
|
|
9529
9561
|
});
|
|
9530
9562
|
server.listen(params.port, params.host, () => {
|
|
9531
9563
|
server.close(() => {
|
|
9532
|
-
|
|
9564
|
+
resolve16({
|
|
9533
9565
|
available: true,
|
|
9534
9566
|
detail: `bind ok on ${params.host}:${params.port}`
|
|
9535
9567
|
});
|
|
@@ -9565,7 +9597,7 @@ var ServiceCommands = class {
|
|
|
9565
9597
|
return { healthy: false, error: "invalid health URL" };
|
|
9566
9598
|
}
|
|
9567
9599
|
const requestImpl = parsed.protocol === "https:" ? httpsRequest : httpRequest;
|
|
9568
|
-
return new Promise((
|
|
9600
|
+
return new Promise((resolve16) => {
|
|
9569
9601
|
const req = requestImpl(
|
|
9570
9602
|
{
|
|
9571
9603
|
protocol: parsed.protocol,
|
|
@@ -9601,19 +9633,19 @@ var ServiceCommands = class {
|
|
|
9601
9633
|
if (bodySnippet) {
|
|
9602
9634
|
details.push(`body=${bodySnippet}`);
|
|
9603
9635
|
}
|
|
9604
|
-
|
|
9636
|
+
resolve16({ healthy: false, error: details.join("; ") });
|
|
9605
9637
|
return;
|
|
9606
9638
|
}
|
|
9607
9639
|
try {
|
|
9608
9640
|
const payload = JSON.parse(responseText);
|
|
9609
9641
|
const healthy = payload?.ok === true && payload?.data?.status === "ok";
|
|
9610
9642
|
if (!healthy) {
|
|
9611
|
-
|
|
9643
|
+
resolve16({ healthy: false, error: "health payload not ok" });
|
|
9612
9644
|
return;
|
|
9613
9645
|
}
|
|
9614
|
-
|
|
9646
|
+
resolve16({ healthy: true, error: null });
|
|
9615
9647
|
} catch {
|
|
9616
|
-
|
|
9648
|
+
resolve16({ healthy: false, error: "invalid health JSON response" });
|
|
9617
9649
|
}
|
|
9618
9650
|
});
|
|
9619
9651
|
}
|
|
@@ -9622,7 +9654,7 @@ var ServiceCommands = class {
|
|
|
9622
9654
|
req.destroy(new Error("probe timeout"));
|
|
9623
9655
|
});
|
|
9624
9656
|
req.on("error", (error) => {
|
|
9625
|
-
|
|
9657
|
+
resolve16({ healthy: false, error: error.message || String(error) });
|
|
9626
9658
|
});
|
|
9627
9659
|
req.end();
|
|
9628
9660
|
});
|
|
@@ -9768,9 +9800,9 @@ ${stderr}`.trim();
|
|
|
9768
9800
|
// src/cli/workspace.ts
|
|
9769
9801
|
import { cpSync as cpSync3, existsSync as existsSync12, mkdirSync as mkdirSync6, readFileSync as readFileSync9, readdirSync as readdirSync2, rmSync as rmSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
9770
9802
|
import { createRequire as createRequire2 } from "module";
|
|
9771
|
-
import { dirname as dirname4, join as join8, resolve as
|
|
9803
|
+
import { dirname as dirname4, join as join8, resolve as resolve14 } from "path";
|
|
9772
9804
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
9773
|
-
import { APP_NAME as APP_NAME4, getDataDir as
|
|
9805
|
+
import { APP_NAME as APP_NAME4, getDataDir as getDataDir10 } from "@nextclaw/core";
|
|
9774
9806
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
9775
9807
|
var WorkspaceManager = class {
|
|
9776
9808
|
constructor(logo) {
|
|
@@ -9862,7 +9894,7 @@ var WorkspaceManager = class {
|
|
|
9862
9894
|
try {
|
|
9863
9895
|
const require3 = createRequire2(import.meta.url);
|
|
9864
9896
|
const entry = require3.resolve("@nextclaw/core");
|
|
9865
|
-
const pkgRoot =
|
|
9897
|
+
const pkgRoot = resolve14(dirname4(entry), "..");
|
|
9866
9898
|
const distSkills = join8(pkgRoot, "dist", "skills");
|
|
9867
9899
|
if (existsSync12(distSkills)) {
|
|
9868
9900
|
return distSkills;
|
|
@@ -9881,8 +9913,8 @@ var WorkspaceManager = class {
|
|
|
9881
9913
|
if (override) {
|
|
9882
9914
|
return override;
|
|
9883
9915
|
}
|
|
9884
|
-
const cliDir =
|
|
9885
|
-
const pkgRoot =
|
|
9916
|
+
const cliDir = resolve14(fileURLToPath4(new URL(".", import.meta.url)));
|
|
9917
|
+
const pkgRoot = resolve14(cliDir, "..", "..");
|
|
9886
9918
|
const candidates = [join8(pkgRoot, "templates")];
|
|
9887
9919
|
for (const candidate of candidates) {
|
|
9888
9920
|
if (existsSync12(candidate)) {
|
|
@@ -9892,7 +9924,7 @@ var WorkspaceManager = class {
|
|
|
9892
9924
|
return null;
|
|
9893
9925
|
}
|
|
9894
9926
|
getBridgeDir() {
|
|
9895
|
-
const userBridge = join8(
|
|
9927
|
+
const userBridge = join8(getDataDir10(), "bridge");
|
|
9896
9928
|
if (existsSync12(join8(userBridge, "dist", "index.js"))) {
|
|
9897
9929
|
return userBridge;
|
|
9898
9930
|
}
|
|
@@ -9900,8 +9932,8 @@ var WorkspaceManager = class {
|
|
|
9900
9932
|
console.error("npm not found. Please install Node.js >= 18.");
|
|
9901
9933
|
process.exit(1);
|
|
9902
9934
|
}
|
|
9903
|
-
const cliDir =
|
|
9904
|
-
const pkgRoot =
|
|
9935
|
+
const cliDir = resolve14(fileURLToPath4(new URL(".", import.meta.url)));
|
|
9936
|
+
const pkgRoot = resolve14(cliDir, "..", "..");
|
|
9905
9937
|
const pkgBridge = join8(pkgRoot, "bridge");
|
|
9906
9938
|
const srcBridge = join8(pkgRoot, "..", "..", "bridge");
|
|
9907
9939
|
let source = null;
|
|
@@ -9915,7 +9947,7 @@ var WorkspaceManager = class {
|
|
|
9915
9947
|
process.exit(1);
|
|
9916
9948
|
}
|
|
9917
9949
|
console.log(`${this.logo} Setting up bridge...`);
|
|
9918
|
-
mkdirSync6(
|
|
9950
|
+
mkdirSync6(resolve14(userBridge, ".."), { recursive: true });
|
|
9919
9951
|
if (existsSync12(userBridge)) {
|
|
9920
9952
|
rmSync6(userBridge, { recursive: true, force: true });
|
|
9921
9953
|
}
|
|
@@ -10067,7 +10099,7 @@ var CliRuntime = class {
|
|
|
10067
10099
|
const delayMs = typeof params.delayMs === "number" && Number.isFinite(params.delayMs) ? Math.max(0, Math.floor(params.delayMs)) : 100;
|
|
10068
10100
|
const cliPath = process.env.NEXTCLAW_SELF_RELAUNCH_CLI?.trim() || fileURLToPath5(new URL("./index.js", import.meta.url));
|
|
10069
10101
|
const startArgs = [cliPath, "start", "--ui-port", String(uiPort)];
|
|
10070
|
-
const serviceStatePath =
|
|
10102
|
+
const serviceStatePath = resolve15(getDataDir11(), "run", "service.json");
|
|
10071
10103
|
const helperScript = [
|
|
10072
10104
|
'const { spawnSync } = require("node:child_process");',
|
|
10073
10105
|
'const { readFileSync } = require("node:fs");',
|
|
@@ -10199,7 +10231,7 @@ var CliRuntime = class {
|
|
|
10199
10231
|
const createdConfig = initializeConfigIfMissing(configPath);
|
|
10200
10232
|
const config2 = loadConfig21();
|
|
10201
10233
|
const workspaceSetting = config2.agents.defaults.workspace;
|
|
10202
|
-
const workspacePath = !workspaceSetting || workspaceSetting === DEFAULT_WORKSPACE_PATH ? join9(
|
|
10234
|
+
const workspacePath = !workspaceSetting || workspaceSetting === DEFAULT_WORKSPACE_PATH ? join9(getDataDir11(), DEFAULT_WORKSPACE_DIR) : expandHome2(workspaceSetting);
|
|
10203
10235
|
const workspaceExisted = existsSync13(workspacePath);
|
|
10204
10236
|
mkdirSync7(workspacePath, { recursive: true });
|
|
10205
10237
|
const templateResult = this.workspaceManager.createWorkspaceTemplates(
|
|
@@ -10392,8 +10424,8 @@ ${this.logo} ${APP_NAME5} is ready! (${source})`);
|
|
|
10392
10424
|
`${this.logo} Interactive mode (type exit or Ctrl+C to quit)
|
|
10393
10425
|
`
|
|
10394
10426
|
);
|
|
10395
|
-
const historyFile = join9(
|
|
10396
|
-
const historyDir =
|
|
10427
|
+
const historyFile = join9(getDataDir11(), "history", "cli_history");
|
|
10428
|
+
const historyDir = resolve15(historyFile, "..");
|
|
10397
10429
|
mkdirSync7(historyDir, { recursive: true });
|
|
10398
10430
|
const history = existsSync13(historyFile) ? readFileSync10(historyFile, "utf-8").split("\n").filter(Boolean) : [];
|
|
10399
10431
|
const rl = createInterface3({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextclaw",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.21",
|
|
4
4
|
"description": "Lightweight personal AI assistant with CLI, multi-provider routing, and channel integrations.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"chokidar": "^3.6.0",
|
|
40
40
|
"commander": "^12.1.0",
|
|
41
41
|
"yaml": "^2.8.1",
|
|
42
|
-
"@nextclaw/core": "0.11.
|
|
43
|
-
"@nextclaw/mcp": "0.1.54",
|
|
44
|
-
"@nextclaw/ncp": "0.4.1",
|
|
42
|
+
"@nextclaw/core": "0.11.8",
|
|
45
43
|
"@nextclaw/ncp-agent-runtime": "0.3.1",
|
|
46
|
-
"@nextclaw/ncp
|
|
44
|
+
"@nextclaw/ncp": "0.4.1",
|
|
45
|
+
"@nextclaw/ncp-mcp": "0.1.56",
|
|
47
46
|
"@nextclaw/ncp-toolkit": "0.4.7",
|
|
48
|
-
"@nextclaw/
|
|
49
|
-
"@nextclaw/
|
|
50
|
-
"@nextclaw/
|
|
51
|
-
"@nextclaw/
|
|
47
|
+
"@nextclaw/runtime": "0.2.22",
|
|
48
|
+
"@nextclaw/openclaw-compat": "0.3.47",
|
|
49
|
+
"@nextclaw/remote": "0.1.65",
|
|
50
|
+
"@nextclaw/mcp": "0.1.55",
|
|
51
|
+
"@nextclaw/server": "0.11.13"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^20.17.6",
|