import {
  GITHUB_SEARCH_DESCRIPTION,
  GITHUB_SEARCH_INPUT_SCHEMA,
  GITHUB_SEARCH_TOOL_NAME,
  WARP_GREP_DESCRIPTION,
  WARP_GREP_TOOL_NAME
} from "./chunk-KJZMKDDP.js";
import {
  WarpGrepClient,
  executeToolCall,
  formatResult
} from "./chunk-TXT3W4QK.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();
    }
  });
}
function createGitHubSearchTool(config) {
  const client = new WarpGrepClient(config);
  const tool = {
    name: GITHUB_SEARCH_TOOL_NAME,
    description: GITHUB_SEARCH_DESCRIPTION,
    input_schema: GITHUB_SEARCH_INPUT_SCHEMA
  };
  return Object.assign(tool, {
    execute: async (input) => {
      return client.searchGitHub(input);
    },
    formatResult: (result) => {
      return formatResult(result);
    },
    getSystemPrompt: () => {
      return getSystemPrompt();
    }
  });
}

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