xml-pipeline/xml_pipeline/message_bus/__init__.py
dullfig e653d63bc1 Rename agentserver to xml_pipeline, add console example
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>
2026-01-19 21:41:19 -08:00

56 lines
1.4 KiB
Python

"""
message_bus — Stream-based message pump for AgentServer v2.1
The message pump handles message flow through the organism:
- YAML config → bootstrap → pump → handlers → responses → loop
Key classes:
StreamPump Main pump class (queue-backed, aiostream-powered)
SystemPipeline Entry point for external messages (console, webhook)
ConfigLoader Load organism.yaml and resolve imports
Listener Runtime listener with handler and routing info
MessageState Message flowing through pipeline steps
Usage:
from xml_pipeline.message_bus import StreamPump, SystemPipeline, bootstrap
pump = await bootstrap("config/organism.yaml")
system = SystemPipeline(pump)
# Inject from console
thread_id = await system.inject_console("@greeter Dan", user="admin")
await pump.run()
"""
from xml_pipeline.message_bus.stream_pump import (
StreamPump,
ConfigLoader,
Listener,
ListenerConfig,
OrganismConfig,
bootstrap,
)
from xml_pipeline.message_bus.message_state import (
MessageState,
HandlerMetadata,
)
from xml_pipeline.message_bus.system_pipeline import (
SystemPipeline,
ExternalMessage,
)
__all__ = [
"StreamPump",
"ConfigLoader",
"Listener",
"ListenerConfig",
"OrganismConfig",
"MessageState",
"HandlerMetadata",
"bootstrap",
"SystemPipeline",
"ExternalMessage",
]