hotplex

package module
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 5 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 with Slack
export HOTPLEX_SLACK_BOT_USER_ID=B12345
export HOTPLEX_SLACK_BOT_TOKEN=xoxb-...
export HOTPLEX_SLACK_APP_TOKEN=xapp-...
./hotplexd --config configs/server.yaml --config-dir configs/chatapps

# Or start with WebSocket gateway only
./hotplexd --config configs/server.yaml
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 --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
}

๐Ÿ“‚ Project Structure

hotplex/
โ”œโ”€โ”€ cmd/
โ”‚   โ””โ”€โ”€ hotplexd/           # Daemon entrypoint
โ”œโ”€โ”€ 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/               # AI provider adapters
โ”‚   โ”œโ”€โ”€ claudecode/         # Claude Code protocol
โ”‚   โ”œโ”€โ”€ opencode/           # OpenCode protocol
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ 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
๐Ÿ”„ Session Pooling Long-lived CLI processes with instant reconnection High-frequency AI interactions
๐ŸŒŠ Full-Duplex Streaming Sub-second token delivery via Go channels Real-time UI updates
๐Ÿ›ก๏ธ Regex WAF Block destructive commands (rm -rf /, mkfs, etc.) Security hardening
๐Ÿ”’ PGID Isolation Clean process termination, no zombies Production reliability
๐Ÿ’ฌ Multi-Platform Slack ยท Feishu Team communication
๐Ÿ“ฆ Go SDK Embed directly in your Go app with zero overhead Custom integrations
๐Ÿ”Œ WebSocket Gateway Language-agnostic access via hotplexd daemon Web frontend
๐Ÿ“Š OpenTelemetry Built-in metrics and tracing support Observability
๐Ÿณ Docker 1+n 1 Base + n Stacks (node, python, java, rust, full) Multi-language

๐Ÿ› Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      ChatApps Layer                              โ”‚
โ”‚                 Slack Bot ยท Feishu Bot ยท Web                    โ”‚
โ”‚            (Event โ†’ ChatMessage โ†’ Session ID)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    WebSocket Gateway                            โ”‚
โ”‚              hotplexd daemon / Go SDK / HTTP                   โ”‚
โ”‚         (Protocol translation, Rate limiting, Auth)            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Engine / Runner                            โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚    โ”‚  Session Pool (map[SessionID]*Session)              โ”‚    โ”‚
โ”‚    โ”‚  - Lifecycle management                              โ”‚    โ”‚
โ”‚    โ”‚  - Idle timeout & GC                                 โ”‚    โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚    โ”‚  Runner (I/O Multiplexer)                           โ”‚    โ”‚
โ”‚    โ”‚  - stdin/stdout/stderr piping                       โ”‚    โ”‚
โ”‚    โ”‚  - Event serialization                               โ”‚    โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                    โ–ผ                    โ–ผ
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ Claude  โ”‚         โ”‚ OpenCodeโ”‚         โ”‚ Custom  โ”‚
   โ”‚   CLI   โ”‚         โ”‚   CLI   โ”‚         โ”‚ Providerโ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Data Flow: Request to Response
User โ†’ Gateway โ†’ Session Pool โ†’ Runner โ†’ CLI
CLI โ†’ Runner โ†’ Gateway โ†’ User (streaming)
Security Layers
Layer Implementation Configuration
Tool Governance AllowedTools config security.allowed_tools
Danger WAF Regex interception security.danger_waf
Process Isolation PGID-based termination Automatic
Filesystem Jail WorkDir lockdown engine.work_dir
Container Sandbox Docker (BaaS) docker/

๐Ÿ“– 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/chatapps/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'
}));
HTTP SSE API
curl -N -X POST http://localhost:8080/api/v1/execute \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello, AI!", "session_id": "session-123"}'

๐Ÿ’ป 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
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/chatapps/:
platform: platform-name
mode: socket  # or http
# ... platform-specific config
Adding a New Provider
  1. Implement provider/<name>/parser.go:
type Parser struct{}

func (p *Parser) ParseStream(line string) (*types.StreamMessage, error) {
    // Provider-specific output parsing
}
  1. Register in provider/factory.go:
func init() {
    providers.Register("provider-name", NewProvider)
}

๐Ÿ“š 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.27.4"
	VersionMajor = 0
	VersionMinor = 27
	VersionPatch = 4
)
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 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

	// 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, and safety configuration.

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 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
hotplexd command
internal
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.
security
Package security provides WAF-like protection for the HotPlex engine.
Package security provides WAF-like protection for the HotPlex engine.
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