openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
12 lines (11 loc) • 794 B
JavaScript
import { i as loadOrCreateProcessDeviceIdentity } from "./device-identity-J83pn_rP.js";
import { createHmac } from "node:crypto";
//#region src/gateway/server-methods/session-goal-request.ts
/** Stable, keyed receipts do not retain another copy or an offline digest of prompt material. */
function fingerprintSessionGoalRequest(value) {
const identity = loadOrCreateProcessDeviceIdentity();
const canonical = JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) : item);
return createHmac("sha256", identity.privateKeyPem).update("openclaw.session-goal.v1\0").update(canonical).digest("hex");
}
//#endregion
export { fingerprintSessionGoalRequest as t };