export interface RuntimeContextOptions { now?: Date; timezone?: string | null; /** * Delegation depth of the agent this prompt is built for. 0 = the top-level * (user-facing) agent, 1 = a sub-agent spawned by the top-level agent, and so * on. Threaded through so a spawned sub-agent knows how deep it sits and * whether it is still allowed to delegate further. Omitted (or 0) for the * top-level chat. See `MAX_SUBAGENT_DELEGATION_DEPTH`. */ delegationDepth?: number; } /** * Default hard cap on sub-agent delegation depth. The top-level agent is depth * 0 and may spawn sub-agents (depth 1); those may spawn once more (depth 2); * a spawn that would create a depth-3 sub-agent is refused. Borrowed from the * "sub-agents must not infinitely spawn sub-agents" runaway/cost safety rail. * * Override at deploy time via `AGENT_NATIVE_MAX_SUBAGENT_DEPTH` (see * `resolveMaxSubagentDelegationDepth`). */ export declare const MAX_SUBAGENT_DELEGATION_DEPTH = 2; /** Env var name that overrides the default sub-agent delegation-depth cap. */ export declare const MAX_SUBAGENT_DELEGATION_DEPTH_ENV = "AGENT_NATIVE_MAX_SUBAGENT_DEPTH"; /** * Resolve the effective maximum sub-agent delegation depth. * * Reads `AGENT_NATIVE_MAX_SUBAGENT_DEPTH` and, when it parses to a finite * non-negative integer, clamps it to `[0, MAX_SUBAGENT_DELEGATION_DEPTH_CEILING]`. * Any invalid value (non-numeric, negative, NaN, Infinity, fractional) falls * back to `MAX_SUBAGENT_DELEGATION_DEPTH` so a typo can never silently disable * the guardrail. `0` is a valid override meaning "no sub-agents may be spawned". */ export declare function resolveMaxSubagentDelegationDepth(env?: Record): number; export declare function isValidTimezone(timezone: string): boolean; export declare function formatDateTime(date: Date, timezone: string): string; export declare function formatDate(date: Date, timezone: string): string; /** * Build the stable, day-granular runtime-context block embedded in the * SYSTEM prompt. * * This block is part of the cached prompt prefix, so it must stay byte-for- * byte identical across requests within the same calendar day — anything * with sub-day granularity (a millisecond/second timestamp) here would * invalidate the Anthropic prompt cache on every single turn, since the * cache matches prefixes and this block sits near the start of the system * prompt. Precise current time is injected separately, per-turn, into the * USER message instead (see `buildCurrentTimeUserContext` below) so the * model can still answer "what time is it" accurately without destabilizing * the cached prefix. */ export declare function buildRuntimeContextPrompt(options?: RuntimeContextOptions): string; export interface CurrentTimeContextOptions { now?: Date; timezone?: string | null; } /** * Build the precise, per-turn current-time block injected into the USER * message (not the system prompt). Millisecond-precision time changes every * request, so it must never live in the cached system-prompt prefix — see * `buildRuntimeContextPrompt`. This follows the same volatile-context pattern * as the current-screen/current-url/selection blocks in production-agent.ts. */ export declare function buildCurrentTimeUserContext(options?: CurrentTimeContextOptions): string; //# sourceMappingURL=runtime-context.d.ts.map