@boundaryml/baml-bridge-web 0.0.0 → 0.15.0

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 (89) hide show
  1. package/dist/index.d.ts +3 -3
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +16 -14
  4. package/dist/index.js.map +1 -1
  5. package/dist/native.d.ts +50 -14
  6. package/dist/native.d.ts.map +1 -1
  7. package/dist/native.js +327 -70
  8. package/dist/native.js.map +1 -1
  9. package/dist/platform.d.ts +4 -0
  10. package/dist/platform.d.ts.map +1 -0
  11. package/dist/platform.js +5 -0
  12. package/dist/platform.js.map +1 -0
  13. package/dist/shared/call_context.d.ts +7 -0
  14. package/dist/shared/call_context.d.ts.map +1 -0
  15. package/dist/shared/call_context.js +11 -0
  16. package/dist/shared/call_context.js.map +1 -0
  17. package/dist/shared/define_function.d.ts.map +1 -1
  18. package/dist/shared/define_function.js +13 -24
  19. package/dist/shared/define_function.js.map +1 -1
  20. package/dist/shared/errors.d.ts +4 -4
  21. package/dist/shared/errors.d.ts.map +1 -1
  22. package/dist/shared/errors.js +16 -10
  23. package/dist/shared/errors.js.map +1 -1
  24. package/dist/shared/host_value_registry.d.ts +5 -3
  25. package/dist/shared/host_value_registry.d.ts.map +1 -1
  26. package/dist/shared/host_value_registry.js +10 -6
  27. package/dist/shared/host_value_registry.js.map +1 -1
  28. package/dist/shared/platform.d.ts +4 -0
  29. package/dist/shared/platform.d.ts.map +1 -0
  30. package/dist/shared/platform.js +5 -0
  31. package/dist/shared/platform.js.map +1 -0
  32. package/dist/shared/proto/baml_cffi.d.ts +35 -8
  33. package/dist/shared/proto/baml_cffi.js +138 -25
  34. package/dist/shared/proto.d.ts +9 -5
  35. package/dist/shared/proto.d.ts.map +1 -1
  36. package/dist/shared/proto.js +197 -104
  37. package/dist/shared/proto.js.map +1 -1
  38. package/dist/shared/stream.d.ts +3 -2
  39. package/dist/shared/stream.d.ts.map +1 -1
  40. package/dist/shared/stream.js +22 -15
  41. package/dist/shared/stream.js.map +1 -1
  42. package/dist/wasm/bridge_web_core.d.ts +99 -68
  43. package/dist/wasm/bridge_web_core.js +519 -492
  44. package/dist/wasm/bridge_web_core_bg.wasm +0 -0
  45. package/dist/wasm/bridge_web_core_bg.wasm.d.ts +41 -27
  46. package/dist/wasm/package.json +1 -1
  47. package/dist/workerd/index.d.ts +3 -3
  48. package/dist/workerd/index.d.ts.map +1 -1
  49. package/dist/workerd/index.js +21 -14
  50. package/dist/workerd/index.js.map +1 -1
  51. package/dist/workerd/native.d.ts +50 -14
  52. package/dist/workerd/native.d.ts.map +1 -1
  53. package/dist/workerd/native.js +327 -70
  54. package/dist/workerd/shared/call_context.d.ts +7 -0
  55. package/dist/workerd/shared/call_context.d.ts.map +1 -0
  56. package/dist/workerd/shared/call_context.js +11 -0
  57. package/dist/workerd/shared/call_context.js.map +1 -0
  58. package/dist/workerd/shared/define_function.d.ts.map +1 -1
  59. package/dist/workerd/shared/define_function.js +13 -24
  60. package/dist/workerd/shared/define_function.js.map +1 -1
  61. package/dist/workerd/shared/errors.d.ts +4 -4
  62. package/dist/workerd/shared/errors.d.ts.map +1 -1
  63. package/dist/workerd/shared/errors.js +16 -10
  64. package/dist/workerd/shared/errors.js.map +1 -1
  65. package/dist/workerd/shared/host_value_registry.d.ts +5 -3
  66. package/dist/workerd/shared/host_value_registry.d.ts.map +1 -1
  67. package/dist/workerd/shared/host_value_registry.js +10 -6
  68. package/dist/workerd/shared/host_value_registry.js.map +1 -1
  69. package/dist/workerd/shared/platform.d.ts +4 -0
  70. package/dist/workerd/shared/platform.d.ts.map +1 -0
  71. package/dist/workerd/shared/platform.js +5 -0
  72. package/dist/workerd/shared/platform.js.map +1 -0
  73. package/dist/workerd/shared/proto/baml_cffi.d.ts +35 -8
  74. package/dist/workerd/shared/proto/baml_cffi.js +140 -25
  75. package/dist/workerd/shared/proto.d.ts +9 -5
  76. package/dist/workerd/shared/proto.d.ts.map +1 -1
  77. package/dist/workerd/shared/proto.js +197 -104
  78. package/dist/workerd/shared/proto.js.map +1 -1
  79. package/dist/workerd/shared/stream.d.ts +3 -2
  80. package/dist/workerd/shared/stream.d.ts.map +1 -1
  81. package/dist/workerd/shared/stream.js +22 -15
  82. package/dist/workerd/shared/stream.js.map +1 -1
  83. package/dist/workerd-wasm/bridge_web_core.d.ts +62 -45
  84. package/dist/workerd-wasm/bridge_web_core.js +3 -5
  85. package/dist/workerd-wasm/bridge_web_core_bg.js +519 -493
  86. package/dist/workerd-wasm/bridge_web_core_bg.wasm +0 -0
  87. package/dist/workerd-wasm/bridge_web_core_bg.wasm.d.ts +41 -27
  88. package/dist/workerd-wasm/package.json +1 -1
  89. package/package.json +22 -5
