clawmoney 0.15.53 → 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 -16
- 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,26 +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
|
-
//
|
|
227
|
-
//
|
|
228
|
-
//
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
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);
|
|
240
|
+
}
|
|
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");
|
|
245
|
+
}
|
|
246
|
+
};
|
|
233
247
|
try {
|
|
234
248
|
const fp = await bootstrapClaudeFingerprint({ timeoutMs: 45_000 });
|
|
235
|
-
|
|
236
|
-
process.stdout.write("
|
|
237
|
-
|
|
238
|
-
|
|
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");
|
|
239
253
|
}
|
|
240
254
|
catch (err) {
|
|
241
|
-
|
|
242
|
-
process.stdout.write("\n
|
|
243
|
-
log.warn(`Claude fingerprint capture failed: ${err.message}`);
|
|
255
|
+
clearStartLine();
|
|
256
|
+
process.stdout.write(`${chalk.yellow("⚠")} Claude fingerprint capture failed: ${err.message}\n`);
|
|
244
257
|
log.message(chalk.dim("Claude providers will be registered but the daemon won't be able " +
|
|
245
258
|
"to serve them until you bootstrap the fingerprint. " +
|
|
246
259
|
"Make sure `claude` is installed and logged in, then re-run setup."));
|