重构会话管理功能,由后端 opencode 发放 sessionId,后端做 scope
This commit is contained in:
@@ -149,6 +149,12 @@ export const toProjectKey = (projectId?: string) => toScopedKey("project", proje
|
||||
export const toStableId = (...parts: string[]) =>
|
||||
createHash("sha256").update(parts.join("|")).digest("hex").slice(0, 24);
|
||||
|
||||
export const toConversationScopeKey = (
|
||||
actorKey: string,
|
||||
projectKey: string,
|
||||
sessionId: string,
|
||||
) => `conversation-${toStableId(actorKey, projectKey, sessionId)}`;
|
||||
|
||||
export const slugify = (value: string) =>
|
||||
value
|
||||
.toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user