JOLT SDK · API REFERENCE

jolt-sdk

Every exported class, interface, function, and type across the SDK modules, generated from the committed typedoc output. Start with the SDK overview or the app development guide.

modulejolt-sdk

jolt-sdk: the TypeScript SDK for building applications on the Jolt network.

Layers, top to bottom:

  1. Client (createJoltClient): domain-shaped operations with tolerant reads. What applications program against.
  2. Operations: one typed function per stable daemon endpoint, for the rare call the client does not wrap.
  3. Transports: how requests reach the daemon. Import one from jolt-sdk/transport-http or jolt-sdk/transport-tauri, or the fake from jolt-sdk/testing.

Quick start (browser or Node.js):

import { createJoltClient } from "jolt-sdk";
import { HttpTransport } from "jolt-sdk/transport-http";

let token = "";
const jolt = createJoltClient({
  transport: new HttpTransport({ daemonUrl: "http://127.0.0.1:9862" }),
  getSessionToken: () => token,
});

const request = await jolt.requestSession({
  appId: "myapp.local",
  appName: "My App",
  appOrigin: "http://127.0.0.1:5173",
  identity: (await jolt.getStatus()).identity_address,
  capabilities: ["publish:/myapp/*", "resolve:public", "fetch:public"],
});
// ...poll jolt.getSessionRequestStatus(request.request_id) until it
// carries a session_token (the user approves in Jolt Console), then:
await jolt.publishJson("/myapp/hello", { hello: "world" });

References

re-exportSessionRequest

Re-export of index.operations.SessionRequest.

Namespaces

namespaceoperations

Typed daemon operations over a JoltTransport.

One function per daemon endpoint the application contract declares stable. These are the lowest app-facing layer: wire DTOs in and out, no domain marshalling. Most applications should use the client from createJoltClient instead and drop to operations only for endpoints the client does not wrap (e.g. binary publish).

typeSessionRequest

type SessionRequest = { ... }

What an app declares when opening a Jolt session.

