tools

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteCommand

type ExecuteCommand struct {
	HostsData *config.Hosts
}

func (ExecuteCommand) Call

func (ExecuteCommand) Description

func (ExecuteCommand) Description() string

func (ExecuteCommand) Name

func (ExecuteCommand) Name() string

func (ExecuteCommand) Run

func (e ExecuteCommand) Run(ctx context.Context, host config.Host, command string) (string, error)

func (ExecuteCommand) Schema

func (ExecuteCommand) Schema() map[string]any

type ExecuteCommandArgs

type ExecuteCommandArgs struct {
	HostID  string `json:"host_id"`
	Command string `json:"command"`
}

type GetHosts

type GetHosts struct {
	HostsData *config.Hosts
}

func (GetHosts) Call

func (h GetHosts) Call(ctx context.Context, raw json.RawMessage) (string, error)

func (GetHosts) Description

func (GetHosts) Description() string

func (GetHosts) Name

func (GetHosts) Name() string

func (GetHosts) Schema

func (GetHosts) Schema() map[string]any

type GetHostsArgs

type GetHostsArgs struct{}

type HostInfo

type HostInfo struct {
	ID          string   `json:"id"`
	Host        string   `json:"host"`
	Port        int      `json:"port"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
}

type Ping

type Ping struct{}

func (Ping) Call

func (Ping) Call(ctx context.Context, raw json.RawMessage) (string, error)

func (Ping) Description

func (Ping) Description() string

func (Ping) Name

func (Ping) Name() string

func (Ping) Schema

func (Ping) Schema() map[string]any

type PingArgs

type PingArgs struct {
	Target string `json:"target"`
}

type Registry

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

func NewRegistry

func NewRegistry(tools ...Tool) *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Tool, bool)

func (*Registry) Tools

type Report

type Report struct{}

func (Report) Call

func (a Report) Call(ctx context.Context, raw json.RawMessage) (string, error)

func (Report) Description

func (a Report) Description() string

func (Report) Name

func (a Report) Name() string

func (Report) Schema

func (a Report) Schema() map[string]any

type ReportArgs

type ReportArgs struct {
	Text string `json:"text"`
}

type Tool

type Tool interface {
	Name() string
	Description() string
	Schema() map[string]any
	Call(ctx context.Context, raw json.RawMessage) (string, error)
}

Jump to

Keyboard shortcuts

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