Documentation
¶
Overview ¶
Package exectool runs command-line tools declared in a YAML manifest.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tool ¶
type Tool struct {
Name string
Description string
Parameters map[string]any
Command []string
Timeout time.Duration
Workdir string
MaxOutputBytes int
RequiresConfirmation bool
// AllowFlagValues lets an argument value begin with "-". Off by default,
// so a model cannot turn a value into a command-line option.
AllowFlagValues bool
// contains filtered or unexported fields
}
Tool is one declared command-line tool.
type ToolManifestExecutor ¶
type ToolManifestExecutor struct {
Tools []*Tool
}
Manifest is a parsed tool manifest.
func Load ¶
func Load(path string) (*ToolManifestExecutor, error)
Load reads and validates a manifest file.
func Parse ¶
func Parse(data []byte) (*ToolManifestExecutor, error)
Parse decodes and validates a manifest. Every problem found is reported, not only the first.
func (*ToolManifestExecutor) ExecuteTool ¶
func (m *ToolManifestExecutor) ExecuteTool(ctx context.Context, name string, arguments string) (string, error)
ExecuteTool runs the named tool with JSON arguments. It satisfies loop.ToolExecutor.
Click to show internal directories.
Click to hide internal directories.