For AI agents: the complete documentation index is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms.txt, the full documentation bundle is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms-full.txt, and this page is available as Markdown at https://scriptedalchemy.github.io/agent-bundle/zh/api/test.md.
跳至主要内容
  • 简体中文
  • Module: test

    Info

    API 参考仅提供英文版本;正文与英文站点相同。

    Classes

    AgentTestError

    Every harness failure. The message carries the route identity, the module provenance, and the recovery step, so a failing consumer test never has to be re-run under a debugger to learn which route and which proof level produced it.

    Extends

    • Error

    Extended by

    Constructors

    Constructor

    new AgentTestError(code, message, options?): AgentTestError

    Parameters
    code

    AgentTestErrorCode

    message

    string

    options?
    cause?

    unknown

    details?

    readonly string[]

    provenance?

    RenderedRouteProvenance

    recovery?

    string

    Returns

    AgentTestError

    Overrides

    Error.constructor

    Properties

    ~effect/ErrorReporter/attributes?

    readonly optional ~effect/ErrorReporter/attributes?: ReadonlyRecord<string, unknown>

    Inherited from

    Error.~effect/ErrorReporter/attributes

    ~effect/ErrorReporter/ignore?

    readonly optional ~effect/ErrorReporter/ignore?: boolean

    Inherited from

    Error.~effect/ErrorReporter/ignore

    ~effect/ErrorReporter/severity?

    readonly optional ~effect/ErrorReporter/severity?: Severity

    Inherited from

    Error.~effect/ErrorReporter/severity

    ~effect/Runtime/errorExitCode?

    readonly optional ~effect/Runtime/errorExitCode?: number

    Inherited from

    Error.~effect/Runtime/errorExitCode

    ~effect/Runtime/errorReported?

    readonly optional ~effect/Runtime/errorReported?: boolean

    Inherited from

    Error.~effect/Runtime/errorReported

    cause?

    optional cause?: unknown

    Inherited from

    Error.cause

    code

    readonly code: AgentTestErrorCode

    message

    message: string

    Inherited from

    Error.message

    name

    name: string

    Inherited from

    Error.name

    provenance?

    readonly optional provenance?: RenderedRouteProvenance

    stack?

    optional stack?: string

    Inherited from

    Error.stack

    stackTraceLimit

    static stackTraceLimit: number

    The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

    The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

    If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

    Inherited from

    Error.stackTraceLimit

    Methods

    captureStackTrace()

    static captureStackTrace(targetObject, constructorOpt?): void

    Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack;  // Similar to `new Error().stack`

    The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

    The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

    The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

    function a() {
      b();
    }
    
    function b() {
      c();
    }
    
    function c() {
      // Create an error without stack trace to avoid calculating the stack trace twice.
      const { stackTraceLimit } = Error;
      Error.stackTraceLimit = 0;
      const error = new Error();
      Error.stackTraceLimit = stackTraceLimit;
    
      // Capture the stack trace above function b
      Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
      throw error;
    }
    
    a();
    Parameters
    targetObject

    object

    constructorOpt?

    Function

    Returns

    void

    Inherited from

    Error.captureStackTrace

    prepareStackTrace()

    static prepareStackTrace(err, stackTraces): any

    Parameters
    err

    Error

    stackTraces

    CallSite[]

    Returns

    any

    See

    https://v8.dev/docs/stack-trace-api#customizing-stack-traces

    Inherited from

    Error.prepareStackTrace


    ContractMatrixViolationError

    Every harness failure. The message carries the route identity, the module provenance, and the recovery step, so a failing consumer test never has to be re-run under a debugger to learn which route and which proof level produced it.

    Extends

    Constructors

    Constructor

    new ContractMatrixViolationError(message, failures, report, options): ContractMatrixViolationError

    Parameters
    message

    string

    failures

    readonly ContractMatrixFailure[]

    report

    ContractMatrixReport

    options
    details

    readonly string[]

    recovery

    string

    Returns

    ContractMatrixViolationError

    Overrides

    AgentTestError.constructor

    Properties

    ~effect/ErrorReporter/attributes?

    readonly optional ~effect/ErrorReporter/attributes?: ReadonlyRecord<string, unknown>

    Inherited from

    AgentTestError.~effect/ErrorReporter/attributes

    ~effect/ErrorReporter/ignore?

    readonly optional ~effect/ErrorReporter/ignore?: boolean

    Inherited from

    AgentTestError.~effect/ErrorReporter/ignore

    ~effect/ErrorReporter/severity?

    readonly optional ~effect/ErrorReporter/severity?: Severity

    Inherited from

    AgentTestError.~effect/ErrorReporter/severity

    ~effect/Runtime/errorExitCode?

    readonly optional ~effect/Runtime/errorExitCode?: number

    Inherited from

    AgentTestError.~effect/Runtime/errorExitCode

    ~effect/Runtime/errorReported?

    readonly optional ~effect/Runtime/errorReported?: boolean

    Inherited from

    AgentTestError.~effect/Runtime/errorReported

    cause?

    optional cause?: unknown

    Inherited from

    AgentTestError.cause

    code

    readonly code: AgentTestErrorCode

    Inherited from

    AgentTestError.code

    failures

    readonly failures: readonly ContractMatrixFailure[]

    message

    message: string

    Inherited from

    AgentTestError.message

    name

    name: string

    Inherited from

    AgentTestError.name

    provenance?

    readonly optional provenance?: RenderedRouteProvenance

    Inherited from

    AgentTestError.provenance

    report

    readonly report: ContractMatrixReport

    stack?

    optional stack?: string

    Inherited from

    AgentTestError.stack

    stackTraceLimit

    static stackTraceLimit: number

    The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

    The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

    If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

    Inherited from

    AgentTestError.stackTraceLimit

    Methods

    captureStackTrace()

    static captureStackTrace(targetObject, constructorOpt?): void

    Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

    const myObject = {};
    Error.captureStackTrace(myObject);
    myObject.stack;  // Similar to `new Error().stack`

    The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

    The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

    The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

    function a() {
      b();
    }
    
    function b() {
      c();
    }
    
    function c() {
      // Create an error without stack trace to avoid calculating the stack trace twice.
      const { stackTraceLimit } = Error;
      Error.stackTraceLimit = 0;
      const error = new Error();
      Error.stackTraceLimit = stackTraceLimit;
    
      // Capture the stack trace above function b
      Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
      throw error;
    }
    
    a();
    Parameters
    targetObject

    object

    constructorOpt?

    Function

    Returns

    void

    Inherited from

    AgentTestError.captureStackTrace

    prepareStackTrace()

    static prepareStackTrace(err, stackTraces): any

    Parameters
    err

    Error

    stackTraces

    CallSite[]

    Returns

    any

    See

    https://v8.dev/docs/stack-trace-api#customizing-stack-traces

    Inherited from

    AgentTestError.prepareStackTrace

    Interfaces

    AgentEventRouteInput

    The { canonical, native, renderInput? } half of AgentEventRouteProps<E>; the harness supplies signal.

    Type Parameters

    E

    E extends CanonicalAgentEvent = CanonicalAgentEvent

    Properties

    canonical

    readonly canonical: AgentEventCanonicalIdentity<E>

    native

    readonly native: AgentEventNativePayload

    renderInput?

    readonly optional renderInput?: JsonValue


    AgentRouteModule

    One route module the harness renders: the public route contract's async default component, plus the schemas the generated server and the routed CLI validate through — inputSchema on the way in (the CLI dispatch level's boundary) and resultSchema on the document value coming out.

    Properties

    default

    readonly default: (props) => unknown

    Parameters
    props

    never

    Returns

    unknown

    inputSchema?

    readonly optional inputSchema?: AgentRouteSchema

    resultSchema?

    readonly optional resultSchema?: AgentRouteSchema


    AgentTestRouteRegistry

    Properties

    layoutLoaders?

    readonly optional layoutLoaders?: Readonly<Record<string, AgentLayoutModuleLoader>>

    Lazy loaders keyed by compiled layout id (layout:root, layout:mcp:<server>).

    loaders

    readonly loaders: Readonly<Record<string, AgentRouteModuleLoader>>

    Lazy loaders keyed by compiled route id, so a test only compiles the routes it renders.

    manifest

    readonly manifest: AgentBundleTestManifest

    projectionLoaders?

    readonly optional projectionLoaders?: Readonly<Record<string, AgentProjectionModuleLoader>>

    Lazy loaders keyed by backing tool route id; present only for explicit CLI projections.

    providerLoaders?

    readonly optional providerLoaders?: Readonly<Record<string, AgentProviderModuleLoader>>

    Lazy loaders keyed by compiled provider id; present only when the project declares providers.

    stateLoader?

    readonly optional stateLoader?: AgentStateModuleLoader

    version

    readonly version: number


    ApplicationLeaf

    Properties

    command?

    readonly optional command?: ArtifactManifestCliCommand

    config

    readonly config: readonly RouteManifestConfigEntry[]

    description?

    readonly optional description?: string

    document?

    readonly optional document?: ServedStaticDocument

    event?

    readonly optional event?: string

    execution

    readonly execution: ApplicationLeafExecution

    handler?

    readonly optional handler?: string

    inputSchema?

    readonly optional inputSchema?: RouteInputSchema

    key

    readonly key: string

    label

    readonly label: string

    ref

    readonly ref: ApplicationNodeRef

    resultSchemaState

    readonly resultSchemaState: RouteResultSchemaState

    routeId?

    readonly optional routeId?: string

    source?

    readonly optional source?: string


    ApplicationServerGroup

    Properties

    key

    readonly key: string

    label

    readonly label: string

    mode

    readonly mode: string

    server

    readonly server: string

    subgroups

    readonly subgroups: readonly ApplicationSubgroup[]


    ApplicationSubgroup

    Properties

    key

    readonly key: string

    label

    readonly label: string

    leaves

    readonly leaves: readonly ApplicationLeaf[]


    ApplicationTree

    Properties

    diagnostics

    readonly diagnostics: readonly Diagnostic[]

    groups

    readonly groups: readonly ApplicationGroup[]

    leafCount

    readonly leafCount: number

    message?

    readonly optional message?: string

    state

    readonly state: ApplicationTreeState


    CliDispatchProvenance

    Extends

    Properties

    commands

    readonly commands: readonly string[]

    Every command the graph compiled, so a dispatch failure can name the alternatives.

    manifestDigest?

    readonly optional manifestDigest?: string

    The manifest digest when the route came from the compiler; absent for a module rendered directly.

    Inherited from

    RenderedRouteProvenance.manifestDigest

    projectRoot?

    readonly optional projectRoot?: string

    Inherited from

    RenderedRouteProvenance.projectRoot

    proofLevel

    readonly proofLevel: "cli-dispatch"


    CliInvocation

    Properties

    argv

    readonly argv: readonly string[]

    The argv vector as dispatched, including the command path segments.

    command?

    readonly optional command?: string

    The resolved command path (db migrate); absent for help, --version, and usage failures.

    exitCode

    readonly exitCode: number

    The process exit code the routed shell mapped: 0 success (or the result's exitCode under config.exitCode: 'result'), 1 execution failure, 2 usage or input-validation failure.

    provenance

    readonly provenance: CliDispatchProvenance

    routeId?

    readonly optional routeId?: string

    The compiled route the shell executed: a cli: route, or the tool: route behind a projected MCP command. Typed from the project's route registration once .agent-bundle/routes.d.ts is in the program (both kinds register), string without it; absent for help, --version, and usage failures. argv itself stays readonly string[] — it is the shell's input, not a route id.

    stderr

    readonly stderr: string

    Everything the shell wrote to its diagnostic stream.

    stdout

    readonly stdout: string

    Everything the shell wrote to stdout, including rendered Markdown, TTY, JSON, or NDJSON output.

    value?

    readonly optional value?: unknown

    The validated plain result or rendered document value; absent unless a command completed validation.


    CompileTestManifestOptions

    Properties

    configPath?

    readonly optional configPath?: string

    root?

    readonly optional root?: string


    ContractCheckOutcome

    Properties

    reason?

    readonly optional reason?: string

    status

    readonly status: ContractCheckStatus


    ContractLifecycleFixture

    Type Parameters

    Input

    Input = unknown

    Properties

    state?

    readonly optional state?: object

    budget?

    readonly optional budget?: object

    budget.codePath

    readonly codePath: readonly string[]

    budget.expectedCode

    readonly expectedCode: string

    budget.input

    readonly input: Input

    budget.revisionPath

    readonly revisionPath: readonly string[]

    catalog?

    readonly optional catalog?: object

    catalog.id

    readonly id: string

    catalog.lifetime

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

    durability?

    readonly optional durability?: object

    durability.expectedStructuredContent

    readonly expectedStructuredContent: unknown

    durability.input

    readonly input: Input

    idempotency?

    readonly optional idempotency?: object

    idempotency.phase

    readonly phase: ContractLifecyclePhase

    idempotency.replayedPath

    readonly replayedPath: readonly string[]

    idempotency.revisionPath

    readonly revisionPath: readonly string[]

    journal?

    readonly optional journal?: object

    journal.expected

    readonly expected: unknown

    journal.path

    readonly path: readonly string[]

    notice?

    readonly optional notice?: object

    notice.expected

    readonly expected: unknown

    notice.path

    readonly path: readonly string[]

    notice.phase

    readonly phase: ContractLifecyclePhase

    transitionDriver

    readonly transitionDriver: () => readonly ContractLifecycleTransition<Input>[]

    Pure deterministic phase driver; transport and assertions remain framework-owned.

    Returns

    readonly ContractLifecycleTransition<Input>[]


    ContractLifecycleTransition

    One lifecycle phase's invocation. Input is the route's input, bound to its registered type by ContractRouteFixtures for a registered id.

    Type Parameters

    Input

    Input = unknown

    Properties

    expectedStructuredContent

    readonly expectedStructuredContent: unknown

    input

    readonly input: Input

    phase

    readonly phase: ContractLifecyclePhase

    progressNotifications

    readonly progressNotifications: number

    renderedTextIncludes?

    readonly optional renderedTextIncludes?: string


    ContractMatrixFailure

    Properties

    check

    readonly check: string

    reason

    readonly reason: string

    routeId

    readonly routeId: string


    ContractMatrixOptions

    Session options; context holds the request-scoped overrides applied to every route render in this session; omitting it (or its providers) mounts the project's conventional providers exactly as the generated server does (see RenderRouteContextInit).

    Extends

    Properties

    apps?

    readonly optional apps?: ContractAppCoverage

    Accepted for parity with the other entry points; apps are never registered here.

    context?

    readonly optional context?: RenderRouteContext

    Inherited from

    InMemoryMcpSessionOptions.context

    fixtures

    readonly fixtures: ContractRouteFixtures

    Route id -> fixture. Every compiled tool, prompt, and resource route on the server must be covered. App routes are not registered at mcp-in-memory; entries for them are accepted and ignored.

    limits?

    readonly optional limits?: Partial<AgentRenderLimits>

    The server dispatcher's base render limits, as the generated entry's dispatcher has them (the runtime defaults when omitted). A route's compiled config.render budget layers over them per call exactly as in the artifact, so a low maxElapsedMs here observes a route's raised budget without waiting out the 60-second default.

    Inherited from

    InMemoryMcpSessionOptionsBase.limits

    lineage?

    readonly optional lineage?: AgentLineageRegistry

    Inherited from

    InMemoryMcpSessionOptionsBase.lineage

    lineageHost?

    readonly optional lineageHost?: LineageHost

    The host vocabulary the registry applies when the in-memory client name maps to none.

    Inherited from

    InMemoryMcpSessionOptionsBase.lineageHost

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    Overrides

    InMemoryMcpSessionOptions.manifest

    restart?

    readonly optional restart?: () => Promise<ContractMatrixRestartSession>

    Reopens the same durable store after the matrix closes its initial in-memory session.

    Returns

    Promise<ContractMatrixRestartSession>

    server?

    readonly optional server?: string

    MCP server name. Optional when the project compiled exactly one server.

    Overrides

    InMemoryMcpSessionOptions.server

    state?

    readonly optional state?: object

    Optional state owner input for parity with a generated Flight worker.

    definition

    readonly definition: AgentStateDefinition<unknown, Readonly<Record<string, ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>>>

    driver

    readonly driver: AgentStateDriver

    noticeDelivery?

    readonly optional noticeDelivery?: Readonly<Record<"next-event" | "mcp-resource-updated" | "mcp-inbox" | "current-response" | "directed-push" | "host-toast", NoticeDeliveryRouteState>>

    The host advertisement the generated runtime would mount (a TargetAdapter.noticeDelivery value): its per-route sensitivity ceilings decide what the inbox discloses. Absent means every route admits internal, exactly as a generated artifact without one.

    noticeRetention?

    readonly optional noticeRetention?: NormalizedNoticeRetentionPolicy

    The project's resolved notices.retention; the runtime defaults apply when absent.

    Inherited from

    InMemoryMcpSessionOptions.state


    ContractMatrixProgressSource

    The explicit progress path a non-SDK client exposes to lifecycle fixtures. Returns the unsubscribe; an SDK Client needs none because its handler map is observed directly.

    Properties

    observeProgress

    readonly observeProgress: (listener) => () => void

    Parameters
    listener

    (notification) => void

    Returns

    () => void


    ContractMatrixReport

    Properties

    checks

    readonly checks: Readonly<Record<string, ContractCheckOutcome>>

    provenance

    readonly provenance: ContractMatrixProvenance

    routes

    readonly routes: Readonly<Record<string, ContractRouteReport>>


    ContractMatrixRestartSession

    Properties

    client

    readonly client: Client


    ContractProgressNotification

    The shape of one notifications/progress delivery a lifecycle fixture counts.

    Properties

    params?

    readonly optional params?: object

    progressToken?

    readonly optional progressToken?: string | number


    ContractResourceFixture

    The explicit fixture form for a resource or MCP App route: the sweep reads the route's wire URI and no input, policy, or lifecycle applies. Declaring it on a tool or prompt route is a coverage failure.

    Properties

    kind

    readonly kind: "resource"


    ContractRouteFixture

    One route's contract fixture. Every input here is handed to the route as its tool or prompt input, so Input is that route's input type: ContractRouteFixtures binds it to the registered input for a registered route id and leaves it unknown otherwise. previousResults stays unknown by design — those payloads come from previous server versions and need not match the current schema's type.

    Type Parameters

    Input

    Input = unknown

    Properties

    cancellation?

    readonly optional cancellation?: object

    Cancellation case: invocation aborted mid-flight must settle rejected and leave the session usable. The input must stay in flight past abortAfterMs (default 50ms); an invocation that settles before the abort fires is reported not-applicable, not failed.

    abortAfterMs?

    readonly optional abortAfterMs?: number

    input?

    readonly optional input?: Input

    input?

    readonly optional input?: Input

    Valid input for the sweep invocation (tools/prompts; resources need none).

    inputs?

    readonly optional inputs?: readonly Input[]

    Additional valid inputs — e.g. one per declared status/discriminant value.

    kind?

    readonly optional kind?: "resource"

    'resource' marks a resource/MCP App fixture (see ContractResourceFixture). Required for resource and app routes; omit it for tool and prompt fixtures.

    lifecycle?

    readonly optional lifecycle?: ContractLifecycleFixture<Input>

    Optional stateful replay over this matrix run's single open client.

    previousResults?

    readonly optional previousResults?: readonly unknown[]

    Serialized payloads captured from previous server versions; each must parse under the CURRENT resultSchema (previous-server + current-client skew).

    resultCompat?

    readonly optional resultCompat?: ResultCompatPolicy

    Declared serialized-result compatibility policy. REQUIRED for tool routes.


    ContractRouteReport

    Properties

    checks

    readonly checks: Readonly<Record<string, ContractCheckOutcome>>


    CreateEventRouteInputOptions

    Properties

    host

    readonly host: "claude" | "codex" | "cursor" | string & object

    The host the envelope came from; selects the canonical payload mapping and the validator.

    hostContractRevision?

    readonly optional hostContractRevision?: string

    The pinned host contract revision recorded in canonical.provenance. A route-unit test rarely depends on it; defaults to 'route-unit'.

    nativeEvent?

    readonly optional nativeEvent?: string

    The host-native event name; defaults to the envelope's own hook_event_name.

    validate?

    readonly optional validate?: boolean

    Validate the envelope with the same per-host, per-event rules the generated wrapper applies before it reaches a route (default true). Pass false to hand a route a deliberately partial envelope.


    DeletedSourceReceipt

    Verified project-relative paths removed before a packed entry is spawned. The receipt upgrades only a session whose entry and any explicit cwd belong to this same project root.

    Properties

    projectRoot

    readonly projectRoot: string

    Absolute root that must contain the launched entry and any explicit cwd.

    removed

    readonly removed: readonly string[]

    Sorted project-relative POSIX paths that existed, were removed, and were verified absent.


    DevEpochContractMatrixOptions

    Properties

    apps?

    readonly optional apps?: ContractAppCoverage

    App route coverage at this boundary; defaults to 'auto'.

    fixtures

    readonly fixtures: ContractRouteFixtures

    manifest

    readonly manifest: AgentBundleTestManifest

    server?

    readonly optional server?: string

    session

    readonly session: DevEpochContractMatrixSession

    An already-open epoch-pinned generated stdio session; this entry point never opens or closes it.


    DevEpochContractMatrixSession

    Properties

    client

    readonly client: ContractMatrixClient

    provenance

    readonly provenance: DevEpochMcpProvenance

    stderr

    readonly stderr: () => string

    Returns

    string


    DevEpochMcpProvenance

    Properties

    epochId

    readonly epochId: string

    proofLevel

    readonly proofLevel: "dev-epoch"

    serverName

    readonly serverName: string

    target

    readonly target: string


    DocumentAssertions

    Fluent assertions over one final Agent Document. Every failure names the route, its module, and the proof level that produced the document; passing the whole renderRoute result (rather than just .document) is what makes that provenance available.

    Properties

    toContainAudio

    readonly toContainAudio: (expected?) => DocumentAssertions

    Asserts an audio node matches every supplied media field.

    Parameters
    expected?

    MediaNodeExpectation

    Returns

    DocumentAssertions

    toContainContext

    readonly toContainContext: (text) => DocumentAssertions

    Asserts a context node contains text — the additional context an event route returns to its host.

    Parameters
    text

    string

    Returns

    DocumentAssertions

    toContainImage

    readonly toContainImage: (expected?) => DocumentAssertions

    Asserts an image node matches every supplied media field.

    Parameters
    expected?

    MediaNodeExpectation

    Returns

    DocumentAssertions

    toContainMarkdown

    readonly toContainMarkdown: (text) => DocumentAssertions

    Asserts a Markdown node contains text.

    Parameters
    text

    string

    Returns

    DocumentAssertions

    toContainResource

    readonly toContainResource: (expected?) => DocumentAssertions

    Asserts a resource node matches every supplied link field.

    Parameters
    expected?

    ResourceNodeExpectation

    Returns

    DocumentAssertions

    toContainText

    readonly toContainText: (text) => DocumentAssertions

    Asserts a text node contains text.

    Parameters
    text

    string

    Returns

    DocumentAssertions

    toHaveError

    readonly toHaveError: (code?) => DocumentAssertions

    Asserts the document represents an error node, optionally with code.

    Parameters
    code?

    string

    Returns

    DocumentAssertions

    toHaveNodeKinds

    readonly toHaveNodeKinds: (kinds) => DocumentAssertions

    Asserts the document's node kinds in document order.

    Parameters
    kinds

    readonly ("result" | "markdown" | "text" | "context" | "json" | "progress" | "image" | "audio" | "resource" | "error")[]

    Returns

    DocumentAssertions

    toHaveStatus

    readonly toHaveStatus: (status) => DocumentAssertions

    Parameters
    status

    AgentDocumentStatus

    Returns

    DocumentAssertions

    toHaveValue

    readonly toHaveValue: (value) => DocumentAssertions

    Asserts the document's structured value equals value (JSON structural equality). undefined asserts the document emitted no value at all, which null does not satisfy.

    Parameters
    value

    unknown

    Returns

    DocumentAssertions


    InMemoryMcpSession

    Extends

    • AsyncDisposable

    Properties

    client

    readonly client: Client

    The real MCP SDK client, for protocol calls this module does not wrap.

    close

    readonly close: () => Promise<void>

    Returns

    Promise<void>

    provenance

    readonly provenance: McpProjectionProvenance

    Methods

    [asyncDispose]()

    [asyncDispose](): PromiseLike<void>

    Returns

    PromiseLike<void>

    Inherited from

    AsyncDisposable.[asyncDispose]


    InMemoryMcpSessionOptionsBase

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentStateEventSchemas = AgentStateEventSchemas

    Properties

    limits?

    readonly optional limits?: Partial<AgentRenderLimits>

    The server dispatcher's base render limits, as the generated entry's dispatcher has them (the runtime defaults when omitted). A route's compiled config.render budget layers over them per call exactly as in the artifact, so a low maxElapsedMs here observes a route's raised budget without waiting out the 60-second default.

    lineage?

    readonly optional lineage?: AgentLineageRegistry

    lineageHost?

    readonly optional lineageHost?: LineageHost

    The host vocabulary the registry applies when the in-memory client name maps to none.

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    server?

    readonly optional server?: string

    MCP server name. Optional when the project compiled exactly one server.

    state?

    readonly optional state?: object

    Optional state owner input for parity with a generated Flight worker.

    definition

    readonly definition: AgentStateDefinition<TState, TEvents>

    driver

    readonly driver: AgentStateDriver

    noticeDelivery?

    readonly optional noticeDelivery?: Readonly<Record<"next-event" | "mcp-resource-updated" | "mcp-inbox" | "current-response" | "directed-push" | "host-toast", NoticeDeliveryRouteState>>

    The host advertisement the generated runtime would mount (a TargetAdapter.noticeDelivery value): its per-route sensitivity ceilings decide what the inbox discloses. Absent means every route admits internal, exactly as a generated artifact without one.

    noticeRetention?

    readonly optional noticeRetention?: NormalizedNoticeRetentionPolicy

    The project's resolved notices.retention; the runtime defaults apply when absent.


    InspectWorkbenchSurfaceOptions

    Properties

    configPath?

    readonly optional configPath?: string

    Explicit Agent Bundle configuration path; discovered from root when omitted.

    root?

    readonly optional root?: string

    Project root; defaults to the working directory.


    InstalledHostCheckOutcome

    Properties

    reason?

    readonly optional reason?: string

    status

    readonly status: "failed" | "passed"


    InstalledHostContractMatrixOptions

    Properties

    apps?

    readonly optional apps?: ContractAppCoverage

    App route coverage at this boundary; defaults to 'auto'.

    fixtures

    readonly fixtures: ContractRouteFixtures

    manifest

    readonly manifest: AgentBundleTestManifest

    server?

    readonly optional server?: string

    session

    readonly session: InstalledHostMcpSession

    An already-open installed-host session; this entry point never opens or closes it.


    InstalledHostContractMatrixReport

    Properties

    checks

    readonly checks: Readonly<Record<string, InstalledHostCheckOutcome>>

    host

    readonly host: InstalledMcpHost

    matrix

    readonly matrix: ContractMatrixReport

    metadata

    readonly metadata: InstalledHostEvidenceMetadata

    proofLevel

    readonly proofLevel: string

    sessionEvidence

    readonly sessionEvidence: string

    status

    readonly status: "passed"

    versions

    readonly versions: InstalledHostVersionQuadruple


    InstalledHostEvidenceMetadata

    Properties

    adapterRevision

    readonly adapterRevision: string

    frameworkVersion

    readonly frameworkVersion: string

    hostBinaryVersion

    readonly hostBinaryVersion: InstalledHostBinaryVersion

    manifestSchemaDigest

    readonly manifestSchemaDigest: string


    InstalledHostMcpProvenance

    Properties

    entry

    readonly entry: string

    Installed-root-relative command entry, never an absolute host path.

    host

    readonly host: InstalledMcpHost

    pid

    readonly pid: number | undefined

    proofLevel

    readonly proofLevel: "simulated" | "host-install"


    InstalledHostMcpSession

    Extends

    • AsyncDisposable

    Properties

    client

    readonly client: Client

    close

    readonly close: () => Promise<void>

    Returns

    Promise<void>

    eventRuntimeEndpoint?

    readonly optional eventRuntimeEndpoint?: string

    Raw read-only status socket for the installed generated event runtime.

    observation

    readonly observation: InstalledHostObservation

    provenance

    readonly provenance: InstalledHostMcpProvenance

    stderr

    readonly stderr: () => string

    Returns

    string

    Methods

    [asyncDispose]()

    [asyncDispose](): PromiseLike<void>

    Returns

    PromiseLike<void>

    Inherited from

    AsyncDisposable.[asyncDispose]


    InstalledHostObservation

    Properties

    checks

    readonly checks: Readonly<Record<InstalledHostCheckName, InstalledHostCheckOutcome>>

    host

    readonly host: InstalledMcpHost

    metadata

    readonly metadata: InstalledHostEvidenceMetadata

    proofLevel

    readonly proofLevel: string

    sessionEvidence

    readonly sessionEvidence: string

    versions

    readonly versions: InstalledHostVersionQuadruple


    InstalledHostVersionQuadruple

    Properties

    builtArtifact

    readonly builtArtifact: string

    installedArtifact

    readonly installedArtifact: string

    runningProcess

    readonly runningProcess: string

    source

    readonly source: string


    InvokeCliOptionsBase

    Properties

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    signal?

    readonly optional signal?: AbortSignal

    tty?

    readonly optional tty?: boolean

    Selects interactive rendered output explicitly. Generated binaries probe process.stdout; the in-process harness defaults to piped output. The same knob shapes the request.terminal the command observes (#511): a synthetic 80×24 basic-color terminal on both streams, or two color-free pipes. Inject context.terminal to choose other values.


    LoadedRouteModule

    The evaluated module loadRouteModule returns: the same object the generated server, the routed CLI, and renderRoute execute, so inputSchema and resultSchema are the route's own schema instances by reference (not copies or JSON), config is the module's static config export, and default its component — absent for a plain src/scripts/*.ts module, whose contract is main. Any other named export is reachable through the index signature.

    Type Parameters

    Target

    Target extends string = string

    Indexable

    [exportName: string]: unknown

    Properties

    config?

    readonly optional config?: unknown

    default?

    readonly optional default?: (props) => unknown

    Parameters
    props

    never

    Returns

    unknown

    inputSchema?

    readonly optional inputSchema?: RouteModuleSchema<RouteTargetParsedInput<Target>>

    parse returns the component's input — the caller's input after defaults and transforms.

    resultSchema?

    readonly optional resultSchema?: RouteModuleSchema<RouteTargetResult<Target>>


    LoadRouteModuleOptions

    Properties

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    Loads against an explicit manifest instead of the one the generated configuration registered.


    McpContentBlock

    Properties

    data?

    readonly optional data?: string

    mimeType?

    readonly optional mimeType?: string

    name?

    readonly optional name?: string

    text?

    readonly optional text?: string

    type

    readonly type: string

    uri?

    readonly optional uri?: string


    McpProjectionProvenance

    Where an in-memory projection result came from and what it proves.

    Properties

    manifestDigest

    readonly manifestDigest: string

    projectRoot

    readonly projectRoot: string

    proofLevel

    readonly proofLevel: "mcp-in-memory"

    routeIds

    readonly routeIds: readonly string[]

    Compiled route ids this server registered.

    serverName

    readonly serverName: string

    The MCP server name as the protocol sees it, e.g. curator.


    McpPromptResult

    Properties

    messages

    readonly messages: readonly Readonly<Record<string, unknown>>[]

    provenance

    readonly provenance: McpProjectionProvenance


    McpResourceRead

    Properties

    contents

    readonly contents: readonly Readonly<Record<string, unknown>>[]

    provenance

    readonly provenance: McpProjectionProvenance


    McpSurfaceListing

    Properties

    prompts

    readonly prompts: readonly string[]

    provenance

    readonly provenance: McpProjectionProvenance

    resources

    readonly resources: readonly string[]

    tools

    readonly tools: readonly string[]


    McpToolInvocation

    Properties

    _meta?

    readonly optional _meta?: Readonly<Record<string, unknown>>

    Result-level CallToolResult._meta, projected from Agent.Result metadata.

    content

    readonly content: readonly McpContentBlock[]

    isError

    readonly isError: boolean

    provenance

    readonly provenance: McpProjectionProvenance

    structuredContent?

    readonly optional structuredContent?: unknown


    MediaNodeExpectation

    Properties

    data?

    readonly optional data?: string

    mimeType?

    readonly optional mimeType?: string


    MountedTestState

    One state owner mounted for a whole test rather than one render: the same state handle and noticeLedger for every renderRoute / renderRouteEvents call that spreads MountedTestState.context into its context, a typed snapshot read, the ledger's snapshot, and one close().

    Extends

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentState.AgentStateEventSchemas = AgentState.AgentStateEventSchemas

    Properties

    noticeLedger

    readonly noticeLedger: AgentNoticeLedger

    Inherited from

    MountedTestStateContext.noticeLedger

    state

    readonly state: AgentStateHandle<TState, TEvents>

    Inherited from

    MountedTestStateContext.state

    Methods

    close()

    close(): Promise<void>

    Releases the bindings, closes the owner and its driver, and removes the disposable sqlite root. Idempotent.

    Returns

    Promise<void>

    context()

    context(): MountedTestStateContext<TState, TEvents>

    { noticeLedger, state }, to spread into the context of any number of renders.

    Returns

    MountedTestStateContext<TState, TEvents>

    notices()

    notices(): Promise<AgentNoticeLedgerSnapshot>

    The notice ledger's current snapshot: every notice with its delivery state.

    Returns

    Promise<AgentNoticeLedgerSnapshot>

    read()

    read(): Promise<AgentStateSnapshot<TState>>

    The project state's current snapshot, typed by the mounted definition.

    Returns

    Promise<AgentStateSnapshot<TState>>


    MountedTestStateContext

    The state and noticeLedger context members one mounted test state hands every render.

    Extended by

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentState.AgentStateEventSchemas = AgentState.AgentStateEventSchemas

    Properties

    noticeLedger

    readonly noticeLedger: AgentNoticeLedger

    state

    readonly state: AgentStateHandle<TState, TEvents>


    MountTestStateOptions

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentState.AgentStateEventSchemas = AgentState.AgentStateEventSchemas

    Properties

    definition?

    readonly optional definition?: AgentStateDefinition<TState, TEvents>

    The state definition to mount instead of the manifest's registered state module. It also types state and read(); without it, pass the definition's types as type arguments (mountTestState<State, Events>()).

    driver?

    readonly optional driver?: AgentStateDriver

    A driver of your own, closed with the mount; replaces the disposable-sqlite / memory choice.

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    Mounts the state declared by an explicit manifest instead of the one the generated configuration registered.

    signal?

    readonly optional signal?: AbortSignal


    OpenInstalledHostMcpServerOptions

    Properties

    artifactRoot

    readonly artifactRoot: string

    Root containing agent-bundle.manifest.json and target directories.

    env?

    readonly optional env?: Readonly<Record<string, string>>

    host

    readonly host: InstalledMcpHost

    hostBinaryVersion?

    readonly optional hostBinaryVersion?: string

    Version observed from the real host binary, when that lane invoked one.

    installedRoot

    readonly installedRoot: string

    Host-owned installed plugin root, not the build target directory.

    manifest

    readonly manifest: AgentBundleTestManifest

    server?

    readonly optional server?: string

    sessionEvidence?

    readonly optional sessionEvidence?: string


    PackedContractMatrixOptions

    Properties

    apps?

    readonly optional apps?: ContractAppCoverage

    App route coverage at this boundary; defaults to 'auto'.

    eventRuntime?

    readonly optional eventRuntime?: ContractEventRuntimeAddress

    Read-only status address for the generated event runtime, when this artifact has one.

    fixtures

    readonly fixtures: ContractRouteFixtures

    Route id -> fixture. Every compiled tool, prompt, and resource route on the server must be covered; app routes are auto-covered unless apps: 'explicit'.

    manifest

    readonly manifest: AgentBundleTestManifest

    restart?

    readonly optional restart?: () => Promise<ContractMatrixRestartSession>

    Caller-owned packed restart; it must close the initial session and reopen the same artifact/store.

    Returns

    Promise<ContractMatrixRestartSession>

    server?

    readonly optional server?: string

    session

    readonly session: PackedMcpSession

    An already-open packed session; this entry point never opens or closes it.


    PackedMcpProvenance

    Where a packed session's evidence came from.

    Properties

    entry

    readonly entry: string

    Absolute path of the generated stdio entry that was spawned.

    pid

    readonly pid: number | undefined

    proofLevel

    readonly proofLevel: "packed-stdio" | "packed-deleted-source"

    sourceRemoved?

    readonly optional sourceRemoved?: readonly string[]

    Project-relative paths verified absent immediately before the process spawn.


    PackedMcpSession

    Extends

    • AsyncDisposable

    Properties

    client

    readonly client: Client

    close

    readonly close: () => Promise<void>

    Returns

    Promise<void>

    provenance

    readonly provenance: PackedMcpProvenance

    stderr

    readonly stderr: () => string

    Everything the server wrote to stderr, bounded — stdout is the protocol channel.

    Returns

    string

    Methods

    [asyncDispose]()

    [asyncDispose](): PromiseLike<void>

    Returns

    PromiseLike<void>

    Inherited from

    AsyncDisposable.[asyncDispose]


    PackedMcpSessionOptions

    Properties

    args?

    readonly optional args?: readonly string[]

    Extra argv appended after the entry path.

    cwd?

    readonly optional cwd?: string

    Working directory for the spawned process; defaults to the entry's directory.

    deletedSource?

    readonly optional deletedSource?: DeletedSourceReceipt

    Receipt whose paths must still be absent and whose project root must contain the entry and any explicit cwd before this session may claim deleted-source proof.

    entry

    readonly entry: string

    Absolute path of the generated stdio entry (<artifact>/mcp/<server>.mjs, emitted once at the composite root).

    env?

    readonly optional env?: Readonly<Record<string, string>>

    Environment for the spawned process; defaults to the current one.

    execPath?

    readonly optional execPath?: string

    Node binary to spawn; defaults to the running one.

    name?

    readonly optional name?: string

    Client identity sent in initialize.


    ProgressExpectation

    Properties

    atLeast?

    readonly optional atLeast?: number

    atMost?

    readonly optional atMost?: number

    messages?

    readonly optional messages?: readonly string[]

    Every listed substring must appear in some progress message, in order.


    RenderedRoute

    Extended by

    Type Parameters

    Target

    Target = RenderRouteTarget

    Properties

    document

    readonly document: AgentDocument

    The final Agent Document the real renderer produced.

    invocation

    readonly invocation: AgentRenderInvocation

    progress

    readonly progress: readonly AgentProgressUpdate[]

    Request-scoped progress the route reported. These are not render events; the final-only dispatcher emits no event stream.

    provenance

    readonly provenance: RenderedRouteProvenance

    result?

    readonly optional result?: RouteTargetResult<Target>

    The document value parsed by the route's own resultSchema, typed from that schema once the id is registered; absent when the module exports none.


    RenderedRouteEvents

    Extends

    Type Parameters

    Target

    Target = RenderRouteTarget

    Properties

    document

    readonly document: AgentDocument

    The final Agent Document the real renderer produced.

    Inherited from

    RenderedRoute.document

    events

    readonly events: readonly AgentRenderEvent[]

    Every render event the runtime emitted, in the order it emitted them.

    invocation

    readonly invocation: AgentRenderInvocation

    Inherited from

    RenderedRoute.invocation

    progress

    readonly progress: readonly AgentProgressUpdate[]

    Request-scoped progress the route reported. These are not render events; the final-only dispatcher emits no event stream.

    Inherited from

    RenderedRoute.progress

    provenance

    readonly provenance: RenderedRouteProvenance

    Inherited from

    RenderedRoute.provenance

    result?

    readonly optional result?: RouteTargetResult<Target>

    The document value parsed by the route's own resultSchema, typed from that schema once the id is registered; absent when the module exports none.

    Inherited from

    RenderedRoute.result


    RenderedRouteProvenance

    Where a rendered route came from and what the render proves. Every harness failure reports this block so a red test names the route, the module, the compiler pass behind it, and the level of proof it actually carried.

    Properties

    kind

    readonly kind: RenderableRouteKind

    manifestDigest?

    readonly optional manifestDigest?: string

    The manifest digest when the route came from the compiler; absent for a module rendered directly.

    modulePath?

    readonly optional modulePath?: string

    Absolute module path when known.

    projectRoot?

    readonly optional projectRoot?: string

    proofLevel

    readonly proofLevel: AgentTestProofLevel

    relativePath?

    readonly optional relativePath?: string

    Project-relative POSIX path when the route came from the compiler.

    routeId

    readonly routeId: string

    serverId?

    readonly optional serverId?: string

    source

    readonly source: "manifest" | "module"

    manifest when the compiler named the route; module when the test passed a module in.

    targets

    readonly targets: readonly string[]

    The project's selected host targets. Route-unit rendering is target-neutral.


    RenderEventAssertions

    Properties

    toBeBoundedBy

    readonly toBeBoundedBy: (maxEvents) => RenderEventAssertions

    Asserts a total event count ceiling — the #120 bound that keeps tolerance honest.

    Parameters
    maxEvents

    number

    Returns

    RenderEventAssertions

    toCompleteOnce

    readonly toCompleteOnce: () => RenderEventAssertions

    Asserts exactly one terminal complete, and that it is last.

    Returns

    RenderEventAssertions

    toContainSequence

    readonly toContainSequence: (expected) => RenderEventAssertions

    Asserts the expected types appear in order, tolerating extra events between them.

    Parameters
    expected

    readonly ("progress" | "error" | "shell" | "replace" | "complete")[]

    Returns

    RenderEventAssertions

    toHaveErrorCode

    readonly toHaveErrorCode: (code?) => RenderEventAssertions

    Asserts an error event, optionally with code.

    Parameters
    code?

    string

    Returns

    RenderEventAssertions

    toHaveMonotonicSequence

    readonly toHaveMonotonicSequence: () => RenderEventAssertions

    Asserts strictly increasing sequence numbers with no repeats or regressions.

    Returns

    RenderEventAssertions

    toHaveNoErrors

    readonly toHaveNoErrors: () => RenderEventAssertions

    Asserts no error event was emitted.

    Returns

    RenderEventAssertions

    toHaveProgress

    readonly toHaveProgress: (expectation?) => RenderEventAssertions

    Asserts progress reporting: a count window and/or ordered message substrings.

    Parameters
    expectation?

    ProgressExpectation

    Returns

    RenderEventAssertions

    toHaveTypes

    readonly toHaveTypes: (expected) => RenderEventAssertions

    Asserts the exact event-type array. Prefer toContainSequence unless the exact frame set is the contract.

    Parameters
    expected

    readonly ("progress" | "error" | "shell" | "replace" | "complete")[]

    Returns

    RenderEventAssertions


    RenderRouteOptionsBase

    Type Parameters

    Target

    Target = RenderRouteTarget

    Properties

    args?

    readonly optional args?: readonly string[]

    CLI route arguments; cli routes only.

    input?

    readonly optional input?: RouteTargetInput<Target>

    The route's input: tool input, event payload, or script input — typed from the route's own schema once the id is registered.

    kind?

    readonly optional kind?: RenderableRouteKind

    Overrides the route kind when a module is rendered directly; ignored for manifest routes.

    limits?

    readonly optional limits?: Partial<AgentRenderLimits>

    The dispatcher's base render limits, as the generated executable's dispatcher has them. A manifest route's compiled config.render budget layers over them exactly as in the generated MCP server and routed CLI; a module rendered directly has no compiled config, so these apply alone.

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    Renders against an explicit manifest instead of the one the generated configuration registered.

    routeId?

    readonly optional routeId?: string

    Names a module rendered directly, so failure diagnostics carry a route identity.

    signal?

    readonly optional signal?: AbortSignal


    ResourceNodeExpectation

    Properties

    mimeType?

    readonly optional mimeType?: string

    name?

    readonly optional name?: string

    uri?

    readonly optional uri?: string


    RouteModuleSchema

    A route schema whose parsed value is typed from the route's registration once the id is registered.

    Extends

    • AgentRouteSchema

    Type Parameters

    Value

    Value

    Properties

    parse

    readonly parse: (value) => Value

    Parameters
    value

    unknown

    Returns

    Value

    Overrides

    AgentRouteSchema.parse


    RunScriptOptionsBase

    Properties

    manifest?

    readonly optional manifest?: AgentBundleTestManifest

    signal?

    readonly optional signal?: AbortSignal

    stdin?

    readonly optional stdin?: string

    Input piped to a plain script's stdin, ended after the last byte. Omitted, the script reads end-of-file at once. A generated executable inherits the invoking terminal's stdin; a test names its input instead. Plain scripts only.

    tty?

    readonly optional tty?: boolean

    Selects interactive rendered output explicitly. Generated executables probe process.stdout; the in-process harness defaults to piped output. The same knob shapes the request.terminal the script observes (#511): a synthetic 80×24 basic-color terminal on both streams, or two color-free pipes. Rendered scripts only; a plain script's main receives the real child process's probe.


    ScriptDispatchProvenance

    Extends

    Properties

    execution

    readonly execution: ScriptExecution

    manifestDigest?

    readonly optional manifestDigest?: string

    The manifest digest when the route came from the compiler; absent for a module rendered directly.

    Inherited from

    RenderedRouteProvenance.manifestDigest

    projectRoot?

    readonly optional projectRoot?: string

    Inherited from

    RenderedRouteProvenance.projectRoot

    proofLevel

    readonly proofLevel: "script-dispatch"

    scripts

    readonly scripts: readonly string[]

    Every conventional script the graph compiled, so a lookup failure can name the alternatives.


    ScriptInvocation

    Properties

    argv

    readonly argv: readonly string[]

    The argv vector as dispatched; for rendered scripts this still includes the --json / --ndjson mode flags.

    exitCode

    readonly exitCode: number

    The process status the contract mapped: rendered scripts exit 0 on a success document and 1 otherwise (2 for conflicting mode flags); plain scripts report their process's exit status — a numeric main return, an assigned process.exitCode, a process.exit call, 1 after an escaped rejection, or 128 + the signal number when a signal ended the process.

    kind

    readonly kind: "plain" | "rendered"

    name

    readonly name: string

    provenance

    readonly provenance: ScriptDispatchProvenance

    routeId

    readonly routeId: string

    stderr

    readonly stderr: string

    Everything the script wrote to its diagnostic stream.

    stdout

    readonly stdout: string

    Everything the script wrote to stdout, including rendered Markdown, TTY, JSON, or NDJSON output.

    value?

    readonly optional value?: unknown

    Rendered scripts: the completed document value the shell passed through. Absent for plain scripts.


    TargetCapabilityFixture

    An explicit target-capability fixture for route-unit projection.

    This is projection-layer proof only. It does not open an MCP transport, start a packed process, or prove that a host accepts any projected block.

    Extends

    Properties

    audio

    readonly audio: boolean

    Inherited from

    TargetCapabilityFixtureInput.audio

    image

    readonly image: boolean

    Inherited from

    TargetCapabilityFixtureInput.image

    progress

    readonly progress: boolean

    Inherited from

    TargetCapabilityFixtureInput.progress

    proofLevel

    readonly proofLevel: "route-unit"

    resource

    readonly resource: boolean

    Inherited from

    TargetCapabilityFixtureInput.resource

    richContentFallback

    readonly richContentFallback: McpRichContentFallback

    Inherited from

    TargetCapabilityFixtureInput.richContentFallback

    text

    readonly text: true


    TargetCapabilityFixtureInput

    The capabilities one route-unit fixture explicitly advertises. Text is not configurable because MCP text is the projector's always-supported baseline. Progress is separate from document content: it controls whether the real MCP event-stream projector receives a progress token and notification sink.

    Extended by

    Properties

    audio

    readonly audio: boolean

    image

    readonly image: boolean

    progress

    readonly progress: boolean

    resource

    readonly resource: boolean

    richContentFallback

    readonly richContentFallback: McpRichContentFallback


    TargetCapabilityProjection

    The real MCP projector's output plus any progress notifications it emitted.

    Properties

    content

    readonly content: readonly McpContentBlock[]

    isError

    readonly isError: boolean

    progress

    readonly progress: readonly McpProgressNotificationParams[]

    provenance

    readonly provenance: RenderedRouteProvenance

    structuredContent?

    readonly optional structuredContent?: unknown


    TestableAppDescriptor

    One normalized MCP App declaration addressable by the browser proof level.

    Properties

    _meta?

    readonly optional _meta?: Readonly<Record<string, unknown>>

    id

    readonly id: string

    name

    readonly name: string

    prebuilt?

    readonly optional prebuilt?: true

    relativePath

    readonly relativePath: string

    Project-relative POSIX path of the browser entry module.

    resourceUri

    readonly resourceUri: string

    serverIds

    readonly serverIds: readonly string[]

    Every MCP server sharing this identical app declaration.

    source

    readonly source: string

    Absolute browser entry module path.

    targets

    readonly targets: readonly string[]

    template?

    readonly optional template?: string

    Absolute optional HTML shell template path.


    TestableLayoutDescriptor

    One conventional layout module the harness composes around manifest route renders, exactly as generated workers do.

    Properties

    id

    readonly id: string

    layout:root or layout:mcp:<server>.

    relativePath

    readonly relativePath: string

    Project-relative POSIX path of the layout module.

    scope

    readonly scope: CompiledLayoutScope

    serverId?

    readonly optional serverId?: string

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

    source

    readonly source: string

    Absolute layout module path.


    TestableScriptDescriptor

    One conventional src/scripts/<name> module the script-dispatch level can run. rendered is the extension contract (#102 stage 3): .tsx/.jsx scripts render through the Agent renderer, everything else is a plain executable module. Explicit scripts: configuration entries are bundled entries rather than routes, so they never appear here.

    Properties

    name

    readonly name: string

    The path-derived script name (script:verify -> verify).

    relativePath

    readonly relativePath: string

    Project-relative POSIX path of the script module.

    rendered

    readonly rendered: boolean

    routeId

    readonly routeId: string

    source

    readonly source: string

    Absolute script module path.


    TestManifestPluginIdentity

    The project identity a generated MCP server advertises on the wire.

    Properties

    name

    readonly name: string

    packageName?

    readonly optional packageName?: string

    The validated npm package name, absent for unpackaged development projects.

    packageVersion?

    readonly optional packageVersion?: string

    The validated semantic release version, absent for unpackaged development projects.

    version

    readonly version: string


    ValidateClaudePluginOptions

    Properties

    executable?

    readonly optional executable?: string

    loadCheck?

    readonly optional loadCheck?: boolean

    Also run claude --plugin-dir <bundle-dir> plugin list --json after the validation runs and read the plugin's row (default true). plugin validate --strict accepts manifests Claude Code then refuses to load (observed 2.1.250–2.1.260); the listing's errors[] is the only load verdict. Doctor passes false because it runs its own registration proof.

    pluginDirectory

    readonly pluginDirectory: string

    run?

    readonly optional run?: ClaudePluginCommandRunner

    Injectable proof seam. Production always uses the bounded process runner.

    strict?

    readonly optional strict?: boolean

    Promote host warnings to Agent Bundle errors. Claude itself always runs with --strict.

    target

    readonly target: string

    version?

    readonly optional version?: string

    The claude --version number the caller already probed from the same executable; skips this run's own probe (Doctor validates several directories per host and probes once).


    ValidateCodexPluginOptions

    Properties

    executable?

    readonly optional executable?: string

    pluginDirectory

    readonly pluginDirectory: string

    run?

    readonly optional run?: CodexPluginCommandRunner

    Injectable proof seam. Production always uses the bounded process runner.

    strict?

    readonly optional strict?: boolean

    Promote live-schema drift to an Agent Bundle error.

    target

    readonly target: string


    ValidateCursorPluginOptions

    Properties

    executable?

    readonly optional executable?: string

    pluginDirectory

    readonly pluginDirectory: string

    run?

    readonly optional run?: CursorPluginCommandRunner

    Injectable proof seam. Production always uses the bounded process runner.

    target

    readonly target: string


    WorkbenchCapabilityCounts

    The capability counts the Workbench derives its navigation from, as the built artifact's inventory would list them: one instance per hook, MCP server, or script declaration per selected target it names (a hook shipped to two hosts counts twice; a declaration whose targets select none of the project's targets emits nothing and counts nothing), plus the declared Skills, eval suites, and targets.

    Properties

    evalSuites

    readonly evalSuites: number

    hooks

    readonly hooks: number

    mcpServers

    readonly mcpServers: number

    scripts

    readonly scripts: number

    skills

    readonly skills: number

    targets

    readonly targets: number


    WorkbenchRouteCatalog

    Properties

    diagnostics

    readonly diagnostics: readonly Diagnostic[]

    digest

    readonly digest: string

    groups

    readonly groups: readonly WorkbenchRouteCatalogGroup[]

    providers

    readonly providers: readonly ArtifactManifestProvider[]

    routeCount

    readonly routeCount: number

    The number of compiled routes in the catalog.

    servers

    readonly servers: readonly WorkbenchRouteCatalogServer[]

    stateDefinition?

    readonly optional stateDefinition?: StateDefinitionProjection

    The effective state declaration; absent when the project declares none.


    WorkbenchRouteCatalogEntry

    One route as the Workbench catalog lists it: the manifest route plus, for CLI routes, its compiled command.

    Properties

    command?

    readonly optional command?: ArtifactManifestCliCommand

    commandUsage?

    readonly optional commandUsage?: string

    The <bin> <command> … usage line the route workspace renders for a CLI command.

    route

    readonly route: RouteManifestRoute


    WorkbenchRouteCatalogGroup

    One catalog section, exactly as the application tree groups them: per server and kind for MCP routes (curator · Tools), project-level for event routes, CLI commands, and scripts.

    Properties

    entries

    readonly entries: readonly WorkbenchRouteCatalogEntry[]

    kind

    readonly kind: CompiledRouteKind

    label

    readonly label: string

    The heading text the application tree renders for this group.

    mode?

    readonly optional mode?: string

    server?

    readonly optional server?: string

    serverId?

    readonly optional serverId?: string


    WorkbenchRouteCatalogServer

    Properties

    id

    readonly id: string

    mode

    readonly mode: CompiledServerMode

    name

    readonly name: string

    routeCount

    readonly routeCount: number


    WorkbenchSurface

    Properties

    advanced

    readonly advanced: readonly AdvancedSection[]

    application

    readonly application: ApplicationTree

    catalog

    readonly catalog: WorkbenchRouteCatalog

    counts

    readonly counts: WorkbenchCapabilityCounts

    lifecycles

    readonly lifecycles: readonly Lifecycle[]

    Every event route with the concrete hosts and starter fixtures available for replay.

    manifest

    readonly manifest: RouteManifest

    Exactly the wire body of GET /api/routes/manifest.

    provenance

    readonly provenance: WorkbenchSurfaceProvenance


    WorkbenchSurfaceFromGraphInput

    Properties

    configPath?

    readonly optional configPath?: string

    counts

    readonly counts: WorkbenchCapabilityCounts

    graph

    readonly graph: CompiledRouteGraph

    inspection?

    readonly optional inspection?: Readonly<{ hooks: readonly ApplicationTreeInspectionHook[]; mcpServers: readonly ApplicationTreeInspectionMcpServer[]; scripts: readonly ApplicationTreeInspectionScript[]; }>

    lifecycles

    readonly lifecycles: LifecycleListResponse

    notices?

    readonly optional notices?: NormalizedNotices

    projectRoot

    readonly projectRoot: string

    skills?

    readonly optional skills?: readonly object[]

    sourceRevision

    readonly sourceRevision: string

    state?

    readonly optional state?: NormalizedStateDefinition

    staticDocuments?

    readonly optional staticDocuments?: readonly ServedStaticDocument[]

    targets

    readonly targets: readonly string[]


    WorkbenchSurfaceProvenance

    Properties

    configPath?

    readonly optional configPath?: string

    manifestDigest

    readonly manifestDigest: string

    projectRoot

    readonly projectRoot: string

    proofLevel

    readonly proofLevel: "workbench-surface"

    sourceRevision

    readonly sourceRevision: string

    The compiler pass revision the dev server would stamp on the manifest.

    targets

    readonly targets: readonly string[]

    Type Aliases

    AdvancedSection

    AdvancedSection = "artifact" | "evals" | "hosts" | "logs" | "protocol"

    A content-bearing destination within the Workbench's Advanced area.


    AgentDocumentNodeKind

    AgentDocumentNodeKind = AgentDocumentNode["kind"]


    AgentProviderModuleLoader

    AgentProviderModuleLoader = () => Promise<{ default?: unknown; }>

    Returns

    Promise<{ default?: unknown; }>


    AgentRenderEventType

    AgentRenderEventType = AgentRenderEvent["type"]


    AgentRouteModuleLoader

    AgentRouteModuleLoader = () => Promise<AgentRouteModule>

    Returns

    Promise<AgentRouteModule>


    AgentTestErrorCode

    AgentTestErrorCode = "assertion-failed" | "command-not-found" | "contract-violation" | "deleted-source-unverified" | "invalid-input" | "invalid-route-module" | "manifest-unavailable" | "packed-unavailable" | "projection-failed" | "render-failed" | "result-rejected" | "route-not-found" | "script-not-found" | "server-not-found" | "unsupported-rich-content" | "unsupported-route-kind"


    AgentTestProofLevel

    AgentTestProofLevel = "route-unit" | "mcp-in-memory" | "dev-epoch" | "cli-dispatch" | "script-dispatch" | "workbench-surface" | "packed-stdio" | "packed-deleted-source" | "browser-app" | "simulated" | "host-install"

    The proof level one harness helper supplies. The levels are deliberately separate and separately named: a pass at one is never a receipt for another, and every helper stamps the level it actually carried into its provenance and its failure text.

    • route-unit renders a route module through the real Agent renderer. No transport, no browser surface, no host artifact.
    • mcp-in-memory runs the real generated MCP server against a real MCP client over the SDK's in-memory transport pair. It proves the protocol contract — registration, schemas, content projection — and proves nothing about a process, stdout framing, or a packed artifact.
    • dev-epoch opens an epoch-pinned generated stdio entry through the Workbench session service and drives its real process. It proves the generated development artifact, not packed or native-host provenance.
    • cli-dispatch runs an argv vector through the routed CLI's own shell over the compiled command graph, in this process. It proves command resolution, argv projection, and exit codes, not a spawned binary.
    • script-dispatch runs one conventional src/scripts/* module through the contract its generated scripts/<name>.mjs executable carries: a rendered .tsx script through the rendered-script shell and its four output modes in this process, a plain .ts script as a Node child process of its own over the source module with the main envelope. It proves the script's behavior and output contract — process exit, streams, and signals included for a plain script — not the bundled artifact.
    • workbench-surface projects the compiled route graph the way the dev server serves it to the Workbench — route catalog, state, lifecycle fixtures, page availability — without a browser or a dev server. It proves what the Workbench would be given, not that the Workbench rendered it.
    • packed-stdio installs the packed release tarball into a clean consumer, spawns the generated stdio entry as a real process, and drives it with a real MCP client. This is the packed process-and-protocol evidence level.
    • packed-deleted-source carries the packed-stdio proof after project source and configuration have been removed and verified absent. It proves that the generated entry is self-contained; it does not prove native-host install or dispatch, or an install mode that copies the artifact elsewhere.
    • browser-app compiles MCP App HTML through the production Rsbuild profile and mounts it over the product bridge in a real browser page. It does not prove host embedding, a packed artifact, or Workbench behavior.
    • simulated stages an emitted bundle directly into an isolated host-shaped root and spawns its MCP command. It does not prove a host-owned install.
    • host-install installs a built bundle into an isolated real host home through the public install path and observes registration through the host's own CLI. It does not prove session behavior or packed provenance.

    ApplicationGroup

    ApplicationGroup = Readonly<{ key: string; kind: "mcp"; label: "MCP"; servers: readonly ApplicationServerGroup[]; }> | Readonly<{ key: string; kind: Exclude<ApplicationGroupKind, "mcp">; label: string; leaves: readonly ApplicationLeaf[]; }>


    ApplicationGroupKind

    ApplicationGroupKind = "cli" | "events" | "mcp" | "rules" | "scripts" | "skills"


    ApplicationLeafExecution

    ApplicationLeafExecution = "invoke" | "preview" | "document"


    ClaudePluginCommandResult

    ClaudePluginCommandResult = BoundedChildProcessResult<ClaudePluginTermination>


    ClaudePluginCommandRunner

    ClaudePluginCommandRunner = (request) => Promise<ClaudePluginCommandResult>

    Parameters

    request

    BoundedChildProcessRequest

    Returns

    Promise<ClaudePluginCommandResult>


    ClaudePluginValidationStatus

    ClaudePluginValidationStatus = "failed" | "passed" | "unavailable" | "warnings"


    CodexPluginCommandResult

    CodexPluginCommandResult = BoundedChildProcessResult<CodexPluginTermination>


    CodexPluginCommandRunner

    CodexPluginCommandRunner = (request) => Promise<CodexPluginCommandResult>

    Parameters

    request

    BoundedChildProcessRequest

    Returns

    Promise<CodexPluginCommandResult>


    CodexPluginValidationStatus

    CodexPluginValidationStatus = "failed" | "passed" | "unavailable" | "warnings"


    ContractAppCoverage

    ContractAppCoverage = "auto" | "explicit"

    How MCP App routes are covered at boundaries that register app resources.

    • 'auto' (default): app routes need no fixture entry; coverage passes and the sweep reads the compiled ui:// resource. Explicit entries are still accepted.
    • 'explicit': every compiled app route must have a fixture entry ({ kind: 'resource' }), matching the rule for every other route kind.

    Has no effect at mcp-in-memory, where apps are never registered.


    ContractCheckStatus

    ContractCheckStatus = "failed" | "not-applicable" | "passed"


    ContractEventRuntimeAddress

    ContractEventRuntimeAddress = { endpoint: string; endpointId?: never; } | { endpoint?: never; endpointId: string; }


    ContractLifecyclePhase

    ContractLifecyclePhase = "unknown" | "queued" | "running" | "first-progress" | "repeated-progress" | "terminal"


    ContractMatrixClient

    ContractMatrixClient = Pick<Client, "callTool" | "getPrompt" | "listPrompts" | "listResources" | "listTools" | "readResource"> & Partial<ContractMatrixProgressSource>


    ContractMatrixProvenance

    ContractMatrixProvenance = DevEpochMcpProvenance | InstalledHostMcpProvenance | McpProjectionProvenance | PackedMcpProvenance


    ContractRouteFixtures

    ContractRouteFixtures = { readonly [Id in RegisteredRouteId]?: ContractRouteFixture<RegisteredRouteInput<Id>> } & object

    Route id -> fixture, the fixtures member of every contract-matrix entry point. Once the generated .agent-bundle/routes.d.ts registers the project's routes, a registered id's fixture carries that route's registered input in input, inputs, cancellation.input, and its lifecycle transitions (a mistyped literal is rejected at the key), while any other key — an MCP App route, which the registration never lists, or a value typed Record<string, ContractRouteFixture> built dynamically — stays legal with unknown inputs, exactly as before. Without a registration every key is a string and every input unknown.


    CursorPluginCommandResult

    CursorPluginCommandResult = BoundedChildProcessResult<CursorPluginTermination>


    CursorPluginCommandRunner

    CursorPluginCommandRunner = (request) => Promise<CursorPluginCommandResult>

    Parameters

    request

    BoundedChildProcessRequest

    Returns

    Promise<CursorPluginCommandResult>


    CursorPluginValidationStatus

    CursorPluginValidationStatus = "failed" | "passed" | "unavailable" | "warnings"


    DocumentSubject

    DocumentSubject = AgentDocument | RenderedRoute


    HarnessOptionsArguments

    HarnessOptionsArguments<Options> = readonly [Options]

    The trailing options parameter of every harness entry point. It is always optional: a call that omits it mounts the project's conventional providers exactly as the generated request scopes do (see RenderRouteContextInit).

    Type Parameters

    Options

    Options


    InMemoryMcpSessionOptions

    InMemoryMcpSessionOptions<TState, TEvents> = InMemoryMcpSessionOptionsBase<TState, TEvents> & RenderRouteContextInit

    Session options; context holds the request-scoped overrides applied to every route render in this session; omitting it (or its providers) mounts the project's conventional providers exactly as the generated server does (see RenderRouteContextInit).

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentStateEventSchemas = AgentStateEventSchemas


    InstalledHostBinaryVersion

    InstalledHostBinaryVersion = { status: "observed"; value: string; } | { reason: string; status: "unavailable"; }


    InstalledHostCheckName

    InstalledHostCheckName = "component-paths" | "hook-commands" | "manifest-schema" | "mcp-command" | "resources" | "version-digests" | "version-quadruple"


    InvokeCliOptions

    InvokeCliOptions = InvokeCliOptionsBase & RenderRouteContextInit

    Dispatch options; context carries the request-scope overrides for the dispatched command over the runtime's request contract; omitting it (or its providers) mounts the project's conventional providers exactly as the generated executable does (see RenderRouteContextInit).


    LoadRouteModuleConstraint

    LoadRouteModuleConstraint<Target> = string extends Target ? string : RegisteredRouteId | `script:${string}`

    The constraint one loadRouteModule id must satisfy. Conventional scripts are loadable but are not part of the generated route registration (.agent-bundle/routes.d.ts registers tool, resource, prompt, CLI, and event routes), so a script: literal is admitted unchecked while every other literal is checked against the registered ids exactly as renderRoute checks its target; a value typed string stays legal for dynamic lookups, and without a registration every string is legal. The union is spelled inline so a rejection lists the registered ids rather than an alias name.

    Type Parameters

    Target

    Target


    McpInvocationOptions

    McpInvocationOptions<Input, Server> = InMemoryMcpSessionOptions & object

    Options of one wire invocation. Input is the payload a caller sends over the wire — the route's inputSchema input, before the server parses it into what the route receives: invokeMcpTool and getMcpPrompt bind it to the route's registered input (McpRouteInput) when the name is a literal, and it stays unknown — the previous shape — for a dynamic name or an unregistered project. Server is the literal server option, when given; it selects which server's route the name resolves to.

    Type Declaration

    input?

    readonly optional input?: Input

    server?

    readonly optional server?: Server & McpServerConstraint<Server> | McpServerConstraint<Server>

    Type Parameters

    Input

    Input = unknown

    Server

    Server extends string = string


    McpRouteInput

    McpRouteInput<Name, Kind, Server> = Name extends RegisteredMcpRouteName<Kind, McpRouteServer<Server>> ? RegisteredRouteInput<RegisteredMcpRouteId<Kind, McpRouteServer<Server>, Name>> : unknown

    The registered input of the Kind route named Name on Server — on any compiled server when Server is string, a union when two of them register the same name; unknown for a dynamic name or an unregistered project.

    Type Parameters

    Name

    Name extends string

    Kind

    Kind extends RegisteredMcpRouteKind

    Server

    Server extends string = string


    McpRouteNameConstraint

    McpRouteNameConstraint<Name, Kind, Server> = string extends Name ? string : RegisteredMcpRouteName<Kind, McpRouteServer<Server>> & string

    The constraint one protocol name must satisfy — RouteTargetConstraint for the wire helpers. Once the generated .agent-bundle/routes.d.ts registers the project's routes, a string literal must be the protocol name of a registered Kind route on Server (find for tool:curator/find; the editor completes them and a typo is rejected naming the alternatives) — on any compiled server when server is omitted or dynamic — while a value typed string stays legal for dynamic lookups. Without a registration RegisteredMcpRouteName is string, so every name is legal, as before.

    The & string is not a widening: it makes the compiler reduce the alias instantiation to a fresh literal union, so a rejection lists the registered names rather than printing RegisteredMcpRouteName<"tool">.

    Type Parameters

    Name

    Name

    Kind

    Kind extends RegisteredMcpRouteKind

    Server

    Server extends string = string


    McpRouteServer

    McpRouteServer<Server> = Server extends RegisteredMcpServerName ? Server : string

    The server the wire helpers look a name up on: a registered literal narrows the lookup to that server's routes; string (omitted or dynamic) and an unregistered literal — already rejected by McpServerConstraint — match every compiled server, so the one error lands on server.

    Type Parameters

    Server

    Server extends string


    McpServerConstraint

    McpServerConstraint<Server> = string extends Server ? string : RegisteredMcpServerName & string

    The constraint a server option must satisfy: once the project's routes are registered, a literal must name a compiled server (curator for tool:curator/find; a typo is rejected naming the alternatives), while a value typed string stays legal. string for an unregistered project.

    Type Parameters

    Server

    Server


    RenderableRouteKind

    RenderableRouteKind = "cli" | "event-route" | "prompt" | "resource" | "script" | "tool"

    The route kinds the route-unit level renders. app routes are browser surfaces, so the browser proof level owns them; every other compiled kind renders here the way the generated server renders it.


    RenderEventSubject

    RenderEventSubject = readonly AgentRenderEvent[] | { events: readonly AgentRenderEvent[]; provenance?: RenderedRouteProvenance; }

    Anything that carries render events: the raw array or a harness result.


    RenderRouteContext

    RenderRouteContext = Omit<AgentRequestInit, "invocation" | "progress" | "providers" | "signal"> & object

    Request-scoped overrides for one rendered route, over the runtime's own request contract. host, session, actor, workspace, and capabilities are the identity-injection seam for context-dependent route tests; construct observed values with available or unavailable from @agent-bundle/runtime. providers is the opt-out for conventional provider discovery: supplied values seed provider(key); otherwise the harness loads requested factories from src/providers/* as generated scopes do. It stays optional even once the generated .agent-bundle/routes.d.ts augmentation declares provider keys — omitting it runs requested providers, which is the artifact's behavior — while an explicit map seeds only the keys the test supplies, so a fixture can leave a promised value undefined.

    Type Declaration

    invocation?

    readonly optional invocation?: Omit<AgentInvocationInput, "kind">

    progress?

    readonly optional progress?: AgentProgressReporter

    providers?

    readonly optional providers?: Partial<AgentProviderValues>


    RenderRouteContextInit

    RenderRouteContextInit = object

    Optional request context; explicit provider values replace conventional discovery.

    Properties

    context?

    readonly optional context?: RenderRouteContext


    RenderRouteOptions

    RenderRouteOptions<Target> = RenderRouteOptionsBase<Target> & RenderRouteContextInit

    Type Parameters

    Target

    Target = RenderRouteTarget


    RenderRouteTarget

    RenderRouteTarget = AgentRouteModule | string

    What renderRoute accepts: a route module rendered directly, or a route id.


    ResultCompatPolicy

    ResultCompatPolicy = "additive" | "closed"

    Declared serialized-result compatibility policy for tool routes.


    RouteTargetConstraint

    RouteTargetConstraint<Target> = Target extends AgentRouteModule ? AgentRouteModule : string extends Target ? string : RegisteredRouteId

    The constraint one target must satisfy. Once the generated .agent-bundle/routes.d.ts registers the project's routes on @agent-bundle/runtime's Register, a string literal must be one of the registered ids (the editor completes them and a typo is rejected naming the alternatives), while a value typed string stays legal for dynamic lookups and a module target is unaffected. Without a registration RegisteredRouteId is string, so every string is legal, exactly as before.

    renderRoute infers Target from a literal while checking it against this constraint through TanStack Router's ConstrainLiteral shape, (Target & Constraint) | Constraint, spelled inline in each signature so the rejection message lists the registered ids rather than an alias name.

    Type Parameters

    Target

    Target


    RouteTargetInput

    RouteTargetInput<Target> = Target extends RegisteredRouteId ? RegisteredRouteInput<Target> : unknown

    The registered input type of a route target; unknown for a module target, a dynamic string, or an unregistered project.

    Type Parameters

    Target

    Target


    RouteTargetParsedInput

    RouteTargetParsedInput<Target> = Target extends RegisteredRouteId ? RegisteredRouteParsedInput<Target> : unknown

    The registered parsed input of a route target — what its component receives after defaults and transforms; unknown when unregistered.

    Type Parameters

    Target

    Target


    RouteTargetResult

    RouteTargetResult<Target> = Target extends RegisteredRouteId ? RegisteredRouteResult<Target> : unknown

    The registered result type of a route target; unknown for a module target, a dynamic string, or an unregistered project.

    Type Parameters

    Target

    Target


    RunScriptOptions

    RunScriptOptions = RunScriptOptionsBase & RenderRouteContextInit

    Run options. context carries the request-scope overrides for a rendered script over the runtime's request contract (see RenderRouteContextInit): omitted, the harness mounts the project's src/providers/* with the script invocation exactly as the generated executable does before the component renders, and context.providers substitutes a fixture map. A plain script has no request scope and accepts no context.


    ScriptExecution

    ScriptExecution = "main-envelope" | "rendered-shell" | "self-executing"

    How one script module executed at this level.

    Variables

    AGENT_TEST_REGISTRY_VERSION

    const AGENT_TEST_REGISTRY_VERSION: 7 = 7

    Bumped whenever the registry layout changes so a setup module and the helpers reading it never silently disagree about what the registry carries. 4: providerLoaders (conventional context providers mounted by the harness). 5: layoutLoaders (conventional layouts composed around manifest renders). 6: manifest.scripts (the script-dispatch level's inventory). 7: projectionLoaders (explicit CLI projection modules).


    BROWSER_APP_PROOF_LEVEL

    const BROWSER_APP_PROOF_LEVEL: "browser-app"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    CLI_DISPATCH_PROOF_LEVEL

    const CLI_DISPATCH_PROOF_LEVEL: "cli-dispatch"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    cliJson

    const cliJson: (invocation) => unknown

    The parsed canonical JSON line a successful command wrote to stdout.

    Parameters

    invocation

    CliInvocation

    Returns

    unknown


    cliNdjson

    const cliNdjson: (invocation) => readonly CliRenderedEvent[]

    The ordered render events a successful --ndjson invocation wrote to stdout.

    Parameters

    invocation

    CliInvocation

    Returns

    readonly CliRenderedEvent[]


    compileTestManifest

    const compileTestManifest: (options?) => Promise<AgentBundleTestManifest>

    Compiles one project's test manifest from the same preparation the build and inspect run: configuration load, conventional discovery (which owns route-graph compilation), normalization, and validation. No artifact is built and no bundler runs, so route-unit tests get the manifest without a build.

    The compiler is reached through a dynamic import on purpose: the generated Rstest configuration compiles the manifest once in the runner process and hands it to workers, so a test worker that only renders routes never loads the compiler at all.

    Parameters

    options?

    CompileTestManifestOptions

    Returns

    Promise<AgentBundleTestManifest>


    createEventRouteInput

    const createEventRouteInput: <E>(event, native, options) => AgentEventRouteInput<E>

    Builds the renderRoute input of an event route from one host-native envelope, exactly as the generated wrapper does: the envelope is validated per host and event, frozen as native, and projected into the family's canonical payload through the same table the artifact uses (#466). A route test therefore reads canonical.payload.toolName from a real Claude, Codex, or Cursor fixture instead of hand-writing the identity.

    const rendered = await renderRoute('event:tool/after', {
      input: createEventRouteInput('tool/after', claudeFixture, { host: 'claude' }),
    });

    Type Parameters

    E

    E extends CanonicalAgentEvent

    Parameters

    event

    E

    native

    Readonly<Record<string, unknown>>

    options

    CreateEventRouteInputOptions

    Returns

    AgentEventRouteInput<E>


    createTargetCapabilityFixture

    const createTargetCapabilityFixture: (input) => TargetCapabilityFixture

    Creates an immutable, explicit fixture. No rich capability defaults to supported: callers must choose every boolean and the fallback policy.

    Parameters

    input

    TargetCapabilityFixtureInput

    Returns

    TargetCapabilityFixture


    DEV_EPOCH_PROOF_LEVEL

    const DEV_EPOCH_PROOF_LEVEL: "dev-epoch"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    expectDocument

    const expectDocument: (subject) => DocumentAssertions

    Parameters

    subject

    DocumentSubject

    Returns

    DocumentAssertions


    expectEvents

    const expectEvents: (subject) => RenderEventAssertions

    Parameters

    subject

    RenderEventSubject

    Returns

    RenderEventAssertions


    getMcpPrompt

    const getMcpPrompt: <Name, Server>(prompt, ...[options]) => Promise<McpPromptResult>

    Gets one compiled prompt route through the real protocol. prompt is the wire name (brief for prompt:curator/brief); once registered, a literal is checked against the compiled prompt names (of the literal server, when passed) and input is typed from that route's inputSchema, exactly as invokeMcpTool types a tool.

    Type Parameters

    Name

    Name extends string

    Server

    Server extends string = string

    Parameters

    prompt

    Name & McpRouteNameConstraint<Name, "prompt", Server> | McpRouteNameConstraint<Name, "prompt", Server>

    [options]

    ...HarnessOptionsArguments<McpInvocationOptions<McpRouteInput<Name, "prompt", Server>, Server>>

    Returns

    Promise<McpPromptResult>


    HOST_INSTALL_PROOF_LEVEL

    const HOST_INSTALL_PROOF_LEVEL: "host-install"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    inspectWorkbenchSurface

    const inspectWorkbenchSurface: (options?) => Promise<WorkbenchSurface>

    Runs the dev server's own preparation for one project and projects it the way the Workbench receives it. No artifact is built and no server starts.

    This is the workbench-surface proof level.

    Parameters

    options?

    InspectWorkbenchSurfaceOptions

    Returns

    Promise<WorkbenchSurface>


    invokeCli

    const invokeCli: (argv, ...[options]) => Promise<CliInvocation>

    Dispatches one argv vector through the routed CLI shell in this process and returns its exit code, streams, and validated result.

    This is the cli-dispatch proof level. Nothing is spawned.

    Parameters

    argv

    readonly string[]

    [options]

    ...HarnessOptionsArguments<InvokeCliOptions>

    Returns

    Promise<CliInvocation>


    invokeMcpTool

    const invokeMcpTool: <Name, Server>(tool, ...[options]) => Promise<McpToolInvocation>

    Calls one compiled tool through the real protocol and returns the projected result. mcp-in-memory level: protocol contract proof, not process proof.

    tool is the wire name (find for the route tool:curator/find). Once the project's routes are registered, a literal is checked against the compiled tool names — of the literal server when one is passed, since the session mounts only that server's routes — and input is typed from that route's inputSchema (see McpRouteNameConstraint). The projected structuredContent stays unknown: the wire carries it only for object-valued documents, so the route's resultSchema output is not what every call yields.

    Type Parameters

    Name

    Name extends string

    Server

    Server extends string = string

    Parameters

    tool

    Name & McpRouteNameConstraint<Name, "tool", Server> | McpRouteNameConstraint<Name, "tool", Server>

    [options]

    ...HarnessOptionsArguments<McpInvocationOptions<McpRouteInput<Name, "tool", Server>, Server>>

    Returns

    Promise<McpToolInvocation>


    listMcpSurface

    const listMcpSurface: (...[options]) => Promise<McpSurfaceListing>

    Lists what the generated server actually registered — the cheapest proof that a compiled route reached the protocol at all.

    Parameters

    [options]

    ...HarnessOptionsArguments<InMemoryMcpSessionOptions>

    Returns

    Promise<McpSurfaceListing>


    loadRouteModule

    const loadRouteModule: <Target>(routeId, ...[options]) => Promise<LoadedRouteModule<Target>>

    Loads the evaluated module of one compiled route by its id, through the lazy loader the generated Rstest setup registered for it — the loader renderRoute uses. This is the supported replacement for a hand-maintained list of static import * as m from '../../src/mcp/<server>/tools/<tool>' statements in a schema-identity suite: iterate testManifest().routes and load each id instead (#493).

    The id is checked against the registered route ids exactly as renderRoute checks its target, so a removed placement is a type error (script: ids are not registered and pass unchecked; see LoadRouteModuleConstraint). Outside a pool built with agentBundleRstest() it throws manifest-unavailable, and a manifest describing another project rejects with the same mismatch report renderRoute gives: route loaders are bound to the compilation that produced them. Every renderable kind loads — tools, resources, prompts, event routes, CLI commands, and scripts; App routes are browser builds and are not loadable here (unsupported-route-kind).

    Type Parameters

    Target

    Target extends string

    Parameters

    routeId

    Target & LoadRouteModuleConstraint<Target> | LoadRouteModuleConstraint<Target>

    [options]

    ...HarnessOptionsArguments<LoadRouteModuleOptions>

    Returns

    Promise<LoadedRouteModule<Target>>


    MCP_IN_MEMORY_PROOF_LEVEL

    const MCP_IN_MEMORY_PROOF_LEVEL: "mcp-in-memory"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    mountTestState

    const mountTestState: <TState, TEvents>(...[options]) => Promise<MountedTestState<TState, TEvents>>

    Mounts the project's state definition and notice ledger once, for a journey that spans several renders — record on one event, read on the next — where the fresh per-render owner renderRoute mounts by default would forget everything between calls. The same driver rules apply: a workspace-durable definition opens a disposable sqlite root that close() removes; every other lifetime uses the memory driver. renderRoute and renderRouteEvents honour a caller-supplied state and noticeLedger, so spreading context() into each render's context is the whole wiring; a render that omits them still mounts its own isolated owner. Each render that receives the handles binds the shared owner to its own request signal, exactly as a generated request scope does, so a render's signal still cancels its state operations; read(), notices(), and the handles themselves are bound to options.signal. The owner is held as one request's bindings, so a request-lifetime definition behaves as one long request. Always close() it (or use withTestState).

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentState.AgentStateEventSchemas = AgentState.AgentStateEventSchemas

    Parameters

    [options]

    ...HarnessOptionsArguments<MountTestStateOptions<TState, TEvents>>

    Returns

    Promise<MountedTestState<TState, TEvents>>


    negativeInputsFromJsonSchema

    const negativeInputsFromJsonSchema: (schema) => readonly object[] | undefined

    Derives negative input cases from a tool's ADVERTISED input JSON Schema — the wire contract from listTools, not the route module's zod source.

    Generates, when the schema has top-level object structure:

    • one unknown-extra-key case
    • one missing-required-property case per required field
    • one wrong-JSON-type case per typed top-level property

    Unknown-extra-key tolerance: when the advertised schema declares additionalProperties: false, plain z.object tool routes may still strip unknown keys without a protocol failure. The negative-inputs check records that acceptance when other generated negatives still prove rejection paths.

    Does NOT prove deep nested validation, format constraints, or enum exhaustiveness beyond the top-level object shape the MCP SDK advertises.

    Parameters

    schema

    Record<string, unknown>

    Returns

    readonly object[] | undefined


    openInMemoryMcpServer

    const openInMemoryMcpServer: <TState, TEvents>(...[options]) => Promise<InMemoryMcpSession>

    Opens a real MCP client against the real generated server for one compiled MCP surface, over the SDK's in-memory transport pair.

    Compiled MCP Apps are deliberately not registered: their HTML is a browser build output, and claiming an App resource without it would be exactly the fake this level must not become. App surfaces belong to the browser level.

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentStateEventSchemas = AgentStateEventSchemas

    Parameters

    [options]

    ...HarnessOptionsArguments<InMemoryMcpSessionOptions<TState, TEvents>>

    Returns

    Promise<InMemoryMcpSession>


    openInstalledHostMcpServer

    const openInstalledHostMcpServer: (options) => Promise<InstalledHostMcpSession>

    Discovers an emitted MCP command from a host-owned installed layout, checks the artifact/install boundary, then opens a real stdio client session.

    The running-process version is read only from the live initialize result. The helper also derives the installed generated event-runtime socket so the shared matrix can read WarmRuntimeIdentity without crossing into source.

    Parameters

    options

    OpenInstalledHostMcpServerOptions

    Returns

    Promise<InstalledHostMcpSession>


    openPackedMcpServer

    const openPackedMcpServer: (options) => Promise<PackedMcpSession>

    Spawns a built stdio MCP entry and connects a real MCP client to it.

    The entry must already exist: build the artifact once per suite and reuse the session for every assertion. A connect failure reports the captured stderr, because a generated entry that dies on startup says why there and nowhere else.

    Parameters

    options

    PackedMcpSessionOptions

    Returns

    Promise<PackedMcpSession>


    PACKED_DELETED_SOURCE_PROOF_LEVEL

    const PACKED_DELETED_SOURCE_PROOF_LEVEL: "packed-deleted-source"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    PACKED_STDIO_PROOF_LEVEL

    const PACKED_STDIO_PROOF_LEVEL: "packed-stdio"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    projectTargetCapabilities

    const projectTargetCapabilities: (rendered, fixture) => Promise<TargetCapabilityProjection>

    Reprojects a real route render-event stream through the runtime's projectMcpRenderStream, using exactly the capabilities and fallback the fixture advertises.

    Proof level: route-unit. The events came from the real Agent renderer and the projection is real, but no MCP transport, packed artifact, or host is involved. A denied rich block either becomes the runtime's exact text placeholder or fails closed; this helper never marks it as accepted.

    Parameters

    rendered

    RenderedRouteEvents

    fixture

    TargetCapabilityFixture

    Returns

    Promise<TargetCapabilityProjection>


    proofLevelLabel

    const proofLevelLabel: (level) => string

    One line per level, printed in every harness failure. A red test has to say what the passing case would have proven, or the level discipline is only a naming convention.

    Parameters

    level

    AgentTestProofLevel

    Returns

    string


    readMcpResource

    const readMcpResource: (uri, ...[options]) => Promise<McpResourceRead>

    Reads one compiled resource route by URI through the real protocol.

    Parameters

    uri

    string

    [options]

    ...HarnessOptionsArguments<InMemoryMcpSessionOptions>

    Returns

    Promise<McpResourceRead>


    registerTestRoutes

    const registerTestRoutes: (registry) => void

    Parameters

    registry

    AgentTestRouteRegistry

    Returns

    void


    removeProjectSource

    const removeProjectSource: (options) => Promise<DeletedSourceReceipt>

    Removes a consumer project's conventional source inputs and verifies their absence before minting deleted-source evidence.

    The default set is src plus every root agent-bundle.config.* entry; callers may add project-relative paths for non-conventional inputs. A project with nothing to remove is refused, because absence observed without a deletion is not evidence that the artifact survived source removal.

    Parameters

    options
    extraPaths?

    readonly string[]

    projectRoot

    string

    Returns

    Promise<DeletedSourceReceipt>


    renderRoute

    const renderRoute: <Target>(target, ...[options]) => Promise<RenderedRoute<Target>>

    Renders one route through the real Agent renderer and returns its final Agent Document. The route component executes inside a real request scope, its output is encoded as React Flight, and the runtime's own final-only dispatcher decodes it — the harness owns no second rendering path.

    This is the route-unit proof level: no transport is opened, no browser surface is compiled, and no host artifact is built.

    Type Parameters

    Target

    Target extends RenderRouteTarget

    Parameters

    target

    Target & RouteTargetConstraint<Target> | RouteTargetConstraint<Target>

    [options]

    ...HarnessOptionsArguments<RenderRouteOptions<Target>>

    Returns

    Promise<RenderedRoute<Target>>


    renderRouteEvents

    const renderRouteEvents: <Target>(target, ...[options]) => Promise<RenderedRouteEvents<Target>>

    Renders one route and collects the ordered render-event stream (#140) alongside the final document, for the event matchers in agent-bundle/test. Same proof level and same renderer as renderRoute: this drains the dispatcher's public event stream rather than its final-only entry point.

    Type Parameters

    Target

    Target extends RenderRouteTarget

    Parameters

    target

    Target & RouteTargetConstraint<Target> | RouteTargetConstraint<Target>

    [options]

    ...HarnessOptionsArguments<RenderRouteOptions<Target>>

    Returns

    Promise<RenderedRouteEvents<Target>>


    ROUTE_UNIT_PROOF_LEVEL

    const ROUTE_UNIT_PROOF_LEVEL: "route-unit"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    runContractMatrix

    const runContractMatrix: (options) => Promise<ContractMatrixReport>

    Runs the contract matrix against one compiled MCP server at the mcp-in-memory proof level. Returns a per-route report; throws one aggregated AgentTestError with code contract-violation when any check failed (never first-failure-only).

    Parameters

    options

    ContractMatrixOptions

    Returns

    Promise<ContractMatrixReport>


    runDevEpochContractMatrix

    const runDevEpochContractMatrix: (options) => Promise<ContractMatrixReport>

    Runs #218 stage 4's shared matrix against an already-open dev epoch session. The caller owns the epoch lease and process lifetime so host adoption can settle without replacing or dropping an existing live host connection.

    Parameters

    options

    DevEpochContractMatrixOptions

    Returns

    Promise<ContractMatrixReport>


    runInstalledHostContractMatrix

    const runInstalledHostContractMatrix: (options) => Promise<InstalledHostContractMatrixReport>

    Runs the shared contract matrix over an already-open MCP process discovered and spawned from a host-owned installed layout. The returned report carries the separately observed source/artifact/installed/running version evidence.

    Parameters

    options

    InstalledHostContractMatrixOptions

    Returns

    Promise<InstalledHostContractMatrixReport>


    runPackedContractMatrix

    const runPackedContractMatrix: (options) => Promise<ContractMatrixReport>

    Runs the contract matrix against an already-open packed stdio session. Never opens or closes the session; stamps the session's own proof level. Compiled MCP App routes are covered here (surface + ui:// sweep) and auto-covered without a fixture entry unless apps: 'explicit'.

    Parameters

    options

    PackedContractMatrixOptions

    Returns

    Promise<ContractMatrixReport>


    runScript

    const runScript: (name, argv?, ...[options]) => Promise<ScriptInvocation>

    Runs one conventional script through its generated-executable contract — a rendered script in this process, a plain script as a Node process of its own over the source — and returns its exit code, streams, and (for rendered scripts) the completed document value.

    This is the script-dispatch proof level. Nothing is bundled.

    Parameters

    name

    string

    argv?

    readonly string[]

    [options]

    ...HarnessOptionsArguments<RunScriptOptions>

    Returns

    Promise<ScriptInvocation>


    SCRIPT_DISPATCH_PROOF_LEVEL

    const SCRIPT_DISPATCH_PROOF_LEVEL: "script-dispatch"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    scriptJson

    const scriptJson: (invocation) => unknown

    The parsed canonical JSON line a successful --json rendered-script run wrote to stdout.

    Parameters

    invocation

    ScriptInvocation

    Returns

    unknown


    scriptNdjson

    const scriptNdjson: (invocation) => readonly CliRenderedEvent[]

    The ordered render events a successful --ndjson rendered-script run wrote to stdout.

    Parameters

    invocation

    ScriptInvocation

    Returns

    readonly CliRenderedEvent[]


    SIMULATED_PROOF_LEVEL

    const SIMULATED_PROOF_LEVEL: "simulated"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    testManifest

    const testManifest: () => AgentBundleTestManifest

    The manifest the generated configuration registered for this test process. Throws with the wiring step when nothing is registered — a silent empty manifest would read as "this project declares no routes".

    Returns

    AgentBundleTestManifest


    testManifestFromRouteGraph

    const testManifestFromRouteGraph: (input) => AgentBundleTestManifest

    Projects the compiled route graph into the manifest the harness addresses. The graph is an input here, never recompiled: one compiler pass feeds the build, inspect, and the harness alike.

    Parameters

    input
    apps?

    readonly NormalizedMcpApp[]

    configPath?

    string

    diagnostics?

    readonly Diagnostic[]

    graph

    CompiledRouteGraph

    plugin?

    TestManifestPluginIdentity

    projectRoot

    string

    scripts?

    readonly NormalizedScript[]

    The normalized script inventory; its config-provenance entries decide which conventional routes conflict.

    state?

    NormalizedStateDefinition

    targets?

    readonly string[]

    Returns

    AgentBundleTestManifest


    withTestState

    const withTestState: <TState, TEvents, T>(run, ...[options]) => Promise<T>

    mountTestState scoped to one callback: the mounted state is closed — and its disposable root removed — when run settles, whether it resolved or threw.

    Type Parameters

    TState

    TState = unknown

    TEvents

    TEvents extends AgentState.AgentStateEventSchemas = AgentState.AgentStateEventSchemas

    T

    T = void

    Parameters

    run

    (state) => Promise<T>

    [options]

    ...HarnessOptionsArguments<MountTestStateOptions<TState, TEvents>>

    Returns

    Promise<T>


    WORKBENCH_SURFACE_PROOF_LEVEL

    const WORKBENCH_SURFACE_PROOF_LEVEL: "workbench-surface"

    agent-bundle/test — the consumer test harness helpers.

    Ten Node proof levels ship here, and the browser-safe eleventh level ships from agent-bundle/test/browser. The repository's real-host install proof uses the same level convention. Each helper names the level it supplies, stamps it into its provenance, and prints it in every failure:

    levelhelperwhat it proves
    route-unitrenderRoute, renderRouteEvents, loadRouteModule, mountTestState, withTestState, createTargetCapabilityFixture, projectTargetCapabilitiesthe route component and its document through the real Agent renderer (and the evaluated route module itself, by compiled id; one mounted state shared across a multi-render journey); explicit target-capability projection through the real MCP projector, without transport or host proof
    mcp-in-memoryopenInMemoryMcpServer, invokeMcpTool, readMcpResource, getMcpPrompt, listMcpSurface, runContractMatrixthe real generated MCP server's protocol contract, over the SDK's in-memory transport; MCP App routes are not registered and report not-applicable
    dev-epochrunDevEpochContractMatrixan epoch-pinned generated stdio process opened through the Workbench session service; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    cli-dispatchinvokeCli, cliJson, cliNdjsona compiled plain or rendered CLI command dispatched through the routed CLI's own shell, including rendered output modes, in this process
    script-dispatchrunScript, scriptJson, scriptNdjsona conventional src/scripts/* module run through its generated executable's contract — the rendered-script shell with its four output modes in this process, or the plain main envelope as a Node process of its own over the source — without bundling
    workbench-surfaceinspectWorkbenchSurfacethe compiled route graph projected exactly as the dev server serves it to the Workbench: application tree, route catalog, state, lifecycle fixtures, and Advanced availability, without a browser or dev server
    packed-stdioopenPackedMcpServer, runPackedContractMatrixa built artifact's generated entry running as a real process over stdio; MCP App routes are covered (surface + ui:// sweep) and auto-covered without a fixture
    packed-deleted-sourceremoveProjectSource, openPackedMcpServer({ deletedSource }), runPackedContractMatrixthe packed stdio process still runs after project source and configuration are removed and verified absent; MCP App routes are covered as at packed-stdio
    browser-appmountBrowserApp (agent-bundle/test/browser)production-compiled MCP App HTML mounted over the product bridge in a real browser page
    simulatedopenInstalledHostMcpServer without sessionEvidencean emitted bundle staged directly into an isolated host-shaped root and spawned without a host-owned install
    host-installopenInstalledHostMcpServer, runInstalledHostContractMatrixa built bundle staged into an isolated host root, discovered in the host's emitted format, and spawned from the installed layout; MCP App routes are covered as at packed-stdio

    Contract-matrix fixtures cover every compiled tool, prompt, and resource route. App routes are auto-covered (apps: 'auto', the default) wherever they are registered; { kind: 'resource' } names one explicitly and apps: 'explicit' requires that for every app route.

    A pass at one level is never a receipt for another. The deletedSource option upgrades openPackedMcpServer provenance only after every path in a non-empty removal receipt is verified absent immediately before spawn.


    workbenchCommandUsage

    const workbenchCommandUsage: (command) => string

    The usage line the route workspace renders: positionals in order, then flags, required ones unbracketed.

    Parameters

    command

    RouteManifestCliCommand

    Returns

    string


    workbenchLeafPath

    const workbenchLeafPath: (leaf) => string

    The Workbench route for one application leaf.

    Parameters

    leaf

    ApplicationLeaf

    Returns

    string


    workbenchRouteCatalog

    const workbenchRouteCatalog: (manifest) => WorkbenchRouteCatalog

    The route catalog derived from one route manifest, by the Workbench's grouping rules.

    Parameters

    manifest

    RouteManifest

    Returns

    WorkbenchRouteCatalog


    workbenchSurfaceFromRouteGraph

    const workbenchSurfaceFromRouteGraph: (input) => WorkbenchSurface

    The pure projection behind inspectWorkbenchSurface: the same routeManifestFor the dev server serves, grouped by the application tree's rules, with Advanced availability applied over the declared counts.

    Parameters

    input

    WorkbenchSurfaceFromGraphInput

    Returns

    WorkbenchSurface

    References

    AgentBundleTestManifest

    Re-exports AgentBundleTestManifest


    ClaudePluginValidationReport

    Re-exports ClaudePluginValidationReport


    CliRenderedEvent

    Re-exports CliRenderedEvent


    CodexPluginValidationReport

    Re-exports CodexPluginValidationReport


    CursorPluginValidationReport

    Re-exports CursorPluginValidationReport


    TestableProviderDescriptor

    Re-exports TestableProviderDescriptor


    TestableRouteDescriptor

    Re-exports TestableRouteDescriptor


    TestableStateDescriptor

    Re-exports TestableStateDescriptor


    validateClaudePlugin

    Re-exports validateClaudePlugin


    validateCodexPlugin

    Re-exports validateCodexPlugin


    validateCursorPlugin

    Re-exports validateCursorPlugin