adjusts js winml sdk to depend on standard sdk and replace dependencies with winml binaries#596
Open
adjusts js winml sdk to depend on standard sdk and replace dependencies with winml binaries#596
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the JS WinML variant into a thin wrapper package (foundry-local-sdk-winml) that depends on foundry-local-sdk, intending to let users install the WinML variant but continue importing from foundry-local-sdk while swapping in WinML native binaries.
Changes:
- Updates the packaging script to publish
foundry-local-sdk-winmlas a wrapper that depends onfoundry-local-sdkand does not shipdist/. - Updates the WinML install script to target the standard SDK’s installation directory for native binary placement.
- Extends the shared install utilities to support installing binaries into an explicit SDK root (rather than only this package’s own directory).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sdk/js/script/pack.cjs | Converts the WinML package into a thin wrapper (no dist/, depends on foundry-local-sdk). |
| sdk/js/script/install-winml.cjs | Attempts to run preinstall + download WinML-native binaries into the standard SDK’s platform directory. |
| sdk/js/script/install-utils.cjs | Adds sdkRoot support to direct extraction to a different @foundry-local-core/<platform> directory. |
Comments suppressed due to low confidence (1)
sdk/js/script/install-utils.cjs:180
runInstall()returns early if the required files already exist andnpm_config_nightlyisn’t set. For the WinML wrapper use-case (overwriting an existing standard install), this prevents the WinML artifacts from ever being applied. Add an explicitforce/overwriteoption (or a check that detects whether the existing Core is the WinML variant) and use it frominstall-winml.cjs.
async function runInstall(artifacts, sdkRoot) {
if (!RID) {
console.warn(`[foundry-local] Unsupported platform: ${platformKey}. Skipping.`);
return;
}
const binDir = sdkRoot
? path.join(sdkRoot, 'packages', '@foundry-local-core', platformKey)
: DEFAULT_BIN_DIR;
if (fs.existsSync(binDir) && REQUIRED_FILES.every(f => fs.existsSync(path.join(binDir, f)))) {
if (process.env.npm_config_nightly === 'true') {
console.log(`[foundry-local] Nightly requested. Forcing reinstall...`);
fs.rmSync(binDir, { recursive: true, force: true });
} else {
console.log(`[foundry-local] Native libraries already installed.`);
return;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
baijumeswani
previously approved these changes
Apr 6, 2026
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.
allows users to do
npm install foundry-local-sdk-winmland then doimport { FoundryLocalManager } from 'foundry-local-sdk';like the other SDKs do