rivetkit 0.0.0-codex-fix-engine-ui-build-base.aec1405 → 0.0.0-codex-rivetkit-cli-preview.e0b3ae0
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 +16 -0
- package/dist/browser/client.js +2 -2
- 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.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/agent-os/index.cjs +1 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +16 -0
- package/dist/tsup/agent-os/index.d.ts +16 -0
- package/dist/tsup/agent-os/index.js +1 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-ZSJVOE76.cjs → chunk-3LC3BY25.cjs} +7 -7
- package/dist/tsup/{chunk-ZSJVOE76.cjs.map → chunk-3LC3BY25.cjs.map} +1 -1
- package/dist/tsup/{chunk-PT6PN7RZ.js → chunk-3NZLRLYI.js} +3 -3
- package/dist/tsup/{chunk-DCAQEZO6.cjs → chunk-5HPDYH2D.cjs} +10 -3
- package/dist/tsup/chunk-5HPDYH2D.cjs.map +1 -0
- package/dist/tsup/{chunk-IFMTKFQV.js → chunk-67DIWJVD.js} +4 -4
- package/dist/tsup/{chunk-HAEJDJSQ.cjs → chunk-7XEVE6NM.cjs} +4 -4
- package/dist/tsup/{chunk-HAEJDJSQ.cjs.map → chunk-7XEVE6NM.cjs.map} +1 -1
- package/dist/tsup/{chunk-F454HCI7.js → chunk-AWIPTEN7.js} +9 -2
- package/dist/tsup/chunk-AWIPTEN7.js.map +1 -0
- package/dist/tsup/{chunk-CMJVDEDE.js → chunk-BSA37OX7.js} +2 -2
- package/dist/tsup/{chunk-SZHZSNPS.cjs → chunk-CSJI7IRZ.cjs} +5 -5
- package/dist/tsup/{chunk-SZHZSNPS.cjs.map → chunk-CSJI7IRZ.cjs.map} +1 -1
- package/dist/tsup/{chunk-2WQQZFYZ.js → chunk-DPIMKYNB.js} +1 -1
- package/dist/tsup/chunk-DPIMKYNB.js.map +1 -0
- package/dist/tsup/{chunk-RGV6A7NC.cjs → chunk-ERIDC7PA.cjs} +3 -3
- package/dist/tsup/{chunk-RGV6A7NC.cjs.map → chunk-ERIDC7PA.cjs.map} +1 -1
- package/dist/tsup/{chunk-KR36C74E.cjs → chunk-NIOC52DM.cjs} +10 -10
- package/dist/tsup/{chunk-KR36C74E.cjs.map → chunk-NIOC52DM.cjs.map} +1 -1
- package/dist/tsup/{chunk-MWNKF5OP.cjs → chunk-NIY3RSPX.cjs} +1 -1
- package/dist/tsup/chunk-NIY3RSPX.cjs.map +1 -0
- package/dist/tsup/{chunk-EUIYU7BE.js → chunk-PNMCWNDX.js} +2 -2
- package/dist/tsup/{chunk-DF4LSVO4.js → chunk-RYFFWSOD.js} +5 -5
- package/dist/tsup/{chunk-DF4LSVO4.js.map → chunk-RYFFWSOD.js.map} +1 -1
- package/dist/tsup/{chunk-PAL2SCK4.cjs → chunk-UUMTOQPC.cjs} +140 -140
- package/dist/tsup/{chunk-PAL2SCK4.cjs.map → chunk-UUMTOQPC.cjs.map} +1 -1
- package/dist/tsup/{chunk-IB3DGSJZ.js → chunk-WCSMKOHR.js} +2 -2
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +3 -3
- package/dist/tsup/client/mod.d.ts +3 -3
- package/dist/tsup/client/mod.js +5 -5
- 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-DJU_K3QZ.d.ts → config-BxWAw3iH.d.ts} +17 -1
- package/dist/tsup/{config-B7TlE3x5.d.cts → config-CZQQ-mso.d.cts} +17 -1
- package/dist/tsup/{context-CWRUBQJc.d.cts → context-Bw7xq8w3.d.cts} +1 -1
- package/dist/tsup/{context-BsCziuYX.d.ts → context-D8QA76sV.d.ts} +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- 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-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +130 -79
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +63 -12
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +9 -9
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/{utils-DVekpm4I.d.cts → utils-DQosb24I.d.cts} +1 -1
- package/dist/tsup/{utils-DVekpm4I.d.ts → utils-DQosb24I.d.ts} +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.d.cts +1 -1
- package/dist/tsup/utils.d.ts +1 -1
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +11 -11
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +8 -8
- package/src/actor/config.ts +8 -0
- package/src/actor/instance/mod.ts +4 -4
- package/src/actor/mod.ts +2 -0
- package/src/common/engine.ts +28 -1
- package/src/engine-client/actor-http-client.ts +2 -2
- package/src/registry/config/index.ts +37 -7
- package/src/registry/index.ts +4 -2
- package/src/registry/native.ts +37 -7
- package/src/registry/runtime.ts +4 -0
- package/src/utils/env-vars.ts +6 -0
- package/dist/tsup/chunk-2WQQZFYZ.js.map +0 -1
- package/dist/tsup/chunk-DCAQEZO6.cjs.map +0 -1
- package/dist/tsup/chunk-F454HCI7.js.map +0 -1
- package/dist/tsup/chunk-MWNKF5OP.cjs.map +0 -1
- /package/dist/tsup/{chunk-PT6PN7RZ.js.map → chunk-3NZLRLYI.js.map} +0 -0
- /package/dist/tsup/{chunk-IFMTKFQV.js.map → chunk-67DIWJVD.js.map} +0 -0
- /package/dist/tsup/{chunk-CMJVDEDE.js.map → chunk-BSA37OX7.js.map} +0 -0
- /package/dist/tsup/{chunk-EUIYU7BE.js.map → chunk-PNMCWNDX.js.map} +0 -0
- /package/dist/tsup/{chunk-IB3DGSJZ.js.map → chunk-WCSMKOHR.js.map} +0 -0
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
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 _chunk3LC3BY25cjs = require('../chunk-3LC3BY25.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkUUMTOQPCcjs = require('../chunk-UUMTOQPC.cjs');
|
|
8
8
|
require('../chunk-VE2X4KMG.cjs');
|
|
9
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-CSJI7IRZ.cjs');
|
|
10
10
|
require('../chunk-ZA7FLHKH.cjs');
|
|
11
|
-
require('../chunk-
|
|
12
|
-
require('../chunk-
|
|
11
|
+
require('../chunk-ERIDC7PA.cjs');
|
|
12
|
+
require('../chunk-5HPDYH2D.cjs');
|
|
13
13
|
require('../chunk-KORQB2IR.cjs');
|
|
14
14
|
|
|
15
15
|
// src/test/mod.ts
|
|
16
16
|
var _pretry = require('p-retry'); var _pretry2 = _interopRequireDefault(_pretry);
|
|
17
17
|
async function waitForRegistryReady(registry) {
|
|
18
|
-
const clientConfig =
|
|
18
|
+
const clientConfig = _chunkUUMTOQPCcjs.convertRegistryConfigToClientConfig.call(void 0,
|
|
19
19
|
registry.parseConfig()
|
|
20
20
|
);
|
|
21
21
|
await _pretry2.default.call(void 0,
|
|
22
22
|
async () => {
|
|
23
|
-
await
|
|
23
|
+
await _chunkUUMTOQPCcjs.getMetadata.call(void 0, clientConfig);
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
retries: 20,
|
|
@@ -34,8 +34,8 @@ async function setupTest(c, registry) {
|
|
|
34
34
|
registry.config.noWelcome = true;
|
|
35
35
|
registry.start();
|
|
36
36
|
await waitForRegistryReady(registry);
|
|
37
|
-
const client =
|
|
38
|
-
...
|
|
37
|
+
const client = _chunk3LC3BY25cjs.createClient.call(void 0, {
|
|
38
|
+
..._chunkUUMTOQPCcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
|
|
39
39
|
disableMetadataLookup: false
|
|
40
40
|
});
|
|
41
41
|
c.onTestFinished(async () => {
|
package/dist/tsup/test/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import { ax as Registry, _ as Client } from '../config-
|
|
2
|
+
import { ax as Registry, _ as Client } from '../config-CZQQ-mso.cjs';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-D49x8NpL.cjs';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
|
@@ -9,7 +9,7 @@ import '@rivetkit/virtual-websocket';
|
|
|
9
9
|
import '@standard-schema/spec';
|
|
10
10
|
import 'hono';
|
|
11
11
|
import '../utils.cjs';
|
|
12
|
-
import '../utils-
|
|
12
|
+
import '../utils-DQosb24I.cjs';
|
|
13
13
|
import 'hono/utils/http-status';
|
|
14
14
|
|
|
15
15
|
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 { ax as Registry, _ as Client } from '../config-
|
|
2
|
+
import { ax as Registry, _ as Client } from '../config-BxWAw3iH.js';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-D49x8NpL.js';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
|
@@ -9,7 +9,7 @@ import '@rivetkit/virtual-websocket';
|
|
|
9
9
|
import '@standard-schema/spec';
|
|
10
10
|
import 'hono';
|
|
11
11
|
import '../utils.js';
|
|
12
|
-
import '../utils-
|
|
12
|
+
import '../utils-DQosb24I.js';
|
|
13
13
|
import 'hono/utils/http-status';
|
|
14
14
|
|
|
15
15
|
interface SetupTestResult<A extends Registry<any>> {
|
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3NZLRLYI.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig,
|
|
6
6
|
getMetadata
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-RYFFWSOD.js";
|
|
8
8
|
import "../chunk-HXUEHHJF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-WCSMKOHR.js";
|
|
10
10
|
import "../chunk-JZ7TWV65.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-PNMCWNDX.js";
|
|
12
|
+
import "../chunk-AWIPTEN7.js";
|
|
13
13
|
import "../chunk-BRP62GZC.js";
|
|
14
14
|
|
|
15
15
|
// src/test/mod.ts
|
|
@@ -100,4 +100,4 @@ declare function stringifyError(error: unknown): string;
|
|
|
100
100
|
/** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */
|
|
101
101
|
declare function noopNext(): Next;
|
|
102
102
|
|
|
103
|
-
export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type
|
|
103
|
+
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, isRivetErrorCode as v, isRivetErrorLike as w, toRivetError as x, unsupportedFeature as y };
|
|
@@ -100,4 +100,4 @@ declare function stringifyError(error: unknown): string;
|
|
|
100
100
|
/** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */
|
|
101
101
|
declare function noopNext(): Next;
|
|
102
102
|
|
|
103
|
-
export { type ActorRestartingOptions as A, BRIDGE_RIVET_ERROR_PREFIX as B, INTERNAL_ERROR_CODE as I, RivetError as R, UserError as U, type
|
|
103
|
+
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, isRivetErrorCode as v, isRivetErrorLike as w, toRivetError as x, unsupportedFeature as y };
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk5HPDYH2Dcjs = require('./chunk-5HPDYH2D.cjs');
|
|
21
21
|
require('./chunk-KORQB2IR.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
@@ -38,5 +38,5 @@ require('./chunk-KORQB2IR.cjs');
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
exports.EXTRA_ERROR_LOG =
|
|
41
|
+
exports.EXTRA_ERROR_LOG = _chunk5HPDYH2Dcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunk5HPDYH2Dcjs.SinglePromiseQueue; exports.VERSION = _chunk5HPDYH2Dcjs.VERSION; exports.arrayBuffersEqual = _chunk5HPDYH2Dcjs.arrayBuffersEqual; exports.assertUnreachable = _chunk5HPDYH2Dcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunk5HPDYH2Dcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunk5HPDYH2Dcjs.combineUrlPath; exports.dbg = _chunk5HPDYH2Dcjs.dbg; exports.detectRuntime = _chunk5HPDYH2Dcjs.detectRuntime; exports.getEnvUniversal = _chunk5HPDYH2Dcjs.getEnvUniversal; exports.httpUserAgent = _chunk5HPDYH2Dcjs.httpUserAgent; exports.interval = _chunk5HPDYH2Dcjs.interval; exports.joinSignals = _chunk5HPDYH2Dcjs.joinSignals; exports.promiseWithResolvers = _chunk5HPDYH2Dcjs.promiseWithResolvers; exports.setLongTimeout = _chunk5HPDYH2Dcjs.setLongTimeout; exports.sleep = _chunk5HPDYH2Dcjs.sleep; exports.stringifyError = _chunk5HPDYH2Dcjs.stringifyError; exports.toUint8Array = _chunk5HPDYH2Dcjs.toUint8Array;
|
|
42
42
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/tsup/utils.d.cts
CHANGED
package/dist/tsup/utils.d.ts
CHANGED
package/dist/tsup/utils.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkNIOC52DMcjs = require('../chunk-NIOC52DM.cjs');
|
|
4
|
+
require('../chunk-7XEVE6NM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNIY3RSPXcjs = require('../chunk-NIY3RSPX.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkVE2X4KMGcjs = require('../chunk-VE2X4KMG.cjs');
|
|
14
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-CSJI7IRZ.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk5HPDYH2Dcjs = require('../chunk-5HPDYH2D.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunkKORQB2IRcjs = require('../chunk-KORQB2IR.cjs');
|
|
@@ -284,7 +284,7 @@ var ActorWorkflowContext = class _ActorWorkflowContext {
|
|
|
284
284
|
async #withActorAccessAndStateRollback(run) {
|
|
285
285
|
let stateSnapshot = null;
|
|
286
286
|
try {
|
|
287
|
-
stateSnapshot = { state: this.#runCtx[
|
|
287
|
+
stateSnapshot = { state: this.#runCtx[_chunkNIY3RSPXcjs.RAW_STATE_SYMBOL]() };
|
|
288
288
|
} catch (error) {
|
|
289
289
|
this.#runCtx.log.debug({
|
|
290
290
|
msg: "failed to get state, likely due to being stateless workflow",
|
|
@@ -639,13 +639,13 @@ function workflow(fn, options = {}) {
|
|
|
639
639
|
function getWorkflowInspector(actorId) {
|
|
640
640
|
let workflowInspector = workflowInspectors.get(actorId);
|
|
641
641
|
if (!workflowInspector) {
|
|
642
|
-
workflowInspector =
|
|
642
|
+
workflowInspector = _chunkNIOC52DMcjs.createWorkflowInspectorAdapter.call(void 0, );
|
|
643
643
|
workflowInspectors.set(actorId, workflowInspector);
|
|
644
644
|
}
|
|
645
645
|
return workflowInspector;
|
|
646
646
|
}
|
|
647
647
|
async function run(runCtx) {
|
|
648
|
-
const actor = runCtx[
|
|
648
|
+
const actor = runCtx[_chunkNIY3RSPXcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL];
|
|
649
649
|
_invariant2.default.call(void 0, actor, "workflow() requires an actor instance");
|
|
650
650
|
const workflowInspector = getWorkflowInspector(actor.id);
|
|
651
651
|
const driver = new ActorWorkflowDriver(actor, runCtx);
|
|
@@ -705,20 +705,20 @@ function workflow(fn, options = {}) {
|
|
|
705
705
|
if (shouldRethrowWorkflowError(error)) {
|
|
706
706
|
runCtx.log.error({
|
|
707
707
|
msg: "workflow run failed",
|
|
708
|
-
error:
|
|
708
|
+
error: _chunk5HPDYH2Dcjs.stringifyError.call(void 0, error)
|
|
709
709
|
});
|
|
710
710
|
throw error;
|
|
711
711
|
}
|
|
712
712
|
runCtx.log.warn({
|
|
713
713
|
msg: "workflow failed and will sleep until woken",
|
|
714
|
-
error:
|
|
714
|
+
error: _chunk5HPDYH2Dcjs.stringifyError.call(void 0, error)
|
|
715
715
|
});
|
|
716
716
|
} finally {
|
|
717
717
|
runCtx.abortSignal.removeEventListener("abort", onAbort);
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
const runWithConfig = run;
|
|
721
|
-
runWithConfig[
|
|
721
|
+
runWithConfig[_chunkNIY3RSPXcjs.RUN_FUNCTION_CONFIG_SYMBOL] = {
|
|
722
722
|
icon: "diagram-project",
|
|
723
723
|
inspectorFactory: (actor) => {
|
|
724
724
|
const actorId = resolveWorkflowInspectorActorId(actor);
|
|
@@ -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-CZQQ-mso.cjs';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-D49x8NpL.cjs';
|
|
5
|
-
import { A as ActorWorkflowContext } from '../context-
|
|
6
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-
|
|
5
|
+
import { A as ActorWorkflowContext } from '../context-Bw7xq8w3.cjs';
|
|
6
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-Bw7xq8w3.cjs';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -12,7 +12,7 @@ import '@rivetkit/virtual-websocket';
|
|
|
12
12
|
import '@standard-schema/spec';
|
|
13
13
|
import 'hono';
|
|
14
14
|
import '../utils.cjs';
|
|
15
|
-
import '../utils-
|
|
15
|
+
import '../utils-DQosb24I.cjs';
|
|
16
16
|
import 'hono/utils/http-status';
|
|
17
17
|
|
|
18
18
|
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-BxWAw3iH.js';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-D49x8NpL.js';
|
|
5
|
-
import { A as ActorWorkflowContext } from '../context-
|
|
6
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-
|
|
5
|
+
import { A as ActorWorkflowContext } from '../context-D8QA76sV.js';
|
|
6
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from '../context-D8QA76sV.js';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -12,7 +12,7 @@ import '@rivetkit/virtual-websocket';
|
|
|
12
12
|
import '@standard-schema/spec';
|
|
13
13
|
import 'hono';
|
|
14
14
|
import '../utils.js';
|
|
15
|
-
import '../utils-
|
|
15
|
+
import '../utils-DQosb24I.js';
|
|
16
16
|
import 'hono/utils/http-status';
|
|
17
17
|
|
|
18
18
|
interface WorkflowOptions<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-67DIWJVD.js";
|
|
4
|
+
import "../chunk-BSA37OX7.js";
|
|
5
5
|
import {
|
|
6
6
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
7
7
|
RAW_STATE_SYMBOL,
|
|
8
8
|
RUN_FUNCTION_CONFIG_SYMBOL
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-DPIMKYNB.js";
|
|
10
10
|
import {
|
|
11
11
|
makeWorkflowKey,
|
|
12
12
|
workflowStoragePrefix
|
|
13
13
|
} from "../chunk-HXUEHHJF.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-WCSMKOHR.js";
|
|
15
15
|
import {
|
|
16
16
|
stringifyError
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-AWIPTEN7.js";
|
|
18
18
|
import {
|
|
19
19
|
RivetError
|
|
20
20
|
} from "../chunk-BRP62GZC.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rivetkit",
|
|
3
|
-
"version": "0.0.0-codex-
|
|
3
|
+
"version": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
4
4
|
"description": "Lightweight libraries for building stateful actors on edge platforms",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -193,14 +193,14 @@
|
|
|
193
193
|
"@hono/zod-openapi": "^1.1.5",
|
|
194
194
|
"@rivet-dev/agent-os-core": "^0.1.1",
|
|
195
195
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
196
|
-
"@rivetkit/engine-cli": "0.0.0-codex-
|
|
197
|
-
"@rivetkit/engine-envoy-protocol": "0.0.0-codex-
|
|
196
|
+
"@rivetkit/engine-cli": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
197
|
+
"@rivetkit/engine-envoy-protocol": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
198
198
|
"@rivetkit/on-change": "6.0.1",
|
|
199
|
-
"@rivetkit/rivetkit-napi": "0.0.0-codex-
|
|
200
|
-
"@rivetkit/rivetkit-wasm": "0.0.0-codex-
|
|
201
|
-
"@rivetkit/traces": "0.0.0-codex-
|
|
202
|
-
"@rivetkit/virtual-websocket": "0.0.0-codex-
|
|
203
|
-
"@rivetkit/workflow-engine": "0.0.0-codex-
|
|
199
|
+
"@rivetkit/rivetkit-napi": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
200
|
+
"@rivetkit/rivetkit-wasm": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
201
|
+
"@rivetkit/traces": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
202
|
+
"@rivetkit/virtual-websocket": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
203
|
+
"@rivetkit/workflow-engine": "0.0.0-codex-rivetkit-cli-preview.e0b3ae0",
|
|
204
204
|
"cbor-x": "^1.6.0",
|
|
205
205
|
"drizzle-orm": "^0.44.2",
|
|
206
206
|
"get-port": "^7.1.0",
|
package/src/actor/config.ts
CHANGED
|
@@ -62,6 +62,10 @@ type ActorKvListOptions<
|
|
|
62
62
|
|
|
63
63
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db` / `c.sql`)
|
|
67
|
+
* or actor state instead.
|
|
68
|
+
*/
|
|
65
69
|
export interface ActorKv {
|
|
66
70
|
get<T extends ActorKvValueType = "text">(
|
|
67
71
|
key: Uint8Array | string,
|
|
@@ -305,6 +309,10 @@ export interface ActorContext<
|
|
|
305
309
|
[RAW_STATE_SYMBOL](): TState;
|
|
306
310
|
state: TState;
|
|
307
311
|
vars: TVars;
|
|
312
|
+
/**
|
|
313
|
+
* @deprecated Actor KV is deprecated. Use embedded SQLite (`db` / `sql`)
|
|
314
|
+
* or actor state instead.
|
|
315
|
+
*/
|
|
308
316
|
readonly kv: ActorKv;
|
|
309
317
|
readonly db: InferDatabaseClient<TDatabase>;
|
|
310
318
|
readonly schedule: ActorSchedule;
|
|
@@ -1637,10 +1637,10 @@ export class ActorInstance<
|
|
|
1637
1637
|
attributes?: Record<string, unknown>,
|
|
1638
1638
|
): Record<string, unknown> {
|
|
1639
1639
|
return {
|
|
1640
|
-
"rivet.actor.id": this.#actorId,
|
|
1641
|
-
"rivet.actor.name": this.#name,
|
|
1642
|
-
"rivet.actor.key": this.#actorKeyString,
|
|
1643
|
-
"rivet.actor.region": this.#region,
|
|
1640
|
+
"rivet.actors.actor.id": this.#actorId,
|
|
1641
|
+
"rivet.actors.actor.name": this.#name,
|
|
1642
|
+
"rivet.actors.actor.key": this.#actorKeyString,
|
|
1643
|
+
"rivet.actors.actor.region": this.#region,
|
|
1644
1644
|
...(attributes ?? {}),
|
|
1645
1645
|
};
|
|
1646
1646
|
}
|
package/src/actor/mod.ts
CHANGED
package/src/common/engine.ts
CHANGED
|
@@ -1,2 +1,29 @@
|
|
|
1
|
+
export const ENGINE_HOST = "127.0.0.1";
|
|
1
2
|
export const ENGINE_PORT = 6420;
|
|
2
|
-
export const ENGINE_ENDPOINT =
|
|
3
|
+
export const ENGINE_ENDPOINT = buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT);
|
|
4
|
+
|
|
5
|
+
export function buildEngineEndpoint(host: string, port: number): string {
|
|
6
|
+
const urlHost =
|
|
7
|
+
host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
8
|
+
return `http://${urlHost}:${port}`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isLocalEngineEndpoint(endpoint: string): boolean {
|
|
12
|
+
let url: URL;
|
|
13
|
+
try {
|
|
14
|
+
url = new URL(endpoint);
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const hostname = url.hostname.toLowerCase();
|
|
20
|
+
return (
|
|
21
|
+
hostname === "localhost" ||
|
|
22
|
+
hostname === "0.0.0.0" ||
|
|
23
|
+
hostname === "::" ||
|
|
24
|
+
hostname === "[::]" ||
|
|
25
|
+
hostname === "::1" ||
|
|
26
|
+
hostname === "[::1]" ||
|
|
27
|
+
/^127(?:\.\d{1,3}){0,3}$/.test(hostname)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -34,9 +34,9 @@ export async function sendHttpRequestToGateway(
|
|
|
34
34
|
bodyToSend = reqBody;
|
|
35
35
|
|
|
36
36
|
// If this is a streaming request, we need to convert the headers
|
|
37
|
-
// for the basic array buffer
|
|
37
|
+
// for the basic array buffer.
|
|
38
38
|
guardHeaders.delete("transfer-encoding");
|
|
39
|
-
guardHeaders.
|
|
39
|
+
guardHeaders.delete("content-length");
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
queueMetadataKey,
|
|
11
11
|
workflowStoragePrefix,
|
|
12
12
|
} from "@/actor/keys";
|
|
13
|
-
import {
|
|
13
|
+
import { buildEngineEndpoint, ENGINE_HOST, ENGINE_PORT } from "@/common/engine";
|
|
14
14
|
import { type Logger, LogLevelSchema } from "@/common/log";
|
|
15
15
|
import { VERSION } from "@/utils";
|
|
16
16
|
import { tryParseEndpoint } from "@/utils/endpoint-parser";
|
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
getRivetkitRuntime,
|
|
21
21
|
getRivetNamespace,
|
|
22
22
|
getRivetRunEngine,
|
|
23
|
+
getRivetRunEngineHost,
|
|
24
|
+
getRivetRunEnginePort,
|
|
23
25
|
getRivetRunEngineVersion,
|
|
24
26
|
getRivetToken,
|
|
25
27
|
isDev,
|
|
@@ -224,6 +226,27 @@ export const RegistryConfigSchema = z
|
|
|
224
226
|
* Starts the full Rust engine process locally.
|
|
225
227
|
*/
|
|
226
228
|
startEngine: z.boolean().default(() => getRivetRunEngine()),
|
|
229
|
+
/**
|
|
230
|
+
* @experimental
|
|
231
|
+
*
|
|
232
|
+
* Host to bind the spawned local engine process to.
|
|
233
|
+
*/
|
|
234
|
+
engineHost: z
|
|
235
|
+
.string()
|
|
236
|
+
.optional()
|
|
237
|
+
.default(() => getRivetRunEngineHost() ?? ENGINE_HOST),
|
|
238
|
+
/**
|
|
239
|
+
* @experimental
|
|
240
|
+
*
|
|
241
|
+
* Port to bind the spawned local engine process to.
|
|
242
|
+
*/
|
|
243
|
+
enginePort: z
|
|
244
|
+
.number()
|
|
245
|
+
.int()
|
|
246
|
+
.min(1)
|
|
247
|
+
.max(65_535)
|
|
248
|
+
.optional()
|
|
249
|
+
.default(() => getRivetRunEnginePort() ?? ENGINE_PORT),
|
|
227
250
|
/** @experimental */
|
|
228
251
|
engineVersion: z
|
|
229
252
|
.string()
|
|
@@ -312,7 +335,9 @@ export const RegistryConfigSchema = z
|
|
|
312
335
|
})
|
|
313
336
|
: undefined;
|
|
314
337
|
|
|
315
|
-
//
|
|
338
|
+
// RIVET_ENDPOINT configures what RivetKit connects to. Use
|
|
339
|
+
// engineHost/enginePort (or RIVET_RUN_ENGINE_HOST/PORT) to control the
|
|
340
|
+
// spawned local engine bind address.
|
|
316
341
|
if (config.startEngine && parsedEndpoint) {
|
|
317
342
|
ctx.addIssue({
|
|
318
343
|
code: "custom",
|
|
@@ -329,12 +354,17 @@ export const RegistryConfigSchema = z
|
|
|
329
354
|
});
|
|
330
355
|
}
|
|
331
356
|
|
|
332
|
-
// Flatten the endpoint and apply defaults for namespace/token
|
|
333
|
-
|
|
357
|
+
// Flatten the endpoint and apply defaults for namespace/token.
|
|
358
|
+
const localEngineEndpoint = buildEngineEndpoint(
|
|
359
|
+
config.engineHost,
|
|
360
|
+
config.enginePort,
|
|
361
|
+
);
|
|
334
362
|
const endpoint = config.startEngine
|
|
335
|
-
?
|
|
363
|
+
? localEngineEndpoint
|
|
336
364
|
: (parsedEndpoint?.endpoint ??
|
|
337
|
-
(isDevEnv
|
|
365
|
+
(isDevEnv
|
|
366
|
+
? buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT)
|
|
367
|
+
: undefined));
|
|
338
368
|
const validateServerlessEndpoint = Boolean(
|
|
339
369
|
config.startEngine || parsedEndpoint,
|
|
340
370
|
);
|
|
@@ -367,7 +397,7 @@ export const RegistryConfigSchema = z
|
|
|
367
397
|
// In dev mode, clients connect directly to the local Rivet Engine.
|
|
368
398
|
const publicEndpoint =
|
|
369
399
|
parsedPublicEndpoint?.endpoint ??
|
|
370
|
-
(isDevEnv && config.startEngine ?
|
|
400
|
+
(isDevEnv && config.startEngine ? endpoint : undefined);
|
|
371
401
|
// We extract publicNamespace to validate that it matches the backend
|
|
372
402
|
// namespace (see validation above), not for functional use.
|
|
373
403
|
const publicNamespace = parsedPublicEndpoint?.namespace;
|
package/src/registry/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import {
|
|
2
|
+
import { isLocalEngineEndpoint } from "@/common/engine";
|
|
3
3
|
import { configureServerlessPool } from "@/serverless/configure";
|
|
4
4
|
import { detectRuntime, VERSION } from "@/utils";
|
|
5
5
|
import { crossPlatformServe, loadRuntimeServeStatic } from "@/utils/serve";
|
|
@@ -700,7 +700,9 @@ export class Registry<A extends RegistryActors> {
|
|
|
700
700
|
|
|
701
701
|
if (config.endpoint) {
|
|
702
702
|
const endpointType =
|
|
703
|
-
config.
|
|
703
|
+
config.startEngine || isLocalEngineEndpoint(config.endpoint)
|
|
704
|
+
? "local native"
|
|
705
|
+
: "remote";
|
|
704
706
|
logLine("Endpoint", `${config.endpoint} (${endpointType})`);
|
|
705
707
|
}
|
|
706
708
|
|
package/src/registry/native.ts
CHANGED
|
@@ -630,6 +630,14 @@ function encodeValue(value: unknown): RuntimeBytes {
|
|
|
630
630
|
return encodeCborCompat(value as JsonCompatValue);
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
+
function normalizeArgs(value: unknown): unknown[] {
|
|
634
|
+
return Array.isArray(value)
|
|
635
|
+
? value
|
|
636
|
+
: value === undefined || value === null
|
|
637
|
+
? []
|
|
638
|
+
: [value];
|
|
639
|
+
}
|
|
640
|
+
|
|
633
641
|
function unwrapTsfnPayload<T>(error: unknown, payload: T): T {
|
|
634
642
|
if (error !== null && error !== undefined) {
|
|
635
643
|
throw error;
|
|
@@ -1096,11 +1104,7 @@ function wrapNativeCallback<Args extends Array<unknown>, Result>(
|
|
|
1096
1104
|
|
|
1097
1105
|
function decodeArgs(value?: RuntimeBytes | null): unknown[] {
|
|
1098
1106
|
const decoded = decodeValue<unknown>(value);
|
|
1099
|
-
return
|
|
1100
|
-
? decoded
|
|
1101
|
-
: decoded === undefined
|
|
1102
|
-
? []
|
|
1103
|
-
: [decoded];
|
|
1107
|
+
return normalizeArgs(decoded);
|
|
1104
1108
|
}
|
|
1105
1109
|
|
|
1106
1110
|
function buildRequest(init: {
|
|
@@ -3837,14 +3841,38 @@ export function buildNativeFactory(
|
|
|
3837
3841
|
404,
|
|
3838
3842
|
);
|
|
3839
3843
|
}
|
|
3840
|
-
const body = (await jsRequest.json()) as {
|
|
3844
|
+
const body = (await jsRequest.json()) as {
|
|
3845
|
+
args?: unknown;
|
|
3846
|
+
properties?: unknown;
|
|
3847
|
+
};
|
|
3848
|
+
if (body.args !== undefined && body.properties !== undefined) {
|
|
3849
|
+
return jsonResponse(
|
|
3850
|
+
{ error: "use either args or properties, not both" },
|
|
3851
|
+
{ status: 400 },
|
|
3852
|
+
);
|
|
3853
|
+
}
|
|
3854
|
+
if (
|
|
3855
|
+
body.properties !== undefined &&
|
|
3856
|
+
(body.properties === null ||
|
|
3857
|
+
typeof body.properties !== "object" ||
|
|
3858
|
+
Array.isArray(body.properties))
|
|
3859
|
+
) {
|
|
3860
|
+
return jsonResponse(
|
|
3861
|
+
{ error: "properties must be an object" },
|
|
3862
|
+
{ status: 400 },
|
|
3863
|
+
);
|
|
3864
|
+
}
|
|
3865
|
+
const args =
|
|
3866
|
+
body.properties !== undefined
|
|
3867
|
+
? [body.properties]
|
|
3868
|
+
: normalizeArgs(body.args);
|
|
3841
3869
|
try {
|
|
3842
3870
|
const output = await action(
|
|
3843
3871
|
actorCtx,
|
|
3844
3872
|
...validateActionArgs(
|
|
3845
3873
|
schemaConfig.actionInputSchemas,
|
|
3846
3874
|
actionName,
|
|
3847
|
-
|
|
3875
|
+
args,
|
|
3848
3876
|
),
|
|
3849
3877
|
);
|
|
3850
3878
|
return jsonResponse({ output });
|
|
@@ -4731,6 +4759,8 @@ export async function buildServeConfig(
|
|
|
4731
4759
|
if (config.startEngine) {
|
|
4732
4760
|
const { getEnginePath } = await loadEngineCli();
|
|
4733
4761
|
serveConfig.engineBinaryPath = getEnginePath();
|
|
4762
|
+
serveConfig.engineHost = config.engineHost;
|
|
4763
|
+
serveConfig.enginePort = config.enginePort;
|
|
4734
4764
|
}
|
|
4735
4765
|
if (config.test?.enabled) {
|
|
4736
4766
|
serveConfig.inspectorTestToken =
|
package/src/registry/runtime.ts
CHANGED
|
@@ -250,6 +250,8 @@ export interface RuntimeServeConfig {
|
|
|
250
250
|
namespace: string;
|
|
251
251
|
poolName: string;
|
|
252
252
|
engineBinaryPath?: string;
|
|
253
|
+
engineHost?: string;
|
|
254
|
+
enginePort?: number;
|
|
253
255
|
handleInspectorHttpInRuntime?: boolean;
|
|
254
256
|
inspectorTestToken?: string;
|
|
255
257
|
serverlessBasePath?: string;
|
|
@@ -599,6 +601,8 @@ export async function buildServeConfig(
|
|
|
599
601
|
|
|
600
602
|
if (config.startEngine) {
|
|
601
603
|
serveConfig.engineBinaryPath = await loadEnginePath();
|
|
604
|
+
serveConfig.engineHost = config.engineHost;
|
|
605
|
+
serveConfig.enginePort = config.enginePort;
|
|
602
606
|
}
|
|
603
607
|
if (config.test?.enabled) {
|
|
604
608
|
serveConfig.inspectorTestToken =
|