rivetkit 2.3.0-rc.10 → 2.3.0-rc.11
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 +105 -56
- package/dist/browser/client.js +128 -87
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +40 -20
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +2 -2
- package/dist/tsup/actor/errors.js +1 -1
- package/dist/tsup/agent-os/index.cjs +2103 -2090
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +106 -66
- package/dist/tsup/agent-os/index.d.ts +106 -66
- package/dist/tsup/agent-os/index.js +2102 -2089
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-4K3MV2MW.cjs → chunk-2NXFKPRB.cjs} +10 -10
- package/dist/tsup/chunk-2NXFKPRB.cjs.map +1 -0
- package/dist/tsup/{chunk-6BI2MS3S.js → chunk-3P2JUHWJ.js} +2 -2
- package/dist/tsup/{chunk-KU6VKVEK.js → chunk-4FP4FFB5.js} +18 -6
- package/dist/tsup/chunk-4FP4FFB5.js.map +1 -0
- package/dist/tsup/{chunk-KIWH5H3K.js → chunk-BRP62GZC.js} +3 -3
- package/dist/tsup/chunk-BRP62GZC.js.map +1 -0
- package/dist/tsup/{chunk-G34LIR7S.js → chunk-GRFBV2U7.js} +22 -7
- package/dist/tsup/chunk-GRFBV2U7.js.map +1 -0
- package/dist/tsup/{chunk-PWFGP2US.cjs → chunk-GX6W4MW3.cjs} +138 -24
- package/dist/tsup/chunk-GX6W4MW3.cjs.map +1 -0
- package/dist/tsup/{chunk-3YY5S6TV.js → chunk-HXUEHHJF.js} +2 -2
- package/dist/tsup/chunk-HXUEHHJF.js.map +1 -0
- package/dist/tsup/{chunk-PCBNKI2J.js → chunk-JZ7TWV65.js} +1 -1
- package/dist/tsup/chunk-JZ7TWV65.js.map +1 -0
- package/dist/tsup/{chunk-QAZLM4WT.cjs → chunk-KORQB2IR.cjs} +3 -3
- package/dist/tsup/{chunk-QAZLM4WT.cjs.map → chunk-KORQB2IR.cjs.map} +1 -1
- package/dist/tsup/{chunk-BM3EOY7M.js → chunk-KRC4L3YB.js} +134 -20
- package/dist/tsup/chunk-KRC4L3YB.js.map +1 -0
- package/dist/tsup/{chunk-G5RULGYQ.cjs → chunk-LNP7Q6I6.cjs} +24 -9
- package/dist/tsup/chunk-LNP7Q6I6.cjs.map +1 -0
- package/dist/tsup/{chunk-Z4C3W2CQ.cjs → chunk-LW5HNCWD.cjs} +3 -3
- package/dist/tsup/{chunk-Z4C3W2CQ.cjs.map → chunk-LW5HNCWD.cjs.map} +1 -1
- package/dist/tsup/{chunk-J5P6S2LC.cjs → chunk-RDBGKI66.cjs} +25 -13
- package/dist/tsup/chunk-RDBGKI66.cjs.map +1 -0
- package/dist/tsup/{chunk-T6YVRM4K.js → chunk-T3VCJ4PV.js} +3 -1
- package/dist/tsup/chunk-T3VCJ4PV.js.map +1 -0
- package/dist/tsup/{chunk-WU2O2KIE.js → chunk-TTLUIDVH.js} +61 -77
- package/dist/tsup/chunk-TTLUIDVH.js.map +1 -0
- package/dist/tsup/{chunk-LD5YASJU.cjs → chunk-VE2X4KMG.cjs} +2 -2
- package/dist/tsup/{chunk-LD5YASJU.cjs.map → chunk-VE2X4KMG.cjs.map} +1 -1
- package/dist/tsup/{chunk-XV52XUWU.js → chunk-WXYWDLJY.js} +4 -4
- package/dist/tsup/chunk-WXYWDLJY.js.map +1 -0
- package/dist/tsup/{chunk-WQ4HNA4W.cjs → chunk-XCDCURZ4.cjs} +4 -2
- package/dist/tsup/chunk-XCDCURZ4.cjs.map +1 -0
- package/dist/tsup/{chunk-TE4VCDNY.cjs → chunk-XG25CGSW.cjs} +217 -233
- package/dist/tsup/chunk-XG25CGSW.cjs.map +1 -0
- package/dist/tsup/{chunk-3LGP4JSO.cjs → chunk-Y3JBOFBG.cjs} +8 -8
- package/dist/tsup/{chunk-3LGP4JSO.cjs.map → chunk-Y3JBOFBG.cjs.map} +1 -1
- package/dist/tsup/{chunk-CMYS77J6.js → chunk-YRQ4F5CD.js} +3 -3
- package/dist/tsup/{chunk-2NDZ7JCR.cjs → chunk-ZA7FLHKH.cjs} +1 -1
- package/dist/tsup/chunk-ZA7FLHKH.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +9 -9
- package/dist/tsup/client/mod.d.cts +4 -4
- package/dist/tsup/client/mod.d.ts +4 -4
- package/dist/tsup/client/mod.js +8 -8
- package/dist/tsup/common/log.cjs +3 -3
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{config-Ca8dN4cS.d.cts → config-CTwe3WwC.d.cts} +69 -19
- package/dist/tsup/{config-CxjGYf4K.d.cts → config-D49x8NpL.d.cts} +1 -2
- package/dist/tsup/{config-CxjGYf4K.d.ts → config-D49x8NpL.d.ts} +1 -2
- package/dist/tsup/{config-0Ta55UV0.d.ts → config-De5UVu0V.d.ts} +69 -19
- package/dist/tsup/{context-B_IWbWne.d.ts → context-DPHISlUi.d.ts} +8 -8
- package/dist/tsup/{context-CUrQ9MHc.d.cts → context-Dmj477Uh.d.cts} +8 -8
- package/dist/tsup/db/drizzle.cjs +3 -3
- 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 +2 -2
- package/dist/tsup/db/mod.d.cts +2 -2
- package/dist/tsup/db/mod.d.ts +2 -2
- package/dist/tsup/db/mod.js +1 -1
- package/dist/tsup/dynamic/mod.cjs +24 -0
- package/dist/tsup/dynamic/mod.cjs.map +1 -0
- package/dist/tsup/dynamic/mod.d.cts +37 -0
- package/dist/tsup/dynamic/mod.d.ts +37 -0
- package/dist/tsup/dynamic/mod.js +24 -0
- package/dist/tsup/dynamic/mod.js.map +1 -0
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/mod.cjs +501 -315
- 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 +405 -219
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +21 -18
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +3 -3
- package/dist/tsup/test/mod.d.ts +3 -3
- package/dist/tsup/test/mod.js +18 -15
- package/dist/tsup/test/mod.js.map +1 -1
- package/dist/tsup/utils.cjs +3 -3
- package/dist/tsup/utils.d.cts +1 -1
- package/dist/tsup/utils.d.ts +1 -1
- package/dist/tsup/utils.js +2 -2
- package/dist/tsup/workflow/mod.cjs +307 -282
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +5 -5
- package/dist/tsup/workflow/mod.d.ts +5 -5
- package/dist/tsup/workflow/mod.js +501 -476
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +22 -11
- package/src/actor/config.ts +48 -41
- package/src/actor/contexts/index.ts +7 -2
- package/src/actor/definition.ts +11 -14
- package/src/actor/driver.ts +3 -3
- package/src/actor/errors.ts +9 -3
- package/src/actor/instance/mod.ts +22 -30
- package/src/actor/keys.ts +1 -1
- package/src/actor/mod.ts +20 -20
- package/src/actor/schema.ts +2 -2
- package/src/agent-os/actor/index.ts +38 -18
- package/src/agent-os/actor/preview.ts +1 -2
- package/src/agent-os/actor/session.ts +2 -2
- package/src/agent-os/config.ts +1 -1
- package/src/agent-os/fs/database-vfs.ts +1 -1
- package/src/agent-os/index.ts +16 -15
- package/src/client/actor-common.ts +90 -54
- package/src/client/actor-conn.ts +8 -36
- package/src/client/actor-handle.ts +67 -50
- package/src/client/actor-query.ts +5 -5
- package/src/client/errors.ts +1 -1
- package/src/client/lifecycle-errors.ts +2 -4
- package/src/client/query.ts +1 -1
- package/src/client/queue.ts +8 -3
- package/src/client/raw-utils.ts +8 -6
- package/src/client/resolve-gateway-target.ts +1 -1
- package/src/client/utils.ts +2 -7
- package/src/common/actor-websocket.ts +3 -1
- package/src/common/bare/actor-persist/v1.ts +205 -163
- package/src/common/bare/actor-persist/v2.ts +265 -213
- package/src/common/bare/actor-persist/v3.ts +176 -172
- package/src/common/bare/actor-persist/v4.ts +254 -253
- package/src/common/bare/transport/v1.ts +659 -543
- package/src/common/client-protocol-versioned.ts +66 -64
- package/src/common/database/config.ts +2 -8
- package/src/common/database/native-database.ts +1 -1
- package/src/common/database/shared.ts +1 -0
- package/src/common/encoding.ts +250 -16
- package/src/common/eventsource.ts +1 -1
- package/src/common/inline-websocket-adapter.ts +14 -13
- package/src/common/log.ts +1 -0
- package/src/common/router.ts +13 -17
- package/src/common/utils.ts +0 -149
- package/src/common/websocket-interface.ts +1 -1
- package/src/db/mod.ts +1 -1
- package/src/drivers/engine/actor-driver.ts +63 -72
- package/src/dynamic/instance.ts +32 -0
- package/src/dynamic/internal.ts +50 -0
- package/src/dynamic/isolate-runtime.ts +66 -0
- package/src/dynamic/mod.ts +32 -0
- package/src/engine-client/actor-http-client.ts +1 -1
- package/src/engine-client/actor-websocket-client.ts +6 -5
- package/src/engine-client/api-endpoints.ts +47 -2
- package/src/engine-client/api-utils.ts +2 -2
- package/src/engine-client/driver.ts +1 -1
- package/src/engine-client/mod.ts +6 -3
- package/src/engine-client/ws-proxy.ts +4 -4
- package/src/inspector/client.browser.ts +5 -11
- package/src/inspector/mod.ts +1 -3
- package/src/registry/config/envoy.ts +1 -2
- package/src/registry/config/index.ts +7 -7
- package/src/registry/index.ts +70 -71
- package/src/registry/napi-runtime.ts +7 -2
- package/src/registry/native-validation.ts +10 -12
- package/src/registry/native.ts +179 -153
- package/src/registry/process-metrics.ts +238 -0
- package/src/registry/runtime.ts +1 -3
- package/src/registry/wasm-runtime.ts +3 -2
- package/src/registry/write-through-proxy.ts +40 -0
- package/src/serde.ts +2 -2
- package/src/serverless/configure.ts +18 -7
- package/src/test/mod.ts +11 -8
- package/src/utils/endpoint-parser.ts +1 -1
- package/src/utils/router.ts +1 -1
- package/src/utils/serve.ts +4 -5
- package/src/utils.ts +1 -2
- package/src/workflow/context.ts +61 -33
- package/src/workflow/driver.ts +4 -6
- package/src/workflow/inspector.ts +4 -3
- package/src/workflow/mod.ts +15 -17
- package/dist/tsup/chunk-2NDZ7JCR.cjs.map +0 -1
- package/dist/tsup/chunk-3YY5S6TV.js.map +0 -1
- package/dist/tsup/chunk-4K3MV2MW.cjs.map +0 -1
- package/dist/tsup/chunk-BM3EOY7M.js.map +0 -1
- package/dist/tsup/chunk-G34LIR7S.js.map +0 -1
- package/dist/tsup/chunk-G5RULGYQ.cjs.map +0 -1
- package/dist/tsup/chunk-J5P6S2LC.cjs.map +0 -1
- package/dist/tsup/chunk-KIWH5H3K.js.map +0 -1
- package/dist/tsup/chunk-KU6VKVEK.js.map +0 -1
- package/dist/tsup/chunk-PCBNKI2J.js.map +0 -1
- package/dist/tsup/chunk-PWFGP2US.cjs.map +0 -1
- package/dist/tsup/chunk-T6YVRM4K.js.map +0 -1
- package/dist/tsup/chunk-TE4VCDNY.cjs.map +0 -1
- package/dist/tsup/chunk-WQ4HNA4W.cjs.map +0 -1
- package/dist/tsup/chunk-WU2O2KIE.js.map +0 -1
- package/dist/tsup/chunk-XV52XUWU.js.map +0 -1
- /package/dist/tsup/{chunk-6BI2MS3S.js.map → chunk-3P2JUHWJ.js.map} +0 -0
- /package/dist/tsup/{chunk-CMYS77J6.js.map → chunk-YRQ4F5CD.js.map} +0 -0
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXG25CGSWcjs = require('./chunk-XG25CGSW.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkRDBGKI66cjs = require('./chunk-RDBGKI66.cjs');
|
|
10
10
|
|
|
11
11
|
// src/devtools-loader/log.ts
|
|
12
12
|
function logger() {
|
|
13
|
-
return
|
|
13
|
+
return _chunkRDBGKI66cjs.getLogger.call(void 0, "devtools");
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// src/devtools-loader/index.ts
|
|
17
|
-
var DEFAULT_DEVTOOLS_URL = (version =
|
|
17
|
+
var DEFAULT_DEVTOOLS_URL = (version = _chunkRDBGKI66cjs.VERSION) => `https://releases.rivet.dev/rivet/latest/devtools/mod.js?v=${version}`;
|
|
18
18
|
var scriptId = "rivetkit-devtools-script";
|
|
19
19
|
function injectDevtools(config) {
|
|
20
20
|
if (!window) {
|
|
@@ -35,15 +35,15 @@ function injectDevtools(config) {
|
|
|
35
35
|
// src/client/mod.ts
|
|
36
36
|
function createClient(endpointOrConfig) {
|
|
37
37
|
const configInput = endpointOrConfig === void 0 ? {} : typeof endpointOrConfig === "string" ? { endpoint: endpointOrConfig } : endpointOrConfig;
|
|
38
|
-
const config =
|
|
39
|
-
const driver = new (0,
|
|
38
|
+
const config = _chunkXG25CGSWcjs.ClientConfigSchema.parse(configInput);
|
|
39
|
+
const driver = new (0, _chunkXG25CGSWcjs.RemoteEngineControlClient)(config);
|
|
40
40
|
if (config.devtools) {
|
|
41
41
|
injectDevtools(config);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return _chunkXG25CGSWcjs.createClientWithDriver.call(void 0, driver, config);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
exports.createClient = createClient;
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-Y3JBOFBG.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-Y3JBOFBG.cjs","../../src/devtools-loader/log.ts","../../src/devtools-loader/index.ts","../../src/client/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACRO,SAAS,MAAA,CAAA,EAAS;AACxB,EAAA,OAAO,yCAAA,UAAoB,CAAA;AAC5B;ADUA;AACA;AELA,IAAM,qBAAA,EAAuB,CAAC,QAAA,EAAU,yBAAA,EAAA,GACvC,CAAA,0DAAA,EAA6D,OAAO,CAAA,CAAA;AAEpD;AAEyC;AAC5C,EAAA;AACsD,IAAA;AAClE,IAAA;AACD,EAAA;AAEwC,EAAA;AACO,IAAA;AAClC,IAAA;AAEqD,IAAA;AAClD,IAAA;AACiB,IAAA;AACjC,EAAA;AAE0C,EAAA;AACb,EAAA;AAC9B;AFCuH;AACA;AGuB1G;AAMK,EAAA;AAEkC,EAAA;AAGA,EAAA;AAE9B,EAAA;AACC,IAAA;AACtB,EAAA;AAE+C,EAAA;AAChD;AH/BuH;AACA;AACA;AACA","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-Y3JBOFBG.cjs","sourcesContent":[null,"import { getLogger } from \"@/common/log\";\n\nexport function logger() {\n\treturn getLogger(\"devtools\");\n}\n","import type { ClientConfigInput } from \"@/client/client\";\nimport { VERSION } from \"@/utils\";\nimport { logger } from \"./log\";\n\ndeclare global {\n\t// Injected via tsup config\n\t// biome-ignore lint/style/noVar: required for global declaration\n\tvar CUSTOM_RIVETKIT_DEVTOOLS_URL: string | undefined;\n}\n\nconst DEFAULT_DEVTOOLS_URL = (version = VERSION) =>\n\t`https://releases.rivet.dev/rivet/latest/devtools/mod.js?v=${version}`;\n\nconst scriptId = \"rivetkit-devtools-script\";\n\nexport function injectDevtools(config: ClientConfigInput) {\n\tif (!window) {\n\t\tlogger().warn(\"devtools not available outside browser environment\");\n\t\treturn;\n\t}\n\n\tif (!document.getElementById(scriptId)) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.id = scriptId;\n\t\tscript.src =\n\t\t\tglobalThis.CUSTOM_RIVETKIT_DEVTOOLS_URL || DEFAULT_DEVTOOLS_URL();\n\t\tscript.async = true;\n\t\tdocument.head.appendChild(script);\n\t}\n\n\twindow.__rivetkit = window.__rivetkit || [];\n\twindow.__rivetkit.push(config);\n}\n","import { injectDevtools } from \"@/devtools-loader\";\nimport { RemoteEngineControlClient } from \"@/engine-client/mod\";\nimport type { Registry } from \"@/registry\";\nimport {\n\ttype Client,\n\ttype ClientConfigInput,\n\tcreateClientWithDriver,\n} from \"./client\";\nimport { ClientConfigSchema } from \"./config\";\n\nexport type { ActorDefinition, AnyActorDefinition } from \"@/actor/definition\";\nexport {\n\tActorClientError,\n\tActorConnDisposed,\n\tActorError,\n\tMalformedResponseMessage,\n\tManagerError,\n\tRivetError,\n\tUserError,\n} from \"@/client/errors\";\nexport type { CreateRequest } from \"@/client/query\";\nexport type { Encoding } from \"@/common/encoding\";\nexport type {\n\tActorActionFunction,\n\tActorActionOptions,\n\tActorConnectOptions,\n\tActorGatewayOptions,\n} from \"./actor-common\";\nexport type {\n\tActorConn,\n\tActorConnStatus,\n\tConnectionStateCallback,\n\tEventUnsubscribe,\n\tStatusChangeCallback,\n} from \"./actor-conn\";\nexport { ActorConnRaw } from \"./actor-conn\";\nexport type { ActorHandle } from \"./actor-handle\";\nexport { ActorHandleRaw } from \"./actor-handle\";\nexport type {\n\tActorAccessor,\n\tClient,\n\tClientConfigInput,\n\tClientRaw,\n\tCreateOptions,\n\tExtractActorsFromRegistry,\n\tExtractRegistryFromClient,\n\tGetOptions,\n\tGetWithIdOptions,\n\tQueryOptions,\n\tRegion,\n} from \"./client\";\n\n/**\n * Creates a client with the actor accessor proxy.\n */\nexport function createClient<A extends Registry<any>>(\n\tendpointOrConfig?: string | ClientConfigInput,\n): Client<A> {\n\t// Parse config\n\tconst configInput =\n\t\tendpointOrConfig === undefined\n\t\t\t? {}\n\t\t\t: typeof endpointOrConfig === \"string\"\n\t\t\t\t? { endpoint: endpointOrConfig }\n\t\t\t\t: endpointOrConfig;\n\tconst config = ClientConfigSchema.parse(configInput);\n\n\t// Create client\n\tconst driver = new RemoteEngineControlClient(config);\n\n\tif (config.devtools) {\n\t\tinjectDevtools(config);\n\t}\n\n\treturn createClientWithDriver<A>(driver, config);\n}\n"]}
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
ClientConfigSchema,
|
|
3
3
|
RemoteEngineControlClient,
|
|
4
4
|
createClientWithDriver
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TTLUIDVH.js";
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
getLogger
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4FP4FFB5.js";
|
|
10
10
|
|
|
11
11
|
// src/devtools-loader/log.ts
|
|
12
12
|
function logger() {
|
|
@@ -46,4 +46,4 @@ function createClient(endpointOrConfig) {
|
|
|
46
46
|
export {
|
|
47
47
|
createClient
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-YRQ4F5CD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-ZA7FLHKH.cjs","../../src/common/database/shared.ts"],"names":[],"mappings":"AAAA;ACIA,SAAS,oBAAA,CAAqB,KAAA,EAAyB;AACtD,EAAA,GAAA,CACC,MAAA,IAAU,KAAA,GACV,OAAO,MAAA,IAAU,SAAA,GACjB,OAAO,MAAA,IAAU,SAAA,GACjB,OAAO,MAAA,IAAU,SAAA,GACjB,MAAA,WAAiB,UAAA,EAChB;AACD,IAAA,OAAO,IAAA;AAAA,EACR;AAEA,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACzB,IAAA,OAAO,KAAA,CAAM,KAAA,CAAM,CAAC,IAAA,EAAA,GAAS,OAAO,KAAA,IAAS,QAAQ,CAAA;AAAA,EACtD;AAEA,EAAA,OAAO,KAAA;AACR;AAEA,SAAS,aAAA,CAAc,KAAA,EAAkD;AACxE,EAAA,GAAA,CAAI,CAAC,MAAA,GAAS,OAAO,MAAA,IAAU,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChE,IAAA,OAAO,KAAA;AAAA,EACR;AACA,EAAA,OAAO,MAAA,CAAO,cAAA,CAAe,KAAK,EAAA,IAAM,MAAA,CAAO,SAAA;AAChD;AAEO,SAAS,qBAAA,CACf,KAAA,EAC+B;AAC/B,EAAA,GAAA,CAAI,CAAC,aAAA,CAAc,KAAK,CAAA,EAAG;AAC1B,IAAA,OAAO,KAAA;AAAA,EACR;AAEA,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA,CAAE,KAAA,CAAM,CAAC,KAAA,EAAA,GAAU,oBAAA,CAAqB,KAAK,CAAC,CAAA;AACzE;AASO,SAAS,gBAAA,CACf,KAAA,EACiB;AACjB,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACzB,IAAA,IAAA,CAAA,MAAW,MAAA,GAAS,KAAA,EAAO;AAC1B,MAAA,GAAA,CAAI,CAAC,oBAAA,CAAqB,KAAK,CAAA,EAAG;AACjC,QAAA,MAAM,IAAI,KAAA;AAAA,UACT,CAAA,iCAAA,EAAoC,OAAO,KAAK,CAAA;AAAA,QAAA;AACjD,MAAA;AACD,IAAA;AAED,IAAA;AAAO,EAAA;AAGR,EAAA;AACC,IAAA;AAAO,EAAA;AAGR,EAAA;AACD;AAKO;AAAiB,EAAA;AACb,EAAA;AACkB,EAAA;AAG3B,IAAA;AACC,MAAA;AAAgE,IAAA;AAEjE,IAAA;AAAe,EAAA;AAChB,EAAA;AAGC,IAAA;AACA,IAAA;AACA,IAAA;AACC,MAAA;AAAK,IAAA;AACN,EAAA;AACD,EAAA;AAGC,IAAA;AACA,IAAA;AACC,MAAA;AAAgB,IAAA;AAEhB,MAAA;AAAa,IAAA;AACd,EAAA;AAEF;ADlCA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-ZA7FLHKH.cjs","sourcesContent":[null,"import type { SqliteBindings } from \"./config\";\n\ntype SqliteBindingObject = Record<string, unknown>;\n\nfunction isSqliteBindingValue(value: unknown): boolean {\n\tif (\n\t\tvalue === null ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"bigint\" ||\n\t\tvalue instanceof Uint8Array\n\t) {\n\t\treturn true;\n\t}\n\n\tif (Array.isArray(value)) {\n\t\treturn value.every((item) => typeof item === \"number\");\n\t}\n\n\treturn false;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\treturn Object.getPrototypeOf(value) === Object.prototype;\n}\n\nexport function isSqliteBindingObject(\n\tvalue: unknown,\n): value is SqliteBindingObject {\n\tif (!isPlainObject(value)) {\n\t\treturn false;\n\t}\n\n\treturn Object.values(value).every((entry) => isSqliteBindingValue(entry));\n}\n\nexport function isSqliteBindingArray(value: unknown): value is unknown[] {\n\treturn (\n\t\tArray.isArray(value) &&\n\t\tvalue.every((entry) => isSqliteBindingValue(entry))\n\t);\n}\n\nexport function toSqliteBindings(\n\tinput: unknown[] | SqliteBindingObject,\n): SqliteBindings {\n\tif (Array.isArray(input)) {\n\t\tfor (const value of input) {\n\t\t\tif (!isSqliteBindingValue(value)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`unsupported sqlite binding type: ${typeof value}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn input as SqliteBindings;\n\t}\n\n\tif (isSqliteBindingObject(input)) {\n\t\treturn input as SqliteBindings;\n\t}\n\n\tthrow new Error(\"unsupported sqlite binding collection\");\n}\n\n/**\n * Serialize async operations on a shared non-reentrant resource.\n */\nexport class AsyncMutex {\n\t#locked = false;\n\t#waiting: (() => void)[] = [];\n\n\tasync acquire(): Promise<void> {\n\t\twhile (this.#locked) {\n\t\t\tawait new Promise<void>((resolve) => this.#waiting.push(resolve));\n\t\t}\n\t\tthis.#locked = true;\n\t}\n\n\trelease(): void {\n\t\tthis.#locked = false;\n\t\tconst next = this.#waiting.shift();\n\t\tif (next) {\n\t\t\tnext();\n\t\t}\n\t}\n\n\tasync run<T>(fn: () => Promise<T>): Promise<T> {\n\t\tawait this.acquire();\n\t\ttry {\n\t\t\treturn await fn();\n\t\t} finally {\n\t\t\tthis.release();\n\t\t}\n\t}\n}\n"]}
|
package/dist/tsup/client/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkY3JBOFBGcjs = require('../chunk-Y3JBOFBG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,16 +8,16 @@ var _chunk3LGP4JSOcjs = require('../chunk-3LGP4JSO.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
11
|
+
var _chunkXG25CGSWcjs = require('../chunk-XG25CGSW.cjs');
|
|
12
|
+
require('../chunk-VE2X4KMG.cjs');
|
|
13
|
+
require('../chunk-GX6W4MW3.cjs');
|
|
14
|
+
require('../chunk-ZA7FLHKH.cjs');
|
|
15
|
+
require('../chunk-LW5HNCWD.cjs');
|
|
16
|
+
require('../chunk-RDBGKI66.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkKORQB2IRcjs = require('../chunk-KORQB2IR.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -29,5 +29,5 @@ var _chunkQAZLM4WTcjs = require('../chunk-QAZLM4WT.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
exports.ActorClientError =
|
|
32
|
+
exports.ActorClientError = _chunkXG25CGSWcjs.ActorClientError; exports.ActorConnDisposed = _chunkXG25CGSWcjs.ActorConnDisposed; exports.ActorConnRaw = _chunkXG25CGSWcjs.ActorConnRaw; exports.ActorError = _chunkKORQB2IRcjs.RivetError; exports.ActorHandleRaw = _chunkXG25CGSWcjs.ActorHandleRaw; exports.MalformedResponseMessage = _chunkXG25CGSWcjs.MalformedResponseMessage; exports.ManagerError = _chunkXG25CGSWcjs.ManagerError; exports.RivetError = _chunkKORQB2IRcjs.RivetError; exports.UserError = _chunkKORQB2IRcjs.UserError; exports.createClient = _chunkY3JBOFBGcjs.createClient;
|
|
33
33
|
//# sourceMappingURL=mod.cjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { aq as Registry, V as Client } from '../config-CTwe3WwC.cjs';
|
|
2
|
+
export { a$ as ActorAccessor, b0 as ActorActionFunction, b1 as ActorActionOptions, b2 as ActorConn, b3 as ActorConnRaw, b4 as ActorConnStatus, b5 as ActorConnectOptions, r as ActorDefinition, b6 as ActorGatewayOptions, b7 as ActorHandle, b8 as ActorHandleRaw, A as AnyActorDefinition, b9 as ClientRaw, ba as ConnectionStateCallback, bb as CreateOptions, bc as CreateRequest, a4 as Encoding, bd as EventUnsubscribe, be as ExtractActorsFromRegistry, bf as ExtractRegistryFromClient, bg as GetOptions, bh as GetWithIdOptions, bi as QueryOptions, bj as Region, bk as StatusChangeCallback } from '../config-CTwe3WwC.cjs';
|
|
3
3
|
import z from 'zod/v4';
|
|
4
4
|
import { GetUpgradeWebSocket } from '../utils.cjs';
|
|
5
5
|
export { R as ActorError, R as RivetError, U as UserError } from '../utils-DVekpm4I.cjs';
|
|
6
|
-
import '
|
|
7
|
-
import '../config-CxjGYf4K.cjs';
|
|
6
|
+
import '../config-D49x8NpL.cjs';
|
|
8
7
|
import '@rivetkit/rivetkit-wasm';
|
|
9
8
|
import 'zod';
|
|
10
9
|
import 'pino';
|
|
10
|
+
import '@rivetkit/virtual-websocket';
|
|
11
11
|
import '@standard-schema/spec';
|
|
12
12
|
import 'hono';
|
|
13
13
|
import 'hono/utils/http-status';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { aq as Registry, V as Client } from '../config-De5UVu0V.js';
|
|
2
|
+
export { a$ as ActorAccessor, b0 as ActorActionFunction, b1 as ActorActionOptions, b2 as ActorConn, b3 as ActorConnRaw, b4 as ActorConnStatus, b5 as ActorConnectOptions, r as ActorDefinition, b6 as ActorGatewayOptions, b7 as ActorHandle, b8 as ActorHandleRaw, A as AnyActorDefinition, b9 as ClientRaw, ba as ConnectionStateCallback, bb as CreateOptions, bc as CreateRequest, a4 as Encoding, bd as EventUnsubscribe, be as ExtractActorsFromRegistry, bf as ExtractRegistryFromClient, bg as GetOptions, bh as GetWithIdOptions, bi as QueryOptions, bj as Region, bk as StatusChangeCallback } from '../config-De5UVu0V.js';
|
|
3
3
|
import z from 'zod/v4';
|
|
4
4
|
import { GetUpgradeWebSocket } from '../utils.js';
|
|
5
5
|
export { R as ActorError, R as RivetError, U as UserError } from '../utils-DVekpm4I.js';
|
|
6
|
-
import '
|
|
7
|
-
import '../config-CxjGYf4K.js';
|
|
6
|
+
import '../config-D49x8NpL.js';
|
|
8
7
|
import '@rivetkit/rivetkit-wasm';
|
|
9
8
|
import 'zod';
|
|
10
9
|
import 'pino';
|
|
10
|
+
import '@rivetkit/virtual-websocket';
|
|
11
11
|
import '@standard-schema/spec';
|
|
12
12
|
import 'hono';
|
|
13
13
|
import 'hono/utils/http-status';
|
package/dist/tsup/client/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-YRQ4F5CD.js";
|
|
4
4
|
import {
|
|
5
5
|
ActorClientError,
|
|
6
6
|
ActorConnDisposed,
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
ActorHandleRaw,
|
|
9
9
|
MalformedResponseMessage,
|
|
10
10
|
ManagerError
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-TTLUIDVH.js";
|
|
12
|
+
import "../chunk-HXUEHHJF.js";
|
|
13
|
+
import "../chunk-KRC4L3YB.js";
|
|
14
|
+
import "../chunk-JZ7TWV65.js";
|
|
15
|
+
import "../chunk-3P2JUHWJ.js";
|
|
16
|
+
import "../chunk-4FP4FFB5.js";
|
|
17
17
|
import {
|
|
18
18
|
RivetError,
|
|
19
19
|
UserError
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-BRP62GZC.js";
|
|
21
21
|
export {
|
|
22
22
|
ActorClientError,
|
|
23
23
|
ActorConnDisposed,
|
package/dist/tsup/common/log.cjs
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-
|
|
9
|
+
var _chunkRDBGKI66cjs = require('../chunk-RDBGKI66.cjs');
|
|
10
|
+
require('../chunk-KORQB2IR.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -16,5 +16,5 @@ require('../chunk-QAZLM4WT.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
exports.LogLevelSchema =
|
|
19
|
+
exports.LogLevelSchema = _chunkRDBGKI66cjs.LogLevelSchema; exports.configureBaseLogger = _chunkRDBGKI66cjs.configureBaseLogger; exports.configureDefaultLogger = _chunkRDBGKI66cjs.configureDefaultLogger; exports.getBaseLogger = _chunkRDBGKI66cjs.getBaseLogger; exports.getIncludeTarget = _chunkRDBGKI66cjs.getIncludeTarget; exports.getLogger = _chunkRDBGKI66cjs.getLogger; exports.getPinoLevel = _chunkRDBGKI66cjs.getPinoLevel;
|
|
20
20
|
//# sourceMappingURL=log.cjs.map
|
package/dist/tsup/common/log.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var _chunkLW5HNCWDcjs = require('../chunk-LW5HNCWD.cjs');
|
|
4
|
+
require('../chunk-RDBGKI66.cjs');
|
|
5
|
+
require('../chunk-KORQB2IR.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.importWebSocket =
|
|
8
|
+
exports.importWebSocket = _chunkLW5HNCWDcjs.importWebSocket;
|
|
9
9
|
//# sourceMappingURL=websocket.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import {
|
|
3
|
-
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-CxjGYf4K.cjs';
|
|
2
|
+
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-D49x8NpL.cjs';
|
|
4
3
|
import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
|
|
5
4
|
import { z as z$1 } from 'zod';
|
|
6
5
|
import { Logger } from 'pino';
|
|
6
|
+
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
7
7
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
8
|
import { Context, Hono } from 'hono';
|
|
9
9
|
import { GetUpgradeWebSocket } from './utils.cjs';
|
|
@@ -70,7 +70,7 @@ declare const EncodingSchema: z.ZodEnum<{
|
|
|
70
70
|
*/
|
|
71
71
|
type Encoding = z.infer<typeof EncodingSchema>;
|
|
72
72
|
|
|
73
|
-
declare const ActorsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodCustom<
|
|
73
|
+
declare const ActorsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodCustom<AnyActorDefinition, AnyActorDefinition>>;
|
|
74
74
|
type RegistryActors = z$1.infer<typeof ActorsSchema>;
|
|
75
75
|
declare const RuntimeKindSchema: z$1.ZodEnum<{
|
|
76
76
|
auto: "auto";
|
|
@@ -191,7 +191,7 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
191
191
|
envoyKey: z$1.ZodOptional<z$1.ZodString>;
|
|
192
192
|
}, z$1.core.$strip>>>;
|
|
193
193
|
shutdown: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
|
|
194
|
-
gracePeriodMs: z$1.ZodOptional<z$1.ZodNumber
|
|
194
|
+
gracePeriodMs: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
195
195
|
disableSignalHandlers: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
196
196
|
}, z$1.core.$strip>>>;
|
|
197
197
|
}, z$1.core.$strip>, z$1.ZodTransform<{
|
|
@@ -240,8 +240,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
240
240
|
envoyKey?: string | undefined;
|
|
241
241
|
};
|
|
242
242
|
shutdown: {
|
|
243
|
+
gracePeriodMs: number;
|
|
243
244
|
disableSignalHandlers: boolean;
|
|
244
|
-
gracePeriodMs?: number | undefined;
|
|
245
245
|
};
|
|
246
246
|
staticDir?: string | undefined;
|
|
247
247
|
httpHost?: string | undefined;
|
|
@@ -297,8 +297,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
|
|
|
297
297
|
envoyKey?: string | undefined;
|
|
298
298
|
};
|
|
299
299
|
shutdown: {
|
|
300
|
+
gracePeriodMs: number;
|
|
300
301
|
disableSignalHandlers: boolean;
|
|
301
|
-
gracePeriodMs?: number | undefined;
|
|
302
302
|
};
|
|
303
303
|
staticDir?: string | undefined;
|
|
304
304
|
httpHost?: string | undefined;
|
|
@@ -444,7 +444,7 @@ interface QueueSchemaDefinition<TContext = any> {
|
|
|
444
444
|
type EventSchema<TContext = any> = PrimitiveSchema | EventSchemaDefinition<TContext>;
|
|
445
445
|
type QueueSchema = PrimitiveSchema | QueueSchemaDefinition<any> | QueueTypeToken<unknown, unknown, any>;
|
|
446
446
|
type EventSchemaConfig<TContext = any> = Record<string, EventSchema<TContext>>;
|
|
447
|
-
type QueueSchemaConfig<
|
|
447
|
+
type QueueSchemaConfig<_TContext = any> = Record<string, QueueSchema>;
|
|
448
448
|
type InferSchema<T> = T extends QueueSchemaDefinition<any> ? InferSchema<T["message"]> : T extends QueueTypeToken<infer M, unknown, any> ? M : T extends EventSchemaDefinition<any> ? InferSchema<T["schema"]> : T extends StandardSchemaV1<any, infer O> ? O : T extends EventTypeToken<infer R, any> ? R : never;
|
|
449
449
|
type InferSchemaMap<T extends Record<string, unknown>> = {
|
|
450
450
|
[K in keyof T]: InferSchema<T[K]>;
|
|
@@ -455,10 +455,12 @@ type InferQueueCompleteMap<T extends QueueSchemaConfig> = {
|
|
|
455
455
|
};
|
|
456
456
|
type InferEventArgs<T> = T extends readonly unknown[] ? number extends T["length"] ? [T] : T : [T];
|
|
457
457
|
|
|
458
|
-
interface BaseActorDefinition<S, CP, CS, V, I, DB extends AnyDatabaseProvider, E extends EventSchemaConfig = Record<never, never>, Q extends QueueSchemaConfig = Record<never, never>,
|
|
458
|
+
interface BaseActorDefinition<S, CP, CS, V, I, DB extends AnyDatabaseProvider, E extends EventSchemaConfig = Record<never, never>, Q extends QueueSchemaConfig = Record<never, never>, _R extends Actions<S, CP, CS, V, I, DB, E, Q> = Actions<S, CP, CS, V, I, DB, E, Q>> {
|
|
459
459
|
readonly config: ActorConfig<S, CP, CS, V, I, DB, E, Q>;
|
|
460
460
|
}
|
|
461
|
-
|
|
461
|
+
interface AnyActorDefinition {
|
|
462
|
+
readonly config: any;
|
|
463
|
+
}
|
|
462
464
|
type AnyStaticActorDefinition = ActorDefinition<any, any, any, any, any, any, any, any, any>;
|
|
463
465
|
declare class ActorDefinition<S, CP, CS, V, I, DB extends AnyDatabaseProvider, E extends EventSchemaConfig = Record<never, never>, Q extends QueueSchemaConfig = Record<never, never>, R extends Actions<S, CP, CS, V, I, DB, E, Q> = Actions<S, CP, CS, V, I, DB, E, Q>> implements BaseActorDefinition<S, CP, CS, V, I, DB, E, Q, R> {
|
|
464
466
|
#private;
|
|
@@ -592,6 +594,25 @@ declare class Registry<A extends RegistryActors> {
|
|
|
592
594
|
* ```
|
|
593
595
|
*/
|
|
594
596
|
serve(): ServerlessHandler;
|
|
597
|
+
/**
|
|
598
|
+
* Starts an HTTP server that dispatches every request through the
|
|
599
|
+
* serverless handler. Uses `crossPlatformServe` to pick the right
|
|
600
|
+
* runtime (Node, Bun, Deno).
|
|
601
|
+
*
|
|
602
|
+
* @param opts.port Port to listen on. Defaults to 3000.
|
|
603
|
+
* @param opts.publicDir If set, serves static files from this directory
|
|
604
|
+
* before falling through to the registry handler.
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* ```ts
|
|
608
|
+
* await registry.listen();
|
|
609
|
+
* await registry.listen({ port: 8080, publicDir: "./public" });
|
|
610
|
+
* ```
|
|
611
|
+
*/
|
|
612
|
+
listen(opts?: {
|
|
613
|
+
port?: number;
|
|
614
|
+
publicDir?: string;
|
|
615
|
+
}): Promise<void>;
|
|
595
616
|
startEnvoy(): void;
|
|
596
617
|
/**
|
|
597
618
|
* Starts the actor envoy for standalone server deployments.
|
|
@@ -631,6 +652,8 @@ interface QueueSendResult<TResponse = unknown> {
|
|
|
631
652
|
* @returns {Promise<Response>}
|
|
632
653
|
*/
|
|
633
654
|
type ActorActionFunction<Args extends Array<unknown> = unknown[], Response = unknown> = (...args: Args extends [unknown, ...infer Rest] ? Rest : Args) => Promise<Response>;
|
|
655
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
656
|
+
type LooseEventSubscribe = (eventName: string, callback: (...args: any[]) => void) => () => void;
|
|
634
657
|
interface ActorGatewayOptions {
|
|
635
658
|
skipReadyWait?: boolean;
|
|
636
659
|
}
|
|
@@ -643,9 +666,15 @@ type ActorWebSocketOptions = ActorGatewayOptions;
|
|
|
643
666
|
/**
|
|
644
667
|
* Maps action methods from actor definition to typed function signatures.
|
|
645
668
|
*/
|
|
646
|
-
type ActorDefinitionActions<AD extends AnyActorDefinition> = AD extends
|
|
669
|
+
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : AD extends {
|
|
670
|
+
config: {
|
|
671
|
+
actions?: infer R;
|
|
672
|
+
};
|
|
673
|
+
} ? {
|
|
647
674
|
[K in keyof R]: R[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Return> : never;
|
|
648
|
-
} :
|
|
675
|
+
} : AD extends BaseActorDefinition<any, any, any, any, any, any, any, any, infer R> ? {
|
|
676
|
+
[K in keyof R]: R[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Return> : never;
|
|
677
|
+
} : {};
|
|
649
678
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
650
679
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
651
680
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
|
|
@@ -656,13 +685,31 @@ type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
|
|
|
656
685
|
<K extends keyof TEvents & string>(eventName: K, callback: (...args: InferEventArgs<InferSchemaMap<TEvents>[K]>) => void): () => void;
|
|
657
686
|
(eventName: keyof TEvents extends never ? string : never, callback: (...args: any[]) => void): () => void;
|
|
658
687
|
};
|
|
659
|
-
type ActorDefinitionQueueSend<AD extends AnyActorDefinition> = AD
|
|
688
|
+
type ActorDefinitionQueueSend<AD extends AnyActorDefinition> = IsAny<AD> extends true ? {
|
|
689
|
+
send: ActorQueueSend<Record<string, any>>;
|
|
690
|
+
} : AD extends {
|
|
691
|
+
config: {
|
|
692
|
+
queues?: infer Q;
|
|
693
|
+
};
|
|
694
|
+
} ? Q extends QueueSchemaConfig ? {
|
|
660
695
|
send: ActorQueueSend<Q>;
|
|
661
|
-
} :
|
|
662
|
-
|
|
696
|
+
} : {} : AD extends BaseActorDefinition<any, any, any, any, any, any, any, infer Q, any> ? Q extends QueueSchemaConfig ? {
|
|
697
|
+
send: ActorQueueSend<Q>;
|
|
698
|
+
} : {} : {};
|
|
699
|
+
type ActorDefinitionEventSubscriptions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? {
|
|
700
|
+
on: LooseEventSubscribe;
|
|
701
|
+
once: LooseEventSubscribe;
|
|
702
|
+
} : AD extends {
|
|
703
|
+
config: {
|
|
704
|
+
events?: infer E;
|
|
705
|
+
};
|
|
706
|
+
} ? E extends EventSchemaConfig ? {
|
|
707
|
+
on: ActorEventSubscribe<E>;
|
|
708
|
+
once: ActorEventSubscribe<E>;
|
|
709
|
+
} : {} : AD extends BaseActorDefinition<any, any, any, any, any, any, infer E, any, any> ? E extends EventSchemaConfig ? {
|
|
663
710
|
on: ActorEventSubscribe<E>;
|
|
664
711
|
once: ActorEventSubscribe<E>;
|
|
665
|
-
} :
|
|
712
|
+
} : {} : {};
|
|
666
713
|
|
|
667
714
|
type ActorResolutionState = ActorQuery;
|
|
668
715
|
|
|
@@ -1120,6 +1167,7 @@ declare function createClientWithDriver<A extends Registry<any>>(driver: EngineC
|
|
|
1120
1167
|
|
|
1121
1168
|
declare const DEFAULT_SLEEP_GRACE_PERIOD = 15000;
|
|
1122
1169
|
declare const ACTOR_CONTEXT_INTERNAL_SYMBOL: unique symbol;
|
|
1170
|
+
declare const RAW_STATE_SYMBOL: unique symbol;
|
|
1123
1171
|
declare const CONN_DRIVER_SYMBOL: unique symbol;
|
|
1124
1172
|
declare const CONN_STATE_MANAGER_SYMBOL: unique symbol;
|
|
1125
1173
|
interface ActorLogger {
|
|
@@ -1236,7 +1284,7 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
|
1236
1284
|
iter<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueIterOptions<TName, TCompletable>): AsyncIterable<any>;
|
|
1237
1285
|
[key: string]: any;
|
|
1238
1286
|
}
|
|
1239
|
-
interface Conn<
|
|
1287
|
+
interface Conn<_TState = unknown, TConnParams = unknown, TConnState = unknown, _TVars = unknown, _TInput = unknown, _TDatabase extends AnyDatabaseProvider = AnyDatabaseProvider, _TEvents extends EventSchemaConfig = Record<never, never>, _TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
1240
1288
|
id: string;
|
|
1241
1289
|
params: TConnParams;
|
|
1242
1290
|
state: TConnState;
|
|
@@ -1248,6 +1296,8 @@ interface Conn<TState = unknown, TConnParams = unknown, TConnState = unknown, TV
|
|
|
1248
1296
|
type AnyConn = Conn<any, any, any, any, any, any, any, any>;
|
|
1249
1297
|
interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
1250
1298
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
1299
|
+
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
1300
|
+
[RAW_STATE_SYMBOL](): TState;
|
|
1251
1301
|
state: TState;
|
|
1252
1302
|
vars: TVars;
|
|
1253
1303
|
readonly kv: ActorKv;
|
|
@@ -1457,7 +1507,7 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
1457
1507
|
preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
|
|
1458
1508
|
}, z.core.$strict>>;
|
|
1459
1509
|
}, z.core.$strict>;
|
|
1460
|
-
type CreateState<TState,
|
|
1510
|
+
type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
1461
1511
|
state: TState;
|
|
1462
1512
|
} | {
|
|
1463
1513
|
createState: (c: CreateContext<TState, TInput, TDatabase, TEvents, TQueues>, input: TInput) => TState | Promise<TState>;
|
|
@@ -1470,7 +1520,7 @@ type CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase e
|
|
|
1470
1520
|
/**
|
|
1471
1521
|
* @experimental
|
|
1472
1522
|
*/
|
|
1473
|
-
type CreateVars<TState,
|
|
1523
|
+
type CreateVars<TState, _TConnParams, _TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
1474
1524
|
/**
|
|
1475
1525
|
* @experimental
|
|
1476
1526
|
*/
|
|
@@ -1739,4 +1789,4 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
1739
1789
|
}, z.core.$strip>>;
|
|
1740
1790
|
}, z.core.$strip>;
|
|
1741
1791
|
|
|
1742
|
-
export { DocConfigurePoolSchema as $, type AnyActorDefinition as A, type BaseActorDefinition as B, type ConnectContext as C, type DestroyContext as D, type EventSchemaConfig as E, type ActorSchedule as F, type ActorTypes as G, ActorsSchema as H, type AnyActorInstance as I, type AnyClient as J, type AnyConn as K, type AnyStaticActorDefinition as L, type MigrateContext as M, type AnyStaticActorInstance as N, type AuthIntent as O, type BaseActorInstance as P, type QueueSchemaConfig as Q, type RequestContext as R, type SleepContext as S, CONN_DRIVER_SYMBOL as T, CONN_STATE_MANAGER_SYMBOL as U, type Client as V, type WakeContext as W, type Conn as X, DEFAULT_SLEEP_GRACE_PERIOD as Y, DocActorConfigSchema as Z, DocActorOptionsSchema as _, type ActionContext as a, type
|
|
1792
|
+
export { DocConfigurePoolSchema as $, type AnyActorDefinition as A, type BaseActorDefinition as B, type ConnectContext as C, type DestroyContext as D, type EventSchemaConfig as E, type ActorSchedule as F, type ActorTypes as G, ActorsSchema as H, type AnyActorInstance as I, type AnyClient as J, type AnyConn as K, type AnyStaticActorDefinition as L, type MigrateContext as M, type AnyStaticActorInstance as N, type AuthIntent as O, type BaseActorInstance as P, type QueueSchemaConfig as Q, type RequestContext as R, type SleepContext as S, CONN_DRIVER_SYMBOL as T, CONN_STATE_MANAGER_SYMBOL as U, type Client as V, type WakeContext as W, type Conn as X, DEFAULT_SLEEP_GRACE_PERIOD as Y, DocActorConfigSchema as Z, DocActorOptionsSchema as _, type ActionContext as a, type ActorAccessor as a$, DocEnvoyConfigSchema as a0, DocRegistryConfigSchema as a1, DocServerlessConfigSchema as a2, DocSqliteConfigSchema as a3, type Encoding as a4, type FetchHandler as a5, type GlobalActorOptions as a6, type GlobalActorOptionsInput as a7, GlobalActorOptionsSchema as a8, type InspectorUnsubscribe as a9, RuntimeKindSchema as aA, type ServerlessHandler as aB, type SqliteBackend as aC, SqliteBackendSchema as aD, type SqliteConfig as aE, SqliteConfigSchema as aF, type TestConfig as aG, TestConfigSchema as aH, type Type as aI, type WasmRuntimeBindings as aJ, type WasmRuntimeConfig as aK, WasmRuntimeConfigSchema as aL, type WasmRuntimeInitInput as aM, type WorkflowInspectorConfig as aN, actor as aO, buildActorNames as aP, createClientWithDriver as aQ, event as aR, getRunFunction as aS, getRunInspectorConfig as aT, getRunMetadata as aU, isStaticActorDefinition as aV, isStaticActorInstance as aW, lookupInRegistry as aX, queue as aY, setup as aZ, test as a_, type InstanceActorOptions as aa, type InstanceActorOptionsInput as ab, InstanceActorOptionsSchema as ac, type QueueEnqueueAndWaitOptions as ad, type QueueFilterName as ae, type QueueIterOptions as af, type QueueMessageOf as ag, type QueueName as ah, type QueueNextBatchOptions as ai, type QueueNextOptions as aj, type QueueResultMessageForName as ak, type QueueTryNextBatchOptions as al, type QueueTryNextOptions as am, type QueueWaitOptions as an, RAW_STATE_SYMBOL as ao, RUN_FUNCTION_CONFIG_SYMBOL as ap, Registry as aq, type RegistryActors as ar, type RegistryConfig as as, type RegistryConfigInput as at, RegistryConfigSchema as au, type RegistryRoutes as av, type RunConfig as aw, RunConfigSchema as ax, type RunInspectorConfig as ay, type RuntimeKind as az, type BeforeActionResponseContext as b, type ActorActionFunction as b0, type ActorActionOptions as b1, type ActorConn as b2, ActorConnRaw as b3, type ActorConnStatus as b4, type ActorConnectOptions as b5, type ActorGatewayOptions as b6, type ActorHandle as b7, ActorHandleRaw as b8, ClientRaw as b9, type ConnectionStateCallback as ba, type CreateOptions as bb, type CreateRequest as bc, type EventUnsubscribe as bd, type ExtractActorsFromRegistry as be, type ExtractRegistryFromClient as bf, type GetOptions as bg, type GetWithIdOptions as bh, type QueryOptions as bi, type Region as bj, type StatusChangeCallback as bk, type InferSchemaMap as bl, type InferEventArgs as bm, type BeforeConnectContext as c, type CreateConnStateContext as d, type CreateContext as e, type CreateVarsContext as f, type DisconnectContext as g, type RunContext as h, type StateChangeContext as i, type WebSocketContext as j, ACTOR_CONTEXT_INTERNAL_SYMBOL as k, type Actions as l, type ActorConfig as m, type ActorConfigInput as n, ActorConfigSchema as o, type ActorContext as p, type ActorContextOf as q, ActorDefinition as r, type ActorKey as s, type ActorKv as t, type ActorLogger as u, type ActorOptions as v, type ActorOptionsInput as w, ActorOptionsSchema as x, type ActorQuery as y, type ActorQueue as z };
|
|
@@ -100,8 +100,7 @@ interface RawDatabaseClient {
|
|
|
100
100
|
/**
|
|
101
101
|
* Drizzle database client interface (will be extended by drizzle-orm types)
|
|
102
102
|
*/
|
|
103
|
-
|
|
104
|
-
}
|
|
103
|
+
type DrizzleDatabaseClient = {};
|
|
105
104
|
type ExecuteFunction = <TRow extends Record<string, unknown> = Record<string, unknown>>(query: string, ...args: unknown[]) => Promise<TRow[]>;
|
|
106
105
|
type RawAccess = {
|
|
107
106
|
/**
|
|
@@ -100,8 +100,7 @@ interface RawDatabaseClient {
|
|
|
100
100
|
/**
|
|
101
101
|
* Drizzle database client interface (will be extended by drizzle-orm types)
|
|
102
102
|
*/
|
|
103
|
-
|
|
104
|
-
}
|
|
103
|
+
type DrizzleDatabaseClient = {};
|
|
105
104
|
type ExecuteFunction = <TRow extends Record<string, unknown> = Record<string, unknown>>(query: string, ...args: unknown[]) => Promise<TRow[]>;
|
|
106
105
|
type RawAccess = {
|
|
107
106
|
/**
|