import { Effect, 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 declare const ToolFileSchema: Schema.TaggedStruct<"ToolFile", {
    readonly name: Schema.optional<Schema.String>;
    readonly mimeType: Schema.String;
    readonly encoding: Schema.Literal<"base64">;
    readonly data: Schema.String;
    readonly byteLength: Schema.Int;
}>;
export type ToolFile = typeof ToolFileSchema.Type;
export declare const ToolFileJsonSchema: import("effect/JsonSchema").JsonSchema;
export declare const isToolFile: (value: unknown) => value is ToolFile;
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>;
/**
 * Annotate the current span with the outcome of a tool invocation.
 *
 * `ToolResult.fail` rides the Effect *success* channel by design (expected
 * failures are values, not defects), which means the tracer records those
 * spans as healthy. Without this, "user keeps hitting 4xx walls" is invisible
 * to telemetry — the exact class of signal that lets us catch product issues
 * before they're reported. Stamped attributes:
 *
 *   - `executor.tool.outcome`      — "ok" | "fail" (always, on ToolResults)
 *   - `executor.tool.error_code`   — ToolError.code (fail only)
 *   - `executor.tool.error_status` — upstream HTTP status (fail, when present)
 *
 * Codes/statuses are enumerable identifiers, never user content — safe span
 * attributes. Non-ToolResult values (raw success payloads) annotate "ok".
 */
export declare const annotateToolResultOutcome: (value: unknown) => Effect.Effect<void>;
//# sourceMappingURL=tool-result.d.ts.map