#!/usr/bin/env python3 import sys import readline from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent)) from src.shorekeeper import SHOREKEEPER def print_banner(): print(""" ╔══════════════════════════════════════════════════════════╗ ║ ║ ║ ███████╗██╗ ██╗ ██████╗ ██████╗ ███████╗██╗ ██╗ ║ ║ ██╔════╝██║ ██║██╔═══██╗██╔══██╗██╔════╝██║ ██╔╝ ║ ║ ███████╗███████║██║ ██║██████╔╝█████╗ █████╔╝ ║ ║ ╚════██║██╔══██║██║ ██║██╔══██╗██╔══╝ ██╔═██╗ ║ ║ ███████║██║ ██║╚██████╔╝██║ ██║███████╗██║ ██╗ ║ ║ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ║ ║ ║ ║ SHOREKEEPER-4B ║ ║ The AI with 12 Specialized Experts ║ ║ ║ ╚══════════════════════════════════════════════════════════╝ Commands: /remember - Store in memory /recall - Search memory /run - Execute in sandbox /project - Create project on 3TB drive /exit - Goodbye """) def main(): print_banner() print("Loading SHOREKEEPER-4B...") model = SHOREKEEPER() print("SHOREKEEPER is ready. Type /help for commands.\n") while True: try: user_input = input("\nYou: ").strip() if not user_input: continue if user_input == "/exit": print("\nSHOREKEEPER: Until we meet again. The council will remember.") break elif user_input == "/help": print(""" Commands: /remember - Store something in memory /recall - Search memory /run - Run terminal command in sandbox /project - Create new project on 3TB drive /exit - Quit """) elif user_input.startswith("/remember "): fact = user_input[10:] mem_id = model.remember(fact) print(f"SHOREKEEPER: I will remember that. (ID: {mem_id})") elif user_input.startswith("/recall "): query = user_input[8:] memories = model.recall(query) if memories: print("\nSHOREKEEPER: I found these memories:") for mem in memories[:5]: content = mem.get("content", {}) if isinstance(content, dict): for k, v in content.items(): print(f" * {k}: {v}") else: print(f" * {content}") else: print("SHOREKEEPER: I don't remember anything matching that.") elif user_input.startswith("/run "): command = user_input[5:] print(f"\nExecuting: {command}\n") output = model.run_command(command) print(output) elif user_input.startswith("/project "): name = user_input[9:] project_path = model.create_project(name) print(f"SHOREKEEPER: Created project {name} at {project_path}") else: response = model.chat(user_input) print(f"\nSHOREKEEPER: {response}") except KeyboardInterrupt: print("\n\nSHOREKEEPER: Interrupted. Goodbye.") break except Exception as e: print(f"\nError: {e}") if __name__ == "__main__": main()