跳到主要内容

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

提交记录
修改.github/workflows/linux-build.yml+2 −2看文件
@@ -29,12 +29,12 @@ jobs:
2929 image: ubuntu:22.04
3030 # docker-default AppArmor denies bubblewrap's private mount namespace.
3131 # Relax only this disposable outer container; WebKit keeps its sandbox.
32删除: options: --security-opt seccomp=unconfined --security-opt systempaths=unconfined --security-opt apparmor=unconfined
32新增: options: --init --security-opt seccomp=unconfined --security-opt systempaths=unconfined --security-opt apparmor=unconfined
3333 steps:
3434 - name: Install build and test dependencies
3535 run: |
3636 apt-get update
37删除: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libjson-glib-dev dpkg-dev curl ca-certificates git software-properties-common qemu-system-x86 qemu-utils ovmf openssh-client iproute2 dbus-x11 xvfb xauth fonts-noto-cjk zsh sudo
37新增: DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libjson-glib-dev dpkg-dev curl ca-certificates git software-properties-common qemu-system-x86 qemu-utils ovmf openssh-client iproute2 dbus-x11 xvfb xauth fonts-noto-cjk zsh sudo tzdata
3838 # The supported 22.04 ABI predates safe.bareRepository. Use the Git
3939 # project's documented Ubuntu packages, preserving the runtime gate.
4040 add-apt-repository -y ppa:git-core/ppa
修改internal/workbench/claude_desktop_resize_unix_test.go+11 −5看文件
@@ -18,10 +18,15 @@ func TestDesktopResizeScriptAppliesTheViewersDensity(t *testing.T) {
1818 if runtime.GOOS != "linux" || err != nil {
1919 t.Skip("the script identifies its settings manager through /proc")
2020 }
21删除: // Go's temporary directory can be mounted noexec; the stand-ins must run.
22删除: root, err := os.MkdirTemp("/dev/shm", "cage-resize-")
21新增: // go test already executes its test binary from this filesystem. Both
22新增: // TMPDIR and /dev/shm can be mounted noexec independently of the Go build directory.
23新增: executable, err := os.Executable()
2324 if err != nil {
24删除: root = t.TempDir()
25新增: t.Fatal(err)
26新增: }
27新增: root, err := os.MkdirTemp(filepath.Dir(executable), "cage-resize-")
28新增: if err != nil {
29新增: t.Fatal(err)
2530 }
2631 t.Cleanup(func() { os.RemoveAll(root) })
2732 desktop, phone, bin := filepath.Join(root, "desktop"), filepath.Join(root, "phone"), filepath.Join(root, "bin")
@@ -40,9 +45,10 @@ func TestDesktopResizeScriptAppliesTheViewersDensity(t *testing.T) {
4045 data, _ := os.ReadFile(path)
4146 return string(data)
4247 }
43删除: write(filepath.Join(bin, "xrandr"), "#!/bin/sh\necho \"$*\" >> "+filepath.Join(root, "modes")+"\n", 0o700)
48新增: t.Setenv("CAGE_RESIZE_FIXTURE", root)
49新增: write(filepath.Join(bin, "xrandr"), "#!/bin/sh\necho \"$*\" >> \"$CAGE_RESIZE_FIXTURE/modes\"\n", 0o700)
4450 // The script signals a process named xsettingsd.
45删除: write(filepath.Join(bin, "xsettingsd"), "#!/bin/sh\ntrap 'echo reload >> "+filepath.Join(root, "reloads")+"' HUP\nwhile :; do sleep 1 & wait $!; done\n", 0o700)
51新增: write(filepath.Join(bin, "xsettingsd"), "#!/bin/sh\ntrap 'echo reload >> \"$CAGE_RESIZE_FIXTURE/reloads\"' HUP\nwhile :; do sleep 1 & wait $!; done\n", 0o700)
4652 resize := func(scale string) string {
4753 t.Helper()
4854 script := strings.NewReplacer("/run/cage-desktop", desktop, "/run/cage-phone-desktop", phone).Replace(desktopResizeScript(1000, 800, scale))
修改scripts/guest-os/setup-windows-guest.ps1+2 −0看文件
@@ -91,6 +91,8 @@ finally { if ($progressStream) { $progressStream.Dispose() } }
9191 try{
9292 if($context){Wait-CageHostEnrollment $context $worker}
9393 $process=Start-Process -FilePath (Join-Path ([Environment]::GetFolderPath('System')) 'WindowsPowerShell/v1.0/powershell.exe') -ArgumentList @('-NoLogo','-NoProfile','-ExecutionPolicy','RemoteSigned','-EncodedCommand',$encoded) -Verb RunAs -PassThru
94新增: # Windows PowerShell 5.1 must retain a handle before waiting to read ExitCode.
95新增: $null=$process.Handle
9496 if($context){Set-CageHostEnrollmentAdmin $context $process}
9597 Wait-CageWindowsInstaller $process $progressFile
9698 if($process.ExitCode -ne 0){throw 'Windows setup did not complete; existing VM and data were preserved.'}
修改scripts/guest-os/windows-iso-setup.tests.ps1+1 −0看文件
@@ -84,6 +84,7 @@ try {
8484 $encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($command))
8585 $child = Start-Process -FilePath (Get-Process -Id $PID).Path -ArgumentList @('-NoLogo','-NoProfile','-NonInteractive','-EncodedCommand',$encoded) -RedirectStandardOutput $stdout -RedirectStandardError $stderr -PassThru
8686 try {
87新增: $null = $child.Handle
8788 $forwarded = @(Wait-CageWindowsInstaller $child $progressFile)
8889 Assert-Check ($child.ExitCode -eq 0) ('Encoded installer wrapper failed. '+[IO.File]::ReadAllText($stderr))
8990 Assert-Check ($forwarded[-1] -ceq 'CAGE_GUEST_STAGE windows-11 oobe') 'The actual child could not publish its final stage.'