@0xmaxma/claude-gateway 1.8.4 → 1.8.6
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 +11 -2
- package/config.template.json +5 -3
- package/dist/agent/model-catalog.d.ts.map +1 -1
- package/dist/agent/model-catalog.js +5 -13
- package/dist/agent/model-catalog.js.map +1 -1
- package/dist/agent/runner.d.ts +1 -1
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +22 -3
- package/dist/agent/runner.js.map +1 -1
- package/dist/api/apps-router.d.ts.map +1 -1
- package/dist/api/apps-router.js +31 -9
- package/dist/api/apps-router.js.map +1 -1
- package/dist/api/gateway-router.js +1 -1
- package/dist/api/gateway-router.js.map +1 -1
- package/dist/api/packages.d.ts.map +1 -1
- package/dist/api/packages.js +17 -1
- package/dist/api/packages.js.map +1 -1
- package/dist/api/share-router.d.ts +8 -0
- package/dist/api/share-router.d.ts.map +1 -1
- package/dist/api/share-router.js +100 -10
- package/dist/api/share-router.js.map +1 -1
- package/dist/apps/agent-manager.d.ts +35 -2
- package/dist/apps/agent-manager.d.ts.map +1 -1
- package/dist/apps/agent-manager.js +131 -15
- package/dist/apps/agent-manager.js.map +1 -1
- package/dist/apps/installer.d.ts +49 -1
- package/dist/apps/installer.d.ts.map +1 -1
- package/dist/apps/installer.js +74 -17
- package/dist/apps/installer.js.map +1 -1
- package/dist/cli/args.d.ts +6 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/logs.d.ts.map +1 -1
- package/dist/cli/commands/logs.js +91 -18
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/commands/service.d.ts.map +1 -1
- package/dist/cli/commands/service.js +61 -7
- package/dist/cli/commands/service.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +34 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +56 -10
- package/dist/cli/output.js.map +1 -1
- package/dist/config/claude-settings.d.ts +41 -0
- package/dist/config/claude-settings.d.ts.map +1 -0
- package/dist/config/claude-settings.js +102 -0
- package/dist/config/claude-settings.js.map +1 -0
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/session/process.d.ts +43 -1
- package/dist/session/process.d.ts.map +1 -1
- package/dist/session/process.js +154 -9
- package/dist/session/process.js.map +1 -1
- package/dist/share/share-store.d.ts +45 -4
- package/dist/share/share-store.d.ts.map +1 -1
- package/dist/share/share-store.js +127 -23
- package/dist/share/share-store.js.map +1 -1
- package/dist/shutdown-signals.d.ts +18 -0
- package/dist/shutdown-signals.d.ts.map +1 -1
- package/dist/shutdown-signals.js +33 -2
- package/dist/shutdown-signals.js.map +1 -1
- package/mcp/server.ts +2 -2
- package/mcp/tools/image/module.ts +10 -3
- package/mcp/tools/share-file/module.ts +169 -0
- package/mcp/tools/shared/share-client.ts +8 -4
- package/mcp/tools/telegram/receiver-server.ts +12 -2
- package/package.json +1 -1
- package/mcp/tools/share-image/module.ts +0 -120
package/dist/apps/installer.d.ts
CHANGED
|
@@ -442,14 +442,38 @@ export declare class AppInstaller {
|
|
|
442
442
|
* is recorded ({@link getRestoreFailure}) so it is visible through the apps API
|
|
443
443
|
* rather than only in the log, and so reconcileStatus() keeps the app eligible
|
|
444
444
|
* for the next boot's restore instead of latching it off (issue #425).
|
|
445
|
+
*
|
|
446
|
+
* @param pending the batch from a prior {@link markRestorePending} call. Boot
|
|
447
|
+
* passes one so the marking is already done before the HTTP server starts
|
|
448
|
+
* listening; omitting it marks the batch here, which is correct for any
|
|
449
|
+
* caller that is not racing live status reads.
|
|
445
450
|
*/
|
|
446
|
-
restoreRunningApps(): Promise<{
|
|
451
|
+
restoreRunningApps(pending?: AppEntry[]): Promise<{
|
|
447
452
|
attempted: number;
|
|
448
453
|
failures: Array<{
|
|
449
454
|
app: string;
|
|
450
455
|
error: string;
|
|
451
456
|
}>;
|
|
452
457
|
}>;
|
|
458
|
+
/**
|
|
459
|
+
* Phase 1 of the boot restore: read the registry and mark every app stored as
|
|
460
|
+
* `running` in flight, returning that batch for {@link restoreRunningApps}.
|
|
461
|
+
*
|
|
462
|
+
* Exists because the marking is what makes the suppression in {@link
|
|
463
|
+
* queryRuntimeStatus} apply, and it cannot be done synchronously — the
|
|
464
|
+
* registry read is async. Doing it inside restoreRunningApps() left a window
|
|
465
|
+
* between the HTTP server accepting requests and the marks landing: a
|
|
466
|
+
* `GET /api/v1/apps` in that window queries Docker, finds no containers (the
|
|
467
|
+
* host reboot took them down), and persists `running` → `stopped`. If that
|
|
468
|
+
* write lands before the registry read here, the app is filtered out of the
|
|
469
|
+
* batch and never restored at all — the #425 latch-off, reached through the
|
|
470
|
+
* very code that exists to prevent it. Boot therefore awaits this BEFORE
|
|
471
|
+
* `router.start()`, then fires the restore itself in the background.
|
|
472
|
+
*
|
|
473
|
+
* Callers that are not racing live reads can skip it: restoreRunningApps()
|
|
474
|
+
* calls this itself when no batch is supplied.
|
|
475
|
+
*/
|
|
476
|
+
markRestorePending(): Promise<AppEntry[]>;
|
|
453
477
|
/**
|
|
454
478
|
* Why this boot's restore of `appName` failed, or `undefined` when the last
|
|
455
479
|
* restore succeeded (or never ran). Lets `GET /api/v1/apps` tell an app the
|
|
@@ -457,6 +481,22 @@ export declare class AppInstaller {
|
|
|
457
481
|
* previously the difference existed only in the boot log.
|
|
458
482
|
*/
|
|
459
483
|
getRestoreFailure(appName: string): RestoreFailure | undefined;
|
|
484
|
+
/**
|
|
485
|
+
* Whether this process's boot restore is currently bringing `appName` up.
|
|
486
|
+
*
|
|
487
|
+
* Reads {@link restoringNames} — the same set {@link queryRuntimeStatus}
|
|
488
|
+
* consults at :1439 — rather than tracking a second copy, so the flag cannot
|
|
489
|
+
* disagree with the suppression it describes. That suppression is why the
|
|
490
|
+
* accessor is needed at all: while a restore holds an app, its stored status
|
|
491
|
+
* is returned unreconciled, and the set restored is exactly the apps stored
|
|
492
|
+
* as `running` ({@link restoreRunningApps}), so a rebuild that takes minutes
|
|
493
|
+
* on a cold host reports a flat `running` with no containers behind it. The
|
|
494
|
+
* apps API pairs this with that status so a client can tell rebuilding from
|
|
495
|
+
* serving (issue #446); the failed case is {@link getRestoreFailure}.
|
|
496
|
+
*
|
|
497
|
+
* In-memory and process-local: never persisted to `apps.json`.
|
|
498
|
+
*/
|
|
499
|
+
isRestoring(appName: string): boolean;
|
|
460
500
|
private runInstall;
|
|
461
501
|
private runUpdate;
|
|
462
502
|
/**
|
|
@@ -598,6 +638,14 @@ export declare class AppInstaller {
|
|
|
598
638
|
* Stop conflicting containers then run `docker compose up -d --wait`.
|
|
599
639
|
* Captures container logs into the job on failure before rethrowing.
|
|
600
640
|
* job is optional — when omitted (e.g. startStopRestart) logs go to stderr.
|
|
641
|
+
*
|
|
642
|
+
* Uses the async spawn seam for the `up` itself (which can legitimately run
|
|
643
|
+
* for minutes waiting on a healthcheck), so this never freezes the gateway
|
|
644
|
+
* event loop while a container starts — every caller (install/update/
|
|
645
|
+
* reconfigure/backup/restore/startStopRestart) is on the request-serving
|
|
646
|
+
* path. `stopConflictingContainers` stays on the sync seam: it is a handful
|
|
647
|
+
* of short, bounded `docker ps`/`stop`/`rm` calls, not the long-running step
|
|
648
|
+
* this fix targets.
|
|
601
649
|
*/
|
|
602
650
|
private composeUp;
|
|
603
651
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/apps/installer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kCAAkC,EAAoB,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAa,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAIL,WAAW,EACX,aAAa,EACb,YAAY,EAEZ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AAQ,CAAC,QAAQ,CAAC,CAsBpB"}
|
package/dist/apps/installer.js
CHANGED
|
@@ -709,7 +709,7 @@ class AppInstaller {
|
|
|
709
709
|
if (wasRunning) {
|
|
710
710
|
try {
|
|
711
711
|
log(`Restarting "${appName}"`);
|
|
712
|
-
this.composeUp(appName, appDir);
|
|
712
|
+
await this.composeUp(appName, appDir);
|
|
713
713
|
}
|
|
714
714
|
catch (restartErr) {
|
|
715
715
|
log(`WARNING: failed to restart "${appName}" after backup: ${restartErr instanceof Error ? restartErr.message : String(restartErr)}`);
|
|
@@ -797,7 +797,7 @@ class AppInstaller {
|
|
|
797
797
|
// same credentials the volume data was created under.
|
|
798
798
|
this.copyIfExists(path.join(staging, 'config', '.env'), path.join(appDir, '.env'));
|
|
799
799
|
log(`Starting "${appName}" on restored data`);
|
|
800
|
-
this.composeUp(appName, appDir);
|
|
800
|
+
await this.composeUp(appName, appDir);
|
|
801
801
|
await this.registry.updateStatus(appName, 'running').catch(() => { });
|
|
802
802
|
log(`Restore of "${backupId}" complete`);
|
|
803
803
|
return {
|
|
@@ -1078,7 +1078,7 @@ class AppInstaller {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
else {
|
|
1080
1080
|
// start / restart: stop conflicting containers and wait for healthcheck
|
|
1081
|
-
this.composeUp(appName, entry.installPath);
|
|
1081
|
+
await this.composeUp(appName, entry.installPath);
|
|
1082
1082
|
await this.registry.updateStatus(appName, 'running');
|
|
1083
1083
|
}
|
|
1084
1084
|
// An explicit operator action supersedes this boot's restore attempt: a
|
|
@@ -1202,10 +1202,14 @@ class AppInstaller {
|
|
|
1202
1202
|
* is recorded ({@link getRestoreFailure}) so it is visible through the apps API
|
|
1203
1203
|
* rather than only in the log, and so reconcileStatus() keeps the app eligible
|
|
1204
1204
|
* for the next boot's restore instead of latching it off (issue #425).
|
|
1205
|
+
*
|
|
1206
|
+
* @param pending the batch from a prior {@link markRestorePending} call. Boot
|
|
1207
|
+
* passes one so the marking is already done before the HTTP server starts
|
|
1208
|
+
* listening; omitting it marks the batch here, which is correct for any
|
|
1209
|
+
* caller that is not racing live status reads.
|
|
1205
1210
|
*/
|
|
1206
|
-
async restoreRunningApps() {
|
|
1207
|
-
const
|
|
1208
|
-
const running = apps.filter((e) => e.status === 'running');
|
|
1211
|
+
async restoreRunningApps(pending) {
|
|
1212
|
+
const running = pending ?? (await this.markRestorePending());
|
|
1209
1213
|
const failures = [];
|
|
1210
1214
|
// Mark the WHOLE batch in flight before any worker starts, not per worker.
|
|
1211
1215
|
// The pool runs at most RESTORE_MAX_CONCURRENCY at a time, so marking inside
|
|
@@ -1215,6 +1219,8 @@ class AppInstaller {
|
|
|
1215
1219
|
// no-latch guard in reconcileStatus() no longer applies (it requires the
|
|
1216
1220
|
// stored status to still be `running`), so a later failure would latch the
|
|
1217
1221
|
// app off for good — the exact outcome this path exists to prevent (#425).
|
|
1222
|
+
// Re-marking a `pending` batch is a no-op (Set.add is idempotent) and keeps
|
|
1223
|
+
// the invariant owned here rather than by the caller.
|
|
1218
1224
|
for (const entry of running)
|
|
1219
1225
|
this.restoringNames.add(entry.name);
|
|
1220
1226
|
// Bounded-concurrency worker pool: workers pull from a shared cursor until
|
|
@@ -1252,6 +1258,31 @@ class AppInstaller {
|
|
|
1252
1258
|
}
|
|
1253
1259
|
return { attempted: running.length, failures };
|
|
1254
1260
|
}
|
|
1261
|
+
/**
|
|
1262
|
+
* Phase 1 of the boot restore: read the registry and mark every app stored as
|
|
1263
|
+
* `running` in flight, returning that batch for {@link restoreRunningApps}.
|
|
1264
|
+
*
|
|
1265
|
+
* Exists because the marking is what makes the suppression in {@link
|
|
1266
|
+
* queryRuntimeStatus} apply, and it cannot be done synchronously — the
|
|
1267
|
+
* registry read is async. Doing it inside restoreRunningApps() left a window
|
|
1268
|
+
* between the HTTP server accepting requests and the marks landing: a
|
|
1269
|
+
* `GET /api/v1/apps` in that window queries Docker, finds no containers (the
|
|
1270
|
+
* host reboot took them down), and persists `running` → `stopped`. If that
|
|
1271
|
+
* write lands before the registry read here, the app is filtered out of the
|
|
1272
|
+
* batch and never restored at all — the #425 latch-off, reached through the
|
|
1273
|
+
* very code that exists to prevent it. Boot therefore awaits this BEFORE
|
|
1274
|
+
* `router.start()`, then fires the restore itself in the background.
|
|
1275
|
+
*
|
|
1276
|
+
* Callers that are not racing live reads can skip it: restoreRunningApps()
|
|
1277
|
+
* calls this itself when no batch is supplied.
|
|
1278
|
+
*/
|
|
1279
|
+
async markRestorePending() {
|
|
1280
|
+
const apps = await this.registry.list();
|
|
1281
|
+
const running = apps.filter((e) => e.status === 'running');
|
|
1282
|
+
for (const entry of running)
|
|
1283
|
+
this.restoringNames.add(entry.name);
|
|
1284
|
+
return running;
|
|
1285
|
+
}
|
|
1255
1286
|
/**
|
|
1256
1287
|
* Why this boot's restore of `appName` failed, or `undefined` when the last
|
|
1257
1288
|
* restore succeeded (or never ran). Lets `GET /api/v1/apps` tell an app the
|
|
@@ -1261,6 +1292,24 @@ class AppInstaller {
|
|
|
1261
1292
|
getRestoreFailure(appName) {
|
|
1262
1293
|
return this.restoreFailures.get(appName);
|
|
1263
1294
|
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Whether this process's boot restore is currently bringing `appName` up.
|
|
1297
|
+
*
|
|
1298
|
+
* Reads {@link restoringNames} — the same set {@link queryRuntimeStatus}
|
|
1299
|
+
* consults at :1439 — rather than tracking a second copy, so the flag cannot
|
|
1300
|
+
* disagree with the suppression it describes. That suppression is why the
|
|
1301
|
+
* accessor is needed at all: while a restore holds an app, its stored status
|
|
1302
|
+
* is returned unreconciled, and the set restored is exactly the apps stored
|
|
1303
|
+
* as `running` ({@link restoreRunningApps}), so a rebuild that takes minutes
|
|
1304
|
+
* on a cold host reports a flat `running` with no containers behind it. The
|
|
1305
|
+
* apps API pairs this with that status so a client can tell rebuilding from
|
|
1306
|
+
* serving (issue #446); the failed case is {@link getRestoreFailure}.
|
|
1307
|
+
*
|
|
1308
|
+
* In-memory and process-local: never persisted to `apps.json`.
|
|
1309
|
+
*/
|
|
1310
|
+
isRestoring(appName) {
|
|
1311
|
+
return this.restoringNames.has(appName);
|
|
1312
|
+
}
|
|
1264
1313
|
// ─── Internal install pipeline ────────────────────────────────────────────
|
|
1265
1314
|
async runInstall(job, options) {
|
|
1266
1315
|
job.status = 'running';
|
|
@@ -1498,7 +1547,7 @@ class AppInstaller {
|
|
|
1498
1547
|
// Pre-pull the agent base image so compose up --wait doesn't time out during pull
|
|
1499
1548
|
this.log(job, 'Pre-pulling agent base image');
|
|
1500
1549
|
try {
|
|
1501
|
-
this.
|
|
1550
|
+
await this.runAsync(['docker', 'pull', 'debian:stable-slim'], appDir, 300000);
|
|
1502
1551
|
}
|
|
1503
1552
|
catch {
|
|
1504
1553
|
// non-fatal — compose up will attempt its own pull
|
|
@@ -1517,10 +1566,10 @@ class AppInstaller {
|
|
|
1517
1566
|
try {
|
|
1518
1567
|
// ── docker compose build ──────────────────────────────────────────────
|
|
1519
1568
|
this.log(job, 'Building images');
|
|
1520
|
-
this.
|
|
1569
|
+
await this.runAsync(['docker', 'compose', '-p', appName, 'build'], appDir, 600000);
|
|
1521
1570
|
// ── docker compose up -d ──────────────────────────────────────────────
|
|
1522
1571
|
this.log(job, 'Starting containers');
|
|
1523
|
-
this.composeUp(appName, appDir, job);
|
|
1572
|
+
await this.composeUp(appName, appDir, job);
|
|
1524
1573
|
}
|
|
1525
1574
|
catch (err) {
|
|
1526
1575
|
this.log(job, 'Build/start failed — rolling back');
|
|
@@ -1677,7 +1726,7 @@ class AppInstaller {
|
|
|
1677
1726
|
preservedImages = this.preserveRunningImages(appName, entry.installPath, job);
|
|
1678
1727
|
// ── Build new images in tmp dir ───────────────────────────────────────
|
|
1679
1728
|
this.log(job, 'Building new images');
|
|
1680
|
-
this.
|
|
1729
|
+
await this.runAsync(['docker', 'compose', '-p', appName, 'build'], tmpDir, 600000);
|
|
1681
1730
|
// ── Backup MEMORY.md before any disruption ────────────────────────────
|
|
1682
1731
|
let memoryBackup = null;
|
|
1683
1732
|
if (entry.agentDeclaration && this.agentManager) {
|
|
@@ -1730,7 +1779,7 @@ class AppInstaller {
|
|
|
1730
1779
|
// ── Start new containers ────────────────────────────────────────────
|
|
1731
1780
|
this.log(job, 'Starting new containers');
|
|
1732
1781
|
reachedContainerStart = true;
|
|
1733
|
-
this.composeUp(appName, finalDir, job);
|
|
1782
|
+
await this.composeUp(appName, finalDir, job);
|
|
1734
1783
|
}
|
|
1735
1784
|
catch (upErr) {
|
|
1736
1785
|
// The catch spans the whole swap, so a failure here is not necessarily a
|
|
@@ -1778,7 +1827,7 @@ class AppInstaller {
|
|
|
1778
1827
|
const upArgs = ['docker', 'compose', '-p', appName, 'up', '-d'];
|
|
1779
1828
|
if (rebuild)
|
|
1780
1829
|
upArgs.push('--build');
|
|
1781
|
-
this.
|
|
1830
|
+
await this.runAsync(upArgs, finalDir, rebuild ? 600000 : 120000);
|
|
1782
1831
|
this.callbacks.registerRoutes(appName, entry.ports.map((p) => ({
|
|
1783
1832
|
name: p.name,
|
|
1784
1833
|
service: p.service,
|
|
@@ -2026,7 +2075,7 @@ class AppInstaller {
|
|
|
2026
2075
|
// compose does not detect an env_file content change on its own. This is an
|
|
2027
2076
|
// `up`, not a `down -v`, so named volumes (and their data) survive.
|
|
2028
2077
|
this.log(job, 'Recreating container');
|
|
2029
|
-
this.composeUp(appName, appDir, job, { forceRecreate: true });
|
|
2078
|
+
await this.composeUp(appName, appDir, job, { forceRecreate: true });
|
|
2030
2079
|
await this.registry.updateStatus(appName, 'running');
|
|
2031
2080
|
// Persist the reconfigure: always bump updatedAt so the registry reflects
|
|
2032
2081
|
// that the app was reconfigured; refresh the port mappings + re-register
|
|
@@ -2064,7 +2113,7 @@ class AppInstaller {
|
|
|
2064
2113
|
if (hasPortChange && oldComposeContent !== null) {
|
|
2065
2114
|
fs.writeFileSync(composePath, oldComposeContent);
|
|
2066
2115
|
}
|
|
2067
|
-
this.composeUp(appName, appDir, job, { forceRecreate: true });
|
|
2116
|
+
await this.composeUp(appName, appDir, job, { forceRecreate: true });
|
|
2068
2117
|
if (hasPortChange) {
|
|
2069
2118
|
this.callbacks.registerRoutes(appName, oldPorts.map((p) => ({
|
|
2070
2119
|
name: p.name,
|
|
@@ -2588,20 +2637,28 @@ class AppInstaller {
|
|
|
2588
2637
|
* Stop conflicting containers then run `docker compose up -d --wait`.
|
|
2589
2638
|
* Captures container logs into the job on failure before rethrowing.
|
|
2590
2639
|
* job is optional — when omitted (e.g. startStopRestart) logs go to stderr.
|
|
2640
|
+
*
|
|
2641
|
+
* Uses the async spawn seam for the `up` itself (which can legitimately run
|
|
2642
|
+
* for minutes waiting on a healthcheck), so this never freezes the gateway
|
|
2643
|
+
* event loop while a container starts — every caller (install/update/
|
|
2644
|
+
* reconfigure/backup/restore/startStopRestart) is on the request-serving
|
|
2645
|
+
* path. `stopConflictingContainers` stays on the sync seam: it is a handful
|
|
2646
|
+
* of short, bounded `docker ps`/`stop`/`rm` calls, not the long-running step
|
|
2647
|
+
* this fix targets.
|
|
2591
2648
|
*/
|
|
2592
|
-
composeUp(appName, dir, job, opts) {
|
|
2649
|
+
async composeUp(appName, dir, job, opts) {
|
|
2593
2650
|
this.stopConflictingContainers(appName);
|
|
2594
2651
|
const args = ['docker', 'compose', '-p', appName, 'up', '-d', '--wait'];
|
|
2595
2652
|
if (opts?.forceRecreate) {
|
|
2596
2653
|
args.push('--force-recreate');
|
|
2597
2654
|
}
|
|
2598
2655
|
try {
|
|
2599
|
-
this.
|
|
2656
|
+
await this.runAsync(args, dir, 600000);
|
|
2600
2657
|
}
|
|
2601
2658
|
catch (upErr) {
|
|
2602
2659
|
if (job) {
|
|
2603
2660
|
try {
|
|
2604
|
-
const { stdout } = this.
|
|
2661
|
+
const { stdout } = await this.runAsync(['docker', 'compose', '-p', appName, 'logs', '--no-color', '--tail=50'], dir, 10000);
|
|
2605
2662
|
if (stdout.trim()) {
|
|
2606
2663
|
for (const line of stdout.trim().split('\n')) {
|
|
2607
2664
|
this.log(job, ` ${line}`);
|