[Phase 6.6] Chat Interface (Slack/Discord) #75

Closed
opened 2026-04-02 20:54:11 +00:00 by Mark · 0 comments
Owner

Overview

Human interface via Slack/Discord/Matrix bot for interactive mesh operation.

Problem Statement

Current mesh requires:

  • HTTP API calls (developer-only)
  • JSON intent payloads (technical)
  • No interactive feedback (batch only)

Humans can't easily:

  • Ask questions and get answers
  • Refine results iteratively
  • Steer mesh in real-time
  • Use mesh without technical knowledge

Proposed Solution

6.6.1: Slack Bot Integration

class SlackMeshBot:
    """Slack bot for mesh interaction."""
    
    def handle_message(self, event: dict):
        """Process Slack message, route to mesh"""
        
    def send_response(self, channel: str, text: str, artifacts: list = None):
        """Send mesh response to Slack"""
        
    def handle_thread(self, thread_ts: str):
        """Multi-turn conversation in thread"""

6.6.2: Discord Bot Integration

class DiscordMeshBot:
    """Discord bot for mesh interaction."""
    
    async def on_message(self, message):
        """Process Discord message"""
        
    async def send_response(self, channel, content, files=None):
        """Send mesh response with artifacts"""

6.6.3: Message → Intent Translation

# Slack message:
User: "mesh: write article about distributed systems"

# Translated to intent:
intent_type: write_article
payload:
  topic: distributed systems
  conversation_id: slack_channel_thread_ts
  
# Response posted to Slack thread

6.6.4: Commands

commands:
  mesh: <request>  # General intent
  mesh:artifact <id>  # Get artifact
  mesh:status  # Show mesh status
  mesh:help  # Show available commands
  mesh:cost  # Show spend this period
  
examples:
  mesh: analyze this PDF → summarize key points
  mesh: write code for sorting algorithm in Python
  mesh: refactor the generated code to use async

6.6.5: Artifact Sharing

# Generated artifacts posted to chat
def share_artifact(bot, channel, artifact_id):
    artifact = artifact_store.get(artifact_id)
    
    if artifact.format in ["md", "txt"]:
        bot.send_message(channel, artifact.content)
    elif artifact.format in ["png", "pdf"]:
        bot.send_file(channel, artifact.path)

Deliverables

  • bots/slack_bot.py - Slack bot implementation
  • bots/discord_bot.py - Discord bot implementation
  • Message → intent translation
  • Response formatting for chat
  • Thread-based conversations
  • Artifact sharing in chat
  • Command parsing
  • Unit tests
  • Integration tests with mock bots

Dependencies

  • #73 (Conversation Memory) - for multi-turn
  • #70 (Artifacts) - for sharing outputs

Estimated Duration

1 week

Success Criteria

  • Slack/Discord bot responds to messages
  • Multi-turn conversations in threads
  • Artifacts shared in chat
  • Commands parsed correctly
  • Works without API knowledge
  • Parent: #69 (Phase 6 Meta)
  • Depends on: #73 (Memory), #70 (Artifacts)
## Overview Human interface via Slack/Discord/Matrix bot for interactive mesh operation. ## Problem Statement Current mesh requires: - HTTP API calls (developer-only) - JSON intent payloads (technical) - No interactive feedback (batch only) Humans can't easily: - Ask questions and get answers - Refine results iteratively - Steer mesh in real-time - Use mesh without technical knowledge ## Proposed Solution ### 6.6.1: Slack Bot Integration ```python class SlackMeshBot: """Slack bot for mesh interaction.""" def handle_message(self, event: dict): """Process Slack message, route to mesh""" def send_response(self, channel: str, text: str, artifacts: list = None): """Send mesh response to Slack""" def handle_thread(self, thread_ts: str): """Multi-turn conversation in thread""" ``` ### 6.6.2: Discord Bot Integration ```python class DiscordMeshBot: """Discord bot for mesh interaction.""" async def on_message(self, message): """Process Discord message""" async def send_response(self, channel, content, files=None): """Send mesh response with artifacts""" ``` ### 6.6.3: Message → Intent Translation ```yaml # Slack message: User: "mesh: write article about distributed systems" # Translated to intent: intent_type: write_article payload: topic: distributed systems conversation_id: slack_channel_thread_ts # Response posted to Slack thread ``` ### 6.6.4: Commands ```yaml commands: mesh: <request> # General intent mesh:artifact <id> # Get artifact mesh:status # Show mesh status mesh:help # Show available commands mesh:cost # Show spend this period examples: mesh: analyze this PDF → summarize key points mesh: write code for sorting algorithm in Python mesh: refactor the generated code to use async ``` ### 6.6.5: Artifact Sharing ```python # Generated artifacts posted to chat def share_artifact(bot, channel, artifact_id): artifact = artifact_store.get(artifact_id) if artifact.format in ["md", "txt"]: bot.send_message(channel, artifact.content) elif artifact.format in ["png", "pdf"]: bot.send_file(channel, artifact.path) ``` ## Deliverables - [ ] `bots/slack_bot.py` - Slack bot implementation - [ ] `bots/discord_bot.py` - Discord bot implementation - [ ] Message → intent translation - [ ] Response formatting for chat - [ ] Thread-based conversations - [ ] Artifact sharing in chat - [ ] Command parsing - [ ] Unit tests - [ ] Integration tests with mock bots ## Dependencies - #73 (Conversation Memory) - for multi-turn - #70 (Artifacts) - for sharing outputs ## Estimated Duration 1 week ## Success Criteria - [ ] Slack/Discord bot responds to messages - [ ] Multi-turn conversations in threads - [ ] Artifacts shared in chat - [ ] Commands parsed correctly - [ ] Works without API knowledge ## Related - Parent: #69 (Phase 6 Meta) - Depends on: #73 (Memory), #70 (Artifacts)
Mark 2026-07-15 10:37:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#75
No description provided.