Capability first · transport second

InMemoryCommunicationProvider.js

Implements deterministic in-memory thread/message/send behavior for demos and tests.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Implements deterministic in-memory thread/message/send behavior for demos and tests.

  • Artifact
    InMemoryCommunicationProvider.js · esm
  • Classification
    public first party
  • Availability
    Cross-host
  • Normalization
    Normalized communication entities.

Import and lifecycle

JavaScript
import inMemoryCommunicationProvider from '/arcane/modules/InMemoryCommunicationProvider.js';

Construction clones supplied entities into mutable in-memory thread/message state. send() appends one outbound message and advances a per-instance sequence; there is no I/O or global installation.

Application-facing behavior: default provider with listThreads(), getMessages(), send().

Protocol and host implementation

In-process only This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
defaultdefault · classclass InMemoryCommunicationProvider
CallableKindExact public signatureParameter syntax
InMemoryCommunicationProvider.listThreadspublic-memberasync listThreads()
InMemoryCommunicationProvider.getMessagespublic-memberasync getMessages(threadId)threadId
InMemoryCommunicationProvider.sendpublic-memberasync send({threadId,channel='other',body,recipients=[]}={}){threadId,channel='other',body,recipients=[]}={}
MemberKindExact public declarationParameter syntax
InMemoryCommunicationProvider.constructorconstructorconstructor({id='demo-provider',label='Demo provider',channels=['other'],threads=[],messages={}}={}){id='demo-provider',label='Demo provider',channels=['other'],threads=[],messages={}}={}
InMemoryCommunicationProvider.listThreadsasync methodasync listThreads()
InMemoryCommunicationProvider.getMessagesasync methodasync getMessages(threadId)threadId
InMemoryCommunicationProvider.sendasync methodasync send({threadId,channel='other',body,recipients=[]}={}){threadId,channel='other',body,recipients=[]}={}

Parameter meanings and results

new Provider({id,label,channels,threads,messages}); listThreads() resolves CommunicationThread[]; getMessages(threadId) resolves CommunicationMessage[]; send({threadId,channel='other',body,recipients=[]}) resolves a CommunicationMessage with a generated id/timestamp and status 'sent'.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

This artifact has no additional documented lifecycle event flow.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • CommunicationThread and CommunicationMessage validation errors propagate.

Availability and capabilities

Cross-host. Normalized communication entities.

None; this is a deterministic in-process provider.

Contract example

JavaScript
import Provider from '/arcane/modules/InMemoryCommunicationProvider.js';

const provider = new Provider({id:'demo', label:'Demo'});
console.log(await provider.listThreads());

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.