MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / makeOpenModal

Function makeOpenModal

packages/bot/src/create-bot.ts:361–371  ·  view source on GitHub ↗

* Build the context-level `openModal` closure, or `undefined` when the surface * can't open one. Requires both `adapter.openModal` and a platform `triggerId`; * otherwise the context omits `openModal` (callers guard `ctx.openModal?.(view)`).

(
    adapter: PlatformAdapter,
    replyTarget: unknown,
    triggerId: string | undefined,
  )

Source from the content-addressed store, hash-verified

359 * otherwise the context omits `openModal` (callers guard `ctx.openModal?.(view)`).
360 */
361 function makeOpenModal(
362 adapter: PlatformAdapter,
363 replyTarget: unknown,
364 triggerId: string | undefined,
365 ):
366 | ((view: ModalView) => Promise<{ ok: boolean; error?: string }>)
367 | undefined {
368 if (!adapter.openModal || !triggerId) return undefined;
369 return (view: ModalView) =>
370 adapter.openModal!(replyTarget, triggerId, renderToIR(view));
371 }
372
373 function makeSink(adapter: PlatformAdapter): IngressSink {
374 return {

Callers 2

onInteractionFunction · 0.85
onCommandFunction · 0.85

Calls 1

renderToIRFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…