跳到主要内容

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

浏览文件

build-macos-claude-window.sh

31 行 · 2.1 KB历史下载
1#!/bin/bash
2# Build the GUI-session helper for an Apple-silicon guest (macOS 14+).
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 .app path.' >&2; exit 2; }
7mkdir -p "$app/Contents/MacOS"
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.GuestClaudeWindow</string>
12<key>CFBundleName</key><string>Cage Guest Window</string>
13<key>CFBundleExecutable</key><string>CageGuestWindow</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<key>CFBundleDocumentTypes</key><array><dict>
19<key>CFBundleTypeName</key><string>Cage project file</string>
20<key>CFBundleTypeRole</key><string>Viewer</string>
21<key>LSHandlerRank</key><string>None</string>
22<key>LSItemContentTypes</key><array><string>public.data</string></array>
23</dict></array>
24</dict></plist>
25PLIST
26objects=$(mktemp -d)
27trap 'rm -rf "$objects"' EXIT
28xcrun clang -target arm64-apple-macos14.0 -Wall -Wextra -Werror -O2 -c "$src/macos-file-writers.c" -o "$objects/file-writers.o"
29xcrun swiftc -parse-as-library -D GUEST_WINDOW_APP -O -target arm64-apple-macos14.0 "$src/../../desktop/MacKeyboard.swift" "$src/claude-window-macos.swift" "$src/macos-diagnostics.swift" "$src/macos-claude-window-app.swift" "$src/macos-window-input.swift" "$src/macos-maintenance.swift" "$src/macos-setup-password.swift" "$src/macos-project-panel.swift" "$src/macos-claude-canvas.swift" "$src/macos-window-stream.swift" "$src/macos-audio.swift" "$src/macos-gui-session.swift" "$src/macos-phone-desktop.swift" "$src/macos-desktop-files.swift" "$src/macos-desktop-downloads.swift" "$src/macos-native-open.swift" "$objects/file-writers.o" -lbsm -o "$app/Contents/MacOS/CageGuestWindow"
30codesign --force --sign "${CAGE_GUEST_SIGN_IDENTITY:-${CAGE_SIGNING_IDENTITY:--}}" --identifier dev.cage.GuestClaudeWindow "$app"
31codesign --verify --strict "$app"