rivetkit 0.0.0-sqlite-uds.2015d80 → 0.0.0-sqlite-profiling-compat.87d61c0
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 +28 -25
- package/dist/browser/client.js +6 -9
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +2 -22
- package/dist/browser/inspector/client.js +222 -996
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/agent-os/index.cjs +34 -99
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +28 -25
- package/dist/tsup/agent-os/index.d.ts +28 -25
- package/dist/tsup/agent-os/index.js +36 -101
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-MUPT34DY.js → chunk-3GVMLSND.js} +7 -7
- package/dist/tsup/{chunk-OAPVVVTX.cjs → chunk-3MHDOUD7.cjs} +1 -1
- package/dist/tsup/chunk-3MHDOUD7.cjs.map +1 -0
- package/dist/tsup/chunk-4FC7TVS6.cjs.map +1 -1
- package/dist/tsup/{chunk-D5TT3ZDY.js → chunk-B3GLD4IN.js} +2 -22
- package/dist/tsup/chunk-B3GLD4IN.js.map +1 -0
- package/dist/tsup/{chunk-HV4FLJQR.cjs → chunk-BWERJMV6.cjs} +141 -141
- package/dist/tsup/chunk-BWERJMV6.cjs.map +1 -0
- package/dist/tsup/{chunk-CKKFRK2T.cjs → chunk-D363DMNH.cjs} +3 -3
- package/dist/tsup/chunk-D363DMNH.cjs.map +1 -0
- package/dist/tsup/{chunk-COPUTOJF.cjs → chunk-DTRDGPHU.cjs} +7 -7
- package/dist/tsup/chunk-DTRDGPHU.cjs.map +1 -0
- package/dist/tsup/{chunk-5RC3H5MH.cjs → chunk-E4LNLI3W.cjs} +8 -12
- package/dist/tsup/chunk-E4LNLI3W.cjs.map +1 -0
- package/dist/tsup/{chunk-XPXLCL5I.js → chunk-EFU4JW3T.js} +7 -11
- package/dist/tsup/chunk-EFU4JW3T.js.map +1 -0
- package/dist/tsup/{chunk-IVUL2OMZ.cjs → chunk-FNAXD5BQ.cjs} +4 -24
- package/dist/tsup/chunk-FNAXD5BQ.cjs.map +1 -0
- package/dist/tsup/{chunk-YPIVGZVX.cjs → chunk-GM45LG7L.cjs} +10 -18
- package/dist/tsup/chunk-GM45LG7L.cjs.map +1 -0
- package/dist/tsup/{chunk-DNGOGOHS.js → chunk-O3ZUMAN7.js} +3 -3
- package/dist/tsup/{chunk-VBASTLLY.js → chunk-OAUFXOG7.js} +2 -2
- package/dist/tsup/{chunk-VP3RWGXE.cjs → chunk-P6F5MEWX.cjs} +5 -5
- package/dist/tsup/chunk-P6F5MEWX.cjs.map +1 -0
- package/dist/tsup/{chunk-VL3UZ6XX.js → chunk-PT7AC5PC.js} +4 -12
- package/dist/tsup/chunk-PT7AC5PC.js.map +1 -0
- package/dist/tsup/{chunk-5NJB7EE2.js → chunk-UV7INX3N.js} +2 -2
- package/dist/tsup/chunk-VE2X4KMG.cjs.map +1 -1
- package/dist/tsup/{chunk-3GLNEWGY.js → chunk-XIX5DOZN.js} +1 -1
- package/dist/tsup/chunk-XIX5DOZN.js.map +1 -0
- package/dist/tsup/chunk-ZA7FLHKH.cjs.map +1 -1
- package/dist/tsup/client/mod.cjs +7 -7
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +3 -3
- package/dist/tsup/client/mod.d.ts +3 -3
- package/dist/tsup/client/mod.js +6 -6
- package/dist/tsup/common/log.cjs +2 -4
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.d.cts +1 -5
- package/dist/tsup/common/log.d.ts +1 -5
- package/dist/tsup/common/log.js +3 -5
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-DLOxy81E.d.cts → config-B0LNDrLY.d.cts} +25 -5
- package/dist/tsup/{config-DLOxy81E.d.ts → config-B0LNDrLY.d.ts} +25 -5
- package/dist/tsup/{config-Ds6DCRhV.d.ts → config-BR1Nn0QQ.d.ts} +5 -22
- package/dist/tsup/{config-CxG53eQo.d.cts → config-tCvkwzyN.d.cts} +5 -22
- package/dist/tsup/{context-Cfbm4QLr.d.ts → context-D4WDwf9m.d.cts} +2 -3
- package/dist/tsup/{context-8KlcOYIs.d.cts → context-oc9zhA3x.d.ts} +2 -3
- package/dist/tsup/db/drizzle.cjs +72 -144
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +2 -4
- package/dist/tsup/db/drizzle.d.ts +2 -4
- package/dist/tsup/db/drizzle.js +72 -144
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +28 -90
- 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 +28 -90
- 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 +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +11 -46
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +15 -37
- package/dist/tsup/inspector/mod.d.ts +15 -37
- package/dist/tsup/inspector/mod.js +10 -45
- package/dist/tsup/inspector/mod.js.map +1 -1
- package/dist/tsup/inspector-tab/mod.cjs +13 -2
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.d.cts +14 -4
- package/dist/tsup/inspector-tab/mod.d.ts +14 -4
- package/dist/tsup/inspector-tab/mod.js +12 -1
- package/dist/tsup/inspector-tab/mod.js.map +1 -1
- package/dist/tsup/mod.cjs +91 -191
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +27 -127
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +10 -10
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +6 -6
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +11 -14
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +5 -8
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +14 -9
- package/src/actor/config.ts +0 -2
- package/src/common/bare/transport/v1.ts +0 -36
- package/src/common/database/config.ts +24 -19
- package/src/common/database/mod.test.ts +2 -91
- package/src/common/database/mod.ts +38 -102
- package/src/common/database/native-database.ts +4 -19
- package/src/common/log.ts +8 -14
- package/src/db/drizzle.ts +86 -189
- package/src/db/mod.ts +1 -0
- package/src/inspector/client.browser.ts +16 -73
- package/src/inspector/mod.ts +1 -1
- package/src/inspector-tab/mod.ts +15 -0
- package/src/registry/config/index.ts +0 -3
- package/src/registry/index.ts +0 -4
- package/src/registry/napi-runtime.ts +1 -25
- package/src/registry/native.ts +13 -95
- package/src/registry/runtime.ts +6 -18
- package/src/registry/wasm-runtime.ts +0 -22
- package/src/workflow/context.ts +0 -4
- package/src/workflow/inspector.ts +0 -8
- package/dist/tsup/chunk-3GLNEWGY.js.map +0 -1
- package/dist/tsup/chunk-5RC3H5MH.cjs.map +0 -1
- package/dist/tsup/chunk-CKKFRK2T.cjs.map +0 -1
- package/dist/tsup/chunk-COPUTOJF.cjs.map +0 -1
- package/dist/tsup/chunk-D5TT3ZDY.js.map +0 -1
- package/dist/tsup/chunk-HV4FLJQR.cjs.map +0 -1
- package/dist/tsup/chunk-IVUL2OMZ.cjs.map +0 -1
- package/dist/tsup/chunk-OAPVVVTX.cjs.map +0 -1
- package/dist/tsup/chunk-VL3UZ6XX.js.map +0 -1
- package/dist/tsup/chunk-VP3RWGXE.cjs.map +0 -1
- package/dist/tsup/chunk-XPXLCL5I.js.map +0 -1
- package/dist/tsup/chunk-YPIVGZVX.cjs.map +0 -1
- package/src/common/bare/generated/actor-uds-protocol/v1.ts +0 -802
- package/src/common/bare/generated/inspector/v5.ts +0 -1016
- /package/dist/tsup/{chunk-MUPT34DY.js.map → chunk-3GVMLSND.js.map} +0 -0
- /package/dist/tsup/{chunk-DNGOGOHS.js.map → chunk-O3ZUMAN7.js.map} +0 -0
- /package/dist/tsup/{chunk-VBASTLLY.js.map → chunk-OAUFXOG7.js.map} +0 -0
- /package/dist/tsup/{chunk-5NJB7EE2.js.map → chunk-UV7INX3N.js.map} +0 -0
|
@@ -3,17 +3,16 @@ 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
6
|
import {
|
|
8
7
|
decodeWorkflowHistoryTransport,
|
|
9
8
|
encodeWorkflowHistoryTransport,
|
|
10
9
|
} from "@/common/inspector-transport";
|
|
11
10
|
|
|
12
|
-
export * from "@/common/bare/generated/inspector/
|
|
11
|
+
export * from "@/common/bare/generated/inspector/v4";
|
|
13
12
|
export { decodeWorkflowHistoryTransport, encodeWorkflowHistoryTransport };
|
|
14
13
|
export type { WorkflowHistory as TransportWorkflowHistory } from "@/common/bare/transport/v1";
|
|
15
14
|
|
|
16
|
-
export const CURRENT_VERSION =
|
|
15
|
+
export const CURRENT_VERSION = 4;
|
|
17
16
|
|
|
18
17
|
const EVENTS_DROPPED_ERROR = "inspector.events_dropped";
|
|
19
18
|
const WORKFLOW_HISTORY_DROPPED_ERROR = "inspector.workflow_history_dropped";
|
|
@@ -157,42 +156,6 @@ const v4ToClientToV3 = (v4Data: v4.ToClient): v3.ToClient => {
|
|
|
157
156
|
return v4Data as unknown as v3.ToClient;
|
|
158
157
|
};
|
|
159
158
|
|
|
160
|
-
const v4ToClientToV5 = (v4Data: v4.ToClient): v5.ToClient => {
|
|
161
|
-
if (v4Data.body.tag === "Init") {
|
|
162
|
-
// A v4 runtime predates tab config in Init; default to an empty list.
|
|
163
|
-
// The client reads that as "no custom tabs" (built-in tabs only).
|
|
164
|
-
const init = v4Data.body.val;
|
|
165
|
-
return {
|
|
166
|
-
body: {
|
|
167
|
-
tag: "Init",
|
|
168
|
-
val: { ...init, tabConfig: [] },
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return v4Data as unknown as v5.ToClient;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const v5ToClientToV4 = (v5Data: v5.ToClient): v4.ToClient => {
|
|
177
|
-
if (v5Data.body.tag === "Init") {
|
|
178
|
-
const { tabConfig: _tabConfig, ...rest } = v5Data.body.val;
|
|
179
|
-
return {
|
|
180
|
-
body: {
|
|
181
|
-
tag: "Init",
|
|
182
|
-
val: rest,
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return v5Data as unknown as v4.ToClient;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const v4ToServerToV5 = (v4Data: v4.ToServer): v5.ToServer =>
|
|
191
|
-
v4Data as unknown as v5.ToServer;
|
|
192
|
-
|
|
193
|
-
const v5ToServerToV4 = (v5Data: v5.ToServer): v4.ToServer =>
|
|
194
|
-
v5Data as unknown as v4.ToServer;
|
|
195
|
-
|
|
196
159
|
const v1ToServerToV2 = (v1Data: v1.ToServer): v2.ToServer => {
|
|
197
160
|
if (
|
|
198
161
|
v1Data.body.tag === "EventsRequest" ||
|
|
@@ -243,7 +206,7 @@ const v4ToServerToV3 = (v4Data: v4.ToServer): v3.ToServer => {
|
|
|
243
206
|
return v4Data as unknown as v3.ToServer;
|
|
244
207
|
};
|
|
245
208
|
|
|
246
|
-
export const TO_SERVER_VERSIONED = createVersionedDataHandler<
|
|
209
|
+
export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
|
|
247
210
|
serializeVersion: (data, version) => {
|
|
248
211
|
switch (version) {
|
|
249
212
|
case 1:
|
|
@@ -253,9 +216,7 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v5.ToServer>({
|
|
|
253
216
|
case 3:
|
|
254
217
|
return v3.encodeToServer(data as unknown as v3.ToServer);
|
|
255
218
|
case 4:
|
|
256
|
-
return v4.encodeToServer(data
|
|
257
|
-
case 5:
|
|
258
|
-
return v5.encodeToServer(data);
|
|
219
|
+
return v4.encodeToServer(data);
|
|
259
220
|
default:
|
|
260
221
|
throw new Error(`Unknown version ${version}`);
|
|
261
222
|
}
|
|
@@ -263,15 +224,13 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v5.ToServer>({
|
|
|
263
224
|
deserializeVersion: (bytes, version) => {
|
|
264
225
|
switch (version) {
|
|
265
226
|
case 1:
|
|
266
|
-
return v1.decodeToServer(bytes) as unknown as
|
|
227
|
+
return v1.decodeToServer(bytes) as unknown as v4.ToServer;
|
|
267
228
|
case 2:
|
|
268
|
-
return v2.decodeToServer(bytes) as unknown as
|
|
229
|
+
return v2.decodeToServer(bytes) as unknown as v4.ToServer;
|
|
269
230
|
case 3:
|
|
270
|
-
return v3.decodeToServer(bytes) as unknown as
|
|
231
|
+
return v3.decodeToServer(bytes) as unknown as v4.ToServer;
|
|
271
232
|
case 4:
|
|
272
|
-
return v4.decodeToServer(bytes)
|
|
273
|
-
case 5:
|
|
274
|
-
return v5.decodeToServer(bytes);
|
|
233
|
+
return v4.decodeToServer(bytes);
|
|
275
234
|
default:
|
|
276
235
|
throw new Error(`Unknown version ${version}`);
|
|
277
236
|
}
|
|
@@ -280,17 +239,11 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v5.ToServer>({
|
|
|
280
239
|
v1ToServerToV2,
|
|
281
240
|
v2ToServerToV3,
|
|
282
241
|
v3ToServerToV4,
|
|
283
|
-
v4ToServerToV5,
|
|
284
|
-
],
|
|
285
|
-
serializeConverters: () => [
|
|
286
|
-
v5ToServerToV4,
|
|
287
|
-
v4ToServerToV3,
|
|
288
|
-
v3ToServerToV2,
|
|
289
|
-
v2ToServerToV1,
|
|
290
242
|
],
|
|
243
|
+
serializeConverters: () => [v4ToServerToV3, v3ToServerToV2, v2ToServerToV1],
|
|
291
244
|
});
|
|
292
245
|
|
|
293
|
-
export const TO_CLIENT_VERSIONED = createVersionedDataHandler<
|
|
246
|
+
export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
|
|
294
247
|
serializeVersion: (data, version) => {
|
|
295
248
|
switch (version) {
|
|
296
249
|
case 1:
|
|
@@ -300,9 +253,7 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v5.ToClient>({
|
|
|
300
253
|
case 3:
|
|
301
254
|
return v3.encodeToClient(data as unknown as v3.ToClient);
|
|
302
255
|
case 4:
|
|
303
|
-
return v4.encodeToClient(data
|
|
304
|
-
case 5:
|
|
305
|
-
return v5.encodeToClient(data);
|
|
256
|
+
return v4.encodeToClient(data);
|
|
306
257
|
default:
|
|
307
258
|
throw new Error(`Unknown version ${version}`);
|
|
308
259
|
}
|
|
@@ -310,15 +261,13 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v5.ToClient>({
|
|
|
310
261
|
deserializeVersion: (bytes, version) => {
|
|
311
262
|
switch (version) {
|
|
312
263
|
case 1:
|
|
313
|
-
return v1.decodeToClient(bytes) as unknown as
|
|
264
|
+
return v1.decodeToClient(bytes) as unknown as v4.ToClient;
|
|
314
265
|
case 2:
|
|
315
|
-
return v2.decodeToClient(bytes) as unknown as
|
|
266
|
+
return v2.decodeToClient(bytes) as unknown as v4.ToClient;
|
|
316
267
|
case 3:
|
|
317
|
-
return v3.decodeToClient(bytes) as unknown as
|
|
268
|
+
return v3.decodeToClient(bytes) as unknown as v4.ToClient;
|
|
318
269
|
case 4:
|
|
319
|
-
return v4.decodeToClient(bytes)
|
|
320
|
-
case 5:
|
|
321
|
-
return v5.decodeToClient(bytes);
|
|
270
|
+
return v4.decodeToClient(bytes);
|
|
322
271
|
default:
|
|
323
272
|
throw new Error(`Unknown version ${version}`);
|
|
324
273
|
}
|
|
@@ -327,12 +276,6 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v5.ToClient>({
|
|
|
327
276
|
v1ToClientToV2,
|
|
328
277
|
v2ToClientToV3,
|
|
329
278
|
v3ToClientToV4,
|
|
330
|
-
v4ToClientToV5,
|
|
331
|
-
],
|
|
332
|
-
serializeConverters: () => [
|
|
333
|
-
v5ToClientToV4,
|
|
334
|
-
v4ToClientToV3,
|
|
335
|
-
v3ToClientToV2,
|
|
336
|
-
v2ToClientToV1,
|
|
337
279
|
],
|
|
280
|
+
serializeConverters: () => [v4ToClientToV3, v3ToClientToV2, v2ToClientToV1],
|
|
338
281
|
});
|
package/src/inspector/mod.ts
CHANGED
package/src/inspector-tab/mod.ts
CHANGED
|
@@ -280,6 +280,18 @@ export const InspectorQueueResponseSchema = z.object({
|
|
|
280
280
|
messages: z.array(InspectorQueueMessageSchema),
|
|
281
281
|
});
|
|
282
282
|
|
|
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
|
+
|
|
283
295
|
export type InspectorStateResponse = z.infer<
|
|
284
296
|
typeof InspectorStateResponseSchema
|
|
285
297
|
>;
|
|
@@ -298,3 +310,6 @@ export type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;
|
|
|
298
310
|
export type InspectorQueueResponse = z.infer<
|
|
299
311
|
typeof InspectorQueueResponseSchema
|
|
300
312
|
>;
|
|
313
|
+
export type InspectorTabConfigResponse = z.infer<
|
|
314
|
+
typeof InspectorTabConfigResponseSchema
|
|
315
|
+
>;
|
|
@@ -97,9 +97,6 @@ export const RegistryConfigSchema = z
|
|
|
97
97
|
/** @experimental */
|
|
98
98
|
maxOutgoingMessageSize: z.number().optional().default(1_048_576),
|
|
99
99
|
|
|
100
|
-
/** Enables the experimental per-actor Unix socket API. */
|
|
101
|
-
experimentalActorUds: z.boolean().optional().default(false),
|
|
102
|
-
|
|
103
100
|
// MARK: Runtime
|
|
104
101
|
/**
|
|
105
102
|
* @experimental
|
package/src/registry/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isLocalEngineEndpoint } from "@/common/engine";
|
|
2
|
-
import { configureBaseLogger } from "@/common/log";
|
|
3
2
|
import { configureServerlessPool } from "@/serverless/configure";
|
|
4
3
|
import { VERSION } from "@/utils";
|
|
5
4
|
import {
|
|
@@ -83,9 +82,6 @@ export class Registry<A extends RegistryActors> {
|
|
|
83
82
|
|
|
84
83
|
constructor(config: RegistryConfigInput<A>, deps?: Partial<RegistryDeps>) {
|
|
85
84
|
this.#config = config;
|
|
86
|
-
if (config.logging?.baseLogger) {
|
|
87
|
-
configureBaseLogger(config.logging.baseLogger);
|
|
88
|
-
}
|
|
89
85
|
this.#buildConfiguredRegistry =
|
|
90
86
|
deps?.buildConfiguredRegistry ?? buildConfiguredRegistry;
|
|
91
87
|
this.routes = {
|
|
@@ -34,7 +34,6 @@ import type {
|
|
|
34
34
|
RuntimeSqlBindParams,
|
|
35
35
|
RuntimeSqlExecResult,
|
|
36
36
|
RuntimeSqlExecuteResult,
|
|
37
|
-
RuntimeSqlLeaseOptions,
|
|
38
37
|
RuntimeSqlQueryResult,
|
|
39
38
|
RuntimeSqlRunResult,
|
|
40
39
|
RuntimeStateDeltaPayload,
|
|
@@ -599,26 +598,18 @@ export class NapiCoreRuntime implements CoreRuntime {
|
|
|
599
598
|
async actorSqlExec(
|
|
600
599
|
ctx: ActorContextHandle,
|
|
601
600
|
sql: string,
|
|
602
|
-
lease?: RuntimeSqlLeaseOptions,
|
|
603
601
|
): Promise<RuntimeSqlExecResult> {
|
|
604
|
-
return await this.#actorSql(ctx).exec(
|
|
605
|
-
sql,
|
|
606
|
-
lease?.key,
|
|
607
|
-
lease?.timeoutMs,
|
|
608
|
-
);
|
|
602
|
+
return await this.#actorSql(ctx).exec(sql);
|
|
609
603
|
}
|
|
610
604
|
|
|
611
605
|
async actorSqlExecute(
|
|
612
606
|
ctx: ActorContextHandle,
|
|
613
607
|
sql: string,
|
|
614
608
|
params?: RuntimeSqlBindParams,
|
|
615
|
-
lease?: RuntimeSqlLeaseOptions,
|
|
616
609
|
): Promise<RuntimeSqlExecuteResult> {
|
|
617
610
|
const result = await this.#actorSql(ctx).execute(
|
|
618
611
|
sql,
|
|
619
612
|
toNapiSqlBindParams(params),
|
|
620
|
-
lease?.key,
|
|
621
|
-
lease?.timeoutMs,
|
|
622
613
|
);
|
|
623
614
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
624
615
|
}
|
|
@@ -661,10 +652,6 @@ export class NapiCoreRuntime implements CoreRuntime {
|
|
|
661
652
|
await database.close();
|
|
662
653
|
}
|
|
663
654
|
|
|
664
|
-
async actorUdsProvision(ctx: ActorContextHandle) {
|
|
665
|
-
return await asNativeActorContext(ctx).provisionActorUds();
|
|
666
|
-
}
|
|
667
|
-
|
|
668
655
|
async actorQueueSend(
|
|
669
656
|
ctx: ActorContextHandle,
|
|
670
657
|
name: string,
|
|
@@ -758,10 +745,6 @@ export class NapiCoreRuntime implements CoreRuntime {
|
|
|
758
745
|
return await asNativeActorContext(ctx).queue().inspectMessages();
|
|
759
746
|
}
|
|
760
747
|
|
|
761
|
-
async actorQueueReset(ctx: ActorContextHandle): Promise<void> {
|
|
762
|
-
await asNativeActorContext(ctx).queue().reset();
|
|
763
|
-
}
|
|
764
|
-
|
|
765
748
|
actorScheduleAfter(
|
|
766
749
|
ctx: ActorContextHandle,
|
|
767
750
|
durationMs: number,
|
|
@@ -845,13 +828,6 @@ export async function loadNapiRuntime(): Promise<{
|
|
|
845
828
|
bindings: NapiBindings;
|
|
846
829
|
runtime: NapiCoreRuntime;
|
|
847
830
|
}> {
|
|
848
|
-
// LOAD-BEARING: the specifier is computed (`.join("/")`) on purpose. Do NOT
|
|
849
|
-
// "simplify" it to a literal `import("@rivetkit/rivetkit-napi")`. Edge
|
|
850
|
-
// adapters (e.g. @rivetkit/supabase) pre-bundle this module for Deno; a
|
|
851
|
-
// literal dynamic import is statically resolvable, so Deno's eszip bundler
|
|
852
|
-
// would snapshot the native `.node` addon into the deploy and 413. The
|
|
853
|
-
// computed specifier keeps it opaque to static analysis so it is never
|
|
854
|
-
// bundled. Enforced by scripts/ci/check-edge-native-closure.mjs.
|
|
855
831
|
const bindings = await import(["@rivetkit", "rivetkit-napi"].join("/"));
|
|
856
832
|
return {
|
|
857
833
|
bindings,
|
package/src/registry/native.ts
CHANGED
|
@@ -33,7 +33,10 @@ import {
|
|
|
33
33
|
} from "@/client/client";
|
|
34
34
|
import { convertRegistryConfigToClientConfig } from "@/client/config";
|
|
35
35
|
import { HEADER_CONN_PARAMS } from "@/common/actor-router-consts";
|
|
36
|
-
import type {
|
|
36
|
+
import type {
|
|
37
|
+
AnyDatabaseProvider,
|
|
38
|
+
SqliteProfilingOptions,
|
|
39
|
+
} from "@/common/database/config";
|
|
37
40
|
import { wrapJsNativeDatabase } from "@/common/database/native-database";
|
|
38
41
|
import { assertJsonCompatValue, type JsonCompatValue } from "@/common/encoding";
|
|
39
42
|
import { decodeWorkflowHistoryTransport } from "@/common/inspector-transport";
|
|
@@ -510,23 +513,8 @@ function getOrCreateNativeSqlDatabase(
|
|
|
510
513
|
}
|
|
511
514
|
|
|
512
515
|
const database = wrapJsNativeDatabase({
|
|
513
|
-
exec: (sql
|
|
514
|
-
|
|
515
|
-
ctx,
|
|
516
|
-
sql,
|
|
517
|
-
leaseKey === undefined
|
|
518
|
-
? undefined
|
|
519
|
-
: { key: leaseKey, timeoutMs: leaseTimeoutMs },
|
|
520
|
-
),
|
|
521
|
-
execute: (sql, params, leaseKey, leaseTimeoutMs) =>
|
|
522
|
-
runtime.actorSqlExecute(
|
|
523
|
-
ctx,
|
|
524
|
-
sql,
|
|
525
|
-
params,
|
|
526
|
-
leaseKey === undefined
|
|
527
|
-
? undefined
|
|
528
|
-
: { key: leaseKey, timeoutMs: leaseTimeoutMs },
|
|
529
|
-
),
|
|
516
|
+
exec: (sql) => runtime.actorSqlExec(ctx, sql),
|
|
517
|
+
execute: (sql, params) => runtime.actorSqlExecute(ctx, sql, params),
|
|
530
518
|
query: (sql, params) => runtime.actorSqlQuery(ctx, sql, params),
|
|
531
519
|
run: (sql, params) => runtime.actorSqlRun(ctx, sql, params),
|
|
532
520
|
metrics: () => runtime.actorSqlMetrics(ctx),
|
|
@@ -637,13 +625,6 @@ function decodeNativeKvValue<T extends NativeKvValueType = "text">(
|
|
|
637
625
|
}
|
|
638
626
|
|
|
639
627
|
async function loadEngineCli(): Promise<typeof import("@rivetkit/engine-cli")> {
|
|
640
|
-
// LOAD-BEARING: the specifier is computed (`.join("/")`) on purpose. Do NOT
|
|
641
|
-
// "simplify" it to a literal `import("@rivetkit/engine-cli")`. Edge adapters
|
|
642
|
-
// (e.g. @rivetkit/supabase) pre-bundle this module for Deno; a literal
|
|
643
|
-
// dynamic import is statically resolvable, so Deno's eszip bundler would
|
|
644
|
-
// snapshot the ~117 MB engine-cli binary into the deploy and 413. The
|
|
645
|
-
// computed specifier keeps it opaque to static analysis so it is never
|
|
646
|
-
// bundled. Enforced by scripts/ci/check-edge-native-closure.mjs.
|
|
647
628
|
return import(["@rivetkit", "engine-cli"].join("/"));
|
|
648
629
|
}
|
|
649
630
|
|
|
@@ -929,10 +910,6 @@ function serializeWorkflowEntryKind(
|
|
|
929
910
|
| {
|
|
930
911
|
tag: "WorkflowRemovedEntry";
|
|
931
912
|
val: { originalType: string; originalName: string | null };
|
|
932
|
-
}
|
|
933
|
-
| {
|
|
934
|
-
tag: "WorkflowVersionCheckEntry";
|
|
935
|
-
val: { resolved: number; latest: number };
|
|
936
913
|
} {
|
|
937
914
|
switch (kind.tag) {
|
|
938
915
|
case "WorkflowStepEntry":
|
|
@@ -998,14 +975,6 @@ function serializeWorkflowEntryKind(
|
|
|
998
975
|
originalName: kind.val.originalName,
|
|
999
976
|
},
|
|
1000
977
|
};
|
|
1001
|
-
case "WorkflowVersionCheckEntry":
|
|
1002
|
-
return {
|
|
1003
|
-
tag: kind.tag,
|
|
1004
|
-
val: {
|
|
1005
|
-
resolved: kind.val.resolved,
|
|
1006
|
-
latest: kind.val.latest,
|
|
1007
|
-
},
|
|
1008
|
-
};
|
|
1009
978
|
}
|
|
1010
979
|
}
|
|
1011
980
|
|
|
@@ -2488,10 +2457,6 @@ export class ActorContextHandleAdapter {
|
|
|
2488
2457
|
return this.#sql;
|
|
2489
2458
|
}
|
|
2490
2459
|
|
|
2491
|
-
async actorUds(): Promise<{ path: string; token: string }> {
|
|
2492
|
-
return await this.#runtime.actorUdsProvision(this.#ctx);
|
|
2493
|
-
}
|
|
2494
|
-
|
|
2495
2460
|
get db() {
|
|
2496
2461
|
if (!this.#databaseProvider) {
|
|
2497
2462
|
throw databaseNotConfiguredError();
|
|
@@ -3331,14 +3296,18 @@ function buildActorConfig(
|
|
|
3331
3296
|
const options = (config.options ?? {}) as Record<string, unknown>;
|
|
3332
3297
|
const canHibernate = options.canHibernateWebSocket;
|
|
3333
3298
|
|
|
3299
|
+
const sqliteProfiling = (
|
|
3300
|
+
config.db as { sqliteProfiling?: SqliteProfilingOptions } | undefined
|
|
3301
|
+
)?.sqliteProfiling;
|
|
3302
|
+
|
|
3334
3303
|
return {
|
|
3335
3304
|
name: options.name as string | undefined,
|
|
3336
3305
|
icon: options.icon as string | undefined,
|
|
3337
3306
|
hasDatabase: config.db !== undefined,
|
|
3307
|
+
sqliteProfiling,
|
|
3338
3308
|
remoteSqlite:
|
|
3339
3309
|
config.db !== undefined &&
|
|
3340
3310
|
sqliteBackendForConfig(registryConfig) === "remote",
|
|
3341
|
-
experimentalActorUds: registryConfig.experimentalActorUds,
|
|
3342
3311
|
hasState:
|
|
3343
3312
|
config.state !== undefined ||
|
|
3344
3313
|
typeof config.createState === "function",
|
|
@@ -3607,11 +3576,10 @@ export function buildNativeFactory(
|
|
|
3607
3576
|
);
|
|
3608
3577
|
};
|
|
3609
3578
|
|
|
3610
|
-
// Tab config is delivered over the inspector WS `Init` message, not
|
|
3611
|
-
// HTTP. Only custom-tab assets remain a public per-actor path.
|
|
3612
3579
|
const isPublicPerActorPath =
|
|
3613
3580
|
jsRequest.method === "GET" &&
|
|
3614
|
-
url.pathname
|
|
3581
|
+
(url.pathname === "/inspector/tab-config" ||
|
|
3582
|
+
url.pathname.startsWith("/inspector/custom-tabs/"));
|
|
3615
3583
|
|
|
3616
3584
|
if (!isPublicPerActorPath) {
|
|
3617
3585
|
try {
|
|
@@ -3706,56 +3674,6 @@ export function buildNativeFactory(
|
|
|
3706
3674
|
messages,
|
|
3707
3675
|
});
|
|
3708
3676
|
}
|
|
3709
|
-
if (
|
|
3710
|
-
url.pathname === "/inspector/queue" &&
|
|
3711
|
-
jsRequest.method === "DELETE"
|
|
3712
|
-
) {
|
|
3713
|
-
await runtime.actorQueueReset(ctx);
|
|
3714
|
-
return jsonResponse({});
|
|
3715
|
-
}
|
|
3716
|
-
if (
|
|
3717
|
-
url.pathname === "/inspector/queue" &&
|
|
3718
|
-
jsRequest.method === "POST"
|
|
3719
|
-
) {
|
|
3720
|
-
let body: { name?: string; body?: unknown };
|
|
3721
|
-
try {
|
|
3722
|
-
body = (await jsRequest.json()) as {
|
|
3723
|
-
name?: string;
|
|
3724
|
-
body?: unknown;
|
|
3725
|
-
};
|
|
3726
|
-
} catch {
|
|
3727
|
-
return errorResponse(
|
|
3728
|
-
new RivetError(
|
|
3729
|
-
"actor",
|
|
3730
|
-
"invalid_request",
|
|
3731
|
-
"Invalid inspector JSON body",
|
|
3732
|
-
{ public: true },
|
|
3733
|
-
),
|
|
3734
|
-
400,
|
|
3735
|
-
);
|
|
3736
|
-
}
|
|
3737
|
-
const name = body.name ?? "";
|
|
3738
|
-
if (name === "") {
|
|
3739
|
-
return errorResponse(
|
|
3740
|
-
new RivetError(
|
|
3741
|
-
"actor",
|
|
3742
|
-
"invalid_request",
|
|
3743
|
-
"Queue message name must not be empty",
|
|
3744
|
-
{ public: true },
|
|
3745
|
-
),
|
|
3746
|
-
400,
|
|
3747
|
-
);
|
|
3748
|
-
}
|
|
3749
|
-
const cbor = encodeCborCompat(
|
|
3750
|
-
(body.body ?? null) as JsonCompatValue,
|
|
3751
|
-
);
|
|
3752
|
-
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
3753
|
-
return jsonResponse({
|
|
3754
|
-
id: message.id().toString(),
|
|
3755
|
-
name: message.name(),
|
|
3756
|
-
createdAtMs: message.createdAt(),
|
|
3757
|
-
});
|
|
3758
|
-
}
|
|
3759
3677
|
if (
|
|
3760
3678
|
url.pathname === "/inspector/traces" &&
|
|
3761
3679
|
jsRequest.method === "GET"
|
package/src/registry/runtime.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { stringifyError } from "@/common/utils";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
SqliteNativeMetrics,
|
|
4
|
+
SqliteProfilingOptions,
|
|
5
|
+
} from "@/common/database/config";
|
|
3
6
|
import type { RegistryConfig } from "./config";
|
|
4
7
|
import { logger } from "./log";
|
|
5
8
|
|
|
@@ -152,16 +155,6 @@ export type RuntimeSqlBindParam =
|
|
|
152
155
|
|
|
153
156
|
export type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
154
157
|
|
|
155
|
-
export interface RuntimeSqlLeaseOptions {
|
|
156
|
-
key: string;
|
|
157
|
-
timeoutMs?: number;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface RuntimeActorUdsEndpointInfo {
|
|
161
|
-
path: string;
|
|
162
|
-
token: string;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
158
|
export interface RuntimeSqlQueryResult {
|
|
166
159
|
columns: string[];
|
|
167
160
|
rows: unknown[][];
|
|
@@ -211,7 +204,8 @@ export interface RuntimeActorConfig {
|
|
|
211
204
|
icon?: string;
|
|
212
205
|
hasDatabase?: boolean;
|
|
213
206
|
remoteSqlite?: boolean;
|
|
214
|
-
|
|
207
|
+
/** @experimental This entire configuration surface is subject to change. */
|
|
208
|
+
sqliteProfiling?: SqliteProfilingOptions;
|
|
215
209
|
hasState?: boolean;
|
|
216
210
|
canHibernateWebsocket?: boolean;
|
|
217
211
|
stateSaveIntervalMs?: number;
|
|
@@ -496,13 +490,11 @@ export interface CoreRuntime {
|
|
|
496
490
|
actorSqlExec(
|
|
497
491
|
ctx: ActorContextHandle,
|
|
498
492
|
sql: string,
|
|
499
|
-
lease?: RuntimeSqlLeaseOptions,
|
|
500
493
|
): Promise<RuntimeSqlExecResult>;
|
|
501
494
|
actorSqlExecute(
|
|
502
495
|
ctx: ActorContextHandle,
|
|
503
496
|
sql: string,
|
|
504
497
|
params?: RuntimeSqlBindParams,
|
|
505
|
-
lease?: RuntimeSqlLeaseOptions,
|
|
506
498
|
): Promise<RuntimeSqlExecuteResult>;
|
|
507
499
|
actorSqlQuery(
|
|
508
500
|
ctx: ActorContextHandle,
|
|
@@ -517,9 +509,6 @@ export interface CoreRuntime {
|
|
|
517
509
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
518
510
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
519
511
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
520
|
-
actorUdsProvision(
|
|
521
|
-
ctx: ActorContextHandle,
|
|
522
|
-
): Promise<RuntimeActorUdsEndpointInfo>;
|
|
523
512
|
|
|
524
513
|
actorQueueSend(
|
|
525
514
|
ctx: ActorContextHandle,
|
|
@@ -558,7 +547,6 @@ export interface CoreRuntime {
|
|
|
558
547
|
actorQueueInspectMessages(
|
|
559
548
|
ctx: ActorContextHandle,
|
|
560
549
|
): Promise<RuntimeQueueInspectMessage[]>;
|
|
561
|
-
actorQueueReset(ctx: ActorContextHandle): Promise<void>;
|
|
562
550
|
|
|
563
551
|
actorScheduleAfter(
|
|
564
552
|
ctx: ActorContextHandle,
|
|
@@ -43,7 +43,6 @@ import type {
|
|
|
43
43
|
RuntimeSqlDatabase,
|
|
44
44
|
RuntimeSqlExecResult,
|
|
45
45
|
RuntimeSqlExecuteResult,
|
|
46
|
-
RuntimeSqlLeaseOptions,
|
|
47
46
|
RuntimeSqlQueryResult,
|
|
48
47
|
RuntimeSqlRunResult,
|
|
49
48
|
RuntimeStateDeltaPayload,
|
|
@@ -687,13 +686,7 @@ export class WasmCoreRuntime implements CoreRuntime {
|
|
|
687
686
|
async actorSqlExec(
|
|
688
687
|
ctx: ActorContextHandle,
|
|
689
688
|
sql: string,
|
|
690
|
-
lease?: RuntimeSqlLeaseOptions,
|
|
691
689
|
): Promise<RuntimeSqlExecResult> {
|
|
692
|
-
if (lease) {
|
|
693
|
-
throw new Error(
|
|
694
|
-
"sqlite transaction leases are unavailable in the wasm runtime",
|
|
695
|
-
);
|
|
696
|
-
}
|
|
697
690
|
return await callWasm(() => this.#actorSql(ctx).exec(sql));
|
|
698
691
|
}
|
|
699
692
|
|
|
@@ -701,13 +694,7 @@ export class WasmCoreRuntime implements CoreRuntime {
|
|
|
701
694
|
ctx: ActorContextHandle,
|
|
702
695
|
sql: string,
|
|
703
696
|
params?: RuntimeSqlBindParams,
|
|
704
|
-
lease?: RuntimeSqlLeaseOptions,
|
|
705
697
|
): Promise<RuntimeSqlExecuteResult> {
|
|
706
|
-
if (lease) {
|
|
707
|
-
throw new Error(
|
|
708
|
-
"sqlite transaction leases are unavailable in the wasm runtime",
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
698
|
const result = await callWasm(() =>
|
|
712
699
|
this.#actorSql(ctx).execute(sql, params),
|
|
713
700
|
);
|
|
@@ -749,10 +736,6 @@ export class WasmCoreRuntime implements CoreRuntime {
|
|
|
749
736
|
await callWasm(() => database.close());
|
|
750
737
|
}
|
|
751
738
|
|
|
752
|
-
async actorUdsProvision(_ctx: ActorContextHandle): Promise<never> {
|
|
753
|
-
throw new Error("actor UDS endpoints require the native runtime");
|
|
754
|
-
}
|
|
755
|
-
|
|
756
739
|
async actorQueueSend(
|
|
757
740
|
ctx: ActorContextHandle,
|
|
758
741
|
name: string,
|
|
@@ -857,11 +840,6 @@ export class WasmCoreRuntime implements CoreRuntime {
|
|
|
857
840
|
return await callHandleAsync(queue, "inspectMessages");
|
|
858
841
|
}
|
|
859
842
|
|
|
860
|
-
async actorQueueReset(ctx: ActorContextHandle): Promise<void> {
|
|
861
|
-
const queue = childHandle(asWasmActorContext(ctx), "queue");
|
|
862
|
-
await callHandleAsync(queue, "reset");
|
|
863
|
-
}
|
|
864
|
-
|
|
865
843
|
actorScheduleAfter(
|
|
866
844
|
ctx: ActorContextHandle,
|
|
867
845
|
durationMs: number | bigint,
|
package/src/workflow/context.ts
CHANGED
|
@@ -960,10 +960,6 @@ export class WorkflowContext<
|
|
|
960
960
|
await this.#wrapActive(() => this.#inner.removed(name, originalType));
|
|
961
961
|
}
|
|
962
962
|
|
|
963
|
-
getVersion(name: string, latest: number): Promise<number> {
|
|
964
|
-
return this.#wrapActive(() => this.#inner.getVersion(name, latest));
|
|
965
|
-
}
|
|
966
|
-
|
|
967
963
|
isEvicted(): boolean {
|
|
968
964
|
return this.#inner.isEvicted();
|
|
969
965
|
}
|
|
@@ -184,14 +184,6 @@ function toWorkflowEntryKind(kind: EntryKind): transport.WorkflowEntryKind {
|
|
|
184
184
|
originalName: kind.data.originalName ?? null,
|
|
185
185
|
},
|
|
186
186
|
};
|
|
187
|
-
case "version_check":
|
|
188
|
-
return {
|
|
189
|
-
tag: "WorkflowVersionCheckEntry",
|
|
190
|
-
val: {
|
|
191
|
-
resolved: kind.data.resolved,
|
|
192
|
-
latest: kind.data.latest,
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
187
|
default:
|
|
196
188
|
assertUnreachable(kind as never);
|
|
197
189
|
}
|