跳到主要内容

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

提交记录
修改packaging/windows/installation-files.ps1+2 −1看文件
@@ -150,7 +150,8 @@ function Complete-Transfer {
150150 $relative = if ($entry.state -eq 'moved') { $entry.destination } else { $entry.path }
151151 if (!(Get-Item -LiteralPath (Join-Path $Target $relative) -Force -ErrorAction SilentlyContinue)) { throw ('个人文件尚未恢复,事务回执已保留:' + $relative) }
152152 }
153删除: $hash = (Get-FileHash -LiteralPath $Receipt -Algorithm SHA256).Hash
153新增: $receiptStream = Open-ReadLocked $Receipt
154新增: try { $hash = Stream-Hash $receiptStream } finally { $receiptStream.Dispose() }
154155 Remove-MatchingFile (Split-Path $Receipt -Parent) (Split-Path $Receipt -Leaf) $hash
155156 if (Test-Path -LiteralPath $Receipt) { throw '安装回执在完成期间发生变化,已保留待核对。' }
156157}
修改scripts/ci-windows-build.ps1+3 −1看文件
@@ -53,7 +53,9 @@ try {
5353 Invoke-BuildTool 'node' @('--test', 'internal/cage/browser-clipboard.test.mjs', 'scripts/windows-native-bridge.test.mjs')
5454 Invoke-BuildTool (Get-BuildCommand @('pwsh.exe', 'pwsh')) @('-NoProfile', '-NonInteractive', '-File', 'scripts/windows-workbench-smoke.test.ps1')
5555 $windowsPowerShell = Join-Path ([Environment]::SystemDirectory) 'WindowsPowerShell/v1.0/powershell.exe'
56删除: & (Join-Path $PSScriptRoot 'test-windows-installation-files.ps1') -HelperShell $windowsPowerShell -InstallerSmoke
56新增: # NSIS is x86 and resolves $SYSDIR to SysWOW64. Match its real helper host.
57新增: $installationPowerShell = Join-Path $env:SystemRoot 'SysWOW64/WindowsPowerShell/v1.0/powershell.exe'
58新增: & (Join-Path $PSScriptRoot 'test-windows-installation-files.ps1') -HelperShell $installationPowerShell -InstallerSmoke
5759 if ($Release) {
5860 & (Join-Path $PSScriptRoot 'prepare-qemu-release.ps1')
5961 $qemuSource = Join-Path $repository '_output/windows-qemu-sources/full-source.tar.gz'
修改scripts/test-windows-installation-files.ps1+14 −3看文件
@@ -44,10 +44,21 @@ function App([string]$Path, [string]$Version) {
4444 })
4545 @{version = 1; files = $files} | ConvertTo-Json -Depth 4 | Set-Content (Join-Path $Path 'Cage.install-files.json')
4646}
47删除:function Invoke-Helper([string[]]$Arguments, [int]$Expected = 0) {
47新增:function Invoke-Helper([string[]]$Arguments, [int]$Expected = 0, [switch]$WithoutFileHash) {
48新增: $entry = $helper
49新增: if ($WithoutFileHash) {
50新增: $entry = Join-Path $root 'helper-without-filehash.ps1'
51新增: Write-File $entry @'
52新增:$ErrorActionPreference = 'Stop'
53新增:function global:Get-FileHash { throw [Management.Automation.CommandNotFoundException]::new('Get-FileHash is intentionally unavailable in this native helper fixture.') }
54新增:$remaining = @($args | Select-Object -Skip 1)
55新增:& $args[0] @remaining
56新增:'@
57新增: $Arguments = @($helper) + $Arguments
58新增: }
4859 try {
4960 $ErrorActionPreference = 'Continue'
50删除: $output = & $HelperShell -NoProfile -File $helper @Arguments 2>&1 | Out-String
61新增: $output = & $HelperShell -NoProfile -File $entry @Arguments 2>&1 | Out-String
5162 } finally { $ErrorActionPreference = 'Stop' }
5263 if ($LASTEXITCODE -ne $Expected) { throw "Helper returned $LASTEXITCODE, expected $Expected. $output" }
5364}
@@ -126,7 +137,7 @@ try {
126137 $transfer = Get-Content -LiteralPath $receipt -Raw | ConvertFrom-Json
127138 Check (!$transfer.backupPath -and @($transfer.moves).Count -eq 0) 'First install invented a backup or personal file transfer.'
128139 [IO.Directory]::Delete($old); [IO.Directory]::Move($stage, $old)
129删除: Invoke-Helper @('-Operation','complete','-Target',$old,'-Receipt',$receipt)
140新增: Invoke-Helper @('-Operation','complete','-Target',$old,'-Receipt',$receipt) -WithoutFileHash
130141 Check (!(Test-Path -LiteralPath $receipt)) 'First install did not finish its transaction.'
131142
132143 $diagnostic = Join-Path $scenario 'diagnostic.json'