// Package {{PACKAGE}} defines pure decision rules for the {{AGENT_ID}} bot. // Provisioned by dev-scripts/agent/provision-agent-user.sh (issue 0144b). // // Mode: user. Operates on {{HOST}} with operator's uid (no sudo). // Tool registry is built by the runtime from cfg.DeviceMesh.ToolsAllowed // (issue 0144a wires the LLM action to invoke devicemesh tools). package {{PACKAGE}} import ( "github.com/enmanuel/agents/devagents" "github.com/enmanuel/agents/pkg/decision" ) func init() { devagents.Register("{{AGENT_ID}}", Rules) } // Rules returns the decision rules for {{AGENT_ID}}. // // Strategy: any DM or @mention triggers the LLM with tool_use. The LLM // decides which devicemesh tool to invoke (exec, fs.*, project.create, // delegate_sudo, ...). Tools are registered automatically by the runtime // from the cfg.DeviceMesh.ToolsAllowed slice — we do NOT enumerate them // here. See devagents/registry_build.go and pkg/tools/devicemesh/. // // Pure: zero I/O, zero side effects. The action emits []decision.Action, // the shell layer consumes it. func Rules() []decision.Rule { return []decision.Rule{ { Name: "llm-conversational", Match: func(ctx decision.MessageContext) bool { return ctx.IsDirectMsg || ctx.IsMention }, Actions: []decision.Action{{ Kind: decision.ActionKindLLM, LLM: &decision.LLMAction{}, }}, }, } }