{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pendingyou-com/json-schema/pendingyou-com-snapshot-schema.json",
  "title": "Snapshot",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/pendingyou-com-v1-openapi.json#/components/schemas/Snapshot",
  "type": "object",
  "properties": {
    "stack": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^req_[A-Za-z0-9-]+$"
      }
    },
    "lanes": {
      "type": "object",
      "properties": {
        "new": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^req_[A-Za-z0-9-]+$"
          }
        },
        "yours": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^req_[A-Za-z0-9-]+$"
          }
        },
        "theirs": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^req_[A-Za-z0-9-]+$"
          }
        }
      },
      "required": [
        "new",
        "yours",
        "theirs"
      ]
    },
    "pending": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Card"
      }
    },
    "later": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Card"
      }
    },
    "delegated": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Card"
      }
    },
    "done": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Card"
      }
    },
    "motion": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "$ref": "#/$defs/Card"
      }
    },
    "counts": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "integer",
          "minimum": 0
        },
        "waiting": {
          "type": "integer",
          "minimum": 0
        },
        "later": {
          "type": "integer",
          "minimum": 0
        },
        "delegated": {
          "type": "integer",
          "minimum": 0
        },
        "done": {
          "type": "integer",
          "minimum": 0
        },
        "elsewhere": {
          "type": "integer",
          "minimum": 0
        },
        "new": {
          "type": "integer",
          "minimum": 0
        },
        "yours": {
          "type": "integer",
          "minimum": 0
        },
        "theirs": {
          "type": "integer",
          "minimum": 0
        },
        "newThreads": {
          "type": "integer",
          "minimum": 0
        },
        "yoursThreads": {
          "type": "integer",
          "minimum": 0
        },
        "theirsThreads": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "pending",
        "waiting",
        "later",
        "delegated",
        "done"
      ]
    },
    "areas": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Area"
      }
    },
    "groups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AreaGroup"
      }
    },
    "notify": {
      "$ref": "#/$defs/NotifySettings"
    },
    "newReplies": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "$ref": "#/$defs/NewReplyRow"
      }
    },
    "newRepliesLine": {
      "$ref": "#/$defs/Line"
    },
    "newRepliesLabel": {
      "$ref": "#/$defs/Line"
    },
    "newRepliesRegion": {
      "$ref": "#/$defs/Line"
    },
    "newRepliesUnread": {
      "$ref": "#/$defs/Line"
    }
  },
  "required": [
    "pending",
    "later",
    "delegated",
    "done",
    "counts",
    "areas",
    "groups"
  ],
  "$defs": {
    "Answer": {
      "type": "object",
      "properties": {
        "answers": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "choiceIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "approved": {
                "type": "boolean"
              },
              "text": {
                "type": "string",
                "maxLength": 4000
              },
              "note": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "via": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "voice",
                          "text"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "audioSeconds": {
                    "type": "number"
                  }
                },
                "required": [
                  "text",
                  "via"
                ]
              },
              "theyDecide": {
                "type": "boolean"
              }
            }
          }
        },
        "choiceIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approved": {
          "type": "boolean"
        },
        "text": {
          "type": "string"
        },
        "note": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string",
              "maxLength": 4000
            },
            "via": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "voice",
                    "text"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "audioSeconds": {
              "type": "number"
            }
          },
          "required": [
            "text",
            "via"
          ]
        },
        "theyDecide": {
          "type": "boolean"
        },
        "failed": {
          "type": "boolean",
          "const": true
        },
        "failedStep": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "handled": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "self",
                "leave"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "notSent": {
          "type": "boolean",
          "const": true
        },
        "notNeeded": {
          "type": "boolean",
          "const": true
        },
        "by": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "you",
                "go-between",
                "helper",
                "teammate"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "helper": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "why": {
              "type": "string"
            },
            "note": {
              "type": "string",
              "maxLength": 1000
            }
          },
          "required": [
            "name",
            "why"
          ]
        },
        "where": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "app",
                "conversation"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "app": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^app_[A-Za-z0-9-]+$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "machine": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          "required": [
            "id",
            "name"
          ]
        },
        "answeredAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "answeredAt"
      ]
    },
    "Area": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^prj_[A-Za-z0-9-]+$"
        },
        "name": {
          "type": "string"
        },
        "tint": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "peri",
                "sage",
                "peach",
                "sun",
                "lilac",
                "sky",
                "mint",
                "rose"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "icon": {
          "type": "string"
        },
        "groupId": {
          "type": "string",
          "pattern": "^agr_[A-Za-z0-9-]+$"
        },
        "position": {
          "type": "integer",
          "minimum": 0
        },
        "pinnedAt": {
          "type": "string",
          "format": "date-time"
        },
        "hiddenAt": {
          "type": "string",
          "format": "date-time"
        },
        "notify": {
          "type": "object",
          "properties": {
            "mode": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "waiting",
                    "muted"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "until": {
              "type": "string",
              "format": "date-time"
            },
            "stillWhenStuck": {
              "type": "boolean"
            }
          },
          "required": [
            "mode",
            "stillWhenStuck"
          ]
        },
        "lastActivityAt": {
          "type": "string",
          "format": "date-time"
        },
        "systemKind": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "getting_started"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "archived": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "tint",
        "archived"
      ]
    },
    "AreaGroup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^agr_[A-Za-z0-9-]+$"
        },
        "name": {
          "type": "string"
        },
        "position": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "id",
        "name",
        "position"
      ]
    },
    "AskFace": {
      "type": "object",
      "properties": {
        "tag": {
          "$ref": "#/$defs/Line"
        },
        "changed": {
          "$ref": "#/$defs/Line"
        },
        "context": {
          "type": "object",
          "properties": {
            "label": {
              "$ref": "#/$defs/Line"
            },
            "title": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "label",
            "title"
          ]
        },
        "title": {
          "$ref": "#/$defs/Line"
        },
        "summary": {
          "type": "object",
          "properties": {
            "line": {
              "$ref": "#/$defs/Line"
            },
            "runs": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Run"
              }
            }
          },
          "required": [
            "line"
          ]
        },
        "why": {
          "type": "object",
          "properties": {
            "line": {
              "$ref": "#/$defs/Line"
            },
            "runs": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Run"
              }
            }
          },
          "required": [
            "line"
          ]
        },
        "goesTo": {
          "$ref": "#/$defs/Line"
        }
      },
      "required": [
        "tag",
        "title",
        "summary"
      ]
    },
    "Attachment": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^att_[A-Za-z0-9-]+$"
        },
        "place": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "card",
                "message",
                "answer"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "waiting",
                "ready",
                "failed",
                "removed"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "title": {
          "type": "string"
        },
        "contentType": {
          "type": "string"
        },
        "bytes": {
          "type": "integer"
        },
        "width": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "height": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "downloadUrl": {
          "type": "string",
          "format": "uri"
        },
        "thumbUrl": {
          "type": "string",
          "format": "uri"
        },
        "previewUrl": {
          "type": "string",
          "format": "uri"
        },
        "downloadExpiresAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "place",
        "status",
        "title"
      ]
    },
    "Block": {
      "anyOf": [
        {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "p"
                },
                "runs": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Run"
                  }
                }
              },
              "required": [
                "t",
                "runs"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "heading"
                },
                "runs": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Run"
                  }
                }
              },
              "required": [
                "t",
                "runs"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "list"
                },
                "ordered": {
                  "type": "boolean"
                },
                "start": {
                  "type": "integer"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "blocks": {
                        "type": "array",
                        "items": {
                          "$ref": "#/$defs/Block"
                        }
                      },
                      "done": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "blocks"
                    ]
                  }
                }
              },
              "required": [
                "t",
                "ordered",
                "items"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "quote"
                },
                "blocks": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Block"
                  }
                }
              },
              "required": [
                "t",
                "blocks"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "code"
                },
                "lang": {
                  "type": "string"
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "t",
                "lines"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "table"
                },
                "head": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/Run"
                    }
                  }
                },
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/Run"
                      }
                    }
                  }
                },
                "align": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "left",
                          "right",
                          "center"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  }
                },
                "compact": {
                  "type": "boolean"
                },
                "caption": {
                  "type": "string"
                },
                "more": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "integer"
                    },
                    "columns": {
                      "type": "integer"
                    }
                  }
                }
              },
              "required": [
                "t",
                "head",
                "rows",
                "align",
                "compact"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "rule"
                }
              },
              "required": [
                "t"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "cut"
                }
              },
              "required": [
                "t"
              ]
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "t": {
              "type": "string",
              "description": "A kind this version doesn’t know: /v1 adds kinds, so read past it (a doc has its `plain`)."
            }
          },
          "required": [
            "t"
          ]
        }
      ]
    },
    "Card": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9-]+$"
        },
        "version": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "pending",
                "delegated",
                "answered",
                "resolved",
                "snoozed",
                "expired",
                "cancelled"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "turn": {
          "type": "string",
          "enum": [
            "you",
            "agent"
          ]
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "choice",
                "multi",
                "approve",
                "text",
                "review",
                "action",
                "fyi",
                "group",
                "answer"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "intent": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "decide",
                "approve",
                "do",
                "tell",
                "heads_up"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "title": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "summaryRuns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Run"
          }
        },
        "textRuns": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/Run"
            }
          }
        },
        "urgency": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "now",
                "today",
                "whenever"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "blocking": {
          "type": "boolean"
        },
        "fallback": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "text",
            "at"
          ]
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string",
                "maxLength": 80
              },
              "detail": {
                "type": "string",
                "maxLength": 200
              },
              "consequence": {
                "type": "string",
                "maxLength": 200
              },
              "sends": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "required": [
                  "to"
                ]
              }
            },
            "required": [
              "id",
              "label"
            ]
          }
        },
        "recommendedIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rationale": {
          "type": "string"
        },
        "multi": {
          "type": "object",
          "properties": {
            "min": {
              "type": "integer"
            },
            "max": {
              "type": "integer"
            }
          },
          "required": [
            "min",
            "max"
          ]
        },
        "approve": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "risk": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "reversible": {
              "type": "boolean"
            },
            "because": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "spends",
                    "irreversible",
                    "public"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "required": [
            "action",
            "risk",
            "reversible"
          ]
        },
        "text": {
          "type": "object",
          "properties": {
            "placeholder": {
              "type": "string"
            },
            "suggestions": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "long": {
              "type": "boolean"
            }
          },
          "required": [
            "placeholder"
          ]
        },
        "action": {
          "type": "object",
          "properties": {
            "where": {
              "type": "string"
            },
            "steps": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^s[1-9][0-9]{0,4}$"
                      },
                      "text": {
                        "type": "string"
                      },
                      "command": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "text"
                    ]
                  }
                ]
              }
            },
            "done": {
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "verify": {
              "type": "string"
            }
          },
          "required": [
            "steps"
          ]
        },
        "progress": {
          "$ref": "#/$defs/StepProgress"
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,40}$"
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "choice",
                      "multi",
                      "approve",
                      "text"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "title": {
                "type": "string",
                "maxLength": 140
              },
              "detail": {
                "type": "string",
                "maxLength": 200
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "detail": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "consequence": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "sends": {
                      "type": "object",
                      "properties": {
                        "to": {
                          "type": "string",
                          "maxLength": 120
                        }
                      },
                      "required": [
                        "to"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "label"
                  ]
                }
              },
              "recommendedIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rationale": {
                "type": "string",
                "maxLength": 200
              },
              "multi": {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  }
                },
                "required": [
                  "min",
                  "max"
                ]
              },
              "approve": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string"
                  },
                  "command": {
                    "type": "string"
                  },
                  "risk": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "low",
                          "medium",
                          "high"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "reversible": {
                    "type": "boolean"
                  },
                  "because": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "spends",
                          "irreversible",
                          "public"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  }
                },
                "required": [
                  "action",
                  "risk",
                  "reversible"
                ]
              },
              "highStakes": {
                "type": "boolean"
              },
              "text": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "suggestions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "long": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "placeholder"
                ]
              }
            },
            "required": [
              "id",
              "kind",
              "title"
            ]
          }
        },
        "about": {
          "type": "object",
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "email",
                    "pr",
                    "booking",
                    "document",
                    "other"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "required": [
            "kind",
            "title"
          ]
        },
        "threadId": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9-]+$"
        },
        "follows": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9-]+$"
        },
        "highStakes": {
          "type": "boolean"
        },
        "actions": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "answer",
                  "undo",
                  "reply",
                  "later",
                  "back",
                  "delegate",
                  "take_back",
                  "tick"
                ]
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "area": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^prj_[A-Za-z0-9-]+$"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "name"
          ]
        },
        "asker": {
          "type": "object",
          "properties": {
            "assistant": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^con_[A-Za-z0-9-]+$"
                },
                "name": {
                  "type": "string"
                },
                "app": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "claude-code",
                        "codex",
                        "cursor",
                        "gemini-cli",
                        "opencode",
                        "pi",
                        "antigravity",
                        "grok",
                        "muse",
                        "chatgpt",
                        "claude",
                        "dots",
                        "other",
                        "webhook"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "appName": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "app",
                "appName"
              ]
            },
            "agent": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^agt_[A-Za-z0-9-]+$"
                },
                "name": {
                  "type": "string"
                },
                "shownName": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "task": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "cwd": {
                  "type": "string"
                },
                "branch": {
                  "type": "string"
                }
              },
              "required": [
                "label"
              ]
            },
            "machine": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^mch_[A-Za-z0-9-]+$"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "required": [
            "assistant",
            "task"
          ]
        },
        "askedFirst": {
          "type": "object",
          "properties": {
            "where": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "terminal",
                    "chat"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "why": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "quiet",
                    "away"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "required": [
            "where",
            "at"
          ]
        },
        "answer": {
          "$ref": "#/$defs/Answer"
        },
        "undoUntil": {
          "type": "string",
          "format": "date-time"
        },
        "snoozedUntil": {
          "type": "string",
          "format": "date-time"
        },
        "sendTo": {
          "$ref": "#/$defs/SendTo"
        },
        "drafted": {
          "type": "object",
          "properties": {
            "by": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "claude-code",
                    "codex",
                    "opencode",
                    "pi"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "model": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9.:_-]{0,39}$"
            },
            "confidence": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "said": {
              "type": "string",
              "minLength": 1,
              "maxLength": 6000
            }
          },
          "required": [
            "by",
            "model",
            "confidence"
          ]
        },
        "delegation": {
          "type": "object",
          "properties": {
            "to": {
              "type": "object",
              "properties": {
                "assistantId": {
                  "type": "string",
                  "pattern": "^con_[A-Za-z0-9-]+$"
                },
                "agentId": {
                  "type": "string",
                  "pattern": "^agt_[A-Za-z0-9-]+$"
                }
              },
              "required": [
                "assistantId"
              ]
            },
            "mode": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "freely",
                    "loop"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "working",
                    "suggested",
                    "answered",
                    "returned",
                    "taken_back"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "onStandingOk": {
              "type": "boolean",
              "const": true
            },
            "pickedUpAt": {
              "type": "string",
              "format": "date-time"
            },
            "returnAt": {
              "type": "string",
              "format": "date-time"
            },
            "working": {
              "type": "object",
              "properties": {
                "doing": {
                  "type": "string"
                },
                "since": {
                  "type": "string",
                  "format": "date-time"
                },
                "until": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "doing",
                "since",
                "until"
              ]
            },
            "resumes": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "handedBackAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "found": {
                    "type": "string"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "blocked",
                          "needs_person",
                          "not_mine"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  }
                },
                "required": [
                  "at",
                  "handedBackAt"
                ]
              }
            }
          },
          "required": [
            "to",
            "mode",
            "state",
            "at"
          ]
        },
        "ask": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "from": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "helper",
                    "asker"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "name": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "summary": {
              "type": "string"
            },
            "why": {
              "type": "string"
            },
            "options": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "detail": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "consequence": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "sends": {
                    "type": "object",
                    "properties": {
                      "to": {
                        "type": "string",
                        "maxLength": 120
                      }
                    },
                    "required": [
                      "to"
                    ]
                  }
                },
                "required": [
                  "id",
                  "label"
                ]
              }
            },
            "recommendedIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "rationale": {
              "type": "string"
            },
            "artifacts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "image",
                          "diff",
                          "url",
                          "file",
                          "draft",
                          "code"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "title": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "attachmentId": {
                    "type": "string"
                  },
                  "upload": {
                    "description": "image or file: true for an uploadUrl",
                    "type": "boolean"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "caption": {
                    "type": "string"
                  },
                  "lang": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "ts",
                          "json",
                          "shell",
                          "sql",
                          "yaml",
                          "toml",
                          "css",
                          "markdown",
                          "text"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "startLine": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "kind",
                  "title",
                  "ref"
                ]
              }
            },
            "action": {
              "type": "object",
              "properties": {
                "where": {
                  "type": "string"
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^s[1-9][0-9]{0,4}$"
                          },
                          "text": {
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "text"
                        ]
                      }
                    ]
                  }
                },
                "done": {
                  "type": "string"
                },
                "command": {
                  "type": "string"
                },
                "verify": {
                  "type": "string"
                }
              },
              "required": [
                "steps"
              ]
            },
            "highStakes": {
              "type": "boolean"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "answered": {
              "type": "object",
              "properties": {
                "choiceIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "done": {
                  "type": "boolean"
                },
                "text": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "answeredAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "answeredAt"
              ]
            }
          },
          "required": [
            "id",
            "from",
            "name",
            "title",
            "highStakes",
            "at"
          ]
        },
        "context": {
          "type": "object",
          "properties": {
            "background": {
              "type": "string"
            },
            "trace": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "done",
                          "paused",
                          "warn",
                          "failed"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "state",
                  "text"
                ]
              }
            },
            "filesTouched": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "tried": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "links": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "url"
                ]
              }
            }
          },
          "required": [
            "background",
            "trace",
            "filesTouched",
            "tried",
            "links"
          ]
        },
        "backgroundDoc": {
          "$ref": "#/$defs/Doc"
        },
        "artifacts": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "image",
                          "diff",
                          "url",
                          "file",
                          "draft",
                          "code"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "title": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "attachmentId": {
                    "type": "string"
                  },
                  "upload": {
                    "description": "image or file: true for an uploadUrl",
                    "type": "boolean"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "caption": {
                    "type": "string"
                  },
                  "lang": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "ts",
                          "json",
                          "shell",
                          "sql",
                          "yaml",
                          "toml",
                          "css",
                          "markdown",
                          "text"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "startLine": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "kind",
                  "title",
                  "ref"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "path"
                  },
                  "title": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  },
                  "machine": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "modifiedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "note": {
                    "type": "string"
                  },
                  "fetch": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "title",
                  "path"
                ]
              }
            ]
          }
        },
        "asked": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "text"
          ]
        },
        "body": {
          "$ref": "#/$defs/Doc"
        },
        "asOf": {
          "type": "string",
          "format": "date-time"
        },
        "dataSource": {
          "type": "string"
        },
        "dataSourceRuns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Run"
          }
        },
        "inChat": {
          "type": "boolean"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Attachment"
          }
        },
        "hasFiles": {
          "type": "boolean",
          "const": true
        },
        "thread": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^msg_[A-Za-z0-9-]+$"
              },
              "author": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "you",
                      "agent",
                      "pendingyou",
                      "helper",
                      "teammate"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "teammate": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "body": {
                "type": "string"
              },
              "via": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "voice",
                      "text"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "audioSeconds": {
                "type": "number"
              },
              "attachmentIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^att_[A-Za-z0-9-]+$"
                }
              },
              "app": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^app_[A-Za-z0-9-]+$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "machine": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "doc": {
                "$ref": "#/$defs/Doc"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "author",
              "body",
              "createdAt"
            ]
          }
        },
        "threadCount": {
          "type": "integer",
          "minimum": 0
        },
        "newReply": {
          "$ref": "#/$defs/NewReply"
        },
        "lane": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "new",
                "motion",
                "later",
                "done"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "section": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "yours",
                "theirs"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "unread": {
          "type": "boolean",
          "const": true
        },
        "partial": {
          "type": "boolean",
          "const": true
        },
        "presentation": {
          "$ref": "#/$defs/Presentation"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "version",
        "status",
        "turn",
        "kind",
        "title",
        "summary",
        "urgency",
        "blocking",
        "highStakes",
        "actions",
        "area",
        "asker",
        "threadCount",
        "url",
        "createdAt",
        "updatedAt"
      ]
    },
    "Conversation": {
      "type": "object",
      "properties": {
        "shown": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "earlier": {
          "$ref": "#/$defs/Line"
        },
        "newBefore": {
          "type": "string"
        },
        "fold": {
          "type": "object",
          "properties": {
            "head": {
              "type": "object",
              "properties": {
                "who": {
                  "$ref": "#/$defs/Line"
                },
                "time": {
                  "$ref": "#/$defs/Line"
                }
              }
            },
            "day": {
              "$ref": "#/$defs/Line"
            },
            "hidesNew": {
              "type": "boolean",
              "const": true
            }
          }
        },
        "left": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "leftLine": {
          "$ref": "#/$defs/Line"
        },
        "live": {
          "$ref": "#/$defs/ConversationLive"
        },
        "before": {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "card",
                          "asked",
                          "line"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "cardId": {
                    "type": "string",
                    "pattern": "^req_[A-Za-z0-9_-]+$"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "question": {
                    "$ref": "#/$defs/Line"
                  },
                  "line": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "message",
                          "handed",
                          "handed_back",
                          "taken_back",
                          "back",
                          "reopened"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "messageId": {
                    "type": "string"
                  },
                  "time": {
                    "$ref": "#/$defs/Line"
                  },
                  "mark": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "answered",
                              "fallback",
                              "withdrawn",
                              "later",
                              "delegated",
                              "you",
                              "said",
                              "handed",
                              "back"
                            ]
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "tone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "ok",
                              "quiet"
                            ]
                          },
                          {
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "tone"
                    ]
                  },
                  "outcome": {
                    "$ref": "#/$defs/Line"
                  },
                  "route": {
                    "type": "object",
                    "properties": {
                      "first": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "who": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "asker",
                                  "webhook",
                                  "person",
                                  "helper",
                                  "their_assistant"
                                ]
                              },
                              {
                                "type": "string"
                              }
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "who"
                        ]
                      },
                      "hidden": {
                        "type": "boolean"
                      },
                      "current": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "who": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "asker",
                                  "webhook",
                                  "person",
                                  "helper",
                                  "their_assistant"
                                ]
                              },
                              {
                                "type": "string"
                              }
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "who"
                        ]
                      },
                      "label": {
                        "$ref": "#/$defs/Line"
                      },
                      "state": {
                        "$ref": "#/$defs/Line"
                      },
                      "spoken": {
                        "$ref": "#/$defs/Line"
                      },
                      "tone": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "quiet",
                              "stalled",
                              "you"
                            ]
                          },
                          {
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "first",
                      "hidden",
                      "current",
                      "label",
                      "tone"
                    ]
                  },
                  "note": {
                    "$ref": "#/$defs/Line"
                  },
                  "withdrawn": {
                    "$ref": "#/$defs/Line"
                  },
                  "state": {
                    "$ref": "#/$defs/Line"
                  },
                  "talked": {
                    "$ref": "#/$defs/Line"
                  },
                  "said": {
                    "$ref": "#/$defs/Line"
                  },
                  "style": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "you",
                          "agent",
                          "event",
                          "note"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "who": {
                    "$ref": "#/$defs/Line"
                  },
                  "words": {
                    "type": "object",
                    "properties": {
                      "line": {
                        "$ref": "#/$defs/Line"
                      },
                      "runs": {
                        "type": "array",
                        "items": {
                          "$ref": "#/$defs/Run"
                        }
                      }
                    },
                    "required": [
                      "line"
                    ]
                  },
                  "doc": {
                    "$ref": "#/$defs/Doc"
                  }
                },
                "required": [
                  "kind",
                  "cardId",
                  "at"
                ]
              }
            },
            "more": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "line": {
                  "$ref": "#/$defs/Line"
                }
              },
              "required": [
                "count",
                "line"
              ]
            }
          },
          "required": [
            "items"
          ]
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ConversationItem"
          }
        }
      },
      "required": [
        "shown",
        "items"
      ]
    },
    "ConversationItem": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "side": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "you",
                "assistant",
                "note"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "head": {
          "type": "object",
          "properties": {
            "who": {
              "$ref": "#/$defs/Line"
            },
            "time": {
              "$ref": "#/$defs/Line"
            }
          }
        },
        "day": {
          "$ref": "#/$defs/Line"
        },
        "words": {
          "$ref": "#/$defs/Line"
        },
        "attachmentIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "via": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "voice",
                "text"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "label": {
          "$ref": "#/$defs/Line"
        }
      },
      "required": [
        "id",
        "side",
        "at"
      ]
    },
    "ConversationLive": {
      "type": "object",
      "properties": {
        "original": {
          "type": "object",
          "properties": {
            "open": {
              "type": "boolean"
            },
            "show": {
              "$ref": "#/$defs/Line"
            },
            "hide": {
              "$ref": "#/$defs/Line"
            },
            "progress": {
              "$ref": "#/$defs/Line"
            },
            "chips": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "line": {
                    "$ref": "#/$defs/Line"
                  }
                },
                "required": [
                  "ref",
                  "kind",
                  "line"
                ]
              }
            }
          },
          "required": [
            "open",
            "show",
            "hide"
          ]
        },
        "reAsk": {
          "type": "object",
          "properties": {
            "under": {
              "type": "string"
            },
            "placeholder": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "under",
            "placeholder"
          ]
        },
        "chose": {
          "type": "object",
          "properties": {
            "under": {
              "type": "string"
            },
            "line": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "under",
            "line"
          ]
        },
        "openAt": {
          "type": "string"
        }
      },
      "required": [
        "original"
      ]
    },
    "Doc": {
      "type": "object",
      "properties": {
        "v": {
          "type": "number",
          "const": 1
        },
        "blocks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Block"
          }
        },
        "plain": {
          "type": "string"
        }
      },
      "required": [
        "v",
        "blocks"
      ]
    },
    "EmailFace": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "email"
        },
        "heading": {
          "$ref": "#/$defs/Line"
        },
        "label": {
          "$ref": "#/$defs/Line"
        },
        "subject": {
          "$ref": "#/$defs/Line"
        },
        "from": {
          "type": "object",
          "properties": {
            "name": {
              "$ref": "#/$defs/Line"
            },
            "address": {
              "$ref": "#/$defs/Line"
            },
            "initial": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "initial"
          ]
        },
        "to": {
          "$ref": "#/$defs/Line"
        },
        "date": {
          "$ref": "#/$defs/Line"
        },
        "body": {
          "$ref": "#/$defs/Doc"
        },
        "fold": {
          "type": "object",
          "properties": {
            "folded": {
              "type": "boolean"
            },
            "show": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "folded",
            "show"
          ]
        },
        "images": {
          "type": "object",
          "properties": {
            "hidden": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "line": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "hidden",
            "line"
          ]
        },
        "truncated": {
          "$ref": "#/$defs/Line"
        },
        "attachments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "$ref": "#/$defs/Line"
              },
              "size": {
                "$ref": "#/$defs/Line"
              },
              "attachmentId": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          }
        }
      },
      "required": [
        "kind",
        "heading",
        "label",
        "subject",
        "from",
        "body",
        "fold"
      ]
    },
    "Line": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)*$"
        },
        "args": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/LineArg"
          }
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "key",
        "text"
      ]
    },
    "LineArg": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "object",
          "properties": {
            "time": {
              "type": "string",
              "format": "date-time"
            },
            "as": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "clock",
                    "duration",
                    "ago",
                    "until",
                    "day",
                    "date",
                    "since",
                    "stamp"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "zone": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "required": [
            "time",
            "as"
          ]
        },
        {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)*$"
            }
          },
          "required": [
            "key"
          ]
        }
      ]
    },
    "NewReply": {
      "type": "object",
      "properties": {
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "report"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "messageId": {
          "type": "string"
        },
        "preview": {
          "type": "string"
        },
        "answersYou": {
          "type": "boolean"
        },
        "asked": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "text",
            "at"
          ]
        }
      },
      "required": [
        "at",
        "messageId",
        "preview",
        "answersYou"
      ]
    },
    "NewReplyRow": {
      "type": "object",
      "properties": {
        "cardId": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9_-]+$"
        },
        "areaId": {
          "type": "string",
          "pattern": "^prj_[A-Za-z0-9_-]+$"
        },
        "report": {
          "type": "boolean",
          "const": true
        },
        "head": {
          "$ref": "#/$defs/Line"
        },
        "time": {
          "$ref": "#/$defs/Line"
        },
        "preview": {
          "$ref": "#/$defs/Line"
        },
        "about": {
          "$ref": "#/$defs/Line"
        },
        "name": {
          "$ref": "#/$defs/Line"
        }
      },
      "required": [
        "cardId",
        "areaId",
        "head",
        "time",
        "preview",
        "about",
        "name"
      ]
    },
    "NotifySettings": {
      "type": "object",
      "properties": {
        "mute": {
          "type": "object",
          "properties": {
            "choice": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "1h",
                    "2h",
                    "tomorrow",
                    "forever"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "until": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "choice"
          ]
        },
        "stillWhenStuck": {
          "type": "boolean"
        },
        "showQuestion": {
          "type": "boolean"
        },
        "newCards": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "stuck",
                "soon",
                "all"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "apns": {
          "type": "object",
          "properties": {
            "ready": {
              "type": "boolean"
            }
          },
          "required": [
            "ready"
          ]
        }
      },
      "required": [
        "stillWhenStuck",
        "showQuestion",
        "newCards",
        "apns"
      ]
    },
    "Presentation": {
      "type": "object",
      "properties": {
        "v": {
          "type": "number",
          "const": 1
        },
        "layout": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "choice",
                "multi",
                "approve",
                "draft",
                "review",
                "todo",
                "text",
                "update",
                "group",
                "ask",
                "permission",
                "answer",
                "settled",
                "fallback"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "head": {
          "type": "object",
          "properties": {
            "intent": {
              "type": "object",
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "decide",
                        "approve",
                        "do",
                        "tell",
                        "heads_up"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "label": {
                  "$ref": "#/$defs/Line"
                }
              },
              "required": [
                "kind",
                "label"
              ]
            },
            "wait": {
              "type": "object",
              "properties": {
                "line": {
                  "$ref": "#/$defs/Line"
                },
                "tone": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "you",
                        "deadline",
                        "quiet"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "line",
                "tone"
              ]
            },
            "marks": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "files",
                      "high_stakes"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              }
            }
          },
          "required": [
            "marks"
          ]
        },
        "above": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "asked_first",
                      "helper",
                      "note"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "title": {
                "$ref": "#/$defs/Line"
              },
              "body": {
                "$ref": "#/$defs/Line"
              }
            },
            "required": [
              "kind",
              "body"
            ]
          }
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "suggested": {
                "$ref": "#/$defs/Line"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "preselected": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "steps": {
          "$ref": "#/$defs/PresentationSteps"
        },
        "below": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Line"
          }
        },
        "box": {
          "type": "object",
          "properties": {
            "mode": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "hidden",
                    "on_demand",
                    "open"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "placeholder": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "mode"
          ]
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PresentationAction"
          }
        },
        "settled": {
          "$ref": "#/$defs/Line"
        },
        "fallbackAhead": {
          "type": "object",
          "properties": {
            "label": {
              "$ref": "#/$defs/Line"
            },
            "line": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "label",
            "line"
          ]
        },
        "context": {
          "type": "object",
          "properties": {
            "why": {
              "$ref": "#/$defs/Line"
            },
            "didSoFar": {
              "$ref": "#/$defs/Line"
            },
            "tried": {
              "$ref": "#/$defs/Line"
            }
          }
        },
        "route": {
          "type": "object",
          "properties": {
            "first": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "who": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "asker",
                        "webhook",
                        "person",
                        "helper",
                        "their_assistant"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "name",
                "who"
              ]
            },
            "hidden": {
              "type": "boolean"
            },
            "current": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "who": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "asker",
                        "webhook",
                        "person",
                        "helper",
                        "their_assistant"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "name",
                "who"
              ]
            },
            "label": {
              "$ref": "#/$defs/Line"
            },
            "state": {
              "$ref": "#/$defs/Line"
            },
            "spoken": {
              "$ref": "#/$defs/Line"
            },
            "tone": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "quiet",
                    "stalled",
                    "you"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "steps": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "time": {
                    "$ref": "#/$defs/Line"
                  },
                  "line": {
                    "$ref": "#/$defs/Line"
                  },
                  "detail": {
                    "$ref": "#/$defs/Line"
                  },
                  "quote": {
                    "type": "string"
                  },
                  "quoted": {
                    "$ref": "#/$defs/Line"
                  },
                  "who": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "asker",
                          "webhook",
                          "person",
                          "helper",
                          "their_assistant",
                          "you"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "claude-code",
                          "codex",
                          "cursor",
                          "gemini-cli",
                          "opencode",
                          "pi",
                          "antigravity",
                          "grok",
                          "muse",
                          "chatgpt",
                          "claude",
                          "dots",
                          "other",
                          "webhook",
                          "teammate"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "when": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "past",
                          "now",
                          "next"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "rounds": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "time": {
                          "$ref": "#/$defs/Line"
                        },
                        "line": {
                          "$ref": "#/$defs/Line"
                        },
                        "detail": {
                          "$ref": "#/$defs/Line"
                        },
                        "quote": {
                          "type": "string"
                        },
                        "quoted": {
                          "$ref": "#/$defs/Line"
                        },
                        "who": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "asker",
                                "webhook",
                                "person",
                                "helper",
                                "their_assistant",
                                "you"
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "claude-code",
                                "codex",
                                "cursor",
                                "gemini-cli",
                                "opencode",
                                "pi",
                                "antigravity",
                                "grok",
                                "muse",
                                "chatgpt",
                                "claude",
                                "dots",
                                "other",
                                "webhook",
                                "teammate"
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "when": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "past",
                                "now",
                                "next"
                              ]
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      },
                      "required": [
                        "line",
                        "who",
                        "when"
                      ]
                    }
                  }
                },
                "required": [
                  "line",
                  "who",
                  "when"
                ]
              }
            }
          },
          "required": [
            "first",
            "hidden",
            "current",
            "label",
            "tone"
          ]
        },
        "row": {
          "type": "object",
          "properties": {
            "title": {
              "$ref": "#/$defs/Line"
            },
            "meta": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Line"
              }
            },
            "turn": {
              "$ref": "#/$defs/Line"
            },
            "last": {
              "type": "object",
              "properties": {
                "who": {
                  "$ref": "#/$defs/Line"
                },
                "words": {
                  "$ref": "#/$defs/Line"
                }
              },
              "required": [
                "who",
                "words"
              ]
            },
            "area": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^prj_[A-Za-z0-9_-]+$"
                },
                "label": {
                  "$ref": "#/$defs/Line"
                }
              },
              "required": [
                "id",
                "label"
              ]
            },
            "lane": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "new",
                    "motion",
                    "later",
                    "done"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "section": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "yours",
                    "theirs"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "unread": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "title",
            "meta"
          ]
        },
        "conversation": {
          "$ref": "#/$defs/Conversation"
        },
        "reply": {
          "$ref": "#/$defs/Reply"
        },
        "ask": {
          "$ref": "#/$defs/AskFace"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmailFace"
          }
        },
        "fallback": {
          "type": "object",
          "properties": {
            "line": {
              "$ref": "#/$defs/Line"
            },
            "path": {
              "type": "string"
            }
          },
          "required": [
            "line",
            "path"
          ]
        }
      },
      "required": [
        "v",
        "layout",
        "head",
        "above",
        "below",
        "box",
        "actions",
        "row",
        "fallback"
      ]
    },
    "PresentationAction": {
      "type": "object",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "answer",
                "answer.option",
                "answer.approve",
                "answer.decline",
                "answer.done",
                "answer.got_it",
                "answer.allow",
                "answer.deny",
                "answer.send_words",
                "answer.send_changes",
                "answer.ask_keep_open",
                "didnt_work",
                "handle",
                "skip",
                "later",
                "back",
                "delegate",
                "take_back",
                "reply",
                "details",
                "undo",
                "open_web"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "label": {
          "$ref": "#/$defs/Line"
        },
        "icon": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "send",
                "check",
                "x",
                "clock",
                "forward",
                "reply",
                "info",
                "undo",
                "back",
                "open",
                "hand"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "place": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "primary",
                "secondary",
                "link",
                "overflow",
                "dock"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "style": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "primary",
                "secondary",
                "quiet",
                "ghost",
                "danger"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "confirm": {
          "type": "object",
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "hold",
                    "tap"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "prompt": {
              "$ref": "#/$defs/Line"
            },
            "yes": {
              "$ref": "#/$defs/Line"
            },
            "proof": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "none",
                    "yes_key"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "required": [
            "kind",
            "prompt",
            "yes",
            "proof"
          ]
        },
        "sends": {
          "type": "object",
          "properties": {
            "approved": {
              "type": "boolean"
            },
            "choiceIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "theyDecide": {
              "type": "boolean",
              "const": true
            },
            "handled": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "self",
                    "leave"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "needs": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "choice",
                "words"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "disabledLabel": {
          "$ref": "#/$defs/Line"
        }
      },
      "required": [
        "id",
        "label",
        "icon",
        "place",
        "style"
      ]
    },
    "PresentationSteps": {
      "type": "object",
      "properties": {
        "count": {
          "$ref": "#/$defs/Line"
        },
        "fold": {
          "type": "object",
          "properties": {
            "through": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "line": {
              "$ref": "#/$defs/Line"
            },
            "agent": {
              "$ref": "#/$defs/Line"
            },
            "show": {
              "$ref": "#/$defs/Line"
            },
            "hide": {
              "$ref": "#/$defs/Line"
            },
            "showLabel": {
              "$ref": "#/$defs/Line"
            },
            "hideLabel": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "through",
            "line",
            "show",
            "hide",
            "showLabel",
            "hideLabel"
          ]
        },
        "change": {
          "type": "object",
          "properties": {
            "before": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "failed": {
              "$ref": "#/$defs/Line"
            },
            "head": {
              "$ref": "#/$defs/Line"
            },
            "note": {
              "$ref": "#/$defs/Line"
            },
            "removed": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "before",
            "at"
          ]
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "n": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "done",
                      "next",
                      "todo",
                      "failed"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "mark": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "new",
                      "changed"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "by": {
                "type": "object",
                "properties": {
                  "how": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "saw",
                          "told"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "line": {
                    "$ref": "#/$defs/Line"
                  },
                  "label": {
                    "$ref": "#/$defs/Line"
                  }
                },
                "required": [
                  "how",
                  "at",
                  "line",
                  "label"
                ]
              },
              "changedAfter": {
                "$ref": "#/$defs/Line"
              },
              "runs": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Run"
                }
              }
            },
            "required": [
              "id",
              "n",
              "state"
            ]
          }
        }
      },
      "required": [
        "items"
      ]
    },
    "Reply": {
      "type": "object",
      "properties": {
        "head": {
          "$ref": "#/$defs/Line"
        },
        "label": {
          "$ref": "#/$defs/Line"
        },
        "time": {
          "$ref": "#/$defs/Line"
        },
        "quote": {
          "type": "object",
          "properties": {
            "label": {
              "$ref": "#/$defs/Line"
            },
            "words": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "label"
          ]
        },
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "time": {
                "$ref": "#/$defs/Line"
              },
              "words": {
                "$ref": "#/$defs/Line"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "preview": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "words": {
              "$ref": "#/$defs/Line"
            },
            "time": {
              "$ref": "#/$defs/Line"
            }
          },
          "required": [
            "id",
            "at",
            "words"
          ]
        },
        "replyTo": {
          "$ref": "#/$defs/Line"
        },
        "earlier": {
          "$ref": "#/$defs/Line"
        },
        "earlierLabel": {
          "$ref": "#/$defs/Line"
        },
        "earlierRegion": {
          "$ref": "#/$defs/Line"
        }
      },
      "required": [
        "head",
        "label",
        "quote",
        "messages",
        "earlierLabel",
        "earlierRegion"
      ]
    },
    "Run": {
      "anyOf": [
        {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "text"
                },
                "text": {
                  "type": "string"
                },
                "b": {
                  "type": "boolean",
                  "const": true
                },
                "i": {
                  "type": "boolean",
                  "const": true
                },
                "s": {
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "t",
                "text"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "code"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "t",
                "text"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "br"
                }
              },
              "required": [
                "t"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "address"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "t",
                "text"
              ]
            },
            {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "const": "link"
                },
                "href": {
                  "type": "string",
                  "format": "uri"
                },
                "words": {
                  "type": "string"
                },
                "site": {
                  "type": "string"
                },
                "asWritten": {
                  "type": "boolean",
                  "const": true
                },
                "own": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "card",
                            "page"
                          ]
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "kind",
                    "path"
                  ]
                },
                "b": {
                  "type": "boolean",
                  "const": true
                },
                "i": {
                  "type": "boolean",
                  "const": true
                },
                "s": {
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "t",
                "href",
                "words",
                "site"
              ]
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "t": {
              "type": "string",
              "description": "A kind this version doesn’t know: /v1 adds kinds, so read past it (a doc has its `plain`)."
            }
          },
          "required": [
            "t"
          ]
        }
      ]
    },
    "SendTo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "assistant",
                "teammate"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "to": {
          "type": "object",
          "properties": {
            "assistantId": {
              "type": "string",
              "pattern": "^con_[A-Za-z0-9-]+$"
            },
            "agentId": {
              "type": "string",
              "pattern": "^agt_[A-Za-z0-9-]+$"
            }
          },
          "required": [
            "assistantId",
            "agentId"
          ]
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "freely",
                "loop"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "helped": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "answered": {
              "type": "boolean"
            },
            "theirs": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "title",
            "at",
            "answered"
          ]
        }
      },
      "required": [
        "name",
        "kind"
      ]
    },
    "StepProgress": {
      "type": "object",
      "properties": {
        "rev": {
          "type": "integer",
          "minimum": 0
        },
        "done": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^s[1-9][0-9]{0,4}$"
          }
        },
        "unticked": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^s[1-9][0-9]{0,4}$"
          }
        },
        "agent": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^s[1-9][0-9]{0,4}$"
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "how": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "saw",
                      "told"
                    ]
                  },
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "required": [
              "id",
              "at",
              "how"
            ]
          }
        },
        "failed": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^s[1-9][0-9]{0,4}$"
            },
            "n": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "by": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "you",
                    "agent"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "at": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "id",
            "n",
            "by",
            "at"
          ]
        },
        "change": {
          "type": "object",
          "properties": {
            "at": {
              "type": "string",
              "format": "date-time"
            },
            "added": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^s[1-9][0-9]{0,4}$"
              }
            },
            "changed": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^s[1-9][0-9]{0,4}$"
              }
            },
            "removed": {
              "type": "integer",
              "minimum": 0
            },
            "before": {
              "type": "string",
              "pattern": "^s[1-9][0-9]{0,4}$"
            },
            "ticksOff": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^s[1-9][0-9]{0,4}$"
              }
            },
            "failed": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^s[1-9][0-9]{0,4}$"
                },
                "n": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "by": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "you",
                        "agent"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "n",
                "by",
                "at"
              ]
            }
          },
          "required": [
            "at",
            "added",
            "changed",
            "removed"
          ]
        }
      },
      "required": [
        "rev",
        "done"
      ]
    }
  }
}