Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions skills/runtype-admin/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
name: runtype-admin
description: 'Inspect, debug, or manage a live Runtype account through MCP or CLI; mutate only within the requested scope.'
user-invocable: true
argument-hint: '[live account operation or debugging task]'
---

# Runtype Admin
Expand All @@ -15,12 +13,12 @@ workspace unless you run it against a disposable test account.
Runtype has two hosted MCP servers. Both accept browser sign-in on the first call, or a
Runtype API key sent as `Authorization: Bearer <key>`.

| Server | URL | Tools |
| ------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Standard MCP | `https://api.runtype.com/v1/mcp/protocol` | One named tool per operation, such as `get_me`, `list_agents`, and `list_runs` |
| Code Mode MCP | `https://code.runtype.com/mcp` | `search`, `execute`, `get_platform_documentation`, `search_documentation`, `get_build_instructions`, `generate_persona_embed_code`, `get_persona_theme_reference` |
| Server | URL | Tools |
| ------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Standard MCP | `https://api.runtype.com/v1/mcp/protocol` | One named tool per operation, such as `get_me`, `list_agents`, and `list_runs` |
| Code Mode MCP | `https://code.runtype.com/mcp` | `search`, `execute`, `get_platform_documentation`, `search_documentation`, `get_build_instructions`, `generate_persona_embed_code`, `get_persona_theme_reference`, `submit_feedback` |

To check which server is connected, look at the tool list. Code Mode lists only the seven
To check which server is connected, look at the tool list. Code Mode lists only the eight
tools in the table. Call `get_me` (on Code Mode, `execute` with
`async (runtype) => runtype.getMe()`) to confirm the organization before you change anything.

Expand Down Expand Up @@ -67,6 +65,10 @@ Discover before you act:

Surfaces belong to a product. List or change them with the product ID in hand.

When the server lists `delegate_to_runtype`, delegate debugging that needs trace, fix,
and verify, and audits that page across many entities: the digest keeps large payloads
out of your context. Single lookups and edits to a known id are faster as direct calls.

Use `list_model_configs` to see which models the account can run. `list_available_models`
is the platform catalog: its `isEnabled` and `isDefault` fields are always null or false,
so it cannot tell you whether a model is enabled.
Expand Down Expand Up @@ -217,9 +219,17 @@ permission is missing, or request a new key:

1. Call `request_api_key` with the narrowest `permissions` that cover the task and a
specific `reason`. Keep the returned `codeVerifier`. It cannot be recovered.
2. Wait for a person to approve the request in the dashboard.
3. Redeem it with `runtype api-keys claim <request_id> --verifier <codeVerifier>`, or with
`claim_api_key` using the default `delivery: "secret"`.
2. Wait for a person to approve the request in the dashboard. Do not guess when they decide.
With a shell, run
`RUNTYPE_KEY_REQUEST_VERIFIER=<codeVerifier> runtype api-keys claim <request_id> --wait` in
the background (older CLIs: `--verifier <codeVerifier>`). It exits once the request is
decided and writes the key file on approval.
3. Without a shell, call `wait_for_api_key_decision` with the request id. It never claims
the key and never needs the verifier. Or call `wait_for_event` with
`runtype.api_key_request.decided`, arguments `{ requestId }` and cursor `"0"`; if
nothing arrives by the request's `expiresAt`, call `claim_api_key` once to read the
outcome and stop. Then redeem with `claim_api_key` using the default
`delivery: "secret"`. Redeem within 10 minutes of approval.

Never print the key into the conversation.

Expand Down
21 changes: 17 additions & 4 deletions skills/runtype-build-product/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
name: runtype-build-product
description: 'Build, deploy, validate, or modify Runtype-hosted AI products, agents, flows, tools, surfaces, schedules, and eval suites, including from example templates.'
user-invocable: true
argument-hint: '[product idea or build task]'
---

