rivetkit 0.0.0-sqlite-query-metrics-v2.f5d3605 → 0.0.0-sqlite-sync-3-0-1-release.95f6e2d
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/dist/browser/client.d.ts +99 -59
- package/dist/browser/client.js +228 -34
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-3URZ4UV5.js → chunk-2HWY7FZU.js} +2 -2
- package/dist/tsup/{chunk-PJ5EXY6F.js → chunk-62WFU3BQ.js} +223 -42
- package/dist/tsup/chunk-62WFU3BQ.js.map +1 -0
- package/dist/tsup/{chunk-JI6GZ2C2.js → chunk-A2CF6PFH.js} +18 -1
- package/dist/tsup/chunk-A2CF6PFH.js.map +1 -0
- package/dist/tsup/{chunk-KDT56V3Y.cjs → chunk-AQWZWR2P.cjs} +10 -11
- package/dist/tsup/chunk-AQWZWR2P.cjs.map +1 -0
- package/dist/tsup/{chunk-L3Z3W44Q.cjs → chunk-E4KDQJCR.cjs} +3 -3
- package/dist/tsup/{chunk-L3Z3W44Q.cjs.map → chunk-E4KDQJCR.cjs.map} +1 -1
- package/dist/tsup/{chunk-DHL2M2E2.cjs → chunk-E6HKVCPA.cjs} +3 -3
- package/dist/tsup/{chunk-DHL2M2E2.cjs.map → chunk-E6HKVCPA.cjs.map} +1 -1
- package/dist/tsup/{chunk-DDS7OOVF.cjs → chunk-EQBUH25O.cjs} +362 -181
- package/dist/tsup/chunk-EQBUH25O.cjs.map +1 -0
- package/dist/tsup/{chunk-USKGKQZM.js → chunk-HQHTTJW5.js} +10 -11
- package/dist/tsup/chunk-HQHTTJW5.js.map +1 -0
- package/dist/tsup/{chunk-JW2WPE6Z.cjs → chunk-M5SQGPRJ.cjs} +4 -4
- package/dist/tsup/{chunk-JW2WPE6Z.cjs.map → chunk-M5SQGPRJ.cjs.map} +1 -1
- package/dist/tsup/{chunk-FYDB45YU.cjs → chunk-MYWNJP55.cjs} +10 -10
- package/dist/tsup/{chunk-FYDB45YU.cjs.map → chunk-MYWNJP55.cjs.map} +1 -1
- package/dist/tsup/{chunk-F7IGTKGM.js → chunk-OWZ76NSH.js} +2 -2
- package/dist/tsup/{chunk-KSP3NXGY.js → chunk-QE5MTZHB.js} +3 -3
- package/dist/tsup/{chunk-D4G35VTO.js → chunk-QFZY2CK3.js} +4 -4
- package/dist/tsup/{chunk-E2CUROR3.js → chunk-QIIIRYN7.js} +2 -2
- package/dist/tsup/{chunk-MYWZCDML.cjs → chunk-RTWH3AX3.cjs} +19 -2
- package/dist/tsup/chunk-RTWH3AX3.cjs.map +1 -0
- package/dist/tsup/{chunk-HO76AEDH.cjs → chunk-UHMB5FFB.cjs} +3 -3
- package/dist/tsup/{chunk-HO76AEDH.cjs.map → chunk-UHMB5FFB.cjs.map} +1 -1
- package/dist/tsup/{chunk-QR6EAWEC.cjs → chunk-VKXEBB3Z.cjs} +7 -7
- package/dist/tsup/{chunk-QR6EAWEC.cjs.map → chunk-VKXEBB3Z.cjs.map} +1 -1
- package/dist/tsup/{chunk-EPRA2TCT.js → chunk-ZMVYZ7ZI.js} +2 -2
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +15 -3
- package/dist/tsup/client/mod.d.ts +15 -3
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-Cw_BwH_G.d.ts → config-B4erdavw.d.ts} +58 -12
- package/dist/tsup/{config-D4clT6mq.d.ts → config-BfG1qpYz.d.cts} +34 -52
- package/dist/tsup/{config-D4clT6mq.d.cts → config-BfG1qpYz.d.ts} +34 -52
- package/dist/tsup/{config-CkmVg2fG.d.cts → config-DK144OAw.d.cts} +58 -12
- package/dist/tsup/{context-_xIcgBnE.d.cts → context-Cvnf3BRe.d.cts} +2 -2
- package/dist/tsup/{context-BYOKTQJi.d.ts → context-Oxi6YWcG.d.ts} +2 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.d.cts +1 -1
- package/dist/tsup/db/drizzle.d.ts +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.d.cts +2 -2
- package/dist/tsup/db/mod.d.ts +2 -2
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/mod.cjs +553 -202
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +467 -116
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/unstable/migrations.d.cts +1 -1
- package/dist/tsup/unstable/migrations.d.ts +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +22 -19
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +10 -7
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +9 -10
- package/src/actor/keys.ts +86 -0
- package/src/client/actor-conn.ts +136 -24
- package/src/client/actor-handle.ts +21 -3
- package/src/client/client.ts +6 -0
- package/src/client/config.ts +12 -1
- package/src/client/lifecycle-errors.ts +35 -2
- package/src/client/retry-budget.ts +78 -0
- package/src/client/utils.ts +13 -2
- package/src/common/database/config.ts +46 -52
- package/src/common/database/native-database.ts +247 -27
- package/src/common/router.ts +1 -1
- package/src/db/mod.ts +0 -1
- package/src/engine-api/actors.ts +3 -3
- package/src/engine-client/actor-websocket-client.ts +4 -2
- package/src/engine-client/api-endpoints.ts +44 -14
- package/src/engine-client/mod.ts +2 -2
- package/src/registry/config/envoy.ts +1 -1
- package/src/registry/config/index.ts +29 -31
- package/src/registry/index.ts +66 -21
- package/src/registry/napi-runtime.ts +82 -3
- package/src/registry/native.ts +184 -52
- package/src/registry/runtime.ts +79 -10
- package/src/registry/wasm-runtime.ts +94 -3
- package/src/utils/env-vars.ts +15 -10
- package/src/workflow/driver.ts +5 -3
- package/dist/tsup/chunk-DDS7OOVF.cjs.map +0 -1
- package/dist/tsup/chunk-JI6GZ2C2.js.map +0 -1
- package/dist/tsup/chunk-KDT56V3Y.cjs.map +0 -1
- package/dist/tsup/chunk-MYWZCDML.cjs.map +0 -1
- package/dist/tsup/chunk-PJ5EXY6F.js.map +0 -1
- package/dist/tsup/chunk-USKGKQZM.js.map +0 -1
- package/src/actor/config.test.ts +0 -78
- package/src/actor/keys.test.ts +0 -275
- package/src/actor/utils.test.ts +0 -48
- package/src/client/test.ts +0 -44
- package/src/client/token-provider.test.ts +0 -86
- package/src/common/database/mod.test.ts +0 -364
- package/src/common/database/native-database.test.ts +0 -220
- package/src/common/inline-websocket-adapter.test.ts +0 -51
- package/src/db/drizzle.test.ts +0 -164
- package/src/registry/config/index.test.ts +0 -25
- package/src/registry/run-handler-coordinator.test.ts +0 -252
- package/src/registry/runtime.test.ts +0 -124
- package/src/unstable/migrations.test.ts +0 -170
- package/src/utils/endpoint-parser.test.ts +0 -206
- package/src/utils.test.ts +0 -34
- package/src/workflow/driver.test.ts +0 -62
- /package/dist/tsup/{chunk-3URZ4UV5.js.map → chunk-2HWY7FZU.js.map} +0 -0
- /package/dist/tsup/{chunk-F7IGTKGM.js.map → chunk-OWZ76NSH.js.map} +0 -0
- /package/dist/tsup/{chunk-KSP3NXGY.js.map → chunk-QE5MTZHB.js.map} +0 -0
- /package/dist/tsup/{chunk-D4G35VTO.js.map → chunk-QFZY2CK3.js.map} +0 -0
- /package/dist/tsup/{chunk-E2CUROR3.js.map → chunk-QIIIRYN7.js.map} +0 -0
- /package/dist/tsup/{chunk-EPRA2TCT.js.map → chunk-ZMVYZ7ZI.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-
|
|
2
|
+
import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-BfG1qpYz.js';
|
|
3
3
|
import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
|
|
4
4
|
import { z as z$1 } from 'zod';
|
|
5
5
|
import { Logger } from 'pino';
|
|
@@ -182,11 +182,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
182
182
|
publicEndpoint: z$1.ZodPipe<z$1.ZodOptional<z$1.ZodString>, z$1.ZodTransform<string | undefined, string | undefined>>;
|
|
183
183
|
publicToken: z$1.ZodPipe<z$1.ZodOptional<z$1.ZodString>, z$1.ZodTransform<string | undefined, string | undefined>>;
|
|
184
184
|
}, z$1.core.$strip>>>;
|
|
185
|
-
|
|
185
|
+
node: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
186
186
|
poolName: z$1.ZodDefault<z$1.ZodString>;
|
|
187
187
|
version: z$1.ZodDefault<z$1.ZodNumber>;
|
|
188
188
|
totalSlots: z$1.ZodDefault<z$1.ZodNumber>;
|
|
189
|
-
|
|
189
|
+
nodeKey: z$1.ZodOptional<z$1.ZodString>;
|
|
190
190
|
}, z$1.core.$strip>>>;
|
|
191
191
|
shutdown: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
192
192
|
gracePeriodMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
@@ -197,6 +197,7 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
197
197
|
backend: "local" | "remote";
|
|
198
198
|
} | undefined;
|
|
199
199
|
endpoint: string | undefined;
|
|
200
|
+
engineSpawn: boolean;
|
|
200
201
|
startServices: boolean;
|
|
201
202
|
namespace: string;
|
|
202
203
|
token: string | undefined;
|
|
@@ -234,11 +235,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
234
235
|
engineHost: string;
|
|
235
236
|
enginePort: number;
|
|
236
237
|
engineVersion: string;
|
|
237
|
-
|
|
238
|
+
node: {
|
|
238
239
|
poolName: string;
|
|
239
240
|
version: number;
|
|
240
241
|
totalSlots: number;
|
|
241
|
-
|
|
242
|
+
nodeKey?: string | undefined;
|
|
242
243
|
};
|
|
243
244
|
shutdown: {
|
|
244
245
|
disableSignalHandlers: boolean;
|
|
@@ -293,11 +294,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
293
294
|
publicEndpoint: string | undefined;
|
|
294
295
|
publicToken: string | undefined;
|
|
295
296
|
};
|
|
296
|
-
|
|
297
|
+
node: {
|
|
297
298
|
poolName: string;
|
|
298
299
|
version: number;
|
|
299
300
|
totalSlots: number;
|
|
300
|
-
|
|
301
|
+
nodeKey?: string | undefined;
|
|
301
302
|
};
|
|
302
303
|
shutdown: {
|
|
303
304
|
disableSignalHandlers: boolean;
|
|
@@ -343,7 +344,7 @@ declare const DocServerlessConfigSchema: z$1.ZodObject<{
|
|
|
343
344
|
declare const DocEnvoyConfigSchema: z$1.ZodObject<{
|
|
344
345
|
totalSlots: z$1.ZodOptional<z$1.ZodNumber>;
|
|
345
346
|
poolName: z$1.ZodOptional<z$1.ZodString>;
|
|
346
|
-
|
|
347
|
+
nodeKey: z$1.ZodOptional<z$1.ZodString>;
|
|
347
348
|
version: z$1.ZodOptional<z$1.ZodNumber>;
|
|
348
349
|
}, z$1.core.$strip>;
|
|
349
350
|
declare const DocSqliteConfigSchema: z$1.ZodOptional<z$1.ZodObject<{
|
|
@@ -401,10 +402,10 @@ declare const DocRegistryConfigSchema: z$1.ZodObject<{
|
|
|
401
402
|
publicEndpoint: z$1.ZodOptional<z$1.ZodString>;
|
|
402
403
|
publicToken: z$1.ZodOptional<z$1.ZodString>;
|
|
403
404
|
}, z$1.core.$strip>>;
|
|
404
|
-
|
|
405
|
+
node: z$1.ZodOptional<z$1.ZodObject<{
|
|
405
406
|
totalSlots: z$1.ZodOptional<z$1.ZodNumber>;
|
|
406
407
|
poolName: z$1.ZodOptional<z$1.ZodString>;
|
|
407
|
-
|
|
408
|
+
nodeKey: z$1.ZodOptional<z$1.ZodString>;
|
|
408
409
|
version: z$1.ZodOptional<z$1.ZodNumber>;
|
|
409
410
|
}, z$1.core.$strip>>;
|
|
410
411
|
}, z$1.core.$strip>;
|
|
@@ -815,6 +816,7 @@ interface RuntimeActorConfig {
|
|
|
815
816
|
icon?: string;
|
|
816
817
|
hasDatabase?: boolean;
|
|
817
818
|
remoteSqlite?: boolean;
|
|
819
|
+
sqliteDeferredCommits?: boolean;
|
|
818
820
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
819
821
|
tracing?: RuntimeActorTracingConfig;
|
|
820
822
|
enableActorRuntimeSocket?: boolean;
|
|
@@ -872,6 +874,8 @@ interface RuntimeServeConfig {
|
|
|
872
874
|
engineBinaryPath?: string;
|
|
873
875
|
startServices?: boolean;
|
|
874
876
|
servicesBinaryPath?: string;
|
|
877
|
+
/** Whether config resolution selected a managed local development engine. */
|
|
878
|
+
engineSpawn?: boolean;
|
|
875
879
|
engineHost?: string;
|
|
876
880
|
enginePort?: number;
|
|
877
881
|
handleInspectorHttpInRuntime?: boolean;
|
|
@@ -960,7 +964,12 @@ interface CoreRuntime {
|
|
|
960
964
|
createCancellationToken(): CancellationTokenHandle;
|
|
961
965
|
cancellationTokenAborted(token: CancellationTokenHandle): boolean;
|
|
962
966
|
cancelCancellationToken(token: CancellationTokenHandle): void;
|
|
963
|
-
|
|
967
|
+
/**
|
|
968
|
+
* Calls `callback` once when `token` is cancelled. Returns a release
|
|
969
|
+
* function that drops the registration without calling `callback`; call it
|
|
970
|
+
* once cancellation no longer matters so the native listener is freed.
|
|
971
|
+
*/
|
|
972
|
+
onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): () => void;
|
|
964
973
|
actorState(ctx: ActorContextHandle): RuntimeBytes;
|
|
965
974
|
actorBeginOnStateChange(ctx: ActorContextHandle): void;
|
|
966
975
|
actorEndOnStateChange(ctx: ActorContextHandle): void;
|
|
@@ -1034,13 +1043,20 @@ interface CoreRuntime {
|
|
|
1034
1043
|
actorKvBatchPut(ctx: ActorContextHandle, entries: RuntimeKvEntry[]): Promise<void>;
|
|
1035
1044
|
actorKvBatchDelete(ctx: ActorContextHandle, keys: RuntimeBytes[]): Promise<void>;
|
|
1036
1045
|
actorSqlExec(ctx: ActorContextHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
1046
|
+
actorSqlExecSync(ctx: ActorContextHandle, sql: string): RuntimeSqlExecResult;
|
|
1037
1047
|
actorSqlExecute(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
1048
|
+
actorSqlExecuteSync(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
|
|
1038
1049
|
actorSqlExecuteBatch(ctx: ActorContextHandle, statements: RuntimeSqlBatchStatement[]): Promise<RuntimeSqlExecuteResult[]>;
|
|
1039
1050
|
actorSqlBeginTransaction(ctx: ActorContextHandle, timeoutMs?: number, name?: string): Promise<SqliteTransactionHandle>;
|
|
1051
|
+
actorSqlBeginTransactionSync(ctx: ActorContextHandle, timeoutMs?: number, name?: string): SqliteTransactionHandle;
|
|
1040
1052
|
actorSqlTransactionExec(transaction: SqliteTransactionHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
1053
|
+
actorSqlTransactionExecSync(transaction: SqliteTransactionHandle, sql: string): RuntimeSqlExecResult;
|
|
1041
1054
|
actorSqlTransactionExecute(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
1055
|
+
actorSqlTransactionExecuteSync(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
|
|
1042
1056
|
actorSqlTransactionCommit(transaction: SqliteTransactionHandle): Promise<void>;
|
|
1057
|
+
actorSqlTransactionCommitSync(transaction: SqliteTransactionHandle): void;
|
|
1043
1058
|
actorSqlTransactionRollback(transaction: SqliteTransactionHandle): Promise<void>;
|
|
1059
|
+
actorSqlTransactionRollbackSync(transaction: SqliteTransactionHandle): void;
|
|
1044
1060
|
actorBeginStateTransaction(ctx: ActorContextHandle, timeoutMs?: number): Promise<ActorStateTransactionHandle>;
|
|
1045
1061
|
actorStateTransactionExecute(transaction: ActorStateTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
1046
1062
|
actorStateTransactionCommit(transaction: ActorStateTransactionHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
|
|
@@ -1049,6 +1065,13 @@ interface CoreRuntime {
|
|
|
1049
1065
|
actorSqlRun(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlRunResult>;
|
|
1050
1066
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
1051
1067
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
1068
|
+
/** Opens the actor database so later synchronous calls never fetch its first pages. */
|
|
1069
|
+
actorSqlOpen(ctx: ActorContextHandle): Promise<void>;
|
|
1070
|
+
/** Returns the ticket of the latest local commit. */
|
|
1071
|
+
actorSqlCommitTicket(ctx: ActorContextHandle): number;
|
|
1072
|
+
/** Resolves once the commit `ticket` names and every earlier commit are durable. */
|
|
1073
|
+
actorSqlWhenDurable(ctx: ActorContextHandle, ticket: number): Promise<void>;
|
|
1074
|
+
actorSqlAbortGeneration(ctx: ActorContextHandle, reason: string): void;
|
|
1052
1075
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
1053
1076
|
actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
1054
1077
|
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
@@ -1463,6 +1486,27 @@ declare class ActorConnRaw {
|
|
|
1463
1486
|
*/
|
|
1464
1487
|
type ActorConn<AD extends AnyActorDefinition> = Omit<ActorConnRaw, "send" | "on" | "once"> & ActorDefinitionQueueSend<AD> & ActorDefinitionEventSubscriptions<AD> & ActorDefinitionActions<AD>;
|
|
1465
1488
|
|
|
1489
|
+
/** How many retries a client may spend, as a share of the requests it sends. */
|
|
1490
|
+
interface RetryBudgetOptions {
|
|
1491
|
+
/** Retries allowed per 100 requests (default 10). */
|
|
1492
|
+
percent?: number;
|
|
1493
|
+
/** Retries the client can bank for a burst of refusals; the budget starts full (default 100). */
|
|
1494
|
+
maxTokens?: number;
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Bounds the client's retries of refused requests. Each request adds a fraction of a token and
|
|
1498
|
+
* each retry spends one, so retries stay a fixed share of traffic while the service sheds load
|
|
1499
|
+
* instead of multiplying it.
|
|
1500
|
+
*/
|
|
1501
|
+
declare class RetryBudget {
|
|
1502
|
+
#private;
|
|
1503
|
+
constructor(options?: RetryBudgetOptions);
|
|
1504
|
+
/** Credits one request sent. */
|
|
1505
|
+
deposit(): void;
|
|
1506
|
+
/** Spends one token. Returns `false` when the budget is spent. */
|
|
1507
|
+
tryWithdraw(): boolean;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1466
1510
|
/**
|
|
1467
1511
|
* Provides underlying functions for stateless {@link ActorHandle} for action calls.
|
|
1468
1512
|
* Similar to ActorConnRaw but doesn't maintain a connection.
|
|
@@ -1478,7 +1522,7 @@ declare class ActorHandleRaw {
|
|
|
1478
1522
|
*
|
|
1479
1523
|
* @protected
|
|
1480
1524
|
*/
|
|
1481
|
-
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan);
|
|
1525
|
+
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
|
|
1482
1526
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1483
1527
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1484
1528
|
/**
|
|
@@ -1685,6 +1729,8 @@ declare const CREATE_ACTOR_CONN_PROXY: unique symbol;
|
|
|
1685
1729
|
interface ClientRawOptions {
|
|
1686
1730
|
encoding?: Encoding;
|
|
1687
1731
|
gateway?: ActorGatewayOptions;
|
|
1732
|
+
/** Bounds retries of refused requests across every handle of this client. */
|
|
1733
|
+
retryBudget?: RetryBudgetOptions;
|
|
1688
1734
|
}
|
|
1689
1735
|
/** Runtime-supplied wiring for clients created inside an actor. Set only by the native runtime. */
|
|
1690
1736
|
interface ActorClientRuntimeOptions {
|
|
@@ -41,18 +41,13 @@ interface SqliteTransactionOptions {
|
|
|
41
41
|
* to change without notice.
|
|
42
42
|
*/
|
|
43
43
|
interface SqliteProfilingOptions {
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
metrics?: SqliteProfilingMetricsOptions;
|
|
52
|
-
/** Duration buckets in seconds. Default [0.01, 0.1, 1]. Positive, finite, strictly increasing.
|
|
53
|
-
* All actors in a process enabling the duration histogram must use identical buckets. */
|
|
54
|
-
durationHistogramBucketsSeconds?: number[];
|
|
55
|
-
/** Maximum distinct statement fingerprints per process. Default: 512. */
|
|
44
|
+
/** Exact SQL statements to give fingerprint labels. Profiling defaults to actor
|
|
45
|
+
* aggregates without fingerprint labels. Profile logs remain enabled.
|
|
46
|
+
* RIVETKIT_SQLITE_PROFILING overrides selection with a JSON object containing
|
|
47
|
+
* queries and/or fingerprints arrays. An empty object clears fingerprint selection. */
|
|
48
|
+
queries?: string[];
|
|
49
|
+
/** Exact query fingerprints to label separately, as reported in profile logs. */
|
|
50
|
+
fingerprints?: string[];
|
|
56
51
|
maxTrackedStatementFingerprints?: number;
|
|
57
52
|
maxTrackedTransactionFingerprints?: number;
|
|
58
53
|
maxPrometheusSeries?: number;
|
|
@@ -64,45 +59,6 @@ interface SqliteProfilingOptions {
|
|
|
64
59
|
maxDiagnosticEventsPerMinute?: number;
|
|
65
60
|
diagnosticEventQueueCapacity?: number;
|
|
66
61
|
}
|
|
67
|
-
/** SQLite profiling metrics. Physical-request metrics and gauges have no query labels. */
|
|
68
|
-
interface SqliteProfilingMetricsOptions {
|
|
69
|
-
/** Execution count and cumulative seconds. Uses histogram count/sum when enabled, otherwise counters. Default: true. */
|
|
70
|
-
duration?: boolean;
|
|
71
|
-
/** Execution duration histogram. Only applies when duration is enabled. Default: true. */
|
|
72
|
-
durationHistogram?: boolean;
|
|
73
|
-
/** Outcome counters, including success and errors. Default: true. */
|
|
74
|
-
outcomes?: boolean;
|
|
75
|
-
/** Per-query timing phase histograms. Default: false. */
|
|
76
|
-
phaseDurationHistogram?: boolean;
|
|
77
|
-
/** Storage round trips per operation histogram. Default: false. */
|
|
78
|
-
getPagesRoundTripsHistogram?: boolean;
|
|
79
|
-
/** Statements per transaction histogram. Default: false. */
|
|
80
|
-
transactionStatementCountHistogram?: boolean;
|
|
81
|
-
/** Per-query pages returned from storage, including returned prefetch pages. Default: true. */
|
|
82
|
-
pagesFetched?: boolean;
|
|
83
|
-
/** Actor-level page counters by page kind (no query labels). Default: false. */
|
|
84
|
-
localPages?: boolean;
|
|
85
|
-
/** Actor-level byte counters by byte kind (no query labels). Default: false. */
|
|
86
|
-
localBytes?: boolean;
|
|
87
|
-
/** Actor-level physical storage request duration histogram. Default: false. */
|
|
88
|
-
getPagesDurationHistogram?: boolean;
|
|
89
|
-
/** Actor-level pages per storage request histograms, by page kind. Default: false. */
|
|
90
|
-
getPagesPagesHistogram?: boolean;
|
|
91
|
-
/** Actor-level storage response byte histogram. Default: false. */
|
|
92
|
-
getPagesResponseBytesHistogram?: boolean;
|
|
93
|
-
/** Actor-level missing response page counter. Default: false. */
|
|
94
|
-
getPagesMissingPages?: boolean;
|
|
95
|
-
/** Queued SQLite work, aggregated by actor name. Default: true. */
|
|
96
|
-
workerQueueDepth?: boolean;
|
|
97
|
-
/** Executing SQLite work, aggregated by actor name. Default: true. */
|
|
98
|
-
workerInflight?: boolean;
|
|
99
|
-
/** Transaction waiters, aggregated by actor name. Default: true. */
|
|
100
|
-
coordinatorQueueDepth?: boolean;
|
|
101
|
-
/** Counts observations exceeding fingerprint or series limits. Default: true. */
|
|
102
|
-
fingerprintOverflow?: boolean;
|
|
103
|
-
/** Counts diagnostic events dropped by rate limits or backpressure. Default: true. */
|
|
104
|
-
eventDropped?: boolean;
|
|
105
|
-
}
|
|
106
62
|
interface SqliteNativeMetrics {
|
|
107
63
|
requestBuildNs: number;
|
|
108
64
|
serializeNs: number;
|
|
@@ -118,20 +74,46 @@ interface SqliteNativeMetrics {
|
|
|
118
74
|
}
|
|
119
75
|
interface SqliteDatabase {
|
|
120
76
|
exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
|
|
77
|
+
execSync?(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
|
|
121
78
|
execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
|
|
79
|
+
executeSync?(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
122
80
|
executeBatch(statements: SqliteBatchStatement[]): Promise<SqliteExecuteResult[]>;
|
|
123
81
|
beginTransaction(timeoutMs?: number, name?: string): Promise<SqliteTransactionDatabase>;
|
|
82
|
+
beginTransactionSync?(timeoutMs?: number, name?: string): SynchronousSqliteTransactionDatabase;
|
|
124
83
|
run(sql: string, params?: SqliteBindings): Promise<void>;
|
|
125
84
|
query(sql: string, params?: SqliteBindings): Promise<SqliteQueryResult>;
|
|
126
85
|
nativeMetrics?(): SqliteNativeMetrics | Promise<SqliteNativeMetrics | null> | null;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the ticket of the latest local commit. Synchronous writes return before they are
|
|
88
|
+
* durable; pass the ticket to `whenDurable` before releasing output that depends on them.
|
|
89
|
+
*/
|
|
90
|
+
commitTicket?(): number;
|
|
91
|
+
/**
|
|
92
|
+
* Resolves once the commit `ticket` names and every earlier commit are durable. Rejects with
|
|
93
|
+
* `sqlite.durability_failed` once the database broke and the actor is restarting.
|
|
94
|
+
*/
|
|
95
|
+
whenDurable?(ticket: number): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Restarts the owning actor from durable state. Every later write fails, including the final
|
|
98
|
+
* state save. For native database providers whose in-memory state can no longer be trusted.
|
|
99
|
+
*/
|
|
100
|
+
abortGeneration?(reason: string): void;
|
|
127
101
|
close(): Promise<void>;
|
|
128
102
|
}
|
|
129
103
|
interface SqliteTransactionDatabase {
|
|
130
104
|
exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
|
|
105
|
+
execSync?(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
|
|
131
106
|
execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
|
|
107
|
+
executeSync?(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
132
108
|
commit(): Promise<void>;
|
|
133
109
|
rollback(): Promise<void>;
|
|
134
110
|
}
|
|
111
|
+
type SynchronousSqliteTransactionDatabase = SqliteTransactionDatabase & {
|
|
112
|
+
execSync(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
|
|
113
|
+
executeSync(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
114
|
+
commitSync(): void;
|
|
115
|
+
rollbackSync(): void;
|
|
116
|
+
};
|
|
135
117
|
/**
|
|
136
118
|
* Provider for opening native databases from the active runtime.
|
|
137
119
|
*/
|
|
@@ -223,4 +205,4 @@ type RawAccess = {
|
|
|
223
205
|
close: () => Promise<void>;
|
|
224
206
|
};
|
|
225
207
|
|
|
226
|
-
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f,
|
|
208
|
+
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f, SqliteQueryResult as g };
|
|
@@ -41,18 +41,13 @@ interface SqliteTransactionOptions {
|
|
|
41
41
|
* to change without notice.
|
|
42
42
|
*/
|
|
43
43
|
interface SqliteProfilingOptions {
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
metrics?: SqliteProfilingMetricsOptions;
|
|
52
|
-
/** Duration buckets in seconds. Default [0.01, 0.1, 1]. Positive, finite, strictly increasing.
|
|
53
|
-
* All actors in a process enabling the duration histogram must use identical buckets. */
|
|
54
|
-
durationHistogramBucketsSeconds?: number[];
|
|
55
|
-
/** Maximum distinct statement fingerprints per process. Default: 512. */
|
|
44
|
+
/** Exact SQL statements to give fingerprint labels. Profiling defaults to actor
|
|
45
|
+
* aggregates without fingerprint labels. Profile logs remain enabled.
|
|
46
|
+
* RIVETKIT_SQLITE_PROFILING overrides selection with a JSON object containing
|
|
47
|
+
* queries and/or fingerprints arrays. An empty object clears fingerprint selection. */
|
|
48
|
+
queries?: string[];
|
|
49
|
+
/** Exact query fingerprints to label separately, as reported in profile logs. */
|
|
50
|
+
fingerprints?: string[];
|
|
56
51
|
maxTrackedStatementFingerprints?: number;
|
|
57
52
|
maxTrackedTransactionFingerprints?: number;
|
|
58
53
|
maxPrometheusSeries?: number;
|
|
@@ -64,45 +59,6 @@ interface SqliteProfilingOptions {
|
|
|
64
59
|
maxDiagnosticEventsPerMinute?: number;
|
|
65
60
|
diagnosticEventQueueCapacity?: number;
|
|
66
61
|
}
|
|
67
|
-
/** SQLite profiling metrics. Physical-request metrics and gauges have no query labels. */
|
|
68
|
-
interface SqliteProfilingMetricsOptions {
|
|
69
|
-
/** Execution count and cumulative seconds. Uses histogram count/sum when enabled, otherwise counters. Default: true. */
|
|
70
|
-
duration?: boolean;
|
|
71
|
-
/** Execution duration histogram. Only applies when duration is enabled. Default: true. */
|
|
72
|
-
durationHistogram?: boolean;
|
|
73
|
-
/** Outcome counters, including success and errors. Default: true. */
|
|
74
|
-
outcomes?: boolean;
|
|
75
|
-
/** Per-query timing phase histograms. Default: false. */
|
|
76
|
-
phaseDurationHistogram?: boolean;
|
|
77
|
-
/** Storage round trips per operation histogram. Default: false. */
|
|
78
|
-
getPagesRoundTripsHistogram?: boolean;
|
|
79
|
-
/** Statements per transaction histogram. Default: false. */
|
|
80
|
-
transactionStatementCountHistogram?: boolean;
|
|
81
|
-
/** Per-query pages returned from storage, including returned prefetch pages. Default: true. */
|
|
82
|
-
pagesFetched?: boolean;
|
|
83
|
-
/** Actor-level page counters by page kind (no query labels). Default: false. */
|
|
84
|
-
localPages?: boolean;
|
|
85
|
-
/** Actor-level byte counters by byte kind (no query labels). Default: false. */
|
|
86
|
-
localBytes?: boolean;
|
|
87
|
-
/** Actor-level physical storage request duration histogram. Default: false. */
|
|
88
|
-
getPagesDurationHistogram?: boolean;
|
|
89
|
-
/** Actor-level pages per storage request histograms, by page kind. Default: false. */
|
|
90
|
-
getPagesPagesHistogram?: boolean;
|
|
91
|
-
/** Actor-level storage response byte histogram. Default: false. */
|
|
92
|
-
getPagesResponseBytesHistogram?: boolean;
|
|
93
|
-
/** Actor-level missing response page counter. Default: false. */
|
|
94
|
-
getPagesMissingPages?: boolean;
|
|
95
|
-
/** Queued SQLite work, aggregated by actor name. Default: true. */
|
|
96
|
-
workerQueueDepth?: boolean;
|
|
97
|
-
/** Executing SQLite work, aggregated by actor name. Default: true. */
|
|
98
|
-
workerInflight?: boolean;
|
|
99
|
-
/** Transaction waiters, aggregated by actor name. Default: true. */
|
|
100
|
-
coordinatorQueueDepth?: boolean;
|
|
101
|
-
/** Counts observations exceeding fingerprint or series limits. Default: true. */
|
|
102
|
-
fingerprintOverflow?: boolean;
|
|
103
|
-
/** Counts diagnostic events dropped by rate limits or backpressure. Default: true. */
|
|
104
|
-
eventDropped?: boolean;
|
|
105
|
-
}
|
|
106
62
|
interface SqliteNativeMetrics {
|
|
107
63
|
requestBuildNs: number;
|
|
108
64
|
serializeNs: number;
|
|
@@ -118,20 +74,46 @@ interface SqliteNativeMetrics {
|
|
|
118
74
|
}
|
|
119
75
|
interface SqliteDatabase {
|
|
120
76
|
exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
|
|
77
|
+
execSync?(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
|
|
121
78
|
execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
|
|
79
|
+
executeSync?(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
122
80
|
executeBatch(statements: SqliteBatchStatement[]): Promise<SqliteExecuteResult[]>;
|
|
123
81
|
beginTransaction(timeoutMs?: number, name?: string): Promise<SqliteTransactionDatabase>;
|
|
82
|
+
beginTransactionSync?(timeoutMs?: number, name?: string): SynchronousSqliteTransactionDatabase;
|
|
124
83
|
run(sql: string, params?: SqliteBindings): Promise<void>;
|
|
125
84
|
query(sql: string, params?: SqliteBindings): Promise<SqliteQueryResult>;
|
|
126
85
|
nativeMetrics?(): SqliteNativeMetrics | Promise<SqliteNativeMetrics | null> | null;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the ticket of the latest local commit. Synchronous writes return before they are
|
|
88
|
+
* durable; pass the ticket to `whenDurable` before releasing output that depends on them.
|
|
89
|
+
*/
|
|
90
|
+
commitTicket?(): number;
|
|
91
|
+
/**
|
|
92
|
+
* Resolves once the commit `ticket` names and every earlier commit are durable. Rejects with
|
|
93
|
+
* `sqlite.durability_failed` once the database broke and the actor is restarting.
|
|
94
|
+
*/
|
|
95
|
+
whenDurable?(ticket: number): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Restarts the owning actor from durable state. Every later write fails, including the final
|
|
98
|
+
* state save. For native database providers whose in-memory state can no longer be trusted.
|
|
99
|
+
*/
|
|
100
|
+
abortGeneration?(reason: string): void;
|
|
127
101
|
close(): Promise<void>;
|
|
128
102
|
}
|
|
129
103
|
interface SqliteTransactionDatabase {
|
|
130
104
|
exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
|
|
105
|
+
execSync?(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
|
|
131
106
|
execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
|
|
107
|
+
executeSync?(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
132
108
|
commit(): Promise<void>;
|
|
133
109
|
rollback(): Promise<void>;
|
|
134
110
|
}
|
|
111
|
+
type SynchronousSqliteTransactionDatabase = SqliteTransactionDatabase & {
|
|
112
|
+
execSync(sql: string, callback?: (row: unknown[], columns: string[]) => void): void;
|
|
113
|
+
executeSync(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
114
|
+
commitSync(): void;
|
|
115
|
+
rollbackSync(): void;
|
|
116
|
+
};
|
|
135
117
|
/**
|
|
136
118
|
* Provider for opening native databases from the active runtime.
|
|
137
119
|
*/
|
|
@@ -223,4 +205,4 @@ type RawAccess = {
|
|
|
223
205
|
close: () => Promise<void>;
|
|
224
206
|
};
|
|
225
207
|
|
|
226
|
-
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f,
|
|
208
|
+
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f, SqliteQueryResult as g };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-
|
|
2
|
+
import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-BfG1qpYz.cjs';
|
|
3
3
|
import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
|
|
4
4
|
import { z as z$1 } from 'zod';
|
|
5
5
|
import { Logger } from 'pino';
|
|
@@ -182,11 +182,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
182
182
|
publicEndpoint: z$1.ZodPipe<z$1.ZodOptional<z$1.ZodString>, z$1.ZodTransform<string | undefined, string | undefined>>;
|
|
183
183
|
publicToken: z$1.ZodPipe<z$1.ZodOptional<z$1.ZodString>, z$1.ZodTransform<string | undefined, string | undefined>>;
|
|
184
184
|
}, z$1.core.$strip>>>;
|
|
185
|
-
|
|
185
|
+
node: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
186
186
|
poolName: z$1.ZodDefault<z$1.ZodString>;
|
|
187
187
|
version: z$1.ZodDefault<z$1.ZodNumber>;
|
|
188
188
|
totalSlots: z$1.ZodDefault<z$1.ZodNumber>;
|
|
189
|
-
|
|
189
|
+
nodeKey: z$1.ZodOptional<z$1.ZodString>;
|
|
190
190
|
}, z$1.core.$strip>>>;
|
|
191
191
|
shutdown: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
192
192
|
gracePeriodMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
@@ -197,6 +197,7 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
197
197
|
backend: "local" | "remote";
|
|
198
198
|
} | undefined;
|
|
199
199
|
endpoint: string | undefined;
|
|
200
|
+
engineSpawn: boolean;
|
|
200
201
|
startServices: boolean;
|
|
201
202
|
namespace: string;
|
|
202
203
|
token: string | undefined;
|
|
@@ -234,11 +235,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
234
235
|
engineHost: string;
|
|
235
236
|
enginePort: number;
|
|
236
237
|
engineVersion: string;
|
|
237
|
-
|
|
238
|
+
node: {
|
|
238
239
|
poolName: string;
|
|
239
240
|
version: number;
|
|
240
241
|
totalSlots: number;
|
|
241
|
-
|
|
242
|
+
nodeKey?: string | undefined;
|
|
242
243
|
};
|
|
243
244
|
shutdown: {
|
|
244
245
|
disableSignalHandlers: boolean;
|
|
@@ -293,11 +294,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
293
294
|
publicEndpoint: string | undefined;
|
|
294
295
|
publicToken: string | undefined;
|
|
295
296
|
};
|
|
296
|
-
|
|
297
|
+
node: {
|
|
297
298
|
poolName: string;
|
|
298
299
|
version: number;
|
|
299
300
|
totalSlots: number;
|
|
300
|
-
|
|
301
|
+
nodeKey?: string | undefined;
|
|
301
302
|
};
|
|
302
303
|
shutdown: {
|
|
303
304
|
disableSignalHandlers: boolean;
|
|
@@ -343,7 +344,7 @@ declare const DocServerlessConfigSchema: z$1.ZodObject<{
|
|
|
343
344
|
declare const DocEnvoyConfigSchema: z$1.ZodObject<{
|
|
344
345
|
totalSlots: z$1.ZodOptional<z$1.ZodNumber>;
|
|
345
346
|
poolName: z$1.ZodOptional<z$1.ZodString>;
|
|
346
|
-
|
|
347
|
+
nodeKey: z$1.ZodOptional<z$1.ZodString>;
|
|
347
348
|
version: z$1.ZodOptional<z$1.ZodNumber>;
|
|
348
349
|
}, z$1.core.$strip>;
|
|
349
350
|
declare const DocSqliteConfigSchema: z$1.ZodOptional<z$1.ZodObject<{
|
|
@@ -401,10 +402,10 @@ declare const DocRegistryConfigSchema: z$1.ZodObject<{
|
|
|
401
402
|
publicEndpoint: z$1.ZodOptional<z$1.ZodString>;
|
|
402
403
|
publicToken: z$1.ZodOptional<z$1.ZodString>;
|
|
403
404
|
}, z$1.core.$strip>>;
|
|
404
|
-
|
|
405
|
+
node: z$1.ZodOptional<z$1.ZodObject<{
|
|
405
406
|
totalSlots: z$1.ZodOptional<z$1.ZodNumber>;
|
|
406
407
|
poolName: z$1.ZodOptional<z$1.ZodString>;
|
|
407
|
-
|
|
408
|
+
nodeKey: z$1.ZodOptional<z$1.ZodString>;
|
|
408
409
|
version: z$1.ZodOptional<z$1.ZodNumber>;
|
|
409
410
|
}, z$1.core.$strip>>;
|
|
410
411
|
}, z$1.core.$strip>;
|
|
@@ -815,6 +816,7 @@ interface RuntimeActorConfig {
|
|
|
815
816
|
icon?: string;
|
|
816
817
|
hasDatabase?: boolean;
|
|
817
818
|
remoteSqlite?: boolean;
|
|
819
|
+
sqliteDeferredCommits?: boolean;
|
|
818
820
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
819
821
|
tracing?: RuntimeActorTracingConfig;
|
|
820
822
|
enableActorRuntimeSocket?: boolean;
|
|
@@ -872,6 +874,8 @@ interface RuntimeServeConfig {
|
|
|
872
874
|
engineBinaryPath?: string;
|
|
873
875
|
startServices?: boolean;
|
|
874
876
|
servicesBinaryPath?: string;
|
|
877
|
+
/** Whether config resolution selected a managed local development engine. */
|
|
878
|
+
engineSpawn?: boolean;
|
|
875
879
|
engineHost?: string;
|
|
876
880
|
enginePort?: number;
|
|
877
881
|
handleInspectorHttpInRuntime?: boolean;
|
|
@@ -960,7 +964,12 @@ interface CoreRuntime {
|
|
|
960
964
|
createCancellationToken(): CancellationTokenHandle;
|
|
961
965
|
cancellationTokenAborted(token: CancellationTokenHandle): boolean;
|
|
962
966
|
cancelCancellationToken(token: CancellationTokenHandle): void;
|
|
963
|
-
|
|
967
|
+
/**
|
|
968
|
+
* Calls `callback` once when `token` is cancelled. Returns a release
|
|
969
|
+
* function that drops the registration without calling `callback`; call it
|
|
970
|
+
* once cancellation no longer matters so the native listener is freed.
|
|
971
|
+
*/
|
|
972
|
+
onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): () => void;
|
|
964
973
|
actorState(ctx: ActorContextHandle): RuntimeBytes;
|
|
965
974
|
actorBeginOnStateChange(ctx: ActorContextHandle): void;
|
|
966
975
|
actorEndOnStateChange(ctx: ActorContextHandle): void;
|
|
@@ -1034,13 +1043,20 @@ interface CoreRuntime {
|
|
|
1034
1043
|
actorKvBatchPut(ctx: ActorContextHandle, entries: RuntimeKvEntry[]): Promise<void>;
|
|
1035
1044
|
actorKvBatchDelete(ctx: ActorContextHandle, keys: RuntimeBytes[]): Promise<void>;
|
|
1036
1045
|
actorSqlExec(ctx: ActorContextHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
1046
|
+
actorSqlExecSync(ctx: ActorContextHandle, sql: string): RuntimeSqlExecResult;
|
|
1037
1047
|
actorSqlExecute(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
1048
|
+
actorSqlExecuteSync(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
|
|
1038
1049
|
actorSqlExecuteBatch(ctx: ActorContextHandle, statements: RuntimeSqlBatchStatement[]): Promise<RuntimeSqlExecuteResult[]>;
|
|
1039
1050
|
actorSqlBeginTransaction(ctx: ActorContextHandle, timeoutMs?: number, name?: string): Promise<SqliteTransactionHandle>;
|
|
1051
|
+
actorSqlBeginTransactionSync(ctx: ActorContextHandle, timeoutMs?: number, name?: string): SqliteTransactionHandle;
|
|
1040
1052
|
actorSqlTransactionExec(transaction: SqliteTransactionHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
1053
|
+
actorSqlTransactionExecSync(transaction: SqliteTransactionHandle, sql: string): RuntimeSqlExecResult;
|
|
1041
1054
|
actorSqlTransactionExecute(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
1055
|
+
actorSqlTransactionExecuteSync(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
|
|
1042
1056
|
actorSqlTransactionCommit(transaction: SqliteTransactionHandle): Promise<void>;
|
|
1057
|
+
actorSqlTransactionCommitSync(transaction: SqliteTransactionHandle): void;
|
|
1043
1058
|
actorSqlTransactionRollback(transaction: SqliteTransactionHandle): Promise<void>;
|
|
1059
|
+
actorSqlTransactionRollbackSync(transaction: SqliteTransactionHandle): void;
|
|
1044
1060
|
actorBeginStateTransaction(ctx: ActorContextHandle, timeoutMs?: number): Promise<ActorStateTransactionHandle>;
|
|
1045
1061
|
actorStateTransactionExecute(transaction: ActorStateTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
1046
1062
|
actorStateTransactionCommit(transaction: ActorStateTransactionHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
|
|
@@ -1049,6 +1065,13 @@ interface CoreRuntime {
|
|
|
1049
1065
|
actorSqlRun(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlRunResult>;
|
|
1050
1066
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
1051
1067
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
1068
|
+
/** Opens the actor database so later synchronous calls never fetch its first pages. */
|
|
1069
|
+
actorSqlOpen(ctx: ActorContextHandle): Promise<void>;
|
|
1070
|
+
/** Returns the ticket of the latest local commit. */
|
|
1071
|
+
actorSqlCommitTicket(ctx: ActorContextHandle): number;
|
|
1072
|
+
/** Resolves once the commit `ticket` names and every earlier commit are durable. */
|
|
1073
|
+
actorSqlWhenDurable(ctx: ActorContextHandle, ticket: number): Promise<void>;
|
|
1074
|
+
actorSqlAbortGeneration(ctx: ActorContextHandle, reason: string): void;
|
|
1052
1075
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
1053
1076
|
actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
1054
1077
|
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
@@ -1463,6 +1486,27 @@ declare class ActorConnRaw {
|
|
|
1463
1486
|
*/
|
|
1464
1487
|
type ActorConn<AD extends AnyActorDefinition> = Omit<ActorConnRaw, "send" | "on" | "once"> & ActorDefinitionQueueSend<AD> & ActorDefinitionEventSubscriptions<AD> & ActorDefinitionActions<AD>;
|
|
1465
1488
|
|
|
1489
|
+
/** How many retries a client may spend, as a share of the requests it sends. */
|
|
1490
|
+
interface RetryBudgetOptions {
|
|
1491
|
+
/** Retries allowed per 100 requests (default 10). */
|
|
1492
|
+
percent?: number;
|
|
1493
|
+
/** Retries the client can bank for a burst of refusals; the budget starts full (default 100). */
|
|
1494
|
+
maxTokens?: number;
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Bounds the client's retries of refused requests. Each request adds a fraction of a token and
|
|
1498
|
+
* each retry spends one, so retries stay a fixed share of traffic while the service sheds load
|
|
1499
|
+
* instead of multiplying it.
|
|
1500
|
+
*/
|
|
1501
|
+
declare class RetryBudget {
|
|
1502
|
+
#private;
|
|
1503
|
+
constructor(options?: RetryBudgetOptions);
|
|
1504
|
+
/** Credits one request sent. */
|
|
1505
|
+
deposit(): void;
|
|
1506
|
+
/** Spends one token. Returns `false` when the budget is spent. */
|
|
1507
|
+
tryWithdraw(): boolean;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1466
1510
|
/**
|
|
1467
1511
|
* Provides underlying functions for stateless {@link ActorHandle} for action calls.
|
|
1468
1512
|
* Similar to ActorConnRaw but doesn't maintain a connection.
|
|
@@ -1478,7 +1522,7 @@ declare class ActorHandleRaw {
|
|
|
1478
1522
|
*
|
|
1479
1523
|
* @protected
|
|
1480
1524
|
*/
|
|
1481
|
-
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan);
|
|
1525
|
+
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
|
|
1482
1526
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1483
1527
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1484
1528
|
/**
|
|
@@ -1685,6 +1729,8 @@ declare const CREATE_ACTOR_CONN_PROXY: unique symbol;
|
|
|
1685
1729
|
interface ClientRawOptions {
|
|
1686
1730
|
encoding?: Encoding;
|
|
1687
1731
|
gateway?: ActorGatewayOptions;
|
|
1732
|
+
/** Bounds retries of refused requests across every handle of this client. */
|
|
1733
|
+
retryBudget?: RetryBudgetOptions;
|
|
1688
1734
|
}
|
|
1689
1735
|
/** Runtime-supplied wiring for clients created inside an actor. Set only by the native runtime. */
|
|
1690
1736
|
interface ActorClientRuntimeOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, H as ActorLogger, ax as QueueFilterName, aC as QueueNextOptions, aD as QueueResultMessageForName, aB as QueueNextBatchOptions, aI as Registry, a6 as Client, ap as InferEventArgs, aq as InferSchemaMap } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, H as ActorLogger, ax as QueueFilterName, aC as QueueNextOptions, aD as QueueResultMessageForName, aB as QueueNextBatchOptions, aI as Registry, a6 as Client, ap as InferEventArgs, aq as InferSchemaMap } from './config-DK144OAw.cjs';
|
|
2
2
|
import { WorkflowContextInterface, StepConfig, TryStepResult, TryStepConfig, TryBlockResult, TryBlockConfig, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
|
|
3
|
-
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-
|
|
3
|
+
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-BfG1qpYz.cjs';
|
|
4
4
|
|
|
5
5
|
type WorkflowActorQueueNextOptions<TName extends string, TCompletable extends boolean> = Omit<QueueNextOptions<TName, TCompletable>, "signal">;
|
|
6
6
|
type WorkflowActorQueueNextOptionsFallback<TCompletable extends boolean> = Omit<QueueNextOptions<string, TCompletable>, "signal">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, H as ActorLogger, ax as QueueFilterName, aC as QueueNextOptions, aD as QueueResultMessageForName, aB as QueueNextBatchOptions, aI as Registry, a6 as Client, ap as InferEventArgs, aq as InferSchemaMap } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, H as ActorLogger, ax as QueueFilterName, aC as QueueNextOptions, aD as QueueResultMessageForName, aB as QueueNextBatchOptions, aI as Registry, a6 as Client, ap as InferEventArgs, aq as InferSchemaMap } from './config-B4erdavw.js';
|
|
2
2
|
import { WorkflowContextInterface, StepConfig, TryStepResult, TryStepConfig, TryBlockResult, TryBlockConfig, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
|
|
3
|
-
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-
|
|
3
|
+
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-BfG1qpYz.js';
|
|
4
4
|
|
|
5
5
|
type WorkflowActorQueueNextOptions<TName extends string, TCompletable extends boolean> = Omit<QueueNextOptions<TName, TCompletable>, "signal">;
|
|
6
6
|
type WorkflowActorQueueNextOptionsFallback<TCompletable extends boolean> = Omit<QueueNextOptions<string, TCompletable>, "signal">;
|