Help us shape the future of Go! Take the 2026 Go Developer Survey

tools

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InputSchema

func InputSchema(name string) map[string]any

func OutputSchema

func OutputSchema(name string) map[string]any

Types

type Result

type Result map[string]any

type Runtime

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

func NewRuntime

func NewRuntime(cfg config.Config) (*Runtime, error)

func (*Runtime) AgentDockContext

func (r *Runtime) AgentDockContext(ctx context.Context) (Result, error)

func (*Runtime) Call

func (r *Runtime) Call(ctx context.Context, name string, args map[string]any) (Result, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) Config

func (r *Runtime) Config() config.Config

func (*Runtime) RuntimeCapabilities

func (r *Runtime) RuntimeCapabilities(ctx context.Context, refresh bool) (Result, error)

func (*Runtime) RuntimeMCPManage

func (r *Runtime) RuntimeMCPManage(ctx context.Context, args map[string]any) (Result, error)

func (*Runtime) RuntimeMCPServer

func (r *Runtime) RuntimeMCPServer(ctx context.Context, name string) (Result, error)

func (*Runtime) RuntimeMCPServers

func (r *Runtime) RuntimeMCPServers(ctx context.Context) (Result, error)

func (*Runtime) RuntimeSkill

func (r *Runtime) RuntimeSkill(skill string) (Result, error)

func (*Runtime) RuntimeSkillFile added in v0.5.3

func (r *Runtime) RuntimeSkillFile(skill, relativePath string) (Result, error)

RuntimeSkillFile 只读取当前激活 Skill 包内的普通 UTF-8 文本文件。 路径解析和符号链接校验都在 AgentDock 内完成,调用方无需挂载宿主机目录。

func (*Runtime) RuntimeSkillFiles added in v0.5.3

func (r *Runtime) RuntimeSkillFiles(skill string) (Result, error)

RuntimeSkillFiles 返回当前激活 Skill 包的安全文件清单。 隐藏文件、安装元数据和符号链接不会暴露给控制面。

func (*Runtime) RuntimeSkills

func (r *Runtime) RuntimeSkills() (Result, error)

func (*Runtime) RuntimeStatus

func (r *Runtime) RuntimeStatus() Result

func (*Runtime) RuntimeTask

func (r *Runtime) RuntimeTask(id string) (Result, error)

func (*Runtime) RuntimeTaskDelete

func (r *Runtime) RuntimeTaskDelete(id string) (Result, error)

func (*Runtime) RuntimeTasks

func (r *Runtime) RuntimeTasks(status string, limit int) (Result, error)

func (*Runtime) ToolNames

func (r *Runtime) ToolNames() []string

func (*Runtime) Workspace

func (r *Runtime) Workspace() *workspace.Workspace

type SessionStore

type SessionStore = session.Store

func NewSessionStore

func NewSessionStore() *SessionStore

type ToolDefinition

type ToolDefinition struct {
	Name                   string
	Title                  string
	Description            string
	FileArgRewritePaths    []string
	FileResultRewritePaths []string
	InputSchema            map[string]any
	OutputSchema           map[string]any
}

func ToolDefinitions

func ToolDefinitions() []ToolDefinition

ToolDefinitions 只导出 MCP 层需要的描述和 schema,不暴露 handler。

type ToolError

type ToolError struct {
	Code      string         `json:"code"`
	Message   string         `json:"message"`
	Category  string         `json:"category"`
	Retryable bool           `json:"retryable"`
	Details   map[string]any `json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*ToolError) Error

func (e *ToolError) Error() string

func (*ToolError) Unwrap

func (e *ToolError) Unwrap() error

type ToolHandler

type ToolHandler func(context.Context, *Runtime, map[string]any) (Result, error)

type ToolSpec

type ToolSpec struct {
	Name                   string
	Title                  string
	Description            string
	FileArgRewritePaths    []string
	FileResultRewritePaths []string
	InputSchema            func() map[string]any
	OutputSchema           func() map[string]any
	Availability           func(config.Config) bool
	Handler                ToolHandler
}

ToolSpec 是工具公开入口的单一事实源:运行时分发、MCP 描述、 配置开关都从这里派生,避免多处手写列表漂移。

Jump to

Keyboard shortcuts

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