/**
 * The canonical conversation model.
 *
 * A {@link Conversation} is the provider-neutral request payload: a system
 * preamble, an ordered list of {@link Turn}s, and the {@link ToolDescriptor}s
 * the model is allowed to call. Connectors translate this into each provider's
 * native wire shape.
 */
/** A JSON Schema object describing a tool's parameters. Kept structurally open. */
export type JsonSchema = Record<string, unknown>;
/** A free-form text segment authored by a user, assistant, or tool. */
export interface TextBlock {
    readonly kind: "text";
    readonly text: string;
}
/**
 * A reasoning / chain-of-thought segment. `signature` carries an opaque
 * provider token used to replay verified reasoning back to the model.
 */
export interface ThinkingBlock {
    readonly kind: "thinking";
    readonly text: string;
    readonly signature?: string;
}
/** A request from the assistant to invoke a named tool with structured input. */
export interface ToolCallBlock {
    readonly kind: "tool_call";
    readonly id: string;
    readonly name: string;
    readonly input: unknown;
}
/** The outcome of running a tool, paired back to its originating call by `callId`. */
export interface ToolResultBlock {
    readonly kind: "tool_result";
    readonly callId: string;
    readonly output: unknown;
    readonly isError?: boolean;
}
/** Inline binary media, carried as base64 with an explicit IANA media type. */
export interface ImageBlock {
    readonly kind: "image";
    readonly mediaType: string;
    readonly dataBase64: string;
}
/**
 * An indus-original block representing a shell or MCP command intent the
 * assistant wants to execute. Unlike {@link ToolCallBlock}, this is a
 * lower-level shell-style instruction (program + argv) rather than a
 * structured tool invocation.
 */
export interface CommandBlock {
    readonly kind: "command";
    readonly command: string;
    readonly args?: readonly string[];
}
/** The tagged union of every content fragment that can appear inside a turn. */
export type Block = TextBlock | ThinkingBlock | ToolCallBlock | ToolResultBlock | ImageBlock | CommandBlock;
/** A turn authored by the human/caller side of the conversation. */
export interface UserTurn {
    readonly role: "user";
    readonly blocks: readonly Block[];
}
/** A turn authored by the model. */
export interface AssistantTurn {
    readonly role: "assistant";
    readonly blocks: readonly Block[];
}
/** A turn carrying tool results back into the conversation. */
export interface ToolTurn {
    readonly role: "tool";
    readonly blocks: readonly Block[];
}
/** One conversational message, discriminated by `role`. */
export type Turn = UserTurn | AssistantTurn | ToolTurn;
/** Declares a tool the model may call, with JSON-Schema-typed parameters. */
export interface ToolDescriptor {
    readonly name: string;
    readonly description: string;
    readonly parameters: JsonSchema;
}
/** A complete provider-neutral request payload. */
export interface Conversation {
    readonly system?: string;
    readonly turns: readonly Turn[];
    readonly tools?: readonly ToolDescriptor[];
}
