{"openapi":"3.1.0","info":{"title":"AgentScope","version":"2.0.6dev"},"paths":{"/agent/schema":{"get":{"tags":["agent"],"summary":"[Deprecated] Legacy sectioned schema — use /schema/v2","description":"Return the legacy sectioned JSON Schema fragments.\n\n.. deprecated::\n    Superseded by :func:`get_agent_schema_v2`, which returns the\n    full :class:`AgentData` schema in a single ``schema`` field.\n    Kept for backwards compatibility with existing API consumers.\n    New consumers should call ``GET /agent/schema/v2``.\n\nThe frontend previously used three sections — identity, context\nconfig, and react config — so we return them as separate\nself-contained schemas rather than a single :class:`AgentData`\nschema with ``$ref`` s.\n\nReturns:\n    `AgentSchemaResponse`:\n        Schemas for the three form sections.","operationId":"get_agent_schema_agent_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSchemaResponse"}}}},"404":{"description":"Not found"}},"deprecated":true}},"/agent/schema/v2":{"get":{"tags":["agent"],"summary":"Full AgentData JSON Schema for the agent form","description":"Return the full :class:`AgentData` JSON Schema.\n\nSuperset of the legacy sectioned endpoint. The response body is a\nsingle ``schema`` field carrying the whole Pydantic-generated\nschema of :class:`AgentData`, with two curated exclusions handled\nat the model layer (so no post-processing is needed here):\n\n- ``id``: server-assigned, marked :class:`SkipJsonSchema` on\n  :attr:`AgentData.id`.\n- ``context_config.summary_schema``: internal structured-output\n  spec for the compression model, dropped below since it is not\n  user-editable and there is no equivalent hook on the Pydantic\n  side.\n\n``$ref`` inlining is delegated to\n:func:`~agentscope._utils._common._flatten_json_schema` so the\nfrontend can render every property from the response body alone.\n\nThe frontend derives its section grouping (identity / context /\nreact / invite) directly from this schema — top-level scalar\nproperties are the \"identity\" section, and top-level nested-object\nproperties each become their own section. Adding a new\nuser-editable field to :class:`AgentData` is thus enough to have it\nappear in the create / edit form without a router change.\n\nReturns:\n    `AgentSchemaV2Response`:\n        ``schema`` = the full :class:`AgentData` JSON Schema.","operationId":"get_agent_schema_v2_agent_schema_v2_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSchemaV2Response"}}}},"404":{"description":"Not found"}}}},"/agent/":{"get":{"tags":["agent"],"summary":"List all agents","description":"Return all agent records visible to the authenticated user.\n\nIncludes the caller's own ``source == \"user\"`` agents plus any agents\nshared to them through :class:`ResourceAccessPolicyBase`. Each entry\ncarries an ``editable`` flag indicating whether the caller may\nPATCH/DELETE it.\n\nArgs:\n    user_id (`str`):\n        Injected authenticated user ID.\n    access (`ResourceAccessService`):\n        Injected resource access service.\n\nReturns:\n    `ListAgentsResponse`:\n        All visible agent records paired with per-viewer editability.","operationId":"list_agents_agent__get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["agent"],"summary":"Create a new agent","description":"Create and persist a new agent configuration.\n\nArgs:\n    body (`CreateAgentRequest`):\n        Agent configuration to store.\n    user_id (`str`):\n        Injected authenticated user ID.\n    storage (`StorageBase`):\n        Injected storage backend.\n\nReturns:\n    `CreateAgentResponse`:\n        The server-assigned agent identifier.\n\nRaises:\n    `HTTPException`: 422 if the request body passes\n        :class:`CreateAgentRequest` validation but the resulting\n        :class:`AgentData` fails its cross-field invariants (e.g.\n        ``invite_config.invitable=True`` without a non-empty\n        ``invite_description``). Symmetrical with\n        :func:`update_agent`.","operationId":"create_agent_agent__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{agent_id}":{"patch":{"tags":["agent"],"summary":"Update an agent","description":"Partially update an existing agent configuration.\n\nOnly the fields present in the request body are updated; all other fields\nkeep their current values.\n\nArgs:\n    agent_id (`str`): The agent to update.\n    body (`UpdateAgentRequest`): Fields to update.\n    user_id (`str`): Injected authenticated user ID.\n    storage (`StorageBase`): Injected storage backend.\n    access (`ResourceAccessService`): Injected access service.\n\nReturns:\n    `AgentView`: The full agent record after the update.\n\nRaises:\n    `HTTPException`: 404 if the agent is not visible to the caller;\n        403 if visible but only readable.","operationId":"update_agent_agent__agent_id__patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentView"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent"],"summary":"Delete an agent","description":"Permanently delete an agent configuration.\n\nCascades through every session owned by this agent (and, for team\nleaders, through every worker session) — cancelling any in-flight\nchat run, removing storage records, and purging bus state.\n\nArgs:\n    agent_id (`str`): The agent to delete.\n    user_id (`str`): Injected authenticated user ID.\n    session_service (`SessionService`): Injected session service.\n    access (`ResourceAccessService`): Injected access service — used\n        to resolve the owning user and enforce the edit permission\n        when a shared editor deletes the agent.\n\nRaises:\n    `HTTPException`: 404 if the agent is not visible to the caller;\n        403 if visible but only readable.","operationId":"delete_agent_agent__agent_id__delete","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/":{"post":{"tags":["chat"],"summary":"Trigger a chat run (fire-and-forget)","description":"Trigger a chat run for the specified session.\n\nEvents produced during the run are published to the message bus and\ndelivered to any active ``GET /sessions/{session_id}/stream`` SSE\nsubscriber. The caller does **not** receive events from this\nendpoint's response body.\n\nAccepts the same ``input`` payloads as before:\n\n- ``Msg`` / ``list[Msg]``: new user message(s) — spawned directly.\n- ``UserConfirmResultEvent`` / ``ExternalExecutionResultEvent``:\n  resume a paused tool call (human-in-the-loop) — routed to the\n  owning session and enqueued for the dispatcher.\n- ``None``: continue from current state — spawned directly.\n\nArgs:\n    request (`ChatRequest`):\n        JSON body with ``agent_id``, ``session_id``, and ``input``.\n    user_id (`str`):\n        Injected user id.\n    chat_service (`ChatService`):\n        Injected application-wide chat service.\n    chat_run_registry (`ChatRunRegistry`):\n        Injected per-process chat-run registry.\n    message_bus (`MessageBus`):\n        Injected message bus, used to resolve subagent-confirm\n        routing and to enqueue resume triggers.\n\nReturns:\n    `ChatTriggerResponse`:\n        Confirms the run was scheduled (for a resume, that it was\n        enqueued).\n\nRaises:\n    `HTTPException`:\n        409 if a chat run for this session is already in flight in\n        this process (the registry enforces single-run-per-session).\n        Only direct-spawn paths (new messages / ``None``) can raise\n        this; the enqueued resume path never does.","operationId":"chat_chat__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatTriggerResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credential/schemas":{"get":{"tags":["credential"],"summary":"List JSON schemas for all credential types","description":"Return JSON schemas for all registered credential types.\n\nUsed by the frontend to render credential creation forms dynamically.","operationId":"list_credential_schemas_credential_schemas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCredentialSchemasResponse"}}}},"404":{"description":"Not found"}}}},"/credential/":{"get":{"tags":["credential"],"summary":"List all credentials","description":"Return all credential records visible to the authenticated user.\n\nIncludes the caller's own credentials plus any credentials shared to\nthem through :class:`ResourceAccessPolicyBase`. Shared entries have\ntheir secret ``data`` payload masked — only the discriminator and\ndisplay name survive in the response — while runtime resolution\n(e.g. the chat model service) still sees the full payload.\n\nArgs:\n    user_id (`str`):\n        Injected authenticated user ID.\n    access (`ResourceAccessService`):\n        Injected resource access service.\n\nReturns:\n    `ListCredentialsResponse`:\n        All visible credentials paired with editability and\n        (for shared entries) redacted data.","operationId":"list_credentials_credential__get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCredentialsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["credential"],"summary":"Create a new credential","description":"Store a new credential.\n\nArgs:\n    body (`CreateCredentialRequest`): Credential payload to store.\n    user_id (`str`): Injected authenticated user ID.\n    storage (`StorageBase`): Injected storage backend.\n\nReturns:\n    `CreateCredentialResponse`: The server-assigned credential identifier.","operationId":"create_credential_credential__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCredentialRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCredentialResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credential/{credential_id}":{"patch":{"tags":["credential"],"summary":"Update a credential","description":"Replace the payload of an existing credential.\n\nArgs:\n    credential_id (`str`): The credential to update.\n    body (`UpdateCredentialRequest`): New credential payload.\n    user_id (`str`): Injected authenticated user ID.\n    storage (`StorageBase`): Injected storage backend.\n    access (`ResourceAccessService`): Injected access service — used\n        to resolve the owning user and enforce the edit permission\n        when a shared editor updates the credential.\n\nReturns:\n    `CredentialView`: The updated credential record.\n\nRaises:\n    `HTTPException`: 404 if the credential is not visible to the\n        caller; 403 if visible but only readable.","operationId":"update_credential_credential__credential_id__patch","parameters":[{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","title":"Credential Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCredentialRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialView"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["credential"],"summary":"Delete a credential","description":"Permanently delete a credential.\n\nArgs:\n    credential_id (`str`): The credential to delete.\n    user_id (`str`): Injected authenticated user ID.\n    storage (`StorageBase`): Injected storage backend.\n    access (`ResourceAccessService`): Injected access service — used\n        to resolve the owning user and enforce the edit permission\n        when a shared editor deletes the credential.\n\nRaises:\n    `HTTPException`: 404 if the credential is not visible to the\n        caller; 403 if visible but only readable.","operationId":"delete_credential_credential__credential_id__delete","parameters":[{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","title":"Credential Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Report service liveness and per-component readiness","description":"Report whether the service is ready to serve requests.\n\nThe check is deliberately I/O-free — it only inspects what is\nattached to ``app.state``, so probing it never touches Redis, the\ndatabase or a workspace backend.\n\nUnder a plain ``uvicorn.run(app)`` the ``not_ready`` status is\neffectively unreachable: uvicorn completes the lifespan startup\nbefore it accepts connections, so anything that reaches this handler\nalready has the lifespan components in place.  What it does catch is\nthe mount-as-sub-app deployment documented in\n:func:`~agentscope.app.create_app` — Starlette does not run a mounted\nsub-app's lifespan, so every lifespan component stays missing and\nall business endpoints are broken.  Reporting 503 here turns that\nsilent misconfiguration into one clear signal.\n\nArgs:\n    request (`Request`): The incoming FastAPI request.\n    response (`Response`): The outgoing response, whose status code\n        is downgraded to ``503`` when the service is not ready.\n\nReturns:\n    `HealthResponse`: The overall status, API version and the\n    per-component readiness map.","operationId":"get_health_health_get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hub/mcp":{"get":{"tags":["hub"],"summary":"List Mcp Hubs","description":"Return every registered MCP hub.","operationId":"list_mcp_hubs_hub_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/HubInfo"},"type":"array","title":"Response List Mcp Hubs Hub Mcp Get"}}}}}}},"/hub/mcp/{hub_id}/cards":{"get":{"tags":["hub"],"summary":"List Mcp Cards","description":"Browse or search one MCP hub's catalog.","operationId":"list_mcp_cards_hub_mcp__hub_id__cards_get","parameters":[{"name":"hub_id","in":"path","required":true,"schema":{"type":"string","title":"Hub Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPHubPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hub/mcp/{hub_id}/cards/{card_id}":{"get":{"tags":["hub"],"summary":"Get Mcp Card","description":"Return one MCP card, including the inputs the user must fill.","operationId":"get_mcp_card_hub_mcp__hub_id__cards__card_id__get","parameters":[{"name":"hub_id","in":"path","required":true,"schema":{"type":"string","title":"Hub Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPCard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hub/mcp/{hub_id}/cards/{card_id}/install":{"post":{"tags":["hub"],"summary":"Install Mcp","description":"Fill a card's template and add the result to the user's library.\n\nInstalling is a user-level act with no workspace involved — putting\nthe MCP into a session's workspace is separate and explicit. The\nrecord keeps ``(hub_id, card_id)`` so the library can later answer\n\"where did this come from\" and \"is there a newer version\".\n\nNote that the config is not connection-tested here, so a mistyped\nAPI key surfaces on first use rather than now. Testing it would mean\nconnecting from the app process, and a stdio MCP would then spawn\nits command here instead of in the workspace sandbox.","operationId":"install_mcp_hub_mcp__hub_id__cards__card_id__install_post","parameters":[{"name":"hub_id","in":"path","required":true,"schema":{"type":"string","title":"Hub Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallMCPRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hub/skill":{"get":{"tags":["hub"],"summary":"List Skill Hubs","description":"Return every registered skill hub.","operationId":"list_skill_hubs_hub_skill_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/HubInfo"},"type":"array","title":"Response List Skill Hubs Hub Skill Get"}}}}}}},"/hub/skill/{hub_id}/cards":{"get":{"tags":["hub"],"summary":"List Skill Cards","description":"Browse or search one skill hub's catalog.","operationId":"list_skill_cards_hub_skill__hub_id__cards_get","parameters":[{"name":"hub_id","in":"path","required":true,"schema":{"type":"string","title":"Hub Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillHubPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hub/skill/{hub_id}/cards/{card_id}":{"get":{"tags":["hub"],"summary":"Get Skill Card","description":"Return one skill card, including its ``SKILL.md`` body.","operationId":"get_skill_card_hub_skill__hub_id__cards__card_id__get","parameters":[{"name":"hub_id","in":"path","required":true,"schema":{"type":"string","title":"Hub Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillCard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/hub/skill/{hub_id}/cards/{card_id}/install":{"post":{"tags":["hub"],"summary":"Install Skill","description":"Add a skill card to the user's library.\n\nMirrors the MCP install: user-level, no workspace involved. The\narchive is not downloaded here — only the card's metadata is\nrecorded, and the files are fetched when the skill is actually put\ninto a workspace. So a hub that has since dropped the card fails\nthen rather than now.","operationId":"install_skill_hub_skill__hub_id__cards__card_id__install_post","parameters":[{"name":"hub_id","in":"path","required":true,"schema":{"type":"string","title":"Hub Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/embedding_models":{"get":{"tags":["knowledge_bases"],"summary":"List embedding models compatible with the KB dimension policy","description":"List embedding models the user can pick at KB-creation time.\n\nWalks every credential visible to the caller (own + shared via the\nresource access policy), looks up each provider's embedding model\nclass, gathers its model cards, and projects each card through the\nmanager's :class:`DimensionPolicy`. Incompatible cards are\ndropped; matryoshka cards under a ``FIXED`` /\n``LOCKED_BY_EXISTING`` policy are narrowed to the locked\ndimension.  Providers that end up with zero compatible models are\nomitted from the response entirely.\n\nArgs:\n    user_id (`str`):\n        Injected authenticated user ID.\n    access (`ResourceAccessService`):\n        Injected resource access service; enumerates visible\n        credentials (own + shared) so KB creation works against\n        shared credentials too.\n    manager (`KnowledgeBaseManagerBase`):\n        Injected knowledge base manager.\n\nReturns:\n    `ListKbEmbeddingModelsResponse`:\n        One entry per credential with at least one compatible\n        embedding model, plus the policy used for filtering.","operationId":"list_kb_embedding_models_knowledge_bases_embedding_models_get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListKbEmbeddingModelsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/middleware/parameters_schema":{"get":{"tags":["knowledge_bases"],"summary":"JSON Schema for the KB middleware's tunable parameters","description":"Return the parameter schema for\n:class:`agentscope.middleware.RAGMiddleware`.\n\nThe schema is shaped like every other ``parameter_schema`` served\nby this service — title / description / default / enum / minimum\n/ maximum — so the front-end can render the session-level KB\nattachment form with the same schema-driven component used for\nmodel parameters.\n\nArgs:\n    _ (`str`):\n        Injected authenticated user ID; only used to gate the\n        endpoint behind authentication.\n\nReturns:\n    `KbMiddlewareParametersSchemaResponse`:\n        The JSON Schema describing the middleware's\n        user-tunable parameters.","operationId":"get_kb_middleware_parameters_schema_knowledge_bases_middleware_parameters_schema_get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KbMiddlewareParametersSchemaResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/supported_content_types":{"get":{"tags":["knowledge_bases"],"summary":"List file types the configured parsers can ingest","description":"Advertise the union of media types and filename extensions every\nregistered parser accepts.\n\nUsed by the front-end to populate the document picker's ``accept``\nattribute and to reject drag-dropped files whose extension lies\noutside the supported set before the upload starts.  Routing on\nupload still goes through the media type — this endpoint is a\ncapability hint, not authoritative dispatch.\n\nArgs:\n    _ (`str`):\n        Injected authenticated user ID; only used to gate the\n        endpoint behind authentication.\n    parsers (`list[ParserBase] | dict[str, ParserBase]`):\n        Injected parser registry — the same value the index worker\n        uses to dispatch uploads.\n\nReturns:\n    `ListSupportedContentTypesResponse`:\n        Deduplicated, sorted unions of ``media_types`` and\n        ``extensions``.","operationId":"list_supported_content_types_knowledge_bases_supported_content_types_get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSupportedContentTypesResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/":{"post":{"tags":["knowledge_bases"],"summary":"Create a new knowledge base","description":"Create a new knowledge base for the authenticated user.\n\nAllocates a fresh vector store collection sized to the embedding\nmodel's output dimension and persists the knowledge base record.\n\nArgs:\n    body (`CreateKnowledgeBaseRequest`):\n        Knowledge base name, description, and embedding model\n        configuration.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.\n\nReturns:\n    `CreateKnowledgeBaseResponse`:\n        The server-assigned knowledge base identifier.","operationId":"create_knowledge_base_knowledge_bases__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeBaseRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeBaseResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["knowledge_bases"],"summary":"List the caller's knowledge bases","description":"Return all knowledge bases visible to the authenticated user.\n\nIncludes the caller's own knowledge bases plus any shared to them\nthrough :class:`ResourceAccessPolicyBase`. Each entry carries an\n``editable`` flag: ``read`` grants search + attach; ``edit`` also\ngrants document add/delete and metadata update.\n\nArgs:\n    user_id (`str`):\n        Injected authenticated user ID.\n    access (`ResourceAccessService`):\n        Injected resource access service.\n\nReturns:\n    `ListKnowledgeBasesResponse`:\n        All visible knowledge bases paired with per-viewer\n        editability.","operationId":"list_knowledge_bases_knowledge_bases__get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListKnowledgeBasesResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/{knowledge_base_id}":{"patch":{"tags":["knowledge_bases"],"summary":"Update mutable fields on a knowledge base","description":"Update mutable fields on a knowledge base.\n\nOnly ``name`` and ``description`` can be updated.  The embedding\nmodel configuration is pinned at creation time and cannot be\nchanged.\n\nArgs:\n    body (`UpdateKnowledgeBaseRequest`):\n        The fields to update; omitted fields stay unchanged.\n    knowledge_base_id (`str`):\n        The knowledge base to update.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.\n\nReturns:\n    `KnowledgeBaseView`:\n        The knowledge base record after the update.","operationId":"update_knowledge_base_knowledge_bases__knowledge_base_id__patch","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKnowledgeBaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseView"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["knowledge_bases"],"summary":"Delete a knowledge base","description":"Permanently delete a knowledge base.\n\nDrops the underlying vector store collection together with every\nassociated document and the knowledge base record itself.\n\nArgs:\n    knowledge_base_id (`str`):\n        The knowledge base to delete.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.","operationId":"delete_knowledge_base_knowledge_bases__knowledge_base_id__delete","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/{knowledge_base_id}/documents":{"get":{"tags":["knowledge_bases"],"summary":"List documents registered in a knowledge base","description":"List every document registered against a knowledge base.\n\nReads from the storage backend (service-mode source of truth), so\ndocuments in any lifecycle state — including ``pending`` /\n``parsing`` / ``error`` — are returned alongside ``ready`` ones.\n\nArgs:\n    knowledge_base_id (`str`):\n        The target knowledge base id.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.\n\nReturns:\n    `ListKnowledgeDocumentsResponse`:\n        One view per registered document.","operationId":"list_knowledge_documents_knowledge_bases__knowledge_base_id__documents_get","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListKnowledgeDocumentsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["knowledge_bases"],"summary":"Upload a document into a knowledge base","description":"Register an uploaded document and dispatch it for indexing.\n\nThe HTTP connection covers only the upload phase: the request body\nis streamed into the blob store, a ``pending`` document record is\npersisted, the indexing task is dispatched, and the response is\nreturned.  Parsing / chunking / embedding happen asynchronously in\na worker; the client tracks progress via\n:func:`list_knowledge_document_status`.\n\nArgs:\n    knowledge_base_id (`str`):\n        The knowledge base to receive the document.\n    file (`UploadFile`):\n        The uploaded file (multipart/form-data).\n    content_type (`str | None`, optional):\n        Override the IANA media type used to route the upload.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.\n\nReturns:\n    `UploadKnowledgeDocumentResponse`:\n        The server-assigned document id, filename, and the\n        initial lifecycle state (always ``\"pending\"``).","operationId":"upload_knowledge_document_knowledge_bases__knowledge_base_id__documents_post","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_knowledge_document_knowledge_bases__knowledge_base_id__documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadKnowledgeDocumentResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/{knowledge_base_id}/documents/status":{"get":{"tags":["knowledge_bases"],"summary":"Batch-query indexing status of one or more documents","description":"Return the current lifecycle state of a batch of documents.\n\nDesigned for the front-end's status polling loop: the page sends\nevery in-flight document id at once so per-document round-trips\ndo not multiply with concurrency.\n\nArgs:\n    knowledge_base_id (`str`):\n        The target knowledge base id.\n    ids (`str`):\n        Comma-separated document ids.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.\n\nReturns:\n    `ListKnowledgeDocumentStatusResponse`:\n        Views for the matched documents.","operationId":"list_knowledge_document_status_knowledge_bases__knowledge_base_id__documents_status_get","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated list of document ids to query. Missing ids are silently omitted from the response.","title":"Ids"},"description":"Comma-separated list of document ids to query. Missing ids are silently omitted from the response."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListKnowledgeDocumentStatusResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/{knowledge_base_id}/documents/{document_id}":{"delete":{"tags":["knowledge_bases"],"summary":"Delete a document from a knowledge base","description":"Remove a document and all its chunks from a knowledge base.\n\nArgs:\n    knowledge_base_id (`str`):\n        The knowledge base the document belongs to.\n    document_id (`str`):\n        The document to delete.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.","operationId":"delete_knowledge_document_knowledge_bases__knowledge_base_id__documents__document_id__delete","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","description":"The document id.","title":"Document Id"},"description":"The document id."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge_bases/{knowledge_base_id}/search":{"post":{"tags":["knowledge_bases"],"summary":"Search a knowledge base by natural-language query","description":"Run a similarity search over a knowledge base.\n\nEmbeds the query with the knowledge base's configured embedding\nmodel and returns the top-K most similar chunks.\n\nArgs:\n    body (`SearchKnowledgeBaseRequest`):\n        The query text and ``top_k``.\n    knowledge_base_id (`str`):\n        The knowledge base to search.\n    user_id (`str`):\n        Injected authenticated user ID.\n    service (`KnowledgeBaseService`):\n        Injected knowledge base service.\n\nReturns:\n    `SearchKnowledgeBaseResponse`:\n        Matched chunks ordered by descending similarity.","operationId":"search_knowledge_base_knowledge_bases__knowledge_base_id__search_post","parameters":[{"name":"knowledge_base_id","in":"path","required":true,"schema":{"type":"string","description":"The knowledge base id.","title":"Knowledge Base Id"},"description":"The knowledge base id."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchKnowledgeBaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchKnowledgeBaseResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"get":{"tags":["mcp"],"summary":"List Mcps","description":"Return every MCP the user has installed, ordered by name.","operationId":"list_mcps_mcp_get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MCPView"},"title":"Response List Mcps Mcp Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/{mcp_id}":{"patch":{"tags":["mcp"],"summary":"Update Mcp","description":"Rename, enable/disable, or re-key an installed MCP.\n\nChanging a secret is a re-render, not a field edit: an API key can\nsit anywhere in the config — inside a URL, a header, an env var — so\nthe card's template plus the merged answers is the only thing that\nknows where to put it.","operationId":"update_mcp_mcp__mcp_id__patch","parameters":[{"name":"mcp_id","in":"path","required":true,"schema":{"type":"string","title":"Mcp Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMCPRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["mcp"],"summary":"Delete Mcp","description":"Remove an MCP from the user's library.\n\nWorkspaces that already hold this MCP keep it — the workspace\nrelation is derived by name, not a foreign key, and tearing down a\nlive stateful MCP session as a side effect of a library edit would\nsurprise the user.","operationId":"delete_mcp_mcp__mcp_id__delete","parameters":[{"name":"mcp_id","in":"path","required":true,"schema":{"type":"string","title":"Mcp Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedule/":{"get":{"tags":["schedule"],"summary":"List all schedules","description":"List all schedules owned by the current user.\n\nArgs:\n    user_id (`str`): Authenticated user ID.\n    storage (`StorageBase`): Storage instance.\n\nReturns:\n    `ListSchedulesResponse`:\n        Paginated list of schedule records.","operationId":"list_schedules_schedule__get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSchedulesResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["schedule"],"summary":"Create a new schedule","description":"Create a new schedule and register it with the scheduler.\n\nThe referenced agent may be either the viewer's own or one shared\nto them through :class:`ResourceAccessPolicyBase`; the schedule\nrecord itself is always owned by the caller.\n\nArgs:\n    body (`CreateScheduleRequest`): Schedule configuration.\n    user_id (`str`): Authenticated user ID.\n    storage (`StorageBase`): Storage instance.\n    access (`ResourceAccessService`): Access service.\n    scheduler (`SchedulerManager`): Scheduler manager.\n\nReturns:\n    `CreateScheduleResponse`:\n        The ID of the newly created schedule.\n\nRaises:\n    `HTTPException`: 404 if the specified agent or the credential\n        referenced by ``chat_model_config`` is not visible to the\n        caller.","operationId":"create_schedule_schedule__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedule/{schedule_id}":{"patch":{"tags":["schedule"],"summary":"Update a schedule","description":"Partially update a schedule.\n\nFields omitted from the request body keep their current values.\nChanging ``cron_expression`` or ``timezone`` immediately reschedules the\nAPScheduler job.  Setting ``enable=False`` removes the job from the\nscheduler without deleting the record.\n\nArgs:\n    schedule_id (`str`): ID of the schedule to update.\n    body (`UpdateScheduleRequest`): Fields to update.\n    user_id (`str`): Authenticated user ID.\n    storage (`StorageBase`): Storage instance.\n    scheduler (`SchedulerManager`): Scheduler manager.\n\nReturns:\n    `ScheduleRecord`:\n        The updated schedule record.\n\nRaises:\n    `HTTPException`: 404 if the schedule does not exist.","operationId":"update_schedule_schedule__schedule_id__patch","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRecord"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["schedule"],"summary":"Delete a schedule","description":"Permanently delete a schedule.\n\nCancels any in-flight chat run for sessions this schedule has\ntriggered, removes their records via the session service, and\nfinally unregisters the APScheduler job.\n\nArgs:\n    schedule_id (`str`): ID of the schedule to delete.\n    user_id (`str`): Authenticated user ID.\n    session_service (`SessionService`): Injected session service.\n    scheduler (`SchedulerManager`): Scheduler manager.\n\nRaises:\n    `HTTPException`: 404 if the schedule does not exist.","operationId":"delete_schedule_schedule__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedule/{schedule_id}/sessions":{"get":{"tags":["schedule"],"summary":"List execution sessions for a schedule","description":"Return all sessions triggered by a given schedule.\n\nArgs:\n    schedule_id (`str`): ID of the schedule.\n    user_id (`str`): Authenticated user ID.\n    storage (`StorageBase`): Storage instance.\n\nReturns:\n    `ScheduleSessionsResponse`:\n        List of execution sessions ordered by creation time (newest first).\n\nRaises:\n    `HTTPException`: 404 if the schedule does not exist.","operationId":"list_schedule_sessions_schedule__schedule_id__sessions_get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleSessionsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/":{"get":{"tags":["sessions"],"summary":"List sessions for an agent","description":"Return all sessions for an agent as enriched\n:class:`SessionView` entries.\n\nEach entry bundles three things the chat UI needs to render\nwithout follow-up requests: the session record (incl.\n``state``), whether a chat run is currently active, and — when\nthe session participates in a team — the resolved team detail\n(leader agent + member agents with their session ids).\n\nArgs:\n    agent_id (`str`):\n        Agent whose sessions to list. May be an agent shared to\n        the viewer through :class:`ResourceAccessPolicyBase`;\n        the returned sessions are still the viewer's own.\n    user_id (`str`):\n        Injected authenticated user ID.\n    storage (`StorageBase`):\n        Injected storage backend.\n    access (`ResourceAccessService`):\n        Injected resource access service; used to validate that\n        the target agent is visible to the viewer.\n    message_bus (`MessageBus`):\n        Injected message bus (used for ``session_is_running``).\n\nReturns:\n    `ListSessionsResponse`:\n        Enriched session views and their count.\n\nRaises:\n    `HTTPException`: 404 if the agent is not visible to the caller.","operationId":"list_sessions_sessions__get","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Filter sessions by agent ID.","title":"Agent Id"},"description":"Filter sessions by agent ID."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSessionsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["sessions"],"summary":"Create a new session","description":"Create (or resume) a session for a given agent and workspace.\n\nAt most one session exists per ``(user_id, agent_id, workspace_id)``\ntriple — a second call with the same triple updates the existing session\nrather than creating a duplicate.\n\nArgs:\n    body (`CreateSessionRequest`): Agent, workspace, and model config.\n    user_id (`str`): Injected authenticated user ID.\n    storage (`StorageBase`): Injected storage backend.\n    workspace_manager (`WorkspaceManagerBase`): Injected workspace\n        manager; consulted via\n        :meth:`WorkspaceManagerBase.assign_workspace_id` to fill in\n        ``workspace_id`` when the request body omits it.\n    access (`ResourceAccessService`): Injected access service.\n\nReturns:\n    `CreateSessionResponse`: The session identifier.\n\nRaises:\n    `HTTPException`: 404 if the agent / credential / knowledge base\n        is not visible to the caller.","operationId":"create_session_sessions__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}":{"delete":{"tags":["sessions"],"summary":"Delete a session","description":"Permanently delete a session and all its associated state.\n\nCancels any in-flight chat run for this session (and for every\nworker session if this one is a team leader) before dropping\nstorage records and bus state. The cancel path is cross-process:\nwhichever worker is actually running the session will receive the\ncancel broadcast and abort.\n\nArgs:\n    session_id (`str`): The session to delete.\n    agent_id (`str`): The agent the session belongs to.\n    user_id (`str`): Injected authenticated user ID.\n    session_service (`SessionService`): Injected session service.\n\nRaises:\n    `HTTPException`: 404 if the session does not exist or does not belong\n        to the authenticated user.","operationId":"delete_session_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Agent the session belongs to.","title":"Agent Id"},"description":"Agent the session belongs to."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["sessions"],"summary":"Update a session","description":"Update the model configuration of an existing session.\n\nArgs:\n    session_id (`str`): The session to update.\n    body (`UpdateSessionRequest`): Fields to update.\n    user_id (`str`): Injected authenticated user ID.\n    storage (`StorageBase`): Injected storage backend.\n    access (`ResourceAccessService`): Injected access service.\n\nReturns:\n    `SessionRecord`: The full session record after the update.\n\nRaises:\n    `HTTPException`: 404 if the session does not exist, or if the\n        referenced credential / KB is not visible to the caller.","operationId":"update_session_sessions__session_id__patch","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Agent the session belongs to.","title":"Agent Id"},"description":"Agent the session belongs to."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSessionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionRecord"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/interrupt":{"post":{"tags":["sessions"],"summary":"Interrupt a running or HITL-parked chat run for a session","description":"Request interruption of an in-progress reply for a session.\n\nThin HTTP wrapper around :meth:`ChatService.interrupt`; see that\nmethod for the running vs not-running dispatch. Idempotent — an\nidle target session is a silent no-op at the agent layer.\n\nArgs:\n    session_id: The session whose reply should be interrupted.\n    agent_id: The agent that owns the session.\n    user_id: Injected authenticated user id.\n    chat_service: Injected chat service.\n\nReturns:\n    202 with :class:`InterruptSessionResponse` echoing the\n    session id.\n\nRaises:\n    HTTPException: 404 if the session does not exist.","operationId":"interrupt_session_sessions__session_id__interrupt_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Agent the session belongs to.","title":"Agent Id"},"description":"Agent the session belongs to."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterruptSessionResponse"}}}},"404":{"description":"Session not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/messages":{"get":{"tags":["sessions"],"summary":"List messages for a session","description":"Return persisted messages for a session with cursor-based\npagination.\n\nArgs:\n    session_id: The session to query.\n    agent_id: Agent the session belongs to.\n    before: A message ID used as the pagination cursor. Omit for\n        the latest page; provide a message ID from a previous\n        response to load older messages.\n    offset: **Deprecated.** Numeric offset, always ignored. Still\n        accepted for backward compatibility.\n    limit: Maximum number of messages to return.\n    user_id: Injected authenticated user ID.\n    storage: Injected storage backend.\n    message_bus: Injected message bus.\n\nReturns:\n    Messages, running status, and whether more pages exist.","operationId":"list_messages_sessions__session_id__messages_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Agent the session belongs to.","title":"Agent Id"},"description":"Agent the session belongs to."},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A message ID used as the pagination cursor. Omit to get the latest page. Provide a message ID from a previous response to load older messages.","title":"Before"},"description":"A message ID used as the pagination cursor. Omit to get the latest page. Provide a message ID from a previous response to load older messages."},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"**Deprecated.** Use ``before`` for cursor-based pagination. This parameter is always ignored.","deprecated":true,"title":"Offset"},"description":"**Deprecated.** Use ``before`` for cursor-based pagination. This parameter is always ignored.","deprecated":true},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max messages.","default":50,"title":"Limit"},"description":"Max messages."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/status":{"get":{"tags":["sessions"],"summary":"Probe the session's high-level status","description":"Return the unified :class:`SessionStatus` for a session.\n\nOwnership validation, cluster-liveness probing, and parked-state\nderivation are all delegated to\n:meth:`SessionService.get_session_status` — see that method for\nthe precedence rules that collapse the two orthogonal signals\n(message-bus run lock + persisted context tail) into a single\nfour-valued enum.\n\nArgs:\n    session_id (`str`):\n        The session to probe.\n    agent_id (`str`):\n        The agent that owns the session (ownership validation).\n    user_id (`str`):\n        Injected authenticated user ID.\n    session_service (`SessionService`):\n        Injected session service. Owns both storage and message\n        bus dependencies so the composed answer is derived in a\n        single layer.\n\nReturns:\n    `SessionStatusResponse`:\n        The probed session id and its unified status.\n\nRaises:\n    `HTTPException`: 404 if the session does not exist or does not\n        belong to the authenticated user.","operationId":"get_session_status_sessions__session_id__status_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Agent the session belongs to.","title":"Agent Id"},"description":"Agent the session belongs to."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStatusResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/stream":{"get":{"tags":["sessions"],"summary":"Subscribe to a session's event stream (SSE)","description":"Subscribe to a session's live event stream.\n\nReturns a ``text/event-stream`` that first replays any buffered\nevents from the current run's replay log (if a run is in progress\nor just finished), then streams live events as they are produced\nby :meth:`ChatService.run`. The connection stays open\nuntil the client disconnects — subsequent runs on the same session\nare delivered over the same connection.\n\nA heartbeat comment frame (``:\\n\\n``) is sent every 30 seconds to\nkeep the connection alive through reverse proxies.\n\nArgs:\n    session_id (`str`):\n        The session to subscribe to.\n    agent_id (`str`):\n        The agent that owns the session (used for ownership\n        validation).\n    user_id (`str`):\n        Injected authenticated user id.\n    storage (`StorageBase`):\n        Injected storage backend (ownership check only).\n    message_bus (`MessageBus`):\n        Injected message bus (replay + live subscription).\n\nReturns:\n    `StreamingResponse`:\n        SSE stream of AgentEvent frames + periodic heartbeats.","operationId":"stream_session_events_sessions__session_id__stream_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","description":"Agent the session belongs to.","title":"Agent Id"},"description":"Agent the session belongs to."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Server-Sent Events stream of AgentEvent objects","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skill":{"get":{"tags":["skill"],"summary":"List Skills","description":"Return every skill the user has installed, ordered by name.","operationId":"list_skills_skill_get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillView"},"title":"Response List Skills Skill Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skill/{skill_id}":{"get":{"tags":["skill"],"summary":"Get Skill","description":"Return one installed skill, including its ``SKILL.md`` body.","operationId":"get_skill_skill__skill_id__get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["skill"],"summary":"Delete Skill","description":"Remove a skill from the user's library.\n\nWorkspaces that already hold this skill keep their copy — the files\nwere extracted into the workspace, and this record was only where\nthey came from.","operationId":"delete_skill_skill__skill_id__delete","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/mcp":{"get":{"tags":["workspace"],"summary":"List Mcps","description":"Return all MCP clients with live tool list and health status.","operationId":"list_mcps_workspace_mcp_get","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MCPClientStatus"},"title":"Response List Mcps Workspace Mcp Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workspace"],"summary":"Add Mcp","description":"Add an MCP client to the session's workspace.\n\nThe MCP is also recorded in the user's library, so one typed in by\nhand is reusable in the next session instead of being retyped. An\nexisting record of the same name is left alone: the library is where\nthat MCP is defined, and adding it to a second workspace must not\nsilently redefine it.","operationId":"add_mcp_workspace_mcp_post","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPClient"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/mcp/from-library":{"post":{"tags":["workspace"],"summary":"Add Mcps From Library","description":"Put MCPs the user has already installed into this workspace.\n\nThe rendered config never leaves the server, so the client sends ids\nrather than configs — it has no way to reconstruct one.\n\nAdding is per-MCP: one that fails to connect does not cancel the\nrest, and the response says which ones landed.","operationId":"add_mcps_from_library_workspace_mcp_from_library_post","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFromLibraryRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFromLibraryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/mcp/{mcp_name}":{"delete":{"tags":["workspace"],"summary":"Remove Mcp","description":"Remove an MCP client from the session's workspace by name.","operationId":"remove_mcp_workspace_mcp__mcp_name__delete","parameters":[{"name":"mcp_name","in":"path","required":true,"schema":{"type":"string","title":"Mcp Name"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/skill":{"get":{"tags":["workspace"],"summary":"List Skills","description":"Return all skills available in the session's workspace.","operationId":"list_skills_workspace_skill_get","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Skill"},"title":"Response List Skills Workspace Skill Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workspace"],"summary":"Add Skill","description":"Add a skill to the session's workspace from the given path.\n\nDeprecated: the path is resolved on the server, which only means\nanything for a single-host deployment. Use ``POST /skill/upload``\nto send a folder, or ``POST /skill/from-library`` to install one\nthe user already has.","operationId":"add_skill_workspace_skill_post","deprecated":true,"parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSkillRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/skill/upload":{"post":{"tags":["workspace"],"summary":"Upload Skill","description":"Install a skill from an uploaded folder.\n\nThe parts are re-tarred on the fly and piped into the workspace, so\nthe archive is never held whole. The manifest is what the client\nclaims; every limit in it is re-checked here, and the byte counts\nare verified as the tar is built.","operationId":"upload_skill_workspace_skill_upload_post","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_skill_workspace_skill_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/skill/from-library":{"post":{"tags":["workspace"],"summary":"Add Skills From Library","description":"Put skills the user has already installed into this workspace.\n\nEach one is re-downloaded from its hub and piped into the\nworkspace; the server holds no copy in between. Adding is\nper-skill, and the response says which ones landed.","operationId":"add_skills_from_library_workspace_skill_from_library_post","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSkillsFromLibraryRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFromLibraryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/skill/{skill_name}":{"delete":{"tags":["workspace"],"summary":"Remove Skill","description":"Remove a skill from the session's workspace by name.","operationId":"remove_skill_workspace_skill__skill_name__delete","parameters":[{"name":"skill_name","in":"path","required":true,"schema":{"type":"string","title":"Skill Name"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/directories":{"get":{"tags":["workspace"],"summary":"List Workspace Directory","description":"List one directory level, reachable from a session's workspace.\n\nPaths are not confined to the workspace root: for a sandboxed\nbackend the reachable filesystem is the sandbox, and for a local\none the caller is already trusted with the host.","operationId":"list_workspace_directory_workspace_directories_get","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"path","in":"query","required":false,"schema":{"type":"string","description":"Absolute path, or one relative to the workspace root. Empty lists the workspace root itself.","default":"","title":"Path"},"description":"Absolute path, or one relative to the workspace root. Empty lists the workspace root itself."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryEntry"},"title":"Response List Workspace Directory Workspace Directories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/files/download-token":{"post":{"tags":["workspace"],"summary":"Create Download Token","description":"Mint a short-lived token for a browser-native download.\n\nThe browser writes the response straight to disk only when it\nissues the request itself, and such a request carries no custom\nheader — hence a credential in the URL. Fetching with ``X-User-ID``\ninstead works but holds the whole file in the tab.\n\nMinting depends on the normal identity, so whatever replaces\n``X-User-ID`` guards this too.\n\nThe session is resolved here only to fail early: the download is a\nbrowser navigation, so an error there surfaces as a raw error page\nrather than something the UI can show.","operationId":"create_download_token_workspace_files_download_token_post","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"The path the token will authorize.","title":"Path"},"description":"The path the token will authorize."},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspace/files":{"get":{"tags":["workspace"],"summary":"Read Workspace File","description":"Stream one file out of a session's workspace.\n\nThe body is piped chunk by chunk rather than read whole: the API\nprocess is shared, so one large download must not be able to\nexhaust it for everyone else.","operationId":"read_workspace_file_workspace_files_get","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"Absolute path, or one relative to the workspace root.","title":"Path"},"description":"Absolute path, or one relative to the workspace root."},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"Force a Content-Disposition attachment.","default":false,"title":"Download"},"description":"Force a Content-Disposition attachment."},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A token from ``POST /workspace/files/download-token``, accepted in place of the ``X-User-ID`` header so a browser navigation can download the file directly.","title":"Token"},"description":"A token from ``POST /workspace/files/download-token``, accepted in place of the ``X-User-ID`` header so a browser navigation can download the file directly."},{"name":"x-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-User-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/model/":{"get":{"tags":["model"],"summary":"List all candidate models under the given credential type","description":"Return all candidate models under the given credential type.\n\nArgs:\n    body (ListModelsRequest): The request body.\n\nReturns:\n    `ListModelsResponse`: The response body.","operationId":"list_models_model__get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListModelsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tts-model/":{"get":{"tags":["tts-model"],"summary":"List all candidate TTS models under the given credential type","description":"Return all candidate TTS models under the given credential type.\n\nArgs:\n    body (ListTTSModelsRequest): The request body.\n\nReturns:\n    `ListTTSModelsResponse`: The response body.","operationId":"list_tts_models_tts_model__get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTTSModelsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/embedding-model/":{"get":{"tags":["embedding-model"],"summary":"List all candidate embedding models under the given credential type","description":"Return all candidate embedding models under the credential type.\n\nUnlike ``/knowledge_bases/embedding_models``, which narrows the\nlist to what the knowledge base's dimension policy accepts, this\nendpoint reports the provider's full catalogue — it answers \"what\ncan this credential do\", not \"what can I build a KB with\".\n\nArgs:\n    body (ListEmbeddingModelsRequest): The request body.\n\nReturns:\n    `ListEmbeddingModelsResponse`: The response body.","operationId":"list_embedding_models_embedding_model__get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEmbeddingModelsResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/types":{"get":{"tags":["channels"],"summary":"List Channel Types","description":"List supported channel types with their JSON schemas.","operationId":"list_channel_types_channels_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ChannelTypeSchema"},"type":"array","title":"Response List Channel Types Channels Types Get"}}}}}}},"/channels/":{"get":{"tags":["channels"],"summary":"List Channels","description":"List channels owned by the current user.","operationId":"list_channels_channels__get","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelResponse"},"title":"Response List Channels Channels  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Create Channel","description":"Create a channel.","operationId":"create_channel_channels__post","parameters":[{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChannelRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/{channel_id}":{"get":{"tags":["channels"],"summary":"Get Channel","description":"Get channel details.","operationId":"get_channel_channels__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["channels"],"summary":"Update Channel","description":"Update routing / session / config / enabled.","operationId":"update_channel_channels__channel_id__patch","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChannelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channels"],"summary":"Delete Channel","description":"Delete a channel.","operationId":"delete_channel_channels__channel_id__delete","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/{channel_id}/enable":{"post":{"tags":["channels"],"summary":"Enable Channel","description":"Enable a channel.","operationId":"enable_channel_channels__channel_id__enable_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/{channel_id}/disable":{"post":{"tags":["channels"],"summary":"Disable Channel","description":"Disable a channel.","operationId":"disable_channel_channels__channel_id__disable_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/{channel_id}/status":{"get":{"tags":["channels"],"summary":"Channel Status","description":"The channel's live connection status.","operationId":"channel_status_channels__channel_id__status_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/{channel_id}/sessions":{"get":{"tags":["channels"],"summary":"List Channel Sessions","description":"Sessions this channel spawned, newest first.","operationId":"list_channel_sessions_channels__channel_id__sessions_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSessionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/{channel_id}/chat_ids":{"get":{"tags":["channels"],"summary":"List Chat Ids","description":"Known chats for routing config: platform list ∪ passively seen.","operationId":"list_chat_ids_channels__channel_id__chat_ids_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"x-user-id","in":"header","required":true,"schema":{"type":"string","description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.","title":"X-User-Id"},"description":"Caller's user ID. Temporary header-based identity; will be replaced by JWT auth."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelChatIdsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AddFromLibraryRequest":{"properties":{"mcp_ids":{"items":{"type":"string"},"type":"array","title":"Mcp Ids","description":"The installed-MCP record ids to add."}},"type":"object","required":["mcp_ids"],"title":"AddFromLibraryRequest","description":"The request to put library MCPs into a workspace."},"AddFromLibraryResponse":{"properties":{"added":{"items":{"type":"string"},"type":"array","title":"Added","description":"The names now in the workspace. Excludes ones already present, which are skipped rather than re-added."},"failed":{"additionalProperties":{"type":"string"},"type":"object","title":"Failed","description":"Whatever could not be added, mapped to why."}},"type":"object","title":"AddFromLibraryResponse","description":"What landed, and what did not.\n\nReported per item rather than as one status: installing is done one\nat a time, so a bad API key on the third pick must not throw away\nthe two that worked."},"AddSkillRequest":{"properties":{"skill_path":{"type":"string","title":"Skill Path"}},"type":"object","required":["skill_path"],"title":"AddSkillRequest","description":"The request to add skill."},"AddSkillsFromLibraryRequest":{"properties":{"skill_ids":{"items":{"type":"string"},"type":"array","title":"Skill Ids","description":"The installed-skill record ids to add."}},"type":"object","required":["skill_ids"],"title":"AddSkillsFromLibraryRequest","description":"The request to put library skills into a workspace."},"AdditionalWorkingDirectory":{"properties":{"path":{"type":"string","title":"Path"},"source":{"type":"string","title":"Source"}},"type":"object","required":["path","source"],"title":"AdditionalWorkingDirectory","description":"An additional directory included in permission scope.\n\nWorking directories are used to determine which file paths should be\nautomatically allowed in ACCEPT_EDITS mode."},"AgentData":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the agent."},"system_prompt":{"type":"string","format":"textarea","title":"System Prompt","description":"The system prompt for the agent.","default":"You're a helpful assistant."},"context_config":{"$ref":"#/components/schemas/ContextConfig","title":"Context Config","description":"The context config for the agent."},"react_config":{"$ref":"#/components/schemas/ReActConfig","title":"React Config","description":"The react config for the agent."},"invite_config":{"$ref":"#/components/schemas/InviteConfig","title":"Invite Config","description":"The invite config for the agent."}},"type":"object","required":["name","context_config","react_config"],"title":"AgentData","description":"The agent data model."},"AgentSchemaResponse":{"properties":{"identity":{"additionalProperties":true,"type":"object","title":"Identity","description":"Schema for the agent's identity fields (``name``, ``system_prompt``)."},"context_config":{"additionalProperties":true,"type":"object","title":"Context Config","description":"Schema for ``ContextConfig``."},"react_config":{"additionalProperties":true,"type":"object","title":"React Config","description":"Schema for ``ReActConfig``."}},"type":"object","required":["identity","context_config","react_config"],"title":"AgentSchemaResponse","description":"**Deprecated.** JSON Schema fragments used by the frontend to\nrender the agent create / edit forms.\n\nSuperseded by :class:`AgentSchemaV2Response`, which returns the full\n:class:`AgentData` JSON Schema in a single ``schema`` field so newly\nadded agent fields (like the ``invite_config`` sub-model) reach the\nfrontend automatically without the router having to know about them.\n\nThe frontend previously split :class:`AgentData` into three\nhand-picked sections (``identity``, ``context_config``,\n``react_config``) here, which required a router edit every time a\nnew user-editable field landed on :class:`AgentData`. Kept for\nbackwards compatibility with pre-v2 API consumers."},"AgentSchemaV2Response":{"properties":{"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"Full :class:`AgentData` JSON Schema. All user-editable fields appear as top-level entries in ``properties`` — the frontend derives its section grouping from this single schema."}},"type":"object","required":["schema"],"title":"AgentSchemaV2Response","description":"Response for ``GET /agent/schema/v2``.\n\nWraps the full :class:`AgentData` JSON Schema in a single\n``schema`` field so the frontend can render every user-editable\nproperty without the router having to enumerate them."},"AgentState":{"properties":{"session_id":{"type":"string","title":"Session Id"},"summary":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/TextBlock"},{"$ref":"#/components/schemas/DataBlock"}]},"type":"array"}],"title":"Summary","default":""},"context":{"items":{"$ref":"#/components/schemas/Msg"},"type":"array","title":"Context"},"reply_context":{"$ref":"#/components/schemas/ReplyContext"},"permission_context":{"$ref":"#/components/schemas/PermissionContext"},"tool_context":{"$ref":"#/components/schemas/ToolContext"},"tasks_context":{"$ref":"#/components/schemas/TaskContext"},"middle_context":{"additionalProperties":true,"type":"object","title":"Middle Context"}},"type":"object","title":"AgentState","description":"The agent state that should be saved and loaded from storage."},"AgentView":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the credential."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"user_id":{"type":"string","title":"User Id"},"source":{"type":"string","enum":["user","team"],"title":"Source","default":"user"},"data":{"$ref":"#/components/schemas/AgentData"},"editable":{"type":"boolean","title":"Editable","description":"Whether the current viewer may PATCH/DELETE this agent."}},"type":"object","required":["user_id","data","editable"],"title":"AgentView","description":"Agent record + viewer-relative ``editable``.\n\nSubclasses :class:`AgentRecord` so the wire format is a strict\nsuperset of the historical response (one extra top-level field);\nold clients ignore ``editable`` transparently."},"Base64Source":{"properties":{"type":{"type":"string","const":"base64","title":"Type","default":"base64"},"data":{"type":"string","title":"Data"},"media_type":{"type":"string","title":"Media Type"}},"type":"object","required":["data","media_type"],"title":"Base64Source","description":"The base64 source."},"BaseModel":{"properties":{},"type":"object","title":"BaseModel"},"Body_upload_knowledge_document_knowledge_bases__knowledge_base_id__documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"The document to index (PDF, TXT, Markdown, …)."},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","description":"Override the IANA media type used to route the upload. Defaults to the type guessed from the filename."}},"type":"object","required":["file"],"title":"Body_upload_knowledge_document_knowledge_bases__knowledge_base_id__documents_post"},"Body_upload_skill_workspace_skill_upload_post":{"properties":{"manifest":{"type":"string","title":"Manifest","description":"JSON ``{entries: [{path, size}]}`` describing the parts, in the order they are sent."},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"The folder's files."}},"type":"object","required":["manifest","files"],"title":"Body_upload_skill_workspace_skill_upload_post"},"ChannelActionResponse":{"properties":{"status":{"type":"string","title":"Status","description":"New lifecycle status, e.g. 'enabled'."}},"type":"object","required":["status"],"title":"ChannelActionResponse","description":"Result of an enable/disable action."},"ChannelBinding":{"properties":{"match_key":{"type":"string","title":"Match Key","default":"chat_id"},"match_value":{"type":"string","title":"Match Value","default":"*"},"agent_id":{"type":"string","title":"Agent Id"},"session_scope":{"$ref":"#/components/schemas/SessionScope","default":"per_chat"}},"type":"object","required":["agent_id"],"title":"ChannelBinding","description":"One routing rule: match an inbound event, then decide which agent\nhandles it and how its session is grouped.\n\nRules are evaluated in list order; the first match wins. The final\nrule must be a catch-all (``match_value == \"*\"``) — it carries the\nchannel's defaults."},"ChannelChatId":{"properties":{"chat_id":{"type":"string","title":"Chat Id"},"name":{"type":"string","title":"Name","default":""},"source":{"type":"string","title":"Source","description":"'platform' or 'recorded'."}},"type":"object","required":["chat_id","source"],"title":"ChannelChatId","description":"A chat the bot can route to (from the platform or seen inbound)."},"ChannelChatIdsResponse":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/ChannelChatId"},"type":"array","title":"Chats"}},"type":"object","title":"ChannelChatIdsResponse","description":"Chats available for routing configuration."},"ChannelResponse":{"properties":{"id":{"type":"string","title":"Id"},"channel_type":{"type":"string","title":"Channel Type"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"user_id":{"type":"string","title":"User Id"},"platform_bot_id":{"type":"string","title":"Platform Bot Id"},"enabled":{"type":"boolean","title":"Enabled"},"platform_config":{"additionalProperties":true,"type":"object","title":"Platform Config"},"routing":{"$ref":"#/components/schemas/RoutingConfig"},"session":{"$ref":"#/components/schemas/SessionSettings"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","channel_type","name","user_id","platform_bot_id","enabled","platform_config","routing","session","created_at","updated_at"],"title":"ChannelResponse","description":"Channel details returned to the client (credentials omitted)."},"ChannelSessionsResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionRecord"},"type":"array","title":"Sessions"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["sessions","total"],"title":"ChannelSessionsResponse","description":"Sessions a channel has spawned."},"ChannelStatus":{"properties":{"state":{"type":"string","title":"State","default":"stopped"},"last_error":{"type":"string","title":"Last Error","default":""}},"type":"object","title":"ChannelStatus","description":"Live connection status of a running channel adapter — owned and\nupdated by the adapter itself; read by the dispatcher's status API.\n\n``state`` transitions (all set by the adapter):\n``stopped`` (default / on teardown) → ``connecting`` → ``connected``;\n``retrying`` while reconnecting after a drop; ``failed`` when the\nadapter gave up (parked, no more retries until the channel is edited)."},"ChannelTypeSchema":{"properties":{"channel_type":{"type":"string","title":"Channel Type"},"display_name":{"type":"string","title":"Display Name"},"description":{"type":"string","title":"Description","default":""},"icon_url":{"type":"string","title":"Icon Url","default":""},"credentials_schema":{"additionalProperties":true,"type":"object","title":"Credentials Schema"},"config_schema":{"additionalProperties":true,"type":"object","title":"Config Schema"},"platform_bot_id_field":{"type":"string","title":"Platform Bot Id Field"}},"type":"object","required":["channel_type","display_name","credentials_schema","config_schema","platform_bot_id_field"],"title":"ChannelTypeSchema","description":"Frontend-facing metadata for one channel type.\n\nGenerated from a channel class. ``credentials_schema`` /\n``config_schema`` are JSON Schemas the frontend renders as forms."},"ChatModelConfig":{"properties":{"type":{"type":"string","title":"Type"},"credential_id":{"type":"string","title":"Credential Id"},"model":{"type":"string","title":"Model"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"}},"type":"object","required":["type","credential_id","model","parameters"],"title":"ChatModelConfig","description":"The model configuration class."},"ChatRequest":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Agent ID for the chat endpoint."},"session_id":{"type":"string","title":"Session Id","description":"The session to send the message to."},"input":{"anyOf":[{"$ref":"#/components/schemas/Msg"},{"items":{"$ref":"#/components/schemas/Msg"},"type":"array"},{"$ref":"#/components/schemas/UserConfirmResultEvent"},{"$ref":"#/components/schemas/ExternalExecutionResultEvent"},{"type":"null"}],"title":"Input","description":"The input message(s), or agent event, or None."}},"type":"object","required":["agent_id","session_id","input"],"title":"ChatRequest","description":"Request body for the chat endpoint."},"ChatTriggerResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Always ``\"started\"`` when the trigger succeeded.","default":"started"},"session_id":{"type":"string","title":"Session Id","description":"Echo of the session id the run was started for."}},"type":"object","required":["session_id"],"title":"ChatTriggerResponse","description":"Response body for the fire-and-forget chat trigger.\n\nConfirms that the chat run was scheduled. Events produced by the\nrun arrive separately via the session's SSE stream endpoint."},"Chunk":{"properties":{"content":{"anyOf":[{"$ref":"#/components/schemas/TextBlock"},{"$ref":"#/components/schemas/DataBlock"}],"title":"Content"},"source":{"type":"string","title":"Source"},"chunk_index":{"type":"integer","title":"Chunk Index"},"total_chunks":{"type":"integer","title":"Total Chunks"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["content","source","chunk_index","total_chunks"],"title":"Chunk","description":"A final indexable chunk produced by a :class:`ChunkerBase`.\n\nEach ``Chunk`` corresponds to one record in the vector store.\nThe required structural fields (``source``, ``chunk_index``,\n``total_chunks``) enable downstream features such as \"expand\ncontext around a hit\" during retrieval."},"ConfirmResult":{"properties":{"confirmed":{"type":"boolean","title":"Confirmed"},"tool_call":{"$ref":"#/components/schemas/ToolCallBlock"},"rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/PermissionRule"},"type":"array"},{"type":"null"}],"title":"Rules"}},"type":"object","required":["confirmed","tool_call"],"title":"ConfirmResult","description":"Confirm result for a tool call."},"ContextConfig":{"properties":{"trigger_ratio":{"type":"number","exclusiveMaximum":0.9,"exclusiveMinimum":0.0,"title":"Trigger Ratio","default":0.8},"reserve_ratio":{"type":"number","exclusiveMaximum":0.9,"exclusiveMinimum":0.0,"title":"Reserve Ratio","default":0.1},"compression_prompt":{"type":"string","format":"textarea","title":"Compression Prompt","default":"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.\nThe current time is {current_time}.\nThis summary may itself be summarized again later, and the conversation history it refers to will be gone, so every reference must be self-contained — resolve anything that depends on the vanished context into an absolute, fully-qualified form:\n- Time: convert relative expressions ('today', 'now', 'yesterday', 'tomorrow', 'recently') to absolute dates using the current time above; re-anchor them even if an earlier summary already wrote them relatively.\n- Names & pointers: use file paths, symbol names, PR/issue numbers, IDs, URLs, and exact commands/error strings verbatim instead of 'this file', 'the above', 'the second approach', 'the 5 failing tests'.\n- In-flight work: record everything still pending, especially tools launched in the background whose results you are still waiting on — give each one's id and a short note of what it is doing — and mark each item's owner (user request vs your own decision) and status (done / pending / blocked).\n</system-hint>"},"summary_template":{"type":"string","format":"textarea","title":"Summary Template","default":"<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>"},"summary_schema":{"additionalProperties":true,"type":"object","title":"Summary Schema"},"tool_result_limit":{"type":"integer","title":"Tool Result Limit","description":"The maximum length of the tool results in tokens. If exceeded, the tool result will be truncated.","default":50000}},"type":"object","title":"ContextConfig","description":"The context related configuration in AgentScope"},"CreateAgentRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the agent."},"system_prompt":{"type":"string","title":"System Prompt","description":"Base system prompt fed to the agent.","default":"You're a helpful assistant."},"context_config":{"$ref":"#/components/schemas/ContextConfig","description":"Context-window management configuration."},"react_config":{"$ref":"#/components/schemas/ReActConfig","description":"ReAct loop configuration."},"invite_config":{"$ref":"#/components/schemas/InviteConfig","description":"Invite-pool settings for this agent. See :class:`InviteConfig` — enforces the ``invitable ⇒ non-empty description`` invariant."}},"type":"object","required":["name"],"title":"CreateAgentRequest","description":"Request body for creating a new agent."},"CreateAgentResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Server-assigned agent identifier."}},"type":"object","required":["agent_id"],"title":"CreateAgentResponse","description":"Response body after creating an agent."},"CreateChannelRequest":{"properties":{"channel_type":{"type":"string","title":"Channel Type","description":"Channel type id, e.g. 'feishu'."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional display name."},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials","description":"Platform credentials."},"platform_config":{"additionalProperties":true,"type":"object","title":"Platform Config","description":"Non-secret platform options."},"routing":{"$ref":"#/components/schemas/RoutingConfig","description":"Inbound routing rules."},"session":{"$ref":"#/components/schemas/SessionSettings","description":"Session/model settings."},"enabled":{"type":"boolean","title":"Enabled","description":"Start it enabled.","default":true}},"type":"object","required":["channel_type","credentials","routing","session"],"title":"CreateChannelRequest","description":"Request body for creating a channel."},"CreateCredentialRequest":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Credential payload (e.g. API keys)."}},"type":"object","required":["data"],"title":"CreateCredentialRequest","description":"Request body for creating a new credential."},"CreateCredentialResponse":{"properties":{"credential_id":{"type":"string","title":"Credential Id","description":"Server-assigned credential identifier."}},"type":"object","required":["credential_id"],"title":"CreateCredentialResponse","description":"Response body after creating a credential."},"CreateKnowledgeBaseRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the knowledge base."},"description":{"type":"string","title":"Description","description":"Free-form description shown in the UI.","default":""},"embedding_model_config":{"$ref":"#/components/schemas/EmbeddingModelConfig","description":"Embedding model used both at indexing and at query time. Cannot be changed after creation — switching would invalidate every previously inserted vector."}},"type":"object","required":["name","embedding_model_config"],"title":"CreateKnowledgeBaseRequest","description":"Request body for creating a new knowledge base."},"CreateKnowledgeBaseResponse":{"properties":{"knowledge_base_id":{"type":"string","title":"Knowledge Base Id","description":"Server-assigned knowledge base identifier."}},"type":"object","required":["knowledge_base_id"],"title":"CreateKnowledgeBaseResponse","description":"Response body after creating a knowledge base."},"CreateScheduleRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the schedule."},"description":{"type":"string","title":"Description","description":"Optional description.","default":""},"cron_expression":{"type":"string","title":"Cron Expression","description":"Standard 5-field cron expression, e.g. '0 9 * * 1-5'."},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone name, e.g. 'America/New_York' or 'Asia/Shanghai'.","default":"UTC"},"agent_id":{"type":"string","title":"Agent Id","description":"Agent to run when the schedule fires."},"chat_model_config":{"$ref":"#/components/schemas/ChatModelConfig","description":"Model configuration for the auto-created session."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the schedule is active immediately after creation.","default":true},"stateful":{"type":"boolean","title":"Stateful","description":"If True, consecutive executions share the same session context.","default":false},"permission_mode":{"$ref":"#/components/schemas/PermissionMode","description":"Permission level for the agent during scheduled execution.","default":"dont_ask"}},"type":"object","required":["name","cron_expression","agent_id","chat_model_config"],"title":"CreateScheduleRequest","description":"Request body for creating a new schedule."},"CreateScheduleResponse":{"properties":{"schedule_id":{"type":"string","title":"Schedule Id","description":"Server-assigned schedule identifier."}},"type":"object","required":["schedule_id"],"title":"CreateScheduleResponse","description":"Response body after creating a schedule."},"CreateSessionRequest":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Agent this session belongs to."},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Optional explicit workspace binding. When omitted the server calls ``WorkspaceManagerBase.assign_workspace_id`` under the configured isolation policy. Set only to force a specific binding (e.g. share workspace with another existing session)."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name. Defaults to current datetime if omitted."},"chat_model_config":{"anyOf":[{"$ref":"#/components/schemas/ChatModelConfig"},{"type":"null"}],"description":"Model provider and parameters. Can be set later via PATCH."},"fallback_chat_model_config":{"anyOf":[{"$ref":"#/components/schemas/ChatModelConfig"},{"type":"null"}],"description":"Fallback model used when the primary model fails. Can be set later via PATCH."},"tts_model_config":{"anyOf":[{"$ref":"#/components/schemas/TTSModelConfig"},{"type":"null"}],"description":"TTS model configuration. Can be set later via PATCH."},"knowledge_config":{"anyOf":[{"$ref":"#/components/schemas/SessionKnowledgeConfig"},{"type":"null"}],"description":"Knowledge bases attached to this session plus the `RAGMiddleware` parameters. Can be set later via PATCH."}},"type":"object","required":["agent_id"],"title":"CreateSessionRequest","description":"Request body for creating a new session."},"CreateSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Server-assigned session identifier."}},"type":"object","required":["session_id"],"title":"CreateSessionResponse","description":"Response body after creating a session."},"CredentialView":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the credential."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"user_id":{"type":"string","title":"User Id"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"editable":{"type":"boolean","title":"Editable","description":"Whether the current viewer may PATCH/DELETE this credential."}},"type":"object","required":["data","editable"],"title":"CredentialView","description":"Credential record + viewer-relative ``editable``.\n\n``data`` inherits :class:`CredentialRecord.data` in shape, but the\nservice masks it for shared credentials before constructing the\nview: only ``type`` and ``name`` survive. Runtime paths that need\nthe raw payload call :meth:`ResourceAccessService.resolve_credential`\ninstead, which returns the underlying record."},"DataBlock":{"properties":{"type":{"type":"string","const":"data","title":"Type","default":"data"},"id":{"type":"string","title":"Id"},"source":{"anyOf":[{"$ref":"#/components/schemas/Base64Source"},{"$ref":"#/components/schemas/URLSource"}],"title":"Source"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"created_at":{"type":"string","title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["source"],"title":"DataBlock","description":"The data block for binary content (images, audio, video, etc.)."},"DimensionPolicy":{"properties":{"kind":{"$ref":"#/components/schemas/DimensionPolicyKind","description":"What constraint applies to the chosen dimension."},"dimension":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dimension","description":"The required dimension when ``kind`` is ``FIXED`` or ``LOCKED_BY_EXISTING``.  Always ``None`` for ``ANY``."}},"type":"object","required":["kind"],"title":"DimensionPolicy","description":"The dimension policy a manager exposes to the front-end."},"DimensionPolicyKind":{"type":"string","enum":["any","fixed","locked_by_existing"],"title":"DimensionPolicyKind","description":"The kind of dimension policy the manager publishes."},"DirectoryEntry":{"properties":{"name":{"type":"string","title":"Name","description":"The entry name, without any leading directory."},"is_dir":{"type":"boolean","title":"Is Dir","description":"Whether the entry is itself a directory."},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"File size in bytes. Always null for a directory, and null for a file the backend could not stat."},"updated_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Updated At","description":"Last modification time as a Unix timestamp."}},"type":"object","required":["name","is_dir"],"title":"DirectoryEntry","description":"One entry in a workspace directory listing."},"DownloadTokenResponse":{"properties":{"token":{"type":"string","title":"Token","description":"Pass as the ``token`` query parameter of ``GET /workspace/files``, in place of the ``X-User-ID`` header. Valid for this path only."},"expires_at":{"type":"number","title":"Expires At","description":"Unix timestamp after which the token is refused."}},"type":"object","required":["token","expires_at"],"title":"DownloadTokenResponse","description":"A capability authorizing one download of one path."},"EmbeddingModelCard":{"properties":{"type":{"type":"string","const":"embedding_model","title":"Type","default":"embedding_model"},"name":{"type":"string","title":"Name","description":"The model name used in API calls."},"label":{"type":"string","title":"Label","description":"Human-readable label for the frontend."},"status":{"type":"string","enum":["active","deprecated","sunset"],"title":"Status","description":"The model lifecycle status.","default":"active"},"input_types":{"items":{"type":"string"},"type":"array","title":"Input Types","description":"Supported input media types.","default":["text/plain"]},"output_types":{"items":{"type":"string"},"type":"array","title":"Output Types","description":"Supported output media types.","default":["application/x-embedding"]},"dimensions":{"type":"integer","exclusiveMinimum":0.0,"title":"Dimensions","description":"Default output vector dimensions for this model."},"supported_dimensions":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Supported Dimensions","description":"If set, the only dimensions this model can produce. ``None`` means dimensions are fixed at :attr:`dimensions` and cannot be overridden."},"context_size":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Context Size","description":"Maximum input length (in tokens) per request."},"parameter_schema":{"additionalProperties":true,"type":"object","title":"Parameter Schema","description":"JSON Schema for user-configurable parameters (built from the Parameters class + YAML overrides)."},"parameter_overrides":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Parameter Overrides","description":"Raw parameter overrides from the YAML file."}},"type":"object","required":["name","label","dimensions"],"title":"EmbeddingModelCard","description":"A card describing an embedding model's capabilities.\n\nMirrors :class:`~agentscope.model.ModelCard` but tailored for\nembedding models.  Uses ``input_types`` / ``output_types`` to\ndescribe model capabilities, and ``parameter_schema`` (built from\nthe embedding class's ``Parameters`` + YAML ``parameter_overrides``)\nto tell the frontend which knobs the user can adjust.\n\nThe output type ``application/x-embedding`` indicates that the\nmodel produces dense vector embeddings."},"EmbeddingModelConfig":{"properties":{"type":{"type":"string","title":"Type"},"credential_id":{"type":"string","title":"Credential Id"},"model":{"type":"string","title":"Model"},"dimensions":{"type":"integer","exclusiveMinimum":0.0,"title":"Dimensions"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"}},"type":"object","required":["type","credential_id","model","dimensions"],"title":"EmbeddingModelConfig","description":"Configuration for constructing an embedding model from a credential.\n\nMirrors :class:`ChatModelConfig` but targets\n:class:`~agentscope.embedding.EmbeddingModelBase` subclasses.\nUsed by :class:`KnowledgeBaseRecord` to persist the user's\nembedding model selection."},"ErrorInfo":{"properties":{"type":{"$ref":"#/components/schemas/ErrorType","default":"unknown"},"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"ErrorInfo","description":"Structured, UI-facing description of a fatal reply error."},"ErrorType":{"type":"string","enum":["authentication","permission","rate_limit","invalid_request","upstream","connection","internal","setup","unknown"],"title":"ErrorType","description":"Classification of a fatal error that terminated a reply.\n\nNot model-specific: the status-derived members apply to any upstream\nservice reached during a reply (chat model, embedding, TTS, MCP)."},"ExternalExecutionResultEvent":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"type":{"type":"string","const":"EXTERNAL_EXECUTION_RESULT","title":"Type","default":"EXTERNAL_EXECUTION_RESULT"},"reply_id":{"type":"string","title":"Reply Id"},"execution_results":{"items":{"$ref":"#/components/schemas/ToolResultBlock"},"type":"array","title":"Execution Results"}},"type":"object","required":["reply_id","execution_results"],"title":"ExternalExecutionResultEvent","description":"External execution result event."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","enum":["ok","not_ready"],"title":"Status","description":"Overall service status. ``not_ready`` when any required component is missing; disabled optional features do not affect it."},"version":{"type":"string","title":"Version","description":"The API version this app was created with."},"components":{"additionalProperties":{"type":"string","enum":["ok","not_ready","disabled"]},"type":"object","title":"Components","description":"Per-subsystem readiness. ``disabled`` marks an optional feature the deployment did not enable."}},"type":"object","required":["status","version","components"],"title":"HealthResponse","description":"The service health response."},"HintBlock":{"properties":{"type":{"type":"string","const":"hint","title":"Type","default":"hint"},"hint":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/TextBlock"},{"$ref":"#/components/schemas/DataBlock"}]},"type":"array"}],"title":"Hint"},"id":{"type":"string","title":"Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"created_at":{"type":"string","title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["hint"],"title":"HintBlock","description":"A block used to provide instructions or hints to the LLM during the\nreasoning-acting loop. When passed to the LLM API, the hint block is\nconverted into a user message.\n\nThe ``hint`` field can be a plain string (text-only) or a list of\n:class:`TextBlock` / :class:`DataBlock` for multimodal content\n(e.g. a background tool result containing both text and an image)."},"HttpMCPConfig":{"properties":{"type":{"type":"string","const":"http_mcp","title":"Type","default":"http_mcp"},"url":{"type":"string","title":"URL","description":"The URL of the MCP server."},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers","description":"The additional headers to include in the HTTP request."},"timeout":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timeout","description":"The HTTP request timeout in seconds.","default":30.0}},"type":"object","required":["url"],"title":"HttpMCPConfig","description":"The HTTP MCP server configuration."},"HubInfo":{"properties":{"hub_id":{"type":"string","title":"Hub Id","description":"The id addressing this hub."},"display_name":{"type":"string","title":"Display Name","description":"The user-facing hub name."},"description":{"type":"string","title":"Description","description":"The user-facing description."},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url","description":"An image identifying the hub, when it has one."}},"type":"object","required":["hub_id","display_name","description"],"title":"HubInfo","description":"One registered hub, as shown in the hub picker."},"InstallMCPRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"The name to install under, defaulting to the card's name. Must match ``[a-zA-Z0-9_-]+``; use it to resolve a clash with an MCP already in the library."},"values":{"additionalProperties":true,"type":"object","title":"Values","description":"The answers to the card's ``inputs_schema``, e.g. API keys."}},"type":"object","title":"InstallMCPRequest","description":"The body of an MCP install call."},"InterruptSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Echo of the interrupted session id."}},"type":"object","required":["session_id"],"title":"InterruptSessionResponse","description":"Response body for ``POST /sessions/{sid}/interrupt`` (HTTP 202).\n\nThe interrupt operation is idempotent and always succeeds for an\nexisting session (only ``404`` is raised when the session id does\nnot exist):\n\n- If the session is **running**, an interrupt signal is published\n  so the local\n  :class:`~agentscope.app._manager.CancelDispatcher` cancels the\n  chat-run task; the agent then runs its ``CancelledError`` cleanup\n  path.\n- If the session is **parked** on HITL / external execution, a\n  resume trigger carrying a\n  :class:`~agentscope.event.UserInterruptEvent` is enqueued so the\n  agent short-circuits into the same cleanup path.\n- If the session is **idle**, the call is a no-op."},"InviteConfig":{"properties":{"invitable":{"type":"boolean","title":"Invitable","description":"Whether this agent may be borrowed into another agent's team via the ``AgentInvite`` tool. Independent from :attr:`invite_description` so the user can preserve an authored blurb while temporarily disabling the toggle. ``invitable=True`` requires a non-empty :attr:`invite_description` (enforced by validator).","default":false},"invite_description":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"textarea","title":"Invite Description","description":"Free-text blurb shown to a leader LLM in the ``AgentInvite`` tool description — used by the leader to decide whether to borrow this agent. Persisted across toggle off/on so the user's authored draft is not lost when :attr:`invitable` is temporarily disabled."}},"type":"object","title":"InviteConfig","description":"User-editable invite settings for :class:`AgentData`.\n\nKept in its own sub-model so the frontend's schema-driven form —\nwhich renders any nested-object property as its own fieldset —\npicks it up as a dedicated section without a per-field allowlist.\nAlso keeps the cross-field ``invitable ⇒ non-empty description``\ninvariant local to this model."},"KbEmbeddingProvider":{"properties":{"credential":{"$ref":"#/components/schemas/CredentialView","description":"The credential record exposing these models."},"models":{"items":{"$ref":"#/components/schemas/EmbeddingModelCard"},"type":"array","title":"Models","description":"Embedding model cards available under this credential, filtered to those compatible with the manager's dimension policy."}},"type":"object","required":["credential","models"],"title":"KbEmbeddingProvider","description":"One credential and the embedding models it can serve.\n\nThe model cards have been projected through the manager's\ndimension policy: incompatible models are removed and matryoshka\ncards are narrowed to the locked dimension when applicable."},"KbMiddlewareParametersSchemaResponse":{"properties":{"parameter_schema":{"additionalProperties":true,"type":"object","title":"Parameter Schema","description":"JSON Schema produced by `RAGMiddleware.Parametersmodel_json_schema()`.  Shaped identically to the `parameter_schema` field on `ModelCard`."}},"type":"object","required":["parameter_schema"],"title":"KbMiddlewareParametersSchemaResponse","description":"Response body exposing the KB middleware's parameters schema.\n\nThe schema is derived from\n:class:`agentscope.middleware.RAGMiddleware.Parameters`\nvia ``model_json_schema()`` so the front-end can render the\nsession-level KB attachment form with the same schema-driven\ncomponent used for model parameters."},"KnowledgeBaseView":{"properties":{"id":{"type":"string","title":"Id","description":"The knowledge base id."},"name":{"type":"string","title":"Name","description":"Display name of the knowledge base."},"description":{"type":"string","title":"Description","description":"Free-form description of the knowledge base.","default":""},"embedding_model_config":{"$ref":"#/components/schemas/EmbeddingModelConfig","description":"Embedding model configuration pinned at creation."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last-update timestamp."},"editable":{"type":"boolean","title":"Editable","description":"Whether the current viewer may modify this knowledge base."}},"type":"object","required":["id","name","embedding_model_config","created_at","updated_at","editable"],"title":"KnowledgeBaseView","description":"Flat, viewer-facing projection of a knowledge base.\n\nUnlike :class:`AgentView` / :class:`CredentialView` — which subclass\ntheir records and expose the nested ``data`` payload verbatim — the\nknowledge base's public wire shape is intentionally **flat**: the\nfrontend and the documented API contract read ``name`` /\n``embedding_model_config`` at the top level. The storage-layer\nnesting of those fields under :attr:`KnowledgeBaseRecord.data`\n(introduced so the SQL backend can serialise a single JSON column)\nmust not leak into the HTTP response, so :meth:`_lift_data_payload`\nlifts them back up. ``user_id`` and the opaque ``collection_name``\nare dropped (pydantic ignores the surplus keys)."},"KnowledgeDocumentView":{"properties":{"id":{"type":"string","title":"Id","description":"The document identifier."},"filename":{"type":"string","title":"Filename","description":"Original filename at upload time."},"size":{"type":"integer","title":"Size","description":"Document size in bytes."},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","description":"IANA media type recorded at upload time, if any."},"status":{"type":"string","enum":["pending","parsing","chunking","indexing","ready","error"],"title":"Status","description":"Current lifecycle state of the document."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Human-readable failure reason when ``status == 'error'``."},"chunk_count":{"type":"integer","title":"Chunk Count","description":"Number of chunks indexed so far.","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Upload timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last status transition timestamp."}},"type":"object","required":["id","filename","size","status","created_at","updated_at"],"title":"KnowledgeDocumentView","description":"A document record as exposed to API clients.\n\nSurfaces both the static fields the UI needs to render a row\n(``filename`` / ``size``) and the live lifecycle fields the front\nend polls (``status`` / ``error`` / ``chunk_count``).  Internal\nfields (``user_id`` / ``blob_uri`` / ``processing_node`` / lease)\nare deliberately omitted — clients have no business introspecting\nthem."},"ListAgentsResponse":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentView"},"type":"array","title":"Agents","description":"Agent records."},"total":{"type":"integer","title":"Total","description":"Total number of agents."}},"type":"object","required":["agents","total"],"title":"ListAgentsResponse","description":"Response body for listing agents."},"ListCredentialSchemasResponse":{"properties":{"schemas":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Schemas","description":"JSON schemas for all registered credential types."}},"type":"object","required":["schemas"],"title":"ListCredentialSchemasResponse","description":"Response body for listing credential type schemas."},"ListCredentialsResponse":{"properties":{"credentials":{"items":{"$ref":"#/components/schemas/CredentialView"},"type":"array","title":"Credentials","description":"Credential records."},"total":{"type":"integer","title":"Total","description":"Total number of credentials."}},"type":"object","required":["credentials","total"],"title":"ListCredentialsResponse","description":"Response body for listing credentials."},"ListEmbeddingModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/EmbeddingModelCard"},"type":"array","title":"Models","description":"The candidate embedding models."},"total":{"type":"integer","title":"Total","description":"The total number of candidates."}},"type":"object","required":["models","total"],"title":"ListEmbeddingModelsResponse","description":"List the candidate embedding models response."},"ListKbEmbeddingModelsResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/KbEmbeddingProvider"},"type":"array","title":"Providers","description":"One entry per credential that has at least one compatible embedding model."},"policy":{"$ref":"#/components/schemas/DimensionPolicy","description":"The dimension policy used to filter the cards; surfaced verbatim so the UI can explain *why* models were filtered."}},"type":"object","required":["providers","policy"],"title":"ListKbEmbeddingModelsResponse","description":"Response body listing KB-compatible embedding models.\n\nThe list is pre-filtered server-side against the manager's\ndimension policy.  The policy itself is also returned so the\nfront-end can render an explanatory banner and lock the dimension\nselector when applicable."},"ListKnowledgeBasesResponse":{"properties":{"knowledge_bases":{"items":{"$ref":"#/components/schemas/KnowledgeBaseView"},"type":"array","title":"Knowledge Bases","description":"All knowledge bases owned by the caller."},"total":{"type":"integer","title":"Total","description":"Total number of returned items."}},"type":"object","required":["knowledge_bases","total"],"title":"ListKnowledgeBasesResponse","description":"Response body for listing the caller's knowledge bases."},"ListKnowledgeDocumentStatusResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/KnowledgeDocumentView"},"type":"array","title":"Items","description":"Subset of the requested documents that still exist. Missing ids are silently omitted — clients may legitimately ask about a document that was deleted between two polls."}},"type":"object","required":["items"],"title":"ListKnowledgeDocumentStatusResponse","description":"Response body for batch document-status polling."},"ListKnowledgeDocumentsResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/KnowledgeDocumentView"},"type":"array","title":"Documents","description":"One view per registered document."},"total":{"type":"integer","title":"Total","description":"Total number of returned items."}},"type":"object","required":["documents","total"],"title":"ListKnowledgeDocumentsResponse","description":"Response body for listing documents inside a knowledge base."},"ListMessagesResponse":{"properties":{"messages":{"items":{},"type":"array","title":"Messages","description":"Messages in chronological order."},"is_running":{"type":"boolean","title":"Is Running","description":"Whether the session is currently running."},"has_more":{"type":"boolean","title":"Has More","description":"Whether there are older messages before this page. When ``True``, pass a message ID from this response as the ``before`` parameter to load the previous page."}},"type":"object","required":["messages","is_running","has_more"],"title":"ListMessagesResponse","description":"Response body for listing messages in a session."},"ListModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ModelCard"},"type":"array","title":"Models","description":"The candidate models."},"total":{"type":"integer","title":"Total","description":"The total number of candidates."}},"type":"object","required":["models","total"],"title":"ListModelsResponse","description":"List the candidate models response."},"ListSchedulesResponse":{"properties":{"schedules":{"items":{"$ref":"#/components/schemas/ScheduleRecord"},"type":"array","title":"Schedules","description":"Schedule records."},"total":{"type":"integer","title":"Total","description":"Total number of schedules."}},"type":"object","required":["schedules","total"],"title":"ListSchedulesResponse","description":"Response body for listing schedules."},"ListSessionsResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionView"},"type":"array","title":"Sessions","description":"Session views (record + is_running + team)."},"total":{"type":"integer","title":"Total","description":"Total number of sessions."}},"type":"object","required":["sessions","total"],"title":"ListSessionsResponse","description":"Response body for listing sessions."},"ListSupportedContentTypesResponse":{"properties":{"media_types":{"items":{"type":"string"},"type":"array","title":"Media Types","description":"Union of IANA media types every registered parser claims to handle.  Deduplicated and sorted."},"extensions":{"items":{"type":"string"},"type":"array","title":"Extensions","description":"Filename extensions (each starting with `.`) every registered parser claims to handle.  Deduplicated and sorted.  Derived from `mimetypes` by the base parser; subclasses may override the default."}},"type":"object","required":["media_types","extensions"],"title":"ListSupportedContentTypesResponse","description":"Response body advertising the parser-supported upload types.\n\nAggregated across every parser registered on the app — the union of\neach parser's :attr:`supported_media_types` and\n:meth:`supported_extensions`.  The front-end uses this to populate\n``<input accept>`` and to reject unsupported drops on the client\nbefore the file leaves the browser."},"ListTTSModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/TTSModelCard"},"type":"array","title":"Models","description":"The candidate TTS models."},"total":{"type":"integer","title":"Total","description":"The total number of candidates."}},"type":"object","required":["models","total"],"title":"ListTTSModelsResponse","description":"List the candidate TTS models response."},"MCPCard":{"properties":{"hub_id":{"type":"string","title":"Hub ID","description":"The id of the hub this card came from."},"id":{"type":"string","title":"ID","description":"The identifier addressing this card on its hub. Defaults to ``name`` for registries that expose no separate id.","default":""},"name":{"type":"string","title":"Name","description":"The default name of the installed MCP client."},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"The user-facing name, falling back to ``name``."},"description":{"type":"string","title":"Description","description":"The user-facing description of the MCP.","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"The tags categorizing this card."},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"The card version reported by the hub."},"updated_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Updated At","description":"The last-updated timestamp (Unix epoch seconds)."},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author","description":"Who published the MCP, when the hub says."},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon URL","description":"An image representing the MCP. ``None`` when the hub offers none — the UI is expected to fall back rather than show a broken image."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"URL","description":"The MCP's page on the hub's website, for a 'view on the hub' link. ``None`` when the hub has no web presence."},"readme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Readme","description":"The server's long-form documentation, shown in the detail view where a skill shows its ``SKILL.md``. ``None`` when the hub publishes none."},"installs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Installs","description":"How many times this MCP has been installed. ``None`` when the hub does not count installs, which is not the same as zero — render it only when set."},"downloads":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Downloads","description":"How many times this MCP has been downloaded. ``None`` when the hub does not count downloads."},"is_stateful":{"type":"boolean","title":"Stateful","description":"Whether the installed client requires explicit connect() and close(). Forwarded to ``MCPClient.is_stateful``.","default":true},"auth":{"type":"string","enum":["none","inputs"],"title":"Auth","description":"How the user authenticates: ``none`` for public servers, ``inputs`` for the ``inputs_schema`` form. Reserved as a discriminator so an ``oauth`` flow can be added later without breaking the API.","default":"inputs"},"inputs_schema":{"additionalProperties":true,"type":"object","title":"Inputs Schema","description":"A JSON Schema (``type: object``) describing the values the user must supply. Secret fields carry the standard ``writeOnly: true`` and ``format: password`` keywords so the frontend renders them masked."},"config_template":{"oneOf":[{"$ref":"#/components/schemas/StdioMCPConfig"},{"$ref":"#/components/schemas/HttpMCPConfig"}],"title":"Config Template","description":"The MCP config whose string leaves may hold ``${name}`` placeholders referring to ``inputs_schema`` properties.","discriminator":{"propertyName":"type","mapping":{"http_mcp":"#/components/schemas/HttpMCPConfig","stdio_mcp":"#/components/schemas/StdioMCPConfig"}}}},"type":"object","required":["hub_id","name","config_template"],"title":"MCPCard","description":"A single MCP listing on a hub.\n\nA card is a *template*, not a connectable client:\n:attr:`config_template` carries ``${...}`` placeholders whose values\nthe user supplies at install time, described by\n:attr:`inputs_schema`.\n\nTwo identifiers, deliberately separate:\n\n- :attr:`id` addresses the card on its hub and is what\n  :attr:`ref` embeds. It may be any opaque string.\n- :attr:`name` is the default name of the *installed* client, which\n  must match ``[a-zA-Z0-9_-]+`` because it composes the model-facing\n  tool name ``mcp__{name}__{tool}``. Cards are not rejected for a\n  bad name — the install call is, so browsing a registry with odd\n  slugs still works."},"MCPClient":{"properties":{"name":{"type":"string","title":"MCP Name","description":"The MCP name."},"is_stateful":{"type":"boolean","title":"Stateful","description":"Whether this is a stateful connection that requires explicit connect() and close(). STDIO MCP must be stateful. HTTP MCP can be either stateful or stateless."},"mcp_config":{"oneOf":[{"$ref":"#/components/schemas/StdioMCPConfig"},{"$ref":"#/components/schemas/HttpMCPConfig"}],"title":"MCP Config","description":"The MCP server configuration.","discriminator":{"propertyName":"type","mapping":{"http_mcp":"#/components/schemas/HttpMCPConfig","stdio_mcp":"#/components/schemas/StdioMCPConfig"}}},"enable_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enable Tools"},"disable_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Disable Tools"},"execution_timeout":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Execution Timeout"}},"type":"object","required":["name","is_stateful","mcp_config"],"title":"MCPClient","description":"The unified MCP client in AgentScope.\n\nThis class provides a unified interface for MCP connections, handling both\nstateful (persistent) and stateless (ephemeral) connections.\n\n- Stateful: Requires explicit connect() and close(), maintains session\n- Stateless: No connect() needed, creates temporary session per call\n\nPrivate attributes:\n- _client: The underlying MCP client context manager\n- _session: The MCP ClientSession (for stateful connections only)\n- _stack: AsyncExitStack for managing connection lifecycle\n- _is_connected: Connection state flag\n- _cached_tools: Cached list of tools\n\nExample:\n\n.. code-block:: python\n\n    # Stateful connection (STDIO or HTTP)\n    client = MCPClient(\n        name=\"file_system\",\n        is_stateful=True,\n        mcp_config=StdioMCPConfig(\n            command=\"mcp-server-filesystem\"\n        )\n    )\n    await client.connect()\n    tools = await client.list_tools()\n    await client.close()\n\n    # Stateless connection (HTTP only)\n    client = MCPClient(\n        name=\"weather_search\",\n        is_stateful=False,\n        mcp_config=HttpMCPConfig(\n            url=\"https://api.weather.com/mcp\"\n        )\n    )\n    # No connect() needed\n    tools = await client.list_tools()"},"MCPClientStatus":{"properties":{"name":{"type":"string","title":"MCP Name","description":"The MCP name."},"is_stateful":{"type":"boolean","title":"Stateful","description":"Whether this is a stateful connection that requires explicit connect() and close(). STDIO MCP must be stateful. HTTP MCP can be either stateful or stateless."},"mcp_config":{"oneOf":[{"$ref":"#/components/schemas/StdioMCPConfig"},{"$ref":"#/components/schemas/HttpMCPConfig"}],"title":"MCP Config","description":"The MCP server configuration.","discriminator":{"propertyName":"type","mapping":{"http_mcp":"#/components/schemas/HttpMCPConfig","stdio_mcp":"#/components/schemas/StdioMCPConfig"}}},"enable_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enable Tools"},"disable_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Disable Tools"},"execution_timeout":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Execution Timeout"},"is_healthy":{"type":"boolean","title":"Is Healthy","default":false},"tools":{"items":{"$ref":"#/components/schemas/ToolInfo"},"type":"array","title":"Tools"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Why listing this MCP's tools failed. A red dot alone leaves the user with nothing to act on — a wrong API key, an unreachable host and a missing command all look the same."}},"type":"object","required":["name","is_stateful","mcp_config"],"title":"MCPClientStatus","description":"MCPClient enriched with live tool list and health status."},"MCPHubPage":{"properties":{"cards":{"items":{"$ref":"#/components/schemas/MCPCard"},"type":"array","title":"Cards","description":"The cards on this page."},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"The opaque cursor fetching the following page, or ``None`` when this is the last one."}},"type":"object","required":["cards"],"title":"MCPHubPage","description":"One page of MCP cards."},"MCPView":{"properties":{"id":{"type":"string","title":"Id","description":"The installed-MCP record id."},"name":{"type":"string","title":"Name","description":"The MCP name, unique for this user."},"is_stateful":{"type":"boolean","title":"Is Stateful","description":"Whether it needs a session."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the user has it turned on."},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"The card's user-facing name at install time."},"description":{"type":"string","title":"Description","description":"The card's description at install time.","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"The card's tags at install time."},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author","description":"Who published the MCP, at install time."},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url","description":"The card's icon at install time."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"The MCP's page on the hub's website."},"hub_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub Id","description":"The hub it came from, or null when added by hand."},"card_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Id","description":"The card's id on that hub."},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"The card version installed."}},"type":"object","required":["id","name","is_stateful","enabled"],"title":"MCPView","description":"One installed MCP, as shown in the user's library.\n\nThe rendered ``mcp_config`` is deliberately left out: it carries the\ninputs the user filled in at install time, API keys included, and\nnothing on this screen needs them."},"ModelCard":{"properties":{"type":{"type":"string","const":"chat_model","title":"Type","default":"chat_model"},"name":{"type":"string","title":"Name","description":"The name of the model"},"label":{"type":"string","title":"Label","description":"The model label."},"status":{"type":"string","enum":["active","deprecated","sunset"],"title":"Status","description":"The model status"},"deprecated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deprecation date","description":"The model deprecation date and time."},"input_types":{"items":{"type":"string"},"type":"array","title":"Input types","description":"The supported model input types.","default":["text/plain"]},"output_types":{"items":{"type":"string"},"type":"array","title":"Output types","description":"The supported model output types.","default":["text/plain"]},"context_size":{"type":"integer","exclusiveMinimum":0.0,"title":"Context size","description":"The context size."},"output_size":{"type":"integer","exclusiveMinimum":0.0,"title":"Max output tokens","description":"The maximum number of tokens."},"parameter_schema":{"additionalProperties":true,"type":"object","title":"Parameter Schema"},"parameters_overrides":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Parameters Overrides"}},"type":"object","required":["name","label","status","context_size","output_size","parameter_schema","parameters_overrides"],"title":"ModelCard","description":"The model card class."},"Msg":{"properties":{"name":{"type":"string","title":"Name"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextBlock"},{"$ref":"#/components/schemas/ThinkingBlock"},{"$ref":"#/components/schemas/HintBlock"},{"$ref":"#/components/schemas/ToolCallBlock"},{"$ref":"#/components/schemas/ToolResultBlock"},{"$ref":"#/components/schemas/DataBlock"}]},"type":"array","title":"Content"},"role":{"type":"string","enum":["user","assistant","system"],"title":"Role"},"id":{"type":"string","title":"Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","title":"Created At"},"usage":{"anyOf":[{"$ref":"#/components/schemas/Usage"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"finished_reason":{"anyOf":[{"$ref":"#/components/schemas/ReplyFinishedReason"},{"type":"null"}]},"structured_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structured Output"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"type":"null"}]}},"type":"object","required":["name","content","role"],"title":"Msg","description":"The message class in AgentScope, responsible for information storage\nand transmission among different agents."},"PermissionBehavior":{"type":"string","enum":["allow","deny","ask","passthrough"],"title":"PermissionBehavior","description":"The behavior of permission.\n\nAttributes:\n    ALLOW: Allow the operation\n    DENY: Deny the operation\n    ASK: Ask the user for permission\n    PASSTHROUGH: Let the permission engine continue with rule matching\n        (used by tools to defer decision to the engine)"},"PermissionContext":{"properties":{"mode":{"$ref":"#/components/schemas/PermissionMode","default":"default"},"working_directories":{"additionalProperties":{"$ref":"#/components/schemas/AdditionalWorkingDirectory"},"type":"object","title":"Working Directories"},"allow_rules":{"additionalProperties":{"items":{"$ref":"#/components/schemas/PermissionRule"},"type":"array"},"type":"object","title":"Allow Rules"},"deny_rules":{"additionalProperties":{"items":{"$ref":"#/components/schemas/PermissionRule"},"type":"array"},"type":"object","title":"Deny Rules"},"ask_rules":{"additionalProperties":{"items":{"$ref":"#/components/schemas/PermissionRule"},"type":"array"},"type":"object","title":"Ask Rules"}},"type":"object","title":"PermissionContext","description":"Context for permission checking.\n\nContains the permission mode, working directories, and all configured\npermission rules organized by behavior type (allow, deny, ask)."},"PermissionMode":{"type":"string","enum":["default","accept_edits","explore","bypass","dont_ask"],"title":"PermissionMode","description":"The mode of permission.\n\nPermission modes control how the system handles tool execution requests.\nDifferent modes are suitable for different scenarios:\n\n+---------------+--------------------------------------------------+--------------------------------+\n| Mode          | Behavior                                         | Use Case                       |\n+===============+==================================================+================================+\n| DEFAULT       | Every operation asks for permission unless:      | Default mode, most secure      |\n|               | - an allow rule matches, OR                      |                                |\n|               | - the tool's ``check_permissions`` explicitly    |                                |\n|               |   returns ALLOW for the invocation (currently   |                                |\n|               |   only ``Bash`` auto-allows recognized          |                                |\n|               |   read-only commands such as ``ls``/``git       |                                |\n|               |   status``). Read/Glob/Grep return PASSTHROUGH  |                                |\n|               |   and fall through to the default ASK unless    |                                |\n|               |   an allow rule matches.                        |                                |\n+---------------+--------------------------------------------------+--------------------------------+\n| ACCEPT_EDITS  | - Auto-allow file writes in working directories | User present, rapid iteration  |\n|               | - Auto-allow file reads in working directories  | development                    |\n|               | - Auto-allow filesystem commands (mkdir, rm,     |                                |\n|               |   mv, cp, ...) **only when all target paths**   |                                |\n|               |   **resolve inside a working directory**         |                                |\n|               | - Other operations follow normal rules           |                                |\n+---------------+--------------------------------------------------+--------------------------------+\n| EXPLORE       | Read-only mode:                                  | Exploring codebase, planning   |\n|               | - Allow: read-only tools (``Read``/``Grep``/    | implementation                 |\n|               |   ``Glob``) and read-only bash commands         |                                |\n|               |   (e.g. ``ls``, ``git status``)                  |                                |\n|               | - Deny: any modification tool / command         |                                |\n|               | - User-configured DENY or ASK rules take         |                                |\n|               |   precedence over the read-only auto-allow      |                                |\n+---------------+--------------------------------------------------+--------------------------------+\n| BYPASS        | Skip all permission checks except explicit       | Sandboxed environments         |\n|               | user-configured deny / ask rules and tool       | (container, VM), unattended    |\n|               | DENY. **Safety ASKs from tools are NOT**         | runs where you fully trust     |\n|               | **enforced** — including ``rm -rf /``, writes   | the agent                      |\n|               | to ``~/.bashrc``, command-injection patterns,    |                                |\n|               | etc. Use deny rules to protect specific paths.   |                                |\n|               | For unattended runs that still need safety,      |                                |\n|               | prefer DONT_ASK.                                 |                                |\n+---------------+--------------------------------------------------+--------------------------------+\n| DONT_ASK      | Convert every ASK (including safety ASKs and     | Scheduled tasks, background    |\n|               | ASK-rule hits) to DENY. Safe-by-default for     | execution when user is away    |\n|               | unattended execution.                            |                                |\n+---------------+--------------------------------------------------+--------------------------------+\n\nAttributes:\n    DEFAULT: Default mode - explicit permission per action. The\n        only auto-allow path is the tool's own ``check_permissions``\n        returning ALLOW (currently just ``Bash`` for recognized\n        read-only commands like ``ls``/``git status``).\n    ACCEPT_EDITS: Accept edits mode - automatically allows file\n        edits within working directories (including filesystem\n        bash commands whose every target is in a working dir).\n    EXPLORE: Explore mode - read-only; modifications are denied.\n    BYPASS: Bypass mode - skips safety checks; relies on user\n        deny / ask rules as the only guardrail.\n    DONT_ASK: Don't ask mode - converts all ASK decisions to DENY\n        (for unattended execution)."},"PermissionRule":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"rule_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Content"},"behavior":{"$ref":"#/components/schemas/PermissionBehavior"},"source":{"type":"string","title":"Source"}},"type":"object","required":["tool_name","rule_content","behavior","source"],"title":"PermissionRule","description":"Permission rule for tool usage.\n\nA permission rule defines whether a specific tool or tool operation\nshould be allowed, denied, or require user confirmation. The\nrule_content field has different semantics depending on the tool_name:\n\n- For \"Bash\": rule_content is a substring pattern matched against the\n  command Example: rule_content=\"npm install\" matches \"npm install express\"\n\n- For \"Write\"/\"Read\": rule_content is a glob pattern matched against file\n  paths Example: rule_content=\"src/**\" matches \"src/main.py\"\n\n- For other tools: rule_content is a tool-specific filter pattern"},"ReActConfig":{"properties":{"max_iters":{"type":"integer","title":"Max Iterations","description":"The maximum number of reasoning-acting iterations in one reply","default":20},"structured_output_grace_iters":{"type":"integer","exclusiveMinimum":0.0,"title":"Grace Iters for Structured Output","description":"The grace iterations for structured output when exceeding the max iterations","default":5},"stop_on_reject":{"type":"boolean","title":"Rejection Handling","description":"Whether to stop replying when being rejected to execute tools.","default":false},"interruption_message":{"type":"string","title":"Interruption Message","description":"The quick reply message when interrupted.","default":"I notice the interruption. How can I help you?"},"interruption_raise_cancelled_error":{"type":"boolean","title":"Raise CancelledError on Interruption","description":"Whether to re-raise ``asyncio.CancelledError`` after handling the interruption. When ``False``, the ``CancelledError`` is swallowed once the interruption context has been produced.","default":false}},"type":"object","title":"ReActConfig","description":"The reasoning related configuration"},"ReadCacheEntry":{"properties":{"lines":{"items":{"type":"string"},"type":"array","title":"Lines"},"updated_at":{"type":"number","title":"Updated At"},"bytes":{"type":"number","title":"Bytes"},"file_path":{"type":"string","title":"File Path"}},"type":"object","required":["lines","updated_at","bytes","file_path"],"title":"ReadCacheEntry","description":"The read file cache."},"ReplyContext":{"properties":{"reply_id":{"type":"string","title":"Reply Id"},"cur_iter":{"type":"integer","title":"Cur Iter","default":0},"structured_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structured Schema"},"structured_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structured Output"}},"type":"object","title":"ReplyContext","description":"The context of the current agent reply."},"ReplyFinishedReason":{"type":"string","enum":["completed","interrupted","exceed_max_iters","error"],"title":"ReplyFinishedReason","description":"The reason a reply finished."},"RoutingConfig":{"properties":{"bindings":{"items":{"$ref":"#/components/schemas/ChannelBinding"},"type":"array","title":"Bindings"}},"type":"object","title":"RoutingConfig","description":"Ordered routing rules for a channel.\n\nValidated so routing is always total and unambiguous: exactly one\ncatch-all, placed last, with no duplicate ``(match_key,\nmatch_value)`` pairs."},"ScheduleData":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the schedule."},"description":{"type":"string","title":"Description","description":"The description of the schedule, including its purpose, trigger conditions, etc.","default":""},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the schedule is active. Disabled schedules are retained but will not trigger.","default":true},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone name used to evaluate the cron expression, e.g. 'America/New_York' or 'Asia/Shanghai'.","default":"Asia/Shanghai"},"cron_expression":{"type":"string","title":"Cron Expression","description":"Standard 5-field cron expression, e.g. '0 9 * * 1-5'."},"started_at":{"type":"string","format":"date-time","title":"Started At","description":"The date and time the schedule was started."},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At","description":"The date and time the schedule was ended."},"chat_model_config":{"$ref":"#/components/schemas/ChatModelConfig","description":"Model configuration for the auto-created session."},"stateful":{"type":"boolean","title":"Stateful","description":"Whether consecutive executions share the same session context. If not, each execution will have its own state.","default":false},"permission_mode":{"$ref":"#/components/schemas/PermissionMode","title":"Permission mode","description":"Permission level for the agent during scheduled execution. Defaults to DONT_ASK since no user is present to answer prompts.","default":"dont_ask"},"source":{"$ref":"#/components/schemas/ScheduleSource","description":"Indicates how this schedule was created.","default":"USER"},"source_session_id":{"type":"string","title":"Source Session Id","description":"The source session identifier, used for resource retrieval.","default":""}},"type":"object","required":["name","cron_expression","chat_model_config"],"title":"ScheduleData","description":"The schedule configuration data."},"ScheduleRecord":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the credential."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"user_id":{"type":"string","title":"User Id","description":"Owner user id."},"agent_id":{"type":"string","title":"Agent Id","description":"The agent id that will execute the schedule."},"data":{"$ref":"#/components/schemas/ScheduleData","description":"Schedule configuration."}},"type":"object","required":["user_id","agent_id","data"],"title":"ScheduleRecord","description":"Persisted schedule record."},"ScheduleSessionsResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionRecord"},"type":"array","title":"Sessions","description":"Sessions triggered by this schedule."},"total":{"type":"integer","title":"Total","description":"Total number of execution sessions."}},"type":"object","required":["sessions","total"],"title":"ScheduleSessionsResponse","description":"Response body for listing execution sessions of a schedule."},"ScheduleSource":{"type":"string","enum":["USER","AGENT"],"title":"ScheduleSource","description":"The source that created the schedule.\n\nAttributes:\n    USER: Created manually by the user via the UI.\n    AGENT: Created automatically by an agent, e.g. via a tool call."},"SearchKnowledgeBaseRequest":{"properties":{"query":{"type":"string","title":"Query","description":"The natural-language search query."},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","description":"Maximum number of results to return.","default":5}},"type":"object","required":["query"],"title":"SearchKnowledgeBaseRequest","description":"Request body for searching a knowledge base."},"SearchKnowledgeBaseResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/VectorSearchResult"},"type":"array","title":"Results","description":"Matched chunks ordered by descending similarity score."},"total":{"type":"integer","title":"Total","description":"Total number of returned results."}},"type":"object","required":["results","total"],"title":"SearchKnowledgeBaseResponse","description":"Response body for a knowledge base search."},"SessionConfig":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"type":"string","title":"Name","description":"Display name for the session."},"chat_model_config":{"anyOf":[{"$ref":"#/components/schemas/ChatModelConfig"},{"type":"null"}]},"fallback_chat_model_config":{"anyOf":[{"$ref":"#/components/schemas/ChatModelConfig"},{"type":"null"}]},"tts_model_config":{"anyOf":[{"$ref":"#/components/schemas/TTSModelConfig"},{"type":"null"}]},"knowledge_config":{"anyOf":[{"$ref":"#/components/schemas/SessionKnowledgeConfig"},{"type":"null"}]}},"type":"object","required":["workspace_id"],"title":"SessionConfig","description":"Session configuration — set at creation, updatable via PATCH."},"SessionKnowledgeConfig":{"properties":{"knowledge_base_ids":{"items":{"type":"string"},"type":"array","title":"Knowledge Base Ids"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"}},"type":"object","title":"SessionKnowledgeConfig","description":"Session-level knowledge base attachment.\n\nPersists which knowledge bases the agent should retrieve from for\nthis session and how the\n:class:`~agentscope.middleware.RAGMiddleware` should be\nconfigured.  ``parameters`` carries the user-tunable middleware\nfields verbatim (mirrors :attr:`ChatModelConfig.parameters`); the\naccepted keys and value types are described by\n:meth:`RAGMiddleware.Config.model_json_schema`."},"SessionRecord":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the credential."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"user_id":{"type":"string","title":"User Id"},"agent_id":{"type":"string","title":"Agent Id"},"source":{"$ref":"#/components/schemas/SessionSource","default":"user"},"source_schedule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Schedule Id"},"source_chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Chat Id"},"source_channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Channel Id"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"config":{"$ref":"#/components/schemas/SessionConfig"},"state":{"$ref":"#/components/schemas/AgentState"}},"type":"object","required":["user_id","agent_id","config"],"title":"SessionRecord","description":"The session record."},"SessionScope":{"type":"string","enum":["per_chat","per_chat_user"],"title":"SessionScope","description":"How inbound messages are grouped into agent sessions.\n\nScope is chat-centric: the session key is a projection of the\n``(chat_id, user_id)`` pair."},"SessionSettings":{"properties":{"chat_model_config":{"additionalProperties":true,"type":"object","title":"Chat Model Config"},"fallback_chat_model_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Fallback Chat Model Config"},"permission_mode":{"type":"string","title":"Permission Mode","default":"default"}},"type":"object","required":["chat_model_config"],"title":"SessionSettings","description":"Settings applied when a channel creates an agent session."},"SessionSource":{"type":"string","enum":["user","schedule","channel"],"title":"SessionSource","description":"The source that created the session."},"SessionStatus":{"type":"string","enum":["running","idle","awaiting_permission","awaiting_external_result"],"title":"SessionStatus","description":"The high-level status of a session, unifying cluster liveness\n(from the message bus) with the durable tool-call parking state\n(from the persisted :class:`~agentscope.state.AgentState.context`).\n\nExactly one value applies at any moment — the frontend renders a\nsingle indicator without having to reconcile multiple boolean\nflags.\n\nPrecedence: ``RUNNING`` is decided first from the distributed\nsession-run lock; only when the session is not held by any worker\ndo the ``AWAITING_*`` / ``IDLE`` values (derived from the stored\ncontext tail) apply. This ordering reflects the ground-truth\nhierarchy — while a worker owns the run, the live in-memory state\nsupersedes the persisted snapshot, which is by definition stale\nuntil the run yields.\n\nValues:\n    - ``RUNNING``: a worker somewhere in the cluster currently\n      holds the session's run lease on the message bus.\n    - ``IDLE``: no worker is running the session, and its\n      persisted context is not parked on any pending tool call.\n    - ``AWAITING_PERMISSION``: no worker is running the session,\n      and the persisted context tail has at least one tool call\n      waiting for user permission confirmation (HITL).\n    - ``AWAITING_EXTERNAL_RESULT``: no worker is running the\n      session, and the persisted context tail has at least one\n      tool call dispatched to an external executor and awaiting\n      its result (with no peer awaiting permission)."},"SessionStatusResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"The session that was probed."},"status":{"$ref":"#/components/schemas/SessionStatus","description":"The session's unified status. One of ``running`` (some worker holds the run lease), ``idle`` (no worker, context clean), ``awaiting_permission`` (no worker, context parked on HITL tool call), or ``awaiting_external_result`` (no worker, context parked on external executor)."}},"type":"object","required":["session_id","status"],"title":"SessionStatusResponse","description":"Response body for probing a session's high-level status.\n\nSee :class:`~agentscope.app._service.SessionStatus` for the\nsemantics of each ``status`` value and the precedence rules used\nto derive it."},"SessionView":{"properties":{"session":{"$ref":"#/components/schemas/SessionRecord","description":"The persisted session record. Includes ``state`` (``permission_context`` / ``tool_context`` / ``tasks_context``) inline."},"is_running":{"type":"boolean","title":"Is Running","description":"Whether a chat run is currently active on this session."},"team":{"anyOf":[{"$ref":"#/components/schemas/TeamDetailResponse"},{"type":"null"}],"description":"Resolved team detail when ``session.team_id`` is set (leader agent + member agents with their session ids). ``None`` when the session does not participate in any team."}},"type":"object","required":["session","is_running"],"title":"SessionView","description":"Per-session bundle with everything the frontend needs to\nrender either the list view or open a session.\n\nBundles three orthogonal pieces of information so opening a\nsession does not require a waterfall of follow-up requests:\n\n- the persisted :class:`SessionRecord` itself (config + state),\n- whether the session has an active chat run right now,\n- the team detail (resolved leader + members) when the session\n  participates in a team.\n\nMessages are intentionally **not** included here — they are\npaginated separately via ``GET /sessions/{id}/messages``."},"Skill":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"dir":{"type":"string","title":"Dir"},"markdown":{"type":"string","title":"Markdown"},"updated_at":{"type":"number","title":"Updated At"}},"type":"object","required":["name","description","dir","markdown","updated_at"],"title":"Skill","description":"The agent skill class"},"SkillCard":{"properties":{"hub_id":{"type":"string","title":"Hub ID","description":"The id of the hub this card came from."},"id":{"type":"string","title":"ID","description":"The identifier addressing this card on its hub. Defaults to ``name`` for registries that expose no separate id.","default":""},"name":{"type":"string","title":"Name","description":"The skill name."},"description":{"type":"string","title":"Description","description":"The user-facing description of the skill.","default":""},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"The user-facing name, falling back to ``name``."},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"The tags categorizing this card."},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"The card version reported by the hub."},"updated_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Updated At","description":"The last-updated timestamp (Unix epoch seconds)."},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author","description":"Who published the skill, when the hub says."},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon URL","description":"An image representing the skill, for the card and the detail view. ``None`` when the hub offers none — the UI is expected to fall back rather than show a broken image."},"installs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Installs","description":"How many times this skill has been installed. ``None`` when the hub does not count installs, which is not the same as zero — render it only when set."},"downloads":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Downloads","description":"How many times this skill has been downloaded. ``None`` when the hub does not count downloads."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"URL","description":"The skill's page on the hub's website, for a 'view on the hub' link. ``None`` when the hub has no web presence."},"markdown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown","description":"The ``SKILL.md`` body. Left ``None`` when browsing so the catalog does not fetch one file per card; populated by ``get_skill``."},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"The hub-specific extra fields carried verbatim."}},"type":"object","required":["hub_id","name"],"title":"SkillCard","description":"A single skill listing on a hub.\n\nUnlike an :class:`MCPCard` there is nothing to configure: installing\na skill copies its files into the workspace, so no input form and no\ntemplate substitution are involved.\n\n:attr:`id` addresses the card on its hub — together with\n:attr:`hub_id` it names the card globally; :attr:`name` is the\nskill's own name."},"SkillHubPage":{"properties":{"cards":{"items":{"$ref":"#/components/schemas/SkillCard"},"type":"array","title":"Cards","description":"The cards on this page."},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"The opaque cursor fetching the following page, or ``None`` when this is the last one."}},"type":"object","required":["cards"],"title":"SkillHubPage","description":"One page of skill cards."},"SkillRecord":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the credential."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"description":{"type":"string","title":"Description","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"markdown":{"type":"string","title":"Markdown","default":""},"hub_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub Id"},"card_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Id"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["user_id","name"],"title":"SkillRecord","description":"One skill a user has installed, at the user level rather than in\nany one workspace — the skill counterpart of :class:`MCPRecord`.\n\nUnlike an MCP, whose whole substance is a config small enough to\nstore inline, a skill is a directory of files. Those files are *not*\nkept here: the record holds where the skill came from and what it\nsays it does, and the archive is re-fetched from the hub when the\nskill is actually put into a workspace.\n\nTODO: store the archive so the library survives the hub dropping the\ncard or going offline. That needs a blob store, and the one this app\nhas is only wired up alongside ``knowledge_base_manager``."},"SkillView":{"properties":{"id":{"type":"string","title":"Id","description":"The installed-skill record id."},"name":{"type":"string","title":"Name","description":"The skill name, unique for this user."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the user has it turned on."},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"The card's user-facing name at install time."},"description":{"type":"string","title":"Description","description":"The card's description at install time.","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"The card's tags at install time."},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author","description":"Who published the skill, at install time."},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url","description":"The card's icon at install time."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"The skill's page on the hub's website."},"hub_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub Id","description":"The hub it came from, or null when added by hand."},"card_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Id","description":"The card's id on that hub."},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"The card version installed."}},"type":"object","required":["id","name","enabled"],"title":"SkillView","description":"One installed skill, as shown in the user's library."},"StdioMCPConfig":{"properties":{"type":{"type":"string","const":"stdio_mcp","title":"Type","default":"stdio_mcp"},"command":{"type":"string","title":"Command","description":"The command to start the MCP server."},"args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Args","description":"The command line arguments to pass to the MCP server."},"env":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment Variables","description":"The environment variables to pass to the MCP server."},"cwd":{"anyOf":[{"type":"string"},{"type":"string","format":"path"},{"type":"null"}],"title":"CWD","description":"The working directory to use when spawning the process."},"encoding_error_handler":{"type":"string","enum":["strict","ignore","replace"],"title":"Encoding Error Handler","description":"The text encoding error handler.","default":"strict"}},"type":"object","required":["command"],"title":"StdioMCPConfig","description":"The STDIO MCP server configuration."},"TTSModelCard":{"properties":{"type":{"type":"string","const":"tts_model","title":"Type","default":"tts_model"},"name":{"type":"string","title":"Name","description":"The name of the TTS model"},"label":{"type":"string","title":"Label","description":"The model label."},"status":{"type":"string","enum":["active","deprecated","sunset"],"title":"Status","description":"The model status","default":"active"},"deprecated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deprecation date","description":"The model deprecation date and time."},"input_types":{"items":{"type":"string"},"type":"array","title":"Input types","description":"The supported model input types.","default":["text/plain"]},"output_types":{"items":{"type":"string"},"type":"array","title":"Output types","description":"The supported model output types.","default":["audio/wav"]},"realtime":{"type":"boolean","title":"Realtime","description":"Whether the model supports streaming input (realtime).","default":false},"parameter_schema":{"additionalProperties":true,"type":"object","title":"Parameter Schema"},"parameters_overrides":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Parameters Overrides"}},"type":"object","required":["name","label","parameter_schema","parameters_overrides"],"title":"TTSModelCard","description":"The model card class for TTS models."},"TTSModelConfig":{"properties":{"type":{"type":"string","title":"Type"},"credential_id":{"type":"string","title":"Credential Id"},"model":{"type":"string","title":"Model"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"}},"type":"object","required":["type","credential_id","model","parameters"],"title":"TTSModelConfig","description":"The TTS model configuration class."},"Task":{"properties":{"subject":{"type":"string","title":"Subject"},"description":{"type":"string","title":"Description"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","title":"Created At"},"state":{"type":"string","enum":["pending","in_progress","completed"],"title":"State","default":"pending"},"id":{"type":"string","title":"Id"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"blocks":{"items":{"type":"string"},"type":"array","title":"Blocks"},"blocked_by":{"items":{"type":"string"},"type":"array","title":"Blocked By"}},"type":"object","required":["subject","description","metadata"],"title":"Task","description":"The agent task."},"TaskContext":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/Task"},"type":"array","title":"Tasks"}},"type":"object","title":"TaskContext","description":"The task context."},"TeamData":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the team."},"description":{"type":"string","title":"Description","description":"What the team is for — its overall goal or shared context. Wired into every member's system prompt so all members share the same high-level understanding of why the team exists.","default":""},"member_ids":{"items":{"type":"string"},"type":"array","title":"Member Ids","description":"**Deprecated** — legacy roster of worker agent ids from before the ``AgentInvite`` era, when every member was team-spawned (``source='team'``) with a 1:1 agent-session mapping. New code should read :attr:`members` via the ``ensure_team_members`` helper, which migrates any records still using this field to the richer schema on first read.","deprecated":true},"members":{"items":{"$ref":"#/components/schemas/TeamMember"},"type":"array","title":"Members","description":"Explicit member roster with role + session id per entry. Read this via the ``ensure_team_members`` helper so legacy records with only :attr:`member_ids` populated are migrated transparently."}},"type":"object","required":["name"],"title":"TeamData","description":"The team data model."},"TeamDetailResponse":{"properties":{"team":{"$ref":"#/components/schemas/TeamRecord","description":"The team record."},"leader_agent":{"anyOf":[{"$ref":"#/components/schemas/AgentView"},{"type":"null"}],"description":"Leader's agent record (resolved from the team's ``session_id`` → session.agent_id)."},"members":{"items":{"$ref":"#/components/schemas/TeamMemberView"},"type":"array","title":"Members","description":"Worker agents listed in :attr:`TeamData.member_ids`, each paired with its single session id when available."}},"type":"object","required":["team"],"title":"TeamDetailResponse","description":"Resolved team detail embedded inside :class:`SessionView.team`."},"TeamMember":{"properties":{"owner_id":{"type":"string","title":"Owner Id","description":"Owner of the member's agent. Always equals the team owner in today's user-only invite pool, but is stored explicitly so a future admin-share layer (agents borrowed across users) can slot in without a schema migration. Distinct name from :attr:`TeamRecord.user_id` on purpose — the surrounding team already carries the team owner in context, so calling this field ``user_id`` too would be ambiguous."},"agent_id":{"type":"string","title":"Agent Id","description":"The member agent's id."},"session_id":{"type":"string","title":"Session Id","description":"The team-scoped session id for this member. For ``created`` members this is the sole session (1:1 with the agent). For ``invited`` members this is the freshly-minted session that ``AgentInvite`` created — the agent's other sessions are unrelated to this team."},"role":{"type":"string","enum":["created","invited"],"title":"Role","description":"How this member joined the team. ``created`` — spawned from a :class:`SubAgentTemplate` via ``AgentCreate``, deleted with the team. ``invited`` — a pre-existing user-owned agent borrowed via ``AgentInvite``, retains its :class:`AgentRecord` when the team is dissolved."}},"type":"object","required":["owner_id","agent_id","session_id","role"],"title":"TeamMember","description":"An entry in a team's member roster.\n\nUnlike the legacy :attr:`TeamData.member_ids`, this carries both the\nagent id AND the session id — required because an *invited* member's\nagent (e.g. Monday) can have multiple sessions of its own; the team\nonly wants the one it created when the leader called ``AgentInvite``.\nThe ``role`` tag then drives cascade behavior (see\n:meth:`SessionService.delete_team`): ``created`` members are fully\ndeleted with the team, ``invited`` members only lose the borrowed\nsession while their :class:`AgentRecord` survives."},"TeamMemberView":{"properties":{"agent":{"$ref":"#/components/schemas/AgentView","description":"The worker agent record."},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"The worker's session id. ``None`` if the agent is in an inconsistent state (worker without a session)."}},"type":"object","required":["agent"],"title":"TeamMemberView","description":"One row in :attr:`TeamDetailResponse.members`.\n\nPairs each member's :class:`AgentView` with its single\n``session_id`` so the UI can subscribe to the worker's chat\nstream without a separate lookup."},"TeamRecord":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the credential."},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"user_id":{"type":"string","title":"User Id"},"session_id":{"type":"string","title":"Session Id"},"data":{"$ref":"#/components/schemas/TeamData"}},"type":"object","required":["user_id","session_id","data"],"title":"TeamRecord","description":"The team ORM model.\n\nTeam membership is session-level: the leader is identified by its\n``session_id`` (since a user agent can lead multiple teams across\ndifferent sessions). Workers are identified by\n:class:`TeamMember` entries in :attr:`TeamData.members`, accessed\nvia the ``ensure_team_members`` helper which handles migration from\nthe legacy :attr:`TeamData.member_ids` shape."},"TextBlock":{"properties":{"type":{"type":"string","const":"text","title":"Type","default":"text"},"text":{"type":"string","title":"Text"},"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["text"],"title":"TextBlock","description":"The text block."},"ThinkingBlock":{"properties":{"type":{"type":"string","const":"thinking","title":"Type","default":"thinking"},"thinking":{"type":"string","title":"Thinking"},"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"additionalProperties":true,"type":"object","required":["thinking"],"title":"ThinkingBlock","description":"The thinking block.\n\nAllows extra provider-specific fields (e.g. Anthropic's ``signature``,\n``redacted_thinking_data``) via ``extra=\"allow\"`` so that model\nimplementations can pass arbitrary metadata without subclassing.\n\n.. note::\n    Anthropic's ``redacted_thinking`` blocks are also stored as\n    ``ThinkingBlock`` instances with ``thinking=\"\"`` and the\n    encrypted payload in the ``redacted_thinking_data`` extra\n    field. Callers filtering by ``type==\"thinking\"`` (e.g.\n    ``get_content_blocks``) will receive both visible and\n    redacted blocks."},"ToolCallBlock":{"properties":{"type":{"type":"string","const":"tool_call","title":"Type","default":"tool_call"},"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"input":{"type":"string","title":"Input"},"state":{"$ref":"#/components/schemas/ToolCallState","default":"pending"},"suggested_rules":{"items":{"$ref":"#/components/schemas/PermissionRule"},"type":"array","title":"Suggested Rules"},"created_at":{"type":"string","title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","name","input"],"title":"ToolCallBlock","description":"The tool call block."},"ToolCallState":{"type":"string","enum":["pending","asking","allowed","submitted","finished"],"title":"ToolCallState","description":"The state of the tool call."},"ToolContext":{"properties":{"max_cache_files":{"type":"integer","exclusiveMinimum":1.0,"title":"Max Cache Files","default":100},"max_cache_bytes":{"type":"number","exclusiveMinimum":10000.0,"title":"Max Cache Bytes","default":25000},"read_file_cache":{"items":{"$ref":"#/components/schemas/ReadCacheEntry"},"type":"array","title":"Read File Cache"},"activated_groups":{"items":{"type":"string"},"type":"array","title":"Activated Groups"}},"type":"object","title":"ToolContext","description":"The tool context, e.g. tool cache"},"ToolInfo":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"ToolInfo","description":"The tool info."},"ToolResultBlock":{"properties":{"type":{"type":"string","const":"tool_result","title":"Type","default":"tool_result"},"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"output":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/TextBlock"},{"$ref":"#/components/schemas/DataBlock"}]},"type":"array"}],"title":"Output"},"state":{"$ref":"#/components/schemas/ToolResultState","default":"running"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","name","output"],"title":"ToolResultBlock","description":"The tool result block."},"ToolResultState":{"type":"string","enum":["success","error","interrupted","denied","running"],"title":"ToolResultState","description":"The tool result state."},"URLSource":{"properties":{"type":{"type":"string","const":"url","title":"Type","default":"url"},"url":{"type":"string","minLength":1,"format":"uri","title":"Url"},"media_type":{"type":"string","title":"Media Type"}},"type":"object","required":["url","media_type"],"title":"URLSource","description":"The URL source."},"UpdateAgentRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New display name."},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt","description":"New system prompt."},"context_config":{"anyOf":[{"$ref":"#/components/schemas/ContextConfig"},{"type":"null"}],"description":"New context configuration."},"react_config":{"anyOf":[{"$ref":"#/components/schemas/ReActConfig"},{"type":"null"}],"description":"New ReAct loop configuration."},"invite_config":{"anyOf":[{"$ref":"#/components/schemas/InviteConfig"},{"type":"null"}],"description":"New invite-pool settings. Pass the full :class:`InviteConfig` object to update; omit to leave both invitable-related fields unchanged."}},"type":"object","title":"UpdateAgentRequest","description":"Request body for partially updating an agent.\n\nOmit any field to keep its current value."},"UpdateChannelRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"platform_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Platform Config"},"routing":{"anyOf":[{"$ref":"#/components/schemas/RoutingConfig"},{"type":"null"}]},"session":{"anyOf":[{"$ref":"#/components/schemas/SessionSettings"},{"type":"null"}]},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"UpdateChannelRequest","description":"Request body for updating a channel (type/credentials immutable)."},"UpdateCredentialRequest":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data","description":"New credential payload."}},"type":"object","required":["data"],"title":"UpdateCredentialRequest","description":"Request body for updating an existing credential."},"UpdateKnowledgeBaseRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New display name; omit to leave unchanged."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"New free-form description; omit to leave unchanged."}},"type":"object","title":"UpdateKnowledgeBaseRequest","description":"Request body for updating a knowledge base.\n\nOnly mutable fields can be set here.  The embedding model\nconfiguration is pinned at creation time and cannot be changed —\nswitching it would invalidate every previously inserted vector."},"UpdateMCPRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"A new name. Must match ``[a-zA-Z0-9_-]+`` and stay unique for this user."},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values","description":"New answers to the card's ``inputs_schema``, merged over the stored ones — send only the keys that changed. The config is re-rendered from the card, so this needs the originating hub to still be registered and reachable."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Whether the MCP is turned on."}},"type":"object","title":"UpdateMCPRequest","description":"The body of a library edit. Omitted fields are left alone."},"UpdateScheduleRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New display name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"New description."},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression","description":"New cron expression. Reschedules the task immediately."},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"New IANA timezone name."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Set to False to pause the schedule without deleting it."},"stateful":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stateful","description":"Change whether executions share session context."},"permission_mode":{"anyOf":[{"$ref":"#/components/schemas/PermissionMode"},{"type":"null"}],"description":"New permission mode."}},"type":"object","title":"UpdateScheduleRequest","description":"Request body for partially updating a schedule.\n\nOmit any field to keep its current value.  Changing ``cron_expression``\nor ``timezone`` will reschedule the APScheduler job immediately.\nChanging ``enable`` to ``False`` removes the job from the scheduler\nwithout deleting the record; setting it back to ``True`` re-registers it."},"UpdateSessionRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New display name."},"chat_model_config":{"anyOf":[{"$ref":"#/components/schemas/ChatModelConfig"},{"type":"null"}],"description":"New model configuration. Replaces the existing one entirely. Pass null to clear; omit to leave unchanged."},"fallback_chat_model_config":{"anyOf":[{"$ref":"#/components/schemas/ChatModelConfig"},{"type":"null"}],"description":"New fallback model configuration. Pass null to clear; omit to leave unchanged."},"tts_model_config":{"anyOf":[{"$ref":"#/components/schemas/TTSModelConfig"},{"type":"null"}],"description":"New TTS model configuration. Pass null to clear; omit to leave unchanged."},"knowledge_config":{"anyOf":[{"$ref":"#/components/schemas/SessionKnowledgeConfig"},{"type":"null"}],"description":"New knowledge base attachment + middleware parameters. Pass null to clear; omit to leave unchanged."},"permission_mode":{"anyOf":[{"$ref":"#/components/schemas/PermissionMode"},{"type":"null"}],"description":"New permission mode for the session."}},"type":"object","title":"UpdateSessionRequest","description":"Request body for updating an existing session.\n\nOmit any field to keep its current value."},"UploadKnowledgeDocumentResponse":{"properties":{"document_id":{"type":"string","title":"Document Id","description":"Server-assigned document identifier."},"filename":{"type":"string","title":"Filename","description":"The original filename of the uploaded document."},"status":{"type":"string","enum":["pending","parsing","chunking","indexing","ready","error"],"title":"Status","description":"Lifecycle state immediately after upload — always ``'pending'`` in the happy path; surfaced so the client can seed its progress tracker without an extra round-trip."}},"type":"object","required":["document_id","filename","status"],"title":"UploadKnowledgeDocumentResponse","description":"Response body after uploading a document into a knowledge base."},"Usage":{"properties":{"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"}},"type":"object","required":["input_tokens","output_tokens"],"title":"Usage","description":"The token usage information of a message."},"UserConfirmResultEvent":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"type":{"type":"string","const":"USER_CONFIRM_RESULT","title":"Type","default":"USER_CONFIRM_RESULT"},"reply_id":{"type":"string","title":"Reply Id"},"confirm_results":{"items":{"$ref":"#/components/schemas/ConfirmResult"},"type":"array","title":"Confirm Results"}},"type":"object","required":["reply_id","confirm_results"],"title":"UserConfirmResultEvent","description":"User confirm result event."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VectorSearchResult":{"properties":{"score":{"type":"number","title":"Score"},"document_id":{"type":"string","title":"Document Id"},"chunk":{"$ref":"#/components/schemas/Chunk"}},"type":"object","required":["score","document_id","chunk"],"title":"VectorSearchResult","description":"A single result returned by a similarity search.\n\nPairs the matched :class:`Chunk` with its similarity score.\n``Chunk`` is intentionally not extended with a ``score`` field so\nits semantics stay stable; instead the score lives in this\nwrapper whose only purpose is \"I am a query hit.\""}}}}