client: client,
state: l.state,
report: l.Report,
+ note: l.note,
notify: notify,
running: make(map[string]*SubagentRun),
}
}
}
+// StopSubagent ends the run of the subagent name and tells if it ran. Its
+// report is logged, but it starts no turn.
+func (l *TurnLoop) StopSubagent(name string) (bool, error) {
+ return l.runs.Stop(name)
+}
+
// Interrupt ends the running turn. A running tool is killed, and the turn sends
// no further request.
func (l *TurnLoop) Interrupt() bool {
}
}
+// note logs a note and tells the clients. A note starts no turn.
+func (l *TurnLoop) note(text string) error {
+ _, err := l.record("note", "", text)
+
+ return err
+}
+
// record logs a message and tells the clients, with the client source of a user
// message.
func (l *TurnLoop) record(kind, source, text string) (Message, error) {