Skip to content

Add JS to SDK v2#748

Open
skottmckay wants to merge 2 commits into
mainfrom
skottmckay/SDKv2_JS
Open

Add JS to SDK v2#748
skottmckay wants to merge 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
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Old leftovers. Not needed as the tests cover .netfx.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this file need to be checked in?

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