/**
 * Limit Constants
 * All "how many before we stop?" defaults.
 * Quantities (not durations).
 */

/** Max concurrent session memory keys before oldest are evicted. */
export const MAX_SESSION_MEMORY_KEYS = 25

/** Total token budget for agent memory (history + session). */
export const MAX_MEMORY_TOKENS = 32_000

/** Max tokens for a single memory entry before truncation. */
export const MAX_SINGLE_ENTRY_TOKENS = 2_000

/** Max tokens for a single tool result stored in history before truncation. */
export const MAX_TOOL_RESULT_TOKENS = 4_000

/** Max execution requests per org per minute (token bucket refill rate + capacity). */
export const EXECUTION_RATE_LIMIT_PER_MINUTE = 120

/** Global WebSocket connection limit across all orgs. */
export const WS_MAX_GLOBAL_CONNECTIONS = 5_000

/** Max WebSocket connections per session (covers tabs, reconnect overlap). */
export const WS_MAX_CONNECTIONS_PER_SESSION = 5

/** Max inbound WebSocket messages per connection per minute. */
export const WS_MAX_MESSAGES_PER_MINUTE = 60

/** Minimum interval between WebSocket messages in ms (burst protection). */
export const WS_MIN_MESSAGE_INTERVAL_MS = 1_000
