hotplex

package module
v0.35.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 7 Imported by: 0

README ยถ

HotPlex Banner

HotPlex

High-Performance AI Agent Runtime

HotPlex transforms terminal AI tools (Claude Code, OpenCode) into production services. Built with Go using the Cli-as-a-Service paradigm, it eliminates CLI startup latency through persistent process pooling and ensures execution safety via PGID isolation and Regex WAF. The system supports WebSocket/HTTP/SSE communication with Python and TypeScript SDKs. At the application layer, HotPlex integrates with Slack and Feishu, supporting streaming output, interactive cards, and multi-bot protocols.

Release Go Reference Go Report Coverage License Stars

Quick Start ยท Features ยท Architecture ยท Docs ยท Discussions ยท ็ฎ€ไฝ“ไธญๆ–‡


Table of Contents


โšก Quick Start

# One-line installation
curl -sL https://raw.githubusercontent.com/hrygo/hotplex/main/install.sh | bash

# Or build from source
make build

# Start the daemon
./hotplexd start -config configs/server.yaml

# Start with custom environment file
./hotplexd start -config configs/server.yaml -env-file .env.local
Requirements
Component Version Notes
Go 1.25+ Runtime & SDK
AI CLI Claude Code or OpenCode Execution target
Docker 24.0+ Optional, for container deployment
First Run Checklist
# 1. Clone and build
git clone https://github.com/hrygo/hotplex.git
cd hotplex
make build

# 2. Copy environment template
cp .env.example .env

# 3. Configure your AI CLI
# Ensure Claude Code or OpenCode is in PATH

# 4. Run the daemon
./hotplexd start -config configs/server.yaml

๐Ÿง  Core Concepts

Understanding these concepts is essential for effective HotPlex development.

Session Pooling

HotPlex maintains long-lived CLI processes instead of spawning fresh instances per request. This eliminates:

  • Cold start latency (typically 2-5 seconds per invocation)
  • Context loss between requests
  • Resource waste from repeated initialization
Request 1 โ†’ CLI Process 1 (spawned, persistent)
Request 2 โ†’ CLI Process 1 (reused, instant)
Request 3 โ†’ CLI Process 1 (reused, instant)
I/O Multiplexing

The Runner component handles bidirectional communication between:

  • Upstream: User requests (WebSocket/HTTP/ChatApp events)
  • Downstream: CLI stdin/stdout/stderr streams
// Each session has dedicated I/O channels
type Session struct {
    Stdin  io.Writer
    Stdout io.Reader
    Stderr io.Reader
    Events chan *Event  // Internal event bus
}
PGID Isolation

Process Group ID (PGID) isolation ensures clean termination:

  • CLI processes are spawned with Setpgid: true
  • Termination sends signal to entire process group (kill -PGID)
  • No orphaned or zombie processes
Regex WAF

Web Application Firewall layer intercepts dangerous commands before they reach the CLI:

  • Block patterns: rm -rf /, mkfs, dd, :(){:|:&};:
  • Configurable via security.danger_waf in config
  • Works alongside CLI's native tool restrictions (AllowedTools)
ChatApps Abstraction

Unified interface for multi-platform bot integration:

type ChatAdapter interface {
    // Platform-specific event handling
    HandleEvent(event Event) error
    // Unified message format
    SendMessage(msg *ChatMessage) error
}
MessageOperations (Optional)

Advanced platforms implement streaming and message management:

type MessageOperations interface {
    StartStream(ctx, channelID, threadTS) (messageTS, error)
    AppendStream(ctx, channelID, messageTS, content) error
    StopStream(ctx, channelID, messageTS) error
    UpdateMessage(ctx, channelID, messageTS, msg) error
    DeleteMessage(ctx, channelID, messageTS) error
}

Module Analysis

1. Engine & Session Pool (internal/engine)

The engine layer is the brain of HotPlex, coordinating all AI interactions.

  • Deterministic ID Mapping: Generates UUID v5 using platform metadata, ensuring that the corresponding Claude CLI process can be retrieved even after hotplexd restarts.
  • Health Detection: 500ms frequency waitForReady polling combined with process.Signal(0) detection ensures that sessions assigned to users are 100% available.
  • Cleanup Mechanism: Dynamically adjusts the cleanup interval (Timeout/4), balancing resource utilization and response speed.
