import "./env.js";
import { defaultSDK } from "./instrumentation.js";
import { createAgentsHono } from "./createApp.js";
import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
import { createAgentsApp, createAgentsAuth } from "./factory.js";
import { CredentialStoreRegistry, createDefaultCredentialStores } from "@inkeep/agents-core";
import { Hono } from "hono";

//#region src/index.ts
defaultSDK.start();
const defaultConfig = {
	port: 3002,
	serverOptions: {
		requestTimeout: 12e4,
		keepAliveTimeout: 6e4,
		keepAlive: true
	}
};
const sandboxConfig = process.env.SANDBOX_VERCEL_TEAM_ID && process.env.SANDBOX_VERCEL_PROJECT_ID && process.env.SANDBOX_VERCEL_TOKEN ? {
	provider: "vercel",
	runtime: "node22",
	timeout: 6e4,
	vcpus: 4,
	teamId: process.env.SANDBOX_VERCEL_TEAM_ID,
	projectId: process.env.SANDBOX_VERCEL_PROJECT_ID,
	token: process.env.SANDBOX_VERCEL_TOKEN
} : {
	provider: "native",
	runtime: "node22",
	timeout: 3e4,
	vcpus: 2
};
const ssoProviders = await Promise.all([process.env.AUTH0_DOMAIN && process.env.AUTH0_CLIENT_ID && process.env.AUTH0_CLIENT_SECRET ? createAuth0Provider({
	domain: process.env.AUTH0_DOMAIN,
	clientId: process.env.AUTH0_CLIENT_ID,
	clientSecret: process.env.AUTH0_CLIENT_SECRET
}) : null]);
const socialProviders = process.env.PUBLIC_GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET ? { google: {
	prompt: "select_account",
	display: "popup",
	clientId: process.env.PUBLIC_GOOGLE_CLIENT_ID,
	clientSecret: process.env.GOOGLE_CLIENT_SECRET
} } : void 0;
const auth = createAgentsAuth({
	ssoProviders: ssoProviders.filter((p) => p !== null),
	socialProviders
});
const app = createAgentsHono({
	serverConfig: defaultConfig,
	credentialStores: new CredentialStoreRegistry(createDefaultCredentialStores()),
	auth,
	sandboxConfig
});
var src_default = app;

//#endregion
export { Hono, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, src_default as default };