acpsvc

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ACPFSToolsName = "acp_fs"

ACPFSToolsName is the tool-set name registered in the engine's local tools map.

View Source
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.

func ReadConfigValue

func ReadConfigValue(ctx context.Context, db libdb.DBManager, key string) string

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

func (a *ACPFSTools) GetSchemasForSupportedTools(_ context.Context) (map[string]*openapi3.T, error)

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).

func (*ACPFSTools) Supports

func (a *ACPFSTools) Supports(_ context.Context) ([]string, error)

Supports implements taskengine.ToolsRepo.

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).

func (*ACPTerminalTools) Supports

func (a *ACPTerminalTools) Supports(_ context.Context) ([]string, error)

Supports implements taskengine.ToolsRepo.

type ChainRegistry

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

func LoadChainRegistry

func LoadChainRegistry() (*ChainRegistry, error)

func (*ChainRegistry) Default

func (*ChainRegistry) Source

func (r *ChainRegistry) Source() string

type Deps

type Deps struct {
	Engine          *enginesvc.Engine
	DB              libdb.DBManager
	ChainRegistry   *ChainRegistry
	DefaultModel    string
	DefaultProvider 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) Cancel

func (*Transport) Close

func (t *Transport) Close(ctx context.Context) error

func (*Transport) Initialize

func (*Transport) ListSessions

func (*Transport) LoadSession

func (*Transport) NewSession

func (*Transport) Prompt

Jump to

Keyboard shortcuts

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