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

//#region src/constants/schema-validation/index.ts
loadEnvironmentFiles();
const constantsSchema = z.object(Object.fromEntries(Object.keys(schemaValidationDefaults).map((key) => [`AGENTS_${key}`, z.coerce.number().optional()])));
const parseConstants = () => {
	const envOverrides = constantsSchema.parse(process.env);
	return Object.fromEntries(Object.entries(schemaValidationDefaults).map(([key, defaultValue]) => [key, envOverrides[`AGENTS_${key}`] ?? defaultValue]));
};
const constants = parseConstants();
const { AGENT_EXECUTION_TRANSFER_COUNT_MIN, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MIN, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, STATUS_UPDATE_MAX_NUM_EVENTS, STATUS_UPDATE_MAX_INTERVAL_SECONDS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, VALIDATION_AGENT_PROMPT_MAX_CHARS, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT } = constants;

//#endregion
export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, schemaValidationDefaults };