import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import * as z from "zod/v4"; import type { RenderResultOptions } from "../extensibility/custom-tools/types"; import { type FileDiagnosticsResult } from "../lsp"; import { type Theme } from "../modes/theme/theme"; import type { ToolSession } from "../sdk"; import { type OutputMeta } from "./output-meta"; declare const writeSchema: z.ZodObject<{ path: z.ZodString; content: z.ZodString; }, z.core.$strip>; export type WriteToolInput = z.infer; /** Details returned by the write tool for TUI rendering */ export interface WriteToolDetails { diagnostics?: FileDiagnosticsResult; meta?: OutputMeta; } type WriteParams = WriteToolInput; /** * Write tool implementation. * * Creates or overwrites files with optional LSP formatting and diagnostics. */ export declare class WriteTool implements AgentTool { #private; private readonly session; readonly name = "write"; readonly label = "Write"; readonly description: string; readonly parameters: z.ZodObject<{ path: z.ZodString; content: z.ZodString; }, z.core.$strip>; readonly nonAbortable = true; readonly strict = true; readonly concurrency = "exclusive"; readonly loadMode = "discoverable"; readonly summary = "Write content to a file (creates or overwrites)"; constructor(session: ToolSession); execute(_toolCallId: string, { path, content }: WriteParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, context?: AgentToolContext): Promise>; } interface WriteRenderArgs { path?: string; file_path?: string; content?: string; } export declare const writeToolRenderer: { renderCall(args: WriteRenderArgs, options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: WriteToolDetails; }, options: RenderResultOptions, uiTheme: Theme, args?: WriteRenderArgs): Component; mergeCallAndResult: boolean; }; export {};