{
  "openapi": "3.1.0",
  "info": {
    "title": "hya API v2",
    "summary": "Generated from proto/hya/v2 by cargo run -p xtask -- gen-api; do not edit by hand.",
    "version": "2.0.0"
  },
  "paths": {
    "/v2/agent-efforts/{agent_id}": {
      "put": {
        "operationId": "AgentModels.SetAgentEffort",
        "summary": "Set or clear (empty `effort`) one agent's default thinking effort,",
        "tags": [
          "AgentModels"
        ],
        "x-grpc-method": "hya.v2.AgentModels.SetAgentEffort",
        "x-server-streaming": false
      }
    },
    "/v2/agent-models": {
      "get": {
        "operationId": "AgentModels.ListAgentModels",
        "summary": "Effective model state for every catalog agent under one binding.",
        "tags": [
          "AgentModels"
        ],
        "x-grpc-method": "hya.v2.AgentModels.ListAgentModels",
        "x-server-streaming": false
      }
    },
    "/v2/agent-models/{agent_id}": {
      "put": {
        "operationId": "AgentModels.SetAgentModel",
        "summary": "Set or clear one agent's remembered preference; returns the",
        "tags": [
          "AgentModels"
        ],
        "x-grpc-method": "hya.v2.AgentModels.SetAgentModel",
        "x-server-streaming": false
      }
    },
    "/v2/agent-models/{agent_id}/configuration": {
      "put": {
        "operationId": "AgentModels.SaveAgentModelConfiguration",
        "summary": "Set or clear the model in the owning user configuration file. Keeps a",
        "tags": [
          "AgentModels"
        ],
        "x-grpc-method": "hya.v2.AgentModels.SaveAgentModelConfiguration",
        "x-server-streaming": false
      }
    },
    "/v2/agents": {
      "get": {
        "operationId": "Catalog.ListAgents",
        "summary": "Agents that can be bound to a session.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListAgents",
        "x-server-streaming": false
      }
    },
    "/v2/auth": {
      "get": {
        "operationId": "Auth.ListProviderAuth",
        "summary": "List provider ids with saved credentials. Never returns secret values.",
        "tags": [
          "Auth"
        ],
        "x-grpc-method": "hya.v2.Auth.ListProviderAuth",
        "x-server-streaming": false
      }
    },
    "/v2/auth/{provider_id}": {
      "put": {
        "operationId": "Auth.SetProviderAuth",
        "summary": "Store an API key (written atomically with mode 0600 as `type: api`) and",
        "tags": [
          "Auth"
        ],
        "x-grpc-method": "hya.v2.Auth.SetProviderAuth",
        "x-server-streaming": false
      },
      "delete": {
        "operationId": "Auth.RemoveProviderAuth",
        "summary": "Delete the stored credentials for a provider and rebuild its route live",
        "tags": [
          "Auth"
        ],
        "x-grpc-method": "hya.v2.Auth.RemoveProviderAuth",
        "x-server-streaming": false
      }
    },
    "/v2/bootstrap": {
      "get": {
        "operationId": "Process.GetBootstrap",
        "summary": "Aggregated startup snapshot: config, catalogs, pending interactions,",
        "tags": [
          "Process"
        ],
        "x-grpc-method": "hya.v2.Process.GetBootstrap",
        "x-server-streaming": false
      }
    },
    "/v2/bundle-apis": {
      "get": {
        "operationId": "BundleApi.ListBundleApis",
        "summary": "List every endpoint the bundles of the request's catalog scope register",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.ListBundleApis",
        "x-server-streaming": false
      }
    },
    "/v2/bundles": {
      "get": {
        "operationId": "Catalog.ListBundles",
        "summary": "Bundle inventory, as `hya bundle list` shows it. Includes first-party,",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListBundles",
        "x-server-streaming": false
      }
    },
    "/v2/bundles/{bundle}/api/{path}": {
      "get": {
        "operationId": "BundleApi.InvokeGlobalBundleApi.get",
        "summary": "Invoke one global bundle endpoint (not tied to a session); otherwise",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeGlobalBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "post": {
        "operationId": "BundleApi.InvokeGlobalBundleApi.post",
        "summary": "Invoke one global bundle endpoint (not tied to a session); otherwise",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeGlobalBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "put": {
        "operationId": "BundleApi.InvokeGlobalBundleApi.put",
        "summary": "Invoke one global bundle endpoint (not tied to a session); otherwise",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeGlobalBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "patch": {
        "operationId": "BundleApi.InvokeGlobalBundleApi.patch",
        "summary": "Invoke one global bundle endpoint (not tied to a session); otherwise",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeGlobalBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "delete": {
        "operationId": "BundleApi.InvokeGlobalBundleApi.delete",
        "summary": "Invoke one global bundle endpoint (not tied to a session); otherwise",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeGlobalBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      }
    },
    "/v2/bundles:install": {
      "post": {
        "operationId": "Catalog.InstallBundle",
        "summary": "Install a `.hyabundle` package from a path on the backend's machine",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.InstallBundle",
        "x-server-streaming": false
      }
    },
    "/v2/bundles:refresh": {
      "post": {
        "operationId": "Catalog.RefreshBundles",
        "summary": "Refresh the installed-bundle catalog and the directory's Project",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.RefreshBundles",
        "x-server-streaming": false
      }
    },
    "/v2/bundles:set-enabled": {
      "post": {
        "operationId": "Catalog.SetBundleEnabled",
        "summary": "Enable or disable a bundle by id in every scope (`hya bundle",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.SetBundleEnabled",
        "x-server-streaming": false
      }
    },
    "/v2/bundles:uninstall": {
      "post": {
        "operationId": "Catalog.UninstallBundle",
        "summary": "Remove an installed bundle (`hya bundle remove`), then refresh the",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.UninstallBundle",
        "x-server-streaming": false
      }
    },
    "/v2/commands": {
      "get": {
        "operationId": "Catalog.ListCommands",
        "summary": "Slash-command catalog entries.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListCommands",
        "x-server-streaming": false
      }
    },
    "/v2/config": {
      "get": {
        "operationId": "Process.GetConfig",
        "summary": "Read the effective runtime configuration bag for a directory.",
        "tags": [
          "Process"
        ],
        "x-grpc-method": "hya.v2.Process.GetConfig",
        "x-server-streaming": false
      },
      "patch": {
        "operationId": "Process.UpdateConfig",
        "summary": "Deep-merge a JSON object into the runtime configuration bag.",
        "tags": [
          "Process"
        ],
        "x-grpc-method": "hya.v2.Process.UpdateConfig",
        "x-server-streaming": false
      }
    },
    "/v2/events/stream": {
      "get": {
        "operationId": "Events.StreamGlobalEvents",
        "summary": "Live stream across all sessions of a directory scope.",
        "tags": [
          "Events"
        ],
        "x-grpc-method": "hya.v2.Events.StreamGlobalEvents",
        "x-server-streaming": true
      }
    },
    "/v2/health": {
      "get": {
        "operationId": "Process.GetHealth",
        "summary": "Liveness and version probe.",
        "tags": [
          "Process"
        ],
        "x-grpc-method": "hya.v2.Process.GetHealth",
        "x-server-streaming": false
      }
    },
    "/v2/interactions": {
      "get": {
        "operationId": "Interactions.ListInteractions",
        "summary": "List pending permission/question requests, optionally scoped to one",
        "tags": [
          "Interactions"
        ],
        "x-grpc-method": "hya.v2.Interactions.ListInteractions",
        "x-server-streaming": false
      }
    },
    "/v2/interactions/{request}/respond": {
      "post": {
        "operationId": "Interactions.RespondInteraction",
        "summary": "Respond to one pending request. Exactly one response kind is set.",
        "tags": [
          "Interactions"
        ],
        "x-grpc-method": "hya.v2.Interactions.RespondInteraction",
        "x-server-streaming": false
      }
    },
    "/v2/location": {
      "get": {
        "operationId": "Process.GetLocation",
        "summary": "Identity of this backend process and the directory it serves.",
        "tags": [
          "Process"
        ],
        "x-grpc-method": "hya.v2.Process.GetLocation",
        "x-server-streaming": false
      }
    },
    "/v2/logs": {
      "post": {
        "operationId": "Logs.IngestLog",
        "summary": "Ingest one frontend log entry.",
        "tags": [
          "Logs"
        ],
        "x-grpc-method": "hya.v2.Logs.IngestLog",
        "x-server-streaming": false
      }
    },
    "/v2/mcp": {
      "get": {
        "operationId": "Mcp.GetMcpStatus",
        "summary": "Status of every configured MCP server in a directory.",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.GetMcpStatus",
        "x-server-streaming": false
      },
      "post": {
        "operationId": "Mcp.AddMcpServer",
        "summary": "Add (or replace) one MCP server in desired state. The server is stored",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.AddMcpServer",
        "x-server-streaming": false
      }
    },
    "/v2/mcp/session": {
      "post": {
        "operationId": "Mcp.OpenMcpSession",
        "summary": "Create a root session with MCP peers supplied by a local client, or",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.OpenMcpSession",
        "x-server-streaming": true
      }
    },
    "/v2/mcp/{name}/auth": {
      "post": {
        "operationId": "Mcp.StartMcpAuth",
        "summary": "Begin an MCP server OAuth flow.",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.StartMcpAuth",
        "x-server-streaming": false
      },
      "delete": {
        "operationId": "Mcp.RemoveMcpAuth",
        "summary": "Remove stored MCP server credentials.",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.RemoveMcpAuth",
        "x-server-streaming": false
      }
    },
    "/v2/mcp/{name}/auth/complete": {
      "post": {
        "operationId": "Mcp.CompleteMcpAuth",
        "summary": "Complete an MCP server OAuth flow.",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.CompleteMcpAuth",
        "x-server-streaming": false
      }
    },
    "/v2/mcp/{name}/connect": {
      "post": {
        "operationId": "Mcp.ConnectMcp",
        "summary": "Enable and connect one MCP server now. A connect failure is answered",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.ConnectMcp",
        "x-server-streaming": false
      }
    },
    "/v2/mcp/{name}/disconnect": {
      "post": {
        "operationId": "Mcp.DisconnectMcp",
        "summary": "Disconnect one MCP server.",
        "tags": [
          "Mcp"
        ],
        "x-grpc-method": "hya.v2.Mcp.DisconnectMcp",
        "x-server-streaming": false
      }
    },
    "/v2/model-effort-preferences": {
      "get": {
        "operationId": "AgentModels.ListModelEffortPreferences",
        "summary": "",
        "tags": [
          "AgentModels"
        ],
        "x-grpc-method": "hya.v2.AgentModels.ListModelEffortPreferences",
        "x-server-streaming": false
      }
    },
    "/v2/model-effort-preferences/{provider_id}/{model_id}": {
      "put": {
        "operationId": "AgentModels.SetModelEffortPreference",
        "summary": "Empty effort clears the preference. Emits a live `catalogUpdated` frame",
        "tags": [
          "AgentModels"
        ],
        "x-grpc-method": "hya.v2.AgentModels.SetModelEffortPreference",
        "x-server-streaming": false
      }
    },
    "/v2/models": {
      "get": {
        "operationId": "Catalog.ListModels",
        "summary": "Models across providers, optionally filtered to one provider.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListModels",
        "x-server-streaming": false
      }
    },
    "/v2/permission-modes": {
      "get": {
        "operationId": "Catalog.ListPermissionModes",
        "summary": "Session permission modes accepted by `UpdateSession.permission_mode`:",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListPermissionModes",
        "x-server-streaming": false
      }
    },
    "/v2/permissions/rules": {
      "get": {
        "operationId": "Interactions.ListSavedRules",
        "summary": "List saved permission rules (persisted allow/deny/ask decisions).",
        "tags": [
          "Interactions"
        ],
        "x-grpc-method": "hya.v2.Interactions.ListSavedRules",
        "x-server-streaming": false
      }
    },
    "/v2/permissions/rules/{rule}": {
      "delete": {
        "operationId": "Interactions.DeleteSavedRule",
        "summary": "Delete one saved permission rule.",
        "tags": [
          "Interactions"
        ],
        "x-grpc-method": "hya.v2.Interactions.DeleteSavedRule",
        "x-server-streaming": false
      }
    },
    "/v2/projects": {
      "get": {
        "operationId": "Project.ListProjects",
        "summary": "List the Projects (archived ones are left out), most recently updated",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.ListProjects",
        "x-server-streaming": false
      },
      "post": {
        "operationId": "Project.CreateProject",
        "summary": "Create a Project. `invalid_argument` for an empty name, no roots, or a",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.CreateProject",
        "x-server-streaming": false
      }
    },
    "/v2/projects/current": {
      "get": {
        "operationId": "Project.GetCurrentProject",
        "summary": "The Project whose root contains the request's directory scope (its",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.GetCurrentProject",
        "x-server-streaming": false
      }
    },
    "/v2/projects/ensure": {
      "post": {
        "operationId": "Project.EnsureProjectForPath",
        "summary": "The Project for a local working directory: the Project that contains",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.EnsureProjectForPath",
        "x-server-streaming": false
      }
    },
    "/v2/projects/resolve": {
      "get": {
        "operationId": "Project.ResolveProject",
        "summary": "The Project that contains `path`, without creating one: `project` is",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.ResolveProject",
        "x-server-streaming": false
      }
    },
    "/v2/projects/trust": {
      "get": {
        "operationId": "Project.GetProjectTrust",
        "summary": "Inspect a directory's recorded trust and detected repository artifacts.",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.GetProjectTrust",
        "x-server-streaming": false
      },
      "put": {
        "operationId": "Project.SetProjectTrust",
        "summary": "Record a trust decision for a canonical directory.",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.SetProjectTrust",
        "x-server-streaming": false
      }
    },
    "/v2/projects/{project}": {
      "get": {
        "operationId": "Project.GetProject",
        "summary": "Read one Project. `not_found` when it does not exist.",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.GetProject",
        "x-server-streaming": false
      },
      "patch": {
        "operationId": "Project.UpdateProject",
        "summary": "Rename a Project and/or replace its roots, in one step. Running",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.UpdateProject",
        "x-server-streaming": false
      },
      "delete": {
        "operationId": "Project.DeleteProject",
        "summary": "Delete a Project. `failed_precondition` while a non-archived root",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.DeleteProject",
        "x-server-streaming": false
      }
    },
    "/v2/projects/{project}/directories": {
      "get": {
        "operationId": "Project.ListProjectDirectories",
        "summary": "The roots of a Project, primary root first. `not_found` when it does",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.ListProjectDirectories",
        "x-server-streaming": false
      }
    },
    "/v2/projects/{project}/init-git": {
      "post": {
        "operationId": "Project.InitProjectGit",
        "summary": "Initialize git in the primary root of a Project that has no repository",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.InitProjectGit",
        "x-server-streaming": false
      }
    },
    "/v2/providers": {
      "get": {
        "operationId": "Catalog.ListProviders",
        "summary": "Providers with their aggregate auth status, and the provider kinds a",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListProviders",
        "x-server-streaming": false
      }
    },
    "/v2/providers/{provider_id}": {
      "get": {
        "operationId": "Catalog.GetProvider",
        "summary": "One provider's detail including its models.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.GetProvider",
        "x-server-streaming": false
      },
      "put": {
        "operationId": "Catalog.UpsertProvider",
        "summary": "Add or update a provider in `config.yaml` (and save its API key when",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.UpsertProvider",
        "x-server-streaming": false
      }
    },
    "/v2/providers/{provider_id}/models": {
      "put": {
        "operationId": "Catalog.SetProviderModel",
        "summary": "Write one model's entry (with its metadata overrides) into the",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.SetProviderModel",
        "x-server-streaming": false
      },
      "delete": {
        "operationId": "Catalog.RemoveProviderModel",
        "summary": "Remove one model's entry from the provider's `models:` in",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.RemoveProviderModel",
        "x-server-streaming": false
      }
    },
    "/v2/providers/{provider_id}/refresh": {
      "post": {
        "operationId": "Catalog.RefreshProvider",
        "summary": "Re-read the provider's config entry and key, fetch its remote model",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.RefreshProvider",
        "x-server-streaming": false
      }
    },
    "/v2/providers/{provider_id}/test": {
      "post": {
        "operationId": "Catalog.TestProviderModel",
        "summary": "Send one `hi` user message to a provider's model with max output tokens",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.TestProviderModel",
        "x-server-streaming": false
      }
    },
    "/v2/pty": {
      "post": {
        "operationId": "Pty.CreatePty",
        "summary": "Create a PTY session.",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.CreatePty",
        "x-server-streaming": false
      }
    },
    "/v2/pty/shells": {
      "get": {
        "operationId": "Pty.ListShells",
        "summary": "List available shell binaries on the host.",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.ListShells",
        "x-server-streaming": false
      }
    },
    "/v2/pty/{id}": {
      "get": {
        "operationId": "Pty.GetPty",
        "summary": "Read one PTY session's state.",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.GetPty",
        "x-server-streaming": false
      },
      "put": {
        "operationId": "Pty.UpdatePty",
        "summary": "Resize or otherwise update a PTY session.",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.UpdatePty",
        "x-server-streaming": false
      },
      "delete": {
        "operationId": "Pty.DeletePty",
        "summary": "Terminate a PTY session.",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.DeletePty",
        "x-server-streaming": false
      }
    },
    "/v2/pty/{id}/connect": {
      "get": {
        "operationId": "Pty.StreamPty",
        "summary": "Bidirectional terminal stream: client sends input/resize/ping,",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.StreamPty",
        "x-server-streaming": true
      }
    },
    "/v2/pty/{id}/connect-token": {
      "post": {
        "operationId": "Pty.CreateConnectToken",
        "summary": "Mint a one-time token authorizing a terminal connection.",
        "tags": [
          "Pty"
        ],
        "x-grpc-method": "hya.v2.Pty.CreateConnectToken",
        "x-server-streaming": false
      }
    },
    "/v2/relay/connect": {
      "post": {
        "operationId": "RelayControl.ConnectRelay",
        "summary": "Join a relay: load (or create) the relay identity and keep a host",
        "tags": [
          "RelayControl"
        ],
        "x-grpc-method": "hya.v2.RelayControl.ConnectRelay",
        "x-server-streaming": false
      }
    },
    "/v2/relay/disconnect": {
      "post": {
        "operationId": "RelayControl.DisconnectRelay",
        "summary": "Leave the relay: close the control stream (the proxy releases the room)",
        "tags": [
          "RelayControl"
        ],
        "x-grpc-method": "hya.v2.RelayControl.DisconnectRelay",
        "x-server-streaming": false
      }
    },
    "/v2/relay/link": {
      "get": {
        "operationId": "RelayControl.GetRelayLink",
        "summary": "The full relay link — a secret: whoever holds it controls this backend.",
        "tags": [
          "RelayControl"
        ],
        "x-grpc-method": "hya.v2.RelayControl.GetRelayLink",
        "x-server-streaming": false
      }
    },
    "/v2/relay/rotate": {
      "post": {
        "operationId": "RelayControl.RotateRelayKey",
        "summary": "Issue a new pre-shared key: every earlier link fails its next",
        "tags": [
          "RelayControl"
        ],
        "x-grpc-method": "hya.v2.RelayControl.RotateRelayKey",
        "x-server-streaming": false
      }
    },
    "/v2/relay/status": {
      "get": {
        "operationId": "RelayControl.GetRelayStatus",
        "summary": "The connector's state. Never contains key material.",
        "tags": [
          "RelayControl"
        ],
        "x-grpc-method": "hya.v2.RelayControl.GetRelayStatus",
        "x-server-streaming": false
      }
    },
    "/v2/sessions": {
      "post": {
        "operationId": "Session.CreateSession",
        "summary": "Create a session, optionally as a child of an existing session and",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.CreateSession",
        "x-server-streaming": false
      },
      "get": {
        "operationId": "Session.ListSessions",
        "summary": "List sessions, optionally scoped under one parent (subagent tree).",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.ListSessions",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}": {
      "get": {
        "operationId": "Session.GetSession",
        "summary": "Fetch one session's projection summary.",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.GetSession",
        "x-server-streaming": false
      },
      "patch": {
        "operationId": "Session.UpdateSession",
        "summary": "Update mutable session fields: title, agent, model, background flag,",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.UpdateSession",
        "x-server-streaming": false
      },
      "delete": {
        "operationId": "Session.DeleteSession",
        "summary": "Delete a session and its event log.",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.DeleteSession",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/bundles/{bundle}/{path}": {
      "get": {
        "operationId": "BundleApi.InvokeSessionBundleApi.get",
        "summary": "Invoke one session-scoped bundle endpoint. Over HTTP `bundle` is one",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeSessionBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "post": {
        "operationId": "BundleApi.InvokeSessionBundleApi.post",
        "summary": "Invoke one session-scoped bundle endpoint. Over HTTP `bundle` is one",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeSessionBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "put": {
        "operationId": "BundleApi.InvokeSessionBundleApi.put",
        "summary": "Invoke one session-scoped bundle endpoint. Over HTTP `bundle` is one",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeSessionBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "patch": {
        "operationId": "BundleApi.InvokeSessionBundleApi.patch",
        "summary": "Invoke one session-scoped bundle endpoint. Over HTTP `bundle` is one",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeSessionBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      },
      "delete": {
        "operationId": "BundleApi.InvokeSessionBundleApi.delete",
        "summary": "Invoke one session-scoped bundle endpoint. Over HTTP `bundle` is one",
        "tags": [
          "BundleApi"
        ],
        "x-grpc-method": "hya.v2.BundleApi.InvokeSessionBundleApi",
        "x-server-streaming": false,
        "x-hya-any-method": true
      }
    },
    "/v2/sessions/{session}/compact": {
      "post": {
        "operationId": "Session.CompactSession",
        "summary": "Compact a session's context using the configured method ladder.",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.CompactSession",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/events": {
      "get": {
        "operationId": "Events.ListEvents",
        "summary": "Replay events of one session after a sequence watermark.",
        "tags": [
          "Events"
        ],
        "x-grpc-method": "hya.v2.Events.ListEvents",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/events/stream": {
      "get": {
        "operationId": "Events.StreamSessionEvents",
        "summary": "Live stream for one session; server-streaming over gRPC and SSE over",
        "tags": [
          "Events"
        ],
        "x-grpc-method": "hya.v2.Events.StreamSessionEvents",
        "x-server-streaming": true
      }
    },
    "/v2/sessions/{session}/fork": {
      "post": {
        "operationId": "Session.ForkSession",
        "summary": "Fork a session into a new session id. The fork copies the source's",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.ForkSession",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/messages": {
      "get": {
        "operationId": "Messages.ListMessages",
        "summary": "List the transcript messages of a session.",
        "tags": [
          "Messages"
        ],
        "x-grpc-method": "hya.v2.Messages.ListMessages",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/messages/{message}": {
      "get": {
        "operationId": "Messages.GetMessage",
        "summary": "Fetch one message with its parts.",
        "tags": [
          "Messages"
        ],
        "x-grpc-method": "hya.v2.Messages.GetMessage",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/messages/{message}/parts/{part}": {
      "delete": {
        "operationId": "Messages.DeleteMessagePart",
        "summary": "Delete one part of a message (message editing / redaction).",
        "tags": [
          "Messages"
        ],
        "x-grpc-method": "hya.v2.Messages.DeleteMessagePart",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/refresh-context": {
      "post": {
        "operationId": "Session.RefreshSessionContext",
        "summary": "Re-record a session's initial context at its next turn: the",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.RefreshSessionContext",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/revert": {
      "post": {
        "operationId": "Session.RevertSession",
        "summary": "Revert a session to just before a user message (default: the last",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.RevertSession",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/summarize": {
      "post": {
        "operationId": "Session.SummarizeSession",
        "summary": "Produce a summary message for a session (titles, handoffs).",
        "tags": [
          "Session"
        ],
        "x-grpc-method": "hya.v2.Session.SummarizeSession",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/todo": {
      "get": {
        "operationId": "Messages.GetSessionTodo",
        "summary": "Read the session's todo list projection.",
        "tags": [
          "Messages"
        ],
        "x-grpc-method": "hya.v2.Messages.GetSessionTodo",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/turns": {
      "post": {
        "operationId": "Turn.CreateTurn",
        "summary": "Admit one turn into a session: a user prompt, a slash command, or a",
        "tags": [
          "Turn"
        ],
        "x-grpc-method": "hya.v2.Turn.CreateTurn",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/turns/{turn}": {
      "get": {
        "operationId": "Turn.GetTurn",
        "summary": "Read the current state of one turn.",
        "tags": [
          "Turn"
        ],
        "x-grpc-method": "hya.v2.Turn.GetTurn",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/turns/{turn}/cancel": {
      "post": {
        "operationId": "Turn.CancelTurn",
        "summary": "Request cancellation of a running turn (cooperative abort).",
        "tags": [
          "Turn"
        ],
        "x-grpc-method": "hya.v2.Turn.CancelTurn",
        "x-server-streaming": false
      }
    },
    "/v2/sessions/{session}/turns/{turn}/wait": {
      "post": {
        "operationId": "Turn.WaitTurn",
        "summary": "Block until the turn reaches a terminal state or the timeout elapses.",
        "tags": [
          "Turn"
        ],
        "x-grpc-method": "hya.v2.Turn.WaitTurn",
        "x-server-streaming": false
      }
    },
    "/v2/skills": {
      "get": {
        "operationId": "Catalog.ListSkills",
        "summary": "Skill catalog entries.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListSkills",
        "x-server-streaming": false
      }
    },
    "/v2/tools": {
      "get": {
        "operationId": "Catalog.ListTools",
        "summary": "Tool registry entries including hidden aliases.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListTools",
        "x-server-streaming": false
      }
    },
    "/v2/tui-extensions": {
      "get": {
        "operationId": "Catalog.ListTuiExtensions",
        "summary": "Verified frontend extension declarations from prepared bundles. Metadata only.",
        "tags": [
          "Catalog"
        ],
        "x-grpc-method": "hya.v2.Catalog.ListTuiExtensions",
        "x-server-streaming": false
      }
    },
    "/v2/vcs": {
      "get": {
        "operationId": "Project.GetVcsStatus",
        "summary": "Repository status: branch, head, and changed files.",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.GetVcsStatus",
        "x-server-streaming": false
      }
    },
    "/v2/vcs/apply": {
      "post": {
        "operationId": "Project.ApplyPatch",
        "summary": "Apply a unified diff patch to the working tree.",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.ApplyPatch",
        "x-server-streaming": false
      }
    },
    "/v2/vcs/diff": {
      "get": {
        "operationId": "Project.GetVcsDiff",
        "summary": "Unified diff of working-tree changes.",
        "tags": [
          "Project"
        ],
        "x-grpc-method": "hya.v2.Project.GetVcsDiff",
        "x-server-streaming": false
      }
    }
  },
  "components": {
    "schemas": {
      "SetAgentEffortRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "effort": {
            "type": "string"
          },
          "directory": {
            "type": "string"
          }
        }
      },
      "AgentEffort": {
        "type": "object",
        "description": "One agent's saved runtime effort choice (empty when cleared).",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "effort": {
            "type": "string"
          }
        }
      },
      "ModelEffortPreference": {
        "type": "object",
        "description": "",
        "properties": {
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "effort": {
            "type": "string"
          },
          "updated_at": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ListModelEffortPreferencesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "preferences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelEffortPreference"
            }
          }
        }
      },
      "SetModelEffortPreferenceRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "effort": {
            "type": "string"
          }
        }
      },
      "AgentModelSelection": {
        "type": "object",
        "description": "A concrete provider/model selection.",
        "properties": {
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          }
        }
      },
      "AgentModelState": {
        "type": "object",
        "description": "Effective model state for one catalog agent.",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          },
          "configured": {
            "type": "boolean"
          },
          "settable": {
            "type": "boolean"
          },
          "preference": {
            "$ref": "#/components/schemas/AgentModelSelection"
          },
          "preference_available": {
            "type": "boolean"
          },
          "effective": {
            "$ref": "#/components/schemas/AgentModelSelection"
          },
          "source": {
            "$ref": "#/components/schemas/AgentModelSource"
          },
          "configuration": {
            "$ref": "#/components/schemas/AgentModelSelection"
          },
          "session_override": {
            "$ref": "#/components/schemas/AgentModelSelection"
          },
          "effort": {
            "type": "string"
          },
          "effort_source": {
            "$ref": "#/components/schemas/AgentEffortSource"
          },
          "configuration_path": {
            "type": "string"
          }
        }
      },
      "ListAgentModelsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "session": {
            "type": "string"
          }
        }
      },
      "ListAgentModelsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentModelState"
            }
          }
        }
      },
      "SetAgentModelRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "preference": {
            "$ref": "#/components/schemas/AgentModelSelection"
          }
        }
      },
      "SaveAgentModelConfigurationRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/AgentModelSelection"
          }
        }
      },
      "ListProviderAuthResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "provider_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "OauthTokens": {
        "type": "object",
        "description": "OAuth tokens captured from a completed provider flow.",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "refresh_token": {
            "type": "string"
          },
          "expires_at": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SetProviderAuthRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "api_key": {
            "type": "string"
          },
          "oauth": {
            "$ref": "#/components/schemas/OauthTokens"
          }
        }
      },
      "SetProviderAuthResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/AuthStatus"
          },
          "provider": {
            "$ref": "#/components/schemas/ProviderInfo"
          },
          "discovery": {
            "$ref": "#/components/schemas/DiscoveryOutcome"
          }
        }
      },
      "RemoveProviderAuthRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          }
        }
      },
      "RemoveProviderAuthResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderInfo"
          }
        }
      },
      "ListBundleApisRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "session": {
            "type": "string"
          }
        }
      },
      "BundleApiInfo": {
        "type": "object",
        "description": "One endpoint a published bundle registers.",
        "properties": {
          "bundle": {
            "type": "string"
          },
          "api": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "request_schema": {
            "$ref": "#/components/schemas/google.protobuf.Value"
          },
          "response_schema": {
            "$ref": "#/components/schemas/google.protobuf.Value"
          }
        }
      },
      "ListBundleApisResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "apis": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BundleApiInfo"
            }
          }
        }
      },
      "InvokeSessionBundleApiRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "bundle": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "string> query": {
            "$ref": "#/components/schemas/map<string,"
          },
          "body": {
            "$ref": "#/components/schemas/google.protobuf.Value"
          }
        }
      },
      "InvokeGlobalBundleApiRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "bundle": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "string> query": {
            "$ref": "#/components/schemas/map<string,"
          },
          "body": {
            "$ref": "#/components/schemas/google.protobuf.Value"
          }
        }
      },
      "BundleApiResponse": {
        "type": "object",
        "description": "One served bundle API call (the gRPC reply; HTTP returns `body` verbatim with `status` as the HTTP status).",
        "properties": {
          "bundle": {
            "type": "string"
          },
          "api": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int64"
          },
          "content_type": {
            "type": "string"
          },
          "body": {
            "$ref": "#/components/schemas/google.protobuf.Value"
          }
        }
      },
      "ModelRef": {
        "type": "object",
        "description": "Provider/model identity pair. `model_id` is provider-local.",
        "properties": {
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          }
        }
      },
      "ListAgentsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "AgentSummary": {
        "type": "object",
        "description": "One selectable agent.",
        "properties": {
          "name": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          },
          "description": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          }
        }
      },
      "ListAgentsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentSummary"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "ListModelsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ModelSummary": {
        "type": "object",
        "description": "One selectable model.",
        "properties": {
          "id": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "reasoning": {
            "type": "boolean"
          },
          "auth": {
            "$ref": "#/components/schemas/AuthStatus"
          },
          "context_limit": {
            "type": "integer",
            "format": "int64"
          },
          "output_limit": {
            "type": "integer",
            "format": "int64"
          },
          "source": {
            "type": "string"
          },
          "image_input": {
            "type": "boolean"
          },
          "reasoning_variants": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reasoning_default": {
            "type": "string"
          }
        }
      },
      "ListModelsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelSummary"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "ListProvidersRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ProviderSummary": {
        "type": "object",
        "description": "One provider route with aggregate auth state.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "auth": {
            "$ref": "#/components/schemas/AuthStatus"
          },
          "website": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "base_url": {
            "type": "string"
          },
          "key_source": {
            "type": "string"
          },
          "model_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ListProvidersResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderSummary"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "protocols": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderProtocol"
            }
          }
        }
      },
      "ProviderProtocol": {
        "type": "object",
        "description": "One registered provider kind: a value `UpsertProviderRequest.kind` accepts.",
        "properties": {
          "kind": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "supports_oauth": {
            "type": "boolean"
          }
        }
      },
      "GetProviderRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          }
        }
      },
      "ProviderInfo": {
        "type": "object",
        "description": "Provider detail with its model rows.",
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/ProviderSummary"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelSummary"
            }
          },
          "supports_api_key": {
            "type": "boolean"
          },
          "supports_oauth": {
            "type": "boolean"
          }
        }
      },
      "UpsertProviderRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "base_url": {
            "type": "string"
          },
          "api_key": {
            "type": "string"
          }
        }
      },
      "RefreshProviderRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          }
        }
      },
      "RefreshBundlesRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "RefreshBundlesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "generation": {
            "type": "integer",
            "format": "int64"
          },
          "bundles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RefreshedBundle"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BundleRefreshError"
            }
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "RefreshedBundle": {
        "type": "object",
        "description": "",
        "properties": {
          "id": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "prepared_digest": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "BundleRefreshError": {
        "type": "object",
        "description": "",
        "properties": {
          "bundle_id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ListBundlesRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "ListBundlesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "bundles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BundleSummary"
            }
          }
        }
      },
      "BundleSummary": {
        "type": "object",
        "description": "One bundle as installed or shipped.",
        "properties": {
          "id": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "publisher": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "removable": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "prepared_digest": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "components": {
            "$ref": "#/components/schemas/BundleComponents"
          }
        }
      },
      "BundleComponents": {
        "type": "object",
        "description": "What a bundle contributes, by id.",
        "properties": {
          "agents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "permission_modes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "apis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hooks": {
            "type": "integer",
            "format": "int64"
          },
          "tui": {
            "type": "boolean"
          },
          "tui_permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "InstallBundleRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "project": {
            "type": "boolean"
          },
          "overwrite": {
            "type": "boolean"
          }
        }
      },
      "UninstallBundleRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "bundle_id": {
            "type": "string"
          },
          "project": {
            "type": "boolean"
          }
        }
      },
      "SetBundleEnabledRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "bundle_id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "BundleChange": {
        "type": "object",
        "description": "The bundle a management call changed and the refresh that followed.",
        "properties": {
          "bundle_id": {
            "type": "string"
          },
          "refresh": {
            "$ref": "#/components/schemas/RefreshBundlesResponse"
          }
        }
      },
      "SetProviderModelRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "context_limit": {
            "type": "integer",
            "format": "int64"
          },
          "output_limit": {
            "type": "integer",
            "format": "int64"
          },
          "reasoning": {
            "type": "boolean"
          }
        }
      },
      "RemoveProviderModelRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          }
        }
      },
      "DiscoveryOutcome": {
        "type": "object",
        "description": "Outcome of one remote model-list fetch.",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "result": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          },
          "model_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ProviderUpdate": {
        "type": "object",
        "description": "A provider after a change, applied live.",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderInfo"
          },
          "discovery": {
            "$ref": "#/components/schemas/DiscoveryOutcome"
          }
        }
      },
      "TestProviderModelRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          }
        }
      },
      "TestProviderModelResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "text": {
            "type": "string"
          },
          "finish_reason": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          },
          "latency_ms": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ListCommandsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          },
          "session": {
            "type": "string"
          }
        }
      },
      "CommandSummary": {
        "type": "object",
        "description": "One slash-command entry.",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "argument_hint": {
            "type": "string"
          },
          "hints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "subtask": {
            "type": "boolean"
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "ListCommandsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "commands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommandSummary"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "diagnostics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogDiagnostic"
            }
          }
        }
      },
      "CatalogDiagnostic": {
        "type": "object",
        "description": "A resource file a catalog skipped or warns about, for clients to show.",
        "properties": {
          "path": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ListSkillsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          },
          "session": {
            "type": "string"
          }
        }
      },
      "SkillSummary": {
        "type": "object",
        "description": "One invocable skill.",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "disable_model_invocation": {
            "type": "boolean"
          },
          "bundle_id": {
            "type": "string"
          }
        }
      },
      "ListSkillsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkillSummary"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "diagnostics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogDiagnostic"
            }
          }
        }
      },
      "ListToolsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ToolSummary": {
        "type": "object",
        "description": "One tool registry entry.",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "hidden": {
            "type": "boolean"
          }
        }
      },
      "ListToolsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSummary"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "ListPermissionModesRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "session": {
            "type": "string"
          }
        }
      },
      "PermissionModeSummary": {
        "type": "object",
        "description": "One selectable session permission mode.",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "ListPermissionModesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "modes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PermissionModeSummary"
            }
          }
        }
      },
      "ListTuiExtensionsRequest": {
        "type": "object",
        "description": "List verified, prepared frontend extension descriptors visible in a directory.",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "TuiExtensionDescriptor": {
        "type": "object",
        "description": "",
        "properties": {
          "bundle_id": {
            "type": "string"
          },
          "bundle_version": {
            "type": "string"
          },
          "prepared_digest": {
            "type": "string"
          },
          "api_version": {
            "type": "integer",
            "format": "int64"
          },
          "entry": {
            "type": "string"
          },
          "sdk": {
            "type": "string"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TuiExtensionFile"
            }
          },
          "first_party": {
            "type": "boolean"
          },
          "cached": {
            "type": "boolean"
          }
        }
      },
      "TuiExtensionFile": {
        "type": "object",
        "description": "",
        "properties": {
          "path": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "content": {
            "type": "string"
          }
        }
      },
      "ListTuiExtensionsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "extensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TuiExtensionDescriptor"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Stable, machine-readable HTTP error payload.  HTTP bindings render this payload inside an enclosing {\"error\": ...} object. gRPC returns the corresponding canonical status and human-readable message.",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "PageRequest": {
        "type": "object",
        "description": "Standard list controls shared by every paginated rpc.",
        "properties": {
          "cursor": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PageInfo": {
        "type": "object",
        "description": "Pagination outcome attached to every paginated response.",
        "properties": {
          "next_cursor": {
            "type": "string"
          },
          "has_more": {
            "type": "boolean"
          }
        }
      },
      "ListEventsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "since_seq": {
            "type": "integer",
            "format": "int64"
          },
          "limit": {
            "type": "integer",
            "format": "int64"
          },
          "include_raw": {
            "type": "boolean"
          }
        }
      },
      "ListEventsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StreamEvent"
            }
          },
          "next_seq": {
            "type": "integer",
            "format": "int64"
          },
          "raw_envelopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "StreamSessionEventsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "since_seq": {
            "type": "integer",
            "format": "int64"
          },
          "include_descendants": {
            "type": "boolean"
          }
        }
      },
      "StreamGlobalEventsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "since_seq": {
            "type": "integer",
            "format": "int64"
          },
          "interactions_only": {
            "type": "boolean"
          }
        }
      },
      "StreamFrame": {
        "type": "object",
        "description": "One frame on a live stream.",
        "properties": {
          "event": {
            "$ref": "#/components/schemas/StreamEvent"
          },
          "resync": {
            "$ref": "#/components/schemas/ResyncFrame"
          }
        }
      },
      "ResyncFrame": {
        "type": "object",
        "description": "Typed lag signal replacing the legacy SSE `resync` event name.",
        "properties": {
          "last_seq": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "StreamEvent": {
        "type": "object",
        "description": "One curated projected event from the event log.",
        "properties": {
          "seq": {
            "type": "integer",
            "format": "int64"
          },
          "session": {
            "type": "string"
          },
          "time_recorded": {
            "type": "string",
            "format": "date-time"
          },
          "session_started": {
            "$ref": "#/components/schemas/SessionStarted"
          },
          "session_updated": {
            "$ref": "#/components/schemas/SessionUpdated"
          },
          "message_started": {
            "$ref": "#/components/schemas/MessageStarted"
          },
          "message_finished": {
            "$ref": "#/components/schemas/MessageFinished"
          },
          "part_started": {
            "$ref": "#/components/schemas/PartStarted"
          },
          "part_appended": {
            "$ref": "#/components/schemas/PartAppended"
          },
          "part_completed": {
            "$ref": "#/components/schemas/PartCompleted"
          },
          "tool_state_changed": {
            "$ref": "#/components/schemas/ToolStateChanged"
          },
          "permission_requested": {
            "$ref": "#/components/schemas/PermissionRequested"
          },
          "question_requested": {
            "$ref": "#/components/schemas/QuestionRequested"
          },
          "interaction_resolved": {
            "$ref": "#/components/schemas/InteractionResolved"
          },
          "todo_updated": {
            "$ref": "#/components/schemas/TodoUpdated"
          },
          "extension_event": {
            "$ref": "#/components/schemas/ExtensionEvent"
          },
          "tokens_recorded": {
            "$ref": "#/components/schemas/TokensRecorded"
          },
          "compaction_applied": {
            "$ref": "#/components/schemas/CompactionApplied"
          },
          "session_deleted": {
            "$ref": "#/components/schemas/SessionDeleted"
          },
          "part_replaced": {
            "$ref": "#/components/schemas/PartReplaced"
          },
          "error_reported": {
            "$ref": "#/components/schemas/ErrorReported"
          },
          "session_reverted": {
            "$ref": "#/components/schemas/SessionReverted"
          },
          "parts_added": {
            "$ref": "#/components/schemas/PartsAdded"
          },
          "catalog_updated": {
            "$ref": "#/components/schemas/CatalogUpdated"
          },
          "server_stopping": {
            "$ref": "#/components/schemas/ServerStopping"
          },
          "projects_updated": {
            "$ref": "#/components/schemas/ProjectsUpdated"
          },
          "part_deleted": {
            "$ref": "#/components/schemas/PartDeleted"
          }
        }
      },
      "ExtensionEvent": {
        "type": "object",
        "description": "Bundle-owned extension event emitted on a session stream.",
        "properties": {
          "session_id": {
            "type": "string"
          },
          "bundle": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "payload": {
            "$ref": "#/components/schemas/google.protobuf.Value"
          }
        }
      },
      "CatalogUpdated": {
        "type": "object",
        "description": "A catalog changed.",
        "properties": {
          "project_id": {
            "type": "string"
          }
        }
      },
      "ServerStopping": {
        "type": "object",
        "description": "The Project list changed; carries no fields. Why the server is going away.",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "PartsAdded": {
        "type": "object",
        "description": "Complete parts added to a message in one step.",
        "properties": {
          "message": {
            "type": "string"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartInfo"
            }
          }
        }
      },
      "PartDeleted": {
        "type": "object",
        "description": "A part removed from a message.",
        "properties": {
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          }
        }
      },
      "SessionReverted": {
        "type": "object",
        "description": "A session revert or its undo.",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "undone": {
            "type": "boolean"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevertedFile"
            }
          }
        }
      },
      "SessionStarted": {
        "type": "object",
        "description": "A session was created.",
        "properties": {
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "workdir": {
            "type": "string"
          },
          "parent": {
            "type": "string"
          }
        }
      },
      "SessionUpdated": {
        "type": "object",
        "description": "Session metadata changed.",
        "properties": {
          "title": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "background": {
            "type": "boolean"
          },
          "permission_mode": {
            "type": "string"
          },
          "archived": {
            "type": "boolean"
          },
          "busy": {
            "type": "boolean"
          }
        }
      },
      "MessageStarted": {
        "type": "object",
        "description": "A session was deleted: its log is gone. Live-only (`seq` 0), for root sessions only, on the global stream (also with `interactions_only`). A message started.",
        "properties": {
          "message": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          }
        }
      },
      "MessageFinished": {
        "type": "object",
        "description": "A message reached a terminal state.",
        "properties": {
          "message": {
            "type": "string"
          },
          "finish": {
            "$ref": "#/components/schemas/FinishReason"
          },
          "usage": {
            "$ref": "#/components/schemas/TokenUsage"
          },
          "cause": {
            "$ref": "#/components/schemas/FinishCause"
          }
        }
      },
      "PartStarted": {
        "type": "object",
        "description": "A part was appended to a message.",
        "properties": {
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          }
        }
      },
      "PartAppended": {
        "type": "object",
        "description": "Streaming delta appended to a part. Text, reasoning, and tool-input deltas are live-only (`seq = 0`); toolStateChanged supplies complete tool input.",
        "properties": {
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          },
          "text_delta": {
            "type": "string"
          }
        }
      },
      "PartCompleted": {
        "type": "object",
        "description": "A part reached its final form.",
        "properties": {
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          }
        }
      },
      "PartReplaced": {
        "type": "object",
        "description": "A text or reasoning part's text was replaced wholesale. Clients set the part's text to `text` (not append); it supersedes any live deltas they accumulated for the same part id.",
        "properties": {
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ErrorReported": {
        "type": "object",
        "description": "A runtime error was recorded.",
        "properties": {
          "message": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          }
        }
      },
      "ToolStateChanged": {
        "type": "object",
        "description": "A tool call's execution state changed.",
        "properties": {
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ToolExecutionState"
          },
          "error_code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          },
          "input_json": {
            "type": "string"
          },
          "output_json": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64"
          },
          "tool": {
            "type": "string"
          }
        }
      },
      "PermissionRequested": {
        "type": "object",
        "description": "A permission decision is pending.",
        "properties": {
          "request": {
            "type": "string"
          },
          "interaction": {
            "$ref": "#/components/schemas/Interaction"
          }
        }
      },
      "QuestionRequested": {
        "type": "object",
        "description": "A question is pending.",
        "properties": {
          "request": {
            "type": "string"
          },
          "interaction": {
            "$ref": "#/components/schemas/Interaction"
          }
        }
      },
      "InteractionResolved": {
        "type": "object",
        "description": "A pending interaction was resolved.",
        "properties": {
          "request": {
            "type": "string"
          }
        }
      },
      "TodoUpdated": {
        "type": "object",
        "description": "The session todo list changed.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TodoItem"
            }
          }
        }
      },
      "TokensRecorded": {
        "type": "object",
        "description": "Billed usage of one provider call. Durable: one per streaming round of an assistant message, plus side calls (title, summarizer) made for the session, which carry no `message`.",
        "properties": {
          "message": {
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/TokenUsage"
          },
          "model": {
            "type": "string"
          }
        }
      },
      "CompactionApplied": {
        "type": "object",
        "description": "A compaction folded part of the context behind a summary. Emitted by the automatic mid-turn strategies and by a manual `CompactSession`.",
        "properties": {
          "until_seq": {
            "type": "integer",
            "format": "int64"
          },
          "strategy": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "folded_count": {
            "type": "integer",
            "format": "int64"
          },
          "manual": {
            "type": "boolean"
          }
        }
      },
      "Interaction": {
        "type": "object",
        "description": "One pending interaction request.",
        "properties": {
          "id": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/InteractionType"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payload": {
            "type": "object"
          },
          "time_created": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ListInteractionsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/InteractionType"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ListInteractionsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "interactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interaction"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "PermissionResponse": {
        "type": "object",
        "description": "Response to a permission request.",
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "persist": {
            "type": "boolean"
          }
        }
      },
      "QuestionResponse": {
        "type": "object",
        "description": "Response to a question request.",
        "properties": {
          "answer": {
            "type": "string"
          },
          "rejected": {
            "type": "boolean"
          }
        }
      },
      "RespondInteractionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "request": {
            "type": "string"
          },
          "permission": {
            "$ref": "#/components/schemas/PermissionResponse"
          },
          "question": {
            "$ref": "#/components/schemas/QuestionResponse"
          }
        }
      },
      "RespondInteractionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "applied": {
            "type": "boolean"
          }
        }
      },
      "SavedRule": {
        "type": "object",
        "description": "A persisted permission rule. Deleting it revokes it live.",
        "properties": {
          "id": {
            "type": "string"
          },
          "permission": {
            "$ref": "#/components/schemas/RulePermission"
          },
          "tool": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          },
          "time_created": {
            "type": "string",
            "format": "date-time"
          },
          "project_id": {
            "type": "string"
          },
          "rule": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "project_path": {
            "type": "string"
          }
        }
      },
      "ListSavedRulesRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ListSavedRulesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedRule"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "DeleteSavedRuleRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "rule": {
            "type": "string"
          }
        }
      },
      "IngestLogRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "service": {
            "type": "string"
          },
          "level": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "message": {
            "type": "string"
          },
          "extra": {
            "type": "object"
          }
        }
      },
      "McpServerStatus": {
        "type": "object",
        "description": "Status of one MCP server.",
        "properties": {
          "name": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/McpServerState"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string"
          },
          "auth_required": {
            "type": "boolean"
          }
        }
      },
      "GetMcpStatusRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "GetMcpStatusResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpServerStatus"
            }
          }
        }
      },
      "CommandTransport": {
        "type": "object",
        "description": "stdio transport: launch a local command.",
        "properties": {
          "command": {
            "type": "string"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "string> env": {
            "$ref": "#/components/schemas/map<string,"
          }
        }
      },
      "UrlTransport": {
        "type": "object",
        "description": "HTTP/SSE transport: connect to a URL.",
        "properties": {
          "url": {
            "type": "string"
          }
        }
      },
      "AddMcpServerRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "command": {
            "$ref": "#/components/schemas/CommandTransport"
          },
          "url": {
            "$ref": "#/components/schemas/UrlTransport"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ConnectMcpRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DisconnectMcpRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "StartMcpAuthRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "StartMcpAuthResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "authorization_url": {
            "type": "string"
          }
        }
      },
      "CompleteMcpAuthRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      },
      "RemoveMcpAuthRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SessionMcpPeer": {
        "type": "object",
        "description": "A named MCP peer supplied by a local client: either a stdio server the client bridges through a private Unix socket (`socket`), or a remote server the backend connects to itself (`url`). Exactly one is set.",
        "properties": {
          "name": {
            "type": "string"
          },
          "socket": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "headers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpHeader"
            }
          }
        }
      },
      "McpHeader": {
        "type": "object",
        "description": "",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "OpenMcpSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "workdir": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "peers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionMcpPeer"
            }
          },
          "session": {
            "type": "string"
          },
          "ephemeral": {
            "type": "boolean"
          },
          "temp_chat": {
            "type": "boolean"
          }
        }
      },
      "OpenMcpSessionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "TokenUsage": {
        "type": "object",
        "description": "Token accounting for one model round.",
        "properties": {
          "input": {
            "type": "integer",
            "format": "int64"
          },
          "output": {
            "type": "integer",
            "format": "int64"
          },
          "reasoning": {
            "type": "integer",
            "format": "int64"
          },
          "cache_read": {
            "type": "integer",
            "format": "int64"
          },
          "cache_write": {
            "type": "integer",
            "format": "int64"
          },
          "reasoning_unknown": {
            "type": "boolean"
          }
        }
      },
      "TextPart": {
        "type": "object",
        "description": "Text part of a message.",
        "properties": {
          "text": {
            "type": "string"
          }
        }
      },
      "ReasoningPart": {
        "type": "object",
        "description": "Model reasoning trace part.",
        "properties": {
          "text": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          }
        }
      },
      "ToolCallPart": {
        "type": "object",
        "description": "A tool invocation requested by the model. One part covers the whole call: arguments, execution state, and (once finished) its output or error.",
        "properties": {
          "call_id": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "input_json": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ToolExecutionState"
          },
          "error_code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          },
          "output_json": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ToolResultPart": {
        "type": "object",
        "description": "The outcome of a tool invocation.",
        "properties": {
          "call_id": {
            "type": "string"
          },
          "output": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          }
        }
      },
      "AttachmentPart": {
        "type": "object",
        "description": "A binary or file attachment on a message (for example an image attached to a prompt turn).",
        "properties": {
          "name": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "data": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "path": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PartInfo": {
        "type": "object",
        "description": "One part of a message body.",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "$ref": "#/components/schemas/TextPart"
          },
          "reasoning": {
            "$ref": "#/components/schemas/ReasoningPart"
          },
          "tool_call": {
            "$ref": "#/components/schemas/ToolCallPart"
          },
          "tool_result": {
            "$ref": "#/components/schemas/ToolResultPart"
          },
          "attachment": {
            "$ref": "#/components/schemas/AttachmentPart"
          }
        }
      },
      "MessageInfo": {
        "type": "object",
        "description": "Projection snapshot of one message.",
        "properties": {
          "id": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "finish": {
            "$ref": "#/components/schemas/FinishReason"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartInfo"
            }
          },
          "time_created": {
            "type": "string",
            "format": "date-time"
          },
          "time_updated": {
            "type": "string",
            "format": "date-time"
          },
          "finish_cause": {
            "$ref": "#/components/schemas/FinishCause"
          },
          "error": {
            "$ref": "#/components/schemas/MessageError"
          },
          "usage": {
            "$ref": "#/components/schemas/TokenUsage"
          },
          "round_usage": {
            "$ref": "#/components/schemas/TokenUsage"
          }
        }
      },
      "MessageError": {
        "type": "object",
        "description": "Recorded failure of the turn behind an assistant message.",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ListMessagesRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ListMessagesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageInfo"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "GetMessageRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "DeleteMessagePartRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "part": {
            "type": "string"
          }
        }
      },
      "TodoItem": {
        "type": "object",
        "description": "One todo item of a session's plan.",
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TodoStatus"
          }
        }
      },
      "GetSessionTodoRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "TodoList": {
        "type": "object",
        "description": "A session's todo list projection.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TodoItem"
            }
          }
        }
      },
      "RevertedFile": {
        "type": "object",
        "description": "One file a session revert or unrevert wrote (or could not restore).",
        "properties": {
          "path": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "GetHealthResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "GetLocationRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "LocationInfo": {
        "type": "object",
        "description": "Where this backend runs and which directory it serves.",
        "properties": {
          "directory": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "pid": {
            "type": "integer",
            "format": "int64"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "GetConfigRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "GetConfigResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "values": {
            "type": "object"
          }
        }
      },
      "UpdateConfigRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "patch": {
            "type": "object"
          }
        }
      },
      "GetBootstrapRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "Bootstrap": {
        "type": "object",
        "description": "One-round-trip startup snapshot for frontends.",
        "properties": {
          "location": {
            "$ref": "#/components/schemas/LocationInfo"
          },
          "config": {
            "type": "object"
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentSummary"
            }
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelSummary"
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderSummary"
            }
          },
          "commands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommandSummary"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkillSummary"
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSummary"
            }
          },
          "interactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interaction"
            }
          },
          "saved_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedRule"
            }
          },
          "sessions_cursor": {
            "type": "string"
          },
          "context_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContextFile"
            }
          }
        }
      },
      "ContextFile": {
        "type": "object",
        "description": "One context file (`AGENTS.md`) of `Bootstrap.context_files`.",
        "properties": {
          "path": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ProjectInfo": {
        "type": "object",
        "description": "One Project.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "roots": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "session_count": {
            "type": "integer",
            "format": "int64"
          },
          "busy": {
            "type": "boolean"
          }
        }
      },
      "ListProjectsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          }
        }
      },
      "ListProjectsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectInfo"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "GetCurrentProjectRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "ResolveProjectRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "path": {
            "type": "string"
          }
        }
      },
      "ResolveProjectResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "$ref": "#/components/schemas/ProjectInfo"
          }
        }
      },
      "EnsureProjectForPathRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "path": {
            "type": "string"
          }
        }
      },
      "EnsureProjectForPathResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "$ref": "#/components/schemas/ProjectInfo"
          },
          "created": {
            "type": "boolean"
          }
        }
      },
      "CreateProjectRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "name": {
            "type": "string"
          },
          "roots": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GetProjectRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "type": "string"
          }
        }
      },
      "UpdateProjectRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "roots": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DeleteProjectRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "type": "string"
          }
        }
      },
      "ListProjectDirectoriesRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "type": "string"
          }
        }
      },
      "ListProjectDirectoriesResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "directories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "InitProjectGitRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "project": {
            "type": "string"
          }
        }
      },
      "InitProjectGitResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "initialized": {
            "type": "boolean"
          }
        }
      },
      "GetVcsStatusRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          }
        }
      },
      "VcsStatus": {
        "type": "object",
        "description": "Repository status snapshot.",
        "properties": {
          "branch": {
            "type": "string"
          },
          "head": {
            "type": "string"
          },
          "dirty": {
            "type": "integer",
            "format": "int64"
          },
          "ahead": {
            "type": "integer",
            "format": "int64"
          },
          "behind": {
            "type": "integer",
            "format": "int64"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VcsFileChange"
            }
          }
        }
      },
      "VcsFileChange": {
        "type": "object",
        "description": "One changed file.",
        "properties": {
          "path": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/VcsFileStatus"
          }
        }
      },
      "GetVcsDiffRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "raw": {
            "type": "boolean"
          },
          "paths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GetVcsDiffResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "diff": {
            "type": "string"
          }
        }
      },
      "ApplyPatchRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "patch": {
            "type": "string"
          }
        }
      },
      "ApplyPatchResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "applied": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "GetProjectTrustRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "path": {
            "type": "string"
          }
        }
      },
      "GetProjectTrustResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "canonical_path": {
            "type": "string"
          },
          "trust": {
            "type": "string"
          },
          "detected_artifacts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SetProjectTrustRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "path": {
            "type": "string"
          },
          "trust": {
            "type": "string"
          }
        }
      },
      "SetProjectTrustResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "canonical_path": {
            "type": "string"
          },
          "trust": {
            "type": "string"
          }
        }
      },
      "PtySession": {
        "type": "object",
        "description": "State snapshot of one PTY session.",
        "properties": {
          "id": {
            "type": "string"
          },
          "shell": {
            "type": "string"
          },
          "cols": {
            "type": "integer",
            "format": "int64"
          },
          "rows": {
            "type": "integer",
            "format": "int64"
          },
          "cwd": {
            "type": "string"
          }
        }
      },
      "ListShellsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "shells": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreatePtyRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "directory": {
            "type": "string"
          },
          "shell": {
            "type": "string"
          },
          "cols": {
            "type": "integer",
            "format": "int64"
          },
          "rows": {
            "type": "integer",
            "format": "int64"
          },
          "cwd": {
            "type": "string"
          },
          "string> env": {
            "$ref": "#/components/schemas/map<string,"
          }
        }
      },
      "GetPtyRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "UpdatePtyRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "id": {
            "type": "string"
          },
          "cols": {
            "type": "integer",
            "format": "int64"
          },
          "rows": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DeletePtyRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "CreateConnectTokenRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "CreateConnectTokenResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "PtyClientFrame": {
        "type": "object",
        "description": "Client-to-server terminal frame.",
        "properties": {
          "attach": {
            "$ref": "#/components/schemas/PtyAttach"
          },
          "input": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "resize": {
            "$ref": "#/components/schemas/PtyResize"
          },
          "ping": {
            "type": "boolean"
          },
          "upload": {
            "$ref": "#/components/schemas/PtyUpload"
          }
        }
      },
      "PtyUpload": {
        "type": "object",
        "description": "One file uploaded from the browser.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "data": {
            "type": "string",
            "contentEncoding": "base64"
          }
        }
      },
      "PtyUploaded": {
        "type": "object",
        "description": "An upload stored on the host.",
        "properties": {
          "id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        }
      },
      "PtyUploadFailed": {
        "type": "object",
        "description": "An upload the host refused.",
        "properties": {
          "id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "PtyAttach": {
        "type": "object",
        "description": "Session attachment envelope for the gRPC terminal stream.",
        "properties": {
          "id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "PtyResize": {
        "type": "object",
        "description": "Terminal resize request.",
        "properties": {
          "cols": {
            "type": "integer",
            "format": "int64"
          },
          "rows": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PtyServerFrame": {
        "type": "object",
        "description": "Server-to-client terminal frame.",
        "properties": {
          "output": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "exit": {
            "type": "integer",
            "format": "int64"
          },
          "pong": {
            "type": "boolean"
          },
          "uploaded": {
            "$ref": "#/components/schemas/PtyUploaded"
          },
          "upload_failed": {
            "$ref": "#/components/schemas/PtyUploadFailed"
          }
        }
      },
      "ConnectRelayRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "proxy_url": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "extra_ca_path": {
            "type": "string"
          },
          "ephemeral": {
            "type": "boolean"
          }
        }
      },
      "ConnectRelayResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/RelayStatus"
          },
          "link": {
            "type": "string"
          }
        }
      },
      "RelayStatus": {
        "type": "object",
        "description": "",
        "properties": {
          "state": {
            "$ref": "#/components/schemas/RelayState"
          },
          "proxy": {
            "type": "string"
          },
          "room_id": {
            "type": "string"
          },
          "redacted_link": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "binding": {
            "type": "string"
          },
          "binding_reason": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "connected_since": {
            "type": "string",
            "format": "date-time"
          },
          "active_streams": {
            "type": "integer",
            "format": "int64"
          },
          "ephemeral": {
            "type": "boolean"
          }
        }
      },
      "RelayLinkResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "link": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RelayStatus"
          }
        }
      },
      "SessionRef": {
        "type": "object",
        "description": "Session id string (`hysec_...`, `ses_...`, or legacy raw UUID accepted on input; canonical form on output).",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "SessionInfo": {
        "type": "object",
        "description": "Projection summary of one session.",
        "properties": {
          "id": {
            "type": "string"
          },
          "parent": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          },
          "workdir": {
            "type": "string"
          },
          "background": {
            "type": "boolean"
          },
          "time_created": {
            "type": "string",
            "format": "date-time"
          },
          "time_updated": {
            "type": "string",
            "format": "date-time"
          },
          "last_seq": {
            "type": "integer",
            "format": "int64"
          },
          "busy": {
            "type": "boolean"
          },
          "permission_mode": {
            "type": "string"
          },
          "extensions": {
            "type": "object"
          },
          "usage": {
            "$ref": "#/components/schemas/TokenUsage"
          },
          "forked_from": {
            "$ref": "#/components/schemas/ForkSource"
          },
          "revert": {
            "$ref": "#/components/schemas/SessionRevert"
          },
          "archived": {
            "type": "boolean"
          },
          "archived_at": {
            "type": "string",
            "format": "date-time"
          },
          "ephemeral": {
            "type": "boolean"
          },
          "project_id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/SessionKind"
          },
          "effective_effort": {
            "type": "string"
          },
          "effort_source": {
            "$ref": "#/components/schemas/EffortSource"
          },
          "temp_chat": {
            "type": "boolean"
          }
        }
      },
      "ForkSource": {
        "type": "object",
        "description": "Where a forked session came from.",
        "properties": {
          "session": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          }
        }
      },
      "SessionRevert": {
        "type": "object",
        "description": "A pending revert of a session.",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "hidden_messages": {
            "type": "integer",
            "format": "int64"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevertedFile"
            }
          }
        }
      },
      "CreateSessionRequest": {
        "type": "object",
        "description": "Where a new root session works is chosen by the client (ADR-0024):  - `kind = SESSION_KIND_TEMPORARY`: no Project; the server creates the session's scratch directory and uses it as the workdir. `project_id` and `workdir` must be unset (`invalid_argument`). - `project_id` set (kind `SESSION_KIND_PROJECT` or unset): the Project must exist (`not_found`). `workdir`, when set, must lie inside one of its roots (`invalid_argument` otherwise); unset means the primary root. - no `project_id`, `workdir` set (kind `SESSION_KIND_PROJECT` or unset): the Project is found or created as by `EnsureProjectForPath(workdir)` and the session works in `workdir` (a local client passes its cwd). A temp chat (`temp_chat`) only joins a Project that already contains `workdir`; with none it is `SESSION_KIND_TEMPORARY` and works in `workdir`. - neither: `invalid_argument`.  A child session (`parent` set) always joins its parent's Project and kind: `project_id` and `kind` must be unset (`invalid_argument`); `workdir` defaults to the parent's. `workdir` must be absolute without `..` components.",
        "properties": {
          "agent": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "workdir": {
            "type": "string"
          },
          "parent": {
            "type": "string"
          },
          "initialize": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "ephemeral": {
            "type": "boolean"
          },
          "project_id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/SessionKind"
          },
          "temp_chat": {
            "type": "boolean"
          }
        }
      },
      "CreateSessionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionInfo"
          }
        }
      },
      "GetSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "ListSessionsRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "parent": {
            "type": "string"
          },
          "page": {
            "$ref": "#/components/schemas/PageRequest"
          },
          "include_archived": {
            "type": "boolean"
          },
          "archived_only": {
            "type": "boolean"
          },
          "project_id": {
            "type": "string"
          }
        }
      },
      "ListSessionsResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionInfo"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "UpdateSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "background": {
            "type": "boolean"
          },
          "permission_mode": {
            "type": "string"
          },
          "archived": {
            "type": "boolean"
          }
        }
      },
      "DeleteSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "ForkSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "until_seq": {
            "type": "integer",
            "format": "int64"
          },
          "message_id": {
            "type": "string"
          }
        }
      },
      "ForkSessionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionInfo"
          },
          "prompt_text": {
            "type": "string"
          }
        }
      },
      "CompactSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "until_seq": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CompactSessionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "compacted_until_seq": {
            "type": "integer",
            "format": "int64"
          },
          "strategy": {
            "type": "string"
          }
        }
      },
      "SummarizeSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "SummarizeSessionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "summary_message": {
            "type": "string"
          }
        }
      },
      "RefreshSessionContextRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          }
        }
      },
      "RefreshSessionContextResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "pending": {
            "type": "boolean"
          }
        }
      },
      "RevertSessionRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "until_seq": {
            "type": "integer",
            "format": "int64"
          },
          "undo": {
            "type": "boolean"
          },
          "message_id": {
            "type": "string"
          }
        }
      },
      "RevertSessionResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionInfo"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevertedFile"
            }
          }
        }
      },
      "PromptTurn": {
        "type": "object",
        "description": "A plain user prompt turn.",
        "properties": {
          "text": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PromptAttachment"
            }
          }
        }
      },
      "PromptAttachment": {
        "type": "object",
        "description": "One image attached to a prompt turn.",
        "properties": {
          "name": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "data": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "path": {
            "type": "string"
          }
        }
      },
      "CommandTurn": {
        "type": "object",
        "description": "A slash-command turn.",
        "properties": {
          "command": {
            "type": "string"
          },
          "arguments": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "model": {
            "type": "string"
          }
        }
      },
      "ShellTurn": {
        "type": "object",
        "description": "A synthetic shell turn, the `!` command: the bundle that claims it (`hya/direct-shell`) runs the command line as the user's own `bash` call with no model round; with no such bundle enabled the turn is refused with `invalid_argument`. The user's own shell command never asks for permission in any mode (approved once); an explicit Deny rule still blocks it, a `tool.execute.before` hook can still veto it, and a directory outside the working directory still asks.",
        "properties": {
          "command": {
            "type": "string"
          },
          "agent": {
            "type": "string"
          },
          "model": {
            "$ref": "#/components/schemas/ModelRef"
          }
        }
      },
      "CreateTurnRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "prompt": {
            "$ref": "#/components/schemas/PromptTurn"
          },
          "command": {
            "$ref": "#/components/schemas/CommandTurn"
          },
          "shell": {
            "$ref": "#/components/schemas/ShellTurn"
          }
        }
      },
      "CreateTurnResponse": {
        "type": "object",
        "description": "",
        "properties": {
          "turn": {
            "$ref": "#/components/schemas/TurnInfo"
          }
        }
      },
      "TurnInfo": {
        "type": "object",
        "description": "Projection snapshot of one admitted turn. For prompt and command turns the turn id is the id of the admitted **user** message; the assistant message(s) the engine drives for it arrive on the event stream (`messageStarted` with `ROLE_ASSISTANT`). For shell turns it is the id of the synthetic assistant message. Slash commands intercepted by workflow features return an empty id.",
        "properties": {
          "id": {
            "type": "string"
          },
          "session": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/TurnState"
          },
          "finish": {
            "$ref": "#/components/schemas/FinishReason"
          },
          "error_code": {
            "type": "string"
          },
          "error_message": {
            "type": "string"
          }
        }
      },
      "GetTurnRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "turn": {
            "type": "string"
          }
        }
      },
      "WaitTurnRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "session": {
            "type": "string"
          },
          "turn": {
            "type": "string"
          },
          "timeout_ms": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CancelTurnRequest": {
        "type": "object",
        "description": "",
        "properties": {
          "only_if_current": {
            "type": "boolean"
          },
          "session": {
            "type": "string"
          },
          "turn": {
            "type": "string"
          }
        }
      },
      "AgentEffortSource": {
        "type": "string",
        "description": "Which layer chose an agent's default thinking effort.",
        "enum": [
          "AGENT_EFFORT_SOURCE_UNSPECIFIED",
          "AGENT_EFFORT_SOURCE_PREFERENCE",
          "AGENT_EFFORT_SOURCE_CONFIGURED",
          "AGENT_EFFORT_SOURCE_AUTHORED",
          "AGENT_EFFORT_SOURCE_NONE"
        ]
      },
      "AgentModelSource": {
        "type": "string",
        "description": "Which tier resolved an agent's effective base model.",
        "enum": [
          "AGENT_MODEL_SOURCE_UNSPECIFIED",
          "AGENT_MODEL_SOURCE_SESSION",
          "AGENT_MODEL_SOURCE_CONFIGURED",
          "AGENT_MODEL_SOURCE_REMEMBERED",
          "AGENT_MODEL_SOURCE_DEFAULT"
        ]
      },
      "AuthStatus": {
        "type": "string",
        "description": "Authentication state of a provider route.",
        "enum": [
          "AUTH_STATUS_UNSPECIFIED",
          "AUTH_STATUS_CREDENTIALED",
          "AUTH_STATUS_UNAUTHENTICATED",
          "AUTH_STATUS_AUTH_REQUIRED",
          "AUTH_STATUS_AUTH_REJECTED",
          "AUTH_STATUS_NOT_APPLICABLE"
        ]
      },
      "InteractionType": {
        "type": "string",
        "description": "Kind of a pending interaction.",
        "enum": [
          "INTERACTION_TYPE_UNSPECIFIED",
          "INTERACTION_TYPE_PERMISSION",
          "INTERACTION_TYPE_QUESTION"
        ]
      },
      "RulePermission": {
        "type": "string",
        "description": "Effect of a saved permission rule.",
        "enum": [
          "RULE_PERMISSION_UNSPECIFIED",
          "RULE_PERMISSION_ALLOW",
          "RULE_PERMISSION_ASK",
          "RULE_PERMISSION_DENY"
        ]
      },
      "LogLevel": {
        "type": "string",
        "description": "Severity of an ingested log entry.",
        "enum": [
          "LOG_LEVEL_UNSPECIFIED",
          "LOG_LEVEL_DEBUG",
          "LOG_LEVEL_INFO",
          "LOG_LEVEL_WARN",
          "LOG_LEVEL_ERROR"
        ]
      },
      "McpServerState": {
        "type": "string",
        "description": "Connection state of an MCP server.",
        "enum": [
          "MCP_SERVER_STATE_UNSPECIFIED",
          "MCP_SERVER_STATE_DESIRED",
          "MCP_SERVER_STATE_CONNECTED",
          "MCP_SERVER_STATE_DISCONNECTED",
          "MCP_SERVER_STATE_FAILED"
        ]
      },
      "FinishReason": {
        "type": "string",
        "description": "Terminal reason of an assistant message.",
        "enum": [
          "FINISH_REASON_UNSPECIFIED",
          "FINISH_REASON_STOP",
          "FINISH_REASON_TOOL_CALLS",
          "FINISH_REASON_LENGTH",
          "FINISH_REASON_CANCELLED",
          "FINISH_REASON_ERROR"
        ]
      },
      "FinishCause": {
        "type": "string",
        "description": "Why the harness (not the model) ended an assistant message. Context on top of FinishReason; unset when the model ended the message itself.",
        "enum": [
          "FINISH_CAUSE_UNSPECIFIED",
          "FINISH_CAUSE_USER_CANCEL",
          "FINISH_CAUSE_SHUTDOWN",
          "FINISH_CAUSE_LEADER_FAILED",
          "FINISH_CAUSE_INTERRUPTED",
          "FINISH_CAUSE_PROVIDER_ERROR",
          "FINISH_CAUSE_OTHER",
          "FINISH_CAUSE_ARCHIVED",
          "FINISH_CAUSE_HANDOFF"
        ]
      },
      "Role": {
        "type": "string",
        "description": "Author role of a message.",
        "enum": [
          "ROLE_UNSPECIFIED",
          "ROLE_USER",
          "ROLE_ASSISTANT",
          "ROLE_SYSTEM",
          "ROLE_TOOL"
        ]
      },
      "ToolExecutionState": {
        "type": "string",
        "description": "Execution state of one tool call.",
        "enum": [
          "TOOL_EXECUTION_STATE_UNSPECIFIED",
          "TOOL_EXECUTION_STATE_PENDING",
          "TOOL_EXECUTION_STATE_RUNNING",
          "TOOL_EXECUTION_STATE_OK",
          "TOOL_EXECUTION_STATE_ERROR",
          "TOOL_EXECUTION_STATE_DENIED"
        ]
      },
      "TodoStatus": {
        "type": "string",
        "description": "Lifecycle status of a todo item.",
        "enum": [
          "TODO_STATUS_UNSPECIFIED",
          "TODO_STATUS_PENDING",
          "TODO_STATUS_IN_PROGRESS",
          "TODO_STATUS_COMPLETED",
          "TODO_STATUS_BLOCKED"
        ]
      },
      "VcsFileStatus": {
        "type": "string",
        "description": "Change status of one file.",
        "enum": [
          "VCS_FILE_STATUS_UNSPECIFIED",
          "VCS_FILE_STATUS_ADDED",
          "VCS_FILE_STATUS_MODIFIED",
          "VCS_FILE_STATUS_DELETED",
          "VCS_FILE_STATUS_RENAMED",
          "VCS_FILE_STATUS_UNTRACKED"
        ]
      },
      "RelayState": {
        "type": "string",
        "description": "The host connector's state.",
        "enum": [
          "RELAY_STATE_UNSPECIFIED",
          "RELAY_STATE_DISCONNECTED",
          "RELAY_STATE_CONNECTING",
          "RELAY_STATE_CONNECTED",
          "RELAY_STATE_BACKOFF"
        ]
      },
      "EffortSource": {
        "type": "string",
        "description": "Source of a session's effective reasoning effort.",
        "enum": [
          "EFFORT_SOURCE_UNSPECIFIED",
          "EFFORT_SOURCE_SUFFIX",
          "EFFORT_SOURCE_AGENT",
          "EFFORT_SOURCE_PREFERENCE",
          "EFFORT_SOURCE_MODEL_DEFAULT",
          "EFFORT_SOURCE_GLOBAL_DEFAULT",
          "EFFORT_SOURCE_NONE"
        ]
      },
      "SessionKind": {
        "type": "string",
        "description": "Kind of a session (ADR-0024).",
        "enum": [
          "SESSION_KIND_UNSPECIFIED",
          "SESSION_KIND_PROJECT",
          "SESSION_KIND_TEMPORARY"
        ]
      },
      "TurnState": {
        "type": "string",
        "description": "Terminal state of a turn.",
        "enum": [
          "TURN_STATE_UNSPECIFIED",
          "TURN_STATE_ADMITTED",
          "TURN_STATE_RUNNING",
          "TURN_STATE_FINISHED",
          "TURN_STATE_FAILED",
          "TURN_STATE_CANCELLED"
        ]
      }
    }
  }
}