@cavelon/cli 0.1.9 → 0.1.10

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 (52) hide show
  1. package/dist/branches.js +4 -3
  2. package/dist/capacity.js +3 -2
  3. package/dist/code-hints.js +5 -4
  4. package/dist/command.js +6 -0
  5. package/dist/commands/api.js +3 -3
  6. package/dist/commands/async.js +7 -4
  7. package/dist/commands/chat.js +10 -12
  8. package/dist/commands/docs.js +5 -3
  9. package/dist/commands/fmt.js +6 -4
  10. package/dist/commands/index.js +2 -0
  11. package/dist/commands/init.js +106 -28
  12. package/dist/commands/limits-set.js +8 -9
  13. package/dist/commands/limits.js +4 -3
  14. package/dist/commands/loops.js +15 -14
  15. package/dist/commands/models.js +10 -12
  16. package/dist/commands/sandboxes.js +15 -14
  17. package/dist/commands/schema.js +6 -5
  18. package/dist/commands/session.js +27 -15
  19. package/dist/commands/setup.js +4 -2
  20. package/dist/commands/solution.js +152 -68
  21. package/dist/commands/tenants.js +14 -14
  22. package/dist/commands/values.js +62 -38
  23. package/dist/commands/work.js +18 -12
  24. package/dist/confirm-token.js +3 -1
  25. package/dist/contracts.js +2 -1
  26. package/dist/default-route.js +1 -1
  27. package/dist/features.js +2 -1
  28. package/dist/harness-ref.js +6 -4
  29. package/dist/http.js +4 -3
  30. package/dist/invoke.js +3 -2
  31. package/dist/kit-codes.js +9 -2
  32. package/dist/limits.js +1 -1
  33. package/dist/main.js +13 -1
  34. package/dist/mcp.js +41 -21
  35. package/dist/openapi.js +5 -2
  36. package/dist/operations.js +3 -2
  37. package/dist/package-check.js +10 -4
  38. package/dist/package-files.js +5 -1
  39. package/dist/package-format.js +10 -0
  40. package/dist/preview-report.js +44 -5
  41. package/dist/printed.js +182 -0
  42. package/dist/project.js +2 -1
  43. package/dist/results.js +1 -1
  44. package/dist/secret-access.js +30 -0
  45. package/dist/session.js +3 -11
  46. package/dist/shell.js +0 -3
  47. package/dist/skills/cavelon-authoring/SKILL.md +9 -2
  48. package/dist/skills/cavelon-long-running/SKILL.md +1 -1
  49. package/dist/skills/cavelon-loop/SKILL.md +11 -4
  50. package/dist/tenant-choice.js +7 -7
  51. package/dist/trace-view.js +1 -1
  52. package/package.json +1 -1
@@ -138,7 +138,9 @@ it and where, as the output says.
138
138
 
139
139
  A file of a section the instance does not know is kept as it is; the preview
140
140
  lists it under "ignored". `package/manifest.yaml` names the package format
141
- version; leave it as `pull` wrote it. Some fields are not applied by an
141
+ version and the tenant the package is for; leave it as `pull` or `init`
142
+ wrote it (`init` writes a minimal one for a new solution, and the first `pull`
143
+ replaces it). Some fields are not applied by an
142
144
  import: the preview lists them under "not applied", each with the command
143
145
  that sets it (a solution's `status` with `cavelon activate`, its `is_default`
144
146
  with `cavelon harness default`).
@@ -300,7 +302,12 @@ schema has them: `cavelon validate` reports an unknown section):
300
302
  without echoing it. Never ask for the value, never put it into a file,
301
303
  an argument or a message, and never put a credential into a variable.
302
304
  `cavelon secrets list` (the `secrets_list` tool) shows which are set,
303
- never a value. A tenant API key cannot set a secret at all.
305
+ never a value. A tenant API key cannot set a secret at all, and neither can
306
+ a person whose role may not manage secrets (a Builder): `cavelon whoami`
307
+ says "may set secrets: no", and `secrets set`, `activate` and `status` then
308
+ name who does instead. Tell the person that a tenant Owner sets it, in the
309
+ Admin under Settings › Secrets or with their own token; do not suggest the
310
+ command to someone whose role cannot run it.
304
311
 
305
312
  ## After each edit
306
313
 
@@ -72,7 +72,7 @@ run's traces. Keep each `watch` or `wait` under your shell's time
72
72
  limit and run it again to resume (exit 6 means still running). Over MCP, use the
