dsh-context-toolkit 0.2.0 → 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/README.md CHANGED
@@ -113,9 +113,10 @@ Tool switches: `tools.execute`, `tools.executeFile`, `tools.batchExecute`, `tool
113
113
  The offline suites need no DSH runtime:
114
114
 
115
115
  ```bash
116
- node smoke.mjs # 52 checks: contract, runtime discovery, tools, gate, knowledge base, observability
116
+ node smoke.mjs # 58 checks: contract, runtime discovery, tools, gate, knowledge base, observability, version reporting
117
117
  node test-client.mjs # 27 checks: browser-half contract and bilingual dictionary parity
118
- node test-package.mjs # 18 checks: publish manifest and the zero-dependency constraint
118
+ node test-package.mjs # 20 checks: publish manifest and the zero-dependency constraint
119
+ node release-check.mjs # 24 checks: release readiness (manifest, deps, tool count, gate, version, SHA coverage, no hardcoded paths)
119
120
  ```
120
121
 
121
122
  ## Known limits
package/README.zh.md CHANGED
@@ -113,9 +113,10 @@ await ctk_search({ queries: ['rate limit', 'auth'] }); // 只取相关片段
113
113
  离线套件不依赖 DSH 运行时:
114
114
 
115
115
  ```bash
116
- node smoke.mjs # 52 项:契约、运行时探测、三工具、门禁、知识库、观测
116
+ node smoke.mjs # 58 项:契约、运行时探测、三工具、门禁、知识库、观测、版本自述
117
117
  node test-client.mjs # 27 项:浏览器半体契约与双语字典一致性
118
- node test-package.mjs # 18 项:发布清单与零依赖约束
118
+ node test-package.mjs # 20 项:发布清单与零依赖约束
119
+ node release-check.mjs # 24 项:发布就绪(清单/依赖/工具数/门禁/版本/SHA 覆盖/无硬编码路径)
119
120
  ```
120
121
 
121
122
  ## 已知边界
package/index.js CHANGED
@@ -18,8 +18,9 @@
18
18
  * no third-party runtime dependencies.
19
19
  */
20
20
  import { homedir } from 'node:os'
21
- import { existsSync, statSync, readdirSync } from 'node:fs'
22
- import { join, isAbsolute, resolve, basename } from 'node:path'
21
+ import { existsSync, statSync, readdirSync, readFileSync } from 'node:fs'
22
+ import { join, isAbsolute, resolve, basename, dirname } from 'node:path'
23
+ import { fileURLToPath } from 'node:url'
23
24
  import { runProcess, availableRuntimes, probeRuntimes, shellPlan, scratchDir } from './lib/runner.js'
24
25
  import { mkdtempSync, rmSync } from 'node:fs'
25
26
  import { openStore } from './lib/store.js'
@@ -27,6 +28,26 @@ import { openStore } from './lib/store.js'
27
28
  export const name = 'dsh-context-toolkit'
28
29
  export const inject = ['tools', 'systemPrompt']
29
30
 
31
+ /**
32
+ * The version this bundle actually ships, read from its own manifest.
33
+ *
34
+ * It used to be hardcoded and drifted: the manifest moved to 0.2.0 while the
35
+ * doctor still reported 0.1.0, so the one line meant to identify the build was
36
+ * the one line that could not be trusted. Reading the manifest keeps the two in
37
+ * step without a release step of its own.
38
+ */
39
+ export const PLUGIN_VERSION = readManifestVersion()
40
+
41
+ /** Read the neighbouring package.json; a bundled copy still gets a usable value. */
42
+ export function readManifestVersion() {
43
+ try {
44
+ const here = dirname(fileURLToPath(import.meta.url))
45
+ const parsed = JSON.parse(readFileSync(join(here, 'package.json'), 'utf8'))
46
+ if (parsed && typeof parsed.version === 'string' && parsed.version) return parsed.version
47
+ } catch { /* not resolvable from here: still report something the doctor can print */ }
48
+ return '0.0.0'
49
+ }
50
+
30
51
  const z = await loadSchemastery()
31
52
 
32
53
  /**
@@ -1223,7 +1244,7 @@ function registerObservabilityTools(ctx, config, stats, store, storageDir, log)
1223
1244
 
1224
1245
  // storage
1225
1246
  ok('存储目录 Storage', storageDir)
1226
- ok('版本 Version', '0.1.0')
1247
+ ok('版本 Version', PLUGIN_VERSION)
1227
1248
 
1228
1249
  lines.push('')
1229
1250
  const failed = lines.filter((l) => l.startsWith('[FAIL]')).length
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-toolkit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "DeepSeek Harness bundle: native ctk_* sandbox tools, a routing gate that keeps bulk output out of the transcript, and a local full-text knowledge base. No third-party runtime dependencies.",
5
5
  "repository": {
6
6
  "type": "git",