跳到主要内容

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

提交记录
修改CHANGELOG.md+1 −1看文件
@@ -1,6 +1,6 @@
11# Changelog
22
3删除:## Unreleased
3新增:## 0.2.1
44
55### Added
66
修改agent-vm.sh+1 −1看文件
@@ -21,7 +21,7 @@ fi
2121
2222# Semantic version of this file. Bumped by hand on release. Integrators gate on
2323# it via `agent-vm version`; a build with no `version` command predates it.
24删除:AGENT_VM_VERSION="0.2.0"
24新增:AGENT_VM_VERSION="0.2.1"
2525
2626AGENT_VM_TEMPLATE="agent-vm-base"
2727# Overridable, for a test or a second install, without moving HOME (and
修改lib/git.sh+4 −3看文件
@@ -393,9 +393,10 @@ _agent_vm_git_scan() {
393393_agent_vm_git_scan_lines() {
394394 local shares proj home s kind at i n=0 hooks hp top h f t in_repo name shown
395395 local hit_share hit_rel top_share top_rel names="$_AGENT_VM_BASE_NAMES"
396删除: local _agent_vm_windows_memo=0 _agent_vm_nocase_memo=0 kinds=() ats=() hookss=() tops=()
397删除: _agent_vm_on_windows && _agent_vm_windows_memo=1
398删除: _agent_vm_fs_nocase && _agent_vm_nocase_memo=1
396新增: # Empty while asked: the memos are what the two functions read first.
397新增: local _agent_vm_windows_memo="" _agent_vm_nocase_memo="" kinds=() ats=() hookss=() tops=()
398新增: _agent_vm_on_windows && _agent_vm_windows_memo=1 || _agent_vm_windows_memo=0
399新增: _agent_vm_fs_nocase && _agent_vm_nocase_memo=1 || _agent_vm_nocase_memo=0
399400 shares="$(_agent_vm_writable_shares "$1")"
400401 [[ -n "$shares" ]] || return 0
401402 proj="${shares%%$'\n'*}"
修改lib/mounts.sh+4 −3看文件
@@ -92,9 +92,10 @@ _agent_vm_project_mountpoint() {
9292_agent_vm_volume_entries() {
9393 local host_dir="$1" raw line mounts_file="$AGENT_VM_STATE_DIR/volumes" why mp proj_mp seen_mps=$'\n'
9494 [[ -f "$mounts_file" ]] || return 0
95删除: local _agent_vm_unsafe_refs _agent_vm_windows_memo=0 _agent_vm_nocase_memo=0
96删除: _agent_vm_on_windows && _agent_vm_windows_memo=1
97删除: _agent_vm_fs_nocase && _agent_vm_nocase_memo=1
95新增: # Empty while asked: the memos are what the two functions read first.
96新增: local _agent_vm_unsafe_refs _agent_vm_windows_memo="" _agent_vm_nocase_memo=""
97新增: _agent_vm_on_windows && _agent_vm_windows_memo=1 || _agent_vm_windows_memo=0
98新增: _agent_vm_fs_nocase && _agent_vm_nocase_memo=1 || _agent_vm_nocase_memo=0
9899 _agent_vm_unsafe_refs="$(_agent_vm_unsafe_ref_dirs)"
99100 proj_mp="$(_agent_vm_path_join / "$host_dir")"
100101 while IFS= read -r raw || [[ -n "$raw" ]]; do
修改tests/13-volumes-and-readonly.sh+7 −0看文件
@@ -307,6 +307,13 @@ check "volumes: covering the project or merged with another, whatever the spelli
307307 "$(printf '%s\n' "$vols_err" | grep -c 'covers the project')/$(printf '%s\n' "$vols_err" | grep -c 'as an entry before it')" "3/1"
308308check "volumes: the first at a place is kept, its destination normalized" "$vols" "$SB/vol-ok|/mnt/d|ro|$SB/vol-ok:/mnt/d:ro"
309309rm -rf "$SB/vol-ok" "$SB/vol-ok2" "$SB/cov" "$HOME/.agent-vm/volumes"
310新增:# Where case is ignored, a volume holding the home directory spelled with
311新增:# other capitals is refused all the same.
312新增:mkdir -p "$SB/CaseVol"
313新增:printf '%s:/mnt/c:ro\n' "$SB/CaseVol" > "$HOME/.agent-vm/volumes"
314新增:out="$( HOME="$SB/casevol/home"; uname() { echo Darwin; }; _agent_vm_volume_entries "$PROJ" 2>&1 )"
315新增:case "$out" in *"is, or contains, your home directory"*) pass "volumes: the home directory in other capitals, where case is ignored: refused" ;; *) fail "volumes: case: $out" ;; esac
316新增:rm -rf "$SB/CaseVol" "$HOME/.agent-vm/volumes"
310317# A repository's own folder: refused writable, where the VM would write its
311318# hooks and config, not read-only.
312319mkdir -p "$SB/bare.git/objects" "$SB/bare.git/refs" && : > "$SB/bare.git/HEAD"
修改tests/14-git-protection.sh+20 −9看文件
@@ -493,6 +493,11 @@ if command -v git >/dev/null 2>&1; then
493493 ( _agent_vm_fs_nocase() { return 1; }; _agent_vm_rel_in /Work/Proj/x /work/proj ) >/dev/null \
494494 && fail "a path in other capitals counted as inside where case matters" \
495495 || pass "and not where case matters"
496新增: # The same through a whole scan.
497新增: hp "$(printf '%s' "$PROJ" | tr '[:lower:]' '[:upper:]')/.husky/_"
498新增: check "hooks: a hooks path in other capitals is named, where case is ignored" \
499新增: "$( uname() { echo Darwin; }; names )" '[".git", ".hg", ".husky"]'
500新增: hp .husky/_
496501
497502 # A repository below the project has hooks of its own.
498503 mkdir -p "$PROJ/lib/inner"
@@ -584,7 +589,7 @@ if command -v git >/dev/null 2>&1; then
584589 && git -C "$VREPO" config core.fsmonitor ./fsmon.sh )
585590 printf '%s:/mnt/vrepo:rw\n' "$VREPO" > "$HOME/.agent-vm/volumes"
586591 check "volumes: a writable volume's hooks folder joins the names" "$(names)" '[".git", ".hg", ".husky", "tools"]'
587删除: case "$(_agent_vm_share_hooks "$PROJ")" in *"$VREPO/tools/hooks"*) pass "volumes: named by the volume's path" ;; *) fail "volumes: hooks: $(_agent_vm_share_hooks "$PROJ")" ;; esac
592新增: case "$(_agent_vm_share_hooks "$PROJ")" in *"$(_agent_vm_git_spelling "$VREPO")/tools/hooks"*) pass "volumes: named by the volume's path" ;; *) fail "volumes: hooks: $(_agent_vm_share_hooks "$PROJ")" ;; esac
588593 case "$(_agent_vm_share_config_risks "$PROJ")" in
589594 *"core.fsmonitor = ./fsmon.sh"*) pass "volumes: its config naming a command in it is a risk" ;;
590595 *) fail "volumes: risks: $(_agent_vm_share_config_risks "$PROJ")" ;;
@@ -599,9 +604,11 @@ if command -v git >/dev/null 2>&1; then
599604 VOL="$SB/teamtools"
600605 mkdir -p "$VOL/hooks"
601606 printf '%s:/mnt/teamtools:rw\n' "$VOL" > "$HOME/.agent-vm/volumes"
602删除: ( git -C "$PROJ" config core.fsmonitor "$VOL/fsmon.sh" && git -C "$PROJ" config include.path "$VOL/gitconfig" )
607新增: # Paths as git spells them: Git Bash hands git C:/... for /c/...
608新增: VOLG="$(_agent_vm_git_spelling "$VOL")"
609新增: ( git -C "$PROJ" config core.fsmonitor "$VOLG/fsmon.sh" && git -C "$PROJ" config include.path "$VOLG/gitconfig" )
603610 case "$(_agent_vm_share_config_risks "$PROJ")" in
604删除: *"core.fsmonitor = $VOL/fsmon.sh"*"config file $VOL/gitconfig"*|*"config file $VOL/gitconfig"*"core.fsmonitor = $VOL/fsmon.sh"*)
611新增: *"core.fsmonitor = $VOLG/fsmon.sh"*"config file $VOLG/gitconfig"*|*"config file $VOLG/gitconfig"*"core.fsmonitor = $VOLG/fsmon.sh"*)
605612 pass "volumes: the project's config naming a command and a file in a volume" ;;
606613 *) fail "volumes: cross: $(_agent_vm_share_config_risks "$PROJ")" ;;
607614 esac
@@ -612,15 +619,19 @@ if command -v git >/dev/null 2>&1; then
612619 mkdir -p "$VOL/git"
613620 printf '[core]\n\tfsmonitor = %s/fsmon.sh\n' "$VOL" > "$VOL/git/config"
614621 case "$( XDG_CONFIG_HOME="$VOL" _agent_vm_share_config_risks "$PROJ" )" in
615删除: *"config file $VOL/git/config"*) pass "volumes: git's own config kept in a volume" ;;
622新增: *"config file $VOLG/git/config"*) pass "volumes: git's own config kept in a volume" ;;
616623 *) fail "volumes: global: $( XDG_CONFIG_HOME="$VOL" _agent_vm_share_config_risks "$PROJ" )" ;;
617624 esac
618625 # A volume reached through a symlink is searched all the same.
619删除: mkdir -p "$SB/data/code/app"
620删除: ln -s "$SB/data/code" "$SB/code-link"
621删除: ( git -C "$SB/data/code/app" init -q && git -C "$SB/data/code/app" config core.hooksPath .husky/_ )
622删除: printf '%s:/mnt/code:rw\n' "$SB/code-link" > "$HOME/.agent-vm/volumes"
623删除: case "$(_agent_vm_share_hooks "$PROJ")" in *"$SB/data/code/app/.husky/_"*) pass "volumes: a volume through a symlink is searched" ;; *) fail "volumes: symlinked: $(_agent_vm_share_hooks "$PROJ")" ;; esac
626新增: if [ -n "$AGENT_VM_HAS_SYMLINKS" ]; then
627新增: mkdir -p "$SB/data/code/app"
628新增: ln -s "$SB/data/code" "$SB/code-link"
629新增: ( git -C "$SB/data/code/app" init -q && git -C "$SB/data/code/app" config core.hooksPath .husky/_ )
630新增: printf '%s:/mnt/code:rw\n' "$SB/code-link" > "$HOME/.agent-vm/volumes"
631新增: case "$(_agent_vm_share_hooks "$PROJ")" in *"$(_agent_vm_git_spelling "$SB/data/code/app")/.husky/_"*) pass "volumes: a volume through a symlink is searched" ;; *) fail "volumes: symlinked: $(_agent_vm_share_hooks "$PROJ")" ;; esac
632新增: else
633新增: printf ' skip a volume through a symlink (no symlinks here)\n'
634新增: fi
624635 # The project inside a writable volume: each folder once, named from the
625636 # project.
626637 mkdir -p "$SB/up/app"