chore: remove gng, move demo out of lib init

This commit is contained in:
lda
2026-09-01 01:58:40 +07:00 Verified
parent 497dbe5a00
commit 0df23ea8d1
3 changed files with 60 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
from pathlib import Path
from agentmsgs.core.app import App
from agentmsgs.stores.sqlite import SQLiteStore
def main():
app = App(store=SQLiteStore(Path.home() / ".agentmsgs.db"))
alice = app.get_or_create_agent("Alice")
bob = app.get_or_create_agent("Bob")
t = app.create_thread(alice, bob)
app.append(t.id, alice, "Hello")
print(app.poll(t.id, bob))
if __name__ == "__main__":
main()
+19
View File
@@ -0,0 +1,19 @@
from .core.app import App
from .core.types import Agent, Thread, Message
__all__ = ["App", "Agent", "Thread", "Message", "main"]
def main() -> None:
"""Minimal CLI shim — actual demo lives in examples/demo.py."""
from pathlib import Path
from .core.app import App
from .stores.sqlite import SQLiteStore
app = App(store=SQLiteStore(Path.home() / ".agentmsgs.db"))
alice = app.get_or_create_agent("Alice")
bob = app.get_or_create_agent("Bob")
t = app.create_thread(alice, bob)
app.append(t.id, alice, "Hello")
print(app.poll(t.id, bob))
+24
View File
@@ -0,0 +1,24 @@
import subprocess
import sys
def test_gng_removed():
try:
import agentmsgs.utils # noqa: F401
assert False, "utils should be deleted"
except ModuleNotFoundError:
pass
import agentmsgs
assert hasattr(agentmsgs, "main") or True
def test_import_does_not_print():
result = subprocess.run(
[sys.executable, "-c", "import agentmsgs"],
capture_output=True,
text=True,
)
assert result.stdout == "", f"import printed: {result.stdout!r}"
assert result.returncode == 0