@boundaryml/baml-core-node 0.11.2-nightly.20260604.d

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.
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Error thrown when a host callable (a JS `function`) is passed to the
3
+ * *synchronous* call path. See {@link encodeCallArgs} for why this can't work.
4
+ */
5
+ export declare class HostCallableSyncError extends Error {
6
+ constructor(message: string);
7
+ }
8
+ /**
9
+ * Encode kwargs into `CallFunctionArgs` bytes.
10
+ *
11
+ * `syncMode` (default false) selects the sync guard: a host callable in the
12
+ * kwargs of a *synchronous* call rejects with {@link HostCallableSyncError}
13
+ * before any work, rather than registering a tsfn and then hanging.
14
+ *
15
+ * Release tradeoff: a callable that encodes successfully is registered in the
16
+ * host-value table and is normally released only when the engine GCs the
17
+ * `HostClosure` it allocated and fires the C release callback (a GC-timed
18
+ * release, drained by the engine after collection).
19
+ * Because the Node tsfn is built with `weak::<false>` it keeps a strong libuv
20
+ * ref, so a *leaked* registry entry can also keep the Node process from
21
+ * exiting — which is exactly why the encode-error rollback below matters: if a
22
+ * later kwarg fails, the engine never sees (and so never releases) the keys we
23
+ * already registered, so we release them here.
24
+ */
25
+ export declare function encodeCallArgs(kwargs: Record<string, unknown>, syncMode?: boolean): Buffer;
26
+ /**
27
+ * Decode a bare `BamlOutboundValue` to a JS value. Used for the host-callable
28
+ * args path, where the engine sends a list-shaped `BamlOutboundValue` rather
29
+ * than the call-result `BamlOutboundResult` envelope.
30
+ */
31
+ export declare function decodeOutboundValue(data: Buffer | Uint8Array): unknown;
32
+ /**
33
+ * Decode a `BamlOutboundResult` envelope (the engine's call-result wire shape
34
+ * after 31c/31e). The `ok` arm returns the decoded value; the `error`/`panic`
35
+ * arms **throw** a `BamlError`/`BamlPanic` carrying the fully decoded thrown
36
+ * value (`.value`), the BAML trace (`.bamlTrace`), and the class FQN
37
+ * (`.className`), with a readable formatted `.message`. An `is_exit_panic`
38
+ * (clean `baml.sys.exit`) terminates the process via `process.exit(code)`
39
+ * rather than throwing.
40
+ */
41
+ export declare function decodeCallResult(data: Buffer | Uint8Array): unknown;
42
+ //# sourceMappingURL=proto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../typescript_src/proto.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI9B;AA+JD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,UAAQ,GAAG,MAAM,CA2BxF;AA6LD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAGtE;AAwCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAiCnE"}