omp-conductor 0.15.0 → 0.15.1
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/setup-host.ts +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omp-conductor",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A 24/7 dispatcher that takes ready GitHub issues to green, mergeable PRs using omp coding sessions, with tiered escalation first to an orchestrator session and then to a human.",
|
package/src/setup-host.ts
CHANGED
|
@@ -72,6 +72,21 @@ function systemdQuote(value: string): string {
|
|
|
72
72
|
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replaceAll("%", "%%")}"`;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* A bare path for the settings that take exactly one, never a quoted word list.
|
|
77
|
+
*
|
|
78
|
+
* `Environment=` and `ExecStart=` unquote their values, so {@link systemdQuote}
|
|
79
|
+
* is right there. `WorkingDirectory=` does not: systemd reads the whole value as
|
|
80
|
+
* the path, so a quoted one fails `systemd-analyze verify` with "path is not
|
|
81
|
+
* absolute" and the unit refuses to start — a landmine that only fires on the
|
|
82
|
+
* next restart, because the running daemon keeps the unit it started with.
|
|
83
|
+
* Spaces need no quoting here; `%` still does, or it reads as a specifier.
|
|
84
|
+
*/
|
|
85
|
+
function systemdPath(value: string): string {
|
|
86
|
+
if (/\r|\n/.test(value)) throw new Error("systemd values cannot contain newlines");
|
|
87
|
+
return value.replaceAll("%", "%%");
|
|
88
|
+
}
|
|
89
|
+
|
|
75
90
|
function shellQuote(value: string): string {
|
|
76
91
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
77
92
|
}
|
|
@@ -268,7 +283,7 @@ export function renderDaemonService(runtime: ServiceRuntime, totalWorkers: numbe
|
|
|
268
283
|
`Environment=${systemdQuote(`PATH=${runtime.path}`)}`,
|
|
269
284
|
`Environment=${systemdQuote(`OMP_CONDUCTOR_HOME=${runtime.conductorHome}`)}`,
|
|
270
285
|
`Environment=${systemdQuote(`OMP_TELEGRAM_STATE_DIR=${runtime.telegramStateDir}`)}`,
|
|
271
|
-
`WorkingDirectory=${
|
|
286
|
+
`WorkingDirectory=${systemdPath(stateDir())}`,
|
|
272
287
|
`ExecStart=${command.map(systemdQuote).join(" ")}`,
|
|
273
288
|
"Restart=on-failure",
|
|
274
289
|
"SuccessExitStatus=0 143",
|