agents
Version:
A home for your AI agents
19 lines (18 loc) • 799 B
JavaScript
//#region src/socket-address.ts
/**
* Set by `useAgent` on the socket it returns: `true` while the hook's options
* address a different agent than the socket it is still holding.
* `usePartySocket` replaces the socket in an effect, so for at least one
* render after `name` (or the host, path, or sub-agent chain) changes the
* returned socket still points at the previous agent, with the previous
* credentials in its URL.
*
* A registered symbol, so a separately bundled `useAgentChat` still sees it.
*/
const SOCKET_ADDRESS_PENDING = Symbol.for("cloudflare.agents.socketAddressPending");
function isSocketAddressPending(socket) {
return socket[SOCKET_ADDRESS_PENDING] === true;
}
//#endregion
export { SOCKET_ADDRESS_PENDING, isSocketAddressPending };
//# sourceMappingURL=socket-address.js.map