Skip to content

toolmark-monorepo / @toolmark/core/bridge/in-page / createInPageChannel

Function: createInPageChannel() ​

createInPageChannel(): object

Defined in: packages/core/src/bridge/in-page.ts:28

Creates an in-page channel: a page-side BridgeTransport for bridge({ transport }) and an agent handle for a client-side LLM loop or tests. Both directions are delivered asynchronously (queueMicrotask); a throwing handler is logged and never breaks delivery to the others. transport.close() stops delivery in both directions.

Returns ​

object

{ transport, agent }.

agent ​

agent: InPageAgent

transport ​

transport: BridgeTransport