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 ¶
- type Anchor
- type Attention
- type Await
- type Guide
- type Point
- type Report
- type Service
- func (s *Service) ClearAttention()
- func (s *Service) Close(context.Context) error
- func (s *Service) Mount(mux *http.ServeMux)
- func (s *Service) SetAnchors(window string, list []Anchor)
- func (s *Service) SetReport(r Report)
- func (s *Service) Snapshot() State
- func (s *Service) Tools() []kernel.BoundTool
- type State
- type Step
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
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 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 (*Service) ClearAttention ¶
func (s *Service) ClearAttention()
ClearAttention is the owner dismissing what the agent pointed at.
func (*Service) Mount ¶
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 ¶
SetAnchors records what a window's view declared; none forgets the window.
func (*Service) SetReport ¶
SetReport records where the page says the guide stands. A guide that has ended is let go.
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.