foldrun 0.6.0 → 0.7.2

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
@@ -25,18 +25,36 @@ Requires Node 22 or newer. `init` and `check` need no API key.
25
25
 
26
26
  ## What `init` gives you
27
27
 
28
+ An **account folder** — the same shape the platform keeps, so what you reason
29
+ about locally is what runs there:
30
+
28
31
  ```
29
- competitor-watch/
30
- ├── AGENTS.md what every agent here shares
31
- ├── agents/
32
- │ ├── researcher/agent.md
33
- │ └── writer/agent.md
34
- ├── flows/publish.md the steps, in order
35
- ├── knowledge/house-style.md given to them; they may read, never write
36
- ├── memory/what-worked.md what they learned; they write here
37
- └── evals/writer-quality.md what "good" means, as a test
32
+ competitor-watch/ the account
33
+ ├── AGENTS.md config and context every workspace inherits
34
+ ├── library/ skills, tools, scripts, knowledge shared by all of them
35
+ │ ├── skills/ tools/ scripts/
36
+ │ └── knowledge/ memory/
37
+ └── workspaces/
38
+ └── main/ the first workspace, ready to run
39
+ ├── AGENTS.md what every agent HERE shares
40
+ ├── agents/
41
+ │ ├── researcher/agent.md
42
+ │ └── writer/agent.md
43
+ ├── flows/publish.md the steps, in order
44
+ ├── knowledge/house-style.md given to them; they may read, never write
45
+ ├── memory/what-worked.md what they learned; they write here
46
+ └── evals/writer-quality.md what "good" means, as a test
38
47
  ```
39
48
 
49
+ `--workspace <name>` names that first workspace (default `main`), and
50
+ `foldrun new <name>` adds another beside it. Every workspace in the account
51
+ resolves `skills:`, `tools:` and `scripts:` against the shared `library/`,
52
+ nearest-wins — its own file first, the library second.
53
+
54
+ `foldrun init --flat <dir>` makes the older single-folder shape instead: no
55
+ account around it, `agents/` and `flows/` at the root. **Every command still
56
+ reads that shape**, unchanged, so a folder made before today keeps working.
57
+
40
58
  An agent is frontmatter for the machine and prose for the model:
41
59
 
42
60
  ```markdown
@@ -94,24 +112,77 @@ declared the same way.
94
112
 
95
113
  | | |
96
114
  |---|---|
97
- | `foldrun init [dir]` | create a workspace you can run immediately |
98
- | `foldrun check [dir]` | validate agents, flows, tools, evals and knowledge |
115
+ | `foldrun init [dir]` | create an account folder with one workspace in it (`--flat` for the old shape) |
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>` |
118
+ | `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
+ | `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
+ | `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) |
121
+ | `foldrun check [dir]` | validate every workspace here, and the shared library |
122
+ | `foldrun check --to <ws>` | validate the copy that is DEPLOYED — fetched from the platform, checked by the same rules |
123
+ | `foldrun agent run <name>` | run one agent once on a platform, no flow (`--task "…"`, `--wait`, `--test`) |
124
+ | `foldrun tool test <name>` | exercise one tool alone — no model, no run (`key=value` for its args) |
99
125
  | `foldrun run <target>` | run an agent or a flow |
100
126
  | `foldrun eval [name]` | run one eval, or all of them |
101
127
  | `foldrun extract [dir]` | move single-file script tools into folders |
102
128
  | `foldrun probe <model>` | live check: can this model hold a tool loop here? |
103
129
  | `foldrun logs [run-id]` | recent runs, or one run's full event trail |
130
+ | `foldrun runs` | what has run lately, across the account — `--status`, `--since`, `--to`, `--limit` |
131
+ | `foldrun report <run-id>` | one run, whole: every step, what it cost, what it wrote, what is still waiting (`--json` for the record) |
132
+ | `foldrun approvals` | every gate waiting on a person, with its question and what it previews |
133
+ | `foldrun approve <run-id>` | release a waiting gate — it asks first, `--yes` means it, `--note "…"` steers the step |
134
+ | `foldrun reject <run-id>` | refuse one, `--note` being the reason |
135
+ | `foldrun stop <run-id>` | kill a run in flight — it says what it will destroy, then asks (`--yes` means it) |
136
+ | `foldrun answer <run-id> "…"` | answer the question an agent is asking mid-step (`--option <n>` picks a choice) |
137
+ | `foldrun message <run-id> "…"` | say something to a running agent — it hears it after its next tool call |
138
+ | `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
+ | `foldrun schedule` | every flow in the account that fires on a clock, its cron line, and the next few times it fires |
140
+ | `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 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
+ | `foldrun onboarding` | the account's getting-started steps, done or not, the next one first |
144
+ | `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`) |
145
+ | `foldrun webhooks deliveries` | the `notify:` webhooks a workspace sent: status, attempts, the last answer (`--failed`, `--to`) — and `redeliver <id>` to send one again |
146
+ | `foldrun notifications` | what mail you get, per category; `set <category> on\|off` (`--to <workspace>` for run alerts and approvals) — security, invites, billing and account mail are always sent |
147
+ | `foldrun storage <verb>` | what a workspace produced: `ls [prefix]`, `cat <path>`, `get <path>` — with when each file was written and which run wrote it. `put <file|folder>...` uploads any files (`--into <folder/>`, `--as <path>` for one), `rm <path>` removes one, and `share`, `shares`, `unshare` manage public links |
148
+ | `foldrun storage put <file>` | upload a file into a workspace's storage (`--as <path>` names it) — also `rm <path>` |
149
+ | `foldrun storage share <path>` | a public link to one produced file (`--ttl <days>`, default 7; `--forever`) — also `shares` (`--all`) and `unshare <token>` |
150
+ | `foldrun billing` | the account's balance and its recent ledger entries, with what each was for |
151
+ | `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
+ | `foldrun account` | the account's defaults: timezone, notify, budget, concurrency — also `set <key> <value>` and `clear <key>` |
153
+ | `foldrun account providers` | which model providers the account's files use and whether each key still answers (`--check` asks now) |
104
154
  | `foldrun secrets set NAME` | store a secret, prompted and never echoed |
