GULI-lab/DSH-element-source1

dsh-element-source

适用于 DeepSeek Harness 的代码元素定位插件,支持在预览页面点击任意 UI 元素直接跳转到对应的源码位置。

AI 分析

核心用途是实现“点击即定位源码”的前端开发辅助功能。适合进行网页开发调试、需要快速修改对应组件代码的开发者。兼容dsh-better-sidebar的本地预览标签页。

套件
dsh-element-source
版本
0.1.0
授權
MIT
最近更新
2026年8月15日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:GULI-lab/DSH-element-source

Usage

  1. Open the entry: with better-sidebar → its Local preview tab; without it → the right-docked sidebar (open by default; collapsible to an edge strip) (note: this previews YOUR page, not the DSH UI itself);
  2. Enter http://localhost:3000 (your dev server) and press Enter;
  3. Watch the probe status icon (wifi) turn green — ready automatically in proxy mode;
  4. Click the select icon (crosshair), move the mouse — the target highlights; click to locate the source;
  5. The panel shows the location: file:line and the source snippet;
  6. The pick fills the chat input DRAFT automatically (e.g. [元素定位] src/components/App.vue:12) — nothing is sent; add your own wording and press Enter.

Esc cancels selection. A pick only fills the composer draft; whether to send is entirely your call.

The toolbar also has refresh (reload the page) and open externally (real browser tab).

Configuration

Override the row in your cordis.patch.yml (or the profile patch):

- id: element-source
  config:
    autoSteer: false        # wake the agent right after a pick (default false: only fill the chat draft)
    mappings:               # source-path prefix mappings (monorepo / node_modules rebasing)
      - find: '@app/ui/src'
        replacement: 'D:/workspace/my-app/packages/ui/src'
    proxyHosts:             # extra hosts the preview proxy may fetch (default: loopback only)
      - '192.168.1.10'
    sessionId: 'fixed-session'  # pin a session (usually not needed)