rivetkit 0.0.0-pr.4857.3a10f72 → 0.0.0-pr.4860.2a8ccdf

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.
Files changed (95) hide show
  1. package/dist/browser/client.d.ts +55 -2
  2. package/dist/browser/client.js +31 -11
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +3 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/agent-os/index.cjs +37 -2
  7. package/dist/tsup/agent-os/index.cjs.map +1 -1
  8. package/dist/tsup/agent-os/index.d.cts +59 -4
  9. package/dist/tsup/agent-os/index.d.ts +59 -4
  10. package/dist/tsup/agent-os/index.js +37 -2
  11. package/dist/tsup/agent-os/index.js.map +1 -1
  12. package/dist/tsup/{chunk-W6VZVQ74.js → chunk-3INWR34Y.js} +10 -7
  13. package/dist/tsup/chunk-3INWR34Y.js.map +1 -0
  14. package/dist/tsup/{chunk-VGIZJDH2.cjs → chunk-AD7OK7LI.cjs} +10 -10
  15. package/dist/tsup/{chunk-VGIZJDH2.cjs.map → chunk-AD7OK7LI.cjs.map} +1 -1
  16. package/dist/tsup/{chunk-IK7XOPVQ.cjs → chunk-AZIIYUHK.cjs} +19 -9
  17. package/dist/tsup/chunk-AZIIYUHK.cjs.map +1 -0
  18. package/dist/tsup/{chunk-NV4O6INK.js → chunk-EVNC2AVD.js} +21 -6
  19. package/dist/tsup/chunk-EVNC2AVD.js.map +1 -0
  20. package/dist/tsup/{chunk-4FNDV4JS.cjs → chunk-F4S2N3JO.cjs} +3 -3
  21. package/dist/tsup/{chunk-4FNDV4JS.cjs.map → chunk-F4S2N3JO.cjs.map} +1 -1
  22. package/dist/tsup/{chunk-NOUNIXHW.js → chunk-FE2HXRKQ.js} +3 -3
  23. package/dist/tsup/{chunk-SZJTLUYZ.cjs → chunk-FSGTF6EC.cjs} +4 -4
  24. package/dist/tsup/{chunk-SZJTLUYZ.cjs.map → chunk-FSGTF6EC.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-YONSKZBP.js → chunk-GFCBXIAL.js} +2 -2
  26. package/dist/tsup/{chunk-NILLFLQK.js → chunk-J4RG6VUY.js} +18 -8
  27. package/dist/tsup/chunk-J4RG6VUY.js.map +1 -0
  28. package/dist/tsup/{chunk-6PJ4EWLG.js → chunk-JPI2RVP3.js} +2 -2
  29. package/dist/tsup/{chunk-NIEZ7RPT.cjs → chunk-MZLHWYXX.cjs} +142 -139
  30. package/dist/tsup/chunk-MZLHWYXX.cjs.map +1 -0
  31. package/dist/tsup/{chunk-R6VNBRIY.cjs → chunk-O7HNW6KQ.cjs} +8 -8
  32. package/dist/tsup/{chunk-R6VNBRIY.cjs.map → chunk-O7HNW6KQ.cjs.map} +1 -1
  33. package/dist/tsup/{chunk-K7P7UC7A.cjs → chunk-SX75GIG2.cjs} +25 -10
  34. package/dist/tsup/chunk-SX75GIG2.cjs.map +1 -0
  35. package/dist/tsup/{chunk-OJEQ6EHD.js → chunk-UYKG5R7O.js} +4 -4
  36. package/dist/tsup/client/mod.cjs +7 -7
  37. package/dist/tsup/client/mod.cjs.map +1 -1
  38. package/dist/tsup/client/mod.d.cts +3 -2
  39. package/dist/tsup/client/mod.d.ts +3 -2
  40. package/dist/tsup/client/mod.js +6 -6
  41. package/dist/tsup/common/log.cjs +2 -2
  42. package/dist/tsup/common/log.js +1 -1
  43. package/dist/tsup/common/websocket.cjs +3 -3
  44. package/dist/tsup/common/websocket.js +2 -2
  45. package/dist/tsup/{config-DXQrxi9u.d.ts → config-Ditotsl8.d.ts} +97 -4
  46. package/dist/tsup/{config-D0JkLRC6.d.cts → config-ctKnLh95.d.cts} +97 -4
  47. package/dist/tsup/{context-CTmlWPyt.d.ts → context-BQAsyraR.d.ts} +1 -1
  48. package/dist/tsup/{context-CmbKWIPs.d.cts → context-BpqKT1X1.d.cts} +1 -1
  49. package/dist/tsup/inspector/mod.cjs +5 -5
  50. package/dist/tsup/inspector/mod.js +4 -4
  51. package/dist/tsup/mod.cjs +1857 -458
  52. package/dist/tsup/mod.cjs.map +1 -1
  53. package/dist/tsup/mod.d.cts +4 -3
  54. package/dist/tsup/mod.d.ts +4 -3
  55. package/dist/tsup/mod.js +1815 -416
  56. package/dist/tsup/mod.js.map +1 -1
  57. package/dist/tsup/test/mod.cjs +10 -10
  58. package/dist/tsup/test/mod.d.cts +2 -1
  59. package/dist/tsup/test/mod.d.ts +2 -1
  60. package/dist/tsup/test/mod.js +6 -6
  61. package/dist/tsup/utils.cjs +2 -2
  62. package/dist/tsup/utils.js +1 -1
  63. package/dist/tsup/workflow/mod.cjs +7 -7
  64. package/dist/tsup/workflow/mod.d.cts +4 -3
  65. package/dist/tsup/workflow/mod.d.ts +4 -3
  66. package/dist/tsup/workflow/mod.js +4 -4
  67. package/package.json +9 -7
  68. package/src/agent-os/actor/cron.ts +37 -2
  69. package/src/agent-os/types.ts +11 -0
  70. package/src/client/actor-conn.ts +8 -0
  71. package/src/common/database/mod.test.ts +106 -0
  72. package/src/common/database/native-database.test.ts +57 -0
  73. package/src/common/database/native-database.ts +74 -7
  74. package/src/common/encoding.ts +24 -4
  75. package/src/common/utils.ts +8 -2
  76. package/src/globals.d.ts +4 -0
  77. package/src/registry/config/index.ts +116 -6
  78. package/src/registry/index.ts +59 -48
  79. package/src/registry/napi-runtime.ts +759 -0
  80. package/src/registry/native.ts +761 -430
  81. package/src/registry/runtime.test.ts +79 -0
  82. package/src/registry/runtime.ts +592 -0
  83. package/src/registry/wasm-runtime.ts +987 -0
  84. package/src/serde.ts +6 -0
  85. package/src/utils/env-vars.ts +2 -0
  86. package/dist/tsup/chunk-IK7XOPVQ.cjs.map +0 -1
  87. package/dist/tsup/chunk-K7P7UC7A.cjs.map +0 -1
  88. package/dist/tsup/chunk-NIEZ7RPT.cjs.map +0 -1
  89. package/dist/tsup/chunk-NILLFLQK.js.map +0 -1
  90. package/dist/tsup/chunk-NV4O6INK.js.map +0 -1
  91. package/dist/tsup/chunk-W6VZVQ74.js.map +0 -1
  92. /package/dist/tsup/{chunk-NOUNIXHW.js.map → chunk-FE2HXRKQ.js.map} +0 -0
  93. /package/dist/tsup/{chunk-YONSKZBP.js.map → chunk-GFCBXIAL.js.map} +0 -0
  94. /package/dist/tsup/{chunk-6PJ4EWLG.js.map → chunk-JPI2RVP3.js.map} +0 -0
  95. /package/dist/tsup/{chunk-OJEQ6EHD.js.map → chunk-UYKG5R7O.js.map} +0 -0
