clawmoney 0.15.48 → 0.15.50
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.
|
@@ -221,18 +221,21 @@ export async function relaySetupCommand() {
|
|
|
221
221
|
// Only claude is wired up for now; codex/gemini will follow the
|
|
222
222
|
// same pattern.
|
|
223
223
|
if (selectedClis.includes("claude") && !hasClaudeFingerprint()) {
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
// Use static log.step + log.success/log.warn instead of a spinner:
|
|
225
|
+
// some terminals (notably Claude Code's bash runner) don't honor
|
|
226
|
+
// `\r` cursor-return, which makes a clack spinner accumulate one
|
|
227
|
+
// frame per tick instead of animating in place.
|
|
228
|
+
log.step("Capturing Claude fingerprint (runs `claude -p hi` once, ~5-15s)...");
|
|
226
229
|
try {
|
|
227
230
|
const fp = await bootstrapClaudeFingerprint({ timeoutMs: 45_000 });
|
|
228
|
-
|
|
231
|
+
log.success(`Claude fingerprint captured ` +
|
|
229
232
|
chalk.dim(`(device=${fp.device_id.slice(0, 8)}… cc_version=${fp.cc_version || "?"})`));
|
|
230
233
|
}
|
|
231
234
|
catch (err) {
|
|
232
|
-
|
|
233
|
-
log.
|
|
234
|
-
"to serve them until you
|
|
235
|
-
"
|
|
235
|
+
log.warn(`Claude fingerprint capture failed: ${err.message}`);
|
|
236
|
+
log.message(chalk.dim("Claude providers will be registered but the daemon won't be able " +
|
|
237
|
+
"to serve them until you bootstrap the fingerprint. " +
|
|
238
|
+
"Make sure `claude` is installed and logged in, then re-run setup."));
|
|
236
239
|
}
|
|
237
240
|
}
|
|
238
241
|
const registrations = [];
|
|
@@ -276,16 +276,46 @@ export async function bootstrapClaudeFingerprint(opts = {}) {
|
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
const port = addr.port;
|
|
279
|
-
//
|
|
280
|
-
//
|
|
279
|
+
// Build child env: inherit parent's env but strip HTTPS_PROXY
|
|
280
|
+
// entries so claude doesn't try to tunnel its call to
|
|
281
|
+
// http://127.0.0.1:<port> through the upstream proxy. Set
|
|
282
|
+
// NO_PROXY=localhost as belt-and-braces.
|
|
283
|
+
const childEnv = {
|
|
284
|
+
...process.env,
|
|
285
|
+
ANTHROPIC_BASE_URL: `http://127.0.0.1:${port}`,
|
|
286
|
+
NO_PROXY: "127.0.0.1,localhost",
|
|
287
|
+
no_proxy: "127.0.0.1,localhost",
|
|
288
|
+
};
|
|
289
|
+
delete childEnv.HTTPS_PROXY;
|
|
290
|
+
delete childEnv.https_proxy;
|
|
291
|
+
delete childEnv.HTTP_PROXY;
|
|
292
|
+
delete childEnv.http_proxy;
|
|
293
|
+
delete childEnv.ALL_PROXY;
|
|
294
|
+
delete childEnv.all_proxy;
|
|
295
|
+
// Launch `claude -p "hi"` — same command the manual capture
|
|
296
|
+
// script documents. `-p` is non-interactive print mode; in
|
|
297
|
+
// recent claude versions it skips the trust dialog for
|
|
298
|
+
// text-only prompts. We intentionally do NOT pass
|
|
299
|
+
// --dangerously-skip-permissions — that would silently opt
|
|
300
|
+
// users into a lower safety setting without consent.
|
|
281
301
|
claudeChild = spawn("claude", ["-p", "hi"], {
|
|
282
|
-
env:
|
|
283
|
-
|
|
284
|
-
ANTHROPIC_BASE_URL: `http://127.0.0.1:${port}`,
|
|
285
|
-
},
|
|
286
|
-
stdio: "ignore",
|
|
302
|
+
env: childEnv,
|
|
303
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
287
304
|
shell: process.platform === "win32",
|
|
288
305
|
});
|
|
306
|
+
// Buffer stderr so we can surface it in the error message if
|
|
307
|
+
// claude bails out. stdout is dropped — we don't care about
|
|
308
|
+
// the content, only about the /v1/messages request it made.
|
|
309
|
+
let stderrBuf = "";
|
|
310
|
+
claudeChild.stderr?.on("data", (chunk) => {
|
|
311
|
+
stderrBuf += chunk.toString();
|
|
312
|
+
if (stderrBuf.length > 4_000) {
|
|
313
|
+
stderrBuf = stderrBuf.slice(-4_000);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
claudeChild.stdout?.on("data", () => {
|
|
317
|
+
// drain, ignore
|
|
318
|
+
});
|
|
289
319
|
claudeChild.on("error", (err) => {
|
|
290
320
|
if (resolved)
|
|
291
321
|
return;
|
|
@@ -304,8 +334,9 @@ export async function bootstrapClaudeFingerprint(opts = {}) {
|
|
|
304
334
|
resolved = true;
|
|
305
335
|
clearTimeout(timer);
|
|
306
336
|
cleanup();
|
|
307
|
-
|
|
308
|
-
|
|
337
|
+
const tail = stderrBuf.trim().slice(-400);
|
|
338
|
+
const detail = tail ? ` stderr: ${tail}` : "";
|
|
339
|
+
reject(new Error(`claude -p hi exited with code ${code ?? "unknown"} before sending a /v1/messages request.${detail}`));
|
|
309
340
|
}, 500);
|
|
310
341
|
});
|
|
311
342
|
});
|