export function remotePeerThreadSourceContextKey(baseContextKey, threadId) {
    const thread = contextPart(threadId);
    return thread ? `${baseContextKey}:thread:${thread}` : baseContextKey;
}
function contextPart(value) {
    return String(value ?? "").trim().replace(/[^a-zA-Z0-9._-]/g, "_").slice(0, 180);
}
