foldrun 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -114,7 +114,8 @@ declared the same way.
114
114
  |---|---|
115
115
  | `foldrun init [dir]` | create an account folder with one workspace in it (`--flat` for the old shape) |
116
116
  | `foldrun new <name>` | another workspace in this account |
117
- | `foldrun agent new <name>` | one more agent in this workspace — also `flow new <name>` and `tool new <name>` |
117
+ | `foldrun agent new <name>` | one more agent in this workspace — also `flow new <name>` and `tool new <name>`; `--platform` makes it in the deployed workspace instead |
118
+ | `foldrun agent ls` | the agents deployed in a workspace — also `flow ls`, and `agent import --list` for what could be copied in (`--to`) |
118
119
  | `foldrun flow set\|trigger\|move-step\|copy-step\|paste\|draft <flow>` | the Flows page from a terminal: step options, the trigger, a drag, copy and paste, Draft with AI — the same core rewriters, a diff, refused when `check` would call it an error (`--to <ws>` edits the deployed copy) |
119
120
  | `foldrun guide` | the coding-agent rules, as Next.js writes them: a short block in `AGENTS.md` telling Claude Code, Cursor or Codex to read `foldrun docs` before editing, and `CLAUDE.md` importing it (`@AGENTS.md`). `init` writes them, `pull` refreshes them, `check` re-adds them when a coding agent runs it; only the marked block is ever rewritten (`--check`, `--print`) |
120
121
  | `foldrun docs [page]` | foldrun's docs from the copy this CLI ships, so a coding agent reads the version it is driving, offline (`--path` prints where) |
@@ -123,7 +124,7 @@ declared the same way.
123
124
  | `foldrun agent run <name>` | run one agent once on a platform, no flow (`--task "…"`, `--wait`, `--test`) |
124
125
  | `foldrun tool test <name>` | exercise one tool alone — no model, no run (`key=value` for its args) |
125
126
  | `foldrun run <target>` | run an agent or a flow |
126
- | `foldrun eval [name]` | run one eval, or all of them |
127
+ | `foldrun eval [name]` | run one eval, or all of them — `eval new <name> --to <ws>` makes one on the platform |
127
128
  | `foldrun extract [dir]` | move single-file script tools into folders |
128
129
  | `foldrun probe <model>` | live check: can this model hold a tool loop here? |
129
130
  | `foldrun logs [run-id]` | recent runs, or one run's full event trail |
@@ -138,7 +139,7 @@ declared the same way.
138
139
  | `foldrun rerun <run-id>` | the same flow again from a step — `--from <n>` as the flow numbers them, or `--agent <name>` for the first step that agent runs; `--wait` follows it |
139
140
  | `foldrun schedule` | every flow in the account that fires on a clock, its cron line, and the next few times it fires |
140
141
  | `foldrun schedule tick` | fire whatever is due now — Settings' "Run scheduler now" |
141
- | `foldrun backups` | how the account is backed up and the snapshots it is in; `backups request --what runs --at "<when>" [--to <ws>]` asks the platform team for a restore |
142
+ | `foldrun backups` | how the account is backed up and the snapshots it is in; `backups request --what runs --at "<when>" [--to <ws>]` asks the platform team for a restore, `backups requests` lists them |
142
143
  | `foldrun restore <ws> --to <commit\|time\|3d>` | a workspace's source back as it was then — shows the change, asks for the name typed back (`--dry-run`, `--yes`) |
143
144
  | `foldrun onboarding` | the account's getting-started steps, done or not, the next one first |
144
145
  | `foldrun triggers` | why nothing ran: per flow, how often its trigger fired, how often that became a run, and every reason for the difference (`--since <days>`, `--to`) |
@@ -148,6 +149,7 @@ declared the same way.
148
149
  | `foldrun storage put <file>` | upload a file into a workspace's storage (`--as <path>` names it) — also `rm <path>` |
149
150
  | `foldrun storage share <path>` | a public link to one produced file (`--ttl <days>`, default 7; `--forever`) — also `shares` (`--all`) and `unshare <token>` |
150
151
  | `foldrun billing` | the account's balance and its recent ledger entries, with what each was for |
152
+ | `foldrun billing credit <usd>` | credit added by hand — only on an install without Stripe (self-hosted, dev) |
151
153
  | `foldrun billing plans` | the plans and this cycle's credits — also `plan <id>`, `plan cancel`, `plan resume`, `top-up <usd>`, `card` (Stripe's own pages for anything with a card) |
152
154
  | `foldrun account` | the account's defaults: timezone, notify, budget, concurrency — also `set <key> <value>` and `clear <key>` |
153
155
  | `foldrun account providers` | which model providers the account's files use and whether each key still answers (`--check` asks now) |
@@ -155,15 +157,16 @@ declared the same way.
155
157
  | `foldrun secrets clients` | OAuth clients saved on the platform — `add`, `rm`; `connect NAME --client <name>` runs a consent from one. `secrets set NAME --kind file\|ssh\|api\|service-account\|m2m` for the other shapes |
156
158
  | `foldrun deploy [dir]` | push the whole account — or `deploy <workspace>` for one of them |
157
159
  | `foldrun pull [workspace]` | bring the platform's account down here (refuses to clobber local edits) |
