dsh-lost-and-found

toolsinstall failsnpmMIT

Local file recall: indexes the folders you choose into one local SQLite database, so 'where did I put that file?' is one query instead of a disk walk. Caches, VCS and program folders are pruned per directory; each folder keeps its own incremental anchor, so a folder added later is backfilled in full

下载量 / Downloads
925
测试时间 / Tested
2026-11-07
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add dsh-lost-and-found

Sandbox test results

StageResult
1 install✗
2 list—
3 mount—
4 boot—
First error
dsh: initialized profile web at /home/node/.dsh/profiles/web

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

文件快速寻回 · dsh-lost-and-found

![Test](https://github.com/wangzhanchao883/dsh-lost-and-found/actions/workflows/test.yml)

![License: MIT](LICENSE)

![npm](https://www.npmjs.com/package/dsh-lost-and-found)

忘了文件放哪,问一句就能找回来,再也不用翻遍硬盘。

忘了文件放哪,问一句就能找回来,再也不用翻遍硬盘。这款 DSH 插件把你指定的文件夹变成一座随问随答的本地文献库。支持多目录只读扫描,缓存与程序目录整棵跳过,几万个文件十几秒扫完;结果统一登记进本地 SQLite 索引,随时可从零重建。名字、类型、大小、出现时间、位置、来源自动入库,图片内容交给大模型看过之后写回描述。找文件采用两段式:先按时间、类型、目录、来源硬过滤,再按文件名、标签、路径、摘要、图片描述分层加权,多关键词取交,命中的是哪一层直接标给你看。索引里没有的当场实时兜底找一遍,但只现场比对、绝不写库,插件只读,绝不修改、移动或删除你的文件。比每次让大模型硬翻目录更省更可控,比你自己的记忆更靠得住,几万文件规模也照样秒回。

设置页:扫描概况与一键扫描 · 监视的文件夹(可逐个设内容深度) · 高级选项

!settings · !folders · !advanced


English summary

dsh-lost-and-found answers "where did I put that file?" from a **local SQLite

index** instead of walking your disk on every question. You pick the folders to

watch; the plugin records what appeared — name, type, size, appeared-at, location

and origin — and prunes caches, VCS and program folders at the directory level,

so a scan of tens of thousands of files finishes in seconds.

Search is two-stage: SQL hard filters (time / type / folder / origin) first, then

multi-keyword AND matching scored by where the hit landed (name > tags > path >

summary > image description > excerpt), and the result tells you which layer hit.

When the index has no hit, the watched folders are scanned live as a fallback —

compared only, never written back.

Every watched folder keeps its own incremental anchor. A folder added later is

backfilled in full on its first scan; after that it is incremental, and a folder

whose scan was interrupted keeps its anchor so the next run finishes the job.

Read-only promise: the plugin never modifies, moves, renames or deletes your

files, never writes NTFS alternate data streams, never generates thumbnails, never

touches timestamps, and never uploads anything — the whole index is one SQLite

file on your machine.

dsh plugin --profile web add dsh-lost-and-found

Requires DSH with the web profile and Node.js ^22 or >=24. Windows-focused

(uses birthtime on NTFS), but nothing here is Windows-only by design.


它做什么

  • 按你设定的间隔(每天 / 每 3 天 / 每周)扫描你指定的文件夹;打开 DSH 时会检查是否到期并补扫
  • 记录文件名、类型、大小、出现时间、位置、来源,写进本地 SQLite 索引
  • 每个目录各有自己的增量锚点:新加入的目录第一次扫描会把它的历史文件一并收进来,之后转为增量
  • 支持按关键词、时间范围、文件类型、目录范围、来源组合查找,并按「命中在哪一层」加权排序
  • 索引里没有的,会对扫描目录做一次实时兜底扫描,尽力找回(只读,不写库)
  • 图片内容可以交给模型看过之后写回描述,之后按画面内容也能搜到
  • 提示你扫描范围之外哪些文件夹最近出现了新文件(只提示,不自动收录)
  • 记忆库可随时从零重建:索引是派生数据,不是唯一真相

它不做什么

  • 绝不修改、移动、重命名或删除你的任何文件
  • 不会去看你没有指定的文件夹
  • 不写 NTFS 附加数据流(ADS)、不生成缩略图、不改任何时间戳
  • 不联网上传任何内容:所有记录只存在你本机的一个 SQLite 文件里
  • 不做文件同步、不做备份、不做重复文件清理(那些是别的工具的职责)

怎么用

不用记命令。直接说人话:

  • 「我上个月收到的那份报价单在哪?」
  • 「我让你写的那份关于 XX 的报告存哪了?」
  • 「下载的那个安装包放哪了,好像这周下的」
  • 「我记得有张截图,上面有转账金额 1280」

也可以直接调用工具:

工具 · 作用

file_find · 找文件(核心):关键词 + 时间/类型/目录/来源过滤,索引没命中时自动兜底

file_index_scan · 立刻扫描一次(wait=true 等它跑完;full=true 强制忽略锚点全量重扫)

file_index_status · 概况:上次扫描时间、库内数量、扫描目录、待处理项、库位置

file_index_open · 在资源管理器里定位某个文件

file_index_forget · 从记忆库里删掉某条记录(不动文件)

file_index_verify · 手动检查一批记录是否还在原处

file_index_pending_images / file_index_set_image_desc · 图片内容的「待看清单 / 写回描述」

环境要求

  • DSH 0.1.7 ~ 0.2.x,使用 web profile

(设置页依赖 0.1.7 才有的 configForms 客户端服务与 Config 导出契约。更早的 0.1.x 上

host 功能仍然可用 —— 扫描、检索、工具调用都不受影响 —— 但设置页不会出现)

  • 0.2 已实测可用:本机在 0.2.0-rc.1 上完整跑通(含浏览器端设置页),peerDependencies

上界已从 <0.2.0-0 抬到 <0.3.0-0

  • Node.js ^22 或 >=24(用到内置 node:sqlite)
  • 无需 API key、无需联网;扫描与检索全部在本机完成

安装

从 npm:

dsh plugin --profile web add dsh-lost-and-found

直接从仓库:

dsh plugin --profile web add https://github.com/wangzhanchao883/dsh-lost-and-found

开发期把工作副本链进 profile(改完必须重启 DSH,插件源码不热更新):

dsh plugin --profile web add link:/path/to/dsh-lost-and-found

配置

设置页里有:扫描概况与「立即扫描」按钮、扫描目录(可增删,每个目录可单独设内容深度)、记忆库存放位置、扫描间隔、内容读取说明与高级选项。

配置项 · 默认 · 说明

enabled · true · 关闭后不再自动扫描,也不再提供找文件工具

roots · [] · 要监视的目录,每个目录带自己的 policy

dbPath · 空 · 索引库位置;留空用 %LOCALAPPDATA%\dsh-lost-and-found\index.db。可以填文件路径,也可以直接填文件夹(会用该文件夹下的 index.db)

intervalDays · 1 · 自动扫描间隔;0 = 只手动

firstScanMode · full · 一个目录第一次被扫时收多久:full 全部历史 / window 最近 firstRunWindowDays 天 / none 只收今后新增

firstRunWindowDays · 7 · 仅当 firstScanMode = window 时生效

maxFileMB · 50 · 超过此体积只记基本信息,不读内容

imageQuotaPerRun · 20 · 每次看图配额

patrolEnabled · true · 是否提示白名单外有新文件的目录

backupKeep · 7 · 每日备份保留份数,0 = 不备份

extraExcludeDirs / extraExcludePatterns · [] · 追加的排除目录名 / 路径片段(re: 前缀表示正则)

配置存在哪(DSH 0.1.7 起)

DSH 0.1.7 起,设置服务不再替插件另存一份配置 —— 它只把 Loader 里本插件条目的

Config 投影成表单,权威值始终在 profile 的补丁文件里:

  • 设置页里改的值会写进 $DSH_HOME/profiles/web/cordis.patch.yml 中 id: dsh-lost-and-found 那段
  • 想手改也行,直接编辑那个文件,效果与设置页完全一致
  • 改完立刻生效,不需要重启 DSH:0.1.7 移除了旧版的 watch,插件改为在每次用到配置之前

重新读一遍投影(settings.describe()),所以面板里加完目录就能直接点「立即扫描」

  • 从 0.1.2 升级上来的话注意:0.1.2 只在插件加载那一刻读一次配置,会表现为

「面板里明明加了文件夹,点扫描却说还没设置」—— 0.1.3 修的就是这个

扫描目录的内容深度(每个目录可不同)

  • 完整:记基本信息,并允许把图片交给模型看过之后写回描述(默认)
  • 只摘要:记基本信息;不把图片交给模型
  • 只记基本信息:只记名字、类型、位置、时间(适合含证件/合同等敏感内容的目录)
下拉框里的档位名写的是「完整(正文+摘要+看图)」,其中正文与摘要抽取尚未启用,见下方路线图;当前真正生效的

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::4,最后更新 2026-10-02

Links

GitHub · Homepage · npm

Same category