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/openjarvis/operators/manager.py
Attributes¶
Functions¶
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/openjarvis/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/openjarvis/operators/manager.py
deactivate
¶
Deactivate an operator by cancelling its scheduler task.
Source code in src/openjarvis/operators/manager.py
pause
¶
Pause an active operator.
Source code in src/openjarvis/operators/manager.py
resume
¶
Resume a paused operator.
Source code in src/openjarvis/operators/manager.py
status
¶
Return status of all registered operators.
Merges manifest info with scheduler task state.
Source code in src/openjarvis/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/openjarvis/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/openjarvis/operators/manager.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 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 | |
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).