Python API inventory
This page is generated from the release's declared public exports. It records exact signatures, model fields, and public members. The capability pages explain how these objects work together; use this inventory for exact lookup.
Do not edit this file directly. Run python scripts/render_docs_api_reference.py.
m3
__version__
m3.__version__
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
MCPTestKit
m3.MCPTestKit(config: 'Config | _Mapping[str, _Any] | None' = None, *, env: '_Mapping[str, str] | None' = None, cwd: 'str | _Path | None' = None, probe_timeout_seconds: 'float' = 5.0, probe_output_limit: 'int' = 65536, store: '_ExecutionStore | None' = None, embedded_worker: 'bool' = True, adapter_registry: '_HarnessAdapterRegistry | None' = None, run_id: '_RunId | str | None' = None, suite_name: 'str | None' = None, project_id: '_ProjectId | str | None' = None, record_checks: 'bool' = False, max_judge_requests: 'int | None' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'None'
Lifecycle-safe synchronous configuration and capability shell.
Public fields and methods:
get_trace(self, execution_id: '_ExecutionId | str') -> '_TraceResult'— Return the finalized stable trace for an execution.get_trace_view(self, execution_id: '_ExecutionId | str') -> 'TraceView'— Return the finalized typed trace view for an execution.read_raw_evidence(self, reference: '_EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Read bounded, redacted raw evidence by its durable reference.close(self) -> 'None'— Close the shell; repeated calls are intentionally harmless.capabilities(self, requests: '_Iterable[ProbeRequest]' = ()) -> 'ProbeReport'— Return the baseline or exactly the explicitly requested probes.register_evaluator(self, name: 'str', evaluator: '_EvaluatorCallable') -> 'None'— Register an evaluator callback by its serializable name.evaluate(self, subject: '_Any', evaluator: 'str | _EvaluatorCallable', *, required: 'bool' = False, goal: 'str | None' = None, trace: '_Any' = None, artifacts: '_Any' = (), metadata: '_Mapping[str, str | int | float | bool | None] | None' = None, execution_id: '_Any' = None, turn_id: '_Any' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Run and persist one evaluation without changing lifecycle.judge_response(self, *, name: 'str', input: 'str', actual: 'str', expected: 'str', judge: '_LLMJudge', required: 'bool' = False, execution_id: '_Any' = None, turn_id: '_Any' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Judge one response and persist the result through this kit's runner.evaluation_results(self) -> 'tuple[_EvaluationResult, ...]'— Public method onMCPTestKit.agents(self, selections: '_Any', *, trials: 'int' = 1) -> 'tuple[_Any, ...]'— Expand ordered agent dictionaries without starting any I/O.run(self, spec: '_DirectSpec | _AgentSpec') -> '_ExecutionResult'— Public method onMCPTestKit.submit(self, spec: '_ExecutionSpec', *, human_input: '_HumanInput' = 'fail') -> 'ExecutionHandle'— Public method onMCPTestKit.direct(self, server: '_ServerValue | _ServerBinding', *, protocol: 'object | None' = None, timeout: 'float | None' = None, validate_schemas: 'bool' = False, secret_resolver: '_Any' = None, bearer_token: '_Any' = None, auth: '_Any' = None, for_agent: 'bool' = False, resolve_host: '_Any' = None, raise_server_exceptions: 'bool' = True, sampling_callback: '_Any' = None, elicitation_callback: '_RemovedElicitationCallback' = <m3.direct_client._RemovedElicitationCallback object>, list_roots_callback: '_Any' = None, logging_callback: '_Any' = None, message_handler: '_Any' = None, client_info: '_Any' = None, log_level: '_Any' = None, sampling_capabilities: '_Any' = None, result_claims: '_Any' = None, extensions: '_Mapping[str, _Mapping[str, _Any]] | None' = None, notification_bindings: '_Iterable[_Any] | None' = None, dispatcher: '_Any' = None, trace_bridge: '_Any' = None, trace_owner: 'bool' = True, workspace_root: 'str | None' = None) -> 'DirectClient'— Public method onMCPTestKit.agent_session(self, spec: '_AgentSpec', *, adapter: '_AgentAdapter | None' = None, runtime_servers: '_Iterable[_Any]' = (), interaction_handlers: 'InteractionHandlers | None' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'AgentSession'— Public method onMCPTestKit.
StdioServer
m3.StdioServer(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], trust: m3.types.TrustLevel = <TrustLevel.UNTRUSTED: 'untrusted'>, kind: Literal['stdio'] = 'stdio', command: Annotated[str, MinLen(min_length=1)], args: tuple[str, ...] = (), environment: collections.abc.Mapping[str, m3.types.SecretReference | str] = <factory>, cwd: str | None = None) -> None
Public class in m3.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.trust: <enum 'TrustLevel'>; default<TrustLevel.UNTRUSTED: 'untrusted'>— Stored and validated as part of this public value.kind: typing.Literal['stdio']; default'stdio'— Stored and validated as part of this public value.command: <class 'str'>; required — Stored and validated as part of this public value.args: tuple[str, ...]; default()— Stored and validated as part of this public value.environment: collections.abc.Mapping[str, m3.types.SecretReference | str]; required — Stored and validated as part of this public value.cwd: str | None; defaultNone— Stored and validated as part of this public value.
HTTPServer
m3.HTTPServer(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], trust: m3.types.TrustLevel = <TrustLevel.UNTRUSTED: 'untrusted'>, kind: Literal['streamable_http'] = 'streamable_http', url: Annotated[str, MinLen(min_length=1)], headers: collections.abc.Mapping[str, m3.types.SecretReference | str] = <factory>, loopback_only: bool = False) -> None
Public class in m3.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.trust: <enum 'TrustLevel'>; default<TrustLevel.UNTRUSTED: 'untrusted'>— Stored and validated as part of this public value.kind: typing.Literal['streamable_http']; default'streamable_http'— Stored and validated as part of this public value.url: <class 'str'>; required — Stored and validated as part of this public value.headers: collections.abc.Mapping[str, m3.types.SecretReference | str]; required — Stored and validated as part of this public value.loopback_only: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
InProcessServer
m3.InProcessServer(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], trust: m3.types.TrustLevel = <TrustLevel.SDK_LOOPBACK: 'sdk_loopback'>, kind: Literal['in_process'] = 'in_process', factory: Any, descriptor: collections.abc.Mapping[str, typing.Any] = <factory>, origin: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)] = 'python_registration') -> None
Runtime-only server descriptor; the factory is excluded from serialization.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.trust: <enum 'TrustLevel'>; default<TrustLevel.SDK_LOOPBACK: 'sdk_loopback'>— Stored and validated as part of this public value.kind: typing.Literal['in_process']; default'in_process'— Stored and validated as part of this public value.factory: typing.Any; required — Stored and validated as part of this public value.descriptor: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.origin: <class 'str'>; default'python_registration'— Stored and validated as part of this public value.
ExecutionResult
m3.ExecutionResult(*, snapshot: m3.types.ExecutionState, turns: tuple[m3.types.TurnResult, ...] = (), trace: m3.types.TraceResult | None = None, direct_result: Optional[Annotated[m3.types.ListToolsResult | m3.types.ListResourcesResult | m3.types.ListTemplatesResult | m3.types.ListPromptsResult | m3.types.CallToolResult | m3.types.ReadResourceResult | m3.types.GetPromptResult | m3.types.PingResult, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] = None, evaluations: tuple[m3.types.EvaluationResult, ...] = (), artifacts: tuple[m3.types.ArtifactRef, ...] = (), activity_health: m3.types.ActivityHealth = <ActivityHealth.NO_CALLS: 'no_calls'>, error: m3.types.ErrorInfo | None = None, provenance: m3.types.SessionSource | None = None) -> None
Public class in m3.
Public fields and methods:
snapshot: <class 'm3.types.ExecutionState'>; required — Stored and validated as part of this public value.turns: tuple[m3.types.TurnResult, ...]; default()— Stored and validated as part of this public value.trace: m3.types.TraceResult | None; defaultNone— Stored and validated as part of this public value.direct_result: typing.Optional[typing.Annotated[m3.types.ListToolsResult | m3.types.ListResourcesResult | m3.types.ListTemplatesResult | m3.types.ListPromptsResult | m3.types.CallToolResult | m3.types.ReadResourceResult | m3.types.GetPromptResult | m3.types.PingResult, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]]; defaultNone— Stored and validated as part of this public value.evaluations: tuple[m3.types.EvaluationResult, ...]; default()— Stored and validated as part of this public value.artifacts: tuple[m3.types.ArtifactRef, ...]; default()— Stored and validated as part of this public value.activity_health: <enum 'ActivityHealth'>; default<ActivityHealth.NO_CALLS: 'no_calls'>— Stored and validated as part of this public value.error: m3.types.ErrorInfo | None; defaultNone— Stored and validated as part of this public value.provenance: m3.types.SessionSource | None; defaultNone— Stored and validated as part of this public value.
ExecutionOutcome
m3.ExecutionOutcome(*values)
Public class in m3.
TurnOutcome
m3.TurnOutcome(*values)
Public class in m3.
expect
m3.expect(subject: '_SubjectT', *, redaction_config: '_RedactionConfig | None' = None) -> 'Expectation[_SubjectT]'
Public callable in m3.
check
m3.check(*, redaction_config: '_RedactionConfig | None' = None) -> 'CheckGroup'
Public callable in m3.
MCPError
m3.MCPError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Base class for expected M3 failures.
m3.types
EVENT_SCHEMA_ID
m3.types.EVENT_SCHEMA_ID
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
EVENT_SCHEMA_VERSION
m3.types.EVENT_SCHEMA_VERSION
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
ExecutionOutcome
m3.types.ExecutionOutcome(*values)
Public class in m3.types.
ExecutionResult
m3.types.ExecutionResult(*, snapshot: m3.types.ExecutionState, turns: tuple[m3.types.TurnResult, ...] = (), trace: m3.types.TraceResult | None = None, direct_result: Optional[Annotated[m3.types.ListToolsResult | m3.types.ListResourcesResult | m3.types.ListTemplatesResult | m3.types.ListPromptsResult | m3.types.CallToolResult | m3.types.ReadResourceResult | m3.types.GetPromptResult | m3.types.PingResult, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] = None, evaluations: tuple[m3.types.EvaluationResult, ...] = (), artifacts: tuple[m3.types.ArtifactRef, ...] = (), activity_health: m3.types.ActivityHealth = <ActivityHealth.NO_CALLS: 'no_calls'>, error: m3.types.ErrorInfo | None = None, provenance: m3.types.SessionSource | None = None) -> None
Public class in m3.types.
Public fields and methods:
snapshot: <class 'm3.types.ExecutionState'>; required — Stored and validated as part of this public value.turns: tuple[m3.types.TurnResult, ...]; default()— Stored and validated as part of this public value.trace: m3.types.TraceResult | None; defaultNone— Stored and validated as part of this public value.direct_result: typing.Optional[typing.Annotated[m3.types.ListToolsResult | m3.types.ListResourcesResult | m3.types.ListTemplatesResult | m3.types.ListPromptsResult | m3.types.CallToolResult | m3.types.ReadResourceResult | m3.types.GetPromptResult | m3.types.PingResult, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]]; defaultNone— Stored and validated as part of this public value.evaluations: tuple[m3.types.EvaluationResult, ...]; default()— Stored and validated as part of this public value.artifacts: tuple[m3.types.ArtifactRef, ...]; default()— Stored and validated as part of this public value.activity_health: <enum 'ActivityHealth'>; default<ActivityHealth.NO_CALLS: 'no_calls'>— Stored and validated as part of this public value.error: m3.types.ErrorInfo | None; defaultNone— Stored and validated as part of this public value.provenance: m3.types.SessionSource | None; defaultNone— Stored and validated as part of this public value.
TurnOutcome
m3.types.TurnOutcome(*values)
Public class in m3.types.
TurnResult
m3.types.TurnResult(*, snapshot: m3.types.TurnState, response: m3.types.TurnResponse | None = None, error: m3.types.ErrorInfo | None = None, trace: m3.types.TraceResult | None = None, evidence: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.types.
Public fields and methods:
snapshot: <class 'm3.types.TurnState'>; required — Stored and validated as part of this public value.response: m3.types.TurnResponse | None; defaultNone— Stored and validated as part of this public value.error: m3.types.ErrorInfo | None; defaultNone— Stored and validated as part of this public value.trace: m3.types.TraceResult | None; defaultNone— Stored and validated as part of this public value.evidence: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
HTTPServer
m3.types.HTTPServer(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], trust: m3.types.TrustLevel = <TrustLevel.UNTRUSTED: 'untrusted'>, kind: Literal['streamable_http'] = 'streamable_http', url: Annotated[str, MinLen(min_length=1)], headers: collections.abc.Mapping[str, m3.types.SecretReference | str] = <factory>, loopback_only: bool = False) -> None
Public class in m3.types.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.trust: <enum 'TrustLevel'>; default<TrustLevel.UNTRUSTED: 'untrusted'>— Stored and validated as part of this public value.kind: typing.Literal['streamable_http']; default'streamable_http'— Stored and validated as part of this public value.url: <class 'str'>; required — Stored and validated as part of this public value.headers: collections.abc.Mapping[str, m3.types.SecretReference | str]; required — Stored and validated as part of this public value.loopback_only: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
StdioServer
m3.types.StdioServer(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], trust: m3.types.TrustLevel = <TrustLevel.UNTRUSTED: 'untrusted'>, kind: Literal['stdio'] = 'stdio', command: Annotated[str, MinLen(min_length=1)], args: tuple[str, ...] = (), environment: collections.abc.Mapping[str, m3.types.SecretReference | str] = <factory>, cwd: str | None = None) -> None
Public class in m3.types.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.trust: <enum 'TrustLevel'>; default<TrustLevel.UNTRUSTED: 'untrusted'>— Stored and validated as part of this public value.kind: typing.Literal['stdio']; default'stdio'— Stored and validated as part of this public value.command: <class 'str'>; required — Stored and validated as part of this public value.args: tuple[str, ...]; default()— Stored and validated as part of this public value.environment: collections.abc.Mapping[str, m3.types.SecretReference | str]; required — Stored and validated as part of this public value.cwd: str | None; defaultNone— Stored and validated as part of this public value.
InProcessServer
m3.types.InProcessServer(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], trust: m3.types.TrustLevel = <TrustLevel.SDK_LOOPBACK: 'sdk_loopback'>, kind: Literal['in_process'] = 'in_process', factory: Any, descriptor: collections.abc.Mapping[str, typing.Any] = <factory>, origin: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)] = 'python_registration') -> None
Runtime-only server descriptor; the factory is excluded from serialization.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.trust: <enum 'TrustLevel'>; default<TrustLevel.SDK_LOOPBACK: 'sdk_loopback'>— Stored and validated as part of this public value.kind: typing.Literal['in_process']; default'in_process'— Stored and validated as part of this public value.factory: typing.Any; required — Stored and validated as part of this public value.descriptor: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.origin: <class 'str'>; default'python_registration'— Stored and validated as part of this public value.
SecretReference
m3.types.SecretReference(*, source: Literal['environment', 'provider'], name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)]) -> None
Reference to a secret; resolved values are deliberately not modelled.
Public fields and methods:
source: typing.Literal['environment', 'provider']; required — Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.
ServerBinding
m3.types.ServerBinding(*, server: Optional[Annotated[m3.types.StdioServer | m3.types.HTTPServer | m3.types.InProcessServer, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] = None, profile: m3.types.ServerProfileRef | None = None, alias: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, required: bool = True) -> None
Public class in m3.types.
Public fields and methods:
server: typing.Optional[typing.Annotated[m3.types.StdioServer | m3.types.HTTPServer | m3.types.InProcessServer, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]]; defaultNone— Stored and validated as part of this public value.profile: m3.types.ServerProfileRef | None; defaultNone— Stored and validated as part of this public value.alias: str | None; defaultNone— Stored and validated as part of this public value.required: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.
ServerValue
m3.types.ServerValue(*args, **kwargs)
Runtime representation of an annotated type.
ToolPolicy
m3.types.ToolPolicy(*args, **kwargs)
Runtime representation of an annotated type.
UserMessage
m3.types.UserMessage(*, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...], metadata: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Typed user message; a string is accepted as text shorthand.
Public fields and methods:
content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; required — Stored and validated as part of this public value.metadata: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
TextContent
m3.types.TextContent(*, kind: Literal['text'] = 'text', text: str) -> None
Public class in m3.types.
Public fields and methods:
kind: typing.Literal['text']; default'text'— Stored and validated as part of this public value.text: <class 'str'>; required — Stored and validated as part of this public value.
DirectSpec
m3.types.DirectSpec(*, run_id: m3.types.RunId | None = None, project_id: m3.types.ProjectId | None = None, project_name: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, suite_name: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, case_id: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, servers: tuple[m3.types.ServerBinding, ...] = (), protocol: m3.types.ProtocolConstraint = <factory>, timeout_seconds: Annotated[float | None, Gt(gt=0)] = None, goal: Annotated[str | None, MaxLen(max_length=32768)] = None, evaluations: tuple[m3.types.EvaluationRegistration, ...] = (), artifact_policy: m3.types.ArtifactPolicy = <ArtifactPolicy.FAILED: 'failed'>, declared_artifacts: tuple[str, ...] = (), workspace: m3.types.WorkspacePolicy = <factory>, tool_policy: m3.types.RestrictiveToolPolicy | m3.types.FullToolPolicy | m3.types.NativeToolPolicy = <factory>, permission_policy: m3.types.PermissionPolicy = <factory>, sampling_policy: m3.types.SamplingPolicy = <factory>, filesystem_policy: m3.types.FilesystemPolicy = <factory>, terminal_policy: m3.types.TerminalPolicy = <factory>, metadata: collections.abc.Mapping[str, str | int | float | bool | None] = <factory>, kind: Literal['direct'] = 'direct', operation: m3.types.ListTools | m3.types.ListResources | m3.types.ListTemplates | m3.types.ListPrompts | m3.types.CallTool | m3.types.ReadResource | m3.types.GetPrompt | m3.types.Ping, validate_schemas: bool = False) -> None
Public class in m3.types.
Public fields and methods:
run_id: m3.types.RunId | None; defaultNone— Stored and validated as part of this public value.project_id: m3.types.ProjectId | None; defaultNone— Stored and validated as part of this public value.project_name: str | None; defaultNone— Stored and validated as part of this public value.suite_name: str | None; defaultNone— Stored and validated as part of this public value.case_id: str | None; defaultNone— Stored and validated as part of this public value.servers: tuple[m3.types.ServerBinding, ...]; default()— Stored and validated as part of this public value.protocol: <class 'm3.types.ProtocolConstraint'>; required — Stored and validated as part of this public value.timeout_seconds: float | None; defaultNone— Stored and validated as part of this public value.goal: str | None; defaultNone— Stored and validated as part of this public value.evaluations: tuple[m3.types.EvaluationRegistration, ...]; default()— Stored and validated as part of this public value.artifact_policy: <enum 'ArtifactPolicy'>; default<ArtifactPolicy.FAILED: 'failed'>— Stored and validated as part of this public value.declared_artifacts: tuple[str, ...]; default()— Stored and validated as part of this public value.workspace: <class 'm3.types.WorkspacePolicy'>; required — Stored and validated as part of this public value.tool_policy: m3.types.RestrictiveToolPolicy | m3.types.FullToolPolicy | m3.types.NativeToolPolicy; required — Stored and validated as part of this public value.permission_policy: <class 'm3.types.PermissionPolicy'>; required — Stored and validated as part of this public value.sampling_policy: <class 'm3.types.SamplingPolicy'>; required — Stored and validated as part of this public value.filesystem_policy: <class 'm3.types.FilesystemPolicy'>; required — Stored and validated as part of this public value.terminal_policy: <class 'm3.types.TerminalPolicy'>; required — Stored and validated as part of this public value.metadata: collections.abc.Mapping[str, str | int | float | bool | None]; required — Stored and validated as part of this public value.kind: typing.Literal['direct']; default'direct'— Stored and validated as part of this public value.operation: m3.types.ListTools | m3.types.ListResources | m3.types.ListTemplates | m3.types.ListPrompts | m3.types.CallTool | m3.types.ReadResource | m3.types.GetPrompt | m3.types.Ping; required — Stored and validated as part of this public value.validate_schemas: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
DirectOperation
m3.types.DirectOperation(*args, **kwargs)
Runtime representation of an annotated type.
CallTool
m3.types.CallTool(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['call_tool'] = 'call_tool', name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], arguments: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['call_tool']; default'call_tool'— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.arguments: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
ListTools
m3.types.ListTools(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['list_tools'] = 'list_tools', cursor: Annotated[str | None, MaxLen(max_length=256)] = None, all_pages: bool = True) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['list_tools']; default'list_tools'— Stored and validated as part of this public value.cursor: str | None; defaultNone— Stored and validated as part of this public value.all_pages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.
ListResources
m3.types.ListResources(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['list_resources'] = 'list_resources', cursor: Annotated[str | None, MaxLen(max_length=256)] = None, all_pages: bool = True) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['list_resources']; default'list_resources'— Stored and validated as part of this public value.cursor: str | None; defaultNone— Stored and validated as part of this public value.all_pages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.
ListTemplates
m3.types.ListTemplates(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['list_resource_templates'] = 'list_resource_templates', cursor: Annotated[str | None, MaxLen(max_length=256)] = None, all_pages: bool = True) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['list_resource_templates']; default'list_resource_templates'— Stored and validated as part of this public value.cursor: str | None; defaultNone— Stored and validated as part of this public value.all_pages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.
ListPrompts
m3.types.ListPrompts(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['list_prompts'] = 'list_prompts', cursor: Annotated[str | None, MaxLen(max_length=256)] = None, all_pages: bool = True) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['list_prompts']; default'list_prompts'— Stored and validated as part of this public value.cursor: str | None; defaultNone— Stored and validated as part of this public value.all_pages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.
ReadResource
m3.types.ReadResource(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['read_resource'] = 'read_resource', uri: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)]) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['read_resource']; default'read_resource'— Stored and validated as part of this public value.uri: <class 'str'>; required — Stored and validated as part of this public value.
GetPrompt
m3.types.GetPrompt(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['get_prompt'] = 'get_prompt', name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], arguments: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['get_prompt']; default'get_prompt'— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.arguments: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
Ping
m3.types.Ping(*, server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, kind: Literal['ping'] = 'ping') -> None
Public class in m3.types.
Public fields and methods:
server: str | None; defaultNone— Stored and validated as part of this public value.kind: typing.Literal['ping']; default'ping'— Stored and validated as part of this public value.
EvaluationResult
m3.types.EvaluationResult(*, evaluation_id: m3.types.EvaluationId, name: str, status: m3.types.EvaluationStatus, required: bool = False, message: str | None = None, context: m3.types.EvaluationContext | None = None, score: float | None = None, rationale: str | None = None, metrics: collections.abc.Mapping[str, float] = <factory>, provenance: m3.types.EvaluationSource | None = None, details: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.types.
Public fields and methods:
evaluation_id: <class 'm3.types.EvaluationId'>; required — Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.status: <enum 'EvaluationStatus'>; required — Stored and validated as part of this public value.required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.message: str | None; defaultNone— Stored and validated as part of this public value.context: m3.types.EvaluationContext | None; defaultNone— Stored and validated as part of this public value.score: float | None; defaultNone— Stored and validated as part of this public value.rationale: str | None; defaultNone— Stored and validated as part of this public value.metrics: collections.abc.Mapping[str, float]; required — Stored and validated as part of this public value.provenance: m3.types.EvaluationSource | None; defaultNone— Stored and validated as part of this public value.details: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
EvaluationRecord
m3.types.EvaluationRecord(*, evaluation_id: m3.types.EvaluationId, execution_id: m3.types.ExecutionId, suite_id: m3.types.SuiteId | None = None, suite_name: str | None = None, case_id: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, turn_id: m3.types.TurnId | None = None, name: str, status: m3.types.EvaluationStatus, required: bool = False, message: str | None = None, score: float | None = None, rationale: str | None = None, metrics: collections.abc.Mapping[str, float] = <factory>, provenance: m3.types.EvaluationSource | None = None, details: collections.abc.Mapping[str, typing.Any] = <factory>, goal: str | None = None, metadata: collections.abc.Mapping[str, str | int | float | bool | None] = <factory>, subject_kind: str = 'unknown', subject_digest: Annotated[str | None, _PydanticGeneralMetadata(pattern='^[0-9a-f]{64}$')] = None, run_id: m3.types.RunId | None = None, created_at: datetime.datetime = <factory>) -> None
Compact durable evaluation row linked to an execution report.
Public fields and methods:
evaluation_id: <class 'm3.types.EvaluationId'>; required — Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.suite_id: m3.types.SuiteId | None; defaultNone— Stored and validated as part of this public value.suite_name: str | None; defaultNone— Stored and validated as part of this public value.case_id: str | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.status: <enum 'EvaluationStatus'>; required — Stored and validated as part of this public value.required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.message: str | None; defaultNone— Stored and validated as part of this public value.score: float | None; defaultNone— Stored and validated as part of this public value.rationale: str | None; defaultNone— Stored and validated as part of this public value.metrics: collections.abc.Mapping[str, float]; required — Stored and validated as part of this public value.provenance: m3.types.EvaluationSource | None; defaultNone— Stored and validated as part of this public value.details: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.goal: str | None; defaultNone— Stored and validated as part of this public value.metadata: collections.abc.Mapping[str, str | int | float | bool | None]; required — Stored and validated as part of this public value.subject_kind: <class 'str'>; default'unknown'— Stored and validated as part of this public value.subject_digest: str | None; defaultNone— Stored and validated as part of this public value.run_id: m3.types.RunId | None; defaultNone— Stored and validated as part of this public value.created_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.
EvaluationContext
m3.types.EvaluationContext(*, subject: Any = None, subject_kind: str = 'unknown', execution_id: m3.types.ExecutionId | None = None, suite_id: m3.types.SuiteId | None = None, suite_name: str | None = None, case_id: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, turn_id: m3.types.TurnId | None = None, goal: str | None = None, trace: m3.types.TraceResult | None = None, artifacts: tuple[m3.types.ArtifactRef, ...] = (), metadata: collections.abc.Mapping[str, str | int | float | bool | None] = <factory>) -> None
Public class in m3.types.
Public fields and methods:
subject: typing.Any; defaultNone— Stored and validated as part of this public value.subject_kind: <class 'str'>; default'unknown'— Stored and validated as part of this public value.execution_id: m3.types.ExecutionId | None; defaultNone— Stored and validated as part of this public value.suite_id: m3.types.SuiteId | None; defaultNone— Stored and validated as part of this public value.suite_name: str | None; defaultNone— Stored and validated as part of this public value.case_id: str | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.goal: str | None; defaultNone— Stored and validated as part of this public value.trace: m3.types.TraceResult | None; defaultNone— Stored and validated as part of this public value.artifacts: tuple[m3.types.ArtifactRef, ...]; default()— Stored and validated as part of this public value.metadata: collections.abc.Mapping[str, str | int | float | bool | None]; required — Stored and validated as part of this public value.
EvaluationDecision
m3.types.EvaluationDecision(*, status: m3.types.EvaluationStatus, score: float | None = None, rationale: str | None = None, metrics: collections.abc.Mapping[str, float] = <factory>, provenance: m3.types.EvaluationSource | None = None, details: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Structured evaluator output, compatible with scalar verdicts.
Public fields and methods:
status: <enum 'EvaluationStatus'>; required — Stored and validated as part of this public value.score: float | None; defaultNone— Stored and validated as part of this public value.rationale: str | None; defaultNone— Stored and validated as part of this public value.metrics: collections.abc.Mapping[str, float]; required — Stored and validated as part of this public value.provenance: m3.types.EvaluationSource | None; defaultNone— Stored and validated as part of this public value.details: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
EvaluationStatus
m3.types.EvaluationStatus(*values)
Public class in m3.types.
EvaluationSource
m3.types.EvaluationSource(*, kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], provider: Annotated[str | None, MaxLen(max_length=256)] = None, model: Annotated[str | None, MaxLen(max_length=256)] = None, rubric_id: Annotated[str | None, MaxLen(max_length=256)] = None, rubric_version: Annotated[str | None, MaxLen(max_length=128)] = None, config_digest: Annotated[str | None, MaxLen(max_length=256)] = None) -> None
Optional, redaction-safe provenance for a structured judgment.
Public fields and methods:
kind: <class 'str'>; required — Stored and validated as part of this public value.provider: str | None; defaultNone— Stored and validated as part of this public value.model: str | None; defaultNone— Stored and validated as part of this public value.rubric_id: str | None; defaultNone— Stored and validated as part of this public value.rubric_version: str | None; defaultNone— Stored and validated as part of this public value.config_digest: str | None; defaultNone— Stored and validated as part of this public value.
TraceResult
m3.types.TraceResult(*, trace_id: m3.types.TraceId, execution_id: m3.types.ExecutionId, completeness: Literal['complete', 'partial'] = 'complete', highest_sequence: Annotated[int, Ge(ge=0)] = 0, events: tuple[m3.types.Event, ...] = (), limitations: tuple[str, ...] = ()) -> None
Public class in m3.types.
Public fields and methods:
trace_id: <class 'm3.types.TraceId'>; required — Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.completeness: typing.Literal['complete', 'partial']; default'complete'— Stored and validated as part of this public value.highest_sequence: <class 'int'>; default0— Stored and validated as part of this public value.events: tuple[m3.types.Event, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.view(self) -> '_TraceView'— Project this finalized stable trace into the typed view.
EvidenceRef
m3.types.EvidenceRef(*, evidence_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], sha256: Annotated[str | None, _PydanticGeneralMetadata(pattern='^[0-9a-f]{64}$')] = None, size_bytes: Annotated[int | None, Ge(ge=0)] = None, media_type: Annotated[str | None, MaxLen(max_length=256)] = None, storage_key: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=1024)] = None) -> None
Public class in m3.types.
Public fields and methods:
evidence_id: <class 'str'>; required — Stored and validated as part of this public value.sha256: str | None; defaultNone— Stored and validated as part of this public value.size_bytes: int | None; defaultNone— Stored and validated as part of this public value.media_type: str | None; defaultNone— Stored and validated as part of this public value.storage_key: str | None; defaultNone— Stored and validated as part of this public value.
ArtifactRef
m3.types.ArtifactRef(*, artifact_id: m3.types.ArtifactId, execution_id: m3.types.ExecutionId, name: Annotated[str, MinLen(min_length=1)], media_type: str | None = None, size_bytes: Annotated[int, Ge(ge=0)], sha256: Annotated[str, _PydanticGeneralMetadata(pattern='^[0-9a-f]{64}$')], redacted: Literal[True] = True) -> None
Public class in m3.types.
Public fields and methods:
artifact_id: <class 'm3.types.ArtifactId'>; required — Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.media_type: str | None; defaultNone— Stored and validated as part of this public value.size_bytes: <class 'int'>; required — Stored and validated as part of this public value.sha256: <class 'str'>; required — Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
ExecutionReport
m3.types.ExecutionReport(*, snapshot: m3.types.ExecutionState, agent: m3.types.AgentIdentity | None = None, events: tuple[m3.types.Event, ...] = (), artifacts: tuple[m3.types.ArtifactRef, ...] = (), direct_result: Optional[Annotated[m3.types.ListToolsResult | m3.types.ListResourcesResult | m3.types.ListTemplatesResult | m3.types.ListPromptsResult | m3.types.CallToolResult | m3.types.ReadResourceResult | m3.types.GetPromptResult | m3.types.PingResult, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] = None, error: m3.types.ErrorInfo | None = None, evidence: m3.types.ExecutionEvidence | None = None, turns: tuple[m3.types.TurnResult, ...] = (), evaluations: tuple[m3.types.EvaluationRecord, ...] = (), event_count: Annotated[int, Ge(ge=0)] = 0, events_truncated: bool = False, next_after_sequence: Annotated[int | None, Ge(ge=-1)] = None, artifact_count: Annotated[int, Ge(ge=0)] = 0, artifacts_truncated: bool = False) -> None
Portable evidence that is actually persisted by an execution store.
Public fields and methods:
snapshot: <class 'm3.types.ExecutionState'>; required — Stored and validated as part of this public value.agent: m3.types.AgentIdentity | None; defaultNone— Stored and validated as part of this public value.events: tuple[m3.types.Event, ...]; default()— Stored and validated as part of this public value.artifacts: tuple[m3.types.ArtifactRef, ...]; default()— Stored and validated as part of this public value.direct_result: typing.Optional[typing.Annotated[m3.types.ListToolsResult | m3.types.ListResourcesResult | m3.types.ListTemplatesResult | m3.types.ListPromptsResult | m3.types.CallToolResult | m3.types.ReadResourceResult | m3.types.GetPromptResult | m3.types.PingResult, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]]; defaultNone— Stored and validated as part of this public value.error: m3.types.ErrorInfo | None; defaultNone— Stored and validated as part of this public value.evidence: m3.types.ExecutionEvidence | None; defaultNone— Stored and validated as part of this public value.turns: tuple[m3.types.TurnResult, ...]; default()— Stored and validated as part of this public value.evaluations: tuple[m3.types.EvaluationRecord, ...]; default()— Stored and validated as part of this public value.event_count: <class 'int'>; default0— Stored and validated as part of this public value.events_truncated: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.next_after_sequence: int | None; defaultNone— Stored and validated as part of this public value.artifact_count: <class 'int'>; default0— Stored and validated as part of this public value.artifacts_truncated: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
ExecutionEvidence
m3.types.ExecutionEvidence(*, completeness: Literal['complete', 'partial'], limitations: tuple[str, ...] = (), reason: str | None = None) -> None
Typed completeness markers persisted in stable terminal events.
Public fields and methods:
completeness: typing.Literal['complete', 'partial']; required — Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.reason: str | None; defaultNone— Stored and validated as part of this public value.
Capability
m3.types.Capability(*, name: str, status: m3.types.CapabilityStatus, reason: str | None = None, detected_version: str | None = None, protocol_version: str | None = None, transport: m3.types.TransportKind | None = None) -> None
Public class in m3.types.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.status: <enum 'CapabilityStatus'>; required — Stored and validated as part of this public value.reason: str | None; defaultNone— Stored and validated as part of this public value.detected_version: str | None; defaultNone— Stored and validated as part of this public value.protocol_version: str | None; defaultNone— Stored and validated as part of this public value.transport: m3.types.TransportKind | None; defaultNone— Stored and validated as part of this public value.
Readiness
m3.types.Readiness(*, ready: bool, capabilities: tuple[m3.types.Capability, ...] = (), reason: str | None = None) -> None
Public class in m3.types.
Public fields and methods:
ready: <class 'bool'>; required — Stored and validated as part of this public value.capabilities: tuple[m3.types.Capability, ...]; default()— Stored and validated as part of this public value.reason: str | None; defaultNone— Stored and validated as part of this public value.
ProtocolConstraint
m3.types.ProtocolConstraint(*, revision: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=128)] = None, transport: m3.types.TransportKind | None = None) -> None
Public class in m3.types.
Public fields and methods:
revision: str | None; defaultNone— Stored and validated as part of this public value.transport: m3.types.TransportKind | None; defaultNone— Stored and validated as part of this public value.
WorkspacePolicy
m3.types.WorkspacePolicy(*, kind: m3.types.WorkspaceKind = <WorkspaceKind.TEMPORARY: 'temporary'>, source: str | None = None, acknowledge_risk: bool = False) -> None
Public class in m3.types.
Public fields and methods:
kind: <enum 'WorkspaceKind'>; default<WorkspaceKind.TEMPORARY: 'temporary'>— Stored and validated as part of this public value.source: str | None; defaultNone— Stored and validated as part of this public value.acknowledge_risk: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
PermissionPolicy
m3.types.PermissionPolicy(*, mode: Literal['deny', 'prompt', 'allow'] = 'deny') -> None
Public class in m3.types.
Public fields and methods:
mode: typing.Literal['deny', 'prompt', 'allow']; default'deny'— Stored and validated as part of this public value.
SamplingPolicy
m3.types.SamplingPolicy(*, mode: Literal['deny', 'allow'] = 'deny') -> None
Public class in m3.types.
Public fields and methods:
mode: typing.Literal['deny', 'allow']; default'deny'— Stored and validated as part of this public value.
FilesystemPolicy
m3.types.FilesystemPolicy(*, mode: Literal['deny', 'read_only', 'read_write'] = 'deny') -> None
Public class in m3.types.
Public fields and methods:
mode: typing.Literal['deny', 'read_only', 'read_write']; default'deny'— Stored and validated as part of this public value.
TerminalPolicy
m3.types.TerminalPolicy(*, mode: Literal['deny', 'allow'] = 'deny') -> None
Public class in m3.types.
Public fields and methods:
mode: typing.Literal['deny', 'allow']; default'deny'— Stored and validated as part of this public value.
m3.errors
CleanupError
m3.errors.CleanupError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
ElicitationExpectationError
m3.errors.ElicitationExpectationError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
An elicitation round did not match the declared response plan.
ElicitationRoundLimitError
m3.errors.ElicitationRoundLimitError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
An elicitation operation exceeded its configured round limit.
ExecutionNotFound
m3.errors.ExecutionNotFound(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
The requested execution does not exist in the trace store.
InvalidTransitionError
m3.errors.InvalidTransitionError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
KitClosed
m3.errors.KitClosed(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
An operation was attempted after its owning test kit was closed.
MCPError
m3.errors.MCPError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Base class for expected M3 failures.
ModelValidationError
m3.errors.ModelValidationError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
OperationCancelled
m3.errors.OperationCancelled(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
OperationTimeout
m3.errors.OperationTimeout(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
RawEvidenceIntegrityError
m3.errors.RawEvidenceIntegrityError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Referenced raw evidence failed its digest or size integrity check.
RawEvidenceUnavailable
m3.errors.RawEvidenceUnavailable(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Referenced redacted raw evidence cannot be read.
ProtocolError
m3.errors.ProtocolError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
SessionBusy
m3.errors.SessionBusy(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
SessionStillOpen
m3.errors.SessionStillOpen(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
TransportError
m3.errors.TransportError(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
TraceNotFinalized
m3.errors.TraceNotFinalized(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
A typed view was requested before terminal execution evidence arrived.
TraceUnavailable
m3.errors.TraceUnavailable(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
An execution exists but has no usable trace evidence.
UnsupportedFeature
m3.errors.UnsupportedFeature(message: 'str', *, details: '_Mapping[str, _Any] | None' = None) -> 'None'
Public class in m3.errors.
m3.sync_api
AgentSession
m3.sync_api.AgentSession(portal: '_SyncPortal', spec: '_AgentSpec', adapter: '_AgentAdapter | None' = None, runtime_servers: '_Iterable[_Any]' = (), interaction_handlers: 'InteractionHandlers | None' = None, _handle: 'int | None' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'None'
Blocking proxy for the async session state machine.
Public fields and methods:
send(self, message: 'str | _UserMessage', *, timeout: 'float | None' = None, metadata: 'dict[str, object] | None' = None, elicitation: 'ElicitationPlan | None' = None, elicitation_round_limit: 'int' = 10) -> '_TurnResult'— Public method onAgentSession.enqueue_turn(self, message: 'str | _UserMessage', *, timeout: 'float | None' = None, metadata: 'dict[str, object] | None' = None) -> '_Any'— Public method onAgentSession.snapshot(self) -> '_ExecutionState'— Public method onAgentSession.cancel(self) -> 'None'— Public method onAgentSession.fork(self, request: '_SessionForkRequest', *, adapter_factory: '_Callable[..., _Any]') -> 'AgentSession'— Public method onAgentSession.close(self) -> 'None'— Public method onAgentSession.
HarnessAdapter
m3.sync_api.HarnessAdapter(*args, **kwargs)
Minimal injected adapter contract for one continuing conversation.
Public fields and methods:
start(self, spec: 'AgentSpec') -> 'None'— Public method onHarnessAdapter.send(self, message: 'UserMessage', *, timeout: 'float | None' = None, metadata: 'Mapping[str, object] | None' = None) -> 'TurnResponse | AdapterTurn'— Public method onHarnessAdapter.close(self) -> 'None'— Public method onHarnessAdapter.
Probes
m3.sync_api.Probes(*, timeout_seconds: 'float' = 5.0, output_limit: 'int' = 65536) -> 'None'
Probe only explicitly requested capability targets.
Public fields and methods:
probe_binary(self, name: 'str', executable: 'str | os.PathLike[str]', *, args: 'Sequence[str]' = ('--version',), env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None) -> 'ProbeResult'— Check one explicitly selected executable and record its version.probe_protocol(self, name: 'str', executable: 'str | os.PathLike[str]', *, args: 'Sequence[str]' = ('--protocol-version',), env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None, transport: 'str | TransportKind | None' = None) -> 'ProbeResult'— Run the caller-selected protocol probe without version allowlists.probe_harness(self, name: 'str', executable: 'str | os.PathLike[str]', *, args: 'Sequence[str]' = ('--version',), env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None, transport: 'str | TransportKind | None' = None) -> 'ProbeResult'— Probe exactly one harness executable; never select a fallback.probe_transport(self, name: 'str', *, transport: 'str | TransportKind', executable: 'str | os.PathLike[str] | None' = None, args: 'Sequence[str]' = ('--transport-ready',), module: 'str | None' = None, env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None) -> 'ProbeResult'— Probe a selected transport through an explicit command or module.probe_storage(self, name: 'str' = 'memory', *, module: 'str | None' = None) -> 'ProbeResult'— Report in-memory storage as ready; check optional storage lazily.probe_requested(self, requests: 'Iterable[ProbeRequest]') -> 'ProbeReport'— Run only the supplied requests, retaining each independent result.
CallToolResult
m3.sync_api.CallToolResult(*, raw: Any = None, content: tuple[collections.abc.Mapping[str, typing.Any], ...] = (), structured_content: Any = None, is_error: bool = False) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.content: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.structured_content: typing.Any; defaultNone— Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
CompletionResult
m3.sync_api.CompletionResult(*, raw: Any = None, values: tuple[str, ...] = (), total: int | None = None, has_more: bool | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.values: tuple[str, ...]; default()— Stored and validated as part of this public value.total: int | None; defaultNone— Stored and validated as part of this public value.has_more: bool | None; defaultNone— Stored and validated as part of this public value.
ConfigOrigin
m3.sync_api.ConfigOrigin(*, source: m3.configuration.ConfigSource, origin: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)]) -> None
Public class in m3.sync_api.
Public fields and methods:
source: <enum 'ConfigSource'>; required — Stored and validated as part of this public value.origin: <class 'str'>; required — Stored and validated as part of this public value.
ConfigSource
m3.sync_api.ConfigSource(*values)
Public class in m3.sync_api.
Config
m3.sync_api.Config(*, artifact_policy: Literal['failed', 'always', 'never'] = 'failed', protocol_revision: Annotated[str, Strict(strict=True)] = 'auto', telemetry_enabled: Annotated[bool, Strict(strict=True)] = False, sources: collections.abc.Mapping[str, m3.configuration.ConfigOrigin] = <factory>) -> None
Effective SDK-wide settings and the origin of each setting.
Public fields and methods:
artifact_policy: typing.Literal['failed', 'always', 'never']; default'failed'— Stored and validated as part of this public value.protocol_revision: <class 'str'>; default'auto'— Stored and validated as part of this public value.telemetry_enabled: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.sources: collections.abc.Mapping[str, m3.configuration.ConfigOrigin]; required — Stored and validated as part of this public value.source_for(self, field: 'str') -> 'ConfigOrigin'— Public method onConfig.
ConfigError
m3.sync_api.ConfigError(*, field: 'str', origin: 'str', reason: 'str', code: 'str | None' = None) -> 'None'
A strict, value-free configuration diagnostic.
DirectClient
m3.sync_api.DirectClient(portal: '_SyncPortal', server: '_ServerValue | _ServerBinding', options: '_Mapping[str, _Any]') -> 'None'
Synchronous proxy whose async protocol state remains in a portal thread.
Public fields and methods:
close(self) -> 'None'— Public method onDirectClient.initialize(self) -> 'InitializationResult'— Public method onDirectClient.list_tools(self, *, cursor: 'str | None' = None) -> 'ListToolsResult'— Public method onDirectClient.list_all_tools(self) -> 'tuple[Tool, ...]'— Public method onDirectClient.list_resources(self, *, cursor: 'str | None' = None) -> 'ListResourcesResult'— Public method onDirectClient.list_all_resources(self) -> 'tuple[Resource, ...]'— Public method onDirectClient.list_resource_templates(self, *, cursor: 'str | None' = None) -> 'ListResourceTemplatesResult'— Public method onDirectClient.list_all_resource_templates(self) -> 'tuple[ResourceTemplate, ...]'— Public method onDirectClient.list_prompts(self, *, cursor: 'str | None' = None) -> 'ListPromptsResult'— Public method onDirectClient.list_all_prompts(self) -> 'tuple[PromptInfo, ...]'— Public method onDirectClient.read_resource(self, uri: 'str', *, input_responses: '_Any' = None, request_state: 'str | None' = None, meta: '_Any' = None, allow_input_required: 'bool' = False, elicitation: 'ElicitationPlan | None' = None, elicitation_round_limit: 'int' = 10) -> 'ResourceReadResult | InputRequiredResult'— Public method onDirectClient.get_prompt(self, name: 'str', arguments: '_Mapping[str, str] | None' = None, *, input_responses: '_Any' = None, request_state: 'str | None' = None, meta: '_Any' = None, allow_input_required: 'bool' = False, elicitation: 'ElicitationPlan | None' = None, elicitation_round_limit: 'int' = 10) -> 'PromptResult | InputRequiredResult'— Public method onDirectClient.call_tool(self, name: 'str', arguments: '_Mapping[str, _Any] | None' = None, *, timeout: 'float | None' = None, progress_callback: '_Any' = None, input_responses: '_Any' = None, request_state: 'str | None' = None, meta: '_Any' = None, allow_input_required: 'bool' = False, allow_claimed: 'bool' = False, elicitation: 'ElicitationPlan | None' = None, elicitation_round_limit: 'int' = 10) -> 'ToolCallResult | InputRequiredResult'— Public method onDirectClient.complete(self, reference: '_Any', argument: '_Mapping[str, str]', context_arguments: '_Mapping[str, str] | None' = None) -> 'CompletionResult'— Public method onDirectClient.subscribe_resource(self, uri: 'str', *, meta: '_Any' = None) -> 'EmptyResult'— Public method onDirectClient.unsubscribe_resource(self, uri: 'str', *, meta: '_Any' = None) -> 'EmptyResult'— Public method onDirectClient.ping(self, *, meta: '_Any' = None) -> 'EmptyResult'— Public method onDirectClient.set_logging_level(self, level: 'str', *, meta: '_Any' = None) -> 'EmptyResult'— Public method onDirectClient.send_progress_notification(self, progress_token: 'str | int', progress: 'float', total: 'float | None' = None, message: 'str | None' = None, *, meta: '_Any' = None) -> 'None'— Public method onDirectClient.send_notification(self, notification: '_Any') -> 'None'— Public method onDirectClient.send_roots_list_changed(self) -> 'None'— Public method onDirectClient.register_callbacks(self, **callbacks: '_Any') -> '_NoReturn'— Public method onDirectClient.
ExecutionHandle
m3.sync_api.ExecutionHandle(portal: '_SyncPortal', identifier: 'int') -> 'None'
Blocking twin of :class:AsyncExecutionHandle with no async leakage.
Public fields and methods:
snapshot(self) -> '_ExecutionState'— Public method onExecutionHandle.pending_elicitation(self) -> 'PendingElicitationRound | None'— Public method onExecutionHandle.respond_elicitation(self, round_id: 'str', responses: '_Mapping[str, ElicitationResponse]', *, idempotency_key: 'str') -> 'None'— Public method onExecutionHandle.result(self, timeout: 'float | None' = None) -> '_ExecutionResult'— Public method onExecutionHandle.cancel(self) -> 'None'— Public method onExecutionHandle.events(self, *, after_sequence: 'int' = -1) -> '_Iterator[_Event]'— Public method onExecutionHandle.on_event(self, callback: '_Callable[[_Event], _Any]') -> '_Callable[[], None]'— Public method onExecutionHandle.
PromptInfo
m3.sync_api.PromptInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, arguments: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.arguments: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
ResourceInfo
m3.sync_api.ResourceInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None, size: Annotated[int | None, Ge(ge=0)] = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.size: int | None; defaultNone— Stored and validated as part of this public value.
TemplateInfo
m3.sync_api.TemplateInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri_template: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri_template: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.
ToolInfo
m3.sync_api.ToolInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, input_schema: collections.abc.Mapping[str, typing.Any] | bool = <factory>, output_schema: collections.abc.Mapping[str, typing.Any] | bool | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.input_schema: collections.abc.Mapping[str, typing.Any] | bool; required — Stored and validated as part of this public value.output_schema: collections.abc.Mapping[str, typing.Any] | bool | None; defaultNone— Stored and validated as part of this public value.
EmptyResult
m3.sync_api.EmptyResult(*, raw: Any = None, result_type: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.result_type: str | None; defaultNone— Stored and validated as part of this public value.
GetPromptResult
m3.sync_api.GetPromptResult(*, raw: Any = None, description: str | None = None, messages: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.messages: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
InitializationResult
m3.sync_api.InitializationResult(*, raw: Any = None, protocol_version: str, server_info: collections.abc.Mapping[str, typing.Any], instructions: str | None = None, capabilities: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.protocol_version: <class 'str'>; required — Stored and validated as part of this public value.server_info: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.instructions: str | None; defaultNone— Stored and validated as part of this public value.capabilities: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
InputRequiredResult
m3.sync_api.InputRequiredResult(*, raw: Any = None, result_type: Literal['input_required'] = 'input_required', input_requests: collections.abc.Mapping[str, typing.Any] | None = None, request_state: str | None = None) -> None
Official MCP interactive result, preserved instead of coercing empty data.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.result_type: typing.Literal['input_required']; default'input_required'— Stored and validated as part of this public value.input_requests: collections.abc.Mapping[str, typing.Any] | None; defaultNone— Stored and validated as part of this public value.request_state: str | None; defaultNone— Stored and validated as part of this public value.
ListPromptsResult
m3.sync_api.ListPromptsResult(*, raw: Any = None, prompts: tuple[m3.types.PromptInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.prompts: tuple[m3.types.PromptInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ListResourcesResult
m3.sync_api.ListResourcesResult(*, raw: Any = None, resources: tuple[m3.types.ResourceInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resources: tuple[m3.types.ResourceInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ListResourceTemplatesResult
m3.sync_api.ListResourceTemplatesResult(*, raw: Any = None, resource_templates: tuple[m3.types.TemplateInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resource_templates: tuple[m3.types.TemplateInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ListToolsResult
m3.sync_api.ListToolsResult(*, raw: Any = None, tools: tuple[m3.types.ToolInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.tools: tuple[m3.types.ToolInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
MCPTestKit
m3.sync_api.MCPTestKit(config: 'Config | _Mapping[str, _Any] | None' = None, *, env: '_Mapping[str, str] | None' = None, cwd: 'str | _Path | None' = None, probe_timeout_seconds: 'float' = 5.0, probe_output_limit: 'int' = 65536, store: '_ExecutionStore | None' = None, embedded_worker: 'bool' = True, adapter_registry: '_HarnessAdapterRegistry | None' = None, run_id: '_RunId | str | None' = None, suite_name: 'str | None' = None, project_id: '_ProjectId | str | None' = None, record_checks: 'bool' = False, max_judge_requests: 'int | None' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'None'
Lifecycle-safe synchronous configuration and capability shell.
Public fields and methods:
get_trace(self, execution_id: '_ExecutionId | str') -> '_TraceResult'— Return the finalized stable trace for an execution.get_trace_view(self, execution_id: '_ExecutionId | str') -> 'TraceView'— Return the finalized typed trace view for an execution.read_raw_evidence(self, reference: '_EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Read bounded, redacted raw evidence by its durable reference.close(self) -> 'None'— Close the shell; repeated calls are intentionally harmless.capabilities(self, requests: '_Iterable[ProbeRequest]' = ()) -> 'ProbeReport'— Return the baseline or exactly the explicitly requested probes.register_evaluator(self, name: 'str', evaluator: '_EvaluatorCallable') -> 'None'— Register an evaluator callback by its serializable name.evaluate(self, subject: '_Any', evaluator: 'str | _EvaluatorCallable', *, required: 'bool' = False, goal: 'str | None' = None, trace: '_Any' = None, artifacts: '_Any' = (), metadata: '_Mapping[str, str | int | float | bool | None] | None' = None, execution_id: '_Any' = None, turn_id: '_Any' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Run and persist one evaluation without changing lifecycle.judge_response(self, *, name: 'str', input: 'str', actual: 'str', expected: 'str', judge: '_LLMJudge', required: 'bool' = False, execution_id: '_Any' = None, turn_id: '_Any' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Judge one response and persist the result through this kit's runner.evaluation_results(self) -> 'tuple[_EvaluationResult, ...]'— Public method onMCPTestKit.agents(self, selections: '_Any', *, trials: 'int' = 1) -> 'tuple[_Any, ...]'— Expand ordered agent dictionaries without starting any I/O.run(self, spec: '_DirectSpec | _AgentSpec') -> '_ExecutionResult'— Public method onMCPTestKit.submit(self, spec: '_ExecutionSpec', *, human_input: '_HumanInput' = 'fail') -> 'ExecutionHandle'— Public method onMCPTestKit.direct(self, server: '_ServerValue | _ServerBinding', *, protocol: 'object | None' = None, timeout: 'float | None' = None, validate_schemas: 'bool' = False, secret_resolver: '_Any' = None, bearer_token: '_Any' = None, auth: '_Any' = None, for_agent: 'bool' = False, resolve_host: '_Any' = None, raise_server_exceptions: 'bool' = True, sampling_callback: '_Any' = None, elicitation_callback: '_RemovedElicitationCallback' = <m3.direct_client._RemovedElicitationCallback object>, list_roots_callback: '_Any' = None, logging_callback: '_Any' = None, message_handler: '_Any' = None, client_info: '_Any' = None, log_level: '_Any' = None, sampling_capabilities: '_Any' = None, result_claims: '_Any' = None, extensions: '_Mapping[str, _Mapping[str, _Any]] | None' = None, notification_bindings: '_Iterable[_Any] | None' = None, dispatcher: '_Any' = None, trace_bridge: '_Any' = None, trace_owner: 'bool' = True, workspace_root: 'str | None' = None) -> 'DirectClient'— Public method onMCPTestKit.agent_session(self, spec: '_AgentSpec', *, adapter: '_AgentAdapter | None' = None, runtime_servers: '_Iterable[_Any]' = (), interaction_handlers: 'InteractionHandlers | None' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'AgentSession'— Public method onMCPTestKit.
ProbeEvidence
m3.sync_api.ProbeEvidence(*, kind: m3.services.probes.ProbeKind, target: Annotated[str, MinLen(min_length=1), MaxLen(max_length=512)], command: tuple[str, ...] = (), resolved_executable: str | None = None, detected_version: str | None = None, protocol_version: str | None = None, output: Annotated[str, MaxLen(max_length=65536)] = '', details: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Safe evidence collected by one probe.
Public fields and methods:
kind: <enum 'ProbeKind'>; required — Stored and validated as part of this public value.target: <class 'str'>; required — Stored and validated as part of this public value.command: tuple[str, ...]; default()— Stored and validated as part of this public value.resolved_executable: str | None; defaultNone— Stored and validated as part of this public value.detected_version: str | None; defaultNone— Stored and validated as part of this public value.protocol_version: str | None; defaultNone— Stored and validated as part of this public value.output: <class 'str'>; default''— Stored and validated as part of this public value.details: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
ProbeKind
m3.sync_api.ProbeKind(*values)
The independently requestable capability categories.
ProbeReport
m3.sync_api.ProbeReport(*, readiness: m3.types.Readiness, results: tuple[m3.services.probes.ProbeResult, ...] = ()) -> None
Aggregate readiness for exactly the requested probes.
Public fields and methods:
readiness: <class 'm3.types.Readiness'>; required — Stored and validated as part of this public value.results: tuple[m3.services.probes.ProbeResult, ...]; default()— Stored and validated as part of this public value.result_for(self, name: 'str') -> 'ProbeResult | None'— Return the result fornamewithout guessing another target.
ProbeRequest
m3.sync_api.ProbeRequest(kind: 'ProbeKind', name: 'str', executable: 'str | None' = None, args: 'tuple[str, ...]' = (), env: 'Mapping[str, str] | None' = None, module: 'str | None' = None, transport: 'str | None' = None, timeout_seconds: 'float | None' = None) -> None
Typed request used by :meth:Probes.probe_requested.
ProbeResult
m3.sync_api.ProbeResult(*, capability: m3.types.Capability, evidence: m3.services.probes.ProbeEvidence) -> None
One capability result and its separately inspectable evidence.
Public fields and methods:
capability: <class 'm3.types.Capability'>; required — Stored and validated as part of this public value.evidence: <class 'm3.services.probes.ProbeEvidence'>; required — Stored and validated as part of this public value.
PromptResult
m3.sync_api.PromptResult(*, raw: Any = None, description: str | None = None, messages: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.messages: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
ResourceReadResult
m3.sync_api.ResourceReadResult(*, raw: Any = None, contents: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.contents: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
ToolCallResult
m3.sync_api.ToolCallResult(*, raw: Any = None, content: tuple[collections.abc.Mapping[str, typing.Any], ...] = (), structured_content: Any = None, is_error: bool = False) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.content: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.structured_content: typing.Any; defaultNone— Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
Tool
m3.sync_api.Tool(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, input_schema: collections.abc.Mapping[str, typing.Any] | bool = <factory>, output_schema: collections.abc.Mapping[str, typing.Any] | bool | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.input_schema: collections.abc.Mapping[str, typing.Any] | bool; required — Stored and validated as part of this public value.output_schema: collections.abc.Mapping[str, typing.Any] | bool | None; defaultNone— Stored and validated as part of this public value.
Resource
m3.sync_api.Resource(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None, size: Annotated[int | None, Ge(ge=0)] = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.size: int | None; defaultNone— Stored and validated as part of this public value.
ResourceTemplate
m3.sync_api.ResourceTemplate(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri_template: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None) -> None
Public class in m3.sync_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri_template: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.
load_config
m3.sync_api.load_config(explicit: '_Mapping[str, _Any] | None' = None, *, env: '_Mapping[str, str] | None' = None, cwd: 'str | _Path | None' = None, artifact_policy: '_Any' = <object object>, protocol_revision: '_Any' = <object object>, telemetry_enabled: '_Any' = <object object>) -> 'Config'
Resolve SDK settings using explicit, environment, project, default order.
AllowedCommands
m3.sync_api.AllowedCommands(*, allowed_executables: 'Sequence[str]', root: 'str | Path', environment: 'Mapping[str, str] | None' = None, allowed_environment: 'Sequence[str]' = ()) -> 'None'
Safe argv-only terminal handler with cwd, timeout, and output bounds.
FilesystemHandler
m3.sync_api.FilesystemHandler(*args, **kwargs)
Public class in m3.sync_api.
FilesystemRequest
m3.sync_api.FilesystemRequest(operation: 'FilesystemOperation', path: 'str', data: 'bytes | None' = None, max_bytes: 'int' = 1048576) -> None
FilesystemRequest(operation: 'FilesystemOperation', path: 'str', data: 'bytes | None' = None, max_bytes: 'int' = 1048576)
FilesystemResult
m3.sync_api.FilesystemResult(allowed: 'bool', data: 'bytes | tuple[str, ...] | None', receipt: 'InteractionReceipt') -> None
FilesystemResult(allowed: 'bool', data: 'bytes | tuple[str, ...] | None', receipt: 'InteractionReceipt')
Interactions
m3.sync_api.Interactions(*, permission_policy: 'PermissionPolicy | None' = None, sampling_policy: 'SamplingPolicy | None' = None, filesystem_policy: 'FilesystemPolicy | None' = None, terminal_policy: 'TerminalPolicy | None' = None, handlers: 'InteractionHandlers | None' = None) -> 'None'
Apply immutable policies around explicit interaction callbacks.
Public fields and methods:
receipts(self) -> 'tuple[InteractionReceipt, ...]'— Public method onInteractions.permission(self, request: 'PermissionRequest') -> 'PermissionResult'— Public method onInteractions.sample(self, request: 'SamplingRequest') -> 'SamplingResult'— Public method onInteractions.filesystem(self, request: 'FilesystemRequest') -> 'FilesystemResult'— Public method onInteractions.terminal(self, request: 'TerminalRequest') -> 'TerminalResult'— Public method onInteractions.
InteractionHandlers
m3.sync_api.InteractionHandlers(permission: 'PermissionCallback | None' = None, sampling: 'SamplingCallback | None' = None, filesystem: 'FilesystemHandler | None' = None, terminal: 'TerminalHandler | None' = None) -> None
Optional callbacks; absent callbacks are always default-deny.
InteractionReceipt
m3.sync_api.InteractionReceipt(request_id: 'str', kind: 'str', decision: 'Decision', reason: 'str', timestamp: 'datetime' = <factory>) -> None
Safe decision evidence; request values and handler errors are excluded.
PermissionRequest
m3.sync_api.PermissionRequest(operation: 'str', resource: 'str' = '', destructive: 'bool' = False) -> None
PermissionRequest(operation: 'str', resource: 'str' = '', destructive: 'bool' = False)
PermissionResult
m3.sync_api.PermissionResult(allowed: 'bool', receipt: 'InteractionReceipt', confirmation_required: 'bool' = False) -> None
PermissionResult(allowed: 'bool', receipt: 'InteractionReceipt', confirmation_required: 'bool' = False)
PermissionHandler
m3.sync_api.PermissionHandler(*args, **kwargs)
Public class in m3.sync_api.
SamplingRequest
m3.sync_api.SamplingRequest(prompt: 'str', model: 'str | None' = None, metadata: 'Mapping[str, str | int | float | bool | None]' = <factory>) -> None
SamplingRequest(prompt: 'str', model: 'str | None' = None, metadata: 'Mapping[str, str | int | float | bool | None]' = <factory>)
SamplingResult
m3.sync_api.SamplingResult(accepted: 'bool', content: 'str | None', receipt: 'InteractionReceipt') -> None
SamplingResult(accepted: 'bool', content: 'str | None', receipt: 'InteractionReceipt')
SamplingHandler
m3.sync_api.SamplingHandler(*args, **kwargs)
Public class in m3.sync_api.
TerminalHandler
m3.sync_api.TerminalHandler(*args, **kwargs)
Public class in m3.sync_api.
TerminalRequest
m3.sync_api.TerminalRequest(argv: 'tuple[str, ...]', cwd: 'str | None' = None, environment: 'Mapping[str, str]' = <factory>, timeout_seconds: 'float' = 30.0, max_output_bytes: 'int' = 1048576) -> None
TerminalRequest(argv: 'tuple[str, ...]', cwd: 'str | None' = None, environment: 'Mapping[str, str]' = <factory>, timeout_seconds: 'float' = 30.0, max_output_bytes: 'int' = 1048576)
TerminalResult
m3.sync_api.TerminalResult(allowed: 'bool', returncode: 'int | None', stdout: 'bytes', stderr: 'bytes', timed_out: 'bool', truncated: 'bool', receipt: 'InteractionReceipt') -> None
TerminalResult(allowed: 'bool', returncode: 'int | None', stdout: 'bytes', stderr: 'bytes', timed_out: 'bool', truncated: 'bool', receipt: 'InteractionReceipt')
WorkspaceFiles
m3.sync_api.WorkspaceFiles(root: 'str | Path', *, mode: "Literal['read_only', 'read_write']" = 'read_only', max_bytes: 'int' = 1048576) -> 'None'
Bounded filesystem handler rooted inside one owned workspace.
ElicitationPlan
m3.sync_api.ElicitationPlan(*, node: Literal['leaf', 'sequence', 'optional', 'one_of', 'round_of'] = 'leaf', request: Optional[Annotated[m3.elicitation._FormExpectation | m3.elicitation._UrlExpectation, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]] = None, response: m3.elicitation.ElicitationResponse | None = None, children: tuple[m3.elicitation.ElicitationPlan, ...] = (), optional_occurrence: bool = False) -> None
An immutable, serializable elicitation expectation tree.
Public fields and methods:
node: typing.Literal['leaf', 'sequence', 'optional', 'one_of', 'round_of']; default'leaf'— Stored and validated as part of this public value.request: typing.Optional[typing.Annotated[m3.elicitation._FormExpectation | m3.elicitation._UrlExpectation, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]]; defaultNone— Stored and validated as part of this public value.response: m3.elicitation.ElicitationResponse | None; defaultNone— Stored and validated as part of this public value.children: tuple[m3.elicitation.ElicitationPlan, ...]; default()— Stored and validated as part of this public value.optional_occurrence: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.accept(self, content: 'Mapping[str, object] | None' = None) -> 'ElicitationPlan'— Public method onElicitationPlan.decline(self) -> 'ElicitationPlan'— Public method onElicitationPlan.cancel(self) -> 'ElicitationPlan'— Public method onElicitationPlan.canonical_identity(self) -> 'str'— Public method onElicitationPlan.canonical_json(self) -> 'str'— Public method onElicitationPlan.model_dump(self, *args: 'Any', **kwargs: 'Any') -> 'dict[str, Any]'— Public method onElicitationPlan.model_dump_json(self, *args: 'Any', **kwargs: 'Any') -> 'str'— Public method onElicitationPlan.matcher(self) -> 'PlanMatcher'— Public method onElicitationPlan.
ElicitationResponse
m3.sync_api.ElicitationResponse(*, action: Literal['accept', 'decline', 'cancel'], content: collections.abc.Mapping[str, object] | None = None, meta: collections.abc.Mapping[str, object] | None = None) -> None
The response that will be associated with one request key.
Public fields and methods:
action: typing.Literal['accept', 'decline', 'cancel']; required — Stored and validated as part of this public value.content: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.
FormElicitationRequest
m3.sync_api.FormElicitationRequest(*, request_key: Annotated[str, MinLen(min_length=1)], mode: Literal['form'] = 'form', message: str, requested_schema: collections.abc.Mapping[str, object], meta: collections.abc.Mapping[str, object] | None = None, task: collections.abc.Mapping[str, object] | None = None, server: str | None = None, operation_kind: Optional[Literal['tool', 'prompt', 'resource']] = None, operation_name: str | None = None) -> None
A normalized form-mode elicitation request.
Public fields and methods:
request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['form']; default'form'— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.requested_schema: collections.abc.Mapping[str, object]; required — Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.task: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['tool', 'prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: str | None; defaultNone— Stored and validated as part of this public value.
PendingElicitationRound
m3.sync_api.PendingElicitationRound(*, round_id: Annotated[str, MinLen(min_length=1)], execution_id: Annotated[str, MinLen(min_length=1)], logical_operation_id: Annotated[str, MinLen(min_length=1)], server: Annotated[str, MinLen(min_length=1)], operation_kind: Literal['tool', 'prompt', 'resource'], operation_name: Annotated[str, MinLen(min_length=1)], request_state: str | None = None, requests: collections.abc.Mapping[str, typing.Annotated[m3.elicitation.FormElicitationRequest | m3.elicitation.UrlElicitationRequest, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]], created_at: datetime.datetime, deadline: datetime.datetime | None = None) -> None
A persisted, keyed set of elicitation requests awaiting responses.
Public fields and methods:
round_id: <class 'str'>; required — Stored and validated as part of this public value.execution_id: <class 'str'>; required — Stored and validated as part of this public value.logical_operation_id: <class 'str'>; required — Stored and validated as part of this public value.server: <class 'str'>; required — Stored and validated as part of this public value.operation_kind: typing.Literal['tool', 'prompt', 'resource']; required — Stored and validated as part of this public value.operation_name: <class 'str'>; required — Stored and validated as part of this public value.request_state: str | None; defaultNone— Stored and validated as part of this public value.requests: collections.abc.Mapping[str, typing.Annotated[m3.elicitation.FormElicitationRequest | m3.elicitation.UrlElicitationRequest, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]]; required — Stored and validated as part of this public value.created_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.deadline: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.
UrlElicitationRequest
m3.sync_api.UrlElicitationRequest(*, request_key: Annotated[str, MinLen(min_length=1)], mode: Literal['url'] = 'url', message: str, url: str, elicitation_id: str | None = None, meta: collections.abc.Mapping[str, object] | None = None, task: collections.abc.Mapping[str, object] | None = None, server: str | None = None, operation_kind: Optional[Literal['tool', 'prompt', 'resource']] = None, operation_name: str | None = None) -> None
A normalized URL-mode elicitation request.
Public fields and methods:
request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['url']; default'url'— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.url: <class 'str'>; required — Stored and validated as part of this public value.elicitation_id: str | None; defaultNone— Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.task: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['tool', 'prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: str | None; defaultNone— Stored and validated as part of this public value.
expect_form
m3.sync_api.expect_form(request_key: 'str', *, message: 'str | None' = None, schema: 'Mapping[str, object] | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.sync_api.
expect_url
m3.sync_api.expect_url(request_key: 'str', *, message: 'str | None' = None, url: 'str | None' = None, elicitation_id: 'str | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.sync_api.
maybe_form
m3.sync_api.maybe_form(request_key: 'str', *, message: 'str | None' = None, schema: 'Mapping[str, object] | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.sync_api.
maybe_url
m3.sync_api.maybe_url(request_key: 'str', *, message: 'str | None' = None, url: 'str | None' = None, elicitation_id: 'str | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.sync_api.
one_of
m3.sync_api.one_of(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.sync_api.
optional
m3.sync_api.optional(child: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.sync_api.
round_of
m3.sync_api.round_of(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.sync_api.
sequence
m3.sync_api.sequence(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.sync_api.
ACPTrace
m3.sync_api.ACPTrace(*, kind: Literal['acp'] = 'acp', session_id: m3.observability.Observation[str] = <factory>, protocol_version: m3.observability.Observation[str] = <factory>, agent_identity: m3.observability.Observation[JsonValue] = <factory>, available_modes: m3.observability.Observation[JsonValue] = <factory>, current_mode: m3.observability.Observation[str] = <factory>, config_options: m3.observability.Observation[JsonValue] = <factory>, selected_config: m3.observability.Observation[JsonValue] = <factory>, plan_state_available: m3.observability.Observation[bool] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
kind: typing.Literal['acp']; default'acp'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.agent_identity: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.available_modes: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.current_mode: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.config_options: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.selected_config: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.plan_state_available: <class 'm3.observability.Observation[bool]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
ArtifactEntry
m3.sync_api.ArtifactEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['artifact'] = 'artifact', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), artifact: m3.types.ArtifactRef) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['artifact']; default'artifact'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.artifact: <class 'm3.types.ArtifactRef'>; required — Stored and validated as part of this public value.
CaptureOptions
m3.sync_api.CaptureOptions(*, capture_raw_evidence: bool = True, capture_provider_messages: bool = True, capture_stderr: bool = True, raw_preview_bytes: Annotated[int, Gt(gt=0)] = 65536, raw_frame_bytes: Annotated[int, Gt(gt=0)] = 1048576, raw_execution_bytes: Annotated[int, Gt(gt=0)] = 67108864) -> None
Boundaries for redacted provider/MCP evidence capture.
Public fields and methods:
capture_raw_evidence: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.capture_provider_messages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.capture_stderr: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.raw_preview_bytes: <class 'int'>; default65536— Stored and validated as part of this public value.raw_frame_bytes: <class 'int'>; default1048576— Stored and validated as part of this public value.raw_execution_bytes: <class 'int'>; default67108864— Stored and validated as part of this public value.
ClaudeCodeTrace
m3.sync_api.ClaudeCodeTrace(*, kind: Literal['claude_code'] = 'claude_code', session_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, result_subtype: m3.observability.Observation[str] = <factory>, stop_reason: m3.observability.Observation[str] = <factory>, service_tier: m3.observability.Observation[str] = <factory>, api_duration_ms: m3.observability.Observation[float] = <factory>, encrypted_reasoning: m3.observability.Observation[bool] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
kind: typing.Literal['claude_code']; default'claude_code'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.result_subtype: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.stop_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.service_tier: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.api_duration_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.encrypted_reasoning: <class 'm3.observability.Observation[bool]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
CodexTrace
m3.sync_api.CodexTrace(*, kind: Literal['codex'] = 'codex', thread_id: m3.observability.Observation[str] = <factory>, turn_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, sandbox: m3.observability.Observation[str] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
kind: typing.Literal['codex']; default'codex'— Stored and validated as part of this public value.thread_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.turn_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.sandbox: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
CorrelationState
m3.sync_api.CorrelationState(*values)
Public class in m3.sync_api.
DiagnosticEntry
m3.sync_api.DiagnosticEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['diagnostic'] = 'diagnostic', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), code: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], message: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], stage: Annotated[str | None, MaxLen(max_length=128)] = None, operation: Annotated[str | None, MaxLen(max_length=256)] = None, elapsed_seconds: Annotated[float | None, Ge(ge=0)] = None, timeout_seconds: Annotated[float | None, Gt(gt=0)] = None) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['diagnostic']; default'diagnostic'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.code: <class 'str'>; required — Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.stage: str | None; defaultNone— Stored and validated as part of this public value.operation: str | None; defaultNone— Stored and validated as part of this public value.elapsed_seconds: float | None; defaultNone— Stored and validated as part of this public value.timeout_seconds: float | None; defaultNone— Stored and validated as part of this public value.
DirectTrace
m3.sync_api.DirectTrace(*, kind: Literal['direct'] = 'direct', transport: m3.observability.Observation[TransportKind] = <factory>, protocol: m3.observability.Observation[str] = <factory>, initialization: m3.observability.Observation[InitializationValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
kind: typing.Literal['direct']; default'direct'— Stored and validated as part of this public value.transport: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.protocol: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.initialization: <class 'm3.observability.Observation[InitializationValue]'>; required — Stored and validated as part of this public value.
ElicitationEntry
m3.sync_api.ElicitationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['elicitation'] = 'elicitation', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, operation_kind: Literal['tool', 'prompt', 'resource'], operation_name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], logical_operation_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], round_index: Annotated[int, Ge(ge=1)], request_key: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], mode: Literal['form', 'url'], message: m3.observability.Observation[str] = <factory>, requested_schema: m3.observability.Observation[JsonValue] = <factory>, url: m3.observability.Observation[str] = <factory>, elicitation_id: m3.observability.Observation[str] = <factory>, request_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, action: Optional[Literal['accept', 'decline', 'cancel']] = None, content: m3.observability.Observation[JsonValue] = <factory>) -> None
One keyed elicitation embedded in an MRTR input-required round.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['elicitation']; default'elicitation'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Literal['tool', 'prompt', 'resource']; required — Stored and validated as part of this public value.operation_name: <class 'str'>; required — Stored and validated as part of this public value.logical_operation_id: <class 'str'>; required — Stored and validated as part of this public value.round_index: <class 'int'>; required — Stored and validated as part of this public value.request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['form', 'url']; required — Stored and validated as part of this public value.message: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.requested_schema: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.url: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.elicitation_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.action: typing.Optional[typing.Literal['accept', 'decline', 'cancel']]; defaultNone— Stored and validated as part of this public value.content: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
EvaluationEntry
m3.sync_api.EvaluationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['evaluation'] = 'evaluation', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), evaluation: m3.types.EvaluationResult) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['evaluation']; default'evaluation'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.evaluation: <class 'm3.types.EvaluationResult'>; required — Stored and validated as part of this public value.
EvidenceCapture
m3.sync_api.EvidenceCapture(*, reference: m3.types.EvidenceRef, preview: m3.observability.Observation[str], original_size_bytes: Annotated[int, Ge(ge=0)], stored_size_bytes: Annotated[int, Ge(ge=0)], redacted: bool, truncated: bool) -> None
Typed result of bounded, redacted raw-evidence capture.
Public fields and methods:
reference: <class 'm3.types.EvidenceRef'>; required — Stored and validated as part of this public value.preview: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.original_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.stored_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.redacted: <class 'bool'>; required — Stored and validated as part of this public value.truncated: <class 'bool'>; required — Stored and validated as part of this public value.
EvidenceConflict
m3.sync_api.EvidenceConflict(*, field: Literal['server', 'tool', 'arguments', 'result', 'status'], reported: m3.observability.Observation[JsonValue], wire: m3.observability.Observation[JsonValue]) -> None
Public class in m3.sync_api.
Public fields and methods:
field: typing.Literal['server', 'tool', 'arguments', 'result', 'status']; required — Stored and validated as part of this public value.reported: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.wire: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
HttpExchange
m3.sync_api.HttpExchange(*, method: Annotated[str, MinLen(min_length=1)], status_code: Annotated[int, Ge(ge=100), Le(le=599)], headers: tuple[m3.observability.SafeHttpHeader, ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
method: <class 'str'>; required — Stored and validated as part of this public value.status_code: <class 'int'>; required — Stored and validated as part of this public value.headers: tuple[m3.observability.SafeHttpHeader, ...]; default()— Stored and validated as part of this public value.
InitializationEntry
m3.sync_api.InitializationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['initialization'] = 'initialization', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), protocol_version: m3.observability.Observation[str] = <factory>, server_name: m3.observability.Observation[str] = <factory>, server_version: m3.observability.Observation[str] = <factory>, instructions: m3.observability.Observation[str] = <factory>, capabilities: m3.observability.Observation[JsonValue] = <factory>, tools: m3.observability.Observation[tuple[ToolInfo, ...]] = <factory>, resources: m3.observability.Observation[tuple[ResourceInfo, ...]] = <factory>, resource_templates: m3.observability.Observation[tuple[TemplateInfo, ...]] = <factory>, prompts: m3.observability.Observation[tuple[PromptInfo, ...]] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['initialization']; default'initialization'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.instructions: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.capabilities: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.tools: <class 'm3.observability.Observation[tuple[ToolInfo, ...]]'>; required — Stored and validated as part of this public value.resources: <class 'm3.observability.Observation[tuple[ResourceInfo, ...]]'>; required — Stored and validated as part of this public value.resource_templates: <class 'm3.observability.Observation[tuple[TemplateInfo, ...]]'>; required — Stored and validated as part of this public value.prompts: <class 'm3.observability.Observation[tuple[PromptInfo, ...]]'>; required — Stored and validated as part of this public value.
InitializationValue
m3.sync_api.InitializationValue(*, protocol_version: m3.observability.Observation[str] = <factory>, server_name: m3.observability.Observation[str] = <factory>, server_version: m3.observability.Observation[str] = <factory>, instructions: m3.observability.Observation[str] = <factory>, capabilities: m3.observability.Observation[JsonValue] = <factory>, tools: m3.observability.Observation[tuple[ToolInfo, ...]] = <factory>, resources: m3.observability.Observation[tuple[ResourceInfo, ...]] = <factory>, resource_templates: m3.observability.Observation[tuple[TemplateInfo, ...]] = <factory>, prompts: m3.observability.Observation[tuple[PromptInfo, ...]] = <factory>) -> None
Value-only initialization metadata used by runtime information.
Public fields and methods:
protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.instructions: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.capabilities: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.tools: <class 'm3.observability.Observation[tuple[ToolInfo, ...]]'>; required — Stored and validated as part of this public value.resources: <class 'm3.observability.Observation[tuple[ResourceInfo, ...]]'>; required — Stored and validated as part of this public value.resource_templates: <class 'm3.observability.Observation[tuple[TemplateInfo, ...]]'>; required — Stored and validated as part of this public value.prompts: <class 'm3.observability.Observation[tuple[PromptInfo, ...]]'>; required — Stored and validated as part of this public value.
InteractionEntry
m3.sync_api.InteractionEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['interaction'] = 'interaction', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), interaction_kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], request: m3.observability.Observation[JsonValue] = <factory>, response: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['interaction']; default'interaction'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.interaction_kind: <class 'str'>; required — Stored and validated as part of this public value.request: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.response: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
LifecycleEntry
m3.sync_api.LifecycleEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['lifecycle'] = 'lifecycle', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), phase: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)]) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['lifecycle']; default'lifecycle'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.phase: <class 'str'>; required — Stored and validated as part of this public value.
MessageEntry
m3.sync_api.MessageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['message'] = 'message', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), message_id: m3.observability.Observation[str] = <factory>, role: m3.observability.MessageRole = <MessageRole.ASSISTANT: 'assistant'>, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = (), stop_reason: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['message']; default'message'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.message_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.role: <enum 'MessageRole'>; default<MessageRole.ASSISTANT: 'assistant'>— Stored and validated as part of this public value.content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.stop_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
MessageRole
m3.sync_api.MessageRole(*values)
Public class in m3.sync_api.
Observation
m3.sync_api.Observation(*, state: m3.observability.ObservationState, value: Optional[~_T] = None, reason: m3.observability.ObservationReason | None = None, provenance: tuple[m3.types.EventSource, ...] = (), evidence_ref: m3.types.EvidenceRef | None = None) -> None
A typed value with explicit availability and provenance.
Public fields and methods:
state: <enum 'ObservationState'>; required — Stored and validated as part of this public value.value: typing.Optional[~_T]; defaultNone— Stored and validated as part of this public value.reason: m3.observability.ObservationReason | None; defaultNone— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.evidence_ref: m3.types.EvidenceRef | None; defaultNone— Stored and validated as part of this public value.
ObservationReason
m3.sync_api.ObservationReason(*values)
Public class in m3.sync_api.
ObservationState
m3.sync_api.ObservationState(*values)
How completely a provider-dependent value was observed.
OpenCodeTrace
m3.sync_api.OpenCodeTrace(*, kind: Literal['opencode'] = 'opencode', session_id: m3.observability.Observation[str] = <factory>, provider_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, http_lifecycle: m3.observability.Observation[JsonValue] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
kind: typing.Literal['opencode']; default'opencode'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.provider_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.http_lifecycle: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
PiTrace
m3.sync_api.PiTrace(*, kind: Literal['pi'] = 'pi', session_id: m3.observability.Observation[str] = <factory>, provider_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
kind: typing.Literal['pi']; default'pi'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.provider_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
ProcessEntry
m3.sync_api.ProcessEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['process'] = 'process', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), executable: m3.observability.Observation[str] = <factory>, pid: m3.observability.Observation[int] = <factory>, exit_code: m3.observability.Observation[int] = <factory>, signal: m3.observability.Observation[int] = <factory>, stderr: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['process']; default'process'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.executable: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.pid: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.exit_code: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.signal: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.stderr: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
ProtocolCallAttempt
m3.sync_api.ProtocolCallAttempt(*, attempt_index: Annotated[int, Ge(ge=0)], jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request_state: m3.observability.Observation[str] = <factory>, continuation_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, operation_params: m3.observability.Observation[JsonValue] = <factory>, input_required: bool = False, result: m3.observability.Observation[JsonValue] = <factory>, raw_result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.TraceStatus = <TraceStatus.INCOMPLETE: 'incomplete'>, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>) -> None
One wire-level attempt belonging to a prompt or resource call.
Public fields and methods:
attempt_index: <class 'int'>; required — Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.continuation_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.operation_params: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.input_required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.raw_result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.
ProtocolEntry
m3.sync_api.ProtocolEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['protocol'] = 'protocol', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), protocol: m3.observability.ProtocolKind, method: m3.observability.Observation[str] = <factory>, direction: m3.types.EventDirection = <EventDirection.INTERNAL: 'internal'>, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request: m3.observability.Observation[JsonValue] = <factory>, response: m3.observability.Observation[JsonValue] = <factory>, error: m3.observability.Observation[ProtocolErrorInfo] = <factory>, http: m3.observability.Observation[HttpExchange] = <factory>, operation_kind: Optional[Literal['prompt', 'resource']] = None, operation_name: m3.observability.Observation[str] = <factory>, attempts: tuple[m3.observability.ProtocolCallAttempt, ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['protocol']; default'protocol'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.protocol: <enum 'ProtocolKind'>; required — Stored and validated as part of this public value.method: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.direction: <enum 'EventDirection'>; default<EventDirection.INTERNAL: 'internal'>— Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.response: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.error: <class 'm3.observability.Observation[ProtocolErrorInfo]'>; required — Stored and validated as part of this public value.http: <class 'm3.observability.Observation[HttpExchange]'>; required — Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.attempts: tuple[m3.observability.ProtocolCallAttempt, ...]; default()— Stored and validated as part of this public value.
ProtocolErrorInfo
m3.sync_api.ProtocolErrorInfo(*, code: int | str | None = None, message: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], data: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
code: int | str | None; defaultNone— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.data: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
ProtocolKind
m3.sync_api.ProtocolKind(*values)
Public class in m3.sync_api.
ProviderEntry
m3.sync_api.ProviderEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['provider'] = 'provider', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), provider: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], category: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], data: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['provider']; default'provider'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.provider: <class 'str'>; required — Stored and validated as part of this public value.category: <class 'str'>; required — Stored and validated as part of this public value.data: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
RawEvidence
m3.sync_api.RawEvidence(*, reference: m3.types.EvidenceRef, media_type: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], content: Union[JsonValue, str], size_bytes: Annotated[int, Ge(ge=0)], returned_size_bytes: Annotated[int, Ge(ge=0)], truncated: bool = False, redacted: Literal[True] = True) -> None
Public class in m3.sync_api.
Public fields and methods:
reference: <class 'm3.types.EvidenceRef'>; required — Stored and validated as part of this public value.media_type: <class 'str'>; required — Stored and validated as part of this public value.content: typing.Union[JsonValue, str]; required — Stored and validated as part of this public value.size_bytes: <class 'int'>; required — Stored and validated as part of this public value.returned_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.truncated: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
RawEvidenceSource
m3.sync_api.RawEvidenceSource(*values)
Public class in m3.sync_api.
RawMessageEntry
m3.sync_api.RawMessageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['raw_message'] = 'raw_message', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), source: m3.observability.RawEvidenceSource, direction: m3.types.EventDirection = <EventDirection.INTERNAL: 'internal'>, media_type: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], preview: m3.observability.Observation[Union[JsonValue, str]] = <factory>, evidence_ref: m3.types.EvidenceRef | None = None, size_bytes: Annotated[int, Ge(ge=0)] = 0, redacted: Literal[True] = True) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['raw_message']; default'raw_message'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.source: <enum 'RawEvidenceSource'>; required — Stored and validated as part of this public value.direction: <enum 'EventDirection'>; default<EventDirection.INTERNAL: 'internal'>— Stored and validated as part of this public value.media_type: <class 'str'>; required — Stored and validated as part of this public value.preview: <class 'm3.observability.Observation[Union[JsonValue, str]]'>; required — Stored and validated as part of this public value.evidence_ref: m3.types.EvidenceRef | None; defaultNone— Stored and validated as part of this public value.size_bytes: <class 'int'>; default0— Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
ReasoningEntry
m3.sync_api.ReasoningEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['reasoning'] = 'reasoning', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), block_id: m3.observability.Observation[str] = <factory>, content: m3.observability.Observation[tuple[Annotated[Union[TextContent, FileContent, ImageContent, AudioContent, ResourceLink, OpaqueContent], FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['reasoning']; default'reasoning'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.block_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.content: <class 'm3.observability.Observation[tuple[Annotated[Union[TextContent, FileContent, ImageContent, AudioContent, ResourceLink, OpaqueContent], FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]]'>; required — Stored and validated as part of this public value.
ReportedToolCall
m3.sync_api.ReportedToolCall(*, provider_call_id: m3.observability.Observation[str] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
provider_call_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
RuntimeTraceInfo
m3.sync_api.RuntimeTraceInfo(*args, **kwargs)
Runtime representation of an annotated type.
SafeHttpHeader
m3.sync_api.SafeHttpHeader(*, name: Literal['content-type', 'content-length', 'retry-after', 'request-id', 'x-request-id'], value: str) -> None
Public class in m3.sync_api.
Public fields and methods:
name: typing.Literal['content-type', 'content-length', 'retry-after', 'request-id', 'x-request-id']; required — Stored and validated as part of this public value.value: <class 'str'>; required — Stored and validated as part of this public value.
ToolCallAttempt
m3.sync_api.ToolCallAttempt(*, attempt_index: Annotated[int, Ge(ge=0)], jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request_state: m3.observability.Observation[str] = <factory>, continuation_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, operation_params: m3.observability.Observation[JsonValue] = <factory>, input_required: bool = False, result: m3.observability.Observation[ToolResult] = <factory>, raw_result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.ToolCallStatus = <ToolCallStatus.INCOMPLETE: 'incomplete'>, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>) -> None
One wire-level attempt belonging to a logical tool call.
Public fields and methods:
attempt_index: <class 'int'>; required — Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.continuation_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.operation_params: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.input_required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.raw_result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <enum 'ToolCallStatus'>; default<ToolCallStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.
ToolCallEntry
m3.sync_api.ToolCallEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['tool_call'] = 'tool_call', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), call_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], provider_call_id: m3.observability.Observation[str] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[ToolResult] = <factory>, tool_status: m3.observability.ToolCallStatus = <ToolCallStatus.INCOMPLETE: 'incomplete'>, correlation: m3.observability.CorrelationState = <CorrelationState.UNAVAILABLE: 'unavailable'>, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, server_latency_ms: m3.observability.Observation[float] = <factory>, policy: m3.observability.Observation[ToolPolicyDecision] = <factory>, reported: m3.observability.Observation[ReportedToolCall] = <factory>, wire: m3.observability.Observation[WireToolCall] = <factory>, conflicts: tuple[m3.observability.EvidenceConflict, ...] = (), attempts: tuple[m3.observability.ToolCallAttempt, ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['tool_call']; default'tool_call'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.call_id: <class 'str'>; required — Stored and validated as part of this public value.provider_call_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.tool_status: <enum 'ToolCallStatus'>; default<ToolCallStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.correlation: <enum 'CorrelationState'>; default<CorrelationState.UNAVAILABLE: 'unavailable'>— Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.server_latency_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.policy: <class 'm3.observability.Observation[ToolPolicyDecision]'>; required — Stored and validated as part of this public value.reported: <class 'm3.observability.Observation[ReportedToolCall]'>; required — Stored and validated as part of this public value.wire: <class 'm3.observability.Observation[WireToolCall]'>; required — Stored and validated as part of this public value.conflicts: tuple[m3.observability.EvidenceConflict, ...]; default()— Stored and validated as part of this public value.attempts: tuple[m3.observability.ToolCallAttempt, ...]; default()— Stored and validated as part of this public value.
ToolCallStatus
m3.sync_api.ToolCallStatus(*values)
Public class in m3.sync_api.
ToolResult
m3.sync_api.ToolResult(*, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = (), structured_content: m3.observability.Observation[JsonValue] = <factory>, is_error: bool = False, error: m3.observability.Observation[ErrorInfo] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.structured_content: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.error: <class 'm3.observability.Observation[ErrorInfo]'>; required — Stored and validated as part of this public value.
TraceEntry
m3.sync_api.TraceEntry(*args, **kwargs)
Runtime representation of an annotated type.
TraceEntryBase
m3.sync_api.TraceEntryBase(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=64)], parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: <class 'str'>; required — Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.
TraceStatus
m3.sync_api.TraceStatus(*values)
Public class in m3.sync_api.
TraceSummary
m3.sync_api.TraceSummary(*, timing: m3.observability.TraceTiming = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>, turn_count: Annotated[int, Ge(ge=0)] = 0, message_count: Annotated[int, Ge(ge=0)] = 0, reasoning_count: Annotated[int, Ge(ge=0)] = 0, tool_call_count: Annotated[int, Ge(ge=0)] = 0, successful_tool_call_count: Annotated[int, Ge(ge=0)] = 0, failed_tool_call_count: Annotated[int, Ge(ge=0)] = 0, protocol_error_count: Annotated[int, Ge(ge=0)] = 0, activity_health: m3.types.ActivityHealth = <ActivityHealth.NO_CALLS: 'no_calls'>, cleanup_status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>) -> None
Public class in m3.sync_api.
Public fields and methods:
timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.turn_count: <class 'int'>; default0— Stored and validated as part of this public value.message_count: <class 'int'>; default0— Stored and validated as part of this public value.reasoning_count: <class 'int'>; default0— Stored and validated as part of this public value.tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.successful_tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.failed_tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.protocol_error_count: <class 'int'>; default0— Stored and validated as part of this public value.activity_health: <enum 'ActivityHealth'>; default<ActivityHealth.NO_CALLS: 'no_calls'>— Stored and validated as part of this public value.cleanup_status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.
TraceTiming
m3.sync_api.TraceTiming(*, started_at: datetime.datetime = <factory>, finished_at: datetime.datetime | None = None, start_offset_ms: Annotated[float, Ge(ge=0)] = 0, end_offset_ms: Annotated[float, Ge(ge=0)] = 0, duration_ms: Annotated[float, Ge(ge=0)] = 0) -> None
Public class in m3.sync_api.
Public fields and methods:
started_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.finished_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.start_offset_ms: <class 'float'>; default0— Stored and validated as part of this public value.end_offset_ms: <class 'float'>; default0— Stored and validated as part of this public value.duration_ms: <class 'float'>; default0— Stored and validated as part of this public value.
TraceView
m3.sync_api.TraceView(*, schema_id: Literal['m3.trace_view'] = 'm3.trace_view', schema_version: Literal['1.1', '1.2'] = '1.1', trace_id: m3.types.TraceId, execution_id: m3.types.ExecutionId, outcome: m3.types.ExecutionOutcome = <ExecutionOutcome.COMPLETED: 'completed'>, completeness: Literal['complete', 'partial'] = 'complete', limitations: tuple[str, ...] = (), agent: m3.types.AgentIdentity | None = None, runtime: m3.observability.DirectTrace | m3.observability.OpenCodeTrace | m3.observability.ClaudeCodeTrace | m3.observability.CodexTrace | m3.observability.PiTrace | m3.observability.ACPTrace = <factory>, summary: m3.observability.TraceSummary = <factory>, timeline: tuple[typing.Annotated[m3.observability.LifecycleEntry | m3.observability.MessageEntry | m3.observability.ReasoningEntry | m3.observability.ToolCallEntry | m3.observability.ProtocolEntry | m3.observability.TransportEntry | m3.observability.InitializationEntry | m3.observability.UsageEntry | m3.observability.InteractionEntry | m3.observability.ElicitationEntry | m3.observability.ProcessEntry | m3.observability.WorkspaceEntry | m3.observability.ArtifactEntry | m3.observability.EvaluationEntry | m3.observability.DiagnosticEntry | m3.observability.RawMessageEntry | m3.observability.ProviderEntry, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = ()) -> None
Public class in m3.sync_api.
Public fields and methods:
schema_id: typing.Literal['m3.trace_view']; default'm3.trace_view'— Stored and validated as part of this public value.schema_version: typing.Literal['1.1', '1.2']; default'1.1'— Stored and validated as part of this public value.trace_id: <class 'm3.types.TraceId'>; required — Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.outcome: <enum 'ExecutionOutcome'>; default<ExecutionOutcome.COMPLETED: 'completed'>— Stored and validated as part of this public value.completeness: typing.Literal['complete', 'partial']; default'complete'— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.agent: m3.types.AgentIdentity | None; defaultNone— Stored and validated as part of this public value.runtime: m3.observability.DirectTrace | m3.observability.OpenCodeTrace | m3.observability.ClaudeCodeTrace | m3.observability.CodexTrace | m3.observability.PiTrace | m3.observability.ACPTrace; required — Stored and validated as part of this public value.summary: <class 'm3.observability.TraceSummary'>; required — Stored and validated as part of this public value.timeline: tuple[typing.Annotated[m3.observability.LifecycleEntry | m3.observability.MessageEntry | m3.observability.ReasoningEntry | m3.observability.ToolCallEntry | m3.observability.ProtocolEntry | m3.observability.TransportEntry | m3.observability.InitializationEntry | m3.observability.UsageEntry | m3.observability.InteractionEntry | m3.observability.ElicitationEntry | m3.observability.ProcessEntry | m3.observability.WorkspaceEntry | m3.observability.ArtifactEntry | m3.observability.EvaluationEntry | m3.observability.DiagnosticEntry | m3.observability.RawMessageEntry | m3.observability.ProviderEntry, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.for_turn(self, turn: '_TurnResult | _TurnState | _TurnId | str') -> 'TraceView'— Return the finalized evidence belonging to one turn.for_session(self, session_id: '_SessionId | str') -> 'TraceView'— Public method onTraceView.for_server(self, server_binding: 'str') -> 'TraceView'— Public method onTraceView.between(self, start_offset_ms: 'float', end_offset_ms: 'float') -> 'TraceView'— Public method onTraceView.
TransportEntry
m3.sync_api.TransportEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['transport'] = 'transport', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), phase: Literal['connected', 'disconnected'], configured: m3.observability.Observation[TransportKind] = <factory>, instrumented: m3.observability.Observation[TransportKind] = <factory>) -> None
A stable MCP transport lifecycle observation.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['transport']; default'transport'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.phase: typing.Literal['connected', 'disconnected']; required — Stored and validated as part of this public value.configured: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.instrumented: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.
UsageEntry
m3.sync_api.UsageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['usage'] = 'usage', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), input_tokens: m3.observability.Observation[int] = <factory>, output_tokens: m3.observability.Observation[int] = <factory>, reasoning_tokens: m3.observability.Observation[int] = <factory>, cache_creation_tokens: m3.observability.Observation[int] = <factory>, cache_read_tokens: m3.observability.Observation[int] = <factory>, cache_write_tokens: m3.observability.Observation[int] = <factory>, total_tokens: m3.observability.Observation[int] = <factory>, cost: m3.observability.Observation[float] = <factory>, currency: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['usage']; default'usage'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.input_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.output_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.reasoning_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_creation_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_read_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_write_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.total_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cost: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.currency: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
UsageValue
m3.sync_api.UsageValue(*, input_tokens: m3.observability.Observation[int] = <factory>, output_tokens: m3.observability.Observation[int] = <factory>, reasoning_tokens: m3.observability.Observation[int] = <factory>, cache_creation_tokens: m3.observability.Observation[int] = <factory>, cache_read_tokens: m3.observability.Observation[int] = <factory>, cache_write_tokens: m3.observability.Observation[int] = <factory>, total_tokens: m3.observability.Observation[int] = <factory>, cost: m3.observability.Observation[float] = <factory>, currency: m3.observability.Observation[str] = <factory>) -> None
Value-only usage aggregate used by summaries and runtime metadata.
Public fields and methods:
input_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.output_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.reasoning_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_creation_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_read_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_write_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.total_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cost: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.currency: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
WireToolCall
m3.sync_api.WireToolCall(*, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[ToolResult] = <factory>, latency_ms: m3.observability.Observation[float] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.latency_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.
WorkspaceEntry
m3.sync_api.WorkspaceEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['workspace'] = 'workspace', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), change: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.sync_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['workspace']; default'workspace'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.change: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
m3.async_api
AsyncAgentSession
m3.async_api.AsyncAgentSession(spec: 'AgentSpec', adapter: 'AgentAdapter', *, server_manager: 'Any' = None, server_manager_factory: 'Callable[[], Any] | None' = None, interaction_controller: 'Interactions | None' = None, provenance: 'SessionSource | None' = None, on_close: 'Callable[[AsyncAgentSession], None] | None' = None, event_sink: '_EventSink | None' = None, trace_recorder: 'ExecutionTraceRecorder | None' = None, trace_owner: 'bool' = True, artifact_store: 'ArtifactStore | None' = None, harness_cache_dir: 'str | None' = None, runtime_manager: 'Any' = None, runtime_invocation_dir: 'str | Path | None' = None, runtime_project_root: 'str | Path | None' = None, managed_input_runtime: 'ManagedInputRuntime | None' = None) -> 'None'
Lifecycle-safe async session over one injected harness adapter.
Public fields and methods:
send(self, message: 'str | UserMessage', *, timeout: 'float | None' = None, metadata: 'Mapping[str, object] | None' = None, elicitation: 'ElicitationPlan | None' = None, elicitation_round_limit: 'int' = 10) -> 'TurnResult'— Public method onAsyncAgentSession.enqueue_turn(self, message: 'str | UserMessage', *, timeout: 'float | None' = None, metadata: 'Mapping[str, object] | None' = None) -> 'QueuedTurn'— Public method onAsyncAgentSession.cancel(self) -> 'None'— Public method onAsyncAgentSession.snapshot(self) -> 'ExecutionState'— Public method onAsyncAgentSession.fork(self, request: 'SessionForkRequest', *, adapter_factory: 'Callable[[AgentSpec, SessionSource], HarnessAdapter | Awaitable[HarnessAdapter]]') -> 'AsyncAgentSession'— Create a fresh child execution from this terminal session.aclose(self) -> 'None'— Public method onAsyncAgentSession.
HarnessAdapter
m3.async_api.HarnessAdapter(*args, **kwargs)
Minimal injected adapter contract for one continuing conversation.
Public fields and methods:
start(self, spec: 'AgentSpec') -> 'None'— Public method onHarnessAdapter.send(self, message: 'UserMessage', *, timeout: 'float | None' = None, metadata: 'Mapping[str, object] | None' = None) -> 'TurnResponse | AdapterTurn'— Public method onHarnessAdapter.close(self) -> 'None'— Public method onHarnessAdapter.
AsyncProbes
m3.async_api.AsyncProbes(*, timeout_seconds: 'float' = 5.0, output_limit: 'int' = 65536) -> 'None'
Async namespace for capability probes.
Public fields and methods:
probe_binary(self, name: 'str', executable: 'str | os.PathLike[str]', *, args: 'Sequence[str]' = ('--version',), env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None) -> 'ProbeResult'— Public method onAsyncProbes.probe_protocol(self, name: 'str', executable: 'str | os.PathLike[str]', *, args: 'Sequence[str]' = ('--protocol-version',), env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None, transport: 'str | TransportKind | None' = None) -> 'ProbeResult'— Public method onAsyncProbes.probe_harness(self, name: 'str', executable: 'str | os.PathLike[str]', *, args: 'Sequence[str]' = ('--version',), env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None, transport: 'str | TransportKind | None' = None) -> 'ProbeResult'— Public method onAsyncProbes.probe_transport(self, name: 'str', *, transport: 'str | TransportKind', executable: 'str | os.PathLike[str] | None' = None, args: 'Sequence[str]' = ('--transport-ready',), module: 'str | None' = None, env: 'Mapping[str, str] | None' = None, timeout_seconds: 'float | None' = None) -> 'ProbeResult'— Public method onAsyncProbes.probe_storage(self, name: 'str' = 'memory', *, module: 'str | None' = None) -> 'ProbeResult'— Public method onAsyncProbes.probe_requested(self, requests: 'Iterable[ProbeRequest]') -> 'ProbeReport'— Public method onAsyncProbes.
AsyncDirectClient
m3.async_api.AsyncDirectClient(kit: 'AsyncMCPTestKit', server: '_ServerValue', *, timeout: 'float', validate_schemas: 'bool', secret_resolver: '_SecretResolver | None', bearer_token: '_SecretReference | None', auth: 'httpx2.Auth | None', for_agent: 'bool', resolve_host: '_HostResolver | None', raise_server_exceptions: 'bool', session_options: '_Mapping[str, _Any]', trace_bridge: '_DirectTraceBridge | None' = None, trace_owner: 'bool' = True, workspace_root: 'str | None' = None, server_bindings: '_Iterable[_Mapping[str, _Any]]' = (), prefer_modern_protocol: 'bool' = False) -> 'None'
Lifecycle-owned async direct client returned by AsyncMCPTestKit.
Public fields and methods:
aclose(self) -> 'None'— Public method onAsyncDirectClient.
AsyncExecutionHandle
m3.async_api.AsyncExecutionHandle(controller: 'AsyncExecutionController', spec: 'ExecutionSpec', *, store: 'ExecutionStore | None' = None, persistent: 'bool' = False, execution_id: 'ExecutionId | str | None' = None, run_id: 'str | None' = None, human_input: 'HumanInput' = 'fail', resolution_provenance: 'Sequence[Mapping[str, Any]]' = ()) -> 'None'
Live, immutable view of one submitted execution.
Public fields and methods:
snapshot(self) -> 'ExecutionState'— Public method onAsyncExecutionHandle.pending_elicitation(self) -> 'PendingElicitationRound | None'— Return the current public managed-input round, if one is pending.respond_elicitation(self, round_id: 'str', responses: 'Mapping[str, ElicitationResponse]', *, idempotency_key: 'str') -> 'None'— Atomically validate and commit keyed human responses.result(self, timeout: 'float | None' = None) -> 'ExecutionResult'— Public method onAsyncExecutionHandle.cancel(self) -> 'None'— Public method onAsyncExecutionHandle.on_event(self, callback: 'Callable[[Event], Any]') -> 'Callable[[], None]'— Subscribe after commit; callback failures cannot affect execution.events(self, *, after_sequence: 'int' = -1) -> 'AsyncIterator[Event]'— Yield committed events in sequence order and finish at terminal.
AsyncMCPTestKit
m3.async_api.AsyncMCPTestKit(config: 'Config | _Mapping[str, _Any] | None' = None, *, env: '_Mapping[str, str] | None' = None, cwd: 'str | _Path | None' = None, probe_timeout_seconds: 'float' = 5.0, probe_output_limit: 'int' = 65536, adapter_registry: '_HarnessAdapterRegistry | None' = None, store: '_ExecutionStore | None' = None, embedded_worker: 'bool' = True, run_id: '_RunId | str | None' = None, suite_name: 'str | None' = None, project_id: '_ProjectId | str | None' = None, record_checks: 'bool' = False, max_judge_requests: 'int | None' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'None'
Async twin of :class:m3.sync_api.MCPTestKit.
Public fields and methods:
get_trace(self, execution_id: '_ExecutionId | str') -> '_TraceResult'— Return the finalized stable trace for an execution.get_trace_view(self, execution_id: '_ExecutionId | str') -> 'TraceView'— Return the finalized typed trace view for an execution.read_raw_evidence(self, reference: '_EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Read bounded, redacted raw evidence by its durable reference.aclose(self) -> 'None'— Close the shell; repeated calls are intentionally harmless.capabilities(self, requests: '_Iterable[ProbeRequest]' = ()) -> 'ProbeReport'— Public method onAsyncMCPTestKit.register_evaluator(self, name: 'str', evaluator: '_EvaluatorCallable | _AsyncEvaluator') -> 'None'— Register an evaluator callback by its serializable name.evaluate(self, subject: '_Any', evaluator: 'str | _EvaluatorCallable | _AsyncEvaluator', *, required: 'bool' = False, goal: 'str | None' = None, trace: '_Any' = None, artifacts: '_Any' = (), metadata: '_Mapping[str, str | int | float | bool | None] | None' = None, execution_id: '_Any' = None, turn_id: '_Any' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Run and persist one evaluation without changing lifecycle.judge_response(self, *, name: 'str', input: 'str', actual: 'str', expected: 'str', judge: '_LLMJudge', required: 'bool' = False, execution_id: '_Any' = None, turn_id: '_Any' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Public method onAsyncMCPTestKit.evaluation_results(self) -> 'tuple[_EvaluationResult, ...]'— Public method onAsyncMCPTestKit.agents(self, selections: '_Any', *, trials: 'int' = 1) -> 'tuple[_Any, ...]'— Expand ordered agent dictionaries without starting any I/O.run(self, spec: '_DirectSpec | _AgentSpec') -> '_ExecutionResult'— Public method onAsyncMCPTestKit.submit(self, spec: '_ExecutionSpec', *, human_input: '_HumanInput' = 'fail') -> 'AsyncExecutionHandle'— Public method onAsyncMCPTestKit.direct(self, server: '_ServerValue | _ServerBinding', *, protocol: 'object | None' = None, timeout: 'float | None' = None, validate_schemas: 'bool' = False, secret_resolver: '_SecretResolver | None' = None, bearer_token: '_SecretReference | None' = None, auth: 'httpx2.Auth | None' = None, for_agent: 'bool' = False, resolve_host: '_HostResolver | None' = None, raise_server_exceptions: 'bool' = True, sampling_callback: '_Any' = None, elicitation_callback: '_RemovedElicitationCallback' = <m3.direct_client._RemovedElicitationCallback object>, list_roots_callback: '_Any' = None, logging_callback: '_Any' = None, message_handler: '_Any' = None, client_info: '_Any' = None, log_level: '_Any' = None, sampling_capabilities: '_Any' = None, result_claims: '_Any' = None, extensions: '_Mapping[str, _Mapping[str, _Any]] | None' = None, notification_bindings: '_Iterable[_Any] | None' = None, dispatcher: '_Any' = None, trace_bridge: '_DirectTraceBridge | None' = None, trace_owner: 'bool' = True, workspace_root: 'str | None' = None) -> 'AsyncDirectClient'— Public method onAsyncMCPTestKit.agent_session(self, spec: '_AgentSpec', *, adapter: '_AgentAdapter | None' = None, runtime_servers: '_Iterable[_Any]' = (), _event_sink: '_Any' = None, interaction_handlers: 'InteractionHandlers | None' = None, _trace_recorder: '_ExecutionTraceRecorder | None' = None, _trace_owner: 'bool' = True, _execution_id: '_Any' = None, _artifact_store: '_ArtifactStore | None' = None, _managed_input_runtime: '_Any' = None, harness_cache_dir: 'str | _Path | None' = None) -> 'AsyncAgentSession'— Public method onAsyncMCPTestKit.
CallToolResult
m3.async_api.CallToolResult(*, raw: Any = None, content: tuple[collections.abc.Mapping[str, typing.Any], ...] = (), structured_content: Any = None, is_error: bool = False) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.content: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.structured_content: typing.Any; defaultNone— Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
CompletionResult
m3.async_api.CompletionResult(*, raw: Any = None, values: tuple[str, ...] = (), total: int | None = None, has_more: bool | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.values: tuple[str, ...]; default()— Stored and validated as part of this public value.total: int | None; defaultNone— Stored and validated as part of this public value.has_more: bool | None; defaultNone— Stored and validated as part of this public value.
ConfigOrigin
m3.async_api.ConfigOrigin(*, source: m3.configuration.ConfigSource, origin: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)]) -> None
Public class in m3.async_api.
Public fields and methods:
source: <enum 'ConfigSource'>; required — Stored and validated as part of this public value.origin: <class 'str'>; required — Stored and validated as part of this public value.
ConfigSource
m3.async_api.ConfigSource(*values)
Public class in m3.async_api.
Config
m3.async_api.Config(*, artifact_policy: Literal['failed', 'always', 'never'] = 'failed', protocol_revision: Annotated[str, Strict(strict=True)] = 'auto', telemetry_enabled: Annotated[bool, Strict(strict=True)] = False, sources: collections.abc.Mapping[str, m3.configuration.ConfigOrigin] = <factory>) -> None
Effective SDK-wide settings and the origin of each setting.
Public fields and methods:
artifact_policy: typing.Literal['failed', 'always', 'never']; default'failed'— Stored and validated as part of this public value.protocol_revision: <class 'str'>; default'auto'— Stored and validated as part of this public value.telemetry_enabled: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.sources: collections.abc.Mapping[str, m3.configuration.ConfigOrigin]; required — Stored and validated as part of this public value.source_for(self, field: 'str') -> 'ConfigOrigin'— Public method onConfig.
ConfigError
m3.async_api.ConfigError(*, field: 'str', origin: 'str', reason: 'str', code: 'str | None' = None) -> 'None'
A strict, value-free configuration diagnostic.
PromptInfo
m3.async_api.PromptInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, arguments: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.arguments: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
ResourceInfo
m3.async_api.ResourceInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None, size: Annotated[int | None, Ge(ge=0)] = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.size: int | None; defaultNone— Stored and validated as part of this public value.
TemplateInfo
m3.async_api.TemplateInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri_template: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri_template: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.
ToolInfo
m3.async_api.ToolInfo(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, input_schema: collections.abc.Mapping[str, typing.Any] | bool = <factory>, output_schema: collections.abc.Mapping[str, typing.Any] | bool | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.input_schema: collections.abc.Mapping[str, typing.Any] | bool; required — Stored and validated as part of this public value.output_schema: collections.abc.Mapping[str, typing.Any] | bool | None; defaultNone— Stored and validated as part of this public value.
EmptyResult
m3.async_api.EmptyResult(*, raw: Any = None, result_type: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.result_type: str | None; defaultNone— Stored and validated as part of this public value.
GetPromptResult
m3.async_api.GetPromptResult(*, raw: Any = None, description: str | None = None, messages: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.messages: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
InitializeResult
m3.async_api.InitializeResult(*, raw: Any = None, protocol_version: str, server_info: collections.abc.Mapping[str, typing.Any], instructions: str | None = None, capabilities: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.protocol_version: <class 'str'>; required — Stored and validated as part of this public value.server_info: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.instructions: str | None; defaultNone— Stored and validated as part of this public value.capabilities: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
InitializationResult
m3.async_api.InitializationResult(*, raw: Any = None, protocol_version: str, server_info: collections.abc.Mapping[str, typing.Any], instructions: str | None = None, capabilities: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.protocol_version: <class 'str'>; required — Stored and validated as part of this public value.server_info: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.instructions: str | None; defaultNone— Stored and validated as part of this public value.capabilities: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
InputRequiredResult
m3.async_api.InputRequiredResult(*, raw: Any = None, result_type: Literal['input_required'] = 'input_required', input_requests: collections.abc.Mapping[str, typing.Any] | None = None, request_state: str | None = None) -> None
Official MCP interactive result, preserved instead of coercing empty data.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.result_type: typing.Literal['input_required']; default'input_required'— Stored and validated as part of this public value.input_requests: collections.abc.Mapping[str, typing.Any] | None; defaultNone— Stored and validated as part of this public value.request_state: str | None; defaultNone— Stored and validated as part of this public value.
ListPromptsResult
m3.async_api.ListPromptsResult(*, raw: Any = None, prompts: tuple[m3.types.PromptInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.prompts: tuple[m3.types.PromptInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ListResourcesResult
m3.async_api.ListResourcesResult(*, raw: Any = None, resources: tuple[m3.types.ResourceInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resources: tuple[m3.types.ResourceInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ListResourceTemplatesResult
m3.async_api.ListResourceTemplatesResult(*, raw: Any = None, resource_templates: tuple[m3.types.TemplateInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resource_templates: tuple[m3.types.TemplateInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ListToolsResult
m3.async_api.ListToolsResult(*, raw: Any = None, tools: tuple[m3.types.ToolInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.tools: tuple[m3.types.ToolInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ProbeEvidence
m3.async_api.ProbeEvidence(*, kind: m3.services.probes.ProbeKind, target: Annotated[str, MinLen(min_length=1), MaxLen(max_length=512)], command: tuple[str, ...] = (), resolved_executable: str | None = None, detected_version: str | None = None, protocol_version: str | None = None, output: Annotated[str, MaxLen(max_length=65536)] = '', details: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Safe evidence collected by one probe.
Public fields and methods:
kind: <enum 'ProbeKind'>; required — Stored and validated as part of this public value.target: <class 'str'>; required — Stored and validated as part of this public value.command: tuple[str, ...]; default()— Stored and validated as part of this public value.resolved_executable: str | None; defaultNone— Stored and validated as part of this public value.detected_version: str | None; defaultNone— Stored and validated as part of this public value.protocol_version: str | None; defaultNone— Stored and validated as part of this public value.output: <class 'str'>; default''— Stored and validated as part of this public value.details: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
ProbeKind
m3.async_api.ProbeKind(*values)
The independently requestable capability categories.
ProbeReport
m3.async_api.ProbeReport(*, readiness: m3.types.Readiness, results: tuple[m3.services.probes.ProbeResult, ...] = ()) -> None
Aggregate readiness for exactly the requested probes.
Public fields and methods:
readiness: <class 'm3.types.Readiness'>; required — Stored and validated as part of this public value.results: tuple[m3.services.probes.ProbeResult, ...]; default()— Stored and validated as part of this public value.result_for(self, name: 'str') -> 'ProbeResult | None'— Return the result fornamewithout guessing another target.
ProbeRequest
m3.async_api.ProbeRequest(kind: 'ProbeKind', name: 'str', executable: 'str | None' = None, args: 'tuple[str, ...]' = (), env: 'Mapping[str, str] | None' = None, module: 'str | None' = None, transport: 'str | None' = None, timeout_seconds: 'float | None' = None) -> None
Typed request used by :meth:Probes.probe_requested.
ProbeResult
m3.async_api.ProbeResult(*, capability: m3.types.Capability, evidence: m3.services.probes.ProbeEvidence) -> None
One capability result and its separately inspectable evidence.
Public fields and methods:
capability: <class 'm3.types.Capability'>; required — Stored and validated as part of this public value.evidence: <class 'm3.services.probes.ProbeEvidence'>; required — Stored and validated as part of this public value.
Prompt
m3.async_api.Prompt(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, arguments: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.arguments: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
PromptPage
m3.async_api.PromptPage(*, raw: Any = None, prompts: tuple[m3.types.PromptInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.prompts: tuple[m3.types.PromptInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
PromptResult
m3.async_api.PromptResult(*, raw: Any = None, description: str | None = None, messages: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.messages: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
ReadResourceResult
m3.async_api.ReadResourceResult(*, raw: Any = None, contents: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.contents: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
Resource
m3.async_api.Resource(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None, size: Annotated[int | None, Ge(ge=0)] = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.size: int | None; defaultNone— Stored and validated as part of this public value.
ResourcePage
m3.async_api.ResourcePage(*, raw: Any = None, resources: tuple[m3.types.ResourceInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resources: tuple[m3.types.ResourceInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ResourceReadResult
m3.async_api.ResourceReadResult(*, raw: Any = None, contents: tuple[collections.abc.Mapping[str, typing.Any], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.contents: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.
ResourceTemplate
m3.async_api.ResourceTemplate(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, uri_template: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], description: str | None = None, mime_type: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.uri_template: <class 'str'>; required — Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.mime_type: str | None; defaultNone— Stored and validated as part of this public value.
ResourceTemplatePage
m3.async_api.ResourceTemplatePage(*, raw: Any = None, resource_templates: tuple[m3.types.TemplateInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resource_templates: tuple[m3.types.TemplateInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ResourceTemplatesPage
m3.async_api.ResourceTemplatesPage(*, raw: Any = None, resource_templates: tuple[m3.types.TemplateInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resource_templates: tuple[m3.types.TemplateInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ResourcesPage
m3.async_api.ResourcesPage(*, raw: Any = None, resources: tuple[m3.types.ResourceInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.resources: tuple[m3.types.ResourceInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
Tool
m3.async_api.Tool(*, raw: Any = None, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], title: str | None = None, description: str | None = None, input_schema: collections.abc.Mapping[str, typing.Any] | bool = <factory>, output_schema: collections.abc.Mapping[str, typing.Any] | bool | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.title: str | None; defaultNone— Stored and validated as part of this public value.description: str | None; defaultNone— Stored and validated as part of this public value.input_schema: collections.abc.Mapping[str, typing.Any] | bool; required — Stored and validated as part of this public value.output_schema: collections.abc.Mapping[str, typing.Any] | bool | None; defaultNone— Stored and validated as part of this public value.
ToolCallResult
m3.async_api.ToolCallResult(*, raw: Any = None, content: tuple[collections.abc.Mapping[str, typing.Any], ...] = (), structured_content: Any = None, is_error: bool = False) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.content: tuple[collections.abc.Mapping[str, typing.Any], ...]; default()— Stored and validated as part of this public value.structured_content: typing.Any; defaultNone— Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
ToolPage
m3.async_api.ToolPage(*, raw: Any = None, tools: tuple[m3.types.ToolInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.tools: tuple[m3.types.ToolInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
ToolsPage
m3.async_api.ToolsPage(*, raw: Any = None, tools: tuple[m3.types.ToolInfo, ...] = (), next_cursor: str | None = None) -> None
Public class in m3.async_api.
Public fields and methods:
raw: typing.Any; defaultNone— Stored and validated as part of this public value.tools: tuple[m3.types.ToolInfo, ...]; default()— Stored and validated as part of this public value.next_cursor: str | None; defaultNone— Stored and validated as part of this public value.
load_config
m3.async_api.load_config(explicit: '_Mapping[str, _Any] | None' = None, *, env: '_Mapping[str, str] | None' = None, cwd: 'str | _Path | None' = None, artifact_policy: '_Any' = <object object>, protocol_revision: '_Any' = <object object>, telemetry_enabled: '_Any' = <object object>) -> 'Config'
Resolve SDK settings using explicit, environment, project, default order.
AllowedCommands
m3.async_api.AllowedCommands(*, allowed_executables: 'Sequence[str]', root: 'str | Path', environment: 'Mapping[str, str] | None' = None, allowed_environment: 'Sequence[str]' = ()) -> 'None'
Safe argv-only terminal handler with cwd, timeout, and output bounds.
FilesystemHandler
m3.async_api.FilesystemHandler(*args, **kwargs)
Public class in m3.async_api.
FilesystemRequest
m3.async_api.FilesystemRequest(operation: 'FilesystemOperation', path: 'str', data: 'bytes | None' = None, max_bytes: 'int' = 1048576) -> None
FilesystemRequest(operation: 'FilesystemOperation', path: 'str', data: 'bytes | None' = None, max_bytes: 'int' = 1048576)
FilesystemResult
m3.async_api.FilesystemResult(allowed: 'bool', data: 'bytes | tuple[str, ...] | None', receipt: 'InteractionReceipt') -> None
FilesystemResult(allowed: 'bool', data: 'bytes | tuple[str, ...] | None', receipt: 'InteractionReceipt')
Interactions
m3.async_api.Interactions(*, permission_policy: 'PermissionPolicy | None' = None, sampling_policy: 'SamplingPolicy | None' = None, filesystem_policy: 'FilesystemPolicy | None' = None, terminal_policy: 'TerminalPolicy | None' = None, handlers: 'InteractionHandlers | None' = None) -> 'None'
Apply immutable policies around explicit interaction callbacks.
Public fields and methods:
receipts(self) -> 'tuple[InteractionReceipt, ...]'— Public method onInteractions.permission(self, request: 'PermissionRequest') -> 'PermissionResult'— Public method onInteractions.sample(self, request: 'SamplingRequest') -> 'SamplingResult'— Public method onInteractions.filesystem(self, request: 'FilesystemRequest') -> 'FilesystemResult'— Public method onInteractions.terminal(self, request: 'TerminalRequest') -> 'TerminalResult'— Public method onInteractions.
InteractionHandlers
m3.async_api.InteractionHandlers(permission: 'PermissionCallback | None' = None, sampling: 'SamplingCallback | None' = None, filesystem: 'FilesystemHandler | None' = None, terminal: 'TerminalHandler | None' = None) -> None
Optional callbacks; absent callbacks are always default-deny.
InteractionReceipt
m3.async_api.InteractionReceipt(request_id: 'str', kind: 'str', decision: 'Decision', reason: 'str', timestamp: 'datetime' = <factory>) -> None
Safe decision evidence; request values and handler errors are excluded.
PermissionRequest
m3.async_api.PermissionRequest(operation: 'str', resource: 'str' = '', destructive: 'bool' = False) -> None
PermissionRequest(operation: 'str', resource: 'str' = '', destructive: 'bool' = False)
PermissionResult
m3.async_api.PermissionResult(allowed: 'bool', receipt: 'InteractionReceipt', confirmation_required: 'bool' = False) -> None
PermissionResult(allowed: 'bool', receipt: 'InteractionReceipt', confirmation_required: 'bool' = False)
PermissionHandler
m3.async_api.PermissionHandler(*args, **kwargs)
Public class in m3.async_api.
SamplingRequest
m3.async_api.SamplingRequest(prompt: 'str', model: 'str | None' = None, metadata: 'Mapping[str, str | int | float | bool | None]' = <factory>) -> None
SamplingRequest(prompt: 'str', model: 'str | None' = None, metadata: 'Mapping[str, str | int | float | bool | None]' = <factory>)
SamplingResult
m3.async_api.SamplingResult(accepted: 'bool', content: 'str | None', receipt: 'InteractionReceipt') -> None
SamplingResult(accepted: 'bool', content: 'str | None', receipt: 'InteractionReceipt')
SamplingHandler
m3.async_api.SamplingHandler(*args, **kwargs)
Public class in m3.async_api.
TerminalHandler
m3.async_api.TerminalHandler(*args, **kwargs)
Public class in m3.async_api.
TerminalRequest
m3.async_api.TerminalRequest(argv: 'tuple[str, ...]', cwd: 'str | None' = None, environment: 'Mapping[str, str]' = <factory>, timeout_seconds: 'float' = 30.0, max_output_bytes: 'int' = 1048576) -> None
TerminalRequest(argv: 'tuple[str, ...]', cwd: 'str | None' = None, environment: 'Mapping[str, str]' = <factory>, timeout_seconds: 'float' = 30.0, max_output_bytes: 'int' = 1048576)
TerminalResult
m3.async_api.TerminalResult(allowed: 'bool', returncode: 'int | None', stdout: 'bytes', stderr: 'bytes', timed_out: 'bool', truncated: 'bool', receipt: 'InteractionReceipt') -> None
TerminalResult(allowed: 'bool', returncode: 'int | None', stdout: 'bytes', stderr: 'bytes', timed_out: 'bool', truncated: 'bool', receipt: 'InteractionReceipt')
WorkspaceFiles
m3.async_api.WorkspaceFiles(root: 'str | Path', *, mode: "Literal['read_only', 'read_write']" = 'read_only', max_bytes: 'int' = 1048576) -> 'None'
Bounded filesystem handler rooted inside one owned workspace.
ElicitationPlan
m3.async_api.ElicitationPlan(*, node: Literal['leaf', 'sequence', 'optional', 'one_of', 'round_of'] = 'leaf', request: Optional[Annotated[m3.elicitation._FormExpectation | m3.elicitation._UrlExpectation, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]] = None, response: m3.elicitation.ElicitationResponse | None = None, children: tuple[m3.elicitation.ElicitationPlan, ...] = (), optional_occurrence: bool = False) -> None
An immutable, serializable elicitation expectation tree.
Public fields and methods:
node: typing.Literal['leaf', 'sequence', 'optional', 'one_of', 'round_of']; default'leaf'— Stored and validated as part of this public value.request: typing.Optional[typing.Annotated[m3.elicitation._FormExpectation | m3.elicitation._UrlExpectation, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]]; defaultNone— Stored and validated as part of this public value.response: m3.elicitation.ElicitationResponse | None; defaultNone— Stored and validated as part of this public value.children: tuple[m3.elicitation.ElicitationPlan, ...]; default()— Stored and validated as part of this public value.optional_occurrence: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.accept(self, content: 'Mapping[str, object] | None' = None) -> 'ElicitationPlan'— Public method onElicitationPlan.decline(self) -> 'ElicitationPlan'— Public method onElicitationPlan.cancel(self) -> 'ElicitationPlan'— Public method onElicitationPlan.canonical_identity(self) -> 'str'— Public method onElicitationPlan.canonical_json(self) -> 'str'— Public method onElicitationPlan.model_dump(self, *args: 'Any', **kwargs: 'Any') -> 'dict[str, Any]'— Public method onElicitationPlan.model_dump_json(self, *args: 'Any', **kwargs: 'Any') -> 'str'— Public method onElicitationPlan.matcher(self) -> 'PlanMatcher'— Public method onElicitationPlan.
ElicitationResponse
m3.async_api.ElicitationResponse(*, action: Literal['accept', 'decline', 'cancel'], content: collections.abc.Mapping[str, object] | None = None, meta: collections.abc.Mapping[str, object] | None = None) -> None
The response that will be associated with one request key.
Public fields and methods:
action: typing.Literal['accept', 'decline', 'cancel']; required — Stored and validated as part of this public value.content: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.
FormElicitationRequest
m3.async_api.FormElicitationRequest(*, request_key: Annotated[str, MinLen(min_length=1)], mode: Literal['form'] = 'form', message: str, requested_schema: collections.abc.Mapping[str, object], meta: collections.abc.Mapping[str, object] | None = None, task: collections.abc.Mapping[str, object] | None = None, server: str | None = None, operation_kind: Optional[Literal['tool', 'prompt', 'resource']] = None, operation_name: str | None = None) -> None
A normalized form-mode elicitation request.
Public fields and methods:
request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['form']; default'form'— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.requested_schema: collections.abc.Mapping[str, object]; required — Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.task: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['tool', 'prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: str | None; defaultNone— Stored and validated as part of this public value.
PendingElicitationRound
m3.async_api.PendingElicitationRound(*, round_id: Annotated[str, MinLen(min_length=1)], execution_id: Annotated[str, MinLen(min_length=1)], logical_operation_id: Annotated[str, MinLen(min_length=1)], server: Annotated[str, MinLen(min_length=1)], operation_kind: Literal['tool', 'prompt', 'resource'], operation_name: Annotated[str, MinLen(min_length=1)], request_state: str | None = None, requests: collections.abc.Mapping[str, typing.Annotated[m3.elicitation.FormElicitationRequest | m3.elicitation.UrlElicitationRequest, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]], created_at: datetime.datetime, deadline: datetime.datetime | None = None) -> None
A persisted, keyed set of elicitation requests awaiting responses.
Public fields and methods:
round_id: <class 'str'>; required — Stored and validated as part of this public value.execution_id: <class 'str'>; required — Stored and validated as part of this public value.logical_operation_id: <class 'str'>; required — Stored and validated as part of this public value.server: <class 'str'>; required — Stored and validated as part of this public value.operation_kind: typing.Literal['tool', 'prompt', 'resource']; required — Stored and validated as part of this public value.operation_name: <class 'str'>; required — Stored and validated as part of this public value.request_state: str | None; defaultNone— Stored and validated as part of this public value.requests: collections.abc.Mapping[str, typing.Annotated[m3.elicitation.FormElicitationRequest | m3.elicitation.UrlElicitationRequest, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]]; required — Stored and validated as part of this public value.created_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.deadline: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.
UrlElicitationRequest
m3.async_api.UrlElicitationRequest(*, request_key: Annotated[str, MinLen(min_length=1)], mode: Literal['url'] = 'url', message: str, url: str, elicitation_id: str | None = None, meta: collections.abc.Mapping[str, object] | None = None, task: collections.abc.Mapping[str, object] | None = None, server: str | None = None, operation_kind: Optional[Literal['tool', 'prompt', 'resource']] = None, operation_name: str | None = None) -> None
A normalized URL-mode elicitation request.
Public fields and methods:
request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['url']; default'url'— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.url: <class 'str'>; required — Stored and validated as part of this public value.elicitation_id: str | None; defaultNone— Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.task: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['tool', 'prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: str | None; defaultNone— Stored and validated as part of this public value.
expect_form
m3.async_api.expect_form(request_key: 'str', *, message: 'str | None' = None, schema: 'Mapping[str, object] | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.async_api.
expect_url
m3.async_api.expect_url(request_key: 'str', *, message: 'str | None' = None, url: 'str | None' = None, elicitation_id: 'str | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.async_api.
maybe_form
m3.async_api.maybe_form(request_key: 'str', *, message: 'str | None' = None, schema: 'Mapping[str, object] | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.async_api.
maybe_url
m3.async_api.maybe_url(request_key: 'str', *, message: 'str | None' = None, url: 'str | None' = None, elicitation_id: 'str | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.async_api.
one_of
m3.async_api.one_of(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.async_api.
optional
m3.async_api.optional(child: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.async_api.
round_of
m3.async_api.round_of(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.async_api.
sequence
m3.async_api.sequence(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.async_api.
ACPTrace
m3.async_api.ACPTrace(*, kind: Literal['acp'] = 'acp', session_id: m3.observability.Observation[str] = <factory>, protocol_version: m3.observability.Observation[str] = <factory>, agent_identity: m3.observability.Observation[JsonValue] = <factory>, available_modes: m3.observability.Observation[JsonValue] = <factory>, current_mode: m3.observability.Observation[str] = <factory>, config_options: m3.observability.Observation[JsonValue] = <factory>, selected_config: m3.observability.Observation[JsonValue] = <factory>, plan_state_available: m3.observability.Observation[bool] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
kind: typing.Literal['acp']; default'acp'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.agent_identity: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.available_modes: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.current_mode: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.config_options: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.selected_config: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.plan_state_available: <class 'm3.observability.Observation[bool]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
ArtifactEntry
m3.async_api.ArtifactEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['artifact'] = 'artifact', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), artifact: m3.types.ArtifactRef) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['artifact']; default'artifact'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.artifact: <class 'm3.types.ArtifactRef'>; required — Stored and validated as part of this public value.
CaptureOptions
m3.async_api.CaptureOptions(*, capture_raw_evidence: bool = True, capture_provider_messages: bool = True, capture_stderr: bool = True, raw_preview_bytes: Annotated[int, Gt(gt=0)] = 65536, raw_frame_bytes: Annotated[int, Gt(gt=0)] = 1048576, raw_execution_bytes: Annotated[int, Gt(gt=0)] = 67108864) -> None
Boundaries for redacted provider/MCP evidence capture.
Public fields and methods:
capture_raw_evidence: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.capture_provider_messages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.capture_stderr: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.raw_preview_bytes: <class 'int'>; default65536— Stored and validated as part of this public value.raw_frame_bytes: <class 'int'>; default1048576— Stored and validated as part of this public value.raw_execution_bytes: <class 'int'>; default67108864— Stored and validated as part of this public value.
ClaudeCodeTrace
m3.async_api.ClaudeCodeTrace(*, kind: Literal['claude_code'] = 'claude_code', session_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, result_subtype: m3.observability.Observation[str] = <factory>, stop_reason: m3.observability.Observation[str] = <factory>, service_tier: m3.observability.Observation[str] = <factory>, api_duration_ms: m3.observability.Observation[float] = <factory>, encrypted_reasoning: m3.observability.Observation[bool] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
kind: typing.Literal['claude_code']; default'claude_code'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.result_subtype: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.stop_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.service_tier: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.api_duration_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.encrypted_reasoning: <class 'm3.observability.Observation[bool]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
CodexTrace
m3.async_api.CodexTrace(*, kind: Literal['codex'] = 'codex', thread_id: m3.observability.Observation[str] = <factory>, turn_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, sandbox: m3.observability.Observation[str] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
kind: typing.Literal['codex']; default'codex'— Stored and validated as part of this public value.thread_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.turn_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.sandbox: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
CorrelationState
m3.async_api.CorrelationState(*values)
Public class in m3.async_api.
DiagnosticEntry
m3.async_api.DiagnosticEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['diagnostic'] = 'diagnostic', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), code: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], message: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], stage: Annotated[str | None, MaxLen(max_length=128)] = None, operation: Annotated[str | None, MaxLen(max_length=256)] = None, elapsed_seconds: Annotated[float | None, Ge(ge=0)] = None, timeout_seconds: Annotated[float | None, Gt(gt=0)] = None) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['diagnostic']; default'diagnostic'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.code: <class 'str'>; required — Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.stage: str | None; defaultNone— Stored and validated as part of this public value.operation: str | None; defaultNone— Stored and validated as part of this public value.elapsed_seconds: float | None; defaultNone— Stored and validated as part of this public value.timeout_seconds: float | None; defaultNone— Stored and validated as part of this public value.
DirectTrace
m3.async_api.DirectTrace(*, kind: Literal['direct'] = 'direct', transport: m3.observability.Observation[TransportKind] = <factory>, protocol: m3.observability.Observation[str] = <factory>, initialization: m3.observability.Observation[InitializationValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
kind: typing.Literal['direct']; default'direct'— Stored and validated as part of this public value.transport: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.protocol: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.initialization: <class 'm3.observability.Observation[InitializationValue]'>; required — Stored and validated as part of this public value.
ElicitationEntry
m3.async_api.ElicitationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['elicitation'] = 'elicitation', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, operation_kind: Literal['tool', 'prompt', 'resource'], operation_name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], logical_operation_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], round_index: Annotated[int, Ge(ge=1)], request_key: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], mode: Literal['form', 'url'], message: m3.observability.Observation[str] = <factory>, requested_schema: m3.observability.Observation[JsonValue] = <factory>, url: m3.observability.Observation[str] = <factory>, elicitation_id: m3.observability.Observation[str] = <factory>, request_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, action: Optional[Literal['accept', 'decline', 'cancel']] = None, content: m3.observability.Observation[JsonValue] = <factory>) -> None
One keyed elicitation embedded in an MRTR input-required round.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['elicitation']; default'elicitation'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Literal['tool', 'prompt', 'resource']; required — Stored and validated as part of this public value.operation_name: <class 'str'>; required — Stored and validated as part of this public value.logical_operation_id: <class 'str'>; required — Stored and validated as part of this public value.round_index: <class 'int'>; required — Stored and validated as part of this public value.request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['form', 'url']; required — Stored and validated as part of this public value.message: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.requested_schema: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.url: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.elicitation_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.action: typing.Optional[typing.Literal['accept', 'decline', 'cancel']]; defaultNone— Stored and validated as part of this public value.content: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
EvaluationEntry
m3.async_api.EvaluationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['evaluation'] = 'evaluation', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), evaluation: m3.types.EvaluationResult) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['evaluation']; default'evaluation'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.evaluation: <class 'm3.types.EvaluationResult'>; required — Stored and validated as part of this public value.
EvidenceCapture
m3.async_api.EvidenceCapture(*, reference: m3.types.EvidenceRef, preview: m3.observability.Observation[str], original_size_bytes: Annotated[int, Ge(ge=0)], stored_size_bytes: Annotated[int, Ge(ge=0)], redacted: bool, truncated: bool) -> None
Typed result of bounded, redacted raw-evidence capture.
Public fields and methods:
reference: <class 'm3.types.EvidenceRef'>; required — Stored and validated as part of this public value.preview: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.original_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.stored_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.redacted: <class 'bool'>; required — Stored and validated as part of this public value.truncated: <class 'bool'>; required — Stored and validated as part of this public value.
EvidenceConflict
m3.async_api.EvidenceConflict(*, field: Literal['server', 'tool', 'arguments', 'result', 'status'], reported: m3.observability.Observation[JsonValue], wire: m3.observability.Observation[JsonValue]) -> None
Public class in m3.async_api.
Public fields and methods:
field: typing.Literal['server', 'tool', 'arguments', 'result', 'status']; required — Stored and validated as part of this public value.reported: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.wire: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
HttpExchange
m3.async_api.HttpExchange(*, method: Annotated[str, MinLen(min_length=1)], status_code: Annotated[int, Ge(ge=100), Le(le=599)], headers: tuple[m3.observability.SafeHttpHeader, ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
method: <class 'str'>; required — Stored and validated as part of this public value.status_code: <class 'int'>; required — Stored and validated as part of this public value.headers: tuple[m3.observability.SafeHttpHeader, ...]; default()— Stored and validated as part of this public value.
InitializationEntry
m3.async_api.InitializationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['initialization'] = 'initialization', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), protocol_version: m3.observability.Observation[str] = <factory>, server_name: m3.observability.Observation[str] = <factory>, server_version: m3.observability.Observation[str] = <factory>, instructions: m3.observability.Observation[str] = <factory>, capabilities: m3.observability.Observation[JsonValue] = <factory>, tools: m3.observability.Observation[tuple[ToolInfo, ...]] = <factory>, resources: m3.observability.Observation[tuple[ResourceInfo, ...]] = <factory>, resource_templates: m3.observability.Observation[tuple[TemplateInfo, ...]] = <factory>, prompts: m3.observability.Observation[tuple[PromptInfo, ...]] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['initialization']; default'initialization'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.instructions: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.capabilities: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.tools: <class 'm3.observability.Observation[tuple[ToolInfo, ...]]'>; required — Stored and validated as part of this public value.resources: <class 'm3.observability.Observation[tuple[ResourceInfo, ...]]'>; required — Stored and validated as part of this public value.resource_templates: <class 'm3.observability.Observation[tuple[TemplateInfo, ...]]'>; required — Stored and validated as part of this public value.prompts: <class 'm3.observability.Observation[tuple[PromptInfo, ...]]'>; required — Stored and validated as part of this public value.
InitializationValue
m3.async_api.InitializationValue(*, protocol_version: m3.observability.Observation[str] = <factory>, server_name: m3.observability.Observation[str] = <factory>, server_version: m3.observability.Observation[str] = <factory>, instructions: m3.observability.Observation[str] = <factory>, capabilities: m3.observability.Observation[JsonValue] = <factory>, tools: m3.observability.Observation[tuple[ToolInfo, ...]] = <factory>, resources: m3.observability.Observation[tuple[ResourceInfo, ...]] = <factory>, resource_templates: m3.observability.Observation[tuple[TemplateInfo, ...]] = <factory>, prompts: m3.observability.Observation[tuple[PromptInfo, ...]] = <factory>) -> None
Value-only initialization metadata used by runtime information.
Public fields and methods:
protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.instructions: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.capabilities: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.tools: <class 'm3.observability.Observation[tuple[ToolInfo, ...]]'>; required — Stored and validated as part of this public value.resources: <class 'm3.observability.Observation[tuple[ResourceInfo, ...]]'>; required — Stored and validated as part of this public value.resource_templates: <class 'm3.observability.Observation[tuple[TemplateInfo, ...]]'>; required — Stored and validated as part of this public value.prompts: <class 'm3.observability.Observation[tuple[PromptInfo, ...]]'>; required — Stored and validated as part of this public value.
InteractionEntry
m3.async_api.InteractionEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['interaction'] = 'interaction', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), interaction_kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], request: m3.observability.Observation[JsonValue] = <factory>, response: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['interaction']; default'interaction'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.interaction_kind: <class 'str'>; required — Stored and validated as part of this public value.request: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.response: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
LifecycleEntry
m3.async_api.LifecycleEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['lifecycle'] = 'lifecycle', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), phase: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)]) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['lifecycle']; default'lifecycle'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.phase: <class 'str'>; required — Stored and validated as part of this public value.
MessageEntry
m3.async_api.MessageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['message'] = 'message', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), message_id: m3.observability.Observation[str] = <factory>, role: m3.observability.MessageRole = <MessageRole.ASSISTANT: 'assistant'>, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = (), stop_reason: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['message']; default'message'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.message_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.role: <enum 'MessageRole'>; default<MessageRole.ASSISTANT: 'assistant'>— Stored and validated as part of this public value.content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.stop_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
MessageRole
m3.async_api.MessageRole(*values)
Public class in m3.async_api.
Observation
m3.async_api.Observation(*, state: m3.observability.ObservationState, value: Optional[~_T] = None, reason: m3.observability.ObservationReason | None = None, provenance: tuple[m3.types.EventSource, ...] = (), evidence_ref: m3.types.EvidenceRef | None = None) -> None
A typed value with explicit availability and provenance.
Public fields and methods:
state: <enum 'ObservationState'>; required — Stored and validated as part of this public value.value: typing.Optional[~_T]; defaultNone— Stored and validated as part of this public value.reason: m3.observability.ObservationReason | None; defaultNone— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.evidence_ref: m3.types.EvidenceRef | None; defaultNone— Stored and validated as part of this public value.
ObservationReason
m3.async_api.ObservationReason(*values)
Public class in m3.async_api.
ObservationState
m3.async_api.ObservationState(*values)
How completely a provider-dependent value was observed.
OpenCodeTrace
m3.async_api.OpenCodeTrace(*, kind: Literal['opencode'] = 'opencode', session_id: m3.observability.Observation[str] = <factory>, provider_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, http_lifecycle: m3.observability.Observation[JsonValue] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
kind: typing.Literal['opencode']; default'opencode'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.provider_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.http_lifecycle: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
PiTrace
m3.async_api.PiTrace(*, kind: Literal['pi'] = 'pi', session_id: m3.observability.Observation[str] = <factory>, provider_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
kind: typing.Literal['pi']; default'pi'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.provider_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
ProcessEntry
m3.async_api.ProcessEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['process'] = 'process', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), executable: m3.observability.Observation[str] = <factory>, pid: m3.observability.Observation[int] = <factory>, exit_code: m3.observability.Observation[int] = <factory>, signal: m3.observability.Observation[int] = <factory>, stderr: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['process']; default'process'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.executable: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.pid: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.exit_code: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.signal: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.stderr: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
ProtocolCallAttempt
m3.async_api.ProtocolCallAttempt(*, attempt_index: Annotated[int, Ge(ge=0)], jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request_state: m3.observability.Observation[str] = <factory>, continuation_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, operation_params: m3.observability.Observation[JsonValue] = <factory>, input_required: bool = False, result: m3.observability.Observation[JsonValue] = <factory>, raw_result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.TraceStatus = <TraceStatus.INCOMPLETE: 'incomplete'>, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>) -> None
One wire-level attempt belonging to a prompt or resource call.
Public fields and methods:
attempt_index: <class 'int'>; required — Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.continuation_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.operation_params: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.input_required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.raw_result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.
ProtocolEntry
m3.async_api.ProtocolEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['protocol'] = 'protocol', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), protocol: m3.observability.ProtocolKind, method: m3.observability.Observation[str] = <factory>, direction: m3.types.EventDirection = <EventDirection.INTERNAL: 'internal'>, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request: m3.observability.Observation[JsonValue] = <factory>, response: m3.observability.Observation[JsonValue] = <factory>, error: m3.observability.Observation[ProtocolErrorInfo] = <factory>, http: m3.observability.Observation[HttpExchange] = <factory>, operation_kind: Optional[Literal['prompt', 'resource']] = None, operation_name: m3.observability.Observation[str] = <factory>, attempts: tuple[m3.observability.ProtocolCallAttempt, ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['protocol']; default'protocol'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.protocol: <enum 'ProtocolKind'>; required — Stored and validated as part of this public value.method: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.direction: <enum 'EventDirection'>; default<EventDirection.INTERNAL: 'internal'>— Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.response: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.error: <class 'm3.observability.Observation[ProtocolErrorInfo]'>; required — Stored and validated as part of this public value.http: <class 'm3.observability.Observation[HttpExchange]'>; required — Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.attempts: tuple[m3.observability.ProtocolCallAttempt, ...]; default()— Stored and validated as part of this public value.
ProtocolErrorInfo
m3.async_api.ProtocolErrorInfo(*, code: int | str | None = None, message: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], data: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
code: int | str | None; defaultNone— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.data: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
ProtocolKind
m3.async_api.ProtocolKind(*values)
Public class in m3.async_api.
ProviderEntry
m3.async_api.ProviderEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['provider'] = 'provider', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), provider: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], category: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], data: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['provider']; default'provider'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.provider: <class 'str'>; required — Stored and validated as part of this public value.category: <class 'str'>; required — Stored and validated as part of this public value.data: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
RawEvidence
m3.async_api.RawEvidence(*, reference: m3.types.EvidenceRef, media_type: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], content: Union[JsonValue, str], size_bytes: Annotated[int, Ge(ge=0)], returned_size_bytes: Annotated[int, Ge(ge=0)], truncated: bool = False, redacted: Literal[True] = True) -> None
Public class in m3.async_api.
Public fields and methods:
reference: <class 'm3.types.EvidenceRef'>; required — Stored and validated as part of this public value.media_type: <class 'str'>; required — Stored and validated as part of this public value.content: typing.Union[JsonValue, str]; required — Stored and validated as part of this public value.size_bytes: <class 'int'>; required — Stored and validated as part of this public value.returned_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.truncated: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
RawEvidenceSource
m3.async_api.RawEvidenceSource(*values)
Public class in m3.async_api.
RawMessageEntry
m3.async_api.RawMessageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['raw_message'] = 'raw_message', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), source: m3.observability.RawEvidenceSource, direction: m3.types.EventDirection = <EventDirection.INTERNAL: 'internal'>, media_type: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], preview: m3.observability.Observation[Union[JsonValue, str]] = <factory>, evidence_ref: m3.types.EvidenceRef | None = None, size_bytes: Annotated[int, Ge(ge=0)] = 0, redacted: Literal[True] = True) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['raw_message']; default'raw_message'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.source: <enum 'RawEvidenceSource'>; required — Stored and validated as part of this public value.direction: <enum 'EventDirection'>; default<EventDirection.INTERNAL: 'internal'>— Stored and validated as part of this public value.media_type: <class 'str'>; required — Stored and validated as part of this public value.preview: <class 'm3.observability.Observation[Union[JsonValue, str]]'>; required — Stored and validated as part of this public value.evidence_ref: m3.types.EvidenceRef | None; defaultNone— Stored and validated as part of this public value.size_bytes: <class 'int'>; default0— Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
ReasoningEntry
m3.async_api.ReasoningEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['reasoning'] = 'reasoning', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), block_id: m3.observability.Observation[str] = <factory>, content: m3.observability.Observation[tuple[Annotated[Union[TextContent, FileContent, ImageContent, AudioContent, ResourceLink, OpaqueContent], FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['reasoning']; default'reasoning'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.block_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.content: <class 'm3.observability.Observation[tuple[Annotated[Union[TextContent, FileContent, ImageContent, AudioContent, ResourceLink, OpaqueContent], FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]]'>; required — Stored and validated as part of this public value.
ReportedToolCall
m3.async_api.ReportedToolCall(*, provider_call_id: m3.observability.Observation[str] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
provider_call_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
RuntimeTraceInfo
m3.async_api.RuntimeTraceInfo(*args, **kwargs)
Runtime representation of an annotated type.
SafeHttpHeader
m3.async_api.SafeHttpHeader(*, name: Literal['content-type', 'content-length', 'retry-after', 'request-id', 'x-request-id'], value: str) -> None
Public class in m3.async_api.
Public fields and methods:
name: typing.Literal['content-type', 'content-length', 'retry-after', 'request-id', 'x-request-id']; required — Stored and validated as part of this public value.value: <class 'str'>; required — Stored and validated as part of this public value.
ToolCallAttempt
m3.async_api.ToolCallAttempt(*, attempt_index: Annotated[int, Ge(ge=0)], jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request_state: m3.observability.Observation[str] = <factory>, continuation_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, operation_params: m3.observability.Observation[JsonValue] = <factory>, input_required: bool = False, result: m3.observability.Observation[ToolResult] = <factory>, raw_result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.ToolCallStatus = <ToolCallStatus.INCOMPLETE: 'incomplete'>, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>) -> None
One wire-level attempt belonging to a logical tool call.
Public fields and methods:
attempt_index: <class 'int'>; required — Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.continuation_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.operation_params: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.input_required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.raw_result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <enum 'ToolCallStatus'>; default<ToolCallStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.
ToolCallEntry
m3.async_api.ToolCallEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['tool_call'] = 'tool_call', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), call_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], provider_call_id: m3.observability.Observation[str] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[ToolResult] = <factory>, tool_status: m3.observability.ToolCallStatus = <ToolCallStatus.INCOMPLETE: 'incomplete'>, correlation: m3.observability.CorrelationState = <CorrelationState.UNAVAILABLE: 'unavailable'>, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, server_latency_ms: m3.observability.Observation[float] = <factory>, policy: m3.observability.Observation[ToolPolicyDecision] = <factory>, reported: m3.observability.Observation[ReportedToolCall] = <factory>, wire: m3.observability.Observation[WireToolCall] = <factory>, conflicts: tuple[m3.observability.EvidenceConflict, ...] = (), attempts: tuple[m3.observability.ToolCallAttempt, ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['tool_call']; default'tool_call'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.call_id: <class 'str'>; required — Stored and validated as part of this public value.provider_call_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.tool_status: <enum 'ToolCallStatus'>; default<ToolCallStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.correlation: <enum 'CorrelationState'>; default<CorrelationState.UNAVAILABLE: 'unavailable'>— Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.server_latency_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.policy: <class 'm3.observability.Observation[ToolPolicyDecision]'>; required — Stored and validated as part of this public value.reported: <class 'm3.observability.Observation[ReportedToolCall]'>; required — Stored and validated as part of this public value.wire: <class 'm3.observability.Observation[WireToolCall]'>; required — Stored and validated as part of this public value.conflicts: tuple[m3.observability.EvidenceConflict, ...]; default()— Stored and validated as part of this public value.attempts: tuple[m3.observability.ToolCallAttempt, ...]; default()— Stored and validated as part of this public value.
ToolCallStatus
m3.async_api.ToolCallStatus(*values)
Public class in m3.async_api.
ToolResult
m3.async_api.ToolResult(*, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = (), structured_content: m3.observability.Observation[JsonValue] = <factory>, is_error: bool = False, error: m3.observability.Observation[ErrorInfo] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.structured_content: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.error: <class 'm3.observability.Observation[ErrorInfo]'>; required — Stored and validated as part of this public value.
TraceEntry
m3.async_api.TraceEntry(*args, **kwargs)
Runtime representation of an annotated type.
TraceEntryBase
m3.async_api.TraceEntryBase(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=64)], parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: <class 'str'>; required — Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.
TraceStatus
m3.async_api.TraceStatus(*values)
Public class in m3.async_api.
TraceSummary
m3.async_api.TraceSummary(*, timing: m3.observability.TraceTiming = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>, turn_count: Annotated[int, Ge(ge=0)] = 0, message_count: Annotated[int, Ge(ge=0)] = 0, reasoning_count: Annotated[int, Ge(ge=0)] = 0, tool_call_count: Annotated[int, Ge(ge=0)] = 0, successful_tool_call_count: Annotated[int, Ge(ge=0)] = 0, failed_tool_call_count: Annotated[int, Ge(ge=0)] = 0, protocol_error_count: Annotated[int, Ge(ge=0)] = 0, activity_health: m3.types.ActivityHealth = <ActivityHealth.NO_CALLS: 'no_calls'>, cleanup_status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>) -> None
Public class in m3.async_api.
Public fields and methods:
timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.turn_count: <class 'int'>; default0— Stored and validated as part of this public value.message_count: <class 'int'>; default0— Stored and validated as part of this public value.reasoning_count: <class 'int'>; default0— Stored and validated as part of this public value.tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.successful_tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.failed_tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.protocol_error_count: <class 'int'>; default0— Stored and validated as part of this public value.activity_health: <enum 'ActivityHealth'>; default<ActivityHealth.NO_CALLS: 'no_calls'>— Stored and validated as part of this public value.cleanup_status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.
TraceTiming
m3.async_api.TraceTiming(*, started_at: datetime.datetime = <factory>, finished_at: datetime.datetime | None = None, start_offset_ms: Annotated[float, Ge(ge=0)] = 0, end_offset_ms: Annotated[float, Ge(ge=0)] = 0, duration_ms: Annotated[float, Ge(ge=0)] = 0) -> None
Public class in m3.async_api.
Public fields and methods:
started_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.finished_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.start_offset_ms: <class 'float'>; default0— Stored and validated as part of this public value.end_offset_ms: <class 'float'>; default0— Stored and validated as part of this public value.duration_ms: <class 'float'>; default0— Stored and validated as part of this public value.
TraceView
m3.async_api.TraceView(*, schema_id: Literal['m3.trace_view'] = 'm3.trace_view', schema_version: Literal['1.1', '1.2'] = '1.1', trace_id: m3.types.TraceId, execution_id: m3.types.ExecutionId, outcome: m3.types.ExecutionOutcome = <ExecutionOutcome.COMPLETED: 'completed'>, completeness: Literal['complete', 'partial'] = 'complete', limitations: tuple[str, ...] = (), agent: m3.types.AgentIdentity | None = None, runtime: m3.observability.DirectTrace | m3.observability.OpenCodeTrace | m3.observability.ClaudeCodeTrace | m3.observability.CodexTrace | m3.observability.PiTrace | m3.observability.ACPTrace = <factory>, summary: m3.observability.TraceSummary = <factory>, timeline: tuple[typing.Annotated[m3.observability.LifecycleEntry | m3.observability.MessageEntry | m3.observability.ReasoningEntry | m3.observability.ToolCallEntry | m3.observability.ProtocolEntry | m3.observability.TransportEntry | m3.observability.InitializationEntry | m3.observability.UsageEntry | m3.observability.InteractionEntry | m3.observability.ElicitationEntry | m3.observability.ProcessEntry | m3.observability.WorkspaceEntry | m3.observability.ArtifactEntry | m3.observability.EvaluationEntry | m3.observability.DiagnosticEntry | m3.observability.RawMessageEntry | m3.observability.ProviderEntry, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = ()) -> None
Public class in m3.async_api.
Public fields and methods:
schema_id: typing.Literal['m3.trace_view']; default'm3.trace_view'— Stored and validated as part of this public value.schema_version: typing.Literal['1.1', '1.2']; default'1.1'— Stored and validated as part of this public value.trace_id: <class 'm3.types.TraceId'>; required — Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.outcome: <enum 'ExecutionOutcome'>; default<ExecutionOutcome.COMPLETED: 'completed'>— Stored and validated as part of this public value.completeness: typing.Literal['complete', 'partial']; default'complete'— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.agent: m3.types.AgentIdentity | None; defaultNone— Stored and validated as part of this public value.runtime: m3.observability.DirectTrace | m3.observability.OpenCodeTrace | m3.observability.ClaudeCodeTrace | m3.observability.CodexTrace | m3.observability.PiTrace | m3.observability.ACPTrace; required — Stored and validated as part of this public value.summary: <class 'm3.observability.TraceSummary'>; required — Stored and validated as part of this public value.timeline: tuple[typing.Annotated[m3.observability.LifecycleEntry | m3.observability.MessageEntry | m3.observability.ReasoningEntry | m3.observability.ToolCallEntry | m3.observability.ProtocolEntry | m3.observability.TransportEntry | m3.observability.InitializationEntry | m3.observability.UsageEntry | m3.observability.InteractionEntry | m3.observability.ElicitationEntry | m3.observability.ProcessEntry | m3.observability.WorkspaceEntry | m3.observability.ArtifactEntry | m3.observability.EvaluationEntry | m3.observability.DiagnosticEntry | m3.observability.RawMessageEntry | m3.observability.ProviderEntry, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.for_turn(self, turn: '_TurnResult | _TurnState | _TurnId | str') -> 'TraceView'— Return the finalized evidence belonging to one turn.for_session(self, session_id: '_SessionId | str') -> 'TraceView'— Public method onTraceView.for_server(self, server_binding: 'str') -> 'TraceView'— Public method onTraceView.between(self, start_offset_ms: 'float', end_offset_ms: 'float') -> 'TraceView'— Public method onTraceView.
TransportEntry
m3.async_api.TransportEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['transport'] = 'transport', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), phase: Literal['connected', 'disconnected'], configured: m3.observability.Observation[TransportKind] = <factory>, instrumented: m3.observability.Observation[TransportKind] = <factory>) -> None
A stable MCP transport lifecycle observation.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['transport']; default'transport'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.phase: typing.Literal['connected', 'disconnected']; required — Stored and validated as part of this public value.configured: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.instrumented: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.
UsageEntry
m3.async_api.UsageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['usage'] = 'usage', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), input_tokens: m3.observability.Observation[int] = <factory>, output_tokens: m3.observability.Observation[int] = <factory>, reasoning_tokens: m3.observability.Observation[int] = <factory>, cache_creation_tokens: m3.observability.Observation[int] = <factory>, cache_read_tokens: m3.observability.Observation[int] = <factory>, cache_write_tokens: m3.observability.Observation[int] = <factory>, total_tokens: m3.observability.Observation[int] = <factory>, cost: m3.observability.Observation[float] = <factory>, currency: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['usage']; default'usage'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.input_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.output_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.reasoning_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_creation_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_read_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_write_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.total_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cost: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.currency: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
UsageValue
m3.async_api.UsageValue(*, input_tokens: m3.observability.Observation[int] = <factory>, output_tokens: m3.observability.Observation[int] = <factory>, reasoning_tokens: m3.observability.Observation[int] = <factory>, cache_creation_tokens: m3.observability.Observation[int] = <factory>, cache_read_tokens: m3.observability.Observation[int] = <factory>, cache_write_tokens: m3.observability.Observation[int] = <factory>, total_tokens: m3.observability.Observation[int] = <factory>, cost: m3.observability.Observation[float] = <factory>, currency: m3.observability.Observation[str] = <factory>) -> None
Value-only usage aggregate used by summaries and runtime metadata.
Public fields and methods:
input_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.output_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.reasoning_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_creation_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_read_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_write_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.total_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cost: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.currency: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
WireToolCall
m3.async_api.WireToolCall(*, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[ToolResult] = <factory>, latency_ms: m3.observability.Observation[float] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.latency_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.
WorkspaceEntry
m3.async_api.WorkspaceEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['workspace'] = 'workspace', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), change: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.async_api.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['workspace']; default'workspace'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.change: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
m3.matchers
CheckGroup
m3.matchers.CheckGroup(redaction_config: '_RedactionConfig | None' = None) -> 'None'
Collect assertion failures and report them together on context exit.
Public fields and methods:
expect(self, subject: '_Any') -> 'Expectation[_Any]'— Public method onCheckGroup.
Expectation
m3.matchers.Expectation(subject: '_SubjectT', sink: '_FailureSink | None' = None, redaction_config: '_RedactionConfig | None' = None) -> 'None'
One-shot assertion facade; optional pytest recording persists checks.
Public fields and methods:
to_have_text(self, expected: 'str') -> 'None'— Public method onExpectation.to_have_text_containing(self, expected: 'str') -> 'None'— Public method onExpectation.to_have_text_matching(self, pattern: 'str', *, flags: 'int' = 0) -> 'None'— Public method onExpectation.to_have_text_matching_regex(self, pattern: 'str', *, flags: 'int' = 0) -> 'None'— Public method onExpectation.to_not_have_text(self, unexpected: 'str', *, current_snapshot: 'bool' = False) -> 'None'— Public method onExpectation.to_not_have_text_containing(self, unexpected: 'str', *, current_snapshot: 'bool' = False) -> 'None'— Public method onExpectation.to_have_structured_content(self, expected: 'object') -> 'None'— Public method onExpectation.to_have_content(self, expected: '_Any', *, ordered: 'bool' = True) -> 'None'— Public method onExpectation.to_have_ordered_content(self, expected: '_Any') -> 'None'— Public method onExpectation.to_have_unordered_content(self, expected: '_Any') -> 'None'— Public method onExpectation.to_have_tool_calls(self, expected: '_Sequence[str]', *, ordered: 'bool' = True, server: 'str | None' = None, turn: '_TurnSelector | None' = None, evidence: "_Literal['wire', 'reported', 'any']" = 'wire', current_snapshot: 'bool' = False) -> 'None'— Match the complete list of tool names, including repeated calls.to_have_tool_call(self, tool: 'str | None' = None, *, name: 'str | None' = None, server: 'str | None' = None, arguments: '_Any' = None, arguments_partial: 'bool' = False, arguments_unordered: 'bool' = False, arguments_regex: 'bool' = False, arguments_tolerance: 'float | None' = None, argument_predicate: '_Callable[[_Any], bool] | None' = None, result: '_Any' = None, result_partial: 'bool' = False, arguments_observed_null: 'bool' = False, result_observed_null: 'bool' = False, status: 'str | None' = None, count: 'int | None' = None, min_count: 'int | None' = None, max_count: 'int | None' = None, turn: '_TurnSelector | None' = None, predicate: '_Callable[[_Mapping[str, _Any]], bool] | None' = None, server_name: 'str | None' = None, evidence: "_Literal['wire', 'reported', 'any']" = 'wire', min_latency_ms: 'float | None' = None, max_latency_ms: 'float | None' = None, current_snapshot: 'bool' = False) -> 'None'— Public method onExpectation.to_not_have_tool_call(self, tool: 'str | None' = None, *, current_snapshot: 'bool' = False, **kwargs: '_Any') -> 'None'— Public method onExpectation.to_have_no_tool_call(self, tool: 'str | None' = None, *, current_snapshot: 'bool' = False, **kwargs: '_Any') -> 'None'— Public method onExpectation.to_have_reported_tool_call(self, tool: 'str | None' = None, **kwargs: '_Any') -> 'None'— Explicitly match provider/harness-reported calls without wire evidence.to_have_duration(self, expected_ms: 'float | None' = None, *, min_ms: 'float | None' = None, max_ms: 'float | None' = None, tolerance_ms: 'float' = 0.0) -> 'None'— Public method onExpectation.to_have_duration_between(self, min_ms: 'float', max_ms: 'float') -> 'None'— Public method onExpectation.to_have_lifecycle(self, lifecycle: '_ExecutionStatus | _TurnStatus | str') -> 'None'— Public method onExpectation.to_have_outcome(self, outcome: '_ExecutionOutcome | str') -> 'None'— Public method onExpectation.to_be_completed(self) -> 'None'— Public method onExpectation.to_have_terminal_outcome(self, outcome: '_ExecutionOutcome | str') -> 'None'— Public method onExpectation.to_have_error(self, expected: '_Any' = None) -> 'None'— Public method onExpectation.to_have_protocol_version(self, version: 'str') -> 'None'— Public method onExpectation.to_have_transport(self, transport: 'str') -> 'None'— Public method onExpectation.to_have_capability(self, name: 'str', *, status: '_CapabilityStatus | str | None' = None) -> 'None'— Public method onExpectation.to_have_artifact(self, artifact: '_ArtifactRef | str', *, name: 'str | None' = None) -> 'None'— Public method onExpectation.to_have_workspace_diff(self, expected: '_Any' = None, *, added: '_Any' = None, modified: '_Any' = None, deleted: '_Any' = None) -> 'None'— Assert the generic workspace projection exposed by a result/handle.to_have_trace(self, *, completeness: 'str | None' = None, limitation: 'str | None' = None) -> 'None'— Public method onExpectation.to_have_event(self, kind: '_EventKind | str', *, count: 'int | None' = None) -> 'None'— Public method onExpectation.to_eventually(self, matcher: '_Callable[[_Any], None]', *, timeout: 'float' = 5.0) -> 'None'— Public method onExpectation.
check
m3.matchers.check(*, redaction_config: '_RedactionConfig | None' = None) -> 'CheckGroup'
Public callable in m3.matchers.
expect
m3.matchers.expect(subject: '_SubjectT', *, redaction_config: '_RedactionConfig | None' = None) -> 'Expectation[_SubjectT]'
Public callable in m3.matchers.
m3.testing
ArtifactIntegrityError
m3.testing.ArtifactIntegrityError
A recorded artifact does not match its content-addressed metadata.
ExpectedCall
m3.testing.ExpectedCall(method: 'str', matcher: '_Mapping[str, _Any]' = <factory>, response: '_Any' = None, optional_call: 'bool' = False, minimum: 'int' = 1, maximum: 'int | None' = 1, subset_match: 'bool' = False, unordered_group: 'str | None' = None, fallback_call: 'bool' = False, calls: 'int' = 0) -> None
ExpectedCall(method: 'str', matcher: '_Mapping[str, _Any]' = <factory>, response: '_Any' = None, optional_call: 'bool' = False, minimum: 'int' = 1, maximum: 'int | None' = 1, subset_match: 'bool' = False, unordered_group: 'str | None' = None, fallback_call: 'bool' = False, calls: 'int' = 0)
Public fields and methods:
optional(self) -> 'ExpectedCall'— Public method onExpectedCall.repeated(self, minimum: 'int' = 0, maximum: 'int | None' = None) -> 'ExpectedCall'— Public method onExpectedCall.subset(self) -> 'ExpectedCall'— Public method onExpectedCall.unordered(self, group: 'str' = 'default') -> 'ExpectedCall'— Public method onExpectedCall.fallback(self) -> 'ExpectedCall'— Public method onExpectedCall.returns(self, value: '_Any') -> 'ExpectedCall'— Public method onExpectedCall.
FaultInjector
m3.testing.FaultInjector(delays: 'dict[str, float]' = <factory>, gates: 'dict[str, Gate]' = <factory>, disconnect_methods: 'set[str]' = <factory>, malformed_methods: 'set[str]' = <factory>, partial_methods: 'set[str]' = <factory>, invalid_schema_methods: 'set[str]' = <factory>, invalid_result_methods: 'set[str]' = <factory>, protocol_errors: 'dict[str, tuple[int, str]]' = <factory>, oversized_methods: 'dict[str, int]' = <factory>, reordered_methods: 'set[str]' = <factory>, duplicate_id_methods: 'set[str]' = <factory>, cancel_before_methods: 'set[str]' = <factory>, process_crash_methods: 'set[str]' = <factory>, race_gates: 'dict[str, Gate]' = <factory>, reorder_window: 'float' = 0.01) -> None
Deterministic faults for decoded in-process or literal stdio fixtures.
Public fields and methods:
delay(self, method: 'str', seconds: 'float') -> 'FaultInjector'— Public method onFaultInjector.hang(self, method: 'str', gate: 'Gate | None' = None) -> 'Gate'— Public method onFaultInjector.disconnect(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.malformed(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.partial_frame(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.invalid_schema(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.invalid_result(self, method: 'str') -> 'FaultInjector'— Advertise an output schema and return a violating structured result.duplicate_id(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.reorder(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.oversized(self, method: 'str', size: 'int') -> 'FaultInjector'— Public method onFaultInjector.cancel_before_dispatch(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.process_crash(self, method: 'str') -> 'FaultInjector'— Exit the dedicated stdio fixture with a non-zero status.cancellation_race(self, method: 'str') -> 'FaultInjector'— Public method onFaultInjector.race_gate(self, method: 'str') -> 'Gate'— Return the gate deciding whether a raced response is released.protocol_error(self, method: 'str', code: 'int' = -32000, message: 'str' = 'mock protocol error') -> 'FaultInjector'— Public method onFaultInjector.stdio_server(self, *, name: 'str' = 'wire-fault') -> '_StdioServer'— Return a safe stdio fixture that applies literal wire faults.close_fixture(self) -> 'None'— Public method onFaultInjector.before(self, method: 'str') -> 'None'— Public method onFaultInjector.response(self, method: 'str', value: '_Any') -> '_Any'— Apply deterministic response-shape faults after handler output.
Gate
m3.testing.Gate(*, open: 'bool' = False) -> 'None'
Deterministic async gate for delay and hang tests.
Public fields and methods:
open(self) -> 'None'— Public method onGate.release(self) -> 'None'— Public method onGate.close(self) -> 'None'— Public method onGate.wait(self, *, poll_seconds: 'float' = 0.001) -> 'None'— Public method onGate.wait_async(self, *, poll_seconds: 'float' = 0.001) -> 'None'— Alias with an explicit name for composing deterministic races.
MockExpectationError
m3.testing.MockExpectationError
A scripted mock interaction did not match.
MockMCPServer
m3.testing.MockMCPServer(name: 'str' = 'mock-mcp', *, version: 'str' = '1', strict: 'bool' = True, redaction_config: '_RedactionConfig | None' = None, faults: 'FaultInjector | None' = None, state: '_Mapping[str, _Any] | None' = None) -> 'None'
Decorator-defined and stateful official in-process MCP server.
Public fields and methods:
tool(self, name: 'str | _Callable[..., _Any] | None' = None, *, description: 'str | None' = None, input_schema: '_Mapping[str, _Any] | None' = None, output_schema: '_Mapping[str, _Any] | None' = None) -> '_Any'— Public method onMockMCPServer.resource(self, uri: 'str', *, name: 'str | None' = None, mime_type: 'str | None' = None) -> '_Callable[[_Callable[_P, _R]], _Callable[_P, _R]]'— Public method onMockMCPServer.resource_template(self, uri_template: 'str', *, name: 'str | None' = None, description: 'str | None' = None, mime_type: 'str | None' = None) -> '_types.ResourceTemplate'— Register a resource template exposed byresources/templates/list.prompt(self, name: 'str | _Callable[..., _Any] | None' = None, *, description: 'str | None' = None) -> '_Any'— Public method onMockMCPServer.expect(self, method: 'str', *, optional: 'bool' = False, repeat: 'int | tuple[int, int | None] | None' = None, subset: 'bool' = False, unordered: 'str | None' = None, fallback: 'bool' = False, **matcher: '_Any') -> 'ExpectedCall'— Public method onMockMCPServer.expect_call(self, method: 'str', *, optional: 'bool' = False, repeat: 'int | tuple[int, int | None] | None' = None, subset: 'bool' = False, unordered: 'str | None' = None, fallback: 'bool' = False, **matcher: '_Any') -> 'ExpectedCall'— Public method onMockMCPServer.expect_tool_call(self, name: 'str', arguments: '_Mapping[str, _Any] | None' = None, **options: '_Any') -> 'ExpectedCall'— Public method onMockMCPServer.server(self) -> '_Server'— Public method onMockMCPServer.in_process(self, *, name: 'str | None' = None) -> '_InProcessServer'— Return a decodedSessionMessagein-process fixture.verify(self) -> 'None'— Public method onMockMCPServer.recording(self) -> 'Recording'— Public method onMockMCPServer.close(self) -> 'None'— Public method onMockMCPServer.
MockProtocolError
m3.testing.MockProtocolError(code: 'int', message: 'str') -> 'None'
Public class in m3.testing.
RecordedArtifact
m3.testing.RecordedArtifact(artifact_id: 'str', sha256: 'str', size_bytes: 'int', media_type: 'str | None' = None) -> None
Content-addressed artifact metadata carried by a recording.
Public fields and methods:
from_bytes(cls, artifact_id: 'str', content: 'bytes', *, media_type: 'str | None' = None) -> 'RecordedArtifact'— Public method onRecordedArtifact.validate(self, content: 'bytes') -> 'None'— Public method onRecordedArtifact.model(self) -> 'dict[str, _JsonValue]'— Public method onRecordedArtifact.
RecordedInteraction
m3.testing.RecordedInteraction(method: 'str', params: '_Mapping[str, _JsonValue]', response: '_JsonValue | None' = None, error: '_Mapping[str, _JsonValue] | None' = None, sequence: 'int' = 0, provenance: 'tuple[str, ...]' = ()) -> None
RecordedInteraction(method: 'str', params: '_Mapping[str, _JsonValue]', response: '_JsonValue | None' = None, error: '_Mapping[str, _JsonValue] | None' = None, sequence: 'int' = 0, provenance: 'tuple[str, ...]' = ())
Public fields and methods:
model(self) -> 'dict[str, _JsonValue]'— Public method onRecordedInteraction.
Recording
m3.testing.Recording(interactions: 'tuple[RecordedInteraction, ...]', redaction_bound: 'bool', provenance: 'tuple[str, ...]' = (), server_name: 'str' = 'mock-mcp', server_version: 'str' = '1', initialization: '_Mapping[str, _JsonValue]' = <factory>, artifacts: 'tuple[RecordedArtifact, ...]' = (), redaction_bindings: 'tuple[RedactionBinding, ...]' = <factory>, _runtime: '_RedactionRuntime' = <factory>) -> None
Recording(interactions: 'tuple[RecordedInteraction, ...]', redaction_bound: 'bool', provenance: 'tuple[str, ...]' = (), server_name: 'str' = 'mock-mcp', server_version: 'str' = '1', initialization: '_Mapping[str, _JsonValue]' = <factory>, artifacts: 'tuple[RecordedArtifact, ...]' = (), redaction_bindings: 'tuple[RedactionBinding, ...]' = <factory>, _runtime: '_RedactionRuntime' = <factory>)
Public fields and methods:
with_redaction_config(self, config: '_RedactionConfig') -> 'Recording'— Bind an explicit in-process redaction config without serializing secrets.validate_artifacts(self, contents: '_Mapping[str, bytes]') -> 'None'— Validate every supplied artifact against the recorded digest/length.model_dump(self, *, config: '_RedactionConfig | None' = None) -> 'dict[str, _JsonValue]'— Public method onRecording.to_json(self, *, config: '_RedactionConfig | None' = None) -> 'str'— Public method onRecording.redacted(self, *, config: '_RedactionConfig | None' = None) -> 'Recording'— Return a detached recording whose persisted values are redacted.from_json(cls, value: 'str') -> 'Recording'— Public method onRecording.
RedactionBinding
m3.testing.RedactionBinding(source: 'str' = 'explicit', version: 'str' = '1', wildcard_paths: 'tuple[str, ...]' = (), secret_references: 'tuple[str, ...]' = ()) -> None
Serializable redaction provenance without secret values.
Public fields and methods:
model(self) -> 'dict[str, _JsonValue]'— Public method onRedactionBinding.
ReplayMismatch
m3.testing.ReplayMismatch
A strict replay request differs from the recorded interaction.
ReplayServer
m3.testing.ReplayServer(recording: 'Recording', *, strict: 'bool' = True, redaction_config: '_RedactionConfig | None' = None, artifacts: '_Mapping[str, bytes] | None' = None, expected_server: 'tuple[str, str] | None' = None) -> 'None'
Strict JSON-only replay matcher.
Public fields and methods:
match(self, method: 'str', params: '_Mapping[str, _Any]') -> 'RecordedInteraction'— Public method onReplayServer.verify_replay(self) -> 'None'— Public method onReplayServer.
VirtualClock
m3.testing.VirtualClock(start: 'float' = 0.0) -> 'None'
A process-local virtual clock with awaitable deterministic sleeps.
Public fields and methods:
sleep(self, duration: 'float') -> 'None'— Public method onVirtualClock.advance(self, duration: 'float') -> 'float'— Public method onVirtualClock.
m3.evaluations
AsyncEvaluator
m3.evaluations.AsyncEvaluator(*args, **kwargs)
Public class in m3.evaluations.
EvaluationDecision
m3.evaluations.EvaluationDecision(*, status: m3.types.EvaluationStatus, score: float | None = None, rationale: str | None = None, metrics: collections.abc.Mapping[str, float] = <factory>, provenance: m3.types.EvaluationSource | None = None, details: collections.abc.Mapping[str, typing.Any] = <factory>) -> None
Structured evaluator output, compatible with scalar verdicts.
Public fields and methods:
status: <enum 'EvaluationStatus'>; required — Stored and validated as part of this public value.score: float | None; defaultNone— Stored and validated as part of this public value.rationale: str | None; defaultNone— Stored and validated as part of this public value.metrics: collections.abc.Mapping[str, float]; required — Stored and validated as part of this public value.provenance: m3.types.EvaluationSource | None; defaultNone— Stored and validated as part of this public value.details: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.
EvaluationRunner
m3.evaluations.EvaluationRunner(*, registry: 'EvaluatorRegistry | None' = None, store: 'EvaluationStore | None' = None, durable_store: '_Any | None' = None, redaction_config: '_RedactionConfig | None' = None, max_judge_requests: 'int | None' = None, run_id: 'str | None' = None) -> 'None'
Run and persist deterministic evaluations in a separate store.
Public fields and methods:
register(self, name: 'str', evaluator: 'EvaluatorCallable | AsyncEvaluator') -> 'EvaluatorRegistration'— Public method onEvaluationRunner.evaluate(self, subject: '_Any', evaluator: 'str | EvaluatorCallable', *, required: 'bool' = False, goal: 'str | None' = None, trace: '_TraceResult | None' = None, artifacts: '_Sequence[_ArtifactRef]' = (), metadata: '_Mapping[str, str | int | float | bool | None] | None' = None, evaluation_id: '_EvaluationId | str | None' = None, execution_id: '_ExecutionId | str | None' = None, turn_id: '_TurnId | str | None' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Public method onEvaluationRunner.evaluate_async(self, subject: '_Any', evaluator: 'str | _Any', *, required: 'bool' = False, goal: 'str | None' = None, trace: '_TraceResult | None' = None, artifacts: '_Sequence[_ArtifactRef]' = (), metadata: '_Mapping[str, str | int | float | bool | None] | None' = None, evaluation_id: '_EvaluationId | str | None' = None, execution_id: '_ExecutionId | str | None' = None, turn_id: '_TurnId | str | None' = None, case_id: 'str | None' = None) -> '_EvaluationResult'— Public method onEvaluationRunner.results(self) -> 'tuple[_EvaluationResult, ...]'— Public method onEvaluationRunner.
EvaluationStore
m3.evaluations.EvaluationStore(*args, **kwargs)
Public class in m3.evaluations.
Public fields and methods:
save(self, result: '_EvaluationResult') -> 'None'— Public method onEvaluationStore.get(self, evaluation_id: '_EvaluationId | str') -> '_EvaluationResult | None'— Public method onEvaluationStore.all(self) -> 'tuple[_EvaluationResult, ...]'— Public method onEvaluationStore.
EvaluationVerdict
m3.evaluations.EvaluationVerdict
Represent a PEP 604 union type
Evaluator
m3.evaluations.Evaluator(*args, **kwargs)
An evaluator callback over an immutable context.
EvaluatorCallable
m3.evaluations.EvaluatorCallable(*args, **kwargs)
Public callable in m3.evaluations.
EvaluatorRegistry
m3.evaluations.EvaluatorRegistry() -> 'None'
Explicit runtime registry for evaluator callables.
Public fields and methods:
register(self, name: 'str', evaluator: '_Any') -> 'EvaluatorRegistration'— Public method onEvaluatorRegistry.get(self, name: 'str') -> '_Any'— Public method onEvaluatorRegistry.names(self) -> 'tuple[str, ...]'— Public method onEvaluatorRegistry.
EvaluatorRegistration
m3.evaluations.EvaluatorRegistration(name: 'str', evaluator: 'EvaluatorCallable | AsyncEvaluator') -> None
Runtime-only registration; only its stable name is serializable.
InMemoryEvaluationStore
m3.evaluations.InMemoryEvaluationStore() -> 'None'
Small independent store; evaluations never rewrite execution state.
Public fields and methods:
save(self, result: '_EvaluationResult') -> 'None'— Public method onInMemoryEvaluationStore.get(self, evaluation_id: '_EvaluationId | str') -> '_EvaluationResult | None'— Public method onInMemoryEvaluationStore.all(self) -> 'tuple[_EvaluationResult, ...]'— Public method onInMemoryEvaluationStore.
RequiredEvaluationError
m3.evaluations.RequiredEvaluationError(result: '_EvaluationResult') -> 'None'
A required non-passing evaluation after its result was persisted.
register_builtin_evaluators
m3.evaluations.register_builtin_evaluators(registry: 'EvaluatorRegistry') -> 'None'
Install the reserved deterministic evaluators on a runtime registry.
m3.snapshots
SnapshotOptions
m3.snapshots.SnapshotOptions(include_fields: 'frozenset[str]' = frozenset(), omitted_fields: 'frozenset[str]' = frozenset({'cost', 'cost_usd', 'created_at', 'duration', 'duration_ms', 'elapsed_ms', 'end_time', 'ended_at', 'execution_id', 'finished_at', 'input_cost', 'latency', 'latency_ms', 'output_cost', 'path', 'paths', 'port', 'ports', 'provider_metadata', 'run_id', 'run_ids', 'session_id', 'start_time', 'started_at', 'timestamp', 'timestamps', 'total_cost', 'trace_id', 'turn_id', 'updated_at', 'vendor_metadata'})) -> None
Controls stable snapshot omission and explicit field opt-ins.
snapshot
m3.snapshots.snapshot(value: '_Any', *, include_fields: '_Iterable[str]' = (), omitted_fields: '_Iterable[str] | None' = None, options: 'SnapshotOptions | None' = None, config: '_RedactionConfig | None' = None) -> '_SnapshotValue'
Return a deterministic, redacted, JSON-compatible snapshot value.
m3.policy
ConfirmationHook
m3.policy.ConfirmationHook(*args, **kwargs)
Public callable in m3.policy.
ToolDescriptor
m3.policy.ToolDescriptor(*, server: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], destructive: bool = False) -> None
A qualified advertised tool identity used during preflight.
Public fields and methods:
server: <class 'str'>; required — Stored and validated as part of this public value.name: <class 'str'>; required — Stored and validated as part of this public value.destructive: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.
ToolPolicyDecision
m3.policy.ToolPolicyDecision(*, allowed: bool, requires_confirmation: bool = False, reason: str, evidence: m3.policy.ToolPolicyEvidence) -> None
Decision for one qualified tool call.
Public fields and methods:
allowed: <class 'bool'>; required — Stored and validated as part of this public value.requires_confirmation: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.reason: <class 'str'>; required — Stored and validated as part of this public value.evidence: <class 'm3.policy.ToolPolicyEvidence'>; required — Stored and validated as part of this public value.
ToolPolicyEvidence
m3.policy.ToolPolicyEvidence(*, requested: str, enforced: str | None = None, observed: str | None = None, unavailable: tuple[str, ...] = (), portable: bool = True, nonportable_reason: str | None = None) -> None
Truthful requested/enforced/observed policy status.
Public fields and methods:
requested: <class 'str'>; required — Stored and validated as part of this public value.enforced: str | None; defaultNone— Stored and validated as part of this public value.observed: str | None; defaultNone— Stored and validated as part of this public value.unavailable: tuple[str, ...]; default()— Stored and validated as part of this public value.portable: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.nonportable_reason: str | None; defaultNone— Stored and validated as part of this public value.
ToolPolicyEvaluator
m3.policy.ToolPolicyEvaluator(tools: '_Iterable[ToolDescriptor]') -> 'None'
Evaluate portable and explicitly native tool policies.
Public fields and methods:
preflight(self, policy: '_ToolPolicy', *, harness_name: 'str', supports_enforcement: 'bool') -> 'ToolPolicyEvidence'— Public method onToolPolicyEvaluator.decide(self, policy: '_ToolPolicy', descriptor: 'ToolDescriptor', *, harness_name: 'str', supports_enforcement: 'bool', confirm: 'ConfirmationHook | None' = None) -> 'ToolPolicyDecision'— Public method onToolPolicyEvaluator.
evaluate_tool_policy
m3.policy.evaluate_tool_policy(policy: '_ToolPolicy', tools: '_Iterable[ToolDescriptor]', *, harness_name: 'str', supports_enforcement: 'bool') -> 'ToolPolicyEvidence'
Run policy preflight and return only truthful usage evidence.
m3.pytest_plugin
pytest_addoption
m3.pytest_plugin.pytest_addoption(parser: '_Any') -> 'None'
Public callable in m3.pytest_plugin.
pytest_configure
m3.pytest_plugin.pytest_configure(config: '_Any') -> 'None'
Public callable in m3.pytest_plugin.
pytest_unconfigure
m3.pytest_plugin.pytest_unconfigure(config: '_Any') -> 'None'
Public callable in m3.pytest_plugin.
pytest_generate_tests
m3.pytest_plugin.pytest_generate_tests(metafunc: '_Any') -> 'None'
Public callable in m3.pytest_plugin.
m3_kit
m3.pytest_plugin.m3_kit(request: '_Any') -> '_Any'
Public callable in m3.pytest_plugin.
agent
m3.pytest_plugin.agent(request: '_Any', m3_kit: '_Any') -> '_Any'
Public callable in m3.pytest_plugin.
server
m3.pytest_plugin.server(request: '_Any') -> '_Any'
Selected typed server for an M3 marked test.
pytest_collection_modifyitems
m3.pytest_plugin.pytest_collection_modifyitems(config: '_Any', items: 'list[_Any]') -> 'None'
Public callable in m3.pytest_plugin.
m3.matrix
ToolCase
m3.matrix.ToolCase(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], id: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, arguments: collections.abc.Mapping[str, typing.Any] = <factory>, prompt: str | m3.types.UserMessage | None = None) -> None
One deterministic call definition owned by a server case.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.id: str | None; defaultNone— Stored and validated as part of this public value.arguments: collections.abc.Mapping[str, typing.Any]; required — Stored and validated as part of this public value.prompt: str | m3.types.UserMessage | None; defaultNone— Stored and validated as part of this public value.
ServerCase
m3.matrix.ServerCase(*, name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], server: m3.types.StdioServer | m3.types.HTTPServer | m3.types.InProcessServer, tools: tuple[m3.matrix.ToolCase, ...]) -> None
A serializable MCP server and its owned logical tool cases.
Public fields and methods:
name: <class 'str'>; required — Stored and validated as part of this public value.server: m3.types.StdioServer | m3.types.HTTPServer | m3.types.InProcessServer; required — Stored and validated as part of this public value.tools: tuple[m3.matrix.ToolCase, ...]; required — Stored and validated as part of this public value.tool(self, logical_id: 'str') -> 'ToolCase'— Return the tool withlogical_idor raise a clear lookup error.
ToolMatrix
m3.matrix.ToolMatrix(*, servers: tuple[m3.matrix.ServerCase, ...], id: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, matrix_id: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, trials: Annotated[int, Strict(strict=True), Ge(ge=1)] = 1) -> None
Expand server-owned deterministic tool cases in declared order.
Public fields and methods:
servers: tuple[m3.matrix.ServerCase, ...]; required — Stored and validated as part of this public value.id: str | None; defaultNone— Stored and validated as part of this public value.matrix_id: str | None; defaultNone— Stored and validated as part of this public value.trials: <class 'int'>; default1— Stored and validated as part of this public value.cases(self) -> 'tuple[ToolMatrixCase, ...]'— Public method onToolMatrix.parametrize(self, argname: 'str' = 'case') -> '_pytest.MarkDecorator'— Return pytest's ordinary parametrization decorator for this matrix.
ToolMatrixCase
m3.matrix.ToolMatrixCase(*, id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=1024)], server: m3.matrix.ServerCase, tool: m3.matrix.ToolCase, matrix_id: str | None = None, cell_id: str | None = None, trial: Annotated[int, Strict(strict=True), Ge(ge=1)] = 1, trial_count: Annotated[int, Strict(strict=True), Ge(ge=1)] = 1) -> None
One server-owned deterministic tool cell.
Public fields and methods:
id: <class 'str'>; required — Stored and validated as part of this public value.server: <class 'm3.matrix.ServerCase'>; required — Stored and validated as part of this public value.tool: <class 'm3.matrix.ToolCase'>; required — Stored and validated as part of this public value.matrix_id: str | None; defaultNone— Stored and validated as part of this public value.cell_id: str | None; defaultNone— Stored and validated as part of this public value.trial: <class 'int'>; default1— Stored and validated as part of this public value.trial_count: <class 'int'>; default1— Stored and validated as part of this public value.run(self, *, kit: '_MCPTestKit | None' = None, timeout: 'float | None' = None, validate_schemas: 'bool' = False, metadata: '_Mapping[str, _Scalar] | None' = None) -> '_ExecutionResult'— Run this cell through the normal synchronous execution boundary.run_async(self, *, kit: '_AsyncMCPTestKit | None' = None, timeout: 'float | None' = None, validate_schemas: 'bool' = False, metadata: '_Mapping[str, _Scalar] | None' = None) -> '_ExecutionResult'— Run this cell through the normal asynchronous execution boundary.
m3.observability
ACPTrace
m3.observability.ACPTrace(*, kind: Literal['acp'] = 'acp', session_id: m3.observability.Observation[str] = <factory>, protocol_version: m3.observability.Observation[str] = <factory>, agent_identity: m3.observability.Observation[JsonValue] = <factory>, available_modes: m3.observability.Observation[JsonValue] = <factory>, current_mode: m3.observability.Observation[str] = <factory>, config_options: m3.observability.Observation[JsonValue] = <factory>, selected_config: m3.observability.Observation[JsonValue] = <factory>, plan_state_available: m3.observability.Observation[bool] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
kind: typing.Literal['acp']; default'acp'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.agent_identity: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.available_modes: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.current_mode: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.config_options: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.selected_config: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.plan_state_available: <class 'm3.observability.Observation[bool]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
ArtifactEntry
m3.observability.ArtifactEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['artifact'] = 'artifact', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), artifact: m3.types.ArtifactRef) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['artifact']; default'artifact'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.artifact: <class 'm3.types.ArtifactRef'>; required — Stored and validated as part of this public value.
CaptureOptions
m3.observability.CaptureOptions(*, capture_raw_evidence: bool = True, capture_provider_messages: bool = True, capture_stderr: bool = True, raw_preview_bytes: Annotated[int, Gt(gt=0)] = 65536, raw_frame_bytes: Annotated[int, Gt(gt=0)] = 1048576, raw_execution_bytes: Annotated[int, Gt(gt=0)] = 67108864) -> None
Boundaries for redacted provider/MCP evidence capture.
Public fields and methods:
capture_raw_evidence: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.capture_provider_messages: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.capture_stderr: <class 'bool'>; defaultTrue— Stored and validated as part of this public value.raw_preview_bytes: <class 'int'>; default65536— Stored and validated as part of this public value.raw_frame_bytes: <class 'int'>; default1048576— Stored and validated as part of this public value.raw_execution_bytes: <class 'int'>; default67108864— Stored and validated as part of this public value.
ClaudeCodeTrace
m3.observability.ClaudeCodeTrace(*, kind: Literal['claude_code'] = 'claude_code', session_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, result_subtype: m3.observability.Observation[str] = <factory>, stop_reason: m3.observability.Observation[str] = <factory>, service_tier: m3.observability.Observation[str] = <factory>, api_duration_ms: m3.observability.Observation[float] = <factory>, encrypted_reasoning: m3.observability.Observation[bool] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
kind: typing.Literal['claude_code']; default'claude_code'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.result_subtype: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.stop_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.service_tier: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.api_duration_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.encrypted_reasoning: <class 'm3.observability.Observation[bool]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
CodexTrace
m3.observability.CodexTrace(*, kind: Literal['codex'] = 'codex', thread_id: m3.observability.Observation[str] = <factory>, turn_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, sandbox: m3.observability.Observation[str] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
kind: typing.Literal['codex']; default'codex'— Stored and validated as part of this public value.thread_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.turn_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.sandbox: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
CorrelationState
m3.observability.CorrelationState(*values)
Public class in m3.observability.
DiagnosticEntry
m3.observability.DiagnosticEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['diagnostic'] = 'diagnostic', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), code: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], message: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], stage: Annotated[str | None, MaxLen(max_length=128)] = None, operation: Annotated[str | None, MaxLen(max_length=256)] = None, elapsed_seconds: Annotated[float | None, Ge(ge=0)] = None, timeout_seconds: Annotated[float | None, Gt(gt=0)] = None) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['diagnostic']; default'diagnostic'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.code: <class 'str'>; required — Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.stage: str | None; defaultNone— Stored and validated as part of this public value.operation: str | None; defaultNone— Stored and validated as part of this public value.elapsed_seconds: float | None; defaultNone— Stored and validated as part of this public value.timeout_seconds: float | None; defaultNone— Stored and validated as part of this public value.
DirectTrace
m3.observability.DirectTrace(*, kind: Literal['direct'] = 'direct', transport: m3.observability.Observation[TransportKind] = <factory>, protocol: m3.observability.Observation[str] = <factory>, initialization: m3.observability.Observation[InitializationValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
kind: typing.Literal['direct']; default'direct'— Stored and validated as part of this public value.transport: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.protocol: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.initialization: <class 'm3.observability.Observation[InitializationValue]'>; required — Stored and validated as part of this public value.
ElicitationEntry
m3.observability.ElicitationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['elicitation'] = 'elicitation', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), server: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=256)] = None, operation_kind: Literal['tool', 'prompt', 'resource'], operation_name: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], logical_operation_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], round_index: Annotated[int, Ge(ge=1)], request_key: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], mode: Literal['form', 'url'], message: m3.observability.Observation[str] = <factory>, requested_schema: m3.observability.Observation[JsonValue] = <factory>, url: m3.observability.Observation[str] = <factory>, elicitation_id: m3.observability.Observation[str] = <factory>, request_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, action: Optional[Literal['accept', 'decline', 'cancel']] = None, content: m3.observability.Observation[JsonValue] = <factory>) -> None
One keyed elicitation embedded in an MRTR input-required round.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['elicitation']; default'elicitation'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Literal['tool', 'prompt', 'resource']; required — Stored and validated as part of this public value.operation_name: <class 'str'>; required — Stored and validated as part of this public value.logical_operation_id: <class 'str'>; required — Stored and validated as part of this public value.round_index: <class 'int'>; required — Stored and validated as part of this public value.request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['form', 'url']; required — Stored and validated as part of this public value.message: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.requested_schema: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.url: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.elicitation_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.action: typing.Optional[typing.Literal['accept', 'decline', 'cancel']]; defaultNone— Stored and validated as part of this public value.content: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
EvaluationEntry
m3.observability.EvaluationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['evaluation'] = 'evaluation', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), evaluation: m3.types.EvaluationResult) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['evaluation']; default'evaluation'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.evaluation: <class 'm3.types.EvaluationResult'>; required — Stored and validated as part of this public value.
EvidenceCapture
m3.observability.EvidenceCapture(*, reference: m3.types.EvidenceRef, preview: m3.observability.Observation[str], original_size_bytes: Annotated[int, Ge(ge=0)], stored_size_bytes: Annotated[int, Ge(ge=0)], redacted: bool, truncated: bool) -> None
Typed result of bounded, redacted raw-evidence capture.
Public fields and methods:
reference: <class 'm3.types.EvidenceRef'>; required — Stored and validated as part of this public value.preview: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.original_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.stored_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.redacted: <class 'bool'>; required — Stored and validated as part of this public value.truncated: <class 'bool'>; required — Stored and validated as part of this public value.
EvidenceConflict
m3.observability.EvidenceConflict(*, field: Literal['server', 'tool', 'arguments', 'result', 'status'], reported: m3.observability.Observation[JsonValue], wire: m3.observability.Observation[JsonValue]) -> None
Public class in m3.observability.
Public fields and methods:
field: typing.Literal['server', 'tool', 'arguments', 'result', 'status']; required — Stored and validated as part of this public value.reported: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.wire: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
HttpExchange
m3.observability.HttpExchange(*, method: Annotated[str, MinLen(min_length=1)], status_code: Annotated[int, Ge(ge=100), Le(le=599)], headers: tuple[m3.observability.SafeHttpHeader, ...] = ()) -> None
Public class in m3.observability.
Public fields and methods:
method: <class 'str'>; required — Stored and validated as part of this public value.status_code: <class 'int'>; required — Stored and validated as part of this public value.headers: tuple[m3.observability.SafeHttpHeader, ...]; default()— Stored and validated as part of this public value.
InitializationEntry
m3.observability.InitializationEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['initialization'] = 'initialization', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), protocol_version: m3.observability.Observation[str] = <factory>, server_name: m3.observability.Observation[str] = <factory>, server_version: m3.observability.Observation[str] = <factory>, instructions: m3.observability.Observation[str] = <factory>, capabilities: m3.observability.Observation[JsonValue] = <factory>, tools: m3.observability.Observation[tuple[ToolInfo, ...]] = <factory>, resources: m3.observability.Observation[tuple[ResourceInfo, ...]] = <factory>, resource_templates: m3.observability.Observation[tuple[TemplateInfo, ...]] = <factory>, prompts: m3.observability.Observation[tuple[PromptInfo, ...]] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['initialization']; default'initialization'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.instructions: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.capabilities: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.tools: <class 'm3.observability.Observation[tuple[ToolInfo, ...]]'>; required — Stored and validated as part of this public value.resources: <class 'm3.observability.Observation[tuple[ResourceInfo, ...]]'>; required — Stored and validated as part of this public value.resource_templates: <class 'm3.observability.Observation[tuple[TemplateInfo, ...]]'>; required — Stored and validated as part of this public value.prompts: <class 'm3.observability.Observation[tuple[PromptInfo, ...]]'>; required — Stored and validated as part of this public value.
InitializationValue
m3.observability.InitializationValue(*, protocol_version: m3.observability.Observation[str] = <factory>, server_name: m3.observability.Observation[str] = <factory>, server_version: m3.observability.Observation[str] = <factory>, instructions: m3.observability.Observation[str] = <factory>, capabilities: m3.observability.Observation[JsonValue] = <factory>, tools: m3.observability.Observation[tuple[ToolInfo, ...]] = <factory>, resources: m3.observability.Observation[tuple[ResourceInfo, ...]] = <factory>, resource_templates: m3.observability.Observation[tuple[TemplateInfo, ...]] = <factory>, prompts: m3.observability.Observation[tuple[PromptInfo, ...]] = <factory>) -> None
Value-only initialization metadata used by runtime information.
Public fields and methods:
protocol_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server_version: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.instructions: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.capabilities: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.tools: <class 'm3.observability.Observation[tuple[ToolInfo, ...]]'>; required — Stored and validated as part of this public value.resources: <class 'm3.observability.Observation[tuple[ResourceInfo, ...]]'>; required — Stored and validated as part of this public value.resource_templates: <class 'm3.observability.Observation[tuple[TemplateInfo, ...]]'>; required — Stored and validated as part of this public value.prompts: <class 'm3.observability.Observation[tuple[PromptInfo, ...]]'>; required — Stored and validated as part of this public value.
InteractionEntry
m3.observability.InteractionEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['interaction'] = 'interaction', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), interaction_kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], request: m3.observability.Observation[JsonValue] = <factory>, response: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['interaction']; default'interaction'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.interaction_kind: <class 'str'>; required — Stored and validated as part of this public value.request: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.response: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
LifecycleEntry
m3.observability.LifecycleEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['lifecycle'] = 'lifecycle', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), phase: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)]) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['lifecycle']; default'lifecycle'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.phase: <class 'str'>; required — Stored and validated as part of this public value.
MessageEntry
m3.observability.MessageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['message'] = 'message', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), message_id: m3.observability.Observation[str] = <factory>, role: m3.observability.MessageRole = <MessageRole.ASSISTANT: 'assistant'>, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = (), stop_reason: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['message']; default'message'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.message_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.role: <enum 'MessageRole'>; default<MessageRole.ASSISTANT: 'assistant'>— Stored and validated as part of this public value.content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.stop_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
MessageRole
m3.observability.MessageRole(*values)
Public class in m3.observability.
Observation
m3.observability.Observation(*, state: m3.observability.ObservationState, value: Optional[~_T] = None, reason: m3.observability.ObservationReason | None = None, provenance: tuple[m3.types.EventSource, ...] = (), evidence_ref: m3.types.EvidenceRef | None = None) -> None
A typed value with explicit availability and provenance.
Public fields and methods:
state: <enum 'ObservationState'>; required — Stored and validated as part of this public value.value: typing.Optional[~_T]; defaultNone— Stored and validated as part of this public value.reason: m3.observability.ObservationReason | None; defaultNone— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.evidence_ref: m3.types.EvidenceRef | None; defaultNone— Stored and validated as part of this public value.
ObservationReason
m3.observability.ObservationReason(*values)
Public class in m3.observability.
ObservationState
m3.observability.ObservationState(*values)
How completely a provider-dependent value was observed.
OpenCodeTrace
m3.observability.OpenCodeTrace(*, kind: Literal['opencode'] = 'opencode', session_id: m3.observability.Observation[str] = <factory>, provider_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, http_lifecycle: m3.observability.Observation[JsonValue] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
kind: typing.Literal['opencode']; default'opencode'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.provider_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.http_lifecycle: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
PiTrace
m3.observability.PiTrace(*, kind: Literal['pi'] = 'pi', session_id: m3.observability.Observation[str] = <factory>, provider_id: m3.observability.Observation[str] = <factory>, model_id: m3.observability.Observation[str] = <factory>, finish_reason: m3.observability.Observation[str] = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
kind: typing.Literal['pi']; default'pi'— Stored and validated as part of this public value.session_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.provider_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.model_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.finish_reason: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.
ProcessEntry
m3.observability.ProcessEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['process'] = 'process', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), executable: m3.observability.Observation[str] = <factory>, pid: m3.observability.Observation[int] = <factory>, exit_code: m3.observability.Observation[int] = <factory>, signal: m3.observability.Observation[int] = <factory>, stderr: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['process']; default'process'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.executable: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.pid: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.exit_code: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.signal: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.stderr: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
ProtocolCallAttempt
m3.observability.ProtocolCallAttempt(*, attempt_index: Annotated[int, Ge(ge=0)], jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request_state: m3.observability.Observation[str] = <factory>, continuation_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, operation_params: m3.observability.Observation[JsonValue] = <factory>, input_required: bool = False, result: m3.observability.Observation[JsonValue] = <factory>, raw_result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.TraceStatus = <TraceStatus.INCOMPLETE: 'incomplete'>, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>) -> None
One wire-level attempt belonging to a prompt or resource call.
Public fields and methods:
attempt_index: <class 'int'>; required — Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.continuation_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.operation_params: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.input_required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.raw_result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.
ProtocolEntry
m3.observability.ProtocolEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['protocol'] = 'protocol', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), protocol: m3.observability.ProtocolKind, method: m3.observability.Observation[str] = <factory>, direction: m3.types.EventDirection = <EventDirection.INTERNAL: 'internal'>, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request: m3.observability.Observation[JsonValue] = <factory>, response: m3.observability.Observation[JsonValue] = <factory>, error: m3.observability.Observation[ProtocolErrorInfo] = <factory>, http: m3.observability.Observation[HttpExchange] = <factory>, operation_kind: Optional[Literal['prompt', 'resource']] = None, operation_name: m3.observability.Observation[str] = <factory>, attempts: tuple[m3.observability.ProtocolCallAttempt, ...] = ()) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['protocol']; default'protocol'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.protocol: <enum 'ProtocolKind'>; required — Stored and validated as part of this public value.method: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.direction: <enum 'EventDirection'>; default<EventDirection.INTERNAL: 'internal'>— Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.response: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.error: <class 'm3.observability.Observation[ProtocolErrorInfo]'>; required — Stored and validated as part of this public value.http: <class 'm3.observability.Observation[HttpExchange]'>; required — Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.attempts: tuple[m3.observability.ProtocolCallAttempt, ...]; default()— Stored and validated as part of this public value.
ProtocolErrorInfo
m3.observability.ProtocolErrorInfo(*, code: int | str | None = None, message: Annotated[str, MinLen(min_length=1), MaxLen(max_length=4096)], data: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
code: int | str | None; defaultNone— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.data: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
ProtocolKind
m3.observability.ProtocolKind(*values)
Public class in m3.observability.
ProviderEntry
m3.observability.ProviderEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['provider'] = 'provider', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), provider: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], category: Annotated[str, MinLen(min_length=1), MaxLen(max_length=128)], data: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['provider']; default'provider'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.provider: <class 'str'>; required — Stored and validated as part of this public value.category: <class 'str'>; required — Stored and validated as part of this public value.data: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
RawEvidence
m3.observability.RawEvidence(*, reference: m3.types.EvidenceRef, media_type: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], content: Union[JsonValue, str], size_bytes: Annotated[int, Ge(ge=0)], returned_size_bytes: Annotated[int, Ge(ge=0)], truncated: bool = False, redacted: Literal[True] = True) -> None
Public class in m3.observability.
Public fields and methods:
reference: <class 'm3.types.EvidenceRef'>; required — Stored and validated as part of this public value.media_type: <class 'str'>; required — Stored and validated as part of this public value.content: typing.Union[JsonValue, str]; required — Stored and validated as part of this public value.size_bytes: <class 'int'>; required — Stored and validated as part of this public value.returned_size_bytes: <class 'int'>; required — Stored and validated as part of this public value.truncated: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
RawEvidenceSource
m3.observability.RawEvidenceSource(*values)
Public class in m3.observability.
RawMessageEntry
m3.observability.RawMessageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['raw_message'] = 'raw_message', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), source: m3.observability.RawEvidenceSource, direction: m3.types.EventDirection = <EventDirection.INTERNAL: 'internal'>, media_type: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], preview: m3.observability.Observation[Union[JsonValue, str]] = <factory>, evidence_ref: m3.types.EvidenceRef | None = None, size_bytes: Annotated[int, Ge(ge=0)] = 0, redacted: Literal[True] = True) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['raw_message']; default'raw_message'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.source: <enum 'RawEvidenceSource'>; required — Stored and validated as part of this public value.direction: <enum 'EventDirection'>; default<EventDirection.INTERNAL: 'internal'>— Stored and validated as part of this public value.media_type: <class 'str'>; required — Stored and validated as part of this public value.preview: <class 'm3.observability.Observation[Union[JsonValue, str]]'>; required — Stored and validated as part of this public value.evidence_ref: m3.types.EvidenceRef | None; defaultNone— Stored and validated as part of this public value.size_bytes: <class 'int'>; default0— Stored and validated as part of this public value.redacted: typing.Literal[True]; defaultTrue— Stored and validated as part of this public value.
ReasoningEntry
m3.observability.ReasoningEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['reasoning'] = 'reasoning', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), block_id: m3.observability.Observation[str] = <factory>, content: m3.observability.Observation[tuple[Annotated[Union[TextContent, FileContent, ImageContent, AudioContent, ResourceLink, OpaqueContent], FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['reasoning']; default'reasoning'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.block_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.content: <class 'm3.observability.Observation[tuple[Annotated[Union[TextContent, FileContent, ImageContent, AudioContent, ResourceLink, OpaqueContent], FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]]'>; required — Stored and validated as part of this public value.
ReportedToolCall
m3.observability.ReportedToolCall(*, provider_call_id: m3.observability.Observation[str] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
provider_call_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
RuntimeTraceInfo
m3.observability.RuntimeTraceInfo(*args, **kwargs)
Runtime representation of an annotated type.
SafeHttpHeader
m3.observability.SafeHttpHeader(*, name: Literal['content-type', 'content-length', 'retry-after', 'request-id', 'x-request-id'], value: str) -> None
Public class in m3.observability.
Public fields and methods:
name: typing.Literal['content-type', 'content-length', 'retry-after', 'request-id', 'x-request-id']; required — Stored and validated as part of this public value.value: <class 'str'>; required — Stored and validated as part of this public value.
ToolCallAttempt
m3.observability.ToolCallAttempt(*, attempt_index: Annotated[int, Ge(ge=0)], jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, request_state: m3.observability.Observation[str] = <factory>, continuation_state: m3.observability.Observation[str] = <factory>, input_responses: m3.observability.Observation[JsonValue] = <factory>, operation_params: m3.observability.Observation[JsonValue] = <factory>, input_required: bool = False, result: m3.observability.Observation[ToolResult] = <factory>, raw_result: m3.observability.Observation[JsonValue] = <factory>, status: m3.observability.ToolCallStatus = <ToolCallStatus.INCOMPLETE: 'incomplete'>, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>) -> None
One wire-level attempt belonging to a logical tool call.
Public fields and methods:
attempt_index: <class 'int'>; required — Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.request_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.continuation_state: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.input_responses: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.operation_params: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.input_required: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.raw_result: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.status: <enum 'ToolCallStatus'>; default<ToolCallStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.
ToolCallEntry
m3.observability.ToolCallEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['tool_call'] = 'tool_call', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), call_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], provider_call_id: m3.observability.Observation[str] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[ToolResult] = <factory>, tool_status: m3.observability.ToolCallStatus = <ToolCallStatus.INCOMPLETE: 'incomplete'>, correlation: m3.observability.CorrelationState = <CorrelationState.UNAVAILABLE: 'unavailable'>, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, server_latency_ms: m3.observability.Observation[float] = <factory>, policy: m3.observability.Observation[ToolPolicyDecision] = <factory>, reported: m3.observability.Observation[ReportedToolCall] = <factory>, wire: m3.observability.Observation[WireToolCall] = <factory>, conflicts: tuple[m3.observability.EvidenceConflict, ...] = (), attempts: tuple[m3.observability.ToolCallAttempt, ...] = ()) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['tool_call']; default'tool_call'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.call_id: <class 'str'>; required — Stored and validated as part of this public value.provider_call_id: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.tool_status: <enum 'ToolCallStatus'>; default<ToolCallStatus.INCOMPLETE: 'incomplete'>— Stored and validated as part of this public value.correlation: <enum 'CorrelationState'>; default<CorrelationState.UNAVAILABLE: 'unavailable'>— Stored and validated as part of this public value.jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.server_latency_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.policy: <class 'm3.observability.Observation[ToolPolicyDecision]'>; required — Stored and validated as part of this public value.reported: <class 'm3.observability.Observation[ReportedToolCall]'>; required — Stored and validated as part of this public value.wire: <class 'm3.observability.Observation[WireToolCall]'>; required — Stored and validated as part of this public value.conflicts: tuple[m3.observability.EvidenceConflict, ...]; default()— Stored and validated as part of this public value.attempts: tuple[m3.observability.ToolCallAttempt, ...]; default()— Stored and validated as part of this public value.
ToolCallStatus
m3.observability.ToolCallStatus(*values)
Public class in m3.observability.
ToolResult
m3.observability.ToolResult(*, content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = (), structured_content: m3.observability.Observation[JsonValue] = <factory>, is_error: bool = False, error: m3.observability.Observation[ErrorInfo] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
content: tuple[typing.Annotated[m3.types.TextContent | m3.types.FileContent | m3.types.ImageContent | m3.types.AudioContent | m3.types.ResourceLink | m3.types.OpaqueContent, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.structured_content: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.is_error: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.error: <class 'm3.observability.Observation[ErrorInfo]'>; required — Stored and validated as part of this public value.
TraceEntry
m3.observability.TraceEntry(*args, **kwargs)
Runtime representation of an annotated type.
TraceEntryBase
m3.observability.TraceEntryBase(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Annotated[str, MinLen(min_length=1), MaxLen(max_length=64)], parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = ()) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: <class 'str'>; required — Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.
TraceStatus
m3.observability.TraceStatus(*values)
Public class in m3.observability.
TraceSummary
m3.observability.TraceSummary(*, timing: m3.observability.TraceTiming = <factory>, usage: m3.observability.Observation[UsageValue] = <factory>, turn_count: Annotated[int, Ge(ge=0)] = 0, message_count: Annotated[int, Ge(ge=0)] = 0, reasoning_count: Annotated[int, Ge(ge=0)] = 0, tool_call_count: Annotated[int, Ge(ge=0)] = 0, successful_tool_call_count: Annotated[int, Ge(ge=0)] = 0, failed_tool_call_count: Annotated[int, Ge(ge=0)] = 0, protocol_error_count: Annotated[int, Ge(ge=0)] = 0, activity_health: m3.types.ActivityHealth = <ActivityHealth.NO_CALLS: 'no_calls'>, cleanup_status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>) -> None
Public class in m3.observability.
Public fields and methods:
timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.usage: <class 'm3.observability.Observation[UsageValue]'>; required — Stored and validated as part of this public value.turn_count: <class 'int'>; default0— Stored and validated as part of this public value.message_count: <class 'int'>; default0— Stored and validated as part of this public value.reasoning_count: <class 'int'>; default0— Stored and validated as part of this public value.tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.successful_tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.failed_tool_call_count: <class 'int'>; default0— Stored and validated as part of this public value.protocol_error_count: <class 'int'>; default0— Stored and validated as part of this public value.activity_health: <enum 'ActivityHealth'>; default<ActivityHealth.NO_CALLS: 'no_calls'>— Stored and validated as part of this public value.cleanup_status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.
TraceTiming
m3.observability.TraceTiming(*, started_at: datetime.datetime = <factory>, finished_at: datetime.datetime | None = None, start_offset_ms: Annotated[float, Ge(ge=0)] = 0, end_offset_ms: Annotated[float, Ge(ge=0)] = 0, duration_ms: Annotated[float, Ge(ge=0)] = 0) -> None
Public class in m3.observability.
Public fields and methods:
started_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.finished_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.start_offset_ms: <class 'float'>; default0— Stored and validated as part of this public value.end_offset_ms: <class 'float'>; default0— Stored and validated as part of this public value.duration_ms: <class 'float'>; default0— Stored and validated as part of this public value.
TraceView
m3.observability.TraceView(*, schema_id: Literal['m3.trace_view'] = 'm3.trace_view', schema_version: Literal['1.1', '1.2'] = '1.1', trace_id: m3.types.TraceId, execution_id: m3.types.ExecutionId, outcome: m3.types.ExecutionOutcome = <ExecutionOutcome.COMPLETED: 'completed'>, completeness: Literal['complete', 'partial'] = 'complete', limitations: tuple[str, ...] = (), agent: m3.types.AgentIdentity | None = None, runtime: m3.observability.DirectTrace | m3.observability.OpenCodeTrace | m3.observability.ClaudeCodeTrace | m3.observability.CodexTrace | m3.observability.PiTrace | m3.observability.ACPTrace = <factory>, summary: m3.observability.TraceSummary = <factory>, timeline: tuple[typing.Annotated[m3.observability.LifecycleEntry | m3.observability.MessageEntry | m3.observability.ReasoningEntry | m3.observability.ToolCallEntry | m3.observability.ProtocolEntry | m3.observability.TransportEntry | m3.observability.InitializationEntry | m3.observability.UsageEntry | m3.observability.InteractionEntry | m3.observability.ElicitationEntry | m3.observability.ProcessEntry | m3.observability.WorkspaceEntry | m3.observability.ArtifactEntry | m3.observability.EvaluationEntry | m3.observability.DiagnosticEntry | m3.observability.RawMessageEntry | m3.observability.ProviderEntry, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...] = ()) -> None
Public class in m3.observability.
Public fields and methods:
schema_id: typing.Literal['m3.trace_view']; default'm3.trace_view'— Stored and validated as part of this public value.schema_version: typing.Literal['1.1', '1.2']; default'1.1'— Stored and validated as part of this public value.trace_id: <class 'm3.types.TraceId'>; required — Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.outcome: <enum 'ExecutionOutcome'>; default<ExecutionOutcome.COMPLETED: 'completed'>— Stored and validated as part of this public value.completeness: typing.Literal['complete', 'partial']; default'complete'— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.agent: m3.types.AgentIdentity | None; defaultNone— Stored and validated as part of this public value.runtime: m3.observability.DirectTrace | m3.observability.OpenCodeTrace | m3.observability.ClaudeCodeTrace | m3.observability.CodexTrace | m3.observability.PiTrace | m3.observability.ACPTrace; required — Stored and validated as part of this public value.summary: <class 'm3.observability.TraceSummary'>; required — Stored and validated as part of this public value.timeline: tuple[typing.Annotated[m3.observability.LifecycleEntry | m3.observability.MessageEntry | m3.observability.ReasoningEntry | m3.observability.ToolCallEntry | m3.observability.ProtocolEntry | m3.observability.TransportEntry | m3.observability.InitializationEntry | m3.observability.UsageEntry | m3.observability.InteractionEntry | m3.observability.ElicitationEntry | m3.observability.ProcessEntry | m3.observability.WorkspaceEntry | m3.observability.ArtifactEntry | m3.observability.EvaluationEntry | m3.observability.DiagnosticEntry | m3.observability.RawMessageEntry | m3.observability.ProviderEntry, FieldInfo(annotation=NoneType, required=True, discriminator='kind')], ...]; default()— Stored and validated as part of this public value.for_turn(self, turn: '_TurnResult | _TurnState | _TurnId | str') -> 'TraceView'— Return the finalized evidence belonging to one turn.for_session(self, session_id: '_SessionId | str') -> 'TraceView'— Public method onTraceView.for_server(self, server_binding: 'str') -> 'TraceView'— Public method onTraceView.between(self, start_offset_ms: 'float', end_offset_ms: 'float') -> 'TraceView'— Public method onTraceView.
TransportEntry
m3.observability.TransportEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['transport'] = 'transport', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), phase: Literal['connected', 'disconnected'], configured: m3.observability.Observation[TransportKind] = <factory>, instrumented: m3.observability.Observation[TransportKind] = <factory>) -> None
A stable MCP transport lifecycle observation.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['transport']; default'transport'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.phase: typing.Literal['connected', 'disconnected']; required — Stored and validated as part of this public value.configured: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.instrumented: <class 'm3.observability.Observation[TransportKind]'>; required — Stored and validated as part of this public value.
UsageEntry
m3.observability.UsageEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['usage'] = 'usage', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), input_tokens: m3.observability.Observation[int] = <factory>, output_tokens: m3.observability.Observation[int] = <factory>, reasoning_tokens: m3.observability.Observation[int] = <factory>, cache_creation_tokens: m3.observability.Observation[int] = <factory>, cache_read_tokens: m3.observability.Observation[int] = <factory>, cache_write_tokens: m3.observability.Observation[int] = <factory>, total_tokens: m3.observability.Observation[int] = <factory>, cost: m3.observability.Observation[float] = <factory>, currency: m3.observability.Observation[str] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['usage']; default'usage'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.input_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.output_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.reasoning_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_creation_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_read_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_write_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.total_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cost: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.currency: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
UsageValue
m3.observability.UsageValue(*, input_tokens: m3.observability.Observation[int] = <factory>, output_tokens: m3.observability.Observation[int] = <factory>, reasoning_tokens: m3.observability.Observation[int] = <factory>, cache_creation_tokens: m3.observability.Observation[int] = <factory>, cache_read_tokens: m3.observability.Observation[int] = <factory>, cache_write_tokens: m3.observability.Observation[int] = <factory>, total_tokens: m3.observability.Observation[int] = <factory>, cost: m3.observability.Observation[float] = <factory>, currency: m3.observability.Observation[str] = <factory>) -> None
Value-only usage aggregate used by summaries and runtime metadata.
Public fields and methods:
input_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.output_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.reasoning_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_creation_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_read_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cache_write_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.total_tokens: <class 'm3.observability.Observation[int]'>; required — Stored and validated as part of this public value.cost: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.currency: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.
WireToolCall
m3.observability.WireToolCall(*, jsonrpc_id: m3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]] = <factory>, server: m3.observability.Observation[str] = <factory>, tool: m3.observability.Observation[str] = <factory>, arguments: m3.observability.Observation[JsonValue] = <factory>, result: m3.observability.Observation[ToolResult] = <factory>, latency_ms: m3.observability.Observation[float] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
jsonrpc_id: <class 'm3.observability.Observation[Union[Annotated[int, Strict(strict=True)], Annotated[str, Strict(strict=True)]]]'>; required — Stored and validated as part of this public value.server: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.tool: <class 'm3.observability.Observation[str]'>; required — Stored and validated as part of this public value.arguments: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.result: <class 'm3.observability.Observation[ToolResult]'>; required — Stored and validated as part of this public value.latency_ms: <class 'm3.observability.Observation[float]'>; required — Stored and validated as part of this public value.
WorkspaceEntry
m3.observability.WorkspaceEntry(*, entry_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], kind: Literal['workspace'] = 'workspace', parent_id: str | None = None, execution_id: m3.types.ExecutionId, session_id: m3.types.SessionId | None = None, turn_id: m3.types.TurnId | None = None, server_binding: str | None = None, connection_id: m3.types.ConnectionId | None = None, sequence_start: Annotated[int, Ge(ge=0)], sequence_end: Annotated[int, Ge(ge=0)], timing: m3.observability.TraceTiming = <factory>, status: m3.observability.TraceStatus = <TraceStatus.COMPLETED: 'completed'>, provenance: tuple[m3.types.EventSource, ...] = (), limitations: tuple[str, ...] = (), change: m3.observability.Observation[JsonValue] = <factory>) -> None
Public class in m3.observability.
Public fields and methods:
entry_id: <class 'str'>; required — Stored and validated as part of this public value.kind: typing.Literal['workspace']; default'workspace'— Stored and validated as part of this public value.parent_id: str | None; defaultNone— Stored and validated as part of this public value.execution_id: <class 'm3.types.ExecutionId'>; required — Stored and validated as part of this public value.session_id: m3.types.SessionId | None; defaultNone— Stored and validated as part of this public value.turn_id: m3.types.TurnId | None; defaultNone— Stored and validated as part of this public value.server_binding: str | None; defaultNone— Stored and validated as part of this public value.connection_id: m3.types.ConnectionId | None; defaultNone— Stored and validated as part of this public value.sequence_start: <class 'int'>; required — Stored and validated as part of this public value.sequence_end: <class 'int'>; required — Stored and validated as part of this public value.timing: <class 'm3.observability.TraceTiming'>; required — Stored and validated as part of this public value.status: <enum 'TraceStatus'>; default<TraceStatus.COMPLETED: 'completed'>— Stored and validated as part of this public value.provenance: tuple[m3.types.EventSource, ...]; default()— Stored and validated as part of this public value.limitations: tuple[str, ...]; default()— Stored and validated as part of this public value.change: <class 'm3.observability.Observation[JsonValue]'>; required — Stored and validated as part of this public value.
m3.aggregations
EvaluationGroup
m3.aggregations.EvaluationGroup(*, key: collections.abc.Mapping[str, str | int | float | bool | None] = <factory>, values: m3.aggregations.EvaluationStats = <factory>) -> None
Public class in m3.aggregations.
Public fields and methods:
key: collections.abc.Mapping[str, str | int | float | bool | None]; required — Stored and validated as part of this public value.values: <class 'm3.aggregations.EvaluationStats'>; required — Stored and validated as part of this public value.
EvaluationQuery
m3.aggregations.EvaluationQuery(*, from_: datetime.datetime | None = None, to: datetime.datetime | None = None, group_by: tuple[str, ...] = (), filters: collections.abc.Mapping[str, tuple[str | int | float | bool | None, ...]] = <factory>, limit: Annotated[int, Ge(ge=1), Le(le=1000)] = 200, offset: Annotated[int, Ge(ge=0)] = 0) -> None
A read-only query over persisted evaluations.
Public fields and methods:
from_: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.to: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.group_by: tuple[str, ...]; default()— Stored and validated as part of this public value.filters: collections.abc.Mapping[str, tuple[str | int | float | bool | None, ...]]; required — Stored and validated as part of this public value.limit: <class 'int'>; default200— Stored and validated as part of this public value.offset: <class 'int'>; default0— Stored and validated as part of this public value.
EvaluationReport
m3.aggregations.EvaluationReport(*, from_: datetime.datetime | None = None, to: datetime.datetime | None = None, totals: m3.aggregations.EvaluationStats = <factory>, groups: tuple[m3.aggregations.EvaluationGroup, ...] = (), total_groups: int = 0, limit: int = 200, offset: int = 0) -> None
Public class in m3.aggregations.
Public fields and methods:
from_: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.to: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.totals: <class 'm3.aggregations.EvaluationStats'>; required — Stored and validated as part of this public value.groups: tuple[m3.aggregations.EvaluationGroup, ...]; default()— Stored and validated as part of this public value.total_groups: <class 'int'>; default0— Stored and validated as part of this public value.limit: <class 'int'>; default200— Stored and validated as part of this public value.offset: <class 'int'>; default0— Stored and validated as part of this public value.
EvaluationStats
m3.aggregations.EvaluationStats(*, trial_count: Annotated[int, Ge(ge=0)] = 0, evaluation_count: Annotated[int, Ge(ge=0)] = 0, expected_count: Annotated[int, Ge(ge=0)] = 0, missing_required_count: Annotated[int, Ge(ge=0)] = 0, pending_required_count: Annotated[int, Ge(ge=0)] = 0, status_counts: collections.abc.Mapping[str, int] = <factory>, pass_rate: Annotated[float | None, Ge(ge=0), Le(le=1)] = None, average_score: Annotated[float | None, Ge(ge=0), Le(le=1)] = None, score_count: Annotated[int, Ge(ge=0)] = 0, health: m3.aggregations.HealthStats = <factory>) -> None
Counts and health metrics for one aggregate group.
Public fields and methods:
trial_count: <class 'int'>; default0— Stored and validated as part of this public value.evaluation_count: <class 'int'>; default0— Stored and validated as part of this public value.expected_count: <class 'int'>; default0— Stored and validated as part of this public value.missing_required_count: <class 'int'>; default0— Stored and validated as part of this public value.pending_required_count: <class 'int'>; default0— Stored and validated as part of this public value.status_counts: collections.abc.Mapping[str, int]; required — Stored and validated as part of this public value.pass_rate: float | None; defaultNone— Stored and validated as part of this public value.average_score: float | None; defaultNone— Stored and validated as part of this public value.score_count: <class 'int'>; default0— Stored and validated as part of this public value.health: <class 'm3.aggregations.HealthStats'>; required — Stored and validated as part of this public value.
HealthStats
m3.aggregations.HealthStats(*, execution_count: Annotated[int, Ge(ge=0)] = 0, tool_calls: m3.aggregations.ToolCallStats = <factory>, protocol_error_count: Annotated[int, Ge(ge=0)] = 0, outcome_counts: collections.abc.Mapping[str, int] = <factory>, execution_duration_ms: m3.aggregations.LatencyStats = <factory>, server_latency_ms: m3.aggregations.LatencyStats = <factory>) -> None
Execution and tool health observed for a group.
Public fields and methods:
execution_count: <class 'int'>; default0— Stored and validated as part of this public value.tool_calls: <class 'm3.aggregations.ToolCallStats'>; required — Stored and validated as part of this public value.protocol_error_count: <class 'int'>; default0— Stored and validated as part of this public value.outcome_counts: collections.abc.Mapping[str, int]; required — Stored and validated as part of this public value.execution_duration_ms: <class 'm3.aggregations.LatencyStats'>; required — Stored and validated as part of this public value.server_latency_ms: <class 'm3.aggregations.LatencyStats'>; required — Stored and validated as part of this public value.
LatencyStats
m3.aggregations.LatencyStats(*, count: Annotated[int, Ge(ge=0)] = 0, p50: Annotated[float | None, Ge(ge=0)] = None, p95: Annotated[float | None, Ge(ge=0)] = None) -> None
Public class in m3.aggregations.
Public fields and methods:
count: <class 'int'>; default0— Stored and validated as part of this public value.p50: float | None; defaultNone— Stored and validated as part of this public value.p95: float | None; defaultNone— Stored and validated as part of this public value.
ToolCallStats
m3.aggregations.ToolCallStats(*, total: Annotated[int, Ge(ge=0)] = 0, successful: Annotated[int, Ge(ge=0)] = 0, failed: Annotated[int, Ge(ge=0)] = 0) -> None
Public class in m3.aggregations.
Public fields and methods:
total: <class 'int'>; default0— Stored and validated as part of this public value.successful: <class 'int'>; default0— Stored and validated as part of this public value.failed: <class 'int'>; default0— Stored and validated as part of this public value.
aggregate_evaluations
m3.aggregations.aggregate_evaluations(query: 'EvaluationQuery', records: 'Iterable[EvaluationRecord]', *, snapshots: 'Mapping[str, Any] | None' = None, specifications: 'Mapping[str, Any] | None' = None, traces: 'Mapping[str, Any] | None' = None, attempt_states: 'Mapping[str, str] | None' = None, project_names: 'Mapping[str, str] | None' = None) -> 'EvaluationReport'
Aggregate persisted evaluations and unresolved specification requirements.
m3.elicitation
ElicitationPlan
m3.elicitation.ElicitationPlan(*, node: Literal['leaf', 'sequence', 'optional', 'one_of', 'round_of'] = 'leaf', request: Optional[Annotated[m3.elicitation._FormExpectation | m3.elicitation._UrlExpectation, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]] = None, response: m3.elicitation.ElicitationResponse | None = None, children: tuple[m3.elicitation.ElicitationPlan, ...] = (), optional_occurrence: bool = False) -> None
An immutable, serializable elicitation expectation tree.
Public fields and methods:
node: typing.Literal['leaf', 'sequence', 'optional', 'one_of', 'round_of']; default'leaf'— Stored and validated as part of this public value.request: typing.Optional[typing.Annotated[m3.elicitation._FormExpectation | m3.elicitation._UrlExpectation, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]]; defaultNone— Stored and validated as part of this public value.response: m3.elicitation.ElicitationResponse | None; defaultNone— Stored and validated as part of this public value.children: tuple[m3.elicitation.ElicitationPlan, ...]; default()— Stored and validated as part of this public value.optional_occurrence: <class 'bool'>; defaultFalse— Stored and validated as part of this public value.accept(self, content: 'Mapping[str, object] | None' = None) -> 'ElicitationPlan'— Public method onElicitationPlan.decline(self) -> 'ElicitationPlan'— Public method onElicitationPlan.cancel(self) -> 'ElicitationPlan'— Public method onElicitationPlan.canonical_identity(self) -> 'str'— Public method onElicitationPlan.canonical_json(self) -> 'str'— Public method onElicitationPlan.model_dump(self, *args: 'Any', **kwargs: 'Any') -> 'dict[str, Any]'— Public method onElicitationPlan.model_dump_json(self, *args: 'Any', **kwargs: 'Any') -> 'str'— Public method onElicitationPlan.matcher(self) -> 'PlanMatcher'— Public method onElicitationPlan.
ElicitationRequest
m3.elicitation.ElicitationRequest
Represent a PEP 604 union type
ElicitationResponse
m3.elicitation.ElicitationResponse(*, action: Literal['accept', 'decline', 'cancel'], content: collections.abc.Mapping[str, object] | None = None, meta: collections.abc.Mapping[str, object] | None = None) -> None
The response that will be associated with one request key.
Public fields and methods:
action: typing.Literal['accept', 'decline', 'cancel']; required — Stored and validated as part of this public value.content: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.
FormElicitationRequest
m3.elicitation.FormElicitationRequest(*, request_key: Annotated[str, MinLen(min_length=1)], mode: Literal['form'] = 'form', message: str, requested_schema: collections.abc.Mapping[str, object], meta: collections.abc.Mapping[str, object] | None = None, task: collections.abc.Mapping[str, object] | None = None, server: str | None = None, operation_kind: Optional[Literal['tool', 'prompt', 'resource']] = None, operation_name: str | None = None) -> None
A normalized form-mode elicitation request.
Public fields and methods:
request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['form']; default'form'— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.requested_schema: collections.abc.Mapping[str, object]; required — Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.task: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['tool', 'prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: str | None; defaultNone— Stored and validated as part of this public value.
PendingElicitationRound
m3.elicitation.PendingElicitationRound(*, round_id: Annotated[str, MinLen(min_length=1)], execution_id: Annotated[str, MinLen(min_length=1)], logical_operation_id: Annotated[str, MinLen(min_length=1)], server: Annotated[str, MinLen(min_length=1)], operation_kind: Literal['tool', 'prompt', 'resource'], operation_name: Annotated[str, MinLen(min_length=1)], request_state: str | None = None, requests: collections.abc.Mapping[str, typing.Annotated[m3.elicitation.FormElicitationRequest | m3.elicitation.UrlElicitationRequest, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]], created_at: datetime.datetime, deadline: datetime.datetime | None = None) -> None
A persisted, keyed set of elicitation requests awaiting responses.
Public fields and methods:
round_id: <class 'str'>; required — Stored and validated as part of this public value.execution_id: <class 'str'>; required — Stored and validated as part of this public value.logical_operation_id: <class 'str'>; required — Stored and validated as part of this public value.server: <class 'str'>; required — Stored and validated as part of this public value.operation_kind: typing.Literal['tool', 'prompt', 'resource']; required — Stored and validated as part of this public value.operation_name: <class 'str'>; required — Stored and validated as part of this public value.request_state: str | None; defaultNone— Stored and validated as part of this public value.requests: collections.abc.Mapping[str, typing.Annotated[m3.elicitation.FormElicitationRequest | m3.elicitation.UrlElicitationRequest, FieldInfo(annotation=NoneType, required=True, discriminator='mode')]]; required — Stored and validated as part of this public value.created_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.deadline: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.
UrlElicitationRequest
m3.elicitation.UrlElicitationRequest(*, request_key: Annotated[str, MinLen(min_length=1)], mode: Literal['url'] = 'url', message: str, url: str, elicitation_id: str | None = None, meta: collections.abc.Mapping[str, object] | None = None, task: collections.abc.Mapping[str, object] | None = None, server: str | None = None, operation_kind: Optional[Literal['tool', 'prompt', 'resource']] = None, operation_name: str | None = None) -> None
A normalized URL-mode elicitation request.
Public fields and methods:
request_key: <class 'str'>; required — Stored and validated as part of this public value.mode: typing.Literal['url']; default'url'— Stored and validated as part of this public value.message: <class 'str'>; required — Stored and validated as part of this public value.url: <class 'str'>; required — Stored and validated as part of this public value.elicitation_id: str | None; defaultNone— Stored and validated as part of this public value.meta: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.task: collections.abc.Mapping[str, object] | None; defaultNone— Stored and validated as part of this public value.server: str | None; defaultNone— Stored and validated as part of this public value.operation_kind: typing.Optional[typing.Literal['tool', 'prompt', 'resource']]; defaultNone— Stored and validated as part of this public value.operation_name: str | None; defaultNone— Stored and validated as part of this public value.
expect_form
m3.elicitation.expect_form(request_key: 'str', *, message: 'str | None' = None, schema: 'Mapping[str, object] | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.elicitation.
expect_url
m3.elicitation.expect_url(request_key: 'str', *, message: 'str | None' = None, url: 'str | None' = None, elicitation_id: 'str | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.elicitation.
maybe_form
m3.elicitation.maybe_form(request_key: 'str', *, message: 'str | None' = None, schema: 'Mapping[str, object] | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.elicitation.
maybe_url
m3.elicitation.maybe_url(request_key: 'str', *, message: 'str | None' = None, url: 'str | None' = None, elicitation_id: 'str | None' = None, server: 'object | None' = None, operation_kind: 'OperationKind | None' = None, operation_name: 'str | None' = None) -> 'ElicitationPlan'
Public callable in m3.elicitation.
one_of
m3.elicitation.one_of(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.elicitation.
optional
m3.elicitation.optional(child: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.elicitation.
round_of
m3.elicitation.round_of(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.elicitation.
sequence
m3.elicitation.sequence(*children: 'ElicitationPlan') -> 'ElicitationPlan'
Public callable in m3.elicitation.
m3.judges
PROMPT_VERSION
m3.judges.PROMPT_VERSION
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
LLMJudge
m3.judges.LLMJudge(model: 'str', base_url: 'str | None' = None, api_key_env: 'str | None' = None, auth: 'str' = 'env', response_mode: 'str | None' = None, threshold: 'float' = 0.8, rubric: 'str | None' = None, rubric_id: 'str | None' = None, rubric_version: 'str | None' = None, timeout_seconds: 'float' = 30.0, max_retries: 'Literal[0, 1]' = 1) -> None
LLMJudge(model: 'str', base_url: 'str | None' = None, api_key_env: 'str | None' = None, auth: 'str' = 'env', response_mode: 'str | None' = None, threshold: 'float' = 0.8, rubric: 'str | None' = None, rubric_id: 'str | None' = None, rubric_version: 'str | None' = None, timeout_seconds: 'float' = 30.0, max_retries: 'Literal[0, 1]' = 1)
Public fields and methods:
evaluate_async(self, context: 'EvaluationContext') -> 'EvaluationDecision'— Public method onLLMJudge.
m3.managed_input_api
HumanInput
m3.managed_input_api.HumanInput(*args, **kwargs)
Public callable in m3.managed_input_api.
apply_human_input
m3.managed_input_api.apply_human_input(spec: 'object', value: 'object' = 'fail') -> 'object'
Public callable in m3.managed_input_api.
command_human_input
m3.managed_input_api.command_human_input(payload: 'Mapping[str, object]') -> 'HumanInput'
Read the durable policy, preserving fail as the old-envelope default.
managed_input_provider
m3.managed_input_api.managed_input_provider(store: 'object') -> 'ManagedInputProvider'
Public callable in m3.managed_input_api.
managed_store
m3.managed_input_api.managed_store(store: 'object') -> 'ManagedInputStore'
Public callable in m3.managed_input_api.
pending_elicitation
m3.managed_input_api.pending_elicitation(store: 'object', execution_id: 'object') -> 'PendingElicitationRound | None'
Public callable in m3.managed_input_api.
respond_elicitation
m3.managed_input_api.respond_elicitation(store: 'object', execution_id: 'object', round_id: 'str', responses: 'Mapping[str, ElicitationResponse]', *, idempotency_key: 'str') -> 'None'
Public callable in m3.managed_input_api.
validate_human_input
m3.managed_input_api.validate_human_input(value: 'object') -> 'HumanInput'
Public callable in m3.managed_input_api.
m3.storage
ACPProbeDimension
m3.storage.ACPProbeDimension(*, profile_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], revision_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], probe_type: m3.services.acp_probes.ACPProbeKind, transport: Annotated[str, MinLen(min_length=1), MaxLen(max_length=32)] = 'stdio', agent_mode_id: Annotated[str | None, MaxLen(max_length=256)] = None, session_config: collections.abc.Mapping[str, JsonValue] = <factory>) -> None
Exact profile/revision and ACP request dimensions.
Public fields and methods:
profile_id: <class 'str'>; required — Stored and validated as part of this public value.revision_id: <class 'str'>; required — Stored and validated as part of this public value.probe_type: <enum 'ACPProbeKind'>; required — Stored and validated as part of this public value.transport: <class 'str'>; default'stdio'— Stored and validated as part of this public value.agent_mode_id: str | None; defaultNone— Stored and validated as part of this public value.session_config: collections.abc.Mapping[str, JsonValue]; required — Stored and validated as part of this public value.
ACPProbeResult
m3.storage.ACPProbeResult(*, profile_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], revision_id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)], probe_type: m3.services.acp_probes.ACPProbeKind, transport: Annotated[str, MinLen(min_length=1), MaxLen(max_length=32)] = 'stdio', agent_mode_id: Annotated[str | None, MaxLen(max_length=256)] = None, session_config: collections.abc.Mapping[str, JsonValue] = <factory>, id: Annotated[str, MinLen(min_length=1), MaxLen(max_length=256)] = <factory>, status: m3.services.acp_probes.ACPProbeStatus, agent_capabilities: collections.abc.Mapping[str, JsonValue] = <factory>, config_options: tuple[collections.abc.Mapping[str, JsonValue], ...] = (), evidence: collections.abc.Mapping[str, JsonValue] = <factory>, diagnostics: Annotated[str | None, MaxLen(max_length=65536)] = None, error: Annotated[str | None, MaxLen(max_length=2048)] = None, created_at: datetime.datetime = <factory>, started_at: datetime.datetime | None = None, finished_at: datetime.datetime | None = None, duration_ms: Annotated[float | None, Ge(ge=0)] = None, agent_identity: m3.services.acp_probes.ACPAgentIdentity | None = None, agent_modes: tuple[m3.services.acp_probes.ACPAgentMode, ...] = (), current_agent_mode_id: Annotated[str | None, MaxLen(max_length=256)] = None) -> None
One terminal or in-flight probe observation.
Public fields and methods:
profile_id: <class 'str'>; required — Stored and validated as part of this public value.revision_id: <class 'str'>; required — Stored and validated as part of this public value.probe_type: <enum 'ACPProbeKind'>; required — Stored and validated as part of this public value.transport: <class 'str'>; default'stdio'— Stored and validated as part of this public value.agent_mode_id: str | None; defaultNone— Stored and validated as part of this public value.session_config: collections.abc.Mapping[str, JsonValue]; required — Stored and validated as part of this public value.id: <class 'str'>; required — Stored and validated as part of this public value.status: <enum 'ACPProbeStatus'>; required — Stored and validated as part of this public value.agent_capabilities: collections.abc.Mapping[str, JsonValue]; required — Stored and validated as part of this public value.config_options: tuple[collections.abc.Mapping[str, JsonValue], ...]; default()— Stored and validated as part of this public value.evidence: collections.abc.Mapping[str, JsonValue]; required — Stored and validated as part of this public value.diagnostics: str | None; defaultNone— Stored and validated as part of this public value.error: str | None; defaultNone— Stored and validated as part of this public value.created_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.started_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.finished_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.duration_ms: float | None; defaultNone— Stored and validated as part of this public value.agent_identity: m3.services.acp_probes.ACPAgentIdentity | None; defaultNone— Stored and validated as part of this public value.agent_modes: tuple[m3.services.acp_probes.ACPAgentMode, ...]; default()— Stored and validated as part of this public value.current_agent_mode_id: str | None; defaultNone— Stored and validated as part of this public value.
ACPProbeStore
m3.storage.ACPProbeStore(*args, **kwargs)
Public class in m3.storage.
Public fields and methods:
save_acp_probe(self, result: 'ACPProbeResult') -> 'ACPProbeResult'— Public method onACPProbeStore.get_acp_probe(self, probe_id: 'str') -> 'ACPProbeResult | None'— Public method onACPProbeStore.list_acp_probes(self, dimension: 'ACPProbeDimension | None' = None, *, include_inflight: 'bool' = True) -> 'tuple[ACPProbeResult, ...]'— Public method onACPProbeStore.latest_acp_probe(self, dimension: 'ACPProbeDimension') -> 'ACPProbeResult | None'— Public method onACPProbeStore.
ArtifactNotFound
m3.storage.ArtifactNotFound
An artifact or content-addressed blob is not present.
ArtifactStore
m3.storage.ArtifactStore(*args, **kwargs)
Content-addressed artifact/blob store contract.
Public fields and methods:
put(self, execution_id: 'ExecutionId | str', name: 'str', content: 'bytes', *, media_type: 'str | None' = None) -> 'ArtifactRef'— Public method onArtifactStore.get(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'bytes'— Public method onArtifactStore.get_ref(self, artifact_id: 'ArtifactId | str') -> 'ArtifactRef'— Public method onArtifactStore.iter_refs(self, execution_id: 'ExecutionId | str | None' = None) -> 'Iterator[ArtifactRef]'— Public method onArtifactStore.delete(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'None'— Public method onArtifactStore.cleanup(self) -> 'None'— Public method onArtifactStore.
BlobIntegrityError
m3.storage.BlobIntegrityError
A compressed blob does not match its recorded hash or length.
BlobRecord
m3.storage.BlobRecord(sha256: 'str', size_bytes: 'int', compressed_size_bytes: 'int', path: 'Path') -> None
Verified metadata for one compressed content-addressed blob.
Command
m3.storage.Command(id: 'str', execution_id: 'ExecutionId', kind: 'str', status: 'str', payload: 'Mapping[str, Any]', session_id: 'SessionId | None' = None, turn_id: 'TurnId | None' = None) -> None
Command(id: 'str', execution_id: 'ExecutionId', kind: 'str', status: 'str', payload: 'Mapping[str, Any]', session_id: 'SessionId | None' = None, turn_id: 'TurnId | None' = None)
DurableSerializationError
m3.storage.DurableSerializationError(reason: 'str' = 'durable value is invalid') -> 'None'
A value cannot safely cross a durable specification boundary.
EventCallback
m3.storage.EventCallback(*args, **kwargs)
Public callable in m3.storage.
ExecutionStore
m3.storage.ExecutionStore(*args, **kwargs)
Store contract for immutable execution snapshots and event streams.
Public fields and methods:
create(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, object] | None' = None, provenance: 'Mapping[str, object] | None' = None, server_bindings: 'Sequence[Mapping[str, object]]' = (), harness_binding: 'Mapping[str, object] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onExecutionStore.get_snapshot(self, execution_id: 'ExecutionId | str') -> 'ExecutionState | None'— Public method onExecutionStore.get_execution_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Public method onExecutionStore.list_executions(self, *, limit: 'int' = 50, offset: 'int' = 0, lifecycle: 'ExecutionStatus | str | None' = None, outcome: 'ExecutionOutcome | str | None' = None, run_id: 'RunId | str | None' = None, suite_id: 'int | None' = None, project_id: 'str | None' = None) -> 'ExecutionPage'— Public method onExecutionStore.get_report(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1, event_limit: 'int | None' = None, artifact_limit: 'int | None' = None) -> 'ExecutionReport | None'— Public method onExecutionStore.get_trace(self, execution_id: 'ExecutionId | str') -> 'TraceResult | None'— Public method onExecutionStore.get_trace_view(self, execution_id: 'ExecutionId | str') -> 'TraceView | None'— Public method onExecutionStore.save_evaluation(self, execution_id: 'ExecutionId | str', result: 'EvaluationResult | Mapping[str, object]', *, evaluation_id: 'str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'str'— Public method onExecutionStore.evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onExecutionStore.aggregate_evaluations(self, query: 'EvaluationQuery') -> 'EvaluationReport'— Public method onExecutionStore.turns(self, execution_id: 'ExecutionId | str') -> 'tuple[tuple[TurnState, TurnResult | None], ...]'— Public method onExecutionStore.save_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onExecutionStore.append_events(self, events: 'Sequence[Event]') -> 'None'— Public method onExecutionStore.append_event(self, event: 'Event', content: 'bytes', *, media_type: 'str') -> 'Event'— Public method onExecutionStore.iter_events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'Iterator[Event]'— Public method onExecutionStore.transaction(self, execution_id: 'ExecutionId | str') -> 'ExecutionTransaction'— Public method onExecutionStore.release(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onExecutionStore.subscribe(self, execution_id: 'ExecutionId | str', callback: 'EventCallback') -> 'Callable[[], None]'— Public method onExecutionStore.put_raw_evidence(self, event_id: 'EventId | str', content: 'bytes', *, media_type: 'str') -> 'EvidenceCapture'— Public method onExecutionStore.read_raw_evidence(self, reference: 'EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Public method onExecutionStore.delete_execution(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onExecutionStore.
ExecutionTransaction
m3.storage.ExecutionTransaction(*args, **kwargs)
Uncommitted event batch used by :class:ExecutionStore.
Public fields and methods:
append(self, events: 'Sequence[Event]') -> 'None'— Public method onExecutionTransaction.commit(self) -> 'None'— Public method onExecutionTransaction.rollback(self) -> 'None'— Public method onExecutionTransaction.
FilesystemBlobStore
m3.storage.FilesystemBlobStore(root: 'str | os.PathLike[str]', *, max_read_bytes: 'int' = 536870912) -> 'None'
Atomic, compressed, content-addressed filesystem storage.
Public fields and methods:
path_for(self, sha256: 'str') -> 'Path'— Public method onFilesystemBlobStore.put(self, content: 'bytes', *, sha256: 'str | None' = None, size_bytes: 'int | None' = None) -> 'BlobRecord'— Atomically persistcontentand return verified metadata.put_blob(self, content: 'bytes', *, sha256: 'str | None' = None, size_bytes: 'int | None' = None) -> 'BlobRecord'— Atomically persistcontentand return verified metadata.read(self, sha256: 'str', *, size_bytes: 'int | None' = None) -> 'bytes'— Public method onFilesystemBlobStore.get(self, sha256: 'str', *, size_bytes: 'int | None' = None) -> 'bytes'— Public method onFilesystemBlobStore.read_blob(self, sha256: 'str', *, size_bytes: 'int | None' = None) -> 'bytes'— Public method onFilesystemBlobStore.verify(self, sha256: 'str', size_bytes: 'int') -> 'BlobRecord'— Public method onFilesystemBlobStore.iter_records(self) -> 'tuple[BlobRecord, ...]'— Public method onFilesystemBlobStore.garbage_collect(self, references: 'Mapping[str, int] | Iterable[str]') -> 'tuple[str, ...]'— Delete only explicitly unreferenced, valid blobs.collect_garbage(self, references: 'Mapping[str, int] | Iterable[str]') -> 'tuple[str, ...]'— Delete only explicitly unreferenced, valid blobs.cleanup_temporary_files(self) -> 'tuple[Path, ...]'— Remove incomplete temp files left by interrupted writers.
InMemoryArtifactStore
m3.storage.InMemoryArtifactStore(*, config: 'RedactionConfig | None' = None) -> 'None'
In-memory compressed, content-addressed artifact store.
Public fields and methods:
put(self, execution_id: 'ExecutionId | str', name: 'str', content: 'bytes', *, media_type: 'str | None' = None) -> 'ArtifactRef'— Public method onInMemoryArtifactStore.get(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'bytes'— Public method onInMemoryArtifactStore.get_ref(self, artifact_id: 'ArtifactId | str') -> 'ArtifactRef'— Public method onInMemoryArtifactStore.iter_refs(self, execution_id: 'ExecutionId | str | None' = None) -> 'Iterator[ArtifactRef]'— Public method onInMemoryArtifactStore.delete(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'None'— Public method onInMemoryArtifactStore.cleanup(self) -> 'None'— Public method onInMemoryArtifactStore.close(self) -> 'None'— Public method onInMemoryArtifactStore.
InMemoryExecutionStore
m3.storage.InMemoryExecutionStore(*, config: 'RedactionConfig | None' = None, capture_config: 'CaptureOptions | None' = None) -> 'None'
Thread-safe execution metadata store with commit-gated visibility.
Public fields and methods:
save_acp_probe(self, result: 'ACPProbeResult') -> 'ACPProbeResult'— Public method onInMemoryExecutionStore.get_acp_probe(self, probe_id: 'str') -> 'ACPProbeResult | None'— Public method onInMemoryExecutionStore.list_acp_probes(self, dimension: 'ACPProbeDimension | None' = None, *, include_inflight: 'bool' = True) -> 'tuple[ACPProbeResult, ...]'— Public method onInMemoryExecutionStore.latest_acp_probe(self, dimension: 'ACPProbeDimension') -> 'ACPProbeResult | None'— Public method onInMemoryExecutionStore.create(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, object] | None' = None, provenance: 'Mapping[str, object] | None' = None, server_bindings: 'Sequence[Mapping[str, object]]' = (), harness_binding: 'Mapping[str, object] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onInMemoryExecutionStore.ensure_project(self, project_id: 'str', project_name: 'str') -> 'tuple[str, str]'— Public method onInMemoryExecutionStore.get_project(self, project_id: 'str') -> 'tuple[str, str] | None'— Public method onInMemoryExecutionStore.ensure_suite(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite'— Public method onInMemoryExecutionStore.get_suite(self, suite_id: 'SuiteId | str') -> 'Suite | None'— Public method onInMemoryExecutionStore.get_suite_by_name(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite | None'— Public method onInMemoryExecutionStore.list_suites(self) -> 'tuple[Suite, ...]'— Public method onInMemoryExecutionStore.create_execution(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, object] | None' = None, provenance: 'Mapping[str, object] | None' = None, server_bindings: 'Sequence[Mapping[str, object]]' = (), harness_binding: 'Mapping[str, object] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onInMemoryExecutionStore.save_test_run(self, run_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onInMemoryExecutionStore.get_test_run(self, run_id: 'str') -> 'Mapping[str, object] | None'— Public method onInMemoryExecutionStore.list_test_runs(self) -> 'tuple[Mapping[str, object], ...]'— Public method onInMemoryExecutionStore.list_test_run_page(self, *, limit: 'int | None' = None, offset: 'int' = 0, suite_id: 'int | None' = None, project_id: 'str | None' = None, q: 'str | None' = None) -> 'tuple[tuple[Mapping[str, object], ...], int]'— Return newest-first run manifests with their suites, and the total.save_test_result(self, run_id: 'str', attempt_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onInMemoryExecutionStore.list_test_results(self, run_id: 'str') -> 'tuple[Mapping[str, object], ...]'— Public method onInMemoryExecutionStore.get_snapshot(self, execution_id: 'ExecutionId | str') -> 'ExecutionState | None'— Public method onInMemoryExecutionStore.get_execution_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Public method onInMemoryExecutionStore.list_executions(self, *, limit: 'int' = 50, offset: 'int' = 0, lifecycle: 'ExecutionStatus | str | None' = None, outcome: 'ExecutionOutcome | str | None' = None, run_id: 'RunId | str | None' = None, suite_id: 'int | None' = None, project_id: 'str | None' = None) -> 'ExecutionPage'— Public method onInMemoryExecutionStore.get_report(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1, event_limit: 'int | None' = None, artifact_limit: 'int | None' = None) -> 'ExecutionReport | None'— Public method onInMemoryExecutionStore.save_evaluation(self, execution_id: 'ExecutionId | str', result: 'EvaluationResult | Mapping[str, object]', *, evaluation_id: 'str | None' = None, turn_id: 'object | None' = None) -> 'str'— Public method onInMemoryExecutionStore.save_turn(self, snapshot: 'TurnState', result: 'TurnResult | None' = None) -> 'None'— Public method onInMemoryExecutionStore.append_turn(self, snapshot: 'TurnState', result: 'TurnResult | None' = None) -> 'None'— Public method onInMemoryExecutionStore.turns(self, execution_id: 'ExecutionId | str') -> 'tuple[tuple[TurnState, TurnResult | None], ...]'— Public method onInMemoryExecutionStore.evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'object | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onInMemoryExecutionStore.aggregate_evaluations(self, query: 'EvaluationQuery') -> 'EvaluationReport'— Calculate summaries from the evaluations currently in memory.get_trace(self, execution_id: 'ExecutionId | str') -> 'TraceResult | None'— Public method onInMemoryExecutionStore.get_trace_view(self, execution_id: 'ExecutionId | str') -> 'TraceView | None'— Public method onInMemoryExecutionStore.save_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onInMemoryExecutionStore.update_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onInMemoryExecutionStore.append_events(self, events: 'Sequence[Event]') -> 'None'— Public method onInMemoryExecutionStore.append(self, events: 'Sequence[Event]') -> 'None'— Public method onInMemoryExecutionStore.append_event(self, event: 'Event', content: 'bytes', *, media_type: 'str') -> 'Event'— Commit an event and its raw blob as one in-memory operation.iter_events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'Iterator[Event]'— Public method onInMemoryExecutionStore.events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'tuple[Event, ...]'— Public method onInMemoryExecutionStore.transaction(self, execution_id: 'ExecutionId | str') -> 'ExecutionTransaction'— Public method onInMemoryExecutionStore.subscribe(self, execution_id: 'ExecutionId | str', callback: 'EventCallback') -> 'Callable[[], None]'— Public method onInMemoryExecutionStore.allocate(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Reserve the next per-execution sequence numbers.allocate_sequence(self, execution_id: 'ExecutionId | str') -> 'int'— Public method onInMemoryExecutionStore.allocate_sequences(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Reserve the next per-execution sequence numbers.release(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Release uncommitted reservations after producer cancellation.release_sequences(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Release uncommitted reservations after producer cancellation.close(self) -> 'None'— Public method onInMemoryExecutionStore.put_raw_evidence(self, event_id: 'EventId | str', content: 'bytes', *, media_type: 'str') -> 'EvidenceCapture'— Public method onInMemoryExecutionStore.read_raw_evidence(self, reference: 'EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Public method onInMemoryExecutionStore.delete_execution(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onInMemoryExecutionStore.delete(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onInMemoryExecutionStore.
Lease
m3.storage.Lease(execution_id: 'ExecutionId', owner_id: 'str', lease_token: 'str', expires_at: 'datetime') -> None
Lease(execution_id: 'ExecutionId', owner_id: 'str', lease_token: 'str', expires_at: 'datetime')
ManagedInputLease
m3.storage.ManagedInputLease(*, owner_id: Annotated[str, MinLen(min_length=1)], lease_token: Annotated[str, MinLen(min_length=1)], expires_at: datetime.datetime) -> None
The compare-and-set token currently allowed to mutate a round.
Public fields and methods:
owner_id: <class 'str'>; required — Stored and validated as part of this public value.lease_token: <class 'str'>; required — Stored and validated as part of this public value.expires_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.
ManagedInputRecord
m3.storage.ManagedInputRecord(*, pending: m3.elicitation.PendingElicitationRound, round_index: Annotated[int, Ge(ge=0)], round_limit: Annotated[int, Gt(gt=0)], status: Literal['pending', 'response_validated', 'delivery_started', 'delivered', 'resolved', 'failed'], lease: m3.storage.managed_input.ManagedInputLease, responses: collections.abc.Mapping[str, m3.elicitation.ElicitationResponse] | None = None, response_idempotency_key: str | None = None, harness_session_id: str | None = None, native_resume_token: str | None = None, delivery_idempotency_key: str | None = None, session_id: str | None = None, turn_id: str | None = None, operation_parameters: collections.abc.Mapping[str, object] = <factory>, delivery_attempts: Annotated[int, Ge(ge=0)] = 0, created_at: datetime.datetime, updated_at: datetime.datetime, response_validated_at: datetime.datetime | None = None, delivery_started_at: datetime.datetime | None = None, delivered_at: datetime.datetime | None = None, resolved_at: datetime.datetime | None = None, failed_at: datetime.datetime | None = None, failure_code: str | None = None, failure_message: str | None = None) -> None
Immutable view of one durable managed-input round.
Public fields and methods:
pending: <class 'm3.elicitation.PendingElicitationRound'>; required — Stored and validated as part of this public value.round_index: <class 'int'>; required — Stored and validated as part of this public value.round_limit: <class 'int'>; required — Stored and validated as part of this public value.status: typing.Literal['pending', 'response_validated', 'delivery_started', 'delivered', 'resolved', 'failed']; required — Stored and validated as part of this public value.lease: <class 'm3.storage.managed_input.ManagedInputLease'>; required — Stored and validated as part of this public value.responses: collections.abc.Mapping[str, m3.elicitation.ElicitationResponse] | None; defaultNone— Stored and validated as part of this public value.response_idempotency_key: str | None; defaultNone— Stored and validated as part of this public value.harness_session_id: str | None; defaultNone— Stored and validated as part of this public value.native_resume_token: str | None; defaultNone— Stored and validated as part of this public value.delivery_idempotency_key: str | None; defaultNone— Stored and validated as part of this public value.session_id: str | None; defaultNone— Stored and validated as part of this public value.turn_id: str | None; defaultNone— Stored and validated as part of this public value.operation_parameters: collections.abc.Mapping[str, object]; required — Stored and validated as part of this public value.delivery_attempts: <class 'int'>; default0— Stored and validated as part of this public value.created_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.updated_at: <class 'datetime.datetime'>; required — Stored and validated as part of this public value.response_validated_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.delivery_started_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.delivered_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.resolved_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.failed_at: datetime.datetime | None; defaultNone— Stored and validated as part of this public value.failure_code: str | None; defaultNone— Stored and validated as part of this public value.failure_message: str | None; defaultNone— Stored and validated as part of this public value.
ManagedInputStatus
m3.storage.ManagedInputStatus(*args, **kwargs)
Public callable in m3.storage.
ManagedInputStore
m3.storage.ManagedInputStore(*args, **kwargs)
Storage contract consumed by future execution handles.
Public fields and methods:
create_round(self, pending: 'PendingElicitationRound', *, round_index: 'int', round_limit: 'int', owner_id: 'str', lease_seconds: 'float', lease_token: 'str | None' = None, harness_session_id: 'str | None' = None, native_resume_token: 'str | None' = None, delivery_idempotency_key: 'str | None' = None, session_id: 'str | None' = None, turn_id: 'str | None' = None, operation_parameters: 'Mapping[str, object] | None' = None) -> 'ManagedInputRecord'— Public method onManagedInputStore.get_round(self, execution_id: 'str', round_id: 'str') -> 'ManagedInputRecord | None'— Public method onManagedInputStore.list_rounds(self, execution_id: 'str') -> 'tuple[ManagedInputRecord, ...]'— Public method onManagedInputStore.claim_round(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_seconds: 'float', expected_lease_token: 'str | None' = None, delivery_state: "Literal['not_started', 'not_delivered', 'delivered'] | None" = None, idempotent_delivery: 'bool' = False) -> 'ManagedInputRecord'— Public method onManagedInputStore.renew(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str', lease_seconds: 'float') -> 'ManagedInputRecord'— Public method onManagedInputStore.submit_responses(self, execution_id: 'str', round_id: 'str', responses: 'Mapping[str, ElicitationResponse]', *, owner_id: 'str', lease_token: 'str', response_idempotency_key: 'str') -> 'ManagedInputRecord'— Public method onManagedInputStore.start_delivery(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str') -> 'ManagedInputRecord'— Public method onManagedInputStore.mark_delivered(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str') -> 'ManagedInputRecord'— Public method onManagedInputStore.resolve(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str') -> 'ManagedInputRecord'— Public method onManagedInputStore.fail(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str', code: 'str', message: 'str') -> 'ManagedInputRecord'— Public method onManagedInputStore.fail_recovery(self, execution_id: 'str', round_id: 'str', *, expected_lease_token: 'str', message: 'str') -> 'ManagedInputRecord'— Public method onManagedInputStore.redacted_responses(self, execution_id: 'str', round_id: 'str') -> 'Mapping[str, object] | None'— Public method onManagedInputStore.
PersistentExecutionStore
m3.storage.PersistentExecutionStore(database: 'str | Path', *, blob_root: 'str | Path | None' = None, config: 'RedactionConfig | None' = None, capture_config: 'CaptureOptions | None' = None, payload_blob_threshold: 'int' = 65536, **kwargs: 'Any') -> 'None'
SQLite implementation of the public :class:ExecutionStore protocol.
Public fields and methods:
resolve_managed_input_store(self) -> 'SQLiteManagedInputStore'— Resolve managed-input storage lazily for opted-in executions.ensure_project(self, project_id: 'str', project_name: 'str') -> 'tuple[str, str]'— Register a stable project identity and refresh its display name.get_project(self, project_id: 'str') -> 'tuple[str, str] | None'— Public method onSQLiteExecutionStore.ensure_suite(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite'— Public method onSQLiteExecutionStore.get_suite(self, suite_id: 'SuiteId | str') -> 'Suite | None'— Public method onSQLiteExecutionStore.get_suite_by_name(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite | None'— Public method onSQLiteExecutionStore.list_suites(self) -> 'tuple[Suite, ...]'— Public method onSQLiteExecutionStore.create(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, Any] | None' = None, provenance: 'Mapping[str, Any] | None' = None, server_bindings: 'Sequence[Mapping[str, Any]]' = (), harness_binding: 'Mapping[str, Any] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onSQLiteExecutionStore.create_execution(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, Any] | None' = None, provenance: 'Mapping[str, Any] | None' = None, server_bindings: 'Sequence[Mapping[str, Any]]' = (), harness_binding: 'Mapping[str, Any] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onSQLiteExecutionStore.save_test_run(self, run_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onSQLiteExecutionStore.get_test_run(self, run_id: 'str') -> 'Mapping[str, object] | None'— Public method onSQLiteExecutionStore.list_test_runs(self) -> 'tuple[Mapping[str, object], ...]'— Public method onSQLiteExecutionStore.list_test_run_page(self, *, limit: 'int | None' = None, offset: 'int' = 0, suite_id: 'int | None' = None, project_id: 'str | None' = None, q: 'str | None' = None) -> 'tuple[tuple[Mapping[str, object], ...], int]'— Return newest-first run manifests with their suites, and the total.save_test_result(self, run_id: 'str', attempt_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onSQLiteExecutionStore.list_test_results(self, run_id: 'str') -> 'tuple[Mapping[str, object], ...]'— Public method onSQLiteExecutionStore.get_snapshot(self, execution_id: 'ExecutionId | str') -> 'ExecutionState | None'— Public method onSQLiteExecutionStore.get_execution_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Return the immutable typed submission spec, if one was saved.get_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Return the immutable typed submission spec, if one was saved.list_executions(self, *, limit: 'int' = 50, offset: 'int' = 0, lifecycle: 'ExecutionStatus | str | None' = None, outcome: 'ExecutionOutcome | str | None' = None, run_id: 'str | None' = None, suite_id: 'int | None' = None, project_id: 'str | None' = None) -> 'ExecutionPage'— Public method onSQLiteExecutionStore.get_report(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1, event_limit: 'int | None' = None, artifact_limit: 'int | None' = None) -> 'ExecutionReport | None'— Public method onSQLiteExecutionStore.get_trace(self, execution_id: 'ExecutionId | str') -> 'TraceResult | None'— Public method onSQLiteExecutionStore.get_trace_view(self, execution_id: 'ExecutionId | str') -> 'TraceView | None'— Public method onSQLiteExecutionStore.save_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onSQLiteExecutionStore.update_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onSQLiteExecutionStore.append_events(self, events: 'Sequence[Event]') -> 'None'— Public method onSQLiteExecutionStore.append(self, events: 'Sequence[Event]') -> 'None'— Public method onSQLiteExecutionStore.append_event(self, event: 'Event', content: 'bytes', *, media_type: 'str') -> 'Event'— Commit an event and its raw blob in one SQLite transaction.iter_events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'Iterator[Event]'— Public method onSQLiteExecutionStore.events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'tuple[Event, ...]'— Public method onSQLiteExecutionStore.create_session(self, execution_id: 'ExecutionId | str', session_id: 'SessionId | str', *, state: 'str' = 'open') -> 'SessionId'— Public method onSQLiteExecutionStore.close_session(self, session_id: 'SessionId | str') -> 'None'— Public method onSQLiteExecutionStore.save_turn(self, snapshot: 'TurnState', result: 'TurnResult | Mapping[str, Any] | None' = None) -> 'None'— Public method onSQLiteExecutionStore.append_turn(self, snapshot: 'TurnState', result: 'TurnResult | Mapping[str, Any] | None' = None) -> 'None'— Public method onSQLiteExecutionStore.turns(self, execution_id: 'ExecutionId | str') -> 'tuple[tuple[TurnState, TurnResult | None], ...]'— Public method onSQLiteExecutionStore.save_evaluation(self, execution_id: 'ExecutionId | str', result: 'Mapping[str, Any] | Any', *, evaluation_id: 'str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'str'— Public method onSQLiteExecutionStore.reserve_judge_request(self, run_id: 'str', limit: 'int') -> 'bool'— Atomically reserve one judge request for a run across workers.save(self, result: 'EvaluationResult') -> 'None'— Public method onSQLiteExecutionStore.get(self, evaluation_id: 'str') -> 'EvaluationResult | None'— Public method onSQLiteExecutionStore.all(self) -> 'tuple[EvaluationResult, ...]'— Public method onSQLiteExecutionStore.evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onSQLiteExecutionStore.aggregate_evaluations(self, query: 'EvaluationQuery') -> 'EvaluationReport'— Calculate summaries from persisted evaluations and execution traces.persisted_evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onSQLiteExecutionStore.evaluation_json(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[Mapping[str, Any], ...]'— Public method onSQLiteExecutionStore.transaction(self, execution_id: 'ExecutionId | str') -> 'ExecutionTransaction'— Public method onSQLiteExecutionStore.allocate(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Public method onSQLiteExecutionStore.allocate_sequence(self, execution_id)— Public method onSQLiteExecutionStore.allocate_sequences(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Public method onSQLiteExecutionStore.release(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onSQLiteExecutionStore.release_sequences(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onSQLiteExecutionStore.subscribe(self, execution_id: 'ExecutionId | str', callback: 'EventCallback') -> 'Callable[[], None]'— Public method onSQLiteExecutionStore.save_acp_probe(self, result: 'ACPProbeResult') -> 'ACPProbeResult'— Persist one redacted ACP probe result and return its safe copy.get_acp_probe(self, probe_id: 'str') -> 'ACPProbeResult | None'— Public method onSQLiteExecutionStore.list_acp_probes(self, dimension: 'ACPProbeDimension | None' = None, *, include_inflight: 'bool' = True) -> 'tuple[ACPProbeResult, ...]'— Public method onSQLiteExecutionStore.latest_acp_probe(self, dimension: 'ACPProbeDimension') -> 'ACPProbeResult | None'— Public method onSQLiteExecutionStore.create_profile(self, kind: 'str', name: 'str', value: 'Mapping[str, Any]', *, description: 'str' = '', profile_id: 'str | None' = None, revision_id: 'str | None' = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.create_server_profile(self, name: 'str', value: 'Mapping[str, Any]', **kwargs: 'Any') -> 'ProfileRecord'— Public method onSQLiteExecutionStore.create_harness_profile(self, name: 'str', value: 'Mapping[str, Any]', **kwargs: 'Any') -> 'ProfileRecord'— Public method onSQLiteExecutionStore.get_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord | None'— Public method onSQLiteExecutionStore.resolve_profile(self, profile_id: 'str', selection: 'RevisionSelection', *, kind: "Literal['server', 'harness']") -> 'tuple[ProfileRecord | None, ProfileRevisionRecord | None]'— Read one profile and its selected immutable revision.list_profiles(self, kind: 'str', *, include_archived: 'bool' = False) -> 'tuple[ProfileRecord, ...]'— List one profile family in stable name/id order.list_profile_revisions(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'tuple[ProfileRevisionRecord, ...]'— Return every revision ordered by revision number then id.update_profile(self, profile_id: 'str', *, name: 'str | None' = None, description: 'str | None' = None, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Update mutable metadata without changing the immutable revision.add_revision(self, profile_id: 'str', value: 'Mapping[str, Any]', *, revision_id: 'str | None' = None, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord'— Public method onSQLiteExecutionStore.archive_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.restore_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.resolve_revision(self, profile_id: 'str', selection: 'RevisionSelection | str' = 'latest', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord'— Public method onSQLiteExecutionStore.get_revision(self, revision_id: 'RevisionId | str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord | None'— Public method onSQLiteExecutionStore.enqueue_command(self, execution_id: 'ExecutionId | str', kind: 'str' = 'execution', payload: 'Mapping[str, Any] | None' = None, *, command_id: 'str | None' = None, session_id: 'SessionId | str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'Command'— Public method onSQLiteExecutionStore.enqueue(self, execution_id: 'ExecutionId | str', kind: 'str' = 'execution', payload: 'Mapping[str, Any] | None' = None, *, command_id: 'str | None' = None, session_id: 'SessionId | str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'Command'— Public method onSQLiteExecutionStore.get_command(self, command_id: 'str') -> 'Command | None'— Public method onSQLiteExecutionStore.claim_next(self, owner_id: 'str', *, lease_seconds: 'float' = 30.0) -> 'tuple[Command, Lease] | None'— Public method onSQLiteExecutionStore.claim(self, owner_id: 'str', *, lease_seconds: 'float' = 30.0) -> 'tuple[Command, Lease] | None'— Public method onSQLiteExecutionStore.heartbeat(self, lease: 'Lease | str', *, owner_id: 'str | None' = None, lease_seconds: 'float' = 30.0) -> 'bool'— Public method onSQLiteExecutionStore.renew_lease(self, lease: 'Lease | str', *, owner_id: 'str | None' = None, lease_seconds: 'float' = 30.0) -> 'bool'— Public method onSQLiteExecutionStore.mark_interrupted_if_lease_lost(self, lease: 'Lease', *, reason: 'str' = 'worker lease lost') -> 'bool'— Atomically close work whose owner can no longer renew its lease.mark_managed_recovery_unavailable_if_lease_lost(self, lease: 'Lease', *, reason: 'str' = 'managed interaction cannot be resumed safely after worker loss') -> 'bool'— Terminalize managed input when its owning worker is lost.release_lease(self, lease: 'Lease | str', *, owner_id: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.complete_command(self, command_id: 'str', *, owner_id: 'str', lease_token: 'str', status: 'str' = 'done') -> 'bool'— Mark one claimed command terminal under its current lease.request_cancel(self, execution_id: 'ExecutionId | str', reason: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.cancel(self, execution_id: 'ExecutionId | str', reason: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.finalize_cancelled(self, execution_id: 'ExecutionId | str', *, reason: 'str' = 'cancelled') -> 'bool'— Persist a cancellation terminal event when a worker observed it.cancellation_requested(self, execution_id: 'ExecutionId | str') -> 'bool'— Public method onSQLiteExecutionStore.mark_stale_interrupted(self, *, now: 'datetime | None' = None) -> 'tuple[ExecutionId, ...]'— Public method onSQLiteExecutionStore.delete_execution(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onSQLiteExecutionStore.delete(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onSQLiteExecutionStore.put_raw_evidence(self, event_id: 'EventId | str', content: 'bytes', *, media_type: 'str') -> 'EvidenceCapture'— Redact, bound, and durably associate evidence with one event.read_raw_evidence(self, reference: 'EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Public method onSQLiteExecutionStore.clone_execution(self, execution_id: 'ExecutionId | str', *, use_latest: 'bool' = False) -> 'ExecutionId'— Public method onSQLiteExecutionStore.clone(self, execution_id: 'ExecutionId | str', *, use_latest: 'bool' = False) -> 'ExecutionId'— Public method onSQLiteExecutionStore.resolved_bindings(self, execution_id: 'ExecutionId | str') -> 'Mapping[str, Any]'— Return the immutable, submission-time profile binding snapshot.close(self) -> 'None'— Public method onSQLiteExecutionStore.
ProfileRecord
m3.storage.ProfileRecord(id: 'str', kind: 'str', name: 'str', description: 'str', archived: 'bool', current_revision_id: 'RevisionId | None', created_at: 'datetime', updated_at: 'datetime') -> None
ProfileRecord(id: 'str', kind: 'str', name: 'str', description: 'str', archived: 'bool', current_revision_id: 'RevisionId | None', created_at: 'datetime', updated_at: 'datetime')
ProfileResolver
m3.storage.ProfileResolver(*args, **kwargs)
Read-only saved-profile lookup used by execution runtimes.
Public fields and methods:
resolve_profile(self, profile_id: 'str', selection: 'RevisionSelection', *, kind: "Literal['server', 'harness']") -> 'tuple[Any, Any]'— Public method onProfileResolver.
ProfileRevisionRecord
m3.storage.ProfileRevisionRecord(id: 'RevisionId', profile_id: 'str', revision_number: 'int', value: 'Mapping[str, Any]', created_at: 'datetime') -> None
ProfileRevisionRecord(id: 'RevisionId', profile_id: 'str', revision_number: 'int', value: 'Mapping[str, Any]', created_at: 'datetime')
SQLiteArtifactStore
m3.storage.SQLiteArtifactStore(database: 'str | Path', blob_root: 'str | Path | None' = None, **kwargs: 'Any') -> 'None'
Filesystem-backed content-addressed artifact store with SQLite refs.
Public fields and methods:
put(self, execution_id: 'ExecutionId | str', name: 'str', content: 'bytes', *, media_type: 'str | None' = None) -> 'ArtifactRef'— Public method onSQLiteArtifactStore.get(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'bytes'— Public method onSQLiteArtifactStore.get_ref(self, artifact_id: 'ArtifactId | str') -> 'ArtifactRef'— Public method onSQLiteArtifactStore.iter_refs(self, execution_id: 'ExecutionId | str | None' = None) -> 'Iterator[ArtifactRef]'— Public method onSQLiteArtifactStore.delete(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'None'— Public method onSQLiteArtifactStore.cleanup(self) -> 'None'— Public method onSQLiteArtifactStore.
SQLiteExecutionStore
m3.storage.SQLiteExecutionStore(database: 'str | Path', *, blob_root: 'str | Path | None' = None, config: 'RedactionConfig | None' = None, capture_config: 'CaptureOptions | None' = None, payload_blob_threshold: 'int' = 65536, **kwargs: 'Any') -> 'None'
SQLite implementation of the public :class:ExecutionStore protocol.
Public fields and methods:
resolve_managed_input_store(self) -> 'SQLiteManagedInputStore'— Resolve managed-input storage lazily for opted-in executions.ensure_project(self, project_id: 'str', project_name: 'str') -> 'tuple[str, str]'— Register a stable project identity and refresh its display name.get_project(self, project_id: 'str') -> 'tuple[str, str] | None'— Public method onSQLiteExecutionStore.ensure_suite(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite'— Public method onSQLiteExecutionStore.get_suite(self, suite_id: 'SuiteId | str') -> 'Suite | None'— Public method onSQLiteExecutionStore.get_suite_by_name(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite | None'— Public method onSQLiteExecutionStore.list_suites(self) -> 'tuple[Suite, ...]'— Public method onSQLiteExecutionStore.create(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, Any] | None' = None, provenance: 'Mapping[str, Any] | None' = None, server_bindings: 'Sequence[Mapping[str, Any]]' = (), harness_binding: 'Mapping[str, Any] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onSQLiteExecutionStore.create_execution(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, Any] | None' = None, provenance: 'Mapping[str, Any] | None' = None, server_bindings: 'Sequence[Mapping[str, Any]]' = (), harness_binding: 'Mapping[str, Any] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onSQLiteExecutionStore.save_test_run(self, run_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onSQLiteExecutionStore.get_test_run(self, run_id: 'str') -> 'Mapping[str, object] | None'— Public method onSQLiteExecutionStore.list_test_runs(self) -> 'tuple[Mapping[str, object], ...]'— Public method onSQLiteExecutionStore.list_test_run_page(self, *, limit: 'int | None' = None, offset: 'int' = 0, suite_id: 'int | None' = None, project_id: 'str | None' = None, q: 'str | None' = None) -> 'tuple[tuple[Mapping[str, object], ...], int]'— Return newest-first run manifests with their suites, and the total.save_test_result(self, run_id: 'str', attempt_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onSQLiteExecutionStore.list_test_results(self, run_id: 'str') -> 'tuple[Mapping[str, object], ...]'— Public method onSQLiteExecutionStore.get_snapshot(self, execution_id: 'ExecutionId | str') -> 'ExecutionState | None'— Public method onSQLiteExecutionStore.get_execution_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Return the immutable typed submission spec, if one was saved.get_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Return the immutable typed submission spec, if one was saved.list_executions(self, *, limit: 'int' = 50, offset: 'int' = 0, lifecycle: 'ExecutionStatus | str | None' = None, outcome: 'ExecutionOutcome | str | None' = None, run_id: 'str | None' = None, suite_id: 'int | None' = None, project_id: 'str | None' = None) -> 'ExecutionPage'— Public method onSQLiteExecutionStore.get_report(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1, event_limit: 'int | None' = None, artifact_limit: 'int | None' = None) -> 'ExecutionReport | None'— Public method onSQLiteExecutionStore.get_trace(self, execution_id: 'ExecutionId | str') -> 'TraceResult | None'— Public method onSQLiteExecutionStore.get_trace_view(self, execution_id: 'ExecutionId | str') -> 'TraceView | None'— Public method onSQLiteExecutionStore.save_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onSQLiteExecutionStore.update_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onSQLiteExecutionStore.append_events(self, events: 'Sequence[Event]') -> 'None'— Public method onSQLiteExecutionStore.append(self, events: 'Sequence[Event]') -> 'None'— Public method onSQLiteExecutionStore.append_event(self, event: 'Event', content: 'bytes', *, media_type: 'str') -> 'Event'— Commit an event and its raw blob in one SQLite transaction.iter_events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'Iterator[Event]'— Public method onSQLiteExecutionStore.events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'tuple[Event, ...]'— Public method onSQLiteExecutionStore.create_session(self, execution_id: 'ExecutionId | str', session_id: 'SessionId | str', *, state: 'str' = 'open') -> 'SessionId'— Public method onSQLiteExecutionStore.close_session(self, session_id: 'SessionId | str') -> 'None'— Public method onSQLiteExecutionStore.save_turn(self, snapshot: 'TurnState', result: 'TurnResult | Mapping[str, Any] | None' = None) -> 'None'— Public method onSQLiteExecutionStore.append_turn(self, snapshot: 'TurnState', result: 'TurnResult | Mapping[str, Any] | None' = None) -> 'None'— Public method onSQLiteExecutionStore.turns(self, execution_id: 'ExecutionId | str') -> 'tuple[tuple[TurnState, TurnResult | None], ...]'— Public method onSQLiteExecutionStore.save_evaluation(self, execution_id: 'ExecutionId | str', result: 'Mapping[str, Any] | Any', *, evaluation_id: 'str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'str'— Public method onSQLiteExecutionStore.reserve_judge_request(self, run_id: 'str', limit: 'int') -> 'bool'— Atomically reserve one judge request for a run across workers.save(self, result: 'EvaluationResult') -> 'None'— Public method onSQLiteExecutionStore.get(self, evaluation_id: 'str') -> 'EvaluationResult | None'— Public method onSQLiteExecutionStore.all(self) -> 'tuple[EvaluationResult, ...]'— Public method onSQLiteExecutionStore.evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onSQLiteExecutionStore.aggregate_evaluations(self, query: 'EvaluationQuery') -> 'EvaluationReport'— Calculate summaries from persisted evaluations and execution traces.persisted_evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onSQLiteExecutionStore.evaluation_json(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[Mapping[str, Any], ...]'— Public method onSQLiteExecutionStore.transaction(self, execution_id: 'ExecutionId | str') -> 'ExecutionTransaction'— Public method onSQLiteExecutionStore.allocate(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Public method onSQLiteExecutionStore.allocate_sequence(self, execution_id)— Public method onSQLiteExecutionStore.allocate_sequences(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Public method onSQLiteExecutionStore.release(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onSQLiteExecutionStore.release_sequences(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onSQLiteExecutionStore.subscribe(self, execution_id: 'ExecutionId | str', callback: 'EventCallback') -> 'Callable[[], None]'— Public method onSQLiteExecutionStore.save_acp_probe(self, result: 'ACPProbeResult') -> 'ACPProbeResult'— Persist one redacted ACP probe result and return its safe copy.get_acp_probe(self, probe_id: 'str') -> 'ACPProbeResult | None'— Public method onSQLiteExecutionStore.list_acp_probes(self, dimension: 'ACPProbeDimension | None' = None, *, include_inflight: 'bool' = True) -> 'tuple[ACPProbeResult, ...]'— Public method onSQLiteExecutionStore.latest_acp_probe(self, dimension: 'ACPProbeDimension') -> 'ACPProbeResult | None'— Public method onSQLiteExecutionStore.create_profile(self, kind: 'str', name: 'str', value: 'Mapping[str, Any]', *, description: 'str' = '', profile_id: 'str | None' = None, revision_id: 'str | None' = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.create_server_profile(self, name: 'str', value: 'Mapping[str, Any]', **kwargs: 'Any') -> 'ProfileRecord'— Public method onSQLiteExecutionStore.create_harness_profile(self, name: 'str', value: 'Mapping[str, Any]', **kwargs: 'Any') -> 'ProfileRecord'— Public method onSQLiteExecutionStore.get_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord | None'— Public method onSQLiteExecutionStore.resolve_profile(self, profile_id: 'str', selection: 'RevisionSelection', *, kind: "Literal['server', 'harness']") -> 'tuple[ProfileRecord | None, ProfileRevisionRecord | None]'— Read one profile and its selected immutable revision.list_profiles(self, kind: 'str', *, include_archived: 'bool' = False) -> 'tuple[ProfileRecord, ...]'— List one profile family in stable name/id order.list_profile_revisions(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'tuple[ProfileRevisionRecord, ...]'— Return every revision ordered by revision number then id.update_profile(self, profile_id: 'str', *, name: 'str | None' = None, description: 'str | None' = None, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Update mutable metadata without changing the immutable revision.add_revision(self, profile_id: 'str', value: 'Mapping[str, Any]', *, revision_id: 'str | None' = None, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord'— Public method onSQLiteExecutionStore.archive_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.restore_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.resolve_revision(self, profile_id: 'str', selection: 'RevisionSelection | str' = 'latest', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord'— Public method onSQLiteExecutionStore.get_revision(self, revision_id: 'RevisionId | str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord | None'— Public method onSQLiteExecutionStore.enqueue_command(self, execution_id: 'ExecutionId | str', kind: 'str' = 'execution', payload: 'Mapping[str, Any] | None' = None, *, command_id: 'str | None' = None, session_id: 'SessionId | str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'Command'— Public method onSQLiteExecutionStore.enqueue(self, execution_id: 'ExecutionId | str', kind: 'str' = 'execution', payload: 'Mapping[str, Any] | None' = None, *, command_id: 'str | None' = None, session_id: 'SessionId | str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'Command'— Public method onSQLiteExecutionStore.get_command(self, command_id: 'str') -> 'Command | None'— Public method onSQLiteExecutionStore.claim_next(self, owner_id: 'str', *, lease_seconds: 'float' = 30.0) -> 'tuple[Command, Lease] | None'— Public method onSQLiteExecutionStore.claim(self, owner_id: 'str', *, lease_seconds: 'float' = 30.0) -> 'tuple[Command, Lease] | None'— Public method onSQLiteExecutionStore.heartbeat(self, lease: 'Lease | str', *, owner_id: 'str | None' = None, lease_seconds: 'float' = 30.0) -> 'bool'— Public method onSQLiteExecutionStore.renew_lease(self, lease: 'Lease | str', *, owner_id: 'str | None' = None, lease_seconds: 'float' = 30.0) -> 'bool'— Public method onSQLiteExecutionStore.mark_interrupted_if_lease_lost(self, lease: 'Lease', *, reason: 'str' = 'worker lease lost') -> 'bool'— Atomically close work whose owner can no longer renew its lease.mark_managed_recovery_unavailable_if_lease_lost(self, lease: 'Lease', *, reason: 'str' = 'managed interaction cannot be resumed safely after worker loss') -> 'bool'— Terminalize managed input when its owning worker is lost.release_lease(self, lease: 'Lease | str', *, owner_id: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.complete_command(self, command_id: 'str', *, owner_id: 'str', lease_token: 'str', status: 'str' = 'done') -> 'bool'— Mark one claimed command terminal under its current lease.request_cancel(self, execution_id: 'ExecutionId | str', reason: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.cancel(self, execution_id: 'ExecutionId | str', reason: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.finalize_cancelled(self, execution_id: 'ExecutionId | str', *, reason: 'str' = 'cancelled') -> 'bool'— Persist a cancellation terminal event when a worker observed it.cancellation_requested(self, execution_id: 'ExecutionId | str') -> 'bool'— Public method onSQLiteExecutionStore.mark_stale_interrupted(self, *, now: 'datetime | None' = None) -> 'tuple[ExecutionId, ...]'— Public method onSQLiteExecutionStore.delete_execution(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onSQLiteExecutionStore.delete(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onSQLiteExecutionStore.put_raw_evidence(self, event_id: 'EventId | str', content: 'bytes', *, media_type: 'str') -> 'EvidenceCapture'— Redact, bound, and durably associate evidence with one event.read_raw_evidence(self, reference: 'EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Public method onSQLiteExecutionStore.clone_execution(self, execution_id: 'ExecutionId | str', *, use_latest: 'bool' = False) -> 'ExecutionId'— Public method onSQLiteExecutionStore.clone(self, execution_id: 'ExecutionId | str', *, use_latest: 'bool' = False) -> 'ExecutionId'— Public method onSQLiteExecutionStore.resolved_bindings(self, execution_id: 'ExecutionId | str') -> 'Mapping[str, Any]'— Return the immutable, submission-time profile binding snapshot.close(self) -> 'None'— Public method onSQLiteExecutionStore.
SQLiteManagedInputStore
m3.storage.SQLiteManagedInputStore(database: 'str | Path', *, busy_timeout_ms: 'int' = 5000, clock: 'Callable[[], datetime]' = <function _now>) -> 'None'
SQLite-backed managed-input storage sharing a database path safely.
Public fields and methods:
get_round(self, execution_id: 'str', round_id: 'str') -> 'ManagedInputRecord | None'— Public method onSQLiteManagedInputStore.list_rounds(self, execution_id: 'str') -> 'tuple[ManagedInputRecord, ...]'— Public method onSQLiteManagedInputStore.create_round(self, pending: 'PendingElicitationRound', *, round_index: 'int', round_limit: 'int', owner_id: 'str', lease_seconds: 'float', lease_token: 'str | None' = None, harness_session_id: 'str | None' = None, native_resume_token: 'str | None' = None, delivery_idempotency_key: 'str | None' = None, session_id: 'str | None' = None, turn_id: 'str | None' = None, operation_parameters: 'Mapping[str, object] | None' = None) -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.claim_round(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_seconds: 'float', expected_lease_token: 'str | None' = None, delivery_state: "Literal['not_started', 'not_delivered', 'delivered'] | None" = None, idempotent_delivery: 'bool' = False) -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.renew(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str', lease_seconds: 'float') -> 'ManagedInputRecord'— Renew an active local wait without changing its compare-and-set token.submit_responses(self, execution_id: 'str', round_id: 'str', responses: 'Mapping[str, ElicitationResponse]', *, owner_id: 'str', lease_token: 'str', response_idempotency_key: 'str') -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.start_delivery(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str') -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.mark_delivered(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str') -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.resolve(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str') -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.fail(self, execution_id: 'str', round_id: 'str', *, owner_id: 'str', lease_token: 'str', code: 'str', message: 'str') -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.fail_recovery(self, execution_id: 'str', round_id: 'str', *, expected_lease_token: 'str', message: 'str') -> 'ManagedInputRecord'— Public method onSQLiteManagedInputStore.redacted_responses(self, execution_id: 'str', round_id: 'str') -> 'Mapping[str, object] | None'— Public method onSQLiteManagedInputStore.
SQLiteStore
m3.storage.SQLiteStore(database: 'str | Path', *, blob_root: 'str | Path | None' = None, config: 'RedactionConfig | None' = None, capture_config: 'CaptureOptions | None' = None, payload_blob_threshold: 'int' = 65536, **kwargs: 'Any') -> 'None'
SQLite implementation of the public :class:ExecutionStore protocol.
Public fields and methods:
resolve_managed_input_store(self) -> 'SQLiteManagedInputStore'— Resolve managed-input storage lazily for opted-in executions.ensure_project(self, project_id: 'str', project_name: 'str') -> 'tuple[str, str]'— Register a stable project identity and refresh its display name.get_project(self, project_id: 'str') -> 'tuple[str, str] | None'— Public method onSQLiteExecutionStore.ensure_suite(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite'— Public method onSQLiteExecutionStore.get_suite(self, suite_id: 'SuiteId | str') -> 'Suite | None'— Public method onSQLiteExecutionStore.get_suite_by_name(self, suite_name: 'str', project_id: 'str | None' = None) -> 'Suite | None'— Public method onSQLiteExecutionStore.list_suites(self) -> 'tuple[Suite, ...]'— Public method onSQLiteExecutionStore.create(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, Any] | None' = None, provenance: 'Mapping[str, Any] | None' = None, server_bindings: 'Sequence[Mapping[str, Any]]' = (), harness_binding: 'Mapping[str, Any] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onSQLiteExecutionStore.create_execution(self, snapshot: 'ExecutionState', *, specification: 'Mapping[str, Any] | None' = None, provenance: 'Mapping[str, Any] | None' = None, server_bindings: 'Sequence[Mapping[str, Any]]' = (), harness_binding: 'Mapping[str, Any] | None' = None, parent_execution_id: 'ExecutionId | str | None' = None, run_id: 'RunId | str | None' = None) -> 'None'— Public method onSQLiteExecutionStore.save_test_run(self, run_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onSQLiteExecutionStore.get_test_run(self, run_id: 'str') -> 'Mapping[str, object] | None'— Public method onSQLiteExecutionStore.list_test_runs(self) -> 'tuple[Mapping[str, object], ...]'— Public method onSQLiteExecutionStore.list_test_run_page(self, *, limit: 'int | None' = None, offset: 'int' = 0, suite_id: 'int | None' = None, project_id: 'str | None' = None, q: 'str | None' = None) -> 'tuple[tuple[Mapping[str, object], ...], int]'— Return newest-first run manifests with their suites, and the total.save_test_result(self, run_id: 'str', attempt_id: 'str', value: 'Mapping[str, object]') -> 'None'— Public method onSQLiteExecutionStore.list_test_results(self, run_id: 'str') -> 'tuple[Mapping[str, object], ...]'— Public method onSQLiteExecutionStore.get_snapshot(self, execution_id: 'ExecutionId | str') -> 'ExecutionState | None'— Public method onSQLiteExecutionStore.get_execution_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Return the immutable typed submission spec, if one was saved.get_spec(self, execution_id: 'ExecutionId | str') -> 'ExecutionSpec | None'— Return the immutable typed submission spec, if one was saved.list_executions(self, *, limit: 'int' = 50, offset: 'int' = 0, lifecycle: 'ExecutionStatus | str | None' = None, outcome: 'ExecutionOutcome | str | None' = None, run_id: 'str | None' = None, suite_id: 'int | None' = None, project_id: 'str | None' = None) -> 'ExecutionPage'— Public method onSQLiteExecutionStore.get_report(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1, event_limit: 'int | None' = None, artifact_limit: 'int | None' = None) -> 'ExecutionReport | None'— Public method onSQLiteExecutionStore.get_trace(self, execution_id: 'ExecutionId | str') -> 'TraceResult | None'— Public method onSQLiteExecutionStore.get_trace_view(self, execution_id: 'ExecutionId | str') -> 'TraceView | None'— Public method onSQLiteExecutionStore.save_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onSQLiteExecutionStore.update_snapshot(self, snapshot: 'ExecutionState') -> 'None'— Public method onSQLiteExecutionStore.append_events(self, events: 'Sequence[Event]') -> 'None'— Public method onSQLiteExecutionStore.append(self, events: 'Sequence[Event]') -> 'None'— Public method onSQLiteExecutionStore.append_event(self, event: 'Event', content: 'bytes', *, media_type: 'str') -> 'Event'— Commit an event and its raw blob in one SQLite transaction.iter_events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'Iterator[Event]'— Public method onSQLiteExecutionStore.events(self, execution_id: 'ExecutionId | str', *, after_sequence: 'int' = -1) -> 'tuple[Event, ...]'— Public method onSQLiteExecutionStore.create_session(self, execution_id: 'ExecutionId | str', session_id: 'SessionId | str', *, state: 'str' = 'open') -> 'SessionId'— Public method onSQLiteExecutionStore.close_session(self, session_id: 'SessionId | str') -> 'None'— Public method onSQLiteExecutionStore.save_turn(self, snapshot: 'TurnState', result: 'TurnResult | Mapping[str, Any] | None' = None) -> 'None'— Public method onSQLiteExecutionStore.append_turn(self, snapshot: 'TurnState', result: 'TurnResult | Mapping[str, Any] | None' = None) -> 'None'— Public method onSQLiteExecutionStore.turns(self, execution_id: 'ExecutionId | str') -> 'tuple[tuple[TurnState, TurnResult | None], ...]'— Public method onSQLiteExecutionStore.save_evaluation(self, execution_id: 'ExecutionId | str', result: 'Mapping[str, Any] | Any', *, evaluation_id: 'str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'str'— Public method onSQLiteExecutionStore.reserve_judge_request(self, run_id: 'str', limit: 'int') -> 'bool'— Atomically reserve one judge request for a run across workers.save(self, result: 'EvaluationResult') -> 'None'— Public method onSQLiteExecutionStore.get(self, evaluation_id: 'str') -> 'EvaluationResult | None'— Public method onSQLiteExecutionStore.all(self) -> 'tuple[EvaluationResult, ...]'— Public method onSQLiteExecutionStore.evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onSQLiteExecutionStore.aggregate_evaluations(self, query: 'EvaluationQuery') -> 'EvaluationReport'— Calculate summaries from persisted evaluations and execution traces.persisted_evaluations(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[EvaluationRecord, ...]'— Public method onSQLiteExecutionStore.evaluation_json(self, execution_id: 'ExecutionId | str', *, turn_id: 'TurnId | str | None' = None) -> 'tuple[Mapping[str, Any], ...]'— Public method onSQLiteExecutionStore.transaction(self, execution_id: 'ExecutionId | str') -> 'ExecutionTransaction'— Public method onSQLiteExecutionStore.allocate(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Public method onSQLiteExecutionStore.allocate_sequence(self, execution_id)— Public method onSQLiteExecutionStore.allocate_sequences(self, execution_id: 'ExecutionId | str', *, count: 'int' = 1) -> 'tuple[int, ...]'— Public method onSQLiteExecutionStore.release(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onSQLiteExecutionStore.release_sequences(self, execution_id: 'ExecutionId | str', sequences: 'Sequence[int]') -> 'None'— Public method onSQLiteExecutionStore.subscribe(self, execution_id: 'ExecutionId | str', callback: 'EventCallback') -> 'Callable[[], None]'— Public method onSQLiteExecutionStore.save_acp_probe(self, result: 'ACPProbeResult') -> 'ACPProbeResult'— Persist one redacted ACP probe result and return its safe copy.get_acp_probe(self, probe_id: 'str') -> 'ACPProbeResult | None'— Public method onSQLiteExecutionStore.list_acp_probes(self, dimension: 'ACPProbeDimension | None' = None, *, include_inflight: 'bool' = True) -> 'tuple[ACPProbeResult, ...]'— Public method onSQLiteExecutionStore.latest_acp_probe(self, dimension: 'ACPProbeDimension') -> 'ACPProbeResult | None'— Public method onSQLiteExecutionStore.create_profile(self, kind: 'str', name: 'str', value: 'Mapping[str, Any]', *, description: 'str' = '', profile_id: 'str | None' = None, revision_id: 'str | None' = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.create_server_profile(self, name: 'str', value: 'Mapping[str, Any]', **kwargs: 'Any') -> 'ProfileRecord'— Public method onSQLiteExecutionStore.create_harness_profile(self, name: 'str', value: 'Mapping[str, Any]', **kwargs: 'Any') -> 'ProfileRecord'— Public method onSQLiteExecutionStore.get_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord | None'— Public method onSQLiteExecutionStore.resolve_profile(self, profile_id: 'str', selection: 'RevisionSelection', *, kind: "Literal['server', 'harness']") -> 'tuple[ProfileRecord | None, ProfileRevisionRecord | None]'— Read one profile and its selected immutable revision.list_profiles(self, kind: 'str', *, include_archived: 'bool' = False) -> 'tuple[ProfileRecord, ...]'— List one profile family in stable name/id order.list_profile_revisions(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'tuple[ProfileRevisionRecord, ...]'— Return every revision ordered by revision number then id.update_profile(self, profile_id: 'str', *, name: 'str | None' = None, description: 'str | None' = None, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Update mutable metadata without changing the immutable revision.add_revision(self, profile_id: 'str', value: 'Mapping[str, Any]', *, revision_id: 'str | None' = None, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord'— Public method onSQLiteExecutionStore.archive_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.restore_profile(self, profile_id: 'str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRecord'— Public method onSQLiteExecutionStore.resolve_revision(self, profile_id: 'str', selection: 'RevisionSelection | str' = 'latest', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord'— Public method onSQLiteExecutionStore.get_revision(self, revision_id: 'RevisionId | str', *, kind: "Literal['server', 'harness'] | None" = None) -> 'ProfileRevisionRecord | None'— Public method onSQLiteExecutionStore.enqueue_command(self, execution_id: 'ExecutionId | str', kind: 'str' = 'execution', payload: 'Mapping[str, Any] | None' = None, *, command_id: 'str | None' = None, session_id: 'SessionId | str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'Command'— Public method onSQLiteExecutionStore.enqueue(self, execution_id: 'ExecutionId | str', kind: 'str' = 'execution', payload: 'Mapping[str, Any] | None' = None, *, command_id: 'str | None' = None, session_id: 'SessionId | str | None' = None, turn_id: 'TurnId | str | None' = None) -> 'Command'— Public method onSQLiteExecutionStore.get_command(self, command_id: 'str') -> 'Command | None'— Public method onSQLiteExecutionStore.claim_next(self, owner_id: 'str', *, lease_seconds: 'float' = 30.0) -> 'tuple[Command, Lease] | None'— Public method onSQLiteExecutionStore.claim(self, owner_id: 'str', *, lease_seconds: 'float' = 30.0) -> 'tuple[Command, Lease] | None'— Public method onSQLiteExecutionStore.heartbeat(self, lease: 'Lease | str', *, owner_id: 'str | None' = None, lease_seconds: 'float' = 30.0) -> 'bool'— Public method onSQLiteExecutionStore.renew_lease(self, lease: 'Lease | str', *, owner_id: 'str | None' = None, lease_seconds: 'float' = 30.0) -> 'bool'— Public method onSQLiteExecutionStore.mark_interrupted_if_lease_lost(self, lease: 'Lease', *, reason: 'str' = 'worker lease lost') -> 'bool'— Atomically close work whose owner can no longer renew its lease.mark_managed_recovery_unavailable_if_lease_lost(self, lease: 'Lease', *, reason: 'str' = 'managed interaction cannot be resumed safely after worker loss') -> 'bool'— Terminalize managed input when its owning worker is lost.release_lease(self, lease: 'Lease | str', *, owner_id: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.complete_command(self, command_id: 'str', *, owner_id: 'str', lease_token: 'str', status: 'str' = 'done') -> 'bool'— Mark one claimed command terminal under its current lease.request_cancel(self, execution_id: 'ExecutionId | str', reason: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.cancel(self, execution_id: 'ExecutionId | str', reason: 'str | None' = None) -> 'bool'— Public method onSQLiteExecutionStore.finalize_cancelled(self, execution_id: 'ExecutionId | str', *, reason: 'str' = 'cancelled') -> 'bool'— Persist a cancellation terminal event when a worker observed it.cancellation_requested(self, execution_id: 'ExecutionId | str') -> 'bool'— Public method onSQLiteExecutionStore.mark_stale_interrupted(self, *, now: 'datetime | None' = None) -> 'tuple[ExecutionId, ...]'— Public method onSQLiteExecutionStore.delete_execution(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onSQLiteExecutionStore.delete(self, execution_id: 'ExecutionId | str') -> 'None'— Public method onSQLiteExecutionStore.put_raw_evidence(self, event_id: 'EventId | str', content: 'bytes', *, media_type: 'str') -> 'EvidenceCapture'— Redact, bound, and durably associate evidence with one event.read_raw_evidence(self, reference: 'EvidenceRef', *, max_bytes: 'int' = 1048576) -> 'RawEvidence'— Public method onSQLiteExecutionStore.clone_execution(self, execution_id: 'ExecutionId | str', *, use_latest: 'bool' = False) -> 'ExecutionId'— Public method onSQLiteExecutionStore.clone(self, execution_id: 'ExecutionId | str', *, use_latest: 'bool' = False) -> 'ExecutionId'— Public method onSQLiteExecutionStore.resolved_bindings(self, execution_id: 'ExecutionId | str') -> 'Mapping[str, Any]'— Return the immutable, submission-time profile binding snapshot.close(self) -> 'None'— Public method onSQLiteExecutionStore.
SQLiteStoreWorker
m3.storage.SQLiteStoreWorker(store: 'Any', runner: 'Callable[[Any, Any, Any], Any]', *, worker_id: 'str | None' = None, lease_seconds: 'float' = 30.0, cancel_runner: 'Callable[[Any], Any] | None' = None) -> 'None'
Embedded worker facade for :class:SQLiteExecutionStore.
Public fields and methods:
run_once(self) -> 'bool'— Public method onSQLiteStoreWorker.stop(self) -> 'None'— Public method onSQLiteStoreWorker.
StorageConflict
m3.storage.StorageConflict
The append or snapshot operation conflicts with committed state.
StorageError
m3.storage.StorageError
Base class for expected ephemeral storage failures.
TemporaryArtifactStore
m3.storage.TemporaryArtifactStore(root: 'str | os.PathLike[str] | None' = None, *, config: 'RedactionConfig | None' = None) -> 'None'
Filesystem-backed temporary artifact store with atomic blob placement.
Public fields and methods:
put(self, execution_id: 'ExecutionId | str', name: 'str', content: 'bytes', *, media_type: 'str | None' = None) -> 'ArtifactRef'— Public method onTemporaryArtifactStore.get(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'bytes'— Public method onTemporaryArtifactStore.delete(self, artifact: 'ArtifactRef | ArtifactId | str') -> 'None'— Public method onTemporaryArtifactStore.cleanup(self) -> 'None'— Public method onTemporaryArtifactStore.
serialize_durable
m3.storage.serialize_durable(value: 'Any', *, config: 'RedactionConfig | None' = None, path: 'str' = '$') -> 'Any'
Return strict JSON-compatible durable data while preserving references.