}
// Event tells the clients what the agent does as it happens. Kind is the kind
-// of a logged message (user, reply, tool, echo), or one of busy, idle, and
-// error. ID is the ID of a logged message.
+// of a logged message (user, reply, tool, echo), or one of ready, busy, idle,
+// and error. ID is the ID of a logged message.
type Event struct {
Kind string `json:"kind"`
ID int `json:"id,omitempty"`
return true
}
+// Busy tells if a turn runs.
+func (l *loop) Busy() bool {
+ l.mutex.Lock()
+ defer l.mutex.Unlock()
+
+ return l.cancel != nil
+}
+
// Append logs a message and tells the clients. The toolbox logs its calls and
// results through it.
func (l *loop) Append(kind, text string) (Message, error) {