dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
中文 |
English
L-clone is a personal external brain: it records what you've done, and recalls your memory and checks the boundary conditions of your proposals when you plan what's next.
~/.lclone/evolution/ is only a reproducible read-only cache (pull / publish / status) that an insight points to with [[evo:name.ext]]. The store holds data and executables only — specs, rules and prose belong in insights, and evolution audit only flags suspected misfilingskip tier costs zero calls) and only accepts decisions / agreements / rules / lessons, judged on user turns with negation scoping; then code-enforced filtering of "what was done" (goes to git/spec, not the brain), conflict detection between insights, and an organize action that merges semantically-similar insights in one clicksetup seeds 4 generic insights plus 2 example scripts (published as evolution assets; seeds contain no prose documents) — idempotent, and deleted seeds are never re-addedorigin (host/group/repo), the local path is only "where it was last seen"; duplicates are found with proj dupes and merged with proj merge (rollback-able)evolution delete / proj rm only move an object to the recycle bin (a tombstone you can restore); only purge is permanent — irreversible, no backup, and accepted only for objects already in the bin. Purging a project keeps its review_log trail (admission precision is computed from it) and unbinds its evolution assets instead of deleting theminstall wizardModels are stateless: in the next conversation, the AI doesn't remember your last decisions, your project boundaries, or your specs. L-clone settles "what you did, what you decided, what the constraints are" into durable memory and injects it into every new session, so the AI's next steps build on your previous decisions instead of starting from scratch each time.
L-clone separates the access layer (CLI / Web / REST API / MCP) from the backend service (admission gate + core logic — pure functions) and the storage & model layers:
Interactive version — pan/zoom, search, guided chapters (write path / read path / two-step delete / entry points), light & dark, PNG & SVG export:
docs/diagrams/lclone-architecture.html. It is generated fromdocs/diagrams/lclone-architecture.json, where every node is bound to the source file it was verified against.
With
BRAIN_LLM=dummythe model layer is replaced by a built-in offline backend — no network and no API key needed.
See docs/CONCEPTS.md for the data model (ER), the write/recall/spec flows, and the design rationale.
| Item | Requirement |
|---|---|
| Python | >= 3.10 (no GPU required) |
| Third-party libs | openai (>=1.30) / fastapi (>=0.110) / uvicorn (>=0.29) / questionary (>=2.0, interactive menus) |
| Database | SQLite (built-in, nothing to install) |
| Network | The model API must be reachable at BRAIN_BASE_URL; use the Tsinghua mirror for installing dependencies in China |
| Offline mode | BRAIN_LLM=dummy: zero third-party deps, no API key needed, full feature experience |
Install:
python -m venv .venv
# Windows: .venv\Scripts\python.exe -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
.venv/bin/python -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Tip: use
python -m piprather than.venv\Scripts\pip— the latter is a launcher that breaks when the venv is moved or renamed (Fatal error in launcher).
Deploy the backend with
lclone setup(pick a provider + enter a key → generates.env, initializes the database, start from an empty project); it does not register projects or touch any AI-tool frontend. To hook up Claude Code / Codex / DSH, uselclone integrate. See docs/CLI.md.
powershell -ExecutionPolicy Bypass -File .\scripts\demo_offline.ps1
# Local (Windows / macOS / Linux): create venv + install deps + setup wizard + self-check + start web
python scripts/deploy_local.py # interactive: pick provider + enter key
python scripts/deploy_local.py --offline # offline mode, zero deps, zero key
python scripts/deploy_local.py --mirror # use the Tsinghua mirror in China
# Server (Linux + Docker): generate .env interactively → docker compose up -d --build → health check
./scripts/deploy_server.sh
Step 1 — get it running offline first (no API key):
$env:BRAIN_LLM = "dummy" # offline mode
python -m lclone init
python -m lclone proj add demo examples/demo_project --charter "示例项目"
python -m lclone proj sync demo # scan and index the spec files in the project
python -m lclone remember "后端用 FastAPI, 边界: 单用户" --project demo
# ↑ insights go to pending by default; add --confirmed to apply immediately, or confirm later with review
python -m lclone capture "讨论后确定: 6月1日上线" --project demo
python -m lclone review --all keep # confirm drafts (or interactive: lclone review)
python -m lclone recall "FastAPI" --project demo
python -m lclone supervise "把数据库换成 PostgreSQL" --project demo
python -m lclone conflicts # find contradictory insight pairs (needs a real LLM)
python -m lclone ask "我们项目定了什么?" --project demo
Note:
rememberonly writes insights (there is no longer a separatenotelevel — process fact-records were folded into the evolution / git-side). To register a reusable script/tool, uselclone evolution add.
Step 2 — hook up a real model API + the Web panel:
python -m lclone setup # deploy backend: pick provider + enter key, auto-writes .env (recommended)
# or manually: Copy-Item .env.example .env, fill in OPENAI_API_KEY / BRAIN_BASE_URL / model name (see docs/CLI.md)
python -m lclone doctor --check-llm # self-check the integration
.\.venv\Scripts\python.exe -m lclone web # open http://127.0.0.1:8000 in a browser
# run in background: lclone serve start / stop / status / restart
# hook up Claude Code / Codex / DSH etc. (optional, separate command): lclone integrate
Paste the conversation into the brain and it automatically extracts an insight (goes to drafts, active after you confirm):
lclone capture "我想做个健身记录工具。Claude 建议: 用 Python + SQLite, 每周自动汇总, 先跑通再优化。我同意, 定于下月 1 号上线。"
lclone review --all keep # confirm the insight drafts after you review them
lclone recall "健身工具" # it comes back next time
Don't want to paste a long conversation? Have Claude output a one-line conclusion at the end, then:
lclone remember "健身工具: Python+SQLite, 每周汇总, 下月1号上线" --confirmed # insight already confirmed, applies immediately
If you forget
--confirmed, it's fine: unconfirmed insights go to pending, andlclone reviewstamps them later to the same effect. The Web panel's "Memory Workbench" → "Pending" button also handles this; once you integrate AI tools (lclone integrateconfigures MCP / DSH plugin / Claude Code hooks) there's no copy-pasting — it's captured automatically.
python tests/test_offline.py # 90+ offline assertions, no API key
The backend (memory on the server) is decoupled from the access layer: the frontend can be installed from npm (DSH plugin marketplace), or you can just open the Web panel the backend serves.
After the backend is up (docker compose up -d), visit:
http://<server-ip>:8000/http://<server-ip>:8000/askThe DSH "brain board" frontend is a standalone npm plugin; install it with one command:
dsh plugin --profile web add @yueliudan/lclone-memory-dsh -w
http://127.0.0.1:8000 — point it at the server via environment variables.Set these before launching DSH:
export LCLONE_WEB_URL=http://<server-ip>:8000
export LCLONE_API_KEY=<LCLONE_API_KEY from the server .env>
.env sets LCLONE_API_KEY, /api/* and /mcp require it (401 without a key).lclone auth create <name> issues an independent token (only its sha256 hash is stored; revocable individually); manage with lclone auth list/revoke/test. Auth is enforced when the env key is set or any token exists.LCLONE_API_KEY empty and restrict access by firewall/Tailscale IP allowlist.lclone backup # local: consistent snapshot via the backup API (WAL-safe)
scp backups/lclone-<timestamp>.db root@<server>:/repo/data/lclone.db.new # upload to a temp name
ssh root@<server> 'cd /repo && docker compose down && mv data/lclone.db.new data/lclone.db && docker compose up -d'
Never
cpa live database file; uselclone backup(SQLite online backup API).
| Doc | Content |
|---|---|
| docs/CONCEPTS.md | Design rationale (layering, the two loops, insight confirmation, evolution), Mermaid diagrams (data model / write / recall / spec / vertical), ecosystem, roadmap |
| docs/CLI.md | Full CLI reference, Web panel & REST API, model API config, environment variables |
| docs/DEPLOYMENT.md | Server deployment (Docker + Caddy + security) and MCP over HTTP |
LICENSE · MIT License · Copyright (c) 2026 ljzRober