rivetkit 2.1.5 → 2.1.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.
Files changed (72) hide show
  1. package/dist/browser/client.js +1 -1
  2. package/dist/browser/client.js.map +1 -1
  3. package/dist/browser/inspector/client.js +1 -1
  4. package/dist/browser/inspector/client.js.map +1 -1
  5. package/dist/inspector.tar.gz +0 -0
  6. package/dist/tsup/{chunk-HYPIHCDT.cjs → chunk-2Q5WS6QH.cjs} +3 -4
  7. package/dist/tsup/chunk-2Q5WS6QH.cjs.map +1 -0
  8. package/dist/tsup/{chunk-D2SPAJVT.cjs → chunk-4YFX2SP2.cjs} +30 -30
  9. package/dist/tsup/{chunk-D2SPAJVT.cjs.map → chunk-4YFX2SP2.cjs.map} +1 -1
  10. package/dist/tsup/{chunk-7WF2QSIC.cjs → chunk-7ANRFQJK.cjs} +20 -20
  11. package/dist/tsup/{chunk-7WF2QSIC.cjs.map → chunk-7ANRFQJK.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-JPXO2H55.js → chunk-DOEWKM5V.js} +5 -5
  13. package/dist/tsup/{chunk-JC6BEPE7.cjs → chunk-DSXC3S7Q.cjs} +3 -3
  14. package/dist/tsup/{chunk-JC6BEPE7.cjs.map → chunk-DSXC3S7Q.cjs.map} +1 -1
  15. package/dist/tsup/{chunk-2OK7S6QF.js → chunk-ELCI2QTU.js} +2 -2
  16. package/dist/tsup/{chunk-IIJNPVPQ.cjs → chunk-GRHLSP4A.cjs} +152 -152
  17. package/dist/tsup/{chunk-IIJNPVPQ.cjs.map → chunk-GRHLSP4A.cjs.map} +1 -1
  18. package/dist/tsup/{chunk-PB5AEMKQ.cjs → chunk-GVBTEL2D.cjs} +3 -3
  19. package/dist/tsup/{chunk-PB5AEMKQ.cjs.map → chunk-GVBTEL2D.cjs.map} +1 -1
  20. package/dist/tsup/{chunk-EIATSBYZ.js → chunk-ITLKCAXM.js} +2 -3
  21. package/dist/tsup/{chunk-EIATSBYZ.js.map → chunk-ITLKCAXM.js.map} +1 -1
  22. package/dist/tsup/{chunk-GQGRQDRL.cjs → chunk-J45S63Q5.cjs} +4 -4
  23. package/dist/tsup/{chunk-GQGRQDRL.cjs.map → chunk-J45S63Q5.cjs.map} +1 -1
  24. package/dist/tsup/{chunk-R5OQUSLN.js → chunk-K7JTZNLG.js} +4 -4
  25. package/dist/tsup/{chunk-WY2SHWXQ.js → chunk-KARQFHQH.js} +4 -4
  26. package/dist/tsup/{chunk-SRIM3GHD.js → chunk-KJXZTBFN.js} +5 -5
  27. package/dist/tsup/{chunk-ZPWOYQHN.js → chunk-KTQKZOGC.js} +110 -110
  28. package/dist/tsup/chunk-KTQKZOGC.js.map +1 -0
  29. package/dist/tsup/{chunk-S662Y6ZU.js → chunk-PB5QRAQX.js} +2 -2
  30. package/dist/tsup/{chunk-TADUYCHF.js → chunk-SFC4YXTL.js} +2 -2
  31. package/dist/tsup/{chunk-TI5PXQGG.cjs → chunk-TTVNEKBE.cjs} +81 -81
  32. package/dist/tsup/{chunk-TI5PXQGG.cjs.map → chunk-TTVNEKBE.cjs.map} +1 -1
  33. package/dist/tsup/{chunk-OAXJWGMU.cjs → chunk-VQHUWB37.cjs} +192 -192
  34. package/dist/tsup/chunk-VQHUWB37.cjs.map +1 -0
  35. package/dist/tsup/{chunk-MIX2KB6U.js → chunk-W735O34B.js} +3 -3
  36. package/dist/tsup/{chunk-U5SMSA27.cjs → chunk-Z2X3VVCS.cjs} +235 -235
  37. package/dist/tsup/{chunk-U5SMSA27.cjs.map → chunk-Z2X3VVCS.cjs.map} +1 -1
  38. package/dist/tsup/client/mod.cjs +6 -6
  39. package/dist/tsup/client/mod.js +5 -5
  40. package/dist/tsup/common/log.cjs +2 -2
  41. package/dist/tsup/common/log.js +1 -1
  42. package/dist/tsup/common/websocket.cjs +3 -3
  43. package/dist/tsup/common/websocket.js +2 -2
  44. package/dist/tsup/driver-helpers/mod.cjs +4 -4
  45. package/dist/tsup/driver-helpers/mod.js +3 -3
  46. package/dist/tsup/driver-test-suite/mod.cjs +60 -60
  47. package/dist/tsup/driver-test-suite/mod.js +10 -10
  48. package/dist/tsup/inspector/mod.cjs +3 -3
  49. package/dist/tsup/inspector/mod.js +2 -2
  50. package/dist/tsup/mod.cjs +8 -8
  51. package/dist/tsup/mod.js +7 -7
  52. package/dist/tsup/serve-test-suite/mod.cjs +102 -102
  53. package/dist/tsup/serve-test-suite/mod.js +10 -10
  54. package/dist/tsup/test/mod.cjs +10 -10
  55. package/dist/tsup/test/mod.js +6 -6
  56. package/dist/tsup/utils.cjs +2 -2
  57. package/dist/tsup/utils.js +1 -1
  58. package/dist/tsup/workflow/mod.cjs +5 -5
  59. package/dist/tsup/workflow/mod.js +4 -4
  60. package/package.json +6 -6
  61. package/src/registry/index.ts +4 -4
  62. package/dist/tsup/chunk-HYPIHCDT.cjs.map +0 -1
  63. package/dist/tsup/chunk-OAXJWGMU.cjs.map +0 -1
  64. package/dist/tsup/chunk-ZPWOYQHN.js.map +0 -1
  65. /package/dist/tsup/{chunk-JPXO2H55.js.map → chunk-DOEWKM5V.js.map} +0 -0
  66. /package/dist/tsup/{chunk-2OK7S6QF.js.map → chunk-ELCI2QTU.js.map} +0 -0
  67. /package/dist/tsup/{chunk-R5OQUSLN.js.map → chunk-K7JTZNLG.js.map} +0 -0
  68. /package/dist/tsup/{chunk-WY2SHWXQ.js.map → chunk-KARQFHQH.js.map} +0 -0
  69. /package/dist/tsup/{chunk-SRIM3GHD.js.map → chunk-KJXZTBFN.js.map} +0 -0
  70. /package/dist/tsup/{chunk-S662Y6ZU.js.map → chunk-PB5QRAQX.js.map} +0 -0
  71. /package/dist/tsup/{chunk-TADUYCHF.js.map → chunk-SFC4YXTL.js.map} +0 -0
  72. /package/dist/tsup/{chunk-MIX2KB6U.js.map → chunk-W735O34B.js.map} +0 -0
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  WORKFLOW_GUARD_KV_KEY,
3
3
  workflow
