Documentation
¶
Index ¶
- type CreateDirectoryTool
- func (t *CreateDirectoryTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *CreateDirectoryTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *CreateDirectoryTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *CreateDirectoryTool) Definition() tool.Definition
- func (t *CreateDirectoryTool) Description(_ context.Context) (string, error)
- func (t *CreateDirectoryTool) FormatResult(data any) string
- func (t *CreateDirectoryTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *CreateDirectoryTool) IsEnabled() bool
- func (t *CreateDirectoryTool) IsReadOnly(_ map[string]any) bool
- func (t *CreateDirectoryTool) PreparePermissionMatcher(_ context.Context, _ map[string]any) (func(string) bool, error)
- func (t *CreateDirectoryTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type DirEntry
- type FileMetadata
- type GetMetadataTool
- func (t *GetMetadataTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *GetMetadataTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *GetMetadataTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *GetMetadataTool) Definition() tool.Definition
- func (t *GetMetadataTool) Description(_ context.Context) (string, error)
- func (t *GetMetadataTool) FormatResult(data any) string
- func (t *GetMetadataTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *GetMetadataTool) IsEnabled() bool
- func (t *GetMetadataTool) IsReadOnly(_ map[string]any) bool
- func (t *GetMetadataTool) PreparePermissionMatcher(_ context.Context, _ map[string]any) (func(string) bool, error)
- func (t *GetMetadataTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type ListDirectoryTool
- func (t *ListDirectoryTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *ListDirectoryTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *ListDirectoryTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *ListDirectoryTool) Definition() tool.Definition
- func (t *ListDirectoryTool) Description(_ context.Context) (string, error)
- func (t *ListDirectoryTool) FormatResult(data any) string
- func (t *ListDirectoryTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *ListDirectoryTool) IsEnabled() bool
- func (t *ListDirectoryTool) IsReadOnly(_ map[string]any) bool
- func (t *ListDirectoryTool) PreparePermissionMatcher(_ context.Context, _ map[string]any) (func(string) bool, error)
- func (t *ListDirectoryTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type RemoveTool
- func (t *RemoveTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *RemoveTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *RemoveTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *RemoveTool) Definition() tool.Definition
- func (t *RemoveTool) Description(_ context.Context) (string, error)
- func (t *RemoveTool) FormatResult(data any) string
- func (t *RemoveTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *RemoveTool) IsEnabled() bool
- func (t *RemoveTool) IsReadOnly(_ map[string]any) bool
- func (t *RemoveTool) PreparePermissionMatcher(_ context.Context, _ map[string]any) (func(string) bool, error)
- func (t *RemoveTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateDirectoryTool ¶
type CreateDirectoryTool struct {
// contains filtered or unexported fields
}
CreateDirectoryTool creates directories (mkdir -p equivalent).
func NewCreateDirectoryTool ¶
func NewCreateDirectoryTool(workingDir string) *CreateDirectoryTool
func (*CreateDirectoryTool) BackfillInput ¶
func (*CreateDirectoryTool) Call ¶
func (t *CreateDirectoryTool) Call( ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn, ) (tool.CallResult, error)
func (*CreateDirectoryTool) CheckPermissions ¶
func (t *CreateDirectoryTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*CreateDirectoryTool) Definition ¶
func (t *CreateDirectoryTool) Definition() tool.Definition
func (*CreateDirectoryTool) Description ¶
func (t *CreateDirectoryTool) Description(_ context.Context) (string, error)
func (*CreateDirectoryTool) FormatResult ¶
func (t *CreateDirectoryTool) FormatResult(data any) string
func (*CreateDirectoryTool) IsConcurrencySafe ¶
func (t *CreateDirectoryTool) IsConcurrencySafe(_ map[string]any) bool
func (*CreateDirectoryTool) IsEnabled ¶
func (t *CreateDirectoryTool) IsEnabled() bool
func (*CreateDirectoryTool) IsReadOnly ¶
func (t *CreateDirectoryTool) IsReadOnly(_ map[string]any) bool
func (*CreateDirectoryTool) PreparePermissionMatcher ¶
func (*CreateDirectoryTool) ValidateInput ¶
type DirEntry ¶
type DirEntry struct {
Name string `json:"name"`
IsDirectory bool `json:"is_directory"`
IsFile bool `json:"is_file"`
IsSymlink bool `json:"is_symlink"`
SizeBytes int64 `json:"size_bytes"`
Mode string `json:"mode"`
}
DirEntry represents a single entry in a directory listing.
type FileMetadata ¶
type FileMetadata struct {
Path string `json:"path"`
IsFile bool `json:"is_file"`
IsDirectory bool `json:"is_directory"`
IsSymlink bool `json:"is_symlink"`
// SymlinkTarget is set when IsSymlink is true.
SymlinkTarget string `json:"symlink_target,omitempty"`
SizeBytes int64 `json:"size_bytes"`
Mode string `json:"mode"`
ModifiedAt time.Time `json:"modified_at"`
CreatedAt time.Time `json:"created_at,omitempty"`
Exists bool `json:"exists"`
}
FileMetadata is the structured metadata returned by GetMetadataTool.
type GetMetadataTool ¶
type GetMetadataTool struct {
// contains filtered or unexported fields
}
GetMetadataTool returns metadata (stat) for a path without reading its content.
func NewGetMetadataTool ¶
func NewGetMetadataTool(workingDir string) *GetMetadataTool
func (*GetMetadataTool) BackfillInput ¶
func (*GetMetadataTool) Call ¶
func (t *GetMetadataTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*GetMetadataTool) CheckPermissions ¶
func (t *GetMetadataTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*GetMetadataTool) Definition ¶
func (t *GetMetadataTool) Definition() tool.Definition
func (*GetMetadataTool) Description ¶
func (t *GetMetadataTool) Description(_ context.Context) (string, error)
func (*GetMetadataTool) FormatResult ¶
func (t *GetMetadataTool) FormatResult(data any) string
func (*GetMetadataTool) IsConcurrencySafe ¶
func (t *GetMetadataTool) IsConcurrencySafe(_ map[string]any) bool
func (*GetMetadataTool) IsEnabled ¶
func (t *GetMetadataTool) IsEnabled() bool
func (*GetMetadataTool) IsReadOnly ¶
func (t *GetMetadataTool) IsReadOnly(_ map[string]any) bool
func (*GetMetadataTool) PreparePermissionMatcher ¶
func (*GetMetadataTool) ValidateInput ¶
type ListDirectoryTool ¶
type ListDirectoryTool struct {
// contains filtered or unexported fields
}
ListDirectoryTool lists the entries of a directory.
func NewListDirectoryTool ¶
func NewListDirectoryTool(workingDir string) *ListDirectoryTool
func (*ListDirectoryTool) BackfillInput ¶
func (*ListDirectoryTool) Call ¶
func (t *ListDirectoryTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*ListDirectoryTool) CheckPermissions ¶
func (t *ListDirectoryTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*ListDirectoryTool) Definition ¶
func (t *ListDirectoryTool) Definition() tool.Definition
func (*ListDirectoryTool) Description ¶
func (t *ListDirectoryTool) Description(_ context.Context) (string, error)
func (*ListDirectoryTool) FormatResult ¶
func (t *ListDirectoryTool) FormatResult(data any) string
func (*ListDirectoryTool) IsConcurrencySafe ¶
func (t *ListDirectoryTool) IsConcurrencySafe(_ map[string]any) bool
func (*ListDirectoryTool) IsEnabled ¶
func (t *ListDirectoryTool) IsEnabled() bool
func (*ListDirectoryTool) IsReadOnly ¶
func (t *ListDirectoryTool) IsReadOnly(_ map[string]any) bool
func (*ListDirectoryTool) PreparePermissionMatcher ¶
func (*ListDirectoryTool) ValidateInput ¶
type RemoveTool ¶
type RemoveTool struct {
// contains filtered or unexported fields
}
RemoveTool deletes a file or directory with safety checks.
func NewRemoveTool ¶
func NewRemoveTool(workingDir string) *RemoveTool
func (*RemoveTool) BackfillInput ¶
func (*RemoveTool) Call ¶
func (t *RemoveTool) Call( ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn, ) (tool.CallResult, error)
func (*RemoveTool) CheckPermissions ¶
func (t *RemoveTool) CheckPermissions(_ context.Context, _ map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*RemoveTool) Definition ¶
func (t *RemoveTool) Definition() tool.Definition
func (*RemoveTool) Description ¶
func (t *RemoveTool) Description(_ context.Context) (string, error)
func (*RemoveTool) FormatResult ¶
func (t *RemoveTool) FormatResult(data any) string
func (*RemoveTool) IsConcurrencySafe ¶
func (t *RemoveTool) IsConcurrencySafe(_ map[string]any) bool
func (*RemoveTool) IsEnabled ¶
func (t *RemoveTool) IsEnabled() bool
func (*RemoveTool) IsReadOnly ¶
func (t *RemoveTool) IsReadOnly(_ map[string]any) bool
func (*RemoveTool) PreparePermissionMatcher ¶
func (*RemoveTool) ValidateInput ¶
Click to show internal directories.
Click to hide internal directories.