MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / createLocalThreadDraft

Function createLocalThreadDraft

shared/session-paths.ts:49–64  ·  view source on GitHub ↗
(
  projectId: string,
  token = buildLocalSessionToken(),
  options: { chatGroupId?: string | undefined | null | undefined } = {},
)

Source from the content-addressed store, hash-verified

47}
48
49export function createLocalThreadDraft(
50 projectId: string,
51 token = buildLocalSessionToken(),
52 options: { chatGroupId?: string | undefined | null | undefined } = {},
53) {
54 const encodedProjectId = encodeURIComponent(projectId)
55 const chatGroupSuffix = options.chatGroupId
56 ? `?chatGroupId=${encodeURIComponent(options.chatGroupId)}`
57 : ''
58
59 return {
60 projectId,
61 threadId: `local-thread-${token}`,
62 sessionPath: `${LOCAL_SESSION_PREFIX}${encodedProjectId}/${token}${chatGroupSuffix}`,
63 }
64}

Callers 5

startNewThreadFunction · 0.90
startNewThreadFunction · 0.90
buildLocalThreadFallbackFunction · 0.90

Calls 1

buildLocalSessionTokenFunction · 0.85

Tested by

no test coverage detected