@clawops/cli 1.7.4 → 1.7.6
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 +1 -1
- package/dist/{apply-PZ5IIU7Z.js → apply-F3KY2HTB.js} +3 -2
- package/dist/{chunk-5SPESD5N.js → chunk-35WVQY3X.js} +2 -2
- package/dist/chunk-EI7CQQ7D.js +14 -0
- package/dist/{chunk-FSUWPL7Q.js → chunk-FNS56UQY.js} +1 -1
- package/dist/{chunk-OPUM3FDW.js → chunk-RAZZ256T.js} +2 -2
- package/dist/{chunk-O3F7OGH7.js → chunk-SEZMVVAS.js} +40 -18
- package/dist/{chunk-2YOP6N7X.js → chunk-UKTP332Z.js} +4 -10
- package/dist/cli.js +55 -60
- package/dist/{generate-DYNAQRD7.js → generate-VDNZC4QM.js} +1 -1
- package/dist/{mcp-wire-SLL4TLSC.js → mcp-wire-FR3W2CB6.js} +2 -1
- package/dist/{package-3RCGT5UR.js → package-HTNU53G5.js} +1 -1
- package/dist/{remote-config-PFB66RPY.js → remote-config-QDLN4UMG.js} +2 -1
- package/dist/{server-7TEMRTRY.js → server-ZQ72NTW2.js} +18 -16
- package/dist/{version-guard-MZAO4KHS.js → version-guard-VUCNZXQS.js} +2 -1
- package/dist/{versions-OEPAS2EL.js → versions-2UVAT6PQ.js} +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -275,7 +275,7 @@ clawops down --yes # Destroy local-provider stack
|
|
|
275
275
|
| `config` | Get/set remote OpenClaw config values (`--dry-run` shows would-write JSON) |
|
|
276
276
|
| `agents` | List or restart OpenClaw agents |
|
|
277
277
|
| `gateway` | Restart the OpenClaw gateway service |
|
|
278
|
-
| `backup` | Create
|
|
278
|
+
| `backup` | Create an OpenClaw state backup (`restore` returns in clawops 2.x — see [limitations](docs/limitations.md#backup-and-restore)) |
|
|
279
279
|
| `stacks` | List named stacks and their state |
|
|
280
280
|
| `doctor` | Check Node version, config, SSH key, provider credentials, and Pulumi home |
|
|
281
281
|
| `secret` | Manage secrets: `list`, `set`, `delete`, `rotate`, `audit` |
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
applyPlan
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-35WVQY3X.js";
|
|
5
5
|
import "./chunk-6ZFIFDBJ.js";
|
|
6
6
|
import "./chunk-BOPSG2LI.js";
|
|
7
7
|
import "./chunk-6X45DDGH.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-SEZMVVAS.js";
|
|
9
9
|
import "./chunk-P5LKWRPL.js";
|
|
10
|
+
import "./chunk-EI7CQQ7D.js";
|
|
10
11
|
import "./chunk-PVUVI35Y.js";
|
|
11
12
|
import "./chunk-A2I76FTA.js";
|
|
12
13
|
import "./chunk-CX5SL5HP.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
deepMerge,
|
|
14
14
|
readRemoteConfig,
|
|
15
15
|
restartGateway
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SEZMVVAS.js";
|
|
17
17
|
import {
|
|
18
18
|
buildContext
|
|
19
19
|
} from "./chunk-P5LKWRPL.js";
|
|
@@ -35,7 +35,7 @@ ${validation.errors.join("\n")}`
|
|
|
35
35
|
"plan/apply is not supported for the local provider. Use `clawops up` directly."
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
const { guardOpenclawVersion } = await import("./version-guard-
|
|
38
|
+
const { guardOpenclawVersion } = await import("./version-guard-VUCNZXQS.js");
|
|
39
39
|
await guardOpenclawVersion(plan.spec.openclaw.version);
|
|
40
40
|
const ctx = buildContext({
|
|
41
41
|
stack: plan.spec.stackName,
|
|
@@ -45,10 +45,10 @@ async function generatePlan(intent, _opts) {
|
|
|
45
45
|
"plan/apply is not supported for the local provider. Use `clawops up` directly."
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
const { version } = await import("./package-
|
|
48
|
+
const { version } = await import("./package-HTNU53G5.js");
|
|
49
49
|
const config = getConfig();
|
|
50
50
|
const instanceType = intent.instanceType ?? "small";
|
|
51
|
-
const { guardOpenclawVersion, defaultOpenclawVersion } = await import("./version-guard-
|
|
51
|
+
const { guardOpenclawVersion, defaultOpenclawVersion } = await import("./version-guard-VUCNZXQS.js");
|
|
52
52
|
const openclawVersion = await guardOpenclawVersion(
|
|
53
53
|
intent.openclawVersion ?? await defaultOpenclawVersion()
|
|
54
54
|
);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
err,
|
|
4
|
+
ok
|
|
5
|
+
} from "./chunk-EI7CQQ7D.js";
|
|
2
6
|
|
|
3
7
|
// src/openclaw/run-flags.ts
|
|
4
8
|
var CONFIG_MOUNT_PATH = "/app/config.json";
|
|
@@ -7,6 +11,29 @@ var CONFIG_PATH_ENV = `-e OPENCLAW_CONFIG_PATH=${CONFIG_MOUNT_PATH}`;
|
|
|
7
11
|
var ADD_HOST_FLAG = "--add-host=host.docker.internal:host-gateway";
|
|
8
12
|
var PORT_PIN = `--port ${GATEWAY_PORT}`;
|
|
9
13
|
var COMMON_RUN_FLAGS = `${CONFIG_PATH_ENV} ${ADD_HOST_FLAG}`;
|
|
14
|
+
var ENV_FILE_PATH = "/home/clawops/openclaw.env";
|
|
15
|
+
var IMAGE_INSPECT_CMD = `docker inspect openclaw --format '{{.Config.Image}}'`;
|
|
16
|
+
function imageForRestart(inspectStdout) {
|
|
17
|
+
const image = inspectStdout.trim();
|
|
18
|
+
if (!image || image.includes("Error") || !image.includes(":")) {
|
|
19
|
+
return err(
|
|
20
|
+
"No running OpenClaw container found, so there is no image version to reuse. Deploy one with `clawops up --openclaw-version <version>`. clawops does not fall back to `latest` or `stable` here: both now point at OpenClaw 2.0, which this release line does not support."
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return ok(image);
|
|
24
|
+
}
|
|
25
|
+
function versionOf(image) {
|
|
26
|
+
return image.split(":")[1] ?? "unknown";
|
|
27
|
+
}
|
|
28
|
+
function gatewayRunCommand(opts) {
|
|
29
|
+
const { image, configPath, envFilePath = ENV_FILE_PATH, pathPrefix = "" } = opts;
|
|
30
|
+
const envFileArg = `$([ -s ${envFilePath} ] && echo --env-file ${envFilePath})`;
|
|
31
|
+
return pathPrefix + [
|
|
32
|
+
"docker stop openclaw 2>/dev/null || true",
|
|
33
|
+
"docker rm openclaw 2>/dev/null || true",
|
|
34
|
+
`docker run -d --name openclaw --restart unless-stopped -p ${GATEWAY_PORT}:${GATEWAY_PORT} ${COMMON_RUN_FLAGS} ${envFileArg} -v ${configPath}:${CONFIG_MOUNT_PATH}:ro ${image} node openclaw.mjs gateway run --allow-unconfigured ${PORT_PIN}`
|
|
35
|
+
].join(" && ");
|
|
36
|
+
}
|
|
10
37
|
|
|
11
38
|
// src/plan/remote-config.ts
|
|
12
39
|
var OPENCLAW_CONFIG_LINUX = "/home/clawops/openclaw.json";
|
|
@@ -66,25 +93,16 @@ async function restartGateway(session, signal) {
|
|
|
66
93
|
const os = await detectOS(session, signal);
|
|
67
94
|
const configPath = configPathForOS(os);
|
|
68
95
|
const pathPrefix = os === "Darwin" ? 'export PATH="/usr/local/bin:/opt/homebrew/bin:/Applications/Docker.app/Contents/Resources/bin:$PATH" && ' : "";
|
|
69
|
-
const imgCmd = `${pathPrefix}
|
|
96
|
+
const imgCmd = `${pathPrefix}${IMAGE_INSPECT_CMD}`;
|
|
70
97
|
const imgResult = os === "Darwin" ? await session.exec(imgCmd, signal) : await execWithFallbackSudo(session, imgCmd, signal);
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
gatewayCmd = `node openclaw.mjs gateway run --allow-unconfigured ${PORT_PIN} --token '${tokenVal}'`;
|
|
80
|
-
}
|
|
81
|
-
} catch {
|
|
82
|
-
}
|
|
83
|
-
const restartCmd = pathPrefix + [
|
|
84
|
-
"docker stop openclaw 2>/dev/null || true",
|
|
85
|
-
"docker rm openclaw 2>/dev/null || true",
|
|
86
|
-
`docker run -d --name openclaw --restart unless-stopped -p ${GATEWAY_PORT}:${GATEWAY_PORT} ${COMMON_RUN_FLAGS} -v ${configPath}:/app/config.json:ro ${image} ${gatewayCmd}`
|
|
87
|
-
].join(" && ");
|
|
98
|
+
const resolved = imageForRestart(imgResult.stdout);
|
|
99
|
+
if (!resolved.ok) throw new Error(resolved.error);
|
|
100
|
+
const image = resolved.value;
|
|
101
|
+
const restartCmd = gatewayRunCommand({
|
|
102
|
+
image,
|
|
103
|
+
configPath,
|
|
104
|
+
pathPrefix
|
|
105
|
+
});
|
|
88
106
|
const result = os === "Darwin" ? await session.exec(restartCmd, signal) : await execWithFallbackSudo(session, restartCmd, signal);
|
|
89
107
|
if (result.code !== 0) {
|
|
90
108
|
throw new Error(`Gateway restart failed: ${result.stderr}`);
|
|
@@ -122,6 +140,10 @@ function deepMerge(base, overlay) {
|
|
|
122
140
|
}
|
|
123
141
|
|
|
124
142
|
export {
|
|
143
|
+
IMAGE_INSPECT_CMD,
|
|
144
|
+
imageForRestart,
|
|
145
|
+
versionOf,
|
|
146
|
+
gatewayRunCommand,
|
|
125
147
|
OPENCLAW_CONFIG_LINUX,
|
|
126
148
|
OPENCLAW_CONFIG_MACOS,
|
|
127
149
|
OPENCLAW_CONFIG,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
err,
|
|
4
|
+
ok
|
|
5
|
+
} from "./chunk-EI7CQQ7D.js";
|
|
2
6
|
import {
|
|
3
7
|
resolveSpecDir
|
|
4
8
|
} from "./chunk-PVUVI35Y.js";
|
|
@@ -6,16 +10,6 @@ import {
|
|
|
6
10
|
// src/openclaw/versions.ts
|
|
7
11
|
import { readFileSync } from "fs";
|
|
8
12
|
import { join } from "path";
|
|
9
|
-
|
|
10
|
-
// src/types/result.ts
|
|
11
|
-
function ok(value) {
|
|
12
|
-
return { ok: true, value };
|
|
13
|
-
}
|
|
14
|
-
function err(error) {
|
|
15
|
-
return { ok: false, error };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/openclaw/versions.ts
|
|
19
13
|
var MOVING_TAGS = ["latest", "stable", "dev", "main"];
|
|
20
14
|
function isMovingTag(v) {
|
|
21
15
|
return MOVING_TAGS.includes(v);
|
package/dist/cli.js
CHANGED
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
monitor_default,
|
|
4
4
|
validateOpenclawConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FNS56UQY.js";
|
|
6
6
|
import {
|
|
7
7
|
MCP_APPS,
|
|
8
8
|
buildMcpEntry,
|
|
9
9
|
writeAppConfigs
|
|
10
10
|
} from "./chunk-OIGTOLB3.js";
|
|
11
11
|
import "./chunk-DQDAWNGB.js";
|
|
12
|
-
import
|
|
12
|
+
import {
|
|
13
|
+
IMAGE_INSPECT_CMD,
|
|
14
|
+
gatewayRunCommand,
|
|
15
|
+
imageForRestart,
|
|
16
|
+
versionOf
|
|
17
|
+
} from "./chunk-SEZMVVAS.js";
|
|
13
18
|
import "./chunk-P5LKWRPL.js";
|
|
19
|
+
import "./chunk-EI7CQQ7D.js";
|
|
14
20
|
import {
|
|
15
21
|
resolveSpecDir
|
|
16
22
|
} from "./chunk-PVUVI35Y.js";
|
|
@@ -211,7 +217,7 @@ var up_default = defineCommand2({
|
|
|
211
217
|
},
|
|
212
218
|
async run({ args }) {
|
|
213
219
|
const { buildContext } = await import("./context-5LCUG2QR.js");
|
|
214
|
-
const { guardOpenclawVersion, defaultOpenclawVersion } = await import("./version-guard-
|
|
220
|
+
const { guardOpenclawVersion, defaultOpenclawVersion } = await import("./version-guard-VUCNZXQS.js");
|
|
215
221
|
const ctx = buildContext(args);
|
|
216
222
|
const requestedVersion = typeof args["openclaw-version"] === "string" ? args["openclaw-version"] : await defaultOpenclawVersion();
|
|
217
223
|
const openclawVersion = await guardOpenclawVersion(requestedVersion);
|
|
@@ -318,7 +324,7 @@ var up_default = defineCommand2({
|
|
|
318
324
|
async function applyLocalConfigOverlay(opts) {
|
|
319
325
|
const { connect } = await import("./ssh-CNJNLM3E.js");
|
|
320
326
|
const { resolveSecrets } = await import("./secrets-SVZWNAPK.js");
|
|
321
|
-
const { readRemoteConfig, atomicWriteConfig, restartGateway, deepMerge } = await import("./remote-config-
|
|
327
|
+
const { readRemoteConfig, atomicWriteConfig, restartGateway, deepMerge } = await import("./remote-config-QDLN4UMG.js");
|
|
322
328
|
let overlay;
|
|
323
329
|
try {
|
|
324
330
|
overlay = JSON.parse(readFileSync(opts.configPath, "utf-8"));
|
|
@@ -495,7 +501,7 @@ var plan_default = defineCommand5({
|
|
|
495
501
|
},
|
|
496
502
|
async run({ args }) {
|
|
497
503
|
const { buildContext } = await import("./context-5LCUG2QR.js");
|
|
498
|
-
const { generatePlan } = await import("./generate-
|
|
504
|
+
const { generatePlan } = await import("./generate-VDNZC4QM.js");
|
|
499
505
|
const ctx = buildContext(args);
|
|
500
506
|
if (ctx.adapter.name === "local") {
|
|
501
507
|
throw new UsageError(
|
|
@@ -585,7 +591,7 @@ var apply_default = defineCommand6({
|
|
|
585
591
|
},
|
|
586
592
|
async run({ args }) {
|
|
587
593
|
const { validatePlan } = await import("./validate-CFQ4FH2T.js");
|
|
588
|
-
const { applyPlan } = await import("./apply-
|
|
594
|
+
const { applyPlan } = await import("./apply-F3KY2HTB.js");
|
|
589
595
|
const planPath = args._?.[0];
|
|
590
596
|
if (!planPath) {
|
|
591
597
|
throw new UsageError("Usage: clawops apply <plan.json>");
|
|
@@ -996,11 +1002,7 @@ import process13 from "process";
|
|
|
996
1002
|
var OPENCLAW_CONFIG = "/home/clawops/openclaw.json";
|
|
997
1003
|
var OPENCLAW_TMP = "/tmp/clawops-config.json.tmp";
|
|
998
1004
|
function dockerRunCmd(image) {
|
|
999
|
-
return
|
|
1000
|
-
"docker stop openclaw 2>/dev/null || true",
|
|
1001
|
-
"docker rm openclaw 2>/dev/null || true",
|
|
1002
|
-
`docker run -d --name openclaw --restart unless-stopped -p 18789:18789 -e OPENCLAW_CONFIG_PATH=/app/config.json --add-host=host.docker.internal:host-gateway -v ${OPENCLAW_CONFIG}:/app/config.json:ro ${image}`
|
|
1003
|
-
].join(" && ");
|
|
1005
|
+
return gatewayRunCommand({ image, configPath: OPENCLAW_CONFIG });
|
|
1004
1006
|
}
|
|
1005
1007
|
function getPath(obj, dotKey) {
|
|
1006
1008
|
return dotKey.split(".").reduce((cur, k) => {
|
|
@@ -1257,7 +1259,10 @@ import { defineCommand as defineCommand13 } from "citty";
|
|
|
1257
1259
|
import process15 from "process";
|
|
1258
1260
|
var OPENCLAW_CONFIG2 = "/home/clawops/openclaw.json";
|
|
1259
1261
|
function dockerRunCmd2(version) {
|
|
1260
|
-
return
|
|
1262
|
+
return gatewayRunCommand({
|
|
1263
|
+
image: `ghcr.io/openclaw/openclaw:${version}`,
|
|
1264
|
+
configPath: OPENCLAW_CONFIG2
|
|
1265
|
+
});
|
|
1261
1266
|
}
|
|
1262
1267
|
var gateway_default = defineCommand13({
|
|
1263
1268
|
meta: {
|
|
@@ -1325,11 +1330,13 @@ var gateway_default = defineCommand13({
|
|
|
1325
1330
|
);
|
|
1326
1331
|
}
|
|
1327
1332
|
} else if (action === "restart") {
|
|
1328
|
-
const imgResult = await session.exec(
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
+
const imgResult = await session.exec(IMAGE_INSPECT_CMD, abortController.signal);
|
|
1334
|
+
const image = imageForRestart(imgResult.stdout);
|
|
1335
|
+
if (!image.ok) {
|
|
1336
|
+
failure(image.error);
|
|
1337
|
+
process15.exit(1);
|
|
1338
|
+
}
|
|
1339
|
+
const version = versionOf(image.value);
|
|
1333
1340
|
const spin = spinner("Restarting gateway...");
|
|
1334
1341
|
const result = await session.exec(dockerRunCmd2(version), abortController.signal);
|
|
1335
1342
|
spin.stop();
|
|
@@ -1367,18 +1374,18 @@ var gateway_default = defineCommand13({
|
|
|
1367
1374
|
|
|
1368
1375
|
// src/cli/commands/backup.ts
|
|
1369
1376
|
import { defineCommand as defineCommand14 } from "citty";
|
|
1370
|
-
import { createWriteStream
|
|
1377
|
+
import { createWriteStream } from "fs";
|
|
1371
1378
|
import { pipeline } from "stream/promises";
|
|
1372
1379
|
import process16 from "process";
|
|
1373
1380
|
var backup_default = defineCommand14({
|
|
1374
1381
|
meta: {
|
|
1375
1382
|
name: "backup",
|
|
1376
|
-
description: "Create
|
|
1383
|
+
description: "Create an OpenClaw backup (restore is unavailable on this release line)"
|
|
1377
1384
|
},
|
|
1378
1385
|
args: {
|
|
1379
|
-
action: { type: "positional", description: "Action: create
|
|
1386
|
+
action: { type: "positional", description: "Action: create (restore returns in clawops 2.x)", required: true },
|
|
1380
1387
|
out: { type: "string", description: "[create] Local path to write the backup archive" },
|
|
1381
|
-
file: { type: "string", description: "[restore] Local backup archive
|
|
1388
|
+
file: { type: "string", description: "[restore] Local backup archive (restore is unavailable)" },
|
|
1382
1389
|
stack: { type: "string", description: "Target stack name" },
|
|
1383
1390
|
yes: { type: "boolean", description: "[restore] Skip confirmation prompt" }
|
|
1384
1391
|
},
|
|
@@ -1438,44 +1445,32 @@ var backup_default = defineCommand14({
|
|
|
1438
1445
|
const outPath = typeof args.out === "string" ? args.out : `openclaw-backup-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.tar.gz`;
|
|
1439
1446
|
info(`Writing backup to ${outPath}...`);
|
|
1440
1447
|
const spin = spinner("Creating backup on remote host...");
|
|
1448
|
+
const remoteArchive = "/tmp/clawops-backup.tar.gz";
|
|
1449
|
+
const createResult = await session.exec(
|
|
1450
|
+
`docker exec openclaw sh -lc 'rm -f ${remoteArchive} && openclaw backup create --output ${remoteArchive} --verify --json'`,
|
|
1451
|
+
abortController.signal
|
|
1452
|
+
);
|
|
1453
|
+
if (createResult.code !== 0) {
|
|
1454
|
+
spin.stop();
|
|
1455
|
+
throw new Error(`Backup failed on the remote host: ${createResult.stderr.slice(0, 300)}`);
|
|
1456
|
+
}
|
|
1441
1457
|
const backupStream = await session.stream(
|
|
1442
|
-
|
|
1458
|
+
`docker exec openclaw cat ${remoteArchive}`,
|
|
1443
1459
|
abortController.signal
|
|
1444
1460
|
);
|
|
1445
1461
|
spin.stop();
|
|
1446
1462
|
const fileStream = createWriteStream(outPath);
|
|
1447
1463
|
await pipeline(backupStream, fileStream);
|
|
1464
|
+
await session.exec(
|
|
1465
|
+
`docker exec openclaw rm -f ${remoteArchive}`,
|
|
1466
|
+
abortController.signal
|
|
1467
|
+
);
|
|
1448
1468
|
success(`Backup saved to ${outPath}`);
|
|
1469
|
+
info("The archive contains credentials \u2014 store it accordingly.");
|
|
1449
1470
|
} else {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
throw new UsageError("--file is required for backup restore");
|
|
1453
|
-
}
|
|
1454
|
-
if (!args.yes) {
|
|
1455
|
-
const { createInterface: createInterface3 } = await import("readline/promises");
|
|
1456
|
-
const rl = createInterface3({ input: process16.stdin, output: process16.stdout });
|
|
1457
|
-
try {
|
|
1458
|
-
const answer = await rl.question(
|
|
1459
|
-
`Restore backup from "${filePath}" to stack "${ctx.stackName}"? This will overwrite existing data. (y/N) `
|
|
1460
|
-
);
|
|
1461
|
-
if (answer.trim().toLowerCase() !== "y") {
|
|
1462
|
-
info("Restore cancelled.");
|
|
1463
|
-
return;
|
|
1464
|
-
}
|
|
1465
|
-
} finally {
|
|
1466
|
-
rl.close();
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
info(`Restoring from ${filePath}...`);
|
|
1470
|
-
const spin = spinner("Transferring and restoring backup...");
|
|
1471
|
-
const restoreStream = await session.stream(
|
|
1472
|
-
"docker exec -i openclaw openclaw-ctl backup restore --stdin",
|
|
1473
|
-
abortController.signal
|
|
1471
|
+
throw new UsageError(
|
|
1472
|
+
"Restore is not available on this clawops release.\nOpenClaw up to 2026.7.1-2 provides `backup create` and `backup verify` only; restore arrived in OpenClaw 2.0 and will be supported by clawops 2.x.\nTo recover manually: copy the archive to the host, then extract it into the gateway container with the gateway stopped."
|
|
1474
1473
|
);
|
|
1475
|
-
const fileStream = createReadStream(filePath);
|
|
1476
|
-
await pipeline(fileStream, restoreStream);
|
|
1477
|
-
spin.stop();
|
|
1478
|
-
success("Backup restored successfully");
|
|
1479
1474
|
}
|
|
1480
1475
|
} finally {
|
|
1481
1476
|
release();
|
|
@@ -1711,7 +1706,7 @@ var doctor_default = defineCommand16({
|
|
|
1711
1706
|
process18.stdout.write("\nOpenClaw\n");
|
|
1712
1707
|
try {
|
|
1713
1708
|
const yaml = await import("./js-yaml-PTEEG4FO.js");
|
|
1714
|
-
const { loadVersionSpec, describeRange } = await import("./versions-
|
|
1709
|
+
const { loadVersionSpec, describeRange } = await import("./versions-2UVAT6PQ.js");
|
|
1715
1710
|
const support = loadVersionSpec(yaml).support;
|
|
1716
1711
|
success(`Supported range ${describeRange(support)} (recommended ${support.recommended})`);
|
|
1717
1712
|
if (!support.max) {
|
|
@@ -1771,7 +1766,7 @@ var doctor_default = defineCommand16({
|
|
|
1771
1766
|
const deployedVersion = image.includes(":") ? image.slice(image.lastIndexOf(":") + 1) : "";
|
|
1772
1767
|
if (deployedVersion) {
|
|
1773
1768
|
const yaml = await import("./js-yaml-PTEEG4FO.js");
|
|
1774
|
-
const { loadVersionSpec, checkVersion, isMovingTag } = await import("./versions-
|
|
1769
|
+
const { loadVersionSpec, checkVersion, isMovingTag } = await import("./versions-2UVAT6PQ.js");
|
|
1775
1770
|
const support = loadVersionSpec(yaml).support;
|
|
1776
1771
|
if (isMovingTag(deployedVersion)) {
|
|
1777
1772
|
warn(
|
|
@@ -1907,7 +1902,7 @@ var serveCmd = defineCommand17({
|
|
|
1907
1902
|
inspector: { type: "boolean", description: "Enable MCP inspector" }
|
|
1908
1903
|
},
|
|
1909
1904
|
async run({ args }) {
|
|
1910
|
-
const { serveMcp } = await import("./server-
|
|
1905
|
+
const { serveMcp } = await import("./server-ZQ72NTW2.js");
|
|
1911
1906
|
await serveMcp({
|
|
1912
1907
|
port: args.http ? Number(args.http) : void 0,
|
|
1913
1908
|
bind: args.bind,
|
|
@@ -1985,7 +1980,7 @@ var wireCmd = defineCommand17({
|
|
|
1985
1980
|
const { buildContext } = await import("./context-5LCUG2QR.js");
|
|
1986
1981
|
const { acquireSession, drainPool } = await import("./pool-QGFQRMGU.js");
|
|
1987
1982
|
const { extractBaseOutputs } = await import("./outputs-DJHBY7EE.js");
|
|
1988
|
-
const { wireGatewayMcp } = await import("./mcp-wire-
|
|
1983
|
+
const { wireGatewayMcp } = await import("./mcp-wire-FR3W2CB6.js");
|
|
1989
1984
|
const ac = new AbortController();
|
|
1990
1985
|
process19.on("SIGINT", () => {
|
|
1991
1986
|
ac.abort();
|
|
@@ -2506,7 +2501,7 @@ var setup_default = defineCommand18({
|
|
|
2506
2501
|
default: false
|
|
2507
2502
|
}]);
|
|
2508
2503
|
if (applyNow) {
|
|
2509
|
-
const { applyPlan } = await import("./apply-
|
|
2504
|
+
const { applyPlan } = await import("./apply-F3KY2HTB.js");
|
|
2510
2505
|
const plan = JSON.parse(readFileSync3(outputPath, "utf-8"));
|
|
2511
2506
|
try {
|
|
2512
2507
|
await applyPlan(plan, {
|
|
@@ -2537,7 +2532,7 @@ async function runLocalDeploy(opts) {
|
|
|
2537
2532
|
const { setConfig: setConfig2, getConfig: getConfig2, getConfigDir: getConfigDir2 } = await import("./store-SDUR52Z5.js");
|
|
2538
2533
|
const { localBootstrap } = await import("./bootstrap-HL4DNUNG.js");
|
|
2539
2534
|
const { connect } = await import("./ssh-CNJNLM3E.js");
|
|
2540
|
-
const { readRemoteConfig, atomicWriteConfig, restartGateway, deepMerge } = await import("./remote-config-
|
|
2535
|
+
const { readRemoteConfig, atomicWriteConfig, restartGateway, deepMerge } = await import("./remote-config-QDLN4UMG.js");
|
|
2541
2536
|
const { resolveSecrets } = await import("./secrets-SVZWNAPK.js");
|
|
2542
2537
|
const knownHostsPath = path3.join(getConfigDir2(), "known_hosts");
|
|
2543
2538
|
const existing = getConfig2();
|
|
@@ -3009,7 +3004,7 @@ async function maybeWireGatewayMcp(opts) {
|
|
|
3009
3004
|
if (!wireGateway) return;
|
|
3010
3005
|
const { connect } = await import("./ssh-CNJNLM3E.js");
|
|
3011
3006
|
const { getConfigDir: getConfigDir2 } = await import("./store-SDUR52Z5.js");
|
|
3012
|
-
const { wireGatewayMcp } = await import("./mcp-wire-
|
|
3007
|
+
const { wireGatewayMcp } = await import("./mcp-wire-FR3W2CB6.js");
|
|
3013
3008
|
const knownHostsPath = path3.join(getConfigDir2(), "known_hosts");
|
|
3014
3009
|
const spin = spinner("Wiring gateway MCP client...");
|
|
3015
3010
|
const session = await connect({
|
|
@@ -3341,7 +3336,7 @@ var rotateCmd = defineCommand19({
|
|
|
3341
3336
|
info(`Re-applying config overlay to stack "${targetStack}"\u2026`);
|
|
3342
3337
|
try {
|
|
3343
3338
|
const { buildContext } = await import("./context-5LCUG2QR.js");
|
|
3344
|
-
const { readRemoteConfig, atomicWriteConfig, restartGateway, deepMerge } = await import("./remote-config-
|
|
3339
|
+
const { readRemoteConfig, atomicWriteConfig, restartGateway, deepMerge } = await import("./remote-config-QDLN4UMG.js");
|
|
3345
3340
|
const { resolveSecrets } = await import("./secrets-SVZWNAPK.js");
|
|
3346
3341
|
const { acquireSession, drainPool } = await import("./pool-QGFQRMGU.js");
|
|
3347
3342
|
const { localStateToConnectionInfo } = await import("./state-PRBIIN7I.js");
|
|
@@ -3527,7 +3522,7 @@ import { accessSync as accessSync2, constants as constants2 } from "fs";
|
|
|
3527
3522
|
import { execSync as execSync2 } from "child_process";
|
|
3528
3523
|
var ISSUES_URL = `${REPO_URL}/issues/new`;
|
|
3529
3524
|
var BODY_CAP = 2e3;
|
|
3530
|
-
var VERSION = true ? "1.7.
|
|
3525
|
+
var VERSION = true ? "1.7.6" : "dev";
|
|
3531
3526
|
async function collectContext() {
|
|
3532
3527
|
const nodeVersion = process22.version;
|
|
3533
3528
|
const os3 = `${process22.platform} ${process22.arch}`;
|
|
@@ -3767,7 +3762,7 @@ function handleError(err) {
|
|
|
3767
3762
|
}
|
|
3768
3763
|
|
|
3769
3764
|
// src/cli/index.ts
|
|
3770
|
-
var CLI_VERSION = true ? "1.7.
|
|
3765
|
+
var CLI_VERSION = true ? "1.7.6" : "dev";
|
|
3771
3766
|
var main = defineCommand23({
|
|
3772
3767
|
meta: {
|
|
3773
3768
|
name: "clawops",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
applyPlan
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-35WVQY3X.js";
|
|
5
5
|
import "./chunk-6ZFIFDBJ.js";
|
|
6
6
|
import "./chunk-BOPSG2LI.js";
|
|
7
7
|
import {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-3QJBNAHW.js";
|
|
10
10
|
import {
|
|
11
11
|
generatePlan
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RAZZ256T.js";
|
|
13
13
|
import {
|
|
14
14
|
validatePlan
|
|
15
15
|
} from "./chunk-6X45DDGH.js";
|
|
@@ -23,15 +23,21 @@ import {
|
|
|
23
23
|
handleConfigValidate,
|
|
24
24
|
okText,
|
|
25
25
|
resolveConn
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FNS56UQY.js";
|
|
27
27
|
import {
|
|
28
28
|
acquireSession,
|
|
29
29
|
drainPool
|
|
30
30
|
} from "./chunk-DQDAWNGB.js";
|
|
31
|
-
import
|
|
31
|
+
import {
|
|
32
|
+
IMAGE_INSPECT_CMD,
|
|
33
|
+
OPENCLAW_CONFIG,
|
|
34
|
+
gatewayRunCommand,
|
|
35
|
+
imageForRestart
|
|
36
|
+
} from "./chunk-SEZMVVAS.js";
|
|
32
37
|
import {
|
|
33
38
|
buildContext
|
|
34
39
|
} from "./chunk-P5LKWRPL.js";
|
|
40
|
+
import "./chunk-EI7CQQ7D.js";
|
|
35
41
|
import "./chunk-PVUVI35Y.js";
|
|
36
42
|
import "./chunk-3XK66DKK.js";
|
|
37
43
|
import "./chunk-Q7NQY5HV.js";
|
|
@@ -476,7 +482,7 @@ async function handleAgentsList(input, _server) {
|
|
|
476
482
|
const conn = await resolveConn(ctx);
|
|
477
483
|
const { session, release } = await acquireSession(conn);
|
|
478
484
|
try {
|
|
479
|
-
const result = await session.exec('docker exec openclaw openclaw
|
|
485
|
+
const result = await session.exec('docker exec openclaw openclaw agents list --json 2>&1 || echo "[]"');
|
|
480
486
|
return okText(result.stdout.trim());
|
|
481
487
|
} finally {
|
|
482
488
|
release();
|
|
@@ -500,7 +506,7 @@ async function handleAgentsRestart(input, server) {
|
|
|
500
506
|
const { session, release } = await acquireSession(conn);
|
|
501
507
|
try {
|
|
502
508
|
const result = await session.exec(
|
|
503
|
-
`docker exec openclaw openclaw
|
|
509
|
+
`docker exec openclaw openclaw agents restart ${input.agentId} 2>&1`
|
|
504
510
|
);
|
|
505
511
|
if (result.code !== 0) {
|
|
506
512
|
return errText(`Failed to restart agent: ${result.stderr || result.stdout}`);
|
|
@@ -529,16 +535,12 @@ async function handleGatewayRestart(input, server) {
|
|
|
529
535
|
const conn = await resolveConn(ctx);
|
|
530
536
|
const { session, release } = await acquireSession(conn);
|
|
531
537
|
try {
|
|
532
|
-
const imgResult = await session.exec(
|
|
533
|
-
|
|
538
|
+
const imgResult = await session.exec(IMAGE_INSPECT_CMD);
|
|
539
|
+
const image = imageForRestart(imgResult.stdout);
|
|
540
|
+
if (!image.ok) return errText(image.error);
|
|
541
|
+
const result = await session.exec(
|
|
542
|
+
gatewayRunCommand({ image: image.value, configPath: OPENCLAW_CONFIG })
|
|
534
543
|
);
|
|
535
|
-
const image = imgResult.stdout.trim();
|
|
536
|
-
const cmd = [
|
|
537
|
-
"docker stop openclaw 2>/dev/null || true",
|
|
538
|
-
"docker rm openclaw 2>/dev/null || true",
|
|
539
|
-
`docker run -d --name openclaw --restart unless-stopped -p 18789:18789 -e OPENCLAW_CONFIG_PATH=/app/config.json --add-host=host.docker.internal:host-gateway -v /home/clawops/openclaw.json:/app/config.json:ro ${image}`
|
|
540
|
-
].join(" && ");
|
|
541
|
-
const result = await session.exec(cmd);
|
|
542
544
|
if (result.code !== 0) {
|
|
543
545
|
return errText(`Gateway restart failed: ${result.stderr}`);
|
|
544
546
|
}
|
|
@@ -1307,7 +1309,7 @@ If none of the above resolves the issue:
|
|
|
1307
1309
|
|
|
1308
1310
|
// src/mcp/server.ts
|
|
1309
1311
|
async function serveMcp(opts) {
|
|
1310
|
-
const { version } = await import("./package-
|
|
1312
|
+
const { version } = await import("./package-HTNU53G5.js");
|
|
1311
1313
|
const server = new McpServer({ name: "clawops", version });
|
|
1312
1314
|
registerTools(server, opts);
|
|
1313
1315
|
registerResources(server);
|