import "./paths-WcYpcMAY.js";
import "./auth-profiles-CaNK0cUT.js";
import "./exec-CmvuUufz.js";
import "./agent-scope-E2aR3Ci_.js";
import "./github-copilot-token-CKOQDjEZ.js";
import "./emitter-BKo8D7Oj.js";
import "./sqlite-CVrhPija.js";
import "./reliability-BnL75OlZ.js";
import "./frontmatter-C3D7gE4Z.js";
import "./skills-UwTwDeDw.js";
import "./manifest-registry-AgGLF4V7.js";
import "./validation-B00oOkJ3.js";
import "./config-CoCeK5B2.js";
import "./message-channel-DKXbq8GH.js";
import { a as loadSessionStore } from "./sessions-CFJLtXRH.js";
import "./accounts-CNwod9BY.js";
import "./accounts-C3i8BBiA.js";
import "./normalize-CRf-uoB2.js";
import "./bindings-B1hNZin3.js";
import "./logging-BiuZwq5D.js";
import "./plugins-DMpYx7kb.js";
import "./image-ops-D0pBQqKh.js";
import "./dock-BvRrtCWj.js";
import "./accounts-CdYdWklO.js";
import "./paths-CDTtU20P.js";
import "./tool-images-B4eVOjD0.js";
import { a as jsonResult } from "./common-CxpUJZLb.js";
import "./gmail-setup-utils-CqttLGxc.js";
import { s as getValidCredentials } from "./gog-credentials-tQ9F8HpD.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 };