Documentation
¶
Index ¶
- func BuiltinToolDefs() []*model.BuiltinTool
- func NewBuiltinTools(skillStore *skill.SkillStore) []tool.BaseTool
- type ContainerInspectTool
- type DFTool
- type DUTool
- type DmesgTool
- type FileScanTool
- type FreeTool
- type IOStatTool
- type JournalctlTool
- type LsofTool
- type NetstatTool
- type PSTool
- type PgrepTool
- type PrometheusQueryTool
- type SSTool
- type ShellExecTool
- type ShellSuggestTool
- type SystemInspectTool
- type SystemctlTool
- type TailTool
- type TopTool
- type UnameTool
- type UptimeTool
- type VMStatTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltinToolDefs ¶
func BuiltinToolDefs() []*model.BuiltinTool
BuiltinToolDefs 返回所有内置工具的数据库记录定义,用于持久化到 cl_agent_builtin_tools 表。
func NewBuiltinTools ¶
func NewBuiltinTools(skillStore *skill.SkillStore) []tool.BaseTool
NewBuiltinTools 返回所有内置运维工具。 共 24 个工具,覆盖网络、日志、进程、磁盘、系统、服务、Shell、文件、容器、监控和 skill 管理。 skillStore 为 nil 时跳过 skill_manage 工具注册。
Types ¶
type ContainerInspectTool ¶
type ContainerInspectTool struct {
// contains filtered or unexported fields
}
ContainerInspectTool 检测 Docker/Podman 容器状态。
func NewContainerInspectTool ¶
func NewContainerInspectTool() *ContainerInspectTool
NewContainerInspectTool 创建 ContainerInspectTool 实例。 自动检测 docker/podman,优先使用 docker。
func (*ContainerInspectTool) InvokableRun ¶
type DFTool ¶
type DFTool struct {
// contains filtered or unexported fields
}
DFTool 查看文件系统磁盘空间使用情况。
type DmesgTool ¶
type DmesgTool struct {
// contains filtered or unexported fields
}
DmesgTool 查看内核环形缓冲区日志。
func NewDmesgTool ¶
func NewDmesgTool() *DmesgTool
type FileScanTool ¶
type FileScanTool struct {
// contains filtered or unexported fields
}
FileScanTool 扫描文件和目录(支持列表、搜索、内容读取)。
func NewFileScanTool ¶
func NewFileScanTool() *FileScanTool
NewFileScanTool 创建 FileScanTool 实例。 如果通过 SetFileServiceAndFS 注入了 FileService,优先使用它; 否则回退到 find/ls 等 shell 命令。
func (*FileScanTool) InvokableRun ¶
type FreeTool ¶
type FreeTool struct {
// contains filtered or unexported fields
}
FreeTool 查看内存和交换空间使用情况。
func NewFreeTool ¶
func NewFreeTool() *FreeTool
type IOStatTool ¶
type IOStatTool struct {
// contains filtered or unexported fields
}
IOStatTool 查看磁盘 I/O 统计。
func NewIOStatTool ¶
func NewIOStatTool() *IOStatTool
func (*IOStatTool) InvokableRun ¶
type JournalctlTool ¶
type JournalctlTool struct {
// contains filtered or unexported fields
}
JournalctlTool 查询 systemd 日志。
func NewJournalctlTool ¶
func NewJournalctlTool() *JournalctlTool
func (*JournalctlTool) InvokableRun ¶
type LsofTool ¶
type LsofTool struct {
// contains filtered or unexported fields
}
LsofTool 列出打开的文件和网络连接。
func NewLsofTool ¶
func NewLsofTool() *LsofTool
type NetstatTool ¶
type NetstatTool struct {
// contains filtered or unexported fields
}
NetstatTool 网络连接、路由表、接口统计。
func NewNetstatTool ¶
func NewNetstatTool() *NetstatTool
func (*NetstatTool) InvokableRun ¶
type PSTool ¶
type PSTool struct {
// contains filtered or unexported fields
}
PSTool 列出系统进程(按内存排序)。
type PgrepTool ¶
type PgrepTool struct {
// contains filtered or unexported fields
}
PgrepTool 按名称查找进程。
func NewPgrepTool ¶
func NewPgrepTool() *PgrepTool
type PrometheusQueryTool ¶
type PrometheusQueryTool struct {
// contains filtered or unexported fields
}
PrometheusQueryTool 通过 HTTP API 查询 Prometheus 指标。
func NewPrometheusQueryTool ¶
func NewPrometheusQueryTool() *PrometheusQueryTool
NewPrometheusQueryTool 创建 PrometheusQueryTool 实例。
func (*PrometheusQueryTool) InvokableRun ¶
type ShellExecTool ¶
type ShellExecTool struct {
// contains filtered or unexported fields
}
ShellExecTool 执行用户指定的任意 Shell 命令。
func NewShellExecTool ¶
func NewShellExecTool() *ShellExecTool
NewShellExecTool 创建 ShellExecTool 实例。
func (*ShellExecTool) InvokableRun ¶
type ShellSuggestTool ¶
type ShellSuggestTool struct{}
ShellSuggestTool 返回终端命令建议但不执行,用于安全的命令推荐。
func NewShellSuggestTool ¶
func NewShellSuggestTool() *ShellSuggestTool
NewShellSuggestTool 创建 ShellSuggestTool 实例。
func (*ShellSuggestTool) InvokableRun ¶
type SystemInspectTool ¶
type SystemInspectTool struct{}
SystemInspectTool 查看当前系统运行时信息(hostname/os/arch/pid)。
func NewSystemInspectTool ¶
func NewSystemInspectTool() *SystemInspectTool
NewSystemInspectTool 创建 SystemInspectTool 实例。
func (*SystemInspectTool) InvokableRun ¶
type SystemctlTool ¶
type SystemctlTool struct {
// contains filtered or unexported fields
}
SystemctlTool systemd 服务管理。
func NewSystemctlTool ¶
func NewSystemctlTool() *SystemctlTool
func (*SystemctlTool) InvokableRun ¶
type TailTool ¶
type TailTool struct {
// contains filtered or unexported fields
}
TailTool 追踪日志文件末尾内容。
func NewTailTool ¶
func NewTailTool() *TailTool
type TopTool ¶
type TopTool struct {
// contains filtered or unexported fields
}
TopTool 获取进程资源占用快照(非交互模式)。
func NewTopTool ¶
func NewTopTool() *TopTool
type UnameTool ¶
type UnameTool struct {
// contains filtered or unexported fields
}
UnameTool 查看系统信息。
func NewUnameTool ¶
func NewUnameTool() *UnameTool
type UptimeTool ¶
type UptimeTool struct {
// contains filtered or unexported fields
}
UptimeTool 查看系统运行时间和负载。
func NewUptimeTool ¶
func NewUptimeTool() *UptimeTool
func (*UptimeTool) InvokableRun ¶
type VMStatTool ¶
type VMStatTool struct {
// contains filtered or unexported fields
}
VMStatTool 查看虚拟内存、CPU 和 I/O 统计。
func NewVMStatTool ¶
func NewVMStatTool() *VMStatTool