@tensorlakeai/tensorlake 0.5.162 → 0.5.163

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.
Files changed (49) hide show
  1. package/dist/applications/index.cjs +26 -5
  2. package/dist/applications/index.cjs.map +1 -1
  3. package/dist/applications/index.d.cts +3 -3
  4. package/dist/applications/index.d.ts +3 -3
  5. package/dist/applications/index.js +26 -5
  6. package/dist/applications/index.js.map +1 -1
  7. package/dist/function-agent/main.cjs +18 -4
  8. package/dist/function-agent/main.cjs.map +1 -1
  9. package/dist/function-agent/main.js +18 -4
  10. package/dist/function-agent/main.js.map +1 -1
  11. package/dist/function-executor/main.cjs +5 -2
  12. package/dist/function-executor/main.cjs.map +1 -1
  13. package/dist/function-executor/main.js +5 -2
  14. package/dist/function-executor/main.js.map +1 -1
  15. package/dist/index.cjs +47 -12
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +9 -4
  18. package/dist/index.d.ts +9 -4
  19. package/dist/index.js +47 -12
  20. package/dist/index.js.map +1 -1
  21. package/dist/native-worker.cjs +12 -3
  22. package/dist/native-worker.cjs.map +1 -1
  23. package/dist/native-worker.js +12 -3
  24. package/dist/native-worker.js.map +1 -1
  25. package/dist/{remote-DYBXCTNC.d.ts → remote-BMibssYe.d.ts} +29 -29
  26. package/dist/{remote-CEs4GFGP.d.cts → remote-BzVx-ai8.d.cts} +29 -29
  27. package/dist/sandbox-image.cjs +12 -3
  28. package/dist/sandbox-image.cjs.map +1 -1
  29. package/dist/sandbox-image.d.cts +1 -1
  30. package/dist/sandbox-image.d.ts +1 -1
  31. package/dist/sandbox-image.js +12 -3
  32. package/dist/sandbox-image.js.map +1 -1
  33. package/package.json +14 -9
  34. package/runtime/function-executor/manifest.json +13 -13
  35. package/runtime/function-executor/package/dist/function-executor/main.js +5 -2
  36. package/runtime/function-executor/package/dist/function-executor/main.js.map +1 -1
  37. package/runtime/function-executor/package/dist/native-worker.cjs +12 -3
  38. package/runtime/function-executor/package/dist/native-worker.cjs.map +1 -1
  39. package/runtime/function-executor/package/npm-shrinkwrap.json +27 -27
  40. package/runtime/function-executor/package/package.json +4 -4
  41. package/runtime/typescript-function-runner/manifest.json +13 -13
  42. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +18 -4
  43. package/runtime/typescript-function-runner/package/dist/function-agent/main.js.map +1 -1
  44. package/runtime/typescript-function-runner/package/dist/native-worker.cjs +12 -3
  45. package/runtime/typescript-function-runner/package/dist/native-worker.cjs.map +1 -1
  46. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +48 -48
  47. package/runtime/typescript-function-runner/package/package.json +7 -7
  48. package/dist/{sandbox-image-C2GTVnx3.d.cts → image-CN0M59QP.d.cts} +48 -48
  49. package/dist/{sandbox-image-C2GTVnx3.d.ts → image-CN0M59QP.d.ts} +48 -48
@@ -5,11 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ var __esm = (fn, res, err) => function __init() {
9
+ if (err) throw err[0];
10
+ try {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ } catch (e) {
13
+ throw err = [e], e;
14
+ }
10
15
  };
11
16
  var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ try {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ } catch (e) {
20
+ throw mod = 0, e;
21
+ }
13
22
  };
