wyrd/tools
esc

    ↑↓ Move ↵ Open t3c results first Search by Pagefind
    Releases

    Peer links API

    Peer links API

    Classes

    PeerLinksApi

    Links from this environment to other T3 Code environments (peers), so that its agents can work there. capabilities.peerLinks advertises them. A refusal rejects with a T3RpcError whose PeerLinkError record has a reason such as disabled, pairing_rejected, self or unreachable. The server setting linkedEnvironmentsEnabled is off by default and is needed on both sides: off here, a new link rejects with disabled; off on the peer, with pairing_rejected.

    PeerLinksApi

    Links from this environment to other T3 Code environments (peers), so that its agents can work there. capabilities.peerLinks advertises them. A refusal rejects with a T3RpcError whose PeerLinkError record has a reason such as disabled, pairing_rejected, self or unreachable. The server setting linkedEnvironmentsEnabled is off by default and is needed on both sides: off here, a new link rejects with disabled; off on the peer, with pairing_rejected.

    Kind: global class

    peerLinksApi.list()

    List the links with their current status. The server checks each peer. Needs access:read.

    async list(signal?: AbortSignal): Promise<readonly PeerLinkSummary[]>;

    Kind: instance method of PeerLinksApi

    Link a peer with a pairing code from that peer. The code must carry the scopes of access. Linking a peer again replaces its link. Needs access:write.

    link(
        input: RpcPayload<RpcMethods, "peerLinks.link">,
        signal?: AbortSignal,
      ): Promise<RpcSuccess<RpcMethods, "peerLinks.link">>;

    Kind: instance method of PeerLinksApi

    Remove a link; return whether one was removed. Needs access:write.

    async unlink(environmentId: EnvironmentId, signal?: AbortSignal): Promise<boolean>;

    Kind: instance method of PeerLinksApi

    peerLinksApi.answerRequest()

    Answer an agent’s link_request turn item: link, use-existing or decline. A link that the peer refuses resolves, and the turn item records it as failed. A request that is gone or already answered rejects with a PeerLinkRequestError record. Its reason record_failed can come after the link was made, so check list after it. A link answer that names an environment, to a request that an older server recorded with both url and environmentId, ends failed: ask for the link again. Needs access:write.

    answerRequest(
        input: RpcPayload<RpcMethods, "peerLinks.answerRequest">,
        signal?: AbortSignal,
      ): Promise<void>;

    Kind: instance method of PeerLinksApi