Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function installI18n(ctx) {
| `confirm.` | 用 `window.confirm` 提出的确认 | `confirm.delete` · `confirm.removeLast` |
| `placeholder.` | 输入框占位符(**语法示例不翻**) | `placeholder.name` · `placeholder.sidebar` |
| `version.` / `ab.` | 包内特有的分组(版本管理 / A-B 测试) | `version.initialNote` · `ab.banner` |
| `summary.` | 「项目汇总」整页(左栏项目名单、六个页签名、概览的三个大数字与说明) | `summary.title` · `summary.files` |

**两条写法要求**:

Expand Down
4 changes: 4 additions & 0 deletions packages/codegraph/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
- **One-click initialisation**: an uninitialised directory gets an "Initialise index" button on the card that runs `codegraph init` (two-step confirm) — `index` / `sync` both require the project to be initialised first.
- **Two systemPrompt sections with deliberately unequal gates**: `plugin:dsh-codegraph` (order 150, ≤70 characters: only "this machine has the plugin, point the user at the card") and `plugin:dsh-codegraph:usage` (order 151, ≤600 characters: when to use it / the two entry points / what to do on failure). The announcement block is gated **only** by the `announceToAgent` switch — it is about the card, and the card routes are registered unconditionally, so it keeps being injected while the CLI probe is pending or failing; the usage block needs `CLI probe available && usageGuidance && effective path indexed` all three. Both switches write the settings namespace and add/remove the sections live.

- **“Project digest” panel (sidebar entry)**: sits below “New session”, next to “Context insight” and “Memory”; it collects every indexed project into one readable page. The right pane has six tabs: Overview (files/definitions/relations + “what this project does” + live MCP processes), Structure (directory aggregation: tree / heat), **Features (a drill-down feature tree: module → feature area → sub-feature → file)**, Composition (symbol-kind bands), Query (symbol search / explore / context), Maintenance (sync, rebuild, unlock, revert, diagnostics bundle, rename).
Feature grouping is **entirely hard-coded rules** (marker files + directories + file names; `moduleKindOf` / `FEATURE_SPEC` / `sideKindOf` in `client-src/pure.js`), never a model call. Third-party code, tests, one-off scripts, backups and scratch directories are folded and excluded from feature counts — a real 1,726-file project had 1,382 of them in `miniprogram_npm` / vendor `Drivers` / `FreeRTOS`, which would otherwise drown “Communication”. Module kinds are detected from **marker files**, not directory names (`app.json`, `pom.xml`, `APP/`+`Drivers/`, `mainwindow.cpp`), so a Keil project without `CMakeLists.txt` is still recognised as firmware.
“What this project does” is the only AI-generated content in the panel (`summaryAi`, on by default); it is re-calibrated at most once per 24 hours, can be edited by hand, and hand edits are never overwritten by the scheduler. Turning it off leaves every other tab fully functional.

![Codegraph console: target project, 8-cell index status with a header refresh, maintenance actions tiered by kind, search & query with a tabbed result area, agent integration](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-codegraph.png)

## Why the MCP working directory is managed
Expand Down
4 changes: 4 additions & 0 deletions packages/codegraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
- **一键初始化**:未初始化的目录在卡片上直接点「初始化索引」跑 `codegraph init`(两步确认)——`index` / `sync` 都要求项目先 init 过。
- **systemPrompt 分两段,门禁刻意不对等**:`plugin:dsh-codegraph`(order 150,≤70 字符:只说「本机有这个插件、提到就引导用户去开卡片」)与 `plugin:dsh-codegraph:usage`(order 151,≤600 字符:何时用 / 两个入口 / 失败怎么办)。公告段**只看** `announceToAgent` 开关——它讲的是卡片,而卡片路由无条件注册,所以 CLI 探测没落地或失败时它照常注入;usage 段要 `CLI 探测可用 && usageGuidance && 生效路径已索引` 三道全过。两个开关写 settings 命名空间后即时增删 section。

- **「项目汇总」面板(左栏入口)**:左侧栏「新会话」下方与「上下文洞察」「记忆系统」并列,把已索引的项目汇成一页可读摘要。右栏六个页签:概览(文件/定义/关系 + 「这个项目在做什么」+ 进程情况)、结构(目录聚合:树 / 热力)、**功能(可下钻的功能树:模块 → 功能域 → 子功能 → 文件)**、构成(符号类型色带)、查询(符号搜索 / 探索 / 上下文)、维护(同步、重建、解锁、撤销、诊断包、项目改名)。
功能归类**全部是写死的规则**(特征文件 + 目录 + 文件名,见 `client-src/pure.js` 的 `moduleKindOf` / `FEATURE_SPEC` / `sideKindOf`),不调模型。第三方库、测试、一次性脚本、备份与临时目录默认折叠且不计入功能统计——实测 1726 个文件的项目里有 1382 个是 `miniprogram_npm` / 厂商 `Drivers` / `FreeRTOS`,不折叠的话「通讯」会被厂商库塞满。模块类型看**特征文件**而不是目录名(`app.json` / `pom.xml` / `APP/`+`Drivers/` / `mainwindow.cpp`),Keil 工程没有 `CMakeLists.txt` 也认得出固件。
「这个项目在做什么」是面板里唯一的 AI 内容(`summaryAi`,默认开),24 小时内最多校准一次,可手改且手改后不再被自动校准覆盖;关掉它其余页签照常可用。

![Codegraph 控制台:目标项目、8 格索引状态(组头刷新)、索引维护按动作性质分层、搜索与查询(含结果区页签)、Agent 集成](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-codegraph.png)

## 为什么要托管 MCP 的工作目录
Expand Down
Loading