file

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package file provides file ops tool calls

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandFilePattern

func ExpandFilePattern(pattern string) ([]string, error)

ExpandFilePattern 扩展文件模式

func ParseLineRange

func ParseLineRange(args ToolArgs) (int, int, error)

ParseLineRange parse line range

func ResolvePath

func ResolvePath(ctx context.Context, path string) string

ResolvePath 解析文件路径:

  1. 如果是 "~" 开头(如 ~/.dscli/skills/...),展开为用户主目录
  2. 如果是绝对路径,直接使用
  3. 否则是相对路径,拼接项目根目录

Types

type SearchConfig

type SearchConfig struct {
	MaxDepth        int      // 最大递归深度
	ExcludeDirs     []string // 排除目录列表
	ExcludePatterns []string // 排除模式列表
}

SearchConfig 搜索配置

type ToolArgs

type ToolArgs = toolcall.ToolArgs

Source Files

  • file.go
  • file_pattern_expand.go
  • file_read.go
  • file_read_with_line_range.go
  • file_search_with_pattern.go
  • file_write.go
  • file_write_with_line_range.go

Jump to

Keyboard shortcuts

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