14
23
  var __copyProps = (to, from, except, desc) => {
15
24
  if (from && typeof from === "object" || typeof from === "function") {
@@ -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 // 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\": \"@tensorlakeai/native-darwin-arm64\",\n \"linux-arm64\": \"@tensorlakeai/native-linux-arm64-gnu\",\n \"linux-arm64-musl\": \"@tensorlakeai/native-linux-arm64-musl\",\n \"linux-x64\": \"@tensorlakeai/native-linux-x64-gnu\",\n \"linux-x64-musl\": \"@tensorlakeai/native-linux-x64-musl\",\n \"win32-x64\": \"@tensorlakeai/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 @tensorlakeai/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,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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\": \"@tensorlakeai/native-darwin-arm64\",\n \"linux-arm64\": \"@tensorlakeai/native-linux-arm64-gnu\",\n \"linux-arm64-musl\": \"@tensorlakeai/native-linux-arm64-musl\",\n \"linux-x64\": \"@tensorlakeai/native-linux-x64-gnu\",\n \"linux-x64-musl\": \"@tensorlakeai/native-linux-x64-musl\",\n \"win32-x64\": \"@tensorlakeai/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 @tensorlakeai/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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;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,12 +1,12 @@
1
1
  {
2
2
  "name": "@tensorlake/typescript-function-runner-runtime",
3
- "version": "0.5.162",
3
+ "version": "0.5.163",
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.162",
9
+ "version": "0.5.163",
10
10
  "description": "Tensorlake Node.js function runner with a platform-specific Rust agent core",
11
11
  "type": "module",
12
12
  "bin": {
@@ -20,19 +20,19 @@
20
20
  "fflate": "0.8.3"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@tensorlakeai/native-darwin-arm64": "0.5.162",
24
- "@tensorlakeai/native-linux-arm64-gnu": "0.5.162",
25
- "@tensorlakeai/native-linux-arm64-musl": "0.5.162",
26
- "@tensorlakeai/native-linux-x64-gnu": "0.5.162",
27
- "@tensorlakeai/native-linux-x64-musl": "0.5.162",
28
- "@tensorlakeai/native-win32-x64": "0.5.162"
23
+ "@tensorlakeai/native-darwin-arm64": "0.5.163",
24
+ "@tensorlakeai/native-linux-arm64-gnu": "0.5.163",
25
+ "@tensorlakeai/native-linux-arm64-musl": "0.5.163",
26
+ "@tensorlakeai/native-linux-x64-gnu": "0.5.163",
27
+ "@tensorlakeai/native-linux-x64-musl": "0.5.163",
28
+ "@tensorlakeai/native-win32-x64": "0.5.163"
29
29
  },
30
30
  "license": "Apache-2.0"
31
31
  },
32
32
  "node_modules/@grpc/grpc-js": {
33
- "version": "1.14.4",
34
- "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.4.tgz",
35
- "integrity": "sha512-k9Dj3DV/itK9D06Y8f190Qgop7/Ui+D0njFV3LHMPwPT75DpXLQohE9Wmz0QElrJnzsjB7KPWiKJbOl7IPDArQ==",
33
+ "version": "1.14.7",
34
+ "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.7.tgz",
35
+ "integrity": "sha512-W4W/fcBMGRVtG6dW2c7cw2mnpS3hvbBd+oQXjh2iYFTZDk1JJmcNqkM5KSaPubQpamlUUurrlb7G1s9NJeERmQ==",
36
36
  "license": "Apache-2.0",
37
37
  "dependencies": {
38
38
  "@grpc/proto-loader": "^0.8.0",
@@ -128,9 +128,9 @@
128
128
  "license": "BSD-3-Clause"
129
129
  },
130
130
  "node_modules/@tensorlakeai/native-darwin-arm64": {
131
- "version": "0.5.162",
132
- "resolved": "https://registry.npmjs.org/@tensorlakeai/native-darwin-arm64/-/native-darwin-arm64-0.5.162.tgz",
133
- "integrity": "sha512-qngq5exxsuOhwpi2TKSe9D4LVrzkwidRb3dggRRamuH1QgkOk2GgVqBfnEQNi8ZfaMNnyZdKl49RtKOsKXhJpg==",
131
+ "version": "0.5.163",
132
+ "resolved": "https://registry.npmjs.org/@tensorlakeai/native-darwin-arm64/-/native-darwin-arm64-0.5.163.tgz",
133
+ "integrity": "sha512-WzRx+uFa89oo67C4cxEbpb08m+z9I6ugm4HxUZm+fApn7K5Eg24SwZixvrUk2zRrvkPlmPubPqBFvvszYpRiWw==",
134
134
  "cpu": [
135
135
  "arm64"
136
136
  ],
@@ -144,9 +144,9 @@
144
144
  }
145
145
  },
146
146
  "node_modules/@tensorlakeai/native-linux-arm64-gnu": {
147
- "version": "0.5.162",
148
- "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-arm64-gnu/-/native-linux-arm64-gnu-0.5.162.tgz",
149
- "integrity": "sha512-MElasPYzkgBsdWDAEwrRCmYedOV+ohEwHEiKag6Mn3U60fFYQF96SS4iJ/5A/mDJ4fPakWtdzUwb8NnvclcnBw==",
147
+ "version": "0.5.163",
148
+ "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-arm64-gnu/-/native-linux-arm64-gnu-0.5.163.tgz",
149
+ "integrity": "sha512-MK7r9X13yiHbgq1qrKLzdxzYe6gS+aZTWJuYS1dBP3GHAb44XGbCWHwjoh+2mouo3VzvBwuWRLXB3GwMYttnKw==",
150
150
  "cpu": [
151
151
  "arm64"
152
152
  ],
@@ -163,9 +163,9 @@
163
163
  }
164
164
  },
165
165
  "node_modules/@tensorlakeai/native-linux-arm64-musl": {
166
- "version": "0.5.162",
167
- "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-arm64-musl/-/native-linux-arm64-musl-0.5.162.tgz",
168
- "integrity": "sha512-VYHcGumS+DEYwpjbZl7wPxZRHGL1m0WrJBdXnpfGEzebUpvK2eXf6KvTRBSErbS6CepAV96lSZfDnkIZ1ZLxYg==",
166
+ "version": "0.5.163",
167
+ "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-arm64-musl/-/native-linux-arm64-musl-0.5.163.tgz",
168
+ "integrity": "sha512-fsxD7zcoMXmQBXQ1j6v9O1m0SegRCiv5ej/OAFSB8s8Hhzr3Q/PvFhDpzqC8UVeJBPI+MFvAQVzvrnuYRahKtg==",
169
169
  "cpu": [
170
170
  "arm64"
171
171
  ],
@@ -182,9 +182,9 @@
182
182
  }
183
183
  },
