@rivetkit/rivetkit-napi 0.0.0-skip-ready-wait-flatten-client-options.1cae221 → 0.0.0-sqlite-uds.4e59a38
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 +54 -7
- package/package.json +10 -10
- package/scripts/build.mjs +8 -0
package/index.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export interface JsInspectorSnapshot {
|
|
|
35
35
|
queueSize: number
|
|
36
36
|
connectedClients: number
|
|
37
37
|
}
|
|
38
|
+
export interface JsActorUdsEndpointInfo {
|
|
39
|
+
path: string
|
|
40
|
+
token: string
|
|
41
|
+
}
|
|
38
42
|
export interface JsHttpResponse {
|
|
39
43
|
status?: number
|
|
40
44
|
headers?: Record<string, string>
|
|
@@ -47,11 +51,32 @@ export interface JsQueueSendResult {
|
|
|
47
51
|
export interface JsActionDefinition {
|
|
48
52
|
name: string
|
|
49
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* One entry in the actor's `inspector.tabs[]` declaration. Either a
|
|
56
|
+
* custom-tab descriptor (id + label + source dir) or a built-in modifier
|
|
57
|
+
* (id + hidden=true). Validation already happened on the TS side; the
|
|
58
|
+
* runtime just splits the discriminator.
|
|
59
|
+
*/
|
|
60
|
+
export interface JsInspectorTabEntry {
|
|
61
|
+
id: string
|
|
62
|
+
/** Required for custom entries; omitted for HideBuiltin. */
|
|
63
|
+
label?: string
|
|
64
|
+
/** Required for custom entries — absolute path to the source directory. */
|
|
65
|
+
source?: string
|
|
66
|
+
/**
|
|
67
|
+
* Optional icon id for custom entries. Dashboard maps strings to
|
|
68
|
+
* glyphs; unknown ids fall back to a generic icon.
|
|
69
|
+
*/
|
|
70
|
+
icon?: string
|
|
71
|
+
/** Set to true for HideBuiltin entries. */
|
|
72
|
+
hidden?: boolean
|
|
73
|
+
}
|
|
50
74
|
export interface JsActorConfig {
|
|
51
75
|
name?: string
|
|
52
76
|
icon?: string
|
|
53
77
|
hasDatabase?: boolean
|
|
54
78
|
remoteSqlite?: boolean
|
|
79
|
+
experimentalActorUds?: boolean
|
|
55
80
|
hasState?: boolean
|
|
56
81
|
canHibernateWebsocket?: boolean
|
|
57
82
|
stateSaveIntervalMs?: number
|
|
@@ -78,6 +103,7 @@ export interface JsActorConfig {
|
|
|
78
103
|
preloadMaxWorkflowBytes?: number
|
|
79
104
|
preloadMaxConnectionsBytes?: number
|
|
80
105
|
actions?: Array<JsActionDefinition>
|
|
106
|
+
inspectorTabs?: Array<JsInspectorTabEntry>
|
|
81
107
|
}
|
|
82
108
|
export interface JsBindParam {
|
|
83
109
|
kind: string
|
|
@@ -155,6 +181,8 @@ export interface JsServeConfig {
|
|
|
155
181
|
namespace: string
|
|
156
182
|
poolName: string
|
|
157
183
|
engineBinaryPath?: string
|
|
184
|
+
engineHost?: string
|
|
185
|
+
enginePort?: number
|
|
158
186
|
handleInspectorHttpInRuntime?: boolean
|
|
159
187
|
serverlessBasePath?: string
|
|
160
188
|
serverlessPackageVersion: string
|
|
@@ -164,6 +192,16 @@ export interface JsServeConfig {
|
|
|
164
192
|
serverlessValidateEndpoint: boolean
|
|
165
193
|
serverlessMaxStartPayloadBytes: number
|
|
166
194
|
}
|
|
195
|
+
export interface JsListenerConfig {
|
|
196
|
+
/** Host to bind. Defaults to `0.0.0.0` when not provided. */
|
|
197
|
+
host?: string
|
|
198
|
+
port: number
|
|
199
|
+
/**
|
|
200
|
+
* Optional static file root mounted as a fallback below the framework
|
|
201
|
+
* routes.
|
|
202
|
+
*/
|
|
203
|
+
publicDir?: string
|
|
204
|
+
}
|
|
167
205
|
export interface JsServerlessRequest {
|
|
168
206
|
method: string
|
|
169
207
|
url: string
|
|
@@ -174,9 +212,10 @@ export interface JsServerlessResponseHead {
|
|
|
174
212
|
status: number
|
|
175
213
|
headers: Record<string, string>
|
|
176
214
|
}
|
|
177
|
-
export interface
|
|
178
|
-
|
|
179
|
-
|
|
215
|
+
export interface JsRegistryRouteResponse {
|
|
216
|
+
status: number
|
|
217
|
+
headers: Record<string, string>
|
|
218
|
+
body: Buffer
|
|
180
219
|
}
|
|
181
220
|
export interface JsServerlessStreamError {
|
|
182
221
|
group: string
|
|
@@ -201,6 +240,7 @@ export declare class ActorContext {
|
|
|
201
240
|
endOnStateChange(): void
|
|
202
241
|
kv(): Kv
|
|
203
242
|
sql(): JsNativeDatabase
|
|
243
|
+
provisionActorUds(): Promise<JsActorUdsEndpointInfo>
|
|
204
244
|
schedule(): Schedule
|
|
205
245
|
queue(): Queue
|
|
206
246
|
setAlarm(timestampMs?: number | undefined | null): void
|
|
@@ -240,6 +280,8 @@ export declare class ActorContext {
|
|
|
240
280
|
disconnectConns(predicate: (...args: any[]) => any): Promise<void>
|
|
241
281
|
broadcast(name: string, args: Buffer): void
|
|
242
282
|
waitUntil(promise: Promise<any>): void
|
|
283
|
+
waitForTrackedShutdownWork(): Promise<boolean>
|
|
284
|
+
waitForTrackedShutdownWorkUnbounded(): Promise<void>
|
|
243
285
|
registerTask(promise: Promise<any>): void
|
|
244
286
|
runtimeState(): object
|
|
245
287
|
clearRuntimeState(): void
|
|
@@ -267,8 +309,8 @@ export declare class JsNativeDatabase {
|
|
|
267
309
|
metrics(): JsSqliteVfsMetrics | null
|
|
268
310
|
run(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<ExecuteResult>
|
|
269
311
|
query(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<QueryResult>
|
|
270
|
-
execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
|
|
271
|
-
exec(sql: string): Promise<QueryResult>
|
|
312
|
+
execute(sql: string, params?: Array<JsBindParam> | undefined | null, leaseKey?: string | undefined | null, leaseTimeoutMs?: number | undefined | null): Promise<NativeExecuteResult>
|
|
313
|
+
exec(sql: string, leaseKey?: string | undefined | null, leaseTimeoutMs?: number | undefined | null): Promise<QueryResult>
|
|
272
314
|
close(): Promise<void>
|
|
273
315
|
}
|
|
274
316
|
export declare class Kv {
|
|
@@ -287,11 +329,12 @@ export declare class Queue {
|
|
|
287
329
|
next(options?: JsQueueNextOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage | null>
|
|
288
330
|
nextBatch(options?: JsQueueNextBatchOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Array<QueueMessage>>
|
|
289
331
|
waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage>
|
|
290
|
-
waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null): Promise<void>
|
|
332
|
+
waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<void>
|
|
291
333
|
enqueueAndWait(name: string, body: Buffer, options?: JsQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Buffer | null>
|
|
292
334
|
tryNext(options?: JsQueueTryNextOptions | undefined | null): QueueMessage | null
|
|
293
335
|
tryNextBatch(options?: JsQueueTryNextBatchOptions | undefined | null): Array<QueueMessage>
|
|
294
336
|
maxSize(): number
|
|
337
|
+
reset(): Promise<void>
|
|
295
338
|
inspectMessages(): Promise<Array<JsQueueInspectMessage>>
|
|
296
339
|
}
|
|
297
340
|
export declare class QueueMessage {
|
|
@@ -314,7 +357,11 @@ export declare class CoreRegistry {
|
|
|
314
357
|
* separately to avoid re-entrancy.
|
|
315
358
|
*/
|
|
316
359
|
shutdown(): Promise<void>
|
|
317
|
-
|
|
360
|
+
actorStopThresholdMs(): Promise<number | null>
|
|
361
|
+
health(): Promise<JsRegistryRouteResponse>
|
|
362
|
+
metadata(): JsRegistryRouteResponse
|
|
363
|
+
metrics(): JsRegistryRouteResponse
|
|
364
|
+
serveListener(listener: JsListenerConfig, config: JsServeConfig): Promise<void>
|
|
318
365
|
handleServerlessRequest(req: JsServerlessRequest, onStreamEvent: (...args: any[]) => any, cancelToken: CancellationToken, config: JsServeConfig): Promise<JsServerlessResponseHead>
|
|
319
366
|
}
|
|
320
367
|
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-
|
|
3
|
+
"version": "0.0.0-sqlite-uds.4e59a38",
|
|
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,19 @@
|
|
|
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": "0.0.0-
|
|
47
|
+
"@rivetkit/engine-envoy-protocol": "0.0.0-sqlite-uds.4e59a38"
|
|
47
48
|
},
|
|
48
49
|
"optionalDependencies": {
|
|
49
|
-
"@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-
|
|
50
|
-
"@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-
|
|
51
|
-
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-
|
|
52
|
-
"@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-
|
|
53
|
-
"@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-
|
|
54
|
-
"@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-
|
|
55
|
-
"@rivetkit/rivetkit-napi-win32-x64-msvc": "0.0.0-skip-ready-wait-flatten-client-options.1cae221"
|
|
50
|
+
"@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-sqlite-uds.4e59a38",
|
|
51
|
+
"@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-sqlite-uds.4e59a38",
|
|
52
|
+
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-sqlite-uds.4e59a38",
|
|
53
|
+
"@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-sqlite-uds.4e59a38",
|
|
54
|
+
"@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-sqlite-uds.4e59a38",
|
|
55
|
+
"@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-sqlite-uds.4e59a38"
|
|
56
56
|
}
|
|
57
57
|
}
|
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" });
|