fsutil

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package fsutil 提供工作区文件工具四件:read_file / list_dir / search_files / delete_file(读-搜为主 + 显式删除——删除走审批卡直白话,比拼 rm 命令可控; 内容写面归 applypatch / str_replace_editor / runcommand)。行为形态参照 Claude Code Read/Glob/Grep 与 deepseek-harness packages/fs/tool-fs-search (MIT);全部路径圈进工作区根,穿越显式拒绝(fail-closed)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTools

func NewTools(cfg Config) ([]contract.Tool, error)

NewTools 构造三件(读面:直过审批)。

Types

type Config

type Config struct {
	Root        string
	Spill       string
	ProtectDirs []string
}

Config 构造配置。Root = 会话工作区根——空值拒绝构造(不给全盘默认, P0 纪律)。Spill = 可选的 reduction 外置域(会话持久 sessions/<sid>/spill, 与历史同寿命——「spill/」前缀路径路由至此根取回,跨轮不失效;其余路径 仍圈工作区,穿越显式拒绝 fail-closed)。ProtectDirs = 写保护区顶层子目录 名——delete_file 命中即拒(读面不受影响);nil/空 = 不设区零变化。

Jump to

Keyboard shortcuts

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