@duyquangnvx/agent-cli 0.11.1 → 0.12.0
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/CHANGELOG.md +6 -0
- package/dist/spawn.d.ts +11 -1
- package/dist/spawn.js +73 -7
- package/dist/spawn.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ What changed in each release of `@duyquangnvx/agent-cli` (the Runtime) and `@duy
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## v0.12.0 (2026-10-23)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `ctx.spawn`'s `stdin` option writes a child's stdin: a string or bytes, or an `AsyncIterable<Uint8Array>` written as the child reads it, so a large input streams without being held in memory. Writing stops on `ctx.signal`; a stream that throws kills the child and fails the run with its error; a child that exits before reading it all is judged by its exit code. A fake `spawn` given to `runCli` receives it as `stdin`.
|
|
12
|
+
|
|
7
13
|
## v0.11.1 (2026-10-22)
|
|
8
14
|
|
|
9
15
|
### Changed
|
package/dist/spawn.d.ts
CHANGED
|
@@ -9,13 +9,17 @@ export interface SpawnResult {
|
|
|
9
9
|
/**
|
|
10
10
|
* Runs a child process to its end; a test replaces it through `runCli`. `onLine`, when given,
|
|
11
11
|
* receives each line of the child's stdout and stderr as it arrives, without its line ending.
|
|
12
|
+
* `stdin`, when given, is what the caller passed; a stream throws the caller's errors as it is read.
|
|
12
13
|
*/
|
|
13
14
|
export type Spawn = (command: string, args: readonly string[], options: ChildOptions) => Promise<SpawnResult>;
|
|
15
|
+
/** What a child reads on stdin: text or bytes whole, or a stream of chunks. */
|
|
16
|
+
export type ChildInput = string | Uint8Array | AsyncIterable<Uint8Array>;
|
|
14
17
|
interface ChildOptions {
|
|
15
18
|
readonly cwd: string;
|
|
16
19
|
readonly env: Env;
|
|
17
20
|
readonly signal: AbortSignal;
|
|
18
21
|
readonly onLine?: (line: string) => void;
|
|
22
|
+
readonly stdin?: ChildInput;
|
|
19
23
|
}
|
|
20
24
|
export interface SpawnOptions {
|
|
21
25
|
/** `ctx.cwd` when absent. */
|
|
@@ -32,13 +36,19 @@ export interface SpawnOptions {
|
|
|
32
36
|
* result still holds the whole output.
|
|
33
37
|
*/
|
|
34
38
|
readonly progress?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Written to the child's stdin, which then ends; ignored when absent. A stream is written as the
|
|
41
|
+
* child reads it and stops on `ctx.signal`; one that throws kills the child and rejects with its
|
|
42
|
+
* error. A child that exits before reading it all is judged by its exit code alone.
|
|
43
|
+
*/
|
|
44
|
+
readonly stdin?: ChildInput;
|
|
35
45
|
}
|
|
36
46
|
export type ContextSpawn = (command: string, args?: readonly string[], options?: SpawnOptions) => Promise<SpawnResult>;
|
|
37
47
|
/**
|
|
38
48
|
* Runs a child process to its end; it is killed on abort, and the promise settles only once it has
|
|
39
49
|
* exited. A `detached` child leaves the terminal's process group on POSIX, and so its Ctrl-C.
|
|
40
50
|
*/
|
|
41
|
-
export declare function spawnChild(command: string, args: readonly string[], { cwd, env, signal, onLine, detached }: ChildOptions & {
|
|
51
|
+
export declare function spawnChild(command: string, args: readonly string[], { cwd, env, signal, onLine, stdin, detached, }: ChildOptions & {
|
|
42
52
|
readonly detached?: boolean;
|
|
43
53
|
}): Promise<SpawnResult>;
|
|
44
54
|
export declare const realSpawn: Spawn;
|
package/dist/spawn.js
CHANGED
|
@@ -13,6 +13,9 @@ const CMD_SHIM = /\.cmd$/i;
|
|
|
13
13
|
const CMD_META = /([()\][%!^"`<>&|;, *?])/g;
|
|
14
14
|
const PATH_SEPARATOR = /[\\/]/;
|
|
15
15
|
const TRAILING_CR = /\r$/;
|
|
16
|
+
function isWhole(input) {
|
|
17
|
+
return typeof input === "string" || input instanceof Uint8Array;
|
|
18
|
+
}
|
|
16
19
|
function escapedForCmd(text) {
|
|
17
20
|
return text.replace(CMD_META, "^$1");
|
|
18
21
|
}
|
|
@@ -76,11 +79,40 @@ function lineSplitter(onLine) {
|
|
|
76
79
|
},
|
|
77
80
|
};
|
|
78
81
|
}
|
|
82
|
+
/** Settles once the child has taken what was written, or its stdin has closed. */
|
|
83
|
+
function drained(stdin) {
|
|
84
|
+
return new Promise((resolve) => {
|
|
85
|
+
const done = () => {
|
|
86
|
+
stdin.off("drain", done);
|
|
87
|
+
stdin.off("close", done);
|
|
88
|
+
resolve();
|
|
89
|
+
};
|
|
90
|
+
stdin.on("drain", done);
|
|
91
|
+
stdin.on("close", done);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Writes `input` to the child's stdin and ends it, stopping once the child is gone or the run
|
|
96
|
+
* aborts.
|
|
97
|
+
*/
|
|
98
|
+
async function feed(stdin, input, signal) {
|
|
99
|
+
// A child that exits before reading it all breaks its stdin (EPIPE, EOF on Windows); its exit code
|
|
100
|
+
// says what went wrong.
|
|
101
|
+
stdin.on("error", () => undefined);
|
|
102
|
+
const chunks = isWhole(input) ? [input] : input;
|
|
103
|
+
for await (const chunk of chunks) {
|
|
104
|
+
if (signal.aborted || stdin.destroyed)
|
|
105
|
+
return;
|
|
106
|
+
if (!stdin.write(chunk))
|
|
107
|
+
await drained(stdin);
|
|
108
|
+
}
|
|
109
|
+
stdin.end();
|
|
110
|
+
}
|
|
79
111
|
/**
|
|
80
112
|
* Runs a child process to its end; it is killed on abort, and the promise settles only once it has
|
|
81
113
|
* exited. A `detached` child leaves the terminal's process group on POSIX, and so its Ctrl-C.
|
|
82
114
|
*/
|
|
83
|
-
export async function spawnChild(command, args, { cwd, env, signal, onLine, detached = false }) {
|
|
115
|
+
export async function spawnChild(command, args, { cwd, env, signal, onLine, stdin, detached = false, }) {
|
|
84
116
|
signal.throwIfAborted();
|
|
85
117
|
const launch = process.platform === "win32"
|
|
86
118
|
? await windowsLaunch(command, args, env)
|
|
@@ -92,18 +124,18 @@ export async function spawnChild(command, args, { cwd, env, signal, onLine, deta
|
|
|
92
124
|
env,
|
|
93
125
|
shell: launch.shell,
|
|
94
126
|
windowsHide: true,
|
|
95
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
127
|
+
stdio: [stdin === undefined ? "ignore" : "pipe", "pipe", "pipe"],
|
|
96
128
|
detached: detached && process.platform !== "win32",
|
|
97
129
|
});
|
|
98
130
|
let stdout = "";
|
|
99
131
|
let stderr = "";
|
|
100
132
|
const stdoutLines = lineSplitter(onLine);
|
|
101
133
|
const stderrLines = lineSplitter(onLine);
|
|
102
|
-
child.stdout
|
|
134
|
+
child.stdout?.setEncoding("utf8").on("data", (chunk) => {
|
|
103
135
|
stdout += chunk;
|
|
104
136
|
stdoutLines.push(chunk);
|
|
105
137
|
});
|
|
106
|
-
child.stderr
|
|
138
|
+
child.stderr?.setEncoding("utf8").on("data", (chunk) => {
|
|
107
139
|
stderr += chunk;
|
|
108
140
|
stderrLines.push(chunk);
|
|
109
141
|
});
|
|
@@ -112,6 +144,14 @@ export async function spawnChild(command, args, { cwd, env, signal, onLine, deta
|
|
|
112
144
|
stopped = stop(child);
|
|
113
145
|
};
|
|
114
146
|
signal.addEventListener("abort", kill, { once: true });
|
|
147
|
+
let inputFailure;
|
|
148
|
+
if (stdin !== undefined && child.stdin !== null) {
|
|
149
|
+
// Ending stdin early would pass a truncated input off as whole, so the child is killed instead.
|
|
150
|
+
feed(child.stdin, stdin, signal).catch((error) => {
|
|
151
|
+
inputFailure = { error };
|
|
152
|
+
kill();
|
|
153
|
+
});
|
|
154
|
+
}
|
|
115
155
|
child.on("error", (error) => {
|
|
116
156
|
signal.removeEventListener("abort", kill);
|
|
117
157
|
reject(error);
|
|
@@ -122,6 +162,11 @@ export async function spawnChild(command, args, { cwd, env, signal, onLine, deta
|
|
|
122
162
|
void stopped.then(() => reject(signal.reason));
|
|
123
163
|
return;
|
|
124
164
|
}
|
|
165
|
+
if (inputFailure !== undefined) {
|
|
166
|
+
const { error } = inputFailure;
|
|
167
|
+
void stopped.then(() => reject(error));
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
125
170
|
stdoutLines.end();
|
|
126
171
|
stderrLines.end();
|
|
127
172
|
resolve({
|
|
@@ -150,9 +195,28 @@ function missingError(command, cause) {
|
|
|
150
195
|
hint: `install ${command}, then run the same command again`,
|
|
151
196
|
}, { cause });
|
|
152
197
|
}
|
|
198
|
+
function startError(command, error, fileError) {
|
|
199
|
+
if (isMissingFile(error))
|
|
200
|
+
return missingError(command, error);
|
|
201
|
+
return fileError(error, { path: command, access: "read" });
|
|
202
|
+
}
|
|
203
|
+
async function* reported(stream, onError) {
|
|
204
|
+
try {
|
|
205
|
+
yield* stream;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
onError(error);
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/** `input`, a stream passing each error it throws to `onError` before the reader sees it. */
|
|
213
|
+
function reporting(input, onError) {
|
|
214
|
+
return input === undefined || isWhole(input) ? input : reported(input, onError);
|
|
215
|
+
}
|
|
153
216
|
/** `ctx.spawn`: `spawn` bound to the run, its start failures classified by errno. */
|
|
154
217
|
export function contextSpawn(run, defaults, fileError) {
|
|
155
218
|
return async (command, args = [], options = {}) => {
|
|
219
|
+
let inputFailure;
|
|
156
220
|
let result;
|
|
157
221
|
try {
|
|
158
222
|
result = await run(command, args, {
|
|
@@ -160,12 +224,14 @@ export function contextSpawn(run, defaults, fileError) {
|
|
|
160
224
|
env: options.env ?? defaults.env,
|
|
161
225
|
signal: defaults.signal,
|
|
162
226
|
onLine: options.progress === true ? defaults.progress : undefined,
|
|
227
|
+
stdin: reporting(options.stdin, (error) => {
|
|
228
|
+
inputFailure = { error };
|
|
229
|
+
}),
|
|
163
230
|
});
|
|
164
231
|
}
|
|
165
232
|
catch (error) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
throw fileError(error, { path: command, access: "read" });
|
|
233
|
+
// The caller's stream failed, not the command: its errno names none of the command's files.
|
|
234
|
+
throw inputFailure?.error === error ? error : startError(command, error, fileError);
|
|
169
235
|
}
|
|
170
236
|
if (options.check === true && result.exitCode !== 0) {
|
|
171
237
|
throw failedError(command, result);
|
package/dist/spawn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../src/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../src/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,sEAAsE;AACtE,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,MAAM,WAAW,GAAG,KAAK,CAAC;AAsB1B,SAAS,OAAO,CAAC,KAAiB;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,UAAU,CAAC;AAClE,CAAC;AA6CD,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,C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