/** * Runtime policy module — single seam for Phase 02 runtime configuration. * * Provides: * - DEFAULT_RUNTIME_POLICY: hardcoded defaults matching current production * - loadRuntimePolicy: validate and merge workspace-level policy * - getRuntimePolicyForSession: resolve per-session overrides * * RESEARCH D-16 (built-in-first): * OpenCode already provides hook/session surfaces for tool budgets, loop * detection, and retry resolution. This policy layer ONLY supplements the * missing per-key concurrency and per-session threshold behavior. It does * NOT replace or duplicate OpenCode-native enforcement. */ import type { ResolvedBudgetPolicy, RuntimePolicy, SessionPolicyOverride } from "./types.js"; export declare const DEFAULT_RUNTIME_POLICY: RuntimePolicy; /** * Load and validate a workspace-level runtime policy. * * @param workspacePolicy - Optional workspace-level policy. When omitted or * empty, returns DEFAULT_RUNTIME_POLICY. * @returns A fully-resolved RuntimePolicy with all fields populated. * @throws [Hivemind]-prefixed Error when limits are out of valid range. */ export declare function loadRuntimePolicy(workspacePolicy?: Partial): RuntimePolicy; /** * Resolve the effective runtime policy for a specific session. * * Per-session overrides take precedence over workspace-level defaults. * Both the workspace policy and the session override are validated before * being applied — out-of-range values throw [Hivemind] errors. * * RESEARCH D-16: Session overrides come from trusted continuity/delegation * metadata only (not arbitrary tool args). This prevents silent limit * escalation from untrusted sources (threat T-02-03). * * @param workspacePolicy - Workspace-level policy (already validated or default). * @param sessionOverride - Optional per-session overrides from delegation metadata. * @returns Fully-resolved policy for this session. * @throws [Hivemind]-prefixed Error when session override values are invalid. */ export declare function getRuntimePolicyForSession(workspacePolicy: RuntimePolicy, sessionOverride?: SessionPolicyOverride): RuntimePolicy; /** * Resolve the effective per-key concurrency policy for a given lane key. * * Falls back to the global limit when no per-key override exists. */ export declare function resolveConcurrencyForKey(policy: RuntimePolicy, key: string): { limit: number; acquireTimeoutMs?: number; }; /** * Resolve the effective budget policy for a session. * * This is the budget analogue of resolveConcurrencyForKey — it returns * the full budget policy for use by the tool guard hooks. */ export declare function resolveBudgetForSession(policy: RuntimePolicy): ResolvedBudgetPolicy; //# sourceMappingURL=runtime-policy.d.ts.map