@oxy-hq/cli 0.11.0 → 0.12.1
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 +406 -16
- package/dist/main.mjs +6563 -8427
- package/dist/main.mjs.map +1 -1
- package/dist/{mcp-B2KBWNOU.mjs → mcp-CJWQm-yd.mjs} +147 -190
- package/dist/mcp-CJWQm-yd.mjs.map +1 -0
- package/json-schemas/config.json +26 -45
- package/json-schemas/workflow.json +0 -17
- package/package.json +6 -5
- package/skills/oxy-agents/SKILL.md +15 -4
- package/skills/oxy-agents/references/quick-reference.md +1 -1
- package/skills/oxy-automations/SKILL.md +1 -1
- package/skills/oxy-cli/SKILL.md +91 -4
- package/skills/oxy-custom-apps/SKILL.md +233 -13
- package/skills/oxy-custom-apps/references/environment-branches.md +172 -0
- package/skills/oxy-custom-apps/references/phone-layout.md +88 -0
- package/skills/oxy-custom-apps/references/reading-data.md +4 -6
- package/skills/oxy-custom-apps/references/sandbox-agent-loop.md +120 -17
- package/skills/oxy-custom-apps/references/verifying-in-the-browser.md +19 -9
- package/skills/oxy-evals/SKILL.md +1 -1
- package/skills/oxy-experiments/SKILL.md +245 -0
- package/skills/oxy-semantic-modeling/SKILL.md +2 -2
- package/template/.github/workflows/publish.yaml +1 -1
- package/dist/mcp-B2KBWNOU.mjs.map +0 -1
- package/json-schemas/app.json +0 -1884
- package/skills/oxy-data-apps/SKILL.md +0 -362
- package/skills/oxy-data-apps/references/examples.md +0 -263
- package/skills/oxy-data-apps/references/quick-reference.md +0 -171
- package/skills/oxy-data-apps/templates/dashboard-with-controls.app.yml +0 -128
- package/skills/oxy-data-apps/templates/simple-dashboard.app.yml +0 -102
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
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";
|
|
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
|
-
|
|
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,9 +102,8 @@ 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
|
-
if (tool.name === "oxy_env_show") return {
|
|
106
|
+
if (tool.name === "oxy_env_show" || tool.name === "oxy_env_update" || tool.name === "oxy_env_reset") return {
|
|
126
107
|
...tool,
|
|
127
108
|
inputSchema: {
|
|
128
109
|
...tool.inputSchema,
|
|
@@ -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,67 +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
|
-
|
|
197
|
-
//#region src/commands/mcp.ts
|
|
198
|
-
/**
|
|
199
|
-
* `oxyc mcp` — the Oxy API as MCP tools, over stdio.
|
|
200
|
-
*
|
|
201
|
-
* NOT THE SAME THING AS `oxy mcp`. That one is workspace tooling: it takes a
|
|
202
|
-
* local checkout and exposes the semantic model, automations and `.sql` files
|
|
203
|
-
* in it. This one takes a TOKEN and exposes the deployment's HTTP API — the
|
|
204
|
-
* same surface `oxyc api` reaches, for an agent that would rather call a tool
|
|
205
|
-
* than shell out. Different input, different audience, no overlap.
|
|
206
|
-
*
|
|
207
|
-
* FOUR GENERIC TOOLS FOR THE WHOLE API — the design decision that makes most
|
|
208
|
-
* of it affordable.
|
|
209
|
-
*
|
|
210
|
-
* The obvious shape is one tool per endpoint, and it is the wrong one: the API
|
|
211
|
-
* has ~670 routes, an agent runtime ships every tool's JSON schema in every
|
|
212
|
-
* request, and that is tens of kilobytes of context spent on each turn before
|
|
213
|
-
* a single question is asked. It would also go stale on every deploy, since
|
|
214
|
-
* the tool list would be baked into this package rather than read from the
|
|
215
|
-
* deployment.
|
|
216
|
-
*
|
|
217
|
-
* So discovery stays a QUESTION the agent asks (`oxy_routes`, `oxy_schema`)
|
|
218
|
-
* rather than a payload it carries, exactly as the CLI does it, for
|
|
219
|
-
* everything a generic request can do safely.
|
|
220
|
-
*
|
|
221
|
-
* TWO NAMED EXCEPTIONS: `SANDBOX_TOOLS` and `PREVIEW_TOOLS` below. The sandbox
|
|
222
|
-
* loop and the workspace-previews loop are meant to run UNSUPERVISED — create
|
|
223
|
-
* a sandbox, publish into it, call a function, tear it down — and that needs
|
|
224
|
-
* per-operation validation (the `dev-<handle>` grammar, a confirm gate before
|
|
225
|
-
* a delete, a hard refusal of `--app-env` outside `dev-<handle>` on the
|
|
226
|
-
* publish tool) that `oxy_request` has no way to carry. Each of those tools
|
|
227
|
-
* calls its CLI verb's own request-building function (`env.ts`, `fn.ts`,
|
|
228
|
-
* `checks.ts`, `preview.ts`, `preview-runs.ts`, …), so there is exactly one
|
|
229
|
-
* implementation of each request, and a tool's result is the same JSON
|
|
230
|
-
* document that verb's `--json` prints. `mcp.test.ts` pins the full tool list
|
|
231
|
-
* and a raised (and justified) per-turn schema budget.
|
|
232
|
-
*
|
|
233
|
-
* Target resolution and placeholder substitution are the CLI's — the same
|
|
234
|
-
* `Context`, so `{org}` / `{workspace}` resolve the same way.
|
|
235
|
-
*
|
|
236
|
-
* THE CREDENTIAL IS THE TOKEN VARIABLE AND NOTHING ELSE, unless the server is
|
|
237
|
-
* started with `--login`. An agent runtime starts this with the agent's own
|
|
238
|
-
* token in `OXY_TOKEN`; with the variable unset, the process exits `4` rather
|
|
239
|
-
* than serving on whatever `oxyc login` cached for the machine's owner. A
|
|
240
|
-
* person who does want their own login passes `--login`.
|
|
241
|
-
*
|
|
242
|
-
* A SANDBOX AGENT TOKEN (`oxy_sbx_…`) GETS A DIFFERENT, SMALLER LIST — the
|
|
243
|
-
* sandbox loop, `oxy_whoami`, three secret tools and `oxy_token_revoke`; no
|
|
244
|
-
* `oxy_request`, no discovery, no previews. See `mcp-sandbox.ts`.
|
|
245
|
-
*/
|
|
246
|
-
/**
|
|
247
|
-
* Package version, reported in the MCP handshake.
|
|
248
|
-
*
|
|
249
|
-
* Read from `package.json` rather than restated, so a release bump cannot
|
|
250
|
-
* leave the server announcing a version nobody shipped.
|
|
251
|
-
*/
|
|
156
|
+
// src/commands/mcp.ts
|
|
252
157
|
const VERSION = (() => {
|
|
253
158
|
try {
|
|
254
159
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -256,10 +161,6 @@ const VERSION = (() => {
|
|
|
256
161
|
} catch {}
|
|
257
162
|
return "0.0.0";
|
|
258
163
|
})();
|
|
259
|
-
/**
|
|
260
|
-
* A tool result. MCP wants content blocks; everything here is text, because
|
|
261
|
-
* the caller is a language model and the payloads are JSON or markdown.
|
|
262
|
-
*/
|
|
263
164
|
function text(body, isError = false) {
|
|
264
165
|
return {
|
|
265
166
|
content: [{
|
|
@@ -269,13 +170,6 @@ function text(body, isError = false) {
|
|
|
269
170
|
isError
|
|
270
171
|
};
|
|
271
172
|
}
|
|
272
|
-
/**
|
|
273
|
-
* A tool result carrying one JSON document — the same shape the matching
|
|
274
|
-
* verb's `--json` prints, so a tool's result and the CLI's output never
|
|
275
|
-
* drift apart. On failure the exit-code class is appended, same spelling as
|
|
276
|
-
* the generic catch-all below (`[exit N NAME]`), so an agent branches on it
|
|
277
|
-
* the way it would on `oxyc`'s own exit code.
|
|
278
|
-
*/
|
|
279
173
|
function jsonResult(data, opts = {}) {
|
|
280
174
|
const body = JSON.stringify(data);
|
|
281
175
|
if (!opts.isError) return text(body);
|
|
@@ -353,22 +247,10 @@ const TOOLS = [
|
|
|
353
247
|
}
|
|
354
248
|
}
|
|
355
249
|
];
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
* agent to drive unsupervised: the dev-<handle> grammar, the confirm-before-
|
|
361
|
-
* delete gate, and the hard refusal of a sandbox publish outside dev-<handle>.
|
|
362
|
-
* Every one of these reuses its CLI verb's own request-building function —
|
|
363
|
-
* see `env.ts` / `fn.ts` / `checks.ts` / `invocations.ts` / `logs.ts` /
|
|
364
|
-
* `publish.ts` — so there is exactly one implementation of each request, and
|
|
365
|
-
* the tool result is the same JSON document that verb's `--json` prints.
|
|
366
|
-
*
|
|
367
|
-
* Each description says what it returns AND what to call next, so the loop
|
|
368
|
-
* reads off the tool list alone: env_create → publish_sandbox → fn_call /
|
|
369
|
-
* checks_run → invocations_list / invocations_held / logs → iterate from
|
|
370
|
-
* publish_sandbox → env_delete.
|
|
371
|
-
*/
|
|
250
|
+
const PLANES_ARG = {
|
|
251
|
+
type: "object",
|
|
252
|
+
description: "Plane key to mode, e.g. {\"semantic\": \"branch:<git branch>\"}; \"default\" clears a key."
|
|
253
|
+
};
|
|
372
254
|
const SANDBOX_TOOLS = [
|
|
373
255
|
{
|
|
374
256
|
name: "oxy_env_create",
|
|
@@ -383,6 +265,96 @@ const SANDBOX_TOOLS = [
|
|
|
383
265
|
name: {
|
|
384
266
|
type: "string",
|
|
385
267
|
description: "dev-<handle> — 1-12 lowercase letters, digits and single hyphens."
|
|
268
|
+
},
|
|
269
|
+
from: {
|
|
270
|
+
type: "string",
|
|
271
|
+
description: "Parent: production, staging or a sandbox."
|
|
272
|
+
},
|
|
273
|
+
at: {
|
|
274
|
+
type: "string",
|
|
275
|
+
description: "Fork time, RFC 3339, not in the future."
|
|
276
|
+
},
|
|
277
|
+
preset: {
|
|
278
|
+
type: "string",
|
|
279
|
+
enum: ["light", "full"]
|
|
280
|
+
},
|
|
281
|
+
planes: PLANES_ARG
|
|
282
|
+
},
|
|
283
|
+
required: ["app", "name"]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: "oxy_env_update",
|
|
288
|
+
description: "Set plane modes on staging or a dev-<handle> sandbox, keeping those already set (replace=true: exactly `planes`). Returns the Environment.",
|
|
289
|
+
inputSchema: {
|
|
290
|
+
type: "object",
|
|
291
|
+
properties: {
|
|
292
|
+
app: {
|
|
293
|
+
type: "string",
|
|
294
|
+
description: "\"<org-slug>/<app-slug>\" or the app UUID."
|
|
295
|
+
},
|
|
296
|
+
name: {
|
|
297
|
+
type: "string",
|
|
298
|
+
description: "staging or dev-<handle>."
|
|
299
|
+
},
|
|
300
|
+
planes: PLANES_ARG,
|
|
301
|
+
replace: { type: "boolean" }
|
|
302
|
+
},
|
|
303
|
+
required: [
|
|
304
|
+
"app",
|
|
305
|
+
"name",
|
|
306
|
+
"planes"
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "oxy_env_reset",
|
|
312
|
+
description: "Reset planes of staging or a dev-<handle> sandbox to a clean copy of the parent's. Returns {name, planes: [{plane, status, run_id}]}.",
|
|
313
|
+
inputSchema: {
|
|
314
|
+
type: "object",
|
|
315
|
+
properties: {
|
|
316
|
+
app: {
|
|
317
|
+
type: "string",
|
|
318
|
+
description: "\"<org-slug>/<app-slug>\" or the app UUID."
|
|
319
|
+
},
|
|
320
|
+
name: {
|
|
321
|
+
type: "string",
|
|
322
|
+
description: "staging or dev-<handle>."
|
|
323
|
+
},
|
|
324
|
+
planes: {
|
|
325
|
+
type: "array",
|
|
326
|
+
items: { type: "string" },
|
|
327
|
+
description: "Plane keys."
|
|
328
|
+
},
|
|
329
|
+
at: {
|
|
330
|
+
type: "string",
|
|
331
|
+
description: "Optional RFC 3339 time to reset the OLTP branch from the parent as of (not in the future, within the last 24 hours); default: the parent as it is now."
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
required: [
|
|
335
|
+
"app",
|
|
336
|
+
"name",
|
|
337
|
+
"planes"
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: "oxy_env_outbox",
|
|
343
|
+
description: "Email and notifications a staging or dev-<handle> environment CAPTURED instead of sending (messages plane `capture`), newest first — read it after oxy_fn_call. Returns {messages: [{kind, to, subject|title, body, invocation_id, function}], has_more}.",
|
|
344
|
+
inputSchema: {
|
|
345
|
+
type: "object",
|
|
346
|
+
properties: {
|
|
347
|
+
app: {
|
|
348
|
+
type: "string",
|
|
349
|
+
description: "\"<org-slug>/<app-slug>\" or the app UUID."
|
|
350
|
+
},
|
|
351
|
+
name: {
|
|
352
|
+
type: "string",
|
|
353
|
+
description: "staging or dev-<handle>."
|
|
354
|
+
},
|
|
355
|
+
limit: {
|
|
356
|
+
type: "number",
|
|
357
|
+
description: "Default 50, at most 200."
|
|
386
358
|
}
|
|
387
359
|
},
|
|
388
360
|
required: ["app", "name"]
|
|
@@ -506,7 +478,7 @@ const SANDBOX_TOOLS = [
|
|
|
506
478
|
},
|
|
507
479
|
{
|
|
508
480
|
name: "oxy_checks_run",
|
|
509
|
-
description: "Run every function the app marked \"check\": true in one environment, and wait for each to a terminal status. Returns {app, checks:[{name, status, passed, error, durationMs}]}; isError is set when any check failed or timed out. Run this right after oxy_publish_sandbox to verify a build.",
|
|
481
|
+
description: "Run every function the app marked \"check\": true in one environment, and wait for each to a terminal status. Returns {app, checks:[{name, status, passed, error, durationMs}]}; isError is set when any check failed or timed out. Run this right after oxy_publish_sandbox to verify a build. browser=true also loads the page in headless Chromium (needs Playwright), adding a {kind:\"browser\"} check.",
|
|
510
482
|
inputSchema: {
|
|
511
483
|
type: "object",
|
|
512
484
|
properties: {
|
|
@@ -521,6 +493,14 @@ const SANDBOX_TOOLS = [
|
|
|
521
493
|
timeoutSeconds: {
|
|
522
494
|
type: "number",
|
|
523
495
|
description: "Per-check timeout (default 300)."
|
|
496
|
+
},
|
|
497
|
+
browser: {
|
|
498
|
+
type: "boolean",
|
|
499
|
+
description: "Also load the page in a browser."
|
|
500
|
+
},
|
|
501
|
+
expectSelector: {
|
|
502
|
+
type: "string",
|
|
503
|
+
description: "With browser: a selector to await."
|
|
524
504
|
}
|
|
525
505
|
},
|
|
526
506
|
required: ["app"]
|
|
@@ -594,7 +574,7 @@ const SANDBOX_TOOLS = [
|
|
|
594
574
|
},
|
|
595
575
|
appEnv: {
|
|
596
576
|
type: "string",
|
|
597
|
-
description: "
|
|
577
|
+
description: "One environment. With app as <org>/<app> the default is production only (or the environment a non-production build ran in); pass dev-<handle> to see a sandbox."
|
|
598
578
|
},
|
|
599
579
|
build: {
|
|
600
580
|
type: "string",
|
|
@@ -665,19 +645,6 @@ const SANDBOX_TOOLS = [
|
|
|
665
645
|
}
|
|
666
646
|
}
|
|
667
647
|
];
|
|
668
|
-
/**
|
|
669
|
-
* WORKSPACE PREVIEWS, AS TOOLS — the same exception as `SANDBOX_TOOLS` above,
|
|
670
|
-
* for the same reason: the run-kind grammar and the create/wait/timeout
|
|
671
|
-
* contract are per-operation validation a generic `oxy_request` cannot carry.
|
|
672
|
-
* Each reuses its `oxyc preview` verb's own request-building function (see
|
|
673
|
-
* `preview.ts` / `preview-runs.ts`), so there is one implementation of each
|
|
674
|
-
* request and the tool result matches that verb's `--json` output.
|
|
675
|
-
*
|
|
676
|
-
* The loop: preview_create (waits for the compile) → preview_checks → " +
|
|
677
|
-
* preview_run (procedure or airway_sample) → preview_run_show (waits for the " +
|
|
678
|
-
* run) → preview_runs_list to see transform_build/compare runs the server " +
|
|
679
|
-
* queued on its own → preview_delete when done.
|
|
680
|
-
*/
|
|
681
648
|
const PREVIEW_TOOLS = [
|
|
682
649
|
{
|
|
683
650
|
name: "oxy_preview_create",
|
|
@@ -834,47 +801,20 @@ const ALL_TOOLS = [
|
|
|
834
801
|
...SANDBOX_TOOLS,
|
|
835
802
|
...PREVIEW_TOOLS
|
|
836
803
|
];
|
|
837
|
-
/** The list a session serves — decided once, from its credential (`mcp-sandbox.ts`). */
|
|
838
804
|
function toolsFor(set) {
|
|
839
805
|
return set === "sandbox_agent" ? sandboxAgentTools(SANDBOX_TOOLS) : ALL_TOOLS;
|
|
840
806
|
}
|
|
841
|
-
/**
|
|
842
|
-
* Above this many matches, `oxy_routes` drops the descriptions.
|
|
843
|
-
*
|
|
844
|
-
* DEGRADES, IT DOES NOT REFUSE — the same shape as `oxyc routes`, which picks
|
|
845
|
-
* `renderDetailed` under 40 matches and the compact method+path table above it
|
|
846
|
-
* (`discover.ts`). The expensive field is `description`, not the row: a trimmed
|
|
847
|
-
* row is a few tens of bytes, so several hundred still fit in a result an agent
|
|
848
|
-
* can read, while the descriptions are what turn a broad match into hundreds of
|
|
849
|
-
* KB of context spent before a question is asked.
|
|
850
|
-
*
|
|
851
|
-
* The threshold is on the COUNT, not on whether a `filter` was supplied — a
|
|
852
|
-
* filter is not evidence of narrowing. `searchRoutes` matches a substring of
|
|
853
|
-
* method, path, surface or description, so `"admin"`, `"workspace"` and
|
|
854
|
-
* `"query"` are all filters a model reaches for in good faith that clear this.
|
|
855
|
-
*/
|
|
856
807
|
const MAX_DESCRIBED_ROUTES = 60;
|
|
857
|
-
/**
|
|
858
|
-
* And above THIS many, there is nothing useful to return at all.
|
|
859
|
-
*
|
|
860
|
-
* Deliberately far above the threshold that drops descriptions: refusing is the
|
|
861
|
-
* answer only when even the trimmed listing would be a context dump, which for
|
|
862
|
-
* a deployment of ~670 routes means "you asked for effectively all of them".
|
|
863
|
-
*/
|
|
864
808
|
const MAX_ROUTES_PER_RESULT = 400;
|
|
865
|
-
/** `{ a: 1 }` → the `-f`/`-F` pairs `parseFields` understands. */
|
|
866
809
|
function fieldPairs(fields) {
|
|
867
810
|
if (!fields) return [];
|
|
868
811
|
return Object.entries(fields).map(([k, v]) => `${k}=${JSON.stringify(v)}`);
|
|
869
812
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
* no `path` matched every path and returned the whole OpenAPI document, and
|
|
876
|
-
* `oxy_request` with none built a request to `/api/`.
|
|
877
|
-
*/
|
|
813
|
+
function optionalString(name, value) {
|
|
814
|
+
if (value === void 0 || value === null) return void 0;
|
|
815
|
+
if (typeof value === "string") return value;
|
|
816
|
+
throw usageError(`${name} must be a string`);
|
|
817
|
+
}
|
|
878
818
|
function requireArgs(name, args, required) {
|
|
879
819
|
const missing = required.filter((k) => {
|
|
880
820
|
const v = args[k];
|
|
@@ -960,7 +900,7 @@ async function callTool(ctx, name, args) {
|
|
|
960
900
|
if (response.status < 200 || response.status >= 300) return text(`HTTP ${response.status} ${response.statusText}\n${response.body}`, true);
|
|
961
901
|
if (response.body.trim() === "null") return text("null\n\n(NOTE: a 200 with a null body can mean an expired session on this API, not 'no such thing'. Call oxy_whoami to tell them apart.)");
|
|
962
902
|
const jq = args.jq;
|
|
963
|
-
if (jq) return text(runJq(response.body, jq));
|
|
903
|
+
if (jq) return text(await runJq(response.body, jq));
|
|
964
904
|
return text(response.body);
|
|
965
905
|
}
|
|
966
906
|
case "oxy_whoami": {
|
|
@@ -988,7 +928,35 @@ async function callTool(ctx, name, args) {
|
|
|
988
928
|
}
|
|
989
929
|
case "oxy_env_create":
|
|
990
930
|
requireArgs("oxy_env_create", args, ["app", "name"]);
|
|
991
|
-
return jsonResult(await envCreate(ctx, String(args.app), String(args.name)
|
|
931
|
+
return jsonResult(await envCreate(ctx, String(args.app), String(args.name), {
|
|
932
|
+
from: optionalString("from", args.from),
|
|
933
|
+
at: optionalString("at", args.at),
|
|
934
|
+
preset: optionalString("preset", args.preset),
|
|
935
|
+
planes: args.planes
|
|
936
|
+
}));
|
|
937
|
+
case "oxy_env_update":
|
|
938
|
+
requireArgs("oxy_env_update", args, [
|
|
939
|
+
"app",
|
|
940
|
+
"name",
|
|
941
|
+
"planes"
|
|
942
|
+
]);
|
|
943
|
+
return jsonResult(await envUpdate(ctx, String(args.app), String(args.name), {
|
|
944
|
+
planes: args.planes,
|
|
945
|
+
replace: args.replace === true
|
|
946
|
+
}));
|
|
947
|
+
case "oxy_env_reset":
|
|
948
|
+
requireArgs("oxy_env_reset", args, [
|
|
949
|
+
"app",
|
|
950
|
+
"name",
|
|
951
|
+
"planes"
|
|
952
|
+
]);
|
|
953
|
+
if (!Array.isArray(args.planes) || args.planes.some((p) => typeof p !== "string")) throw usageError("planes must be an array of plane keys", "e.g. [\"storage\", \"oltp\"]");
|
|
954
|
+
return jsonResult(await envReset(ctx, String(args.app), String(args.name), args.planes, optionalString("at", args.at)));
|
|
955
|
+
case "oxy_env_outbox": {
|
|
956
|
+
requireArgs("oxy_env_outbox", args, ["app", "name"]);
|
|
957
|
+
const limit = args.limit === void 0 ? void 0 : Number(args.limit);
|
|
958
|
+
return jsonResult(await envOutbox(ctx, String(args.app), String(args.name), { limit }));
|
|
959
|
+
}
|
|
992
960
|
case "oxy_env_list":
|
|
993
961
|
requireArgs("oxy_env_list", args, ["app"]);
|
|
994
962
|
return jsonResult({ environments: await envList(ctx, String(args.app)) });
|
|
@@ -1033,7 +1001,9 @@ async function callTool(ctx, name, args) {
|
|
|
1033
1001
|
requireArgs("oxy_checks_run", args, ["app"]);
|
|
1034
1002
|
const report = await runChecksCore(ctx, String(args.app), {
|
|
1035
1003
|
timeoutSeconds: args.timeoutSeconds === void 0 ? 300 : Number(args.timeoutSeconds),
|
|
1036
|
-
appEnv: args.appEnv
|
|
1004
|
+
appEnv: args.appEnv,
|
|
1005
|
+
browser: args.browser === true,
|
|
1006
|
+
expectSelector: args.expectSelector
|
|
1037
1007
|
});
|
|
1038
1008
|
return jsonResult(report, {
|
|
1039
1009
|
isError: report.checks.some((c) => !c.passed),
|
|
@@ -1172,18 +1142,6 @@ async function callTool(ctx, name, args) {
|
|
|
1172
1142
|
default: return text(`unknown tool: ${name}`, true);
|
|
1173
1143
|
}
|
|
1174
1144
|
}
|
|
1175
|
-
/**
|
|
1176
|
-
* Serve MCP on stdio until the client disconnects.
|
|
1177
|
-
*
|
|
1178
|
-
* STDIO IS THE WHOLE TRANSPORT, deliberately. An HTTP/SSE server would need a
|
|
1179
|
-
* port, a lifetime and an auth story of its own; stdio is what every agent
|
|
1180
|
-
* runtime already launches, and the process inherits the caller's environment
|
|
1181
|
-
* — which is where the token and the target come from.
|
|
1182
|
-
*
|
|
1183
|
-
* NOTHING MAY BE WRITTEN TO STDOUT except protocol frames. `log.info` and
|
|
1184
|
-
* friends already go to stderr, which is why this can share the CLI's own
|
|
1185
|
-
* plumbing without corrupting the stream.
|
|
1186
|
-
*/
|
|
1187
1145
|
async function runMcp(ctx) {
|
|
1188
1146
|
markMcpSession();
|
|
1189
1147
|
const set = await startupToolSet(ctx);
|
|
@@ -1215,6 +1173,5 @@ async function runMcp(ctx) {
|
|
|
1215
1173
|
});
|
|
1216
1174
|
}
|
|
1217
1175
|
|
|
1218
|
-
//#endregion
|
|
1219
1176
|
export { runMcp };
|
|
1220
|
-
//# sourceMappingURL=mcp-
|
|
1177
|
+
//# sourceMappingURL=mcp-CJWQm-yd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-CJWQm-yd.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;GACX,MAAM;GACN,YAAY;IACV,KAAK;IACL,QAAQ;IACR,KAAK;KAAE,MAAM;KAAU,aAAa;IAAqB;GAC3D;GACA,UAAU;IAAC;IAAO;IAAU;GAAK;EACnC;CACF;CACA;EACE,MAAM;EACN,aACE;EAEF,aAAa;GACX,MAAM;GACN,YAAY,EACV,SAAS;IAAE,MAAM;IAAW,aAAa;GAAwC,EACnF;GACA,UAAU,CAAC,SAAS;EACtB;CACF;AACF;AAGA,SAAS,gBAAgB,MAAwB;CAC/C,IACE,KAAK,SAAS,kBACd,KAAK,SAAS,oBACd,KAAK,SAAS,iBAEd,OAAO;EACL,GAAG;EACH,aAAa;GACX,GAAG,KAAK;GACR,YAAY;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Properties": false,
|
|
113
113
|
"definitions": {
|
|
114
|
-
"AppProbeTarget": {
|
|
115
|
-
"description": "One named app to run, and the control values to run it with.",
|
|
116
|
-
"type": "object",
|
|
117
|
-
"required": [
|
|
118
|
-
"app"
|
|
119
|
-
],
|
|
120
|
-
"properties": {
|
|
121
|
-
"app": {
|
|
122
|
-
"description": "Workspace-relative path (`apps/sales.app.yml`) or bare file name (`sales.app.yml`).",
|
|
123
|
-
"type": "string"
|
|
124
|
-
},
|
|
125
|
-
"variables": {
|
|
126
|
-
"description": "Control values for this app, exactly as its Controls would supply them. Absent → the app's own defaults, which is what the `apps: true` sweep uses.\n\nValues keep their YAML type (`limit: 5` stays a number), because that is what an app's own Controls hand its tasks.",
|
|
127
|
-
"type": "object",
|
|
128
|
-
"additionalProperties": true
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"additionalProperties": false
|
|
132
|
-
},
|
|
133
|
-
"AppsProbeConfig": {
|
|
134
|
-
"description": "How the app probe picks its targets. Same `bool | [targets]` shape as [`SemanticProbeConfig`], with `variables` per app rather than shared across all of them — two apps rarely want the same control values.\n\n```yaml apps: true # run every task of every .app.yml apps: # run only these apps - app: apps/sales.app.yml variables: region: us-east - app: apps/inventory.app.yml ```",
|
|
135
|
-
"anyOf": [
|
|
136
|
-
{
|
|
137
|
-
"description": "`apps: true|false` — run every app, or none.",
|
|
138
|
-
"type": "boolean"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"description": "`apps: [ { app: … }, … ]` — run only the named apps.",
|
|
142
|
-
"type": "array",
|
|
143
|
-
"items": {
|
|
144
|
-
"$ref": "#/definitions/AppProbeTarget"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
]
|
|
148
|
-
},
|
|
149
114
|
"BuilderAgentConfig": {
|
|
150
115
|
"description": "Configuration for the built-in builder copilot agent.\n\nExample: `builder_agent: { model: \"claude-sonnet-4-6\" }`",
|
|
151
116
|
"anyOf": [
|
|
@@ -196,6 +161,13 @@
|
|
|
196
161
|
"format": "uint64",
|
|
197
162
|
"minimum": 0.0
|
|
198
163
|
},
|
|
164
|
+
"key_json_var": {
|
|
165
|
+
"default": null,
|
|
166
|
+
"type": [
|
|
167
|
+
"string",
|
|
168
|
+
"null"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
199
171
|
"key_path": {
|
|
200
172
|
"default": null,
|
|
201
173
|
"type": [
|
|
@@ -306,6 +278,17 @@
|
|
|
306
278
|
}
|
|
307
279
|
}
|
|
308
280
|
},
|
|
281
|
+
{
|
|
282
|
+
"type": "object",
|
|
283
|
+
"required": [
|
|
284
|
+
"private_key_var"
|
|
285
|
+
],
|
|
286
|
+
"properties": {
|
|
287
|
+
"private_key_var": {
|
|
288
|
+
"type": "string"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
309
292
|
{
|
|
310
293
|
"type": "object",
|
|
311
294
|
"properties": {
|
|
@@ -1363,7 +1346,7 @@
|
|
|
1363
1346
|
"type": "object",
|
|
1364
1347
|
"properties": {
|
|
1365
1348
|
"tools": {
|
|
1366
|
-
"description": "List of file patterns to expose as MCP tools Supports glob patterns like \"agents/*.
|
|
1349
|
+
"description": "List of file patterns to expose as MCP tools Supports glob patterns like \"agents/*.agentic.yml\" Examples: - \"agents/sql-generator.agentic.yml\" (specific file) - \"agents/*.agentic.yml\" (all agents in directory) - \"workflows/**/*.automation.yml\" (all automations recursively) - \"semantics/topics/*.topic.yml\" (semantic topics) - \"sqls/queries/*.sql\" (SQL files)",
|
|
1367
1350
|
"default": [],
|
|
1368
1351
|
"type": "array",
|
|
1369
1352
|
"items": {
|
|
@@ -2050,7 +2033,7 @@
|
|
|
2050
2033
|
"additionalProperties": true
|
|
2051
2034
|
},
|
|
2052
2035
|
"SemanticProbeConfig": {
|
|
2053
|
-
"description": "How the semantic probe picks its targets: sweep everything, or probe a list of named topics.\n\n```yaml semantic: true # every topic, measure auto-picked from its base view semantic: # only these topics - topic: fruit_business measures: # omit to auto-pick one, as the sweep does - fruits.total_count - fruits.avg_price - topic: orders ```\n\nNaming topics is the cheaper mode and the one to reach for on a real warehouse: the sweep's cost scales with *every* topic's data volume, while a named list is a bill you chose. Explicit `measures` also pin the probe to columns you know are small, instead of whatever the base view lists first
|
|
2036
|
+
"description": "How the semantic probe picks its targets: sweep everything, or probe a list of named topics.\n\n```yaml semantic: true # every topic, measure auto-picked from its base view semantic: # only these topics - topic: fruit_business measures: # omit to auto-pick one, as the sweep does - fruits.total_count - fruits.avg_price - topic: orders ```\n\nNaming topics is the cheaper mode and the one to reach for on a real warehouse: the sweep's cost scales with *every* topic's data volume, while a named list is a bill you chose. Explicit `measures` also pin the probe to columns you know are small, instead of whatever the base view lists first.",
|
|
2054
2037
|
"anyOf": [
|
|
2055
2038
|
{
|
|
2056
2039
|
"description": "`semantic: true|false` — sweep every topic, or run nothing.",
|
|
@@ -2141,8 +2124,11 @@
|
|
|
2141
2124
|
"additionalProperties": false
|
|
2142
2125
|
},
|
|
2143
2126
|
"SmokeTestConfig": {
|
|
2144
|
-
"description": "Which probes the workspace smoke test runs, and how often.\n\n**Only `connections` defaults on**, and the whole block defaults on when absent — so a workspace that opted into `health_check:` gets a cheap credential check for free (nothing here runs for one that didn't: the smoke run is gated inside an eval pass). The other three are opt-in even then, because they are not cheap, and the reason is not obvious from their descriptions:\n\n* `connections` — `SELECT 1`. Scans zero bytes, so it is free on a bytes-billed warehouse (BigQuery on-demand, Athena). Caveat: on Snowflake it *resumes* a suspended warehouse, which bills a 60-second minimum. At the 6h default that is four wake-ups a day. * `semantic` — one measure query per topic. `SUM(x)` over an unpartitioned fact table reads the whole column; a `LIMIT` cannot shrink an aggregate's scan. Cost scales with your *data volume*, not your topic count, and on a bytes-billed warehouse it is by far the most expensive probe here. * `
|
|
2127
|
+
"description": "Which probes the workspace smoke test runs, and how often.\n\n**Only `connections` defaults on**, and the whole block defaults on when absent — so a workspace that opted into `health_check:` gets a cheap credential check for free (nothing here runs for one that didn't: the smoke run is gated inside an eval pass). The other three are opt-in even then, because they are not cheap, and the reason is not obvious from their descriptions:\n\n* `connections` — `SELECT 1`. Scans zero bytes, so it is free on a bytes-billed warehouse (BigQuery on-demand, Athena). Caveat: on Snowflake it *resumes* a suspended warehouse, which bills a 60-second minimum. At the 6h default that is four wake-ups a day. * `semantic` — one measure query per topic. `SUM(x)` over an unpartitioned fact table reads the whole column; a `LIMIT` cannot shrink an aggregate's scan. Cost scales with your *data volume*, not your topic count, and on a bytes-billed warehouse it is by far the most expensive probe here. * `agent` — a real LLM round-trip, plus whatever SQL the agent decides to run.",
|
|
2145
2128
|
"type": "object",
|
|
2129
|
+
"required": [
|
|
2130
|
+
"apps"
|
|
2131
|
+
],
|
|
2146
2132
|
"properties": {
|
|
2147
2133
|
"agent": {
|
|
2148
2134
|
"description": "Ask an agentic agent a fixed question and assert it answers. Absent → the probe is skipped. Costs tokens on every smoke run.\n\nSingular back-compat spelling for a single probe; prefer `agents:`. Both may be set, and [`SmokeTestConfig::resolved_agents`] runs the union.",
|
|
@@ -2163,13 +2149,8 @@
|
|
|
2163
2149
|
}
|
|
2164
2150
|
},
|
|
2165
2151
|
"apps": {
|
|
2166
|
-
"description": "
|
|
2167
|
-
"
|
|
2168
|
-
"allOf": [
|
|
2169
|
-
{
|
|
2170
|
-
"$ref": "#/definitions/AppsProbeConfig"
|
|
2171
|
-
}
|
|
2172
|
-
]
|
|
2152
|
+
"description": "Ignored. Data Apps (`.app.yml`) were removed and this probe went with them. Still accepted, because `health_check` rejects unknown keys and a `config.yml` that sets `apps:` must keep loading.\n\nCompared as always equal, so a stored smoke config (which no longer records it) never reads as \"changed\" against a parsed one that still sets it.",
|
|
2153
|
+
"writeOnly": true
|
|
2173
2154
|
},
|
|
2174
2155
|
"connections": {
|
|
2175
2156
|
"description": "`SELECT 1` against every database in `databases:`. Defaults **true** — the one probe cheap enough to run unasked.",
|