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.
- package/dist/browser/client.d.ts +4 -0
- package/dist/browser/client.js +116 -60
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +2 -2
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/actor/errors.js +1 -1
- package/dist/tsup/agent-os/index.cjs +2 -2
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +4 -0
- package/dist/tsup/agent-os/index.d.ts +4 -0
- package/dist/tsup/agent-os/index.js +2 -2
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-MT33DKU4.js → chunk-34Q4YVCX.js} +2 -2
- package/dist/tsup/{chunk-T4MKKCRF.cjs → chunk-4ESGNS3Z.cjs} +15 -10
- package/dist/tsup/chunk-4ESGNS3Z.cjs.map +1 -0
- package/dist/tsup/{chunk-VJ4KLJO5.cjs → chunk-EQKSWDIH.cjs} +3 -3
- package/dist/tsup/{chunk-VJ4KLJO5.cjs.map → chunk-EQKSWDIH.cjs.map} +1 -1
- package/dist/tsup/{chunk-BZX4LYYD.cjs → chunk-IJWTHKH6.cjs} +3 -3
- package/dist/tsup/{chunk-BZX4LYYD.cjs.map → chunk-IJWTHKH6.cjs.map} +1 -1
- package/dist/tsup/{chunk-ZZ3WBRPD.js → chunk-IXBD7BXC.js} +15 -4
- package/dist/tsup/chunk-IXBD7BXC.js.map +1 -0
- package/dist/tsup/{chunk-ZTPFJOBX.js → chunk-NHI5L7C7.js} +3 -3
- package/dist/tsup/{chunk-CMZBDX6Z.cjs → chunk-O6H3BUN4.cjs} +3 -3
- package/dist/tsup/{chunk-CMZBDX6Z.cjs.map → chunk-O6H3BUN4.cjs.map} +1 -1
- package/dist/tsup/{chunk-HVHDZDM2.js → chunk-OLGQYFUW.js} +8 -3
- package/dist/tsup/chunk-OLGQYFUW.js.map +1 -0
- package/dist/tsup/{chunk-BEPAAID2.cjs → chunk-OX6WVQE6.cjs} +10 -10
- package/dist/tsup/{chunk-BEPAAID2.cjs.map → chunk-OX6WVQE6.cjs.map} +1 -1
- package/dist/tsup/{chunk-KRPA4UOE.js → chunk-PSXMESQJ.js} +2 -2
- package/dist/tsup/{chunk-6ETWXXAZ.cjs → chunk-PZBWSCQR.cjs} +262 -213
- package/dist/tsup/chunk-PZBWSCQR.cjs.map +1 -0
- package/dist/tsup/{chunk-2D5PNV5A.cjs → chunk-QLOBB27M.cjs} +4 -4
- package/dist/tsup/{chunk-2D5PNV5A.cjs.map → chunk-QLOBB27M.cjs.map} +1 -1
- package/dist/tsup/{chunk-4FC7TVS6.cjs → chunk-SPJORZMM.cjs} +15 -4
- package/dist/tsup/chunk-SPJORZMM.cjs.map +1 -0
- package/dist/tsup/{chunk-DIHAXOB7.cjs → chunk-UBB32UOG.cjs} +7 -7
- package/dist/tsup/{chunk-DIHAXOB7.cjs.map → chunk-UBB32UOG.cjs.map} +1 -1
- package/dist/tsup/{chunk-OZWVDFCA.js → chunk-UN5JNDBT.js} +4 -4
- package/dist/tsup/{chunk-5UYNV4W6.js → chunk-WVFTFWJL.js} +2 -2
- package/dist/tsup/{chunk-JHHAMABO.js → chunk-XI4MEUUI.js} +2 -2
- package/dist/tsup/{chunk-A5BZEQOG.js → chunk-YYIDQBBM.js} +110 -61
- package/dist/tsup/chunk-YYIDQBBM.js.map +1 -0
- 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-DTGoWdkG.d.cts → config-BXSV17G7.d.cts} +2 -2
- package/dist/tsup/{config-C4OSv0QP.d.ts → config-Bi1r6gI7.d.ts} +2 -2
- package/dist/tsup/{context-C6cvDNyk.d.cts → context-4fJemY0D.d.cts} +1 -1
- package/dist/tsup/{context-CMygeBxS.d.ts → context-D4sNYboo.d.ts} +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.d.cts +3 -3
- package/dist/tsup/dynamic/mod.d.ts +3 -3
- 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.d.cts +4 -4
- package/dist/tsup/inspector-tab/mod.d.ts +4 -4
- package/dist/tsup/mod.cjs +111 -110
- 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 +8 -7
- 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-DQDCphrl.d.cts → utils-Bbz-3411.d.cts} +1 -1
- package/dist/tsup/{utils-CV0akuDD.d.ts → utils-BqdWVlzm.d.ts} +1 -1
- package/dist/tsup/{utils-CqDnC_PS.d.cts → utils-vvJQyygr.d.cts} +5 -0
- package/dist/tsup/{utils-CqDnC_PS.d.ts → utils-vvJQyygr.d.ts} +5 -0
- 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 +11 -11
- package/dist/tsup/workflow/mod.d.cts +5 -5
- package/dist/tsup/workflow/mod.d.ts +5 -5
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +8 -8
- package/src/actor/errors.ts +29 -2
- package/src/client/actor-conn.ts +5 -4
- package/src/client/actor-handle.ts +47 -19
- package/src/client/actor-query.ts +8 -1
- package/src/client/errors.ts +2 -1
- package/src/client/raw-utils.ts +3 -5
- package/src/client/utils.ts +2 -0
- package/src/common/utils.ts +6 -0
- package/src/engine-client/mod.ts +51 -20
- package/src/registry/native.ts +1 -0
- package/dist/tsup/chunk-4FC7TVS6.cjs.map +0 -1
- package/dist/tsup/chunk-6ETWXXAZ.cjs.map +0 -1
- package/dist/tsup/chunk-A5BZEQOG.js.map +0 -1
- package/dist/tsup/chunk-HVHDZDM2.js.map +0 -1
- package/dist/tsup/chunk-T4MKKCRF.cjs.map +0 -1
- package/dist/tsup/chunk-ZZ3WBRPD.js.map +0 -1
- /package/dist/tsup/{chunk-MT33DKU4.js.map → chunk-34Q4YVCX.js.map} +0 -0
- /package/dist/tsup/{chunk-ZTPFJOBX.js.map → chunk-NHI5L7C7.js.map} +0 -0
- /package/dist/tsup/{chunk-KRPA4UOE.js.map → chunk-PSXMESQJ.js.map} +0 -0
- /package/dist/tsup/{chunk-OZWVDFCA.js.map → chunk-UN5JNDBT.js.map} +0 -0
- /package/dist/tsup/{chunk-5UYNV4W6.js.map → chunk-WVFTFWJL.js.map} +0 -0
- /package/dist/tsup/{chunk-JHHAMABO.js.map → chunk-XI4MEUUI.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 _chunkUBB32UOGcjs = require('../chunk-UBB32UOG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkPZBWSCQRcjs = require('../chunk-PZBWSCQR.cjs');
|
|
7
7
|
require('../chunk-MYWZCDML.cjs');
|
|
8
8
|
require('../chunk-KVFIONKQ.cjs');
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-
|
|
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 =
|
|
40
|
-
...
|
|
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 () => {
|
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-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-
|
|
11
|
+
import '../utils-Bbz-3411.cjs';
|
|
12
12
|
import 'hono';
|
|
13
|
-
import '../utils-
|
|
13
|
+
import '../utils-vvJQyygr.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-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-
|
|
11
|
+
import '../utils-BqdWVlzm.js';
|
|
12
12
|
import 'hono';
|
|
13
|
-
import '../utils-
|
|
13
|
+
import '../utils-vvJQyygr.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-NHI5L7C7.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-YYIDQBBM.js";
|
|
7
7
|
import "../chunk-JI6GZ2C2.js";
|
|
8
8
|
import "../chunk-JTHHCZCZ.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
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";
|
|
@@ -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;
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
require('./chunk-
|
|
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 =
|
|
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
|
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-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';
|
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-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';
|
package/dist/tsup/utils.js
CHANGED
|
@@ -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
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
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
|
|
16
|
+
var _chunk4ESGNS3Zcjs = require('../chunk-4ESGNS3Z.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
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,
|
|
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
|
|
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 =
|
|
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 ||
|
|
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:
|
|
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:
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
14
|
+
import '../utils-Bbz-3411.cjs';
|
|
15
15
|
import 'hono';
|
|
16
|
-
import '../utils-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
14
|
+
import '../utils-BqdWVlzm.js';
|
|
15
15
|
import 'hono';
|
|
16
|
-
import '../utils-
|
|
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-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
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-
|
|
16
|
+
} from "../chunk-OLGQYFUW.js";
|
|
17
17
|
import {
|
|
18
18
|
RivetError,
|
|
19
19
|
isActorAbortedError
|
|
20
|
-
} from "../chunk-
|
|
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.
|
|
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.
|
|
215
|
-
"@rivetkit/engine-envoy-protocol": "2.3.12-rc.
|
|
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.
|
|
218
|
-
"@rivetkit/rivetkit-wasm": "2.3.12-rc.
|
|
219
|
-
"@rivetkit/traces": "2.3.12-rc.
|
|
220
|
-
"@rivetkit/virtual-websocket": "2.3.12-rc.
|
|
221
|
-
"@rivetkit/workflow-engine": "2.3.12-rc.
|
|
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",
|
package/src/actor/errors.ts
CHANGED
|
@@ -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
|
|
267
|
+
const raw = JSON.parse(
|
|
248
268
|
value.slice(BRIDGE_RIVET_ERROR_PREFIX.length),
|
|
249
|
-
) as
|
|
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
|
},
|
package/src/client/actor-conn.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
917
|
+
{ rayId },
|
|
917
918
|
);
|
|
918
919
|
}
|
|
919
920
|
|