/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
import { z } from 'zod'

const ContentBlockRemoteCodec$schema = z.union([z.object({
  'type': z.literal("text"),
  'text': z.string(),
}), z.object({
  'type': z.literal("image"),
  'attachment': z.object({
  'attachmentId': z.intersection(z.string(), z.unknown()),
  'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]),
  'bytes': z.number(),
  'width': z.number(),
  'height': z.number(),
  'name': z.string().optional(),
  'originalDimensions': z.object({
  'width': z.number(),
  'height': z.number(),
}).optional(),
}),
}), z.object({
  'type': z.literal("reasoning"),
  'text': z.string(),
}), z.object({
  'type': z.literal("tool-call"),
  'id': z.intersection(z.string(), z.unknown()),
  'name': z.string(),
  'arguments': z.string(),
}), z.object({
  'type': z.literal("tool-result"),
  'toolCallId': z.intersection(z.string(), z.unknown()),
  'content': z.array(z.lazy(() => ContentBlockRemoteCodec$schema)),
  'isError': z.boolean().optional(),
})])
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_0$schema = z.intersection(z.string(), z.unknown())
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_1$schema = z.intersection(z.string(), z.unknown())
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_2$schema = z.literal("continuable")
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema = z.object({
  'accepted': z.literal(true).readonly(),
})
const _deepseek_ai_dsh_subagent_subagents_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
const _deepseek_ai_dsh_subagent_subagents_list_result$schema = z.object({
  'entries': z.array(z.union([z.intersection(z.object({
  'kind': z.literal("child").readonly(),
  'id': z.intersection(z.string(), z.unknown()).readonly(),
  'activity': z.union([z.literal("running"), z.literal("inactive")]).readonly(),
  'hasChildren': z.boolean().readonly(),
}), z.object({
  'mode': z.literal("one-shot").readonly(),
  'label': z.string().readonly().optional(),
})), z.intersection(z.object({
  'kind': z.literal("child").readonly(),
  'id': z.intersection(z.string(), z.unknown()).readonly(),
  'activity': z.union([z.literal("running"), z.literal("inactive")]).readonly(),
  'hasChildren': z.boolean().readonly(),
}), z.object({
  'mode': z.literal("continuable").readonly(),
  'label': z.string().readonly(),
})), z.object({
  'kind': z.literal("diagnostic").readonly(),
  'id': z.intersection(z.string(), z.unknown()).readonly(),
  'reason': z.union([z.literal("corrupt"), z.literal("unsupported"), z.literal("unavailable")]).readonly(),
})])).readonly(),
  'parentAvailable': z.boolean().readonly(),
})
const _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema = z.object({
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
  'parentSessionId': z.intersection(z.string(), z.unknown()).readonly(),
  'childSessionId': z.intersection(z.string(), z.unknown()).readonly(),
  'mode': z.literal("continuable").readonly(),
  'content': z.array(z.union([z.object({
  'type': z.literal("text"),
  'text': z.string(),
}), z.object({
  'type': z.literal("image"),
  'attachment': z.object({
  'attachmentId': z.intersection(z.string(), z.unknown()),
  'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]),
  'bytes': z.number(),
  'width': z.number(),
  'height': z.number(),
  'name': z.string().optional(),
  'originalDimensions': z.object({
  'width': z.number(),
  'height': z.number(),
}).optional(),
}),
}), z.object({
  'type': z.literal("reasoning"),
  'text': z.string(),
}), z.object({
  'type': z.literal("tool-call"),
  'id': z.intersection(z.string(), z.unknown()),
  'name': z.string(),
  'arguments': z.string(),
}), z.object({
  'type': z.literal("tool-result"),
  'toolCallId': z.intersection(z.string(), z.unknown()),
  'content': z.array(z.lazy(() => ContentBlockRemoteCodec$schema)),
  'isError': z.boolean().optional(),
})])).readonly(),
  'clientTimeZone': z.string().readonly().optional(),
})
const _deepseek_ai_dsh_subagent_subagents_prompt_result$schema = z.object({
  'messageId': z.intersection(z.string(), z.unknown()).readonly(),
})

