mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
refactor(automations): vertical-slice actions and triggers by domain
This commit is contained in:
parent
ce45e11009
commit
8c32455818
24 changed files with 86 additions and 108 deletions
|
|
@ -1,8 +1,13 @@
|
|||
"""Schemas for the automation definition and per-type configs."""
|
||||
"""Schemas for the automation definition envelope.
|
||||
|
||||
Per-action and per-trigger params schemas live with the action/trigger
|
||||
implementations (``app.automations.actions.<name>.params`` /
|
||||
``app.automations.triggers.<name>.params``); only the cross-cutting envelope
|
||||
lives here.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .actions import AgentTaskActionParams
|
||||
from .definition import (
|
||||
AutomationDefinition,
|
||||
Execution,
|
||||
|
|
@ -11,16 +16,12 @@ from .definition import (
|
|||
PlanStep,
|
||||
TriggerSpec,
|
||||
)
|
||||
from .triggers import ManualTriggerParams, ScheduleTriggerParams
|
||||
|
||||
__all__ = [
|
||||
"AgentTaskActionParams",
|
||||
"AutomationDefinition",
|
||||
"Execution",
|
||||
"Inputs",
|
||||
"ManualTriggerParams",
|
||||
"Metadata",
|
||||
"PlanStep",
|
||||
"ScheduleTriggerParams",
|
||||
"TriggerSpec",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
"""Per-action params schemas, one per action type."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .agent_task import AgentTaskActionParams
|
||||
|
||||
__all__ = [
|
||||
"AgentTaskActionParams",
|
||||
]
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
"""``AgentTaskActionParams`` — params for the ``agent_task`` action type."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class AgentTaskActionParams(BaseModel):
|
||||
"""Run a multi_agent_chat turn from an automation step."""
|
||||
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
query: str = Field(
|
||||
...,
|
||||
min_length=1,
|
||||
description="User query for the agent; rendered at execute time.",
|
||||
)
|
||||
auto_approve_all: bool = Field(
|
||||
default=False,
|
||||
description="If true, every HITL approval is auto-approved; otherwise rejected.",
|
||||
)
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
"""Per-trigger params schemas, one per trigger type."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .manual import ManualTriggerParams
|
||||
from .schedule import ScheduleTriggerParams
|
||||
|
||||
__all__ = [
|
||||
"ManualTriggerParams",
|
||||
"ScheduleTriggerParams",
|
||||
]
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
"""``ManualTriggerParams`` — params for the ``manual`` trigger (empty in v1)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class ManualTriggerParams(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
"""``ScheduleTriggerParams`` — params for the ``schedule`` trigger type."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class ScheduleTriggerParams(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
cron: str = Field(..., description="Five-field cron expression.", examples=["0 9 * * 1-5"])
|
||||
timezone: str = Field(..., description="IANA timezone.", examples=["Africa/Kigali"])
|
||||
Loading…
Add table
Add a link
Reference in a new issue