Markdown Converter
Agent skill for markdown-converter
**Version:** (e.g., 0.6.0 - Increment after cleanup)
Sign in to like and favorite skills
Version: (e.g., 0.6.0 - Increment after cleanup)
Agent Type: Core Infrastructure Library / Message Bus SDK
Primary Goal: To provide a reliable, asynchronous, Redis Streams-based message bus for inter-agent communication within the AG1 ecosystem. It defines core message structures (Envelope), publishing/subscribing mechanisms, and RPC-like patterns.
Key Components & Modules:
- The envelope.py
Class:Envelope
role, content, agent_name, user_id, session_code, reply_to, correlation_id, envelope_type, meta, timestamp, envelope_id.to_dict), deserialization (from_dict), unique ID generation.
- keys.py
Class:StreamKeyBuilder
agent_inbox(name), edge_response(edge_name, user_id), edge_register(edge_name), temp_response(unique_id_part).
- Core Bus Operations:bus.py
build_redis_url(...): Constructs the Redis connection URL from configuration (environment variables or direct parameters).publish_envelope(redis_client, stream_name, envelope): Serializes an Envelope and publishes it to a specified Redis Stream using XADD.subscribe_simple(redis_client, stream_name, callback, group_name, consumer_name, mkstream, block_ms, is_temp_stream): A simplified, robust function for an agent to subscribe to a single stream using a consumer group, process messages via a callback, and handle acknowledgments.subscribe(redis_client, stream_patterns_or_names, callback, group, consumer, mkstream, batch_size, block_ms): (If this is a more general or older version) A function for subscribing to one or more streams/patterns. Focus for cleanup might be to ensure subscribe_simple is the primary, well-tested method for single stream listening by agents, or to make subscribe equally robust.
- Request-Response Pattern Implementation:rpc.py
bus_rpc_call(redis_client, target_stream, request_envelope, timeout):
request_envelope to target_stream.request_envelope.reply_to before sending.None.bus_rpc_envelope(redis_client, target_inbox, request_envelope, timeout):
bus_rpc_call.request_envelope.reply_to is appropriately set (using a fallback if necessary) before calling bus_rpc_call.bus_rpc_call and deserializes it into an Envelope object (or an error dictionary).
- bus_adapterV2.py
Class:BusAdapterV2
agent_id, core_handler (like agent.handle_bus_envelope), redis_client, and patterns to listen on.subscribe_simple (or subscribe) internally to manage the Redis Stream subscriptions and consumer groups.start() and stop() methods for managing the lifecycle of the listeners.core_handler.add_subscription() for dynamic subscriptions.Dependencies:
redis (asyncio version: redis.asyncio)Key Design Principles for Robustness:
XACK) in subscription loops to prevent reprocessing of faulty messages.StreamKeyBuilder.asyncio environment.Interaction with Other Agents: This library is the fundamental communication layer. All AetherBus agents (Muse2, HeartBeat, Echo, EthAgent, Gatekeeper, uFetch_ASIOne_Client_Agent, ufetch_asi_edge_handler, Relay, etc.) will use these components to send and receive messages.