open-agents-ai 0.187.319 → 0.187.320
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/postinstall-daemon.cjs +28 -0
- package/package.json +1 -1
|
@@ -96,4 +96,32 @@ function migrate() {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
try { migrate(); } catch {}
|
|
99
|
+
|
|
100
|
+
// After install: force-restart the OA daemon so the new version is active.
|
|
101
|
+
// 1) Prefer systemd --user: restart open-agents-daemon.service if present
|
|
102
|
+
// 2) Fallback: launch the freshly installed CLI's launcher in daemon mode
|
|
103
|
+
// using this package's dist/launcher.cjs (absolute path), detached.
|
|
104
|
+
function restartDaemon() {
|
|
105
|
+
try {
|
|
106
|
+
execSync('systemctl --user is-enabled open-agents-daemon.service >/dev/null 2>&1 || true', { stdio: 'pipe' });
|
|
107
|
+
try {
|
|
108
|
+
execSync('systemctl --user restart open-agents-daemon.service', { stdio: 'pipe' });
|
|
109
|
+
return;
|
|
110
|
+
} catch {}
|
|
111
|
+
} catch {}
|
|
112
|
+
try {
|
|
113
|
+
const { spawn } = require('node:child_process');
|
|
114
|
+
const { resolve, join } = require('node:path');
|
|
115
|
+
const la = resolve(__dirname, 'launcher.cjs');
|
|
116
|
+
const nodeBin = process.execPath;
|
|
117
|
+
const child = spawn(nodeBin, [la, 'serve', '--daemon', '--quiet'], {
|
|
118
|
+
detached: true,
|
|
119
|
+
stdio: 'ignore',
|
|
120
|
+
env: Object.assign({}, process.env, { OA_DAEMON: '' })
|
|
121
|
+
});
|
|
122
|
+
child.unref();
|
|
123
|
+
} catch {}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
try { restartDaemon(); } catch {}
|
|
99
127
|
process.exit(0);
|
package/package.json
CHANGED