agent-relay-server 0.4.0 → 0.4.2
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/codex/plugin/.codex-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/public/index.html +3 -0
- package/src/daemon.ts +19 -2
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -131,6 +131,9 @@
|
|
|
131
131
|
|
|
132
132
|
<!-- ==================== OVERVIEW ==================== -->
|
|
133
133
|
<div x-show="view === 'overview'" x-cloak class="fade-in">
|
|
134
|
+
<div class="d-md-none mb-3">
|
|
135
|
+
<h2 class="page-title mb-0">Overview</h2>
|
|
136
|
+
</div>
|
|
134
137
|
|
|
135
138
|
<!-- Stats row -->
|
|
136
139
|
<div class="row g-3 mb-4">
|
package/src/daemon.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { constants } from "node:fs";
|
|
3
3
|
import { access, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
|
-
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
import { delimiter, dirname, join, resolve } from "node:path";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
import { DEFAULT_HOST, DEFAULT_PORT, defaultEnvFile, defaultLogDir, type SetupEnvironment } from "./setup";
|
|
8
8
|
|
|
@@ -265,6 +265,7 @@ function renderSystemdUnit(options: {
|
|
|
265
265
|
binaryPath: string;
|
|
266
266
|
}): string {
|
|
267
267
|
const execArgs = daemonProgramArgs(options.binaryPath).map(quoteSystemdArg);
|
|
268
|
+
const pathValue = systemdServicePath();
|
|
268
269
|
return [
|
|
269
270
|
`# ${MANAGED_MARKER}`,
|
|
270
271
|
"[Unit]",
|
|
@@ -273,7 +274,8 @@ function renderSystemdUnit(options: {
|
|
|
273
274
|
"",
|
|
274
275
|
"[Service]",
|
|
275
276
|
"Type=simple",
|
|
276
|
-
`EnvironmentFile=${
|
|
277
|
+
`EnvironmentFile=${options.envFile}`,
|
|
278
|
+
`Environment=PATH=${quoteSystemdArg(pathValue)}`,
|
|
277
279
|
`ExecStart=${execArgs.join(" ")}`,
|
|
278
280
|
"Restart=on-failure",
|
|
279
281
|
"RestartSec=2",
|
|
@@ -365,6 +367,21 @@ function daemonProgramArgs(binaryPath: string): string[] {
|
|
|
365
367
|
: [binaryPath];
|
|
366
368
|
}
|
|
367
369
|
|
|
370
|
+
function systemdServicePath(): string {
|
|
371
|
+
const dirs = [
|
|
372
|
+
dirname(process.execPath),
|
|
373
|
+
join(homedir(), ".bun", "bin"),
|
|
374
|
+
join(homedir(), ".npm-global", "bin"),
|
|
375
|
+
"/usr/local/sbin",
|
|
376
|
+
"/usr/local/bin",
|
|
377
|
+
"/usr/sbin",
|
|
378
|
+
"/usr/bin",
|
|
379
|
+
"/sbin",
|
|
380
|
+
"/bin",
|
|
381
|
+
];
|
|
382
|
+
return [...new Set(dirs)].join(delimiter);
|
|
383
|
+
}
|
|
384
|
+
|
|
368
385
|
function defaultBinaryPath(): string {
|
|
369
386
|
const current = process.argv[1];
|
|
370
387
|
if (!current || current.includes("bunx-")) return "agent-relay";
|