Skip to content

Latest commit

 

History

History
691 lines (510 loc) · 14.6 KB

File metadata and controls

691 lines (510 loc) · 14.6 KB

PathBridge - Integration Plan

Comprehensive guide for integrating PathBridge with Team Brain agents, tools, and BCH.


🎯 INTEGRATION GOALS

This document outlines how PathBridge integrates with:

  1. Team Brain agents (Forge, Atlas, Clio, Nexus, Bolt)
  2. Existing Team Brain tools
  3. BCH (Beacon Command Hub) - if applicable
  4. Logan's workflows

📦 BCH INTEGRATION

Overview

PathBridge is a utility tool that can be integrated into BCH for cross-platform path operations. When users or agents share file paths, BCH can automatically convert them to the appropriate format.

BCH Commands (Proposed)

@path convert "D:\BEACON_HQ\file.txt"
@path info "/mnt/d/folder"
@path windows "path"
@path wsl "path"

Implementation Steps

  1. Add PathBridge to BCH imports:
from pathbridge import PathBridge
pb = PathBridge()
  1. Create command handler:
@bch.command("path")
async def path_command(ctx, action: str, path: str):
    if action == "convert":
        result = pb.convert(path)
    elif action == "info":
        info = pb.get_info(path)
        result = format_info(info)
    elif action in ("windows", "win"):
        result = pb.convert(path, target="windows")
    elif action == "wsl":
        result = pb.convert(path, target="wsl")
    await ctx.send(result)
  1. Test integration with agent commands
  2. Update BCH documentation

Auto-Convert Feature

BCH could automatically detect and convert paths in messages:

  • Detect Windows paths in messages from CLIO
  • Detect WSL paths in messages from FORGE
  • Offer conversion or auto-convert

🤖 AI AGENT INTEGRATION

Integration Matrix

Agent Primary Use Case Integration Method Priority
Forge Config path translation Python API HIGH
Atlas Tool build automation CLI + Python HIGH
Clio WSL ↔ Windows handoffs CLI HIGH
Nexus Cross-platform configs Python API MEDIUM
Bolt Batch file processing CLI LOW

Agent-Specific Workflows


FORGE (Orchestrator / Reviewer)

Primary Use Case: Translate config paths when reviewing code from different agents.

Integration Steps:

  1. Add PathBridge to session startup:
from pathbridge import PathBridge
pb = PathBridge()
  1. Use when reviewing paths in configs:
# When reviewing a config from CLIO (WSL paths)
config_path = "/mnt/d/BEACON_HQ/config.json"
windows_path = pb.convert(config_path, target="windows")
print(f"Viewing on Windows: {windows_path}")
  1. Include in handoff preparation:
# Prepare paths for next agent
handoff_paths = {
    "windows": pb.convert(file_path, target="windows"),
    "wsl": pb.convert(file_path, target="wsl")
}

Example Workflow:

# Forge receives review request with WSL paths
from pathbridge import PathBridge

pb = PathBridge()

# Convert all paths to Windows format for review
source_files = [
    "/mnt/d/BCH/src/main.py",
    "/mnt/d/BCH/src/utils.py",
    "/mnt/d/BCH/config.json"
]

print("Files to review:")
for f in source_files:
    win_path = pb.convert(f, target="windows")
    print(f"  {win_path}")

ATLAS (Executor / Builder)

Primary Use Case: Ensure tool builds work cross-platform by using correct paths.

Integration Steps:

  1. Import in tool creation scripts:
from pathbridge import PathBridge
pb = PathBridge()
  1. Use for cross-platform path generation:
# In setup.py or tool scripts
import platform
from pathbridge import PathBridge

pb = PathBridge()

# Generate platform-appropriate path
config_base = "D:\\BEACON_HQ\\configs"
if platform.system() != "Windows":
    config_base = pb.convert(config_base, target="wsl")
  1. Include in test fixtures:
# Generate test paths for both platforms
def get_test_paths():
    pb = PathBridge()
    base = "D:\\test_data"
    return {
        "windows": base,
        "wsl": pb.convert(base, target="wsl")
    }

Example Workflow:

# Atlas building a tool that works cross-platform
from pathbridge import PathBridge
import platform

pb = PathBridge()

# Define paths in Windows format (canonical)
PATHS = {
    "memory_core": "D:\\BEACON_HQ\\MEMORY_CORE_V2",
    "synapse": "D:\\BEACON_HQ\\MEMORY_CORE_V2\\03_INTER_AI_COMMS\\THE_SYNAPSE",
    "tools": "C:\\Users\\logan\\OneDrive\\Documents\\AutoProjects"
}

def get_path(key):
    """Get platform-appropriate path."""
    path = PATHS[key]
    if platform.system() != "Windows":
        return pb.convert(path, target="wsl")
    return path

# Usage
memory_path = get_path("memory_core")
print(f"Memory Core: {memory_path}")

CLIO (Linux / Ubuntu Agent)

Primary Use Case: Convert Windows paths from Forge/Atlas to WSL format.

