@oxy-hq/cli 0.12.0 → 0.13.0

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 (34) hide show
  1. package/README.md +605 -68
  2. package/dist/main.mjs +12264 -9947
  3. package/dist/main.mjs.map +1 -1
  4. package/dist/{mcp-WxYfGpMF.mjs → mcp-vlYd5Bms.mjs} +4 -183
  5. package/dist/mcp-vlYd5Bms.mjs.map +1 -0
  6. package/json-schemas/agent-test.json +47 -2
  7. package/json-schemas/agentic.json +77 -0
  8. package/json-schemas/config.json +2 -1
  9. package/json-schemas/topic.json +252 -0
  10. package/json-schemas/view.json +473 -0
  11. package/package.json +4 -4
  12. package/skills/oxy-agents/SKILL.md +29 -26
  13. package/skills/oxy-agents/references/quick-reference.md +4 -6
  14. package/skills/oxy-agents/templates/agentic-template.yml +2 -1
  15. package/skills/oxy-airway-pipelines/SKILL.md +27 -2
  16. package/skills/oxy-automations/SKILL.md +42 -28
  17. package/skills/oxy-cli/SKILL.md +57 -9
  18. package/skills/oxy-custom-apps/SKILL.md +303 -7
  19. package/skills/oxy-custom-apps/references/app-calls.md +98 -0
  20. package/skills/oxy-custom-apps/references/phone-layout.md +16 -2
  21. package/skills/oxy-custom-apps/references/sandbox-agent-loop.md +8 -8
  22. package/skills/oxy-evals/SKILL.md +60 -36
  23. package/skills/oxy-evals/references/diagnosis.md +7 -5
  24. package/skills/oxy-evals/references/results-json.md +23 -15
  25. package/skills/oxy-evals/references/writing-expected.md +3 -2
  26. package/skills/oxy-experiments/SKILL.md +4 -3
  27. package/skills/oxy-semantic-modeling/SKILL.md +14 -12
  28. package/template/.claude/hooks/oxyc-cloud-session.sh +40 -8
  29. package/template/.github/workflows/publish.yaml +5 -5
  30. package/template/.github/workflows/validate.yaml +125 -199
  31. package/template/README.md +50 -21
  32. package/template/_gitignore +4 -4
  33. package/template/config.yml +2 -2
  34. package/dist/mcp-WxYfGpMF.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as isSandboxAgentToken, A as runChecksCore, B as paramsToQuery, C as envReset, D as loadCatalog, E as comparablePath, F as requireSandboxName, G as forgetSandboxTokens, H as hint, I as createContext, J as request, K as revokeCallingToken, L as envOnly, M as envDelete, N as envList, O as loadOpenApi, P as envShow, Q as substitutePlaceholders, R as notAuthenticated, S as envSchedules, T as envOutbox, U as warn, V as parseFields, W as describeSandboxToken, X as isExternalSurface, Y as markMcpSession, Z as normalizePath, _ as fnRun, a as previewSubmitRun, b as secretList, c as previewChecks, d as previewFailed, et as CliError, f as previewList, g as invocationsList, h as invocationsHeld, i as previewRunsList, j as envCreate, k as searchRoutes, l as previewCreate, m as fetchLogs, n as parseVariables, nt as exitCodeName, o as requireRunKind, p as previewShow, q as parseJson, r as previewRunGet, rt as usageError, s as runFailed, t as publish, tt as ExitCode, u as previewDelete, v as fnCall, w as envUpdate, x as secretSet, y as secretDelete, z as runJq } from "./main.mjs";
2
+ import { $ as isSandboxAgentToken, A as runChecksCore, B as paramsToQuery, C as envReset, D as loadCatalog, E as comparablePath, F as requireSandboxName, G as forgetSandboxTokens, H as hint, I as createContext, J as request, K as revokeCallingToken, L as envOnly, M as envDelete, N as envList, O as loadOpenApi, P as envShow, Q as substitutePlaceholders, R as notAuthenticated, S as envSchedules, T as envOutbox, U as warn, V as parseFields, W as describeSandboxToken, X as isExternalSurface, Y as markMcpSession, Z as normalizePath, _ as fnRun, a as previewFailed, b as secretList, c as parseVariables, d as previewSubmitRun, et as CliError, f as requireRunKind, g as invocationsList, h as invocationsHeld, i as previewDelete, j as envCreate, k as searchRoutes, l as previewRunGet, m as fetchLogs, n as previewChecks, nt as exitCodeName, o as previewList, p as runFailed, q as parseJson, r as previewCreate, rt as usageError, s as previewShow, t as publish, tt as ExitCode, u as previewRunsList, v as fnCall, w as envUpdate, x as secretSet, y as secretDelete, z as runJq } from "./main.mjs";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -7,23 +7,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
8
8
  import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
