pet.trezy.resolveFeeding

trezy.pet

Documentation

Settle what happened in the terrarium while nobody was watching, and report the state feeding needs. Called on load. HappyView has no scheduler — the only job trigger is job.run:<type>, fired by jobs.create — so an absence is replayed here rather than ticked by a cron. The player cannot tell the difference: they close the tab with four morsels down and come back to find the pets fed and one morsel left. What they gain is that the gap is computed at the moment it can be REPORTED, and that resolution runs while their OAuth session is definitely alive, which a background job could not rely on.

main procedure

Settle what happened in the terrarium while nobody was watching, and report the state feeding needs. Called on load. HappyView has no scheduler — the only job trigger is job.run:<type>, fired by jobs.create — so an absence is replayed here rather than ticked by a cron. The player cannot tell the difference: they close the tab with four morsels down and come back to find the pets fed and one morsel left. What they gain is that the gap is computed at the moment it can be REPORTED, and that resolution runs while their OAuth session is definitely alive, which a background job could not rely on.

Input

Encodingapplication/json

Output

Encodingapplication/json
deadlines array Optional

How long until each staged pet may be fed again. ⚠ EVERY STAGED PET APPEARS HERE, INCLUDING ONES THAT DID NOT EAT. The client reads a pet missing from this list as 'not known yet' and excludes it from claiming food entirely, so an omission is a pet that can never be fed. This is also the only thing that tells a client every pet's cooldown at once: getPets returns at-uris only, and getStats answers for one pet.

drops array Optional

The terrarium as it stands AFTER resolution: the client's opening morsel list, so load is one call rather than two.

eaten array Optional

What was eaten during the absence, oldest first — the homecoming's material. Empty when nothing was.

error string Optional

Present instead of the answer. A stable machine code the client branches on — add codes, never rename them. ⚠ THE CLIENT MUST TREAT A REFUSAL AS 'UNKNOWN', NEVER AS 'NOBODY IS HUNGRY': the first stops pets claiming food, the second would render a world where nothing is ever hungry and quietly disable feeding.

Known values: not-authenticated, unavailable
message string Optional

No description available.

Try It

Requests are sent directly from your browser. Some servers may block requests due to CORS.

Base URL for XRPC calls (e.g., https://bsky.social)
Enter valid JSON for the request body
View raw schema
{
  "type": "procedure",
  "input": {
    "schema": {
      "type": "object",
      "required": [],
      "properties": {}
    },
    "encoding": "application/json"
  },
  "output": {
    "schema": {
      "type": "object",
      "required": [],
      "properties": {
        "drops": {
          "type": "array",
          "items": {
            "ref": "#drop",
            "type": "ref"
          },
          "description": "The terrarium as it stands AFTER resolution: the client's opening morsel list, so load is one call rather than two."
        },
        "eaten": {
          "type": "array",
          "items": {
            "ref": "#eaten",
            "type": "ref"
          },
          "description": "What was eaten during the absence, oldest first — the homecoming's material. Empty when nothing was."
        },
        "error": {
          "type": "string",
          "description": "Present instead of the answer. A stable machine code the client branches on — add codes, never rename them. ⚠ THE CLIENT MUST TREAT A REFUSAL AS 'UNKNOWN', NEVER AS 'NOBODY IS HUNGRY': the first stops pets claiming food, the second would render a world where nothing is ever hungry and quietly disable feeding.",
          "knownValues": [
            "not-authenticated",
            "unavailable"
          ]
        },
        "message": {
          "type": "string"
        },
        "deadlines": {
          "type": "array",
          "items": {
            "ref": "#deadline",
            "type": "ref"
          },
          "description": "How long until each staged pet may be fed again. ⚠ EVERY STAGED PET APPEARS HERE, INCLUDING ONES THAT DID NOT EAT. The client reads a pet missing from this list as 'not known yet' and excludes it from claiming food entirely, so an omission is a pet that can never be fed. This is also the only thing that tells a client every pet's cooldown at once: getPets returns at-uris only, and getStats answers for one pet."
        }
      }
    },
    "encoding": "application/json"
  },
  "description": "Settle what happened in the terrarium while nobody was watching, and report the state feeding needs. Called on load. HappyView has no scheduler — the only job trigger is job.run:<type>, fired by jobs.create — so an absence is replayed here rather than ticked by a cron. The player cannot tell the difference: they close the tab with four morsels down and come back to find the pets fed and one morsel left. What they gain is that the gap is computed at the moment it can be REPORTED, and that resolution runs while their OAuth session is definitely alive, which a background job could not rely on."
}
deadline object

No description available.

Properties

feedCooldownRemaining integer Required

Seconds until this pet may be fed again; 0 means hungry now. Named to match getStats, which reports the same quantity for a single pet.

minimum: 0
pet string at-uri Required

An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).

View raw schema
{
  "type": "object",
  "required": [
    "pet",
    "feedCooldownRemaining"
  ],
  "properties": {
    "pet": {
      "type": "string",
      "format": "at-uri"
    },
    "feedCooldownRemaining": {
      "type": "integer",
      "minimum": 0,
      "description": "Seconds until this pet may be fed again; 0 means hungry now. Named to match getStats, which reports the same quantity for a single pet."
    }
  }
}
drop object

No description available.

Properties

droppedAt string datetime Required

An RFC 3339 formatted timestamp.

food string Required

No description available.

rkey string Required

No description available.

x integer Required

No description available.

View raw schema
{
  "type": "object",
  "required": [
    "rkey",
    "food",
    "x",
    "droppedAt"
  ],
  "properties": {
    "x": {
      "type": "integer"
    },
    "food": {
      "type": "string"
    },
    "rkey": {
      "type": "string"
    },
    "droppedAt": {
      "type": "string",
      "format": "datetime"
    }
  }
}
eaten object

No description available.

Properties

eatenAt string datetime Required

When the pet would have eaten it — in the past, since the whole point is that this already happened. The matching pet.trezy.activity carries the same value as its createdAt.

food string Required

No description available.

pet string at-uri Required

An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).

View raw schema
{
  "type": "object",
  "required": [
    "pet",
    "food",
    "eatenAt"
  ],
  "properties": {
    "pet": {
      "type": "string",
      "format": "at-uri"
    },
    "food": {
      "type": "string"
    },
    "eatenAt": {
      "type": "string",
      "format": "datetime",
      "description": "When the pet would have eaten it — in the past, since the whole point is that this already happened. The matching pet.trezy.activity carries the same value as its createdAt."
    }
  }
}

Lexicon Garden

@