@oxy-hq/cli 0.4.0 → 0.6.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.
- package/README.md +407 -11
- package/dist/main.mjs +5207 -400
- package/dist/main.mjs.map +1 -1
- package/dist/mcp-D5FFpqAw.mjs +902 -0
- package/dist/mcp-D5FFpqAw.mjs.map +1 -0
- package/json-schemas/agentic.json +1 -1
- package/json-schemas/config.json +2 -4
- package/json-schemas/flow-test.json +3 -3
- package/package.json +8 -8
- package/skills/oxy-cli/SKILL.md +23 -0
- package/skills/oxy-custom-apps/SKILL.md +167 -3
- package/dist/mcp-CIsyezzU.mjs +0 -316
- package/dist/mcp-CIsyezzU.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-D5FFpqAw.mjs","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["/**\n * `oxyc mcp` — the Oxy API as MCP tools, over stdio.\n *\n * NOT THE SAME THING AS `oxy mcp`. That one is workspace tooling: it takes a\n * local checkout and exposes the semantic model, automations and `.sql` files\n * in it. This one takes a TOKEN and exposes the deployment's HTTP API — the\n * same surface `oxyc api` reaches, for an agent that would rather call a tool\n * than shell out. Different input, different audience, no overlap.\n *\n * FOUR GENERIC TOOLS FOR THE WHOLE API — the design decision that makes most\n * of it affordable.\n *\n * The obvious shape is one tool per endpoint, and it is the wrong one: the API\n * has ~670 routes, an agent runtime ships every tool's JSON schema in every\n * request, and that is tens of kilobytes of context spent on each turn before\n * a single question is asked. It would also go stale on every deploy, since\n * the tool list would be baked into this package rather than read from the\n * deployment.\n *\n * So discovery stays a QUESTION the agent asks (`oxy_routes`, `oxy_schema`)\n * rather than a payload it carries, exactly as the CLI does it, for\n * everything a generic request can do safely.\n *\n * TWO NAMED EXCEPTIONS: `SANDBOX_TOOLS` and `PREVIEW_TOOLS` below. The sandbox\n * loop and the workspace-previews loop are meant to run UNSUPERVISED — create\n * a sandbox, publish into it, call a function, tear it down — and that needs\n * per-operation validation (the `dev-<handle>` grammar, a confirm gate before\n * a delete, a hard refusal of `--app-env` outside `dev-<handle>` on the\n * publish tool) that `oxy_request` has no way to carry. Each of those tools\n * calls its CLI verb's own request-building function (`env.ts`, `fn.ts`,\n * `checks.ts`, `preview.ts`, `preview-runs.ts`, …), so there is exactly one\n * implementation of each request, and a tool's result is the same JSON\n * document that verb's `--json` prints. `mcp.test.ts` pins the full tool list\n * and a raised (and justified) per-turn schema budget.\n *\n * Auth, target resolution and placeholder substitution are the CLI's — the\n * same `Context`, so a token cached by `oxyc login` works\n * here with no separate setup, and `{org}` / `{workspace}` resolve the same\n * way.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { CallToolRequestSchema, ListToolsRequestSchema } from \"@modelcontextprotocol/sdk/types.js\";\nimport { loadCatalog, loadOpenApi, searchRoutes } from \"../api/catalog.js\";\nimport { paramsToQuery, parseFields } from \"../api/fields.js\";\nimport { runJq } from \"../api/output.js\";\nimport { isExternalSurface, normalizePath, substitutePlaceholders } from \"../api/paths.js\";\nimport { parseJson, request } from \"../api/request.js\";\nimport { requireSandboxName } from \"../apps/environment.js\";\nimport { type Context, createContext } from \"../context/resolve.js\";\nimport {\n CliError,\n ExitCode,\n type ExitCodeValue,\n exitCodeName,\n usageError\n} from \"../util/errors.js\";\nimport { runChecksCore } from \"./checks.js\";\nimport { comparablePath } from \"./discover.js\";\nimport { envCreate, envDelete, envList, envShow } from \"./env.js\";\nimport { fnCall } from \"./fn.js\";\nimport { invocationsHeld, invocationsList } from \"./invocations.js\";\nimport { fetchLogs } from \"./logs.js\";\nimport {\n previewChecks,\n previewCreate,\n previewDelete,\n previewFailed,\n previewList,\n previewShow\n} from \"./preview.js\";\nimport {\n parseVariables,\n previewRunGet,\n previewRunsList,\n previewSubmitRun,\n requireRunKind,\n runFailed\n} from \"./preview-runs.js\";\nimport { publish } from \"./publish.js\";\n\n/**\n * Package version, reported in the MCP handshake.\n *\n * Read from `package.json` rather than restated, so a release bump cannot\n * leave the server announcing a version nobody shipped.\n */\nconst VERSION: string = (() => {\n try {\n const here = dirname(fileURLToPath(import.meta.url));\n for (const candidate of [\n resolve(here, \"..\", \"package.json\"),\n resolve(here, \"..\", \"..\", \"package.json\")\n ]) {\n if (existsSync(candidate)) {\n return (\n (JSON.parse(readFileSync(candidate, \"utf8\")) as { version?: string }).version ?? \"0.0.0\"\n );\n }\n }\n } catch {\n // A packaging shape we did not anticipate. The handshake needs a string,\n // not an accurate one.\n }\n return \"0.0.0\";\n})();\n\n/**\n * A tool result. MCP wants content blocks; everything here is text, because\n * the caller is a language model and the payloads are JSON or markdown.\n */\nfunction text(body: string, isError = false) {\n return { content: [{ type: \"text\" as const, text: body }], isError };\n}\n\n/**\n * A tool result carrying one JSON document — the same shape the matching\n * verb's `--json` prints, so a tool's result and the CLI's output never\n * drift apart. On failure the exit-code class is appended, same spelling as\n * the generic catch-all below (`[exit N NAME]`), so an agent branches on it\n * the way it would on `oxyc`'s own exit code.\n */\nfunction jsonResult(data: unknown, opts: { isError?: boolean; code?: ExitCodeValue } = {}) {\n const body = JSON.stringify(data);\n if (!opts.isError) return text(body);\n const code = opts.code ?? ExitCode.FAILURE;\n return text(`${body}\\n\\n[exit ${code} ${exitCodeName(code)}]`, true);\n}\n\nconst TOOLS = [\n {\n name: \"oxy_routes\",\n description:\n \"List the API endpoints this Oxy deployment mounts, with what each one does. \" +\n \"ALWAYS call this before oxy_request rather than guessing a path. \" +\n \"Pass a filter (matched against method, path, surface and description) to narrow it — \" +\n \"unfiltered is ~670 routes. Above 60 matches the descriptions are dropped and only \" +\n \"method, path and credential come back, so narrow enough to stay under that when you \" +\n \"need to know what an endpoint does; past ~400 it is refused outright.\",\n inputSchema: {\n type: \"object\",\n properties: {\n filter: {\n type: \"string\",\n description: \"Substring to narrow by, e.g. 'threads', 'sql', 'admin', 'semantic'.\"\n },\n all: {\n type: \"boolean\",\n description:\n \"Include ide-only and worker-only routes. Off by default: those are mounted on one \" +\n \"instance of the fleet, so a caller hitting the load balancer cannot reach them directly.\"\n }\n }\n }\n },\n {\n name: \"oxy_schema\",\n description:\n \"The request and response schema for ONE endpoint, so a body can be built correctly. \" +\n \"Covers the data plane (SQL, semantic query, and the org/workspace lookups); a blank \" +\n \"result means undocumented, not nonexistent — use oxy_routes to confirm the endpoint exists.\",\n inputSchema: {\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Endpoint path, e.g. '{workspace}/sql/query'.\" },\n method: { type: \"string\", description: \"Narrow to one HTTP method.\" }\n },\n required: [\"path\"]\n }\n },\n {\n name: \"oxy_request\",\n description:\n \"Make an authenticated request to the Oxy API. The credential is picked from the path \" +\n \"(/api/** takes a bearer, /external/api/** an API key). Placeholders {org}, {workspace}, \" +\n \"{project}, {customer} and {me} are substituted from context. \" +\n \"Read freely; ask the human before any mutating request against production.\",\n inputSchema: {\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path relative to /api, e.g. '{org}/workspaces'.\" },\n method: {\n type: \"string\",\n description: \"HTTP method. Defaults to GET, or POST with fields.\"\n },\n fields: {\n type: \"object\",\n description:\n \"Request parameters. Sent as a JSON body on POST/PUT/PATCH, or as query parameters \" +\n \"on GET/HEAD/DELETE. Values keep their JSON type.\"\n },\n jq: {\n type: \"string\",\n description:\n \"A jq program to reduce the response before it is returned. Use it — a full list \" +\n \"response is far more context than the two fields you need.\"\n }\n },\n required: [\"path\"]\n }\n },\n {\n name: \"oxy_whoami\",\n description:\n \"Which deployment this is pointed at and who the token belongs to. \" +\n \"Use it when a call returns 401/403, or a 200 with a null body — on this API an expired \" +\n \"session answers 200 null rather than 401, and this tells the two apart.\",\n inputSchema: { type: \"object\", properties: {} }\n }\n];\n\n/**\n * THE SANDBOX LOOP, AS TOOLS — the deliberate exception to \"four, not one per\n * endpoint\" above. A generic `oxy_request` can call these same routes, but it\n * cannot carry the per-operation validation that makes the loop safe for an\n * agent to drive unsupervised: the dev-<handle> grammar, the confirm-before-\n * delete gate, and the hard refusal of a sandbox publish outside dev-<handle>.\n * Every one of these reuses its CLI verb's own request-building function —\n * see `env.ts` / `fn.ts` / `checks.ts` / `invocations.ts` / `logs.ts` /\n * `publish.ts` — so there is exactly one implementation of each request, and\n * the tool result is the same JSON document that verb's `--json` prints.\n *\n * Each description says what it returns AND what to call next, so the loop\n * reads off the tool list alone: env_create → publish_sandbox → fn_call /\n * checks_run → invocations_list / invocations_held / logs → iterate from\n * publish_sandbox → env_delete.\n */\nconst SANDBOX_TOOLS = [\n {\n name: \"oxy_env_create\",\n description:\n \"Create a dev-<handle> SANDBOX of a custom app — its own build pointer, storage silo, \" +\n \"secrets and Airhouse sibling, isolated from production and from every other sandbox. \" +\n \"Starts with no build. Returns the Environment (status, build, url). Call \" +\n \"oxy_publish_sandbox next to give it one.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n name: {\n type: \"string\",\n description: \"dev-<handle> — 1-12 lowercase letters, digits and single hyphens.\"\n }\n },\n required: [\"app\", \"name\"]\n }\n },\n {\n name: \"oxy_env_list\",\n description:\n \"List a custom app's environments — production, staging and every dev-<handle> sandbox \" +\n \"— each with its status and build. Use it to find a sandbox's name before oxy_env_show, \" +\n \"oxy_publish_sandbox or oxy_env_delete.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' }\n },\n required: [\"app\"]\n }\n },\n {\n name: \"oxy_env_show\",\n description:\n \"One environment's detail — status, build, url. Call it after oxy_publish_sandbox to \" +\n \"confirm a build landed, or before oxy_fn_call to confirm one exists.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n name: { type: \"string\", description: \"production, staging, or dev-<handle>.\" }\n },\n required: [\"app\", \"name\"]\n }\n },\n {\n name: \"oxy_env_delete\",\n description:\n \"DESTRUCTIVE — tears down a sandbox's storage silo, secrets and Airhouse sibling for \" +\n \"good. Requires confirm=true: there is no terminal to ask on here, so the delete refuses \" +\n \"without it, the same way `oxyc env delete` refuses without --yes off a TTY. Set \" +\n \"waitSeconds to avoid polling oxy_env_show yourself.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n name: {\n type: \"string\",\n description: \"dev-<handle> — production and staging can never be deleted.\"\n },\n confirm: { type: \"boolean\", description: \"Must be true, or the call is refused.\" },\n waitSeconds: {\n type: \"number\",\n description: \"Block until torn down, or this many seconds pass (no wait by default).\"\n }\n },\n required: [\"app\", \"name\", \"confirm\"]\n }\n },\n {\n name: \"oxy_publish_sandbox\",\n description:\n \"DESTRUCTIVE (to the sandbox's build, not production) — build the app in `dir` (default: \" +\n \"the current directory) and publish it to a dev-<handle> sandbox's build pointer. \" +\n \"REQUIRES a dev-<handle> appEnv and refuses production, staging, or any attempt to \" +\n \"promote — a sandbox build is never promoted; publish the same tree to staging and \" +\n \"promote that instead, outside this tool. Runs the app's own build command, so it \" +\n \"executes whatever package scripts oxy-app.json declares. Returns the publish result \" +\n \"(build id, url). Call oxy_fn_call or oxy_checks_run with the same appEnv next.\",\n inputSchema: {\n type: \"object\",\n properties: {\n appEnv: {\n type: \"string\",\n description: \"dev-<handle> — anything else (production, staging) is refused.\"\n },\n dir: { type: \"string\", description: \"App directory to publish (default: cwd).\" },\n app: {\n type: \"string\",\n description: \"App slug (default: oxy-app.json's slug, or OXY_APP).\"\n },\n org: {\n type: \"string\",\n description: \"Org slug (default: oxy-app.json's orgSlug, or OXY_ORG).\"\n }\n },\n required: [\"appEnv\"]\n }\n },\n {\n name: \"oxy_fn_call\",\n description:\n \"Call a custom app's Oxy Function directly (POST .../fn/<function>) and return its \" +\n \"result: {ok, status, body, logs, invocationId, error}. isError is set when the \" +\n \"FUNCTION failed (distinct from a transport failure, which throws). Needs a build in \" +\n \"that environment — oxy_publish_sandbox or oxy_env_show confirms one exists. Call \" +\n \"oxy_logs or oxy_invocations_held with the returned invocationId to see why it failed.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n function: { type: \"string\", description: \"The Oxy Function's name.\" },\n appEnv: { type: \"string\", description: \"production (default), staging, or dev-<handle>.\" },\n data: { type: \"string\", description: 'JSON request body (default \"{}\").' },\n timeoutSeconds: { type: \"number\", description: \"Client-side timeout (default 60).\" }\n },\n required: [\"app\", \"function\"]\n }\n },\n {\n name: \"oxy_checks_run\",\n description:\n 'Run every function the app marked \"check\": true in one environment, and wait for each ' +\n \"to a terminal status. Returns {app, checks:[{name, status, passed, error, durationMs}]}; \" +\n \"isError is set when any check failed or timed out. Run this right after \" +\n \"oxy_publish_sandbox to verify a build.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n appEnv: { type: \"string\", description: \"production (default), staging, or dev-<handle>.\" },\n timeoutSeconds: { type: \"number\", description: \"Per-check timeout (default 300).\" }\n },\n required: [\"app\"]\n }\n },\n {\n name: \"oxy_invocations_list\",\n description:\n \"List what ran in an app's environment — every function invocation, newest first, with \" +\n \"its status. Use it to confirm oxy_fn_call or oxy_checks_run reached the sandbox, or to \" +\n \"find an invocation id for oxy_invocations_held.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n appEnv: { type: \"string\", description: \"Narrow to one environment.\" },\n build: { type: \"string\", description: \"Narrow to one build (its id, or the build UUID).\" },\n function: { type: \"string\", description: \"Narrow to one function.\" },\n limit: { type: \"number\", description: \"Max rows (default 50).\" }\n },\n required: [\"app\"]\n }\n },\n {\n name: \"oxy_invocations_held\",\n description:\n \"What a non-production invocation's write policy HELD instead of performing — \" +\n \"production's would-be effect, recorded rather than run. Empty for a production \" +\n \"invocation, since nothing is held there. Call with an id from oxy_invocations_list or \" +\n \"oxy_fn_call's invocationId.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n invocationId: { type: \"string\", description: \"From oxy_invocations_list or oxy_fn_call.\" }\n },\n required: [\"app\", \"invocationId\"]\n }\n },\n {\n name: \"oxy_logs\",\n description:\n \"An app's persisted ctx.log() / console.* output, newest-relevant window first. Use it \" +\n \"to debug a function that oxy_fn_call or oxy_checks_run reported as failed.\",\n inputSchema: {\n type: \"object\",\n properties: {\n app: { type: \"string\", description: '\"<org-slug>/<app-slug>\" or the app UUID.' },\n appEnv: {\n type: \"string\",\n description: \"Narrow to one environment (default: production only).\"\n },\n invocation: { type: \"string\", description: \"Narrow to one invocation id.\" },\n request: { type: \"string\", description: \"Narrow to one request id.\" },\n hours: { type: \"number\", description: \"Window size in hours (default 24, max 168).\" },\n limit: { type: \"number\", description: \"Max rows (default 100, max 500).\" }\n },\n required: [\"app\"]\n }\n }\n];\n\n/**\n * WORKSPACE PREVIEWS, AS TOOLS — the same exception as `SANDBOX_TOOLS` above,\n * for the same reason: the run-kind grammar and the create/wait/timeout\n * contract are per-operation validation a generic `oxy_request` cannot carry.\n * Each reuses its `oxyc preview` verb's own request-building function (see\n * `preview.ts` / `preview-runs.ts`), so there is one implementation of each\n * request and the tool result matches that verb's `--json` output.\n *\n * The loop: preview_create (waits for the compile) → preview_checks → \" +\n * preview_run (procedure or airway_sample) → preview_run_show (waits for the \" +\n * run) → preview_runs_list to see transform_build/compare runs the server \" +\n * queued on its own → preview_delete when done.\n */\nconst PREVIEW_TOOLS = [\n {\n name: \"oxy_preview_create\",\n description:\n \"Preview a workspace branch: compile its head into a staging revision (or reuse the \" +\n \"ready one for that commit) and start serving it under x-oxy-preview-revision. Returns \" +\n \"the PreviewItem ({branch, status, revision_id, checks, ...}) — idempotent, so calling it \" +\n \"again on the same commit is free. Set waitSeconds to avoid polling oxy_preview_show \" +\n \"yourself; isError is then set on a compile that failed. Call oxy_preview_checks next.\",\n inputSchema: {\n type: \"object\",\n properties: {\n branch: { type: \"string\", description: \"The branch to preview. Not the default branch.\" },\n waitSeconds: {\n type: \"number\",\n description:\n \"Block until the compile is ready or failed, up to this many seconds (no wait by default).\"\n }\n },\n required: [\"branch\"]\n }\n },\n {\n name: \"oxy_preview_list\",\n description:\n \"List every branch staff are previewing in this workspace, most recently touched first, \" +\n \"each with its compile status and checks summary. Use it to find a branch name before \" +\n \"the other preview tools.\",\n inputSchema: { type: \"object\", properties: {} }\n },\n {\n name: \"oxy_preview_show\",\n description:\n \"One branch's preview — status and checks summary (PreviewItem). Not a server route: \" +\n \"filters oxy_preview_list's result by branch, and fails NOT_FOUND when the branch has \" +\n \"no preview.\",\n inputSchema: {\n type: \"object\",\n properties: { branch: { type: \"string\", description: \"The previewed branch.\" } },\n required: [\"branch\"]\n }\n },\n {\n name: \"oxy_preview_delete\",\n description:\n \"DESTRUCTIVE — stop previewing a branch: cancels its queued runs and releases its \" +\n \"staging revision. Requires confirm=true (there is no terminal to ask on here).\",\n inputSchema: {\n type: \"object\",\n properties: {\n branch: { type: \"string\", description: \"The previewed branch to stop previewing.\" },\n confirm: { type: \"boolean\", description: \"Must be true, or the call is refused.\" }\n },\n required: [\"branch\", \"confirm\"]\n }\n },\n {\n name: \"oxy_preview_checks\",\n description:\n \"The Airway change check of a preview's current revision: each changed .airway.yml \" +\n \"pipeline and whether merging it needs a Reset schema, and each changed automation \" +\n '(\"auto\" transforms are built in the preview and compared with live; \"manual\" ones say ' +\n 'why not). \"pending\" with no pipelines until the check has run — call oxy_preview_show ' +\n \"or retry shortly.\",\n inputSchema: {\n type: \"object\",\n properties: { branch: { type: \"string\", description: \"The previewed branch.\" } },\n required: [\"branch\"]\n }\n },\n {\n name: \"oxy_preview_run\",\n description:\n \"Start a held dry run of a previewed branch: a procedure (every write held or, on the \" +\n \"managed Airhouse, redirected into the preview's own schemas) or an airway_sample (a \" +\n \"bounded window of a pipeline into the preview's schemas). transform_build and compare \" +\n \"runs are queued by the server's own change check and cannot be started here — read \" +\n \"them back with oxy_preview_runs_list / oxy_preview_run_show instead. Returns \" +\n \"{run_id, state}. Set waitSeconds to avoid polling oxy_preview_run_show yourself; isError \" +\n \"is then set if the run failed or was cancelled. Needs OXY_PREVIEW_RUNS enabled on the \" +\n \"deployment.\",\n inputSchema: {\n type: \"object\",\n properties: {\n branch: { type: \"string\", description: \"The previewed branch to run against.\" },\n kind: { type: \"string\", description: '\"procedure\" or \"airway_sample\".' },\n ref: {\n type: \"string\",\n description: \"The automation path (procedure) or .airway.yml path (airway_sample).\"\n },\n variables: {\n type: \"string\",\n description: \"procedure: JSON object of the automation's variables.\"\n },\n readLiveOnly: {\n type: \"boolean\",\n description: \"procedure: read live tables even where the preview holds a copy.\"\n },\n windowFrom: { type: \"string\", description: \"airway_sample: window start, RFC 3339.\" },\n windowTo: { type: \"string\", description: \"airway_sample: window end, RFC 3339.\" },\n resources: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"airway_sample: the resources to read, for a multi-resource source.\"\n },\n waitSeconds: {\n type: \"number\",\n description: \"Block until the run finishes, up to this many seconds (no wait by default).\"\n }\n },\n required: [\"branch\", \"kind\", \"ref\"]\n }\n },\n {\n name: \"oxy_preview_runs_list\",\n description:\n \"A branch's held runs, newest first — procedure, transform_build, compare and \" +\n \"airway_sample alike, with each one's state and outcome. Use it to find a run_id for \" +\n \"oxy_preview_run_show, including the transform_build/compare runs the server queues on \" +\n \"its own that oxy_preview_run cannot start.\",\n inputSchema: {\n type: \"object\",\n properties: { branch: { type: \"string\", description: \"The previewed branch.\" } },\n required: [\"branch\"]\n }\n },\n {\n name: \"oxy_preview_run_show\",\n description:\n \"One run's detail: its steps (with what each held or redirected), and — for \" +\n \"transform_build/compare — the compare-with-live outcome, or — for airway_sample — the \" +\n \"sample's ask and result. Set waitSeconds to avoid polling yourself; isError is then set \" +\n \"if the run failed or was cancelled.\",\n inputSchema: {\n type: \"object\",\n properties: {\n runId: { type: \"string\", description: \"From oxy_preview_run or oxy_preview_runs_list.\" },\n waitSeconds: {\n type: \"number\",\n description: \"Block until the run finishes, up to this many seconds (no wait by default).\"\n }\n },\n required: [\"runId\"]\n }\n }\n];\n\nconst ALL_TOOLS = [...TOOLS, ...SANDBOX_TOOLS, ...PREVIEW_TOOLS];\n\n/**\n * Above this many matches, `oxy_routes` drops the descriptions.\n *\n * DEGRADES, IT DOES NOT REFUSE — the same shape as `oxyc routes`, which picks\n * `renderDetailed` under 40 matches and the compact method+path table above it\n * (`discover.ts`). The expensive field is `description`, not the row: a trimmed\n * row is a few tens of bytes, so several hundred still fit in a result an agent\n * can read, while the descriptions are what turn a broad match into hundreds of\n * KB of context spent before a question is asked.\n *\n * The threshold is on the COUNT, not on whether a `filter` was supplied — a\n * filter is not evidence of narrowing. `searchRoutes` matches a substring of\n * method, path, surface or description, so `\"admin\"`, `\"workspace\"` and\n * `\"query\"` are all filters a model reaches for in good faith that clear this.\n */\nconst MAX_DESCRIBED_ROUTES = 60;\n\n/**\n * And above THIS many, there is nothing useful to return at all.\n *\n * Deliberately far above the threshold that drops descriptions: refusing is the\n * answer only when even the trimmed listing would be a context dump, which for\n * a deployment of ~670 routes means \"you asked for effectively all of them\".\n */\nconst MAX_ROUTES_PER_RESULT = 400;\n\n/** `{ a: 1 }` → the `-f`/`-F` pairs `parseFields` understands. */\nfunction fieldPairs(fields: Record<string, unknown> | undefined): string[] {\n if (!fields) return [];\n return Object.entries(fields).map(([k, v]) => `${k}=${JSON.stringify(v)}`);\n}\n\n/**\n * Check the arguments the schema says are required.\n *\n * `inputSchema.required` is ADVISORY on the low-level `Server` — it is handed\n * to the model, not enforced by the transport. Without this, `oxy_schema` with\n * no `path` matched every path and returned the whole OpenAPI document, and\n * `oxy_request` with none built a request to `/api/`.\n */\nfunction requireArgs(name: string, args: Record<string, unknown>, required: string[]): void {\n const missing = required.filter((k) => {\n const v = args[k];\n return v === undefined || v === null || (typeof v === \"string\" && v.trim() === \"\");\n });\n if (missing.length > 0) {\n throw new CliError(`${name} needs ${missing.join(\", \")}`, { code: ExitCode.USAGE });\n }\n}\n\nasync function callTool(ctx: Context, name: string, args: Record<string, unknown>) {\n switch (name) {\n case \"oxy_routes\": {\n const catalog = await loadCatalog({ target: ctx.target(), bearer: ctx.maybeBearer() });\n const filter = (args.filter as string | undefined)?.trim();\n let matches = searchRoutes(catalog, filter || undefined);\n if (!args.all) matches = matches.filter((r) => r.role === \"fleet-ok\");\n\n // A cache stale enough to be wrong is worth saying INSIDE the result:\n // `loadCatalog` warns on stderr, which an MCP client never shows anyone.\n const staleNote = catalog.stale\n ? \"NOTE: this route table came from a stale local cache; the deployment was unreachable.\\n\\n\"\n : \"\";\n\n const asked = filter ? ` ${JSON.stringify(filter)}` : \"\";\n\n // Only a match set too large even to LIST is refused. Below that the\n // result degrades instead, because a filter like \"admin\" or \"query\" can\n // clear the description threshold in good faith and \"guess something\n // narrower\" is a dead end for a model with no way to see what it hit.\n if (matches.length > MAX_ROUTES_PER_RESULT) {\n return text(\n `${staleNote}${matches.length} routes match${asked}, which is effectively the whole ` +\n `deployment. Call oxy_routes again with a narrower \\`filter\\` (matched against ` +\n `method, path, surface and description), e.g. \"threads\", \"sql\", \"semantic\", \"admin\".`,\n true\n );\n }\n\n if (matches.length === 0) {\n // An empty array reads as \"this deployment has no such endpoint\",\n // which is usually false — the filter was wrong, or the route is\n // ide-only and hidden by default.\n return text(\n `${staleNote}No route matches ${JSON.stringify(filter ?? \"\")}. Try a broader filter, ` +\n `or pass all=true to include ide-only and worker-only mounts.`,\n true\n );\n }\n // Trimmed to the fields that help a caller build a request. The full\n // record carries the handler path and mount notes, which are for a\n // maintainer reading source, not for an agent composing a call.\n const described = matches.length <= MAX_DESCRIBED_ROUTES;\n // `credential` SURVIVES THE TRIM. It is what separates the bearer mount\n // from the `/external/api` API-key one, so a caller composing a request\n // needs it in either form — and `renderCompact`, the CLI shape this\n // mirrors, keeps it as a per-surface heading. It is also not the\n // expensive field: ~25 bytes a row, ~10 KB across the whole ceiling,\n // against descriptions that run to hundreds of KB.\n const trimmed = matches.map((r) =>\n described\n ? { method: r.method, path: r.path, credential: r.credential, description: r.description }\n : { method: r.method, path: r.path, credential: r.credential }\n );\n // The note says the listing is trimmed AND how to get the descriptions\n // back. Without it a model reads a description-less row as an endpoint\n // that has no documentation, rather than one it did not ask narrowly\n // enough to see.\n const trimNote = described\n ? \"\"\n : `NOTE: ${matches.length} routes match${asked} — too many to describe, so each row is ` +\n `method, path and credential WITHOUT its description. Narrow the \\`filter\\` to ` +\n `${MAX_DESCRIBED_ROUTES} or fewer matches to get the descriptions back.\\n\\n`;\n return text(`${staleNote}${trimNote}${JSON.stringify(trimmed)}`);\n }\n\n case \"oxy_schema\": {\n requireArgs(\"oxy_schema\", args, [\"path\"]);\n const doc = (await loadOpenApi({ target: ctx.target(), bearer: ctx.maybeBearer() })) as {\n paths?: Record<string, Record<string, unknown>>;\n components?: unknown;\n };\n const wanted = typeof args.path === \"string\" ? args.path : \"\";\n const method = args.method as string | undefined;\n // `comparablePath` is imported from `discover.ts` rather than copied:\n // a second reduction of the same two spellings is a second thing to keep\n // in step, and the copy here was untested. Exact first, then substring —\n // the order `runSchema` uses, so the two commands answer alike.\n const paths = Object.entries(doc.paths ?? {});\n const exact = paths.filter(([p]) => comparablePath(p) === comparablePath(wanted));\n const hit =\n exact.length > 0\n ? exact\n : paths.filter(([p]) => comparablePath(p).includes(comparablePath(wanted)));\n if (hit.length === 0) {\n return text(\n `No documented schema for ${wanted}. The OpenAPI document covers the data plane only — ` +\n `call oxy_routes with a filter to confirm the endpoint exists.`,\n true\n );\n }\n const selected = Object.fromEntries(\n hit.map(([p, ops]) => [\n p,\n method\n ? Object.fromEntries(\n Object.entries(ops).filter(([verb]) => verb.toLowerCase() === method.toLowerCase())\n )\n : ops\n ])\n );\n return text(JSON.stringify({ paths: selected, components: doc.components }, null, 2));\n }\n\n case \"oxy_request\": {\n requireArgs(\"oxy_request\", args, [\"path\"]);\n const raw = typeof args.path === \"string\" ? args.path : \"\";\n const method =\n (typeof args.method === \"string\" ? args.method.toUpperCase() : \"\") || undefined;\n const fields = parseFields([], fieldPairs(args.fields as Record<string, unknown>));\n const verb = method ?? (fields.present ? \"POST\" : \"GET\");\n const carriesBody = ![\"GET\", \"HEAD\", \"DELETE\"].includes(verb);\n\n let path = substitutePlaceholders(normalizePath(raw), ctx.placeholders());\n let body: string | undefined;\n if (fields.present) {\n if (carriesBody) body = JSON.stringify(fields.params);\n else {\n const query = paramsToQuery(fields.params);\n if (query) path += (path.includes(\"?\") ? \"&\" : \"?\") + query;\n }\n }\n\n const apiKey = ctx.apiKey();\n const external = isExternalSurface(path);\n const response = await request({\n target: ctx.target(),\n path,\n method: verb,\n body,\n bearer: external && apiKey ? ctx.maybeBearer() : ctx.bearer(),\n apiKey\n });\n\n if (response.status < 200 || response.status >= 300) {\n // The STATUS and the body, not a thrown error: the model can act on\n // \"403, here is what the server said\" and cannot act on a transport\n // exception. It is marked `isError` so the runtime shows it as one.\n return text(`HTTP ${response.status} ${response.statusText}\\n${response.body}`, true);\n }\n\n if (response.body.trim() === \"null\") {\n return text(\n \"null\\n\\n(NOTE: a 200 with a null body can mean an expired session on this API, \" +\n \"not 'no such thing'. Call oxy_whoami to tell them apart.)\"\n );\n }\n\n const jq = args.jq as string | undefined;\n if (jq) return text(runJq(response.body, jq));\n return text(response.body);\n }\n\n case \"oxy_whoami\": {\n const target = ctx.target();\n const response = await request({\n target,\n path: \"/api/user\",\n method: \"GET\",\n bearer: ctx.bearer()\n });\n const payload = parseJson(response.body);\n if (payload === null || payload === undefined) {\n return text(\n `target: ${target}\\nThe token no longer resolves to a user — the session has expired. ` +\n `Ask the human to run \\`oxyc login\\`.`,\n true\n );\n }\n return text(JSON.stringify({ target, user: payload }, null, 2));\n }\n\n // ── sandbox loop ───────────────────────────────────────────────────────\n\n case \"oxy_env_create\": {\n requireArgs(\"oxy_env_create\", args, [\"app\", \"name\"]);\n return jsonResult(await envCreate(ctx, String(args.app), String(args.name)));\n }\n\n case \"oxy_env_list\": {\n requireArgs(\"oxy_env_list\", args, [\"app\"]);\n return jsonResult({ environments: await envList(ctx, String(args.app)) });\n }\n\n case \"oxy_env_show\": {\n requireArgs(\"oxy_env_show\", args, [\"app\", \"name\"]);\n return jsonResult(await envShow(ctx, String(args.app), String(args.name)));\n }\n\n case \"oxy_env_delete\": {\n requireArgs(\"oxy_env_delete\", args, [\"app\", \"name\"]);\n if (args.confirm !== true) {\n throw usageError(\n \"oxy_env_delete needs confirm=true\",\n \"there is no terminal to ask on here — pass confirm=true once you mean it\"\n );\n }\n const result = await envDelete(ctx, String(args.app), String(args.name), {\n yes: true,\n waitSeconds: args.waitSeconds === undefined ? undefined : Number(args.waitSeconds)\n });\n return jsonResult(result);\n }\n\n case \"oxy_publish_sandbox\": {\n requireArgs(\"oxy_publish_sandbox\", args, [\"appEnv\"]);\n // Client-side, before any build or request — the same grammar `oxyc\n // publish --app-env` validates, and the same refusal of \"production\" /\n // \"staging\": a sandbox publish tool that accepted either would be the\n // promote path this tool exists to foreclose.\n const appEnv = requireSandboxName(String(args.appEnv));\n // `org` is a GLOBAL flag (`resolveIdentity` reads `ctx.flags.org`), not a\n // `PublishFlags` field — a fresh context carries it the way `--org`\n // would on the CLI, without mutating the one `runMcp` was given.\n const org = args.org as string | undefined;\n const publishCtx = org === undefined ? ctx : createContext({ ...ctx.flags, org }, ctx.cwd);\n const outcome = await publish(publishCtx, {\n appEnv,\n dir: args.dir as string | undefined,\n app: args.app as string | undefined\n });\n return jsonResult(outcome.result ?? { bundle_dir: outcome.bundleDir });\n }\n\n case \"oxy_fn_call\": {\n requireArgs(\"oxy_fn_call\", args, [\"app\", \"function\"]);\n const result = await fnCall(ctx, String(args.app), String(args.function), {\n appEnv: args.appEnv as string | undefined,\n data: args.data as string | undefined,\n timeoutSeconds: args.timeoutSeconds === undefined ? 60 : Number(args.timeoutSeconds)\n });\n return jsonResult(result, { isError: !result.ok, code: ExitCode.FAILURE });\n }\n\n case \"oxy_checks_run\": {\n requireArgs(\"oxy_checks_run\", args, [\"app\"]);\n const report = await runChecksCore(ctx, String(args.app), {\n timeoutSeconds: args.timeoutSeconds === undefined ? 300 : Number(args.timeoutSeconds),\n appEnv: args.appEnv as string | undefined\n });\n const failed = report.checks.some((c) => !c.passed);\n return jsonResult(report, { isError: failed, code: ExitCode.CHECK_FAILED });\n }\n\n case \"oxy_invocations_list\": {\n requireArgs(\"oxy_invocations_list\", args, [\"app\"]);\n const invocations = await invocationsList(ctx, String(args.app), {\n appEnv: args.appEnv as string | undefined,\n build: args.build as string | undefined,\n fn: args.function as string | undefined,\n limit: args.limit === undefined ? undefined : Number(args.limit)\n });\n return jsonResult({ invocations });\n }\n\n case \"oxy_invocations_held\": {\n requireArgs(\"oxy_invocations_held\", args, [\"app\", \"invocationId\"]);\n return jsonResult(await invocationsHeld(ctx, String(args.app), String(args.invocationId)));\n }\n\n case \"oxy_logs\": {\n requireArgs(\"oxy_logs\", args, [\"app\"]);\n const logs = await fetchLogs(ctx, String(args.app), {\n appEnv: args.appEnv as string | undefined,\n invocation: args.invocation as string | undefined,\n request: args.request as string | undefined,\n hours: args.hours === undefined ? undefined : Number(args.hours),\n limit: args.limit === undefined ? undefined : Number(args.limit)\n });\n return jsonResult({ logs });\n }\n\n // ── workspace previews ──────────────────────────────────────────────────\n\n case \"oxy_preview_create\": {\n requireArgs(\"oxy_preview_create\", args, [\"branch\"]);\n const item = await previewCreate(ctx, String(args.branch), {\n waitSeconds: args.waitSeconds === undefined ? undefined : Number(args.waitSeconds)\n });\n return jsonResult(item, { isError: previewFailed(item), code: ExitCode.FAILURE });\n }\n\n case \"oxy_preview_list\":\n return jsonResult({ items: await previewList(ctx) });\n\n case \"oxy_preview_show\": {\n requireArgs(\"oxy_preview_show\", args, [\"branch\"]);\n return jsonResult(await previewShow(ctx, String(args.branch)));\n }\n\n case \"oxy_preview_delete\": {\n requireArgs(\"oxy_preview_delete\", args, [\"branch\"]);\n if (args.confirm !== true) {\n throw usageError(\n \"oxy_preview_delete needs confirm=true\",\n \"there is no terminal to ask on here — pass confirm=true once you mean it\"\n );\n }\n return jsonResult(await previewDelete(ctx, String(args.branch), { yes: true }));\n }\n\n case \"oxy_preview_checks\": {\n requireArgs(\"oxy_preview_checks\", args, [\"branch\"]);\n return jsonResult(await previewChecks(ctx, String(args.branch)));\n }\n\n case \"oxy_preview_run\": {\n requireArgs(\"oxy_preview_run\", args, [\"branch\", \"kind\", \"ref\"]);\n const kind = requireRunKind(String(args.kind));\n const windowFrom = args.windowFrom as string | undefined;\n const windowTo = args.windowTo as string | undefined;\n const submitted = await previewSubmitRun(ctx, {\n branch: String(args.branch),\n kind,\n ref: String(args.ref),\n variables: parseVariables(args.variables as string | undefined),\n readLiveOnly: args.readLiveOnly as boolean | undefined,\n window:\n windowFrom === undefined && windowTo === undefined\n ? undefined\n : { from: windowFrom, to: windowTo },\n resources: (args.resources as string[] | undefined) ?? []\n });\n const waitSeconds = args.waitSeconds === undefined ? undefined : Number(args.waitSeconds);\n if (waitSeconds === undefined) return jsonResult(submitted);\n const detail = await previewRunGet(ctx, submitted.run_id, { waitSeconds });\n return jsonResult(detail, { isError: runFailed(detail), code: ExitCode.FAILURE });\n }\n\n case \"oxy_preview_runs_list\": {\n requireArgs(\"oxy_preview_runs_list\", args, [\"branch\"]);\n return jsonResult({ runs: await previewRunsList(ctx, String(args.branch)) });\n }\n\n case \"oxy_preview_run_show\": {\n requireArgs(\"oxy_preview_run_show\", args, [\"runId\"]);\n const detail = await previewRunGet(ctx, String(args.runId), {\n waitSeconds: args.waitSeconds === undefined ? undefined : Number(args.waitSeconds)\n });\n return jsonResult(detail, { isError: runFailed(detail), code: ExitCode.FAILURE });\n }\n\n default:\n return text(`unknown tool: ${name}`, true);\n }\n}\n\n/**\n * Serve MCP on stdio until the client disconnects.\n *\n * STDIO IS THE WHOLE TRANSPORT, deliberately. An HTTP/SSE server would need a\n * port, a lifetime and an auth story of its own; stdio is what every agent\n * runtime already launches, and the process inherits the caller's environment\n * — which is where the token and the target come from.\n *\n * NOTHING MAY BE WRITTEN TO STDOUT except protocol frames. `log.info` and\n * friends already go to stderr, which is why this can share the CLI's own\n * plumbing without corrupting the stream.\n */\nexport async function runMcp(ctx: Context): Promise<void> {\n const server = new Server({ name: \"oxyc\", version: VERSION }, { capabilities: { tools: {} } });\n\n server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: ALL_TOOLS }));\n\n server.setRequestHandler(CallToolRequestSchema, async (req) => {\n try {\n return await callTool(\n ctx,\n req.params.name,\n (req.params.arguments ?? {}) as Record<string, unknown>\n );\n } catch (cause) {\n // A throw here would kill the session. The model can act on a message;\n // it cannot act on a dead transport.\n const message = (cause as Error).message ?? String(cause);\n // BOTH CHANNELS. A model gets one string, so there is no marker to\n // distinguish them — but reading `hint` alone drops the one line that\n // says what to DO, which is the half a model can act on.\n const { hint, remedy } = cause as { hint?: string; remedy?: string };\n // Blank line between them, the way every other renderer of these two\n // separates them — a model given two consecutive imperatives with no\n // boundary loses the distinction the second field exists to make.\n // `!== undefined` for the narrowing TS gives it, and a length check\n // because an empty string would open the block with a blank line —\n // `filter(Boolean)` covered that and cost the narrowing, so both.\n const extra = [hint, remedy].filter((line) => line !== undefined && line !== \"\").join(\"\\n\\n\");\n // THE EXIT-CODE CLASS, APPENDED — not substituted for the message, and\n // not only on the sandbox/preview tools: every CliError carries a code,\n // so every tool's failure now lets a caller branch the way it would on\n // `oxyc`'s own exit code, by NAME rather than a digit it has to look up.\n // The server's own `code` field (previews, sandboxes) rides along when\n // the response carried one.\n const codeLine =\n cause instanceof CliError\n ? `[exit ${cause.code} ${exitCodeName(cause.code)}]` +\n (cause.serverCode ? ` server code: ${cause.serverCode}` : \"\")\n : undefined;\n const body = [message, extra, codeLine]\n .filter((s) => s !== undefined && s !== \"\")\n .join(\"\\n\\n\");\n return text(body, true);\n }\n });\n\n await server.connect(new StdioServerTransport());\n\n // `connect` returns once the transport is wired; the process must stay up\n // until the client closes stdin.\n await new Promise<void>((resolve) => {\n process.stdin.on(\"close\", resolve);\n server.onclose = resolve;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,MAAM,iBAAyB;CAC7B,IAAI;EACF,MAAM,OAAO,QAAQ,cAAc,YAAY,GAAG,CAAC;EACnD,KAAK,MAAM,aAAa,CACtB,QAAQ,MAAM,MAAM,cAAc,GAClC,QAAQ,MAAM,MAAM,MAAM,cAAc,CAC1C,GACE,IAAI,WAAW,SAAS,GACtB,OACG,KAAK,MAAM,aAAa,WAAW,MAAM,CAAC,CAAC,CAA0B,WAAW;CAIzF,QAAQ,CAGR;CACA,OAAO;AACT,EAAC,CAAE;;;;;AAMH,SAAS,KAAK,MAAc,UAAU,OAAO;CAC3C,OAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAiB,MAAM;EAAK,CAAC;EAAG;CAAQ;AACrE;;;;;;;;AASA,SAAS,WAAW,MAAe,OAAoD,CAAC,GAAG;CACzF,MAAM,OAAO,KAAK,UAAU,IAAI;CAChC,IAAI,CAAC,KAAK,SAAS,OAAO,KAAK,IAAI;CACnC,MAAM,OAAO,KAAK,QAAQ,SAAS;CACnC,OAAO,KAAK,GAAG,KAAK,YAAY,KAAK,GAAG,aAAa,IAAI,EAAE,IAAI,IAAI;AACrE;AAEA,MAAM,QAAQ;CACZ;EACE,MAAM;EACN,aACE;EAMF,aAAa;GACX,MAAM;GACN,YAAY;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,KAAK;KACH,MAAM;KACN,aACE;IAEJ;GACF;EACF;CACF;CACA;EACE,MAAM;EACN,aACE;EAGF,aAAa;GACX,MAAM;GACN,YAAY;IACV,MAAM;KAAE,MAAM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CAAC,QAAQ,SAAS,SAAS,UAAa,SAAS,EAAE,CAAC,CAAC,KAAK,MAY3D;IAJzB,iBAAiB,WACb,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"}
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"validation": {
|
|
72
|
-
"description": "Validation rule configuration.\n\nWhen absent,
|
|
72
|
+
"description": "Validation rule configuration.\n\nWhen absent, the 15 default rules run with their default parameters ([`ValidationConfig::default_all_rules`]). When present, it **replaces** that set rather than adjusting it: only the rules it lists, and does not mark `enabled: false`, run. A stage it lists no rules for is not checked at all, and an empty section (`validation: {}`) runs no rules. To switch off one rule or tune its parameters, list every rule that should still run. This, for example, runs outlier detection with a tighter threshold and nothing else:\n\n```yaml validation: rules: solved: - name: outlier_detection enabled: true threshold_sigma: 3.0 min_rows: 6 ```",
|
|
73
73
|
"default": null,
|
|
74
74
|
"anyOf": [
|
|
75
75
|
{
|
package/json-schemas/config.json
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "Config",
|
|
4
4
|
"type": "object",
|
|
5
|
-
"required": [
|
|
6
|
-
"databases",
|
|
7
|
-
"models"
|
|
8
|
-
],
|
|
9
5
|
"properties": {
|
|
10
6
|
"base_branch": {
|
|
11
7
|
"description": "Branch that new worktrees fork from when saving on a protected branch. Defaults to the currently checked-out branch (usually the default branch) when not set. Use this when Oxy serves from a \"deployment\" branch but new work should fork from an \"integration\" branch (e.g. serve from `deploy`, fork new work from `main`).\n\nExample config.yml: base_branch: main",
|
|
@@ -25,6 +21,7 @@
|
|
|
25
21
|
]
|
|
26
22
|
},
|
|
27
23
|
"databases": {
|
|
24
|
+
"default": [],
|
|
28
25
|
"type": "array",
|
|
29
26
|
"items": {
|
|
30
27
|
"$ref": "#/definitions/Database"
|
|
@@ -70,6 +67,7 @@
|
|
|
70
67
|
]
|
|
71
68
|
},
|
|
72
69
|
"models": {
|
|
70
|
+
"default": [],
|
|
73
71
|
"type": "array",
|
|
74
72
|
"items": {
|
|
75
73
|
"$ref": "#/definitions/Model"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"trace": "on-failure",
|
|
22
22
|
"cache_actions": true,
|
|
23
23
|
"max_steps": 30,
|
|
24
|
-
"backend_mode": "
|
|
24
|
+
"backend_mode": "cloud"
|
|
25
25
|
},
|
|
26
26
|
"allOf": [{ "$ref": "#/definitions/FlowSettings" }]
|
|
27
27
|
},
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"backend_mode": {
|
|
51
51
|
"type": "string",
|
|
52
52
|
"enum": ["local", "cloud"],
|
|
53
|
-
"default": "
|
|
54
|
-
"description": "Which oxy backend mode the flow exercises. '
|
|
53
|
+
"default": "cloud",
|
|
54
|
+
"description": "Which oxy backend mode the flow exercises. 'cloud' (default) = enterprise mode, the production path: oxy start --enterprise + oxy seed of demo_project/ as the Demo workspace; the runner signs in on :3000 as flow@oxy.local and prefixes workspace paths with /local/workspaces/<demo id>. 'local' = the legacy, unmaintained --local single-workspace no-auth mode; opt in only for a flow that tests legacy local mode itself. Flows in a single invocation must agree."
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"additionalProperties": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy-hq/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "oxyc — the Oxy CLI: a gh-api-style client for the Oxy HTTP API, plus the customer-account tooling that scopes a session to one customer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
],
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@clack/prompts": "^1.
|
|
48
|
-
"@modelcontextprotocol/sdk": "^1.30.
|
|
47
|
+
"@clack/prompts": "^1.8.1",
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.30.1",
|
|
49
49
|
"ajv": "^8.20.0",
|
|
50
50
|
"ajv-formats": "^3.0.1",
|
|
51
51
|
"commander": "^15.0.0",
|
|
52
52
|
"picocolors": "^1.1.1",
|
|
53
|
-
"yaml": "^2.
|
|
54
|
-
"zod": "^
|
|
53
|
+
"yaml": "^2.9.1",
|
|
54
|
+
"zod": "^4.6.5"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/node": "^26.
|
|
58
|
-
"tsdown": "^0.
|
|
57
|
+
"@types/node": "^26.6.3",
|
|
58
|
+
"tsdown": "^0.23.0",
|
|
59
59
|
"typescript": "^7.0.2",
|
|
60
|
-
"vitest": "^5.0.
|
|
60
|
+
"vitest": "^5.0.2"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20"
|
package/skills/oxy-cli/SKILL.md
CHANGED
|
@@ -79,6 +79,29 @@ wins where the two disagree.
|
|
|
79
79
|
If your runtime speaks MCP, `oxyc mcp` serves the same API surface as four
|
|
80
80
|
tools (`oxy_routes`, `oxy_schema`, `oxy_request`, `oxy_whoami`) instead.
|
|
81
81
|
|
|
82
|
+
## Custom apps: what is live, healthy, used
|
|
83
|
+
|
|
84
|
+
Read-only — every request is a GET. `<app>` is `<org-slug>/<app-slug>` or an
|
|
85
|
+
app UUID; each command takes `--json`.
|
|
86
|
+
|
|
87
|
+
oxyc apps list [--org <slug>] [--published|--draft] [--builds] # every app you can see
|
|
88
|
+
oxyc apps show <app> # live build, draft build, health, availability, 7-day usage
|
|
89
|
+
oxyc apps builds <app> # build history; which build is live, which is the draft
|
|
90
|
+
oxyc apps health [<app>] # fleet table (--needs-attention), or one app's checks and errors
|
|
91
|
+
oxyc apps usage <app> # views, visitors, tracked events over 7 days
|
|
92
|
+
oxyc apps drift [<app>] # commits in a LOCAL checkout after the live build's commit
|
|
93
|
+
|
|
94
|
+
- Use these rather than `oxyc api api/customer-apps…` by hand: they walk the
|
|
95
|
+
paged listing to its end and resolve `<org>/<app>` to the id the routes take.
|
|
96
|
+
- **A failed request never prints as an empty result.** The part that was not
|
|
97
|
+
read says `NOT READ` and the exit code is non-zero. A failing health check or
|
|
98
|
+
a drifted app is a report and exits `0` — read the output, not the code.
|
|
99
|
+
- **`drift` answers `in sync`, `N commits ahead`, or `unknown — <reason>`.**
|
|
100
|
+
`unknown` means the comparison could not be made (commit not recorded,
|
|
101
|
+
repository not checked out, commit not fetched, no matching `oxy-app.json`,
|
|
102
|
+
uncommitted changes) and is NOT evidence of no drift. It never fetches: run
|
|
103
|
+
`git fetch` in the checkout first if you want the remote's state.
|
|
104
|
+
|
|
82
105
|
## Branch on the exit code, not the text
|
|
83
106
|
|
|
84
107
|
| | |
|
|
@@ -109,9 +109,15 @@ qualified.)
|
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
`ctx` bridges to the data plane: `ctx.query` / `ctx.queryStream`,
|
|
112
|
-
`ctx.semantic.query`, `ctx.warehouse.
|
|
113
|
-
`ctx.
|
|
114
|
-
|
|
112
|
+
`ctx.semantic.query`, `ctx.warehouse.query`,
|
|
113
|
+
`ctx.warehouse.{insert,exec,upsert}` (to Airhouse, or to a customer
|
|
114
|
+
warehouse the function names in `customerWarehouseWrites`), `ctx.airway.run`,
|
|
115
|
+
`ctx.fetch` (SSRF-allowlisted), `ctx.env`, `ctx.user`, `ctx.log`.
|
|
116
|
+
What the app STORES picks its surface by shape — facts through
|
|
117
|
+
`ctx.airhouse`, records through `ctx.oltp`, files through
|
|
118
|
+
`ctx.storage` — and customer warehouses are read-only. See
|
|
119
|
+
**Where data goes** below before writing anything.
|
|
120
|
+
`oxyc publish` bundles `functions/*.ts` with
|
|
115
121
|
esbuild — no separate backend to stand up. Worked example +
|
|
116
122
|
author-facing `ctx` types: `oxy-hq/customer-apps:
|
|
117
123
|
examples/hello-oxy/functions/`.
|
|
@@ -124,6 +130,65 @@ qualified.)
|
|
|
124
130
|
from the manifest for `pnpm dev` / `pnpm build`. Mismatch → asset
|
|
125
131
|
404s → blank dashboard.
|
|
126
132
|
|
|
133
|
+
## Where data goes (the shape of the data picks the store)
|
|
134
|
+
|
|
135
|
+
| The data | Store | In a function | In `oxy-app.json` |
|
|
136
|
+
| --- | --- | --- | --- |
|
|
137
|
+
| **Facts** — something happened and won't change: an order, a completed checklist, a delivery, a reading | The workspace's Airhouse, in your schema `app_<writer>` | `ctx.airhouse.append(table, rows)` · `ctx.airhouse.query(sql)` · `ctx.airhouse.exec(sql)` | function: `"airhouse": { "enabled": true }` · app: `"airhouseMigrations": { "dir": "airhouse-migrations" }` |
|
|
138
|
+
| **Records** your app edits — bookings, assignments, templates, counts | The org's OLTP Postgres, in your schema `app_<writer>` | `ctx.oltp.query/exec(sql, params)` · `ctx.oltp.tx(async (tx) => …)` | function: `"oltp": { "enabled": true }` · app: `"migrations": { "dir": "migrations" }` |
|
|
139
|
+
| **Files** — photos, PDFs, exports | Your app's storage silo | `ctx.storage` | function: `"storage": { "read": true, "write": true }` |
|
|
140
|
+
| **The customer's warehouse** — ClickHouse, Snowflake, BigQuery, their Postgres | Theirs | `ctx.query` · `ctx.warehouse.query(db, sql)` | read-only: a write is refused unless the function declares `"customerWarehouseWrites": { "<db>": "<why>" }` |
|
|
141
|
+
|
|
142
|
+
**Availability.** `ctx.airhouse`, `ctx.oltp.tx`, `airhouseMigrations`, the
|
|
143
|
+
read-only rule for customer warehouses and `oxyc validate`'s data-placement
|
|
144
|
+
and manifest checks arrive with the Oxy release carrying oxygen-internal#3187,
|
|
145
|
+
together with the `@oxy-hq/sdk` and `@oxy-hq/cli` published from it. Against
|
|
146
|
+
an older Oxy, `ctx.airhouse` is `undefined` and the new manifest fields are
|
|
147
|
+
ignored; vendored `oxy.d.ts` copies (`examples/hello-oxy/functions/oxy.d.ts`)
|
|
148
|
+
gain the types when they are re-synced from that SDK.
|
|
149
|
+
|
|
150
|
+
Three questions, in order: **Is it bytes?** → storage (keep the key in a record
|
|
151
|
+
or fact). **Does it change after it's written?** No → a fact; yes → a record;
|
|
152
|
+
both when you need history (the record says what is true now, the fact says
|
|
153
|
+
what changed). **Is it already in the customer's warehouse?** → read it there.
|
|
154
|
+
|
|
155
|
+
`<writer>` is your slug with `-` → `_` (`store-ops` → `app_store_ops`); a slug
|
|
156
|
+
with `_` can't back a schema. Both stores are written **as the app**, whoever
|
|
157
|
+
invoked the function, so a scheduled run writes like a click.
|
|
158
|
+
|
|
159
|
+
**Facts, in practice.** Airhouse is DuckLake: no `PRIMARY KEY`, `UNIQUE`,
|
|
160
|
+
indexes or foreign keys — publish refuses a migration carrying one. So:
|
|
161
|
+
|
|
162
|
+
- Give every fact the id its source assigned and a `recorded_at`. A retried
|
|
163
|
+
function appends twice; readers keep one row per id:
|
|
164
|
+
`QUALIFY row_number() OVER (PARTITION BY completion_id ORDER BY recorded_at DESC) = 1`.
|
|
165
|
+
- A correction is a new fact (`voided`, `amended`), not an `UPDATE`.
|
|
166
|
+
- Name tables `app_<writer>.<table>` in migrations and in `exec`/`query`
|
|
167
|
+
(`ctx.airhouse.schema` has the name). `append` takes the bare table name.
|
|
168
|
+
- One statement per call, nothing bound: request data goes through `append`,
|
|
169
|
+
never into `exec` SQL. `exec` runs no DDL — tables come from migrations.
|
|
170
|
+
|
|
171
|
+
**Records, in practice.** Bound parameters (`$1`, `$2`) always. Several
|
|
172
|
+
statements that must land together go in one `ctx.oltp.tx`. The store is
|
|
173
|
+
provisioned per org by an operator; until then calls fail naming that step.
|
|
174
|
+
|
|
175
|
+
**Not a store:** `ctx.secrets` holds credentials you rotate. A cursor, a
|
|
176
|
+
counter or a JSON blob is a record. `oxyc validate` warns about it, about
|
|
177
|
+
keys in Airhouse migrations, and lists every customer-warehouse write exception.
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
// A checklist is finished: the record changes, and a fact is appended.
|
|
181
|
+
async function completeChecklist(ctx, runId: string, storeGuid: string) {
|
|
182
|
+
await ctx.oltp.tx(async (tx) => {
|
|
183
|
+
await tx.exec("UPDATE checklist_runs SET status = 'done', completed_at = now() WHERE id = $1", [runId]);
|
|
184
|
+
await tx.exec("DELETE FROM open_reminders WHERE run_id = $1", [runId]);
|
|
185
|
+
});
|
|
186
|
+
await ctx.airhouse.append("checklist_completions", [
|
|
187
|
+
{ completion_id: runId, store_guid: storeGuid, completed_by: ctx.user.id, recorded_at: new Date().toISOString() },
|
|
188
|
+
]);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
127
192
|
## Four pitfalls
|
|
128
193
|
|
|
129
194
|
- **CORS errors are usually wrong-URL errors in disguise.** The SDK's
|
|
@@ -278,6 +343,7 @@ be resolved at publish time):
|
|
|
278
343
|
```bash
|
|
279
344
|
oxyc login --env production # once; browser flow, caches a token,
|
|
280
345
|
# and prints whether you're an app-admin
|
|
346
|
+
oxyc validate # data-placement and manifest checks first
|
|
281
347
|
oxyc publish --env production # build → tar → upload (draft channel)
|
|
282
348
|
oxyc publish --env production --promote # …straight to live
|
|
283
349
|
```
|
|
@@ -295,9 +361,107 @@ oxyc publish --env production --promote # …straight to live
|
|
|
295
361
|
- `--dir out` skips the build and uploads a prebuilt directory.
|
|
296
362
|
- Promote / roll back / unpublish from the oxy admin app-detail console;
|
|
297
363
|
every publish is audited (who shipped each build, when).
|
|
364
|
+
- **What is live now:** `oxyc apps show <org>/<app>` prints the live build, the
|
|
365
|
+
commit it was built from, a newer draft if there is one, and its health;
|
|
366
|
+
`oxyc apps builds <org>/<app>` is the history. `oxyc apps drift <org>/<app>`
|
|
367
|
+
lists the commits in your checkout that touch the app after the live build's
|
|
368
|
+
commit — `unknown` there means it could not compare, not that nothing changed.
|
|
298
369
|
|
|
299
370
|
Full hands-on guide: `oxy-hq/customer-apps: docs/local-development.md`.
|
|
300
371
|
|
|
372
|
+
## Sandboxes — try a change on real data before shipping it
|
|
373
|
+
|
|
374
|
+
A sandbox (`dev-<handle>`, 1-12 lowercase letters/digits/hyphens, no leading,
|
|
375
|
+
trailing or double hyphen) is a named, short-lived environment of one app: its
|
|
376
|
+
own build pointer, storage silo, secrets and Airhouse sibling schema. Reads
|
|
377
|
+
hit production; most writes are isolated or *held* (recorded, not performed —
|
|
378
|
+
`ctx.oltp`/`ctx.warehouse` stay shared — see
|
|
379
|
+
`internal-docs/custom-app-sandboxes.md` if you have this repo checked out; if
|
|
380
|
+
not, the per-call table is in this skill's "Where data goes" section above,
|
|
381
|
+
and a held write's `note` field in `invocations held` names the manifest key
|
|
382
|
+
that would make it land instead). It starts with no build, costs nothing
|
|
383
|
+
idle, and is gone after 7 idle days or an explicit delete — safe to use for
|
|
384
|
+
every iteration that would otherwise touch staging. Limit: 20 per app.
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
oxyc env create acme/store dev-x --env dev --json # starts with no build
|
|
388
|
+
oxyc publish --env dev --app-env dev-x --json # build + publish to it
|
|
389
|
+
oxyc fn call acme/store submit-order --app-env dev-x --env dev --data '{}' --json # call it
|
|
390
|
+
oxyc checks run acme/store --app-env dev-x --env dev --json # run its checks
|
|
391
|
+
oxyc invocations list acme/store --app-env dev-x --env dev --json # what ran; a row's id is `id`
|
|
392
|
+
oxyc invocations held acme/store <invocation-id> --env dev --json # what it held, not wrote
|
|
393
|
+
oxyc env delete acme/store dev-x --env dev --yes --wait --json # done; tears its homes down
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
(`--data` has no short form — don't write `-d`.)
|
|
397
|
+
|
|
398
|
+
**Over MCP.** If your runtime speaks MCP, `oxyc mcp --env dev` serves the same
|
|
399
|
+
loop as tools — `oxy_env_create` / `oxy_env_list` / `oxy_env_show` /
|
|
400
|
+
`oxy_env_delete`, `oxy_publish_sandbox`, `oxy_fn_call`, `oxy_checks_run`,
|
|
401
|
+
`oxy_invocations_list` / `oxy_invocations_held`, `oxy_logs`. Prefer them to
|
|
402
|
+
shelling out: each calls its verb's own request-building code, so the result
|
|
403
|
+
is the document that verb's `--json` prints, and the choice changes nothing
|
|
404
|
+
on the server. There is no exit code over MCP: a failure is `isError: true`
|
|
405
|
+
with the class at the end of its text (`[exit 5 NOT_FOUND]`, plus `server
|
|
406
|
+
code: <code>` when the server sent one) — branch on that the way you would
|
|
407
|
+
on the exit code. `oxy_fn_call` and `oxy_checks_run` set `isError` when the
|
|
408
|
+
function or a check failed, with the full document still in the result.
|
|
409
|
+
`oxy_env_delete` needs `confirm: true`. `oxy_publish_sandbox` takes only a
|
|
410
|
+
`dev-<handle>` and cannot reach staging or production.
|
|
411
|
+
|
|
412
|
+
Iterate from `publish` as the code changes — each publish is a new build, and
|
|
413
|
+
the sandbox always serves the newest. A sandbox build is **never promoted**:
|
|
414
|
+
ship by publishing the same tree to staging, then promoting from the console.
|
|
415
|
+
Staff only (needs `develop_apps` + `manage_apps`); a publish token is refused
|
|
416
|
+
on every sandbox operation, so CI cannot use one.
|
|
417
|
+
|
|
418
|
+
**Driving this loop unattended (an agent, not a human at a keyboard):**
|
|
419
|
+
|
|
420
|
+
- Name your sandbox `dev-<short-task-slug>` — one per agent/task, never reused
|
|
421
|
+
across unrelated tasks, so parallel agents don't collide. `env create`
|
|
422
|
+
answers exit `6` if the name is already taken.
|
|
423
|
+
- Branch on exit codes and JSON fields only, never on stderr text: `0` ok,
|
|
424
|
+
`1` it ran and the thing itself failed, `2` you called it wrong, `4` not
|
|
425
|
+
authenticated (stop — don't try another credential), `5` not found
|
|
426
|
+
(environment/function/invocation — check the name, or publish first if
|
|
427
|
+
the environment has no build), `6` a conflict or bad name (pick another
|
|
428
|
+
name, wait out a teardown, or free up the 20-sandbox limit), `7` retryable
|
|
429
|
+
(network/5xx, or a `--wait` deadline), `8` refused (stop and report), `9`
|
|
430
|
+
a check failed — read `invocations held` for that check's invocation
|
|
431
|
+
before assuming the function is broken.
|
|
432
|
+
- Hard rules: never pass `--promote` in this loop; never `publish` without
|
|
433
|
+
`--app-env` while iterating in a sandbox; never use `production` as
|
|
434
|
+
`--app-env` to "check" something — reads already hit production. Always
|
|
435
|
+
delete the sandbox you created, **even when an earlier step failed**. On
|
|
436
|
+
exit `4` or `8`, stop and report to a human rather than retrying with a
|
|
437
|
+
different credential or flag. A held write is information to report, not
|
|
438
|
+
an error to engineer around.
|
|
439
|
+
- Report back: the sandbox name, the build id(s) published, each check's
|
|
440
|
+
`passed`, every held write (`op`/`plane`/`table`/`note`), and confirmation
|
|
441
|
+
the sandbox was deleted.
|
|
442
|
+
|
|
443
|
+
**A sandbox isolates the app, not the workspace.** The semantic model,
|
|
444
|
+
automations and Airway pipelines it reads are `main`'s. To try a workspace
|
|
445
|
+
branch, open a **workspace preview** (staff only) — a separate loop:
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
oxyc preview create <branch> --wait --workspace <id> --json # compile the branch; idempotent
|
|
449
|
+
oxyc preview checks <branch> --workspace <id> --json # Airway change check of that revision
|
|
450
|
+
oxyc preview run <branch> procedure <file.automation.yml> --wait --workspace <id> --json # held dry run
|
|
451
|
+
oxyc preview runs list <branch> --workspace <id> --json # every run, the server's own included
|
|
452
|
+
oxyc preview runs show <run-id> --wait --workspace <id> --json # one run: held steps, outcome
|
|
453
|
+
oxyc preview delete <branch> --yes --workspace <id> --json # done
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
`preview run`'s kind is `procedure` or `airway_sample`; never post a
|
|
457
|
+
`transform_build` or `compare` run — the server queues those itself, and you
|
|
458
|
+
read them with `preview runs list` / `runs show`. A `--wait` verb exits `1`
|
|
459
|
+
when what it waited for ended `failed` or `cancelled`, `7` past its deadline.
|
|
460
|
+
Over MCP the same verbs are `oxy_preview_create` / `_list` / `_show` /
|
|
461
|
+
`_delete` (`confirm: true`) / `_checks` / `_run` / `_runs_list` / `_run_show`.
|
|
462
|
+
To make a sandbox read the branch's semantic model, publish to it with
|
|
463
|
+
`--semantic-branch <branch>`.
|
|
464
|
+
|
|
301
465
|
## Reading data while vibe-coding
|
|
302
466
|
|
|
303
467
|
You don't need an `X-API-Key` to poke at the data API by hand — your
|