2. Security & Protection (internal/security)

HotPlex acts as a WAF for the local system.

  • Multi-level Filtering: Pre-configured with over 50 dangerous command patterns, ranging from simple rm to complex sudo bash reverse shells.
  • Evasion Defense: Specifically designed for LLM-generated content, it includes automatic markdown code block stripping and real-time detection of malicious control characters (e.g., null bytes).
3. Communication Server (internal/server)
  • Protocol Translation: The core ExecutionController serializes complex CLI events into standard streaming JSON for consumption by upstream platforms.
  • Admin API: Provides complete session audit logs (Audit Events) and export interfaces.
4. Native Brain (brain & internal/brain)
  • "System 1" Abstraction: Providing lightweight intent recognition and safety pre-audit interfaces, supporting multiple LLM model routing.
  • Resiliency: Built-in circuit breakers and automatic failover logic to ensure core capabilities remain available even if the primary model is down.
5. Telemetry & Monitoring (internal/telemetry)
  • OpenTelemetry: Deeply integrated OTEL, not only tracking request latency but also tracing every "Permission Decision" made by the AI.
  • Monitoring Metrics: Exports Prometheus-compatible metrics covering session success rates, token costs, and security interception frequency.
6. Management Tools (Management CLI)

hotplexd is not just a daemon; it is also a full-featured management tool:

  • status: View engine load, active session count, and memory usage in real-time.
  • session: Provides fine-grained session control including list (list), kill (kill), and logs (view logs).
  • doctor: Automatically diagnoses the local environment, checking claude CLI connectivity, permission settings, and Docker status.
  • config: Validates and renders the current merged configuration tree, supporting both local and remote validation.
  • cron: Schedule and manage background AI tasks with standard cron syntax and history tracking.
  • relay: Configure cross-platform bot-to-bot relaying and binding.

๐Ÿ“‚ Project Structure

hotplex/
โ”œโ”€โ”€ [cmd/](./cmd)                  # CLI & Daemon entrypoints
โ”‚   โ””โ”€โ”€ [hotplexd/](./cmd/hotplexd)  # Main daemon implementation
โ”œโ”€โ”€ internal/               # Core implementation (private)
โ”‚   โ”œโ”€โ”€ engine/             # Session pool & runner
โ”‚   โ”œโ”€โ”€ server/             # WebSocket & HTTP gateway
โ”‚   โ”œโ”€โ”€ security/           # WAF & isolation
โ”‚   โ”œโ”€โ”€ config/             # Configuration loading
โ”‚   โ”œโ”€โ”€ sys/                # OS signals
โ”‚   โ”œโ”€โ”€ telemetry/          # OpenTelemetry
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ brain/                  # Native Brain orchestration
โ”œโ”€โ”€ cache/                  # Caching layer
โ”œโ”€โ”€ [provider/](./provider)        # AI provider adapters
โ”‚   โ”œโ”€โ”€ [claude_provider.go](./provider/claude_provider.go)      # Claude Code protocol
โ”‚   โ”œโ”€โ”€ [opencode_provider.go](./provider/opencode_provider.go)  # OpenCode protocol
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ [chatapps/](./chatapps)        # Platform adapters
โ”‚   โ”œโ”€โ”€ slack/              # Slack Bot
โ”‚   โ”œโ”€โ”€ feishu/             # Feishu Bot
โ”‚   โ””โ”€โ”€ base/               # Common interfaces
โ”œโ”€โ”€ types/                  # Public type definitions
โ”œโ”€โ”€ event/                  # Event system
โ”œโ”€โ”€ plugins/                # Extension points
โ”‚   โ””โ”€โ”€ storage/            # Message persistence
โ”œโ”€โ”€ sdks/                   # Language bindings
โ”‚   โ”œโ”€โ”€ go/                 # Go SDK (embedded)
โ”‚   โ”œโ”€โ”€ python/             # Python SDK
โ”‚   โ””โ”€โ”€ typescript/         # TypeScript SDK
โ”œโ”€โ”€ docker/                 # Container definitions
โ”œโ”€โ”€ configs/                # Configuration examples
โ””โ”€โ”€ docs/                  # Architecture docs
Key Directories
Directory Purpose Public API
types/ Core types & interfaces โœ… Yes
event/ Event definitions โœ… Yes
hotplex.go SDK entry point โœ… Yes
internal/engine/ Session management โŒ Internal
internal/server/ Network protocols โŒ Internal
provider/ CLI adapters โš ๏ธ Provider interface

