blazen 0.1.122 → 0.1.124

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 (3) hide show
  1. package/index.d.ts +212 -33
  2. package/index.js +59 -52
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -38,6 +38,63 @@ export declare class ChatMessage {
38
38
  }
39
39
  export type JsChatMessage = ChatMessage
40
40
 
41
+ /**
42
+ * A token-windowed conversation memory.
43
+ *
44
+ * Holds a sequence of `ChatMessage` objects and automatically evicts the
45
+ * oldest messages (preserving system messages) when the token count exceeds
46
+ * the configured budget.
47
+ *
48
+ * ```javascript
49
+ * const window = new ChatWindow(4096);
50
+ * window.add(ChatMessage.system("You are helpful."));
51
+ * window.add(ChatMessage.user("Hello!"));
52
+ * console.log(window.tokenCount());
53
+ * console.log(window.remainingTokens());
54
+ * ```
55
+ */
56
+ export declare class ChatWindow {
57
+ /**
58
+ * Create a new chat window with the given token budget.
59
+ *
60
+ * @param maxTokens - The maximum number of tokens to allow in the window.
61
+ */
62
+ constructor(maxTokens: number)
63
+ /**
64
+ * Append a message to the window.
65
+ *
66
+ * If the token count exceeds the budget after adding the message,
67
+ * the oldest non-system messages are evicted until within budget.
68
+ * System messages are never evicted.
69
+ *
70
+ * @param message - A `ChatMessage` to add.
71
+ */
72
+ add(message: JsChatMessage): void
73
+ /**
74
+ * Get the current messages in the window.
75
+ *
76
+ * @returns An array of `ChatMessage` objects.
77
+ */
78
+ messages(): Array<JsChatMessage>
79
+ /** Remove all messages from the window. */
80
+ clear(): void
81
+ /**
82
+ * Estimate the total token count of all messages in the window.
83
+ *
84
+ * @returns The estimated number of tokens.
85
+ */
86
+ tokenCount(): number
87
+ /**
88
+ * Return the number of tokens remaining before the budget is reached.
89
+ *
90
+ * @returns The number of tokens remaining (0 if already at or over budget).
91
+ */
92
+ remainingTokens(): number
93
+ /** Return the number of messages in the window. */
94
+ get length(): number
95
+ }
96
+ export type JsChatWindow = ChatWindow
97
+
41
98
  /**
42
99
  * A chat completion model.
43
100
  *
@@ -339,49 +396,44 @@ export declare class FalProvider {
339
396
  /** Get the model ID. */
340
397
  get modelId(): string
341
398
  /** Generate images from a text prompt. */
342
- generateImage(request: JsImageRequest): Promise<any>
399
+ generateImage(request: JsImageRequest): Promise<JsImageResult>
343
400
  /** Upscale an image. */
344
- upscaleImage(request: JsUpscaleRequest): Promise<any>
401
+ upscaleImage(request: JsUpscaleRequest): Promise<JsImageResult>
345
402
  /** Upscale an image via the aura-sr model. */
346
- upscaleImageAura(request: JsUpscaleRequest): Promise<any>
403
+ upscaleImageAura(request: JsUpscaleRequest): Promise<JsImageResult>
347
404
  /** Upscale an image via the clarity-upscaler model. */
348
- upscaleImageClarity(request: JsUpscaleRequest): Promise<any>
405
+ upscaleImageClarity(request: JsUpscaleRequest): Promise<JsImageResult>
349
406
  /** Upscale an image via the creative-upscaler model. */
350
- upscaleImageCreative(request: JsUpscaleRequest): Promise<any>
351
- /**
352
- * Remove the background from an image.
353
- *
354
- * `imageUrl` is the URL of the source image. `model` optionally
355
- * overrides the model id.
356
- */
357
- removeBackground(imageUrl: string, model?: string | undefined | null): Promise<any>
407
+ upscaleImageCreative(request: JsUpscaleRequest): Promise<JsImageResult>
408
+ /** Remove the background from an image. */
409
+ removeBackground(request: JsBackgroundRemovalRequest): Promise<JsImageResult>
358
410
  /** Generate a 3D model from a text prompt or source image. */
