import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolTier } from "@oh-my-pi/pi-agent-core";
import type { Component } from "@oh-my-pi/pi-tui";
import type { RenderResultOptions } from "../extensibility/custom-tools/types.js";
import { type FileDiagnosticsResult } from "../lsp/index.js";
import { type Theme } from "../modes/theme/theme.js";
import type { ToolSession } from "../sdk.js";
import { type OutputMeta } from "./output-meta.js";
declare const writeSchema: import("arktype/internal/variants/object.ts").ObjectType<{
    path: string;
    content: string;
}, {}>;
export type WriteToolInput = typeof writeSchema.infer;
/** Details returned by the write tool for TUI rendering */
export interface WriteToolDetails {
    diagnostics?: FileDiagnosticsResult;
    meta?: OutputMeta;
    /** Set when the file was auto-chmod'd because content begins with a `#!` shebang. */
    madeExecutable?: boolean;
    /** Absolute filesystem path the write resolved to. Used by the renderer to wrap
     * the (possibly cwd-relative) header path in an OSC 8 `file://` hyperlink. */
    resolvedPath?: string;
}
type WriteParams = WriteToolInput;
/**
 * Write tool implementation.
 *
 * Creates or overwrites files with optional LSP formatting and diagnostics.
 */
export declare class WriteTool implements AgentTool<typeof writeSchema, WriteToolDetails> {
    #private;
    private readonly session;
    readonly name = "write";
    readonly approval: (args: unknown) => ToolTier;
    readonly formatApprovalDetails: (args: unknown) => string[];
    readonly label = "Write";
    readonly description: string;
    readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
        path: string;
        content: string;
    }, {}>;
    readonly strict = true;
    readonly concurrency = "exclusive";
    readonly loadMode = "essential";
    /** Stream matchers should see the real file content, not its JSON-escaped argument encoding. */
    matcherDigest(args: unknown): string | undefined;
    constructor(session: ToolSession);
    execute(_toolCallId: string, { path: rawPath, content }: WriteParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<WriteToolDetails>, context?: AgentToolContext): Promise<AgentToolResult<WriteToolDetails>>;
}
interface WriteRenderArgs {
    path?: unknown;
    file_path?: unknown;
    content?: unknown;
}
export declare const writeToolRenderer: {
    renderCall(args: WriteRenderArgs, options: RenderResultOptions, uiTheme: Theme): Component;
    renderResult(result: {
        content: Array<{
            type: string;
            text?: string;
        }>;
        details?: WriteToolDetails;
        isError?: boolean;
    }, options: RenderResultOptions, uiTheme: Theme, args?: WriteRenderArgs): Component;
    mergeCallAndResult: boolean;
    forceFirstResultViewportRepaint: (args: unknown, options: RenderResultOptions) => boolean;
};
export {};
