跳到主要内容

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

浏览文件

build-windows-workbench-payload.ps1

42 行 · 2.9 KB历史下载
1# Build Cage-owned assets only. Third-party Windows packages are fetched when
2# Windows is selected, with the digests in windows-workbench-packages.json.
3[CmdletBinding()]
4param([Parameter(Mandatory)][string]$Destination)
5$ErrorActionPreference='Stop'
6$root=(Resolve-Path (Join-Path $PSScriptRoot '../..')).Path
7$dest=[IO.Path]::GetFullPath($Destination)
8$null=New-Item -ItemType Directory -Force $dest
9$build=Join-Path ([IO.Path]::GetTempPath()) ('cage-windows-publish-'+[guid]::NewGuid())
10Push-Location $root
11$oldOS=$env:GOOS; $oldArch=$env:GOARCH; $oldCGO=$env:CGO_ENABLED
12try {
13 dotnet publish scripts/guest-os/guest-clipboard-windows/Cage.GuestClipboard.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o $build
14 if ($LASTEXITCODE) {throw 'Could not publish the native Windows guest bridge.'}
15 Copy-Item -LiteralPath (Join-Path $build 'Cage.GuestClipboard.exe') -Destination $dest
16 $env:GOOS='windows'; $env:GOARCH='amd64'; $env:CGO_ENABLED='0'
17 go build -trimpath -o (Join-Path $dest 'cage-guest-files.exe') ./cmd/cage-guest-files
18 if ($LASTEXITCODE) {throw 'Could not build the Windows guest file helper.'}
19 go build -trimpath -o (Join-Path $dest 'cage-guest-boot.exe') ./cmd/cage-guest-boot
20 if ($LASTEXITCODE) {throw 'Could not build the Windows guest boot service.'}
21 go build -trimpath -o (Join-Path $dest 'Cage.HyperVManager.exe') ./cmd/cage-hyperv-manager
22 if ($LASTEXITCODE) {throw 'Could not build the scoped Windows host manager.'}
23 Push-Location (Join-Path $root 'tools/tailnet')
24 try { go build -trimpath -ldflags '-s -w' -o (Join-Path $dest 'cage-tailnet.exe') .; if ($LASTEXITCODE) { throw 'Could not build Cage Tailscale.' } } finally { Pop-Location }
25 Copy-Item -LiteralPath (Join-Path $root 'internal/cage/tailnet-client.mjs') -Destination $dest
26 foreach ($file in @('windows-browser.mjs','windows-browser-extensions.mjs','windows-phone-browser.mjs','windows-workbench-packages.json','install-windows-workbench-user-tools.ps1')) {
27 Copy-Item -LiteralPath (Join-Path $PSScriptRoot $file) -Destination $dest
28 }
29 foreach ($file in @('install-cli.ps1','cli-dependencies.json')) {
30 Copy-Item -LiteralPath (Join-Path $PSScriptRoot ('guest-clipboard-windows/'+$file)) -Destination $dest
31 }
32 $moduleDir=Join-Path $dest 'modules'
33 $null=New-Item -ItemType Directory -Force $moduleDir
34 foreach ($name in @('clipboard','uploads','downloads','cookies','extensions','vault','phone','phone-network')) {
35 Copy-Item -LiteralPath (Join-Path $root "internal/cage/browser-$name.mjs") -Destination $moduleDir
36 }
37 Copy-Item -LiteralPath (Join-Path $root 'internal/cage/split-extension') -Destination $dest -Recurse -Force
38} finally {
39 $env:GOOS=$oldOS; $env:GOARCH=$oldArch; $env:CGO_ENABLED=$oldCGO
40 Pop-Location
41 if (Test-Path -LiteralPath $build) { Remove-Item -LiteralPath $build -Recurse -Force }
42}