~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0
39 lines · 2.6 KB Raw History
{
  "lexicon": 1,
  "id": "com.publicdomainrelay.temp.compute.guest.subscribeEvents",
  "defs": {
    "main": {
      "type": "subscription",
      "description": "Served by the bidder's GuestControlPlane to a guest holding a workload identity token (in the Authorization header only): streams the requester-authored compute.events.guest.* payloads for that guest's contract, in order, after cursor. Unlike the XRPC event-stream framing, each message is a JSON text frame, an #event object whose $type is com.publicdomainrelay.temp.compute.guest.subscribeEvents#event, and an empty binary frame every 25 s keeps the socket alive. The stream closes with code 1001 once the ComputeVM is gone.",
      "parameters": {
        "type": "params",
        "properties": {
          "cursor": { "type": "integer", "minimum": 0, "description": "The last seq the guest received; entries after it are replayed, then new ones streamed, and the bidder drops the entries up to it. Absent, the stream starts at the oldest entry kept; the guest agent always sends one (0 when it has none)." }
        }
      },
      "message": {
        "schema": {
          "type": "union",
          "refs": ["#event"]
        }
      },
      "errors": [
        { "name": "FutureCursor", "description": "cursor is past the last seq: sent after the upgrade as a JSON text frame {error: FutureCursor, message}, then a close with code 1008; the guest agent starts again from 0." },
        { "name": "InvalidRequest", "description": "400, as HTTP JSON before the upgrade: cursor is not an integer or is negative; the body is {errors: [message]} and carries no error name." },
        { "name": "AuthenticationRequired", "description": "401, as HTTP JSON before the upgrade: no workload identity token." },
        { "name": "UnknownGuest", "description": "404, as HTTP JSON before the upgrade: the token names no guest of this bidder." },
        { "name": "Unavailable", "description": "503, as HTTP JSON before the upgrade: the GuestControlPlane is not ready." }
      ]
    },
    "event": {
      "type": "object",
      "required": ["seq", "uri", "cid", "record"],
      "properties": {
        "seq": { "type": "integer", "description": "The entry's place in the guest's queue." },
        "uri": { "type": "string", "format": "at-uri", "description": "The compute.events.guest.* payload record." },
        "cid": { "type": "string", "format": "cid", "description": "The CID of the payload record." },
        "record": { "type": "unknown", "description": "The payload record value; its $type is a compute.events.guest.* NSID." }
      }
    }
  }
}