@rivetkit/rivetkit-napi 2.3.0-rc.9 → 2.3.1

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/index.d.ts CHANGED
@@ -47,6 +47,26 @@ export interface JsQueueSendResult {
47
47
  export interface JsActionDefinition {
48
48
  name: string
49
49
  }
50
+ /**
51
+ * One entry in the actor's `inspector.tabs[]` declaration. Either a
52
+ * custom-tab descriptor (id + label + source dir) or a built-in modifier
53
+ * (id + hidden=true). Validation already happened on the TS side; the
54
+ * runtime just splits the discriminator.
55
+ */
56
+ export interface JsInspectorTabEntry {
57
+ id: string
58
+ /** Required for custom entries; omitted for HideBuiltin. */
59
+ label?: string
60
+ /** Required for custom entries — absolute path to the source directory. */
61
+ source?: string
62
+ /**
63
+ * Optional icon id for custom entries. Dashboard maps strings to
64
+ * glyphs; unknown ids fall back to a generic icon.
65
+ */
66
+ icon?: string
67
+ /** Set to true for HideBuiltin entries. */
68
+ hidden?: boolean
69
+ }
50
70
  export interface JsActorConfig {
51
71
  name?: string
52
72
  icon?: string
@@ -78,6 +98,7 @@ export interface JsActorConfig {
78
98
  preloadMaxWorkflowBytes?: number
79
99
  preloadMaxConnectionsBytes?: number
80
100
  actions?: Array<JsActionDefinition>
101
+ inspectorTabs?: Array<JsInspectorTabEntry>
81
102
  }
82
103
  export interface JsBindParam {
83
104
  kind: string
@@ -155,6 +176,8 @@ export interface JsServeConfig {
155
176
  namespace: string
156
177
  poolName: string
157
178
  engineBinaryPath?: string
179
+ engineHost?: string
180
+ enginePort?: number
158
181
  handleInspectorHttpInRuntime?: boolean
159
182
  serverlessBasePath?: string
160
183
  serverlessPackageVersion: string
@@ -164,6 +187,16 @@ export interface JsServeConfig {
164
187
  serverlessValidateEndpoint: boolean
165
188
  serverlessMaxStartPayloadBytes: number
166
189
  }
190
+ export interface JsListenerConfig {
191
+ /** Host to bind. Defaults to `0.0.0.0` when not provided. */
192
+ host?: string
193
+ port: number
194
+ /**
195
+ * Optional static file root mounted as a fallback below the framework
196
+ * routes.
197
+ */
198
+ publicDir?: string
199
+ }
167
200
  export interface JsServerlessRequest {
168
201
  method: string
169
202
  url: string
@@ -242,6 +275,7 @@ export declare class ActorContext {
242
275
  broadcast(name: string, args: Buffer): void
243
276
  waitUntil(promise: Promise<any>): void
244
277
  waitForTrackedShutdownWork(): Promise<boolean>
278
+ waitForTrackedShutdownWorkUnbounded(): Promise<void>
245
279
  registerTask(promise: Promise<any>): void
246
280
  runtimeState(): object
247
281
  clearRuntimeState(): void
@@ -289,7 +323,7 @@ export declare class Queue {
289
323
  next(options?: JsQueueNextOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage | null>
290
324
  nextBatch(options?: JsQueueNextBatchOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Array<QueueMessage>>
291
325
  waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage>
292
- waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null): Promise<void>
326
+ waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<void>
293
327
  enqueueAndWait(name: string, body: Buffer, options?: JsQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Buffer | null>
294
328
  tryNext(options?: JsQueueTryNextOptions | undefined | null): QueueMessage | null
295
329
  tryNextBatch(options?: JsQueueTryNextBatchOptions | undefined | null): Array<QueueMessage>
@@ -320,6 +354,7 @@ export declare class CoreRegistry {
320
354
  health(): Promise<JsRegistryRouteResponse>
321
355
  metadata(): JsRegistryRouteResponse
322
356
  metrics(): JsRegistryRouteResponse
357
+ serveListener(listener: JsListenerConfig, config: JsServeConfig): Promise<void>
323
358
  handleServerlessRequest(req: JsServerlessRequest, onStreamEvent: (...args: any[]) => any, cancelToken: CancellationToken, config: JsServeConfig): Promise<JsServerlessResponseHead>
324
359
  }
325
360
  export declare class Schedule {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-napi",
3
- "version": "2.3.0-rc.9",
3
+ "version": "2.3.1",
4
4
  "description": "Native N-API addon for RivetKit providing envoy client and SQLite access",
5
5
  "license": "Apache-2.0",
6
6
  "main": "index.js",
@@ -39,19 +39,20 @@
39
39
  "build": "node scripts/build.mjs",
40
40
  "build:release": "node scripts/build.mjs --release",
41
41
  "build:force": "node scripts/build.mjs --force",
42
- "build:force:release": "node scripts/build.mjs --force --release"
42
+ "build:force:release": "node scripts/build.mjs --force --release",
43
+ "build:embed": "node scripts/build.mjs"
43
44
  },
44
45
  "dependencies": {
45
46
  "@napi-rs/cli": "^2.18.4",
46
- "@rivetkit/engine-envoy-protocol": "2.3.0-rc.9"
47
+ "@rivetkit/engine-envoy-protocol": "2.3.1"
47
48
  },
48
49
  "optionalDependencies": {
49
- "@rivetkit/rivetkit-napi-darwin-arm64": "2.3.0-rc.9",
50
- "@rivetkit/rivetkit-napi-darwin-x64": "2.3.0-rc.9",
51
- "@rivetkit/rivetkit-napi-linux-arm64-gnu": "2.3.0-rc.9",
52
- "@rivetkit/rivetkit-napi-linux-arm64-musl": "2.3.0-rc.9",
53
- "@rivetkit/rivetkit-napi-linux-x64-gnu": "2.3.0-rc.9",
54
- "@rivetkit/rivetkit-napi-linux-x64-musl": "2.3.0-rc.9",
55
- "@rivetkit/rivetkit-napi-win32-x64-msvc": "2.3.0-rc.9"
50
+ "@rivetkit/rivetkit-napi-darwin-arm64": "2.3.1",
51
+ "@rivetkit/rivetkit-napi-darwin-x64": "2.3.1",
52
+ "@rivetkit/rivetkit-napi-linux-arm64-gnu": "2.3.1",
53
+ "@rivetkit/rivetkit-napi-linux-arm64-musl": "2.3.1",
54
+ "@rivetkit/rivetkit-napi-linux-x64-gnu": "2.3.1",
55
+ "@rivetkit/rivetkit-napi-linux-x64-musl": "2.3.1",
56
+ "@rivetkit/rivetkit-napi-win32-x64-msvc": "2.3.1"
56
57
  }
57
58
  }
package/scripts/build.mjs CHANGED
@@ -16,6 +16,14 @@ if (process.env.SKIP_NAPI_BUILD === "1") {
16
16
  process.exit(0);
17
17
  }
18
18
 
19
+ // The per-actor inspector UI (frontend/dist/inspector-ui, embedded into
20
+ // rivetkit-core by its build.rs) must be built before this napi build runs.
21
+ // It is NOT built here: rivetkit-core's embed needs rivetkit/inspector-tab,
22
+ // which is downstream of this package in the build graph, so building it from
23
+ // the napi build would invert the dependency order. CI builds it via
24
+ // `turbo build:inspector-ui` in docker/build/*.Dockerfile before `napi build`;
25
+ // for local builds run `pnpm -F @rivetkit/engine-frontend build:inspector-ui`
26
+ // (or `turbo build:inspector-ui`) first.
19
27
  const cmd = ["build", "--platform", ...extraFlags];
20
28
  console.log(`[rivetkit-napi/build] running: napi ${cmd.join(" ")}`);
21
29
  execFileSync("napi", cmd, { stdio: "inherit" });