Binary file
@@ -1,41 +1,55 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const callFunction: (a: number, b: number, c: number, d: number) => number;
5
- export const callFunctionSync: (a: number, b: number, c: number, d: number, e: number) => void;
4
+ export const _testHandleTableEntryCount: (a: number) => void;
5
+ export const _testWebFireHostRelease: (a: bigint) => void;
6
+ export const _testWebHostCallableCount: () => number;
7
+ export const _testWebHostReleaseCallbackInstalled: () => number;
8
+ export const _testWebInFlightHostCallCount: () => number;
9
+ export const _testWebMissingHostCallableError: (a: bigint) => number;
10
+ export const _testWebSyncPendingHostCallableError: (a: number, b: bigint) => void;
11
+ export const callFunction: (a: number, b: number) => number;
12
+ export const callFunctionSync: (a: number, b: number, c: number) => void;
6
13
  export const cancelFunctionCall: (a: bigint) => number;
7
- export const completeWebHostCall: (a: number, b: number, c: number, d: number) => void;
14
+ export const cloneHandle: (a: number, b: bigint) => void;
15
+ export const completeWebHostCall: (a: number, b: number, c: number, d: number) => number;
16
+ export const configureWebSysops: (a: number, b: bigint, c: bigint) => void;
17
+ export const flushEvents: () => void;
18
+ export const getBridgeRuntimeVersion: (a: number) => void;
19
+ export const init: () => void;
20
+ export const mediaBase64: (a: number, b: bigint, c: number) => void;
21
+ export const mediaFile: (a: number, b: bigint, c: number) => void;
22
+ export const mediaFromBase64: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
23
+ export const mediaFromFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
24
+ export const mediaFromUrl: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
25
+ export const mediaMimeType: (a: number, b: bigint, c: number) => void;
26
+ export const mediaUrl: (a: number, b: bigint, c: number) => void;
8
27
  export const mintWebHostValueKey: () => bigint;
9
28
  export const newFunctionCall: () => bigint;
10
29
  export const registerWebHostCallable: (a: number) => bigint;
