Skip to content

Add JS to SDK v2#748

Merged
skottmckay merged 2 commits into
mainfrom
skottmckay/SDKv2_JS
Jun 3, 2026
Merged

Add JS to SDK v2#748
skottmckay merged 2 commits into
mainfrom
skottmckay/SDKv2_JS

Conversation

@skottmckay

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 31, 2026 00:35
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment May 31, 2026 1:59am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-gsl headers.
  • Removes the legacy Smoke.NetFx smoke 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

Comment thread sdk_v2/cs/test/Smoke.NetFx/Program.cs
Comment thread sdk_v2/js/docs/code-review-2026-05-27.md
@skottmckay
skottmckay merged commit 872f320 into main Jun 3, 2026
47 checks passed
@skottmckay
skottmckay deleted the skottmckay/SDKv2_JS branch June 3, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants