Index
operators
¶
Operators — persistent, scheduled autonomous agents.
Classes¶
OperatorManager
¶
Manages operator manifests and their lifecycle via the TaskScheduler.
| PARAMETER | DESCRIPTION |
|---|---|
system
|
A
TYPE:
|
Source code in src/diapason/operators/manager.py
Attributes¶
Methods:¶
register
¶
register(manifest: OperatorManifest) -> None
discover
¶
discover(directory: str | Path) -> List[OperatorManifest]
Discover and register operator manifests from a directory.
Scans for *.toml files in directory and loads each as an
operator manifest.
Source code in src/diapason/operators/manager.py
activate
¶
Activate an operator by creating a scheduler task.
Returns the scheduler task ID (deterministic: operator:{id}).
Raises KeyError if the operator is not registered, or
RuntimeError if the scheduler is not available.
Source code in src/diapason/operators/manager.py
deactivate
¶
Deactivate an operator by cancelling its scheduler task.
Source code in src/diapason/operators/manager.py
pause
¶
Pause an active operator.
Source code in src/diapason/operators/manager.py
resume
¶
Resume a paused operator.
Source code in src/diapason/operators/manager.py
status
¶
Return status of all registered operators.
Merges manifest info with scheduler task state.
Source code in src/diapason/operators/manager.py
run_once
¶
Execute a single tick of an operator immediately.
Useful for development and testing. Returns the agent's response.
Source code in src/diapason/operators/manager.py
collect_metrics
¶
collect_metrics(
operator_id: str,
*,
since: Optional[float] = None,
until: Optional[float] = None,
) -> Dict[str, Any]
Collect telemetry metrics declared in the operator's manifest.
Reads the metrics list from :class:OperatorManifest and queries
the system's TelemetryAggregator (when available) for matching
statistics. Only fields explicitly listed in manifest.metrics are
returned, giving operators fine-grained control over what data they
expose.
| PARAMETER | DESCRIPTION |
|---|---|
operator_id
|
ID of the registered operator.
TYPE:
|
since
|
Optional Unix timestamp; restrict stats to records after this time.
TYPE:
|
until
|
Optional Unix timestamp; restrict stats to records before this time.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict[str, Any]
|
Mapping of |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If operator_id is not registered. |
Source code in src/diapason/operators/manager.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
get_manifest
¶
get_manifest(
operator_id: str,
) -> Optional[OperatorManifest]
OperatorManifest
dataclass
¶
OperatorManifest(
id: str,
name: str,
version: str = "0.1.0",
description: str = "",
author: str = "",
tools: List[str] = list(),
system_prompt: str = "",
system_prompt_path: str = "",
max_turns: int = 20,
temperature: float = 0.3,
schedule_type: str = "interval",
schedule_value: str = "300",
metrics: List[str] = list(),
required_capabilities: List[str] = list(),
settings: Dict[str, Any] = dict(),
metadata: Dict[str, Any] = dict(),
)
Manifest describing a persistent autonomous operator.
Functions:¶
load_operator
¶
load_operator(path: str | Path) -> OperatorManifest
Load an operator manifest from a TOML file.
Supports inline system_prompt or external system_prompt_path
(resolved relative to the TOML file).