Skip to main content

Crate awaken_contract

Crate awaken_contract 

Source
Expand description

Compatibility facade for Awaken contract crates.

New runtime-facing code should depend on awaken-runtime-contract. New server/store-facing code should depend on awaken-server-contract. This crate preserves the historical awaken-contract import path by re-exporting both surfaces.

Re-exports§

pub use awaken_server_contract as server_contract;

Modules§

agent_spec_patch
Field-level override for AgentSpec.
builtin_seed
Carrier types for binary-supplied built-in specs (“seed”).
cancellation
Cooperative cancellation token for agent runs.
config_loader
Generic configuration loading utilities for YAML/JSON config files.
config_record
Metadata envelope wrapping any spec stored in ConfigStore.
config_validation
contract
identity
Content-addressed identity helpers for prompts, tool descriptions, and skills. See ADR-0030 D1.
model
periodic_refresh
Reusable periodic-refresh primitive for registry managers.
registry_spec
Serializable agent definition — pure data, no trait objects.
secret
Secret value newtype that redacts itself in Debug/Display while still round-tripping through serde.
skill_allowed_tools
skill_spec
Skill registry record managed through ConfigStore.
skill_spec_patch
Field-level override for SkillSpec.
state
thread
Thread types for persistent conversation state.
time
tool_spec
Tool registry record. The description field is the only field exposed to the patch surface (ADR-0029); other fields are read-only snapshots taken from ToolDescriptor at seed time.
tool_spec_patch
Field-level override for ToolSpec (ADR-0029).

Structs§

