Documentation
¶
Index ¶
- Constants
- func New(deps Deps) libacp.AgentFactory
- func NewACPFSTools(transport func() *Transport) taskengine.ToolsRepo
- func NewACPTerminalTools(transport func() *Transport) taskengine.ToolsRepo
- func ReadConfigValue(ctx context.Context, db libdb.DBManager, key string) string
- type ACPFSTools
- func (a *ACPFSTools) Exec(ctx context.Context, _ time.Time, input any, _ bool, ...) (any, taskengine.DataType, error)
- func (a *ACPFSTools) GetSchemasForSupportedTools(_ context.Context) (map[string]*openapi3.T, error)
- func (a *ACPFSTools) GetToolsForToolsByName(_ context.Context, name string) ([]taskengine.Tool, error)
- func (a *ACPFSTools) Supports(_ context.Context) ([]string, error)
- type ACPTerminalResult
- type ACPTerminalTools
- func (a *ACPTerminalTools) Exec(ctx context.Context, _ time.Time, input any, _ bool, ...) (any, taskengine.DataType, error)
- func (a *ACPTerminalTools) GetSchemasForSupportedTools(_ context.Context) (map[string]*openapi3.T, error)
- func (a *ACPTerminalTools) GetToolsForToolsByName(_ context.Context, name string) ([]taskengine.Tool, error)
- func (a *ACPTerminalTools) Supports(_ context.Context) ([]string, error)
- type ChainRegistry
- type Deps
- type Transport
- func (t *Transport) AskApproval(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
- func (t *Transport) Authenticate(_ context.Context, _ libacp.AuthenticateRequest) (libacp.AuthenticateResponse, error)
- func (t *Transport) Cancel(_ context.Context, _ libacp.CancelNotification) error
- func (t *Transport) Close(ctx context.Context) error
- func (t *Transport) Initialize(_ context.Context, req libacp.InitializeRequest) (libacp.InitializeResponse, error)
- func (t *Transport) ListSessions(ctx context.Context, req libacp.ListSessionsRequest) (libacp.ListSessionsResponse, error)
- func (t *Transport) LoadSession(ctx context.Context, req libacp.LoadSessionRequest) (libacp.LoadSessionResponse, error)
- func (t *Transport) NewSession(ctx context.Context, req libacp.NewSessionRequest) (libacp.NewSessionResponse, error)
- func (t *Transport) Prompt(ctx context.Context, req libacp.PromptRequest) (libacp.PromptResponse, error)
Constants ¶
const ACPFSToolsName = "acp_fs"
ACPFSToolsName is the tool-set name registered in the engine's local tools map.
const ACPTerminalToolsName = "acp_terminal"
ACPTerminalToolsName is the tool-set name registered in the engine's local tools map.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(deps Deps) libacp.AgentFactory
func NewACPFSTools ¶
func NewACPFSTools(transport func() *Transport) taskengine.ToolsRepo
NewACPFSTools creates a new ToolsRepo that routes file operations to the ACP client. transport must return the active Transport or nil.
func NewACPTerminalTools ¶
func NewACPTerminalTools(transport func() *Transport) taskengine.ToolsRepo
NewACPTerminalTools creates a new ToolsRepo that routes command execution to the ACP client's terminal subsystem.
Types ¶
type ACPFSTools ¶
type ACPFSTools struct {
// contains filtered or unexported fields
}
ACPFSTools exposes the ACP fs/read_text_file and fs/write_text_file methods as tools the LLM can invoke. The actual I/O happens inside the client (editor) — Contenox sends a JSON-RPC request over the ACP connection and the editor returns the file content (including unsaved buffer state) or performs the write.
This follows the same ToolsRepo pattern as EchoTools, LocalFSTools, etc.
func (*ACPFSTools) Exec ¶
func (a *ACPFSTools) Exec(ctx context.Context, _ time.Time, input any, _ bool, toolsCall *taskengine.ToolsCall) (any, taskengine.DataType, error)
Exec implements taskengine.ToolsRepo.
func (*ACPFSTools) GetSchemasForSupportedTools ¶
GetSchemasForSupportedTools implements taskengine.ToolsRepo.
func (*ACPFSTools) GetToolsForToolsByName ¶
func (a *ACPFSTools) GetToolsForToolsByName(_ context.Context, name string) ([]taskengine.Tool, error)
GetToolsForToolsByName implements taskengine.ToolsRepo. Only advertises tools the client actually supports (checked via clientCaps from the initialize handshake).
type ACPTerminalResult ¶
type ACPTerminalResult struct {
ExitCode *int `json:"exit_code"`
Signal string `json:"signal,omitempty"`
Output string `json:"output"`
Truncated bool `json:"truncated"`
Command string `json:"command"`
}
ACPTerminalResult is the structured result returned to the LLM after command execution.
type ACPTerminalTools ¶
type ACPTerminalTools struct {
// contains filtered or unexported fields
}
ACPTerminalTools exposes the ACP terminal/* methods as tools the LLM can invoke. The actual command execution happens inside the client (editor) — Contenox sends JSON-RPC requests over the ACP connection and the editor creates, runs, and manages the terminal process.
The tool presents a single "exec" function to the LLM that orchestrates the full lifecycle: terminal/create → terminal/wait_for_exit → terminal/output → terminal/release. This keeps the LLM interface simple while following the spec's lifecycle requirements.
func (*ACPTerminalTools) Exec ¶
func (a *ACPTerminalTools) Exec(ctx context.Context, _ time.Time, input any, _ bool, toolsCall *taskengine.ToolsCall) (any, taskengine.DataType, error)
Exec implements taskengine.ToolsRepo.
func (*ACPTerminalTools) GetSchemasForSupportedTools ¶
func (a *ACPTerminalTools) GetSchemasForSupportedTools(_ context.Context) (map[string]*openapi3.T, error)
GetSchemasForSupportedTools implements taskengine.ToolsRepo.
func (*ACPTerminalTools) GetToolsForToolsByName ¶
func (a *ACPTerminalTools) GetToolsForToolsByName(_ context.Context, name string) ([]taskengine.Tool, error)
GetToolsForToolsByName implements taskengine.ToolsRepo. Only advertises the tool when the client supports terminals (checked via clientCaps.Terminal).
type ChainRegistry ¶
type ChainRegistry struct {
// contains filtered or unexported fields
}
func LoadChainRegistry ¶
func LoadChainRegistry() (*ChainRegistry, error)
func (*ChainRegistry) Default ¶
func (r *ChainRegistry) Default() *taskengine.TaskChainDefinition
func (*ChainRegistry) Source ¶
func (r *ChainRegistry) Source() string
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) AskApproval ¶
func (t *Transport) AskApproval(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
func (*Transport) Authenticate ¶
func (t *Transport) Authenticate(_ context.Context, _ libacp.AuthenticateRequest) (libacp.AuthenticateResponse, error)
func (*Transport) Initialize ¶
func (t *Transport) Initialize(_ context.Context, req libacp.InitializeRequest) (libacp.InitializeResponse, error)
func (*Transport) ListSessions ¶
func (t *Transport) ListSessions(ctx context.Context, req libacp.ListSessionsRequest) (libacp.ListSessionsResponse, error)
func (*Transport) LoadSession ¶
func (t *Transport) LoadSession(ctx context.Context, req libacp.LoadSessionRequest) (libacp.LoadSessionResponse, error)
func (*Transport) NewSession ¶
func (t *Transport) NewSession(ctx context.Context, req libacp.NewSessionRequest) (libacp.NewSessionResponse, error)
func (*Transport) Prompt ¶
func (t *Transport) Prompt(ctx context.Context, req libacp.PromptRequest) (libacp.PromptResponse, error)