@@ -1,3 +1,4 @@
1
+ import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
1
2
  import { z as z$2 } from 'zod';
2
3
  import z$1, { z } from 'zod/v4';
3
4
  import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
@@ -1338,10 +1339,40 @@ type RegistryActors = z$2.infer<typeof ActorsSchema>;
1338
1339
  declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
1339
1340
  use: z$2.ZodRecord<z$2.ZodString, z$2.ZodCustom<AnyActorDefinition, AnyActorDefinition>>;
1340
1341
  test: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
1341
- enabled: z$2.ZodBoolean;
1342
+ enabled: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodBoolean>>;
1343
+ sqliteBackend: z$2.ZodOptional<z$2.ZodEnum<{
1344
+ local: "local";
1345
+ remote: "remote";
1346
+ }>>;
1342
1347
  }, z$2.core.$strip>>>;
1343
1348
  maxIncomingMessageSize: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodNumber>>;
1344
1349
  maxOutgoingMessageSize: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodNumber>>;
1350
+ runtime: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodEnum<{
1351
+ auto: "auto";
1352
+ native: "native";
1353
+ wasm: "wasm";
1354
+ }>>, z$2.ZodTransform<"auto" | "native" | "wasm", "auto" | "native" | "wasm" | undefined>>;
1355
+ wasm: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
1356
+ bindings: z$2.ZodOptional<z$2.ZodCustom<typeof _rivetkit_rivetkit_wasm, typeof _rivetkit_rivetkit_wasm>>;
1357
+ initInput: z$2.ZodOptional<z$2.ZodCustom<{
1358
+ module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
1359
+ } | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined, {
1360
+ module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
1361
+ } | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined>>;
1362
+ }, z$2.core.$strip>>>;
1363
+ sqlite: z$2.ZodPipe<z$2.ZodOptional<z$2.ZodUnion<readonly [z$2.ZodEnum<{
1364
+ local: "local";
1365
+ remote: "remote";
1366
+ }>, z$2.ZodObject<{
1367
+ backend: z$2.ZodEnum<{
1368
+ local: "local";
1369
+ remote: "remote";
1370
+ }>;
1371
+ }, z$2.core.$strip>]>>, z$2.ZodTransform<{
1372
+ backend: "local" | "remote";
1373
+ } | undefined, "local" | "remote" | {
1374
+ backend: "local" | "remote";
1375
+ } | undefined>>;
1345
1376
  noWelcome: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodBoolean>>;
