foldrun 19.0.0 → 19.0.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/bin/foldrun.mjs CHANGED
@@ -231,7 +231,7 @@ const HELP = `foldrun — agents are just folders
231
231
  foldrun account the account's defaults — also set <key> <value>, clear <key> (timezone, notify, budget, concurrency, compute vcpu <n> memory <GiB> disk <GiB>, deploy_block none|secrets|security, network_enforce on|off, owner, alerts <threshold> <value>, judge model|effort <value>; or <job>.<field>, e.g. governance.owner), pause [--reason] [--stop] / resume (the kill switch), telemetry [set <url> --header name=\${SECRET} (others kept; name= drops one) | clear | test] (runs as OpenTelemetry traces), providers (--check) (singular; accounts lists logins)
232
232
  foldrun account clear compute <vcpu|memory|disk>… drop just those figures of the account's pool · clear notify <email|url>: drop one channel, the other and the events kept
233
233
  foldrun account export everything the platform holds about the account as one JSON file (owner only; --file <path>, --force)
234
- foldrun account model what steps run on — your own key: set <provider> --key <api key> (--key - reads stdin; custom --base-url --format; --use runs on it at once, as use own), remove; or foldrun's models (billed in credits): use foldrun --provider <p>, use own, prices
234
+ foldrun account model what steps run on — your own key: set <provider> --key <api key> (--key - reads stdin, or asks for it hidden in a terminal; custom --base-url --format; --use runs on it at once, as use own), remove; or foldrun's models (billed in credits): use foldrun --provider <p>, use own, prices
235
235
  foldrun workspace one deployed workspace's settings (--to) — also set <name|description|timezone|budget|compute|notify|network_enforce|owner|alerts|judge> <value> (compute vcpu <n> memory <GiB> disk <GiB>: this workspace's pool) (or <job>.<field>), clear <key>, pause [--reason] [--stop] / resume (the kill switch)
236
236
  foldrun workspace clear compute <vcpu|memory|disk>… drop just those figures of its pool · clear notify <email|url>: one channel, the rest kept (--to)
237
237
  foldrun workspace vocabulary the names the dashboard's editor completes in a workspace: agents, flows, skills, tools, secrets, scripts, types, documents (--to, --json)
package/docs/cli.md CHANGED
@@ -187,7 +187,7 @@ claude.ai or Claude Code there, nor any MCP configuration on disk.
187
187
  | `foldrun gallery` | the tools the platform ships to every account (`web`), and for each whether this account keeps its own copy and whether that copy still matches. `pull` lays the shelf down under `~/.foldrun/gallery/<host>/` for offline runs (`foldrun run` and `foldrun eval` refresh it themselves before each run); `upgrade <tool>` replaces the account's copy with the current gallery version, the old one a revision back |
188
188
  | `foldrun identity` | keyless cloud identity: the issuer your cloud must trust and the subject each agent's tokens carry (`GET /api/identity`); `--to <workspace>` fills the workspace in, `--json` |
189
189
  | `foldrun jobs` | the four jobs — governance, guardrail, observability, evaluation — and every `AGENTS.md` field of each, with what is set (`GET /api/account/jobs`). `--to <workspace>` shows the workspace's value beside the account's and how the two combine; `--json` the document. `account set <job>.<field>` and `workspace set <job>.<field>` refuse a field that scope cannot set and name the `AGENTS.md` to write it in. See [The four jobs](four-jobs) |
190
- | `foldrun account` | the account's own defaults — the AGENTS.md frontmatter every workspace under it inherits: `timezone`, `notify`, `budget`, `concurrency`, `deploy_block`, `network_enforce`. `foldrun account set timezone Australia/Sydney`, `set notify email you@example.com` (`--events failed,awaiting-approval,completed`), `set notify url https://…`, `set budget 60/month`, `set concurrency 4`, `set compute vcpu 4 memory 8 disk 40` (GiB; any of them, merged over what is set — the account's own pool, lower than the plan's), `set deploy_block secrets` (`none`, `secrets` or `security` — what the scanner's findings do to a deploy), `set network_enforce on` (every workspace refuses a site off an agent's `network:` list; `off` reports only), `set owner <email or name>`, `set alerts <threshold> <value>` (merged into what is set; `off` removes one), `set judge model|effort <value>`. Any setting may be named by its job — `set governance.deploy_block secrets`, `set observability.alerts stale_days 30` — and one named under the wrong job is refused with the right one, `pause` (`--reason "…"`, `--stop` to also stop every run going now — asks, or `--yes`) and `resume`: the kill switch, no new run starts in any workspace while paused, `telemetry` — where each finished run goes as an OpenTelemetry trace: bare shows it, `set <url> --header authorization='${OTEL_TOKEN}'` (repeatable; a value is a vault secret's name; the headers already set are kept, as the dashboard's card keeps them, and `--header name=` drops one), `clear`, `test` (one made-up run, and what the collector answered; exit 1 when not delivered), and `clear <key>` to unset one. `set notify` merges against what is there, because the platform replaces the whole block. `providers` lists the model providers the account's files use and the last daily key check — `--check` asks now, and a dead key is a non-zero exit. `model` is what every step runs on unless a `provider:` block names another — the account's own model key, or foldrun's models: `foldrun account model` shows it (never a key, only its last four; on foldrun's models, the provider, its tier map and today's spend against the daily cap; exit 1 when runs are refused — no key, or foldrun's models refused for the account), `model set <provider> --key <api key>` sets the key — a preset name (anthropic, openrouter, openai, groq, …) or `custom --base-url https://… --format anthropic|openai`, `--key -` reads the key from stdin, `--use` also runs on it from now on in the same request (as `model use own`, which the dashboard's Save does) — and `model remove` removes it (the choice stays); a Claude login token is refused for any account not allowed the platform's own credential. `model use foldrun --provider <anthropic|openai|gemini|deepseek|moonshot>` runs every step on foldrun's models — the platform's keys, billed in credits at foldrun's price list, hosted only; a provider the platform cannot serve now is refused — and `model use own` goes back to the account's own key, which is kept. `model prices` (`--provider <p>`, `--json`) lists foldrun's price list as the account pays it, USD per million tokens. `export` downloads everything the platform holds about the account — workspaces, runs, members and the whole ledger — as one JSON file (owner only; `--file <path>`, `--force`). Singular — `accounts` below is the list of logins on this machine |
190
+ | `foldrun account` | the account's own defaults — the AGENTS.md frontmatter every workspace under it inherits: `timezone`, `notify`, `budget`, `concurrency`, `deploy_block`, `network_enforce`. `foldrun account set timezone Australia/Sydney`, `set notify email you@example.com` (`--events failed,awaiting-approval,completed`), `set notify url https://…`, `set budget 60/month`, `set concurrency 4`, `set compute vcpu 4 memory 8 disk 40` (GiB; any of them, merged over what is set — the account's own pool, lower than the plan's), `set deploy_block secrets` (`none`, `secrets` or `security` — what the scanner's findings do to a deploy), `set network_enforce on` (every workspace refuses a site off an agent's `network:` list; `off` reports only), `set owner <email or name>`, `set alerts <threshold> <value>` (merged into what is set; `off` removes one), `set judge model|effort <value>`. Any setting may be named by its job — `set governance.deploy_block secrets`, `set observability.alerts stale_days 30` — and one named under the wrong job is refused with the right one, `pause` (`--reason "…"`, `--stop` to also stop every run going now — asks, or `--yes`) and `resume`: the kill switch, no new run starts in any workspace while paused, `telemetry` — where each finished run goes as an OpenTelemetry trace: bare shows it, `set <url> --header authorization='${OTEL_TOKEN}'` (repeatable; a value is a vault secret's name; the headers already set are kept, as the dashboard's card keeps them, and `--header name=` drops one), `clear`, `test` (one made-up run, and what the collector answered; exit 1 when not delivered), and `clear <key>` to unset one. `set notify` merges against what is there, because the platform replaces the whole block. `providers` lists the model providers the account's files use and the last daily key check — `--check` asks now, and a dead key is a non-zero exit. `model` is what every step runs on unless a `provider:` block names another — the account's own model key, or foldrun's models: `foldrun account model` shows it (never a key, only its last four; on foldrun's models, the provider, its tier map and today's spend against the daily cap; exit 1 when runs are refused — no key, or foldrun's models refused for the account), `model set <provider> --key <api key>` sets the key — a preset name (anthropic, openrouter, openai, groq, …) or `custom --base-url https://… --format anthropic|openai`, `--key -` reads the key from stdin, and in a terminal it (or no `--key`) asks for it hidden — a pasted key works, `--use` also runs on it from now on in the same request (as `model use own`, which the dashboard's Save does) — and `model remove` removes it (the choice stays); a Claude login token is refused for any account not allowed the platform's own credential. `model use foldrun --provider <anthropic|openai|gemini|deepseek|moonshot>` runs every step on foldrun's models — the platform's keys, billed in credits at foldrun's price list, hosted only; a provider the platform cannot serve now is refused — and `model use own` goes back to the account's own key, which is kept. `model prices` (`--provider <p>`, `--json`) lists foldrun's price list as the account pays it, USD per million tokens. `export` downloads everything the platform holds about the account — workspaces, runs, members and the whole ledger — as one JSON file (owner only; `--file <path>`, `--force`). Singular — `accounts` below is the list of logins on this machine |
191
191
  | `foldrun account clear compute <vcpu\|memory\|disk>…` | drops just those figures of the account's own pool and keeps the rest (`{ compute: { diskGiB: null } }`, as the Governance card's emptied field); bare `clear compute` drops all three. `clear notify email` or `clear notify url` drops one channel and keeps the other and the events; the last channel goes with `clear notify`, which turns notify off |
