pandarayc/dsh-editor-context ↗★ 0
dsh-editor-context
将编辑器当前浏览行作为上下文发送给输入框。 适合使用 Cursor 或 VS Code,需要快速同步代码上下文的开发者。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:pandarayc/dsh-editor-context说明文档
阅读完整 README ↗Configuration
- id: editor-context
name: dsh-editor-context
config:
# wsUrl: "ws://127.0.0.1:7788/editor-context" # the editor extension's publisher
# wsToken: "" # required if that side set editorContext.ws.token
# wsName: dsh # this subscriber's identity, and its send target
# wsLabel: DSH # how the editor's recipient picker names it
# includeText: true # ask for the selected text, not only the address
# autoSelection: false # also receive every changed selection
# stateDir: "~/.editor-context" # where the extension writes window state
# logFile: "" # defaults to /plugin.log
# maxAgeSeconds: 3600
# http: false # disable the browser routes entirely
# httpPath: /editor-context/position
wsUrl is the fallback, not the address: with extension 0.5.0 or newer the
real endpoint comes from the registry, and this is only dialled when the registry
is empty. If the extension sets a token, this side needs the same string or the
publisher refuses the subscription — and a refusal is terminal, reported once,
because a wrong secret is still wrong thirty seconds later.
The plugin mounts a read-only GET /editor-context/position on DSH's web server,
which the browser half reads. It returns an address and a line range — never file
contents. A path the extension's excludeGlobs rejected answers 404, so the
exclusion rule does not leak the path it is hiding.
/editors
Typing /editors in a conversation opens a picker of the editor windows this
plugin is talking to — app name, project folder, state and pid. Picking one
inserts that window's current position into the draft, which is the DSH-side
equivalent of going back to the editor and pressing Add to Bot.
It is a picker rather than a status dump because the question behind it is
"which Cursor am I pointing at", and with two windows open that has no single
answer. It is named editors and not status: status describes a whole
process, and a keyword nobody can guess is a failure of its own.
The same data is on GET /editor-context/editors, one entry per link with its
state (absent, connecting, ready, refused), dial count, and the hello
the window sent. It says nothing about files, and it exists because the
interesting failure is silence: a plugin with no socket looks exactly like a user
who has not pressed anything.
That route is matched before DSH's SPA fallback and is therefore not
additionally authenticated. It is meant for loopback, which is the default;
http: false removes it.