@walwal-harness/cli 5.9.4 → 5.9.5
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/package.json +1 -1
- package/scripts/harness-dashboard.sh +21 -1
- package/scripts/harness-tmux.sh +19 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walwal-harness/cli",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.5",
|
|
4
4
|
"description": "Production harness for AI agent engineering — Solo/Team mode, Planner, Generator(BE/FE), Evaluator chain (Code-Quality → Functional → Visual), optional Brainstormer. Supports React, Next.js, and Flutter FE stacks.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"walwal-harness": "bin/init.js"
|
|
@@ -46,7 +46,27 @@ get_term_width() {
|
|
|
46
46
|
|
|
47
47
|
get_mode() {
|
|
48
48
|
if [ -f "$PROGRESS" ] && command -v jq &>/dev/null; then
|
|
49
|
-
|
|
49
|
+
local raw_mode queue active
|
|
50
|
+
raw_mode=$(jq -r '.mode // "solo"' "$PROGRESS" 2>/dev/null)
|
|
51
|
+
queue="$(dirname "$PROGRESS")/actions/feature-queue.json"
|
|
52
|
+
if [ "$raw_mode" != "team" ] && [ -f "$queue" ]; then
|
|
53
|
+
active=$(jq -r '(.queue.in_progress | length) // 0' "$queue" 2>/dev/null || echo 0)
|
|
54
|
+
if [ "${active:-0}" -gt 0 ]; then
|
|
55
|
+
local heal_teams=$active
|
|
56
|
+
[ "$heal_teams" -gt 3 ] && heal_teams=3
|
|
57
|
+
local SCRIPT_DIR_LOCAL
|
|
58
|
+
SCRIPT_DIR_LOCAL="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
59
|
+
bash "$SCRIPT_DIR_LOCAL/harness-progress-set.sh" "$(dirname "$(dirname "$PROGRESS")")" \
|
|
60
|
+
".mode = \"team\" | .team_state.active_teams = ${heal_teams} | .team_state.paused_at = null" \
|
|
61
|
+
2>/dev/null
|
|
62
|
+
if [ -f "$(dirname "$PROGRESS")/progress.log" ]; then
|
|
63
|
+
echo "$(date +'%Y-%m-%d %H:%M') | system | heal | mode | dashboard reset ${raw_mode}→team (queue had ${active} in_progress)" >> "$(dirname "$PROGRESS")/progress.log"
|
|
64
|
+
fi
|
|
65
|
+
echo "team"
|
|
66
|
+
return
|
|
67
|
+
fi
|
|
68
|
+
fi
|
|
69
|
+
echo "$raw_mode"
|
|
50
70
|
else
|
|
51
71
|
echo "solo"
|
|
52
72
|
fi
|
package/scripts/harness-tmux.sh
CHANGED
|
@@ -79,10 +79,28 @@ if [ -z "$PROJECT_ROOT" ] || [ ! -d "$PROJECT_ROOT/.harness" ]; then
|
|
|
79
79
|
exit 1
|
|
80
80
|
fi
|
|
81
81
|
|
|
82
|
-
# Auto-detect mode from progress.json if not specified
|
|
82
|
+
# Auto-detect mode from progress.json if not specified.
|
|
83
|
+
# Self-heal: feature-queue.json 에 in_progress 가 있으면 mode 와 무관하게 team 으로 간주.
|
|
84
|
+
# (SessionStart 훅 외 경로에서 dashboard/tmux 가 stale solo 를 표시하던 버그)
|
|
83
85
|
if [ -z "$MODE" ]; then
|
|
84
86
|
if command -v jq &>/dev/null && [ -f "$PROJECT_ROOT/.harness/progress.json" ]; then
|
|
85
87
|
MODE=$(jq -r '.mode // "solo"' "$PROJECT_ROOT/.harness/progress.json" 2>/dev/null)
|
|
88
|
+
QUEUE_FILE="$PROJECT_ROOT/.harness/actions/feature-queue.json"
|
|
89
|
+
if [ "$MODE" != "team" ] && [ -f "$QUEUE_FILE" ]; then
|
|
90
|
+
ACTIVE_COUNT=$(jq -r '(.queue.in_progress | length) // 0' "$QUEUE_FILE" 2>/dev/null || echo 0)
|
|
91
|
+
if [ "${ACTIVE_COUNT:-0}" -gt 0 ]; then
|
|
92
|
+
HEAL_TEAMS=$ACTIVE_COUNT
|
|
93
|
+
[ "$HEAL_TEAMS" -gt 3 ] && HEAL_TEAMS=3
|
|
94
|
+
bash "$SCRIPT_DIR/harness-progress-set.sh" "$PROJECT_ROOT" \
|
|
95
|
+
".mode = \"team\" | .team_state.active_teams = ${HEAL_TEAMS} | .team_state.paused_at = null" \
|
|
96
|
+
2>/dev/null
|
|
97
|
+
MODE="team"
|
|
98
|
+
echo "# tmux: mode auto-healed to 'team' (queue had ${ACTIVE_COUNT} in_progress)"
|
|
99
|
+
if [ -f "$PROJECT_ROOT/.harness/progress.log" ]; then
|
|
100
|
+
echo "$(date +'%Y-%m-%d %H:%M') | system | heal | mode | tmux reset solo→team (queue had ${ACTIVE_COUNT} in_progress)" >> "$PROJECT_ROOT/.harness/progress.log"
|
|
101
|
+
fi
|
|
102
|
+
fi
|
|
103
|
+
fi
|
|
86
104
|
fi
|
|
87
105
|
MODE="${MODE:-solo}"
|
|
88
106
|
fi
|