"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WriteFileToolDefinition = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("./agentToolNames.js");
var writeFileArgumentsSchema = zod_1.z.object({
    filename: zod_1.z.string().meta({ description: 'The name of the file' }),
    mode: zod_1.z.enum(['overwrite', 'append', 'patch']).meta({
        description: 'overwrite: replace entire file (or create new). append: add content to end of file. patch: replace characters between start and end indices.',
    }),
    content: zod_1.z.string().meta({
        description: 'The content to write. For overwrite: the full new content. For append: text to add at the end. For patch: replacement text for the [start, end) range.',
    }),
    start: zod_1.z.number().optional().meta({
        description: 'Start character index (0-indexed, inclusive). Required for patch mode.',
    }),
    end: zod_1.z.number().optional().meta({
        description: 'End character index (0-indexed, exclusive). Required for patch mode.',
    }),
});
var writeFileResponseSchema = zod_1.z.object({
    filename: zod_1.z.string(),
    size_chars: zod_1.z.number(),
    diff: zod_1.z.string(),
});
exports.WriteFileToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.WriteFile,
    description: 'Write to a file. Supports three modes: overwrite (create or replace entire file), append (add to end), and patch (replace a character range). Returns a diff showing what changed.',
    argumentsSchema: writeFileArgumentsSchema,
    responseSchema: writeFileResponseSchema,
});
//# sourceMappingURL=WriteFileDefinition.js.map