forked from niuniu/llm-intelligence
48 lines
906 B
Bash
48 lines
906 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
PROJECT_ROOT="/home/long/project/llm-intelligence"
|
||
|
|
GLOBAL_GUARD="/home/long/.openclaw/workspace/scripts/preflight_task_write_guard.sh"
|
||
|
|
|
||
|
|
usage() {
|
||
|
|
cat <<'EOF'
|
||
|
|
Usage:
|
||
|
|
preflight_task_write_guard.sh <writer-role> <target-path> [target-path...]
|
||
|
|
|
||
|
|
Writer roles:
|
||
|
|
main-session
|
||
|
|
llm-intelligence-agent
|
||
|
|
llm-intelligence-review
|
||
|
|
llm-intelligence-cron
|
||
|
|
EOF
|
||
|
|
}
|
||
|
|
|
||
|
|
if [[ $# -lt 2 ]]; then
|
||
|
|
usage >&2
|
||
|
|
exit 64
|
||
|
|
fi
|
||
|
|
|
||
|
|
writer_role="$1"
|
||
|
|
shift
|
||
|
|
|
||
|
|
case "$writer_role" in
|
||
|
|
main-session)
|
||
|
|
generic_role="main-session"
|
||
|
|
;;
|
||
|
|
llm-intelligence-agent)
|
||
|
|
generic_role="project-agent"
|
||
|
|
;;
|
||
|
|
llm-intelligence-review)
|
||
|
|
generic_role="project-review"
|
||
|
|
;;
|
||
|
|
llm-intelligence-cron)
|
||
|
|
generic_role="project-cron"
|
||
|
|
;;
|
||
|
|
*)
|
||
|
|
printf '%s\n' "preflight: unsupported writer role: $writer_role" >&2
|
||
|
|
exit 68
|
||
|
|
;;
|
||
|
|
esac
|
||
|
|
|
||
|
|
exec "$GLOBAL_GUARD" "$generic_role" "$PROJECT_ROOT" "$@"
|