import { agentTool } from "./utils-iC0Uutcf.js";
import { z } from "zod";

//#region src/internal/agents/tools/whoami.ts
/**
* Get the current authenticated user's information from Sentry API
*/
async function getCurrentUser(apiService) {
	const user = await apiService.getAuthenticatedUser();
	return {
		id: user.id,
		name: user.name,
		email: user.email
	};
}
/**
* Create a tool for getting current user information
* The tool is pre-bound with the API service configured for the appropriate region
*/
function createWhoamiTool(options) {
	const { apiService } = options;
	return agentTool({
		description: "Get the current authenticated user's information",
		parameters: z.object({}),
		execute: async () => {
			const user = await getCurrentUser(apiService);
			return `Current user: ${user.name || "Unknown"} (${user.email}, ID: ${user.id})`;
		}
	});
}

//#endregion
export { createWhoamiTool, getCurrentUser };
//# sourceMappingURL=whoami-D8-XCgVJ.js.map