359
- generate3d(request: JsThreeDRequest): Promise<any>
411
+ generate3d(request: JsThreeDRequest): Promise<JsThreeDResult>
360
412
  /**
361
413
  * Build a [`JsFalEmbeddingModel`] sharing this provider's HTTP client
362
414
  * and API key.
363
415
  */
364
416
  embeddingModel(): JsFalEmbeddingModel
365
417
  /** Generate a video from a text prompt. */
366
- textToVideo(request: JsVideoRequest): Promise<any>
418
+ textToVideo(request: JsVideoRequest): Promise<JsVideoResult>
367
419
  /** Generate a video from a source image and prompt. */
368
- imageToVideo(request: JsVideoRequest): Promise<any>
420
+ imageToVideo(request: JsVideoRequest): Promise<JsVideoResult>
369
421
  /** Synthesize speech from text. */
370
- textToSpeech(request: JsSpeechRequest): Promise<any>
422
+ textToSpeech(request: JsSpeechRequest): Promise<JsAudioResult>
371
423
  /** Generate music from a prompt. */
372
- generateMusic(request: JsMusicRequest): Promise<any>
424
+ generateMusic(request: JsMusicRequest): Promise<JsAudioResult>
373
425
  /** Generate sound effects from a prompt. */
374
- generateSfx(request: JsMusicRequest): Promise<any>
426
+ generateSfx(request: JsMusicRequest): Promise<JsAudioResult>
375
427
  /** Transcribe audio to text. */
376
- transcribe(request: JsTranscriptionRequest): Promise<any>
428
+ transcribe(request: JsTranscriptionRequest): Promise<JsTranscriptionResult>
377
429
  /** Run a model synchronously (submit + wait for result). */
378
- run(model: string, input: any): Promise<any>
430
+ run(request: JsComputeRequest): Promise<JsComputeResult>
379
431
  /** Submit a job to the queue and return a job handle. */
380
- submit(model: string, input: any): Promise<any>
432
+ submit(request: JsComputeRequest): Promise<JsJobHandle>
381
433
  /** Get the status of a submitted job. */
382
- status(jobId: string, model: string): Promise<any>
434
+ status(handle: JsJobHandle): Promise<JsJobStatus>
383
435
  /** Cancel a submitted job. */
384
- cancel(jobId: string, model: string): Promise<void>
436
+ cancel(handle: JsJobHandle): Promise<void>
385
437
  /** Perform a chat completion via fal.ai's `any-llm` proxy. */
386
438
  complete(messages: Array<JsChatMessage>): Promise<JsCompletionResponse>
387
439
  }
@@ -523,6 +575,118 @@ export declare class Memory {
523
575
  }
524
576
  export type JsMemory = Memory
525
577
 
