Documentation
¶
Overview ¶
Package toolmeta provides shared tool-call metadata helpers used by both the ACP prompt handler and the WebUI SSE handler. These functions map Pando tool names and their JSON-encoded inputs into display-friendly titles, kinds, statuses, and file locations — without depending on any ACP SDK types.
Index ¶
- func DisplayTitle(toolName string, rawInput interface{}, cwd string) string
- func InputBool(rawInput interface{}, key string) bool
- func InputInt(rawInput interface{}, key string) int
- func InputString(rawInput interface{}, key string) string
- func IsBashTool(name string) bool
- func IsEditTool(name string) bool
- func IsTodoWriteTool(name string) bool
- func ParseJSONInput(s string) interface{}
- func ToDisplayPath(path string, cwd string) string
- type Location
- type ToolCallStatus
- type ToolKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayTitle ¶
DisplayTitle returns a human-friendly title for a tool call.
func InputString ¶
InputString extracts a string value from a raw input map.
func IsBashTool ¶
IsBashTool returns true for tool names that execute shell commands.
func IsEditTool ¶
IsEditTool returns true for tool names that modify files on disk.
func IsTodoWriteTool ¶
IsTodoWriteTool returns true for the TodoWrite tool.
func ParseJSONInput ¶
func ParseJSONInput(s string) interface{}
ParseJSONInput decodes a JSON string into a native map/slice. Returns an empty map if the string is blank or cannot be parsed.
func ToDisplayPath ¶
ToDisplayPath makes a path relative to cwd when possible.
Types ¶
type Location ¶
type Location struct {
Path string `json:"path"`
}
Location represents a file/directory affected by a tool call.
func ToLocations ¶
ToLocations extracts file/directory locations from a tool call input string.
type ToolCallStatus ¶
type ToolCallStatus string
ToolCallStatus represents the lifecycle state of a tool call.
const ( StatusPending ToolCallStatus = "pending" StatusInProgress ToolCallStatus = "in_progress" StatusCompleted ToolCallStatus = "completed" StatusFailed ToolCallStatus = "failed" )
type ToolKind ¶
type ToolKind string
ToolKind categorises a tool call for UI rendering.
func MapToolKind ¶
MapToolKind returns the ToolKind for a given Pando tool name.