@cavelon/cli 0.1.11 → 0.1.13
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 +12 -6
- package/dist/change-confirmation.js +93 -0
- package/dist/commands/api.js +41 -13
- package/dist/commands/chat.js +6 -3
- package/dist/commands/db.js +181 -19
- package/dist/commands/index.js +2 -1
- package/dist/commands/limits-set.js +7 -3
- package/dist/commands/loops.js +20 -12
- package/dist/commands/models.js +10 -5
- package/dist/commands/session.js +5 -3
- package/dist/commands/setup.js +4 -3
- package/dist/commands/solution.js +73 -28
- package/dist/commands/tenants.js +18 -11
- package/dist/commands/values.js +59 -19
- package/dist/confirm-token.js +80 -5
- package/dist/context.js +2 -0
- package/dist/database-queries.js +168 -0
- package/dist/http.js +34 -2
- package/dist/install.js +30 -0
- package/dist/invoke.js +8 -2
- package/dist/kit-codes.js +4 -2
- package/dist/mcp.js +40 -12
- package/dist/openapi.js +7 -0
- package/dist/printed.js +5 -0
- package/dist/run-program.js +2 -1
- package/dist/secret-access.js +14 -5
- package/dist/setup-agents.js +63 -17
- package/dist/skills/cavelon-authoring/SKILL.md +29 -11
- package/dist/skills/cavelon-long-running/SKILL.md +16 -12
- package/dist/skills/cavelon-loop/SKILL.md +74 -41
- package/dist/skills/cavelon-testing/SKILL.md +13 -4
- package/dist/update-check.js +17 -4
- package/package.json +1 -1
|
@@ -58,7 +58,7 @@ Do not work around it; use the other column.
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
cavelon loop start <trigger> --input @request.json # previews: the trigger, its solution, the payload
|
|
61
|
-
cavelon loop start <trigger> --input @request.json --confirm <token> # starts it
|
|
61
|
+
cavelon loop start <trigger> --input @request.json --confirm <token> # a draft's trigger: starts it, the run id and an operation id
|
|
62
62
|
cavelon loop watch <run> --timeout 5m # each iteration's verdict, then the loop's outcome
|
|
63
63
|
cavelon loop iterations <run> # state, budget, iterations (a page at a time)
|
|
64
64
|
cavelon wait <operation-id> --timeout 90s # exit 0 done, 1 failed, 5 needs a person, 6 still running
|
|
@@ -66,11 +66,12 @@ cavelon wait <operation-id> --timeout 90s # exit 0 done, 1 failed, 5
|
|
|
66
66
|
|
|
67
67
|
A loop started from `cavelon` runs **as the person whose token it is**, checked
|
|
68
68
|
again on every iteration, and spends the tenant's budget. So `loop start`
|
|
69
|
-
previews first and starts nothing without `--confirm
|
|
70
|
-
it prints (from your shell it carries
|
|
71
|
-
`loop_start` again with `confirm` set to its
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
previews first and starts nothing without `--confirm`. For a trigger of a
|
|
70
|
+
draft solution, run the confirm command it prints (from your shell it carries
|
|
71
|
+
the preview's token; over MCP call `loop_start` again with `confirm` set to its
|
|
72
|
+
`confirm_token`). Any other run needs the person's yes (`needs_person` in the
|
|
73
|
+
preview): over MCP the client asks them when you confirm with the token; from
|
|
74
|
+
your shell the preview names the command they run in their own terminal. If `loop start` exits 8 (a timeout, a cut
|
|
74
75
|
connection), the run may have started: retry only with the
|
|
75
76
|
`--idempotency-key <key>` its error names, never without it, or a second run
|
|
76
77
|
starts and spends the budget again. `cavelon trace <operation-id>` reads the
|
|
@@ -130,8 +131,9 @@ Two reasons end work for capacity; each has its code in `cavelon explain`:
|
|
|
130
131
|
`model_endpoint_slot_wait_seconds`. Retry later, or, if the endpoint can serve
|
|
131
132
|
more, propose raising the Model Registry row's `max_concurrent_requests`
|
|
132
133
|
(`cavelon models list` shows it). The person decides; only then run
|
|
133
|
-
`cavelon models set-limit <model_id> <n
|
|
134
|
-
|
|
134
|
+
`cavelon models set-limit <model_id> <n>`: over MCP the client asks the person
|
|
135
|
+
when you confirm with the token; from your shell the person runs the confirm
|
|
136
|
+
command it prints in their own terminal.
|
|
135
137
|
|
|
136
138
|
`cavelon limits` shows the caps, their source and origin, the slot waits, and
|
|
137
139
|
branch concurrency (how many items of a Map loop run at once, and whether they
|
|
@@ -166,12 +168,14 @@ its trigger. `apply` never binds one; it lists unbound triggers in the preview.
|
|
|
166
168
|
|
|
167
169
|
```bash
|
|
168
170
|
cavelon trigger identity <trigger> # who it runs as, what the key must reach
|
|
169
|
-
cavelon trigger identity <trigger> <key-name> # shows the change
|
|
170
|
-
cavelon trigger identity <trigger> <key-name> --confirm
|
|
171
|
+
cavelon trigger identity <trigger> <key-name> # shows the change
|
|
172
|
+
cavelon trigger identity <trigger> <key-name> --confirm # the person, in their own terminal
|
|
171
173
|
```
|
|
172
174
|
|
|
173
|
-
Binding gives the trigger standing authority over its Sandboxes
|
|
174
|
-
|
|
175
|
+
Binding gives the trigger standing authority over its Sandboxes, so the person
|
|
176
|
+
confirms it: over MCP the client asks them when you call `trigger_identity`
|
|
177
|
+
with the preview's token; from your shell they run the confirm command in their
|
|
178
|
+
own terminal. Name the key by its name or id, never
|
|
175
179
|
its value. A personal access token is never an execution identity. Creating keys
|
|
176
180
|
and adding a key to a Sandbox's Access stay in the Admin; the output says when
|
|
177
181
|
that is still missing.
|
|
@@ -35,7 +35,9 @@ use it when you parse the result.
|
|
|
35
35
|
- **Secrets are set by a person.** When a preview or `cavelon secrets list`
|
|
36
36
|
names a secret that is not set, tell the person the exact command to run in
|
|
37
37
|
their terminal, `cavelon secrets set <name>` (as `apply` prints it, with its
|
|
38
|
-
`--env` and `--tenant`).
|
|
38
|
+
`--env` and `--tenant`). Where the instance lets no token set a secret,
|
|
39
|
+
`apply`, `activate`, `status` and `secrets list` name the Admin page
|
|
40
|
+
(Settings › Secrets) instead: tell the person that, not the command. Never ask for the value, never pipe or pass one yourself; there is
|
|
39
41
|
no MCP tool for it. Plain-text variables you may set with `cavelon variables
|
|
40
42
|
set <name> <value>` when the value is not a credential and your role may
|
|
41
43
|
manage the tenant's settings, as for a secret: a Builder's may not, and
|
|
@@ -97,10 +99,20 @@ use it when you parse the result.
|
|
|
97
99
|
(`cavelon db test <connection>`); you never handle its host, user or
|
|
98
100
|
password. Use the same connection name in every tenant and environment
|
|
99
101
|
(`env/test.yaml`, `env/prod.yaml`), each pointing at that environment's
|
|
100
|
-
database, so one package serves them all. `cavelon db
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
database, so one package serves them all. `cavelon db instance` says which
|
|
103
|
+
dialects this instance runs and the addresses it connects from, which the
|
|
104
|
+
customer allows through their database's firewall; tell the person both
|
|
105
|
+
before they set up a connection. The dialects are `postgresql`, `mysql` and
|
|
106
|
+
`mssql` (SQL Server). A SQL Server login that can write keeps the
|
|
107
|
+
connection's queries from running (`write_privileges_unacknowledged`) until
|
|
108
|
+
it may only read or a superadmin acknowledges it in the Admin, so ask for a
|
|
109
|
+
read-only login. A stored-procedure query (`EXEC`, SQL Server only) needs
|
|
110
|
+
one without any write privileges, acknowledged or not
|
|
111
|
+
(`write_privileges_block_procedure`), and a procedure that only reads.
|
|
112
|
+
`cavelon db connections` shows which exist, whether their
|
|
113
|
+
last test passed, when their CA certificates expire and why a connection's
|
|
114
|
+
queries, or its stored-procedure queries, cannot be enabled. A pull writes each query's SQL into
|
|
115
|
+
`package/tools.yaml`, so the repository holds it: review it like code.
|
|
104
116
|
|
|
105
117
|
## The loop
|
|
106
118
|
|
|
@@ -219,9 +231,10 @@ says when the solution it activated is not the default.
|
|
|
219
231
|
- **Ask the person** whether the new solution should become the default. It
|
|
220
232
|
changes live traffic; never decide it yourself.
|
|
221
233
|
- With their yes: `cavelon activate --make-default` (or `cavelon harness
|
|
222
|
-
default <solution>`) shows the change, naming the current default; show it
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
default <solution>`) shows the change, naming the current default; show it.
|
|
235
|
+
You cannot confirm it yourself: over MCP the client asks the person when you
|
|
236
|
+
call the tool with the preview's token; from your shell the person runs the
|
|
237
|
+
confirm command it printed in their own terminal. `harness default` refuses a draft
|
|
225
238
|
(`solution_not_active`, exit 4): only an active solution can be the
|
|
226
239
|
default, so use `cavelon activate --make-default`.
|
|
227
240
|
- `is_default` in `harnesses.yaml` is not applied by `apply`; the preview
|
|
@@ -241,8 +254,12 @@ says when the solution it activated is not the default.
|
|
|
241
254
|
|
|
242
255
|
## Show the person before confirming
|
|
243
256
|
|
|
244
|
-
Confirm on your own only
|
|
245
|
-
|
|
257
|
+
Show every preview to the person. Confirm on your own only a preview that
|
|
258
|
+
needs no person: `apply` to a draft solution in a test environment (the
|
|
259
|
+
preview says nothing about showing it to a person), `loop start` of a trigger
|
|
260
|
+
of a draft solution, `loop cancel` and `sandbox seed` of a test run or Sandbox
|
|
261
|
+
you started, and `kb upload --replace`. Stop, show the preview, and wait for
|
|
262
|
+
the person when:
|
|
246
263
|
|
|
247
264
|
- the preview lists an active solution under "reaches active", or the target
|
|
248
265
|
solution is active;
|
|
@@ -253,24 +270,40 @@ show the preview to the person, and confirm only after they agree, when:
|
|
|
253
270
|
`--include-tenant-wide` or on an instance that imports them anyway): every
|
|
254
271
|
solution of the tenant sees the change;
|
|
255
272
|
- the preview lists target needs (secrets, grants, identities): only a person
|
|
256
|
-
can provide them, with `cavelon secrets set <name>` or in the Admin
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
`
|
|
266
|
-
`
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
can provide them, with `cavelon secrets set <name>` or in the Admin, as the
|
|
274
|
+
preview names it.
|
|
275
|
+
|
|
276
|
+
**The person's yes is theirs to give.** For these, and for `tenant create` (a
|
|
277
|
+
new tenant on the platform), `variables set` that replaces a value (every
|
|
278
|
+
solution of the tenant reads it) and `variables delete`, `loop start` of a
|
|
279
|
+
trigger whose solution is not a draft (a run acts as the person and spends
|
|
280
|
+
budget), `limits set`, `models set-limit`, `trigger identity` (standing
|
|
281
|
+
authority for a trigger), `harness default`, `activate --make-default`,
|
|
282
|
+
`activate` of a solution its preview says a channel or trigger reaches,
|
|
283
|
+
`deactivate` (they move live traffic), and `api` for any operation that is
|
|
284
|
+
not read-only, `cavelon` does not take your confirm as theirs. Their preview
|
|
285
|
+
says how in `needs_person`:
|
|
286
|
+
|
|
287
|
+
- `"client"` (over MCP, where your client can ask the person): show the
|
|
288
|
+
preview, then call the tool again with the same arguments and `confirm` set
|
|
289
|
+
to its token (for `apply`, the preview id). The client then asks the person
|
|
290
|
+
to approve exactly that change, and nothing changes without their yes. A no,
|
|
291
|
+
or no answer within 10 minutes, returns `confirm_declined` (exit code 5):
|
|
292
|
+
ask the person what they want instead of trying again.
|
|
293
|
+
- `"terminal"` (your shell, or a client that cannot ask): the preview's
|
|
294
|
+
`confirm` is the command the person runs in their own terminal, not with `!`
|
|
295
|
+
in your session. Give them that command and wait; never run it yourself. A
|
|
296
|
+
token is refused (`confirm_needs_person`, exit code 5).
|
|
297
|
+
|
|
298
|
+
A new variable, and a draft solution no channel or trigger reaches, need no
|
|
299
|
+
confirm.
|
|
300
|
+
|
|
301
|
+
An instance that publishes `confirmations.enforced` checks the person's yes
|
|
302
|
+
too: after it, `cavelon` asks the instance for a confirmation id for exactly
|
|
303
|
+
that request and sends it along; you never handle it. `confirmation_required`
|
|
304
|
+
or `confirmation_invalid` (exit code 5) means the instance changed nothing:
|
|
305
|
+
show the person the preview again and let them confirm it (in the client's
|
|
306
|
+
dialog or their own terminal), never retry on your own.
|
|
274
307
|
|
|
275
308
|
**Over MCP, confirm with the preview's token.** `api`, `tenant_create`,
|
|
276
309
|
`variables_set` where it replaces a value, `loop_start`, `limits_set`,
|
|
@@ -280,7 +313,8 @@ trigger reaches or with `make_default`, and
|
|
|
280
313
|
`kb_upload` where it would deactivate documents return a `confirm_token` with
|
|
281
314
|
their preview. Show
|
|
282
315
|
the preview, then call the tool again with the same arguments and `confirm`
|
|
283
|
-
set to that token; it makes exactly the change shown
|
|
316
|
+
set to that token; it makes exactly the change shown, after the person's yes
|
|
317
|
+
where the preview says `needs_person`. `confirm: true` is
|
|
284
318
|
refused (`confirm_token_required`), and a token of another change returns the
|
|
285
319
|
new preview with `token_mismatch` (exit code 4): show that one instead. Tool
|
|
286
320
|
arguments are spelled in snake_case (`make_default`, `keep_both`, `dry_run`);
|
|
@@ -290,14 +324,12 @@ closest one named. Over MCP the next steps a tool returns (hints, `next`,
|
|
|
290
324
|
make the call as written, filling a value in angle brackets (a
|
|
291
325
|
`confirm_token` comes from that tool's preview).
|
|
292
326
|
|
|
293
|
-
**From your shell, `--confirm` takes the same token
|
|
294
|
-
|
|
295
|
-
`
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
print their preview with a confirm token and the command that confirms it
|
|
300
|
-
(`… --confirm <token>`). Show the preview, then run exactly that command. A
|
|
327
|
+
**From your shell, `--confirm` takes the same token, where you may confirm.**
|
|
328
|
+
Run by a coding agent, `loop start` of a draft's trigger, `loop cancel`,
|
|
329
|
+
`sandbox seed` and `kb upload --replace` print their preview with a confirm
|
|
330
|
+
token and the command that confirms it (`… --confirm <token>`). Show the
|
|
331
|
+
preview, then run exactly that command. The changes that need the person's yes
|
|
332
|
+
print no token and name the command the person runs in their own terminal. A
|
|
301
333
|
bare `--confirm`, as the docs show it for a person's terminal, changes nothing
|
|
302
334
|
from your shell and exits 5; a token of another change exits 4 with the new
|
|
303
335
|
preview. A line printed before its preview exists ends in
|
|
@@ -307,10 +339,11 @@ preview. A line printed before its preview exists ends in
|
|
|
307
339
|
**`cavelon api` from your shell has the guards of the MCP `api` tool**, since
|
|
308
340
|
`cavelon` sees that a coding agent runs it:
|
|
309
341
|
|
|
310
|
-
- For an operation that is not read-only, it prints the request and
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
342
|
+
- For an operation that is not read-only, it prints the request and the
|
|
343
|
+
command the person runs in their own terminal to send it, and sends nothing.
|
|
344
|
+
Show both to the person; you cannot send it yourself, with or without a
|
|
345
|
+
token (`confirm_needs_person`). Over MCP the `api` tool sends it after the
|
|
346
|
+
person's yes in the client.
|
|
314
347
|
- It refuses an operation the instance keeps for a person
|
|
315
348
|
(`operation_for_a_person`) and a body that sets a field the instance marks as
|
|
316
349
|
a secret value (`secret_field_for_a_person`), with or without `--confirm`,
|
|
@@ -152,6 +152,13 @@ the Admin. Then:
|
|
|
152
152
|
Owner runs it once with `cavelon db test-run <query> --value <name>=<value>`,
|
|
153
153
|
identity parameters included; it shows what the model would see. Never put
|
|
154
154
|
a real customer's data into a test file.
|
|
155
|
+
- A stored-procedure query (SQL Server) is test-run the same way; the
|
|
156
|
+
instance refuses the run while the connection's login can write or the
|
|
157
|
+
procedure's definition writes or cannot be read, with a code
|
|
158
|
+
`cavelon explain` explains. A run whose procedure committed or rolled back
|
|
159
|
+
fails with `query_failed` and a `notice`: the query is switched off, and a
|
|
160
|
+
person fixes the procedure. `cavelon db test <connection>` lists the
|
|
161
|
+
procedure queries whose procedure no longer passes (`procedure_findings`).
|
|
155
162
|
- `cavelon db runs <query>` lists each run's outcome and error code (never a
|
|
156
163
|
value or a row), and `cavelon trace` shows the code a failed call answered
|
|
157
164
|
the model with on the tool's span (`error_code`); `cavelon explain <code>`
|
|
@@ -249,10 +256,12 @@ which the tenant's chat and widget never answer with; a draft answers only a
|
|
|
249
256
|
person's token, as a Playground run. `cavelon api chat` with `harness_id` in
|
|
250
257
|
the body does the same, but needs the id and a confirm. `cavelon deactivate
|
|
251
258
|
--harness <solution>` takes an active solution out of live traffic again; it
|
|
252
|
-
previews first and is the person's decision
|
|
253
|
-
|
|
259
|
+
previews first and is the person's decision: show the preview; over MCP the
|
|
260
|
+
client asks them when you confirm with its token, and from your shell they run
|
|
261
|
+
the confirm command in their own terminal. When every suite passes,
|
|
254
262
|
`cavelon activate --harness <name or slug>` goes through the readiness gate; if the
|
|
255
263
|
token may not activate, a person activates in the Admin. A solution that a
|
|
256
264
|
channel or an active trigger reaches goes live for them at once, so its
|
|
257
|
-
activation previews first and needs the
|
|
258
|
-
|
|
265
|
+
activation previews first and needs the person's yes: show it; over MCP the
|
|
266
|
+
client asks them when you confirm with its token, and from your shell they run
|
|
267
|
+
the confirm command in their own terminal.
|
package/dist/update-check.js
CHANGED
|
@@ -224,12 +224,23 @@ const PLUGIN_UPDATE = {
|
|
|
224
224
|
claude: "`claude plugin marketplace update cavelon-dev-kit` and `claude plugin update cavelon@cavelon-dev-kit`",
|
|
225
225
|
codex: "`codex plugin marketplace upgrade cavelon-dev-kit` and `codex plugin add cavelon@cavelon-dev-kit`",
|
|
226
226
|
};
|
|
227
|
+
const INSTALL_DOCS = `https://github.com/${REPOSITORY}/blob/main/docs/install`;
|
|
227
228
|
function pluginUpdate(client) {
|
|
228
229
|
const name = client?.toLowerCase() ?? "";
|
|
229
230
|
if (name.includes("claude"))
|
|
230
|
-
return PLUGIN_UPDATE.claude
|
|
231
|
+
return `with ${PLUGIN_UPDATE.claude}`;
|
|
231
232
|
if (name.includes("codex"))
|
|
232
|
-
return PLUGIN_UPDATE.codex
|
|
233
|
+
return `with ${PLUGIN_UPDATE.codex}`;
|
|
234
|
+
if (name.includes("gemini"))
|
|
235
|
+
return "with `gemini extensions update cavelon`";
|
|
236
|
+
if (name.includes("cursor"))
|
|
237
|
+
return `as ${INSTALL_DOCS}/cursor.md#update says`;
|
|
238
|
+
if (name.includes("kiro"))
|
|
239
|
+
return `as ${INSTALL_DOCS}/kiro.md#update says`;
|
|
240
|
+
if (name.includes("copilot"))
|
|
241
|
+
return "with `copilot plugin update cavelon`";
|
|
242
|
+
if (name.includes("visual studio code") || name.includes("vscode"))
|
|
243
|
+
return `as ${INSTALL_DOCS}/vscode-copilot.md#update says`;
|
|
233
244
|
return undefined;
|
|
234
245
|
}
|
|
235
246
|
export function sessionWarning(facts) {
|
|
@@ -249,10 +260,12 @@ export function sessionWarning(facts) {
|
|
|
249
260
|
if (pluginBehind) {
|
|
250
261
|
said.push(`The Cavelon plugin is ${plugin}${latest ? "" : `, older than cavelon ${newest}`}.`);
|
|
251
262
|
const commands = pluginUpdate(facts.client);
|
|
252
|
-
asks.push(commands
|
|
263
|
+
asks.push(commands
|
|
264
|
+
? `Update the plugin ${commands}.`
|
|
265
|
+
: `Update the plugin: in Claude Code with ${PLUGIN_UPDATE.claude}; in Codex with ${PLUGIN_UPDATE.codex}; in another agent as its page in ${INSTALL_DOCS}/ says.`);
|
|
253
266
|
}
|
|
254
267
|
else if (latest && plugin === undefined && pluginUpdate(facts.client)) {
|
|
255
|
-
asks.push(`If they use the Cavelon plugin, also update it
|
|
268
|
+
asks.push(`If they use the Cavelon plugin, also update it ${pluginUpdate(facts.client)}.`);
|
|
256
269
|
}
|
|
257
270
|
if (skillsBehind) {
|
|
258
271
|
said.push(`The skills \`cavelon init --agents\` wrote in this solution folder are from cavelon ${skills}.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cavelon/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
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",
|