578
+ /**
579
+ * A versioned registry for prompt templates.
580
+ *
581
+ * Organises templates by name and version, with convenient lookup,
582
+ * rendering, and file I/O.
583
+ *
584
+ * ```javascript
585
+ * const registry = new PromptRegistry();
586
+ * registry.register("greet", new PromptTemplate("Hello {{name}}!"));
587
+ * const msg = registry.render("greet", { name: "Alice" });
588
+ * console.log(msg.content);
589
+ * ```
590
+ */
591
+ export declare class PromptRegistry {
592
+ /** Create a new empty prompt registry. */
593
+ constructor()
594
+ /**
595
+ * Register a template under the given name.
596
+ *
597
+ * The template's internal name is updated to match the provided name.
598
+ * If a template with the same name and version already exists, it is
599
+ * replaced.
600
+ *
601
+ * @param name - The name to register the template under.
602
+ * @param template - The `PromptTemplate` to register.
603
+ */
604
+ register(name: string, template: PromptTemplate): void
605
+ /**
606
+ * Get the latest version of a template by name.
607
+ *
608
+ * @param name - The template name.
609
+ * @returns The `PromptTemplate` or `null` if not found.
610
+ */
611
+ get(name: string): PromptTemplate | null
612
+ /**
613
+ * Render the latest version of the named template with the given variables.
614
+ *
615
+ * @param name - The template name.
616
+ * @param variables - A map of variable name to value.
617
+ * @returns A `ChatMessage` with the rendered content.
618
+ */
619
+ render(name: string, variables: Record<string, string>): ChatMessage
620
+ /**
621
+ * List all registered template names (sorted).
622
+ *
623
+ * @returns An array of template name strings.
624
+ */
625
+ list(): Array<string>
626
+ /**
627
+ * Load a registry from a YAML or JSON file.
628
+ *
629
+ * The file format is detected by extension (`.yaml`/`.yml` for YAML,
630
+ * `.json` for JSON).
631
+ *
632
+ * @param path - Path to the prompt file.
633
+ * @returns A new `PromptRegistry` with the loaded templates.
634
+ */
635
+ static fromFile(path: string): PromptRegistry
636
+ /**
637
+ * Load all prompt files from a directory.
638
+ *
639
+ * Reads all `.yaml`, `.yml`, and `.json` files in the directory.
640
+ *
641
+ * @param path - Path to the directory.
642
+ * @returns A new `PromptRegistry` with the loaded templates.
643
+ */
644
+ static fromDir(path: string): PromptRegistry
645
+ }
646
+ export type JsPromptRegistry = PromptRegistry
647
+
648
+ /**
649
+ * A reusable prompt template with `{{variable}}` placeholders.
650
+ *
651
+ * Templates are rendered by replacing `{{var}}` placeholders with the
652
+ * provided variables map.
653
+ *
654
+ * ```javascript
655
+ * const t = new PromptTemplate("Hello {{name}}!", { role: "user" });
656
+ * const msg = t.render({ name: "Alice" });
657
+ * console.log(msg.content); // "Hello Alice!"
658
+ * ```
659
+ */
660
+ export declare class PromptTemplate {
661
+ /**
662
+ * Create a new prompt template.
663
+ *
664
+ * @param template - The template string with `{{variable}}` placeholders.
665
+ * @param options - Optional configuration (role, name, description, version).
666
+ */
667
+ constructor(template: string, options?: PromptTemplateOptions | undefined | null)
668
+ /** The raw template string. */
669
+ get template(): string
670
+ /** The chat role ("system", "user", or "assistant"). */
671
+ get role(): string
672
+ /** The template name. */
673
+ get name(): string
674
+ /** The optional description. */
675
+ get description(): string | null
676
+ /** The version string. */
677
+ get version(): string
678
+ /** The sorted list of variable names in this template. */
679
+ get variables(): Array<string>
680
+ /**
681
+ * Render the template with the given variables.
682
+ *
683
+ * @param variables - A map of variable name to value.
684
+ * @returns A `ChatMessage` with the rendered content and template's role.
685
+ */
686
+ render(variables: Record<string, string>): ChatMessage
687
+ }
688
+ export type JsPromptTemplate = PromptTemplate
689
+
526
690
  /**
527
691
  * Namespace for in-process-only workflow values.
528
692
  *
@@ -928,14 +1092,19 @@ export interface JsBedrockOptions {
928
1092
  region: string
929
1093
  }
930
1094
 
931
- /** Configuration for the `withCache` decorator. */
932
1095
  export interface JsCacheConfig {
933
- /** How long a cached response remains valid, in seconds. */
1096
+ strategy?: JsCacheStrategy
934
1097
  ttlSeconds?: number
935
- /** Maximum number of entries to keep in the cache. */
936
1098
  maxEntries?: number
937
1099
  }
938
1100
 
1101
+ export declare const enum JsCacheStrategy {
1102
+ None = 'none',
1103
+ ContentHash = 'content_hash',
1104
+ AnthropicEphemeral = 'anthropic_ephemeral',
1105
+ Auto = 'auto'
1106
+ }
1107
+
939
1108
  /**
940
1109
  * A web/document citation backing a model statement.
941
1110
  *
@@ -979,9 +1148,9 @@ export interface JsCompletionResponse {
979
1148
  finishReason?: string
980
1149
  cost?: number
981
1150
  timing?: JsRequestTiming
982
- images: Array<any>
983
- audio: Array<any>
984
- videos: Array<any>
1151
+ images: Array<JsGeneratedImage>
1152
+ audio: Array<JsGeneratedAudio>
1153
+ videos: Array<JsGeneratedVideo>
985
1154
  reasoning?: JsReasoningTrace
986
1155
  citations: Array<JsCitation>
987
1156
  artifacts: Array<JsArtifact>
@@ -1239,14 +1408,12 @@ export interface JsResponseFormat {
1239
1408
  strict?: boolean
1240
1409
  }
1241
1410
 
1242
- /** Configuration for the `withRetry` decorator. */
1243
1411
  export interface JsRetryConfig {
1244
- /** Maximum number of retry attempts (total calls = `maxRetries + 1`). */
1245
1412
  maxRetries?: number
1246
- /** Delay before the first retry, in milliseconds. */
1247
1413
  initialDelayMs?: number
1248
- /** Upper bound on the computed backoff delay, in milliseconds. */
1249
1414
  maxDelayMs?: number
1415
+ honorRetryAfter?: boolean
1416
+ jitter?: boolean
1250
1417
  }
