MemoryStorage
In-memory reference implementation of the Storage port.
State lives in a MemoryStore that outlives any one opened Storage, so tests can simulate a crash: close the
layer that owns a Harness mid-work, then open a new one over the same store. Reads and retained writes are detached
copies, matching the ownership boundary of serializing backends.
Since v0.0.0
MemoryStore (class)
Section titled “MemoryStore (class)”Durable state of one in-memory “database”. Shared by every Storage opened over it.
Signature
declare class MemoryStoreSince v0.0.0
recordTypes (property)
Section titled “recordTypes (property)”Signature
readonly recordTypes: Map<number, TableName>conversations (property)
Section titled “conversations (property)”Signature
readonly conversations: Map<any, ConversationRecord>conversationIds (property)
Section titled “conversationIds (property)”Signature
readonly conversationIds: Array<any>conversationIdsByOwnerConversation (property)
Section titled “conversationIdsByOwnerConversation (property)”Signature
readonly conversationIdsByOwnerConversation: Map<any, Array<any>>conversationIdsByOwnerTask (property)
Section titled “conversationIdsByOwnerTask (property)”Signature
readonly conversationIdsByOwnerTask: Map<any, Array<any>>entries (property)
Section titled “entries (property)”Signature
readonly entries: Map<any, EntryRecord>entryIds (property)
Section titled “entryIds (property)”Signature
readonly entryIds: Map<any, Array<any>>headEntryIds (property)
Section titled “headEntryIds (property)”Signature
readonly headEntryIds: Map<any, Array<any>>entryCommitSeqs (property)
Section titled “entryCommitSeqs (property)”Signature
readonly entryCommitSeqs: Map<any, any>tasks (property)
Section titled “tasks (property)”Signature
readonly tasks: Map<any, TaskRecord>taskIds (property)
Section titled “taskIds (property)”Signature
readonly taskIds: Array<any>taskIdsByStatus (property)
Section titled “taskIdsByStatus (property)”Signature
readonly taskIdsByStatus: Record<"pending" | "running" | "waiting" | "completing" | "terminal", Array<any>>submissions (property)
Section titled “submissions (property)”Signature
readonly submissions: Map<any, SubmissionRecord>submissionIds (property)
Section titled “submissionIds (property)”Signature
readonly submissionIds: Array<any>submissionIdsByStatus (property)
Section titled “submissionIdsByStatus (property)”Signature
readonly submissionIdsByStatus: Record<"queued" | "placed" | "done" | "unanswered", Array<any>>submissionIdsByRequest (property)
Section titled “submissionIdsByRequest (property)”Signature
readonly submissionIdsByRequest: Map<any, Map<string, any>>documents (property)
Section titled “documents (property)”Signature
readonly documents: Map<any, StoredDocumentState>documentAddresses (property)
Section titled “documentAddresses (property)”Signature
readonly documentAddresses: Map<string, AddressIndex>documentIdsByScope (property)
Section titled “documentIdsByScope (property)”Signature
readonly documentIdsByScope: Map<string, Array<any>>nextId (property)
Section titled “nextId (property)”Next mint candidate; ID 1 is reserved for the root conversation.
Signature
nextId: numbernextSeq (property)
Section titled “nextSeq (property)”Signature
nextSeq: numberA Storage over a fresh store that is discarded with the layer.
Signature
declare const layer: Layer.Layer<Storage>Since v0.0.0
layerFromStore
Section titled “layerFromStore”Open a Storage over an existing store. Closing the layer’s scope closes this handle only; the store keeps its
state for the next opener.
Signature
declare const layerFromStore: (store: MemoryStore) => Layer.Layer<Storage>Since v0.0.0
makeStore
Section titled “makeStore”A fresh, empty store.
Signature
declare const makeStore: () => MemoryStoreSince v0.0.0