Files
ai-agent/backend/schemas/__init__.py

494 lines
10 KiB
Python

"""Pydantic response models — the OpenAPI schema for the read endpoints.
These are **documentation-only**: they are attached to the routes via
``responses={200: {"model": …}}`` (see ``main.py``), never as ``response_model``.
FastAPI therefore serves them in ``/openapi.json`` but does **not** validate or
filter the actual returned dicts through them — so a model that drifts from the
real payload can only produce a wrong TypeScript type (caught by ``tsc``), never
a silent runtime regression.
They mirror ``frontend/src/types.ts`` field-for-field; fields are intentionally
**camelCase** (matching the JSON the handlers already emit) so Orval generates
property names identical to the hand-written types they replace. Class names
match the TS interface names so the generated model names line up 1:1.
The package has one module per section of the API (``conversations``,
``projects``, ``cron``, …); every model is re-exported here so handlers keep
writing ``schemas.ConversationDetail``.
"""
from .base import (
Schema,
AccountSplit,
)
from .usage import * # noqa: F401,F403
from .usage import __all__ as _usage_all
from .telemetry import * # noqa: F401,F403
from .telemetry import __all__ as _telemetry_all
from .plugin_commands import * # noqa: F401,F403
from .plugin_commands import __all__ as _plugin_commands_all
from .security import * # noqa: F401,F403
from .security import __all__ as _security_all
from .perf import * # noqa: F401,F403
from .perf import __all__ as _perf_all
from .perf_storage import * # noqa: F401,F403
from .perf_storage import __all__ as _perf_storage_all
from .guest_perf import * # noqa: F401,F403
from .guest_perf import __all__ as _guest_perf_all
from .mcp import * # noqa: F401,F403
from .mcp import __all__ as _mcp_all
from .tags import * # noqa: F401,F403
from .tags import __all__ as _tags_all
from .drafts import * # noqa: F401,F403
from .drafts import __all__ as _drafts_all
from .roles import * # noqa: F401,F403
from .roles import __all__ as _roles_all
from .users import (
GuestClaude,
IdpApp,
IdpStatus,
GuestIdp,
IdpSyncResult,
AuthMethods,
ComputerPolicy,
ComputerLimits,
Computer,
ComputersResponse,
ComputerEnroll,
ComputersWaiting,
TerminalSession,
TerminalSessions,
ProjectGrant,
NotifyPrefs,
PushDevice,
PushPref,
PushDevices,
PushSendResult,
PushTestResult,
Me,
GuestUser,
UsersResponse,
DaySpend,
ProjectSpend,
StatsPeriod,
StatsTotals,
StatsMonth,
StatsDay,
StatsCalendarDay,
StatsProject,
StatsModel,
StatsTokens,
StatsFootprint,
GuestStats,
UserConversation,
UserActivity,
LoginLink,
ShareCandidate,
AudienceMember,
CurvePoint,
AnimationCurve,
GuestDefaults,
GuestSkill,
GuestSkillsResponse,
ConversationShare,
NewProjectAccess,
DomainDns,
DomainStatus,
)
from .files import (
Pricing,
SkillStat,
DashboardTotals,
TopFile,
Dashboard,
)
from .skills import (
SkillCopy,
SkillSummary,
SkillsTotals,
SkillsResponse,
SkillPrompt,
)
from .conversations import (
FullText,
EffortUsage,
ModelUsage,
PlanPct,
ToolUsage,
ConvNotification,
WorktreeInfo,
ForkedFrom,
SpawnedBy,
AutoArchived,
SpawnedConvRef,
CronRef,
ScheduledRef,
AgentRunRef,
Resource,
PastConversationsResponse,
ConversationRefCard,
ConversationRefsResponse,
ConvLook,
LinearInfo,
ConvMeta,
ConvSummary,
Usage,
DeployCall,
SubagentFormRef,
SubagentRef,
StoppedOn,
SubagentListItem,
SubagentsResponse,
RunningAgent,
ParentConvRef,
Task,
ConversationSummary,
ThreadItem,
TurnAuthor,
TurnUsage,
ArtefactItem,
ConversationDetail,
ConversationsResponse,
)
from .notifications import (
NotifConversation,
NotificationsResponse,
FeedNotification,
UnreadNotificationsResponse,
NotifStateResponse,
NotifStateChange,
FreshContextSettings,
DeliveryStatus,
NotifyResult,
AskRecord,
NotifyLogEntry,
NotifyLogResponse,
)
from .askform import (
AskFormRecord,
AskFormsResponse,
)
from .search import (
SearchMsg,
SearchConv,
SearchIndexResponse,
)
from .projects import (
ProjectCostSummary,
TokenTypeSpend,
ProjectByType,
ProjectCostDetail,
GoalSummary,
GoalChecklistItem,
GoalClaim,
GoalDetail,
GoalMilestone,
GoalTheme,
RunningConversation,
GoalBoardEntry,
GoalsResponse,
ProjectSummary,
ProjectWorker,
IndexMeta,
OgImage,
KeyFile,
ProjectCommit,
ProjectDetail,
ProjectsResponse,
)
from .misc import (
GhLogin,
UiStateValue,
OkResponse,
ModelInfo,
ModelsResponse,
ModelPreset,
ModelPresetResponse,
PendingLogin,
LoginState,
UsageRead,
AccountStatus,
LoginCodeResult,
Account,
AccountsResponse,
AccountRunner,
AccountHealthConversation,
AccountHealth,
WorkerLoginHealth,
AccountsHealthResponse,
AccountCheckResult,
Profile,
ProfilesResponse,
Worker,
WorkerClaudeProxy,
WorkerOpencodeProxy,
WorkersResponse,
LabSyncItem,
RepoPlugin,
RepoPluginCell,
RepoPluginWorker,
RepoPluginsView,
WorkerLabSync,
OpenRouterModel,
OpenRouterModelsResponse,
SpawnResult,
CodeModeRunner,
CodeModeStatus,
InterruptResult,
UploadedFile,
UploadResult,
ConversationMetaResponse,
MetaUpdateResult,
ArchiveOldResult,
AutoArchiveItem,
AutoArchiveResult,
BannerStep,
BannerStatus,
HomeTile,
HomeTileDay,
HomeTilesResponse,
ServiceGoal,
ServiceIndexEntry,
ServicesIndexResponse,
AppLaunchModal,
AppLaunchResponse,
MachineAttention,
MachineAttentionItem,
MachinesWakeable,
MachineWakeResult,
WakeableMachine,
GenProgress,
GenProgressSnapshot,
)
from .diff import (
CommitRef,
ConversationCommits,
DiffLine,
DiffHunk,
FileDiff,
WorktreeRef,
DiffResult,
)
from .agents import (
AgentSummary,
AgentsTotals,
AgentsResponse,
AgentRun,
AgentDay,
AgentDetail,
ClaudeHookEntry,
ClaudeHooksResponse,
)
__all__ = [
"GuestClaude",
"ComputerPolicy",
"ComputerLimits",
"Computer",
"ComputersResponse",
"ComputerEnroll",
"ComputersWaiting",
"IdpApp",
"IdpStatus",
"GuestIdp",
"IdpSyncResult",
"AuthMethods",
"TerminalSession",
"TerminalSessions",
"Schema",
"AccountSplit",
"Pricing",
"SkillStat",
"DashboardTotals",
"TopFile",
"Dashboard",
"SkillCopy",
"SkillSummary",
"SkillsTotals",
"SkillsResponse",
"SkillPrompt",
"ToolUsage",
"ConvNotification",
"WorktreeInfo",
"ForkedFrom",
"SpawnedBy",
"AutoArchived",
"SpawnedConvRef",
"CronRef",
"ScheduledRef",
"AgentRunRef",
"ConvLook",
"LinearInfo",
"ConvMeta",
"ConvSummary",
"Usage",
"DeployCall",
"SubagentFormRef",
"SubagentRef",
"StoppedOn",
"SubagentListItem",
"SubagentsResponse",
"RunningAgent",
"ParentConvRef",
"Task",
"ConversationSummary",
"ThreadItem",
"FullText",
"TurnAuthor",
"ProjectGrant",
"NotifyPrefs",
"Me",
"GuestUser",
"UsersResponse",
"DaySpend",
"ProjectSpend",
"UserConversation",
"UserActivity",
"LoginLink",
"ShareCandidate",
"AudienceMember",
"ConversationShare",
"NewProjectAccess",
"DomainDns",
"DomainStatus",
"CurvePoint",
"AnimationCurve",
"GuestDefaults",
"GuestSkill",
"GuestSkillsResponse",
"TurnUsage",
"ArtefactItem",
"ConversationDetail",
"ConversationsResponse",
"NotifConversation",
"NotificationsResponse",
"FeedNotification",
"UnreadNotificationsResponse",
"NotifStateResponse",
"NotifStateChange",
"FreshContextSettings",
"DeliveryStatus",
"NotifyResult",
"AskRecord",
"NotifyLogEntry",
"NotifyLogResponse",
"AskFormRecord",
"AskFormsResponse",
"SearchMsg",
"SearchConv",
"SearchIndexResponse",
"ProjectCostSummary",
"TokenTypeSpend",
"ProjectByType",
"ProjectCostDetail",
"GoalSummary",
"GoalChecklistItem",
"GoalClaim",
"GoalDetail",
"GoalMilestone",
"GoalTheme",
"RunningConversation",
"GoalBoardEntry",
"GoalsResponse",
"ProjectSummary",
"ProjectWorker",
"IndexMeta",
"OgImage",
"KeyFile",
"ProjectCommit",
"ProjectDetail",
"ProjectsResponse",
"ServiceSummary",
"ServiceDetail",
"ServicesResponse",
"UiStateValue",
"OkResponse",
"ModelInfo",
"ModelsResponse",
"ModelPreset",
"ModelPresetResponse",
"PendingLogin",
"GhLogin",
"LoginState",
"UsageRead",
"AccountStatus",
"LoginCodeResult",
"Account",
"AccountsResponse",
"AccountRunner",
"AccountHealthConversation",
"AccountHealth",
"WorkerLoginHealth",
"AccountsHealthResponse",
"AccountCheckResult",
"Profile",
"ProfilesResponse",
"Worker",
"WorkerClaudeProxy",
"WorkerOpencodeProxy",
"WorkersResponse",
"LabSyncItem",
"RepoPlugin",
"RepoPluginCell",
"RepoPluginWorker",
"RepoPluginsView",
"WorkerLabSync",
"OpenRouterModel",
"OpenRouterModelsResponse",
"SpawnResult",
"CodeModeRunner",
"CodeModeStatus",
"InterruptResult",
"UploadedFile",
"UploadResult",
"ConversationMetaResponse",
"MetaUpdateResult",
"ArchiveOldResult",
"AutoArchiveItem",
"AutoArchiveResult",
"BannerStep",
"BannerStatus",
"HomeTile",
"HomeTileDay",
"HomeTilesResponse",
"ServiceGoal",
"ServiceIndexEntry",
"ServicesIndexResponse",
"AppLaunchModal",
"AppLaunchResponse",
"MachineAttention",
"MachineAttentionItem",
"MachinesWakeable",
"MachineWakeResult",
"WakeableMachine",
"CommitRef",
"ConversationCommits",
"DiffLine",
"DiffHunk",
"FileDiff",
"WorktreeRef",
"DiffResult",
"AgentSummary",
"AgentsTotals",
"AgentsResponse",
"AgentRun",
"AgentDay",
"AgentDetail",
"ClaudeHookEntry",
"ClaudeHooksResponse",
"EffortUsage",
"ModelUsage",
"PlanPct",
"Resource",
*_usage_all,
*_perf_all,
*_perf_storage_all,
*_guest_perf_all,
*_security_all,
*_mcp_all,
*_tags_all,
*_drafts_all,
*_roles_all,
*_telemetry_all,
*_plugin_commands_all,
]