MCPcopy
hub / github.com/CopilotKit/CopilotKit / makeThread

Function makeThread

packages/bot/src/create-bot.ts:329–354  ·  view source on GitHub ↗
(
    adapter: PlatformAdapter,
    replyTarget: unknown,
    conversationKey: string,
    extras?: { userKey?: string; message?: IncomingMessage },
  )

Source from the content-addressed store, hash-verified

327 let toolDescriptors = toAgentToolDescriptors([...toolMap.values()]);
328
329 function makeThread(
330 adapter: PlatformAdapter,
331 replyTarget: unknown,
332 conversationKey: string,
333 extras?: { userKey?: string; message?: IncomingMessage },
334 ): Thread {
335 const deps: ThreadDeps = {
336 adapter,
337 replyTarget,
338 conversationKey,
339 registry,
340 agentFactory,
341 tools: toolMap,
342 toolDescriptors,
343 context,
344 registerWaiter: (k, r) => waiters.set(k, r),
345 interruptHandlers,
346 state: backend,
347 stateSchema: cfg.state,
348 transcripts,
349 userKey: extras?.userKey,
350 message: extras?.message,
351 telemetry,
352 };
353 return new Thread(deps);
354 }
355
356 /**
357 * Build the context-level `openModal` closure, or `undefined` when the surface

Callers 6

onTurnFunction · 0.70
onInteractionFunction · 0.70
onCommandFunction · 0.70
onThreadStartedFunction · 0.70
onReactionFunction · 0.70
onModalSubmitFunction · 0.70

Calls 1

setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…