ade

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ade lets the agent show the owner things on the desk: point at a window or at a part of one (an anchor its view declared), spotlight it, draw an arrow between two, and walk the owner through a short guide.

The server keeps what is asked for and the page draws it. A tool call publishes "ade.attention" or "ade.guide" on the bus; the page applies it to its attention hub (@hollis-labs/ade-core) and draws it with the registry's attention layer and guide bar. The page reports back the anchors each window's view declared and where a guide stands, so the agent can see what it can point at and whether the owner has finished.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	Name  string `json:"name"`
	Label string `json:"label,omitempty"`
}

Anchor is a part of a window that its view named, so it can be pointed at.

type Attention

type Attention struct {
	Style   string  `json:"style"`
	Targets []Point `json:"targets"`
	From    *Point  `json:"from,omitempty"`
	Note    string  `json:"note,omitempty"`
	// Until is when it lapses, in Unix milliseconds; 0 means until replaced or cleared.
	Until int64 `json:"until,omitempty"`
}

Attention is what the agent is pointing at now.

type Await

type Await struct {
	Kind string `json:"kind"`
	View string `json:"view,omitempty"`
}

Await is what a guide step waits for: the owner's go-ahead ("ack"), a window of a view being open ("open"), or being in front ("focus").

type Guide

type Guide struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	Steps []Step `json:"steps"`
}

Guide is a short walk-through the owner moves on.

type Point

type Point struct {
	Window string `json:"window"`
	Anchor string `json:"anchor,omitempty"`
	Label  string `json:"label,omitempty"`
}

Point is a Target found: the window's id, and the anchor when there is one.

type Report

type Report struct {
	Guide   string `json:"guide"`
	Index   int    `json:"index"`
	Step    string `json:"step,omitempty"`
	Status  string `json:"status"`
	Stalled string `json:"stalled,omitempty"`
	At      string `json:"at,omitempty"`
}

Report is where the page says a guide stands.

type Service

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

Service keeps the attention, the guide and the anchors.

func New

func New(k kernel.Kernel) *Service

New makes the service.

func (*Service) ClearAttention

func (s *Service) ClearAttention()

ClearAttention is the owner dismissing what the agent pointed at.

func (*Service) Close

func (s *Service) Close(context.Context) error

Close has nothing to let go of.

func (*Service) Mount

func (s *Service) Mount(mux *http.ServeMux)

Mount serves what the page needs:

GET    /api/ade                    the attention, the guide and where it stands
PUT    /api/ade/anchors/{window}   [{name, label}]: what the window's view declared ([] forgets it)
POST   /api/ade/guide              a Report: where the guide stands
DELETE /api/ade/attention          the owner dismissed what the agent pointed at

func (*Service) SetAnchors

func (s *Service) SetAnchors(window string, list []Anchor)

SetAnchors records what a window's view declared; none forgets the window.

func (*Service) SetReport

func (s *Service) SetReport(r Report)

SetReport records where the page says the guide stands. A guide that has ended is let go.

func (*Service) Snapshot

func (s *Service) Snapshot() State

Snapshot is the state now, with a lapsed attention dropped.

func (*Service) Tools

func (s *Service) Tools() []kernel.BoundTool

Tools are the agent's: look at what can be pointed at, point, clear, and run a guide.

type State

type State struct {
	Attention *Attention `json:"attention"`
	Guide     *Guide     `json:"guide"`
	Report    *Report    `json:"report"`
}

State is everything the page needs to draw on load.

type Step

type Step struct {
	ID    string  `json:"id"`
	Say   string  `json:"say"`
	Point []Point `json:"point,omitempty"`
	Style string  `json:"style,omitempty"`
	Await *Await  `json:"await,omitempty"`
	Hint  string  `json:"hint,omitempty"`
}

Step is one step of a guide.

type Target

type Target struct {
	Window string `json:"window,omitempty"`
	View   string `json:"view,omitempty"`
	Anchor string `json:"anchor,omitempty"`
	Label  string `json:"label,omitempty"`
}

Target is what the agent asks to point at: a window (by id, or by view for the window of that view), and optionally an anchor in it.

Jump to

Keyboard shortcuts

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