โœจ Features

Feature Description Use Case
๐Ÿ”„ Deterministic Sessions Precise mapping based on UUID v5 (SHA1) to ensure cross-platform context consistency High-frequency AI collaboration
๐Ÿ›ก๏ธ Secure Isolation Unix PGID and Windows Job Objects isolation to completely eliminate zombie processes Production-grade security
๐Ÿ›ก๏ธ Regex WAF 6-level risk assessment system to prevent command injection, privilege escalation, and reverse shells System hardening
๐ŸŒŠ Streaming Delivery 1MB-level I/O buffer + full-duplex Pipe for sub-second Token response Real-time interactive UI
๐Ÿ’ฌ Multi-platform Adaptation Native support for Slack and Feishu with $O(1)$ session lookup via secondary indexing Enterprise-level communication
๐Ÿ›ก๏ธ Cross-platform Relay Secure bot-to-bot message routing between different chat platforms Multi-agent collaboration
โฐ Background Cron Native scheduling for periodic AI tasks with failure recovery and webhooks Automation & Monitoring
Packaged Go SDK Zero-overhead embedded engine for direct integration into Go business logic Custom Agents
๐Ÿ”Œ Protocol Compatibility Full OpenCode HTTP/SSE protocol support for seamless frontend integration Cross-language frontend
๐Ÿ“Š Deep Telemetry Built-in OpenTelemetry tracing for tool execution and permission decisions Production monitoring
๐Ÿณ BaaS Architecture Docker 1+n containerization scheme with pre-installed major language environments Rapid deployment

๐Ÿ› Technical Architecture

HotPlex employs a decoupled layered architecture to ensure high reliability from chat platforms to the execution engine.

1. Engine & Session Pool
  • Deterministic ID Mapping: Uses UUID v5 (SHA1) to map Namespace + Platform + UserID + ChannelID to a persistent providerSessionID. This ensures that as long as the user metadata remains the same, the session can be accurately recovered after a daemon restart.
  • Cold/Warm Start Logic: Features a 500ms polling waitForReady mechanism combined with Job Markers for state recovery and stale session detection.
2. Isolation & Security
  • Process Group Isolation: Utilizes PGID (Process Group ID). Upon session termination, a signal is sent to the negative PID, forcing the removal of the entire process tree and eradicating orphan processes.
  • Dual-Layer WAF: Performs a 6-level risk assessment before commands reach the CLI. Includes evasion protection (blocking null bytes/control chars) and automatic markdown stripping (reducing false positives).
3. Communication & Flow Control
  • OpenCode Compatibility: Real-time mapping of internal events to reasoning, text, and tool parts.
  • I/O Multiplexing: Full-duplex pipes with 1MB dynamic buffers to prevent accidental blocking during large concurrent read/write operations.
  • Management Plane: Provides both direct local CLI access and a remote Admin API (port 9080) for session management, diagnostics, and metrics.
4. Module Structure
  • Provider System: Plug-in architecture supporting Claude Code's ~/.claude/projects/ directory management and permission synchronization.
  • ChatApp Adapter: Built-in secondary indexing for $O(1)$ session lookup based on user + channel.
graph TD
    User([User / ChatApps]) -- WebSocket / HTTP --> Gateway[hotplexd Gateway]
    Gateway -- Event Map --> Pool[Session Pool]
    Pool -- ID Mapping --> Runner[Runner/Multiplexer]
    Runner -- PGID Isolation --> CLI[AI CLI Process]
    
    subgraph Security Layer
    WAF[Regex WAF] .-> Runner
    Auth[API Key / Admin Auth] .-> Gateway
    end
    
    subgraph Persistence
    Marker[Session Marker Store] .-> Pool
    Log[Session Logs] .-> Runner
    end

๐Ÿ“– Usage Examples

Go SDK (Embeddable)
import (
    "context"
    "fmt"
    "time"

    "github.com/hrygo/hotplex"
    "github.com/hrygo/hotplex/types"
)

