clawmoney 0.15.13 → 0.15.14
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 +23 -37
- package/package.json +1 -1
|
@@ -2,7 +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 { intro, outro, multiselect, confirm,
|
|
5
|
+
import { intro, outro, multiselect, confirm, spinner, isCancel, cancel, log, } from "@clack/prompts";
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import { apiPost } from "../utils/api.js";
|
|
8
8
|
import { requireConfig } from "../utils/config.js";
|
|
@@ -224,48 +224,34 @@ export async function relaySetupCommand() {
|
|
|
224
224
|
cancel("No models selected — nothing to register");
|
|
225
225
|
process.exit(0);
|
|
226
226
|
}
|
|
227
|
-
// ── Step 4:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
defaultValue: "15",
|
|
248
|
-
validate: (v) => {
|
|
249
|
-
const n = parseFloat(v || "15");
|
|
250
|
-
if (Number.isNaN(n) || n < 0) {
|
|
251
|
-
return "Must be a non-negative number";
|
|
252
|
-
}
|
|
253
|
-
return undefined;
|
|
254
|
-
},
|
|
255
|
-
});
|
|
256
|
-
if (isCancel(dailyLimitAns)) {
|
|
257
|
-
cancel("Setup cancelled");
|
|
258
|
-
process.exit(0);
|
|
259
|
-
}
|
|
260
|
-
const concurrency = parseInt(concurrencyAns, 10);
|
|
261
|
-
const dailyLimit = parseFloat(dailyLimitAns);
|
|
227
|
+
// ── Step 4: defaults that don't need user input ──
|
|
228
|
+
//
|
|
229
|
+
// We deliberately don't prompt for these:
|
|
230
|
+
//
|
|
231
|
+
// - Concurrency (5): the right value is "looks like a single power
|
|
232
|
+
// user". 3-5 is the sweet spot — high enough that one person with
|
|
233
|
+
// multiple terminals is plausible, low enough that Anthropic's
|
|
234
|
+
// per-account behavioral profiler can't easily distinguish from
|
|
235
|
+
// real CC traffic. Asking the user creates friction and an option
|
|
236
|
+
// they can't confidently judge.
|
|
237
|
+
//
|
|
238
|
+
// - Daily limit ($15): roughly what a heavy individual user spends
|
|
239
|
+
// on Claude API in a day. Hard cap that protects against runaway
|
|
240
|
+
// buyer abuse hitting the OAuth account's quota.
|
|
241
|
+
//
|
|
242
|
+
// Both can be overridden later via:
|
|
243
|
+
// clawmoney relay register --cli X --model Y --concurrency N --daily-limit M
|
|
244
|
+
// (or just edit ~/.clawmoney/config.yaml after start)
|
|
245
|
+
const concurrency = 5;
|
|
246
|
+
const dailyLimit = 15;
|
|
262
247
|
// ── Step 5: confirmation summary ──
|
|
263
248
|
log.step(chalk.bold("Summary"));
|
|
264
249
|
for (const r of registrations) {
|
|
265
250
|
log.message(` ${chalk.cyan(r.cli + "/" + r.model).padEnd(50)} ${chalk.dim(formatBuyerPrice(r.input, r.output))}`);
|
|
266
251
|
}
|
|
267
|
-
log.message(chalk.dim(` ${registrations.length}
|
|
252
|
+
log.message(chalk.dim(` ${registrations.length} provider(s) · concurrency=${concurrency}/provider · daily_limit=$${dailyLimit}/provider`));
|
|
268
253
|
log.message(chalk.dim(` You earn ~${Math.round((1 - PLATFORM_FEE) * 100)}% of what buyers pay (after platform fee)`));
|
|
254
|
+
log.message(chalk.dim(` To customize: edit ~/.clawmoney/config.yaml after start, or re-register a single model via "clawmoney relay register --cli X --model Y --concurrency N --daily-limit M"`));
|
|
269
255
|
const proceed = await confirm({
|
|
270
256
|
message: `Register all ${registrations.length} providers now?`,
|
|
271
257
|
initialValue: true,
|