import { z } from "zod";
import * as ai277 from "ai";

//#region src/internal/agents/tools/utils.d.ts
type AgentToolResponse<T = unknown> = {
  error?: string;
  result?: T;
};
/**
 * Creates an embedded agent tool with automatic error handling and schema wrapping.
 *
 * This wrapper:
 * - Maintains the same API as the AI SDK's tool() function
 * - Automatically wraps the result schema with error/result structure
 * - Handles all error types and returns them as structured responses
 * - Preserves type inference from the original tool implementation
 *
 * @example
 * ```typescript
 * export function createMyTool(apiService: SentryApiService) {
 *   return agentTool({
 *     description: "My tool description",
 *     parameters: z.object({ param: z.string() }),
 *     execute: async (params) => {
 *       // Tool implementation that might throw errors
 *       const result = await apiService.someMethod(params);
 *       return result; // Original return type preserved
 *     }
 *   });
 * }
 * ```
 */
declare function agentTool<TParameters, TResult>(config: {
  description: string;
  parameters: z.ZodSchema<TParameters>;
  execute: (params: TParameters) => Promise<TResult>;
}): ai277.Tool<z.ZodType<TParameters, z.ZodTypeDef, TParameters>, AgentToolResponse<Awaited<TResult>>> & {
  execute: (args: TParameters, options: ai277.ToolExecutionOptions) => PromiseLike<AgentToolResponse<Awaited<TResult>>>;
};
//# sourceMappingURL=utils.d.ts.map
//#endregion
export { AgentToolResponse, agentTool };
//# sourceMappingURL=utils-BV58GdRy.d.ts.map