/**
 * Chat Wire Types — fundamental data types that cross the JSON-RPC boundary.
 *
 * These types appear in RPC method params/results (session/prompt, session.resume, etc.)
 * and are needed by every consumer that interacts with the agent.
 */
import type { ToolRiskLevel } from "./web-capability.js";
export type { ToolRiskLevel } from "./web-capability.js";
export type ChatMessageRole = "system" | "user" | "assistant" | "tool";
/** Thinking block from Anthropic Messages API (DeepSeek, Claude, etc.) */
export interface ThinkingBlock {
    thinking: string;
    signature: string;
}
/** Tool call within an assistant message. */
export interface ToolCallMessage {
    id: string;
    type: "function";
    function: {
        name: string;
        arguments: string;
    };
}
/**
 * Chat message — the fundamental unit of conversation over JSON-RPC.
 *
 * Used in `session/prompt` params (user sends messages to agent)
 * and `session.resume` result (agent returns conversation history).
 */
export interface ChatMessage {
    role: ChatMessageRole;
    content: string | null;
    /** For assistant messages with tool calls. */
    tool_calls?: ToolCallMessage[];
    /** For tool result messages. */
    tool_call_id?: string;
    /** For tool result messages — tool name. */
    name?: string;
    /** Anthropic thinking blocks — must be passed back to API in subsequent requests. */
    thinkingBlocks?: ThinkingBlock[];
    /** Image URLs for vision-capable models. */
    imageUrls?: string[];
    /** Image detail level: 'auto' | 'low' | 'high' | 'xhigh'. */
    imageDetail?: "auto" | "low" | "high" | "xhigh";
    /** Max image pixels budget (Volcengine image_pixel_limit). */
    imagePixelLimit?: {
        minPixels?: number;
        maxPixels?: number;
    };
    /** Video URLs for video-understanding models. */
    videoUrls?: string[];
    /** Per-video fps for video understanding (0.2-5, default 1). */
    videoFps?: number;
    /** Audio format hint: 'mp3' | 'wav' | 'aac' | 'm4a'. */
    audioFormat?: "mp3" | "wav" | "aac" | "m4a";
    /** Audio URLs for audio-understanding models. */
    audioUrls?: string[];
    /** Pre-uploaded file IDs for document/media understanding. */
    fileIds?: Array<{
        id: string;
        mimeType?: string;
        size?: number;
    }>;
    /** UI-facing structured blocks persisted with transcripts; ignored by model transports. */
    blocks?: Array<Record<string, unknown>>;
}
export type ToolCapabilityCategory = "orchestration" | "filesystem" | "web" | "search" | "memory" | "media" | "developer" | "mcp" | "automation" | "system" | "other";
export interface LocalizedToolText {
    key: string;
    fallback: string;
    values?: Partial<Record<string, string>>;
}
/**
 * Tool definition — wire format as sent over JSON-RPC.
 *
 * Used in `session/prompt` params (host provides available tools)
 * and `tools.list` result (agent reports its tool inventory).
 */
export interface ToolDefinition {
    type: "function";
    function: {
        name: string;
        description: string;
        parameters?: Record<string, unknown>;
    };
    /** Tool scheduling metadata from host manifest (optional). */
    meta?: {
        category?: ToolCapabilityCategory;
        displayName?: LocalizedToolText;
        displayDescription?: LocalizedToolText;
        serialOnly?: boolean;
        parallelSafe?: boolean;
        /** Unified permission risk class. */
        riskLevel?: ToolRiskLevel;
        /** If true, host should request user approval before execution. */
        requiresApproval?: boolean;
        /** Tool is read-only / safe — skip approval even in strict mode. */
        isReadOnly?: boolean;
        /** Tool can cause irreversible side-effects — force approval in default mode. */
        isDangerous?: boolean;
        /** Tool deletes data (files, records, cloud resources). */
        isDelete?: boolean;
        /** Tool sends data or requests to an external service. */
        isEgress?: boolean;
        /** Egress carries user data (true) vs. read-only external query (false). */
        egressCarriesData?: boolean;
    };
}
