feat: scaffold codespace backend

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
tao.chen
2026-07-02 15:07:54 +08:00
co-authored by Claude Fable 5
commit 411ed1f8ba
43 changed files with 4428 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package model
// WriteFileRequest is the request body for writing a file.
type WriteFileRequest struct {
Path string `json:"path"`
Content string `json:"content"`
}
// MkdirRequest is the request body for creating a directory.
type MkdirRequest struct {
Path string `json:"path"`
}
// RenameRequest is the request body for renaming a file or directory.
type RenameRequest struct {
OldPath string `json:"oldPath"`
NewPath string `json:"newPath"`
}
// ReadFileResponse is the API response for reading a file.
type ReadFileResponse struct {
Path string `json:"path"`
Content string `json:"content"`
}
+8
View File
@@ -0,0 +1,8 @@
package model
// ProcessStatusResponse is the API response for process status.
type ProcessStatusResponse struct {
WorkspaceID string `json:"workspaceId"`
Running bool `json:"running"`
PID int `json:"pid,omitempty"`
}
+11
View File
@@ -0,0 +1,11 @@
package model
// CreateWorkspaceRequest is the request body for creating a workspace.
type CreateWorkspaceRequest struct {
ID string `json:"id"`
}
// WorkspaceResponse is the API response for a workspace.
type WorkspaceResponse struct {
ID string `json:"id"`
}