blazen 0.1.120 → 0.1.122

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 +12 -5
  2. package/index.d.ts +95 -256
  3. package/index.js +53 -55
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -330,17 +330,19 @@ wf.addStep("work", ["blazen::StartEvent"], async (event, ctx) => {
330
330
  const handler = await wf.runWithHandler({ input: "data" });
331
331
 
332
332
  // Pause and serialize the snapshot
333
- const snapshot = await handler.pause();
333
+ handler.pause();
334
+ const snapshot = await handler.snapshot();
334
335
  writeFileSync("snapshot.json", snapshot);
335
336
 
336
337
  // Later: resume from the snapshot
337
338
  const saved = readFileSync("snapshot.json", "utf-8");
338
339
  const resumedHandler = await wf.resume(saved);
340
+ await resumedHandler.resumeInPlace();
339
341
  const result = await resumedHandler.result();
340
342
  console.log(result.data); // { answer: 42 }
341
343
  ```
342
344
 
343
- **Important:** `handler.result()` and `handler.pause()` each consume the handler. You can only call one of them, and only once.
345
+ **Note:** `pause()` is synchronous and non-consuming. Call `snapshot()` afterwards to get the serialized state, or `resumeInPlace()` to continue execution.
344
346
 
345
347
  > **Note:** Values stored via `ctx.session.set(...)` are **excluded** from snapshots. The workflow's `session_pause_policy` (default `pickle_or_error`; other policies: `warn_drop`, `hard_error`) governs what happens to session entries at pause time -- see the Rust docs for policy details. For anything that must survive pause/resume, use `ctx.state.set(...)` (or the legacy `ctx.set(...)` shortcut).
346
348
 
@@ -352,7 +354,8 @@ Pause/resume is the foundation for human-in-the-loop workflows. Pause after a st
352
354
  const handler = await wf.runWithHandler({ document: rawText });
353
355
 
354
356
  // Pause and persist until a human reviews
355
- const snapshot = await handler.pause();
357
+ handler.pause();
358
+ const snapshot = await handler.snapshot();
356
359
  await db.saveSnapshot(jobId, snapshot);
357
360
 
358
361
  // ... human reviews via UI ...
@@ -370,7 +373,7 @@ Use `handler.streamEvents()` to subscribe to intermediate events before calling
370
373
  ```typescript
371
374
  const handler = await wf.runWithHandler({ prompt: "Tell me a story." });
372
375
 
373
- // Subscribe to stream events (must be called before result() or pause())
376
+ // Subscribe to stream events (must be called before result())
374
377
  await handler.streamEvents((event) => {
375
378
  console.log("[stream]", event);
376
379
  });
@@ -493,7 +496,11 @@ import type {
493
496
  | `Workflow.setTimeout(seconds)` | Set workflow timeout in seconds |
494
497
  | `WorkflowHandler` | Control handle for a running workflow |
495
498
  | `WorkflowHandler.result()` | Await the final workflow result |
496
- | `WorkflowHandler.pause()` | Pause and get a serialized snapshot string |
499
+ | `WorkflowHandler.pause()` | Signal the workflow to pause (synchronous) |
500
+ | `WorkflowHandler.snapshot()` | Get the serialized workflow state after pausing |
501
+ | `WorkflowHandler.resumeInPlace()` | Resume a paused workflow in-place |
502
+ | `WorkflowHandler.respondToInput(requestId, response)` | Supply a response to a pending input request |
503
+ | `WorkflowHandler.abort()` | Abort the running workflow |
497
504
  | `WorkflowHandler.streamEvents(callback)` | Subscribe to intermediate stream events |
498
505
  | `Context` | Per-run shared state, event routing, and stream output |
499
506
  | `Context.set(key, value)` | Store a JSON-serializable value (async) |
package/index.d.ts CHANGED
@@ -52,13 +52,13 @@ export type JsChatMessage = ChatMessage
52
52
  */
53
53
  export declare class CompletionModel {
54
54
  /** Create an `OpenAI` completion model. */
55
- static openai(apiKey: string, model?: string | undefined | null): CompletionModel
55
+ static openai(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
56
56
  /** Create an Anthropic completion model. */
57
- static anthropic(apiKey: string, model?: string | undefined | null): CompletionModel
57
+ static anthropic(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
58
58
  /** Create a Google Gemini completion model. */
59
- static gemini(apiKey: string, model?: string | undefined | null): CompletionModel
59
+ static gemini(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
60
60
  /** Create an Azure `OpenAI` completion model. */
61
- static azure(apiKey: string, resourceName: string, deploymentName: string): CompletionModel
61
+ static azure(apiKey: string, options: JsAzureOptions): CompletionModel
62
62
  /**
63
63
  * Create a fal.ai completion model.
64
64
  *
@@ -68,25 +68,25 @@ export declare class CompletionModel {
68
68
  */
69
69
  static fal(apiKey: string, options?: JsFalOptions | undefined | null): CompletionModel
70
70
  /** Create an `OpenRouter` completion model. */
71
- static openrouter(apiKey: string, model?: string | undefined | null): CompletionModel
71
+ static openrouter(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
72
72
  /** Create a Groq completion model. */
73
- static groq(apiKey: string, model?: string | undefined | null): CompletionModel
73
+ static groq(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
74
74
  /** Create a Together AI completion model. */
75
- static together(apiKey: string, model?: string | undefined | null): CompletionModel
75
+ static together(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
76
76
  /** Create a Mistral AI completion model. */
77
- static mistral(apiKey: string, model?: string | undefined | null): CompletionModel
77
+ static mistral(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
78
78
  /** Create a `DeepSeek` completion model. */
79
- static deepseek(apiKey: string, model?: string | undefined | null): CompletionModel
79
+ static deepseek(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
80
80
  /** Create a Fireworks AI completion model. */
81
- static fireworks(apiKey: string, model?: string | undefined | null): CompletionModel
81
+ static fireworks(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
82
82
  /** Create a Perplexity completion model. */
83
- static perplexity(apiKey: string, model?: string | undefined | null): CompletionModel
83
+ static perplexity(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
84
84
  /** Create an xAI (Grok) completion model. */
85
- static xai(apiKey: string, model?: string | undefined | null): CompletionModel
85
+ static xai(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
86
86
  /** Create a Cohere completion model. */
87
- static cohere(apiKey: string, model?: string | undefined | null): CompletionModel
87
+ static cohere(apiKey: string, options?: JsProviderOptions | undefined | null): CompletionModel
88
88
  /** Create an AWS Bedrock completion model. */
89
- static bedrock(apiKey: string, region: string, model?: string | undefined | null): CompletionModel
89
+ static bedrock(apiKey: string, options: JsBedrockOptions): CompletionModel
90
90
  /** Get the model ID. */
91
91
  get modelId(): string
92
92
  /**
@@ -685,13 +685,19 @@ export type JsWorkflow = Workflow
685
685
  *
686
686
  * Returned by `Workflow.runWithHandler()`. Provides methods to:
687
687
  *
688
- * - **`result()`** -- await the final workflow result.
689
- * - **`pause()`** -- pause the workflow and get a snapshot JSON string.
688
+ * - **`result()`** -- await the final workflow result (consumes the handler).
689
+ * - **`pause()`** -- signal the workflow to pause.
690
+ * - **`snapshot()`** -- get a serializable snapshot as a JSON string.
691
+ * - **`resumeInPlace()`** -- resume a paused workflow without creating a new one.
692
+ * - **`respondToInput(requestId, response)`** -- respond to an input request.
693
+ * - **`abort()`** -- abort the running workflow.
690
694
  * - **`streamEvents(callback)`** -- subscribe to intermediate events
691
695
  * published via `ctx.writeEventToStream()`.
692
696
  *
693
- * **Important:** `result()` and `pause()` each consume the handler
694
- * internally. You can only call one of them, and only once.
697
+ * **Important:** `result()` consumes the handler internally. You can only
698
+ * call it once. The other control methods (`pause`, `resumeInPlace`,
699
+ * `abort`, `respondToInput`, `snapshot`) borrow the handler and can be
700
+ * called multiple times.
695
701
  *
696
702
  * ```javascript
697
703
  * const handler = await workflow.runWithHandler({ message: "hello" });
@@ -699,9 +705,12 @@ export type JsWorkflow = Workflow
699
705
  * // Option A: just get the result
700
706
  * const result = await handler.result();
701
707
  *
702
- * // Option B: pause and get a snapshot
703
- * const snapshot = await handler.pause();
704
- * fs.writeFileSync("snapshot.json", snapshot);
708
+ * // Option B: pause, snapshot, then resume
709
+ * await handler.pause();
710
+ * const snap = await handler.snapshot();
711
+ * fs.writeFileSync("snapshot.json", snap);
712
+ * await handler.resumeInPlace();
713
+ * const result = await handler.result();
705
714
  *
706
715
  * // Option C: stream events, then get the result
707
716
  * handler.streamEvents((event) => console.log(event));
@@ -715,19 +724,34 @@ export declare class WorkflowHandler {
715
724
  * Returns the result when the workflow completes via a `StopEvent`.
716
725
  *
717
726
  * This method consumes the handler internally -- it can only be called
718
- * once, and cannot be called after `pause()`.
727
+ * once.
719
728
  */
720
729
  result(): Promise<JsWorkflowResult>
721
730
  /**
722
- * Pause the running workflow and return a snapshot as a JSON string.
731
+ * Signal the running workflow to pause.
732
+ *
733
+ * After pausing, use `snapshot()` to get a serializable snapshot, or
734
+ * `resumeInPlace()` to continue execution.
735
+ */
736
+ pause(): Promise<void>
737
+ /** Resume a paused workflow in place without creating a new handler. */
738
+ resumeInPlace(): Promise<void>
739
+ /**
740
+ * Get a serializable snapshot of the workflow as a JSON string.
723
741
  *
724
742
  * The snapshot contains all workflow state and can be saved to a file
725
743
  * or database. Use `Workflow.resume(snapshotJson)` to resume later.
744
+ */
745
+ snapshot(): Promise<string>
746
+ /**
747
+ * Respond to an input request from a paused workflow.
726
748
  *
727
- * This method consumes the handler internally -- it can only be called
728
- * once, and cannot be called after `result()`.
749
+ * The `request_id` must match the `InputRequestEvent.request_id` that
750
+ * was published by the workflow step.
729
751
  */
730
- pause(): Promise<string>
752
+ respondToInput(requestId: string, response: any): Promise<void>
753
+ /** Abort the running workflow. */
754
+ abort(): Promise<void>
731
755
  /**
732
756
  * Subscribe to intermediate events published by steps via
733
757
  * `ctx.writeEventToStream()`.
@@ -783,29 +807,6 @@ export declare function countMessageTokens(messages: Array<ChatMessage>, context
783
807
  */
784
808
  export declare function estimateTokens(text: string, contextSize?: number | undefined | null): number
785
809
 
786
- /**
787
- * The fal.ai LLM endpoint family.
788
- *
789
- * Selects which fal LLM URL/body schema to use. Defaults to `OpenAiChat`
790
- * (the OpenAI-compatible chat-completions surface on fal).
791
- */
792
- export declare const enum FalLlmEndpoint {
793
- /** OpenAI-compatible chat-completions endpoint (default). */
794
- OpenAiChat = 'openai_chat',
795
- /** OpenAI-compatible Responses endpoint. */
796
- OpenAiResponses = 'openai_responses',
797
- /** OpenAI-compatible embeddings endpoint. */
798
- OpenAiEmbeddings = 'openai_embeddings',
799
- /** `OpenRouter` proxy via fal. */
800
- OpenRouter = 'openrouter',
801
- /** `OpenRouter` proxy via fal (enterprise/SOC2 tier). */
802
- OpenRouterEnterprise = 'openrouter_enterprise',
803
- /** fal-ai/any-llm proxy. */
804
- AnyLlm = 'any_llm',
805
- /** fal-ai/any-llm proxy (enterprise/SOC2 tier). */
806
- AnyLlmEnterprise = 'any_llm_enterprise'
807
- }
808
-
809
810
  /** An entry to add to the memory store (used by `addMany`). */
810
811
  export interface JsAddEntry {
811
812
  /** Unique identifier. If empty, one will be generated. */
@@ -900,18 +901,33 @@ export interface JsAudioContent {
900
901
  durationSeconds?: number
901
902
  }
902
903
 
903
- /** Result of an audio generation or TTS operation. */
904
904
  export interface JsAudioResult {
905
- /** The generated audio clips. */
906
905
  audio: Array<JsGeneratedAudio>
907
- /** Request timing breakdown. */
908
- timing?: JsComputeTiming
909
- /** Cost in USD, if reported by the provider. */
906
+ timing: JsRequestTiming
910
907
  cost?: number
911
- /** Arbitrary provider-specific metadata. */
912
908
  metadata: any
913
909
  }
914
910
 
911
+ export interface JsAzureOptions {
912
+ model?: string
913
+ baseUrl?: string
914
+ resourceName: string
915
+ deploymentName: string
916
+ apiVersion?: string
917
+ }
918
+
919
+ export interface JsBackgroundRemovalRequest {
920
+ imageUrl: string
921
+ model?: string
922
+ parameters?: any
923
+ }
924
+
925
+ export interface JsBedrockOptions {
926
+ model?: string
927
+ baseUrl?: string
928
+ region: string
929
+ }
930
+
915
931
  /** Configuration for the `withCache` decorator. */
916
932
  export interface JsCacheConfig {
917
933
  /** How long a cached response remains valid, in seconds. */
@@ -972,40 +988,20 @@ export interface JsCompletionResponse {
972
988
  metadata: any
973
989
  }
974
990
 
975
- /** Input for a generic compute job. */
976
991
  export interface JsComputeRequest {
977
- /** The model/endpoint to run (e.g., "fal-ai/flux/dev"). */
978
992
  model: string
979
- /** Input parameters as JSON (model-specific). */
980
993
  input: any
981
- /** Optional webhook URL for async completion notification. */
982
994
  webhook?: string
983
995
  }
984
996
 
985
- /** Result of a completed compute job. */
986
997
  export interface JsComputeResult {
987
- /** The job handle that produced this result, if available. */
988
998
  job?: JsJobHandle
989
- /** Output data (model-specific JSON). */
990
999
  output: any
991
- /** Request timing breakdown. */
992
- timing?: JsComputeTiming
993
- /** Cost in USD, if reported by the provider. */
1000
+ timing: JsRequestTiming
994
1001
  cost?: number
995
- /** Raw provider-specific metadata. */
996
1002
  metadata: any
997
1003
  }
998
1004
 
999
- /** Timing breakdown for a compute request. */
1000
- export interface JsComputeTiming {
1001
- /** Time spent waiting in queue, in milliseconds. */
1002
- queueMs?: number
1003
- /** Time spent executing, in milliseconds. */
1004
- executionMs?: number
1005
- /** Total wall-clock time, in milliseconds. */
1006
- totalMs?: number
1007
- }
1008
-
1009
1005
  /**
1010
1006
  * A single part in a multi-part message.
1011
1007
  *
@@ -1036,29 +1032,19 @@ export interface JsEmbeddingResponse {
1036
1032
  metadata: any
1037
1033
  }
1038
1034
 
1039
- /**
1040
- * Configuration options for [`JsFalProvider`].
1041
- *
1042
- * ```typescript
1043
- * const fal = FalProvider.create("fal-key-...", {
1044
- * model: "anthropic/claude-sonnet-4.5",
1045
- * endpoint: "openai_chat",
1046
- * enterprise: false,
1047
- * autoRouteModality: true,
1048
- * });
1049
- * ```
1050
- */
1035
+ export declare const enum JsFalLlmEndpointKind {
1036
+ OpenAiChat = 'open_ai_chat',
1037
+ OpenAiResponses = 'open_ai_responses',
1038
+ OpenAiEmbeddings = 'open_ai_embeddings',
1039
+ OpenRouter = 'open_router',
1040
+ AnyLlm = 'any_llm'
1041
+ }
1042
+
1051
1043
  export interface JsFalOptions {
1052
- /** Underlying LLM model name (e.g. `"anthropic/claude-sonnet-4.5"`). */
1053
1044
  model?: string
1054
- /** The fal endpoint family to target. Defaults to `OpenAiChat`. */
1055
- endpoint?: FalLlmEndpoint
1056
- /** Promote the endpoint to its enterprise / SOC2-eligible variant. */
1045
+ baseUrl?: string
1046
+ endpoint?: JsFalLlmEndpointKind
1057
1047
  enterprise?: boolean
1058
- /**
1059
- * Auto-route the request to the matching vision/audio/video variant
1060
- * when the message content contains media. Defaults to `true`.
1061
- */
1062
1048
  autoRouteModality?: boolean
1063
1049
  }
1064
1050
 
@@ -1086,53 +1072,32 @@ export interface JsFinishReason {
1086
1072
  value: string
1087
1073
  }
1088
1074
 
1089
- /** A single generated 3D model with optional mesh metadata. */
1090
1075
  export interface JsGenerated3DModel {
1091
- /** The 3D model media output. */
1092
1076
  media: JsMediaOutput
1093
- /** Total vertex count, if known. */
1094
1077
  vertexCount?: number
1095
- /** Total face/triangle count, if known. */
1096
1078
  faceCount?: number
1097
- /** Whether the model includes texture data. */
1098
1079
  hasTextures: boolean
1099
- /** Whether the model includes animation data. */
1100
1080
  hasAnimations: boolean
1101
1081
  }
1102
1082
 
1103
- /** A single generated audio clip with optional metadata. */
1104
1083
  export interface JsGeneratedAudio {
1105
- /** The audio media output. */
1106
1084
  media: JsMediaOutput
1107
- /** Duration in seconds, if known. */
1108
1085
  durationSeconds?: number
1109
- /** Sample rate in Hz, if known. */
1110
1086
  sampleRate?: number
1111
- /** Number of audio channels, if known. */
1112
1087
  channels?: number
1113
1088
  }
1114
1089
 
1115
- /** A single generated image with optional dimension metadata. */
1116
1090
  export interface JsGeneratedImage {
1117
- /** The image media output. */
1118
1091
  media: JsMediaOutput
1119
- /** Image width in pixels, if known. */
1120
1092
  width?: number
1121
- /** Image height in pixels, if known. */
1122
1093
  height?: number
1123
1094
  }
1124
1095
 
1125
- /** A single generated video with optional metadata. */
1126
1096
  export interface JsGeneratedVideo {
1127
- /** The video media output. */
1128
1097
  media: JsMediaOutput
1129
- /** Video width in pixels, if known. */
1130
1098
  width?: number
1131
- /** Video height in pixels, if known. */
1132
1099
  height?: number
1133
- /** Duration in seconds, if known. */
1134
1100
  durationSeconds?: number
1135
- /** Frames per second, if known. */
1136
1101
  fps?: number
1137
1102
  }
1138
1103
 
@@ -1142,33 +1107,20 @@ export interface JsImageContent {
1142
1107
  mediaType?: string
1143
1108
  }
1144
1109
 
1145
- /** Request to generate images from a text prompt. */
1146
1110
  export interface JsImageRequest {
1147
- /** The text prompt describing the desired image. */
1148
1111
  prompt: string
1149
- /** Negative prompt (things to avoid in the image). */
1150
1112
  negativePrompt?: string
1151
- /** Desired image width in pixels. */
1152
1113
  width?: number
1153
- /** Desired image height in pixels. */
1154
1114
  height?: number
1155
- /** Number of images to generate. */
1156
1115
  numImages?: number
1157
- /** Model override (provider-specific model identifier). */
1158
1116
  model?: string
1159
- /** Additional provider-specific parameters. */
1160
1117
  parameters?: any
1161
1118
  }
1162
1119
 
1163
- /** Result of an image generation or upscale operation. */
1164
1120
  export interface JsImageResult {
1165
- /** The generated or upscaled images. */
1166
1121
  images: Array<JsGeneratedImage>
1167
- /** Request timing breakdown. */
1168
- timing?: JsComputeTiming
1169
- /** Cost in USD, if reported by the provider. */
1122
+ timing: JsRequestTiming
1170
1123
  cost?: number
1171
- /** Arbitrary provider-specific metadata. */
1172
1124
  metadata: any
1173
1125
  }
1174
1126
 
@@ -1179,15 +1131,10 @@ export interface JsImageSource {
1179
1131
  data?: string
1180
1132
  }
1181
1133
 
1182
- /** A handle to a submitted compute job. */
1183
1134
  export interface JsJobHandle {
1184
- /** Provider-assigned job/request identifier. */
1185
1135
  id: string
1186
- /** Provider name (e.g., "fal", "replicate", "runpod"). */
1187
1136
  provider: string
1188
- /** The model/endpoint that was invoked. */
1189
1137
  model: string
1190
- /** When the job was submitted (ISO 8601). */
1191
1138
  submittedAt: string
1192
1139
  }
1193
1140
 
@@ -1205,54 +1152,15 @@ export declare const enum JsJobStatus {
1205
1152
  Cancelled = 'cancelled'
1206
1153
  }
1207
1154
 
1208
- /** A single piece of generated media content. */
1209
1155
  export interface JsMediaOutput {
1210
- /** URL where the media can be downloaded. */
1211
1156
  url?: string
1212
- /** Base64-encoded media data. */
1213
1157
  base64?: string
1214
- /** Raw text content for text-based formats (SVG, OBJ, GLTF JSON). */
1215
1158
  rawContent?: string
1216
- /** The MIME type of the media (e.g. "image/png", "video/mp4"). */
1217
1159
  mediaType: string
1218
- /** File size in bytes, if known. */
1219
1160
  fileSize?: number
1220
- /** Arbitrary provider-specific metadata. */
1221
1161
  metadata: any
1222
1162
  }
1223
1163
 
1224
- /** Map of friendly format names to their MIME type strings. */
1225
- export interface JsMediaTypeMap {
1226
- png: string
1227
- jpeg: string
1228
- webp: string
1229
- gif: string
1230
- svg: string
1231
- bmp: string
1232
- tiff: string
1233
- avif: string
1234
- ico: string
1235
- mp4: string
1236
- webm: string
1237
- mov: string
1238
- avi: string
1239
- mkv: string
1240
- mp3: string
1241
- wav: string
1242
- ogg: string
1243
- flac: string
1244
- aac: string
1245
- m4A: string
1246
- glb: string
1247
- gltf: string
1248
- obj: string
1249
- fbx: string
1250
- usdz: string
1251
- stl: string
1252
- ply: string
1253
- pdf: string
1254
- }
1255
-
1256
1164
  /** A stored entry retrieved from the memory store. */
1257
1165
  export interface JsMemoryEntry {
1258
1166
  /** The entry id. */
@@ -1275,18 +1183,18 @@ export interface JsMemoryResult {
1275
1183
  metadata: any
1276
1184
  }
1277
1185
 
1278
- /** Request to generate music or sound effects. */
1279
1186
  export interface JsMusicRequest {
1280
- /** Text prompt describing the desired audio. */
1281
1187
  prompt: string
1282
- /** Desired duration in seconds. */
1283
1188
  durationSeconds?: number
1284
- /** Model override. */
1285
1189
  model?: string
1286
- /** Additional provider-specific parameters. */
1287
1190
  parameters?: any
1288
1191
  }
1289
1192
 
1193
+ export interface JsProviderOptions {
1194
+ model?: string
1195
+ baseUrl?: string
1196
+ }
1197
+
1290
1198
  /**
1291
1199
  * Chain-of-thought / extended-thinking trace from a model that exposes one.
1292
1200
  *
@@ -1307,7 +1215,6 @@ export interface JsReasoningTrace {
1307
1215
  effort?: string
1308
1216
  }
1309
1217
 
1310
- /** Timing metadata for a completion request. */
1311
1218
  export interface JsRequestTiming {
1312
1219
  queueMs?: number
1313
1220
  executionMs?: number
@@ -1350,21 +1257,13 @@ export declare const enum JsRole {
1350
1257
  Tool = 'tool'
1351
1258
  }
1352
1259
 
1353
- /** Request to generate speech from text (TTS). */
1354
1260
  export interface JsSpeechRequest {
1355
- /** The text to synthesize into speech. */
1356
1261
  text: string
1357
- /** Voice identifier (provider-specific). */
1358
1262
  voice?: string
1359
- /** URL to a reference voice sample for voice cloning. */
1360
1263
  voiceUrl?: string
1361
- /** Language code (e.g. "en", "fr", "ja"). */
1362
1264
  language?: string
1363
- /** Speech speed multiplier (1.0 = normal). */
1364
1265
  speed?: number
1365
- /** Model override. */
1366
1266
  model?: string
1367
- /** Additional provider-specific parameters. */
1368
1267
  parameters?: any
1369
1268
  }
1370
1269
 
@@ -1404,40 +1303,31 @@ export interface JsStreamChunk {
1404
1303
  artifacts: Array<JsArtifact>
1405
1304
  }
1406
1305
 
1407
- /** Request to generate a 3D model. */
1408
1306
  export interface JsThreeDRequest {
1409
- /** Text prompt describing the desired 3D model. */
1410
1307
  prompt?: string
1411
- /** Source image URL for image-to-3D generation. */
1412
1308
  imageUrl?: string
1413
- /** Desired output format (e.g. "glb", "obj", "usdz"). */
1414
1309
  format?: string
1415
- /** Model override. */
1416
1310
  model?: string
1417
- /** Additional provider-specific parameters. */
1418
1311
  parameters?: any
1419
1312
  }
1420
1313
 
1421
- /** Result of a 3D model generation operation. */
1422
1314
  export interface JsThreeDResult {
1423
- /** The generated 3D models. */
1424
1315
  models: Array<JsGenerated3DModel>
1425
- /** Request timing breakdown. */
1426
- timing?: JsComputeTiming
1427
- /** Cost in USD, if reported by the provider. */
1316
+ timing: JsRequestTiming
1428
1317
  cost?: number
1429
- /** Arbitrary provider-specific metadata. */
1430
1318
  metadata: any
1431
1319
  }
1432
1320
 
1433
- /** Token usage statistics for a completion request. */
1434
1321
  export interface JsTokenUsage {
1435
1322
  promptTokens: number
1436
1323
  completionTokens: number
1437
1324
  totalTokens: number
1325
+ reasoningTokens?: number
1326
+ cachedInputTokens?: number
1327
+ audioInputTokens?: number
1328
+ audioOutputTokens?: number
1438
1329
  }
1439
1330
 
1440
- /** A tool invocation requested by the model. */
1441
1331
  export interface JsToolCall {
1442
1332
  id: string
1443
1333
  name: string
@@ -1454,64 +1344,40 @@ export interface JsToolDef {
1454
1344
  parameters: any
1455
1345
  }
1456
1346
 
1457
- /** Describes a tool that the model may invoke during a conversation. */
1458
1347
  export interface JsToolDefinition {
1459
1348
  name: string
1460
1349
  description: string
1461
1350
  parameters: any
1462
1351
  }
1463
1352
 
1464
- /** Request to transcribe audio to text. */
1465
1353
  export interface JsTranscriptionRequest {
1466
- /** URL of the audio file to transcribe. */
1467
1354
  audioUrl: string
1468
- /** Language hint (e.g. "en", "fr"). */
1469
1355
  language?: string
1470
- /** Whether to perform speaker diarization. */
1471
1356
  diarize?: boolean
1472
- /** Model override. */
1473
1357
  model?: string
1474
- /** Additional provider-specific parameters. */
1475
1358
  parameters?: any
1476
1359
  }
1477
1360
 
1478
- /** Result of a transcription operation. */
1479
1361
  export interface JsTranscriptionResult {
1480
- /** The full transcribed text. */
1481
1362
  text: string
1482
- /** Time-aligned segments, if available. */
1483
1363
  segments: Array<JsTranscriptionSegment>
1484
- /** Detected or specified language code (e.g. "en", "fr"). */
1485
1364
  language?: string
1486
- /** Request timing breakdown. */
1487
- timing?: JsComputeTiming
1488
- /** Cost in USD, if reported by the provider. */
1365
+ timing: JsRequestTiming
1489
1366
  cost?: number
1490
- /** Arbitrary provider-specific metadata. */
1491
1367
  metadata: any
1492
1368
  }
1493
1369
 
1494
- /** A single segment within a transcription. */
1495
1370
  export interface JsTranscriptionSegment {
1496
- /** The transcribed text for this segment. */
1497
1371
  text: string
1498
- /** Start time in seconds. */
1499
1372
  start: number
1500
- /** End time in seconds. */
1501
1373
  end: number
1502
- /** Speaker label, if diarization was enabled. */
1503
1374
  speaker?: string
1504
1375
  }
1505
1376
 
1506
- /** Request to upscale an image. */
1507
1377
  export interface JsUpscaleRequest {
1508
- /** URL of the image to upscale. */
1509
1378
  imageUrl: string
1510
- /** Scale factor (e.g., 2.0 for 2x, 4.0 for 4x). */
1511
1379
  scale: number
1512
- /** Model override. */
1513
1380
  model?: string
1514
- /** Additional provider-specific parameters. */
1515
1381
  parameters?: any
1516
1382
  }
1517
1383
 
@@ -1522,35 +1388,21 @@ export interface JsVideoContent {
1522
1388
  durationSeconds?: number
1523
1389
  }
1524
1390
 
1525
- /** Request to generate a video. */
1526
1391
  export interface JsVideoRequest {
1527
- /** Text prompt describing the desired video. */
1528
1392
  prompt: string
1529
- /** Source image URL for image-to-video generation. */
1530
1393
  imageUrl?: string
1531
- /** Desired duration in seconds. */
1532
1394
  durationSeconds?: number
1533
- /** Negative prompt (things to avoid). */
1534
1395
  negativePrompt?: string
1535
- /** Desired video width in pixels. */
1536
1396
  width?: number
1537
- /** Desired video height in pixels. */
1538
1397
  height?: number
1539
- /** Model override. */
1540
1398
  model?: string
1541
- /** Additional provider-specific parameters. */
1542
1399
  parameters?: any
1543
1400
  }
1544
1401
 
1545
- /** Result of a video generation operation. */
1546
1402
  export interface JsVideoResult {
1547
- /** The generated videos. */
1548
1403
  videos: Array<JsGeneratedVideo>
1549
- /** Request timing breakdown. */
1550
- timing?: JsComputeTiming
1551
- /** Cost in USD, if reported by the provider. */
1404
+ timing: JsRequestTiming
1552
1405
  cost?: number
1553
- /** Arbitrary provider-specific metadata. */
1554
1406
  metadata: any
1555
1407
  }
1556
1408
 
@@ -1562,19 +1414,6 @@ export interface JsWorkflowResult {
1562
1414
  data: any
1563
1415
  }
1564
1416
 
1565
- /**
1566
- * Returns an object mapping friendly names to MIME type strings.
1567
- *
1568
- * ```typescript
1569
- * import { mediaTypes } from 'blazen';
1570
- *
1571
- * const types = mediaTypes();
1572
- * console.log(types.png); // "image/png"
1573
- * console.log(types.mp4); // "video/mp4"
1574
- * ```
1575
- */
1576
- export declare function mediaTypes(): JsMediaTypeMap
1577
-
1578
1417
  /**
1579
1418
  * Run an agentic tool execution loop.
1580
1419
  *
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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.1.122' && 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.122 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.120' && 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.120 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.1.122' && 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.122 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -606,10 +606,8 @@ module.exports.WorkflowHandler = nativeBinding.WorkflowHandler
606
606
  module.exports.JsWorkflowHandler = nativeBinding.JsWorkflowHandler
607
607
  module.exports.countMessageTokens = nativeBinding.countMessageTokens
608
608
  module.exports.estimateTokens = nativeBinding.estimateTokens
609
- module.exports.FalLlmEndpoint = nativeBinding.FalLlmEndpoint
610
- module.exports.JsFalLlmEndpoint = nativeBinding.JsFalLlmEndpoint
609
+ module.exports.JsFalLlmEndpointKind = nativeBinding.JsFalLlmEndpointKind
611
610
  module.exports.JsJobStatus = nativeBinding.JsJobStatus
612
611
  module.exports.JsRole = nativeBinding.JsRole
613
- module.exports.mediaTypes = nativeBinding.mediaTypes
614
612
  module.exports.runAgent = nativeBinding.runAgent
615
613
  module.exports.version = nativeBinding.version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blazen",
3
- "version": "0.1.120",
3
+ "version": "0.1.122",
4
4
  "description": "Blazen - Event-driven AI workflow framework for Node.js/TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",