Documentation
¶
Index ¶
- Constants
- func AddRuntimeOutputProperties(_ map[string]any)
- func AddRuntimeProperties(_ map[string]any)
- func EditDescription(base string) string
- func InputSchema(name string) (map[string]any, bool)
- func OutputSchema(name string) (map[string]any, bool)
- func PatchDescription(base string) string
- func PathDescription(hostDescription string) string
- func ToolDescription(base string) string
- type CommandEnv
- type EditRequest
- type ListRequest
- type ReadRequest
- type Result
- type RuntimeOptions
- type SearchOptions
- type SearchRequest
- type Service
- func (svc *Service) Edit(ctx context.Context, request EditRequest) (Result, error)
- func (svc *Service) ListDir(ctx context.Context, request ListRequest) (Result, error)
- func (svc *Service) ReadFile(ctx context.Context, request ReadRequest) (Result, error)
- func (svc *Service) SearchText(ctx context.Context, request SearchRequest) (Result, error)
- type SkillResourceResolver
- type ToolError
Constants ¶
View Source
const ( ToolReadFile = "read_file" ToolListDir = "list_dir" ToolSearchText = "search_text" ToolFileEdit = "file_edit" )
View Source
const (
MaxTextOutputBytes = 4 << 20
)
Variables ¶
This section is empty.
Functions ¶
func AddRuntimeProperties ¶
func EditDescription ¶
func PatchDescription ¶
func PathDescription ¶
func ToolDescription ¶
Types ¶
type EditRequest ¶ added in v0.8.2
type EditRequest struct {
RuntimeOptions
Action string `json:"action"`
Path string `json:"path,omitempty"`
Old string `json:"old,omitempty"`
New string `json:"new,omitempty"`
ReplaceAll bool `json:"replace_all,omitempty"`
ExpectedMatches *int `json:"expected_matches,omitempty"`
Content string `json:"content,omitempty"`
NewPath string `json:"new_path,omitempty"`
Overwrite bool `json:"overwrite,omitempty"`
Recursive bool `json:"recursive,omitempty"`
Patch string `json:"patch,omitempty"`
Workdir string `json:"workdir,omitempty"`
DryRun bool `json:"dry_run,omitempty"`
MaxDiffBytes *int `json:"max_diff_bytes,omitempty"`
}
EditRequest 统一承载 file_edit 五种 action 的输入,避免为每个 action 再制造一层类型。 action 对字段组合的业务约束仍由文件服务在对应主流程中校验。
type ListRequest ¶ added in v0.8.2
type ListRequest struct {
RuntimeOptions
Path string `json:"path,omitempty"`
MaxDepth *int `json:"max_depth,omitempty"`
MaxEntries *int `json:"max_entries,omitempty"`
Patterns []string `json:"patterns,omitempty"`
ExcludePatterns []string `json:"exclude_patterns,omitempty"`
EntryType string `json:"entry_type,omitempty"`
IncludeHidden bool `json:"include_hidden,omitempty"`
IncludeIgnored bool `json:"include_ignored,omitempty"`
}
ListRequest 是 list_dir 进入文件核心后的稳定输入契约。
type ReadRequest ¶ added in v0.8.2
type ReadRequest struct {
RuntimeOptions
Path string `json:"path"`
StartLine *int `json:"start_line,omitempty"`
EndLine *int `json:"end_line,omitempty"`
MaxBytes *int `json:"max_bytes,omitempty"`
}
ReadRequest 是 read_file 进入文件核心后的稳定输入契约。
type RuntimeOptions ¶ added in v0.8.2
type RuntimeOptions struct {
Runtime string `json:"runtime,omitempty"`
WSLDistribution string `json:"wsl_distribution,omitempty"`
}
RuntimeOptions 描述文件工具的实际文件系统运行环境。非 Windows 主机只接受零值。
type SearchOptions ¶
type SearchRequest ¶ added in v0.8.2
type SearchRequest struct {
RuntimeOptions
Path string `json:"path,omitempty"`
Query string `json:"query"`
Regex bool `json:"regex,omitempty"`
CaseSensitive bool `json:"case_sensitive,omitempty"`
IncludeHidden bool `json:"include_hidden,omitempty"`
IncludeIgnored bool `json:"include_ignored,omitempty"`
IncludeGlobs []string `json:"include_globs,omitempty"`
Glob string `json:"glob,omitempty"`
ExcludeGlobs []string `json:"exclude_globs,omitempty"`
ContextLines *int `json:"context_lines,omitempty"`
MaxResults *int `json:"max_results,omitempty"`
}
SearchRequest 是 search_text 进入文件核心后的稳定输入契约。
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(ws *workspace.Workspace, resolveSkillResource SkillResourceResolver, commandEnv CommandEnv) *Service
func (*Service) SearchText ¶
type SkillResourceResolver ¶
Source Files
¶
- bounded_file.go
- contract.go
- diff_parse.go
- diff_preview.go
- edit_file.go
- file_edit.go
- file_runtime.go
- file_runtime_other.go
- file_snapshot.go
- file_snapshot_unix.go
- git_apply_patch.go
- helpers.go
- ignore.go
- patch.go
- patch_parse.go
- patch_preview.go
- patch_transaction.go
- rename_noreplace_linux.go
- request.go
- runtime_files.go
- search.go
- service.go
- text.go
- text_edit_prepare.go
- wsl_files_other.go
- wsl_patch_policy.go
Click to show internal directories.
Click to hide internal directories.