rivetkit 0.0.0-sqlite-profiling-compat.4a9a623 → 0.0.0-sqlite-sync-3-0-0-release.14341d0
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 +1317 -765
- package/dist/browser/client.js +1433 -692
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +252 -129
- package/dist/browser/inspector/client.js +2042 -228
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +6 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/actor/errors.js +5 -1
- package/dist/tsup/agent-os/index.cjs +3 -2367
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +1 -2277
- package/dist/tsup/agent-os/index.d.ts +1 -2277
- package/dist/tsup/agent-os/index.js +3 -2367
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-AGDY6TKH.js → chunk-2EQ2WCO7.js} +1054 -364
- package/dist/tsup/chunk-2EQ2WCO7.js.map +1 -0
- package/dist/tsup/{chunk-7QKCGUTJ.cjs → chunk-4H2LT2WB.cjs} +444 -29
- package/dist/tsup/chunk-4H2LT2WB.cjs.map +1 -0
- package/dist/tsup/{chunk-XIX5DOZN.js → chunk-6FEYCVZC.js} +196 -20
- package/dist/tsup/chunk-6FEYCVZC.js.map +1 -0
- package/dist/tsup/{chunk-QAVN4QNO.cjs → chunk-6WYQ3NJI.cjs} +7 -7
- package/dist/tsup/chunk-6WYQ3NJI.cjs.map +1 -0
- package/dist/tsup/{chunk-75UE45DE.js → chunk-6ZJX3KXW.js} +436 -21
- package/dist/tsup/chunk-6ZJX3KXW.js.map +1 -0
- package/dist/tsup/{chunk-HXUEHHJF.js → chunk-A2CF6PFH.js} +19 -11
- package/dist/tsup/chunk-A2CF6PFH.js.map +1 -0
- package/dist/tsup/{chunk-RIT7N3TX.js → chunk-AIGW2SKA.js} +50 -3
- package/dist/tsup/chunk-AIGW2SKA.js.map +1 -0
- package/dist/tsup/{chunk-3MHDOUD7.cjs → chunk-HDVZ6YZG.cjs} +197 -21
- package/dist/tsup/chunk-HDVZ6YZG.cjs.map +1 -0
- package/dist/tsup/{chunk-2CICCOBL.cjs → chunk-HU4F7H3F.cjs} +52 -5
- package/dist/tsup/chunk-HU4F7H3F.cjs.map +1 -0
- package/dist/tsup/{chunk-4PX3ZKJR.js → chunk-JNJEWQZL.js} +3 -3
- package/dist/tsup/chunk-JNJEWQZL.js.map +1 -0
- package/dist/tsup/{chunk-JZ7TWV65.js → chunk-JTHHCZCZ.js} +24 -1
- package/dist/tsup/chunk-JTHHCZCZ.js.map +1 -0
- package/dist/tsup/{chunk-ZA7FLHKH.cjs → chunk-KVFIONKQ.cjs} +25 -2
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -0
- package/dist/tsup/{chunk-4FC7TVS6.cjs → chunk-MGI2VVF6.cjs} +39 -7
- package/dist/tsup/chunk-MGI2VVF6.cjs.map +1 -0
- package/dist/tsup/{chunk-NHUTYWKU.cjs → chunk-NE5CUQRN.cjs} +1173 -483
- package/dist/tsup/chunk-NE5CUQRN.cjs.map +1 -0
- package/dist/tsup/{chunk-IICIOTML.js → chunk-OX5MX7TO.js} +2 -2
- package/dist/tsup/{chunk-ND567FR5.cjs → chunk-PSIBTOAR.cjs} +3 -3
- package/dist/tsup/chunk-PSIBTOAR.cjs.map +1 -0
- package/dist/tsup/chunk-PW6FYEIV.cjs +14 -0
- package/dist/tsup/chunk-PW6FYEIV.cjs.map +1 -0
- package/dist/tsup/{chunk-VE2X4KMG.cjs → chunk-RTWH3AX3.cjs} +18 -10
- package/dist/tsup/chunk-RTWH3AX3.cjs.map +1 -0
- package/dist/tsup/chunk-SLICBKAU.js +14 -0
- package/dist/tsup/chunk-SLICBKAU.js.map +1 -0
- package/dist/tsup/{chunk-XFYEVYHG.js → chunk-WCVYMFWJ.js} +16 -9
- package/dist/tsup/chunk-WCVYMFWJ.js.map +1 -0
- package/dist/tsup/chunk-WX3JS4XU.cjs +243 -0
- package/dist/tsup/chunk-WX3JS4XU.cjs.map +1 -0
- package/dist/tsup/chunk-X32L7FDD.js +243 -0
- package/dist/tsup/chunk-X32L7FDD.js.map +1 -0
- package/dist/tsup/{chunk-2WMYYG4R.cjs → chunk-XAY2HIZN.cjs} +18 -11
- package/dist/tsup/chunk-XAY2HIZN.cjs.map +1 -0
- package/dist/tsup/{chunk-ZZ3WBRPD.js → chunk-ZOVJDAOW.js} +38 -6
- package/dist/tsup/chunk-ZOVJDAOW.js.map +1 -0
- package/dist/tsup/client/mod.cjs +8 -9
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +32 -6
- package/dist/tsup/client/mod.d.ts +32 -6
- package/dist/tsup/client/mod.js +7 -8
- package/dist/tsup/common/log.cjs +5 -3
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.d.cts +5 -1
- package/dist/tsup/common/log.d.ts +5 -1
- package/dist/tsup/common/log.js +6 -4
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{config-BR1Nn0QQ.d.ts → config-B4erdavw.d.ts} +571 -65
- package/dist/tsup/{config-B0LNDrLY.d.ts → config-BfG1qpYz.d.cts} +80 -14
- package/dist/tsup/{config-B0LNDrLY.d.cts → config-BfG1qpYz.d.ts} +80 -14
- package/dist/tsup/{config-tCvkwzyN.d.cts → config-DK144OAw.d.cts} +571 -65
- package/dist/tsup/{context-oc9zhA3x.d.ts → context-Cvnf3BRe.d.cts} +3 -2
- package/dist/tsup/{context-D4WDwf9m.d.cts → context-Oxi6YWcG.d.ts} +3 -2
- package/dist/tsup/db/drizzle.cjs +127 -67
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +8 -4
- package/dist/tsup/db/drizzle.d.ts +8 -4
- package/dist/tsup/db/drizzle.js +127 -67
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +6 -126
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.d.cts +8 -4
- package/dist/tsup/db/mod.d.ts +8 -4
- package/dist/tsup/db/mod.js +5 -125
- package/dist/tsup/db/mod.js.map +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.cjs.map +1 -1
- package/dist/tsup/dynamic/mod.d.cts +6 -4
- package/dist/tsup/dynamic/mod.d.ts +6 -4
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +47 -12
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +26 -136
- package/dist/tsup/inspector/mod.d.ts +26 -136
- package/dist/tsup/inspector/mod.js +46 -11
- 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 -13
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.d.cts +9 -17
- package/dist/tsup/inspector-tab/mod.d.ts +9 -17
- package/dist/tsup/inspector-tab/mod.js +1 -12
- package/dist/tsup/inspector-tab/mod.js.map +1 -1
- package/dist/tsup/mod.cjs +2728 -611
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +9 -7
- package/dist/tsup/mod.d.ts +9 -7
- package/dist/tsup/mod.js +2645 -528
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +19 -17
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +6 -4
- package/dist/tsup/test/mod.d.ts +6 -4
- package/dist/tsup/test/mod.js +18 -16
- package/dist/tsup/test/mod.js.map +1 -1
- package/dist/tsup/unstable/migrations.cjs +101 -0
- package/dist/tsup/unstable/migrations.cjs.map +1 -0
- package/dist/tsup/unstable/migrations.d.cts +29 -0
- package/dist/tsup/unstable/migrations.d.ts +29 -0
- package/dist/tsup/unstable/migrations.js +101 -0
- package/dist/tsup/unstable/migrations.js.map +1 -0
- package/dist/tsup/{utils-CqDnC_PS.d.cts → utils-3rsE0JvI.d.cts} +25 -2
- package/dist/tsup/{utils-CqDnC_PS.d.ts → utils-3rsE0JvI.d.ts} +25 -2
- package/dist/tsup/utils-C1O-SklO.d.ts +162 -0
- package/dist/tsup/utils-C6b0aYUM.d.cts +162 -0
- package/dist/tsup/utils.cjs +7 -3
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.d.cts +4 -147
- package/dist/tsup/utils.d.ts +4 -147
- package/dist/tsup/utils.js +6 -2
- package/dist/tsup/workflow/mod.cjs +260 -200
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +8 -6
- package/dist/tsup/workflow/mod.d.ts +8 -6
- package/dist/tsup/workflow/mod.js +249 -189
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +34 -14
- package/src/actor/actions.ts +155 -0
- package/src/actor/config.ts +403 -43
- package/src/actor/definition.ts +26 -7
- package/src/actor/errors.ts +87 -5
- package/src/actor/keys.ts +86 -0
- package/src/actor/mod.ts +15 -1
- package/src/actor/tracing.ts +28 -0
- package/src/agent-os/index.ts +5 -65
- package/src/client/actor-common.ts +8 -15
- package/src/client/actor-conn.ts +178 -25
- package/src/client/actor-handle.ts +180 -42
- package/src/client/actor-query.ts +8 -1
- package/src/client/auth.ts +37 -0
- package/src/client/client.ts +89 -21
- package/src/client/config.ts +27 -2
- package/src/client/errors.ts +2 -1
- package/src/client/lifecycle-errors.ts +29 -1
- package/src/client/mod.ts +9 -0
- package/src/client/outbound-telemetry.ts +66 -0
- package/src/client/query.ts +2 -0
- package/src/client/queue.ts +3 -0
- package/src/client/raw-utils.ts +37 -8
- package/src/client/resolve-gateway-target.ts +2 -0
- package/src/client/retry-budget.ts +78 -0
- package/src/client/token-provider.ts +93 -0
- package/src/client/utils.ts +16 -2
- package/src/common/actor-router-consts.ts +5 -0
- package/src/common/actor-telemetry-context.ts +19 -0
- package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +848 -0
- package/src/common/bare/generated/inspector/v5.ts +1016 -0
- package/src/common/bare/generated/inspector/v6.ts +1367 -0
- package/src/common/bare/transport/v1.ts +36 -0
- package/src/common/database/config.ts +108 -15
- package/src/common/database/mod.ts +247 -76
- package/src/common/database/native-database.ts +433 -23
- package/src/common/database/shared.ts +24 -0
- package/src/common/encoding.ts +31 -21
- package/src/common/fetch-like.ts +63 -0
- package/src/common/inspector-transport.ts +12 -2
- package/src/common/log.ts +14 -8
- package/src/common/otel-context.ts +99 -0
- package/src/common/router.ts +1 -1
- package/src/common/utils.ts +7 -19
- package/src/db/drizzle.ts +182 -80
- package/src/db/mod.ts +2 -0
- package/src/dynamic/isolate-runtime.ts +0 -2
- package/src/engine-api/actors.ts +3 -3
- package/src/engine-client/actor-http-client.ts +29 -20
- package/src/engine-client/actor-websocket-client.ts +6 -3
- package/src/engine-client/api-endpoints.ts +72 -14
- package/src/engine-client/driver.ts +8 -15
- package/src/engine-client/mod.ts +248 -112
- package/src/inspector/client.browser.ts +134 -16
- package/src/inspector/mod.ts +1 -1
- package/src/inspector/workflow.ts +61 -0
- package/src/inspector-tab/mod.ts +1 -15
- package/src/registry/config/envoy.ts +2 -18
- package/src/registry/config/index.ts +54 -61
- package/src/registry/index.ts +324 -21
- package/src/registry/napi-runtime.ts +583 -39
- package/src/registry/native-http.ts +225 -0
- package/src/registry/native.ts +1365 -414
- package/src/registry/run-handler-coordinator.ts +219 -0
- package/src/registry/runtime.ts +372 -7
- package/src/registry/wasm-runtime.ts +490 -21
- package/src/registry/write-through-proxy.ts +101 -0
- package/src/test/mod.ts +1 -19
- package/src/test/ready.ts +22 -0
- package/src/unstable/migrations.ts +141 -0
- package/src/utils/env-vars.ts +15 -6
- package/src/utils/node.ts +44 -28
- package/src/utils.ts +3 -0
- package/src/workflow/context.ts +9 -27
- package/src/workflow/driver.ts +253 -116
- package/src/workflow/inspector.ts +23 -24
- package/src/workflow/mod.ts +50 -72
- package/dist/tsup/chunk-2CICCOBL.cjs.map +0 -1
- package/dist/tsup/chunk-2WMYYG4R.cjs.map +0 -1
- package/dist/tsup/chunk-3MHDOUD7.cjs.map +0 -1
- package/dist/tsup/chunk-4FC7TVS6.cjs.map +0 -1
- package/dist/tsup/chunk-4PX3ZKJR.js.map +0 -1
- package/dist/tsup/chunk-75UE45DE.js.map +0 -1
- package/dist/tsup/chunk-7QKCGUTJ.cjs.map +0 -1
- package/dist/tsup/chunk-AGDY6TKH.js.map +0 -1
- package/dist/tsup/chunk-HXUEHHJF.js.map +0 -1
- package/dist/tsup/chunk-JZ7TWV65.js.map +0 -1
- package/dist/tsup/chunk-ND567FR5.cjs.map +0 -1
- package/dist/tsup/chunk-NHUTYWKU.cjs.map +0 -1
- package/dist/tsup/chunk-QAVN4QNO.cjs.map +0 -1
- package/dist/tsup/chunk-RIT7N3TX.js.map +0 -1
- package/dist/tsup/chunk-RV5MAFDT.cjs +0 -382
- package/dist/tsup/chunk-RV5MAFDT.cjs.map +0 -1
- package/dist/tsup/chunk-VE2X4KMG.cjs.map +0 -1
- package/dist/tsup/chunk-XFYEVYHG.js.map +0 -1
- package/dist/tsup/chunk-XHGDS3DZ.js +0 -382
- package/dist/tsup/chunk-XHGDS3DZ.js.map +0 -1
- package/dist/tsup/chunk-XIX5DOZN.js.map +0 -1
- package/dist/tsup/chunk-ZA7FLHKH.cjs.map +0 -1
- package/dist/tsup/chunk-ZZ3WBRPD.js.map +0 -1
- package/src/actor/driver.ts +0 -141
- package/src/actor/instance/mod.ts +0 -2484
- package/src/actor/keys.test.ts +0 -275
- package/src/actor/utils.test.ts +0 -48
- package/src/agent-os/actor/cron.ts +0 -84
- package/src/agent-os/actor/db.ts +0 -54
- package/src/agent-os/actor/filesystem.ts +0 -131
- package/src/agent-os/actor/index.ts +0 -285
- package/src/agent-os/actor/network.ts +0 -58
- package/src/agent-os/actor/preview.ts +0 -190
- package/src/agent-os/actor/process.ts +0 -177
- package/src/agent-os/actor/session.ts +0 -518
- package/src/agent-os/actor/shell.ts +0 -60
- package/src/agent-os/config.ts +0 -79
- package/src/agent-os/fs/database-vfs.ts +0 -624
- package/src/agent-os/types.ts +0 -148
- package/src/client/test.ts +0 -44
- package/src/common/database/mod.test.ts +0 -137
- package/src/common/database/native-database.test.ts +0 -211
- package/src/common/inline-websocket-adapter.test.ts +0 -51
- package/src/drivers/engine/actor-driver.ts +0 -2473
- package/src/registry/process-metrics.ts +0 -250
- package/src/registry/runtime.test.ts +0 -50
- package/src/utils/endpoint-parser.test.ts +0 -206
- package/src/utils.test.ts +0 -34
- /package/dist/tsup/{chunk-IICIOTML.js.map → chunk-OX5MX7TO.js.map} +0 -0
|
@@ -3,22 +3,25 @@ import * as v1 from "@/common/bare/generated/inspector/v1";
|
|
|
3
3
|
import * as v2 from "@/common/bare/generated/inspector/v2";
|
|
4
4
|
import * as v3 from "@/common/bare/generated/inspector/v3";
|
|
5
5
|
import * as v4 from "@/common/bare/generated/inspector/v4";
|
|
6
|
+
import * as v5 from "@/common/bare/generated/inspector/v5";
|
|
7
|
+
import * as v6 from "@/common/bare/generated/inspector/v6";
|
|
6
8
|
import {
|
|
7
9
|
decodeWorkflowHistoryTransport,
|
|
8
10
|
encodeWorkflowHistoryTransport,
|
|
9
11
|
} from "@/common/inspector-transport";
|
|
10
12
|
|
|
11
|
-
export * from "@/common/bare/generated/inspector/
|
|
13
|
+
export * from "@/common/bare/generated/inspector/v6";
|
|
12
14
|
export { decodeWorkflowHistoryTransport, encodeWorkflowHistoryTransport };
|
|
13
15
|
export type { WorkflowHistory as TransportWorkflowHistory } from "@/common/bare/transport/v1";
|
|
14
16
|
|
|
15
|
-
export const CURRENT_VERSION =
|
|
17
|
+
export const CURRENT_VERSION = 6;
|
|
16
18
|
|
|
17
19
|
const EVENTS_DROPPED_ERROR = "inspector.events_dropped";
|
|
18
20
|
const WORKFLOW_HISTORY_DROPPED_ERROR = "inspector.workflow_history_dropped";
|
|
19
21
|
const QUEUE_DROPPED_ERROR = "inspector.queue_dropped";
|
|
20
22
|
const TRACE_DROPPED_ERROR = "inspector.trace_dropped";
|
|
21
23
|
const DATABASE_DROPPED_ERROR = "inspector.database_dropped";
|
|
24
|
+
const SCHEDULES_DROPPED_ERROR = "inspector.schedules_dropped";
|
|
22
25
|
|
|
23
26
|
const v1ToClientToV2 = (v1Data: v1.ToClient): v2.ToClient => {
|
|
24
27
|
if (v1Data.body.tag === "Init") {
|
|
@@ -156,6 +159,89 @@ const v4ToClientToV3 = (v4Data: v4.ToClient): v3.ToClient => {
|
|
|
156
159
|
return v4Data as unknown as v3.ToClient;
|
|
157
160
|
};
|
|
158
161
|
|
|
162
|
+
const v4ToClientToV5 = (v4Data: v4.ToClient): v5.ToClient => {
|
|
163
|
+
if (v4Data.body.tag === "Init") {
|
|
164
|
+
// A v4 runtime predates tab config in Init; default to an empty list.
|
|
165
|
+
// The client reads that as "no custom tabs" (built-in tabs only).
|
|
166
|
+
const init = v4Data.body.val;
|
|
167
|
+
return {
|
|
168
|
+
body: {
|
|
169
|
+
tag: "Init",
|
|
170
|
+
val: { ...init, tabConfig: [] },
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return v4Data as unknown as v5.ToClient;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const v5ToClientToV4 = (v5Data: v5.ToClient): v4.ToClient => {
|
|
179
|
+
if (v5Data.body.tag === "Init") {
|
|
180
|
+
const { tabConfig: _tabConfig, ...rest } = v5Data.body.val;
|
|
181
|
+
return {
|
|
182
|
+
body: {
|
|
183
|
+
tag: "Init",
|
|
184
|
+
val: rest,
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return v5Data as unknown as v4.ToClient;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const v5ToClientToV6 = (v5Data: v5.ToClient): v6.ToClient => {
|
|
193
|
+
if (v5Data.body.tag === "Init") {
|
|
194
|
+
return {
|
|
195
|
+
body: {
|
|
196
|
+
tag: "Init",
|
|
197
|
+
val: { ...v5Data.body.val, schedules: [] },
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
return v5Data as unknown as v6.ToClient;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const v6ToClientToV5 = (v6Data: v6.ToClient): v5.ToClient => {
|
|
205
|
+
if (v6Data.body.tag === "Init") {
|
|
206
|
+
const { schedules: _schedules, ...rest } = v6Data.body.val;
|
|
207
|
+
return { body: { tag: "Init", val: rest } };
|
|
208
|
+
}
|
|
209
|
+
if (
|
|
210
|
+
v6Data.body.tag === "SchedulesUpdated" ||
|
|
211
|
+
v6Data.body.tag === "SchedulesResponse" ||
|
|
212
|
+
v6Data.body.tag === "ScheduleHistoryResponse" ||
|
|
213
|
+
v6Data.body.tag === "ScheduleDeleteResponse"
|
|
214
|
+
) {
|
|
215
|
+
return {
|
|
216
|
+
body: {
|
|
217
|
+
tag: "Error",
|
|
218
|
+
val: { message: SCHEDULES_DROPPED_ERROR },
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return v6Data as unknown as v5.ToClient;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const v4ToServerToV5 = (v4Data: v4.ToServer): v5.ToServer =>
|
|
226
|
+
v4Data as unknown as v5.ToServer;
|
|
227
|
+
|
|
228
|
+
const v5ToServerToV4 = (v5Data: v5.ToServer): v4.ToServer =>
|
|
229
|
+
v5Data as unknown as v4.ToServer;
|
|
230
|
+
|
|
231
|
+
const v5ToServerToV6 = (v5Data: v5.ToServer): v6.ToServer =>
|
|
232
|
+
v5Data as unknown as v6.ToServer;
|
|
233
|
+
|
|
234
|
+
const v6ToServerToV5 = (v6Data: v6.ToServer): v5.ToServer => {
|
|
235
|
+
if (
|
|
236
|
+
v6Data.body.tag === "SchedulesRequest" ||
|
|
237
|
+
v6Data.body.tag === "ScheduleHistoryRequest" ||
|
|
238
|
+
v6Data.body.tag === "ScheduleDeleteRequest"
|
|
239
|
+
) {
|
|
240
|
+
throw new Error("Cannot convert v6-only schedule requests to v5");
|
|
241
|
+
}
|
|
242
|
+
return v6Data as unknown as v5.ToServer;
|
|
243
|
+
};
|
|
244
|
+
|
|
159
245
|
const v1ToServerToV2 = (v1Data: v1.ToServer): v2.ToServer => {
|
|
160
246
|
if (
|
|
161
247
|
v1Data.body.tag === "EventsRequest" ||
|
|
@@ -206,7 +292,7 @@ const v4ToServerToV3 = (v4Data: v4.ToServer): v3.ToServer => {
|
|
|
206
292
|
return v4Data as unknown as v3.ToServer;
|
|
207
293
|
};
|
|
208
294
|
|
|
209
|
-
export const TO_SERVER_VERSIONED = createVersionedDataHandler<
|
|
295
|
+
export const TO_SERVER_VERSIONED = createVersionedDataHandler<v6.ToServer>({
|
|
210
296
|
serializeVersion: (data, version) => {
|
|
211
297
|
switch (version) {
|
|
212
298
|
case 1:
|
|
@@ -216,7 +302,11 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
|
|
|
216
302
|
case 3:
|
|
217
303
|
return v3.encodeToServer(data as unknown as v3.ToServer);
|
|
218
304
|
case 4:
|
|
219
|
-
return v4.encodeToServer(data);
|
|
305
|
+
return v4.encodeToServer(data as unknown as v4.ToServer);
|
|
306
|
+
case 5:
|
|
307
|
+
return v5.encodeToServer(data as unknown as v5.ToServer);
|
|
308
|
+
case 6:
|
|
309
|
+
return v6.encodeToServer(data);
|
|
220
310
|
default:
|
|
221
311
|
throw new Error(`Unknown version ${version}`);
|
|
222
312
|
}
|
|
@@ -224,13 +314,17 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
|
|
|
224
314
|
deserializeVersion: (bytes, version) => {
|
|
225
315
|
switch (version) {
|
|
226
316
|
case 1:
|
|
227
|
-
return v1.decodeToServer(bytes) as unknown as
|
|
317
|
+
return v1.decodeToServer(bytes) as unknown as v5.ToServer;
|
|
228
318
|
case 2:
|
|
229
|
-
return v2.decodeToServer(bytes) as unknown as
|
|
319
|
+
return v2.decodeToServer(bytes) as unknown as v5.ToServer;
|
|
230
320
|
case 3:
|
|
231
|
-
return v3.decodeToServer(bytes) as unknown as
|
|
321
|
+
return v3.decodeToServer(bytes) as unknown as v5.ToServer;
|
|
232
322
|
case 4:
|
|
233
|
-
return v4.decodeToServer(bytes);
|
|
323
|
+
return v4.decodeToServer(bytes) as unknown as v5.ToServer;
|
|
324
|
+
case 5:
|
|
325
|
+
return v5.decodeToServer(bytes) as unknown as v6.ToServer;
|
|
326
|
+
case 6:
|
|
327
|
+
return v6.decodeToServer(bytes);
|
|
234
328
|
default:
|
|
235
329
|
throw new Error(`Unknown version ${version}`);
|
|
236
330
|
}
|
|
@@ -239,11 +333,19 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
|
|
|
239
333
|
v1ToServerToV2,
|
|
240
334
|
v2ToServerToV3,
|
|
241
335
|
v3ToServerToV4,
|
|
336
|
+
v4ToServerToV5,
|
|
337
|
+
v5ToServerToV6,
|
|
338
|
+
],
|
|
339
|
+
serializeConverters: () => [
|
|
340
|
+
v6ToServerToV5,
|
|
341
|
+
v5ToServerToV4,
|
|
342
|
+
v4ToServerToV3,
|
|
343
|
+
v3ToServerToV2,
|
|
344
|
+
v2ToServerToV1,
|
|
242
345
|
],
|
|
243
|
-
serializeConverters: () => [v4ToServerToV3, v3ToServerToV2, v2ToServerToV1],
|
|
244
346
|
});
|
|
245
347
|
|
|
246
|
-
export const TO_CLIENT_VERSIONED = createVersionedDataHandler<
|
|
348
|
+
export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v6.ToClient>({
|
|
247
349
|
serializeVersion: (data, version) => {
|
|
248
350
|
switch (version) {
|
|
249
351
|
case 1:
|
|
@@ -253,7 +355,11 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
|
|
|
253
355
|
case 3:
|
|
254
356
|
return v3.encodeToClient(data as unknown as v3.ToClient);
|
|
255
357
|
case 4:
|
|
256
|
-
return v4.encodeToClient(data);
|
|
358
|
+
return v4.encodeToClient(data as unknown as v4.ToClient);
|
|
359
|
+
case 5:
|
|
360
|
+
return v5.encodeToClient(data as unknown as v5.ToClient);
|
|
361
|
+
case 6:
|
|
362
|
+
return v6.encodeToClient(data);
|
|
257
363
|
default:
|
|
258
364
|
throw new Error(`Unknown version ${version}`);
|
|
259
365
|
}
|
|
@@ -261,13 +367,17 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
|
|
|
261
367
|
deserializeVersion: (bytes, version) => {
|
|
262
368
|
switch (version) {
|
|
263
369
|
case 1:
|
|
264
|
-
return v1.decodeToClient(bytes) as unknown as
|
|
370
|
+
return v1.decodeToClient(bytes) as unknown as v5.ToClient;
|
|
265
371
|
case 2:
|
|
266
|
-
return v2.decodeToClient(bytes) as unknown as
|
|
372
|
+
return v2.decodeToClient(bytes) as unknown as v5.ToClient;
|
|
267
373
|
case 3:
|
|
268
|
-
return v3.decodeToClient(bytes) as unknown as
|
|
374
|
+
return v3.decodeToClient(bytes) as unknown as v5.ToClient;
|
|
269
375
|
case 4:
|
|
270
|
-
return v4.decodeToClient(bytes);
|
|
376
|
+
return v4.decodeToClient(bytes) as unknown as v5.ToClient;
|
|
377
|
+
case 5:
|
|
378
|
+
return v5.decodeToClient(bytes) as unknown as v6.ToClient;
|
|
379
|
+
case 6:
|
|
380
|
+
return v6.decodeToClient(bytes);
|
|
271
381
|
default:
|
|
272
382
|
throw new Error(`Unknown version ${version}`);
|
|
273
383
|
}
|
|
@@ -276,6 +386,14 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
|
|
|
276
386
|
v1ToClientToV2,
|
|
277
387
|
v2ToClientToV3,
|
|
278
388
|
v3ToClientToV4,
|
|
389
|
+
v4ToClientToV5,
|
|
390
|
+
v5ToClientToV6,
|
|
391
|
+
],
|
|
392
|
+
serializeConverters: () => [
|
|
393
|
+
v6ToClientToV5,
|
|
394
|
+
v5ToClientToV4,
|
|
395
|
+
v4ToClientToV3,
|
|
396
|
+
v3ToClientToV2,
|
|
397
|
+
v2ToClientToV1,
|
|
279
398
|
],
|
|
280
|
-
serializeConverters: () => [v4ToClientToV3, v3ToClientToV2, v2ToClientToV1],
|
|
281
399
|
});
|
package/src/inspector/mod.ts
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { JsonCompatValue } from "@/common/encoding";
|
|
2
|
+
import type { WorkflowHistoryBytes } from "@/common/inspector-transport";
|
|
3
|
+
import { encodeCborCompat } from "@/serde";
|
|
4
|
+
import { bufferToArrayBuffer } from "@/utils";
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
WorkflowBranchStatus,
|
|
8
|
+
WorkflowCbor,
|
|
9
|
+
WorkflowEntry,
|
|
10
|
+
WorkflowEntryKind,
|
|
11
|
+
WorkflowEntryMetadata,
|
|
12
|
+
WorkflowHistory,
|
|
13
|
+
WorkflowJoinEntry,
|
|
14
|
+
WorkflowLocation,
|
|
15
|
+
WorkflowLoopEntry,
|
|
16
|
+
WorkflowLoopIterationMarker,
|
|
17
|
+
WorkflowMessageEntry,
|
|
18
|
+
WorkflowNameIndex,
|
|
19
|
+
WorkflowPathSegment,
|
|
20
|
+
WorkflowRaceEntry,
|
|
21
|
+
WorkflowRemovedEntry,
|
|
22
|
+
WorkflowRollbackCheckpointEntry,
|
|
23
|
+
WorkflowSleepEntry,
|
|
24
|
+
WorkflowStepEntry,
|
|
25
|
+
WorkflowVersionCheckEntry,
|
|
26
|
+
} from "@/common/bare/transport/v1";
|
|
27
|
+
export {
|
|
28
|
+
WorkflowBranchStatusType,
|
|
29
|
+
WorkflowEntryStatus,
|
|
30
|
+
WorkflowSleepState,
|
|
31
|
+
} from "@/common/bare/transport/v1";
|
|
32
|
+
export type { WorkflowHistoryBytes } from "@/common/inspector-transport";
|
|
33
|
+
export {
|
|
34
|
+
decodeWorkflowHistoryTransport,
|
|
35
|
+
encodeWorkflowHistoryTransport,
|
|
36
|
+
} from "@/common/inspector-transport";
|
|
37
|
+
|
|
38
|
+
/** @experimental State exposed by a durable workflow run handler to the Inspector. */
|
|
39
|
+
export type WorkflowState =
|
|
40
|
+
| "pending"
|
|
41
|
+
| "running"
|
|
42
|
+
| "sleeping"
|
|
43
|
+
| "failed"
|
|
44
|
+
| "completed"
|
|
45
|
+
| "cancelled"
|
|
46
|
+
| "rolling_back";
|
|
47
|
+
|
|
48
|
+
/** @experimental The raw workflow Inspector adapter consumed by RivetKit's transport. */
|
|
49
|
+
export interface WorkflowInspectorAdapter {
|
|
50
|
+
getHistory: () => WorkflowHistoryBytes | null;
|
|
51
|
+
getState: () => Promise<WorkflowState | null>;
|
|
52
|
+
onHistoryUpdated: (
|
|
53
|
+
listener: (history: WorkflowHistoryBytes) => void,
|
|
54
|
+
) => () => void;
|
|
55
|
+
replayFromStep: (entryId?: string) => Promise<WorkflowHistoryBytes | null>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @experimental Encodes a workflow Inspector value with RivetKit's CBOR-compatible codec. */
|
|
59
|
+
export function encodeWorkflowInspectorValue(value: unknown): ArrayBuffer {
|
|
60
|
+
return bufferToArrayBuffer(encodeCborCompat(value as JsonCompatValue));
|
|
61
|
+
}
|
package/src/inspector-tab/mod.ts
CHANGED
|
@@ -69,6 +69,7 @@ export type BuiltinInspectorTabId =
|
|
|
69
69
|
| "database"
|
|
70
70
|
| "state"
|
|
71
71
|
| "queue"
|
|
72
|
+
| "schedules"
|
|
72
73
|
| "connections"
|
|
73
74
|
| "console";
|
|
74
75
|
|
|
@@ -280,18 +281,6 @@ export const InspectorQueueResponseSchema = z.object({
|
|
|
280
281
|
messages: z.array(InspectorQueueMessageSchema),
|
|
281
282
|
});
|
|
282
283
|
|
|
283
|
-
/** `GET /inspector/tab-config` response shape. */
|
|
284
|
-
export const InspectorTabConfigResponseSchema = z.object({
|
|
285
|
-
tabs: z.array(
|
|
286
|
-
z.object({
|
|
287
|
-
id: z.string(),
|
|
288
|
-
label: z.string().optional(),
|
|
289
|
-
icon: z.string().nullable().optional(),
|
|
290
|
-
hidden: z.boolean().optional(),
|
|
291
|
-
}),
|
|
292
|
-
),
|
|
293
|
-
});
|
|
294
|
-
|
|
295
284
|
export type InspectorStateResponse = z.infer<
|
|
296
285
|
typeof InspectorStateResponseSchema
|
|
297
286
|
>;
|
|
@@ -310,6 +299,3 @@ export type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;
|
|
|
310
299
|
export type InspectorQueueResponse = z.infer<
|
|
311
300
|
typeof InspectorQueueResponseSchema
|
|
312
301
|
>;
|
|
313
|
-
export type InspectorTabConfigResponse = z.infer<
|
|
314
|
-
typeof InspectorTabConfigResponseSchema
|
|
315
|
-
>;
|
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
import { getLogger } from "@/common/log";
|
|
3
2
|
import {
|
|
4
|
-
getNodeEnv,
|
|
5
3
|
getRivetEnvoyVersion,
|
|
6
4
|
getRivetPool,
|
|
7
5
|
getRivetTotalSlots,
|
|
8
6
|
} from "@/utils/env-vars";
|
|
9
7
|
|
|
10
|
-
let warnedMissingVersion = false;
|
|
11
|
-
|
|
12
8
|
export const EnvoyConfigSchema = z.object({
|
|
13
9
|
poolName: z.string().default(() => getRivetPool() ?? "default"),
|
|
14
|
-
version: z.number().default(() =>
|
|
15
|
-
const version = getRivetEnvoyVersion();
|
|
16
|
-
if (version !== undefined) return version;
|
|
17
|
-
|
|
18
|
-
if (getNodeEnv() === "production" && !warnedMissingVersion) {
|
|
19
|
-
warnedMissingVersion = true;
|
|
20
|
-
getLogger("rivetkit").error(
|
|
21
|
-
"RIVET_ENVOY_VERSION is not set. Actors will not be versioned, which means they won't be drained on deploy. This is only needed when self-hosting or using a custom envoy (not needed for Rivet Compute). Set this as a build arg in your Dockerfile. See https://rivet.dev/docs/actors/versions",
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return 1;
|
|
26
|
-
}),
|
|
10
|
+
version: z.number().default(() => getRivetEnvoyVersion() ?? 1),
|
|
27
11
|
|
|
28
12
|
// Deprecated.
|
|
29
13
|
totalSlots: z.number().default(() => getRivetTotalSlots() ?? 100000),
|
|
30
|
-
|
|
14
|
+
nodeKey: z.string().optional(),
|
|
31
15
|
});
|
|
32
16
|
export type EnvoyConfigInput = z.input<typeof EnvoyConfigSchema>;
|
|
33
17
|
export type EnvoyConfig = z.infer<typeof EnvoyConfigSchema>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getRunMetadata } from "@/actor/config";
|
|
3
|
-
import type {
|
|
4
|
-
AnyActorDefinition,
|
|
5
|
-
BaseActorDefinition,
|
|
6
|
-
} from "@/actor/definition";
|
|
3
|
+
import type { AnyActorDefinition } from "@/actor/definition";
|
|
7
4
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "@/
|
|
13
|
-
import { buildEngineEndpoint, ENGINE_HOST, ENGINE_PORT } from "@/common/engine";
|
|
5
|
+
buildEngineEndpoint,
|
|
6
|
+
ENGINE_HOST,
|
|
7
|
+
ENGINE_PORT,
|
|
8
|
+
isLocalEngineEndpoint,
|
|
9
|
+
} from "@/common/engine";
|
|
14
10
|
import { type Logger, LogLevelSchema } from "@/common/log";
|
|
15
11
|
import { VERSION } from "@/utils";
|
|
16
12
|
import { tryParseEndpoint } from "@/utils/endpoint-parser";
|
|
@@ -23,6 +19,7 @@ import {
|
|
|
23
19
|
getRivetRunEngineHost,
|
|
24
20
|
getRivetRunEnginePort,
|
|
25
21
|
getRivetRunEngineVersion,
|
|
22
|
+
getRivetRunServices,
|
|
26
23
|
getRivetToken,
|
|
27
24
|
isDev,
|
|
28
25
|
} from "@/utils/env-vars";
|
|
@@ -161,7 +158,7 @@ export const RegistryConfigSchema = z
|
|
|
161
158
|
// // created or must be imported async using `await import(...)`
|
|
162
159
|
// getUpgradeWebSocket: z.custom<GetUpgradeWebSocket>().optional(),
|
|
163
160
|
|
|
164
|
-
// MARK:
|
|
161
|
+
// MARK: Node Configuration
|
|
165
162
|
/**
|
|
166
163
|
* Endpoint to connect to for Rivet Engine.
|
|
167
164
|
*
|
|
@@ -252,10 +249,16 @@ export const RegistryConfigSchema = z
|
|
|
252
249
|
.string()
|
|
253
250
|
.optional()
|
|
254
251
|
.default(() => getRivetRunEngineVersion() ?? VERSION),
|
|
252
|
+
/**
|
|
253
|
+
* Starts the first-party Services actor host when RivetKit manages
|
|
254
|
+
* a local engine. Disabled by default. Set RIVET_RUN_SERVICES=1
|
|
255
|
+
* or startServices: true to enable it.
|
|
256
|
+
*/
|
|
257
|
+
startServices: z.boolean().optional(),
|
|
255
258
|
/**
|
|
256
259
|
* @experimental
|
|
257
260
|
*
|
|
258
|
-
* Automatically configure serverless
|
|
261
|
+
* Automatically configure serverless nodes in the engine.
|
|
259
262
|
*/
|
|
260
263
|
configurePool: ConfigurePoolSchema.optional(),
|
|
261
264
|
|
|
@@ -263,7 +266,7 @@ export const RegistryConfigSchema = z
|
|
|
263
266
|
serverless: ServerlessConfigSchema.optional().default(() =>
|
|
264
267
|
ServerlessConfigSchema.parse({}),
|
|
265
268
|
),
|
|
266
|
-
|
|
269
|
+
node: EnvoyConfigSchema.optional().default(() =>
|
|
267
270
|
EnvoyConfigSchema.parse({}),
|
|
268
271
|
),
|
|
269
272
|
|
|
@@ -271,9 +274,9 @@ export const RegistryConfigSchema = z
|
|
|
271
274
|
/**
|
|
272
275
|
* Graceful shutdown configuration for SIGINT/SIGTERM.
|
|
273
276
|
*
|
|
274
|
-
* When a persistent
|
|
277
|
+
* When a persistent node is running (Mode A, started via `registry.start()`),
|
|
275
278
|
* rivetkit installs Node SIGINT/SIGTERM handlers that call into core's
|
|
276
|
-
* `shutdown()` and wait up to `gracePeriodMs` for the
|
|
279
|
+
* `shutdown()` and wait up to `gracePeriodMs` for the node to drain
|
|
277
280
|
* before re-raising the signal to let Node exit via its default path.
|
|
278
281
|
*
|
|
279
282
|
* Handlers are NOT installed when `handler(request)` is used alone
|
|
@@ -286,9 +289,12 @@ export const RegistryConfigSchema = z
|
|
|
286
289
|
/**
|
|
287
290
|
* Wait this many milliseconds for the serve promise to resolve
|
|
288
291
|
* after calling `CoreRegistry::shutdown()`. Defaults to the
|
|
289
|
-
* engine-provided actor stop threshold once the
|
|
292
|
+
* engine-provided actor stop threshold once the node connects. A
|
|
293
|
+
* signal-driven shutdown of a managed local development engine waits
|
|
294
|
+
* four seconds by default so actors can acknowledge stopping before
|
|
295
|
+
* a file watcher restarts the process.
|
|
290
296
|
*
|
|
291
|
-
*
|
|
297
|
+
* Set a longer period when a complete graceful node drain is required.
|
|
292
298
|
*/
|
|
293
299
|
gracePeriodMs: z.number().int().min(1_000).optional(),
|
|
294
300
|
/**
|
|
@@ -345,12 +351,12 @@ export const RegistryConfigSchema = z
|
|
|
345
351
|
});
|
|
346
352
|
}
|
|
347
353
|
|
|
348
|
-
//
|
|
349
|
-
if (config.configurePool
|
|
354
|
+
// Serverless pool configuration is disabled for v3.
|
|
355
|
+
if (config.configurePool) {
|
|
350
356
|
ctx.addIssue({
|
|
351
357
|
code: "custom",
|
|
352
|
-
message:
|
|
353
|
-
|
|
358
|
+
message: "serverless is disabled in this version",
|
|
359
|
+
path: ["configurePool"],
|
|
354
360
|
});
|
|
355
361
|
}
|
|
356
362
|
|
|
@@ -362,9 +368,8 @@ export const RegistryConfigSchema = z
|
|
|
362
368
|
const endpoint = config.startEngine
|
|
363
369
|
? localEngineEndpoint
|
|
364
370
|
: (parsedEndpoint?.endpoint ??
|
|
365
|
-
(isDevEnv
|
|
366
|
-
|
|
367
|
-
: undefined));
|
|
371
|
+
(isDevEnv ? localEngineEndpoint : undefined));
|
|
372
|
+
const startServices = config.startServices ?? getRivetRunServices();
|
|
368
373
|
const validateServerlessEndpoint = Boolean(
|
|
369
374
|
config.startEngine || parsedEndpoint,
|
|
370
375
|
);
|
|
@@ -372,7 +377,12 @@ export const RegistryConfigSchema = z
|
|
|
372
377
|
const namespace =
|
|
373
378
|
parsedEndpoint?.namespace ?? config.namespace ?? "default";
|
|
374
379
|
// Token priority: parsed from endpoint URL > config value (includes env var)
|
|
375
|
-
const token =
|
|
380
|
+
const token =
|
|
381
|
+
parsedEndpoint?.token ??
|
|
382
|
+
config.token ??
|
|
383
|
+
(endpoint && isLocalEngineEndpoint(endpoint)
|
|
384
|
+
? "default"
|
|
385
|
+
: undefined);
|
|
376
386
|
|
|
377
387
|
// Parse publicEndpoint string (env var fallback is applied via transform in serverless schema)
|
|
378
388
|
const parsedPublicEndpoint = config.serverless.publicEndpoint
|
|
@@ -397,7 +407,7 @@ export const RegistryConfigSchema = z
|
|
|
397
407
|
// In dev mode, clients connect directly to the local Rivet Engine.
|
|
398
408
|
const publicEndpoint =
|
|
399
409
|
parsedPublicEndpoint?.endpoint ??
|
|
400
|
-
(isDevEnv &&
|
|
410
|
+
(isDevEnv && !parsedEndpoint ? endpoint : undefined);
|
|
401
411
|
// We extract publicNamespace to validate that it matches the backend
|
|
402
412
|
// namespace (see validation above), not for functional use.
|
|
403
413
|
const publicNamespace = parsedPublicEndpoint?.namespace;
|
|
@@ -409,6 +419,8 @@ export const RegistryConfigSchema = z
|
|
|
409
419
|
...config,
|
|
410
420
|
sqlite,
|
|
411
421
|
endpoint,
|
|
422
|
+
engineSpawn: !parsedEndpoint && Boolean(endpoint),
|
|
423
|
+
startServices,
|
|
412
424
|
namespace,
|
|
413
425
|
token,
|
|
414
426
|
publicEndpoint,
|
|
@@ -440,31 +452,6 @@ export function buildActorNames(
|
|
|
440
452
|
// Actor options take precedence over run metadata
|
|
441
453
|
metadata.icon = options.icon ?? runMeta.icon;
|
|
442
454
|
metadata.name = options.name ?? runMeta.name;
|
|
443
|
-
metadata.preload = {
|
|
444
|
-
keys: [
|
|
445
|
-
Array.from(KEYS.PERSIST_DATA),
|
|
446
|
-
Array.from(KEYS.INSPECTOR_TOKEN),
|
|
447
|
-
Array.from(queueMetadataKey()),
|
|
448
|
-
Array.from(KEYS.LAST_PUSHED_ALARM),
|
|
449
|
-
],
|
|
450
|
-
prefixes: [
|
|
451
|
-
{
|
|
452
|
-
prefix: Array.from(workflowStoragePrefix()),
|
|
453
|
-
maxBytes: options.preloadMaxWorkflowBytes ?? 131_072,
|
|
454
|
-
partial: false,
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
prefix: Array.from(KEYS.CONN_PREFIX),
|
|
458
|
-
maxBytes: options.preloadMaxConnectionsBytes ?? 65_536,
|
|
459
|
-
partial: false,
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
prefix: Array.from(queueMessagesPrefix()),
|
|
463
|
-
maxBytes: 65_536,
|
|
464
|
-
partial: false,
|
|
465
|
-
},
|
|
466
|
-
],
|
|
467
|
-
};
|
|
468
455
|
// Remove undefined values
|
|
469
456
|
if (!metadata.icon) delete metadata.icon;
|
|
470
457
|
if (!metadata.name) delete metadata.name;
|
|
@@ -479,10 +466,10 @@ export function buildActorNames(
|
|
|
479
466
|
|
|
480
467
|
export const DocConfigurePoolSchema = z
|
|
481
468
|
.object({
|
|
482
|
-
name: z.string().optional().describe("Name of the
|
|
469
|
+
name: z.string().optional().describe("Name of the node pool."),
|
|
483
470
|
url: z
|
|
484
471
|
.string()
|
|
485
|
-
.describe("URL of the serverless platform to configure
|
|
472
|
+
.describe("URL of the serverless platform to configure nodes."),
|
|
486
473
|
headers: z
|
|
487
474
|
.record(z.string(), z.string())
|
|
488
475
|
.optional()
|
|
@@ -515,7 +502,7 @@ export const DocConfigurePoolSchema = z
|
|
|
515
502
|
.boolean()
|
|
516
503
|
.optional()
|
|
517
504
|
.describe(
|
|
518
|
-
"Drain
|
|
505
|
+
"Drain nodes when a new version is deployed. Defaults to true.",
|
|
519
506
|
),
|
|
520
507
|
})
|
|
521
508
|
.optional();
|
|
@@ -558,17 +545,17 @@ export const DocEnvoyConfigSchema = z
|
|
|
558
545
|
poolName: z
|
|
559
546
|
.string()
|
|
560
547
|
.optional()
|
|
561
|
-
.describe("Name of this
|
|
562
|
-
|
|
548
|
+
.describe("Name of this node pool. Default: 'default'"),
|
|
549
|
+
nodeKey: z
|
|
563
550
|
.string()
|
|
564
551
|
.optional()
|
|
565
|
-
.describe("Deprecated. Authentication key for the
|
|
552
|
+
.describe("Deprecated. Authentication key for the node."),
|
|
566
553
|
version: z
|
|
567
554
|
.number()
|
|
568
555
|
.optional()
|
|
569
|
-
.describe("Version number of this
|
|
556
|
+
.describe("Version number of this node. Default: 1"),
|
|
570
557
|
})
|
|
571
|
-
.describe("Configuration for
|
|
558
|
+
.describe("Configuration for node mode.");
|
|
572
559
|
|
|
573
560
|
export const DocSqliteConfigSchema = z
|
|
574
561
|
.object({
|
|
@@ -665,10 +652,16 @@ export const DocRegistryConfigSchema = z
|
|
|
665
652
|
.describe(
|
|
666
653
|
"Version of the local engine package to use. Defaults to the current RivetKit version.",
|
|
667
654
|
),
|
|
655
|
+
startServices: z
|
|
656
|
+
.boolean()
|
|
657
|
+
.optional()
|
|
658
|
+
.describe(
|
|
659
|
+
"Starts Services when RivetKit manages a local Engine. Disabled by default. Set RIVET_RUN_SERVICES=1 or startServices: true to enable.",
|
|
660
|
+
),
|
|
668
661
|
configurePool: DocConfigurePoolSchema.describe(
|
|
669
|
-
"Automatically configure serverless
|
|
662
|
+
"Automatically configure serverless nodes in the engine.",
|
|
670
663
|
),
|
|
671
664
|
serverless: DocServerlessConfigSchema.optional(),
|
|
672
|
-
|
|
665
|
+
node: DocEnvoyConfigSchema.optional(),
|
|
673
666
|
})
|
|
674
667
|
.describe("RivetKit registry configuration.");
|