manage

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package manage provides programmatic management of local AHT integrations and background tracking.

Operations are idempotent and use the same managed artifacts and native harness registration mechanisms as the aht command. Dry-run options report intended changes without modifying the host.

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	// ErrForeignTracker means the service definition is not owned by AHT.
	ErrForeignTracker = errors.New("tracker service definition is not owned by aht")
	// ErrUnsupportedTracker means background tracking is unavailable on this platform.
	ErrUnsupportedTracker = errors.New("background tracking is unsupported")
)

Functions

func SupportedHarnesses

func SupportedHarnesses() []registry.Harness

SupportedHarnesses returns the harnesses with managed integrations.

Example
package main

import (
	"fmt"

	"github.com/zigai/aht/pkg/manage"
)

func main() {
	fmt.Println(len(manage.SupportedHarnesses()) > 0)
}
Output:
true

Types

type ArtifactStatus

type ArtifactStatus string

ArtifactStatus describes the ownership and freshness of a managed integration artifact.

const (
	ArtifactMissing ArtifactStatus = "missing"
	ArtifactCurrent ArtifactStatus = "current"
	ArtifactStale   ArtifactStatus = "stale"
	ArtifactForeign ArtifactStatus = "foreign"
)

type Config

type Config struct {
	Binary             string
	StorePath          string
	TrackerInterval    time.Duration
	TrackerGracePeriod time.Duration
}

Config identifies the AHT binary, registry, and tracker settings managed by a Manager. Empty fields use the current user's defaults.

type IntegrationOptions

type IntegrationOptions struct {
	TargetBinary string
	DryRun       bool
	Force        bool
	UseShim      bool
}

IntegrationOptions controls one managed harness integration operation.

type IntegrationResult

type IntegrationResult struct {
	Harness  registry.Harness
	Path     string
	Changed  bool
	Message  string
	NextStep string
	Snippet  string
}

IntegrationResult describes the effect of installing or removing one integration.

type IntegrationStatus

type IntegrationStatus struct {
	Harness  registry.Harness
	Status   ArtifactStatus
	Paths    []string
	Message  string
	NextStep string
}

IntegrationStatus describes the installed state of one harness integration.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager installs harness integrations and controls the platform-native AHT tracker.

func New

func New(config Config) *Manager

New returns a Manager with normalized local defaults.

func (*Manager) DisableTracker

func (m *Manager) DisableTracker(ctx context.Context, options TrackerOptions) (TrackerResult, error)

DisableTracker stops and removes background agent-session tracking.

func (*Manager) EnableTracker

func (m *Manager) EnableTracker(ctx context.Context, options TrackerOptions) (TrackerResult, error)

EnableTracker installs, updates, and starts background agent-session tracking.

func (*Manager) InstallIntegration

func (m *Manager) InstallIntegration(
	ctx context.Context,
	harness registry.Harness,
	options IntegrationOptions,
) (IntegrationResult, error)

InstallIntegration idempotently installs or updates one harness integration.

func (*Manager) IntegrationStatus

func (m *Manager) IntegrationStatus(
	ctx context.Context,
	harness registry.Harness,
) (IntegrationStatus, error)

IntegrationStatus reports whether one harness integration is installed and current.

func (*Manager) RemoveIntegration

func (m *Manager) RemoveIntegration(
	ctx context.Context,
	harness registry.Harness,
	options IntegrationOptions,
) (IntegrationResult, error)

RemoveIntegration removes only artifacts owned by AHT for one harness.

func (*Manager) TrackerStatus

func (m *Manager) TrackerStatus(ctx context.Context) (TrackerResult, error)

TrackerStatus reports the state of background agent-session tracking.

type TrackerOptions

type TrackerOptions struct {
	DryRun bool
}

TrackerOptions controls a tracker operation.

type TrackerResult

type TrackerResult struct {
	Platform       string
	Manager        string
	ManagedPath    string
	ManagedVersion int
	Installed      bool
	Current        bool
	Running        bool
	Changed        bool
	Message        string
}

TrackerResult describes the platform-native tracker state after an operation.

Jump to

Keyboard shortcuts

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