import "./paths-D4_LjrY7.js";
import "./utils-BnlaT0eO.js";
import "./theme-CG-K7m8u.js";
import "./subsystem-ocBR131w.js";
import "./runtime-CRvfzclG.js";
import "./exec-CZr_EJHt.js";
import "./agent-scope-CVnlY0oG.js";
import "./model-selection-p6J3l4qF.js";
import "./github-copilot-token-CjSKohyA.js";
import "./emitter-oHo8y9ow.js";
import "./sqlite-wYNyDR1B.js";
import "./reliability-Dl7hbRzF.js";
import "./boolean-DGGu1sGA.js";
import "./env-CvUd308i.js";
import "./validation-p1IK70TM.js";
import "./config-DJ3A5x_1.js";
import "./manifest-registry-U2EDFVP4.js";
import "./frontmatter-VFr0KMAQ.js";
import "./skills-CHYyY1lO.js";
import "./image-ops-C0D77XHD.js";
import { u as updateSessionStore } from "./sessions-Ct2d_bGl.js";
import "./message-channel-DSU96OKy.js";
import "./dock-DY0TWaYa.js";
import "./normalize-DgwtBdm-.js";
import "./accounts-BZv5WxME.js";
import "./accounts-DFaskvEN.js";
import "./accounts-T7o73ZSN.js";
import "./bindings-BbaWTQJM.js";
import "./logging-wfRfbMvt.js";
import "./plugins-DYgcd4QJ.js";
import { t as resolveDefaultSessionStorePath } from "./paths-DRyRQF9o.js";
import "./tool-images-CRPqucMe.js";
import { a as jsonResult, u as readStringParam } from "./common-oaZdjdal.js";
import "./gmail-setup-utils-BRj-aPVG.js";
import { l as revokeCredentials } from "./gog-credentials-Cu_qOd32.js";
import { Type } from "@sinclair/typebox";

//#region src/agents/tools/auth/gog-auth-revoke-tool.ts
/**
* gog_auth_revoke tool - Revoke Google OAuth credentials
*/
const GogAuthRevokeSchema = Type.Object({ email: Type.Optional(Type.String({ description: "Specific Google account email to revoke (optional, defaults to session credentials)" })) });
function createGogAuthRevokeTool(opts) {
	return {
		label: "Google Auth Revoke",
		name: "gog_auth_revoke",
		description: "Revoke Google OAuth credentials for this session. This will delete local credentials and revoke access with Google.",
		parameters: GogAuthRevokeSchema,
		execute: async (_toolCallId, args) => {
			const email = readStringParam(args, "email");
			if (!opts?.agentId || !opts?.agentDir || !opts?.sessionKey) return jsonResult({ error: "Missing agent context (agentId, agentDir, or sessionKey)" });
			try {
				await revokeCredentials(opts.agentId, opts.sessionKey, email);
				await updateSessionStore(resolveDefaultSessionStorePath(opts.agentId), (store) => {
					const session = store[opts.sessionKey];
					if (session) {
						delete session.gogCredentialsFile;
						delete session.gogAuthEmail;
						delete session.gogAuthPending;
						session.updatedAt = Date.now();
					}
				});
				return jsonResult({ success: true });
			} catch (error) {
				return jsonResult({
					success: false,
					error: error instanceof Error ? error.message : "Unknown error occurred"
				});
			}
		}
	};
}

//#endregion
export { createGogAuthRevokeTool };