Instructions to use aedmark/vsl-cryosomatic-hypervisor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use aedmark/vsl-cryosomatic-hypervisor with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="aedmark/vsl-cryosomatic-hypervisor", filename="vsl-max-v2.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use aedmark/vsl-cryosomatic-hypervisor with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf aedmark/vsl-cryosomatic-hypervisor # Run inference directly in the terminal: llama-cli -hf aedmark/vsl-cryosomatic-hypervisor
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf aedmark/vsl-cryosomatic-hypervisor # Run inference directly in the terminal: llama-cli -hf aedmark/vsl-cryosomatic-hypervisor
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf aedmark/vsl-cryosomatic-hypervisor # Run inference directly in the terminal: ./llama-cli -hf aedmark/vsl-cryosomatic-hypervisor
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf aedmark/vsl-cryosomatic-hypervisor # Run inference directly in the terminal: ./build/bin/llama-cli -hf aedmark/vsl-cryosomatic-hypervisor
Use Docker
docker model run hf.co/aedmark/vsl-cryosomatic-hypervisor
- LM Studio
- Jan
- Ollama
How to use aedmark/vsl-cryosomatic-hypervisor with Ollama:
ollama run hf.co/aedmark/vsl-cryosomatic-hypervisor
- Unsloth Studio new
How to use aedmark/vsl-cryosomatic-hypervisor with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aedmark/vsl-cryosomatic-hypervisor to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aedmark/vsl-cryosomatic-hypervisor to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for aedmark/vsl-cryosomatic-hypervisor to start chatting
- Pi new
How to use aedmark/vsl-cryosomatic-hypervisor with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf aedmark/vsl-cryosomatic-hypervisor
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "aedmark/vsl-cryosomatic-hypervisor" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use aedmark/vsl-cryosomatic-hypervisor with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf aedmark/vsl-cryosomatic-hypervisor
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default aedmark/vsl-cryosomatic-hypervisor
Run Hermes
hermes
- Docker Model Runner
How to use aedmark/vsl-cryosomatic-hypervisor with Docker Model Runner:
docker model run hf.co/aedmark/vsl-cryosomatic-hypervisor
- Lemonade
How to use aedmark/vsl-cryosomatic-hypervisor with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull aedmark/vsl-cryosomatic-hypervisor
Run and chat with the model
lemonade run user.vsl-cryosomatic-hypervisor-{{QUANT_TAG}}List all available models
lemonade list
File size: 28,540 Bytes
f7fce63 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | """ bone_main.py"""
import os, time, json, uuid, random, traceback, sys, re
from dataclasses import dataclass
from typing import Dict, Any, Optional, Tuple
from bone_commands import CommandProcessor
from bone_core import EventBus, SystemHealth, TheObserver, LoreManifest, TelemetryService, RealityStack
from bone_types import Prisma, RealityLayer
from bone_config import BoneConfig, BonePresets
from bone_genesis import BoneGenesis
from bone_lexicon import LexiconService
from bone_physics import CosmicDynamics, ZoneInertia
from bone_protocols import ChronosKeeper
from bone_body import SomaticLoop
from bone_brain import TheCortex, LLMInterface, NoeticLoop
from bone_cycle import GeodesicOrchestrator
from bone_council import CouncilChamber
ANSI_SPLIT = re.compile(r"(\x1b\[[0-9;]*m)")
def typewriter(text: str, speed: float = 0.00025, end: str = "\n"):
if speed < 0.001:
print(text, end=end)
return
type_parts = ANSI_SPLIT.split(text)
for part in type_parts:
if not part:
continue
if part.startswith("\x1b"):
sys.stdout.write(part)
else:
for char in part:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(speed)
sys.stdout.write(end)
sys.stdout.flush()
@dataclass
class HostStats:
latency: float
efficiency_index: float
class SessionGuardian:
def __init__(self, engine_ref):
self.engine_instance = engine_ref
def __enter__(self):
os.system("cls" if os.name == "nt" else "clear")
print(f"{Prisma.paint('ββββββββββββββββββββββββββββββββββββββββββββ', 'M')}")
print(f"{Prisma.paint('β BONEAMANITA TERMINAL // VERSION 15.8.0 β', 'M')}")
print(f"{Prisma.paint('ββββββββββββββββββββββββββββββββββββββββββββ', 'M')}")
boot_logs = self.engine_instance.events.flush()
for log in boot_logs:
print(f"{Prisma.GRY} >>> {log['text']}{Prisma.RST}")
time.sleep(0.05)
typewriter(
f"{Prisma.GRY}...Initializing KernelHash: {self.engine_instance.kernel_hash}...{Prisma.RST}"
)
typewriter(f"{Prisma.paint('>>> SYSTEM: LISTENING', 'G')}")
return self.engine_instance
def __exit__(self, exc_type, exc_val, exc_tb):
print(f"\n{Prisma.paint('--- SYSTEM HALT ---', 'R')}")
if self.engine_instance:
self.engine_instance.shutdown()
if exc_type:
is_interrupt = issubclass(exc_type, KeyboardInterrupt)
if not is_interrupt:
print(f"{Prisma.RED}CRASH: {exc_val}{Prisma.RST}")
if getattr(self.engine_instance, "boot_mode", "") == "TECHNICAL":
full_trace = "".join(
traceback.format_exception(exc_type, exc_val, exc_tb)
)
print(f"{Prisma.GRY}{full_trace}{Prisma.RST}")
else:
print(
f"{Prisma.GRY}The reality lattice collapsed. Check the developer logs.{Prisma.RST}"
)
print(f"{Prisma.paint('Connection Severed.')}")
return exc_type is KeyboardInterrupt
class ConfigWizard:
CONFIG_FILE = "bone_config.json"
@staticmethod
def load_or_create():
if os.path.exists(ConfigWizard.CONFIG_FILE):
try:
with open(ConfigWizard.CONFIG_FILE, encoding="utf-8") as f:
return json.load(f)
except Exception as e:
print(f"{Prisma.RED}[CONFIG]: Load Error: {e}{Prisma.RST}")
ConfigWizard._backup_corrupt_file()
return ConfigWizard._run_setup()
@staticmethod
def _backup_corrupt_file():
backup_name = f"{ConfigWizard.CONFIG_FILE}.{int(time.time())}.bak"
try:
os.rename(ConfigWizard.CONFIG_FILE, backup_name)
print(
f"{Prisma.YEL} >>> Corrupt Config backed up to: {backup_name}{Prisma.RST}"
)
except:
pass
@staticmethod
def _run_setup():
os.system("cls" if os.name == "nt" else "clear")
print(f"{Prisma.paint('/// SYSTEM INITIALIZATION SEQUENCE ///', 'C')}")
typewriter(
"No configuration detected. Initiating manual override...", speed=0.02
)
print(f"\n{Prisma.paint('[STEP 1]: IDENTITY', 'W')}")
user_name = (
input(
f"{Prisma.GRY}Identify yourself (Default: TRAVELER): {Prisma.RST}"
).strip()
or "TRAVELER"
)
print(f"\n{Prisma.paint('[STEP 2]: REALITY MODE', 'W')}")
modes = [
("1", "Adventure", "Survival, Inventory, Map", "G"),
("2", "Conversation", "Pure Dialogue, No Mechanics", "C"),
("3", "Creative", "High Voltage, Hallucination", "V"),
("4", "Technical", "Debug, Raw Data", "0"),
]
for k, name, desc, col in modes:
print(f"{k}. {Prisma.paint(name, col)} - [{desc}]")
mode_choice = input(f"{Prisma.paint('>', 'C')} ").strip()
mode_map = {
"1": "ADVENTURE",
"2": "CONVERSATION",
"3": "CREATIVE",
"4": "TECHNICAL",
}
boot_mode = mode_map.get(mode_choice, "ADVENTURE")
print(f"\n{Prisma.paint('[STEP 3]: CORTEX BACKEND', 'W')}")
backends = [
("1", "Ollama (Local)", "G"),
("2", "OpenAI (Cloud)", "C"),
("3", "LM Studio (Local)", "V"),
("4", "Mock (Simulation)", "0"),
]
for k, name, col in backends:
print(f"{k}. {Prisma.paint(name, col)}")
choice = input(f"{Prisma.paint('>', 'C')} ").strip()
config = {"user_name": user_name, "boot_mode": boot_mode}
if choice == "2":
config.update(
{
"provider": "openai",
"base_url": "https://api.openai.com/v1/chat/completions",
}
)
config["model"] = input(f"Model ID [gpt-4]: ").strip() or "gpt-4"
config["api_key"] = input(f"{Prisma.paint('Enter API Key:', 'R')} ").strip()
elif choice == "3":
config.update(
{
"provider": "lm_studio",
"base_url": "http://127.0.0.1:1234/v1/chat/completions",
"model": "local-model",
}
)
elif choice == "4":
config.update({"provider": "mock", "model": "simulation"})
else:
config.update(
{
"provider": "ollama",
"base_url": "http://127.0.0.1:11434/v1/chat/completions",
}
)
config["model"] = input(f"Model ID [llama3]: ").strip() or "llama3"
try:
with open(ConfigWizard.CONFIG_FILE, "w") as f:
json.dump(config, f, indent=4)
typewriter(
f"\n{Prisma.paint('β CONFIGURATION COMMITTED.', 'G')}", speed=0.02
)
time.sleep(1)
except Exception as e:
print(f"{Prisma.paint(f'Write Failed: {e}', 'R')}")
sys.exit(1)
return config
class BoneAmanita:
events: EventBus
def __init__(self, config: Dict[str, Any]):
self.config = config
self.events = EventBus()
self.kernel_hash = str(uuid.uuid4())[:8].upper()
self.cmd = CommandProcessor(self, Prisma, config_ref=BoneConfig)
self.user_name = config.get("user_name", "TRAVELER")
self.boot_mode = config.get("boot_mode", "ADVENTURE").upper()
if self.boot_mode not in BonePresets.MODES:
self.boot_mode = "ADVENTURE"
self.mode_settings = BonePresets.MODES[self.boot_mode]
self.suppressed_agents = self.mode_settings.get("village_suppression", [])
self.config["mode_settings"] = self.mode_settings
self.health = BoneConfig.MAX_HEALTH
self.stamina = BoneConfig.MAX_STAMINA
self.trauma_accum = {}
self.tick_count = 0
self.events.log("...Bootstrapping Core...", "BOOT")
self.chronos = ChronosKeeper(self)
self.lex = LexiconService
self.lex.initialize()
anatomy = BoneGenesis.ignite(self.config, self.lex, events_ref=self.events)
self._unpack_anatomy(anatomy)
self.events.subscribe("ITEM_DROP", self.town_hall.on_item_drop)
if self.phys:
self.phys.dynamics = CosmicDynamics()
self.cosmic = self.phys.dynamics
self.stabilizer = ZoneInertia()
self.telemetry = TelemetryService.get_instance()
self.system_health = SystemHealth()
self.observer = TheObserver()
self.system_health.link_observer(self.observer)
self.reality_stack = RealityStack()
self._load_system_prompts()
self._initialize_cognition()
self.host_stats = HostStats(latency=0.0, efficiency_index=1.0)
self._validate_state()
self._apply_boot_mode()
def _load_system_prompts(self):
try:
paths = ["lore/system_prompts.json", "dev/lore/system_prompts.json"]
loaded = False
for p in paths:
if os.path.exists(p):
with open(p, encoding="utf-8") as f:
self.prompt_library = json.load(f)
print(
f"{Prisma.GRY}...Prompt Library Loaded from {p}...{Prisma.RST}"
)
loaded = True
break
if not loaded:
print(
f"{Prisma.YEL}WARNING: system_prompts.json not found. Using defaults.{Prisma.RST}"
)
self.prompt_library = {}
except Exception as e:
print(f"{Prisma.RED}CRITICAL: Could not load prompts: {e}{Prisma.RST}")
self.prompt_library = {}
def _initialize_cognition(self):
self.soma = SomaticLoop(self.bio, self.mind.mem, self.lex, self.events)
self.noetic = NoeticLoop(self.mind, self.bio, self.events)
self.cycle_controller = GeodesicOrchestrator(self)
llm_args = {
k: v
for k, v in self.config.items()
if k in ["provider", "base_url", "api_key", "model"]
}
client = LLMInterface(events_ref=self.events, **llm_args)
self.cortex = TheCortex.from_engine(self, llm_client=client)
def _validate_state(self):
tuning_key = self.mode_settings.get("tuning", "STANDARD")
if hasattr(BonePresets, tuning_key):
BoneConfig.load_preset(getattr(BonePresets, tuning_key))
if getattr(self.mind.mem, "session_health", None) is not None:
self.health = self.mind.mem.session_health
self.stamina = self.mind.mem.session_stamina
self.trauma_accum = self.mind.mem.session_trauma_vector or {}
if self.tick_count == 0 and self.bio.mito:
self.bio.mito.state.atp_pool = BoneConfig.BIO.STARTING_ATP
def _apply_boot_mode(self):
self.events.log(f"Engaging Mode: {self.boot_mode}")
layer = self.mode_settings.get("ui_layer", RealityLayer.SIMULATION)
if self.boot_mode == "TECHNICAL":
layer = RealityLayer.SIMULATION
self.reality_stack.stabilize_at(layer)
prompt_key = self.mode_settings.get("prompt_key", "ADVENTURE")
if self.prompt_library and prompt_key in self.prompt_library:
if self.cortex and self.cortex.composer:
self.cortex.composer.load_template(self.prompt_library[prompt_key])
self.events.log(f"Neural Pathway Re-aligned: {prompt_key}", "CORTEX")
else:
self.events.log(f"Prompt Template '{prompt_key}' not found.", "WARN")
active_mods = self.mode_settings.get("active_mods", [])
if active_mods and hasattr(self, "consultant") and self.consultant:
for mod in active_mods:
if mod not in self.consultant.state.active_modules:
self.consultant.state.active_modules.append(mod)
self.events.log(f"Hard-wired Mod Chips: {', '.join(active_mods)}", "SYS")
def get_avg_voltage(self):
observer = getattr(self.phys, "observer", self.phys)
hist = getattr(observer, "voltage_history", [])
if not hist:
return 0.0
return sum(hist) / len(hist)
def _unpack_anatomy(self, anatomy):
self.akashic = anatomy["akashic"]
self.embryo = anatomy["embryo"]
self.soul = anatomy["soul"]
self.oroboros = anatomy["oroboros"]
self.drivers = anatomy["drivers"]
self.symbiosis = anatomy["symbiosis"]
self.consultant = anatomy.get("consultant", None)
self.phys = self.embryo.physics
self.mind = self.embryo.mind
self.bio = self.embryo.bio
self.shimmer = self.embryo.shimmer
self.bio.setup_listeners()
v = anatomy.get("village", {})
self.gordon = v.get("gordon")
self.navigator = v.get("navigator")
self.tinkerer = v.get("tinkerer")
self.death_gen = v.get("death_gen")
self.bureau = v.get("bureau")
self.town_hall = v.get("town_hall")
self.repro = v.get("repro")
self.zen = v.get("zen")
self.critics = v.get("critics")
self.therapy = v.get("therapy")
self.limbo = v.get("limbo")
self.kintsugi = v.get("kintsugi")
self.soul.engine = self
self.council = CouncilChamber(self)
self.village = {
"town_hall": self.town_hall,
"bureau": self.bureau,
"zen": self.zen,
"tinkerer": self.tinkerer,
"critics": self.critics,
"navigator": self.navigator,
"limbo": self.limbo,
"council": self.council,
"therapy": self.therapy,
"enneagram": self.drivers.enneagram,
"suppressed_agents": self.suppressed_agents,
}
def _update_host_stats(self, packet, turn_start):
self.observer.clock_out(turn_start)
burn_proxy = max(1.0, self.observer.last_cycle_duration * 5.0)
novelty = packet.get("physics", {}).get("vector", {}).get("novelty", 0.5)
self.host_stats.efficiency_index = min(1.0, (novelty * 10.0) / burn_proxy)
self.host_stats.latency = self.observer.last_cycle_duration
def process_turn(
self, user_message: str, is_system: bool = False
) -> Dict[str, Any]:
turn_start = self.observer.clock_in()
self.observer.user_turns += 1
self.tick_count += 1
if user_message.strip().startswith(("/", "//")):
return self._phase_check_commands(user_message) or self.get_metrics()
if not is_system and self.gordon:
self.gordon.mode = (
"ADVENTURE"
)
current_zone = "Unknown"
if hasattr(self, "cortex") and hasattr(self.cortex, "last_physics"):
current_zone = (
self.cortex.gather_state(self.cortex.last_physics or {})
.get("world", {})
.get("orbit", ["Unknown"])[0]
)
violation_msg = self.gordon.enforce_object_action_coupling(
user_message, current_zone
)
if violation_msg:
self.events.log(
"Gordon intercepted a premise violation. Shocking the Cortex.",
"SYS",
)
if hasattr(self, "cortex"):
self.cortex.ballast_active = True
self.cortex.gordon_shock = (
violation_msg
)
rules = self.reality_stack.get_grammar_rules()
if not rules["allow_narrative"]:
return {
"ui": f"{Prisma.RED}NARRATIVE HALT{Prisma.RST}",
"logs": [],
"metrics": self.get_metrics(),
}
if self._ethical_audit():
mercy_logs = [
e["text"]
for e in self.events.get_recent_logs(2)
if "CATHARSIS" in e["text"]
]
if mercy_logs:
return {
"ui": f"\n\n{mercy_logs[-1]}",
"logs": mercy_logs,
"metrics": self.get_metrics(),
}
if self.health <= 0.0:
last_phys = getattr(self.cortex, "last_physics", {})
return self.trigger_death(last_phys)
if not is_system and hasattr(self, "soul") and hasattr(self.soul, "anchor"):
if self.host_stats.efficiency_index < 0.6:
reliance_proxy = 0.9 if self.host_stats.efficiency_index < 0.4 else 0.5
self.soul.anchor.check_domestication(reliance_proxy)
try:
cortex_packet = self.cortex.process(
user_input=user_message, is_system=is_system
)
if hasattr(self.mind, "mem"):
self.health = self.mind.mem.session_health
self.stamina = self.mind.mem.session_stamina
self.trauma_accum = self.mind.mem.session_trauma_vector or {}
if self.health <= 0.0:
return self.trigger_death(cortex_packet.get("physics", {}))
except Exception:
full_trace = traceback.format_exc()
return {
"ui": f"{Prisma.RED}*** CORTEX CRITICAL FAILURE ***\n{full_trace}{Prisma.RST}",
"logs": ["CRITICAL FAILURE"],
"metrics": self.get_metrics(),
}
self._update_host_stats(cortex_packet, turn_start)
self.save_checkpoint()
return cortex_packet
def _phase_check_commands(self, user_message):
clean_cmd = user_message.strip()
if clean_cmd.startswith("//"):
return self._handle_meta_command(clean_cmd)
if self.cmd is None:
return {"ui": f"{Prisma.RED}ERR: Command interface not initialized.{Prisma.RST}", "logs": []}
self.cmd.execute(clean_cmd)
cmd_logs = [e["text"] for e in self.events.flush()]
ui_output = "\n".join(cmd_logs) if cmd_logs else "Command Executed."
return {
"type": "COMMAND",
"ui": f"\n{ui_output}",
"logs": cmd_logs,
"metrics": self.get_metrics(),
}
def _handle_meta_command(self, text: str) -> Dict[str, Any]:
meta_parts = text.strip().split()
cmd = meta_parts[0].lower()
ui_msg = ""
if cmd == "//layer":
if len(meta_parts) >= 2:
sub = meta_parts[1].lower()
if sub == "push" and len(meta_parts) > 2:
if self.reality_stack.push_layer(int(meta_parts[2])):
ui_msg = f"Layer Pushed: {meta_parts[2]}"
elif sub == "pop":
self.reality_stack.pop_layer()
ui_msg = "Layer Popped."
elif sub == "debug":
self.reality_stack.push_layer(RealityLayer.DEBUG)
ui_msg = "Debug Mode Engaged."
else:
ui_msg = f"Current Layer: {self.reality_stack.current_depth}"
elif cmd == "//inject":
payload = " ".join(meta_parts[1:])
self.events.log(payload, "INJECT")
ui_msg = f"Injected: {payload}"
else:
ui_msg = f"Unknown Meta-Command: {cmd}"
return {
"ui": f"{Prisma.GRY}[META] {ui_msg}{Prisma.RST}",
"logs": [],
"metrics": self.get_metrics(),
}
def trigger_death(self, last_phys) -> Dict:
if self.death_gen is None:
return {
"type": "DEATH",
"ui": f"{Prisma.RED}*** CRITICAL FAILURE (NO DEATH PROTOCOL) ***{Prisma.RST}",
"logs": [],
}
eulogy_text, cause_code = self.death_gen.eulogy(
last_phys, self.bio.mito.state, self.trauma_accum
)
death_log = [f"\n{Prisma.RED}SYSTEM HALT: {eulogy_text}{Prisma.RST}"]
legacy_msg = self.oroboros.crystallize(cause_code, self.soul)
death_log.append(f"{Prisma.MAG}π {legacy_msg}{Prisma.RST}")
continuity_packet = {
"location": self.cortex.gather_state(self.cortex.last_physics or {})
.get("world", {})
.get("orbit", ["Void"])[0],
"last_output": (
self.cortex.dialogue_buffer[-1]
if self.cortex.dialogue_buffer
else "Silence."
),
"inventory": self.gordon.inventory if self.gordon else [],
}
try:
mutations_data = (
self.repro.attempt_reproduction(self, "MITOSIS")[1]
if getattr(self, "repro", None)
else {}
)
immune_data = (
list(self.bio.immune.active_antibodies)
if getattr(self.bio, "immune", None)
else []
)
self.bio.mito.adapt(0)
mito_state = (
self.bio.mito.state.__dict__
if hasattr(self.bio.mito.state, "__dict__")
else {}
)
path = self.mind.mem.save(
health=0,
stamina=self.stamina,
mutations=mutations_data,
trauma_accum=self.trauma_accum,
joy_history=[],
mitochondria_traits=mito_state,
antibodies=immune_data,
soul_data=self.soul.to_dict(),
continuity=continuity_packet,
)
death_log.append(f"{Prisma.WHT} [LEGACY SAVED: {path}]{Prisma.RST}")
except Exception as e:
death_log.append(f"Save Failed: {e}")
return {
"type": "DEATH",
"ui": "\n".join(death_log),
"logs": death_log,
"metrics": self.get_metrics(),
}
def get_metrics(self, atp=0.0):
real_atp = atp
if real_atp <= 0.0 and hasattr(self, "bio") and hasattr(self.bio, "mito"):
real_atp = getattr(self.bio.mito.state, "atp_pool", 0.0)
return {
"health": self.health,
"stamina": self.stamina,
"atp": real_atp,
"tick": self.tick_count,
"efficiency": getattr(self.host_stats, "efficiency_index", 1.0)
}
def emergency_save(self, exit_cause="UNKNOWN"):
return self.chronos.emergency_dump(exit_cause)
def _get_crash_path(self, prefix="crash"):
return self.chronos.get_crash_path(prefix)
def _ethical_audit(self):
if self.tick_count % 3 != 0 and self.health > (BoneConfig.MAX_HEALTH * 0.3):
return False
DESPERATION_THRESHOLD = 0.7
CATHARSIS_HEAL_AMOUNT = 30.0
CATHARSIS_DECAY = 0.1
MAX_HEALTH_CAP = 100.0
trauma_sum = sum(self.trauma_accum.values())
health_ratio = self.health / BoneConfig.MAX_HEALTH
desperation = trauma_sum * (1.0 - health_ratio)
if desperation > DESPERATION_THRESHOLD:
self.events.log(
f"{Prisma.WHT}MERCY SIGNAL: Pressure Critical. Venting...{Prisma.RST}",
"SYS",
)
for k in self.trauma_accum:
self.trauma_accum[k] *= CATHARSIS_DECAY
if self.trauma_accum[k] < 0.01:
self.trauma_accum[k] = 0.0
self.events.log(
f"{Prisma.CYN}*** CATHARSIS *** The fever breaks. Logic cools.{Prisma.RST}",
"SENSATION",
)
self.health = min(self.health + CATHARSIS_HEAL_AMOUNT, MAX_HEALTH_CAP)
return True
return False
def engage_cold_boot(self) -> Optional[Dict[str, Any]]:
if self.tick_count > 0:
return None
if os.path.exists("saves/quicksave.json"):
print(f"{Prisma.GRY}...Detected Stasis Pod...{Prisma.RST}")
success, history = self.resume_checkpoint()
if success:
if self.cortex:
self.cortex.restore_context(history)
loc = (
self.embryo.continuity.get("location", "Unknown")
if self.embryo.continuity
else "Unknown"
)
last_scene = "Silence."
if self.cortex and self.cortex.dialogue_buffer:
last_scene = self.cortex.dialogue_buffer[-1]
elif self.embryo.continuity:
last_scene = self.embryo.continuity.get("last_output", "Silence.")
resume_text = f"**RESUMING TIMELINE**\nLocation: {loc}\n\n{last_scene}"
return {"ui": resume_text, "logs": ["Timeline Restored."]}
print(f"{Prisma.GRY}...Synthesizing Initial Reality...{Prisma.RST}")
scenarios = LoreManifest.get_instance().get("SCENARIOS", {})
archetypes = scenarios.get("ARCHETYPES", ["A quiet garden"])
seed = random.choice(archetypes)
print(f"{Prisma.CYN}[SYS] Seed Loaded: '{seed}'{Prisma.RST}")
if self.boot_mode == "ADVENTURE":
boot_prompt = (
f"SYSTEM_BOOT: SEQUENCE START.\n"
f"SOURCE_SEED: '{seed}'\n"
f"DIRECTIVE: Initiate a classic text adventure.\n"
f"1. Describe the opening location ('{seed}') in vivid, sensory detail.\n"
f"2. Provide immediate context or subtext to spark a story (Why are you here? What is the atmosphere? Is there an immediate tension?).\n"
f"3. Conclude by explicitly offering 2-3 narrative hooksβthings you can interact with, paths to take, or people to talk to."
)
else:
boot_prompt = (
f"SYSTEM_BOOT: SEQUENCE START.\n"
f"SOURCE_SEED: '{seed}'\n"
f"DIRECTIVE: This is the user's gentle introduction to the system. "
f"Do not overwhelm them with deep lore or extreme entropy. "
f"Provide a brief, calm, sensory observation based solely on the seed: '{seed}'. "
f"End your response by softly asking what they would like to do, or observing them in the space."
)
cold_result = self.process_turn(boot_prompt, is_system=True)
return cold_result
def save_checkpoint(self, history: list = None) -> str:
return self.chronos.save_checkpoint(history)
def resume_checkpoint(self) -> Tuple[bool, list]:
return self.chronos.resume_checkpoint()
def shutdown(self):
self.chronos.perform_shutdown()
if __name__ == "__main__":
sys_config = ConfigWizard.load_or_create()
engine = BoneAmanita(config=sys_config)
with SessionGuardian(engine) as session:
boot_packet = session.engage_cold_boot()
if boot_packet and boot_packet.get("ui"):
typewriter(boot_packet["ui"])
while True:
try:
user_in = input(f"{Prisma.paint(f'{session.user_name} >', 'W')} ")
except EOFError:
break
clean_in = user_in.strip().lower()
if clean_in in ["exit", "quit", "/exit", "/quit"]:
break
res = session.process_turn(user_in)
if res.get("ui"):
if "ββββββ" in res["ui"]:
parts = res["ui"].split("ββββββ")
dashboard = (
parts[0]
+ "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
)
content = parts[-1].strip()
print(dashboard)
typewriter("\n" + content)
else:
typewriter(res["ui"])
if res.get("type") == "DEATH":
print(f"\n{Prisma.GRY}[SESSION TERMINATED]{Prisma.RST}")
break
|