158
- | `foldrun status [workspace]` | per workspace: added, changed, and what moved on the platform since your last deploy |
159
- | `foldrun workspaces` | what exists here and there — also `rm <name>` (`--platform --yes` to delete it there) |
160
- | `foldrun library` | the account's shared library on the platform: `ls`, `cat`, `put`, `rm` |
160
+ | `foldrun status [workspace]` | per workspace: added, changed, and what moved on the platform since your last deploy — `--platform` for the platform's health, `--platform --history` for its daily uptime |
161
+ | `foldrun workspaces` | what exists here and there — also `show <name>` (what is deployed in it), `new <name> --platform` (`--starter`), `rm <name>` (`--platform --yes` to delete it there) |
162
+ | `foldrun library` | the account's shared library on the platform: `ls`, `cat`, `put`, `new <kind>/<name>`, `rm` |
161
163
  | `foldrun find <words>` | the dashboard's ⌘K search, across the account |
162
164
  | `foldrun history restore <path> --id <rev>` | one file back as a revision left it, as a new revision |
163
165
  | `foldrun invoke <flow>` | start a flow on a running platform (`--watch` streams its trace; `--once <key>` makes a retry a no-op rather than a second run) |
164
166
  | `foldrun open [page]` | the dashboard for this workspace, in the browser |
165
167
  | `foldrun login` | sign this machine in from the browser — no key to copy |
166
168
  | `foldrun whoami` | who you are on the platform: account, role, workspaces |
169
+ | `foldrun team` | who is in the account, their roles and workspaces — read-only; invites and role changes are a person's, in the dashboard |
167
170
  | `foldrun preferences` | your theme on the platform — `set theme system\|light\|dark` |
168
171
  | `foldrun api version` | the API version pin and rate limits — `pin <date>`, `unpin` |
169
172
  | `foldrun changelog` | the platform's release notes |
package/bin/foldrun.mjs CHANGED
@@ -22,24 +22,28 @@
22
22
  // foldrun triggers why nothing ran: fired vs started per flow, and each reason
23
23
  // foldrun webhooks <verb> deliveries / redeliver <id> — the notify: webhooks a workspace sent, and each attempt
24
24
  // foldrun notifications what mail you get, per category — set <category> on|off
25
- // foldrun backups how the account is backed up, its snapshots — request a restore from one
25
+ // foldrun flags the feature flags for this account — on or off, and why (read-only)
26
+ // foldrun backups how the account is backed up, its snapshots — request a restore from one, requests lists them
27
+ // foldrun team who is in the account, their roles and workspaces (read-only)
26
28
  // foldrun restore <ws> a workspace's source back to a point in its history (shows the change, asks)
27
29
  // foldrun onboarding the account's getting-started steps, the next one first
28
- // foldrun billing the balance, and what the money went on
30
+ // foldrun billing the balance, and what the money went on — credit <usd> on an install without Stripe
29
31
  // foldrun gallery the tools the platform ships to every account — list, pull, upgrade <tool>
30
32
  // foldrun storage <verb> ls / cat / get / put / rm / share / shares / unshare — what the agents produced, and public links to it
31
33
  // foldrun runtimes the environments a workspace's agents need, and whether each is built
32
34
  // foldrun secrets <verb> set / ls / rm — the vault, from the terminal
33
35
  // foldrun new <name> another workspace in this account
34
- // foldrun agent new <name> one more agent in this workspace — also flow new, tool new
36
+ // foldrun agent new <name> one more agent in this workspace — also flow new, tool new (--platform: in the deployed one)
37
+ // foldrun agent ls the agents deployed in a workspace — also flow ls
38
+ // foldrun eval new <name> a new eval in a deployed workspace
35
39
  // foldrun agent run <name> run one agent once on a platform, no flow
36
40
  // foldrun tool test <name> exercise one tool alone — no model, no run
37
41
  // foldrun deploy [dir] push this account — or one workspace — into an installation
38
42
  // foldrun pull bring the platform's account down into this folder
39
- // foldrun status what differs here from what is deployed
40
- // foldrun workspaces what exists here, and there
43
+ // foldrun status what differs here from what is deployed — --platform [--history]: is the platform up
44
+ // foldrun workspaces what exists here, and there — show <name>, new <name> --platform
41
45
  // foldrun invoke <flow> start a flow on a running platform
42
- // foldrun source <verb> ls / cat / put / mv / rm one workspace file on a platform
46
+ // foldrun source <verb> ls / cat / put / new / mv / rm one workspace file on a platform
43
47
  // foldrun open [page] the dashboard for this workspace
44
48
  // foldrun login sign this machine in from the browser
45
49
  // foldrun login <site> a browser window to sign in to a site by hand; the session
@@ -48,7 +52,7 @@
48
52
  // foldrun doctor what is between this terminal and the platform, checked
49
53
  // foldrun accounts every account signed in here; `use <name>` switches
50
54
  // foldrun keys <verb> ls / create / revoke — the account's API keys
51
- // foldrun library <verb> ls / cat / put / rm — the account's shared shelf on the platform
55
+ // foldrun library <verb> ls / cat / put / new / rm — the account's shared shelf on the platform
52
56
  // foldrun find <words> search the account the way the dashboard's ⌘K does
53
57
  // foldrun changelog what each release of the platform changed
54
58
  // foldrun preferences your own settings on the platform — the theme
