feat(ts-sdk): add app-first TypeScript SDK and native runtime packaging#98
Merged
feat(ts-sdk): add app-first TypeScript SDK and native runtime packaging#98
Conversation
added 25 commits
April 11, 2026 11:52
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.
Description
Adds the first production-shaped TypeScript SOF SDK and the native runtime host flow it depends on.
This PR turns the TS SDK into a real app-facing surface instead of a partial wrapper: users can author apps with
new App({...}),new Plugin({...}), andawait app.run()while ingress, fan-in, replay, gossip, direct shreds, and the hot runtime path remain in Rust.It also finalizes npm packaging/release flow, adds CI coverage, and adds GitBook SDK docs so the branch is coherent from runtime to distribution to documentation.
Changes
Detailed list of what changed:
sdks/typescript/src/**: added the TypeScript SDK surface for app authoring, runtime config, runtime policy, derived-state config, result/error helpers, package exports, examples, and tests.sdks/typescript/src/app.ts: added the constructor-firstApp/PluginAPI, typed ingress/fan-in/runtime config, native runtime host handoff, installed native package resolution, and internal worker launching.sdks/typescript/src/runtime/runtime-extension-stdio.ts: added the stdio worker bridge and hard-blocked workerstdoutmisuse so callback logging cannot corrupt the protocol.sdks/typescript/src/index.ts,sdks/typescript/src/runtime.ts,sdks/typescript/src/runtime/app-internal.ts: narrowed the public API so worker/runtime internals and oldtry*authoring entry points do not leak from the main package surface.sdks/typescript/package.json,pnpm-workspace.yaml,pnpm-lock.yaml,sdks/typescript/native/*/package.json: migrated the SDK topnpm,oxlint,biome, minified build output, per-platform native packages, and release metadata validation.sdks/typescript/scripts/build-native-host.mjs,sdks/typescript/scripts/check-release-metadata.mjs: added native host packaging and release metadata checks.crates/sof-observer/src/bin/sof_ts_runtime_host.rs: added the native runtime host used by@sof/sdk, including websocket/gRPC provider ingress, mixed provider+raw runtime support, plugin worker bridging, gossip mode, direct shred ingress, and Linux kernel-bypass integration.crates/sof-observer/src/bin/sof_ts_runtime_host/af_xdp.rs: added Linux AF_XDP support for native SDK runtime-host direct-shred ingress.crates/sof-observer/src/runtime.rs: added the combined raw-ingress plus provider-stream runtime path required by the SDK handoff..github/workflows/ci.yml: added a dedicated TypeScript SDK CI job..github/workflows/release-typescript-sdk.yml: added npm release automation for native packages first, then@sof/sdk.docs/gitbook/**,docs/README.md,sdks/typescript/README.md,sdks/typescript/RELEASING.md: documented the SDK, runtime host/packaging model, release flow, and added an SDK section to GitBook with navbar support..gitignore: ignores generated native packagevendor/binaries.For slice-related changes, include:
sdks/typescript,crates/sof-observerruntime/bootstrap path, docs/GitBook, CI/release automation.@sof/sdk.Motivation
Business motivation:
Technical motivation:
Alternative approaches considered:
npm install: rejected as the primary path because it makes installs slower and more fragileScope and impact
@sof/sdkpublic API and native runtime-host config handoff; narrows old public wrapper/internal exportsTesting
Commands/results:
cargo check -p sof --features provider-grpc,provider-websocket,gossip-bootstrap,kernel-bypass --bin sof_ts_runtime_host cargo clippy -p sof --features provider-grpc,provider-websocket,gossip-bootstrap,kernel-bypass --bin sof_ts_runtime_host --tests -- -D warnings cargo test -p sof --features provider-grpc,provider-websocket,gossip-bootstrap,kernel-bypass --bin sof_ts_runtime_host pnpm install --frozen-lockfile pnpm --dir sdks/typescript run check npm --prefix docs/gitbook run build pnpm --dir sdks/typescript/native/linux-x64 publish --dry-run --access public --no-git-checks pnpm --dir sdks/typescript publish --dry-run --access public --no-git-checksManual verification:
../sof-arb-minimalapp.run()executes the Rustsof_ts_runtime_hostunderneath via wrapper capture of the runtime-host handoffRelated issues and documentation
docs/architecture/README.mddocs/architecture/adr/0011-plugin-config-and-lifecycle-hooks.md,docs/architecture/adr/0013-runtime-delivery-profiles.md,docs/architecture/ard/0010-simplification-without-capability-regression.mddocs/gitbook/sdk/; npm release process documented insdks/typescript/RELEASING.mdReviewer checklist
docs/architecture/ard/0003-slice-dependency-contracts.md)Additional notes
Final audit result: