feat: skills - archive auto-tmux report packs

This commit is contained in:
tukuaiai
2026-05-19 14:01:28 +08:00
parent b46c412ec2
commit 1a53248281
6 changed files with 23 additions and 4 deletions
+1
View File
@@ -88,6 +88,7 @@ skills/auto-tmux/scripts/swarm-blockers.sh --dir /tmp/ai_swarm --out /tmp/ai-swa
# 生成完整报告包
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --session ai-hub --out /tmp/ai-swarm-report-pack
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-report-pack --attach /tmp/auto-tmux-remote
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-report-pack --tar
# 生成 worker 分配建议
skills/auto-tmux/scripts/swarm-assign.sh --swarm-dir /tmp/ai_swarm --session ai-hub --out /tmp/ai-swarm-assign.md
+14 -1
View File
@@ -7,7 +7,7 @@ usage() {
swarm-report-pack: build an auto-tmux swarm report pack
Usage:
swarm-report-pack.sh [--dir DIR] [--session NAME] [--out DIR] [--attach DIR ...]
swarm-report-pack.sh [--dir DIR] [--session NAME] [--out DIR] [--attach DIR ...] [--tar]
Defaults:
--dir AUTO_TMUX_SWARM_DIR or /tmp/ai_swarm
@@ -15,6 +15,7 @@ Defaults:
This script is read-only for tmux and swarm state. It writes only to --out.
Use --attach to copy explicit external evidence directories into the report pack.
Use --tar to create OUT.tar.gz after the directory report pack is written.
EOF
}
@@ -39,6 +40,7 @@ session=""
out_dir="/tmp/auto-tmux-report-pack-$(date +%Y%m%d-%H%M%S)"
attachments=()
created_at="$(date -Is)"
make_tar="0"
while [[ $# -gt 0 ]]; do
case "$1" in
@@ -58,6 +60,10 @@ while [[ $# -gt 0 ]]; do
attachments+=("${2:-}")
shift 2
;;
--tar)
make_tar="1"
shift
;;
-h|--help)
usage
exit 0
@@ -165,4 +171,11 @@ $(if [[ -n "$attachment_lines" ]]; then printf '%s' "- [attachments.md](./attach
EOF
rm -f /tmp/auto-tmux-report-pack.log
if [[ "$make_tar" == "1" ]]; then
command -v tar >/dev/null 2>&1 || die "tar not found"
parent_dir="$(cd "$(dirname "$out_dir")" && pwd)"
base_dir="$(basename "$out_dir")"
tar -C "$parent_dir" -czf "$out_dir.tar.gz" "$base_dir"
printf 'swarm report archive written: %s\n' "$out_dir.tar.gz"
fi
printf 'swarm report pack written: %s\n' "$out_dir"
@@ -149,6 +149,8 @@ run_gate "swarm-report-pack attachment" bash -c '
grep -Fq "\"type\": \"auto-tmux-swarm-report-pack\"" "$tmp/out/manifest.json"
grep -Fq "\"attachments\"" "$tmp/out/manifest.json"
grep -Fq "remote-tmux.txt" "$tmp/out/attachments/remote/remote-tmux.txt"
"$1" --dir "$tmp/swarm" --out "$tmp/out-tar" --attach "$tmp/remote" --tar >/dev/null
test -f "$tmp/out-tar.tar.gz"
rm -rf "$tmp"
' _ "$script_dir/swarm-report-pack.sh"
run_gate "swarm-assign help" "$script_dir/swarm-assign.sh" --help