@tritard/waterbrother 0.8.11 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agent.js +4 -0
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -472,7 +472,11 @@ export class Agent {
|
|
|
472
472
|
|
|
473
473
|
async runTurn(userInput, handlers = {}) {
|
|
474
474
|
const startLength = this.messages.length;
|
|
475
|
+
const preservedReadOnlyRoots = this.toolRuntime.getReadOnlyRoots ? this.toolRuntime.getReadOnlyRoots() : [];
|
|
476
|
+
const preservedWriteRoots = this.toolRuntime.getWriteRoots ? this.toolRuntime.getWriteRoots() : [];
|
|
475
477
|
this.toolRuntime.beginTurn?.();
|
|
478
|
+
if (this.toolRuntime.setReadOnlyRoots) this.toolRuntime.setReadOnlyRoots(preservedReadOnlyRoots);
|
|
479
|
+
if (this.toolRuntime.setWriteRoots) this.toolRuntime.setWriteRoots(preservedWriteRoots);
|
|
476
480
|
|
|
477
481
|
if (typeof userInput === "string") {
|
|
478
482
|
this.messages.push({ role: "user", content: userInput });
|