import {
  WARP_GREP_DESCRIPTION,
  WARP_GREP_TOOL_NAME
} from "./chunk-KW7OEGZK.js";
import {
  executeToolCall,
  formatResult
} from "./chunk-23R562QJ.js";
import {
  getSystemPrompt
} from "./chunk-FMLHRJDF.js";

// tools/warp_grep/anthropic.ts
var INPUT_SCHEMA = {
  type: "object",
  properties: {
    query: { type: "string", description: "Free-form repository question" }
  },
  required: ["query"]
};
var warpGrepTool = {
  name: WARP_GREP_TOOL_NAME,
  description: WARP_GREP_DESCRIPTION,
  input_schema: INPUT_SCHEMA
};
async function execute(input, config) {
  return executeToolCall(input, config);
}
function createWarpGrepTool(config) {
  const tool = {
    name: config.name ?? WARP_GREP_TOOL_NAME,
    description: config.description ?? WARP_GREP_DESCRIPTION,
    input_schema: INPUT_SCHEMA
  };
  return Object.assign(tool, {
    execute: async (input) => {
      return executeToolCall(input, config);
    },
    formatResult: (result) => {
      return formatResult(result);
    },
    getSystemPrompt: () => {
      return getSystemPrompt();
    }
  });
}

export {
  warpGrepTool,
  execute,
  createWarpGrepTool
};
//# sourceMappingURL=chunk-ALTKGCG5.js.map