Help us shape the future of Go! Take the 2026 Go Developer Survey

daemon

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package daemon runs an awp node as a long-lived local service and serves the control API that the CLI, the MCP server and harness hooks use.

One daemon per awp home (~/.awp by default) owns the identity key, the tailcat listener and every connection, so switching harness mid-task keeps the identity and the conversations (spec section 15, question 1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHome

func DefaultHome() string

DefaultHome is $AWP_HOME or ~/.awp.

func Run

func Run(cfg Config) error

Run starts the node and serves the control socket until SIGINT, SIGTERM or a "shutdown" call.

Types

type Config

type Config struct {
	Home    string `json:"-"`
	Name    string `json:"name,omitempty"`
	About   string `json:"about,omitempty"`
	Harness string `json:"harness,omitempty"` // claude, codex, ...: see internal/harness
	// DetectedHarness is the harness this daemon's environment points to.
	DetectedHarness string      `json:"-"`
	Model           string      `json:"model,omitempty"`      // the model the agent runs on
	ShareWith       []string    `json:"share_with,omitempty"` // keys of hosts to mirror conversations to (wire/mirror.go)
	Listen          []string    `json:"listen,omitempty"`
	Advertise       string      `json:"advertise,omitempty"`
	BlobLimit       int64       `json:"blob_limit,omitempty"`
	PingInterval    string      `json:"ping_interval,omitempty"`
	OutboxTTL       string      `json:"outbox_ttl,omitempty"`
	Policy          node.Policy `json:"policy,omitzero"`
	Trace           bool        `json:"trace,omitempty"`
	Plaintext       bool        `json:"allow_plaintext,omitempty"` // plain TCP to public addresses
	Verbose         bool        `json:"verbose,omitempty"`         // include tailcat's own logs
	Presence        bool        `json:"presence,omitempty"`        // publish signed presence (NOTES.md)
}

Config is the daemon configuration: home/config.json, overridden by AWP_* environment variables, overridden by command-line flags.

func LoadConfig

func LoadConfig(home string) (Config, error)

LoadConfig reads home/config.json (if present) and applies environment overrides.

type Daemon

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

Daemon serves the control API for one node.

func (*Daemon) Call

func (d *Daemon) Call(ctx context.Context, method string, params json.RawMessage) (any, error)

func (*Daemon) Stream

func (d *Daemon) Stream(ctx context.Context, method string, params json.RawMessage, emit func(any) error) (bool, error)

Stream implements control.Handler.

Jump to

Keyboard shortcuts

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