1251
1418
 
1252
1419
  /** The role of a participant in a chat conversation. */
@@ -1414,6 +1581,18 @@ export interface JsWorkflowResult {
1414
1581
  data: any
1415
1582
  }
1416
1583
 
1584
+ /** Options for creating a `PromptTemplate`. */
1585
+ export interface PromptTemplateOptions {
1586
+ /** The chat role: "system", "user", or "assistant". Defaults to "user". */
1587
+ role?: string
1588
+ /** A unique name for this template. Defaults to "unnamed". */
1589
+ name?: string
1590
+ /** An optional description of this template. */
1591
+ description?: string
1592
+ /** The version string. Defaults to "1.0". */
1593
+ version?: string
1594
+ }
1595
+
1417
1596
  /**
1418
1597
  * Run an agentic tool execution loop.
1419
1598
  *
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.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.`)
80
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
96
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
117
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
133
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
150
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
166
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
185
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
201
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
217
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
237
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
253
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
274
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
290
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
308
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
324
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
342
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
358
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
376
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
392
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
410
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
426
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
443
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
459
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
479
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
495
+ if (bindingPackageVersion !== '0.1.124' && 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.124 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.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.`)
511
+ if (bindingPackageVersion !== '0.1.124' && 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.124 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -578,6 +578,8 @@ if (!nativeBinding) {
578
578
  module.exports = nativeBinding
579
579
  module.exports.ChatMessage = nativeBinding.ChatMessage
580
580
  module.exports.JsChatMessage = nativeBinding.JsChatMessage
581
+ module.exports.ChatWindow = nativeBinding.ChatWindow
582
+ module.exports.JsChatWindow = nativeBinding.JsChatWindow
581
583
  module.exports.CompletionModel = nativeBinding.CompletionModel
582
584
  module.exports.JsCompletionModel = nativeBinding.JsCompletionModel
583
585
  module.exports.Context = nativeBinding.Context
@@ -594,6 +596,10 @@ module.exports.JsonlBackend = nativeBinding.JsonlBackend
594
596
  module.exports.JsJsonlBackend = nativeBinding.JsJsonlBackend
595
597
  module.exports.Memory = nativeBinding.Memory
596
598
  module.exports.JsMemory = nativeBinding.JsMemory
599
+ module.exports.PromptRegistry = nativeBinding.PromptRegistry
600
+ module.exports.JsPromptRegistry = nativeBinding.JsPromptRegistry
601
+ module.exports.PromptTemplate = nativeBinding.PromptTemplate
602
+ module.exports.JsPromptTemplate = nativeBinding.JsPromptTemplate
597
603
  module.exports.SessionNamespace = nativeBinding.SessionNamespace
598
604
  module.exports.JsSessionNamespace = nativeBinding.JsSessionNamespace
599
605
  module.exports.StateNamespace = nativeBinding.StateNamespace
@@ -606,6 +612,7 @@ module.exports.WorkflowHandler = nativeBinding.WorkflowHandler
606
612
  module.exports.JsWorkflowHandler = nativeBinding.JsWorkflowHandler
607
613
  module.exports.countMessageTokens = nativeBinding.countMessageTokens
608
614
  module.exports.estimateTokens = nativeBinding.estimateTokens
615
+ module.exports.JsCacheStrategy = nativeBinding.JsCacheStrategy
609
616
  module.exports.JsFalLlmEndpointKind = nativeBinding.JsFalLlmEndpointKind
610
617
  module.exports.JsJobStatus = nativeBinding.JsJobStatus
611
618
  module.exports.JsRole = nativeBinding.JsRole
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blazen",
3
- "version": "0.1.122",
3
+ "version": "0.1.124",
4
4
  "description": "Blazen - Event-driven AI workflow framework for Node.js/TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",