@cavelon/cli 0.1.6 → 0.1.8
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 +44 -13
- package/dist/command.js +41 -0
- package/dist/commands/chat.js +17 -11
- package/dist/commands/docs.js +15 -4
- package/dist/commands/fmt.js +56 -4
- package/dist/commands/init.js +35 -12
- package/dist/commands/limits-set.js +1 -0
- package/dist/commands/loops.js +7 -2
- package/dist/commands/models.js +2 -1
- package/dist/commands/sandboxes.js +3 -1
- package/dist/commands/schema.js +19 -5
- package/dist/commands/session.js +21 -3
- package/dist/commands/solution.js +233 -51
- package/dist/commands/tenants.js +6 -4
- package/dist/commands/values.js +3 -3
- package/dist/commands/work.js +59 -12
- package/dist/format.js +4 -4
- package/dist/harness-ref.js +4 -4
- package/dist/http.js +6 -0
- package/dist/kit-codes.js +6 -2
- package/dist/local-state.js +18 -0
- package/dist/main.js +4 -6
- package/dist/mcp.js +17 -10
- package/dist/package-check.js +52 -7
- package/dist/package-files.js +24 -2
- package/dist/preview-report.js +10 -0
- package/dist/session.js +9 -0
- package/dist/skills/cavelon-authoring/SKILL.md +11 -3
- package/dist/skills/cavelon-long-running/SKILL.md +13 -9
- package/dist/skills/cavelon-loop/SKILL.md +50 -15
- package/package.json +2 -2
|
@@ -47,7 +47,9 @@ Do not work around it; use the other column.
|
|
|
47
47
|
iteration, activate the parent (cavelon-loop skill, "A Masterloop parent and
|
|
48
48
|
its iteration solution"). `activate` never forces.
|
|
49
49
|
5. **Seed it.** Isolated container: `cavelon sandbox seed <sandbox> <folder>`
|
|
50
|
-
shows what it would send
|
|
50
|
+
shows what it would send and the confirm command that sends it: run that
|
|
51
|
+
one (from your shell it carries the preview's token, `--confirm <token>`;
|
|
52
|
+
a bare `--confirm` exits 5 and sends nothing). The archive **replaces
|
|
51
53
|
the workspace**, so confirm only for a test Sandbox or after the person
|
|
52
54
|
agreed. Customer VM: the files go onto the VM, then `cavelon sandbox refresh
|
|
53
55
|
<sandbox>`.
|
|
@@ -79,14 +81,15 @@ seconds).
|
|
|
79
81
|
`invalid_continuation`, …) resumes only with `--reason <the pause reason>`,
|
|
80
82
|
exactly as the loop names it, once the person reviewed the cause; `--reason`
|
|
81
83
|
is never free text. A pause that cannot be resumed is cancelled
|
|
82
|
-
(`cavelon loop cancel <run
|
|
83
|
-
watch prints both commands.
|
|
84
|
+
(`cavelon loop cancel <run>`, then the confirm command it prints) and started
|
|
85
|
+
again after the fix; the watch prints both commands.
|
|
84
86
|
- An iteration reads **accepted** (with its outcome: continue, wait, done,
|
|
85
87
|
blocked), **rejected**, or **failed** when its child failed. A run that ended
|
|
86
88
|
without a loop names the stage that recorded an error.
|
|
87
89
|
`cavelon trace <child_run_id>` reads one iteration's run.
|
|
88
|
-
- **Stop** a run and its loops: `cavelon loop cancel <run>` shows what stops
|
|
89
|
-
|
|
90
|
+
- **Stop** a run and its loops: `cavelon loop cancel <run>` shows what stops
|
|
91
|
+
and the confirm command (`--confirm <token>` from your shell) that stops it.
|
|
92
|
+
Stop runs you started, not someone else's.
|
|
90
93
|
- A run that waits at an **Approval** node, or a loop paused by a guardrail,
|
|
91
94
|
needs a person: `wait` prints the reason and the Admin link. An approval is
|
|
92
95
|
decided by a person, or by an API key an owner granted the explicit scope
|
|
@@ -121,7 +124,8 @@ Two reasons end work for capacity; each has its code in `cavelon explain`:
|
|
|
121
124
|
`model_endpoint_slot_wait_seconds`. Retry later, or, if the endpoint can serve
|
|
122
125
|
more, propose raising the Model Registry row's `max_concurrent_requests`
|
|
123
126
|
(`cavelon models list` shows it). The person decides; only then run
|
|
124
|
-
`cavelon models set-limit <model_id> <n
|
|
127
|
+
`cavelon models set-limit <model_id> <n>` and the confirm command it prints
|
|
128
|
+
(`--confirm <token>` from your shell).
|
|
125
129
|
|
|
126
130
|
`cavelon limits` shows the caps, their source and origin, the slot waits, and
|
|
127
131
|
branch concurrency (how many items of a Map loop run at once, and whether they
|
|
@@ -155,9 +159,9 @@ A scheduled or webhook run has no caller, so it acts as an **API key** bound to
|
|
|
155
159
|
its trigger. `apply` never binds one; it lists unbound triggers in the preview.
|
|
156
160
|
|
|
157
161
|
```bash
|
|
158
|
-
cavelon trigger identity <trigger>
|
|
159
|
-
cavelon trigger identity <trigger> <key-name>
|
|
160
|
-
cavelon trigger identity <trigger> <key-name> --confirm
|
|
162
|
+
cavelon trigger identity <trigger> # who it runs as, what the key must reach
|
|
163
|
+
cavelon trigger identity <trigger> <key-name> # shows the change and its confirm token
|
|
164
|
+
cavelon trigger identity <trigger> <key-name> --confirm <token> # from your shell; a person's terminal takes a bare --confirm
|
|
161
165
|
```
|
|
162
166
|
|
|
163
167
|
Binding gives the trigger standing authority over its Sandboxes: show the person
|
|
@@ -14,7 +14,8 @@ use it when you parse the result.
|
|
|
14
14
|
## Before anything
|
|
15
15
|
|
|
16
16
|
- `cavelon status` says which instance, tenant and solution this folder is
|
|
17
|
-
bound to, the solution's state (draft
|
|
17
|
+
bound to, the solution's state (draft, active, or inactive after a
|
|
18
|
+
deactivate; whether it is ready to
|
|
18
19
|
activate, its latest test run), the last pull and the open previews.
|
|
19
20
|
`cavelon whoami` says who the token acts as, when it expires, whether it may
|
|
20
21
|
enter Platform mode and which tenants it reaches.
|
|
@@ -45,7 +46,14 @@ use it when you parse the result.
|
|
|
45
46
|
add `cavelon pull` after it. From your shell, `init --harness "<name>"`
|
|
46
47
|
creates a solution that does not exist yet as a draft; the MCP tool `init`
|
|
47
48
|
never creates one and names the `cavelon harness new <slug> --name "<name>"`
|
|
48
|
-
that does.
|
|
49
|
+
that does. A name close to an existing solution's is refused as a likely
|
|
50
|
+
typo (`solution_not_found`, naming the closest ones, creating nothing): ask
|
|
51
|
+
the person whether they meant that one, and only for a new solution run
|
|
52
|
+
`cavelon init ... --harness "<name>" --new`. Until a `cavelon.yaml` exists,
|
|
53
|
+
pass `--tenant` (and `--instance`) to every command, `harness new` and
|
|
54
|
+
`pull` included: without it a command acts in the tenant `cavelon use`
|
|
55
|
+
chose, which may be another one. The commands `cavelon` prints carry the
|
|
56
|
+
`--tenant` you gave; run them as printed. `apply` never creates a solution: when the one an env file names
|
|
49
57
|
is missing it stops with `solution_not_found` and names that command. To start from a package file (a blueprint, an
|
|
50
58
|
export from another instance), run
|
|
51
59
|
`cavelon init --instance <url> --tenant <tenant> --from <file>` instead of
|
|
@@ -67,8 +75,15 @@ use it when you parse the result.
|
|
|
67
75
|
commit. `git diff` then shows what someone changed in the Admin. A test
|
|
68
76
|
suite goes back to the file it came from, whatever its name. A solution's
|
|
69
77
|
pull leaves the tenant-wide sections (the tenant's settings, its model
|
|
70
|
-
list) out of the folder
|
|
71
|
-
|
|
78
|
+
list) out of the folder, and `apply` leaves them out of the solution's
|
|
79
|
+
import. `pull --include-tenant-wide` writes them; `apply
|
|
80
|
+
--include-tenant-wide` (the MCP tool's `include_tenant_wide`) imports them,
|
|
81
|
+
for every solution of the tenant, so only with the person's say-so; its
|
|
82
|
+
preview names the active solutions the change reaches.
|
|
83
|
+
`validate` warns about a tenant-wide file in the folder
|
|
84
|
+
(`tenant_wide_section`); on an instance that does not publish
|
|
85
|
+
`include_tenant_wide`, `apply` imports such a file anyway and says so:
|
|
86
|
+
remove it unless the person wants it.
|
|
72
87
|
2. **Edit** the files in `package/` (one file per schema section) and `tests/`
|
|
73
88
|
(one file per test suite). See the cavelon-authoring skill.
|
|
74
89
|
3. **Validate** offline: `cavelon validate`. Fix every error; `cavelon explain
|
|
@@ -83,7 +98,9 @@ use it when you parse the result.
|
|
|
83
98
|
names a check it could not make (offline, no list). After writing files by
|
|
84
99
|
hand, run `cavelon fmt`: it fills in the defaults the export writes and
|
|
85
100
|
numbers test cases in their written order, so the first `pull` after the
|
|
86
|
-
apply rewrites only what changed on the instance.
|
|
101
|
+
apply rewrites only what changed on the instance. It drops comments, as
|
|
102
|
+
pull does, and names each file whose comments it drops (`cavelon fmt
|
|
103
|
+
--check` says so first): keep notes the person needs elsewhere.
|
|
87
104
|
4. **Preview**: `cavelon apply --env test` (or `--harness <name or slug>`). Nothing is
|
|
88
105
|
imported yet. Read the preview: what is created, updated or deleted, which
|
|
89
106
|
active solutions it reaches, what the target still needs (variables and
|
|
@@ -93,12 +110,16 @@ use it when you parse the result.
|
|
|
93
110
|
old → new`) and the fields it does not apply ("not applied", with the
|
|
94
111
|
command that sets each). A blocked preview names each blocker with its
|
|
95
112
|
code, package file and path, and hint; `cavelon explain <code>` says more.
|
|
113
|
+
A preview that changes nothing says "Nothing to import" and stores no
|
|
114
|
+
preview: there is nothing to confirm.
|
|
96
115
|
5. **Confirm** exactly that preview: `cavelon apply --confirm <preview-id>`
|
|
97
116
|
(the line `apply` printed, with the same `--env` and `--tenant`). Exit 4
|
|
98
117
|
means the preview is stale and nothing was imported: the target changed on
|
|
99
|
-
the instance (`import_preview_stale
|
|
100
|
-
(`preview_files_changed`, naming them),
|
|
101
|
-
old (`preview_expired`)
|
|
118
|
+
the instance (`import_preview_stale`; a recent instance names what changed), the package files changed since
|
|
119
|
+
(`preview_files_changed`, naming them), the preview is more than a day
|
|
120
|
+
old (`preview_expired`), another preview was imported after it
|
|
121
|
+
(`preview_superseded`), it was imported already (`preview_applied`), or it
|
|
122
|
+
was discarded (`preview_discarded`). Preview again, show the new preview when the rules
|
|
102
123
|
below say so, and confirm the new id. Use `--allow-stale` only when the
|
|
103
124
|
person wants exactly the old preview imported. When the error lists
|
|
104
125
|
`blockers`, the import's own check found them as it applied: fix what each
|
|
@@ -125,6 +146,12 @@ use it when you parse the result.
|
|
|
125
146
|
document is replaced once the new file is verified; where it cannot,
|
|
126
147
|
`--replace` shows the documents it would deactivate after the upload and
|
|
127
148
|
needs `--confirm`: show the person that first.
|
|
149
|
+
- A file whose content is already an active document is not uploaded
|
|
150
|
+
again: "identical to the active document …; nothing new was created
|
|
151
|
+
(deduplicated)", with nothing to wait for and nothing replaced. Where the
|
|
152
|
+
instance publishes its documents' file hashes, `--dry-run` says it first
|
|
153
|
+
("nothing new would be created"; `--json`: `identical`, and
|
|
154
|
+
`content_compared` false where it cannot tell).
|
|
128
155
|
A test Sandbox gets its files with `cavelon sandbox seed <sandbox> <folder>`
|
|
129
156
|
(isolated container) or `cavelon sandbox refresh <sandbox>` after the files
|
|
130
157
|
were put on the VM (customer VM).
|
|
@@ -159,9 +186,12 @@ says when the solution it activated is not the default.
|
|
|
159
186
|
conversation to trace. A draft answers only a person's token, as a
|
|
160
187
|
Playground run.
|
|
161
188
|
- `cavelon deactivate --harness <solution>` takes an active solution out of
|
|
162
|
-
live traffic: it previews, and only
|
|
163
|
-
|
|
164
|
-
|
|
189
|
+
live traffic: it previews, and only the confirm command it prints
|
|
190
|
+
deactivates. Its status becomes `inactive`, not `draft`: it keeps its
|
|
191
|
+
configuration, answers no live traffic, and `cavelon activate` puts it back
|
|
192
|
+
through its readiness gate. It is the person's decision, like the default
|
|
193
|
+
route; the default route itself is refused until another solution is the
|
|
194
|
+
default.
|
|
165
195
|
|
|
166
196
|
## Show the person before confirming
|
|
167
197
|
|
|
@@ -172,6 +202,10 @@ show the preview to the person, and confirm only after they agree, when:
|
|
|
172
202
|
solution is active;
|
|
173
203
|
- the environment is `prod` (`--env prod`), or the preview deletes anything
|
|
174
204
|
(`--mode replace`);
|
|
205
|
+
- the preview changes tenant-wide sections (`tenant-wide: … change for every
|
|
206
|
+
solution of the tenant, reaching the active solutions …`, after
|
|
207
|
+
`--include-tenant-wide` or on an instance that imports them anyway): every
|
|
208
|
+
solution of the tenant sees the change;
|
|
175
209
|
- the preview lists target needs (secrets, grants, identities): only a person
|
|
176
210
|
can provide them, with `cavelon secrets set <name>` or in the Admin.
|
|
177
211
|
|
|
@@ -200,11 +234,12 @@ closest one named.
|
|
|
200
234
|
**From your shell, `--confirm` takes the same token.** Run by a coding agent,
|
|
201
235
|
`limits set`, `models set-limit`, `loop cancel`, `sandbox seed`,
|
|
202
236
|
`trigger identity`, `harness default`, `activate --make-default`,
|
|
203
|
-
`kb upload --replace`, `variables delete` and `secrets delete`
|
|
204
|
-
preview with a confirm token and the command that confirms it
|
|
237
|
+
`deactivate`, `kb upload --replace`, `variables delete` and `secrets delete`
|
|
238
|
+
print their preview with a confirm token and the command that confirms it
|
|
205
239
|
(`… --confirm <token>`). Show the preview, then run exactly that command. A
|
|
206
|
-
bare `--confirm
|
|
207
|
-
4 with the new
|
|
240
|
+
bare `--confirm`, as the docs show it for a person's terminal, changes nothing
|
|
241
|
+
from your shell and exits 5; a token of another change exits 4 with the new
|
|
242
|
+
preview.
|
|
208
243
|
|
|
209
244
|
**`cavelon api` from your shell has the guards of the MCP `api` tool**, since
|
|
210
245
|
`cavelon` sees that a coding agent runs it (`CLAUDECODE`, `CODEX_THREAD_ID`, `CODEX_SANDBOX`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cavelon/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "The cavelon binary: CLI and local MCP server for building Cavelon solutions with a coding agent.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/goodguys-gmbh/cavelon-dev-kit",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@eslint/js": "^10.0.1",
|
|
45
45
|
"@types/node": "^20.19.0",
|
|
46
46
|
"eslint": "^10.12.0",
|
|
47
|
-
"typescript": "~
|
|
47
|
+
"typescript": "~6.0.3",
|
|
48
48
|
"typescript-eslint": "^8.71.0",
|
|
49
49
|
"vitest": "^4.0.0"
|
|
50
50
|
}
|