vibe-forge 0.8.1 → 0.8.3

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.
Files changed (51) hide show
  1. package/.claude/commands/configure-vcs.md +102 -102
  2. package/.claude/commands/forge.md +218 -218
  3. package/.claude/hooks/worker-loop.js +220 -217
  4. package/.claude/settings.json +89 -89
  5. package/README.md +149 -191
  6. package/agents/aegis/personality.md +303 -303
  7. package/agents/anvil/personality.md +278 -278
  8. package/agents/architect/personality.md +260 -260
  9. package/agents/crucible/personality.md +362 -362
  10. package/agents/crucible-x/personality.md +210 -210
  11. package/agents/ember/personality.md +293 -293
  12. package/agents/flux/personality.md +248 -248
  13. package/agents/furnace/personality.md +342 -342
  14. package/agents/herald/personality.md +249 -249
  15. package/agents/oracle/personality.md +284 -284
  16. package/agents/pixel/personality.md +140 -140
  17. package/agents/planning-hub/personality.md +473 -473
  18. package/agents/scribe/personality.md +253 -253
  19. package/agents/slag/personality.md +268 -268
  20. package/agents/temper/personality.md +270 -270
  21. package/bin/cli.js +372 -372
  22. package/bin/forge-daemon.sh +477 -477
  23. package/bin/forge-setup.sh +662 -661
  24. package/bin/forge-spawn.sh +164 -164
  25. package/bin/forge.sh +566 -566
  26. package/docs/commands.md +8 -8
  27. package/package.json +77 -77
  28. package/{bin → src}/lib/agents.sh +177 -177
  29. package/{bin → src}/lib/check-aliases.js +50 -50
  30. package/{bin → src}/lib/colors.sh +45 -44
  31. package/{bin → src}/lib/config.sh +347 -347
  32. package/{bin → src}/lib/constants.sh +241 -241
  33. package/{bin → src}/lib/daemon/budgets.sh +107 -107
  34. package/{bin → src}/lib/daemon/dependencies.sh +146 -146
  35. package/{bin → src}/lib/daemon/display.sh +128 -128
  36. package/{bin → src}/lib/daemon/notifications.sh +273 -273
  37. package/{bin → src}/lib/daemon/routing.sh +93 -93
  38. package/{bin → src}/lib/daemon/state.sh +163 -163
  39. package/{bin → src}/lib/daemon/sync.sh +103 -103
  40. package/{bin → src}/lib/database.sh +357 -357
  41. package/{bin → src}/lib/frontmatter.js +106 -106
  42. package/{bin → src}/lib/heimdall-setup.js +113 -113
  43. package/{bin → src}/lib/heimdall.js +265 -265
  44. package/src/lib/index.sh +25 -0
  45. package/{bin → src}/lib/json.sh +264 -264
  46. package/{bin → src}/lib/terminal.js +452 -452
  47. package/{bin → src}/lib/util.sh +126 -126
  48. package/{bin → src}/lib/vcs.js +349 -349
  49. package/{context → templates}/project-context-template.md +122 -122
  50. package/config/task-template.md +0 -159
  51. package/config/templates/handoff-template.md +0 -40