9
9
 
10
- //#region src/commands/mcp-sandbox.ts
11
- /**
12
- * What `oxyc mcp` serves when its credential is a sandbox agent token
13
- * (`oxy_sbx_…`): the sandbox loop, `oxy_whoami`, and four tools that exist
14
- * only here.
15
- *
16
- * A SMALLER LIST, NOT A FILTERED ONE. The generic tools — `oxy_request`,
17
- * `oxy_routes`, `oxy_schema` — and the workspace-preview tools are dropped:
18
- * the server answers this token `404` on everything they reach, and a tool
19
- * that can only fail still costs its schema on every turn. What replaces
20
- * `oxy_request` is named: a sandbox's secret is set with `oxy_env_secret_set`,
21
- * which can carry the one rule a generic request cannot — a `dev-<handle>`
22
- * environment, and nothing else.
23
- *
24
- * Tool DEFINITIONS and the startup decision live here. The calls themselves
25
- * are cases in `mcp.ts`'s `callTool`, beside the verbs they share code with.
26
- */
10
+ // src/commands/mcp-sandbox.ts
27
11
  const APP = {
28
12
  type: "string",
29
13
  description: "\"<org-slug>/<app-slug>\" or the app UUID."
@@ -32,7 +16,6 @@ const OWN_SANDBOX = {
32
16
  type: "string",
33
17
  description: "dev-<handle> — a sandbox this token created. Production and staging are refused."
34
18
  };
35
- /** The sandbox tools whose `appEnv` is optional for staff and required here. */
36
19
  const NEEDS_SANDBOX = /* @__PURE__ */ new Set([
37
20
  "oxy_fn_call",
38
21
  "oxy_fn_run",
@@ -48,7 +31,6 @@ const WHOAMI = {
48
31
  properties: {}
49
32
  }
50
33
  };
51
- /** The four tools only a sandbox agent token is served. */
52
34
  const SANDBOX_AGENT_TOOLS = [
53
35
  {
54
36
  name: "oxy_env_secret_list",
@@ -120,7 +102,6 @@ const SANDBOX_AGENT_TOOLS = [
120
102
  }
121
103
  }
122
104
  ];
123
- /** A sandbox tool as this credential must call it: the environment is not optional. */
124
105
  function forSandboxAgent(tool) {
125
106
  if (tool.name === "oxy_env_show" || tool.name === "oxy_env_update" || tool.name === "oxy_env_reset") return {
126
107
  ...tool,
@@ -146,14 +127,7 @@ function forSandboxAgent(tool) {
146
127
  }
147
128
  };
148
129
  }
149
- /**
150
- * The loop's tools a sandbox agent token is never served: an environment's
151
- * schedules switch is staff's to flip (the server refuses the token there),
152
- * and a tool that can only fail still costs its schema on every turn. A
153
- * token runs a scheduled function once with `oxy_fn_run` instead.
154
- */
155
130
  const STAFF_ONLY = /* @__PURE__ */ new Set(["oxy_env_schedules"]);
156
- /** The list for a sandbox agent token, built from the loop's own definitions. */
157
131
  function sandboxAgentTools(sandboxLoop) {
158
132
  const loop = sandboxLoop.filter((tool) => !STAFF_ONLY.has(tool.name));
159
133
  return [
@@ -162,19 +136,6 @@ function sandboxAgentTools(sandboxLoop) {
162
136
  ...SANDBOX_AGENT_TOOLS
163
137
  ];
164
138
  }
165
- /**
166
- * Decide the tool list, and FAIL CLOSED before serving one.
167
- *
168
- * `oxyc mcp` is what an agent runtime starts, with the agent's own token in
169
- * its environment. Started without `--login`, an unset variable is exit `4`
170
- * right here: falling back to the login cache would hand the agent its
171
- * operator's whole reach, silently, for the life of the session. An
172
- * `OXY_API_KEY` the caller also set is a credential it named, and is let by.
173
- *
174
- * A sandbox agent token is then asked what it is (`GET /api/auth/token`).
175
- * Refused there, it is dead and the session never starts. Unreachable, the
176
- * prefix still picks the smaller list — the safe direction to be wrong in.
177
- */
178
139
  async function startupToolSet(ctx) {
179
140
  const bearer = ctx.storedBearer();
180
141
  if (envOnly(ctx.flags) && !bearer && !ctx.apiKey()) throw notAuthenticated(ctx.target(), ctx.flags);
@@ -188,66 +149,11 @@ async function startupToolSet(ctx) {
188
149
  }
189
150
  return "sandbox_agent";
190
151
  }
191
- /** A tool the session does not serve, called anyway. */
192
152
  function notServed(name, set) {
193
153
  return set === "sandbox_agent" ? `${name} is not served to a sandbox agent token. It does the sandbox loop with the tools listed, and nothing else.` : `unknown tool: ${name}`;
194
154
  }
195
155
 
196
- //#endregion
197
- //#region src/commands/mcp.ts
198
- /**
199
- * `oxyc mcp` — the Oxy API as MCP tools, over stdio.
200
- *
201
- * It replaced the Rust `oxy mcp stdio|sse`, which took a local checkout and
202
- * exposed the semantic model, automations and `.sql` files in it. This one
203
- * takes a TOKEN and exposes the deployment's HTTP API — the same surface
204
- * `oxyc api` reaches, for an agent that would rather call a tool than shell out.
205
- *
206
- * FOUR GENERIC TOOLS FOR THE WHOLE API — the design decision that makes most
207
- * of it affordable.
208
- *
209
- * The obvious shape is one tool per endpoint, and it is the wrong one: the API
210
- * has ~670 routes, an agent runtime ships every tool's JSON schema in every
211
- * request, and that is tens of kilobytes of context spent on each turn before
212
- * a single question is asked. It would also go stale on every deploy, since
213
- * the tool list would be baked into this package rather than read from the
214
- * deployment.
215
- *
216
- * So discovery stays a QUESTION the agent asks (`oxy_routes`, `oxy_schema`)
217
- * rather than a payload it carries, exactly as the CLI does it, for
218
- * everything a generic request can do safely.
219
- *
220
- * TWO NAMED EXCEPTIONS: `SANDBOX_TOOLS` and `PREVIEW_TOOLS` below. The sandbox
221
- * loop and the workspace-previews loop are meant to run UNSUPERVISED — create
222
- * a sandbox, publish into it, call a function, tear it down — and that needs
223
- * per-operation validation (the `dev-<handle>` grammar, a confirm gate before
224
- * a delete, a hard refusal of `--app-env` outside `dev-<handle>` on the
225
- * publish tool) that `oxy_request` has no way to carry. Each of those tools
226
- * calls its CLI verb's own request-building function (`env.ts`, `fn.ts`,
227
- * `checks.ts`, `preview.ts`, `preview-runs.ts`, …), so there is exactly one
228
- * implementation of each request, and a tool's result is the same JSON
229
- * document that verb's `--json` prints. `mcp.test.ts` pins the full tool list
230
- * and a raised (and justified) per-turn schema budget.
231
- *
232
- * Target resolution and placeholder substitution are the CLI's — the same
233
- * `Context`, so `{org}` / `{workspace}` resolve the same way.
234
- *
235
- * THE CREDENTIAL IS THE TOKEN VARIABLE AND NOTHING ELSE, unless the server is
236
- * started with `--login`. An agent runtime starts this with the agent's own
237
- * token in `OXY_TOKEN`; with the variable unset, the process exits `4` rather
238
- * than serving on whatever `oxyc login` cached for the machine's owner. A
239
- * person who does want their own login passes `--login`.
240
- *
241
- * A SANDBOX AGENT TOKEN (`oxy_sbx_…`) GETS A DIFFERENT, SMALLER LIST — the
242
- * sandbox loop, `oxy_whoami`, three secret tools and `oxy_token_revoke`; no
243
- * `oxy_request`, no discovery, no previews. See `mcp-sandbox.ts`.
244
- */
245
- /**
246
- * Package version, reported in the MCP handshake.
247
- *
248
- * Read from `package.json` rather than restated, so a release bump cannot
249
- * leave the server announcing a version nobody shipped.
250
- */
156
+ // src/commands/mcp.ts
251
157
  const VERSION = (() => {
252
158
  try {
253
159
  const here = dirname(fileURLToPath(import.meta.url));
@@ -255,10 +161,6 @@ const VERSION = (() => {
255
161
  } catch {}
256
162
  return "0.0.0";
257
163
  })();
258
- /**
259
- * A tool result. MCP wants content blocks; everything here is text, because
260
- * the caller is a language model and the payloads are JSON or markdown.
261
- */
262
164
  function text(body, isError = false) {
263
165
  return {
264
166
  content: [{
@@ -268,13 +170,6 @@ function text(body, isError = false) {
268
170
  isError
269
171
  };
270
172
  }
271
- /**
272
- * A tool result carrying one JSON document — the same shape the matching
273
- * verb's `--json` prints, so a tool's result and the CLI's output never
274
- * drift apart. On failure the exit-code class is appended, same spelling as
275
- * the generic catch-all below (`[exit N NAME]`), so an agent branches on it
276
- * the way it would on `oxyc`'s own exit code.
277
- */
278
173
  function jsonResult(data, opts = {}) {
279
174
  const body = JSON.stringify(data);
280
175
  if (!opts.isError) return text(body);
@@ -352,22 +247,6 @@ const TOOLS = [
352
247
  }
353
248
  }
354
249
  ];
355
- /**
356
- * THE SANDBOX LOOP, AS TOOLS — the deliberate exception to "four, not one per
357
- * endpoint" above. A generic `oxy_request` can call these same routes, but it
358
- * cannot carry the per-operation validation that makes the loop safe for an
359
- * agent to drive unsupervised: the dev-<handle> grammar, the confirm-before-
360
- * delete gate, and the hard refusal of a sandbox publish outside dev-<handle>.
361
- * Every one of these reuses its CLI verb's own request-building function —
362
- * see `env.ts` / `fn.ts` / `checks.ts` / `invocations.ts` / `logs.ts` /
363
- * `publish.ts` — so there is exactly one implementation of each request, and
364
- * the tool result is the same JSON document that verb's `--json` prints.
365
- *
366
- * Each description says what it returns AND what to call next, so the loop
367
- * reads off the tool list alone: env_create → publish_sandbox → fn_call /
368
- * checks_run → invocations_list / invocations_held / logs → iterate from
369
- * publish_sandbox → env_delete.
370
- */
371
250
  const PLANES_ARG = {
372
251
  type: "object",
373
252
  description: "Plane key to mode, e.g. {\"semantic\": \"branch:<git branch>\"}; \"default\" clears a key."
@@ -766,19 +645,6 @@ const SANDBOX_TOOLS = [
766
645
  }
767
646
  }
768
647
  ];
769
- /**
770
- * WORKSPACE PREVIEWS, AS TOOLS — the same exception as `SANDBOX_TOOLS` above,
771
- * for the same reason: the run-kind grammar and the create/wait/timeout
772
- * contract are per-operation validation a generic `oxy_request` cannot carry.
773
- * Each reuses its `oxyc preview` verb's own request-building function (see
774
- * `preview.ts` / `preview-runs.ts`), so there is one implementation of each
775
- * request and the tool result matches that verb's `--json` output.
776
- *
777
- * The loop: preview_create (waits for the compile) → preview_checks → " +
778
- * preview_run (procedure or airway_sample) → preview_run_show (waits for the " +
779
- * run) → preview_runs_list to see transform_build/compare runs the server " +
780
- * queued on its own → preview_delete when done.
781
- */
782
648
  const PREVIEW_TOOLS = [
783
649
  {
784
650
  name: "oxy_preview_create",
@@ -935,47 +801,15 @@ const ALL_TOOLS = [
935
801
  ...SANDBOX_TOOLS,
936
802
  ...PREVIEW_TOOLS
937
803
  ];
938
- /** The list a session serves — decided once, from its credential (`mcp-sandbox.ts`). */
939
804
  function toolsFor(set) {
940
805
  return set === "sandbox_agent" ? sandboxAgentTools(SANDBOX_TOOLS) : ALL_TOOLS;
941
806
  }
942
- /**
943
- * Above this many matches, `oxy_routes` drops the descriptions.
944
- *
945
- * DEGRADES, IT DOES NOT REFUSE — the same shape as `oxyc routes`, which picks
946
- * `renderDetailed` under 40 matches and the compact method+path table above it
947
- * (`discover.ts`). The expensive field is `description`, not the row: a trimmed
948
- * row is a few tens of bytes, so several hundred still fit in a result an agent
949
- * can read, while the descriptions are what turn a broad match into hundreds of
950
- * KB of context spent before a question is asked.
951
- *
952
- * The threshold is on the COUNT, not on whether a `filter` was supplied — a
953
- * filter is not evidence of narrowing. `searchRoutes` matches a substring of
954
- * method, path, surface or description, so `"admin"`, `"workspace"` and
955
- * `"query"` are all filters a model reaches for in good faith that clear this.
956
- */
957
807
  const MAX_DESCRIBED_ROUTES = 60;
958
- /**
959
- * And above THIS many, there is nothing useful to return at all.
960
- *
961
- * Deliberately far above the threshold that drops descriptions: refusing is the
962
- * answer only when even the trimmed listing would be a context dump, which for
963
- * a deployment of ~670 routes means "you asked for effectively all of them".
964
- */
965
808
  const MAX_ROUTES_PER_RESULT = 400;
966
- /** `{ a: 1 }` → the `-f`/`-F` pairs `parseFields` understands. */
967
809
  function fieldPairs(fields) {
968
810
  if (!fields) return [];
969
811
  return Object.entries(fields).map(([k, v]) => `${k}=${JSON.stringify(v)}`);
970
812
  }
971
- /**
972
- * Check the arguments the schema says are required.
973
- *
974
- * `inputSchema.required` is ADVISORY on the low-level `Server` — it is handed
975
- * to the model, not enforced by the transport. Without this, `oxy_schema` with
976
- * no `path` matched every path and returned the whole OpenAPI document, and
977
- * `oxy_request` with none built a request to `/api/`.
978
- */
979
813
  function optionalString(name, value) {
980
814
  if (value === void 0 || value === null) return void 0;
981
815
  if (typeof value === "string") return value;
@@ -1308,18 +1142,6 @@ async function callTool(ctx, name, args) {
1308
1142
  default: return text(`unknown tool: ${name}`, true);
1309
1143
  }
1310
1144
  }
1311
- /**
1312
- * Serve MCP on stdio until the client disconnects.
1313
- *
1314
- * STDIO IS THE WHOLE TRANSPORT, deliberately. An HTTP/SSE server would need a
1315
- * port, a lifetime and an auth story of its own; stdio is what every agent
1316
- * runtime already launches, and the process inherits the caller's environment
1317
- * — which is where the token and the target come from.
1318
- *
1319
- * NOTHING MAY BE WRITTEN TO STDOUT except protocol frames. `log.info` and
1320
- * friends already go to stderr, which is why this can share the CLI's own
1321
- * plumbing without corrupting the stream.
1322
- */
1323
1145
  async function runMcp(ctx) {
1324
1146
  markMcpSession();
1325
1147
  const set = await startupToolSet(ctx);
@@ -1351,6 +1173,5 @@ async function runMcp(ctx) {
1351
1173
  });
1352
1174
  }
1353
1175
 
1354
- //#endregion
1355
1176
  export { runMcp };
1356
- //# sourceMappingURL=mcp-WxYfGpMF.mjs.map
1177
+ //# sourceMappingURL=mcp-vlYd5Bms.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-vlYd5Bms.mjs","names":[],"sources":["../src/commands/mcp-sandbox.ts","../src/commands/mcp.ts"],"mappings":";;;;;;;;;;AAoCA,MAAM,MAAM;CAAE,MAAM;CAAU,aAAa;AAA2C;AACtF,MAAM,cAAc;CAClB,MAAM;CACN,aAAa;AACf;AAGA,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,SAAkB;CACtB,MAAM;CACN,aACE;CAIF,aAAa;EAAE,MAAM;EAAU,YAAY,CAAC;CAAE;AAChD;AAGA,MAAa,sBAAiC;CAC5C;EACE,MAAM;EACN,aACE;EAGF,aAAa;GACX,MAAM;GACN,YAAY;IAAE,KAAK;IAAK,QAAQ;GAAY;GAC5C,UAAU,CAAC,OAAO,QAAQ;EAC5B;CACF;CACA;EACE,MAAM;EACN,aACE;EAGF,aAAa;GACX,MAAM;GACN,YAAY;IACV,KAAK;IACL,QAAQ;IACR,KAAK;KAAE,MAAM;KAAU,aAAa;IAA6C;IACjF,OAAO;KAAE,MAAM;KAAU,aAAa;IAAsB;GAC9D;GACA,UAAU;IAAC;IAAO;IAAU;IAAO;GAAO;EAC5C;CACF;CACA;EACE,MAAM;EACN,aACE;EAEF,aAAa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ACb,SAAS,MAAM,KAAK,GAAG,aAAa,MAAM,IAAI,EAAE,MAC/C,MAAM,aAAa,iBAAiB,MAAM,eAAe,MAC1D;GACgC,CAAC,CACpC,QAAQ,MAAM,MAAM,UAAa,MAAM,EAAE,CAAC,CAC1C,KAAK,MACO,GAAG,IAAI;EACxB;CACF,CAAC;CAED,MAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;CAI/C,MAAM,IAAI,SAAe,YAAY;EACnC,QAAQ,MAAM,GAAG,SAAS,OAAO;EACjC,OAAO,UAAU;CACnB,CAAC;AACH"}
@@ -22,7 +22,9 @@
22
22
  "default": {
23
23
  "concurrency": 5,
24
24
  "runs": 3,
25
- "judge_model": null
25
+ "judge_model": null,
26
+ "grader": "judge",
27
+ "database": null
26
28
  },
27
29
  "allOf": [
28
30
  {
@@ -39,16 +41,43 @@
39
41
  },
40
42
  "additionalProperties": false,
41
43
  "definitions": {
44
+ "Grader": {
45
+ "description": "How a case's answer is graded.",
46
+ "oneOf": [
47
+ {
48
+ "description": "LLM-as-judge compares the answer text with `expected`.",
49
+ "type": "string",
50
+ "enum": [
51
+ "judge"
52
+ ]
53
+ },
54
+ {
55
+ "description": "Run the agent's final SQL and `expected_sql` against `database`, compare result sets.",
56
+ "type": "string",
57
+ "enum": [
58
+ "execution"
59
+ ]
60
+ }
61
+ ]
62
+ },
42
63
  "TestCase": {
43
64
  "type": "object",
44
65
  "required": [
45
- "expected",
46
66
  "prompt"
47
67
  ],
48
68
  "properties": {
49
69
  "expected": {
70
+ "default": "",
50
71
  "type": "string"
51
72
  },
73
+ "expected_sql": {
74
+ "description": "Gold SQL for the execution grader.",
75
+ "default": null,
76
+ "type": [
77
+ "string",
78
+ "null"
79
+ ]
80
+ },
52
81
  "name": {
53
82
  "default": null,
54
83
  "type": [
@@ -85,6 +114,22 @@
85
114
  "format": "uint",
86
115
  "minimum": 0.0
87
116
  },
117
+ "database": {
118
+ "description": "Database the execution grader runs both queries against.",
119
+ "default": null,
120
+ "type": [
121
+ "string",
122
+ "null"
123
+ ]
124
+ },
125
+ "grader": {
126
+ "default": "judge",
127
+ "allOf": [
128
+ {
129
+ "$ref": "#/definitions/Grader"
130
+ }
131
+ ]
132
+ },
88
133
  "judge_model": {
89
134
  "type": [
90
135
  "string",
@@ -31,6 +31,14 @@
31
31
  "llm": {
32
32
  "$ref": "#/definitions/LlmConfigYaml"
33
33
  },
34
+ "runtime": {
35
+ "description": "Which agent runtime runs this agent: `fsm` (default, the staged pipeline) or `react` (the tool-calling loop). A typo is a parse error.",
36
+ "allOf": [
37
+ {
38
+ "$ref": "#/definitions/AgentRuntime"
39
+ }
40
+ ]
41
+ },
34
42
  "semantic_engine": {
35
43
  "description": "Optional vendor semantic engine configuration.\n\nWhen absent, the solver routes exclusively through the internal semantic model and LLM paths (identical to today's behaviour).",
36
44
  "anyOf": [
@@ -42,6 +50,11 @@
42
50
  }
43
51
  ]
44
52
  },
53
+ "semantic_only": {
54
+ "description": "React runtime only: the `query` tool accepts semantic-model queries and refuses raw `sql`, so every number comes from SQL the semantic model compiled. A react run of an agent with no semantic model refuses to start. The FSM ignores it.",
55
+ "default": false,
56
+ "type": "boolean"
57
+ },
45
58
  "states": {
46
59
  "description": "Per-state overrides.",
47
60
  "type": "object",
@@ -82,6 +95,59 @@
82
95
  }
83
96
  },
84
97
  "definitions": {
98
+ "AdvisorYaml": {
99
+ "description": "`llm.advisor`. The advisor must be at least as capable as the agent's model; the API refuses a pair it does not accept.",
100
+ "type": "object",
101
+ "required": [
102
+ "model"
103
+ ],
104
+ "properties": {
105
+ "max_tokens": {
106
+ "description": "Cap on each call's output tokens, 1024 at least. Defaults to 2048.",
107
+ "default": null,
108
+ "type": [
109
+ "integer",
110
+ "null"
111
+ ],
112
+ "format": "uint32",
113
+ "minimum": 0.0
114
+ },
115
+ "max_uses": {
116
+ "description": "Advisor calls allowed per turn. Defaults to 3.",
117
+ "default": null,
118
+ "type": [
119
+ "integer",
120
+ "null"
121
+ ],
122
+ "format": "uint32",
123
+ "minimum": 0.0
124
+ },
125
+ "model": {
126
+ "description": "The advisor's model ID, e.g. `claude-opus-5-5`.",
127
+ "type": "string"
128
+ }
129
+ },
130
+ "additionalProperties": false
131
+ },
132
+ "AgentRuntime": {
133
+ "description": "The runtime an `.agentic.yml` opts into.",
134
+ "oneOf": [
135
+ {
136
+ "description": "The staged FSM pipeline.",
137
+ "type": "string",
138
+ "enum": [
139
+ "fsm"
140
+ ]
141
+ },
142
+ {
143
+ "description": "The react tool-calling loop.",
144
+ "type": "string",
145
+ "enum": [
146
+ "react"
147
+ ]
148
+ }
149
+ ]
150
+ },
85
151
  "ExtendedThinkingConfigYaml": {
86
152
  "description": "Extended thinking mode preset configuration.\n\nOverrides the default model and/or thinking config when the user activates \"extended thinking\" mode from the UI.",
87
153
  "type": "object",
@@ -110,6 +176,17 @@
110
176
  "LlmConfigYaml": {
111
177
  "type": "object",
112
178
  "properties": {
179
+ "advisor": {
180
+ "description": "React runtime, Anthropic only: a stronger model the agent consults mid-turn for a plan or a check (Anthropic's advisor tool, beta). Its tokens are billed at the advisor model's rates. The FSM ignores it.\n\n```yaml llm: model: claude-sonnet-5-5 advisor: model: claude-opus-5-5 ```",
181
+ "anyOf": [
182
+ {
183
+ "$ref": "#/definitions/AdvisorYaml"
184
+ },
185
+ {
186
+ "type": "null"
187
+ }
188
+ ]
189
+ },
113
190
  "api_key": {
114
191
  "description": "API key. Falls back to `ANTHROPIC_API_KEY` (Anthropic) or `OPENAI_API_KEY` (OpenAi / OpenAiCompat) environment variables.",
115
192
  "default": null,
@@ -11,6 +11,7 @@
11
11
  ]
12
12
  },
13
13
  "builder_agent": {
14
+ "description": "Ignored: the builder agent was removed. The key still parses.",
14
15
  "anyOf": [
15
16
  {
16
17
  "$ref": "#/definitions/BuilderAgentConfig"
@@ -112,7 +113,7 @@
112
113
  "additionalProperties": false,
113
114
  "definitions": {
114
115
  "BuilderAgentConfig": {
115
- "description": "Configuration for the built-in builder copilot agent.\n\nExample: `builder_agent: { model: \"claude-sonnet-4-6\" }`",
116
+ "description": "Configuration for the built-in builder copilot agent, which no longer exists. Kept only so a `config.yml` that still carries `builder_agent:` parses (the struct is `deny_unknown_fields`); the value is ignored.\n\nExample: `builder_agent: { model: \"claude-sonnet-4-6\" }`",
116
117
  "anyOf": [
117
118
  {
118
119
  "description": "Built-in copilot configured only with a model name.",