export interface ToolOutputStreamMetadata {
    streamId: string;
    seq: number;
}
export interface ToolContext {
    sessionId: string;
    actionId: string;
    projectRoot: string;
    requestedBy: string;
    userId?: string;
    apiKeys?: Record<string, string>;
    providerId?: string;
    model?: string;
    jaitBackend?: string;
    runtimeMode?: string;
    /** Optional long-lived sandbox container for provider-owned thread execution */
    sandboxContainerName?: string;
    /** Optional callback for streaming tool output chunks (e.g. terminal) */
    onOutputChunk?: (chunk: string, metadata?: ToolOutputStreamMetadata) => void;
    /** Optional abort signal — when fired, the tool should stop as soon as possible */
    signal?: AbortSignal;
}
export interface ToolResult {
    ok: boolean;
    message: string;
    data?: unknown;
}
/** JSON Schema for OpenAI function-calling format */
export interface ToolParametersSchema {
    type: "object";
    properties: Record<string, ToolPropertySchema>;
    required?: string[];
}
/** JSON Schema for a single tool parameter property */
export interface ToolPropertySchema {
    type: string;
    description?: string;
    enum?: string[];
    /** For type: "array" — describes the shape of each array element */
    items?: ToolPropertySchema & {
        properties?: Record<string, ToolPropertySchema>;
        required?: string[];
    };
    /** For type: "object" — nested properties */
    properties?: Record<string, ToolPropertySchema>;
    /** For nested objects — which properties are required */
    required?: string[];
}
/**
 * Tool tier determines when a tool's schema is sent to the LLM.
 *
 * - `core`     — Always included in every LLM request (~10 tools).
 *                These are the bread-and-butter tools the agent uses
 *                on nearly every interaction: read, edit, execute,
 *                search, web, todo, jait, agent, tools.list, tools.search.
 * - `standard` — NOT sent in the initial payload. Discovered via
 *                `tools.search` or `tools.list` meta-tools and
 *                dynamically injected into the active schema set.
 * - `external` — MCP / user-provided tools. Never auto-included;
 *                must be explicitly discovered or enabled.
 */
export type ToolTier = "core" | "standard" | "external";
/**
 * Categories group tools for the settings UI and search.
 */
export type ToolCategory = "terminal" | "filesystem" | "os" | "surfaces" | "scheduler" | "gateway" | "screen" | "browser" | "web" | "memory" | "voice" | "agent" | "network" | "meta" | "external";
export type ToolRisk = "low" | "medium" | "high";
export type ToolConsentLevel = "none" | "once" | "always" | "dangerous";
export type ToolSource = "builtin" | "mcp" | `plugin:${string}`;
export interface BuiltinToolSourceMetadata {
    kind: "builtin";
}
export interface McpToolSourceMetadata {
    kind: "mcp";
    serverId?: string;
    serverName?: string;
}
export interface PluginToolSourceMetadata {
    kind: "plugin";
    pluginId: string;
    pluginDisplayName: string;
}
export type ToolSourceMetadata = BuiltinToolSourceMetadata | McpToolSourceMetadata | PluginToolSourceMetadata;
export interface ToolDefinition<TInput = unknown> {
    name: string;
    description: string;
    parameters: ToolParametersSchema;
    /** Tool tier — defaults to 'standard' if not set */
    tier?: ToolTier;
    /** Tool category for grouping in settings UI */
    category?: ToolCategory;
    /** Source of the tool: builtin, MCP, or plugin:<id> */
    source?: ToolSource;
    /** Structured source metadata for plugin/MCP/builtin provenance */
    sourceMetadata?: ToolSourceMetadata;
    /** Baseline risk level for policy defaults and consent UI */
    risk?: ToolRisk;
    /** Suggested consent level when no explicit policy exists yet */
    defaultConsentLevel?: ToolConsentLevel;
    execute(input: TInput, context: ToolContext): Promise<ToolResult>;
}
//# sourceMappingURL=contracts.d.ts.map