mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Add special handling for viewing /projects
This commit is contained in:
2 files changed
+59
-9
No files matched your search
@@ -52,6 +52,13 @@ export class TextEditorViewTool implements Tool<TextEditorViewParams> {
|
||||
const stats = await this.fs.stat(absolutePath);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
// Special handling for /projects directory - only show project directories, not their contents
|
||||
const normalizedPath = absolutePath.replace(/\/$/, ''); // Remove trailing slash
|
||||
if (normalizedPath === '/projects') {
|
||||
const tree = await this.generateDirectoryTree(absolutePath, "", 1); // Only show immediate children
|
||||
return tree;
|
||||
}
|
||||
|
||||
// If it's a directory, generate a tree-like listing
|
||||
// Note: start_line and end_line are ignored for directories
|
||||
const tree = await this.generateDirectoryTree(absolutePath);
|
||||
|
||||
Reference in new issue
Block a user