openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
38 lines (37 loc) • 1.66 kB
JavaScript
import "./session-participant-Bbap4dZh.js";
//#region src/config/sessions/session-entry-provenance.ts
function sessionCreatorProfileId(actor) {
return actor?.type === "human" && actor.source === "profile" ? actor.id : void 0;
}
const MAX_SESSION_PARTICIPANTS = 32;
function buildSessionCreationStamp(params) {
return {
createdVia: params.via,
...params.actor ? { createdActor: params.actor } : {},
createdAt: params.now ?? Date.now(),
...params.sandbox === "required" ? { sandbox: "required" } : {},
...params.skillLibrarySelections ? { skillLibrarySelections: params.skillLibrarySelections.map((selection) => ({ ...selection })) } : {}
};
}
/** Logical nodes retain creation attribution and isolation across writes and rollovers. */
function preserveCreationStamp(entry, authoritative) {
return authoritative ? {
...entry,
createdVia: authoritative.createdVia,
createdActor: authoritative.createdActor,
createdAt: authoritative.createdAt,
...authoritative.sandbox === "required" ? { sandbox: authoritative.sandbox } : {}
} : entry;
}
/** Delegation keeps a required parent's human isolation identity, regardless of current roles. */
function inheritSessionCreationPolicy(source, actor) {
return {
...source?.sandbox === "required" ? {
actor: source.createdActor,
sandbox: "required"
} : { actor },
...source?.skillLibrarySelections ? { skillLibrarySelections: source.skillLibrarySelections.map((selection) => ({ ...selection })) } : {}
};
}
//#endregion
export { sessionCreatorProfileId as a, preserveCreationStamp as i, buildSessionCreationStamp as n, inheritSessionCreationPolicy as r, MAX_SESSION_PARTICIPANTS as t };