func main() {
    // Initialize engine
    engine, err := hotplex.NewEngine(hotplex.EngineOptions{
        Timeout:     5 * time.Minute,
        IdleTimeout: 30 * time.Minute,
    })
    if err != nil {
        panic(err)
    }
    defer engine.Close()

    // Execute prompt
    cfg := &types.Config{
        WorkDir:   "/path/to/project",
        SessionID: "user-session-123",
    }

    engine.Execute(context.Background(), cfg, "Explain this function", func(eventType string, data any) error {
        switch eventType {
        case "message":
            if msg, ok := data.(*types.StreamMessage); ok {
                fmt.Print(msg.Content)  // Streaming output
            }
        case "error":
            if errMsg, ok := data.(string); ok {
                fmt.Printf("Error: %s\n", errMsg)
            }
        case "usage":
            if stats, ok := data.(*types.UsageStats); ok {
                fmt.Printf("Tokens: %d input, %d output\n", stats.InputTokens, stats.OutputTokens)
            }
        }
        return nil
    })
}
Slack Bot Configuration
# configs/base/slack.yaml
platform: slack
mode: socket

provider:
  type: claude-code
  default_model: sonnet
  allowed_tools:
    - Read
    - Edit
    - Glob
    - Grep
    - Bash

engine:
  work_dir: ~/projects/hotplex
  timeout: 30m
  idle_timeout: 1h

security:
  owner:
    primary: ${HOTPLEX_SLACK_PRIMARY_OWNER}
    policy: trusted

assistant:
  bot_user_id: ${HOTPLEX_SLACK_BOT_USER_ID}
  dm_policy: allow
  group_policy: multibot
WebSocket API
// Connect
const ws = new WebSocket('ws://localhost:8080/ws/v1/agent');

// Listen for messages
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  switch (data.type) {
    case 'message':
      console.log(data.content);
      break;
    case 'error':
      console.error(data.error);
      break;
    case 'done':
      console.log('Execution complete');
      break;
  }
};

// Execute prompt
ws.send(JSON.stringify({
  type: 'execute',
  session_id: 'optional-session-id',
  prompt: 'List files in current directory'
}));
OpenCode Compatible API (HTTP/SSE)
# 1. Create session
curl -X POST http://localhost:8080/session

# 2. Send prompt (async)
curl -X POST http://localhost:8080/session/{session_id}/message \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello, AI!"}'

# 3. Listen for events (SSE)
curl -N http://localhost:8080/global/event

๐Ÿ’ป Development Guide

Common Tasks
# Run tests
make test

# Run with race detector
make test-race

# Build binary
make build

# Run linter
make lint

# Build Docker images
make docker-build

# Start Docker stack
make docker-up

[!TIP] The version information displayed by hotplexd version is injected via LDFLAGS during build. If you run go run or go build directly without LDFLAGS, it will show the default v0.0.0-dev. Using make build is recommended for compilation.

Adding a New ChatApp Platform
  1. Implement the adapter interface in chatapps/<platform>/:
type Adapter struct {
    client *platform.Client
    engine *engine.Engine
}

// Implement base.ChatAdapter interface
var _ base.ChatAdapter = (*Adapter)(nil)

func (a *Adapter) HandleEvent(event base.Event) error {
    // Platform-specific event parsing
}

func (a *Adapter) SendMessage(msg *base.ChatMessage) error {
    // Platform-specific message sending
}
  1. Register in chatapps/setup.go:
func init() {
    registry.Register("platform-name", NewAdapter)
}
  1. Add configuration in configs/base/:
platform: platform-name
mode: socket  # or http
# ... platform-specific config
Adding a New Provider
  1. Implement the Provider interface in provider/:
// provider/custom_provider.go
type CustomProvider struct{}

func (p *CustomProvider) Execute(ctx context.Context, cfg *types.Config, prompt string, callback event.Callback) error {
    // Implement provider-specific logic
}
  1. Register the new type in provider/factory.go.

๐Ÿ“š Documentation

Guide Description
๐Ÿš€ Deployment Docker, production setup
๐Ÿ’ฌ ChatApps Slack & Feishu integration
๐Ÿ›  Go SDK SDK reference
๐Ÿ”’ Security WAF, isolation
๐Ÿ“Š Observability Metrics, tracing
โš™๏ธ Configuration Full config reference

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

