diff --git a/.devcontainer/config.fish b/.devcontainer/config.fish index 620119433f..632341921c 100644 --- a/.devcontainer/config.fish +++ b/.devcontainer/config.fish @@ -104,6 +104,57 @@ function dollarpiece st $argv end +# AC Pack - Package pieces for Teia with cover GIF generation +# Usage: ac-pack '$ceo' or ac-pack 'ceo' (from any directory) +function ac-pack + if test (count $argv) -ne 1 + echo "Usage: ac-pack PIECE_NAME" + echo "Example: ac-pack '\$ceo' or ac-pack 'ceo'" + return 1 + end + + set -l piece_name $argv[1] + set -l current_dir (pwd) + + # Store original directory + echo "📂 Packaging $piece_name from $current_dir" + + # Run the ac-pack.mjs script from the teia directory + cd /workspaces/aesthetic-computer/teia + + # Run the packaging with the piece name + node ac-pack.mjs $piece_name + + # Check if packaging was successful + if test $status -eq 0 + # Find the generated zip file and cover GIF + set -l zip_files (find /workspaces/aesthetic-computer/teia/output -name "*.zip" -newer /workspaces/aesthetic-computer/teia/ac-pack.mjs 2>/dev/null) + set -l cover_files (find /workspaces/aesthetic-computer/teia/output -name "*-cover.gif" -newer /workspaces/aesthetic-computer/teia/ac-pack.mjs 2>/dev/null) + + # Copy files to the original directory + for zip_file in $zip_files + if test -f $zip_file + cp $zip_file $current_dir/ + echo "📦 Copied (basename $zip_file) to $current_dir" + end + end + + for cover_file in $cover_files + if test -f $cover_file + cp $cover_file $current_dir/ + echo "🖼️ Copied (basename $cover_file) to $current_dir" + end + end + + echo "✅ AC Pack complete! Files copied to $current_dir" + else + echo "❌ AC Pack failed with exit code $status" + end + + # Return to original directory + cd $current_dir +end + # always start in aesthetic-computer directory if there was a greeting if not test "$nogreet" = true cd ~/aesthetic-computer diff --git a/monitor-emacs.sh b/monitor-emacs.sh new file mode 100644 index 0000000000..573e2e341f --- /dev/null +++ b/monitor-emacs.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Monitor Emacs loading process +echo "=== Starting Emacs Load Monitor ===" +echo "Time: $(date)" +echo "PID: $$" + +# Clear previous debug log +rm -f /tmp/emacs-debug.log + +# Function to log system metrics +log_metrics() { + echo "=== METRICS $(date) ===" + echo "Load Average: $(uptime | awk -F'load average:' '{ print $2 }')" + echo "Memory Usage:" + free -h + echo "Top CPU processes:" + ps aux --sort=-%cpu | head -10 + echo "Emacs processes:" + ps aux | grep -E "(emacs|aesthetic)" | grep -v grep + echo "Open files by emacs:" + lsof -c emacs 2>/dev/null | wc -l || echo "No emacs processes" + echo "Network connections:" + ss -an | grep ESTABLISHED | wc -l 2>/dev/null || echo "0" + echo "---" +} + +# Monitor in background +while true; do + log_metrics + sleep 2 +done & + +MONITOR_PID=$! + +echo "Monitor started with PID: $MONITOR_PID" +echo "Debug log will be at: /tmp/emacs-debug.log" +echo "Kill monitor with: kill $MONITOR_PID" + +# Keep script running +wait \ No newline at end of file diff --git a/teia/ac-pack.mjs b/teia/ac-pack.mjs index 83ff31bd7e..21a8f1165b 100644 --- a/teia/ac-pack.mjs +++ b/teia/ac-pack.mjs @@ -814,8 +814,8 @@ export function boot({ wipe, ink, help, backgroundFill }) { this.pieceName, // piece (supports KidLisp $code or .mjs files) 360, // 6 seconds at 60fps (360 frames) for cover tempOutputDir, // temporary output directory - 400, // width - 400, // height + 512, // width + 512, // height { gifMode: true } // enable GIF mode ); @@ -853,9 +853,9 @@ export function boot({ wipe, ink, help, backgroundFill }) { // Fallback to SVG cover if GIF generation fails const coverPath = path.join(this.options.outputDir, "cover.svg"); - const coverSvg = ` - - ${this.pieceName} + const coverSvg = ` + + ${this.pieceName} `; await fs.writeFile(coverPath, coverSvg); console.log("🖼️ Generated fallback cover: cover.svg");