11
- export const registerWebHostValueReleaseCallback: (a: number) => void;
30
+ export const registerWebHostValueReleaseCallback: (a: number) => number;
31
+ export const releaseHandle: (a: bigint) => number;
12
32
  export const releaseWebHostCallable: (a: bigint) => void;
13
- export const stageRuntimeBytecode: (a: number, b: number, c: number, d: number) => void;
14
- export const completeHostCall: (a: number, b: number, c: number, d: number) => void;
33
+ export const seedFunctionRefHandle: (a: number, b: number) => void;
34
+ export const seedGenericMediaHandle: (a: number) => void;
35
+ export const stageRuntimeBytecode: (a: number, b: number, c: number, d: number, e: number) => void;
36
+ export const stageRuntimeSources: (a: number, b: number, c: number, d: number) => void;
37
+ export const getVersion: (a: number) => void;
38
+ export const getToolchainVersion: (a: number) => void;
39
+ export const completeHostCall: (a: number, b: number, c: number, d: number) => number;
15
40
  export const registerHostCallable: (a: number) => bigint;
16
- export const registerHostValueReleaseCallback: (a: number) => void;
41
+ export const registerHostValueReleaseCallback: (a: number) => number;
17
42
  export const releaseHostCallable: (a: bigint) => void;
18
43
  export const mintHostValueKey: () => bigint;
19
- export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
20
- export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
21
- export const __wbg_intounderlyingsource_free: (a: number, b: number) => void;
22
- export const intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
23
- export const intounderlyingbytesource_cancel: (a: number) => void;
24
- export const intounderlyingbytesource_pull: (a: number, b: number) => number;
25
- export const intounderlyingbytesource_start: (a: number, b: number) => void;
26
- export const intounderlyingbytesource_type: (a: number) => number;
27
- export const intounderlyingsink_abort: (a: number, b: number) => number;
28
- export const intounderlyingsink_close: (a: number) => number;
29
- export const intounderlyingsink_write: (a: number, b: number) => number;
30
- export const intounderlyingsource_cancel: (a: number) => void;
31
- export const intounderlyingsource_pull: (a: number, b: number) => number;
32
- export const __wasm_bindgen_func_elem_37361: (a: number, b: number, c: number, d: number) => void;
33
- export const __wasm_bindgen_func_elem_37369: (a: number, b: number, c: number, d: number) => void;
34
- export const __wasm_bindgen_func_elem_1351: (a: number, b: number, c: number) => void;
35
- export const __wasm_bindgen_func_elem_1130: (a: number, b: number) => void;
36
- export const __wbindgen_export: (a: number) => void;
37
- export const __wbindgen_export2: (a: number, b: number) => number;
38
- export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
44
+ export const cancel_function_call: (a: bigint) => number;
45
+ export const free_buffer: (a: number) => void;
46
+ export const new_function_call: () => bigint;
47
+ export const __wasm_bindgen_func_elem_41706: (a: number, b: number, c: number, d: number) => void;
48
+ export const __wasm_bindgen_func_elem_41719: (a: number, b: number, c: number, d: number) => void;
49
+ export const __wbindgen_export: (a: number, b: number) => number;
50
+ export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
51
+ export const __wbindgen_export3: (a: number) => void;
39
52
  export const __wbindgen_export4: (a: number, b: number) => void;
40
53
  export const __wbindgen_export5: (a: number, b: number, c: number) => void;
41
54
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
55
+ export const __wbindgen_start: () => void;
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "bridge_web",
2
+ "name": "bridge_typescript_web",
3
3
  "type": "module",
