openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 838 B
JavaScript
import"./transcript-sqlite-schema-facts-C1_zV4Yg.mjs";import"./transcript-kysely-sync-CAP5xe3V.mjs";import{brotliDecompressSync as e}from"node:zlib";const t=262144,n=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});function decodePayload(r,i,a){if(i!==`br`)throw Error(`Unsupported trajectory payload codec: ${String(i)}`);if(!(r instanceof Uint8Array)||r.byteLength===0||r.byteLength>t||typeof a!=`number`||!Number.isSafeInteger(a)||a<1||a>t)throw Error(`Invalid compressed trajectory payload bounds`);let o=e(r,{maxOutputLength:a});if(o.byteLength!==a)throw Error(`Compressed trajectory payload length does not match its recorded UTF-8 size`);return n.decode(o)}function readTrajectoryPayload(e){return e.event_codec===null?e.event_json:decodePayload(e.event_payload,e.event_codec,e.event_utf8_bytes)}export{readTrajectoryPayload as t};