For AI agents: the complete documentation index is available at https://scriptedalchemy.github.io/agent-bundle/llms.txt, the full documentation bundle is available at https://scriptedalchemy.github.io/agent-bundle/llms-full.txt, and this page is available as Markdown at https://scriptedalchemy.github.io/agent-bundle/api/routes/public.md.
Skip to main content
  • English
  • Module: routes/public

    Interfaces

    AgentEventCanonicalIdentity

    Cross-host identity supplied to an event route without fabricated host fields, plus the canonical payload of its family (#466): the fields at least two hosts report — tool name, input, and response, session id, transcript path, stop re-entry, prompt text, agent id and type, … — each carrying the host's own key as provenance, and absent when the host did not send it. E narrows payload to the family the route handles.

    Type Parameters

    E

    E extends CanonicalAgentEvent = CanonicalAgentEvent

    Properties

    event

    readonly event: E

    idempotencyKey

    readonly idempotencyKey: string

    observedAt

    readonly observedAt: string

    payload

    readonly payload: AgentEventPayload<E>

    provenance

    readonly provenance: AgentEventProvenance

    sequence

    readonly sequence: number


    AgentEventProvenance

    Properties

    host

    readonly host: string

    hostContractRevision

    readonly hostContractRevision: string

    nativeEvent

    readonly nativeEvent: string

    source

    readonly source: "native"


    AgentEventRouteConfig

    Statically extractable event-route configuration.

    Properties

    delivery?

    readonly optional delivery?: readonly "immediate"[]

    fallback?

    readonly optional fallback?: AgentEventFallbackMode

    requires?

    readonly optional requires?: readonly string[]

    Capability rows every projected host must support; mutually exclusive with targets.

    runtime?

    readonly optional runtime?: AgentEventRuntimeMode

    Standalone by default; shared explicitly reuses a generated MCP server.

    targets?

    readonly optional targets?: readonly string[]

    timeoutMs?

    readonly optional timeoutMs?: number

    Route budget within the adapter's stricter native-host deadline.

    tools?

    readonly optional tools?: readonly string[]

    Canonical tool selectors for tool/before and tool/after routes.


    AgentEventRouteProps

    Props received by an event route's default Server Component. canonical.payload is the cross-host reading of the envelope for the route's family; native is the frozen host envelope itself, for the host-specific fields the payload does not model; renderInput is strict JSON passed by the event handler to ctx.render().

    Read transport-owned request context with await agent() from @agent-bundle/runtime. The invocation, host, session, actor, workspace, and lineage axes are Observed, including typed unavailable reasons when the host cannot know an axis. Business payload fields cannot override them. lineage answers "who is my parent, what is the root, am I a subagent"; actor is the HTTP-authenticated client of a streamable MCP transport and is unavailable on hook-driven event scopes. The framework never derives or surfaces the operator's identity from a host payload.

    Type Parameters

    E

    E extends CanonicalAgentEvent = CanonicalAgentEvent

    RenderInput

    RenderInput extends JsonValue = JsonValue

    Properties

    canonical

    readonly canonical: AgentEventCanonicalIdentity<E>

    native

    readonly native: AgentEventNativePayload

    renderInput?

    readonly optional renderInput?: RenderInput

    signal

    readonly signal: AbortSignal


    AgentLayoutRoute

    Stable identity of the route a layout is wrapping, baked at compile time from the route graph. name is the protocol-facing name: the MCP tool, resource, or prompt name, the space-joined CLI command path, or the script name. The layout component's props type, AgentLayoutProps, ships from @agent-bundle/runtime because it carries React's ReactNode children and this package's root declarations stay React-free for config-only consumers.

    Properties

    id

    readonly id: string

    kind

    readonly kind: AgentLayoutRouteKind

    name

    readonly name: string

    serverId?

    readonly optional serverId?: string

    The owning MCP server id (mcp:<name>); MCP route kinds only.


    AgentProviderContext

    Request-scoped inputs supplied to a conventional context provider factory. Beyond the surface-specific invocation and the request signal, a factory observes the request's identity axes (host, session, workspace, plugin) and lineage exactly as the route will read them from await agent() — the same Observed values, provenance included — plus read-only views of the mounted state and notice handles (#459). Providers run after the request's handles exist and before the route, outside the request's async context: agent() throws outside-invocation there, and nothing on this context can dispatch state or publish a notice.

    Properties

    host

    readonly host: AgentProviderObserved<AgentProviderHostIdentity>

    invocation

    readonly invocation: AgentProviderInvocation

    lineage

    readonly lineage: AgentProviderObserved<AgentProviderLineage>

    notices?

    readonly optional notices?: AgentProviderNoticesHandle

    Present only for projects with a mounted notice ledger.

    plugin

    readonly plugin: AgentProviderObservedPluginRoot

    The resolved plugin root, exactly what the route will read as (await agent()).plugin.

    session

    readonly session: AgentProviderObserved<AgentProviderSessionIdentity>

    signal

    readonly signal: AbortSignal

    state?

    readonly optional state?: AgentProviderStateHandle<unknown>

    Present only for projects that declare src/state.ts.

    workspace

    readonly workspace: AgentProviderObserved<AgentProviderWorkspaceIdentity>


    AgentProviderHostIdentity

    Structurally the runtime's AgentHostIdentity: the host the request came through.

    Properties

    name

    readonly name: string


    AgentProviderLineage

    Structurally the runtime's AgentLineage: the request's own chain plus, when the warm runtime's registry placed it, the live tree around it.

    Properties

    conversation

    readonly conversation: string

    depth

    readonly depth: number

    generation?

    readonly optional generation?: string

    parent?

    readonly optional parent?: string

    resolution

    readonly resolution: AgentProviderLineageResolution

    root

    readonly root: string

    subagent?

    readonly optional subagent?: AgentProviderLineageSubagent

    tree?

    readonly optional tree?: AgentProviderLineageTree


    AgentProviderLineagePeer

    Structurally the runtime's AgentLineagePeer (#457): one other live conversation in the registry's tree.

    Properties

    conversation

    readonly conversation: string

    depth

    readonly depth: number

    parent?

    readonly optional parent?: string

    resolution

    readonly resolution: AgentProviderLineageResolution

    startedAt

    readonly startedAt: string

    subagent?

    readonly optional subagent?: AgentProviderLineageSubagent


    AgentProviderLineageSubagent

    Structurally the runtime's AgentLineageSubagent.

    Properties

    id

    readonly id: string

    isParallelWorker?

    readonly optional isParallelWorker?: boolean

    toolCallId?

    readonly optional toolCallId?: string

    type?

    readonly optional type?: string


    AgentProviderLineageTree

    Structurally the runtime's AgentLineageTree (#457).

    Properties

    children

    readonly children: readonly AgentProviderLineagePeer[]

    roots

    readonly roots: readonly AgentProviderLineagePeer[]

    siblings

    readonly siblings: readonly AgentProviderLineagePeer[]


    AgentProviderNotice

    One notice as a provider reads it from inbox() or published(): every field of the runtime's AgentNotice, spelled structurally. content is the persisted Agent Document (the runtime's AgentDocument); it is unknown here because the Agent Document types ship with the runtime, so a provider that needs the authored text narrows it with the runtime's types — a route reads the same notice through (await agent()).notices.

    Properties

    acknowledgement?

    readonly optional acknowledgement?: object

    acknowledgedAt

    readonly acknowledgedAt: string

    invocationId

    readonly invocationId: string

    attempts

    readonly attempts: readonly AgentProviderNoticeAttempt[]

    availability?

    readonly optional availability?: object

    channel

    readonly channel: "mcp-resource-updated"

    count

    readonly count: number

    firstAt

    readonly firstAt: string

    lastAt

    readonly lastAt: string

    availabilityReservation?

    readonly optional availabilityReservation?: object

    at

    readonly at: string

    key

    readonly key: string

    content

    readonly content: unknown

    createdAt

    readonly createdAt: string

    dedupeKey?

    readonly optional dedupeKey?: string

    expiredAt?

    readonly optional expiredAt?: string

    expiresAt?

    readonly optional expiresAt?: string

    exposure?

    readonly optional exposure?: object

    channel

    readonly channel: "mcp-inbox"

    count

    readonly count: number

    firstAt

    readonly firstAt: string

    lastAt

    readonly lastAt: string

    lastInvocationId

    readonly lastInvocationId: string

    id

    readonly id: string

    nextAttemptAt?

    readonly optional nextAttemptAt?: string

    priority

    readonly priority: "low" | "normal" | "high"

    publisher?

    readonly optional publisher?: AgentProviderNoticePublisher

    recipient

    readonly recipient: AgentProviderNoticeRecipient

    retryBudget?

    readonly optional retryBudget?: number

    sensitivity?

    readonly optional sensitivity?: "public" | "internal" | "secret"

    state

    readonly state: AgentProviderNoticeState

    unavailableAt?

    readonly optional unavailableAt?: string

    unavailableReason?

    readonly optional unavailableReason?: "delivery-authorization-unavailable"

    withdrawnAt?

    readonly optional withdrawnAt?: string

    withheld?

    readonly optional withheld?: Readonly<Partial<Record<string, AgentProviderNoticeWithholding>>>


    AgentProviderNoticeAttempt

    Structurally the runtime's AgentNoticeAttemptReceipt.

    Properties

    attemptedAt

    readonly attemptedAt: string

    channel

    readonly channel: "next-event"

    invocationId

    readonly invocationId: string


    AgentProviderNoticePublisher

    Structurally the runtime's AgentNoticePublisher: the identity publish() recorded (#460).

    Properties

    actor?

    readonly optional actor?: object

    id

    readonly id: string

    conversation?

    readonly optional conversation?: string

    host?

    readonly optional host?: AgentProviderHostIdentity

    session?

    readonly optional session?: AgentProviderSessionIdentity

    workspace?

    readonly optional workspace?: AgentProviderWorkspaceIdentity


    AgentProviderNoticeRecipient

    Structurally the runtime's AgentRecipient: the conjunction of identity axes a notice is addressed to. conversation and root are lineage ids.

    Properties

    actor?

    readonly optional actor?: object

    id

    readonly id: string

    conversation?

    readonly optional conversation?: string

    host?

    readonly optional host?: AgentProviderHostIdentity

    root?

    readonly optional root?: string

    session?

    readonly optional session?: AgentProviderSessionIdentity

    workspace?

    readonly optional workspace?: AgentProviderWorkspaceIdentity


    AgentProviderNoticesHandle

    The read-only view of the request's notice handle a provider receives (#459): the runtime's AgentNoticesHandle narrowed by construction to inbox — pending notices addressed to this request's principal, as the mcp-inbox route discloses them — and published — what became of the notices this principal published, in every state (#460). Never publish, acknowledge, or the admission-bound read. Absent when the project mounts no notice ledger.

    Methods

    inbox()

    inbox(): Promise<readonly AgentProviderNotice[]>

    Returns

    Promise<readonly AgentProviderNotice[]>

    published()

    published(): Promise<readonly AgentProviderNotice[]>

    Returns

    Promise<readonly AgentProviderNotice[]>


    AgentProviderNoticeWithholding

    Structurally the runtime's AgentNoticeWithholding: a route's refusal to disclose the notice.

    Properties

    count

    readonly count: number

    firstAt

    readonly firstAt: string

    lastAt

    readonly lastAt: string

    reason

    readonly reason: "route-unavailable" | "sensitivity-exceeds-route"


    AgentProviderPluginRoot

    The plugin code root and framework state root a generated scope resolved (#468), as (await agent()).plugin observes it: root is the code root — the expanded AGENT_BUNDLE_PLUGIN_ROOT (source: 'native') or the shell's fallback ('derived') — and stateRoot is the framework state root (AGENT_BUNDLE_STATE_ROOT, else ~/.agent-bundle/state/<plugin>-<digest> or $XDG_STATE_HOME/agent-bundle/<plugin>-<digest> for an installed artifact; <root>/state for the npm package bin and the test harnesses), where the SQLite kernel, the notice ledger, and the lineage journal live. Structurally identical to the runtime's AgentPluginIdentity.

    Properties

    root

    readonly root: string

    stateRoot

    readonly stateRoot: string


    AgentProviderSessionIdentity

    Structurally the runtime's AgentSessionIdentity: the host session the request belongs to.

    Properties

    sessionId

    readonly sessionId: string


    AgentProviderStateHandle

    The read-only view of the project's mounted state handle a provider receives (#459): the runtime's AgentStateHandle narrowed to lifetime and read by construction, so a provider can derive a view of shared state but never dispatch. Absent for stateless projects and for surfaces that mount none.

    Type Parameters

    TState

    TState = unknown

    Properties

    lifetime

    readonly lifetime: "request" | "process" | "workspace-durable" | "external"

    Methods

    read()

    read(options?): Promise<AgentProviderStateSnapshot<TState>>

    Parameters
    options?
    revision?

    number

    signal?

    AbortSignal

    Returns

    Promise<AgentProviderStateSnapshot<TState>>


    AgentProviderStateSnapshot

    The snapshot a provider's state.read() resolves; structurally the runtime's AgentStateSnapshot.

    Type Parameters

    TState

    TState = unknown

    Properties

    revision

    readonly revision: number

    state

    readonly state: TState


    AgentProviderWorkspaceIdentity

    Structurally the runtime's AgentWorkspaceIdentity: the workspace root the request runs in.

    Properties

    root

    readonly root: string


    AppRouteConfig

    Properties

    _meta?

    readonly optional _meta?: RouteMeta

    resourceUri

    readonly resourceUri: string

    targets?

    readonly optional targets?: readonly string[]

    template?

    readonly optional template?: string

    Optional HTML shell for the compiled App. The path resolves relative to the route module, the way its imports do ('./dashboard.html'). A missing file fails the build with AB4827.


    CliProjectionConfig

    The config export of a tool's CLI surface projection module, src/mcp/<server>/tools/<tool>.cli.{ts,tsx} (#596). The module is never a route: it projects the sibling tool route onto one idiomatic command whose identity stays the tool's. Every field must stay inside the static route-config grammar; flags and positionals name canonical keys of the tool's inputSchema, so declare it as satisfies CliProjectionConfig<typeof inputSchema> with import type { inputSchema } from './<tool>.js'. The module may also export a sync or async mapInput(input) the shell awaits and applies to the parsed argv before the canonical schema validates.

    Type Parameters

    Schema

    Schema = RouteSchema<Readonly<Record<string, unknown>>>

    Properties

    aliases?

    readonly optional aliases?: readonly string[]

    Alternative command names at the same nesting level (the src/cli alias rules apply).

    command?

    readonly optional command?: readonly string[]

    Command path segments; default [<tool>]. Each must be a safe identity segment.

    confirm?

    readonly optional confirm?: boolean

    Require --yes before running; default: !(annotations.readOnlyHint === true) of the tool.

    description?

    readonly optional description?: string

    Help text; default: the tool's config.description.

    exitCode?

    readonly optional exitCode?: "result" | "zero"

    Exit-code policy; default: the tool's config.exitCode, else 'zero'.

    flags?

    readonly optional flags?: Partial<Readonly<Record<RouteSchemaInputKey<Schema>, CliProjectionFlagConfig>>>

    Per canonical key: the CLI spelling, aliases, description, default, and relaxed requirement.

    input?

    readonly optional input?: "json"

    'json': the command takes the tool's canonical input as one JSON object through --input '<json>' instead of per-field flags — for a schema the bounded argv grammar cannot express (a nested object, a union, a transform). The tool's own inputSchema still validates it. Cannot be combined with flags, positionals, or a mapInput export.

    positionals?

    readonly optional positionals?: readonly RouteSchemaInputKey<Schema>[]

    Canonical keys consumed as bare arguments, in order (the src/cli positional rules apply).


    CliProjectionFlagConfig

    How a CLI projection spells one canonical input key on argv. Every field is optional; an absent flag entry keeps the default policy (the kebab-cased key as --option, the schema's .describe() and .default()).

    Properties

    aliases?

    readonly optional aliases?: readonly string[]

    Extra long-form spellings (kebab-case, no leading dashes) accepted beside name.

    default?

    readonly optional default?: CliProjectionFlagDefault

    A CLI-only default the shell fills in before the canonical inputSchema reads the input; on a canonical-required key it is legal only when the module exports mapInput, and the key is listed as relaxed.

    description?

    readonly optional description?: string

    Help text; overrides the schema's .describe().

    name?

    readonly optional name?: string

    The CLI spelling (kebab-case, no leading dashes); default: the kebab-cased key.

    required?

    readonly optional required?: false

    Relax a canonical-required key so the option may be omitted on argv; legal only when the module exports mapInput, which must then supply the key before the canonical schema validates.


    CliRouteConfig

    Static metadata of one src/cli/** command route (#102 stage 2). Every field must stay inside the static route-config grammar; the command path itself comes from the file path, never from config.

    Properties

    aliases?

    readonly optional aliases?: readonly string[]

    Alternative command names at the same nesting level.

    description?

    readonly optional description?: string

    exitCode?

    readonly optional exitCode?: "result"

    Exit-code policy: omit for 0-on-success, or 'result' to read the validated result's integer exitCode property (0-255).

    input?

    readonly optional input?: "json"

    Take canonical input through --input JSON; the default when inputJsonSchema is absent.

    inputJsonSchema?

    readonly optional inputJsonSchema?: RouteInputSchema

    Execution-free input metadata for forms and CLI flags; the original schema owns validation.

    positionals?

    readonly optional positionals?: readonly string[]

    The inputSchema keys consumed as bare arguments, in order. All but the last must be scalar; a trailing z.array(...) key is variadic. Keys not named here become --options.

    render?

    readonly optional render?: RouteRenderConfig

    The render budget of one rendered (.tsx) command run; plain commands ignore it.


    CliRouteProps

    Props received by every routed CLI command's default function.

    Read transport-owned invocation, host, session, actor, and workspace axes with await agent() from @agent-bundle/runtime. Every identity axis is Observed; unavailable axes carry a typed reason, and parsed command input cannot override request identity.

    Type Parameters

    InputSchema

    InputSchema extends RouteSchema

    Properties

    input

    readonly input: RouteSchemaOutput<InputSchema>

    signal

    readonly signal: AbortSignal


    ExecutableMainContext

    The second argument the generated executable envelope passes to a plain script's or bin's main(argv, context) (#511): the process's terminal capability, probed once before main runs. A rendered route reads the same shape from (await agent()).terminal; a plain script has no request scope, so the envelope hands it the value directly.

    Properties

    terminal

    readonly terminal: AgentTerminal


    PromptConfig

    Properties

    _meta?

    readonly optional _meta?: RouteMeta

    description?

    readonly optional description?: string

    inputJsonSchema?

    readonly optional inputJsonSchema?: RouteInputSchema

    Execution-free input metadata for forms and CLI flags; the original schema owns validation.

    render?

    readonly optional render?: RouteRenderConfig

    The render budget of one get.

    title?

    readonly optional title?: string


    ResourceConfig

    Properties

    _meta?

    readonly optional _meta?: RouteMeta

    description?

    readonly optional description?: string

    inputJsonSchema?

    readonly optional inputJsonSchema?: RouteInputSchema

    Execution-free input metadata for forms and CLI flags; the original schema owns validation.

    mimeType?

    readonly optional mimeType?: string

    render?

    readonly optional render?: RouteRenderConfig

    The render budget of one read.

    title?

    readonly optional title?: string

    uri

    readonly uri: string


    RouteRenderConfig

    The render budget a rendered route declares statically in config.render. Every rendered route runs inside one render session bounded by the runtime's default limits; a long-running route (a build await, a long poll) raises maxElapsedMs here instead of clamping its own waits. The compiler validates the value (AB4835: a positive integer of milliseconds up to MAX_ROUTE_RENDER_ELAPSED_MS), and the generated MCP server, the routed CLI, and the route-unit harness apply it to that route's render session — the host's own tool-call deadline still applies on top.

    Properties

    maxElapsedMs?

    readonly optional maxElapsedMs?: number

    Wall-clock budget of one render of this route, in milliseconds; the runtime default is 60 000.


    RouteSchema

    The structural schema surface route props infer without coupling to one schema library.

    Type Parameters

    Output

    Output = unknown

    Properties

    _output

    readonly _output: Output


    RouteUiMeta

    The MCP Apps _meta.ui block a tool, resource, or prompt stamps on its listing so hosts open the referenced App beside the result. Set resourceUri to appResourceUri of the App route instead of repeating the App's ui:// literal: the compiler resolves the reference to the App's static config.resourceUri, so the two can never drift. The block stays open for the rest of the MCP Apps ui vocabulary (prefersBorder, csp, permissions, …).

    Indexable

    [key: string]: unknown

    Properties

    resourceUri?

    readonly optional resourceUri?: string


    ScriptRouteProps

    Props received by a rendered script's (src/scripts/<name>.tsx) async default Server Component: the argv left after the framework reserved --json / --ndjson, exactly as the generated executable passes it, and the request abort signal.

    Properties

    argv

    readonly argv: readonly string[]

    signal

    readonly signal: AbortSignal


    ToolConfig

    Properties

    _meta?

    readonly optional _meta?: RouteMeta

    annotations?

    readonly optional annotations?: Readonly<Record<string, boolean>>

    description?

    readonly optional description?: string

    excludeClients?

    readonly optional excludeClients?: readonly string[]

    Case-insensitive negotiated MCP client-name prefixes where this tool is unavailable. Unknown clients retain tools; this is presentation, not authorization.

    execution?

    readonly optional execution?: ToolExecutionConfig

    Task-augmented execution of this tool (execution.taskSupport); see ToolTaskSupport.

    exitCode?

    readonly optional exitCode?: "result"

    Project a validated result's integer exitCode when this tool is exposed through the generated CLI.

    inputJsonSchema?

    readonly optional inputJsonSchema?: RouteInputSchema

    Execution-free input metadata for forms and CLI flags; the original schema owns validation.

    render?

    readonly optional render?: RouteRenderConfig

    The render budget of one call; also inherited by the tool's projected CLI command.

    title?

    readonly optional title?: string


    ToolExecutionConfig

    The Tool.execution block a tool route declares statically in config.execution.

    Properties

    taskSupport?

    readonly optional taskSupport?: ToolTaskSupport


    ToolRouteProps

    Props received by every executable MCP route's default Server Component.

    Read transport-owned invocation, host, session, actor, and workspace axes with await agent() from @agent-bundle/runtime. Every identity axis is Observed; unavailable axes carry a typed reason, and input cannot override request identity.

    Type Parameters

    InputSchema

    InputSchema extends RouteSchema

    Properties

    input

    readonly input: RouteSchemaOutput<InputSchema>

    signal

    readonly signal: AbortSignal

    Type Aliases

    AgentEventDelivery

    AgentEventDelivery = "immediate"


    AgentEventFallbackMode

    AgentEventFallbackMode = "none" | "standalone"


    AgentEventNativePayload

    AgentEventNativePayload = Readonly<Record<string, unknown>>

    Complete host envelope after the adapter's schema and byte-bound validation.


    AgentEventRuntimeMode

    AgentEventRuntimeMode = "shared" | "standalone"


    AgentLayoutRouteKind

    AgentLayoutRouteKind = "tool" | "resource" | "prompt" | "cli" | "script"

    The route kinds a conventional layout wraps; event routes are host protocol responses and stay unwrapped.


    AgentProviderFactory

    AgentProviderFactory = (context) => unknown | Promise<unknown>

    Default export contract for one src/providers/<name>.{ts,tsx} module.

    Parameters

    context

    AgentProviderContext

    Returns

    unknown | Promise<unknown>


    AgentProviderLineageResolution

    AgentProviderLineageResolution = "native" | "registry" | "confirmed" | "transcript" | "inferred"


    AgentProviderNoticeState

    AgentProviderNoticeState = "pending" | "attempted" | "expired" | "unavailable" | "withdrawn" | "acknowledged"


    AgentProviderObserved

    AgentProviderObserved<Value> = { source: "native" | "receipt" | "derived"; state: "available"; value: Value; } | { reason: string; state: "unavailable"; }

    An observed request axis as a provider receives it: the same shape as every agent() identity axis, provenance included. Declared here so config-only consumers need no @agent-bundle/runtime import; structurally the runtime's Observed<T>.

    Type Parameters

    Value

    Value


    AgentProviderObservedPluginRoot

    AgentProviderObservedPluginRoot = AgentProviderObserved<AgentProviderPluginRoot>

    The observed plugin root a provider receives; the same shape as every agent() identity axis.


    CliProjectionFlagDefault

    CliProjectionFlagDefault = boolean | number | string | readonly (boolean | number | string)[]

    A literal a CLI projection may declare as flags.<key>.default: what the argv grammar itself can spell.


    RouteMeta

    RouteMeta = Readonly<Record<string, unknown>> & object

    Listing-level _meta of an MCP route. It stays inside the static route-config grammar (see the diagnostics reference), with ui typed so _meta.ui.resourceUri can reference an App route.

    Type Declaration

    ui?

    readonly optional ui?: RouteUiMeta


    RouteSchemaInputKey

    RouteSchemaInputKey<Schema> = Schema extends object ? keyof Input & string : Schema extends RouteSchema<infer Output> ? keyof Output & string : string

    The keys of a schema's input object, as keyof z.input<Schema> reads them: a zod schema declares _input; a schema declaring only _output (the structural RouteSchema) falls back to its output keys.

    Type Parameters

    Schema

    Schema


    RouteSchemaOutput

    RouteSchemaOutput<Schema> = Schema extends RouteSchema<infer Output> ? Output : never

    Type Parameters

    Schema

    Schema


    ToolTaskSupport

    ToolTaskSupport = "forbidden" | "optional" | "required"

    How a tool may be called as an MCP task (the 2025-11-25 Tasks utility, Tool.execution.taskSupport). forbidden — the wire default when the field is absent — means every call is an ordinary request. optional lets a client that asks for task-augmented execution receive a CreateTaskResult at once and poll tasks/get / tasks/result for the final CallToolResult while the render continues; a client that does not ask sees no change. required refuses an ordinary call with JSON-RPC -32601. The compiler validates the value (AB4836); the generated server advertises it in tools/list and declares the tasks capability only when at least one tool opted in.

    Variables

    appResourceUri

    const appResourceUri: (reference) => string

    References an MCP App route's config.resourceUri from another route's static config (typically _meta.ui.resourceUri). The App must belong to the same generated server as the referencing route — a generated server registers only its own Apps. Accepted references:

    • '<app>' — the App route src/mcp/<server>/apps/<app>.{ts,tsx} of the referencing route's server;
    • '<server>/<app>' or 'app:<server>/<app>' — the same App by route id;
    • './…' or '../…' — the App route module relative to the referencing module, with or without its .ts/.tsx extension.

    The compiler evaluates the call statically while extracting config and replaces it with the target App's resourceUri; a reference to no App of the same server is AB4826. The route module still evaluates at run time (generated entries import it for its default export), where the call returns the reference unchanged — generated servers read the compiled config, never this value.

    Parameters

    reference

    string

    Returns

    string


    MAX_ROUTE_RENDER_ELAPSED_MS

    const MAX_ROUTE_RENDER_ELAPSED_MS: number

    The ceiling config.render.maxElapsedMs may declare: 24 hours. The value stays inside Claude Code's default per-call wall clock (MCP_TOOL_TIMEOUT, about 28 hours); Codex (tool_timeout_sec, 60 s by default) and any per-server host setting must be raised separately by the operator.

    References

    AgentEventPayload

    Re-exports AgentEventPayload


    AgentEventPayloadField

    Re-exports AgentEventPayloadField


    AgentEventPayloadFieldKind

    Re-exports AgentEventPayloadFieldKind


    agentEventPayloadFieldKinds

    Re-exports agentEventPayloadFieldKinds


    AgentEventPayloadFieldName

    Re-exports AgentEventPayloadFieldName


    agentEventPayloadFields

    Re-exports agentEventPayloadFields


    AgentEventPayloadFields

    Re-exports AgentEventPayloadFields


    AgentEventPayloadFieldTypes

    Re-exports AgentEventPayloadFieldTypes


    AgentEventPayloadHost

    Re-exports AgentEventPayloadHost


    AgentEventPayloadNativeKey

    Re-exports AgentEventPayloadNativeKey


    agentEventPayloadNativeKeys

    Re-exports agentEventPayloadNativeKeys


    AgentTerminal

    Re-exports AgentTerminal


    AgentTerminalColor

    Re-exports AgentTerminalColor


    AgentTerminalStream

    Re-exports AgentTerminalStream


    AgentTerminalStreamKind

    Re-exports AgentTerminalStreamKind


    AgentTerminalSurface

    Re-exports AgentTerminalSurface


    CanonicalAgentEvent

    Re-exports CanonicalAgentEvent


    canonicalAgentEvents

    Re-exports canonicalAgentEvents