{
  "components": {
    "schemas": {
      "AccountLabel": {
        "description": "An account label from deck config.",
        "properties": {
          "address": {
            "description": "The mailbox's address (`you@example.com`): the web app's \"View email\" opens a card's thread in Gmail with it.",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label"
        ],
        "type": "object"
      },
      "Action": {
        "description": "One proposed action. The `type` tag is also the name `runner.eligible` uses.",
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "archive",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "mark_read",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "Close a support conversation (Intercom): its \"archive\". `account` is the deck's account for the support inbox\n(`intercom`), `conversation_id` the conversation's ID there.",
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "conversation_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "close_conversation",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "conversation_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "Out of spam and back into the inbox: Gmail's \"Not spam\".",
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "not_spam",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "add": {
                "default": [],
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              "remove": {
                "default": [],
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "label",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "Pass the email on to a session, with the fixed forward header.",
            "properties": {
              "note": {
                "default": null,
                "description": "The user's own comment, set on a sent row. Part of the approved payload, not an adjustment.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/MessageRef"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "text": {
                "maxLength": 100000,
                "minLength": 1,
                "type": "string"
              },
              "to": {
                "$ref": "#/components/schemas/SessionRef"
              },
              "type": {
                "const": "forward",
                "type": "string"
              }
            },
            "required": [
              "type",
              "to",
              "text"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "A Gmail draft in the thread, which the user edits and sends themselves. The normal reply path.",
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "body": {
                "maxLength": 100000,
                "minLength": 1,
                "type": "string"
              },
              "cc": {
                "default": [],
                "items": {
                  "format": "email",
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              "from": {
                "description": "The address it's sent from. Must be one the account can send as (checked when the card is posted, again\nbefore sending, and against the sent message's From header afterwards).",
                "format": "email",
                "type": "string"
              },
              "reply_to_message_id": {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              "requested_by": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionRef"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The session that asked for the draft, which gets what the user really sent (the sent-mail forward)."
              },
              "subject": {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "to": {
                "items": {
                  "format": "email",
                  "type": "string"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              "type": {
                "const": "draft",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id",
              "reply_to_message_id",
              "from",
              "to",
              "subject",
              "body"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "Sends straight away. Never runner-eligible.",
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "body": {
                "maxLength": 100000,
                "minLength": 1,
                "type": "string"
              },
              "cc": {
                "default": [],
                "items": {
                  "format": "email",
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              "from": {
                "description": "The address it's sent from. Must be one the account can send as (checked when the card is posted, again\nbefore sending, and against the sent message's From header afterwards).",
                "format": "email",
                "type": "string"
              },
              "reply_to_message_id": {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              "requested_by": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionRef"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The session that asked for the draft, which gets what the user really sent (the sent-mail forward)."
              },
              "subject": {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "to": {
                "items": {
                  "format": "email",
                  "type": "string"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              "type": {
                "const": "reply",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id",
              "reply_to_message_id",
              "from",
              "to",
              "subject",
              "body"
            ],
            "type": "object"
          },
          {
            "description": "A tracker story: create one, or comment on one. Boards are names from deck config; the runner's and the skill's\nown config map them to the tracker's IDs.",
            "oneOf": [
              {
                "properties": {
                  "board": {
                    "maxLength": 100,
                    "minLength": 1,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 100000,
                    "type": "string"
                  },
                  "labels": {
                    "default": [],
                    "items": {
                      "maxLength": 100,
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 20,
                    "type": "array"
                  },
                  "op": {
                    "const": "create",
                    "type": "string"
                  },
                  "story_type": {
                    "maxLength": 50,
                    "minLength": 1,
                    "type": "string"
                  },
                  "title": {
                    "maxLength": 500,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "op",
                  "board",
                  "story_type",
                  "title",
                  "description"
                ],
                "type": "object"
              },
              {
                "properties": {
                  "op": {
                    "const": "comment",
                    "type": "string"
                  },
                  "story_id": {
                    "maxLength": 100,
                    "minLength": 1,
                    "type": "string"
                  },
                  "text": {
                    "maxLength": 100000,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "op",
                  "story_id",
                  "text"
                ],
                "type": "object"
              }
            ],
            "properties": {
              "type": {
                "const": "story",
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "agent_tab": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "op": {
                "$ref": "#/components/schemas/TaskOp"
              },
              "story_id": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "title": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "const": "task",
                "type": "string"
              }
            },
            "required": [
              "type",
              "op"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "calendar": {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              "description": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "end": {
                "type": "string"
              },
              "location": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "start": {
                "type": "string"
              },
              "time_zone": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "title": {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "calendar",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "calendar",
              "title",
              "start",
              "end",
              "time_zone"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "cwd": {
                "maxLength": 4096,
                "minLength": 1,
                "type": "string"
              },
              "node": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "session_id": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "tab": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "resume",
                "type": "string"
              }
            },
            "required": [
              "type",
              "node",
              "tab",
              "session_id",
              "cwd"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "cwd": {
                "maxLength": 4096,
                "minLength": 1,
                "type": "string"
              },
              "node": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "prompt": {
                "maxLength": 100000,
                "minLength": 1,
                "type": "string"
              },
              "tab": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "new_session",
                "type": "string"
              }
            },
            "required": [
              "type",
              "node",
              "tab",
              "cwd",
              "prompt"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "Retired: leases moved to Fleetlayer (`fleetlayer lease`). Kept so cards stored before still read; the deck\nrefuses a new card or edit that carries one ([`LEASES_RETIRED`]), and the runner never carries one out.",
            "properties": {
              "holder": {
                "$ref": "#/components/schemas/SessionRef"
              },
              "kind": {
                "maxLength": 50,
                "minLength": 1,
                "type": "string"
              },
              "params": {},
              "reason": {
                "maxLength": 2000,
                "minLength": 1,
                "type": "string"
              },
              "resource": {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "lease",
                "type": "string"
              }
            },
            "required": [
              "type",
              "kind",
              "resource",
              "params",
              "holder",
              "reason"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "account": {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              "on": {
                "type": "boolean"
              },
              "thread_id": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              "type": {
                "const": "watch",
                "type": "string"
              }
            },
            "required": [
              "type",
              "account",
              "thread_id",
              "on"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "description": "Message, wrap up or close another session (the Work tab's session actions).",
            "properties": {
              "op": {
                "$ref": "#/components/schemas/SessionOp"
              },
              "text": {
                "default": null,
                "type": [
                  "string",
                  "null"
                ]
              },
              "to": {
                "$ref": "#/components/schemas/SessionRef"
              },
              "type": {
                "const": "session",
                "type": "string"
              }
            },
            "required": [
              "type",
              "op",
              "to"
            ],
            "type": "object"
          }
        ]
      },
      "ActionRecord": {
        "description": "An action as stored on a card version.",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/Action"
          },
          "card_id": {
            "format": "int64",
            "type": "integer"
          },
          "card_version": {
            "format": "int64",
            "type": "integer"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "outcome": {
            "description": "What was sent and what came back."
          },
          "run_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunBy"
              },
              {
                "type": "null"
              }
            ]
          },
          "seq": {
            "format": "int64",
            "type": "integer"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ActionStatus"
          }
        },
        "required": [
          "id",
          "card_id",
          "card_version",
          "seq",
          "action",
          "status"
        ],
        "type": "object"
      },
      "ActionReport": {
        "description": "One action's result, for `quietdeck action done|fail` and `quietdeck actions report`.",
        "oneOf": [
          {
            "properties": {
              "outcome": {
                "default": null,
                "description": "What was sent and what came back."
              },
              "result": {
                "const": "done",
                "type": "string"
              }
            },
            "required": [
              "result"
            ],
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "maxLength": 5000,
                "minLength": 1,
                "type": "string"
              },
              "result": {
                "const": "failed",
                "type": "string"
              }
            },
            "required": [
              "result",
              "error"
            ],
            "type": "object"
          }
        ],
        "properties": {
          "action_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "action_id"
        ],
        "type": "object"
      },
      "ActionStatus": {
        "enum": [
          "pending",
          "released",
          "started",
          "done",
          "failed",
          "stopped"
        ],
        "type": "string"
      },
      "ActionTemplate": {
        "description": "What a rule allows: action types, and for forwards, resumes and new sessions, the target.",
        "properties": {
          "target": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "types": {
            "items": {
              "$ref": "#/components/schemas/ActionType"
            },
            "maxItems": 13,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "types"
        ],
        "type": "object"
      },
      "ActionType": {
        "description": "An action's type alone: the `type` tag, the names `runner.eligible` and project policies use.",
        "oneOf": [
          {
            "enum": [
              "archive",
              "mark_read",
              "not_spam",
              "close_conversation",
              "label",
              "forward",
              "draft",
              "reply",
              "story",
              "task",
              "calendar",
              "resume",
              "new_session",
              "watch",
              "session"
            ],
            "type": "string"
          },
          {
            "const": "lease",
            "description": "Retired: see [`Action::Lease`].",
            "type": "string"
          }
        ]
      },
      "AgentKind": {
        "description": "Which harness runs the session.",
        "enum": [
          "claude",
          "codex"
        ],
        "type": "string"
      },
      "AgentStatus": {
        "description": "herdr's `agent_status`, as each node forwards it.\n\n- `idle`: waiting for input, and the person has seen its last turn.\n- `done`: idle, with a finished turn nobody has looked at yet (herdr's blue dot).\n- `working`: running a turn.\n- `blocked`: waiting on the person: a permission prompt, a question (herdr's red dot).\n- `unknown`: herdr can't tell, or the agent isn't running.",
        "enum": [
          "idle",
          "done",
          "working",
          "blocked",
          "unknown"
        ],
        "type": "string"
      },
      "AnswerKind": {
        "oneOf": [
          {
            "const": "choice",
            "description": "An option of an `<Ask>`, or its Other text.",
            "type": "string"
          },
          {
            "const": "change",
            "description": "What the person says about a `<Default>`: usually an adjustment or an addition, and the start or the next\nmessage of its thread.",
            "type": "string"
          },
          {
            "const": "reply",
            "description": "The agent's reply in a default's thread (`quietdeck report reply`).",
            "type": "string"
          }
        ]
      },
      "ApiError": {
        "description": "Every error the REST API returns, with an HTTP status.",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ApproveAll": {
        "description": "Approve All: every card on screen with its decision (unmentioned means yes, so the app sends approve for each\ncard the person didn't change), and the timeline entries on screen, which move to History.",
        "properties": {
          "cards": {
            "items": {
              "$ref": "#/components/schemas/CardDecision"
            },
            "maxItems": 500,
            "type": "array"
          },
          "single": {
            "default": null,
            "description": "One default's own Approve rather than Approve All: the same undo window, but no Inbox snapshot in History.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "timeline": {
            "default": [],
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 1000,
            "type": "array"
          }
        },
        "required": [
          "cards"
        ],
        "type": "object"
      },
      "ApproveReport": {
        "description": "Approve All for the Inbox report: the deck works out the cards itself, those named by each `<Default>` the person\ndidn't change on this version of the report, so every frontend approves the same way. `report_version` is the\nversion on screen: a newer one is refused, to be read first.",
        "properties": {
          "report_id": {
            "format": "int64",
            "type": "integer"
          },
          "report_version": {
            "format": "int64",
            "type": "integer"
          },
          "timeline": {
            "default": [],
            "description": "The timeline entries on screen, which move to History.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 1000,
            "type": "array"
          }
        },
        "required": [
          "report_id",
          "report_version"
        ],
        "type": "object"
      },
      "Approving": {
        "description": "What Approve All did: nothing is released until `release_at`, and Undo with `batch` cancels it until then.",
        "properties": {
          "batch": {
            "type": "string"
          },
          "cards": {
            "description": "The cards with a decision in this batch.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "release_at": {
            "type": "string"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/Skipped"
            },
            "type": "array"
          }
        },
        "required": [
          "batch",
          "release_at",
          "cards",
          "skipped"
        ],
        "type": "object"
      },
      "AuthState": {
        "description": "`GET /api/auth/state`: what the sign-in screen shows.",
        "properties": {
          "setup_needed": {
            "description": "No passkey is registered yet: the first one needs a setup code from the deck's container.",
            "type": "boolean"
          },
          "signed_in": {
            "type": "boolean"
          },
          "signin": {
            "default": false,
            "description": "The deck signs its owner in through Fleetlayer's sign-in service too: the web app offers it, at\n`/auth/signin?next=<path>`.",
            "type": "boolean"
          }
        },
        "required": [
          "signed_in",
          "setup_needed"
        ],
        "type": "object"
      },
      "BlockedPrompt": {
        "description": "A blocked prompt: one of the harness's own menus (Claude Code's question form, a permission prompt, a plan to\napprove) waiting in a session, as Fleetlayer reads it (`meta.prompt`). The Work tab shows it as a form; the answer\ngoes back through Fleetlayer.",
        "properties": {
          "at": {
            "default": null,
            "description": "When it appeared, as Fleetlayer gives it.",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "description": "Fleetlayer's ID for this prompt: stable while it shows, new for every prompt. An answer names it.",
            "type": "string"
          },
          "kind": {
            "description": "`question`, `permission` or `plan`.",
            "type": "string"
          },
          "options": {
            "default": [],
            "description": "A permission or plan prompt's choices.",
            "items": {
              "$ref": "#/components/schemas/PromptOption"
            },
            "type": "array"
          },
          "plan": {
            "default": null,
            "description": "A plan prompt's plan.",
            "type": [
              "string",
              "null"
            ]
          },
          "questions": {
            "default": [],
            "description": "A question form's questions, in order.",
            "items": {
              "$ref": "#/components/schemas/PromptQuestion"
            },
            "type": "array"
          },
          "tool": {
            "default": null,
            "description": "A permission prompt's tool, by name, and a short form of its input.",
            "type": [
              "string",
              "null"
            ]
          },
          "tool_input": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "kind"
        ],
        "type": "object"
      },
      "Board": {
        "description": "`GET /board`.",
        "properties": {
          "checkins": {
            "description": "Whether the deck checks in with agents (deck.yaml `status.checkins`).",
            "type": "boolean"
          },
          "rows": {
            "description": "Waiting first, then working, then idle; within each, the most recently changed first.",
            "items": {
              "$ref": "#/components/schemas/BoardRow"
            },
            "type": "array"
          }
        },
        "required": [
          "rows",
          "checkins"
        ],
        "type": "object"
      },
      "BoardGroup": {
        "description": "Where a row sits on the board.",
        "oneOf": [
          {
            "enum": [
              "working"
            ],
            "type": "string"
          },
          {
            "const": "waiting",
            "description": "Blocked on a prompt or question only the person can answer.",
            "type": "string"
          },
          {
            "const": "idle",
            "description": "Idle, with real work in the last half hour, or shipped in the last two hours.",
            "type": "string"
          }
        ]
      },
      "BoardRow": {
        "description": "One agent's row.",
        "properties": {
          "checkin_at": {
            "description": "The deck's last check-in.",
            "type": [
              "string",
              "null"
            ]
          },
          "group": {
            "$ref": "#/components/schemas/BoardGroup"
          },
          "last_work_at": {
            "description": "Its last real work (a turn that wasn't just answering a check-in).",
            "type": [
              "string",
              "null"
            ]
          },
          "node": {
            "type": "string"
          },
          "ongoing": {
            "type": "boolean"
          },
          "pr": {
            "type": [
              "string",
              "null"
            ]
          },
          "pr_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "progress": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "session_id": {
            "type": "string"
          },
          "status_since": {
            "description": "Since when it's been in its current status (working, idle, blocked).",
            "type": "string"
          },
          "story": {
            "type": [
              "string",
              "null"
            ]
          },
          "story_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "description": "Fleetlayer's one-line summary of the session, shown while it hasn't reported.",
            "type": [
              "string",
              "null"
            ]
          },
          "tab": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "description": "Its own title, or None before it has reported.",
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "description": "When its row was last set (or confirmed with `--same`).",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "node",
          "session_id",
          "group",
          "ongoing",
          "status_since"
        ],
        "type": "object"
      },
      "BoardSet": {
        "description": "`quietdeck status`: set the caller's row. Fields left out keep their value.",
        "properties": {
          "clear": {
            "default": false,
            "description": "Nothing on now: the row is removed.",
            "type": "boolean"
          },
          "ongoing": {
            "description": "A role that never finishes (triage, the overseer): its line shows without a bar.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "pr": {
            "description": "`owner/repo#12` or a pull request's URL (the CLI turns `12` into `owner/repo#12` from the folder's git remote);\nan empty string removes it.",
            "type": [
              "string",
              "null"
            ]
          },
          "progress": {
            "description": "0–100 by the stages in [`STAGES`].",
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "same": {
            "default": false,
            "description": "Nothing changed: the row is current as it is.",
            "type": "boolean"
          },
          "story": {
            "description": "`sc-1234`, `1234` or a Shortcut story's URL; an empty string removes it.",
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "description": "The main task, as a short title (\"Redesigned search filters for Talira\").",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Caller": {
        "description": "Who the deck thinks is calling.",
        "oneOf": [
          {
            "description": "An agent (or a shell) on a node, with a session token.",
            "properties": {
              "kind": {
                "const": "session",
                "type": "string"
              },
              "session": {
                "$ref": "#/components/schemas/SessionRef"
              }
            },
            "required": [
              "kind",
              "session"
            ],
            "type": "object"
          },
          {
            "description": "A node itself (its runner), with the node token.",
            "properties": {
              "kind": {
                "const": "node",
                "type": "string"
              },
              "node": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "node"
            ],
            "type": "object"
          },
          {
            "description": "The owner in a browser, signed in with a passkey: `device` is that passkey's name.",
            "properties": {
              "device": {
                "type": "string"
              },
              "kind": {
                "const": "owner",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "device"
            ],
            "type": "object"
          }
        ]
      },
      "Card": {
        "description": "A card as the deck serves it.",
        "properties": {
          "account": {
            "description": "An account label from deck config.",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "action_records": {
            "description": "The current version's actions, in order.",
            "items": {
              "$ref": "#/components/schemas/ActionRecord"
            },
            "type": "array"
          },
          "actions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "maxItems": 20,
            "type": "array"
          },
          "auto_grant": {
            "default": null,
            "description": "Ask for an automatic action under this grant: the deck runs `rules match`, and stores the card as automatic\nonly when it allows.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "excerpt": {
            "default": null,
            "description": "The email's own words for the Inbox's details pane, as plain text: the newest message verbatim, or a thread as\none line per message (`Mary: Did we update this for Compass?`). Leave out quoted replies, signatures and\nfooters. The pane shows the first lines. On an account whose rules keep customers' data out of other\nsystems, leave out end users' personal data and document contents, as stories and forwards do.",
            "type": [
              "string",
              "null"
            ]
          },
          "facts": {
            "default": [],
            "description": "Key facts shown under the summary, each `{\"label\": \"Amount\", \"value\": \"$1,200\"}`.",
            "items": {
              "$ref": "#/components/schemas/Fact"
            },
            "maxItems": 30,
            "type": "array"
          },
          "grant_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "keep_in_inbox": {
            "default": false,
            "description": "Nothing touches the thread (a newsletter the person reads themselves).",
            "type": "boolean"
          },
          "last_message_at": {
            "default": null,
            "description": "When that message arrived. A thread left for later takes a new card only for a message newer than that.",
            "type": [
              "string",
              "null"
            ]
          },
          "last_message_ref": {
            "default": null,
            "description": "The newest message the card was prepared on, for freshness checks.",
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "default": null,
            "description": "Open in Gmail (or the draft).",
            "type": [
              "string",
              "null"
            ]
          },
          "list_id": {
            "default": null,
            "description": "The `List-Id` header, for strict rules and the learning loop.",
            "type": [
              "string",
              "null"
            ]
          },
          "needs_agent": {
            "default": false,
            "description": "The agent wants to carry the card out itself, whatever the runner could do.",
            "type": "boolean"
          },
          "pending": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PendingDecision"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The person's decision on this version while it waits out the undo window: the card still reads `open` until\nthe batch is released (or undone, when this goes away)."
          },
          "posted_by": {
            "$ref": "#/components/schemas/SessionRef"
          },
          "prepared_at": {
            "type": "string"
          },
          "reason": {
            "maxLength": 5000,
            "minLength": 1,
            "type": "string"
          },
          "recheck_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "rechecked_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "refs": {
            "default": [],
            "items": {
              "maxLength": 300,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "rule_ref": {
            "default": null,
            "description": "The rules.md row the agent used.",
            "type": [
              "string",
              "null"
            ]
          },
          "section": {
            "$ref": "#/components/schemas/CardSection"
          },
          "sender": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Sender"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "sender_auth": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SenderAuth"
              }
            ],
            "default": {
              "dkim_pass": false,
              "dmarc_pass": false
            }
          },
          "state": {
            "$ref": "#/components/schemas/CardState"
          },
          "subject": {
            "maxLength": 1000,
            "type": "string"
          },
          "summary": {
            "description": "What the email is, in a few words: the Inbox shows it on one line beside the proposed action. Lead with the kind\nof email and leave out who sent it and what their company does unless the person needs that to decide:\n\"Sales pitch: card dunning\", \"Water bill, direct debit\", \"Customer asks how webhook retries work\". Facts and\ndrafts carry the rest.",
            "maxLength": 5000,
            "minLength": 1,
            "type": "string"
          },
          "thread_key": {
            "description": "The thread's ID as the mail service gives it: Gmail's thread ID, exactly (`19a4f0c2b7e1d3a5`), with no account\nor service prefix (the account is its own field). One card per account and thread; a forward without a\n`source` names the thread by it.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "to": {
            "default": null,
            "description": "Which of the person's addresses the newest message went to (an alias such as `hello@example.com` when that's\nwhere it arrived). The Inbox shows it with the sender; without it, the account's address stands in.",
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "posted_by",
          "state",
          "prepared_at",
          "updated_at",
          "account",
          "thread_key",
          "subject",
          "summary",
          "section",
          "reason",
          "action_records"
        ],
        "type": "object"
      },
      "CardAdded": {
        "description": "`quietdeck card add`'s answer.",
        "properties": {
          "auto": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MatchResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "With `auto_grant`: what `rules match` said. A denied card is stored as a normal card."
          },
          "card": {
            "$ref": "#/components/schemas/Card"
          },
          "replaced": {
            "description": "True when it replaced the content of the thread's open card.",
            "type": "boolean"
          }
        },
        "required": [
          "card",
          "replaced"
        ],
        "type": "object"
      },
      "CardDecision": {
        "description": "The person's decision on one card version, as the web app sends it.",
        "properties": {
          "card_id": {
            "format": "int64",
            "type": "integer"
          },
          "fields": {
            "default": null,
            "description": "The actions as the person edited them, replacing the proposed ones. Absent means as proposed.",
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/DecisionKind"
          },
          "text": {
            "default": null,
            "description": "An adjustment or comment: free text makes it the agent's decision.",
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "description": "The version on screen. A card that has a newer version by the time the decision is released is skipped.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "card_id",
          "version",
          "kind"
        ],
        "type": "object"
      },
      "CardInput": {
        "additionalProperties": false,
        "description": "`quietdeck card add`: what an agent posts. The posting session comes from its token.",
        "properties": {
          "account": {
            "description": "An account label from deck config.",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "actions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "maxItems": 20,
            "type": "array"
          },
          "auto_grant": {
            "default": null,
            "description": "Ask for an automatic action under this grant: the deck runs `rules match`, and stores the card as automatic\nonly when it allows.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "excerpt": {
            "default": null,
            "description": "The email's own words for the Inbox's details pane, as plain text: the newest message verbatim, or a thread as\none line per message (`Mary: Did we update this for Compass?`). Leave out quoted replies, signatures and\nfooters. The pane shows the first lines. On an account whose rules keep customers' data out of other\nsystems, leave out end users' personal data and document contents, as stories and forwards do.",
            "type": [
              "string",
              "null"
            ]
          },
          "facts": {
            "default": [],
            "description": "Key facts shown under the summary, each `{\"label\": \"Amount\", \"value\": \"$1,200\"}`.",
            "items": {
              "$ref": "#/components/schemas/Fact"
            },
            "maxItems": 30,
            "type": "array"
          },
          "keep_in_inbox": {
            "default": false,
            "description": "Nothing touches the thread (a newsletter the person reads themselves).",
            "type": "boolean"
          },
          "last_message_at": {
            "default": null,
            "description": "When that message arrived. A thread left for later takes a new card only for a message newer than that.",
            "type": [
              "string",
              "null"
            ]
          },
          "last_message_ref": {
            "default": null,
            "description": "The newest message the card was prepared on, for freshness checks.",
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "default": null,
            "description": "Open in Gmail (or the draft).",
            "type": [
              "string",
              "null"
            ]
          },
          "list_id": {
            "default": null,
            "description": "The `List-Id` header, for strict rules and the learning loop.",
            "type": [
              "string",
              "null"
            ]
          },
          "needs_agent": {
            "default": false,
            "description": "The agent wants to carry the card out itself, whatever the runner could do.",
            "type": "boolean"
          },
          "reason": {
            "maxLength": 5000,
            "minLength": 1,
            "type": "string"
          },
          "refs": {
            "default": [],
            "items": {
              "maxLength": 300,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "rule_ref": {
            "default": null,
            "description": "The rules.md row the agent used.",
            "type": [
              "string",
              "null"
            ]
          },
          "section": {
            "$ref": "#/components/schemas/CardSection"
          },
          "sender": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Sender"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "sender_auth": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SenderAuth"
              }
            ],
            "default": {
              "dkim_pass": false,
              "dmarc_pass": false
            }
          },
          "subject": {
            "maxLength": 1000,
            "type": "string"
          },
          "summary": {
            "description": "What the email is, in a few words: the Inbox shows it on one line beside the proposed action. Lead with the kind\nof email and leave out who sent it and what their company does unless the person needs that to decide:\n\"Sales pitch: card dunning\", \"Water bill, direct debit\", \"Customer asks how webhook retries work\". Facts and\ndrafts carry the rest.",
            "maxLength": 5000,
            "minLength": 1,
            "type": "string"
          },
          "thread_key": {
            "description": "The thread's ID as the mail service gives it: Gmail's thread ID, exactly (`19a4f0c2b7e1d3a5`), with no account\nor service prefix (the account is its own field). One card per account and thread; a forward without a\n`source` names the thread by it.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "to": {
            "default": null,
            "description": "Which of the person's addresses the newest message went to (an alias such as `hello@example.com` when that's\nwhere it arrived). The Inbox shows it with the sender; without it, the account's address stands in.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "account",
          "thread_key",
          "subject",
          "summary",
          "section",
          "reason"
        ],
        "type": "object"
      },
      "CardResolution": {
        "description": "`quietdeck card resolve`: the agent's recheck found the card needs nothing more.",
        "oneOf": [
          {
            "description": "The thread is no longer in the inbox: the card moves to History.",
            "properties": {
              "how": {
                "const": "archived_in_gmail",
                "type": "string"
              }
            },
            "required": [
              "how"
            ],
            "type": "object"
          },
          {
            "description": "Someone handled it (the person replied, a session mentioned it): the card moves to the archive list with\nthe note, which the person reads.",
            "properties": {
              "how": {
                "const": "handled_elsewhere",
                "type": "string"
              },
              "note": {
                "maxLength": 1000,
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "how",
              "note"
            ],
            "type": "object"
          },
          {
            "description": "The agent rechecked it and it still stands.",
            "properties": {
              "how": {
                "const": "rechecked",
                "type": "string"
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "how"
            ],
            "type": "object"
          }
        ]
      },
      "CardSection": {
        "description": "Where a card sits in the Inbox.",
        "oneOf": [
          {
            "enum": [
              "suggestion",
              "later",
              "sent"
            ],
            "type": "string"
          },
          {
            "const": "actions",
            "description": "What the person needs to look at: a reply in their name, money, a decision, something only they can do.",
            "type": "string"
          },
          {
            "const": "archive_list",
            "description": "Routine mail Approve All just handles, one line each: an archive, with at most a label or a one-line\nunsubscribe reply (\"Unsubscribe, thanks.\") before it. Sales pitches and FYI mail go here.",
            "type": "string"
          }
        ]
      },
      "CardState": {
        "enum": [
          "open",
          "revising",
          "approved",
          "executing",
          "handed_off",
          "done",
          "failed",
          "handled_elsewhere",
          "later",
          "automatic"
        ],
        "type": "string"
      },
      "Catchup": {
        "description": "\"Since your last message\": a short account of what happened after the anchor, for the chat view's header.",
        "properties": {
          "anchor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CatchupAnchor"
              },
              {
                "type": "null"
              }
            ],
            "description": "None when the transcript has no real message from the person."
          },
          "generated_at": {
            "type": "string"
          },
          "offset": {
            "description": "The transcript size `text` was written from.",
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          },
          "session_id": {
            "type": "string"
          },
          "stale": {
            "description": "The transcript has grown since `offset`: this text is served now, and a new one is being written.",
            "type": "boolean"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "text",
          "generated_at",
          "offset",
          "stale"
        ],
        "type": "object"
      },
      "CatchupAnchor": {
        "description": "The newest message from the person that the noise filter accepts as real (not a wake-up, tool output, compaction\nor slash command). The chat view opens here.",
        "properties": {
          "at": {
            "type": "string"
          },
          "end": {
            "description": "Byte offset just past the message's line in the transcript.",
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          },
          "uuid": {
            "description": "The transcript record's `uuid`, when it has one.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "at",
          "end"
        ],
        "type": "object"
      },
      "Ceremony": {
        "description": "A WebAuthn ceremony in progress: `options` goes to `navigator.credentials`, and the result comes back with\n`ceremony`.",
        "properties": {
          "ceremony": {
            "type": "string"
          },
          "options": {
            "description": "WebAuthn options as JSON: pass them to `navigator.credentials.create()` (registering) or `.get()` (signing in)."
          }
        },
        "required": [
          "ceremony",
          "options"
        ],
        "type": "object"
      },
      "CeremonyFinish": {
        "description": "The browser's answer to a ceremony.",
        "properties": {
          "ceremony": {
            "type": "string"
          },
          "credential": {
            "description": "The WebAuthn credential as JSON, from `navigator.credentials.create()` or `.get()`."
          }
        },
        "required": [
          "ceremony",
          "credential"
        ],
        "type": "object"
      },
      "Changed": {
        "description": "One message on the event stream (`GET /api/v1/events`): what changed, so it refetches that. Never the data\nitself.",
        "oneOf": [
          {
            "enum": [
              "cards",
              "timeline",
              "sessions",
              "settings",
              "nodes",
              "rules"
            ],
            "type": "string"
          },
          {
            "const": "pings",
            "description": "Pings, their feedback and thread watches.",
            "type": "string"
          },
          {
            "const": "push",
            "description": "Devices that take pushes.",
            "type": "string"
          },
          {
            "const": "mail",
            "description": "The Drafts and Sent tabs.",
            "type": "string"
          },
          {
            "const": "documents",
            "description": "The documents (tabs) and their settings.",
            "type": "string"
          },
          {
            "const": "session_marks",
            "description": "The person's marks on sessions: ignored, parked.",
            "type": "string"
          },
          {
            "const": "all",
            "description": "The stream fell behind: refetch everything.",
            "type": "string"
          }
        ]
      },
      "ChannelMessage": {
        "description": "A message the deck keeps.",
        "properties": {
          "body": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "channel_name": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "node": {
            "description": "The node that read it.",
            "type": "string"
          },
          "received_at": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "sent_at": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "channel",
          "channel_name",
          "external_id",
          "sender",
          "body",
          "sent_at",
          "node",
          "received_at"
        ],
        "type": "object"
      },
      "ChatReply": {
        "description": "`quietdeck chat reply`: the agent's answer to the person's chat in the Inbox, shown as a toast.",
        "properties": {
          "text": {
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "type": "object"
      },
      "Comment": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "on": {
            "description": "What it's on, in a line: the entry's text, or the card's subject.",
            "type": "string"
          },
          "picked_up_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "target": {
            "$ref": "#/components/schemas/CommentTarget"
          },
          "text": {
            "type": "string"
          },
          "to": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "The session it went to."
          }
        },
        "required": [
          "id",
          "target",
          "on",
          "text",
          "created_at"
        ],
        "type": "object"
      },
      "CommentAdd": {
        "description": "The person comments on a timeline entry or a History row. It reaches the agent like an adjustment, and anything\nit proposes comes back as a card.",
        "properties": {
          "target": {
            "$ref": "#/components/schemas/CommentTarget"
          },
          "text": {
            "maxLength": 4000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "target",
          "text"
        ],
        "type": "object"
      },
      "CommentTarget": {
        "description": "What a comment is on: a timeline entry, or a card in History.",
        "oneOf": [
          {
            "properties": {
              "id": {
                "format": "int64",
                "type": "integer"
              },
              "type": {
                "const": "timeline",
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "type": "object"
          },
          {
            "properties": {
              "id": {
                "format": "int64",
                "type": "integer"
              },
              "type": {
                "const": "card",
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "type": "object"
          }
        ]
      },
      "Criteria": {
        "description": "A strict rule's criteria. A sender criterion needs the card to report DMARC or DKIM passing.",
        "properties": {
          "account": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "from_address": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "from_domain": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "list_id": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "subject_contains": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Decide": {
        "description": "One card's own decision outside Approve All, which takes effect at once: `later`, `move_up` or `move_down` only.\nApproving, editing and adjusting a card go through Approve All (`POST /api/v1/decisions/approve-all`, with\n`single: true` for one card), so they get the undo window.",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/DecisionKind"
          },
          "text": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "kind"
        ],
        "type": "object"
      },
      "Decision": {
        "description": "A decision on one card version.",
        "properties": {
          "at": {
            "type": "string"
          },
          "card_id": {
            "format": "int64",
            "type": "integer"
          },
          "card_version": {
            "format": "int64",
            "type": "integer"
          },
          "claimed_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunBy"
              },
              {
                "type": "null"
              }
            ]
          },
          "fields": {
            "description": "The person's edits: the actions as approved, when they changed any.",
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/DecisionKind"
          },
          "picked_up_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "released_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "description": "The person's adjustment or comment. Free text makes the decision the agent's.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "card_id",
          "card_version",
          "kind",
          "at"
        ],
        "type": "object"
      },
      "DecisionKind": {
        "description": "The kinds of decision the person makes on a card.",
        "enum": [
          "approve",
          "edit",
          "adjust",
          "move_down",
          "move_up",
          "later",
          "stop"
        ],
        "type": "string"
      },
      "DeckInfo": {
        "description": "`GET /api/info`: what agents and the web app need to know about this deck.",
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/AccountLabel"
            },
            "type": "array"
          },
          "actions": {
            "description": "Quietdeck solo: the actions its runner carries out once the person approves them. A card proposing another is\nrefused when posted. Absent on other decks.",
            "items": {
              "$ref": "#/components/schemas/ActionType"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "boards": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "built_at": {
            "description": "When that release was built.",
            "type": [
              "string",
              "null"
            ]
          },
          "caller": {
            "$ref": "#/components/schemas/Caller"
          },
          "commit": {
            "description": "The release running: the commit it was built from (scripts/build-images passes it), or None for a local build.",
            "type": [
              "string",
              "null"
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/Settings"
          },
          "solo": {
            "default": false,
            "description": "Quietdeck solo: the deck on the person's own machine. The Inbox then polls `/api/solo/health` and warns when\nthe runner or its agent is failing.",
            "type": "boolean"
          },
          "started_at": {
            "description": "When this deck started: with rolling deploys, when the release went live (or the deck last restarted).",
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "started_at",
          "caller",
          "accounts",
          "boards",
          "settings"
        ],
        "type": "object"
      },
      "Delivered": {
        "description": "Answers for deliveries and searches.",
        "oneOf": [
          {
            "const": "socket",
            "description": "Handed to the session's own messaging socket.",
            "type": "string"
          },
          {
            "const": "orchestrator",
            "description": "Sent through the orchestrator (herdr: `herdr agent prompt`).",
            "type": "string"
          },
          {
            "const": "headless",
            "description": "Handed to the runner's headless agent (Quietdeck solo), which reads it in the turn it starts or its next one.",
            "type": "string"
          }
        ]
      },
      "Document": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/DocumentKind"
          },
          "name": {
            "description": "What the person calls it, shown as its sub-tab: free text.",
            "type": "string"
          },
          "position": {
            "description": "Its order among the documents, lowest first; top-level tabs follow their first document.",
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "description": "Its name in URLs and `?doc=`: `inbox`, `work`, `docspring`.",
            "type": "string"
          },
          "tab": {
            "description": "The top-level tab it sits under: free text (\"Inbox\", \"Work\").",
            "type": "string"
          },
          "writer_node": {
            "description": "The agent that writes it: an agent's report commands go to the document it writes. None: any agent may (the\nInbox, as before documents).",
            "type": [
              "string",
              "null"
            ]
          },
          "writer_tab": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "tab",
          "kind",
          "position"
        ],
        "type": "object"
      },
      "DocumentAdd": {
        "additionalProperties": false,
        "description": "A new document (Settings, or `POST /documents`).",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/DocumentKind"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "position": {
            "default": null,
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "slug": {
            "maxLength": 40,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9-]*$",
            "type": "string"
          },
          "tab": {
            "maxLength": 40,
            "minLength": 1,
            "type": "string"
          },
          "writer_node": {
            "default": null,
            "description": "The agent that writes it (both or neither).",
            "type": [
              "string",
              "null"
            ]
          },
          "writer_tab": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "slug",
          "name",
          "tab",
          "kind"
        ],
        "type": "object"
      },
      "DocumentEdit": {
        "additionalProperties": false,
        "description": "A change to a document: only the fields given change. `clear_writer` makes it writable by any agent.",
        "properties": {
          "clear_writer": {
            "default": null,
            "description": "Any agent may write it from now on.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "default": null,
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "tab": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "writer_node": {
            "default": null,
            "description": "A new writer (both or neither).",
            "type": [
              "string",
              "null"
            ]
          },
          "writer_tab": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "DocumentKind": {
        "oneOf": [
          {
            "const": "inbox",
            "description": "Mail: cards about email threads, an archive part with Archive all, and a new report per round.",
            "type": "string"
          },
          {
            "const": "work",
            "description": "Sessions: entries about the person's agents, an FYI part that Approve All clears, and one report that's never\nreplaced, only kept up to date and pruned.",
            "type": "string"
          }
        ]
      },
      "Enabled": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "EnrolRequest": {
        "description": "`quietdeck node enroll <code>`.",
        "properties": {
          "code": {
            "maxLength": 100,
            "minLength": 8,
            "type": "string"
          },
          "name": {
            "description": "The machine's name on the deck: letters, digits, dots, dashes and underscores.",
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
            "type": "string"
          }
        },
        "required": [
          "code",
          "name"
        ],
        "type": "object"
      },
      "Enrolled": {
        "properties": {
          "node": {
            "type": "string"
          },
          "token": {
            "description": "Shown once. The node keeps it in a file only its user can read.",
            "type": "string"
          }
        },
        "required": [
          "node",
          "token"
        ],
        "type": "object"
      },
      "EnrolmentCode": {
        "properties": {
          "code": {
            "type": "string"
          },
          "expires_at": {
            "description": "Unix seconds.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "code",
          "expires_at"
        ],
        "type": "object"
      },
      "EntrySource": {
        "enum": [
          "runner",
          "agent",
          "deck"
        ],
        "type": "string"
      },
      "Fact": {
        "additionalProperties": false,
        "description": "One fact on a card: an amount, a date, a reference.",
        "properties": {
          "label": {
            "description": "A few words: \"Amount\", \"Due\".",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "value": {
            "description": "\"$1,200\", \"1 December\".",
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "label",
          "value"
        ],
        "type": "object"
      },
      "FleetApproval": {
        "description": "One pending request.",
        "properties": {
          "created_at": {
            "description": "Milliseconds since the epoch.",
            "format": "int64",
            "type": "integer"
          },
          "detail": {
            "description": "What else Fleetlayer says about it (the call's arguments, the reason): the asker's own text, outside data.",
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "description": "When the request lapses, if it does.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "from": {
            "description": "Who asks (`ops@server-admin`).",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "line": {
            "description": "The request in plain words, built by Fleetlayer from access control's own names only (\"The cookies plugin on\nlaptop wants to send its x set to worker\"): shown first. Fleetlayer v0.4.2 and later.",
            "type": [
              "string",
              "null"
            ]
          },
          "once": {
            "description": "Approving allows one use only.",
            "type": "boolean"
          },
          "to": {
            "description": "On what (`node:laptop`, `tool:browser@laptop`, `window:admin`).",
            "type": "string"
          },
          "verb": {
            "description": "What it asks to do (`start`, `use_tool`, `activate`).",
            "type": "string"
          },
          "window": {
            "description": "It asks to open a role's window: approving needs the person's passkey first.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "from",
          "verb",
          "to",
          "created_at",
          "once",
          "window"
        ],
        "type": "object"
      },
      "FleetApprovals": {
        "description": "`GET /fleetlayer/approvals`: the pending requests and the open windows.",
        "properties": {
          "approvals": {
            "items": {
              "$ref": "#/components/schemas/FleetApproval"
            },
            "type": "array"
          },
          "configured": {
            "description": "The deck has an approve token. Without one, there's nothing to show.",
            "type": "boolean"
          },
          "error": {
            "description": "Why Fleetlayer couldn't be read, when it couldn't.",
            "type": [
              "string",
              "null"
            ]
          },
          "windows": {
            "items": {
              "$ref": "#/components/schemas/FleetWindow"
            },
            "type": "array"
          }
        },
        "required": [
          "configured",
          "approvals",
          "windows"
        ],
        "type": "object"
      },
      "FleetDecide": {
        "description": "`POST /fleetlayer/approvals/{id}`: approve or refuse.",
        "properties": {
          "approve": {
            "type": "boolean"
          },
          "for": {
            "description": "How long an approval holds (`10m`, `1h`); the request's own when absent. For a window, how long it's open.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "approve"
        ],
        "type": "object"
      },
      "FleetDecided": {
        "description": "What deciding did. A window that needs the passkey first isn't decided: `stepup_url` is the sign-in service's\npage to confirm it on, which comes back to the deck, and the deck then approves it again.",
        "properties": {
          "decided": {
            "type": "boolean"
          },
          "stepup_url": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "decided"
        ],
        "type": "object"
      },
      "FleetWindow": {
        "description": "An open admin window.",
        "properties": {
          "ends_at": {
            "description": "When it closes by itself, in milliseconds since the epoch.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "opened_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "problem": {
            "description": "What went wrong closing an earlier one, if a node reported a problem.",
            "type": [
              "string",
              "null"
            ]
          },
          "requested_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "role"
        ],
        "type": "object"
      },
      "History": {
        "description": "`quietdeck history --since`: what happened since the calling session last looked.",
        "properties": {
          "cards": {
            "description": "Cards whose state or actions changed in that time.",
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "type": "array"
          },
          "comments": {
            "default": [],
            "description": "The person's comments on this session's timeline entries and History rows, not picked up before. Empty on\nthe History screen.",
            "items": {
              "$ref": "#/components/schemas/Comment"
            },
            "type": "array"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/TimelineEntry"
            },
            "type": "array"
          },
          "since": {
            "type": "string"
          },
          "snapshots": {
            "default": [],
            "description": "The Inbox document as it was at each Approve All in that time. Only on the History screen.",
            "items": {
              "$ref": "#/components/schemas/ReportSnapshotSummary"
            },
            "type": "array"
          },
          "until": {
            "type": "string"
          }
        },
        "required": [
          "since",
          "until",
          "entries",
          "cards"
        ],
        "type": "object"
      },
      "HitSource": {
        "description": "Where a \"who has this ID?\" hit came from.",
        "enum": [
          "summary",
          "transcript"
        ],
        "type": "string"
      },
      "HookCreate": {
        "description": "`quietdeck hooks create`: an agent proposes an endpoint; it receives nothing until the person approves it.",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/HookKind"
          },
          "label": {
            "description": "What it's for, as the person reads it (\"Ops alerts\").",
            "type": "string"
          },
          "to": {
            "description": "The session its events go to, as `<tab>@<node>` (\"alerts@server\").",
            "type": "string"
          }
        },
        "required": [
          "label",
          "kind",
          "to"
        ],
        "type": "object"
      },
      "HookCreated": {
        "description": "What `hooks create` answers: the endpoint and its URL, shown this once.",
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/HookEndpoint"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "url"
        ],
        "type": "object"
      },
      "HookEndpoint": {
        "description": "One endpoint, as Settings and `hooks list` show it. The secret is never shown again after creation.",
        "properties": {
          "approved_at": {
            "description": "None until the person approves it: until then it receives nothing (404).",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "event_count": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/HookKind"
          },
          "label": {
            "type": "string"
          },
          "last_event_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_failure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HookFailure"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The latest time its owner couldn't be reached (the events went to the triage agent instead)."
          },
          "proposed_by": {
            "description": "Who proposed it (`<tab>@<node>`), when an agent did.",
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "description": "`<tab>@<node>`.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "to",
          "created_at",
          "event_count"
        ],
        "type": "object"
      },
      "HookFailure": {
        "properties": {
          "at": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "at",
          "reason"
        ],
        "type": "object"
      },
      "HookKind": {
        "description": "How the deck reads what arrives.",
        "oneOf": [
          {
            "const": "generic",
            "description": "Any JSON (or text): a title is taken from the usual fields. Lenient, for Gatus, which doesn't escape its JSON.",
            "type": "string"
          },
          {
            "const": "alertmanager",
            "description": "Alertmanager's `webhook_configs` format: one event per alert, firing and resolved.",
            "type": "string"
          }
        ]
      },
      "Inbox": {
        "description": "The Inbox, for one account or all of them. Nothing here is a count: `has_later` only says whether to show the\nLater link.",
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "type": "array"
          },
          "approving": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Approving"
              },
              {
                "type": "null"
              }
            ],
            "description": "The batch still in its undo window, if any."
          },
          "archive_list": {
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "type": "array"
          },
          "finished_cards": {
            "default": [],
            "description": "Cards the report names that were carried out after an approval (done, or done by a rule): their defaults keep\nthe green check on every device and after the report changes, without the browser having to remember.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "has_later": {
            "type": "boolean"
          },
          "last_agent_at": {
            "description": "When an agent last posted a card or took decisions. The Inbox shows it only when it's over an hour ago.",
            "type": [
              "string",
              "null"
            ]
          },
          "presence": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Presence"
              }
            ],
            "default": {
              "active": false,
              "active_until": null,
              "held": null,
              "held_count": 0
            },
            "description": "Whether the person is reading the Inbox, and what the runner holds meanwhile."
          },
          "report": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Report"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The triage agent's current report, which the Inbox shows in place of the cards."
          },
          "rule_offers": {
            "default": [],
            "description": "Cards whose target's tab had grants archived when its earlier session closed.",
            "items": {
              "$ref": "#/components/schemas/RuleOffer"
            },
            "type": "array"
          },
          "running": {
            "description": "Whether any approved action is still waiting or running, for Stop.",
            "type": "boolean"
          },
          "sent": {
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "type": "array"
          },
          "suggestions": {
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "type": "array"
          },
          "timeline": {
            "description": "Unread automatic actions.",
            "items": {
              "$ref": "#/components/schemas/TimelineEntry"
            },
            "type": "array"
          }
        },
        "required": [
          "actions",
          "suggestions",
          "archive_list",
          "sent",
          "timeline",
          "has_later",
          "running"
        ],
        "type": "object"
      },
      "LinkKind": {
        "enum": [
          "github_pr",
          "shortcut_story",
          "linear_issue",
          "link"
        ],
        "type": "string"
      },
      "LinkState": {
        "enum": [
          "open",
          "merged",
          "closed",
          "done"
        ],
        "type": "string"
      },
      "MailBadges": {
        "description": "The counts on the Inbox page's tabs.",
        "properties": {
          "drafts": {
            "description": "How many drafts there are now.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "inbox": {
            "description": "Emails waiting for the person's approval: the distinct threads across the open cards.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "sent": {
            "description": "Sent messages new since the person last opened the Sent tab.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "inbox",
          "drafts",
          "sent"
        ],
        "type": "object"
      },
      "MailKind": {
        "enum": [
          "draft",
          "sent"
        ],
        "type": "string"
      },
      "MailRow": {
        "description": "A row on the Drafts or Sent tab.",
        "properties": {
          "account": {
            "type": "string"
          },
          "at": {
            "description": "When it was written or sent (Gmail's internal date).",
            "type": "string"
          },
          "card_id": {
            "description": "The card whose draft or reply this is, when the deck made it.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "draft_id": {
            "default": null,
            "description": "Gmail's draft ID, for a draft (its message ID changes with every save).",
            "type": [
              "string",
              "null"
            ]
          },
          "from": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/MailKind"
          },
          "message_id": {
            "type": "string"
          },
          "new": {
            "description": "New since the person last opened this tab.",
            "type": "boolean"
          },
          "posted_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "The session that posted that card."
          },
          "snippet": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "thread_id": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "account",
          "kind",
          "message_id",
          "at",
          "new"
        ],
        "type": "object"
      },
      "MailSeen": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/MailKind"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "MarkKind": {
        "oneOf": [
          {
            "const": "ignored",
            "description": "The overseer leaves the session out of Work, unless it's blocked on a prompt.",
            "type": "string"
          },
          {
            "const": "parked",
            "description": "The person put the session's work aside: its entries show in the collapsed Parked part, until `until` or until\nunparked.",
            "type": "string"
          }
        ]
      },
      "MatchRequest": {
        "description": "`quietdeck rules match`: may this card be carried out without the person?",
        "properties": {
          "card": {
            "$ref": "#/components/schemas/CardInput"
          },
          "grant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "card",
          "grant_id"
        ],
        "type": "object"
      },
      "MatchResult": {
        "properties": {
          "allow": {
            "type": "boolean"
          },
          "grant_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "allow",
          "grant_id",
          "reason"
        ],
        "type": "object"
      },
      "MessageRef": {
        "additionalProperties": false,
        "description": "A message in a mail thread: what a forward is about.",
        "properties": {
          "account": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "thread_id": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "account",
          "thread_id"
        ],
        "type": "object"
      },
      "MessagesPage": {
        "description": "`quietdeck messages`: messages after the caller's last read (`new`), or after a message ID.",
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ChannelMessage"
            },
            "type": "array"
          },
          "more": {
            "description": "More messages wait after these: ask again.",
            "type": "boolean"
          }
        },
        "required": [
          "messages",
          "more"
        ],
        "type": "object"
      },
      "MoveLink": {
        "description": "One end of a move, as `sessions show` prints it: the session on the other end and the handoff between them.",
        "properties": {
          "at": {
            "type": "string"
          },
          "handoff_id": {
            "format": "int64",
            "type": "integer"
          },
          "session": {
            "$ref": "#/components/schemas/SessionRef"
          }
        },
        "required": [
          "handoff_id",
          "session",
          "at"
        ],
        "type": "object"
      },
      "MsgSend": {
        "description": "`quietdeck msg send --to \"<tab>[@<node>]\" \"<text>\"`.",
        "properties": {
          "text": {
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          },
          "to": {
            "description": "`tab` or `tab@node`. The node is optional when the tab name is unique across nodes.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "to",
          "text"
        ],
        "type": "object"
      },
      "NodeRow": {
        "description": "A node as the deck serves it.",
        "properties": {
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "no_handler": {
            "default": [],
            "description": "The action types the runner handed to its agent for lack of a handler, most often first: candidates for the\nnext handler. Types only, no counts.",
            "items": {
              "$ref": "#/components/schemas/ActionType"
            },
            "type": "array"
          },
          "online": {
            "type": "boolean"
          },
          "runner": {
            "type": "boolean"
          },
          "runner_types": {
            "items": {
              "$ref": "#/components/schemas/ActionType"
            },
            "type": "array"
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "online",
          "runner",
          "runner_types"
        ],
        "type": "object"
      },
      "PartialSearch": {
        "properties": {
          "node": {
            "type": "string"
          },
          "searched_back_to": {
            "type": "string"
          }
        },
        "required": [
          "node",
          "searched_back_to"
        ],
        "type": "object"
      },
      "PasskeyInfo": {
        "description": "A registered passkey, for Settings.",
        "properties": {
          "created_at": {
            "type": "string"
          },
          "device_name": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "this_device": {
            "description": "The passkey this browser signed in with.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "device_name",
          "created_at",
          "this_device"
        ],
        "type": "object"
      },
      "PasskeyRename": {
        "properties": {
          "device_name": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "device_name"
        ],
        "type": "object"
      },
      "PendingDecision": {
        "description": "A decision in its undo window (`Card.pending`).",
        "properties": {
          "batch": {
            "description": "The Approve All batch: `POST /api/v1/decisions/undo` with it cancels the decision.",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/DecisionKind"
          },
          "release_at": {
            "description": "When the batch is released to the runner.",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "batch",
          "release_at"
        ],
        "type": "object"
      },
      "Ping": {
        "properties": {
          "account": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "feedback": {
            "description": "\"Don't ping for this again\", with the person's words (empty when they left no note).",
            "type": [
              "string",
              "null"
            ]
          },
          "feedback_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "feedback_picked_up_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          },
          "result": {
            "description": "How many devices took it.",
            "type": [
              "string",
              "null"
            ]
          },
          "sent_at": {
            "type": "string"
          },
          "sent_by": {
            "$ref": "#/components/schemas/SessionRef"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sent_by",
          "title",
          "body",
          "reason",
          "sent_at"
        ],
        "type": "object"
      },
      "PingFeedback": {
        "description": "\"Don't ping for this again\", with an optional note for the agent that sent it.",
        "properties": {
          "note": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "PingRequest": {
        "description": "`quietdeck ping`.",
        "properties": {
          "account": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          },
          "link": {
            "default": null,
            "description": "A card or a thread.",
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "description": "The agent's one line on why this can't wait a few hours.",
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "thread_key": {
            "default": null,
            "description": "Repeats for the same thread collapse into one notification.",
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "title",
          "body",
          "reason"
        ],
        "type": "object"
      },
      "PingsView": {
        "description": "The Rules screen's pings: the last seven days' against the weekly budget, which suppresses nothing.",
        "properties": {
          "last_week": {
            "description": "Pings sent in the last seven days.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "pings": {
            "description": "The newest first, up to 100.",
            "items": {
              "$ref": "#/components/schemas/Ping"
            },
            "type": "array"
          },
          "weekly_budget": {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "weekly_budget",
          "last_week",
          "pings"
        ],
        "type": "object"
      },
      "Presence": {
        "description": "What the deck knows about the person reading, and what the runner holds meanwhile.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "active_until": {
            "type": [
              "string",
              "null"
            ]
          },
          "held": {
            "description": "New items the runner holds until the person is idle, e.g. \"2 Work, 1 in Ops alerts (Matrix)\".\nNone when nothing waits.",
            "type": [
              "string",
              "null"
            ]
          },
          "held_count": {
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "active",
          "held_count"
        ],
        "type": "object"
      },
      "PresenceBeat": {
        "description": "`POST /api/presence`: the Inbox page's heartbeat. `active: false` when the tab is hidden or closed.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "device": {
            "description": "One ID per browser tab, so one tab going idle doesn't end another's activity.",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "device",
          "active"
        ],
        "type": "object"
      },
      "ProjectPolicy": {
        "description": "A project's autonomy policy, from deck.yaml.",
        "properties": {
          "accounts": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "automatic": {
            "items": {
              "$ref": "#/components/schemas/ActionType"
            },
            "type": "array"
          },
          "dirs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "dirs",
          "accounts",
          "automatic"
        ],
        "type": "object"
      },
      "PromptAnswer": {
        "anyOf": [
          {
            "properties": {
              "pick": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "pick"
            ],
            "type": "object"
          },
          {
            "properties": {
              "picks": {
                "items": {
                  "format": "uint32",
                  "minimum": 0,
                  "type": "integer"
                },
                "type": "array"
              }
            },
            "required": [
              "picks"
            ],
            "type": "object"
          },
          {
            "properties": {
              "text": {
                "type": "string"
              }
            },
            "required": [
              "text"
            ],
            "type": "object"
          }
        ],
        "description": "One question's answer: an option, several (a multiple-choice question), or free text."
      },
      "PromptAnswerSend": {
        "description": "The person's answer to a blocked prompt, from the Work tab.",
        "properties": {
          "answers": {
            "description": "One per question, in order; one for a permission or plan prompt.",
            "items": {
              "$ref": "#/components/schemas/PromptAnswer"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "prompt": {
            "description": "The prompt's ID, so an answer to a prompt that's gone is refused rather than typed into the next one.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "session": {
            "description": "The session: `<session ID>@<node>`, as the deck names it.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "session",
          "prompt",
          "answers"
        ],
        "type": "object"
      },
      "PromptOption": {
        "properties": {
          "description": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "n": {
            "description": "What to answer to pick it.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "n",
          "label"
        ],
        "type": "object"
      },
      "PromptQuestion": {
        "properties": {
          "header": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "multiSelect": {
            "default": false,
            "type": "boolean"
          },
          "options": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/PromptOption"
            },
            "type": "array"
          },
          "other": {
            "default": false,
            "description": "It takes a free-text answer too.",
            "type": "boolean"
          },
          "question": {
            "type": "string"
          }
        },
        "required": [
          "question"
        ],
        "type": "object"
      },
      "PushConfig": {
        "description": "Web push on this deck: the VAPID public key a browser subscribes with, or none when push is off.",
        "properties": {
          "public_key": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "PushDevice": {
        "description": "One device that takes pushes.",
        "properties": {
          "created_at": {
            "type": "string"
          },
          "device": {
            "type": [
              "string",
              "null"
            ]
          },
          "endpoint": {
            "type": "string"
          },
          "last_ok_at": {
            "description": "When a push last reached it.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "endpoint",
          "created_at"
        ],
        "type": "object"
      },
      "PushEndpoint": {
        "properties": {
          "endpoint": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "endpoint"
        ],
        "type": "object"
      },
      "PushSubscribe": {
        "description": "A browser's push subscription (`PushSubscription.toJSON()`, flattened), with a name for the device.",
        "properties": {
          "auth": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "device": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "endpoint": {
            "maxLength": 2000,
            "minLength": 1,
            "pattern": "^https://",
            "type": "string"
          },
          "p256dh": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "p256dh",
          "auth"
        ],
        "type": "object"
      },
      "ReadingRule": {
        "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one.",
        "properties": {
          "account": {
            "default": null,
            "description": "The mail account, or the Matrix room's name.",
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "from": {
            "default": null,
            "description": "The sender contains this (case doesn't matter): `@alertmanager:`, `no-reply@accounts.google.com`.",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "default": null,
            "description": "The item carries this Gmail label.",
            "type": [
              "string",
              "null"
            ]
          },
          "last_matched_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "match_count": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "description": "What it's for, as the Rules screen shows it (\"Critical alerts\").",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "default": null,
            "description": "`gmail` or `matrix`.",
            "type": [
              "string",
              "null"
            ]
          },
          "text_regex": {
            "default": null,
            "description": "An RE2 regular expression the subject and text are matched against: `(?i)\\(critical\\)`.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "enabled",
          "match_count"
        ],
        "type": "object"
      },
      "ReadingRuleInput": {
        "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one.",
        "properties": {
          "account": {
            "default": null,
            "description": "The mail account, or the Matrix room's name.",
            "type": [
              "string",
              "null"
            ]
          },
          "from": {
            "default": null,
            "description": "The sender contains this (case doesn't matter): `@alertmanager:`, `no-reply@accounts.google.com`.",
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "default": null,
            "description": "The item carries this Gmail label.",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "description": "What it's for, as the Rules screen shows it (\"Critical alerts\").",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "default": null,
            "description": "`gmail` or `matrix`.",
            "type": [
              "string",
              "null"
            ]
          },
          "text_regex": {
            "default": null,
            "description": "An RE2 regular expression the subject and text are matched against: `(?i)\\(critical\\)`.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "RecordOrigin": {
        "description": "Who wrote a record.",
        "oneOf": [
          {
            "const": "node",
            "description": "Written by the node's summaries module.",
            "type": "string"
          },
          {
            "const": "claude_summarizer",
            "description": "Imported once from claude-summarizer's index.json and Markdown updates.",
            "type": "string"
          }
        ]
      },
      "RegisterStart": {
        "description": "Start registering a passkey. Signed in, it adds one for this device; with a setup code (from\n`quietdeck-server setup-code`), it registers the first one, or recovers a deck whose passkeys are all lost.",
        "properties": {
          "device_name": {
            "description": "What to call this passkey in Settings (\"MacBook\", \"iPhone\").",
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "setup_code": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "device_name"
        ],
        "type": "object"
      },
      "Released": {
        "description": "A released decision with the card it approves, as the runner and `quietdeck decisions take` get it. `actions` is\nexactly what was approved, with the person's edits applied.",
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/ActionRecord"
            },
            "type": "array"
          },
          "card": {
            "$ref": "#/components/schemas/Card"
          },
          "changes": {
            "default": [],
            "description": "The person's changes to this card's default in the Inbox, oldest first, in his own words: carry them out\nalong with the actions.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "decision": {
            "$ref": "#/components/schemas/Decision"
          },
          "handoff_reason": {
            "description": "Why the runner handed it over, when it did.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "decision",
          "card",
          "actions"
        ],
        "type": "object"
      },
      "Report": {
        "properties": {
          "answers": {
            "description": "The person's answers and changes on this report, oldest first.",
            "items": {
              "$ref": "#/components/schemas/ReportAnswer"
            },
            "type": "array"
          },
          "cards_not_in_report": {
            "description": "Open cards (waiting on the person, handed off or failed) that no `<Default>` names: the Inbox points at the\nCards screen for them, and `report set` lists them for the agent.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "changes": {
            "default": [],
            "description": "The latest changes, newest last (at most 20): the Inbox toasts new ones.",
            "items": {
              "$ref": "#/components/schemas/ReportChange"
            },
            "type": "array"
          },
          "created_at": {
            "type": "string"
          },
          "document_id": {
            "default": 1,
            "description": "The document it's on (`GET /documents`); 1 is the Inbox.",
            "format": "int64",
            "type": "integer"
          },
          "finished": {
            "default": false,
            "description": "The agent said nothing on it waits for the person any more (`quietdeck report done`): the Inbox shows \"All\ndone.\" until the agent edits it or starts the next one.",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "item_times": {
            "description": "When each top-level list item's text last changed, in the order the items are written (`items`): the Work tab\nshows it as \"(1 hour ago)\".",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "markdown": {
            "type": "string"
          },
          "posted_by": {
            "$ref": "#/components/schemas/SessionRef"
          },
          "updated_at": {
            "type": "string"
          },
          "version": {
            "description": "Goes up with every edit; an edit names the version it was made from.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "markdown",
          "posted_by",
          "created_at",
          "updated_at",
          "answers",
          "cards_not_in_report"
        ],
        "type": "object"
      },
      "ReportAnswer": {
        "properties": {
          "about": {
            "description": "The question or the default's text, so the agent reads the answer without the report.",
            "type": "string"
          },
          "answered_at": {
            "type": "string"
          },
          "cards": {
            "description": "For an answer to an `<Ask cards=\"…\">`: the cards it's about. The Inbox shows it in the thread of the default\nthat names them.",
            "type": [
              "string",
              "null"
            ]
          },
          "control": {
            "description": "The `<Ask>`'s id, or for a `<Default>` its id or `cards` value.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/AnswerKind"
          },
          "picked_up": {
            "description": "The agent has it: delivered as a message, or taken with `quietdeck report answers`.",
            "type": "boolean"
          },
          "report_version": {
            "format": "int64",
            "type": "integer"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "report_version",
          "control",
          "kind",
          "about",
          "value",
          "answered_at",
          "picked_up"
        ],
        "type": "object"
      },
      "ReportAnswerAdd": {
        "description": "An answer from the Inbox.",
        "properties": {
          "about": {
            "maxLength": 2000,
            "type": "string"
          },
          "cards": {
            "description": "An `<Ask>`'s `cards`, when it names them.",
            "maxLength": 500,
            "type": [
              "string",
              "null"
            ]
          },
          "control": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/AnswerKind"
          },
          "report_id": {
            "format": "int64",
            "type": "integer"
          },
          "report_version": {
            "format": "int64",
            "type": "integer"
          },
          "value": {
            "maxLength": 4000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "report_id",
          "report_version",
          "control",
          "kind",
          "about",
          "value"
        ],
        "type": "object"
      },
      "ReportChange": {
        "description": "One change to the report, for the Inbox's toast and Approve All's settle window.",
        "properties": {
          "at": {
            "type": "string"
          },
          "cards": {
            "description": "The cards whose defaults this change added or altered.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "reply": {
            "default": false,
            "description": "The agent's answer to the person's chat (`quietdeck chat reply`), not a change: `summary` is its text.",
            "type": "boolean"
          },
          "summary": {
            "description": "What changed, in a line: the agent's `--change`, or what the deck worked out.",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "summary",
          "cards",
          "at"
        ],
        "type": "object"
      },
      "ReportChat": {
        "description": "The chat box under the report: plain words straight to the agent that writes it.",
        "properties": {
          "text": {
            "maxLength": 8000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "type": "object"
      },
      "ReportReceipt": {
        "description": "One action's report from `quietdeck actions report`, as the deck took it.",
        "properties": {
          "action_id": {
            "format": "int64",
            "type": "integer"
          },
          "error": {
            "description": "Why the deck refused this one; absent when it was recorded.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "action_id"
        ],
        "type": "object"
      },
      "ReportReply": {
        "additionalProperties": false,
        "description": "`quietdeck report reply`: the agent's answer in a default's thread, which the Inbox shows under it.",
        "properties": {
          "text": {
            "maxLength": 4000,
            "minLength": 1,
            "type": "string"
          },
          "to": {
            "description": "The default: the `[key]` its messages to you carry (`cards:c_12`, `archive-all`), or a card it names\n(`c_12`).",
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "to",
          "text"
        ],
        "type": "object"
      },
      "ReportRetype": {
        "description": "Type one of his answers into its session again as his own words, after typing it in failed (within a day of it,\nand not again once it's been typed in).",
        "properties": {
          "answer_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "answer_id"
        ],
        "type": "object"
      },
      "ReportRetyped": {
        "description": "Where a retyped answer goes: the deck types it in within a minute, or as soon as the session can take it.",
        "properties": {
          "session": {
            "type": "string"
          }
        },
        "required": [
          "session"
        ],
        "type": "object"
      },
      "ReportSet": {
        "additionalProperties": false,
        "description": "`quietdeck report set`: the whole report, as the agent wants it now.",
        "properties": {
          "base": {
            "default": null,
            "description": "The version this edit starts from (`quietdeck report show` prints it), so an edit never overwrites one it\ndidn't see. Leave it out only for the first report.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "change": {
            "default": null,
            "description": "What this edit changes, in a line, for the toast the person sees (\"New: CI failure on web (c_67)\").\nLeft out, the deck works one out from the defaults that changed.",
            "type": [
              "string",
              "null"
            ]
          },
          "markdown": {
            "maxLength": 200000,
            "minLength": 1,
            "type": "string"
          },
          "new": {
            "default": false,
            "description": "Start a new report: the current one is finished (everything on it approved or handled).",
            "type": "boolean"
          }
        },
        "required": [
          "markdown"
        ],
        "type": "object"
      },
      "ReportSnapshot": {
        "description": "The Inbox document as it was when the person pressed Approve All, for History: the report with every answer on it,\nthe cards it named, and the changes and answers given since the report's previous snapshot.",
        "properties": {
          "approved": {
            "description": "How many cards that Approve All approved.",
            "format": "int64",
            "type": "integer"
          },
          "cards": {
            "description": "The cards the report's defaults named, and the ones Approve All approved, as they were.",
            "items": {
              "$ref": "#/components/schemas/Card"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "report": {
            "$ref": "#/components/schemas/Report"
          },
          "round_answers": {
            "description": "The person's changes and answers since the previous snapshot of this report, oldest first.",
            "items": {
              "$ref": "#/components/schemas/ReportAnswer"
            },
            "type": "array"
          },
          "taken_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "taken_at",
          "report",
          "cards",
          "approved",
          "round_answers"
        ],
        "type": "object"
      },
      "ReportSnapshotSummary": {
        "description": "A snapshot as History lists it.",
        "properties": {
          "answers": {
            "description": "The changes and answers it records.",
            "format": "int64",
            "type": "integer"
          },
          "approved": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "taken_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "taken_at",
          "approved",
          "answers"
        ],
        "type": "object"
      },
      "RoundDone": {
        "description": "`quietdeck round done`'s answer.",
        "properties": {
          "runner_told": {
            "description": "Whether a runner on the caller's machine was told. False when none runs for this session.",
            "type": "boolean"
          }
        },
        "required": [
          "runner_told"
        ],
        "type": "object"
      },
      "RoundStatus": {
        "description": "`quietdeck round status`: where the runner's mail watch is, for the agent it wakes.",
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/WatchedAccount"
            },
            "type": "array"
          },
          "checked_at": {
            "description": "The last time the watch read the mailboxes' history.",
            "type": [
              "string",
              "null"
            ]
          },
          "runner": {
            "description": "No runner on the caller's machine runs for this session, or it isn't connected: nothing else is set.",
            "type": "boolean"
          },
          "waiting": {
            "description": "A wake-up went and `round done` hasn't come yet, so no other goes.",
            "type": "boolean"
          },
          "woke_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "runner",
          "waiting",
          "accounts"
        ],
        "type": "object"
      },
      "Rule": {
        "description": "A grant.",
        "properties": {
          "action_template": {
            "$ref": "#/components/schemas/ActionTemplate"
          },
          "archived_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "builtin": {
            "description": "Shipped with the deck (the sent-mail grant). The person can turn it off but not delete it.",
            "type": "boolean"
          },
          "created_from_card_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "criteria": {
            "$ref": "#/components/schemas/Criteria"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "instruction": {
            "type": [
              "string",
              "null"
            ]
          },
          "known_sender_domains": {
            "description": "A fuzzy match from any other domain is refused.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "last_matched_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "match_count": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "$ref": "#/components/schemas/RuleMode"
          },
          "project": {
            "type": [
              "string",
              "null"
            ]
          },
          "session_ref": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/RuleStatus"
          },
          "topic": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "mode",
          "criteria",
          "action_template",
          "known_sender_domains",
          "status",
          "match_count",
          "builtin"
        ],
        "type": "object"
      },
      "RuleInput": {
        "description": "A grant as the person writes it on the Rules screen or from a card (\"Auto-approve matches in future\").",
        "properties": {
          "action_template": {
            "$ref": "#/components/schemas/ActionTemplate"
          },
          "created_from_card_id": {
            "default": null,
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "criteria": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Criteria"
              }
            ],
            "default": {
              "account": null,
              "from_address": null,
              "from_domain": null,
              "list_id": null,
              "subject_contains": null
            }
          },
          "instruction": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "known_sender_domains": {
            "default": [],
            "items": {
              "maxLength": 253,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "mode": {
            "$ref": "#/components/schemas/RuleMode"
          },
          "project": {
            "default": null,
            "description": "The project whose policy governs every action. Without one, each action's project is found from its target\nsession's directory or its account.",
            "type": [
              "string",
              "null"
            ]
          },
          "session_ref": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The session the grant is tied to: when it closes, the grant is archived. Defaults to the template's target."
          },
          "topic": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "mode",
          "action_template"
        ],
        "type": "object"
      },
      "RuleMode": {
        "oneOf": [
          {
            "const": "fuzzy",
            "description": "The agent judges matches from the instruction; the deck checks the grant, the sender's domain, the template\nand the policy.",
            "type": "string"
          },
          {
            "const": "strict",
            "description": "The deck judges matches from the card's fields.",
            "type": "string"
          }
        ]
      },
      "RuleOffer": {
        "description": "On a card that forwards to, resumes or starts a session in a tab whose earlier session's grants were archived\nwhen it closed: those grants can move to this card's target.",
        "properties": {
          "card_id": {
            "format": "int64",
            "type": "integer"
          },
          "rule_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "to": {
            "$ref": "#/components/schemas/SessionRef"
          }
        },
        "required": [
          "card_id",
          "rule_ids",
          "to"
        ],
        "type": "object"
      },
      "RuleStatus": {
        "oneOf": [
          {
            "enum": [
              "active",
              "disabled"
            ],
            "type": "string"
          },
          {
            "const": "archived",
            "description": "Archived when the session it was tied to closed.",
            "type": "string"
          }
        ]
      },
      "RuleStatusChange": {
        "description": "Archive, restore, or restore tied to another session (\"move\").",
        "properties": {
          "move_to": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "With `active`: tie the grant to this session, and make it the target of its forwards and resumes."
          },
          "status": {
            "$ref": "#/components/schemas/RuleStatus"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "RulesView": {
        "description": "The Rules screen, and `quietdeck rules list`.",
        "properties": {
          "policies": {
            "items": {
              "$ref": "#/components/schemas/ProjectPolicy"
            },
            "type": "array"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "type": "array"
          },
          "session_starts_per_day": {
            "description": "Automatic resumes and new sessions allowed in any 24 hours.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "rules",
          "policies",
          "session_starts_per_day"
        ],
        "type": "object"
      },
      "RunBy": {
        "enum": [
          "runner",
          "agent"
        ],
        "type": "string"
      },
      "Sender": {
        "additionalProperties": false,
        "description": "The sender as the agent read it.",
        "properties": {
          "address": {
            "maxLength": 320,
            "minLength": 3,
            "type": "string"
          },
          "name": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "address"
        ],
        "type": "object"
      },
      "SenderAuth": {
        "additionalProperties": false,
        "description": "What the agent read in the message's authentication results. Strict sender rules need one of them to pass.",
        "properties": {
          "dkim_pass": {
            "default": false,
            "type": "boolean"
          },
          "dmarc_pass": {
            "default": false,
            "type": "boolean"
          },
          "spf_pass": {
            "description": "The sending server is one the domain's SPF record allows. Absent on cards from before 28 Nov 2026, and left\nout of the deck's answers when absent, so a CLI from before then (which refuses unknown fields here) still\nreads them.",
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "SessionDetail": {
        "description": "`quietdeck sessions show <session>`: one session, and with `--timeline` every summary point it has, oldest first.",
        "properties": {
          "continues": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MoveLink"
              },
              {
                "type": "null"
              }
            ],
            "description": "The session this one continues, when it was started from a handoff."
          },
          "moved_to": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MoveLink"
              },
              {
                "type": "null"
              }
            ],
            "description": "The session that continues this one, when it was moved."
          },
          "session": {
            "$ref": "#/components/schemas/SessionRow"
          },
          "timeline": {
            "items": {
              "$ref": "#/components/schemas/SummaryRecord"
            },
            "type": "array"
          }
        },
        "required": [
          "session",
          "timeline"
        ],
        "type": "object"
      },
      "SessionEnd": {
        "description": "How a session ended, from herdr's close events.",
        "oneOf": [
          {
            "description": "Its tab closed: a person closed it, or the last process in it exited.",
            "properties": {
              "how": {
                "const": "tab_closed",
                "type": "string"
              }
            },
            "required": [
              "how"
            ],
            "type": "object"
          },
          {
            "description": "The agent's process exited. `terminal_closed` is false when it went back to its terminal's shell and the tab\nstayed.",
            "properties": {
              "final_status": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/AgentStatus"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "how": {
                "const": "agent_exited",
                "type": "string"
              },
              "terminal_closed": {
                "type": "boolean"
              }
            },
            "required": [
              "how",
              "terminal_closed"
            ],
            "type": "object"
          }
        ]
      },
      "SessionHandoff": {
        "properties": {
          "continued_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "continued_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "The session started from it, once there is one."
          },
          "created_at": {
            "type": "string"
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SessionRef"
              }
            ],
            "description": "The session that wrote it: the one being moved."
          },
          "handoff": {
            "description": "Markdown: what the session is for, where it's up to, open items, decisions and why, conventions and gotchas,\nand pointers.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "manifest": {
            "description": "Markdown: repositories, CLIs, each credential and where it comes from, hosts and networks, MCP servers,\nwatchers and timers.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "from",
          "handoff",
          "manifest",
          "created_at"
        ],
        "type": "object"
      },
      "SessionHandoffAdd": {
        "additionalProperties": false,
        "description": "`quietdeck handoff add`: written by the session being moved, about itself.",
        "properties": {
          "handoff": {
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          },
          "manifest": {
            "maxLength": 50000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "handoff",
          "manifest"
        ],
        "type": "object"
      },
      "SessionLink": {
        "properties": {
          "added_at": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/LinkKind"
          },
          "ref": {
            "description": "`owner/repo#1234`, `sc-6450`, `ENG-12`.",
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "description": "`agent`, or the detector's name.",
            "type": "string"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LinkState"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "kind",
          "source",
          "added_at"
        ],
        "type": "object"
      },
      "SessionMark": {
        "description": "The person's mark on a session.",
        "properties": {
          "at": {
            "type": "string"
          },
          "mark": {
            "$ref": "#/components/schemas/MarkKind"
          },
          "node": {
            "type": "string"
          },
          "note": {
            "description": "What it's about, in the person's words or the entry's headline, for the Parked list.",
            "type": [
              "string",
              "null"
            ]
          },
          "tab": {
            "type": "string"
          },
          "until": {
            "description": "A parked session comes back on its own at this time (snoozed); None: until unparked.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "node",
          "tab",
          "mark",
          "at"
        ],
        "type": "object"
      },
      "SessionMarkRemove": {
        "additionalProperties": false,
        "description": "Take a mark off.",
        "properties": {
          "mark": {
            "$ref": "#/components/schemas/MarkKind"
          },
          "node": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "tab": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "node",
          "tab",
          "mark"
        ],
        "type": "object"
      },
      "SessionMarkSet": {
        "additionalProperties": false,
        "description": "Set a mark (it replaces the same kind of mark on that session).",
        "properties": {
          "mark": {
            "$ref": "#/components/schemas/MarkKind"
          },
          "node": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "note": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "tab": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "until": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "node",
          "tab",
          "mark"
        ],
        "type": "object"
      },
      "SessionOp": {
        "description": "What to do with another session, approved from the Work tab.",
        "oneOf": [
          {
            "const": "message",
            "description": "Pass the person's words on (`text`).",
            "type": "string"
          },
          {
            "const": "wrap_up",
            "description": "Ask it to run its wrap-up: the end-of-session sweep for loose ends. `text` replaces the default request.",
            "type": "string"
          },
          {
            "const": "close",
            "description": "Close it.",
            "type": "string"
          },
          {
            "const": "compact",
            "description": "Compact its context (`/compact`, typed in by Fleetlayer while it's idle): for a long-running session that\nalways has more to do (Nathan, 28 Nov 2026: \"compact, not close\").",
            "type": "string"
          }
        ]
      },
      "SessionRef": {
        "description": "A session by its tab, on a node. `session_id` pins one conversation when the tab has been reused.",
        "properties": {
          "node": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tab": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "node",
          "tab"
        ],
        "type": "object"
      },
      "SessionRow": {
        "description": "A session as the deck serves it.",
        "properties": {
          "address": {
            "description": "Where the orchestrator runs it, in the orchestrator's own terms (herdr: a pane ID). Opaque to the deck.",
            "type": [
              "string",
              "null"
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/AgentKind"
          },
          "closed_at": {
            "description": "When herdr reported it closed. A session that isn't running and has no `closed_at` went away without a close\nevent: herdr stopped, or the machine shut down.",
            "type": [
              "string",
              "null"
            ]
          },
          "cwd": {
            "type": [
              "string",
              "null"
            ]
          },
          "ended": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionEnd"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_activity": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "items": {
              "$ref": "#/components/schemas/SessionLink"
            },
            "type": "array"
          },
          "node": {
            "type": "string"
          },
          "node_online": {
            "description": "The node is connected now. When it isn't, everything above is as last pushed.",
            "type": "boolean"
          },
          "open_url": {
            "default": null,
            "description": "A link that brings the session forward in its orchestrator on the machine it runs on (herdr: `herdr://open`).",
            "type": [
              "string",
              "null"
            ]
          },
          "opens_in": {
            "default": null,
            "description": "The orchestrator's name, for \"Open in …\".",
            "type": [
              "string",
              "null"
            ]
          },
          "page": {
            "type": [
              "string",
              "null"
            ]
          },
          "paragraph": {
            "type": [
              "string",
              "null"
            ]
          },
          "project": {
            "type": [
              "string",
              "null"
            ]
          },
          "prompt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BlockedPrompt"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The harness's own menu it's waiting on (blocked), when its node reads one through Fleetlayer."
          },
          "pushed_at": {
            "type": "string"
          },
          "resume_command": {
            "description": "The command that resumes it, to copy until herdr's create-and-resume is there.",
            "type": [
              "string",
              "null"
            ]
          },
          "running": {
            "description": "Whether the agent is running now.",
            "type": "boolean"
          },
          "sentence": {
            "type": [
              "string",
              "null"
            ]
          },
          "session_id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus"
          },
          "status_changed_at": {
            "type": "string"
          },
          "tab": {
            "type": [
              "string",
              "null"
            ]
          },
          "workspace": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "node",
          "session_id",
          "agent",
          "status",
          "status_changed_at",
          "running",
          "pushed_at",
          "node_online",
          "links"
        ],
        "type": "object"
      },
      "SessionStart": {
        "description": "Start a session on a machine (flow 3.15). The node checks it, then runs `herdr tab create --agent`, with the\nagent's permission flags from its own node.yaml.",
        "properties": {
          "agent": {
            "$ref": "#/components/schemas/AgentKind"
          },
          "cwd": {
            "description": "The working directory on that machine. `~/` is that machine's home.",
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          },
          "effort": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "handoff": {
            "description": "The handoff it starts from (`quietdeck handoff add`): the new session continues the one that wrote it, and\nwithout a `prompt` its first prompt tells it to read the handoff. The deck's alone: never sent to the node.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "model": {
            "default": null,
            "description": "The agent's own default when absent.",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "default": null,
            "description": "The session's name. The tab name when absent.",
            "type": [
              "string",
              "null"
            ]
          },
          "on": {
            "description": "The machine (node) it runs on.",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "prompt": {
            "default": null,
            "description": "Sent with `herdr agent prompt` once the agent is ready.",
            "type": [
              "string",
              "null"
            ]
          },
          "tab": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "on",
          "tab",
          "agent",
          "cwd"
        ],
        "type": "object"
      },
      "SessionStarted": {
        "description": "What the node did for a start or a resume.",
        "properties": {
          "address": {
            "description": "The new session's address in the orchestrator.",
            "type": "string"
          },
          "node": {
            "type": "string"
          },
          "prompt_error": {
            "description": "Set when the session started but its initial prompt couldn't be sent.",
            "type": [
              "string",
              "null"
            ]
          },
          "session_id": {
            "description": "Absent when the agent hadn't reported it yet (Codex before its first turn without `/status`).",
            "type": [
              "string",
              "null"
            ]
          },
          "tab": {
            "type": "string"
          }
        },
        "required": [
          "node",
          "tab",
          "address"
        ],
        "type": "object"
      },
      "SessionTarget": {
        "description": "`quietdeck session resume <session>` and the registry's Resume and Close: a session by address (`tab@machine`,\na tab name, or a session ID).",
        "properties": {
          "session": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "session"
        ],
        "type": "object"
      },
      "Settings": {
        "description": "The deck's settings (the Settings screen).",
        "properties": {
          "chat_shortcuts": {
            "default": [
              "Just archive and nothing else",
              "Set up a rule to do this automatically",
              "Unsubscribe if possible, then archive",
              "Start a new session to investigate and propose what to do. Don't change anything without my OK",
              "Create the story AND start a new agent to fix it",
              "This doesn't belong in my tasks"
            ],
            "description": "Chat shortcuts: replies the Inbox's chat box offers in one tap (\"Just archive and nothing else\"). Each is sent\nas an ordinary message.",
            "items": {
              "maxLength": 500,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 30,
            "type": "array"
          },
          "report": {
            "default": true,
            "description": "The triage report: the default web app's write-up of the Inbox. Off, the deck is cards only: the report's\nroutes answer 404, and the Inbox, History, Approve All and the runner ignore any report kept from before. On\nunless switched off.",
            "type": "boolean"
          },
          "require_filter_proposal": {
            "description": "Retired with the deck's leases (Fleetlayer's leases plugin approves filters now): kept within v1, and has no\neffect.",
            "type": "boolean"
          },
          "show_pending_count": {
            "default": true,
            "description": "\"Show the pending count on the tab icon\": the number of cards in the Inbox on the deck's favicon and in its\ntitle. On unless switched off.",
            "type": "boolean"
          },
          "undo_seconds": {
            "description": "Approve All's undo window in seconds: 0 (off) or 1 to 60.",
            "format": "uint32",
            "maximum": 60,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "undo_seconds",
          "require_filter_proposal"
        ],
        "type": "object"
      },
      "Skipped": {
        "description": "A card Approve All left alone, and why.",
        "properties": {
          "card_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "card_id",
          "reason"
        ],
        "type": "object"
      },
      "StopResult": {
        "description": "What Stop stopped.",
        "properties": {
          "actions": {
            "description": "Actions that hadn't started and now won't.",
            "format": "int64",
            "type": "integer"
          },
          "decisions": {
            "description": "Decisions still in their undo window, cancelled.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "actions",
          "decisions"
        ],
        "type": "object"
      },
      "Subagent": {
        "description": "A subagent the session started.",
        "properties": {
          "agent_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "depth": {
            "description": "1 for one the session started, 2 for one a subagent started, and so on.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "tool_use_id": {
            "description": "The tool call that started it.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "depth"
        ],
        "type": "object"
      },
      "SummaryPeriod": {
        "description": "The stretch of activity a record covers.\n\nLive summaries are one point per local hour of activity: a later update in the same hour replaces the earlier one\n(same `session_id`, same period). Old history (the import, and the daily sweep's catch-up on a long transcript) is\nchunked by local day for the last 30 days and by ISO week before that.",
        "oneOf": [
          {
            "description": "The local hour of the activity's last real moment, floored: `2026-11-23T14`.",
            "properties": {
              "key": {
                "type": "string"
              },
              "kind": {
                "const": "hour",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "key"
            ],
            "type": "object"
          },
          {
            "description": "A local day: `2026-11-23`.",
            "properties": {
              "key": {
                "type": "string"
              },
              "kind": {
                "const": "day",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "key"
            ],
            "type": "object"
          },
          {
            "description": "An ISO week: `2026-W47`.",
            "properties": {
              "key": {
                "type": "string"
              },
              "kind": {
                "const": "week",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "key"
            ],
            "type": "object"
          }
        ]
      },
      "SummaryRecord": {
        "description": "One point on a session's timeline, with the session's three tiers as of that point.\n\nKey: `session_id` + `period`. The deck replaces a stored record with the same key.",
        "properties": {
          "activity_from": {
            "description": "The first and last real activity the record covers.",
            "type": "string"
          },
          "activity_to": {
            "type": "string"
          },
          "agent": {
            "$ref": "#/components/schemas/AgentKind"
          },
          "dir": {
            "description": "The session's working directory.",
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "$ref": "#/components/schemas/RecordOrigin"
          },
          "page": {
            "description": "Up to about a page, Markdown.",
            "type": "string"
          },
          "paragraph": {
            "description": "One or two paragraphs.",
            "type": "string"
          },
          "period": {
            "$ref": "#/components/schemas/SummaryPeriod"
          },
          "sentence": {
            "description": "The one-liner.",
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "tab": {
            "description": "The herdr tab label when the record was written, if the session had one.",
            "type": [
              "string",
              "null"
            ]
          },
          "written_at": {
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "agent",
          "period",
          "activity_from",
          "activity_to",
          "written_at",
          "sentence",
          "paragraph",
          "page",
          "origin"
        ],
        "type": "object"
      },
      "TaskOp": {
        "description": "What to do with a task on the person's own task board.",
        "enum": [
          "create",
          "update",
          "done"
        ],
        "type": "string"
      },
      "ThreadWatch": {
        "properties": {
          "account": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "thread_key": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "account",
          "thread_key",
          "created_at",
          "active"
        ],
        "type": "object"
      },
      "TimelineAdd": {
        "description": "`quietdeck timeline add`: agents post automatic actions they carried out.",
        "properties": {
          "account": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/TimelineKind"
          },
          "refs": {
            "default": [],
            "items": {
              "maxLength": 300,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "text": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "text"
        ],
        "type": "object"
      },
      "TimelineEntry": {
        "properties": {
          "account": {
            "type": [
              "string",
              "null"
            ]
          },
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/TimelineKind"
          },
          "read_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "refs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "source": {
            "$ref": "#/components/schemas/EntrySource"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "source",
          "refs",
          "text",
          "count",
          "created_at"
        ],
        "type": "object"
      },
      "TimelineKind": {
        "oneOf": [
          {
            "enum": [
              "auto_action",
              "sent_forwarded",
              "lease_absorbed",
              "lease_expired",
              "lease_cleanup_overdue",
              "filter_without_proposal",
              "session_started",
              "session_resumed",
              "session_closed",
              "webhook_delivered",
              "grant_archived"
            ],
            "type": "string"
          },
          {
            "const": "lease_started",
            "description": "The four lease kinds are retired with the deck's leases (they're Fleetlayer's now): kept for entries stored\nbefore.",
            "type": "string"
          }
        ]
      },
      "TranscriptItem": {
        "description": "One thing in a transcript.",
        "oneOf": [
          {
            "description": "A message the person typed (or a slash command they ran).",
            "properties": {
              "kind": {
                "const": "person",
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "text"
            ],
            "type": "object"
          },
          {
            "description": "A message from another session.",
            "properties": {
              "from": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "kind": {
                "const": "peer",
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "text"
            ],
            "type": "object"
          },
          {
            "description": "What the agent wrote, Markdown.",
            "properties": {
              "kind": {
                "const": "agent",
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "text"
            ],
            "type": "object"
          },
          {
            "description": "The agent's thinking, when the transcript keeps it.",
            "properties": {
              "kind": {
                "const": "thinking",
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "text"
            ],
            "type": "object"
          },
          {
            "description": "A tool call: one line, with its input and result to expand.",
            "properties": {
              "error": {
                "type": "boolean"
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "input": {
                "type": "string"
              },
              "kind": {
                "const": "tool",
                "type": "string"
              },
              "line": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "result": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "subagent": {
                "description": "The subagent this call started, when it started one.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "kind",
              "name",
              "line",
              "input",
              "error"
            ],
            "type": "object"
          },
          {
            "description": "A tool call's result whose call is in an earlier page: the viewer adds it to that call.",
            "properties": {
              "error": {
                "type": "boolean"
              },
              "id": {
                "type": "string"
              },
              "kind": {
                "const": "tool_result",
                "type": "string"
              },
              "result": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "id",
              "result",
              "error"
            ],
            "type": "object"
          },
          {
            "description": "Something typed into the session that isn't the person: a background task finishing, a watcher waking it,\nthe orchestrator's own auto-continue.",
            "properties": {
              "kind": {
                "const": "wake_up",
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "text"
            ],
            "type": "object"
          },
          {
            "description": "The conversation was compacted here: what came before is summarised in `summary`.",
            "properties": {
              "kind": {
                "const": "compaction",
                "type": "string"
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          {
            "description": "The person interrupted the agent.",
            "properties": {
              "kind": {
                "const": "interrupted",
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          }
        ],
        "properties": {
          "at": {
            "type": [
              "string",
              "null"
            ]
          },
          "offset": {
            "description": "The byte offset of the record it came from, with `part` its place in that record: together, a stable key.",
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          },
          "part": {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "offset",
          "part"
        ],
        "type": "object"
      },
      "TranscriptPage": {
        "description": "A run of a transcript's items, oldest first.",
        "properties": {
          "earlier": {
            "description": "Where these items start: ask with `before` set to this for earlier ones. None at the start of the transcript.",
            "format": "uint64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "end": {
            "description": "Where they end: ask with `after` set to this for what's new.",
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/TranscriptItem"
            },
            "type": "array"
          },
          "session_id": {
            "type": "string"
          },
          "subagent": {
            "type": [
              "string",
              "null"
            ]
          },
          "subagents": {
            "description": "The session's subagents, in the order they started.",
            "items": {
              "$ref": "#/components/schemas/Subagent"
            },
            "type": "array"
          }
        },
        "required": [
          "session_id",
          "items",
          "end",
          "subagents"
        ],
        "type": "object"
      },
      "UndoBatch": {
        "properties": {
          "batch": {
            "type": "string"
          }
        },
        "required": [
          "batch"
        ],
        "type": "object"
      },
      "WatchAdd": {
        "description": "Watch a thread from the card's menu: replies on it may ping.",
        "properties": {
          "account": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "subject": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "thread_key": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "account",
          "thread_key"
        ],
        "type": "object"
      },
      "WatchedAccount": {
        "description": "One mailbox the runner watches.",
        "properties": {
          "history_id": {
            "description": "Gmail's history ID the watch has read up to.",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "new_since_wakeup": {
            "description": "Messages since the last wake-up, waiting for the next one. None: some, but how many isn't known.",
            "format": "uint64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "watching_since": {
            "description": "When the watch started on it. Mail from before then never woke anyone: it's the agent's own to sweep, or\nto leave. None when the watch started before this was recorded.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "label"
        ],
        "type": "object"
      },
      "WhoHas": {
        "properties": {
          "hits": {
            "items": {
              "$ref": "#/components/schemas/WhoHasHit"
            },
            "type": "array"
          },
          "offline_nodes": {
            "description": "Nodes whose transcripts weren't searched (offline, or didn't answer in time): their sessions were searched by\nsummary only.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "partial": {
            "description": "Nodes that ran out of time: they searched their transcripts back to this time, newest first.",
            "items": {
              "$ref": "#/components/schemas/PartialSearch"
            },
            "type": "array"
          },
          "query": {
            "type": "string"
          }
        },
        "required": [
          "query",
          "hits",
          "offline_nodes",
          "partial"
        ],
        "type": "object"
      },
      "WhoHasHit": {
        "properties": {
          "last_mentioned_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "moved_to": {
            "default": null,
            "description": "`tab@machine` of the session that continues this one, when it was moved: ask that one instead.",
            "type": [
              "string",
              "null"
            ]
          },
          "node": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/HitSource"
          },
          "tab": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "node",
          "session_id",
          "source"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "node": {
        "bearerFormat": "qdn_…",
        "description": "A node's own token, from enrolment.",
        "scheme": "bearer",
        "type": "http"
      },
      "owner": {
        "description": "The owner in a browser, signed in with a passkey (`/auth/login/*`). Requests that change something must come from the deck's own origin.",
        "in": "cookie",
        "name": "qd_auth",
        "type": "apiKey"
      },
      "session": {
        "bearerFormat": "qds_…",
        "description": "An agent's session token, from the node it runs on (the `quietdeck` CLI).",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Build your own frontend for a Quietdeck deck. Every route is under `/api/v1`. Within v1, changes are additive only: new routes, new optional fields in requests, new fields in responses (ignore the ones you don't know) and new enum values (handle the ones you don't know). Anything that would break a client goes in `/api/v2`, and v1 keeps working alongside it. Operations tagged `report` or `presence` (with `x-quietdeck-ui`) belong to the default web app's own screens: a frontend of its own can ignore them, and with the `report` setting off the report's routes answer 404 and the rest of the API works on cards alone. Errors answer `ApiError` with a 4xx or 5xx status.",
    "license": {
      "identifier": "Apache-2.0",
      "name": "Apache-2.0"
    },
    "summary": "Quietdeck's core: cards, decisions, actions, rules, sessions and the timeline.",
    "title": "Quietdeck API",
    "version": "1.14.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/actions/report": {
      "post": {
        "operationId": "actions_report",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/ActionReport"
                },
                "type": "array"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReportReceipt"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The runner's results for actions it carried out",
        "tags": [
          "actions"
        ]
      }
    },
    "/api/v1/actions/{id}/start": {
      "post": {
        "operationId": "action_start",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionRecord"
                }
              }
            },
            "description": "An action as stored on a card version."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The runner, just before carrying an action out",
        "tags": [
          "actions"
        ]
      }
    },
    "/api/v1/auth/login/finish": {
      "post": {
        "operationId": "login_finish",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CeremonyFinish"
              }
            }
          },
          "description": "The browser's answer to a ceremony.",
          "required": true
        },
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Finish signing in with a passkey: sets the session cookie",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/login/start": {
      "post": {
        "operationId": "login_start",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ceremony"
                }
              }
            },
            "description": "A WebAuthn ceremony in progress: `options` goes to `navigator.credentials`, and the result comes back with\n`ceremony`."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Start signing in with a passkey",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "logout",
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Sign this browser out",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/register/finish": {
      "post": {
        "operationId": "register_finish",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CeremonyFinish"
              }
            }
          },
          "description": "The browser's answer to a ceremony.",
          "required": true
        },
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Finish registering a passkey, which signs this browser in",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/register/start": {
      "post": {
        "operationId": "register_start",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterStart"
              }
            }
          },
          "description": "Start registering a passkey. Signed in, it adds one for this device; with a setup code (from\n`quietdeck-server setup-code`), it registers the first one, or recovers a deck whose passkeys are all lost.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ceremony"
                }
              }
            },
            "description": "A WebAuthn ceremony in progress: `options` goes to `navigator.credentials`, and the result comes back with\n`ceremony`."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Start registering a passkey",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/state": {
      "get": {
        "operationId": "auth_state",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthState"
                }
              }
            },
            "description": "`GET /api/auth/state`: what the sign-in screen shows."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Whether this browser is signed in, and whether a passkey exists yet",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/board": {
      "get": {
        "operationId": "board_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Board"
                }
              }
            },
            "description": "`GET /board`."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The Status board: each running agent's main task and progress",
        "tags": [
          "board"
        ]
      },
      "post": {
        "operationId": "board_set",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BoardSet"
              }
            }
          },
          "description": "`quietdeck status`: set the caller's row. Fields left out keep their value.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "An agent sets its row on the Status board (quietdeck status)",
        "tags": [
          "board"
        ]
      }
    },
    "/api/v1/cards": {
      "get": {
        "operationId": "list_cards",
        "parameters": [
          {
            "in": "query",
            "name": "account",
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "section",
            "schema": {
              "$ref": "#/components/schemas/CardSection"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "$ref": "#/components/schemas/CardState"
            },
            "style": "form"
          },
          {
            "description": "Only cards still on the Inbox (not finished).",
            "in": "query",
            "name": "open",
            "schema": {
              "default": false,
              "description": "Only cards still on the Inbox (not finished).",
              "type": "boolean"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Card"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Cards, filtered by account, section or state",
        "tags": [
          "cards"
        ]
      },
      "post": {
        "operationId": "add_card",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "account": "work",
                "actions": [
                  {
                    "account": "work",
                    "add": [
                      "Receipts"
                    ],
                    "thread_id": "18c2f0a9d4e7b311",
                    "type": "label"
                  },
                  {
                    "account": "work",
                    "thread_id": "18c2f0a9d4e7b311",
                    "type": "archive"
                  }
                ],
                "reason": "A receipt: nothing to do.",
                "section": "archive_list",
                "sender": {
                  "address": "billing@acme.example",
                  "name": "Acme Billing"
                },
                "subject": "Invoice 2041 from Acme Hosting",
                "summary": "Acme's November invoice, $240, paid by card on file.",
                "thread_key": "18c2f0a9d4e7b311"
              },
              "schema": {
                "$ref": "#/components/schemas/CardInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardAdded"
                }
              }
            },
            "description": "`quietdeck card add`'s answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Post a card, or a new version of the open card for the same thread",
        "tags": [
          "cards"
        ]
      }
    },
    "/api/v1/cards/{id}": {
      "get": {
        "operationId": "get_card",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            },
            "description": "A card as the deck serves it."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "One card",
        "tags": [
          "cards"
        ]
      }
    },
    "/api/v1/cards/{id}/decide": {
      "post": {
        "operationId": "decide",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "kind": "adjust",
                "text": "Forward it to accounts instead",
                "version": 2
              },
              "schema": {
                "$ref": "#/components/schemas/Decide"
              }
            }
          },
          "description": "One card's own decision outside Approve All, which takes effect at once: `later`, `move_up` or `move_down` only.\nApproving, editing and adjusting a card go through Approve All (`POST /api/v1/decisions/approve-all`, with\n`single: true` for one card), so they get the undo window.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            },
            "description": "A card as the deck serves it."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Decide one card: approve, adjust, reject or later",
        "tags": [
          "decisions"
        ]
      }
    },
    "/api/v1/cards/{id}/dismiss": {
      "post": {
        "operationId": "dismiss_card",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            },
            "description": "A card as the deck serves it."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The owner sets a card aside without acting on it",
        "tags": [
          "cards"
        ]
      }
    },
    "/api/v1/cards/{id}/resolve": {
      "post": {
        "operationId": "resolve_card",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardResolution"
              }
            }
          },
          "description": "`quietdeck card resolve`: the agent's recheck found the card needs nothing more.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            },
            "description": "A card as the deck serves it."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The agent's recheck found the card needs nothing more",
        "tags": [
          "cards"
        ]
      }
    },
    "/api/v1/cards/{id}/retry": {
      "post": {
        "operationId": "retry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approving"
                }
              }
            },
            "description": "What Approve All did: nothing is released until `release_at`, and Undo with `batch` cancels it until then."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Retry a card whose actions failed",
        "tags": [
          "decisions"
        ]
      }
    },
    "/api/v1/chat/reply": {
      "post": {
        "operationId": "chat_reply",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatReply"
              }
            }
          },
          "description": "`quietdeck chat reply`: the agent's answer to the person's chat in the Inbox, shown as a toast.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The triage agent replies in the report's chat",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/comments": {
      "post": {
        "operationId": "comment_add",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentAdd"
              }
            }
          },
          "description": "The person comments on a timeline entry or a History row. It reaches the agent like an adjustment, and anything\nit proposes comes back as a card.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Comment on a timeline entry or a History row",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/decisions/approve-all": {
      "post": {
        "operationId": "approve_all",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "cards": [
                  {
                    "card_id": 41,
                    "kind": "approve",
                    "version": 1
                  },
                  {
                    "card_id": 42,
                    "kind": "adjust",
                    "text": "Say we'll pay on Friday",
                    "version": 3
                  }
                ],
                "timeline": [
                  118,
                  119
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ApproveAll"
              }
            }
          },
          "description": "Approve All: every card on screen with its decision (unmentioned means yes, so the app sends approve for each\ncard the person didn't change), and the timeline entries on screen, which move to History.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approving"
                }
              }
            },
            "description": "What Approve All did: nothing is released until `release_at`, and Undo with `batch` cancels it until then."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Approve a list of cards, each at the version on screen",
        "tags": [
          "decisions"
        ]
      }
    },
    "/api/v1/decisions/stop": {
      "post": {
        "operationId": "stop",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopResult"
                }
              }
            },
            "description": "What Stop stopped."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Stop: hold every approved action that hasn't started",
        "tags": [
          "decisions"
        ]
      }
    },
    "/api/v1/decisions/take": {
      "post": {
        "operationId": "take",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Released"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The runner takes the decisions released from the undo window",
        "tags": [
          "decisions"
        ]
      }
    },
    "/api/v1/decisions/undo": {
      "post": {
        "operationId": "undo",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "batch": "b_7f3a"
              },
              "schema": {
                "$ref": "#/components/schemas/UndoBatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "no content"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Undo a batch of decisions while it's in its undo window",
        "tags": [
          "decisions"
        ]
      }
    },
    "/api/v1/documents": {
      "get": {
        "operationId": "documents_list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Document"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The documents, in order, with the tab each sits under",
        "tags": [
          "documents"
        ]
      },
      "post": {
        "operationId": "documents_add",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "kind": "work",
                "name": "Work",
                "slug": "work",
                "tab": "Work",
                "writer_node": "laptop",
                "writer_tab": "overseer"
              },
              "schema": {
                "$ref": "#/components/schemas/DocumentAdd"
              }
            }
          },
          "description": "A new document (Settings, or `POST /documents`).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Add a document",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/documents/{id}": {
      "patch": {
        "operationId": "documents_edit",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentEdit"
              }
            }
          },
          "description": "A change to a document: only the fields given change. `clear_writer` makes it writable by any agent.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Rename a document, move it, or change who writes it",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/documents/{id}/remove": {
      "post": {
        "operationId": "documents_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Remove a document (not the Inbox)",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/events": {
      "get": {
        "description": "Server-sent events. Every event is named `changed` (listen with `addEventListener(\"changed\", …)`: `onmessage` sees only unnamed events), and its `data` is a JSON string naming what changed (`Changed`), never the data itself: refetch that. `all` means the stream fell behind: refetch everything. A comment line every 20 seconds keeps the connection open. The stream ends when the deck restarts: reconnect (EventSource does) and refetch.",
        "operationId": "events",
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "example": "event: changed\ndata: \"cards\"\n\n",
                "schema": {
                  "contentSchema": {
                    "$ref": "#/components/schemas/Changed"
                  },
                  "description": "`event: changed` lines, each with a `data:` line holding a `Changed`.",
                  "type": "string"
                }
              }
            },
            "description": "The event stream."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Server-sent events naming what changed, so a frontend knows what to reload",
        "tags": [
          "deck"
        ],
        "x-quietdeck-events": {
          "changed": {
            "$ref": "#/components/schemas/Changed"
          }
        }
      }
    },
    "/api/v1/fleetlayer/approvals": {
      "get": {
        "operationId": "fleet_approvals",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetApprovals"
                }
              }
            },
            "description": "`GET /fleetlayer/approvals`: the pending requests and the open windows."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Fleetlayer's pending access requests and open admin windows",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/fleetlayer/approvals/{id}": {
      "post": {
        "operationId": "fleet_decide",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FleetDecide"
              }
            }
          },
          "description": "`POST /fleetlayer/approvals/{id}`: approve or refuse.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FleetDecided"
                }
              }
            },
            "description": "What deciding did. A window that needs the passkey first isn't decided: `stepup_url` is the sign-in service's\npage to confirm it on, which comes back to the deck, and the deck then approves it again."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Approve or refuse a Fleetlayer request (a window needs the passkey page first)",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/fleetlayer/windows/{id}/close": {
      "post": {
        "operationId": "fleet_close",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Close a Fleetlayer admin window now (id is its role)",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/handoffs": {
      "post": {
        "operationId": "handoff_add",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionHandoffAdd"
              }
            }
          },
          "description": "`quietdeck handoff add`: written by the session being moved, about itself.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionHandoff"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A session writes a handoff about itself",
        "tags": [
          "messages"
        ]
      }
    },
    "/api/v1/handoffs/{id}": {
      "get": {
        "operationId": "handoff_show",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionHandoff"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "One handoff",
        "tags": [
          "messages"
        ]
      }
    },
    "/api/v1/handoffs/{id}/claim": {
      "post": {
        "operationId": "handoff_claim",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionHandoff"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The new session claims a handoff",
        "tags": [
          "messages"
        ]
      }
    },
    "/api/v1/history": {
      "get": {
        "operationId": "history",
        "parameters": [
          {
            "description": "For an agent: `last` (since this session last asked, the default), or an RFC 3339 time. For the owner: an RFC\n3339 time, a week before `until` by default.",
            "in": "query",
            "name": "since",
            "schema": {
              "description": "For an agent: `last` (since this session last asked, the default), or an RFC 3339 time. For the owner: an RFC\n3339 time, a week before `until` by default.",
              "type": "string"
            },
            "style": "form"
          },
          {
            "description": "The owner's History screen only: the window's end, now by default.",
            "in": "query",
            "name": "until",
            "schema": {
              "description": "The owner's History screen only: the window's end, now by default.",
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "account",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/History"
                }
              }
            },
            "description": "`quietdeck history --since`: what happened since the calling session last looked."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "What happened since the calling session last looked",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/hooks": {
      "get": {
        "operationId": "hooks_list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/HookEndpoint"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Webhook endpoints",
        "tags": [
          "hooks"
        ]
      },
      "post": {
        "operationId": "hooks_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HookCreate"
              }
            }
          },
          "description": "`quietdeck hooks create`: an agent proposes an endpoint; it receives nothing until the person approves it.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HookCreated"
                }
              }
            },
            "description": "What `hooks create` answers: the endpoint and its URL, shown this once."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Propose a webhook endpoint; it receives nothing until approved",
        "tags": [
          "hooks"
        ]
      }
    },
    "/api/v1/hooks/{id}": {
      "delete": {
        "operationId": "hooks_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Delete a webhook endpoint",
        "tags": [
          "hooks"
        ]
      }
    },
    "/api/v1/hooks/{id}/approve": {
      "post": {
        "operationId": "hooks_approve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HookEndpoint"
                }
              }
            },
            "description": "One endpoint, as Settings and `hooks list` show it. The secret is never shown again after creation."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Approve a webhook endpoint",
        "tags": [
          "hooks"
        ]
      }
    },
    "/api/v1/inbox": {
      "get": {
        "operationId": "inbox",
        "parameters": [
          {
            "in": "query",
            "name": "account",
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inbox"
                }
              }
            },
            "description": "The Inbox, for one account or all of them. Nothing here is a count: `has_later` only says whether to show the\nLater link."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The Inbox, for one account or all of them",
        "tags": [
          "inbox"
        ]
      }
    },
    "/api/v1/info": {
      "get": {
        "operationId": "info",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeckInfo"
                }
              }
            },
            "description": "`GET /api/info`: what agents and the web app need to know about this deck."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The deck's version and release, and who the caller is",
        "tags": [
          "deck"
        ]
      }
    },
    "/api/v1/later": {
      "get": {
        "operationId": "later",
        "parameters": [
          {
            "in": "query",
            "name": "account",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Card"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Cards put off with Later",
        "tags": [
          "inbox"
        ]
      }
    },
    "/api/v1/lease-patterns/{id}/revoke": {
      "post": {
        "deprecated": true,
        "operationId": "lease_pattern_revoke",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases": {
      "get": {
        "deprecated": true,
        "operationId": "leases_view",
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases/acquire": {
      "post": {
        "deprecated": true,
        "operationId": "lease_acquire",
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases/propose": {
      "post": {
        "deprecated": true,
        "operationId": "lease_propose",
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases/{id}": {
      "get": {
        "deprecated": true,
        "operationId": "lease_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases/{id}/cleaned": {
      "post": {
        "deprecated": true,
        "operationId": "lease_cleaned",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases/{id}/register": {
      "post": {
        "deprecated": true,
        "operationId": "lease_register",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/leases/{id}/release": {
      "post": {
        "deprecated": true,
        "operationId": "lease_release",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Retired: answers 410 Gone (leases moved to Fleetlayer)",
        "tags": [
          "leases"
        ]
      }
    },
    "/api/v1/mail": {
      "get": {
        "operationId": "mail_list",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailKind"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "account",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MailRow"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "One of the mail tabs' lists",
        "tags": [
          "inbox"
        ]
      }
    },
    "/api/v1/mail/badges": {
      "get": {
        "operationId": "mail_badges",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailBadges"
                }
              }
            },
            "description": "The counts on the Inbox page's tabs."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The counts on the mail tabs",
        "tags": [
          "inbox"
        ]
      }
    },
    "/api/v1/mail/seen": {
      "post": {
        "operationId": "mail_seen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailSeen"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Mark a mail tab seen, which clears its badge",
        "tags": [
          "inbox"
        ]
      }
    },
    "/api/v1/messages": {
      "get": {
        "operationId": "messages_read",
        "parameters": [
          {
            "in": "query",
            "name": "source",
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "description": "A message ID: read after it without moving the session's mark. Left out: after the session's last read.",
            "in": "query",
            "name": "after",
            "schema": {
              "description": "A message ID: read after it without moving the session's mark. Left out: after the session's last read.",
              "format": "int64",
              "type": "integer"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "uint32",
              "minimum": 0,
              "type": "integer"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagesPage"
                }
              }
            },
            "description": "`quietdeck messages`: messages after the caller's last read (`new`), or after a message ID."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Read messages after the caller's last read, or after a message ID",
        "tags": [
          "messages"
        ]
      }
    },
    "/api/v1/msg": {
      "post": {
        "operationId": "msg_send",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MsgSend"
              }
            }
          },
          "description": "`quietdeck msg send --to \"<tab>[@<node>]\" \"<text>\"`.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivered"
                }
              }
            },
            "description": "Answers for deliveries and searches."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Send a message to a session by address",
        "tags": [
          "messages"
        ]
      }
    },
    "/api/v1/nodes": {
      "get": {
        "operationId": "list_nodes",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/NodeRow"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The enrolled nodes",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/v1/nodes/enroll": {
      "post": {
        "operationId": "enroll",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrolRequest"
              }
            }
          },
          "description": "`quietdeck node enroll <code>`.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enrolled"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {}
        ],
        "summary": "Enrol a node with a one-time enrolment code",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/v1/nodes/enrolment-codes": {
      "post": {
        "operationId": "new_code",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrolmentCode"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Make a one-time enrolment code for a new node",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/v1/nodes/ws": {
      "get": {
        "operationId": "node_socket",
        "responses": {
          "101": {
            "description": "websocket upgrade",
            "headers": {
              "connection": {
                "schema": {
                  "const": "upgrade",
                  "enum": [
                    "upgrade"
                  ],
                  "example": "upgrade",
                  "type": "string"
                },
                "style": "simple"
              },
              "sec-websocket-key": {
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "sec-websocket-protocol": {
                "schema": {
                  "type": "string"
                },
                "style": "simple"
              },
              "upgrade": {
                "schema": {
                  "const": "websocket",
                  "enum": [
                    "websocket"
                  ],
                  "example": "websocket",
                  "type": "string"
                },
                "style": "simple"
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "node": []
          }
        ],
        "summary": "A node's WebSocket to the deck (the node protocol, not for frontends)",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/v1/nodes/{name}": {
      "delete": {
        "operationId": "revoke_node",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "description": "no content"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Revoke a node",
        "tags": [
          "nodes"
        ]
      }
    },
    "/api/v1/passkeys": {
      "get": {
        "operationId": "list_passkeys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PasskeyInfo"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The owner's passkeys",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/passkeys/{id}": {
      "delete": {
        "operationId": "remove_passkey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "description": "no content"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Remove a passkey",
        "tags": [
          "auth"
        ]
      },
      "patch": {
        "operationId": "rename_passkey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyRename"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "no content"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Rename a passkey",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/pings": {
      "get": {
        "operationId": "pings_view",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingsView"
                }
              }
            },
            "description": "The Rules screen's pings: the last seven days' against the weekly budget, which suppresses nothing."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The last seven days' pings, against the weekly budget",
        "tags": [
          "timeline"
        ]
      },
      "post": {
        "operationId": "ping_send",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PingRequest"
              }
            }
          },
          "description": "`quietdeck ping`.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ping"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "An agent pings the owner",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/pings/feedback/take": {
      "post": {
        "operationId": "ping_feedback_take",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Ping"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "An agent takes the feedback on its pings",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/pings/{id}/feedback": {
      "post": {
        "operationId": "ping_feedback",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PingFeedback"
              }
            }
          },
          "description": "\"Don't ping for this again\", with an optional note for the agent that sent it.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ping"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The owner's feedback on a ping",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/presence": {
      "post": {
        "operationId": "presence_beat",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PresenceBeat"
              }
            }
          },
          "description": "`POST /api/presence`: the Inbox page's heartbeat. `active: false` when the tab is hidden or closed.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Presence"
                }
              }
            },
            "description": "What the deck knows about the person reading, and what the runner holds meanwhile."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The Inbox page's heartbeat while the owner reads",
        "tags": [
          "presence"
        ],
        "x-quietdeck-ui": "presence"
      }
    },
    "/api/v1/presence/release": {
      "post": {
        "operationId": "presence_release",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The owner stopped reading",
        "tags": [
          "presence"
        ],
        "x-quietdeck-ui": "presence"
      }
    },
    "/api/v1/push": {
      "get": {
        "operationId": "push_config",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PushConfig"
                }
              }
            },
            "description": "Web push on this deck: the VAPID public key a browser subscribes with, or none when push is off."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Web push on this deck: the VAPID public key, or none when push is off",
        "tags": [
          "push"
        ]
      }
    },
    "/api/v1/push/devices": {
      "get": {
        "operationId": "push_devices",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PushDevice"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The devices that get push notifications",
        "tags": [
          "push"
        ]
      },
      "post": {
        "operationId": "push_subscribe",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushSubscribe"
              }
            }
          },
          "description": "A browser's push subscription (`PushSubscription.toJSON()`, flattened), with a name for the device.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PushDevice"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Subscribe this browser to push notifications",
        "tags": [
          "push"
        ]
      }
    },
    "/api/v1/push/devices/remove": {
      "post": {
        "operationId": "push_remove",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushEndpoint"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PushDevice"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Remove a push device",
        "tags": [
          "push"
        ]
      }
    },
    "/api/v1/reading-rules": {
      "get": {
        "operationId": "reading_rules_list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReadingRule"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Reading rules: what may arrive while the owner reads",
        "tags": [
          "rules"
        ]
      },
      "post": {
        "operationId": "reading_rule_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadingRuleInput"
              }
            }
          },
          "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingRule"
                }
              }
            },
            "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Create a reading rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/reading-rules/{id}": {
      "delete": {
        "operationId": "reading_rule_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Delete a reading rule",
        "tags": [
          "rules"
        ]
      },
      "put": {
        "operationId": "reading_rule_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadingRuleInput"
              }
            }
          },
          "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingRule"
                }
              }
            },
            "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Change a reading rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/reading-rules/{id}/enabled": {
      "post": {
        "operationId": "reading_rule_enabled",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Enabled"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingRule"
                }
              }
            },
            "description": "A \"while I'm reading\" rule: an item that matches every condition it sets gets through while the person reads.\nConditions left out match anything; a rule must set at least one."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Turn a reading rule on or off",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/report": {
      "get": {
        "operationId": "report_show",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Report"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The triage agent's current report",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      },
      "post": {
        "operationId": "report_set",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportSet"
              }
            }
          },
          "description": "`quietdeck report set`: the whole report, as the agent wants it now.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The triage agent writes a new version of the report",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/answers": {
      "post": {
        "operationId": "report_answer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportAnswerAdd"
              }
            }
          },
          "description": "An answer from the Inbox.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The owner answers a question in the report",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/answers/retype": {
      "post": {
        "operationId": "report_answer_retype",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportRetype"
              }
            }
          },
          "description": "Type one of his answers into its session again as his own words, after typing it in failed (within a day of it,\nand not again once it's been typed in).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportRetyped"
                }
              }
            },
            "description": "Where a retyped answer goes: the deck types it in within a minute, or as soon as the session can take it."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Type one of the owner's answers into its session again, after typing it in failed",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/answers/take": {
      "post": {
        "operationId": "report_answers_take",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReportAnswer"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The triage agent takes the answers",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/approve": {
      "post": {
        "operationId": "approve_report",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveReport"
              }
            }
          },
          "description": "Approve All for the Inbox report: the deck works out the cards itself, those named by each `<Default>` the person\ndidn't change on this version of the report, so every frontend approves the same way. `report_version` is the\nversion on screen: a newer one is refused, to be read first.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approving"
                }
              }
            },
            "description": "What Approve All did: nothing is released until `release_at`, and Undo with `batch` cancels it until then."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Approve All by the report's Defaults: every default not changed on the version on screen",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/chat": {
      "post": {
        "operationId": "report_chat",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportChat"
              }
            }
          },
          "description": "The chat box under the report: plain words straight to the agent that writes it.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivered"
                }
              }
            },
            "description": "Answers for deliveries and searches."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "The owner writes to the triage agent from the report",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/done": {
      "post": {
        "operationId": "report_done",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The triage agent marks the report done",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/fyi/clear": {
      "post": {
        "operationId": "report_fyi_clear",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Report"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Clear a Work document's FYI list",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/replies": {
      "post": {
        "operationId": "report_reply",
        "parameters": [
          {
            "in": "query",
            "name": "doc",
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportReply"
              }
            }
          },
          "description": "`quietdeck report reply`: the agent's answer in a default's thread, which the Inbox shows under it.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The triage agent replies in the report",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/report/snapshots/{id}": {
      "get": {
        "operationId": "report_snapshot",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSnapshot"
                }
              }
            },
            "description": "The Inbox document as it was when the person pressed Approve All, for History: the report with every answer on it,\nthe cards it named, and the changes and answers given since the report's previous snapshot."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "An earlier version of the report",
        "tags": [
          "report"
        ],
        "x-quietdeck-ui": "report"
      }
    },
    "/api/v1/round": {
      "get": {
        "operationId": "round_status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoundStatus"
                }
              }
            },
            "description": "`quietdeck round status`: where the runner's mail watch is, for the agent it wakes."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Where the runner's mail watch is, for the agent it wakes",
        "tags": [
          "actions"
        ]
      }
    },
    "/api/v1/round/done": {
      "post": {
        "operationId": "round_done",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoundDone"
                }
              }
            },
            "description": "`quietdeck round done`'s answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The woken agent finished its round",
        "tags": [
          "actions"
        ]
      }
    },
    "/api/v1/rules": {
      "get": {
        "operationId": "rules_view",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RulesView"
                }
              }
            },
            "description": "The Rules screen, and `quietdeck rules list`."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The rules",
        "tags": [
          "rules"
        ]
      },
      "post": {
        "operationId": "rule_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleInput"
              }
            }
          },
          "description": "A grant as the person writes it on the Rules screen or from a card (\"Auto-approve matches in future\").",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            },
            "description": "A grant."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Create a rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/rules/match": {
      "post": {
        "operationId": "rules_match",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchRequest"
              }
            }
          },
          "description": "`quietdeck rules match`: may this card be carried out without the person?",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchResult"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "May this card be carried out without the owner?",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/rules/{id}": {
      "put": {
        "operationId": "rule_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleInput"
              }
            }
          },
          "description": "A grant as the person writes it on the Rules screen or from a card (\"Auto-approve matches in future\").",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            },
            "description": "A grant."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Change a rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/rules/{id}/status": {
      "post": {
        "operationId": "rule_status",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleStatusChange"
              }
            }
          },
          "description": "Archive, restore, or restore tied to another session (\"move\").",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            },
            "description": "A grant."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Archive, restore or move a rule",
        "tags": [
          "rules"
        ]
      }
    },
    "/api/v1/session-marks": {
      "get": {
        "operationId": "session_marks_list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionMark"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The owner's marks on sessions: ignored, parked",
        "tags": [
          "documents"
        ]
      },
      "post": {
        "operationId": "session_marks_set",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionMarkSet"
              }
            }
          },
          "description": "Set a mark (it replaces the same kind of mark on that session).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionMark"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Ignore a session, or park it (until a time)",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/session-marks/remove": {
      "post": {
        "operationId": "session_marks_remove",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionMarkRemove"
              }
            }
          },
          "description": "Take a mark off.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionMark"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Take a mark off a session",
        "tags": [
          "documents"
        ]
      }
    },
    "/api/v1/sessions": {
      "get": {
        "operationId": "list_sessions",
        "parameters": [
          {
            "in": "query",
            "name": "node",
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "description": "Include sessions that aren't running (closed or ended), most recent first.",
            "in": "query",
            "name": "all",
            "schema": {
              "default": false,
              "description": "Include sessions that aren't running (closed or ended), most recent first.",
              "type": "boolean"
            },
            "style": "form"
          },
          {
            "description": "Only sessions active since: a date (`2026-05-23`) or a number of days back (`180d`). Implies `all`.",
            "in": "query",
            "name": "since",
            "schema": {
              "description": "Only sessions active since: a date (`2026-05-23`) or a number of days back (`180d`). Implies `all`.",
              "type": "string"
            },
            "style": "form"
          },
          {
            "description": "At most this many (default 200, or 5,000 with `since`).",
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "At most this many (default 200, or 5,000 with `since`).",
              "format": "int64",
              "type": "integer"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionRow"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Sessions on every node",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/answer": {
      "post": {
        "operationId": "answer_prompt",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptAnswerSend"
              }
            }
          },
          "description": "The person's answer to a blocked prompt, from the Work tab.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Answer a session's blocked prompt (its own menu), through Fleetlayer",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/catchup": {
      "get": {
        "operationId": "session_catchup",
        "parameters": [
          {
            "in": "query",
            "name": "session",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catchup"
                }
              }
            },
            "description": "\"Since your last message\": a short account of what happened after the anchor, for the chat view's header."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "What happened in a session since the owner's last message",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/close": {
      "post": {
        "operationId": "close_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionTarget"
              }
            }
          },
          "description": "`quietdeck session resume <session>` and the registry's Resume and Close: a session by address (`tab@machine`,\na tab name, or a session ID).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Close a session",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/interrupt": {
      "post": {
        "operationId": "interrupt_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionTarget"
              }
            }
          },
          "description": "`quietdeck session resume <session>` and the registry's Resume and Close: a session by address (`tab@machine`,\na tab name, or a session ID).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Interrupt a session",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/resume": {
      "post": {
        "operationId": "resume_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionTarget"
              }
            }
          },
          "description": "`quietdeck session resume <session>` and the registry's Resume and Close: a session by address (`tab@machine`,\na tab name, or a session ID).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionStarted"
                }
              }
            },
            "description": "What the node did for a start or a resume."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Resume a session",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/search": {
      "get": {
        "operationId": "search_sessions",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SessionRow"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Search sessions",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/show": {
      "get": {
        "operationId": "show_session",
        "parameters": [
          {
            "in": "query",
            "name": "session",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "timeline",
            "schema": {
              "default": false,
              "type": "boolean"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDetail"
                }
              }
            },
            "description": "`quietdeck sessions show <session>`: one session, and with `--timeline` every summary point it has, oldest first."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "One session, optionally with its timeline",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/start": {
      "post": {
        "operationId": "start_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionStart"
              }
            }
          },
          "description": "Start a session on a machine (flow 3.15). The node checks it, then runs `herdr tab create --agent`, with the\nagent's permission flags from its own node.yaml.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionStarted"
                }
              }
            },
            "description": "What the node did for a start or a resume."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Start a session on a node",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/sessions/transcript": {
      "get": {
        "operationId": "session_transcript",
        "parameters": [
          {
            "in": "query",
            "name": "session",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "subagent",
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "before",
            "schema": {
              "format": "uint64",
              "minimum": 0,
              "type": "integer"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "format": "uint64",
              "minimum": 0,
              "type": "integer"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptPage"
                }
              }
            },
            "description": "A run of a transcript's items, oldest first."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "A page of a session's transcript",
        "tags": [
          "sessions"
        ]
      }
    },
    "/api/v1/settings": {
      "get": {
        "operationId": "get_settings",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            },
            "description": "The deck's settings (the Settings screen)."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "The deck's settings",
        "tags": [
          "deck"
        ]
      },
      "put": {
        "operationId": "put_settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Settings"
              }
            }
          },
          "description": "The deck's settings (the Settings screen).",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            },
            "description": "The deck's settings (the Settings screen)."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Change the deck's settings",
        "tags": [
          "deck"
        ]
      }
    },
    "/api/v1/timeline": {
      "post": {
        "operationId": "timeline_add",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimelineAdd"
              }
            }
          },
          "description": "`quietdeck timeline add`: agents post automatic actions they carried out.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimelineEntry"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "An agent records an automatic action it carried out",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/watches": {
      "get": {
        "operationId": "watches_list",
        "parameters": [
          {
            "in": "query",
            "name": "all",
            "schema": {
              "default": false,
              "type": "boolean"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ThreadWatch"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Thread watches",
        "tags": [
          "timeline"
        ]
      },
      "post": {
        "operationId": "watch_add",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchAdd"
              }
            }
          },
          "description": "Watch a thread from the card's menu: replies on it may ping.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadWatch"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Watch a thread",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/watches/{id}/stop": {
      "post": {
        "operationId": "watch_stop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "null"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          }
        ],
        "summary": "Stop watching a thread",
        "tags": [
          "timeline"
        ]
      }
    },
    "/api/v1/who-has": {
      "get": {
        "operationId": "who_has",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int64",
              "type": "integer"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoHas"
                }
              }
            },
            "description": ""
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "An error, with its message."
          }
        },
        "security": [
          {
            "owner": []
          },
          {
            "session": []
          },
          {
            "node": []
          }
        ],
        "summary": "Which session has a thread, account or topic",
        "tags": [
          "sessions"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Your deck",
      "url": "https://{deck}",
      "variables": {
        "deck": {
          "default": "deck.example.com",
          "description": "The deck's host name"
        }
      }
    }
  ],
  "tags": [
    {
      "description": "The deck itself. `GET /info` says who you are and carries the settings and accounts a frontend needs to start; `GET /events` is a server-sent event stream naming what changed, so a frontend reloads only that.",
      "name": "deck"
    },
    {
      "description": "Passkey sign-in for the owner's browsers. The first passkey takes a one-time setup code from the deck's host; signing in sets an HttpOnly cookie, which the `owner` security scheme names.",
      "name": "auth"
    },
    {
      "description": "Machines enrolled with the deck. A node enrols once with a one-time code, then keeps a WebSocket open (the node protocol, which frontends don't need) and issues session tokens to the agents on it.",
      "name": "nodes"
    },
    {
      "description": "A card is what an agent proposes about one email thread: a summary, why, and the actions it would take (archive, label, reply, forward and more). One card per thread: posting again for the same thread makes a new version. A decision names the version on screen, so the person never approves something they didn't see.",
      "name": "cards"
    },
    {
      "description": "The owner's decisions. Approve All sends every card on screen with its decision; the batch waits out the undo window (Settings), then the runner takes it. `undo` cancels a batch inside its window; `stop` holds everything approved that hasn't started.",
      "name": "decisions"
    },
    {
      "description": "The runner carrying approved actions out: it marks each one started, then reports the results, which finish the card. The round routes tell the woken agent where the mail watch is.",
      "name": "actions"
    },
    {
      "description": "Read views for a frontend: the Inbox (open cards by section, the unread timeline, the batch in its undo window), Later, and the mail tabs' lists and badges.",
      "name": "inbox"
    },
    {
      "description": "What happened without a card: automatic actions the agents carried out, History over a time range, the owner's comments on either, pings (agents asking for attention, against a weekly budget) and thread watches.",
      "name": "timeline"
    },
    {
      "description": "Agent sessions on every node: list and search them, read a transcript or a catch-up, and start, resume, interrupt or close one.",
      "name": "sessions"
    },
    {
      "description": "Messages between sessions by address (`tab@node`), chat messages the deck keeps for agents to read, and handoffs that move a session's work to a new one.",
      "name": "messages"
    },
    {
      "description": "Rules decide what may be carried out without asking: a card that matches an active rule skips the Inbox. Reading rules decide what may still arrive while the owner is reading the Inbox.",
      "name": "rules"
    },
    {
      "description": "Retired: leases moved to Fleetlayer (`fleetlayer lease`, its leases plugin). These routes stay within v1 and answer 410 Gone with an `ApiError` saying so.",
      "name": "leases"
    },
    {
      "description": "Webhook endpoints that wake agents. An agent proposes one; it receives nothing until the owner approves it.",
      "name": "hooks"
    },
    {
      "description": "Web push: the deck's VAPID key, and the browsers subscribed to notifications.",
      "name": "push"
    },
    {
      "description": "The Status board: one row per running agent with its main task, its progress (0-100, where 100 is live and checked), and its Shortcut story and pull request. Agents set their own row; the deck checks in with a session whose row is stale.",
      "name": "board"
    },
    {
      "description": "The default web app's report: the triage agent's write-up of the Inbox, its answers, chat and snapshots. A frontend of its own can ignore these (they carry `x-quietdeck-ui: report`), and with the `report` setting off they answer 404.",
      "name": "report"
    },
    {
      "description": "Documents are the pages agents write and the owner reads, each under a top-level tab: the Inbox (kind `inbox`) on every deck, and others such as a Work page about the owner's agents (kind `work`). An agent's report commands go to the document it writes; `?doc=<slug>` picks one. Session marks are the owner's records about sessions: ignored, or parked until a time.",
      "name": "documents"
    },
    {
      "description": "Whether the owner is reading the Inbox in the default web app, so the runner holds new items meanwhile (`x-quietdeck-ui: presence`).",
      "name": "presence"
    }
  ]
}
