openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
36 lines (35 loc) • 1.08 kB
JavaScript
import { r as localAgentAvatarRevision, t as isLocalAgentAvatarFileCurrent } from "./identity-avatar-file-CzRs1l0-.mjs";
import { t as prepareCachedIdentityRead } from "./identity-file-runtime-DRBgVd9H.mjs";
//#region 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
});
}
//#endregion
export { prepareLocalAgentAvatar };