gordonlu/dsh-context-lens1

dsh-context-lens

Request Context Profiler for DeepSeek Harness — see what changed between model requests, and how cache reuse changed with it.

AI 分析

核心用途是分析和优化模型请求的上下文。适合需要深入排查缓存复用效率、对比请求差异的开发者,开发时需注意其依赖的特定包版本存根。

パッケージ
dsh-context-lens
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/08/13

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:gordonlu/dsh-context-lens

ドキュメント

README 全文を読む ↗

Install & build

The published npm snapshot of the harness packages is incomplete: @deepseek-ai/dsh-compact and @deepseek-ai/dsh-type-meta are referenced by peers/dependencies but have never been published, and pnpm ≥ 10/11 auto-installs peers — so a plain registry install fails. This repo vendors type-only copies of the eight @deepseek-ai/dsh-* packages under vendor-stubs/ (dev-time, lib/types snapshots with sanitized package.json; only dsh-llm carries a 3-line runtime for its brand constructors). @deepseek-ai/cordis installs for real. See IMPLEMENTATION_NOTES.md → "npm snapshot gaps" for the full story.

pnpm install
pnpm typecheck   # tsc --noEmit
pnpm test        # vitest — 53 tests: fingerprint, cache math, diffing, projection lifecycle, replay consistency, determinism
pnpm build       # tsc declarations → lib/types, tsdown → lib/index.js + lib/invariant.js + lib/client.js (browser, closure-factory ABI)

The browser bundle replicates the harness client-bundle ABI: window.__ModuleLoader__.load({ id: "dsh-context-lens", factory: (require) => … }), resolving react / react-dom / platform module-table entries through the loader-injected require and inlining everything else.