#!/usr/bin/env python3 """O1 brain — runtime/memory capability (ships as capability; memories are EMPTY seeds at install). The brain.py here is the *capability contract* for the O1 package. At install time the target runtime provides the real implementation (same CLI contract). Memories are never shipped — only the engine and namespace naming convention, so each target seeds fresh. CLI contract (per agent-card-spec v1.0, `memory` field): brain.py store brain.py search [topk] brain.py clear Namespaces used by O1 agents (see agent cards): o1-sellers, o1-tests, o1-closer, o1-compliance """ import sys def _die(msg: str, code: int = 1) -> None: print(f"brain: {msg}", file=sys.stderr) sys.exit(code) def main(argv: list[str]) -> int: if len(argv) < 3: _die(f"usage: {argv[0]} [...]") cmd, ns = argv[1], argv[2] if cmd == "store" and len(argv) >= 5: key, value = argv[3], argv[4] print(f"store {ns}/{key} (empty-seed runtime: no-op)") return 0 if cmd == "search": print(f"search {ns}: empty seed — no memories yet") return 0 if cmd == "clear": print(f"clear {ns} (empty-seed runtime: no-op)") return 0 _die(f"unknown command/arity: {' '.join(argv[1:])}") return 1 if __name__ == "__main__": sys.exit(main(sys.argv))