# 1. Fork and clone
git clone https://github.com/hrygo/hotplex.git

# 2. Create a feature branch
git checkout -b feat/your-feature

# 3. Make changes and test
make test
make lint

# 4. Commit with conventional format
git commit -m "feat(engine): add session priority support"

# 5. Submit PR
gh pr create --fill
Commit Message Format
<type>(<scope>): <description>

Types: feat, fix, refactor, docs, test, chore
Scope: engine, server, chatapps, provider, etc.
Code Standards
  • Follow Uber Go Style Guide
  • All interfaces require compile-time verification
  • Run make test-race before submitting

๐Ÿ“„ License

MIT License ยฉ 2024-present HotPlex Contributors


HotPlex Logo
Built for the AI Engineering community

Documentation ยถ

Overview ยถ

Package hotplex provides a production-ready execution environment for AI CLI agents.

Index ยถ

Constants ยถ

View Source
const (
	ProviderTypeClaudeCode = provider.ProviderTypeClaudeCode
	ProviderTypeOpenCode   = provider.ProviderTypeOpenCode
)

Provider constants

Variables ยถ

View Source
var (
	// Version can be overridden via ldflags: -X github.com/hrygo/hotplex.Version=1.2.3
	Version      = "0.35.2"
	VersionMajor = 0
	VersionMinor = 35
	VersionPatch = 2
)
View Source
var (
	// ErrDangerBlocked is returned when a dangerous operation is blocked by the WAF.
	ErrDangerBlocked = types.ErrDangerBlocked
	// ErrInvalidConfig is returned when the configuration is invalid.
	ErrInvalidConfig = types.ErrInvalidConfig
	// ErrSessionNotFound is returned when the requested session does not exist.
	ErrSessionNotFound = types.ErrSessionNotFound
	// ErrSessionDead is returned when the session is no longer alive.
	ErrSessionDead = types.ErrSessionDead
	// ErrTimeout is returned when an operation times out.
	ErrTimeout = types.ErrTimeout
	// ErrInputTooLarge is returned when input exceeds maximum size.
	ErrInputTooLarge = types.ErrInputTooLarge
	// ErrProcessStart is returned when the CLI process fails to start.
	ErrProcessStart = types.ErrProcessStart
	// ErrPipeClosed is returned when the pipe is closed.
	ErrPipeClosed = types.ErrPipeClosed
)
View Source
var (
	// NewEngine creates a new HotPlex Engine instance.
	NewEngine = engine.NewEngine
	// WrapSafe wraps a callback to make it safe for concurrent use.
	WrapSafe = event.WrapSafe
	// NewEventWithMeta creates a new EventWithMeta.
	NewEventWithMeta = event.NewEventWithMeta
	// TruncateString truncates a string to the given length.
	TruncateString = types.TruncateString
	// SummarizeInput creates a summary of input data.
	SummarizeInput = types.SummarizeInput
	// NewClaudeCodeProvider creates a new Claude Code provider instance.
	NewClaudeCodeProvider = provider.NewClaudeCodeProvider
	// NewOpenCodeProvider creates a new OpenCode provider instance.
	NewOpenCodeProvider = provider.NewOpenCodeProvider
)

Functions ยถ

This section is empty.

Types ยถ

type AssistantMessage ยถ

type AssistantMessage = types.AssistantMessage

AssistantMessage represents a message from the assistant.

type Callback ยถ

type Callback = event.Callback

Callback is the function signature for event streaming.

type ClaudeCodeProvider ยถ added in v0.7.0

type ClaudeCodeProvider = provider.ClaudeCodeProvider

ClaudeCodeProvider implements the Provider interface for Claude Code CLI.

type Config ยถ

type Config = types.Config

Config represents the configuration for a single HotPlex execution session.

type ContentBlock ยถ

type ContentBlock = types.ContentBlock

ContentBlock represents a content block in a message.

type CronJob ยถ added in v0.35.0

type CronJob = cron.CronJob

CronJob is an alias for the internal cron job type.

type CronManager ยถ added in v0.35.0

