Documentation
¶
Overview ¶
Package aht provides the primary high-level API for inspecting, filtering, and streaming agent-harness sessions tracked by AHT.
It exports the central Client, operational modes, and re-exports core domain models (Session, Filter, Presence, Activity, Harness) so that consumers can interact with AHT through a single import.
Index ¶
- Constants
- Variables
- func DefaultSocketPath() string
- func DefaultStorePath() string
- func IsUnavailable(err error) bool
- type Activity
- type Client
- type Config
- type Filter
- type Harness
- type Mode
- type MultiplexerContext
- type Observation
- type ObservationIdentity
- type Presence
- type Session
- type StateSnapshot
- type Store
- type Subscription
- type Summary
- type TmuxContext
Examples ¶
Constants ¶
const ( // ModeAuto routes through the broker socket and falls back to disk if offline. ModeAuto Mode = client.ModeAuto // ModeRealtimeOnly connects strictly to the broker socket, failing if offline. ModeRealtimeOnly Mode = client.ModeRealtimeOnly // ModeDurableOnly reads directly from the on-disk registry file. ModeDurableOnly Mode = client.ModeDurableOnly // PresenceLive indicates the agent session process or container is active. PresenceLive Presence = registry.PresenceLive // PresenceGone indicates the agent session has terminated. PresenceGone Presence = registry.PresenceGone // PresenceUnknown indicates presence cannot be determined. PresenceUnknown Presence = registry.PresenceUnknown // ActivityRunning indicates the agent is actively processing or executing. ActivityRunning Activity = registry.ActivityRunning // ActivityWaiting indicates the agent is waiting for user or tool input. ActivityWaiting Activity = registry.ActivityWaiting // ActivityIdle indicates the agent is idle and ready for interaction. ActivityIdle Activity = registry.ActivityIdle // ActivityFailed indicates the agent encountered an unrecoverable failure. ActivityFailed Activity = registry.ActivityFailed // ActivityInterrupted indicates the agent run was canceled or interrupted. ActivityInterrupted Activity = registry.ActivityInterrupted // ActivityUnknown indicates activity cannot be determined. ActivityUnknown Activity = registry.ActivityUnknown HarnessClaude Harness = registry.HarnessClaude HarnessCodex Harness = registry.HarnessCodex HarnessCursor Harness = registry.HarnessCursor HarnessCopilot Harness = registry.HarnessCopilot HarnessCline Harness = registry.HarnessCline HarnessKimiCode Harness = registry.HarnessKimiCode HarnessGrok Harness = registry.HarnessGrok HarnessGoose Harness = registry.HarnessGoose HarnessPi Harness = registry.HarnessPi HarnessOmp Harness = registry.HarnessOmp HarnessOpenCode Harness = registry.HarnessOpenCode HarnessAgy Harness = registry.HarnessAgy HarnessKilo Harness = registry.HarnessKilo HarnessDroid Harness = registry.HarnessDroid HarnessOpenClaw Harness = registry.HarnessOpenClaw HarnessHermes Harness = registry.HarnessHermes )
Variables ¶
var ( // ErrInvalidMode means the client was configured with an unsupported operating mode. ErrInvalidMode = client.ErrInvalidMode ErrUnavailable = client.ErrUnavailable // ErrProtocol means the broker returned an invalid or incompatible response. ErrProtocol = client.ErrProtocol // ErrRealtimeRequired means the operation requires a realtime broker connection. ErrRealtimeRequired = client.ErrRealtimeRequired )
Functions ¶
func DefaultSocketPath ¶
func DefaultSocketPath() string
DefaultSocketPath returns the default endpoint for the current user's AHT broker.
func DefaultStorePath ¶
func DefaultStorePath() string
DefaultStorePath returns the default filesystem location for the durable registry.
func IsUnavailable ¶
IsUnavailable reports whether err means that no realtime broker accepted the connection.
Types ¶
type Client ¶
Client reads and updates agent-harness state through the local AHT broker.
func New ¶
New returns a client for the configured local AHT instance.
Example ¶
package main
import (
"fmt"
"github.com/zigai/aht/pkg/aht"
)
func main() {
client := aht.New(aht.Config{
SocketPath: "/path/to/socket.sock",
Mode: aht.ModeRealtimeOnly,
})
fmt.Printf("Mode: %s\n", client.Mode())
}
Output: Mode: realtime
type Mode ¶
Mode controls how a Client routes operations between the realtime broker and the durable registry file on disk.
type MultiplexerContext ¶
type MultiplexerContext = registry.MultiplexerContext
MultiplexerContext represents the unified multiplexer location of a session.
type Observation ¶
type Observation = registry.Observation
Observation represents an observation recorded for a session.
type ObservationIdentity ¶
type ObservationIdentity = registry.ObservationIdentity
ObservationIdentity identifies the session an observation belongs to.
type StateSnapshot ¶
type StateSnapshot = registry.StateSnapshot
StateSnapshot is a revisioned collection of tracked sessions.
type Subscription ¶
type Subscription = broker.Subscription
Subscription streams immutable state snapshots from the realtime broker.
func NewSubscription ¶
func NewSubscription(snapshots <-chan StateSnapshot, errors <-chan error, cancel context.CancelFunc) *Subscription
NewSubscription creates a subscription wrapping custom channels.
type TmuxContext ¶
type TmuxContext = registry.TmuxContext
TmuxContext represents the tmux multiplexer location of a session.