presence

package
v0.49.13 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package presence manages agent presence metadata. Each agent can set a status and optional note, stored as presence.json in their mailbox directory with a last_seen timestamp.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetNotifierStatus added in v0.48.0

func SetNotifierStatus(root, handle, status, mode, reason string) error

SetNotifierStatus records notifier capability without overwriting the agent's own presence status or note. Empty values clear a stale notifier diagnosis when a later wake starts with a usable injector.

func Touch added in v0.24.1

func Touch(root, handle string) error

Touch updates the LastSeen timestamp for an agent's presence. If presence already exists, it preserves Status and Note. If no presence exists, it creates one with status "active".

func TouchDeliveryRoot added in v0.45.0

func TouchDeliveryRoot(root *fsq.DeliveryRoot, handle string) error

TouchDeliveryRoot updates presence through a pinned root capability.

func Write

func Write(root string, p Presence) error

func WriteDeliveryRoot added in v0.45.0

func WriteDeliveryRoot(root *fsq.DeliveryRoot, p Presence) error

WriteDeliveryRoot writes presence through an already authorized root capability. Send/reply use this form so a path alias change cannot redirect a best-effort presence update outside the authorized tree.

Types

type Presence

type Presence struct {
	Schema         int    `json:"schema"`
	Handle         string `json:"handle"`
	Status         string `json:"status"`
	LastSeen       string `json:"last_seen"`
	Note           string `json:"note,omitempty"`
	NotifierStatus string `json:"notifier_status,omitempty"`
	NotifierMode   string `json:"notifier_mode,omitempty"`
	NotifierReason string `json:"notifier_reason,omitempty"`
}

Presence captures the current presence for an agent handle.

func New

func New(handle, status, note string, now time.Time) Presence

func Read

func Read(root, handle string) (Presence, error)

Jump to

Keyboard shortcuts

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