A2aServerSpec
Named A2A server connection profile used by admin/control-plane surfaces.
AgentEventNormalizationContext
Scope and metadata used when normalizing runtime events that do not carry thread or run identifiers themselves.
AgentSpec
Serializable agent definition referencing registries by ID.
AgentSpecPatch
Patch for built-in agent customization.
AllowedTool
Parsed allowed-tools token.
AppendOptions
Options supplied when appending a canonical event.
AppendResult
Result returned by an append call.
AuditEvent
A self-contained audit record for a single admin action.
BuiltinSeedSet
A complete seed payload: the binary’s version tag plus all specs it wants present.
CancellationHandle
Write-only handle that can signal cancellation.
CancellationToken
A cooperative cancellation token.
CanonicalEvent
EventStore append output.
CanonicalEventDraft
EventStore append input. Store-assigned fields are intentionally absent.
CanonicalEventId
Stable canonical event identifier assigned by an [EventWriter].
CanonicalEventKind
Protocol-neutral canonical event kind.
ConfigChangeEvent
A config change notification emitted by a store implementation.
ConfigRecord
Wrapper carrying a spec plus provenance + lifecycle metadata.
ConfigRevisionRef
Editing-store revision included in a publication audit boundary.
DiagnosticEvent
Non-replay diagnostic event.
DispatchSignalEntry
One durable dispatch delivery signal pulled from a backend work queue.
DurableEventSink
EventSink wrapper that forwards live events and stages canonical drafts.
EventCursor
Opaque cursor for a single EventScope.
EventPage
Paged canonical event list response.
EventScopeIds
Denormalized ids derived from event scopes.
FailedScheduledActions
LiveRunCommandEntry
Entry yielded by a LiveRunCommandStream: the command plus the receipt the consumer must ack once the run has received it.
LiveRunTarget
Exact live-run target for cross-node ephemeral control.
MailboxInterrupt
Result of a mailbox interrupt operation.
MailboxInterruptDetails
Detailed result of a mailbox interrupt operation.
MailboxLiveControlSource
Adapter exposing any MailboxStore as a runtime LiveRunCommandSource.
McpRestartPolicy
Restart policy for MCP server connections.
McpServerSpec
Serializable MCP server configuration used to construct a live MCP tool registry.
Modalities
Set of modalities a model accepts on input and produces on output.
ModelPoolSpec
A named pool of member models, addressable like a single model.
ModelSpec
Serializable model offering: addressing (id, provider, upstream model), intrinsic capabilities (context window, max output tokens, modalities, knowledge cutoff), and per-million-token pricing.
MutationBatch
A batch of state mutation operations.
NoConfigPatch
Empty patch for spec types that do not support field-level overrides.
NormalizedCanonicalEvent
A normalized canonical event draft with its durability class.
OutboxEnqueueResult
OutboxMessage
OutboxMessageDraft
PendingScheduledActions
PeriodicRefresher
A reusable handle for a single periodic background task.
PersistedState
PinnedRegistryEntry
One published runtime-config version pinned by a run.
PinnedRegistryManifest
Pinned published runtime-config graph attached to one run.
PoolMemberSpec
One member of a ModelPoolSpec, referencing a ModelSpec by id.
PoolRoutingPolicy
How a session picks its initial member and how long that choice is held.
PoolSwitchPolicy
When the pool abandons the active member for another one.
ProfileEntry
A single profile entry stored in the profile store.
ProtocolReplayAppendResult
Result returned by an append call.
ProtocolReplayCursor
Opaque cursor for a single protocol replay stream.
ProtocolReplayDraft
ProtocolReplayLog append input. Store-assigned fields are intentionally absent.
ProtocolReplayId
Stable protocol replay row identifier assigned by a ProtocolReplayWriter.
ProtocolReplayPage
Paged protocol replay response.
ProtocolReplayRecord
Persisted protocol replay row.
ProtocolStreamKey
Protocol stream selection.
ProviderSpec
Serializable provider configuration used to construct an LLM executor.
RecordMeta
Provenance + lifecycle metadata for a stored spec.
RedactedString
String wrapper whose Debug/Display implementations never reveal the underlying value, and whose buffer is zeroized on drop.
RegistryGraphValidationReport
RegistryGraphValidationRequest
RegistryPublication
Atomic published graph snapshot.
RegistryResourcePublish
One resource value to publish inside an atomic registry publication.
RegistryRetentionPolicy
ADR-0035 D19 retention policy. A historical version is eligible for physical purge only when every rule below allows it; the absence of a rule is permissive.
RunDispatch
A run dispatch persisted in the mailbox queue.
RunDispatchParts
Explicit persisted representation used by store codecs.
RunDispatchResult
Durable runtime-result projection for the dispatch that consumed a run.
ScopeContext
ScopeId
ScopedAgentEventNormalizer
Default normalizer for one runtime stream.
ScopedConfigStore
ScopedMailboxStore
ScopedOutboxStore
ScopedProtocolReplayLog
ScopedThreadRunStore
ServerCanonicalEvent
Server-authored canonical event attached to the same thread commit as the state transition that made the fact true.
SkillArgumentSpec
Formal argument metadata for a skill activation.
SkillSpec
ConfigStore representation of a skill.
SkillSpecPatch
Snapshot
SourceEventCursor
Canonical event cursor referenced by a protocol replay row.
StagedCanonicalEvent
Staged canonical event together with its append options.
StandardRegistryGraphValidator
StateCommand
A command that carries state mutations, scheduled actions, and effects.
StateKeyOptions
StateMap
StateScope
Identifies a shared state scope at runtime.
SubscribeHandle
Result returned when a live subscription is opened.
Thread
A persistent conversation thread (metadata only).
ThreadCommit
One atomic thread commit.
ThreadCommitOutcome
Runtime-facing outcome for a successful thread commit.
ThreadCommitStagedOutcome
Identifiers assigned by stores during a successful staged commit.
ThreadCommitStagedWrites
Event/outbox writes committed atomically with a checkpoint, supplied by server-side writers: the runtime tee’s canonical drafts (drained from the dispatch EventBuffer), server-authored canonical events, and inline outbox rows.
ThreadMetadata
Thread metadata.
ToolCallProgressState
Canonical progress state for a tool call execution.
ToolSpec
ToolSpecPatch
TransactionScopeId
Opaque equality marker identifying the set of stores that can share a single backend transaction.
TypedEffect
TypedVersionedRegistry
Typed view over a kind-scoped published runtime-config registry.
VersionRef
A concrete published version reference.
VersionedRecord
One immutable published runtime-config version.
VersionedResourceState
Mutable state for one published resource identity.

Enums§

AllowedToolParseError
AuditAction
Action that triggered an audit event.
BuiltinSpec
A single spec the binary wants to seed into ConfigStore.
CommitError
Failure surface for CommitCoordinator::commit_checkpoint.
ConfigChangeKind
Type of config mutation that was published by a store notification.
ConfigRecordError
Error returned while decoding a ConfigRecord or applying its overrides.
ConfigValidationError
EventPublishError
Failure surface for advisory server canonical publication.
EventScope
Query and ordering scope for canonical events.
EventScopeFamily
Standard event-scope family.
EventStoreError
Errors returned by canonical event store implementations.
EventVisibility
Visibility and redaction hint for canonical events.
FidelityClass
Durability class used by compacted and full-fidelity event capture.
HomeStrategy
Strategy for choosing a session’s home member.
JsonValue
Represents any valid JSON value.
KeyScope
Lifetime scope for a state key.
LiveControlError
LiveDeliveryOutcome
Outcome of a live-control delivery call — lets the caller decide whether to fall back to the durable queue. NoSubscriber means no node acknowledged the command; the command was either lost in transit or the run failed to accept it. Callers must treat NoSubscriber as “did not deliver” and fall back to durable dispatch.
LiveRunCommand
Control command delivered to an active run’s owning node (out-of-band relative to durable dispatch). Consumed by the runtime forwarder attached to each RunHandle; unsubscribed targets silently drop commands (best effort — steering is ephemeral by design).
McpTransportKind
Transport type for an MCP server connection.
MergeStrategy
Parallel merge strategy for a state key.
Modality
Input/output modality supported by a model.
OutboxError
OutboxNackOutcome
OutboxStatus
Phase
Lifecycle phase within an agent run.
PoolMemberRole
Eligibility of a pool member for initial home selection.
ProfileOwner
Identifies who owns a profile entry.
ProgressStatus
ProtocolReplayError
Errors returned by protocol replay log implementations.
ProtocolReplayRedactionState
Redaction state of a replay row.
PublishOutcome
Result of publishing a resource version.
RecordSource
Who wrote this record into ConfigStore.
RegistryGraphValidationError
RegistryReferencePolicy
RequestSurface
RunDispatchStatus
Six-state lifecycle for a dispatch attempt.
RuntimeEventDurability
Runtime event durability mode used by DurableEventSink.
ScopeError
ServerEventPublishOutcome
Outcome for advisory server canonical publication through an outbox.
SkillSpecContext
Execution mode for a config-managed skill.
StateError
StickyScope
Lifetime over which a session holds its active member.
SubscribeStart
Start position for event subscription.
UnknownFieldPolicy
Unknown-field behavior for a serializable config surface.
UnknownKeyPolicy
VersionSelector
VersionedRegistryError
Errors returned by versioned registry stores.

