rivetkit 0.0.0-active-actors-fix-active-count.253e406 → 0.0.0-bisect-sync-sqlite-1.910d1c7
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 +1286 -89
- package/dist/browser/client.js +1699 -704
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +252 -129
- package/dist/browser/inspector/client.js +2083 -236
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +8 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/actor/errors.js +7 -1
- package/dist/tsup/agent-os/index.cjs +3 -2289
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +1 -1813
- package/dist/tsup/agent-os/index.d.ts +1 -1813
- package/dist/tsup/agent-os/index.js +3 -2289
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/chunk-2JJU7IQ7.cjs +14 -0
- package/dist/tsup/chunk-2JJU7IQ7.cjs.map +1 -0
- package/dist/tsup/{chunk-DZJZLZ4R.js → chunk-2MXBZGUP.js} +2 -2
- package/dist/tsup/{chunk-L4FVS7GY.js → chunk-47IS5ZFI.js} +6 -6
- package/dist/tsup/chunk-47IS5ZFI.js.map +1 -0
- package/dist/tsup/{chunk-DXWOGCZY.js → chunk-5XWY5CBA.js} +70 -8
- package/dist/tsup/chunk-5XWY5CBA.js.map +1 -0
- package/dist/tsup/{chunk-OQEEZDIK.cjs → chunk-6XVNZKKP.cjs} +506 -31
- package/dist/tsup/chunk-6XVNZKKP.cjs.map +1 -0
- package/dist/tsup/{chunk-3YY5S6TV.js → chunk-A2CF6PFH.js} +20 -12
- package/dist/tsup/chunk-A2CF6PFH.js.map +1 -0
- package/dist/tsup/{chunk-WQ4HNA4W.cjs → chunk-AQJFKHBK.cjs} +276 -27
- package/dist/tsup/chunk-AQJFKHBK.cjs.map +1 -0
- package/dist/tsup/chunk-DPWLASMC.cjs +244 -0
- package/dist/tsup/chunk-DPWLASMC.cjs.map +1 -0
- package/dist/tsup/{chunk-VUF2YEF4.cjs → chunk-DYJOU3MF.cjs} +10 -10
- package/dist/tsup/chunk-DYJOU3MF.cjs.map +1 -0
- package/dist/tsup/{chunk-7WXCRV25.cjs → chunk-ELZ6MT3V.cjs} +18 -11
- package/dist/tsup/chunk-ELZ6MT3V.cjs.map +1 -0
- package/dist/tsup/chunk-HYIVSH5X.js +244 -0
- package/dist/tsup/chunk-HYIVSH5X.js.map +1 -0
- package/dist/tsup/{chunk-T6YVRM4K.js → chunk-IHEO5OT3.js} +275 -26
- package/dist/tsup/chunk-IHEO5OT3.js.map +1 -0
- package/dist/tsup/chunk-IWACVNN5.js +14 -0
- package/dist/tsup/chunk-IWACVNN5.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-V4JUWAT6.js → chunk-K3AJOPSF.js} +498 -23
- package/dist/tsup/chunk-K3AJOPSF.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-QAZLM4WT.cjs → chunk-MGI2VVF6.cjs} +45 -9
- package/dist/tsup/chunk-MGI2VVF6.cjs.map +1 -0
- package/dist/tsup/{chunk-QNLGOTQP.js → chunk-NPHTIUUJ.js} +1291 -420
- package/dist/tsup/chunk-NPHTIUUJ.js.map +1 -0
- package/dist/tsup/{chunk-7GKQJFSB.cjs → chunk-POCSZXPQ.cjs} +72 -10
- package/dist/tsup/chunk-POCSZXPQ.cjs.map +1 -0
- package/dist/tsup/{chunk-LD5YASJU.cjs → chunk-RTWH3AX3.cjs} +19 -11
- package/dist/tsup/chunk-RTWH3AX3.cjs.map +1 -0
- package/dist/tsup/{chunk-ARRBQTAR.cjs → chunk-X76BM5JS.cjs} +1420 -549
- package/dist/tsup/chunk-X76BM5JS.cjs.map +1 -0
- package/dist/tsup/{chunk-AGBP757I.js → chunk-X7SYKFPM.js} +16 -9
- package/dist/tsup/chunk-X7SYKFPM.js.map +1 -0
- package/dist/tsup/{chunk-GKAMEBTZ.cjs → chunk-XLDJSZ3B.cjs} +3 -3
- package/dist/tsup/{chunk-GKAMEBTZ.cjs.map → chunk-XLDJSZ3B.cjs.map} +1 -1
- package/dist/tsup/{chunk-KIWH5H3K.js → chunk-ZOVJDAOW.js} +44 -8
- package/dist/tsup/chunk-ZOVJDAOW.js.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 +33 -7
- package/dist/tsup/client/mod.d.ts +33 -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.js +3 -3
- package/dist/tsup/{config-nlTlOKaE.d.cts → config-BMGUEKMZ.d.cts} +1252 -75
- package/dist/tsup/config-CBTr4IhE.d.cts +224 -0
- package/dist/tsup/config-CBTr4IhE.d.ts +224 -0
- package/dist/tsup/{config-D7ykAntK.d.ts → config-iBpXyITj.d.ts} +1252 -75
- package/dist/tsup/context-hyVakgnU.d.ts +136 -0
- package/dist/tsup/context-qfvLuF0P.d.cts +136 -0
- package/dist/tsup/db/drizzle.cjs +127 -67
- 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 +127 -67
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +6 -124
- 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 -123
- 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 +39 -0
- package/dist/tsup/dynamic/mod.d.ts +39 -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 +242 -0
- package/dist/tsup/inspector-tab/mod.d.ts +242 -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 +3527 -753
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +11 -7
- package/dist/tsup/mod.d.ts +11 -7
- package/dist/tsup/mod.js +3468 -694
- 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 -5
- package/dist/tsup/test/mod.d.ts +7 -5
- 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-DVekpm4I.d.ts → utils-3rsE0JvI.d.cts} +26 -2
- package/dist/tsup/{utils-DVekpm4I.d.cts → utils-3rsE0JvI.d.ts} +26 -2
- package/dist/tsup/utils-C1O-SklO.d.ts +162 -0
- package/dist/tsup/utils-C6b0aYUM.d.cts +162 -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 +557 -410
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +11 -9
- package/dist/tsup/workflow/mod.d.ts +11 -9
- package/dist/tsup/workflow/mod.js +551 -404
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +67 -18
- package/src/actor/actions.ts +155 -0
- package/src/actor/config.ts +679 -101
- package/src/actor/contexts/index.ts +9 -2
- package/src/actor/definition.ts +75 -26
- package/src/actor/errors.ts +107 -8
- package/src/actor/keys.ts +87 -1
- package/src/actor/mod.ts +36 -20
- package/src/actor/schema.ts +6 -2
- package/src/actor/tracing.ts +28 -0
- package/src/agent-os/index.ts +5 -64
- package/src/client/actor-common.ts +84 -54
- package/src/client/actor-conn.ts +231 -68
- package/src/client/actor-handle.ts +283 -89
- package/src/client/actor-query.ts +13 -6
- package/src/client/auth.ts +37 -0
- package/src/client/client.ts +182 -21
- package/src/client/config.ts +28 -3
- package/src/client/errors.ts +15 -2
- package/src/client/lifecycle-errors.ts +63 -5
- package/src/client/mod.ts +10 -0
- package/src/client/outbound-telemetry.ts +66 -0
- package/src/client/query.ts +3 -1
- package/src/client/queue.ts +13 -3
- package/src/client/raw-utils.ts +59 -14
- package/src/client/resolve-gateway-target.ts +3 -1
- package/src/client/retry-budget.ts +81 -0
- package/src/client/token-provider.ts +93 -0
- package/src/client/utils.ts +22 -9
- package/src/common/actor-router-consts.ts +6 -0
- package/src/common/actor-telemetry-context.ts +19 -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/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 +66 -64
- package/src/common/database/config.ts +175 -9
- package/src/common/database/mod.ts +262 -77
- package/src/common/database/native-database.ts +442 -20
- package/src/common/database/shared.ts +25 -0
- package/src/common/encoding.ts +278 -34
- package/src/common/engine.ts +28 -1
- package/src/common/eventsource.ts +1 -1
- package/src/common/fetch-like.ts +63 -0
- package/src/common/inline-websocket-adapter.ts +14 -13
- package/src/common/inspector-transport.ts +12 -2
- package/src/common/log.ts +15 -8
- package/src/common/otel-context.ts +99 -0
- package/src/common/router.ts +14 -18
- package/src/common/utils.ts +8 -169
- package/src/common/websocket-interface.ts +1 -1
- package/src/db/drizzle.ts +182 -80
- package/src/db/mod.ts +5 -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-api/actors.ts +15 -3
- package/src/engine-client/actor-http-client.ts +37 -22
- package/src/engine-client/actor-websocket-client.ts +37 -9
- package/src/engine-client/api-endpoints.ts +128 -5
- package/src/engine-client/api-utils.ts +2 -2
- package/src/engine-client/driver.ts +21 -16
- package/src/engine-client/mod.ts +280 -111
- package/src/engine-client/ws-proxy.ts +9 -4
- 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 +3 -20
- package/src/registry/config/index.ts +91 -74
- package/src/registry/index.ts +702 -80
- package/src/registry/napi-runtime.ts +643 -42
- package/src/registry/native-http.ts +225 -0
- package/src/registry/native-validation.ts +10 -12
- package/src/registry/native.ts +1881 -582
- package/src/registry/run-handler-coordinator.ts +219 -0
- package/src/registry/runtime.ts +441 -7
- package/src/registry/wasm-runtime.ts +516 -23
- package/src/registry/write-through-proxy.ts +141 -0
- package/src/serde.ts +2 -2
- package/src/serverless/configure.ts +18 -7
- package/src/test/mod.ts +2 -17
- package/src/test/ready.ts +22 -0
- package/src/unstable/migrations.ts +141 -0
- package/src/utils/endpoint-parser.ts +1 -1
- package/src/utils/env-vars.ts +50 -2
- 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 +703 -242
- package/src/workflow/driver.ts +284 -125
- 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-3YY5S6TV.js.map +0 -1
- package/dist/tsup/chunk-6NT2LIFN.cjs +0 -268
- package/dist/tsup/chunk-6NT2LIFN.cjs.map +0 -1
- package/dist/tsup/chunk-7GKQJFSB.cjs.map +0 -1
- package/dist/tsup/chunk-7WXCRV25.cjs.map +0 -1
- package/dist/tsup/chunk-AGBP757I.js.map +0 -1
- package/dist/tsup/chunk-ARRBQTAR.cjs.map +0 -1
- package/dist/tsup/chunk-DXWOGCZY.js.map +0 -1
- package/dist/tsup/chunk-JGIPV3QU.js +0 -268
- package/dist/tsup/chunk-JGIPV3QU.js.map +0 -1
- package/dist/tsup/chunk-KIWH5H3K.js.map +0 -1
- package/dist/tsup/chunk-L4FVS7GY.js.map +0 -1
- package/dist/tsup/chunk-LD5YASJU.cjs.map +0 -1
- package/dist/tsup/chunk-OQEEZDIK.cjs.map +0 -1
- package/dist/tsup/chunk-PCBNKI2J.js.map +0 -1
- package/dist/tsup/chunk-QAZLM4WT.cjs.map +0 -1
- package/dist/tsup/chunk-QNLGOTQP.js.map +0 -1
- package/dist/tsup/chunk-T6YVRM4K.js.map +0 -1
- package/dist/tsup/chunk-V4JUWAT6.js.map +0 -1
- package/dist/tsup/chunk-VUF2YEF4.cjs.map +0 -1
- package/dist/tsup/chunk-WQ4HNA4W.cjs.map +0 -1
- package/dist/tsup/config-CxjGYf4K.d.cts +0 -121
- package/dist/tsup/config-CxjGYf4K.d.ts +0 -121
- package/dist/tsup/context-88opQsfZ.d.cts +0 -92
- package/dist/tsup/context-CVEG5zfg.d.ts +0 -92
- package/src/actor/driver.ts +0 -141
- package/src/actor/instance/mod.ts +0 -2492
- package/src/actor/keys.test.ts +0 -275
- package/src/actor/utils.test.ts +0 -48
- package/src/agent-os/actor/cron.ts +0 -84
- package/src/agent-os/actor/db.ts +0 -54
- package/src/agent-os/actor/filesystem.ts +0 -131
- package/src/agent-os/actor/index.ts +0 -265
- package/src/agent-os/actor/network.ts +0 -58
- package/src/agent-os/actor/preview.ts +0 -191
- package/src/agent-os/actor/process.ts +0 -177
- package/src/agent-os/actor/session.ts +0 -518
- package/src/agent-os/actor/shell.ts +0 -60
- package/src/agent-os/config.ts +0 -79
- package/src/agent-os/fs/database-vfs.ts +0 -624
- package/src/agent-os/types.ts +0 -148
- package/src/client/test.ts +0 -44
- package/src/common/database/mod.test.ts +0 -137
- package/src/common/database/native-database.test.ts +0 -211
- package/src/common/inline-websocket-adapter.test.ts +0 -51
- package/src/drivers/engine/actor-driver.ts +0 -2460
- package/src/registry/runtime.test.ts +0 -50
- package/src/utils/endpoint-parser.test.ts +0 -206
- package/src/utils/serve.ts +0 -217
- package/src/utils.test.ts +0 -34
- /package/dist/tsup/{chunk-DZJZLZ4R.js.map → chunk-2MXBZGUP.js.map} +0 -0
package/src/common/encoding.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod/v4";
|
|
2
1
|
import type { VersionedDataHandler } from "vbare";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
3
|
import { serializeWithEncoding } from "@/serde";
|
|
4
4
|
import { assertUnreachable } from "./utils";
|
|
5
5
|
|
|
@@ -13,6 +13,171 @@ const JSON_COMPAT_BIGINT = "$BigInt";
|
|
|
13
13
|
const JSON_COMPAT_ARRAY_BUFFER = "$ArrayBuffer";
|
|
14
14
|
const JSON_COMPAT_UINT8_ARRAY = "$Uint8Array";
|
|
15
15
|
const JSON_COMPAT_UNDEFINED = "$Undefined";
|
|
16
|
+
const JSON_COMPAT_SET = "$Set";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Types that cbor-x encodes natively without any compat transforms.
|
|
20
|
+
*/
|
|
21
|
+
export type CborSerializable =
|
|
22
|
+
| string
|
|
23
|
+
| number
|
|
24
|
+
| boolean
|
|
25
|
+
| null
|
|
26
|
+
| undefined
|
|
27
|
+
| bigint
|
|
28
|
+
| Date
|
|
29
|
+
| RegExp
|
|
30
|
+
| Error
|
|
31
|
+
| ArrayBuffer
|
|
32
|
+
| Uint8Array
|
|
33
|
+
| Uint8ClampedArray
|
|
34
|
+
| Uint16Array
|
|
35
|
+
| Uint32Array
|
|
36
|
+
| BigUint64Array
|
|
37
|
+
| Int8Array
|
|
38
|
+
| Int16Array
|
|
39
|
+
| Int32Array
|
|
40
|
+
| BigInt64Array
|
|
41
|
+
| Float32Array
|
|
42
|
+
| Float64Array
|
|
43
|
+
| CborSerializable[]
|
|
44
|
+
| Map<CborSerializable, CborSerializable>
|
|
45
|
+
| { [key: string]: CborSerializable };
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* User-facing serializable type. Extends CborSerializable with Set (encoded
|
|
49
|
+
* as a `$Set` tagged array by the JSON compat layer).
|
|
50
|
+
*/
|
|
51
|
+
export type JsonCompatValue =
|
|
52
|
+
| CborSerializable
|
|
53
|
+
| Set<JsonCompatValue>
|
|
54
|
+
| JsonCompatValue[]
|
|
55
|
+
| Map<JsonCompatValue, JsonCompatValue>
|
|
56
|
+
| { [key: string]: JsonCompatValue };
|
|
57
|
+
|
|
58
|
+
function isTypedArray(value: unknown): boolean {
|
|
59
|
+
return (
|
|
60
|
+
value instanceof Uint8ClampedArray ||
|
|
61
|
+
value instanceof Uint16Array ||
|
|
62
|
+
value instanceof Uint32Array ||
|
|
63
|
+
value instanceof BigUint64Array ||
|
|
64
|
+
value instanceof Int8Array ||
|
|
65
|
+
value instanceof Int16Array ||
|
|
66
|
+
value instanceof Int32Array ||
|
|
67
|
+
value instanceof BigInt64Array ||
|
|
68
|
+
value instanceof Float32Array ||
|
|
69
|
+
value instanceof Float64Array
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Recursively validates that a value is CBOR serializable. Throws TypeError
|
|
75
|
+
* with a descriptive message for non-serializable values.
|
|
76
|
+
*/
|
|
77
|
+
export function assertJsonCompatValue(
|
|
78
|
+
value: unknown,
|
|
79
|
+
path = "",
|
|
80
|
+
): asserts value is JsonCompatValue {
|
|
81
|
+
if (
|
|
82
|
+
value === null ||
|
|
83
|
+
value === undefined ||
|
|
84
|
+
typeof value === "string" ||
|
|
85
|
+
typeof value === "number" ||
|
|
86
|
+
typeof value === "boolean" ||
|
|
87
|
+
typeof value === "bigint"
|
|
88
|
+
) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (typeof value === "function") {
|
|
93
|
+
throw new TypeError(
|
|
94
|
+
`Value at ${path || "root"} is a function and is not CBOR serializable`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (typeof value === "symbol") {
|
|
99
|
+
throw new TypeError(
|
|
100
|
+
`Value at ${path || "root"} is a symbol and is not CBOR serializable`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (
|
|
105
|
+
value instanceof Date ||
|
|
106
|
+
value instanceof RegExp ||
|
|
107
|
+
value instanceof Error ||
|
|
108
|
+
value instanceof ArrayBuffer ||
|
|
109
|
+
value instanceof Uint8Array ||
|
|
110
|
+
isTypedArray(value)
|
|
111
|
+
) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (value instanceof WeakMap) {
|
|
116
|
+
throw new TypeError(
|
|
117
|
+
`Value at ${path || "root"} is a WeakMap and is not CBOR serializable`,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (value instanceof WeakSet) {
|
|
122
|
+
throw new TypeError(
|
|
123
|
+
`Value at ${path || "root"} is a WeakSet and is not CBOR serializable`,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (value instanceof WeakRef) {
|
|
128
|
+
throw new TypeError(
|
|
129
|
+
`Value at ${path || "root"} is a WeakRef and is not CBOR serializable`,
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (value instanceof Promise) {
|
|
134
|
+
throw new TypeError(
|
|
135
|
+
`Value at ${path || "root"} is a Promise and is not CBOR serializable`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (value instanceof Map) {
|
|
140
|
+
for (const [k, v] of value.entries()) {
|
|
141
|
+
assertJsonCompatValue(k, `${path || "root"}.key(${String(k)})`);
|
|
142
|
+
assertJsonCompatValue(v, `${path || "root"}.value(${String(k)})`);
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (value instanceof Set) {
|
|
148
|
+
let index = 0;
|
|
149
|
+
for (const item of value.values()) {
|
|
150
|
+
assertJsonCompatValue(item, `${path || "root"}.set[${index}]`);
|
|
151
|
+
index++;
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (Array.isArray(value)) {
|
|
157
|
+
for (let i = 0; i < value.length; i++) {
|
|
158
|
+
assertJsonCompatValue(value[i], `${path || "root"}[${i}]`);
|
|
159
|
+
}
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (isPlainObject(value)) {
|
|
164
|
+
for (const key in value) {
|
|
165
|
+
assertJsonCompatValue(
|
|
166
|
+
value[key as keyof typeof value],
|
|
167
|
+
path ? `${path}.${key}` : key,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const typeName =
|
|
174
|
+
typeof value === "object" && value !== null
|
|
175
|
+
? (value.constructor?.name ?? typeof value)
|
|
176
|
+
: typeof value;
|
|
177
|
+
throw new TypeError(
|
|
178
|
+
`Value at ${path || "root"} of type "${typeName}" is not CBOR serializable`,
|
|
179
|
+
);
|
|
180
|
+
}
|
|
16
181
|
|
|
17
182
|
export const EncodingSchema = z.enum(["json", "cbor", "bare"]);
|
|
18
183
|
|
|
@@ -112,38 +277,97 @@ function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
|
112
277
|
return proto === Object.prototype || proto === null;
|
|
113
278
|
}
|
|
114
279
|
|
|
115
|
-
export function encodeJsonCompatValue(input:
|
|
280
|
+
export function encodeJsonCompatValue(input: JsonCompatValue): unknown {
|
|
281
|
+
// Primitives
|
|
282
|
+
if (input === null) {
|
|
283
|
+
return input;
|
|
284
|
+
}
|
|
116
285
|
if (input === undefined) {
|
|
117
286
|
return [JSON_COMPAT_UNDEFINED, 0];
|
|
118
287
|
}
|
|
288
|
+
if (
|
|
289
|
+
typeof input === "string" ||
|
|
290
|
+
typeof input === "number" ||
|
|
291
|
+
typeof input === "boolean"
|
|
292
|
+
) {
|
|
293
|
+
return input;
|
|
294
|
+
}
|
|
119
295
|
if (typeof input === "bigint") {
|
|
120
296
|
return [JSON_COMPAT_BIGINT, input.toString()];
|
|
121
297
|
}
|
|
298
|
+
|
|
299
|
+
// Binary types with custom encoding
|
|
122
300
|
if (input instanceof ArrayBuffer) {
|
|
123
301
|
return [JSON_COMPAT_ARRAY_BUFFER, base64EncodeArrayBuffer(input)];
|
|
124
302
|
}
|
|
125
303
|
if (input instanceof Uint8Array) {
|
|
126
304
|
return [JSON_COMPAT_UINT8_ARRAY, base64EncodeUint8Array(input)];
|
|
127
305
|
}
|
|
306
|
+
|
|
307
|
+
// TypedArrays pass through for cbor-x native handling
|
|
308
|
+
if (isTypedArray(input)) {
|
|
309
|
+
return input;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Date, RegExp, and Error pass through for cbor-x native handling
|
|
313
|
+
if (
|
|
314
|
+
input instanceof Date ||
|
|
315
|
+
input instanceof RegExp ||
|
|
316
|
+
input instanceof Error
|
|
317
|
+
) {
|
|
318
|
+
return input;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Set uses custom tag encoding
|
|
322
|
+
if (input instanceof Set) {
|
|
323
|
+
const encoded = [...input.values()].map((v) =>
|
|
324
|
+
encodeJsonCompatValue(v as JsonCompatValue),
|
|
325
|
+
);
|
|
326
|
+
return [JSON_COMPAT_SET, encoded];
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Map recurses into keys and values
|
|
330
|
+
if (input instanceof Map) {
|
|
331
|
+
const encoded = new Map<unknown, unknown>();
|
|
332
|
+
for (const [k, v] of input.entries()) {
|
|
333
|
+
encoded.set(
|
|
334
|
+
encodeJsonCompatValue(k as JsonCompatValue),
|
|
335
|
+
encodeJsonCompatValue(v as JsonCompatValue),
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
return encoded;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Arrays
|
|
128
342
|
if (Array.isArray(input)) {
|
|
129
|
-
const encoded = input.map((value) =>
|
|
343
|
+
const encoded = input.map((value) =>
|
|
344
|
+
encodeJsonCompatValue(value as JsonCompatValue),
|
|
345
|
+
);
|
|
130
346
|
if (
|
|
131
347
|
encoded.length === 2 &&
|
|
132
348
|
typeof encoded[0] === "string" &&
|
|
133
|
-
encoded[0].startsWith("$")
|
|
349
|
+
(encoded[0] as string).startsWith("$")
|
|
134
350
|
) {
|
|
135
|
-
return [
|
|
351
|
+
return [`$${encoded[0]}`, encoded[1]];
|
|
136
352
|
}
|
|
137
353
|
return encoded;
|
|
138
354
|
}
|
|
355
|
+
|
|
356
|
+
// Plain objects
|
|
139
357
|
if (isPlainObject(input)) {
|
|
140
358
|
const encoded: Record<string, unknown> = {};
|
|
141
359
|
for (const [key, value] of Object.entries(input)) {
|
|
142
|
-
encoded[key] = encodeJsonCompatValue(value);
|
|
360
|
+
encoded[key] = encodeJsonCompatValue(value as JsonCompatValue);
|
|
143
361
|
}
|
|
144
362
|
return encoded;
|
|
145
363
|
}
|
|
146
|
-
|
|
364
|
+
|
|
365
|
+
// Not serializable
|
|
366
|
+
const typeName =
|
|
367
|
+
typeof input === "object" && input !== null
|
|
368
|
+
? ((input as object).constructor?.name ?? typeof input)
|
|
369
|
+
: typeof input;
|
|
370
|
+
throw new TypeError(`Value of type "${typeName}" is not CBOR serializable`);
|
|
147
371
|
}
|
|
148
372
|
|
|
149
373
|
export interface JsonCompatReviveOptions {
|
|
@@ -164,6 +388,16 @@ export function reviveJsonCompatValue(
|
|
|
164
388
|
}
|
|
165
389
|
return input;
|
|
166
390
|
}
|
|
391
|
+
if (input instanceof Map) {
|
|
392
|
+
const revived = new Map();
|
|
393
|
+
for (const [k, v] of input.entries()) {
|
|
394
|
+
revived.set(
|
|
395
|
+
reviveJsonCompatValue(k, options),
|
|
396
|
+
reviveJsonCompatValue(v, options),
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
return revived;
|
|
400
|
+
}
|
|
167
401
|
if (Array.isArray(input)) {
|
|
168
402
|
if (
|
|
169
403
|
input.length === 2 &&
|
|
@@ -182,6 +416,12 @@ export function reviveJsonCompatValue(
|
|
|
182
416
|
if (input[0] === JSON_COMPAT_UNDEFINED) {
|
|
183
417
|
return undefined;
|
|
184
418
|
}
|
|
419
|
+
if (input[0] === JSON_COMPAT_SET) {
|
|
420
|
+
const items = (input[1] as unknown[]).map((v) =>
|
|
421
|
+
reviveJsonCompatValue(v, options),
|
|
422
|
+
);
|
|
423
|
+
return new Set(items);
|
|
424
|
+
}
|
|
185
425
|
if (input[0].startsWith("$$")) {
|
|
186
426
|
return [
|
|
187
427
|
input[0].substring(1),
|
|
@@ -233,33 +473,37 @@ function base64DecodeToArrayBuffer(base64: string): ArrayBuffer {
|
|
|
233
473
|
}
|
|
234
474
|
|
|
235
475
|
/** Stringifies with compat for values that BARE & CBOR supports. */
|
|
236
|
-
export function jsonStringifyCompat(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
476
|
+
export function jsonStringifyCompat(
|
|
477
|
+
input: any,
|
|
478
|
+
space?: string | number,
|
|
479
|
+
): string {
|
|
480
|
+
return JSON.stringify(
|
|
481
|
+
input,
|
|
482
|
+
(_key, value) => {
|
|
483
|
+
if (typeof value === "bigint") {
|
|
484
|
+
return [JSON_COMPAT_BIGINT, value.toString()];
|
|
485
|
+
}
|
|
486
|
+
if (value instanceof ArrayBuffer) {
|
|
487
|
+
return [
|
|
488
|
+
JSON_COMPAT_ARRAY_BUFFER,
|
|
489
|
+
base64EncodeArrayBuffer(value),
|
|
490
|
+
];
|
|
491
|
+
}
|
|
492
|
+
if (value instanceof Uint8Array) {
|
|
493
|
+
return [JSON_COMPAT_UINT8_ARRAY, base64EncodeUint8Array(value)];
|
|
494
|
+
}
|
|
495
|
+
if (
|
|
496
|
+
Array.isArray(value) &&
|
|
497
|
+
value.length === 2 &&
|
|
498
|
+
typeof value[0] === "string" &&
|
|
499
|
+
value[0].startsWith("$")
|
|
500
|
+
) {
|
|
501
|
+
return [`$${value[0]}`, value[1]];
|
|
502
|
+
}
|
|
503
|
+
return value;
|
|
504
|
+
},
|
|
505
|
+
space,
|
|
506
|
+
);
|
|
263
507
|
}
|
|
264
508
|
|
|
265
509
|
/** Parses JSON with compat for values that BARE & CBOR supports. */
|
package/src/common/engine.ts
CHANGED
|
@@ -1,2 +1,29 @@
|
|
|
1
|
+
export const ENGINE_HOST = "127.0.0.1";
|
|
1
2
|
export const ENGINE_PORT = 6420;
|
|
2
|
-
export const ENGINE_ENDPOINT =
|
|
3
|
+
export const ENGINE_ENDPOINT = buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT);
|
|
4
|
+
|
|
5
|
+
export function buildEngineEndpoint(host: string, port: number): string {
|
|
6
|
+
const urlHost =
|
|
7
|
+
host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
8
|
+
return `http://${urlHost}:${port}`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isLocalEngineEndpoint(endpoint: string): boolean {
|
|
12
|
+
let url: URL;
|
|
13
|
+
try {
|
|
14
|
+
url = new URL(endpoint);
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const hostname = url.hostname.toLowerCase();
|
|
20
|
+
return (
|
|
21
|
+
hostname === "localhost" ||
|
|
22
|
+
hostname === "0.0.0.0" ||
|
|
23
|
+
hostname === "::" ||
|
|
24
|
+
hostname === "[::]" ||
|
|
25
|
+
hostname === "::1" ||
|
|
26
|
+
hostname === "[::1]" ||
|
|
27
|
+
/^127(?:\.\d{1,3}){0,3}$/.test(hostname)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -25,7 +25,7 @@ export async function importEventSource(): Promise<typeof EventSource> {
|
|
|
25
25
|
const es = await import(/* webpackIgnore: true */ moduleName);
|
|
26
26
|
_EventSource = es.EventSource;
|
|
27
27
|
logger().debug("using eventsource from npm");
|
|
28
|
-
} catch (
|
|
28
|
+
} catch (_err) {
|
|
29
29
|
// EventSource not available
|
|
30
30
|
_EventSource = class MockEventSource {
|
|
31
31
|
constructor() {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
type HeadersLike = {
|
|
2
|
+
entries(): IterableIterator<[string, string]>;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export type RequestLike = Request & {
|
|
6
|
+
readonly headers: HeadersLike & Request["headers"];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type ResponseLike = Response & {
|
|
10
|
+
readonly headers: HeadersLike & Response["headers"];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function isUrlLike(value: unknown): value is URL {
|
|
14
|
+
return (
|
|
15
|
+
typeof value === "object" &&
|
|
16
|
+
value !== null &&
|
|
17
|
+
typeof (value as URL).href === "string" &&
|
|
18
|
+
typeof (value as URL).pathname === "string" &&
|
|
19
|
+
typeof (value as URL).search === "string"
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function isRequestLike(value: unknown): value is RequestLike {
|
|
24
|
+
return (
|
|
25
|
+
typeof value === "object" &&
|
|
26
|
+
value !== null &&
|
|
27
|
+
typeof (value as Request).url === "string" &&
|
|
28
|
+
typeof (value as Request).method === "string" &&
|
|
29
|
+
isHeadersLike((value as Request).headers)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function isResponseLike(value: unknown): value is ResponseLike {
|
|
34
|
+
return (
|
|
35
|
+
typeof value === "object" &&
|
|
36
|
+
value !== null &&
|
|
37
|
+
typeof (value as Response).status === "number" &&
|
|
38
|
+
isHeadersLike((value as Response).headers) &&
|
|
39
|
+
typeof (value as Response).arrayBuffer === "function"
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isHeadersLike(value: unknown): value is HeadersLike {
|
|
44
|
+
return (
|
|
45
|
+
typeof value === "object" &&
|
|
46
|
+
value !== null &&
|
|
47
|
+
typeof (value as HeadersLike).entries === "function"
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Reads a request body into bytes. Aborting the request's signal cancels the
|
|
53
|
+
* body and rejects the read.
|
|
54
|
+
*/
|
|
55
|
+
export function readRequestBody(request: Request): Promise<ArrayBuffer> {
|
|
56
|
+
// Firefox has no Request.body.
|
|
57
|
+
if (!request.body) return request.arrayBuffer();
|
|
58
|
+
return new Response(
|
|
59
|
+
request.body.pipeThrough(new TransformStream(), {
|
|
60
|
+
signal: request.signal,
|
|
61
|
+
}),
|
|
62
|
+
).arrayBuffer();
|
|
63
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { VirtualWebSocket } from "@rivetkit/virtual-websocket";
|
|
1
2
|
import { WSContext } from "hono/ws";
|
|
2
3
|
import type { UpgradeWebSocketArgs } from "@/common/actor-websocket";
|
|
3
4
|
import type { UniversalWebSocket } from "@/common/websocket-interface";
|
|
4
|
-
import { VirtualWebSocket } from "@rivetkit/virtual-websocket";
|
|
5
5
|
import { getLogger } from "./log";
|
|
6
6
|
|
|
7
7
|
function logger() {
|
|
@@ -161,28 +161,29 @@ export class InlineWebSocketAdapter {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
#handleError(
|
|
165
|
-
console.error("INLINE_WEBSOCKET_ADAPTER_ERROR",
|
|
164
|
+
#handleError(error: unknown): void {
|
|
165
|
+
console.error("INLINE_WEBSOCKET_ADAPTER_ERROR", error);
|
|
166
166
|
logger().error({
|
|
167
167
|
msg: "error in websocket",
|
|
168
|
-
error
|
|
169
|
-
errorMessage:
|
|
170
|
-
|
|
168
|
+
error,
|
|
169
|
+
errorMessage:
|
|
170
|
+
error instanceof Error ? error.message : String(error),
|
|
171
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
171
172
|
});
|
|
172
173
|
|
|
173
174
|
// Call handler.onError
|
|
174
175
|
try {
|
|
175
|
-
this.#handler.onError(
|
|
176
|
-
} catch (
|
|
176
|
+
this.#handler.onError(error, this.#wsContext);
|
|
177
|
+
} catch (error) {
|
|
177
178
|
logger().error({
|
|
178
179
|
msg: "error in onError handler",
|
|
179
|
-
error
|
|
180
|
+
error,
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
// Fire error event to both sides
|
|
184
|
-
this.#clientWs.triggerError(
|
|
185
|
-
this.#actorWs.triggerError(
|
|
185
|
+
this.#clientWs.triggerError(error);
|
|
186
|
+
this.#actorWs.triggerError(error);
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
#close(code: number, reason: string): void {
|
|
@@ -199,8 +200,8 @@ export class InlineWebSocketAdapter {
|
|
|
199
200
|
{ code, reason, wasClean: true },
|
|
200
201
|
this.#wsContext,
|
|
201
202
|
);
|
|
202
|
-
} catch (
|
|
203
|
-
logger().error({ msg: "error closing websocket", error
|
|
203
|
+
} catch (error) {
|
|
204
|
+
logger().error({ msg: "error closing websocket", error });
|
|
204
205
|
} finally {
|
|
205
206
|
this.#readyState = 3; // CLOSED
|
|
206
207
|
|
|
@@ -5,10 +5,20 @@ import {
|
|
|
5
5
|
} from "@/common/bare/transport/v1";
|
|
6
6
|
import { bufferToArrayBuffer, toUint8Array } from "@/utils";
|
|
7
7
|
|
|
8
|
+
declare const workflowHistoryBare: unique symbol;
|
|
9
|
+
|
|
10
|
+
// Branded so these bytes cannot be handed to the CBOR compat encoder, which
|
|
11
|
+
// would rewrite the buffer as `["$ArrayBuffer", "<base64>"]`.
|
|
12
|
+
export type WorkflowHistoryBytes = ArrayBuffer & {
|
|
13
|
+
readonly [workflowHistoryBare]: true;
|
|
14
|
+
};
|
|
15
|
+
|
|
8
16
|
export function encodeWorkflowHistoryTransport(
|
|
9
17
|
history: WorkflowHistory,
|
|
10
|
-
):
|
|
11
|
-
return bufferToArrayBuffer(
|
|
18
|
+
): WorkflowHistoryBytes {
|
|
19
|
+
return bufferToArrayBuffer(
|
|
20
|
+
encodeWorkflowHistory(history),
|
|
21
|
+
) as WorkflowHistoryBytes;
|
|
12
22
|
}
|
|
13
23
|
|
|
14
24
|
export function decodeWorkflowHistoryTransport(
|
package/src/common/log.ts
CHANGED
|
@@ -62,20 +62,16 @@ export function configureBaseLogger(logger: Logger): void {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Create the default logger with optional log level.
|
|
66
66
|
*/
|
|
67
|
-
export function
|
|
68
|
-
|
|
69
|
-
if (logLevel) {
|
|
70
|
-
configuredLogLevel = logLevel;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
baseLogger = pino(
|
|
67
|
+
export function makeDefaultLogger(logLevel?: LogLevel): Logger {
|
|
68
|
+
return pino(
|
|
74
69
|
{
|
|
75
70
|
level: getPinoLevel(logLevel),
|
|
76
71
|
messageKey: "msg",
|
|
77
72
|
// Do not include pid/hostname in output
|
|
78
73
|
base: {},
|
|
74
|
+
errorKey: "error",
|
|
79
75
|
// Keep the numeric level so the logfmt sink can match Pino's levels.
|
|
80
76
|
formatters: {
|
|
81
77
|
level(_label: string, number: number) {
|
|
@@ -86,7 +82,18 @@ export function configureDefaultLogger(logLevel?: LogLevel) {
|
|
|
86
82
|
},
|
|
87
83
|
createLogfmtDestination(),
|
|
88
84
|
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Configure the default logger with optional log level.
|
|
89
|
+
*/
|
|
90
|
+
export function configureDefaultLogger(logLevel?: LogLevel) {
|
|
91
|
+
// Store the configured log level
|
|
92
|
+
if (logLevel) {
|
|
93
|
+
configuredLogLevel = logLevel;
|
|
94
|
+
}
|
|
89
95
|
|
|
96
|
+
baseLogger = makeDefaultLogger(logLevel);
|
|
90
97
|
loggerCache.clear();
|
|
91
98
|
}
|
|
92
99
|
|