imageShow *ImageShow
}
+// ToolZoomArguments are the arguments of zoom. A Name that is not nil names the
+// child whose view or the subagent whose whole log zoom gives. ID and N are
+// then not used.
+type ToolZoomArguments struct {
+ ID int `json:"id"`
+ N int `json:"n"`
+ Name *string `json:"name"`
+}
+
+// ToolDateArguments are the arguments of date.
+type ToolDateArguments struct {
+ ID int `json:"id"`
+}
+
+// ToolShellArguments are the arguments of shell.
+type ToolShellArguments struct {
+ Command string `json:"command"`
+}
+
+// ToolPathArguments are the arguments of read.
+type ToolPathArguments struct {
+ Path string `json:"path"`
+}
+
+// ToolWriteArguments are the arguments of write.
+type ToolWriteArguments struct {
+ Path string `json:"path"`
+ Text string `json:"text"`
+}
+
+// ToolEditArguments are the arguments of edit.
+type ToolEditArguments struct {
+ Path string `json:"path"`
+ Old string `json:"old"`
+ New string `json:"new"`
+}
+
+// ToolSpawnArguments are the arguments of spawn. A nil Effort is the effort of
+// the agent.
+type ToolSpawnArguments struct {
+ Tasks []string `json:"tasks"`
+ Effort *string `json:"effort"`
+}
+
+// ToolAgentCreateArguments are the arguments of agent_create.
+type ToolAgentCreateArguments struct {
+ Name string `json:"name"`
+ Responsibility string `json:"responsibility"`
+}
+
+// ToolRouteArguments are the arguments of route.
+type ToolRouteArguments struct {
+ Source string `json:"source"`
+ Agent string `json:"agent"`
+}
+
+// ToolRouteSourceArguments are the arguments of unroute.
+type ToolRouteSourceArguments struct {
+ Source string `json:"source"`
+}
+
+// ToolTellArguments are the arguments of tell.
+type ToolTellArguments struct {
+ Name string `json:"name"`
+ Message string `json:"message"`
+}
+
+// ToolImageShowArguments are the arguments of image_show.
+type ToolImageShowArguments struct {
+ Image string `json:"image"`
+ Caption string `json:"caption"`
+}
+
+// ToolWhatsAppFindArguments are the arguments of whatsapp_find.
+type ToolWhatsAppFindArguments struct {
+ Name string `json:"name"`
+}
+
+// ToolWhatsAppSendArguments are the arguments of whatsapp_send.
+type ToolWhatsAppSendArguments struct {
+ ID string `json:"id"`
+ Chat string `json:"chat"`
+ Text string `json:"text"`
+ Image string `json:"image"`
+}
+
+// ToolScheduleSetArguments are the arguments of schedule_set. Exactly one of At
+// and Cron is not nil.
+type ToolScheduleSetArguments struct {
+ Text string `json:"text"`
+ At *string `json:"at"`
+ Cron *string `json:"cron"`
+}
+
+// ToolScheduleRemoveArguments are the arguments of schedule_remove.
+type ToolScheduleRemoveArguments struct {
+ ID int `json:"id"`
+}
+
+// ToolHeadTail keeps the first and the last toolClipBytes bytes written to it,
+// and counts the bytes between them that it drops.
+type ToolHeadTail struct {
+ head []byte
+ tail []byte
+ dropped int
+}
+
// Call logs the call of the tool name with its JSON arguments, makes the log
// durable, runs the tool, and logs its clipped text. It returns that text or
// the text and image parts of a single-message zoom. Pixels never enter the
return filepath.Join(b.workdir, path)
}
-// ToolZoomArguments are the arguments of zoom. A Name that is not nil names the
-// child whose view or the subagent whose whole log zoom gives. ID and N are
-// then not used.
-type ToolZoomArguments struct {
- ID int `json:"id"`
- N int `json:"n"`
- Name *string `json:"name"`
-}
-
-// ToolDateArguments are the arguments of date.
-type ToolDateArguments struct {
- ID int `json:"id"`
-}
-
-// ToolShellArguments are the arguments of shell.
-type ToolShellArguments struct {
- Command string `json:"command"`
-}
-
-// ToolPathArguments are the arguments of read.
-type ToolPathArguments struct {
- Path string `json:"path"`
-}
-
-// ToolWriteArguments are the arguments of write.
-type ToolWriteArguments struct {
- Path string `json:"path"`
- Text string `json:"text"`
-}
-
-// ToolEditArguments are the arguments of edit.
-type ToolEditArguments struct {
- Path string `json:"path"`
- Old string `json:"old"`
- New string `json:"new"`
-}
-
-// ToolSpawnArguments are the arguments of spawn. A nil Effort is the effort of
-// the agent.
-type ToolSpawnArguments struct {
- Tasks []string `json:"tasks"`
- Effort *string `json:"effort"`
-}
-
-// ToolAgentCreateArguments are the arguments of agent_create.
-type ToolAgentCreateArguments struct {
- Name string `json:"name"`
- Responsibility string `json:"responsibility"`
-}
-
-// ToolRouteArguments are the arguments of route.
-type ToolRouteArguments struct {
- Source string `json:"source"`
- Agent string `json:"agent"`
-}
-
-// ToolRouteSourceArguments are the arguments of unroute.
-type ToolRouteSourceArguments struct {
- Source string `json:"source"`
-}
-
-// ToolTellArguments are the arguments of tell.
-type ToolTellArguments struct {
- Name string `json:"name"`
- Message string `json:"message"`
-}
-
-// ToolImageShowArguments are the arguments of image_show.
-type ToolImageShowArguments struct {
- Image string `json:"image"`
- Caption string `json:"caption"`
-}
-
-// ToolWhatsAppFindArguments are the arguments of whatsapp_find.
-type ToolWhatsAppFindArguments struct {
- Name string `json:"name"`
-}
-
-// ToolWhatsAppSendArguments are the arguments of whatsapp_send.
-type ToolWhatsAppSendArguments struct {
- ID string `json:"id"`
- Chat string `json:"chat"`
- Text string `json:"text"`
- Image string `json:"image"`
-}
-
-// ToolScheduleSetArguments are the arguments of schedule_set. Exactly one of At
-// and Cron is not nil.
-type ToolScheduleSetArguments struct {
- Text string `json:"text"`
- At *string `json:"at"`
- Cron *string `json:"cron"`
-}
-
-// ToolScheduleRemoveArguments are the arguments of schedule_remove.
-type ToolScheduleRemoveArguments struct {
- ID int `json:"id"`
-}
-
-// ToolHeadTail keeps the first and the last toolClipBytes bytes written to it,
-// and counts the bytes between them that it drops.
-type ToolHeadTail struct {
- head []byte
- tail []byte
- dropped int
-}
-
// String returns the output, clipped when it is too long. Invalid UTF-8 becomes
// the replacement character.
func (h *ToolHeadTail) String() string {