Generated API reference¶
These signatures and docstrings are extracted from the source in this checkout. Use the public API map for supported import paths and the integration guides for credentials and account tracks.
Capability contracts¶
zeo_core.contracts.CapabilityResult ¶
Bases: BaseModel, Generic[T]
Standard return envelope for ALL capabilities.
Orchestrators (n8n, Temporal) parse this JSON to decide the next step in the workflow. This enables: - Machine branching (success/skip/error paths) - Audit trails (logs, timing, metadata) - Debugging (structured errors with context)
Invariants
- If status == error, then error must be present AND machine_message must be present
- If status == error, then machine_message must start with a recognized prefix (ZEO_ preferred; QC_/ZC_ accepted, see below)
- If status == success, then error must be None AND machine_message should be None
- If status == skipped, then error must be None AND machine_message must be present
- If status == skipped, then machine_message must start with a recognized prefix (ZEO_ preferred; QC_/ZC_ accepted, see below)
- If machine_message is present, it must start with a recognized prefix (ZEO_ preferred; QC_/ZC_ accepted, see below)
Machine-message / error-code prefix:
New code should use ZEO_<AREA>_<DETAIL> (matches the package
name, zeo_core). QC_<AREA>_<DETAIL> is still accepted -- it is
the convention this package's capabilities used before the
pre-extraction rename from quack_core to zeo_core, and it
remains valid on purpose (not a leftover bug) because orchestrators
already branch on QC_* codes emitted by existing tools; widening
the validator to also accept ZEO_/ZC_ was chosen over a hard
rename so no existing call site or downstream consumer breaks.
ZC_ is accepted as a short-form alias of ZEO_.
Usage Pattern
Tools should use the helper methods (.ok(), .skip(), .fail()) rather than constructing CapabilityResult directly:
Success¶
result = CapabilityResult.ok( ... data={"transcription": "Hello world"}, ... msg="Transcription completed" ... )
Skip¶
result = CapabilityResult.skip( ... reason="Video too short for processing", ... code="ZEO_VAL_TOO_SHORT" ... )
Error¶
try: ... risky_operation() ... except Exception as e: ... result = CapabilityResult.fail_from_exc( ... msg="Failed to process video", ... code="ZEO_IO_ERROR", ... exc=e ... )
Source code in src/zeo_core/contracts/envelopes/result.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 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 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 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
fail
classmethod
¶
fail(msg, code, exception=None, metadata=None, logs=None, run_id=None, outcome=CapabilityOutcome.integration_failure)
Create an error result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg
|
str
|
Human-readable error message |
required |
code
|
str
|
Machine-readable error code (must start with ZEO_, ZC_, or the legacy QC_ -- see MACHINE_MESSAGE_PREFIXES) |
required |
exception
|
Exception | None
|
Optional exception that caused the error |
None
|
metadata
|
dict[str, Any] | None
|
Optional metadata dict |
None
|
logs
|
list[CapabilityLogEvent] | None
|
Optional log events from execution |
None
|
run_id
|
str | None
|
Optional run_id to reuse (should match manifest run_id) |
None
|
Returns:
| Type | Description |
|---|---|
CapabilityResult[T]
|
CapabilityResult with status=error |
Example
result = CapabilityResult.fail( ... msg="Failed to read video file", ... code="ZEO_IO_NOT_FOUND", ... exception=FileNotFoundError("/data/video.mp4") ... )
Source code in src/zeo_core/contracts/envelopes/result.py
fail_from_exc
classmethod
¶
Convenience wrapper for fail() that always includes exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg
|
str
|
Human-readable error message |
required |
code
|
str
|
Machine-readable error code (must start with ZEO_, ZC_, or the legacy QC_ -- see MACHINE_MESSAGE_PREFIXES) |
required |
exc
|
Exception
|
Exception that caused the error |
required |
metadata
|
dict[str, Any] | None
|
Optional metadata dict |
None
|
run_id
|
str | None
|
Optional run_id to reuse (should match manifest run_id) |
None
|
Returns:
| Type | Description |
|---|---|
CapabilityResult[T]
|
CapabilityResult with status=error |
Example
try: ... process_video() ... except IOError as e: ... result = CapabilityResult.fail_from_exc( ... msg="Video processing failed", ... code="ZEO_IO_ERROR", ... exc=e ... )
Source code in src/zeo_core/contracts/envelopes/result.py
ok
classmethod
¶
Create a successful result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
T
|
The result payload |
required |
msg
|
str
|
Human-readable success message |
'Success'
|
metadata
|
dict[str, Any] | None
|
Optional metadata dict |
None
|
logs
|
list[CapabilityLogEvent] | None
|
Optional log events from execution |
None
|
duration_sec
|
float | None
|
Execution time in seconds (None if not measured) |
None
|
run_id
|
str | None
|
Optional run_id to reuse (should match manifest run_id) |
None
|
Returns:
| Type | Description |
|---|---|
CapabilityResult[T]
|
CapabilityResult with status=success |
Example
result = CapabilityResult.ok( ... data={"clips": [...]}, ... msg="Generated 5 clips", ... metadata={"tool": "slice_video", "preset": "fast"} ... )
Source code in src/zeo_core/contracts/envelopes/result.py
skip
classmethod
¶
Create a skip result (valid policy decision).
Skips are NOT errors - they represent intentional decisions to skip processing (e.g., video too short, file already exists).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reason
|
str
|
Human-readable explanation for the skip |
required |
code
|
str
|
Machine-readable skip code (must start with ZEO_, ZC_, or the legacy QC_ -- see MACHINE_MESSAGE_PREFIXES) |
required |
metadata
|
dict[str, Any] | None
|
Optional metadata dict |
None
|
run_id
|
str | None
|
Optional run_id to reuse (should match manifest run_id) |
None
|
Returns:
| Type | Description |
|---|---|
CapabilityResult[T]
|
CapabilityResult with status=skipped |
Example
result = CapabilityResult.skip( ... reason="Video duration under 10 seconds", ... code="ZEO_VAL_TOO_SHORT" ... )
Source code in src/zeo_core/contracts/envelopes/result.py
unavailable
classmethod
¶
Create a skipped result because a declared dependency is missing.
Source code in src/zeo_core/contracts/envelopes/result.py
validate_machine_message_format
classmethod
¶
Ensure machine_message follows a recognized *_ convention when present.
Source code in src/zeo_core/contracts/envelopes/result.py
validate_status_invariants ¶
Enforce invariants between status and other fields.
This ensures orchestrators can rely on the structure: - Errors always have error objects and machine codes - Successes never have error objects or machine codes - Skips never have error objects but always have machine codes
Source code in src/zeo_core/contracts/envelopes/result.py
zeo_core.contracts.EffectKind ¶
Bases: StrEnum
Declared side-effect kind. Declarations are not permission grants.
Source code in src/zeo_core/contracts/common/enums.py
Authoring and invocation¶
zeo_core.tools.capability ¶
capability(*, id, description, effects, examples, error_codes=(), concurrency=ConcurrencyMode.PARALLEL_SAFE, resource_key_fields=(), requirements=None, tags=(), metadata=None, deprecation=None, projection_name=None, guards=(), register_to=None)
Wrap a typed function as a BoundCapability.
Does not register globally unless register_to is an explicit registry.
Source code in src/zeo_core/tools/authoring.py
zeo_core.tools.ToolContext ¶
Bases: BaseModel
Immutable context for tool execution.
The runner constructs this with all required services. Tools receive it as read-only and must not modify it.
METADATA CONTRACT (ENFORCED): - Must be a Mapping (dict-like) - Must be JSON-serializable (validated on construction) - Uses shared normalize_for_json() - same logic as ToolRunner - Primitives: str, int, float, bool, None - Collections: list, dict (string keys only) - Safe types auto-converted: Path→str, datetime→isoformat, Enum→value - Pydantic models: converted via model_dump() (strict isinstance) - Top-level immutable (cannot reassign ctx.metadata) - Nested values not frozen (tools should treat as read-only) - Violations fail immediately with clear error
Source code in src/zeo_core/tools/context.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
get_artifact_sink ¶
get_cancellation ¶
get_clock ¶
get_service ¶
Get a service by name (if runner provided it).
Source code in src/zeo_core/tools/context.py
normalize_path
classmethod
¶
Normalize Path to str for storage.
Raises:
| Type | Description |
|---|---|
TypeError
|
If value is neither str nor Path |
Source code in src/zeo_core/tools/context.py
require_fs ¶
Get filesystem service (guaranteed non-None by runner).
Source code in src/zeo_core/tools/context.py
require_logger ¶
Get logger (guaranteed non-None by runner).
require_service ¶
Get a service by name (raises if missing).
Raises:
| Type | Description |
|---|---|
ValueError
|
If service not available in context |
Source code in src/zeo_core/tools/context.py
serialize_mapping ¶
validate_and_normalize_metadata
classmethod
¶
Validate metadata is a Mapping and JSON-serializable, then normalize.
Must-fix #2: Explicitly enforce Mapping type before processing.
Source code in src/zeo_core/tools/context.py
validate_and_normalize_services
classmethod
¶
Validate services is a Mapping and convert to MappingProxyType.
Must-fix B: Defensive coding - handle None gracefully.
Source code in src/zeo_core/tools/context.py
zeo_core.tools.invoke_sync ¶
Source code in src/zeo_core/tools/invoke.py
Added in 0.11.0: Runtime and meetings¶
These APIs ship in 0.11.0. The generic host protocol is a candidate; consult its guide before integration.
zeo_core.contracts.runtime.LaunchContext ¶
Bases: WireModel
Delivered on a private inherited FD, not supplied in request JSON.
Source code in src/zeo_core/contracts/runtime.py
zeo_core.contracts.runtime.HostResult ¶
Bases: WireModel
Source code in src/zeo_core/contracts/runtime.py
zeo_core.integrations.meetings.MeetingRunner ¶
Runtime owns leases and replay; this runner owns no second execution ledger.
Source code in src/zeo_core/integrations/meetings/runner.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
Marketing¶
zeo_core.integrations.hubspot.HubSpotIntegration ¶
Source code in src/zeo_core/integrations/hubspot/service.py
zeo_core.integrations.kit.KitIntegration ¶
Source code in src/zeo_core/integrations/kit/service.py
Account tracks and execution profiles¶
zeo_core.integrations.environments.IntegrationEnvironment
dataclass
¶
One application process, one mode, explicit provider inputs.
Fixture mode removes all provider variables; applications supply their own controlled transports/services. Neither backend is an operating-system sandbox.
Source code in src/zeo_core/integrations/environments/launcher.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
child_environment ¶
Return selected credentials only; never mutate the parent process.
Source code in src/zeo_core/integrations/environments/launcher.py
prepare ¶
Create separate private directories; refuse aliases into another mode.
Source code in src/zeo_core/integrations/environments/launcher.py
run ¶
Run the application without a shell and propagate its exit status.
Source code in src/zeo_core/integrations/environments/launcher.py
zeo_core.integrations.hosted.ExecutionProfile ¶
Bases: StrEnum
Explicit execution placements; automatic choice is policy, not a profile.
Source code in src/zeo_core/integrations/hosted/profile.py
Gemini requests¶
zeo_core.integrations.gemini.ImageGenerationRequest ¶
Bases: BaseModel
One billed operation; references and intent are covered by authorization.