import { type JsonObject, type JsonValue } from "./stable-json.js";
export interface OmkToolContext {
    readonly runId?: string;
    readonly nodeId?: string;
    readonly signal?: AbortSignal;
}
export interface OmkToolDefinition<A = unknown, R = unknown> {
    readonly name: string;
    readonly description?: string;
    readonly parameters?: JsonObject;
    readonly readOnly?: boolean;
    readonly readOnlyCheck?: (args: A) => boolean;
    readonly parallelSafe?: boolean;
    readonly stormExempt?: boolean;
    readonly skipRetentionSave?: boolean;
    readonly fn: (args: A, ctx: OmkToolContext) => Promise<R> | R;
}
export interface OmkToolPrefixSpec {
    readonly name: string;
    readonly description?: string;
    readonly parameters?: JsonValue;
    readonly readOnly: boolean;
    readonly parallelSafe: boolean;
    readonly stormExempt: boolean;
    readonly skipRetentionSave: boolean;
}
export interface OmkToolCall<A = unknown> {
    readonly toolName: string;
    readonly args: A;
}
export type OmkToolExecutionBatchKind = "parallel" | "serial";
export interface OmkToolExecutionBatch<A = unknown> {
    readonly kind: OmkToolExecutionBatchKind;
    readonly calls: readonly OmkToolCall<A>[];
}
export declare function toToolPrefixSpec(definition: OmkToolDefinition): OmkToolPrefixSpec;
export declare function sortToolPrefixSpecs(specs: readonly OmkToolPrefixSpec[]): OmkToolPrefixSpec[];
export declare function toSortedToolPrefixSpecs(definitions: readonly OmkToolDefinition[]): OmkToolPrefixSpec[];
export declare function isToolReadOnly<A>(definition: OmkToolDefinition<A>, args: A): boolean;
export declare function createToolExecutionBatches<A>(calls: readonly OmkToolCall<A>[], registry: ReadonlyMap<string, OmkToolDefinition<A>>): OmkToolExecutionBatch<A>[];
