Add beads and session management tools for MCP
This commit is contained in:
parent
8a5d9e8518
commit
4bfbe3cc62
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Add a dependency (child depends on parent)
|
||||
# Usage: add_dependency.sh <child-id> <parent-id>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: add_dependency.sh <child-id> <parent-id>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "dep $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Claim a bead for work
|
||||
# Usage: claim_bead.sh <bead-id> [assignee]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: claim_bead.sh <bead-id> [assignee]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "claim $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Add a comment to a bead
|
||||
# Usage: comment_bead.sh <bead-id> <text>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: comment_bead.sh <bead-id> <text>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "comment $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Complete a bead
|
||||
# Usage: complete_bead.sh <bead-id>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: complete_bead.sh <bead-id>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "complete $1" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: agents
|
||||
# description: Control a session (stop|restart|kill|refresh)
|
||||
# Usage: control_session.sh <session-id> <command>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: control_session.sh <session-id> <command>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$2" | 9p write "agent/$1/ctl"
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Create a new bead
|
||||
# Usage: create_bead.sh <title> [description] [parent-id] [--no-lint] [capability=low|standard|high]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: create_bead.sh <title> [description] [parent-id] [--no-lint] [capability=low|standard|high]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "new $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: agents
|
||||
# description: Create a new agent session
|
||||
# Usage: create_session.sh <backend> <cwd> [role=<role>] [tasks=<task1,task2>] [model=<model>]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: create_session.sh <backend> <cwd> [role=<role>] [tasks=<task1,task2>] [model=<model>]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "new $*" | 9p write agent/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Fail a bead with reason
|
||||
# Usage: fail_bead.sh <bead-id> <reason>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: fail_bead.sh <bead-id> <reason>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "fail $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Add a label to a bead
|
||||
# Usage: label_bead.sh <bead-id> <label>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: label_bead.sh <bead-id> <label>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "label $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: List all beads across all mounted projects (JSON array)
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
9p read agent/beads/list
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: List mounted beads projects
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
9p read agent/beads/mtab
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: List ready/claimable beads (JSON array)
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
9p read agent/beads/ready
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Mark a bead as pending approval
|
||||
# Usage: mark_pending_approval.sh <bead-id> [assignee]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: mark_pending_approval.sh <bead-id> [assignee]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "pending-approval $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Mark a bead as pending review
|
||||
# Usage: mark_pending_review.sh <bead-id> [assignee]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: mark_pending_review.sh <bead-id> [assignee]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "pending-review $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Mount a beads project
|
||||
# Usage: mount_beads.sh <cwd> [name]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: mount_beads.sh <cwd> [name]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "mount $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Read a bead property
|
||||
# Usage: read_bead.sh <bead-id> <property>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: read_bead.sh <bead-id> <property>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
9p read "agent/beads/$1/$2"
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Remove a dependency
|
||||
# Usage: remove_dependency.sh <child-id> <parent-id>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: remove_dependency.sh <child-id> <parent-id>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "undep $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Resume work on a bead after approval/review
|
||||
# Usage: resume_work.sh <bead-id> [assignee]
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: resume_work.sh <bead-id> [assignee]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "resume $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Set capability level on a bead (low|standard|high)
|
||||
# Usage: set_capability.sh <bead-id> <level>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: set_capability.sh <bead-id> <level>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "set-capability $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Unmount a beads project
|
||||
# Usage: umount_beads.sh <name>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: umount_beads.sh <name>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "umount $1" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Unclaim a bead (reset to open)
|
||||
# Usage: unclaim_bead.sh <bead-id>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "usage: unclaim_bead.sh <bead-id>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "unclaim $1" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Remove a label from a bead
|
||||
# Usage: unlabel_bead.sh <bead-id> <label>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: unlabel_bead.sh <bead-id> <label>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "unlabel $*" | 9p write agent/beads/ctl
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# capabilities: beads
|
||||
# description: Update a bead field
|
||||
# Usage: update_bead.sh <bead-id> <field> <value>
|
||||
set -euo pipefail
|
||||
|
||||
if cat /etc/passwd >/dev/null 2>&1; then
|
||||
echo "Error: This script must be run via execute_code tool" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -lt 3 ]; then
|
||||
echo "usage: update_bead.sh <bead-id> <field> <value>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "update $*" | 9p write agent/beads/ctl
|
||||
Reference in New Issue