UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

16 lines (15 loc) • 732 B
//#region src/media/bounded-read-file.ts const BOUNDED_OUTBOUND_MEDIA_READ_FILE = Symbol("boundedOutboundMediaReadFile"); /** Marks an owned reader that can reject oversized files before buffering them. */ function createBoundedOutboundMediaReadFile(e) { const wrapped = (async (t) => await e(t)); Object.defineProperty(wrapped, BOUNDED_OUTBOUND_MEDIA_READ_FILE, { value: e }); return wrapped; } /** Passes source limits only to owned readers; public callbacks keep their one-argument contract. */ async function readOutboundMediaFile(e, t, n) { const r = e[BOUNDED_OUTBOUND_MEDIA_READ_FILE]; return r ? await r(t, n) : await e(t); } //#endregion export { readOutboundMediaFile as n, createBoundedOutboundMediaReadFile as t };