Replace standalone Telegram bot with full CodeAnywhere framework fork. BetterBot shares all framework code and customizes only: - instance.py: BetterBot identity, system prompt, feature flags - tools/site_editing/: list_files, read_file, write_file with auto git push - .env: model defaults and site directory paths - compose/: Docker setup with betterlifesg + memoraiz mounts - deploy script: RackNerd with Infisical secrets
9 lines
363 B
Python
9 lines
363 B
Python
import difflib
|
|
|
|
|
|
def generate_diff(old: str, new: str) -> str:
|
|
"""Return a unified diff between two prompt strings, or empty string if identical."""
|
|
old_lines = old.splitlines(keepends=True)
|
|
new_lines = new.splitlines(keepends=True)
|
|
diff = difflib.unified_diff(old_lines, new_lines, fromfile="current", tofile="proposed")
|
|
return "".join(diff)
|