8a3abff2d6
- lib.sh: TMUX_SERVER_NAME env var, _tmux helper, shim externalized to TMPDIR with recursive guard, resolve_tmux_server helper for YAML-driven server routing - multi-agent-create: --tmux-server opt-in flag, YAML tmux_server field for orphan prevention - multi-agent-delete/resume/status/agent-sessions-monitor: use resolve_tmux_server to auto-route to correct isolated server - SKILL.md × 4: documented isolation server workflow - Verified by claude review (R1+re-run) + agy R2 patches (orphan prevention + shim location fix)
41 lines
1.3 KiB
Bash
Executable File
41 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# resolve_session_id.sh — multi-agent-resume 의 부속 스크립트
|
|
# Usage:
|
|
# bash resolve_session_id.sh --workspace <path> --agent <claude|agy>
|
|
# 출력: stdout 으로 UUID 한 줄 (없으면 빈 줄 + exit 0)
|
|
#
|
|
# P0-C: 전역 agent_identities 를 즉시 반환하지 않는다. lib.sh::find_workspace_uuid
|
|
# 가 워크스페이스 격리된 해결 경로(per-row own id -> 디스크 스캔 -> cwd 일치하는
|
|
# cache)만 사용. 다른 워크스페이스의 UUID 를 절대 반환하지 않음.
|
|
set -euo pipefail
|
|
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/lib.sh"
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: $0 --workspace <path> --agent <claude|agy>
|
|
Outputs the resolved UUID on stdout (empty if not found).
|
|
EOF
|
|
}
|
|
|
|
WORKSPACE=""
|
|
AGENT=""
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
--workspace) WORKSPACE="$2"; shift 2 ;;
|
|
--agent) AGENT="$2"; shift 2 ;;
|
|
-h|--help) usage; exit 0 ;;
|
|
*) echo "ERROR: unknown arg: $1" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
[ -n "$WORKSPACE" ] || { echo "ERROR: --workspace required" >&2; exit 2; }
|
|
[ -n "$AGENT" ] || { echo "ERROR: --agent required" >&2; exit 2; }
|
|
case "$AGENT" in
|
|
claude|agy) ;;
|
|
*) echo "ERROR: --agent must be claude or agy" >&2; exit 2 ;;
|
|
esac
|
|
|
|
find_workspace_uuid "$WORKSPACE" "$AGENT"
|