@cavelon/cli 0.0.0 → 0.1.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.
Files changed (61) hide show
  1. package/README.md +713 -3
  2. package/dist/LICENSE +201 -0
  3. package/dist/agents.js +107 -0
  4. package/dist/branches.js +61 -0
  5. package/dist/capacity.js +162 -0
  6. package/dist/cli.js +4 -0
  7. package/dist/command.js +62 -0
  8. package/dist/commands/api.js +313 -0
  9. package/dist/commands/async.js +207 -0
  10. package/dist/commands/docs.js +158 -0
  11. package/dist/commands/index.js +112 -0
  12. package/dist/commands/init.js +481 -0
  13. package/dist/commands/inventory.js +56 -0
  14. package/dist/commands/limits-set.js +633 -0
  15. package/dist/commands/limits.js +156 -0
  16. package/dist/commands/loops.js +798 -0
  17. package/dist/commands/models.js +197 -0
  18. package/dist/commands/sandboxes.js +674 -0
  19. package/dist/commands/session.js +480 -0
  20. package/dist/commands/solution.js +830 -0
  21. package/dist/commands/tenants.js +266 -0
  22. package/dist/commands/values.js +386 -0
  23. package/dist/commands/work.js +761 -0
  24. package/dist/context.js +60 -0
  25. package/dist/contracts.js +234 -0
  26. package/dist/credentials.js +134 -0
  27. package/dist/errors.js +64 -0
  28. package/dist/features.js +52 -0
  29. package/dist/format.js +36 -0
  30. package/dist/fsutil.js +43 -0
  31. package/dist/git.js +41 -0
  32. package/dist/http.js +304 -0
  33. package/dist/invoke.js +165 -0
  34. package/dist/io.js +49 -0
  35. package/dist/limits.js +307 -0
  36. package/dist/local-state.js +78 -0
  37. package/dist/main.js +227 -0
  38. package/dist/markers.js +113 -0
  39. package/dist/mcp.js +137 -0
  40. package/dist/openapi.js +233 -0
  41. package/dist/operations.js +107 -0
  42. package/dist/package-check.js +342 -0
  43. package/dist/package-files.js +394 -0
  44. package/dist/pair-order.js +39 -0
  45. package/dist/paths.js +77 -0
  46. package/dist/principal.js +33 -0
  47. package/dist/project.js +157 -0
  48. package/dist/prompt.js +34 -0
  49. package/dist/results.js +104 -0
  50. package/dist/session.js +190 -0
  51. package/dist/shell.js +41 -0
  52. package/dist/skills/cavelon-authoring/SKILL.md +224 -0
  53. package/dist/skills/cavelon-long-running/SKILL.md +185 -0
  54. package/dist/skills/cavelon-loop/SKILL.md +159 -0
  55. package/dist/skills/cavelon-testing/SKILL.md +97 -0
  56. package/dist/sse.js +44 -0
  57. package/dist/tar.js +172 -0
  58. package/dist/user-config.js +36 -0
  59. package/dist/version.js +17 -0
  60. package/dist/zip.js +132 -0
  61. package/package.json +40 -4
package/README.md CHANGED
@@ -1,4 +1,714 @@
1
- # @cavelon/cli
1
+ # `cavelon`: the Cavelon CLI and MCP server
2
2
 
