{"version":3,"file":"connect.cjs","names":["createSseEventResponse","extractForwardableHeaders"],"sources":["../../../../../src/v2/runtime/handlers/sse/connect.ts"],"sourcesContent":["import { CopilotRuntimeLike } from \"../../core/runtime\";\nimport { createSseEventResponse } from \"../shared/sse-response\";\nimport { extractForwardableHeaders } from \"../header-utils\";\n\ninterface HandleSseConnectParams {\n  runtime: CopilotRuntimeLike;\n  request: Request;\n  agentId: string;\n  threadId: string;\n}\n\nexport function handleSseConnect({\n  runtime,\n  request,\n  agentId,\n  threadId,\n}: HandleSseConnectParams): Response {\n  return createSseEventResponse({\n    request,\n    debugEventBus: runtime.debugEventBus,\n    // Forward the real agentId so debug envelopes reflect the agent the\n    // route resolved to — not the literal string \"connect\".\n    agentId,\n    observableFactory: () =>\n      runtime.runner.connect({\n        threadId,\n        headers: extractForwardableHeaders(request),\n      }),\n  });\n}\n"],"mappings":";;;;;AAWA,SAAgB,iBAAiB,EAC/B,SACA,SACA,SACA,YACmC;AACnC,QAAOA,4CAAuB;EAC5B;EACA,eAAe,QAAQ;EAGvB;EACA,yBACE,QAAQ,OAAO,QAAQ;GACrB;GACA,SAASC,+CAA0B,QAAQ;GAC5C,CAAC;EACL,CAAC"}