rivetkit 2.3.18-rc.4 → 2.3.19

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 (136) hide show
  1. package/dist/browser/client.d.ts +723 -616
  2. package/dist/browser/client.js +184 -28
  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/actor/errors.cjs +6 -2
  7. package/dist/tsup/actor/errors.cjs.map +1 -1
  8. package/dist/tsup/actor/errors.d.cts +1 -1
  9. package/dist/tsup/actor/errors.d.ts +1 -1
  10. package/dist/tsup/actor/errors.js +5 -1
  11. package/dist/tsup/agent-os/index.cjs +3 -1
  12. package/dist/tsup/agent-os/index.cjs.map +1 -1
  13. package/dist/tsup/agent-os/index.d.cts +110 -3
  14. package/dist/tsup/agent-os/index.d.ts +110 -3
  15. package/dist/tsup/agent-os/index.js +3 -1
  16. package/dist/tsup/agent-os/index.js.map +1 -1
  17. package/dist/tsup/{chunk-ENDOWQTM.js → chunk-464WE4RF.js} +2 -2
  18. package/dist/tsup/{chunk-KKG2CTSI.js → chunk-4SC2NSAV.js} +2 -2
  19. package/dist/tsup/{chunk-R2WRP6VV.cjs → chunk-7A5EIXJJ.cjs} +7 -7
  20. package/dist/tsup/{chunk-R2WRP6VV.cjs.map → chunk-7A5EIXJJ.cjs.map} +1 -1
  21. package/dist/tsup/{chunk-GUVDWB2O.cjs → chunk-7BRRGBRY.cjs} +10 -10
  22. package/dist/tsup/{chunk-GUVDWB2O.cjs.map → chunk-7BRRGBRY.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-KVPU65TI.js → chunk-7HTST3NX.js} +3 -3
  24. package/dist/tsup/{chunk-MS6C3B2I.js → chunk-BKX7UDTA.js} +185 -28
  25. package/dist/tsup/chunk-BKX7UDTA.js.map +1 -0
  26. package/dist/tsup/{chunk-FL2FDUSZ.js → chunk-DK3L22R6.js} +4 -4
  27. package/dist/tsup/{chunk-CAL23WOC.js → chunk-DN6MD3KK.js} +7 -7
  28. package/dist/tsup/chunk-DN6MD3KK.js.map +1 -0
  29. package/dist/tsup/{chunk-6W5VGLFT.js → chunk-EB77NZL4.js} +1 -1
  30. package/dist/tsup/chunk-EB77NZL4.js.map +1 -0
  31. package/dist/tsup/{chunk-4KGXFC6M.cjs → chunk-EO5UOXXY.cjs} +1 -1
  32. package/dist/tsup/chunk-EO5UOXXY.cjs.map +1 -0
  33. package/dist/tsup/{chunk-QFLG6UB4.cjs → chunk-G4U5L6AX.cjs} +3 -3
  34. package/dist/tsup/{chunk-QFLG6UB4.cjs.map → chunk-G4U5L6AX.cjs.map} +1 -1
  35. package/dist/tsup/{chunk-TGGF6SZN.cjs → chunk-IJUXBWH4.cjs} +351 -194
  36. package/dist/tsup/chunk-IJUXBWH4.cjs.map +1 -0
  37. package/dist/tsup/{chunk-2JSYYH6P.cjs → chunk-JX2ITWAV.cjs} +13 -2
  38. package/dist/tsup/chunk-JX2ITWAV.cjs.map +1 -0
  39. package/dist/tsup/{chunk-N3DJTMSZ.cjs → chunk-OGPFN6BT.cjs} +3 -3
  40. package/dist/tsup/{chunk-N3DJTMSZ.cjs.map → chunk-OGPFN6BT.cjs.map} +1 -1
  41. package/dist/tsup/{chunk-OUQUIBVW.js → chunk-P2OFXH4G.js} +12 -1
  42. package/dist/tsup/chunk-P2OFXH4G.js.map +1 -0
  43. package/dist/tsup/{chunk-F3IP3SGO.cjs → chunk-PPEIPCW4.cjs} +4 -4
  44. package/dist/tsup/{chunk-F3IP3SGO.cjs.map → chunk-PPEIPCW4.cjs.map} +1 -1
  45. package/dist/tsup/{chunk-7E2W2YSM.cjs → chunk-RJC5O2SD.cjs} +13 -13
  46. package/dist/tsup/chunk-RJC5O2SD.cjs.map +1 -0
  47. package/dist/tsup/{chunk-YQD6RRVP.js → chunk-WME6KOXW.js} +2 -2
  48. package/dist/tsup/{chunk-PLAJJOTE.js → chunk-X7RMJQGY.js} +2 -2
  49. package/dist/tsup/{chunk-4OMHYVOQ.cjs → chunk-Z4RAXFSD.cjs} +3 -3
  50. package/dist/tsup/{chunk-4OMHYVOQ.cjs.map → chunk-Z4RAXFSD.cjs.map} +1 -1
  51. package/dist/tsup/client/mod.cjs +6 -6
  52. package/dist/tsup/client/mod.d.cts +5 -5
  53. package/dist/tsup/client/mod.d.ts +5 -5
  54. package/dist/tsup/client/mod.js +5 -5
  55. package/dist/tsup/common/log.cjs +3 -3
  56. package/dist/tsup/common/log.js +2 -2
  57. package/dist/tsup/common/websocket.cjs +4 -4
  58. package/dist/tsup/common/websocket.js +3 -3
  59. package/dist/tsup/{config-gvHwMas-.d.cts → config-8n2AOhXK.d.cts} +114 -10
  60. package/dist/tsup/{config-Ug5M2MOr.d.ts → config-DEm0yIVV.d.ts} +114 -10
  61. package/dist/tsup/{context-DererUCI.d.ts → context-DGg2-IOm.d.ts} +1 -1
  62. package/dist/tsup/{context-BSCBvbfM.d.cts → context-DwjOVvlE.d.cts} +1 -1
  63. package/dist/tsup/db/drizzle.cjs +3 -3
  64. package/dist/tsup/db/drizzle.js +2 -2
  65. package/dist/tsup/db/mod.cjs +4 -4
  66. package/dist/tsup/db/mod.js +3 -3
  67. package/dist/tsup/dynamic/mod.cjs +2 -2
  68. package/dist/tsup/dynamic/mod.d.cts +3 -3
  69. package/dist/tsup/dynamic/mod.d.ts +3 -3
  70. package/dist/tsup/dynamic/mod.js +1 -1
  71. package/dist/tsup/inspector/mod.cjs +6 -6
  72. package/dist/tsup/inspector/mod.js +5 -5
  73. package/dist/tsup/inspector/workflow.cjs +5 -5
  74. package/dist/tsup/inspector/workflow.js +4 -4
  75. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  76. package/dist/tsup/inspector-tab/mod.d.cts +4 -4
  77. package/dist/tsup/inspector-tab/mod.d.ts +4 -4
  78. package/dist/tsup/inspector-tab/mod.js +1 -1
  79. package/dist/tsup/mod.cjs +492 -319
  80. package/dist/tsup/mod.cjs.map +1 -1
  81. package/dist/tsup/mod.d.cts +5 -5
  82. package/dist/tsup/mod.d.ts +5 -5
  83. package/dist/tsup/mod.js +367 -194
  84. package/dist/tsup/mod.js.map +1 -1
  85. package/dist/tsup/test/mod.cjs +7 -7
  86. package/dist/tsup/test/mod.d.cts +3 -3
  87. package/dist/tsup/test/mod.d.ts +3 -3
  88. package/dist/tsup/test/mod.js +5 -5
  89. package/dist/tsup/{utils-Bbz-3411.d.cts → utils-CNFeS-Dk.d.cts} +1 -1
  90. package/dist/tsup/{utils-vvJQyygr.d.ts → utils-DsoDinPz.d.cts} +9 -1
  91. package/dist/tsup/{utils-vvJQyygr.d.cts → utils-DsoDinPz.d.ts} +9 -1
  92. package/dist/tsup/{utils-BqdWVlzm.d.ts → utils-OQHBjfcM.d.ts} +1 -1
  93. package/dist/tsup/utils.cjs +3 -3
  94. package/dist/tsup/utils.d.cts +2 -2
  95. package/dist/tsup/utils.d.ts +2 -2
  96. package/dist/tsup/utils.js +2 -2
  97. package/dist/tsup/workflow/mod.cjs +33 -27
  98. package/dist/tsup/workflow/mod.cjs.map +1 -1
  99. package/dist/tsup/workflow/mod.d.cts +5 -5
  100. package/dist/tsup/workflow/mod.d.ts +5 -5
  101. package/dist/tsup/workflow/mod.js +25 -19
  102. package/dist/tsup/workflow/mod.js.map +1 -1
  103. package/package.json +10 -8
  104. package/src/actor/config.ts +38 -0
  105. package/src/actor/errors.ts +31 -0
  106. package/src/client/actor-conn.ts +7 -0
  107. package/src/client/actor-handle.ts +57 -17
  108. package/src/client/client.ts +26 -6
  109. package/src/client/outbound-telemetry.ts +66 -0
  110. package/src/client/queue.ts +3 -0
  111. package/src/client/raw-utils.ts +3 -0
  112. package/src/common/actor-router-consts.ts +3 -0
  113. package/src/common/actor-telemetry-context.ts +19 -0
  114. package/src/common/otel-context.ts +99 -0
  115. package/src/common/utils.ts +1 -19
  116. package/src/engine-client/actor-http-client.ts +15 -0
  117. package/src/registry/index.ts +6 -0
  118. package/src/registry/napi-runtime.ts +155 -35
  119. package/src/registry/native.ts +277 -191
  120. package/src/registry/runtime.ts +66 -0
  121. package/src/registry/wasm-runtime.ts +40 -0
  122. package/src/workflow/driver.ts +20 -12
  123. package/dist/tsup/chunk-2JSYYH6P.cjs.map +0 -1
  124. package/dist/tsup/chunk-4KGXFC6M.cjs.map +0 -1
  125. package/dist/tsup/chunk-6W5VGLFT.js.map +0 -1
  126. package/dist/tsup/chunk-7E2W2YSM.cjs.map +0 -1
  127. package/dist/tsup/chunk-CAL23WOC.js.map +0 -1
  128. package/dist/tsup/chunk-MS6C3B2I.js.map +0 -1
  129. package/dist/tsup/chunk-OUQUIBVW.js.map +0 -1
  130. package/dist/tsup/chunk-TGGF6SZN.cjs.map +0 -1
  131. /package/dist/tsup/{chunk-ENDOWQTM.js.map → chunk-464WE4RF.js.map} +0 -0
  132. /package/dist/tsup/{chunk-KKG2CTSI.js.map → chunk-4SC2NSAV.js.map} +0 -0
  133. /package/dist/tsup/{chunk-KVPU65TI.js.map → chunk-7HTST3NX.js.map} +0 -0
  134. /package/dist/tsup/{chunk-FL2FDUSZ.js.map → chunk-DK3L22R6.js.map} +0 -0
  135. /package/dist/tsup/{chunk-YQD6RRVP.js.map → chunk-WME6KOXW.js.map} +0 -0
  136. /package/dist/tsup/{chunk-PLAJJOTE.js.map → chunk-X7RMJQGY.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 _chunkR2WRP6VVcjs = require('../chunk-R2WRP6VV.cjs');
3
+ var _chunk7A5EIXJJcjs = require('../chunk-7A5EIXJJ.cjs');
4
4
 
5
5
 
6
- var _chunkTGGF6SZNcjs = require('../chunk-TGGF6SZN.cjs');
6
+ var _chunkIJUXBWH4cjs = require('../chunk-IJUXBWH4.cjs');
7
7
  require('../chunk-MYWZCDML.cjs');
8
- require('../chunk-N3DJTMSZ.cjs');
8
+ require('../chunk-OGPFN6BT.cjs');
9
9
  require('../chunk-KVFIONKQ.cjs');
10
- require('../chunk-7E2W2YSM.cjs');
11
- require('../chunk-2JSYYH6P.cjs');
10
+ require('../chunk-RJC5O2SD.cjs');
11
+ require('../chunk-JX2ITWAV.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 = _chunkR2WRP6VVcjs.createClient.call(void 0, {
40
- ..._chunkTGGF6SZNcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
39
+ const client = _chunk7A5EIXJJcjs.createClient.call(void 0, {
40
+ ..._chunkIJUXBWH4cjs.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-gvHwMas-.cjs';
2
+ import { aF as Registry, a3 as Client } from '../config-8n2AOhXK.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-Bbz-3411.cjs';
11
+ import '../utils-CNFeS-Dk.cjs';
12
12
  import 'hono';
13
- import '../utils-vvJQyygr.cjs';
13
+ import '../utils-DsoDinPz.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-Ug5M2MOr.js';
2
+ import { aF as Registry, a3 as Client } from '../config-DEm0yIVV.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-BqdWVlzm.js';
11
+ import '../utils-OQHBjfcM.js';
12
12
  import 'hono';
13
- import '../utils-vvJQyygr.js';
13
+ import '../utils-DsoDinPz.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-KVPU65TI.js";
3
+ } from "../chunk-7HTST3NX.js";
4
4
  import {
5
5
  convertRegistryConfigToClientConfig
6
- } from "../chunk-MS6C3B2I.js";
6
+ } from "../chunk-BKX7UDTA.js";
7
7
  import "../chunk-JI6GZ2C2.js";
8
- import "../chunk-PLAJJOTE.js";
8
+ import "../chunk-X7RMJQGY.js";
9
9
  import "../chunk-JTHHCZCZ.js";
10
- import "../chunk-CAL23WOC.js";
11
- import "../chunk-OUQUIBVW.js";
10
+ import "../chunk-DN6MD3KK.js";
11
+ import "../chunk-P2OFXH4G.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-vvJQyygr.cjs';
2
+ import './utils-DsoDinPz.cjs';
3
3
  import { z } from 'zod/v4';
4
4
 
5
5
  declare const EncodingSchema: z.ZodEnum<{
@@ -71,6 +71,14 @@ declare class UserError extends RivetError {
71
71
  }
72
72
  declare function toRivetError(error: unknown, fallback?: Partial<RivetErrorLike>): RivetError;
73
73
  declare function encodeBridgeRivetError(error: RivetErrorLike): string;
74
+ /**
75
+ * Encodes an error for the telemetry bridge. A structured error crosses with
76
+ * its group and code. Anything else crosses as text so Core classifies it,
77
+ * which is the same rule that keeps raw messages out of every span.
78
+ */
79
+ declare function encodeErrorForBridge(error: unknown): string;
80
+ /** A `RivetError` instance, or a plain object carrying its full tagged shape. */
81
+ declare function isCanonicalStructuredRivetError(error: unknown): error is RivetErrorLike;
74
82
  declare function decodeBridgeRivetErrorPayload(value: string): BridgeRivetErrorPayload | undefined;
75
83
  declare function decodeBridgeRivetError(value: string): RivetError | undefined;
76
84
  declare function isRivetErrorCode(error: unknown, group: string, code: string): error is RivetError;
@@ -106,4 +114,4 @@ declare function stringifyError(error: unknown): string;
106
114
  /** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */
107
115
  declare function noopNext(): Next;
108
116
 
109
- export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type RivetErrorLike as a, type RivetErrorOptions as b, type UserErrorOptions as c, assertUnreachable as d, type ActorSpecifier as e, type BridgeRivetErrorPayload as f, INTERNAL_ERROR_DESCRIPTION as g, type InternalErrorMetadata 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, isActorAbortedError as v, isRivetErrorCode as w, isRivetErrorLike as x, toRivetError as y, unsupportedFeature as z };
117
+ export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, toRivetError as C, unsupportedFeature as D, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type RivetErrorLike as a, type RivetErrorOptions as b, type UserErrorOptions as c, assertUnreachable as d, type ActorSpecifier as e, type BridgeRivetErrorPayload as f, INTERNAL_ERROR_DESCRIPTION as g, type InternalErrorMetadata 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, encodeErrorForBridge as q, forbiddenError as r, stringifyError as s, internalError as t, invalidEncoding as u, invalidRequest as v, isActorAbortedError as w, isCanonicalStructuredRivetError as x, isRivetErrorCode as y, isRivetErrorLike as z };
@@ -71,6 +71,14 @@ declare class UserError extends RivetError {
71
71
  }
72
72
  declare function toRivetError(error: unknown, fallback?: Partial<RivetErrorLike>): RivetError;
73
73
  declare function encodeBridgeRivetError(error: RivetErrorLike): string;
74
+ /**
75
+ * Encodes an error for the telemetry bridge. A structured error crosses with
76
+ * its group and code. Anything else crosses as text so Core classifies it,
77
+ * which is the same rule that keeps raw messages out of every span.
78
+ */
79
+ declare function encodeErrorForBridge(error: unknown): string;
80
+ /** A `RivetError` instance, or a plain object carrying its full tagged shape. */
81
+ declare function isCanonicalStructuredRivetError(error: unknown): error is RivetErrorLike;
74
82
  declare function decodeBridgeRivetErrorPayload(value: string): BridgeRivetErrorPayload | undefined;
75
83
  declare function decodeBridgeRivetError(value: string): RivetError | undefined;
76
84
  declare function isRivetErrorCode(error: unknown, group: string, code: string): error is RivetError;
@@ -106,4 +114,4 @@ declare function stringifyError(error: unknown): string;
106
114
  /** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */
107
115
  declare function noopNext(): Next;
108
116
 
109
- export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type RivetErrorLike as a, type RivetErrorOptions as b, type UserErrorOptions as c, assertUnreachable as d, type ActorSpecifier as e, type BridgeRivetErrorPayload as f, INTERNAL_ERROR_DESCRIPTION as g, type InternalErrorMetadata 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, isActorAbortedError as v, isRivetErrorCode as w, isRivetErrorLike as x, toRivetError as y, unsupportedFeature as z };
117
+ export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, toRivetError as C, unsupportedFeature as D, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type RivetErrorLike as a, type RivetErrorOptions as b, type UserErrorOptions as c, assertUnreachable as d, type ActorSpecifier as e, type BridgeRivetErrorPayload as f, INTERNAL_ERROR_DESCRIPTION as g, type InternalErrorMetadata 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, encodeErrorForBridge as q, forbiddenError as r, stringifyError as s, internalError as t, invalidEncoding as u, invalidRequest as v, isActorAbortedError as w, isCanonicalStructuredRivetError as x, isRivetErrorCode as y, isRivetErrorLike as z };
@@ -1,5 +1,5 @@
1
1
  import { Context, Handler } from 'hono';
