feat(skill): cover full API — projects, delete, health, all WorkCreate fields
All checks were successful
ci / build-test-push (push) Successful in 1m26s

This commit is contained in:
Marcus A.
2026-04-11 16:11:13 -05:00
parent c14cc296d7
commit 33d65c35e9
15 changed files with 407 additions and 244 deletions

View File

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