Documentation
¶
Overview ¶
Package hotplex provides a production-ready execution environment for AI CLI agents.
Index ¶
- Constants
- Variables
- type AssistantMessage
- type Callback
- type ClaudeCodeProvider
- type Config
- type ContentBlock
- type Engine
- type EngineOptions
- type EventMeta
- type EventWithMeta
- type Executor
- type HotPlexClient
- type OpenCodeConfig
- type Provider
- type ProviderConfig
- type ProviderEvent
- type ProviderFeatures
- type ProviderMeta
- type ProviderSessionOptions
- type ProviderType
- type SafetyManager
- type SessionController
- type SessionStats
- type SessionStatsData
- type StreamMessage
- type UsageStats
Constants ¶
const ( Version = "0.9.3" VersionMajor = 0 VersionMinor = 9 VersionPatch = 3 )
const ( ProviderTypeClaudeCode = provider.ProviderTypeClaudeCode ProviderTypeOpenCode = provider.ProviderTypeOpenCode )
Provider constants
Variables ¶
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 )
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 ClaudeCodeProvider ¶ added in v0.7.0
type ClaudeCodeProvider = provider.ClaudeCodeProvider
ClaudeCodeProvider implements the Provider interface for Claude Code CLI.
type ContentBlock ¶
type ContentBlock = types.ContentBlock
ContentBlock represents a content block in a message.
type EngineOptions ¶
type EngineOptions = engine.EngineOptions
EngineOptions defines the configuration parameters for initializing a new HotPlex Engine.
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 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.
Directories
¶
| Path | Synopsis |
|---|---|
|
_examples
|
|
|
chatapps_dingtalk
command
|
|
|
chatapps_dingtalk_local
command
|
|
|
chatapps_dingtalk_with_engine
command
|
|
|
dingtalk_hook
command
|
|
|
go_claude_basic
command
|
|
|
go_claude_lifecycle
command
|
|
|
go_error_handling
command
|
|
|
go_opencode_basic
command
|
|
|
go_opencode_lifecycle
command
|
|
|
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. |
|
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. |