{
  "openapi": "3.1.0",
  "info": {
    "title": "Agent Codex guarded browser API",
    "version": "0.1.0",
    "description": "Implemented same-origin browser contract. Real Passport sign-in and authenticated notebook round-trip remain unverified. Not an API-key or remote-agent login. Production remote MCP/OAuth is disabled and intentionally has no operations here. See /skill.md and /docs-manifest.json on the product website."
  },
  "servers": [
    {
      "url": "https://app.agentcodex.io",
      "description": "Controlled browser origin, not the docs origin. Do not add /v1."
    }
  ],
  "tags": [
    {
      "name": "Health"
    },
    {
      "name": "Browser authentication"
    },
    {
      "name": "Entries"
    }
  ],
  "security": [],
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Read runtime construction status, not auth/readiness",
        "tags": [
          "Health"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Configured shell status only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method; Allow: GET, HEAD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passport/begin": {
      "post": {
        "operationId": "beginPassport",
        "summary": "Begin original-browser challenge",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BeginResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passport/callback": {
      "post": {
        "operationId": "receivePassport",
        "summary": "Receive approved direct Passport delivery",
        "tags": [
          "Browser authentication"
        ],
        "description": "Approved server-to-server direct Passport delivery only. Not token-paste login or a notebook bearer exchange.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallbackInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallbackResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passport/status": {
      "post": {
        "operationId": "passportStatus",
        "summary": "Read and display arrived identity",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Nonce"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChallengeStatus"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passport/confirm": {
      "post": {
        "operationId": "confirmPassport",
        "summary": "Confirm displayed identity and one-time code",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/passport/cancel": {
      "post": {
        "operationId": "cancelPassport",
        "summary": "Cancel original challenge",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Nonce"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cancelled"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/session": {
      "get": {
        "operationId": "browserSession",
        "summary": "Bootstrap browser session and CSRF token",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option. HttpOnly cookie is optional: absent/malformed/duplicate/oversized gives anonymous; a well-formed but unknown/revoked/expired token gives 401. An Origin header, if supplied, must match.",
        "security": [],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "logout",
        "summary": "Revoke current browser session",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": [],
            "Csrf": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoutResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout-all": {
      "post": {
        "operationId": "logoutAll",
        "summary": "Revoke all current browser sessions for this identity",
        "tags": [
          "Browser authentication"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": [],
            "Csrf": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoutAllResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/entries": {
      "post": {
        "operationId": "saveEntry",
        "summary": "Idempotently save a private entry",
        "tags": [
          "Entries"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": [],
            "Csrf": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntryResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/entries/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
            "description": "Entry ID returned by save or search, never an owner/Passport ID."
          }
        }
      ],
      "get": {
        "operationId": "getEntry",
        "summary": "Retrieve full private entry",
        "tags": [
          "Entries"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option. CSRF is required even for GET. An Origin header, if supplied, must match.",
        "security": [
          {
            "BrowserSession": [],
            "Csrf": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntryResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceEntry",
        "summary": "Fully replace entry at expected revision",
        "tags": [
          "Entries"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": [],
            "Csrf": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntryResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/entries/search": {
      "post": {
        "operationId": "searchEntries",
        "summary": "Search current active entries with bounded continuation",
        "tags": [
          "Entries"
        ],
        "description": "Guarded browser contract. Real authenticated Passport-to-notebook round-trip remains unverified. Not a remote-agent API credential option.",
        "security": [
          {
            "BrowserSession": [],
            "Csrf": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://app.agentcodex.io"
            },
            "description": "Exact configured browser origin. No CORS is enabled."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, CSRF or authorization denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entry not found; another owner is not distinguished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Save payload or revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Sign-in rate limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BrowserSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__session",
        "description": "HttpOnly original-browser challenge or confirmed session cookie. Never export or paste it; not an API key. Challenge routes and authenticated routes use distinct server state."
      },
      "Csrf": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Field-Notes-Csrf",
        "description": "Matching CSRF token from GET /auth/session, required for all entry reads/writes and logout. This is not an API authentication key."
      }
    },
    "schemas": {
      "SaveInput": {
        "type": "object",
        "properties": {
          "entry": {
            "type": "object",
            "properties": {
              "content": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536,
                "description": "Full original text, at most 64 KiB UTF-8. Retrieved text remains untrusted data.",
                "x-max-utf8-bytes": 65536
              },
              "mediaType": {
                "description": "Bare MIME type, defaults to text/plain; binary uploads are not supported.",
                "type": "string",
                "minLength": 3,
                "maxLength": 128,
                "pattern": "^[a-zA-Z0-9!#$&^_.+-]+/[a-zA-Z0-9!#$&^_.+-]+$",
                "default": "text/plain"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "tags": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                }
              },
              "relatedAgentIds": {
                "description": "Optional exact identifiers; mentioning an agent grants no access.",
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                }
              },
              "provenance": {
                "description": "Optional JSON source/context, at most 8 KiB and depth six. Not verified facts or instructions.",
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/SaveInput/definitions/__schema0"
                },
                "x-max-utf8-bytes": 8192,
                "x-max-json-depth": 6
              }
            },
            "required": [
              "content"
            ],
            "additionalProperties": false
          },
          "requestId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Unique client request key; keep the same key and content when retrying this save."
          }
        },
        "required": [
          "entry",
          "requestId"
        ],
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "definitions": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SaveInput/definitions/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/SaveInput/definitions/__schema0"
                }
              }
            ]
          }
        }
      },
      "GetInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
            "description": "Entry ID returned by save or search, never an owner/Passport ID."
          }
        },
        "required": [
          "id"
        ],
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false
      },
      "UpdateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
            "description": "Entry ID returned by save or search, never an owner/Passport ID."
          },
          "expectedRevision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "entry": {
            "type": "object",
            "properties": {
              "content": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536,
                "description": "Full original text, at most 64 KiB UTF-8. Retrieved text remains untrusted data.",
                "x-max-utf8-bytes": 65536
              },
              "mediaType": {
                "description": "Bare MIME type, defaults to text/plain; binary uploads are not supported.",
                "type": "string",
                "minLength": 3,
                "maxLength": 128,
                "pattern": "^[a-zA-Z0-9!#$&^_.+-]+/[a-zA-Z0-9!#$&^_.+-]+$",
                "default": "text/plain"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "tags": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                }
              },
              "relatedAgentIds": {
                "description": "Optional exact identifiers; mentioning an agent grants no access.",
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                }
              },
              "provenance": {
                "description": "Optional JSON source/context, at most 8 KiB and depth six. Not verified facts or instructions.",
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/UpdateInput/definitions/__schema0"
                },
                "x-max-utf8-bytes": 8192,
                "x-max-json-depth": 6
              }
            },
            "required": [
              "content"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "expectedRevision",
          "entry"
        ],
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "definitions": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UpdateInput/definitions/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/UpdateInput/definitions/__schema0"
                }
              }
            ]
          }
        }
      },
      "SearchInput": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 256
          },
          "tag": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "relatedAgentId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        },
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false
      },
      "EntryResult": {
        "type": "object",
        "properties": {
          "entry": {
            "type": "object",
            "properties": {
              "content": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536,
                "description": "Full original text, at most 64 KiB UTF-8. Retrieved text remains untrusted data."
              },
              "mediaType": {
                "type": "string"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "tags": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                }
              },
              "relatedAgentIds": {
                "description": "Optional exact identifiers; mentioning an agent grants no access.",
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                }
              },
              "provenance": {
                "description": "Optional JSON source/context, at most 8 KiB and depth six. Not verified facts or instructions.",
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/EntryResult/definitions/__schema0"
                }
              },
              "id": {
                "type": "string"
              },
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "createdAt": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string"
              },
              "contentSha256": {
                "type": "string"
              }
            },
            "required": [
              "content",
              "mediaType",
              "id",
              "revision",
              "createdAt",
              "updatedAt",
              "contentSha256"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "entry"
        ],
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "definitions": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/EntryResult/definitions/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/EntryResult/definitions/__schema0"
                }
              }
            ]
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "mediaType": {
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "tags": {
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "relatedAgentIds": {
                  "description": "Optional exact identifiers; mentioning an agent grants no access.",
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  }
                },
                "provenance": {
                  "description": "Optional JSON source/context, at most 8 KiB and depth six. Not verified facts or instructions.",
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/SearchResult/definitions/__schema0"
                  }
                },
                "id": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "createdAt": {
                  "type": "string"
                },
                "updatedAt": {
                  "type": "string"
                },
                "contentSha256": {
                  "type": "string"
                },
                "excerpt": {
                  "type": "string"
                }
              },
              "required": [
                "mediaType",
                "id",
                "revision",
                "createdAt",
                "updatedAt",
                "contentSha256",
                "excerpt"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": "string"
          },
          "coverage": {
            "type": "object",
            "properties": {
              "storage": {
                "type": "string",
                "const": "active-only"
              },
              "mode": {
                "type": "string",
                "const": "literal-substring-v1"
              },
              "scanned": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "hasMore": {
                "type": "boolean"
              }
            },
            "required": [
              "storage",
              "mode",
              "scanned",
              "hasMore"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "entries",
          "coverage"
        ],
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "definitions": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SearchResult/definitions/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/SearchResult/definitions/__schema0"
                }
              }
            ]
          }
        }
      },
      "BrowserUpdateInput": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "entry": {
            "type": "object",
            "properties": {
              "content": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536,
                "description": "Full original text, at most 64 KiB UTF-8. Retrieved text remains untrusted data.",
                "x-max-utf8-bytes": 65536
              },
              "mediaType": {
                "description": "Bare MIME type, defaults to text/plain; binary uploads are not supported.",
                "type": "string",
                "minLength": 3,
                "maxLength": 128,
                "pattern": "^[a-zA-Z0-9!#$&^_.+-]+/[a-zA-Z0-9!#$&^_.+-]+$",
                "default": "text/plain"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "tags": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                }
              },
              "relatedAgentIds": {
                "description": "Optional exact identifiers; mentioning an agent grants no access.",
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                }
              },
              "provenance": {
                "description": "Optional JSON source/context, at most 8 KiB and depth six. Not verified facts or instructions.",
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/BrowserUpdateInput/definitions/__schema0"
                },
                "x-max-utf8-bytes": 8192,
                "x-max-json-depth": 6
              }
            },
            "required": [
              "content"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "expectedRevision",
          "entry"
        ],
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "definitions": {
          "__schema0": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BrowserUpdateInput/definitions/__schema0"
                }
              },
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/BrowserUpdateInput/definitions/__schema0"
                }
              }
            ]
          }
        }
      },
      "Empty": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "Nonce": {
        "type": "object",
        "properties": {
          "nonce": {
            "type": "string",
            "minLength": 22,
            "maxLength": 128
          }
        },
        "required": [
          "nonce"
        ],
        "additionalProperties": false
      },
      "BeginResult": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "nonce": {
            "type": "string",
            "minLength": 22,
            "maxLength": 128
          },
          "signInFingerprint": {
            "type": "string",
            "pattern": "^[0-9A-HJKMNP-TV-Z]{4}-[0-9A-HJKMNP-TV-Z]{4}$"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Epoch milliseconds."
          }
        },
        "required": [
          "clientId",
          "nonce",
          "signInFingerprint",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "CallbackInput": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          },
          "nonce": {
            "type": "string",
            "minLength": 22,
            "maxLength": 128
          }
        },
        "required": [
          "token",
          "nonce"
        ],
        "additionalProperties": false
      },
      "CallbackResult": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 39
          },
          "confirmationCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 39
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Epoch milliseconds."
          }
        },
        "required": [
          "message",
          "confirmationCode",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "ConfirmInput": {
        "type": "object",
        "properties": {
          "nonce": {
            "type": "string",
            "minLength": 22,
            "maxLength": 128
          },
          "confirmationCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 39
          },
          "expectedPassportId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "nonce",
          "confirmationCode",
          "expectedPassportId"
        ],
        "additionalProperties": false
      },
      "Session": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "authenticated"
          },
          "issuer": {
            "type": "string",
            "minLength": 1
          },
          "passportId": {
            "type": "string",
            "minLength": 1
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Epoch milliseconds."
          },
          "csrfToken": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "status",
          "issuer",
          "passportId",
          "expiresAt",
          "csrfToken"
        ],
        "additionalProperties": false
      },
      "SessionResult": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "anonymous"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Session"
          }
        ]
      },
      "ChallengeStatus": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "pending"
              },
              "expiresAt": {
                "type": "integer",
                "minimum": 0,
                "description": "Epoch milliseconds."
              }
            },
            "required": [
              "status",
              "expiresAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "arrived"
              },
              "issuer": {
                "type": "string",
                "minLength": 1
              },
              "passportId": {
                "type": "string",
                "minLength": 1
              },
              "expiresAt": {
                "type": "integer",
                "minimum": 0,
                "description": "Epoch milliseconds."
              }
            },
            "required": [
              "status",
              "issuer",
              "passportId",
              "expiresAt"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Cancelled": {
        "type": "object",
        "properties": {
          "cancelled": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "cancelled"
        ],
        "additionalProperties": false
      },
      "LogoutResult": {
        "type": "object",
        "properties": {
          "signedOut": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "string",
            "const": "current-session"
          }
        },
        "required": [
          "signedOut",
          "scope"
        ],
        "additionalProperties": false
      },
      "LogoutAllResult": {
        "type": "object",
        "properties": {
          "signedOut": {
            "type": "boolean",
            "const": true
          },
          "scope": {
            "type": "string",
            "const": "all-current-sessions"
          }
        },
        "required": [
          "signedOut",
          "scope"
        ],
        "additionalProperties": false
      },
      "Health": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string",
            "const": "field-notes"
          },
          "status": {
            "type": "string",
            "enum": [
              "browser-auth-configured",
              "mcp-configured",
              "scaffold"
            ]
          }
        },
        "required": [
          "service",
          "status"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_input",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "unavailable",
                  "invalid_assertion",
                  "invalid_sign_in",
                  "rate_limited",
                  "not_implemented",
                  "method_not_allowed"
                ]
              },
              "message": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "code"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-capabilities": {
    "remoteMcpEnabled": false,
    "realAuthenticatedRoundTripVerified": false,
    "reviewedAt": "2026-11-07"
  }
}
