-// ruler shows the model the size limit of a line. Models cannot count bytes,
-// and a sample line as the ruler gets its content copied.
-var ruler = strings.Repeat("-", nodeBytes)
+// compactorRuler shows the model the size limit of a line. Models cannot count
+// bytes, and a sample line as the ruler gets its content copied.
+var compactorRuler = strings.Repeat("-", nodeBytes)
+
+// newCompactor returns the compactor of an agent, which sends its calls through
+// client with model. instructions gives the system prompt of the agent at each
+// build. tools are the tools of that agent, so a build sends the same prompt
+// and tools as its turns.
+func newCompactor(client *ModelClient, instructions func() (string, error), model ModelConfig, tools []ModelTool) *Compactor {
+ return &Compactor{
+ client: client,
+ model: model,
+ instructions: instructions,
+ tools: tools,
+ }
+}