@@ -85,20 +89,26 @@ if (command === "--version" || command === "-v") {
85
89
  const HELP = `foldrun — agents are just folders
86
90
 
87
91
  foldrun init [dir] create an account folder: AGENTS.md, library/ and workspaces/<name>
88
- foldrun new <name> another workspace in this account
92
+ foldrun new <name> another workspace in this account — blank (--starter for the example researcher, writer and flow)
89
93
  foldrun agent new <name> one more agent in this workspace (--to <workspace> in an account)
94
+ foldrun agent new <name> --platform make it in the DEPLOYED workspace, as the dashboard's New agent does (--to, --description, --model)
90
95
  foldrun flow new <name> one more flow — its first step names an agent you already have
91
- foldrun tool new <name> one more tool: a folder with its program beside it (--transport, --language)
96
+ foldrun flow new <name> --platform make it in the deployed workspace from a shape (--pattern pipeline|review-loop|fan-out|debate|router, --to)
97
+ foldrun tool new <name> one more tool: a folder with its program beside it (--transport, --language; --platform in the deployed workspace, --template <gallery entry>)
98
+ foldrun agent ls the agents deployed in a workspace: model, description (--to, --json) — flow ls the flows and how each fires
92
99
  foldrun check [dir] validate every workspace here, and the shared library
93
100
  foldrun check --to <ws> validate the DEPLOYED copy instead — fetched from the platform, checked here
94
101
  foldrun agent run <name> run one agent once on the platform (--task "…", --to, --wait, --test)
95
102
  foldrun agent link <agent> add to its team, in its frontmatter: --subagent <worker>, --consult <agent> or --can-ask (--description for a worker with none)
96
103
  foldrun agent unlink <agent> take one away: --subagent <name>, --consult <name> or --can-ask
104
+ foldrun agent import <workspace>/<agent> copy an agent you already have in another workspace into this one — its agent.md, own skills and scripts, not its memory (--as <name>, --workspace <name>; --to <ws> on the platform)
105
+ foldrun agent import --list what could be imported into a deployed workspace: every other workspace you can read, and its agents (--to, --json)
97
106
  foldrun flow add <flow> <pattern> one canvas block as a markdown edit: chain, parallel, router, fan-out, loop, approval, ask, wait, rescue, subflow — diff shown, checked, --dry-run
98
107
  foldrun flow rm-step <flow> --step <n|agent> delete one step (its options too); groups renumber, agent file untouched — says what else changes, diff, checked, asks (--yes), --dry-run
99
108
  foldrun flow dup-step <flow> --step <n|agent> copy one step (marker and options) directly under it, in parallel with it — diff, checked, --dry-run
100
109
  foldrun flow show <flow> the flow as the canvas draws it: trigger, groups, step chips, each agent's team, check problems in place
101
110
  foldrun flow run <flow> start a flow on the platform — the same command as invoke
111
+ foldrun flow hook <flow> the flow's webhook URL as it is now, changing nothing (--json) — the URL is a credential
102
112
  foldrun flow rotate-hook <flow> a new webhook URL for a flow; the old one stops at once — asks first, --yes means it
103
113
  foldrun flow set <flow> --step <n|agent> key=value … the step editor: model, effort, retry, timeout, verify, when, case, else, loop, until, each, max, limits, instruction (key= clears) — diff, checked, --dry-run
104
114
  foldrun flow trigger <flow> manual|webhook|schedule the trigger picker (--schedule "<cron>", --timezone <zone>) — diff, checked, --dry-run
@@ -110,6 +120,7 @@ const HELP = `foldrun — agents are just folders
110
120
  foldrun extract [dir] move single-file script tools into folders (tool.md + run.*)
111
121
  foldrun run <target> run an agent or flow HERE (target: name, or flow:name) — on the platform: flow run / invoke a flow, agent run one agent
112
122
  foldrun eval [name] run one eval, or all of them (--to <workspace>: the deployed evals, run on the platform)
123
+ foldrun eval new <name> a new eval in the deployed workspace, its agent the first one there — edit its cases, then eval <name> --to (--to)
113
124
  foldrun promote <run-id> keep a finished run as a regression case in evals/ (--eval <name>, --expect "contains: …" repeatable, --case <name>)
114
125
  foldrun probe <model> live check: can this model hold a tool loop here?
115
126
  foldrun logs [run-id] recent runs in one workspace, or one run's full event trail (--local: this machine's)