# Runtype Build Product
Expand All @@ -17,6 +15,20 @@ If the Runtype MCP tools are not available, run `runtype install-mcp` for the cu
agent harness. Until the tools appear, call them through the CLI with `runtype mcp tools`
and `runtype mcp call <tool>`. For sign-in and account setup, use the `runtype` skill.

## Delegate or drive

If the Runtype MCP server lists `delegate_to_runtype`, hand it the build when the work
stays inside the Runtype account and takes four or more dependent calls (build, validate,
test-run). On a host that runs it as an MCP task (Claude Code's main conversation), three
calls is enough. Put the goal, every decision and target id, and the acceptance check in
`task` up front, relay the `task_url`, and verify anything the digest marks untested.

Drive the steps yourself (below) when the change is one or two calls or an edit to a
known id, when the user wants to steer each step, when the result feeds code you are
writing, or when it needs local files, secrets, provider keys, or client tokens. The
delegate cannot see or create those. Only the self-driven path needs
`get_build_instructions`.

## Required first calls

Before designing or creating resources:
Expand All @@ -26,8 +38,9 @@ Before designing or creating resources:
- Capability scoping: `get_build_instructions(task="explain-capabilities")`.

For a product build, pass `focus` as a comma-separated list when the product clearly
needs one of these areas: `commerce`, `embed`, `subagents`, `skills`, `search`,
`retrieval`, `decision-models`, or `extraction-models`. The response includes those
needs one of these areas: `commerce`, `embed`, `embed-fullscreen`, `subagents`,
`skills`, `search`, `retrieval`, `decision-models`, `extraction-models`,
`operational-design`, `agent-design`, or `prompt-authoring`. The response includes those
full guides instead of pointers to them.

Then fetch only the `get_platform_documentation` topics the task needs:
Expand Down
23 changes: 18 additions & 5 deletions skills/runtype-external-agents/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
name: runtype-external-agents
description: 'Connect agents that run outside Runtype (Flue, Cloudflare Agents SDK, Vercel AI SDK, LangGraph, OpenAI Agents SDK, Mastra, OpenClaw, Hermes, Pi, custom loops) through OpenTelemetry/OTLP trace export or an A2A or runtype-stream endpoint, to get runs, traces, eval capture, Persona chat, or surfaces; not Runtype-hosted execution.'
user-invocable: true
argument-hint: '[framework and what you want from Runtype: traces, evals, chat UI]'
description: 'Connect agents that run outside Runtype (Flue, Cloudflare Agents SDK, Vercel AI SDK, LangGraph, OpenAI Agents SDK, Mastra, OpenClaw, Hermes, Pi, Pydantic AI, custom loops) through OpenTelemetry/OTLP trace export or an A2A or runtype-stream endpoint, to get runs, traces, eval capture, Persona chat, or surfaces; not Runtype-hosted execution.'
---

# Runtype for agents that run elsewhere
Expand Down Expand Up @@ -41,7 +39,8 @@ Capability matrix to state plainly:
`RUNTYPE_CAPTURE_CONTENT=true` for OpenClaw and Pi or
`RUNTYPE_OTEL_CAPTURE_CONTENT=true` for Hermes. If the plugin receives no
content, the run has no transcript to capture as an eval case. The Pi durable
binding sends content unless `content: false`.
binding sends content unless `content: false`, and the Pydantic AI adapter unless
`content=False`.
- Eval **re-run** (`run_eval_suite`) needs Runtype to be able to call the agent. An
`external` agent over A2A works (recorded-tool replay cases are skipped).
`runtype-stream` endpoints are not eval targets. Telemetry-only runs cannot be re-run.
Expand Down Expand Up @@ -157,6 +156,20 @@ pi-durable and `PiHarness` are experimental/beta upstream.
Report each Pi run through one producer only, or Runtype counts its tokens twice. Neither
binding makes the agent callable from Runtype.

**Pydantic AI (`runtype-pydantic-ai`, PyPI).** Supports `pydantic-ai` 1.90+ and 2.x and
sends OTLP itself; do not add an exporter. `pip install runtype-pydantic-ai`, set
`RUNTYPE_API_KEY` (`TELEMETRY:WRITE`) and `RUNTYPE_AGENT_ID`, then call
`runtype_pydantic_ai.instrument()` once at startup; every `Agent` in the process is traced.
`RUNTYPE_OTLP_URL` overrides the full trace URL. With Logfire, call `instrument()` after
`logfire.configure()`, or pass `runtype_pydantic_ai.span_processor()` in
`additional_span_processors`; any instrumentation format from 2 up works. Each top-level run
is one Runtype run (`invoke_agent`, `chat`, `execute_tool`); a sub-agent called from a tool
stays in the outer run. `instrument(agent_ids={...})` maps agent names to Runtype agents.
Content is on by default, including any personal data in prompts; `content=False` or
`ContentOptions` (per-kind switches, `max_chars`, `redact`) narrow it. Spans export in
batches; call `force_flush()` on the returned handle in tests and short-lived handlers.
**Connect an agent** has a **Pydantic AI** chip that creates the agent and key.

**Flue on Node, Cloud Run, or another host.** Point exactly one Flue instrumentation at
Runtype. Two would double the tokens and cost.

Expand Down Expand Up @@ -248,7 +261,7 @@ inside `externalConfig` are the same.
- `retryCount` (0 to 10; default 3) retries the connection only, never a stream that has
started.
- `framework` is a descriptive label (`flue`, `langchain`, `vercel_ai`, `crewai`,
`cloudflare`, `autogen`, or `custom`). It does not change the wire protocol.
`cloudflare`, `autogen`, `mastra`, or `custom`). It does not change the wire protocol.

