Interfaces

InMemoryArtifacts

Interface: InMemoryArtifacts

Defined in: src/artifacts/inMemoryArtifacts.ts:74

The in-memory store, plus the accounting a bounded store owes its owner.

Extends

Properties

dropped

readonly dropped: number

Defined in: src/artifacts/inMemoryArtifacts.ts:78

Artifacts evicted by the byte/row budgets since construction (TTL expiry is the calendar doing its job and is not counted here). Non-zero means "resolve sooner, or raise the budget".


retention

readonly retention: ArtifactRetention

Defined in: src/artifacts/inMemoryArtifacts.ts:80

The dials in force, defaults included.

Methods

delete()

delete(scope, ref): Promise<void>

Defined in: src/artifacts/types.ts:243

Remove one artifact. No-op when it does not exist — deleting an absence is not an error, it is agreement.

Parameters

scope

MemoryIdentity

ref

string

Returns

Promise<void>

Inherited from

ArtifactStore.delete


get()

get(scope, ref): Promise<ArtifactRecord | null>

Defined in: src/artifacts/types.ts:239

The ticket and the payload. null for missing-or-expired. When the meta carries a digest, the payload is re-verified here — a mismatch throws ArtifactIntegrityError, never returns corrupt bytes as if whole.

Parameters

scope

MemoryIdentity

ref

string

Returns

Promise<ArtifactRecord | null>

Inherited from

ArtifactStore.get


getStream()?

optional getStream(scope, ref): Promise<ArtifactStreamRecord | null>

Defined in: src/artifacts/types.ts:274

OPTIONAL — read a payload as a stream of its canonical bytes. null for missing-or-expired, exactly like get. Absent on stores that would have to read the payload whole to answer; detect with canGetArtifactStream(store).

A digest on the meta is NOT re-verified here — verification needs the whole payload, which is the thing this member exists to avoid. get remains the verifying read, and the difference is stated rather than silently traded.

Parameters

scope

MemoryIdentity

ref

string

Returns

Promise<ArtifactStreamRecord | null>

Inherited from

ArtifactStore.getStream


head(scope, ref): Promise<ArtifactMeta | null>

Defined in: src/artifacts/types.ts:232

The ticket without the payload — the render-by-ref decision. null for missing-or-expired (the deliberate ambiguity; both mean "no data").

Parameters

scope

MemoryIdentity

ref

string

Returns

Promise<ArtifactMeta | null>

Inherited from

ArtifactStore.head


list()

list(scope, options?): Promise<ArtifactListResult>

Defined in: src/artifacts/types.ts:246

Page through this scope's tickets, newest first.

Parameters

scope

MemoryIdentity

options?

ArtifactListOptions

Returns

Promise<ArtifactListResult>

Inherited from

ArtifactStore.list


put()

put(scope, input): Promise<ArtifactPutResult>

Defined in: src/artifacts/types.ts:226

Store a payload; mint and return the ticket. Validates the input (a malformed put is refused by name), validates parentRefs resolve in the SAME scope, measures, optionally digests, stamps expiresAt from the store's retention — and reports what retention swept to make room.

Parameters

scope

MemoryIdentity

input

PutArtifactInput

Returns

Promise<ArtifactPutResult>

Inherited from

ArtifactStore.put


putStream()?

optional putStream(scope, input, body): Promise<ArtifactPutResult>

Defined in: src/artifacts/types.ts:257

OPTIONAL — store a payload the caller streams, without either side holding it whole. Absent on stores that cannot honor that promise; detect with canPutArtifactStream(store) before calling.

The stream is consumed exactly once. Everything else is put's law: parentRefs are proven first, retention plans against the DECLARED bytes, and the sweep rides the result.

Parameters

scope

MemoryIdentity

input

ArtifactStreamPutInput

body

ReadableStream<Uint8Array>

Returns

Promise<ArtifactPutResult>

Inherited from

ArtifactStore.putStream

On this page