[feat] Regenerate data models with enhanced ComfyUISystemState

- Add SecurityLevel and RiskLevel enums to generated models
- Enhance ComfyUISystemState with additional system information fields:
  - comfyui_root_path: ComfyUI installation directory
  - model_paths: Map of model types to configured paths
  - manager_version: ComfyUI Manager version
  - security_level: Current security configuration
  - network_mode: Network mode (online/offline/private)
  - cli_args: Selected CLI arguments
  - custom_nodes_count: Total number of custom nodes
  - failed_imports: List of failed imports
  - pip_packages: Installed pip packages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
bymyself 2025-06-17 13:06:14 -07:00
parent f450dcbb57
commit 350cb767c3
2 changed files with 63 additions and 63 deletions

View File

@ -59,6 +59,8 @@ from .generated_models import (
HistoryResponse, HistoryResponse,
HistoryListResponse, HistoryListResponse,
InstallType, InstallType,
SecurityLevel,
RiskLevel,
) )
__all__ = [ __all__ = [
@ -112,4 +114,6 @@ __all__ = [
"HistoryResponse", "HistoryResponse",
"HistoryListResponse", "HistoryListResponse",
"InstallType", "InstallType",
"SecurityLevel",
"RiskLevel",
] ]

View File

@ -1,6 +1,6 @@
# generated by datamodel-codegen: # generated by datamodel-codegen:
# filename: openapi.yaml # filename: openapi.yaml
# timestamp: 2025-06-17T17:32:47+00:00 # timestamp: 2025-06-17T19:50:44+00:00
from __future__ import annotations from __future__ import annotations
@ -8,14 +8,10 @@ from datetime import datetime
from enum import Enum from enum import Enum
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, Field from pydantic import BaseModel, Field, RootModel, conint
class OperationType(Enum): class OperationType(Enum):
"""
Type of operation or task being performed
"""
install = 'install' install = 'install'
uninstall = 'uninstall' uninstall = 'uninstall'
update = 'update' update = 'update'
@ -28,10 +24,6 @@ class OperationType(Enum):
class OperationResult(Enum): class OperationResult(Enum):
"""
Result status of an operation (failed/error and skipped/skip are aliases)
"""
success = 'success' success = 'success'
failed = 'failed' failed = 'failed'
skipped = 'skipped' skipped = 'skipped'
@ -46,10 +38,6 @@ class TaskExecutionStatus(BaseModel):
class ManagerMessageName(Enum): class ManagerMessageName(Enum):
"""
WebSocket message type constants for manager events
"""
cm_task_completed = 'cm-task-completed' cm_task_completed = 'cm-task-completed'
cm_task_started = 'cm-task-started' cm_task_started = 'cm-task-started'
cm_queue_status = 'cm-queue-status' cm_queue_status = 'cm-queue-status'
@ -80,19 +68,11 @@ class ManagerPackInstalled(BaseModel):
class SelectedVersion(Enum): class SelectedVersion(Enum):
"""
Version selection for pack installation
"""
latest = 'latest' latest = 'latest'
nightly = 'nightly' nightly = 'nightly'
class ManagerChannel(Enum): class ManagerChannel(Enum):
"""
Channel for pack sources
"""
default = 'default' default = 'default'
recent = 'recent' recent = 'recent'
legacy = 'legacy' legacy = 'legacy'
@ -102,20 +82,12 @@ class ManagerChannel(Enum):
class ManagerDatabaseSource(Enum): class ManagerDatabaseSource(Enum):
"""
Source for pack information
"""
remote = 'remote' remote = 'remote'
local = 'local' local = 'local'
cache = 'cache' cache = 'cache'
class ManagerPackState(Enum): class ManagerPackState(Enum):
"""
Current state of a pack
"""
installed = 'installed' installed = 'installed'
disabled = 'disabled' disabled = 'disabled'
not_installed = 'not_installed' not_installed = 'not_installed'
@ -124,20 +96,25 @@ class ManagerPackState(Enum):
class ManagerPackInstallType(Enum): class ManagerPackInstallType(Enum):
"""
Type of installation used for the pack
"""
git_clone = 'git-clone' git_clone = 'git-clone'
copy = 'copy' copy = 'copy'
cnr = 'cnr' cnr = 'cnr'
class UpdateState(Enum): class SecurityLevel(Enum):
""" strong = 'strong'
Update availability status normal = 'normal'
""" normal_ = 'normal-'
weak = 'weak'
class RiskLevel(Enum):
block = 'block'
high = 'high'
middle = 'middle'
class UpdateState(Enum):
false = 'false' false = 'false'
true = 'true' true = 'true'
@ -251,8 +228,10 @@ class ManagerMappings1(BaseModel):
title_aux: Optional[str] = Field(None, description='The display name of the pack') title_aux: Optional[str] = Field(None, description='The display name of the pack')
class ManagerMappings(BaseModel): class ManagerMappings(
__root__: Optional[Dict[str, List[Union[List[str], ManagerMappings1]]]] = Field( RootModel[Optional[Dict[str, List[Union[List[str], ManagerMappings1]]]]]
):
root: Optional[Dict[str, List[Union[List[str], ManagerMappings1]]]] = Field(
None, description='Tuple of [node_names, metadata]' None, description='Tuple of [node_names, metadata]'
) )
@ -268,10 +247,6 @@ class ModelMetadata(BaseModel):
class InstallType(Enum): class InstallType(Enum):
"""
Installation method
"""
git = 'git' git = 'git'
copy = 'copy' copy = 'copy'
pip = 'pip' pip = 'pip'
@ -294,20 +269,16 @@ class NodePackageMetadata(BaseModel):
mode: Optional[str] = Field(None, description='Source mode') mode: Optional[str] = Field(None, description='Source mode')
class SnapshotItem(BaseModel): class SnapshotItem(RootModel[str]):
__root__: str = Field(..., description='Name of the snapshot') root: str = Field(..., description='Name of the snapshot')
class Error(BaseModel): class Error(BaseModel):
error: str = Field(..., description='Error message') error: str = Field(..., description='Error message')
class InstalledPacksResponse(BaseModel): class InstalledPacksResponse(RootModel[Optional[Dict[str, ManagerPackInstalled]]]):
""" root: Optional[Dict[str, ManagerPackInstalled]] = None
Map of pack names to their installation info
"""
__root__: Optional[Dict[str, ManagerPackInstalled]] = None
class HistoryListResponse(BaseModel): class HistoryListResponse(BaseModel):
@ -335,7 +306,7 @@ class InstalledModelInfo(BaseModel):
name: str = Field(..., description='Model filename') name: str = Field(..., description='Model filename')
path: str = Field(..., description='Full path to model file') path: str = Field(..., description='Full path to model file')
type: str = Field(..., description='Model type (checkpoint, lora, vae, etc.)') type: str = Field(..., description='Model type (checkpoint, lora, vae, etc.)')
size_bytes: Optional[int] = Field(None, description='File size in bytes', ge=0) size_bytes: Optional[conint(ge=0)] = Field(None, description='File size in bytes')
hash: Optional[str] = Field(None, description='Model file hash for verification') hash: Optional[str] = Field(None, description='Model file hash for verification')
install_date: Optional[datetime] = Field( install_date: Optional[datetime] = Field(
None, description='ISO timestamp when added' None, description='ISO timestamp when added'
@ -399,6 +370,29 @@ class ComfyUISystemState(BaseModel):
manager_config: Optional[Dict[str, Any]] = Field( manager_config: Optional[Dict[str, Any]] = Field(
None, description='ComfyUI Manager configuration settings' None, description='ComfyUI Manager configuration settings'
) )
comfyui_root_path: Optional[str] = Field(
None, description='ComfyUI root installation directory'
)
model_paths: Optional[Dict[str, List[str]]] = Field(
None, description='Map of model types to their configured paths'
)
manager_version: Optional[str] = Field(None, description='ComfyUI Manager version')
security_level: Optional[SecurityLevel] = None
network_mode: Optional[str] = Field(
None, description='Network mode (online, offline, private)'
)
cli_args: Optional[Dict[str, Any]] = Field(
None, description='Selected ComfyUI CLI arguments'
)
custom_nodes_count: Optional[conint(ge=0)] = Field(
None, description='Total number of custom node packages'
)
failed_imports: Optional[List[str]] = Field(
None, description='List of custom nodes that failed to import'
)
pip_packages: Optional[Dict[str, str]] = Field(
None, description='Map of installed pip packages to their versions'
)
class BatchExecutionRecord(BaseModel): class BatchExecutionRecord(BaseModel):
@ -414,17 +408,17 @@ class BatchExecutionRecord(BaseModel):
operations: Optional[List[BatchOperation]] = Field( operations: Optional[List[BatchOperation]] = Field(
None, description='List of operations performed in this batch' None, description='List of operations performed in this batch'
) )
total_operations: Optional[int] = Field( total_operations: Optional[conint(ge=0)] = Field(
0, description='Total number of operations in batch', ge=0 0, description='Total number of operations in batch'
) )
successful_operations: Optional[int] = Field( successful_operations: Optional[conint(ge=0)] = Field(
0, description='Number of successful operations', ge=0 0, description='Number of successful operations'
) )
failed_operations: Optional[int] = Field( failed_operations: Optional[conint(ge=0)] = Field(
0, description='Number of failed operations', ge=0 0, description='Number of failed operations'
) )
skipped_operations: Optional[int] = Field( skipped_operations: Optional[conint(ge=0)] = Field(
0, description='Number of skipped operations', ge=0 0, description='Number of skipped operations'
) )
@ -493,8 +487,10 @@ class MessageTaskFailed(BaseModel):
state: TaskStateMessage state: TaskStateMessage
class MessageUpdate(BaseModel): class MessageUpdate(
__root__: Union[MessageTaskDone, MessageTaskStarted, MessageTaskFailed] = Field( RootModel[Union[MessageTaskDone, MessageTaskStarted, MessageTaskFailed]]
):
root: Union[MessageTaskDone, MessageTaskStarted, MessageTaskFailed] = Field(
..., description='Union type for all possible WebSocket message updates' ..., description='Union type for all possible WebSocket message updates'
) )