aht

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 4 Imported by: 0

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

Examples

Constants

View Source
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

View Source
var (
	// ErrInvalidMode means the client was configured with an unsupported operating mode.
	ErrInvalidMode = client.ErrInvalidMode

	// ErrUnavailable means no realtime AHT broker accepted the local connection.
	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

func IsUnavailable(err error) bool

IsUnavailable reports whether err means that no realtime broker accepted the connection.

Types

type Activity

type Activity = registry.Activity

Activity indicates what an agent is currently doing.

type Client

type Client = client.Client

Client reads and updates agent-harness state through the local AHT broker.

func New

func New(config Config) *Client

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 Config

type Config = client.Config

Config identifies the local AHT instance and operating mode used by a Client.

type Filter

type Filter = registry.Filter

Filter specifies matching criteria when querying or watching sessions.

type Harness

type Harness = registry.Harness

Harness identifies a supported AI coding agent.

type Mode

type Mode = client.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 Presence

type Presence = registry.Presence

Presence indicates whether an agent session is live, gone, or unknown.

type Session

type Session = registry.Session

Session represents an agent-harness session tracked by AHT.

type StateSnapshot

type StateSnapshot = registry.StateSnapshot

StateSnapshot is a revisioned collection of tracked sessions.

type Store

type Store = registry.Store

Store represents an engine that persists or serves agent-harness state.

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 Summary

type Summary = registry.Summary

Summary represents aggregate session counts for a terminal session.

type SummaryOptions

type SummaryOptions = registry.SummaryOptions

SummaryOptions controls grouping and filtering for session summaries.

type TmuxContext

type TmuxContext = registry.TmuxContext

TmuxContext represents the tmux multiplexer location of a session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL