Documentation
¶
Index ¶
- Constants
- Variables
- func CommandLocationAllowed(resolved, allowedDir string, extra []string) bool
- func DecodeMCPImageResult(result any) (*taskengine.ToolImageResult, bool)
- func DefaultSkipDirNames() []string
- func GitignoreIgnores(absRoot, rel string, isDir bool) bool
- func IsApprovalPending() bool
- func IsAtomicTemp(rel string) bool
- func NewEchoTools() taskengine.ToolsRepo
- func NewGitTools(allowedDir string) taskengine.ToolsRepo
- func NewGitToolsWith(allowedDir, name string, cwdResolver func(context.Context) string, ...) taskengine.ToolsRepo
- func NewLocalExecTools(opts ...LocalExecOption) taskengine.ToolsRepo
- func NewLocalExecToolsWith(runner CommandRunner, opts ...LocalExecOption) taskengine.ToolsRepo
- func NewLocalFSTools(allowedDir string, db libdb.DBManager) taskengine.ToolsRepo
- func NewLocalFSToolsWith(allowedDir string, db libdb.DBManager, io FileIO, name string, ...) taskengine.ToolsRepo
- func NewPrint(tracker libtracker.ActivityTracker) taskengine.ToolsRepo
- func NewSSHTools(options ...SSHOption) (taskengine.ToolsRepo, error)
- func NewWebCaller(tracker libtracker.ActivityTracker, options ...WebtoolsOption) taskengine.ToolsRepo
- func PruneLocalFSReads(ctx context.Context, exec interface{ ... }, dialect SQLDialect, ...) error
- func RunOAuthFlow(ctx context.Context, o2cfg *oauth2.Config, oauthCfg *MCPOAuthConfig, ...) (*oauth2.Token, error)
- func ToolchainRoots() []string
- func WorkspaceSkip() func(root, rel string, isDir bool) bool
- type AskApproval
- type AtomicFileIO
- type CommandRunner
- type CommandSpec
- type EchoTools
- func (e *EchoTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (e *EchoTools) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (e *EchoTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (e *EchoTools) Supports(ctx context.Context) ([]string, error)
- type FSOption
- type FileIO
- type FsSedResult
- type FsWriteResult
- type GitBranch
- type GitBranchListResult
- type GitCommitRef
- type GitIdentity
- type GitIdentityResolver
- type GitLogEntry
- type GitLogResult
- type GitOption
- type GitStatusEntry
- type GitStatusResult
- type GitTools
- func (h *GitTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (h *GitTools) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (h *GitTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (h *GitTools) ReadPaths(ctx context.Context, toolsCall *taskengine.ToolsCall, args map[string]any) ([]string, error)
- func (h *GitTools) Supports(ctx context.Context) ([]string, error)
- type HITLWrapper
- func (h *HITLWrapper) AuthorizeRead(ctx context.Context, path string) error
- func (h *HITLWrapper) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (h *HITLWrapper) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (h *HITLWrapper) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (h *HITLWrapper) Supports(ctx context.Context) ([]string, error)
- func (h *HITLWrapper) WithReadPaths(fn ReadPathsFunc) *HITLWrapper
- type HostKeyVerifier
- type LocalExecGate
- type LocalExecOption
- func WithLocalExecAllowedCommands(commands []string) LocalExecOption
- func WithLocalExecAllowedDir(dir string) LocalExecOption
- func WithLocalExecCwdResolver(resolve func(context.Context) string) LocalExecOption
- func WithLocalExecDeniedCommands(commands []string) LocalExecOption
- func WithLocalExecGate(gate LocalExecGate) LocalExecOption
- func WithLocalExecScrubEnv(scrub func([]string) []string) LocalExecOption
- func WithLocalExecShell(shell PlatformShell) LocalExecOption
- func WithLocalExecTimeout(d time.Duration) LocalExecOption
- func WithLocalExecToolDirs(dirs []string) LocalExecOption
- func WithLocalExecTracker(tracker libtracker.ActivityTracker) LocalExecOption
- type LocalExecResult
- type LocalExecTools
- func (h *LocalExecTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (h *LocalExecTools) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (h *LocalExecTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (h *LocalExecTools) Supports(ctx context.Context) ([]string, error)
- type LocalFSTools
- func (h *LocalFSTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (h *LocalFSTools) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (h *LocalFSTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (h *LocalFSTools) InvalidateSessionReads(ctx context.Context, sessionID string) error
- func (h *LocalFSTools) Supports(ctx context.Context) ([]string, error)
- type MCPAuthConfig
- type MCPAuthType
- type MCPImage
- type MCPImageResult
- type MCPOAuthConfig
- type MCPServerConfig
- type MCPSessionPool
- func (p *MCPSessionPool) CallTool(ctx context.Context, toolName string, args map[string]any) (any, error)
- func (p *MCPSessionPool) Close() error
- func (p *MCPSessionPool) Connect(ctx context.Context) error
- func (p *MCPSessionPool) ListTools(ctx context.Context) ([]*mcp.Tool, error)
- func (p *MCPSessionPool) Reconnect(ctx context.Context) error
- func (p *MCPSessionPool) Session(ctx context.Context) (*mcp.ClientSession, error)
- type MCPTransport
- type MediaRenderer
- type MockToolsRepo
- func (m *MockToolsRepo) CallCount() int
- func (m *MockToolsRepo) Exec(ctx context.Context, startingTime time.Time, input any, ...) (int, any, taskengine.DataType, string, error)
- func (m *MockToolsRepo) LastCall() *ToolsCallRecord
- func (m *MockToolsRepo) Reset()
- func (m *MockToolsRepo) Supports(ctx context.Context) ([]string, error)
- func (m *MockToolsRepo) WithErrorSequence(errors ...error) *MockToolsRepo
- func (m *MockToolsRepo) WithResponse(toolsType string, response ToolsResponse) *MockToolsRepo
- type PlatformShell
- func DetectPlatformShell() PlatformShell
- func DetectPlatformShellFor(goos string, getenv func(string) string, lookPath func(string) (string, error)) PlatformShell
- func NewCmdShell(command string) PlatformShell
- func NewPowerShellShell(command string) PlatformShell
- func NewShShell(command string) PlatformShell
- func (s PlatformShell) IsSet() bool
- func (s PlatformShell) ShellModeDescription() string
- func (s PlatformShell) Summary() string
- func (s PlatformShell) WithDefaults() PlatformShell
- func (s PlatformShell) WrapCommand(command string, args []string) (program string, wrappedArgs []string, script string)
- type PolicyRefusal
- type Print
- func (h *Print) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (h *Print) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (h *Print) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (h *Print) Supports(ctx context.Context) ([]string, error)
- type ReadPathProvider
- type ReadPathsFunc
- type SQLDialect
- type SSHClientCache
- type SSHConfig
- type SSHOption
- type SSHResult
- type SSHTools
- func (h *SSHTools) Close() error
- func (h *SSHTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (h *SSHTools) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (h *SSHTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (h *SSHTools) Supports(ctx context.Context) ([]string, error)
- type ShellKind
- type StatFileIO
- type ToolsCallRecord
- type ToolsResponse
- type WebCaller
- func (h *WebCaller) Exec(ctx context.Context, _ time.Time, input any, _ bool, ...) (any, taskengine.DataType, error)
- func (h *WebCaller) GetSchemasForSupportedTools(_ context.Context) (map[string]*openapi3.T, error)
- func (h *WebCaller) GetToolsForToolsByName(_ context.Context, name string) ([]taskengine.Tool, error)
- func (h *WebCaller) Supports(_ context.Context) ([]string, error)
- type WebtoolsOption
Constants ¶
const ( RefusalOutsideProject = "command_outside_project" RefusalNotAllowlisted = "command_not_allowlisted" RefusalDenied = "command_denied_by_policy" RefusalShellNeedsAllowlist = "shell_requires_allowlist" RefusalUngated = "shell_gated_nowhere" )
const AtomicTempPrefix = vfs.AtomicTempPrefix
const (
DenyMessage = denyMessageUser
)
const GitToolsName = "native-git"
const LocalExecToolsName = localExecToolsName
LocalExecToolsName is the registered toolset name local_shell answers on.
const LocalFSToolsName = "local_fs"
const MCPImageResultKind = "contenox.image_result"
const WebToolsName = "webtools"
Variables ¶
var ( ErrMCPToolCallFailed = errors.New("mcp tool call failed") ErrMCPListToolsFailed = errors.New("mcp list-tools failed") ErrMCPOAuthNotAuthenticated = errors.New("mcp oauth not authenticated") ErrOAuthNotAuthenticated = ErrMCPOAuthNotAuthenticated )
var ErrOutputBudgetExceeded = errors.New("local_shell: command output exceeded the remaining context budget")
Functions ¶
func CommandLocationAllowed ¶
func DecodeMCPImageResult ¶
func DecodeMCPImageResult(result any) (*taskengine.ToolImageResult, bool)
func DefaultSkipDirNames ¶
func DefaultSkipDirNames() []string
func GitignoreIgnores ¶
func IsApprovalPending ¶
func IsApprovalPending() bool
func IsAtomicTemp ¶
func NewEchoTools ¶
func NewEchoTools() taskengine.ToolsRepo
func NewGitTools ¶
func NewGitTools(allowedDir string) taskengine.ToolsRepo
func NewGitToolsWith ¶
func NewLocalExecTools ¶
func NewLocalExecTools(opts ...LocalExecOption) taskengine.ToolsRepo
func NewLocalExecToolsWith ¶
func NewLocalExecToolsWith(runner CommandRunner, opts ...LocalExecOption) taskengine.ToolsRepo
func NewLocalFSTools ¶
func NewLocalFSTools(allowedDir string, db libdb.DBManager) taskengine.ToolsRepo
func NewLocalFSToolsWith ¶
func NewPrint ¶
func NewPrint(tracker libtracker.ActivityTracker) taskengine.ToolsRepo
func NewSSHTools ¶
func NewSSHTools(options ...SSHOption) (taskengine.ToolsRepo, error)
func NewWebCaller ¶
func NewWebCaller(tracker libtracker.ActivityTracker, options ...WebtoolsOption) taskengine.ToolsRepo
func PruneLocalFSReads ¶
func RunOAuthFlow ¶
func RunOAuthFlow(ctx context.Context, o2cfg *oauth2.Config, oauthCfg *MCPOAuthConfig, meta *mcpoauth.ServerMetadata) (*oauth2.Token, error)
func ToolchainRoots ¶
func ToolchainRoots() []string
func WorkspaceSkip ¶
Types ¶
type AskApproval ¶
type AskApproval func(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
type AtomicFileIO ¶
type CommandRunner ¶
type CommandRunner interface {
Run(ctx context.Context, spec CommandSpec, stdout, stderr io.Writer) (exitCode int, err error)
}
func NewOSCommandRunner ¶
func NewOSCommandRunner() CommandRunner
func NewOSCommandRunnerWithShell ¶ added in v0.28.4
func NewOSCommandRunnerWithShell(shell PlatformShell) CommandRunner
func NewOSCommandRunnerWithShellAndScrub ¶
func NewOSCommandRunnerWithShellAndScrub(shell PlatformShell, scrub func([]string) []string) CommandRunner
type CommandSpec ¶
type EchoTools ¶
type EchoTools struct{}
func (*EchoTools) GetSchemasForSupportedTools ¶
func (*EchoTools) GetToolsForToolsByName ¶
type FSOption ¶
type FSOption func(*LocalFSTools)
func WithMediaRenderer ¶
func WithMediaRenderer(render MediaRenderer) FSOption
func WithSQLDialect ¶
func WithSQLDialect(d SQLDialect) FSOption
type FileIO ¶
type FileIO interface {
ReadFile(ctx context.Context, path string) ([]byte, error)
WriteFile(ctx context.Context, path string, data []byte) error
}
func NewOSFileIO ¶
func NewOSFileIO() FileIO
type FsSedResult ¶ added in v0.29.0
type FsSedResult struct {
Path string `json:"path"`
Written bool `json:"written"`
Changed bool `json:"changed"`
Replacements int `json:"replacements"`
OldBytes int `json:"old_bytes"`
NewBytes int `json:"new_bytes"`
OldSHA256 string `json:"old_sha256"`
NewSHA256 string `json:"new_sha256"`
OldText string `json:"-"`
NewText string `json:"-"`
}
type FsWriteResult ¶
type GitBranchListResult ¶
type GitBranchListResult struct {
Current string `json:"current"`
Branches []GitBranch `json:"branches"`
// contains filtered or unexported fields
}
func (GitBranchListResult) AppendGuidance ¶
func (r GitBranchListResult) AppendGuidance(text string) any
func (GitBranchListResult) String ¶
func (r GitBranchListResult) String() string
type GitCommitRef ¶
type GitIdentity ¶
type GitIdentityResolver ¶
type GitIdentityResolver func(ctx context.Context, repoDir string) (*GitIdentity, error)
type GitLogEntry ¶
type GitLogResult ¶
type GitLogResult struct {
Commits []GitLogEntry `json:"commits"`
// contains filtered or unexported fields
}
func (GitLogResult) AppendGuidance ¶
func (r GitLogResult) AppendGuidance(text string) any
func (GitLogResult) String ¶
func (r GitLogResult) String() string
type GitOption ¶
type GitOption func(*GitTools)
func WithGitIdentity ¶
func WithGitIdentity(resolve GitIdentityResolver) GitOption
func WithWorkspaceGitHub ¶
type GitStatusEntry ¶
type GitStatusResult ¶
type GitStatusResult struct {
Branch string `json:"branch"`
Head *GitCommitRef `json:"head,omitempty"`
Clean bool `json:"clean"`
Staged []GitStatusEntry `json:"staged"`
Unstaged []GitStatusEntry `json:"unstaged"`
Untracked []string `json:"untracked"`
// contains filtered or unexported fields
}
func (GitStatusResult) AppendGuidance ¶
func (r GitStatusResult) AppendGuidance(text string) any
func (GitStatusResult) String ¶
func (r GitStatusResult) String() string
type GitTools ¶
type GitTools struct {
// contains filtered or unexported fields
}
func (*GitTools) GetSchemasForSupportedTools ¶
func (*GitTools) GetToolsForToolsByName ¶
func (*GitTools) ReadPaths ¶
func (h *GitTools) ReadPaths(ctx context.Context, toolsCall *taskengine.ToolsCall, args map[string]any) ([]string, error)
ReadPaths lists the worktree or history files a call is about to print, so the HITL wrapper can run the read policy over each one before any content is produced. Tools that print names only return no paths.
type HITLWrapper ¶
type HITLWrapper struct {
// contains filtered or unexported fields
}
func NewHITLWrapper ¶
func NewHITLWrapper(inner taskengine.ToolsRepo, ask AskApproval, policy hitlservice.PolicyEvaluator, tracker libtracker.ActivityTracker, eventSinks ...taskengine.TaskEventSink) *HITLWrapper
func (*HITLWrapper) AuthorizeRead ¶
func (h *HITLWrapper) AuthorizeRead(ctx context.Context, path string) error
AuthorizeRead applies the same policy and approval prompt to a workflow document snapshot.
func (*HITLWrapper) Exec ¶
func (h *HITLWrapper) Exec( ctx context.Context, startTime time.Time, input any, debug bool, tools *taskengine.ToolsCall, ) (any, taskengine.DataType, error)
func (*HITLWrapper) GetSchemasForSupportedTools ¶
func (*HITLWrapper) GetToolsForToolsByName ¶
func (h *HITLWrapper) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
func (*HITLWrapper) Supports ¶
func (h *HITLWrapper) Supports(ctx context.Context) ([]string, error)
func (*HITLWrapper) WithReadPaths ¶
func (h *HITLWrapper) WithReadPaths(fn ReadPathsFunc) *HITLWrapper
WithReadPaths wires the multi-file read gate. Call it once with a function that resolves the toolset that will run; without it, read gating is off.
type HostKeyVerifier ¶
type HostKeyVerifier struct {
// contains filtered or unexported fields
}
func NewHostKeyVerifier ¶
func NewHostKeyVerifier(knownHostsFile string, strict bool) (*HostKeyVerifier, error)
func (*HostKeyVerifier) AddKnownHost ¶
func (v *HostKeyVerifier) AddKnownHost(host, key string)
func (*HostKeyVerifier) VerifyHostKey ¶
type LocalExecGate ¶
type LocalExecGate int
const ( GateAllowlist LocalExecGate = iota GatePolicy GateRequireAllowlist )
type LocalExecOption ¶
type LocalExecOption func(*LocalExecTools)
func WithLocalExecAllowedCommands ¶
func WithLocalExecAllowedCommands(commands []string) LocalExecOption
func WithLocalExecAllowedDir ¶
func WithLocalExecAllowedDir(dir string) LocalExecOption
func WithLocalExecCwdResolver ¶
func WithLocalExecCwdResolver(resolve func(context.Context) string) LocalExecOption
func WithLocalExecDeniedCommands ¶
func WithLocalExecDeniedCommands(commands []string) LocalExecOption
func WithLocalExecGate ¶
func WithLocalExecGate(gate LocalExecGate) LocalExecOption
func WithLocalExecScrubEnv ¶
func WithLocalExecScrubEnv(scrub func([]string) []string) LocalExecOption
func WithLocalExecShell ¶ added in v0.28.4
func WithLocalExecShell(shell PlatformShell) LocalExecOption
func WithLocalExecTimeout ¶
func WithLocalExecTimeout(d time.Duration) LocalExecOption
func WithLocalExecToolDirs ¶
func WithLocalExecToolDirs(dirs []string) LocalExecOption
func WithLocalExecTracker ¶
func WithLocalExecTracker(tracker libtracker.ActivityTracker) LocalExecOption
type LocalExecResult ¶
type LocalExecResult struct {
ExitCode int `json:"exit_code"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
DurationSeconds float64 `json:"duration_seconds"`
Command string `json:"command,omitempty"`
Shell string `json:"shell,omitempty"`
OS string `json:"os,omitempty"`
}
type LocalExecTools ¶
type LocalExecTools struct {
// contains filtered or unexported fields
}
func (*LocalExecTools) Exec ¶
func (h *LocalExecTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, tools *taskengine.ToolsCall) (any, taskengine.DataType, error)
func (*LocalExecTools) GetSchemasForSupportedTools ¶
func (*LocalExecTools) GetToolsForToolsByName ¶
func (h *LocalExecTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
type LocalFSTools ¶
type LocalFSTools struct {
// contains filtered or unexported fields
}
func (*LocalFSTools) Exec ¶
func (h *LocalFSTools) Exec(ctx context.Context, startTime time.Time, input any, debug bool, toolsCall *taskengine.ToolsCall) (any, taskengine.DataType, error)
func (*LocalFSTools) GetSchemasForSupportedTools ¶
func (*LocalFSTools) GetToolsForToolsByName ¶
func (h *LocalFSTools) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
func (*LocalFSTools) InvalidateSessionReads ¶
func (h *LocalFSTools) InvalidateSessionReads(ctx context.Context, sessionID string) error
type MCPAuthConfig ¶
type MCPAuthConfig struct {
Type MCPAuthType
Token string
APIKeyFromEnv string
}
func (*MCPAuthConfig) ResolveToken ¶
func (a *MCPAuthConfig) ResolveToken() string
type MCPAuthType ¶
type MCPAuthType string
const ( MCPAuthNone MCPAuthType = "" MCPAuthBearer MCPAuthType = "bearer" MCPAuthOAuth MCPAuthType = "oauth" MCPAuthClientCredentials MCPAuthType = "client_credentials" )
type MCPImageResult ¶
type MCPImageResult struct {
Kind string `json:"kind"`
Text string `json:"text"`
Images []MCPImage `json:"images"`
Audio []taskengine.AudioPart `json:"audio,omitempty"`
}
type MCPOAuthConfig ¶
type MCPOAuthConfig struct {
ClientName string
ClientID string
ClientSecret string
TokenURL string
Scopes []string
CallbackPort int
TokenStore mcpoauth.TokenStore
OpenBrowser func(url string) error
}
func (*MCPOAuthConfig) ResolveCallbackPort ¶
func (c *MCPOAuthConfig) ResolveCallbackPort() int
func (*MCPOAuthConfig) ResolveClientName ¶
func (c *MCPOAuthConfig) ResolveClientName() string
type MCPServerConfig ¶
type MCPServerConfig struct {
Name string
Transport MCPTransport
Command string
Args []string
Env map[string]string
URL string
Headers map[string]string
Auth *MCPAuthConfig
OAuth *MCPOAuthConfig
ConnectTimeout time.Duration
MCPSessionID string
OnSessionID func(string)
Tracker libtracker.ActivityTracker
}
type MCPSessionPool ¶
type MCPSessionPool struct {
// contains filtered or unexported fields
}
func NewMCPSessionPool ¶
func NewMCPSessionPool(cfg MCPServerConfig) *MCPSessionPool
func (*MCPSessionPool) Close ¶
func (p *MCPSessionPool) Close() error
func (*MCPSessionPool) Session ¶
func (p *MCPSessionPool) Session(ctx context.Context) (*mcp.ClientSession, error)
type MCPTransport ¶
type MCPTransport string
const ( MCPTransportStdio MCPTransport = "stdio" MCPTransportSSE MCPTransport = "sse" MCPTransportHTTP MCPTransport = "http" )
type MediaRenderer ¶
type MediaRenderer func(context.Context, mediageneration.Options) (transport.MediaResult, error)
type MockToolsRepo ¶
type MockToolsRepo struct {
Calls []ToolsCallRecord
ResponseMap map[string]ToolsResponse
DefaultResponse ToolsResponse
ErrorSequence []error
// contains filtered or unexported fields
}
func NewMockToolsRegistry ¶
func NewMockToolsRegistry() *MockToolsRepo
func (*MockToolsRepo) CallCount ¶
func (m *MockToolsRepo) CallCount() int
func (*MockToolsRepo) Exec ¶
func (m *MockToolsRepo) Exec( ctx context.Context, startingTime time.Time, input any, inputType taskengine.DataType, transition string, args *taskengine.ToolsCall, ) (int, any, taskengine.DataType, string, error)
func (*MockToolsRepo) LastCall ¶
func (m *MockToolsRepo) LastCall() *ToolsCallRecord
func (*MockToolsRepo) Reset ¶
func (m *MockToolsRepo) Reset()
func (*MockToolsRepo) Supports ¶
func (m *MockToolsRepo) Supports(ctx context.Context) ([]string, error)
func (*MockToolsRepo) WithErrorSequence ¶
func (m *MockToolsRepo) WithErrorSequence(errors ...error) *MockToolsRepo
func (*MockToolsRepo) WithResponse ¶
func (m *MockToolsRepo) WithResponse(toolsType string, response ToolsResponse) *MockToolsRepo
type PlatformShell ¶ added in v0.28.4
type PlatformShell struct {
OS string
Kind ShellKind
Command string
ArgsPrefix []string
DisplayName string
SyntaxHint string
}
func DetectPlatformShell ¶ added in v0.28.4
func DetectPlatformShell() PlatformShell
func DetectPlatformShellFor ¶ added in v0.28.4
func NewCmdShell ¶ added in v0.28.4
func NewCmdShell(command string) PlatformShell
func NewPowerShellShell ¶ added in v0.28.4
func NewPowerShellShell(command string) PlatformShell
func NewShShell ¶ added in v0.28.4
func NewShShell(command string) PlatformShell
func (PlatformShell) IsSet ¶ added in v0.28.4
func (s PlatformShell) IsSet() bool
func (PlatformShell) ShellModeDescription ¶ added in v0.28.4
func (s PlatformShell) ShellModeDescription() string
func (PlatformShell) Summary ¶ added in v0.28.4
func (s PlatformShell) Summary() string
func (PlatformShell) WithDefaults ¶ added in v0.28.4
func (s PlatformShell) WithDefaults() PlatformShell
func (PlatformShell) WrapCommand ¶ added in v0.28.4
type PolicyRefusal ¶
type PolicyRefusal struct {
Code string
Command string
Resolved string
Project string
LookupErr string
AllowedCommands []string
DeniedCommands []string
ToolDirs []string
Hint string
}
func (*PolicyRefusal) Error ¶
func (r *PolicyRefusal) Error() string
func (*PolicyRefusal) Telemetry ¶
func (r *PolicyRefusal) Telemetry() map[string]any
type Print ¶
type Print struct {
// contains filtered or unexported fields
}
func (*Print) GetSchemasForSupportedTools ¶
func (*Print) GetToolsForToolsByName ¶
type ReadPathProvider ¶
type ReadPathProvider interface {
ReadPaths(ctx context.Context, toolsCall *taskengine.ToolsCall, args map[string]any) ([]string, error)
}
ReadPathProvider is implemented by a tool that can list the files a call is about to print. The engine wires it into the HITL wrapper so a multi-file read cannot bypass the read rules that guard each of those files.
type ReadPathsFunc ¶
type ReadPathsFunc func(ctx context.Context, toolsCall *taskengine.ToolsCall, args map[string]any) ([]string, error)
ReadPathsFunc names the files a call would print, so a single call that reads many files (a diff, a commit, a blame) can be checked against the read policy file by file, exactly as a local_fs read is. It returns no paths for a tool that prints names only.
type SSHClientCache ¶
type SSHClientCache struct {
// contains filtered or unexported fields
}
func NewSSHClientCache ¶
func NewSSHClientCache() *SSHClientCache
func (*SSHClientCache) Clear ¶
func (c *SSHClientCache) Clear()
func (*SSHClientCache) IsAlive ¶
func (c *SSHClientCache) IsAlive(key string) bool
func (*SSHClientCache) Put ¶
func (c *SSHClientCache) Put(key string, client *ssh.Client, config *ssh.ClientConfig)
func (*SSHClientCache) Remove ¶
func (c *SSHClientCache) Remove(key string)
type SSHOption ¶
func WithClientCache ¶
func WithClientCache() SSHOption
func WithCustomHostKeyCallback ¶
func WithCustomHostKeyCallback(callback ssh.HostKeyCallback) SSHOption
func WithDefaultPort ¶
func WithDefaultTimeout ¶
func WithKnownHostsFile ¶
func WithStrictHostKey ¶
func WithStrictHostKey() SSHOption
type SSHResult ¶
type SSHResult struct {
ExitCode int `json:"exit_code"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
Duration float64 `json:"duration_seconds"`
Command string `json:"command"`
Host string `json:"host"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
HostKey string `json:"host_key,omitempty"`
}
type SSHTools ¶
type SSHTools struct {
// contains filtered or unexported fields
}
func (*SSHTools) GetSchemasForSupportedTools ¶
func (*SSHTools) GetToolsForToolsByName ¶
type StatFileIO ¶
type ToolsCallRecord ¶
type ToolsCallRecord struct {
Args taskengine.ToolsCall
Input any
InputType taskengine.DataType
Transition string
}
type ToolsResponse ¶
type ToolsResponse struct {
Status int
Output any
OutputType taskengine.DataType
Transition string
}
type WebCaller ¶
type WebCaller struct {
// contains filtered or unexported fields
}
func (*WebCaller) GetSchemasForSupportedTools ¶
func (*WebCaller) GetToolsForToolsByName ¶
type WebtoolsOption ¶
type WebtoolsOption func(*WebCaller)
func WithDefaultHeader ¶
func WithDefaultHeader(key, value string) WebtoolsOption
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) WebtoolsOption