Platform Considerations:

  • CLIO runs on WSL/Ubuntu
  • Receives Windows paths from Windows agents
  • Needs to convert paths before using them

Integration Steps:

  1. Install PathBridge on Linux:
git clone https://github.com/DonkRonk17/PathBridge.git
cd PathBridge
pip install -e .
  1. Create shell alias:
alias pb='python ~/PathBridge/pathbridge.py'
alias pbc='pb --clipboard'
  1. Use in scripts:
# Convert incoming Windows path
WIN_PATH="D:\BCH\src\main.py"
WSL_PATH=$(pb -q "$WIN_PATH")
echo "Working with: $WSL_PATH"

Example Workflow:

#!/bin/bash
# clio_process.sh - Process files from Windows path

# Receive Windows path from Synapse/handoff
WIN_PATH="$1"

# Convert to WSL
WSL_PATH=$(pathbridge -q "$WIN_PATH")

# Verify file exists
if [ -f "$WSL_PATH" ]; then
    echo "[OK] File found: $WSL_PATH"
    # Process file...
else
    echo "[X] File not found: $WSL_PATH"
    exit 1
fi

NEXUS (Multi-Platform Agent)

Primary Use Case: Generate paths that work on all platforms.

Cross-Platform Notes:

  • NEXUS may run on Windows, Linux, or macOS
  • Needs to handle paths universally

Integration Steps:

from pathbridge import PathBridge
import platform

class CrossPlatformPaths:
    """Helper for multi-platform path handling."""
    
    def __init__(self):
        self.pb = PathBridge()
        self.system = platform.system()
    
    def normalize(self, path):
        """Get path for current platform."""
        if self.system == "Windows":
            return self.pb.convert(path, target="windows")
        else:
            return self.pb.convert(path, target="wsl")
    
    def for_agent(self, path, agent):
        """Get path for specific agent's platform."""
        agent_platforms = {
            "FORGE": "windows",
            "ATLAS": "windows",
            "CLIO": "wsl",
            "NEXUS": None,  # Current platform
            "BOLT": "windows"
        }
        target = agent_platforms.get(agent)
        if target:
            return self.pb.convert(path, target=target)
        return self.normalize(path)

BOLT (Cline / Free Executor)

Primary Use Case: Batch process files with correct paths.

Cost Considerations:

  • BOLT is FREE (no API costs)
  • Ideal for bulk path conversion tasks
  • Saves API tokens for other agents

Integration Steps:

# Bulk convert paths from a log file
grep "ERROR" server.log | grep -oE '"[^"]*"' | pathbridge -q > fixed_paths.txt

# Process all Windows paths in a config
cat config.json | pathbridge -q > config_wsl.json

🔗 INTEGRATION WITH OTHER TEAM BRAIN TOOLS

With TimeSync

Problem Solved: TimeSync has hardcoded paths that break cross-platform.

Integration Pattern:

from pathbridge import PathBridge
from timesync import TimeSync

pb = PathBridge()

# TimeSync config with WSL path
config_wsl = "/mnt/d/BEACON_HQ/timesync_config.json"

# Convert to current platform
config_path = pb.convert(config_wsl)

# Initialize TimeSync with correct path
ts = TimeSync(config_path)

With SynapseLink

Use Case: Share files between agents with correct paths.

Integration Pattern:

from pathbridge import PathBridge
from synapselink import quick_send

pb = PathBridge()

# Prepare file for CLIO (WSL agent)
file_windows = "D:\\BCH\\report.pdf"
file_wsl = pb.convert(file_windows, target="wsl")

quick_send(
    "CLIO",
    "Report Ready",
    f"File is at: {file_wsl}",
    priority="NORMAL"
)

With AgentHealth

Use Case: Log paths in platform-agnostic format.

Integration Pattern:

from pathbridge import PathBridge
from agenthealth import AgentHealth

pb = PathBridge()
health = AgentHealth()

# Log work on a file
file_path = "D:\\project\\main.py"
info = pb.get_info(file_path)

health.log_event("ATLAS", {
    "action": "file_edit",
    "windows_path": info["windows"],
    "wsl_path": info["wsl"],
    "exists": info["exists"]
})

With ConfigManager

Use Case: Store paths that work on all platforms.

Integration Pattern:

from pathbridge import PathBridge
from configmanager import ConfigManager

pb = PathBridge()
config = ConfigManager()

# Store paths in canonical (Windows) format
# Convert on retrieval based on platform
def get_config_path(key):
    path = config.get(key)
    return pb.convert(path)  # Auto-converts to current platform

# Usage
data_path = get_config_path("data_directory")

With SessionReplay

Use Case: Record paths in consistent format for replay.

Integration Pattern:

from pathbridge import PathBridge
from sessionreplay import SessionReplay

pb = PathBridge()
replay = SessionReplay()

# Log file operations with both path formats
file = "D:\\project\\output.json"
info = pb.get_info(file)

replay.log_event({
    "type": "file_create",
    "path_info": info,
    "timestamp": "2026-01-23T12:00:00"
})

With ContextCompressor