type CronManager interface {
	// AddCronJob registers a new cron job.
	AddCronJob(ctx context.Context, job *CronJob) error
	// DeleteCronJob removes a cron job by ID.
	DeleteCronJob(ctx context.Context, id string) error
	// PauseCronJob suspends a cron job without removing it.
	PauseCronJob(ctx context.Context, id string) error
	// ResumeCronJob re-activates a paused cron job.
	ResumeCronJob(ctx context.Context, id string) error
	// ListCronJobs returns all registered cron jobs.
	ListCronJobs(ctx context.Context) ([]*CronJob, error)
	// GetCronRuns returns the run history for a specific job.
	GetCronRuns(ctx context.Context, jobID string) ([]*CronRun, error)
}

CronManager defines the cron scheduling API for the HotPlex engine.

type CronRun ยถ added in v0.35.0

type CronRun = cron.CronRun

CronRun is an alias for the internal cron run record type.

type Engine ยถ

type Engine = engine.Engine

Engine is the core Control Plane for AI CLI agent integration.

type EngineOptions ยถ

type EngineOptions = engine.EngineOptions

EngineOptions defines the configuration parameters for initializing a new HotPlex Engine.

type EventMeta ยถ

type EventMeta = event.EventMeta

EventMeta contains metadata for stream events.

type EventWithMeta ยถ

type EventWithMeta = event.EventWithMeta

EventWithMeta wraps event data with metadata.

type Executor ยถ added in v0.7.0

type Executor interface {
	// Execute runs a command or prompt and streams normalized events.
	Execute(ctx context.Context, cfg *types.Config, prompt string, callback event.Callback) error

	// ValidateConfig checks if the session configuration is secure and valid.
	ValidateConfig(cfg *types.Config) error
}

Executor handles the core execution logic and configuration validation.

type HotPlexClient ยถ

type HotPlexClient interface {
	Executor
	SessionController
	SafetyManager
	CronManager
	RelayManager

	// Close gracefully terminates all managed sessions and releases resources.
	Close() error
}

HotPlexClient defines the comprehensive public API for the HotPlex engine. It integrates execution, session management, safety configuration, cron scheduling, and bot-to-bot relay.

type OpenCodeConfig ยถ added in v0.8.0

type OpenCodeConfig = provider.OpenCodeConfig

OpenCodeConfig contains OpenCode-specific configuration.

type Provider ยถ added in v0.7.0

type Provider = provider.Provider

Provider defines the interface for AI CLI agent providers.

type ProviderConfig ยถ added in v0.7.0

type ProviderConfig = provider.ProviderConfig

ProviderConfig defines the configuration for a specific provider instance.

type ProviderEvent ยถ added in v0.7.0

type ProviderEvent = provider.ProviderEvent

ProviderEvent represents a normalized event from any AI CLI provider.

type ProviderFeatures ยถ added in v0.7.0

type ProviderFeatures = provider.ProviderFeatures

ProviderFeatures describes the capabilities of a provider.

type ProviderMeta ยถ added in v0.7.0

type ProviderMeta = provider.ProviderMeta

ProviderMeta contains metadata about a provider.

type ProviderSessionOptions ยถ added in v0.7.0

type ProviderSessionOptions = provider.ProviderSessionOptions

ProviderSessionOptions configures a provider session.

type ProviderType ยถ added in v0.7.0

type ProviderType = provider.ProviderType

ProviderType defines the type of AI CLI provider.

type RelayBinding ยถ added in v0.35.0

type RelayBinding = relay.RelayBinding

RelayBinding is an alias for the relay binding type.

type RelayManager ยถ added in v0.35.0

type RelayManager interface {
	// SendRelay delivers a message to a named agent via the relay network.
	SendRelay(ctx context.Context, to string, content string) (*RelayResponse, error)
	// AddRelayBinding registers a chat-to-bots binding for relay routing.
	AddRelayBinding(ctx context.Context, binding *RelayBinding) error
	// RemoveRelayBinding deletes a relay binding by ChatID.
	RemoveRelayBinding(ctx context.Context, chatID string) error
	// ListRelayBindings returns all registered relay bindings.
	ListRelayBindings(ctx context.Context) ([]*RelayBinding, error)
}

RelayManager defines the bot-to-bot relay API for the HotPlex engine.

type RelayResponse ยถ added in v0.35.0

type RelayResponse = relay.RelayResponse

RelayResponse is an alias for the relay response type.

