Skip to main content
All Python modules · Import and compatibility guidance

Exports

ChannelAdapter

Platform-specific transport that normalizes events and sends replies. Extensions implement this contract without exposing raw provider drivers. Normalization is synchronous and offline so fixtures can be tested without live credentials; sending is the only network-owned operation.
Fields (— means no declared default):

ChannelAdapter.start

Initialize provider-owned clients before accepting invocations.

ChannelAdapter.normalize_event

Parse one provider payload into a ChannelEvent without any I/O.

ChannelAdapter.send_reply

Send content through the transport and return an opaque receipt.

ChannelAdapter.close

Release provider-owned clients after invocations have drained.

ChannelAdapterConflictError

Two extensions registered a channel adapter under the same name.

ChannelAdapterFactory

ChannelAdapterNotFoundError

No extension registered a channel adapter under the requested name.

ChannelBinding

Local policy connecting one platform conversation scope to this agent. extension names the registered ChannelAdapter factory that owns the platform transport (for example a Fused-backed Slack extension, or a direct-API extension); the binding itself never depends on how that extension talks to the platform. Empty allow-lists mean nothing is authorized yet, not that everything is; an adapter must fail closed.
Fields (— means no declared default):

ChannelError

Base class for channel configuration and adapter failures.

ChannelEvent

One inbound platform message, normalized by a ChannelAdapter. delivery_id identifies this specific transport delivery and may repeat across retries; provider_event_id is the platform’s stable identity for deduplication. reply_to is an opaque, adapter-owned address a later reply must target and is never interpreted by the store.
Fields (— means no declared default):

ChannelHTTPInvoker

Use caller-owned HTTP transport and explicit per-actor authentication headers. The server’s authenticator must validate the service credential and map the supplied actor identity to its principal. Metadata never establishes identity.

ChannelHTTPInvoker.call

Create/reuse the scoped session and refuse approval or incomplete responses.

ChannelReply

One outbound answer queued for durable, at-least-once delivery. status is pending, sent, failed, or delivery_unknown (an ambiguous send that must be reconciled before replay, never blindly retried).
Fields (— means no declared default):

ChannelStore

Atomic operations required for durable, deduplicated channel messaging. All identity, scope, and ordering predicates execute inside the datastore. A provider must durably commit before returning success.

ChannelStore.start

Open owned resources and initialize the provider’s durable schema.

ChannelStore.close

Release owned resources after receivers and senders have stopped.

ChannelStore.admit_event

Atomically persist a new event or return an identical prior admission. Deduplication is scoped by platform, installation, and provider event ID. A conflicting definition under the same identity raises ChannelStoreConflictError. The second return value is True only for a newly admitted event.

ChannelStore.get_event

Read one admitted event by its deduplication identity.

ChannelStore.bind_session

Idempotently record which Harnest session owns a conversation scope.

ChannelStore.get_session_binding

Read the session bound to a conversation scope, if any.

ChannelStore.enqueue_reply

Durably queue one reply before the adapter sends it.

ChannelStore.claim_replies

Claim a bounded batch of pending replies for one sender to send.

ChannelStore.finish_reply

Record a claimed reply’s terminal outcome; unknown IDs return false.

ChannelStoreConflictError

An admitted event or reply has a different definition than the request.

ChannelWorker

Admit before ACK, fence work, and persist replies before any provider send. The caller owns the started task store and authenticated invoke/send callbacks. Jobs never automatically retry an ambiguous model execution or provider send. Pending jobs survive restart; interrupted claimed jobs require reconciliation.

ChannelWorker.accepts

Recheck policy at intake and execution, including work retained before changes.

ChannelWorker.admit

Commit input and dispatch intent in one atomic, idempotent task admission.

ChannelWorker.step

Process bounded disjoint claims, prioritizing replies already durably queued.

ChannelWorker.run

Drain bounded work until shutdown; the receiver must stop before this worker.

MemoryChannelStore

Implement the atomic channel contract in one process; nothing survives restart.

MemoryChannelStore.start

Satisfy lifecycle ownership without opening external resources.

MemoryChannelStore.close

Release no resources; in-memory data lives only with this instance.

MemoryChannelStore.admit_event

Commit an isolated event snapshot keyed by its deduplication identity.

MemoryChannelStore.get_event

Read one detached event snapshot by its deduplication identity.

MemoryChannelStore.bind_session

Record the session owning a conversation scope without overwriting it.

MemoryChannelStore.get_session_binding

Read the session bound to a conversation scope, if any.

MemoryChannelStore.enqueue_reply

Queue one detached reply snapshot for later claim and send.

MemoryChannelStore.claim_replies

Return a bounded scoped batch of pending replies, oldest first.

MemoryChannelStore.finish_reply

Record a terminal outcome for one previously enqueued reply.

create_channel_adapter

Build the adapter a binding names, raising if its extension is absent.

discover_channel_bindings

Load every ChannelBinding exported by a project’s channels/ directory. Mirrors the discovery convention used for tools and MCP clients: one file per binding, named after the platform, exporting a callable binding().

register_channel_adapter

Register one packaged extension’s adapter factory under its unique name.

registered_channel_adapters

List currently registered extension names for inspection and errors.