@clawops/cli 2.2.0 → 2.3.0
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 +61 -3
- package/dist/{apply-F5SQ2ZOS.js → apply-ODV3NOJJ.js} +9 -9
- package/dist/{automation-NBYQ6MFZ.js → automation-VDKLZMJI.js} +1 -1
- package/dist/{backup-flows-NDP5JTR3.js → backup-flows-THPX2D7S.js} +1 -1
- package/dist/{bootstrap-32TZXVDF.js → bootstrap-L3P5E4D7.js} +2 -2
- package/dist/{chunk-PASAVVNS.js → chunk-47CGHUVT.js} +1 -1
- package/dist/{chunk-E6BRQK67.js → chunk-4SEFKZRL.js} +1 -1
- package/dist/{chunk-PCSX6Y3U.js → chunk-66CUJFXK.js} +2 -2
- package/dist/{chunk-55UMO37O.js → chunk-CHPMOE4T.js} +1 -1
- package/dist/{chunk-CQOYUWR7.js → chunk-EGGXYZC6.js} +60 -59
- package/dist/{chunk-755X5OGS.js → chunk-FGY262WZ.js} +4 -1
- package/dist/{chunk-LV7UO5CG.js → chunk-G2ROJXYJ.js} +2 -2
- package/dist/{chunk-GFIR2IIJ.js → chunk-GYMAC4MW.js} +47 -28
- package/dist/{chunk-66R52R7K.js → chunk-K7OWMI63.js} +14 -8
- package/dist/{chunk-OUQVKIIA.js → chunk-PNRFFYOA.js} +14 -14
- package/dist/{chunk-AX65JMDZ.js → chunk-PRBDJSWN.js} +12 -9
- package/dist/{chunk-4MHDW2NB.js → chunk-QRF4OWG4.js} +1 -1
- package/dist/{chunk-AVERNLUY.js → chunk-SQPHNVCF.js} +6 -6
- package/dist/{chunk-RDUKRIRC.js → chunk-U3NRKBDW.js} +1 -1
- package/dist/cli.js +111 -72
- package/dist/{context-EHSLWKSH.js → context-4KTM4DKH.js} +5 -5
- package/dist/{flows-6B2I6TRW.js → flows-6YEJGHCK.js} +7 -7
- package/dist/{generate-4YYNW3IU.js → generate-OJ5UWTLV.js} +9 -7
- package/dist/{harden-UHAOVQMZ.js → harden-7O553IOK.js} +5 -5
- package/dist/{init-HOPXDNWY.js → init-RVQ72GZ5.js} +2 -2
- package/dist/{mcp-wire-BXF4DJFT.js → mcp-wire-HSGZFOG5.js} +21 -21
- package/dist/{migrate-flow-24XA4GZL.js → migrate-flow-4XQUUFMH.js} +2 -2
- package/dist/{package-HYGHRX35.js → package-UOWSHBWP.js} +1 -1
- package/dist/policy-4FFK7REN.js +42 -0
- package/dist/{remote-config-OZYBMBSK.js → remote-config-V2WXIXIF.js} +1 -1
- package/dist/{server-E3YA32ND.js → server-YH2JWZ2Q.js} +21 -21
- package/dist/setup-policy-OK5PGWP7.js +90 -0
- package/dist/{stack-config-ICQ5YHUL.js → stack-config-3E7KWFPI.js} +2 -2
- package/dist/{stack-delete-NTIGKWUF.js → stack-delete-SNPMLWMD.js} +2 -2
- package/dist/{state-AKZP2S4T.js → state-KG6K5QZC.js} +2 -2
- package/dist/{store-YOLQYXMB.js → store-BTQOOIJH.js} +1 -1
- package/dist/{tailscale-cutover-V42HO5UM.js → tailscale-cutover-XTMGDM5H.js} +2 -2
- package/dist/{validate-DZE6LFEB.js → validate-CRXX7OYF.js} +1 -1
- package/package.json +1 -1
- package/spec/errors.yaml +5 -3
- package/spec/mcp-tools.yaml +4 -3
- package/spec/openclaw-2.0.config.schema.json +1 -1
- package/dist/{chunk-UAJJEDCJ.js → chunk-AGSNTIYZ.js} +0 -0
- package/dist/{chunk-YPVWF7IA.js → chunk-HSGKK3RF.js} +3 -3
- package/dist/{ready-IJEUBFVX.js → ready-4H3NNEYQ.js} +3 -3
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-POYS3EVQ.js";
|
|
5
5
|
import {
|
|
6
6
|
validatePlan
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-47CGHUVT.js";
|
|
8
8
|
import {
|
|
9
9
|
buildContext,
|
|
10
10
|
loadAdapterModule
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SQPHNVCF.js";
|
|
12
12
|
import {
|
|
13
13
|
getConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GYMAC4MW.js";
|
|
15
15
|
import {
|
|
16
16
|
StateError,
|
|
17
17
|
UsageError
|
|
@@ -62,9 +62,12 @@ async function resolveInstanceType(intent) {
|
|
|
62
62
|
`[clawops] note: "${requested}" is not a clawops size (${INSTANCE_ALIASES.join(", ")}), so it is passed to ${intent.provider} as written.
|
|
63
63
|
`
|
|
64
64
|
);
|
|
65
|
-
return requested;
|
|
66
65
|
}
|
|
67
|
-
|
|
66
|
+
return nativeInstanceType(intent.provider, requested);
|
|
67
|
+
}
|
|
68
|
+
async function nativeInstanceType(provider, requested) {
|
|
69
|
+
if (!isInstanceAlias(requested)) return requested;
|
|
70
|
+
const adapter = await loadAdapterModule(provider);
|
|
68
71
|
return adapter.normalizeInstanceType(requested);
|
|
69
72
|
}
|
|
70
73
|
var parseDiffForTest = parseDiff;
|
|
@@ -74,9 +77,11 @@ async function generatePlan(intent, _opts) {
|
|
|
74
77
|
"plan/apply is not supported for the local provider. Use `clawops up` directly."
|
|
75
78
|
);
|
|
76
79
|
}
|
|
77
|
-
const { version } = await import("./package-
|
|
80
|
+
const { version } = await import("./package-UOWSHBWP.js");
|
|
78
81
|
const config = getConfig();
|
|
79
82
|
const instanceType = await resolveInstanceType(intent);
|
|
83
|
+
const { enforceInstanceType } = await import("./policy-4FFK7REN.js");
|
|
84
|
+
await enforceInstanceType(config, intent.provider, instanceType);
|
|
80
85
|
const { guardOpenclawVersion, defaultOpenclawVersion } = await import("./version-guard-XVYW5WFJ.js");
|
|
81
86
|
const openclawVersion = await guardOpenclawVersion(
|
|
82
87
|
intent.openclawVersion ?? await defaultOpenclawVersion()
|
|
@@ -126,7 +131,7 @@ A plan is only as good as the state it was computed against, so this is not a pl
|
|
|
126
131
|
);
|
|
127
132
|
}
|
|
128
133
|
try {
|
|
129
|
-
const { writeStackConfig } = await import("./stack-config-
|
|
134
|
+
const { writeStackConfig } = await import("./stack-config-3E7KWFPI.js");
|
|
130
135
|
await writeStackConfig(stack, plan);
|
|
131
136
|
const outputLines = [];
|
|
132
137
|
const preview = await stack.preview({
|
|
@@ -154,7 +159,7 @@ A plan is only as good as the state it was computed against, so this is not a pl
|
|
|
154
159
|
throw new Error(`Generated plan failed schema validation:
|
|
155
160
|
${validation.errors.join("\n")}`);
|
|
156
161
|
}
|
|
157
|
-
const { validatePlanConfig, validatePlanNetwork } = await import("./validate-
|
|
162
|
+
const { validatePlanConfig, validatePlanNetwork } = await import("./validate-CRXX7OYF.js");
|
|
158
163
|
const cfgCheck = await validatePlanConfig(plan);
|
|
159
164
|
for (const w of cfgCheck.warnings) process.stderr.write(`[clawops] warning: ${w}
|
|
160
165
|
`);
|
|
@@ -186,6 +191,7 @@ function expandHome(p) {
|
|
|
186
191
|
export {
|
|
187
192
|
INSTANCE_ALIASES,
|
|
188
193
|
isInstanceAlias,
|
|
194
|
+
nativeInstanceType,
|
|
189
195
|
parseDiffForTest,
|
|
190
196
|
generatePlan,
|
|
191
197
|
planId
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
listOverlays
|
|
4
|
-
} from "./chunk-6ZFIFDBJ.js";
|
|
5
2
|
import {
|
|
6
3
|
inspectContainer
|
|
7
4
|
} from "./chunk-Z3XLWZWF.js";
|
|
8
5
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
6
|
+
listOverlays
|
|
7
|
+
} from "./chunk-6ZFIFDBJ.js";
|
|
11
8
|
import {
|
|
12
9
|
interpretProbe,
|
|
13
10
|
probeCommand
|
|
14
11
|
} from "./chunk-LT4XMO5D.js";
|
|
12
|
+
import {
|
|
13
|
+
execPrivileged
|
|
14
|
+
} from "./chunk-WPZIJONN.js";
|
|
15
15
|
import {
|
|
16
16
|
PUBLISH_INSPECT_CMD,
|
|
17
17
|
STATE_DIR_CONTAINER,
|
|
@@ -158,8 +158,8 @@ function renderSnapshot(snap, opts) {
|
|
|
158
158
|
return lines.join("\n");
|
|
159
159
|
}
|
|
160
160
|
async function probeEntries() {
|
|
161
|
-
const { buildContext } = await import("./context-
|
|
162
|
-
const { getConfig } = await import("./store-
|
|
161
|
+
const { buildContext } = await import("./context-4KTM4DKH.js");
|
|
162
|
+
const { getConfig } = await import("./store-BTQOOIJH.js");
|
|
163
163
|
const config = getConfig();
|
|
164
164
|
if (!config) return [];
|
|
165
165
|
return Promise.all(
|
|
@@ -227,7 +227,7 @@ function renderMenu(entries, selectedIdx, showAll, noColor, confirmDelete) {
|
|
|
227
227
|
return lines.join("\n");
|
|
228
228
|
}
|
|
229
229
|
async function deleteFromRegistry(name) {
|
|
230
|
-
const { requireConfig, setConfig } = await import("./store-
|
|
230
|
+
const { requireConfig, setConfig } = await import("./store-BTQOOIJH.js");
|
|
231
231
|
const config = requireConfig();
|
|
232
232
|
const newStacks = { ...config.stacks };
|
|
233
233
|
delete newStacks[name];
|
|
@@ -385,7 +385,7 @@ var monitor_default = defineCommand({
|
|
|
385
385
|
const tailLines = Math.max(1, parseInt(String(args.tail ?? "10"), 10) || 10);
|
|
386
386
|
const isTTY = Boolean(process.stdout.isTTY);
|
|
387
387
|
const noColor = Boolean(args["no-color"]) || !isTTY;
|
|
388
|
-
const { buildContext } = await import("./context-
|
|
388
|
+
const { buildContext } = await import("./context-4KTM4DKH.js");
|
|
389
389
|
const { acquireSession, drainPool } = await import("./pool-NT4XBSUT.js");
|
|
390
390
|
const ac = new AbortController();
|
|
391
391
|
process.on("SIGINT", () => ac.abort());
|
|
@@ -718,7 +718,7 @@ import { accessSync, mkdirSync, readFileSync, constants } from "fs";
|
|
|
718
718
|
import ssh2 from "ssh2";
|
|
719
719
|
import path from "path";
|
|
720
720
|
async function runDiagnostics(opts = {}, deps = {}) {
|
|
721
|
-
const { getConfig, getConfigDir } = await import("./store-
|
|
721
|
+
const { getConfig, getConfigDir } = await import("./store-BTQOOIJH.js");
|
|
722
722
|
const config = getConfig();
|
|
723
723
|
const sections = [];
|
|
724
724
|
sections.push({ title: "Runtime", checks: await runtimeChecks(getConfigDir()) });
|
|
@@ -1018,8 +1018,8 @@ async function deployedVersionCheck(image, deployedVersion) {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
async function hardeningChecks(conn, stack, signal) {
|
|
1020
1020
|
try {
|
|
1021
|
-
const { MODULE_CATALOG, resolveModules, withRemoteExec } = await import("./harden-
|
|
1022
|
-
const { buildContext } = await import("./context-
|
|
1021
|
+
const { MODULE_CATALOG, resolveModules, withRemoteExec } = await import("./harden-7O553IOK.js");
|
|
1022
|
+
const { buildContext } = await import("./context-4KTM4DKH.js");
|
|
1023
1023
|
const provider = buildContext({ stack }).adapter.name;
|
|
1024
1024
|
const modules = resolveModules(MODULE_CATALOG, void 0, provider);
|
|
1025
1025
|
const checks = [];
|
|
@@ -1041,8 +1041,8 @@ async function hardeningChecks(conn, stack, signal) {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
1043
|
async function defaultOpenSession(stack, signal) {
|
|
1044
|
-
const { getConfig } = await import("./store-
|
|
1045
|
-
const { buildContext } = await import("./context-
|
|
1044
|
+
const { getConfig } = await import("./store-BTQOOIJH.js");
|
|
1045
|
+
const { buildContext } = await import("./context-4KTM4DKH.js");
|
|
1046
1046
|
const { extractBaseOutputs } = await import("./outputs-DJHBY7EE.js");
|
|
1047
1047
|
const { acquireSession } = await import("./pool-NT4XBSUT.js");
|
|
1048
1048
|
const config = getConfig();
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveSecrets
|
|
4
4
|
} from "./chunk-BOPSG2LI.js";
|
|
5
|
+
import {
|
|
6
|
+
writeStackConfig
|
|
7
|
+
} from "./chunk-CHPMOE4T.js";
|
|
5
8
|
import {
|
|
6
9
|
atomicWriteConfig,
|
|
7
10
|
deepMerge,
|
|
8
11
|
readRemoteConfig,
|
|
9
12
|
restartGateway
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AGSNTIYZ.js";
|
|
11
14
|
import {
|
|
12
15
|
validatePlan
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
writeStackConfig
|
|
16
|
-
} from "./chunk-55UMO37O.js";
|
|
16
|
+
} from "./chunk-47CGHUVT.js";
|
|
17
17
|
import {
|
|
18
18
|
buildContext
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SQPHNVCF.js";
|
|
20
20
|
import {
|
|
21
21
|
saveOverlay
|
|
22
22
|
} from "./chunk-6ZFIFDBJ.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
getConfig,
|
|
28
28
|
setConfig
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-GYMAC4MW.js";
|
|
30
30
|
import {
|
|
31
31
|
UsageError
|
|
32
32
|
} from "./chunk-KGXPLI7W.js";
|
|
@@ -48,13 +48,16 @@ ${validation.errors.join("\n")}`
|
|
|
48
48
|
}
|
|
49
49
|
const { guardOpenclawVersion } = await import("./version-guard-XVYW5WFJ.js");
|
|
50
50
|
await guardOpenclawVersion(plan.spec.openclaw.version);
|
|
51
|
+
const { enforceInstanceType } = await import("./policy-4FFK7REN.js");
|
|
52
|
+
const { getConfig: getConfig2 } = await import("./store-BTQOOIJH.js");
|
|
53
|
+
await enforceInstanceType(getConfig2(), plan.spec.provider, plan.spec.instanceType);
|
|
51
54
|
const ctx = buildContext({
|
|
52
55
|
stack: plan.spec.stackName,
|
|
53
56
|
provider: plan.spec.provider
|
|
54
57
|
});
|
|
55
58
|
const stack = await ctx.getStack();
|
|
56
59
|
const { guardPrivateOnlyApply } = await import("./private-only-DIA26I2E.js");
|
|
57
|
-
const { probeSsh } = await import("./tailscale-cutover-
|
|
60
|
+
const { probeSsh } = await import("./tailscale-cutover-XTMGDM5H.js");
|
|
58
61
|
await guardPrivateOnlyApply(plan, ctx, opts?.probeTailnet ?? ((conn2) => probeSsh(conn2, opts?.signal)));
|
|
59
62
|
await writeStackConfig(stack, plan);
|
|
60
63
|
if (plan.metadata.stackVersion !== void 0) {
|
|
@@ -93,7 +96,7 @@ The diff you reviewed may no longer reflect what will be applied.
|
|
|
93
96
|
signal: opts?.signal,
|
|
94
97
|
onProgress: (line) => reportProgress(opts, line)
|
|
95
98
|
});
|
|
96
|
-
const { waitForGateway } = await import("./ready-
|
|
99
|
+
const { waitForGateway } = await import("./ready-4H3NNEYQ.js");
|
|
97
100
|
try {
|
|
98
101
|
await waitForGateway(readySession, {
|
|
99
102
|
signal: opts?.signal,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
getProvider
|
|
4
|
-
} from "./chunk-VUFMZEIM.js";
|
|
5
2
|
import {
|
|
6
3
|
readLocalState
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U3NRKBDW.js";
|
|
8
5
|
import {
|
|
9
6
|
getConfigDir,
|
|
10
7
|
requireConfig
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GYMAC4MW.js";
|
|
12
9
|
import {
|
|
13
10
|
UsageError
|
|
14
11
|
} from "./chunk-KGXPLI7W.js";
|
|
12
|
+
import {
|
|
13
|
+
getProvider
|
|
14
|
+
} from "./chunk-VUFMZEIM.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/context.ts
|
|
17
17
|
function buildContext(args) {
|
|
@@ -41,7 +41,7 @@ function buildContext(args) {
|
|
|
41
41
|
`Stack "${stackName}" not found in config. Run \`clawops init\` or use \`--stack\` to specify a different stack.`
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
const { getOrCreateStack } = await import("./automation-
|
|
44
|
+
const { getOrCreateStack } = await import("./automation-VDKLZMJI.js");
|
|
45
45
|
stackCache = await getOrCreateStack({
|
|
46
46
|
stack: stackName,
|
|
47
47
|
stateUrl: stackConfig.stateUrl,
|