2
- import './utils-vvJQyygr.js';
2
+ import './utils-DsoDinPz.js';
3
3
  import { z } from 'zod/v4';
4
4
 
5
5
  declare const EncodingSchema: z.ZodEnum<{
@@ -19,8 +19,8 @@
19
19
 
20
20
 
21
21
 
22
- var _chunk7E2W2YSMcjs = require('./chunk-7E2W2YSM.cjs');
23
- require('./chunk-2JSYYH6P.cjs');
22
+ var _chunkRJC5O2SDcjs = require('./chunk-RJC5O2SD.cjs');
23
+ require('./chunk-JX2ITWAV.cjs');
24
24
 
25
25
 
26
26
 
@@ -42,5 +42,5 @@ require('./chunk-2JSYYH6P.cjs');
42
42
 
43
43
 
44
44
 
45
- exports.EXTRA_ERROR_LOG = _chunk7E2W2YSMcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunk7E2W2YSMcjs.SinglePromiseQueue; exports.VERSION = _chunk7E2W2YSMcjs.VERSION; exports.arrayBuffersEqual = _chunk7E2W2YSMcjs.arrayBuffersEqual; exports.assertUnreachable = _chunk7E2W2YSMcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunk7E2W2YSMcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunk7E2W2YSMcjs.combineUrlPath; exports.dbg = _chunk7E2W2YSMcjs.dbg; exports.detectRuntime = _chunk7E2W2YSMcjs.detectRuntime; exports.getEnvUniversal = _chunk7E2W2YSMcjs.getEnvUniversal; exports.httpUserAgent = _chunk7E2W2YSMcjs.httpUserAgent; exports.interval = _chunk7E2W2YSMcjs.interval; exports.joinSignals = _chunk7E2W2YSMcjs.joinSignals; exports.jsonParseCompat = _chunk7E2W2YSMcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunk7E2W2YSMcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunk7E2W2YSMcjs.promiseWithResolvers; exports.setLongTimeout = _chunk7E2W2YSMcjs.setLongTimeout; exports.sleep = _chunk7E2W2YSMcjs.sleep; exports.stringifyError = _chunk7E2W2YSMcjs.stringifyError; exports.toUint8Array = _chunk7E2W2YSMcjs.toUint8Array;
45
+ exports.EXTRA_ERROR_LOG = _chunkRJC5O2SDcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkRJC5O2SDcjs.SinglePromiseQueue; exports.VERSION = _chunkRJC5O2SDcjs.VERSION; exports.arrayBuffersEqual = _chunkRJC5O2SDcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkRJC5O2SDcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkRJC5O2SDcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkRJC5O2SDcjs.combineUrlPath; exports.dbg = _chunkRJC5O2SDcjs.dbg; exports.detectRuntime = _chunkRJC5O2SDcjs.detectRuntime; exports.getEnvUniversal = _chunkRJC5O2SDcjs.getEnvUniversal; exports.httpUserAgent = _chunkRJC5O2SDcjs.httpUserAgent; exports.interval = _chunkRJC5O2SDcjs.interval; exports.joinSignals = _chunkRJC5O2SDcjs.joinSignals; exports.jsonParseCompat = _chunkRJC5O2SDcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkRJC5O2SDcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkRJC5O2SDcjs.promiseWithResolvers; exports.setLongTimeout = _chunkRJC5O2SDcjs.setLongTimeout; exports.sleep = _chunkRJC5O2SDcjs.sleep; exports.stringifyError = _chunkRJC5O2SDcjs.stringifyError; exports.toUint8Array = _chunkRJC5O2SDcjs.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-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';
2
+ export { d as assertUnreachable, s as stringifyError } from './utils-DsoDinPz.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-CNFeS-Dk.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-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';
2
+ export { d as assertUnreachable, s as stringifyError } from './utils-DsoDinPz.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-OQHBjfcM.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-CAL23WOC.js";
23
- import "./chunk-OUQUIBVW.js";
22
+ } from "./chunk-DN6MD3KK.js";
23
+ import "./chunk-P2OFXH4G.js";
24
24
  export {
25
25
  EXTRA_ERROR_LOG,
26
26
  SinglePromiseQueue,
@@ -1,23 +1,23 @@
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 _chunkGUVDWB2Ocjs = require('../chunk-GUVDWB2O.cjs');
4
- require('../chunk-QFLG6UB4.cjs');
5
- require('../chunk-F3IP3SGO.cjs');
3
+ var _chunk7BRRGBRYcjs = require('../chunk-7BRRGBRY.cjs');
4
+ require('../chunk-G4U5L6AX.cjs');
6
5
 
7
6
 
8
7
 
9
- var _chunk4KGXFC6Mcjs = require('../chunk-4KGXFC6M.cjs');
8
+ var _chunkEO5UOXXYcjs = require('../chunk-EO5UOXXY.cjs');
9
+ require('../chunk-PPEIPCW4.cjs');
10
10
 
11
11
 
12
12
 
13
13
  var _chunkMYWZCDMLcjs = require('../chunk-MYWZCDML.cjs');
14
14
 
15
15
 
16
- var _chunk7E2W2YSMcjs = require('../chunk-7E2W2YSM.cjs');
16
+ var _chunkRJC5O2SDcjs = require('../chunk-RJC5O2SD.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunk2JSYYH6Pcjs = require('../chunk-2JSYYH6P.cjs');
20
+ var _chunkJX2ITWAVcjs = require('../chunk-JX2ITWAV.cjs');
21
21
 
22
22
  // src/workflow/mod.ts
23
23
 
@@ -590,6 +590,7 @@ var ActorWorkflowDriver = (_class = class {
590
590
  __init() {this.atomicBatch = true}
591
591
  __init2() {this.workerPollInterval = 100}
592
592
 
593
+
593
594
  #actor;
594
595
  #runCtx;
595
596
  #storage;
@@ -597,37 +598,42 @@ var ActorWorkflowDriver = (_class = class {
597
598
  this.#actor = actor;
598
599
  this.#runCtx = runCtx;
599
600
  this.messageDriver = new ActorWorkflowMessageDriver(actor, runCtx);
601
+ this.telemetry = {
602
+ startSpan: () => runCtx.run.startWorkflowSpan()
603
+ };
600
604
  this.#storage = new WorkflowStorage(runtimeDbFromContext(runCtx));
601
605
  }
606
+ /** Keeps the engine's history storage out of the workflow run's trace. */
607
+ #untraced(run) {
608
+ return this.#runCtx.internalKeepAwake(
609
+ this.#runCtx.run.runOutsideWorkflowSpan(run)
610
+ );
611
+ }
602
612
  async get(key) {
603
- return await this.#runCtx.internalKeepAwake(this.#storage.get(key));
613
+ return await this.#untraced(() => this.#storage.get(key));
604
614
  }
605
615
  async set(key, value) {
606
- await this.#runCtx.internalKeepAwake(this.#storage.set(key, value));
616
+ await this.#untraced(() => this.#storage.set(key, value));
607
617
  }
608
618
  async delete(key) {
609
- await this.#runCtx.internalKeepAwake(this.#storage.delete(key));
619
+ await this.#untraced(() => this.#storage.delete(key));
610
620
  }
611
621
  async batchDelete(keys) {
612
- await this.#runCtx.internalKeepAwake(this.#storage.batchDelete(keys));
622
+ await this.#untraced(() => this.#storage.batchDelete(keys));
613
623
  }
614
624
  async deletePrefix(prefix) {
615
- await this.#runCtx.internalKeepAwake(
616
- this.#storage.deletePrefix(prefix)
617
- );
625
+ await this.#untraced(() => this.#storage.deletePrefix(prefix));
618
626
  }
619
627
  async deleteRange(start, end) {
620
- await this.#runCtx.internalKeepAwake(
621
- this.#storage.deleteRange(start, end)
622
- );
628
+ await this.#untraced(() => this.#storage.deleteRange(start, end));
623
629
  }
624
630
  async list(prefix) {
625
- return await this.#runCtx.internalKeepAwake(this.#storage.list(prefix));
631
+ return await this.#untraced(() => this.#storage.list(prefix));
626
632
  }
627
633
  async batch(writes) {
628
634
  if (writes.length === 0) return;
629
- await this.#runCtx.internalKeepAwake(
630
- this.#actor.stateManager.saveStateAndWorkflowBatch(writes)
635
+ await this.#untraced(
636
+ () => this.#actor.stateManager.saveStateAndWorkflowBatch(writes)
631
637
  );
632
638
  }