type SafetyManager ยถ added in v0.7.0

type SafetyManager interface {
	// SetDangerAllowPaths configures the whitelist of safe directories for file I/O.
	SetDangerAllowPaths(paths []string)

	// SetDangerBypassEnabled toggles the regex WAF (requires valid admin token).
	SetDangerBypassEnabled(token string, enabled bool) error
}

SafetyManager controls the security boundaries and WAF settings.

type SessionController ยถ added in v0.7.0

type SessionController interface {
	// GetSessionStats returns telemetry and token usage for the given sessionID.
	// Note: Use the business-side sessionID provided during execution, not the internal
	// CLI-level session identifier. This sessionID maps to a specific background process.
	GetSessionStats(sessionID string) *SessionStats

	// StopSession forcibly terminates a persistent session and its underlying OS process group.
	// Note: Use the business-side sessionID (provided by the user) to identify which
	// specific agent instance to terminate.
	StopSession(sessionID string, reason string) error

	// GetCLIVersion returns the version string of the underlying AI CLI tool.
	GetCLIVersion() (string, error)
}

SessionController provides administrative control over persistent sessions.

type SessionStats ยถ

type SessionStats = engine.SessionStats

SessionStats collects session-level statistics.

type SessionStatsData ยถ

type SessionStatsData = event.SessionStatsData

SessionStatsData contains comprehensive session statistics.

type StreamMessage ยถ

type StreamMessage = types.StreamMessage

StreamMessage represents a message from the CLI stream.

type UsageStats ยถ

type UsageStats = types.UsageStats

UsageStats represents token usage statistics.

Directories ยถ

Path Synopsis
_examples
chatapps_slack command
go_claude_basic command
Package brain provides intelligent orchestration capabilities for HotPlex.
Package brain provides intelligent orchestration capabilities for HotPlex.
llm
Package cache provides a pluggable caching layer for HotPlex.
Package cache provides a pluggable caching layer for HotPlex.
slack
Package slack provides a high-performance, AI-native Slack adapter for the HotPlex engine.
Package slack provides a high-performance, AI-native Slack adapter for the HotPlex engine.
slack/apphome
Package apphome provides Slack App Home capability center functionality.
Package apphome provides Slack App Home capability center functionality.
cmd
bridge-client
Package bridgeclient provides a Go SDK for connecting external platform adapters to HotPlex via the BridgeServer WebSocket gateway.
Package bridgeclient provides a Go SDK for connecting external platform adapters to HotPlex via the BridgeServer WebSocket gateway.
hotplexd command
Package main is the entry point for the hotplexd daemon.
Package main is the entry point for the hotplexd daemon.
internal
adminapi
Package adminapi provides shared authentication middleware for admin APIs.
Package adminapi provides shared authentication middleware for admin APIs.
agent
Package agent provides agent capability discovery via Agent Card.
Package agent provides agent capability discovery via Agent Card.
brain
Package brain provides intent detection and routing for user messages.
Package brain provides intent detection and routing for user messages.
bridgewire
Package bridgewire defines the shared Bridge Wire Protocol types and constants used by both BridgeServer (internal/server) and BridgeClient (cmd/bridge-client).
Package bridgewire defines the shared Bridge Wire Protocol types and constants used by both BridgeServer (internal/server) and BridgeClient (cmd/bridge-client).
cron
Package cron provides the cron scheduling subsystem for HotPlex.
Package cron provides the cron scheduling subsystem for HotPlex.
engine
Package engine provides the core session management and process pool for HotPlex.
Package engine provides the core session management and process pool for HotPlex.
panicx
Package panicx provides panic recovery utilities for goroutine safety.
Package panicx provides panic recovery utilities for goroutine safety.
persistence
Package persistence provides session marker storage abstractions.
Package persistence provides session marker storage abstractions.
relay
Package relay provides bot-to-bot communication across HotPlex instances.
Package relay provides bot-to-bot communication across HotPlex instances.
security
Package security provides WAF-like protection for the HotPlex engine.
Package security provides WAF-like protection for the HotPlex engine.
server
Package server provides the BridgeServer for external platform adapters.
Package server provides the BridgeServer for external platform adapters.
sys
Package sys provides cross-platform process management utilities.
Package sys provides cross-platform process management utilities.
plugins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL