import { loadEnvironmentFiles } from "../../env.js";
import { executionLimitsSharedDefaults } from "./defaults.js";
import { z } from "@hono/zod-openapi";

//#region src/constants/execution-limits-shared/index.ts
loadEnvironmentFiles();
const constantsSchema = z.object(Object.fromEntries(Object.keys(executionLimitsSharedDefaults).map((key) => [`AGENTS_${key}`, z.coerce.number().optional()])));
const parseConstants = () => {
	const envOverrides = constantsSchema.parse(process.env);
	return Object.fromEntries(Object.entries(executionLimitsSharedDefaults).map(([key, defaultValue]) => [key, envOverrides[`AGENTS_${key}`] ?? defaultValue]));
};
const constants = parseConstants();
const { MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT } = constants;

//#endregion
export { CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, executionLimitsSharedDefaults };