Documentation
¶
Index ¶
- Variables
- type ClaudeCode
- func (c *ClaudeCode) ActiveSessions() []string
- func (c *ClaudeCode) CLICommands() []string
- func (c *ClaudeCode) Close(userID string) error
- func (c *ClaudeCode) CloseAll() error
- func (c *ClaudeCode) Control(ctx context.Context, userID string, action types.Action) (bool, error)
- func (c *ClaudeCode) Name() string
- func (c *ClaudeCode) RawInput(ctx context.Context, userID string, input string) error
- func (c *ClaudeCode) RespawnSession(ctx context.Context, userID, workDir, resumeOpt string) (bool, error)
- func (c *ClaudeCode) Restart(ctx context.Context, userID string, flags map[string]string) (bool, error)
- func (c *ClaudeCode) Send(ctx context.Context, userID string, msg agent.Message) error
- func (c *ClaudeCode) Subscribe(userID string) <-chan *agent.Response
- type Option
Constants ¶
This section is empty.
Variables ¶
var PromptMD string
Functions ¶
This section is empty.
Types ¶
type ClaudeCode ¶
type ClaudeCode struct {
// contains filtered or unexported fields
}
ClaudeCode implements agent.Agent by spawning Claude Code with an MCP bridge.
func New ¶
func New(ctx context.Context, opts ...Option) (*ClaudeCode, error)
New creates a new ClaudeCode agent. The provided ctx controls the lifetime of all internal goroutines (accept loop, bridge readers, etc.).
func (*ClaudeCode) ActiveSessions ¶
func (c *ClaudeCode) ActiveSessions() []string
func (*ClaudeCode) CLICommands ¶
func (c *ClaudeCode) CLICommands() []string
func (*ClaudeCode) Close ¶
func (c *ClaudeCode) Close(userID string) error
Close terminates a user's session.
func (*ClaudeCode) CloseAll ¶
func (c *ClaudeCode) CloseAll() error
CloseAll terminates all sessions and cleans up the socket.
func (*ClaudeCode) RawInput ¶
RawInput sends text directly to the agent's terminal, bypassing MCP. Polls capture-pane for TUI menu response.
func (*ClaudeCode) RespawnSession ¶
func (c *ClaudeCode) RespawnSession(ctx context.Context, userID, workDir, resumeOpt string) (bool, error)
RespawnSession switches the user's session to a different working directory.
func (*ClaudeCode) Restart ¶
func (c *ClaudeCode) Restart(ctx context.Context, userID string, flags map[string]string) (bool, error)
Restart terminates the user's current session and starts a new one with the given flags.
type Option ¶
type Option func(*ClaudeCode)
Option configures a ClaudeCode agent.
func WithBridgeBin ¶
WithBridgeBin sets the path to the bridge binary.
func WithClaudeCmd ¶
WithClaudeCmd sets the path to the claude CLI binary.
func WithClaudeMD ¶
WithClaudeMD sets the CLAUDE.md content written to each session workdir.
func WithRuntime ¶
WithRuntime sets the runtime container (tmux, screen, etc.) for hosting Claude sessions.
func WithWorkDir ¶
WithWorkDir sets the base working directory for sessions.