Documentation
¶
Index ¶
- Constants
- func GetMessageFromContext(ctx context.Context) string
- func GetModelNameFromContext(ctx context.Context) string
- func GetSessionFromContext(ctx context.Context) string
- func GetSupportsImagesFromContext(ctx context.Context) bool
- func NewDiagnosticsTool(lspManager *lsp.Manager) tool.Tool
- func NewLSPRestartTool(lspManager *lsp.Manager) tool.Tool
- func NewReferencesTool(lspManager *lsp.Manager) tool.Tool
- func NewSeshatInfoTool(cfg *config.ConfigStore, lspManager *lsp.Manager, allSkills []*skills.Skill, ...) tool.Tool
- func NewSeshatLogsTool(logFile string) tool.Tool
- func ResetCache()
- type AgentParams
- type AgenticFetchParams
- type AgenticFetchPermissionsParams
- type ApplyPatchParams
- type AskUserOption
- type AskUserQuestion
- type AskUserRequest
- type BashParams
- type BashPermissionsParams
- type BashResponseMetadata
- type CreateDirectoryParams
- type DiagnosticsParams
- type DownloadParams
- type DownloadPermissionsParams
- type EditParams
- type EditPermissionsParams
- type EditResponseMetadata
- type FetchParams
- type FetchPermissionsParams
- type GetFileMetadataParams
- type GlobParams
- type GrepParams
- type JobKillParams
- type JobKillResponseMetadata
- type JobOutputParams
- type JobOutputResponseMetadata
- type LSPRestartParams
- type LSParams
- type LSPermissionsParams
- type MultiEditParams
- type MultiEditPermissionsParams
- type MultiEditResponseMetadata
- type NotebookCellPreview
- type NotebookCreatePermissionsParams
- type NotebookEditPermissionsParams
- type NotebookWritePermissionsParams
- type ReferencesParams
- type RemoveFileParams
- type SeshatInfoParams
- type SeshatLogsParams
- type SourcegraphParams
- type ViewParams
- type ViewPermissionsParams
- type ViewResponseMetadata
- type WebFetchParams
- type WebSearchParams
- type WriteParams
- type WritePermissionsParams
- type WriteResponseMetadata
Constants ¶
const ( BashToolName = "bash" EditToolName = "edit_file" WriteToolName = "write_file" MultiEditToolName = "multi_edit" ApplyPatchToolName = "apply_patch" ViewToolName = "read_file" RemoveFileToolName = "remove_file" CreateDirectoryToolName = "create_directory" GetFileMetadataToolName = "get_file_metadata" DownloadToolName = "download" FetchToolName = "fetch" AgenticFetchToolName = "agentic_fetch" LSToolName = "list_directory" JobOutputToolName = "job_output" JobKillToolName = "job_kill" GlobToolName = "glob" GrepToolName = "grep" SourcegraphToolName = "sourcegraph" WebFetchToolName = "web_fetch" WebSearchToolName = "web_search" AgentToolName = "agent" AskUserToolName = "ask_user_question" NotebookEditToolName = "notebook_edit" NotebookCreateToolName = "notebook_create" NotebookWriteToolName = "notebook_write" BashNoOutput = "<no output>" )
Tool name constants matching SDK builtin names where applicable. These are used by the permission dialog and chat UI to render tool-specific UI.
const ( // SessionIDContextKey is the key for the session ID in the context. SessionIDContextKey sessionIDContextKey = "session_id" // MessageIDContextKey is the key for the message ID in the context. MessageIDContextKey messageIDContextKey = "message_id" // SupportsImagesContextKey is the key for the model's image support capability. SupportsImagesContextKey supportsImagesKey = "supports_images" // ModelNameContextKey is the key for the model name in the context. ModelNameContextKey modelNameKey = "model_name" )
const DiagnosticsToolName = "lsp_diagnostics"
const LSPRestartToolName = "lsp_restart"
const ReferencesToolName = "lsp_references"
const SeshatInfoToolName = "seshat_info"
const SeshatLogsToolName = "seshat_logs"
const ViewResourceSkill = "skill"
ViewResourceSkill is the resource type for skill-backed file views.
Variables ¶
This section is empty.
Functions ¶
func GetMessageFromContext ¶
GetMessageFromContext retrieves the message ID from the context.
func GetModelNameFromContext ¶
GetModelNameFromContext retrieves the model name from the context.
func GetSessionFromContext ¶
GetSessionFromContext retrieves the session ID from the context.
func GetSupportsImagesFromContext ¶
GetSupportsImagesFromContext retrieves whether the model supports images from the context.
func NewSeshatInfoTool ¶
func NewSeshatLogsTool ¶
func ResetCache ¶
func ResetCache()
ResetCache clears any tool-level in-memory caches (e.g. file content, image caches).
Types ¶
type AgentParams ¶
type AgentParams struct {
Prompt string `json:"prompt" description:"The task for the agent to perform"`
}
AgentParams holds the input for an agent tool call.
type AgenticFetchParams ¶
AgenticFetchParams holds the tool input for an agentic_fetch call.
type AgenticFetchPermissionsParams ¶
AgenticFetchPermissionsParams holds the params for an agentic_fetch permission request.
type ApplyPatchParams ¶
type ApplyPatchParams struct {
Patch string `json:"patch"`
}
ApplyPatchParams holds the input for an apply_patch tool call.
type AskUserOption ¶
type AskUserOption struct {
Label string `json:"label"`
Value string `json:"value"`
Description string `json:"description,omitempty"`
Preview string `json:"preview,omitempty"`
}
AskUserOption mirrors an option in an ask_user_question prompt.
type AskUserQuestion ¶
type AskUserQuestion struct {
Question string `json:"question"`
Header string `json:"header"`
Options []AskUserOption `json:"options"`
MultiSelect bool `json:"multiSelect,omitempty"`
}
AskUserQuestion mirrors one question in an ask_user_question survey.
type AskUserRequest ¶
type AskUserRequest struct {
ID string `json:"id"`
ToolCallID string `json:"tool_call_id"`
Question string `json:"question"`
Header string `json:"header"`
Options []AskUserOption `json:"options"`
MultiSelect bool `json:"multi_select"`
Questions []AskUserQuestion `json:"questions,omitempty"`
IsCustomText bool `json:"is_custom_text"`
}
AskUserRequest is published to the askUserBroker for each question set the agent asks.
type BashParams ¶
type BashParams struct {
Command string `json:"command"`
RunInBackground bool `json:"run_in_background,omitempty"`
}
BashParams holds the input for a bash tool call.
type BashPermissionsParams ¶
BashPermissionsParams holds the params for a bash tool permission request.
type BashResponseMetadata ¶
type BashResponseMetadata struct {
Background bool `json:"background,omitempty"`
Description string `json:"description,omitempty"`
ShellID string `json:"shell_id,omitempty"`
Output string `json:"output,omitempty"`
}
BashResponseMetadata holds the metadata returned by a bash tool call.
type CreateDirectoryParams ¶
type CreateDirectoryParams struct {
Path string `json:"path"`
}
CreateDirectoryParams holds the input for a create_directory tool call.
type DiagnosticsParams ¶
type DiagnosticsParams struct {
FilePath string `json:"file_path,omitempty" description:"The path to the file to get diagnostics for (leave empty for project diagnostics)"`
}
type DownloadParams ¶
type DownloadParams struct {
URL string `json:"url"`
FilePath string `json:"file_path,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
DownloadParams holds the input for a download tool call.
type DownloadPermissionsParams ¶
DownloadPermissionsParams holds the params for a download permission request.
type EditParams ¶
type EditParams struct {
FilePath string `json:"file_path"`
}
EditParams holds the input for an edit_file tool call.
type EditPermissionsParams ¶
EditPermissionsParams holds the params for an edit_file permission request.
type EditResponseMetadata ¶
type EditResponseMetadata struct {
OldContent string `json:"old_content,omitempty"`
NewContent string `json:"new_content,omitempty"`
}
EditResponseMetadata holds the metadata returned by an edit_file tool call.
type FetchParams ¶
type FetchParams struct {
URL string `json:"url"`
Format string `json:"format,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
FetchParams holds the input for a fetch tool call.
type FetchPermissionsParams ¶
type FetchPermissionsParams struct {
URL string
}
FetchPermissionsParams holds the params for a web_fetch permission request.
type GetFileMetadataParams ¶
type GetFileMetadataParams struct {
Path string `json:"path"`
}
GetFileMetadataParams holds the input for a get_file_metadata tool call.
type GlobParams ¶
GlobParams holds the input for a glob tool call.
type GrepParams ¶
type GrepParams struct {
Pattern string `json:"pattern"`
Path string `json:"path,omitempty"`
Include string `json:"include,omitempty"`
LiteralText bool `json:"literal_text,omitempty"`
}
GrepParams holds the input for a grep tool call.
type JobKillParams ¶
type JobKillParams struct {
ShellID string `json:"shell_id"`
}
JobKillParams holds the input for a job_kill tool call.
type JobKillResponseMetadata ¶
type JobKillResponseMetadata struct {
Description string `json:"description,omitempty"`
Command string `json:"command,omitempty"`
}
JobKillResponseMetadata holds the metadata returned by a job_kill tool call.
type JobOutputParams ¶
type JobOutputParams struct {
ShellID string `json:"shell_id"`
}
JobOutputParams holds the input for a job_output tool call.
type JobOutputResponseMetadata ¶
type JobOutputResponseMetadata struct {
Description string `json:"description,omitempty"`
Command string `json:"command,omitempty"`
}
JobOutputResponseMetadata holds the metadata returned by a job_output tool call.
type LSPRestartParams ¶
type LSPRestartParams struct {
// Name is the optional name of a specific LSP client to restart.
// If empty, all LSP clients will be restarted.
Name string `json:"name,omitempty"`
}
type LSParams ¶
type LSParams struct {
Path string `json:"path"`
}
LSParams holds the input for a list_directory tool call.
type LSPermissionsParams ¶
LSPermissionsParams holds the params for a list_directory permission request.
type MultiEditParams ¶
type MultiEditParams struct {
FilePath string `json:"file_path"`
Edits []any `json:"edits,omitempty"`
}
MultiEditParams holds the input for a multi_edit tool call.
type MultiEditPermissionsParams ¶
MultiEditPermissionsParams holds the params for a multi_edit permission request.
type MultiEditResponseMetadata ¶
type MultiEditResponseMetadata struct {
OldContent string `json:"old_content,omitempty"`
NewContent string `json:"new_content,omitempty"`
EditsFailed []any `json:"edits_failed,omitempty"`
EditsApplied int `json:"edits_applied,omitempty"`
}
MultiEditResponseMetadata holds the metadata returned by a multi_edit tool call.
type NotebookCellPreview ¶
NotebookCellPreview is a lightweight notebook cell payload for permission previews.
type NotebookCreatePermissionsParams ¶
type NotebookCreatePermissionsParams struct {
NotebookPath string
Kernel string
Language string
CellCount int
Cells []NotebookCellPreview
}
NotebookCreatePermissionsParams holds the params for a notebook_create permission request.
type NotebookEditPermissionsParams ¶
type NotebookEditPermissionsParams struct {
NotebookPath string
CellID string
CellType string
EditMode string
OldContent string // full notebook JSON before edit (may be empty if file is new)
NewSource string // the new_source being written into the cell
}
NotebookEditPermissionsParams holds the params for a notebook_edit permission request.
type NotebookWritePermissionsParams ¶
type NotebookWritePermissionsParams struct {
NotebookPath string
Kernel string
Language string
CellCount int
Cells []NotebookCellPreview
OldContent string // existing file content when overwriting
}
NotebookWritePermissionsParams holds the params for a notebook_write permission request.
type ReferencesParams ¶
type RemoveFileParams ¶
type RemoveFileParams struct {
Path string `json:"path"`
Recursive bool `json:"recursive,omitempty"`
}
RemoveFileParams holds the input for a remove_file tool call.
type SeshatInfoParams ¶
type SeshatInfoParams struct{}
type SeshatLogsParams ¶
type SeshatLogsParams struct {
Lines int `json:"lines,omitempty" description:"Number of recent log entries to return (default 50, max 100)"`
}
type SourcegraphParams ¶
type SourcegraphParams struct {
Query string `json:"query"`
Count int `json:"count,omitempty"`
ContextWindow int `json:"context_window,omitempty"`
}
SourcegraphParams holds the input for a sourcegraph tool call.
type ViewParams ¶
type ViewParams struct {
FilePath string `json:"file_path"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
}
ViewParams holds the input for a read_file tool call.
type ViewPermissionsParams ¶
ViewPermissionsParams holds the params for a read_file permission request.
type ViewResponseMetadata ¶
type ViewResponseMetadata struct {
Content string `json:"content,omitempty"`
FilePath string `json:"file_path,omitempty"`
ResourceType string `json:"resource_type,omitempty"`
ResourceName string `json:"resource_name,omitempty"`
ResourceDescription string `json:"resource_description,omitempty"`
}
ViewResponseMetadata holds the metadata returned by a read_file tool call.
type WebFetchParams ¶
type WebFetchParams struct {
URL string `json:"url"`
Prompt string `json:"prompt,omitempty"`
RenderMode string `json:"render_mode,omitempty"`
}
WebFetchParams holds the input for a web_fetch tool call.
type WebSearchParams ¶
type WebSearchParams struct {
Query string `json:"query"`
}
WebSearchParams holds the input for a web_search tool call.
type WriteParams ¶
WriteParams holds the input for a write_file tool call.
type WritePermissionsParams ¶
WritePermissionsParams holds the params for a write_file permission request.
type WriteResponseMetadata ¶
type WriteResponseMetadata struct {
Diff string `json:"diff,omitempty"`
}
WriteResponseMetadata holds the metadata returned by a write_file tool call.