qwenpaw-plugin-file-tools QwenPaw增强文件工具 更新 v1.1.1

📅 2026/7/23 1:50:54 👁️ 阅读次数 📝 编程学习
qwenpaw-plugin-file-tools QwenPaw增强文件工具 更新 v1.1.1

更新日志

v1.1.0 (2026-07-22)

字节级操作 + 缩进工具 + 跨行正则 + 安全增强

新增工具(6 个)

  • 字节级工具 4 个file_tools_read_bytes(hex 读取)、file_tools_write_bytes(全量/部分覆盖写入)、file_tools_find_bytes(精确查找)、file_tools_replace_bytes(变长替换)
  • file_tools_indent_lines:调整行首缩进,支持 expand/shrink 两种模式
  • file_tools_write:全量写入文本文件,原子写入,已存在时自动备份

增强功能

  • file_tools_listdir新增分页、排序(7 种字段)、absolute路径控制、Markdown 表格输出
  • file_tools_regex改为跨行匹配,JSON 输出,支持捕获组提取
  • file_tools_regex_replace改为跨行匹配,从后往前替换
  • file_tools_read_lines/read_block新增show_line_number参数
  • file_tools_replace新增count=-1(全部替换)和 diff 预览
  • 6 个修改工具补齐line_separator参数
  • file_tools_read_block参数重命名统一语义(row/col,1-based 包含)

安全增强

  • 备份失败安全锁:字节级写入备份失败时拒绝修改,需用户打字「同意跳过备份」
  • 原子写入:全部 6 个编辑工具改用.temp_file+os.replace原子写入
  • file_tools_write备份失败统一安全策略

预览格式统一

  • 全部修改工具(replace_linesdelete_linesinsert_linesindent_lines)统一为+/-diff 格式

目录融合

  • copy/move源目录→已存在目标目录时融合,文件→已存在目录时放入内部

修复

  • replace_bytes:备份失败不再静默忽略
  • delete_lines:预览<<省略>>死代码移除
  • indent_lines/diff:补齐参数校验
  • replace:支持count=-1
  • copy/movesrc==dst检测、move自动创建目标目录
  • mkdir:空字符串报错
  • info:三段式错误格式
  • replace_bytes:位置列表统一 CSV 格式

测试

  • 测试从 176 增至361,覆盖中文路径、GBK 编码、特殊字符、重叠匹配、变长替换等场景

Full Changelog: https://github.com/One-sixth/qwenpaw-plugin-file-tools/compare/v1.0.0…v1.1.0

推荐使用插件商店来安装和更新,更加方便

插件商店链接:https://platform.agentscope.io/plugins/qwenpaw-plugin-file-tools
开源仓库链接:https://github.com/One-sixth/qwenpaw-plugin-file-tools