rivetkit 2.3.11-rc.9 → 2.3.11
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 +96 -14
- package/dist/browser/client.js +12 -2
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +139 -139
- package/dist/browser/inspector/client.js +12 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +146 -76
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +83 -9
- package/dist/tsup/agent-os/index.d.ts +83 -9
- package/dist/tsup/agent-os/index.js +146 -76
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-HOZ3ZLZ2.js → chunk-3ZR542SK.js} +6 -6
- package/dist/tsup/chunk-3ZR542SK.js.map +1 -0
- package/dist/tsup/{chunk-HNHLBM3Y.cjs → chunk-4KGXFC6M.cjs} +42 -5
- package/dist/tsup/chunk-4KGXFC6M.cjs.map +1 -0
- package/dist/tsup/chunk-5UYWLCRO.js +14 -0
- package/dist/tsup/chunk-5UYWLCRO.js.map +1 -0
- package/dist/tsup/{chunk-QWLJCP3X.js → chunk-6W5VGLFT.js} +42 -5
- package/dist/tsup/chunk-6W5VGLFT.js.map +1 -0
- package/dist/tsup/chunk-6WYATRS4.js +243 -0
- package/dist/tsup/chunk-6WYATRS4.js.map +1 -0
- package/dist/tsup/chunk-B3W74FBB.cjs +14 -0
- package/dist/tsup/chunk-B3W74FBB.cjs.map +1 -0
- package/dist/tsup/{chunk-XOOESJY7.js → chunk-FWROC5LA.js} +2 -2
- package/dist/tsup/{chunk-V5CVATRU.cjs → chunk-GLIPKKEC.cjs} +7 -7
- package/dist/tsup/{chunk-V5CVATRU.cjs.map → chunk-GLIPKKEC.cjs.map} +1 -1
- package/dist/tsup/{chunk-T5XVTVQY.cjs → chunk-GN2EUMEW.cjs} +3 -3
- package/dist/tsup/{chunk-T5XVTVQY.cjs.map → chunk-GN2EUMEW.cjs.map} +1 -1
- package/dist/tsup/{chunk-T56IZ42M.cjs → chunk-GU7ML3KE.cjs} +13 -3
- package/dist/tsup/chunk-GU7ML3KE.cjs.map +1 -0
- package/dist/tsup/{chunk-IOLZ3ONU.js → chunk-JQ2AZ5FN.js} +3 -3
- package/dist/tsup/{chunk-7AFZMFPQ.js → chunk-JTHHCZCZ.js} +10 -1
- package/dist/tsup/chunk-JTHHCZCZ.js.map +1 -0
- package/dist/tsup/{chunk-UEULFXUI.cjs → chunk-KVFIONKQ.cjs} +11 -2
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -0
- package/dist/tsup/chunk-LWQFXGKS.cjs +243 -0
- package/dist/tsup/chunk-LWQFXGKS.cjs.map +1 -0
- package/dist/tsup/{chunk-QVCO6DTZ.js → chunk-MO2SSUOR.js} +8 -7
- package/dist/tsup/chunk-MO2SSUOR.js.map +1 -0
- package/dist/tsup/{chunk-LZ4TSBIP.js → chunk-OUENKQHB.js} +13 -3
- package/dist/tsup/chunk-OUENKQHB.js.map +1 -0
- package/dist/tsup/{chunk-6SBPWTXJ.cjs → chunk-PUZY2XCD.cjs} +10 -9
- package/dist/tsup/chunk-PUZY2XCD.cjs.map +1 -0
- package/dist/tsup/{chunk-C5TORAVP.js → chunk-QFJ24MBU.js} +27 -2
- package/dist/tsup/{chunk-C5TORAVP.js.map → chunk-QFJ24MBU.js.map} +1 -1
- package/dist/tsup/{chunk-BZWKY6WO.cjs → chunk-RXXDNJXB.cjs} +140 -140
- package/dist/tsup/{chunk-BZWKY6WO.cjs.map → chunk-RXXDNJXB.cjs.map} +1 -1
- package/dist/tsup/{chunk-IMRDHZM2.cjs → chunk-VBJQIBXI.cjs} +30 -5
- package/dist/tsup/chunk-VBJQIBXI.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +4 -3
- package/dist/tsup/client/mod.d.ts +4 -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-CZcjyT5B.d.ts → config-C4OSv0QP.d.ts} +92 -7
- package/dist/tsup/{config-rGWrumlO.d.cts → config-DTGoWdkG.d.cts} +92 -7
- package/dist/tsup/{config-BxOimoGX.d.cts → config-ey2I2zz5.d.cts} +46 -6
- package/dist/tsup/{config-BxOimoGX.d.ts → config-ey2I2zz5.d.ts} +46 -6
- package/dist/tsup/{context-B8W8E8nW.d.cts → context-C6cvDNyk.d.cts} +2 -2
- package/dist/tsup/{context-_UrDZhEh.d.ts → context-CMygeBxS.d.ts} +2 -2
- package/dist/tsup/db/drizzle.cjs +18 -10
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +5 -6
- package/dist/tsup/db/drizzle.d.ts +5 -6
- package/dist/tsup/db/drizzle.js +13 -5
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +5 -175
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.d.cts +11 -4
- package/dist/tsup/db/mod.d.ts +11 -4
- package/dist/tsup/db/mod.js +4 -174
- package/dist/tsup/db/mod.js.map +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +3 -2
- package/dist/tsup/dynamic/mod.d.ts +3 -2
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -4
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +12 -146
- package/dist/tsup/inspector/mod.d.ts +12 -146
- package/dist/tsup/inspector/mod.js +4 -3
- package/dist/tsup/inspector/mod.js.map +1 -1
- package/dist/tsup/inspector/workflow.cjs +21 -0
- package/dist/tsup/inspector/workflow.cjs.map +1 -0
- package/dist/tsup/inspector/workflow.d.cts +144 -0
- package/dist/tsup/inspector/workflow.d.ts +144 -0
- package/dist/tsup/inspector/workflow.js +21 -0
- package/dist/tsup/inspector/workflow.js.map +1 -0
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +4 -3
- package/dist/tsup/inspector-tab/mod.d.ts +4 -3
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +743 -247
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +6 -5
- package/dist/tsup/mod.d.ts +6 -5
- package/dist/tsup/mod.js +670 -174
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +3 -2
- package/dist/tsup/test/mod.d.ts +3 -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 +89 -95
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +5 -4
- package/dist/tsup/workflow/mod.d.ts +5 -4
- package/dist/tsup/workflow/mod.js +86 -92
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +19 -9
- package/src/actor/config.test.ts +65 -1
- package/src/actor/config.ts +169 -5
- package/src/actor/mod.ts +10 -1
- package/src/client/actor-common.ts +5 -14
- package/src/common/database/config.ts +50 -3
- package/src/common/database/mod.test.ts +142 -4
- package/src/common/database/mod.ts +210 -98
- package/src/common/database/native-database.ts +42 -3
- package/src/common/database/shared.ts +9 -0
- package/src/db/drizzle.test.ts +8 -1
- package/src/db/drizzle.ts +15 -4
- package/src/db/mod.ts +3 -0
- package/src/inspector/workflow.ts +61 -0
- package/src/registry/napi-runtime.ts +69 -1
- package/src/registry/native.ts +474 -161
- package/src/registry/run-handler-coordinator.test.ts +252 -0
- package/src/registry/run-handler-coordinator.ts +219 -0
- package/src/registry/runtime.ts +34 -1
- package/src/registry/wasm-runtime.ts +122 -17
- package/src/utils/node.ts +44 -28
- package/src/workflow/driver.ts +56 -58
- package/src/workflow/inspector.ts +10 -15
- package/src/workflow/mod.ts +48 -70
- package/dist/tsup/chunk-6SBPWTXJ.cjs.map +0 -1
- package/dist/tsup/chunk-7AFZMFPQ.js.map +0 -1
- package/dist/tsup/chunk-HNHLBM3Y.cjs.map +0 -1
- package/dist/tsup/chunk-HOZ3ZLZ2.js.map +0 -1
- package/dist/tsup/chunk-IMRDHZM2.cjs.map +0 -1
- package/dist/tsup/chunk-LZ4TSBIP.js.map +0 -1
- package/dist/tsup/chunk-QVCO6DTZ.js.map +0 -1
- package/dist/tsup/chunk-QWLJCP3X.js.map +0 -1
- package/dist/tsup/chunk-T56IZ42M.cjs.map +0 -1
- package/dist/tsup/chunk-UEULFXUI.cjs.map +0 -1
- /package/dist/tsup/{chunk-XOOESJY7.js.map → chunk-FWROC5LA.js.map} +0 -0
- /package/dist/tsup/{chunk-IOLZ3ONU.js.map → chunk-JQ2AZ5FN.js.map} +0 -0
package/dist/browser/client.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface ActorMetricsLike {
|
|
|
13
13
|
totalKvWrites: number;
|
|
14
14
|
trackSql(query: string, durationMs: number): void;
|
|
15
15
|
}
|
|
16
|
-
type InferDatabaseClient<DBProvider extends AnyDatabaseProvider> = DBProvider extends DatabaseProvider<any> ? Awaited<ReturnType<DBProvider["createClient"]>> :
|
|
16
|
+
type InferDatabaseClient<DBProvider extends AnyDatabaseProvider> = DBProvider extends DatabaseProvider<any> ? Awaited<ReturnType<DBProvider["createClient"]>> : RawAccess;
|
|
17
17
|
type SqliteBindings = unknown[] | Record<string, unknown>;
|
|
18
18
|
interface SqliteQueryResult {
|
|
19
19
|
columns: string[];
|
|
@@ -27,6 +27,41 @@ interface SqliteBatchStatement {
|
|
|
27
27
|
sql: string;
|
|
28
28
|
params?: SqliteBindings;
|
|
29
29
|
}
|
|
30
|
+
interface SqliteTransactionOptions {
|
|
31
|
+
/** Static operation name used to aggregate transaction performance. */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Deadlock-safety timeout in milliseconds. */
|
|
34
|
+
timeout?: number;
|
|
35
|
+
/** @experimental */
|
|
36
|
+
experimental?: {
|
|
37
|
+
/**
|
|
38
|
+
* Atomically includes actor and hibernatable connection state.
|
|
39
|
+
* Only single-statement `execute` calls are supported in the transaction.
|
|
40
|
+
* Concurrent actions that try to mutate state while the transaction is
|
|
41
|
+
* active fail with `actor.state_transaction_conflict`.
|
|
42
|
+
*/
|
|
43
|
+
includeState?: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* SQLite profiling configuration.
|
|
48
|
+
*
|
|
49
|
+
* @experimental This entire configuration surface is experimental and subject
|
|
50
|
+
* to change without notice.
|
|
51
|
+
*/
|
|
52
|
+
interface SqliteProfilingOptions {
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
maxTrackedStatementFingerprints?: number;
|
|
55
|
+
maxTrackedTransactionFingerprints?: number;
|
|
56
|
+
maxPrometheusSeries?: number;
|
|
57
|
+
maxStatementsPerTransactionTrace?: number;
|
|
58
|
+
maxGetPagesRequestsPerTrace?: number;
|
|
59
|
+
maxTransactionNameBytes?: number;
|
|
60
|
+
slowOperationThresholdMs?: number;
|
|
61
|
+
baselineSampleRate?: number;
|
|
62
|
+
maxDiagnosticEventsPerMinute?: number;
|
|
63
|
+
diagnosticEventQueueCapacity?: number;
|
|
64
|
+
}
|
|
30
65
|
interface SqliteNativeMetrics {
|
|
31
66
|
requestBuildNs: number;
|
|
32
67
|
serializeNs: number;
|
|
@@ -44,7 +79,7 @@ interface SqliteDatabase {
|
|
|
44
79
|
exec(sql: string, callback?: (row: unknown[], columns: string[]) => void): Promise<void>;
|
|
45
80
|
execute(sql: string, params?: SqliteBindings): Promise<SqliteExecuteResult>;
|
|
46
81
|
executeBatch(statements: SqliteBatchStatement[]): Promise<SqliteExecuteResult[]>;
|
|
47
|
-
beginTransaction(timeoutMs?: number): Promise<SqliteTransactionDatabase>;
|
|
82
|
+
beginTransaction(timeoutMs?: number, name?: string): Promise<SqliteTransactionDatabase>;
|
|
48
83
|
run(sql: string, params?: SqliteBindings): Promise<void>;
|
|
49
84
|
query(sql: string, params?: SqliteBindings): Promise<SqliteQueryResult>;
|
|
50
85
|
nativeMetrics?(): SqliteNativeMetrics | Promise<SqliteNativeMetrics | null> | null;
|
|
@@ -99,6 +134,13 @@ interface DatabaseProviderContext {
|
|
|
99
134
|
nativeDatabaseProvider?: NativeDatabaseProvider;
|
|
100
135
|
}
|
|
101
136
|
type DatabaseProvider<DB extends RawAccess> = {
|
|
137
|
+
/**
|
|
138
|
+
* Local SQLite profiling controls consumed by the actor runtime.
|
|
139
|
+
*
|
|
140
|
+
* @experimental This entire configuration surface is experimental and
|
|
141
|
+
* subject to change without notice.
|
|
142
|
+
*/
|
|
143
|
+
sqliteProfiling?: SqliteProfilingOptions;
|
|
102
144
|
/**
|
|
103
145
|
* Creates a new database client for the actor.
|
|
104
146
|
* The result is passed to the actor context as `c.db`.
|
|
@@ -123,9 +165,7 @@ type RawAccess = {
|
|
|
123
165
|
*/
|
|
124
166
|
execute: ExecuteFunction;
|
|
125
167
|
/** Runs a callback in an isolated SQLite transaction. */
|
|
126
|
-
transaction: <T>(callback: (tx: RawAccess) => Promise<T> | T, options?:
|
|
127
|
-
timeout?: number;
|
|
128
|
-
}) => Promise<T>;
|
|
168
|
+
transaction: <T>(callback: (tx: RawAccess) => Promise<T> | T, options?: SqliteTransactionOptions) => Promise<T>;
|
|
129
169
|
/**
|
|
130
170
|
* Returns native SQLite metrics when the active runtime supports them.
|
|
131
171
|
*/
|
|
@@ -406,7 +446,9 @@ type LooseEventSubscribe = (eventName: string, callback: (...args: any[]) => voi
|
|
|
406
446
|
type ActorActionMap<R> = {
|
|
407
447
|
[K in keyof NonNullable<R>]: NonNullable<R>[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Awaited<Return>> : NonNullable<R>[K] extends Record<string, unknown> ? ActorActionMap<NonNullable<R>[K]> : never;
|
|
408
448
|
};
|
|
409
|
-
type ActionsOf<AD extends AnyActorDefinition> = AD extends
|
|
449
|
+
type ActionsOf<AD extends AnyActorDefinition> = AD["config"] extends {
|
|
450
|
+
actions?: infer R;
|
|
451
|
+
} ? R : never;
|
|
410
452
|
interface ActorGatewayOptions {
|
|
411
453
|
skipReadyWait?: boolean;
|
|
412
454
|
}
|
|
@@ -977,6 +1019,9 @@ type Client<A extends Registry<any>> = ClientRaw & {
|
|
|
977
1019
|
[K in keyof ExtractActorsFromRegistry<A>]: ActorAccessor<ExtractActorsFromRegistry<A>[K]>;
|
|
978
1020
|
};
|
|
979
1021
|
|
|
1022
|
+
/** @experimental State exposed by a durable workflow run handler to the Inspector. */
|
|
1023
|
+
type WorkflowState = "pending" | "running" | "sleeping" | "failed" | "completed" | "cancelled" | "rolling_back";
|
|
1024
|
+
|
|
980
1025
|
declare const ACTOR_CONTEXT_INTERNAL_SYMBOL: unique symbol;
|
|
981
1026
|
declare const RAW_STATE_SYMBOL: unique symbol;
|
|
982
1027
|
interface ActorLogger {
|
|
@@ -1012,7 +1057,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
|
|
|
1012
1057
|
};
|
|
1013
1058
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
1014
1059
|
/**
|
|
1015
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`
|
|
1060
|
+
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1016
1061
|
* or actor state instead.
|
|
1017
1062
|
*/
|
|
1018
1063
|
interface ActorKv {
|
|
@@ -1109,6 +1154,8 @@ type QueueMessageOf<Name extends string, Body> = {
|
|
|
1109
1154
|
type QueueName<TQueues extends QueueSchemaConfig> = keyof TQueues & string;
|
|
1110
1155
|
type QueueFilterName<TQueues extends QueueSchemaConfig> = keyof TQueues extends never ? string : QueueName<TQueues>;
|
|
1111
1156
|
type QueueMessageForName<TQueues extends QueueSchemaConfig, TName extends QueueFilterName<TQueues>> = keyof TQueues extends never ? QueueMessageOf<string, unknown> : TName extends QueueName<TQueues> ? QueueMessageOf<TName, InferSchemaMap<TQueues>[TName]> : never;
|
|
1157
|
+
type QueueCompleteArgs<T> = undefined extends T ? [response?: T] : [response: T];
|
|
1158
|
+
type QueueCompleteArgsForName<TQueues extends QueueSchemaConfig, TName extends QueueFilterName<TQueues>> = keyof TQueues extends never ? [response?: unknown] : TName extends QueueName<TQueues> ? [InferQueueCompleteMap<TQueues>[TName]] extends [never] ? [response?: unknown] : QueueCompleteArgs<InferQueueCompleteMap<TQueues>[TName]> : [response?: unknown];
|
|
1112
1159
|
type QueueCompletionResultForName<TQueues extends QueueSchemaConfig, TName extends QueueFilterName<TQueues>> = keyof TQueues extends never ? unknown | undefined : TName extends QueueName<TQueues> ? InferQueueCompleteMap<TQueues>[TName] | undefined : unknown | undefined;
|
|
1113
1160
|
interface QueueNextOptions<TName extends string = string, TCompletable extends boolean = boolean> {
|
|
1114
1161
|
names?: readonly TName[];
|
|
@@ -1151,6 +1198,13 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
|
1151
1198
|
next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
|
|
1152
1199
|
nextBatch<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextBatchOptions<TName, TCompletable>): Promise<any[]>;
|
|
1153
1200
|
waitForNames<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(names: readonly TName[], opts?: QueueWaitOptions<TCompletable>): Promise<any>;
|
|
1201
|
+
/** @experimental */
|
|
1202
|
+
waitForAvailable<const TName extends QueueFilterName<TQueues>>(names?: readonly TName[], opts?: Omit<QueueWaitOptions<false>, "completable">): Promise<void>;
|
|
1203
|
+
/** @experimental */
|
|
1204
|
+
complete<const TName extends QueueFilterName<TQueues>>(message: {
|
|
1205
|
+
id: number | bigint;
|
|
1206
|
+
name: TName;
|
|
1207
|
+
}, ...args: QueueCompleteArgsForName<TQueues, TName>): Promise<void>;
|
|
1154
1208
|
enqueueAndWait<const TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"], opts?: QueueEnqueueAndWaitOptions): Promise<QueueCompletionResultForName<TQueues, TName>>;
|
|
1155
1209
|
tryNext<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueTryNextOptions<TName, TCompletable>): Promise<any>;
|
|
1156
1210
|
tryNextBatch<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueTryNextBatchOptions<TName, TCompletable>): Promise<any[]>;
|
|
@@ -1173,7 +1227,7 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1173
1227
|
state: TState;
|
|
1174
1228
|
vars: TVars;
|
|
1175
1229
|
/**
|
|
1176
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`db`
|
|
1230
|
+
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1177
1231
|
* or actor state instead.
|
|
1178
1232
|
*/
|
|
1179
1233
|
readonly kv: ActorKv;
|
|
@@ -1181,6 +1235,8 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1181
1235
|
readonly schedule: ActorSchedule;
|
|
1182
1236
|
readonly cron: ActorCron;
|
|
1183
1237
|
readonly queue: ActorQueue<TQueues>;
|
|
1238
|
+
/** @experimental */
|
|
1239
|
+
readonly run: ActorRun;
|
|
1184
1240
|
readonly actorId: string;
|
|
1185
1241
|
readonly name: string;
|
|
1186
1242
|
readonly key: string[];
|
|
@@ -1210,6 +1266,14 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1210
1266
|
client<T = any>(): ActorClientFor<T>;
|
|
1211
1267
|
[key: string]: any;
|
|
1212
1268
|
}
|
|
1269
|
+
/** @experimental */
|
|
1270
|
+
interface ActorRun {
|
|
1271
|
+
/**
|
|
1272
|
+
* @experimental Sets or clears the durable Unix-millisecond deadline that
|
|
1273
|
+
* ensures this actor's run handler is active, starting it if inactive.
|
|
1274
|
+
*/
|
|
1275
|
+
setWakeAt(timestamp: number | null): Promise<void>;
|
|
1276
|
+
}
|
|
1213
1277
|
type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & {
|
|
1214
1278
|
conn: Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
1215
1279
|
};
|
|
@@ -1236,6 +1300,7 @@ declare const RunConfigSchema: z.ZodObject<{
|
|
|
1236
1300
|
inspector: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1237
1301
|
workflow: z.ZodOptional<z.ZodObject<{
|
|
1238
1302
|
getHistory: z.ZodCustom<() => unknown, () => unknown>;
|
|
1303
|
+
getState: z.ZodOptional<z.ZodCustom<() => Promise<WorkflowState | null>, () => Promise<WorkflowState | null>>>;
|
|
1239
1304
|
onHistoryUpdated: z.ZodOptional<z.ZodCustom<(listener: (history: unknown) => void) => InspectorUnsubscribe, (listener: (history: unknown) => void) => InspectorUnsubscribe>>;
|
|
1240
1305
|
replayFromStep: z.ZodOptional<z.ZodCustom<(entryId?: string) => Promise<unknown>, (entryId?: string) => Promise<unknown>>>;
|
|
1241
1306
|
}, z.core.$strip>>;
|
|
@@ -1258,6 +1323,7 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
1258
1323
|
inspector: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1259
1324
|
workflow: z.ZodOptional<z.ZodObject<{
|
|
1260
1325
|
getHistory: z.ZodCustom<() => unknown, () => unknown>;
|
|
1326
|
+
getState: z.ZodOptional<z.ZodCustom<() => Promise<WorkflowState | null>, () => Promise<WorkflowState | null>>>;
|
|
1261
1327
|
onHistoryUpdated: z.ZodOptional<z.ZodCustom<(listener: (history: unknown) => void) => InspectorUnsubscribe, (listener: (history: unknown) => void) => InspectorUnsubscribe>>;
|
|
1262
1328
|
replayFromStep: z.ZodOptional<z.ZodCustom<(entryId?: string) => Promise<unknown>, (entryId?: string) => Promise<unknown>>>;
|
|
1263
1329
|
}, z.core.$strip>>;
|
|
@@ -1317,12 +1383,12 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
1317
1383
|
}, z.core.$strict>, z.ZodObject<{
|
|
1318
1384
|
id: z.ZodEnum<{
|
|
1319
1385
|
state: "state";
|
|
1320
|
-
workflow: "workflow";
|
|
1321
1386
|
database: "database";
|
|
1387
|
+
console: "console";
|
|
1388
|
+
workflow: "workflow";
|
|
1322
1389
|
queue: "queue";
|
|
1323
1390
|
schedules: "schedules";
|
|
1324
1391
|
connections: "connections";
|
|
1325
|
-
console: "console";
|
|
1326
1392
|
}>;
|
|
1327
1393
|
hidden: z.ZodLiteral<true>;
|
|
1328
1394
|
}, z.core.$strict>]>>>;
|
|
@@ -1565,7 +1631,11 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
|
|
|
1565
1631
|
}>>, z$2.ZodTransform<"auto" | "native" | "wasm", "auto" | "native" | "wasm" | undefined>>;
|
|
1566
1632
|
wasm: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
|
|
1567
1633
|
bindings: z$2.ZodOptional<z$2.ZodCustom<typeof _rivetkit_rivetkit_wasm, typeof _rivetkit_rivetkit_wasm>>;
|
|
1568
|
-
initInput: z$2.ZodOptional<z$2.ZodCustom<
|
|
1634
|
+
initInput: z$2.ZodOptional<z$2.ZodCustom<{
|
|
1635
|
+
module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
|
|
1636
|
+
} | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined, {
|
|
1637
|
+
module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
|
|
1638
|
+
} | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined>>;
|
|
1569
1639
|
}, z$2.core.$strip>>>;
|
|
1570
1640
|
sqlite: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodUnion<readonly [z$2.ZodEnum<{
|
|
1571
1641
|
local: "local";
|
|
@@ -1658,7 +1728,9 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
|
|
|
1658
1728
|
runtime: "auto" | "native" | "wasm";
|
|
1659
1729
|
wasm: {
|
|
1660
1730
|
bindings?: typeof _rivetkit_rivetkit_wasm | undefined;
|
|
1661
|
-
initInput?:
|
|
1731
|
+
initInput?: {
|
|
1732
|
+
module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
|
|
1733
|
+
} | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined;
|
|
1662
1734
|
};
|
|
1663
1735
|
noWelcome: boolean;
|
|
1664
1736
|
logging: {
|
|
@@ -1705,7 +1777,9 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
|
|
|
1705
1777
|
runtime: "auto" | "native" | "wasm";
|
|
1706
1778
|
wasm: {
|
|
1707
1779
|
bindings?: typeof _rivetkit_rivetkit_wasm | undefined;
|
|
1708
|
-
initInput?:
|
|
1780
|
+
initInput?: {
|
|
1781
|
+
module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
|
|
1782
|
+
} | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined;
|
|
1709
1783
|
};
|
|
1710
1784
|
sqlite: {
|
|
1711
1785
|
backend: "local" | "remote";
|
|
@@ -1769,6 +1843,7 @@ type ActorContextHandle = OpaqueHandle<"actorContext">;
|
|
|
1769
1843
|
type ConnHandle = OpaqueHandle<"conn">;
|
|
1770
1844
|
type WebSocketHandle = OpaqueHandle<"webSocket">;
|
|
1771
1845
|
type CancellationTokenHandle = OpaqueHandle<"cancellationToken">;
|
|
1846
|
+
type ActorStateTransactionHandle = OpaqueHandle<"actorStateTransaction">;
|
|
1772
1847
|
type SqliteTransactionHandle = OpaqueHandle<"sqliteTransaction">;
|
|
1773
1848
|
type RuntimeBytes = Uint8Array;
|
|
1774
1849
|
interface RuntimeActorKeySegment {
|
|
@@ -1935,6 +2010,7 @@ interface RuntimeActorConfig {
|
|
|
1935
2010
|
icon?: string;
|
|
1936
2011
|
hasDatabase?: boolean;
|
|
1937
2012
|
remoteSqlite?: boolean;
|
|
2013
|
+
sqliteProfiling?: SqliteProfilingOptions;
|
|
1938
2014
|
enableActorRuntimeSocket?: boolean;
|
|
1939
2015
|
hasState?: boolean;
|
|
1940
2016
|
canHibernateWebsocket?: boolean;
|
|
@@ -2076,6 +2152,7 @@ interface CoreRuntime {
|
|
|
2076
2152
|
actorBeginOnStateChange(ctx: ActorContextHandle): void;
|
|
2077
2153
|
actorEndOnStateChange(ctx: ActorContextHandle): void;
|
|
2078
2154
|
actorSetAlarm(ctx: ActorContextHandle, timestampMs?: number | undefined | null): void;
|
|
2155
|
+
actorSetRunWakeAt(ctx: ActorContextHandle, timestampMs?: number | undefined | null): Promise<void>;
|
|
2079
2156
|
actorRequestSave(ctx: ActorContextHandle, opts?: RuntimeRequestSaveOpts | undefined | null): void;
|
|
2080
2157
|
actorRequestSaveAndWait(ctx: ActorContextHandle, opts?: RuntimeRequestSaveOpts | undefined | null): Promise<void>;
|
|
2081
2158
|
actorInspectorSnapshot(ctx: ActorContextHandle): RuntimeInspectorSnapshot;
|
|
@@ -2121,11 +2198,15 @@ interface CoreRuntime {
|
|
|
2121
2198
|
actorSqlExec(ctx: ActorContextHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
2122
2199
|
actorSqlExecute(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
2123
2200
|
actorSqlExecuteBatch(ctx: ActorContextHandle, statements: RuntimeSqlBatchStatement[]): Promise<RuntimeSqlExecuteResult[]>;
|
|
2124
|
-
actorSqlBeginTransaction(ctx: ActorContextHandle, timeoutMs?: number): Promise<SqliteTransactionHandle>;
|
|
2201
|
+
actorSqlBeginTransaction(ctx: ActorContextHandle, timeoutMs?: number, name?: string): Promise<SqliteTransactionHandle>;
|
|
2125
2202
|
actorSqlTransactionExec(transaction: SqliteTransactionHandle, sql: string): Promise<RuntimeSqlExecResult>;
|
|
2126
2203
|
actorSqlTransactionExecute(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
2127
2204
|
actorSqlTransactionCommit(transaction: SqliteTransactionHandle): Promise<void>;
|
|
2128
2205
|
actorSqlTransactionRollback(transaction: SqliteTransactionHandle): Promise<void>;
|
|
2206
|
+
actorBeginStateTransaction(ctx: ActorContextHandle, timeoutMs?: number): Promise<ActorStateTransactionHandle>;
|
|
2207
|
+
actorStateTransactionExecute(transaction: ActorStateTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
|
|
2208
|
+
actorStateTransactionCommit(transaction: ActorStateTransactionHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
|
|
2209
|
+
actorStateTransactionRollback(transaction: ActorStateTransactionHandle): Promise<void>;
|
|
2129
2210
|
actorSqlQuery(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlQueryResult>;
|
|
2130
2211
|
actorSqlRun(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlRunResult>;
|
|
2131
2212
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
@@ -2136,6 +2217,7 @@ interface CoreRuntime {
|
|
|
2136
2217
|
actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
|
|
2137
2218
|
actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
|
|
2138
2219
|
actorQueueWaitForNamesAvailable(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<void>;
|
|
2220
|
+
actorQueueCompletePersisted(ctx: ActorContextHandle, messageId: bigint, expectedName: string, response?: RuntimeBytes | undefined | null): Promise<boolean>;
|
|
2139
2221
|
actorQueueEnqueueAndWait(ctx: ActorContextHandle, name: string, body: RuntimeBytes, options?: RuntimeQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeBytes | null>;
|
|
2140
2222
|
actorQueueTryNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueTryNextBatchOptions | undefined | null): RuntimeQueueMessage[];
|
|
2141
2223
|
actorQueueMaxSize(ctx: ActorContextHandle): number;
|
package/dist/browser/client.js
CHANGED
|
@@ -194,7 +194,7 @@ function noopNext() {
|
|
|
194
194
|
// package.json
|
|
195
195
|
var package_default = {
|
|
196
196
|
name: "rivetkit",
|
|
197
|
-
version: "2.3.11
|
|
197
|
+
version: "2.3.11",
|
|
198
198
|
description: "Lightweight libraries for building stateful actors on edge platforms",
|
|
199
199
|
license: "Apache-2.0",
|
|
200
200
|
keywords: [
|
|
@@ -330,6 +330,16 @@ var package_default = {
|
|
|
330
330
|
default: "./dist/tsup/inspector/mod.cjs"
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
|
+
"./experimental/inspector/workflow": {
|
|
334
|
+
import: {
|
|
335
|
+
types: "./dist/tsup/inspector/workflow.d.ts",
|
|
336
|
+
default: "./dist/tsup/inspector/workflow.js"
|
|
337
|
+
},
|
|
338
|
+
require: {
|
|
339
|
+
types: "./dist/tsup/inspector/workflow.d.cts",
|
|
340
|
+
default: "./dist/tsup/inspector/workflow.cjs"
|
|
341
|
+
}
|
|
342
|
+
},
|
|
333
343
|
"./inspector-tab": {
|
|
334
344
|
import: {
|
|
335
345
|
types: "./dist/tsup/inspector-tab/mod.d.ts",
|
|
@@ -375,7 +385,7 @@ var package_default = {
|
|
|
375
385
|
"./dist/tsup/chunk-*.cjs"
|
|
376
386
|
],
|
|
377
387
|
scripts: {
|
|
378
|
-
build: "tsup src/mod.ts src/client/mod.ts src/common/log.ts src/common/websocket.ts src/actor/errors.ts src/utils.ts src/workflow/mod.ts src/test/mod.ts src/inspector/mod.ts src/inspector-tab/mod.ts src/db/mod.ts src/db/drizzle.ts src/dynamic/mod.ts src/unstable/migrations.ts && tsup src/agent-os/index.ts --no-clean --out-dir dist/tsup/agent-os",
|
|
388
|
+
build: "tsup src/mod.ts src/client/mod.ts src/common/log.ts src/common/websocket.ts src/actor/errors.ts src/utils.ts src/workflow/mod.ts src/test/mod.ts src/inspector/mod.ts src/inspector/workflow.ts src/inspector-tab/mod.ts src/db/mod.ts src/db/drizzle.ts src/dynamic/mod.ts src/unstable/migrations.ts && tsup src/agent-os/index.ts --no-clean --out-dir dist/tsup/agent-os && node scripts/check-built-commonjs.mjs",
|
|
379
389
|
"build:browser": "tsup --config tsup.browser.config.ts",
|
|
380
390
|
"check-types": "tsc --noEmit",
|
|
381
391
|
lint: "biome check . && pnpm run check:test-skips && pnpm run check:wait-for-comments",
|