@@ -119,14 +130,14 @@ const HELP = `foldrun — agents are just folders
119
130
  foldrun report <run-id> get <agent>/<path> download a file the run archived from that agent's outputs/ (--file <path>|-, --force)
120
131
  foldrun report <run-id> live the live browser view: which agents have a frame; --agent <name> saves the newest as a JPEG (--file <path>|-)
121
132
  foldrun approvals every gate waiting on a person, with its question (--to <workspace> for one)
122
- foldrun approve <run-id> release a waiting gate — asks first, --yes means it, --note "…" steers the step
133
+ foldrun approve <run-id> release a waiting gate — asks first, --yes means it, --note "…" steers the step; --payload releases a wait: event step
123
134
  foldrun reject <run-id> refuse one, with --note as the reason
124
135
  foldrun stop <run-id> kill a run in flight — asks first, --yes means it
125
- foldrun stop --status running [--since 2h] [--flow f] every run a filter matches (runs/bulk): lists them, asks, stops only those (--dry-run, --to)
136
+ foldrun stop --status running [--since 2h] [--until 1h] [--flow f] every run a filter matches (runs/bulk): lists them, asks, stops only those (--dry-run, --to)
126
137
  foldrun answer <run-id> "…" answer the question an agent is asking mid-step (--option <n> picks a choice)
127
138
  foldrun message <run-id> "…" say something to a running agent — it hears it after its next tool call
128
139
  foldrun rerun <run-id> run it again from a step (--from <n>) or from an agent's step (--agent <name>); --wait
129
- foldrun rerun --status failed [--since 24h] [--flow f] rerun every run a filter matches, from --from <n> (default 1) — lists, asks (--dry-run, --to)
140
+ foldrun rerun --status failed [--since 24h] [--until 2h] [--flow f] rerun every run a filter matches, from --from <n> (default 1) — lists, asks (--dry-run, --to)
130
141
  foldrun observe where the account fails, retries and spends, per workspace (--to <workspace> in full, --since <days>, --json)
131
142
  foldrun usage what the account consumed, and what it was charged week by week (--days <n>, --json)
132
143
  foldrun schedule every flow that fires on a clock, its cron line and the next times (--to <workspace>)
@@ -144,9 +155,11 @@ const HELP = `foldrun — agents are just folders
144
155
  foldrun billing plans the plans, which one the account is on and this cycle's credits — also plan <id>, plan cancel, plan resume (asks first)
145
156
  foldrun billing top-up <usd> Stripe's checkout page for adding credit (owner only; --no-browser prints it)
146
157
  foldrun billing card Stripe's page for saving a card for auto top-up (owner only)
158
+ foldrun billing credit <usd> put credit on the balance by hand (--note "…") — only on an install without Stripe (self-hosted, dev); refused once billing is live
147
159
  foldrun gallery the platform's built-in tools (web) and whether you keep your own copy — also pull (a copy for offline runs), upgrade <tool>
148
160
  foldrun account the account's defaults — also set <key> <value>, clear <key>, providers (--check) (singular; accounts lists logins)
149
161
  foldrun account export everything the platform holds about the account as one JSON file (owner only; --file <path>, --force)
162
+ foldrun account model the account's own model key — set <provider> --key <api key> (--key - reads stdin; custom --base-url --format), remove
150
163
  foldrun workspace one deployed workspace's settings (--to) — also set <name|description|timezone|budget|notify> <value>, clear <key>
151
164
  foldrun workspace vocabulary the names the dashboard's editor completes in a workspace: agents, flows, skills, tools, secrets, scripts, types, documents (--to, --json)
152
165
  foldrun notify test send one test notification from a workspace and say what happened (--to <workspace>)
