import type { ToolDefinition } from "../../protocol/wire/index.js";
import type { MediaPersistence } from "../infra/media-persistence.js";
import type { PathService } from "./path-service.js";
import type { PermissionRiskLevel } from "./permission-contracts.js";
export interface RuntimeToolContract {
    name: string;
    label: string;
    description: string;
    parameters: Record<string, unknown>;
    category?: string;
    displayName?: {
        key: string;
        fallback: string;
        values?: Partial<Record<string, string>>;
    };
    displayDescription?: {
        key: string;
        fallback: string;
        values?: Partial<Record<string, string>>;
    };
    searchHint?: string;
    isConcurrencySafe?: boolean;
    isReadOnly?: boolean;
    riskLevel?: PermissionRiskLevel;
    isDelete?: boolean;
    isEgress?: boolean;
    egressCarriesData?: boolean;
    isEnabled?: () => boolean;
    shouldDefer?: boolean;
    execute?(toolCallId: string, params: any, signal?: AbortSignal): Promise<{
        content: Array<{
            type: "text" | "image";
            text?: string;
            data?: string;
            mimeType?: string;
        }>;
        details?: Record<string, unknown>;
        imageUrls?: string[];
    }>;
}
export interface ToolCatalog {
    findTool(name: string): RuntimeToolContract | undefined;
    getToolManifest(includeDeferred?: boolean): ToolDefinition[];
    getToolNames(): string[];
    setTools(tools: RuntimeToolContract[]): void;
    addTool(tool: RuntimeToolContract): void;
    addTools(tools: RuntimeToolContract[]): void;
    removeTool(name: string): boolean;
    activateTool(name: string): boolean;
    clearActivatedTools(): void;
}
export interface ToolBootstrapProgress {
    output: string;
    elapsedTimeSeconds: number;
    totalLines: number;
    totalBytes: number;
}
export interface ToolBootstrapConfig {
    workdir?: string;
    toolCatalog?: ToolCatalog;
    pathService?: PathService;
    mediaPersistence?: MediaPersistence;
    log?: {
        info(message: string): void;
        warn(message: string): void;
        error(message: string): void;
        debug(message: string): void;
    };
    getTaskScopeKey?(): string | undefined;
    onExecProgress?(progress: ToolBootstrapProgress): void;
}
export interface ToolBootstrap {
    getAllBaseTools(config?: ToolBootstrapConfig): RuntimeToolContract[];
    setWorkdir(dir: string): void;
}
export interface ToolBootstrapProviderContext {
    config?: ToolBootstrapConfig;
}
export interface ToolBootstrapProvider {
    id: string;
    kind?: ToolRegistrationModuleKind;
    register(tools: RuntimeToolContract[], context: ToolBootstrapProviderContext): void;
}
export type ToolRegistrationModuleKind = "core" | "dev" | "web" | "mcp" | "plugin" | "skill" | "local" | "media" | "workflow" | "compat";
export interface ToolRegistrationModule<TContext extends object = Record<string, unknown>> {
    id: string;
    kind: ToolRegistrationModuleKind;
    register(context: TContext): void | Promise<void>;
}
export declare function defineToolRegistrationModule<TContext extends object>(module: ToolRegistrationModule<TContext>): ToolRegistrationModule<TContext>;
