Chinese documentation: README.zh-CN.md
A cross-workspace Library for DeepSeek Harness. Agents record the objects they meet - files, tools,
environments, knowledge, work records - into $DSH_HOME/library, so any conversation can index,
search and reuse them.
Every tool says when it is the cheaper answer, because that is what decides whether an agent asks the
Library or walks the filesystem: library_query before researching something again, library_detect
before looking for a tool or runtime, library_sniff before opening a file to guess its type, and
library_index op=audit before walking a directory to see what is in it. For a host that still reaches
for the disk, injectPrompt: true (plugin config) prepends a short notice to each session's first user
message - replace its wording wholesale with $DSH_HOME/mega-index-prompt.md.
library_record- record an object (change detection routes verify/confirm; a change to the immutable class is refused until the user decides, and is then recorded withconfirm: trueand areason, which the log keeps asrecord-confirm)library_index- three jobs on the index:op=rebuild(default) dedupes/sorts and reports conflicts;op=audit dir=<path>reconciles a directory with the Library read-only, both directions - entries on disk with no record, and records whose path no longer exists (recorded is not the same as addressable);op=index dir=<path> confirm=trueregisters the missing entries, bounded by depth and an entry ceiling, with the sensitive-content rule applied. A drive root is refused: an indexer that walks a whole disk is the scan this Library exists to replacelibrary_query- search by keyword/type/tags, cursor pagination. A multi-word query is matched term by term and ranked by how many terms each object covers, so several words narrow results instead of requiring that exact phrase; a single word behaves as a plain substring search.library_detect- scan and register this machine's tools/environments. The built-in seed is machine-neutral: a bare command name is resolved fromPATH, and a location is written in its owner's own words (%ProgramFiles%,%GOROOT%,%ANDROID_HOME%,~,${HOME}), with the newest installed build derived from disk where a location rotates with its version. A tool kept somewhere of your own goes into the per-install candidate pack withadd, andproposesuggests entries from a directory. A path that does not exist is skipped, and each existing result carriesdeclared: what the file itself states about itself (product/version/vendor, read from its own version resource, statically - the tool is never executed)library_sniff- identify a file by its header bytes (108 signatures), independent of extensionlibrary_format- extend this machine's format library:listscanlearnaddremovedepsdraftreportdeliverunseallibrary_decrypt- read back an isolated sensitive object on requestlibrary_export- export to JSON/NDJSONlibrary_encoding- report the host encoding and how to switch to UTF-8library_adb- developer-side Android device operations over ADB
dsh plugin --profile web add github:Nesarf/mega-index-map- The library lives at
$DSH_HOME/library(default~/.dsh/library). Additions learned on this machine live beside it and never override the built-in tables. - Work stays local: the plugin performs no network I/O and transmits nothing on its own.
- Measured cost is linear and small: at 5,000 objects a query takes about 13 ms, a record 19 ms, a
rebuild 26 ms (index file around 2.3 MB). Back up or migrate with
library_export. - Concurrent writers are serialised through a lock file: a lock whose owner died is taken over, and a busy one is waited for for up to two seconds before the write proceeds and says so in the log.
- This package and the sibling cross-harness build are read-only with respect to each other; nothing
here writes outside
$DSH_HOME, the OS temp directory or a path the caller passed in, andscripts/check-isolation.mjsenforces both directions (see ISOLATION.md). - Three things are held invariant and checked on every push: English/ASCII-only output,
Windows/macOS/Linux portability, and UTF-8-safe handling of multi-language text.
npm run checkruns all of it (ASCII, consistency, portability, isolation), andnpm run selfcheckruns the five-stage pass - smoke, traversal, proofread, traversal, smoke - keeping those three axes in view and reporting them per axis. - MIT License. See LICENSE.