Constants§

A2A_SERVER_ID_OPTION
AGENT_SPEC_PATCH_UNKNOWN_FIELD_POLICY
AGENT_SPEC_UNKNOWN_FIELD_POLICY
AgentSpec and AgentSpecPatch reject unknown fields.
DEFAULT_SCOPE_ID
MODEL_POOL_SPEC_UNKNOWN_FIELD_POLICY
MODEL_SPEC_UNKNOWN_FIELD_POLICY
OUTBOX_LANE_CANONICAL
OUTBOX_LANE_PROTOCOL_REPLAY
OUTBOX_TARGET_A2A_WEBHOOK
OUTBOX_TARGET_PROTOCOL_FANOUT
OUTBOX_TARGET_PROTOCOL_PROJECTOR
PROVIDER_SPEC_UNKNOWN_FIELD_POLICY
ProviderSpec’s serde implementation is intentionally lenient for read-time compatibility, but config write/validate surfaces reject unknown fields so operators do not persist silently ignored provider settings.
REGISTRY_KIND_AGENT
REGISTRY_KIND_MODEL
REGISTRY_KIND_MODEL_POOL
REGISTRY_KIND_PLUGIN_CONFIG
REGISTRY_KIND_PROVIDER
REGISTRY_KIND_SKILL
REGISTRY_KIND_TOOL
SKILL_SPEC_UNKNOWN_FIELD_POLICY
TOOL_CALL_PROGRESS_ACTIVITY_TYPE
Constants for activity type identification.

Traits§

AgentEventNormalizer
Converts runtime AgentEvents to protocol-neutral canonical event drafts.
CanonicalEventStager
Stage canonical event drafts produced during phase execution.
CommitCoordinator
Cross-store atomic commit boundary (ADR-0036 D2).
ConfigChangeNotifier
Optional native notification capability for a ConfigStore.
ConfigChangeSubscriber
Blocking/streaming receiver for store-native config change notifications.
ConfigRecordMerge
Spec types that can apply RecordMeta::user_overrides at read time.
ConfigStore
Async CRUD store for namespaced JSON configuration documents.
DiagnosticEventPublisher
Fire-and-forget diagnostic event publisher.
DispatchSignalReceipt
Receipt for a durable dispatch delivery signal.
EffectSpec
EventLookup
Lookup canonical events by stable event id.
EventReader
Read canonical event history.
EventStore
Full canonical event store capability.
EventSubscriber
Subscribe to canonical event history and live tail.
EventWriter
Append canonical events.
LiveCommandReceipt
Completion receipt for a delivered LiveRunCommand. Consumers call LiveCommandReceipt::ack only after the run has actually accepted the command (e.g. the inbox channel returned success). A dropped receipt signals the producer that delivery did not complete, and the producer’s deliver_live resolves as LiveDeliveryOutcome::NoSubscriber so the caller can fall back to durable dispatch. Producers MUST NOT observe Delivered until the receipt has been acknowledged.
LiveRunCommandSource
MailboxStore
Persistent mailbox queue with lease-based distributed claim.
OutboxServerEventPublisher
Long-lived publisher for advisory server-authored canonical events.
OutboxStore
Outbox store contract (ADR-0034 D9/D10).
PluginConfigKey
Typed plugin configuration key.
PreparedSkillSpecs
Prepared, validated skill registry replacement.
ProfileKey
A typed key for profile storage.
ProfileStore
Raw profile storage backend.
ProtocolReplayLog
Full protocol replay-log capability.
ProtocolReplayLookup
Load a persisted protocol replay row by durable row identity.
ProtocolReplayReader
Read protocol replay history.
ProtocolReplayWriter
Append protocol replay rows.
RegistryGraphValidator
ScheduledActionSpec
SkillSpecSink
Sink used by runtime/config managers that publish DB-managed skill specs to a live skill registry without depending on the concrete skills extension.
StagedCommitCoordinator
A CommitCoordinator that can additionally commit staged event/outbox writes atomically with the thread commit. Store coordinators implement this; the runtime-facing CommitCoordinator::commit_checkpoint is equivalent to a staged commit with ThreadCommitStagedWrites::default.
StateKey
TypedTool
A strongly-typed tool trait that derives its descriptor schema from Args.
VersionedRegistryRetention
Capability-based view onto a versioned registry store that exposes purge planning. Implementations MUST NOT purge anything in dry-run mode and MUST treat current pointers and any version referenced by a retained publication or protected_versions entry as ineligible.
VersionedRegistryStore
Async server/store contract for immutable published runtime-config versions.

