rivetkit 0.0.0-feat-sqlite-sync.32022a9 → 0.0.0-feat-sqlite-sync-3x.a00b07f
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 +58 -9
- package/dist/browser/client.js +193 -23
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -5
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +3 -2652
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +1 -2758
- package/dist/tsup/agent-os/index.d.ts +1 -2758
- package/dist/tsup/agent-os/index.js +3 -2652
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-6ZHUGY2E.cjs → chunk-3JPXBFED.cjs} +4 -4
- package/dist/tsup/{chunk-6ZHUGY2E.cjs.map → chunk-3JPXBFED.cjs.map} +1 -1
- package/dist/tsup/{chunk-6VNQCLKF.js → chunk-5X35FD2T.js} +4 -4
- package/dist/tsup/{chunk-BJGWUWNE.js → chunk-6QNBANXM.js} +3 -3
- package/dist/tsup/{chunk-Z6IVW2Y5.js → chunk-7HILY7QU.js} +188 -28
- package/dist/tsup/chunk-7HILY7QU.js.map +1 -0
- package/dist/tsup/{chunk-JI6GZ2C2.js → chunk-A2CF6PFH.js} +18 -1
- package/dist/tsup/chunk-A2CF6PFH.js.map +1 -0
- package/dist/tsup/{chunk-7XBDAFGQ.cjs → chunk-CT6GQRUN.cjs} +3 -3
- package/dist/tsup/{chunk-7XBDAFGQ.cjs.map → chunk-CT6GQRUN.cjs.map} +1 -1
- package/dist/tsup/{chunk-M27XAZNI.js → chunk-DRZTELHJ.js} +10 -14
- package/dist/tsup/chunk-DRZTELHJ.js.map +1 -0
- package/dist/tsup/{chunk-EDJKDOI2.js → chunk-DUGEPEJO.js} +2 -2
- package/dist/tsup/{chunk-PMU5EDGT.cjs → chunk-EA6P3N4I.cjs} +3 -3
- package/dist/tsup/{chunk-PMU5EDGT.cjs.map → chunk-EA6P3N4I.cjs.map} +1 -1
- package/dist/tsup/{chunk-WE7D64FW.cjs → chunk-ERZDCOQ3.cjs} +10 -10
- package/dist/tsup/{chunk-WE7D64FW.cjs.map → chunk-ERZDCOQ3.cjs.map} +1 -1
- package/dist/tsup/{chunk-UZ5O42HF.js → chunk-GHTA76HT.js} +2 -2
- package/dist/tsup/{chunk-IAVZH6HH.js → chunk-ID5VJNZY.js} +2 -2
- package/dist/tsup/{chunk-2LRKNNQJ.cjs → chunk-PXIOH445.cjs} +327 -167
- package/dist/tsup/chunk-PXIOH445.cjs.map +1 -0
- package/dist/tsup/{chunk-MYWZCDML.cjs → chunk-RTWH3AX3.cjs} +19 -2
- package/dist/tsup/chunk-RTWH3AX3.cjs.map +1 -0
- package/dist/tsup/{chunk-5LBUG2IK.cjs → chunk-UV4KDO4W.cjs} +3 -3
- package/dist/tsup/{chunk-5LBUG2IK.cjs.map → chunk-UV4KDO4W.cjs.map} +1 -1
- package/dist/tsup/{chunk-HHALUH4L.js → chunk-VI2S336K.js} +2 -2
- package/dist/tsup/{chunk-6BRDJRCZ.cjs → chunk-W7NPIYWC.cjs} +10 -14
- package/dist/tsup/chunk-W7NPIYWC.cjs.map +1 -0
- package/dist/tsup/{chunk-4SIQMCXI.cjs → chunk-ZZQM77UA.cjs} +7 -7
- package/dist/tsup/{chunk-4SIQMCXI.cjs.map → chunk-ZZQM77UA.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +15 -3
- package/dist/tsup/client/mod.d.ts +15 -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-DfVrAigH.d.ts → config-B4erdavw.d.ts} +43 -12
- package/dist/tsup/{config-BaUctMNL.d.cts → config-BfG1qpYz.d.cts} +7 -1
- package/dist/tsup/{config-BaUctMNL.d.ts → config-BfG1qpYz.d.ts} +7 -1
- package/dist/tsup/{config-D6T6Ud_V.d.cts → config-DK144OAw.d.cts} +43 -12
- package/dist/tsup/{context-CowF_zyQ.d.cts → context-Cvnf3BRe.d.cts} +2 -2
- package/dist/tsup/{context-BsFWwi3i.d.ts → context-Oxi6YWcG.d.ts} +2 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.d.cts +1 -1
- package/dist/tsup/db/drizzle.d.ts +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.d.cts +2 -2
- package/dist/tsup/db/mod.d.ts +2 -2
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- 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.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/mod.cjs +256 -174
- 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 +170 -88
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- 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/unstable/migrations.d.cts +1 -1
- package/dist/tsup/unstable/migrations.d.ts +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +17 -17
- 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 +9 -13
- package/src/actor/keys.ts +86 -0
- package/src/agent-os/index.ts +5 -65
- package/src/client/actor-conn.ts +92 -6
- package/src/client/actor-handle.ts +24 -4
- package/src/client/client.ts +14 -4
- package/src/client/config.ts +12 -1
- package/src/client/lifecycle-errors.ts +16 -1
- package/src/client/retry-budget.ts +78 -0
- package/src/client/utils.ts +13 -2
- package/src/common/database/config.ts +7 -1
- package/src/common/database/native-database.ts +17 -9
- package/src/common/router.ts +1 -1
- package/src/engine-api/actors.ts +3 -3
- package/src/engine-client/actor-websocket-client.ts +4 -2
- package/src/engine-client/api-endpoints.ts +44 -14
- package/src/engine-client/mod.ts +2 -2
- package/src/registry/config/envoy.ts +1 -1
- package/src/registry/config/index.ts +28 -31
- package/src/registry/index.ts +51 -19
- package/src/registry/napi-runtime.ts +3 -2
- package/src/registry/native.ts +129 -40
- package/src/registry/runtime.ts +27 -10
- package/src/registry/wasm-runtime.ts +6 -3
- package/src/utils/env-vars.ts +15 -10
- package/dist/tsup/chunk-2LRKNNQJ.cjs.map +0 -1
- package/dist/tsup/chunk-6BRDJRCZ.cjs.map +0 -1
- package/dist/tsup/chunk-JI6GZ2C2.js.map +0 -1
- package/dist/tsup/chunk-M27XAZNI.js.map +0 -1
- package/dist/tsup/chunk-MYWZCDML.cjs.map +0 -1
- package/dist/tsup/chunk-Z6IVW2Y5.js.map +0 -1
- package/src/actor/config.test.ts +0 -78
- package/src/actor/keys.test.ts +0 -275
- package/src/actor/utils.test.ts +0 -48
- package/src/agent-os/actor/cron.ts +0 -84
- package/src/agent-os/actor/db.ts +0 -54
- package/src/agent-os/actor/filesystem.ts +0 -131
- package/src/agent-os/actor/index.ts +0 -285
- package/src/agent-os/actor/network.ts +0 -58
- package/src/agent-os/actor/preview.ts +0 -190
- package/src/agent-os/actor/process.ts +0 -177
- package/src/agent-os/actor/session.ts +0 -518
- package/src/agent-os/actor/shell.ts +0 -60
- package/src/agent-os/config.ts +0 -79
- package/src/agent-os/fs/database-vfs.ts +0 -624
- package/src/agent-os/types.ts +0 -148
- package/src/client/test.ts +0 -44
- package/src/client/token-provider.test.ts +0 -86
- package/src/common/database/mod.test.ts +0 -364
- package/src/common/database/native-database.test.ts +0 -241
- package/src/common/inline-websocket-adapter.test.ts +0 -51
- package/src/db/drizzle.test.ts +0 -164
- package/src/registry/config/index.test.ts +0 -25
- package/src/registry/run-handler-coordinator.test.ts +0 -252
- package/src/registry/runtime.test.ts +0 -124
- package/src/unstable/migrations.test.ts +0 -170
- package/src/utils/endpoint-parser.test.ts +0 -206
- package/src/utils.test.ts +0 -34
- package/src/workflow/driver.test.ts +0 -62
- /package/dist/tsup/{chunk-6VNQCLKF.js.map → chunk-5X35FD2T.js.map} +0 -0
- /package/dist/tsup/{chunk-BJGWUWNE.js.map → chunk-6QNBANXM.js.map} +0 -0
- /package/dist/tsup/{chunk-EDJKDOI2.js.map → chunk-DUGEPEJO.js.map} +0 -0
- /package/dist/tsup/{chunk-UZ5O42HF.js.map → chunk-GHTA76HT.js.map} +0 -0
- /package/dist/tsup/{chunk-IAVZH6HH.js.map → chunk-ID5VJNZY.js.map} +0 -0
- /package/dist/tsup/{chunk-HHALUH4L.js.map → chunk-VI2S336K.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 _chunkZZQM77UAcjs = require('../chunk-ZZQM77UA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-
|
|
6
|
+
var _chunkPXIOH445cjs = require('../chunk-PXIOH445.cjs');
|
|
7
|
+
require('../chunk-RTWH3AX3.cjs');
|
|
8
|
+
require('../chunk-UV4KDO4W.cjs');
|
|
8
9
|
require('../chunk-KVFIONKQ.cjs');
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-6BRDJRCZ.cjs');
|
|
10
|
+
require('../chunk-W7NPIYWC.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 = _chunkZZQM77UAcjs.createClient.call(void 0, {
|
|
40
|
+
..._chunkPXIOH445cjs.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,7 +1,7 @@
|
|
|
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-DK144OAw.cjs';
|
|
3
3
|
import 'zod/v4';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-BfG1qpYz.cjs';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'pino';
|
package/dist/tsup/test/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-B4erdavw.js';
|
|
3
3
|
import 'zod/v4';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-BfG1qpYz.js';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'pino';
|
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-6QNBANXM.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-7HILY7QU.js";
|
|
7
|
+
import "../chunk-A2CF6PFH.js";
|
|
8
|
+
import "../chunk-DUGEPEJO.js";
|
|
8
9
|
import "../chunk-JTHHCZCZ.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-M27XAZNI.js";
|
|
10
|
+
import "../chunk-DRZTELHJ.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 _chunkW7NPIYWCcjs = require('./chunk-W7NPIYWC.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 = _chunkW7NPIYWCcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkW7NPIYWCcjs.SinglePromiseQueue; exports.VERSION = _chunkW7NPIYWCcjs.VERSION; exports.arrayBuffersEqual = _chunkW7NPIYWCcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkW7NPIYWCcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkW7NPIYWCcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkW7NPIYWCcjs.combineUrlPath; exports.dbg = _chunkW7NPIYWCcjs.dbg; exports.detectRuntime = _chunkW7NPIYWCcjs.detectRuntime; exports.getEnvUniversal = _chunkW7NPIYWCcjs.getEnvUniversal; exports.httpUserAgent = _chunkW7NPIYWCcjs.httpUserAgent; exports.interval = _chunkW7NPIYWCcjs.interval; exports.joinSignals = _chunkW7NPIYWCcjs.joinSignals; exports.jsonParseCompat = _chunkW7NPIYWCcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkW7NPIYWCcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkW7NPIYWCcjs.promiseWithResolvers; exports.setLongTimeout = _chunkW7NPIYWCcjs.setLongTimeout; exports.sleep = _chunkW7NPIYWCcjs.sleep; exports.stringifyError = _chunkW7NPIYWCcjs.stringifyError; exports.toUint8Array = _chunkW7NPIYWCcjs.toUint8Array;
|
|
46
46
|
//# sourceMappingURL=utils.cjs.map
|
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 _chunkERZDCOQ3cjs = require('../chunk-ERZDCOQ3.cjs');
|
|
4
|
+
require('../chunk-CT6GQRUN.cjs');
|
|
5
|
+
require('../chunk-3JPXBFED.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@ var _chunkHDVZ6YZGcjs = require('../chunk-HDVZ6YZG.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkRTWH3AX3cjs = require('../chunk-RTWH3AX3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkW7NPIYWCcjs = require('../chunk-W7NPIYWC.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -355,7 +355,7 @@ var WorkflowContext = class _WorkflowContext {
|
|
|
355
355
|
};
|
|
356
356
|
|
|
357
357
|
// src/workflow/driver.ts
|
|
358
|
-
var WORKFLOW_STORAGE_PREFIX =
|
|
358
|
+
var WORKFLOW_STORAGE_PREFIX = _chunkRTWH3AX3cjs.workflowStoragePrefix.call(void 0, );
|
|
359
359
|
var WORKFLOW_SQLITE_MAX_BATCH_ROWS = 128;
|
|
360
360
|
var WORKFLOW_SQLITE_MAX_BATCH_BYTES = 512 * 1024;
|
|
361
361
|
function stripWorkflowKey(prefixed) {
|
|
@@ -412,7 +412,7 @@ var WorkflowStorage = class {
|
|
|
412
412
|
}
|
|
413
413
|
async get(key) {
|
|
414
414
|
var _a;
|
|
415
|
-
const prefixed =
|
|
415
|
+
const prefixed = _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, key);
|
|
416
416
|
const rows = await this.#db.execute(
|
|
417
417
|
"SELECT value FROM _rivet_wf_kv WHERE key = ?",
|
|
418
418
|
prefixed
|
|
@@ -423,7 +423,7 @@ var WorkflowStorage = class {
|
|
|
423
423
|
await this.batch([{ key, value }]);
|
|
424
424
|
}
|
|
425
425
|
async delete(key) {
|
|
426
|
-
const prefixed =
|
|
426
|
+
const prefixed = _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, key);
|
|
427
427
|
await this.#db.execute(
|
|
428
428
|
"DELETE FROM _rivet_wf_kv WHERE key = ?",
|
|
429
429
|
prefixed
|
|
@@ -431,10 +431,10 @@ var WorkflowStorage = class {
|
|
|
431
431
|
}
|
|
432
432
|
async batchDelete(keys) {
|
|
433
433
|
if (keys.length === 0) return;
|
|
434
|
-
await this.deleteRawKeys(keys.map((key) =>
|
|
434
|
+
await this.deleteRawKeys(keys.map((key) => _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, key)));
|
|
435
435
|
}
|
|
436
436
|
async deletePrefix(prefix) {
|
|
437
|
-
const start =
|
|
437
|
+
const start = _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, prefix);
|
|
438
438
|
const end = computeUpperBound(start);
|
|
439
439
|
if (end) {
|
|
440
440
|
await this.#db.execute(
|
|
@@ -450,8 +450,8 @@ var WorkflowStorage = class {
|
|
|
450
450
|
);
|
|
451
451
|
}
|
|
452
452
|
async deleteRange(start, end) {
|
|
453
|
-
const prefixedStart =
|
|
454
|
-
const prefixedEnd =
|
|
453
|
+
const prefixedStart = _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, start);
|
|
454
|
+
const prefixedEnd = _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, end);
|
|
455
455
|
await this.#db.execute(
|
|
456
456
|
"DELETE FROM _rivet_wf_kv WHERE key >= ? AND key < ?",
|
|
457
457
|
prefixedStart,
|
|
@@ -459,7 +459,7 @@ var WorkflowStorage = class {
|
|
|
459
459
|
);
|
|
460
460
|
}
|
|
461
461
|
async list(prefix) {
|
|
462
|
-
const prefixed =
|
|
462
|
+
const prefixed = _chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, prefix);
|
|
463
463
|
const entries = await this.listRaw(prefixed);
|
|
464
464
|
return entries.filter(([key]) => keyStartsWith(key, prefixed)).map(([key, value]) => ({
|
|
465
465
|
key: stripWorkflowKey(key),
|
|
@@ -473,7 +473,7 @@ var WorkflowStorage = class {
|
|
|
473
473
|
for (const { key, value } of chunk) {
|
|
474
474
|
await tx.execute(
|
|
475
475
|
"INSERT INTO _rivet_wf_kv (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",
|
|
476
|
-
|
|
476
|
+
_chunkRTWH3AX3cjs.makeWorkflowKey.call(void 0, key),
|
|
477
477
|
value
|
|
478
478
|
);
|
|
479
479
|
}
|
|
@@ -743,7 +743,7 @@ function workflow(fn, options = {}) {
|
|
|
743
743
|
function getWorkflowInspector(actorId) {
|
|
744
744
|
let workflowInspector = workflowInspectors.get(actorId);
|
|
745
745
|
if (!workflowInspector) {
|
|
746
|
-
workflowInspector =
|
|
746
|
+
workflowInspector = _chunkERZDCOQ3cjs.createWorkflowInspectorAdapter.call(void 0, );
|
|
747
747
|
workflowInspectors.set(actorId, workflowInspector);
|
|
748
748
|
}
|
|
749
749
|
return workflowInspector;
|
|
@@ -816,13 +816,13 @@ function workflow(fn, options = {}) {
|
|
|
816
816
|
if (shouldRethrowWorkflowError(error)) {
|
|
817
817
|
runCtx.log.error({
|
|
818
818
|
msg: "workflow run failed",
|
|
819
|
-
error:
|
|
819
|
+
error: _chunkW7NPIYWCcjs.stringifyError.call(void 0, error)
|
|
820
820
|
});
|
|
821
821
|
throw error;
|
|
822
822
|
}
|
|
823
823
|
runCtx.log.warn({
|
|
824
824
|
msg: "workflow failed and will sleep until woken",
|
|
825
|
-
error:
|
|
825
|
+
error: _chunkW7NPIYWCcjs.stringifyError.call(void 0, error)
|
|
826
826
|
});
|
|
827
827
|
} finally {
|
|
828
828
|
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-
|
|
4
|
-
import { A as AnyDatabaseProvider } from '../config-
|
|
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-
|
|
3
|
+
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-DK144OAw.cjs';
|
|
4
|
+
import { A as AnyDatabaseProvider } from '../config-BfG1qpYz.cjs';
|
|
5
|
+
import { d as WorkflowContext } from '../context-Cvnf3BRe.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-Cvnf3BRe.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-
|
|
4
|
-
import { A as AnyDatabaseProvider } from '../config-
|
|
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-
|
|
3
|
+
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-B4erdavw.js';
|
|
4
|
+
import { A as AnyDatabaseProvider } from '../config-BfG1qpYz.js';
|
|
5
|
+
import { d as WorkflowContext } from '../context-Oxi6YWcG.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-Oxi6YWcG.js';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-5X35FD2T.js";
|
|
4
|
+
import "../chunk-ID5VJNZY.js";
|
|
5
|
+
import "../chunk-GHTA76HT.js";
|
|
6
6
|
import {
|
|
7
7
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
8
8
|
defineRunHandler
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
makeWorkflowKey,
|
|
12
12
|
workflowStoragePrefix
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-A2CF6PFH.js";
|
|
14
14
|
import {
|
|
15
15
|
stringifyError
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-DRZTELHJ.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": "0.0.0-feat-sqlite-sync.
|
|
3
|
+
"version": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
4
4
|
"description": "Lightweight libraries for building stateful actors on edge platforms",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -210,18 +210,16 @@
|
|
|
210
210
|
"dependencies": {
|
|
211
211
|
"@hono/zod-openapi": "^1.1.5",
|
|
212
212
|
"@opentelemetry/api": "^1.1.0",
|
|
213
|
-
"@rivet-dev/agent-os-core": "^0.1.1",
|
|
214
|
-
"@rivet-dev/services": "^0.2.0",
|
|
215
213
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
216
|
-
"@rivetkit/engine-api-full": "0.0.0-feat-sqlite-sync.
|
|
217
|
-
"@rivetkit/engine-cli": "0.0.0-feat-sqlite-sync.
|
|
218
|
-
"@rivetkit/engine-envoy-protocol": "0.0.0-feat-sqlite-sync.
|
|
214
|
+
"@rivetkit/engine-api-full": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
215
|
+
"@rivetkit/engine-cli": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
216
|
+
"@rivetkit/engine-envoy-protocol": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
219
217
|
"@rivetkit/on-change": "6.0.1",
|
|
220
|
-
"@rivetkit/rivetkit-napi": "0.0.0-feat-sqlite-sync.
|
|
221
|
-
"@rivetkit/rivetkit-wasm": "0.0.0-feat-sqlite-sync.
|
|
222
|
-
"@rivetkit/traces": "0.0.0-feat-sqlite-sync.
|
|
223
|
-
"@rivetkit/virtual-websocket": "0.0.0-feat-sqlite-sync.
|
|
224
|
-
"@rivetkit/workflow-engine": "0.0.0-feat-sqlite-sync.
|
|
218
|
+
"@rivetkit/rivetkit-napi": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
219
|
+
"@rivetkit/rivetkit-wasm": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
220
|
+
"@rivetkit/traces": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
221
|
+
"@rivetkit/virtual-websocket": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
222
|
+
"@rivetkit/workflow-engine": "0.0.0-feat-sqlite-sync-3x.a00b07f",
|
|
225
223
|
"cbor-x": "^1.6.0",
|
|
226
224
|
"drizzle-orm": "0.45.2",
|
|
227
225
|
"hono": "^4.7.0",
|
|
@@ -238,8 +236,6 @@
|
|
|
238
236
|
"@hono/node-server": "^1.18.2",
|
|
239
237
|
"@hono/node-ws": "^1.1.1",
|
|
240
238
|
"@opentelemetry/sdk-trace-node": "2.11.0",
|
|
241
|
-
"@rivet-dev/agent-os-common": "*",
|
|
242
|
-
"@rivet-dev/agent-os-pi": "^0.1.1",
|
|
243
239
|
"@standard-schema/spec": "^1.0.0",
|
|
244
240
|
"@types/invariant": "^2",
|
|
245
241
|
"@types/node": "^22.13.1",
|
package/src/actor/keys.ts
CHANGED
|
@@ -60,6 +60,8 @@ const TRACES_STORAGE_PREFIX = concatPrefix(
|
|
|
60
60
|
STORAGE_VERSION_BYTES.TRACES,
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
+
// The slash key form the actor REST API and the actor runtime use. The engine translates it to
|
|
64
|
+
// the canonical form (`encodeActorKey`) at those boundaries.
|
|
63
65
|
export function serializeActorKey(key: ActorKey): string {
|
|
64
66
|
// Use a special marker for empty key arrays
|
|
65
67
|
if (key.length === 0) {
|
|
@@ -145,6 +147,90 @@ export function deserializeActorKey(keyString: string | undefined): ActorKey {
|
|
|
145
147
|
return parts;
|
|
146
148
|
}
|
|
147
149
|
|
|
150
|
+
// The canonical actor key: parts joined with `,`, with `\` and `,` escaped by a backslash, an
|
|
151
|
+
// empty part written as `\0`, and the empty key as the empty string. The engine hashes, stores
|
|
152
|
+
// and compares only canonical keys, and the gateway's `rvt-key` carries one. The Rust twin is
|
|
153
|
+
// `rivetkit_shared_types::actor_key`; both run the vectors in
|
|
154
|
+
// `rivetkit-rust/packages/shared-types/tests/fixtures/actor_key_vectors.json`.
|
|
155
|
+
const CANONICAL_SEPARATOR = ",";
|
|
156
|
+
const CANONICAL_EMPTY_PART = "\\0";
|
|
157
|
+
|
|
158
|
+
/** Encodes `key` in the canonical form. */
|
|
159
|
+
export function encodeActorKey(key: ActorKey): string {
|
|
160
|
+
return key
|
|
161
|
+
.map((part) => {
|
|
162
|
+
if (part === "") {
|
|
163
|
+
return CANONICAL_EMPTY_PART;
|
|
164
|
+
}
|
|
165
|
+
return part.replace(/\\/g, "\\\\").replace(/,/g, "\\,");
|
|
166
|
+
})
|
|
167
|
+
.join(CANONICAL_SEPARATOR);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Decodes a canonical key, or an unescaped `rvt-key` value from an earlier client. Only `\\` and
|
|
172
|
+
* `\,` are escapes; any other backslash is literal, and a part written as exactly `\0` is empty.
|
|
173
|
+
*/
|
|
174
|
+
export function decodeActorKey(key: string): ActorKey {
|
|
175
|
+
if (key === "") {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const parts: string[] = [];
|
|
180
|
+
let raw = "";
|
|
181
|
+
let current = "";
|
|
182
|
+
const finishPart = () => {
|
|
183
|
+
parts.push(raw === CANONICAL_EMPTY_PART ? "" : current);
|
|
184
|
+
raw = "";
|
|
185
|
+
current = "";
|
|
186
|
+
};
|
|
187
|
+
for (let i = 0; i < key.length; i++) {
|
|
188
|
+
const char = key[i];
|
|
189
|
+
if (char === CANONICAL_SEPARATOR) {
|
|
190
|
+
finishPart();
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
raw += char;
|
|
195
|
+
if (char !== "\\") {
|
|
196
|
+
current += char;
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const next = key[i + 1];
|
|
201
|
+
if (next === "\\" || next === CANONICAL_SEPARATOR) {
|
|
202
|
+
raw += next;
|
|
203
|
+
current += next;
|
|
204
|
+
i++;
|
|
205
|
+
} else {
|
|
206
|
+
current += char;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
finishPart();
|
|
210
|
+
return parts;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The gateway's `rvt-key` query value for `key`: the canonical key, or `undefined` when the
|
|
215
|
+
* parameter is omitted, as it is for the empty key.
|
|
216
|
+
*/
|
|
217
|
+
export function actorKeyToGatewayQuery(key: ActorKey): string | undefined {
|
|
218
|
+
if (key.length === 0) {
|
|
219
|
+
return undefined;
|
|
220
|
+
}
|
|
221
|
+
return encodeActorKey(key);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Reads the gateway's `rvt-key` query value. A missing value is the empty key. */
|
|
225
|
+
export function actorKeyFromGatewayQuery(
|
|
226
|
+
rvtKey: string | null | undefined,
|
|
227
|
+
): ActorKey {
|
|
228
|
+
if (rvtKey === undefined || rvtKey === null) {
|
|
229
|
+
return [];
|
|
230
|
+
}
|
|
231
|
+
return decodeActorKey(rvtKey);
|
|
232
|
+
}
|
|
233
|
+
|
|
148
234
|
export function makePrefixedKey(key: Uint8Array): Uint8Array {
|
|
149
235
|
const prefixed = new Uint8Array(KEYS.KV.length + key.length);
|
|
150
236
|
prefixed.set(KEYS.KV, 0);
|
package/src/agent-os/index.ts
CHANGED
|
@@ -1,65 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// Filesystem actions
|
|
7
|
-
export { buildFilesystemActions } from "./actor/filesystem";
|
|
8
|
-
// Actor factory and VM lifecycle helpers
|
|
9
|
-
export { agentOs, ensureVm, runHook, syncPreventSleep } from "./actor/index";
|
|
10
|
-
// Network actions
|
|
11
|
-
export {
|
|
12
|
-
buildNetworkActions,
|
|
13
|
-
type VmFetchOptions,
|
|
14
|
-
type VmFetchResult,
|
|
15
|
-
} from "./actor/network";
|
|
16
|
-
// Preview actions
|
|
17
|
-
export {
|
|
18
|
-
buildOnRequestHandler,
|
|
19
|
-
buildPreviewActions,
|
|
20
|
-
generateToken,
|
|
21
|
-
} from "./actor/preview";
|
|
22
|
-
// Process actions
|
|
23
|
-
export { buildProcessActions } from "./actor/process";
|
|
24
|
-
// Session actions
|
|
25
|
-
export {
|
|
26
|
-
buildConfigActions,
|
|
27
|
-
buildPromptActions,
|
|
28
|
-
buildSessionActions,
|
|
29
|
-
buildSessionPersistenceActions,
|
|
30
|
-
subscribeToSession,
|
|
31
|
-
} from "./actor/session";
|
|
32
|
-
// Shell actions
|
|
33
|
-
export { buildShellActions } from "./actor/shell";
|
|
34
|
-
// Config schema and types
|
|
35
|
-
export {
|
|
36
|
-
type AgentOsActorConfig,
|
|
37
|
-
type AgentOsActorConfigInput,
|
|
38
|
-
agentOsActorConfigSchema,
|
|
39
|
-
} from "./config";
|
|
40
|
-
// Database-backed VFS
|
|
41
|
-
export {
|
|
42
|
-
createDatabaseVfs,
|
|
43
|
-
type DatabaseVfsOptions,
|
|
44
|
-
} from "./fs/database-vfs";
|
|
45
|
-
// Domain types and event payloads
|
|
46
|
-
export type {
|
|
47
|
-
AgentOsActionContext,
|
|
48
|
-
AgentOsActorState,
|
|
49
|
-
AgentOsActorVars,
|
|
50
|
-
AgentOsEvents,
|
|
51
|
-
CronEventPayload,
|
|
52
|
-
PermissionRequestPayload,
|
|
53
|
-
PersistedSessionEvent,
|
|
54
|
-
PersistedSessionRecord,
|
|
55
|
-
ProcessExitPayload,
|
|
56
|
-
ProcessOutputPayload,
|
|
57
|
-
PromptResult,
|
|
58
|
-
SerializableCronAction,
|
|
59
|
-
SerializableCronJobOptions,
|
|
60
|
-
SessionEventPayload,
|
|
61
|
-
SessionRecord,
|
|
62
|
-
ShellDataPayload,
|
|
63
|
-
VmBootedPayload,
|
|
64
|
-
VmShutdownPayload,
|
|
65
|
-
} from "./types";
|
|
1
|
+
// agentOS no longer ships inside RivetKit. This entrypoint remains so existing
|
|
2
|
+
// imports fail with migration guidance instead of a missing-module error.
|
|
3
|
+
throw new Error(
|
|
4
|
+
"rivetkit/agent-os has been removed. Use @rivet-dev/agentos-core to run agentOS VMs in your process, or hosted agentOS with @rivet-dev/agentos. See https://rivet.dev/agentos/docs",
|
|
5
|
+
);
|