Files
openclaw/extensions/synology-chat/src/session-key.ts
2026-03-22 09:21:05 -07:00

22 lines
680 B
TypeScript

import { buildAgentSessionKey } from "openclaw/plugin-sdk/core";
const CHANNEL_ID = "synology-chat";
export function buildSynologyChatInboundSessionKey(params: {
agentId: string;
accountId: string;
userId: string;
identityLinks?: Record<string, string[]>;
}): string {
return buildAgentSessionKey({
agentId: params.agentId,
channel: CHANNEL_ID,
accountId: params.accountId,
peer: { kind: "direct", id: params.userId },
// Synology Chat supports multiple independent accounts on one gateway.
// Keep direct-message sessions isolated per account and user.
dmScope: "per-account-channel-peer",
identityLinks: params.identityLinks,
});
}