import { MAX_PLAY_SANDBOX_RUNTIME_LIMITS } from './sandbox-runtime-limits'; /** Maximum active user-code runtime for a standard play, in seconds. */ export const STANDARD_PLAY_RUNTIME_LIMIT_SECONDS = 30 * 60; export const STANDARD_PLAY_RUNTIME_LIMIT_LABEL = '30 minutes'; /** * Extra time after the user-code deadline for the sandbox runner to push its * terminal, flush captured stdout, and let the crash epilogue finish. */ export const PLAY_RUNNER_TERMINAL_GRACE_SECONDS = 90; /** * Hard ceiling for Daytona runner startup before the customer runtime clock is * armed. This covers the first durable heartbeat and the worker's reverse * startup acknowledgement without charging either interval to user code. */ export const PLAY_RUNNER_STARTUP_GRACE_SECONDS = 4 * 60; /** * Runner timeout includes setup, cleanup, and billing headroom after the * user-code runtime cap. */ export const PLAY_RUNNER_TIMEOUT_SECONDS = 40 * 60; /** TTL for workflow executor tokens, in seconds. */ export const WORKFLOW_EXECUTOR_TOKEN_TTL_SECONDS = MAX_PLAY_SANDBOX_RUNTIME_LIMITS.timeoutSeconds + (PLAY_RUNNER_TIMEOUT_SECONDS - STANDARD_PLAY_RUNTIME_LIMIT_SECONDS); /** * Absurd run-claim lease window, in seconds. The scheduler expires a claim whose * `claim_expires_at` falls this far behind, so whoever owns execution must renew * within this window. Shared between the worker's own lease heartbeat and the * Daytona push-execution runner (which heartbeats the receipt gateway on a * `RUNTIME_CLAIM_LEASE_SECONDS / 3` cadence) so both agree on the deadline. */ export const RUNTIME_CLAIM_LEASE_SECONDS = 120; /** Heartbeat cadence divisor: renew the claim this many times per lease window. */ export const RUNTIME_CLAIM_HEARTBEAT_DIVISOR = 3;