跳到主要内容

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

浏览文件

build-macos-guest-core.sh

32 行 · 1.1 KB历史下载
1#!/bin/bash
2# Add the small raw-object accessor needed by the hostagent's AppKit view to a
3# private copy of the pinned VZ binding. The Go module cache stays read-only.
4set -euo pipefail
5cd "$(dirname "$0")/../.."
6work=$(mktemp -d)
7trap 'rm -rf "$work"' EXIT
8mod=github.com/Code-Hex/vz/v3
9version=$(go list -m -f '{{.Version}}' "$mod")
10[[ $version == v3.7.1 ]] || { echo "Review the login view against VZ binding $version" >&2; exit 1; }
11go mod download "$mod"
12dir=$(go list -m -f '{{.Dir}}' "$mod")
13[[ -n "$dir" && -d "$dir" ]] || { echo 'VZ binding source is unavailable after download.' >&2; exit 1; }
14cp -R "$dir" "$work/vz"
15chmod -R u+w "$work/vz"
16cat > "$work/vz/cage_view_object_darwin.go" <<'GO'
17//go:build darwin && cgo
18
19package vz
20
21import (
22 "unsafe"
23 "github.com/Code-Hex/vz/v3/internal/objc"
24)
25
26// CageViewObject borrows the VZVirtualMachine for the duration of RunGUI.
27func (v *VirtualMachine) CageViewObject() unsafe.Pointer { return objc.Ptr(v) }
28GO
29cp go.mod "$work/trial.mod"
30cp go.sum "$work/trial.sum"
31go mod edit -modfile "$work/trial.mod" -replace "$mod=$work/vz"
32GOFLAGS="${GOFLAGS:-} -modfile=$work/trial.mod" make cage VERSION="$1"