OSS restructuring for open-core model: - Rename package from agentserver/ to xml_pipeline/ - Update all imports (44 Python files, 31 docs/configs) - Update pyproject.toml for OSS distribution (v0.3.0) - Move prompt_toolkit from core to optional [console] extra - Remove auth/server/lsp from core optional deps (-> Nextra) New console example in examples/console/: - Self-contained demo with handlers and config - Uses prompt_toolkit (optional, falls back to input()) - No password auth, no TUI, no LSP — just the basics - Shows how to use xml-pipeline as a library Import changes: - from agentserver.* -> from xml_pipeline.* - CLI entry points updated: xml_pipeline.cli:main Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
958 B
Python
38 lines
958 B
Python
"""
|
|
Console Example — Interactive terminal for xml-pipeline.
|
|
|
|
This example demonstrates how to build an interactive console
|
|
that sends messages to listeners and displays responses.
|
|
|
|
Usage:
|
|
python -m examples.console [config.yaml]
|
|
|
|
Or in your own code:
|
|
from examples.console import Console
|
|
console = Console(pump)
|
|
await console.run()
|
|
|
|
Dependencies:
|
|
pip install prompt_toolkit # For rich terminal input (optional)
|
|
|
|
The console provides:
|
|
- @listener message — Send message to a listener
|
|
- /help — Show available commands
|
|
- /listeners — List registered listeners
|
|
- /quit — Graceful shutdown
|
|
|
|
This is a reference implementation. Feel free to copy and modify
|
|
for your own use case.
|
|
"""
|
|
|
|
from .console import Console
|
|
from .handlers import Greeting, Echo, handle_greeting, handle_echo, handle_print
|
|
|
|
__all__ = [
|
|
"Console",
|
|
"Greeting",
|
|
"Echo",
|
|
"handle_greeting",
|
|
"handle_echo",
|
|
"handle_print",
|
|
]
|