184
184
  "node_modules/@tensorlakeai/native-linux-x64-gnu": {
185
- "version": "0.5.162",
186
- "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-x64-gnu/-/native-linux-x64-gnu-0.5.162.tgz",
187
- "integrity": "sha512-F2oHOWX2pw42pFRt64WIbhNOMMv+7YimA1zHmbHFjhgZN9vhuqGTUs5NCQubjpUixVlsOpCNpjjLJa7MRwe4Kw==",
185
+ "version": "0.5.163",
186
+ "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-x64-gnu/-/native-linux-x64-gnu-0.5.163.tgz",
187
+ "integrity": "sha512-thEgyPKgiS0w1gvxu4byGVhBxifOBczfbgv5WreGgUml475kd/lPjIuF6F6sT00cx5P24AHJFQi41fMN4DuVLw==",
188
188
  "cpu": [
189
189
  "x64"
190
190
  ],
@@ -201,9 +201,9 @@
201
201
  }
202
202
  },
203
203
  "node_modules/@tensorlakeai/native-linux-x64-musl": {
204
- "version": "0.5.162",
205
- "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-x64-musl/-/native-linux-x64-musl-0.5.162.tgz",
206
- "integrity": "sha512-mLptlnpTk9RTanGCiN0VF0rUfa92yOtEStUadHVfctSSBx717+K9Hh7zr7PysMxKErZ/rlUrISD2x/ZPQW6+fg==",
204
+ "version": "0.5.163",
205
+ "resolved": "https://registry.npmjs.org/@tensorlakeai/native-linux-x64-musl/-/native-linux-x64-musl-0.5.163.tgz",
206
+ "integrity": "sha512-KypyDhAoWa5LNyCK8OSJxo7LwAF1brpNM6VoLpv27c8EtZJkniTwhs9S8zhvwDhUOakOp0Kf3JAU5/i0UKrUiA==",
207
207
  "cpu": [
208
208
  "x64"
209
209
  ],
@@ -220,9 +220,9 @@
220
220
  }
