summaryrefslogtreecommitdiff
path: root/Omni/Agent/start-worker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Agent/start-worker.sh')
-rwxr-xr-xOmni/Agent/start-worker.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/Omni/Agent/start-worker.sh b/Omni/Agent/start-worker.sh
new file mode 100755
index 0000000..2c5eee4
--- /dev/null
+++ b/Omni/Agent/start-worker.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+set -e
+
+# Omni/Agent/start-worker.sh
+# Launches an Amp worker agent in the specified worktree.
+# Usage: ./Omni/Agent/start-worker.sh [worker-directory-name]
+# Example: ./Omni/Agent/start-worker.sh omni-worker-1
+
+WORKER_NAME="${1:-omni-worker-1}"
+REPO_ROOT="$(git rev-parse --show-toplevel)"
+WORKER_PATH="$REPO_ROOT/../$WORKER_NAME"
+AMP_BIN="$REPO_ROOT/node_modules/.bin/amp"
+
+if [ ! -d "$WORKER_PATH" ]; then
+ echo "Error: Worker directory '$WORKER_PATH' does not exist."
+ echo "Please run './Omni/Agent/setup-worker.sh $WORKER_NAME' first."
+ exit 1
+fi
+
+if [ ! -x "$AMP_BIN" ]; then
+ echo "Error: Amp binary not found at '$AMP_BIN'."
+ echo "Please ensure npm dependencies are installed in the main repository."
+ exit 1
+fi
+
+echo "Starting Worker Agent in '$WORKER_PATH'..."
+echo "Using Amp binary: $AMP_BIN"
+
+cd "$WORKER_PATH"
+
+# Launch Amp with the worker persona and instructions
+"$AMP_BIN" -- "You are a Worker Agent. Your goal is to process tasks from the task manager.
+Please read Omni/Agent/WORKER_AGENT_GUIDE.md and follow the 'Worker Loop' instructions exactly.
+Start by syncing tasks and checking for ready work."