toolview

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package toolview says how clients present a tool call: its title, the verb of a progress line, its main parameter and the secondary ones.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyName

func PrettyName(name string) string

PrettyName turns a tool id into words: "skill_view" becomes "Skill View".

func Value

func Value(params map[string]any, key string) string

Value is params[key] as one line of text: whitespace collapsed, a list as its first item and how many follow, numbers without trailing zeros.

Types

type Call

type Call struct {
	Name   string  // tool id, lower case
	Title  string  // header title, e.g. "Search Web"
	Verb   string  // progress phrase, e.g. "Searching web"
	Detail string  // main parameter, whitespace collapsed, not shortened
	Params []Param // secondary parameters in display order
	// Known is false for tools the table does not list.
	Known bool
}

Call is the presentation of one tool call.

func Describe

func Describe(name string, input string) Call

Describe presents a call of the tool name with JSON input.

type FileChange

type FileChange struct {
	// Paths are the files the input names: one, or each file of a patch.
	Paths []string
	// Edits is how many edits a multiedit asked for.
	Edits int
	// Done is set once the result's metadata describes the change; Files are
	// its changed regions per file (tools.FileChange).
	Done                bool
	Files               []tools.FileChange
	Additions, Removals int
}

FileChange is what a write, edit, multiedit or apply_patch call does.

func FileChangeOf

func FileChangeOf(name string, input string, metadata string) (FileChange, bool)

FileChangeOf reads a file-changing call from its input and, once it has run, its result metadata; ok is false for other tools and unreadable input.

type Param

type Param struct {
	Key   string
	Value string
}

Param is one secondary parameter of a call.

Jump to

Keyboard shortcuts

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