import { Schema } from "effect";
export declare const ToolErrorSchema: Schema.Struct<{
    readonly code: Schema.String;
    readonly message: Schema.String;
    readonly status: Schema.optional<Schema.Number>;
    readonly details: Schema.optional<Schema.Unknown>;
    readonly retryable: Schema.optional<Schema.Boolean>;
}>;
export type ToolError = typeof ToolErrorSchema.Type;
export declare const ToolHttpMetaSchema: Schema.Struct<{
    readonly status: Schema.Number;
    readonly headers: Schema.$Record<Schema.String, Schema.String>;
}>;
/**
 * Transport metadata for HTTP-backed tools (OpenAPI). Kept beside `data`
 * rather than wrapped around it: `data` stays the upstream payload, while
 * cross-cutting transport facts (pagination Link headers, rate-limit
 * headers) remain reachable for callers that need them.
 */
export type ToolHttpMeta = typeof ToolHttpMetaSchema.Type;
export type ToolResult<T> = {
    readonly ok: true;
    readonly data: T;
    readonly http?: ToolHttpMeta;
} | {
    readonly ok: false;
    readonly error: ToolError;
};
export declare const ToolResult: {
    readonly ok: <T>(data: T, meta?: {
        readonly http?: ToolHttpMeta;
    }) => ToolResult<T>;
    readonly fail: <T = never>(error: ToolError) => ToolResult<T>;
};
export declare const isToolResult: (value: unknown) => value is ToolResult<unknown>;
//# sourceMappingURL=tool-result.d.ts.map