@clawops/cli 2.0.0 → 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.
- package/README.md +98 -12
- package/dist/apply-KYFPWI5U.js +27 -0
- package/dist/automation-RMAIBNVC.js +44 -0
- package/dist/bedrock-XVASJX2K.js +61 -0
- package/dist/{bootstrap-DMRPWJGN.js → bootstrap-HNGKY6WW.js} +11 -8
- package/dist/{chunk-N44K3LHE.js → chunk-2I7KCMXZ.js} +6 -4
- package/dist/{chunk-3WYA2QDM.js → chunk-2Z7J3ERQ.js} +1 -1
- package/dist/chunk-3OLUJPCB.js +36 -0
- package/dist/chunk-5XT5IAJK.js +69 -0
- package/dist/chunk-AEEMRFZV.js +24 -0
- package/dist/{chunk-YR3O2I3S.js → chunk-BSLIYB5Q.js} +6 -1
- package/dist/{chunk-AHAAEXWC.js → chunk-E4NJSJ54.js} +16 -93
- package/dist/chunk-FEK7VJAY.js +16 -0
- package/dist/{chunk-6TIYVHPX.js → chunk-GIEVAGEK.js} +7 -33
- package/dist/chunk-HSPHXG6W.js +67 -0
- package/dist/{chunk-GYV4KNW7.js → chunk-IVWP4QUJ.js} +133 -40
- package/dist/{chunk-AX74VXTV.js → chunk-KC3GC3PE.js} +58 -49
- package/dist/{chunk-UFRO4H5W.js → chunk-LBE6COC4.js} +56 -40
- package/dist/chunk-LEVIW2PV.js +890 -0
- package/dist/chunk-MC5ATCXS.js +108 -0
- package/dist/chunk-N4WZLWJ4.js +16 -0
- package/dist/{chunk-SBLQH2TJ.js → chunk-NUL5F6YV.js} +1 -1
- package/dist/chunk-RHOWYIWT.js +52 -0
- package/dist/{chunk-WHJMKDV7.js → chunk-STLRHLLV.js} +65 -12
- package/dist/chunk-V25QRZRB.js +45 -0
- package/dist/chunk-VOEJYRIK.js +33 -0
- package/dist/{providers-2OABPW2E.js → chunk-VUFMZEIM.js} +3 -2
- package/dist/chunk-W3OLNNJW.js +51 -0
- package/dist/cli-WLD3EBEM.js +11 -0
- package/dist/cli-auth-GD5SK7JU.js +13 -0
- package/dist/cli.js +518 -206
- package/dist/context-7EVC6W45.js +20 -0
- package/dist/docker-3PDO4TS7.js +12 -0
- package/dist/{firewall-T3NTPZJD.js → firewall-5VKZ4WBH.js} +22 -1
- package/dist/generate-I6YQ5V2T.js +29 -0
- package/dist/{harden-PCDK3UQ5.js → harden-72JMRT4E.js} +8 -5
- package/dist/index.d.ts +56 -0
- package/dist/known-hosts-file-I3Q3NBYQ.js +22 -0
- package/dist/{logs-P7YCKVF4.js → logs-5A7YYA53.js} +1 -1
- package/dist/{mcp-wire-BFEY2Y6H.js → mcp-wire-3SWBM7D6.js} +25 -15
- package/dist/models-AGTQWYDL.js +32 -0
- package/dist/network-args-PYJRJBYO.js +64 -0
- package/dist/{package-3HUW57XH.js → package-5BCMEBTE.js} +10 -3
- package/dist/passphrase-MJBE45N7.js +15 -0
- package/dist/{pool-EX4ZTA5P.js → pool-PIIKJ4L2.js} +3 -2
- package/dist/preflight-EF52S3WW.js +162 -0
- package/dist/preflight-MWWM5JT3.js +181 -0
- package/dist/preflight-TFD4N5ZU.js +141 -0
- package/dist/providers-FW6H6OPF.js +11 -0
- package/dist/ready-KDNRBNSU.js +95 -0
- package/dist/{remote-config-Z6IIZR3D.js → remote-config-3HZLUWEA.js} +3 -2
- package/dist/{runtime-LZ7NA53V.js → runtime-X3KW5TCP.js} +4 -2
- package/dist/server-GBA7BJGK.js +46 -0
- package/dist/ssh-VAI5DU5M.js +11 -0
- package/dist/ssh-key-DUO6OKOI.js +7 -0
- package/dist/stack-config-R4SPSUQZ.js +12 -0
- package/dist/{validate-BOQRWX4F.js → validate-YVI3BJ55.js} +1 -1
- package/dist/wait-WO72TRRQ.js +79 -0
- package/package.json +10 -3
- package/spec/mcp-tools.yaml +21 -2
- package/spec/models.yaml +14 -3
- package/spec/providers.schema.json +163 -28
- package/dist/apply-AM5HERE7.js +0 -19
- package/dist/automation-RULUSJBW.js +0 -30
- package/dist/aws-AMON7DA7.js +0 -265
- package/dist/azure-T4G6OBJQ.js +0 -273
- package/dist/chunk-CKSPROD5.js +0 -129
- package/dist/chunk-LU2V3LXA.js +0 -114
- package/dist/context-KHKWJJMC.js +0 -10
- package/dist/gcp-2JBTD7ZM.js +0 -204
- package/dist/generate-2XV2GSP2.js +0 -15
- package/dist/local-DXBEVZ5C.js +0 -47
- package/dist/server-A5AB67GQ.js +0 -36
- package/dist/ssh-B3NZAU4I.js +0 -8
- package/dist/{version-guard-GPSTCPT7.js → version-guard-XVYW5WFJ.js} +1 -1
package/dist/gcp-2JBTD7ZM.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
makeStartupScript
|
|
4
|
-
} from "./chunk-CKSPROD5.js";
|
|
5
|
-
import {
|
|
6
|
-
GATEWAY_PORT
|
|
7
|
-
} from "./chunk-6TIYVHPX.js";
|
|
8
|
-
import "./chunk-EI7CQQ7D.js";
|
|
9
|
-
|
|
10
|
-
// src/providers/gcp/index.ts
|
|
11
|
-
import process2 from "process";
|
|
12
|
-
|
|
13
|
-
// src/providers/gcp/program.ts
|
|
14
|
-
var SSH_PORT = 22;
|
|
15
|
-
var gcpProgram = async () => {
|
|
16
|
-
const [pulumi, gcp, { resolveIngressCidrs, resolveGatewayIngressCidrs, resolveGatewayPort, detectEgressIp }] = await Promise.all([
|
|
17
|
-
import("@pulumi/pulumi"),
|
|
18
|
-
import("@pulumi/gcp"),
|
|
19
|
-
import("./firewall-T3NTPZJD.js")
|
|
20
|
-
]);
|
|
21
|
-
const cfg = new pulumi.Config();
|
|
22
|
-
const instanceType = cfg.get("instanceType") ?? "e2-standard-2";
|
|
23
|
-
const region = cfg.get("region") ?? "us-central1";
|
|
24
|
-
const openclawVersion = cfg.get("openclawVersion") ?? "latest";
|
|
25
|
-
const publishGateway = cfg.get("publishGateway") === "all" ? "all" : "loopback";
|
|
26
|
-
const gatewayPort = resolveGatewayPort(cfg.get("gatewayPort"), GATEWAY_PORT);
|
|
27
|
-
const zone = cfg.get("zone") ?? `${region}-a`;
|
|
28
|
-
const accessMode = cfg.get("accessMode") ?? "restricted";
|
|
29
|
-
const allowedCidrs = cfg.get("allowedCidrs") ?? "";
|
|
30
|
-
const sshCidrs = cfg.get("sshCidrs") ?? "";
|
|
31
|
-
const gatewayCidrs = cfg.get("gatewayCidrs") ?? "";
|
|
32
|
-
const sshPublicKey = cfg.get("sshPublicKey");
|
|
33
|
-
if (!sshPublicKey) {
|
|
34
|
-
throw new Error(
|
|
35
|
-
'Stack config "sshPublicKey" is required for the GCP adapter. Set it with: pulumi config set --stack <name> sshPublicKey "ssh-ed25519 ..."'
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
const egressResult = accessMode === "auto" ? await detectEgressIp("https://ifconfig.me") : { ok: true, ip: "" };
|
|
39
|
-
if (accessMode === "open") {
|
|
40
|
-
process.stderr.write(
|
|
41
|
-
"[clawops] WARNING: accessMode=open allows 0.0.0.0/0 on SSH and gateway ports. Only use this for development/sandbox stacks.\n"
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
const sshIngressCidrs = resolveIngressCidrs(accessMode, allowedCidrs, sshCidrs, egressResult);
|
|
45
|
-
const gatewayIngressCidrs = resolveGatewayIngressCidrs(
|
|
46
|
-
publishGateway,
|
|
47
|
-
accessMode,
|
|
48
|
-
allowedCidrs,
|
|
49
|
-
gatewayCidrs,
|
|
50
|
-
egressResult
|
|
51
|
-
);
|
|
52
|
-
const network = new gcp.compute.Network("clawops-network", {
|
|
53
|
-
autoCreateSubnetworks: false,
|
|
54
|
-
description: "clawops managed network"
|
|
55
|
-
});
|
|
56
|
-
const subnet = new gcp.compute.Subnetwork("clawops-subnet", {
|
|
57
|
-
ipCidrRange: "10.0.0.0/24",
|
|
58
|
-
region,
|
|
59
|
-
network: network.selfLink
|
|
60
|
-
});
|
|
61
|
-
if (sshIngressCidrs.length > 0) {
|
|
62
|
-
new gcp.compute.Firewall("clawops-firewall-ssh", {
|
|
63
|
-
network: network.selfLink,
|
|
64
|
-
allows: [{ protocol: "tcp", ports: [String(SSH_PORT)] }],
|
|
65
|
-
sourceRanges: sshIngressCidrs,
|
|
66
|
-
targetTags: ["clawops"]
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if (gatewayIngressCidrs.length > 0) {
|
|
70
|
-
new gcp.compute.Firewall("clawops-firewall-gateway", {
|
|
71
|
-
network: network.selfLink,
|
|
72
|
-
allows: [{ protocol: "tcp", ports: [String(gatewayPort)] }],
|
|
73
|
-
sourceRanges: gatewayIngressCidrs,
|
|
74
|
-
targetTags: ["clawops"]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
const address = new gcp.compute.Address("clawops-address", { region });
|
|
78
|
-
const instance = new gcp.compute.Instance("clawops-instance", {
|
|
79
|
-
machineType: instanceType,
|
|
80
|
-
zone,
|
|
81
|
-
tags: ["clawops"],
|
|
82
|
-
bootDisk: {
|
|
83
|
-
initializeParams: {
|
|
84
|
-
image: "debian-cloud/debian-12",
|
|
85
|
-
size: 20
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
networkInterfaces: [
|
|
89
|
-
{
|
|
90
|
-
network: network.selfLink,
|
|
91
|
-
subnetwork: subnet.selfLink,
|
|
92
|
-
accessConfigs: [
|
|
93
|
-
{
|
|
94
|
-
natIp: address.address,
|
|
95
|
-
networkTier: "PREMIUM"
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
metadata: {
|
|
101
|
-
// GCP guest agent reads 'ssh-keys' and populates /home/<user>/.ssh/authorized_keys
|
|
102
|
-
"ssh-keys": `clawops:${sshPublicKey}`,
|
|
103
|
-
"startup-script": makeStartupScript({ openclawVersion, os: "debian", publishGateway, gatewayPort })
|
|
104
|
-
},
|
|
105
|
-
serviceAccount: {
|
|
106
|
-
scopes: ["https://www.googleapis.com/auth/cloud-platform"]
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return {
|
|
110
|
-
instanceId: instance.id,
|
|
111
|
-
publicIp: address.address,
|
|
112
|
-
gatewayUrl: pulumi.interpolate`https://${address.address}:${gatewayPort}`,
|
|
113
|
-
sshHost: address.address,
|
|
114
|
-
sshPort: SSH_PORT,
|
|
115
|
-
sshUser: "clawops",
|
|
116
|
-
region,
|
|
117
|
-
provisionedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// src/providers/gcp/index.ts
|
|
122
|
-
var INSTANCE_TYPE_MAP = {
|
|
123
|
-
micro: "e2-micro",
|
|
124
|
-
small: "e2-standard-2",
|
|
125
|
-
medium: "e2-standard-4",
|
|
126
|
-
large: "e2-standard-8",
|
|
127
|
-
gpu: "n1-standard-4"
|
|
128
|
-
// TODO M3: add accelerator config for GPU instances
|
|
129
|
-
};
|
|
130
|
-
var gcpAdapter = {
|
|
131
|
-
name: "gcp",
|
|
132
|
-
get program() {
|
|
133
|
-
return gcpProgram;
|
|
134
|
-
},
|
|
135
|
-
getConnectionInfo(outputs) {
|
|
136
|
-
return {
|
|
137
|
-
host: String(outputs["sshHost"] ?? ""),
|
|
138
|
-
port: Number(outputs["sshPort"] ?? 22),
|
|
139
|
-
user: String(outputs["sshUser"] ?? "clawops"),
|
|
140
|
-
privateKeyPath: String(outputs["privateKeyPath"] ?? ""),
|
|
141
|
-
knownHostsPath: String(outputs["knownHostsPath"] ?? "")
|
|
142
|
-
};
|
|
143
|
-
},
|
|
144
|
-
normalizeInstanceType(alias) {
|
|
145
|
-
if (alias === "gpu") {
|
|
146
|
-
throw new Error(
|
|
147
|
-
"GPU instances are not yet supported on GCP. Use --provider aws (g4dn.xlarge) or --provider azure (Standard_NC6s_v3) for GPU workloads."
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
const mapped = INSTANCE_TYPE_MAP[alias];
|
|
151
|
-
if (!mapped) throw new Error(`Unknown instance alias: ${alias}`);
|
|
152
|
-
return mapped;
|
|
153
|
-
},
|
|
154
|
-
defaultRegion() {
|
|
155
|
-
return "us-central1";
|
|
156
|
-
},
|
|
157
|
-
stateBackendUrl(bucket) {
|
|
158
|
-
return `gs://${bucket}`;
|
|
159
|
-
},
|
|
160
|
-
async validateConfig() {
|
|
161
|
-
const errors = [];
|
|
162
|
-
const hasKeyFile = Boolean(process2.env["GOOGLE_APPLICATION_CREDENTIALS"]);
|
|
163
|
-
const hasToken = Boolean(process2.env["GOOGLE_OAUTH_ACCESS_TOKEN"]);
|
|
164
|
-
const hasAdcFile = await checkAdcFile();
|
|
165
|
-
if (!hasKeyFile && !hasToken && !hasAdcFile) {
|
|
166
|
-
const onGcp = await checkInstanceMetadata();
|
|
167
|
-
if (!onGcp) {
|
|
168
|
-
errors.push(
|
|
169
|
-
"No GCP credentials found. Set GOOGLE_APPLICATION_CREDENTIALS to a service account key file, or run `gcloud auth application-default login`."
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return { ok: errors.length === 0, errors };
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
async function checkAdcFile() {
|
|
177
|
-
try {
|
|
178
|
-
const { accessSync } = await import("fs");
|
|
179
|
-
const { join } = await import("path");
|
|
180
|
-
const home = process2.env["HOME"] ?? process2.env["USERPROFILE"] ?? "";
|
|
181
|
-
accessSync(join(home, ".config", "gcloud", "application_default_credentials.json"));
|
|
182
|
-
return true;
|
|
183
|
-
} catch {
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
async function checkInstanceMetadata() {
|
|
188
|
-
try {
|
|
189
|
-
const res = await fetch(
|
|
190
|
-
"http://metadata.google.internal/computeMetadata/v1/instance/id",
|
|
191
|
-
{
|
|
192
|
-
headers: { "Metadata-Flavor": "Google" },
|
|
193
|
-
signal: AbortSignal.timeout(1e3)
|
|
194
|
-
}
|
|
195
|
-
);
|
|
196
|
-
return res.ok;
|
|
197
|
-
} catch {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
var gcp_default = gcpAdapter;
|
|
202
|
-
export {
|
|
203
|
-
gcp_default as default
|
|
204
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
generatePlan,
|
|
4
|
-
planId
|
|
5
|
-
} from "./chunk-WHJMKDV7.js";
|
|
6
|
-
import "./chunk-YR3O2I3S.js";
|
|
7
|
-
import "./chunk-LU2V3LXA.js";
|
|
8
|
-
import "./chunk-JW5A7E3X.js";
|
|
9
|
-
import "./chunk-A2I76FTA.js";
|
|
10
|
-
import "./chunk-CX5SL5HP.js";
|
|
11
|
-
import "./chunk-KGXPLI7W.js";
|
|
12
|
-
export {
|
|
13
|
-
generatePlan,
|
|
14
|
-
planId
|
|
15
|
-
};
|
package/dist/local-DXBEVZ5C.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/providers/local/index.ts
|
|
4
|
-
import { accessSync } from "fs";
|
|
5
|
-
var localAdapter = {
|
|
6
|
-
name: "local",
|
|
7
|
-
/** Never called — local stacks bypass Pulumi entirely. */
|
|
8
|
-
get program() {
|
|
9
|
-
return async () => ({});
|
|
10
|
-
},
|
|
11
|
-
getConnectionInfo(outputs) {
|
|
12
|
-
return {
|
|
13
|
-
host: String(outputs["sshHost"] ?? ""),
|
|
14
|
-
port: Number(outputs["sshPort"] ?? 22),
|
|
15
|
-
user: String(outputs["sshUser"] ?? "root"),
|
|
16
|
-
privateKeyPath: String(outputs["privateKeyPath"] ?? ""),
|
|
17
|
-
knownHostsPath: String(outputs["knownHostsPath"] ?? "")
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
normalizeInstanceType(_alias) {
|
|
21
|
-
return "local";
|
|
22
|
-
},
|
|
23
|
-
defaultRegion() {
|
|
24
|
-
return "local";
|
|
25
|
-
},
|
|
26
|
-
stateBackendUrl(_bucket) {
|
|
27
|
-
return "file://~/.clawops/state";
|
|
28
|
-
},
|
|
29
|
-
async validateConfig() {
|
|
30
|
-
const keyPath = process.env["CLAWOPS_SSH_KEY_PATH"];
|
|
31
|
-
if (keyPath) {
|
|
32
|
-
try {
|
|
33
|
-
accessSync(keyPath);
|
|
34
|
-
} catch {
|
|
35
|
-
return {
|
|
36
|
-
ok: false,
|
|
37
|
-
errors: [`SSH key not readable: ${keyPath}`]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return { ok: true, errors: [] };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var local_default = localAdapter;
|
|
45
|
-
export {
|
|
46
|
-
local_default as default
|
|
47
|
-
};
|
package/dist/server-A5AB67GQ.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
MCP_HTTP_PORT,
|
|
4
|
-
authRequirement,
|
|
5
|
-
bearerFrom,
|
|
6
|
-
isLoopbackBind,
|
|
7
|
-
serveMcp
|
|
8
|
-
} from "./chunk-AX74VXTV.js";
|
|
9
|
-
import "./chunk-UFRO4H5W.js";
|
|
10
|
-
import "./chunk-N44K3LHE.js";
|
|
11
|
-
import "./chunk-3QJBNAHW.js";
|
|
12
|
-
import "./chunk-WHJMKDV7.js";
|
|
13
|
-
import "./chunk-YR3O2I3S.js";
|
|
14
|
-
import "./chunk-6ZFIFDBJ.js";
|
|
15
|
-
import "./chunk-3WYA2QDM.js";
|
|
16
|
-
import "./chunk-AHAAEXWC.js";
|
|
17
|
-
import "./chunk-BOPSG2LI.js";
|
|
18
|
-
import "./chunk-LU2V3LXA.js";
|
|
19
|
-
import "./chunk-GYV4KNW7.js";
|
|
20
|
-
import "./chunk-SBLQH2TJ.js";
|
|
21
|
-
import "./chunk-LT4XMO5D.js";
|
|
22
|
-
import "./chunk-NUDIHZEH.js";
|
|
23
|
-
import "./chunk-JW5A7E3X.js";
|
|
24
|
-
import "./chunk-Q7NQY5HV.js";
|
|
25
|
-
import "./chunk-A2I76FTA.js";
|
|
26
|
-
import "./chunk-CX5SL5HP.js";
|
|
27
|
-
import "./chunk-KGXPLI7W.js";
|
|
28
|
-
import "./chunk-6TIYVHPX.js";
|
|
29
|
-
import "./chunk-EI7CQQ7D.js";
|
|
30
|
-
export {
|
|
31
|
-
MCP_HTTP_PORT,
|
|
32
|
-
authRequirement,
|
|
33
|
-
bearerFrom,
|
|
34
|
-
isLoopbackBind,
|
|
35
|
-
serveMcp
|
|
36
|
-
};
|
package/dist/ssh-B3NZAU4I.js
DELETED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
loadVersionSpec
|
|
5
5
|
} from "./chunk-GAZPPSKU.js";
|
|
6
6
|
import "./chunk-JW5A7E3X.js";
|
|
7
|
+
import "./chunk-EI7CQQ7D.js";
|
|
7
8
|
import {
|
|
8
9
|
UsageError
|
|
9
10
|
} from "./chunk-KGXPLI7W.js";
|
|
10
|
-
import "./chunk-EI7CQQ7D.js";
|
|
11
11
|
|
|
12
12
|
// src/cli/version-guard.ts
|
|
13
13
|
async function defaultOpenclawVersion() {
|