rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:gniquil123/dsh-zcode-memory
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
ZCode-compatible project memory, a post-turn changed-files panel with review/open actions, and a memory settings page for DeepSeek Harness (dsh).
English | 简体中文
Compatibility: dsh >=0.2.1-rc.3 <0.3.0-0 (declared via engines.dsh; verified against 0.2.1-rc.3, 0.2.1-rc.5, and 0.2.2-rc.1 — the latter on cordis 4.1.0 / schemastery 3.19.0). The installer refuses to run against an incompatible dsh. For dsh 0.1.x use plugin v0.1.0.
basename slug + - + first 16 hex of SHA-256 over the normalized absolute path, lowercased on Windows). Copy ZCode's memories/projects/ tree into this plugin's memory root and every project resolves to the same directories, ready to reuse and maintain. Each agent session receives one context injection teaching the model the memory protocol (four memory types, frontmatter format, MEMORY.md index rules) plus the project's current index; writes inside the memory root are sandbox-auto-allowed, mirroring ZCode's memory file permission.dsh-workspace-changes + deliverables UI provides this natively (turn tail with per-file diff and open actions), so this plugin no longer ships its own panel and defers to it.<dsh-home>/dsh-zcode-memory.json); a Browse… button opens the host's native directory chooser; an Open folder button reveals the effective root in the OS file manager; the default root <dsh-home>/memories is created at startup when missing.~/.zcode/cli/memories), diff it against the current root, confirm, then execute — projects missing in the target are copied whole; new files in existing projects are copied; MEMORY.md indexes present on both sides are merged line-by-line (existing lines preserved, new lines appended, exact dedupe — minimal change); same-name files with different content are kept and reported. The import also flags ZCode-only references (.zcode paths, zcode CLI calls) with per-item fix suggestions for the user to decide; indexes modified by a merge are backed up to <dsh-home>/dsh-zcode-memory/import-backup/<timestamp>/.
Fully compatible with ZCode project memory directories: copy ZCode's
memories/projectstree into the memory root and it is reused as-is.
Prerequisites: Node.js ≥ 20 with npm (dsh and pnpm are located automatically — no PATH setup needed).
tar -xzf dsh-zcode-memory-0.1.0.tgz && node dsh-zcode-memory/install.mjs
install.mjs registers the plugin into the web profile via the official dsh plugin add flow and links every peer dependency to the running dsh installation, so the plugin and the host share one module instance. Options: --profile <name> (default web), --home <dsh-home> (default $DSH_HOME or ~/.dsh), --dsh <dir> (override auto-detection).
git clone https://github.com/gniquil123/dsh-zcode-memory.git
node dsh-zcode-memory/install.mjs
The desktop profile is managed exclusively by the Electron app — the CLI refuses dsh plugin add there. Install manually (same pattern as any third-party desktop bundle):
~/.dsh/profiles/desktop/package.json: add "dsh-zcode-memory": "link:<path-to-clone>" to dependencies and "dsh-zcode-memory" to dsh.profile.bundles.pnpm install in that directory.Then restart the profile: dsh web. The settings page gains a "ZCode Memory" section.
# Windows (PowerShell)
Copy-Item -Recurse "$env:USERPROFILE\.zcode\cli\memories\projects" "$env:USERPROFILE\.dsh\memories\projects"
# macOS / Linux
cp -r ~/.zcode/cli/memories/projects ~/.dsh/memories/projects
Memory root defaults to <dsh-home>/memories; projects live at <root>/projects/<project-key>/memory/. Keys are computed exactly like ZCode's, so the copy is recognized as-is.
Edit the profile's user patch layer (~/.dsh/profiles/web/cordis.patch.yml):
- id: zcode-memory
config:
enabled: true # false disables injection and the remote service
memoryRoot: "" # non-empty overrides the root (wins over the settings page value)
memoryWriteAllow: true # widen the sandbox to danger-full-access for writes inside the memory root only
Runtime changes made on the settings page persist to <dsh-home>/dsh-zcode-memory.json; a patch-configured memoryRoot always wins.
memoryWriteAllow widens the sandbox policy only for writeText/editText calls whose resolved target lies inside the memory root — the equivalent of ZCode's auto-allowed memory writes. Bash and all other paths keep the session's standing mode. Set it to false if you prefer approving memory writes manually.$DSH_HOME/.credentials.yaml written by a newer dsh desktop build uses a rich format that 0.1.0-rc.6's flat parser rejects. If you run both, point the web profile's credentials row at a separate file via the user patch layer:
- id: credentials
config:
path: '<dsh-home>/.credentials-web.yaml'
dshHome: '<dsh-home>'
lib/index.js): injects the memory context once per session on agent/pre-step (mid-session re-injection would wake the agent loop into a spurious reply); wraps ctx.fs.writeText/editText for the memory-root allowance; registers a Typert Remote gateway.lib/typert.host.js is a hand-written generator-format Typert contract (dsh-typert-loader auto-registers any mounted package's ./typert export); the client half mounts its descriptors through the public ctx.remote.$mount. Self-mounted namespaces must NOT be declared in the module's inject (that deadlocks the boot waiting on a service only the module itself creates) — calls resolve through remote.namespaces.priority; this panel registers at priority: -1 so it wins when diffs were captured and defers to the official produced-files panel otherwise.lib/project-key.js is ported 1:1 from ZCode (zai-org/ZCode, apps/zcode-cli/packages/core/src/memory/project-root.ts, Apache-2.0, marked changed); prompts are adapted from ZCode's provider-visible memory prompts. See LICENSE for third-party notices.lib/client.js is hand-rolled in dsh ModuleLoader's lazy-CJS factory format. Caveat: the dsh 0.2.x client runtime drops a primitive-string children passed inside createElement(type, { children }) (arrays and the third-argument form are fine) — always pass text children as the third argument (createElement(type, props, text)), or the element renders empty.zod used to live only in dependencies, but dsh desktop's module router redirects a linked plugin's bare imports to the app's built-in shared copies ONLY for names listed in peerDependencies (and present in the runtime resolution table); dependencies entries fall back to native resolution, which walks up from the plugin's real path and finds nothing — import { z } from "zod" in lib/typert.host.js threw MODULE_NOT_FOUND, the typert-loader failed loud, the settings/describe RPC answered not-ok, and the Electron main process crashed with desktop welcome: Web RPC failed. zod (^4.0.0) is now also declared in peerDependencies, so the router resolves the app's own zod (0.2.2-rc.1 ships zod@4.4.3 — no copy drift); dependencies.zod is kept, leaving regular GitHub/profile installs unaffected. The smoke test gained a regression guard asserting zod must be present in peerDependencies.engines.dsh and the peer ranges are unchanged (already covered).adopting/adoptResult states, so rendering threw a ReferenceError that blanked the whole settings section; declarations added, and every identifier introduced this cycle was audited for declaration/reference pairing.status gains sameStore (the effective root compared against the ZCode store's realpath, with Windows case/separator normalization): the status area shows a mode badge (shared store / local); when already on the shared store, the import card collapses into a note and the "Use ZCode shared store" button becomes a disabled "On shared store" — import no longer conflicts with the same-store semantics in shared-store mode.adoptZcodeStore) — zero-loss convergence first (lib/converge.js: full backup of the local root → local-only files merged into the shared store → line-level union of MEMORY.md indexes → plain-file conflicts resolved by newer mtime, with the losing side preserved as a sibling <name>.conflict-<side>-<timestamp>.md copy), then the root switches; ZCode/CodeBuddy/DSH share one live store from then on — no sync jobs, no manual copying.lib/write-fallback.js) — root cause pinned: the staged-fd chmod of dsh's local file backend always fails with ENOENT fchmod on HGFS (vmhgfs shares — the real home of the ZCode memory store), regardless of permissions; Writes/Edits inside the memory root that hit the defect automatically retry through native node:fs with identical semantics (temp-file publish, CRLF preserved, same version template); target comparison now uses "longest existing ancestor realpath + missing suffix", so 8.3 short paths and other spelling differences cannot bypass the fallback.memoryRoot is pinned by cordis.patch.yml (adopt/patch-pinned), instead of silently converging and then failing to switch.sameStore field; a same-store run now reports "nothing to import".copyProjects — when confirming an import into a brand-new target (no existing projects), whole-project copies were all skipped while the report still claimed success (touched only counted copyFiles+mergeIndexes); reproduced against a real 14-project / 244-file store, now lands everything, with the smoke test extended accordingly.engines.dsh unchanged (the range already covers rc.5).remote.directoryPicker) and Open folder (file-manager reveal via the official session/openWorkspacePath) buttons on the memory-root row.~/.zcode/cli/memories → show the diff plan (whole-project copies / new-file copies / line-merged indexes / name conflicts) → confirm → execute. Index merging is a deterministic line union (existing lines preserved, new lines appended, exact dedupe — minimal change, no model call); conflicting same-name files are kept and listed; ZCode-only references (.zcode paths, zcode CLI calls) are reported with fix suggestions for the user to decide; merged indexes are backed up to <dsh-home>/dsh-zcode-memory/import-backup/<timestamp>/.<dsh-home>/memories/projects is ensured at plugin startup and after saving a new root from the settings page.{ok:false,error}); every settings-page action has its own try/catch feeding the error card; the store survives vanishing files, bad mtimes, and invalid paths; host-side store creation or feature installation failures log instead of taking the profile down.node test/smoke.mjs (store, import pipeline, typert schema validation; isolated DSH_HOME so the real configuration is never touched).format v4 message requires a producer-owned source kind: the v4 session format retired the generic source: { kind: "plugin" } wrapper, so injected memory context now carries the producer-owned kind dsh-zcode-memory/memory-context. Session log export no longer fails with HTTP 500 on sessions created by this version. (Sessions whose logs were written by v0.2.0 contain the retired kind and still fail export/replay on 0.2.x — delete those sessions.)>=0.2.1-rc.3 <0.3.0-0; the typert contract was rewritten for the new createTypertRemoteInfo + lazy create() zod-factory format (the old schema field fails at boot on 0.2.x).engines.dsh (dependency-free semver range evaluation); dsh CLI's own plugin gate acts as a second layer.dsh-workspace-changes + the new deliverables surface (turn tail with per-file diff and open actions) natively, so this plugin no longer carries its own 0.1-era client accumulator.desktop profile is managed exclusively by the Electron app; see the install section for the manual manifest + pnpm steps.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。