dsh-code-index 0.10.0 → 0.10.2

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 CHANGED
@@ -2,7 +2,18 @@
2
2
 
3
3
  All notable changes to dsh-code-index are documented here.
4
4
 
5
- ## 0.10.0 — ArkTS & Reliable Code Context (stable candidate, unreleased)
5
+ ## 0.10.2 — Rust declaration signatures (candidate, unpublished)
6
+
7
+ - **fix(rust):** render struct/enum/trait signatures from their declared `name` field, rather than a leading visibility node. Correct `pub`, restricted visibility and ordinary declarations across symbol search, repo maps, context and reference definition labels. Names and stable IDs were already correct; no new reference edges are inferred.
8
+ - **fix(cache):** advance cache generation to 4 and reject old extraction on both disk and direct incremental-build paths, rebuilding unchanged source once.
9
+ - Preserve normalized `exported` semantics, tool contracts, the two exact supported DSH host groups, all nine languages and ArkTS resources. Add Rust regression and installed-runtime smoke coverage. See `RELEASE_EVIDENCE_v0.10.2.md` and bilingual `RELEASE_NOTES_v0.10.2.md`.
10
+
11
+ ## 0.10.1 — DSH Desktop compatibility fix (2026-10-18)
12
+
13
+ - **fix(compat):** enumerate DSH/dsh-tools `0.2.0-rc.2 || 0.2.1-rc.2` so Desktop `0.2.1-rc.2` can activate the plugin without a version exemption. Keep the old development API baseline; no new feature or parser/resource change.
14
+ - **chore(release):** allow installation smoke to select either supported RC group against one archive; document installation and bilingual compatibility evidence. Published as npm `latest` with tag `v0.10.1`; post-merge main Node 22/24 CI and exact registry-archive verification passed. See `RELEASE_EVIDENCE_v0.10.1.md`.
15
+
16
+ ## 0.10.0 — ArkTS & Reliable Code Context (2026-10-13)
6
17
 
7
18
  - Add dedicated `.ets` parsing using pinned harmony-contrib/tree-sitter-arkts
8
19
  0.3.0 / ABI-14 WASM bundled with MIT notices; no native grammar installation.
@@ -18,8 +29,10 @@ All notable changes to dsh-code-index are documented here.
18
29
  all 15 `@Local` documentation snippets). Node 22.23.3 and 24.19.0 each pass
19
30
  235 tests, typecheck, server/client builds and real package-consumer smoke.
20
31
  See `RELEASE_EVIDENCE_v0.10.0.md` for actual methods and Desktop results.