4
4
  "collaborators": [
5
5
  "Vaibhav Gupta <vbv@boundaryml.com>"
@@ -1,14 +1,14 @@
1
1
  import { BamlCallContext, BamlRuntime, Collector, HostSpanManager } from "./native.js";
2
- export { BamlAudio, BamlCallContext, BamlHandle, BamlImage, BamlPdf, BamlRuntime, BamlVideo, Collector, FunctionLog, HostSpanManager, LLMCall, Timing, Usage, flushEvents, getRuntime, getVersion, newFunctionCall } from "./native.js";
2
+ export { BamlAudio, BamlCallContext, BamlHandle, BamlImage, BamlPdf, BamlRuntime, BamlVideo, Collector, FunctionLog, HostSpanManager, Timing, Usage, _seedFunctionRefHandle, _seedGenericMediaHandle, flushEvents, getBridgeRuntimeVersion, getRuntime, getToolchainVersion, getVersion, newFunctionCall } from "./native.js";
3
3
  export { BamlStream } from "./shared/stream.js";
4
4
  export { BamlTypeMap, getTypeMap, setTypeMap } from "./shared/typemap.js";
5
5
  export { defineFunction, defineInstanceFunction, UNSET } from "./shared/define_function.js";
6
6
  export type { GenericParams } from "./shared/define_function.js";
7
7
  export { Never, lowerTypeToWireTy } from "./shared/wire_ty.js";
8
8
  export type { BamlClassCtor, BamlPrimitiveToken, BamlType } from "./shared/wire_ty.js";
9
- export { BamlAbortError, BamlCancelledError, BamlClientError, BamlError, BamlInvalidArgumentError, BamlPanic } from "./shared/errors.js";
9
+ export { BamlAbortError, BamlCancelledError, BamlClientError, BamlError, BamlInvalidArgumentError, BamlPanic, wrapNativeError } from "./shared/errors.js";
10
10
  export { decodeCallResult, encodeCallArgs } from "./shared/proto.js";
11
- export declare function initializeRuntimeFromBytecode(bytecode: Uint8Array): void;
11
+ export declare function initializeRuntimeFromBytecode(bytecode: Uint8Array, embeddedBamlToml?: string): void;
12
12
  export declare function initializeRuntime(srcDir: string, files: Record<string, string>): void;
13
13
  export declare class FunctionResult {
14
14
  private readonly value;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../typescript_src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAwG,MAAM,aAAa,CAAC;AAG7L,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE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,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAS9M;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,GAAG,IAAI,eAAe;IACtB,UAAU,IAAI,OAAO;IACrB,KAAK,IAAI,IAAI;IACb,YAAY,IAAI,eAAe;IAC/B,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;CAC/C;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D"}
@@ -1,14 +1,21 @@
1
- import { BamlRuntime, HostSpanManager, cancelFunctionCall as nativeCancelFunctionCall, newFunctionCall as nativeNewFunctionCall } from "./native.js";
2
- import { decodeCallResult, encodeCallArgs } from "./shared/proto.js";
3
- export { BamlAudio, BamlCallContext, BamlHandle, BamlImage, BamlPdf, BamlRuntime, BamlVideo, Collector, FunctionLog, HostSpanManager, LLMCall, Timing, Usage, flushEvents, getRuntime, getVersion, newFunctionCall } from "./native.js";
1
+ import { readFileSync } from "node:fs";
2
+ import { installReadFileSync } from "./native.js";
3
+
4
+ installReadFileSync((path) => readFileSync(path));
5
+
6
+ import { BamlRuntime, HostSpanManager, cancelFunctionCall as nativeCancelFunctionCall, installHostCallableDispatchFactory, newFunctionCall as nativeNewFunctionCall } from "./native.js";
7
+ import { decodeCallResult, encodeCallArgs, makeHostCallableDispatch } from "./shared/proto.js";
8
+ import { attachCallContext } from "./shared/call_context.js";
9
+ installHostCallableDispatchFactory(makeHostCallableDispatch);
10
+ export { BamlAudio, BamlCallContext, BamlHandle, BamlImage, BamlPdf, BamlRuntime, BamlVideo, Collector, FunctionLog, HostSpanManager, Timing, Usage, _seedFunctionRefHandle, _seedGenericMediaHandle, flushEvents, getBridgeRuntimeVersion, getRuntime, getToolchainVersion, getVersion, newFunctionCall } from "./native.js";
4
11
  export { BamlStream } from "./shared/stream.js";
5
12
  export { BamlTypeMap, getTypeMap, setTypeMap } from "./shared/typemap.js";
6
13
  export { defineFunction, defineInstanceFunction, UNSET } from "./shared/define_function.js";
7
14
  export { Never, lowerTypeToWireTy } from "./shared/wire_ty.js";
8
- export { BamlAbortError, BamlCancelledError, BamlClientError, BamlError, BamlInvalidArgumentError, BamlPanic } from "./shared/errors.js";
15
+ export { BamlAbortError, BamlCancelledError, BamlClientError, BamlError, BamlInvalidArgumentError, BamlPanic, wrapNativeError } from "./shared/errors.js";
9
16
  export { decodeCallResult, encodeCallArgs } from "./shared/proto.js";
10
- export function initializeRuntimeFromBytecode(bytecode) {
11
- BamlRuntime.initializeRuntimeFromBytecode(bytecode);
17
+ export function initializeRuntimeFromBytecode(bytecode, embeddedBamlToml) {
18
+ BamlRuntime.initializeRuntimeFromBytecode(bytecode, embeddedBamlToml);
12
19
  }
13
20
  export function initializeRuntime(srcDir, files) {
14
21
  BamlRuntime.initializeRuntime(srcDir, files);
@@ -23,24 +30,24 @@ export class FunctionResult {
23
30
  }
24
31
  export function callFunctionSync(rt, functionName, kwargs, ctx, collectors, callCtx) {
25
32
  const callId = nativeNewFunctionCall();
26
- const args = encodeCallArgs(kwargs, { syncMode: true, callId });
27
- callCtx?._attachCallId(callId.toString());
33
+ const args = encodeCallArgs(kwargs, { syncMode: true, callId, functionName });
34
+ const callCtxBinding = attachCallContext(callCtx, callId);
28
35
  try {
29
- return new FunctionResult(decodeCallResult(rt.callFunctionSync(functionName, args, ctx ?? null, collectors ?? null)));
36
+ return new FunctionResult(decodeCallResult(rt.callFunctionSync(args, ctx ?? null, collectors ?? null)));
30
37
  }
31
38
  finally {
32
- callCtx?._detachCallId(callId.toString());
39
+ callCtxBinding.detach();
33
40
  }
34
41
  }
35
42
  export async function callFunction(rt, functionName, kwargs, ctx, collectors, callCtx) {
36
43
  const callId = nativeNewFunctionCall();
37
- const args = encodeCallArgs(kwargs, { callId });
38
- callCtx?._attachCallId(callId.toString());
44
+ const args = encodeCallArgs(kwargs, { callId, functionName });
45
+ const callCtxBinding = attachCallContext(callCtx, callId);
39
46
  try {
40
- return new FunctionResult(decodeCallResult(await rt.callFunction(functionName, args, ctx ?? null, collectors ?? null)));
47
+ return new FunctionResult(decodeCallResult(await rt.callFunction(args, ctx ?? null, collectors ?? null)));
41
48
  }
42
49
  finally {
43
- callCtx?._detachCallId(callId.toString());
50
+ callCtxBinding.detach();
44
51
  }
45
52
  }
46
53
  export class CtxManager {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../typescript_src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAa,eAAe,EAAE,kBAAkB,IAAI,wBAAwB,EAAc,eAAe,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC7L,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxO,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAE5F,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,SAAS,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzI,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAErE,MAAM,UAAU,6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AAc,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,MAAM,OAAO,UAAU;IACJ,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;IACjD,GAAG,KAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,UAAU,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IACtC,KAAK,KAAU,CAAC;IAChB,YAAY,KAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACpE,UAAU,CAAC,IAA4B,IAAU,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CAClF;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,42 +1,76 @@
1
+ type ReadFileSync = (path: string) => Uint8Array;
2
+ type HostCallableDispatchFactory = (callable: (...args: unknown[]) => unknown) => (callId: number, payload: Uint8Array) => void;
3
+ export declare function installReadFileSync(impl: ReadFileSync): void;
4
+ export declare function installHostCallableDispatchFactory(factory: HostCallableDispatchFactory): void;
1
5
  export interface HandleKey {
2
6
  low: number;
3
7
  high: number;
4
8
  }
5
9
  export declare class BamlHandle {
6
- readonly key: HandleKey;
7
10
  readonly handleType: number;
11
+ private readonly rawKey;
12
+ private readonly finalizerToken;
13
+ private released;
8
14
  constructor(key: HandleKey, handleType: number);
15
+ get key(): HandleKey;
16
+ private assertLive;
17
+ _keyForBridge(): bigint;
9
18
  clone(): BamlHandle;
10
19
  _cloneKeyForWire(): HandleKey;
20
+ _releaseForTest(): boolean;
11
21
  }
12
- declare class BamlMedia {
13
- private readonly handle;
14
- protected constructor(handle: BamlHandle);
15
- static fromUrl(_url: string, _mimeType?: string | null): BamlMedia;
16
- static fromFile(_file: string, _mimeType?: string | null): BamlMedia;
17
- static fromBase64(_base64: string, _mimeType?: string | null): BamlMedia;
18
- static _fromHandle(handle: BamlHandle): BamlMedia;
22
+ declare abstract class BamlMedia {
23
+ private readonly rawKey;
24
+ private readonly handleType;
25
+ private readonly finalizerToken;
26
+ private released;
27
+ protected constructor(rawKey: bigint, handleType: number);
28
+ protected static cloneKeyFromHandle(handle: BamlHandle, expectedHandleType: number, className: string): bigint;
29
+ private assertLive;
19
30
  _toHandle(): BamlHandle;
20
31
  url(): string | null;
21
32
  file(): string | null;
22
33
  base64(): string;
23
34
  mimeType(): string | null;
35
+ _releaseForTest(): boolean;
24
36
  }
25
37
  export declare class BamlImage extends BamlMedia {
38
+ private constructor();
39
+ static fromUrl(url: string, mimeType?: string | null): BamlImage;
40
+ static fromFile(file: string, mimeType?: string | null): BamlImage;
41
+ static fromBase64(base64: string, mimeType?: string | null): BamlImage;
42
+ static _fromHandle(handle: BamlHandle): BamlImage;
26
43
  }
27
44
  export declare class BamlAudio extends BamlMedia {
45
+ private constructor();
46
+ static fromUrl(url: string, mimeType?: string | null): BamlAudio;
47
+ static fromFile(file: string, mimeType?: string | null): BamlAudio;
48
+ static fromBase64(base64: string, mimeType?: string | null): BamlAudio;
49
+ static _fromHandle(handle: BamlHandle): BamlAudio;
28
50
  }
29
51
  export declare class BamlVideo extends BamlMedia {
52
+ private constructor();
53
+ static fromUrl(url: string, mimeType?: string | null): BamlVideo;
54
+ static fromFile(file: string, mimeType?: string | null): BamlVideo;
55
+ static fromBase64(base64: string, mimeType?: string | null): BamlVideo;
56
+ static _fromHandle(handle: BamlHandle): BamlVideo;
30
57
  }
31
58
  export declare class BamlPdf extends BamlMedia {
59
+ private constructor();
60
+ static fromUrl(url: string, mimeType?: string | null): BamlPdf;
61
+ static fromFile(file: string, mimeType?: string | null): BamlPdf;
62
+ static fromBase64(base64: string, mimeType?: string | null): BamlPdf;
63
+ static _fromHandle(handle: BamlHandle): BamlPdf;
32
64
  }
65
+ export declare function _setCallCancellationObserverForTest(observer: ((callId: bigint) => void) | undefined): void;
33
66
  export declare class BamlCallContext {
34
- private callIds;
67
+ private readonly activeCallIds;
35
68
  private isAborted;
36
69
  abort(): void;
37
70
  get aborted(): boolean;
38
71
  _attachCallId(callId: string): void;
39
72
  _detachCallId(callId: string): void;
73
+ _activeCallIdsForTest(): bigint[];
40
74
  }
41
75
  export declare class HostSpanManager {
42
76
  enter(_name: string, _args: unknown): void;
@@ -59,21 +93,23 @@ export declare class Collector {
59
93
  constructor(_name?: string | null);
60
94
  }
61
95
  export declare class BamlRuntime {
62
- static initializeRuntimeFromBytecode(bytecode: Uint8Array): BamlRuntime;
63
- static initializeRuntime(_rootPath: string, _files: Record<string, string>): BamlRuntime;
64
- callFunctionSync(functionName: string, encodedArgs: Uint8Array, _ctx?: HostSpanManager | null, _collectors?: Collector[] | null): Uint8Array;
65
- callFunction(functionName: string, encodedArgs: Uint8Array, _ctx?: HostSpanManager | null, _collectors?: Collector[] | null): Promise<Uint8Array>;
96
+ static initializeRuntimeFromBytecode(bytecode: Uint8Array, embeddedBamlToml?: string): BamlRuntime;
97
+ static initializeRuntime(rootPath: string, files: Record<string, string>): BamlRuntime;
98
+ callFunctionSync(encodedArgs: Uint8Array, _ctx?: HostSpanManager | null, _collectors?: Collector[] | null): Uint8Array;
99
+ callFunction(encodedArgs: Uint8Array, _ctx?: HostSpanManager | null, _collectors?: Collector[] | null): Promise<Uint8Array>;
66
100
  }
67
101
  export declare function getRuntime(): BamlRuntime;
68
102
  export declare function newFunctionCall(): bigint;
69
103
  export declare function cancelFunctionCall(callId: bigint | string): boolean;
70
104
  export declare function flushEvents(): void;
71
105
  export declare function getVersion(): string;
106
+ export declare function getToolchainVersion(): string;
107
+ export declare function getBridgeRuntimeVersion(): string;
72
108
  export declare function mintHostValueKey(): HandleKey;
73
109
  export declare function registerHostValueReleaseCallback(callback: (key: HandleKey) => void): void;
74
110
  export declare function registerHostCallable(callback: (callId: number, args: Uint8Array) => void): HandleKey;
75
111
  export declare function releaseHostCallable(key: HandleKey): void;
76
112
  export declare function completeHostCall(callId: number, isError: number, content: Uint8Array): void;
77
- export declare function _seedFunctionRefHandle(_globalIndex: number): [HandleKey, number];
113
+ export declare function _seedFunctionRefHandle(globalIndex: number): [HandleKey, number];
78
114
  export declare function _seedGenericMediaHandle(): [HandleKey, number];
79
115
  //# sourceMappingURL=native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../typescript_src/native.ts"],"names":[],"mappings":"AAuDA,MAAM,WAAW,SAAS;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE;AAMzD,qBAAa,UAAU;aACO,GAAG,EAAE,SAAS;aAAkB,UAAU,EAAE,MAAM;gBAAlD,GAAG,EAAE,SAAS,EAAkB,UAAU,EAAE,MAAM;IAC9E,KAAK,IAAI,UAAU;IACnB,gBAAgB,IAAI,SAAS;CAC9B;AAED,cAAM,SAAS;IACS,OAAO,CAAC,QAAQ,CAAC,MAAM;IAA7C,SAAS,aAA8B,MAAM,EAAE,UAAU;IACzD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAClE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IACpE,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IACxE,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS;IACjD,SAAS,IAAI,UAAU;IACvB,GAAG,IAAI,MAAM,GAAG,IAAI;IACpB,IAAI,IAAI,MAAM,GAAG,IAAI;IACrB,MAAM,IAAI,MAAM;IAChB,QAAQ,IAAI,MAAM,GAAG,IAAI;CAC1B;AAED,qBAAa,SAAU,SAAQ,SAAS;CAAG;AAC3C,qBAAa,SAAU,SAAQ,SAAS;C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