feat: add work-queue skill for Marcus and Steve
Some checks failed
ci / build-test-push (push) Failing after 29s

This commit is contained in:
Marcus A.
2026-04-11 14:48:08 -05:00
parent fbc88bb62b
commit c5be58c3c5
9 changed files with 344 additions and 0 deletions

27
skill/bin/wq_dispatch Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
# wq_dispatch — dispatch queued item to agent (queued→dispatched→in_progress atomically)
wq_dispatch() {
local work_id="$1" agent="$2"
if [[ -z "$work_id" ]] || [[ -z "$agent" ]]; then
echo "Usage: wq dispatch <work_item_id> <agent>" >&2
exit 1
fi
# Check if agent already has in_progress
local existing
existing=$(curl -sf "$API_URL/work?status=in_progress&agent=$agent" | jq 'length')
if [[ "$existing" -gt 0 ]]; then
echo "Error: $agent already has an in_progress item" >&2
exit 1
fi
curl -sf -X PATCH "$API_URL/work/$work_id" \
-H "Content-Type: application/json" \
-d "{\"status\":\"dispatched\",\"assigned_agent\":\"$agent\"}" | jq .
curl -sf -X PATCH "$API_URL/work/$work_id" \
-H "Content-Type: application/json" \
-d "{\"status\":\"in_progress\"}" | jq .
}