rivetkit 0.0.0-main.41efcce → 0.0.0-main.49693dc
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 +939 -104
- package/dist/browser/client.js +1867 -900
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +252 -129
- package/dist/browser/inspector/client.js +2079 -233
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +6 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.d.cts +1 -74
- package/dist/tsup/actor/errors.d.ts +1 -74
- package/dist/tsup/actor/errors.js +5 -1
- package/dist/tsup/agent-os/index.cjs +2408 -2029
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +932 -114
- package/dist/tsup/agent-os/index.d.ts +932 -114
- package/dist/tsup/agent-os/index.js +2412 -2033
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-J27CEW6F.js → chunk-2OBVQZX6.js} +6 -6
- package/dist/tsup/chunk-2OBVQZX6.js.map +1 -0
- package/dist/tsup/chunk-3ZWHWMFJ.js +14 -0
- package/dist/tsup/chunk-3ZWHWMFJ.js.map +1 -0
- package/dist/tsup/{chunk-AK57AL7S.cjs → chunk-4KGXFC6M.cjs} +238 -22
- package/dist/tsup/chunk-4KGXFC6M.cjs.map +1 -0
- package/dist/tsup/{chunk-CVHUXINE.js → chunk-5IU3MI7X.js} +594 -72
- package/dist/tsup/chunk-5IU3MI7X.js.map +1 -0
- package/dist/tsup/{chunk-VD7AZIBR.js → chunk-6CXQMHZR.js} +1161 -361
- package/dist/tsup/chunk-6CXQMHZR.js.map +1 -0
- package/dist/tsup/{chunk-SBEFJ4IQ.js → chunk-6W2UIH3X.js} +70 -8
- package/dist/tsup/chunk-6W2UIH3X.js.map +1 -0
- package/dist/tsup/{chunk-7MRGNVSR.js → chunk-6W5VGLFT.js} +237 -21
- package/dist/tsup/chunk-6W5VGLFT.js.map +1 -0
- package/dist/tsup/{chunk-RF3MEJV6.cjs → chunk-B73TBMMG.cjs} +18 -11
- package/dist/tsup/chunk-B73TBMMG.cjs.map +1 -0
- package/dist/tsup/chunk-D6TORRA4.js +243 -0
- package/dist/tsup/chunk-D6TORRA4.js.map +1 -0
- package/dist/tsup/{chunk-PXLJOMJD.js → chunk-FXT3HN32.js} +2 -2
- package/dist/tsup/{chunk-ZGWSH7YV.js → chunk-IXBD7BXC.js} +48 -72
- package/dist/tsup/chunk-IXBD7BXC.js.map +1 -0
- package/dist/tsup/{chunk-3BFYSYRU.js → chunk-JI6GZ2C2.js} +4 -12
- package/dist/tsup/chunk-JI6GZ2C2.js.map +1 -0
- package/dist/tsup/{chunk-PCBNKI2J.js → chunk-JTHHCZCZ.js} +24 -1
- package/dist/tsup/chunk-JTHHCZCZ.js.map +1 -0
- package/dist/tsup/{chunk-2NDZ7JCR.cjs → chunk-KVFIONKQ.cjs} +25 -2
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -0
- package/dist/tsup/{chunk-SPMMF6TR.cjs → chunk-LGOWPZJ5.cjs} +3 -3
- package/dist/tsup/chunk-LGOWPZJ5.cjs.map +1 -0
- package/dist/tsup/chunk-LYNWTX6R.cjs +14 -0
- package/dist/tsup/chunk-LYNWTX6R.cjs.map +1 -0
- package/dist/tsup/{chunk-LLD2D5LO.cjs → chunk-MYWZCDML.cjs} +4 -12
- package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -0
- package/dist/tsup/{chunk-XSC2WWXD.js → chunk-NYDZLWHZ.js} +16 -9
- package/dist/tsup/chunk-NYDZLWHZ.js.map +1 -0
- package/dist/tsup/{chunk-AV54CVAG.cjs → chunk-RB7WUDX6.cjs} +1290 -490
- package/dist/tsup/chunk-RB7WUDX6.cjs.map +1 -0
- package/dist/tsup/{chunk-JTL6Y2UN.cjs → chunk-SPJORZMM.cjs} +49 -73
- package/dist/tsup/chunk-SPJORZMM.cjs.map +1 -0
- package/dist/tsup/chunk-SSMKIYEX.cjs +243 -0
- package/dist/tsup/chunk-SSMKIYEX.cjs.map +1 -0
- package/dist/tsup/{chunk-TQSL4NJ3.cjs → chunk-TQ4HSX2U.cjs} +72 -10
- package/dist/tsup/chunk-TQ4HSX2U.cjs.map +1 -0
- package/dist/tsup/{chunk-EVADNK6Z.cjs → chunk-U6ZQELGJ.cjs} +10 -10
- package/dist/tsup/chunk-U6ZQELGJ.cjs.map +1 -0
- package/dist/tsup/chunk-XLBMKZD3.cjs +1257 -0
- package/dist/tsup/chunk-XLBMKZD3.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +8 -9
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +18 -7
- package/dist/tsup/client/mod.d.ts +18 -7
- package/dist/tsup/client/mod.js +7 -8
- package/dist/tsup/common/log.cjs +5 -3
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.d.cts +5 -1
- package/dist/tsup/common/log.d.ts +5 -1
- package/dist/tsup/common/log.js +6 -4
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{config-B3RIidaJ.d.ts → config-BXSV17G7.d.cts} +987 -72
- package/dist/tsup/{config-D6WxBYjV.d.cts → config-Bi1r6gI7.d.ts} +987 -72
- package/dist/tsup/{config-B9qUIHX4.d.ts → config-ey2I2zz5.d.cts} +82 -15
- package/dist/tsup/{config-B9qUIHX4.d.cts → config-ey2I2zz5.d.ts} +82 -15
- package/dist/tsup/context-4fJemY0D.d.cts +129 -0
- package/dist/tsup/context-D4sNYboo.d.ts +129 -0
- package/dist/tsup/db/drizzle.cjs +168 -103
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +8 -4
- package/dist/tsup/db/drizzle.d.ts +8 -4
- package/dist/tsup/db/drizzle.js +170 -105
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +6 -163
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.d.cts +12 -4
- package/dist/tsup/db/mod.d.ts +12 -4
- package/dist/tsup/db/mod.js +5 -162
- package/dist/tsup/db/mod.js.map +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 +38 -0
- package/dist/tsup/dynamic/mod.d.ts +38 -0
- package/dist/tsup/dynamic/mod.js +24 -0
- package/dist/tsup/dynamic/mod.js.map +1 -0
- package/dist/tsup/inspector/mod.cjs +47 -12
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +26 -136
- package/dist/tsup/inspector/mod.d.ts +26 -136
- package/dist/tsup/inspector/mod.js +46 -11
- package/dist/tsup/inspector/mod.js.map +1 -1
- package/dist/tsup/inspector/workflow.cjs +21 -0
- package/dist/tsup/inspector/workflow.cjs.map +1 -0
- package/dist/tsup/inspector/workflow.d.cts +144 -0
- package/dist/tsup/inspector/workflow.d.ts +144 -0
- package/dist/tsup/inspector/workflow.js +21 -0
- package/dist/tsup/inspector/workflow.js.map +1 -0
- package/dist/tsup/inspector-tab/mod.cjs +162 -0
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -0
- package/dist/tsup/inspector-tab/mod.d.cts +241 -0
- package/dist/tsup/inspector-tab/mod.d.ts +241 -0
- package/dist/tsup/inspector-tab/mod.js +162 -0
- package/dist/tsup/inspector-tab/mod.js.map +1 -0
- package/dist/tsup/mod.cjs +4268 -944
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +9 -8
- package/dist/tsup/mod.d.ts +9 -8
- package/dist/tsup/mod.js +4229 -905
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +26 -21
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +7 -6
- package/dist/tsup/test/mod.d.ts +7 -6
- package/dist/tsup/test/mod.js +25 -20
- package/dist/tsup/test/mod.js.map +1 -1
- package/dist/tsup/unstable/migrations.cjs +101 -0
- package/dist/tsup/unstable/migrations.cjs.map +1 -0
- package/dist/tsup/unstable/migrations.d.cts +29 -0
- package/dist/tsup/unstable/migrations.d.ts +29 -0
- package/dist/tsup/unstable/migrations.js +101 -0
- package/dist/tsup/unstable/migrations.js.map +1 -0
- package/dist/tsup/utils-Bbz-3411.d.cts +162 -0
- package/dist/tsup/utils-BqdWVlzm.d.ts +162 -0
- package/dist/tsup/utils-vvJQyygr.d.cts +109 -0
- package/dist/tsup/utils-vvJQyygr.d.ts +109 -0
- package/dist/tsup/utils.cjs +7 -3
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.d.cts +4 -147
- package/dist/tsup/utils.d.ts +4 -147
- package/dist/tsup/utils.js +6 -2
- package/dist/tsup/workflow/mod.cjs +517 -412
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +11 -10
- package/dist/tsup/workflow/mod.d.ts +11 -10
- package/dist/tsup/workflow/mod.js +511 -406
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +62 -14
- package/src/actor/actions.ts +119 -0
- package/src/actor/config.test.ts +78 -0
- package/src/actor/config.ts +518 -96
- package/src/actor/contexts/index.ts +7 -2
- package/src/actor/definition.ts +38 -26
- package/src/actor/errors.ts +101 -89
- package/src/actor/keys.ts +2 -1
- package/src/actor/mod.ts +32 -21
- package/src/actor/schema.ts +2 -2
- package/src/agent-os/actor/cron.ts +37 -2
- package/src/agent-os/actor/index.ts +39 -19
- 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/agent-os/types.ts +11 -0
- package/src/client/actor-common.ts +106 -53
- package/src/client/actor-conn.ts +94 -45
- package/src/client/actor-handle.ts +198 -79
- package/src/client/actor-query.ts +13 -6
- package/src/client/client.ts +43 -15
- package/src/client/config.ts +8 -0
- package/src/client/errors.ts +4 -2
- package/src/client/lifecycle-errors.ts +28 -4
- package/src/client/mod.ts +9 -4
- package/src/client/query.ts +3 -1
- package/src/client/queue.ts +8 -3
- package/src/client/raw-utils.ts +24 -16
- package/src/client/resolve-gateway-target.ts +3 -1
- package/src/client/utils.ts +36 -10
- package/src/common/actor-router-consts.ts +7 -0
- 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/generated/actor-runtime-socket-protocol/v1.ts +848 -0
- package/src/common/bare/generated/client-protocol/v4.ts +599 -0
- package/src/common/bare/generated/inspector/v5.ts +1016 -0
- package/src/common/bare/generated/inspector/v6.ts +1367 -0
- package/src/common/bare/transport/v1.ts +694 -542
- package/src/common/client-protocol-versioned.ts +176 -67
- package/src/common/client-protocol-zod.ts +7 -0
- package/src/common/client-protocol.ts +1 -1
- package/src/common/database/config.ts +103 -10
- package/src/common/database/mod.test.ts +364 -0
- package/src/common/database/mod.ts +278 -149
- package/src/common/database/native-database.test.ts +220 -0
- package/src/common/database/native-database.ts +394 -58
- package/src/common/database/shared.ts +25 -0
- package/src/common/encoding.ts +302 -38
- package/src/common/engine.ts +28 -1
- package/src/common/eventsource.ts +1 -1
- package/src/common/fetch-like.ts +49 -0
- package/src/common/inline-websocket-adapter.ts +14 -13
- package/src/common/inspector-transport.ts +12 -2
- package/src/common/log.ts +117 -14
- package/src/common/router.ts +49 -23
- package/src/common/utils.ts +23 -203
- package/src/common/websocket-interface.ts +1 -1
- package/src/db/drizzle.test.ts +164 -0
- package/src/db/drizzle.ts +207 -121
- package/src/db/mod.ts +6 -1
- package/src/devtools-loader/index.ts +4 -7
- package/src/devtools-loader/serve-devtools.ts +26 -0
- package/src/dynamic/instance.ts +32 -0
- package/src/dynamic/internal.ts +50 -0
- package/src/dynamic/isolate-runtime.ts +64 -0
- package/src/dynamic/mod.ts +32 -0
- package/src/engine-client/actor-http-client.ts +23 -4
- package/src/engine-client/actor-websocket-client.ts +32 -5
- package/src/engine-client/api-endpoints.ts +52 -2
- package/src/engine-client/api-utils.ts +2 -2
- package/src/engine-client/driver.ts +21 -17
- package/src/engine-client/mod.ts +116 -64
- package/src/engine-client/ws-proxy.ts +9 -4
- package/src/globals.d.ts +4 -0
- package/src/inspector/client.browser.ts +127 -15
- package/src/inspector/mod.ts +2 -4
- package/src/inspector/workflow.ts +61 -0
- package/src/inspector-tab/mod.ts +301 -0
- package/src/registry/config/envoy.ts +1 -2
- package/src/registry/config/index.ts +160 -53
- package/src/registry/config/serverless.ts +7 -1
- package/src/registry/index.ts +659 -96
- package/src/registry/napi-runtime.ts +1154 -0
- package/src/registry/native-validation.ts +10 -12
- package/src/registry/native.ts +2005 -955
- package/src/registry/process-metrics.ts +250 -0
- package/src/registry/run-handler-coordinator.test.ts +252 -0
- package/src/registry/run-handler-coordinator.ts +219 -0
- package/src/registry/runtime.test.ts +50 -0
- package/src/registry/runtime.ts +839 -0
- package/src/registry/wasm-runtime.ts +1283 -0
- package/src/registry/write-through-proxy.ts +141 -0
- package/src/serde.ts +8 -2
- package/src/serverless/configure.ts +102 -49
- package/src/test/mod.ts +2 -17
- package/src/test/ready.ts +22 -0
- package/src/unstable/migrations.test.ts +170 -0
- package/src/unstable/migrations.ts +141 -0
- package/src/utils/crypto.ts +14 -0
- package/src/utils/endpoint-parser.ts +1 -1
- package/src/utils/env-vars.ts +39 -0
- package/src/utils/node.ts +44 -28
- package/src/utils/router.ts +1 -1
- package/src/utils.ts +4 -2
- package/src/workflow/context.ts +683 -242
- package/src/workflow/driver.test.ts +62 -0
- package/src/workflow/driver.ts +246 -119
- package/src/workflow/inspector.ts +24 -24
- package/src/workflow/mod.ts +76 -84
- package/dist/tsup/chunk-2NDZ7JCR.cjs.map +0 -1
- package/dist/tsup/chunk-3BFYSYRU.js.map +0 -1
- package/dist/tsup/chunk-6AVUJ52Q.cjs +0 -253
- package/dist/tsup/chunk-6AVUJ52Q.cjs.map +0 -1
- package/dist/tsup/chunk-7MRGNVSR.js.map +0 -1
- package/dist/tsup/chunk-7X7RVTFF.cjs +0 -735
- package/dist/tsup/chunk-7X7RVTFF.cjs.map +0 -1
- package/dist/tsup/chunk-AK57AL7S.cjs.map +0 -1
- package/dist/tsup/chunk-AV54CVAG.cjs.map +0 -1
- package/dist/tsup/chunk-CVHUXINE.js.map +0 -1
- package/dist/tsup/chunk-EVADNK6Z.cjs.map +0 -1
- package/dist/tsup/chunk-J27CEW6F.js.map +0 -1
- package/dist/tsup/chunk-JTL6Y2UN.cjs.map +0 -1
- package/dist/tsup/chunk-LLD2D5LO.cjs.map +0 -1
- package/dist/tsup/chunk-PCBNKI2J.js.map +0 -1
- package/dist/tsup/chunk-RF3MEJV6.cjs.map +0 -1
- package/dist/tsup/chunk-SB4MXRN2.js +0 -253
- package/dist/tsup/chunk-SB4MXRN2.js.map +0 -1
- package/dist/tsup/chunk-SBEFJ4IQ.js.map +0 -1
- package/dist/tsup/chunk-SPMMF6TR.cjs.map +0 -1
- package/dist/tsup/chunk-TQSL4NJ3.cjs.map +0 -1
- package/dist/tsup/chunk-VD7AZIBR.js.map +0 -1
- package/dist/tsup/chunk-XSC2WWXD.js.map +0 -1
- package/dist/tsup/chunk-ZGWSH7YV.js.map +0 -1
- package/dist/tsup/context-BxvHh9wi.d.cts +0 -92
- package/dist/tsup/context-CNIZBIKl.d.ts +0 -92
- package/dist/tsup/utils-fwx3o3K9.d.cts +0 -18
- package/dist/tsup/utils-fwx3o3K9.d.ts +0 -18
- package/src/actor/driver.ts +0 -141
- package/src/actor/instance/mod.ts +0 -2501
- package/src/drivers/engine/actor-driver.ts +0 -2470
- package/src/utils/serve.ts +0 -217
- /package/dist/tsup/{chunk-PXLJOMJD.js.map → chunk-FXT3HN32.js.map} +0 -0
|
@@ -140,11 +140,11 @@ export function subscribeToSession<TConnParams>(
|
|
|
140
140
|
);
|
|
141
141
|
|
|
142
142
|
// Persist event to SQLite for sleep/wake recovery.
|
|
143
|
-
persistSessionEvent(c, sessionId, event).catch((
|
|
143
|
+
persistSessionEvent(c, sessionId, event).catch((error) =>
|
|
144
144
|
c.log.error({
|
|
145
145
|
msg: "agent-os failed to persist session event",
|
|
146
146
|
sessionId,
|
|
147
|
-
error
|
|
147
|
+
error,
|
|
148
148
|
}),
|
|
149
149
|
);
|
|
150
150
|
|
package/src/agent-os/config.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type {
|
|
|
3
3
|
JsonRpcNotification,
|
|
4
4
|
PermissionRequest,
|
|
5
5
|
} from "@rivet-dev/agent-os-core";
|
|
6
|
-
import type { ActorContext, BeforeConnectContext } from "@/actor/config";
|
|
7
6
|
import { z } from "zod/v4";
|
|
7
|
+
import type { ActorContext, BeforeConnectContext } from "@/actor/config";
|
|
8
8
|
import type { AgentOsActorState, AgentOsActorVars } from "./types";
|
|
9
9
|
|
|
10
10
|
const zFunction = <
|
package/src/agent-os/index.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
// Database migration
|
|
2
|
+
|
|
3
|
+
// Cron actions
|
|
4
|
+
export { buildCronActions } from "./actor/cron";
|
|
2
5
|
export { migrateAgentOsTables } from "./actor/db";
|
|
3
|
-
// Database-backed VFS
|
|
4
|
-
export {
|
|
5
|
-
createDatabaseVfs,
|
|
6
|
-
type DatabaseVfsOptions,
|
|
7
|
-
} from "./fs/database-vfs";
|
|
8
6
|
// Filesystem actions
|
|
9
7
|
export { buildFilesystemActions } from "./actor/filesystem";
|
|
10
8
|
// Actor factory and VM lifecycle helpers
|
|
11
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";
|
|
12
16
|
// Preview actions
|
|
13
17
|
export {
|
|
14
18
|
buildOnRequestHandler,
|
|
@@ -27,20 +31,17 @@ export {
|
|
|
27
31
|
} from "./actor/session";
|
|
28
32
|
// Shell actions
|
|
29
33
|
export { buildShellActions } from "./actor/shell";
|
|
30
|
-
// Cron actions
|
|
31
|
-
export { buildCronActions } from "./actor/cron";
|
|
32
|
-
// Network actions
|
|
33
|
-
export {
|
|
34
|
-
buildNetworkActions,
|
|
35
|
-
type VmFetchOptions,
|
|
36
|
-
type VmFetchResult,
|
|
37
|
-
} from "./actor/network";
|
|
38
34
|
// Config schema and types
|
|
39
35
|
export {
|
|
40
36
|
type AgentOsActorConfig,
|
|
41
37
|
type AgentOsActorConfigInput,
|
|
42
38
|
agentOsActorConfigSchema,
|
|
43
39
|
} from "./config";
|
|
40
|
+
// Database-backed VFS
|
|
41
|
+
export {
|
|
42
|
+
createDatabaseVfs,
|
|
43
|
+
type DatabaseVfsOptions,
|
|
44
|
+
} from "./fs/database-vfs";
|
|
44
45
|
// Domain types and event payloads
|
|
45
46
|
export type {
|
|
46
47
|
AgentOsActionContext,
|
|
@@ -48,12 +49,12 @@ export type {
|
|
|
48
49
|
AgentOsActorVars,
|
|
49
50
|
AgentOsEvents,
|
|
50
51
|
CronEventPayload,
|
|
52
|
+
PermissionRequestPayload,
|
|
51
53
|
PersistedSessionEvent,
|
|
52
54
|
PersistedSessionRecord,
|
|
53
|
-
PermissionRequestPayload,
|
|
54
|
-
PromptResult,
|
|
55
55
|
ProcessExitPayload,
|
|
56
56
|
ProcessOutputPayload,
|
|
57
|
+
PromptResult,
|
|
57
58
|
SerializableCronAction,
|
|
58
59
|
SerializableCronJobOptions,
|
|
59
60
|
SessionEventPayload,
|
package/src/agent-os/types.ts
CHANGED
|
@@ -125,6 +125,17 @@ export interface SerializableCronJobOptions {
|
|
|
125
125
|
overlap?: "allow" | "skip" | "queue";
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
export interface SerializableCronJobInfo {
|
|
129
|
+
id: string;
|
|
130
|
+
schedule: string;
|
|
131
|
+
action: SerializableCronAction;
|
|
132
|
+
overlap: "allow" | "skip" | "queue";
|
|
133
|
+
lastRun?: string;
|
|
134
|
+
nextRun?: string;
|
|
135
|
+
runCount: number;
|
|
136
|
+
running: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
128
139
|
// --- Action context alias ---
|
|
129
140
|
|
|
130
141
|
export type AgentOsActionContext<TConnParams = undefined> = ActionContext<
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
BaseActorDefinition,
|
|
3
2
|
AnyActorDefinition,
|
|
3
|
+
BaseActorDefinition,
|
|
4
4
|
} from "@/actor/definition";
|
|
5
5
|
import type {
|
|
6
6
|
EventSchemaConfig,
|
|
@@ -31,30 +31,65 @@ export type ActorActionFunction<
|
|
|
31
31
|
...args: Args extends [unknown, ...infer Rest] ? Rest : Args
|
|
32
32
|
) => Promise<Response>;
|
|
33
33
|
|
|
34
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
35
|
+
|
|
36
|
+
type LooseEventSubscribe = (
|
|
37
|
+
eventName: string,
|
|
38
|
+
callback: (...args: any[]) => void,
|
|
39
|
+
) => () => void;
|
|
40
|
+
|
|
41
|
+
type ActorActionMap<R> = {
|
|
42
|
+
[K in keyof NonNullable<R>]: NonNullable<R>[K] extends (
|
|
43
|
+
...args: infer Args
|
|
44
|
+
) => infer Return
|
|
45
|
+
? ActorActionFunction<Args, Awaited<Return>>
|
|
46
|
+
: NonNullable<R>[K] extends Record<string, unknown>
|
|
47
|
+
? ActorActionMap<NonNullable<R>[K]>
|
|
48
|
+
: never;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type ActionsOf<AD extends AnyActorDefinition> = AD["config"] extends {
|
|
52
|
+
actions?: infer R;
|
|
53
|
+
}
|
|
54
|
+
? R
|
|
55
|
+
: never;
|
|
56
|
+
|
|
57
|
+
export interface ActorGatewayOptions {
|
|
58
|
+
skipReadyWait?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type ResolvedActorGatewayOptions = Required<ActorGatewayOptions>;
|
|
62
|
+
|
|
63
|
+
export function resolveActorGatewayOptions(
|
|
64
|
+
defaults: ActorGatewayOptions = {},
|
|
65
|
+
overrides?: ActorGatewayOptions,
|
|
66
|
+
): ResolvedActorGatewayOptions {
|
|
67
|
+
const skipReadyWait =
|
|
68
|
+
overrides?.skipReadyWait ?? defaults.skipReadyWait ?? false;
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
skipReadyWait,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ActorActionOptions extends ActorGatewayOptions {
|
|
76
|
+
signal?: AbortSignal;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type ActorConnectOptions = ActorGatewayOptions;
|
|
80
|
+
|
|
81
|
+
export type ActorFetchInit = RequestInit & ActorGatewayOptions;
|
|
82
|
+
|
|
83
|
+
export type ActorWebSocketOptions = ActorGatewayOptions;
|
|
84
|
+
|
|
34
85
|
/**
|
|
35
86
|
* Maps action methods from actor definition to typed function signatures.
|
|
36
87
|
*/
|
|
37
88
|
export type ActorDefinitionActions<AD extends AnyActorDefinition> =
|
|
38
89
|
// biome-ignore lint/suspicious/noExplicitAny: safe to use any here
|
|
39
|
-
AD extends
|
|
40
|
-
any,
|
|
41
|
-
|
|
42
|
-
any,
|
|
43
|
-
any,
|
|
44
|
-
any,
|
|
45
|
-
any,
|
|
46
|
-
any,
|
|
47
|
-
any,
|
|
48
|
-
infer R
|
|
49
|
-
>
|
|
50
|
-
? {
|
|
51
|
-
[K in keyof R]: R[K] extends (
|
|
52
|
-
...args: infer Args
|
|
53
|
-
) => infer Return
|
|
54
|
-
? ActorActionFunction<Args, Return>
|
|
55
|
-
: never;
|
|
56
|
-
}
|
|
57
|
-
: never;
|
|
90
|
+
IsAny<AD> extends true
|
|
91
|
+
? Record<string, ActorActionFunction<any[], any>>
|
|
92
|
+
: ActorActionMap<ActionsOf<AD>>;
|
|
58
93
|
|
|
59
94
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
60
95
|
<K extends keyof TQueues & string>(
|
|
@@ -92,39 +127,57 @@ type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
|
|
|
92
127
|
|
|
93
128
|
export type ActorDefinitionQueueSend<AD extends AnyActorDefinition> =
|
|
94
129
|
// biome-ignore lint/suspicious/noExplicitAny: safe to use any here
|
|
95
|
-
AD extends
|
|
96
|
-
any
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
130
|
+
IsAny<AD> extends true
|
|
131
|
+
? { send: ActorQueueSend<Record<string, any>> }
|
|
132
|
+
: AD extends { config: { queues?: infer Q } }
|
|
133
|
+
? Q extends QueueSchemaConfig
|
|
134
|
+
? { send: ActorQueueSend<Q> }
|
|
135
|
+
: {}
|
|
136
|
+
: AD extends BaseActorDefinition<
|
|
137
|
+
any,
|
|
138
|
+
any,
|
|
139
|
+
any,
|
|
140
|
+
any,
|
|
141
|
+
any,
|
|
142
|
+
any,
|
|
143
|
+
any,
|
|
144
|
+
infer Q,
|
|
145
|
+
any
|
|
146
|
+
>
|
|
147
|
+
? Q extends QueueSchemaConfig
|
|
148
|
+
? { send: ActorQueueSend<Q> }
|
|
149
|
+
: {}
|
|
150
|
+
: {};
|
|
110
151
|
|
|
111
152
|
export type ActorDefinitionEventSubscriptions<AD extends AnyActorDefinition> =
|
|
112
153
|
// biome-ignore lint/suspicious/noExplicitAny: safe to use any here
|
|
113
|
-
AD extends
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
154
|
+
IsAny<AD> extends true
|
|
155
|
+
? {
|
|
156
|
+
on: LooseEventSubscribe;
|
|
157
|
+
once: LooseEventSubscribe;
|
|
158
|
+
}
|
|
159
|
+
: AD extends { config: { events?: infer E } }
|
|
160
|
+
? E extends EventSchemaConfig
|
|
161
|
+
? {
|
|
162
|
+
on: ActorEventSubscribe<E>;
|
|
163
|
+
once: ActorEventSubscribe<E>;
|
|
164
|
+
}
|
|
165
|
+
: {}
|
|
166
|
+
: AD extends BaseActorDefinition<
|
|
167
|
+
any,
|
|
168
|
+
any,
|
|
169
|
+
any,
|
|
170
|
+
any,
|
|
171
|
+
any,
|
|
172
|
+
any,
|
|
173
|
+
infer E,
|
|
174
|
+
any,
|
|
175
|
+
any
|
|
176
|
+
>
|
|
177
|
+
? E extends EventSchemaConfig
|
|
178
|
+
? {
|
|
179
|
+
on: ActorEventSubscribe<E>;
|
|
180
|
+
once: ActorEventSubscribe<E>;
|
|
181
|
+
}
|
|
182
|
+
: {}
|
|
183
|
+
: {};
|
package/src/client/actor-conn.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type ToServer as ToServerJson,
|
|
15
15
|
ToServerSchema,
|
|
16
16
|
} from "@/common/client-protocol-zod";
|
|
17
|
+
import type { JsonCompatValue } from "@/common/encoding";
|
|
17
18
|
import {
|
|
18
19
|
type Encoding,
|
|
19
20
|
inputDataToBuffer,
|
|
@@ -34,7 +35,10 @@ import type {
|
|
|
34
35
|
ActorDefinitionActions,
|
|
35
36
|
ActorDefinitionEventSubscriptions,
|
|
36
37
|
ActorDefinitionQueueSend,
|
|
38
|
+
ActorGatewayOptions,
|
|
39
|
+
ResolvedActorGatewayOptions,
|
|
37
40
|
} from "./actor-common";
|
|
41
|
+
import { resolveActorGatewayOptions } from "./actor-common";
|
|
38
42
|
import {
|
|
39
43
|
type ActorResolutionState,
|
|
40
44
|
checkForSchedulingError,
|
|
@@ -90,8 +94,6 @@ interface EventSubscriptions<Args extends Array<unknown>> {
|
|
|
90
94
|
once: boolean;
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
const DEFAULT_MAX_INCOMING_MESSAGE_SIZE = 65_536;
|
|
94
|
-
|
|
95
97
|
/**
|
|
96
98
|
* A function that unsubscribes from an event.
|
|
97
99
|
*
|
|
@@ -166,6 +168,7 @@ export class ActorConnRaw {
|
|
|
166
168
|
|
|
167
169
|
#actionIdCounter = 0;
|
|
168
170
|
#queueSender: ReturnType<typeof createQueueSender>;
|
|
171
|
+
#readyPromise: ReturnType<typeof promiseWithResolvers<void>>;
|
|
169
172
|
|
|
170
173
|
/**
|
|
171
174
|
* Interval that keeps the NodeJS process alive if this is the only thing running.
|
|
@@ -185,6 +188,7 @@ export class ActorConnRaw {
|
|
|
185
188
|
#getParams?: () => Promise<unknown>;
|
|
186
189
|
#encoding: Encoding;
|
|
187
190
|
#actorResolutionState: ActorResolutionState;
|
|
191
|
+
#gatewayOptions: ResolvedActorGatewayOptions;
|
|
188
192
|
|
|
189
193
|
// TODO: ws message queue
|
|
190
194
|
|
|
@@ -202,6 +206,7 @@ export class ActorConnRaw {
|
|
|
202
206
|
getParams: (() => Promise<unknown>) | undefined,
|
|
203
207
|
encoding: Encoding,
|
|
204
208
|
actorResolutionState: ActorResolutionState,
|
|
209
|
+
gatewayOptions: ActorGatewayOptions = {},
|
|
205
210
|
) {
|
|
206
211
|
this.#client = client;
|
|
207
212
|
this.#driver = driver;
|
|
@@ -209,6 +214,16 @@ export class ActorConnRaw {
|
|
|
209
214
|
this.#getParams = getParams;
|
|
210
215
|
this.#encoding = encoding;
|
|
211
216
|
this.#actorResolutionState = actorResolutionState;
|
|
217
|
+
this.#gatewayOptions = resolveActorGatewayOptions(gatewayOptions);
|
|
218
|
+
if ("getForId" in actorResolutionState) {
|
|
219
|
+
this.#actorId = actorResolutionState.getForId.actorId;
|
|
220
|
+
}
|
|
221
|
+
this.#readyPromise = promiseWithResolvers((reason) =>
|
|
222
|
+
logger().warn({
|
|
223
|
+
msg: "unhandled ready promise rejection",
|
|
224
|
+
reason,
|
|
225
|
+
}),
|
|
226
|
+
);
|
|
212
227
|
// Resolve the actor ID for each queue send so key-based connections do
|
|
213
228
|
// not pin themselves to an earlier resolution.
|
|
214
229
|
this.#queueSender = createQueueSender({
|
|
@@ -218,11 +233,12 @@ export class ActorConnRaw {
|
|
|
218
233
|
return await this.#driver.sendRequest(
|
|
219
234
|
getGatewayTarget(this.#actorResolutionState),
|
|
220
235
|
request,
|
|
236
|
+
this.#gatewayOptions,
|
|
221
237
|
);
|
|
222
238
|
},
|
|
223
239
|
});
|
|
224
240
|
|
|
225
|
-
this.#keepNodeAliveInterval = setInterval(() => 60_000);
|
|
241
|
+
this.#keepNodeAliveInterval = setInterval(() => {}, 60_000);
|
|
226
242
|
}
|
|
227
243
|
|
|
228
244
|
#clearResolvedActorIdentity() {
|
|
@@ -391,6 +407,7 @@ export class ActorConnRaw {
|
|
|
391
407
|
|
|
392
408
|
// Notify open handlers
|
|
393
409
|
if (status === "connected") {
|
|
410
|
+
this.#readyPromise.resolve(undefined);
|
|
394
411
|
for (const handler of [...this.#openHandlers]) {
|
|
395
412
|
try {
|
|
396
413
|
handler();
|
|
@@ -515,6 +532,14 @@ export class ActorConnRaw {
|
|
|
515
532
|
return true;
|
|
516
533
|
}
|
|
517
534
|
|
|
535
|
+
if (
|
|
536
|
+
error instanceof errors.ActorError &&
|
|
537
|
+
error.group === "client" &&
|
|
538
|
+
error.code === "get_params_failed"
|
|
539
|
+
) {
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
|
|
518
543
|
return isRetryableLifecycleReconnectSignal(error);
|
|
519
544
|
}
|
|
520
545
|
|
|
@@ -560,6 +585,7 @@ export class ActorConnRaw {
|
|
|
560
585
|
target,
|
|
561
586
|
this.#encoding,
|
|
562
587
|
params,
|
|
588
|
+
this.#gatewayOptions,
|
|
563
589
|
);
|
|
564
590
|
invariant(ws, "websocket should have been created");
|
|
565
591
|
logger().debug({
|
|
@@ -708,7 +734,7 @@ export class ActorConnRaw {
|
|
|
708
734
|
this.#handleOnOpen();
|
|
709
735
|
} else if (response.body.tag === "Error") {
|
|
710
736
|
// Connection error
|
|
711
|
-
const { group, code, message, metadata, actionId } =
|
|
737
|
+
const { group, code, message, metadata, actionId, actor } =
|
|
712
738
|
response.body.val;
|
|
713
739
|
|
|
714
740
|
if (actionId !== null) {
|
|
@@ -723,10 +749,16 @@ export class ActorConnRaw {
|
|
|
723
749
|
code,
|
|
724
750
|
message,
|
|
725
751
|
metadata,
|
|
752
|
+
actorId: actor?.actorId,
|
|
753
|
+
generation: actor?.generation,
|
|
754
|
+
actorKey: actor?.key,
|
|
726
755
|
});
|
|
727
756
|
|
|
728
757
|
inFlight.reject(
|
|
729
|
-
new errors.ActorError(group, code, message,
|
|
758
|
+
new errors.ActorError(group, code, message, {
|
|
759
|
+
metadata,
|
|
760
|
+
actor,
|
|
761
|
+
}),
|
|
730
762
|
);
|
|
731
763
|
} else {
|
|
732
764
|
logger().warn({
|
|
@@ -735,23 +767,27 @@ export class ActorConnRaw {
|
|
|
735
767
|
code,
|
|
736
768
|
message,
|
|
737
769
|
metadata,
|
|
770
|
+
actorId: actor?.actorId,
|
|
771
|
+
generation: actor?.generation,
|
|
772
|
+
actorKey: actor?.key,
|
|
738
773
|
});
|
|
739
774
|
|
|
740
775
|
if (this.#shouldReconnectForStaleActor(group, code)) {
|
|
741
776
|
this.#clearResolvedActorIdentity();
|
|
742
777
|
this.#onOpenPromise?.reject(
|
|
743
|
-
new errors.ActorError(group, code, message,
|
|
778
|
+
new errors.ActorError(group, code, message, {
|
|
779
|
+
metadata,
|
|
780
|
+
actor,
|
|
781
|
+
}),
|
|
744
782
|
);
|
|
745
783
|
return;
|
|
746
784
|
}
|
|
747
785
|
|
|
748
786
|
// Check if this is an actor scheduling error and try to get more details
|
|
749
|
-
let errorToThrow = new errors.ActorError(
|
|
750
|
-
group,
|
|
751
|
-
code,
|
|
752
|
-
message,
|
|
787
|
+
let errorToThrow = new errors.ActorError(group, code, message, {
|
|
753
788
|
metadata,
|
|
754
|
-
|
|
789
|
+
actor,
|
|
790
|
+
});
|
|
755
791
|
if (errors.isSchedulingError(group, code) && this.#actorId) {
|
|
756
792
|
const schedulingError = await checkForSchedulingError(
|
|
757
793
|
group,
|
|
@@ -838,7 +874,7 @@ export class ActorConnRaw {
|
|
|
838
874
|
const parsed = parseWebSocketCloseReason(reason);
|
|
839
875
|
|
|
840
876
|
if (parsed) {
|
|
841
|
-
const { group, code } = parsed;
|
|
877
|
+
const { group, code, rayId } = parsed;
|
|
842
878
|
|
|
843
879
|
if (this.#shouldReconnectForStaleActor(group, code)) {
|
|
844
880
|
this.#clearResolvedActorIdentity();
|
|
@@ -847,7 +883,7 @@ export class ActorConnRaw {
|
|
|
847
883
|
group,
|
|
848
884
|
code,
|
|
849
885
|
`Connection closed: ${reason}`,
|
|
850
|
-
|
|
886
|
+
{ rayId },
|
|
851
887
|
),
|
|
852
888
|
);
|
|
853
889
|
return;
|
|
@@ -861,6 +897,7 @@ export class ActorConnRaw {
|
|
|
861
897
|
this.#actorId,
|
|
862
898
|
this.#actorResolutionState,
|
|
863
899
|
this.#driver,
|
|
900
|
+
rayId,
|
|
864
901
|
);
|
|
865
902
|
if (schedulingError) {
|
|
866
903
|
error = schedulingError;
|
|
@@ -869,7 +906,7 @@ export class ActorConnRaw {
|
|
|
869
906
|
group,
|
|
870
907
|
code,
|
|
871
908
|
`Connection closed: ${reason}`,
|
|
872
|
-
|
|
909
|
+
{ rayId },
|
|
873
910
|
);
|
|
874
911
|
}
|
|
875
912
|
} else {
|
|
@@ -877,7 +914,7 @@ export class ActorConnRaw {
|
|
|
877
914
|
group,
|
|
878
915
|
code,
|
|
879
916
|
`Connection closed: ${reason}`,
|
|
880
|
-
|
|
917
|
+
{ rayId },
|
|
881
918
|
);
|
|
882
919
|
}
|
|
883
920
|
|
|
@@ -1089,6 +1126,13 @@ export class ActorConnRaw {
|
|
|
1089
1126
|
return this.#connStatus === "connected";
|
|
1090
1127
|
}
|
|
1091
1128
|
|
|
1129
|
+
/**
|
|
1130
|
+
* Resolves when this connection first reaches the connected state.
|
|
1131
|
+
*/
|
|
1132
|
+
get ready(): Promise<void> {
|
|
1133
|
+
return this.#readyPromise.promise;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1092
1136
|
/**
|
|
1093
1137
|
* Subscribes to connection open events.
|
|
1094
1138
|
*
|
|
@@ -1226,7 +1270,8 @@ export class ActorConnRaw {
|
|
|
1226
1270
|
name: msg.body.val.name,
|
|
1227
1271
|
args: bufferToArrayBuffer(
|
|
1228
1272
|
encodeCborCompat(
|
|
1229
|
-
msg.body.val
|
|
1273
|
+
msg.body.val
|
|
1274
|
+
.args as JsonCompatValue,
|
|
1230
1275
|
),
|
|
1231
1276
|
),
|
|
1232
1277
|
},
|
|
@@ -1237,34 +1282,8 @@ export class ActorConnRaw {
|
|
|
1237
1282
|
}
|
|
1238
1283
|
},
|
|
1239
1284
|
);
|
|
1240
|
-
const serializedLength = messageLength(messageSerialized);
|
|
1241
|
-
if (
|
|
1242
|
-
serializedLength > DEFAULT_MAX_INCOMING_MESSAGE_SIZE &&
|
|
1243
|
-
message.body.tag === "ActionRequest"
|
|
1244
|
-
) {
|
|
1245
|
-
const actionId = Number(message.body.val.id);
|
|
1246
|
-
const inFlight = this.#takeActionInFlight(actionId);
|
|
1247
|
-
const error = new errors.ActorError(
|
|
1248
|
-
"message",
|
|
1249
|
-
"incoming_too_long",
|
|
1250
|
-
"Incoming message too long",
|
|
1251
|
-
{
|
|
1252
|
-
maxSize: DEFAULT_MAX_INCOMING_MESSAGE_SIZE,
|
|
1253
|
-
actualSize: serializedLength,
|
|
1254
|
-
},
|
|
1255
|
-
);
|
|
1256
|
-
logger().warn({
|
|
1257
|
-
msg: "rejecting oversized connection action request",
|
|
1258
|
-
actionId,
|
|
1259
|
-
actionName: inFlight.name,
|
|
1260
|
-
actualSize: serializedLength,
|
|
1261
|
-
maxSize: DEFAULT_MAX_INCOMING_MESSAGE_SIZE,
|
|
1262
|
-
});
|
|
1263
|
-
inFlight.reject(error);
|
|
1264
|
-
this.#dispatchActorError(error);
|
|
1265
|
-
return;
|
|
1266
|
-
}
|
|
1267
1285
|
this.#websocket.send(messageSerialized);
|
|
1286
|
+
const serializedLength = messageLength(messageSerialized);
|
|
1268
1287
|
logger().trace({
|
|
1269
1288
|
msg: "sent websocket message",
|
|
1270
1289
|
len: serializedLength,
|
|
@@ -1315,6 +1334,7 @@ export class ActorConnRaw {
|
|
|
1315
1334
|
message: string;
|
|
1316
1335
|
metadata: unknown;
|
|
1317
1336
|
actionId: bigint | null;
|
|
1337
|
+
actor?: errors.ActorSpecifier;
|
|
1318
1338
|
};
|
|
1319
1339
|
}
|
|
1320
1340
|
| { tag: "ActionResponse"; val: { id: bigint; output: unknown } }
|
|
@@ -1329,8 +1349,26 @@ export class ActorConnRaw {
|
|
|
1329
1349
|
buffer,
|
|
1330
1350
|
CLIENT_PROTOCOL_TO_CLIENT,
|
|
1331
1351
|
ToClientSchema,
|
|
1332
|
-
// JSON:
|
|
1333
|
-
(msg):
|
|
1352
|
+
// JSON/CBOR: normalize actor generation to the public number shape.
|
|
1353
|
+
(msg): any => {
|
|
1354
|
+
if (msg.body.tag !== "Error" || !msg.body.val.actor) {
|
|
1355
|
+
return msg as ToClientJson;
|
|
1356
|
+
}
|
|
1357
|
+
return {
|
|
1358
|
+
body: {
|
|
1359
|
+
tag: "Error",
|
|
1360
|
+
val: {
|
|
1361
|
+
...msg.body.val,
|
|
1362
|
+
actor: {
|
|
1363
|
+
...msg.body.val.actor,
|
|
1364
|
+
generation: Number(
|
|
1365
|
+
msg.body.val.actor.generation,
|
|
1366
|
+
),
|
|
1367
|
+
},
|
|
1368
|
+
},
|
|
1369
|
+
},
|
|
1370
|
+
};
|
|
1371
|
+
},
|
|
1334
1372
|
// BARE: need to decode ArrayBuffer fields back to unknown
|
|
1335
1373
|
(msg): any => {
|
|
1336
1374
|
if (msg.body.tag === "Error") {
|
|
@@ -1349,6 +1387,17 @@ export class ActorConnRaw {
|
|
|
1349
1387
|
)
|
|
1350
1388
|
: null,
|
|
1351
1389
|
actionId: msg.body.val.actionId,
|
|
1390
|
+
actor: msg.body.val.actor
|
|
1391
|
+
? {
|
|
1392
|
+
actorId: msg.body.val.actor.actorId,
|
|
1393
|
+
generation: Number(
|
|
1394
|
+
msg.body.val.actor.generation,
|
|
1395
|
+
),
|
|
1396
|
+
key:
|
|
1397
|
+
msg.body.val.actor.key ??
|
|
1398
|
+
undefined,
|
|
1399
|
+
}
|
|
1400
|
+
: undefined,
|
|
1352
1401
|
},
|
|
1353
1402
|
},
|
|
1354
1403
|
};
|