mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 22:37:29 +00:00
feat(agentswarm): M4 — per-agent budget ledger + withBudget guard
BudgetLedger interface + InMemoryBudgetLedger reference impl (reserve/settle/ release with refund of unused holds; mirrors the b1dz budget+ledger concept). withBudget() wraps any SwarmRunner: reserves up front (throws SwarmError 402 when out of funds, before running), settles actual cost on success, releases on error. AgentIdentity DID aligns with @logicsrc/agentstack. 8 new tests; 27/27 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
925894359f
commit
dd7fe0b5c4
3 changed files with 202 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ export type {
|
|||
SwarmOptions,
|
||||
LLMRouterOptions
|
||||
} from "./swarm.js";
|
||||
export { InMemoryBudgetLedger, withBudget } from "./budget.js";
|
||||
export type { AgentIdentity, BudgetLedger, BudgetRunnerOptions } from "./budget.js";
|
||||
export { createRubricRunner, createLLMJudge } from "./rubric.js";
|
||||
export type {
|
||||
RubricEvaluation,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue