daemon

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MPL-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Package daemon implements the a2ald runtime: DHT/QUIC host, REST API, TCP gateway, and MCP server. It is shared by the CLI binary (cmd/a2ald) and the mobile binding (mobile/).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DataDir is the directory for keys, agents.json, peers.cache, and
	// config.toml. Required.
	DataDir string
	// CfgPath overrides the default config file path (DataDir/config.toml).
	CfgPath string
	// Override is called after the config is loaded, allowing the caller to
	// apply additional overrides (e.g., CLI flags).
	Override func(*config.Config)
	// Log is the structured logger to use. Defaults to text output on Stdout.
	Log *slog.Logger
	// MCPStdio runs the MCP server on stdin/stdout instead of HTTP.
	MCPStdio bool
}

Config is the startup configuration for New.

type Daemon

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

Daemon is the a2ald runtime.

func New

func New(cfg Config) (*Daemon, error)

New loads config, generates or loads the node key, and initialises the host. Call Run to start serving.

func (*Daemon) APIAddr

func (d *Daemon) APIAddr() string

APIAddr returns the REST API / Web UI listen address from the loaded config.

func (*Daemon) Run

func (d *Daemon) Run(ctx context.Context, mcpStdio bool) error

Run starts the daemon and blocks until ctx is cancelled. It saves the peers cache and config on return.

Directories

Path Synopsis
Package aidproxy implements the AID Resource Addressing Gateway.
Package aidproxy implements the AID Resource Addressing Gateway.

Jump to

Keyboard shortcuts

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