Skip to main content

Crate agent_sdk_core

Crate agent_sdk_core 

Source
Expand description

Product-neutral core contracts and first-slice runtime for the Agent SDK.

The core crate owns typed domain primitives, package snapshots, run control, events, journals, policy, and test fakes. Product hosts and optional crates own concrete providers, toolkits, isolation runtimes, telemetry exporters, workflow engines, UI, and channel adapters.

§Common Helper

Simple helpers are convenience wrappers over the canonical request path.

use agent_sdk_core::{Agent, AgentId, RunId, RunRequest, SourceKind, SourceRef};

let agent = Agent::builder()
    .id(AgentId::new("agent.docs.helper"))
    .name("docs helper")
    .build()?;
let source = SourceRef::with_kind(SourceKind::Host, "source.docs.helper");

let lowered = RunRequest::text(
    RunId::new("run.docs.helper"),
    agent.id().clone(),
    source.clone(),
    "hello",
);

assert_eq!(
    agent
        .typed_text_request::<DocsTodo>(
            RunId::new("run.docs.helper.typed"),
            source,
            "extract a todo",
        )
        .agent_id,
    lowered.agent_id
);

§Advanced Request Path

Advanced callers can construct the same DTOs explicitly. Runtime execution still resolves one effective RuntimePackage before provider calls, policy checks, journal appends, events, redaction, and telemetry projections.

use agent_sdk_core::{
    AgentId, OutputContract, RunId, RunRequest, SourceKind, SourceRef,
};

let request = RunRequest::text(
    RunId::new("run.docs.advanced"),
    AgentId::new("agent.docs.advanced"),
    SourceRef::with_kind(SourceKind::Host, "source.docs.advanced"),
    "extract a todo",
)
.with_output_contract(OutputContract::for_type::<DocsTodo>());

assert!(request.output_contract.is_some());

§SemVer Posture

The supported consumer import surface is the crate root plus documented namespaces such as agent_sdk_core::testing and agent_sdk_core::ports. Deep implementation modules remain review surfaces until release readiness; downstream code should prefer builders, constructors, accessors, and wildcard matches for public enums so the SDK can add fields and variants without creating avoidable SemVer pressure.

Re-exports§

