agents
Version:
A home for your AI agents
28 lines (27 loc) • 1.13 kB
TypeScript
//#region src/websockets/transport-protocol.d.ts
/**
* Isomorphic wire contract for the Cap'n Web connection transport.
*
* Imported by browser bundles and by the Worker runtime, so it must not
* import `cloudflare:workers`.
*/
/** Wire a `useAgent` / `AgentClient` connection travels on. */
type AgentTransport = "cf-websocket" | "capnweb";
/** Query parameter selecting the Cap'n Web connection transport. */
declare const CAPNWEB_TRANSPORT_QUERY = "__agents_transport";
declare const CAPNWEB_TRANSPORT_VALUE = "capnweb";
type TransportMessage = string | ArrayBuffer | ArrayBufferView;
/** Rewrite a host URL to select the Cap'n Web transport over `ws(s)`. */
declare function capnWebTransportUrl(url: string | URL): string;
/** Whether a request is a WebSocket upgrade selecting the transport. */
declare function isCapnWebTransportUpgrade(request: Request): boolean;
//#endregion
export {
capnWebTransportUrl as a,
TransportMessage as i,
CAPNWEB_TRANSPORT_QUERY as n,
isCapnWebTransportUpgrade as o,
CAPNWEB_TRANSPORT_VALUE as r,
AgentTransport as t
};
//# sourceMappingURL=transport-protocol-ZTew5Wso.d.ts.map