@@ -1,128 +1,128 @@
1
- #!/usr/bin/env bash
2
- #
3
- # bin/lib/daemon/display.sh
4
- #
5
- # Status display functions for the daemon status command
6
- #
7
- # Dependencies: colors.sh, constants.sh, json.sh
8
- # Globals required: FORGE_ROOT, PID_FILE, STATE_FILE, NOTIFY_FILE,
9
- # AGENT_STATUS_DIR, TASKS_ATTENTION, STALE_STATUS_THRESHOLD
10
-
11
- # Prevent double-sourcing
12
- [[ -n "${_DAEMON_DISPLAY_LOADED:-}" ]] && return 0
13
- _DAEMON_DISPLAY_LOADED=1
14
-
15
- # Display daemon running status (PID check)
16
- display_daemon_status() {
17
- if [[ -f "$PID_FILE" ]]; then
18
- local pid
19
- pid=$(cat "$PID_FILE")
20
- if kill -0 "$pid" 2>/dev/null; then
21
- log_success "Running (PID: $pid)"
22
- else
23
- log_warn "Stopped (stale PID file)"
24
- fi
25
- else
26
- echo "Status: Stopped"
27
- fi
28
- }
29
-
30
- # Display task counts from state file
31
- display_task_counts() {
32
- if [[ -f "$STATE_FILE" ]]; then
33
- echo "Task Counts:"
34
- grep -E "pending:|in_progress:|completed:|in_review:|approved:|needs_changes:|merged:|attention_needed:" "$STATE_FILE" | sed 's/^/ /'
35
- fi
36
- }
37
-
38
- # Display workers needing attention (urgent alerts)
39
- display_attention_needed() {
40
- local attention_count
41
- attention_count=$(find "$FORGE_ROOT/$TASKS_ATTENTION" -maxdepth 1 -name "*.md" -type f 2>/dev/null | wc -l)
42
- if [[ "$attention_count" -gt 0 ]]; then
43
- echo -e "${RED}🔔 ATTENTION NEEDED:${NC}"
44
- for attention_file in "$FORGE_ROOT/$TASKS_ATTENTION"/*.md; do
45
- if [[ -f "$attention_file" && ! -L "$attention_file" ]]; then
46
- local agent issue
47
- agent=$(grep -m1 "^agent:" "$attention_file" 2>/dev/null | cut -d':' -f2 | tr -d ' "' | head -c 50)
48
- issue=$(sed -n '/^## Issue/,/^##/p' "$attention_file" 2>/dev/null | grep -v "^##" | head -1 | head -c 80)
49
- echo -e " ${YELLOW}$agent${NC}: $issue"
50
- fi
51
- done
52
- echo ""
53
- fi
54
- }
55
-
56
- # Get status icon for worker status
57
- get_status_icon() {
58
- local status="$1"
59
- case "$status" in
60
- "working") echo "🔨" ;;
61
- "idle") echo "💤" ;;
62
- "blocked") echo "🚫" ;;
63
- "testing") echo "🧪" ;;
64
- "reviewing") echo "👁️" ;;
65
- *) echo "❓" ;;
66
- esac
67
- }
68
-
69
- # Display active worker statuses with staleness indicators
70
- display_worker_status() {
71
- if [[ ! -d "$FORGE_ROOT/$AGENT_STATUS_DIR" ]]; then
72
- return
73
- fi
74
-
75
- local status_count
76
- status_count=$(find "$FORGE_ROOT/$AGENT_STATUS_DIR" -maxdepth 1 -name "*.json" -type f 2>/dev/null | wc -l)
77
- if [[ "$status_count" -eq 0 ]]; then
78
- return
79
- fi
80
-
81
- echo "Active Workers:"
82
- local now_epoch stale_threshold
83
- now_epoch=$(date +%s)
84
- stale_threshold=$STALE_STATUS_THRESHOLD
85
-
86
- for status_file in "$FORGE_ROOT/$AGENT_STATUS_DIR"/*.json; do
87
- if [[ -f "$status_file" && ! -L "$status_file" ]]; then
88
- local agent status task updated stale_marker icon
89
- agent=$(json_read "$status_file" "agent" "unknown")
90
- status=$(json_read "$status_file" "status" "unknown")
91
- task=$(json_read "$status_file" "task" "")
92
- updated=$(json_read "$status_file" "updated" "")
93
-
94
- # Check staleness
95
- stale_marker=""
96
- if [[ -n "$updated" ]]; then
97
- local updated_epoch age
98
- updated_epoch=$(date -d "$updated" +%s 2>/dev/null || date -j -f "%Y-%m-%dT%H:%M:%S" "${updated%Z}" +%s 2>/dev/null || echo "0")
99
- age=$((now_epoch - updated_epoch))
100
- if [[ "$age" -gt "$stale_threshold" ]]; then
101
- stale_marker=" ${YELLOW}(stale)${NC}"
102
- fi
103
- fi
104
-
105
- icon=$(get_status_icon "$status")
106
-
107
- if [[ -n "$task" ]]; then
108
- echo -e " $icon ${CYAN}$agent${NC}: $status ($task)$stale_marker"
109
- else
110
- echo -e " $icon ${CYAN}$agent${NC}: $status$stale_marker"
111
- fi
112
- fi
113
- done
114
- echo ""
115
- }
116
-
117
- # Display recent notifications from log
118
- display_recent_notifications() {
119
- if [[ -f "$NOTIFY_FILE" ]]; then
120
- local notify_count
121
- notify_count=$(wc -l < "$NOTIFY_FILE" 2>/dev/null || echo "0")
122
- if [[ "$notify_count" -gt 0 ]]; then
123
- echo "Recent Notifications (last 5):"
124
- tail -5 "$NOTIFY_FILE" | sed 's/^/ /'
125
- echo ""
126
- fi
127
- fi
128
- }
1
+ #!/usr/bin/env bash
2
+ #
3
+ # src/lib/daemon/display.sh
4
+ #
5
+ # Status display functions for the daemon status command
6
+ #
7
+ # Dependencies: colors.sh, constants.sh, json.sh
8
+ # Globals required: FORGE_ROOT, PID_FILE, STATE_FILE, NOTIFY_FILE,
9
+ # AGENT_STATUS_DIR, TASKS_ATTENTION, STALE_STATUS_THRESHOLD
10
+
11
+ # Prevent double-sourcing
12
+ [[ -n "${_DAEMON_DISPLAY_LOADED:-}" ]] && return 0
13
+ _DAEMON_DISPLAY_LOADED=1
14
+
15
+ # Display daemon running status (PID check)
16
+ display_daemon_status() {
17
+ if [[ -f "$PID_FILE" ]]; then
18
+ local pid
19
+ pid=$(cat "$PID_FILE")
20
+ if kill -0 "$pid" 2>/dev/null; then
21
+ log_success "Running (PID: $pid)"
22
+ else
23
+ log_warn "Stopped (stale PID file)"
24
+ fi
25
+ else
26
+ echo "Status: Stopped"
27
+ fi
28
+ }
29
+
30
+ # Display task counts from state file
31
+ display_task_counts() {
32
+ if [[ -f "$STATE_FILE" ]]; then
33
+ echo "Task Counts:"
34
+ grep -E "pending:|in_progress:|completed:|in_review:|approved:|needs_changes:|merged:|attention_needed:" "$STATE_FILE" | sed 's/^/ /'
35
+ fi
36
+ }
37
+
38
+ # Display workers needing attention (urgent alerts)
39
+ display_attention_needed() {
40
+ local attention_count
41
+ attention_count=$(find "$FORGE_ROOT/$TASKS_ATTENTION" -maxdepth 1 -name "*.md" -type f 2>/dev/null | wc -l)
42
+ if [[ "$attention_count" -gt 0 ]]; then
43
+ echo -e "${RED}🔔 ATTENTION NEEDED:${NC}"
44
+ for attention_file in "$FORGE_ROOT/$TASKS_ATTENTION"/*.md; do
45
+ if [[ -f "$attention_file" && ! -L "$attention_file" ]]; then
46
+ local agent issue
47
+ agent=$(grep -m1 "^agent:" "$attention_file" 2>/dev/null | cut -d':' -f2 | tr -d ' "' | head -c 50)
48
+ issue=$(sed -n '/^## Issue/,/^##/p' "$attention_file" 2>/dev/null | grep -v "^##" | head -1 | head -c 80)
49
+ echo -e " ${YELLOW}$agent${NC}: $issue"
50
+ fi
51
+ done
52
+ echo ""
53
+ fi
54
+ }
55
+
56
+ # Get status icon for worker status
57
+ get_status_icon() {
58
+ local status="$1"
59
+ case "$status" in
60
+ "working") echo "🔨" ;;
61
+ "idle") echo "💤" ;;
62
+ "blocked") echo "🚫" ;;
63
+ "testing") echo "🧪" ;;
64
+ "reviewing") echo "👁️" ;;
65
+ *) echo "❓" ;;
66
+ esac
67
+ }
68
+
69
+ # Display active worker statuses with staleness indicators
70
+ display_worker_status() {
71
+ if [[ ! -d "$FORGE_ROOT/$AGENT_STATUS_DIR" ]]; then
72
+ return
73
+ fi
74
+
75
+ local status_count
76
+ status_count=$(find "$FORGE_ROOT/$AGENT_STATUS_DIR" -maxdepth 1 -name "*.json" -type f 2>/dev/null | wc -l)
77
+ if [[ "$status_count" -eq 0 ]]; then
78
+ return
79
+ fi
80
+
81
+ echo "Active Workers:"
82
+ local now_epoch stale_threshold
83
+ now_epoch=$(date +%s)
84
+ stale_threshold=$STALE_STATUS_THRESHOLD
85
+
86
+ for status_file in "$FORGE_ROOT/$AGENT_STATUS_DIR"/*.json; do
87
+ if [[ -f "$status_file" && ! -L "$status_file" ]]; then
88
+ local agent status task updated stale_marker icon
89
+ agent=$(json_read "$status_file" "agent" "unknown")
90
+ status=$(json_read "$status_file" "status" "unknown")
91
+ task=$(json_read "$status_file" "task" "")
92
+ updated=$(json_read "$status_file" "updated" "")
93
+
94
+ # Check staleness
95
+ stale_marker=""
96
+ if [[ -n "$updated" ]]; then
97
+ local updated_epoch age
98
+ updated_epoch=$(date -d "$updated" +%s 2>/dev/null || date -j -f "%Y-%m-%dT%H:%M:%S" "${updated%Z}" +%s 2>/dev/null || echo "0")
99
+ age=$((now_epoch - updated_epoch))
100
+ if [[ "$age" -gt "$stale_threshold" ]]; then
101
+ stale_marker=" ${YELLOW}(stale)${NC}"
102
+ fi
103
+ fi
104
+
105
+ icon=$(get_status_icon "$status")
106
+
107
+ if [[ -n "$task" ]]; then
108
+ echo -e " $icon ${CYAN}$agent${NC}: $status ($task)$stale_marker"
109
+ else
110
+ echo -e " $icon ${CYAN}$agent${NC}: $status$stale_marker"
111
+ fi
112
+ fi
113
+ done
114
+ echo ""
115
+ }
116
+
117
+ # Display recent notifications from log
118
+ display_recent_notifications() {
119
+ if [[ -f "$NOTIFY_FILE" ]]; then
120
+ local notify_count
121
+ notify_count=$(wc -l < "$NOTIFY_FILE" 2>/dev/null || echo "0")
122
+ if [[ "$notify_count" -gt 0 ]]; then
123
+ echo "Recent Notifications (last 5):"
124
+ tail -5 "$NOTIFY_FILE" | sed 's/^/ /'
125
+ echo ""
126
+ fi
127
+ fi
128
+ }