跳到主要内容

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

浏览文件

package-macos-guest.sh

43 行 · 2.9 KB历史下载
1#!/bin/bash
2# Bundle the first-party helpers. User-selected OS and application media are
3# downloaded during installation and are never taken from a developer's VM.
4set -euo pipefail
5[[ $# == 1 && $1 == /* && ! -e $1 ]]
6src=$(cd "$(dirname "$0")" && pwd)
7dest=$1
8work=$(mktemp -d)
9trap 'rm -rf "$work"' EXIT
10mkdir -p "$dest/project"
11bash "$src/build-macos-project-access.sh" "$dest/project/CageProjectAccess.app"
12bash "$src/build-macos-claude-window.sh" "$dest/Cage Guest Window.app"
13bash "$src/build-macos-clipboard.sh" "$dest/Cage Guest Clipboard.app"
14xcrun clang -arch arm64 -O2 -fobjc-arc -framework Foundation "$src/macos-project-terminal.m" -o "$dest/project/cage-macos-terminal"
15codesign -f -s "${CAGE_SIGNING_IDENTITY:--}" "$dest/project/cage-macos-terminal"
16fuse="$work/macfuse.dmg"
17if [[ -n ${CAGE_BUILD_MACFUSE_DMG:-} ]]; then
18 fuse=$CAGE_BUILD_MACFUSE_DMG
19else
20 curl -fLsS --proto '=https' --proto-redir '=https' --retry 2 https://github.com/macfuse/macfuse/releases/download/macfuse-5.5.0/macfuse-5.5.0.dmg -o "$fuse"
21fi
22bash "$src/macos-fuse-media.sh" "$fuse" "$work/fuse.pkg"
23pkgutil --expand-full "$work/fuse.pkg" "$work/sdk"
24bash "$src/build-macos-sshfs.sh" "$work/sdk/Core.pkg/Payload/usr/local" "$dest/project/cage-sshfs" "$work/sshfs-source"
25xcrun clang -arch arm64 -mmacosx-version-min=14.0 -O2 -fobjc-arc -framework Foundation -framework OpenDirectory \
26 "$src/macos-setup-account.m" -o "$dest/cage-finish-initial-setup"
27xcrun clang -arch arm64 -O2 "$src/macos-ipv6-check.c" -o "$dest/cage-macos-ipv6-check"
28bash "$src/package-macos-browser.sh" "$dest/native-browser"
29for f in prepare-macos-media.sh macos-cli.py prepare-macos-cli-kit.sh install-macos-cli.sh claude-desktop-macos.sh install-macos-browser.sh install-macos-node.sh install-macos-project-tools.sh register-macos-claude-window.sh register-macos-clipboard.sh register-macos-browser.sh macos-browser.mjs cage-macos-editor macos-fuse-media.sh provision-macos-workbench.sh; do
30 cp "$src/$f" "$dest/"
31done
32cp "$src/../../internal/cage/claude-account.py" "$src/../../internal/workbench/"{cli_channel.py,cli_channel.resume.md,claude_account_resume.md} "$dest/"
33# Shared component maintenance is installed separately from first-run accounts.
34cp "$src/maintain-macos-workbench.sh" "$src/native-component-manifest.pl" "$dest/"
35cp "$src/configure-macos-session.sh" "$dest/"
36# Final signing runs after every helper has been built. Component manifests are
37# computed from these final bytes by RequiredNativeComponents at installation.
38bash "$src/sign-macos-guest.sh" "$dest" "${CAGE_SIGNING_IDENTITY:--}"
39# Bind the source distribution to the final Developer ID bytes, after the kit
40# has signed SSHFS. The outer host App signature does not change this helper.
41version=$(tr -d '\n\r' < "$src/../../VERSION")
42node "$src/collect-macos-sshfs-sources.mjs" finish "$work/sshfs-source" "$dest/project/cage-sshfs" \
43 "$dest/sources/cage-macos-guest-$version-source.tar.gz" "$dest/licenses/sshfs"