/**
 * Envelope the runtime and its worker exchange. Tool-payload validation is
 * delegated to `ToolRegistry`; this file only checks the envelope shape.
 */
import type { Api, Context, Model, SimpleStreamOptions } from '../ai/types.js';
import { type AgentCommand, type AgentEvent } from './agent-api.js';
import { type HostToolRequest, type HostToolResult, type ToolRegistry } from './host-tool-api.js';
import type { ShortcutXLUsageLogRequestType } from './model-call.js';
import { type ShortcutXLLlmOperation, type ShortcutXLModelStreamEvent } from './model-stream.js';
export declare const WorkerMessageKind: {
    readonly HostToolRequest: "hostToolRequest";
    readonly HostToolResult: "hostToolResult";
    readonly ModelStreamCancel: "modelStreamCancel";
    readonly ModelStreamEvent: "modelStreamEvent";
    readonly ModelStreamRequest: "modelStreamRequest";
    readonly AgentCommandAck: "runtimeCommandAck";
    readonly AgentCommand: "runtimeCommand";
    readonly AgentEvent: "runtimeEvent";
};
export type WorkerMessageKind = (typeof WorkerMessageKind)[keyof typeof WorkerMessageKind];
export interface AgentCommandMessage {
    kind: typeof WorkerMessageKind.AgentCommand;
    commandId: string;
    command: AgentCommand;
    fatalOnError?: boolean;
}
export interface AgentCommandAckMessage {
    kind: typeof WorkerMessageKind.AgentCommandAck;
    commandId: string;
    ok: boolean;
    error?: string;
}
export interface AgentEventMessage {
    kind: typeof WorkerMessageKind.AgentEvent;
    event: AgentEvent;
}
export interface HostToolRequestMessage {
    kind: typeof WorkerMessageKind.HostToolRequest;
    request: HostToolRequest;
}
export interface HostToolResultMessage {
    kind: typeof WorkerMessageKind.HostToolResult;
    result: HostToolResult;
}
export type ShortcutXLAiStreamOptions = Pick<SimpleStreamOptions, 'cacheRetention' | 'headers' | 'maxRetryDelayMs' | 'maxTokens' | 'metadata' | 'reasoning' | 'temperature' | 'transport'> & {
    readonly agentMode?: string;
    readonly fileAttachmentIds?: readonly string[];
    readonly initialFileId?: string;
    readonly interactionMode?: string;
    readonly llmOperation?: ShortcutXLLlmOperation;
    readonly speed?: 'fast' | 'standard';
    readonly userMessageId?: string;
};
export type ShortcutXLAiInvokeOptions = Pick<SimpleStreamOptions, 'cacheRetention' | 'headers' | 'maxRetryDelayMs' | 'maxTokens' | 'metadata' | 'reasoning' | 'temperature' | 'transport'> & {
    readonly requestType?: ShortcutXLUsageLogRequestType;
    readonly thinkingType?: 'off' | 'on';
    readonly toolChoice?: 'auto' | 'any' | 'none' | 'required' | {
        readonly name: string;
        readonly type: 'tool';
    };
    readonly userMessageId?: string;
};
export interface ShortcutXLAiModelStreamRequest {
    readonly context: Context;
    readonly model: Model<Api>;
    readonly options?: ShortcutXLAiStreamOptions;
    readonly requestId: string;
}
export interface ShortcutXLAiModelInvokeRequest {
    readonly context: Context;
    readonly model: Model<Api>;
    readonly options?: ShortcutXLAiInvokeOptions;
    readonly requestId: string;
}
export interface ModelStreamRequestMessage {
    kind: typeof WorkerMessageKind.ModelStreamRequest;
    /**
     * Lossless owned AI context request. Model-call transports consume this boundary
     * directly; legacy Shortcut proxy bodies are derived only at the proxy edge.
     */
    aiRequest: ShortcutXLAiModelStreamRequest;
}
export interface ModelStreamEventMessage {
    event: ShortcutXLModelStreamEvent;
    kind: typeof WorkerMessageKind.ModelStreamEvent;
    requestId: string;
}
export interface ModelStreamCancelMessage {
    kind: typeof WorkerMessageKind.ModelStreamCancel;
    requestId: string;
}
export type WorkerMessage = AgentCommandAckMessage | AgentCommandMessage | AgentEventMessage | HostToolRequestMessage | HostToolResultMessage | ModelStreamCancelMessage | ModelStreamEventMessage | ModelStreamRequestMessage;
/** Envelope-shape guard; tool-payload validation goes through the registry. */
export declare function isWorkerMessage(value: unknown, registry: ToolRegistry): value is WorkerMessage;
export declare function isShortcutXLAiModelInvokeRequest(value: unknown): value is ShortcutXLAiModelInvokeRequest;
//# sourceMappingURL=wire.d.ts.map