跳到主要内容

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

浏览文件

build-macos-clipboard.sh

25 行 · 1.4 KB历史下载
1#!/bin/bash
2# Build the per-user clipboard agent and its bounded file-transfer helper.
3set -euo pipefail
4src=$(cd "$(dirname "$0")" && pwd)
5app=${1:?Specify a new output .app path}
6[[ $app == /*.app && ! -e $app ]] || { echo 'Choose a new absolute .app path.' >&2; exit 2; }
7mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
8cat > "$app/Contents/Info.plist" <<'PLIST'
9<?xml version="1.0" encoding="UTF-8"?>
10<plist version="1.0"><dict>
11<key>CFBundleIdentifier</key><string>dev.cage.GuestClipboard</string>
12<key>CFBundleName</key><string>Cage Guest Clipboard</string>
13<key>CFBundleExecutable</key><string>CageGuestClipboard</string>
14<key>CFBundlePackageType</key><string>APPL</string>
15<key>CFBundleShortVersionString</key><string>1.0</string>
16<key>CFBundleVersion</key><string>1</string>
17<key>LSUIElement</key><true/>
18</dict></plist>
19PLIST
20xcrun swiftc -parse-as-library -O -target arm64-apple-macos14.0 "$src/guest-clipboard-macos.swift" "$src/macos-diagnostics.swift" -o "$app/Contents/MacOS/CageGuestClipboard"
21(cd "$src/../.." && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags '-s -w' -o "$app/Contents/Resources/cage-guest-files" ./cmd/cage-guest-files)
22identity=${CAGE_GUEST_SIGN_IDENTITY:-${CAGE_SIGNING_IDENTITY:--}}
23codesign --force --sign "$identity" "$app/Contents/Resources/cage-guest-files"
24codesign --force --sign "$identity" --identifier dev.cage.GuestClipboard "$app"
25codesign --verify --deep --strict "$app"