core

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package core provides the built-in core tools for KIT's coding agent. These tools are direct fantasy.AgentTool implementations — no MCP layer, no JSON-RPC, no serialization overhead. They match the pi coding agent's core tool set: bash, read, write, edit, grep, find, ls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllTools

func AllTools(opts ...ToolOption) []fantasy.AgentTool

AllTools returns all available core tools.

func CodingTools

func CodingTools(opts ...ToolOption) []fantasy.AgentTool

CodingTools returns the default set of core tools for a coding agent: bash, read, write, edit. This matches pi's codingTools collection.

func NewBashTool

func NewBashTool(opts ...ToolOption) fantasy.AgentTool

NewBashTool creates the bash core tool.

func NewEditTool

func NewEditTool(opts ...ToolOption) fantasy.AgentTool

NewEditTool creates the edit core tool.

func NewFindTool

func NewFindTool(opts ...ToolOption) fantasy.AgentTool

NewFindTool creates the find core tool.

func NewGrepTool

func NewGrepTool(opts ...ToolOption) fantasy.AgentTool

NewGrepTool creates the grep core tool.

func NewLsTool

func NewLsTool(opts ...ToolOption) fantasy.AgentTool

NewLsTool creates the ls core tool.

func NewReadTool

func NewReadTool(opts ...ToolOption) fantasy.AgentTool

NewReadTool creates the read core tool.

func NewWriteTool

func NewWriteTool(opts ...ToolOption) fantasy.AgentTool

NewWriteTool creates the write core tool.

func ReadOnlyTools

func ReadOnlyTools(opts ...ToolOption) []fantasy.AgentTool

ReadOnlyTools returns tools for read-only exploration: read, grep, find, ls. This matches pi's readOnlyTools collection.

Types

type ToolConfig

type ToolConfig struct {
	WorkDir string
}

ToolConfig holds configuration for tool construction.

func ApplyOptions

func ApplyOptions(opts []ToolOption) ToolConfig

ApplyOptions applies the given ToolOptions to a ToolConfig and returns it.

type ToolOption

type ToolOption func(*ToolConfig)

ToolOption configures tool behavior.

func WithWorkDir

func WithWorkDir(dir string) ToolOption

WithWorkDir sets the working directory for file-based tools. If empty, os.Getwd() is used at execution time.

type TruncationResult

type TruncationResult struct {
	Content   string
	Truncated bool
	TruncBy   string // "lines", "bytes", or ""
	Total     int    // total lines before truncation
	Kept      int    // lines kept after truncation
}

TruncationResult describes how output was truncated.

Jump to

Keyboard shortcuts

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