@clawops/cli 2.1.3 → 2.2.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.
Files changed (52) hide show
  1. package/README.md +133 -2
  2. package/dist/agent-activity-25FAWLAI.js +16 -0
  3. package/dist/{apply-JARPVA5Y.js → apply-F5SQ2ZOS.js} +7 -7
  4. package/dist/backup-flows-NDP5JTR3.js +29 -0
  5. package/dist/{bootstrap-3PBVY7MA.js → bootstrap-32TZXVDF.js} +3 -3
  6. package/dist/bootstrap.sh.tmpl +4 -0
  7. package/dist/chunk-27335SIH.js +51 -0
  8. package/dist/{chunk-E4NJSJ54.js → chunk-4PY6PN4G.js} +51 -7
  9. package/dist/{chunk-7T4CIT7C.js → chunk-AX65JMDZ.js} +15 -15
  10. package/dist/chunk-E6BRQK67.js +289 -0
  11. package/dist/chunk-LV7UO5CG.js +82 -0
  12. package/dist/{chunk-GIEVAGEK.js → chunk-N5ZYUTZS.js} +16 -1
  13. package/dist/{chunk-CPCO6UJK.js → chunk-OUQVKIIA.js} +368 -30
  14. package/dist/{chunk-XFN3YDZE.js → chunk-PASAVVNS.js} +1 -1
  15. package/dist/chunk-PCSX6Y3U.js +297 -0
  16. package/dist/chunk-POYS3EVQ.js +14 -0
  17. package/dist/chunk-SX75L2T3.js +46 -0
  18. package/dist/{chunk-PTCVFLZ3.js → chunk-T6OCPTTR.js} +7 -11
  19. package/dist/{chunk-2Z7J3ERQ.js → chunk-TYNMOYVM.js} +1 -1
  20. package/dist/{chunk-2I7KCMXZ.js → chunk-UAJJEDCJ.js} +2 -2
  21. package/dist/{chunk-NUDIHZEH.js → chunk-WPZIJONN.js} +14 -12
  22. package/dist/{chunk-TYHTISI5.js → chunk-Y3N63PDS.js} +610 -104
  23. package/dist/{chunk-CHNSL3TC.js → chunk-YPVWF7IA.js} +1 -1
  24. package/dist/{chunk-3OLUJPCB.js → chunk-Z3XLWZWF.js} +1 -1
  25. package/dist/cli.js +303 -698
  26. package/dist/conn-M2V5HBPJ.js +9 -0
  27. package/dist/{context-WOKSKAIA.js → context-EHSLWKSH.js} +2 -2
  28. package/dist/{docker-3PDO4TS7.js → docker-IKM5GRMC.js} +2 -2
  29. package/dist/{flows-HGJIA6EL.js → flows-6B2I6TRW.js} +5 -5
  30. package/dist/{generate-NE54BATS.js → generate-4JWTMOLQ.js} +5 -4
  31. package/dist/{harden-RUOUA5BV.js → harden-UHAOVQMZ.js} +3 -3
  32. package/dist/{mcp-wire-FIO5DFBY.js → mcp-wire-7MGEAMZH.js} +21 -14
  33. package/dist/migrate-flow-24XA4GZL.js +25 -0
  34. package/dist/{package-MF5LPITL.js → package-ESYPCIES.js} +3 -1
  35. package/dist/{pool-PIIKJ4L2.js → pool-NT4XBSUT.js} +2 -2
  36. package/dist/{privileged-JFA6LLTV.js → privileged-5Y6O4H7Z.js} +1 -1
  37. package/dist/{ready-KDNRBNSU.js → ready-IJEUBFVX.js} +2 -2
  38. package/dist/{remote-config-3HZLUWEA.js → remote-config-OZYBMBSK.js} +3 -3
  39. package/dist/{runtime-X3KW5TCP.js → runtime-VW53TU2W.js} +5 -1
  40. package/dist/{server-OXWHBTXK.js → server-Y2EDRUDL.js} +21 -14
  41. package/dist/ssh-HOM7GF3M.js +13 -0
  42. package/dist/stack-delete-NTIGKWUF.js +13 -0
  43. package/dist/{tailscale-cutover-EKAQSDXP.js → tailscale-cutover-V42HO5UM.js} +1 -1
  44. package/dist/{validate-JXKN5WD6.js → validate-DZE6LFEB.js} +1 -1
  45. package/dist/{wait-WO72TRRQ.js → wait-DOUNNJNN.js} +2 -2
  46. package/package.json +3 -1
  47. package/spec/mcp-tools.yaml +213 -7
  48. package/spec/openclaw-2.0.config.schema.json +1 -1
  49. package/dist/logs-5A7YYA53.js +0 -15
  50. package/dist/ssh-VAI5DU5M.js +0 -11
  51. package/dist/upgrade-ULD4KFYC.js +0 -88
  52. /package/dist/{chunk-NUL5F6YV.js → chunk-SOZ62ZXW.js} +0 -0
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- GATEWAY_LOGS_PROBE,
4
- agentAuditCommand,
5
- chooseLogSource,
6
- containerLogsCommand,
7
- gatewayLogsCommand
8
- } from "./chunk-NUL5F6YV.js";
9
- export {
10
- GATEWAY_LOGS_PROBE,
11
- agentAuditCommand,
12
- chooseLogSource,
13
- containerLogsCommand,
14
- gatewayLogsCommand
15
- };
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- connect,
4
- describeConnectError
5
- } from "./chunk-E4NJSJ54.js";
6
- import "./chunk-MC5ATCXS.js";
7
- import "./chunk-KGXPLI7W.js";
8
- export {
9
- connect,
10
- describeConnectError
11
- };
@@ -1,88 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/openclaw/upgrade.ts
4
- function judgePreflight(report) {
5
- const { targetVersion, foundVersion, status, reason } = report;
6
- if (status === "indeterminate") {
7
- return {
8
- ok: false,
9
- reason: reason ?? "the database schema could not be determined, so compatibility with the target release is unknown"
10
- };
11
- }
12
- if (typeof foundVersion === "number" && typeof targetVersion === "number") {
13
- if (foundVersion > targetVersion) {
14
- return {
15
- ok: false,
16
- reason: `the state database is at schema ${foundVersion}, but the target release understands ${targetVersion}. This is a downgrade across a schema boundary: the older release would read a database written by a newer one. Restore a backup taken before the upgrade instead.`
17
- };
18
- }
19
- if (foundVersion < targetVersion) {
20
- return { ok: true, note: `state will migrate from schema ${foundVersion} to ${targetVersion}` };
21
- }
22
- return { ok: true };
23
- }
24
- return {
25
- ok: false,
26
- reason: reason ?? `preflight returned no schema version (status: ${status ?? "unknown"})`
27
- };
28
- }
29
- function parsePreflight(stdout) {
30
- try {
31
- const parsed = JSON.parse(stdout.trim());
32
- if (parsed !== null && typeof parsed === "object") return parsed;
33
- } catch {
34
- }
35
- return void 0;
36
- }
37
- function snapshotCommand(image, stateDir, repo) {
38
- return `docker run --rm -v ${stateDir}:/home/node/.openclaw ${image} openclaw backup sqlite create --global --repository ${repo} --json`;
39
- }
40
- function preflightCommand(targetImage, stateDir, snapshotDb) {
41
- return `docker run --rm -v ${stateDir}:/home/node/.openclaw ${targetImage} openclaw database preflight ${snapshotDb} --json`;
42
- }
43
- function snapshotPathFrom(stdout) {
44
- try {
45
- const parsed = JSON.parse(stdout.trim());
46
- if (parsed.ok === true && typeof parsed.snapshotPath === "string") return parsed.snapshotPath;
47
- } catch {
48
- }
49
- return void 0;
50
- }
51
- function repairCommand(image, stateDir) {
52
- return `docker run --rm -v ${stateDir}:/home/node/.openclaw ${image} openclaw doctor --fix --non-interactive --yes`;
53
- }
54
- function describeOutcome(o, version) {
55
- switch (o.kind) {
56
- case "started":
57
- return `Gateway updated to ${version}.`;
58
- case "repaired":
59
- return `Gateway updated to ${version} after a one-shot repair (doctor --fix).`;
60
- case "rolled-back":
61
- return `Rolled back to ${o.to}: the gateway did not start on ${version} \u2014 ${o.reason}. The previous image is running again. If it also fails, restore the snapshot taken before the upgrade.`;
62
- case "failed":
63
- return `Upgrade to ${version} failed and the rollback did not come up either \u2014 ${o.reason}. The state snapshot taken before the upgrade is at ${o.snapshotPath}; restore it with \`openclaw backup sqlite restore\` before retrying.`;
64
- }
65
- }
66
- async function resolveUpgrade(steps, ctx) {
67
- const first = await steps.gate();
68
- if (first.ok) return { kind: "started" };
69
- await steps.repair();
70
- await steps.run(ctx.version);
71
- const second = await steps.gate();
72
- if (second.ok) return { kind: "repaired" };
73
- const reason = second.reason ?? first.reason ?? "unknown";
74
- if (!ctx.previousVersion) return { kind: "failed", reason, snapshotPath: ctx.snapshotPath };
75
- await steps.run(ctx.previousVersion);
76
- const back = await steps.gate();
77
- return back.ok ? { kind: "rolled-back", to: ctx.previousVersion, reason } : { kind: "failed", reason, snapshotPath: ctx.snapshotPath };
78
- }
79
- export {
80
- describeOutcome,
81
- judgePreflight,
82
- parsePreflight,
83
- preflightCommand,
84
- repairCommand,
85
- resolveUpgrade,
86
- snapshotCommand,
87
- snapshotPathFrom
88
- };
File without changes