import "./subsystem-Ci61Iebe.js";
import "./paths-aMBPuCJR.js";
import "./auth-profiles-CRqdowVc.js";
import "./env-3oW17BWM.js";
import "./exec-B5OgjUV4.js";
import "./agent-scope-CCFV2dzL.js";
import "./github-copilot-token-sMZoP3ZH.js";
import "./reliability-B6TVU4OW.js";
import "./sqlite-CbyDDiup.js";
import "./accounts-TaYXhwSR.js";
import "./dock-BRgbOpqS.js";
import "./normalize-Dz9m5w2g.js";
import "./bindings-jC2ZutIF.js";
import "./plugins-6aUfx6Yt.js";
import "./message-channel-BCPYwYUJ.js";
import "./image-ops-DfgorOBP.js";
import "./config-i4b9k_EZ.js";
import "./manifest-registry-BPLS_vpk.js";
import "./skills-CIrNKatf.js";
import { i as loadSessionStore } from "./sessions-N3tZC0jA.js";
import "./paths-a4Li8t1f.js";
import "./tool-images-D39TNWEi.js";
import { a as jsonResult } from "./common-BkBiFnII.js";
import { s as getValidCredentials } from "./gog-credentials-CmQKyfSF.js";
import { Type } from "@sinclair/typebox";

//#region src/agents/tools/auth/gog-auth-status-tool.ts
/**
* gog_auth_status tool - Check Google OAuth authentication status
*/
const GogAuthStatusSchema = Type.Object({});
function createGogAuthStatusTool(opts) {
	return {
		label: "Google Auth Status",
		name: "gog_auth_status",
		description: "Check if the current session has valid Google OAuth credentials. Returns authentication status, email, authorized services, and token expiry.",
		parameters: GogAuthStatusSchema,
		execute: async (_toolCallId, _args) => {
			if (!opts?.agentId || !opts?.sessionKey) return jsonResult({ error: "Missing agent context (agentId or sessionKey)" });
			const hasPendingAuth = !!loadSessionStore(opts.agentId)[opts.sessionKey]?.gogAuthPending;
			const credResult = await getValidCredentials(opts.agentId, opts.sessionKey);
			if (!credResult.credentials) return jsonResult({
				authenticated: false,
				pending: hasPendingAuth,
				error: credResult.error
			});
			return jsonResult({
				authenticated: true,
				email: credResult.credentials.email,
				services: credResult.credentials.services,
				expiresAt: credResult.credentials.expiresAt,
				pending: false
			});
		}
	};
}

//#endregion
export { createGogAuthStatusTool };