import type { OrgDaemon, RunningOrg } from '../daemon.js'; import type { OrgRole } from '../types.js'; import { SectionBudgetNotices } from './section-budget-notice.js'; import { type ScopeText } from './section-budget-text.js'; /** One closed scope: a section, the root reserve or the org. */ export interface ClosedScope extends ScopeText { key: string; /** Every role the scope covers when it closed. */ members: Set; /** The roles this closure closed (their mailbox was open); the others were closed already or never started. */ closedRoles: Set; /** Roles not yet spawned, set aside from `pendingRoles` and `deferredSpawns` (put back when it reopens). */ pending: Map; detail: string; } export interface SectionBudgetState { notices: SectionBudgetNotices; closed: Map; } /** Bind the section budget runtime to a started org: the notice journal, its delivery path and the usage hook. * Nothing happens for an org without a documents runtime. */ export declare function bindSectionBudget(daemon: OrgDaemon, name: string, running: RunningOrg): void; /** The usage hook: warn at 80 percent, close at 100, retry undelivered notices, keep a closed scope closed. */ export declare function evaluateSectionBudgets(running: RunningOrg): void; /** Why a role is closed for the scope it belongs to, or undefined (budget-closure.ts `budgetClosureDetail`). */ export declare function sectionClosureDetail(running: RunningOrg, roleId: string): string | undefined; /** What to tell the closed role's task creator to do (budget-closure.ts `remedy`). */ export declare function sectionClosureRemedy(running: RunningOrg, roleId: string): string | undefined; /** The refusal of a new assignment to `assignee`, or undefined when its scope is open. */ export declare function closedAssignmentRefusal(running: RunningOrg, assignee: string): string | undefined; /** After a reload: reopen each closed scope that is no longer at its allocation (spend kept), re-word the holds of * the ones still closed, then close any scope the new allocation is already under. Returns the roles that need * their held tasks dispatched again. */ export declare function reopenSectionClosures(running: RunningOrg): string[]; //# sourceMappingURL=section-budget-run.d.ts.map