blazen 0.1.125 → 0.1.126

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 (4) hide show
  1. package/README.md +27 -17
  2. package/index.d.ts +176 -5
  3. package/index.js +56 -52
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -140,7 +140,8 @@ Build messages with the `ChatMessage` class and `Role` enum:
140
140
  import { CompletionModel, ChatMessage, Role } from "blazen";
141
141
  import type { CompletionResponse, ToolCall, TokenUsage } from "blazen";
142
142
 
143
- const model = CompletionModel.openrouter(process.env.OPENROUTER_API_KEY!);
143
+ const model = CompletionModel.openrouter({ apiKey: process.env.OPENROUTER_API_KEY! });
144
+ // or rely on the OPENROUTER_API_KEY env var: CompletionModel.openrouter();
144
145
 
145
146
  // Using static factory methods (recommended)
146
147
  const response: CompletionResponse = await model.complete([
@@ -207,30 +208,39 @@ const response = await model.completeWithOptions(
207
208
 
208
209
  ### All 15 Providers
209
210
 
211
+ Every factory method takes a single options object (or no argument, to read the API key from environment variables). Pass `{ apiKey, model, baseUrl, ... }` to override defaults.
212
+
210
213
  | Factory Method | Provider |
211
214
  |---|---|
212
- | `CompletionModel.openai(apiKey)` | OpenAI |
213
- | `CompletionModel.anthropic(apiKey)` | Anthropic |
214
- | `CompletionModel.gemini(apiKey)` | Google Gemini |
215
- | `CompletionModel.azure(apiKey, resourceName, deploymentName)` | Azure OpenAI |
216
- | `CompletionModel.openrouter(apiKey)` | OpenRouter |
217
- | `CompletionModel.groq(apiKey)` | Groq |
218
- | `CompletionModel.together(apiKey)` | Together AI |
219
- | `CompletionModel.mistral(apiKey)` | Mistral AI |
220
- | `CompletionModel.deepseek(apiKey)` | DeepSeek |
221
- | `CompletionModel.fireworks(apiKey)` | Fireworks AI |
222
- | `CompletionModel.perplexity(apiKey)` | Perplexity |
223
- | `CompletionModel.xai(apiKey)` | xAI / Grok |
224
- | `CompletionModel.cohere(apiKey)` | Cohere |
225
- | `CompletionModel.bedrock(apiKey, region)` | AWS Bedrock |
226
- | `CompletionModel.fal(apiKey)` | fal.ai |
215
+ | `CompletionModel.openai({ apiKey })` | OpenAI |
216
+ | `CompletionModel.anthropic({ apiKey })` | Anthropic |
217
+ | `CompletionModel.gemini({ apiKey })` | Google Gemini |
218
+ | `CompletionModel.azure({ apiKey, resourceName, deploymentName })` | Azure OpenAI |
219
+ | `CompletionModel.openrouter({ apiKey })` | OpenRouter |
220
+ | `CompletionModel.groq({ apiKey })` | Groq |
221
+ | `CompletionModel.together({ apiKey })` | Together AI |
222
+ | `CompletionModel.mistral({ apiKey })` | Mistral AI |
223
+ | `CompletionModel.deepseek({ apiKey })` | DeepSeek |
224
+ | `CompletionModel.fireworks({ apiKey })` | Fireworks AI |
225
+ | `CompletionModel.perplexity({ apiKey })` | Perplexity |
226
+ | `CompletionModel.xai({ apiKey })` | xAI / Grok |
227
+ | `CompletionModel.cohere({ apiKey })` | Cohere |
228
+ | `CompletionModel.bedrock({ apiKey, region })` | AWS Bedrock |
229
+ | `CompletionModel.fal({ apiKey })` | fal.ai |
230
+
231
+ Omit the argument entirely to fall back to provider-specific environment variables (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `OPENROUTER_API_KEY`):
232
+
233
+ ```typescript
234
+ const model = CompletionModel.openai(); // reads OPENAI_API_KEY
235
+ ```
227
236
 
228
237
  ### Using LLMs Inside Workflows
229
238
 
230
239
  ```typescript
231
240
  import { Workflow, CompletionModel, ChatMessage } from "blazen";
232
241
 
233
- const model = CompletionModel.openai(process.env.OPENAI_API_KEY!);
242
+ const model = CompletionModel.openai({ apiKey: process.env.OPENAI_API_KEY! });
243
+ // or rely on the OPENAI_API_KEY env var: CompletionModel.openai();
234
244
 
235
245
  const wf = new Workflow("llm-workflow");
236
246
 
package/index.d.ts CHANGED
@@ -101,7 +101,7 @@ export type JsChatWindow = ChatWindow
101
101
  * Use the static factory methods to create an instance for your provider:
102
102
  *
103
103
  * ```javascript
104
- * const model = CompletionModel.openai("sk-...");
104
+ * const model = CompletionModel.openai({ apiKey: "sk-..." });
105
105
  * const response = await model.complete([
106
106
  * ChatMessage.user("What is 2 + 2?")
107
107
  * ]);
@@ -150,7 +150,7 @@ export declare class CompletionModel {
150
150
  * Wrap this model with automatic retry on transient failures.
151
151
  *
152
152
  * ```javascript
153
- * const model = CompletionModel.openrouter(key);
153
+ * const model = CompletionModel.openrouter({ apiKey: key });
154
154
  * const withRetry = model.withRetry({ maxRetries: 3, initialDelayMs: 1000 });
155
155
  * ```
156
156
  */
@@ -278,6 +278,43 @@ export declare class Context {
278
278
  getBytes(key: string): Promise<Buffer | null>
279
279
  /** Get the workflow run ID. */
280
280
  runId(): Promise<string>
281
+ /**
282
+ * Store an opaque, user-serialized payload in the session-ref
283
+ * registry under a fresh [`RegistryKey`].
284
+ *
285
+ * `typeName` is a stable identifier the caller chooses for this
286
+ * payload (e.g. `"app::EmbeddingHandle"`). The same name must be
287
+ * used on the resume side to recognise the payload — the type tag
288
+ * is captured into snapshot metadata along with the bytes when
289
+ * the workflow is paused under
290
+ * [`SessionPausePolicy::PickleOrSerialize`](blazen_core::session_ref::SessionPausePolicy).
291
+ *
292
+ * Returns the registry key as a string. JS callers can use this
293
+ * key with [`Self::get_session_ref_serializable`] inside the same
294
+ * run, or after a snapshot/resume cycle to retrieve the bytes
295
+ * they originally inserted.
296
+ *
297
+ * **Important.** Unlike the Python binding, the Node bindings do
298
+ * not currently auto-detect a `serialize()` method on JS objects.
299
+ * JS code must serialize the value itself (typically into a
300
+ * `Buffer`) before calling this method, and must deserialize the
301
+ * bytes returned by `getSessionRefSerializable` back into a
302
+ * runtime object in user code. This limitation is rooted in the
303
+ * `serde_json::Value`-based step bridge and is tracked separately
304
+ * from this method.
305
+ */
306
+ insertSessionRefSerializable(typeName: string, bytes: Buffer): Promise<string>
307
+ /**
308
+ * Retrieve a payload previously stored via
309
+ * [`Self::insert_session_ref_serializable`].
310
+ *
311
+ * Returns `null` if the registry has no entry under `key`, or if
312
+ * the entry exists but was inserted via the non-serializable
313
+ * path (`set` / `setBytes` / language-specific live refs).
314
+ * Otherwise returns `{ typeName, bytes }` matching the
315
+ * arguments the caller originally passed in.
316
+ */
317
+ getSessionRefSerializable(key: string): Promise<SerializableRefPayload | null>
281
318
  /**
282
319
  * Persistable workflow state. Survives `pause()` / `resume()`,
283
320
  * checkpoints, and durable storage.
@@ -307,7 +344,7 @@ export type JsContext = Context
307
344
  * Use the static factory methods to create an instance for your provider:
308
345
  *
309
346
  * ```javascript
310
- * const model = EmbeddingModel.openai("sk-...");
347
+ * const model = EmbeddingModel.openai({ apiKey: "sk-..." });
311
348
  * const response = await model.embed(["Hello", "World"]);
312
349
  * console.log(response.embeddings); // [[0.1, ...], [0.3, ...]]
313
350
  * ```
@@ -487,7 +524,7 @@ export type JsJsonlBackend = JsonlBackend
487
524
  * ```javascript
488
525
  * import { Memory, EmbeddingModel, InMemoryBackend } from 'blazen';
489
526
  *
490
- * const embedder = EmbeddingModel.openai(key);
527
+ * const embedder = EmbeddingModel.openai({ apiKey: key });
491
528
  * const memory = new Memory(embedder, new InMemoryBackend());
492
529
  *
493
530
  * await memory.add("doc1", "Paris is the capital of France");
@@ -739,6 +776,45 @@ export declare class StateNamespace {
739
776
  }
740
777
  export type JsStateNamespace = StateNamespace
741
778
 
779
+ /**
780
+ * An audio transcription provider.
781
+ *
782
+ * Use the static factory methods to create a transcriber for a specific
783
+ * backend, then call `transcribe` to convert audio to text.
784
+ *
785
+ * ```javascript
786
+ * // Local, offline transcription via whisper.cpp
787
+ * const transcriber = Transcription.whispercpp({ model: "base" });
788
+ * const result = await transcriber.transcribe({ audioUrl: "audio.wav" });
789
+ * console.log(result.text);
790
+ *
791
+ * // Remote transcription via fal.ai (requires API key)
792
+ * const transcriber = Transcription.fal();
793
+ * const result = await transcriber.transcribe({
794
+ * audioUrl: "https://example.com/audio.mp3",
795
+ * });
796
+ * ```
797
+ */
798
+ export declare class Transcription {
799
+ /**
800
+ * Create a fal.ai transcription provider.
801
+ *
802
+ * Requires a fal.ai API key via `options.apiKey` or the `FAL_KEY`
803
+ * environment variable. Supports remote audio URLs.
804
+ */
805
+ static fal(options?: JsFalOptions | undefined | null): Transcription
806
+ /** Get the provider identifier (e.g. `"fal"`, `"whispercpp"`). */
807
+ get providerId(): string
808
+ /**
809
+ * Transcribe an audio clip to text.
810
+ *
811
+ * For local backends like whisper.cpp, pass `audioUrl` as a local file
812
+ * path (whisper.cpp does not fetch remote URLs).
813
+ */
814
+ transcribe(request: JsTranscriptionRequest): Promise<JsTranscriptionResult>
815
+ }
816
+ export type JsTranscription = Transcription
817
+
742
818
  /**
743
819
  * A Valkey/Redis-backed backend for the memory store.
744
820
  *
@@ -776,6 +852,15 @@ export type JsValkeyBackend = ValkeyBackend
776
852
  export declare class Workflow {
777
853
  /** Create a new workflow with the given name. */
778
854
  constructor(name: string)
855
+ /**
856
+ * Configure how live session refs are treated when the workflow
857
+ * is paused or snapshotted.
858
+ *
859
+ * Defaults to `SessionPausePolicy.PickleOrError`. Set this to
860
+ * `SessionPausePolicy.PickleOrSerialize` to opt into the
861
+ * `insertSessionRefSerializable` round-trip path.
862
+ */
863
+ setSessionPausePolicy(policy: SessionPausePolicy): void
779
864
  /**
780
865
  * Add a step to the workflow.
781
866
  *
@@ -841,6 +926,35 @@ export declare class Workflow {
841
926
  * ```
842
927
  */
843
928
  resume(snapshotJson: string): Promise<WorkflowHandler>
929
+ /**
930
+ * Resume a workflow from a snapshot, rehydrating every
931
+ * `SessionPausePolicy.PickleOrSerialize` session-ref entry into
932
+ * the resumed registry under its original [`RegistryKey`].
933
+ *
934
+ * This is the resume-side counterpart of pausing a workflow whose
935
+ * `sessionPausePolicy` is set to `PickleOrSerialize`. The
936
+ * snapshot's `__blazen_serialized_session_refs` sidecar carries
937
+ * `(typeName, bytes)` records for every payload that was inserted
938
+ * via `ctx.insertSessionRefSerializable`. This method walks that
939
+ * sidecar, registers a no-op rehydrator for each unique type tag,
940
+ * and lets the core
941
+ * [`Workflow::resume_with_deserializers`](blazen_core::Workflow::resume_with_deserializers)
942
+ * path repopulate the registry. After this call, JS code can
943
+ * retrieve the original bytes via
944
+ * `ctx.getSessionRefSerializable(key)` and deserialize them
945
+ * itself.
946
+ *
947
+ * Snapshots that do **not** contain any serialized session refs
948
+ * work fine with the plain [`Self::resume`] entrypoint. Use this
949
+ * method only when you need the serializable rehydration path.
950
+ *
951
+ * ```javascript
952
+ * const snap = fs.readFileSync("snapshot.json", "utf-8");
953
+ * const handler = await workflow.resumeWithSerializableRefs(snap);
954
+ * const result = await handler.result();
955
+ * ```
956
+ */
957
+ resumeWithSerializableRefs(snapshotJson: string): Promise<WorkflowHandler>
844
958
  }
845
959
  export type JsWorkflow = Workflow
846
960
 
@@ -1611,7 +1725,7 @@ export interface PromptTemplateOptions {
1611
1725
  * ```typescript
1612
1726
  * import { CompletionModel, ChatMessage, runAgent } from 'blazen';
1613
1727
  *
1614
- * const model = CompletionModel.openai("sk-...");
1728
+ * const model = CompletionModel.openai({ apiKey: "sk-..." });
1615
1729
  *
1616
1730
  * const result = await runAgent(
1617
1731
  * model,
@@ -1627,5 +1741,62 @@ export interface PromptTemplateOptions {
1627
1741
  */
1628
1742
  export declare function runAgent(model: JsCompletionModel, messages: Array<JsChatMessage>, tools: Array<JsToolDef>, toolHandler: ToolHandlerTsfn, options?: JsAgentRunOptions | undefined | null): Promise<JsAgentResult>
1629
1743
 
1744
+ /**
1745
+ * Payload returned by [`JsContext::get_session_ref_serializable`].
1746
+ *
1747
+ * Carries the type-tag string the JS caller supplied at insertion
1748
+ * time alongside the raw bytes captured for that key. JS code is
1749
+ * responsible for reconstructing whatever runtime object the bytes
1750
+ * represent — see the module docs on
1751
+ * [`super::session_ref_serializable`] for the trade-off rationale.
1752
+ */
1753
+ export interface SerializableRefPayload {
1754
+ /**
1755
+ * Stable identifier the JS caller passed to
1756
+ * `insertSessionRefSerializable`.
1757
+ */
1758
+ typeName: string
1759
+ /**
1760
+ * Raw bytes the JS caller passed to
1761
+ * `insertSessionRefSerializable`. Returned as a `Buffer` so the
1762
+ * payload survives the napi boundary unchanged.
1763
+ */
1764
+ bytes: Buffer
1765
+ }
1766
+
1767
+ /**
1768
+ * Policy applied to live session references when a workflow is paused
1769
+ * or snapshotted.
1770
+ *
1771
+ * Mirrors the Rust-side
1772
+ * [`SessionPausePolicy`](blazen_core::session_ref::SessionPausePolicy)
1773
+ * enum and the Python `SessionPausePolicy` exposed by the pyo3
1774
+ * bindings. Configure it on a [`JsWorkflow`] via
1775
+ * [`JsWorkflow::set_session_pause_policy`] before calling
1776
+ * `run`/`runWithHandler`/`resume`.
1777
+ *
1778
+ * Variants:
1779
+ *
1780
+ * - `PickleOrError`: best-effort pickle each live ref; fail the pause
1781
+ * with a descriptive error if a ref cannot be captured. This is the
1782
+ * default.
1783
+ * - `PickleOrSerialize`: same as `PickleOrError` but additionally
1784
+ * honours the [`SessionRefSerializable`](blazen_core::session_ref::SessionRefSerializable)
1785
+ * protocol — values registered via
1786
+ * `ctx.insertSessionRefSerializable(typeName, bytes)` are captured
1787
+ * as opaque bytes in snapshot metadata and reconstructed on resume
1788
+ * via [`JsWorkflow::resume_with_serializable_refs`].
1789
+ * - `WarnDrop`: log a warning and drop each live ref. Downstream
1790
+ * `__blazen_session_ref__` markers carrying dropped UUIDs become
1791
+ * unresolved.
1792
+ * - `HardError`: fail the pause immediately if any live refs exist.
1793
+ */
1794
+ export declare const enum SessionPausePolicy {
1795
+ PickleOrError = 'PickleOrError',
1796
+ PickleOrSerialize = 'PickleOrSerialize',
1797
+ WarnDrop = 'WarnDrop',
1798
+ HardError = 'HardError'
1799
+ }
1800
+
1630
1801
  /** Returns the version of the blazen library. */
1631
1802
  export declare function version(): string
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('blazen-android-arm64')
79
79
  const bindingPackageVersion = require('blazen-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('blazen-android-arm-eabi')
95
95
  const bindingPackageVersion = require('blazen-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('blazen-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('blazen-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('blazen-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('blazen-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('blazen-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('blazen-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('blazen-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('blazen-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('blazen-darwin-universal')
184
184
  const bindingPackageVersion = require('blazen-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('blazen-darwin-x64')
200
200
  const bindingPackageVersion = require('blazen-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('blazen-darwin-arm64')
216
216
  const bindingPackageVersion = require('blazen-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('blazen-freebsd-x64')
236
236
  const bindingPackageVersion = require('blazen-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('blazen-freebsd-arm64')
252
252
  const bindingPackageVersion = require('blazen-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('blazen-linux-x64-musl')
273
273
  const bindingPackageVersion = require('blazen-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('blazen-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('blazen-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('blazen-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('blazen-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('blazen-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('blazen-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('blazen-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('blazen-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('blazen-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('blazen-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('blazen-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('blazen-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('blazen-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('blazen-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('blazen-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('blazen-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('blazen-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('blazen-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('blazen-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('blazen-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('blazen-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('blazen-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('blazen-openharmony-arm64')
478
478
  const bindingPackageVersion = require('blazen-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('blazen-openharmony-x64')
494
494
  const bindingPackageVersion = require('blazen-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('blazen-openharmony-arm')
510
510
  const bindingPackageVersion = require('blazen-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.1.125' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.1.125 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.1.126' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.1.126 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -604,6 +604,8 @@ module.exports.SessionNamespace = nativeBinding.SessionNamespace
604
604
  module.exports.JsSessionNamespace = nativeBinding.JsSessionNamespace
605
605
  module.exports.StateNamespace = nativeBinding.StateNamespace
606
606
  module.exports.JsStateNamespace = nativeBinding.JsStateNamespace
607
+ module.exports.Transcription = nativeBinding.Transcription
608
+ module.exports.JsTranscription = nativeBinding.JsTranscription
607
609
  module.exports.ValkeyBackend = nativeBinding.ValkeyBackend
608
610
  module.exports.JsValkeyBackend = nativeBinding.JsValkeyBackend
609
611
  module.exports.Workflow = nativeBinding.Workflow
@@ -617,4 +619,6 @@ module.exports.JsFalLlmEndpointKind = nativeBinding.JsFalLlmEndpointKind
617
619
  module.exports.JsJobStatus = nativeBinding.JsJobStatus
618
620
  module.exports.JsRole = nativeBinding.JsRole
619
621
  module.exports.runAgent = nativeBinding.runAgent
622
+ module.exports.SessionPausePolicy = nativeBinding.SessionPausePolicy
623
+ module.exports.JsSessionPausePolicy = nativeBinding.JsSessionPausePolicy
620
624
  module.exports.version = nativeBinding.version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blazen",
3
- "version": "0.1.125",
3
+ "version": "0.1.126",
4
4
  "description": "Blazen - Event-driven AI workflow framework for Node.js/TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",