Interface: CreditManagerOptions
Defined in: javascript/src/manager.ts:106
Optional behavioural knobs for the manager.
Properties
defaultTtlSeconds?
optionaldefaultTtlSeconds?:number
Defined in: javascript/src/manager.ts:125
Default lease TTL (seconds) for reserve/runBilled (default 600).
lazyExpiry?
optionallazyExpiry?:boolean
Defined in: javascript/src/manager.ts:137
Enable lazy-on-read credit expiry (default false, unchanged behaviour).
Allowance windows and lease TTLs are already lazy-on-read (checked via
expiresAt/window filters at read time); credit expiry otherwise requires
an explicit sweepExpiredCredits call (e.g. from a cron job). When
true, the manager transparently sweeps a user's own expired credits
(scoped to that user — never a global sweep) before getBalance,
getCreditTiers, deduct, deductFixed, deductTeam,
reserve, and settle so a caller never needs to run a cron job.
lowBalance?
optionallowBalance?:LowBalanceConfig|null
Defined in: javascript/src/manager.ts:123
credits.low_balance thresholds and handler (interface plan §6). When
omitted, the manager uses [engine.minBalance * 2] (documented default,
M18), resolved lazily. The event is edge-triggered: each configured
level fires only on the deduction that crosses it from above, never
repeatedly while already below it, and re-arms on top-up.
maxConcurrent?
optionalmaxConcurrent?:number|null
Defined in: javascript/src/manager.ts:115
Default maxConcurrent lease bound applied by the preset.
overdraftFloor?
optionaloverdraftFloor?:number|Decimal|null
Defined in: javascript/src/manager.ts:113
Negative balance floor for the overdraft preset (interface plan §1).
policy?
optionalpolicy?:PolicyPreset
Defined in: javascript/src/manager.ts:111
Financial-safety preset for planless users (interface plan §2). Defaults to
"strict_prepaid". Per-plan / per-call policy layers on top of this.