633
639
  async setAlarm(_workflowId, wakeAt) {
@@ -715,7 +721,7 @@ function shouldRethrowWorkflowError(error) {
715
721
  return true;
716
722
  }
717
723
  function workflowReplayInFlightError() {
718
- return new (0, _chunk2JSYYH6Pcjs.RivetError)(
724
+ return new (0, _chunkJX2ITWAVcjs.RivetError)(
719
725
  "actor",
720
726
  "workflow_in_flight",
721
727
  "Workflow replay is unavailable while the workflow is currently in flight.",
@@ -729,7 +735,7 @@ function isWorkflowReplayBlockedByRunningEntry(error) {
729
735
  return error instanceof Error && error.message === "Cannot replay a workflow while a step is currently running";
730
736
  }
731
737
  function isRunHandlerUnavailable(error) {
732
- return error instanceof _chunk2JSYYH6Pcjs.RivetError && error.group === "actor" && error.code === "run_handler_unavailable";
738
+ return error instanceof _chunkJX2ITWAVcjs.RivetError && error.group === "actor" && error.code === "run_handler_unavailable";
733
739
  }
734
740
  function workflow(fn, options = {}) {
735
741
  const onError = options.onError;
@@ -737,13 +743,13 @@ function workflow(fn, options = {}) {
737
743
  function getWorkflowInspector(actorId) {
738
744
  let workflowInspector = workflowInspectors.get(actorId);
739
745
  if (!workflowInspector) {
740
- workflowInspector = _chunkGUVDWB2Ocjs.createWorkflowInspectorAdapter.call(void 0, );
746
+ workflowInspector = _chunk7BRRGBRYcjs.createWorkflowInspectorAdapter.call(void 0, );
741
747
  workflowInspectors.set(actorId, workflowInspector);
742
748
  }
743
749
  return workflowInspector;
744
750
  }
745
751
  async function run(runCtx) {
746
- const actor = runCtx[_chunk4KGXFC6Mcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL];
752
+ const actor = runCtx[_chunkEO5UOXXYcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL];
747
753
  _invariant2.default.call(void 0, actor, "workflow() requires an actor instance");
748
754
  const workflowInspector = getWorkflowInspector(actor.id);
749
755
  const driver = new ActorWorkflowDriver(actor, runCtx);
@@ -804,25 +810,25 @@ function workflow(fn, options = {}) {
804
810
  try {
805
811
  await handle.result;
806
812
  } catch (error) {
807
- if (runCtx.abortSignal.aborted || _chunk2JSYYH6Pcjs.isActorAbortedError.call(void 0, error)) {
813
+ if (runCtx.abortSignal.aborted || _chunkJX2ITWAVcjs.isActorAbortedError.call(void 0, error)) {
808
814
  return;
809
815
  }
810
816
  if (shouldRethrowWorkflowError(error)) {
811
817
  runCtx.log.error({
812
818
  msg: "workflow run failed",
813
- error: _chunk7E2W2YSMcjs.stringifyError.call(void 0, error)
819
+ error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
814
820
  });
815
821
  throw error;
816
822
  }
817
823
  runCtx.log.warn({
818
824
  msg: "workflow failed and will sleep until woken",
819
- error: _chunk7E2W2YSMcjs.stringifyError.call(void 0, error)
825
+ error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
820
826
  });
821
827
  } finally {
822
828
  runCtx.abortSignal.removeEventListener("abort", onAbort);
823
829
  }
824
830
  }
825
- return _chunk4KGXFC6Mcjs.defineRunHandler.call(void 0, run, {
831
+ return _chunkEO5UOXXYcjs.defineRunHandler.call(void 0, run, {
826
832
  icon: "diagram-project",
827
833
  inspectorKind: "workflow",
828
834
  createInspector: ({ actorId, control }) => {