export const TYPERT = {
  package: '@deepseek-ai/dsh-subagent',
  face: 'host',
  schemas: [
  ],
  invocations: [
    {
      id: '@deepseek-ai/dsh-subagent#subagents/interruptByParent',
      service: 'subagents',
      namespace: 'subagents',
      method: 'interruptByParent',
      invocation: { kind: 'direct' },
      parameters: [
        {
          name: 'childSessionId',
          wire: 'childSessionId',
          source: 'json',
          codec: {
            mode: 'strict',
            typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
            schema: _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_0$schema,
          },
        },
        {
          name: 'parentSessionId',
          wire: 'parentSessionId',
          source: 'json',
          codec: {
            mode: 'strict',
            typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
            schema: _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_1$schema,
          },
        },
        {
          name: 'mode',
          wire: 'mode',
          source: 'json',
          codec: {
            mode: 'strict',
            typeSymbol: '@deepseek-ai/dsh-subagent#subagents/interruptByParent:mode',
            schema: _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_2$schema,
          },
        },
      ],
      result: {
        mode: 'strict',
        typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentInterruptReceipt',
        schema: _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema,
      },
      sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":479,"column":3},
    },
    {
      id: '@deepseek-ai/dsh-subagent#subagents/list',
      service: 'subagents',
      namespace: 'subagents',
      method: 'list',
      implementation: 'remoteExportList',
      invocation: { kind: 'direct' },
      parameters: [
        {
          name: 'parentSessionId',
          wire: 'parentSessionId',
          source: 'json',
          codec: {
            mode: 'strict',
            typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
            schema: _deepseek_ai_dsh_subagent_subagents_list_parameter_0$schema,
          },
        },
      ],
      cancellation: { parameter: 'signal' },
      result: {
        mode: 'strict',
        typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentCatalog',
        schema: _deepseek_ai_dsh_subagent_subagents_list_result$schema,
      },
      sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":406,"column":9},
    },
    {
      id: '@deepseek-ai/dsh-subagent#subagents/prompt',
      service: 'subagents',
      namespace: 'subagents',
      method: 'prompt',
      invocation: { kind: 'direct' },
      parameters: [
        {
          name: 'request',
          wire: 'request',
          source: 'json',
          codec: {
            mode: 'strict',
            typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptRequest',
            schema: _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema,
          },
        },
      ],
      cancellation: { parameter: 'signal' },
      result: {
        mode: 'strict',
        typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptReceipt',
        schema: _deepseek_ai_dsh_subagent_subagents_prompt_result$schema,
      },
      sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":430,"column":9},
    },
  ],
  model: {
    "services": [
      {
        "description": "Named provider registry with one-shot runs, durable discovery, and continuable-child operations.",
        "summary": "Named provider registry with one-shot runs, durable discovery, and continuable-child operations.",
        "tags": [],
        "jsDoc": "/** Named provider registry with one-shot runs, durable discovery, and continuable-child operations. */",
        "key": "subagents",
        "exportName": "SubagentRuntime",
        "members": [
          {
            "kind": "method",
            "name": "startContinuable",
            "signature": "async startContinuable(spec: ContinuableStartSpec): Promise<ContinuableStart>",
            "summary": "Establish one durable continuable child and deliver its initial prompt.",
            "jsDoc": "/**\n * Establish one durable continuable child and deliver its initial prompt.\n * Resolves when the child's inbox accepts that prompt, without waiting for the\n * turn to start or for the message to reach the Session log; any earlier\n * failure rejects with no ids and rolls back the child entirely.\n * @param spec - provider, delegation request, and caller cancellation.\n * @returns the durable child id and the accepted prompt's message id.\n * @throws when continuation services are unavailable or materialization fails.\n */"
          },
          {
            "kind": "method",
            "name": "followup",
            "signature": "async followup( parent: Agent, childId: SessionId, content: ContentBlock[], options: SubagentFollowupOptions, ): Promise<MessageId>",
            "summary": "Deliver one later message to a continuable child as its next FIFO turn.",
            "jsDoc": "/**\n * Deliver one later message to a continuable child as its next FIFO turn. A\n * resident child's Agent inbox accepts it directly (waking a `waiting`\n * Activation), while an absent one is cold-resumed from its persisted\n * Session. The Agent inbox is the only queue, so every accepted message has\n * one observable order.\n * @param parent - the exact live direct parent authorizing this delivery.\n * @param childId - durable child session id.\n * @param content - user-role content to deliver.\n * @param options - the message source fields and caller cancellation, which stops the\n *   operation only before inbox acceptance.\n * @returns the accepted message's inbox id.\n * @throws when continuation services are unavailable, parent authority is\n *   rejected, or the message was not admitted.\n */"
          },
          {
            "kind": "method",
            "name": "interrupt",
            "signature": "interrupt(targetSessionId: SessionId, authority: SubagentInterruptAuthority): void",
            "summary": "Interrupt one live continuable child's current turn under a human parent address or an exact live ancestor Agent.",
            "jsDoc": "/**\n * Interrupt one live continuable child's current turn under a human parent\n * address or an exact live ancestor Agent. Fire-and-return: the cancel\n * signal is issued before this returns, but the target may keep running\n * until it observes the signal. Unclaimed pending inbox work, the Activation,\n * and published descendants are preserved; claimed work is not requeued.\n * Once the interrupted driver is idle, a waking send resumes the parked FIFO\n * queue. An absent target — including a one-shot or unknown id —\n * is an accepted no-op, as is a manager-less composition, which cannot own a\n * live Activation.\n * @param targetSessionId - the durable child session id to interrupt.\n * @param authority - the human parent address or exact live ancestor Agent.\n * @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the\n *   live target.\n */"
          },
          {
            "kind": "method",
            "name": "reportFrom",
            "signature": "async reportFrom( child: Agent, content: ContentBlock[], options: SubagentReportOptions, ): Promise<MessageId>",
            "summary": "Deliver selected content from one live continuable child to its durable direct parent.",
            "jsDoc": "/**\n * Deliver selected content from one live continuable child to its durable\n * direct parent. The child is the authority credential; callers cannot name a\n * recipient. Reporting does not conclude the child's turn or Activation.\n * @param child - exact live reporting child.\n * @param content - selected model-facing content.\n * @param options - parent scheduling and pre-acceptance cancellation.\n * @returns the stable identity of the parent-accepted message.\n * @throws when continuation services are unavailable, sender authorization\n *   fails, or the direct parent is not live.\n */"
          },
          {
            "kind": "method",
            "name": "registerContinuableSetup",
            "signature": "registerContinuableSetup(contribution: ContinuableSetupContribution): () => void",
            "summary": "Compose one deployment capability into every continuable child's unpublished creation context on fresh creation and cold resume.",
            "jsDoc": "/**\n * Compose one deployment capability into every continuable child's\n * unpublished creation context on fresh creation and cold resume. Grants wait\n * for the next Activation; removing the contribution revokes every resident\n * installation immediately.\n * @param contribution - synchronous child-scope installer.\n * @returns the exact Cordis effect disposer.\n */"
          },
          {
            "kind": "method",
            "name": "drainContinuableDescendants",
            "signature": "async drainContinuableDescendants(parents: readonly Agent[]): Promise<void>",
            "summary": "Close continuable admission below exact live parent Agents, stop only their visible descendant Activations synchronously, then await admitted scoped materializations and release those forests child-first.",
            "jsDoc": "/**\n * Close continuable admission below exact live parent Agents, stop only their\n * visible descendant Activations synchronously, then await admitted scoped\n * materializations and release those forests child-first. The scoped cutoff\n * lasts until each exact parent leaves the registry; unrelated parent trees\n * remain live.\n * @param parents - exact host-owned parent Agents entering teardown.\n * @returns once every retained descendant Activation released its `AgentHandle`.\n * @throws an aggregate error after all branches settle when any failed.\n */"
          },
          {
            "kind": "method",
            "name": "drainContinuableChildren",
            "signature": "async drainContinuableChildren(parent: Agent, childIds: readonly SessionId[]): Promise<void>",
            "summary": "Release selected resident continuable direct children of one exact live parent.",
            "jsDoc": "/**\n * Release selected resident continuable direct children of one exact live\n * parent. Other children of the same parent remain admitted and resident.\n * Absent targets and a manager-less composition are accepted no-ops.\n * @param parent - exact live direct parent authorizing the selected release.\n * @param childIds - durable direct-child ids to release when resident.\n * @returns once every selected Activation released its `AgentHandle`.\n * @throws {SubagentError} `UNAUTHORIZED` when a resident target belongs to a\n *   different parent or the supplied parent identity is stale.\n */"
          },
          {
            "kind": "method",
            "name": "listChildren",
            "signature": "listChildren(parentSessionId: SessionId, signal?: AbortSignal): Promise<SubagentListEntry[]>",
            "summary": "Enumerate the parent's direct session-backed subagents without loading or resuming an Agent.",
            "jsDoc": "/**\n * Enumerate the parent's direct session-backed subagents without loading or\n * resuming an Agent. The Session query service supplies one live-preferred\n * corpus and shared point observations; the projection cache supplies\n * immutable descriptor hits without opening cold logs. The registered\n * `subagent` projection remains the sole mode/label classifier.\n *\n * Every query receives `signal`, and the listing rechecks cancellation\n * around each await. Read rejections that settle\n * after an abort become a stable `SubagentError` with code `CANCELLED`.\n * @param parentSessionId - parent session whose direct children are listed.\n * @param signal - caller-owned cancellation forwarded to Session queries\n *   and observed around every read await.\n * @returns children and per-child diagnostics ordered by `createdAt`, then id.\n * @throws {@link SubagentError} when the projection registry or the session\n *   store is not mounted, or the caller cancels the listing.\n */"
          },
          {
            "kind": "method",
            "name": "listDescendants",
            "signature": "listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<SubagentDescendantListEntry[]>",
            "summary": "Enumerate the root's complete session-backed subagent tree in stable pre-order from one live-preferred corpus, without loading or resuming an Agent.",
            "jsDoc": "/**\n * Enumerate the root's complete session-backed subagent tree in stable\n * pre-order from one live-preferred corpus, without loading or resuming an\n * Agent. Ordinary sessions and one-shot children remain traversal nodes so\n * continuable descendants below them are discovered; each returned entry\n * adds its durable `parentId` and root-relative `depth`. Identity resolution,\n * diagnostics, optional persistence, and cancellation follow the same\n * projection-backed contract as {@link listChildren}.\n * @param rootSessionId - session whose complete descendant tree is listed.\n * @param signal - caller-owned cancellation forwarded to persistence reads\n *   and observed around every read await.\n * @returns children and per-candidate diagnostics with tree position, in\n *   stable pre-order.\n * @throws {@link SubagentError} under the same conditions as {@link listChildren}.\n */"
          },
          {
            "kind": "method",
            "name": "remoteExportList",
            "signature": "@Remote('list') async remoteExportList(parentSessionId: SessionId, signal: AbortSignal): Promise<SubagentCatalog>",
            "summary": "Remote face of {@link listChildren} for one browser: the durable listing plus live Agent activity and the delivery-time parent availability hint.",
            "jsDoc": "/**\n * Remote face of {@link listChildren} for one browser: the durable listing\n * plus live Agent activity and the delivery-time parent availability hint.\n * Parent availability is a hint; {@link prompt} performs the authoritative\n * check. Named apart from the provider-name {@link list}, which owns the\n * member.\n * @param parentSessionId - parent session whose direct children are listed.\n * @param signal - carrier cancellation forwarded to Session queries.\n * @returns the catalog view for that parent.\n * @throws {TypertRemoteFailure} `bad-request` for an empty parent id,\n *   `cancelled` for an aborted read, `subagent-projections-unavailable` when\n *   the deployment has no projection registry, otherwise `internal`.\n */"
          },
          {
            "kind": "method",
            "name": "prompt",
            "signature": "@Remote('prompt') async prompt(request: SubagentPromptRequest, signal: AbortSignal): Promise<SubagentPromptReceipt>",
            "summary": "Deliver one browser-authored message to a continuable child through the exact live direct parent, retaining the caller-minted request identity and validated browser zone on the accepted message.",
            "jsDoc": "/**\n * Deliver one browser-authored message to a continuable child through the\n * exact live direct parent, retaining the caller-minted request identity and\n * validated browser zone on the accepted message. Success identifies the\n * message the child's FIFO inbox accepted; later execution is independent of\n * this call.\n * @param request - durable address, minted identity, content, and optional browser zone.\n * @param signal - carrier cancellation, owning the call until inbox acceptance.\n * @returns the accepted message's inbox identity.\n * @throws {TypertRemoteFailure} `bad-request`, `invalid-time-zone`,\n *   `subagent-parent-unavailable`, `subagent-not-resumable`,\n *   `subagent-unauthorized`, `subagent-delivery-unavailable`, `cancelled`, or\n *   `internal`.\n */"
          },
          {
            "kind": "method",
            "name": "interruptByParent",
            "signature": "@Remote('interruptByParent') interruptByParent( childSessionId: SessionId, parentSessionId: SessionId, mode: 'continuable', ): SubagentInterruptReceipt",
            "summary": "Remote face of {@link interrupt} under one durable parent address.",
            "jsDoc": "/**\n * Remote face of {@link interrupt} under one durable parent address. No\n * catalog, history, persistence, or parent Agent lookup runs: the core\n * primitive alone authorizes the address against the live Activation, which\n * is what keeps a live child interruptible while its parent Agent is offline.\n * Absent, idle, and already-completed targets are accepted no-ops there.\n * @param childSessionId - durable child session id to interrupt.\n * @param parentSessionId - durable direct parent whose authority is claimed.\n * @param mode - required continuable-address discriminator.\n * @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.\n * @throws {TypertRemoteFailure} `bad-request` for an empty id,\n *   `subagent-unauthorized` when the address does not own the live target,\n *   otherwise `internal`.\n */"
          },
          {
            "kind": "method",
            "name": "registerProvider",
            "signature": "registerProvider(provider: SubagentProvider): () => void",
            "summary": "Register a provider under its name.",
            "jsDoc": "/**\n * Register a provider under its name. Registration is effect-scoped and HMR\n * safe; removing a provider blocks new starts but does not revoke runs that\n * were already returned to their holders.\n * @param provider - the trusted provider implementation.\n * @returns the exact Cordis effect disposer.\n */"
          },
          {
            "kind": "method",
            "name": "getProvider",
            "signature": "getProvider(name: string): SubagentProvider | undefined",
            "summary": "Look up a provider by name.",
            "jsDoc": "/**\n * Look up a provider by name.\n * @param name - the provider name.\n * @returns the provider, or undefined when absent.\n */"
          },
          {
            "kind": "method",
            "name": "list",
            "signature": "list(): string[]",
            "summary": "List registered provider names in insertion order.",
            "jsDoc": "/**\n * List registered provider names in insertion order.\n * @returns the registered names.\n */"
          },
          {
            "kind": "method",
            "name": "start",
            "signature": "async start(name: string, request: SubagentStartRequest): Promise<SubagentRun>",
            "summary": "Establish a published child on the named provider.",
            "jsDoc": "/**\n * Establish a published child on the named provider. Capability and semantic\n * checks run before delegation. Provider ownership lasts until its promise\n * fulfills; a rejection therefore has no run for the caller to dispose and\n * emits no run lifecycle events. Post-publication turn and infrastructure\n * failures settle through the returned run.\n * @param name - the provider to use.\n * @param request - child label, prompt, parent, signal, and optional capabilities.\n * @returns the published holder-owned run.\n */"
          }
        ],
        "types": [
          {
            "name": "Agent",
            "declaration": "export interface Agent {\n    readonly id: SessionId;\n    readonly options: AgentOptions;\n    readonly session: Session;\n    readonly inbox: Inbox;\n    readonly status: AgentStatus;\n    readonly ctx: Context;\n    cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n    whenIdle(): Promise<void>;\n    runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n    send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n    followup(message: UserMessage): void;\n    steer(message: UserMessage): void;\n    inject(message: UserMessage): void;\n}"
          },
          {
            "name": "AgentCancelCause",
            "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
          },
          {
            "name": "AgentOptions",
            "declaration": "export interface AgentOptions {\n    provider?: string;\n    model?: string;\n    reasoningEffort?: ReasoningEffortId;\n    maxTokens?: number;\n    subagentDepth?: number;\n}"
          },
          {
            "name": "AgentStatus",
            "declaration": "export type AgentStatus = 'idle' | 'running';"
          },
          {
            "name": "ApprovalOutcome",
            "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
          },
          {
            "name": "ApprovalPolicy",
            "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
          },
          {
            "name": "ApprovalRequestId",
            "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
          },
          {
            "name": "AssistantMessage",
            "declaration": "export interface AssistantMessage extends Message {\n    readonly role: 'assistant';\n    readonly source: ModelMessageSource;\n}"
          },
          {
            "name": "AssistantProvenance",
            "declaration": "export interface AssistantProvenance {\n    provider: string;\n    model: string;\n    replayState?: unknown;\n}"
          },
          {
            "name": "AttachmentId",
            "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
          },
          {
            "name": "Branded",
            "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
          },
          {
            "name": "CancelOptions",
            "declaration": "export interface CancelOptions {\n    keepInbox?: boolean | undefined;\n}"
          },
          {
            "name": "CommandId",
            "declaration": "export type CommandId = Branded<'CommandId'>;"
          },
          {
            "name": "CommandSource",
            "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
          },
          {
            "name": "CommandSourceMap",
            "declaration": "export interface CommandSourceMap {\n    user: { kind: 'user'; };\n}"
          },
          {
            "name": "CompactionId",
            "declaration": "export type CompactionId = Branded<'CompactionId'>;"
          },
          {
            "name": "ContentBlock",
            "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
          },
          {
            "name": "ContentBlockMap",
            "declaration": "export interface ContentBlockMap {\n    text: TextBlock;\n    reasoning: ReasoningBlock;\n    image: ImageBlock;\n    'tool-call': ToolCallBlock;\n    'tool-result': ToolResultBlock;\n}"
          },
          {
            "name": "ContentBlockType",
            "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
          },
          {
            "name": "ContextFormed",
            "declaration": "export type ContextFormed = { readonly form?: never; } | { readonly form: 'instructions'; } | { readonly form: 'catalog'; } | { readonly form: 'snapshot'; readonly sections: readonly ContextSnapshotSection[]; } | { readonly form: 'notice'; readonly summary: string; } | { readonly form: 'relay'; } | { readonly form: 'recall'; };"
          },
          {
            "name": "ContextSnapshotSection",
            "declaration": "export interface ContextSnapshotSection {\n    readonly name: string;\n    readonly text: string;\n}"
          },
          {
            "name": "ContinuableCreateRequest",
            "declaration": "export interface ContinuableCreateRequest {\n    readonly sessionId: SessionId;\n    readonly parent: Agent;\n    readonly signal: AbortSignal;\n}"
          },
          {
            "name": "ContinuableCreateSpec",
            "declaration": "export interface ContinuableCreateSpec {\n    readonly seed?: readonly SessionEvent[];\n}"
          },
          {
            "name": "ContinuableSetupContribution",
            "declaration": "export type ContinuableSetupContribution = (childCtx: Context) => () => void;"
          },
          {
            "name": "ContinuableStart",
            "declaration": "export interface ContinuableStart {\n    readonly childId: SessionId;\n    readonly messageId: MessageId;\n}"
          },
          {
            "name": "ContinuableStartSpec",
            "declaration": "export interface ContinuableStartSpec {\n    readonly provider: string;\n    readonly label: string;\n    readonly childId?: SessionId;\n    readonly request: Omit<SubagentStartRequest, 'label' | 'signal' | 'outputSchema'>;\n    readonly signal: AbortSignal;\n}"
          },
          {
            "name": "ContinuableSubagentDescriptorData",
            "declaration": "export interface ContinuableSubagentDescriptorData extends SubagentDescriptorBase {\n    readonly mode: 'continuable';\n    readonly label: string;\n    readonly agentProvider?: string;\n    readonly agentModel?: string;\n    readonly agentReasoningEffort?: ReasoningEffortId;\n    readonly persona?: string;\n    readonly toolFilter?: ToolRestriction;\n}"
          },
          {
            "name": "CoordinatorMessageSource",
            "declaration": "export interface CoordinatorMessageSource {\n    readonly kind: 'coordinator';\n    readonly form: 'relay';\n    readonly senderSessionId: SessionId;\n}"
          },
          {
            "name": "EpochHeader",
            "declaration": "export interface EpochHeader {\n    config: LlmCallConfig;\n    adapterDefaults?: LlmCallConfigAdapterDefaults;\n    system?: string;\n    tools?: ToolSchema[];\n}"
          },
          {
            "name": "FinishReason",
            "declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
          },
          {
            "name": "FinishReasonMap",
            "declaration": "export interface FinishReasonMap {\n    stop: { kind: 'stop'; };\n    'tool-calls': { kind: 'tool-calls'; };\n    'max-tokens': { kind: 'max-tokens'; };\n    aborted: { kind: 'aborted'; failure: LlmFailure; };\n    error: { kind: 'error'; failure: LlmFailure; };\n}"
          },
          {
            "name": "GoalBlockReason",
            "declaration": "export interface GoalBlockReason {\n    readonly code: string;\n    readonly message: string;\n}"
          },
          {
            "name": "GoalChangeMeta",
            "declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
          },
          {
            "name": "GoalClearChangeMeta",
            "declaration": "export interface GoalClearChangeMeta {\n    readonly kind: 'goal/change';\n    readonly version: 1;\n    readonly operation: 'clear';\n    readonly cleared: GoalRef;\n    readonly clearedAt: number;\n}"
          },
          {
            "name": "GoalId",
            "declaration": "export type GoalId = Branded<'GoalId'>;"
          },
          {
            "name": "GoalMessageSource",
            "declaration": "export interface GoalMessageSource {\n    readonly kind: 'goal';\n    readonly goalId: GoalId;\n    readonly revision: number;\n    readonly round: number;\n}"
          },
          {
            "name": "GoalOperation",
            "declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
          },
          {
            "name": "GoalPhase",
            "declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
          },
          {
            "name": "GoalRef",
            "declaration": "export interface GoalRef {\n    readonly id: GoalId;\n    readonly revision: number;\n}"
          },
          {
            "name": "GoalSnapshot",
            "declaration": "export interface GoalSnapshot extends GoalRef {\n    readonly objective: string;\n    readonly phase: GoalPhase;\n    readonly blockedReason?: GoalBlockReason;\n    readonly maxGoalRounds: number;\n}"
          },
          {
            "name": "GoalSnapshotChangeMeta",
            "declaration": "export interface GoalSnapshotChangeMeta {\n    readonly kind: 'goal/change';\n    readonly version: 1;\n    readonly operation: Exclude<GoalOperation, 'clear'>;\n    readonly goal: GoalSnapshot;\n    readonly roundsStarted: number;\n    readonly createdAt: number;\n    readonly updatedAt: number;\n}"
          },
          {
            "name": "ImageAttachmentRef",
            "declaration": "export interface ImageAttachmentRef {\n    attachmentId: AttachmentId;\n    mediaType: ImageMediaType;\n    bytes: number;\n    width: number;\n    height: number;\n    name?: string;\n    originalDimensions?: { width: number; height: number; };\n}"
          },
          {
            "name": "ImageBlock",
            "declaration": "export interface ImageBlock {\n    type: 'image';\n    attachment: ImageAttachmentRef;\n}"
          },
          {
            "name": "ImageMediaType",
            "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
          },
          {
            "name": "Inbox",
            "declaration": "export class Inbox {\n    get nextTurn(): readonly UserMessage[];\n    get nextStep(): readonly UserMessage[];\n    get hasPending(): boolean;\n    clear(): void;\n    claim(target: InboxTarget, turn: number): UserMessage[];\n    append(target: InboxTarget, message: UserMessage): void;\n    prepend(target: InboxTarget, message: UserMessage): void;\n    replace(messageId: MessageId, newMessage: UserMessage): boolean;\n    remove(messageId: MessageId): boolean;\n    splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];\n}"
          },
          {
            "name": "InboxTarget",
            "declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
          },
          {
            "name": "JsonSchemaNode",
            "declaration": "export interface JsonSchemaNode {\n    type?: JsonSchemaType;\n    oneOf?: JsonSchemaNode[];\n    properties?: Record<string, JsonSchemaNode>;\n    required?: string[];\n    additionalProperties?: boolean;\n    items?: JsonSchemaNode;\n    enum?: JsonSchemaScalar[];\n    const?: JsonSchemaScalar;\n    description?: string;\n    title?: string;\n    default?: JsonValue;\n    examples?: JsonValue;\n}"
          },
          {
            "name": "JsonSchemaScalar",
            "declaration": "export type JsonSchemaScalar = string | number | boolean | null;"
          },
          {
            "name": "JsonSchemaType",
            "declaration": "export type JsonSchemaType = 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';"
          },
          {
            "name": "JsonValue",
            "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
          },
          {
            "name": "LlmCallConfig",
            "declaration": "export interface LlmCallConfig {\n    provider: string;\n    model: string;\n    reasoningEffort?: ReasoningEffortId;\n    temperature?: number;\n    maxTokens?: number;\n    stop?: string[];\n}"
          },
          {
            "name": "LlmCallConfigAdapterDefaults",
            "declaration": "export interface LlmCallConfigAdapterDefaults {\n    reasoningEffort?: true;\n    maxTokens?: true;\n}"
          },
          {
            "name": "LlmFailure",
            "declaration": "export interface LlmFailure {\n    readonly message: string;\n    readonly code: string;\n    readonly status?: number;\n    readonly providerRetryAfterMs?: number;\n    readonly requestId?: ProviderRequestId;\n}"
          },
          {
            "name": "Message",
            "declaration": "export interface Message {\n    readonly id: MessageId;\n    readonly role: 'system' | 'user' | 'assistant';\n    readonly content: ContentBlock[];\n    readonly source: MessageSource;\n}"
          },
          {
            "name": "MessageId",
            "declaration": "export type MessageId = Branded<'MessageId'>;"
          },
          {
            "name": "MessageSource",
            "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
          },
          {
            "name": "MessageSourceMap",
            "declaration": "export interface MessageSourceMap {\n    user: { kind: 'user'; };\n    plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n    model: ModelMessageSource;\n    tool: ToolMessageSource;\n    'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n    coordinator: CoordinatorMessageSource;\n    'subagent-report': SubagentReportMessageSource;\n    'subagent-settled': SubagentSettledMessageSource;\n    'skill-invocation': SkillInvocationSource;\n    'team-message': TeamMessageSource;\n    goal: GoalMessageSource;\n    'session-reference': SessionReferenceSource;\n}"
          },
          {
            "name": "ModelMessageSource",
            "declaration": "export interface ModelMessageSource extends AssistantProvenance {\n    kind: 'model';\n}"
          },
          {
            "name": "ModelSelection",
            "declaration": "export interface ModelSelection {\n    readonly provider: string;\n    readonly model: string;\n    readonly reasoningEffort?: string;\n}"
          },
          {
            "name": "ObjectJsonSchema",
            "declaration": "export type ObjectJsonSchema = JsonSchemaNode & { type: 'object'; };"
          },
          {
            "name": "OneShotSubagentDescriptorData",
            "declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n    readonly mode: 'one-shot';\n    readonly label?: string;\n}"
          },
          {
            "name": "ProviderRequestId",
            "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
          },
          {
            "name": "PtcDispatchEventData",
            "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n    isError: boolean;\n    content: ContentBlock[];\n}"
          },
          {
            "name": "PtcDispatchStartEventData",
            "declaration": "export interface PtcDispatchStartEventData {\n    rootCallId: ToolCallId;\n    parentCallId: ToolCallId;\n    subCallId: ToolCallId;\n    name: string;\n    arguments: unknown;\n}"
          },
          {
            "name": "ReasoningBlock",
            "declaration": "export interface ReasoningBlock {\n    type: 'reasoning';\n    text: string;\n}"
          },
          {
            "name": "ReasoningEffortId",
            "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
          },
          {
            "name": "ReplayEnvelope",
            "declaration": "export interface ReplayEnvelope {\n    response: unknown;\n    blocks?: readonly unknown[];\n}"
          },
          {
            "name": "RequestContext",
            "declaration": "export interface RequestContext {\n    provider: string;\n    model: string;\n    contextWindow?: number;\n}"
          },
          {
            "name": "RequestHeaderReason",
            "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
          },
          {
            "name": "ResolvedSubagentStartRequest",
            "declaration": "export interface ResolvedSubagentStartRequest extends SubagentStartRequest {\n    readonly descriptor: SubagentDescriptorData;\n}"
          },
          {
            "name": "SandboxMode",
            "declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
          },
          {
            "name": "Session",
            "declaration": "export class Session {\n    get surface(): SessionSurface;\n    readonly header: SessionHeader;\n    get id(): SessionId;\n    readonly firstLiveSeq: number;\n    get events(): readonly SessionEvent[];\n    get seq(): number;\n    append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n    requestHeader(): EpochHeader | undefined;\n    requestContext(): RequestContext | undefined;\n    deriveMessages(): Message[];\n    deriveEventMessage(event: SessionEvent): Message | null;\n}"
          },
          {
            "name": "SessionEvent",
            "declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: number; time: number; data: SessionEventMap[K]; } & (K extends SurfaceEventType ? { sourceEventSeqs?: number[]; surfaceOp?: SurfaceOp; } : object) }[T];"
          },
          {
            "name": "SessionEventMap",
            "declaration": "export interface SessionEventMap {\n    'turn/start': { turn: number; };\n    'turn/end': { turn: number; reason: TurnEndReason; };\n    'step/start': { turn: number; step: number; };\n    'step/end': { turn: number; step: number; };\n    'user/message': UserMessage;\n    'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n    'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true; };\n    'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n    'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n    'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n    'request/context': RequestContext;\n    'session/end-seed': Record<string, never>;\n    'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n    'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n    'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n    'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n    'tool/code-dispatch-start': PtcDispatchStartEventData;\n    'tool/code-dispatch': PtcDispatchEventData;\n    'agent-preset/selected': { agentPreset: string; };\n    'session/title': SessionTitleEventData;\n    'todo/write': { todos: TodoItem[]; };\n    'model/selection': ModelSelection;\n    'subagent/descriptor': SubagentDescriptorData;\n    'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n    'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n    'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n    'team/member': { version: 1; teamId: TeamId; member: TeamMemberSnapshot; };\n    'team/task': { version: 1; teamId: TeamId; task: TeamTaskSnapshot; };\n    'team/message/queued': { version: 1; teamId: TeamId; message: TeamMessageSnapshot; };\n    'team/message/delivered': { version: 1; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n    'goal/change': GoalChangeMeta;\n    'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n    'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: number; end: number; }; shadowedSeqs: number[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n    'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n    'compaction/prune': { shadowedRange: { start: number; end: number; }; shadowedSeqs: number[]; shadowedTokenCount: number; };\n}"
          },
          {
            "name": "SessionEventType",
            "declaration": "export type SessionEventType = keyof SessionEventMap;"
          },
          {
            "name": "SessionHeader",
            "declaration": "export interface SessionHeader {\n    readonly version: number;\n    readonly id: SessionId;\n    readonly createdAt: number;\n    readonly cwd?: string;\n    readonly parentSession?: SessionId;\n    readonly seedLength?: number;\n    readonly origin?: 'subagent';\n    readonly delegationDepth?: number;\n    readonly agentPreset?: string;\n}"
          },
          {
            "name": "SessionId",
            "declaration": "export type SessionId = Branded<'SessionId'>;"
          },
          {
            "name": "SessionReferenceSource",
            "declaration": "export interface SessionReferenceSource {\n    kind: 'session-reference';\n    form: 'recall';\n    version: 1;\n    references: { sessionId: string; label: string; capturedThroughSeq: number | null; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
          },
          {
            "name": "SessionRequestId",
            "declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
          },
          {
            "name": "SessionSurface",
            "declaration": "export interface SessionSurface {\n    readonly nodes: readonly number[];\n    readonly replaceGeneration: number;\n}"
          },
          {
            "name": "SessionTitleEventData",
            "declaration": "export interface SessionTitleEventData {\n    readonly title: string;\n    readonly messageSeqs: number[];\n    readonly source: SessionTitleSource;\n}"
          },
          {
            "name": "SessionTitleModelProvenance",
            "declaration": "export interface SessionTitleModelProvenance {\n    readonly provider: string;\n    readonly model: string;\n}"
          },
          {
            "name": "SessionTitleProviderId",
            "declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
          },
          {
            "name": "SessionTitleSource",
            "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelProvenance; } | { readonly kind: 'user'; };"
          },
          {
            "name": "SkillInvocationSource",
            "declaration": "export interface SkillInvocationSource {\n    readonly kind: 'skill-invocation';\n    readonly name: string;\n    readonly form: 'instructions';\n}"
          },
          {
            "name": "StreamChunk",
            "declaration": "export type StreamChunk = { type: 'block-start'; index: number; blockType: ContentBlockType; } | { type: 'text-delta'; index: number; text: string; } | { type: 'reasoning-delta'; index: number; text: string; } | { type: 'tool-call-delta'; index: number; id: ToolCallId; name?: string; argumentsDelta: string; } | { type: 'block-end'; index: number; block: ContentBlock; } | { type: 'usage'; usage: TokenUsage; } | { type: 'finish'; reason: FinishReason; replayState?: ReplayEnvelope; };"
          },
          {
            "name": "SubagentCapabilities",
            "declaration": "export interface SubagentCapabilities {\n    readonly agentOptions: boolean;\n    readonly outputSchema: boolean;\n    readonly depthLimit: boolean;\n    readonly toolFilter: boolean;\n    readonly persona: boolean;\n}"
          },
          {
            "name": "SubagentCatalog",
            "declaration": "export interface SubagentCatalog {\n    readonly entries: readonly SubagentListEntry[];\n    readonly parentAvailable: boolean;\n}"
          },
          {
            "name": "SubagentDescendantListEntry",
            "declaration": "export type SubagentDescendantListEntry = SubagentListEntry & { readonly parentId: SessionId; readonly depth: number; };"
          },
          {
            "name": "SubagentDescriptorBase",
            "declaration": "export interface SubagentDescriptorBase {\n    readonly version: number;\n    readonly mode: 'one-shot' | 'continuable';\n    readonly provider: string;\n}"
          },
          {
            "name": "SubagentDescriptorData",
            "declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
          },
          {
            "name": "SubagentFollowupOptions",
            "declaration": "export interface SubagentFollowupOptions {\n    readonly source: MessageSource;\n    readonly signal: AbortSignal;\n}"
          },
          {
            "name": "SubagentInterruptAuthority",
            "declaration": "export type SubagentInterruptAuthority = { readonly kind: 'user'; readonly parentSessionId: SessionId; } | { readonly kind: 'ancestor'; readonly agent: Agent; };"
          },
          {
            "name": "SubagentInterruptReceipt",
            "declaration": "export interface SubagentInterruptReceipt {\n    readonly accepted: true;\n}"
          },
          {
            "name": "SubagentListEntry",
            "declaration": "export type SubagentListEntry = { readonly kind: 'child'; readonly id: SessionId; readonly activity: 'running' | 'inactive'; readonly hasChildren: boolean; } & ({ readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; }) | { readonly kind: 'diagnostic'; readonly id: SessionId; readonly reason: 'corrupt' | 'unsupported' | 'unavailable'; };"
          },
          {
            "name": "SubagentPromptReceipt",
            "declaration": "export interface SubagentPromptReceipt {\n    readonly messageId: MessageId;\n}"
          },
          {
            "name": "SubagentPromptRequest",
            "declaration": "export interface SubagentPromptRequest {\n    readonly requestId: SubagentPromptRequestId;\n    readonly parentSessionId: SessionId;\n    readonly childSessionId: SessionId;\n    readonly mode: 'continuable';\n    readonly content: ContentBlock[];\n    readonly clientTimeZone?: string;\n}"
          },
          {
            "name": "SubagentPromptRequestId",
            "declaration": "export type SubagentPromptRequestId = Branded<'session-request-id'>;"
          },
          {
            "name": "SubagentProvider",
            "declaration": "export interface SubagentProvider {\n    readonly name: string;\n    readonly capabilities: SubagentCapabilities;\n    readonly inheritsParentContext: boolean;\n    readonly agentRouteDefaults?: Readonly<{ provider: string; model: string; }>;\n    start(request: ResolvedSubagentStartRequest): Promise<SubagentRun>;\n    prepareContinuable?(request: ContinuableCreateRequest): Promise<ContinuableCreateSpec>;\n}"
          },
          {
            "name": "SubagentReportDelivery",
            "declaration": "export type SubagentReportDelivery = 'quiet' | 'next-step';"
          },
          {
            "name": "SubagentReportMessageSource",
            "declaration": "export interface SubagentReportMessageSource {\n    readonly kind: 'subagent-report';\n    readonly form: 'relay';\n    readonly senderSessionId: SessionId;\n}"
          },
          {
            "name": "SubagentReportOptions",
            "declaration": "export interface SubagentReportOptions {\n    readonly delivery: SubagentReportDelivery;\n    readonly signal: AbortSignal;\n}"
          },
          {
            "name": "SubagentResult",
            "declaration": "export interface SubagentResult {\n    readonly output: ContentBlock[];\n    readonly structured?: unknown;\n    readonly diagnostic?: string;\n    readonly stopReason: SubagentStopReason;\n}"
          },
          {
            "name": "SubagentRun",
            "declaration": "export interface SubagentRun {\n    readonly id: SessionId;\n    readonly localAgent: Agent | undefined;\n    readonly result: Promise<SubagentResult>;\n    dispose(): Promise<void>;\n}"
          },
          {
            "name": "SubagentSettledMessageSource",
            "declaration": "export interface SubagentSettledMessageSource {\n    readonly kind: 'subagent-settled';\n    readonly form: 'notice';\n    readonly summary: string;\n    readonly senderSessionId: SessionId;\n}"
          },
          {
            "name": "SubagentStartRequest",
            "declaration": "export interface SubagentStartRequest {\n    readonly label?: string;\n    readonly prompt: ContentBlock[];\n    readonly parent: Agent;\n    readonly signal: AbortSignal;\n    readonly agentOptions?: AgentOptions;\n    readonly outputSchema?: ObjectJsonSchema;\n    readonly maxDepth?: number;\n    readonly toolFilter?: ToolRestriction;\n    readonly persona?: string;\n}"
          },
          {
            "name": "SubagentStopReason",
            "declaration": "export type SubagentStopReason = SubagentStopReasonMap[keyof SubagentStopReasonMap];"
          },
          {
            "name": "SubagentStopReasonMap",
            "declaration": "export interface SubagentStopReasonMap {\n    completed: 'completed';\n    aborted: 'aborted';\n    error: 'error';\n    'max-tokens': 'max-tokens';\n    refusal: 'refusal';\n}"
          },
          {
            "name": "SurfaceEventType",
            "declaration": "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
          },
          {
            "name": "SurfaceIntent",
            "declaration": "export interface SurfaceIntent {\n    surfaceOp: SurfaceOp;\n    sourceEventSeqs?: number[];\n}"
          },
          {
            "name": "SurfaceOp",
            "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
          },
          {
            "name": "TeamId",
            "declaration": "export type TeamId = Branded<'TeamId'>;"
          },
          {
            "name": "TeamMemberPhase",
            "declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
          },
          {
            "name": "TeamMemberSnapshot",
            "declaration": "export interface TeamMemberSnapshot {\n    readonly id: SessionId;\n    readonly name: string;\n    readonly description: string;\n    readonly provider: string;\n    readonly context: 'fresh' | 'fork';\n    readonly phase: TeamMemberPhase;\n    readonly error?: string;\n}"
          },
          {
            "name": "TeamMessageId",
            "declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
          },
          {
            "name": "TeamMessageSnapshot",
            "declaration": "export interface TeamMessageSnapshot {\n    readonly id: TeamMessageId;\n    readonly senderId: SessionId;\n    readonly senderName: string;\n    readonly targetId: SessionId;\n    readonly delivery: 'quiet' | 'wakeup';\n    readonly content: ContentBlock[];\n}"
          },
          {
            "name": "TeamMessageSource",
            "declaration": "export interface TeamMessageSource {\n    readonly kind: 'team-message';\n    readonly teamId: TeamId;\n    readonly messageId: TeamMessageId;\n    readonly senderId: SessionId;\n    readonly senderName: string;\n}"
          },
          {
            "name": "TeamTaskId",
            "declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
          },
          {
            "name": "TeamTaskSnapshot",
            "declaration": "export interface TeamTaskSnapshot {\n    readonly id: TeamTaskId;\n    readonly revision: number;\n    readonly subject: string;\n    readonly description: string;\n    readonly status: TeamTaskStatus;\n    readonly ownerId?: SessionId;\n    readonly blockedBy: TeamTaskId[];\n    readonly writeScopes: string[];\n}"
          },
          {
            "name": "TeamTaskStatus",
            "declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
          },
          {
            "name": "TextBlock",
            "declaration": "export interface TextBlock {\n    type: 'text';\n    text: string;\n}"
          },
          {
            "name": "TodoItem",
            "declaration": "export interface TodoItem {\n    content: string;\n    status: 'pending' | 'in_progress' | 'completed';\n}"
          },
          {
            "name": "TokenUsage",
            "declaration": "export interface TokenUsage {\n    inputTokens: number;\n    outputTokens: number;\n    totalTokens?: number;\n    cacheReadTokens?: number;\n    cacheWriteTokens?: number;\n    reasoningTokens?: number;\n}"
          },
          {
            "name": "ToolCallBlock",
            "declaration": "export interface ToolCallBlock {\n    type: 'tool-call';\n    id: ToolCallId;\n    name: string;\n    arguments: string;\n}"
          },
          {
            "name": "ToolCallId",
            "declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
          },
          {
            "name": "ToolMessageSource",
            "declaration": "export interface ToolMessageSource {\n    kind: 'tool';\n    callId: ToolCallId;\n}"
          },
          {
            "name": "ToolRestriction",
            "declaration": "export interface ToolRestriction {\n    readonly allow?: readonly string[];\n    readonly deny?: readonly string[];\n}"
          },
          {
            "name": "ToolResultBlock",
            "declaration": "export interface ToolResultBlock {\n    type: 'tool-result';\n    toolCallId: ToolCallId;\n    content: ContentBlock[];\n    isError?: boolean;\n}"
          },
          {
            "name": "ToolResultMessage",
            "declaration": "export interface ToolResultMessage extends Message {\n    readonly role: 'user';\n    readonly content: [ToolResultBlock];\n    readonly source: ToolMessageSource;\n}"
          },
          {
            "name": "ToolSchema",
            "declaration": "export interface ToolSchema {\n    name: string;\n    description: string;\n    parameters: Record<string, unknown>;\n}"
          },
          {
            "name": "TurnEndCancelCause",
            "declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
          },
          {
            "name": "TurnEndReason",
            "declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
          },
          {
            "name": "TurnEndReasonMap",
            "declaration": "export interface TurnEndReasonMap {\n    completed: { kind: 'completed'; };\n    aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n    blocked: { kind: 'blocked'; };\n    error: { kind: 'error'; error: LlmFailure; };\n    'max-tokens': { kind: 'max-tokens'; };\n    interrupted: { kind: 'interrupted'; };\n}"
          },
          {
            "name": "UserMessage",
            "declaration": "export interface UserMessage extends Message {\n    readonly role: 'user';\n}"
          }
        ]
      }
    ],
    "events": [
      {
        "description": "A published child settled. Scope-filtered dispatch uses the same delegating parent carrier as `subagent/start`, so the lifecycle pair reaches the same scoped audience.",
        "summary": "A published child settled.",
        "tags": [
          {
            "name": "param",
            "argument": "info",
            "comment": "- the run identity and terminal outcome.",
            "text": "@param info - the run identity and terminal outcome.\n     *"
          },
          {
            "name": "dshScopeScan",
            "comment": "unsupported",
            "text": "@dshScopeScan unsupported\n     *"
          },
          {
            "name": "mode",
            "comment": "emit",
            "text": "@mode emit"
          }
        ],
        "jsDoc": "/**\n * A published child settled. Scope-filtered dispatch uses the same delegating\n * parent carrier as `subagent/start`, so the lifecycle pair reaches the\n * same scoped audience.\n * @param info - the run identity and terminal outcome.\n * @dshScopeScan unsupported\n * @mode emit\n */",
        "name": "subagent/end",
        "mode": "emit",
        "signature": "'subagent/end'(this: Scoped<SubagentRuntime>, info: SubagentRunEndInfo): void"
      },
      {
        "description": "A provider became resolvable in the registry.",
        "summary": "A provider became resolvable in the registry.",
        "tags": [
          {
            "name": "param",
            "argument": "provider",
            "comment": "- the registered provider.",
            "text": "@param provider - the registered provider.\n     *"
          },
          {
            "name": "mode",
            "comment": "emit",
            "text": "@mode emit"
          }
        ],
        "jsDoc": "/**\n * A provider became resolvable in the registry.\n * @param provider - the registered provider.\n * @mode emit\n */",
        "name": "subagent/provider-added",
        "mode": "emit",
        "signature": "'subagent/provider-added'(provider: SubagentProvider): void"
      },
      {
        "description": "A provider left the registry. Accepted runs remain holder-owned.",
        "summary": "A provider left the registry.",
        "tags": [
          {
            "name": "param",
            "argument": "name",
            "comment": "- the provider name that no longer resolves.",
            "text": "@param name - the provider name that no longer resolves.\n     *"
          },
          {
            "name": "mode",
            "comment": "emit",
            "text": "@mode emit"
          }
        ],
        "jsDoc": "/**\n * A provider left the registry. Accepted runs remain holder-owned.\n * @param name - the provider name that no longer resolves.\n * @mode emit\n */",
        "name": "subagent/provider-removed",
        "mode": "emit",
        "signature": "'subagent/provider-removed'(name: string): void"
      },
      {
        "description": "A provider established a published child. For in-process providers, `ctx.agents.get(info.id)` resolves during this notification. Scope-filtered dispatch keys the carrier by the delegating parent, so a parent-scoped listener observes only its own delegations. Paired with `subagent/end`.",
        "summary": "A provider established a published child.",
        "tags": [
          {
            "name": "param",
            "argument": "info",
            "comment": "- the provider and published child identity.",
            "text": "@param info - the provider and published child identity.\n     *"
          },
          {
            "name": "dshScopeScan",
            "comment": "unsupported",
            "text": "@dshScopeScan unsupported\n     *"
          },
          {
            "name": "mode",
            "comment": "emit",
            "text": "@mode emit"
          }
        ],
        "jsDoc": "/**\n * A provider established a published child. For in-process providers,\n * `ctx.agents.get(info.id)` resolves during this notification.\n * Scope-filtered dispatch keys the carrier by the delegating parent, so a\n * parent-scoped listener observes only its own delegations. Paired with\n * `subagent/end`.\n * @param info - the provider and published child identity.\n * @dshScopeScan unsupported\n * @mode emit\n */",
        "name": "subagent/start",
        "mode": "emit",
        "signature": "'subagent/start'(this: Scoped<SubagentRuntime>, info: SubagentRunInfo): void"
      }
    ],
    "objects": []
  },
}