221
221
  },
222
222
  "node_modules/@tensorlakeai/native-win32-x64": {
223
- "version": "0.5.162",
224
- "resolved": "https://registry.npmjs.org/@tensorlakeai/native-win32-x64/-/native-win32-x64-0.5.162.tgz",
225
- "integrity": "sha512-dOHVFtaNF2EsW2zloeR28N4Y+vzN0nqbkxiIHIbWac1s8cEDv0eFbmstnYNDnnq3iL5FUVgz3j3ogaM/zTXIXg==",
223
+ "version": "0.5.163",
224
+ "resolved": "https://registry.npmjs.org/@tensorlakeai/native-win32-x64/-/native-win32-x64-0.5.163.tgz",
225
+ "integrity": "sha512-RiAyfyir8QuBb77EyULv4axcMeFFHpXSyztXb2SHwcIUg0j+zr5a5uO1NQnNjt8rYzPy3OIAh/L4I70j9gEYag==",
226
226
  "cpu": [
227
227
  "x64"
228
228
  ],
@@ -236,12 +236,12 @@
236
236
  }
237
237
  },
238
238
  "node_modules/@types/node": {
239
- "version": "24.13.3",
240
- "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.3.tgz",
241
- "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==",
239
+ "version": "24.19.2",
240
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
241
+ "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",
242
242
  "license": "MIT",
243
243
  "dependencies": {
244
- "undici-types": "~7.18.0"
244
+ "undici-types": ">=7.24.0 <7.24.7"
245
245
  }
246
246
  },
247
247
  "node_modules/ajv": {
@@ -338,9 +338,9 @@
338
338
  "license": "MIT"
339
339
  },
