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.
- package/dist/browser/client.d.ts +723 -616
- package/dist/browser/client.js +184 -28
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +3 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +6 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/actor/errors.js +5 -1
- package/dist/tsup/agent-os/index.cjs +3 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +110 -3
- package/dist/tsup/agent-os/index.d.ts +110 -3
- package/dist/tsup/agent-os/index.js +3 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-ENDOWQTM.js → chunk-464WE4RF.js} +2 -2
- package/dist/tsup/{chunk-KKG2CTSI.js → chunk-4SC2NSAV.js} +2 -2
- package/dist/tsup/{chunk-R2WRP6VV.cjs → chunk-7A5EIXJJ.cjs} +7 -7
- package/dist/tsup/{chunk-R2WRP6VV.cjs.map → chunk-7A5EIXJJ.cjs.map} +1 -1
- package/dist/tsup/{chunk-GUVDWB2O.cjs → chunk-7BRRGBRY.cjs} +10 -10
- package/dist/tsup/{chunk-GUVDWB2O.cjs.map → chunk-7BRRGBRY.cjs.map} +1 -1
- package/dist/tsup/{chunk-KVPU65TI.js → chunk-7HTST3NX.js} +3 -3
- package/dist/tsup/{chunk-MS6C3B2I.js → chunk-BKX7UDTA.js} +185 -28
- package/dist/tsup/chunk-BKX7UDTA.js.map +1 -0
- package/dist/tsup/{chunk-FL2FDUSZ.js → chunk-DK3L22R6.js} +4 -4
- package/dist/tsup/{chunk-CAL23WOC.js → chunk-DN6MD3KK.js} +7 -7
- package/dist/tsup/chunk-DN6MD3KK.js.map +1 -0
- package/dist/tsup/{chunk-6W5VGLFT.js → chunk-EB77NZL4.js} +1 -1
- package/dist/tsup/chunk-EB77NZL4.js.map +1 -0
- package/dist/tsup/{chunk-4KGXFC6M.cjs → chunk-EO5UOXXY.cjs} +1 -1
- package/dist/tsup/chunk-EO5UOXXY.cjs.map +1 -0
- package/dist/tsup/{chunk-QFLG6UB4.cjs → chunk-G4U5L6AX.cjs} +3 -3
- package/dist/tsup/{chunk-QFLG6UB4.cjs.map → chunk-G4U5L6AX.cjs.map} +1 -1
- package/dist/tsup/{chunk-TGGF6SZN.cjs → chunk-IJUXBWH4.cjs} +351 -194
- package/dist/tsup/chunk-IJUXBWH4.cjs.map +1 -0
- package/dist/tsup/{chunk-2JSYYH6P.cjs → chunk-JX2ITWAV.cjs} +13 -2
- package/dist/tsup/chunk-JX2ITWAV.cjs.map +1 -0
- package/dist/tsup/{chunk-N3DJTMSZ.cjs → chunk-OGPFN6BT.cjs} +3 -3
- package/dist/tsup/{chunk-N3DJTMSZ.cjs.map → chunk-OGPFN6BT.cjs.map} +1 -1
- package/dist/tsup/{chunk-OUQUIBVW.js → chunk-P2OFXH4G.js} +12 -1
- package/dist/tsup/chunk-P2OFXH4G.js.map +1 -0
- package/dist/tsup/{chunk-F3IP3SGO.cjs → chunk-PPEIPCW4.cjs} +4 -4
- package/dist/tsup/{chunk-F3IP3SGO.cjs.map → chunk-PPEIPCW4.cjs.map} +1 -1
- package/dist/tsup/{chunk-7E2W2YSM.cjs → chunk-RJC5O2SD.cjs} +13 -13
- package/dist/tsup/chunk-RJC5O2SD.cjs.map +1 -0
- package/dist/tsup/{chunk-YQD6RRVP.js → chunk-WME6KOXW.js} +2 -2
- package/dist/tsup/{chunk-PLAJJOTE.js → chunk-X7RMJQGY.js} +2 -2
- package/dist/tsup/{chunk-4OMHYVOQ.cjs → chunk-Z4RAXFSD.cjs} +3 -3
- package/dist/tsup/{chunk-4OMHYVOQ.cjs.map → chunk-Z4RAXFSD.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +5 -5
- package/dist/tsup/client/mod.d.ts +5 -5
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +3 -3
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{config-gvHwMas-.d.cts → config-8n2AOhXK.d.cts} +114 -10
- package/dist/tsup/{config-Ug5M2MOr.d.ts → config-DEm0yIVV.d.ts} +114 -10
- package/dist/tsup/{context-DererUCI.d.ts → context-DGg2-IOm.d.ts} +1 -1
- package/dist/tsup/{context-BSCBvbfM.d.cts → context-DwjOVvlE.d.cts} +1 -1
- package/dist/tsup/db/drizzle.cjs +3 -3
- package/dist/tsup/db/drizzle.js +2 -2
- package/dist/tsup/db/mod.cjs +4 -4
- package/dist/tsup/db/mod.js +3 -3
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +3 -3
- package/dist/tsup/dynamic/mod.d.ts +3 -3
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/inspector/workflow.cjs +5 -5
- package/dist/tsup/inspector/workflow.js +4 -4
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +4 -4
- package/dist/tsup/inspector-tab/mod.d.ts +4 -4
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +492 -319
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +5 -5
- package/dist/tsup/mod.d.ts +5 -5
- package/dist/tsup/mod.js +367 -194
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +3 -3
- package/dist/tsup/test/mod.d.ts +3 -3
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/{utils-Bbz-3411.d.cts → utils-CNFeS-Dk.d.cts} +1 -1
- package/dist/tsup/{utils-vvJQyygr.d.ts → utils-DsoDinPz.d.cts} +9 -1
- package/dist/tsup/{utils-vvJQyygr.d.cts → utils-DsoDinPz.d.ts} +9 -1
- package/dist/tsup/{utils-BqdWVlzm.d.ts → utils-OQHBjfcM.d.ts} +1 -1
- package/dist/tsup/utils.cjs +3 -3
- package/dist/tsup/utils.d.cts +2 -2
- package/dist/tsup/utils.d.ts +2 -2
- package/dist/tsup/utils.js +2 -2
- package/dist/tsup/workflow/mod.cjs +33 -27
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +5 -5
- package/dist/tsup/workflow/mod.d.ts +5 -5
- package/dist/tsup/workflow/mod.js +25 -19
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +10 -8
- package/src/actor/config.ts +38 -0
- package/src/actor/errors.ts +31 -0
- package/src/client/actor-conn.ts +7 -0
- package/src/client/actor-handle.ts +57 -17
- package/src/client/client.ts +26 -6
- package/src/client/outbound-telemetry.ts +66 -0
- package/src/client/queue.ts +3 -0
- package/src/client/raw-utils.ts +3 -0
- package/src/common/actor-router-consts.ts +3 -0
- package/src/common/actor-telemetry-context.ts +19 -0
- package/src/common/otel-context.ts +99 -0
- package/src/common/utils.ts +1 -19
- package/src/engine-client/actor-http-client.ts +15 -0
- package/src/registry/index.ts +6 -0
- package/src/registry/napi-runtime.ts +155 -35
- package/src/registry/native.ts +277 -191
- package/src/registry/runtime.ts +66 -0
- package/src/registry/wasm-runtime.ts +40 -0
- package/src/workflow/driver.ts +20 -12
- package/dist/tsup/chunk-2JSYYH6P.cjs.map +0 -1
- package/dist/tsup/chunk-4KGXFC6M.cjs.map +0 -1
- package/dist/tsup/chunk-6W5VGLFT.js.map +0 -1
- package/dist/tsup/chunk-7E2W2YSM.cjs.map +0 -1
- package/dist/tsup/chunk-CAL23WOC.js.map +0 -1
- package/dist/tsup/chunk-MS6C3B2I.js.map +0 -1
- package/dist/tsup/chunk-OUQUIBVW.js.map +0 -1
- package/dist/tsup/chunk-TGGF6SZN.cjs.map +0 -1
- /package/dist/tsup/{chunk-ENDOWQTM.js.map → chunk-464WE4RF.js.map} +0 -0
- /package/dist/tsup/{chunk-KKG2CTSI.js.map → chunk-4SC2NSAV.js.map} +0 -0
- /package/dist/tsup/{chunk-KVPU65TI.js.map → chunk-7HTST3NX.js.map} +0 -0
- /package/dist/tsup/{chunk-FL2FDUSZ.js.map → chunk-DK3L22R6.js.map} +0 -0
- /package/dist/tsup/{chunk-YQD6RRVP.js.map → chunk-WME6KOXW.js.map} +0 -0
- /package/dist/tsup/{chunk-PLAJJOTE.js.map → chunk-X7RMJQGY.js.map} +0 -0
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -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
|
|
3
|
+
var _chunk7A5EIXJJcjs = require('../chunk-7A5EIXJJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkIJUXBWH4cjs = require('../chunk-IJUXBWH4.cjs');
|
|
7
7
|
require('../chunk-MYWZCDML.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-OGPFN6BT.cjs');
|
|
9
9
|
require('../chunk-KVFIONKQ.cjs');
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-
|
|
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 =
|
|
40
|
-
...
|
|
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 () => {
|
package/dist/tsup/test/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import { aF as Registry, a3 as Client } from '../config-
|
|
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-
|
|
11
|
+
import '../utils-CNFeS-Dk.cjs';
|
|
12
12
|
import 'hono';
|
|
13
|
-
import '../utils-
|
|
13
|
+
import '../utils-DsoDinPz.cjs';
|
|
14
14
|
import 'hono/utils/http-status';
|
|
15
15
|
|
|
16
16
|
interface SetupTestResult<A extends Registry<any>> {
|
package/dist/tsup/test/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import { aF as Registry, a3 as Client } from '../config-
|
|
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-
|
|
11
|
+
import '../utils-OQHBjfcM.js';
|
|
12
12
|
import 'hono';
|
|
13
|
-
import '../utils-
|
|
13
|
+
import '../utils-DsoDinPz.js';
|
|
14
14
|
import 'hono/utils/http-status';
|
|
15
15
|
|
|
16
16
|
interface SetupTestResult<A extends Registry<any>> {
|
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-7HTST3NX.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-BKX7UDTA.js";
|
|
7
7
|
import "../chunk-JI6GZ2C2.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-X7RMJQGY.js";
|
|
9
9
|
import "../chunk-JTHHCZCZ.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
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";
|
|
@@ -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,
|
|
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,
|
|
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 };
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
require('./chunk-
|
|
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 =
|
|
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
|
package/dist/tsup/utils.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'hono';
|
|
2
|
-
export { d as assertUnreachable, s as stringifyError } from './utils-
|
|
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-
|
|
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';
|
package/dist/tsup/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'hono';
|
|
2
|
-
export { d as assertUnreachable, s as stringifyError } from './utils-
|
|
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-
|
|
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';
|
package/dist/tsup/utils.js
CHANGED
|
@@ -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
|
|
4
|
-
require('../chunk-
|
|
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
|
|
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
|
|
16
|
+
var _chunkRJC5O2SDcjs = require('../chunk-RJC5O2SD.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
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.#
|
|
613
|
+
return await this.#untraced(() => this.#storage.get(key));
|
|
604
614
|
}
|
|
605
615
|
async set(key, value) {
|
|
606
|
-
await this.#
|
|
616
|
+
await this.#untraced(() => this.#storage.set(key, value));
|
|
607
617
|
}
|
|
608
618
|
async delete(key) {
|
|
609
|
-
await this.#
|
|
619
|
+
await this.#untraced(() => this.#storage.delete(key));
|
|
610
620
|
}
|
|
611
621
|
async batchDelete(keys) {
|
|
612
|
-
await this.#
|
|
622
|
+
await this.#untraced(() => this.#storage.batchDelete(keys));
|
|
613
623
|
}
|
|
614
624
|
async deletePrefix(prefix) {
|
|
615
|
-
await this.#
|
|
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.#
|
|
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.#
|
|
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.#
|
|
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,
|
|
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
|
|
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 =
|
|
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[
|
|
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 ||
|
|
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:
|
|
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:
|
|
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
|
|
831
|
+
return _chunkEO5UOXXYcjs.defineRunHandler.call(void 0, run, {
|
|
826
832
|
icon: "diagram-project",
|
|
827
833
|
inspectorKind: "workflow",
|
|
828
834
|
createInspector: ({ actorId, control }) => {
|