2025-10-11 12:29:03 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2025-10-13 17:43:03 -03:00
|
|
|
PROJECT_ROOT="$SCRIPT_DIR"
|
2025-10-18 22:25:59 -03:00
|
|
|
OUTPUT_FILE="/tmp/prompt.out"
|
2025-10-19 11:08:23 -03:00
|
|
|
|
2025-10-13 17:43:03 -03:00
|
|
|
echo "Please, fix this consolidated LLM Context" > "$OUTPUT_FILE"
|
2025-10-11 12:29:03 -03:00
|
|
|
|
|
|
|
|
prompts=(
|
2025-10-19 11:08:23 -03:00
|
|
|
"./prompts/dev/platform/fix-errors.md"
|
2025-10-18 22:25:59 -03:00
|
|
|
"./prompts/dev/platform/shared.md"
|
2025-10-13 17:43:03 -03:00
|
|
|
"./Cargo.toml"
|
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-18 22:25:59 -03:00
|
|
|
#"bot"
|
2025-10-19 19:28:08 -03:00
|
|
|
"bootstrap"
|
2025-10-13 17:43:03 -03:00
|
|
|
#"channels"
|
2025-10-19 19:28:08 -03:00
|
|
|
#"config"
|
2025-10-13 17:43:03 -03:00
|
|
|
#"context"
|
2025-10-11 12:29:03 -03:00
|
|
|
#"email"
|
2025-10-11 20:41:52 -03:00
|
|
|
#"file"
|
2025-10-13 17:43:03 -03:00
|
|
|
#"llm"
|
2025-10-11 12:29:03 -03:00
|
|
|
#"llm_legacy"
|
|
|
|
|
#"org"
|
2025-10-19 11:08:23 -03:00
|
|
|
"package_manager"
|
|
|
|
|
#"session"
|
2025-10-19 19:28:08 -03:00
|
|
|
"shared"
|
2025-10-11 12:29:03 -03:00
|
|
|
#"tests"
|
2025-10-12 20:12:49 -03:00
|
|
|
#"tools"
|
2025-10-11 12:29:03 -03:00
|
|
|
#"web_automation"
|
2025-10-13 17:43:03 -03:00
|
|
|
#"whatsapp"
|
2025-10-11 12:29:03 -03:00
|
|
|
)
|
|
|
|
|
for dir in "${dirs[@]}"; do
|
|
|
|
|
find "$PROJECT_ROOT/src/$dir" -name "*.rs" | while read file; do
|
2025-10-13 00:31:08 -03:00
|
|
|
echo $file >> "$OUTPUT_FILE"
|
2025-10-11 12:29:03 -03:00
|
|
|
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-13 09:36:06 -03:00
|
|
|
echo "$PROJECT_ROOT/src/main.rs" >> "$OUTPUT_FILE"
|
2025-10-11 12:29:03 -03:00
|
|
|
cat "$PROJECT_ROOT/src/main.rs" >> "$OUTPUT_FILE"
|
2025-10-13 09:36:06 -03:00
|
|
|
|
2025-10-11 12:29:03 -03:00
|
|
|
|
|
|
|
|
echo "" >> "$OUTPUT_FILE"
|
2025-10-19 19:28:08 -03:00
|
|
|
echo "Compiling..."
|
2025-10-13 17:43:03 -03:00
|
|
|
cargo build --message-format=short 2>&1 | grep -E 'error' >> "$OUTPUT_FILE"
|
2025-10-18 22:25:59 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# Calculate and display token count (approximation: words * 1.3)
|
|
|
|
|
WORD_COUNT=$(wc -w < "$OUTPUT_FILE")
|
|
|
|
|
TOKEN_COUNT=$(echo "$WORD_COUNT * 1.3 / 1" | bc)
|
|
|
|
|
FILE_SIZE=$(wc -c < "$OUTPUT_FILE")
|
|
|
|
|
|
|
|
|
|
echo "" >> "$OUTPUT_FILE"
|
|
|
|
|
|
|
|
|
|
echo "Approximate token count: $TOKEN_COUNT"
|
|
|
|
|
echo "Context size: $FILE_SIZE bytes"
|
|
|
|
|
|
|
|
|
|
cat "$OUTPUT_FILE" | xclip -selection clipboard
|
|
|
|
|
echo "Content copied to clipboard (xclip)"
|
|
|
|
|
rm -f "$OUTPUT_FILE"
|