@atolis-hq/wake 0.3.15 → 0.3.16
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.
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execa } from 'execa';
|
|
2
2
|
export function runProcess(command, args, cwd, signal, timeoutMs) {
|
|
3
|
-
const child =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, timeoutMs);
|
|
14
|
-
child.stdout.on('data', (chunk) => (stdout += chunk.toString()));
|
|
15
|
-
child.stderr.on('data', (chunk) => (stderr += chunk.toString()));
|
|
16
|
-
child.once('error', (error) => {
|
|
17
|
-
if (timeout !== undefined)
|
|
18
|
-
clearTimeout(timeout);
|
|
19
|
-
reject(error);
|
|
20
|
-
});
|
|
21
|
-
child.once('close', (exitCode) => {
|
|
22
|
-
if (timeout !== undefined)
|
|
23
|
-
clearTimeout(timeout);
|
|
24
|
-
resolve({ stdout, stderr, exitCode, timedOut });
|
|
25
|
-
});
|
|
3
|
+
const child = execa(command, args, {
|
|
4
|
+
...(cwd === undefined ? {} : { cwd }),
|
|
5
|
+
shell: false,
|
|
6
|
+
stdin: 'ignore',
|
|
7
|
+
stdout: 'pipe',
|
|
8
|
+
stderr: 'pipe',
|
|
9
|
+
cancelSignal: signal,
|
|
10
|
+
...(timeoutMs === undefined ? {} : { timeout: timeoutMs }),
|
|
11
|
+
reject: false,
|
|
12
|
+
stripFinalNewline: false,
|
|
26
13
|
});
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
return {
|
|
15
|
+
result: child.then((result) => ({
|
|
16
|
+
stdout: result.stdout,
|
|
17
|
+
stderr: result.stderr,
|
|
18
|
+
exitCode: result.exitCode,
|
|
19
|
+
timedOut: result.timedOut,
|
|
20
|
+
...(result.isMaxBuffer
|
|
21
|
+
? {
|
|
22
|
+
failureKind: 'output-limit',
|
|
23
|
+
...(result.shortMessage === undefined ? {} : { failureMessage: result.shortMessage }),
|
|
24
|
+
}
|
|
25
|
+
: {}),
|
|
26
|
+
})),
|
|
27
|
+
cancel: async () => void child.kill(),
|
|
28
|
+
};
|
|
29
29
|
}
|
|
@@ -99,10 +99,12 @@ export function cliRunner(name, command, args, options = {}) {
|
|
|
99
99
|
output: value.stdout,
|
|
100
100
|
runner: name,
|
|
101
101
|
failure: {
|
|
102
|
-
kind: value.timedOut
|
|
102
|
+
kind: value.timedOut
|
|
103
|
+
? ExecutionCancellationReason.Timeout
|
|
104
|
+
: (value.failureKind ?? 'process-exit'),
|
|
103
105
|
message: value.timedOut
|
|
104
106
|
? `Runner timed out after ${options.timeoutMs}ms`
|
|
105
|
-
: value.stderr || `exit ${value.exitCode}
|
|
107
|
+
: (value.failureMessage ?? (value.stderr || `exit ${value.exitCode}`)),
|
|
106
108
|
},
|
|
107
109
|
}),
|
|
108
110
|
cancel: process.cancel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atolis-hq/wake",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "Local autonomous agent control plane for software development",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@octokit/rest": "^22.0.0",
|
|
69
|
+
"execa": "^10.0.1",
|
|
69
70
|
"handlebars": "^4.7.9",
|
|
70
71
|
"ulid": "^3.0.2",
|
|
71
72
|
"yaml": "^2.9.0",
|