rivetkit 2.3.0-rc.5 → 2.3.0-rc.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 (113) hide show
  1. package/dist/browser/client.d.ts +21 -18
  2. package/dist/browser/client.js +735 -170
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +1 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/actor/errors.cjs +4 -2
  7. package/dist/tsup/actor/errors.cjs.map +1 -1
  8. package/dist/tsup/actor/errors.d.cts +1 -74
  9. package/dist/tsup/actor/errors.d.ts +1 -74
  10. package/dist/tsup/actor/errors.js +3 -1
  11. package/dist/tsup/agent-os/index.cjs +1 -1
  12. package/dist/tsup/agent-os/index.cjs.map +1 -1
  13. package/dist/tsup/agent-os/index.d.cts +18 -7
  14. package/dist/tsup/agent-os/index.d.ts +18 -7
  15. package/dist/tsup/agent-os/index.js +1 -1
  16. package/dist/tsup/agent-os/index.js.map +1 -1
  17. package/dist/tsup/{chunk-2GANBXVP.cjs → chunk-2G64KSZQ.cjs} +10 -10
  18. package/dist/tsup/{chunk-2GANBXVP.cjs.map → chunk-2G64KSZQ.cjs.map} +1 -1
  19. package/dist/tsup/{chunk-N2DQSJIW.js → chunk-6S25NVAP.js} +13 -46
  20. package/dist/tsup/chunk-6S25NVAP.js.map +1 -0
  21. package/dist/tsup/{chunk-NATOT3ET.js → chunk-CAF6JDJE.js} +4 -4
  22. package/dist/tsup/{chunk-PGYEMIOE.js → chunk-DEO7MMWQ.js} +2 -2
  23. package/dist/tsup/{chunk-SULB574D.js → chunk-EMO6E3PJ.js} +3 -3
  24. package/dist/tsup/{chunk-FTZIZ3JG.cjs → chunk-ENK7C66G.cjs} +838 -236
  25. package/dist/tsup/chunk-ENK7C66G.cjs.map +1 -0
  26. package/dist/tsup/{chunk-JY73X7VU.js → chunk-FLODVLYW.js} +690 -88
  27. package/dist/tsup/chunk-FLODVLYW.js.map +1 -0
  28. package/dist/tsup/{chunk-OVJX4IFY.cjs → chunk-HTR4YLNT.cjs} +4 -4
  29. package/dist/tsup/{chunk-OVJX4IFY.cjs.map → chunk-HTR4YLNT.cjs.map} +1 -1
  30. package/dist/tsup/{chunk-LELRJK66.cjs → chunk-JALSAX7Z.cjs} +3 -3
  31. package/dist/tsup/{chunk-LELRJK66.cjs.map → chunk-JALSAX7Z.cjs.map} +1 -1
  32. package/dist/tsup/{chunk-JRCZDHXT.cjs → chunk-K5BA2LEO.cjs} +19 -52
  33. package/dist/tsup/chunk-K5BA2LEO.cjs.map +1 -0
  34. package/dist/tsup/{chunk-K34B3OVG.js → chunk-KIWH5H3K.js} +30 -9
  35. package/dist/tsup/chunk-KIWH5H3K.js.map +1 -0
  36. package/dist/tsup/{chunk-NW2J4SOL.cjs → chunk-LIXXFXVR.cjs} +5 -5
  37. package/dist/tsup/{chunk-NW2J4SOL.cjs.map → chunk-LIXXFXVR.cjs.map} +1 -1
  38. package/dist/tsup/{chunk-HR547GVH.cjs → chunk-M5C7YNI5.cjs} +8 -8
  39. package/dist/tsup/{chunk-HR547GVH.cjs.map → chunk-M5C7YNI5.cjs.map} +1 -1
  40. package/dist/tsup/{chunk-V3QNBJ7N.cjs → chunk-QAZLM4WT.cjs} +31 -10
  41. package/dist/tsup/chunk-QAZLM4WT.cjs.map +1 -0
  42. package/dist/tsup/{chunk-LDTT6WKJ.js → chunk-RTC2AZGB.js} +2 -2
  43. package/dist/tsup/{chunk-UXTP4EBU.js → chunk-ZI5QJMKO.js} +2 -2
  44. package/dist/tsup/client/mod.cjs +7 -7
  45. package/dist/tsup/client/mod.d.cts +3 -4
  46. package/dist/tsup/client/mod.d.ts +3 -4
  47. package/dist/tsup/client/mod.js +6 -6
  48. package/dist/tsup/common/log.cjs +3 -3
  49. package/dist/tsup/common/log.js +2 -2
  50. package/dist/tsup/common/websocket.cjs +4 -4
  51. package/dist/tsup/common/websocket.js +3 -3
  52. package/dist/tsup/{config-CvQUtDp9.d.ts → config-0Ta55UV0.d.ts} +10 -9
  53. package/dist/tsup/{config-C-a9vrke.d.cts → config-Ca8dN4cS.d.cts} +10 -9
  54. package/dist/tsup/{context-A7R0bsZL.d.ts → context-B_IWbWne.d.ts} +1 -1
  55. package/dist/tsup/{context-CA3r-pf2.d.cts → context-CUrQ9MHc.d.cts} +1 -1
  56. package/dist/tsup/inspector/mod.cjs +6 -6
  57. package/dist/tsup/inspector/mod.js +5 -5
  58. package/dist/tsup/mod.cjs +252 -207
  59. package/dist/tsup/mod.cjs.map +1 -1
  60. package/dist/tsup/mod.d.cts +4 -5
  61. package/dist/tsup/mod.d.ts +4 -5
  62. package/dist/tsup/mod.js +183 -138
  63. package/dist/tsup/mod.js.map +1 -1
  64. package/dist/tsup/test/mod.cjs +10 -10
  65. package/dist/tsup/test/mod.d.cts +2 -3
  66. package/dist/tsup/test/mod.d.ts +2 -3
  67. package/dist/tsup/test/mod.js +6 -6
  68. package/dist/tsup/utils-DVekpm4I.d.cts +103 -0
  69. package/dist/tsup/utils-DVekpm4I.d.ts +103 -0
  70. package/dist/tsup/utils.cjs +3 -3
  71. package/dist/tsup/utils.d.cts +1 -1
  72. package/dist/tsup/utils.d.ts +1 -1
  73. package/dist/tsup/utils.js +2 -2
  74. package/dist/tsup/workflow/mod.cjs +9 -9
  75. package/dist/tsup/workflow/mod.d.cts +4 -5
  76. package/dist/tsup/workflow/mod.d.ts +4 -5
  77. package/dist/tsup/workflow/mod.js +5 -5
  78. package/package.json +8 -8
  79. package/src/actor/errors.ts +53 -7
  80. package/src/client/actor-conn.ts +52 -29
  81. package/src/client/actor-handle.ts +57 -23
  82. package/src/client/errors.ts +2 -1
  83. package/src/client/raw-utils.ts +2 -4
  84. package/src/client/utils.ts +32 -3
  85. package/src/common/actor-router-consts.ts +4 -0
  86. package/src/common/bare/generated/client-protocol/v4.ts +599 -0
  87. package/src/common/client-protocol-versioned.ts +125 -18
  88. package/src/common/client-protocol-zod.ts +7 -0
  89. package/src/common/client-protocol.ts +1 -1
  90. package/src/common/database/native-database.test.ts +35 -0
  91. package/src/common/database/native-database.ts +8 -4
  92. package/src/common/router.ts +38 -8
  93. package/src/common/utils.ts +9 -52
  94. package/src/drivers/engine/actor-driver.ts +18 -17
  95. package/src/registry/config/index.ts +3 -5
  96. package/src/registry/index.ts +156 -19
  97. package/src/registry/napi-runtime.ts +44 -6
  98. package/src/registry/native.ts +5 -152
  99. package/src/registry/runtime.ts +16 -5
  100. package/src/registry/wasm-runtime.ts +22 -2
  101. package/dist/tsup/chunk-FTZIZ3JG.cjs.map +0 -1
  102. package/dist/tsup/chunk-JRCZDHXT.cjs.map +0 -1
  103. package/dist/tsup/chunk-JY73X7VU.js.map +0 -1
  104. package/dist/tsup/chunk-K34B3OVG.js.map +0 -1
  105. package/dist/tsup/chunk-N2DQSJIW.js.map +0 -1
  106. package/dist/tsup/chunk-V3QNBJ7N.cjs.map +0 -1
  107. package/dist/tsup/utils-fwx3o3K9.d.cts +0 -18
  108. package/dist/tsup/utils-fwx3o3K9.d.ts +0 -18
  109. /package/dist/tsup/{chunk-NATOT3ET.js.map → chunk-CAF6JDJE.js.map} +0 -0
  110. /package/dist/tsup/{chunk-PGYEMIOE.js.map → chunk-DEO7MMWQ.js.map} +0 -0
  111. /package/dist/tsup/{chunk-SULB574D.js.map → chunk-EMO6E3PJ.js.map} +0 -0
  112. /package/dist/tsup/{chunk-LDTT6WKJ.js.map → chunk-RTC2AZGB.js.map} +0 -0
  113. /package/dist/tsup/{chunk-UXTP4EBU.js.map → chunk-ZI5QJMKO.js.map} +0 -0
