跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录
修改internal/workbench/browser_workspaces.go+3 −1看文件
@@ -85,7 +85,9 @@ func (s *Server) browserStateForHost(body []byte) ([]byte, error) {
8585 byGuest := make(map[string]string, len(authorized))
8686 for _, hostPath := range authorized {
8787 if s.macosGuest != nil {
88删除: byGuest[macOSProjectPath(s.macosGuest.User, hostPath)] = hostPath
88新增: guestPath := macOSProjectPath(s.macosGuest.User, hostPath)
89新增: byGuest[guestPath] = hostPath
90新增: byGuest[filepath.Base(guestPath)] = hostPath
8991 } else {
9092 byGuest[guestPath(hostPath)] = hostPath
9193 }
修改internal/workbench/project_remove_test.go+33 −0看文件
@@ -1,10 +1,12 @@
11package workbench
22
33import (
4新增: "context"
45 "encoding/json"
56 "io"
67 "net/http"
78 "os"
9新增: "os/exec"
810 "path/filepath"
911 "slices"
1012 "strings"
@@ -253,3 +255,34 @@ func TestAgentProjectRemovalUsesSharedOwner(t *testing.T) {
253255 t.Fatal("agent removal did not revoke grant", err)
254256 }
255257}
258新增:
259新增:func TestProjectRemovalRejectsRestoredMacOSEditor(t *testing.T) {
260新增: s := testServer(t)
261新增: root, _ := filepath.EvalSymlinks(t.TempDir())
262新增: s.macosGuest = &guestos.MacOSProfile{Instance: "mac", User: "guestdev"}
263新增: s.ready = true
264新增: s.preferences.ClaudeTerminalCommand = "custom-shell"
265新增: if err := s.rememberSharedProject(root); err != nil {
266新增: t.Fatal(err)
267新增: }
268新增: client := fixtureWindowsBrowserClient(t)
269新增: start := client.start
270新增: client.start = func(ctx context.Context) (*exec.Cmd, error) {
271新增: command, err := start(ctx)
272新增: if err == nil {
273新增: command.Env = append(command.Env, "CAGE_BROWSER_EDITOR_WORKSPACE="+filepath.Base(macOSProjectPath(s.macosGuest.User, root)))
274新增: }
275新增: return command, err
276新增: }
277新增: s.windowsBrowserControl = client
278新增: body, err := s.browserAction(t.Context(), "tabs", nil)
279新增: var state struct {
280新增: Tabs []struct {
281新增: Workspace string `json:"workspace"`
282新增: } `json:"tabs"`
283新增: }
284新增: if err != nil || json.Unmarshal(body, &state) != nil || len(state.Tabs) != 1 || state.Tabs[0].Workspace != root {
285新增: t.Fatal("restored editor lost host workspace", string(body), err)
286新增: }
287新增: removeProjectRequest(t, s, root, 409)
288新增:}
修改internal/workbench/windows_browser_client_test.go+3 −0看文件
@@ -50,6 +50,9 @@ func TestWindowsBrowserRelayHelper(t *testing.T) {
5050 time.Sleep(time.Hour)
5151 case "/tabs":
5252 result = map[string]any{"active": "tab", "tabs": []any{}}
53新增: if workspace := os.Getenv("CAGE_BROWSER_EDITOR_WORKSPACE"); workspace != "" {
54新增: result = map[string]any{"active": "tab", "tabs": []any{map[string]any{"id": "tab", "kind": "editor", "workspace": workspace, "blocked": true}}}
55新增: }
5356 case "/events":
5457 result = map[string]any{"sequence": 2, "events": []any{}}
5558 if request.Input.After == 2 {