openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 885 B
JavaScript
import{r as localAgentAvatarRevision,t as isLocalAgentAvatarFileCurrent}from"./identity-avatar-file-A9zhOHyN.mjs";import{t as prepareCachedIdentityRead}from"./identity-file-runtime-Bm_ST1-9.mjs";
//!src/agents/identity-avatar-file-runtime.ts
function prepareLocalAgentAvatar(e){return prepareCachedIdentityRead({runtimeKey:Symbol.for(`openclaw.localAgentAvatars`),worker:`localAgentAvatar`,readerName:`Avatar reader`,key:()=>JSON.stringify([e.workspaceDir,e.source,e.readBody]),input:(t,n)=>({...e,knownRevision:n}),revision:e=>localAgentAvatarRevision(e.file),isCurrent:t=>isLocalAgentAvatarFileCurrent(e,t.file),sizeOf:e=>e.file.body?.byteLength??0,prepare:(e,t)=>{if(`kind`in e)return t;return e.ok?{ok:true,file:{...e.file,body:e.file.body?Buffer.from(e.file.body.buffer,e.file.body.byteOffset,e.file.body.byteLength):void 0}}:e},isLoaded:e=>e.ok})}export{prepareLocalAgentAvatar};