rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:atticuswx/dsh-cursor
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Cursor models inside DeepSeek Harness.
English | 简体中文
dsh-cursor registers a DeepSeek Harness LLM provider route named cursor.
The models it offers are the ones your Cursor account can select, and the
streams it returns are produced by the Cursor agent SDK. Once installed, Cursor
models appear next to every other provider in the Harness model selector.
Unofficial integration. This project is not affiliated with or endorsed by Cursor / Anysphere. Use it only with accounts you are authorized to use, and in line with Cursor's terms of service.
Cursor does not publish a chat-completions endpoint. It publishes an agent — a local runtime that owns a prompt, a tool surface, and a model selection. The Harness instead asks a provider for one streamed assistant message per request, with the whole conversation passed in.
This plugin bridges those two shapes:
DSH agent loop dsh-cursor Cursor
──────────────── ────────── ──────
llm.stream(request) ──► render transcript as one prompt ──► Agent.create(tools:['mcp'])
Agent.send(prompt) ──► model + custom tools
◄── text-delta ◄──── onDelta → DSH chunks text / thinking deltas
◄── tool-call ◄──── run.cancel() at the tool boundary tool choice for a custom tool
run the tool natively
tools: ['mcp'], so Cursor's own file, shell, search, and subagent tools are
not registered. The only tools the model can see are the Harness tools for
this request, bridged as in-process custom tools.onDelta; token usage is
reported on every turn.From GitHub:
dsh plugin --profile web add github:atticuswx/dsh-cursor
or from a local clone / tarball:
git clone https://github.com/atticuswx/dsh-cursor
dsh plugin --profile web add ./dsh-cursor
# or: dsh plugin --profile web add ./dist/dsh-cursor-0.2.0.tgz
The package declares a DSH bundle patch, so installation mounts the provider
automatically. Reload the page (or restart dsh web) and open Settings >
Models: a Cursor row appears with its API-key card.
The bundle is not published to npm; install it from GitHub or from a local
checkout. npx dsh-cursor login therefore only works from this repo
(node bin/cursor-login.mjs login) or after a global git install — pasting a
key into the card needs no CLI at all.
Open Settings > Models > Cursor. The Cursor card manages any number of API keys and chooses which one every request uses:
CURSOR_KEY_* references and are never returned to the page again. The card
shows the reference and the last four characters only.$DSH_HOME/.credentials.yaml.With no managed key the historic chain still applies, in this order:
CURSOR_API_KEY),CURSOR_API_KEY environment variable,npx dsh-cursor login stored at
~/.cursor/sdk/auth.json.Create keys at https://cursor.com/dashboard/api. Team admin API keys are not supported by the Cursor SDK; use a user key or a service-account key.
npx dsh-cursor login # opens Cursor, stores a user API key under ~/.cursor
npx dsh-cursor status # signed in?
npx dsh-cursor models # model ids this account can select
npx dsh-cursor logout # forget the stored login
That stored login is the last fallback; a managed key takes precedence once one exists.
The catalog comes from Cursor.models.list() for the active account — the
selected managed key, or the fallback credential when no key is managed — and is
cached for ten minutes per credential. Cursor's per-model parameters are mapped
onto the Harness reasoning selector when the parameter is thinking-shaped
(thinking, reasoning, effort, …).
If discovery cannot run — for example on an air-gapped pilot — list the model ids explicitly in the plugin configuration:
- id: dsh-cursor
name: dsh-cursor
config:
apiKeyEnv: CURSOR_API_KEY
models:
- composer-2
- gpt-5
Working:
Deliberate limitations:
~/.cursor as the SDK normally
does; the plugin sets nothing there.| Symptom | Fix |
|---|---|
| No Cursor models in the picker | No key is active. Add one in Settings > Models > Cursor, paste one in that row's key field, or run npx dsh-cursor status / npx dsh-cursor login. |
AUTH failures in the session |
The active key or fallback credential expired or was revoked. Replace it in Settings > Models > Cursor, or sign in again. |
CURSOR_UNAVAILABLE |
@cursor/sdk did not load. Reinstall the package; the host must run Node.js 22.13 or newer. |
INVALID_REQUEST naming a model |
The model id is not offered to this account. Run npx dsh-cursor models. |
QUOTA |
The Cursor plan has no remaining usage for this model. |
npm install
npm test # node --test, no network and no credentials needed
npm run check # syntax check every entry point
npm run pack:dist
A fresh clone runs the credential, catalog, transcript, bridge, and settings
card tests, and skips the six checks that import the Harness peer packages.
To run those too, make the DSH packages resolvable from this checkout; on a
machine with a web profile, link the copies the host itself loads so no
duplicate module instances appear:
ln -s "$DSH_HOME/profiles/node_modules/@deepseek-ai" node_modules/@deepseek-ai
node scripts/smoke.mjs --stream exercises the adapter against the real SDK
(needs a credential).
Because the package is installed into a profile, activating a newly added
bundle needs a fresh profile composition: restart dsh web (or use the
in-app plugin manager, which applies live).
Layout:
| File | Role |
|---|---|
lib/index.js |
Plugin entry: provider route, config, credentials, model catalog |
lib/client.js |
Settings > Models > Cursor card: managed keys and the active selection |
lib/keys.js |
Key registry normalization and the credential-resolution plan |
lib/bridge.js |
Cursor run → Harness stream chunks, tool-call handoff, cancellation |
lib/transcript.js |
Deterministic request → prompt rendering |
lib/catalog.js |
Cursor.models.list() caching, reasoning-parameter mapping |
lib/errors.js |
SDK failure → Harness failure-code translation |
bin/cursor-login.mjs |
login / status / models / logout CLI |
Targets DeepSeek Harness 0.2.1-rc.2 (engines.dsh), Node.js 22.13+
(required by @cursor/sdk), and @cursor/sdk 1.2.x.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm、deepseek-harness。