botserver/scripts/dev/build_prompt.sh

55 lines
1.1 KiB
Bash
Raw Normal View History

2025-10-11 12:29:03 -03:00
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
OUTPUT_FILE="$SCRIPT_DIR/prompt.out"
rm $OUTPUT_FILE
echo "Consolidated LLM Context" > "$OUTPUT_FILE"
prompts=(
2025-10-11 13:29:38 -03:00
"../../prompts/dev/shared.md"
2025-10-11 12:29:03 -03:00
"../../Cargo.toml"
2025-10-11 13:29:38 -03:00
"../../prompts/dev/fix.md"
#"../../prompts/dev/generation.md"
2025-10-11 12:29:03 -03:00
)
for file in "${prompts[@]}"; do
cat "$file" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
done
dirs=(
#"auth"
2025-10-11 20:41:52 -03:00
#"automation"
#"basic"
2025-10-11 12:29:03 -03:00
"bot"
#"channels"
2025-10-11 13:29:38 -03:00
#"config"
2025-10-11 20:41:52 -03:00
#"context"
2025-10-11 12:29:03 -03:00
#"email"
2025-10-11 20:41:52 -03:00
#"file"
2025-10-11 13:29:38 -03:00
#"llm"
2025-10-11 12:29:03 -03:00
#"llm_legacy"
#"org"
2025-10-11 13:29:38 -03:00
"session"
2025-10-11 20:41:52 -03:00
#"shared"
2025-10-11 12:29:03 -03:00
#"tests"
2025-10-11 20:41:52 -03:00
#"tools"
2025-10-11 12:29:03 -03:00
#"web_automation"
#"whatsapp"
)
2025-10-11 13:29:38 -03:00
dirs=() # disabled.
2025-10-11 12:29:03 -03:00
for dir in "${dirs[@]}"; do
find "$PROJECT_ROOT/src/$dir" -name "*.rs" | while read file; do
cat "$file" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
done
done
2025-10-11 13:29:38 -03:00
# Also append the specific files you mentioned
2025-10-11 12:29:03 -03:00
cat "$PROJECT_ROOT/src/main.rs" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
2025-10-11 13:29:38 -03:00
cargo build --message-format=short 2>&1 | grep -E 'error' >> "$OUTPUT_FILE"