73
73
  `loop_iterations` and `operation_status` tools; `loop_iterations` never
74
74
  blocks, and `operation_status` waits only when given a `timeout` (at most 50
75
- seconds).
75
+ seconds); its `resume` is the `operation_status` call to make again.
76
76
 
77
77
  - **Pause** at the next safe point: `cavelon loop pause <run>`. Resume with
78
78
  `cavelon loop resume <run>`. A paused loop makes `wait` and `loop watch` exit
@@ -58,7 +58,7 @@ use it when you parse the result.
58
58
  pass `--tenant` (and `--instance`) to every command, `harness new` and
59
59
  `pull` included: without it a command acts in the tenant `cavelon use`
60
60
  chose, which may be another one. The commands `cavelon` prints carry the
61
- `--tenant` you gave; run them as printed. `apply` never creates a solution: when the one an env file names
61
+ `--tenant` (and `--env`) you gave, confirm lines included; run them as printed. `apply` never creates a solution: when the one an env file names
62
62
  is missing it stops with `solution_not_found` and names that command. To start from a package file (a blueprint, an
63
63
  export from another instance), run
64
64
  `cavelon init --instance <url> --tenant <tenant> --from <file>` instead of
@@ -84,7 +84,9 @@ use it when you parse the result.
84
84
  import. `pull --include-tenant-wide` writes them; `apply
85
85
  --include-tenant-wide` (the MCP tool's `include_tenant_wide`) imports them,
86
86
  for every solution of the tenant, so only with the person's say-so; its
87
- preview names the active solutions the change reaches.
87
+ preview names the sections the confirm would import (`would_import`) and
88
+ the active solutions the change reaches, and warns of a change only where
89
+ one of those sections differs from the instance's.
88
90
  `validate` warns about a tenant-wide file in the folder
89
91
  (`tenant_wide_section`); on an instance that does not publish
90
92
  `include_tenant_wide`, `apply` imports such a file anyway and says so:
@@ -234,7 +236,10 @@ refused (`confirm_token_required`), and a token of another change returns the
234
236
  new preview with `token_mismatch` (exit code 4): show that one instead. Tool
235
237
  arguments are spelled in snake_case (`make_default`, `keep_both`, `dry_run`);
236
238
  an argument a tool does not list is refused (`unknown_argument`) with the
237
- closest one named.
239
+ closest one named. Over MCP the next steps a tool returns (hints, `next`,
240
+ `resume`, `confirm`) are tool calls, `harness_default {"solution":"support"}`:
241
+ make the call as written, filling a value in angle brackets (a
242
+ `confirm_token` comes from that tool's preview).
238
243
 
239
244
  **From your shell, `--confirm` takes the same token.** Run by a coding agent,
240
245
  `limits set`, `models set-limit`, `loop cancel`, `sandbox seed`,
@@ -244,7 +249,9 @@ print their preview with a confirm token and the command that confirms it
244
249
  (`… --confirm <token>`). Show the preview, then run exactly that command. A
245
250
  bare `--confirm`, as the docs show it for a person's terminal, changes nothing
246
251
  from your shell and exits 5; a token of another change exits 4 with the new
247
- preview.
252
+ preview. A line printed before its preview exists ends in
253
+ `--confirm <confirm_token of its preview>`: run the command without
254
+ `--confirm` first for the preview and its token.
248
255
 
249
256
  **`cavelon api` from your shell has the guards of the MCP `api` tool**, since
250
257
  `cavelon` sees that a coding agent runs it (`CLAUDECODE`, `CODEX_THREAD_ID`, `CODEX_SANDBOX`,
@@ -2,7 +2,7 @@ import { closest, displayName, MAX_LISTED, pick } from "./choose.js";
2
2
  import { CavelonError, ExitCode } from "./errors.js";
3
3
  import { readTenantless } from "./principal.js";
4
4
  import { canAsk } from "./prompt.js";
5
- import { cavelonCommand } from "./shell.js";
5
+ import { cavelonCommand, fill } from "./printed.js";
6
6
  export function listsTenants(tenantless) {
7
7
  return Boolean(tenantless && !tenantless.refused && tenantless.tenants);
8
8
  }
@@ -27,7 +27,7 @@ export async function chooseTenant(ctx, client, reach, options = {}) {
27
27
  return { kind: "open" };
28
28
  const later = reachesAll && options.later;
29
29
  const intro = later
30
- ? `This token works in every tenant on ${client.url}, one at a time: \`cavelon use\` switches, ` +
30
+ ? `This token works in every tenant on ${client.url}, one at a time: \`${cavelonCommand("use")}\` switches, ` +
31
31
  `and --tenant or \`tenant:\` in cavelon.yaml choose one per command or per solution folder.${tenants.length ? "\nYours:" : ""}`
32
32
  : reachesAll
33
33
  ? `This token reaches every tenant on ${client.url}.${tenants.length ? " Yours:" : ""}`
@@ -52,18 +52,18 @@ export function commandLines(tenants, command) {
52
52
  const width = Math.max(...shown.map((s) => s.text.length));
53
53
  const lines = shown.map((s) => ` ${s.name ? `${s.text.padEnd(width)} ${s.name}` : s.text}`);
54
54
  if (tenants.length > shown.length)
55
- lines.push(` … and ${tenants.length - shown.length} more (\`cavelon tenant list\` lists them)`);
55
+ lines.push(` … and ${tenants.length - shown.length} more (\`${cavelonCommand("tenant", "list")}\` lists them)`);
56
56
  return lines.join("\n");
57
57
  }
58
58
  export function choicesOf(tenants, command) {
59
59
  return tenants.map((t) => ({ id: t.id, slug: t.slug, name: t.name, role: t.role, is_default: t.is_default, command: command(tenantRef(t)) }));
60
60
  }
61
- export function tenantOpenError(url, reach, lead, command = { line: (ref) => cavelonCommand("use", ref), template: "cavelon use <name or slug>" }) {
61
+ export function tenantOpenError(url, reach, lead, command = { line: (ref) => cavelonCommand("use", ref), template: cavelonCommand("use", fill("name or slug")) }) {
62
62
  const { tenants, reachesAll } = reach;
63
63
  const what = reachesAll ? "every tenant" : `${tenants.length} tenants`;
64
64
  const lines = tenants.length ? `Run the line for the tenant you want:\n${commandLines(tenants, command.line)}` : "";
65
65
  const search = reachesAll
66
- ? `${lines ? "\nAny other tenant: " : "Choose one: "}\`${command.template}\`; \`cavelon tenant list --search <part of the name>\` finds its slug.`
66
+ ? `${lines ? "\nAny other tenant: " : "Choose one: "}\`${command.template}\`; \`${cavelonCommand("tenant", "list", "--search", fill("part of the name"))}\` finds its slug.`
67
67
  : "";
68
68
  return new CavelonError(ExitCode.usage, {
69
69
  code: "tenant_required",
@@ -89,8 +89,8 @@ export function tenantMissError(ref, pool, reachesAll, from) {
89
89
  if (listed.length)
90
90
  hints.push(`Run the line for the tenant you mean:\n${commandLines(listed, (r) => cavelonCommand("use", r))}`);
91
91
  hints.push(reachesAll
92
- ? "This token reaches every tenant: `cavelon tenant list --search <part of the name>` finds one."
93
- : "`cavelon tenant list` shows the tenants this token reaches with name, slug and id; `cavelon use` alone lets you choose.");
92
+ ? `This token reaches every tenant: \`${cavelonCommand("tenant", "list", "--search", fill("part of the name"))}\` finds one.`
93
+ : `\`${cavelonCommand("tenant", "list")}\` shows the tenants this token reaches with name, slug and id; \`${cavelonCommand("use")}\` alone lets you choose.`);
94
94
  return new CavelonError(ExitCode.failure, {
95
95
  code: "tenant_not_found",
96
96
  message: `No tenant "${ref}" that this token reaches${from ? ` (from ${from})` : ""}.${names ? ` ${label}: ${names}.` : ""}`,
@@ -148,7 +148,7 @@ export const KNOWLEDGE_OUTCOMES = [
148
148
  value: "unusable_hits",
149
149
  recorded_as: "no_usable_evidence",
150
150
  message: "The agent recorded no_usable_evidence although the search returned hits: none of them answers the question. A question the knowledge base does not cover usually shows here, not as content_gap, because a search almost always returns its closest passages.",
151
- hint: "Read the hits on the retrieval span (`cavelon trace … --span <span_id>`). Add the missing content, or improve the document whose passage should have answered it.",
151
+ hint: "Read the hits on the retrieval span (`cavelon trace <run> --trace <trace_id> --span <span_id>`). Add the missing content, or improve the document whose passage should have answered it.",
152
152
  },
153
153
  {
154
154
  value: "retrieval_fault",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cavelon/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
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",