rivetkit 2.3.0-rc.8 → 2.3.0-rc.9
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 +8 -37
- package/dist/browser/client.js +34 -64
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +3 -4
- 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 +5 -7
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +5 -26
- package/dist/tsup/agent-os/index.d.ts +5 -26
- package/dist/tsup/agent-os/index.js +5 -7
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-OT7FF6GB.cjs → chunk-4CGA6QJO.cjs} +4 -4
- package/dist/tsup/{chunk-OT7FF6GB.cjs.map → chunk-4CGA6QJO.cjs.map} +1 -1
- package/dist/tsup/{chunk-4BPKKZJO.cjs → chunk-4WPEZBK4.cjs} +8 -8
- package/dist/tsup/{chunk-4BPKKZJO.cjs.map → chunk-4WPEZBK4.cjs.map} +1 -1
- package/dist/tsup/{chunk-AWTPTUQ7.cjs → chunk-CPA4Y3RG.cjs} +10 -10
- package/dist/tsup/chunk-CPA4Y3RG.cjs.map +1 -0
- package/dist/tsup/{chunk-EMFKMVJR.js → chunk-F3Q5BFQ6.js} +34 -10
- package/dist/tsup/chunk-F3Q5BFQ6.js.map +1 -0
- package/dist/tsup/{chunk-7HLFSAJP.cjs → chunk-GVTOE34S.cjs} +193 -169
- package/dist/tsup/chunk-GVTOE34S.cjs.map +1 -0
- package/dist/tsup/{chunk-D3T3ZBSY.js → chunk-H37XQU3I.js} +2 -2
- package/dist/tsup/{chunk-4JU3IPG2.js → chunk-H7P7WR2Y.js} +3 -3
- package/dist/tsup/{chunk-TMLOKTRB.js → chunk-KIWH5H3K.js} +3 -3
- package/dist/tsup/chunk-KIWH5H3K.js.map +1 -0
- package/dist/tsup/{chunk-VUGENVIK.js → chunk-KJTA3ATT.js} +2 -2
- package/dist/tsup/{chunk-6TQSSJ4F.cjs → chunk-MALSPBAF.cjs} +3 -3
- package/dist/tsup/{chunk-6TQSSJ4F.cjs.map → chunk-MALSPBAF.cjs.map} +1 -1
- package/dist/tsup/{chunk-UZXQEGVJ.js → chunk-MMMEZM5J.js} +4 -4
- package/dist/tsup/chunk-MMMEZM5J.js.map +1 -0
- package/dist/tsup/{chunk-63WNTDRC.cjs → chunk-QAZLM4WT.cjs} +3 -3
- package/dist/tsup/{chunk-63WNTDRC.cjs.map → chunk-QAZLM4WT.cjs.map} +1 -1
- package/dist/tsup/{chunk-D5G75T7J.js → chunk-T6YVRM4K.js} +1 -3
- package/dist/tsup/chunk-T6YVRM4K.js.map +1 -0
- package/dist/tsup/{chunk-HGW6PBWR.cjs → chunk-VJFRBJVQ.cjs} +9 -137
- package/dist/tsup/chunk-VJFRBJVQ.cjs.map +1 -0
- package/dist/tsup/{chunk-GBG63SUG.js → chunk-VRCIXJRN.js} +5 -7
- package/dist/tsup/chunk-VRCIXJRN.js.map +1 -0
- package/dist/tsup/{chunk-KY3CERZR.js → chunk-W7EYSYVI.js} +4 -132
- package/dist/tsup/chunk-W7EYSYVI.js.map +1 -0
- package/dist/tsup/{chunk-SRNOPUC6.cjs → chunk-WQ4HNA4W.cjs} +2 -4
- package/dist/tsup/chunk-WQ4HNA4W.cjs.map +1 -0
- package/dist/tsup/{chunk-BATTOVHF.cjs → chunk-Y5NSCZA2.cjs} +12 -14
- package/dist/tsup/chunk-Y5NSCZA2.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +7 -7
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +6 -6
- 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-Ak1lv4gF.d.ts → config-0Ta55UV0.d.ts} +6 -27
- package/dist/tsup/{config-DU_xj4qZ.d.cts → config-Ca8dN4cS.d.cts} +6 -27
- package/dist/tsup/{context-DAAp4Lpg.d.ts → context-B_IWbWne.d.ts} +1 -1
- package/dist/tsup/{context-Dt_L55q8.d.cts → context-CUrQ9MHc.d.cts} +1 -1
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/mod.cjs +355 -482
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +3 -3
- package/dist/tsup/mod.d.ts +3 -3
- package/dist/tsup/mod.js +276 -403
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +10 -10
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +6 -6
- package/dist/tsup/utils.cjs +3 -3
- package/dist/tsup/utils.js +2 -2
- package/dist/tsup/workflow/mod.cjs +16 -41
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +10 -35
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +10 -11
- package/src/actor/config.ts +0 -3
- package/src/actor/errors.ts +2 -2
- package/src/agent-os/actor/session.ts +2 -2
- package/src/client/actor-conn.ts +34 -6
- package/src/client/actor-handle.ts +1 -2
- package/src/client/queue.ts +1 -2
- package/src/client/utils.ts +1 -0
- package/src/common/encoding.ts +5 -243
- package/src/common/inline-websocket-adapter.ts +12 -12
- package/src/common/log.ts +0 -1
- package/src/common/router.ts +2 -2
- package/src/common/utils.ts +148 -0
- package/src/drivers/engine/actor-driver.ts +11 -11
- package/src/engine-client/actor-websocket-client.ts +1 -2
- package/src/engine-client/mod.ts +2 -3
- package/src/registry/index.ts +109 -46
- package/src/registry/napi-runtime.ts +34 -11
- package/src/registry/native.ts +162 -205
- package/src/registry/runtime.ts +12 -5
- package/src/registry/wasm-runtime.ts +13 -2
- package/src/serde.ts +2 -2
- package/src/workflow/context.ts +5 -32
- package/src/workflow/inspector.ts +1 -2
- package/dist/tsup/chunk-7HLFSAJP.cjs.map +0 -1
- package/dist/tsup/chunk-AWTPTUQ7.cjs.map +0 -1
- package/dist/tsup/chunk-BATTOVHF.cjs.map +0 -1
- package/dist/tsup/chunk-D5G75T7J.js.map +0 -1
- package/dist/tsup/chunk-EMFKMVJR.js.map +0 -1
- package/dist/tsup/chunk-GBG63SUG.js.map +0 -1
- package/dist/tsup/chunk-HGW6PBWR.cjs.map +0 -1
- package/dist/tsup/chunk-KY3CERZR.js.map +0 -1
- package/dist/tsup/chunk-SRNOPUC6.cjs.map +0 -1
- package/dist/tsup/chunk-TMLOKTRB.js.map +0 -1
- package/dist/tsup/chunk-UZXQEGVJ.js.map +0 -1
- package/dist/tsup/process-metrics-NW754INA.js +0 -118
- package/dist/tsup/process-metrics-NW754INA.js.map +0 -1
- package/dist/tsup/process-metrics-TYAGKCEJ.cjs +0 -118
- package/dist/tsup/process-metrics-TYAGKCEJ.cjs.map +0 -1
- package/src/registry/process-metrics.ts +0 -183
- package/src/registry/write-through-proxy.ts +0 -40
- /package/dist/tsup/{chunk-D3T3ZBSY.js.map → chunk-H37XQU3I.js.map} +0 -0
- /package/dist/tsup/{chunk-4JU3IPG2.js.map → chunk-H7P7WR2Y.js.map} +0 -0
- /package/dist/tsup/{chunk-VUGENVIK.js.map → chunk-KJTA3ATT.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-Y5NSCZA2.cjs","../../src/utils/env-vars.ts","../../src/common/utils.ts","../../package.json","../../src/common/log.ts","../../src/utils.ts"],"names":["logger"],"mappings":"AAAA;A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AAA;AACR,UAAA;AACL,UAAA;AACA,QAAA;AACF,MAAA;AACD,IAAA;AAE8B,IAAA;AAGF,IAAA;AACE,MAAA;AAC9B,IAAA;AAEO,IAAA;AACR,EAAA;AAAA;AAGkC,EAAA;AAC7B,IAAA;AACoB,MAAA;AAEA,QAAA;AACN,QAAA;AAGA,QAAA;AACC,QAAA;AAEb,QAAA;AACM,UAAA;AAET,UAAA;AACa,QAAA;AACE,UAAA;AACT,YAAA;AACoB,YAAA;AACzB,UAAA;AAED,UAAA;AACD,QAAA;AACD,MAAA;AACC,IAAA;AACuB,MAAA;AACzB,IAAA;AACD,EAAA;AACD;AAO2E;AACxD,EAAA;AACb,IAAA;AACiB,IAAA;AACtB,EAAA;AACD;AAuBC;AAEgC,EAAA;AAGA,EAAA;AACJ,EAAA;AACU,EAAA;AAGJ,EAAA;AACI,EAAA;AAET,EAAA;AAGC,EAAA;AACX,EAAA;AACW,IAAA;AAC9B,EAAA;AACiB,EAAA;AACkB,IAAA;AACR,MAAA;AACb,QAAA;AACoB,UAAA;AAC/B,QAAA;AACD,MAAA;AACD,IAAA;AACD,EAAA;AAEsC,EAAA;AACC,EAAA;AACxC;AAUW;AACmB,EAAA;AAEI,EAAA;AACA,EAAA;AAEM,EAAA;AACJ,IAAA;AACnC,EAAA;AACO,EAAA;AACR;AAE+B;AACtB,EAAA;AACC,EAAA;AACA,EAAA;AACV;AASyC;AAElB,EAAA;AACU,EAAA;AACxB,IAAA;AACR,EAAA;AAC+B,EAAA;AACvB,IAAA;AACR,EAAA;AACO,EAAA;AACR;ALuTyC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-Y5NSCZA2.cjs","sourcesContent":[null,"// This file consolidates all environment variables that affect RivetKit's behavior.\n//\n// IMPORTANT: When adding or modifying environment variables here, also update the\n// documentation at: website/src/content/docs/general/environment-variables.mdx\n\nimport { getEnvUniversal } from \"@/utils\";\n\n// Rivet configuration\nexport const getRivetEngine = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_ENGINE\");\nexport const getRivetEndpoint = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_ENDPOINT\");\nexport const getRivetToken = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_TOKEN\");\nexport const getRivetNamespace = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_NAMESPACE\");\nexport const getRivetPool = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_POOL\");\nexport const getRivetTotalSlots = (): number | undefined => {\n\tconst value = getEnvUniversal(\"RIVET_TOTAL_SLOTS\");\n\treturn value !== undefined ? parseInt(value, 10) : undefined;\n};\nexport const getRivetRunEngine = (): boolean =>\n\tgetEnvUniversal(\"RIVET_RUN_ENGINE\") === \"1\";\nexport const getRivetRunEngineVersion = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_RUN_ENGINE_VERSION\");\nexport const getRivetEnvoyKind = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_ENVOY_KIND\");\nexport const getRivetEnvoyVersion = (): number | undefined => {\n\tconst value = getEnvUniversal(\"RIVET_ENVOY_VERSION\");\n\treturn value !== undefined ? parseInt(value, 10) : undefined;\n};\nexport const getRivetPublicEndpoint = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_PUBLIC_ENDPOINT\");\nexport const getRivetPublicToken = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_PUBLIC_TOKEN\");\n// There is no RIVET_PUBLIC_NAMESPACE because the frontend and backend cannot\n// use different namespaces\n\n// RivetKit configuration\nexport const getRivetkitInspectorDisable = (): boolean =>\n\tgetEnvUniversal(\"RIVET_INSPECTOR_DISABLE\") === \"1\";\nexport const getRivetkitStoragePath = (): string | undefined =>\n\tgetEnvUniversal(\"RIVETKIT_STORAGE_PATH\");\nexport const getRivetkitRuntime = (): string | undefined =>\n\tgetEnvUniversal(\"RIVETKIT_RUNTIME\");\n\n// Logging configuration\n// DEPRECATED: LOG_LEVEL will be removed in a future version\nexport const getLogLevel = (): string | undefined =>\n\tgetEnvUniversal(\"RIVET_LOG_LEVEL\") ?? getEnvUniversal(\"LOG_LEVEL\");\nexport const getLogTarget = (): boolean =>\n\tgetEnvUniversal(\"RIVET_LOG_TARGET\") === \"1\";\nexport const getLogTimestamp = (): boolean =>\n\tgetEnvUniversal(\"RIVET_LOG_TIMESTAMP\") === \"1\";\nexport const getLogMessage = (): boolean =>\n\tgetEnvUniversal(\"RIVET_LOG_MESSAGE\") === \"1\";\nexport const getLogErrorStack = (): boolean =>\n\tgetEnvUniversal(\"RIVET_LOG_ERROR_STACK\") === \"1\";\nexport const getLogHeaders = (): boolean =>\n\tgetEnvUniversal(\"RIVET_LOG_HEADERS\") === \"1\";\n\n// Environment configuration\nexport const getNodeEnv = (): string | undefined => getEnvUniversal(\"NODE_ENV\");\nexport const getNextPhase = (): string | undefined =>\n\tgetEnvUniversal(\"NEXT_PHASE\");\nexport const isDev = (): boolean => getNodeEnv() !== \"production\";\n\n// Experimental\n/**\n * Enables experimental OTel tracing for Rivet Actors.\n *\n * When disabled, actors use an in-memory no-op traces implementation.\n */\nexport const getRivetExperimentalOtel = (): boolean =>\n\tgetEnvUniversal(\"RIVET_EXPERIMENTAL_OTEL\") === \"1\";\n","import type { Next } from \"hono\";\nimport type { ContentfulStatusCode } from \"hono/utils/http-status\";\nimport * as errors from \"@/actor/errors\";\nimport { getLogErrorStack } from \"@/utils/env-vars\";\n\nexport function assertUnreachable(x: never): never {\n\tthrow new Error(`Unreachable case: ${x}`);\n}\n\n/**\n * Safely stringifies an object, ensuring that the stringified object is under a certain size.\n * @param obj any object to stringify\n * @param maxSize maximum size of the stringified object in bytes\n * @returns stringified object\n */\nexport function safeStringify(obj: unknown, maxSize: number) {\n\tlet size = 0;\n\n\tfunction replacer(key: string, value: unknown) {\n\t\tif (value === null || value === undefined) return value;\n\t\tconst valueSize =\n\t\t\ttypeof value === \"string\"\n\t\t\t\t? value.length\n\t\t\t\t: JSON.stringify(value).length;\n\t\tsize += key.length + valueSize;\n\n\t\tif (size > maxSize) {\n\t\t\tthrow new Error(\n\t\t\t\t`JSON object exceeds size limit of ${maxSize} bytes.`,\n\t\t\t);\n\t\t}\n\n\t\treturn value;\n\t}\n\n\treturn JSON.stringify(obj, replacer);\n}\n\n// TODO: Instead of doing this, use a temp var for state and attempt to write\n// it. Roll back state if fails to serialize.\n\n/**\n * Check if a value is CBOR serializable.\n * Optionally pass an onInvalid callback to receive the path to invalid values.\n *\n * For a complete list of supported CBOR tags, see:\n * https://github.com/kriszyp/cbor-x/blob/cc1cf9df8ba72288c7842af1dd374d73e34cdbc1/README.md#list-of-supported-tags-for-decoding\n */\nexport function isCborSerializable(\n\tvalue: unknown,\n\tonInvalid?: (path: string) => void,\n\tcurrentPath = \"\",\n): boolean {\n\t// Handle primitive types directly\n\tif (value === null || value === undefined) {\n\t\treturn true;\n\t}\n\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) {\n\t\t\tonInvalid?.(currentPath);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (typeof value === \"boolean\" || typeof value === \"string\") {\n\t\treturn true;\n\t}\n\n\t// Handle BigInt (CBOR tags 2 and 3)\n\tif (typeof value === \"bigint\") {\n\t\treturn true;\n\t}\n\n\t// Handle Date objects (CBOR tags 0 and 1)\n\tif (value instanceof Date) {\n\t\treturn true;\n\t}\n\n\t// Handle typed arrays (CBOR tags 64-82)\n\tif (\n\t\tvalue instanceof Uint8Array ||\n\t\tvalue instanceof Uint8ClampedArray ||\n\t\tvalue instanceof Uint16Array ||\n\t\tvalue instanceof Uint32Array ||\n\t\tvalue instanceof BigUint64Array ||\n\t\tvalue instanceof Int8Array ||\n\t\tvalue instanceof Int16Array ||\n\t\tvalue instanceof Int32Array ||\n\t\tvalue instanceof BigInt64Array ||\n\t\tvalue instanceof Float32Array ||\n\t\tvalue instanceof Float64Array\n\t) {\n\t\treturn true;\n\t}\n\n\t// Handle Map (CBOR tag 259)\n\tif (value instanceof Map) {\n\t\tfor (const [key, val] of value.entries()) {\n\t\t\tconst keyPath = currentPath\n\t\t\t\t? `${currentPath}.key(${String(key)})`\n\t\t\t\t: `key(${String(key)})`;\n\t\t\tconst valPath = currentPath\n\t\t\t\t? `${currentPath}.value(${String(key)})`\n\t\t\t\t: `value(${String(key)})`;\n\t\t\tif (\n\t\t\t\t!isCborSerializable(key, onInvalid, keyPath) ||\n\t\t\t\t!isCborSerializable(val, onInvalid, valPath)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Handle Set (CBOR tag 258)\n\tif (value instanceof Set) {\n\t\tlet index = 0;\n\t\tfor (const item of value.values()) {\n\t\t\tconst itemPath = currentPath\n\t\t\t\t? `${currentPath}.set[${index}]`\n\t\t\t\t: `set[${index}]`;\n\t\t\tif (!isCborSerializable(item, onInvalid, itemPath)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Handle RegExp (CBOR tag 27)\n\tif (value instanceof RegExp) {\n\t\treturn true;\n\t}\n\n\t// Handle Error objects (CBOR tag 27)\n\tif (value instanceof Error) {\n\t\treturn true;\n\t}\n\n\t// Handle arrays\n\tif (Array.isArray(value)) {\n\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\tconst itemPath = currentPath ? `${currentPath}[${i}]` : `[${i}]`;\n\t\t\tif (!isCborSerializable(value[i], onInvalid, itemPath)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Handle plain objects and records (CBOR tags 105, 51, 57344-57599)\n\tif (typeof value === \"object\") {\n\t\t// Allow plain objects and objects with prototypes (for records and named objects)\n\t\tconst proto = Object.getPrototypeOf(value);\n\t\tif (proto !== null && proto !== Object.prototype) {\n\t\t\t// Check if it's a known serializable object type\n\t\t\tconst protoConstructor = value.constructor;\n\t\t\tif (protoConstructor && typeof protoConstructor.name === \"string\") {\n\t\t\t\t// Allow objects with named constructors (records, named objects)\n\t\t\t\t// This includes user-defined classes and built-in objects\n\t\t\t\t// that CBOR can serialize with tag 27 or record tags\n\t\t\t}\n\t\t}\n\n\t\t// Check all properties recursively\n\t\tfor (const key in value) {\n\t\t\tconst propPath = currentPath ? `${currentPath}.${key}` : key;\n\t\t\tif (\n\t\t\t\t!isCborSerializable(\n\t\t\t\t\tvalue[key as keyof typeof value],\n\t\t\t\t\tonInvalid,\n\t\t\t\t\tpropPath,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Not serializable\n\tonInvalid?.(currentPath);\n\treturn false;\n}\n\nexport interface DeconstructedError {\n\t__type: \"ActorError\";\n\tstatusCode: ContentfulStatusCode;\n\tpublic: boolean;\n\tgroup: string;\n\tcode: string;\n\tmessage: string;\n\tmetadata?: unknown;\n\tactor?: errors.ActorSpecifier;\n}\n\nfunction isCanonicalStructuredRivetError(\n\terror: unknown,\n): error is errors.RivetErrorLike {\n\treturn (\n\t\terror instanceof errors.RivetError ||\n\t\t(typeof error === \"object\" &&\n\t\t\terror !== null &&\n\t\t\t\"__type\" in error &&\n\t\t\terror.__type === \"RivetError\" &&\n\t\t\t\"group\" in error &&\n\t\t\ttypeof error.group === \"string\" &&\n\t\t\t\"code\" in error &&\n\t\t\ttypeof error.code === \"string\" &&\n\t\t\t\"message\" in error &&\n\t\t\ttypeof error.message === \"string\")\n\t);\n}\n\n/**\n * Deconstructs errors into response fields. Bridge callback errors that cross\n * into rivetkit-core are sanitized there; this only classifies JS-local errors.\n */\nexport function deconstructError(\n\terror: unknown,\n\texposeInternalError = false,\n): DeconstructedError {\n\t// Build response error information. Only return errors if flagged as public in order to prevent leaking internal behavior.\n\tlet statusCode: ContentfulStatusCode;\n\tlet public_: boolean;\n\tlet group: string;\n\tlet code: string;\n\tlet message: string;\n\tlet metadata: unknown;\n\tlet actor: errors.ActorSpecifier | undefined;\n\t// Structured errors from core or from pre-built `RivetError` instances are canonical.\n\t// Only unstructured errors go through the classifier below.\n\tif (isCanonicalStructuredRivetError(error)) {\n\t\tstatusCode = (\n\t\t\ttypeof error.statusCode === \"number\"\n\t\t\t\t? error.statusCode\n\t\t\t\t: error.public\n\t\t\t\t\t? 400\n\t\t\t\t\t: 500\n\t\t) as ContentfulStatusCode;\n\t\tpublic_ = error.public ?? false;\n\t\tgroup = error.group;\n\t\tcode = error.code;\n\t\tmessage = error.message;\n\t\tmetadata = error.metadata;\n\t\tactor = error.actor;\n\t} else if (errors.ActorError.isActorError(error) && error.public) {\n\t\t// Check if error has statusCode (could be ActorError instance or DeconstructedError)\n\t\tstatusCode = (\n\t\t\t\"statusCode\" in error && error.statusCode ? error.statusCode : 400\n\t\t) as ContentfulStatusCode;\n\t\tpublic_ = true;\n\t\tgroup = error.group;\n\t\tcode = error.code;\n\t\tmessage = getErrorMessage(error);\n\t\tmetadata = error.metadata;\n\t\tactor = error.actor;\n\t} else if (exposeInternalError) {\n\t\tif (errors.ActorError.isActorError(error)) {\n\t\t\tstatusCode = 500;\n\t\t\tpublic_ = false;\n\t\t\tgroup = error.group;\n\t\t\tcode = error.code;\n\t\t\tmessage = getErrorMessage(error);\n\t\t\tmetadata = error.metadata;\n\t\t\tactor = error.actor;\n\t\t} else {\n\t\t\tstatusCode = 500;\n\t\t\tpublic_ = false;\n\t\t\tgroup = \"rivetkit\";\n\t\t\tcode = errors.INTERNAL_ERROR_CODE;\n\t\t\tmessage = getErrorMessage(error);\n\t\t}\n\t} else {\n\t\tstatusCode = 500;\n\t\tpublic_ = false;\n\t\tgroup = \"rivetkit\";\n\t\tcode = errors.INTERNAL_ERROR_CODE;\n\t\tmessage = errors.INTERNAL_ERROR_DESCRIPTION;\n\t\tif (errors.ActorError.isActorError(error)) {\n\t\t\tactor = error.actor;\n\t\t}\n\t\tmetadata = {\n\t\t\t//url: `https://hub.rivet.dev/projects/${actorMetadata.project.slug}/environments/${actorMetadata.environment.slug}/actors?actorId=${actorMetadata.actor.id}`,\n\t\t} satisfies errors.InternalErrorMetadata;\n\t}\n\n\treturn {\n\t\t__type: \"ActorError\",\n\t\tstatusCode,\n\t\tpublic: public_,\n\t\tgroup,\n\t\tcode,\n\t\tmessage,\n\t\tmetadata,\n\t\tactor,\n\t};\n}\n\nexport function stringifyError(error: unknown): string {\n\tif (error instanceof Error) {\n\t\tif (typeof process !== \"undefined\" && getLogErrorStack()) {\n\t\t\tlet stack: string | undefined;\n\t\t\ttry {\n\t\t\t\tstack = error.stack;\n\t\t\t} catch {\n\t\t\t\tstack = undefined;\n\t\t\t}\n\t\t\treturn `${error.name}: ${error.message}${stack ? `\\n${stack}` : \"\"}`;\n\t\t} else {\n\t\t\treturn `${error.name}: ${error.message}`;\n\t\t}\n\t} else if (typeof error === \"string\") {\n\t\treturn error;\n\t} else if (typeof error === \"object\" && error !== null) {\n\t\ttry {\n\t\t\treturn `${JSON.stringify(error)}`;\n\t\t} catch {\n\t\t\treturn \"[cannot stringify error]\";\n\t\t}\n\t} else {\n\t\treturn `Unknown error: ${getErrorMessage(error)}`;\n\t}\n}\n\nfunction getErrorMessage(err: unknown): string {\n\tif (\n\t\terr &&\n\t\ttypeof err === \"object\" &&\n\t\t\"message\" in err &&\n\t\ttypeof err.message === \"string\"\n\t) {\n\t\treturn err.message;\n\t} else {\n\t\treturn String(err);\n\t}\n}\n\n/** Generates a `Next` handler to pass to middleware in order to be able to call arbitrary middleware. */\nexport function noopNext(): Next {\n\treturn async () => {};\n}\n","{\n\t\"name\": \"rivetkit\",\n\t\"version\": \"2.3.0-rc.9\",\n\t\"description\": \"Lightweight libraries for building stateful actors on edge platforms\",\n\t\"license\": \"Apache-2.0\",\n\t\"keywords\": [\n\t\t\"rivetkit\",\n\t\t\"stateful\",\n\t\t\"serverless\",\n\t\t\"actors\",\n\t\t\"agents\",\n\t\t\"realtime\",\n\t\t\"websocket\",\n\t\t\"actors\",\n\t\t\"framework\"\n\t],\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"schemas\",\n\t\t\"src\",\n\t\t\"package.json\"\n\t],\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/mod.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/mod.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/mod.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/mod.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./workflow\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/workflow/mod.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/workflow/mod.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/workflow/mod.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/workflow/mod.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./test\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/test/mod.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/test/mod.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/test/mod.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/test/mod.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./db\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/db/mod.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/db/mod.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/db/mod.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/db/mod.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./db/drizzle\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/db/drizzle.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/db/drizzle.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/db/drizzle.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/db/drizzle.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./client\": {\n\t\t\t\"import\": {\n\t\t\t\t\"browser\": {\n\t\t\t\t\t\"types\": \"./dist/browser/client.d.ts\",\n\t\t\t\t\t\"default\": \"./dist/browser/client.js\"\n\t\t\t\t},\n\t\t\t\t\"types\": \"./dist/tsup/client/mod.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/client/mod.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/client/mod.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/client/mod.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./log\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/common/log.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/common/log.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/common/log.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/common/log.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./errors\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/actor/errors.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/actor/errors.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/actor/errors.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/actor/errors.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./inspector\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/inspector/mod.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/inspector/mod.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/inspector/mod.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/inspector/mod.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./inspector/client\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/browser/inspector/client.d.ts\",\n\t\t\t\t\"default\": \"./dist/browser/inspector/client.js\"\n\t\t\t}\n\t\t},\n\t\t\"./utils\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/utils.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/utils.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/utils.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/utils.cjs\"\n\t\t\t}\n\t\t},\n\t\t\"./agent-os\": {\n\t\t\t\"import\": {\n\t\t\t\t\"types\": \"./dist/tsup/agent-os/index.d.ts\",\n\t\t\t\t\"default\": \"./dist/tsup/agent-os/index.js\"\n\t\t\t},\n\t\t\t\"require\": {\n\t\t\t\t\"types\": \"./dist/tsup/agent-os/index.d.cts\",\n\t\t\t\t\"default\": \"./dist/tsup/agent-os/index.cjs\"\n\t\t\t}\n\t\t}\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=22.0.0\"\n\t},\n\t\"sideEffects\": [\n\t\t\"./dist/tsup/chunk-*.js\",\n\t\t\"./dist/tsup/chunk-*.cjs\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsup src/mod.ts src/client/mod.ts src/common/log.ts src/common/websocket.ts src/actor/errors.ts src/utils.ts src/workflow/mod.ts src/test/mod.ts src/inspector/mod.ts src/db/mod.ts src/db/drizzle.ts && tsup src/agent-os/index.ts --no-clean --out-dir dist/tsup/agent-os\",\n\t\t\"build:browser\": \"tsup --config tsup.browser.config.ts\",\n\t\t\"check-types\": \"tsc --noEmit\",\n\t\t\"lint\": \"biome check . && pnpm run check:test-skips && pnpm run check:wait-for-comments\",\n\t\t\"lint:fix\": \"biome check --write .\",\n\t\t\"check:test-skips\": \"tsx scripts/check-annotated-skips.ts\",\n\t\t\"check:wait-for-comments\": \"tsx scripts/check-wait-for-comments.ts\",\n\t\t\"format\": \"biome format .\",\n\t\t\"format:write\": \"biome format --write .\",\n\t\t\"test\": \"vitest run\",\n\t\t\"test:platforms\": \"pnpm run build && RIVETKIT_INCLUDE_PLATFORM_TESTS=1 vitest run tests/platforms --passWithNoTests\",\n\t\t\"test:watch\": \"vitest\",\n\t\t\"dump-asyncapi\": \"tsx scripts/dump-asyncapi.ts\",\n\t\t\"registry-config-schema-gen\": \"tsx scripts/registry-config-schema-gen.ts\",\n\t\t\"actor-config-schema-gen\": \"tsx scripts/actor-config-schema-gen.ts\"\n\t},\n\t\"dependencies\": {\n\t\t\"@rivet-dev/agent-os-core\": \"^0.1.1\",\n\t\t\"@hono/node-server\": \"^1.18.2\",\n\t\t\"@hono/node-ws\": \"^1.1.1\",\n\t\t\"@hono/zod-openapi\": \"^1.1.5\",\n\t\t\"@rivetkit/bare-ts\": \"^0.6.2\",\n\t\t\"@rivetkit/engine-cli\": \"workspace:*\",\n\t\t\"@rivetkit/engine-envoy-protocol\": \"workspace:*\",\n\t\t\"@rivetkit/rivetkit-napi\": \"workspace:*\",\n\t\t\"@rivetkit/rivetkit-wasm\": \"workspace:*\",\n\t\t\"@rivetkit/traces\": \"workspace:*\",\n\t\t\"@rivetkit/virtual-websocket\": \"workspace:*\",\n\t\t\"@rivetkit/workflow-engine\": \"workspace:*\",\n\t\t\"cbor-x\": \"^1.6.0\",\n\t\t\"drizzle-orm\": \"^0.44.2\",\n\t\t\"get-port\": \"^7.1.0\",\n\t\t\"hono\": \"^4.7.0\",\n\t\t\"invariant\": \"^2.2.4\",\n\t\t\"p-retry\": \"^6.2.1\",\n\t\t\"pino\": \"^9.5.0\",\n\t\t\"uuid\": \"^12.0.0\",\n\t\t\"vbare\": \"^0.0.4\",\n\t\t\"zod\": \"^4.1.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@copilotkit/llmock\": \"^1.6.0\",\n\t\t\"@rivet-dev/agent-os-common\": \"*\",\n\t\t\"@rivet-dev/agent-os-pi\": \"^0.1.1\",\n\t\t\"@biomejs/biome\": \"^2.3\",\n\t\t\"@standard-schema/spec\": \"^1.0.0\",\n\t\t\"@types/invariant\": \"^2\",\n\t\t\"@types/node\": \"^22.13.1\",\n\t\t\"eventsource\": \"^4.0.0\",\n\t\t\"tsup\": \"^8.4.0\",\n\t\t\"tsx\": \"^4.19.4\",\n\t\t\"typescript\": \"^5.7.3\",\n\t\t\"vite-tsconfig-paths\": \"^5.1.4\",\n\t\t\"vitest\": \"^3.1.1\",\n\t\t\"ws\": \"^8.18.1\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"drizzle-kit\": \"^0.31.2\",\n\t\t\"eventsource\": \"^4.0.0\",\n\t\t\"ws\": \"^8.0.0\"\n\t},\n\t\"peerDependenciesMeta\": {\n\t\t\"drizzle-kit\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"eventsource\": {\n\t\t\t\"optional\": true\n\t\t},\n\t\t\"ws\": {\n\t\t\t\"optional\": true\n\t\t}\n\t},\n\t\"stableVersion\": \"0.8.0\"\n}\n","import {\n\ttype DestinationStream,\n\ttype LevelWithSilent,\n\ttype Logger,\n\tpino,\n\tstdTimeFunctions,\n} from \"pino\";\nimport { z } from \"zod/v4\";\nimport { getLogLevel, getLogTarget, getLogTimestamp } from \"@/utils/env-vars\";\n\nexport type { Logger } from \"pino\";\n\nlet baseLogger: Logger | undefined;\nlet configuredLogLevel: LogLevel | undefined;\n\n/** Cache of child loggers by logger name. */\nconst loggerCache = new Map<string, Logger>();\n\nexport const LogLevelSchema = z.enum([\n\t\"trace\",\n\t\"debug\",\n\t\"info\",\n\t\"warn\",\n\t\"error\",\n\t\"fatal\",\n\t\"silent\",\n]);\n\nexport type LogLevel = z.infer<typeof LogLevelSchema>;\n\nexport function getPinoLevel(logLevel?: LogLevel): LevelWithSilent {\n\t// Priority: provided > configured > env > default\n\tif (logLevel) {\n\t\treturn logLevel;\n\t}\n\n\tif (configuredLogLevel) {\n\t\treturn configuredLogLevel;\n\t}\n\n\tconst raw = (getLogLevel() || \"warn\").toString().toLowerCase();\n\n\tconst parsed = LogLevelSchema.safeParse(raw);\n\tif (parsed.success) {\n\t\treturn parsed.data;\n\t}\n\n\t// Default to info if invalid\n\treturn \"info\";\n}\n\nexport function getIncludeTarget(): boolean {\n\treturn getLogTarget();\n}\n\n/**\n * Configure a custom base logger.\n */\nexport function configureBaseLogger(logger: Logger): void {\n\tbaseLogger = logger;\n\tloggerCache.clear();\n}\n\n/**\n * Configure the default logger with optional log level.\n */\nexport function configureDefaultLogger(logLevel?: LogLevel) {\n\t// Store the configured log level\n\tif (logLevel) {\n\t\tconfiguredLogLevel = logLevel;\n\t}\n\n\tbaseLogger = pino(\n\t\t{\n\t\t\tlevel: getPinoLevel(logLevel),\n\t\t\tmessageKey: \"msg\",\n\t\t\t// Do not include pid/hostname in output\n\t\t\tbase: {},\n\t\t\t// Keep the numeric level so the logfmt sink can match Pino's levels.\n\t\t\tformatters: {\n\t\t\t\tlevel(_label: string, number: number) {\n\t\t\t\t\treturn { level: number };\n\t\t\t\t},\n\t\t\t},\n\t\t\ttimestamp: getLogTimestamp() ? stdTimeFunctions.epochTime : false,\n\t\t},\n\t\tcreateLogfmtDestination(),\n\t);\n\n\tloggerCache.clear();\n}\n\n/**\n * Get or initialize the base logger.\n */\nexport function getBaseLogger(): Logger {\n\tif (!baseLogger) {\n\t\tconfigureDefaultLogger();\n\t}\n\treturn baseLogger!;\n}\n\n/**\n * Returns a child logger with `target` bound for the given name.\n */\nexport function getLogger(name = \"default\"): Logger {\n\t// Check cache first\n\tconst cached = loggerCache.get(name);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\t// Create\n\tconst base = getBaseLogger();\n\n\t// Add target to log if enabled\n\tconst child = getIncludeTarget() ? base.child({ target: name }) : base;\n\n\t// Cache the logger\n\tloggerCache.set(name, child);\n\n\treturn child;\n}\n\nconst PINO_LEVEL_LABELS: Record<number, string> = {\n\t10: \"trace\",\n\t20: \"debug\",\n\t30: \"info\",\n\t40: \"warn\",\n\t50: \"error\",\n\t60: \"fatal\",\n};\n\nfunction createLogfmtDestination(): DestinationStream {\n\treturn {\n\t\twrite(msg: string): void {\n\t\t\tconst line = formatLogfmtLine(msg);\n\t\t\tif (typeof process !== \"undefined\" && process.stdout?.write) {\n\t\t\t\tprocess.stdout.write(`${line}\\n`);\n\t\t\t} else {\n\t\t\t\tconsole.log(line);\n\t\t\t}\n\t\t},\n\t};\n}\n\nfunction formatLogfmtLine(raw: string): string {\n\tlet data: Record<string, unknown>;\n\ttry {\n\t\tdata = JSON.parse(raw);\n\t} catch {\n\t\treturn raw.trimEnd();\n\t}\n\n\tconst parts: string[] = [];\n\tappendLogfmtEntry(parts, \"level\", formatPinoLevel(data.level));\n\n\tif (data.time !== undefined) {\n\t\tappendLogfmtEntry(parts, \"ts\", data.time);\n\t}\n\n\tfor (const [key, value] of Object.entries(data)) {\n\t\tif (key === \"level\" || key === \"time\") {\n\t\t\tcontinue;\n\t\t}\n\t\tappendLogfmtEntry(parts, key, value);\n\t}\n\n\treturn parts.join(\" \");\n}\n\nfunction formatPinoLevel(level: unknown): string {\n\tif (typeof level === \"number\") {\n\t\treturn PINO_LEVEL_LABELS[level] ?? level.toString();\n\t}\n\n\tif (typeof level === \"string\") {\n\t\treturn level.toLowerCase();\n\t}\n\n\treturn \"info\";\n}\n\nfunction appendLogfmtEntry(parts: string[], key: string, value: unknown): void {\n\tconst safeKey = key.replace(/[\\s=\"]/g, \"\");\n\tif (safeKey.length === 0) {\n\t\treturn;\n\t}\n\n\tparts.push(`${safeKey}=${formatLogfmtValue(value)}`);\n}\n\nfunction formatLogfmtValue(value: unknown): string {\n\tif (typeof value === \"number\" || typeof value === \"boolean\") {\n\t\treturn String(value);\n\t}\n\n\tif (value === null || value === undefined) {\n\t\treturn \"null\";\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn quoteLogfmtString(value);\n\t}\n\n\treturn quoteLogfmtString(JSON.stringify(value));\n}\n\nfunction quoteLogfmtString(value: string): string {\n\tif (!/[\\s=\"]/.test(value)) {\n\t\treturn value;\n\t}\n\n\treturn `\"${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\")}\"`;\n}\n","import { stringifyError } from \"@/common/utils\";\nimport type { Context as HonoContext, Handler as HonoHandler } from \"hono\";\nimport { stringify as uuidstringify } from \"uuid\";\nimport pkgJson from \"../package.json\" with { type: \"json\" };\nimport { getLogger } from \"./common/log\";\nimport { assertUnreachable } from \"./common/utils\";\n\n/** @experimental */\nexport { stringifyError };\n\n/** @experimental */\nexport { assertUnreachable };\n\n/**\n * Joins multiple abort signals into one.\n *\n * The returned signal aborts when the first input signal aborts.\n * Uses `AbortSignal.any(...)` when available, with a runtime fallback.\n *\n * @experimental\n */\nexport function joinSignals(\n\t...signals: Array<AbortSignal | undefined | null>\n): AbortSignal {\n\tconst validSignals = signals.filter(\n\t\t(signal): signal is AbortSignal => signal != null,\n\t);\n\n\tif (validSignals.length === 0) {\n\t\treturn new AbortController().signal;\n\t}\n\n\tif (validSignals.length === 1) {\n\t\treturn validSignals[0];\n\t}\n\n\tconst signalAny = (\n\t\tAbortSignal as typeof AbortSignal & {\n\t\t\tany?: (signals: AbortSignal[]) => AbortSignal;\n\t\t}\n\t).any;\n\tif (typeof signalAny === \"function\") {\n\t\treturn signalAny(validSignals);\n\t}\n\n\tconst controller = new AbortController();\n\tconst cleanups: Array<() => void> = [];\n\n\tconst abortWithSignal = (signal: AbortSignal) => {\n\t\tif (controller.signal.aborted) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const cleanup of cleanups) {\n\t\t\tcleanup();\n\t\t}\n\n\t\tconst reason = (signal as AbortSignal & { reason?: unknown }).reason;\n\t\tcontroller.abort(reason);\n\t};\n\n\tfor (const signal of validSignals) {\n\t\tif (signal.aborted) {\n\t\t\tabortWithSignal(signal);\n\t\t\tbreak;\n\t\t}\n\n\t\tconst onAbort = () => abortWithSignal(signal);\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tcleanups.push(() => signal.removeEventListener(\"abort\", onAbort));\n\t}\n\n\treturn controller.signal;\n}\n\n/**\n * Returns a promise that resolves after the given number of milliseconds.\n *\n * @experimental\n */\nexport function sleep(ms: number): Promise<void> {\n\treturn new Promise<void>((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Creates a fixed-rate interval tick function that can be awaited in a loop.\n *\n * @example\n * const tick = interval(100);\n * while (!c.aborted) {\n * await tick();\n * if (c.aborted) break;\n * // ... game logic\n * }\n *\n * @experimental\n */\nexport function interval(ms: number): () => Promise<void> {\n\treturn () => sleep(ms);\n}\n\nexport const VERSION = pkgJson.version;\n\nlet _userAgent: string | undefined;\n\nfunction logger() {\n\treturn getLogger(\"utils\");\n}\n\n/**\n * Builds the HTTP user agent used by this library.\n *\n * @experimental\n */\nexport function httpUserAgent(): string {\n\t// Return cached value if already initialized\n\tif (_userAgent !== undefined) {\n\t\treturn _userAgent;\n\t}\n\n\t// Library\n\tlet userAgent = `RivetKit/${VERSION}`;\n\n\t// Navigator\n\tconst navigatorObj =\n\t\ttypeof navigator !== \"undefined\" ? navigator : undefined;\n\tif (navigatorObj?.userAgent) userAgent += ` ${navigatorObj.userAgent}`;\n\n\t_userAgent = userAgent;\n\n\treturn userAgent;\n}\n\nexport type UpgradeWebSocket = (\n\tcreateEvents: (c: HonoContext) => any,\n) => HonoHandler;\n\nexport type GetUpgradeWebSocket = () => UpgradeWebSocket;\n\n/**\n * Reads an environment variable from Deno or Node runtimes.\n *\n * @experimental\n */\nexport function getEnvUniversal(key: string): string | undefined {\n\tif (typeof Deno !== \"undefined\") {\n\t\treturn Deno.env.get(key);\n\t} else if (typeof process !== \"undefined\") {\n\t\t// Do this after Deno since `process` is sometimes polyfilled\n\t\treturn process.env[key];\n\t}\n}\n\n/**\n * Traces a debug value and returns it.\n *\n * @experimental\n */\nexport function dbg<T>(x: T): T {\n\tconsole.trace(`=== DEBUG ===\\n${x}`);\n\treturn x;\n}\n\n/**\n * Converts various ArrayBuffer-like types to Uint8Array.\n * Handles ArrayBuffer, ArrayBufferView (including typed arrays), and passes through existing Uint8Array.\n *\n * @param data - The ArrayBuffer or ArrayBufferView to convert\n * @returns A Uint8Array view of the data\n *\n * @experimental\n */\nexport function toUint8Array(data: ArrayBuffer | ArrayBufferView): Uint8Array {\n\tif (data instanceof Uint8Array) {\n\t\treturn data;\n\t} else if (data instanceof ArrayBuffer) {\n\t\treturn new Uint8Array(data);\n\t} else if (ArrayBuffer.isView(data)) {\n\t\t// Handle other ArrayBufferView types (Int8Array, Uint16Array, DataView, etc.)\n\t\treturn new Uint8Array(\n\t\t\tdata.buffer.slice(\n\t\t\t\tdata.byteOffset,\n\t\t\t\tdata.byteOffset + data.byteLength,\n\t\t\t),\n\t\t);\n\t} else {\n\t\tthrow new TypeError(\"Input must be ArrayBuffer or ArrayBufferView\");\n\t}\n}\n\n// Long timeouts\n//\n// JavaScript timers use a signed 32-bit integer for delays, so values above 2^31-1 (~24.8 days)\n// are not reliable and may fire immediately or overflow.\n//\n// https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#maximum_delay_value\nconst TIMEOUT_MAX = 2147483647; // 2^31-1\n\nexport type LongTimeoutHandle = { abort: () => void };\n\n/**\n * Polyfill for Promise.withResolvers().\n *\n * This is specifically for Cloudflare Workers. Their implementation of Promise.withResolvers does not work correctly.\n *\n * @experimental\n */\nexport function promiseWithResolvers<T>(onReject: (reason?: any) => void): {\n\tpromise: Promise<T>;\n\tresolve: (value: T | PromiseLike<T>) => void;\n\treject: (reason?: any) => void;\n} {\n\tlet resolve!: (value: T | PromiseLike<T>) => void;\n\tlet reject!: (reason?: any) => void;\n\tconst promise = new Promise<T>((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\tpromise.catch(onReject);\n\treturn { promise, resolve, reject };\n}\n\n/**\n * Sets a timeout that supports delays larger than the JavaScript timer limit.\n *\n * @experimental\n */\nexport function setLongTimeout(\n\tlistener: () => void,\n\tafter: number,\n): LongTimeoutHandle {\n\tlet timeout: ReturnType<typeof setTimeout> | undefined;\n\n\tfunction start(remaining: number) {\n\t\tif (remaining <= TIMEOUT_MAX) {\n\t\t\ttimeout = setTimeout(listener, remaining);\n\t\t} else {\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\tstart(remaining - TIMEOUT_MAX);\n\t\t\t}, TIMEOUT_MAX);\n\t\t}\n\t}\n\n\tstart(after);\n\n\treturn {\n\t\tabort: () => {\n\t\t\tif (timeout !== undefined) clearTimeout(timeout);\n\t\t},\n\t};\n}\n\n/**\n * A tiny utility that coalesces/enqueues async operations so only the latest\n * queued task runs per cycle, while callers receive a promise that resolves\n * when the task for the cycle they joined has completed.\n */\nexport class SinglePromiseQueue {\n\t/** Next operation to execute in the queue. If attempting to enqueue another op, it will override the existing op. */\n\t#queuedOp?: () => Promise<void>;\n\n\t/** The currently running promise of #drainLoop. Do not await this, instead await `pending` to await the current cycle. */\n\trunningDrainLoop?: Promise<void>;\n\n\t/** Pending resolver fro the currently queued entry. */\n\t#pending?: ReturnType<typeof promiseWithResolvers<void>>;\n\n\t/** Queue the next operation and return a promise that resolves when it flushes. */\n\tenqueue(op: () => Promise<void>): Promise<void> {\n\t\t// Replace any previously queued operation with the latest one\n\t\tthis.#queuedOp = op;\n\n\t\t// Ensure a shared resolver exists for all callers in this cycle\n\t\tif (!this.#pending) {\n\t\t\tthis.#pending = promiseWithResolvers<void>((reason) =>\n\t\t\t\tlogger().warn({\n\t\t\t\t\tmsg: \"unhandled single promise queue rejection\",\n\t\t\t\t\treason,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tconst waitForThisCycle = this.#pending.promise;\n\n\t\t// Start runner if not already running\n\t\tif (!this.runningDrainLoop) {\n\t\t\tthis.runningDrainLoop = this.#drainLoop();\n\t\t}\n\n\t\treturn waitForThisCycle;\n\t}\n\n\t/** Drain queued operations sequentially until there is nothing left. */\n\tasync #drainLoop(): Promise<void> {\n\t\ttry {\n\t\t\twhile (this.#queuedOp) {\n\t\t\t\t// Capture current cycle resolver then reset for the next cycle\n\t\t\t\tconst resolver = this.#pending;\n\t\t\t\tthis.#pending = undefined;\n\n\t\t\t\t// Capture and clear the currently queued operation\n\t\t\t\tconst op = this.#queuedOp;\n\t\t\t\tthis.#queuedOp = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tawait op();\n\t\t\t\t\t// Notify all waiters for this cycle\n\t\t\t\t\tresolver?.resolve();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlogger().error({\n\t\t\t\t\t\tmsg: \"error in SinglePromiseQueue drain loop\",\n\t\t\t\t\t\terror: stringifyError(err),\n\t\t\t\t\t});\n\t\t\t\t\t// Reject all waiters for this cycle\n\t\t\t\t\tresolver?.reject(err);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.runningDrainLoop = undefined;\n\t\t}\n\t}\n}\n\n/**\n * Converts a Buffer or Uint8Array into an ArrayBuffer view.\n *\n * @experimental\n */\nexport function bufferToArrayBuffer(buf: Buffer | Uint8Array): ArrayBuffer {\n\treturn buf.buffer.slice(\n\t\tbuf.byteOffset,\n\t\tbuf.byteOffset + buf.byteLength,\n\t) as ArrayBuffer;\n}\n\n/**\n * Properly combines a base URL endpoint with a path, preserving any base path in the endpoint.\n *\n * @example\n * combineUrlPath(\"http://localhost:8787/rivet\", \"/actors/action\")\n * // Returns: \"http://localhost:8787/rivet/actors/action\"\n *\n * @example\n * combineUrlPath(\"http://localhost:8787/rivet\", \"/actors?type=foo\", { namespace: \"test\" })\n * // Returns: \"http://localhost:8787/rivet/actors?type=foo&namespace=test\"\n *\n * @param endpoint The base URL endpoint that may contain a path component\n * @param path The path to append to the endpoint (may include query parameters)\n * @param queryParams Optional additional query parameters to append\n * @returns The properly combined URL string\n *\n * @experimental\n */\nexport function combineUrlPath(\n\tendpoint: string,\n\tpath: string,\n\tqueryParams?: Record<string, string | undefined>,\n): string {\n\tconst baseUrl = new URL(endpoint);\n\n\t// Extract path and query from the provided path\n\tconst pathParts = path.split(\"?\");\n\tconst pathOnly = pathParts[0];\n\tconst existingQuery = pathParts[1] || \"\";\n\n\t// Remove trailing slash from base path and ensure path starts with /\n\tconst basePath = baseUrl.pathname.replace(/\\/$/, \"\");\n\tconst cleanPath = pathOnly.startsWith(\"/\") ? pathOnly : `/${pathOnly}`;\n\t// Combine paths and remove any double slashes\n\tconst fullPath = (basePath + cleanPath).replace(/\\/\\//g, \"/\");\n\n\t// Build query string\n\tconst queryParts: string[] = [];\n\tif (existingQuery) {\n\t\tqueryParts.push(existingQuery);\n\t}\n\tif (queryParams) {\n\t\tfor (const [key, value] of Object.entries(queryParams)) {\n\t\t\tif (value !== undefined) {\n\t\t\t\tqueryParts.push(\n\t\t\t\t\t`${encodeURIComponent(key)}=${encodeURIComponent(value)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst fullQuery = queryParts.length > 0 ? `?${queryParts.join(\"&\")}` : \"\";\n\treturn `${baseUrl.protocol}//${baseUrl.host}${fullPath}${fullQuery}`;\n}\n\n/**\n * Compares two ArrayBuffer values by byte content.\n *\n * @experimental\n */\nexport function arrayBuffersEqual(\n\tbuf1: ArrayBuffer,\n\tbuf2: ArrayBuffer,\n): boolean {\n\tif (buf1.byteLength !== buf2.byteLength) return false;\n\n\tconst view1 = new Uint8Array(buf1);\n\tconst view2 = new Uint8Array(buf2);\n\n\tfor (let i = 0; i < view1.length; i++) {\n\t\tif (view1[i] !== view2[i]) return false;\n\t}\n\treturn true;\n}\n\nexport const EXTRA_ERROR_LOG = {\n\tissues: \"https://github.com/rivet-dev/rivet/issues\",\n\tsupport: \"https://rivet.dev/discord\",\n\tversion: VERSION,\n};\n\nexport type Runtime = \"deno\" | \"bun\" | \"node\";\n\n/**\n * Detects the current JavaScript runtime from the user agent.\n *\n * @experimental\n */\nexport function detectRuntime(): Runtime {\n\tconst userAgent =\n\t\ttypeof navigator !== \"undefined\" ? navigator.userAgent : \"\";\n\tif (userAgent.includes(\"Deno\")) {\n\t\treturn \"deno\";\n\t}\n\tif (userAgent.includes(\"Bun\")) {\n\t\treturn \"bun\";\n\t}\n\treturn \"node\";\n}\n\nexport type DeepReadonly<T> = {\n\treadonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];\n};\n\nexport type DeepMutable<T> = {\n\t-readonly [K in keyof T]: T[K] extends object ? DeepMutable<T[K]> : T[K];\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 _chunk4WPEZBK4cjs = require('../chunk-4WPEZBK4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,16 +8,16 @@ var _chunk4BPKKZJOcjs = require('../chunk-4BPKKZJO.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkGVTOE34Scjs = require('../chunk-GVTOE34S.cjs');
|
|
12
12
|
require('../chunk-LD5YASJU.cjs');
|
|
13
|
-
require('../chunk-
|
|
13
|
+
require('../chunk-VJFRBJVQ.cjs');
|
|
14
14
|
require('../chunk-2NDZ7JCR.cjs');
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
15
|
+
require('../chunk-MALSPBAF.cjs');
|
|
16
|
+
require('../chunk-Y5NSCZA2.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkQAZLM4WTcjs = require('../chunk-QAZLM4WT.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -29,5 +29,5 @@ var _chunk63WNTDRCcjs = require('../chunk-63WNTDRC.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
exports.ActorClientError =
|
|
32
|
+
exports.ActorClientError = _chunkGVTOE34Scjs.ActorClientError; exports.ActorConnDisposed = _chunkGVTOE34Scjs.ActorConnDisposed; exports.ActorConnRaw = _chunkGVTOE34Scjs.ActorConnRaw; exports.ActorError = _chunkQAZLM4WTcjs.RivetError; exports.ActorHandleRaw = _chunkGVTOE34Scjs.ActorHandleRaw; exports.MalformedResponseMessage = _chunkGVTOE34Scjs.MalformedResponseMessage; exports.ManagerError = _chunkGVTOE34Scjs.ManagerError; exports.RivetError = _chunkQAZLM4WTcjs.RivetError; exports.UserError = _chunkQAZLM4WTcjs.UserError; exports.createClient = _chunk4WPEZBK4cjs.createClient;
|
|
33
33
|
//# sourceMappingURL=mod.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ap as Registry, V as Client } from '../config-Ca8dN4cS.cjs';
|
|
2
|
+
export { a_ as ActorAccessor, a$ as ActorActionFunction, b0 as ActorActionOptions, b1 as ActorConn, b2 as ActorConnRaw, b3 as ActorConnStatus, b4 as ActorConnectOptions, r as ActorDefinition, b5 as ActorGatewayOptions, b6 as ActorHandle, b7 as ActorHandleRaw, A as AnyActorDefinition, b8 as ClientRaw, b9 as ConnectionStateCallback, ba as CreateOptions, bb as CreateRequest, a4 as Encoding, bc as EventUnsubscribe, bd as ExtractActorsFromRegistry, be as ExtractRegistryFromClient, bf as GetOptions, bg as GetWithIdOptions, bh as QueryOptions, bi as Region, bj as StatusChangeCallback } from '../config-Ca8dN4cS.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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ap as Registry, V as Client } from '../config-0Ta55UV0.js';
|
|
2
|
+
export { a_ as ActorAccessor, a$ as ActorActionFunction, b0 as ActorActionOptions, b1 as ActorConn, b2 as ActorConnRaw, b3 as ActorConnStatus, b4 as ActorConnectOptions, r as ActorDefinition, b5 as ActorGatewayOptions, b6 as ActorHandle, b7 as ActorHandleRaw, A as AnyActorDefinition, b8 as ClientRaw, b9 as ConnectionStateCallback, ba as CreateOptions, bb as CreateRequest, a4 as Encoding, bc as EventUnsubscribe, bd as ExtractActorsFromRegistry, be as ExtractRegistryFromClient, bf as GetOptions, bg as GetWithIdOptions, bh as QueryOptions, bi as Region, bj as StatusChangeCallback } from '../config-0Ta55UV0.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';
|
package/dist/tsup/client/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-H7P7WR2Y.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-
|
|
11
|
+
} from "../chunk-F3Q5BFQ6.js";
|
|
12
12
|
import "../chunk-3YY5S6TV.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-W7EYSYVI.js";
|
|
14
14
|
import "../chunk-PCBNKI2J.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-H37XQU3I.js";
|
|
16
|
+
import "../chunk-VRCIXJRN.js";
|
|
17
17
|
import {
|
|
18
18
|
RivetError,
|
|
19
19
|
UserError
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-KIWH5H3K.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 _chunkY5NSCZA2cjs = require('../chunk-Y5NSCZA2.cjs');
|
|
10
|
+
require('../chunk-QAZLM4WT.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -16,5 +16,5 @@ require('../chunk-63WNTDRC.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
exports.LogLevelSchema =
|
|
19
|
+
exports.LogLevelSchema = _chunkY5NSCZA2cjs.LogLevelSchema; exports.configureBaseLogger = _chunkY5NSCZA2cjs.configureBaseLogger; exports.configureDefaultLogger = _chunkY5NSCZA2cjs.configureDefaultLogger; exports.getBaseLogger = _chunkY5NSCZA2cjs.getBaseLogger; exports.getIncludeTarget = _chunkY5NSCZA2cjs.getIncludeTarget; exports.getLogger = _chunkY5NSCZA2cjs.getLogger; exports.getPinoLevel = _chunkY5NSCZA2cjs.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 _chunkMALSPBAFcjs = require('../chunk-MALSPBAF.cjs');
|
|
4
|
+
require('../chunk-Y5NSCZA2.cjs');
|
|
5
|
+
require('../chunk-QAZLM4WT.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.importWebSocket =
|
|
8
|
+
exports.importWebSocket = _chunkMALSPBAFcjs.importWebSocket;
|
|
9
9
|
//# sourceMappingURL=websocket.cjs.map
|
|
@@ -561,12 +561,14 @@ type FetchHandler = (request: Request, ...args: any) => Response | Promise<Respo
|
|
|
561
561
|
interface ServerlessHandler {
|
|
562
562
|
fetch: FetchHandler;
|
|
563
563
|
}
|
|
564
|
-
interface
|
|
565
|
-
|
|
566
|
-
|
|
564
|
+
interface RegistryRoutes {
|
|
565
|
+
health(): Promise<Response>;
|
|
566
|
+
metadata(): Promise<Response>;
|
|
567
|
+
prometheusMetrics(request?: Request): Promise<Response>;
|
|
567
568
|
}
|
|
568
569
|
declare class Registry<A extends RegistryActors> {
|
|
569
570
|
#private;
|
|
571
|
+
readonly routes: RegistryRoutes;
|
|
570
572
|
get config(): RegistryConfigInput<A>;
|
|
571
573
|
parseConfig(): RegistryConfig;
|
|
572
574
|
constructor(config: RegistryConfigInput<A>);
|
|
@@ -590,26 +592,6 @@ declare class Registry<A extends RegistryActors> {
|
|
|
590
592
|
* ```
|
|
591
593
|
*/
|
|
592
594
|
serve(): ServerlessHandler;
|
|
593
|
-
/**
|
|
594
|
-
* Starts an HTTP server that dispatches every request through the
|
|
595
|
-
* serverless handler. Uses `crossPlatformServe` to pick the right
|
|
596
|
-
* runtime (Node, Bun, Deno).
|
|
597
|
-
*
|
|
598
|
-
* @param opts.port Port to listen on. Defaults to 3000.
|
|
599
|
-
* @param opts.publicDir If set, serves static files from this directory
|
|
600
|
-
* before falling through to the registry handler.
|
|
601
|
-
*
|
|
602
|
-
* @example
|
|
603
|
-
* ```ts
|
|
604
|
-
* await registry.listen();
|
|
605
|
-
* await registry.listen({ port: 8080, publicDir: "./public" });
|
|
606
|
-
* ```
|
|
607
|
-
*/
|
|
608
|
-
listen(opts?: {
|
|
609
|
-
port?: number;
|
|
610
|
-
publicDir?: string;
|
|
611
|
-
}): Promise<void>;
|
|
612
|
-
diagnostics(): Promise<RegistryDiagnostics>;
|
|
613
595
|
startEnvoy(): void;
|
|
614
596
|
/**
|
|
615
597
|
* Starts the actor envoy for standalone server deployments.
|
|
@@ -1138,7 +1120,6 @@ declare function createClientWithDriver<A extends Registry<any>>(driver: EngineC
|
|
|
1138
1120
|
|
|
1139
1121
|
declare const DEFAULT_SLEEP_GRACE_PERIOD = 15000;
|
|
1140
1122
|
declare const ACTOR_CONTEXT_INTERNAL_SYMBOL: unique symbol;
|
|
1141
|
-
declare const RAW_STATE_SYMBOL: unique symbol;
|
|
1142
1123
|
declare const CONN_DRIVER_SYMBOL: unique symbol;
|
|
1143
1124
|
declare const CONN_STATE_MANAGER_SYMBOL: unique symbol;
|
|
1144
1125
|
interface ActorLogger {
|
|
@@ -1267,8 +1248,6 @@ interface Conn<TState = unknown, TConnParams = unknown, TConnState = unknown, TV
|
|
|
1267
1248
|
type AnyConn = Conn<any, any, any, any, any, any, any, any>;
|
|
1268
1249
|
interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
1269
1250
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
1270
|
-
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
1271
|
-
[RAW_STATE_SYMBOL](): TState;
|
|
1272
1251
|
state: TState;
|
|
1273
1252
|
vars: TVars;
|
|
1274
1253
|
readonly kv: ActorKv;
|
|
@@ -1760,4 +1739,4 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
1760
1739
|
}, z.core.$strip>>;
|
|
1761
1740
|
}, z.core.$strip>;
|
|
1762
1741
|
|
|
1763
|
-
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
|
|
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 ActorActionFunction 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, type ServerlessHandler as aA, type SqliteBackend as aB, SqliteBackendSchema as aC, type SqliteConfig as aD, SqliteConfigSchema as aE, type TestConfig as aF, TestConfigSchema as aG, type Type as aH, type WasmRuntimeBindings as aI, type WasmRuntimeConfig as aJ, WasmRuntimeConfigSchema as aK, type WasmRuntimeInitInput as aL, type WorkflowInspectorConfig as aM, actor as aN, buildActorNames as aO, createClientWithDriver as aP, event as aQ, getRunFunction as aR, getRunInspectorConfig as aS, getRunMetadata as aT, isStaticActorDefinition as aU, isStaticActorInstance as aV, lookupInRegistry as aW, queue as aX, setup as aY, test as aZ, type ActorAccessor 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, RUN_FUNCTION_CONFIG_SYMBOL as ao, Registry as ap, type RegistryActors as aq, type RegistryConfig as ar, type RegistryConfigInput as as, RegistryConfigSchema as at, type RegistryRoutes as au, type RunConfig as av, RunConfigSchema as aw, type RunInspectorConfig as ax, type RuntimeKind as ay, RuntimeKindSchema as az, type BeforeActionResponseContext as b, type ActorActionOptions as b0, type ActorConn as b1, ActorConnRaw as b2, type ActorConnStatus as b3, type ActorConnectOptions as b4, type ActorGatewayOptions as b5, type ActorHandle as b6, ActorHandleRaw as b7, ClientRaw as b8, type ConnectionStateCallback as b9, type CreateOptions as ba, type CreateRequest as bb, type EventUnsubscribe as bc, type ExtractActorsFromRegistry as bd, type ExtractRegistryFromClient as be, type GetOptions as bf, type GetWithIdOptions as bg, type QueryOptions as bh, type Region as bi, type StatusChangeCallback as bj, type InferSchemaMap as bk, type InferEventArgs as bl, 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 };
|
|
@@ -561,12 +561,14 @@ type FetchHandler = (request: Request, ...args: any) => Response | Promise<Respo
|
|
|
561
561
|
interface ServerlessHandler {
|
|
562
562
|
fetch: FetchHandler;
|
|
563
563
|
}
|
|
564
|
-
interface
|
|
565
|
-
|
|
566
|
-
|
|
564
|
+
interface RegistryRoutes {
|
|
565
|
+
health(): Promise<Response>;
|
|
566
|
+
metadata(): Promise<Response>;
|
|
567
|
+
prometheusMetrics(request?: Request): Promise<Response>;
|
|
567
568
|
}
|
|
568
569
|
declare class Registry<A extends RegistryActors> {
|
|
569
570
|
#private;
|
|
571
|
+
readonly routes: RegistryRoutes;
|
|
570
572
|
get config(): RegistryConfigInput<A>;
|
|
571
573
|
parseConfig(): RegistryConfig;
|
|
572
574
|
constructor(config: RegistryConfigInput<A>);
|
|
@@ -590,26 +592,6 @@ declare class Registry<A extends RegistryActors> {
|
|
|
590
592
|
* ```
|
|
591
593
|
*/
|
|
592
594
|
serve(): ServerlessHandler;
|
|
593
|
-
/**
|
|
594
|
-
* Starts an HTTP server that dispatches every request through the
|
|
595
|
-
* serverless handler. Uses `crossPlatformServe` to pick the right
|
|
596
|
-
* runtime (Node, Bun, Deno).
|
|
597
|
-
*
|
|
598
|
-
* @param opts.port Port to listen on. Defaults to 3000.
|
|
599
|
-
* @param opts.publicDir If set, serves static files from this directory
|
|
600
|
-
* before falling through to the registry handler.
|
|
601
|
-
*
|
|
602
|
-
* @example
|
|
603
|
-
* ```ts
|
|
604
|
-
* await registry.listen();
|
|
605
|
-
* await registry.listen({ port: 8080, publicDir: "./public" });
|
|
606
|
-
* ```
|
|
607
|
-
*/
|
|
608
|
-
listen(opts?: {
|
|
609
|
-
port?: number;
|
|
610
|
-
publicDir?: string;
|
|
611
|
-
}): Promise<void>;
|
|
612
|
-
diagnostics(): Promise<RegistryDiagnostics>;
|
|
613
595
|
startEnvoy(): void;
|
|
614
596
|
/**
|
|
615
597
|
* Starts the actor envoy for standalone server deployments.
|
|
@@ -1138,7 +1120,6 @@ declare function createClientWithDriver<A extends Registry<any>>(driver: EngineC
|
|
|
1138
1120
|
|
|
1139
1121
|
declare const DEFAULT_SLEEP_GRACE_PERIOD = 15000;
|
|
1140
1122
|
declare const ACTOR_CONTEXT_INTERNAL_SYMBOL: unique symbol;
|
|
1141
|
-
declare const RAW_STATE_SYMBOL: unique symbol;
|
|
1142
1123
|
declare const CONN_DRIVER_SYMBOL: unique symbol;
|
|
1143
1124
|
declare const CONN_STATE_MANAGER_SYMBOL: unique symbol;
|
|
1144
1125
|
interface ActorLogger {
|
|
@@ -1267,8 +1248,6 @@ interface Conn<TState = unknown, TConnParams = unknown, TConnState = unknown, TV
|
|
|
1267
1248
|
type AnyConn = Conn<any, any, any, any, any, any, any, any>;
|
|
1268
1249
|
interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
1269
1250
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
1270
|
-
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
1271
|
-
[RAW_STATE_SYMBOL](): TState;
|
|
1272
1251
|
state: TState;
|
|
1273
1252
|
vars: TVars;
|
|
1274
1253
|
readonly kv: ActorKv;
|
|
@@ -1760,4 +1739,4 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
1760
1739
|
}, z.core.$strip>>;
|
|
1761
1740
|
}, z.core.$strip>;
|
|
1762
1741
|
|
|
1763
|
-
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
|
|
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 ActorActionFunction 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, type ServerlessHandler as aA, type SqliteBackend as aB, SqliteBackendSchema as aC, type SqliteConfig as aD, SqliteConfigSchema as aE, type TestConfig as aF, TestConfigSchema as aG, type Type as aH, type WasmRuntimeBindings as aI, type WasmRuntimeConfig as aJ, WasmRuntimeConfigSchema as aK, type WasmRuntimeInitInput as aL, type WorkflowInspectorConfig as aM, actor as aN, buildActorNames as aO, createClientWithDriver as aP, event as aQ, getRunFunction as aR, getRunInspectorConfig as aS, getRunMetadata as aT, isStaticActorDefinition as aU, isStaticActorInstance as aV, lookupInRegistry as aW, queue as aX, setup as aY, test as aZ, type ActorAccessor 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, RUN_FUNCTION_CONFIG_SYMBOL as ao, Registry as ap, type RegistryActors as aq, type RegistryConfig as ar, type RegistryConfigInput as as, RegistryConfigSchema as at, type RegistryRoutes as au, type RunConfig as av, RunConfigSchema as aw, type RunInspectorConfig as ax, type RuntimeKind as ay, RuntimeKindSchema as az, type BeforeActionResponseContext as b, type ActorActionOptions as b0, type ActorConn as b1, ActorConnRaw as b2, type ActorConnStatus as b3, type ActorConnectOptions as b4, type ActorGatewayOptions as b5, type ActorHandle as b6, ActorHandleRaw as b7, ClientRaw as b8, type ConnectionStateCallback as b9, type CreateOptions as ba, type CreateRequest as bb, type EventUnsubscribe as bc, type ExtractActorsFromRegistry as bd, type ExtractRegistryFromClient as be, type GetOptions as bf, type GetWithIdOptions as bg, type QueryOptions as bh, type Region as bi, type StatusChangeCallback as bj, type InferSchemaMap as bk, type InferEventArgs as bl, 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, ae as QueueFilterName, aj as QueueNextOptions, ak as QueueResultMessageForName, ai as QueueNextBatchOptions,
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, ae as QueueFilterName, aj as QueueNextOptions, ak as QueueResultMessageForName, ai as QueueNextBatchOptions, bk as InferSchemaMap, ap as Registry, V as Client, u as ActorLogger, bl as InferEventArgs } from './config-0Ta55UV0.js';
|
|
2
2
|
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-CxjGYf4K.js';
|
|
3
3
|
import { WorkflowContextInterface, TryStepResult, TryBlockResult, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, ae as QueueFilterName, aj as QueueNextOptions, ak as QueueResultMessageForName, ai as QueueNextBatchOptions,
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, ae as QueueFilterName, aj as QueueNextOptions, ak as QueueResultMessageForName, ai as QueueNextBatchOptions, bk as InferSchemaMap, ap as Registry, V as Client, u as ActorLogger, bl as InferEventArgs } from './config-Ca8dN4cS.cjs';
|
|
2
2
|
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-CxjGYf4K.cjs';
|
|
3
3
|
import { WorkflowContextInterface, TryStepResult, TryBlockResult, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
|
|
4
4
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkCPA4Y3RGcjs = require('../chunk-CPA4Y3RG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
7
|
+
var _chunk4CGA6QJOcjs = require('../chunk-4CGA6QJO.cjs');
|
|
8
|
+
require('../chunk-VJFRBJVQ.cjs');
|
|
9
|
+
require('../chunk-Y5NSCZA2.cjs');
|
|
10
|
+
require('../chunk-QAZLM4WT.cjs');
|
|
11
11
|
|
|
12
12
|
// src/common/bare/generated/inspector/v4.ts
|
|
13
13
|
var _barets = require('@rivetkit/bare-ts'); var bare = _interopRequireWildcard(_barets);
|
|
@@ -761,5 +761,5 @@ function decodeToClient(bytes) {
|
|
|
761
761
|
|
|
762
762
|
|
|
763
763
|
|
|
764
|
-
exports.createWorkflowInspectorAdapter =
|
|
764
|
+
exports.createWorkflowInspectorAdapter = _chunkCPA4Y3RGcjs.createWorkflowInspectorAdapter; exports.decodeToClient = decodeToClient; exports.decodeToServer = decodeToServer; exports.decodeWorkflowHistoryTransport = _chunk4CGA6QJOcjs.decodeWorkflowHistoryTransport; exports.encodeToClient = encodeToClient; exports.encodeToServer = encodeToServer; exports.encodeWorkflowHistoryTransport = _chunk4CGA6QJOcjs.encodeWorkflowHistoryTransport; exports.readActionRequest = readActionRequest; exports.readActionResponse = readActionResponse; exports.readConnection = readConnection; exports.readConnectionsRequest = readConnectionsRequest; exports.readConnectionsResponse = readConnectionsResponse; exports.readConnectionsUpdated = readConnectionsUpdated; exports.readDatabaseSchemaRequest = readDatabaseSchemaRequest; exports.readDatabaseSchemaResponse = readDatabaseSchemaResponse; exports.readDatabaseTableRowsRequest = readDatabaseTableRowsRequest; exports.readDatabaseTableRowsResponse = readDatabaseTableRowsResponse; exports.readError = readError; exports.readInit = readInit; exports.readPatchStateRequest = readPatchStateRequest; exports.readQueueMessageSummary = readQueueMessageSummary; exports.readQueueRequest = readQueueRequest; exports.readQueueResponse = readQueueResponse; exports.readQueueStatus = readQueueStatus; exports.readQueueUpdated = readQueueUpdated; exports.readRpcsListRequest = readRpcsListRequest; exports.readRpcsListResponse = readRpcsListResponse; exports.readState = readState; exports.readStateRequest = readStateRequest; exports.readStateResponse = readStateResponse; exports.readStateUpdated = readStateUpdated; exports.readToClient = readToClient; exports.readToClientBody = readToClientBody; exports.readToServer = readToServer; exports.readToServerBody = readToServerBody; exports.readTraceQueryRequest = readTraceQueryRequest; exports.readTraceQueryResponse = readTraceQueryResponse; exports.readWorkflowHistory = readWorkflowHistory; exports.readWorkflowHistoryRequest = readWorkflowHistoryRequest; exports.readWorkflowHistoryResponse = readWorkflowHistoryResponse; exports.readWorkflowHistoryUpdated = readWorkflowHistoryUpdated; exports.readWorkflowReplayRequest = readWorkflowReplayRequest; exports.readWorkflowReplayResponse = readWorkflowReplayResponse; exports.writeActionRequest = writeActionRequest; exports.writeActionResponse = writeActionResponse; exports.writeConnection = writeConnection; exports.writeConnectionsRequest = writeConnectionsRequest; exports.writeConnectionsResponse = writeConnectionsResponse; exports.writeConnectionsUpdated = writeConnectionsUpdated; exports.writeDatabaseSchemaRequest = writeDatabaseSchemaRequest; exports.writeDatabaseSchemaResponse = writeDatabaseSchemaResponse; exports.writeDatabaseTableRowsRequest = writeDatabaseTableRowsRequest; exports.writeDatabaseTableRowsResponse = writeDatabaseTableRowsResponse; exports.writeError = writeError; exports.writeInit = writeInit; exports.writePatchStateRequest = writePatchStateRequest; exports.writeQueueMessageSummary = writeQueueMessageSummary; exports.writeQueueRequest = writeQueueRequest; exports.writeQueueResponse = writeQueueResponse; exports.writeQueueStatus = writeQueueStatus; exports.writeQueueUpdated = writeQueueUpdated; exports.writeRpcsListRequest = writeRpcsListRequest; exports.writeRpcsListResponse = writeRpcsListResponse; exports.writeState = writeState; exports.writeStateRequest = writeStateRequest; exports.writeStateResponse = writeStateResponse; exports.writeStateUpdated = writeStateUpdated; exports.writeToClient = writeToClient; exports.writeToClientBody = writeToClientBody; exports.writeToServer = writeToServer; exports.writeToServerBody = writeToServerBody; exports.writeTraceQueryRequest = writeTraceQueryRequest; exports.writeTraceQueryResponse = writeTraceQueryResponse; exports.writeWorkflowHistory = writeWorkflowHistory; exports.writeWorkflowHistoryRequest = writeWorkflowHistoryRequest; exports.writeWorkflowHistoryResponse = writeWorkflowHistoryResponse; exports.writeWorkflowHistoryUpdated = writeWorkflowHistoryUpdated; exports.writeWorkflowReplayRequest = writeWorkflowReplayRequest; exports.writeWorkflowReplayResponse = writeWorkflowReplayResponse;
|
|
765
765
|
//# sourceMappingURL=mod.cjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-MMMEZM5J.js";
|
|
4
4
|
import {
|
|
5
5
|
decodeWorkflowHistoryTransport,
|
|
6
6
|
encodeWorkflowHistoryTransport
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-KJTA3ATT.js";
|
|
8
|
+
import "../chunk-W7EYSYVI.js";
|
|
9
|
+
import "../chunk-VRCIXJRN.js";
|
|
10
|
+
import "../chunk-KIWH5H3K.js";
|
|
11
11
|
|
|
12
12
|
// src/common/bare/generated/inspector/v4.ts
|
|
13
13
|
import * as bare from "@rivetkit/bare-ts";
|