Dashboard › Code › Session s0d6b481b701
s0d6b481b70187d2dhttps://github.com/BYK/fossilize/issues/23 is merged so let's update our code accordingly. Recall that we were using this weird require/import dance with a grep on impl-* to find the right file to import. That's what we want to fix.
Found 3 matches
/home/byk/.local/share/opencode/worktree/51d1015fd1f616acf9a5ffaad9331ec6b304586b/swift-harbor/packages/gateway/script/build-binary-sea.ts:
Line 584: // fossilize v0.8.1 ships its implementation in dist/impl-*.js; the
Line 592: /^impl-.+\.js$/.test(f),
Line 595: console.error("✗ fossilize: no impl-*.js found in dist/");
Add programmatic API export to support non-CLI consumers · Issue #23 · BYK/fossilize · GitHub
[Skip to content](#start-of-content)
## Navigation Menu
Toggle navigation
[](/)
[Sign in](/login?return_to=https%3A%2F%2Fgithub.com%2FBYK%2Ffossilize%2Fissues%2F23)
Appearance settings
- Platform
- AI CODE CREATION
- [
GitHub CopilotWrite better code with AI
](https://github.com/features/copilot)
- [
GitHub Copilot appDirect agents from issue to merge
](https://github.com/features/ai/github-app)
- [
MCP RegistryNewIntegrate external tools
](https://github.com/mcp)
- DEVELOPER WORKFLOWS
- [
ActionsAutomate any workflow
...
feat: add programmatic API export by BYK · Pull Request #24 · BYK/fossilize · GitHub
[Skip to content](#start-of-content)
## Navigation Menu
Toggle navigation
[](/)
[Sign in](/login?return_to=https%3A%2F%2Fgithub.com%2FBYK%2Ffossilize%2Fpull%2F24)
Appearance settings
- Platform
- AI CODE CREATION
- [
GitHub CopilotWrite better code with AI
](https://github.com/features/copilot)
- [
GitHub Copilot appDirect agents from issue to merge
](https://github.com/features/ai/github-app)
- [
MCP RegistryNewIntegrate external tools
](https://github.com/mcp)
- DEVELOPER WORKFLOWS
- [
ActionsAutomate any workflow
...
<path>/home/byk/.local/share/opencode/worktree/51d1015fd1f616acf9a5ffaad9331ec6b304586b/swift-harbor/packages/gateway/script/build-binary-sea.ts</path>
<type>file</type>
<content>
575: // -------------------------------------------------------------------------
576: // fossilize uses Node.js archive naming which differs from our
577: // VALID_TARGETS on some platforms:
578: // our "windows-x64" → fossilize "win-x64"
579: // our "darwin-arm64" → fossilize "darwin-arm64" (same)
580: // our "linux-x64" → fossilize "linux-x64" (same)
581: const fossilizeTarget = (t: CompileTarget): string =>
582: t.startsWith("windows") ? t.replace("windows", "win") : t;
583: // Use fossilize's programmatic API — cleaner, no subprocess overhead.
584: // fossilize v0.8.1 ships its implementation in dist/impl-*.js; the
585: // hash changes between versions but is stable within a lockfile.
586: // Imported dynamically here since this is a build script. ...
<path>/home/byk/.local/share/opencode/worktree/51d1015fd1f616acf9a5ffaad9331ec6b304586b/swift-harbor/packages/gateway/script/build-binary-sea.ts</path>
<type>file</type>
<content>
560: },
561: "worker.cjs": { file: "worker.cjs", src: "worker.cjs" },
562: };
563: if (vendorModelDir) {
564: for (const rel of MODEL_FILES) {
565: const key = `model/${rel}`;
566: manifest[key] = { file: key, src: key };
567: }
568: }
569:
570: const manifestPath = join(stagingDir, "asset-manifest.json");
571: writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
572:
573: // -------------------------------------------------------------------------
574: // Step 4: Run fossilize
575: // -------------------------------------------------------------------------
576: // fossilize uses Node.js archive naming which differs from our
577: // VALID_TARGETS on some platforms:
578: // our "windows-x64" → fossilize "win-x64"
579: // our "darwin-arm64" ...
Edit applied successfully.
Edit applied successfully.
Found 1 matches /home/byk/.local/share/opencode/worktree/51d1015fd1f616acf9a5ffaad9331ec6b304586b/swift-harbor/packages/gateway/script/build-binary-sea.ts: Line 34: readdirSync,
<path>/home/byk/.local/share/opencode/worktree/51d1015fd1f616acf9a5ffaad9331ec6b304586b/swift-harbor/packages/gateway/script/build-binary-sea.ts</path> <type>file</type> <content> 1: /** 2: * Build @loreai/gateway standalone binary via Node SEA + fossilize. 3: * 4: * This replaces the legacy `bun build --compile` pipeline. The new 5: * pipeline uses: 6: * 7: * 1. esbuild → single CJS bundle (target: Node 22) 8: * 2. esbuild → worker CJS bundle 9: * 3. fossilize → Node SEA per target, with WASM files + model 10: * files + worker CJS embedded as SEA assets 11: * 12: * At runtime, the binary uses the WASM backend of 13: * `@huggingface/transformers` (i.e. `onnxruntime-web`'s Node entry). 14: * This is the path of least resistance: WASM runs correctly under 15: * Node's V8 engine (the bugs that forced this migration were (Showing lines 1-15 of 709. Use offset=16 to continue.) </content>
Found 1 matches /home/byk/.local/share/opencode/worktree/51d1015fd1f616acf9a5ffaad9331ec6b304586b/swift-harbor/packages/gateway/script/build-binary-sea.ts: Line 34: readdirSync,