4
- } from "./chunk-WY2SHWXQ.js";
4
+ } from "./chunk-KARQFHQH.js";
5
5
  import {
6
6
  actor,
7
7
  queue
8
- } from "./chunk-ZPWOYQHN.js";
8
+ } from "./chunk-KTQKZOGC.js";
9
9
  import {
10
10
  db
11
11
  } from "./chunk-KJSYAUOM.js";
12
12
  import {
13
13
  getLogger,
14
14
  promiseWithResolvers
15
- } from "./chunk-EIATSBYZ.js";
15
+ } from "./chunk-ITLKCAXM.js";
16
16
 
17
17
  // src/driver-test-suite/log.ts
18
18
  function logger() {
@@ -642,4 +642,4 @@ export {
642
642
  workflowSleepActor,
643
643
  workflowStopTeardownActor
644
644
  };
645
- //# sourceMappingURL=chunk-R5OQUSLN.js.map
645
+ //# sourceMappingURL=chunk-K7JTZNLG.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  encodeWorkflowHistoryTransport
3
- } from "./chunk-S662Y6ZU.js";
3
+ } from "./chunk-PB5QRAQX.js";
4
4
  import {
5
5
  ACTOR_CONTEXT_INTERNAL_SYMBOL,
6
6
  RUN_FUNCTION_CONFIG_SYMBOL,
7
7
  makeWorkflowKey,
8
8
  workflowStoragePrefix
9
- } from "./chunk-TADUYCHF.js";
9
+ } from "./chunk-SFC4YXTL.js";
10
10
  import {
11
11
  assertUnreachable,
12
12
  bufferToArrayBuffer,
13
13
  stringifyError
14
- } from "./chunk-EIATSBYZ.js";
14
+ } from "./chunk-ITLKCAXM.js";
15
15
 
