/** * The budgets one code-mode invocation may spend, resolved from the environment. * * Pure, like resolveSelection and for the same reason: the whole mechanism is * testable offline without starting a server, and no function in here reads * process.env behind your back. * * Out-of-range and non-numeric values throw rather than falling back. A budget * is set deliberately, so one that silently reverts to the default is a config * that looks applied and is not — the same failure toolsets.ts calls "the worst * bug report there is" and refuses to produce. */ export interface CodeLimits { /** Wall clock for the whole invocation. */ timeoutMs: number; /** HTTP requests, shared across every operation the invocation calls. */ maxRequests: number; /** Records materialised, across every collection it reads. */ maxRecords: number; /** Pages one auto-paged read may fetch. */ maxPages: number; /** Concurrent outbound requests. */ maxInflight: number; } /** Thrown for a budget that cannot be honoured. Fatal at startup. */ export declare class CodeLimitsError extends Error { } /** Every environment variable this module reads, for the --help text and the README. */ export declare const LIMIT_VARIABLES: readonly string[]; export declare function resolveLimits(env?: NodeJS.ProcessEnv): CodeLimits; /** * What code mode is permitted to do, as distinct from how much of it. * * Separate from CodeLimits because a budget and a permission fail differently: * exceeding a budget is a thing to narrow, and lacking a permission is a thing * the operator has to grant. Collapsing them would put "ask your admin" and * "ask for fewer records" behind the same error. */ export interface CodePermissions { /** * Whether jsm_apply may call a destructive operation. * * Default false, and deliberately an operator switch rather than something a * client annotation or a model argument can satisfy. Thirty-seven of the * ninety-four operations are destructive, and some clients auto-approve by * tool name or do not read annotations at all — so the only place this can be * enforced independently of client behaviour is here. * * This is the same shape as `unverified` in toolsets.ts: the capability * ships, and reaching it requires naming it. */ destructive: boolean; } /** Every environment variable this module reads for permissions. */ export declare const PERMISSION_VARIABLES: readonly string[]; export declare function resolveCodePermissions(env?: NodeJS.ProcessEnv): CodePermissions; //# sourceMappingURL=limits.d.ts.map