feat: bring TypeScript SDK to parity with Rust client API (#3801)#67
Merged
iduartgomez merged 13 commits intomainfrom Apr 21, 2026
Merged
feat: bring TypeScript SDK to parity with Rust client API (#3801)#67iduartgomez merged 13 commits intomainfrom
iduartgomez merged 13 commits intomainfrom
Conversation
… auth token handling (#3801)
…ter compatibility (#3801)
eee0604 to
6b47e80
Compare
iduartgomez
approved these changes
Apr 19, 2026
1 task
iduartgomez
approved these changes
Apr 21, 2026
iduartgomez
added a commit
that referenced
this pull request
Apr 23, 2026
* chore(typescript): add release script, bump to 0.2.0 Add scripts/release-typescript-ver.sh with --dry-run support. Tightens package.json files globs to dist/src/** to avoid shipping compiled tests. Bump to 0.2.0 for SDK parity work (#67) and breaking wire changes (#65, #66). * chore(release): add non-interactive flags and release-typescript skill Release scripts now support --yes and --otp flags so they work under tools that cannot drive interactive prompts. Rust script gains --yes and package-skip flags for symmetry. Add .claude/skills/release-typescript skill documenting the end-to-end TS release flow. * chore(release): support npm access tokens in typescript release script Adds --token flag and NPM_TOKEN env support. Token is written to a temp userconfig (chmod 600, cleaned via trap) so no credentials land in ~/.npmrc or the repo. Skill doc updated to prefer tokens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the TypeScript SDK (
@freenetorg/freenet-stdlib) from a broken v0.0.9 state to a functional v0.1.0 that can reliably communicate with a current Freenet node. Implements phases 1-3 and 5-6 from #3801.put()/get()that sent wrong request types whensubscribeflag was setUpdateNotificationsilently losing the contract code hash on key reconstructionconst response = await api.get(key)instead of callback-onlydocumentguard)SubscribeResponseand regenerate typesWhat changed
Phase 1 - Critical bug fixes:
put()andget()now correctly sendContractRequestType.Put/Get(previously sentSubscribewhen the subscribe flag was set)UpdateNotificationnow passes thecodefield when reconstructingContractKeyblockingSubscribefield toPutandGetrequestsPhase 2 - Complete response handling:
NotFoundresponse type withonContractNotFoundcallbackSubscribeResponseto FlatBuffers schema (host_response.fbs), regenerated types, wiredonSubscribeResponsecallbackErrorresponse routing toonErrhandleronClosecallback for WebSocket disconnectionPhase 3 - Streaming protocol:
ReassemblyBufferfrom Rust SDK for inbound stream reassembly (chunk validation, TTL eviction, out-of-order support)sendChunked()- payloads exceeding 512KB are automatically split into 256KBStreamChunkmessagessendRequest()(6 duplicate code paths reduced to 1)Phase 5 - Developer experience:
get(),put(),update()now return typed promises (Promise<GetResponse>, etc.) that resolve on response, reject on error/timeout/closeresolveWebSocket()detects environment, falls back towspackage.document.cookieguarded for non-browser contextswsadded as optional dependencyPhase 6 - Cleanup:
UpdateDataType,ContractType)@types/nodefor Node.js type supportNot included (out of scope)
ConnectedPeers,NodeDiagnostics, etc. are not in the FlatBuffers schema and the Rust serialization forQueryResponseisunimplemented!(). Cannot cross the wire yet.onClosecallback; the app decides reconnection strategy.number[]toUint8Arrayconsistency: Requires FlatBuffers codegen changes or extensive wrapper refactoring. Developers usenew Uint8Array(state)as workaround.ts-jesthas runtime incompatibilities with TS6. Pinned to TS 5.9.3 (latest 5.x).Test plan
npx jest)npx tsc --noEmit)get(),put(),update()resolve with correct response dataonErrfires and all pending promises rejectfreenet-microbloggingapp to verify real-world usage