Skip to main content

Class: InMemoryCompoundCreditStore

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:462

Compound credit in memory, for tests and one process. Transactions run one at a time, each on a copy of the state that replaces the state only when the transaction resolves; a transaction that throws leaves nothing.

Implements​

Constructors​

Constructor​

new InMemoryCompoundCreditStore(): InMemoryCompoundCreditStore

Returns​

InMemoryCompoundCreditStore

Properties​

state​

protected state: CreditState

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:464

The committed state.

Methods​

withTransaction()​

withTransaction<T>(fn): Promise<T>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:467

Runs fn in one transaction: every write of it commits, or none does.

Type Parameters​

T​

T

Parameters​

fn​

(trx) => Promise<T>

Returns​

Promise<T>

Implementation of​

ICompoundCreditStore.withTransaction