**Where to register.** The dashboard's **Connect External** tab on the new-agent page
registers A2A endpoints only. Register a `runtype-stream` agent with `create_agent` or
Expand Down
46 changes: 36 additions & 10 deletions skills/runtype-persona/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
name: runtype-persona
description: 'Embed, theme, or debug a Runtype Persona chat widget on a website: client tokens, embed snippets, fullscreen assistant layouts, WebMCP page tools, and browser-side chat integrations.'
user-invocable: true
argument-hint: '[Persona widget or chat UI task]'
---

# Runtype Persona
Expand Down Expand Up @@ -68,9 +66,11 @@ Common wrong answers: `@runtype/persona`, `Persona.mount()`, `window.Persona`,

### Load from cdn.runtype.com

When you load Persona from a CDN, use `cdn.runtype.com`. Pages published with the
`publish_page` tool load scripts only from `cdn.runtype.com`, and scripts from other CDNs
fail without an error. On a page that
When you load Persona from a CDN, use `cdn.runtype.com`. Pages published with
`builtin:publish_page` (run it through `execute_tool`) load scripts only from
`cdn.runtype.com` and block inline scripts. Scripts from other CDNs and inline init code
fail without an error, so use the script-installer form with `data-*` attributes there. On
a page that
Runtype deploys, replace `latest` with the current published version, for example
`https://cdn.runtype.com/persona/PERSONA_VERSION/install.global.js`, so a new release does
not change the widget under your deployed page. Pin the version in the script URL, never
Expand Down Expand Up @@ -99,7 +99,7 @@ as a `version` or `cdn` key in `data-config`.
version requires exactly one agent in `agentIds`. A token with no target resolves like
any run that names no version, so depending on your organization's live-default setting,
a saved agent edit can reach the widget immediately.
4. Generate embed code with `generate_persona_embed_code`.
4. Generate embed code with `generate_persona_embed_code`, then add `future: { v5Defaults: true }` to the widget config to use the V5 default styles. Under V5, the artifact pane is on by default; set `features.artifacts.enabled` to `false` to turn it off. For a coordinated look without hand-written tokens, set the top-level `brand` option (`accent`, `neutral`, `font`, `radius`, `density`, `elevation`). Explicit `theme` values still win.
5. For consumer-facing widgets, hide tool calls and reasoning by default.
6. For internal or debug widgets, expose useful traces intentionally.
7. For custom themes, set explicit high-contrast component tokens and verify header,
Expand Down Expand Up @@ -136,6 +136,12 @@ and layout-specific token choices.

## Local Tools

Before designing or auditing page tools, read
[`webmcp-authoring.md`](references/webmcp-authoring.md). Use its
journey, trust, confirmation, and evaluation checklist alongside the platform
configuration below. Upstream WebMCP skills supplement these rules; they do not
override Runtype authorization or Persona's compatibility contracts.

Use browser-side local tools when the assistant needs to read page state or trigger UI
actions that are only available in the front end. For Persona widgets, these are WebMCP
page tools registered on `document.modelContext` and admitted by the chat surface's
Expand All @@ -162,6 +168,9 @@ Required WebMCP setup:
- Register page tools on `document.modelContext` in the host page, for example with
`registerTool(...)`. Persona collects them on each turn and runs returned
`webmcp:<name>` calls in the browser.
- Install `@mcp-b/webmcp-polyfill` before you register, or check that
`document.modelContext` exists first. It is undefined on a browser without native
support, and Persona installs its fallback only at the first dispatch.
- Create the client token with `product_surface_id` set to the `chat` surface, and include
the embedding page origin in `allowed_origins`. A token that is not bound to the surface
drops every page tool. `product_surface_id` is fixed at creation, so recreate an
Expand All @@ -171,13 +180,30 @@ Required WebMCP setup:
skip approval only for safe read-only tools, and `webmcp.onConfirm` only when the host
page needs custom confirmation UI. The widget-side `webmcp.allowlist` is a convenience
filter, not a security boundary.
- List consequential tools in `requireConfirmFor` so they always confirm, for example
`["checkout_*", "delete_*"]`. Put the list on the surface as
`behavior.webmcp.requireConfirmFor`; Persona reads it from `/v1/client/init` and merges
it with any widget-side `webmcp.requireConfirmFor`. A matching tool always shows the
approval bubble, even when `autoApprove` returns `true` or the call is a read-only voice
call. A custom `onConfirm` receives `info.confirmRequired: true` for a matching tool and
must not auto-approve it. Patterns match the bare tool name, and `*` matches any run of
characters.
- Set the `chat` surface `behavior.webmcp.enabled` to `true`.
- Add origin-scoped `behavior.webmcp.allowlist` rules for page tools that should be
callable, for example `{ origin: "https://store.example.com", tools: ["search_*"] }`.
The server enforces only `enabled` and `allowlist`. `behavior.webmcp.requireConfirmFor`
(for example `["checkout_*"]`) forces Persona's confirmation and is not a security
boundary: chat dispatch does not enforce it, and the voice direct route never picks a
listed tool.
The server enforces only `enabled` and `allowlist`. `requireConfirmFor` is client-side
confirmation, not a security boundary: chat dispatch does not enforce it, so put every
tool that must never run in the allowlist decision, not only in `requireConfirmFor`. The
voice direct route never picks a listed tool.
- To run page tools one at a time, set `webmcp.execution` to `"sequential"`. The default is
`"parallel"`.
- Each page-tool call has a 30-second timeout. Cancellation is cooperative, so honor the
abort signal.
- Persona truncates a page-tool result above 64 KB and adds a visible marker. It treats
every `webmcp:` result as untrusted, whatever the tool's hints say.
- A custom `webmcp.onConfirm` takes full control of confirmation. Persona consults
`webmcp.autoApprove` only on its default confirmation UI, and never for a tool that
matches `requireConfirmFor`.
- After real traffic, open the surface's **WebMCP** section in the dashboard to review
discovered tools and observed origins. Discovery records the offered page tools before
allowlist filtering.
Expand Down
Loading
Loading