tensorlake 0.5.131 → 0.5.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/applications/index.cjs +492 -708
- package/dist/applications/index.cjs.map +1 -1
- package/dist/applications/index.d.cts +3 -3
- package/dist/applications/index.d.ts +3 -3
- package/dist/applications/index.js +493 -713
- package/dist/applications/index.js.map +1 -1
- package/dist/function-agent/main.cjs +5 -2
- package/dist/function-agent/main.cjs.map +1 -1
- package/dist/function-agent/main.js +6 -3
- package/dist/function-agent/main.js.map +1 -1
- package/dist/function-executor/main.cjs +6 -3
- package/dist/function-executor/main.cjs.map +1 -1
- package/dist/function-executor/main.js +7 -4
- package/dist/function-executor/main.js.map +1 -1
- package/dist/index.cjs +121 -418
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -22
- package/dist/index.d.ts +8 -22
- package/dist/index.js +122 -423
- package/dist/index.js.map +1 -1
- package/dist/native-worker.cjs +1 -0
- package/dist/native-worker.cjs.map +1 -1
- package/dist/native-worker.js +1 -0
- package/dist/native-worker.js.map +1 -1
- package/dist/{remote-DRCCuRth.d.cts → remote-D95Y6Czr.d.cts} +1 -1
- package/dist/{remote-0dzBqScB.d.ts → remote-omwTzbfj.d.ts} +1 -1
- package/dist/{sandbox-image-Bf5bcxtO.d.cts → sandbox-image-ChzWDeZy.d.cts} +2 -0
- package/dist/{sandbox-image-Bf5bcxtO.d.ts → sandbox-image-ChzWDeZy.d.ts} +2 -0
- package/dist/sandbox-image.cjs +476 -453
- package/dist/sandbox-image.cjs.map +1 -1
- package/dist/sandbox-image.d.cts +1 -1
- package/dist/sandbox-image.d.ts +1 -1
- package/dist/sandbox-image.js +475 -456
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +8 -8
- package/runtime/function-executor/manifest.json +14 -14
- package/runtime/function-executor/package/dist/function-executor/main.js +7 -4
- package/runtime/function-executor/package/dist/function-executor/main.js.map +1 -1
- package/runtime/function-executor/package/dist/native-worker.cjs +1 -0
- package/runtime/function-executor/package/dist/native-worker.cjs.map +1 -1
- package/runtime/function-executor/package/npm-shrinkwrap.json +2 -12
- package/runtime/function-executor/package/package.json +1 -2
- package/runtime/typescript-function-runner/manifest.json +13 -13
- package/runtime/typescript-function-runner/package/dist/function-agent/main.js +6 -3
- package/runtime/typescript-function-runner/package/dist/function-agent/main.js.map +1 -1
- package/runtime/typescript-function-runner/package/dist/native-worker.cjs +1 -0
- package/runtime/typescript-function-runner/package/dist/native-worker.cjs.map +1 -1
- package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +20 -29
- package/runtime/typescript-function-runner/package/package.json +7 -7
|
@@ -224,6 +224,7 @@ port.on("message", (message) => {
|
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
226
|
if (message.type === "release") {
|
|
227
|
+
handles.get(message.handleId)?.value?.close?.();
|
|
227
228
|
handles.delete(message.handleId);
|
|
228
229
|
for (const stream of streams.values()) {
|
|
229
230
|
if (stream.handleId === message.handleId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../lib/libc.cjs","../src/native-worker.ts","../src/native-binding.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","// Read the ELF interpreter, rather than generating a process-wide diagnostic\n// report. Both supported Linux architectures use little-endian ELF64. Reads\n// are bounded to the header, program headers, and interpreter pathname.\nfunction detectLinuxLibc(fs, executable = process.execPath) {\n const override = process.env.TENSORLAKE_NODE_LIBC;\n if (override != null) {\n if (override === \"gnu\" || override === \"musl\") return override;\n throw new Error(\"TENSORLAKE_NODE_LIBC must be 'gnu' or 'musl'.\");\n }\n\n let fd;\n try {\n fd = fs.openSync(executable, \"r\");\n function read(size, offset) {\n if (!Number.isSafeInteger(offset) || offset < 0) {\n throw new Error(\"Invalid ELF offset\");\n }\n const buffer = Buffer.alloc(size);\n let count = 0;\n while (count < size) {\n const bytes = fs.readSync(fd, buffer, count, size - count, offset + count);\n if (bytes === 0) throw new Error(\"Truncated ELF executable\");\n count += bytes;\n }\n return buffer;\n }\n\n const header = read(64, 0);\n if (header.readUInt32BE(0) !== 0x7f454c46 || header[4] !== 2 || header[5] !== 1) {\n throw new Error(\"Expected a little-endian ELF64 executable\");\n }\n const entrySize = header.readUInt16LE(54);\n const count = header.readUInt16LE(56);\n if (entrySize !== 56 || count === 0 || count > 128) {\n throw new Error(\"Unsupported ELF program headers\");\n }\n const entries = read(entrySize * count, Number(header.readBigUInt64LE(32)));\n for (let i = 0; i < count; i++) {\n const offset = i * entrySize;\n if (entries.readUInt32LE(offset) !== 3) continue; // PT_INTERP\n const size = Number(entries.readBigUInt64LE(offset + 32));\n if (size < 2 || size > 4096) throw new Error(\"Invalid ELF interpreter size\");\n const interpreter = read(size, Number(entries.readBigUInt64LE(offset + 8)));\n if (interpreter[size - 1] !== 0) throw new Error(\"Unterminated ELF interpreter\");\n const name = interpreter.subarray(0, -1).toString(\"utf8\").split(\"/\").at(-1);\n if (name.startsWith(\"ld-musl-\")) return \"musl\";\n if (name.startsWith(\"ld-linux-\")) return \"gnu\";\n throw new Error(\"Unrecognized ELF interpreter\");\n }\n throw new Error(\"No ELF interpreter (statically linked executable)\");\n } catch (cause) {\n throw new Error(\n \"Unable to detect Linux libc from the Node executable. Set TENSORLAKE_NODE_LIBC to 'gnu' or 'musl' for a nonstandard runtime.\",\n { cause },\n );\n } finally {\n if (fd != null) fs.closeSync(fd);\n }\n}\n\nmodule.exports = { detectLinuxLibc };\n","import { parentPort } from \"node:worker_threads\";\nimport { loadNative } from \"./native-binding.js\";\nimport type {\n WorkerRequest,\n WorkerResponse,\n} from \"./native-worker-protocol.js\";\n\nconst port = parentPort!;\n// This module is only a worker entrypoint. All platform detection, dlopen and\n// native object construction happen in this isolate.\nconst binding = loadNative<Record<string, any>>();\nconst handles = new Map<number, { value?: any; error?: unknown }>();\ninterface StreamState {\n cancel?: () => void;\n handleId?: number;\n ack?: () => void;\n}\nconst streams = new Map<number, StreamState>();\n\nfunction getHandle(id: number): any {\n const entry = handles.get(id);\n if (!entry) throw new Error(\"Tensorlake native handle has been released\");\n if (entry.error) throw entry.error;\n return entry.value;\n}\n\n/** Structured clone turns Buffers into Uint8Arrays; napi expects Buffers. */\nfunction nativeArgs(value: any): any {\n if (value instanceof Uint8Array)\n return Buffer.from(value.buffer, value.byteOffset, value.byteLength);\n if (Array.isArray(value)) return value.map(nativeArgs);\n if (value && typeof value === \"object\")\n return Object.fromEntries(\n Object.entries(value).map(([k, v]) => [k, nativeArgs(v)]),\n );\n return value;\n}\n\nfunction send(message: WorkerResponse): void {\n port.postMessage(message);\n}\n\nport.on(\"message\", (message: WorkerRequest) => {\n if (message.type === \"create\") {\n try {\n const { kind, args, id } = message.handle;\n const ctor = binding[kind];\n if (typeof ctor !== \"function\")\n throw new Error(\n `native binding does not export ${kind}; rebuild with 'npm run build:native'`,\n );\n const value =\n message.parentId === undefined\n ? new ctor(...args)\n : getHandle(message.parentId).connectProxy(...args);\n handles.set(id, { value });\n } catch (error) {\n handles.set(message.handle.id, { error });\n }\n return;\n }\n if (message.type === \"release\") {\n handles.delete(message.handleId);\n for (const stream of streams.values()) {\n if (stream.handleId === message.handleId) {\n stream.cancel?.();\n stream.ack?.();\n }\n }\n return;\n }\n if (message.type === \"cancel\" || message.type === \"ack\") {\n const stream = streams.get(message.id);\n if (message.type === \"cancel\") stream?.cancel?.();\n stream?.ack?.();\n if (stream) stream.ack = undefined;\n return;\n }\n if (message.type === \"call\") void invoke(message);\n});\n\nasync function invoke(\n message: Extract<WorkerRequest, { type: \"call\" }>,\n): Promise<void> {\n try {\n const target =\n message.handleId === undefined ? binding : getHandle(message.handleId);\n const args = nativeArgs(message.args);\n let stream: StreamState | undefined;\n if (message.stream) {\n stream = { handleId: message.handleId };\n const state = stream;\n streams.set(message.id, stream);\n args.push(\n (value: string) =>\n new Promise<void>((resolve) => {\n state.ack = resolve;\n send({ type: \"event\", id: message.id, value });\n }),\n );\n }\n const call = target[message.method](...args);\n if (stream) stream.cancel = call.cancel;\n const value = await (stream ? call.result : call);\n send({ type: \"result\", id: message.id, value });\n } catch (cause) {\n const error = cause instanceof Error ? cause : new Error(String(cause));\n send({\n type: \"error\",\n id: message.id,\n error: { name: error.name, message: error.message, stack: error.stack },\n });\n } finally {\n streams.get(message.id)?.ack?.();\n streams.delete(message.id);\n }\n}\n","import { detectLinuxLibc } from \"../lib/libc.cjs\";\nimport * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\ninterface RuntimeReport {\n header?: {\n glibcVersionRuntime?: string;\n };\n}\n\ninterface TargetOptions {\n libc?: \"gnu\" | \"musl\";\n report?: RuntimeReport;\n}\n\ninterface NativeBindingPathOptions extends TargetOptions {\n packageRoot?: string;\n platform?: NodeJS.Platform;\n arch?: string;\n}\n\nconst NATIVE_PACKAGES: Readonly<Record<string, string>> = {\n \"darwin-arm64\": \"tensorlake-native-darwin-arm64\",\n \"linux-arm64\": \"tensorlake-native-linux-arm64-gnu\",\n \"linux-arm64-musl\": \"tensorlake-native-linux-arm64-musl\",\n \"linux-x64\": \"tensorlake-native-linux-x64-gnu\",\n \"linux-x64-musl\": \"tensorlake-native-linux-x64-musl\",\n \"win32-x64\": \"tensorlake-native-win32-x64\",\n};\n\nfunction packageRoot(): string {\n const parent = fileURLToPath(new URL(\"../\", import.meta.url));\n if (fs.existsSync(path.join(parent, \"package.json\"))) return parent;\n const grandparent = fileURLToPath(new URL(\"../../\", import.meta.url));\n if (fs.existsSync(path.join(grandparent, \"package.json\"))) return grandparent;\n return parent;\n}\n\nlet cachedLinuxLibc: \"gnu\" | \"musl\" | undefined;\n\nfunction linuxLibcFamily(options: TargetOptions): \"gnu\" | \"musl\" {\n if (options.libc != null) return options.libc;\n if (options.report != null) {\n return options.report.header?.glibcVersionRuntime ? \"gnu\" : \"musl\";\n }\n if (cachedLinuxLibc != null) return cachedLinuxLibc;\n\n cachedLinuxLibc = detectLinuxLibc(fs);\n return cachedLinuxLibc;\n}\n\nexport function nativeTargetId(\n platform: NodeJS.Platform = process.platform,\n arch: string = process.arch,\n options: TargetOptions = {},\n): string {\n const target = `${platform}-${arch}`;\n if (platform !== \"linux\") return target;\n if (options.libc == null && options.report == null && platform !== process.platform) {\n return target;\n }\n return linuxLibcFamily(options) === \"musl\" ? `${target}-musl` : target;\n}\n\nexport function nativeBindingPath(options: NativeBindingPathOptions = {}): string {\n const platform = options.platform ?? process.platform;\n const arch = options.arch ?? process.arch;\n return path.join(\n options.packageRoot ?? packageRoot(),\n \"dist\",\n \"native\",\n nativeTargetId(platform, arch, options),\n \"tensorlake-node.node\",\n );\n}\n\nexport function nativePackageName(\n platform: NodeJS.Platform = process.platform,\n arch: string = process.arch,\n options: TargetOptions = {},\n): string | undefined {\n return NATIVE_PACKAGES[nativeTargetId(platform, arch, options)];\n}\n\nexport function loadNative<T>(): T {\n const target = nativeTargetId();\n const bindingPath = nativeBindingPath();\n const require = createRequire(import.meta.url);\n\n // Local source builds stage the addon here. Published packages intentionally\n // omit this directory and resolve the platform-specific optional dependency.\n if (fs.existsSync(bindingPath)) return require(bindingPath) as T;\n\n const packageName = nativePackageName();\n if (!packageName) {\n throw new Error(\n `Tensorlake does not provide a native binding for ${target}.`,\n );\n }\n\n let packageEntry: string;\n try {\n packageEntry = require.resolve(packageName);\n } catch (cause) {\n throw new Error(\n `Missing native binding package ${packageName} for ${target}. Reinstall tensorlake without omitting optional dependencies, and install dependencies on the machine where they will run.`,\n { cause },\n );\n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,QAAQ,IAAI;AACpC,QAAI;AACJ,QAAI,QAAQ,QAAQ;AAClB,eAAS,EAAE,UAAU,QAAQ,SAAS;AACtC,YAAM,QAAQ;AACd,cAAQ,IAAI,QAAQ,IAAI,MAAM;AAC9B,WAAK;AAAA,QACH,CAACC,WACC,IAAI,QAAc,CAAC,YAAY;AAC7B,gBAAM,MAAM;AACZ,eAAK,EAAE,MAAM,SAAS,IAAI,QAAQ,IAAI,OAAAA,OAAM,CAAC;AAAA,QAC/C,CAAC;AAAA,MACL;AAAA,IACF;AACA,UAAM,OAAO,OAAO,QAAQ,MAAM,EAAE,GAAG,IAAI;AAC3C,QAAI,OAAQ,QAAO,SAAS,KAAK;AACjC,UAAM,QAAQ,OAAO,SAAS,KAAK,SAAS;AAC5C,SAAK,EAAE,MAAM,UAAU,IAAI,QAAQ,IAAI,MAAM,CAAC;AAAA,EAChD,SAAS,OAAO;AACd,UAAM,QAAQ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AACtE,SAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI,QAAQ;AAAA,MACZ,OAAO,EAAE,MAAM,MAAM,MAAM,SAAS,MAAM,SAAS,OAAO,MAAM,MAAM;AAAA,IACxE,CAAC;AAAA,EACH,UAAE;AACA,YAAQ,IAAI,QAAQ,EAAE,GAAG,MAAM;AAC/B,YAAQ,OAAO,QAAQ,EAAE;AAAA,EAC3B;AACF;","names":["exports","module","detectLinuxLibc","fs","read","count","path","require","value"]}
|
|
1
|
+
{"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../lib/libc.cjs","../src/native-worker.ts","../src/native-binding.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","// Read the ELF interpreter, rather than generating a process-wide diagnostic\n// report. Both supported Linux architectures use little-endian ELF64. Reads\n// are bounded to the header, program headers, and interpreter pathname.\nfunction detectLinuxLibc(fs, executable = process.execPath) {\n const override = process.env.TENSORLAKE_NODE_LIBC;\n if (override != null) {\n if (override === \"gnu\" || override === \"musl\") return override;\n throw new Error(\"TENSORLAKE_NODE_LIBC must be 'gnu' or 'musl'.\");\n }\n\n let fd;\n try {\n fd = fs.openSync(executable, \"r\");\n function read(size, offset) {\n if (!Number.isSafeInteger(offset) || offset < 0) {\n throw new Error(\"Invalid ELF offset\");\n }\n const buffer = Buffer.alloc(size);\n let count = 0;\n while (count < size) {\n const bytes = fs.readSync(fd, buffer, count, size - count, offset + count);\n if (bytes === 0) throw new Error(\"Truncated ELF executable\");\n count += bytes;\n }\n return buffer;\n }\n\n const header = read(64, 0);\n if (header.readUInt32BE(0) !== 0x7f454c46 || header[4] !== 2 || header[5] !== 1) {\n throw new Error(\"Expected a little-endian ELF64 executable\");\n }\n const entrySize = header.readUInt16LE(54);\n const count = header.readUInt16LE(56);\n if (entrySize !== 56 || count === 0 || count > 128) {\n throw new Error(\"Unsupported ELF program headers\");\n }\n const entries = read(entrySize * count, Number(header.readBigUInt64LE(32)));\n for (let i = 0; i < count; i++) {\n const offset = i * entrySize;\n if (entries.readUInt32LE(offset) !== 3) continue; // PT_INTERP\n const size = Number(entries.readBigUInt64LE(offset + 32));\n if (size < 2 || size > 4096) throw new Error(\"Invalid ELF interpreter size\");\n const interpreter = read(size, Number(entries.readBigUInt64LE(offset + 8)));\n if (interpreter[size - 1] !== 0) throw new Error(\"Unterminated ELF interpreter\");\n const name = interpreter.subarray(0, -1).toString(\"utf8\").split(\"/\").at(-1);\n if (name.startsWith(\"ld-musl-\")) return \"musl\";\n if (name.startsWith(\"ld-linux-\")) return \"gnu\";\n throw new Error(\"Unrecognized ELF interpreter\");\n }\n throw new Error(\"No ELF interpreter (statically linked executable)\");\n } catch (cause) {\n throw new Error(\n \"Unable to detect Linux libc from the Node executable. Set TENSORLAKE_NODE_LIBC to 'gnu' or 'musl' for a nonstandard runtime.\",\n { cause },\n );\n } finally {\n if (fd != null) fs.closeSync(fd);\n }\n}\n\nmodule.exports = { detectLinuxLibc };\n","import { parentPort } from \"node:worker_threads\";\nimport { loadNative } from \"./native-binding.js\";\nimport type {\n WorkerRequest,\n WorkerResponse,\n} from \"./native-worker-protocol.js\";\n\nconst port = parentPort!;\n// This module is only a worker entrypoint. All platform detection, dlopen and\n// native object construction happen in this isolate.\nconst binding = loadNative<Record<string, any>>();\nconst handles = new Map<number, { value?: any; error?: unknown }>();\ninterface StreamState {\n cancel?: () => void;\n handleId?: number;\n ack?: () => void;\n}\nconst streams = new Map<number, StreamState>();\n\nfunction getHandle(id: number): any {\n const entry = handles.get(id);\n if (!entry) throw new Error(\"Tensorlake native handle has been released\");\n if (entry.error) throw entry.error;\n return entry.value;\n}\n\n/** Structured clone turns Buffers into Uint8Arrays; napi expects Buffers. */\nfunction nativeArgs(value: any): any {\n if (value instanceof Uint8Array)\n return Buffer.from(value.buffer, value.byteOffset, value.byteLength);\n if (Array.isArray(value)) return value.map(nativeArgs);\n if (value && typeof value === \"object\")\n return Object.fromEntries(\n Object.entries(value).map(([k, v]) => [k, nativeArgs(v)]),\n );\n return value;\n}\n\nfunction send(message: WorkerResponse): void {\n port.postMessage(message);\n}\n\nport.on(\"message\", (message: WorkerRequest) => {\n if (message.type === \"create\") {\n try {\n const { kind, args, id } = message.handle;\n const ctor = binding[kind];\n if (typeof ctor !== \"function\")\n throw new Error(\n `native binding does not export ${kind}; rebuild with 'npm run build:native'`,\n );\n const value =\n message.parentId === undefined\n ? new ctor(...args)\n : getHandle(message.parentId).connectProxy(...args);\n handles.set(id, { value });\n } catch (error) {\n handles.set(message.handle.id, { error });\n }\n return;\n }\n if (message.type === \"release\") {\n // Cloud clients own cancellation for buffered requests as well as streams.\n handles.get(message.handleId)?.value?.close?.();\n handles.delete(message.handleId);\n for (const stream of streams.values()) {\n if (stream.handleId === message.handleId) {\n stream.cancel?.();\n stream.ack?.();\n }\n }\n return;\n }\n if (message.type === \"cancel\" || message.type === \"ack\") {\n const stream = streams.get(message.id);\n if (message.type === \"cancel\") stream?.cancel?.();\n stream?.ack?.();\n if (stream) stream.ack = undefined;\n return;\n }\n if (message.type === \"call\") void invoke(message);\n});\n\nasync function invoke(\n message: Extract<WorkerRequest, { type: \"call\" }>,\n): Promise<void> {\n try {\n const target =\n message.handleId === undefined ? binding : getHandle(message.handleId);\n const args = nativeArgs(message.args);\n let stream: StreamState | undefined;\n if (message.stream) {\n stream = { handleId: message.handleId };\n const state = stream;\n streams.set(message.id, stream);\n args.push(\n (value: string) =>\n new Promise<void>((resolve) => {\n state.ack = resolve;\n send({ type: \"event\", id: message.id, value });\n }),\n );\n }\n const call = target[message.method](...args);\n if (stream) stream.cancel = call.cancel;\n const value = await (stream ? call.result : call);\n send({ type: \"result\", id: message.id, value });\n } catch (cause) {\n const error = cause instanceof Error ? cause : new Error(String(cause));\n send({\n type: \"error\",\n id: message.id,\n error: { name: error.name, message: error.message, stack: error.stack },\n });\n } finally {\n streams.get(message.id)?.ack?.();\n streams.delete(message.id);\n }\n}\n","import { detectLinuxLibc } from \"../lib/libc.cjs\";\nimport * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\ninterface RuntimeReport {\n header?: {\n glibcVersionRuntime?: string;\n };\n}\n\ninterface TargetOptions {\n libc?: \"gnu\" | \"musl\";\n report?: RuntimeReport;\n}\n\ninterface NativeBindingPathOptions extends TargetOptions {\n packageRoot?: string;\n platform?: NodeJS.Platform;\n arch?: string;\n}\n\nconst NATIVE_PACKAGES: Readonly<Record<string, string>> = {\n \"darwin-arm64\": \"tensorlake-native-darwin-arm64\",\n \"linux-arm64\": \"tensorlake-native-linux-arm64-gnu\",\n \"linux-arm64-musl\": \"tensorlake-native-linux-arm64-musl\",\n \"linux-x64\": \"tensorlake-native-linux-x64-gnu\",\n \"linux-x64-musl\": \"tensorlake-native-linux-x64-musl\",\n \"win32-x64\": \"tensorlake-native-win32-x64\",\n};\n\nfunction packageRoot(): string {\n const parent = fileURLToPath(new URL(\"../\", import.meta.url));\n if (fs.existsSync(path.join(parent, \"package.json\"))) return parent;\n const grandparent = fileURLToPath(new URL(\"../../\", import.meta.url));\n if (fs.existsSync(path.join(grandparent, \"package.json\"))) return grandparent;\n return parent;\n}\n\nlet cachedLinuxLibc: \"gnu\" | \"musl\" | undefined;\n\nfunction linuxLibcFamily(options: TargetOptions): \"gnu\" | \"musl\" {\n if (options.libc != null) return options.libc;\n if (options.report != null) {\n return options.report.header?.glibcVersionRuntime ? \"gnu\" : \"musl\";\n }\n if (cachedLinuxLibc != null) return cachedLinuxLibc;\n\n cachedLinuxLibc = detectLinuxLibc(fs);\n return cachedLinuxLibc;\n}\n\nexport function nativeTargetId(\n platform: NodeJS.Platform = process.platform,\n arch: string = process.arch,\n options: TargetOptions = {},\n): string {\n const target = `${platform}-${arch}`;\n if (platform !== \"linux\") return target;\n if (options.libc == null && options.report == null && platform !== process.platform) {\n return target;\n }\n return linuxLibcFamily(options) === \"musl\" ? `${target}-musl` : target;\n}\n\nexport function nativeBindingPath(options: NativeBindingPathOptions = {}): string {\n const platform = options.platform ?? process.platform;\n const arch = options.arch ?? process.arch;\n return path.join(\n options.packageRoot ?? packageRoot(),\n \"dist\",\n \"native\",\n nativeTargetId(platform, arch, options),\n \"tensorlake-node.node\",\n );\n}\n\nexport function nativePackageName(\n platform: NodeJS.Platform = process.platform,\n arch: string = process.arch,\n options: TargetOptions = {},\n): string | undefined {\n return NATIVE_PACKAGES[nativeTargetId(platform, arch, options)];\n}\n\nexport function loadNative<T>(): T {\n const target = nativeTargetId();\n const bindingPath = nativeBindingPath();\n const require = createRequire(import.meta.url);\n\n // Local source builds stage the addon here. Published packages intentionally\n // omit this directory and resolve the platform-specific optional dependency.\n if (fs.existsSync(bindingPath)) return require(bindingPath) as T;\n\n const packageName = nativePackageName();\n if (!packageName) {\n throw new Error(\n `Tensorlake does not provide a native binding for ${target}.`,\n );\n }\n\n let packageEntry: string;\n try {\n packageEntry = require.resolve(packageName);\n } catch (cause) {\n throw new Error(\n `Missing native binding package ${packageName} for ${target}. Reinstall tensorlake without omitting optional dependencies, and install dependencies on the machine where they will run.`,\n { cause },\n );\n }\n return require(packageEntry) as T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAKM,kBAOO;AAZb;AAAA;AAAA;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;AAAA;AAAA;;;ACZ9D;AAAA,iBAAAA,UAAAC,SAAA;AAAA;AAAA;AAGA,aAASC,iBAAgBC,KAAI,aAAa,QAAQ,UAAU;AAC1D,YAAM,WAAW,QAAQ,IAAI;AAC7B,UAAI,YAAY,MAAM;AACpB,YAAI,aAAa,SAAS,aAAa,OAAQ,QAAO;AACtD,cAAM,IAAI,MAAM,+CAA+C;AAAA,MACjE;AAEA,UAAI;AACJ,UAAI;AAEF,YAASC,QAAT,SAAc,MAAM,QAAQ;AAC1B,cAAI,CAAC,OAAO,cAAc,MAAM,KAAK,SAAS,GAAG;AAC/C,kBAAM,IAAI,MAAM,oBAAoB;AAAA,UACtC;AACA,gBAAM,SAAS,OAAO,MAAM,IAAI;AAChC,cAAIC,SAAQ;AACZ,iBAAOA,SAAQ,MAAM;AACnB,kBAAM,QAAQF,IAAG,SAAS,IAAI,QAAQE,QAAO,OAAOA,QAAO,S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AQ,OAAO,QAAQ,EAAE;AAAA,EAC3B;AACF;","names":["exports","module","detectLinuxLibc","fs","read","count","path","require","value"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tensorlake/typescript-function-runner-runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.133",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@tensorlake/typescript-function-runner-runtime",
|
|
9
|
-
"version": "0.5.
|
|
9
|
+
"version": "0.5.133",
|
|
10
10
|
"description": "Tensorlake Node.js function runner with a platform-specific Rust agent core",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"bin": {
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"fflate": "0.8.3"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"tensorlake-native-darwin-arm64": "0.5.
|
|
24
|
-
"tensorlake-native-linux-arm64-gnu": "0.5.
|
|
25
|
-
"tensorlake-native-linux-arm64-musl": "0.5.
|
|
26
|
-
"tensorlake-native-linux-x64-gnu": "0.5.
|
|
27
|
-
"tensorlake-native-linux-x64-musl": "0.5.
|
|
28
|
-
"tensorlake-native-win32-x64": "0.5.
|
|
23
|
+
"tensorlake-native-darwin-arm64": "0.5.133",
|
|
24
|
+
"tensorlake-native-linux-arm64-gnu": "0.5.133",
|
|
25
|
+
"tensorlake-native-linux-arm64-musl": "0.5.133",
|
|
26
|
+
"tensorlake-native-linux-x64-gnu": "0.5.133",
|
|
27
|
+
"tensorlake-native-linux-x64-musl": "0.5.133",
|
|
28
|
+
"tensorlake-native-win32-x64": "0.5.133"
|
|
29
29
|
},
|
|
30
30
|
"license": "Apache-2.0"
|
|
31
31
|
},
|
|
@@ -386,8 +386,8 @@
|
|
|
386
386
|
}
|
|
387
387
|
},
|
|
388
388
|
"node_modules/tensorlake-native-darwin-arm64": {
|
|
389
|
-
"version": "0.5.
|
|
390
|
-
"resolved": "https://registry.npmjs.org/tensorlake-native-darwin-arm64/-/tensorlake-native-darwin-arm64-0.5.
|
|
389
|
+
"version": "0.5.133",
|
|
390
|
+
"resolved": "https://registry.npmjs.org/tensorlake-native-darwin-arm64/-/tensorlake-native-darwin-arm64-0.5.133.tgz",
|
|
391
391
|
"cpu": [
|
|
392
392
|
"arm64"
|
|
393
393
|
],
|
|
@@ -401,8 +401,8 @@
|
|
|
401
401
|
}
|
|
402
402
|
},
|
|
403
403
|
"node_modules/tensorlake-native-linux-arm64-gnu": {
|
|
404
|
-
"version": "0.5.
|
|
405
|
-
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-arm64-gnu/-/tensorlake-native-linux-arm64-gnu-0.5.
|
|
404
|
+
"version": "0.5.133",
|
|
405
|
+
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-arm64-gnu/-/tensorlake-native-linux-arm64-gnu-0.5.133.tgz",
|
|
406
406
|
"cpu": [
|
|
407
407
|
"arm64"
|
|
408
408
|
],
|
|
@@ -419,8 +419,8 @@
|
|
|
419
419
|
}
|
|
420
420
|
},
|
|
421
421
|
"node_modules/tensorlake-native-linux-arm64-musl": {
|
|
422
|
-
"version": "0.5.
|
|
423
|
-
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-arm64-musl/-/tensorlake-native-linux-arm64-musl-0.5.
|
|
422
|
+
"version": "0.5.133",
|
|
423
|
+
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-arm64-musl/-/tensorlake-native-linux-arm64-musl-0.5.133.tgz",
|
|
424
424
|
"cpu": [
|
|
425
425
|
"arm64"
|
|
426
426
|
],
|
|
@@ -437,8 +437,8 @@
|
|
|
437
437
|
}
|
|
438
438
|
},
|
|
439
439
|
"node_modules/tensorlake-native-linux-x64-gnu": {
|
|
440
|
-
"version": "0.5.
|
|
441
|
-
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-x64-gnu/-/tensorlake-native-linux-x64-gnu-0.5.
|
|
440
|
+
"version": "0.5.133",
|
|
441
|
+
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-x64-gnu/-/tensorlake-native-linux-x64-gnu-0.5.133.tgz",
|
|
442
442
|
"cpu": [
|
|
443
443
|
"x64"
|
|
444
444
|
],
|
|
@@ -455,8 +455,8 @@
|
|
|
455
455
|
}
|
|
456
456
|
},
|
|
457
457
|
"node_modules/tensorlake-native-linux-x64-musl": {
|
|
458
|
-
"version": "0.5.
|
|
459
|
-
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-x64-musl/-/tensorlake-native-linux-x64-musl-0.5.
|
|
458
|
+
"version": "0.5.133",
|
|
459
|
+
"resolved": "https://registry.npmjs.org/tensorlake-native-linux-x64-musl/-/tensorlake-native-linux-x64-musl-0.5.133.tgz",
|
|
460
460
|
"cpu": [
|
|
461
461
|
"x64"
|
|
462
462
|
],
|
|
@@ -473,8 +473,8 @@
|
|
|
473
473
|
}
|
|
474
474
|
},
|
|
475
475
|
"node_modules/tensorlake-native-win32-x64": {
|
|
476
|
-
"version": "0.5.
|
|
477
|
-
"resolved": "https://registry.npmjs.org/tensorlake-native-win32-x64/-/tensorlake-native-win32-x64-0.5.
|
|
476
|
+
"version": "0.5.133",
|
|
477
|
+
"resolved": "https://registry.npmjs.org/tensorlake-native-win32-x64/-/tensorlake-native-win32-x64-0.5.133.tgz",
|
|
478
478
|
"cpu": [
|
|
479
479
|
"x64"
|
|
480
480
|
],
|
|
@@ -487,15 +487,6 @@
|
|
|
487
487
|
"node": ">=22.0.0"
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
|
-
"node_modules/undici": {
|
|
491
|
-
"version": "8.3.0",
|
|
492
|
-
"resolved": "https://registry.npmjs.org/undici/-/undici-8.3.0.tgz",
|
|
493
|
-
"integrity": "sha512-TkUDgb6tl7KOGZ+7e8E3d2FYgUQgF6z5YypqjWmixVQSQERFcVrVg0ySADm2LVLRh5ljAaHTCR5Fmz3Q34rB7Q==",
|
|
494
|
-
"license": "MIT",
|
|
495
|
-
"engines": {
|
|
496
|
-
"node": ">=22.19.0"
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
490
|
"node_modules/undici-types": {
|
|
500
491
|
"version": "7.18.2",
|
|
501
492
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tensorlake/typescript-function-runner-runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.133",
|
|
4
4
|
"description": "Tensorlake Node.js function runner with a platform-specific Rust agent core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"fflate": "0.8.3"
|
|
15
15
|
},
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"tensorlake-native-darwin-arm64": "0.5.
|
|
18
|
-
"tensorlake-native-linux-arm64-gnu": "0.5.
|
|
19
|
-
"tensorlake-native-linux-arm64-musl": "0.5.
|
|
20
|
-
"tensorlake-native-linux-x64-gnu": "0.5.
|
|
21
|
-
"tensorlake-native-linux-x64-musl": "0.5.
|
|
22
|
-
"tensorlake-native-win32-x64": "0.5.
|
|
17
|
+
"tensorlake-native-darwin-arm64": "0.5.133",
|
|
18
|
+
"tensorlake-native-linux-arm64-gnu": "0.5.133",
|
|
19
|
+
"tensorlake-native-linux-arm64-musl": "0.5.133",
|
|
20
|
+
"tensorlake-native-linux-x64-gnu": "0.5.133",
|
|
21
|
+
"tensorlake-native-linux-x64-musl": "0.5.133",
|
|
22
|
+
"tensorlake-native-win32-x64": "0.5.133"
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0"
|
|
25
25
|
}
|