clawmoney 0.15.16 → 0.15.18
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 +47 -34
- package/package.json +1 -1
|
@@ -224,53 +224,57 @@ export async function relaySetupCommand() {
|
|
|
224
224
|
cancel("No models selected — nothing to register");
|
|
225
225
|
process.exit(0);
|
|
226
226
|
}
|
|
227
|
-
// ── Step 4: daily
|
|
227
|
+
// ── Step 4: per-provider daily quota share ──
|
|
228
228
|
//
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
// product decision, not a technical one: it directly controls how
|
|
232
|
-
// much you can earn (and how much subscription quota the relay
|
|
233
|
-
// burns through per day). We offer three presets calibrated to
|
|
234
|
-
// common provider postures, plus the implicit fall-through of
|
|
235
|
-
// editing config.yaml after start for advanced overrides.
|
|
229
|
+
// We deliberately don't show USD earnings projections in this prompt
|
|
230
|
+
// because they'd be misleading:
|
|
236
231
|
//
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
//
|
|
232
|
+
// - `daily_limit_usd` is per-provider (per model row), not per-account.
|
|
233
|
+
// If a user registers 4 codex models on one ChatGPT account, total
|
|
234
|
+
// daily cap = 4 × this value, not this value. Showing "$15/day cap"
|
|
235
|
+
// makes them think it's their account-wide total.
|
|
236
|
+
//
|
|
237
|
+
// - Different models have wildly different prices (claude-opus is
|
|
238
|
+
// $5/$25 per Mtok, haiku is $1/$5). A flat USD cap means very
|
|
239
|
+
// different token volumes per model — there's no single "fair
|
|
240
|
+
// share" number we can show.
|
|
241
|
+
//
|
|
242
|
+
// - Multiple CLI families = multiple independent subscriptions. A
|
|
243
|
+
// user with claude + codex + gemini has three separate quota
|
|
244
|
+
// pools. A single "% of subscription" framing per the wizard
|
|
245
|
+
// can't express that cleanly.
|
|
246
|
+
//
|
|
247
|
+
// Solution: ask the user for a percentage (~10/25/50/100) which maps
|
|
248
|
+
// internally to a per-provider USD cap, but only SHOW the percentage
|
|
249
|
+
// in the prompt. Earnings depend on real buyer demand × per-model
|
|
250
|
+
// pricing × number of providers; we can't predict that, so we don't
|
|
251
|
+
// pretend to.
|
|
241
252
|
const concurrency = 5;
|
|
242
|
-
const earnPerMonth = (cap) => Math.round(cap * RELAY_DISCOUNT * (1 - PLATFORM_FEE) * 30);
|
|
243
|
-
// Baseline: $60/day API cost ≈ a fully utilized Max-tier subscription's
|
|
244
|
-
// daily quota (Claude Max 20x, ChatGPT Pro, etc.). Percentages are
|
|
245
|
-
// computed off this baseline so users can intuit "I'm sharing X% of
|
|
246
|
-
// a typical subscription's daily capacity". For Pro tier subs the
|
|
247
|
-
// real percentage is higher (because their full quota is smaller),
|
|
248
|
-
// but the USD cap is what actually matters technically.
|
|
249
253
|
const dailyLimitChoice = await select({
|
|
250
|
-
message: "
|
|
254
|
+
message: "Daily quota share per model? (applies independently to each model you register)",
|
|
251
255
|
options: [
|
|
252
|
-
{
|
|
253
|
-
value: 6,
|
|
254
|
-
label: `~10% · $6/day cap → ~$${earnPerMonth(6)}/month earnings`,
|
|
255
|
-
hint: "light sharing — keeps most of your quota for personal use",
|
|
256
|
-
},
|
|
257
256
|
{
|
|
258
257
|
value: 15,
|
|
259
|
-
label:
|
|
260
|
-
hint: "
|
|
258
|
+
label: "~25% · Light",
|
|
259
|
+
hint: "share a quarter, leaves 75% for your personal use",
|
|
261
260
|
},
|
|
262
261
|
{
|
|
263
262
|
value: 30,
|
|
264
|
-
label:
|
|
265
|
-
hint: "
|
|
263
|
+
label: "~50% · Balanced (recommended)",
|
|
264
|
+
hint: "splits each model's quota evenly between you and the relay",
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
value: 45,
|
|
268
|
+
label: "~75% · Heavy",
|
|
269
|
+
hint: "most of your subscription goes to relay, 25% reserved for personal use",
|
|
266
270
|
},
|
|
267
271
|
{
|
|
268
272
|
value: 60,
|
|
269
|
-
label:
|
|
270
|
-
hint: "relay
|
|
273
|
+
label: "~100% · Full",
|
|
274
|
+
hint: "dedicates your subscription to relay — best for accounts you don't use personally",
|
|
271
275
|
},
|
|
272
276
|
],
|
|
273
|
-
initialValue:
|
|
277
|
+
initialValue: 30,
|
|
274
278
|
});
|
|
275
279
|
if (isCancel(dailyLimitChoice)) {
|
|
276
280
|
cancel("Setup cancelled");
|
|
@@ -278,13 +282,22 @@ export async function relaySetupCommand() {
|
|
|
278
282
|
}
|
|
279
283
|
const dailyLimit = dailyLimitChoice;
|
|
280
284
|
// ── Step 5: confirmation summary ──
|
|
285
|
+
// Translate the chosen daily-limit USD value back into the percentage
|
|
286
|
+
// label the user picked, so what they see in the summary matches what
|
|
287
|
+
// they answered in the prompt.
|
|
288
|
+
const limitLabel = {
|
|
289
|
+
15: "~25% (Light)",
|
|
290
|
+
30: "~50% (Balanced)",
|
|
291
|
+
45: "~75% (Heavy)",
|
|
292
|
+
60: "~100% (Full)",
|
|
293
|
+
};
|
|
281
294
|
log.step(chalk.bold("Summary"));
|
|
282
295
|
for (const r of registrations) {
|
|
283
296
|
log.message(` ${chalk.cyan(r.cli + "/" + r.model).padEnd(50)} ${chalk.dim(formatBuyerPrice(r.input, r.output))}`);
|
|
284
297
|
}
|
|
285
|
-
log.message(chalk.dim(` ${registrations.length} provider(s) ·
|
|
298
|
+
log.message(chalk.dim(` ${registrations.length} provider(s) · ${limitLabel[dailyLimit] ?? `$${dailyLimit}/day cap`} per model`));
|
|
286
299
|
log.message(chalk.dim(` You earn ~${Math.round((1 - PLATFORM_FEE) * 100)}% of what buyers pay (after platform fee)`));
|
|
287
|
-
log.message(chalk.dim(` To customize: edit ~/.clawmoney/config.yaml after start
|
|
300
|
+
log.message(chalk.dim(` To customize: edit ~/.clawmoney/config.yaml after start`));
|
|
288
301
|
const proceed = await confirm({
|
|
289
302
|
message: `Register all ${registrations.length} providers now?`,
|
|
290
303
|
initialValue: true,
|