import {
  EDIT_FILE_SYSTEM_PROMPT,
  EDIT_FILE_TOOL_DESCRIPTION
} from "./chunk-63WE2C5R.js";
import {
  executeEditFile
} from "./chunk-SFIMDGVL.js";
import {
  __export
} from "./chunk-PZ5AY32C.js";

// tools/fastapply/anthropic.ts
var anthropic_exports = {};
__export(anthropic_exports, {
  createEditFileTool: () => createEditFileTool,
  editFileTool: () => editFileTool,
  execute: () => execute,
  formatResult: () => formatResult,
  getSystemPrompt: () => getSystemPrompt
});
var editFileTool = {
  name: "edit_file",
  description: EDIT_FILE_TOOL_DESCRIPTION,
  input_schema: {
    type: "object",
    properties: {
      target_filepath: {
        type: "string",
        description: "The path of the target file to modify"
      },
      instruction: {
        type: "string",
        description: "A single sentence written in the first person describing what the agent is changing. Used to help disambiguate uncertainty in the edit."
      },
      code_edit: {
        type: "string",
        description: "Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections."
      }
    },
    required: ["target_filepath", "instruction", "code_edit"]
  }
};
function formatResult(result) {
  if (!result.success) {
    return `Error editing file: ${result.error}`;
  }
  const { changes } = result;
  return `Successfully applied changes to ${result.filepath}. Added ${changes.linesAdded}, removed ${changes.linesRemoved}, modified ${changes.linesModified}.`;
}
function createEditFileTool(config = {}) {
  const toolDef = {
    ...editFileTool,
    ...config.description && { description: config.description }
  };
  return Object.assign({}, toolDef, {
    execute: async (input) => {
      return executeEditFile(input, config);
    },
    formatResult: (result) => {
      return formatResult(result);
    },
    getSystemPrompt: () => {
      return EDIT_FILE_SYSTEM_PROMPT;
    }
  });
}
async function execute(input, config) {
  return executeEditFile(input, config);
}
function getSystemPrompt() {
  return EDIT_FILE_SYSTEM_PROMPT;
}

export {
  editFileTool,
  formatResult,
  createEditFileTool,
  execute,
  getSystemPrompt,
  anthropic_exports
};
//# sourceMappingURL=chunk-NICCCJAA.js.map