@lifeaitools/clauth 1.30.3 → 1.30.4
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/cli/commands/agent-pool.js +22 -6
- package/cli/commands/serve.js +1070 -144
- package/cli/enrollment-script.js +62 -0
- package/cli/index.js +4 -43
- package/package.json +1 -1
- package/scripts/bin/bootstrap-linux +0 -0
- package/scripts/bin/bootstrap-macos +0 -0
- package/scripts/bin/bootstrap-win.exe +0 -0
- package/cli/commands/serve/tools/fs.js +0 -1055
|
@@ -894,10 +894,12 @@ export class AgentPool {
|
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
-
buildArgs({
|
|
897
|
+
buildArgs({ model, appendSystemPrompt }) {
|
|
898
898
|
return [
|
|
899
|
+
// Prompt is fed via the child's stdin (claude -p reads stdin), NOT as an
|
|
900
|
+
// argv positional — a large prompt as argv overflows the OS command-line
|
|
901
|
+
// length limit (spawn ENAMETOOLONG on content-heavy call_agent jobs).
|
|
899
902
|
"-p",
|
|
900
|
-
prompt,
|
|
901
903
|
"--model",
|
|
902
904
|
model || this.defaultModel,
|
|
903
905
|
"--dangerously-skip-permissions",
|
|
@@ -1467,7 +1469,7 @@ export class AgentPool {
|
|
|
1467
1469
|
proc = this._spawn(command, spawnArgs, {
|
|
1468
1470
|
cwd,
|
|
1469
1471
|
env: process.env, // inherits CLI login session; no ANTHROPIC_API_KEY injected
|
|
1470
|
-
stdio: ["
|
|
1472
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
1471
1473
|
shell: false,
|
|
1472
1474
|
windowsHide: true,
|
|
1473
1475
|
});
|
|
@@ -1481,6 +1483,13 @@ export class AgentPool {
|
|
|
1481
1483
|
|
|
1482
1484
|
job._proc = proc;
|
|
1483
1485
|
job.pid = proc.pid;
|
|
1486
|
+
// Feed the prompt over stdin (buildArgs no longer puts it in argv) so a large
|
|
1487
|
+
// prompt cannot overflow the OS command-line limit. Tolerate a stdin race:
|
|
1488
|
+
// the proc error/close handlers below settle the job if the pipe breaks.
|
|
1489
|
+
if (proc.stdin) {
|
|
1490
|
+
proc.stdin.on("error", () => {});
|
|
1491
|
+
try { proc.stdin.write(prompt); proc.stdin.end(); } catch { /* settled by close/error */ }
|
|
1492
|
+
}
|
|
1484
1493
|
// REVERTED (2026-07-02): a visible window here is a dead end — this job's stdin/stdout
|
|
1485
1494
|
// are piped to this Node process for programmatic stream-json parsing, not connected to
|
|
1486
1495
|
// the console, so "showing" it just displays an empty, non-interactive window. Real
|
|
@@ -1757,10 +1766,12 @@ export class DelegationLane {
|
|
|
1757
1766
|
return this.binary != null;
|
|
1758
1767
|
}
|
|
1759
1768
|
|
|
1760
|
-
buildArgs({
|
|
1769
|
+
buildArgs({ model, appendSystemPrompt }) {
|
|
1761
1770
|
return [
|
|
1771
|
+
// Prompt is fed via the child's stdin (claude -p reads stdin), NOT as an
|
|
1772
|
+
// argv positional — a large prompt as argv overflows the OS command-line
|
|
1773
|
+
// length limit (spawn ENAMETOOLONG on content-heavy call_agent jobs).
|
|
1762
1774
|
"-p",
|
|
1763
|
-
prompt,
|
|
1764
1775
|
"--model",
|
|
1765
1776
|
model || this.defaultModel,
|
|
1766
1777
|
"--dangerously-skip-permissions",
|
|
@@ -1836,7 +1847,7 @@ export class DelegationLane {
|
|
|
1836
1847
|
proc = this._spawn(command, spawnArgs, {
|
|
1837
1848
|
cwd,
|
|
1838
1849
|
env: process.env, // inherits CLI login; never sets ANTHROPIC_API_KEY
|
|
1839
|
-
stdio: ["
|
|
1850
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
1840
1851
|
shell: false,
|
|
1841
1852
|
windowsHide: true,
|
|
1842
1853
|
});
|
|
@@ -1852,6 +1863,11 @@ export class DelegationLane {
|
|
|
1852
1863
|
this.active++;
|
|
1853
1864
|
this.totalSpawned++;
|
|
1854
1865
|
this._procs.add(proc);
|
|
1866
|
+
// Prompt over stdin — avoids argv-length overflow on large delegated prompts.
|
|
1867
|
+
if (proc.stdin) {
|
|
1868
|
+
proc.stdin.on("error", () => {});
|
|
1869
|
+
try { proc.stdin.write(prompt); proc.stdin.end(); } catch { /* settled by close/error */ }
|
|
1870
|
+
}
|
|
1855
1871
|
|
|
1856
1872
|
let stdout = "";
|
|
1857
1873
|
let stderr = "";
|