@lifeaitools/clauth 1.18.0 → 1.18.1
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/serve.js +17 -5
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -4657,6 +4657,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
4657
4657
|
detached: true,
|
|
4658
4658
|
stdio: ["ignore", out, out],
|
|
4659
4659
|
env: { ...process.env, __CLAUTH_DAEMON: "1" },
|
|
4660
|
+
windowsHide: true,
|
|
4660
4661
|
});
|
|
4661
4662
|
child.unref();
|
|
4662
4663
|
stopTunnel();
|
|
@@ -5412,6 +5413,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
5412
5413
|
detached: true,
|
|
5413
5414
|
stdio: ["ignore", out, out],
|
|
5414
5415
|
env: childEnv,
|
|
5416
|
+
windowsHide: true,
|
|
5415
5417
|
});
|
|
5416
5418
|
child.unref();
|
|
5417
5419
|
|
|
@@ -6341,7 +6343,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
6341
6343
|
const sendEvt = (data) => res.write(`data: ${JSON.stringify(data)}\n\n`);
|
|
6342
6344
|
try {
|
|
6343
6345
|
const { spawn } = await import("child_process");
|
|
6344
|
-
const proc = spawn("cloudflared", ["tunnel", "login"], { stdio: ["ignore","pipe","pipe"] });
|
|
6346
|
+
const proc = spawn("cloudflared", ["tunnel", "login"], { stdio: ["ignore","pipe","pipe"], windowsHide: true });
|
|
6345
6347
|
proc.stdout.on("data", d => d.toString().split("\n").forEach(l => l.trim() && sendEvt({ line: l })));
|
|
6346
6348
|
proc.stderr.on("data", d => d.toString().split("\n").forEach(l => l.trim() && sendEvt({ line: l })));
|
|
6347
6349
|
proc.on("close", code => { sendEvt({ done: true, code }); res.end(); });
|
|
@@ -6375,7 +6377,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
6375
6377
|
sendEvt({ line: `Creating tunnel "${name}"…`, step: 1 });
|
|
6376
6378
|
let tunnelId = null;
|
|
6377
6379
|
await new Promise((resolve, reject) => {
|
|
6378
|
-
const proc = spawn("cloudflared", ["tunnel", "create", name], { stdio: ["ignore","pipe","pipe"] });
|
|
6380
|
+
const proc = spawn("cloudflared", ["tunnel", "create", name], { stdio: ["ignore","pipe","pipe"], windowsHide: true });
|
|
6379
6381
|
let output = "";
|
|
6380
6382
|
proc.stdout.on("data", d => { const s = d.toString(); output += s; s.split("\n").forEach(l => l.trim() && sendEvt({ line: l, step: 1 })); });
|
|
6381
6383
|
proc.stderr.on("data", d => { const s = d.toString(); output += s; s.split("\n").forEach(l => l.trim() && sendEvt({ line: l, step: 1 })); });
|
|
@@ -6395,7 +6397,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
6395
6397
|
// Step 2: route DNS
|
|
6396
6398
|
sendEvt({ line: `Routing DNS: ${hostname}…`, step: 2 });
|
|
6397
6399
|
await new Promise((resolve) => {
|
|
6398
|
-
const proc = spawn("cloudflared", ["tunnel", "route", "dns", name, hostname], { stdio: ["ignore","pipe","pipe"] });
|
|
6400
|
+
const proc = spawn("cloudflared", ["tunnel", "route", "dns", name, hostname], { stdio: ["ignore","pipe","pipe"], windowsHide: true });
|
|
6399
6401
|
proc.stdout.on("data", d => d.toString().split("\n").forEach(l => l.trim() && sendEvt({ line: l, step: 2 })));
|
|
6400
6402
|
proc.stderr.on("data", d => d.toString().split("\n").forEach(l => l.trim() && sendEvt({ line: l, step: 2 })));
|
|
6401
6403
|
proc.on("close", () => resolve());
|
|
@@ -6877,6 +6879,7 @@ async function actionStart(opts) {
|
|
|
6877
6879
|
detached: true,
|
|
6878
6880
|
stdio: ["ignore", out, out],
|
|
6879
6881
|
env: { ...process.env, __CLAUTH_DAEMON: "1", ...(isStaged ? { __CLAUTH_STAGED: "1" } : {}) },
|
|
6882
|
+
windowsHide: true,
|
|
6880
6883
|
});
|
|
6881
6884
|
child.unref();
|
|
6882
6885
|
|
|
@@ -7101,11 +7104,18 @@ function getAgentPool() {
|
|
|
7101
7104
|
defaultModel: process.env.CLAUTH_AGENT_MODEL || "claude-haiku-4-5",
|
|
7102
7105
|
});
|
|
7103
7106
|
_agentPool.startReaper();
|
|
7107
|
+
console.log(`[agent-pool] init: binary=${_agentPool.binary ? 'found' : 'MISSING'} warmEnabled=${_agentPool.warmEnabled} available=${_agentPool.available()} poolSize=${_agentPool.poolSize} warmSize=${_agentPool.warmSize}`);
|
|
7104
7108
|
// WP-P2: boot persistent re-targetable warm workers in the background so the
|
|
7105
7109
|
// first real call_agent dispatch hits a hot worker (sub-boot latency). Never
|
|
7106
7110
|
// blocks daemon startup; if warm isn't ready yet, dispatch falls back to cold.
|
|
7107
7111
|
if (_agentPool.warmEnabled && _agentPool.available()) {
|
|
7108
|
-
_agentPool.prime().
|
|
7112
|
+
_agentPool.prime().then((r) => {
|
|
7113
|
+
console.log(`[agent-pool] prime complete: mode=${r.mode} warmed=${r.warmed} workers=${r.workers ?? 'n/a'}`);
|
|
7114
|
+
}).catch((e) => {
|
|
7115
|
+
console.error(`[agent-pool] prime failed: ${e.message}`);
|
|
7116
|
+
});
|
|
7117
|
+
} else {
|
|
7118
|
+
console.log(`[agent-pool] prime skipped: warmEnabled=${_agentPool.warmEnabled} available=${_agentPool.available()}`);
|
|
7109
7119
|
}
|
|
7110
7120
|
return _agentPool;
|
|
7111
7121
|
}
|
|
@@ -7945,7 +7955,7 @@ function sendTerminalMessage(session_id, message) {
|
|
|
7945
7955
|
if (!terminalSessions.has(session_id)) return;
|
|
7946
7956
|
const s = terminalSessions.get(session_id);
|
|
7947
7957
|
const response = result.ok
|
|
7948
|
-
? (result.
|
|
7958
|
+
? (result.package || '').trim() || '(no output)'
|
|
7949
7959
|
: `(warm dispatch error: ${result.error || 'unknown'})`;
|
|
7950
7960
|
// Still update rolling context for terminal_recv compatibility
|
|
7951
7961
|
const turn = `\n\nUser: ${message}\nAssistant: ${response}`;
|
|
@@ -7990,6 +8000,7 @@ function sendTerminalMessage(session_id, message) {
|
|
|
7990
8000
|
env: process.env,
|
|
7991
8001
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
7992
8002
|
shell: true,
|
|
8003
|
+
windowsHide: true,
|
|
7993
8004
|
});
|
|
7994
8005
|
session.activeProc = proc;
|
|
7995
8006
|
|
|
@@ -8205,6 +8216,7 @@ function launchVisibleChitchatTerminal(session_id, cwd = CHITCHAT_FALLBACK_CWD)
|
|
|
8205
8216
|
cwd,
|
|
8206
8217
|
detached: true,
|
|
8207
8218
|
stdio: "ignore",
|
|
8219
|
+
windowsHide: true,
|
|
8208
8220
|
});
|
|
8209
8221
|
child.on("error", (err) => {
|
|
8210
8222
|
console.warn(`[ClaudeAItoCLI] visible terminal process error: ${err.message}`);
|