@lightupai/polaris 0.0.99 → 0.0.100
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/package.json +1 -1
- package/src/cli/cli.ts +24 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightupai/polaris",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.100",
|
|
4
4
|
"description": "Record and stream Claude Code sessions to Slack. Like Gong for AI coding — capture every prompt, response, and tool call. Multiplayer collaboration across AI coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
package/src/cli/cli.ts
CHANGED
|
@@ -184,8 +184,18 @@ const SYSTEMD_SERVICE_FILE = join(SYSTEMD_USER_DIR, `${SYSTEMD_SERVICE_NAME}.ser
|
|
|
184
184
|
async function installSystemdService(daemonSecret?: string): Promise<void> {
|
|
185
185
|
// Resolve bun's absolute path at install time so systemd's minimal PATH
|
|
186
186
|
// doesn't matter. Bun.which() searches PATH; process.execPath is the
|
|
187
|
-
// interpreter we're already running under
|
|
188
|
-
const
|
|
187
|
+
// interpreter we're already running under.
|
|
188
|
+
const resolvedBun = Bun.which("bun") ?? process.execPath;
|
|
189
|
+
|
|
190
|
+
// Warn when bun resolved to an npx cache directory — that path is volatile
|
|
191
|
+
// and will break the service if the cache is pruned or the hash changes.
|
|
192
|
+
const isVolatile = resolvedBun.includes("/_npx/") || resolvedBun.includes("/npx_cache/");
|
|
193
|
+
if (isVolatile) {
|
|
194
|
+
console.error(` Warning: bun was found at a volatile npm cache path:`);
|
|
195
|
+
console.error(` ${resolvedBun}`);
|
|
196
|
+
console.error(` The daemon service may break if npm cleans its cache.`);
|
|
197
|
+
console.error(` Install bun permanently for reliability: curl -fsSL https://bun.sh/install | bash`);
|
|
198
|
+
}
|
|
189
199
|
|
|
190
200
|
const binDir = join(POLARIS_DIR, "bin");
|
|
191
201
|
const runnerPath = join(binDir, "run-daemon.sh");
|
|
@@ -194,12 +204,19 @@ async function installSystemdService(daemonSecret?: string): Promise<void> {
|
|
|
194
204
|
);
|
|
195
205
|
|
|
196
206
|
await mkdir(binDir, { recursive: true });
|
|
197
|
-
//
|
|
207
|
+
// Runner tries the baked-in path first (fast path), then falls back to
|
|
208
|
+
// common stable install locations, then npx as a last resort — so the
|
|
209
|
+
// service survives a cache prune or bun reinstall without needing
|
|
210
|
+
// `polaris install` to be rerun.
|
|
198
211
|
const runner = [
|
|
199
212
|
"#!/bin/sh",
|
|
200
213
|
`# Polaris daemon — managed by systemd (${SYSTEMD_SERVICE_NAME}.service)`,
|
|
201
|
-
|
|
202
|
-
`
|
|
214
|
+
`DAEMONTS="${daemonTsPath}"`,
|
|
215
|
+
`for BUNPATH in "${resolvedBun}" "$HOME/.bun/bin/bun" /usr/local/bin/bun /usr/bin/bun; do`,
|
|
216
|
+
` if [ -x "$BUNPATH" ]; then exec "$BUNPATH" run "$DAEMONTS"; fi`,
|
|
217
|
+
`done`,
|
|
218
|
+
`# npx fallback — slow but avoids exit-127 restart loops`,
|
|
219
|
+
`exec npx --yes bun run "$DAEMONTS"`,
|
|
203
220
|
].join("\n") + "\n";
|
|
204
221
|
await writeFile(runnerPath, runner);
|
|
205
222
|
await chmod(runnerPath, 0o755);
|
|
@@ -214,7 +231,8 @@ Type=simple
|
|
|
214
231
|
ExecStart=${runnerPath}
|
|
215
232
|
Restart=always
|
|
216
233
|
RestartSec=5
|
|
217
|
-
${secretLine}
|
|
234
|
+
${secretLine}Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
235
|
+
StandardOutput=append:/tmp/polaris-daemon.log
|
|
218
236
|
StandardError=append:/tmp/polaris-daemon.log
|
|
219
237
|
|
|
220
238
|
[Install]
|