@opentrust/cli 7.3.31 → 7.3.33
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/dist/commands/init.js +3 -3
- package/dist/lib/command-handler.js +10 -0
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -13,9 +13,9 @@ const SCAFFOLD_PKG = {
|
|
|
13
13
|
status: "opentrust status",
|
|
14
14
|
},
|
|
15
15
|
dependencies: {
|
|
16
|
-
"@opentrust/core": "^7.3.
|
|
17
|
-
"@opentrust/gateway": "^7.3.
|
|
18
|
-
"@opentrust/dashboard": "^7.3.
|
|
16
|
+
"@opentrust/core": "^7.3.33",
|
|
17
|
+
"@opentrust/gateway": "^7.3.33",
|
|
18
|
+
"@opentrust/dashboard": "^7.3.33",
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
const ENV_TEMPLATE = `# OpenTrust Configuration
|
|
@@ -294,6 +294,7 @@ function handleInstallOpenclaw(payload) {
|
|
|
294
294
|
if (!config)
|
|
295
295
|
return { success: false, error: "Missing config in payload. Configure OpenClaw template in Settings first." };
|
|
296
296
|
const results = [];
|
|
297
|
+
// Step 1: Install OpenClaw via curl
|
|
297
298
|
try {
|
|
298
299
|
const output = execSync("curl -fsSL https://openclaw.ai/install.sh | bash", {
|
|
299
300
|
encoding: "utf-8",
|
|
@@ -315,6 +316,7 @@ function handleInstallOpenclaw(payload) {
|
|
|
315
316
|
return { success: false, error: `Install script failed: ${(stderr || err.message || String(err)).slice(0, 500)}` };
|
|
316
317
|
}
|
|
317
318
|
}
|
|
319
|
+
// Step 2: Write openclaw.json config
|
|
318
320
|
try {
|
|
319
321
|
const clawHome = path.join(os.homedir(), ".openclaw");
|
|
320
322
|
fs.mkdirSync(clawHome, { recursive: true });
|
|
@@ -325,5 +327,13 @@ function handleInstallOpenclaw(payload) {
|
|
|
325
327
|
catch (err) {
|
|
326
328
|
return { success: false, error: `Failed to write config: ${(err.message || String(err)).slice(0, 500)}` };
|
|
327
329
|
}
|
|
330
|
+
// Step 3: Auto-install Guards plugin
|
|
331
|
+
const guardsResult = runClawPluginCmd("openclaw plugins install @opentrust/guards");
|
|
332
|
+
if (guardsResult.success) {
|
|
333
|
+
results.push(`Guards plugin: installed${guardsResult.output ? ` (${guardsResult.output.split("\n").pop()})` : ""}`);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
results.push(`Guards plugin: install failed — ${guardsResult.error?.slice(0, 200) ?? "unknown error"}`);
|
|
337
|
+
}
|
|
328
338
|
return { success: true, output: results.join("\n") };
|
|
329
339
|
}
|