vibe-forge 0.8.1 → 0.8.2
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/.claude/commands/configure-vcs.md +102 -102
- package/.claude/commands/forge.md +218 -218
- package/.claude/hooks/worker-loop.js +220 -217
- package/.claude/settings.json +89 -89
- package/README.md +149 -191
- package/agents/aegis/personality.md +303 -303
- package/agents/anvil/personality.md +278 -278
- package/agents/architect/personality.md +260 -260
- package/agents/crucible/personality.md +362 -362
- package/agents/crucible-x/personality.md +210 -210
- package/agents/ember/personality.md +293 -293
- package/agents/flux/personality.md +248 -248
- package/agents/furnace/personality.md +342 -342
- package/agents/herald/personality.md +249 -249
- package/agents/oracle/personality.md +284 -284
- package/agents/pixel/personality.md +140 -140
- package/agents/planning-hub/personality.md +473 -473
- package/agents/scribe/personality.md +253 -253
- package/agents/slag/personality.md +268 -268
- package/agents/temper/personality.md +270 -270
- package/bin/cli.js +372 -372
- package/bin/forge-daemon.sh +477 -477
- package/bin/forge-setup.sh +662 -661
- package/bin/forge-spawn.sh +164 -164
- package/bin/forge.sh +566 -566
- package/docs/commands.md +8 -8
- package/package.json +77 -77
- package/{bin → src}/lib/agents.sh +177 -177
- package/{bin → src}/lib/check-aliases.js +50 -50
- package/{bin → src}/lib/colors.sh +45 -44
- package/{bin → src}/lib/config.sh +347 -347
- package/{bin → src}/lib/constants.sh +241 -241
- package/{bin → src}/lib/daemon/budgets.sh +107 -107
- package/{bin → src}/lib/daemon/dependencies.sh +146 -146
- package/{bin → src}/lib/daemon/display.sh +128 -128
- package/{bin → src}/lib/daemon/notifications.sh +273 -273
- package/{bin → src}/lib/daemon/routing.sh +93 -93
- package/{bin → src}/lib/daemon/state.sh +163 -163
- package/{bin → src}/lib/daemon/sync.sh +103 -103
- package/{bin → src}/lib/database.sh +357 -357
- package/{bin → src}/lib/frontmatter.js +106 -106
- package/{bin → src}/lib/heimdall-setup.js +113 -113
- package/{bin → src}/lib/heimdall.js +265 -265
- package/src/lib/index.sh +25 -0
- package/{bin → src}/lib/json.sh +264 -264
- package/{bin → src}/lib/terminal.js +452 -452
- package/{bin → src}/lib/util.sh +126 -126
- package/{bin → src}/lib/vcs.js +349 -349
- package/{context → templates}/project-context-template.md +122 -122
- package/config/task-template.md +0 -159
- package/config/templates/handoff-template.md +0 -40
package/bin/forge-spawn.sh
CHANGED
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Vibe Forge - Agent Spawner
|
|
4
|
-
# Spawns worker agents in new terminal windows/tabs based on configured terminal type
|
|
5
|
-
#
|
|
6
|
-
# Usage: forge-spawn.sh <agent-name>
|
|
7
|
-
#
|
|
8
|
-
# Supports:
|
|
9
|
-
# - Windows Terminal (wt new-tab)
|
|
10
|
-
# - Manual (prints instructions)
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
set -
|
|
14
|
-
|
|
15
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
16
|
-
FORGE_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
17
|
-
CONFIG_FILE="$FORGE_ROOT/.forge/config.json"
|
|
18
|
-
|
|
19
|
-
# =============================================================================
|
|
20
|
-
# Load Shared Libraries
|
|
21
|
-
# =============================================================================
|
|
22
|
-
|
|
23
|
-
# shellcheck source=lib/colors.sh
|
|
24
|
-
source "$SCRIPT_DIR/lib/colors.sh"
|
|
25
|
-
# shellcheck source=lib/constants.sh
|
|
26
|
-
source "$SCRIPT_DIR/lib/constants.sh"
|
|
27
|
-
# shellcheck source=lib/config.sh
|
|
28
|
-
source "$SCRIPT_DIR/lib/config.sh"
|
|
29
|
-
# shellcheck source=lib/agents.sh
|
|
30
|
-
source "$SCRIPT_DIR/lib/agents.sh"
|
|
31
|
-
|
|
32
|
-
# Load agent configuration from JSON if available
|
|
33
|
-
if [[ -f "$FORGE_ROOT/$AGENTS_CONFIG" ]]; then
|
|
34
|
-
if ! load_agents_from_json "$FORGE_ROOT/$AGENTS_CONFIG" 2>/dev/null; then
|
|
35
|
-
log_warn "Failed to load agents.json, using fallback defaults"
|
|
36
|
-
fi
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
# =============================================================================
|
|
40
|
-
# Spawn Functions
|
|
41
|
-
# =============================================================================
|
|
42
|
-
|
|
43
|
-
spawn_windows_terminal() {
|
|
44
|
-
local agent="$1"
|
|
45
|
-
|
|
46
|
-
log_info "Spawning $agent in Windows Terminal..."
|
|
47
|
-
|
|
48
|
-
if command -v wt &> /dev/null || command -v wt.exe &> /dev/null; then
|
|
49
|
-
# Get display info for tab
|
|
50
|
-
local display_name icon tab_color
|
|
51
|
-
display_name=$(get_agent_display_name "$agent")
|
|
52
|
-
icon=$(get_agent_icon "$agent")
|
|
53
|
-
tab_color=$(get_agent_tab_color "$agent")
|
|
54
|
-
|
|
55
|
-
# Build tab title with icon
|
|
56
|
-
local tab_title="$display_name"
|
|
57
|
-
if [[ -n "$icon" ]]; then
|
|
58
|
-
tab_title="$icon $display_name"
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
# Convert FORGE_ROOT to Windows path for wt.exe
|
|
62
|
-
# Git Bash paths like /c/foo become C:/foo
|
|
63
|
-
local win_forge_root
|
|
64
|
-
if [[ "$FORGE_ROOT" =~ ^/([a-zA-Z])/ ]]; then
|
|
65
|
-
win_forge_root="${BASH_REMATCH[1]}:${FORGE_ROOT:2}"
|
|
66
|
-
else
|
|
67
|
-
win_forge_root="$FORGE_ROOT"
|
|
68
|
-
fi
|
|
69
|
-
|
|
70
|
-
# Build wt command with optional tab color
|
|
71
|
-
local wt_args=(-w 0 new-tab --title "$tab_title")
|
|
72
|
-
if [[ -n "$tab_color" ]]; then
|
|
73
|
-
wt_args+=(--tabColor "$tab_color")
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
# Windows Terminal: open new tab with forge command
|
|
77
|
-
# SECURITY: $agent has already been validated through resolve_agent
|
|
78
|
-
# SECURITY: Use printf %q to properly escape paths for nested shell invocation
|
|
79
|
-
local escaped_path escaped_agent
|
|
80
|
-
escaped_path=$(printf %q "$win_forge_root")
|
|
81
|
-
escaped_agent=$(printf %q "$agent")
|
|
82
|
-
|
|
83
|
-
if [[ -n "$GIT_BASH_PATH" ]]; then
|
|
84
|
-
local bash_path="${GIT_BASH_PATH//\//\\}"
|
|
85
|
-
wt.exe "${wt_args[@]}" "$bash_path" -c "cd $escaped_path && ./bin/forge.sh start $escaped_agent"
|
|
86
|
-
else
|
|
87
|
-
wt.exe "${wt_args[@]}" bash -c "cd $escaped_path && ./bin/forge.sh start $escaped_agent"
|
|
88
|
-
fi
|
|
89
|
-
log_success "$tab_title spawned in new Windows Terminal tab"
|
|
90
|
-
else
|
|
91
|
-
log_error "wt command not found."
|
|
92
|
-
echo "Make sure Windows Terminal is installed."
|
|
93
|
-
echo ""
|
|
94
|
-
echo "Manual fallback:"
|
|
95
|
-
print_manual_instructions "$agent"
|
|
96
|
-
exit $EXIT_DEPENDENCY_MISSING
|
|
97
|
-
fi
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
print_manual_instructions() {
|
|
101
|
-
local agent="$1"
|
|
102
|
-
local display_name
|
|
103
|
-
display_name=$(get_agent_display_name "$agent")
|
|
104
|
-
|
|
105
|
-
echo ""
|
|
106
|
-
log_info "To start $display_name manually:"
|
|
107
|
-
echo ""
|
|
108
|
-
echo " 1. Open a new terminal window/tab"
|
|
109
|
-
echo " 2. Navigate to: $FORGE_ROOT"
|
|
110
|
-
echo " 3. Run: ./bin/forge.sh start $agent"
|
|
111
|
-
echo ""
|
|
112
|
-
echo "Or copy this command:"
|
|
113
|
-
echo ""
|
|
114
|
-
echo " cd '$FORGE_ROOT' && ./bin/forge.sh start '$agent'"
|
|
115
|
-
echo ""
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
# =============================================================================
|
|
119
|
-
# Main
|
|
120
|
-
# =============================================================================
|
|
121
|
-
|
|
122
|
-
main() {
|
|
123
|
-
local agent="${1:-}"
|
|
124
|
-
|
|
125
|
-
if [[ -z "$agent" ]]; then
|
|
126
|
-
log_error "No agent specified."
|
|
127
|
-
echo ""
|
|
128
|
-
echo "Usage: forge-spawn.sh <agent-name>"
|
|
129
|
-
echo ""
|
|
130
|
-
show_available_agents
|
|
131
|
-
exit $EXIT_INVALID_ARGUMENT
|
|
132
|
-
fi
|
|
133
|
-
|
|
134
|
-
# Resolve alias to canonical agent name (SECURITY: whitelist validation)
|
|
135
|
-
local resolved
|
|
136
|
-
resolved=$(resolve_agent "$agent") || {
|
|
137
|
-
log_error "Unknown agent: $agent"
|
|
138
|
-
echo ""
|
|
139
|
-
show_available_agents
|
|
140
|
-
exit $EXIT_INVALID_ARGUMENT
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
# Load config
|
|
144
|
-
require_forge_config "$FORGE_ROOT"
|
|
145
|
-
|
|
146
|
-
echo ""
|
|
147
|
-
local icon
|
|
148
|
-
icon=$(get_agent_icon "$resolved")
|
|
149
|
-
log_header "${icon:-🔥} Forge Spawn: $(get_agent_display_name "$resolved")"
|
|
150
|
-
if [[ "$agent" != "$resolved" ]]; then
|
|
151
|
-
echo " (resolved from '$agent')"
|
|
152
|
-
fi
|
|
153
|
-
|
|
154
|
-
case "$TERMINAL_TYPE" in
|
|
155
|
-
"windows-terminal")
|
|
156
|
-
spawn_windows_terminal "$resolved"
|
|
157
|
-
;;
|
|
158
|
-
*)
|
|
159
|
-
print_manual_instructions "$resolved"
|
|
160
|
-
;;
|
|
161
|
-
esac
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
main "$@"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Vibe Forge - Agent Spawner
|
|
4
|
+
# Spawns worker agents in new terminal windows/tabs based on configured terminal type
|
|
5
|
+
#
|
|
6
|
+
# Usage: forge-spawn.sh <agent-name>
|
|
7
|
+
#
|
|
8
|
+
# Supports:
|
|
9
|
+
# - Windows Terminal (wt new-tab)
|
|
10
|
+
# - Manual (prints instructions)
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
|
|
15
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
16
|
+
FORGE_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
17
|
+
CONFIG_FILE="$FORGE_ROOT/.forge/config.json"
|
|
18
|
+
|
|
19
|
+
# =============================================================================
|
|
20
|
+
# Load Shared Libraries
|
|
21
|
+
# =============================================================================
|
|
22
|
+
|
|
23
|
+
# shellcheck source=lib/colors.sh
|
|
24
|
+
source "$SCRIPT_DIR/../src/lib/colors.sh"
|
|
25
|
+
# shellcheck source=lib/constants.sh
|
|
26
|
+
source "$SCRIPT_DIR/../src/lib/constants.sh"
|
|
27
|
+
# shellcheck source=lib/config.sh
|
|
28
|
+
source "$SCRIPT_DIR/../src/lib/config.sh"
|
|
29
|
+
# shellcheck source=lib/agents.sh
|
|
30
|
+
source "$SCRIPT_DIR/../src/lib/agents.sh"
|
|
31
|
+
|
|
32
|
+
# Load agent configuration from JSON if available
|
|
33
|
+
if [[ -f "$FORGE_ROOT/$AGENTS_CONFIG" ]]; then
|
|
34
|
+
if ! load_agents_from_json "$FORGE_ROOT/$AGENTS_CONFIG" 2>/dev/null; then
|
|
35
|
+
log_warn "Failed to load agents.json, using fallback defaults"
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# =============================================================================
|
|
40
|
+
# Spawn Functions
|
|
41
|
+
# =============================================================================
|
|
42
|
+
|
|
43
|
+
spawn_windows_terminal() {
|
|
44
|
+
local agent="$1"
|
|
45
|
+
|
|
46
|
+
log_info "Spawning $agent in Windows Terminal..."
|
|
47
|
+
|
|
48
|
+
if command -v wt &> /dev/null || command -v wt.exe &> /dev/null; then
|
|
49
|
+
# Get display info for tab
|
|
50
|
+
local display_name icon tab_color
|
|
51
|
+
display_name=$(get_agent_display_name "$agent")
|
|
52
|
+
icon=$(get_agent_icon "$agent")
|
|
53
|
+
tab_color=$(get_agent_tab_color "$agent")
|
|
54
|
+
|
|
55
|
+
# Build tab title with icon
|
|
56
|
+
local tab_title="$display_name"
|
|
57
|
+
if [[ -n "$icon" ]]; then
|
|
58
|
+
tab_title="$icon $display_name"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# Convert FORGE_ROOT to Windows path for wt.exe
|
|
62
|
+
# Git Bash paths like /c/foo become C:/foo
|
|
63
|
+
local win_forge_root
|
|
64
|
+
if [[ "$FORGE_ROOT" =~ ^/([a-zA-Z])/ ]]; then
|
|
65
|
+
win_forge_root="${BASH_REMATCH[1]}:${FORGE_ROOT:2}"
|
|
66
|
+
else
|
|
67
|
+
win_forge_root="$FORGE_ROOT"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# Build wt command with optional tab color
|
|
71
|
+
local wt_args=(-w 0 new-tab --title "$tab_title")
|
|
72
|
+
if [[ -n "$tab_color" ]]; then
|
|
73
|
+
wt_args+=(--tabColor "$tab_color")
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
# Windows Terminal: open new tab with forge command
|
|
77
|
+
# SECURITY: $agent has already been validated through resolve_agent
|
|
78
|
+
# SECURITY: Use printf %q to properly escape paths for nested shell invocation
|
|
79
|
+
local escaped_path escaped_agent
|
|
80
|
+
escaped_path=$(printf %q "$win_forge_root")
|
|
81
|
+
escaped_agent=$(printf %q "$agent")
|
|
82
|
+
|
|
83
|
+
if [[ -n "$GIT_BASH_PATH" ]]; then
|
|
84
|
+
local bash_path="${GIT_BASH_PATH//\//\\}"
|
|
85
|
+
wt.exe "${wt_args[@]}" "$bash_path" -c "cd $escaped_path && ./bin/forge.sh start $escaped_agent"
|
|
86
|
+
else
|
|
87
|
+
wt.exe "${wt_args[@]}" bash -c "cd $escaped_path && ./bin/forge.sh start $escaped_agent"
|
|
88
|
+
fi
|
|
89
|
+
log_success "$tab_title spawned in new Windows Terminal tab"
|
|
90
|
+
else
|
|
91
|
+
log_error "wt command not found."
|
|
92
|
+
echo "Make sure Windows Terminal is installed."
|
|
93
|
+
echo ""
|
|
94
|
+
echo "Manual fallback:"
|
|
95
|
+
print_manual_instructions "$agent"
|
|
96
|
+
exit $EXIT_DEPENDENCY_MISSING
|
|
97
|
+
fi
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
print_manual_instructions() {
|
|
101
|
+
local agent="$1"
|
|
102
|
+
local display_name
|
|
103
|
+
display_name=$(get_agent_display_name "$agent")
|
|
104
|
+
|
|
105
|
+
echo ""
|
|
106
|
+
log_info "To start $display_name manually:"
|
|
107
|
+
echo ""
|
|
108
|
+
echo " 1. Open a new terminal window/tab"
|
|
109
|
+
echo " 2. Navigate to: $FORGE_ROOT"
|
|
110
|
+
echo " 3. Run: ./bin/forge.sh start $agent"
|
|
111
|
+
echo ""
|
|
112
|
+
echo "Or copy this command:"
|
|
113
|
+
echo ""
|
|
114
|
+
echo " cd '$FORGE_ROOT' && ./bin/forge.sh start '$agent'"
|
|
115
|
+
echo ""
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# =============================================================================
|
|
119
|
+
# Main
|
|
120
|
+
# =============================================================================
|
|
121
|
+
|
|
122
|
+
main() {
|
|
123
|
+
local agent="${1:-}"
|
|
124
|
+
|
|
125
|
+
if [[ -z "$agent" ]]; then
|
|
126
|
+
log_error "No agent specified."
|
|
127
|
+
echo ""
|
|
128
|
+
echo "Usage: forge-spawn.sh <agent-name>"
|
|
129
|
+
echo ""
|
|
130
|
+
show_available_agents
|
|
131
|
+
exit $EXIT_INVALID_ARGUMENT
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
# Resolve alias to canonical agent name (SECURITY: whitelist validation)
|
|
135
|
+
local resolved
|
|
136
|
+
resolved=$(resolve_agent "$agent") || {
|
|
137
|
+
log_error "Unknown agent: $agent"
|
|
138
|
+
echo ""
|
|
139
|
+
show_available_agents
|
|
140
|
+
exit $EXIT_INVALID_ARGUMENT
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# Load config
|
|
144
|
+
require_forge_config "$FORGE_ROOT"
|
|
145
|
+
|
|
146
|
+
echo ""
|
|
147
|
+
local icon
|
|
148
|
+
icon=$(get_agent_icon "$resolved")
|
|
149
|
+
log_header "${icon:-🔥} Forge Spawn: $(get_agent_display_name "$resolved")"
|
|
150
|
+
if [[ "$agent" != "$resolved" ]]; then
|
|
151
|
+
echo " (resolved from '$agent')"
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
case "$TERMINAL_TYPE" in
|
|
155
|
+
"windows-terminal")
|
|
156
|
+
spawn_windows_terminal "$resolved"
|
|
157
|
+
;;
|
|
158
|
+
*)
|
|
159
|
+
print_manual_instructions "$resolved"
|
|
160
|
+
;;
|
|
161
|
+
esac
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
main "$@"
|