@geravant/sinain 1.0.6 → 1.0.8
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/install.js +9 -2
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -3,6 +3,7 @@ import fs from "fs";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import os from "os";
|
|
5
5
|
import { execSync } from "child_process";
|
|
6
|
+
import { randomBytes } from "crypto";
|
|
6
7
|
|
|
7
8
|
const HOME = os.homedir();
|
|
8
9
|
const PLUGIN_DIR = path.join(HOME, ".openclaw/extensions/sinain-hud");
|
|
@@ -73,6 +74,12 @@ cfg.agents.defaults.sandbox.sessionToolsVisibility = "all";
|
|
|
73
74
|
cfg.gateway ??= {};
|
|
74
75
|
cfg.gateway.mode = "local"; // required for gateway to start
|
|
75
76
|
cfg.gateway.bind = "lan"; // allow remote Mac to connect
|
|
77
|
+
cfg.gateway.auth ??= {};
|
|
78
|
+
cfg.gateway.auth.mode ??= "token";
|
|
79
|
+
if (!cfg.gateway.auth.token) {
|
|
80
|
+
cfg.gateway.auth.token = randomBytes(24).toString("hex");
|
|
81
|
+
}
|
|
82
|
+
const authToken = cfg.gateway.auth.token;
|
|
76
83
|
|
|
77
84
|
fs.mkdirSync(path.dirname(OC_JSON), { recursive: true });
|
|
78
85
|
fs.writeFileSync(OC_JSON, JSON.stringify(cfg, null, 2));
|
|
@@ -112,8 +119,8 @@ try {
|
|
|
112
119
|
|
|
113
120
|
console.log("\n✓ sinain installed successfully.");
|
|
114
121
|
console.log(" Plugin config: ~/.openclaw/openclaw.json");
|
|
115
|
-
console.log(
|
|
116
|
-
console.log("
|
|
122
|
+
console.log(` Auth token: ${authToken}`);
|
|
123
|
+
console.log(" Next: run 'openclaw gateway' in a new terminal, then run ./setup-nemoclaw.sh on your Mac.\n");
|
|
117
124
|
|
|
118
125
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
119
126
|
|