interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / agent / bench / nb_minimal.py

37 lines · 1299 bytes Raw Blame History
1"""TEST-ONLY launcher: nanobot's own CLI, reduced to omagent's four tools for the equal-work benchmark.
2
3nanobot 0.3.5 has no config switch for every extra tool (message, spawn, cron, session and goal
4tools stay registered; see the feature matrix), so this wrapper drops every tool except
5read_file, write_file, exec and web_fetch at registration. Everything else is unmodified nanobot.
6If NB_MODULES is set, the files of all loaded modules are written there at exit (footprint run only).
7"""
8import atexit, os, sys
9
10from nanobot.agent.tools.registry import ToolRegistry
11
12KEEP = {"read_file", "write_file", "exec", "web_fetch"}
13_register = ToolRegistry.register
14
15
16def register(self, tool):
17 if tool.name in KEEP:
18 _register(self, tool)
19
20
21ToolRegistry.register = register
22
23if os.environ.get("NB_MODULES"):
24 def dump():
25 with open(os.environ["NB_MODULES"], "w") as fh:
26 for m in list(sys.modules.values()):
27 f = getattr(m, "__cached__", None) or getattr(m, "__file__", None)
28 if f and not os.path.exists(f):
29 f = getattr(m, "__file__", None)
30 if f:
31 fh.write(f + "\n")
32 atexit.register(dump)
33
34from nanobot.cli.entry import main # noqa: E402
35
36sys.argv[0] = "nanobot"
37sys.exit(main())