/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */ /** * Budget enforcement (see CHANGELOG 0.38.0). Enforcement point is BEFORE the * scheduler claims an item into a new phase (i.e. before a new agent spawn) *, never mid-item. An in-flight item's phase always runs to completion even * if a later check here would refuse a NEW claim: honest semantics, never a * mid-run kill on budget. * * Usage is summed directly from WorkItem.usage, which phase-runner.ts * populates from the SAME `priceUsage` function threaded through * OrchestrationEngineDeps, the single cost source shared with the fleet * registry (registry.ts ProcessRegistryDeps.priceUsage), so budget checks and * fleet cost totals can never double-count against each other. */ import type { WorkItem, Workstream } from './types.js'; export interface BudgetCheck { readonly allowed: boolean; readonly reason?: string | undefined; /** * A dollar budget's honest blind spot: usage the ceiling could not see * because its model resolved to no price. Present whenever the workstream * carries a maxCostUsd budget, so callers can state "N tokens unpriced" * instead of implying the ceiling covered everything. */ readonly unpricedTokens?: number | undefined; readonly unpricedItems?: number | undefined; } /** Tokens/items whose spend a dollar ceiling cannot see (model resolved to no price). */ export declare function budgetBlindSpot(workstream: Workstream): { unpricedTokens: number; unpricedItems: number; }; /** * Refuses a NEW claim once the workstream's running total has reached its * ceiling. Never mid-item. When `item` is supplied and carries its own * `itemBudget`, that per-item ceiling is checked too (against the item's own * usage), a best-of-N attempt, or any opted-in item, can be bounded * independently of the workstream (see WorkItem.itemBudget). The stricter of the * two refuses. */ export declare function checkBudget(workstream: Workstream, item?: WorkItem): BudgetCheck; //# sourceMappingURL=budget.d.ts.map