Documentation
¶
Overview ¶
Package tool defines Alaska's agent tools — the capabilities the model can invoke from inside a chat turn (read/write/edit files, run shell commands).
Each Tool has a JSON schema describing its arguments (sent to the model so it knows what to call) and an Execute method the agent loop calls after permission is granted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BashExec ¶
type BashExec struct{}
BashExec — run a shell command and return its combined stdout+stderr.
func (*BashExec) Description ¶
func (*BashExec) InputSchema ¶
func (*BashExec) InputSchema() json.RawMessage
type EditFile ¶
type EditFile struct{}
EditFile — replace a unique substring in a file. Refuses if old_string isn't unique so accidental multi-match replacements don't happen.
func (*EditFile) Description ¶
func (*EditFile) InputSchema ¶
func (*EditFile) InputSchema() json.RawMessage
type ReadFile ¶
type ReadFile struct{}
ReadFile — read a UTF-8 text file, returns contents up to a line limit.
func (*ReadFile) Description ¶
func (*ReadFile) InputSchema ¶
func (*ReadFile) InputSchema() json.RawMessage
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry indexes tools by name for dispatch.
func NewRegistry ¶
type Result ¶
type Result struct {
Content string // full output sent back to the model
Preview string // short human-readable summary for the REPL transcript
IsError bool
}
Result carries the payload an executor returns to the model. LongText is what's shown in the transcript (usually a truncated preview); Content is what's actually fed back to the model in a tool_result message.
type Tool ¶
type Tool interface {
Name() string
Description() string
InputSchema() json.RawMessage
Execute(ctx context.Context, argsJSON string) (Result, error)
}
Tool is the contract every Alaska tool implements.
type WriteFile ¶
type WriteFile struct{}
WriteFile — create or overwrite a file. Parent dirs are created.
func (*WriteFile) Description ¶
func (*WriteFile) InputSchema ¶
func (*WriteFile) InputSchema() json.RawMessage