@geravant/sinain 1.0.11 → 1.0.13

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.
Files changed (2) hide show
  1. package/install.js +10 -8
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -116,13 +116,14 @@ async function installNemoClaw({ sandboxName }) {
116
116
  cfg.agents.defaults ??= {};
117
117
  cfg.agents.defaults.sandbox ??= {};
118
118
  cfg.agents.defaults.sandbox.sessionToolsVisibility = "all";
119
- cfg.compaction = { mode: "safeguard", maxHistoryShare: 0.2, reserveTokensFloor: 40000 };
120
- // NemoClaw: gateway bind/auth are managed by OpenShell — do not overwrite them
119
+ // NemoClaw: gateway bind/auth and compaction are managed by OpenShell do not overwrite them
121
120
 
122
121
  const token = cfg.gateway?.auth?.token ?? "(see sandbox openclaw.json)";
123
122
 
124
- fs.writeFileSync(tmpJson, JSON.stringify(cfg, null, 2));
125
- run(`openshell sandbox upload ${sandboxName} "${tmpJson}" /sandbox/.openclaw/openclaw.json`);
123
+ const jsonContent = JSON.stringify(cfg, null, 2);
124
+ // openshell upload always treats destination as a directory, so use SSH to write the file directly
125
+ const encoded = Buffer.from(jsonContent).toString("base64");
126
+ run(`ssh -T openshell-${sandboxName} "printf '%s' '${encoded}' | base64 --decode > /sandbox/.openclaw/openclaw.json"`);
126
127
  fs.rmSync(tmpDir, { recursive: true, force: true });
127
128
  console.log(" ✓ openclaw.json patched in sandbox");
128
129
 
@@ -139,12 +140,13 @@ async function installNemoClaw({ sandboxName }) {
139
140
  }
140
141
  }
141
142
 
142
- // Reload openclaw gateway inside sandbox
143
+ // Restart openclaw gateway inside sandbox (kill existing PID + start fresh)
143
144
  try {
144
- run_capture(`ssh -T openshell-${sandboxName} 'openclaw reload'`);
145
- console.log(" Gateway reloaded");
145
+ // Find the gateway PID, kill it, then start a new instance detached
146
+ run_capture(`ssh -T openshell-${sandboxName} 'pid=$(ss -tlnp 2>/dev/null | awk -F"pid=" "/18789/{print \\$2}" | cut -d, -f1); [ -n "$pid" ] && kill "$pid"; nohup openclaw gateway > /tmp/oc-gateway.log 2>&1 &'`);
147
+ console.log(" ✓ Gateway restarted");
146
148
  } catch {
147
- console.warn(" ⚠ Could not reload gateway — it will pick up changes on next start");
149
+ console.warn(" ⚠ Could not restart gateway — it will pick up changes on next start");
148
150
  }
149
151
 
150
152
  console.log(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geravant/sinain",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "sinain OpenClaw plugin — AI overlay for macOS",
5
5
  "type": "module",
6
6
  "bin": {