21
- - v0.9.1 remains the published stable version. No v0.10 tag, npm publication,
22
- GitHub Release or main push has been performed.
32
+ - Published as npm `latest` with tag `v0.10.0` and a bilingual
33
+ [GitHub Release](https://github.com/lemonxiny55/dsh-code-index/releases/tag/v0.10.0).
34
+ The registry archive matches the verified stable candidate byte-for-byte;
35
+ post-merge Node 22/24 CI passed. Publication details are in Release Evidence.
23
36
 
24
37
  ## 0.9.1 — Gitignore directory whitelist fix (2026-10-10)
25
38
 
package/README.md CHANGED
@@ -5,7 +5,11 @@
5
5
 
6
6
  English | [中文](README.zh.md)
7
7
 
8
- **v0.10.0 stable candidate — ArkTS & Reliable Code Context**
8
+ **v0.10.2 candidate — Rust declaration display fix (not published).** Fixes public struct/enum/trait signatures reported as `pub` in [Issue #5](https://github.com/lemonxiny55/dsh-code-index/issues/5). Existing caches rebuild once. `exported` / the generic `export` display marker still mean language-specific public visibility: Rust unrestricted `pub` is true; `pub(crate)` and `pub(in path)` are false. This does not add type-use reference edges. See [fix notes](RELEASE_NOTES_v0.10.2.md) and [candidate evidence](RELEASE_EVIDENCE_v0.10.2.md).
9
+
10
+ **v0.10.1 released — DSH Desktop compatibility fix**
11
+
12
+ **[v0.10.1 is released](https://github.com/lemonxiny55/dsh-code-index/releases/tag/v0.10.1); npm `latest` is `0.10.1`.** Adds DSH Desktop `0.2.1-rc.2` support while retaining `0.2.0-rc.2`. Only these two exact DSH/dsh-tools host groups are supported; keep each host's first-party packages on the same version. See [release evidence](RELEASE_EVIDENCE_v0.10.1.md) and [bilingual fix notes](RELEASE_NOTES_v0.10.1.md).
9
13
 
10
14
  Give your [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) agent the bounded source context it needs to start a code task. One `code_context` call selects primary declarations, strong callers/callees, imports, current changes, and likely tests, with exact source ranges and reasons for inclusion. When evidence is missing, the pack says so.
11
15
 
@@ -14,11 +18,9 @@ Give your [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) ag
14
18
  - **Evidence you can inspect:** inclusion reasons are separate from `exact` / `import-scoped` / `name-only` relationship provenance. No probability or confidence estimate is invented.
15
19
  - **Local and current:** isolated repo/worktree indexes, external add/change/delete freshness, no external indexing API key. Existing full/compact surfaces and v0.8 configuration remain supported.
16
20
 
17
- v0.9.1 is published on npm and fixes Gitignore directory whitelist rules that silently omitted source trees. The packaged candidate passed real Agent verification in DSH Desktop `0.2.0-rc.2`. See [release evidence](RELEASE_EVIDENCE_v0.9.1.md).
21
+ Introduced in [v0.10.0](https://github.com/lemonxiny55/dsh-code-index/releases/tag/v0.10.0) and retained unchanged in v0.10.1: ArkTS `.ets` files use a dedicated, pinned parser to find component structs, methods, fields and decorators, navigate statically identifiable ETS/TS references, and retrieve actual source in bounded Context Packs. The installed package passed real DSH Desktop Agent verification and Node 22/24 release checks. Partial or failed parses report bounded diagnostics.
18
22
 
19
- This branch prepares the unpublished `0.10.0` stable candidate; npm `latest` remains v0.9.1.
20
- ArkTS `.ets` files now use a pinned, bundled MIT grammar rather than the TS
21
- parser. See [ArkTS PoC](ARKTS_POC_v0.10.0.md) and [v0.10 evidence](RELEASE_EVIDENCE_v0.10.0.md).
23
+ This supports syntax and static code context, without full HarmonyOS SDK semantics, HAR/module-alias resolution or state-update/UI rerender graphs. See [release evidence](RELEASE_EVIDENCE_v0.10.0.md), [ArkTS PoC](ARKTS_POC_v0.10.0.md) and [the bilingual announcement](assets/v0.10.0-announcement.md). The v0.9.1 Gitignore directory whitelist fix remains included.
22
24
 
23
25
  ## On this page
24
26
 
@@ -34,11 +36,17 @@ parser. See [ArkTS PoC](ARKTS_POC_v0.10.0.md) and [v0.10 evidence](RELEASE_EVIDE
34
36
 
35
37
  ## Quick start
36
38
 
37
- Requires Node 22/24 and a matching DSH `0.2.0-rc.2` host group. Install the published version into a Web profile:
39
+ Requires Node 22/24 and a matching DSH `0.2.0-rc.2` or `0.2.1-rc.2` host group. Install into an existing Desktop profile using its bundled `dsh` CLI:
40
+
41
+ ```sh
42
+ dsh plugin --profile desktop add dsh-code-index@0.10.1
43
+ ```
44
+
45
+ Restart Desktop after installation. For a matching Web profile:
38
46
 
39
47
  ```sh
40
- npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-code-index@0.9.1
41
- npx @deepseek-ai/dsh@0.2.0-rc.2 web
48
+ npx @deepseek-ai/dsh@0.2.1-rc.2 plugin --profile web add dsh-code-index@0.10.1
49
+ npx @deepseek-ai/dsh@0.2.1-rc.2 web
42
50
  ```
43
51
 
44
52
  For local development, run `pnpm install` and `pnpm build` at the repository root, then use `plugin --profile web add .`. See [Install](#install) for profile options.
@@ -89,13 +97,13 @@ Plus an optional **auto-injected system prompt section** (`code-index:repo-map`,
89
97
 
90
98
  Requires `dsh` (any install path — npx, npm, or source) and Node ≥ 22.
91
99
 
92
- The verified compatibility target is `@deepseek-ai/dsh@0.2.0-rc.2` / `@deepseek-ai/dsh-tools@0.2.0-rc.2` (Node 22 and 24 verification matrix). The DSH plugin surface is still a preview API, so upstream changes may require compatibility updates.
100
+ v0.10.1 declares `@deepseek-ai/dsh-tools: 0.2.0-rc.2 || 0.2.1-rc.2`. Use matching DSH/dsh-tools groups, rather than mixing first-party RC packages. The DSH plugin surface remains a preview API; other RCs and future releases are outside this compatibility declaration.
93
101
 
94
- v0.9 requires the matching `0.2.0-rc.2` tool runtime; the peer pin prevents fresh npm installs from selecting the older registry `latest` tag. Upgrade the host group together. The text/config/tool-surface compatibility above does not promise support for older DSH APIs.
102
+ Desktop checks DSH peer requirements before activation. v0.10.0's exact `0.2.0-rc.2` pin is rejected by DSH `0.2.1-rc.2`; v0.10.1 enumerates the supported groups instead of requiring a version exemption or an unbounded range. Its development dependency stays on `0.2.0-rc.2` for backward API checks.
95
103
 
96
104
  ```sh
97
105
  # from npm (prebuilt)
98
- npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-code-index@0.9.0
106
+ npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-code-index@0.10.1
99
107
 
100
108
  # or from a directory containing this checkout
101
109
  npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add ./dsh-code-index
package/README.zh.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- **v0.10.0 稳定候选 — ArkTS & Reliable Code Context**
5
+ **v0.10.2 候选 — Rust 声明展示修复(未发布)。**修复 [Issue #5](https://github.com/lemonxiny55/dsh-code-index/issues/5) 中公共 struct/enum/trait 的签名显示为 `pub` 的问题。既有缓存会重建一次。`exported` / 通用 `export` 展示标记仍表示各语言的公开状态:Rust 不带限制的 `pub` 为 true,`pub(crate)` 和 `pub(in path)` 为 false。本次不增加类型使用引用边。见[修复说明](RELEASE_NOTES_v0.10.2.md)及[候选验证证据](RELEASE_EVIDENCE_v0.10.2.md)。
6
+
7
+ **v0.10.1 已发布 — DSH Desktop 兼容修复**
8
+
9
+ **[v0.10.1 已正式发布](https://github.com/lemonxiny55/dsh-code-index/releases/tag/v0.10.1),npm `latest` 为 `0.10.1`。**增加 DSH Desktop `0.2.1-rc.2` 支持,保留 `0.2.0-rc.2`。仅支持这两个精确的 DSH/dsh-tools 宿主版本组;每组第一方包必须保持同版。验证方法见[发布证据](RELEASE_EVIDENCE_v0.10.1.md)及[中英文修复说明](RELEASE_NOTES_v0.10.1.md)。
6
10
 
7
11
  让 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Agent 用一次 `code_context` 调用拿到开始处理任务所需的有界源码上下文:主要声明、强相关 caller/callee、imports、当前变化和相关测试。每个关键 item 都有入选理由,源码有准确行号;证据不足时明确说明缺口。
8
12
 
@@ -11,11 +15,9 @@
11
15
  - **可检查的证据:**入选 reason 与关系的 `exact` / `import-scoped` / `name-only` provenance 分开,不编造概率或 confidence。
12
16
  - **本地、隔离、实时:**repo/worktree 独立,外部增改删自动刷新,不需要外部索引 API key;保留 full/compact surface 和 v0.8 配置。
13
17
 
14
- v0.9.1 已发布到 npm,修复了 Gitignore 目录白名单规则静默遗漏源码的问题。打包候选产物已通过 DSH Desktop `0.2.0-rc.2` 真实 Agent 验证。验证边界见[release evidence](RELEASE_EVIDENCE_v0.9.1.md)。
18
+ [v0.10.0](https://github.com/lemonxiny55/dsh-code-index/releases/tag/v0.10.0) 引入的 ArkTS 功能在 v0.10.1 中保持不变:`.ets` 使用独立、版本锁定的 parser,定位组件 struct、方法、字段和装饰器,查看静态可确定的 ETS/TS 引用,并通过有界 Context Pack 获取真实源码。安装包已通过 DSH Desktop 真实 Agent 验证及 Node 22/24 发布检查;部分解析或解析失败会提供有限诊断。
15
19
 
16
- 本分支准备尚未发布的 `0.10.0` 稳定候选,npm `latest` 仍是已发布的 v0.9.1。
17
- `.ets` 现在使用锁定版本、随包附带 MIT 许可证的 ArkTS grammar,独立于 TS parser。
18
- 见 [ArkTS PoC](ARKTS_POC_v0.10.0.md) 和 [v0.10 验证证据](RELEASE_EVIDENCE_v0.10.0.md)。
20
+ 支持范围是语法和静态代码上下文,不包含完整 HarmonyOS SDK 语义、HAR/模块别名解析、状态更新或 UI 重渲染调用图。见[发布证据](RELEASE_EVIDENCE_v0.10.0.md)、[ArkTS PoC](ARKTS_POC_v0.10.0.md) 和[双语公告](assets/v0.10.0-announcement.md)。v0.9.1 的 Gitignore 目录白名单修复继续保留。
19
21
 
20
22
  ## 本页导航
21
23
 
@@ -31,11 +33,17 @@ v0.9.1 已发布到 npm,修复了 Gitignore 目录白名单规则静默遗漏
31
33
 
32
34
  ## 快速开始
33
35
 
34
- 需要 Node 22/24 与匹配的 DSH `0.2.0-rc.2` 宿主版本组。将已发布版本安装到 Web profile:
36
+ 需要 Node 22/24 与匹配的 DSH `0.2.0-rc.2` 或 `0.2.1-rc.2` 宿主版本组。用 Desktop 自带的 `dsh` CLI 安装到现有 profile:
37
+
38
+ ```sh
39
+ dsh plugin --profile desktop add dsh-code-index@0.10.1
40
+ ```
41
+
42
+ 安装后重启 Desktop。匹配的 Web profile 可使用:
35
43
 
36
44
  ```sh
37
- npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-code-index@0.9.1
38
- npx @deepseek-ai/dsh@0.2.0-rc.2 web
45
+ npx @deepseek-ai/dsh@0.2.1-rc.2 plugin --profile web add dsh-code-index@0.10.1
46
+ npx @deepseek-ai/dsh@0.2.1-rc.2 web
39
47
  ```
40
48
 
41
49
  本地开发时,在仓库根目录运行 `pnpm install`、`pnpm build`,然后使用 `plugin --profile web add .`。其他 profile 选项见[安装说明](#安装)。
@@ -86,13 +94,13 @@ npx @deepseek-ai/dsh@0.2.0-rc.2 web
86
94
 
87
95
  需要 `dsh`(任意安装方式——npx、npm 或源码)与 Node ≥ 22。
88
96
 
89
- 当前开发兼容目标为 `@deepseek-ai/dsh@0.2.0-rc.2` / `@deepseek-ai/dsh-tools@0.2.0-rc.2`(CI 覆盖 Node 22 和 24)。DSH 插件接口仍属于预览 API,上游变化可能需要更新兼容适配。
97
+ v0.10.1 声明 `@deepseek-ai/dsh-tools: 0.2.0-rc.2 || 0.2.1-rc.2`。使用配套的 DSH/dsh-tools 版本组,不混装第一方 RC 包。DSH 插件接口仍属于预览 API;其他 RC 和未来版本不在此兼容声明范围内。
90
98
 
91
- v0.9 要求匹配的 `0.2.0-rc.2` tools runtime;精确 peer pin 防止 npm 新安装选到 registry 中旧的 `latest` 标签。宿主版本组需一起升级;文本、配置、工具 surface 的兼容承诺不等于支持旧 DSH API。
99
+ Desktop 在激活前检查 DSH peer 约束。v0.10.0 的精确 `0.2.0-rc.2` pin 会被 DSH `0.2.1-rc.2` 拒绝;v0.10.1 明确列举支持组,不依赖版本豁免或无上限范围。开发依赖保留 `0.2.0-rc.2`,继续检查旧版 API。
92
100
 
93
101
  ```sh
94
102
  # 从 npm(预编译)
95
- npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-code-index@0.9.0
103
+ npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-code-index@0.10.1
96
104
 
97
105
  # 或从包含本仓库检查副本的目录
98
106
  npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add ./dsh-code-index
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import Schema from '@deepseek-ai/schemastery';
3
3
 
4
4
  /** Shared data model for dsh-code-index. */
5
5
  /** On-disk cache layout version. Bump when persisted graph/symbol shapes change. */
6
- declare const REPO_INDEX_SCHEMA_VERSION: 3;
6
+ declare const REPO_INDEX_SCHEMA_VERSION: 4;
7
7
  type SymbolKind = 'function' | 'method' | 'class' | 'interface' | 'type' | 'enum' | 'variable' | 'field' | 'import' | 'module';
8
8
  /** Stable, file-qualified symbol identity: `sym:v1:<file>#<scope>/<segment>`. */
9
9
  type SymbolId = string;
@@ -29,7 +29,7 @@ interface SymbolInfo {
29
29
  line: number;
30
30
  /** 1-based end line (inclusive). */
31
31
  endLine: number;
32
- /** True when the symbol is exported at module level (export .. / export default). */
32
+ /** Normalized public/export status by language; Rust: unrestricted `pub` only. */
33
33
  exported: boolean;
34
34
  /** Short human-readable signature, e.g. `greet(name: string)` — empty when n/a. */
35
35
  signature: string;
package/dist/index.js CHANGED
@@ -992,6 +992,7 @@ function signatureFor(id, node) {
992
992
  }
993
993
  function rawSignature(id, node) {
994
994
  const name2 = nameOf(id, node);
995
+ if (id === "rust" && ["struct_item", "enum_item", "trait_item"].includes(node.type)) return name2;
995
996
  if (id === "arkts" && node.type === "struct_declaration") return `struct ${name2}`;
996
997
  if (id === "arkts" && node.type === "public_field_definition") {
997
998
  return `${name2}${collapseSpace(node.childForFieldName("type")?.text ?? "")}`;
@@ -1249,7 +1250,7 @@ import path3 from "path";
1249
1250
  import { createHash, randomUUID } from "crypto";
1250
1251
 
1251
1252
  // src/types.ts
1252
- var REPO_INDEX_SCHEMA_VERSION = 3;
1253
+ var REPO_INDEX_SCHEMA_VERSION = 4;
1253
1254
  function symbolCount(index) {
1254
1255
  return index.files.reduce((n, f) => n + f.symbols.length, 0);
1255
1256
  }
@@ -1302,6 +1303,7 @@ async function saveIndex(cachePath, index) {
1302
1303
 
1303
1304
  // src/buildIndex.ts
1304
1305
  async function buildIndex(root, options = {}, previous = null, forcePaths = /* @__PURE__ */ new Set()) {
1306
+ if (previous?.schemaVersion !== REPO_INDEX_SCHEMA_VERSION) previous = null;
1305
1307
  const scanned = await scanRepo(root, options);
1306
1308
  const prevByPath = new Map((previous?.files ?? []).map((f) => [f.path, f]));
1307
1309
  const prevMtime = new Map((previous?.files ?? []).map((f) => [f.path, f.mtimeMs]));