dsh-codegraph-init 0.0.0-stage → 0.1.0

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 ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
+ the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 0.1.0 — 2026-11-12
8
+
9
+ ### Added
10
+
11
+ - Workspace "…" menu entries **安装 codegraph** and **卸载 codegraph**, ordered
12
+ between "Show in Finder" and "Delete workspace".
13
+ - Modal dialog with live install/uninstall log, status readout (CLI version,
14
+ DSH home, current wiring) and an optional "remove the global CLI" checkbox.
15
+ - Host service `codegraphInstall` (`status` / `start` / `poll` / `cancel` /
16
+ `forget`) with a bounded in-memory log and a single concurrent run.
17
+ - Own DSH wiring writer for CLI releases that predate the `dsh` target: appends
18
+ an `@deepseek-ai/dsh-mcp-client` entry to `$DSH_HOME/cordis.patch.yml` (with an
19
+ absolute command path) and a marked block to `$DSH_HOME/AGENTS.md`, while
20
+ delegating to `codegraph install -t dsh` whenever the CLI supports it.
21
+ - Resolution fallback so a `link:`-installed checkout can still load
22
+ `@deepseek-ai/dsh-typert-protocol` from the running installation.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 scccy
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,64 @@
1
- # Temporary Holding Version
1
+ # dsh-codegraph-init
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 把 [codegraph](https://github.com/colbymchenry/codegraph) 的接入流程搬进 DSH 侧栏:在**工作区**的「…」菜单里点一下,装 CLI、写 MCP 接线、写 agent 说明,全过程在一个对话框里流式打日志。
4
+
5
+ 它装的是 npm 上的发布版 `@colbymchenry/codegraph`,与任何本地 fork 无关。
6
+
7
+ ## 为什么需要它
8
+
9
+ `codegraph install` 原本就有 `dsh` 这个 target,但它只存在于上游仓库 2026-10-30 之后的提交里;npm 上最新的 1.6.2(2026-10-03 发布)还没有。所以在发布版上直接跑 `codegraph install -t dsh` 只会得到 `Unknown target: dsh`。
10
+
11
+ 插件因此分两条路:
12
+
13
+ 1. 用 `codegraph install --print-config dsh` 探测当前 CLI 认不认 `dsh` target——认,就交给上游自己写;
14
+ 2. 不认,就由插件按上游同样的格式自己写接线:`$DSH_HOME/cordis.patch.yml` 里追加一条 `@deepseek-ai/dsh-mcp-client`,`$DSH_HOME/AGENTS.md` 里追加带标记的说明块。
15
+
16
+ 写出来的 YAML 与上游 `src/installer/targets/dsh.ts` 同形,等上游发版后可以直接换回 CLI,不会出现两份格式。
17
+
18
+ ## 入口
19
+
20
+ 侧栏工作区「…」菜单,落在「在 Finder 中显示」之后、「删除工作区」之前:
21
+
22
+ - **安装 codegraph**(order 240,带分隔线)
23
+ - **卸载 codegraph**(order 250)
24
+
25
+ 两个入口共用同一个对话框;对话框第一次打开时会读一次宿主状态,把 DSH 目录、CLI 版本、当前是否已接线一并列出来,再决定按钮文案。
26
+
27
+ ## 安装时发生了什么
28
+
29
+ 1. **检查 CLI**:`command -v codegraph`,找不到就 `npm install -g @colbymchenry/codegraph@latest`。
30
+ 2. **判断 target**:`codegraph install --print-config dsh` 能通过就走 CLI,否则插件自己写。
31
+ 3. **写接线**:`cordis.patch.yml` 追加 MCP 客户端条目;`AGENTS.md` 追加 `<!-- CODEGRAPH_START -->` 块。
32
+ 4. **校验**:重新解析两个文件,确认接线真的落地。
33
+
34
+ 一个刻意的偏离:写进 `command:` 的是**绝对路径**,不是上游那份裸 `codegraph`。从 Finder/桌面图标启动的 DSH 进程,PATH 里通常没有 node bin 目录,裸命令会在 MCP 拉起时直接失败。
35
+
36
+ ## 卸载时发生了什么
37
+
38
+ 1. 先试 `codegraph uninstall -y -l global -t dsh`;
39
+ 2. 不支持(发布版就是这样)或失败,就由插件精确摘掉自己写的那条 `- insert:` 块和 `AGENTS.md` 里的标记块,其它内容原样保留;
40
+ 3. 可勾选「同时移除全局 CLI」,跑 `npm uninstall -g @colbymchenry/codegraph`。
41
+
42
+ **`.codegraph/` 索引不受影响**——那是仓库里的东西,归 `codegraph uninit` 管,不是接线。
43
+
44
+ ## 落盘位置
45
+
46
+ | 路径 | 内容 |
47
+ | --- | --- |
48
+ | `$DSH_HOME/cordis.patch.yml` | MCP 客户端条目(上游同形) |
49
+ | `$DSH_HOME/AGENTS.md` | `<!-- CODEGRAPH_START -->` … `<!-- CODEGRAPH_END -->` 说明块 |
50
+
51
+ 接好之后需要**新开一个会话**才生效;如果 `dsh-hmr` 关着,要重启 DSH。MCP 工具名形如 `mcp__codegraph__*`。
52
+
53
+ ## 宿主与客户端
54
+
55
+ - 宿主半(`lib/index.js`):一个 `TypertRemoteService`,命名空间 `codegraphInstall`,方法 `status` / `start` / `poll` / `cancel` / `forget`。运行日志放在内存环形缓冲里(上限 4000 行),客户端按游标 `poll` 增量取,同一时刻只允许一个 run。
56
+ - 客户端半(`lib/client.js`):只依赖 `react`,不 import 任何 Harness 客户端包;样式全部走 `--dsw-alias-*` token 自绘,跟随主题。
57
+
58
+ ## 开发注记
59
+
60
+ 从本地目录 `link:` 装进 profile 时,裸 import `@deepseek-ai/dsh-typert-protocol` 会失败:DSH 只对**位于 profile 目录内**的模块做 `@deepseek-ai/*` 路由,软链到别处的包会退化成普通 Node 解析。`lib/index.js` 顶部的 `importTypertProtocol()` 因此带一条兜底:从 `DSH_INSTALL_DIR` 和 `process.argv` 推断安装目录,直接按文件 URL 加载同一个包。npm 安装的正常形态走不到这条兜底。
61
+
62
+ ## 许可
63
+
64
+ MIT。
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: codegraph-init
3
+ name: 'dsh-codegraph-init'
package/icon.svg ADDED
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
2
+ <circle cx="6" cy="6" r="2.4"/>
3
+ <circle cx="18" cy="6" r="2.4"/>
4
+ <circle cx="12" cy="18" r="2.4"/>
5
+ <path d="M8.2 6.6 15.8 6.6"/>
6
+ <path d="M7.2 8.1 10.9 15.9"/>
7
+ <path d="M16.8 8.1 13.1 15.9"/>
8
+ </svg>