fix: fixed tool-call compatibility and tiny runtime resolver behavior
- Updated tool-call handling to accept string and object arguments. - Stored object tool-call args directly into block.partialArgs and block.arguments. - Added compiled runtime module resolution honoring exports, main, and index fallbacks. - Patched tiny runtime loading to install resolver stubs and load the resolved entry file.
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
#!/usr/bin/env bun
|
||||
|
||||
import { createRequire } from "node:module";
|
||||
import * as path from "node:path";
|
||||
|
||||
const packageDir = path.join(import.meta.dir, "..");
|
||||
const outputPath = path.join(packageDir, "dist", "omp");
|
||||
|
||||
// Transformers.js is an optional, native-heavy dependency that is never bundled
|
||||
// into the binary; the tiny-model worker `bun install`s it into a runtime cache
|
||||
// on first use. The `catalog:` spec cannot be resolved from inside the compiled
|
||||
// bunfs (issue #1763), so embed the concrete installed version here for the
|
||||
// worker to pin its runtime install against.
|
||||
const transformersVersion = (
|
||||
createRequire(import.meta.url)("@huggingface/transformers/package.json") as { version: string }
|
||||
).version;
|
||||
|
||||
function shouldAdhocSignDarwinBinary(): boolean {
|
||||
return process.platform === "darwin";
|
||||
}
|
||||
@@ -40,6 +50,8 @@ async function main(): Promise<void> {
|
||||
"--keep-names",
|
||||
"--define",
|
||||
'process.env.PI_COMPILED="true"',
|
||||
"--define",
|
||||
`process.env.PI_TINY_TRANSFORMERS_VERSION=${JSON.stringify(transformersVersion)}`,
|
||||
"--external",
|
||||
"mupdf",
|
||||
"--root",
|
||||
|
||||
Reference in New Issue
Block a user