refactor: rename new runtime as sandbox feature

This commit is contained in:
Harry
2026-01-12 01:53:39 +08:00
parent 3d2840edb6
commit 9dd0361d0e
13 changed files with 47 additions and 18 deletions
+4 -1
View File
@@ -37,13 +37,13 @@ from extensions.ext_storage import Storage
from factories.variable_factory import TypeMismatchError, build_segment_with_type
from libs.datetime_utils import naive_utc_now
from libs.uuid_utils import uuidv7
from models.workflow_features import WorkflowFeature, WorkflowFeatures
from ._workflow_exc import NodeNotFoundError, WorkflowDataError
if TYPE_CHECKING:
from .model import AppMode, UploadFile
from constants import DEFAULT_FILE_NUMBER_LIMITS, HIDDEN_VALUE
from core.helper import encrypter
from core.variables import SecretVariable, Segment, SegmentType, Variable
@@ -345,6 +345,9 @@ class Workflow(Base): # bug
def features_dict(self) -> dict[str, Any]:
return json.loads(self.features) if self.features else {}
def get_feature(self, key: WorkflowFeatures) -> WorkflowFeature:
return WorkflowFeature.from_dict(self.features_dict.get(key.value))
def walk_nodes(
self, specific_node_type: NodeType | None = None
) -> Generator[tuple[str, Mapping[str, Any]], None, None]: