Skip to content

cayu.sessions.invocation

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.sessions import InvocationOrigin

Immutable root identity retained across a complete session tree.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
trust InvocationOriginTrust required
subject str | None Field(default=None, max_length=INVOCATION_IDENTITY_MAX_CHARS)
tenant str | None Field(default=None, max_length=INVOCATION_IDENTITY_MAX_CHARS)
InvocationOrigin.validate_identity(value: str | None, info) -> str | None
InvocationOrigin.validate_trust_shape() -> InvocationOrigin

Release source · Runtime guarantees · Capability guides

from cayu.sessions import InvocationOriginClaim

Bounded identity asserted by a trusted direct-SDK host application.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
subject str Field(max_length=INVOCATION_IDENTITY_MAX_CHARS)
tenant str | None Field(default=None, max_length=INVOCATION_IDENTITY_MAX_CHARS)
InvocationOriginClaim.validate_identity(value: str | None, info) -> str | None

Release source · Runtime guarantees · Capability guides

from cayu.sessions import InvocationOriginTrust

How Cayu obtained the root invocation identity.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
SERVER_VERIFIED class attribute 'server_verified'
HOST_ASSERTED class attribute 'host_asserted'
UNATTRIBUTED class attribute 'unattributed'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import session_invocation_from_task

Create the session-side root snapshot for task-backed execution.

session_invocation_from_task(task: TaskInvocation, *, session_id: str, source: SessionExecutionSource=SessionExecutionSource.TASK) -> SessionInvocation

Release source · Runtime guarantees · Capability guides

from cayu.sessions import SessionExecutionSource

The runtime boundary that created one session.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
HTTP_RUN class attribute 'http_run'
SDK_RUN class attribute 'sdk_run'
FORK class attribute 'fork'
SUBAGENT class attribute 'subagent'
TASK class attribute 'task'
WORKFLOW_STEP class attribute 'workflow_step'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import SessionInvocation

Versioned provenance attached atomically to one durable session.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] INVOCATION_PROVENANCE_SCHEMA_VERSION
origin InvocationOrigin required
root_invocation_id str Field(min_length=36, max_length=36, pattern=_CANONICAL_UUID4_PATTERN, json_schema_extra={'format': 'uuid4'})
root_session_id str required
source SessionExecutionSource required
resource_access ResourceExecutionBinding | None Field(default=None, exclude_if=lambda v: v is None)
SessionInvocation.validate_root_invocation_id(value: str) -> str
SessionInvocation.validate_root_session_id(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import SessionInvocationBinding

One immediate session identity bound to its immutable provenance.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
id str required
session_instance_id str Field(min_length=36, max_length=36, pattern=_CANONICAL_UUID4_PATTERN, json_schema_extra={'format': 'uuid4'})
invocation SessionInvocation required
SessionInvocationBinding.validate_id(value: str) -> str
SessionInvocationBinding.validate_session_instance_id(value: str) -> str
SessionInvocationBinding.copy_invocation(value: SessionInvocation) -> SessionInvocation

Release source · Runtime guarantees · Capability guides

from cayu.sessions import TaskExecutionSource

The trusted boundary that created one durable task.

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
HTTP_RUN class attribute 'http_run'
PRODUCT_OPERATION class attribute 'product_operation'
SCHEDULED class attribute 'scheduled'
SDK_TASK class attribute 'sdk_task'
TASK_DISPATCH class attribute 'task_dispatch'
WEBHOOK class attribute 'webhook'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import TaskInvocation

Versioned root provenance attached atomically to one durable task.

root_session_id is absent when the invocation began as task-only work. A later task/session attachment remains structural state on Task and cannot rewrite this immutable root record.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] INVOCATION_PROVENANCE_SCHEMA_VERSION
origin InvocationOrigin required
root_invocation_id str Field(min_length=36, max_length=36, pattern=_CANONICAL_UUID4_PATTERN, json_schema_extra={'format': 'uuid4'})
root_session_id str | None None
source TaskExecutionSource required
resource_access ResourceExecutionBinding | None Field(default=None, exclude_if=lambda v: v is None)
access_labels Mapping[str, str] Field(default_factory=dict, exclude_if=lambda v: not v)
TaskInvocation.validate_access_labels(value)
TaskInvocation.freeze_access_labels(value)
TaskInvocation.serialize_access_labels(value)
TaskInvocation.validate_root_invocation_id(value: str) -> str
TaskInvocation.validate_root_session_id(value: str | None) -> str | None

Release source · Runtime guarantees · Capability guides