Use Case: Compress context that includes file paths.

from pathbridge import PathBridge
from contextcompressor import compress

pb = PathBridge()

# Context with Windows paths
context = """
Working on D:\\BCH\\src\\main.py
Config at D:\\BCH\\config.json
Output to D:\\BCH\\output\\
"""

# Convert paths to WSL for CLIO
lines = context.split("\n")
converted = []
for line in lines:
    # Simple path detection and conversion
    if ":\\" in line:
        # Find and convert Windows paths
        parts = line.split()
        for i, part in enumerate(parts):
            if ":\\" in part:
                parts[i] = pb.convert(part, target="wsl")
        converted.append(" ".join(parts))
    else:
        converted.append(line)

compressed = compress("\n".join(converted))

With TaskQueuePro

Use Case: Ensure task file references work for assigned agent.

Integration Pattern:

from pathbridge import PathBridge
from taskqueuepro import TaskQueuePro

pb = PathBridge()
queue = TaskQueuePro()

# Create task with platform-appropriate paths
file_to_process = "D:\\data\\input.csv"

# If assigning to CLIO (WSL agent)
task_file = pb.convert(file_to_process, target="wsl")

queue.create_task(
    title="Process CSV data",
    agent="CLIO",
    priority=2,
    metadata={
        "file": task_file,
        "original_path": file_to_process
    }
)

With MemoryBridge

Use Case: Store paths in memory that work across sessions.

from pathbridge import PathBridge
from memorybridge import MemoryBridge

pb = PathBridge()
memory = MemoryBridge()

# Store project paths with both formats
project = {
    "name": "BCH",
    "paths": {
        "root": {
            "windows": "D:\\BCH",
            "wsl": pb.convert("D:\\BCH", target="wsl")
        },
        "src": {
            "windows": "D:\\BCH\\src",
            "wsl": pb.convert("D:\\BCH\\src", target="wsl")
        }
    }
}

memory.set("project_bch", project)
memory.sync()

🚀 ADOPTION ROADMAP

Phase 1: Core Adoption (Week 1)

Goal: All agents aware and can use basic features

Steps:

  1. ✅ Tool deployed to GitHub
  2. ☐ Quick-start guides sent via Synapse
  3. ☐ Each agent tests basic conversion
  4. ☐ Feedback collected

Success Criteria:

  • All 5 agents have used PathBridge at least once
  • No blocking issues reported

Phase 2: Integration (Week 2-3)

Goal: Integrated into daily workflows

Steps:

  1. ☐ Add to agent startup routines
  2. ☐ Fix TimeSync path issues
  3. ☐ Update SynapseLink to use PathBridge
  4. ☐ Create shell aliases on all platforms

Success Criteria:

  • Path conversion happens automatically
  • No manual path translation needed

Phase 3: Optimization (Week 4+)

Goal: Optimized and fully adopted

Steps:

  1. ☐ Collect usage metrics
  2. ☐ Implement v1.1 improvements
  3. ☐ Add custom mappings as needed
  4. ☐ Document common patterns

Success Criteria:

  • Zero manual path conversions
  • All tools use PathBridge

📊 SUCCESS METRICS

Adoption Metrics:

  • Number of agents using PathBridge: [Track]
  • Daily usage count: [Track]
  • Integration with other tools: [Track]

Efficiency Metrics:

  • Time saved per use: ~30 seconds
  • Manual conversions eliminated: 100%
  • Cross-platform issues reduced: 90%+

Quality Metrics:

  • Bug reports: [Track]
  • Feature requests: [Track]
  • User satisfaction: [Qualitative]

🛠️ TECHNICAL INTEGRATION DETAILS

Import Paths

# Standard import
from pathbridge import PathBridge

# Specific imports
from pathbridge import PathBridge, get_clipboard_content, set_clipboard_content

Configuration Integration

Config File: ~/.pathbridgerc (optional)

Shared Config with Other Tools:

{
  "pathbridge": {
    "custom_mappings": {
      "N": "/network/share"
    },
    "default_target": null
  }
}

Error Handling Integration

Standardized Error Codes:

  • 0: Success
  • 1: General error
  • 2: Path not found
  • 3: Clipboard error

Logging Integration

Log Format: Compatible with Team Brain standard

import logging

logging.basicConfig(
    format='[%(levelname)s] %(name)s: %(message)s',
    level=logging.INFO
)

logger = logging.getLogger('pathbridge')

🔧 MAINTENANCE & SUPPORT

Update Strategy

  • Minor updates (v1.x): As needed
  • Major updates (v2.0+): Quarterly
  • Bug fixes: Immediate

Support Channels

  • GitHub Issues: Bug reports
  • Synapse: Team Brain discussions
  • Direct to ATLAS: Complex issues

Known Limitations

  • UNC paths detected but not fully converted
  • Pure Unix paths have limited conversion options
  • Clipboard requires platform-specific tools (xclip, pbcopy)

📚 ADDITIONAL RESOURCES


Last Updated: January 23, 2026
Maintained By: ATLAS (Team Brain)