pub use agent::Agent;
pub use agent::AgentBuilder;
pub use agent_pool::AgentPool;
pub use agent_pool::AgentPoolBuilder;
pub use agent_pool::AgentPoolMember;
pub use agent_pool::AgentPoolMessagePolicy;
pub use agent_pool::AgentPoolSnapshot;
pub use agent_pool::AgentPoolStore;
pub use agent_pool::AgentPoolStoreConfig;
pub use agent_pool::AgentPoolStoreCursor;
pub use agent_pool::AgentPoolStoreRecord;
pub use agent_pool::AgentPoolStoreRecordPayload;
pub use agent_pool::AgentPoolStoreStream;
pub use agent_pool::AgentPoolStoredMessage;
pub use agent_pool::AgentPoolStoredWake;
pub use agent_pool::AgentPoolWakePolicy;
pub use agent_pool::InMemoryAgentPoolStore;
pub use agent_pool::MessageReceipt;
pub use agent_pool::MessageResponseContract;
pub use agent_pool::MessageStatus;
pub use agent_pool::ResumeInputPolicy;
pub use agent_pool::RunAddress;
pub use agent_pool::RunAddressTarget;
pub use agent_pool::RunMessage;
pub use agent_pool::WakeCondition;
pub use agent_pool::WakeRegistration;
pub use agent_pool::WakeRegistrationStatus;
pub use anti_entropy::AntiEntropyRepair;
pub use anti_entropy::AntiEntropyReport;
pub use anti_entropy::AntiEntropyScanner;
pub use anti_entropy::DerivedViewKind;
pub use anti_entropy::DerivedViewState;
pub use application_isolation::IsolationCleanupOutcome;
pub use application_isolation::IsolationDowngradeApproval;
pub use application_isolation::IsolationLifecycleContext;
pub use application_isolation::IsolationLifecycleCoordinator;
pub use application_isolation::IsolationMatchStatus;
pub use application_isolation::IsolationProcessOutcome;
pub use application_isolation::IsolationReadinessProfile;
pub use application_isolation::IsolationSelectionOutcome;
pub use application_isolation::PolicyDecisionScope;
pub use approval::ApprovalBroker;
pub use approval_ports::ApprovalDispatchRequest;
pub use approval_ports::ApprovalDispatchResponse;
pub use approval_ports::ApprovalDispatcher;
pub use approval_records::ApprovalBrokerOutcome;
pub use approval_records::ApprovalDecision;
pub use approval_records::ApprovalLifecycleStatus;
pub use approval_records::ApprovalRecord;
pub use approval_records::ApprovalRequest;
pub use approval_records::ApprovalTerminalStatus;
pub use capability::CapabilityId;
pub use capability::CapabilityKind;
pub use capability::CapabilityNamespace;
pub use capability::CapabilityReadiness;
pub use capability::CapabilityReadinessStatus;
pub use capability::CapabilitySource;
pub use capability::CapabilitySourceKind;
pub use capability::CapabilitySpec;
pub use capability::CapabilityVersion;
pub use capability::CapabilityVisibility;
pub use capability::ExecutableCapabilityRoute;
pub use capability::ExecutorRef;
pub use capability::PackageSidecarRef;
pub use capability::ProjectionMode;
pub use capability::ProviderCapabilityProjection;
pub use checkpoint::CheckpointPrunePolicy;
pub use checkpoint::CheckpointPruneReport;
pub use checkpoint::CheckpointSaveOutcome;
pub use checkpoint::CheckpointStore;
pub use checkpoint::InMemoryCheckpointStore;
pub use content::ArtifactRef;
pub use content::ArtifactVersion;
pub use content::ContentKind;
pub use content::ContentRef;
pub use content::ContentResolutionError;
pub use content::ContentResolutionErrorKind;
pub use content::ContentResolutionPolicy;
pub use content::ContentResolutionPurpose;
pub use content::ContentResolveRequest;
pub use content::ContentScope;
pub use content::ContentVersion;
pub use content::MissingContentPolicy;
pub use content::ResolvedContent;
pub use content::RetentionUse;
pub use content_ports::ContentResolver;
pub use context::AgentMessage;
pub use context::AgentMessagePart;
pub use context::AgentMessageRole;
pub use context::ContextBudgetHint;
pub use context::ContextBudgetSummary;
pub use context::ContextContribution;
pub use context::ContextContributionId;
pub use context::ContextContributionKind;
pub use context::ContextItem;
pub use context::ContextProjection;
pub use context::ContextProjectionAudit;
pub use context::ContextSelectionDecision;
pub use context::ContextSelectionReason;
pub use context::ProjectedContextPart;
pub use context::ProjectionRole;
pub use domain::AdapterRef;
pub use domain::AgentId;
pub use domain::AgentPoolId;
pub use domain::ArtifactId;
pub use domain::AttemptId;
pub use domain::ContentId;
pub use domain::CorrelationEntry;
pub use domain::CorrelationKey;
pub use domain::CorrelationValue;
pub use domain::DedupeKey;
pub use domain::DestinationKind;
pub use domain::DestinationRef;
pub use domain::EffectId;
pub use domain::EntityKind;
pub use domain::EntityRef;
pub use domain::EventCursorId;
pub use domain::EventId;
pub use domain::IdValidationError;
pub use domain::IdempotencyKey;
pub use domain::LineageId;
pub use domain::LineageRef;
pub use domain::MAX_ID_LEN;
pub use domain::MessageId;
pub use domain::OutputSchemaId;
pub use domain::PolicyKind;
pub use domain::PolicyRef;
pub use domain::PrivacyClass;
pub use domain::RepairAttemptId;
pub use domain::RetentionClass;
pub use domain::RunId;
pub use domain::RuntimePackageId;
pub use domain::SourceKind;
pub use domain::SourceRef;
pub use domain::ToolCallId;
pub use domain::TopicId;
pub use domain::TraceId;
pub use domain::TrustClass;
pub use domain::TurnId;
pub use domain::ValidatedOutputId;
pub use domain::ValidationAttemptId;
pub use domain::WakeConditionId;
pub use effect::EffectIntent;
pub use effect::EffectKind;
pub use effect::EffectResult;
pub use effect::EffectTerminalStatus;
pub use error::AgentError;
pub use error::AgentErrorKind;
pub use error::CausalIds;
pub use error::ErrorContext;
pub use error::RetryClassification;
pub use event::AgentEvent;
pub use event::ArchiveCursor;
pub use event::CompiledEventFilter;
pub use event::EventCursor;
pub use event::EventEnvelope;
pub use event::EventFamily;
pub use event::EventFilter;
pub use event::EventFrame;
pub use event::EventKind;
pub use event::EventOverflowNotice;
pub use event_bus::AgentEventBus;
pub use event_bus::AgentEventStream;
pub use event_bus::EventArchive;
pub use event_bus::InMemoryAgentEventBus;
pub use extension::ExtensionActionContext;
pub use extension::ExtensionActionCoordinator;
pub use extension::ExtensionActionOutcome;
pub use extension::ExtensionActionOutcomeStatus;
pub use extension::ExtensionProtocolRecoveryContext;
pub use extension::ExtensionProtocolRecoveryOutcome;
pub use extension::recover_extension_protocol_error;
pub use extension_ports::ExtensionActionExecutionOutput;
pub use extension_ports::ExtensionActionExecutionRequest;
pub use extension_ports::ExtensionActionExecutor;
pub use extension_ports::ExtensionActionExecutorRegistry;
pub use extension_ports::ExtensionActionRegistrySnapshot;
pub use extension_ports::ExtensionActionRequest;
pub use extension_ports::ExtensionActionRoute;
pub use extension_ports::ExtensionProtocolError;
pub use extension_ports::ExtensionProtocolErrorKind;
pub use extension_ports::ExtensionProtocolRequestId;
pub use extension_ports::ExtensionProtocolVersion;
pub use extension_ports::validate_extension_protocol_response_id;
pub use extension_records::ExtensionActionEvent;
pub use extension_records::ExtensionActionEventKind;
pub use extension_records::ExtensionActionRecord;
pub use extension_records::ExtensionActionRecordParams;
pub use extension_records::ExtensionActionRecordStatus;
pub use extension_records::ExtensionProtocolRecoveryRecord;
pub use hook_ports::HookExecutionOutcome;
pub use hook_ports::HookExecutor;
pub use hook_ports::HookExecutorRegistry;
pub use hook_ports::InMemoryHookExecutorRegistry;
pub use hook_records::HookMutationJournalPlan;
pub use hook_records::HookRecord;
pub use hook_records::HookRecordPayload;
pub use hook_records::HookResponseDecision;
pub use hooks::HookInvocationOutcome;
pub use hooks::HookInvocationStatus;
pub use hooks::HookLifecycleContext;
pub use hooks::HookLifecycleCoordinator;
pub use journal::AgentPoolLifecycleStatus;
pub use journal::AgentPoolRecord;
pub use journal::ContextProjectionRecord;
pub use journal::EventIndexProjection;
pub use journal::JournalCursor;
pub use journal::JournalRecord;
pub use journal::JournalRecordBase;
pub use journal::JournalRecordKind;
pub use journal::JournalRecordPayload;
pub use journal::MessageRecord;
pub use journal::ModelAttemptRecord;
pub use journal::PendingSideEffect;
pub use journal::RecoveryMarker;
pub use journal::RunCheckpoint;
pub use journal::RunLifecycleRecord;
pub use journal::RunMessageAddressTargetRecord;
pub use journal::RunMessageDeliveryStatus;
pub use journal::RunMessageRecord;
pub use journal::StructuredOutputRecord;
pub use journal::TerminalResultMarker;
pub use journal::WakeRecord;
pub use journal::WakeResumeInputPolicyRecord;
pub use journal::WakeTriggerStatus;
pub use journal_ports::RunJournal;
pub use journal_ports::append_before_effect;
pub use journal_ports::append_result_or_recovery;
pub use loop_state::AgentStateMachine;
pub use loop_state::CheckpointPolicy;
pub use loop_state::LoopEventKind;
pub use loop_state::LoopState;
pub use loop_state::LoopStopReason;
pub use loop_state::LoopTerminalResult;
pub use loop_state::LoopTerminalStatus;
pub use loop_state::LoopTrigger;
pub use loop_state::MaxIterationOutcome;
pub use loop_state::SideEffectPolicy;
pub use loop_state::TransitionGuard;
pub use loop_state::TransitionGuardSet;
pub use loop_state::TransitionInput;
pub use loop_state::TransitionOutput;
pub use loop_state::TransitionRule;
pub use loop_state::contract_state_names;
pub use loop_state::transition_table;
pub use loop_state::validate_transition;
pub use output::CandidateContentRepairPolicy;
pub use output::ContentHash;
pub use output::CrateName;
pub use output::OutputContract;
pub use output::OutputMode;
pub use output::OutputPreset;
pub use output::OutputProjectionHint;
pub use output::OutputSchemaDialect;
pub use output::OutputSchemaRef;
pub use output::OutputValidatorRef;
pub use output::ProviderHintPolicy;
pub use output::RepairAdapterRef;
pub use output::RepairExhaustedBehavior;
pub use output::RepairPolicy;
pub use output::RetryBackoff;
pub use output::RetryBudget;
pub use output::SchemaVersion;
pub use output::SemanticValidatorRef;
pub use output::TypeName;
pub use output::ValidationFailureVisibility;
pub use output::ValidationPolicy;
pub use output_delivery::OutputContentMode;
pub use output_delivery::OutputDeliveryDedupeRecord;
pub use output_delivery::OutputDeliveryEventKind;
pub use output_delivery::OutputDeliveryEventRecord;
pub use output_delivery::OutputDeliveryId;
pub use output_delivery::OutputDeliveryIntentRecord;
pub use output_delivery::OutputDeliveryJournalBase;
pub use output_delivery::OutputDeliveryKind;
pub use output_delivery::OutputDeliveryPolicy;
pub use output_delivery::OutputDeliveryReceipt;
pub use output_delivery::OutputDeliveryReconciliationRecord;
pub use output_delivery::OutputDeliveryRecord;
pub use output_delivery::OutputDeliveryRequest;
pub use output_delivery::OutputDeliveryRequirement;
pub use output_delivery::OutputDeliveryResultRecord;
pub use output_delivery::OutputDispatchStatus;
pub use output_delivery::OutputSinkRef;
pub use output_delivery::RawOutputContentPolicy;
pub use output_delivery::ReplayRepairDecision;
pub use output_delivery::TerminalAppendStatus;
pub use output_delivery::build_output_delivery_dedupe_key;
pub use output_delivery_port::OutputSink as OutputDeliverySink;
pub use output_delivery_port::OutputSinkCapabilities;
pub use output_delivery_port::OutputSinkRegistry as OutputDeliverySinkRegistry;
pub use output_delivery_service::OutputDedupeProof;
pub use output_delivery_service::OutputDeliveryCandidate;
pub use output_delivery_service::OutputDeliveryContext;
pub use output_delivery_service::OutputDeliveryDedupeIndex;
pub use output_delivery_service::OutputDeliveryOutcome;
pub use output_delivery_service::OutputDeliveryService;
pub use package::realtime::REALTIME_SESSION_SIDECAR_KIND;
pub use package::realtime::REALTIME_SESSION_SIDECAR_VERSION;
pub use package::realtime::RealtimeSessionSidecar;
pub use package::stream::STREAM_RULE_SIDECAR_KIND;
pub use package::stream::STREAM_RULE_SIDECAR_VERSION;
pub use package::stream::StreamRuleSidecar;
pub use package::tool_pack::AnchorValidationRequirement;
pub use package::tool_pack::PreviewApplyRequirement;
pub use package::tool_pack::ResourceRouteSnapshot;
pub use package::tool_pack::ToolDiscoverySnapshot;
pub use package::tool_pack::ToolPackId;
pub use package::tool_pack::ToolPackKind;
pub use package::tool_pack::ToolPackSnapshot;
pub use package::tool_pack::ToolPackToolSnapshot;
pub use package::tool_pack::WorkspaceBoundsSnapshot;
pub use package::tool_pack::active_tool_pack_readiness;
pub use package::AgentSnapshot;
pub use package::CapabilityCatalogSnapshot;
pub use package::ChildLifecyclePolicySnapshot;
pub use package::ChildPackageStripManifest;
pub use package::ChildRuntimePackage;
pub use package::ChildRuntimePackagePolicy;
pub use package::ContextHandoffPolicy;
pub use package::DepthBudget;
pub use package::FingerprintExclusionGroup;
pub use package::FingerprintInputGroup;
pub use package::FingerprintInputManifest;
pub use package::OutputContractSnapshot;
pub use package::OutputSinkSnapshot;
pub use package::PackageDelta;
pub use package::PackageSidecarSnapshot;
pub use package::PolicySnapshot;
pub use package::ProviderCapabilitySnapshot;
pub use package::ProviderRouteSnapshot;
pub use package::ReadinessProfile;
pub use package::RouteInheritanceMode;
pub use package::RuntimePackage;
pub use package::RuntimePackageBuilder;
pub use package::RuntimePackageCanonicalV1;
pub use package::RuntimePackageConformanceReport;
pub use package::RuntimePackageFingerprint;
pub use package::SubagentRoutePolicy;
pub use package::SubagentToolPolicy;
pub use package::VolatileRuntimeFields;
pub use package::build_child_runtime_package;
pub use package_extension::CoreExtensionCapabilities;
pub use package_extension::CoreExtensionCapabilitiesBuilder;
pub use package_extension::EXTENSION_ACTION_SIDECAR_KIND;
pub use package_extension::EXTENSION_ACTION_SIDECAR_VERSION;
pub use package_extension::ExtensionActionCapability;
pub use package_extension::ExtensionActionId;
pub use package_extension::ExtensionActionIdempotency;
pub use package_extension::ExtensionActionKind;
pub use package_extension::ExtensionActionRef;
pub use package_extension::ExtensionActionRequestId;
pub use package_extension::ExtensionBridgeRef;
pub use package_extension::ExtensionHookCapability;
pub use package_extension::ExtensionId;
pub use package_extension::ExtensionManifestAudit;
pub use package_extension::ExtensionPackageCapability;
pub use package_extension::ExtensionPackageResolution;
pub use package_extension::ExtensionProviderCapability;
pub use package_extension::ExtensionSubagentCapability;
pub use package_extension::ExtensionToolCapability;
pub use package_extension::ExtensionVersion;
pub use package_extension::ResolvedExtensionActionSidecar;
pub use package_extension::ResolvedExtensionPackage;
pub use package_extension::audit_core_extension_capabilities;
pub use package_hooks::ApprovalRequestPatch;
pub use package_hooks::CleanupRepairRequest;
pub use package_hooks::CompactionRequest;
pub use package_hooks::ContextInjectionRequest;
pub use package_hooks::DenyReason;
pub use package_hooks::DetachValidationRequest;
pub use package_hooks::HookCancellationToken;
pub use package_hooks::HookConfig;
pub use package_hooks::HookExecutionMode;
pub use package_hooks::HookExecutorRef;
pub use package_hooks::HookFailurePolicy;
pub use package_hooks::HookId;
pub use package_hooks::HookInput;
pub use package_hooks::HookMutationRight;
pub use package_hooks::HookMutationRights;
pub use package_hooks::HookOrdering;
pub use package_hooks::HookOrderingPhase;
pub use package_hooks::HookOverflowPolicy;
pub use package_hooks::HookPoint;
pub use package_hooks::HookPrivacyPolicy;
pub use package_hooks::HookQueueConfig;
pub use package_hooks::HookResponse;
pub use package_hooks::HookResponseClass;
pub use package_hooks::HookSource;
pub use package_hooks::HookSpec;
pub use package_hooks::HookTimeoutPolicy;
pub use package_hooks::HookView;
pub use package_hooks::ProjectionAuditRepairRequest;
pub use package_hooks::ProjectionPatch;
pub use package_hooks::RepairNeededReason;
pub use package_hooks::RetryRequest;
pub use package_hooks::StopReason;
pub use package_hooks::SubagentRequestPatch;
pub use package_hooks::ToolRequestPatch;
pub use package_hooks::ToolResultPatch;
pub use package_hooks::UsageRollupRepairRequest;
pub use package_hooks::ValidationHintPatch;
pub use package_hooks::hook_policy_ref;
pub use package_hooks::lower_code_hook;
pub use package_hooks::ordered_hooks_for_point;
pub use package_hooks::validate_hook_specs;
pub use package_isolation::AmbientSecretPolicy;
pub use package_isolation::AuditabilityRequirement;
pub use package_isolation::ChildArtifactId;
pub use package_isolation::ChildShutdownBehavior;
pub use package_isolation::CleanupGuaranteeRequirement;
pub use package_isolation::CleanupMode;
pub use package_isolation::CleanupPlanRef;
pub use package_isolation::ContentRefMode;
pub use package_isolation::DataResidencyRequirement;
pub use package_isolation::DetachPolicy;
pub use package_isolation::EnvironmentLifecyclePolicy;
pub use package_isolation::EnvironmentSpec;
pub use package_isolation::ExecutionEnvironment;
pub use package_isolation::ExecutionEnvironmentBuilder;
pub use package_isolation::ExecutionEnvironmentId;
pub use package_isolation::ExecutionEnvironmentKind;
pub use package_isolation::FilesystemIsolationPolicy;
pub use package_isolation::ImageRef;
pub use package_isolation::ImageRequest;
pub use package_isolation::IsolatedProcessId;
pub use package_isolation::IsolatedProcessRef;
pub use package_isolation::IsolatedProcessSpec;
pub use package_isolation::IsolatedProcessSpecBuilder;
pub use package_isolation::IsolationAdapterRequirement;
pub use package_isolation::IsolationAdapterSessionRef;
pub use package_isolation::IsolationCapability;
pub use package_isolation::IsolationCapabilityReportRef;
pub use package_isolation::IsolationCapabilitySet;
pub use package_isolation::IsolationClass;
pub use package_isolation::IsolationFallback;
pub use package_isolation::IsolationFingerprintFields;
pub use package_isolation::IsolationRequirement;
pub use package_isolation::IsolationRequirementRef;
pub use package_isolation::IsolationRequirementSnapshot;
pub use package_isolation::IsolationRuntimeRef;
pub use package_isolation::IsolationSessionId;
pub use package_isolation::IsolationSessionRef;
pub use package_isolation::IsolationTrustField;
pub use package_isolation::IsolationTrustRequirement;
pub use package_isolation::LocalityRequirement;
pub use package_isolation::MountExpansionAudit;
pub use package_isolation::MountMode;
pub use package_isolation::MountPolicy;
pub use package_isolation::MountRef;
pub use package_isolation::NetworkIsolationPolicy;
pub use package_isolation::NetworkNamespaceRef;
pub use package_isolation::PolicyDecisionRef;
pub use package_isolation::ProcessContentCaptureMode;
pub use package_isolation::ProcessIoCapturePolicy;
pub use package_isolation::ProcessIoPolicy;
pub use package_isolation::ProcessIoStreamRef;
pub use package_isolation::ProcessOwnershipClass;
pub use package_isolation::ProcessOwnershipPolicy;
pub use package_isolation::ProcessStatsPolicy;
pub use package_isolation::ProcessStatsSnapshotRef;
pub use package_isolation::ReclaimPolicy;
pub use package_isolation::ReclaimTicketRef;
pub use package_isolation::RedactedEnvVar;
pub use package_isolation::ResourceLimits;
pub use package_isolation::RootFilesystemMode;
pub use package_isolation::RootfsRef;
pub use package_isolation::RootfsRequest;
pub use package_isolation::RunChildLifecyclePolicyRef;
pub use package_isolation::RuntimePackageSidecarId;
pub use package_isolation::SecretEnvPolicy;
pub use package_isolation::SecretExposurePolicy;
pub use package_isolation::SecretIsolationRequirement;
pub use package_isolation::SecretMountPolicy;
pub use package_isolation::SecretMountRef;
pub use package_isolation::SecretRef;
pub use package_isolation::SingleFileMountExpansionPolicy;
pub use package_isolation::StdinPolicy;
pub use package_isolation::SymlinkPolicy;
pub use package_isolation::TenantBoundaryRequirement;
pub use package_isolation::TerminalMode;
pub use package_isolation::TruncationPolicy;
pub use package_isolation::WorkspaceMountMode;
pub use package_isolation::WorkspaceMountPolicy;
pub use policy::ApprovalDecisionKind;
pub use policy::ApprovalPolicy;
pub use policy::ApprovalRequestSpec;
pub use policy::CapabilityPermission;
pub use policy::ContentCaptureMode;
pub use policy::ContentCapturePolicy;
pub use policy::DecisionReason;
pub use policy::DispatcherScope;
pub use policy::EffectClass;
pub use policy::EscalationPolicy;
pub use policy::MissingDependency;
pub use policy::PermissionPolicy;
pub use policy::PolicyDecision;
pub use policy::PolicyOutcome;
pub use policy::PolicyStage;
pub use policy::PrivacyPolicy;
pub use policy::ResumePolicy;
pub use policy::RiskClass;
pub use policy::SandboxMode;
pub use policy::SandboxPolicy;
pub use policy::ToolRequestModification;
pub use ports::realtime::RealtimeAdapterAck;
pub use ports::realtime::RealtimeAdapterCall;
pub use ports::realtime::RealtimeConnectRequest;
pub use ports::realtime::RealtimeConnectResponse;
pub use ports::realtime::RealtimeProviderAdapter;
pub use ports::InMemoryRuntimePackageResolver;
pub use ports::OutputSinkPort;
pub use ports::OutputSinkRegistry;
pub use ports::ProviderRegistry;
pub use ports::RuntimePackageResolver;
pub use ports::RuntimePolicyPort;
pub use ports_isolation::CleanupRequest;
pub use ports_isolation::CleanupResult;
pub use ports_isolation::CleanupStatus;
pub use ports_isolation::DetachTransferRequest;
pub use ports_isolation::DetachTransferResult;
pub use ports_isolation::EnvironmentPrepareRequest;
pub use ports_isolation::ImageResolution;
pub use ports_isolation::ImageResolveRequest;
pub use ports_isolation::IsolationCapabilityReport;
pub use ports_isolation::IsolationRuntime;
pub use ports_isolation::IsolationRuntimeHealth;
pub use ports_isolation::IsolationRuntimeKind;
pub use ports_isolation::IsolationRuntimeRegistry;
pub use ports_isolation::MountPlan;
pub use ports_isolation::MountResolveRequest;
pub use ports_isolation::NetworkPrepareRequest;
pub use ports_isolation::PlatformReport;
pub use ports_isolation::ProcessIoFrame;
pub use ports_isolation::ProcessIoRequest;
pub use ports_isolation::ProcessIoStream;
pub use ports_isolation::ProcessSignal;
pub use ports_isolation::ProcessSignalRequest;
pub use ports_isolation::ProcessSignalResult;
pub use ports_isolation::ProcessStartRequest;
pub use ports_isolation::ProcessStartResult;
pub use ports_isolation::ProcessStatsRequest;
pub use ports_isolation::ProcessStatsSnapshot;
pub use ports_isolation::ReclaimRequest;
pub use ports_isolation::ReclaimResult;
pub use ports_isolation::RootfsPrepareRequest;
pub use ports_isolation::SecretMaterializationPlan;
pub use ports_isolation::SecretPrepareRequest;
pub use ports_isolation::SessionPrepareRequest;
pub use ports_isolation::isolation_host_configuration_needed;
pub use projection::project_context_projection;
pub use provider::ProviderAdapter;
pub use provider::ProviderCapabilities;
pub use provider::ProviderConformanceCase;
pub use provider::ProviderMessage;
pub use provider::ProviderMessageRole;
pub use provider::ProviderModality;
pub use provider::ProviderProjectedMetadata;
pub use provider::ProviderProjectionPolicy;
pub use provider::ProviderRequest;
pub use provider::ProviderResponse;
pub use provider::ProviderStopReason;
pub use provider::ProviderStreamChunk;
pub use provider::ProviderStreamDelta;
pub use provider::ProviderStructuredOutputHint;
pub use provider::ProviderUsage;
pub use realtime::RealtimeCompletionGate;
pub use realtime::RealtimeSessionController;
pub use realtime_records::RealtimeBackpressureAction;
pub use realtime_records::RealtimeBackpressureState;
pub use realtime_records::RealtimeCloseReason;
pub use realtime_records::RealtimeConnectionId;
pub use realtime_records::RealtimeFrameId;
pub use realtime_records::RealtimeInputFrame;
pub use realtime_records::RealtimeMediaKind;
pub use realtime_records::RealtimeOutputFrame;
pub use realtime_records::RealtimeResponseId;
pub use realtime_records::RealtimeSessionId;
pub use realtime_records::RealtimeSessionRecord;
pub use realtime_records::RealtimeSessionRecordKind;
pub use realtime_records::RealtimeSessionState;
pub use realtime_records::RealtimeSessionStatus;
pub use records_isolation::ISOLATION_RECORD_SCHEMA_VERSION;
pub use records_isolation::IsolationCapabilityMatchRecord;
pub use records_isolation::IsolationCapabilityReportedRecord;
pub use records_isolation::IsolationCleanupIntentRecord;
pub use records_isolation::IsolationCleanupResultRecord;
pub use records_isolation::IsolationDowngradeDecisionRecord;
pub use records_isolation::IsolationEnvironmentPrepareIntentRecord;
pub use records_isolation::IsolationEnvironmentPrepareResultRecord;
pub use records_isolation::IsolationEventBase;
pub use records_isolation::IsolationEventKind;
pub use records_isolation::IsolationEventRecord;
pub use records_isolation::IsolationFailureRecord;
pub use records_isolation::IsolationNetworkPreparedRecord;
pub use records_isolation::IsolationProcessStartIntentRecord;
pub use records_isolation::IsolationProcessStartResultRecord;
pub use records_isolation::IsolationProcessStatsRecord;
pub use records_isolation::IsolationRecord;
pub use records_isolation::IsolationRequestedRecord;
pub use recovery::RecoveryAction;
pub use recovery::RecoveryClassification;
pub use recovery::RecoveryDecision;
pub use recovery::RecoveryFailureKind;
pub use recovery::classify_recovery;
pub use repair::LocalValidationRepairService;
pub use repair::RepairAccounting;
pub use repair::RepairDecision;
pub use repair::RepairPolicyController;
pub use repair::ValidationRepairOutcome;
pub use replay::CursorCompatibility;
pub use replay::DurableReplaySupport;
pub use replay::ReplayMode;
pub use replay::ReplayPendingSideEffect;
pub use replay::ReplayReducer;
pub use replay::ReplayRepairKind;
pub use replay::ReplayRepairNeeded;
pub use replay::ReplayResult;
pub use replay::ReplayStatus;
pub use replay::check_cursor_compatibility;
pub use replay::durable_replay_support;
pub use run::RunRequest;
pub use run::RunResult;
pub use run::RunStatus;
pub use run::StructuredOutputArtifacts;
pub use run_handle::InMemoryRunControlStore;
pub use run_handle::RunControlStore;
pub use run_handle::RunHandle;
pub use runtime::AgentRuntime;
pub use runtime::AgentRuntimeBuilder;
pub use runtime::CancellationHandle;
pub use runtime::EffectiveRuntimePackage;
pub use runtime::RunRegistryStatus;
pub use runtime::RunSnapshot;
pub use stream::StreamRuleEngine;
pub use stream::StreamRuleEngineState;
pub use stream_records::MarkerId;
pub use stream_records::MarkerVersion;
pub use stream_records::MatchPrivacyPolicy;
pub use stream_records::MatcherEngineRef;
pub use stream_records::PartialOutputPolicy;
pub use stream_records::RedactedMatch;
pub use stream_records::RegexDialect;
pub use stream_records::RepeatPolicy;
pub use stream_records::RuleVersion;
pub use stream_records::StreamAction;
pub use stream_records::StreamChannel;
pub use stream_records::StreamChannelSelector;
pub use stream_records::StreamCursor;
pub use stream_records::StreamCursorPrecision;
pub use stream_records::StreamDelta;
pub use stream_records::StreamDeltaId;
pub use stream_records::StreamDirection;
pub use stream_records::StreamIntervention;
pub use stream_records::StreamInterventionId;
pub use stream_records::StreamMatchId;
pub use stream_records::StreamMatchRef;
pub use stream_records::StreamMatcher;
pub use stream_records::StreamRule;
pub use stream_records::StreamRuleBuilder;
pub use stream_records::StreamRuleId;
pub use stream_records::StreamRuleRecord;
pub use stream_records::StreamRuleRecordKind;
pub use stream_records::StreamRuleRepeatStateSnapshot;
pub use stream_records::StreamRuleScope;
pub use stream_records::stream_policy_ref;
pub use structured_output::RepairExhaustionRecord;
pub use structured_output::RepairPrompt;
pub use structured_output::RepairPromptCandidateContent;
pub use structured_output::RepairRecord;
pub use structured_output::RepairRecordKind;
pub use structured_output::StructuredOutputLifecycleKind;
pub use structured_output::StructuredOutputLifecycleRecord;
pub use structured_output::ValidationErrorCode;
pub use structured_output::ValidationErrorSummary;
pub use structured_output::ValidationRecord;
pub use structured_output::ValidationRecordKind;
pub use subagent::ChildRunHandle;
pub use subagent::SubagentRequest;
pub use subagent::SubagentRequestId;
pub use subagent::SubagentSupervisor;
pub use subagent::subagent_runtime_event_frame;
pub use subagent_records::ChildArtifactKind;
pub use subagent_records::ChildLifecycleAction;
pub use subagent_records::ChildLifecycleRecord;
pub use subagent_records::ChildLifecycleStatus;
pub use subagent_records::RunJournalRef;
pub use subagent_records::SubagentCompletedRecord;
pub use subagent_records::SubagentHandoffRecord;
pub use subagent_records::SubagentRecord;
pub use subagent_records::SubagentStartedRecord;
pub use subagent_records::SubagentTerminalStatus;
pub use subagent_records::SubagentUsageRolledUpRecord;
pub use subagent_records::SubagentWrappedEventRecord;
pub use subscription::InMemorySubscriptionHub;
pub use subscription::RunSubscriptionSource;
pub use telemetry::TelemetryAuthorityBoundary;
pub use telemetry::TelemetryContentCaptureDecision;
pub use telemetry::TelemetryContentCaptureRequest;
pub use telemetry::TelemetryDrainReport;
pub use telemetry::TelemetryFanout;
pub use telemetry::TelemetryFanoutConfig;
pub use telemetry::TelemetryFanoutReport;
pub use telemetry::TelemetryOverflowPolicy;
pub use telemetry::TelemetrySinkIsolationPolicy;
pub use telemetry::TelemetryUsageExtractionInput;
pub use telemetry::TelemetryUsageExtractor;
pub use telemetry::evaluate_content_capture;
pub use telemetry::sink_health_projection;
pub use telemetry::terminal_run_projection_from_event;
pub use telemetry_ports::TelemetrySink;
pub use telemetry_ports::TelemetrySinkAck;
pub use telemetry_ports::TelemetrySinkError;
pub use telemetry_ports::TelemetrySinkSpec;
pub use telemetry_records::CostEstimateStatus;
pub use telemetry_records::CostTelemetryRecord;
pub use telemetry_records::CostUnits;
pub use telemetry_records::RateTableVersion;
pub use telemetry_records::TelemetryContentCaptureMode;
pub use telemetry_records::TelemetryCostRecordId;
pub use telemetry_records::TelemetryExportAttemptId;
pub use telemetry_records::TelemetryExportCursor;
pub use telemetry_records::TelemetryExportCursorRecord;
pub use telemetry_records::TelemetryProjection;
pub use telemetry_records::TelemetryProjectionId;
pub use telemetry_records::TelemetryProjectionKind;
pub use telemetry_records::TelemetryRecord;
pub use telemetry_records::TelemetryRecordId;
pub use telemetry_records::TelemetryRecordPayload;
pub use telemetry_records::TelemetrySinkFailureKind;
pub use telemetry_records::TelemetrySinkFailureRecord;
pub use telemetry_records::TelemetrySinkHealth;
pub use telemetry_records::TelemetrySinkHealthState;
pub use telemetry_records::TelemetrySinkId;
pub use telemetry_records::TelemetrySinkKind;
pub use telemetry_records::TelemetrySinkRecoveryRecord;
pub use telemetry_records::TelemetrySourceCursor;
pub use telemetry_records::TelemetrySourceRecord;
pub use telemetry_records::TelemetryTerminalStatus;
pub use telemetry_records::TelemetryUsageRecordId;
pub use telemetry_records::UsageTelemetryRecord;
pub use telemetry_records::UsageUnits;
pub use tool_execution::ToolExecutionContext;
pub use tool_execution::ToolExecutionCoordinator;
pub use tool_execution::ToolExecutionOutcome;
pub use tool_pack_ports::ResourceReadRequest;
pub use tool_pack_ports::ResourceResolution;
pub use tool_pack_ports::ResourceResolver;
pub use tool_pack_ports::ResourceRouter;
pub use tool_pack_ports::ResourceScheme;
pub use tool_pack_records::ShellProcessLineage;
pub use tool_pack_records::ToolDiscoveryLineage;
pub use tool_pack_records::ToolPackEffectLineage;
pub use tool_pack_records::WorkspaceMutationLineage;
pub use tool_pack_records::WorkspaceReadLineage;
pub use tool_ports::AllowToolPolicy;
pub use tool_ports::ResolvedToolCall;
pub use tool_ports::ToolCallRequest;
pub use tool_ports::ToolExecutionOutput;
pub use tool_ports::ToolExecutionRequest;
pub use tool_ports::ToolExecutionStrategy;
pub use tool_ports::ToolExecutor;
pub use tool_ports::ToolExecutorRegistry;
pub use tool_ports::ToolPolicyPort;
pub use tool_ports::ToolRegistrySnapshot;
pub use tool_ports::ToolRoute;
pub use tool_ports::ToolRouter;
pub use tool_ports::allowed_tool_policy_outcome;
pub use tool_records::CanonicalToolName;
pub use tool_records::ToolCallRecord;
pub use tool_records::ToolCallRecordParams;
pub use tool_records::ToolCallRecordStatus;
pub use tool_records::ToolResultRef;
pub use tool_records::tool_call_journal_record;
pub use typed_output_ports::TypedOutputDeserializer;
pub use typed_output_ports::TypedOutputModel;
pub use validated_output::DecodedTypedOutput;
pub use validated_output::OutputLineage;
pub use validated_output::StructuredOutputResult;
pub use validated_output::TypedOutputError;
pub use validated_output::TypedResultPublicationRecord;
pub use validated_output::TypedResultPublicationStatus;
pub use validated_output::ValidatedOutput;
pub use validated_output::ValidatedOutputParams;
pub use validated_output::ValidatedOutputPublicationStep;
pub use validated_output::ValidationReportRecord;
pub use validated_output::ValidationReportRef;
pub use validated_output::ValidationStatus;
pub use validated_output::validate_typed_result_publication_order;
pub use validation::HostileSchemaLimits;
pub use validation::JsonSchemaSubsetValidator;
pub use validation::OutputCandidate;
pub use validation::StructuredOutputValidator;
pub use validation::TerminalValidationFailure;
pub use validation::ValidationErrorReport;
pub use validation::ValidationSuccess;

