import {
  GITHUB_READ_FILE_DESCRIPTION,
  GITHUB_READ_FILE_TOOL_NAME,
  GITHUB_SEARCH_DESCRIPTION,
  GITHUB_SEARCH_TOOL_NAME,
  WARP_GREP_DESCRIPTION,
  WARP_GREP_TOOL_NAME
} from "../../chunk-OTOVGCG6.js";
import {
  WarpGrepClient,
  executeGitHubReadFile,
  executeToolCall,
  formatGitHubReadFileResult,
  formatResult
} from "../../chunk-S4RLT56A.js";
import "../../chunk-GVGJIXV2.js";
import "../../chunk-PUGSTXLO.js";
import "../../chunk-63VHBANJ.js";
import "../../chunk-HHRHUUGN.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-SGRNIWJD.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 GITHUB_READ_FILE_PARAMETERS = {
  type: "OBJECT",
  properties: {
    github: { type: "STRING", description: 'owner/repo shorthand (e.g., "vercel/next.js")' },
    path: { type: "STRING", description: "File path within the repository" },
    startLine: { type: "NUMBER", description: "Start line number (1-based)" },
    endLine: { type: "NUMBER", description: "End line number (1-based, inclusive)" },
    branch: { type: "STRING", description: "Branch to read from (defaults to repo default branch)" }
  },
  required: ["github", "path"]
};
function createGitHubReadFileTool(config) {
  const declaration = {
    name: GITHUB_READ_FILE_TOOL_NAME,
    description: GITHUB_READ_FILE_DESCRIPTION,
    parameters: GITHUB_READ_FILE_PARAMETERS
  };
  return Object.assign(declaration, {
    execute: async (input) => {
      return executeGitHubReadFile(input, config);
    },
    formatResult: (result) => {
      return formatGitHubReadFileResult(result);
    }
  });
}
var gemini_default = warpGrepFunctionDeclaration;
export {
  createGitHubReadFileTool,
  createGitHubSearchTool,
  createMorphWarpGrepTool,
  createWarpGrepTool,
  gemini_default as default,
  execute,
  formatResult,
  getSystemPrompt,
  warpGrepFunctionDeclaration
};
//# sourceMappingURL=gemini.js.map