rivetkit 2.3.12-rc.1 → 2.3.12-rc.3

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 (114) hide show
  1. package/dist/browser/client.d.ts +4 -0
  2. package/dist/browser/client.js +116 -60
  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 +2 -2
  7. package/dist/tsup/actor/errors.d.cts +1 -1
  8. package/dist/tsup/actor/errors.d.ts +1 -1
  9. package/dist/tsup/actor/errors.js +1 -1
  10. package/dist/tsup/agent-os/index.cjs +2 -2
  11. package/dist/tsup/agent-os/index.cjs.map +1 -1
  12. package/dist/tsup/agent-os/index.d.cts +4 -0
  13. package/dist/tsup/agent-os/index.d.ts +4 -0
  14. package/dist/tsup/agent-os/index.js +2 -2
  15. package/dist/tsup/agent-os/index.js.map +1 -1
  16. package/dist/tsup/{chunk-MT33DKU4.js → chunk-34Q4YVCX.js} +2 -2
  17. package/dist/tsup/{chunk-T4MKKCRF.cjs → chunk-4ESGNS3Z.cjs} +15 -10
  18. package/dist/tsup/chunk-4ESGNS3Z.cjs.map +1 -0
  19. package/dist/tsup/{chunk-VJ4KLJO5.cjs → chunk-EQKSWDIH.cjs} +3 -3
  20. package/dist/tsup/{chunk-VJ4KLJO5.cjs.map → chunk-EQKSWDIH.cjs.map} +1 -1
  21. package/dist/tsup/{chunk-BZX4LYYD.cjs → chunk-IJWTHKH6.cjs} +3 -3
  22. package/dist/tsup/{chunk-BZX4LYYD.cjs.map → chunk-IJWTHKH6.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-ZZ3WBRPD.js → chunk-IXBD7BXC.js} +15 -4
  24. package/dist/tsup/chunk-IXBD7BXC.js.map +1 -0
  25. package/dist/tsup/{chunk-ZTPFJOBX.js → chunk-NHI5L7C7.js} +3 -3
  26. package/dist/tsup/{chunk-CMZBDX6Z.cjs → chunk-O6H3BUN4.cjs} +3 -3
  27. package/dist/tsup/{chunk-CMZBDX6Z.cjs.map → chunk-O6H3BUN4.cjs.map} +1 -1
  28. package/dist/tsup/{chunk-HVHDZDM2.js → chunk-OLGQYFUW.js} +8 -3
  29. package/dist/tsup/chunk-OLGQYFUW.js.map +1 -0
  30. package/dist/tsup/{chunk-BEPAAID2.cjs → chunk-OX6WVQE6.cjs} +10 -10
  31. package/dist/tsup/{chunk-BEPAAID2.cjs.map → chunk-OX6WVQE6.cjs.map} +1 -1
  32. package/dist/tsup/{chunk-KRPA4UOE.js → chunk-PSXMESQJ.js} +2 -2
  33. package/dist/tsup/{chunk-6ETWXXAZ.cjs → chunk-PZBWSCQR.cjs} +262 -213
  34. package/dist/tsup/chunk-PZBWSCQR.cjs.map +1 -0
  35. package/dist/tsup/{chunk-2D5PNV5A.cjs → chunk-QLOBB27M.cjs} +4 -4
  36. package/dist/tsup/{chunk-2D5PNV5A.cjs.map → chunk-QLOBB27M.cjs.map} +1 -1
  37. package/dist/tsup/{chunk-4FC7TVS6.cjs → chunk-SPJORZMM.cjs} +15 -4
  38. package/dist/tsup/chunk-SPJORZMM.cjs.map +1 -0
  39. package/dist/tsup/{chunk-DIHAXOB7.cjs → chunk-UBB32UOG.cjs} +7 -7
  40. package/dist/tsup/{chunk-DIHAXOB7.cjs.map → chunk-UBB32UOG.cjs.map} +1 -1
  41. package/dist/tsup/{chunk-OZWVDFCA.js → chunk-UN5JNDBT.js} +4 -4
  42. package/dist/tsup/{chunk-5UYNV4W6.js → chunk-WVFTFWJL.js} +2 -2
  43. package/dist/tsup/{chunk-JHHAMABO.js → chunk-XI4MEUUI.js} +2 -2
  44. package/dist/tsup/{chunk-A5BZEQOG.js → chunk-YYIDQBBM.js} +110 -61
  45. package/dist/tsup/chunk-YYIDQBBM.js.map +1 -0
  46. package/dist/tsup/client/mod.cjs +6 -6
  47. package/dist/tsup/client/mod.d.cts +5 -5
  48. package/dist/tsup/client/mod.d.ts +5 -5
  49. package/dist/tsup/client/mod.js +5 -5
  50. package/dist/tsup/common/log.cjs +3 -3
  51. package/dist/tsup/common/log.js +2 -2
  52. package/dist/tsup/common/websocket.cjs +4 -4
  53. package/dist/tsup/common/websocket.js +3 -3
  54. package/dist/tsup/{config-DTGoWdkG.d.cts → config-BXSV17G7.d.cts} +2 -2
  55. package/dist/tsup/{config-C4OSv0QP.d.ts → config-Bi1r6gI7.d.ts} +2 -2
  56. package/dist/tsup/{context-C6cvDNyk.d.cts → context-4fJemY0D.d.cts} +1 -1
  57. package/dist/tsup/{context-CMygeBxS.d.ts → context-D4sNYboo.d.ts} +1 -1
  58. package/dist/tsup/db/drizzle.cjs +3 -3
  59. package/dist/tsup/db/drizzle.js +2 -2
  60. package/dist/tsup/db/mod.cjs +4 -4
  61. package/dist/tsup/db/mod.js +3 -3
  62. package/dist/tsup/dynamic/mod.d.cts +3 -3
  63. package/dist/tsup/dynamic/mod.d.ts +3 -3
  64. package/dist/tsup/inspector/mod.cjs +6 -6
  65. package/dist/tsup/inspector/mod.js +5 -5
  66. package/dist/tsup/inspector/workflow.cjs +5 -5
  67. package/dist/tsup/inspector/workflow.js +4 -4
  68. package/dist/tsup/inspector-tab/mod.d.cts +4 -4
  69. package/dist/tsup/inspector-tab/mod.d.ts +4 -4
  70. package/dist/tsup/mod.cjs +111 -110
  71. package/dist/tsup/mod.cjs.map +1 -1
  72. package/dist/tsup/mod.d.cts +5 -5
  73. package/dist/tsup/mod.d.ts +5 -5
  74. package/dist/tsup/mod.js +8 -7
  75. package/dist/tsup/mod.js.map +1 -1
  76. package/dist/tsup/test/mod.cjs +7 -7
  77. package/dist/tsup/test/mod.d.cts +3 -3
  78. package/dist/tsup/test/mod.d.ts +3 -3
  79. package/dist/tsup/test/mod.js +5 -5
  80. package/dist/tsup/{utils-DQDCphrl.d.cts → utils-Bbz-3411.d.cts} +1 -1
  81. package/dist/tsup/{utils-CV0akuDD.d.ts → utils-BqdWVlzm.d.ts} +1 -1
  82. package/dist/tsup/{utils-CqDnC_PS.d.cts → utils-vvJQyygr.d.cts} +5 -0
  83. package/dist/tsup/{utils-CqDnC_PS.d.ts → utils-vvJQyygr.d.ts} +5 -0
  84. package/dist/tsup/utils.cjs +3 -3
  85. package/dist/tsup/utils.d.cts +2 -2
  86. package/dist/tsup/utils.d.ts +2 -2
  87. package/dist/tsup/utils.js +2 -2
  88. package/dist/tsup/workflow/mod.cjs +11 -11
  89. package/dist/tsup/workflow/mod.d.cts +5 -5
  90. package/dist/tsup/workflow/mod.d.ts +5 -5
  91. package/dist/tsup/workflow/mod.js +5 -5
  92. package/package.json +8 -8
  93. package/src/actor/errors.ts +29 -2
  94. package/src/client/actor-conn.ts +5 -4
  95. package/src/client/actor-handle.ts +47 -19
  96. package/src/client/actor-query.ts +8 -1
  97. package/src/client/errors.ts +2 -1
  98. package/src/client/raw-utils.ts +3 -5
  99. package/src/client/utils.ts +2 -0
  100. package/src/common/utils.ts +6 -0
  101. package/src/engine-client/mod.ts +51 -20
  102. package/src/registry/native.ts +1 -0
  103. package/dist/tsup/chunk-4FC7TVS6.cjs.map +0 -1
  104. package/dist/tsup/chunk-6ETWXXAZ.cjs.map +0 -1
  105. package/dist/tsup/chunk-A5BZEQOG.js.map +0 -1
  106. package/dist/tsup/chunk-HVHDZDM2.js.map +0 -1
  107. package/dist/tsup/chunk-T4MKKCRF.cjs.map +0 -1
  108. package/dist/tsup/chunk-ZZ3WBRPD.js.map +0 -1
  109. /package/dist/tsup/{chunk-MT33DKU4.js.map → chunk-34Q4YVCX.js.map} +0 -0
  110. /package/dist/tsup/{chunk-ZTPFJOBX.js.map → chunk-NHI5L7C7.js.map} +0 -0
  111. /package/dist/tsup/{chunk-KRPA4UOE.js.map → chunk-PSXMESQJ.js.map} +0 -0
  112. /package/dist/tsup/{chunk-OZWVDFCA.js.map → chunk-UN5JNDBT.js.map} +0 -0
  113. /package/dist/tsup/{chunk-5UYNV4W6.js.map → chunk-WVFTFWJL.js.map} +0 -0
  114. /package/dist/tsup/{chunk-JHHAMABO.js.map → chunk-XI4MEUUI.js.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkDIHAXOB7cjs = require('../chunk-DIHAXOB7.cjs');
3
+ var _chunkUBB32UOGcjs = require('../chunk-UBB32UOG.cjs');
4
4
 
5
5
 
6
- var _chunk6ETWXXAZcjs = require('../chunk-6ETWXXAZ.cjs');
6
+ var _chunkPZBWSCQRcjs = require('../chunk-PZBWSCQR.cjs');
7
7
  require('../chunk-MYWZCDML.cjs');
8
8
  require('../chunk-KVFIONKQ.cjs');
9
- require('../chunk-VJ4KLJO5.cjs');
10
- require('../chunk-T4MKKCRF.cjs');
11
- require('../chunk-4FC7TVS6.cjs');
9
+ require('../chunk-EQKSWDIH.cjs');
10
+ require('../chunk-4ESGNS3Z.cjs');
11
+ require('../chunk-SPJORZMM.cjs');
12
12
 
13
13
  // src/test/ready.ts
14
14
  var _pretry = require('p-retry'); var _pretry2 = _interopRequireDefault(_pretry);
@@ -36,8 +36,8 @@ async function setupTest(c, registry) {
36
36
  registry.config.noWelcome = true;
37
37
  registry.start();
38
38
  await waitForRegistryReady(registry);
39
- const client = _chunkDIHAXOB7cjs.createClient.call(void 0, {
40
- ..._chunk6ETWXXAZcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
39
+ const client = _chunkUBB32UOGcjs.createClient.call(void 0, {
40
+ ..._chunkPZBWSCQRcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
41
41
  disableMetadataLookup: false
42
42
  });
43
43
  c.onTestFinished(async () => {
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { aF as Registry, a3 as Client } from '../config-DTGoWdkG.cjs';
2
+ import { aF as Registry, a3 as Client } from '../config-BXSV17G7.cjs';
3
3
  import 'zod/v4';
4
4
  import '../config-ey2I2zz5.cjs';
5
5
  import '@rivetkit/rivetkit-wasm';
@@ -8,9 +8,9 @@ import 'pino';
8
8
  import '@rivetkit/virtual-websocket';
9
9
  import '../inspector/workflow.cjs';
10
10
  import '@standard-schema/spec';
11
- import '../utils-DQDCphrl.cjs';
11
+ import '../utils-Bbz-3411.cjs';
12
12
  import 'hono';
13
- import '../utils-CqDnC_PS.cjs';
13
+ import '../utils-vvJQyygr.cjs';
14
14
  import 'hono/utils/http-status';
15
15
 
16
16
  interface SetupTestResult<A extends Registry<any>> {
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { aF as Registry, a3 as Client } from '../config-C4OSv0QP.js';
2
+ import { aF as Registry, a3 as Client } from '../config-Bi1r6gI7.js';
3
3
  import 'zod/v4';
4
4
  import '../config-ey2I2zz5.js';
5
5
  import '@rivetkit/rivetkit-wasm';
@@ -8,9 +8,9 @@ import 'pino';
8
8
  import '@rivetkit/virtual-websocket';
9
9
  import '../inspector/workflow.js';
10
10
  import '@standard-schema/spec';
11
- import '../utils-CV0akuDD.js';
11
+ import '../utils-BqdWVlzm.js';
12
12
  import 'hono';
13
- import '../utils-CqDnC_PS.js';
13
+ import '../utils-vvJQyygr.js';
14
14
  import 'hono/utils/http-status';
15
15
 
16
16
  interface SetupTestResult<A extends Registry<any>> {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createClient
3
- } from "../chunk-ZTPFJOBX.js";
3
+ } from "../chunk-NHI5L7C7.js";
4
4
  import {
5
5
  convertRegistryConfigToClientConfig
6
- } from "../chunk-A5BZEQOG.js";
6
+ } from "../chunk-YYIDQBBM.js";
7
7
  import "../chunk-JI6GZ2C2.js";
8
8
  import "../chunk-JTHHCZCZ.js";
9
- import "../chunk-JHHAMABO.js";
10
- import "../chunk-HVHDZDM2.js";
11
- import "../chunk-ZZ3WBRPD.js";
9
+ import "../chunk-XI4MEUUI.js";
10
+ import "../chunk-OLGQYFUW.js";
11
+ import "../chunk-IXBD7BXC.js";
12
12
 
13
13
  // src/test/ready.ts
14
14
  import pRetry from "p-retry";
@@ -1,5 +1,5 @@
1
1
  import { Context, Handler } from 'hono';
2
- import './utils-CqDnC_PS.cjs';
2
+ import './utils-vvJQyygr.cjs';
3
3
  import { z } from 'zod/v4';
4
4
 
5
5
  declare const EncodingSchema: z.ZodEnum<{
@@ -1,5 +1,5 @@
1
1
  import { Context, Handler } from 'hono';
2
- import './utils-CqDnC_PS.js';
2
+ import './utils-vvJQyygr.js';
3
3
  import { z } from 'zod/v4';
4
4
 
5
5
  declare const EncodingSchema: z.ZodEnum<{
@@ -11,6 +11,8 @@ interface RivetErrorOptions extends ErrorOptions {
11
11
  public?: boolean;
12
12
  /** Metadata associated with this error. */
13
13
  metadata?: unknown;
14
+ /** Request identifier used to correlate this error with engine logs. */
15
+ rayId?: string;
14
16
  /** Explicit HTTP status override for router responses. */
15
17
  statusCode?: number;
16
18
  /** Actor context associated with this error. */
@@ -28,6 +30,7 @@ interface RivetErrorLike {
28
30
  code: string;
29
31
  message: string;
30
32
  metadata?: unknown;
33
+ rayId?: string;
31
34
  public?: boolean;
32
35
  statusCode?: number;
33
36
  actor?: ActorSpecifier;
@@ -52,6 +55,7 @@ declare class RivetError extends Error {
52
55
  __type: "RivetError";
53
56
  public: boolean;
54
57
  metadata?: unknown;
58
+ readonly rayId?: string;
55
59
  statusCode: number;
56
60
  actor?: ActorSpecifier;
57
61
  readonly group: string;
@@ -95,6 +99,7 @@ interface DeconstructedError {
95
99
  code: string;
96
100
  message: string;
97
101
  metadata?: unknown;
102
+ rayId?: string;
98
103
  actor?: ActorSpecifier;
99
104
  }
100
105
  declare function stringifyError(error: unknown): string;
@@ -11,6 +11,8 @@ interface RivetErrorOptions extends ErrorOptions {
11
11
  public?: boolean;
12
12
  /** Metadata associated with this error. */
13
13
  metadata?: unknown;
14
+ /** Request identifier used to correlate this error with engine logs. */
15
+ rayId?: string;
14
16
  /** Explicit HTTP status override for router responses. */
15
17
  statusCode?: number;
16
18
  /** Actor context associated with this error. */
@@ -28,6 +30,7 @@ interface RivetErrorLike {
28
30
  code: string;
29
31
  message: string;
30
32
  metadata?: unknown;
33
+ rayId?: string;
31
34
  public?: boolean;
32
35
  statusCode?: number;
33
36
  actor?: ActorSpecifier;
@@ -52,6 +55,7 @@ declare class RivetError extends Error {
52
55
  __type: "RivetError";
53
56
  public: boolean;
54
57
  metadata?: unknown;
58
+ readonly rayId?: string;
55
59
  statusCode: number;
56
60
  actor?: ActorSpecifier;
57
61
  readonly group: string;
@@ -95,6 +99,7 @@ interface DeconstructedError {
95
99
  code: string;
96
100
  message: string;
97
101
  metadata?: unknown;
102
+ rayId?: string;
98
103
  actor?: ActorSpecifier;
99
104
  }
100
105
  declare function stringifyError(error: unknown): string;
@@ -19,8 +19,8 @@
19
19
 
20
20
 
21
21
 
22
- var _chunkT4MKKCRFcjs = require('./chunk-T4MKKCRF.cjs');
23
- require('./chunk-4FC7TVS6.cjs');
22
+ var _chunk4ESGNS3Zcjs = require('./chunk-4ESGNS3Z.cjs');
23
+ require('./chunk-SPJORZMM.cjs');
24
24
 
25
25
 
26
26
 
@@ -42,5 +42,5 @@ require('./chunk-4FC7TVS6.cjs');
42
42
 
43
43
 
44
44
 
45
- exports.EXTRA_ERROR_LOG = _chunkT4MKKCRFcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkT4MKKCRFcjs.SinglePromiseQueue; exports.VERSION = _chunkT4MKKCRFcjs.VERSION; exports.arrayBuffersEqual = _chunkT4MKKCRFcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkT4MKKCRFcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkT4MKKCRFcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkT4MKKCRFcjs.combineUrlPath; exports.dbg = _chunkT4MKKCRFcjs.dbg; exports.detectRuntime = _chunkT4MKKCRFcjs.detectRuntime; exports.getEnvUniversal = _chunkT4MKKCRFcjs.getEnvUniversal; exports.httpUserAgent = _chunkT4MKKCRFcjs.httpUserAgent; exports.interval = _chunkT4MKKCRFcjs.interval; exports.joinSignals = _chunkT4MKKCRFcjs.joinSignals; exports.jsonParseCompat = _chunkT4MKKCRFcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkT4MKKCRFcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkT4MKKCRFcjs.promiseWithResolvers; exports.setLongTimeout = _chunkT4MKKCRFcjs.setLongTimeout; exports.sleep = _chunkT4MKKCRFcjs.sleep; exports.stringifyError = _chunkT4MKKCRFcjs.stringifyError; exports.toUint8Array = _chunkT4MKKCRFcjs.toUint8Array;
45
+ exports.EXTRA_ERROR_LOG = _chunk4ESGNS3Zcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunk4ESGNS3Zcjs.SinglePromiseQueue; exports.VERSION = _chunk4ESGNS3Zcjs.VERSION; exports.arrayBuffersEqual = _chunk4ESGNS3Zcjs.arrayBuffersEqual; exports.assertUnreachable = _chunk4ESGNS3Zcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunk4ESGNS3Zcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunk4ESGNS3Zcjs.combineUrlPath; exports.dbg = _chunk4ESGNS3Zcjs.dbg; exports.detectRuntime = _chunk4ESGNS3Zcjs.detectRuntime; exports.getEnvUniversal = _chunk4ESGNS3Zcjs.getEnvUniversal; exports.httpUserAgent = _chunk4ESGNS3Zcjs.httpUserAgent; exports.interval = _chunk4ESGNS3Zcjs.interval; exports.joinSignals = _chunk4ESGNS3Zcjs.joinSignals; exports.jsonParseCompat = _chunk4ESGNS3Zcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunk4ESGNS3Zcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunk4ESGNS3Zcjs.promiseWithResolvers; exports.setLongTimeout = _chunk4ESGNS3Zcjs.setLongTimeout; exports.sleep = _chunk4ESGNS3Zcjs.sleep; exports.stringifyError = _chunk4ESGNS3Zcjs.stringifyError; exports.toUint8Array = _chunk4ESGNS3Zcjs.toUint8Array;
46
46
  //# sourceMappingURL=utils.cjs.map
@@ -1,5 +1,5 @@
1
1
  import 'hono';
2
- export { d as assertUnreachable, s as stringifyError } from './utils-CqDnC_PS.cjs';
3
- export { D as DeepMutable, a as DeepReadonly, b as EXTRA_ERROR_LOG, G as GetUpgradeWebSocket, L as LongTimeoutHandle, R as Runtime, S as SinglePromiseQueue, U as UpgradeWebSocket, V as VERSION, c as arrayBuffersEqual, d as bufferToArrayBuffer, e as combineUrlPath, f as dbg, g as detectRuntime, h as getEnvUniversal, i as httpUserAgent, j as interval, k as joinSignals, l as jsonParseCompat, m as jsonStringifyCompat, p as promiseWithResolvers, s as setLongTimeout, n as sleep, t as toUint8Array } from './utils-DQDCphrl.cjs';
2
+ export { d as assertUnreachable, s as stringifyError } from './utils-vvJQyygr.cjs';
3
+ export { D as DeepMutable, a as DeepReadonly, b as EXTRA_ERROR_LOG, G as GetUpgradeWebSocket, L as LongTimeoutHandle, R as Runtime, S as SinglePromiseQueue, U as UpgradeWebSocket, V as VERSION, c as arrayBuffersEqual, d as bufferToArrayBuffer, e as combineUrlPath, f as dbg, g as detectRuntime, h as getEnvUniversal, i as httpUserAgent, j as interval, k as joinSignals, l as jsonParseCompat, m as jsonStringifyCompat, p as promiseWithResolvers, s as setLongTimeout, n as sleep, t as toUint8Array } from './utils-Bbz-3411.cjs';
4
4
  import 'hono/utils/http-status';
5
5
  import 'zod/v4';
@@ -1,5 +1,5 @@
1
1
  import 'hono';
2
- export { d as assertUnreachable, s as stringifyError } from './utils-CqDnC_PS.js';
3
- export { D as DeepMutable, a as DeepReadonly, b as EXTRA_ERROR_LOG, G as GetUpgradeWebSocket, L as LongTimeoutHandle, R as Runtime, S as SinglePromiseQueue, U as UpgradeWebSocket, V as VERSION, c as arrayBuffersEqual, d as bufferToArrayBuffer, e as combineUrlPath, f as dbg, g as detectRuntime, h as getEnvUniversal, i as httpUserAgent, j as interval, k as joinSignals, l as jsonParseCompat, m as jsonStringifyCompat, p as promiseWithResolvers, s as setLongTimeout, n as sleep, t as toUint8Array } from './utils-CV0akuDD.js';
2
+ export { d as assertUnreachable, s as stringifyError } from './utils-vvJQyygr.js';
3
+ export { D as DeepMutable, a as DeepReadonly, b as EXTRA_ERROR_LOG, G as GetUpgradeWebSocket, L as LongTimeoutHandle, R as Runtime, S as SinglePromiseQueue, U as UpgradeWebSocket, V as VERSION, c as arrayBuffersEqual, d as bufferToArrayBuffer, e as combineUrlPath, f as dbg, g as detectRuntime, h as getEnvUniversal, i as httpUserAgent, j as interval, k as joinSignals, l as jsonParseCompat, m as jsonStringifyCompat, p as promiseWithResolvers, s as setLongTimeout, n as sleep, t as toUint8Array } from './utils-BqdWVlzm.js';
4
4
  import 'hono/utils/http-status';
5
5
  import 'zod/v4';
@@ -19,8 +19,8 @@ import {
19
19
  sleep,
20
20
  stringifyError,
21
21
  toUint8Array
22
- } from "./chunk-HVHDZDM2.js";
23
- import "./chunk-ZZ3WBRPD.js";
22
+ } from "./chunk-OLGQYFUW.js";
23
+ import "./chunk-IXBD7BXC.js";
24
24
  export {
25
25
  EXTRA_ERROR_LOG,
26
26
  SinglePromiseQueue,
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } var _class; var _class2;
2
2
 
3
- var _chunkBEPAAID2cjs = require('../chunk-BEPAAID2.cjs');
4
- require('../chunk-BZX4LYYD.cjs');
5
- require('../chunk-2D5PNV5A.cjs');
3
+ var _chunkOX6WVQE6cjs = require('../chunk-OX6WVQE6.cjs');
4
+ require('../chunk-IJWTHKH6.cjs');
5
+ require('../chunk-QLOBB27M.cjs');
6
6
 
7
7
 
8
8
 
@@ -13,11 +13,11 @@ var _chunk4KGXFC6Mcjs = require('../chunk-4KGXFC6M.cjs');
13
13
  var _chunkMYWZCDMLcjs = require('../chunk-MYWZCDML.cjs');
14
14
 
15
15
 
16
- var _chunkT4MKKCRFcjs = require('../chunk-T4MKKCRF.cjs');
16
+ var _chunk4ESGNS3Zcjs = require('../chunk-4ESGNS3Z.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunk4FC7TVS6cjs = require('../chunk-4FC7TVS6.cjs');
20
+ var _chunkSPJORZMMcjs = require('../chunk-SPJORZMM.cjs');
21
21
 
22
22
  // src/workflow/mod.ts
23
23
 
@@ -705,7 +705,7 @@ function shouldRethrowWorkflowError(error) {
705
705
  return true;
706
706
  }
707
707
  function workflowReplayInFlightError() {
708
- return new (0, _chunk4FC7TVS6cjs.RivetError)(
708
+ return new (0, _chunkSPJORZMMcjs.RivetError)(
709
709
  "actor",
710
710
  "workflow_in_flight",
711
711
  "Workflow replay is unavailable while the workflow is currently in flight.",
@@ -719,7 +719,7 @@ function isWorkflowReplayBlockedByRunningEntry(error) {
719
719
  return error instanceof Error && error.message === "Cannot replay a workflow while a step is currently running";
720
720
  }
721
721
  function isRunHandlerUnavailable(error) {
722
- return error instanceof _chunk4FC7TVS6cjs.RivetError && error.group === "actor" && error.code === "run_handler_unavailable";
722
+ return error instanceof _chunkSPJORZMMcjs.RivetError && error.group === "actor" && error.code === "run_handler_unavailable";
723
723
  }
724
724
  function workflow(fn, options = {}) {
725
725
  const onError = options.onError;
@@ -727,7 +727,7 @@ function workflow(fn, options = {}) {
727
727
  function getWorkflowInspector(actorId) {
728
728
  let workflowInspector = workflowInspectors.get(actorId);
729
729
  if (!workflowInspector) {
730
- workflowInspector = _chunkBEPAAID2cjs.createWorkflowInspectorAdapter.call(void 0, );
730
+ workflowInspector = _chunkOX6WVQE6cjs.createWorkflowInspectorAdapter.call(void 0, );
731
731
  workflowInspectors.set(actorId, workflowInspector);
732
732
  }
733
733
  return workflowInspector;
@@ -794,19 +794,19 @@ function workflow(fn, options = {}) {
794
794
  try {
795
795
  await handle.result;
796
796
  } catch (error) {
797
- if (runCtx.abortSignal.aborted || _chunk4FC7TVS6cjs.isActorAbortedError.call(void 0, error)) {
797
+ if (runCtx.abortSignal.aborted || _chunkSPJORZMMcjs.isActorAbortedError.call(void 0, error)) {
798
798
  return;
799
799
  }
800
800
  if (shouldRethrowWorkflowError(error)) {
801
801
  runCtx.log.error({
802
802
  msg: "workflow run failed",
803
- error: _chunkT4MKKCRFcjs.stringifyError.call(void 0, error)
803
+ error: _chunk4ESGNS3Zcjs.stringifyError.call(void 0, error)
804
804
  });
805
805
  throw error;
806
806
  }
807
807
  runCtx.log.warn({
808
808
  msg: "workflow failed and will sleep until woken",
809
- error: _chunkT4MKKCRFcjs.stringifyError.call(void 0, error)
809
+ error: _chunk4ESGNS3Zcjs.stringifyError.call(void 0, error)
810
810
  });
811
811
  } finally {
812
812
  runCtx.abortSignal.removeEventListener("abort", onAbort);
@@ -1,9 +1,9 @@
1
1
  import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
2
2
  export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
3
- import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-DTGoWdkG.cjs';
3
+ import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-BXSV17G7.cjs';
4
4
  import { A as AnyDatabaseProvider } from '../config-ey2I2zz5.cjs';
5
- import { d as WorkflowContext } from '../context-C6cvDNyk.cjs';
6
- export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-C6cvDNyk.cjs';
5
+ import { d as WorkflowContext } from '../context-4fJemY0D.cjs';
6
+ export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-4fJemY0D.cjs';
7
7
  import 'zod/v4';
8
8
  import '@rivetkit/rivetkit-wasm';
9
9
  import 'zod';
@@ -11,9 +11,9 @@ import 'pino';
11
11
  import '@rivetkit/virtual-websocket';
12
12
  import '../inspector/workflow.cjs';
13
13
  import '@standard-schema/spec';
14
- import '../utils-DQDCphrl.cjs';
14
+ import '../utils-Bbz-3411.cjs';
15
15
  import 'hono';
16
- import '../utils-CqDnC_PS.cjs';
16
+ import '../utils-vvJQyygr.cjs';
17
17
  import 'hono/utils/http-status';
18
18
 
19
19
  interface WorkflowOptions<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
@@ -1,9 +1,9 @@
1
1
  import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
2
2
  export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
3
- import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-C4OSv0QP.js';
3
+ import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-Bi1r6gI7.js';
4
4
  import { A as AnyDatabaseProvider } from '../config-ey2I2zz5.js';
5
- import { d as WorkflowContext } from '../context-CMygeBxS.js';
6
- export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-CMygeBxS.js';
5
+ import { d as WorkflowContext } from '../context-D4sNYboo.js';
6
+ export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-D4sNYboo.js';
7
7
  import 'zod/v4';
8
8
  import '@rivetkit/rivetkit-wasm';
9
9
  import 'zod';
@@ -11,9 +11,9 @@ import 'pino';
11
11
  import '@rivetkit/virtual-websocket';
12
12
  import '../inspector/workflow.js';
13
13
  import '@standard-schema/spec';
14
- import '../utils-CV0akuDD.js';
14
+ import '../utils-BqdWVlzm.js';
15
15
  import 'hono';
16
- import '../utils-CqDnC_PS.js';
16
+ import '../utils-vvJQyygr.js';
17
17
  import 'hono/utils/http-status';
18
18
 
19
19
  interface WorkflowOptions<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-OZWVDFCA.js";
4
- import "../chunk-MT33DKU4.js";
5
- import "../chunk-5UYNV4W6.js";
3
+ } from "../chunk-UN5JNDBT.js";
4
+ import "../chunk-34Q4YVCX.js";
5
+ import "../chunk-WVFTFWJL.js";
6
6
  import {
7
7
  ACTOR_CONTEXT_INTERNAL_SYMBOL,
8
8
  defineRunHandler
@@ -13,11 +13,11 @@ import {
13
13
  } from "../chunk-JI6GZ2C2.js";
14
14
  import {
15
15
  stringifyError
16
- } from "../chunk-HVHDZDM2.js";
16
+ } from "../chunk-OLGQYFUW.js";
17
17
  import {
18
18
  RivetError,
19
19
  isActorAbortedError
20
- } from "../chunk-ZZ3WBRPD.js";
20
+ } from "../chunk-IXBD7BXC.js";
21
21
 
22
22
  // src/workflow/mod.ts
23
23
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivetkit",
3
- "version": "2.3.12-rc.1",
3
+ "version": "2.3.12-rc.3",
4
4
  "description": "Lightweight libraries for building stateful actors on edge platforms",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -211,14 +211,14 @@
211
211
  "@hono/zod-openapi": "^1.1.5",
212
212
  "@rivet-dev/agent-os-core": "^0.1.1",
213
213
  "@rivetkit/bare-ts": "^0.6.2",
214
- "@rivetkit/engine-cli": "2.3.12-rc.1",
215
- "@rivetkit/engine-envoy-protocol": "2.3.12-rc.1",
214
+ "@rivetkit/engine-cli": "2.3.12-rc.3",
215
+ "@rivetkit/engine-envoy-protocol": "2.3.12-rc.3",
216
216
  "@rivetkit/on-change": "6.0.1",
217
- "@rivetkit/rivetkit-napi": "2.3.12-rc.1",
218
- "@rivetkit/rivetkit-wasm": "2.3.12-rc.1",
219
- "@rivetkit/traces": "2.3.12-rc.1",
220
- "@rivetkit/virtual-websocket": "2.3.12-rc.1",
221
- "@rivetkit/workflow-engine": "2.3.12-rc.1",
217
+ "@rivetkit/rivetkit-napi": "2.3.12-rc.3",
218
+ "@rivetkit/rivetkit-wasm": "2.3.12-rc.3",
219
+ "@rivetkit/traces": "2.3.12-rc.3",
220
+ "@rivetkit/virtual-websocket": "2.3.12-rc.3",
221
+ "@rivetkit/workflow-engine": "2.3.12-rc.3",
222
222
  "cbor-x": "^1.6.0",
223
223
  "drizzle-orm": "^0.44.2",
224
224
  "hono": "^4.7.0",
@@ -12,6 +12,8 @@ export interface RivetErrorOptions extends ErrorOptions {
12
12
  public?: boolean;
13
13
  /** Metadata associated with this error. */
14
14
  metadata?: unknown;
15
+ /** Request identifier used to correlate this error with engine logs. */
16
+ rayId?: string;
15
17
  /** Explicit HTTP status override for router responses. */
16
18
  statusCode?: number;
17
19
  /** Actor context associated with this error. */
@@ -31,6 +33,7 @@ export interface RivetErrorLike {
31
33
  code: string;
32
34
  message: string;
33
35
  metadata?: unknown;
36
+ rayId?: string;
34
37
  public?: boolean;
35
38
  statusCode?: number;
36
39
  actor?: ActorSpecifier;
@@ -38,6 +41,14 @@ export interface RivetErrorLike {
38
41
 
39
42
  export interface BridgeRivetErrorPayload extends RivetErrorLike {}
40
43
 
44
+ /**
45
+ * Shape as it arrives from the native bridge, where an absent ray ID serializes
46
+ * to null. Normalized to a BridgeRivetErrorPayload before validation.
47
+ */
48
+ interface NativeBridgeErrorPayload extends Omit<BridgeRivetErrorPayload, "rayId"> {
49
+ rayId?: string | null;
50
+ }
51
+
41
52
  export interface UserErrorOptions extends ErrorOptions {
42
53
  /**
43
54
  * Machine readable code for this error. Useful for catching different types of
@@ -59,6 +70,7 @@ function looksLikeRivetErrorOptions(
59
70
  value !== null &&
60
71
  ("public" in value ||
61
72
  "metadata" in value ||
73
+ "rayId" in value ||
62
74
  "statusCode" in value ||
63
75
  "actor" in value ||
64
76
  "cause" in value)
@@ -94,6 +106,9 @@ export function isRivetErrorLike(
94
106
  typeof error.code === "string" &&
95
107
  "message" in error &&
96
108
  typeof error.message === "string" &&
109
+ (!("rayId" in error) ||
110
+ error.rayId === undefined ||
111
+ typeof error.rayId === "string") &&
97
112
  (!("__type" in error) || isTypedErrorTag(error.__type))
98
113
  );
99
114
  }
@@ -128,6 +143,7 @@ export class RivetError extends Error {
128
143
 
129
144
  public public: boolean;
130
145
  public metadata?: unknown;
146
+ public readonly rayId?: string;
131
147
  public statusCode: number;
132
148
  public actor?: ActorSpecifier;
133
149
  public readonly group: string;
@@ -161,6 +177,7 @@ export class RivetError extends Error {
161
177
  this.code = code;
162
178
  this.public = normalized.public ?? false;
163
179
  this.metadata = normalized.metadata;
180
+ this.rayId = normalized.rayId ?? undefined;
164
181
  this.statusCode = normalized.statusCode ?? (this.public ? 400 : 500);
165
182
  this.actor = normalized.actor;
166
183
  }
@@ -205,6 +222,7 @@ export function toRivetError(
205
222
  public: error.public,
206
223
  statusCode: error.statusCode,
207
224
  metadata: error.metadata,
225
+ rayId: error.rayId,
208
226
  actor: error.actor,
209
227
  cause: error instanceof Error ? error.cause : undefined,
210
228
  });
@@ -218,6 +236,7 @@ export function toRivetError(
218
236
  public: fallback?.public,
219
237
  statusCode: fallback?.statusCode,
220
238
  metadata: fallback?.metadata,
239
+ rayId: fallback?.rayId,
221
240
  actor: fallback?.actor,
222
241
  cause: error instanceof Error ? error : undefined,
223
242
  },
@@ -230,6 +249,7 @@ export function encodeBridgeRivetError(error: RivetErrorLike): string {
230
249
  code: error.code,
231
250
  message: error.message,
232
251
  metadata: error.metadata,
252
+ rayId: error.rayId,
233
253
  public: error.public,
234
254
  statusCode: error.statusCode,
235
255
  actor: error.actor,
@@ -244,9 +264,14 @@ export function decodeBridgeRivetErrorPayload(
244
264
  }
245
265
 
246
266
  try {
247
- const payload = JSON.parse(
267
+ const raw = JSON.parse(
248
268
  value.slice(BRIDGE_RIVET_ERROR_PREFIX.length),
249
- ) as BridgeRivetErrorPayload;
269
+ ) as NativeBridgeErrorPayload;
270
+ // Coerce the native bridge's null ray ID to undefined before validation.
271
+ const payload: BridgeRivetErrorPayload = {
272
+ ...raw,
273
+ rayId: raw.rayId ?? undefined,
274
+ };
250
275
  if (!isRivetErrorLike(payload)) {
251
276
  return undefined;
252
277
  }
@@ -272,6 +297,7 @@ export function decodeBridgeRivetError(value: string): RivetError | undefined {
272
297
 
273
298
  return new RivetError(payload.group, payload.code, payload.message, {
274
299
  metadata: payload.metadata,
300
+ rayId: payload.rayId,
275
301
  public: payload.public,
276
302
  statusCode: payload.statusCode,
277
303
  actor: payload.actor ?? undefined,
@@ -303,6 +329,7 @@ export function internalError(
303
329
  public: options?.public,
304
330
  statusCode: options?.statusCode,
305
331
  metadata: options?.metadata,
332
+ rayId: options?.rayId,
306
333
  actor: options?.actor,
307
334
  cause: options?.cause,
308
335
  },
@@ -874,7 +874,7 @@ export class ActorConnRaw {
874
874
  const parsed = parseWebSocketCloseReason(reason);
875
875
 
876
876
  if (parsed) {
877
- const { group, code } = parsed;
877
+ const { group, code, rayId } = parsed;
878
878
 
879
879
  if (this.#shouldReconnectForStaleActor(group, code)) {
880
880
  this.#clearResolvedActorIdentity();
@@ -883,7 +883,7 @@ export class ActorConnRaw {
883
883
  group,
884
884
  code,
885
885
  `Connection closed: ${reason}`,
886
- undefined,
886
+ { rayId },
887
887
  ),
888
888
  );
889
889
  return;
@@ -897,6 +897,7 @@ export class ActorConnRaw {
897
897
  this.#actorId,
898
898
  this.#actorResolutionState,
899
899
  this.#driver,
900
+ rayId,
900
901
  );
901
902
  if (schedulingError) {
902
903
  error = schedulingError;
@@ -905,7 +906,7 @@ export class ActorConnRaw {
905
906
  group,
906
907
  code,
907
908
  `Connection closed: ${reason}`,
908
- undefined,
909
+ { rayId },
909
910
  );
910
911
  }
911
912
  } else {
@@ -913,7 +914,7 @@ export class ActorConnRaw {
913
914
  group,
914
915
  code,
915
916
  `Connection closed: ${reason}`,
916
- undefined,
917
+ { rayId },
917
918
  );
918
919
  }
919
920