3
- Placeholder. The Cavelon dev-kit CLI is not released yet; this version contains
4
- no code. See https://github.com/goodguys-gmbh/cavelon-dev-kit.
3
+ `cavelon` lets a developer, or the coding agent working for them, build, seed and
4
+ test Cavelon solutions from a repository instead of the Admin. It is generic: it
5
+ learns each instance's API, features and docs from what the instance publishes
6
+ (its OpenAPI, `/api/v1/meta/capabilities`, `/api/v1/meta/error-catalog` and
7
+ `/llms.txt`), so a new core release needs no new `cavelon` release.
8
+
9
+ Node.js 20.3 or newer. Install it from npm, or run it as `npx -y @cavelon/cli`:
10
+
11
+ ```bash
12
+ npm i -g @cavelon/cli
13
+ cavelon --help
14
+ ```
15
+
16
+ The full documentation is in the repository's
17
+ [`docs/`](https://github.com/goodguys-gmbh/cavelon-dev-kit/tree/main/docs):
18
+ [installation](https://github.com/goodguys-gmbh/cavelon-dev-kit/blob/main/docs/installation.md)
19
+ (with the plugin for Claude Code and Codex),
20
+ [getting started](https://github.com/goodguys-gmbh/cavelon-dev-kit/blob/main/docs/getting-started.md),
21
+ [concepts](https://github.com/goodguys-gmbh/cavelon-dev-kit/blob/main/docs/concepts.md),
22
+ the [command reference](https://github.com/goodguys-gmbh/cavelon-dev-kit/blob/main/docs/commands.md),
23
+ [troubleshooting](https://github.com/goodguys-gmbh/cavelon-dev-kit/blob/main/docs/troubleshooting.md)
24
+ and [security](https://github.com/goodguys-gmbh/cavelon-dev-kit/blob/main/docs/security.md).
25
+ This page is a compact reference.
26
+
27
+ ## Log in (a person does this once per instance)
28
+
29
+ 1. Create a personal access token on `/account/access-tokens` in the Admin. It
30
+ starts with `cvpat_`. A tenant API key (`cbp_…`) works too, for one tenant.
31
+ An instance with personal access tokens turned off refuses every `cvpat_`
32
+ token; `login` and every later command then answer
33
+ `personal_access_tokens_disabled` (exit 7) and name the operator's setting,
34
+ `PERSONAL_ACCESS_TOKENS_ENABLED`.
35
+ 2. Run, in a terminal:
36
+
37
+ ```bash
38
+ cavelon login --instance https://cavelon.example.com
39
+ ```
40
+
41
+ `https://cavelon.example.com` stands for your instance's address, the URL you
42
+ open Cavelon at in the browser.
43
+
44
+ It asks for the token without echoing it. `--token-stdin` reads it from
45
+ standard input instead. **`cavelon` never takes a token as an argument**, so it
46
+ stays out of shell history. Run it in a terminal of your own: an agent's
47
+ shell (`!` in Claude Code) has no terminal to type the token into.
48
+ 3. `cavelon whoami` shows who the token acts as, its name and when it expires (it
49
+ warns from seven days before), and whether it may activate solutions. With a
50
+ token that reaches several tenants, choose one: `cavelon use <tenant>`.
51
+
52
+ The token goes into the operating system's credential store (Keychain, Windows
53
+ Credential Manager, Secret Service). Where there is none, it goes into
54
+ `~/.config/cavelon/credentials.json`, readable only by you (0600). `logout`
55
+ deletes it. The coding agent never sees the token: it calls `cavelon`, and
56
+ `cavelon` sends it.
57
+
58
+ `login` reads the instance's capabilities and warns when its contract versions
59
+ are newer than this `cavelon` understands. It also caches the OpenAPI and the
60
+ error catalog under `~/.cache/cavelon/<instance>/<version>/`.
61
+
62
+ ### CI, scripts and cloud agents
63
+
64
+ Environment variables replace the login:
65
+
66
+ | Variable | Holds |
67
+ |---|---|
68
+ | `CAVELON_URL` | the instance URL |
69
+ | `CAVELON_TOKEN` | a personal access token (`cvpat_…`) or a tenant API key (`cbp_…`); needs `CAVELON_URL` |
70
+ | `CAVELON_TENANT` | the tenant slug or id, for a personal token that reaches several tenants |
71
+
72
+ ### Which instance, token and tenant
73
+
74
+ Highest first:
75
+
76
+ 1. command-line options: `--instance <url>`, `--tenant <tenant>` (there is no
77
+ token option);
78
+ 2. `CAVELON_URL`, `CAVELON_TOKEN`, `CAVELON_TENANT`;
79
+ 3. the nearest `cavelon.yaml` from the current directory upwards (instance URL
80
+ and tenant, never a token);
81
+ 4. the stored login, and the tenant chosen with `cavelon use`.
82
+
83
+ `CAVELON_TOKEN` is used only together with `CAVELON_URL`, and only for that
84
+ instance: an option or a `cavelon.yaml` (perhaps from a cloned repository) that
85
+ names another instance never receives it. Plain `http://` is refused except for
86
+ `localhost` (or with `CAVELON_ALLOW_HTTP=1`).
87
+
88
+ `cavelon.yaml` is written by `cavelon init` (see "Solution as code"). Keys the
89
+ binary does not know are kept and ignored. With `--env <name>`, `env/<name>.yaml`
90
+ names the tenant between `CAVELON_TENANT` and `cavelon.yaml`.
91
+
92
+ ## Commands
93
+
94
+ Every command takes `--json` (one JSON document on stdout, errors included),
95
+ `--instance` and `--tenant`, and `--help`. Each is marked read-only or changing
96
+ (`cavelon commands` lists them; `cavelon <command> --help` says it).
97
+
98
+ | Command | Marked | What it does |
99
+ |---|---|---|
100
+ | `login [--token-stdin]` | changing | Store a token for an instance. A person runs this. |
101
+ | `logout [--all]` | changing | Delete the stored token. |
102
+ | `whoami` | read-only | Owner or key, tenant, role, and where the credential came from. |
103
+ | `use <tenant>` / `use --clear` | changing | Choose the tenant for this instance. |
104
+ | `status [--offline]` | read-only | Instance, credential, tenant, solution folder, running operations, quotas close to full. |
105
+ | `limits [--key <key>] [--source <source>]` | read-only | The instance's limits for this tenant by source, who changes each and how; the tenant's quotas with their use (the monthly Processing Step cap among them); branch concurrency. |
106
+ | `limits set <key> <value> [--confirm]` | changing (destructive) | Change a limit through the operation the instance names: a tenant admin's, a quota of the Tenant Owner's (inference budget, Processing Step cap), or an operator's run cap with a Platform-mode token; without `--confirm`, shows the old and new value. |
107
+ | `models list` | read-only | The tenant's Model Registry rows with their endpoint and `max_concurrent_requests`; never a key. |
108
+ | `models set-limit <model> <n\|none> [--confirm]` | changing (destructive) | Set or clear a row's `max_concurrent_requests`; without `--confirm`, shows the old and new value. |
109
+ | `tenant create <slug> [--name] [--use]` | changing | Create a tenant (personal token in Platform mode with `tenants.manage`). |
110
+ | `tenant list [--search]` | read-only | Tenants the token can see. |
111
+ | `harness list [--readiness]` | read-only | The tenant's solutions. |
112
+ | `harness new <slug> [--name] [--description]` | changing | Create an empty draft solution. |
113
+ | `harness clone <source> [--slug] [--name] [--no-tests] [--no-triggers]` | changing | Copy a solution into a new draft. |
114
+ | `activate [--harness] [--env]` | changing | Activate through the readiness gate only, never by force. |
115
+ | `init [--harness] [--agents <list>] [--hook] [--update] [--from <file> [--force]]` | changing (files) | Make this folder a solution: `cavelon.yaml`, `package/`, `tests/`, `env/`, `.cavelon/`; `--from` writes a package file into it. |
116
+ | `pull [--harness] [--force]` | changing (files) | Write the instance's package into `package/` and `tests/`, the inventory into `.cavelon/`. |
117
+ | `validate [--offline]` | read-only | Check the package files against the cached package schema. |
118
+ | `apply [--env] [--harness] [--mode]` | changing | Preview the files against the instance; prints and stores a preview id. |
119
+ | `apply --confirm <preview-id>` | changing | Import exactly that preview; a stale one, or one the import's own check refuses (it names the blockers), exits 4. |
120
+ | `explain <code>` | read-only | Look a code up in the instance's error catalog. |
121
+ | `variables list` / `variables get <name>` | read-only | The tenant's plain-text variables (`{{var:…}}`) with their values. |
122
+ | `variables set <name> <value> [--stdin]` | changing | Create or replace a variable. Never a credential. |
123
+ | `variables delete <name> [--confirm]` | changing (destructive) | Delete a variable; without `--confirm`, shows it. |
124
+ | `secrets list [--missing]` | read-only | The tenant's secret names (`{{secret:…}}`): set or not, declared, changed when. Never a value. |
125
+ | `secrets set <name>` | changing | Set a secret's value from the terminal or stdin. A person runs this. |
126
+ | `secrets delete <name> [--confirm]` | changing (destructive) | Delete a secret's value; without `--confirm`, shows its status. A person runs this. |
127
+ | `api <operation> [name=value…] [--json <body>]` | changing | Call any operation of the instance's OpenAPI. |
128
+ | `api list [--tag] [--search] [--method] [--tags]` | read-only | The operations the instance publishes. |
129
+ | `api describe <operation>` | read-only | One operation's parameters, body and responses. |
130
+ | `docs search <query>` | read-only | Search the instance's own docs. |
131
+ | `docs get <page> [--max-chars] [--cursor]` | read-only | One docs page as markdown. |
132
+ | `wait <operation…> [--timeout 90s]` | read-only | Wait for operations; resumable. A test run with failed cases is a failure. |
133
+ | `watch <operation> [--timeout 10m]` | read-only | Stream an operation's changes (server-sent events). |
134
+ | `kb upload <dir> --kb <kb> [-r] [--ext pdf] [--wait]` | changing | Upload documents; returns operation ids. |
135
+ | `test run [--suite <s>] [--harness <h>] [--wait]` | changing | Start test-suite runs; returns operation ids. |
136
+ | `trace <run> [--trace <id>] [--span <id>]` | read-only | Summarise a run's traces (or a test run's results, with why a case did not pass), then one trace's spans, then one span. |
137
+ | `loop start <trigger> [--input <json>] [--wait]` | changing | Start a loop through its trigger, as you; returns the run and operation ids. |
138
+ | `loop cancel <run> [--confirm]` | changing (destructive) | Stop a trigger run and its loops; without `--confirm`, shows what would stop. |
139
+ | `loop watch <run> [--loop] [--timeout 10m]` | read-only | One line per decided iteration and per state change, then the loop's outcome; returns when it ends or pauses. |
140
+ | `loop iterations <run> [--loop] [--limit] [--cursor]` | read-only | A loop's state, budget and iterations. |
141
+ | `loop pause <run>` / `loop resume <run> [--reason <pause_reason>]` | changing | Pause at the next safe point; resume a paused loop (a verdict on the task names its pause reason as reviewed). |
142
+ | `trigger identity <trigger> [<key> \| --clear] [--confirm]` | changing (destructive) | Show, bind or clear the API key a trigger's unattended runs act as. |
143
+ | `sandbox list` | read-only | The tenant's Sandboxes: mode, state, revision, what each mode offers. |
144
+ | `sandbox validate <sandbox>` | changing | Run the Sandbox's readiness checks; exit 3 when one fails. |
145
+ | `sandbox files <sandbox> [<path>]` / `sandbox cat <sandbox> <path>` | read-only | List a workspace folder; print a file a page at a time. |
146
+ | `sandbox activity <sandbox> [<id>]` / `sandbox logs` / `sandbox receipt` | read-only | What ran in the Sandbox, one activity's log, its validation receipt. |
147
+ | `sandbox seed <sandbox> <folder\|tar> [--confirm]` | changing (destructive) | Replace an isolated container's workspace with an archive. |
148
+ | `sandbox refresh <sandbox>` | changing | Accept a customer VM's files as the new baseline. |
149
+ | `artifacts export <sandbox> [--path] [--out] [--wait \| --job <id>]` | changing | Take files out of an isolated container as a tar. |
150
+ | `commands` | read-only | Every command with its marking and MCP tool. |
151
+ | `mcp` | changing | Serve the commands as MCP tools on stdio. |
152
+
153
+ ### `cavelon api`
154
+
155
+ ```bash
156
+ cavelon api list --search harness
157
+ cavelon api describe create_harness
158
+ cavelon api get_harness_by_slug slug=support
159
+ cavelon api create_knowledge_base --json '{"name": "FAQ"}'
160
+ cavelon api create_knowledge_base --json @kb.json # or --json - for stdin
161
+ ```
162
+
163
+ An operation is named by its `operationId` or by its short name (the part before
164
+ FastAPI's path suffix, `list_harnesses` for `list_harnesses_api_v1_harnesses_get`).
165
+ Parameters are `name=value` or `-p name=value`; the body is checked against the
166
+ operation's schema before it is sent. On `api`, `--json` followed by a value is
167
+ the body; a bare `--json` is the output switch as everywhere else.
168
+
169
+ ### Limits
170
+
171
+ `cavelon limits` shows what the instance allows this tenant, from the `limits`
172
+ it publishes in `/api/v1/meta/capabilities`: upload size and file types, agent
173
+ turns and tool calls, timeouts, rate limits, the licence's cap on solutions.
174
+ They are grouped by where each value comes from (`tenant`, `platform`,
175
+ `licence`), and each names who changes it (a tenant admin or the instance
176
+ operator), the setting, and the docs page (`cavelon docs get <page>`). The
177
+ tenant's quotas follow with their current use, read from the path the limits
178
+ link to (`/api/v1/tenants/current/quota-usage`); `status` names the ones at 80 %
179
+ or more (or at the quota's own `warning_ratio`).
180
+
181
+ Two commands check them before they send anything:
182
+
183
+ - **`kb upload`** refuses a file larger than `kb_upload_max_file_size_mb` or of
184
+ a type outside `kb_upload_allowed_extensions` (exit 3, with the instance's own
185
+ code, `upload_file_too_large` or `upload_file_type_unsupported`), naming the
186
+ files, the limit, its source and who changes it. `--dry-run` checks the same.
187
+ A `.zip` is sent only while the tenant has archive uploads on
188
+ (`kb_upload_archive_enabled`;
189
+ `archive_uploads_disabled` otherwise, whatever the formats list) and
190
+ `kb_upload_archive_formats` lists `zip` (`archive_format_disabled`), and only
191
+ when the files its directory declares stay within
192
+ `kb_upload_archive_max_entries`, `kb_upload_archive_max_total_uncompressed_mb`
193
+ and `kb_upload_archive_max_compression_ratio` (per file), as the instance
194
+ counts them (directories do not count). A limit whose `binds_when` names an
195
+ on/off limit that is off does not bind and is not checked. On an instance
196
+ without the switch, an empty list of formats means archives are off. The
197
+ instance checks each file inside against the types itself. On an instance
198
+ that publishes no archive entries, the zip is sent and the instance decides.
199
+ A knowledge base may set lower limits of its own, which the instance checks.
200
+ - **`harness new`** refuses when the tenant's quotas list a solution quota that
201
+ is used up (exit 3, `tenant_quota_reached`), or when the tenant alone already
202
+ has as many solutions that are not archived as `licence_max_harnesses` allows
203
+ (exit 7, `license_limit_reached`, as the instance answers). The licence counts
204
+ every tenant's solutions, so below the cap the instance decides.
205
+
206
+ A limit the instance does not publish is never assumed: on an instance older
207
+ than the published limits, `limits` says so and the commands send as before.
208
+
209
+ **Limits that bind only while another is on**.
210
+ The archive caps are published whether archive uploads are on or off, with
211
+ `binds_when: "kb_upload_archive_enabled"`. `limits` lists them under "Only while
212
+ another limit is on" ("applies while archive uploads are on", and whether they
213
+ bind now), and `--json` adds `binds_now` to each. A tenant admin may set a cap
214
+ before turning archives on, and turns them on with
215
+ `limits set kb_upload_archive_enabled true`. The formats are the platform's
216
+ (`changeable_by: operator`); `limits set kb_upload_archive_formats` refuses and
217
+ names the switch.
218
+
219
+ **The monthly Processing Step cap**. The instance
220
+ publishes it in `tenant_quotas.values`, with this billing month's use, its
221
+ `state` (`none`, `ok`, `reached`, `unavailable`) and its change. `limits` lists
222
+ it under the tenant quotas ("close to the cap" from 80 %, "cap reached"), and
223
+ leaves out the quota-usage row that names the same change. A Tenant Owner
224
+ (`settings.manage`) sets it with `limits set monthly_processing_step_cap <n>`
225
+ and removes it with `none`. `cavelon explain processing_step_cap` explains the
226
+ refusal of new work at the cap (`PROCESSING_STEP_CAP_REACHED`), with the cap,
227
+ its use, when it resets and who raises it.
228
+
229
+ **Branch concurrency**. `limits` shows the width
230
+ per node (`orchestration_max_branch_concurrency`: a fan-out's or Map loop's
231
+ `max_concurrency` above it is capped), the branch slots one process shares
232
+ (`orchestration_process_max_branch_inflight`), and whether this tenant's
233
+ branches run concurrently (`orchestration_parallel_branches`). With branches
234
+ off, it names the switch that turned them off (the platform's
235
+ `ORCHESTRATION_PARALLEL_FANOUT_ENABLED`, or the tenant's feature flag) and who
236
+ turns it on. `validate` warns, never fails, when a fan-out or Map loop in the
237
+ package (an orchestration node's or graph edge's `config`, or a handoff's
238
+ `orchestration_config`) sets `max_concurrency` above the width
239
+ (`branch_width_capped`), and when the tenant runs fan-outs and Map loops in
240
+ sequence (`branches_run_in_sequence`). It reads the limits the instance last
241
+ published (cached by any command that read them), so it stays offline.
242
+
243
+ **Run capacity**. The run caps
244
+ (`max_concurrent_agent_runs_per_tenant`, `max_concurrent_agent_runs_global`)
245
+ also name their `origin` where the instance publishes one: a platform setting
246
+ the operator changes in the Admin (Platform › Operations › Rate limits), the
247
+ environment, or the default; `limits` then adds an origin column and says where
248
+ each cap is set. A tenant's own cap shows under
249
+ `max_concurrent_agent_runs_per_tenant` with source `tenant`; the operator sets
250
+ it with `PATCH /api/v1/tenants/{tenant_id}/limits`. `status` prints the run caps
251
+ with source and origin, and the slot waits (`agent_run_slot_wait_seconds`,
252
+ `model_endpoint_slot_wait_seconds`). An entry without `origin` shows as before.
253
+
254
+ **Changing a limit**. Each limit a tenant admin
255
+ may change publishes its `change`: the operation (`operationId`, method, path),
256
+ the body field that carries the value, the permissions of which the caller
257
+ needs one, and its bounds (`minimum`, `maximum`; a rate limit's `maximum` is the
258
+ operator's ceiling, named in `maximum_setting`; the per-visitor rate limits
259
+ `rate_limit_chat_visitor_rpm` and `rate_limit_widget_visitor_rpm` among them).
260
+ The inference budget, a quota,
261
+ is listed in `tenant_quotas.changes`. `limits set <key> <value>` reads that and
262
+ checks the value offline: a whole number in the limit's unit (`50` or `50MB`,
263
+ `100rpm`), a comma-separated list of file types, `true`/`false` for a switch,
264
+ or `none` to clear the tenant's own value so the platform's applies again.
265
+ Without `--confirm` it shows the old and the new value, the operation with its
266
+ body and who may run it, and changes nothing; with `--confirm` it sends exactly
267
+ that operation and prints the new value from the instance's answer. Where the
268
+ tenant's quota row names the change, the preview
269
+ of a quota shows its current value from the row's `change.field`.
270
+
271
+ ```bash
272
+ cavelon limits set kb_upload_max_file_size_mb 50 # shows the change
273
+ cavelon limits set kb_upload_max_file_size_mb 50 --confirm # PATCH /api/v1/tenants/current/upload-defaults
274
+ cavelon limits set rate_limit_chat_rpm none --confirm # back to the platform's value
275
+ cavelon limits set monthly_inference_token_budget 2000000 # PATCH /api/v1/tenants/{tenant_id}/limits, this tenant
276
+ cavelon limits set monthly_processing_step_cap none --confirm # a Tenant Owner removes the cap
277
+ ```
278
+
279
+ **An operator's change**. The run caps publish a
280
+ `change` too, with `requires_role` (the global roles, any one of which the
281
+ caller needs) and `mode: platform`. `limits set` sends it only when
282
+ `/api/v1/meta/principal`, asked without `X-Tenant-Id`, answers in Platform mode
283
+ for a personal access token whose ceiling role is one of those roles (and the
284
+ person's global role from `/api/v1/auth/me` too), and sends the change without
285
+ `X-Tenant-Id`. Otherwise it refuses before sending (exit 7,
286
+ `platform_role_required`), naming the role and the Admin page (Platform ›
287
+ Operations › Rate limits › Run caps, a tenant's Limits section, or Configure ›
288
+ Feature Flags). The limits are still read for a tenant, so name one with
289
+ `--tenant` or `cavelon use`. With `--tenant <id|slug>`, a limit's
290
+ `tenant_change` applies instead: `max_concurrent_agent_runs_per_tenant` then
291
+ sets that tenant's own cap, with the tenant's id in the path. The tenant's flag
292
+ behind concurrent branches is the change on `orchestration_parallel_branches`:
293
+ a `PUT` to
294
+ `/api/v1/admin/feature-flags/{tenant_id}/ORCHESTRATION_PARALLEL_FANOUT_ENABLED`,
295
+ the tenant's id from `--tenant` and the flag from the published path (the
296
+ OpenAPI's `{flag_key}`); `on`/`off` (or `true`/`false`), and the preview shows
297
+ the flag's own state. An operator limit without a `change` cannot be changed at
298
+ runtime, and `limits set` says so. A tenant on Processing-Step terms is not
299
+ offered the inference budget: the instance leaves its change out, so `limits set` refuses it as not listed.
300
+
301
+ ```bash
302
+ cavelon limits set max_concurrent_agent_runs_global 150 --tenant acme --confirm # superadmin, Platform mode
303
+ cavelon limits set max_concurrent_agent_runs_per_tenant 6 --tenant acme --confirm # acme's own cap
304
+ cavelon limits set orchestration_parallel_branches false --tenant acme --confirm # acme's flag, platform admin
305
+ ```
306
+
307
+ It refuses before sending anything:
308
+
309
+ - an `operator` or licence limit without a `change` (exit 7,
310
+ `limit_changed_by_operator`), naming who changes it and where (its `setting`,
311
+ `origin` and docs page);
312
+ - an operator's change without a Platform-mode token of its role (exit 7,
313
+ `platform_role_required`);
314
+ - a value outside the published bounds (exit 3, `request_invalid`, as the
315
+ instance answers); a rate limit above the ceiling names the operator's
316
+ setting that raises it, with the instance's `limit_above_platform_ceiling`
317
+ where its error catalog lists the code (its
318
+ fields `setting`, `value`, `maximum` and `maximum_setting` in the details).
319
+ When the instance itself refuses with that code (its ceiling changed since it
320
+ published), the error names the ceiling, the setting and that only the
321
+ operator raises it; `cavelon explain limit_above_platform_ceiling` lists
322
+ today's ceilings;
323
+ - an entry without `change`, on an older instance (exit 1,
324
+ `operation_unavailable`: this instance does not publish how to change it);
325
+ - a credential whose `permissions`, as `/api/v1/meta/principal` lists them,
326
+ share no name with the change's (exit 7,
327
+ `forbidden`, naming the permission): a tenant admin's token for the
328
+ Processing Step cap, for example. On an instance that publishes no
329
+ `permissions`, an API key whose scopes are neither `admin` nor one of the
330
+ permissions is refused, and for a person the instance decides; its 403 exits
331
+ 7 and names the permissions.
332
+
333
+ The MCP tool `limits_set` carries the destructive annotation and takes
334
+ `confirm` like the CLI. `cavelon limits` names the command under the limits a
335
+ tenant admin changes, and the limits an operator changes in Platform mode.
336
+
337
+ **Model endpoint limits**. `models list` shows the
338
+ tenant's Model Registry rows with their endpoint (the `base_url`'s scheme, host,
339
+ port and path: user info and query are left out) and `max_concurrent_requests`,
340
+ and which rows share an endpoint, and so its count. It never shows a key, only
341
+ its kind (`api_key_type`). `models set-limit <model> <n|none>` shows the old and
342
+ the new value and changes nothing; with `--confirm` it sends only that field to
343
+ the row's update operation (`PATCH /api/v1/model-registry/{model_registry_id}`,
344
+ `agents.manage_llm_config`). The value is checked against the instance's own
345
+ schema, and a row without a `base_url` is refused before anything is sent
346
+ (exit 3, `model_endpoint_limit_without_base_url`). The MCP tool
347
+ `models_set_limit` carries the destructive annotation, so the person confirms it
348
+ in the client.
349
+
350
+ ### Variables and secrets
351
+
352
+ Prompts, tools, guardrails and test suites name tenant **variables** as
353
+ `{{var:<name>}}` and **secrets** as `{{secret:<name>}}`. A package carries only
354
+ their names: `package/required_variables.yaml` and
355
+ `package/required_secrets.yaml` declare what the solution needs (a `name` and a
356
+ `description` each), and `pull` and `apply` keep them. `apply` lists every
357
+ name the target has no value for, with the command that sets it (`--json`:
358
+ `set_commands`), and reminds of them after `--confirm`.
359
+
360
+ ```bash
361
+ cavelon variables set crm_base_url https://crm.example.com
362
+ cavelon secrets list --missing
363
+ cavelon secrets set crm_api_token # asks for the value, without echo
364
+ op read op://dev/crm/token | cavelon secrets set crm_api_token
365
+ ```
366
+
367
+ - A **variable** is plain text: anyone who may view the tenant's settings
368
+ reads it, and the agent may set it (MCP: `variables_list`, `variables_get`,
369
+ `variables_set`). `variables set` refuses a value that looks like a token.
370
+ - A **secret's** value is never an argument, never printed, never written to a
371
+ file and never read back. `secrets set` reads it from the terminal without
372
+ echo, or from standard input when that is piped (one trailing line break is
373
+ dropped), and refuses a value given as an argument without repeating it.
374
+ Setting or deleting one needs a person (a session or a personal access
375
+ token): with a tenant API key, `cavelon` refuses before it asks for the value
376
+ or sends anything (exit 7, `secret_needs_a_person`, as the instance would
377
+ answer). MCP offers only `secrets_list`; an agent tells the person the exact
378
+ `cavelon secrets set <name>` command instead.
379
+ - `--env <name>` acts in the tenant `env/<name>.yaml` names, like `apply`. A
380
+ name without its env file is refused (exit 2) before anything is sent.
381
+
382
+ ### Long-running work
383
+
384
+ `kb upload` and `test run` return operation ids at once. `--wait` waits for them,
385
+ or run `wait`:
386
+
387
+ ```bash
388
+ cavelon wait op_test_run_… --timeout 5m
389
+ ```
390
+
391
+ `wait` returns when every operation has finished or needs a person, or when the
392
+ timeout passes. It prints the state in every case; when time ran out, the work
393
+ goes on, and the same `wait` again resumes it. `watch` streams each change.
394
+ An operation only says that the work finished: for a test run, `wait`,
395
+ `watch` and `test run --wait` also read the run's summary. A run whose cases
396
+ failed or errored, or that measured nothing comparable (steps not run,
397
+ technical errors, missing results, or no pass rate), exits 1 with the counts,
398
+ the failed cases and the reason the instance recorded; a run whose answers
399
+ wait for a manual verdict or for a value a case needs exits 5 (`--json`:
400
+ `failed_results`, each with `counts`, `comparable` and `exit_code`). `trace <test run>` lists every case that did not pass with
401
+ its error, the judge's reasoning and the command that opens its traces (by its
402
+ conversation id, or for a trigger case by the run it started), and the judge's
403
+ reasoning for each scored pass the instance sent it for. `test run --wait` ends,
404
+ when its wait ran out, with the one `wait` command that resumes.
405
+
406
+ A trigger or channel run that meets a full run cap stays `queued` and the
407
+ instance retries it every 5–20 s. The run says so itself
408
+ (`waiting_for_capacity`; for an operation, the
409
+ kit reads the run its `result_ref` names), so `wait`, `watch`, `loop watch`,
410
+ `trace`, `status` and `loop cancel` say **waiting for run capacity** from the
411
+ first poll (`--json`: `capacity_waits`, or `capacity_wait` on the run), name
412
+ the run caps and where each is set, and keep waiting within the timeout. On an
413
+ instance that does not publish the field, they say it once a run has been
414
+ queued for more than 30 s, and mark the wait `inferred: true`.
415
+ A run or call refused for capacity (`run_capacity_busy`, `model_endpoint_busy`)
416
+ gets the instance's catalog entry plus which limit to raise and who can
417
+ (`--json`: `capacity_refusals`; `explain`: `kit_hint`), and that retrying later
418
+ is fine.
419
+
420
+ ## Loops and Sandboxes
421
+
422
+ A Masterloop loop runs a solution in bounded iterations; it starts only
423
+ through its trigger, and stopping the trigger run stops it. A Sandbox is the
424
+ workspace a loop works in, in one of two modes, which offer different things:
425
+
426
+ | | `isolated_container` | `customer_vm` |
427
+ |---|---|---|
428
+ | Put files in | `sandbox seed <sandbox> <folder>` (archive import) | put them on the VM, then `sandbox refresh <sandbox>` |
429
+ | Take results out | `artifacts export <sandbox>` (archive export) | `sandbox cat <sandbox> <path>` |
430
+ | Validation receipt | `sandbox receipt` | none: completion is agent-reported |
431
+
432
+ `cavelon` reads each Sandbox's mode and refuses a command the mode does not
433
+ offer before sending anything, naming the mode (exit 3, with the instance's
434
+ own code: `sandbox_capability_unavailable`, `sandbox_workspace_refresh_unavailable`
435
+ or `sandbox_validation_receipt_unavailable`). It also refuses Sandbox and loop
436
+ commands when the instance's capabilities say the feature is off.
437
+
438
+ ```bash
439
+ cavelon sandbox validate orders-test
440
+ cavelon sandbox seed orders-test seeds/orders # shows what it would send
441
+ cavelon sandbox seed orders-test seeds/orders --confirm # the archive becomes the workspace
442
+ cavelon trigger identity orders loop-runner # shows the change
443
+ cavelon trigger identity orders loop-runner --confirm # binds the API key
444
+ cavelon loop start orders --input @request.json
445
+ cavelon loop watch <run>
446
+ cavelon sandbox cat orders-test output/summary.json
447
+ cavelon artifacts export orders-test --path output --wait --out results.tar
448
+ ```
449
+
450
+ - **`loop start`** calls the trigger's run-now route; the run acts as you (with
451
+ a personal access token, the person). It returns the run id and the run's
452
+ operation id, so `wait` and `watch` follow it (and `trace <operation>` reads
453
+ the run's traces); a paused loop makes `wait` exit 5. It sends an
454
+ `Idempotency-Key` (`--idempotency-key`, a new UUID by default; `--json`:
455
+ `idempotency_key`). When the start ends in exit 8 (a timeout, a cut
456
+ connection, a 5xx), the run may have started: the error's hint names the key,
457
+ and the same command with `--idempotency-key <key>` starts no second run.
458
+ With `--wait`, a run that ended without starting a loop exits 1 and names the
459
+ stage that recorded an error.
460
+ - **`loop watch`** prints each iteration once the loop decided on it: accepted
461
+ (with the outcome of its `loop.continuation.v1` result), rejected, or failed
462
+ when its child failed, with the reason. Usage is the iteration's actual usage;
463
+ until the instance reports it, the line says what the iteration reserved.
464
+ Then each state change, and at the end the loop's outcome: its reason, what
465
+ it charged and, for a paused loop, how it goes on (`go_on`): the `loop
466
+ resume` a person runs after fixing the cause, with `--reason <the pause
467
+ reason>` when the pause is a verdict on the task; or, when it cannot be
468
+ resumed, why not, `loop cancel <run> --confirm` and `loop start <trigger>`.
469
+ The kit follows the loop's `resume` where the instance publishes it;
470
+ until then it rules a resume out only from the
471
+ loop's published state (its run stopping, its deadline, `resume_enabled`,
472
+ unknown operations), and names the `--reason` command for when the instance
473
+ asks for a review. The catalog's sentence for the pause reason is shown when
474
+ it lists one. `--json` gives one object per line (`iteration`, `loop`,
475
+ `outcome`). Exit 0 completed, 1 failed or cancelled, 5 at once when the loop
476
+ pauses, 6 when the timeout came first. A run that ended without a loop names
477
+ the stage that recorded an error. `loop iterations` reads the same a page at
478
+ a time; `trace <child_run_id>` reads one iteration's run.
479
+ - **`loop pause`**, **`loop resume`** send the loop's version and an
480
+ `Idempotency-Key` (`--idempotency-key` makes a retry safe; an exit-8 error
481
+ names the key it sent); a loop that
482
+ changed in between answers 409 (exit 4). `loop resume --reason` must be the
483
+ loop's pause reason (exit 2 otherwise, before anything is sent). A pause that
484
+ needs a review and has none exits 5 (`loop_resume_review_required`) with the
485
+ command to run; one that cannot be resumed exits 4 with what to do instead. Without `--loop`, they act on the
486
+ run's only loop that can be paused or resumed.
487
+ - **`loop cancel`** and **`sandbox seed`** change nothing without `--confirm`;
488
+ they show what would happen.
489
+ - **`trigger identity`** binds through the trigger's versioned
490
+ `execution-identity` route, with the version it read; `apply` never binds
491
+ one. The key is named by its name or id, never its value (a value that looks
492
+ like a key or token is refused and not echoed). Without `--confirm` it shows
493
+ the change. It warns when the key does not reach the solutions the trigger
494
+ needs or a Sandbox's Access does not list it; both are fixed in the Admin.
495
+ - **Sandbox reads** (`files`, `cat`, `activity`, `logs`, `receipt`) and jobs
496
+ go through a solution the Sandbox allows: `--harness`, else `cavelon.yaml`'s,
497
+ else the Sandbox's only allowed solution. One it does not allow exits 7.
498
+ - **`sandbox seed`** sends a folder as an uncompressed USTAR archive (files and
499
+ folders only; links and special files are refused), a `.tar` as it is, or
500
+ any other file under its own name, up to the size the instance's OpenAPI
501
+ allows (64 MiB). Names are checked before they go in, and the archive's bytes
502
+ depend only on the files, so the same seed again is the same job: running it
503
+ again resumes it. The archive goes up once the job has taken the workspace;
504
+ `sandbox seed` waits up to 30 seconds for that (over MCP too), and otherwise
505
+ exits 6 with the command that resumes it.
506
+ - **`artifacts export`** starts an export job and returns its operation id;
507
+ with `--wait`, or later with `--job <id>`, it writes the tar to `--out`
508
+ (default `sandbox-<job>.tar`) after checking its SHA-256, and never over an
509
+ existing file (exit 4).
510
+
511
+ ## Solution as code
512
+
513
+ A solution is a folder with a `cavelon.yaml`; `cavelon` finds the nearest one
514
+ from the working directory upwards, so a monorepo can hold several.
515
+
516
+ ```text
517
+ solution/
518
+ cavelon.yaml instance, tenant, solution (harness), package format, layout; never a token
519
+ package/ one file per top-level section of the instance's package schema
520
+ tests/ one file per test suite (the schema's test_suites section)
521
+ seeds/ your seed scripts and data manifests
522
+ env/test.yaml where `apply --env test` goes: tenant, harness, mode, runtime_bindings
523
+ env/prod.yaml
524
+ .cavelon/ local state, never committed: inventory.md, pull.json, previews/
525
+ AGENTS.md a short Cavelon block between markers
526
+ ```
527
+
528
+ ```bash
529
+ cavelon init --instance https://cavelon.example.com --tenant acme --harness support
530
+ cavelon pull # the live solution into package/ and tests/
531
+ $EDITOR package/agents.yaml
532
+ cavelon validate # offline, against the cached package schema
533
+ cavelon apply --env test # preview: prints and stores a preview id
534
+ cavelon apply --confirm <id> --env test
535
+ cavelon activate --harness support
536
+ ```
537
+
538
+ - **`init`** creates its own files (`cavelon.yaml`, `package/`, `tests/`,
539
+ `seeds/`, `env/test.yaml`, `env/prod.yaml`, `.cavelon/`) and never overwrites
540
+ them. `AGENTS.md`, `.gitignore` and an existing `CLAUDE.md` (with an
541
+ `@AGENTS.md` import) get at most one block between `cavelon:begin` and
542
+ `cavelon:end` markers; a file whose markers are broken is left alone with a
543
+ warning. `--hook` adds a git pre-commit hook that runs `cavelon validate`, as a
544
+ marked block after a hook's shebang. Only an invalid package (exit 3) stops the
545
+ commit; when the check cannot run, the hook warns and lets the commit through. `--update` touches only the marked
546
+ blocks and the fallback files a previous `init` wrote.
547
+ - **`init --from <file>`** brings an existing package file into the solution:
548
+ a blueprint package,
549
+ an export from another instance, a package attached to an issue. It reads JSON
550
+ or YAML and writes it as `pull` writes an export, one `package/<section>.yaml`
551
+ per top-level section and one `tests/<suite>.yaml` per test suite, so
552
+ `validate` and `apply` take it from there; it never goes through the Admin's
553
+ import, and the repository stays the source. A file that already holds the
554
+ same value keeps its bytes. One that would change, or go away because the
555
+ package lacks its section or suite, stops the import before anything is written
556
+ (exit 4, `package_files_differ`, the files in `details.files`) unless `--force`.
557
+ Sections the instance's package schema does not know are written, reported as
558
+ `ignored` and warned about, as `validate` does. With no `--harness`,
559
+ a package with one harness names the solution in a new `cavelon.yaml` and
560
+ `env/test.yaml`, so `apply --env test` creates that draft. The rest of `init`
561
+ runs as without `--from`: its own files, the marked blocks.
562
+
563
+ ```bash
564
+ mkdir counter && cd counter
565
+ cavelon init --instance https://cavelon.example.com --tenant acme --from ../counter-parent.json
566
+ cavelon validate --offline
567
+ cavelon apply --env test
568
+ ```
569
+ - **`init --agents <list>`** is the fallback for agents without the Cavelon
570
+ plugin: the skills go into `.agents/skills/cavelon-*/` and
571
+ `.claude/skills/cavelon-*/`, marked as generated, and each named agent gets the
572
+ `cavelon mcp` entry: `claude` (`.mcp.json`), `codex` (`.codex/config.toml`, a
573
+ marked block), `cursor` (`.cursor/mcp.json`), `copilot` (`.vscode/mcp.json`),
574
+ `gemini` (`.gemini/settings.json`), `kiro` (`.kiro/settings/mcp.json`); `pi` and
575
+ `other` need only `AGENTS.md`. A JSON file is changed only when rewriting it
576
+ keeps every other byte; otherwise `init` says what to add.
577
+ - **`pull`** exports the solution (`--harness`, or `cavelon.yaml`'s), or without
578
+ one the tenant's full configuration, and splits it along the top-level sections
579
+ of the instance's published package schema, so no entity type is built into
580
+ the binary. A file whose content did not change keeps its bytes, so `git diff`
581
+ shows what changed on the instance; files of sections the schema does not know
582
+ are kept byte for byte. It refuses when package files have uncommitted changes
583
+ (exit 4) unless `--force`, and writes the tenant's solutions, knowledge bases,
584
+ tools, test suites and sandboxes to `.cavelon/inventory.md`.
585
+ - **`validate`** checks the files against the package schema that `init`, `pull`
586
+ or `apply` cached, and the package version against those the instance accepts.
587
+ It contacts the instance only when nothing is cached (never with `--offline`).
588
+ Each finding has a file, line, path and code; exit 3 on errors. A Model
589
+ Registry row's `max_concurrent_requests` needs a `base_url`
590
+ (`model_endpoint_limit_without_base_url`); where the package schema does not
591
+ carry the field, a warning says the import ignores it.
592
+ - **`apply`** validates, then calls the import preview and prints what changes,
593
+ which active solutions it reaches, what the target still needs (secret values,
594
+ OAuth grants, runtime bindings, trigger execution identities), loop budgets and
595
+ ignored sections, with the preview id. It stores the exact request in
596
+ `.cavelon/previews/`, so **`apply --confirm <id>`** imports exactly what was
597
+ previewed, even if the files changed since (it warns). A target that changed
598
+ since the preview answers `409 import_preview_stale`: exit 4, and the hint says
599
+ how to preview again. An import whose own check, re-run when it applies,
600
+ finds what the preview did not answers `409 package_requirements_changed`
601
+ with `blockers`: exit 4, each blocker on its own line (in `--json`, the
602
+ error's `blockers`), "nothing was imported; preview again", and for a code
603
+ the kit knows (such as `runtime_draft_iteration_needs_draft_parent`) its hint. When the env file names a solution that does not exist
604
+ yet, `apply` creates it as a draft first, named as `package/harnesses.yaml`
605
+ names the harness with that slug (or its only harness), and after the slug
606
+ where the package has none; `runtime_bindings` from the env file
607
+ bind the package's runtime requirements. A preview that reaches an active
608
+ solution, deletes, or goes to `env/prod` says to show it to a person first.
609
+ - **`explain <code>`** looks a rule code or API error code up in the instance's
610
+ error catalog (and the codes `validate` reports itself): meaning, fix and docs
611
+ link. For `run_capacity_busy` and `model_endpoint_busy` it adds which limit to
612
+ raise, who can, and today's values from `limits`, and the instance's pages on
613
+ capacity (`concepts/capacity-and-concurrency`, `tutorials/plan-model-capacity`)
614
+ where its docs index lists them (`--json`: `read`).
615
+ - **`activate`** reads the readiness gate and activates only when it passes,
616
+ never with `force`. A personal access token without "may activate" is refused
617
+ before anything is sent (exit 7); a solution that is not ready exits 3 with its
618
+ blockers.
619
+ - **A Masterloop parent and its iteration solution** activate without the
620
+ override in one order: apply the iteration, apply the parent, run the
621
+ parent's loop suite, activate the iteration, activate the parent.
622
+ When `apply` meets
623
+ `runtime_draft_iteration_needs_draft_parent` or
624
+ `runtime_external_iteration_harness_unavailable`, or `activate` meets the
625
+ parent's `masterloop_iteration_harness_draft`, its `hint` gives the catalog's
626
+ sentence and hint, the step it points at, and the order; `explain` adds the
627
+ same under `order`.
628
+
629
+ Import needs a personal access token (or an Admin session): an instance refuses
630
+ it to a tenant API key.
631
+
632
+ ## Built for agents
633
+
634
+ - **No prompts.** Only `login` asks, and only on a terminal; everywhere else it
635
+ needs `--token-stdin`.
636
+ - **`--json` everywhere**; no colours or progress lines without a terminal, or with
637
+ `NO_COLOR` set.
638
+ - **Bounded waits**: `wait` defaults to 90 seconds, `watch` and `loop watch` to 10 minutes.
639
+ - **Commands to copy**: a command printed in a hint quotes every name for the
640
+ shell cavelon runs in (POSIX shells, PowerShell, cmd), so a Sandbox named
641
+ `Lab VM 4073` stays one argument. `CAVELON_SHELL=posix|powershell|cmd` names
642
+ the shell when the guess is wrong.
643
+ - **Confirm what is destructive**: `apply`, `loop cancel`, `sandbox seed` and
644
+ `trigger identity` show what they would do, and act only with `--confirm`.
645
+ - **Bounded output**: lists take `--limit` and `--cursor` and print the next
646
+ cursor; traces are summarised, with the command for each span's detail.
647
+ - **Read-only or changing**, on every command and MCP tool.
648
+
649
+ ## Exit codes
650
+
651
+ | Code | Meaning |
652
+ |---|---|
653
+ | 0 | ok |
654
+ | 1 | anything else (not found, an operation failed or was cancelled, a test case failed) |
655
+ | 2 | usage: unknown command or option, a missing argument, no instance chosen |
656
+ | 3 | validation failed: the arguments or body do not match the instance's schema, or the instance refused them (400, 422) |
657
+ | 4 | conflict or stale preview (409, 412) |
658
+ | 5 | needs a person (`needs_action`): the reason and the Admin link are printed |
659
+ | 6 | timed out: the operation is still running; `wait` again to resume |
660
+ | 7 | not authorised: no token, or the instance refused it (401, 403) |
661
+ | 8 | server or network error (5xx, 429, unreachable, request timeout) |
662
+
663
+ With `--json`, an error is `{"error": {"code", "message", "hint", "docs", "status", "exit_code"}}`,
664
+ carrying the instance's own error code where it sent one.
665
+
666
+ ## `cavelon mcp`
667
+
668
+ The same commands as MCP tools over stdio, for agents that prefer tools to a
669
+ shell. The tools are coarse, one per workflow command plus `api`, `api_list`,
670
+ `api_describe`, `docs_search` and `docs_get`, and carry the standard read-only and
671
+ destructive annotations. The repository tools (`init`, `pull`, `validate`,
672
+ `apply`, `explain`, `activate`) and `sandbox_seed` and `artifacts_export` work in
673
+ the folder the agent started `cavelon mcp` in. They never block: `kb_upload`,
674
+ `test_run`, `loop_start`, `sandbox_seed` and `artifacts_export` return operation
675
+ ids, `operation_status` reads them, and `loop_iterations` follows a loop
676
+ (`loop watch` and `watch` stream, so they are no tools). `loop_cancel`,
677
+ `sandbox_seed` and `trigger_identity` are marked destructive and change nothing
678
+ without `confirm: true`. `limits` is read-only; the server's instructions tell
679
+ the agent to read it before planning a solution. `login` and `logout` are not
680
+ tools; a person runs them.
681
+
682
+ ```json
683
+ {
684
+ "mcpServers": {
685
+ "cavelon": { "command": "npx", "args": ["-y", "@cavelon/cli@0.1", "mcp"] }
686
+ }
687
+ }
688
+ ```
689
+
690
+ The Cavelon plugin for Claude Code and Codex (`plugin/.mcp.json`) and
691
+ `init --agents` carry this entry. It runs the released package through `npx`,
692
+ pinned to the kit's minor version: in 0.x a new minor may break, and it reaches
693
+ an agent only with a new plugin or `init --update`. With `cavelon` installed,
694
+ `{ "command": "cavelon", "args": ["mcp"] }` works as well.
695
+
696
+ ## Files on your machine
697
+
698
+ | Path | Holds |
699
+ |---|---|
700
+ | `~/.config/cavelon/config.json` | the current instance, the tenant chosen with `use`, which store holds the token. Never a token. |
701
+ | `~/.config/cavelon/credentials.json` | the token per instance (0600), only where there is no OS credential store |
702
+ | `~/.cache/cavelon/<instance>/<version>/` | the instance's capabilities, OpenAPI, error catalog, package schema and docs index |
703
+
704
+ `CAVELON_CONFIG_DIR` and `CAVELON_CACHE_DIR` move them; `XDG_CONFIG_HOME` and
705
+ `XDG_CACHE_HOME` are honoured. `CAVELON_CREDENTIAL_STORE=file` skips the OS store.
706
+ A release's cached copies are kept until the instance reports another version.
707
+ A development build (a version with `dev`, `snapshot` or `local` in it) keeps
708
+ one version while what it publishes changes, so its copies are read again after
709
+ a minute, or checked with the ETag the instance sent with them;
710
+ `CAVELON_CONTRACT_TTL_SECONDS` sets that time. `cavelon validate --verbose` says
711
+ which copy of the package schema it used.
712
+ In the working directory, only `init`, `pull` and `apply` write, as described
713
+ in "Solution as code", and `artifacts export`, which writes the tar it
714
+ downloads to a new file.