Documentation
¶
Overview ¶
ABOUTME: Bootstrap functions for creating mux agents in hex. ABOUTME: Handles root agent and subagent creation with proper tool filtering.
ABOUTME: Package adapter provides adapters for integrating hex with mux. ABOUTME: This package bridges hex's existing tools and orchestrator with mux's agent system.
ABOUTME: LLM client wrapper that injects extended thinking config into requests ABOUTME: Enables deep reasoning for complex tasks without modifying the mux orchestrator
ABOUTME: Adapter that wraps hex tools to implement mux's tool.Tool interface. ABOUTME: Allows hex's existing tools to work with mux's orchestrator.
Index ¶
- func AdaptAll(hexTools []tools.Tool) []muxtool.Tool
- func AdaptTool(t tools.Tool) muxtool.Tool
- func IsSubagent() bool
- func NewRootAgent(cfg Config) *agent.Agent
- func NewSubagent(cfg Config) *agent.Agent
- func NewSubagentWithClient(cfg Config, llmClient llm.Client, agentID string) *agent.Agent
- type AgentRunner
- type ApprovalFunc
- type Config
- type ThinkingClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSubagent ¶
func IsSubagent() bool
IsSubagent returns true if this process is running as a subagent.
func NewRootAgent ¶
NewRootAgent creates a root agent with full tool access.
func NewSubagent ¶
NewSubagent creates a subagent with filtered tool access based on env vars.
Types ¶
type AgentRunner ¶ added in v1.10.0
type AgentRunner struct {
LLMClient llm.Client // LLM client for agent communication
ToolFactory func() []tools.Tool // Factory to create fresh tool instances
ApprovalFunc func(ctx context.Context, toolName string, params map[string]any) (bool, error)
}
AgentRunner implements the tools.MuxAgentRunner interface. It creates and runs mux agents for in-process subagent execution.
func NewAgentRunner ¶ added in v1.10.0
func NewAgentRunner(llmClient llm.Client, toolFactory func() []tools.Tool) *AgentRunner
NewAgentRunner creates a new AgentRunner for executing mux agents.
type ApprovalFunc ¶
ApprovalFunc is called when a tool requires approval before execution. Returns true to approve, false to deny. Error indicates approval check failed.
type Config ¶
type Config struct {
APIKey string
Model string
SystemPrompt string
HexTools []tools.Tool
ApprovalFunc ApprovalFunc // Optional: if nil, tools requiring approval will fail
HookManager *muxhooks.Manager // Optional: mux hook manager for lifecycle events
LLMClient llm.Client // Optional: pre-configured LLM client (overrides APIKey/Model)
}
Config holds configuration for creating an agent.
type ThinkingClient ¶ added in v1.12.0
type ThinkingClient struct {
// contains filtered or unexported fields
}
ThinkingClient wraps an LLM client and injects ThinkingConfig into every request.
func NewThinkingClient ¶ added in v1.12.0
func NewThinkingClient(inner llm.Client, budgetTokens int) *ThinkingClient
NewThinkingClient creates a client wrapper that enables extended thinking.
func (*ThinkingClient) CreateMessage ¶ added in v1.12.0
func (c *ThinkingClient) CreateMessage(ctx context.Context, req *llm.Request) (*llm.Response, error)
CreateMessage injects thinking config and delegates to the inner client.
func (*ThinkingClient) CreateMessageStream ¶ added in v1.12.0
func (c *ThinkingClient) CreateMessageStream(ctx context.Context, req *llm.Request) (<-chan llm.StreamEvent, error)
CreateMessageStream injects thinking config and delegates to the inner client.