{
  "components": {
    "schemas": {
      "AcceptInvitationRequest": {
        "properties": {
          "token": {
            "maxLength": 255,
            "minLength": 8,
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "title": "AcceptInvitationRequest",
        "type": "object"
      },
      "AcceptInvitationResponse": {
        "properties": {
          "role": {
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "user_id",
          "role"
        ],
        "title": "AcceptInvitationResponse",
        "type": "object"
      },
      "AnswerInputRequest": {
        "description": "Resolve a HITL ask (TRD-do-anything §6.12).",
        "properties": {
          "input_request_id": {
            "maxLength": 64,
            "title": "Input Request Id",
            "type": "string"
          },
          "kind": {
            "const": "answer_input_request",
            "default": "answer_input_request",
            "title": "Kind",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "response": {
            "title": "Response"
          }
        },
        "required": [
          "input_request_id",
          "response"
        ],
        "title": "AnswerInputRequest",
        "type": "object"
      },
      "ApiKeyCreatedResponse": {
        "description": "Returned exactly once — `secret_token` is the full `wa_<...>`\nstring the caller MUST capture immediately. Subsequent reads will\nonly show the prefix.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "disabled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "grace_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Until"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "prefix": {
            "title": "Prefix",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "secret_token": {
            "title": "Secret Token",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "user_id",
          "prefix",
          "name",
          "created_at",
          "secret_token"
        ],
        "title": "ApiKeyCreatedResponse",
        "type": "object"
      },
      "ApiKeyListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyResponse"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "ApiKeyListResponse",
        "type": "object"
      },
      "ApiKeyResponse": {
        "description": "Metadata only — `secret` is never re-issued. ``hashed_secret`` is\nexcluded from this schema even when admin reads, per TRD §3.2.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "disabled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "grace_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Until"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "prefix": {
            "title": "Prefix",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "user_id",
          "prefix",
          "name",
          "created_at"
        ],
        "title": "ApiKeyResponse",
        "type": "object"
      },
      "BillingAccountResponse": {
        "description": "Decimal-as-string contract per trd-overview §5.4.",
        "properties": {
          "browser_cost_usd": {
            "default": "0.00",
            "title": "Browser Cost Usd",
            "type": "string"
          },
          "credit_balance_usd": {
            "default": "0.00",
            "title": "Credit Balance Usd",
            "type": "string"
          },
          "llm_cost_usd": {
            "default": "0.00",
            "title": "Llm Cost Usd",
            "type": "string"
          },
          "period_end": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "period_start": {
            "format": "date-time",
            "title": "Period Start",
            "type": "string"
          },
          "plan": {
            "default": "hackathon",
            "title": "Plan",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "proxy_cost_usd": {
            "default": "0.00",
            "title": "Proxy Cost Usd",
            "type": "string"
          },
          "sessions_count": {
            "default": 0,
            "title": "Sessions Count",
            "type": "integer"
          },
          "total_cost_usd": {
            "default": "0.00",
            "title": "Total Cost Usd",
            "type": "string"
          }
        },
        "required": [
          "project_id",
          "period_start"
        ],
        "title": "BillingAccountResponse",
        "type": "object"
      },
      "BugReportListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BugReportResponse"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "BugReportListResponse",
        "type": "object"
      },
      "BugReportResponse": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "input_method": {
            "title": "Input Method",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "page_path": {
            "title": "Page Path",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "screenshot_data_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Screenshot Data Url"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          },
          "viewport_height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Viewport Height"
          },
          "viewport_width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Viewport Width"
          }
        },
        "required": [
          "id",
          "project_id",
          "user_id",
          "message",
          "page_path",
          "screenshot_data_url",
          "input_method",
          "viewport_width",
          "viewport_height",
          "user_agent",
          "status",
          "created_at"
        ],
        "title": "BugReportResponse",
        "type": "object"
      },
      "CancelTaskRequest": {
        "properties": {
          "reason": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "title": "CancelTaskRequest",
        "type": "object"
      },
      "ChangePasswordRequest": {
        "properties": {
          "current_password": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Current Password",
            "type": "string"
          },
          "new_password": {
            "maxLength": 200,
            "minLength": 8,
            "title": "New Password",
            "type": "string"
          }
        },
        "required": [
          "current_password",
          "new_password"
        ],
        "title": "ChangePasswordRequest",
        "type": "object"
      },
      "ConfidenceSummary": {
        "description": "Per-section confidence count rollup (PRD §2.9).",
        "properties": {
          "high": {
            "default": 0,
            "minimum": 0.0,
            "title": "High",
            "type": "integer"
          },
          "low": {
            "default": 0,
            "minimum": 0.0,
            "title": "Low",
            "type": "integer"
          },
          "medium": {
            "default": 0,
            "minimum": 0.0,
            "title": "Medium",
            "type": "integer"
          }
        },
        "title": "ConfidenceSummary",
        "type": "object"
      },
      "CreateApiKeyRequest": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "CreateApiKeyRequest",
        "type": "object"
      },
      "CreateBugReportRequest": {
        "additionalProperties": false,
        "properties": {
          "input_method": {
            "default": "text",
            "enum": [
              "text",
              "voice",
              "mixed"
            ],
            "title": "Input Method",
            "type": "string"
          },
          "message": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "page_path": {
            "maxLength": 2048,
            "minLength": 1,
            "title": "Page Path",
            "type": "string"
          },
          "screenshot_data_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Screenshot Data Url"
          },
          "user_agent": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          },
          "viewport_height": {
            "anyOf": [
              {
                "maximum": 10000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Viewport Height"
          },
          "viewport_width": {
            "anyOf": [
              {
                "maximum": 10000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Viewport Width"
          }
        },
        "required": [
          "message",
          "page_path"
        ],
        "title": "CreateBugReportRequest",
        "type": "object"
      },
      "CreateFollowUpTaskRequest": {
        "properties": {
          "allowed_actions": {
            "items": {
              "type": "string"
            },
            "title": "Allowed Actions",
            "type": "array"
          },
          "callback_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Url"
          },
          "instructions": {
            "maxLength": 10000,
            "title": "Instructions",
            "type": "string"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          }
        },
        "required": [
          "instructions"
        ],
        "title": "CreateFollowUpTaskRequest",
        "type": "object"
      },
      "CreateMonitorRequest": {
        "description": "``POST /v1/projects/{pid}/track/monitors`` body.\n\nTwo modes:\n\n1. **Alignment mode** (legacy): pass only ``intent`` + ``notify_channel``;\n   the supervisor drives a clarification dialogue that fills in\n   ``target_urls`` / ``extraction_schema`` / ``trigger_dsl`` /\n   ``schedule`` over a few rounds of intervene.\n\n2. **Direct mode** (v1 P0): pass ``schedule`` and any of the other\n   fields. If ``schedule`` is set the monitor goes straight to\n   ``active`` without any clarification round; alignment is skipped\n   entirely. ``target_urls`` and / or ``extraction_schema`` left\n   unset means the existing tick pipeline runs in degraded mode\n   (search-only / no-extract).",
        "properties": {
          "extraction_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Direct-mode JSON schema for the Extract phase. Omitting keeps the schema empty; the tick will only diff at the fingerprint layer.",
            "title": "Extraction Schema"
          },
          "intent": {
            "description": "Natural-language monitor intent. Used for the Console's human-readable label; in alignment mode also seeds the supervisor's clarification dialogue.",
            "maxLength": 4000,
            "minLength": 4,
            "title": "Intent",
            "type": "string"
          },
          "notify_channel": {
            "$ref": "#/components/schemas/NotifyChannelSpec"
          },
          "profile_id": {
            "anyOf": [
              {
                "maxLength": 36,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional — bind a profile when monitoring logged-in pages.",
            "title": "Profile Id"
          },
          "schedule": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Provide to bypass alignment and go straight to ``active``. Shape: ``{kind: 'cron'|'interval', expr|interval_seconds, tz}``.",
            "title": "Schedule"
          },
          "stop_condition_dsl": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Direct-mode stop expression; ``null`` = run forever.",
            "title": "Stop Condition Dsl"
          },
          "target_urls": {
            "anyOf": [
              {
                "items": {
                  "format": "uri",
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Direct-mode monitor pages.",
            "title": "Target Urls"
          },
          "trigger_dsl": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Direct-mode trigger expression. Defaults to ``{'on': 'change'}`` if omitted (any non-empty diff fires).",
            "title": "Trigger Dsl"
          }
        },
        "required": [
          "intent",
          "notify_channel"
        ],
        "title": "CreateMonitorRequest",
        "type": "object"
      },
      "CreateMonitorResponse": {
        "description": "``POST /v1/track/monitors`` response — adds the one-shot HMAC\nsecret. Returned exactly once; subsequent GETs never expose it.",
        "properties": {
          "baseline_extracted": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Extracted"
          },
          "baseline_extracted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Extracted At"
          },
          "consecutive_failures": {
            "default": 0,
            "title": "Consecutive Failures",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "extraction_schema": {
            "additionalProperties": true,
            "title": "Extraction Schema",
            "type": "object"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "intent_text": {
            "title": "Intent Text",
            "type": "string"
          },
          "last_tick_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Tick At"
          },
          "last_tick_n": {
            "default": 0,
            "title": "Last Tick N",
            "type": "integer"
          },
          "notify_channel": {
            "$ref": "#/components/schemas/NotifyChannelOut"
          },
          "notify_secret": {
            "description": "Cleartext HMAC-SHA256 secret. Persist this on the caller side immediately; it is not retrievable later.",
            "title": "Notify Secret",
            "type": "string"
          },
          "owner_user_id": {
            "title": "Owner User Id",
            "type": "string"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "schedule": {
            "additionalProperties": true,
            "title": "Schedule",
            "type": "object"
          },
          "status": {
            "enum": [
              "pending_clarification",
              "active",
              "paused",
              "completed",
              "canceled"
            ],
            "title": "Status",
            "type": "string"
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Reason"
          },
          "stop_condition_dsl": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Condition Dsl"
          },
          "target_urls": {
            "items": {
              "type": "string"
            },
            "title": "Target Urls",
            "type": "array"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "trigger_dsl": {
            "additionalProperties": true,
            "title": "Trigger Dsl",
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "owner_user_id",
          "status",
          "intent_text",
          "notify_channel",
          "created_at",
          "updated_at",
          "notify_secret"
        ],
        "title": "CreateMonitorResponse",
        "type": "object"
      },
      "CreateProfileRequest": {
        "additionalProperties": false,
        "properties": {
          "cookie_domains": {
            "items": {
              "type": "string"
            },
            "maxItems": 64,
            "title": "Cookie Domains",
            "type": "array"
          },
          "customer_user_id": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer User Id"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "CreateProfileRequest",
        "type": "object"
      },
      "CreateResearchRequest": {
        "additionalProperties": false,
        "description": "Body of ``POST /v1/deep_research`` — trd-deep-research.md §4.2.\n\n``extra=\"forbid\"`` because DR's contract is fully structured: silently\nswallowing typo'd field names would let bugs slip through (e.g.\n``output_fmt`` vs ``output_format`` would silently use the default).",
        "properties": {
          "callback_url": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Webhook URL on terminal task state (HMAC-signed).",
            "title": "Callback Url"
          },
          "depth": {
            "default": "standard",
            "description": "Affects outline section count, per-section ResearchAgent step budget, and Critic threshold strictness.",
            "enum": [
              "light",
              "standard",
              "deep"
            ],
            "title": "Depth",
            "type": "string"
          },
          "domain_blacklist": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional source domain blacklist.",
            "title": "Domain Blacklist"
          },
          "domain_whitelist": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional source domain filter. Default null (research needs broad coverage).",
            "title": "Domain Whitelist"
          },
          "max_cost_usd": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Hard cost ceiling (decimal string to avoid float precision). None = no explicit cap (still subject to platform limits).",
            "title": "Max Cost Usd"
          },
          "max_duration_minutes": {
            "default": 600,
            "description": "Wall-clock cap covering both research execution and outline gate wait time (PRD §6.1). Default 600 min (10h).",
            "maximum": 10000.0,
            "minimum": 1.0,
            "title": "Max Duration Minutes",
            "type": "integer"
          },
          "output_format": {
            "const": "report",
            "default": "report",
            "description": "Output shape. Phase 1 only `report`; expand later.",
            "title": "Output Format",
            "type": "string"
          },
          "require_outline_approval": {
            "default": true,
            "description": "Default true (product default isn't black-box). SDK callers running automation pipelines may set false to skip the HITL outline gate.",
            "title": "Require Outline Approval",
            "type": "boolean"
          },
          "target_audience": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional free text — affects writing style.",
            "title": "Target Audience"
          },
          "topic": {
            "description": "The research topic — natural language.",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Topic",
            "type": "string"
          }
        },
        "required": [
          "topic"
        ],
        "title": "CreateResearchRequest",
        "type": "object"
      },
      "CreateTaskRequest": {
        "description": "Body of POST /sessions and POST /sessions/{sid}/tasks.\n\nCross-field rules (require_either(instructions, session_id) etc.) are\nenforced at the route layer, not here, so this schema can be reused for\nboth endpoints with different rules.",
        "properties": {
          "agentmail": {
            "default": true,
            "title": "Agentmail",
            "type": "boolean"
          },
          "allowed_actions": {
            "items": {
              "type": "string"
            },
            "title": "Allowed Actions",
            "type": "array"
          },
          "cache_script": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Script"
          },
          "callback_url": {
            "anyOf": [
              {
                "format": "uri",
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Url"
          },
          "instructions": {
            "anyOf": [
              {
                "maxLength": 10000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions"
          },
          "keep_alive": {
            "default": true,
            "title": "Keep Alive",
            "type": "boolean"
          },
          "max_cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Cost Usd"
          },
          "max_duration_minutes": {
            "anyOf": [
              {
                "maximum": 10080.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Duration Minutes"
          },
          "model": {
            "default": "claude-sonnet-4.6",
            "minLength": 1,
            "title": "Model",
            "type": "string"
          },
          "output_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Schema"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "proxy_country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "us",
            "title": "Proxy Country Code"
          },
          "recording": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecordingConfigRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScheduleSpec"
              },
              {
                "type": "null"
              }
            ]
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "workspace_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Id"
          }
        },
        "title": "CreateTaskRequest",
        "type": "object"
      },
      "CreateTenantRequest": {
        "properties": {
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateTenantRequest",
        "type": "object"
      },
      "CreateTenantResponse": {
        "properties": {
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id"
        ],
        "title": "CreateTenantResponse",
        "type": "object"
      },
      "FeedbackRequest": {
        "description": "`POST /sessions/{sid}/tasks/{tid}/feedback` body — TRD §6.13.",
        "properties": {
          "feedback_text": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Feedback Text"
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "title": "Labels",
            "type": "array"
          },
          "rating": {
            "anyOf": [
              {
                "maximum": 5.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rating"
          },
          "thumbs": {
            "anyOf": [
              {
                "enum": [
                  "up",
                  "down"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thumbs"
          }
        },
        "title": "FeedbackRequest",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "InvitationListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvitationResponse"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "InvitationListResponse",
        "type": "object"
      },
      "InvitationResponse": {
        "properties": {
          "accepted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "expires_at": {
            "title": "Expires At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "invited_by": {
            "title": "Invited By",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "role": {
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ],
            "title": "Status",
            "type": "string"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "email",
          "role",
          "status",
          "invited_by",
          "expires_at",
          "accepted_at",
          "revoked_at",
          "created_at"
        ],
        "title": "InvitationResponse",
        "type": "object"
      },
      "InviteRequest": {
        "properties": {
          "email": {
            "maxLength": 255,
            "minLength": 3,
            "title": "Email",
            "type": "string"
          },
          "role": {
            "default": "member",
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "InviteRequest",
        "type": "object"
      },
      "InviteResponse": {
        "properties": {
          "expires_at": {
            "title": "Expires At",
            "type": "string"
          },
          "invitation_id": {
            "title": "Invitation Id",
            "type": "string"
          },
          "invite_url": {
            "title": "Invite Url",
            "type": "string"
          }
        },
        "required": [
          "invitation_id",
          "invite_url",
          "expires_at"
        ],
        "title": "InviteResponse",
        "type": "object"
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "maxLength": 255,
            "minLength": 3,
            "title": "Email",
            "type": "string"
          },
          "password": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest",
        "type": "object"
      },
      "LoginResponse": {
        "properties": {
          "auth_identity_id": {
            "title": "Auth Identity Id",
            "type": "string"
          }
        },
        "required": [
          "auth_identity_id"
        ],
        "title": "LoginResponse",
        "type": "object"
      },
      "MeResponse": {
        "properties": {
          "auth_identity_id": {
            "title": "Auth Identity Id",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "tenants": {
            "items": {
              "$ref": "#/components/schemas/TenantMembership"
            },
            "title": "Tenants",
            "type": "array"
          }
        },
        "required": [
          "auth_identity_id",
          "email",
          "provider",
          "tenants"
        ],
        "title": "MeResponse",
        "type": "object"
      },
      "MemberListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MemberResponse"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "MemberListResponse",
        "type": "object"
      },
      "MemberResponse": {
        "properties": {
          "auth_identity_id": {
            "title": "Auth Identity Id",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "invited_by_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By User Id"
          },
          "role": {
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ],
            "title": "Status",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "auth_identity_id",
          "role",
          "status",
          "display_name",
          "invited_by_user_id",
          "created_at"
        ],
        "title": "MemberResponse",
        "type": "object"
      },
      "MessageMonitorRequest": {
        "additionalProperties": false,
        "description": "``POST /monitors/{mid}/messages`` body — user-initiated text into\nthe alignment inflight queue. Active monitors reject this with\n409 ``monitor_not_in_alignment`` (handled at the route layer).",
        "properties": {
          "content": {
            "maxLength": 4000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "kind": {
            "default": "user_clarification",
            "enum": [
              "user_clarification",
              "user_correction"
            ],
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "MessageMonitorRequest",
        "type": "object"
      },
      "MonitorInterveneRequest": {
        "additionalProperties": false,
        "description": "``POST /monitors/{mid}/intervene`` body — answer to a supervisor\nclarification (alignment phase only).\n\n``kind=abandon`` is the structured \"I give up\" path: the monitor\nimmediately transitions to ``canceled`` with\n``status_reason='user_abandoned_alignment'``.",
        "properties": {
          "kind": {
            "default": "answer",
            "enum": [
              "answer",
              "skip",
              "abandon"
            ],
            "title": "Kind",
            "type": "string"
          },
          "request_id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Request Id",
            "type": "string"
          },
          "response": {
            "default": "",
            "maxLength": 4000,
            "title": "Response",
            "type": "string"
          }
        },
        "required": [
          "request_id"
        ],
        "title": "MonitorInterveneRequest",
        "type": "object"
      },
      "MonitorListResponse": {
        "description": "``GET /v1/track/monitors`` paginated list.",
        "properties": {
          "has_more": {
            "default": false,
            "title": "Has More",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MonitorResponse"
            },
            "title": "Items",
            "type": "array"
          },
          "page": {
            "default": 1,
            "title": "Page",
            "type": "integer"
          },
          "page_size": {
            "default": 20,
            "title": "Page Size",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "MonitorListResponse",
        "type": "object"
      },
      "MonitorResponse": {
        "description": "GET / list monitor item. ``notify_secret`` is intentionally\nabsent — see ``CreateMonitorResponse`` for the create-only field.",
        "properties": {
          "baseline_extracted": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Extracted"
          },
          "baseline_extracted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Extracted At"
          },
          "consecutive_failures": {
            "default": 0,
            "title": "Consecutive Failures",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "extraction_schema": {
            "additionalProperties": true,
            "title": "Extraction Schema",
            "type": "object"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "intent_text": {
            "title": "Intent Text",
            "type": "string"
          },
          "last_tick_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Tick At"
          },
          "last_tick_n": {
            "default": 0,
            "title": "Last Tick N",
            "type": "integer"
          },
          "notify_channel": {
            "$ref": "#/components/schemas/NotifyChannelOut"
          },
          "owner_user_id": {
            "title": "Owner User Id",
            "type": "string"
          },
          "profile_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Id"
          },
          "schedule": {
            "additionalProperties": true,
            "title": "Schedule",
            "type": "object"
          },
          "status": {
            "enum": [
              "pending_clarification",
              "active",
              "paused",
              "completed",
              "canceled"
            ],
            "title": "Status",
            "type": "string"
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Reason"
          },
          "stop_condition_dsl": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Condition Dsl"
          },
          "target_urls": {
            "items": {
              "type": "string"
            },
            "title": "Target Urls",
            "type": "array"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "trigger_dsl": {
            "additionalProperties": true,
            "title": "Trigger Dsl",
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "owner_user_id",
          "status",
          "intent_text",
          "notify_channel",
          "created_at",
          "updated_at"
        ],
        "title": "MonitorResponse",
        "type": "object"
      },
      "NotifyChannelKind": {
        "enum": [
          "callback_url",
          "global_webhook",
          "console_inbox"
        ],
        "title": "NotifyChannelKind",
        "type": "string"
      },
      "NotifyChannelOut": {
        "description": "Read-side echo of the configured channel.",
        "properties": {
          "kind": {
            "enum": [
              "callback_url",
              "global_webhook",
              "console_inbox"
            ],
            "title": "Kind",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "webhook_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Id"
          }
        },
        "required": [
          "kind"
        ],
        "title": "NotifyChannelOut",
        "type": "object"
      },
      "NotifyChannelSpec": {
        "additionalProperties": false,
        "description": "``notify_channel`` value object — exactly one of (url) or\n(webhook_id) must be set, matching ``kind``.\n\nM4 ships ``callback_url`` only (``global_webhook`` is M4.5+, but we\nstill validate the shape so SDKs can prepare). The\n``notify_channel_ref`` we persist on the row is the string form\n``\"<kind>:<rest>\"`` — service layer does the join.",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/NotifyChannelKind"
          },
          "url": {
            "anyOf": [
              {
                "format": "uri",
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required when kind=callback_url",
            "title": "Url"
          },
          "webhook_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required when kind=global_webhook (M4.5+)",
            "title": "Webhook Id"
          }
        },
        "required": [
          "kind"
        ],
        "title": "NotifyChannelSpec",
        "type": "object"
      },
      "PartialSection": {
        "description": "A single section that fell short of acceptance criteria — only\npopulated when ``is_complete=false`` (PRD §3.5).",
        "properties": {
          "blockers": {
            "description": "Human-readable bullets explaining what was missing.",
            "items": {
              "type": "string"
            },
            "title": "Blockers",
            "type": "array"
          },
          "coverage_ratio": {
            "description": "Final coverage of this section's research_questions.",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Coverage Ratio",
            "type": "number"
          },
          "reason": {
            "description": "Short tag — 'single-source' / 'low-coverage' / 'unresolved-conflict' / etc.",
            "title": "Reason",
            "type": "string"
          },
          "section_id": {
            "description": "Outline section id (e.g. `s5`).",
            "title": "Section Id",
            "type": "string"
          }
        },
        "required": [
          "section_id",
          "reason",
          "coverage_ratio"
        ],
        "title": "PartialSection",
        "type": "object"
      },
      "PatchAction": {
        "enum": [
          "pause",
          "resume",
          "refine",
          "cancel"
        ],
        "title": "PatchAction",
        "type": "string"
      },
      "PatchMonitorRequest": {
        "additionalProperties": false,
        "description": "``PATCH /monitors/{mid}`` body. ``action`` is the discriminator;\n``patch`` is required iff action=refine.",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/PatchAction"
          },
          "patch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RefinePatch"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "action"
        ],
        "title": "PatchMonitorRequest",
        "type": "object"
      },
      "ProfileListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProfileResponse"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "ProfileListResponse",
        "type": "object"
      },
      "ProfileResponse": {
        "properties": {
          "cookie_domains": {
            "items": {
              "type": "string"
            },
            "title": "Cookie Domains",
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer User Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "created_at",
          "updated_at"
        ],
        "title": "ProfileResponse",
        "type": "object"
      },
      "ProviderInfo": {
        "description": "One enabled SSO provider, surfaced to the login UI to render\na 'Sign in with X' button.",
        "properties": {
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "provider_id": {
            "title": "Provider Id",
            "type": "string"
          }
        },
        "required": [
          "provider_id",
          "display_name"
        ],
        "title": "ProviderInfo",
        "type": "object"
      },
      "ProvidersResponse": {
        "properties": {
          "providers": {
            "items": {
              "$ref": "#/components/schemas/ProviderInfo"
            },
            "title": "Providers",
            "type": "array"
          }
        },
        "required": [
          "providers"
        ],
        "title": "ProvidersResponse",
        "type": "object"
      },
      "QuotaStatusResponse": {
        "properties": {
          "additional_credits": {
            "title": "Additional Credits",
            "type": "integer"
          },
          "concurrency": {
            "items": {
              "$ref": "#/components/schemas/QuotaUsageRow"
            },
            "title": "Concurrency",
            "type": "array"
          },
          "monthly_credits": {
            "title": "Monthly Credits",
            "type": "integer"
          },
          "plan_id": {
            "title": "Plan Id",
            "type": "string"
          },
          "plan_name": {
            "title": "Plan Name",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "scheduled_cap": {
            "title": "Scheduled Cap",
            "type": "integer"
          },
          "scheduled_running": {
            "title": "Scheduled Running",
            "type": "integer"
          },
          "subscription_status": {
            "title": "Subscription Status",
            "type": "string"
          }
        },
        "required": [
          "project_id",
          "plan_id",
          "plan_name",
          "subscription_status",
          "concurrency",
          "scheduled_running",
          "scheduled_cap",
          "monthly_credits",
          "additional_credits"
        ],
        "title": "QuotaStatusResponse",
        "type": "object"
      },
      "QuotaUsageRow": {
        "properties": {
          "cap": {
            "title": "Cap",
            "type": "integer"
          },
          "running": {
            "title": "Running",
            "type": "integer"
          },
          "supervisor_kind": {
            "title": "Supervisor Kind",
            "type": "string"
          }
        },
        "required": [
          "supervisor_kind",
          "running",
          "cap"
        ],
        "title": "QuotaUsageRow",
        "type": "object"
      },
      "RecordingConfigRequest": {
        "description": "Per-session recording knob — trd-recording §6.4.\n\nReplaces the v1 flat ``enable_recording: bool``. New shape collapses\nthree orthogonal toggles (on/off, quality, capture-during-take_control)\ninto one structured field so future extensions land naturally.",
        "properties": {
          "capture_during_take_control": {
            "default": false,
            "title": "Capture During Take Control",
            "type": "boolean"
          },
          "enabled": {
            "default": false,
            "title": "Enabled",
            "type": "boolean"
          },
          "quality": {
            "default": "low",
            "enum": [
              "low",
              "medium"
            ],
            "title": "Quality",
            "type": "string"
          }
        },
        "title": "RecordingConfigRequest",
        "type": "object"
      },
      "RecordingResponse": {
        "description": "`GET /sessions/{sid}/recording` — TRD-do-anything §6.\n\n`recording_url` is `null` until the session ends and the recording is\nfinalised; the engine fills it in `finalize_task` (§13).",
        "properties": {
          "recording_started_at": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Recording Started At"
          },
          "recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Url"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "recording_url"
        ],
        "title": "RecordingResponse",
        "type": "object"
      },
      "RecordingSegmentResponse": {
        "description": "Per-segment shape — trd-recording §6.3.",
        "properties": {
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "ended_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "mime": {
            "default": "video/webm",
            "title": "Mime",
            "type": "string"
          },
          "segment_index": {
            "title": "Segment Index",
            "type": "integer"
          },
          "segment_kind": {
            "title": "Segment Kind",
            "type": "string"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "segment_index",
          "segment_kind",
          "started_at",
          "status"
        ],
        "title": "RecordingSegmentResponse",
        "type": "object"
      },
      "RefinePatch": {
        "additionalProperties": false,
        "description": "``action=refine`` payload. Any field set to ``None`` is\nignored; service layer decides which fields invalidate baseline\n(trd-track.md §10.2.4).",
        "properties": {
          "extraction_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extraction Schema"
          },
          "notify_channel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NotifyChannelSpec"
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "stop_condition_dsl": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Condition Dsl"
          },
          "target_urls": {
            "anyOf": [
              {
                "items": {
                  "format": "uri",
                  "minLength": 1,
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Urls"
          },
          "trigger_dsl": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trigger Dsl"
          }
        },
        "title": "RefinePatch",
        "type": "object"
      },
      "RefineSearchRequest": {
        "additionalProperties": false,
        "description": "Body of ``POST /v1/projects/{pid}/web_search/tasks/{tid}/messages``\n— the inflight follow-up channel (trd-web-search §4.3 / prd §2.3).\n\nThe user can refine the original queries (e.g. add ``site:reddit.com``)\nand re-search; the supervisor reopens the task, mutates\n``state.search_inputs.queries``, and re-runs Phase 0.\n\nTwo shapes accepted:\n- ``text`` — natural-language refinement; supervisor parses it\n  (\"再加 site:reddit.com 限制重搜\") into a query mutation.\n- ``queries`` — explicit override of the query list (skip parsing).\n\nExactly one must be set.",
        "properties": {
          "queries": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Explicit replacement query list (skips text parsing).",
            "title": "Queries"
          },
          "text": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Natural-language refinement instruction.",
            "title": "Text"
          }
        },
        "title": "RefineSearchRequest",
        "type": "object"
      },
      "ReleaseControlRequest": {
        "description": "Hand control back to the agent (TRD-take-control §4.1).",
        "properties": {
          "kind": {
            "const": "release_control",
            "title": "Kind",
            "type": "string"
          },
          "trigger": {
            "default": "client_release",
            "enum": [
              "client_release",
              "console_release",
              "idle_timeout",
              "token_expire",
              "disconnect",
              "expired_no_connect"
            ],
            "title": "Trigger",
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "title": "ReleaseControlRequest",
        "type": "object"
      },
      "ResearchFeedbackRequest": {
        "additionalProperties": false,
        "description": "Body of ``POST /v1/deep_research/tasks/{tid}/feedback`` —\nmirrors the DA ``UserOutcome`` shape (trd-do-anything §6.13).",
        "properties": {
          "feedback_text": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Free-form feedback text.",
            "title": "Feedback Text"
          },
          "rating": {
            "anyOf": [
              {
                "maximum": 5.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional 1-5 rating.",
            "title": "Rating"
          },
          "thumbs": {
            "anyOf": [
              {
                "enum": [
                  "up",
                  "down"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Coarse thumbs up / down.",
            "title": "Thumbs"
          }
        },
        "title": "ResearchFeedbackRequest",
        "type": "object"
      },
      "ResearchFollowupRequest": {
        "additionalProperties": false,
        "description": "Body of ``POST /v1/deep_research/tasks/{tid}/messages`` —\nfollow-up text appended after the task reaches a terminal state.\n\nPhase-1 MVP only supports done-task follow-up (PRD §6 / spec):\nin-flight messages return 409 from the route layer.",
        "properties": {
          "text": {
            "description": "Natural-language follow-up instruction.",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "ResearchFollowupRequest",
        "type": "object"
      },
      "ResearchInterveneRequest": {
        "additionalProperties": false,
        "description": "Body of ``POST /v1/deep_research/tasks/{tid}/intervene``.\n\nThree response shapes:\n- ``\"approve\"`` (string) — proceed with current outline\n- ``{\"action\": \"approve_with_edits\", \"edits\": [OutlineEdit, ...]}`` — apply edits then proceed\n- ``{\"action\": \"reject\", \"reason\": \"...\"}`` — replan brief / outline",
        "properties": {
          "request_id": {
            "description": "Echoes the `request_id` from the `task.input_request` event.",
            "minLength": 1,
            "title": "Request Id",
            "type": "string"
          },
          "response": {
            "anyOf": [
              {
                "const": "approve",
                "type": "string"
              },
              {
                "additionalProperties": true,
                "type": "object"
              }
            ],
            "description": "Either the literal string `\"approve\"` or a dict whose `action` field discriminates `approve_with_edits` / `reject`.",
            "title": "Response"
          }
        },
        "required": [
          "request_id",
          "response"
        ],
        "title": "ResearchInterveneRequest",
        "type": "object"
      },
      "ResearchPhase": {
        "description": "5-phase machine + the HITL gate (trd-deep-research.md §3.2 / §5.2).\n\nThe ``hitl_outline`` value is a transition state — it appears between\nPlan and Gather only when ``require_outline_approval=true``. Skipped\nwhen SDK passes ``require_outline_approval=false``.",
        "enum": [
          "brief",
          "plan",
          "hitl_outline",
          "gather",
          "crosscheck",
          "synthesize"
        ],
        "title": "ResearchPhase",
        "type": "string"
      },
      "ResearchResultPayload": {
        "description": "Terminal result snapshot — populated on done / partial.\n\n``partial_sections`` is non-empty exactly when the parent task carries\n``is_complete=false``. SDKs branch on ``is_complete`` first then drill\ninto ``partial_sections`` for the specific blockers.",
        "properties": {
          "citations_count": {
            "default": 0,
            "minimum": 0.0,
            "title": "Citations Count",
            "type": "integer"
          },
          "confidence_summary": {
            "$ref": "#/components/schemas/ConfidenceSummary"
          },
          "final_artifact_id": {
            "description": "Artifact id of the final.md report.",
            "title": "Final Artifact Id",
            "type": "string"
          },
          "partial_sections": {
            "items": {
              "$ref": "#/components/schemas/PartialSection"
            },
            "title": "Partial Sections",
            "type": "array"
          }
        },
        "required": [
          "final_artifact_id"
        ],
        "title": "ResearchResultPayload",
        "type": "object"
      },
      "ResearchTaskResponse": {
        "description": "The single task-detail response shape — used for:\n- ``POST /v1/deep_research`` (202 on create)\n- ``GET /v1/deep_research/tasks/{tid}``\n\nMirrors the canonical task envelope (PRD §2.9 + trd-deep-research §4.3)\nminus DA-specific fields that don't apply (no live_url / cdp_url /\nrecording_urls / take_control payload — DR is read-only and never\ndrives a browser session that gets surfaced to the caller).",
        "properties": {
          "cost_usd": {
            "default": "0",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Cost Usd",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "duration_seconds": {
            "default": 0,
            "minimum": 0.0,
            "title": "Duration Seconds",
            "type": "integer"
          },
          "is_complete": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Complete"
          },
          "phase": {
            "$ref": "#/components/schemas/ResearchPhase"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResearchResultPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "running",
              "waiting",
              "done",
              "failed",
              "canceled",
              "expired"
            ],
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          },
          "total_input_tokens": {
            "default": 0,
            "title": "Total Input Tokens",
            "type": "integer"
          },
          "total_output_tokens": {
            "default": 0,
            "title": "Total Output Tokens",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "user_outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserOutcome"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "task_id",
          "session_id",
          "status",
          "phase",
          "created_at",
          "updated_at"
        ],
        "title": "ResearchTaskResponse",
        "type": "object"
      },
      "ScheduleSpec": {
        "properties": {
          "cron": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron"
          },
          "event_filter": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Filter"
          },
          "interval_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interval Seconds"
          },
          "kind": {
            "enum": [
              "cron",
              "interval",
              "event",
              "autonomous"
            ],
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "title": "ScheduleSpec",
        "type": "object"
      },
      "SearchResultItem": {
        "description": "A single ranked search result. Mirrors trd-search-agent §2.3 so\nSDK consumers see the same shape regardless of whether the result\ncame from WebSearch or DoAnything's Plan-internal search node.",
        "properties": {
          "canonical_url": {
            "description": "Normalized URL used for dedup (utm_/ref/fbclid stripped, www prefix removed, trailing slash normalized, fragment dropped).",
            "title": "Canonical Url",
            "type": "string"
          },
          "dedup_count": {
            "default": 1,
            "description": "Number of (query, engine) pairs that returned this canonical_url. Higher = stronger relevance signal.",
            "minimum": 1.0,
            "title": "Dedup Count",
            "type": "integer"
          },
          "final_rank": {
            "description": "1-based rank after dedup + RRF rerank across all (query, engine) pairs.",
            "minimum": 1.0,
            "title": "Final Rank",
            "type": "integer"
          },
          "original_rank": {
            "description": "1-based rank within the engine's response.",
            "minimum": 1.0,
            "title": "Original Rank",
            "type": "integer"
          },
          "snippet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Engine-provided snippet.",
            "title": "Snippet"
          },
          "source_engine": {
            "description": "Engine that returned this result (`ddg` / `bing` / ...).",
            "title": "Source Engine",
            "type": "string"
          },
          "source_query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The query (verbatim from request) that produced this result. Required for multi-query tasks; null for single-query.",
            "title": "Source Query"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "1-3 sentence summary written by TextifyAgent. Present only when the request was made with `summarize=true`.",
            "title": "Summary"
          },
          "title": {
            "description": "Result title as the engine returned it.",
            "title": "Title",
            "type": "string"
          },
          "url": {
            "description": "Original URL from the engine.",
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "title",
          "url",
          "canonical_url",
          "source_engine",
          "original_rank",
          "final_rank"
        ],
        "title": "SearchResultItem",
        "type": "object"
      },
      "SendMessageRequest": {
        "description": "`POST /sessions/{sid}/tasks/{tid}/messages` body — TRD §6.11.",
        "properties": {
          "content": {
            "maxLength": 10000,
            "title": "Content",
            "type": "string"
          },
          "kind": {
            "default": "user_instruction",
            "enum": [
              "user_instruction",
              "user_clarification",
              "user_correction"
            ],
            "title": "Kind",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "role": {
            "default": "human",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "SendMessageRequest",
        "type": "object"
      },
      "SessionListResponse": {
        "properties": {
          "has_more": {
            "default": false,
            "title": "Has More",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SessionResponse"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "SessionListResponse",
        "type": "object"
      },
      "SessionResponse": {
        "properties": {
          "agentmail_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agentmail Email"
          },
          "browser_cost_usd": {
            "default": "0",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Browser Cost Usd",
            "type": "string"
          },
          "cdp_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cdp Url"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions"
          },
          "is_task_successful": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Task Successful"
          },
          "last_step_summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Step Summary"
          },
          "latest_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Task Id"
          },
          "live_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Live Url"
          },
          "llm_cost_usd": {
            "default": "0",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Llm Cost Usd",
            "type": "string"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "output": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Output"
          },
          "output_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Schema"
          },
          "pending_message_count": {
            "default": 0,
            "title": "Pending Message Count",
            "type": "integer"
          },
          "proxy_cost_usd": {
            "default": "0",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Proxy Cost Usd",
            "type": "string"
          },
          "proxy_used_mb": {
            "default": "0",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Proxy Used Mb",
            "type": "string"
          },
          "recording": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskRecordingResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "recording_capture_during_take_control": {
            "default": false,
            "title": "Recording Capture During Take Control",
            "type": "boolean"
          },
          "recording_urls": {
            "items": {
              "type": "string"
            },
            "title": "Recording Urls",
            "type": "array"
          },
          "screenshot_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Screenshot Url"
          },
          "status": {
            "enum": [
              "created",
              "idle",
              "running",
              "stopped",
              "timed_out",
              "error"
            ],
            "title": "Status",
            "type": "string"
          },
          "step_count": {
            "default": 0,
            "title": "Step Count",
            "type": "integer"
          },
          "supervisor_kind": {
            "enum": [
              "do_anything",
              "deep_research",
              "deep_solve",
              "web_search",
              "track"
            ],
            "title": "Supervisor Kind",
            "type": "string"
          },
          "terminal_reason": {
            "anyOf": [
              {
                "enum": [
                  "done",
                  "failed",
                  "canceled",
                  "expired"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Terminal Reason"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "total_cost_usd": {
            "default": "0",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total Cost Usd",
            "type": "string"
          },
          "total_input_tokens": {
            "default": 0,
            "title": "Total Input Tokens",
            "type": "integer"
          },
          "total_output_tokens": {
            "default": 0,
            "title": "Total Output Tokens",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "user_outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserOutcome"
              },
              {
                "type": "null"
              }
            ]
          },
          "waiting_reason": {
            "anyOf": [
              {
                "enum": [
                  "human_intervention",
                  "user_paused",
                  "confirmation_required",
                  "sleep_until",
                  "external_signal"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Waiting Reason"
          }
        },
        "required": [
          "id",
          "status",
          "supervisor_kind",
          "model",
          "created_at",
          "updated_at"
        ],
        "title": "SessionResponse",
        "type": "object"
      },
      "SignupRequest": {
        "properties": {
          "email": {
            "maxLength": 255,
            "minLength": 3,
            "title": "Email",
            "type": "string"
          },
          "password": {
            "maxLength": 128,
            "minLength": 8,
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "title": "SignupRequest",
        "type": "object"
      },
      "SignupResponse": {
        "properties": {
          "auth_identity_id": {
            "title": "Auth Identity Id",
            "type": "string"
          },
          "default_tenant_id": {
            "title": "Default Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "auth_identity_id",
          "default_tenant_id"
        ],
        "title": "SignupResponse",
        "type": "object"
      },
      "StopSessionRequest": {
        "description": "`POST /sessions/{sid}/stop` body — TRD §5.4.",
        "properties": {
          "strategy": {
            "default": "session",
            "enum": [
              "task",
              "session"
            ],
            "title": "Strategy",
            "type": "string"
          }
        },
        "title": "StopSessionRequest",
        "type": "object"
      },
      "TakeControlRequest": {
        "description": "Sign a standalone_control_url for the user (TRD-take-control §4.1).",
        "properties": {
          "kind": {
            "const": "take_control",
            "title": "Kind",
            "type": "string"
          },
          "reason": {
            "default": "user_initiated",
            "maxLength": 64,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "title": "TakeControlRequest",
        "type": "object"
      },
      "TaskRecordingResponse": {
        "description": "Aggregate task recording shape — trd-recording §6.3.\n\n``segments`` is in segment_index ascending order. ``is_complete`` is\nTrue iff every segment is finalised (or failed) — Console swaps from\nthe live preview placeholder to the player on this flag.",
        "properties": {
          "is_complete": {
            "default": false,
            "title": "Is Complete",
            "type": "boolean"
          },
          "segments": {
            "items": {
              "$ref": "#/components/schemas/RecordingSegmentResponse"
            },
            "title": "Segments",
            "type": "array"
          },
          "total_duration_ms": {
            "default": 0,
            "title": "Total Duration Ms",
            "type": "integer"
          }
        },
        "title": "TaskRecordingResponse",
        "type": "object"
      },
      "TenantMembership": {
        "description": "One row in ``GET /v1/me.tenants[]`` — TRD §2.3.",
        "properties": {
          "kind": {
            "enum": [
              "personal",
              "team"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "name",
          "kind",
          "role",
          "user_id"
        ],
        "title": "TenantMembership",
        "type": "object"
      },
      "UpdateBugReportRequest": {
        "additionalProperties": false,
        "properties": {
          "claimed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Claimed By"
          },
          "status": {
            "enum": [
              "submitted",
              "in_progress",
              "resolved",
              "wontfix"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "UpdateBugReportRequest",
        "type": "object"
      },
      "UpdateMemberRequest": {
        "properties": {
          "role": {
            "anyOf": [
              {
                "enum": [
                  "admin",
                  "member"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "disabled"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "UpdateMemberRequest",
        "type": "object"
      },
      "UpdateProfileRequest": {
        "additionalProperties": false,
        "properties": {
          "cookie_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cookie Domains"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "UpdateProfileRequest",
        "type": "object"
      },
      "UsageDailyBucket": {
        "properties": {
          "cache_creation_input_tokens": {
            "title": "Cache Creation Input Tokens",
            "type": "integer"
          },
          "cache_read_input_tokens": {
            "title": "Cache Read Input Tokens",
            "type": "integer"
          },
          "day": {
            "format": "date",
            "title": "Day",
            "type": "string"
          },
          "input_tokens": {
            "title": "Input Tokens",
            "type": "integer"
          },
          "llm_calls": {
            "title": "Llm Calls",
            "type": "integer"
          },
          "output_tokens": {
            "title": "Output Tokens",
            "type": "integer"
          },
          "wall_ms": {
            "title": "Wall Ms",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "input_tokens",
          "output_tokens",
          "cache_read_input_tokens",
          "cache_creation_input_tokens",
          "wall_ms",
          "llm_calls"
        ],
        "title": "UsageDailyBucket",
        "type": "object"
      },
      "UsageSummaryResponse": {
        "description": "Token + wall-clock rollup for the current period. No $.\n\nCost lives on `/billing/account`. This endpoint is for the Usage\nsurface (telemetry / diagnostic / drill-down) — keep money out so\nthe two surfaces stay decoupled.",
        "properties": {
          "period_end": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "period_start": {
            "format": "date-time",
            "title": "Period Start",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "sessions_count": {
            "default": 0,
            "title": "Sessions Count",
            "type": "integer"
          },
          "total_cache_creation_input_tokens": {
            "default": 0,
            "title": "Total Cache Creation Input Tokens",
            "type": "integer"
          },
          "total_cache_read_input_tokens": {
            "default": 0,
            "title": "Total Cache Read Input Tokens",
            "type": "integer"
          },
          "total_input_tokens": {
            "default": 0,
            "title": "Total Input Tokens",
            "type": "integer"
          },
          "total_output_tokens": {
            "default": 0,
            "title": "Total Output Tokens",
            "type": "integer"
          },
          "total_wall_ms": {
            "default": 0,
            "title": "Total Wall Ms",
            "type": "integer"
          }
        },
        "required": [
          "project_id",
          "period_start"
        ],
        "title": "UsageSummaryResponse",
        "type": "object"
      },
      "UsageTimeseriesResponse": {
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/UsageDailyBucket"
            },
            "title": "Buckets",
            "type": "array"
          },
          "period_end": {
            "format": "date",
            "title": "Period End",
            "type": "string"
          },
          "period_start": {
            "format": "date",
            "title": "Period Start",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          }
        },
        "required": [
          "project_id",
          "period_start",
          "period_end",
          "buckets"
        ],
        "title": "UsageTimeseriesResponse",
        "type": "object"
      },
      "UsageTopTaskRow": {
        "properties": {
          "actor_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Kind"
          },
          "actor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Name"
          },
          "cache_creation_input_tokens": {
            "title": "Cache Creation Input Tokens",
            "type": "integer"
          },
          "cache_read_input_tokens": {
            "title": "Cache Read Input Tokens",
            "type": "integer"
          },
          "input_tokens": {
            "title": "Input Tokens",
            "type": "integer"
          },
          "llm_calls": {
            "title": "Llm Calls",
            "type": "integer"
          },
          "output_tokens": {
            "title": "Output Tokens",
            "type": "integer"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          },
          "wall_ms": {
            "title": "Wall Ms",
            "type": "integer"
          }
        },
        "required": [
          "task_id",
          "session_id",
          "actor_kind",
          "actor_name",
          "input_tokens",
          "output_tokens",
          "cache_read_input_tokens",
          "cache_creation_input_tokens",
          "wall_ms",
          "llm_calls"
        ],
        "title": "UsageTopTaskRow",
        "type": "object"
      },
      "UsageTopTasksResponse": {
        "properties": {
          "period_end": {
            "format": "date",
            "title": "Period End",
            "type": "string"
          },
          "period_start": {
            "format": "date",
            "title": "Period Start",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/UsageTopTaskRow"
            },
            "title": "Rows",
            "type": "array"
          }
        },
        "required": [
          "project_id",
          "period_start",
          "period_end",
          "rows"
        ],
        "title": "UsageTopTasksResponse",
        "type": "object"
      },
      "UserOutcome": {
        "properties": {
          "feedback_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Feedback Text"
          },
          "rating": {
            "anyOf": [
              {
                "maximum": 5.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rating"
          },
          "submitted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted At"
          },
          "submitted_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted By"
          },
          "thumbs": {
            "anyOf": [
              {
                "enum": [
                  "up",
                  "down"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thumbs"
          }
        },
        "title": "UserOutcome",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WebSearchRequest": {
        "additionalProperties": false,
        "description": "Body of ``POST /v1/projects/{pid}/web_search``.\n\nMirrors trd-search-agent §2.1 task.start.inputs so the supervisor\ncan drop the body verbatim into ``state.search_inputs`` without\nre-mapping field names. ``extra=\"forbid\"`` because the WebSearch\ncontract is \"query in / results out\" — silently swallowing\ntypo'd field names would let bugs slip through (e.g. ``engine``\nvs ``engines`` would silently fall back to default).",
        "properties": {
          "engines": {
            "description": "Search engines to query. Cartesian product with `queries` is the search space. Default: ['tavily'] (rich snippets + synthesized `engine_answer`; requires `TAVILY_API_KEY` server-side). Pass ['ddg'] for the zero-cost fallback. Bing / Google are deferred per trd-search-agent §6.2.",
            "items": {
              "type": "string"
            },
            "maxItems": 8,
            "minItems": 1,
            "title": "Engines",
            "type": "array"
          },
          "freshness": {
            "anyOf": [
              {
                "enum": [
                  "month",
                  "year"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time-window filter. Engine adapter applies if supported.",
            "title": "Freshness"
          },
          "language": {
            "default": "en",
            "description": "Engine language code (e.g. `en`, `zh`).",
            "maxLength": 8,
            "minLength": 2,
            "title": "Language",
            "type": "string"
          },
          "max_results_per_query": {
            "default": 10,
            "description": "Max raw results from each (query, engine) pair before dedup.",
            "maximum": 50.0,
            "minimum": 1.0,
            "title": "Max Results Per Query",
            "type": "integer"
          },
          "objective": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional natural-language context that helps the engine interpret the queries (e.g. *'focus on parent-child trip scenarios'*). Engines that have an answer channel (Tavily) splice this into the wire-level query so the synthesised answer matches the user's intent; engines that don't (DDG) ignore it. Whitespace-only strings are treated as null.",
            "title": "Objective"
          },
          "queries": {
            "description": "One or more search queries. Multi-query tasks aggregate via dedup + RRF rerank (trd-search-agent §3.2).",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Queries",
            "type": "array"
          },
          "rerank": {
            "default": false,
            "description": "When true, run an LLM-based rerank on the dedup'd candidate pool (extra LLM cost). Default heuristic is RRF + domain authority + freshness — usually sufficient.",
            "title": "Rerank",
            "type": "boolean"
          },
          "site_blacklist": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "If set, exclude results from these domains.",
            "title": "Site Blacklist"
          },
          "site_whitelist": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "If set, restrict results to these domains. Each entry is a bare hostname (`reddit.com`); the engine adapter prepends the engine-specific `site:` operator.",
            "title": "Site Whitelist"
          },
          "summarize": {
            "default": false,
            "description": "When true, the supervisor's WRAP phase fans out TextifyAgent per result for a 1-3 sentence summary (extra LLM cost). Default false: caller gets raw `snippet` from the engine.",
            "title": "Summarize",
            "type": "boolean"
          }
        },
        "required": [
          "queries"
        ],
        "title": "WebSearchRequest",
        "type": "object"
      },
      "WebSearchResults": {
        "description": "The aggregated results payload — what\n``WebSearchSyncResponse.results`` and the supervisor's\n``state.search_results`` artifact carry.\n\nShape matches trd-search-agent §2.2 ``search_results.json``.",
        "properties": {
          "engine_answer": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per-engine LLM-synthesised summary of the SERP, keyed by engine name. Populated when an engine offers an answer channel (Tavily today via `include_answer=true`); other engines (DDG) contribute nothing. ``None`` when no engine surfaced an answer.",
            "title": "Engine Answer"
          },
          "is_summarized": {
            "default": false,
            "description": "True when every result has `summary` populated.",
            "title": "Is Summarized",
            "type": "boolean"
          },
          "queries": {
            "description": "Echoed back from the request for traceability.",
            "items": {
              "type": "string"
            },
            "title": "Queries",
            "type": "array"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            },
            "title": "Results",
            "type": "array"
          },
          "total_unique_results": {
            "description": "Count after dedup. Equals `len(results)`; surfaced explicitly so callers don't have to materialize the full list when they only care about the count.",
            "minimum": 0.0,
            "title": "Total Unique Results",
            "type": "integer"
          }
        },
        "required": [
          "queries",
          "total_unique_results"
        ],
        "title": "WebSearchResults",
        "type": "object"
      },
      "WebSearchTaskResponse": {
        "description": "Generic task response — used for:\n- ``POST wait=false`` 202 response (no results yet)\n- ``GET /tasks/{tid}`` task detail\n- ``POST wait=true`` 202 fallback when search exceeded the 30s\n  sync window\n\n``results`` is null until the task reaches ``status=\"done\"``;\nerror fields (``terminal_reason`` / ``error``) populate on\nfailed / canceled.",
        "properties": {
          "cost_usd": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total cost.",
            "title": "Cost Usd"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Elapsed wall-clock time from pending → terminal.",
            "title": "Duration Seconds"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable error message on failure.",
            "title": "Error"
          },
          "queries": {
            "items": {
              "type": "string"
            },
            "title": "Queries",
            "type": "array"
          },
          "results": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebSearchResults"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "pending",
              "running",
              "done",
              "failed",
              "canceled"
            ],
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          },
          "terminal_reason": {
            "anyOf": [
              {
                "enum": [
                  "done",
                  "failed",
                  "canceled",
                  "expired"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Terminal Reason"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "WebSearchTaskResponse",
        "type": "object"
      },
      "_BenchmarkRunCreate": {
        "properties": {
          "baseline_variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Variant"
          },
          "budget_usd": {
            "default": 50.0,
            "exclusiveMinimum": 0.0,
            "title": "Budget Usd",
            "type": "number"
          },
          "concurrency": {
            "default": 5,
            "exclusiveMinimum": 0.0,
            "maximum": 100.0,
            "title": "Concurrency",
            "type": "integer"
          },
          "custom_dataset_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Dataset Path"
          },
          "dataset": {
            "default": "webbench",
            "enum": [
              "webbench",
              "browsecomp",
              "custom"
            ],
            "title": "Dataset",
            "type": "string"
          },
          "enable_optimize": {
            "default": false,
            "title": "Enable Optimize",
            "type": "boolean"
          },
          "sample": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/_VariantConfig"
            },
            "minItems": 1,
            "title": "Variants",
            "type": "array"
          }
        },
        "required": [
          "variants"
        ],
        "title": "_BenchmarkRunCreate",
        "type": "object"
      },
      "_VariantConfig": {
        "description": "Wire-format for a Variant. Mirrors `supervisors.benchmark.Variant`\none-to-one so the supervisor's internal dataclass can evolve without\nbreaking this contract.",
        "properties": {
          "browser_profile": {
            "default": "default",
            "title": "Browser Profile",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "extra_kwargs": {
            "additionalProperties": true,
            "title": "Extra Kwargs",
            "type": "object"
          },
          "extra_tools": {
            "items": {
              "type": "string"
            },
            "title": "Extra Tools",
            "type": "array"
          },
          "max_steps": {
            "default": 50,
            "exclusiveMinimum": 0.0,
            "maximum": 500.0,
            "title": "Max Steps",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "name": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "title": "_VariantConfig",
        "type": "object"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "bearerFormat": "wa_token",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "WebAgent backend — admin/OpsConsole API + (later) /v1 user-facing API.",
    "title": "WebAgent Backend",
    "version": "local"
  },
  "openapi": "3.1.0",
  "paths": {
    "/admin/audit": {
      "get": {
        "operationId": "list_audit_admin_audit_get",
        "parameters": [
          {
            "in": "query",
            "name": "actor_email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Actor Email"
            }
          },
          {
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Action"
            }
          },
          {
            "in": "query",
            "name": "target_env",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Env"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Audit Admin Audit Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Audit",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/admin/auth/exchange": {
      "post": {
        "description": "Exchange the upstream SSO assertion for a `wao_` session token.\n\n- **prod**: validate the `CF-Access-Jwt-Assertion` header (issuer / audience\n  / signature checks delegated to Cloudflare-trusted JWT verification).\n  Resolved actor email → RBAC role from configured email lists.\n- **dev mode** (`ADMIN_DEV_MODE=true`, ENV must be dev): skip CF JWT,\n  use `ADMIN_DEV_ACTOR` + `ADMIN_DEV_ROLE`. Same `wao_` token shape so\n  downstream code paths are identical.",
        "operationId": "exchange_token_admin_auth_exchange_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Exchange Token Admin Auth Exchange Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Exchange Token",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/admin/auth/me": {
      "get": {
        "operationId": "me_admin_auth_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Me Admin Auth Me Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Me",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/admin/benchmark/datasets": {
      "get": {
        "description": "Datasets seeded into ``benchmark_dataset_cases`` with case totals.\n\n``passed`` / ``failed`` / ``untried`` partition the case set; their\nsum equals ``total``. ``attempts`` is the raw job count across all\nruns (one case can be attempted multiple times).",
        "operationId": "list_datasets_admin_benchmark_datasets_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Datasets Admin Benchmark Datasets Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Datasets",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/datasets/{dataset_name}/cases": {
      "get": {
        "description": "Per-case rollup for ``dataset_name``. Each row aggregates every\nhistorical attempt — the cases view's row payload.\n\nDefault sort: ``untried → failed → passed``, then most-recent-attempt\nfirst. Frontend depends on this ordering to put unfinished work on\ntop. Override with ``sort=case_asc`` / ``case_desc`` (numeric on\n``case_id``) or ``last_attempt_asc`` / ``last_attempt_desc`` (NULLs\nlast in both).",
        "operationId": "list_dataset_cases_admin_benchmark_datasets__dataset_name__cases_get",
        "parameters": [
          {
            "in": "path",
            "name": "dataset_name",
            "required": true,
            "schema": {
              "title": "Dataset Name",
              "type": "string"
            }
          },
          {
            "description": "untried | failed | passed (omit = all)",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "untried | failed | passed (omit = all)",
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "description": "default | case_asc | case_desc | last_attempt_asc | last_attempt_desc",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "default | case_asc | case_desc | last_attempt_asc | last_attempt_desc",
              "title": "Sort"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 1000,
              "maximum": 5000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Dataset Cases Admin Benchmark Datasets  Dataset Name  Cases Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Dataset Cases",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/datasets/{dataset_name}/cases/{case_id}": {
      "get": {
        "description": "Per-case attempt history — drill-in for a cases row.\n\nReturns the case meta + every job that ran against it, ordered\nnewest-first. Each attempt row pulls comparison-grade fields out of\n``config_snapshot`` (model / skills / max_steps / headless) so the\nUI can diff \"what changed between attempts\" without fetching each\njob separately.",
        "operationId": "get_dataset_case_admin_benchmark_datasets__dataset_name__cases__case_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "dataset_name",
            "required": true,
            "schema": {
              "title": "Dataset Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Dataset Case Admin Benchmark Datasets  Dataset Name  Cases  Case Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Dataset Case",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/jobs/{job_id}": {
      "get": {
        "operationId": "get_job_admin_benchmark_jobs__job_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Job Admin Benchmark Jobs  Job Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Job",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/jobs/{job_id}/evidence": {
      "get": {
        "description": "Evidence bundle the v2 grader judged from. Powers the OpsConsole\nEvidence tab — trd-benchmark §6.4 / §6.4.1.\n\nAggregates four channels into one payload:\n  - terminal URL (``benchmark_jobs.final_url``)\n  - terminal DOM excerpt (``benchmark_jobs.final_dom_excerpt``)\n  - downloads — every ``download_file`` artifact attached to any\n    step of the job, with the metadata bag (name, sha256, source\n    URL, size_bytes) that survived from the listener\n  - parsed grader verdict — JSON parse of ``grader_raw`` so the UI\n    can render ``criteria_met`` / ``criteria_missed`` /\n    ``evidence_disagreement`` directly. ``grader_raw`` itself is\n    also returned for raw inspection.",
        "operationId": "get_job_evidence_admin_benchmark_jobs__job_id__evidence_get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Job Evidence Admin Benchmark Jobs  Job Id  Evidence Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Job Evidence",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/jobs/{job_id}/steps": {
      "get": {
        "operationId": "list_steps_admin_benchmark_jobs__job_id__steps_get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Steps Admin Benchmark Jobs  Job Id  Steps Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Steps",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/options": {
      "get": {
        "description": "Static config drop-downs for the Ops Compare form — model list +\nregistered skill names. Skill list is pulled live from the registry\nso adding a skill in `agents/skills/builtin/` shows up without an\nOps redeploy.",
        "operationId": "get_options_admin_benchmark_options_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Options Admin Benchmark Options Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Options",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/runs": {
      "get": {
        "description": "Paginated runs list — newest first.",
        "operationId": "list_runs_admin_benchmark_runs_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "description": "cli / ci / supervisor_api",
            "in": "query",
            "name": "triggered_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "cli / ci / supervisor_api",
              "title": "Triggered By"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Runs Admin Benchmark Runs Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Runs",
        "tags": [
          "admin:benchmark"
        ]
      },
      "post": {
        "description": "Kick off a new benchmark run. Triggers a durable workflow.",
        "operationId": "create_run_admin_benchmark_runs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/_BenchmarkRunCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Run Admin Benchmark Runs Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Run",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/runs/{run_id}": {
      "get": {
        "operationId": "get_run_admin_benchmark_runs__run_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Run Admin Benchmark Runs  Run Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Run",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/runs/{run_id}/cancel": {
      "post": {
        "description": "Request cancellation. Activity re-checks the persisted flag at\nevery phase boundary, so the cancel propagates even if the worker is\noffline / signal lost.",
        "operationId": "cancel_run_admin_benchmark_runs__run_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cancel Run Admin Benchmark Runs  Run Id  Cancel Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Run",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/steps/{step_id}/actions": {
      "get": {
        "description": "Actions tab data for a step. Returned in execution order.",
        "operationId": "list_actions_admin_benchmark_steps__step_id__actions_get",
        "parameters": [
          {
            "in": "path",
            "name": "step_id",
            "required": true,
            "schema": {
              "title": "Step Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Actions Admin Benchmark Steps  Step Id  Actions Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Actions",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/benchmark/steps/{step_id}/artifacts/{artifact_type}": {
      "get": {
        "description": "Per-step artifact pull. Each entry includes a presigned S3 URL\nso the UI can ``GET`` the body directly without proxying through us.",
        "operationId": "list_step_artifacts_admin_benchmark_steps__step_id__artifacts__artifact_type__get",
        "parameters": [
          {
            "in": "path",
            "name": "step_id",
            "required": true,
            "schema": {
              "title": "Step Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "artifact_type",
            "required": true,
            "schema": {
              "title": "Artifact Type",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "presign_ttl",
            "required": false,
            "schema": {
              "default": 900,
              "maximum": 86400,
              "minimum": 60,
              "title": "Presign Ttl",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Step Artifacts Admin Benchmark Steps  Step Id  Artifacts  Artifact Type  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Step Artifacts",
        "tags": [
          "admin:benchmark"
        ]
      }
    },
    "/admin/bug_reports": {
      "get": {
        "operationId": "list_bug_reports_admin_bug_reports_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "submitted",
                    "in_progress",
                    "resolved",
                    "wontfix"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Bug Reports Admin Bug Reports Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Bug Reports",
        "tags": [
          "admin:bug_reports"
        ]
      }
    },
    "/admin/bug_reports/{report_id}": {
      "patch": {
        "operationId": "update_bug_report_admin_bug_reports__report_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBugReportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Update Bug Report Admin Bug Reports  Report Id  Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Bug Report",
        "tags": [
          "admin:bug_reports"
        ]
      }
    },
    "/admin/dashboard": {
      "get": {
        "operationId": "dashboard_admin_dashboard_get",
        "parameters": [
          {
            "description": "Target env (dev/testing/staging/prod)",
            "in": "query",
            "name": "env",
            "required": false,
            "schema": {
              "default": "dev",
              "description": "Target env (dev/testing/staging/prod)",
              "title": "Env",
              "type": "string"
            }
          },
          {
            "description": "Bypass the ServiceMonitor cache and re-probe immediately. UI sets this on initial page load and explicit refresh-button clicks.",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "description": "Bypass the ServiceMonitor cache and re-probe immediately. UI sets this on initial page load and explicit refresh-button clicks.",
              "title": "Force",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Dashboard Admin Dashboard Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Dashboard",
        "tags": [
          "admin:dashboard"
        ]
      }
    },
    "/admin/deploy": {
      "post": {
        "operationId": "trigger_deploy_admin_deploy_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Trigger Deploy Admin Deploy Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Deploy",
        "tags": [
          "admin:deploy"
        ]
      }
    },
    "/admin/deploy/{deploy_id}/stream": {
      "get": {
        "operationId": "deploy_stream_admin_deploy__deploy_id__stream_get",
        "parameters": [
          {
            "in": "path",
            "name": "deploy_id",
            "required": true,
            "schema": {
              "title": "Deploy Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deploy Stream",
        "tags": [
          "admin:deploy"
        ]
      }
    },
    "/admin/deployments": {
      "get": {
        "operationId": "list_deployments_admin_deployments_get",
        "parameters": [
          {
            "in": "query",
            "name": "env",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Env"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Deployments Admin Deployments Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Deployments",
        "tags": [
          "admin:deploy"
        ]
      }
    },
    "/admin/dynamic-config": {
      "get": {
        "operationId": "list_dynamic_config_admin_dynamic_config_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Dynamic Config Admin Dynamic Config Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Dynamic Config",
        "tags": [
          "admin:dynamic-config"
        ]
      },
      "patch": {
        "description": "Body: `{\"key\": \"<entry-key>\", \"value\": <typed-value>}`.\n\nOperator role is the broad floor; entries whose schema declares\n`requires_role=\"admin\"` are checked extra below.",
        "operationId": "patch_dynamic_config_admin_dynamic_config_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Patch Dynamic Config Admin Dynamic Config Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Dynamic Config",
        "tags": [
          "admin:dynamic-config"
        ]
      }
    },
    "/admin/env": {
      "get": {
        "operationId": "list_env_admin_env_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Env Admin Env Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Env",
        "tags": [
          "admin:env"
        ]
      },
      "patch": {
        "operationId": "patch_env_admin_env_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Patch Env Admin Env Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch Env",
        "tags": [
          "admin:env"
        ]
      }
    },
    "/admin/inspect/browsers": {
      "get": {
        "operationId": "list_browsers_admin_inspect_browsers_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider"
            }
          },
          {
            "in": "query",
            "name": "session_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Session Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Browsers Admin Inspect Browsers Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Browsers",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/inspect/browsers/{instance_id}": {
      "get": {
        "operationId": "get_browser_admin_inspect_browsers__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Browser Admin Inspect Browsers  Instance Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Browser",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/inspect/sessions": {
      "get": {
        "operationId": "list_sessions_admin_inspect_sessions_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Project Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Sessions Admin Inspect Sessions Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Sessions",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/inspect/sessions/{session_id}": {
      "get": {
        "operationId": "get_session_admin_inspect_sessions__session_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Session Admin Inspect Sessions  Session Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Session",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/inspect/sessions/{session_id}/timeline": {
      "get": {
        "description": "Session-scoped chronological timeline: every event + message under\nevery task in this session, merged ascending by timestamp. Plus per-task\nheaders (with computed Temporal workflow_id) so the UI can render an\n\"ID map\" without a second round-trip.",
        "operationId": "get_session_timeline_admin_inspect_sessions__session_id__timeline_get",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 1000,
              "maximum": 5000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Session Timeline Admin Inspect Sessions  Session Id  Timeline Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Session Timeline",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/inspect/tasks": {
      "get": {
        "operationId": "list_tasks_admin_inspect_tasks_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "session_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Session Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Tasks Admin Inspect Tasks Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tasks",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/inspect/tasks/{task_id}": {
      "get": {
        "operationId": "get_task_admin_inspect_tasks__task_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Task Admin Inspect Tasks  Task Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Task",
        "tags": [
          "admin:inspect"
        ]
      }
    },
    "/admin/panic": {
      "post": {
        "operationId": "trigger_panic_admin_panic_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Trigger Panic Admin Panic Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Panic",
        "tags": [
          "admin:panic"
        ]
      }
    },
    "/admin/plans": {
      "get": {
        "description": "Plan catalog (free / developer / pro / business / enterprise) for\nthe dropdown the operator picks from. Active plans only, sorted by\n``sort_order`` so the UI shows the canonical free→enterprise order.",
        "operationId": "list_plans_admin_plans_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Plans Admin Plans Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Plans",
        "tags": [
          "admin:tenants"
        ]
      }
    },
    "/admin/rollback": {
      "post": {
        "operationId": "trigger_rollback_admin_rollback_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Trigger Rollback Admin Rollback Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Rollback",
        "tags": [
          "admin:deploy"
        ]
      }
    },
    "/admin/tenants": {
      "get": {
        "description": "List tenants with their current plan + owner email. Substring\nmatching is case-insensitive on tenant id, tenant name, and the\npersonal-tenant owner's email — enough for operators to find a test\naccount by typing the user's address.",
        "operationId": "list_tenants_admin_tenants_get",
        "parameters": [
          {
            "description": "substring filter on email / name / tenant id",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "substring filter on email / name / tenant id",
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Tenants Admin Tenants Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenants",
        "tags": [
          "admin:tenants"
        ]
      }
    },
    "/admin/tenants/{tenant_id}/credits": {
      "post": {
        "description": "Manual Credits adjustment via the OpsConsole.\n\nWrites one ``credit_ledger`` row with kind=``manual_adjust``. Sign of\n``delta_credits`` matters: positive grants, negative debits. Bucket\nmust be ``monthly`` or ``additional`` — admission gate sums both.\n\nBody:\n  - ``bucket`` (required) — ``monthly`` | ``additional``.\n  - ``delta_credits`` (required, non-zero int) — amount to grant /\n    deduct. UI typically sends positive integers; negative is\n    allowed for clawbacks.\n  - ``reason`` (required, non-empty) — recorded in audit + ledger.",
        "operationId": "grant_tenant_credits_admin_tenants__tenant_id__credits_post",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Grant Tenant Credits Admin Tenants  Tenant Id  Credits Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant Tenant Credits",
        "tags": [
          "admin:tenants"
        ]
      }
    },
    "/admin/tenants/{tenant_id}/plan": {
      "post": {
        "description": "Upsert ``tenant_subscriptions.plan_id`` for a tenant.\n\nNo Stripe round-trip — this is the manual override path for internal\ntest accounts. If the tenant has no subscription row yet (just\nregistered, never made a request to trigger admission's\nauto-provision), inserts one with status='active' and a 30-day\nperiod anchor.\n\nBody:\n  - ``plan_id`` (required) — must reference an existing row in ``plans``.\n  - ``reason`` (required, non-empty) — free-text recorded in the audit row.",
        "operationId": "set_tenant_plan_admin_tenants__tenant_id__plan_post",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Set Tenant Plan Admin Tenants  Tenant Id  Plan Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Tenant Plan",
        "tags": [
          "admin:tenants"
        ]
      }
    },
    "/admin/tenants/{tenant_id}/users": {
      "get": {
        "description": "Members of one tenant — with each member's auth_identity email so\nthe operator can flip the role of a known person without juggling\nuser_id strings.",
        "operationId": "list_tenant_users_admin_tenants__tenant_id__users_get",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Tenant Users Admin Tenants  Tenant Id  Users Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Users",
        "tags": [
          "admin:tenants"
        ]
      }
    },
    "/admin/tenants/{tenant_id}/users/{user_id}/role": {
      "patch": {
        "description": "Flip ``users.role`` for one tenant member.\n\nBody:\n  - ``role`` (required) — ``admin`` or ``member`` (matches the DB\n    CHECK constraint on ``users.role``).\n  - ``reason`` (required, non-empty) — recorded in the audit row.",
        "operationId": "set_tenant_user_role_admin_tenants__tenant_id__users__user_id__role_patch",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Set Tenant User Role Admin Tenants  Tenant Id  Users  User Id  Role Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Tenant User Role",
        "tags": [
          "admin:tenants"
        ]
      }
    },
    "/admin/unpanic": {
      "post": {
        "operationId": "trigger_unpanic_admin_unpanic_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Trigger Unpanic Admin Unpanic Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Unpanic",
        "tags": [
          "admin:panic"
        ]
      }
    },
    "/healthz": {
      "get": {
        "operationId": "healthz_healthz_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Healthz Healthz Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Healthz"
      }
    },
    "/readyz": {
      "get": {
        "operationId": "readyz_readyz_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Readyz Readyz Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Readyz"
      }
    },
    "/v1/_ping": {
      "get": {
        "operationId": "ping_v1__ping_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Ping V1  Ping Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Ping",
        "tags": [
          "v1"
        ]
      }
    },
    "/v1/auth/login": {
      "post": {
        "operationId": "login_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Login",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/auth/logout": {
      "post": {
        "description": "Invalidate the cookie + the server-side session row.\n\nIdempotent: a logged-out user calling logout still returns 204.\nDoesn't use ``require_auth_identity`` because logout-without-cookie\nmust succeed too (browser cache state can drift; we always honour\n\"user wants out\").",
        "operationId": "logout_v1_auth_logout_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Logout",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/auth/password": {
      "post": {
        "operationId": "change_password_v1_auth_password_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Change Password",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/auth/providers": {
      "get": {
        "description": "Enumerate enabled SSO providers — used by the login UI to\nrender 'Sign in with X' buttons. Empty list = no SSO configured,\nUI hides the buttons entirely.",
        "operationId": "list_sso_providers_v1_auth_providers_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvidersResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Sso Providers",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/auth/signup": {
      "post": {
        "operationId": "signup_v1_auth_signup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Signup",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/auth/sso/{provider_id}/callback": {
      "get": {
        "description": "Step 2 — provider sent the user back. Verify state, exchange\ncode, find-or-register the identity, mint a session cookie, and\nredirect into the Console.\n\nFailure modes (each → ``302`` to ``/login?error=<code>`` so the user\nsees something instead of a JSON dump):\n\n- ``error`` set in the redirect (user canceled at provider)\n- state HMAC / freshness / cookie mismatch\n- provider returns no code / token endpoint fails\n- email already bound to a different provider (provider_mismatch)",
        "operationId": "sso_callback_v1_auth_sso__provider_id__callback_get",
        "parameters": [
          {
            "in": "path",
            "name": "provider_id",
            "required": true,
            "schema": {
              "title": "Provider Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "code",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Error"
            }
          },
          {
            "in": "cookie",
            "name": "wa_oidc_state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Oidc State"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sso Callback",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/auth/sso/{provider_id}/start": {
      "get": {
        "description": "Step 1 of the OIDC dance — mint a signed state, set it as a\nHttpOnly cookie, then 302 to the provider's authorize endpoint.\n\nThe cookie is the second half of the CSRF check on callback: the\nstate value comes back via the URL (under attacker control if\nthey can craft a request), but the cookie only travels with\nthe same browser session that initiated the start request.",
        "operationId": "sso_start_v1_auth_sso__provider_id__start_get",
        "parameters": [
          {
            "in": "path",
            "name": "provider_id",
            "required": true,
            "schema": {
              "title": "Provider Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "next",
            "required": false,
            "schema": {
              "default": "/sessions",
              "title": "Next",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sso Start",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/deep_research": {
      "post": {
        "description": "Create a new research task. Returns 202 + the task envelope.\n\nThe supervisor starts asynchronously; clients subscribe to SSE on\n``/tasks/{tid}/events`` or wait for the webhook (``callback_url``).",
        "operationId": "create_research_v1_deep_research_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateResearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Research",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}": {
      "get": {
        "operationId": "get_research_task_v1_deep_research_tasks__tid__get",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Research Task",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/artifacts": {
      "get": {
        "description": "List artifacts associated with a research task. Mirrors PRD §2.2\nend-point set (``GET /tasks/{tid}/artifacts``).\n\nCurrently returns ``items: []`` until Agent C wires the artifact\nrepo through. Schema is stable.",
        "operationId": "list_research_artifacts_v1_deep_research_tasks__tid__artifacts_get",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Research Artifacts V1 Deep Research Tasks  Tid  Artifacts Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Research Artifacts",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/artifacts/{aid}": {
      "get": {
        "description": "Download a single artifact's body. Returns 404 until Agent C's\nartifact storage lands.",
        "operationId": "get_research_artifact_v1_deep_research_tasks__tid__artifacts__aid__get",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "aid",
            "required": true,
            "schema": {
              "title": "Aid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Research Artifact",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/cancel": {
      "post": {
        "operationId": "cancel_research_v1_deep_research_tasks__tid__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Research",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/events": {
      "get": {
        "description": "SSE event stream for a research task. Reuses the DoAnything\nhandler internals so the envelope / heartbeat / resume contract is\nidentical (TRD §7.1).",
        "operationId": "stream_research_events_v1_deep_research_tasks__tid__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Stream Research Events",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/feedback": {
      "post": {
        "operationId": "post_research_feedback_v1_deep_research_tasks__tid__feedback_post",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResearchFeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Post Research Feedback",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/intervene": {
      "post": {
        "description": "Respond to the outline gate (approve / approve_with_edits /\nreject). The supervisor consumes the response via the inflight\nqueue and resumes Plan→Gather (TRD §6.4).",
        "operationId": "intervene_research_v1_deep_research_tasks__tid__intervene_post",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResearchInterveneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Intervene Research",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/deep_research/tasks/{tid}/messages": {
      "post": {
        "description": "Follow-up text — Phase-1 MVP only supports done-task follow-up\n(PRD §6 decision). In-flight follow-up returns 409.",
        "operationId": "post_research_followup_v1_deep_research_tasks__tid__messages_post",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResearchFollowupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Post Research Followup",
        "tags": [
          "v1",
          "deep_research"
        ]
      }
    },
    "/v1/invitations/accept": {
      "post": {
        "description": "Accept an invitation token while logged in.\n\nThe accepting identity's email must match the invitation's email — TRD\n§4.4. Mismatched email returns 422 ``invitation_email_mismatch`` so\nthe Console can show \"this invite is for X — sign in as that user\".",
        "operationId": "accept_invitation_v1_invitations_accept_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Accept Invitation",
        "tags": [
          "v1",
          "invitations"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "me_v1_me_get",
        "parameters": [
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Me",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/v1/projects/{pid}/api_keys": {
      "get": {
        "operationId": "list_api_keys_v1_projects__pid__api_keys_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "include_disabled",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Disabled",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Api Keys",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "post": {
        "operationId": "create_api_key_v1_projects__pid__api_keys_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreatedResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Api Key",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/api_keys/{key_id}": {
      "delete": {
        "description": "Soft-delete with 60-min grace (TRD §14). Returns the disabled row\nso callers can see when the grace window ends. Member can only\ndisable own keys; admin can disable any.",
        "operationId": "disable_api_key_v1_projects__pid__api_keys__key_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Disable Api Key",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/billing/account": {
      "get": {
        "description": "Aggregate session-level cost columns for the billing summary.\n\nReal per-period rollover lives in the commercialisation surface when\ninvoices and credit ledgers join the schema (TRD-do-anything §6).",
        "operationId": "get_billing_account_v1_projects__pid__billing_account_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingAccountResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Billing Account",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/bug_reports": {
      "get": {
        "operationId": "list_bug_reports_v1_projects__pid__bug_reports_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BugReportListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Bug Reports",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "post": {
        "operationId": "create_bug_report_v1_projects__pid__bug_reports_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBugReportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BugReportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Bug Report",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions": {
      "get": {
        "operationId": "list_sessions_v1_projects__pid__do_anything_sessions_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Sessions",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "post": {
        "operationId": "create_session_v1_projects__pid__do_anything_sessions_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Session",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}": {
      "delete": {
        "operationId": "delete_session_v1_projects__pid__do_anything_sessions__sid__delete",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Session",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "get": {
        "operationId": "get_session_v1_projects__pid__do_anything_sessions__sid__get",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Session",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/recording": {
      "get": {
        "operationId": "get_session_recording_v1_projects__pid__do_anything_sessions__sid__recording_get",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Session Recording",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/stop": {
      "post": {
        "operationId": "stop_session_v1_projects__pid__do_anything_sessions__sid__stop_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/StopSessionRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Stop Session",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks": {
      "post": {
        "operationId": "create_task_v1_projects__pid__do_anything_sessions__sid__tasks_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFollowUpTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Task V1 Projects  Pid  Do Anything Sessions  Sid  Tasks Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Task",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}": {
      "get": {
        "operationId": "get_task_v1_projects__pid__do_anything_sessions__sid__tasks__tid__get",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Task V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Task",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/cancel": {
      "post": {
        "operationId": "cancel_task_v1_projects__pid__do_anything_sessions__sid__tasks__tid__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CancelTaskRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cancel Task V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Cancel Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Task",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/events": {
      "get": {
        "operationId": "stream_events_v1_projects__pid__do_anything_sessions__sid__tasks__tid__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Stream Events",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/feedback": {
      "post": {
        "operationId": "feedback_v1_projects__pid__do_anything_sessions__sid__tasks__tid__feedback_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Feedback V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Feedback Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Feedback",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/intervene": {
      "post": {
        "operationId": "intervene_v1_projects__pid__do_anything_sessions__sid__tasks__tid__intervene_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "discriminator": {
                  "mapping": {
                    "answer_input_request": "#/components/schemas/AnswerInputRequest",
                    "release_control": "#/components/schemas/ReleaseControlRequest",
                    "take_control": "#/components/schemas/TakeControlRequest"
                  },
                  "propertyName": "kind"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AnswerInputRequest"
                  },
                  {
                    "$ref": "#/components/schemas/TakeControlRequest"
                  },
                  {
                    "$ref": "#/components/schemas/ReleaseControlRequest"
                  }
                ],
                "title": "Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Intervene V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Intervene Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Intervene",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/messages": {
      "get": {
        "operationId": "list_messages_v1_projects__pid__do_anything_sessions__sid__tasks__tid__messages_get",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 200,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Messages V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Messages Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Messages",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "post": {
        "operationId": "send_message_v1_projects__pid__do_anything_sessions__sid__tasks__tid__messages_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Send Message V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Messages Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Send Message",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/pause": {
      "post": {
        "description": "Move RUNNING → WAITING(user_paused) — TRD-do-anything §6.7.",
        "operationId": "pause_task_v1_projects__pid__do_anything_sessions__sid__tasks__tid__pause_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Pause Task V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Pause Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Pause Task",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/do_anything/sessions/{sid}/tasks/{tid}/resume": {
      "post": {
        "description": "Move WAITING(user_paused) → RUNNING — TRD-do-anything §6.7.",
        "operationId": "resume_task_v1_projects__pid__do_anything_sessions__sid__tasks__tid__resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Resume Task V1 Projects  Pid  Do Anything Sessions  Sid  Tasks  Tid  Resume Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resume Task",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/invitations": {
      "get": {
        "operationId": "list_invitations_v1_projects__pid__invitations_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Invitations",
        "tags": [
          "v1",
          "invitations"
        ]
      }
    },
    "/v1/projects/{pid}/invitations/{invitation_id}/revoke": {
      "post": {
        "operationId": "revoke_invitation_v1_projects__pid__invitations__invitation_id__revoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "title": "Invitation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Invitation",
        "tags": [
          "v1",
          "invitations"
        ]
      }
    },
    "/v1/projects/{pid}/members": {
      "get": {
        "operationId": "list_members_v1_projects__pid__members_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Members",
        "tags": [
          "v1",
          "members"
        ]
      }
    },
    "/v1/projects/{pid}/members/invite": {
      "post": {
        "operationId": "invite_member_v1_projects__pid__members_invite_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Invite Member",
        "tags": [
          "v1",
          "members"
        ]
      }
    },
    "/v1/projects/{pid}/members/{user_id}": {
      "delete": {
        "operationId": "delete_member_v1_projects__pid__members__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Member",
        "tags": [
          "v1",
          "members"
        ]
      },
      "patch": {
        "operationId": "update_member_v1_projects__pid__members__user_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Member",
        "tags": [
          "v1",
          "members"
        ]
      }
    },
    "/v1/projects/{pid}/profiles": {
      "get": {
        "operationId": "list_profiles_v1_projects__pid__profiles_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Profiles",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "post": {
        "operationId": "create_profile_v1_projects__pid__profiles_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Profile",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/profiles/{profile_id}": {
      "delete": {
        "operationId": "delete_profile_v1_projects__pid__profiles__profile_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Profile",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "get": {
        "operationId": "get_profile_v1_projects__pid__profiles__profile_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Profile",
        "tags": [
          "v1",
          "do_anything"
        ]
      },
      "patch": {
        "operationId": "update_profile_v1_projects__pid__profiles__profile_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Profile",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors": {
      "get": {
        "operationId": "list_monitors_v1_projects__pid__track_monitors_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 10000,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Pagesize",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "notify_channel_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Notify Channel Kind"
            }
          },
          {
            "in": "query",
            "name": "profile_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Profile Id"
            }
          },
          {
            "in": "query",
            "name": "created_after",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created After"
            }
          },
          {
            "in": "query",
            "name": "created_before",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created Before"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Sort"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Monitors",
        "tags": [
          "v1",
          "track"
        ]
      },
      "post": {
        "operationId": "create_monitor_v1_projects__pid__track_monitors_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMonitorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateMonitorResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Monitor",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}": {
      "delete": {
        "operationId": "delete_monitor_v1_projects__pid__track_monitors__mid__delete",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Monitor",
        "tags": [
          "v1",
          "track"
        ]
      },
      "get": {
        "operationId": "get_monitor_v1_projects__pid__track_monitors__mid__get",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Monitor",
        "tags": [
          "v1",
          "track"
        ]
      },
      "patch": {
        "operationId": "patch_monitor_v1_projects__pid__track_monitors__mid__patch",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchMonitorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Patch Monitor",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/deliveries": {
      "get": {
        "description": "List the most recent webhook delivery rows. Console's\n\"Notify deliveries\" pane reads from this; SDK consumers can pass\n``?include=payload`` to also receive the full webhook body.",
        "operationId": "list_monitor_deliveries_v1_projects__pid__track_monitors__mid__deliveries_get",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Include"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Monitor Deliveries V1 Projects  Pid  Track Monitors  Mid  Deliveries Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Monitor Deliveries",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/deliveries/{outbox_id}/retry": {
      "post": {
        "description": "Reset an outbox row to ``status=pending, attempts=0``. The\nbackground worker picks it up on the next 5s poll. Useful for\ncustomers who've fixed their webhook endpoint and want to drain\naccumulated dead rows without waiting for backoff.",
        "operationId": "retry_monitor_delivery_v1_projects__pid__track_monitors__mid__deliveries__outbox_id__retry_post",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "outbox_id",
            "required": true,
            "schema": {
              "title": "Outbox Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Retry Monitor Delivery V1 Projects  Pid  Track Monitors  Mid  Deliveries  Outbox Id  Retry Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Retry Monitor Delivery",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/events": {
      "get": {
        "operationId": "stream_events_v1_projects__pid__track_monitors__mid__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Stream Events",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/intervene": {
      "post": {
        "operationId": "post_intervene_v1_projects__pid__track_monitors__mid__intervene_post",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonitorInterveneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Post Intervene",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/messages": {
      "post": {
        "operationId": "post_message_v1_projects__pid__track_monitors__mid__messages_post",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageMonitorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Post Message",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/run_now": {
      "post": {
        "description": "Kick a single execution synchronously (bypassing schedule).\nMonitor must be ``active``; otherwise 409.",
        "operationId": "run_now_v1_projects__pid__track_monitors__mid__run_now_post",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Run Now V1 Projects  Pid  Track Monitors  Mid  Run Now Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Run Now",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/simulate_event": {
      "post": {
        "description": "Append a forged ``monitor.triggered`` event marked\n``simulated: true`` so the user can verify webhook plumbing /\nConsole SSE / client payload parsing without waiting for a real\nchange to fire.",
        "operationId": "simulate_event_v1_projects__pid__track_monitors__mid__simulate_event_post",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Simulate Event V1 Projects  Pid  Track Monitors  Mid  Simulate Event Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Simulate Event",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/snapshots": {
      "get": {
        "description": "Return per-tick snapshots (state / extracted / diffs / notify\nresponse) so the Console can show 'Executions' history. Newest\nfirst (tick_n DESC). Includes failed and canceled ticks too — the\nConsole filters / styles by ``state``.",
        "operationId": "list_monitor_snapshots_v1_projects__pid__track_monitors__mid__snapshots_get",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 10000,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Pagesize",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Monitor Snapshots V1 Projects  Pid  Track Monitors  Mid  Snapshots Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Monitor Snapshots",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/track/monitors/{mid}/snapshots/{sid}": {
      "get": {
        "operationId": "get_monitor_snapshot_v1_projects__pid__track_monitors__mid__snapshots__sid__get",
        "parameters": [
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "title": "Mid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sid",
            "required": true,
            "schema": {
              "title": "Sid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Monitor Snapshot V1 Projects  Pid  Track Monitors  Mid  Snapshots  Sid  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Monitor Snapshot",
        "tags": [
          "v1",
          "track"
        ]
      }
    },
    "/v1/projects/{pid}/usage/quota_status": {
      "get": {
        "description": "Return plan limits + current running counts + Credits balance.\n\nAll numbers come from the same source as the admission gate so\n`running >= cap` here means the next ``POST /sessions`` will get a\n429. See trd-pricing §5 / trd-tenancy §7.",
        "operationId": "quota_status_v1_projects__pid__usage_quota_status_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Quota Status",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/usage/summary": {
      "get": {
        "description": "Token + wall_ms rollup across viewer-scoped events in this period.\n\nSources from `usage_events` filtered by `ts >= period_start`, so the\nnumbers reflect calls that *happened* this billing period — not\nlifetime totals on sessions created any time in the past.",
        "operationId": "get_usage_summary_v1_projects__pid__usage_summary_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Usage Summary",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/usage/timeseries": {
      "get": {
        "description": "Daily rollup of `usage_events` for the project, last N days.\n\nBacked by `usage_events` directly (not `sessions.total_*`) so each\nbucket reflects the day the call actually happened, not the day the\nowning task was created.",
        "operationId": "get_usage_timeseries_v1_projects__pid__usage_timeseries_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 180,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageTimeseriesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Usage Timeseries",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/usage/top_tasks": {
      "get": {
        "description": "Top N tasks by total tokens (input+output+cache) over last N days.",
        "operationId": "get_usage_top_tasks_v1_projects__pid__usage_top_tasks_get",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 180,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageTopTasksResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Usage Top Tasks",
        "tags": [
          "v1",
          "do_anything"
        ]
      }
    },
    "/v1/projects/{pid}/web_search": {
      "post": {
        "operationId": "create_web_search_v1_projects__pid__web_search_post",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "description": "Block until done (≤30s) or return 202 immediately.",
            "in": "query",
            "name": "wait",
            "required": false,
            "schema": {
              "default": true,
              "description": "Block until done (≤30s) or return 202 immediately.",
              "title": "Wait",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Web Search",
        "tags": [
          "v1",
          "web_search"
        ]
      }
    },
    "/v1/projects/{pid}/web_search/tasks/{tid}": {
      "get": {
        "operationId": "get_task_v1_projects__pid__web_search_tasks__tid__get",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Task",
        "tags": [
          "v1",
          "web_search"
        ]
      }
    },
    "/v1/projects/{pid}/web_search/tasks/{tid}/cancel": {
      "post": {
        "operationId": "cancel_task_v1_projects__pid__web_search_tasks__tid__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CancelTaskRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchTaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Task",
        "tags": [
          "v1",
          "web_search"
        ]
      }
    },
    "/v1/projects/{pid}/web_search/tasks/{tid}/events": {
      "get": {
        "operationId": "stream_events_v1_projects__pid__web_search_tasks__tid__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Stream Events",
        "tags": [
          "v1",
          "web_search"
        ]
      }
    },
    "/v1/projects/{pid}/web_search/tasks/{tid}/messages": {
      "post": {
        "description": "Inflight refine — trd-web-search §4.3 / prd §2.3.\n\nThe client sends either a natural-language refinement (`text`) or an\nexplicit replacement query list (`queries`). The supervisor reopens\nthe task, mutates ``state.search_inputs.queries`` accordingly, and\nre-runs Phase 0. The actual queue-side mutation lives in the\nsupervisor / worker; this route just hands the message to\n``SessionService.send_message`` over the same inflight channel\nDoAnything uses.\n\nBody is serialized as JSON into the message ``content`` so the\nsupervisor sees both shapes (text / queries) without a second\ncontract layer. ``kind`` is fixed to ``user_clarification``.",
        "operationId": "send_refine_message_v1_projects__pid__web_search_tasks__tid__messages_post",
        "parameters": [
          {
            "in": "path",
            "name": "tid",
            "required": true,
            "schema": {
              "title": "Tid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "title": "Pid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Tenant-Id"
            }
          },
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefineSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Send Refine Message V1 Projects  Pid  Web Search Tasks  Tid  Messages Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Send Refine Message",
        "tags": [
          "v1",
          "web_search"
        ]
      }
    },
    "/v1/tenants": {
      "post": {
        "operationId": "create_tenant_v1_tenants_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "wa_session",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Wa Session"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTenantResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Tenant",
        "tags": [
          "v1",
          "auth"
        ]
      }
    },
    "/version": {
      "get": {
        "operationId": "version_version_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Version Version Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Version"
      }
    }
  },
  "tags": []
}
