Skip to content

LedgerAPI

Defined in: namespaces-core-plugins.ts:495

Durable forensic record + approval ledger (fn-94).

No bridge-level scope precheck — access is enforced row-level by the cross-plugin gate. Anti-enum: read denials degrade to []/null; markKeepForever on unknown/foreign rows throws sanitized unknownRef. Calls before plugin activation completes reject LEDGER_NOT_AVAILABLE.

Scopes: ledger.read.own, ledger.read.shared.

fn-94

query(filter): Promise<{ records: ExecutionRecord[]; nextScanCursor: AnyJSONValue; }>

Defined in: namespaces-core-plugins.ts:497

Queries ledger records.

AnyJSONValue

Promise<{ records: ExecutionRecord[]; nextScanCursor: AnyJSONValue; }>


get(recordId): Promise<ExecutionRecord | null>

Defined in: namespaces-core-plugins.ts:499

Gets one record, or null.

string

Promise<ExecutionRecord | null>


subscribe(filter, handler): Promise<string>

Defined in: namespaces-core-plugins.ts:501

Subscribes to matching new records. Returns a subscription id.

AnyJSONValue

(record) => void

Promise<string>


unsubscribe(subscriptionId): Promise<void>

Defined in: namespaces-core-plugins.ts:503

Cancels a subscription.

string

Promise<void>


markKeepForever(recordId): Promise<void>

Defined in: namespaces-core-plugins.ts:505

One-way pin: sets keepForever (nil → true; never reversible).

string

Promise<void>