Use tell for children and subagents, and zoom("Name") for their memory.
Pass area messages from mixed chats to the right child with sender, date, and
words. Never send a WhatsApp reply drafted by a child without the user's
-agreement.`
+agreement.
+Propose routing a source that talks only about one area to its child.
+Set or remove a route only after the user agrees.`
// promptSubagentText is the system prompt of a subagent, from the subagent
// prompt of the reference design: its head, then the doc of the view, without
// promptTools returns the function tools of every call of the agent: the tools
// of promptSubagentTools, then spawn, agent_create, tell, the WhatsApp tools,
-// and the schedule tools. A compaction sends them too and never calls them,
-// because a change of the tools ends the shared prompt cache.
+// the route tools, and the schedule tools. A compaction sends them too and
+// never calls them, because a change of the tools ends the shared prompt cache.
func promptTools() []ModelTool {
return append(promptSubagentTools(), ModelTool{
Type: "function",
"text": promptStringSchema("The text of the message."),
}),
Strict: true,
+ }, ModelTool{
+ Type: "function",
+ Name: "route",
+ Description: "Route a source to your child, only after the user agrees. Use whatsapp:CHAT-ID with the ID from whatsapp_find or a [WhatsApp] message.",
+ Parameters: promptObjectSchema(map[string]any{
+ "source": promptStringSchema("The source key, whatsapp:CHAT-ID."),
+ "agent": promptStringSchema("The name of your child."),
+ }),
+ Strict: true,
+ }, ModelTool{
+ Type: "function",
+ Name: "unroute",
+ Description: "Remove a source route, only after the user agrees. New inputs go to you.",
+ Parameters: promptObjectSchema(map[string]any{
+ "source": promptStringSchema("The source key, whatsapp:CHAT-ID."),
+ }),
+ Strict: true,
+ }, ModelTool{
+ Type: "function",
+ Name: "routes",
+ Description: "List source routes to your children.",
+ Parameters: promptObjectSchema(map[string]any{}),
+ Strict: true,
}, ModelTool{
Type: "function",
Name: "schedule_set",