rivetkit 3.1.2-rc.2 → 3.1.2-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client.d.ts +2 -16
- package/dist/browser/client.js +9 -1
- 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/{chunk-MRWI2HTU.js → chunk-2BXN54R4.js} +2 -2
- package/dist/tsup/{chunk-N2SQDK2F.js → chunk-3ALVCHXR.js} +3 -3
- package/dist/tsup/{chunk-LBYX466L.cjs → chunk-6ANYUVLS.cjs} +3 -3
- package/dist/tsup/{chunk-LBYX466L.cjs.map → chunk-6ANYUVLS.cjs.map} +1 -1
- package/dist/tsup/{chunk-I6P2AHO6.js → chunk-6S73EWWS.js} +2 -2
- package/dist/tsup/{chunk-L2XH4EXJ.cjs → chunk-6YDPLY6F.cjs} +155 -147
- package/dist/tsup/chunk-6YDPLY6F.cjs.map +1 -0
- package/dist/tsup/{chunk-QJ7MIAFD.cjs → chunk-C2I4CPLD.cjs} +7 -7
- package/dist/tsup/{chunk-QJ7MIAFD.cjs.map → chunk-C2I4CPLD.cjs.map} +1 -1
- package/dist/tsup/{chunk-YAGP66QF.cjs → chunk-JK62DI4K.cjs} +4 -4
- package/dist/tsup/{chunk-YAGP66QF.cjs.map → chunk-JK62DI4K.cjs.map} +1 -1
- package/dist/tsup/{chunk-6BGQCMIF.cjs → chunk-MJCM3IZN.cjs} +3 -3
- package/dist/tsup/{chunk-6BGQCMIF.cjs.map → chunk-MJCM3IZN.cjs.map} +1 -1
- package/dist/tsup/{chunk-DDF35AIK.cjs → chunk-MJWDZ4CU.cjs} +2 -2
- package/dist/tsup/{chunk-DDF35AIK.cjs.map → chunk-MJWDZ4CU.cjs.map} +1 -1
- package/dist/tsup/{chunk-TAK6KRMJ.cjs → chunk-P57K5DTD.cjs} +3 -3
- package/dist/tsup/{chunk-TAK6KRMJ.cjs.map → chunk-P57K5DTD.cjs.map} +1 -1
- package/dist/tsup/{chunk-MVOIZGVC.js → chunk-POKN6RC5.js} +2 -2
- package/dist/tsup/{chunk-MVOIZGVC.js.map → chunk-POKN6RC5.js.map} +1 -1
- package/dist/tsup/{chunk-JGMXY4GD.js → chunk-WCVT6UXF.js} +14 -6
- package/dist/tsup/chunk-WCVT6UXF.js.map +1 -0
- package/dist/tsup/{chunk-6MJSWO33.js → chunk-WJSHEWTP.js} +4 -4
- package/dist/tsup/{chunk-A3N3LJC6.cjs → chunk-X4HPTBGP.cjs} +10 -10
- package/dist/tsup/{chunk-A3N3LJC6.cjs.map → chunk-X4HPTBGP.cjs.map} +1 -1
- package/dist/tsup/{chunk-D2CCGHEJ.js → chunk-YXBMGSYD.js} +2 -2
- package/dist/tsup/{chunk-6NHRZU52.js → chunk-ZWLSBELO.js} +2 -2
- 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-BMGUEKMZ.d.cts → config-BbRMYCV8.d.cts} +2 -16
- package/dist/tsup/{config-iBpXyITj.d.ts → config-CW3AWqHa.d.ts} +2 -16
- package/dist/tsup/{context-hyVakgnU.d.ts → context-Cp64yaMW.d.ts} +1 -1
- package/dist/tsup/{context-qfvLuF0P.d.cts → context-NuwP8HjQ.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.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +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.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/mod.cjs +127 -391
- 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 +46 -310
- 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 +7 -7
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +9 -9
- package/src/client/lifecycle-errors.ts +15 -0
- package/src/common/database/config.ts +0 -52
- package/src/common/database/native-database.ts +18 -229
- package/src/registry/config/index.ts +3 -1
- package/src/registry/index.ts +15 -14
- package/src/registry/napi-runtime.ts +2 -81
- package/src/registry/native.ts +17 -66
- package/src/registry/runtime.ts +2 -53
- package/src/registry/wasm-runtime.ts +0 -88
- package/dist/tsup/chunk-JGMXY4GD.js.map +0 -1
- package/dist/tsup/chunk-L2XH4EXJ.cjs.map +0 -1
- /package/dist/tsup/{chunk-MRWI2HTU.js.map → chunk-2BXN54R4.js.map} +0 -0
- /package/dist/tsup/{chunk-N2SQDK2F.js.map → chunk-3ALVCHXR.js.map} +0 -0
- /package/dist/tsup/{chunk-I6P2AHO6.js.map → chunk-6S73EWWS.js.map} +0 -0
- /package/dist/tsup/{chunk-6MJSWO33.js.map → chunk-WJSHEWTP.js.map} +0 -0
- /package/dist/tsup/{chunk-D2CCGHEJ.js.map → chunk-YXBMGSYD.js.map} +0 -0
- /package/dist/tsup/{chunk-6NHRZU52.js.map → chunk-ZWLSBELO.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 _chunkC2I4CPLDcjs = require('../chunk-C2I4CPLD.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk6YDPLY6Fcjs = require('../chunk-6YDPLY6F.cjs');
|
|
7
7
|
require('../chunk-RTWH3AX3.cjs');
|
|
8
|
-
require('../chunk-LBYX466L.cjs');
|
|
9
8
|
require('../chunk-KVFIONKQ.cjs');
|
|
10
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-6ANYUVLS.cjs');
|
|
10
|
+
require('../chunk-MJWDZ4CU.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 = _chunkC2I4CPLDcjs.createClient.call(void 0, {
|
|
40
|
+
..._chunk6YDPLY6Fcjs.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 { aK as Registry, a8 as Client } from '../config-
|
|
2
|
+
import { aK as Registry, a8 as Client } from '../config-BbRMYCV8.cjs';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-CBTr4IhE.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 { aK as Registry, a8 as Client } from '../config-
|
|
2
|
+
import { aK as Registry, a8 as Client } from '../config-CW3AWqHa.js';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-CBTr4IhE.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-3ALVCHXR.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WCVT6UXF.js";
|
|
7
7
|
import "../chunk-A2CF6PFH.js";
|
|
8
|
-
import "../chunk-MRWI2HTU.js";
|
|
9
8
|
import "../chunk-JTHHCZCZ.js";
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-2BXN54R4.js";
|
|
10
|
+
import "../chunk-POKN6RC5.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 _chunkMJWDZ4CUcjs = require('./chunk-MJWDZ4CU.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 = _chunkMJWDZ4CUcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkMJWDZ4CUcjs.SinglePromiseQueue; exports.VERSION = _chunkMJWDZ4CUcjs.VERSION; exports.arrayBuffersEqual = _chunkMJWDZ4CUcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkMJWDZ4CUcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkMJWDZ4CUcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkMJWDZ4CUcjs.combineUrlPath; exports.dbg = _chunkMJWDZ4CUcjs.dbg; exports.detectRuntime = _chunkMJWDZ4CUcjs.detectRuntime; exports.getEnvUniversal = _chunkMJWDZ4CUcjs.getEnvUniversal; exports.httpUserAgent = _chunkMJWDZ4CUcjs.httpUserAgent; exports.interval = _chunkMJWDZ4CUcjs.interval; exports.joinSignals = _chunkMJWDZ4CUcjs.joinSignals; exports.jsonParseCompat = _chunkMJWDZ4CUcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkMJWDZ4CUcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkMJWDZ4CUcjs.promiseWithResolvers; exports.setLongTimeout = _chunkMJWDZ4CUcjs.setLongTimeout; exports.sleep = _chunkMJWDZ4CUcjs.sleep; exports.stringifyError = _chunkMJWDZ4CUcjs.stringifyError; exports.toUint8Array = _chunkMJWDZ4CUcjs.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 _chunkX4HPTBGPcjs = require('../chunk-X4HPTBGP.cjs');
|
|
4
|
+
require('../chunk-MJCM3IZN.cjs');
|
|
5
|
+
require('../chunk-JK62DI4K.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ var _chunkAQJFKHBKcjs = require('../chunk-AQJFKHBK.cjs');
|
|
|
13
13
|
var _chunkRTWH3AX3cjs = require('../chunk-RTWH3AX3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkMJWDZ4CUcjs = require('../chunk-MJWDZ4CU.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -769,7 +769,7 @@ function workflow(fn, options = {}) {
|
|
|
769
769
|
function getWorkflowInspector(actorId) {
|
|
770
770
|
let workflowInspector = workflowInspectors.get(actorId);
|
|
771
771
|
if (!workflowInspector) {
|
|
772
|
-
workflowInspector =
|
|
772
|
+
workflowInspector = _chunkX4HPTBGPcjs.createWorkflowInspectorAdapter.call(void 0, );
|
|
773
773
|
workflowInspectors.set(actorId, workflowInspector);
|
|
774
774
|
}
|
|
775
775
|
return workflowInspector;
|
|
@@ -842,13 +842,13 @@ function workflow(fn, options = {}) {
|
|
|
842
842
|
if (shouldRethrowWorkflowError(error)) {
|
|
843
843
|
runCtx.log.error({
|
|
844
844
|
msg: "workflow run failed",
|
|
845
|
-
error:
|
|
845
|
+
error: _chunkMJWDZ4CUcjs.stringifyError.call(void 0, error)
|
|
846
846
|
});
|
|
847
847
|
throw error;
|
|
848
848
|
}
|
|
849
849
|
runCtx.log.warn({
|
|
850
850
|
msg: "workflow failed and will sleep until woken",
|
|
851
|
-
error:
|
|
851
|
+
error: _chunkMJWDZ4CUcjs.stringifyError.call(void 0, error)
|
|
852
852
|
});
|
|
853
853
|
} finally {
|
|
854
854
|
runCtx.abortSignal.removeEventListener("abort", onAbort);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
|
|
2
2
|
export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
|
|
3
|
-
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-
|
|
3
|
+
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-BbRMYCV8.cjs';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-CBTr4IhE.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-NuwP8HjQ.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-NuwP8HjQ.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-CW3AWqHa.js';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-CBTr4IhE.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-Cp64yaMW.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-Cp64yaMW.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-WJSHEWTP.js";
|
|
4
|
+
import "../chunk-ZWLSBELO.js";
|
|
5
|
+
import "../chunk-6S73EWWS.js";
|
|
6
6
|
import {
|
|
7
7
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
8
8
|
defineRunHandler
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "../chunk-A2CF6PFH.js";
|
|
14
14
|
import {
|
|
15
15
|
stringifyError
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-POKN6RC5.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.1.2-rc.
|
|
3
|
+
"version": "3.1.2-rc.3",
|
|
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.1.2-rc.
|
|
215
|
-
"@rivetkit/engine-cli": "3.1.2-rc.
|
|
216
|
-
"@rivetkit/engine-envoy-protocol": "3.1.2-rc.
|
|
214
|
+
"@rivetkit/engine-api-full": "3.1.2-rc.3",
|
|
215
|
+
"@rivetkit/engine-cli": "3.1.2-rc.3",
|
|
216
|
+
"@rivetkit/engine-envoy-protocol": "3.1.2-rc.3",
|
|
217
217
|
"@rivetkit/on-change": "6.0.1",
|
|
218
|
-
"@rivetkit/rivetkit-napi": "3.1.2-rc.
|
|
219
|
-
"@rivetkit/rivetkit-wasm": "3.1.2-rc.
|
|
220
|
-
"@rivetkit/traces": "3.1.2-rc.
|
|
221
|
-
"@rivetkit/virtual-websocket": "3.1.2-rc.
|
|
222
|
-
"@rivetkit/workflow-engine": "3.1.2-rc.
|
|
218
|
+
"@rivetkit/rivetkit-napi": "3.1.2-rc.3",
|
|
219
|
+
"@rivetkit/rivetkit-wasm": "3.1.2-rc.3",
|
|
220
|
+
"@rivetkit/traces": "3.1.2-rc.3",
|
|
221
|
+
"@rivetkit/virtual-websocket": "3.1.2-rc.3",
|
|
222
|
+
"@rivetkit/workflow-engine": "3.1.2-rc.3",
|
|
223
223
|
"cbor-x": "^1.6.0",
|
|
224
224
|
"drizzle-orm": "0.45.2",
|
|
225
225
|
"hono": "^4.7.0",
|
|
@@ -82,6 +82,21 @@ function classifyActorError(
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
// Storage refused the actor's write before running it, as when a new actor's startup commit
|
|
86
|
+
// is shed under load. The connection may open again after the hint the close carried, but
|
|
87
|
+
// an action that failed this way already ran its handler, so it is not sent again.
|
|
88
|
+
if (
|
|
89
|
+
(error.group === "sqlite" && error.code === "storage_overloaded") ||
|
|
90
|
+
(error.group === "depot" && error.code === "overloaded")
|
|
91
|
+
) {
|
|
92
|
+
return buildLifecycleBoundaryInfo(
|
|
93
|
+
"reconnect_only",
|
|
94
|
+
"actor_error",
|
|
95
|
+
error.message,
|
|
96
|
+
{ group: error.group, code: error.code },
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
85
100
|
if (
|
|
86
101
|
(error.group === "ups" && error.code === "consumer_closed") ||
|
|
87
102
|
(error.group === "depot" && error.code === "request_deadline_exceeded")
|
|
@@ -160,58 +160,6 @@ export interface SqliteTransactionDatabase {
|
|
|
160
160
|
rollback(): Promise<void>;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
* A native database as `NativeDatabaseProvider.open` returns it. The synchronous calls and commit
|
|
165
|
-
* tickets work only when the database provider opts into deferred commits, which only embedders
|
|
166
|
-
* that hold output until writes are durable do. Internal: not exported from `rivetkit/db`.
|
|
167
|
-
*/
|
|
168
|
-
export interface DeferredSqliteDatabase extends SqliteDatabase {
|
|
169
|
-
/**
|
|
170
|
-
* Never waits behind other work. Fails with `sqlite.sync_unsupported` unless the actor uses
|
|
171
|
-
* deferred commits. Fails with the retryable `sqlite.writer_busy` while a transaction is open,
|
|
172
|
-
* including a state save, or while another call on this database is running, and with the
|
|
173
|
-
* retryable `sqlite.storage_overloaded` while too many earlier writes wait for storage.
|
|
174
|
-
*/
|
|
175
|
-
execSync(
|
|
176
|
-
sql: string,
|
|
177
|
-
callback?: (row: unknown[], columns: string[]) => void,
|
|
178
|
-
): void;
|
|
179
|
-
/** Fails like `execSync`. */
|
|
180
|
-
executeSync(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
181
|
-
/**
|
|
182
|
-
* Fails like `execSync`, also while a transaction is beginning or a manual `BEGIN` is open.
|
|
183
|
-
*/
|
|
184
|
-
beginTransactionSync(
|
|
185
|
-
timeoutMs?: number,
|
|
186
|
-
name?: string,
|
|
187
|
-
): SynchronousSqliteTransactionDatabase;
|
|
188
|
-
/**
|
|
189
|
-
* Returns the ticket of the latest local commit. Synchronous writes return before they are
|
|
190
|
-
* durable; pass the ticket to `whenDurable` before releasing output that depends on them.
|
|
191
|
-
*/
|
|
192
|
-
commitTicket(): number;
|
|
193
|
-
/**
|
|
194
|
-
* Resolves once the commit `ticket` names and every earlier commit are durable. Rejects with
|
|
195
|
-
* `sqlite.durability_failed` once the database broke and the actor is restarting.
|
|
196
|
-
*/
|
|
197
|
-
whenDurable(ticket: number): Promise<void>;
|
|
198
|
-
/**
|
|
199
|
-
* Restarts the owning actor from durable state. Every later write fails, including the final
|
|
200
|
-
* state save. For native database providers whose in-memory state can no longer be trusted.
|
|
201
|
-
*/
|
|
202
|
-
abortGeneration(reason: string): void;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export type SynchronousSqliteTransactionDatabase = SqliteTransactionDatabase & {
|
|
206
|
-
execSync(
|
|
207
|
-
sql: string,
|
|
208
|
-
callback?: (row: unknown[], columns: string[]) => void,
|
|
209
|
-
): void;
|
|
210
|
-
executeSync(sql: string, params?: SqliteBindings): SqliteExecuteResult;
|
|
211
|
-
commitSync(): void;
|
|
212
|
-
rollbackSync(): void;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
163
|
/**
|
|
216
164
|
* Provider for opening native databases from the active runtime.
|
|
217
165
|
*/
|