import { ChatCompletionTool } from 'openai/resources/chat/completions';
export { formatResult } from './client.js';
import { d as WarpGrepToolConfig, b as WarpGrepResult, g as GitHubSearchToolConfig, h as GitHubReadFileToolConfig, e as GitHubReadFileInput, f as GitHubReadFileResult } from '../../types-CtkD4o1_.js';
import './agent/types.js';
import '../utils/resilience.js';
import './providers/types.js';

/**
 * OpenAI SDK adapter for morph-warp-grep tool
 */

/**
 * OpenAI-native warp grep tool definition
 *
 * @example
 * ```typescript
 * import OpenAI from 'openai';
 * import { warpGrepTool, execute } from '@morphllm/morphsdk/tools/warp-grep/openai';
 *
 * const client = new OpenAI();
 * const response = await client.chat.completions.create({
 *   model: 'gpt-4o',
 *   tools: [warpGrepTool],
 *   messages: [{ role: 'user', content: 'Find authentication middleware' }]
 * });
 *
 * // Execute the tool call
 * const result = await execute({ search_term: '...' }, { repoRoot: '.' });
 * ```
 */
declare const warpGrepTool: ChatCompletionTool;
/**
 * Execute warp grep search
 *
 * @param input - Tool input with search_term
 * @param config - Configuration with repoRoot and optional provider
 * @returns Search results
 */
declare function execute(input: {
    search_term: string;
} | string, config: WarpGrepToolConfig): Promise<WarpGrepResult>;

/**
 * Create a custom warp grep tool with configuration and methods
 *
 * @param config - Configuration options
 * @returns Tool definition with execute and formatResult methods
 *
 * @example Local usage
 * ```typescript
 * import OpenAI from 'openai';
 * import { createWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/openai';
 *
 * const tool = createWarpGrepTool({ repoRoot: '.' });
 *
 * const client = new OpenAI();
 * const response = await client.chat.completions.create({
 *   model: 'gpt-4o',
 *   tools: [tool],
 *   messages: [{ role: 'user', content: 'Find authentication middleware' }]
 * });
 * ```
 *
 * @example Remote sandbox (E2B, Modal, etc.)
 * ```typescript
 * const tool = createMorphWarpGrepTool({
 *   repoRoot: '/home/repo',
 *   remoteCommands: {
 *     grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout,
 *     read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout,
 *     listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout,
 *   },
 * });
 * ```
 */
declare function createWarpGrepTool(config: WarpGrepToolConfig): ChatCompletionTool & {
    execute: (input: unknown) => Promise<WarpGrepResult>;
    formatResult: (result: WarpGrepResult) => string;
};
/**
 * Create a GitHub search tool for OpenAI SDK
 *
 * @param config - Configuration options (morphApiKey, morphApiUrl, codeSearchUrl, timeout)
 * @returns OpenAI ChatCompletionTool with execute and formatResult methods
 *
 * @example
 * ```typescript
 * import OpenAI from 'openai';
 * import { createGitHubSearchTool } from '@morphllm/morphsdk/tools/warp-grep/openai';
 *
 * const tool = createGitHubSearchTool({ morphApiKey: process.env.MORPH_API_KEY });
 *
 * const response = await openai.chat.completions.create({
 *   model: 'gpt-4o',
 *   tools: [tool],
 *   messages: [{ role: 'user', content: 'How does auth work in vercel/next.js?' }]
 * });
 *
 * // Execute
 * const result = await tool.execute({ search_term: 'auth middleware', github_url: 'https://github.com/vercel/next.js' });
 * console.log(tool.formatResult(result));
 * ```
 */
declare function createGitHubSearchTool(config: GitHubSearchToolConfig): ChatCompletionTool & {
    execute: (input: {
        search_term: string;
        github_url?: string;
        owner_repo?: string;
        branch?: string;
    }) => Promise<WarpGrepResult>;
    formatResult: (result: WarpGrepResult) => string;
};
/**
 * Create a GitHub read file tool for OpenAI SDK
 *
 * @param config - Optional configuration (timeout)
 * @returns OpenAI ChatCompletionTool with execute and formatResult methods
 *
 * @example
 * ```typescript
 * import OpenAI from 'openai';
 * import { createGitHubReadFileTool } from '@morphllm/morphsdk/tools/warp-grep/openai';
 *
 * const tool = createGitHubReadFileTool();
 *
 * const response = await openai.chat.completions.create({
 *   model: 'gpt-4o',
 *   tools: [tool],
 *   messages: [{ role: 'user', content: 'Read the package.json from vercel/next.js' }]
 * });
 *
 * const result = await tool.execute({ github: 'vercel/next.js', path: 'package.json' });
 * console.log(tool.formatResult(result));
 * ```
 */
declare function createGitHubReadFileTool(config?: GitHubReadFileToolConfig): ChatCompletionTool & {
    execute: (input: GitHubReadFileInput) => Promise<GitHubReadFileResult>;
    formatResult: (result: GitHubReadFileResult) => string;
};

export { createGitHubReadFileTool, createGitHubSearchTool, createWarpGrepTool, warpGrepTool as default, execute, warpGrepTool };
