socialweb.computer

Request and provide VMs on an atproto compute market.

lexicons and xrpc

lexicon

com.publicdomainrelay.temp.compute.guest.subscribeEvents

subscription WebSocket /xrpc/com.publicdomainrelay.temp.compute.guest.subscribeEvents

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.

definitions: #event

parameters

parametertypedescription
cursorinteger
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).
minimum 0

message

union #event

errors

errordescription
FutureCursorcursor 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.
InvalidRequest400, as HTTP JSON before the upgrade: cursor is not an integer or is negative; the body is {errors: [message]} and carries no error name.
AuthenticationRequired401, as HTTP JSON before the upgrade: no workload identity token.
UnknownGuest404, as HTTP JSON before the upgrade: the token names no guest of this bidder.
Unavailable503, as HTTP JSON before the upgrade: the GuestControlPlane is not ready.

#event object

fieldtypedescription
seq *integer
The entry's place in the guest's queue.
uri *string at-uri
The compute.events.guest.* payload record.
cid *string cid
The CID of the payload record.
record *unknown
The payload record value; its $type is a compute.events.guest.* NSID.

used in

Compute Contract Flow - Complete Architecture Map, flow: one compute contract, end to end, protocol: the atproto protocol of socialweb-computer, lexicons-market: one row per lexicon

raw schema: lexicons/com/publicdomainrelay/temp/compute/guest/subscribeEvents.json
{
  "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."
        }
      }
    }
  }
}