Modules§

agent
Agent construction and common run-request helpers. Use this module to define immutable agent identity and lower simple text or typed-output calls into canonical run requests. Side effects are limited to methods that explicitly call a runtime; builders and request helpers are data-only.
agent_pool
Public agent pool namespace. Use it for the documented agent pool API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Feature-layer agent-pool coordination over runs, messages, wake conditions, and subscriptions. Use this module for generic run-to-run coordination without introducing workflow-engine or product swarm behavior. Side-effecting operations may update pool membership, append source-run journal records, and publish agent-pool events through the configured runtime ports.
anti_entropy
Public anti entropy namespace. Use it for the documented anti entropy API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the anti entropy portion of that contract.
application_isolation
Public application isolation namespace. Use it for the documented application isolation API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Isolation lifecycle coordination over host-provided runtimes. Use this module when a workload requires environment preparation, process execution, signaling, stats, or cleanup. All concrete container or VM behavior remains adapter-owned.
approval
Public approval namespace. Use it for the documented approval API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Approval broker coordination. Use this module to turn policy decisions into host-dispatched approval requests. Broker methods may call a dispatcher and record cancellation or denial outcomes, but UI transport remains host-owned.
approval_ports
Public approval ports namespace. Use it for the documented approval ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the approval portion of that contract.
approval_records
Public approval records namespace. Use it for the documented approval records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the approval portion of that contract.
capability
Public capability namespace. Use it for the documented capability API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Capability identity, projection, executable routes, and readiness records. Use this module when a runtime package exposes callable or discoverable behavior. Projection helpers are pure and must not execute tools.
checkpoint
Public checkpoint namespace. Use it for the documented checkpoint API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the checkpoint portion of that contract.
content
Public content namespace. Use it for the documented content API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the content portion of that contract.
content_ports
Public content ports namespace. Use it for the documented content ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the content portion of that contract.
context
Public context namespace. Use it for the documented context API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the context portion of that contract.
domain
Public domain namespace. Use it for the documented domain API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Domain primitives for stable SDK vocabulary. Use these items for IDs, refs, policy, privacy, trust, and errors that cross crate or host boundaries. They are data-only and must not perform provider, filesystem, network, or UI side effects.
effect
Public effect namespace. Use it for the documented effect API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Shared effect-intent and effect-result records. Use these records before and after externally visible work such as tools, output delivery, extension actions, or child starts. The records themselves do not execute the effect.
error
Public error namespace. Use it for the documented error API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Domain primitives for stable SDK vocabulary. Use these items for IDs, refs, policy, privacy, trust, and errors that cross crate or host boundaries. They are data-only and must not perform provider, filesystem, network, or UI side effects. This file contains the error portion of that contract.
event
Public event namespace. Use it for the documented event API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Canonical event records for live observation and telemetry projection. Use these records to describe what happened without requiring raw content capture. Constructors are data-only; delivery belongs to event buses and sinks.
event_bus
Public event bus namespace. Use it for the documented event bus API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Event bus port and in-memory event bus helpers. Use this module for live observation separate from durable journal truth. Publishing mutates the bus state and may notify subscribers.
events
Public events namespace. Use it for the documented events API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the events portion of that contract.
extension
Public extension namespace. Use it for the documented extension API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Extension action coordination and protocol recovery. Use this module when extension-declared capabilities resolve into policy-checked SDK actions. Execution may call extension ports and approval brokers, but extension hosts remain outside core.
extension_ports
Public extension ports namespace. Use it for the documented extension ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the extension portion of that contract.
extension_records
Public extension records namespace. Use it for the documented extension records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the extension portion of that contract.
hook_ports
Public hook ports namespace. Use it for the documented hook ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the hooks portion of that contract.
hook_records
Public hook records namespace. Use it for the documented hook records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the hooks portion of that contract.
hooks
Public hooks namespace. Use it for the documented hooks API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the hooks portion of that contract.
ids
Public ids namespace. Use it for the documented ids API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Domain primitives for stable SDK vocabulary. Use these items for IDs, refs, policy, privacy, trust, and errors that cross crate or host boundaries. They are data-only and must not perform provider, filesystem, network, or UI side effects. This file contains the ids portion of that contract.
journal
Public journal namespace. Use it for the documented journal API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable run-journal records. Use these records as replayable truth for messages, effects, checkpoints, output, and recovery. Record constructors are data-only; append side effects happen through journal ports.
journal_ports
Public journal ports namespace. Use it for the documented journal ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Journal append port helpers. Use this module to persist intent-before-effect and terminal result records around fallible work. Implementations mutate durable storage and should be idempotent where replay requires it.
kernel
Public kernel namespace. Use it for the documented kernel API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the kernel portion of that contract.
loop_driver
Public loop driver namespace. Use it for the documented loop driver API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Loop driver for the first text-run proof. Use it to connect the runtime package, context projection, provider port, event bus, and journal in one canonical P0 execution path. Driving the loop may call provider adapters, append journals, and publish events.
loop_state
Public loop state namespace. Use it for the documented loop state API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the loop state portion of that contract.
output
Public output namespace. Use it for the documented output API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the output portion of that contract.
output_delivery
Public output delivery namespace. Use it for the documented output delivery API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the output delivery portion of that contract.
output_delivery_port
Public output delivery port namespace. Use it for the documented output delivery port API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Output sink port boundary. Hosts implement this module to deliver output to CLI, desktop, webhook, file, or remote channels. Sink calls may perform external I/O and must honor declared content modes.
output_delivery_service
Public output delivery service namespace. Use it for the documented output delivery service API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Output delivery coordination over destination refs and sinks. Use this module to send final or streaming output through host-provided sinks with dedupe and journal evidence. Dispatch may call sinks and append delivery intent/result records.
package
Public package namespace. Use it for the documented package API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Runtime package authority for one run. Use this module to freeze provider routes, capabilities, sidecars, catalogs, policies, output sinks, and fingerprints before execution. Package builders are data-only; applying deltas returns a new snapshot rather than mutating ambient state.
package_extension
Public package extension namespace. Use it for the documented package extension API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Runtime-package records and builders. Use these items to describe the immutable per-run package that freezes provider route, capabilities, policies, sidecars, catalogs, and fingerprints. Builders are data-only and must not perform discovery or execution side effects. This file contains the extension portion of that contract.
package_hooks
Public package hooks namespace. Use it for the documented package hooks API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Runtime-package records and builders. Use these items to describe the immutable per-run package that freezes provider route, capabilities, policies, sidecars, catalogs, and fingerprints. Builders are data-only and must not perform discovery or execution side effects. This file contains the hooks portion of that contract.
package_isolation
Public package isolation namespace. Use it for the documented package isolation API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Runtime-package records and builders. Use these items to describe the immutable per-run package that freezes provider route, capabilities, policies, sidecars, catalogs, and fingerprints. Builders are data-only and must not perform discovery or execution side effects. This file contains the isolation portion of that contract.
policy
Public policy namespace. Use it for the documented policy API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Domain primitives for stable SDK vocabulary. Use these items for IDs, refs, policy, privacy, trust, and errors that cross crate or host boundaries. They are data-only and must not perform provider, filesystem, network, or UI side effects. This file contains the policy portion of that contract.
ports
Public ports namespace. Use it for the documented ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts.
ports_isolation
Public ports isolation namespace. Use it for the documented ports isolation API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the isolation portion of that contract.
prelude
Common imports for applications built on agent-sdk-core.
privacy
Public privacy namespace. Use it for the documented privacy API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Domain primitives for stable SDK vocabulary. Use these items for IDs, refs, policy, privacy, trust, and errors that cross crate or host boundaries. They are data-only and must not perform provider, filesystem, network, or UI side effects. This file contains the privacy portion of that contract.
projection
Public projection namespace. Use it for the documented projection API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the projection portion of that contract.
provider
Public provider namespace. Use it for the documented provider API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Provider adapter contract and provider-facing projection DTOs. Hosts implement this port to call model providers after core has projected context and policy-safe metadata. Implementations may perform network I/O and must preserve redaction and stop/usage semantics.
providers
Public providers namespace. Use it for the documented providers API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the providers portion of that contract.
realtime
Public realtime namespace. Use it for the documented realtime API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the realtime portion of that contract.
realtime_records
Public realtime records namespace. Use it for the documented realtime records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the realtime portion of that contract.
records_isolation
Public records isolation namespace. Use it for the documented records isolation API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the isolation portion of that contract.
recovery
Public recovery namespace. Use it for the documented recovery API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the recovery portion of that contract.
refs
Public refs namespace. Use it for the documented refs API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Domain primitives for stable SDK vocabulary. Use these items for IDs, refs, policy, privacy, trust, and errors that cross crate or host boundaries. They are data-only and must not perform provider, filesystem, network, or UI side effects. This file contains the refs portion of that contract.
repair
Public repair namespace. Use it for the documented repair API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the repair portion of that contract.
replay
Public replay namespace. Use it for the documented replay API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the replay portion of that contract.
run
Public run namespace. Use it for the documented run API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Run request and result records used by both simple helpers and explicit advanced callers. Use these DTOs at host boundaries when constructing input and reading terminal output. Constructors are data-only and do not contact providers.
run_handle
Public run handle namespace. Use it for the documented run handle API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Reconnectable run-handle helpers. Use this module when a host needs to wait for output, stream events from a cursor, replay journal frames, or request cancellation. Handle operations read or mutate the configured run-control store and may publish cancellation intent.
runtime
Public runtime namespace. Use it for the documented runtime API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Runtime coordination for starting, observing, and completing runs. Use this module when a host wires providers, package resolution, policy, journals, and event streams into the core loop. Runtime methods may call configured adapters, mutate run state, append journals, and publish events.
stream
Public stream namespace. Use it for the documented stream API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the stream portion of that contract.
stream_records
Public stream records namespace. Use it for the documented stream records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the stream portion of that contract.
structured_output
Public structured output namespace. Use it for the documented structured output API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the structured output portion of that contract.
subagent
Public subagent namespace. Use it for the documented subagent API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Subagent supervision helpers layered over agent pools and child run requests. Use this module when a parent run starts bounded child work and needs event wrapping or usage rollup. Child lifecycle is parent-owned; product-specific agent societies stay outside core.
subagent_records
Public subagent records namespace. Use it for the documented subagent records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the subagent portion of that contract.
subscription
Public subscription namespace. Use it for the documented subscription API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the subscription portion of that contract.
telemetry
Public telemetry namespace. Use it for the documented telemetry API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Application-layer coordination over core primitives. Use these services to lower helpers, drive runs, validate output, coordinate tools, approvals, delivery, isolation, telemetry, and feature layers. Methods in this layer may call configured ports, mutate in-memory stores, append journals, or publish events as documented. This file contains the telemetry portion of that contract.
telemetry_ports
Public telemetry ports namespace. Use it for the documented telemetry ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the telemetry portion of that contract.
telemetry_records
Public telemetry records namespace. Use it for the documented telemetry records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the telemetry portion of that contract.
testing
Public testing namespace. Use it for the documented testing API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Downstream-facing test kit for SDK consumers.
tool_execution
Public tool execution namespace. Use it for the documented tool execution API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Tool execution coordination over the shared effect spine. Use this module after tool routing and policy have selected an executor. Execution may call tool adapters and must keep intent/result records observable through journals and events.
tool_pack_ports
Public tool pack ports namespace. Use it for the documented tool pack ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the tool pack portion of that contract.
tool_pack_records
Public tool pack records namespace. Use it for the documented tool pack records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the tool pack portion of that contract.
tool_ports
Public tool ports namespace. Use it for the documented tool ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Tool routing, execution, and policy ports. Use this module when runtime-package capabilities become executable tool calls. Executor implementations may perform side effects and must return effect-compatible output records.
tool_records
Public tool records namespace. Use it for the documented tool records API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the tool portion of that contract.
typed_output_ports
Public typed output ports namespace. Use it for the documented typed output ports API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Host adapter boundaries for the SDK core. Use these traits and registries when hosts provide providers, journals, sinks, tools, isolation, extensions, telemetry, or subscriptions. Implementations may perform external side effects and must honor policy, redaction, idempotency, and replay contracts. This file contains the typed output portion of that contract.
validated_output
Public validated output namespace. Use it for the documented validated output API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Durable and observable SDK records. Use these DTOs for events, journals, effects, context, output, and feature evidence. Constructing records is data-only; persistence, publication, and external actions happen through ports or application coordinators. This file contains the validated output portion of that contract.
validation
Public validation namespace. Use it for the documented validation API surface; prefer crate-root re-exports for common imports. Module items must preserve the core ownership and side-effect boundaries described in this file. Structured-output validation orchestration. Use this module after provider output is available and before typed results are published. Validation is local and deterministic unless a caller-provided validator performs additional work.