16
16
  // src/workflow/mod.ts
17
17
  import { runWorkflow } from "@rivetkit/workflow-engine";
@@ -639,4 +639,4 @@ export {
639
639
  workflow,
640
640
  Loop
641
641
  };
642
- //# sourceMappingURL=chunk-WY2SHWXQ.js.map
642
+ //# sourceMappingURL=chunk-KARQFHQH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createClientWithDriver
3
- } from "./chunk-JPXO2H55.js";
3
+ } from "./chunk-DOEWKM5V.js";
4
4
  import {
5
5
  ACTOR_VERSIONED,
6
6
  ActionContext,
@@ -48,7 +48,7 @@ import {
48
48
  routeWebSocket,
49
49
  serializeActorKey,
50
50
  timingSafeEqual
51
- } from "./chunk-MIX2KB6U.js";
51
+ } from "./chunk-W735O34B.js";
52
52
  import {
53
53
  ActorContext,
54
54
  DeadlineError,
@@ -69,7 +69,7 @@ import {
69
69
  queueMessagesPrefix,
70
70
  queueMetadataKey,
71
71
  tracesStoragePrefix
72
- } from "./chunk-TADUYCHF.js";
72
+ } from "./chunk-SFC4YXTL.js";
73
73
  import {
74
74
  EXTRA_ERROR_LOG,
75
75
  SinglePromiseQueue,
@@ -86,7 +86,7 @@ import {
86
86
  promiseWithResolvers,
87
87
  setLongTimeout,
88
88
  stringifyError
89
- } from "./chunk-EIATSBYZ.js";
89
+ } from "./chunk-ITLKCAXM.js";
90
90
  import {
91
91
  ActionNotFound,
92
92
  ActionTimedOut,
@@ -5981,4 +5981,4 @@ export {
5981
5981
  createFileSystemDriver,
5982
5982
  createMemoryDriver
5983
5983
  };
5984
- //# sourceMappingURL=chunk-SRIM3GHD.js.map
5984
+ //# sourceMappingURL=chunk-KJXZTBFN.js.map
@@ -5,7 +5,7 @@ import {
5
5
  ensureDirectoryExists,
6
6
  getStoragePath,
7
7
  lookupInRegistry
8
- } from "./chunk-SRIM3GHD.js";
8
+ } from "./chunk-KJXZTBFN.js";
9
9
  import {
10
10
  ClientConfigSchemaBase,
11
11
  RemoteManagerDriver,
@@ -16,7 +16,7 @@ import {
16
16
  getEndpoint,
17
17
  transformClientConfig,
18
18
  updateRunnerConfig
19
- } from "./chunk-JPXO2H55.js";
19
+ } from "./chunk-DOEWKM5V.js";
20
20
  import {
21
21
  CONN_STATE_MANAGER_SYMBOL,
22
22
  ENGINE_ENDPOINT,
@@ -48,14 +48,14 @@ import {
48
48
  parseWebSocketProtocols,
49
49
  routeWebSocket,
50
50
  truncateRawWebSocketPathPrefix
51
- } from "./chunk-MIX2KB6U.js";
51
+ } from "./chunk-W735O34B.js";
52
52
  import {
53
53
  ActorConfigSchema,
54
54
  KEYS,
55
55
  event,
56
56
  loggerWithoutContext,
57
57
  queue
58
- } from "./chunk-TADUYCHF.js";
58
+ } from "./chunk-SFC4YXTL.js";
59
59
  import {
60
60
  LogLevelSchema,
61
61
  VERSION,
@@ -63,7 +63,6 @@ import {
63
63
  configureDefaultLogger,
64
64
  detectRuntime,
65
65
  getLogger,
66
- getNodeEnv,
67
66
  getRivetRunEngine,
68
67
  getRivetRunEngineVersion,
69
68
  getRivetRunnerKey,
@@ -74,7 +73,7 @@ import {
74
73
  promiseWithResolvers,
75
74
  setLongTimeout,
76
75
  stringifyError
77
- } from "./chunk-EIATSBYZ.js";
76
+ } from "./chunk-ITLKCAXM.js";
78
77
  import {
79
78
  EndpointMismatch,
80
79
  InvalidRequest,
@@ -836,101 +835,6 @@ function createEngineDriver() {
836
835
  };
837
836
  }
838
837
 
839
- // src/registry/config/legacy-runner.ts
840
- import { z as z2 } from "zod/v4";
841
- var LegacyDriverConfigSchema = z2.object({
842
- /** Machine-readable name to identify this driver by. */
843
- name: z2.string(),
844
- manager: z2.custom(),
845
- actor: z2.custom()
846
- });
847
- var LegacyRunnerConfigSchemaUnmerged = z2.object({
848
- driver: LegacyDriverConfigSchema.optional(),
849
- /** @experimental */
850
- maxIncomingMessageSize: z2.number().optional().default(65536),
851
- /** @experimental */
852
- maxOutgoingMessageSize: z2.number().optional().default(1048576),
853
- /** @experimental */
854
- inspector: InspectorConfigSchema,
855
- /** @experimental */
856
- disableDefaultServer: z2.boolean().optional().default(false),
857
- /** @experimental */
858
- defaultServerPort: z2.number().default(6420),
859
- /** @experimental */
860
- runEngine: z2.boolean().optional().default(() => getRivetRunEngine()),
861
- /** @experimental */
862
- runEngineVersion: z2.string().optional().default(() => getRivetRunEngineVersion() ?? VERSION),
863
- /** @experimental */
864
- overrideServerAddress: z2.string().optional(),
865
- /** @experimental */
866
- disableActorDriver: z2.boolean().optional().default(false),
867
- /**
868
- * @experimental
869
- *
870
- * Whether to run runners normally or have them managed
871
- * serverlessly (by the Rivet Engine for example).
872
- */
873
- runnerKind: z2.enum(["serverless", "normal"]).optional().default(
874
- () => getRivetRunnerKind() === "serverless" ? "serverless" : "normal"
875
- ),
876
- totalSlots: z2.number().optional(),
877
- /**
878
- * @experimental
879
- *
880
- * Base path for the router. This is used to prefix all routes.
881
- * For example, if the base path is `/api`, then the route `/actors` will be
882
- * available at `/api/actors`.
883
- */
884
- basePath: z2.string().optional().default("/"),
885
- /**
886
- * @experimental
887
- *
888
- * Disable welcome message.
889
- * */
890
- noWelcome: z2.boolean().optional().default(false),
891
- /**
892
- * @experimental
893
- * */
894
- logging: z2.object({
895
- baseLogger: z2.custom().optional(),
896
- level: LogLevelSchema.optional()
897
- }).optional().default(() => ({})),
898
- /**
899
- * @experimental
900
- *
901
- * Automatically configure serverless runners in the engine.
902
- * Can only be used when runnerKind is "serverless".
903
- * If true, uses default configuration. Can also provide custom configuration.
904
- */
905
- autoConfigureServerless: z2.union([
906
- z2.boolean(),
907
- z2.object({
908
- url: z2.string().optional(),
909
- headers: z2.record(z2.string(), z2.string()).optional(),
910
- maxRunners: z2.number().optional(),
911
- minRunners: z2.number().optional(),
912
- requestLifespan: z2.number().optional(),
913
- runnersMargin: z2.number().optional(),
914
- slotsPerRunner: z2.number().optional(),
915
- metadata: z2.record(z2.string(), z2.unknown()).optional()
916
- })
917
- ]).optional(),
918
- // This is a function to allow for lazy configuration of upgradeWebSocket on the
919
- // fly. This is required since the dependencies that upgradeWebSocket
920
- // (specifically Node.js) can sometimes only be specified after the router is
921
- // created or must be imported async using `await import(...)`
922
- getUpgradeWebSocket: z2.custom().optional(),
923
- /** @experimental */
924
- token: z2.string().optional().transform((v) => v || getRivetToken())
925
- }).merge(EngineConfigSchemaBase);
926
- var LegacyRunnerConfigSchemaTransformed = LegacyRunnerConfigSchemaUnmerged.transform((config, ctx) => ({
927
- ...config,
928
- ...transformEngineConfig(config, ctx)
929
- }));
930
- var LegacyRunnerConfigSchema = LegacyRunnerConfigSchemaTransformed.default(
931
- () => LegacyRunnerConfigSchemaTransformed.parse({})
932
- );
933
-
934
838
  // runtime/index.ts
935
839
  import invariant4 from "invariant";
936
840
 
@@ -1405,19 +1309,19 @@ async function configureServerlessRunner(config) {
1405
1309
  import invariant3 from "invariant";
1406
1310
 
1407
1311
  // src/manager/router-schema.ts
1408
- import { z as z3 } from "zod/v4";
1409
- var ServerlessStartHeadersSchema = z3.object({
1410
- endpoint: z3.string({
1312
+ import { z as z2 } from "zod/v4";
1313
+ var ServerlessStartHeadersSchema = z2.object({
1314
+ endpoint: z2.string({
1411
1315
  error: "x-rivet-endpoint header is required"
1412
1316
  }),
1413
- token: z3.string({ error: "x-rivet-token header must be a string" }).optional(),
1414
- totalSlots: z3.coerce.number({
1317
+ token: z2.string({ error: "x-rivet-token header must be a string" }).optional(),
1318
+ totalSlots: z2.coerce.number({
1415
1319
  error: "x-rivet-total-slots header must be a number"
1416
1320
  }).int({ error: "x-rivet-total-slots header must be an integer" }).gte(1, { error: "x-rivet-total-slots header must be positive" }),
1417
- runnerName: z3.string({
1321
+ runnerName: z2.string({
1418
1322
  error: "x-rivet-runner-name header is required"
1419
1323
  }),
1420
- namespace: z3.string({
1324
+ namespace: z2.string({
1421
1325
  error: "x-rivet-namespace-name header is required"
1422
1326
  })
1423
1327
  });
@@ -1707,6 +1611,101 @@ var Runtime = class _Runtime {
1707
1611
  }
1708
1612
  };
1709
1613
 
1614
+ // src/registry/config/legacy-runner.ts
1615
+ import { z as z3 } from "zod/v4";
1616
+ var LegacyDriverConfigSchema = z3.object({
1617
+ /** Machine-readable name to identify this driver by. */
1618
+ name: z3.string(),
1619
+ manager: z3.custom(),
1620
+ actor: z3.custom()
1621
+ });
1622
+ var LegacyRunnerConfigSchemaUnmerged = z3.object({
1623
+ driver: LegacyDriverConfigSchema.optional(),
1624
+ /** @experimental */
1625
+ maxIncomingMessageSize: z3.number().optional().default(65536),
1626
+ /** @experimental */
1627
+ maxOutgoingMessageSize: z3.number().optional().default(1048576),
1628
+ /** @experimental */
1629
+ inspector: InspectorConfigSchema,
1630
+ /** @experimental */
1631
+ disableDefaultServer: z3.boolean().optional().default(false),
1632
+ /** @experimental */
1633
+ defaultServerPort: z3.number().default(6420),
1634
+ /** @experimental */
1635
+ runEngine: z3.boolean().optional().default(() => getRivetRunEngine()),
1636
+ /** @experimental */
1637
+ runEngineVersion: z3.string().optional().default(() => getRivetRunEngineVersion() ?? VERSION),
1638
+ /** @experimental */
1639
+ overrideServerAddress: z3.string().optional(),
1640
+ /** @experimental */
1641
+ disableActorDriver: z3.boolean().optional().default(false),
1642
+ /**
1643
+ * @experimental
1644
+ *
1645
+ * Whether to run runners normally or have them managed
1646
+ * serverlessly (by the Rivet Engine for example).
1647
+ */
1648
+ runnerKind: z3.enum(["serverless", "normal"]).optional().default(
1649
+ () => getRivetRunnerKind() === "serverless" ? "serverless" : "normal"
1650
+ ),
1651
+ totalSlots: z3.number().optional(),
1652
+ /**
1653
+ * @experimental
1654
+ *
1655
+ * Base path for the router. This is used to prefix all routes.
1656
+ * For example, if the base path is `/api`, then the route `/actors` will be
1657
+ * available at `/api/actors`.
1658
+ */
1659
+ basePath: z3.string().optional().default("/"),
1660
+ /**
1661
+ * @experimental
1662
+ *
1663
+ * Disable welcome message.
1664
+ * */
1665
+ noWelcome: z3.boolean().optional().default(false),
1666
+ /**
1667
+ * @experimental
1668
+ * */
1669
+ logging: z3.object({
1670
+ baseLogger: z3.custom().optional(),
1671
+ level: LogLevelSchema.optional()
1672
+ }).optional().default(() => ({})),
1673
+ /**
1674
+ * @experimental
1675
+ *
1676
+ * Automatically configure serverless runners in the engine.
1677
+ * Can only be used when runnerKind is "serverless".
1678
+ * If true, uses default configuration. Can also provide custom configuration.
1679
+ */
1680
+ autoConfigureServerless: z3.union([
1681
+ z3.boolean(),
1682
+ z3.object({
1683
+ url: z3.string().optional(),
1684
+ headers: z3.record(z3.string(), z3.string()).optional(),
1685
+ maxRunners: z3.number().optional(),
1686
+ minRunners: z3.number().optional(),
1687
+ requestLifespan: z3.number().optional(),
1688
+ runnersMargin: z3.number().optional(),
1689
+ slotsPerRunner: z3.number().optional(),
1690
+ metadata: z3.record(z3.string(), z3.unknown()).optional()
1691
+ })
1692
+ ]).optional(),
1693
+ // This is a function to allow for lazy configuration of upgradeWebSocket on the
1694
+ // fly. This is required since the dependencies that upgradeWebSocket
1695
+ // (specifically Node.js) can sometimes only be specified after the router is
1696
+ // created or must be imported async using `await import(...)`
1697
+ getUpgradeWebSocket: z3.custom().optional(),
1698
+ /** @experimental */
1699
+ token: z3.string().optional().transform((v) => v || getRivetToken())
1700
+ }).merge(EngineConfigSchemaBase);
1701
+ var LegacyRunnerConfigSchemaTransformed = LegacyRunnerConfigSchemaUnmerged.transform((config, ctx) => ({
1702
+ ...config,
1703
+ ...transformEngineConfig(config, ctx)
1704
+ }));
1705
+ var LegacyRunnerConfigSchema = LegacyRunnerConfigSchemaTransformed.default(
1706
+ () => LegacyRunnerConfigSchemaTransformed.parse({})
1707
+ );
1708
+
1710
1709
  // src/registry/index.ts
1711
1710
  var Registry = class {
1712
1711
  #config;
@@ -1720,8 +1719,9 @@ var Registry = class {
1720
1719
  #runtime;
1721
1720
  #runtimePromise;
1722
1721
  constructor(config) {
1722
+ var _a;
1723
1723
  this.#config = config;
1724
- if (getNodeEnv() !== "test") {
1724
+ if (((_a = config.serverless) == null ? void 0 : _a.spawnEngine) || config.serveManager) {
1725
1725
  setTimeout(() => {
1726
1726
  this.#ensureRuntime();
1727
1727
  }, 0);
@@ -1832,4 +1832,4 @@ export {
1832
1832
  Registry,
1833
1833
  setup
1834
1834
  };
1835
- //# sourceMappingURL=chunk-ZPWOYQHN.js.map
1835
+ //# sourceMappingURL=chunk-KTQKZOGC.js.map