chore: remove gng, move demo out of lib init
This commit is contained in:
@@ -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()
|
||||||
@@ -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))
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user