claude-symphony 0.0.1 → 0.0.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.
- package/README.md +16 -12
- package/assets/claude_symphony.webp +0 -0
- package/assets/claude_symphony_ascii.txt +8 -0
- package/bin/create.js +80 -69
- package/package.json +3 -2
- package/template/.claude/commands/benchmark.md +32 -32
- package/template/.claude/commands/brainstorm.md +33 -33
- package/template/.claude/commands/checkpoint.md +42 -42
- package/template/.claude/commands/codex.md +52 -52
- package/template/.claude/commands/collaborate.md +47 -47
- package/template/.claude/commands/context.md +77 -77
- package/template/.claude/commands/deploy.md +50 -50
- package/template/.claude/commands/fork.md +46 -46
- package/template/.claude/commands/gemini.md +43 -43
- package/template/.claude/commands/handoff.md +42 -42
- package/template/.claude/commands/implement.md +42 -42
- package/template/.claude/commands/init-project.md +25 -25
- package/template/.claude/commands/next.md +67 -67
- package/template/.claude/commands/planning.md +38 -38
- package/template/.claude/commands/qa.md +47 -47
- package/template/.claude/commands/refactor.md +50 -50
- package/template/.claude/commands/research.md +31 -31
- package/template/.claude/commands/restore.md +53 -53
- package/template/.claude/commands/run-stage.md +45 -45
- package/template/.claude/commands/stages.md +49 -49
- package/template/.claude/commands/status.md +41 -41
- package/template/.claude/commands/tasks.md +33 -33
- package/template/.claude/commands/test.md +45 -45
- package/template/.claude/commands/ui-ux.md +31 -31
- package/template/.claude/commands/validate.md +81 -81
- package/template/.claude/hooks/ai-selector.sh +39 -39
- package/template/.claude/hooks/auto-checkpoint.sh +30 -30
- package/template/.claude/hooks/output-validator.sh +45 -45
- package/template/.claude/hooks/post-stage.sh +28 -28
- package/template/.claude/hooks/pre-stage.sh +47 -47
- package/template/.claude/hooks/session-start.sh +27 -27
- package/template/.claude/hooks/statusline.sh +24 -24
- package/template/.claude/hooks/stop.sh +26 -26
- package/template/.claude/settings.json +32 -32
- package/template/.claude/skills/ai-collaboration/README.md +31 -31
- package/template/.claude/skills/ai-collaboration/debate.md +66 -66
- package/template/.claude/skills/ai-collaboration/parallel.md +34 -34
- package/template/.claude/skills/ai-collaboration/prompts/CLAUDE.md +59 -63
- package/template/.claude/skills/auto-checkpoint/README.md +46 -46
- package/template/.claude/skills/auto-checkpoint/prompts/CLAUDE.md +68 -72
- package/template/.claude/skills/auto-checkpoint/rollback.md +95 -95
- package/template/.claude/skills/auto-checkpoint/trigger.md +37 -37
- package/template/.claude/skills/context-compression/README.md +69 -69
- package/template/.claude/skills/context-compression/analyze.md +74 -74
- package/template/.claude/skills/context-compression/compress.md +103 -103
- package/template/.claude/skills/context-compression/prompts/compression.md +78 -78
- package/template/.claude/skills/output-validator/README.md +33 -33
- package/template/.claude/skills/output-validator/prompts/CLAUDE.md +74 -78
- package/template/.claude/skills/output-validator/validate.md +76 -76
- package/template/.claude/skills/smart-handoff/README.md +35 -35
- package/template/.claude/skills/smart-handoff/extract.md +42 -42
- package/template/.claude/skills/smart-handoff/prompts/CLAUDE.md +52 -54
- package/template/.claude/skills/smart-handoff/summarize.md +55 -55
- package/template/.claude/skills/stage-transition/README.md +50 -50
- package/template/.claude/skills/stage-transition/handoff-gen.md +89 -89
- package/template/.claude/skills/stage-transition/prompts/transition.md +74 -74
- package/template/.claude/skills/stage-transition/validate.md +41 -41
- package/template/CLAUDE.md +334 -335
- package/template/config/ai_benchmarking.yaml +22 -22
- package/template/config/ai_collaboration.yaml +18 -18
- package/template/config/ai_logging.yaml +50 -50
- package/template/config/auto_checkpoint.yaml +32 -32
- package/template/config/context.yaml +20 -20
- package/template/config/git.yaml +51 -51
- package/template/config/handoff_intelligence.yaml +23 -23
- package/template/config/mcp_fallbacks.yaml +71 -71
- package/template/config/memory_integration.yaml +23 -23
- package/template/config/model_enforcement.yaml +53 -53
- package/template/config/models.yaml +24 -24
- package/template/config/output_validation.yaml +44 -44
- package/template/config/pipeline.yaml +25 -25
- package/template/config/pipeline_forking.yaml +40 -40
- package/template/config/qa_logging.yaml +67 -67
- package/template/config/smart_rollback.yaml +48 -48
- package/template/config/stage_personas.yaml +154 -154
- package/template/config/workflow.yaml +16 -16
- package/template/scripts/ai-benchmark.sh +41 -41
- package/template/scripts/codex-wrapper.sh +32 -32
- package/template/scripts/context-manager.sh +136 -136
- package/template/scripts/create-checkpoint.sh +34 -34
- package/template/scripts/gemini-wrapper.sh +31 -31
- package/template/scripts/init-project.sh +40 -40
- package/template/scripts/list-stages.sh +30 -30
- package/template/scripts/next-stage.sh +67 -67
- package/template/scripts/output-validate.sh +2 -2
- package/template/scripts/pipeline-fork.sh +68 -68
- package/template/scripts/pre-run-check.sh +84 -84
- package/template/scripts/restore-checkpoint.sh +50 -50
- package/template/scripts/run-stage.sh +44 -44
- package/template/scripts/show-status.sh +30 -30
- package/template/scripts/smart-handoff.sh +70 -70
- package/template/stages/01-brainstorm/CLAUDE.md +70 -74
- package/template/stages/01-brainstorm/README.md +54 -54
- package/template/stages/01-brainstorm/config.yaml +18 -18
- package/template/stages/01-brainstorm/prompts/collaboration.md +24 -24
- package/template/stages/01-brainstorm/prompts/ideation.md +41 -41
- package/template/stages/01-brainstorm/prompts/persona.md +50 -50
- package/template/stages/01-brainstorm/prompts/requirements.md +55 -55
- package/template/stages/01-brainstorm/prompts/validation.md +28 -28
- package/template/stages/01-brainstorm/templates/ideas.md +47 -47
- package/template/stages/01-brainstorm/templates/requirements_analysis.md +61 -61
- package/template/stages/02-research/CLAUDE.md +72 -76
- package/template/stages/02-research/config.yaml +12 -12
- package/template/stages/02-research/prompts/collaboration.md +29 -29
- package/template/stages/02-research/prompts/feasibility.md +38 -38
- package/template/stages/02-research/prompts/market_analysis.md +29 -29
- package/template/stages/02-research/prompts/tech_stack.md +34 -34
- package/template/stages/02-research/prompts/validation.md +29 -29
- package/template/stages/03-planning/CLAUDE.md +88 -92
- package/template/stages/03-planning/config.yaml +10 -10
- package/template/stages/03-planning/prompts/architecture.md +43 -43
- package/template/stages/03-planning/prompts/collaboration.md +34 -34
- package/template/stages/03-planning/prompts/validation.md +34 -34
- package/template/stages/04-ui-ux/CLAUDE.md +68 -72
- package/template/stages/04-ui-ux/config.yaml +5 -5
- package/template/stages/04-ui-ux/prompts/collaboration.md +35 -35
- package/template/stages/04-ui-ux/prompts/validation.md +30 -30
- package/template/stages/05-task-management/CLAUDE.md +81 -85
- package/template/stages/05-task-management/config.yaml +17 -17
- package/template/stages/05-task-management/prompts/collaboration.md +30 -30
- package/template/stages/05-task-management/prompts/validation.md +33 -33
- package/template/stages/05-task-management/templates/notion_integration.md +70 -70
- package/template/stages/05-task-management/templates/parallel_groups.yaml +64 -64
- package/template/stages/05-task-management/templates/task_schema.yaml +33 -33
- package/template/stages/06-implementation/CLAUDE.md +117 -121
- package/template/stages/06-implementation/config.yaml +10 -10
- package/template/stages/06-implementation/prompts/collaboration.md +29 -29
- package/template/stages/06-implementation/prompts/validation.md +36 -36
- package/template/stages/07-refactoring/CLAUDE.md +120 -124
- package/template/stages/07-refactoring/config.yaml +11 -11
- package/template/stages/07-refactoring/prompts/collaboration.md +36 -36
- package/template/stages/07-refactoring/prompts/validation.md +40 -40
- package/template/stages/08-qa/CLAUDE.md +80 -84
- package/template/stages/08-qa/config.yaml +7 -7
- package/template/stages/08-qa/prompts/collaboration.md +34 -34
- package/template/stages/08-qa/prompts/validation.md +41 -41
- package/template/stages/09-testing/CLAUDE.md +86 -90
- package/template/stages/09-testing/config.yaml +10 -10
- package/template/stages/09-testing/prompts/collaboration.md +38 -38
- package/template/stages/09-testing/prompts/validation.md +41 -41
- package/template/stages/10-deployment/CLAUDE.md +86 -90
- package/template/stages/10-deployment/config.yaml +11 -11
- package/template/stages/10-deployment/prompts/collaboration.md +37 -37
- package/template/stages/10-deployment/prompts/validation.md +54 -54
- package/template/stages/10-deployment/templates/github-actions-cd.yaml +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# claude-symphony AI Benchmarking Script
|
|
3
|
-
# AI
|
|
3
|
+
# AI model performance comparison and benchmarking
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ CONFIG_FILE="$PROJECT_ROOT/config/ai_benchmarking.yaml"
|
|
|
10
10
|
BENCHMARKS_DIR="$PROJECT_ROOT/state/ai_benchmarks"
|
|
11
11
|
REPORTS_DIR="$BENCHMARKS_DIR/reports"
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# Color definitions
|
|
14
14
|
RED='\033[0;31m'
|
|
15
15
|
GREEN='\033[0;32m'
|
|
16
16
|
YELLOW='\033[1;33m'
|
|
@@ -18,56 +18,56 @@ BLUE='\033[0;34m'
|
|
|
18
18
|
CYAN='\033[0;36m'
|
|
19
19
|
NC='\033[0m'
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Log functions
|
|
22
22
|
log_info() { echo -e "${BLUE}[BENCHMARK]${NC} $1"; }
|
|
23
23
|
log_success() { echo -e "${GREEN}[BENCHMARK]${NC} $1"; }
|
|
24
24
|
log_warning() { echo -e "${YELLOW}[BENCHMARK]${NC} $1"; }
|
|
25
25
|
log_error() { echo -e "${RED}[BENCHMARK]${NC} $1"; }
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# Ensure directories exist
|
|
28
28
|
ensure_dirs() {
|
|
29
29
|
mkdir -p "$BENCHMARKS_DIR"
|
|
30
30
|
mkdir -p "$REPORTS_DIR"
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# Print usage
|
|
34
34
|
print_usage() {
|
|
35
|
-
echo "
|
|
35
|
+
echo "Usage: $0 [options]"
|
|
36
36
|
echo ""
|
|
37
|
-
echo "
|
|
38
|
-
echo " --task TYPE
|
|
39
|
-
echo " --models MODELS
|
|
40
|
-
echo " --samples N
|
|
41
|
-
echo " --verbose
|
|
42
|
-
echo " --history PERIOD
|
|
43
|
-
echo " --help
|
|
37
|
+
echo "Options:"
|
|
38
|
+
echo " --task TYPE Benchmark task type (code_generation, refactoring, test_generation)"
|
|
39
|
+
echo " --models MODELS Models to compare (comma-separated, e.g., claude,codex)"
|
|
40
|
+
echo " --samples N Number of sample tasks (default: 3)"
|
|
41
|
+
echo " --verbose Verbose output"
|
|
42
|
+
echo " --history PERIOD View history (daily, weekly, monthly)"
|
|
43
|
+
echo " --help Show help"
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
#
|
|
46
|
+
# Run benchmark
|
|
47
47
|
run_benchmark() {
|
|
48
48
|
local task_type="$1"
|
|
49
49
|
local models="$2"
|
|
50
50
|
local samples="$3"
|
|
51
51
|
local verbose="$4"
|
|
52
52
|
|
|
53
|
-
log_info "
|
|
54
|
-
log_info "
|
|
55
|
-
log_info "
|
|
53
|
+
log_info "Starting benchmark: $task_type"
|
|
54
|
+
log_info "Models: $models"
|
|
55
|
+
log_info "Samples: $samples"
|
|
56
56
|
|
|
57
57
|
ensure_dirs
|
|
58
58
|
|
|
59
59
|
local timestamp=$(date +%Y%m%d_%H%M%S)
|
|
60
60
|
local result_file="$BENCHMARKS_DIR/benchmark_${task_type}_${timestamp}.json"
|
|
61
61
|
|
|
62
|
-
#
|
|
62
|
+
# Initialize model scores
|
|
63
63
|
declare -A model_scores
|
|
64
64
|
|
|
65
65
|
IFS=',' read -ra model_array <<< "$models"
|
|
66
66
|
|
|
67
67
|
for model in "${model_array[@]}"; do
|
|
68
|
-
log_info "
|
|
68
|
+
log_info "Testing model: $model"
|
|
69
69
|
|
|
70
|
-
#
|
|
70
|
+
# Simulated scores (in actual implementation, real tests would be performed)
|
|
71
71
|
case "$model" in
|
|
72
72
|
"claude"|"claudecode")
|
|
73
73
|
model_scores[$model]=$(echo "scale=2; 0.85 + ($RANDOM % 10) / 100" | bc)
|
|
@@ -83,10 +83,10 @@ run_benchmark() {
|
|
|
83
83
|
;;
|
|
84
84
|
esac
|
|
85
85
|
|
|
86
|
-
log_info "
|
|
86
|
+
log_info " Score: ${model_scores[$model]}"
|
|
87
87
|
done
|
|
88
88
|
|
|
89
|
-
#
|
|
89
|
+
# Find best scoring model
|
|
90
90
|
local best_model=""
|
|
91
91
|
local best_score=0
|
|
92
92
|
|
|
@@ -97,7 +97,7 @@ run_benchmark() {
|
|
|
97
97
|
fi
|
|
98
98
|
done
|
|
99
99
|
|
|
100
|
-
#
|
|
100
|
+
# Save results
|
|
101
101
|
cat > "$result_file" << EOF
|
|
102
102
|
{
|
|
103
103
|
"task_type": "$task_type",
|
|
@@ -112,19 +112,19 @@ $(for model in "${!model_scores[@]}"; do echo " \"$model\": ${model_score
|
|
|
112
112
|
}
|
|
113
113
|
EOF
|
|
114
114
|
|
|
115
|
-
# latest.json
|
|
115
|
+
# Update latest.json
|
|
116
116
|
cp "$result_file" "$BENCHMARKS_DIR/latest.json"
|
|
117
117
|
|
|
118
|
-
#
|
|
118
|
+
# Output results
|
|
119
119
|
echo ""
|
|
120
120
|
echo "=========================================="
|
|
121
|
-
echo "
|
|
121
|
+
echo " Benchmark Results: $task_type"
|
|
122
122
|
echo "=========================================="
|
|
123
123
|
echo ""
|
|
124
|
-
echo "|
|
|
125
|
-
echo "
|
|
124
|
+
echo "| Model | Score | Rank |"
|
|
125
|
+
echo "|-------|-------|------|"
|
|
126
126
|
|
|
127
|
-
#
|
|
127
|
+
# Output sorted by score
|
|
128
128
|
local rank=1
|
|
129
129
|
for model in $(for m in "${!model_scores[@]}"; do echo "$m ${model_scores[$m]}"; done | sort -k2 -rn | cut -d' ' -f1); do
|
|
130
130
|
local score=${model_scores[$model]}
|
|
@@ -137,14 +137,14 @@ EOF
|
|
|
137
137
|
done
|
|
138
138
|
|
|
139
139
|
echo ""
|
|
140
|
-
log_success "
|
|
141
|
-
log_info "
|
|
140
|
+
log_success "Recommended model: $best_model (score: $best_score)"
|
|
141
|
+
log_info "Results saved: $result_file"
|
|
142
142
|
|
|
143
|
-
#
|
|
143
|
+
# Generate report
|
|
144
144
|
generate_report "$task_type" "$result_file"
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
#
|
|
147
|
+
# Generate report
|
|
148
148
|
generate_report() {
|
|
149
149
|
local task_type="$1"
|
|
150
150
|
local result_file="$2"
|
|
@@ -176,18 +176,18 @@ Based on the benchmark results, the recommended model for **$task_type** tasks i
|
|
|
176
176
|
Generated by claude-symphony AI Benchmark System
|
|
177
177
|
EOF
|
|
178
178
|
|
|
179
|
-
log_info "
|
|
179
|
+
log_info "Report generated: $report_file"
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
#
|
|
182
|
+
# Show history
|
|
183
183
|
show_history() {
|
|
184
184
|
local period="$1"
|
|
185
185
|
|
|
186
|
-
log_info "
|
|
186
|
+
log_info "Viewing history: $period"
|
|
187
187
|
|
|
188
188
|
echo ""
|
|
189
189
|
echo "=========================================="
|
|
190
|
-
echo "
|
|
190
|
+
echo " Benchmark History ($period)"
|
|
191
191
|
echo "=========================================="
|
|
192
192
|
echo ""
|
|
193
193
|
|
|
@@ -206,7 +206,7 @@ show_history() {
|
|
|
206
206
|
;;
|
|
207
207
|
esac
|
|
208
208
|
|
|
209
|
-
#
|
|
209
|
+
# List recent benchmark files
|
|
210
210
|
find "$BENCHMARKS_DIR" -name "benchmark_*.json" -mtime -$days 2>/dev/null | while read -r file; do
|
|
211
211
|
if [ -f "$file" ]; then
|
|
212
212
|
local task=$(cat "$file" | grep -o '"task_type"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
|
|
@@ -219,7 +219,7 @@ show_history() {
|
|
|
219
219
|
done
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
#
|
|
222
|
+
# Main execution
|
|
223
223
|
main() {
|
|
224
224
|
local task_type="code_generation"
|
|
225
225
|
local models="claude,codex"
|
|
@@ -227,7 +227,7 @@ main() {
|
|
|
227
227
|
local verbose=false
|
|
228
228
|
local history=""
|
|
229
229
|
|
|
230
|
-
#
|
|
230
|
+
# Parse arguments
|
|
231
231
|
while [[ $# -gt 0 ]]; do
|
|
232
232
|
case "$1" in
|
|
233
233
|
--task)
|
|
@@ -255,7 +255,7 @@ main() {
|
|
|
255
255
|
exit 0
|
|
256
256
|
;;
|
|
257
257
|
*)
|
|
258
|
-
log_error "
|
|
258
|
+
log_error "Unknown option: $1"
|
|
259
259
|
print_usage
|
|
260
260
|
exit 1
|
|
261
261
|
;;
|
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# codex-wrapper.sh - tmux
|
|
2
|
+
# codex-wrapper.sh - tmux-based Codex CLI wrapper
|
|
3
3
|
# claude-symphony workflow pipeline
|
|
4
|
-
# tmux wait-for
|
|
4
|
+
# tmux wait-for channel-based synchronization (no polling, immediate response)
|
|
5
5
|
|
|
6
6
|
SESSION_NAME="ax-codex"
|
|
7
7
|
CHANNEL="ax-codex-done-$$"
|
|
8
8
|
OUTPUT_FILE="/tmp/ax-codex-output-$$"
|
|
9
9
|
PROMPT="$1"
|
|
10
|
-
TIMEOUT="${2:-300}" #
|
|
10
|
+
TIMEOUT="${2:-300}" # Default 5 minute timeout
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# Color definitions
|
|
13
13
|
RED='\033[0;31m'
|
|
14
14
|
GREEN='\033[0;32m'
|
|
15
15
|
YELLOW='\033[1;33m'
|
|
16
16
|
BLUE='\033[0;34m'
|
|
17
17
|
NC='\033[0m' # No Color
|
|
18
18
|
|
|
19
|
-
#
|
|
19
|
+
# Usage
|
|
20
20
|
if [ -z "$PROMPT" ]; then
|
|
21
|
-
echo "
|
|
22
|
-
echo "
|
|
21
|
+
echo "Usage: $0 \"<prompt>\" [timeout_seconds]"
|
|
22
|
+
echo "Example: $0 \"Refactor this function\" 300"
|
|
23
23
|
exit 1
|
|
24
24
|
fi
|
|
25
25
|
|
|
26
|
-
# tmux
|
|
26
|
+
# Check tmux
|
|
27
27
|
if ! command -v tmux &> /dev/null; then
|
|
28
|
-
echo -e "${RED}
|
|
29
|
-
echo "
|
|
28
|
+
echo -e "${RED}Error:${NC} tmux is not installed."
|
|
29
|
+
echo "Install: brew install tmux (macOS) or apt install tmux (Ubuntu)"
|
|
30
30
|
exit 1
|
|
31
31
|
fi
|
|
32
32
|
|
|
33
|
-
# Codex CLI
|
|
33
|
+
# Check Codex CLI
|
|
34
34
|
if ! command -v codex &> /dev/null; then
|
|
35
|
-
echo -e "${YELLOW}
|
|
36
|
-
echo "
|
|
35
|
+
echo -e "${YELLOW}Warning:${NC} codex CLI is not installed."
|
|
36
|
+
echo "Running in simulation mode without Codex CLI."
|
|
37
37
|
echo ""
|
|
38
|
-
echo "[
|
|
38
|
+
echo "[Simulation] Codex response:"
|
|
39
39
|
echo "---"
|
|
40
|
-
echo "Codex CLI
|
|
41
|
-
echo "
|
|
40
|
+
echo "Actual response will be displayed when Codex CLI is installed."
|
|
41
|
+
echo "Prompt: $PROMPT"
|
|
42
42
|
exit 0
|
|
43
43
|
fi
|
|
44
44
|
|
|
45
|
-
#
|
|
45
|
+
# Cleanup temporary files
|
|
46
46
|
cleanup() {
|
|
47
47
|
rm -f "$OUTPUT_FILE"
|
|
48
48
|
}
|
|
49
49
|
trap cleanup EXIT
|
|
50
50
|
|
|
51
51
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
52
|
-
echo -e "${BLUE}🤖 Codex CLI
|
|
52
|
+
echo -e "${BLUE}🤖 Codex CLI Call${NC}"
|
|
53
53
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
54
|
-
echo "
|
|
55
|
-
echo "
|
|
54
|
+
echo " Session: $SESSION_NAME"
|
|
55
|
+
echo " Timeout: ${TIMEOUT}s"
|
|
56
56
|
echo ""
|
|
57
57
|
|
|
58
|
-
# tmux
|
|
58
|
+
# Check/create tmux session
|
|
59
59
|
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
|
|
60
|
-
echo -e "${YELLOW}⚠${NC}
|
|
60
|
+
echo -e "${YELLOW}⚠${NC} Creating new tmux session: $SESSION_NAME"
|
|
61
61
|
tmux new-session -d -s "$SESSION_NAME"
|
|
62
62
|
sleep 1
|
|
63
63
|
fi
|
|
64
64
|
|
|
65
|
-
#
|
|
65
|
+
# Escape prompt
|
|
66
66
|
ESCAPED_PROMPT=$(printf '%s' "$PROMPT" | sed 's/"/\\"/g' | sed "s/'/'\\\\''/g")
|
|
67
67
|
|
|
68
|
-
# Codex CLI
|
|
69
|
-
# Issue #2, #13
|
|
70
|
-
echo -e "${BLUE}Codex
|
|
68
|
+
# Execute Codex CLI + signal channel on completion
|
|
69
|
+
# Issue #2, #13 resolution: --full-auto option added by default
|
|
70
|
+
echo -e "${BLUE}Calling Codex... (--full-auto mode)${NC}"
|
|
71
71
|
tmux send-keys -t "$SESSION_NAME" "codex --full-auto \"$ESCAPED_PROMPT\" 2>&1 | tee $OUTPUT_FILE; tmux wait-for -S $CHANNEL" Enter
|
|
72
72
|
|
|
73
|
-
#
|
|
73
|
+
# Background timer for timeout handling
|
|
74
74
|
(sleep "$TIMEOUT" && tmux wait-for -S "$CHANNEL" 2>/dev/null) &
|
|
75
75
|
TIMER_PID=$!
|
|
76
76
|
|
|
77
|
-
#
|
|
77
|
+
# Wait for channel signal (blocking)
|
|
78
78
|
tmux wait-for "$CHANNEL"
|
|
79
79
|
kill $TIMER_PID 2>/dev/null || true
|
|
80
80
|
|
|
81
|
-
#
|
|
81
|
+
# Output results
|
|
82
82
|
echo ""
|
|
83
83
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
84
|
-
echo -e "${GREEN}📄 Codex
|
|
84
|
+
echo -e "${GREEN}📄 Codex Response:${NC}"
|
|
85
85
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
86
86
|
|
|
87
87
|
if [[ -f "$OUTPUT_FILE" ]]; then
|
|
88
88
|
cat "$OUTPUT_FILE"
|
|
89
89
|
else
|
|
90
|
-
echo -e "${RED}
|
|
90
|
+
echo -e "${RED}Error:${NC} Failed to capture output."
|
|
91
91
|
exit 1
|
|
92
92
|
fi
|
|
93
93
|
|
|
94
94
|
echo ""
|
|
95
95
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
96
|
-
echo -e "${GREEN}✓${NC} Codex
|
|
96
|
+
echo -e "${GREEN}✓${NC} Codex call completed"
|
|
97
97
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|