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/openai.ts
var TOOL_PARAMETERS = {
  type: "object",
  properties: {
    query: { type: "string", description: "Free-form repository question" }
  },
  required: ["query"]
};
var warpGrepTool = {
  type: "function",
  function: {
    name: WARP_GREP_TOOL_NAME,
    description: WARP_GREP_DESCRIPTION,
    parameters: TOOL_PARAMETERS
  }
};
async function execute(input, config) {
  return executeToolCall(input, config);
}
function createWarpGrepTool(config) {
  const tool = {
    type: "function",
    function: {
      name: config.name ?? WARP_GREP_TOOL_NAME,
      description: config.description ?? WARP_GREP_DESCRIPTION,
      parameters: TOOL_PARAMETERS
    }
  };
  return Object.assign(tool, {
    execute: async (input) => {
      return executeToolCall(input, config);
    },
    formatResult: (result) => {
      return formatResult(result);
    },
    getSystemPrompt: () => {
      return getSystemPrompt();
    }
  });
}
var openai_default = warpGrepTool;

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