PR #20 made routingHint, code and details required on CultNetErrorMessage; six call sites in cultmesh-ts still built the message without them, so build:ts failed with TS2345. cultnet-ts now owns cultNetTextError(error), the legacy-union decode uses it too, and the call sites and two test expectations call it. The types are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3.3 KiB
Changelog
All notable changes to @gamecult/cultnet-ts are recorded here, following
Keep a Changelog.
Unreleased
Added
-
cultNetTextError(error): the text-onlycultnet.error.v0refusal, withroutingHint,codeanddetailsnull. The legacy-union error decode uses it, so there is one place that spells the null members. -
CultNetRudpSocketTransportServer: one UDP socket serving many peers, each remote address and port with its own reliable session (peerConnected,frame,peerDisconnectedevents;send(peer, ...)answers on the peer a frame came from). A second client no longer replaces the first; Connects beyondmaxPeers(default 256) are dropped, andclose()resolves once every peer's goodbye has left the socket. The shape follows the RustCultNetRudpServerHuband C#CultNetRudpSocketTransportServer, and the wire format is unchanged. The optionalpeerTimeoutMs(idle peers ended and told so; default off) exists only in TypeScript.CultNetRudpSocketTransportConnectioninservermode still serves exactly one peer. -
The
cultnet.snapshot_request.v1,cultnet.database_subscribe.v1andcultnet.snapshot_response_raw.v1carriers and the selection payload types (CultNetSelection,CultNetRawDocumentHeader,CultNetEdge).parseCultNetMessageaccepts them (absent members arrive as absent keys; a page carries exactly one ofheaders/documents; an empty or blankschemas/keysentry throwsCultNetSelectionInvalidErrornaming its field), andencodeCultNetMessageForWirewrites the reference's nil-keyed, declaration-ordered map. Judged against bytes the C# reference wrote (contracts/cultnet/interop/carrier-vectors.cs-written.json) and the selection vectors C# and Rust wrote. The selection engine (evaluation, cursors, the declaration-dependent door checks) is not ported.
Breaking
-
The package is renamed
cultnet-tsto@gamecult/cultnet-ts(the repo already scopes@gamecult/cultcache-ts), so the unscoped name cannot be claimed by someone else. Import from@gamecult/cultnet-tsand its subpaths; the API is unchanged. -
CultNetErrorMessagecarriesroutingHint,codeanddetails(null when absent), as the reference writes them andcultnet.error.schema.jsonrequires; the interface previously dropped them. NewCultNetErrorCode,CultNetErrorDetailsandCultNetShardRoutingHinttypes. -
CultMeshCdnChunkRefcarriesid(slot 4), the reference's element id.encodeManifestwrites five-slot chunk references andpackContentsets the decimal offset as the id, as the reference does; a manifest written before ids reads""and is rewritten with the slot. Content vectors regenerated from the reference. -
Needs the cultcache-ts release that ships with this change (its manifest range moves with that release): the Idunn runtime authority reader calls
readSingleFileStore, which 0.14.x does not export. An absent authority file is now a plainErrorwithout a code.
[0.3.0]
Added
cultnet-ts/content: the CultMesh CDN content plane. Manifest and chunk types, canonical manifest encode and decode,packContent, SHA-256 helpers, and the chunk and artifact record keys, with wire parity to the C# reference.
Changed
- Depends on
@gamecult/cultcache-ts^0.14.1, which exportscheckPayloadDepth.