{"version":3,"file":"threadRenderer.cjs","names":[],"sources":["../../../src/web/lib/threadRenderer.ts"],"sourcesContent":["import type { ThreadViewOptions } from '@agimon-ai/po-core/web';\nimport type { ReactNode } from 'react';\n\ntype ThreadRenderer = (sessionId: string, threadId: string, options?: ThreadViewOptions) => ReactNode;\n\nlet render: ThreadRenderer | undefined;\n\n/**\n * Holds the host's thread view for the plugin props to render.\n *\n * The view is a feature built on the timeline, while the props are assembled\n * below it; the composition root binds the one to the other, the same\n * indirection the transport uses for the socket.\n */\nexport function bindThreadRenderer(renderer: ThreadRenderer): void {\n  render = renderer;\n}\n\nexport function releaseThreadRenderer(): void {\n  render = undefined;\n}\n\n/** The bound view, or nothing while none is bound (before the app mounts, and in unit tests). */\nexport function renderThread(sessionId: string, threadId: string, options?: ThreadViewOptions): ReactNode {\n  return render?.(sessionId, threadId, options) ?? null;\n}\n"],"mappings":";AAKA,IAAI;;;;;;;;AASJ,SAAgB,mBAAmB,UAAgC;CACjE,SAAS;AACX;AAEA,SAAgB,wBAA8B;CAC5C,SAAS,KAAA;AACX;;AAGA,SAAgB,aAAa,WAAmB,UAAkB,SAAwC;CACxG,OAAO,SAAS,WAAW,UAAU,OAAO,KAAK;AACnD"}