{"at":"2026-11-23T02:03:55.996Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T02:03:56.766Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T02:03:56.916Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T02:03:57.759Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":true}},"instructions":"# Sapiom local authoring MCP\n\nThis package (`@sapiom/mcp`) is **the local authoring server**: the terminal surface for\nbuilding and managing your Sapiom projects. Agent Studio pre-wires it; in Claude Code,\nregister it with `claude mcp add sapiom -- npx -y @sapiom/mcp`. Today it drives\n**agent authoring, sandbox app previews, and durable app publishing** (more\ndev/management tools will land here over time). Agent authoring: build, test, and deploy a\nSapiom agent — a `defineAgent({ name, entry, steps })` (from `@sapiom/agent`) where each\nstep's `run(input, ctx)` does work and returns a directive. All from the terminal; no\ndashboard required.\n\n## Two ways to use Sapiom\nUse **the local authoring server** (this one) to **author agents** — the `sapiom_dev_agents_*`\ntools scaffold, typecheck, run with stubs, and deploy from a local checkout. For a **one-off\ncapability call** without an agent (a search, a scrape, one image), use **the hosted capability\nserver** at `https://api.sapiom.ai/v1/mcp`. Agent Studio pre-wires it too; in Claude Code,\nregister it with\n`claude mcp add --scope user --transport http sapiom-direct https://api.sapiom.ai/v1/mcp --header \"x-api-key: $SAPIOM_API_KEY\"`.\nIts runtime `tools/list` response is authoritative; use `tool_discover` to find a direct\n`sapiom_*` capability tool. The endpoint may also advertise implemented cloud workflow and\ngovernance tools, but the supported public authoring route is this local MCP or Agent Studio.\nRule of thumb: author an agent for anything multi-step, scheduled, or deployable; use the\nhosted capability server or the TypeScript SDK for a single action.\n\n## Lifecycle (in order)\n1. Start a project — `sapiom_dev_agents_scaffold` (a fresh starter) or `sapiom_dev_agents_clone`\n   (materialize a gallery template or an existing fork — the \"use this template\" handoff).\n   READ the project's `AGENTS.md` first, plus the `sapiom-agent-authoring` skill in\n   `.claude/skills/` where present (scaffolded projects include it; auto-loads in Claude Code).\n   Then `npm install`.\n2. Test locally: `npm run typecheck` → `sapiom_dev_agents_check` (bundles and imports the\n   definition, then validates its graph; top-level author code can execute) →\n   `sapiom_dev_agents_run_local` (Sapiom capabilities are stubbed with no Sapiom\n   capability spend; authored code and its ordinary side effects still execute).\n3. Before the first cloud action, call this server's `sapiom_authenticate` — the one alongside\n   the `sapiom_dev_agents_*` tools; the hosted server's same-named tool only describes the auth\n   flows. Browser login caches the shared credential required by link/deploy/run. Confirm with\n   this server's `sapiom_status`.\n4. Ship: `sapiom_dev_agents_link` → `_deploy` → `_run` (real cloud execution; costs\n   depend on the work performed) → `_inspect`.\n\n## Preview a web app\nFrom inside the project: `sapiom_dev_sandbox_configure` (writes the validated `sapiom.json`\nresource — source, start command, port, optional build/tier/ttl/env) →\n`sapiom_dev_sandbox_check` (optional) → `sapiom_dev_sandbox_preview` (uploads, builds, starts,\nand returns a live URL; a `failed` status carries the build/start logs — fix and retry).\n\nThat preview URL dies with its sandbox — the TTL expires and the link stops resolving. For a\nlink you can hand to someone, publish an **App Link**: a durable\n`https://apps.sapiom.ai/{org}/{slug}` that outlives every sandbox — a visit wakes the app\nfrom its stored bundle behind a \"Starting …\" page (cold start: tens of seconds). Durable\nsharing, not always-on hosting. From this project that is `sapiom_dev_app_publish` (slug +\nname only — it reads the same `sapiom.json` sandbox resource `_preview` uses, so source,\nstart, port, build and env are already set); it needs `@sapiom/mcp` >= 0.13, so if your\n`tools/list` does not offer it, upgrade or use the next line. Without a project on disk:\n`sapiom_app_publish` on the hosted capability server above, or\n`POST /v1/app-links` → `PUT …/bundle` → `POST …/publish`. Bundles are text-only UTF-8\nand self-contained; republishing the same slug replaces the app in place at the same URL.\nOrg-scoped by default; `public` needs an explicit confirmation and a daily spend cap because\nyour org pays for every wake. See https://docs.sapiom.ai/capabilities/app-links.\n\nAn App Link is a wake-on-visit **redirector, not a reverse proxy**: no sub-path is forwarded,\nso the app's own API lives at whichever preview URL is serving the app, never under the link.\nTo get that address, request the root WITHOUT following redirects — a WARM app answers 302 and\n`Location` is the address; a COLD one answers 200 with the \"Starting …\" page and starts a\nwake, and `{link}/__status` then polls to `{\"status\":\"ready\",\"url\":…}`. Do NOT make\n`__status` your FIRST call: with no wake in flight it starts one and answers `waking` with\nno url. Re-read the address per use rather than storing it — it changes when a wake recreates\nthe sandbox and, for an org-scoped app, carries a short-lived token that expires. The check on\nboth is the link's own, so an org-scoped app's API is browser-only: a logged-in member's\nsession, not an API key. A `public` app needs no session, but the daily spend cap it must\ncarry flips it back to `organization` permanently on the first breach (only an `org.write`\nrepublish with `confirmPublic` restores it), so a machine caller built on that route can stop\nworking with nothing republished.\n\nAn App Link can also receive webhooks. Webhooks are OFF by default on a link: turn on\n`webhooksEnabled` with `sapiom_dev_app_settings` and third parties POST to\n`https://apps.sapiom.ai/{org}/{slug}/hook/<path>`: the `/hook` prefix is stripped, the body is\nforwarded byte-exact so Slack/Stripe/GitHub signatures verify inside the app, and a request that\narrives while the app sleeps is held up to 60 s (then 504 while the wake continues, so the\nsender's retry lands warm). Keep the receiver fast: dispatch real work with `agents.launch`\n(below) and return. `_settings` also sets visibility, dailySpendCapUsd and\nwakeRateLimitPerHour; `sapiom_dev_app_list` shows every link; `sapiom_dev_app_delete` removes\none. All three need `@sapiom/mcp` >= 0.15 — on an older client use the dashboard App Links page\nor the REST routes: `GET /v1/app-links` to find the id, then `PATCH` / `DELETE\n/v1/app-links/{id}`. These settings need `org.write` — a credential without it gets the\npermission named in the tool's error; tell the user, do not retry. Two things to weigh before\nturning webhooks on: the hook accepts ANY method on ANY path under `/hook/` — the one case\nwhere a sub-path IS forwarded — with no caller auth at either visibility, and for an org-scoped\napp with no wake or spend cap either. Enable it only for an app whose own handler\nauthenticates the caller, and treat the URL as a secret.\n\n## Triggers (run a deployed agent without a human)\n`sapiom_dev_agents_schedule` creates a trigger of one of four kinds on a deployed agent:\n`schedule_cron` (recurring), `schedule_once` (one future time), `event` (fires whenever this\ntenant emits its `eventType` through the tenant events API), and `webhook` (fires whenever an\nexternal system POSTs to a public hook URL minted for the trigger). \"Run this agent when X POSTs\nto us\" is a `webhook` trigger, not a hand-built HTTP server: the create result carries the hook\nURL, a shown-once secret, and the exact signing recipe — HMAC-SHA256 hex over\n`timestamp.eventId.rawBody` (epoch-ms timestamp, url-safe event id `[A-Za-z0-9_-]{1,128}`,\n±5 min skew), sent as `X-Sapiom-Timestamp` / `X-Sapiom-Event-Id` / `X-Sapiom-Signature`.\nOnly a sender you control can sign that way; Slack, Meta, Stripe and GitHub sign with their own\nschemes and cannot produce our HMAC, so route those to an App Link `/hook/*` receiver\n(`webhooksEnabled`) that verifies their signature, or through a small translator that re-signs\ninto a webhook trigger.\n`_schedule_inspect` / `_schedule_cancel` cover every kind; `sapiom_dev_agents_schedule_secret`\nrotates or revokes a webhook secret. The `event` and `webhook` kinds and the secret tool need\n`@sapiom/mcp` >= 0.15 — on an older client, use the REST trigger routes in the guide:\nhttps://docs.sapiom.ai/guides/triggers.\n\n## Canonical rules (types are the source of truth — run `npm run typecheck`)\n- Import `defineAgent`, `defineStep`, and the directives\n  (`goto` / `terminate` / `fail` / `retry` / `pauseUntilSignal`) from `@sapiom/agent`.\n  Import Zod from `zod/v4`.\n- `terminate()` requires `terminal: true`; `fail()` requires `canFail: true`;\n  `pauseUntilSignal(handle, …)` requires `pause: { signal, resumeStep }`; every `goto`\n  target must be listed in `next[]`. TypeScript enforces all of these.\n- The entry step's `inputSchema` is the agent's public API — the dashboard Run form,\n  the trigger snippet, and engine-side validation all read it. Declare it with zod\n  (`zod/v4`); give fields `.default()` so a zero-input run still validates.\n- Cross-step state: `ctx.shared` — the entry input reaches only the entry step.\n- Capabilities run via the typed `ctx.sapiom.*` client (sandboxes, repositories,\n  models.coding, fileStorage, search, database, email, domains, memory, and more) —\n  don't memorize the catalog; use autocomplete/typecheck. Schedules (cron triggers) are\n  a top-level `@sapiom/tools` import, not under `ctx.sapiom`.\n- A Sapiom Postgres (`ctx.sapiom.database.create`) is permanent: it lives until you delete\n  it, holds one slot of your plan's database limit while held, and never expires — there is\n  no lifetime to pick and no `duration` to pass.\n\n## Secrets, inbound events, receipts\n- **Secrets** set in the dashboard per deployed agent reach a step only as env vars\n  (`process.env.SLACK_BOT_TOKEN`); their Vault ref is derived server-side, so step code cannot\n  name it. `ctx.sapiom.vault.get(ref, key)` is for tenant secrets stored under your own ref\n  (e.g. `vault.get(\"slack\", \"bot_token\")`) and returns `null` when absent — agent code cannot write\n  the Vault. Never route a Sapiom-managed resource's credentials (a repository, a sandbox, a\n  provisioned service) through Vault: use the handle the capability returned.\n- **Receipts and replay:** every inbound event or webhook leaves a receipt, matched or\n  unmatched, and a failed fire can be replayed by hand (never automatically). No tool yet —\n  use the REST surface: `GET /v1/workflows/receipts?outcome=unmatched`,\n  `GET /v1/workflows/receipts/{id}` (the chain it started),\n  `POST /v1/workflows/receipts/{id}/replay` (re-match an unmatched event against today's\n  triggers), `POST /v1/workflows/fires/{id}/replay` (re-drive a failed or stranded fire;\n  `{\"rerun\":true}` to repeat one that succeeded).\n\n## Calling LLMs and running agent loops (from agent code)\n- **One LLM call → `ctx.sapiom.llm.run`** — summarize, extract, classify, one-shot generate.\n  For a plain-text reply, read only `type === 'text'` content blocks (a `thinking` block\n  may be present). For structured/JSON output, use the `output` param — it forces a tool\n  call under the hood, so the payload is always the `tool_use` block's `input` — never\n  \"reply with only JSON\" + string parsing.\n- **Platform-driven agent loop → `ctx.sapiom.models.run`** — a multi-turn reasoning +\n  tool-calling task (minutes, not seconds). `models.coding.run` for sandboxed coding tasks.\n  Never use this for a one-shot completion — it will loop and overthink.\n- **Dispatch a deployed agent by slug → `ctx.sapiom.agents.run`** — compose systems from\n  small deployed agents rather than one large monolith. `agents.run` waits for the terminal\n  state; **`ctx.sapiom.agents.launch`** takes the same spec and returns a handle at once\n  (fire-and-forget). Use `launch` from anything that must return fast — a webhook receiver —\n  or with `pauseUntilSignal(handle, …)` for a long-running child.\n- **You never pick a model.** The platform picks it. `llm.run`/`models.run` report the\n  served class and lane on the result (absent on older servers — treat missing as unknown);\n  `models.coding.run` reports both as `null` today.\n  **Omit `model` entirely (recommended)** — the platform routes it. Raw provider model ids\n  are never honored.\n- **Debugging a run:** open the Run Inspector, or fetch a step's full input/output via\n  the per-step endpoint documented in the guide.\n\nFull reference: https://docs.sapiom.ai/agents/quick-start,\nhttps://docs.sapiom.ai/agents/authoring, and\nhttps://docs.sapiom.ai/guides/connect-claude-code-with-mcp, plus the `AGENTS.md` and\n`sapiom-agent-authoring` skill inside\nyour scaffolded project.","protocolVersion":"2025-11-25","serverInfo":{"description":"The local Sapiom developer MCP (sapiom_dev_*). Scaffold, check, and run with stubbed capabilities locally; authenticated deploys and production runs use Sapiom cloud. It is not the hosted direct-capability MCP.","name":"sapiom-dev","title":"Sapiom Dev — local developer tools","version":"0.1.0"}}}}
{"at":"2026-11-23T02:03:57.759Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T02:03:57.759Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T02:03:57.766Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Authenticate this local Sapiom developer MCP (sapiom-dev) by opening a browser login flow. Run this when a networked agent tool (link/deploy/run/inspect/signal) reports that authentication is required.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"sapiom_authenticate"},{"description":"Check authentication status for this local Sapiom developer MCP (sapiom-dev). Returns whether you're authenticated and which organization.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"sapiom_status"},{"description":"Log out of Sapiom by removing cached credentials for the current environment.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"sapiom_logout"},{"description":"Scaffold a new Sapiom agent project into <dir>. Produces a TypeScript project with a starter agent in index.ts and its dependencies installed (best-effort; if the install was skipped offline, run `npm install` in <dir>). After scaffolding, the author writes step definitions and uses sapiom_dev_agents_run_local to test them.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"dir":{"description":"Target directory for the new project (created if absent; must otherwise be empty, except for Agent Studio's private .sapiom directory).","minLength":1,"type":"string"},"template":{"description":"Template name. 'default' (a minimal two-step starter) or 'coding-pause' (the launch + pauseUntilSignal + resume pattern for a non-blocking coding-agent run). Defaults to 'default'.","type":"string"}},"required":["dir"],"type":"object"},"name":"sapiom_dev_agents_scaffold"},{"description":"Validate an agent locally: typecheck, bundle and import index.ts, derive the manifest, and check the step graph. Needs no Sapiom account or service call to validate; author-written top-level side effects still run when the definition is imported. Returns the agent name, step count, the manifest (which contains the full step graph for visualization), and any warnings — graph warnings, plus one per project file (AGENTS.md, the sapiom-agent-authoring skill) whose platform-rules stamp differs from the copy the Sapiom API currently serves, from a best-effort anonymous read of that endpoint's headers (skipped when the project carries no stamp, silent when unreachable).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"}},"type":"object"},"name":"sapiom_dev_agents_check"},{"description":"Execute an agent on the local machine, running the author's actual step code with every ctx.sapiom.* capability call resolved from stubs (no Sapiom account, capability request, or capability spend). Author code is ordinary local code: its own filesystem, process, environment, and network effects remain real.\nReturns { outcome, output, steps[], unusedStubs[], stubWarnings[] }. outcome is 'completed' | 'failed' | 'paused' | 'running'. A paused dispatch (e.g. models.coding.launch) is auto-resumed locally with its stub result, so the happy path runs end-to-end.\nReturns `unusedStubs` (supplied stub keys that matched no call — a typo or wrong path form) and `stubWarnings` (a stub key matched but its value was the wrong shape for the capability). Check both: a green run with a non-empty unusedStubs/stubWarnings usually means your stub didn't take effect.\nStub shape: { version: 1, steps: { <stepName>: { <methodPath>: <response> } } }. The response is the value that call returns verbatim — e.g. `repositories.list` takes the array list() should return ([{ slug, cloneUrl }]), not a wrapped/sequence form. For a dispatched run, stub `models.coding.run` (or `models.coding.launch`) in the step that launches it; that value becomes both the run result and the payload the paused step resumes with — set status:'failed' there to exercise the failure branch.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"},"input":{"description":"The agent's entry-step input (any JSON value)."},"maxAttemptsPerStep":{"description":"Retry cap per step (default 3).","exclusiveMinimum":0,"type":"integer"},"stubs":{"description":"Stub file object: { version, steps: { <step>: { <method.path>: <response> } } }. Each response is returned verbatim; an array is the actual response only for a list-returning method, not a sequence of responses."}},"type":"object"},"name":"sapiom_dev_agents_run_local"},{"description":"Resolve a hosted agent by name (or create it with create:true) and cache its id in the project's sapiom.json. Run this before deploy.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"create":{"description":"Create the agent if it does not exist.","type":"boolean"},"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"},"name":{"description":"Agent name (matches defineAgent({ name })). Defaults to the agent's name read from index.ts.","type":"string"}},"type":"object"},"name":"sapiom_dev_agents_link"},{"description":"Materialize a Sapiom agent locally. Given a template id (from the gallery) it forks the template into a repo you own; given an existing fork id it re-clones that fork; given a deployed agent's definitionId it clones the engine's live build-repo source directly (no fork step, always current) and pre-links the checkout. Either way it mints a short-lived, repo-scoped clone credential, git-clones the repo into <dir>, and writes sapiom.json recording the provenance.\nAfter cloning: read the project's AGENTS.md, install its dependencies, then _check → _run_local. Before cloud work, authenticate and run _link → _deploy → _run → _inspect. A templateId/forkId clone is source only and has no dashboard agent until link/deploy; a definitionId clone is already linked because sapiom.json contains its definitionId.\nPass exactly one of templateId, forkId, or definitionId. The clone credential is single-repo, read-only, and ~1h-lived — it is used for the clone and discarded (never stored in sapiom.json).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"definitionId":{"description":"Deployed agent's definition id to pull local (e.g. from the dashboard URL or a prior link/deploy). Clones the engine's current build-repo source directly, skipping the fork step, and pre-links the checkout (sapiom.json is written with this id, so sapiom_dev_agents_link is not needed before deploy). Accepts a number or string — the engine id is a bigint. Mutually exclusive with templateId and forkId.","type":["string","number"]},"dir":{"description":"Target directory to clone into (created if absent; must otherwise be empty, except for Agent Studio's private .sapiom directory).","minLength":1,"type":"string"},"forkId":{"description":"Existing fork id to clone (skips the fork step). Mutually exclusive with templateId and definitionId.","type":"string"},"templateId":{"description":"Registry template id to fork then clone (e.g. 'web-research-digest'). Mutually exclusive with forkId and definitionId.","type":"string"}},"required":["dir"],"type":"object"},"name":"sapiom_dev_agents_clone"},{"description":"Deploy the linked agent: bundle the current local source (including uncommitted source), push a synthesized build tree, trigger a metered cloud build, and wait for it to finish. The project must be linked (sapiom.json) and a git repo with at least one commit.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"branch":{"description":"Branch to push to (default 'main').","type":"string"},"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"}},"type":"object"},"name":"sapiom_dev_agents_deploy"},{"description":"Start a real (cloud) execution of the linked agent. Use sapiom_dev_agents_inspect to follow it.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"},"input":{"description":"The agent's entry-step input (any JSON value)."}},"type":"object"},"name":"sapiom_dev_agents_run"},{"description":"Inspect a cloud execution (its steps and errors) by executionId, a build by buildRunId, or list recent executions when neither is given. On a failed step, pull its input here to reproduce the failure locally with run_local. When inspecting an execution, the result includes a `webappUrl` to open that run in the webapp.\n\nBy default the execution is returned COMPACT: identity/status/timestamps + a per-step summary (name/order/attempt/status/error-message) with a `has` flag-set and a `sizes` hint (char counts of the omitted input/output/logs/events/sharedState bodies). Full step bodies are NOT included by default — they can be multiple MB. To pull a specific step's heavy fields, pass `step` (its name or order, from the compact list) with `include` (e.g. ['input','error']); optionally narrow to one `attempt`. Debug loop: inspect(executionId) → see step N failed → inspect(executionId, step:'<name>', include:['input','error']) → feed that input to run_local. Every field is capped to a char budget; an over-budget value is truncated with a marker pointing at `webappUrl`.\n\nReads are a fresh point-in-time snapshot. To wait for a still-running execution to finish, set wait:true (the tool polls until it settles or the wait window elapses) — do NOT sleep-and-poll this tool yourself. If a wait returns waiting:true, just call inspect again with wait:true.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"attempt":{"description":"Restrict expansion to a single attempt of the selected `step` (a retried step has several). Omit to expand every attempt of that step.","type":"integer"},"buildRunId":{"description":"Build to inspect (requires a linked project).","type":"string"},"dir":{"description":"Project directory (for build inspection, which needs the linked id).","type":"string"},"executionId":{"description":"Execution to inspect.","pattern":"^\\d+$","type":"string"},"include":{"description":"Heavy step fields to expand for the selected `step`: 'input' | 'output' | 'logs' | 'events' | 'sharedState' | 'error'. Ignored without `step`. Each is capped to the char budget.","items":{"enum":["input","output","logs","events","sharedState","error"],"type":"string"},"type":"array"},"maxWaitSeconds":{"description":"Max seconds to wait when wait:true (default 45, capped at 55). On timeout it returns the latest snapshot with waiting:true — call again to keep waiting.","type":"number"},"step":{"description":"Expand one step's heavy fields: its stepName or stepOrder (from the compact step list). Pair with `include` to choose which fields.","type":["string","number"]},"wait":{"description":"When inspecting an executionId, block until it reaches a terminal state (or settles on a pause needing a signal) instead of returning the current snapshot. Lets the tool own the polling so you don't have to.","type":"boolean"}},"type":"object"},"name":"sapiom_dev_agents_inspect"},{"description":"Resume a paused cloud execution by delivering a named signal (matched by name + correlationId, NOT by executionId — so one call resumes every run waiting on that pair). Signals resume; they never start a run — to start one, emit an event with sapiom_dev_agents_emit_event. Read `message` in the result whenever it is present: `matched` counts the runs that actually resumed, so it under-reports a partial fanout and a 0 does not prove nothing was waiting.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"correlationId":{"description":"Signal correlation id.","type":"string"},"executionId":{"description":"A paused execution, as the addressable resource. Delivery is matched on name + correlationId, so this need not be the only run that resumes.","pattern":"^\\d+$","type":"string"},"name":{"description":"Signal name to deliver.","type":"string"},"payload":{"description":"Signal payload (any JSON value)."}},"required":["executionId","name","correlationId"],"type":"object"},"name":"sapiom_dev_agents_signal"},{"description":"Emit one custom event for this tenant. It fans out by type to every active 'event' trigger the tenant armed and starts 0..N NEW runs; it never resumes a paused run (use sapiom_dev_agents_signal for that). Events start, signals resume. Returns { receiptId, outcome: 'matched' | 'unmatched', duplicate, fireIds }: 'unmatched' is a success, not an error — it means nothing subscribes to this type, so check it for a typo or arm a trigger with sapiom_dev_agents_schedule (kind 'event'). `fireIds` are trigger fires, not execution ids; read the receipt to get from a fire to the run it started. Pass id to make a retry safe.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"id":{"description":"Your id for THIS delivery (1..256 chars). Reposting the same id returns the original receipt and starts nothing new. Omit it and every call is a distinct event.","type":"string"},"payload":{"description":"Event data, as a JSON object. It becomes the top layer of the run input, folded over each matched trigger's configured input (the payload wins on a key conflict). Keys the target agent's entry step does not declare are NOT dropped for agents built with @sapiom/agent (buildManifest strips the marker the engine's filter keys off), so they reach the run input and the author's own parse decides: a z.object() entry ignores them, a z.strictObject() entry rejects them and the step fails. Match the entry schema when you can. Omit it for an event that carries no data."},"type":{"description":"What happened — the type the triggers match on. Lowercase dot-separated segments, e.g. 'lead.created'; the 'sapiom.*' namespace is reserved.","type":"string"}},"required":["type"],"type":"object"},"name":"sapiom_dev_agents_emit_event"},{"description":"Create a trigger for a deployed agent — one of four kinds. 'schedule_cron' (+ cron, optional timezone) runs it on a recurring schedule; 'schedule_once' (+ at) runs it once at a future time; 'event' (+ eventType) runs it every time this tenant emits that event type via POST /v1/workflows/events; 'webhook' runs it every time an external system POSTs to a public hook URL — the result returns that URL plus a shown-once signing secret and the HMAC-SHA256 scheme the sender must use. Use 'webhook' when an external system should start the agent (\"run when X POSTs to us\") instead of hand-building an HTTP server; third-party senders with their own signature scheme (Slack, Meta, Stripe, GitHub) cannot produce our HMAC, so route those through an App Link /hook/* receiver or a translator. Returns the trigger with its next fire time where it has one. Tip: validate a cron with sapiom_dev_agents_cron_preview first.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"at":{"description":"ISO 8601 fire time — required for 'schedule_once'. E.g. '2026-07-01T17:00:00Z'.","type":"string"},"cron":{"description":"Cron expression — required for 'schedule_cron'. E.g. '0 9 * * 1-5' = 9am on weekdays.","type":"string"},"definition":{"description":"The agent's tenant-unique slug (the handle it was deployed under).","type":"string"},"endAt":{"description":"Cron only: ISO time after which the schedule completes.","type":"string"},"eventType":{"description":"Event type to match — required for 'event'. Lowercase dot-separated segments, e.g. 'lead.created'; the 'sapiom.*' namespace is reserved. Emit it with sapiom_dev_agents_emit_event, or POST /v1/workflows/events { type, payload }.","type":"string"},"input":{"description":"Execution input passed to each run (any JSON value). For 'event' and 'webhook' the inbound payload is folded over this (payload wins on key conflicts)."},"kind":{"description":"'schedule_cron' = recurring; 'schedule_once' = a single delayed run; 'event' = fires on a tenant-emitted event type; 'webhook' = fires on a signed POST to a public URL minted for this trigger.","enum":["schedule_cron","schedule_once","event","webhook"],"type":"string"},"policy":{"description":"Cron only: { catchupPolicy?: 'skip'|'all', overlapPolicy?: 'allow', jitterMs?: number }."},"startAt":{"description":"Cron only: ISO time before which no occurrence fires.","type":"string"},"timezone":{"description":"IANA timezone the cron runs in (e.g. 'America/New_York'). Defaults to UTC.","type":"string"}},"required":["definition","kind"],"type":"object"},"name":"sapiom_dev_agents_schedule"},{"description":"Inspect triggers of any kind (cron, one-off, event, webhook). With scheduleId: returns one trigger's config, next fire time (schedules), eventType (event), publicId / secretVersion / graceUntil / revokedAt (webhook — never the secret, which is shown only at create/rotate), and recent fire history (each with the run's executionId, and the inbound receiptId for event/webhook fires) — use this to debug a misbehaving trigger, then inspect a failed run's executionId with sapiom_dev_agents_inspect. With definition (slug) and no scheduleId: lists that agent's triggers.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"definition":{"description":"List triggers for this agent slug (used when scheduleId is omitted).","type":"string"},"scheduleId":{"description":"Inspect one trigger (detail + recent fires + a health hint).","type":"string"},"status":{"description":"Filter the list by status.","enum":["active","paused","completed","disabled"],"type":"string"}},"type":"object"},"name":"sapiom_dev_agents_schedule_inspect"},{"description":"Cancel a trigger of any kind by id. Stops all future fires: a recurring schedule won't re-arm, a pending one-off won't run, an event trigger stops matching, a webhook stops accepting POSTs (401 from then on). Irreversible — recreate to re-arm (a recreated webhook gets a new URL + secret). For a webhook whose secret leaked but whose URL should keep working, rotate with sapiom_dev_agents_schedule_secret instead.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"scheduleId":{"description":"The trigger to cancel.","type":"string"}},"required":["scheduleId"],"type":"object"},"name":"sapiom_dev_agents_schedule_cancel"},{"description":"Webhook-trigger secret lifecycle. 'rotate' = planned hygiene: mints a new secret (returned ONCE, with the hook URL beside it so the sender can be reconfigured in one step) while the previous secret keeps verifying for a 24h grace. 'complete_rotation' = the sender has moved; end the grace now so the old secret stops verifying immediately. 'revoke' = compromise: the hook rejects every request from now on and any open grace dies with it — irreversible, create a new webhook trigger to hand the sender a fresh URL + secret. Only valid on kind 'webhook'.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"action":{"description":"'rotate' (new secret, old one verifies for 24h) | 'complete_rotation' (end that grace now) | 'revoke' (kill the hook).","enum":["rotate","complete_rotation","revoke"],"type":"string"},"scheduleId":{"description":"The webhook trigger.","type":"string"}},"required":["scheduleId","action"],"type":"object"},"name":"sapiom_dev_agents_schedule_secret"},{"description":"Validate a cron expression and preview its next occurrences, creating nothing. Use before sapiom_dev_agents_schedule to confirm a cron + timezone fire when you expect (cron syntax is easy to get subtly wrong).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"count":{"description":"How many upcoming occurrences to return (default 5).","type":"number"},"cron":{"description":"Cron expression to validate, e.g. '0 9 * * 1-5'.","type":"string"},"timezone":{"description":"IANA timezone (default UTC).","type":"string"}},"required":["cron"],"type":"object"},"name":"sapiom_dev_agents_cron_preview"},{"description":"Create or update a sandbox preview resource in the project's sapiom.json. Fill the typed arguments instead of hand-writing JSON — the config is validated and written under resources.<name> (type: \"sandbox\"). Returns the stored config. Use sapiom_dev_sandbox_preview afterwards to deploy it.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"build":{"type":"string"},"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"},"env":{"additionalProperties":{"type":"string"},"type":"object"},"name":{"description":"Resource name — the sapiom.json `resources` key and the sandbox name (e.g. `web`).","type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"source":{"anyOf":[{"additionalProperties":false,"properties":{"kind":{"const":"upload","type":"string"},"path":{"type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"git","type":"string"},"path":{"type":"string"},"slug":{"minLength":1,"type":"string"}},"required":["kind","slug"],"type":"object"}]},"start":{"minLength":1,"type":"string"},"tier":{"enum":["xs","s","m","l","xl"],"type":"string"},"ttl":{"type":"string"}},"required":["name","source","start","port"],"type":"object"},"name":"sapiom_dev_sandbox_configure"},{"description":"Validate the sandbox preview resources in the project's sapiom.json without deploying. Returns { ok, sandboxes, issues }; `issues` lists actionable validation problems to fix before previewing.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"}},"type":"object"},"name":"sapiom_dev_sandbox_check"},{"description":"Deploy a web-app preview from the current project to a Sapiom sandbox and get a live URL. Reads sapiom.json (a `type: \"sandbox\"` resource), provisions the sandbox if needed, uploads the local code, builds, starts, and exposes a public URL. Returns { name, url, status, logs }. A `failed` status carries build/start logs (not an error) so you can fix and retry. The URL is TEMPORARY — it expires with the sandbox's `ttl`. For a link that is permanent, shareable, or meant for a teammate, use sapiom_dev_app_publish instead.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"dir":{"description":"Project directory (defaults to the current working directory).","type":"string"},"name":{"description":"Which sandbox to deploy, when the project defines more than one.","type":"string"}},"type":"object"},"name":"sapiom_dev_sandbox_preview"},{"description":"Publish this project's web app to a DURABLE Sapiom link: https://apps.sapiom.ai/{org}/{slug}. Use this — not sapiom_dev_sandbox_preview — whenever the user wants a link that is permanent, shareable, or safe to hand to a teammate: a sandbox preview URL expires with the sandbox's ttl, an App Link does not. Reads the same sapiom.json `type: \"sandbox\"` resource (source dir, start, port, optional build/env), uploads the source as a stored bundle, and activates it. Nothing runs until someone visits: the first visit after a publish cold-starts the app (tens of seconds behind a \"Starting…\" page), so this is wake-on-demand hosting, not always-on. Org-scoped by default (only logged-in members of your organization can open it); visibility \"public\" needs confirmPublic: true and a dailySpendCapUsd because your org pays for every wake. Publishing the same slug again replaces the app in place at the SAME URL — that is how you ship an update. The link is a wake-on-visit REDIRECTOR, not a reverse proxy: its root answers a 302 to whichever preview URL is currently serving the app and sub-paths are NOT proxied, so the app's own API lives at that preview URL, never under the link. Read it off the redirect (or from `url` in GET {link}/__status) and re-resolve it per use — it changes when a wake recreates the sandbox and, for an org-scoped app, carries a short-lived token that expires. Both routes run the link's OWN access check — for an org-scoped app that means a logged-in member's browser session, NOT an API key, so its API is browser-only. A public app's link and `/__status` need no session at all, so for machine callers publish the app as `public`, or receive traffic on `/hook/…`, which needs `webhooksEnabled` on the link (off by default, not settable here — REST only). Bundles are TEXT-ONLY (UTF-8 files; no images, fonts, or archives) and capped at 10 MiB; node_modules, .git, dotfiles, symlinks and the project's own sapiom.json are never uploaded — install dependencies at wake via `build`. Both limits are checked locally, so a bad bundle costs no upload. Returns { url, appLinkId, bundleSha256, manifest }.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"confirmPublic":{"description":"Required with visibility \"public\": acknowledges that anyone with the link can wake the app and your org pays for it. Ask the user before setting it.","type":"boolean"},"dailySpendCapUsd":{"description":"Daily spend ceiling for a public app, as a decimal USD string (e.g. \"5.00\"). Required with visibility \"public\".","pattern":"^\\d{1,10}(\\.\\d{1,2})?$","type":"string"},"description":{"description":"Optional description of the app.","maxLength":2000,"type":"string"},"dir":{"description":"Project directory containing sapiom.json (defaults to the current working directory).","type":"string"},"name":{"description":"Human-readable app name, shown on the \"Starting …\" page while it wakes.","maxLength":255,"minLength":1,"type":"string"},"resource":{"description":"Which sapiom.json sandbox resource to publish, when the project defines more than one. Omit when there is exactly one.","type":"string"},"slug":{"description":"URL path segment, unique within your organization — the stable identity of the app. Republishing the same slug updates the same URL in place.","pattern":"^[a-z0-9][a-z0-9-]{0,62}$","type":"string"},"visibility":{"description":"\"organization\" (default: members only) or \"public\" (anyone with the link; requires confirmPublic and dailySpendCapUsd).","enum":["organization","public"],"type":"string"}},"required":["slug","name"],"type":"object"},"name":"sapiom_dev_app_publish"},{"description":"List your organization's App Links (durable https://apps.sapiom.ai/{org}/{slug} apps published with sapiom_dev_app_publish): slug, URL, visibility, whether webhooks are on and the /hook URL when they are, daily spend cap, wake rate limit, wake status. Use it to find a link before sapiom_dev_app_settings or sapiom_dev_app_delete, or to answer \"what have we published?\". Read-only; needs org.read.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"sapiom_dev_app_list"},{"description":"Change how a published App Link is exposed: turn webhooks on or off (webhooksEnabled), change visibility, set or clear the daily spend cap, set the wake rate limit. Webhooks are OFF by default on every link; once on, third parties POST to https://apps.sapiom.ai/{org}/{slug}/hook/<path> — the /hook prefix is stripped and the body forwarded byte-exact, so Slack/Stripe/GitHub signature checks run inside the app. Address the link by slug or appLinkId and send only the fields to change. These settings need the org.write permission (sapiom_dev_app_publish's publish authority is not enough): when the credential lacks it the error names the permission and the fields — tell the user, do not retry. Setting visibility to public needs confirmPublic: true and a dailySpendCapUsd; ask the user first. Returns { url, webhookUrl, settings, changed }.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"appLinkId":{"description":"The app link's id, as returned by sapiom_dev_app_publish — one direct lookup instead of the list. Give this OR slug.","format":"uuid","type":"string"},"confirmPublic":{"description":"Required with visibility \"public\": acknowledges that anyone with the link can wake the app and your org pays for it. Ask the user before setting it.","type":"boolean"},"dailySpendCapUsd":{"anyOf":[{"pattern":"^\\d{1,10}(\\.\\d{1,2})?$","type":"string"},{"type":"null"}],"description":"Daily spend ceiling as a decimal USD string (e.g. \"5.00\"), or null to clear it. A public link cannot have its cap cleared."},"slug":{"description":"The app link's slug — the URL path segment you published it under. Resolved through the list route. Give this OR appLinkId.","pattern":"^[a-z0-9][a-z0-9-]{0,62}$","type":"string"},"visibility":{"description":"\"organization\" (members only) or \"public\" (anyone with the link; requires confirmPublic and a dailySpendCapUsd because your org pays for every wake).","enum":["organization","public"],"type":"string"},"wakeRateLimitPerHour":{"description":"Maximum wakes per hour (cold starts the org will pay for).","minimum":1,"type":"integer"},"webhooksEnabled":{"description":"true to accept third-party webhooks at {url}/hook/<path>; false to stop. Off by default.","type":"boolean"}},"type":"object"},"name":"sapiom_dev_app_settings"},{"description":"Delete a published App Link. The https://apps.sapiom.ai/{org}/{slug} URL stops resolving (anyone holding it gets a 404), any webhook receiver at its /hook path stops answering, and the slug is freed for reuse. Address the link by slug or appLinkId. This is destructive: ask the user before calling it, then pass confirm: true. Needs the org.write permission; when the credential lacks it the error names the permission — tell the user, do not retry.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"appLinkId":{"description":"The app link's id, as returned by sapiom_dev_app_publish — one direct lookup instead of the list. Give this OR slug.","format":"uuid","type":"string"},"confirm":{"description":"Must be true. Acknowledges the URL goes down and the slug is freed. Ask the user first.","type":"boolean"},"slug":{"description":"The app link's slug — the URL path segment you published it under. Resolved through the list route. Give this OR appLinkId.","pattern":"^[a-z0-9][a-z0-9-]{0,62}$","type":"string"}},"required":["confirm"],"type":"object"},"name":"sapiom_dev_app_delete"},{"description":"Send the user's feedback about Sapiom — a bug, a rough edge, a feature request, or praise — to the Sapiom team. Reach for this when the user says something like \"this is broken\", \"tell Sapiom\", \"file feedback\", or \"this should work differently\": confirm the wording with them, then send their words as `message`. NEVER put file contents, code snippets, logs, stack traces, environment variables, API keys, or any other secret in `message` or `context` — both fields are plain prose only. Package version, platform, environment, and timestamp are attached automatically; do not restate them.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"context":{"description":"Optional one- or two-sentence plain-language summary of what the user was doing when the feedback came up (e.g. \"deploying an agent after run_local passed\"). Never include file contents, code snippets, logs, stack traces, environment variables, API keys, or tokens.","type":"string"},"message":{"description":"The user's feedback in their own words: what's wrong, what they expected, or what they want. Plain language only — no code, logs, stack traces, or secrets.","minLength":1,"type":"string"}},"required":["message"],"type":"object"},"name":"sapiom_send_feedback"},{"description":"The agent map: which agents call, launch, schedule or trigger each other, grouped into systems, with every agent's steps. Computed from code each call; nothing about agents or edges is stored. Pass `root` (a project folder; default the working directory) and optionally a git `ref` to draw that version, or pass `agents` to map your own description without scanning. Systems are connected components over code-proven calls, events, signals and timers; shared vault keys, databases and connectors show as `shared` chips and never join agents. Every edge carries the code location that proves it; calls whose target the code does not make knowable are listed under `unresolved`. When signed in, platform triggers and deploy state come from the account, and Jev labels an agent's `role` and a launch or event edge's `label` where its probability `p` is at least 0.8 (`labels: \"ok\"`; signed out or Jev unreachable: `labels: \"unavailable\"`, the map otherwise unchanged). Set `platform: false` to skip both.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"agents":{"description":"Map this description instead of scanning: [{ slug, calls?: [{ to, kind }], emits?, triggers?, steps?, resources? }].","items":{"additionalProperties":false,"properties":{"calls":{"items":{"additionalProperties":false,"properties":{"evidence":{"items":{"additionalProperties":false,"properties":{"file":{"type":"string"},"line":{"exclusiveMinimum":0,"type":"integer"},"step":{"type":"string"},"text":{"type":"string"}},"required":["file","line","text"],"type":"object"},"type":"array"},"kind":{"enum":["launch","signal","timer"],"type":"string"},"to":{"minLength":1,"type":"string"}},"required":["to","kind"],"type":"object"},"type":"array"},"deployed":{"type":["boolean","null"]},"description":{"type":"string"},"emits":{"items":{"additionalProperties":false,"properties":{"eventType":{"minLength":1,"type":"string"},"evidence":{"items":{"$ref":"#/properties/agents/items/properties/calls/items/properties/evidence/items"},"type":"array"}},"required":["eventType"],"type":"object"},"type":"array"},"path":{"type":"string"},"resources":{"items":{"minLength":1,"type":"string"},"type":"array"},"slug":{"minLength":1,"type":"string"},"steps":{"additionalProperties":false,"properties":{"entry":{"type":"string"},"steps":{"items":{"additionalProperties":false,"properties":{"file":{"type":"string"},"id":{"type":"string"},"line":{"type":"integer"}},"required":["id"],"type":"object"},"type":"array"},"transitions":{"items":{"additionalProperties":false,"properties":{"from":{"type":"string"},"kind":{"type":"string"},"to":{"type":"string"}},"required":["from","to","kind"],"type":"object"},"type":"array"}},"required":["entry","steps","transitions"],"type":"object"},"triggers":{"items":{"anyOf":[{"additionalProperties":false,"properties":{"eventType":{"minLength":1,"type":"string"},"evidence":{"items":{"$ref":"#/properties/agents/items/properties/calls/items/properties/evidence/items"},"type":"array"},"kind":{"const":"event","type":"string"},"source":{"default":"code","enum":["code","platform"],"type":"string"}},"required":["kind","eventType"],"type":"object"},{"additionalProperties":false,"properties":{"cron":{"type":"string"},"evidence":{"items":{"$ref":"#/properties/agents/items/properties/calls/items/properties/evidence/items"},"type":"array"},"kind":{"const":"schedule","type":"string"},"source":{"default":"code","enum":["code","platform"],"type":"string"}},"required":["kind"],"type":"object"}]},"type":"array"}},"required":["slug"],"type":"object"},"type":"array"},"platform":{"description":"Read triggers and deploy state from the signed-in account and ask Jev for labels (default true).","type":"boolean"},"ref":{"description":"A git ref (HEAD, a branch, a commit) to draw instead of the working copy. Only inside a git repository.","type":"string"},"root":{"description":"Project folder to scan. Default: the working directory.","type":"string"}},"type":"object"},"name":"sapiom_dev_map"}]}}}
