agent-coord-mcp 0.26.25 → 0.26.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -70
- package/dist/capabilities.js +41 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/server.js +13 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/herdr-tail.js +26 -4
- package/dist/tools/herdr-tail.js.map +1 -1
- package/dist/tools/transport.js +16 -148
- package/dist/tools/transport.js.map +1 -1
- package/dist/transports/config.js +22 -11
- package/dist/transports/config.js.map +1 -1
- package/dist/transports/herdr.js +16 -0
- package/dist/transports/herdr.js.map +1 -1
- package/dist/transports/index.js +3 -2
- package/dist/transports/index.js.map +1 -1
- package/dist/transports/tmux.js +5 -2
- package/dist/transports/tmux.js.map +1 -1
- package/dist/transports/types.js +18 -3
- package/dist/transports/types.js.map +1 -1
- package/package.json +4 -2
- package/scripts/check-global-mcp-fallback.mjs +85 -0
- package/scripts/coord-seat.mjs +96 -0
- package/scripts/coord-token.mjs +79 -4
- package/scripts/stop-agent.sh +8 -4
- package/src/capabilities.ts +42 -3
- package/src/server.ts +12 -3
- package/src/tools/herdr-tail.ts +37 -5
- package/src/tools/transport.ts +14 -152
- package/src/transports/config.ts +25 -12
- package/src/transports/herdr.ts +18 -0
- package/src/transports/index.ts +3 -2
- package/src/transports/tmux.ts +5 -2
- package/src/transports/types.ts +19 -4
- package/hooks/tmux-pusher.mjs +0 -971
- package/scripts/spawn-agent.sh +0 -94
package/scripts/spawn-agent.sh
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# spawn-agent.sh — start a CLI agent in a dedicated tmux session and wire
|
|
3
|
-
# coord-inbox auto-delivery to its pane via hooks/tmux-pusher.mjs.
|
|
4
|
-
#
|
|
5
|
-
# Works with any line-driven CLI agent (Claude Code, Aider, codex, gemini-cli,
|
|
6
|
-
# opencode, ...). The pusher just types into the pane; it doesn't care what's
|
|
7
|
-
# on the receiving end.
|
|
8
|
-
#
|
|
9
|
-
# Usage:
|
|
10
|
-
# scripts/spawn-agent.sh --id frontend --cmd "claude"
|
|
11
|
-
# scripts/spawn-agent.sh --id backend --cmd "aider --model sonnet" --include-room
|
|
12
|
-
# scripts/spawn-agent.sh --id worker --cmd "codex" --allowlist frontend,backend
|
|
13
|
-
#
|
|
14
|
-
# Flags:
|
|
15
|
-
# --id <agentId> coord agentId, also names the tmux session (coord-<id>)
|
|
16
|
-
# --cmd "<command>" agent CLI to run in pane 0 (quote it)
|
|
17
|
-
# --no-include-room skip shared-room delivery (DMs only). Room is on by default.
|
|
18
|
-
# --include-room deprecated no-op, kept for back-compat (room is on by default)
|
|
19
|
-
# --allowlist a,b,c only deliver DMs from these peer agentIds
|
|
20
|
-
# --dir <path> override AGENT_COORD_DIR
|
|
21
|
-
#
|
|
22
|
-
# After spawn, attach with: tmux attach -t coord-<id>
|
|
23
|
-
# Stop with: scripts/stop-agent.sh --id <id>
|
|
24
|
-
|
|
25
|
-
set -euo pipefail
|
|
26
|
-
|
|
27
|
-
ID=""
|
|
28
|
-
CMD=""
|
|
29
|
-
# Room delivery is on by default; pass --no-include-room to opt out.
|
|
30
|
-
INCLUDE_ROOM="1"
|
|
31
|
-
ALLOWLIST=""
|
|
32
|
-
COORD_DIR=""
|
|
33
|
-
|
|
34
|
-
while [[ $# -gt 0 ]]; do
|
|
35
|
-
case "$1" in
|
|
36
|
-
--id) ID="$2"; shift 2 ;;
|
|
37
|
-
--cmd) CMD="$2"; shift 2 ;;
|
|
38
|
-
--include-room) INCLUDE_ROOM="1"; shift ;; # kept for back-compat
|
|
39
|
-
--no-include-room) INCLUDE_ROOM=""; shift ;;
|
|
40
|
-
--allowlist) ALLOWLIST="$2"; shift 2 ;;
|
|
41
|
-
--dir) COORD_DIR="$2"; shift 2 ;;
|
|
42
|
-
-h|--help)
|
|
43
|
-
sed -n '2,22p' "$0"; exit 0 ;;
|
|
44
|
-
*) echo "unknown arg: $1" >&2; exit 2 ;;
|
|
45
|
-
esac
|
|
46
|
-
done
|
|
47
|
-
|
|
48
|
-
[[ -z "$ID" ]] && { echo "--id required" >&2; exit 2; }
|
|
49
|
-
[[ -z "$CMD" ]] && { echo "--cmd required (e.g. 'claude')" >&2; exit 2; }
|
|
50
|
-
|
|
51
|
-
command -v tmux >/dev/null || { echo "tmux not installed" >&2; exit 1; }
|
|
52
|
-
command -v node >/dev/null || { echo "node not installed" >&2; exit 1; }
|
|
53
|
-
|
|
54
|
-
SESSION="coord-$ID"
|
|
55
|
-
ROOT="${COORD_DIR:-${AGENT_COORD_DIR:-$HOME/agent-coord}}"
|
|
56
|
-
LOGDIR="$ROOT/logs"
|
|
57
|
-
PIDDIR="$ROOT/pids"
|
|
58
|
-
mkdir -p "$LOGDIR" "$PIDDIR"
|
|
59
|
-
|
|
60
|
-
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
61
|
-
PUSHER="$REPO_DIR/hooks/tmux-pusher.mjs"
|
|
62
|
-
[[ -f "$PUSHER" ]] || { echo "missing $PUSHER" >&2; exit 1; }
|
|
63
|
-
|
|
64
|
-
if tmux has-session -t "$SESSION" 2>/dev/null; then
|
|
65
|
-
echo "tmux session '$SESSION' already exists — attach with: tmux attach -t $SESSION" >&2
|
|
66
|
-
exit 1
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
PID_FILE="$PIDDIR/pusher-$ID.pid"
|
|
70
|
-
if [[ -f "$PID_FILE" ]] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
|
|
71
|
-
echo "pusher already running for '$ID' (pid $(cat "$PID_FILE"))" >&2
|
|
72
|
-
exit 1
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
tmux new-session -d -s "$SESSION" -n agent "$CMD"
|
|
76
|
-
|
|
77
|
-
# Resolve the actual pane id — globally unique, immune to base-index settings.
|
|
78
|
-
TARGET="$(tmux display-message -p -t "$SESSION:agent" '#{pane_id}')"
|
|
79
|
-
[[ -n "$TARGET" ]] || { echo "failed to resolve tmux pane id" >&2; exit 1; }
|
|
80
|
-
|
|
81
|
-
(
|
|
82
|
-
export AGENT_COORD_ID="$ID"
|
|
83
|
-
export AGENT_COORD_TMUX_TARGET="$TARGET"
|
|
84
|
-
[[ -n "$COORD_DIR" ]] && export AGENT_COORD_DIR="$COORD_DIR"
|
|
85
|
-
[[ -n "$INCLUDE_ROOM" ]] && export AGENT_COORD_INCLUDE_ROOM=1
|
|
86
|
-
[[ -n "$ALLOWLIST" ]] && export AGENT_COORD_ALLOWLIST="$ALLOWLIST"
|
|
87
|
-
nohup node "$PUSHER" >> "$LOGDIR/pusher-$ID.log" 2>&1 &
|
|
88
|
-
echo $! > "$PID_FILE"
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
echo "agent '$ID' started"
|
|
92
|
-
echo " attach: tmux attach -t $SESSION"
|
|
93
|
-
echo " pusher: pid $(cat "$PID_FILE") log: $LOGDIR/pusher-$ID.log"
|
|
94
|
-
echo " stop: scripts/stop-agent.sh --id $ID"
|