Add JS to SDK v2#748
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds the v2 JavaScript/TypeScript SDK (sdk_v2/js/) — a new Node-API addon plus public TS surface built on top of the existing C++ wrapper. The package layers a node-addon-api C++ binding (Manager / Catalog / Model / Request / ItemQueue / Chat-Embeddings-Audio sessions) under a TS public surface that preserves the v1 OpenAI-style client classes (ChatClient, AudioClient, EmbeddingClient, LiveAudioTranscriptionSession) reimplemented on top of the v2 session primitives. Also wires up the npm packaging, dev/CI build scripts, vitest suite, biome config, ADO build/test/pack templates, and a js-sdk-v2 instructions doc. A deprecated Smoke.NetFx C# project is removed.
Changes:
- New
sdk_v2/js/package: native addon (binding.gyp+native/src/*.cc/.h), TS sources (src/), vitest tests, dev scripts,package.json(foundry-local-sdk@2.0.0-dev.0, ESM, Node 20+). - ADO pipeline templates for building, testing, and packing the multi-platform JS prebuild tarball; gitignore updates and a small Windows build step to stage
ms-gslheaders. - Removes the legacy
Smoke.NetFxsmoke test project.
Reviewed changes
Copilot reviewed 92 out of 94 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk_v2/js/native/src/*.{h,cc} | Node-API addon (Manager, Catalog, Model, Request, ItemQueue, Sessions, Items, errors, promise worker, preload addon) |
| sdk_v2/js/src/.ts, src/openai/.ts, src/detail/*.ts | Public TS surface (Item union, Request/Response, Sessions, OpenAI clients, types, errors) |
| sdk_v2/js/test/**/.test.ts, test/_fixtures/ | Vitest suite + shared cache-only and real-model fixtures |
| sdk_v2/js/{package.json,binding.gyp,biome.json,tsconfig*.json,vitest.config.ts,.gitignore} | Package scaffolding, build, lint, format, and test config |
| sdk_v2/js/script/*.{mjs,cjs} | Dev-time copy-native, pack-prebuilds, node-gyp helpers |
| sdk_v2/js/docs/code-review-2026-05-27.md | In-tree code-review record |
| .pipelines/v2/templates/{steps-build-windows,steps-pack-js,steps-test-js,stages-sdk-v2}.yml | ADO templates for JS build/test/pack + ms-gsl staging |
| .gitignore | Re-include sdk_v2/js/package-lock.json; ignore generated sdk_v2/js/deps_versions.json |
| .github/instructions/js-sdk-v2*.instructions.md | New persistent guidance for v2 JS SDK work |
| sdk_v2/cs/test/Smoke.NetFx/* | Removed (deprecated smoke test) |
Files not reviewed (1)
- sdk_v2/js/package-lock.json: Language not supported
There was a problem hiding this comment.
Old leftovers. Not needed as the tests cover .netfx.
There was a problem hiding this comment.
Does this file need to be checked in?
No description provided.