@geravant/sinain 1.0.3 → 1.0.4
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 +11 -9
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -52,7 +52,7 @@ if (fs.existsSync(OC_JSON)) {
|
|
|
52
52
|
}
|
|
53
53
|
cfg.plugins ??= {};
|
|
54
54
|
cfg.plugins.entries ??= {};
|
|
55
|
-
cfg.plugins.entries["sinain"] = {
|
|
55
|
+
cfg.plugins.entries["sinain-hud"] = {
|
|
56
56
|
enabled: true,
|
|
57
57
|
config: {
|
|
58
58
|
heartbeatPath: path.join(SOURCES_DIR, "HEARTBEAT.md"),
|
|
@@ -60,13 +60,15 @@ cfg.plugins.entries["sinain"] = {
|
|
|
60
60
|
sessionKey: "agent:main:sinain"
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
+
// Remove stale "sinain" entry if present from a previous install
|
|
64
|
+
delete cfg.plugins.entries["sinain"];
|
|
63
65
|
cfg.agents ??= {};
|
|
64
66
|
cfg.agents.defaults ??= {};
|
|
65
67
|
cfg.agents.defaults.sandbox ??= {};
|
|
66
68
|
cfg.agents.defaults.sandbox.sessionToolsVisibility = "all";
|
|
67
|
-
cfg.compaction = { mode: "safeguard", maxHistoryShare: 0.2, reserveTokensFloor: 40000 };
|
|
68
69
|
cfg.gateway ??= {};
|
|
69
|
-
cfg.gateway.
|
|
70
|
+
cfg.gateway.mode = "local"; // required for gateway to start
|
|
71
|
+
cfg.gateway.bind = "lan"; // allow remote Mac to connect
|
|
70
72
|
|
|
71
73
|
fs.mkdirSync(path.dirname(OC_JSON), { recursive: true });
|
|
72
74
|
fs.writeFileSync(OC_JSON, JSON.stringify(cfg, null, 2));
|
|
@@ -91,16 +93,16 @@ if (backupUrl) {
|
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
// 7.
|
|
96
|
+
// 7. Start / restart gateway
|
|
95
97
|
try {
|
|
96
|
-
execSync("openclaw
|
|
97
|
-
console.log(" ✓ Gateway
|
|
98
|
+
execSync("openclaw gateway restart --background", { stdio: "pipe" });
|
|
99
|
+
console.log(" ✓ Gateway restarted");
|
|
98
100
|
} catch {
|
|
99
101
|
try {
|
|
100
|
-
execSync("openclaw
|
|
101
|
-
console.log(" ✓ Gateway
|
|
102
|
+
execSync("openclaw gateway start --background", { stdio: "pipe" });
|
|
103
|
+
console.log(" ✓ Gateway started");
|
|
102
104
|
} catch {
|
|
103
|
-
console.warn(" ⚠ Could not
|
|
105
|
+
console.warn(" ⚠ Could not start gateway — run: openclaw gateway start");
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
|