@rivetkit/rivetkit-napi 0.0.0-main.4994268 → 0.0.0-main.78336a1

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 +29 -1
  2. package/index.js +2 -1
  3. package/package.json +13 -8
package/index.d.ts CHANGED
@@ -71,11 +71,29 @@ export interface JsInspectorTabEntry {
71
71
  /** Set to true for HideBuiltin entries. */
72
72
  hidden?: boolean
73
73
  }
74
+ /**
75
+ * Experimental SQLite profiling configuration. This entire configuration
76
+ * surface is subject to change without notice.
77
+ */
78
+ export interface JsSqliteProfilingConfig {
79
+ enabled?: boolean
80
+ maxTrackedStatementFingerprints?: number
81
+ maxTrackedTransactionFingerprints?: number
82
+ maxPrometheusSeries?: number
83
+ maxStatementsPerTransactionTrace?: number
84
+ maxGetPagesRequestsPerTrace?: number
85
+ maxTransactionNameBytes?: number
86
+ slowOperationThresholdMs?: number
87
+ baselineSampleRate?: number
88
+ maxDiagnosticEventsPerMinute?: number
89
+ diagnosticEventQueueCapacity?: number
90
+ }
74
91
  export interface JsActorConfig {
75
92
  name?: string
76
93
  icon?: string
77
94
  hasDatabase?: boolean
78
95
  remoteSqlite?: boolean
96
+ sqliteProfiling?: JsSqliteProfilingConfig
79
97
  enableActorRuntimeSocket?: boolean
80
98
  hasState?: boolean
81
99
  canHibernateWebsocket?: boolean
@@ -190,6 +208,8 @@ export interface JsServeConfig {
190
208
  namespace: string
191
209
  poolName: string
192
210
  engineBinaryPath?: string
211
+ startServices?: boolean
212
+ servicesBinaryPath?: string
193
213
  engineHost?: string
194
214
  enginePort?: number
195
215
  handleInspectorHttpInRuntime?: boolean
@@ -301,6 +321,7 @@ export declare class ActorContext {
301
321
  takePendingHibernationChanges(): Array<string>
302
322
  dirtyHibernatableConns(): Array<ConnHandle>
303
323
  saveState(payload: StateDeltaPayload): Promise<void>
324
+ beginStateTransaction(timeoutMs?: number | undefined | null): Promise<JsActorStateTransaction>
304
325
  saveStateAndWorkflowBatch(writes: Array<WorkflowKvWritePayload>): Promise<void>
305
326
  actorId(): string
306
327
  name(): string
@@ -315,6 +336,7 @@ export declare class ActorContext {
315
336
  aborted(): boolean
316
337
  runHandlerActive(): boolean
317
338
  restartRunHandler(): void
339
+ setRunWakeAt(timestampMs?: number | undefined | null): Promise<void>
318
340
  beginKeepAwake(): number
319
341
  endKeepAwake(regionId: number): void
320
342
  keepAwake(promise: Promise<any>): void
@@ -360,7 +382,7 @@ export declare class JsNativeDatabase {
360
382
  executeBatch(statements: Array<JsSqliteBatchStatement>): Promise<Array<NativeExecuteResult>>
361
383
  exec(sql: string): Promise<QueryResult>
362
384
  close(): Promise<void>
363
- beginTransaction(timeoutMs?: number | undefined | null): Promise<JsSqliteTransaction>
385
+ beginTransaction(timeoutMs?: number | undefined | null, name?: string | undefined | null): Promise<JsSqliteTransaction>
364
386
  }
365
387
  export declare class JsSqliteTransaction {
366
388
  execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
@@ -368,6 +390,11 @@ export declare class JsSqliteTransaction {
368
390
  commit(): Promise<void>
369
391
  rollback(): Promise<void>
370
392
  }
393
+ export declare class JsActorStateTransaction {
394
+ execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
395
+ commit(payload: StateDeltaPayload): Promise<void>
396
+ rollback(): Promise<void>
397
+ }
371
398
  /** JavaScript-facing writer for a streaming actor HTTP response. */
372
399
  export declare class HttpResponseBodyStream {
373
400
  cancelled(): Promise<void>
@@ -397,6 +424,7 @@ export declare class Queue {
397
424
  nextBatch(options?: JsQueueNextBatchOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Array<QueueMessage>>
398
425
  waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage>
399
426
  waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<void>
427
+ completePersisted(messageId: bigint, expectedName: string, response?: Buffer | undefined | null): Promise<boolean>
400
428
  enqueueAndWait(name: string, body: Buffer, options?: JsQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Buffer | null>
401
429
  tryNext(options?: JsQueueTryNextOptions | undefined | null): QueueMessage | null
402
430
  tryNextBatch(options?: JsQueueTryNextBatchOptions | undefined | null): Array<QueueMessage>
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { ActorContext, decodeInspectorRequest, encodeInspectorResponse, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, JsSqliteTransaction, HttpResponseBodyStream, HttpRequestBodyStream, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket } = nativeBinding
313
+ const { ActorContext, decodeInspectorRequest, encodeInspectorResponse, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, JsSqliteTransaction, JsActorStateTransaction, HttpResponseBodyStream, HttpRequestBodyStream, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket } = nativeBinding
314
314
 
315
315
  module.exports.ActorContext = ActorContext
316
316
  module.exports.decodeInspectorRequest = decodeInspectorRequest
@@ -320,6 +320,7 @@ module.exports.CancellationToken = CancellationToken
320
320
  module.exports.ConnHandle = ConnHandle
321
321
  module.exports.JsNativeDatabase = JsNativeDatabase
322
322
  module.exports.JsSqliteTransaction = JsSqliteTransaction
323
+ module.exports.JsActorStateTransaction = JsActorStateTransaction
323
324
  module.exports.HttpResponseBodyStream = HttpResponseBodyStream
324
325
  module.exports.HttpRequestBodyStream = HttpRequestBodyStream
325
326
  module.exports.Kv = Kv
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-napi",
3
- "version": "0.0.0-main.4994268",
3
+ "version": "0.0.0-main.78336a1",
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",
@@ -44,14 +44,19 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@napi-rs/cli": "^2.18.4",
47
- "@rivetkit/engine-envoy-protocol": "0.0.0-main.4994268"
47
+ "@rivetkit/engine-envoy-protocol": "0.0.0-main.78336a1"
48
+ },
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "https://github.com/rivet-dev/actors.git",
52
+ "directory": "rivetkit-typescript/packages/rivetkit-napi"
48
53
  },
49
54
  "optionalDependencies": {
50
- "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-main.4994268",
51
- "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-main.4994268",
52
- "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-main.4994268",
53
- "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-main.4994268",
54
- "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-main.4994268",
55
- "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-main.4994268"
55
+ "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-main.78336a1",
56
+ "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-main.78336a1",
57
+ "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-main.78336a1",
58
+ "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-main.78336a1",
59
+ "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-main.78336a1",
60
+ "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-main.78336a1"
56
61
  }
57
62
  }