blazen 0.6.1 → 0.6.3

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.
package/blazen.workers.js CHANGED
@@ -55,7 +55,12 @@ const __wasi = new __WASI({ version: 'preview1' })
55
55
  const __emnapiContext = __emnapiGetDefaultContext()
56
56
 
57
57
  const __sharedMemory = new WebAssembly.Memory({
58
- initial: 4000,
58
+ // 256 pages * 64 KiB = 16 MiB initial (grows on demand up to `maximum`).
59
+ // napi-rs's default is 4000 pages (~250 MiB), which exceeds a Cloudflare
60
+ // Workers isolate's 128 MiB cap and fails to instantiate (RangeError CF
61
+ // 10021). Keep this in lockstep with napi.wasm.initialMemory in package.json
62
+ // (which controls the napi-generated blazen.wasi*.{cjs,js}).
63
+ initial: 256,
59
64
  maximum: 65536,
60
65
  shared: true,
61
66
  })
package/index.d.ts CHANGED
@@ -110,6 +110,14 @@ export declare class AssignmentContext {
110
110
  * string, number, boolean, null).
111
111
  */
112
112
  emitEvent(eventType: string, data: any): Promise<void>
113
+ /**
114
+ * Request input from the orchestrator and await the response.
115
+ *
116
+ * `prompt` is shown to the responder; `metadata` is an arbitrary
117
+ * JSON-serializable payload. `timeoutMs`, when set, bounds the wait.
118
+ * Resolves with the JSON response value.
119
+ */
120
+ requestInput(prompt: string, metadata: any, timeoutMs?: bigint | undefined | null): Promise<any>
113
121
  }
114
122
  export type JsAssignmentContext = AssignmentContext
115
123
 
@@ -1129,6 +1137,8 @@ export declare class ControlPlaneClient {
1129
1137
  * away; otherwise let in-flight runs finish first.
1130
1138
  */
1131
1139
  drainWorker(nodeId: string, immediate: boolean): Promise<void>
1140
+ /** Respond to a pending input request raised by a worker for a run. */
1141
+ respondToInput(runId: string, requestId: string, response: any): Promise<void>
1132
1142
  /**
1133
1143
  * Subscribe to events for a specific run. The returned stream is
1134
1144
  * a JS `AsyncIterableIterator<RunEvent>` (object with both `next`
@@ -1210,6 +1220,8 @@ export declare class ControlPlaneWorkerConfig {
1210
1220
  * predicates.
1211
1221
  */
1212
1222
  withTag(key: string, value: string): this
1223
+ /** Attach a bearer token sent on the worker handshake. */
1224
+ withBearerToken(token: string): this
1213
1225
  /** Override the admission mode declared at handshake. */
1214
1226
  withAdmission(mode: JsAdmissionMode): this
1215
1227
  /** Override the heartbeat cadence (milliseconds). */
@@ -8246,6 +8258,8 @@ export interface JsCitation {
8246
8258
  export interface JsClientConnectOptions {
8247
8259
  /** mTLS configuration. `None` = plaintext. */
8248
8260
  mtls?: JsMtlsOptions
8261
+ /** Bearer token attached to control-plane requests. `None` = anonymous. */
8262
+ bearerToken?: string
8249
8263
  }
8250
8264
 
8251
8265
  export interface JsComputeRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blazen",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Blazen - Event-driven AI workflow framework for Node.js/TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,7 +28,10 @@
28
28
  "aarch64-apple-darwin",
29
29
  "x86_64-pc-windows-msvc",
30
30
  "wasm32-wasi"
31
- ]
31
+ ],
32
+ "wasm": {
33
+ "initialMemory": 256
34
+ }
32
35
  },
33
36
  "publishConfig": {
34
37
  "access": "public"
@@ -87,13 +90,13 @@
87
90
  "verbose": true
88
91
  },
89
92
  "optionalDependencies": {
90
- "@blazen-dev/blazen-linux-x64-gnu": "0.6.1",
91
- "@blazen-dev/blazen-linux-x64-musl": "0.6.1",
92
- "@blazen-dev/blazen-linux-arm64-gnu": "0.6.1",
93
- "@blazen-dev/blazen-linux-arm64-musl": "0.6.1",
94
- "@blazen-dev/blazen-darwin-arm64": "0.6.1",
95
- "@blazen-dev/blazen-win32-x64-msvc": "0.6.1",
96
- "@blazen-dev/blazen-wasm32-wasi": "0.6.1"
93
+ "@blazen-dev/blazen-linux-x64-gnu": "0.6.3",
94
+ "@blazen-dev/blazen-linux-x64-musl": "0.6.3",
95
+ "@blazen-dev/blazen-linux-arm64-gnu": "0.6.3",
96
+ "@blazen-dev/blazen-linux-arm64-musl": "0.6.3",
97
+ "@blazen-dev/blazen-darwin-arm64": "0.6.3",
98
+ "@blazen-dev/blazen-win32-x64-msvc": "0.6.3",
99
+ "@blazen-dev/blazen-wasm32-wasi": "0.6.3"
97
100
  },
98
101
  "scripts": {
99
102
  "build": "napi build --release --platform --features local-all,langfuse --js index.js && node scripts/post-build.mjs",