Functions§

a2a_server_id
build_rollback_metadata
Normalize rollback metadata so it always carries restored_from pointing at the source version, per ADR-0035 D4. Callers may supply additional metadata fields, but the restored_from key is reserved: supplying it with a value other than to_version is rejected, and when absent it is injected automatically.
canonical_registry_json_bytes
Canonical JSON bytes used as the persisted hash source (ADR-0035 D3).
decode_config_record
Decode a value into ConfigRecord<T>, accepting either an envelope or a legacy bare spec. This does not validate RecordMeta::user_overrides.
effective_config_record
Apply RecordMeta::user_overrides to the record’s base spec.
effective_visible_config_records
Decode visible records and return their effective specs.
extract_meta_revision
Extract the meta.revision integer from a stored config document.
generate_tool_schema
Generate a JSON Schema for T that is suitable for LLM tool calling.
is_skill_allowed_tool_pattern
Return true when an allowed-tools tool_id should be treated as a matcher rather than an exact tool id.
merge_agent_spec
Apply a AgentSpecPatch on top of a base AgentSpec, producing the effective spec passed to the resolver.
merge_skill_spec
merge_tool_spec
Apply a ToolSpecPatch on top of a ToolSpec. None keeps the base value, Some(v) replaces it. Read-only fields (id, name, category, parameters_schema) are untouched — patch shape statically excludes them.
now_ms
Returns the current time in milliseconds since the UNIX epoch.
parse_skill_allowed_tool_token
Parse one allowed-tools token.
parse_skill_allowed_tools
Parse an allowed-tools string into ordered tokens.
registry_content_hash
Compute the ADR-0035 content hash for a canonical published value envelope.
sanitize_for_llm
Sanitize a JSON Schema value in-place to be LLM-friendly.
scoped_key
set_a2a_server_id
sort_publication_entries
Sort publication entries by (kind, id) so different store backends expose the same RegistryPublication.entries order. Callers should apply this to entries before persisting; readers can rely on the resulting order being stable across backends.
unscoped_key
validate_against_schema
Validate args against a JSON Schema, returning an error with joined messages on failure.
validate_agent_spec
Validate and decode an AgentSpec.
validate_agent_spec_patch
Validate and decode an AgentSpecPatch.
validate_config_record
Validate and decode a config record envelope, accepting legacy bare specs. RecordMeta::user_overrides must decode as the patch type for T.
validate_config_record_overrides
Validate RecordMeta::user_overrides for an already decoded record.
validate_model_pool_spec
Validate and decode a ModelPoolSpec from JSON for config write surfaces.
validate_model_pool_spec_struct
Validate an already-constructed ModelPoolSpec.
validate_model_spec
Validate and decode a ModelSpec from JSON for config write surfaces.
validate_model_spec_struct
Validate an already-constructed ModelSpec.
validate_provider_spec
Validate and decode a ProviderSpec for config write surfaces.
validate_skill_allowed_tool_pattern
Validate a pattern-like allowed-tools matcher using the same parser used by runtime permission rules and agent tool-pattern configuration.
validate_skill_spec
Validate and decode a SkillSpec for config write surfaces.
validate_unique_model_ids
Validate that a slice of ModelSpec contains no duplicate id values.

Type Aliases§

CanonicalEventStream
Live canonical event stream.
CheckpointDeprecated
Compatibility name retained for existing call sites.
CheckpointCommitOutcomeDeprecated
Compatibility name retained for existing call sites.
CheckpointStagedWritesDeprecated
Compatibility name retained for existing server/store call sites.
LiveRunCommandStream
Stream of LiveRunCommandEntry consumed by the owning node’s runtime forwarder.
ScopedVersionedRegistry