rivetkit 3.0.1-preview.1 → 3.0.1
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 +9 -0
- package/dist/browser/client.js +68 -8
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +4 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-76EPM7XH.js → chunk-2JSFY7XD.js} +2 -2
- package/dist/tsup/{chunk-GD6EEIUP.cjs → chunk-3PFAODLE.cjs} +3 -3
- package/dist/tsup/{chunk-GD6EEIUP.cjs.map → chunk-3PFAODLE.cjs.map} +1 -1
- package/dist/tsup/{chunk-PC27E4VN.cjs → chunk-4VEJIK7O.cjs} +3 -3
- package/dist/tsup/{chunk-PC27E4VN.cjs.map → chunk-4VEJIK7O.cjs.map} +1 -1
- package/dist/tsup/{chunk-MPBDBG56.js → chunk-57I7SSSV.js} +4 -4
- package/dist/tsup/{chunk-UQGGPTAI.js → chunk-7K6MC544.js} +2 -2
- package/dist/tsup/{chunk-SRAILZ2U.cjs → chunk-B3MXZSPO.cjs} +204 -147
- package/dist/tsup/chunk-B3MXZSPO.cjs.map +1 -0
- package/dist/tsup/{chunk-KYSDMIRN.js → chunk-B5WDVY32.js} +9 -3
- package/dist/tsup/chunk-B5WDVY32.js.map +1 -0
- package/dist/tsup/{chunk-QGK24TS3.js → chunk-BOVQ3JQK.js} +3 -3
- package/dist/tsup/{chunk-W6D3WHMT.cjs → chunk-HQ5JCCK6.cjs} +7 -7
- package/dist/tsup/{chunk-W6D3WHMT.cjs.map → chunk-HQ5JCCK6.cjs.map} +1 -1
- package/dist/tsup/{chunk-33N3SX2W.js → chunk-JOCSSMLU.js} +70 -13
- package/dist/tsup/chunk-JOCSSMLU.js.map +1 -0
- package/dist/tsup/{chunk-HY2NYO2Q.cjs → chunk-LXSYHJ7E.cjs} +4 -4
- package/dist/tsup/{chunk-HY2NYO2Q.cjs.map → chunk-LXSYHJ7E.cjs.map} +1 -1
- package/dist/tsup/{chunk-CNCOY7HZ.cjs → chunk-N7V3BQUB.cjs} +10 -10
- package/dist/tsup/{chunk-CNCOY7HZ.cjs.map → chunk-N7V3BQUB.cjs.map} +1 -1
- package/dist/tsup/{chunk-6M2QCAHK.cjs → chunk-NSQWB4QD.cjs} +3 -3
- package/dist/tsup/{chunk-6M2QCAHK.cjs.map → chunk-NSQWB4QD.cjs.map} +1 -1
- package/dist/tsup/{chunk-ISCHIEBJ.js → chunk-PLZVADML.js} +2 -2
- package/dist/tsup/{chunk-HD2OTPZY.cjs → chunk-QI7E2UH5.cjs} +9 -3
- package/dist/tsup/chunk-QI7E2UH5.cjs.map +1 -0
- package/dist/tsup/{chunk-IHQRD4KC.js → chunk-QX7DWU46.js} +2 -2
- package/dist/tsup/{chunk-HDVZ6YZG.cjs → chunk-SSF2XC33.cjs} +1 -1
- package/dist/tsup/chunk-SSF2XC33.cjs.map +1 -0
- package/dist/tsup/{chunk-6FEYCVZC.js → chunk-UXDASKP6.js} +1 -1
- package/dist/tsup/chunk-UXDASKP6.js.map +1 -0
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-8NgsxIcT.d.cts → config-K9uOKlok.d.cts} +2 -0
- package/dist/tsup/{config-DJ3KW-fe.d.ts → config-XfKwGYxx.d.ts} +2 -0
- package/dist/tsup/{context-BL8kUGjq.d.ts → context-Bm7mA4E3.d.ts} +1 -1
- package/dist/tsup/{context-_RoE_YHL.d.cts → context-CPCM-xn6.d.cts} +1 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +132 -124
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +3 -3
- package/dist/tsup/mod.d.ts +3 -3
- package/dist/tsup/mod.js +31 -23
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +10 -10
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +12 -9
- package/src/actor/config.ts +2 -0
- package/src/client/actor-handle.ts +43 -7
- package/src/client/lifecycle-errors.ts +6 -1
- package/src/client/raw-utils.ts +17 -3
- package/src/client/utils.ts +4 -0
- package/src/registry/config/index.ts +7 -5
- package/src/registry/native.ts +24 -17
- package/src/registry/runtime.ts +1 -1
- package/src/utils/env-vars.ts +4 -2
- package/dist/tsup/chunk-33N3SX2W.js.map +0 -1
- package/dist/tsup/chunk-6FEYCVZC.js.map +0 -1
- package/dist/tsup/chunk-HD2OTPZY.cjs.map +0 -1
- package/dist/tsup/chunk-HDVZ6YZG.cjs.map +0 -1
- package/dist/tsup/chunk-KYSDMIRN.js.map +0 -1
- package/dist/tsup/chunk-SRAILZ2U.cjs.map +0 -1
- /package/dist/tsup/{chunk-76EPM7XH.js.map → chunk-2JSFY7XD.js.map} +0 -0
- /package/dist/tsup/{chunk-MPBDBG56.js.map → chunk-57I7SSSV.js.map} +0 -0
- /package/dist/tsup/{chunk-UQGGPTAI.js.map → chunk-7K6MC544.js.map} +0 -0
- /package/dist/tsup/{chunk-QGK24TS3.js.map → chunk-BOVQ3JQK.js.map} +0 -0
- /package/dist/tsup/{chunk-ISCHIEBJ.js.map → chunk-PLZVADML.js.map} +0 -0
- /package/dist/tsup/{chunk-IHQRD4KC.js.map → chunk-QX7DWU46.js.map} +0 -0
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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 _chunkHQ5JCCK6cjs = require('../chunk-HQ5JCCK6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkB3MXZSPOcjs = require('../chunk-B3MXZSPO.cjs');
|
|
7
7
|
require('../chunk-RTWH3AX3.cjs');
|
|
8
|
-
require('../chunk-PC27E4VN.cjs');
|
|
9
8
|
require('../chunk-KVFIONKQ.cjs');
|
|
10
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-4VEJIK7O.cjs');
|
|
10
|
+
require('../chunk-QI7E2UH5.cjs');
|
|
11
11
|
require('../chunk-MGI2VVF6.cjs');
|
|
12
12
|
|
|
13
13
|
// src/test/ready.ts
|
|
@@ -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 = _chunkHQ5JCCK6cjs.createClient.call(void 0, {
|
|
40
|
+
..._chunkB3MXZSPOcjs.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 { aI as Registry, a6 as Client } from '../config-
|
|
2
|
+
import { aI as Registry, a6 as Client } from '../config-K9uOKlok.cjs';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-B2wlj9wx.cjs';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
package/dist/tsup/test/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import { aI as Registry, a6 as Client } from '../config-
|
|
2
|
+
import { aI as Registry, a6 as Client } from '../config-XfKwGYxx.js';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-B2wlj9wx.js';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-BOVQ3JQK.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JOCSSMLU.js";
|
|
7
7
|
import "../chunk-A2CF6PFH.js";
|
|
8
|
-
import "../chunk-ISCHIEBJ.js";
|
|
9
8
|
import "../chunk-JTHHCZCZ.js";
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-PLZVADML.js";
|
|
10
|
+
import "../chunk-B5WDVY32.js";
|
|
11
11
|
import "../chunk-ZOVJDAOW.js";
|
|
12
12
|
|
|
13
13
|
// src/test/ready.ts
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkQI7E2UH5cjs = require('./chunk-QI7E2UH5.cjs');
|
|
23
23
|
require('./chunk-MGI2VVF6.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
@@ -42,5 +42,5 @@ require('./chunk-MGI2VVF6.cjs');
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
exports.EXTRA_ERROR_LOG =
|
|
45
|
+
exports.EXTRA_ERROR_LOG = _chunkQI7E2UH5cjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkQI7E2UH5cjs.SinglePromiseQueue; exports.VERSION = _chunkQI7E2UH5cjs.VERSION; exports.arrayBuffersEqual = _chunkQI7E2UH5cjs.arrayBuffersEqual; exports.assertUnreachable = _chunkQI7E2UH5cjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkQI7E2UH5cjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkQI7E2UH5cjs.combineUrlPath; exports.dbg = _chunkQI7E2UH5cjs.dbg; exports.detectRuntime = _chunkQI7E2UH5cjs.detectRuntime; exports.getEnvUniversal = _chunkQI7E2UH5cjs.getEnvUniversal; exports.httpUserAgent = _chunkQI7E2UH5cjs.httpUserAgent; exports.interval = _chunkQI7E2UH5cjs.interval; exports.joinSignals = _chunkQI7E2UH5cjs.joinSignals; exports.jsonParseCompat = _chunkQI7E2UH5cjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkQI7E2UH5cjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkQI7E2UH5cjs.promiseWithResolvers; exports.setLongTimeout = _chunkQI7E2UH5cjs.setLongTimeout; exports.sleep = _chunkQI7E2UH5cjs.sleep; exports.stringifyError = _chunkQI7E2UH5cjs.stringifyError; exports.toUint8Array = _chunkQI7E2UH5cjs.toUint8Array;
|
|
46
46
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/tsup/utils.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 _chunkN7V3BQUBcjs = require('../chunk-N7V3BQUB.cjs');
|
|
4
|
+
require('../chunk-NSQWB4QD.cjs');
|
|
5
|
+
require('../chunk-LXSYHJ7E.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkSSF2XC33cjs = require('../chunk-SSF2XC33.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkRTWH3AX3cjs = require('../chunk-RTWH3AX3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkQI7E2UH5cjs = require('../chunk-QI7E2UH5.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -746,13 +746,13 @@ function workflow(fn, options = {}) {
|
|
|
746
746
|
function getWorkflowInspector(actorId) {
|
|
747
747
|
let workflowInspector = workflowInspectors.get(actorId);
|
|
748
748
|
if (!workflowInspector) {
|
|
749
|
-
workflowInspector =
|
|
749
|
+
workflowInspector = _chunkN7V3BQUBcjs.createWorkflowInspectorAdapter.call(void 0, );
|
|
750
750
|
workflowInspectors.set(actorId, workflowInspector);
|
|
751
751
|
}
|
|
752
752
|
return workflowInspector;
|
|
753
753
|
}
|
|
754
754
|
async function run(runCtx) {
|
|
755
|
-
const actor = runCtx[
|
|
755
|
+
const actor = runCtx[_chunkSSF2XC33cjs.ACTOR_CONTEXT_INTERNAL_SYMBOL];
|
|
756
756
|
_invariant2.default.call(void 0, actor, "workflow() requires an actor instance");
|
|
757
757
|
const workflowInspector = getWorkflowInspector(actor.id);
|
|
758
758
|
const driver = new ActorWorkflowDriver(actor, runCtx);
|
|
@@ -819,19 +819,19 @@ function workflow(fn, options = {}) {
|
|
|
819
819
|
if (shouldRethrowWorkflowError(error)) {
|
|
820
820
|
runCtx.log.error({
|
|
821
821
|
msg: "workflow run failed",
|
|
822
|
-
error:
|
|
822
|
+
error: _chunkQI7E2UH5cjs.stringifyError.call(void 0, error)
|
|
823
823
|
});
|
|
824
824
|
throw error;
|
|
825
825
|
}
|
|
826
826
|
runCtx.log.warn({
|
|
827
827
|
msg: "workflow failed and will sleep until woken",
|
|
828
|
-
error:
|
|
828
|
+
error: _chunkQI7E2UH5cjs.stringifyError.call(void 0, error)
|
|
829
829
|
});
|
|
830
830
|
} finally {
|
|
831
831
|
runCtx.abortSignal.removeEventListener("abort", onAbort);
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
return
|
|
834
|
+
return _chunkSSF2XC33cjs.defineRunHandler.call(void 0, run, {
|
|
835
835
|
icon: "diagram-project",
|
|
836
836
|
inspectorKind: "workflow",
|
|
837
837
|
createInspector: ({ actorId, control }) => {
|
|
@@ -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-K9uOKlok.cjs';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-B2wlj9wx.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-CPCM-xn6.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-CPCM-xn6.cjs';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -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-XfKwGYxx.js';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-B2wlj9wx.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-Bm7mA4E3.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-Bm7mA4E3.js';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-57I7SSSV.js";
|
|
4
|
+
import "../chunk-2JSFY7XD.js";
|
|
5
|
+
import "../chunk-QX7DWU46.js";
|
|
6
6
|
import {
|
|
7
7
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
8
8
|
defineRunHandler
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-UXDASKP6.js";
|
|
10
10
|
import {
|
|
11
11
|
makeWorkflowKey,
|
|
12
12
|
workflowStoragePrefix
|
|
13
13
|
} from "../chunk-A2CF6PFH.js";
|
|
14
14
|
import {
|
|
15
15
|
stringifyError
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-B5WDVY32.js";
|
|
17
17
|
import {
|
|
18
18
|
RivetError,
|
|
19
19
|
isActorAbortedError
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rivetkit",
|
|
3
|
-
"version": "3.0.1
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Lightweight libraries for building stateful actors on edge platforms",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -211,15 +211,15 @@
|
|
|
211
211
|
"@hono/zod-openapi": "^1.1.5",
|
|
212
212
|
"@opentelemetry/api": "^1.1.0",
|
|
213
213
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
214
|
-
"@rivetkit/engine-api-full": "3.0.1
|
|
215
|
-
"@rivetkit/engine-cli": "3.0.1
|
|
216
|
-
"@rivetkit/engine-envoy-protocol": "3.0.1
|
|
214
|
+
"@rivetkit/engine-api-full": "3.0.1",
|
|
215
|
+
"@rivetkit/engine-cli": "3.0.1",
|
|
216
|
+
"@rivetkit/engine-envoy-protocol": "3.0.1",
|
|
217
217
|
"@rivetkit/on-change": "6.0.1",
|
|
218
|
-
"@rivetkit/rivetkit-napi": "3.0.1
|
|
219
|
-
"@rivetkit/rivetkit-wasm": "3.0.1
|
|
220
|
-
"@rivetkit/traces": "3.0.1
|
|
221
|
-
"@rivetkit/virtual-websocket": "3.0.1
|
|
222
|
-
"@rivetkit/workflow-engine": "3.0.1
|
|
218
|
+
"@rivetkit/rivetkit-napi": "3.0.1",
|
|
219
|
+
"@rivetkit/rivetkit-wasm": "3.0.1",
|
|
220
|
+
"@rivetkit/traces": "3.0.1",
|
|
221
|
+
"@rivetkit/virtual-websocket": "3.0.1",
|
|
222
|
+
"@rivetkit/workflow-engine": "3.0.1",
|
|
223
223
|
"cbor-x": "^1.6.0",
|
|
224
224
|
"drizzle-orm": "0.45.2",
|
|
225
225
|
"hono": "^4.7.0",
|
|
@@ -248,6 +248,9 @@
|
|
|
248
248
|
"vitest": "^3.1.1",
|
|
249
249
|
"ws": "^8.18.1"
|
|
250
250
|
},
|
|
251
|
+
"optionalDependencies": {
|
|
252
|
+
"@rivet-dev/services": "^0.2.5"
|
|
253
|
+
},
|
|
251
254
|
"peerDependencies": {
|
|
252
255
|
"drizzle-kit": "^0.31.2",
|
|
253
256
|
"eventsource": "^4.0.0",
|
package/src/actor/config.ts
CHANGED
|
@@ -200,8 +200,16 @@ export class ActorHandleRaw {
|
|
|
200
200
|
},
|
|
201
201
|
}).send(name, body, options as any);
|
|
202
202
|
} catch (err) {
|
|
203
|
-
const {
|
|
204
|
-
|
|
203
|
+
const {
|
|
204
|
+
group,
|
|
205
|
+
code,
|
|
206
|
+
message,
|
|
207
|
+
metadata,
|
|
208
|
+
rayId,
|
|
209
|
+
actor,
|
|
210
|
+
public: isPublic,
|
|
211
|
+
statusCode,
|
|
212
|
+
} = deconstructError(err, true);
|
|
205
213
|
|
|
206
214
|
if (
|
|
207
215
|
this.#shouldRetryQueueDispatchOverload(
|
|
@@ -272,6 +280,8 @@ export class ActorHandleRaw {
|
|
|
272
280
|
}
|
|
273
281
|
|
|
274
282
|
throw new ActorError(group, code, message, {
|
|
283
|
+
public: isPublic,
|
|
284
|
+
statusCode,
|
|
275
285
|
metadata,
|
|
276
286
|
rayId,
|
|
277
287
|
actor,
|
|
@@ -434,8 +444,16 @@ export class ActorHandleRaw {
|
|
|
434
444
|
}
|
|
435
445
|
return output;
|
|
436
446
|
} catch (err) {
|
|
437
|
-
const {
|
|
438
|
-
|
|
447
|
+
const {
|
|
448
|
+
group,
|
|
449
|
+
code,
|
|
450
|
+
message,
|
|
451
|
+
metadata,
|
|
452
|
+
rayId,
|
|
453
|
+
actor,
|
|
454
|
+
public: isPublic,
|
|
455
|
+
statusCode,
|
|
456
|
+
} = deconstructError(err, true);
|
|
439
457
|
|
|
440
458
|
if (
|
|
441
459
|
await this.#shouldRetrySchedulingError(
|
|
@@ -476,7 +494,13 @@ export class ActorHandleRaw {
|
|
|
476
494
|
"actor",
|
|
477
495
|
"not_found",
|
|
478
496
|
"The actor does not exist or was destroyed.",
|
|
479
|
-
{
|
|
497
|
+
{
|
|
498
|
+
public: true,
|
|
499
|
+
statusCode: 404,
|
|
500
|
+
metadata,
|
|
501
|
+
rayId,
|
|
502
|
+
actor,
|
|
503
|
+
},
|
|
480
504
|
);
|
|
481
505
|
}
|
|
482
506
|
|
|
@@ -498,6 +522,8 @@ export class ActorHandleRaw {
|
|
|
498
522
|
}
|
|
499
523
|
|
|
500
524
|
throw new ActorError(group, code, message, {
|
|
525
|
+
public: isPublic,
|
|
526
|
+
statusCode,
|
|
501
527
|
metadata,
|
|
502
528
|
rayId,
|
|
503
529
|
actor,
|
|
@@ -779,8 +805,16 @@ export class ActorHandleRaw {
|
|
|
779
805
|
}
|
|
780
806
|
return response;
|
|
781
807
|
} catch (err) {
|
|
782
|
-
const {
|
|
783
|
-
|
|
808
|
+
const {
|
|
809
|
+
group,
|
|
810
|
+
code,
|
|
811
|
+
message,
|
|
812
|
+
metadata,
|
|
813
|
+
rayId,
|
|
814
|
+
actor,
|
|
815
|
+
public: isPublic,
|
|
816
|
+
statusCode,
|
|
817
|
+
} = deconstructError(err, true);
|
|
784
818
|
|
|
785
819
|
if (
|
|
786
820
|
await this.#shouldRetrySchedulingError(
|
|
@@ -828,6 +862,8 @@ export class ActorHandleRaw {
|
|
|
828
862
|
}
|
|
829
863
|
|
|
830
864
|
throw new ActorError(group, code, message, {
|
|
865
|
+
public: isPublic,
|
|
866
|
+
statusCode,
|
|
831
867
|
metadata,
|
|
832
868
|
rayId,
|
|
833
869
|
actor,
|
|
@@ -65,7 +65,12 @@ function classifyActorError(
|
|
|
65
65
|
return undefined;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
// `actor.migrating_from_v2` is a refusal while the actor moves in from a V2 cluster; it
|
|
69
|
+
// carries a `retry_after_ms` hint.
|
|
70
|
+
if (
|
|
71
|
+
error.group === "actor" &&
|
|
72
|
+
(error.code === "restarting" || error.code === "migrating_from_v2")
|
|
73
|
+
) {
|
|
69
74
|
return buildLifecycleBoundaryInfo(
|
|
70
75
|
"request_retry",
|
|
71
76
|
"actor_error",
|
package/src/client/raw-utils.ts
CHANGED
|
@@ -129,9 +129,23 @@ export async function rawHttpFetch(
|
|
|
129
129
|
return driver.sendRequest(target, proxyRequest, options);
|
|
130
130
|
} catch (err) {
|
|
131
131
|
// Standardize to ClientActorError instead of the native backend error
|
|
132
|
-
const {
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
const {
|
|
133
|
+
group,
|
|
134
|
+
code,
|
|
135
|
+
message,
|
|
136
|
+
metadata,
|
|
137
|
+
rayId,
|
|
138
|
+
actor,
|
|
139
|
+
public: isPublic,
|
|
140
|
+
statusCode,
|
|
141
|
+
} = deconstructError(err, true);
|
|
142
|
+
throw new ActorError(group, code, message, {
|
|
143
|
+
public: isPublic,
|
|
144
|
+
statusCode,
|
|
145
|
+
metadata,
|
|
146
|
+
rayId,
|
|
147
|
+
actor,
|
|
148
|
+
});
|
|
135
149
|
}
|
|
136
150
|
}
|
|
137
151
|
|
package/src/client/utils.ts
CHANGED
|
@@ -169,6 +169,10 @@ export async function sendHttpRequest<
|
|
|
169
169
|
}),
|
|
170
170
|
);
|
|
171
171
|
} catch (error) {
|
|
172
|
+
// Credential providers and custom transports can already supply a structured error.
|
|
173
|
+
if (ActorError.isRivetError(error)) {
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
172
176
|
throw new HttpRequestError(`Request failed: ${error}`, {
|
|
173
177
|
cause: error,
|
|
174
178
|
});
|
|
@@ -251,8 +251,8 @@ export const RegistryConfigSchema = z
|
|
|
251
251
|
.default(() => getRivetRunEngineVersion() ?? VERSION),
|
|
252
252
|
/**
|
|
253
253
|
* Starts the first-party Services actor host when RivetKit manages
|
|
254
|
-
* a local engine.
|
|
255
|
-
* or startServices:
|
|
254
|
+
* a local engine. Enabled by default for a managed local Engine. Set
|
|
255
|
+
* RIVET_RUN_SERVICES=0 or startServices: false to disable it.
|
|
256
256
|
*/
|
|
257
257
|
startServices: z.boolean().optional(),
|
|
258
258
|
/**
|
|
@@ -369,7 +369,9 @@ export const RegistryConfigSchema = z
|
|
|
369
369
|
? localEngineEndpoint
|
|
370
370
|
: (parsedEndpoint?.endpoint ??
|
|
371
371
|
(isDevEnv ? localEngineEndpoint : undefined));
|
|
372
|
-
const
|
|
372
|
+
const engineSpawn = !parsedEndpoint && Boolean(endpoint);
|
|
373
|
+
const startServices =
|
|
374
|
+
config.startServices ?? getRivetRunServices() ?? engineSpawn;
|
|
373
375
|
const validateServerlessEndpoint = Boolean(
|
|
374
376
|
config.startEngine || parsedEndpoint,
|
|
375
377
|
);
|
|
@@ -419,7 +421,7 @@ export const RegistryConfigSchema = z
|
|
|
419
421
|
...config,
|
|
420
422
|
sqlite,
|
|
421
423
|
endpoint,
|
|
422
|
-
engineSpawn
|
|
424
|
+
engineSpawn,
|
|
423
425
|
startServices,
|
|
424
426
|
namespace,
|
|
425
427
|
token,
|
|
@@ -656,7 +658,7 @@ export const DocRegistryConfigSchema = z
|
|
|
656
658
|
.boolean()
|
|
657
659
|
.optional()
|
|
658
660
|
.describe(
|
|
659
|
-
"Starts Services when RivetKit manages a local Engine.
|
|
661
|
+
"Starts Services when RivetKit manages a local Engine. Enabled by default for a managed local Engine. Set RIVET_RUN_SERVICES=0 or startServices: false to disable.",
|
|
660
662
|
),
|
|
661
663
|
configurePool: DocConfigurePoolSchema.describe(
|
|
662
664
|
"Automatically configure serverless nodes in the engine.",
|
package/src/registry/native.ts
CHANGED
|
@@ -5512,6 +5512,11 @@ export function buildNativeFactory(
|
|
|
5512
5512
|
conn != null
|
|
5513
5513
|
? makeConnCtx(ctx, conn, undefined, cancelToken)
|
|
5514
5514
|
: makeActorCtx(ctx, undefined, cancelToken);
|
|
5515
|
+
if (scheduledFire) {
|
|
5516
|
+
Object.defineProperty(actorCtx, "scheduledFire", {
|
|
5517
|
+
value: scheduledFire,
|
|
5518
|
+
});
|
|
5519
|
+
}
|
|
5515
5520
|
const runAction = async () => {
|
|
5516
5521
|
try {
|
|
5517
5522
|
return encodeValue(
|
|
@@ -5680,7 +5685,7 @@ export function buildNativeFactory(
|
|
|
5680
5685
|
|
|
5681
5686
|
export async function buildServeConfig(
|
|
5682
5687
|
config: RegistryConfig,
|
|
5683
|
-
|
|
5688
|
+
resolveNativeBinaries = true,
|
|
5684
5689
|
): Promise<RuntimeServeConfig> {
|
|
5685
5690
|
if (!config.endpoint) {
|
|
5686
5691
|
throw nativeEndpointNotConfiguredError();
|
|
@@ -5693,7 +5698,7 @@ export async function buildServeConfig(
|
|
|
5693
5698
|
token: config.token,
|
|
5694
5699
|
namespace: config.namespace,
|
|
5695
5700
|
poolName: config.node.poolName,
|
|
5696
|
-
startServices:
|
|
5701
|
+
startServices: resolveNativeBinaries && config.startServices,
|
|
5697
5702
|
handleInspectorHttpInRuntime: true,
|
|
5698
5703
|
serverlessBasePath: config.serverless.basePath,
|
|
5699
5704
|
serverlessPackageVersion: VERSION,
|
|
@@ -5704,28 +5709,30 @@ export async function buildServeConfig(
|
|
|
5704
5709
|
serverlessMaxStartPayloadBytes: config.serverless.maxStartPayloadBytes,
|
|
5705
5710
|
};
|
|
5706
5711
|
|
|
5707
|
-
//
|
|
5708
|
-
// path to the core. The core
|
|
5712
|
+
// For native runtimes, best-effort resolve the npm-installed engine binary
|
|
5713
|
+
// and hand its path to the core. The core decides whether to spawn a local
|
|
5709
5714
|
// engine using the resolved spawn decision, so
|
|
5710
5715
|
// JS must not duplicate that decision here. Only JS knows the npm
|
|
5711
5716
|
// `node_modules` layout, so it resolves the path; if no binary is available
|
|
5712
5717
|
// (remote-only install, unsupported platform, optional deps skipped), leave
|
|
5713
5718
|
// it unset and let the core report `engine.binary_unavailable` if it actually
|
|
5714
5719
|
// needs one.
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5720
|
+
if (resolveNativeBinaries) {
|
|
5721
|
+
try {
|
|
5722
|
+
const { getEnginePath } = await loadEngineCli();
|
|
5723
|
+
serveConfig.engineBinaryPath = getEnginePath();
|
|
5724
|
+
} catch (error) {
|
|
5725
|
+
// The npm-installed engine binary could not be resolved. The core still
|
|
5726
|
+
// decides whether it needs to spawn a local engine; if it does, it will
|
|
5727
|
+
// fail with engine.binary_unavailable (auto-download is off in the napi
|
|
5728
|
+
// runtime). Warn so the cause is actionable.
|
|
5729
|
+
logger().warn({
|
|
5730
|
+
msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable — set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
|
|
5731
|
+
error: stringifyError(error),
|
|
5732
|
+
});
|
|
5733
|
+
}
|
|
5727
5734
|
}
|
|
5728
|
-
if (
|
|
5735
|
+
if (resolveNativeBinaries && config.startServices) {
|
|
5729
5736
|
const servicesBinary = getEnvUniversal("RIVET_SERVICES_BINARY");
|
|
5730
5737
|
if (servicesBinary) {
|
|
5731
5738
|
serveConfig.servicesBinaryPath = servicesBinary;
|
package/src/registry/runtime.ts
CHANGED
|
@@ -885,7 +885,7 @@ export interface RuntimeBundle {
|
|
|
885
885
|
|
|
886
886
|
export function servicesBinaryUnavailable(cause: unknown): Error {
|
|
887
887
|
return new Error(
|
|
888
|
-
"services.binary_unavailable: Install @rivet-dev/services
|
|
888
|
+
"services.binary_unavailable: Install @rivet-dev/services to run local Services, set RIVET_SERVICES_BINARY to its executable path, or set RIVET_RUN_SERVICES=0 to disable Services.",
|
|
889
889
|
{ cause },
|
|
890
890
|
);
|
|
891
891
|
}
|
package/src/utils/env-vars.ts
CHANGED
|
@@ -30,8 +30,10 @@ export const getRivetRunEnginePort = (): number | undefined => {
|
|
|
30
30
|
};
|
|
31
31
|
export const getRivetRunEngineVersion = (): string | undefined =>
|
|
32
32
|
getEnvUniversal("RIVET_RUN_ENGINE_VERSION");
|
|
33
|
-
export const getRivetRunServices = (): boolean =>
|
|
34
|
-
getEnvUniversal("RIVET_RUN_SERVICES")
|
|
33
|
+
export const getRivetRunServices = (): boolean | undefined => {
|
|
34
|
+
const value = getEnvUniversal("RIVET_RUN_SERVICES");
|
|
35
|
+
return value === undefined ? undefined : value === "1";
|
|
36
|
+
};
|
|
35
37
|
export const getRivetEnvoyKind = (): string | undefined =>
|
|
36
38
|
getEnvUniversal("RIVET_NODE_KIND") ?? getEnvUniversal("RIVET_ENVOY_KIND");
|
|
37
39
|
export const getRivetEnvoyVersion = (): number | undefined => {
|