Documentation
¶
Overview ¶
Package acptools contains tools that are built in to ACP like file IO and terminals
Index ¶
- type FilesystemTools
- type TerminalTools
- func (e *TerminalTools) CreateTerminal(ctx context.Context, params acp.CreateTerminalRequest) (acp.CreateTerminalResponse, error)
- func (e *TerminalTools) KillTerminal(ctx context.Context, params acp.KillTerminalRequest) (acp.KillTerminalResponse, error)
- func (e *TerminalTools) ReleaseTerminal(ctx context.Context, params acp.ReleaseTerminalRequest) (acp.ReleaseTerminalResponse, error)
- func (e *TerminalTools) TerminalOutput(ctx context.Context, params acp.TerminalOutputRequest) (acp.TerminalOutputResponse, error)
- func (e *TerminalTools) WaitForTerminalExit(ctx context.Context, params acp.WaitForTerminalExitRequest) (acp.WaitForTerminalExitResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemTools ¶
type FilesystemTools struct {
// contains filtered or unexported fields
}
FilesystemTools implements the ACP ReadTextFile and WriteTextFile endpoints. It is separate from TerminalTools to allow toggling local/remote execution separately.
func NewFilesystemTools ¶
func NewFilesystemTools(logger zerolog.Logger) *FilesystemTools
func (*FilesystemTools) ReadTextFile ¶
func (e *FilesystemTools) ReadTextFile(ctx context.Context, params acp.ReadTextFileRequest) (acp.ReadTextFileResponse, error)
func (*FilesystemTools) WriteTextFile ¶
func (e *FilesystemTools) WriteTextFile(ctx context.Context, params acp.WriteTextFileRequest) (acp.WriteTextFileResponse, error)
type TerminalTools ¶
type TerminalTools struct {
// contains filtered or unexported fields
}
TerminalTools implements the terminal-related methods of acp.Client. It runs commands as real OS processes and tracks their output and exit status, keyed by a generated terminal ID.
func NewTerminalTools ¶
func NewTerminalTools(logger zerolog.Logger) *TerminalTools
NewTerminalTools constructs a TerminalTools with the given logger.
func (*TerminalTools) CreateTerminal ¶
func (e *TerminalTools) CreateTerminal(ctx context.Context, params acp.CreateTerminalRequest) (acp.CreateTerminalResponse, error)
CreateTerminal starts a new command process and returns a terminal ID that can be used to inspect its output and status.
func (*TerminalTools) KillTerminal ¶
func (e *TerminalTools) KillTerminal(ctx context.Context, params acp.KillTerminalRequest) (acp.KillTerminalResponse, error)
KillTerminal terminates the terminal's process without releasing the terminal; its output and exit status remain available afterwards.
func (*TerminalTools) ReleaseTerminal ¶
func (e *TerminalTools) ReleaseTerminal(ctx context.Context, params acp.ReleaseTerminalRequest) (acp.ReleaseTerminalResponse, error)
ReleaseTerminal frees the resources associated with a terminal, killing the underlying process if it is still running.
func (*TerminalTools) TerminalOutput ¶
func (e *TerminalTools) TerminalOutput(ctx context.Context, params acp.TerminalOutputRequest) (acp.TerminalOutputResponse, error)
TerminalOutput returns the output captured so far for a terminal along with its exit status, if the command has completed.
func (*TerminalTools) WaitForTerminalExit ¶
func (e *TerminalTools) WaitForTerminalExit(ctx context.Context, params acp.WaitForTerminalExitRequest) (acp.WaitForTerminalExitResponse, error)
WaitForTerminalExit blocks until the terminal's command exits (or the context is cancelled) and returns its exit status.