105
- | `foldrun deploy [dir]` | push a workspace into an installation |
106
- | `foldrun invoke <flow>` | start a flow on a running platform (`--watch` streams its trace) |
155
+ | `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
+ | `foldrun deploy [dir]` | push the whole account — or `deploy <workspace>` for one of them |
157
+ | `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` |
161
+ | `foldrun find <words>` | the dashboard's ⌘K search, across the account |
162
+ | `foldrun history restore <path> --id <rev>` | one file back as a revision left it, as a new revision |
163
+ | `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) |
107
164
  | `foldrun open [page]` | the dashboard for this workspace, in the browser |
108
165
  | `foldrun login` | sign this machine in from the browser — no key to copy |
109
166
  | `foldrun whoami` | who you are on the platform: account, role, workspaces |
167
+ | `foldrun preferences` | your theme on the platform — `set theme system\|light\|dark` |
168
+ | `foldrun api version` | the API version pin and rate limits — `pin <date>`, `unpin` |
169
+ | `foldrun changelog` | the platform's release notes |
110
170
  | `foldrun doctor` | check the path to the platform: node, CLI, account, DNS, a timed `/api/healthz` — exit 1 if any line fails |
111
171
  | `foldrun keys ls` | the account's API keys — also `create <label>`, `revoke <id>` |
112
172
 
113
173
  `foldrun --help` lists every flag.
114
174
 
175
+ `foldrun tool test <name> --to <workspace> key=value` is how you find out a
176
+ tool works before a flow depends on it. It runs the real thing — the HTTP
177
+ request, the script, the MCP handshake — and prints what the tool printed, how
178
+ long it took, and any secret it needed by NAME and never by value. It waits
179
+ five minutes by default, because a tool that scrapes or crawls takes as long as
180
+ it takes; `--timeout <seconds>` waits longer.
181
+
182
+ `foldrun agent run <name> --to <workspace> --task "…"` runs one agent once, as
183
+ a flow of one step with no flow file. It prints the run id and how to follow
184
+ it; `--wait` holds on and prints the same report `foldrun report` would.
185
+
115
186
  **`check` is the one to run in CI.** It costs nothing and catches what
116
187
  otherwise surfaces as a confidently wrong answer at 3am: a step naming an agent
117
188
  that doesn't exist, a tool whose program isn't on disk, an eval pointing at a
@@ -134,10 +205,21 @@ an API and never reach the model.
134
205
 
135
206
  ## Running it somewhere else
136
207
 
137
- `foldrun deploy` pushes a workspace into an installation — your own, or a
208
+ `foldrun deploy` pushes this account into an installation — your own, or a
138
209
  hosted one — and `foldrun invoke <flow> --wait` starts a flow there and prints
139
210
  the result. A deploy never touches run history, state, secrets, or memory an
140
- agent wrote: those belong to the installation, not to your git repo.
211
+ agent wrote: those belong to the installation, not to your git repo. It never
212
+ removes a workspace either: one that exists on the platform and not in your
213
+ folder is left exactly as it is, and `foldrun workspaces rm <name> --platform
214
+ --yes` is the deliberate way to delete one.
215
+
216
+ Inside an account folder the workspace-scoped commands take the workspace as a
217
+ positional — `foldrun secrets blog-desk set TOKEN`, `foldrun runs blog-desk` —
218
+ or need nothing at all when there is only one.
219
+
220
+ One gap worth knowing: the platform has no account-file endpoint, so the
221
+ account's own `AGENTS.md` is not pushed or pulled. `deploy` and `pull` say so
222
+ rather than dropping it quietly; edit it in Settings on the platform.
141
223
 
142
224
  ```sh
143
225
  foldrun login # approve it in the browser, once per machine