340
340
  "node_modules/fast-uri": {
341
- "version": "3.1.3",
342
- "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz",
343
- "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==",
341
+ "version": "3.1.9",
342
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
343
+ "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
344
344
  "funding": [
345
345
  {
346
346
  "type": "github",
@@ -409,9 +409,9 @@
409
409
  "license": "Apache-2.0"
410
410
  },
411
411
  "node_modules/nanoid": {
412
- "version": "3.3.18",
413
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
414
- "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
412
+ "version": "3.3.20",
413
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
414
+ "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
415
415
  "funding": [
416
416
  {
417
417
  "type": "github",
@@ -427,9 +427,9 @@
427
427
  }
428
428
  },
429
429
  "node_modules/protobufjs": {
430
- "version": "7.6.5",
431
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz",
432
- "integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==",
430
+ "version": "7.6.6",
431
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.6.tgz",
432
+ "integrity": "sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==",
433
433
  "hasInstallScript": true,
434
434
  "license": "BSD-3-Clause",
435
435
  "dependencies": {
@@ -494,9 +494,9 @@
494
494
  }
495
495
  },
496
496
  "node_modules/undici-types": {
497
- "version": "7.18.2",
498
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
499
- "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
497
+ "version": "7.24.6",
498
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
499
+ "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
500
500
  "license": "MIT"
501
501
  },
502
502
  "node_modules/walkdir": {
@@ -526,9 +526,9 @@
526
526
  }
527
527
  },
528
528
  "node_modules/ws": {
529
- "version": "8.21.1",
530
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz",
531
- "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==",
529
+ "version": "8.22.1",
530
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz",
531
+ "integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==",
532
532
  "license": "MIT",
533
533
  "engines": {
534
534
  "node": ">=10.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensorlake/typescript-function-runner-runtime",
3
- "version": "0.5.162",
3
+ "version": "0.5.163",
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
- "@tensorlakeai/native-darwin-arm64": "0.5.162",
18
- "@tensorlakeai/native-linux-arm64-gnu": "0.5.162",
19
- "@tensorlakeai/native-linux-arm64-musl": "0.5.162",
20
- "@tensorlakeai/native-linux-x64-gnu": "0.5.162",
21
- "@tensorlakeai/native-linux-x64-musl": "0.5.162",
22
- "@tensorlakeai/native-win32-x64": "0.5.162"
17
+ "@tensorlakeai/native-darwin-arm64": "0.5.163",
18
+ "@tensorlakeai/native-linux-arm64-gnu": "0.5.163",
19
+ "@tensorlakeai/native-linux-arm64-musl": "0.5.163",
20
+ "@tensorlakeai/native-linux-x64-gnu": "0.5.163",
21
+ "@tensorlakeai/native-linux-x64-musl": "0.5.163",
22
+ "@tensorlakeai/native-win32-x64": "0.5.163"
23
23
  },
24
24
  "license": "Apache-2.0"
25
25
  }
@@ -171,54 +171,6 @@ interface FileSystem {
171
171
  updatedAt?: Date;
172
172
  }
173
173
 
174
- declare const ImageBuildOperationType: {
175
- readonly ADD: "ADD";
176
- readonly COPY: "COPY";
177
- readonly ENV: "ENV";
178
- readonly RUN: "RUN";
179
- readonly WORKDIR: "WORKDIR";
180
- };
181
- type ImageBuildOperationType = (typeof ImageBuildOperationType)[keyof typeof ImageBuildOperationType];
182
- interface ImageBuildOperation {
183
- type: ImageBuildOperationType;
184
- args: string[];
185
- options: Record<string, string>;
186
- }
187
- interface ImageOptions {
188
- name?: string;
189
- tag?: string;
190
- baseImage?: string | null;
191
- }
192
- declare class Image {
193
- readonly _id: string;
194
- readonly _name: string;
195
- readonly _tag: string;
196
- readonly _baseImage: string | null;
197
- readonly _buildOperations: ImageBuildOperation[];
198
- constructor();
199
- constructor(name: string, tag?: string, baseImage?: string | null);
200
- constructor(options: ImageOptions);
201
- get name(): string;
202
- get tag(): string;
203
- get baseImage(): string | null;
204
- get buildOperations(): ImageBuildOperation[];
205
- add(src: string, dest: string, options?: Record<string, string> | undefined): this;
206
- copy(src: string, dest: string, options?: Record<string, string> | undefined): this;
207
- env(key: string, value: string): this;
208
- run(commands: string | string[], options?: Record<string, string> | undefined): this;
209
- workdir(directory: string): this;
210
- /**
211
- * Build this image and register it as a CAS sandbox image (the default) or,
212
- * with `cas: false`, a legacy sandbox image.
213
- *
214
- * Materializes the image in a build sandbox, snapshots the filesystem,
215
- * and registers the snapshot under the image's name.
216
- */
217
- build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
218
- private _addOperation;
219
- }
220
- declare function dockerfileContent(image: Image): string;
221
-
222
174
  /**
223
175
  * Sandbox-image build engine.
224
176
  *
@@ -570,4 +522,52 @@ declare function listSandboxImagesWithCredentials(credentials: SandboxImageCatal
570
522
  declare function runCreateSandboxImageCli(argv?: string[]): Promise<void>;
571
523
  declare function runImportSandboxImageCli(argv?: string[]): Promise<void>;
572
524
 
525
+ declare const ImageBuildOperationType: {
526
+ readonly ADD: "ADD";
527
+ readonly COPY: "COPY";
528
+ readonly ENV: "ENV";
529
+ readonly RUN: "RUN";
530
+ readonly WORKDIR: "WORKDIR";
531
+ };
532
+ type ImageBuildOperationType = (typeof ImageBuildOperationType)[keyof typeof ImageBuildOperationType];
533
+ interface ImageBuildOperation {
534
+ type: ImageBuildOperationType;
535
+ args: string[];
536
+ options: Record<string, string>;
537
+ }
538
+ interface ImageOptions {
539
+ name?: string;
540
+ tag?: string;
541
+ baseImage?: string | null;
542
+ }
543
+ declare class Image {
544
+ readonly _id: string;
545
+ readonly _name: string;
546
+ readonly _tag: string;
547
+ readonly _baseImage: string | null;
548
+ readonly _buildOperations: ImageBuildOperation[];
549
+ constructor();
550
+ constructor(name: string, tag?: string, baseImage?: string | null);
551
+ constructor(options: ImageOptions);
552
+ get name(): string;
553
+ get tag(): string;
554
+ get baseImage(): string | null;
555
+ get buildOperations(): ImageBuildOperation[];
556
+ add(src: string, dest: string, options?: Record<string, string> | undefined): this;
557
+ copy(src: string, dest: string, options?: Record<string, string> | undefined): this;
558
+ env(key: string, value: string): this;
559
+ run(commands: string | string[], options?: Record<string, string> | undefined): this;
560
+ workdir(directory: string): this;
561
+ /**
562
+ * Build this image and register it as a CAS sandbox image (the default) or,
563
+ * with `cas: false`, a legacy sandbox image.
564
+ *
565
+ * Materializes the image in a build sandbox, snapshots the filesystem,
566
+ * and registers the snapshot under the image's name.
567
+ */
568
+ build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
569
+ private _addOperation;
570
+ }
571
+ declare function dockerfileContent(image: Image): string;
572
+
573
573
  export { type ApplicationManifest as A, type BinaryPayload as B, type CloudClientOptions as C, importSandboxImage as D, listSandboxImages as E, type FileSystem as F, type BuildContext as G, type SandboxImageCatalogCredentials as H, Image as I, __setNativeBindingForTest as J, buildContextFromEnv as K, deleteSandboxImageWithCredentials as L, findSandboxImageByNameWithCredentials as M, type NewSecret as N, listSandboxImagesWithCredentials as O, runCreateSandboxImageCli as P, runImportSandboxImageCli as Q, type RequestInput as R, type SandboxTemplate as S, type UpsertSecretResponse as U, __imageBuildInternals as _, type ApplicationSummary as a, type RequestOutput as b, type RequestMetadata as c, type SecretsList as d, type Secret as e, type StartImageBuildRequest as f, type BuildInfo as g, type CreateApplicationBuildRequest as h, type ApplicationBuildContext as i, type ApplicationBuildResponse as j, type BuildLogEntry as k, type CreateSandboxImageDeps as l, type ApplicationBuildImageResult as m, type CreateApplicationBuildImageRequest as n, type CreateSandboxImageOptions as o, type ImageBuildOperation as p, ImageBuildOperationType as q, type ImageOptions as r, type ImportSandboxImageOptions as s, type RequestErrorInfo as t, type SandboxImageSource as u, type SecretsPagination as v, createSandboxImage as w, deleteSandboxImage as x, dockerfileContent as y, findSandboxImageByName as z };
@@ -171,54 +171,6 @@ interface FileSystem {
171
171
  updatedAt?: Date;
172
172
  }
173
173
 
174
- declare const ImageBuildOperationType: {
175
- readonly ADD: "ADD";
176
- readonly COPY: "COPY";
177
- readonly ENV: "ENV";
178
- readonly RUN: "RUN";
179
- readonly WORKDIR: "WORKDIR";
180
- };
181
- type ImageBuildOperationType = (typeof ImageBuildOperationType)[keyof typeof ImageBuildOperationType];
182
- interface ImageBuildOperation {
183
- type: ImageBuildOperationType;
184
- args: string[];
185
- options: Record<string, string>;
186
- }
187
- interface ImageOptions {
188
- name?: string;
189
- tag?: string;
190
- baseImage?: string | null;
191
- }
192
- declare class Image {
193
- readonly _id: string;
194
- readonly _name: string;
195
- readonly _tag: string;
196
- readonly _baseImage: string | null;
197
- readonly _buildOperations: ImageBuildOperation[];
198
- constructor();
199
- constructor(name: string, tag?: string, baseImage?: string | null);
200
- constructor(options: ImageOptions);
201
- get name(): string;
202
- get tag(): string;
203
- get baseImage(): string | null;
204
- get buildOperations(): ImageBuildOperation[];
205
- add(src: string, dest: string, options?: Record<string, string> | undefined): this;
206
- copy(src: string, dest: string, options?: Record<string, string> | undefined): this;
207
- env(key: string, value: string): this;
208
- run(commands: string | string[], options?: Record<string, string> | undefined): this;
209
- workdir(directory: string): this;
210
- /**
211
- * Build this image and register it as a CAS sandbox image (the default) or,
212
- * with `cas: false`, a legacy sandbox image.
213
- *
214
- * Materializes the image in a build sandbox, snapshots the filesystem,
215
- * and registers the snapshot under the image's name.
216
- */
217
- build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
218
- private _addOperation;
219
- }
220
- declare function dockerfileContent(image: Image): string;
221
-
222
174
  /**
223
175
  * Sandbox-image build engine.
224
176
  *
@@ -570,4 +522,52 @@ declare function listSandboxImagesWithCredentials(credentials: SandboxImageCatal
570
522
  declare function runCreateSandboxImageCli(argv?: string[]): Promise<void>;
571
523
  declare function runImportSandboxImageCli(argv?: string[]): Promise<void>;
572
524
 
525
+ declare const ImageBuildOperationType: {
526
+ readonly ADD: "ADD";
527
+ readonly COPY: "COPY";
528
+ readonly ENV: "ENV";
529
+ readonly RUN: "RUN";
530
+ readonly WORKDIR: "WORKDIR";
531
+ };
532
+ type ImageBuildOperationType = (typeof ImageBuildOperationType)[keyof typeof ImageBuildOperationType];
533
+ interface ImageBuildOperation {
534
+ type: ImageBuildOperationType;
535
+ args: string[];
536
+ options: Record<string, string>;
537
+ }
538
+ interface ImageOptions {
539
+ name?: string;
540
+ tag?: string;
541
+ baseImage?: string | null;
542
+ }
543
+ declare class Image {
544
+ readonly _id: string;
545
+ readonly _name: string;
546
+ readonly _tag: string;
547
+ readonly _baseImage: string | null;
548
+ readonly _buildOperations: ImageBuildOperation[];
549
+ constructor();
550
+ constructor(name: string, tag?: string, baseImage?: string | null);
551
+ constructor(options: ImageOptions);
552
+ get name(): string;
553
+ get tag(): string;
554
+ get baseImage(): string | null;
555
+ get buildOperations(): ImageBuildOperation[];
556
+ add(src: string, dest: string, options?: Record<string, string> | undefined): this;
557
+ copy(src: string, dest: string, options?: Record<string, string> | undefined): this;
558
+ env(key: string, value: string): this;
559
+ run(commands: string | string[], options?: Record<string, string> | undefined): this;
560
+ workdir(directory: string): this;
561
+ /**
562
+ * Build this image and register it as a CAS sandbox image (the default) or,
563
+ * with `cas: false`, a legacy sandbox image.
564
+ *
565
+ * Materializes the image in a build sandbox, snapshots the filesystem,
566
+ * and registers the snapshot under the image's name.
567
+ */
568
+ build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
569
+ private _addOperation;
570
+ }
571
+ declare function dockerfileContent(image: Image): string;
572
+
573
573
  export { type ApplicationManifest as A, type BinaryPayload as B, type CloudClientOptions as C, importSandboxImage as D, listSandboxImages as E, type FileSystem as F, type BuildContext as G, type SandboxImageCatalogCredentials as H, Image as I, __setNativeBindingForTest as J, buildContextFromEnv as K, deleteSandboxImageWithCredentials as L, findSandboxImageByNameWithCredentials as M, type NewSecret as N, listSandboxImagesWithCredentials as O, runCreateSandboxImageCli as P, runImportSandboxImageCli as Q, type RequestInput as R, type SandboxTemplate as S, type UpsertSecretResponse as U, __imageBuildInternals as _, type ApplicationSummary as a, type RequestOutput as b, type RequestMetadata as c, type SecretsList as d, type Secret as e, type StartImageBuildRequest as f, type BuildInfo as g, type CreateApplicationBuildRequest as h, type ApplicationBuildContext as i, type ApplicationBuildResponse as j, type BuildLogEntry as k, type CreateSandboxImageDeps as l, type ApplicationBuildImageResult as m, type CreateApplicationBuildImageRequest as n, type CreateSandboxImageOptions as o, type ImageBuildOperation as p, ImageBuildOperationType as q, type ImageOptions as r, type ImportSandboxImageOptions as s, type RequestErrorInfo as t, type SandboxImageSource as u, type SecretsPagination as v, createSandboxImage as w, deleteSandboxImage as x, dockerfileContent as y, findSandboxImageByName as z };