mud_server.api.models_admin =========================== .. py:module:: mud_server.api.models_admin .. autoapi-nested-parse:: Admin and operations Pydantic models for the API layer. Classes ------- .. autoapisummary:: mud_server.api.models_admin.UserManagementRequest mud_server.api.models_admin.CreateUserRequest mud_server.api.models_admin.CreateCharacterRequest mud_server.api.models_admin.ManageCharacterRequest mud_server.api.models_admin.ServerStopRequest mud_server.api.models_admin.ChatPruneRequest mud_server.api.models_admin.ChatPruneResponse mud_server.api.models_admin.CreateUserResponse mud_server.api.models_admin.CreateCharacterResponse mud_server.api.models_admin.ManageCharacterResponse mud_server.api.models_admin.UserListResponse mud_server.api.models_admin.DatabasePlayersResponse mud_server.api.models_admin.DatabaseTableInfo mud_server.api.models_admin.DatabaseTablesResponse mud_server.api.models_admin.DatabaseSchemaForeignKey mud_server.api.models_admin.DatabaseSchemaTable mud_server.api.models_admin.DatabaseSchemaResponse mud_server.api.models_admin.DatabaseTableRowsResponse mud_server.api.models_admin.DatabasePlayerLocationsResponse mud_server.api.models_admin.DatabaseConnectionsResponse mud_server.api.models_admin.WorldActiveCharacterSession mud_server.api.models_admin.DatabaseWorldStatusRow mud_server.api.models_admin.DatabaseWorldStatusResponse mud_server.api.models_admin.KickSessionRequest mud_server.api.models_admin.KickCharacterRequest mud_server.api.models_admin.KickSessionResponse mud_server.api.models_admin.KickCharacterResponse mud_server.api.models_admin.DatabaseSessionsResponse mud_server.api.models_admin.DatabaseChatResponse mud_server.api.models_admin.CharacterAxisScore mud_server.api.models_admin.DatabaseCharacterAxisStateResponse mud_server.api.models_admin.CharacterAxisDelta mud_server.api.models_admin.CharacterAxisEvent mud_server.api.models_admin.DatabaseCharacterAxisEventsResponse mud_server.api.models_admin.UserManagementResponse mud_server.api.models_admin.ServerStopResponse mud_server.api.models_admin.OllamaCommandRequest mud_server.api.models_admin.OllamaCommandResponse mud_server.api.models_admin.ClearOllamaContextRequest mud_server.api.models_admin.ClearOllamaContextResponse Module Contents --------------- .. py:class:: UserManagementRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to manage user accounts. Requires admin or superuser permissions. Allows role changes, banning, unbanning, and password changes of user accounts. Superusers can manage all users, admins can only manage users with lower permissions. .. attribute:: session_id Active session ID (must have appropriate permission) .. attribute:: target_username Username of the account to manage .. attribute:: action Management action - one of: - "change_role": Change user's role (requires new_role parameter) - "ban" or "deactivate": Deactivate user account (prevents login, removes active session) - "delete": Permanently delete user and related data (superuser only) - "unban": Reactivate previously banned account - "change_password": Change user's password (requires new_password parameter) .. attribute:: new_role (Optional) New role when action is "change_role" Valid roles: "player", "worldbuilder", "admin", "superuser" .. attribute:: new_password (Optional) New password when action is "change_password" Must be at least 8 characters Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: target_username :type: str .. py:attribute:: action :type: str .. py:attribute:: new_role :type: str | None :value: None .. py:attribute:: new_password :type: str | None :value: None .. py:class:: CreateUserRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to create a new user account. Requires admin or superuser permissions. Admins may create Player or WorldBuilder accounts. Superusers may create any role, including Admin and Superuser. Passwords must meet the STANDARD password policy, and password_confirm must match password. .. attribute:: session_id Active session ID (must have appropriate permission) .. attribute:: username Desired username (2-20 characters, must be unique) .. attribute:: password Desired password (must meet STANDARD policy) .. attribute:: password_confirm Password confirmation (must match password) .. attribute:: role Role to assign to the new account Valid roles: "player", "worldbuilder", "admin", "superuser" Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: username :type: str .. py:attribute:: password :type: str .. py:attribute:: password_confirm :type: str .. py:attribute:: role :type: str .. py:class:: CreateCharacterRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to provision a new character for an existing account. This endpoint is intended for operational tooling in the Web Admin UI: it mints a name through the name-generation integration, creates the character row, then applies an entity-state seed event. .. attribute:: session_id Active admin/superuser session id. .. attribute:: target_username Username that will own the new character. .. attribute:: world_id Target world id for the new character. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: target_username :type: str .. py:attribute:: world_id :type: str .. py:class:: ManageCharacterRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Superuser request to remove a character from an account. This operation is intentionally restricted to superusers because it can either soft-remove a character (tombstone) or permanently delete it. .. attribute:: session_id Active superuser session id. .. attribute:: character_id Character id to mutate. .. attribute:: action Removal mode: - "tombstone": Keep historical rows, detach ownership, rename. - "delete": Hard-delete the character row and dependent records. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: character_id :type: int .. py:attribute:: action :type: str .. py:class:: ServerStopRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to stop the server gracefully. Requires STOP_SERVER permission (admin or superuser only). Server will shutdown 0.5 seconds after sending response to allow the HTTP response to be delivered. .. attribute:: session_id Active session ID (must have STOP_SERVER permission) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:class:: ChatPruneRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to prune old chat messages. .. attribute:: session_id Active admin/superuser session id. .. attribute:: max_age_hours Delete messages older than this many hours. Min: 1. .. attribute:: world_id If provided, restrict pruning to this world. .. attribute:: room If provided (requires world_id), restrict to a single room. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: max_age_hours :type: int .. py:attribute:: world_id :type: str | None :value: None .. py:attribute:: room :type: str | None :value: None .. py:class:: ChatPruneResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to chat prune request. .. attribute:: success True if pruning completed without error. .. attribute:: message Human-readable result. .. attribute:: pruned_count Number of rows deleted. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: pruned_count :type: int .. py:class:: CreateUserResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to admin user creation request. .. attribute:: success True if account created, False otherwise .. attribute:: message Success confirmation or error details Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: CreateCharacterResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to admin character provisioning. .. attribute:: success True when character creation succeeded. .. attribute:: message Human-readable status message. .. attribute:: character_id Newly created character id. .. attribute:: character_name Generated character name. .. attribute:: world_id World id assigned to the character. .. attribute:: seed Deterministic seed used for name/entity generation. .. attribute:: entity_state Optional entity payload returned by the entity API. .. attribute:: entity_state_error Optional integration error when entity seeding fails. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: character_id :type: int | None :value: None .. py:attribute:: character_name :type: str | None :value: None .. py:attribute:: world_id :type: str | None :value: None .. py:attribute:: seed :type: int | None :value: None .. py:attribute:: entity_state :type: dict[str, Any] | None :value: None .. py:attribute:: entity_state_error :type: str | None :value: None .. py:class:: ManageCharacterResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to a superuser character management operation. .. attribute:: success True when the requested operation completed. .. attribute:: message Human-readable operation result. .. attribute:: character_id Character id that was targeted. .. attribute:: action Normalized action string that was executed. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: character_id :type: int .. py:attribute:: action :type: str .. py:class:: UserListResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response containing list of user accounts. Used for admin user management interfaces. .. attribute:: users List of user data dictionaries with account information Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: users :type: list[dict[str, Any]] .. py:class:: DatabasePlayersResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing non-tombstoned user records for Active Users views. Requires VIEW_LOGS permission. Includes account details and character counts for currently manageable accounts. Tombstoned/deleted (archival) accounts are intentionally excluded from this response contract. .. attribute:: players List of user data dictionaries with fields: - id: Database record ID - username: Account username - password_hash: Truncated password hash (first 20 chars + "...") - role: User role - account_origin: Account provenance ("visitor", "admin", "superuser", "system", "legacy") - is_guest: Guest flag - guest_expires_at: Guest expiry timestamp - character_count: Number of linked characters - is_online_account: True if any active session exists - is_online_in_world: True if any active session has a character - online_world_ids: Active world ids for character-bound sessions - created_at: Account creation timestamp - last_login: Last login timestamp - is_active: Account status (True=active, False=banned) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: players :type: list[dict[str, Any]] .. py:class:: DatabaseTableInfo(/, **data) Bases: :py:obj:`pydantic.BaseModel` Metadata about a single database table. .. attribute:: name Table name. .. attribute:: columns List of column names in order. .. attribute:: row_count Number of rows in the table. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: name :type: str .. py:attribute:: columns :type: list[str] .. py:attribute:: row_count :type: int .. py:class:: DatabaseTablesResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing database table metadata. Requires VIEW_LOGS permission. Used for table discovery in the admin UI. .. attribute:: tables List of DatabaseTableInfo entries. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: tables :type: list[DatabaseTableInfo] .. py:class:: DatabaseSchemaForeignKey(/, **data) Bases: :py:obj:`pydantic.BaseModel` Foreign key metadata for a database table relationship. .. attribute:: from_column Column on the source table. .. attribute:: ref_table Referenced table name. .. attribute:: ref_column Referenced column name. .. attribute:: on_update SQLite ON UPDATE action. .. attribute:: on_delete SQLite ON DELETE action. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: from_column :type: str .. py:attribute:: ref_table :type: str .. py:attribute:: ref_column :type: str .. py:attribute:: on_update :type: str .. py:attribute:: on_delete :type: str .. py:class:: DatabaseSchemaTable(/, **data) Bases: :py:obj:`pydantic.BaseModel` Schema metadata for a database table. .. attribute:: name Table name. .. attribute:: columns Column names in order. .. attribute:: foreign_keys Foreign key relationships. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: name :type: str .. py:attribute:: columns :type: list[str] .. py:attribute:: foreign_keys :type: list[DatabaseSchemaForeignKey] .. py:class:: DatabaseSchemaResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing database schema relationships. Requires VIEW_LOGS permission. Used for schema map displays. .. attribute:: tables Schema metadata for all tables. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: tables :type: list[DatabaseSchemaTable] .. py:class:: DatabaseTableRowsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing rows for a specific database table. Requires VIEW_LOGS permission. Includes column names and raw row values. .. attribute:: table Table name. .. attribute:: columns Column names in order. .. attribute:: rows Row values as a list of rows (each row is a list of values). Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: table :type: str .. py:attribute:: columns :type: list[str] .. py:attribute:: rows :type: list[list[Any]] .. py:class:: DatabasePlayerLocationsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing character locations with names. Requires VIEW_LOGS permission. Useful for cross-referencing room occupancy. .. attribute:: locations List of dicts with fields: - character_id - character_name - zone_id - room_id - updated_at Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: locations :type: list[dict[str, Any]] .. py:class:: DatabaseConnectionsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing active session connections. Requires VIEW_LOGS permission. Includes activity age for dashboards. .. attribute:: connections List of session dictionaries with fields: - id - username - session_id - created_at - last_activity - expires_at - client_type - age_seconds Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: connections :type: list[dict[str, Any]] .. py:class:: WorldActiveCharacterSession(/, **data) Bases: :py:obj:`pydantic.BaseModel` Active in-world character session row for world operations. .. attribute:: character_id Character identifier bound to the session. .. attribute:: character_name Character display name. .. attribute:: username Owning account username (if resolvable). .. attribute:: session_id Active session identifier for this character session. .. attribute:: last_activity Timestamp of most recent activity. .. attribute:: client_type Client source for the session (browser/tui/api/etc.). Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: character_id :type: int .. py:attribute:: character_name :type: str .. py:attribute:: username :type: str | None :value: None .. py:attribute:: session_id :type: str .. py:attribute:: last_activity :type: str | None :value: None .. py:attribute:: client_type :type: str :value: 'unknown' .. py:class:: DatabaseWorldStatusRow(/, **data) Bases: :py:obj:`pydantic.BaseModel` World operations row for admin and superuser inspection. .. attribute:: world_id World identifier. .. attribute:: name Human-readable world name. .. attribute:: description World description text. .. attribute:: is_active Catalog activation flag from worlds table. .. attribute:: is_online True when one or more in-world character sessions are active. .. attribute:: active_session_count Number of active sessions scoped to this world. .. attribute:: active_character_count Number of unique active characters in this world. .. attribute:: last_activity Most recent session activity timestamp in this world. .. attribute:: active_characters Kickable active character-session rows. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: world_id :type: str .. py:attribute:: name :type: str .. py:attribute:: description :type: str .. py:attribute:: is_active :type: bool .. py:attribute:: is_online :type: bool .. py:attribute:: active_session_count :type: int .. py:attribute:: active_character_count :type: int .. py:attribute:: last_activity :type: str | None :value: None .. py:attribute:: active_characters :type: list[WorldActiveCharacterSession] .. py:class:: DatabaseWorldStatusResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing world operations rows. Requires VIEW_LOGS permission. .. attribute:: worlds World operations rows. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: worlds :type: list[DatabaseWorldStatusRow] .. py:class:: KickSessionRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to force-disconnect a session. Requires KICK_USERS permission. .. attribute:: session_id Admin's active session id. .. attribute:: target_session_id Session id to disconnect. .. attribute:: reason Optional reason for audit/logging. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: target_session_id :type: str .. py:attribute:: reason :type: str | None :value: None .. py:class:: KickCharacterRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to disconnect all sessions bound to a character. Requires KICK_USERS permission. .. attribute:: session_id Admin/superuser session id. .. attribute:: character_id Target character id to disconnect. .. attribute:: reason Optional moderation reason for logging/audit. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: character_id :type: int .. py:attribute:: reason :type: str | None :value: None .. py:class:: KickSessionResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response for a kick session request. .. attribute:: success True if session was removed. .. attribute:: message Human-readable result. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: KickCharacterResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response for a character kick operation. .. attribute:: success True if at least one session was removed. .. attribute:: message Human-readable operation result. .. attribute:: removed_sessions Number of removed sessions. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: removed_sessions :type: int .. py:class:: DatabaseSessionsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing all active sessions from database. Requires VIEW_LOGS permission. Shows who is currently logged in. .. attribute:: sessions List of session data dictionaries with fields: - id: Database record ID - username: Logged in account - character_name: Active character for the session (if selected) - session_id: UUID session identifier - created_at: Login timestamp - last_activity: Most recent API request timestamp - expires_at: Session expiry timestamp (NULL means no expiry) - client_type: Client identifier (tui, browser, api) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: sessions :type: list[dict[str, Any]] .. py:class:: DatabaseChatResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing recent chat messages across all rooms. Requires VIEW_LOGS permission. Useful for moderation and monitoring. .. attribute:: messages List of chat message dictionaries with fields: - id: Database record ID - username: Message sender - message: Message text (includes [WHISPER], [YELL] prefixes) - world_id: World the message was sent in - room_id: Room ID where message was sent - timestamp: Message timestamp Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: messages :type: list[dict[str, Any]] .. py:class:: CharacterAxisScore(/, **data) Bases: :py:obj:`pydantic.BaseModel` Axis score entry for a character. .. attribute:: axis_id Axis registry id. .. attribute:: axis_name Axis name from policy. .. attribute:: axis_score Numeric score for the axis. .. attribute:: axis_label Resolved label from thresholds (if available). Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: axis_id :type: int .. py:attribute:: axis_name :type: str .. py:attribute:: axis_score :type: float .. py:attribute:: axis_label :type: str | None .. py:class:: DatabaseCharacterAxisStateResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing character axis state and snapshot payloads. .. attribute:: character_id Character id. .. attribute:: world_id World identifier. .. attribute:: state_seed Snapshot seed counter. .. attribute:: state_version Policy hash associated with the snapshot. .. attribute:: state_updated_at Timestamp of the snapshot refresh. .. attribute:: base_state Parsed base snapshot JSON. .. attribute:: current_state Parsed current snapshot JSON. .. attribute:: axes Axis score entries. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: character_id :type: int .. py:attribute:: world_id :type: str .. py:attribute:: state_seed :type: int | None .. py:attribute:: state_version :type: str | None .. py:attribute:: state_updated_at :type: str | None .. py:attribute:: base_state :type: dict[str, Any] | None .. py:attribute:: current_state :type: dict[str, Any] | None .. py:attribute:: axes :type: list[CharacterAxisScore] .. py:class:: CharacterAxisDelta(/, **data) Bases: :py:obj:`pydantic.BaseModel` Axis delta entry for an event. .. attribute:: axis_name Axis name. .. attribute:: old_score Score before applying delta. .. attribute:: new_score Score after applying delta. .. attribute:: delta Applied delta value. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: axis_name :type: str .. py:attribute:: old_score :type: float .. py:attribute:: new_score :type: float .. py:attribute:: delta :type: float .. py:class:: CharacterAxisEvent(/, **data) Bases: :py:obj:`pydantic.BaseModel` Axis event entry with deltas and metadata. .. attribute:: event_id Event identifier. .. attribute:: world_id World identifier for the event. .. attribute:: event_type Event type name. .. attribute:: event_type_description Optional event type description. .. attribute:: timestamp Event timestamp. .. attribute:: metadata Key/value metadata entries. .. attribute:: deltas Axis delta entries. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: event_id :type: int .. py:attribute:: world_id :type: str .. py:attribute:: event_type :type: str .. py:attribute:: event_type_description :type: str | None .. py:attribute:: timestamp :type: str | None .. py:attribute:: metadata :type: dict[str, str] .. py:attribute:: deltas :type: list[CharacterAxisDelta] .. py:class:: DatabaseCharacterAxisEventsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing axis events for a character. .. attribute:: character_id Character id. .. attribute:: events Event entries. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: character_id :type: int .. py:attribute:: events :type: list[CharacterAxisEvent] .. py:class:: UserManagementResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to user management action (role change, ban, unban). .. attribute:: success True if action completed successfully .. attribute:: message Confirmation message or error details Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: ServerStopResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to server stop request. Server will shutdown shortly after sending this response. .. attribute:: success True if shutdown initiated .. attribute:: message Confirmation message indicating who initiated shutdown Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: OllamaCommandRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to execute an Ollama command. Requires VIEW_LOGS permission (admin or superuser only). .. attribute:: session_id Active session ID (must have appropriate permission) .. attribute:: server_url URL of the Ollama server (e.g., "http://localhost:11434") .. attribute:: command Ollama command to execute (e.g., "list", "ps", "run llama2") Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: server_url :type: str .. py:attribute:: command :type: str .. py:class:: OllamaCommandResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to Ollama command execution. .. attribute:: success True if command executed successfully .. attribute:: output Command output or error message Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: output :type: str .. py:class:: ClearOllamaContextRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to clear Ollama conversation context for the current session. Requires VIEW_LOGS permission (admin or superuser only). .. attribute:: session_id Active session ID (must have appropriate permission) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:class:: ClearOllamaContextResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to clear Ollama context request. .. attribute:: success True if context was cleared successfully .. attribute:: message Confirmation message Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str