mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Update tools to allow reading any VFS path, writing to /tmp
This commit is contained in:
17 files changed
+356
-60
No files matched your search
@@ -134,7 +134,21 @@ describe('TextEditorStrReplaceTool', () => {
|
||||
path: '/absolute/path/test.ts',
|
||||
old_str: 'old',
|
||||
new_str: 'new'
|
||||
})).rejects.toThrow('❌ Absolute paths are not supported');
|
||||
})).rejects.toThrow('Write access denied');
|
||||
});
|
||||
|
||||
it('should allow writes to /tmp/ directory', async () => {
|
||||
// First create the file in /tmp/
|
||||
await mockFS.writeFile('/tmp/temp-file.txt', 'original content');
|
||||
|
||||
const result = await tool.execute({
|
||||
path: '/tmp/temp-file.txt',
|
||||
old_str: 'original',
|
||||
new_str: 'modified'
|
||||
});
|
||||
|
||||
expect(result).toContain('String successfully replaced');
|
||||
expect(mockFS.getFileContent('/tmp/temp-file.txt')).toBe('modified content');
|
||||
});
|
||||
|
||||
it('should handle whitespace normalization', async () => {
|
||||
|
||||
Reference in new issue
Block a user