1346
1377
  logging: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodObject<{
1347
1378
  baseLogger: z$2.ZodOptional<z$2.ZodCustom<Logger, Logger>>;
@@ -1392,6 +1423,9 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
1392
1423
  disableSignalHandlers: z$2.ZodDefault<z$2.ZodOptional<z$2.ZodBoolean>>;
1393
1424
  }, z$2.core.$strip>>>;
1394
1425
  }, z$2.core.$strip>, z$2.ZodTransform<{
1426
+ sqlite: {
1427
+ backend: "local" | "remote";
1428
+ } | undefined;
1395
1429
  endpoint: string | undefined;
1396
1430
  namespace: string;
1397
1431
  token: string | undefined;
@@ -1408,9 +1442,17 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
1408
1442
  use: Record<string, AnyActorDefinition>;
1409
1443
  test: {
1410
1444
  enabled: boolean;
1445
+ sqliteBackend?: "local" | "remote" | undefined;
1411
1446
  };
1412
1447
  maxIncomingMessageSize: number;
1413
1448
  maxOutgoingMessageSize: number;
1449
+ runtime: "auto" | "native" | "wasm";
1450
+ wasm: {
1451
+ bindings?: typeof _rivetkit_rivetkit_wasm | undefined;
1452
+ initInput?: {
1453
+ module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
1454
+ } | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined;
1455
+ };
1414
1456
  noWelcome: boolean;
1415
1457
  logging: {
1416
1458
  baseLogger?: Logger | undefined;
@@ -1447,9 +1489,20 @@ declare const RegistryConfigSchema: z$2.ZodPipe<z$2.ZodObject<{
1447
1489
  use: Record<string, AnyActorDefinition>;
1448
1490
  test: {
1449
1491
  enabled: boolean;
1492
+ sqliteBackend?: "local" | "remote" | undefined;
1450
1493
  };
1451
1494
  maxIncomingMessageSize: number;
1452
1495
  maxOutgoingMessageSize: number;
1496
+ runtime: "auto" | "native" | "wasm";
1497
+ wasm: {
1498
+ bindings?: typeof _rivetkit_rivetkit_wasm | undefined;
1499
+ initInput?: {
1500
+ module_or_path: _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput>;
1501
+ } | _rivetkit_rivetkit_wasm.InitInput | Promise<_rivetkit_rivetkit_wasm.InitInput> | undefined;
1502
+ };
1503
+ sqlite: {
1504
+ backend: "local" | "remote";
1505
+ } | undefined;
1453
1506
  noWelcome: boolean;
1454
1507
  logging: {
1455
1508
  baseLogger?: Logger | undefined;
@@ -1528,7 +1581,7 @@ declare class Registry<A extends RegistryActors> {
1528
1581
  serve(): ServerlessHandler;
1529
1582
  startEnvoy(): void;
1530
1583
  /**
1531
- * Starts the native actor envoy for standalone server deployments.
1584
+ * Starts the actor envoy for standalone server deployments.
1532
1585
  *
1533
1586
  * @example
1534
1587
  * ```ts
@@ -193,8 +193,14 @@ function deconstructError(error, logger4, extraLog, exposeInternalError = false)
193
193
  function stringifyError(error) {
194
194
  if (error instanceof Error) {
195
195
  if (typeof process !== "undefined" && getLogErrorStack()) {
196
- return `${error.name}: ${error.message}${error.stack ? `
197
- ${error.stack}` : ""}`;
196
+ let stack;
197
+ try {
198
+ stack = error.stack;
199
+ } catch {
200
+ stack = void 0;
201
+ }
202
+ return `${error.name}: ${error.message}${stack ? `
203
+ ${stack}` : ""}`;
198
204
  } else {
199
205
  return `${error.name}: ${error.message}`;
200
206
  }
@@ -225,7 +231,7 @@ function noopNext() {
225
231
  // package.json
226
232
  var package_default = {
227
233
  name: "rivetkit",
228
- version: "0.0.0-pr.4857.3a10f72",
234
+ version: "0.0.0-pr.4860.2a8ccdf",
229
235
  description: "Lightweight libraries for building stateful actors on edge platforms",
230
236
  license: "Apache-2.0",
231
237
  keywords: [
@@ -386,6 +392,7 @@ var package_default = {
386
392
  format: "biome format .",
387
393
  "format:write": "biome format --write .",
388
394
  test: "vitest run",
395
+ "test:platforms": "pnpm run build && RIVETKIT_INCLUDE_PLATFORM_TESTS=1 vitest run tests/platforms --passWithNoTests",
389
396
  "test:watch": "vitest",
390
397
  "dump-asyncapi": "tsx scripts/dump-asyncapi.ts",
391
398
  "registry-config-schema-gen": "tsx scripts/registry-config-schema-gen.ts",
@@ -400,6 +407,7 @@ var package_default = {
400
407
  "@rivetkit/engine-cli": "workspace:*",
401
408
  "@rivetkit/engine-envoy-protocol": "workspace:*",
402
409
  "@rivetkit/rivetkit-napi": "workspace:*",
410
+ "@rivetkit/rivetkit-wasm": "workspace:*",
403
411
  "@rivetkit/traces": "workspace:*",
404
412
  "@rivetkit/virtual-websocket": "workspace:*",
405
413
  "@rivetkit/workflow-engine": "workspace:*",
@@ -521,13 +529,13 @@ function getLogger(name = "default") {
521
529
  }
522
530
 
523
531
  // src/utils.ts
524
- var VERSION2 = package_default.version;
532
+ var VERSION = package_default.version;
525
533
  var _userAgent;
526
534
  function httpUserAgent() {
527
535
  if (_userAgent !== void 0) {
528
536
  return _userAgent;
529
537
  }
530
- let userAgent = `RivetKit/${VERSION2}`;
538
+ let userAgent = `RivetKit/${VERSION}`;
531
539
  const navigatorObj = typeof navigator !== "undefined" ? navigator : void 0;
532
540
  if (navigatorObj?.userAgent) userAgent += ` ${navigatorObj.userAgent}`;
533
541
  _userAgent = userAgent;
@@ -583,7 +591,7 @@ function combineUrlPath(endpoint, path, queryParams) {
583
591
  var EXTRA_ERROR_LOG = {
584
592
  issues: "https://github.com/rivet-dev/rivet/issues",
585
593
  support: "https://rivet.dev/discord",
586
- version: VERSION2
594
+ version: VERSION
587
595
  };
588
596
 
589
597
  // src/devtools-loader/log.ts
@@ -592,7 +600,7 @@ function logger() {
592
600
  }
593
601
 
594
602
  // src/devtools-loader/index.ts
595
- var DEFAULT_DEVTOOLS_URL = (version = VERSION2) => `https://releases.rivet.dev/rivet/latest/devtools/mod.js?v=${version}`;
603
+ var DEFAULT_DEVTOOLS_URL = (version = VERSION) => `https://releases.rivet.dev/rivet/latest/devtools/mod.js?v=${version}`;
596
604
  var scriptId = "rivetkit-devtools-script";
597
605
  function injectDevtools(config) {
598
606
  if (!window) {
@@ -792,7 +800,13 @@ function encodeJsonCompatValue(input) {
792
800
  }
793
801
  return input;
794
802
  }
795
- function reviveJsonCompatValue(input) {
803
+ function reviveJsonCompatValue(input, options = {}) {
804
+ if (typeof input === "bigint") {
805
+ if (options.coerceSafeIntegerBigInts && input >= BigInt(Number.MIN_SAFE_INTEGER) && input <= BigInt(Number.MAX_SAFE_INTEGER)) {
806
+ return Number(input);
807
+ }
808
+ return input;
809
+ }
796
810
  if (Array.isArray(input)) {
797
811
  if (input.length === 2 && typeof input[0] === "string" && input[0].startsWith("$")) {
798
812
  if (input[0] === JSON_COMPAT_BIGINT) {
@@ -808,18 +822,21 @@ function reviveJsonCompatValue(input) {
808
822
  return void 0;
809
823
  }
810
824
  if (input[0].startsWith("$$")) {
811
- return [input[0].substring(1), reviveJsonCompatValue(input[1])];
825
+ return [
826
+ input[0].substring(1),
827
+ reviveJsonCompatValue(input[1], options)
828
+ ];
812
829
  }
813
830
  throw new Error(
814
831
  `Unknown JSON encoding type: ${input[0]}. This may indicate corrupted data or a version mismatch.`
815
832
  );
816
833
  }
817
- return input.map((value) => reviveJsonCompatValue(value));
834
+ return input.map((value) => reviveJsonCompatValue(value, options));
818
835
  }
819
836
  if (isPlainObject(input)) {
820
837
  const decoded = {};
821
838
  for (const [key, value] of Object.entries(input)) {
822
- decoded[key] = reviveJsonCompatValue(value);
839
+ decoded[key] = reviveJsonCompatValue(value, options);
823
840
  }
824
841
  return decoded;
825
842
  }
@@ -4232,6 +4249,9 @@ var ActorConnRaw = class {
4232
4249
  if (error instanceof RivetError && this.#shouldReconnectForStaleActor(error.group, error.code)) {
4233
4250
  return true;
4234
4251
  }
4252
+ if (error instanceof RivetError && error.group === "client" && error.code === "get_params_failed") {
4253
+ return true;
4254
+ }
4235
4255
  return isRetryableLifecycleReconnectSignal(error);
4236
4256
  }
4237
4257
  #clearQueuedMessages() {