File tree explorer UI
What problem or use case are you trying to solve? We'd like a way to show all the files/directories in the workspace
Describe the UX of the solution you'd like Something similar to VS code (screenshot)
Do you have thoughts on the technical implementation? We'll probably need to expose the file list via the API. This could be either:
- one endpoint that returns the results of
findin the workspace dir- maybe a good short-term solution
- an
lsendpoint that takes a path prefix- this is probably more scalable
we'll also need a separate endpoint for file contents.
@rbren I had a working solution for this that allows the terminal to accept input but I closed the pull request. Would you like me to open it? The code I have allows the user to write any command into the terminal including ls.
I'm game for a PR that accepts commands!
But I think that's a little separate from this issue--we probably don't want the FE to run ls specifically, then parse the output. Instead I think it'd be better to have an API endpoint that returns a JSON array of directories available
Just added a draft PR at #537 , check it out! :)
To run ls you would add a button to call endpoint ? There is also tree which will print a file tree to stdout.
I'm game for a PR that accepts commands!
But I think that's a little separate from this issue--we probably don't want the FE to run
lsspecifically, then parse the output. Instead I think it'd be better to have an API endpoint that returns a JSON array of directories available
I did a little investigation. We want 2 new endpoint get_file_tree and get_file_content just like /litellm-agents. If we plan to make it as endpoint. There is a problem how to simply share websocket session variable between different endpoint. Seems better make it as a action? But always add everything in action seems not a good thing in design.
I did a little investigation. We want 2 new endpoint get_file_tree and get_file_content just like /litellm-agents. If we plan to make it as endpoint. There is a problem how to simply share websocket session variable between different endpoint. Seems better make it as a action? But always add everything in action seems not a good thing in design.
Yeah this is a good point. I think making it a REST API (rather than sending an action) is better.
Currently we're tracking workspace_dir on the host machine, which we could list directly from python. But this will need serious refactoring for multi-tenant or multi-session support
@yufansong In #542 I started with a a new endpoint and ran into that problem as well. It should be okay to use the config workspace dir and container image to create a new DockerInteractive whenever the endpoint is called, without having to share the session. I agree adding everything to websocket is a bad design choice.
I'll try and get something working today.