foldrun 25.0.2 → 25.1.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/commands.mjs +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldrun",
3
- "version": "25.0.2",
3
+ "version": "25.1.0",
4
4
  "description": "Agents are just folders. Write them, check them, run them — on your machine.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",
package/src/commands.mjs CHANGED
@@ -4728,6 +4728,7 @@ async function doctor(flags) {
4728
4728
  * keys create <label> --a2a --to <ws> --flows a,b [--max-tasks N] a key for an outside agent: /a2a only
4729
4729
  * keys create <label> --gateway --cap <usd> [--daily <usd>] a coding agent's key (Claude Code): the gateway only
4730
4730
  * keys create <label> --gateway --login on the account's plan (where it has one): not billed per call
4731
+ * keys create <label> --gateway --login --plan max five times a pro key's usage limits (pro is the default)
4731
4732
  * keys create <label> --gateway --cap <usd> --claude-code …and write it into Claude Code's settings (its status line too)
4732
4733
  * keys set <id> --opus|--sonnet|--haiku <provider/model> which model each Claude Code tier runs on (a gateway key; `-` clears one, --clear all)
4733
4734
  * keys rotate <id> [--grace 1h] a new key, same label/role/scope; the old
@@ -4920,7 +4921,7 @@ function modelsLine(m) {
4920
4921
  function gatewayLine(g) {
4921
4922
  const map = modelsLine(g?.models);
4922
4923
  const tail = map ? ` · ${map}` : "";
4923
- if (g?.credential === "login") return `gateway · Claude Code · plan · not billed per call${tail}`;
4924
+ if (g?.credential === "login") return `gateway · Claude Code · ${g.plan === "max" ? "max" : "pro"} plan · not billed per call${tail}`;
4924
4925
  const usd = (n) => `$${Number(n ?? 0).toFixed(2)}`;
4925
4926
  const parts = ["gateway · Claude Code"];
4926
4927
  if (g?.capUsd != null) parts.push(`${usd(g.spentUsd)} of ${usd(g.capUsd)}`);
@@ -4958,7 +4959,10 @@ async function keysCreateGateway(url, label, flags) {
4958
4959
  // could not safely rewrite stops here with nothing made.
4959
4960
  const claude = flags["claude-code"] === true ? preflightClaudeSettings() : null;
4960
4961
  const body = { label, purpose: "gateway" };
4962
+ if (flags.plan !== undefined && flags.login !== true) throw new Error("--plan goes with --login: a key with --cap or --daily has those limits");
4963
+ if (flags.plan !== undefined && flags.plan !== "pro" && flags.plan !== "max") throw new Error(`--plan is pro or max — got ${JSON.stringify(flags.plan)}`);
4961
4964
  if (flags.login === true) body.credential = "login";
4965
+ if (flags.login === true && flags.plan !== undefined) body.plan = flags.plan;
4962
4966
  // --require-customer (FOL-168): every call must send x-foldrun-customer.
4963
4967
  if (flags["require-customer"] === true) body.requireCustomer = true;
4964
4968
  if (capUsd !== undefined) body.capUsd = capUsd;
@@ -4968,7 +4972,7 @@ async function keysCreateGateway(url, label, flags) {
4968
4972
  if (flags.expires !== undefined && typeof flags.expires !== "string") throw new Error("--expires needs a span: 30d, 90d, 365d or never");
4969
4973
  body.expires = flags.forever === true ? "never" : typeof flags.expires === "string" ? flags.expires : "90d";
4970
4974
  const made = await remoteCall(url, flags, "/api/keys", { method: "POST", body: JSON.stringify(body) });
4971
- console.log(`\n ${c.green("✓")} ${c.bold(label)} ${c.dim(made.id)} ${c.dim(gatewayLine({ capUsd: made.capUsd ?? null, dailyUsd: made.dailyUsd ?? null, spentUsd: 0, todayUsd: 0, credential: made.credential }))}${made.expiresAt ? c.dim(` expires ${made.expiresAt.slice(0, 10)}`) : ""}\n`);
4975
+ console.log(`\n ${c.green("✓")} ${c.bold(label)} ${c.dim(made.id)} ${c.dim(gatewayLine({ capUsd: made.capUsd ?? null, dailyUsd: made.dailyUsd ?? null, spentUsd: 0, todayUsd: 0, credential: made.credential, plan: made.plan }))}${made.expiresAt ? c.dim(` expires ${made.expiresAt.slice(0, 10)}`) : ""}\n`);
4972
4976
  if (made.key == null) return lostSecret(made.id);
4973
4977
  console.log(` ${made.key}\n`);
4974
4978
  const base = made.gatewayUrl ?? "<the gateway URL — not set on this platform yet>";