clawmoney 0.15.52 → 0.15.54
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/dist/commands/relay-setup.js +29 -28
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { execSync } from "node:child_process";
|
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
+
import * as readline from "node:readline";
|
|
5
6
|
import { intro, outro, multiselect, select, spinner, isCancel, cancel, log, } from "@clack/prompts";
|
|
6
7
|
import chalk from "chalk";
|
|
7
8
|
import { apiPost } from "../utils/api.js";
|
|
@@ -221,38 +222,38 @@ export async function relaySetupCommand() {
|
|
|
221
222
|
// Only claude is wired up for now; codex/gemini will follow the
|
|
222
223
|
// same pattern.
|
|
223
224
|
if (selectedClis.includes("claude") && !hasClaudeFingerprint()) {
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
// and
|
|
227
|
-
//
|
|
228
|
-
//
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const successMsg = `Claude fingerprint captured ` +
|
|
240
|
-
chalk.dim(`(device=${fp.device_id.slice(0, 8)}… cc_version=${fp.cc_version || "?"})`);
|
|
241
|
-
if (bootSpin) {
|
|
242
|
-
bootSpin.stop(`${chalk.green("✓")} ${successMsg}`);
|
|
225
|
+
// In-place line replacement: write a "Capturing…" start line
|
|
226
|
+
// without a trailing newline, then on completion clear that
|
|
227
|
+
// line and write the final success / failure line over it.
|
|
228
|
+
// Uses readline.cursorTo/clearLine rather than raw \r because
|
|
229
|
+
// some terminal environments don't process \r as cursor-return
|
|
230
|
+
// (see earlier iteration history — the clack spinner accumulated
|
|
231
|
+
// frames in Jack's terminal). Falls back cleanly: if the clear
|
|
232
|
+
// fails, the worst case is two lines instead of one.
|
|
233
|
+
const startLine = `${chalk.gray("◇")} Capturing Claude fingerprint ` +
|
|
234
|
+
chalk.dim("(runs `claude -p hi` once, ~5-15s)");
|
|
235
|
+
process.stdout.write(startLine);
|
|
236
|
+
const clearStartLine = () => {
|
|
237
|
+
try {
|
|
238
|
+
readline.cursorTo(process.stdout, 0);
|
|
239
|
+
readline.clearLine(process.stdout, 0);
|
|
243
240
|
}
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
catch {
|
|
242
|
+
// non-TTY — just move to a new line and let the result
|
|
243
|
+
// print underneath the start line.
|
|
244
|
+
process.stdout.write("\n");
|
|
246
245
|
}
|
|
246
|
+
};
|
|
247
|
+
try {
|
|
248
|
+
const fp = await bootstrapClaudeFingerprint({ timeoutMs: 45_000 });
|
|
249
|
+
clearStartLine();
|
|
250
|
+
process.stdout.write(`${chalk.green("◆")} Claude fingerprint captured ` +
|
|
251
|
+
chalk.dim(`(device=${fp.device_id.slice(0, 8)}… cc_version=${fp.cc_version || "?"})`) +
|
|
252
|
+
"\n");
|
|
247
253
|
}
|
|
248
254
|
catch (err) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
bootSpin.stop(chalk.yellow(`⚠ ${errMsg}`));
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
log.warn(errMsg);
|
|
255
|
-
}
|
|
255
|
+
clearStartLine();
|
|
256
|
+
process.stdout.write(`${chalk.yellow("⚠")} Claude fingerprint capture failed: ${err.message}\n`);
|
|
256
257
|
log.message(chalk.dim("Claude providers will be registered but the daemon won't be able " +
|
|
257
258
|
"to serve them until you bootstrap the fingerprint. " +
|
|
258
259
|
"Make sure `claude` is installed and logged in, then re-run setup."));
|