@@ -154,24 +167,33 @@ const HELP = `foldrun — agents are just folders
154
167
  foldrun webhooks redeliver <id> send one delivery again now, same X-Foldrun-Delivery id; exits 1 when refused (--to)
155
168
  foldrun notifications what mail you get, category by category, and which are always sent (--json)
156
169
  foldrun notifications set <category> on|off turn one off or back on — account-wide, or --to <workspace> for run-alerts and approvals
170
+ foldrun flags the feature flags for this account: each on or off, and why — set for this account, for every account, a staged rollout, or the default (--json). Read-only: the platform's super admin changes them
157
171
  foldrun history [path] every change to a deployed workspace, newest first (--id <revision> for its diff, --limit, --to)
158
172
  foldrun history restore <path> --id <revision> put one file back as that revision left it, as a new revision — diff, asks (--yes, --dry-run, --to)
159
173
  foldrun repo ls a workspace's branches and tags — also diff <branch>, deploy <ref>, merge <branch> (both ask first), rm-branch <branch>, mirror <git-url|off>, mirror-now (--to)
160
174
  foldrun restore <ws> --to <commit|time|3d> put a workspace's source back as it was then — shows the change, asks for the name typed back (--dry-run: the diff only, --yes)
161
175
  foldrun backups how the account is backed up (encrypted?), when it last was, the snapshots it is in — also request --what runs|state|storage|everything --at "<when>" [--to <ws>] [--note]
176
+ foldrun backups requests every restore asked of the platform team, and where each stands (--json)
162
177
  foldrun secrets set NAME store a secret (prompted, never echoed) — also ls, rm, status; --kind file|ssh|api|service-account|m2m for the other shapes
163
178
  foldrun secrets clients the OAuth clients saved on the platform — also add <name> (--provider or --authorize-url/--token-url, --client-id, --scopes), rm <name>
164
179
  foldrun connect NAME OAuth sign-in from the terminal, stored as an auto-refreshing secret — --client <saved> runs it from a saved client through the platform
165
180
  foldrun deploy [dir] push the whole account, or deploy <workspace> for one of them
166
181
  foldrun pull [workspace] bring the platform's account down here (refuses to clobber; --force overrides)
182
+ foldrun export [workspace] a deployed workspace as a .zip — agents, flows, tools, skills, scripts, evals, knowledge; never memory, state or secret values (--flow <name> or --agent <name> for one, with what it needs; --file <path>|-, --force)
183
+ foldrun import <file.zip> take a package in: shows what it adds, would replace and still needs, then asks (--to <workspace>; a new name makes a workspace; --dry-run, --overwrite, --yes, --json)
167
184
  foldrun status [workspace] per workspace: what is added, changed or gone since the last deploy
168
185
  foldrun status --platform is the platform up: each component, and any incident or maintenance posted (--json)
169
- foldrun workspaces what exists here and on the platform — also rm <name> (--platform --yes)
186
+ foldrun status --platform --history uptime per component per day and the incidents in the window, as the status page's bars (--days 1-90, default 90; --json)
187
+ foldrun workspaces what exists here and on the platform (--json for a script) — also rm <name> (--platform --yes)
188
+ foldrun workspaces show <name> what is deployed in one: its agents, flows and how each fires, its files by folder (--json)
189
+ foldrun workspaces new <name> --platform make it on the platform: blank (an AGENTS.md), or --starter for the example researcher, writer and flow
170
190
  foldrun workspaces demo make the demo pipeline workspace on the platform — "Try the demo pipeline"
171
- foldrun library the account's shared library on the platform: ls [skills|tools|scripts|knowledge], cat <kind>/<path>, put <kind>/<path> (--file, else stdin), rm <kind>/<path> (asks)
191
+ foldrun library the account's shared library on the platform: ls [skills|tools|scripts|knowledge|memory], cat <kind>/<path>, put <kind>/<path> (--file, else stdin), rm <kind>/<path> (asks)
192
+ foldrun library new <kind>/<name> a new one from the platform's template, as the Library page's New (--template <transport or gallery entry>, --language)
172
193
  foldrun find <words> search the account as the dashboard's ⌘K does: workspaces, agents, flows, tools, skills, knowledge, memory, runs (--json)
173
194
  foldrun invoke <flow> start a flow on a running platform (--to <workspace>; --once <key> so a retry never starts a second run; --tag <t> repeatable)
174
195
  foldrun source <verb> the files on a platform, one at a time: ls, cat <path>, put <path>, mv, rm (--to <workspace>)
196
+ foldrun source new <kind> <name> the dashboard's New for any document — tools, knowledge, memory, skills, scripts (agents, flows, evals too): the platform writes the template (--agent <a> inside one agent, --template, --language, --to)
175
197
  foldrun open [page] the dashboard for this workspace, in the browser
176
198
  foldrun api spec the platform's OpenAPI 3.1 document (GET /api/openapi.json) — stdout, or --out <file>
177
199
  foldrun api version the API version this account's requests get, the versions served, the rate limits — also pin <YYYY-MM-DD>, unpin (admin; --json)
@@ -185,6 +207,7 @@ Signing in
185
207
  session: cookies, storage and the browser identity it needs
186
208
  foldrun logout forget this machine's key, and revoke it where allowed
187
209
  foldrun whoami who you are on the platform: account, role, workspaces
210
+ foldrun team who is in the account: role, the workspaces each may open, when they joined (--json). Read-only: invites, roles, removal and transfer are a signed-in person's, in Settings → Team
188
211
  foldrun onboarding the account's getting-started steps, done or not, the next one first (--json)
189
212
  foldrun preferences your own settings on the platform — the theme; set theme system|light|dark (a key acts for whoever minted it)
190
213
  foldrun doctor check the path to the platform: node, CLI, model credential, account, DNS, a timed /api/healthz
@@ -198,9 +221,10 @@ Signing in
198
221
  Options
199
222
  --workspace <dir> the workspace folder (default: .) — on init, the first workspace's name
200
223
  --flat init: the old single-folder shape, no account around it
201
- --from <template> init: start from a shipped template, e.g. templates/hello
224
+ --from <template> init: start from a shipped template, e.g. templates/hello (new takes it too)
225
+ --starter new, workspaces new: include the example researcher, writer and publish flow (a new workspace is blank)
202
226
  --transport <k> tool new: script (default), http or mcp
203
- --language <l> tool new: the script's language — javascript, python, bash
227
+ --language <l> tool new, source new, library new: the script's language — javascript, python, bash
204
228
  --task "<text>" the instruction for a manual run
205
229
  --test run, invoke: a test run — nothing outward, state/ untouched, receipts on the run page
206
230
  --follow logs: keep tailing a live run (with --url: on the platform)
@@ -210,9 +234,10 @@ Options
210
234
  --action <a> audit: one action (apikey.created) or a family (apikey, secret, member, support)
211
235
  --actor <who> audit: one person or key — an email, key:<label>, support:<email>
212
236
  --since <days> observe, triggers: the window in days (observe default 30, triggers 7)
237
+ --until <span|date> stop, rerun (bulk): only runs started before then — 2h ago, or a date
213
238
  --verdict <v> runs: only completed runs whose summary leads with it — good, bad, quiet, blocked (comma-separated)
214
- --flow <name> stop, rerun: only that flow's runs; flow add: the other flow a subflow step runs; flow draft: the existing flow to redraft
215
- --agent <name> flow add: the agent a chain, parallel or router step runs; rerun: from the first step that agent runs; report live: whose browser frame
239
+ --flow <name> export: that flow and everything it runs; stop, rerun: only that flow's runs; flow add: the other flow a subflow step runs; flow draft: the existing flow to redraft
240
+ --agent <name> export: that agent and what it grants; flow add: the agent a chain, parallel or router step runs; rerun: from the first step that agent runs; report live: whose browser frame; source new: the agent the document belongs to
216
241
  --instruction "<text>" flow add: what a new step (chain, parallel, router) is told to do
217
242
  --after <n> flow add, flow move-step, flow paste: put the new group after the nth (0 = first); --before <n> before it (flow add); default last
218
243
  --group <n> flow add, flow move-step, flow paste: the group a step joins, in parallel
@@ -230,7 +255,12 @@ Options
230
255
  --subagent <name> agent link, agent unlink: a worker it delegates to (subagents:)
231
256
  --consult <name> agent link, agent unlink: a colleague it asks (agents:)
232
257
  --can-ask agent link, agent unlink: ask in its tools — it may ask you mid-step
233
- --description "<text>" agent link: what a --subagent is for, when its file has no description:
258
+ --description "<text>" agent link: what a --subagent is for, when its file has no description:; agent new --platform: its one line
259
+ --model <tier> agent new --platform: fast, default or max
260
+ --pattern <p> flow new --platform: pipeline (default), review-loop, fan-out, debate or router
261
+ --template <t> tool new --platform, source new, library new: a transport (script, http, mcp) or a gallery entry to start from
262
+ --list agent import: list what could be imported, import nothing
263
+ --history status --platform: the daily uptime and incidents, not just now
234
264
  --eval <name> promote: the eval file to write to (default <target>-regressions)
235
265
  --expect "<line>" promote: an assertion in eval syntax (contains: …, judge: …) — repeatable
236
266
  --case <name> promote: the case's name
@@ -241,20 +271,21 @@ Options
241
271
  --csv audit: the log as CSV, for an auditor (--file <path> to save it)
242
272
  --threshold / --amount billing wallet set: auto top-up refills --amount (5-500 USD) when the balance falls below --threshold
243
273
  --name / --abn / --address / --email billing details set: the invoice's legal name, ABN, "line1, city, state, postcode, AU", receipt email
244
- --days <n> usage: the window the charges cover (default 56)
274
+ --days <n> usage: the window the charges cover (default 56); status --platform --history: 1-90 (default 90)
245
275
  --id <revision> history: one revision in full, as diffs
246
276
  --engine <e> login: (with a site) the browser to sign in with — chrome (default: real Google Chrome, Chromium when it is not installed), chromium, firefox or safari
247
277
  --new-client connect: enter a new OAuth client even when one is saved for the secret
248
278
  --step <n> approve, reject: decide only that step; default is every step that is waiting
249
- --note "<text>" approve, reject: guidance the agent reads — or the reason for a refusal
250
- --yes approve, stop, rerun (bulk), flow rotate-hook, flow draft, history restore, restore <ws>, billing plan, repo, workspace set name, and every rm/revoke/unshare: skip the confirmation, deliberately (required with no terminal)
251
- --json report: the raw run record instead of the report; observe, usage, api version, changelog, find, preferences, workspace vocabulary: the raw document; version: {cli, core, platform}
279
+ --payload <json|text|@f> approve: release a step waiting on wait: event with this body, recorded as you
280
+ --note "<text>" approve, reject: guidance the agent reads — or the reason for a refusal; billing credit: the ledger line's note
281
+ --yes approve, stop, rerun (bulk), flow rotate-hook, flow draft, history restore, restore <ws>, import, billing plan, repo, workspace set name, and every rm/revoke/unshare: skip the confirmation, deliberately (required with no terminal)
282
+ --json report: the raw run record instead of the report; observe, usage, api version, changelog, find, preferences, workspace vocabulary, flags, workspaces, workspaces show, agent ls, flow ls, agent import --list, backups requests, team: the raw document; version: {cli, core, platform}
252
283
  --events <a,b> account set notify: failed, awaiting-approval, completed
253
284
  --failed webhooks deliveries: only the ones that gave up
254
285
  --limit <n> runs, billing, history, changelog: how many rows
255
286
  --value "<text>" secrets set: skip the prompt (careful with shell history)
256
287
  --out <file> api spec: where to write the OpenAPI document (default: stdout)
257
- --file <path> source put, library put, flow paste: the local file to send (default: stdin); secrets set --kind file|service-account: the file it holds; storage get, report get, report live, account export, billing statement: where to write it (- for stdout)
288
+ --file <path> source put, library put, flow paste: the local file to send (default: stdin); secrets set --kind file|service-account: the file it holds; storage get, report get, report live, account export, export, billing statement: where to write it (- for stdout)
258
289
  --message "<why>" source put: recorded on the file's revision
259
290
  --account secrets: account scope instead of the workspace's
260
291
  --wait invoke, agent run: hold on and print the result
@@ -285,11 +316,13 @@ Platform options (deploy, invoke, secrets, logs, keys)
285
316
  --quiet leave out the dim "acting as …" line a platform command prints on stderr
286
317
  --local deploy: into the installation on this machine, even when signed in
287
318
  --commit <sha> deploy: record which commit this is
288
- --dry-run deploy: check and report, change nothing; flow add, flow set, flow trigger, flow move-step, flow paste, flow draft, history restore, agent link, agent unlink: show the diff, write nothing; restore <ws>: the diff only, restore nothing; stop, rerun (bulk): list what matches, touch nothing
319
+ --overwrite import: replace files the workspace already has with different text (refused otherwise)
320
+ --dry-run deploy: check and report, change nothing; flow add, flow set, flow trigger, flow move-step, flow paste, flow draft, history restore, agent link, agent unlink: show the diff, write nothing; restore <ws>: the diff only, restore nothing; import: the preview only, write nothing; stop, rerun (bulk): list what matches, touch nothing
289
321
  --no-runtimes deploy: do not wait for the workspace's environments to be built
290
322
  --force deploy: deploy even while runs are in flight; pull, storage get: overwrite local files
291
323
  --yes deploy: allow deleting files this folder no longer has (asked otherwise; required with no terminal)
292
324
  --platform --yes workspaces rm: delete it on the platform, deliberately
325
+ --platform workspaces new, agent new, flow new, tool new: make it on the platform, not in this folder
293
326
 
294
327
  Nothing here needs an account. Set ANTHROPIC_API_KEY to run; init and check
295
328
  work without one. \`foldrun login\` is for the hosted platform, or your own.`;
