Documentation
¶
Overview ¶
Package monitor hosts the deferred Monitor tool — a background process watcher that streams stdout lines as agent-loop notifications.
The tool spawns the configured shell command in its own process group bound to the host's RootCtx (so monitor goroutines survive the LLM call that spawned them). Each stdout line becomes a daemon.Event signal on the agent's DaemonState; the drain at iter start folds the buffered events into a single <system-reminder>. The terminal lifecycle (Killed when daemon_stop fires, Completed when the script exits, Failed when spawn breaks) flows through the same DaemonState.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DaemonHost ¶
type DaemonHost interface {
DaemonState() *daemon.DaemonState
RootCtx() context.Context
AgentID() string
}
DaemonHost is the narrow surface MonitorTool needs to spawn a monitor daemon. Satisfied by *toolset.ToolState in production.
type MonitorTool ¶
type MonitorTool struct {
// contains filtered or unexported fields
}
MonitorTool spawns a long-running shell command and streams its stdout lines back to the agent as daemon.Event signals. host supplies the DaemonState + RootCtx + AgentID; without it the tool reports a clean error rather than panicking.
func NewMonitor ¶
func NewMonitor(host DaemonHost) *MonitorTool
NewMonitor constructs the production MonitorTool. The toolset factory passes the agent's *ToolState as host so per-event delivery routes through the agent's daemon signal pump.
func (*MonitorTool) Description ¶
func (t *MonitorTool) Description() string
func (*MonitorTool) Execute ¶
func (t *MonitorTool) Execute(_ context.Context, logger *slog.Logger, raw json.RawMessage) (tools.Result, error)
func (*MonitorTool) Name ¶
func (t *MonitorTool) Name() string
func (*MonitorTool) Schema ¶
func (t *MonitorTool) Schema() json.RawMessage