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 ¶
func MsgIDFromRecord ¶ added in v0.2.4
func MsgIDFromRecord(sr protocol.SignedRecord) [32]byte
MsgIDFromRecord computes a stable deduplication key: SHA-256(SignedRecord.Payload). When Payload is empty (legacy entry), it falls back to SHA-256(Address + Seq CBOR).
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 ¶
New loads config, generates or loads the node key, and initialises the host. Call Run to start serving.
type Event ¶ added in v0.2.4
type Event struct {
Type string
AID a2al.Address // zero = global / not agent-specific
Data any
At time.Time
}
Event is a single daemon-internal event. Type follows the naming convention "<domain>.<verb>" (e.g. "mailbox.received").
type EventBus ¶ added in v0.2.4
type EventBus struct {
// contains filtered or unexported fields
}
EventBus is a simple in-process publish/subscribe bus. All methods are safe for concurrent use.
func NewEventBus ¶ added in v0.2.4
NewEventBus returns an initialised EventBus.
type Filter ¶ added in v0.2.4
Filter restricts which events a subscriber receives. Empty/zero values match everything in that dimension.
type MailboxStoreEntry ¶ added in v0.2.4
type MailboxStoreEntry struct {
RecipientAID a2al.Address `cbor:"1,keyasint"`
Record protocol.SignedRecord `cbor:"2,keyasint"` // encrypted; zero-value when sourced from old-style poll
ReceivedAt int64 `cbor:"3,keyasint"`
TTLExpires int64 `cbor:"4,keyasint"`
ConsumedAt int64 `cbor:"5,keyasint,omitempty"` // 0 = unconsumed
}
MailboxStoreEntry is one persisted mailbox record.
Source Files
¶
- aid_dialer.go
- autopublish.go
- beacon.go
- bootstrap.go
- connpool.go
- daemon.go
- demo.go
- event_bus.go
- fetch.go
- gateway.go
- ice_listener.go
- lock_unix.go
- logfilter.go
- mailbox_push.go
- mailbox_quic.go
- mailbox_store.go
- mailbox_sub.go
- mcp.go
- netchange.go
- profile.go
- routes.go
- service.go
- signal_listen.go
- tunnel.go
- tunnel_tls.go
- webui_embed.go