@clawops/cli 1.7.9 → 2.0.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 (98) hide show
  1. package/README.md +504 -76
  2. package/dist/apply-KYFPWI5U.js +27 -0
  3. package/dist/automation-RMAIBNVC.js +44 -0
  4. package/dist/bedrock-XVASJX2K.js +61 -0
  5. package/dist/{bootstrap-HL4DNUNG.js → bootstrap-HNGKY6WW.js} +31 -19
  6. package/dist/bootstrap.sh.tmpl +51 -31
  7. package/dist/channels-KBUR42IU.js +53 -0
  8. package/dist/chunk-2I7KCMXZ.js +142 -0
  9. package/dist/{chunk-DQDAWNGB.js → chunk-2Z7J3ERQ.js} +1 -1
  10. package/dist/chunk-3OLUJPCB.js +36 -0
  11. package/dist/chunk-5XT5IAJK.js +69 -0
  12. package/dist/chunk-AEEMRFZV.js +24 -0
  13. package/dist/chunk-BSLIYB5Q.js +106 -0
  14. package/dist/{chunk-3XK66DKK.js → chunk-E4NJSJ54.js} +57 -93
  15. package/dist/chunk-FEK7VJAY.js +16 -0
  16. package/dist/{chunk-UKTP332Z.js → chunk-GAZPPSKU.js} +6 -7
  17. package/dist/chunk-GIEVAGEK.js +126 -0
  18. package/dist/chunk-HSPHXG6W.js +67 -0
  19. package/dist/chunk-IVWP4QUJ.js +901 -0
  20. package/dist/{chunk-PVUVI35Y.js → chunk-JW5A7E3X.js} +5 -1
  21. package/dist/{chunk-GZN7PKP4.js → chunk-KC3GC3PE.js} +328 -121
  22. package/dist/chunk-LBE6COC4.js +244 -0
  23. package/dist/chunk-LEVIW2PV.js +890 -0
  24. package/dist/chunk-LT4XMO5D.js +50 -0
  25. package/dist/chunk-MC5ATCXS.js +108 -0
  26. package/dist/chunk-N4WZLWJ4.js +16 -0
  27. package/dist/chunk-NUDIHZEH.js +55 -0
  28. package/dist/chunk-NUL5F6YV.js +56 -0
  29. package/dist/chunk-RHOWYIWT.js +52 -0
  30. package/dist/chunk-STLRHLLV.js +193 -0
  31. package/dist/chunk-V25QRZRB.js +45 -0
  32. package/dist/chunk-VOEJYRIK.js +33 -0
  33. package/dist/{providers-2OABPW2E.js → chunk-VUFMZEIM.js} +3 -2
  34. package/dist/chunk-W3OLNNJW.js +51 -0
  35. package/dist/cli-WLD3EBEM.js +11 -0
  36. package/dist/cli-auth-GD5SK7JU.js +13 -0
  37. package/dist/cli.js +1296 -695
  38. package/dist/config-validate-K2N6XLDX.js +76 -0
  39. package/dist/context-7EVC6W45.js +20 -0
  40. package/dist/docker-3PDO4TS7.js +12 -0
  41. package/dist/{firewall-XQGO7HWK.js → firewall-5VKZ4WBH.js} +32 -1
  42. package/dist/generate-I6YQ5V2T.js +29 -0
  43. package/dist/{harden-URPXLSVF.js → harden-72JMRT4E.js} +51 -11
  44. package/dist/health-5CCOXYGG.js +11 -0
  45. package/dist/index.d.ts +56 -0
  46. package/dist/known-hosts-file-I3Q3NBYQ.js +22 -0
  47. package/dist/logs-5A7YYA53.js +15 -0
  48. package/dist/{mcp-wire-7E5JQY47.js → mcp-wire-3SWBM7D6.js} +32 -16
  49. package/dist/models-AGTQWYDL.js +32 -0
  50. package/dist/network-args-PYJRJBYO.js +64 -0
  51. package/dist/{package-5AR4ZPK4.js → package-5BCMEBTE.js} +11 -4
  52. package/dist/passphrase-MJBE45N7.js +15 -0
  53. package/dist/plugins-DTST3OER.js +49 -0
  54. package/dist/{pool-QGFQRMGU.js → pool-PIIKJ4L2.js} +3 -2
  55. package/dist/preflight-EF52S3WW.js +162 -0
  56. package/dist/preflight-MWWM5JT3.js +181 -0
  57. package/dist/preflight-TFD4N5ZU.js +141 -0
  58. package/dist/privileged-JFA6LLTV.js +17 -0
  59. package/dist/providers-FW6H6OPF.js +11 -0
  60. package/dist/ready-KDNRBNSU.js +95 -0
  61. package/dist/{remote-config-QDLN4UMG.js → remote-config-3HZLUWEA.js} +4 -3
  62. package/dist/runtime-X3KW5TCP.js +44 -0
  63. package/dist/server-GBA7BJGK.js +46 -0
  64. package/dist/spec-path-KQOOIQCA.js +9 -0
  65. package/dist/ssh-VAI5DU5M.js +11 -0
  66. package/dist/ssh-key-DUO6OKOI.js +7 -0
  67. package/dist/stack-config-R4SPSUQZ.js +12 -0
  68. package/dist/upgrade-ULD4KFYC.js +88 -0
  69. package/dist/validate-YVI3BJ55.js +14 -0
  70. package/dist/{version-guard-VUCNZXQS.js → version-guard-XVYW5WFJ.js} +2 -2
  71. package/dist/{versions-2UVAT6PQ.js → versions-W5LRQCAJ.js} +2 -2
  72. package/dist/wait-WO72TRRQ.js +79 -0
  73. package/package.json +11 -4
  74. package/spec/deploy-plan.schema.json +114 -25
  75. package/spec/integrations.yaml +135 -28
  76. package/spec/mcp-tools.yaml +89 -37
  77. package/spec/models.yaml +23 -3
  78. package/spec/openclaw-2.0.config.schema.json +1 -0
  79. package/spec/openclaw-versions.yaml +116 -27
  80. package/spec/providers.schema.json +163 -28
  81. package/dist/apply-F3KY2HTB.js +0 -17
  82. package/dist/automation-RULUSJBW.js +0 -30
  83. package/dist/aws-L4RR2LSE.js +0 -254
  84. package/dist/azure-7OXQENQL.js +0 -262
  85. package/dist/chunk-35WVQY3X.js +0 -122
  86. package/dist/chunk-6X45DDGH.js +0 -42
  87. package/dist/chunk-A4QR4TXW.js +0 -120
  88. package/dist/chunk-C5X375RO.js +0 -85
  89. package/dist/chunk-FNS56UQY.js +0 -741
  90. package/dist/chunk-P5LKWRPL.js +0 -114
  91. package/dist/chunk-SEZMVVAS.js +0 -156
  92. package/dist/context-5LCUG2QR.js +0 -10
  93. package/dist/gcp-UG6AWPIZ.js +0 -193
  94. package/dist/generate-OAGYT3VH.js +0 -15
  95. package/dist/local-DXBEVZ5C.js +0 -47
  96. package/dist/server-FIZCOLHL.js +0 -32
  97. package/dist/ssh-CNJNLM3E.js +0 -8
  98. package/dist/validate-CFQ4FH2T.js +0 -10
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- validatePlan
4
- } from "./chunk-6X45DDGH.js";
5
- import {
6
- buildContext
7
- } from "./chunk-P5LKWRPL.js";
8
- import {
9
- getConfig
10
- } from "./chunk-CX5SL5HP.js";
11
- import {
12
- UsageError
13
- } from "./chunk-KGXPLI7W.js";
14
-
15
- // src/plan/generate.ts
16
- import { randomUUID } from "crypto";
17
- var PREVIEW_LINE_RE = /^([+~-])\s+(\S+)\s+(\S+)?/;
18
- function parseDiff(lines) {
19
- const create = [];
20
- const update = [];
21
- const del = [];
22
- for (const line of lines) {
23
- const m = PREVIEW_LINE_RE.exec(line.trimStart());
24
- if (!m) continue;
25
- const [, op, resourceType, name] = m;
26
- const ref = {
27
- urn: `urn:pulumi:::clawops::${resourceType}::${name ?? ""}`,
28
- type: resourceType,
29
- ...name ? { name } : {}
30
- };
31
- if (op === "+") create.push(ref);
32
- else if (op === "~") update.push({ resource: ref, before: null, after: null });
33
- else if (op === "-") del.push(ref);
34
- }
35
- return {
36
- create,
37
- update,
38
- delete: del,
39
- totalChanges: create.length + update.length + del.length
40
- };
41
- }
42
- async function generatePlan(intent, _opts) {
43
- if (intent.provider === "local") {
44
- throw new UsageError(
45
- "plan/apply is not supported for the local provider. Use `clawops up` directly."
46
- );
47
- }
48
- const { version } = await import("./package-5AR4ZPK4.js");
49
- const config = getConfig();
50
- const instanceType = intent.instanceType ?? "small";
51
- const { guardOpenclawVersion, defaultOpenclawVersion } = await import("./version-guard-VUCNZXQS.js");
52
- const openclawVersion = await guardOpenclawVersion(
53
- intent.openclawVersion ?? await defaultOpenclawVersion()
54
- );
55
- const network = intent.network ?? {
56
- allowedSshCidrs: [],
57
- allowedGatewayCidrs: []
58
- };
59
- const stackName = intent.stackName;
60
- const region = intent.region ?? config?.stacks[stackName]?.region;
61
- const plan = {
62
- apiVersion: "clawops.dev/v1",
63
- kind: "DeployPlan",
64
- metadata: {
65
- name: stackName,
66
- generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
67
- generator: "clawops",
68
- generatorVersion: version
69
- },
70
- spec: {
71
- provider: intent.provider,
72
- region,
73
- stackName,
74
- instanceType,
75
- openclaw: { version: openclawVersion },
76
- network,
77
- ...intent.tags ? { tags: intent.tags } : {}
78
- }
79
- };
80
- try {
81
- const ctx = buildContext({ stack: stackName, provider: intent.provider });
82
- const stack = await ctx.getStack();
83
- await stack.setConfig("instanceType", { value: instanceType });
84
- if (region) await stack.setConfig("region", { value: region });
85
- await stack.setConfig("openclawVersion", { value: openclawVersion });
86
- const outputLines = [];
87
- const preview = await stack.preview({
88
- onOutput: (line) => outputLines.push(line)
89
- });
90
- const diff = parseDiff(outputLines);
91
- if (diff.totalChanges === 0 && preview.changeSummary) {
92
- const summary = preview.changeSummary;
93
- diff.totalChanges = (summary["create"] ?? 0) + (summary["update"] ?? 0) + (summary["delete"] ?? 0);
94
- }
95
- plan.diff = diff;
96
- const info = await stack.info();
97
- if (info !== void 0) {
98
- plan.metadata.stackVersion = info.version;
99
- }
100
- } catch (err) {
101
- process.stderr.write(
102
- `[clawops] Warning: preview failed, diff section omitted: ${err instanceof Error ? err.message : String(err)}
103
- `
104
- );
105
- }
106
- const validation = validatePlan(plan);
107
- if (!validation.ok) {
108
- throw new Error(`Generated plan failed schema validation:
109
- ${validation.errors.join("\n")}`);
110
- }
111
- return plan;
112
- }
113
- function planId() {
114
- return randomUUID().slice(0, 8);
115
- }
116
-
117
- export {
118
- generatePlan,
119
- planId
120
- };
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/providers/startup.ts
4
- function makeStartupScript(opts) {
5
- const { openclawVersion, os, bedrockEnabled = false } = opts;
6
- const dockerDistro = os === "ubuntu" ? "ubuntu" : "debian";
7
- const bedrockEnvBlock = bedrockEnabled ? makeBedrockEnvBlock() : "";
8
- return `#!/bin/bash
9
- set -euo pipefail
10
-
11
- # \u2500\u2500 User setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
12
- id -u clawops &>/dev/null || useradd -m -s /bin/bash clawops
13
- mkdir -p /home/clawops/.ssh
14
- chmod 700 /home/clawops/.ssh
15
- chown clawops:clawops /home/clawops/.ssh
16
-
17
- # \u2500\u2500 Docker installation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
18
- if ! command -v docker &>/dev/null; then
19
- export DEBIAN_FRONTEND=noninteractive
20
- apt-get update -q
21
- apt-get install -y -q ca-certificates curl gnupg lsb-release
22
- install -m 0755 -d /etc/apt/keyrings
23
- curl -fsSL https://download.docker.com/linux/${dockerDistro}/gpg \\
24
- -o /etc/apt/keyrings/docker.asc
25
- chmod a+r /etc/apt/keyrings/docker.asc
26
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \\
27
- https://download.docker.com/linux/${dockerDistro} $(lsb_release -cs) stable" \\
28
- > /etc/apt/sources.list.d/docker.list
29
- apt-get update -q
30
- apt-get install -y -q \\
31
- docker-ce \\
32
- docker-ce-cli \\
33
- containerd.io \\
34
- docker-buildx-plugin \\
35
- docker-compose-plugin
36
- systemctl enable --now docker
37
- fi
38
-
39
- usermod -aG docker clawops
40
-
41
- # \u2500\u2500 OpenClaw image \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
42
- OPENCLAW_VERSION="${openclawVersion}"
43
- docker pull ghcr.io/openclaw/openclaw:\${OPENCLAW_VERSION}
44
-
45
- # \u2500\u2500 Gateway auth token \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
46
- # OpenClaw refuses a non-loopback bind without auth, and in a container it always
47
- # binds 0.0.0.0. Without a token the gateway exits 78 and restart-loops.
48
- OPENCLAW_ENV_FILE=/home/clawops/openclaw.env
49
- if [ ! -s "\${OPENCLAW_ENV_FILE}" ]; then
50
- OPENCLAW_TOKEN=$(openssl rand -hex 32 2>/dev/null || head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \\n')
51
- printf 'OPENCLAW_GATEWAY_TOKEN=%s\\n' "\${OPENCLAW_TOKEN}" > "\${OPENCLAW_ENV_FILE}"
52
- chmod 600 "\${OPENCLAW_ENV_FILE}"
53
- chown clawops:clawops "\${OPENCLAW_ENV_FILE}"
54
- fi
55
-
56
- # \u2500\u2500 Default config (apply.ts will overwrite with plan overlay) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
57
- OPENCLAW_CONFIG=/home/clawops/openclaw.json
58
- if [ ! -f "\${OPENCLAW_CONFIG}" ]; then
59
- cat > "\${OPENCLAW_CONFIG}" <<'OPENCLAWJSON'
60
- {"meta":{"lastTouchedVersion":"2026.4"},"gateway":{"port":18789,"auth":{"mode":"token"}},"models":{},"channels":{}}
61
- OPENCLAWJSON
62
- chown clawops:clawops "\${OPENCLAW_CONFIG}"
63
- fi
64
-
65
- # \u2500\u2500 Start OpenClaw container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
66
- docker stop openclaw 2>/dev/null || true
67
- docker rm openclaw 2>/dev/null || true
68
- docker run -d \\
69
- --name openclaw \\
70
- --restart unless-stopped \\
71
- -p 18789:18789 \\
72
- -e OPENCLAW_CONFIG_PATH=/app/config.json --add-host=host.docker.internal:host-gateway \\
73
- --env-file "\${OPENCLAW_ENV_FILE}" \\
74
- -v "\${OPENCLAW_CONFIG}":/app/config.json:ro \\
75
- ${bedrockEnvBlock} ghcr.io/openclaw/openclaw:\${OPENCLAW_VERSION} \\
76
- node openclaw.mjs gateway run --allow-unconfigured --port 18789
77
- `;
78
- }
79
- function makeBedrockEnvBlock() {
80
- return ' -e AWS_DEFAULT_REGION=$( \\\n IMDS_TOKEN=$(curl -sf -X PUT \\\n "http://169.254.169.254/latest/api/token" \\\n -H "X-aws-ec2-metadata-token-ttl-seconds: 60") && \\\n curl -sf \\\n -H "X-aws-ec2-metadata-token: ${IMDS_TOKEN}" \\\n "http://169.254.169.254/latest/meta-data/placement/region" \\\n || echo us-east-1) \\\n';
81
- }
82
-
83
- export {
84
- makeStartupScript
85
- };