dsh-architecture-map 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/CODE_OF_CONDUCT.md +7 -0
- package/CONTRIBUTING.md +24 -0
- package/LICENSE +21 -0
- package/README.md +281 -2
- package/README.zh.md +264 -0
- package/THIRD_PARTY_NOTICES.md +36 -0
- package/client.js +1181 -0
- package/cordis.patch.yml +5 -0
- package/docs/DETAIL.md +76 -0
- package/docs/DETAIL.zh.md +76 -0
- package/docs/preview.svg +50 -0
- package/icon.svg +9 -0
- package/index.js +1 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +68 -4
- package/skills/architecture-map/SKILL.md +75 -0
- package/skills/architecture-map/references/bootstrap.md +100 -0
- package/skills/architecture-map/references/discussion.md +71 -0
- package/skills/architecture-map/references/incremental.md +80 -0
- package/skills/architecture-map/references/schema.md +94 -0
- package/src/README.md +34 -0
- package/src/host/content/index.js +20 -0
- package/src/host/content/local.js +250 -0
- package/src/host/export.js +228 -0
- package/src/host/graph.js +707 -0
- package/src/host/memory.js +364 -0
- package/src/host/plugin.js +1136 -0
- package/src/host/projects.js +241 -0
- package/src/host/remote/commands.js +236 -0
- package/src/host/remote/consent.js +216 -0
- package/src/host/remote/content.js +391 -0
- package/src/host/remote/indexer.js +180 -0
- package/src/host/remote/maintainer.js +85 -0
- package/src/host/remote/ssh.js +287 -0
- package/src/host/remote/state.js +65 -0
- package/src/host/remote/tools.js +162 -0
- package/src/host/signature.js +42 -0
- package/src/host/workspace.js +131 -0
- package/vendor/elkjs.LICENSE +264 -0
- package/vendor/mermaid.LICENSE +21 -0
- package/vendor/mermaid.esm.min.mjs +4343 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## 0.2.1 — 2026-11-23
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- Remote consent scopes: `/arch remote grant <id> session` grants only the current session (and its discussion children, in memory); `/arch remote grant <id> always` or no scope persists a workspace grant. `/arch remote revoke <id>` clears both. The content-read card keeps the same two choices.
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Local node positions no longer freeze the whole layout when the graph revision changes: only dragged nodes are stored as `{x, y}` overrides, so undragged nodes follow the automatic layout after an edit.
|
|
10
|
+
- `Reset layout` clears the local overrides instead of materializing the current layout into the position map.
|
|
11
|
+
- The sidebar's Discuss/Lite buttons now pass the selected source to `/arch discuss`: a node in a remote source is resolved in `remote:<id>` instead of the session's local workspace, which previously produced `node "<id>" does not exist in <cwd>`.
|
|
12
|
+
|
|
13
|
+
### Docs
|
|
14
|
+
|
|
15
|
+
- State that a cyclic graph falls back to a compact grid and that the layered layout is for acyclic graphs.
|
|
16
|
+
|
|
17
|
+
## 0.2.0 — 2026-11-22
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Read-only remote Linux repositories over SSH: `.archmap/index.json` projects, `remote:<id>` workspaces, a project source picker and a remote status line.
|
|
22
|
+
- `arch_remote_list/status/tree/read/grep` tools, a blocking consent card (session / always / reject), and durable workspace consent.
|
|
23
|
+
- `/arch remote add/list/select/sync/update/grant/revoke/remove` commands.
|
|
24
|
+
- Fingerprint polling, `remote-state.json`, manifest-only incremental sync, stale marking and maintenance handoff.
|
|
25
|
+
- Non-git metadata fingerprints, root-containment checks for escapes/symlink escapes, and a read-only remote smoke script.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- `readRange` no longer treats SSH connection diagnostics as the file size.
|
|
30
|
+
- Repeated edits to an already-dirty git file now move the fingerprint.
|
|
31
|
+
|
|
32
|
+
### Developer preview notes
|
|
33
|
+
|
|
34
|
+
- A maintenance run does not clear the local `remote-state.pending` counter yet.
|
|
35
|
+
- Auto maintenance does not start from an idle parent session; `/arch remote update <id>` is the manual fallback.
|
|
36
|
+
- 65 tests pass; real SSH/host/tool/consent flows were verified on a non-production Linux host.
|
|
37
|
+
|
|
38
|
+
## 0.1.0 — 2026-11-21
|
|
39
|
+
|
|
40
|
+
- Canonical `.archmap/graph.json` with revision, validation, atomic writes and backup.
|
|
41
|
+
- Sidebar SVG canvas with layered layout, pan/zoom/Fit, node dragging and local position memory.
|
|
42
|
+
- Architecture memory: manifest, incremental `arch_sync`, cosmetic detection, anchor-hash stale marking, dossier documents.
|
|
43
|
+
- Per-node `arch_discuss` fork/lite conversations, sidebar buttons and notes.
|
|
44
|
+
- Deterministic `arch_export` to Mermaid, SVG and Markdown.
|
|
45
|
+
- Built-in Mermaid fence rendering with a vendored runtime and `auto/on/off` configuration.
|
|
46
|
+
- Bundled `architecture-map` skill and localized panel strings.
|
|
47
|
+
- `node --test` suite and GitHub Actions CI.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Code of conduct
|
|
2
|
+
|
|
3
|
+
This project follows the spirit of the Contributor Covenant: be respectful, assume good faith, and keep criticism about the work rather than the person.
|
|
4
|
+
|
|
5
|
+
Unacceptable behavior includes harassment, discrimination, personal attacks, and publishing private information. Maintainers may remove comments or contributions that violate these expectations.
|
|
6
|
+
|
|
7
|
+
Report concerns to the repository maintainer. Reports are handled confidentially.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for taking a look. This is a 0.2.0 developer-preview bundle; small, focused changes with tests are easiest to review.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run check # syntax check the Host/Client entry points
|
|
9
|
+
npm test # node --test
|
|
10
|
+
npm pack --dry-run
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The client is hand-written (`client.js`); there is no build step for it. Host code is plain ESM under `src/host/`.
|
|
14
|
+
|
|
15
|
+
## What to change
|
|
16
|
+
|
|
17
|
+
- Keep the canonical graph schema backward-compatible unless the change explicitly bumps it.
|
|
18
|
+
- Add or update tests for graph validation, patching, memory sync, stale detection or exports.
|
|
19
|
+
- Do not commit `.archmap/` data, local design notes under `docs/DESIGN.md` / `PLAN.md` / `M0-FINDINGS.md`, or `vendor/` modifications without updating `THIRD_PARTY_NOTICES.md`.
|
|
20
|
+
- If you copy third-party code, keep its license header and add it to `THIRD_PARTY_NOTICES.md`.
|
|
21
|
+
|
|
22
|
+
## Reporting issues
|
|
23
|
+
|
|
24
|
+
Include the DSH version, the workspace layout, the exact tool call, and the raw tool result or browser console error. Do not include credentials.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Architecture map contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,282 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Architecture map
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
**中文名:架构地图** · An architecture workbench for DeepSeek Harness: a live semantic architecture graph, per-node side conversations, and incremental architecture memory.
|
|
6
|
+
|
|
7
|
+
> Status: **0.2.1 developer preview.** The Host tools, sidebar canvas, architecture memory, per-node discussions, deterministic exports, built-in Mermaid rendering and read-only remote Linux repositories over SSH work today. Shared positions remain planned; remote auto-maintenance on an idle parent and pending-counter clearing are the known rough edges.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
Agents can already read a repository and draw a diagram. The diagram is dead:
|
|
14
|
+
|
|
15
|
+
- you cannot click a node and ask about it;
|
|
16
|
+
- every regeneration renames and re-lays-out everything, so last week's "N3" is gone;
|
|
17
|
+
- discussing one module means polluting the main conversation or starting a fresh session that forgot everything;
|
|
18
|
+
- the next session re-reads the whole repository because nothing was remembered.
|
|
19
|
+
|
|
20
|
+
Architecture map makes the architecture a **first-class, addressable object** in the harness:
|
|
21
|
+
|
|
22
|
+
- the agent builds a **semantic graph** (stable ids, code anchors, status);
|
|
23
|
+
- you view it on an interactive canvas in the right sidebar;
|
|
24
|
+
- each node can open an **isolated side conversation** that inherits the main conversation's memory;
|
|
25
|
+
- side conversations merge their edits back into the one canonical graph;
|
|
26
|
+
- an **architecture dossier** makes later analysis incremental — only changed files are re-read.
|
|
27
|
+
|
|
28
|
+
## What it looks like
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
A static feature preview is included. A recorded 30-second demo GIF is not part of this repository yet.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
┌──────────────── main conversation ────────────────┬──────── right sidebar ────────┐
|
|
36
|
+
│ you: draw the architecture of this project │ [Graph] [n3 · discuss] [+] │
|
|
37
|
+
│ agent: 14 nodes, 19 edges — see the map │ ┌────┐ ┌────┐ │
|
|
38
|
+
│ │ │ n1 │─────▶│ n3 │ │
|
|
39
|
+
│ (conversation stays clean while you discuss) │ └────┘ └────┘ │
|
|
40
|
+
│ │ n3 · Session Store │
|
|
41
|
+
│ │ summary / anchors / edges │
|
|
42
|
+
│ │ [lite] [fork] │
|
|
43
|
+
└───────────────────────────────────────────────────┴───────────────────────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Features (implemented today)
|
|
47
|
+
|
|
48
|
+
- **Canonical architecture graph** — `.archmap/graph.json` with a revision number, schema validation, atomic writes and a one-step backup. The model reads and edits it through `arch_graph_get` / `arch_graph_patch`; `apply:false` previews without writing.
|
|
49
|
+
- **Right-sidebar canvas** — reads the graph from the session workspace, renders nodes/edges as SVG with a layered (longest-path) layout, supports pan, wheel zoom, `Fit`, node dragging and `Reset layout`, and shows node details on click.
|
|
50
|
+
- **Local layout memory** — only dragged node positions are kept, per workspace in browser storage; every other node keeps following the automatic layout, so a graph edit reflows it. `Reset layout` clears the local overrides. Shared positions are planned.
|
|
51
|
+
- **Incremental architecture memory with cosmetic detection** — `.archmap/manifest.json` records content hashes plus a normalized code signature; `arch_sync` reports only added/changed/deleted files, distinguishes code changes from format/comment-only changes, and lists the nodes whose anchors are affected. `markStale:true` marks those nodes stale (and bumps the graph rev); the default is report-only. Anchors may also store the file's normalized content signature; sync reports a node whose anchor hash no longer matches, and `arch_graph_patch` fills missing hashes or refreshes them with `refreshAnchors:true` after review. `arch_manifest_commit` records analyzed files, and `arch_doc_get` / `arch_doc_put` read and write `overview`, `modules/<id>` and `notes/<id>`.
|
|
52
|
+
- **Deterministic exports** — `arch_export` writes Mermaid flowchart source, a standalone SVG, or a Markdown dossier digest to `.archmap/export/`; graph revision and files stay unchanged.
|
|
53
|
+
- **Built-in Mermaid rendering** — assistant ` ```mermaid ` fences render with a vendored Mermaid 12.2.0 runtime served from the plugin's own Host route. No CDN and no `dsh-mermaid-plus` dependency. Streaming keeps the code block; parse errors fall back to code plus an error line. `renderMermaid: false` disables it.
|
|
54
|
+
- **Per-node side conversations** — `arch_discuss` starts a child for `node:<id>` or `edge:<id>`: `fork` inherits the main conversation's completed turns; `lite` starts fresh with the graph and dossier. Delivery is caller-only, so the main conversation is not polluted; conclusions go to `notes/<id>`. The node detail also has `Discuss (fork)` / `Lite` buttons that open the child in the right sidebar through the `subagentchat` resource; they pass the selected local or remote source to the host (a remote discussion needs remote content consent). Discussion children are prompt-constrained; shell and generic source-write calls are denied at execution (inherited tool schemas may remain visible in a fork). Graph changes still require approval.
|
|
55
|
+
- **Remote Linux repositories (developer preview)** — `arch_remote_list/status/tree/read/grep` inspect a registered repository over SSH without cloning it. Content reads are consent-gated; remote `arch_sync`/`arch_manifest_commit` hash only analyzed files; change polling and `/arch remote ...` commands work; the panel switches local/remote sources; graph/dossier stay under `.archmap/projects/<id>/`; remote files are never modified.
|
|
56
|
+
|
|
57
|
+
## Planned next
|
|
58
|
+
|
|
59
|
+
- Shared/persisted positions, direct export buttons in the panel, and a short animated demo (GIF).
|
|
60
|
+
- Remote maintenance polish: start from an idle parent and clear the local pending counter after a run.
|
|
61
|
+
|
|
62
|
+
## What it is not
|
|
63
|
+
|
|
64
|
+
- Not a general whiteboard (Excalidraw-style). No freehand pixels; every element is addressable.
|
|
65
|
+
- Not a general memory plugin. The dossier exists to complete the architecture graph, not to store all conversation memory.
|
|
66
|
+
- Not just a diagram generator. The graph, discussions, merges, and memory are one loop.
|
|
67
|
+
|
|
68
|
+
## Dependencies
|
|
69
|
+
|
|
70
|
+
No runtime plugin dependencies beyond DSH itself:
|
|
71
|
+
|
|
72
|
+
| Feature | Extra plugin? |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Canvas, graph storage, local positions | No — implemented in this bundle |
|
|
75
|
+
| Skill / bootstrap guidance | No — bundled `architecture-map` skill |
|
|
76
|
+
| Architecture memory (`arch_sync` + dossier) | No — workspace files managed by this plugin |
|
|
77
|
+
| Mermaid rendering | No — Mermaid 12.2.0 is vendored and served locally; `renderMermaid: auto/on/off` |
|
|
78
|
+
| Side conversations | No — `arch_discuss` plus sidebar `Discuss` buttons |
|
|
79
|
+
| Stale detection | No — `arch_sync` with `markStale:true` |
|
|
80
|
+
| Export (Mermaid/SVG/Markdown) | No — `arch_export` |
|
|
81
|
+
| Sharper call/impact edges | Optional: `dsh-plugin-codegraph` (recommended, **not installed automatically**) |
|
|
82
|
+
|
|
83
|
+
## Mermaid rendering
|
|
84
|
+
|
|
85
|
+
Assistant messages with a ` ```mermaid ` fence render as diagrams. The runtime is vendored at
|
|
86
|
+
`vendor/mermaid.esm.min.mjs` (Mermaid 12.2.0, MIT; ELK is EPL-2.0) and served by the Host at
|
|
87
|
+
`/x-dsh-architecture-map/vendor/mermaid.esm.min.mjs`; the browser never fetches a CDN. The client
|
|
88
|
+
checks `/x-dsh-architecture-map/config` first, so with `renderMermaid: off` fences stay plain
|
|
89
|
+
code blocks and the 5.2 MB runtime is not loaded. The default `auto` disables our renderer when
|
|
90
|
+
`dsh-mermaid-plus` (a known conflicting fence provider) is enabled; `on` forces it, `off` disables it.
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
- insert:
|
|
94
|
+
- id: architecture-map
|
|
95
|
+
name: dsh-architecture-map
|
|
96
|
+
config:
|
|
97
|
+
renderMermaid: off
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Where data lives
|
|
101
|
+
|
|
102
|
+
All graph, manifest, dossier and export data lives in `<workspace>/.archmap/`. The plugin installation
|
|
103
|
+
directory contains only code, skill, vendor, docs and locale. The plugin does not modify a user project's
|
|
104
|
+
`.gitignore`; commit `.archmap/` to share the map, or ignore it for local-only data. Uninstalling the plugin
|
|
105
|
+
does not delete `.archmap/`. Node positions are browser-local and are not part of the graph.
|
|
106
|
+
|
|
107
|
+
## Remote repositories (developer preview)
|
|
108
|
+
|
|
109
|
+
The plugin can map a repository on a remote Linux host over your existing SSH config **without cloning it**. Reads are read-only, and the graph/dossier stay in the local workspace.
|
|
110
|
+
|
|
111
|
+
1. Register the remote with `/arch remote add staging build-01 /srv/app` (or add an entry to `<workspace>/.archmap/index.json`):
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"schema": 1,
|
|
116
|
+
"projects": [
|
|
117
|
+
{ "id": "local", "kind": "local", "dir": "." },
|
|
118
|
+
{
|
|
119
|
+
"id": "staging", "kind": "remote", "dir": "projects/staging",
|
|
120
|
+
"transport": "ssh", "host": "build-01", "root": "/srv/app",
|
|
121
|
+
"vcs": "git", "autoRefresh": true
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`host` is an OpenSSH destination from your SSH config; `root` must be an absolute remote path; use `"vcs": "none"` for a non-git directory.
|
|
128
|
+
|
|
129
|
+
2. Ask the agent to use `arch_remote_list`, `arch_remote_status`, then `arch_remote_tree` / `arch_remote_read` / `arch_remote_grep`. The first content access shows an approval card (session / always / reject); nothing is read before you answer.
|
|
130
|
+
|
|
131
|
+
3. Graph tools use `workspace: "remote:staging"`; state is written under `.archmap/projects/staging/`. Remote files are never modified.
|
|
132
|
+
4. Open `/arch` and pick **Local** or **staging** in the source selector in the panel header. The status line shows host/root/vcs/consent; a remote project without a graph shows its own empty state.
|
|
133
|
+
5. Picking a remote source starts polling. `/arch remote sync staging` checks immediately, `/arch remote update staging` starts a maintenance child, `/arch remote list` lists projects, and `/arch remote grant/revoke/remove` manage consent and registration.
|
|
134
|
+
|
|
135
|
+
### Remote consent scopes
|
|
136
|
+
|
|
137
|
+
The content-read card and the cardless `grant` command expose the same two scopes:
|
|
138
|
+
|
|
139
|
+
| Input / choice | Scope | Lifetime | Stored | Auto maintenance |
|
|
140
|
+
| --- | --- | --- | --- | --- |
|
|
141
|
+
| `/arch remote grant <id>` | workspace | persistent | `.archmap/index.json` | yes |
|
|
142
|
+
| `/arch remote grant <id> always` | workspace | persistent | `.archmap/index.json` | yes |
|
|
143
|
+
| `/arch remote grant <id> session` | session + its children | until this session ends | in-memory only | no |
|
|
144
|
+
| Card: “允许,本次会话” | session | until this session ends | in-memory only | no |
|
|
145
|
+
| Card: “始终允许这个远程” | workspace | persistent | `.archmap/index.json` | yes |
|
|
146
|
+
| `/arch remote revoke <id>` | revokes session + workspace | — | clears both | — |
|
|
147
|
+
|
|
148
|
+
`grant` does not show a card because the typed command itself is the explicit user consent. The card only appears when a content read has no grant yet.
|
|
149
|
+
|
|
150
|
+
There is **no single-read grant**; the smallest scope is the current session. A session grant is invisible in the panel source bar (that bar reads the persisted workspace consent), but it is active for the session and its discussion children. Auto maintenance requires a workspace grant.
|
|
151
|
+
|
|
152
|
+
Auto maintenance runs only after a durable “always allow”, for at most 50 changed files, at most once per 10 minutes. Larger changes only mark affected nodes stale. Real remote end-to-end verification was completed on a Linux host; auto maintenance still skips an idle parent (use `/arch remote update` to force it), and a maintenance run does not yet clear the local pending counter.
|
|
153
|
+
|
|
154
|
+
Remote reads are confined to the registered root: `..`, absolute escapes, and symlinks pointing outside are rejected. Git projects use HEAD plus `git status`, and hash changed/untracked paths so a second edit to an already-dirty file still moves the fingerprint; non-git projects use path/size/mtime metadata, and only analyzed files are hashed.
|
|
155
|
+
|
|
156
|
+
## How memory works (no extra plugin)
|
|
157
|
+
|
|
158
|
+
Architecture map keeps an architecture-specific dossier in the workspace, managed by the plugin itself:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
.archmap/
|
|
162
|
+
├── graph.json # canonical graph + rev
|
|
163
|
+
├── manifest.json # path -> sha256 of analyzed files
|
|
164
|
+
├── overview.md # one-page overview
|
|
165
|
+
├── modules/<id>.md # per-module dossier
|
|
166
|
+
└── notes/<node>.md # per-node discussion conclusions
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- The first pass reads the repository once and writes the dossier + graph.
|
|
170
|
+
- Later, `arch_sync` hashes the workspace and returns only changed/added/deleted files and affected nodes. The agent reads only those, updates the dossier, then `arch_manifest_commit` records them.
|
|
171
|
+
- Conversation memory is separate: a `fork` side chat inherits the main conversation's completed turns through DSH's native fork; `lite` gets a dossier digest.
|
|
172
|
+
- This is **not** a general memory system and does **not** depend on `dsh-project-brain`, `dsh-living-memory`, or `dsh-memex`. Uninstall those and it still works.
|
|
173
|
+
|
|
174
|
+
## Optional companion (recommended)
|
|
175
|
+
|
|
176
|
+
- [dsh-plugin-codegraph](https://github.com/CC19990113/dsh-plugin-codegraph) — tree-sitter code intelligence (symbols, callers, impact). Recommended if you want sharper edges; **not required**. Upstream reports ~1s first index and ~45ms re-index on a 337-file workspace, so structural queries are cheap after the first build. It is type-free, so dynamic dispatch and member calls may stay unresolved and fall back to text search. On a small repo the first index can cost more than a few greps.
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm run check # node --check for the Host/Client entry points
|
|
182
|
+
npm test # node --test
|
|
183
|
+
npm pack --dry-run
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Installation
|
|
187
|
+
|
|
188
|
+
Developer preview; install the local bundle now, or from npm once the 0.2.0 release is published:
|
|
189
|
+
|
|
190
|
+
1. Install the bundle via **Plugins → Add plugin** (local directory) or add it as a `link:` dependency in the profile.
|
|
191
|
+
2. Restart DSH once after installing so the client half joins the browser boot graph.
|
|
192
|
+
3. Open a conversation.
|
|
193
|
+
4. Optional but recommended: install `dsh-plugin-codegraph` separately (`dsh plugin add dsh-plugin-codegraph`). It is **not bundled and not installed automatically**.
|
|
194
|
+
|
|
195
|
+
### Where to find it
|
|
196
|
+
|
|
197
|
+
There is no separate "start" button or left-sidebar icon. The plugin adds a right-sidebar panel and a slash command:
|
|
198
|
+
|
|
199
|
+
- Open the right sidebar and click **+** (add tab) → **Architecture map**.
|
|
200
|
+
- Or type `/arch` in the composer and pick **Architecture map**.
|
|
201
|
+
- To check the Host half, ask the agent to call `arch_hello`.
|
|
202
|
+
|
|
203
|
+
## Quick start
|
|
204
|
+
|
|
205
|
+
1. In a new conversation, ask: *"Use the architecture-map skill: sync this workspace, build or update the graph, and write the dossier."*
|
|
206
|
+
2. Open `/arch` and click **Reset layout** if the saved layout hides the new graph.
|
|
207
|
+
3. Click a node → **Discuss (fork)** for a context-aware discussion, or **Lite** for a cheap one.
|
|
208
|
+
4. After changing code, ask for `arch_sync`; review only the changed files, update the node/doc, then `arch_manifest_commit`.
|
|
209
|
+
5. Use `arch_export` for Mermaid/SVG/Markdown, or the **Mermaid** fence renderer for chat diagrams.
|
|
210
|
+
|
|
211
|
+
## Limitations
|
|
212
|
+
|
|
213
|
+
- The sidebar follows the **session workspace**; an explicit tool `workspace` can point at a different graph than the panel shows.
|
|
214
|
+
- Node positions are stored in the browser locally, not in `graph.json`.
|
|
215
|
+
- Fork discussions inherit the parent request prefix, so their tool schemas may still show `bash`/`write` even though calls are denied.
|
|
216
|
+
- A parent-initiated `send_message` to a discussion child produces DSH's native settlement notice (including the child's closing text) in the parent conversation. The initial `arch_discuss` is caller-only and the child's full transcript never enters the main log; use the child's sidebar chat for narrative follow-ups.
|
|
217
|
+
- The canvas is hand-written SVG with a layered layout, not React Flow. A cyclic graph falls back to a compact grid; the layered (longest-path) layout is used for acyclic graphs.
|
|
218
|
+
- Mermaid rendering is on by default (`auto`) but can be disabled with `renderMermaid: off`; a known `dsh-mermaid-plus` installation makes `auto` disable ours.
|
|
219
|
+
- This is a 0.2.1 developer preview; the API and file schema can still change.
|
|
220
|
+
- Remote repositories are a developer preview: register, read, sync, polling, commands and maintenance are wired and were verified on a real Linux host; auto maintenance on an idle parent and pending-counter clearing remain rough edges.
|
|
221
|
+
|
|
222
|
+
## FAQ
|
|
223
|
+
|
|
224
|
+
**Do I need `dsh-mermaid-plus`?** No. Mermaid 12.2.0 is vendored. With `dsh-mermaid-plus` enabled,
|
|
225
|
+
`renderMermaid: auto` disables our renderer to avoid the shared `mermaid` fence key; `on` forces ours.
|
|
226
|
+
|
|
227
|
+
**Why hand-written SVG instead of React Flow?** It keeps the client bundle self-contained and avoids a
|
|
228
|
+
build/dependency chain. The layered layout covers the current graph sizes; React Flow remains an optional upgrade.
|
|
229
|
+
|
|
230
|
+
**Why does the sidebar show a different graph than a tool's `workspace` argument?** The panel follows the
|
|
231
|
+
session workspace by design. Open a session whose workspace is the graph you want to see.
|
|
232
|
+
|
|
233
|
+
**fork or lite?** `fork` inherits the parent's completed turns; `lite` starts from the graph and dossier only.
|
|
234
|
+
|
|
235
|
+
**Is this a general memory plugin?** No. The dossier is only for this architecture graph.
|
|
236
|
+
|
|
237
|
+
**How do I disable Mermaid?** Set `renderMermaid: off` in the bundle config; fences remain code blocks and the runtime is not loaded.
|
|
238
|
+
|
|
239
|
+
**Do I need codegraph?** No. `dsh-plugin-codegraph` is an optional companion for sharper call/impact edges.
|
|
240
|
+
|
|
241
|
+
## Requirements
|
|
242
|
+
|
|
243
|
+
- DeepSeek Harness with a Web/Desktop host. Verified with DSH `0.2.2-rc.5` on macOS; the Host/client APIs may change in later releases.
|
|
244
|
+
- Node.js 22+ for the test suite and CI.
|
|
245
|
+
- A workspace the agent can read.
|
|
246
|
+
- Mermaid is vendored; no separate Mermaid plugin is required.
|
|
247
|
+
|
|
248
|
+
## Roadmap
|
|
249
|
+
|
|
250
|
+
| Version | Scope |
|
|
251
|
+
|---|---|
|
|
252
|
+
| 0.1 | graph core and tools, sidebar canvas, node dragging, local position memory, `arch_sync` + manifest + dossier docs, cosmetic diff + stale marking, bundled architecture skill, `arch_discuss`, sidebar discussion buttons, `arch_export`, built-in Mermaid fence rendering |
|
|
253
|
+
| 0.2 | read-only remote Linux repositories over SSH (source picker, consent, 60s polling, sync/commands, maintenance), release polish |
|
|
254
|
+
| 0.3 | direct node→discussion bridge, shared/persisted positions, proposals, graph diff |
|
|
255
|
+
| 0.4 | edge discussions, group collapse, Mermaid import, Office export |
|
|
256
|
+
| 0.5 | multiple graphs, PR links, shared team maps |
|
|
257
|
+
| 0.6 | multiple remote repositories in parallel, remote sharing/export polish |
|
|
258
|
+
|
|
259
|
+
## Prior art & acknowledgements
|
|
260
|
+
|
|
261
|
+
This space already has excellent DSH plugins. Architecture map builds on their ideas and, where stated, their MIT-licensed code:
|
|
262
|
+
|
|
263
|
+
| Project | What we take |
|
|
264
|
+
|---|---|
|
|
265
|
+
| [dsh-mermaid-plus](https://github.com/pidongqianqian/dsh-mermaid-plus) (MIT) | The built-in Mermaid fence renderer and vendored runtime are adapted from it; original copyright notices are retained. |
|
|
266
|
+
| [@eduwork/dsh-side-chat](https://github.com/ECNU/EduWork/tree/main/packages/dsh-side-chat) (MIT/MulanPSL-2.0) | UX reference for native seed-fork side chats and hiding inherited messages. |
|
|
267
|
+
| [@ahggg/dsh-side-chat](https://github.com/AHGGG/dsh-side-chat) (MIT) | Codex-style side-chat interaction reference. |
|
|
268
|
+
| [dsh-project-brain](https://github.com/yj-liuzepeng/dsh-project-brain) (MIT) | Prior art for project memory; our dossier is architecture-specific, not a general memory. |
|
|
269
|
+
| [dsh-anatomy](https://github.com/h2298511604-ops/dsh-anatomy) (MIT) | Live architecture-map UI reference (targets DSH itself). |
|
|
270
|
+
| [dsh-diagram-gallery](https://www.npmjs.com/package/dsh-diagram-gallery) (MIT) | Diagram generation/gallery reference. |
|
|
271
|
+
| [dsh-mindmap-live](https://github.com/SSShooter/dsh-mindmap-live) (MIT) | Bidirectional agent/user editing reference. |
|
|
272
|
+
| [dsh-plugin-codegraph](https://github.com/CC19990113/dsh-plugin-codegraph) (MIT) | Optional code-fact companion. |
|
|
273
|
+
|
|
274
|
+
Copied or adapted code keeps its original license header and is listed in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
|
|
275
|
+
|
|
276
|
+
## Design notes
|
|
277
|
+
|
|
278
|
+
Remote design and construction notes live under `docs/`; early design/planning notes are kept locally and intentionally ignored. The README is the public overview.
|
|
279
|
+
|
|
280
|
+
## License
|
|
281
|
+
|
|
282
|
+
MIT.
|