foldrun 26.1.0 → 26.2.1

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/docs/api.md CHANGED
@@ -402,7 +402,7 @@ Reads return which secrets exist, never their values.
402
402
  | `/api/usage/compute` | GET | the account's compute at every level (27 Oct 2026): `compute` is `{ vcpu, memGiB, diskGiB, stepVcpu, stepMemGiB, stepDiskGiB, source }` — the cores, GiB and GiB of disk all its running steps may hold together, the most one step may hold (each `null` for no cap), and where the pool came from (`plan`, `account` — its own `compute:` in AGENTS.md, which can only lower it — `install`, or `null`); `inUse` is `{ vcpu, memGiB, diskGiB, steps }`, what its running steps' sandboxes hold now, from their records (a step still waiting for room holds nothing; a caller scoped to some workspaces sees theirs); `workspaces` is each workspace's own `pool` (its AGENTS.md `compute:`, `null` figures for none) and `inUse`; `runs` is each live run with a pool of its own (its flow's `compute:`) or anything held, `{ workspace, runId, flow, pool, inUse }`; `waiting` lists the steps waiting for room, oldest first — `{ workspace, runId, flow, step, agent, since, why, cpus, memGiB, diskGiB, level?, runPool }`, `since` being when it first found none, its place in line, and `level` the cap that held it when it last looked; `runsWaiting` is `{ waiting, limit, source, slots? }` — the account's runs waiting for their turn (`null` for a caller scoped to some workspaces) and the most before a new run is refused (`null`: no limit), `source` `install` (`FOLDRUN_MAX_WAITING_RUNS`), `plan` (the account's plan sets it: Free 20, Starter 100, Pro 400, Scale 1,000, defaults the owners confirm) or `derived` (20 × `slots`, the runs it may drive at once, at least 50) ([how many runs may wait](budgets-and-billing#how-many-runs-may-wait)); `compute.stepDefault`, when present, names the step figures that are the hosted default for an account whose plan sets none. A step past any level waits, with no time limit, and starts in turn; one bigger than a level's whole cap or the step maximum fails at once ([four levels](budgets-and-billing#compute-at-four-levels), [waiting for room](budgets-and-billing#waiting-for-room)) |
403
403
  | `/api/usage/budget` | GET | spend against the caps, as the Spend limits page shows it (5 Nov 2026): `account` is the account's own `budget:` — `{ budget, label, spentUsd, window }`, `budget` being `{ usd, period }` or `null` for no limit, `label` `"$60/day"` or `null`, `spentUsd` what every workspace together has spent in the cap's window (the month's with no cap) and `window` `today`, `this week` or `this month`; `workspaces` is each workspace's the same way with its name as `workspace`, most spent first. A caller scoped to some workspaces sees those, and gets `account: null` with `accountHidden: true` — the account's figure is spend over every workspace. At the cap new runs are refused until the window turns ([four caps](budgets-and-billing#four-caps)) |
404
404
  | `/api/usage/history?days=` | GET | charged spend by flow, by agent and by workspace over time, read from the ledger rather than the run records — so it survives runs being pruned and reports what was billed rather than what was consumed. Buckets by week over three weeks, by day under. Each series carries its periods, its total, and the change between the last two COMPLETE periods, so a partial week never reads as a collapse. `unattributedUsd` is charges from before a line recorded its flow. A caller scoped to some workspaces sees only the charges in those; `days` 1–365, default 56 |
405
- | `/api/account/model` | GET, PUT, DELETE | what every step runs on unless an agent, workspace or the account's AGENTS.md names a `provider:` — the account's own model key, or foldrun's models (the platform's keys for one provider, billed in credits at foldrun's price list; hosted only). GET: `{ set, provider, baseUrl, format, keyHint, runsOn, platformKeyAllowed, source, supply, choiceVersion, foldrunModels }` — never a key, only its last four characters; `runsOn` is `account` (its own key), `foldrun` (foldrun's models for `supply`), `platform` (the platform's credential, for the operator's accounts) or `none` (runs are refused until a key is set); `foldrunModels` is `{ offered, refused, providers: [{ name, title, available, reason, tiers }], prices: [{ provider, model, inputPerMTok, outputPerMTok, cacheReadPerMTok, cacheWritePerMTok }], dailyCapUsd, spentTodayUsd }`, the money in what the account pays. PUT `{ source: "foldrun", supply, ifVersion? }` chooses foldrun's models (`supply`: anthropic, openai, gemini, deepseek or moonshot; a provider the platform cannot serve now, or an account refused them, is a 409; a stale `ifVersion` is a 409); `{ source: "own" }` goes back to the account's own key; a key alone never changes the choice; audited as model.source_set. PUT `{ provider, apiKey, baseUrl?, format? }` (needs `secrets:write`, as does the choice): `provider` is a preset name (anthropic, openrouter, openai, groq, … — see providers) or `custom` with an https `baseUrl` and a `format` (anthropic or openai); a Claude login token (sk-ant-oat…) is refused for any account not allowed the platform's credential. Stored as the account secrets `FOLDRUN_MODEL_PROVIDER`, `FOLDRUN_MODEL_API_KEY`, `FOLDRUN_MODEL_BASE_URL`, `FOLDRUN_MODEL_FORMAT`. DELETE removes them (the choice stays). Honours Idempotency-Key on PUT; audited as model.key_set / model.key_removed |
405
+ | `/api/account/model` | GET, PUT, DELETE | what every step runs on unless an agent, workspace or the account's AGENTS.md names a `provider:` — the account's own model key, or foldrun's models (the platform's keys for one provider, billed in credits at foldrun's price list; hosted only). GET: `{ set, provider, baseUrl, format, keyHint, runsOn, platformKeyAllowed, source, supply, choiceVersion, foldrunModels }` — never a key, only its last four characters; `runsOn` is `account` (its own key), `foldrun` (foldrun's models for `supply`), `platform` (the platform's credential, for the operator's accounts), `subscription` (Claude, on the account's live Claude plan where the platform sells one: its runs count in the plan's monthly and weekly limits, nothing is billed in credits; an own key or a choice of foldrun's models comes first) or `none` (runs are refused until a key is set); `foldrunModels` is `{ offered, refused, providers: [{ name, title, available, reason, tiers }], prices: [{ provider, model, inputPerMTok, outputPerMTok, cacheReadPerMTok, cacheWritePerMTok }], dailyCapUsd, spentTodayUsd }`, the money in what the account pays. PUT `{ source: "foldrun", supply, ifVersion? }` chooses foldrun's models (`supply`: anthropic, openai, gemini, deepseek or moonshot; a provider the platform cannot serve now, or an account refused them, is a 409; a stale `ifVersion` is a 409); `{ source: "own" }` goes back to the account's own key; a key alone never changes the choice; audited as model.source_set. PUT `{ provider, apiKey, baseUrl?, format? }` (needs `secrets:write`, as does the choice): `provider` is a preset name (anthropic, openrouter, openai, groq, … — see providers) or `custom` with an https `baseUrl` and a `format` (anthropic or openai); a Claude login token (sk-ant-oat…) is refused for any account not allowed the platform's credential. Stored as the account secrets `FOLDRUN_MODEL_PROVIDER`, `FOLDRUN_MODEL_API_KEY`, `FOLDRUN_MODEL_BASE_URL`, `FOLDRUN_MODEL_FORMAT`. DELETE removes them (the choice stays). Honours Idempotency-Key on PUT; audited as model.key_set / model.key_removed |
406
406
  | `/api/account/providers` | GET, POST | GET: the model providers this account's files actually use — each one's preset name, where it is declared, the model a check would send — plus the last daily health check. POST forces one now, which spends one minimal request at each distinct endpoint, and needs the permission that runs and every workspace. A member or key scoped to some workspaces sees the account's provider blocks and its own workspaces' only, in `configured` and in the last check |
407
407
  | `/api/usage` | GET | what has been spent, by meter; each bucket's tokens are `inputTokens` (all input), `outputTokens`, `cacheReadTokens` and `cacheWriteTokens` (the part of the input the prompt cache served and stored), and `cacheHitRate` — reads over `measuredInputTokens`, the input of steps that report the split, `null` when none do. A key or member scoped to some workspaces sees those workspaces, and totals over them; `ledger` is the account's `balanceUsd` and `chargedUsd` (all time), and `waived` the legs the account is not charged for — both `null` to a caller scoped to some workspaces, since they are the whole account's money. Since API version `2026-10-26` nothing else; earlier pins see `providerCostUsd` and `marginUsd` as `null`. `?from=YYYY-MM-DD&to=YYYY-MM-DD` (UTC days; default the month so far; at most a year; anything else is a 400) bound four blocks, which answer every call (7 Nov 2026): `period` (`from`, `to`); `credits`, `{ pots: { planUsd, boughtUsd }, plan, boughtOldestExpiresAt, unit, usdPerCredit }` — the two credit pots (plan credits pay for compute, storage and network, never for tokens on foldrun's models; bought credits pay for anything) and the plan's terms with `status` and `resetsAt`; `tokens`, `{ totals: { calls, billedCredits, byokTokens }, byModel }`, one row per provider and model with `supply` (`foldrun`, `operator` or `own`), `calls`, `inputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens` and `billedCredits` — a model on the account's own key is listed at `0` with a `billedNote`; and `compute`, `{ meters, planFee, bySize }`, each meter (`vcpu`, `ram`, `disk`, `storage`, `network`, `search`, `browser`, `warm`) with `quantity`, `unit`, `rateCreditsPerUnit` and `credits` — `storage` also `includedGb`, `overGb` (only these are charged) and `basis`, and the three pod meters (the account's search and browser pods and its deploy-time runtime builds, charged for the vCPU and GiB they hold while they live and the bytes they move) `sessions`, `networkGb` and a `note`; `credits` on a pod meter and on `storage` is what the ledger charged over the period —, `planFee` the plan's fee as its own line, `bySize` the step sizes with their `creditsPerHour`; `billed` is what the ledger charged over the period (`totalCredits`, `waived`). They are consumption priced at today's rates, which can differ from `billed` after a price change. `credits`, `planFee` and `billed` are `null` to a caller scoped to some workspaces, whose `tokens` and `compute` cover those workspaces, and `null` where nothing is billed. The totals and `workspaces` above are over every retained run, whatever the period |
408
408
  | `/api/usage/rates` | GET | the rates this account is charged now (7 Nov 2026): `rates`, `{ creditUsd, vcpuUsdPerHour, ramUsdPerGibHour, diskUsdPerGibMonth, storageUsdPerGbMonth, networkUsdPerGb, margin }` in dollars, `null` where nothing is billed; `plan`, the account's plan terms (`null` to a caller scoped to some workspaces); and `catalogue`, the same document as `/api/pricing`. The Usage page's Rates tab and `foldrun usage rates` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldrun",
3
- "version": "26.1.0",
3
+ "version": "26.2.1",
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",
@@ -11,7 +11,7 @@
11
11
  "node": ">=22"
12
12
  },
13
13
  "dependencies": {
14
- "@foldrun/core": "^24.0.0"
14
+ "@foldrun/core": "^24.1.0"
15
15
  },
16
16
  "files": [
17
17
  "bin",
package/src/commands.mjs CHANGED
@@ -7324,6 +7324,8 @@ async function accountModelCmd(url, positional, flags) {
7324
7324
  : `${c.green("✓")} foldrun's models — ${c.bold(p?.title ?? r.supply)} ${c.dim("· billed in credits at foldrun's price list")}`;
7325
7325
  } else if (r.runsOn === "account") {
7326
7326
  runs = `${c.green("✓")} your own key — ${c.bold(r.provider ?? "custom")} ${c.dim(`${r.keyHint ?? ""} · ${r.baseUrl ?? ""} · ${r.format ?? ""}`)}`;
7327
+ } else if (r.runsOn === "subscription") {
7328
+ runs = `${c.green("✓")} ${c.bold("Claude subscription")} ${c.dim("· Claude, on your Claude Code plan — counted in its monthly and weekly limits, like your Claude Code (Billing → Plan)")}`;
7327
7329
  } else if (r.runsOn === "platform") {
7328
7330
  runs = `${c.yellow("·")} the platform's credential ${c.dim("(this account is allowed it)")}`;
7329
7331
  } else {