feat: harden workspace file APIs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
c1b8982e3b
commit
04b309d3fc
@@ -22,3 +22,13 @@ type ReadFileResponse struct {
|
||||
Path string `json:"path"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// FileInfoResponse is the API response for file stat.
|
||||
// Path is always workspace-relative; host absolute paths are never exposed.
|
||||
type FileInfoResponse struct {
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
IsDir bool `json:"isDir"`
|
||||
Size int64 `json:"size"`
|
||||
ModTime string `json:"modTime"`
|
||||
}
|
||||
|
||||
@@ -9,3 +9,9 @@ type CreateWorkspaceRequest struct {
|
||||
type WorkspaceResponse struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
// WorkspaceListResponse is the API response for listing workspaces.
|
||||
// Root is never exposed.
|
||||
type WorkspaceListResponse struct {
|
||||
Workspaces []WorkspaceResponse `json:"workspaces"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user