@@ -1,25 +1,25 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkHR547GVHcjs = require('../chunk-HR547GVH.cjs');
3
+ var _chunkM5C7YNI5cjs = require('../chunk-M5C7YNI5.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkFTZIZ3JGcjs = require('../chunk-FTZIZ3JG.cjs');
7
+ var _chunkENK7C66Gcjs = require('../chunk-ENK7C66G.cjs');
8
8
  require('../chunk-LD5YASJU.cjs');
9
- require('../chunk-NW2J4SOL.cjs');
9
+ require('../chunk-LIXXFXVR.cjs');
10
10
  require('../chunk-2NDZ7JCR.cjs');
11
- require('../chunk-LELRJK66.cjs');
12
- require('../chunk-JRCZDHXT.cjs');
13
- require('../chunk-V3QNBJ7N.cjs');
11
+ require('../chunk-JALSAX7Z.cjs');
12
+ require('../chunk-K5BA2LEO.cjs');
13
+ require('../chunk-QAZLM4WT.cjs');
14
14
 
15
15
  // src/test/mod.ts
16
16
  var _pretry = require('p-retry'); var _pretry2 = _interopRequireDefault(_pretry);
17
17
  async function waitForRegistryReady(registry) {
18
- const clientConfig = _chunkFTZIZ3JGcjs.convertRegistryConfigToClientConfig.call(void 0,
18
+ const clientConfig = _chunkENK7C66Gcjs.convertRegistryConfigToClientConfig.call(void 0,
19
19
  registry.parseConfig()
20
20
  );
21
21
  await _pretry2.default.call(void 0, async () => {
22
- await _chunkFTZIZ3JGcjs.getMetadata.call(void 0, clientConfig);
22
+ await _chunkENK7C66Gcjs.getMetadata.call(void 0, clientConfig);
23
23
  }, {
24
24
  retries: 20,
25
25
  minTimeout: 50,
@@ -31,8 +31,8 @@ async function setupTest(c, registry) {
31
31
  registry.config.noWelcome = true;
32
32
  registry.start();
33
33
  await waitForRegistryReady(registry);
34
- const client = _chunkHR547GVHcjs.createClient.call(void 0, {
35
- ..._chunkFTZIZ3JGcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
34
+ const client = _chunkM5C7YNI5cjs.createClient.call(void 0, {
35
+ ..._chunkENK7C66Gcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
36
36
  disableMetadataLookup: false
37
37
  });
38
38
  c.onTestFinished(async () => {
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { ap as Registry, V as Client } from '../config-C-a9vrke.cjs';
2
+ import { ap as Registry, V as Client } from '../config-Ca8dN4cS.cjs';
3
3
  import 'zod/v4';
4
4
  import '@rivetkit/virtual-websocket';
5
5
  import '../config-CxjGYf4K.cjs';
@@ -9,9 +9,8 @@ import 'pino';
9
9
  import '@standard-schema/spec';
10
10
  import 'hono';
11
11
  import '../utils.cjs';
12
- import '../utils-fwx3o3K9.cjs';
12
+ import '../utils-DVekpm4I.cjs';
13
13
  import 'hono/utils/http-status';
14
- import '../actor/errors.cjs';
15
14
 
16
15
  interface SetupTestResult<A extends Registry<any>> {
17
16
  client: Client<A>;
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { ap as Registry, V as Client } from '../config-CvQUtDp9.js';
2
+ import { ap as Registry, V as Client } from '../config-0Ta55UV0.js';
3
3
  import 'zod/v4';
4
4
  import '@rivetkit/virtual-websocket';
5
5
  import '../config-CxjGYf4K.js';
@@ -9,9 +9,8 @@ import 'pino';
9
9
  import '@standard-schema/spec';
10
10
  import 'hono';
11
11
  import '../utils.js';
12
- import '../utils-fwx3o3K9.js';
12
+ import '../utils-DVekpm4I.js';
13
13
  import 'hono/utils/http-status';
14
- import '../actor/errors.js';
15
14
 
16
15
  interface SetupTestResult<A extends Registry<any>> {
17
16
  client: Client<A>;
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createClient
3
- } from "../chunk-SULB574D.js";
3
+ } from "../chunk-EMO6E3PJ.js";
4
4
  import {
5
5
  convertRegistryConfigToClientConfig,
6
6
  getMetadata
7
- } from "../chunk-JY73X7VU.js";
7
+ } from "../chunk-FLODVLYW.js";
8
8
  import "../chunk-3YY5S6TV.js";
9
- import "../chunk-LDTT6WKJ.js";
9
+ import "../chunk-RTC2AZGB.js";
10
10
  import "../chunk-PCBNKI2J.js";
11
- import "../chunk-UXTP4EBU.js";
12
- import "../chunk-N2DQSJIW.js";
13
- import "../chunk-K34B3OVG.js";
11
+ import "../chunk-ZI5QJMKO.js";
12
+ import "../chunk-6S25NVAP.js";
13
+ import "../chunk-KIWH5H3K.js";
14
14
 
15
15
  // src/test/mod.ts
16
16
  import pRetry from "p-retry";
@@ -0,0 +1,103 @@
1
+ import { Next } from 'hono';
2
+ import { ContentfulStatusCode } from 'hono/utils/http-status';
3
+
4
+ declare const INTERNAL_ERROR_CODE = "internal_error";
5
+ declare const INTERNAL_ERROR_DESCRIPTION = "An internal error occurred";
6
+ type InternalErrorMetadata = Record<string, never>;
7
+ declare const USER_ERROR_CODE = "user_error";
8
+ declare const BRIDGE_RIVET_ERROR_PREFIX = "__RIVET_ERROR_JSON__:";
9
+ interface RivetErrorOptions extends ErrorOptions {
10
+ /** Error data can safely be serialized in a response to the client. */
11
+ public?: boolean;
12
+ /** Metadata associated with this error. */
13
+ metadata?: unknown;
14
+ /** Explicit HTTP status override for router responses. */
15
+ statusCode?: number;
16
+ /** Actor context associated with this error. */
17
+ actor?: ActorSpecifier;
18
+ }
19
+ /** Identifies the actor that was handling work when an error was produced. */
20
+ interface ActorSpecifier {
21
+ actorId: string;
22
+ generation: number;
23
+ key?: string;
24
+ }
25
+ interface RivetErrorLike {
26
+ __type?: "ActorError" | "RivetError";
27
+ group: string;
28
+ code: string;
29
+ message: string;
30
+ metadata?: unknown;
31
+ public?: boolean;
32
+ statusCode?: number;
33
+ actor?: ActorSpecifier;
34
+ }
35
+ interface BridgeRivetErrorPayload extends RivetErrorLike {
36
+ }
37
+ interface UserErrorOptions extends ErrorOptions {
38
+ /**
39
+ * Machine readable code for this error. Useful for catching different types of
40
+ * errors in try-catch.
41
+ */
42
+ code?: string;
43
+ /**
44
+ * Additional metadata related to the error. Useful for understanding context
45
+ * about the error.
46
+ */
47
+ metadata?: unknown;
48
+ }
49
+ declare function isRivetErrorLike(error: unknown): error is RivetError | DeconstructedError | RivetErrorLike;
50
+ declare class RivetError extends Error {
51
+ __type: "RivetError";
52
+ public: boolean;
53
+ metadata?: unknown;
54
+ statusCode: number;
55
+ actor?: ActorSpecifier;
56
+ readonly group: string;
57
+ readonly code: string;
58
+ static isRivetError(error: unknown): error is RivetError | DeconstructedError;
59
+ static isActorError(error: unknown): error is RivetError | DeconstructedError;
60
+ constructor(group: string, code: string, message: string, options?: RivetErrorOptions | unknown);
61
+ toString(): string;
62
+ }
63
+
64
+ declare class UserError extends RivetError {
65
+ constructor(message: string, options?: UserErrorOptions);
66
+ }
67
+ declare function toRivetError(error: unknown, fallback?: Partial<RivetErrorLike>): RivetError;
68
+ declare function encodeBridgeRivetError(error: RivetErrorLike): string;
69
+ declare function decodeBridgeRivetErrorPayload(value: string): BridgeRivetErrorPayload | undefined;
70
+ declare function decodeBridgeRivetError(value: string): RivetError | undefined;
71
+ declare function isRivetErrorCode(error: unknown, group: string, code: string): error is RivetError;
72
+ declare function internalError(message: string, options?: Partial<RivetErrorOptions> & {
73
+ group?: string;
74
+ code?: string;
75
+ }): RivetError;
76
+ declare function invalidEncoding(format?: string): RivetError;
77
+ declare function invalidRequest(error?: unknown): RivetError;
78
+ declare function actorNotFound(identifier?: string): RivetError;
79
+ declare function actorStopping(identifier?: string): RivetError;
80
+ interface ActorRestartingOptions {
81
+ phase?: "stopping" | "sleeping" | "waking" | "runner_shutdown";
82
+ retryAfterMs?: number;
83
+ }
84
+ declare function actorRestarting(opts?: ActorRestartingOptions): RivetError;
85
+ declare function forbiddenError(): RivetError;
86
+ declare function unsupportedFeature(feature: string): RivetError;
87
+
88
+ declare function assertUnreachable(x: never): never;
89
+ interface DeconstructedError {
90
+ __type: "ActorError";
91
+ statusCode: ContentfulStatusCode;
92
+ public: boolean;
93
+ group: string;
94
+ code: string;
95
+ message: string;
96
+ metadata?: unknown;
97
+ actor?: ActorSpecifier;
98
+ }
99
+ declare function stringifyError(error: unknown): string;
100
+ /** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */
101
+ declare function noopNext(): Next;
102
+
103
+ export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type UserErrorOptions as a, assertUnreachable as b, type ActorSpecifier as c, type BridgeRivetErrorPayload as d, INTERNAL_ERROR_DESCRIPTION as e, type InternalErrorMetadata as f, type RivetErrorLike as g, type RivetErrorOptions as h, USER_ERROR_CODE as i, actorNotFound as j, actorRestarting as k, actorStopping as l, decodeBridgeRivetError as m, noopNext as n, decodeBridgeRivetErrorPayload as o, encodeBridgeRivetError as p, forbiddenError as q, internalError as r, stringifyError as s, invalidEncoding as t, invalidRequest as u, isRivetErrorCode as v, isRivetErrorLike as w, toRivetError as x, unsupportedFeature as y };
@@ -0,0 +1,103 @@
1
+ import { Next } from 'hono';
2
+ import { ContentfulStatusCode } from 'hono/utils/http-status';
3
+
4
+ declare const INTERNAL_ERROR_CODE = "internal_error";
5
+ declare const INTERNAL_ERROR_DESCRIPTION = "An internal error occurred";
6
+ type InternalErrorMetadata = Record<string, never>;
7
+ declare const USER_ERROR_CODE = "user_error";
8
+ declare const BRIDGE_RIVET_ERROR_PREFIX = "__RIVET_ERROR_JSON__:";
9
+ interface RivetErrorOptions extends ErrorOptions {
10
+ /** Error data can safely be serialized in a response to the client. */
11
+ public?: boolean;
12
+ /** Metadata associated with this error. */
13
+ metadata?: unknown;
14
+ /** Explicit HTTP status override for router responses. */
15
+ statusCode?: number;
16
+ /** Actor context associated with this error. */
17
+ actor?: ActorSpecifier;
18
+ }
19
+ /** Identifies the actor that was handling work when an error was produced. */
20
+ interface ActorSpecifier {
21
+ actorId: string;
22
+ generation: number;
23
+ key?: string;
24
+ }
25
+ interface RivetErrorLike {
26
+ __type?: "ActorError" | "RivetError";
27
+ group: string;
28
+ code: string;
29
+ message: string;
30
+ metadata?: unknown;
31
+ public?: boolean;
32
+ statusCode?: number;
33
+ actor?: ActorSpecifier;
34
+ }
35
+ interface BridgeRivetErrorPayload extends RivetErrorLike {
36
+ }
37
+ interface UserErrorOptions extends ErrorOptions {
38
+ /**
39
+ * Machine readable code for this error. Useful for catching different types of
40
+ * errors in try-catch.
41
+ */
42
+ code?: string;
43
+ /**
44
+ * Additional metadata related to the error. Useful for understanding context
45
+ * about the error.
46
+ */
47
+ metadata?: unknown;
48
+ }
49
+ declare function isRivetErrorLike(error: unknown): error is RivetError | DeconstructedError | RivetErrorLike;
50
+ declare class RivetError extends Error {
51
+ __type: "RivetError";
52
+ public: boolean;
53
+ metadata?: unknown;
54
+ statusCode: number;
55
+ actor?: ActorSpecifier;
56
+ readonly group: string;
57
+ readonly code: string;
58
+ static isRivetError(error: unknown): error is RivetError | DeconstructedError;
59
+ static isActorError(error: unknown): error is RivetError | DeconstructedError;
60
+ constructor(group: string, code: string, message: string, options?: RivetErrorOptions | unknown);
61
+ toString(): string;
62
+ }
63
+
64
+ declare class UserError extends RivetError {
65
+ constructor(message: string, options?: UserErrorOptions);
66
+ }
67
+ declare function toRivetError(error: unknown, fallback?: Partial<RivetErrorLike>): RivetError;
68
+ declare function encodeBridgeRivetError(error: RivetErrorLike): string;
69
+ declare function decodeBridgeRivetErrorPayload(value: string): BridgeRivetErrorPayload | undefined;
70
+ declare function decodeBridgeRivetError(value: string): RivetError | undefined;
71
+ declare function isRivetErrorCode(error: unknown, group: string, code: string): error is RivetError;
72
+ declare function internalError(message: string, options?: Partial<RivetErrorOptions> & {
73
+ group?: string;
74
+ code?: string;
75
+ }): RivetError;
76
+ declare function invalidEncoding(format?: string): RivetError;
77
+ declare function invalidRequest(error?: unknown): RivetError;
78
+ declare function actorNotFound(identifier?: string): RivetError;
79
+ declare function actorStopping(identifier?: string): RivetError;
80
+ interface ActorRestartingOptions {
81
+ phase?: "stopping" | "sleeping" | "waking" | "runner_shutdown";
82
+ retryAfterMs?: number;
83
+ }
84
+ declare function actorRestarting(opts?: ActorRestartingOptions): RivetError;
85
+ declare function forbiddenError(): RivetError;
86
+ declare function unsupportedFeature(feature: string): RivetError;
87
+
88
+ declare function assertUnreachable(x: never): never;
89
+ interface DeconstructedError {
90
+ __type: "ActorError";
91
+ statusCode: ContentfulStatusCode;
92
+ public: boolean;
93
+ group: string;
94
+ code: string;
95
+ message: string;
96
+ metadata?: unknown;
97
+ actor?: ActorSpecifier;
98
+ }
99
+ declare function stringifyError(error: unknown): string;
100
+ /** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */
101
+ declare function noopNext(): Next;
102
+
103
+ export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type UserErrorOptions as a, assertUnreachable as b, type ActorSpecifier as c, type BridgeRivetErrorPayload as d, INTERNAL_ERROR_DESCRIPTION as e, type InternalErrorMetadata as f, type RivetErrorLike as g, type RivetErrorOptions as h, USER_ERROR_CODE as i, actorNotFound as j, actorRestarting as k, actorStopping as l, decodeBridgeRivetError as m, noopNext as n, decodeBridgeRivetErrorPayload as o, encodeBridgeRivetError as p, forbiddenError as q, internalError as r, stringifyError as s, invalidEncoding as t, invalidRequest as u, isRivetErrorCode as v, isRivetErrorLike as w, toRivetError as x, unsupportedFeature as y };
@@ -17,8 +17,8 @@
17
17
 
18
18
 
19
19
 
20
- var _chunkJRCZDHXTcjs = require('./chunk-JRCZDHXT.cjs');
21
- require('./chunk-V3QNBJ7N.cjs');
20
+ var _chunkK5BA2LEOcjs = require('./chunk-K5BA2LEO.cjs');
21
+ require('./chunk-QAZLM4WT.cjs');
22
22
 
23
23
 
24
24
 
@@ -38,5 +38,5 @@ require('./chunk-V3QNBJ7N.cjs');
38
38
 
39
39
 
40
40
 
41
- exports.EXTRA_ERROR_LOG = _chunkJRCZDHXTcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkJRCZDHXTcjs.SinglePromiseQueue; exports.VERSION = _chunkJRCZDHXTcjs.VERSION; exports.arrayBuffersEqual = _chunkJRCZDHXTcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkJRCZDHXTcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkJRCZDHXTcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkJRCZDHXTcjs.combineUrlPath; exports.dbg = _chunkJRCZDHXTcjs.dbg; exports.detectRuntime = _chunkJRCZDHXTcjs.detectRuntime; exports.getEnvUniversal = _chunkJRCZDHXTcjs.getEnvUniversal; exports.httpUserAgent = _chunkJRCZDHXTcjs.httpUserAgent; exports.interval = _chunkJRCZDHXTcjs.interval; exports.joinSignals = _chunkJRCZDHXTcjs.joinSignals; exports.promiseWithResolvers = _chunkJRCZDHXTcjs.promiseWithResolvers; exports.setLongTimeout = _chunkJRCZDHXTcjs.setLongTimeout; exports.sleep = _chunkJRCZDHXTcjs.sleep; exports.stringifyError = _chunkJRCZDHXTcjs.stringifyError; exports.toUint8Array = _chunkJRCZDHXTcjs.toUint8Array;
41
+ exports.EXTRA_ERROR_LOG = _chunkK5BA2LEOcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkK5BA2LEOcjs.SinglePromiseQueue; exports.VERSION = _chunkK5BA2LEOcjs.VERSION; exports.arrayBuffersEqual = _chunkK5BA2LEOcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkK5BA2LEOcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkK5BA2LEOcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkK5BA2LEOcjs.combineUrlPath; exports.dbg = _chunkK5BA2LEOcjs.dbg; exports.detectRuntime = _chunkK5BA2LEOcjs.detectRuntime; exports.getEnvUniversal = _chunkK5BA2LEOcjs.getEnvUniversal; exports.httpUserAgent = _chunkK5BA2LEOcjs.httpUserAgent; exports.interval = _chunkK5BA2LEOcjs.interval; exports.joinSignals = _chunkK5BA2LEOcjs.joinSignals; exports.promiseWithResolvers = _chunkK5BA2LEOcjs.promiseWithResolvers; exports.setLongTimeout = _chunkK5BA2LEOcjs.setLongTimeout; exports.sleep = _chunkK5BA2LEOcjs.sleep; exports.stringifyError = _chunkK5BA2LEOcjs.stringifyError; exports.toUint8Array = _chunkK5BA2LEOcjs.toUint8Array;
42
42
  //# sourceMappingURL=utils.cjs.map
@@ -1,4 +1,4 @@
1
- export { a as assertUnreachable, s as stringifyError } from './utils-fwx3o3K9.cjs';
1
+ export { b as assertUnreachable, s as stringifyError } from './utils-DVekpm4I.cjs';
2
2
  import { Context, Handler } from 'hono';
3
3
  import 'hono/utils/http-status';
4
4
 
@@ -1,4 +1,4 @@
1
- export { a as assertUnreachable, s as stringifyError } from './utils-fwx3o3K9.js';
1
+ export { b as assertUnreachable, s as stringifyError } from './utils-DVekpm4I.js';
2
2
  import { Context, Handler } from 'hono';
3
3
  import 'hono/utils/http-status';
4
4
 
@@ -17,8 +17,8 @@ import {
17
17
  sleep,
18
18
  stringifyError,
19
19
  toUint8Array
20
- } from "./chunk-N2DQSJIW.js";
21
- import "./chunk-K34B3OVG.js";
20
+ } from "./chunk-6S25NVAP.js";
21
+ import "./chunk-KIWH5H3K.js";
22
22
  export {
23
23
  EXTRA_ERROR_LOG,
24
24
  SinglePromiseQueue,
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
2
2
 
3
- var _chunk2GANBXVPcjs = require('../chunk-2GANBXVP.cjs');
3
+ var _chunk2G64KSZQcjs = require('../chunk-2G64KSZQ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkWQ4HNA4Wcjs = require('../chunk-WQ4HNA4W.cjs');
8
- require('../chunk-OVJX4IFY.cjs');
8
+ require('../chunk-HTR4YLNT.cjs');
9
9
 
10
10
 
11
11
 
12
12
  var _chunkLD5YASJUcjs = require('../chunk-LD5YASJU.cjs');
13
- require('../chunk-NW2J4SOL.cjs');
13
+ require('../chunk-LIXXFXVR.cjs');
14
14
 
15
15
 
16
- var _chunkJRCZDHXTcjs = require('../chunk-JRCZDHXT.cjs');
16
+ var _chunkK5BA2LEOcjs = require('../chunk-K5BA2LEO.cjs');
17
17
 
18
18
 
19
- var _chunkV3QNBJ7Ncjs = require('../chunk-V3QNBJ7N.cjs');
19
+ var _chunkQAZLM4WTcjs = require('../chunk-QAZLM4WT.cjs');
20
20
 
21
21
  // src/workflow/mod.ts
22
22
 
@@ -595,7 +595,7 @@ function shouldRethrowWorkflowError(error) {
595
595
  return true;
596
596
  }
597
597
  function workflowReplayInFlightError() {
598
- return new (0, _chunkV3QNBJ7Ncjs.RivetError)(
598
+ return new (0, _chunkQAZLM4WTcjs.RivetError)(
599
599
  "actor",
600
600
  "workflow_in_flight",
601
601
  "Workflow replay is unavailable while the workflow is currently in flight.",
@@ -614,7 +614,7 @@ function workflow(fn, options = {}) {
614
614
  function getWorkflowInspector(actorId) {
615
615
  let workflowInspector = workflowInspectors.get(actorId);
616
616
  if (!workflowInspector) {
617
- workflowInspector = _chunk2GANBXVPcjs.createWorkflowInspectorAdapter.call(void 0, );
617
+ workflowInspector = _chunk2G64KSZQcjs.createWorkflowInspectorAdapter.call(void 0, );
618
618
  workflowInspectors.set(actorId, workflowInspector);
619
619
  }
620
620
  return workflowInspector;
@@ -680,13 +680,13 @@ function workflow(fn, options = {}) {
680
680
  if (shouldRethrowWorkflowError(error)) {
681
681
  runCtx.log.error({
682
682
  msg: "workflow run failed",
683
- error: _chunkJRCZDHXTcjs.stringifyError.call(void 0, error)
683
+ error: _chunkK5BA2LEOcjs.stringifyError.call(void 0, error)
684
684
  });
685
685
  throw error;
686
686
  }
687
687
  runCtx.log.warn({
688
688
  msg: "workflow failed and will sleep until woken",
689
- error: _chunkJRCZDHXTcjs.stringifyError.call(void 0, error)
689
+ error: _chunkK5BA2LEOcjs.stringifyError.call(void 0, error)
690
690
  });
691
691
  } finally {
692
692
  runCtx.abortSignal.removeEventListener("abort", onAbort);
@@ -1,9 +1,9 @@
1
- import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-C-a9vrke.cjs';
1
+ import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-Ca8dN4cS.cjs';
2
2
  import { A as AnyDatabaseProvider } from '../config-CxjGYf4K.cjs';
3
3
  import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
4
4
  export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
5
- import { A as ActorWorkflowContext } from '../context-CA3r-pf2.cjs';
6
- export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-CA3r-pf2.cjs';
5
+ import { A as ActorWorkflowContext } from '../context-CUrQ9MHc.cjs';
6
+ export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-CUrQ9MHc.cjs';
7
7
  import 'zod/v4';
8
8
  import '@rivetkit/virtual-websocket';
9
9
  import '@rivetkit/rivetkit-wasm';
@@ -12,9 +12,8 @@ import 'pino';
12
12
  import '@standard-schema/spec';
13
13
  import 'hono';
14
14
  import '../utils.cjs';
15
- import '../utils-fwx3o3K9.cjs';
15
+ import '../utils-DVekpm4I.cjs';
16
16
  import 'hono/utils/http-status';
17
- import '../actor/errors.cjs';
18
17
 
19
18
  interface WorkflowOptions<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
20
19
  onError?: (ctx: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, event: WorkflowErrorEvent) => void | Promise<void>;
@@ -1,9 +1,9 @@
1
- import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-CvQUtDp9.js';
1
+ import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-0Ta55UV0.js';
2
2
  import { A as AnyDatabaseProvider } from '../config-CxjGYf4K.js';
3
3
  import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
4
4
  export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
5
- import { A as ActorWorkflowContext } from '../context-A7R0bsZL.js';
6
- export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-A7R0bsZL.js';
5
+ import { A as ActorWorkflowContext } from '../context-B_IWbWne.js';
6
+ export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-B_IWbWne.js';
7
7
  import 'zod/v4';
8
8
  import '@rivetkit/virtual-websocket';
9
9
  import '@rivetkit/rivetkit-wasm';
@@ -12,9 +12,8 @@ import 'pino';
12
12
  import '@standard-schema/spec';
13
13
  import 'hono';
14
14
  import '../utils.js';
15
- import '../utils-fwx3o3K9.js';
15
+ import '../utils-DVekpm4I.js';
16
16
  import 'hono/utils/http-status';
17
- import '../actor/errors.js';
18
17
 
19
18
  interface WorkflowOptions<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
20
19
  onError?: (ctx: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, event: WorkflowErrorEvent) => void | Promise<void>;
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-NATOT3ET.js";
3
+ } from "../chunk-CAF6JDJE.js";
4
4
  import {
5
5
  ACTOR_CONTEXT_INTERNAL_SYMBOL,
6
6
  RUN_FUNCTION_CONFIG_SYMBOL
7
7
  } from "../chunk-T6YVRM4K.js";
8
- import "../chunk-PGYEMIOE.js";
8
+ import "../chunk-DEO7MMWQ.js";
9
9
  import {
10
10
  makeWorkflowKey,
11
11
  workflowStoragePrefix
12
12
  } from "../chunk-3YY5S6TV.js";
13
- import "../chunk-LDTT6WKJ.js";
13
+ import "../chunk-RTC2AZGB.js";
14
14
  import {
15
15
  stringifyError
16
- } from "../chunk-N2DQSJIW.js";
16
+ } from "../chunk-6S25NVAP.js";
17
17
  import {
18
18
  RivetError
19
- } from "../chunk-K34B3OVG.js";
19
+ } from "../chunk-KIWH5H3K.js";
20
20
 
21
21
  // src/workflow/mod.ts
22
22
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivetkit",
3
- "version": "2.3.0-rc.5",
3
+ "version": "2.3.0-rc.6",
4
4
  "description": "Lightweight libraries for building stateful actors on edge platforms",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -173,13 +173,13 @@
173
173
  "@hono/node-ws": "^1.1.1",
174
174
  "@hono/zod-openapi": "^1.1.5",
175
175
  "@rivetkit/bare-ts": "^0.6.2",
176
- "@rivetkit/engine-cli": "2.3.0-rc.5",
177
- "@rivetkit/engine-envoy-protocol": "2.3.0-rc.5",
178
- "@rivetkit/rivetkit-napi": "2.3.0-rc.5",
179
- "@rivetkit/rivetkit-wasm": "2.3.0-rc.5",
180
- "@rivetkit/traces": "2.3.0-rc.5",
181
- "@rivetkit/virtual-websocket": "2.3.0-rc.5",
182
- "@rivetkit/workflow-engine": "2.3.0-rc.5",
176
+ "@rivetkit/engine-cli": "2.3.0-rc.6",
177
+ "@rivetkit/engine-envoy-protocol": "2.3.0-rc.6",
178
+ "@rivetkit/rivetkit-napi": "2.3.0-rc.6",
179
+ "@rivetkit/rivetkit-wasm": "2.3.0-rc.6",
180
+ "@rivetkit/traces": "2.3.0-rc.6",
181
+ "@rivetkit/virtual-websocket": "2.3.0-rc.6",
182
+ "@rivetkit/workflow-engine": "2.3.0-rc.6",
183
183
  "cbor-x": "^1.6.0",
184
184
  "drizzle-orm": "^0.44.2",
185
185
  "get-port": "^7.1.0",