@brutalsystems/muster 3.0.2 → 3.1.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/README.md +4 -0
- package/dist/cli-options.js +60 -0
- package/dist/duration.js +17 -0
- package/dist/format.js +3 -0
- package/dist/help.js +25 -0
- package/dist/identity/claude.js +61 -18
- package/dist/identity/processes.js +6 -3
- package/dist/identity-copy.js +30 -3
- package/dist/muster.js +94 -47
- package/dist/on-exit.js +98 -0
- package/dist/registry.js +81 -1
- package/dist/run.js +414 -68
- package/dist/task-worker.js +7 -2
- package/package.json +1 -1
package/dist/task-worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// A per-task owner captures output and the exit result; no pools, retries or daemon.
|
|
2
|
-
import { readFile, writeFile, rm, open } from "node:fs/promises";
|
|
2
|
+
import { readFile, writeFile, rm, open, rename } from "node:fs/promises";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { delay, finishOwnedGroup, processRef, stopTree, } from "./identity/processes.js";
|
|
5
5
|
import { LaunchLog } from "./log.js";
|
|
@@ -45,9 +45,14 @@ async function finish(code, signal, error) {
|
|
|
45
45
|
}
|
|
46
46
|
finally {
|
|
47
47
|
try {
|
|
48
|
-
|
|
48
|
+
// Published by rename: `wait` treats this file as the task's end, and a
|
|
49
|
+
// reader that found it created but not yet written would report a
|
|
50
|
+
// finished task with no exit status.
|
|
51
|
+
const tmp = `${spec.exitPath}.tmp`;
|
|
52
|
+
await writeFile(tmp, JSON.stringify({ code, signal, error }), {
|
|
49
53
|
mode: 0o600,
|
|
50
54
|
});
|
|
55
|
+
await rename(tmp, spec.exitPath);
|
|
51
56
|
}
|
|
52
57
|
finally {
|
|
53
58
|
await finishOwnedGroup(code ?? 1);
|