@rivetkit/rivetkit-napi 0.0.0-main.72cbc7c → 0.0.0-main.879b6a2

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
@@ -174,9 +197,10 @@ export interface JsServerlessResponseHead {
174
197
  status: number
175
198
  headers: Record<string, string>
176
199
  }
177
- export interface JsRegistryDiagnostics {
178
- mode: string
179
- envoyActiveActorCount?: number
200
+ export interface JsRegistryRouteResponse {
201
+ status: number
202
+ headers: Record<string, string>
203
+ body: Buffer
180
204
  }
181
205
  export interface JsServerlessStreamError {
182
206
  group: string
@@ -241,6 +265,7 @@ export declare class ActorContext {
241
265
  broadcast(name: string, args: Buffer): void
242
266
  waitUntil(promise: Promise<any>): void
243
267
  waitForTrackedShutdownWork(): Promise<boolean>
268
+ waitForTrackedShutdownWorkUnbounded(): Promise<void>
244
269
  registerTask(promise: Promise<any>): void
245
270
  runtimeState(): object
246
271
  clearRuntimeState(): void
@@ -288,7 +313,7 @@ export declare class Queue {
288
313
  next(options?: JsQueueNextOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage | null>
289
314
  nextBatch(options?: JsQueueNextBatchOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Array<QueueMessage>>
290
315
  waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage>
291
- waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null): Promise<void>
316
+ waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<void>
292
317
  enqueueAndWait(name: string, body: Buffer, options?: JsQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Buffer | null>
293
318
  tryNext(options?: JsQueueTryNextOptions | undefined | null): QueueMessage | null
294
319
  tryNextBatch(options?: JsQueueTryNextBatchOptions | undefined | null): Array<QueueMessage>
@@ -315,7 +340,10 @@ export declare class CoreRegistry {
315
340
  * separately to avoid re-entrancy.
316
341
  */
317
342
  shutdown(): Promise<void>
318
- diagnostics(): Promise<JsRegistryDiagnostics>
343
+ actorStopThresholdMs(): Promise<number | null>
344
+ health(): Promise<JsRegistryRouteResponse>
345
+ metadata(): JsRegistryRouteResponse
346
+ metrics(): JsRegistryRouteResponse
319
347
  handleServerlessRequest(req: JsServerlessRequest, onStreamEvent: (...args: any[]) => any, cancelToken: CancellationToken, config: JsServeConfig): Promise<JsServerlessResponseHead>
320
348
  }
321
349
  export declare class Schedule {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-napi",
3
- "version": "0.0.0-main.72cbc7c",
3
+ "version": "0.0.0-main.879b6a2",
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",
@@ -43,15 +43,14 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@napi-rs/cli": "^2.18.4",
46
- "@rivetkit/engine-envoy-protocol": "0.0.0-main.72cbc7c"
46
+ "@rivetkit/engine-envoy-protocol": "0.0.0-main.879b6a2"
47
47
  },
48
48
  "optionalDependencies": {
49
- "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-main.72cbc7c",
50
- "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-main.72cbc7c",
51
- "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-main.72cbc7c",
52
- "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-main.72cbc7c",
53
- "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-main.72cbc7c",
54
- "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-main.72cbc7c",
55
- "@rivetkit/rivetkit-napi-win32-x64-msvc": "0.0.0-main.72cbc7c"
49
+ "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-main.879b6a2",
50
+ "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-main.879b6a2",
51
+ "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-main.879b6a2",
52
+ "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-main.879b6a2",
53
+ "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-main.879b6a2",
54
+ "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-main.879b6a2"
56
55
  }
57
56
  }
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" });