PropertyTypeDescription
appIdstring
appNamestring
appOriginstring
capabilitiesreadonly string[]Requested capability strings, e.g. publish:/myapp/*.
identitystring | nullThe identity whose authority the session requests, or null for local identity discovery.

functionacceptIngress

function acceptIngress(transport: JoltTransport, token: string, ingressId: string, options?: CallOptions): Promise<IngressRecord>

Accept a pending ingress envelope.

ParameterTypeNotes
transportJoltTransport
tokenstring
ingressIdstring
optionsCallOptionsoptional

functionappendPublishJson

function appendPublishJson(transport: JoltTransport, token: string, path: string, body: object, options?: CallOptions): Promise<PublishResponse>

Publish a coexisting device-writer append record at path. Append records never overwrite each other, so concurrent writers are safe; read them back with enumerate, never with resolve.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
optionsCallOptionsoptional

functioncreateDataSubscription

function createDataSubscription(transport: JoltTransport, token: string, identity: string, prefix: string, options?: CallOptions): Promise<DataSubscriptionRecordResponse>

Register one session-owned identity/path-prefix Data Subscription.

ParameterTypeNotes
transportJoltTransport
tokenstring
identitystring
prefixstring
optionsCallOptionsoptional

functiondecryptEncryptedTarget

function decryptEncryptedTarget(transport: JoltTransport, token: string, target: string, options?: CallOptions): Promise<DecryptedEncryptedObject>

Resolve + decrypt an encrypted publication addressed to this session's identity.

ParameterTypeNotes
transportJoltTransport
tokenstring
targetstring
optionsCallOptionsoptional

functiondeleteLocalRecord

function deleteLocalRecord(transport: JoltTransport, token: string, path: string, revision: string, mutationId: string, observedRevisions: undefined | readonly string[], options?: CallOptions): Promise<LocalRecordDeleteResponse>

Compare-and-set one local stable record to a Tombstone.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
revisionstring
mutationIdstring
observedRevisionsundefined | readonly string[]
optionsCallOptionsoptional

functionenumerate

function enumerate(transport: JoltTransport, token: string, identity: string, pathPrefix: string, options?: CallOptions): Promise<AppendRecordInfo[]>

List an identity's append records under a path prefix.

ParameterTypeNotes
transportJoltTransport
tokenstring
identitystring
pathPrefixstring
optionsCallOptionsoptional

functionfetchTarget

function fetchTarget(transport: JoltTransport, token: string, target: string, options?: CallOptions): Promise<FetchResult>

Fetch raw bytes by content id or address.

ParameterTypeNotes
transportJoltTransport
tokenstring
targetstring
optionsCallOptionsoptional

functiongetAppApiFeatures

function getAppApiFeatures(transport: JoltTransport, options?: CallOptions): Promise<AppApiFeatureManifestResponse>

Generic App API behavior advertised by the local daemon.

ParameterTypeNotes
transportJoltTransport
optionsCallOptionsoptional

functiongetCurrentSession

function getCurrentSession(transport: JoltTransport, token: string, options?: CallOptions): Promise<CurrentAppSession>

The session behind a bearer token, as the daemon sees it.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functiongetDataSubscriptionView

function getDataSubscriptionView(transport: JoltTransport, token: string, subscriptionId: string, options?: CallOptions): Promise<DataSubscriptionViewResponse>

Perform a bounded refresh and read one subscription's Last Verified View.

ParameterTypeNotes
transportJoltTransport
tokenstring
subscriptionIdstring
optionsCallOptionsoptional

functiongetSessionRequestStatus

function getSessionRequestStatus(transport: JoltTransport, requestId: string, options?: CallOptions): Promise<AppSessionStatusResponse>

Poll a session request until it carries a session_token.

ParameterTypeNotes
transportJoltTransport
requestIdstring
optionsCallOptionsoptional

functiongetStatus

function getStatus(transport: JoltTransport, options?: CallOptions): Promise<NodeStatus>

Local daemon status: identity address, peer id, connectivity.

ParameterTypeNotes
transportJoltTransport
optionsCallOptionsoptional

functionlistDataSubscriptions

function listDataSubscriptions(transport: JoltTransport, token: string, options?: CallOptions): Promise<DataSubscriptionRecordResponse[]>

List Data Subscriptions owned by the current app session.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functionlistPendingIngress

function listPendingIngress(transport: JoltTransport, token: string, options?: CallOptions): Promise<IngressRecord[]>

Pending ingress envelopes awaiting review.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functionlistPublished

function listPublished(transport: JoltTransport, token: string, options?: CallOptions): Promise<PublishedContent[]>

This node's published inventory.

ParameterTypeNotes
transportJoltTransport
tokenstring
optionsCallOptionsoptional

functionnextDataSubscriptionChange

function nextDataSubscriptionChange(transport: JoltTransport, token: string, subscriptionId: string, cursor?: string, options?: CallOptions): Promise<DataSubscriptionChangeResponse>

Wait for one bounded local Materialized View event after cursor.

ParameterTypeNotes
transportJoltTransport
tokenstring
subscriptionIdstring
cursorstringoptional
optionsCallOptionsoptional

functionopenEncryptedTarget

function openEncryptedTarget(transport: JoltTransport, token: string, target: string, path?: string, options?: CallOptions): Promise<OpenedEncryptedObject>

Open encrypted content, preserving ciphertext when this identity cannot decrypt it.

ParameterTypeNotes
transportJoltTransport
tokenstring
targetstring
pathstringoptional
optionsCallOptionsoptional

functionopenIngress

function openIngress(transport: JoltTransport, token: string, ingressId: string, options?: CallOptions): Promise<DecryptedIngress>

Decrypt a pending ingress envelope without deciding it.

ParameterTypeNotes
transportJoltTransport
tokenstring
ingressIdstring
optionsCallOptionsoptional

functionpinHomeRelay

function pinHomeRelay(transport: JoltTransport, token: string, contentId: string, path?: string, options?: CallOptions): Promise<HomeRelayPinResponse>

Ask the configured home relay to retain one of this app's own publications.

ParameterTypeNotes
transportJoltTransport
tokenstring
contentIdstring
pathstringoptional
optionsCallOptionsoptional

functionpublishBytes

function publishBytes(transport: JoltTransport, token: string, path: string, bytes: Uint8Array<ArrayBufferLike>, meta: { fileName: string; mimeType: string }, options?: CallOptions): Promise<PublishResponse>

Publish raw bytes (images, media) at a signed path.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bytesUint8Array<ArrayBufferLike>
meta{ fileName: string; mimeType: string }
optionsCallOptionsoptional

functionpublishEncryptedBytes

function publishEncryptedBytes(transport: JoltTransport, token: string, path: string, plaintext: Uint8Array<ArrayBufferLike>, meta: { mimeType: string; recipients: string[] }, options?: CallOptions): Promise<EncryptedPublishResponse>

Publish raw bytes encrypted to recipients.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
plaintextUint8Array<ArrayBufferLike>
meta{ mimeType: string; recipients: string[] }
optionsCallOptionsoptional

functionpublishEncryptedJson

function publishEncryptedJson(transport: JoltTransport, token: string, path: string, body: object, recipients: string[], options?: CallOptions): Promise<EncryptedPublishResponse>

Publish a JSON object encrypted to recipients (identity addresses).

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
recipientsstring[]
optionsCallOptionsoptional

functionpublishJson

function publishJson(transport: JoltTransport, token: string, path: string, body: object, options?: CallOptions): Promise<PublishResponse>

Publish a JSON object at a signed path (last-writer-wins update log).

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
optionsCallOptionsoptional

functionreadLocalRecord

function readLocalRecord(transport: JoltTransport, token: string, path: string, options?: CallOptions): Promise<LocalRecordReadResponse>

Read one path from the local identity's authoritative singleton state.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
optionsCallOptionsoptional

functionrejectIngress

function rejectIngress(transport: JoltTransport, token: string, ingressId: string, options?: CallOptions): Promise<IngressRecord>

Reject a pending ingress envelope.

ParameterTypeNotes
transportJoltTransport
tokenstring
ingressIdstring
optionsCallOptionsoptional

functionremoveDataSubscription

function removeDataSubscription(transport: JoltTransport, token: string, subscriptionId: string, options?: CallOptions): Promise<RemoveDataSubscriptionResponse>

Remove one Data Subscription owned by the current app session.

ParameterTypeNotes
transportJoltTransport
tokenstring
subscriptionIdstring
optionsCallOptionsoptional

functionrequestSession

function requestSession(transport: JoltTransport, req: SessionRequest, options?: CallOptions): Promise<AppSessionRequestResponse>

Ask the daemon for a scoped session. The user approves it in Jolt Console.

ParameterTypeNotes
transportJoltTransport
reqSessionRequest
optionsCallOptionsoptional

functionresolveAddress

function resolveAddress(transport: JoltTransport, token: string, address: string, options?: CallOptions): Promise<ResolveResponse>

Resolve a .jolt address (identity + path) to its current content id.

ParameterTypeNotes
transportJoltTransport
tokenstring
addressstring
optionsCallOptionsoptional

functionrestoreLocalRecord

function restoreLocalRecord(transport: JoltTransport, token: string, path: string, body: object, revision: string, mutationId: string, observedRevisions: undefined | readonly string[], options?: CallOptions): Promise<LocalRecordRestoreResponse>

Compare-and-set one local Tombstone to new immutable content.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
revisionstring
mutationIdstring
observedRevisionsundefined | readonly string[]
optionsCallOptionsoptional

functionsendIngress

function sendIngress(transport: JoltTransport, token: string, req: { encryptedObject: number[]; expiresAt?: number; recipient: string }, options?: CallOptions): Promise<IngressRecord>

Deliver an already-encrypted object to a recipient's daemon (/app/v1/ingress/send). Most apps should use the client's sendObject, which also publishes the sender's own encrypted copy.

ParameterTypeNotes
transportJoltTransport
tokenstring
req{ encryptedObject: number[]; expiresAt?: number; recipient: string }
optionsCallOptionsoptional

functionupdateLocalRecord

function updateLocalRecord(transport: JoltTransport, token: string, path: string, body: object, revision: string, mutationId: string, observedRevisions: undefined | readonly string[], options?: CallOptions): Promise<LocalRecordUpdateResponse>

Compare-and-set one local stable record against an observed revision.

ParameterTypeNotes
transportJoltTransport
tokenstring
pathstring
bodyobject
revisionstring
mutationIdstring
observedRevisionsundefined | readonly string[]
optionsCallOptionsoptional

Classes

classJoltApiError

The daemon (or its dev proxy) answered with a non-success status.

The daemon's JSON error body, when present, is preserved on body and its error field becomes the message.

new JoltApiError

new JoltApiError(message: string, options?: { body?: unknown; code?: string; status?: number }): JoltApiError
ParameterTypeNotes
messagestring
options{ body?: unknown; code?: string; status?: number }defaults to {}
PropertyTypeDescription
readonly body?unknownThe raw parsed error body, for callers that need more than the message.
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
readonly code?stringMachine-readable error code from the daemon body (e.g. app_session_unauthorized), when present.
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string
PropertyTypeDescription
readonly status?numberHTTP status code of the response, when the transport had one.

classJoltTransportError

The daemon could not be reached at all: connection refused, DNS failure, aborted request, or timeout. The cause carries the underlying error.

new JoltTransportError

new JoltTransportError(message: string, options?: { cause?: unknown }): JoltTransportError
ParameterTypeNotes
messagestring
options{ cause?: unknown }defaults to {}
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

Interfaces

interfaceJoltAppendSdk

Coexisting append records and their enumeration.

enumerate

enumerate(identity: string, pathPrefix: string, options?: CallOptions): Promise<EnumeratedRecord[]>

List an identity's append records under a path prefix.

ParameterTypeNotes
identitystring
pathPrefixstring
optionsCallOptionsoptional

publishAppend

publishAppend(path: string, body: object, options?: CallOptions): Promise<PublishResult>

Publish a coexisting device-writer append record at path.

ParameterTypeNotes
pathstring
bodyobject
optionsCallOptionsoptional

interfaceJoltAvailabilitySdk

Explicit application-owned requests for delegated content availability.

pinHomeRelay

pinHomeRelay(contentId: string, path?: string, options?: CallOptions): Promise<HomeRelayPinResult>

Ask the configured home relay to retain one of this app's own publications.

ParameterTypeNotes
contentIdstring
pathstringoptional
optionsCallOptionsoptional

interfaceJoltCompatibilitySdk

App API compatibility checks that require no app session.

checkCompatibility

checkCompatibility(declaration: AppCompatibilityDeclaration, options?: CompatibilityCheckOptions): Promise<AppCompatibilityResult>
ParameterTypeNotes
declarationAppCompatibilityDeclaration
optionsCompatibilityCheckOptionsoptional

interfaceJoltEncryptedSdk

Encrypted publish and tolerant encrypted reads.

listPublished

listPublished(options?: CallOptions): Promise<PublishedContent[]>

The local node's published inventory.

ParameterTypeNotes
optionsCallOptionsoptional

openEncrypted

openEncrypted(target: string, path?: string, options?: CallOptions): Promise<OpenEncryptedResult>

Open encrypted content without hiding a ciphertext-only result.

ParameterTypeNotes
targetstring
pathstringoptional
optionsCallOptionsoptional

publishEncryptedJson

publishEncryptedJson(path: string, body: object, recipients: string[], options?: CallOptions): Promise<PublishResult>

Publish a JSON body encrypted to recipients (identity addresses). Use [self] for an encrypt-to-self publication; the publisher can always decrypt its own publications, so readEncrypted reads them back.

ParameterTypeNotes
pathstring
bodyobject
recipientsstring[]
optionsCallOptionsoptional

readEncrypted

readEncrypted<T>(ref: Reference, decode: Decoder<T>, options?: CallOptions): Promise<null | Versioned<T>>

Resolve + decrypt + parse + decode; null on any failing step.

ParameterTypeNotes
refReference
decodeDecoder<T>
optionsCallOptionsoptional

interfaceJoltIngressSdk

The recipient-controlled ingress door: deliver identified objects to another identity's daemon and review what arrives at yours. Transport-level vocabulary only; classifying payloads is the app's job.

acceptIngress

acceptIngress(ingressId: string, options?: CallOptions): Promise<void>
ParameterTypeNotes
ingressIdstring
optionsCallOptionsoptional

listPendingIngress

listPendingIngress(options?: CallOptions): Promise<IngressRecord[]>
ParameterTypeNotes
optionsCallOptionsoptional

openIngress

openIngress(ingressId: string, options?: CallOptions): Promise<unknown>

Decrypt a pending envelope and return its parsed JSON, or null.

ParameterTypeNotes
ingressIdstring
optionsCallOptionsoptional

rejectIngress

rejectIngress(ingressId: string, options?: CallOptions): Promise<void>
ParameterTypeNotes
ingressIdstring
optionsCallOptionsoptional

sendObject

sendObject(recipient: string, path: string, body: object, options?: CallOptions): Promise<PublishResult>

Encrypt-publish the object at path (the sender's own copy) and deliver it to recipient's daemon. Returns the publish result so the sender can version its own copy.

ParameterTypeNotes
recipientstring
pathstring
bodyobject
optionsCallOptionsoptional

interfaceJoltSdk

Public publish and tolerant versioned reads.

deleteRecord

deleteRecord(ref: Reference, mutation: RecordMutationContext, options?: CallOptions): Promise<RecordDeletedResult>

Compare-and-set one present local stable record to a Tombstone.

ParameterTypeNotes
refReference
mutationRecordMutationContext
optionsCallOptionsoptional

publishJson

publishJson(path: string, body: object, options?: CallOptions): Promise<PublishResult>

Publish a JSON object at a signed path (last-writer-wins).

ParameterTypeNotes
pathstring
bodyobject
optionsCallOptionsoptional

read

read<T>(ref: Reference, decode: Decoder<T>, options?: CallOptions): Promise<null | Versioned<T>>

Resolve, fetch, parse, and decode a publication. Returns null when the reference is missing/unreachable or the bytes do not decode to T.

ParameterTypeNotes
refReference
decodeDecoder<T>
optionsCallOptionsoptional

readContent

readContent<T>(contentId: string, ref: Reference, latestSequence: number, decode: Decoder<T>, options?: CallOptions): Promise<null | Versioned<T>>

Fetch a known content id (from an enumerated append record), then parse and decode it against the supplied logical reference.

ParameterTypeNotes
contentIdstring
refReference
latestSequencenumber
decodeDecoder<T>
optionsCallOptionsoptional

readRecord

readRecord(ref: Reference, options?: CallOptions): Promise<RecordReadResult>

Read authoritative local record state without collapsing failures into absence.

ParameterTypeNotes
refReference
optionsCallOptionsoptional

resolve

resolve(ref: Reference, options?: CallOptions): Promise<ResolvedReference>

Resolve a reference strictly, preserving daemon errors such as Tombstones.

ParameterTypeNotes
refReference
optionsCallOptionsoptional

restoreRecord

restoreRecord(ref: Reference, body: object, mutation: RecordMutationContext, options?: CallOptions): Promise<RecordPresentResult>

Compare-and-set one local Tombstone to new immutable content.

ParameterTypeNotes
refReference
bodyobject
mutationRecordMutationContext
optionsCallOptionsoptional

updateRecord

updateRecord(ref: Reference, body: object, mutation: RecordMutationContext, options?: CallOptions): Promise<RecordPresentResult>

Compare-and-set one local stable record against an observed revision.

ParameterTypeNotes
refReference
bodyobject
mutationRecordMutationContext
optionsCallOptionsoptional

interfaceJoltSessionSdk

Session bootstrap and daemon status, bound to the client's transport.

getCurrentSession

getCurrentSession(options?: CallOptions): Promise<CurrentAppSession>

The session behind the current token, as the daemon sees it.

ParameterTypeNotes
optionsCallOptionsoptional

getSessionRequestStatus

getSessionRequestStatus(requestId: string, options?: CallOptions): Promise<AppSessionStatusResponse>

Poll a session request until it carries a token.

ParameterTypeNotes
requestIdstring
optionsCallOptionsoptional

getStatus

getStatus(options?: CallOptions): Promise<NodeStatus>

Local daemon status (no session required).

ParameterTypeNotes
optionsCallOptionsoptional

requestSession

requestSession(req: SessionRequest, options?: CallOptions): Promise<AppSessionRequestResponse>

Ask the daemon for a scoped session; the user approves it in Console.

ParameterTypeNotes
reqSessionRequest
optionsCallOptionsoptional

interfaceJoltTransport

The single interface a transport implements.

Implementations must throw JoltApiError for non-success daemon responses and JoltTransportError for network-level failures, so application error handling is uniform across runtimes.

request

request<T>(base: ApiBase, path: string, req?: TransportRequest): Promise<T>

Send a JSON request to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportRequestoptional

upload

upload<T>(base: ApiBase, path: string, req: TransportUpload): Promise<T>

Send a multipart file upload to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportUpload

Type Aliases

typeApiBase

type ApiBase = "app" | "daemon"

Which daemon API surface a request targets.

typeAppApiFeatureManifest

type AppApiFeatureManifest = { ... }

Generic App API behavior available through the connected daemon.

PropertyTypeDescription
appApinumber
discovery"advertised" | "legacy"
featuresReadonly<Record<string, number>>

typeAppApiFeatureManifestResponse

type AppApiFeatureManifestResponse = { ... }

/app/v1/features: generic behavior implemented by this App API.

PropertyTypeDescription
app_apinumber
featuresRecord<string, number>

typeAppCompatibilityDeclaration

type AppCompatibilityDeclaration = { ... }

App-owned runtime requirements, independent of daemon release versions.

PropertyTypeDescription
appApinumber
optionalFeatures?Readonly<Record<string, number>>
requiredFeatures?Readonly<Record<string, number>>

typeAppCompatibilityDeclarationWire

type AppCompatibilityDeclarationWire = { ... }

JSON representation embedded in signed application update manifests.

PropertyTypeDescription
app_apinumber
optional_featuresReadonly<Record<string, number>>
required_featuresReadonly<Record<string, number>>

typeAppCompatibilityResult

type AppCompatibilityResult = { ... }

Complete compatibility result; applications own optional fallback choices.

PropertyTypeDescription
appApiContractLevelCheck
manifestAppApiFeatureManifest
optionalFeaturesReadonly<Record<string, ContractLevelCheck>>
requiredFeaturesReadonly<Record<string, ContractLevelCheck>>
status"compatible" | "incompatible"

typeAppendRecordInfo

type AppendRecordInfo = { ... }

One device-writer append record as enumeration returns it (/app/v1/enumerate).

PropertyTypeDescription
content_idstring
created_atnumber
device_idstring
device_sequencenumber
entry_hashstring
pathstring

typeAppSessionRequestResponse

type AppSessionRequestResponse = { ... }

Response to a session request (/app/v1/sessions/request).

PropertyTypeDescription
request_idstring
statusAppSessionStatus

typeAppSessionStatus

type AppSessionStatus = "pending" | "active" | "rejected" | "revoked" | "expired"

Lifecycle states of an app session.

typeAppSessionStatusResponse

type AppSessionStatusResponse = { ... }

Polled session request status (/app/v1/sessions/{request_id}).

PropertyTypeDescription
capabilitiesstring[]
expires_at?number | null
identity?string | null
request_idstring
session_id?string | null
session_token?string | null
statusAppSessionStatus

typeCallOptions

type CallOptions = { ... }

Options accepted by every SDK operation.

signal aborts the request; timeoutMs fails it with a JoltTransportError after the given time. Both may be combined.

PropertyTypeDescription
signal?AbortSignal
timeoutMs?number

typeCompatibilityCheckOptions

type CompatibilityCheckOptions = CallOptions & { ... }

Compatibility call controls; refresh after daemon reconnection.

PropertyTypeDescription
refresh?boolean

typeContractLevelCheck

type ContractLevelCheck = { ... }

One comparison between an application requirement and daemon support.

PropertyTypeDescription
availableLevelnumber | null
requiredLevelnumber
supportedboolean

typeCurrentAppSession

type CurrentAppSession = { ... }

The current session, as seen by the daemon (/app/v1/session).

PropertyTypeDescription
app_idstring
app_namestring
expires_at?number | null
granted_capabilitiesstring[]
identity?string | null
last_used_at?number | null
request_idstring
session_id?string | null
statusAppSessionStatus

typeDataSubscriptionChangeResponse

type DataSubscriptionChangeResponse = { cursor: string; identity: string; records: MaterializedRecordInfo[]; state: DataSubscriptionRefreshResponse; type: "snapshot" } | { cursor: string; identity: string; records: MaterializedRecordInfo[]; removed: string[]; type: "changed" } | { cursor: string; state: DataSubscriptionRefreshResponse; type: "state" } | { cursor: string; type: "timeout" } | { type: "resync_required" } | { type: "cancelled" } | { type: "revoked" }

One bounded local Materialized View event returned by a Change Stream poll.

typeDataSubscriptionRecordResponse

type DataSubscriptionRecordResponse = { ... }

Persisted Data Subscription metadata owned by the current app session.

PropertyTypeDescription
created_atnumber
idstring
identitystring
lifecycle"active" | "dormant"
prefixstring
refreshDataSubscriptionRefreshResponse

typeDataSubscriptionRefreshResponse

type DataSubscriptionRefreshResponse = { status: "loading" } | { last_verified_at?: number; status: "updating" } | { last_verified_at: number; status: "ready" } | { last_verified_at: number; reason: "networkUnavailable" | "verificationFailed" | "overloaded"; status: "stale" } | { reason: "networkUnavailable" | "verificationFailed" | "overloaded"; status: "unavailable" }

One Data Subscription's last bounded refresh state.

typeDataSubscriptionViewResponse

type DataSubscriptionViewResponse = { ... }

Last verified records plus the outcome of this subscription refresh.

PropertyTypeDescription
identitystring
recordsMaterializedRecordInfo[]
source{ state: DataSubscriptionRefreshResponse; subscription: string }

typeDecoder

type Decoder<T> = (value: unknown) => T | null

A decoder is the app's schema-level reader: it validates an already-parsed JSON value into a canonical type, or returns null to reject it. Decoders never see bytes or transport concerns.

typeDecryptedEncryptedObject

type DecryptedEncryptedObject = { ... }

Decrypted encrypted publication (/app/v1/encrypted/decrypt).

PropertyTypeDescription
content_idstring
content_typestring
pathstring
plaintextnumber[]
sizenumber

typeDecryptedIngress

type DecryptedIngress = { ... }

Decrypted ingress payload (/app/v1/ingress/{id}/open).

PropertyTypeDescription
content_typestring
plaintextnumber[]
sizenumber

typeEncryptedPublishResponse

type EncryptedPublishResponse = PublishResponse & { ... }

Result of an encrypted publish (/app/v1/encrypted/publish).

PropertyTypeDescription
recipient_countnumber

typeEnumeratedRecord

type EnumeratedRecord = { ... }

One append record, marshalled into domain shape.

PropertyTypeDescription
contentIdstring
createdAtnumber
deviceIdstring
deviceSequencenumber
entryHashstring
identitystring
pathstring

typeFetchResult

type FetchResult = { ... }

Raw bytes fetched by content id (/app/v1/fetch).

PropertyTypeDescription
content_idstring
datanumber[]
sizenumber

typeHomeRelayPinResponse

type HomeRelayPinResponse = { ... }

Result of requesting availability from the configured home relay.

PropertyTypeDescription
content_idstring
latest_sequencenumber
ownerstring
relaystring
sizenumber
statusstring

typeHomeRelayPinResult

type HomeRelayPinResult = { ... }

Confirmation that a home relay accepted an availability request.

PropertyTypeDescription
contentIdstring
latestSequencenumber
ownerstring
relaystring
sizenumber
statusstring

typeIngressRecord

type IngressRecord = { ... }

One recipient-controlled ingress envelope awaiting (or past) review.

PropertyTypeDescription
accepted_at?number | null
expires_at?number | null
ingress_idstring
received_atnumber
receiver_idstring
recipient_identitystring
rejected_at?number | null
schema_hint?string | null
sender_identitystring
sizenumber
status"pending" | "accepted" | "rejected"

typeJoltClient

type JoltClient = JoltSdk & JoltAppendSdk & JoltEncryptedSdk & JoltAvailabilitySdk & JoltIngressSdk & JoltSessionSdk & JoltCompatibilitySdk & { ... }

Everything a typical Jolt application needs, in one object.

PropertyTypeDescription
readonly transportJoltTransportThe transport backing this client, for operations the client does not wrap.

typeJoltClientOptions

type JoltClientOptions = { ... }

Configuration for createJoltClient.

PropertyTypeDescription
getSessionToken() => stringWhere the client finds the current session token. Called per request so token rotation needs no client rebuild.
transportJoltTransport

typeLocalRecordDeleteResponse

type LocalRecordDeleteResponse = { ... }

Successful compare-and-set deletion of one local stable record.

PropertyTypeDescription
pathstring
revisionstring

typeLocalRecordHeadResponse

type LocalRecordHeadResponse = { revision: string; state: "deleted" } | { content_id: string; data: number[]; revision: string; state: "present" }

One current or common-base head in a local record conflict.

typeLocalRecordReadResponse

type LocalRecordReadResponse = { path: string; state: "missing" } | { path: string } & LocalRecordHeadResponse | { alternatives: LocalRecordHeadResponse[]; base?: LocalRecordHeadResponse; path: string; state: "conflicted" }

Result of reading one authoritative local singleton path (/app/v1/records/read).

typeLocalRecordRestoreResponse

type LocalRecordRestoreResponse = LocalRecordUpdateResponse

Successful compare-and-set restoration of one local stable record.

typeLocalRecordUpdateResponse

type LocalRecordUpdateResponse = { ... }

Successful compare-and-set write of one local stable record.

PropertyTypeDescription
content_idstring
datanumber[]
pathstring
revisionstring

typeMaterializedRecordInfo

type MaterializedRecordInfo = { ... }

One current non-deleted logical record in a Materialized View.

PropertyTypeDescription
content_idstring
created_atnumber
pathstring
revisionstring

typeNodeStatus

type NodeStatus = { ... }

/api/v1/status: the local daemon's identity and connectivity summary.

PropertyTypeDescription
active_relaysnumber
bootstrap_relayboolean
bootstrap_statestring
cached_countnumber
configured_bootstrap_relay_countnumber
configured_bootstrap_relaysstring[]
connected_bootstrap_peersnumber
connected_peersnumber
daemon_versionstring
direct_peersnumber
effective_bootstrap_relay_countnumber
effective_bootstrap_relaysstring[]
home_relaynull | { api_url?: string | null; capability: "unknown" | "discovery_only" | "pinning"; multiaddr: string; peer_id: string }
identity_addressstring
known_relay_countnumber
last_bootstrap_errorstring | null
listen_addressesstring[]
local_device_idstring
nat_typestring
peer_idstring
published_countnumber
relay_record?unknown | null
relayed_peersnumber
uptime_secsnumber

typeOpenedEncryptedObject

type OpenedEncryptedObject = { ... }

Encrypted bytes opened with plaintext when this identity can decrypt them.

PropertyTypeDescription
access_status"available" | "needs_rewrap" | "not_accessible"
ciphertext?number[] | null
content_idstring
content_type?string | null
decrypt_error?string | null
pathstring
plaintext?number[] | null
sizenumber
status"decrypted" | "ciphertext"

typeOpenEncryptedResult

type OpenEncryptedResult = { ... }

Encrypted content plus the daemon's honest decrypt/access state.

PropertyTypeDescription
accessStatus"available" | "needs_rewrap" | "not_accessible"
bytesnumber[]
contentIdstring
contentTypestring | null
decryptErrorstring | null
pathstring
sizenumber
status"decrypted" | "ciphertext"

typePublishedContent

type PublishedContent = { ... }

One locally published item (/app/v1/published).

PropertyTypeDescription
address?string | null
content_idstring
local_sequence?number | null
path?string | null
pin_statestring
pinned_content_id?string | null
pinned_sequence?number | null
relay?null | { api_url?: string | null; multiaddr: string; peer_id: string }
sizenumber

typePublishResponse

type PublishResponse = { ... }

Result of a public publish (/app/v1/publish).

PropertyTypeDescription
address?string | null
content_idstring
latest_sequence?number | null
path?string | null
revision?string | null
sizenumber

typePublishResult

type PublishResult = { ... }

Result of any publish, in domain (camelCase) shape.

PropertyTypeDescription
addressstring | null
contentIdstring
latestSequencenumber
pathstring
revision?stringOpaque stable-record revision when the daemon bound a singleton path.

typeRecordConflictResult

type RecordConflictResult = { ... }

Every current local record head, plus an unambiguous common base when known.

PropertyTypeDescription
alternativesRecordHeadResult[]Canonical deterministic winner order; the final alternative wins.
base?RecordHeadResult
refReference
state"conflicted"

typeRecordDeletedResult

type RecordDeletedResult = { ... }

One authoritative local stable record whose current state is a Tombstone.

PropertyTypeDescription
refReference
revisionstring
state"deleted"

typeRecordHeadResult

type RecordHeadResult = RecordDeletedResult | RecordPresentResult

One immutable current or common-base head in a local record conflict.

typeRecordMissingResult

type RecordMissingResult = { ... }

One authoritative local stable record reference that has no current value.

PropertyTypeDescription
refReference
state"missing"

typeRecordMutationContext

type RecordMutationContext = { ... }

Opaque compare-and-set context used by advanced record mutations.

PropertyTypeDescription
readonly mutationIdstring
readonly observedRevisions?readonly string[]Every current conflict head in daemon canonical order. Omitted for ordinary CAS.
readonly revisionstring

typeRecordPresentResult

type RecordPresentResult = { ... }

One present authoritative local stable record.

PropertyTypeDescription
bytesnumber[]
contentIdstring
refReference
revisionstring
state"present"

typeRecordReadResult

type RecordReadResult = RecordMissingResult | RecordDeletedResult | RecordPresentResult | RecordConflictResult

Strict authoritative state for one local stable record reference.

typeReference

type Reference = { ... }

The stable identity of a publication: (identity, path).

PropertyTypeDescription
identitystring
pathstring

typeRemoveDataSubscriptionResponse

type RemoveDataSubscriptionResponse = { ... }

Terminal result of explicitly removing a Data Subscription.

PropertyTypeDescription
status"cancelled"
subscription_idstring

typeResolvedReference

type ResolvedReference = { ... }

Strict resolution metadata for one logical reference, before content fetch.

PropertyTypeDescription
contentIdstring
latestSequencenumber
refReference

typeResolveResponse

type ResolveResponse = { ... }

Result of resolving a .jolt address (/app/v1/resolve).

PropertyTypeDescription
addressstring
content_idstring
identitystring
latest_sequencenumber
pathstring
reachability_hintsunknown[]
sourcestring

typeTransportRequest

type TransportRequest = CallOptions & { ... }

A JSON (or empty-body) request.

PropertyTypeDescription
json?unknownJSON body; omitted for GET.
method?"GET" | "POST" | "DELETE"
token?string | nullBearer session token, when the endpoint needs one.

typeTransportUpload

type TransportUpload = CallOptions & { ... }

A multipart upload request (public publish and append).

PropertyTypeDescription
bytesUint8Array
fileNamestring
mimeTypestring
pathstringThe logical Jolt path form field.
tokenstring

typeVersioned

type Versioned<T> = { ... }

A versioned, decoded publication: what a read hands back to the app.

PropertyTypeDescription
contentIdstring
latestSequencenumber
refReference
valueT

Functions

functionapiErrorMessage

function apiErrorMessage(error: unknown): string

Map any error thrown by the SDK to a short human-readable message suitable for an app's error banner. Never throws.

ParameterTypeNotes
errorunknown

functioncreateDataClient

function createDataClient(options: JoltClientOptions): JoltClient & JoltDataSubscriptionSdk

Build the advanced transport required by an already-authorized Data SDK host.

ParameterTypeNotes
optionsJoltClientOptions

functioncreateJoltClient

function createJoltClient(options: JoltClientOptions): JoltClient

Build a JoltClient over a transport and a session-token source.

ParameterTypeNotes
optionsJoltClientOptions

functiondecodeAppCompatibilityDeclaration

function decodeAppCompatibilityDeclaration(value: unknown): AppCompatibilityDeclaration

Decode signed update metadata into the transport-independent SDK shape.

ParameterTypeNotes
valueunknown

functionisContentUnavailableError

function isContentUnavailableError(error: unknown): boolean

Whether a reachable daemon reported that referenced content cannot be fetched.

ParameterTypeNotes
errorunknown

functionisJoltUnavailableError

function isJoltUnavailableError(error: unknown): boolean

Whether a failed Jolt operation should be presented as unavailable.

Typed transport failures mean the daemon could not be reached. Unstructured HTTP 500 and 502 responses also cover browser development proxies that could not complete the request. A machine-readable API error code proves that the daemon answered and must not be weakened into host unavailability. This classifies the attempt, not the availability of content requested through a reachable daemon.

ParameterTypeNotes
errorunknown

functionmakeId

function makeId(prefix: string): string

Generate a collision-resistant id with an app-chosen prefix.

ParameterTypeNotes
prefixstring

functionreferenceKey

function referenceKey(ref: Reference): string

A stable string key for a Reference, for maps and stores.

ParameterTypeNotes
refReference

functionreferenceTarget

function referenceTarget(ref: Reference): string

The .jolt address a Reference resolves through.

ParameterTypeNotes
refReference

modulejolt-sdk/data

Classes

classAccessRevokedError

The App Session no longer authorizes connected Data SDK operations.

new AccessRevokedError

new AccessRevokedError(options?: ErrorOptions): AccessRevokedError
ParameterTypeNotes
optionsErrorOptionsoptional
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

classAppIncompatibleError

The connected Jolt node cannot provide the behavior declared by this App.

new AppIncompatibleError

new AppIncompatibleError(compatibility: AppCompatibilityResult): AppIncompatibleError
ParameterTypeNotes
compatibilityAppCompatibilityResult
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
readonly compatibilityAppCompatibilityResult
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

classAppSessionRejectedError

The person using Jolt did not approve the App's derived access request.

new AppSessionRejectedError

new AppSessionRejectedError(status: AppSessionStatus): AppSessionRejectedError
ParameterTypeNotes
statusAppSessionStatus
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string
PropertyTypeDescription
readonly statusAppSessionStatus

classChangeType

Symbol-backed event kinds emitted by a Materialized View Change Stream.

PropertyTypeDescription
readonly Cancelledquery
PropertyTypeDescription
readonly Changedquery
PropertyTypeDescription
readonly ResyncRequiredquery
PropertyTypeDescription
readonly Revokedquery
PropertyTypeDescription
readonly Snapshotquery
PropertyTypeDescription
readonly Statequery

classConflictError

A mutation observed an older Item revision than the record currently has.

new ConflictError

new ConflictError(ref: Pick<Ref<object>, "path" | "identity">): ConflictError
ParameterTypeNotes
refPick<Ref<object>, "path" | "identity">
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
readonly refPick<Ref<object>, "path" | "identity">
PropertyTypeDescription
stack?string

classDeletedError

Creation was refused because the logical Item is explicitly deleted.

new DeletedError

new DeletedError(ref: Pick<Ref<object>, "path" | "identity">): DeletedError
ParameterTypeNotes
refPick<Ref<object>, "path" | "identity">
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
readonly refPick<Ref<object>, "path" | "identity">
PropertyTypeDescription
stack?string

classDeviceRevokedError

This installation's local device no longer has authority to mutate data.

new DeviceRevokedError

new DeviceRevokedError(options?: ErrorOptions): DeviceRevokedError
ParameterTypeNotes
optionsErrorOptionsoptional
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

classDeviceSigningKeyMismatchError

This installation's persisted device identity conflicts with its authority record.

new DeviceSigningKeyMismatchError

new DeviceSigningKeyMismatchError(options?: ErrorOptions): DeviceSigningKeyMismatchError
ParameterTypeNotes
optionsErrorOptionsoptional
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

classItemUnavailableError

A mutation could not safely proceed because the Item's state is unknown.

new ItemUnavailableError

new ItemUnavailableError(ref: Pick<Ref<object>, "path" | "identity">): ItemUnavailableError
ParameterTypeNotes
refPick<Ref<object>, "path" | "identity">
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
readonly refPick<Ref<object>, "path" | "identity">
PropertyTypeDescription
stack?string

classResourceKind

Symbol-backed kinds used when inspecting a derived App access plan. The class preserves unique-symbol types for direct equality narrowing.

PropertyTypeDescription
readonly Collectionquery
PropertyTypeDescription
readonly Documentquery

classSchemaMigrationError

An older stored value could not be migrated into the current Schema Class.

new SchemaMigrationError

new SchemaMigrationError(fromVersion: number, toVersion: number, message: string, options?: ErrorOptions): SchemaMigrationError
ParameterTypeNotes
fromVersionnumber
toVersionnumber
messagestring
optionsErrorOptionsoptional
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
readonly fromVersionnumber
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string
PropertyTypeDescription
readonly toVersionnumber

classSchemaValidationError

A value failed validation against a Schema Class.

new SchemaValidationError

new SchemaValidationError(field: string, message: string): SchemaValidationError
ParameterTypeNotes
fieldstring
messagestring
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
readonly fieldstring
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

classState

Symbol-backed states for immutable Item snapshots. The class keeps every static Symbol's unique-symbol type so direct equality checks narrow Items.

PropertyTypeDescription
readonly Conflictedquery
PropertyTypeDescription
readonly Deletedquery
PropertyTypeDescription
readonly Missingquery
PropertyTypeDescription
readonly Presentquery
PropertyTypeDescription
readonly Unavailablequery

classSubscriptionCapacityError

The node could not admit another durable Data Subscription.

new SubscriptionCapacityError

new SubscriptionCapacityError(options?: ErrorOptions): SubscriptionCapacityError
ParameterTypeNotes
optionsErrorOptionsoptional
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

classSubscriptionFailure

Symbol-backed explanation for a failed bounded subscription refresh.

PropertyTypeDescription
readonly NetworkUnavailablequery
PropertyTypeDescription
readonly Overloadedquery
PropertyTypeDescription
readonly VerificationFailedquery

classSubscriptionState

Symbol-backed freshness and terminal states for a Data Subscription.

PropertyTypeDescription
readonly Cancelledquery
PropertyTypeDescription
readonly Loadingquery
PropertyTypeDescription
readonly Readyquery
PropertyTypeDescription
readonly Revokedquery
PropertyTypeDescription
readonly Stalequery
PropertyTypeDescription
readonly Unavailablequery
PropertyTypeDescription
readonly Updatingquery

classUnexpectedDataMutationError

Wraps an unrecognized Error thrown by a custom Data SDK client.

new UnexpectedDataMutationError

new UnexpectedDataMutationError(options?: ErrorOptions): UnexpectedDataMutationError
ParameterTypeNotes
optionsErrorOptionsoptional
PropertyTypeDescription
cause?unknown
PropertyTypeDescription
messagestring
PropertyTypeDescription
namestring
PropertyTypeDescription
stack?string

Interfaces

interfaceMigrationPlan

A chain of migrations, keyed by the version each step produces.

to

to(version: number, define: MigrationDefinition): this
ParameterTypeNotes
versionnumber
defineMigrationDefinition

Type Aliases

typeAppAccessPlan

type AppAccessPlan = { ... }

Inspectable connection input derived from an App's Resource declarations. Requirements and Grants are index-aligned in declared Resource order.

PropertyTypeDescription
readonly grantsreadonly ResourceGrantPlan[]
readonly requirementsreadonly ResourceRequirement[]
readonly subscriptionsreadonly ResourceSubscriptionPlan[]

typeAppConnectOptions

type AppConnectOptions = { ... }

Advanced connection seam for an already-authorized Jolt client. It keeps host bootstrap separate from typed Resource behavior.

PropertyTypeDescription
readonly clientDataSdkClient
readonly identityIdentity

typeAppDataDefinitions

type AppDataDefinitions = Readonly<Record<string, CollectionDefinition<object, ResourceAccess, ResourceConflicts> | DocumentDefinition<object, ResourceAccess, ResourceConflicts>>>

Named unbound Resources accepted by App.create.

typeAppDefinition

type AppDefinition<TData> = { ... }

A complete application definition with canonically bound Resources.

PropertyTypeDescription
readonly accessPlanAppAccessPlan
readonly dataBoundAppData<TData>
readonly idstring
readonly namestring
readonly namespacestring
connect() => Promise<AppInstance<TData>>
test(options?: AppTestOptions) => AppInstance<TData>
testWorld() => AppTestWorld<TData>

typeAppInstance

type AppInstance<TData> = mapped & { ... }

The local identity and direct named Resources returned by App.test or App.connect.

PropertyTypeDescription
readonly identityIdentity

typeAppResource

type AppResource<TDefinition> = conditional

The connected Resource surface generated from one Resource definition.

typeAppTestOptions

type AppTestOptions = { ... }

Options for one fresh deterministic App test instance.

PropertyTypeDescription
readonly identity?Identity

typeAppTestWorld

type AppTestWorld<TData> = { ... }

Shared deterministic state that can expose several identity-bound App views.

PropertyTypeDescription
as(identity: string) => AppInstance<TData>Returns a view over the world's immediately shared application state.
device(identity: string, deviceId: string) => AppInstance<TData>Creates one isolated device replica for deterministic offline-branch tests. After synchronization, each Resource applies its declared update and delete conflict policies without relying on device wall clocks.
sync() => Promise<void>Exchanges known histories so every device observes the same branches.

typeArrayFieldItem

type ArrayFieldItem = SchemaFieldFactory | SchemaFieldDecorator

A primitive or nested Schema Class descriptor accepted by Field.array.

typeAutomaticResourceConflicts

type AutomaticResourceConflicts = { ... }

Automatic conflict behavior used when a Resource declares no override.

PropertyTypeDescription
readonly deletequery
readonly updatequery

typeBoundAppData

type BoundAppData<TData> = mapped

App data definitions after canonical paths have been derived.

typeBoundCollectionDefinition

type BoundCollectionDefinition<T, TAccess, TConflicts> = CollectionDefinition<T, TAccess, TConflicts> & { ... }

A Collection definition bound to its canonical App path prefix.

PropertyTypeDescription
readonly pathstring

typeBoundDocumentDefinition

type BoundDocumentDefinition<T, TAccess, TConflicts> = DocumentDefinition<T, TAccess, TConflicts> & { ... }

A Document definition bound to its one canonical App path.

PropertyTypeDescription
readonly pathstring

typeBulkMutationResult

type BulkMutationResult<TItem> = { ... }

Indexed partial-success result from independent itemwise mutations.

PropertyTypeDescription
readonly failedreadonly { error: DataMutationError; index: number }[]
readonly succeededreadonly { index: number; item: TItem }[]

typeCollectionBulkDeleter

type CollectionBulkDeleter<T, TAccess, TConflicts> = { ... }

Itemwise Collection deletions exposed only when declared in Resource access.

PropertyTypeDescription
deleteMany(items: readonly PresentItem<T, TAccess, TConflicts>[]) => Promise<BulkMutationResult<DeletedItem<T, TAccess, TConflicts>>>

typeCollectionBulkRestorer

type CollectionBulkRestorer<T, TAccess, TConflicts> = { ... }

Itemwise Collection restores exposed only when declared in Resource access.

PropertyTypeDescription
restoreMany(inputs: readonly { item: DeletedItem<T, TAccess, TConflicts>; value: T }[]) => Promise<BulkMutationResult<PresentItem<T, TAccess, TConflicts>>>

typeCollectionBulkUpdater

type CollectionBulkUpdater<T, TAccess, TConflicts> = { ... }

Itemwise Collection updates exposed only when declared in Resource access.

PropertyTypeDescription
updateMany(inputs: readonly { item: PresentItem<T, TAccess, TConflicts>; patch: ShallowPatch<T> }[]) => Promise<BulkMutationResult<PresentItem<T, TAccess, TConflicts>>>

typeCollectionCreator

type CollectionCreator<T, TAccess, TConflicts> = { ... }

Collection creation exposed only when declared in Resource access.

PropertyTypeDescription
create(value: T) => Promise<PresentItem<T, TAccess, TConflicts>>
createMany(values: readonly T[]) => Promise<BulkMutationResult<PresentItem<T, TAccess, TConflicts>>>

typeCollectionDefinition

type CollectionDefinition<T, TAccess, TConflicts> = ResourceDefinition<T, TAccess, query, TConflicts>

An unbound Collection definition created before it belongs to an App.

typeCollectionReader

type CollectionReader<T, TAccess, TConflicts> = { ... }

Read operations shared by every connected Collection surface.

PropertyTypeDescription
get(ref: Ref<T>) => Promise<Item<T, TAccess, TConflicts>>

typeCollectionRemoteReader

type CollectionRemoteReader<T, TConflicts> = { ... }

Remote Collection reads exposed only for AnyIdentity access.

PropertyTypeDescription
for(identity: string) => RemoteCollection<T, TConflicts>

typeCollectionResource

type CollectionResource<T, TAccess, TConflicts> = CollectionReader<T, TAccess, TConflicts> & conditional & conditional & conditional & conditional & conditional

A connected Collection surface derived from its access declaration.

typeConflictAlternative

type ConflictAlternative<T> = PresentConflictAlternative<T> | DeletedConflictAlternative<T>

One immutable signed state retained as an unresolved Manual alternative.

typeConflictItem

type ConflictItem<T, TAccess, TConflicts> = conditional & conditional & { ... }

An immutable unresolved state exposed only by a Resource using Manual policy.

PropertyTypeDescription
readonly alternativesreadonly ConflictAlternative<T>[]
readonly refRef<T>
readonly statequery
isConflicted() => predicate
isDeleted() => predicate
isPresent() => predicate

typeDataChangeStream

type DataChangeStream<T, TConflicts> = AsyncIterable<DataSubscriptionChange<T, TConflicts>> & { ... }

A cancellable async sequence of local Materialized View changes.

PropertyTypeDescription
readonly cursor?string
cancel() => Promise<void>

typeDataMutationError

type DataMutationError = SchemaValidationError | SchemaMigrationError | ItemUnavailableError | ConflictError | DeletedError | AccessRevokedError | DeviceRevokedError | DeviceSigningKeyMismatchError | JoltApiError | JoltTransportError | TypeError | UnexpectedDataMutationError

Errors retained on one failed item in a non-atomic bulk mutation.

typeDataSdkClient

type DataSdkClient = Pick<JoltSdk, "publishJson" | "read" | "readContent" | "readRecord" | "resolve" | "updateRecord" | "deleteRecord" | "restoreRecord"> & Pick<JoltDataSubscriptionSdk, "createDataSubscription" | "getDataSubscriptionView" | "nextDataSubscriptionChange" | "removeDataSubscription">

Low-level authorized client operations used by the Data SDK connection seam.

typeDataSubscription

type DataSubscription<T, TConflicts> = { ... }

A typed, refreshable view of one remote Collection.

PropertyTypeDescription
readonly idstring
readonly identityIdentity
readonly lastVerifiedAt?number
readonly reason?SubscriptionFailureValue
readonly stateSubscriptionStateValue
changes(options?: { cursor?: string }) => DataChangeStream<T, TConflicts>
get() => Promise<readonly PresentItem<T, { read: query }, TConflicts>[]>
remove() => Promise<void>

typeDataSubscriptionChange

type DataSubscriptionChange<T, TConflicts> = { cursor: string; items: readonly SubscribedItem<T, TConflicts>[]; lastVerifiedAt?: number; reason?: SubscriptionFailureValue; state: SubscriptionStateValue; type: query } | { cursor: string; items: readonly SubscribedItem<T, TConflicts>[]; removed: readonly Ref<T>[]; type: query } | { cursor: string; lastVerifiedAt?: number; reason?: SubscriptionFailureValue; state: SubscriptionStateValue; type: query } | { type: query } | { type: query } | { type: query }

One typed event from a local Materialized View Change Stream.

typeDeletedConflictAlternative

type DeletedConflictAlternative<T> = { ... }

One deleted alternative in a Manual conflict.

PropertyTypeDescription
readonly refRef<T>
readonly statequery
isDeleted() => predicate
isPresent() => predicate

typeDeletedItem

type DeletedItem<T, TAccess, TConflicts> = ItemSnapshot<T, query, TAccess, TConflicts> & conditional

An immutable Item snapshot whose current state is a Tombstone.

typeDocumentCreator

type DocumentCreator<T, TAccess, TConflicts> = { ... }

Document creation exposed only when declared in Resource access.

PropertyTypeDescription
getOrCreate(value: T) => Promise<PresentItem<T, TAccess, TConflicts>>

typeDocumentDefinition

type DocumentDefinition<T, TAccess, TConflicts> = ResourceDefinition<T, TAccess, query, TConflicts>

An unbound Document definition created before it belongs to an App.

typeDocumentReader

type DocumentReader<T, TAccess, TConflicts> = { ... }

Read operations shared by every connected Document surface.

PropertyTypeDescription
get() => Promise<Item<T, TAccess, TConflicts>>

typeDocumentRemoteReader

type DocumentRemoteReader<T, TConflicts> = { ... }

Remote Document reads exposed only for AnyIdentity access.

PropertyTypeDescription
for(identity: string) => RemoteDocument<T, TConflicts>

typeDocumentResource

type DocumentResource<T, TAccess, TConflicts> = DocumentReader<T, TAccess, TConflicts> & conditional & conditional

A connected Document surface derived from its access declaration.

typeFieldOptions

type FieldOptions = { ... }

Options shared by Schema Class field decorators.

PropertyTypeDescription
readonly optional?boolean

typeIdentity

type Identity = string

A Jolt identity address such as alice.jolt.

typeImmutableValue

type ImmutableValue<T> = conditional

A schema value whose nested object properties and arrays cannot be mutated.

typeItem

type Item<T, TAccess, TConflicts> = PresentItem<T, TAccess, TConflicts> | DeletedItem<T, TAccess, TConflicts> | MissingItem<T, TAccess, TConflicts> | UnavailableItem<T, TAccess, TConflicts> | conditional

Any current immutable state of one logical Item.

typeItemSnapshot

type ItemSnapshot<T, TState, TAccess, TConflicts> = conditional & { ... }

Shared immutable state and narrowing behavior for an Item snapshot.

PropertyTypeDescription
readonly refRef<T>
readonly stateTState
isDeleted() => predicate
isPresent() => predicate

typeMigrationDefinition

type MigrationDefinition = (value: MigrationValue) => unknown

One deterministic, side-effect-free migration into its declared version.

typeMigrationRenames

type MigrationRenames = Readonly<Record<string, string>>

Source fields mapped to their new field names for a migration.

typeMigrationValue

type MigrationValue = Readonly<Record<string, unknown>>

The immutable object supplied to a migration step.

typeMissingItem

type MissingItem<T, TAccess, TConflicts> = ItemSnapshot<T, query, TAccess, TConflicts>

An immutable Item snapshot for a logical reference with no observed record.

typePresentConflictAlternative

type PresentConflictAlternative<T> = { ... }

One content-bearing alternative in a Manual conflict.

PropertyTypeDescription
readonly refRef<T>
readonly statequery
readonly valueImmutableValue<T>
isDeleted() => predicate
isPresent() => predicate

typePresentItem

type PresentItem<T, TAccess, TConflicts> = ItemSnapshot<T, query, TAccess, TConflicts> & conditional & conditional & { ... }

An immutable Item snapshot containing a current schema-valid value.

PropertyTypeDescription
readonly valueImmutableValue<T>

typeRef

type Ref<T> = { ... }

A stable logical reference to one typed Item.

PropertyTypeDescription
readonly [referenceType]?(value: T) => T
readonly identityIdentity
readonly pathstring

typeRemoteCollection

type RemoteCollection<T, TConflicts> = CollectionReader<T, { read: query }, TConflicts> & { ... }

A read-only Collection view bound to another identity.

PropertyTypeDescription
readonly [subscriptionTarget]SubscriptionTarget<T, TConflicts>

typeRemoteDocument

type RemoteDocument<T, TConflicts> = DocumentReader<T, { read: query }, TConflicts>

A read-only Document view bound to another identity.

typeResolvedResourceConflicts

type ResolvedResourceConflicts<TOverrides> = { ... }

Complete literal conflict behavior derived from a Resource's overrides.

PropertyTypeDescription
readonly deleteconditional
readonly updateconditional

typeResourceAccess

type ResourceAccess = { ... }

Operations an application requests for one Resource.

PropertyTypeDescription
readonly create?true
readonly delete?true
readonly readindexedAccess
readonly restore?true
readonly update?true

typeResourceConflictOverrides

type ResourceConflictOverrides = { ... }

Optional advanced overrides for a Resource's automatic conflict behavior.

PropertyTypeDescription
readonly delete?indexedAccess
readonly update?indexedAccess

typeResourceConflicts

type ResourceConflicts = { ... }

Complete conflict behavior resolved for one Resource definition.

PropertyTypeDescription
readonly deleteindexedAccess
readonly updateindexedAccess

typeResourceDefinition

type ResourceDefinition<T, TAccess, TKind, TConflicts> = { ... }

Shared metadata and migration behavior for an unbound Resource.

PropertyTypeDescription
readonly [resourceDefinition]TKind
readonly accessTAccess
readonly conflictsTConflicts
readonly migrate(stored: StoredSchemaValue) => T
readonly schemaSchemaClass<T>

typeResourceGrantPlan

type ResourceGrantPlan = { ... }

High-level authority requested for one canonically scoped Resource.

PropertyTypeDescription
readonly accessReadonly<ResourceAccess>
readonly pathstring
readonly resourcestring

typeResourceKindValue

type ResourceKindValue = query | query

One Collection or Document discriminant used throughout Resource definitions.

typeResourceOptions

type ResourceOptions<TAccess, TOverrides> = { ... }

Developer-facing access and conflict declarations for one Resource.

PropertyTypeDescription
readonly accessTAccess
readonly conflicts?TOverrides

typeResourceRequirement

type ResourceRequirement = { ... }

High-level node behavior required by one declared Resource.

PropertyTypeDescription
readonly accessReadonly<ResourceAccess>
readonly kindResourceKindValue
readonly resourcestring

typeResourceSubscriptionPlan

type ResourceSubscriptionPlan = { ... }

One Collection prefix eligible for remote Data Subscriptions.

PropertyTypeDescription
readonly pathstring
readonly resourcestring

typeSchemaClass

type SchemaClass<T> = () => T

A decorated application value class used as both runtime schema and TypeScript type.

typeSchemaFieldDecorator

type SchemaFieldDecorator = PropertyDecorator

A property decorator produced by one of the typed Field helpers.

typeSchemaFieldFactory

type SchemaFieldFactory = (options?: FieldOptions) => SchemaFieldDecorator

A primitive field helper that can also describe an Array's item type.

typeSchemaOptions

type SchemaOptions = { ... }

Options for a Schema Class. Versions are positive and start at one.

PropertyTypeDescription
readonly migrations?MigrationPlan
readonly versionnumber

typeShallowPatch

type ShallowPatch<T> = mapped

A shallow update: omitted fields remain and supplied fields replace whole values.

typeStoredSchemaValue

type StoredSchemaValue = { ... }

One stored schema version and its opaque value.

PropertyTypeDescription
readonly valueunknown
readonly versionnumber

typeSubscriptionFailureValue

type SubscriptionFailureValue = indexedAccess

typeSubscriptionStateValue

type SubscriptionStateValue = indexedAccess

typeUnavailableItem

type UnavailableItem<T, TAccess, TConflicts> = ItemSnapshot<T, query, TAccess, TConflicts>

An immutable Item snapshot whose current state cannot be determined.

Variables

constApp

const App: { ... }

Composes Resource definitions into one application definition.

PropertyTypeDescription
readonly create(options: { data: TData; id: string; name: string; namespace: string }) => AppDefinition<TData>

constCollection

const Collection: { ... }

Defines an unbound typed Collection. App.create derives its path.

PropertyTypeDescription
readonly create(schemaClass: SchemaClass<T>, options: ResourceOptions<TAccess, TOverrides>) => CollectionDefinition<T, TAccess, ResolvedResourceConflicts<TOverrides>>

constDeleteConflict

const DeleteConflict: { ... }

Conflict policies for a concurrent deletion and update.

PropertyTypeDescription
readonly DeleteWinsReadonly<{ [policyKind]: "delete-conflict:delete-wins" }>
readonly ManualReadonly<{ [policyKind]: "delete-conflict:manual" }>
readonly UpdateWinsReadonly<{ [policyKind]: "delete-conflict:update-wins" }>

constDocument

const Document: { ... }

Defines an unbound typed Document. App.create derives its path.

PropertyTypeDescription
readonly create(schemaClass: SchemaClass<T>, options: ResourceOptions<TAccess, TOverrides>) => DocumentDefinition<T, TAccess, ResolvedResourceConflicts<TOverrides>>

constField

const Field: { ... }

Typed field decorators for Schema Classes.

PropertyTypeDescription
readonly array(item: ArrayFieldItem, options?: FieldOptions) => SchemaFieldDecorator
readonly booleanSchemaFieldFactory
readonly dateTimeSchemaFieldFactory
readonly identitySchemaFieldFactory
readonly numberSchemaFieldFactory
readonly schema(schemaClass: SchemaClass<T>, options?: FieldOptions) => SchemaFieldDecorator
readonly stringSchemaFieldFactory

constMigrations

const Migrations: { ... }

Builds migrations and provides pure helpers for a current Schema Class.

PropertyTypeDescription
readonly create() => MigrationPlan
readonly rename(value: Readonly<Record<string, unknown>>, renames: Readonly<Record<string, string>>) => Record<string, unknown>

constRead

const Read: { ... }

Read scopes available to a Resource access declaration.

PropertyTypeDescription
readonly AnyIdentityReadonly<{ [policyKind]: "read:any-identity" }>
readonly OwnIdentityReadonly<{ [policyKind]: "read:own-identity" }>

constSubscription

const Subscription: { ... }

Creates a typed Data Subscription from a remote Collection view.

PropertyTypeDescription
readonly create(collection: RemoteCollection<T, TConflicts>) => Promise<DataSubscription<T, TConflicts>>

constUpdateConflict

const UpdateConflict: { ... }

Conflict policies for concurrent updates to the same field.

PropertyTypeDescription
readonly LastWriteWinsReadonly<{ [policyKind]: "update-conflict:last-write-wins" }>
readonly ManualReadonly<{ [policyKind]: "update-conflict:manual" }>

Functions

functionSchema

function Schema(options: SchemaOptions): ClassDecorator
ParameterTypeNotes
optionsSchemaOptions

migrate

migrate<T>(schemaClass: SchemaClass<T>, stored: StoredSchemaValue): T
ParameterTypeNotes
schemaClassSchemaClass<T>
storedStoredSchemaValue

parse

parse<T>(schemaClass: SchemaClass<T>, input: unknown): T
ParameterTypeNotes
schemaClassSchemaClass<T>
inputunknown

modulejolt-sdk/transport-http

HTTP transport: reach a Jolt daemon over fetch.

Works in browsers and Node.js 18+. Point it at the daemon directly (new HttpTransport({ daemonUrl: "http://127.0.0.1:9862" })) or, for browser dev servers that proxy the daemon to dodge CORS, at proxy base paths (HttpTransport.viteProxy() uses /jolt-api and /jolt-daemon, the convention Spoke's vite config established).

Classes

classHttpTransport

class HttpTransport implements JoltTransport

The fetch-based transport: reaches the daemon directly by URL, or through dev-server proxy paths via HttpTransport.viteProxy.

new HttpTransport

new HttpTransport(options?: HttpTransportOptions): HttpTransport
ParameterTypeNotes
optionsHttpTransportOptionsdefaults to {}

request

request<T>(base: ApiBase, path: string, req?: TransportRequest): Promise<T>

Send a JSON request to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportRequestdefaults to {}

upload

upload<T>(base: ApiBase, path: string, req: TransportUpload): Promise<T>

Send a multipart file upload to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportUpload

viteProxy

static viteProxy(options?: Omit<HttpTransportOptions, "bases" | "daemonUrl">): HttpTransport

The browser dev-server preset: requests go to the /jolt-api (app API) and /jolt-daemon (daemon API) proxy paths on the current origin.

ParameterTypeNotes
optionsOmit<HttpTransportOptions, "bases" | "daemonUrl">defaults to {}

Type Aliases

typeHttpTransportOptions

type HttpTransportOptions = { ... }

Configuration for HttpTransport.

PropertyTypeDescription
bases?{ app: string; daemon: string }Explicit base paths/URLs per API surface, overriding daemonUrl. Useful behind dev-server proxies.
daemonUrl?stringBase URL of the daemon, e.g. http://127.0.0.1:9862. The transport derives /app/v1 and /api/v1 from it.
defaultTimeoutMs?numberDefault timeout applied when a call passes none.

modulejolt-sdk/transport-tauri

Tauri transport: reach the Jolt daemon through a desktop shell's Rust commands instead of direct HTTP, so the webview never needs network access to the daemon.

The host application must expose these Tauri commands (the contract Spoke established):

#[tauri::command]
async fn daemon_request(base_path: String, path: String, method: String,
                        body: Option<Value>, session_token: Option<String>)
                        -> Result<Value, SerializableDaemonError>;
#[tauri::command]
async fn daemon_publish_bytes(session_token: String, path: String,
                              bytes: Vec<u8>, file_name: String,
                              mime_type: String) -> Result<Value, SerializableDaemonError>;
#[tauri::command]
async fn daemon_append(session_token: String, path: String, bytes: Vec<u8>,
                       file_name: String, mime_type: String)
                       -> Result<Value, SerializableDaemonError>;

See the app development guide for the full Rust implementation to copy.

Classes

classTauriTransport

class TauriTransport implements JoltTransport

The Tauri transport: routes every request through the host shell's Rust commands (tauri-plugin-jolt in plugin mode, or app-defined commands).

new TauriTransport

new TauriTransport(options?: TauriTransportOptions): TauriTransport
ParameterTypeNotes
optionsTauriTransportOptionsdefaults to {}

request

request<T>(base: ApiBase, path: string, req?: TransportRequest): Promise<T>

Send a JSON request to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportRequestdefaults to {}

upload

upload<T>(base: ApiBase, path: string, req: TransportUpload): Promise<T>

Send a multipart file upload to base + path and parse the JSON response.

ParameterTypeNotes
baseApiBase
pathstring
reqTransportUpload

Type Aliases

typeTauriTransportOptions

type TauriTransportOptions = { ... }

Configuration for TauriTransport.

PropertyTypeDescription
plugin?booleanInvoke the commands provided by the tauri-plugin-jolt Rust plugin (plugin:jolt|daemon_request etc.) instead of app-defined commands. Recommended: add tauri_plugin_jolt::init() to your Tauri builder and the jolt:default capability, and no hand-written Rust proxy is needed.

Functions

functionisTauriRuntime

function isTauriRuntime(): boolean

True when running inside a Tauri webview. Use this to choose between TauriTransport and an HTTP transport in apps that also run in a plain browser during development.

modulejolt-sdk/testing

Deterministic in-memory fakes for testing Jolt applications.

createFakeJolt returns a fully working JoltClient implementation with no daemon and no network: publishes land in an in-memory store keyed by path, reads resolve against it, ingress sends are recorded, and incoming envelopes can be injected. Encryption is simulated (recipients are recorded, plaintext is stored), which is exactly what app-level tests need: they test their own schemas and flows, not HPKE.

References

re-exportreferenceKey

Re-export of index.referenceKey.

Type Aliases

typeFakeJolt

type FakeJolt = { ... }

Handle returned by createFakeJolt.

PropertyTypeDescription
clientJoltClient & JoltDataSubscriptionSdkThe fake client; pass it anywhere a JoltClient (or any of its sub-interfaces) is expected.
encryptedRecipientsMap<string, string[]>Every encrypted publish's recipients, keyed by path.
identitystringThe local identity the fake publishes under.
sentRecordedSend[]Every object sent with sendObject, in order.
deliverIngress(input: { body: unknown; schemaHint?: string; sender: string }) => IngressRecordInject a pending ingress envelope, as if a remote sender delivered it. Returns the created record so tests can accept/reject/open it.

typeFakeJoltOptions

type FakeJoltOptions = { appApi?: number; featureDiscovery?: "advertised"; features?: Readonly<Record<string, number>> } | { appApi?: never; featureDiscovery: "legacy"; features?: never }

App API behavior advertised by a deterministic fake daemon.

typeRecordedSend

type RecordedSend = { ... }

An ingress send recorded by the fake.

PropertyTypeDescription
bodyunknown
pathstring
recipientstring

Functions

functioncreateFakeJolt

function createFakeJolt(identity: string, options?: FakeJoltOptions): FakeJolt

Create an in-memory fake Jolt for one identity.

const { client, deliverIngress, sent } = createFakeJolt("alice.jolt");
await client.publishJson("/myapp/profile", { name: "Alice" });
const got = await client.read(
  { identity: "alice.jolt", path: "/myapp/profile" },
  (v) => v as { name: string }
);
ParameterTypeNotes
identitystring
optionsFakeJoltOptionsdefaults to {}