@@ -305,7 +338,7 @@ if (!command || command === "--help" || command === "-h") {
305
338
  // `--value` as the account's argument and stored an empty secret; `--force
306
339
  // ./dir` swallowed the directory. A flag followed by another flag is also
307
340
  // boolean, so an unlisted switch at least does not eat its neighbour.
308
- const BOOLEAN_FLAGS = new Set(["account", "follow", "force", "oauth2", "wait", "watch", "print", "dry-run", "help", "no-browser", "local", "test", "flat", "yes", "platform", "json", "forever", "all", "check", "new-client", "quiet", "off", "can-ask", "preview", "csv", "failed"]);
341
+ const BOOLEAN_FLAGS = new Set(["account", "follow", "force", "oauth2", "wait", "watch", "print", "dry-run", "help", "no-browser", "local", "test", "flat", "yes", "platform", "json", "forever", "all", "check", "new-client", "quiet", "off", "can-ask", "preview", "csv", "failed", "starter", "history", "list"]);
309
342
  // Flags said more than once collect into a list: `--tag a --tag b`.
310
343
  const REPEATABLE = new Set(["tag", "expect", "header"]);
311
344
  // `--wait` is a switch everywhere but `flow add <flow> wait`, where it takes
package/docs/agents.md CHANGED
@@ -75,11 +75,12 @@ only Web takes a provider:
75
75
  | **Web** | `web` | eight actions — search, fetch, browse, crawl, map, extract, answer, monitor | one per action under `web:` — unset is ours |
76
76
  | **Files** | `read` | Read, Glob, Grep — inspect but never modify | — |
77
77
  | | `write` | Read, Write, Edit, Glob, Grep | — |
78
- | **Code** | `code` | Bash — runs anything in the sandbox: Python and Node (packages via `runtime:`), or a binary you ship | — |
78
+ | **Code** | `code` | Bash — runs anything in the sandbox: Python and Node (packages via `runtime:`), Debian programs (`runtime: system:`), or a binary you ship | — |
79
79
  | **Memory** | `search` | `search_files(query)` over knowledge, memory, state and storage at every scope | — |
80
80
  | | `history` | `recall_runs()` and `read_run(id)` — the workspace's last thirty finished runs | — |
81
81
  | | `desks` | `recall_desk_runs()` and `read_desk_run(id)` — the same, across the account's *other* workspaces: ten recent runs each, named per line, up to 100 runs in all. Run records, not files: the way a digest agent reads what every desk concluded this week | — |
82
82
  | **People** | `ask` | `ask_person(question, options?)` — asks the person running the desk mid-step and waits for the answer ([below](#asking-a-person-mid-step)) | — |
83
+ | **Installing** | `install` — every agent has it | `install(manager, packages)` — installs a missing program or library mid-step: Debian packages (`apt`), Python (`pip`), Node (`npm`) ([below](#installing-what-a-step-needs)) | `disallowedTools: [install]` removes it |
83
84
  | **Colleagues** | `agents:` · `subagents:` | not in `tools:` — their own fields: consult a colleague for an answer, or delegate a job to one that works with its own tools ([consult](#consulting-colleagues), [delegate](#delegating-to-a-sub-agent)) | — |
84
85
 
85
86
  ### Asking a person mid-step
@@ -197,7 +198,7 @@ its tools inside the delegating agent's.
197
198
  | field | |
198
199
  |---|---|
199
200
  | `size` | `small` \| `large` (default) \| `heavy` — the sandbox reservation |
200
- | `runtime` | language runtimes and packages the agent's own scripts need |
201
+ | `runtime` | language runtimes, packages and Debian system packages the agent's own scripts need |
201
202
 
202
203
  `size` is a price, not just a limit. Memory is a **hard ceiling** because it is
203
204
  not compressible: a step over it is killed, which on a single-node host
@@ -212,14 +213,42 @@ runtime:
212
213
  packages: [pandas] # pip, installed with uv
213
214
  node: true
214
215
  npm: [cheerio]
216
+ system: [ffmpeg, libcairo2-dev] # Debian packages, installed with apt
215
217
  ```
216
218
 
219
+ `system:` takes Debian (trixie) package names — a program (`ffmpeg`), a
220
+ library's headers for a pip package that compiles (`libcairo2-dev`,
221
+ `python3-dev`), a compiler (`build-essential`), `pkg-config`. They are
222
+ installed by the run container's start-up, as root, **before** anything the
223
+ model directs runs, and the step then runs as the unprivileged agent user as
224
+ always. A name is checked against Debian's own naming rule, so it can never
225
+ become an apt option. The first step that needs a set installs it with apt and
226
+ saves the result as a snapshot in the account's runtime cache; every later
227
+ step restores the snapshot instead, in about a second (154 packages, 432 MB:
228
+ 30 s through apt, under 1 s from the snapshot). A new runner image gets new
229
+ snapshots of its own, never the old one's files. The run log says
230
+ `system packages ready: … (snapshot, 1s)` or `(apt, 30s)`, or fails the step
231
+ with apt's own reason. On a laptop (`foldrun run` with no container) there is nothing to
232
+ install into: the list is reported as assumed present.
233
+
234
+ Manim, for one, needs all four of its kinds at once:
235
+
236
+ ```yaml
237
+ runtime:
238
+ system: [build-essential, pkg-config, python3-dev, libcairo2-dev, libpango1.0-dev]
239
+ packages: [manim]
240
+ ```
241
+
242
+ A package that fails to install says why on the first line of the run log —
243
+ `` `pycairo` has to be compiled and this runner has no C compiler — add
244
+ `system: [build-essential]` … `` — with the installer's last lines under it.
245
+
217
246
  An agent's own runtime and the runtimes of the tools it grants merge into one
218
247
  environment per step, so a tool carries its own dependencies and the agent
219
248
  does not repeat them.
220
249
 
221
250
  The image a step runs in is small on purpose: an interpreter, `uv`, `npm`,
222
- and none of the world's packages. What a step needs arrives through
251
+ and none of the world's packages — no compiler, no media tools. What a step needs arrives through
223
252
  `runtime:` — built once per distinct declaration, kept in the account's
224
253
  cache, and reused by every later step and every agent that declares the same
225
254
  thing. The environment comes first on `PATH`, so a tool file that says
@@ -238,9 +267,40 @@ none — no environment is built for them.
238
267
  On a platform, a deploy builds the environments its agents need before any
239
268
  step does: `foldrun deploy` waits for them and prints each one, ready or
240
269
  failed with the installer's own error, and `foldrun runtimes` asks again
241
- later. A package that will not install is heard at deploy, not from the
270
+ later — as does the **Runtimes** panel on the workspace's overview page. A package that will not install is heard at deploy, not from the
242
271
  first scheduled run.
243
272
 
273
+ ## Installing what a step needs
274
+
275
+ An agent does not have to know in advance what it will need. Every agent has
276
+ `install`, and when a command says `ffmpeg: command not found` or a script
277
+ says `No module named manim`, the agent installs it and carries on:
278
+
279
+ ```
280
+ install(manager: "apt", packages: ["ffmpeg"]) # Debian programs and libraries
281
+ install(manager: "pip", packages: ["manim>=0.19"]) # Python packages
282
+ install(manager: "npm", packages: ["sharp"]) # Node packages
283
+ ```
284
+
285
+ What it installs is usable by its next command — on `PATH`, importable — and
286
+ lasts for the step: the step's container, and everything installed in it, is
287
+ destroyed when the step ends.
288
+
289
+ The agent is never root. A Debian package is installed by a small helper the
290
+ container's root start-up leaves running before it drops to the agent user;
291
+ the agent can only ask it, by name, and each name is checked against Debian's
292
+ naming rule, so nothing but a package name reaches apt. It uses the same cache
293
+ and snapshots as `runtime: system:`, so a package anyone in the account
294
+ installed before is back in about a second. pip and npm packages need no root
295
+ and are installed as the agent, into a directory of the step's own.
296
+
297
+ Each install is in the run log with the line that would have it ready before
298
+ the step starts — `install: apt ffmpeg — ready (snapshot, 1s). To have it
299
+ before the step starts: runtime: system: [ffmpeg]`. Moving it into `runtime:`
300
+ is a speed-up, never a requirement. `disallowedTools: [install]` takes the
301
+ tool away; `permissionMode: plan` has no `install`, being read-only. On a
302
+ laptop (`foldrun run`, no container) pip and npm work and apt says it can't.
303
+
244
304
  ## Its own model credential
245
305
 
246
306
  ```yaml
package/docs/api-usage.md CHANGED
@@ -98,8 +98,9 @@ behind its own gateway).
98
98
  ## Retrying safely: Idempotency-Key
99
99
 
100
100
  The `POST`s that start or change something — run a flow, agent or eval,
101
- rerun, deploy, upload an asset, create a flow, set a secret, mint a key,
102
- approve, answer or message a run, billing actions — accept
101
+ rerun, stop, deploy, upload an asset, create, draft or append to a flow,
102
+ set a secret, mint a key, rotate a webhook, send a test notify, connect an
103
+ OAuth client, approve, answer or message a run, billing actions — accept
103
104
 
104
105
  ```
105
106
  Idempotency-Key: <a UUID you generate, one per operation>
@@ -117,7 +118,7 @@ Idempotency-Key: <a UUID you generate, one per operation>
117
118
  key for at most two minutes, then the key is free for a real retry.
118
119
  - Minting or rotating a key: a replay says what was done but its `key` is
119
120
  `null` — the secret is shown once and never stored. Revoke that key and
120
- mint another.
121
+ mint another. Rotating a webhook is the same: a replay's `path` is `null`.
121
122
 
122
123
  Keys belong to the caller — your account and the API key or person sending
123
124
  them; another key of the same account never gets your stored answer — and to