rivetkit 3.0.4 → 3.0.6
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 +34 -28
- package/dist/browser/client.js +2 -2
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-SIVNBXKO.js → chunk-5FQNTE3U.js} +2 -2
- package/dist/tsup/{chunk-NXAFFMGH.cjs → chunk-6EH5WPVT.cjs} +145 -145
- package/dist/tsup/chunk-6EH5WPVT.cjs.map +1 -0
- package/dist/tsup/{chunk-UTNZZOMF.cjs → chunk-6HXQONU5.cjs} +4 -4
- package/dist/tsup/{chunk-UTNZZOMF.cjs.map → chunk-6HXQONU5.cjs.map} +1 -1
- package/dist/tsup/{chunk-4YUA7CTJ.js → chunk-AETY7X4G.js} +2 -2
- package/dist/tsup/{chunk-ZT7GZRFQ.js → chunk-CJSADDKT.js} +4 -4
- package/dist/tsup/{chunk-F5VDYHOA.js → chunk-FERZDKVR.js} +3 -3
- package/dist/tsup/{chunk-T5Z3FG5Y.cjs → chunk-JU6RP3LW.cjs} +3 -3
- package/dist/tsup/{chunk-T5Z3FG5Y.cjs.map → chunk-JU6RP3LW.cjs.map} +1 -1
- package/dist/tsup/{chunk-4L27QRHE.cjs → chunk-NPA2A53S.cjs} +3 -3
- package/dist/tsup/{chunk-4L27QRHE.cjs.map → chunk-NPA2A53S.cjs.map} +1 -1
- package/dist/tsup/{chunk-UYBLHHFG.cjs → chunk-NUCUZGIV.cjs} +7 -7
- package/dist/tsup/{chunk-UYBLHHFG.cjs.map → chunk-NUCUZGIV.cjs.map} +1 -1
- package/dist/tsup/{chunk-A7Q5DJ2P.js → chunk-PBIQPYE5.js} +12 -15
- package/dist/tsup/chunk-PBIQPYE5.js.map +1 -0
- package/dist/tsup/{chunk-L3LCIZBH.js → chunk-SAR7BMVU.js} +2 -2
- package/dist/tsup/{chunk-NRTL2RDM.js → chunk-VNMBEXJH.js} +2 -2
- package/dist/tsup/{chunk-LW57U7VQ.cjs → chunk-WMAHPIFS.cjs} +10 -10
- package/dist/tsup/{chunk-LW57U7VQ.cjs.map → chunk-WMAHPIFS.cjs.map} +1 -1
- package/dist/tsup/{chunk-SVEL5ZO3.cjs → chunk-YNVGOPSK.cjs} +2 -2
- package/dist/tsup/{chunk-SVEL5ZO3.cjs.map → chunk-YNVGOPSK.cjs.map} +1 -1
- package/dist/tsup/{chunk-INFADXXI.cjs → chunk-YWWDUC6D.cjs} +12 -15
- package/dist/tsup/chunk-YWWDUC6D.cjs.map +1 -0
- package/dist/tsup/{chunk-2PHT2DGL.js → chunk-ZJ2UXLEE.js} +7 -7
- package/dist/tsup/chunk-ZJ2UXLEE.js.map +1 -0
- package/dist/tsup/{chunk-3WZJFRCB.cjs → chunk-ZPTATOYB.cjs} +3 -3
- package/dist/tsup/{chunk-3WZJFRCB.cjs.map → chunk-ZPTATOYB.cjs.map} +1 -1
- package/dist/tsup/{chunk-IIB4ZPZI.js → chunk-ZWNTOFM3.js} +2 -2
- package/dist/tsup/{chunk-IIB4ZPZI.js.map → chunk-ZWNTOFM3.js.map} +1 -1
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- 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-CM_AlRlT.d.cts → config-BDJltifk.d.cts} +36 -32
- package/dist/tsup/{config-DcUqgwcz.d.ts → config-DXC7qzme.d.ts} +36 -32
- package/dist/tsup/{context-Bws3ikEx.d.ts → context-DgPsVbw6.d.ts} +4 -1
- package/dist/tsup/{context-1BFHhiTs.d.cts → context-osC4Q1ax.d.cts} +4 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- 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.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +129 -134
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +5 -3
- package/dist/tsup/mod.d.ts +5 -3
- package/dist/tsup/mod.js +26 -31
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +13 -10
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +8 -5
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +9 -9
- package/src/actor/config.ts +35 -37
- package/src/actor/contexts/index.ts +2 -0
- package/src/actor/definition.ts +33 -1
- package/src/actor/schema.ts +4 -0
- package/src/client/actor-common.ts +4 -0
- package/src/client/actor-conn.ts +2 -0
- package/src/client/actor-handle.ts +2 -0
- package/src/client/config.ts +1 -1
- package/src/client/queue.ts +2 -0
- package/src/registry/napi-runtime.ts +0 -4
- package/src/registry/native.ts +4 -11
- package/src/registry/runtime.ts +0 -8
- package/src/registry/wasm-runtime.ts +0 -14
- package/src/workflow/context.ts +3 -0
- package/dist/tsup/chunk-2PHT2DGL.js.map +0 -1
- package/dist/tsup/chunk-A7Q5DJ2P.js.map +0 -1
- package/dist/tsup/chunk-INFADXXI.cjs.map +0 -1
- package/dist/tsup/chunk-NXAFFMGH.cjs.map +0 -1
- package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +0 -848
- /package/dist/tsup/{chunk-SIVNBXKO.js.map → chunk-5FQNTE3U.js.map} +0 -0
- /package/dist/tsup/{chunk-4YUA7CTJ.js.map → chunk-AETY7X4G.js.map} +0 -0
- /package/dist/tsup/{chunk-ZT7GZRFQ.js.map → chunk-CJSADDKT.js.map} +0 -0
- /package/dist/tsup/{chunk-F5VDYHOA.js.map → chunk-FERZDKVR.js.map} +0 -0
- /package/dist/tsup/{chunk-L3LCIZBH.js.map → chunk-SAR7BMVU.js.map} +0 -0
- /package/dist/tsup/{chunk-NRTL2RDM.js.map → chunk-VNMBEXJH.js.map} +0 -0
|
@@ -116,6 +116,7 @@ export type ConnInitContextOf<AD extends AnyActorDefinition> =
|
|
|
116
116
|
? BeforeConnectContext<S, V, I, DB, E, Q>
|
|
117
117
|
: never;
|
|
118
118
|
|
|
119
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
119
120
|
export type CreateConnStateContextOf<AD extends AnyActorDefinition> =
|
|
120
121
|
AD extends BaseActorDefinition<
|
|
121
122
|
infer S,
|
|
@@ -251,6 +252,7 @@ export type SleepContextOf<AD extends AnyActorDefinition> =
|
|
|
251
252
|
? SleepContext<S, CP, CS, V, I, DB, E, Q>
|
|
252
253
|
: never;
|
|
253
254
|
|
|
255
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
|
|
254
256
|
export type StateChangeContextOf<AD extends AnyActorDefinition> =
|
|
255
257
|
AD extends BaseActorDefinition<
|
|
256
258
|
infer S,
|
package/src/actor/definition.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ActorConfig,
|
|
11
11
|
type ActorConfigInput,
|
|
12
12
|
ActorConfigSchema,
|
|
13
|
+
getRunInspectorKind,
|
|
13
14
|
} from "./config";
|
|
14
15
|
import { loggerWithoutContext } from "./log";
|
|
15
16
|
import type { EventSchemaConfig, QueueSchemaConfig } from "./schema";
|
|
@@ -34,12 +35,42 @@ function warnDeprecatedOptionKeys(options: unknown) {
|
|
|
34
35
|
if (opts[key] !== undefined && !warnedDeprecatedOptionKeys.has(key)) {
|
|
35
36
|
warnedDeprecatedOptionKeys.add(key);
|
|
36
37
|
loggerWithoutContext().warn({
|
|
37
|
-
msg: `actor option \`${key}\` is deprecated and is now ignored. ${detail} Will be removed in
|
|
38
|
+
msg: `actor option \`${key}\` is deprecated and is now ignored. ${detail} Will be removed in 3.2.0.`,
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
let warnedDeprecatedRun = false;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Warns once per process when `run` is a plain function. `run: workflow(...)`
|
|
48
|
+
* is the supported way to use `run` and does not warn.
|
|
49
|
+
*/
|
|
50
|
+
function warnDeprecatedRun(input: unknown) {
|
|
51
|
+
if (warnedDeprecatedRun || !input || typeof input !== "object") return;
|
|
52
|
+
|
|
53
|
+
const run = (input as { run?: unknown }).run;
|
|
54
|
+
if (run === undefined) return;
|
|
55
|
+
|
|
56
|
+
const runFunction =
|
|
57
|
+
typeof run === "object" && run !== null
|
|
58
|
+
? (run as { run?: unknown }).run
|
|
59
|
+
: run;
|
|
60
|
+
if (
|
|
61
|
+
typeof runFunction === "function" &&
|
|
62
|
+
getRunInspectorKind(runFunction as (...args: any[]) => any) ===
|
|
63
|
+
"workflow"
|
|
64
|
+
) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
warnedDeprecatedRun = true;
|
|
69
|
+
loggerWithoutContext().warn({
|
|
70
|
+
msg: "actor option `run` with a plain function was deprecated in 3.0 and will be removed in a future version. Start background work from `onWake` with `c.keepAwake` and track it in `c.vars`. `run: workflow(...)` is not deprecated. See https://rivet.dev/actors/docs/deprecated/run",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
43
74
|
export interface BaseActorDefinition<
|
|
44
75
|
S,
|
|
45
76
|
CP,
|
|
@@ -200,6 +231,7 @@ export function actor<
|
|
|
200
231
|
warnDeprecatedOptionKeys(
|
|
201
232
|
(input as { options?: unknown } | undefined)?.options,
|
|
202
233
|
);
|
|
234
|
+
warnDeprecatedRun(input);
|
|
203
235
|
const config = ActorConfigSchema.parse(input) as ActorConfig<
|
|
204
236
|
TState,
|
|
205
237
|
TConnParams,
|
package/src/actor/schema.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface EventTypeToken<T, TContext = any> {
|
|
|
14
14
|
export interface QueueTypeToken<TMessage, TComplete = never, TContext = any> {
|
|
15
15
|
readonly _queueMessage?: TMessage;
|
|
16
16
|
readonly _queueComplete?: TComplete;
|
|
17
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
17
18
|
readonly canPublish?: SchemaHook<TContext>;
|
|
18
19
|
readonly message?: PrimitiveSchema;
|
|
19
20
|
readonly complete?: PrimitiveSchema;
|
|
@@ -28,6 +29,7 @@ interface EventOptions<TContext = any> {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
interface QueueOptions<TContext = any> {
|
|
32
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
31
33
|
canPublish?: SchemaHook<TContext>;
|
|
32
34
|
message?: PrimitiveSchema;
|
|
33
35
|
complete?: PrimitiveSchema;
|
|
@@ -39,6 +41,7 @@ export function event<T, TContext = any>(
|
|
|
39
41
|
return (options ?? {}) as EventTypeToken<T, TContext>;
|
|
40
42
|
}
|
|
41
43
|
|
|
44
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
42
45
|
export function queue<TMessage, TComplete = never, TContext = any>(
|
|
43
46
|
options?: QueueOptions<TContext>,
|
|
44
47
|
): QueueTypeToken<TMessage, TComplete, TContext> {
|
|
@@ -55,6 +58,7 @@ export interface EventSchemaDefinition<TContext = any> {
|
|
|
55
58
|
export interface QueueSchemaDefinition<TContext = any> {
|
|
56
59
|
message: PrimitiveSchema;
|
|
57
60
|
complete?: PrimitiveSchema;
|
|
61
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
58
62
|
canPublish?: SchemaHook<TContext>;
|
|
59
63
|
}
|
|
60
64
|
|
|
@@ -92,21 +92,25 @@ export type ActorDefinitionActions<AD extends AnyActorDefinition> =
|
|
|
92
92
|
: ActorActionMap<ActionsOf<AD>>;
|
|
93
93
|
|
|
94
94
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
95
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
95
96
|
<K extends keyof TQueues & string>(
|
|
96
97
|
name: K,
|
|
97
98
|
body: InferSchemaMap<TQueues>[K],
|
|
98
99
|
options: QueueSendWaitOptions,
|
|
99
100
|
): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
101
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
100
102
|
<K extends keyof TQueues & string>(
|
|
101
103
|
name: K,
|
|
102
104
|
body: InferSchemaMap<TQueues>[K],
|
|
103
105
|
options?: QueueSendNoWaitOptions,
|
|
104
106
|
): Promise<void>;
|
|
107
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
105
108
|
(
|
|
106
109
|
name: keyof TQueues extends never ? string : never,
|
|
107
110
|
body: unknown,
|
|
108
111
|
options: QueueSendWaitOptions,
|
|
109
112
|
): Promise<QueueSendResult>;
|
|
113
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
110
114
|
(
|
|
111
115
|
name: keyof TQueues extends never ? string : never,
|
|
112
116
|
body: unknown,
|
package/src/client/actor-conn.ts
CHANGED
|
@@ -304,11 +304,13 @@ export class ActorConnRaw {
|
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
307
308
|
send(
|
|
308
309
|
name: string,
|
|
309
310
|
body: unknown,
|
|
310
311
|
options: QueueSendWaitOptions,
|
|
311
312
|
): Promise<QueueSendResult>;
|
|
313
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
312
314
|
send(
|
|
313
315
|
name: string,
|
|
314
316
|
body: unknown,
|
|
@@ -138,11 +138,13 @@ export class ActorHandleRaw {
|
|
|
138
138
|
return this.#params;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
141
142
|
send(
|
|
142
143
|
name: string,
|
|
143
144
|
body: unknown,
|
|
144
145
|
options: QueueSendWaitOptions,
|
|
145
146
|
): Promise<QueueSendResult>;
|
|
147
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
146
148
|
send(
|
|
147
149
|
name: string,
|
|
148
150
|
body: unknown,
|
package/src/client/config.ts
CHANGED
|
@@ -42,7 +42,7 @@ export const ClientConfigSchemaBase = z.object({
|
|
|
42
42
|
hasWarnedMissingEndpoint = true;
|
|
43
43
|
console.warn(
|
|
44
44
|
`[rivetkit] No endpoint provided to client. Defaulting to ${DEFAULT_ENDPOINT}. ` +
|
|
45
|
-
`Starting in
|
|
45
|
+
`Starting in 3.2.0, an explicit endpoint will be required. ` +
|
|
46
46
|
`Pass an endpoint to createClient() or createRivetKit(), ` +
|
|
47
47
|
`or set the RIVET_ENDPOINT environment variable.`,
|
|
48
48
|
);
|
package/src/client/queue.ts
CHANGED
|
@@ -20,11 +20,13 @@ import { bufferToArrayBuffer } from "@/utils";
|
|
|
20
20
|
import { sendHttpRequest } from "./utils";
|
|
21
21
|
|
|
22
22
|
export interface QueueSender {
|
|
23
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
23
24
|
send(
|
|
24
25
|
name: string,
|
|
25
26
|
body: unknown,
|
|
26
27
|
options: QueueSendWaitOptions,
|
|
27
28
|
): Promise<QueueSendResult>;
|
|
29
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
28
30
|
send(
|
|
29
31
|
name: string,
|
|
30
32
|
body: unknown,
|
|
@@ -1009,10 +1009,6 @@ export class NapiCoreRuntime implements CoreRuntime {
|
|
|
1009
1009
|
await nativeCtx.sql().close();
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
|
-
async actorRuntimeSocketProvision(ctx: ActorContextHandle) {
|
|
1013
|
-
return await asNativeActorContext(ctx).provisionActorRuntimeSocket();
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
1012
|
async actorQueueSend(
|
|
1017
1013
|
ctx: ActorContextHandle,
|
|
1018
1014
|
name: string,
|
package/src/registry/native.ts
CHANGED
|
@@ -2858,12 +2858,6 @@ export class ActorContextHandleAdapter {
|
|
|
2858
2858
|
return this.#kv;
|
|
2859
2859
|
}
|
|
2860
2860
|
|
|
2861
|
-
async actorRuntimeSocket(): Promise<{ path: string }> {
|
|
2862
|
-
return await callNative(() =>
|
|
2863
|
-
this.#runtime.actorRuntimeSocketProvision(this.#ctx),
|
|
2864
|
-
);
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
2861
|
get db() {
|
|
2868
2862
|
if (!this.#databaseProvider) {
|
|
2869
2863
|
throw databaseNotConfiguredError();
|
|
@@ -3529,17 +3523,17 @@ export class ActorContextHandleAdapter {
|
|
|
3529
3523
|
// need to keep an actor awake should use `keepAwake(promise)` or
|
|
3530
3524
|
// `waitUntil(promise)` so the native counter machinery in rivetkit-core
|
|
3531
3525
|
// owns the lifecycle.
|
|
3532
|
-
/** @deprecated Use `keepAwake(promise)` or `waitUntil(promise)
|
|
3526
|
+
/** @deprecated `setPreventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
3533
3527
|
setPreventSleep(_preventSleep: boolean): void {
|
|
3534
3528
|
logger().warn({
|
|
3535
|
-
msg: "setPreventSleep
|
|
3529
|
+
msg: "setPreventSleep was deprecated in 3.0 and will be removed in a future version. It is a no-op; use keepAwake(promise) or waitUntil(promise) instead. See https://rivet.dev/actors/docs/deprecated/prevent-sleep",
|
|
3536
3530
|
});
|
|
3537
3531
|
}
|
|
3538
3532
|
|
|
3539
|
-
/** @deprecated Use `keepAwake(promise)` or `waitUntil(promise)
|
|
3533
|
+
/** @deprecated `preventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op that always returns `false`. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
3540
3534
|
get preventSleep(): boolean {
|
|
3541
3535
|
logger().warn({
|
|
3542
|
-
msg: "preventSleep
|
|
3536
|
+
msg: "preventSleep was deprecated in 3.0 and will be removed in a future version. It always returns false; use keepAwake(promise) or waitUntil(promise) instead. See https://rivet.dev/actors/docs/deprecated/prevent-sleep",
|
|
3543
3537
|
});
|
|
3544
3538
|
return false;
|
|
3545
3539
|
}
|
|
@@ -4009,7 +4003,6 @@ function buildActorConfig(
|
|
|
4009
4003
|
definition.config.actions,
|
|
4010
4004
|
definition.config.tracing,
|
|
4011
4005
|
),
|
|
4012
|
-
enableActorRuntimeSocket: options.enableActorRuntimeSocket === true,
|
|
4013
4006
|
hasState:
|
|
4014
4007
|
config.state !== undefined ||
|
|
4015
4008
|
typeof config.createState === "function",
|
package/src/registry/runtime.ts
CHANGED
|
@@ -248,10 +248,6 @@ export type RuntimeSqlBindParam =
|
|
|
248
248
|
|
|
249
249
|
export type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
250
250
|
|
|
251
|
-
export interface RuntimeActorRuntimeSocketEndpointInfo {
|
|
252
|
-
path: string;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
251
|
export interface RuntimeSqlQueryResult {
|
|
256
252
|
columns: string[];
|
|
257
253
|
rows: unknown[][];
|
|
@@ -332,7 +328,6 @@ export interface RuntimeActorConfig {
|
|
|
332
328
|
remoteSqlite?: boolean;
|
|
333
329
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
334
330
|
tracing?: RuntimeActorTracingConfig;
|
|
335
|
-
enableActorRuntimeSocket?: boolean;
|
|
336
331
|
hasState?: boolean;
|
|
337
332
|
canHibernateWebsocket?: boolean;
|
|
338
333
|
stateSaveIntervalMs?: number;
|
|
@@ -760,9 +755,6 @@ export interface CoreRuntime {
|
|
|
760
755
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
761
756
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
762
757
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
763
|
-
actorRuntimeSocketProvision(
|
|
764
|
-
ctx: ActorContextHandle,
|
|
765
|
-
): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
766
758
|
|
|
767
759
|
actorQueueSend(
|
|
768
760
|
ctx: ActorContextHandle,
|
|
@@ -970,20 +970,6 @@ export class WasmCoreRuntime implements CoreRuntime {
|
|
|
970
970
|
await callWasm(() => database.close());
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
-
async actorRuntimeSocketProvision(
|
|
974
|
-
_ctx: ActorContextHandle,
|
|
975
|
-
): Promise<never> {
|
|
976
|
-
throw new RivetError(
|
|
977
|
-
"actor_runtime_socket",
|
|
978
|
-
"unsupported",
|
|
979
|
-
"Actor Runtime Socket is only available on Unix native runtimes.",
|
|
980
|
-
{
|
|
981
|
-
public: true,
|
|
982
|
-
metadata: { runtime: "wasm" },
|
|
983
|
-
},
|
|
984
|
-
);
|
|
985
|
-
}
|
|
986
|
-
|
|
987
973
|
async actorQueueSend(
|
|
988
974
|
ctx: ActorContextHandle,
|
|
989
975
|
name: string,
|
package/src/workflow/context.ts
CHANGED
|
@@ -361,6 +361,7 @@ export class WorkflowStepContext<
|
|
|
361
361
|
return this.#runCtx.abortSignal;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
364
365
|
get state(): TState extends never ? never : TState {
|
|
365
366
|
this.#ensureActive("state");
|
|
366
367
|
return this.#runCtx.state as TState extends never ? never : TState;
|
|
@@ -399,6 +400,7 @@ export class WorkflowStepContext<
|
|
|
399
400
|
);
|
|
400
401
|
}
|
|
401
402
|
|
|
403
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
402
404
|
get queue() {
|
|
403
405
|
const self = this;
|
|
404
406
|
function send<K extends keyof TQueues & string>(
|
|
@@ -510,6 +512,7 @@ export class WorkflowContext<
|
|
|
510
512
|
return this.#runCtx.log;
|
|
511
513
|
}
|
|
512
514
|
|
|
515
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
513
516
|
get queue() {
|
|
514
517
|
const self = this;
|
|
515
518
|
function next<
|