( fs: TextEditorFsCallbacks, resourceState: ResourceStateV1, )
| 579 | } |
| 580 | |
| 581 | function trackFsMutations( |
| 582 | fs: TextEditorFsCallbacks, |
| 583 | resourceState: ResourceStateV1, |
| 584 | ): TextEditorFsCallbacks { |
| 585 | return { |
| 586 | view: (path) => fs.view(path), |
| 587 | listDir: (dir) => fs.listDir(dir), |
| 588 | async create(path, content) { |
| 589 | const result = await fs.create(path, content); |
| 590 | recordMutation(resourceState); |
| 591 | return result; |
| 592 | }, |
| 593 | async strReplace(path, oldStr, newStr) { |
| 594 | const result = await fs.strReplace(path, oldStr, newStr); |
| 595 | recordMutation(resourceState); |
| 596 | return result; |
| 597 | }, |
| 598 | async insert(path, line, text) { |
| 599 | const result = await fs.insert(path, line, text); |
| 600 | recordMutation(resourceState); |
| 601 | return result; |
| 602 | }, |
| 603 | }; |
| 604 | } |
| 605 | |
| 606 | function wrapSkillState( |
| 607 | tool: AgentTool<TSchema, unknown>, |
no test coverage detected