import {
  GITHUB_SEARCH_DESCRIPTION,
  GITHUB_SEARCH_TOOL_NAME,
  WARP_GREP_DESCRIPTION,
  WARP_GREP_TOOL_NAME
} from "../../chunk-KJZMKDDP.js";
import {
  WarpGrepClient,
  executeToolCall,
  formatResult
} from "../../chunk-TXT3W4QK.js";
import "../../chunk-WYYR2EU6.js";
import "../../chunk-PUGSTXLO.js";
import "../../chunk-63VHBANJ.js";
import "../../chunk-MQWEZJTP.js";
import "../../chunk-3MLWXJTJ.js";
import "../../chunk-5PNMAWLC.js";
import "../../chunk-APP75CBN.js";
import "../../chunk-GHGJAQSJ.js";
import {
  getSystemPrompt
} from "../../chunk-FMLHRJDF.js";
import "../../chunk-RNKHRNSG.js";
import "../../chunk-PZ5AY32C.js";

// tools/warp_grep/gemini.ts
var TOOL_PARAMETERS = {
  type: "OBJECT",
  properties: {
    query: {
      type: "STRING",
      description: "Free-form repository question"
    }
  },
  required: ["query"]
};
var warpGrepFunctionDeclaration = {
  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 declaration = {
    name: config.name ?? WARP_GREP_TOOL_NAME,
    description: config.description ?? WARP_GREP_DESCRIPTION,
    parameters: TOOL_PARAMETERS
  };
  return Object.assign(declaration, {
    execute: async (input) => {
      return executeToolCall(input, config);
    },
    formatResult: (result) => {
      return formatResult(result);
    },
    getSystemPrompt: () => {
      return getSystemPrompt();
    }
  });
}
var createMorphWarpGrepTool = createWarpGrepTool;
var GITHUB_SEARCH_PARAMETERS = {
  type: "OBJECT",
  properties: {
    query: { type: "STRING", description: "Natural language search query" },
    github: { type: "STRING", description: 'GitHub URL or "owner/repo" shorthand' },
    branch: { type: "STRING", description: "Branch to search (defaults to repo default branch)" }
  },
  required: ["query", "github"]
};
function createGitHubSearchTool(config) {
  const client = new WarpGrepClient(config);
  const declaration = {
    name: GITHUB_SEARCH_TOOL_NAME,
    description: GITHUB_SEARCH_DESCRIPTION,
    parameters: GITHUB_SEARCH_PARAMETERS
  };
  return Object.assign(declaration, {
    execute: async (input) => {
      return client.searchGitHub(input);
    },
    formatResult: (result) => {
      return formatResult(result);
    },
    getSystemPrompt: () => {
      return getSystemPrompt();
    }
  });
}
var gemini_default = warpGrepFunctionDeclaration;
export {
  createGitHubSearchTool,
  createMorphWarpGrepTool,
  createWarpGrepTool,
  gemini_default as default,
  execute,
  formatResult,
  getSystemPrompt,
  warpGrepFunctionDeclaration
};
//# sourceMappingURL=gemini.js.map