Files
hermes-config/bin/hermes-enqueue
Alexander Whitestone 6490954006 chore: sync all local state to source control
- bin: add hermes-claim, hermes-dispatch, hermes-enqueue (queue scripts)
- bin: update timmy-loop-prompt.md (Phase 1 fix-broken-PRs, --no-verify ban)
- bin: update timmy-loop.sh (timeout cleanup, claim TTL)
- bin: update timmy-status.sh (watchdog auto-restart for dead loop)
- bin: update timmy-tmux.sh (pane layout fixes)
- bin: update timmy-watchdog.sh (minor fixes)
- skills: add hermes-agent skill (was missing from repo)
- memories: sync MEMORY.md and USER.md to current state
- cron/channel_directory: sync runtime state
- .gitignore: whitelist new bin scripts, fix hermes-agent/ scope
2026-03-15 10:11:46 -04:00

36 lines
824 B
Bash
Executable File

#!/bin/bash
# hermes-enqueue — drop a task into the self-prompt queue
# Usage: hermes-enqueue "Run make test and report results"
# hermes-enqueue -p high "Fix the broken import in router.py"
# echo "multi-line prompt" | hermes-enqueue -
set -euo pipefail
QUEUE_DIR="$HOME/.hermes/queue"
PRIORITY="normal"
while [[ $# -gt 0 ]]; do
case "$1" in
-p|--priority) PRIORITY="$2"; shift 2 ;;
-) PROMPT="$(cat)"; shift ;;
*) PROMPT="$1"; shift ;;
esac
done
if [[ -z "${PROMPT:-}" ]]; then
echo "Usage: hermes-enqueue [-p high|normal|low] \"prompt text\""
exit 1
fi
TIMESTAMP=$(date +%s)
ID="${TIMESTAMP}_$$"
TASK_FILE="$QUEUE_DIR/pending/${PRIORITY}_${ID}.task"
cat > "$TASK_FILE" <<EOF
CREATED=$(date -u +%Y-%m-%dT%H:%M:%SZ)
PRIORITY=$PRIORITY
PROMPT=$PROMPT
EOF
echo "Queued: $TASK_FILE"