192
192
  | `foldrun workspace` | one deployed workspace's own settings (`--to <workspace>`): description, timezone, budget and notify, read from its `AGENTS.md` — unset means the account's. `set timezone <tz>`, `set budget 20/week`, `set compute vcpu 2 memory 4 disk 20` (this workspace's own pool, inside the account's; any of them), `set notify email <address>` / `set notify url <https://…>` (`--events`; merged with what the file says), `set network_enforce on` (refuse a site off an agent's `network:` list here; `off` or `clear` goes back to the account's), `set owner`, `set alerts <threshold> <value>`, `set judge model|effort <value>`, and `<job>.<field>` as on `account`, `pause` (`--reason`, `--stop`) and `resume` — this workspace's kill switch, `set description "…"`, `set name <new>` — a rename changes every webhook URL, so it asks first and names the flows whose URLs changed — and `clear <key>`. Singular — `workspaces` is the list |
193
193
  | `foldrun workspace clear compute <vcpu\|memory\|disk>…` | the same for one workspace (`--to`): just those figures of its own pool, and `clear notify email\|url` for one channel of its own `notify:`, the other and the events kept |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldrun",
3
- "version": "19.0.0",
3
+ "version": "19.0.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",
package/src/commands.mjs CHANGED
@@ -2038,18 +2038,25 @@ function promptHidden(question) {
2038
2038
  stdin.resume();
2039
2039
  stdin.setEncoding("utf8");
2040
2040
  let value = "";
2041
- const onData = (ch) => {
2042
- if (ch === "\u0003") {
2043
- cleanup();
2044
- reject(new Error("cancelled"));
2045
- } else if (ch === "\r" || ch === "\n") {
2046
- cleanup();
2047
- process.stdout.write("\n");
2048
- resolve(value);
2049
- } else if (ch === "\u007f" || ch === "\b") {
2050
- value = value.slice(0, -1);
2051
- } else {
2052
- value += ch;
2041
+ // A chunk is not one key press: a pasted key arrives whole, Enter
2042
+ // included, and treating the chunk as one character never saw the Enter
2043
+ // (the prompt waited forever). Walk it a character at a time.
2044
+ const onData = (chunk) => {
2045
+ for (const ch of String(chunk)) {
2046
+ if (ch === "\u0003") {
2047
+ cleanup();
2048
+ reject(new Error("cancelled"));
2049
+ return;
2050
+ } else if (ch === "\r" || ch === "\n") {
2051
+ cleanup();
2052
+ process.stdout.write("\n");
2053
+ resolve(value);
2054
+ return;
2055
+ } else if (ch === "\u007f" || ch === "\b") {
2056
+ value = value.slice(0, -1);
2057
+ } else if (ch >= " ") {
2058
+ value += ch;
2059
+ }
2053
2060
  }
2054
2061
  };
2055
2062
  const cleanup = () => {
@@ -6388,7 +6395,8 @@ async function providersCmd(url, flags) {
6388
6395
  * foldrun account model use own back to the account's own key
6389
6396
  * foldrun account model prices [--provider <p>] foldrun's price list
6390
6397
  *
6391
- * `--key -` reads the key from stdin, so it stays out of the shell's history.
6398
+ * `--key -` reads the key from stdin, so it stays out of the shell's history;
6399
+ * in a terminal it (or no --key at all) asks for it, hidden.
6392
6400
  * The platform refuses a Claude login token for any account not allowed its
6393
6401
  * own credential: bring an API key.
6394
6402
  */
@@ -6510,8 +6518,12 @@ async function accountModelCmd(url, positional, flags) {
6510
6518
  const provider = positional[1];
6511
6519
  if (!provider) throw new Error("which provider? `foldrun account model set anthropic --key …` (a preset name, or `custom --base-url https://… --format openai`)");
6512
6520
  let apiKey = typeof flags.key === "string" ? flags.key : "";
6513
- if (apiKey === "-") apiKey = fs.readFileSync(0, "utf8").trim();
6514
- if (!apiKey) throw new Error("--key <api key> (or --key - to read it from stdin)");
6521
+ // `--key -`, or no --key at all, in a terminal: ask for it, hidden. Reading
6522
+ // fd 0 of an open terminal threw EAGAIN instead of waiting for the key.
6523
+ if (apiKey === "-" || (!apiKey && flags.key === undefined && process.stdin.isTTY)) {
6524
+ apiKey = (process.stdin.isTTY ? await promptHidden(` ${provider} API key (hidden): `) : fs.readFileSync(0, "utf8")).trim();
6525
+ }
6526
+ if (!apiKey) throw new Error("--key <api key> (or --key - to read it from stdin, or type it when asked)");
6515
6527
  const body = {
6516
6528
  provider,
6517
6529
  apiKey,