@gobing-ai/ts-runtime 0.4.15 → 0.4.17
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.
|
@@ -51,6 +51,16 @@ export interface ProcessOptions {
|
|
|
51
51
|
* {@link ProcessResult} remains authoritative.
|
|
52
52
|
*/
|
|
53
53
|
onOutput?: (output: ProcessOutputChunk) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Optional observer invoked once with the OS pid as soon as the child is
|
|
56
|
+
* spawned, for callers that need to identify the subprocess while it is
|
|
57
|
+
* still running (progress lines, `kill` targets, `ps` correlation).
|
|
58
|
+
*
|
|
59
|
+
* The buffered {@link ProcessResult} cannot carry this: execa@9 resolves
|
|
60
|
+
* only after exit, by which point the pid is historical. Failures are
|
|
61
|
+
* isolated — observation cannot change process semantics.
|
|
62
|
+
*/
|
|
63
|
+
onSpawn?: (pid: number) => void;
|
|
54
64
|
/**
|
|
55
65
|
* Registry metadata (spur#0264). Defaults: source `'one-shot'` for `run`.
|
|
56
66
|
* Pass `source: 'supervisor'` (and optional teamId/agentId) when the spawn is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-executor.d.ts","sourceRoot":"","sources":["../src/process-executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,uGAAuG;AACvG,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtF,sGAAsG;AACtG,MAAM,WAAW,qBAAqB;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,YAAY,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AAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW;CAWlD"}
|
package/dist/process-executor.js
CHANGED
|
@@ -53,11 +53,24 @@ export class NodeProcessExecutor {
|
|
|
53
53
|
});
|
|
54
54
|
try {
|
|
55
55
|
const subprocess = execa(options.command, args, execaOptions);
|
|
56
|
+
// execa@9's resolved Result carries no pid, but the live handle does.
|
|
57
|
+
// Publish it while the child is running so observers can identify the
|
|
58
|
+
// subprocess, and record it against the registry entry opened above.
|
|
59
|
+
if (subprocess.pid !== undefined) {
|
|
60
|
+
this.config.registry?.update(registryId, { pid: subprocess.pid });
|
|
61
|
+
if (options.onSpawn !== undefined) {
|
|
62
|
+
try {
|
|
63
|
+
options.onSpawn(subprocess.pid);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Spawn observation cannot change process semantics.
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
56
70
|
const stopGroupCancellation = observeProcessGroupCancellation(subprocess, options.signal);
|
|
57
71
|
observeOutput(subprocess.stdout, 'stdout', options.onOutput);
|
|
58
72
|
observeOutput(subprocess.stderr, 'stderr', options.onOutput);
|
|
59
73
|
const result = await subprocess.finally(stopGroupCancellation);
|
|
60
|
-
// execa@9 Result does not expose pid — buffered runs leave pid unset.
|
|
61
74
|
const processResult = {
|
|
62
75
|
command: options.command,
|
|
63
76
|
args,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobing-ai/ts-runtime",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"description": "@gobing-ai/ts-runtime — Runtime abstractions for Bun, Node, and Cloudflare Workers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-runtime-v<version> && git push --tags' && exit 1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@gobing-ai/ts-utils": "^0.4.
|
|
61
|
+
"@gobing-ai/ts-utils": "^0.4.17",
|
|
62
62
|
"execa": "^9.5.0",
|
|
63
63
|
"yaml": "^2.7.0",
|
|
64
64
|
"zod": "^4.1.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@gobing-ai/ts-db": "^0.4.
|
|
67
|
+
"@gobing-ai/ts-db": "^0.4.17",
|
|
68
68
|
"@types/bun": "1.3.14"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@gobing-ai/ts-db": "^0.4.
|
|
71
|
+
"@gobing-ai/ts-db": "^0.4.17"
|
|
72
72
|
},
|
|
73
73
|
"peerDependenciesMeta": {
|
|
74
74
|
"@gobing-ai/ts-db": {
|
package/src/process-executor.ts
CHANGED
|
@@ -53,6 +53,16 @@ export interface ProcessOptions {
|
|
|
53
53
|
* {@link ProcessResult} remains authoritative.
|
|
54
54
|
*/
|
|
55
55
|
onOutput?: (output: ProcessOutputChunk) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Optional observer invoked once with the OS pid as soon as the child is
|
|
58
|
+
* spawned, for callers that need to identify the subprocess while it is
|
|
59
|
+
* still running (progress lines, `kill` targets, `ps` correlation).
|
|
60
|
+
*
|
|
61
|
+
* The buffered {@link ProcessResult} cannot carry this: execa@9 resolves
|
|
62
|
+
* only after exit, by which point the pid is historical. Failures are
|
|
63
|
+
* isolated — observation cannot change process semantics.
|
|
64
|
+
*/
|
|
65
|
+
onSpawn?: (pid: number) => void;
|
|
56
66
|
/**
|
|
57
67
|
* Registry metadata (spur#0264). Defaults: source `'one-shot'` for `run`.
|
|
58
68
|
* Pass `source: 'supervisor'` (and optional teamId/agentId) when the spawn is
|
|
@@ -231,11 +241,23 @@ export class NodeProcessExecutor implements ProcessExecutor {
|
|
|
231
241
|
|
|
232
242
|
try {
|
|
233
243
|
const subprocess = execa(options.command, args, execaOptions);
|
|
244
|
+
// execa@9's resolved Result carries no pid, but the live handle does.
|
|
245
|
+
// Publish it while the child is running so observers can identify the
|
|
246
|
+
// subprocess, and record it against the registry entry opened above.
|
|
247
|
+
if (subprocess.pid !== undefined) {
|
|
248
|
+
this.config.registry?.update(registryId, { pid: subprocess.pid });
|
|
249
|
+
if (options.onSpawn !== undefined) {
|
|
250
|
+
try {
|
|
251
|
+
options.onSpawn(subprocess.pid);
|
|
252
|
+
} catch {
|
|
253
|
+
// Spawn observation cannot change process semantics.
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
234
257
|
const stopGroupCancellation = observeProcessGroupCancellation(subprocess, options.signal);
|
|
235
258
|
observeOutput(subprocess.stdout, 'stdout', options.onOutput);
|
|
236
259
|
observeOutput(subprocess.stderr, 'stderr', options.onOutput);
|
|
237
260
|
const result = await subprocess.finally(stopGroupCancellation);
|
|
238
|
-
// execa@9 Result does not expose pid — buffered runs leave pid unset.
|
|
239
261
|
const processResult = {
|
|
240
262
|
command: options.command,
|
|
241
263
|
args,
|