acp

package
v0.0.0-...-75ec8e3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunACPAgent

func RunACPAgent(ctx context.Context, cfg *config.Config, providerMgr *provider.Manager) error

RunACPAgent starts an ACP agent server using stdio

Types

type ACPFileSystem

type ACPFileSystem struct {
	// contains filtered or unexported fields
}

ACPFileSystem implements the fs.FileSystem interface using the ACP client's filesystem protocol

func NewACPFileSystem

func NewACPFileSystem(conn *acp.AgentSideConnection, sessionID string, workingDir string) *ACPFileSystem

NewACPFileSystem creates a new ACP filesystem wrapper

func (*ACPFileSystem) Close

func (afs *ACPFileSystem) Close() error

Close implements fs.FileSystem - no-op for ACP

func (*ACPFileSystem) Delete

func (afs *ACPFileSystem) Delete(ctx context.Context, path string) error

Delete implements fs.FileSystem - not supported via ACP

func (*ACPFileSystem) DeleteAll

func (afs *ACPFileSystem) DeleteAll(ctx context.Context, path string) error

DeleteAll implements fs.FileSystem - not supported via ACP

func (*ACPFileSystem) Exists

func (afs *ACPFileSystem) Exists(ctx context.Context, path string) (bool, error)

Exists implements fs.FileSystem

func (*ACPFileSystem) ListDir

func (afs *ACPFileSystem) ListDir(ctx context.Context, path string) ([]*fs.FileInfo, error)

ListDir implements fs.FileSystem - limited implementation for ACP

func (*ACPFileSystem) MkdirAll

func (afs *ACPFileSystem) MkdirAll(ctx context.Context, path string, perm os.FileMode) error

MkdirAll implements fs.FileSystem - not supported via ACP

func (*ACPFileSystem) Move

func (afs *ACPFileSystem) Move(ctx context.Context, src, dst string) error

Move implements fs.FileSystem - uses fallback filesystem behavior

func (*ACPFileSystem) ReadFile

func (afs *ACPFileSystem) ReadFile(ctx context.Context, path string) ([]byte, error)

ReadFile implements fs.FileSystem using client's readTextFile

func (*ACPFileSystem) ReadFileLines

func (afs *ACPFileSystem) ReadFileLines(ctx context.Context, path string, from, to int) ([]string, error)

ReadFileLines implements fs.FileSystem by reading the full file and splitting into lines

func (*ACPFileSystem) Stat

func (afs *ACPFileSystem) Stat(ctx context.Context, path string) (*fs.FileInfo, error)

Stat implements fs.FileSystem - limited implementation for ACP

func (*ACPFileSystem) WriteFile

func (afs *ACPFileSystem) WriteFile(ctx context.Context, path string, data []byte) error

WriteFile implements fs.FileSystem using client's writeTextFile

type ACPInteractionHandler

type ACPInteractionHandler struct {
	// contains filtered or unexported fields
}

ACPInteractionHandler implements UserInteractionHandler for ACP mode

func NewACPInteractionHandler

func NewACPInteractionHandler(conn *acp.AgentSideConnection, sessionID string) *ACPInteractionHandler

NewACPInteractionHandler creates a new ACP interaction handler

func (*ACPInteractionHandler) HandleInteraction

HandleInteraction processes a user interaction request

func (*ACPInteractionHandler) Mode

func (h *ACPInteractionHandler) Mode() string

Mode returns the handler mode name

func (*ACPInteractionHandler) SupportsInteraction

func (h *ACPInteractionHandler) SupportsInteraction(interactionType actor.InteractionType) bool

SupportsInteraction indicates whether this handler can handle the given type. ACP mode currently supports authorization requests.

type ScriptschnellAIAgent

type ScriptschnellAIAgent struct {
	// contains filtered or unexported fields
}

ScriptschnellAIAgent implements the acp.Agent interface to expose statcode-ai functionality via ACP

func NewScriptschnellAIAgent

func NewScriptschnellAIAgent(ctx context.Context, cfg *config.Config, providerMgr *provider.Manager) (*ScriptschnellAIAgent, error)

NewScriptschnellAIAgent creates a new ACP agent that wraps statcode-ai functionality

func (*ScriptschnellAIAgent) Authenticate

Authenticate implements acp.Agent

func (*ScriptschnellAIAgent) Cancel

Cancel implements acp.Agent

func (*ScriptschnellAIAgent) Close

func (a *ScriptschnellAIAgent) Close() error

Close cleans up the agent and all its sessions

func (*ScriptschnellAIAgent) GetAvailableCommands

func (a *ScriptschnellAIAgent) GetAvailableCommands() []acp.AvailableCommand

GetAvailableCommands returns the list of available slash commands

func (*ScriptschnellAIAgent) Initialize

Initialize implements acp.Agent

func (*ScriptschnellAIAgent) LoadSession

LoadSession implements acp.Agent

func (*ScriptschnellAIAgent) NewSession

NewSession implements acp.Agent

func (*ScriptschnellAIAgent) Prompt

Prompt implements acp.Agent - this is the main method where we process user prompts

func (*ScriptschnellAIAgent) SetAgentConnection

func (a *ScriptschnellAIAgent) SetAgentConnection(conn *acp.AgentSideConnection)

SetAgentConnection implements acp.AgentConnAware to receive the connection after construction

func (*ScriptschnellAIAgent) SetSessionMode

SetSessionMode implements acp.Agent

func (*ScriptschnellAIAgent) SetSessionModel

SetSessionModel implements acp.AgentExperimental

type SlashCommand

type SlashCommand struct {
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	Input       *acp.AvailableCommandInput `json:"input,omitempty"`
	Handler     func(sessionID, args string) (string, error)
}

SlashCommand represents a slash command that can be executed by the agent

type Terminal

type Terminal struct {
	ID              string
	SessionID       acp.SessionId
	JobID           string // Background job ID from shell actor
	Command         string
	Args            []string
	Cwd             string
	OutputByteLimit int
	CreatedAt       time.Time
	// contains filtered or unexported fields
}

Terminal represents a running terminal session

type TerminalManager

type TerminalManager struct {
	// contains filtered or unexported fields
}

TerminalManager manages terminal sessions using the shell actor

func NewTerminalManager

func NewTerminalManager(shellActor actor.ShellActor) *TerminalManager

NewTerminalManager creates a new terminal manager

func (*TerminalManager) Create

Create creates a new terminal and starts the command

func (*TerminalManager) Kill

Kill terminates a terminal command

func (*TerminalManager) Output

Output retrieves the current output of a terminal

func (*TerminalManager) Release

Release kills the command if still running and releases terminal resources

func (*TerminalManager) WaitForExit

WaitForExit waits for a terminal command to complete

Jump to

Keyboard shortcuts

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