deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
dsh-subscriptions bridges your paid personal AI subscriptions directly into DeepSeek Harness as first-class LLM providers.
Instead of burning expensive pay-as-you-go API credits for everyday agent tasks, dsh-subscriptions allows you to authenticate your existing web subscriptions via standard OAuth PKCE. It features multi-account rotation pools (automatically switching accounts when a rate limit or cooldown is reached), preemptive quota switching, and an in-process Cordis service (ctx.subscriptions) that safely powers sibling plugins like dsh-image-gen and dsh-grok-xsearch with zero token leakage.
graph LR
subgraph DSHCore [DeepSeek Harness Session]
Agent[🤖 DSH Agent Execution] --> Router{Provider Router}
end
subgraph SubscriptionsCore [dsh-subscriptions Engine]
Router --> Pool{Multi-Account Vendor Pool}
Pool -->|Account #1| Acc1[👤 Primary Account: Active]
Pool -->|Account #2| Acc2[👤 Secondary Account: Standby]
Pool -->|Account #3| Acc3[👤 Fallback Account: Cooldown]
Acc1 -->|HTTP 429 / Quota Limit| Rotate[Smart Quota & Cooldown Rotator]
Rotate -->|Switches Traffic| Acc2
end
subgraph VendorBridges [4 Upstream Vendor Bridges]
Acc1 --> B1[ChatGPT / Codex Backend]
Acc1 --> B2[Claude Pro / Max Protocol]
Acc1 --> B3[xAI / Grok Subscriptions]
Acc1 --> B4[Google Cloud Code Assist / Antigravity]
end
subgraph EcosystemBridge [In-Process Cordis Service: ctx.subscriptions]
Pool --> ImgGen[dsh-image-gen: Zero-Cost Image Drawing]
Pool --> XSearch[dsh-grok-xsearch: Live Twitter Search]
end
style DSHCore fill:#1e1e2e,stroke:#89b4fa,stroke-width:2px,color:#cdd6f4
style SubscriptionsCore fill:#181825,stroke:#cba6f7,stroke-width:2px,color:#cdd6f4
style VendorBridges fill:#11111b,stroke:#a6e3a1,stroke-width:2px,color:#cdd6f4
style EcosystemBridge fill:#181825,stroke:#f38ba8,stroke-width:2px,color:#cdd6f4
| Vendor Key | Subscription Tier | Protocol & Features |
|---|---|---|
codex |
ChatGPT Plus / Pro | Codex streaming responses, tool calling & image drawing (/backend-api/codex/...) |
claude |
Claude Pro / Max | Native Claude Messages protocol, usage tracking (/v1/messages, /api/oauth/...) |
grok |
xAI / X Premium | Real-time reasoning responses, billing checks & social search |
antigravity |
Google Cloud Code Assist | Antigravity engine (/v1/loadCodeAssist, /v1/streamGenerateContent) |
kimi |
Moonshot Kimi | OAuth Device Flow login (auth.kimi.com), OpenAI-compatible chat |
glm |
Z.ai GLM Coding Plan | GLM coding endpoint (api.z.ai), live quota monitor (/api/monitor/usage/quota/limit) |
cursor |
Cursor | Cursor backend (api2.cursor.sh), billing-period usage dashboard parsing |
kiro |
AWS Kiro | Kiro desktop OAuth (app.kiro.dev), streaming code assistance |
copilot |
GitHub Copilot | GitHub Device Flow login (github.com/login/device), Copilot chat completions |
qwen |
Alibaba Qwen (DashScope) | OpenAI-compatible endpoint (dashscope.aliyuncs.com/compatible-mode/v1), API key auth |
ernie |
Baidu ERNIE (Qianfan) | OAuth2 token refresh via API Key + Secret Key, Wenxinworkshop chat |
spark |
iFlytek Spark | OpenAI-compatible Spark HTTP API (spark-api-open.xf-yun.com/v1) |
jetbrains |
JetBrains AI Assistant | JetBrains AI relay (api.jetbrains.ai) |
perplexity |
Perplexity Pro | Sonar model catalog (api.perplexity.ai) |
replit |
Replit Core | Replit AI API (replit.com/api/v1/ai), connect-token auth |
cody |
Sourcegraph Cody Pro | Sourcegraph API (sourcegraph.com/.api), access-token auth |
Custom vendors can also be dynamically registered via the createVendorFromProfile factory.
rotate.js, ratelimit.js)CODEX_OAUTH_1, CODEX_OAUTH_2, CODEX_OAUTH_3).HTTP 429, RATE_LIMIT, QUOTA_EXCEEDED), traffic instantly fails over to the next healthy account in the pool.switchAtRemaining): Automatically rotates to the next account before hitting zero if the rate-limit window reset is imminent.Retry-After, x-ratelimit-reset, ISO dates, epoch timestamps) and auto-restores cooled-down accounts when their window resets.$DSH_HOME/.credentials.yaml managed by the host credentials service.localhost, simply paste the redirected callback URL or authorization code directly into the account card.ctx.subscriptions)Sibling plugins can tap into subscription capabilities directly in memory via Cordis:
// Example in dsh-image-gen or custom plugins:
const res = await ctx.subscriptions.request('codex', '/backend-api/codex/images/generations', {
method: 'POST',
body: JSON.stringify({ prompt: 'Cyberpunk landscape', size: '1024x1024' }),
})
ALLOWLIST): Restricts calls to verified vendor endpoints, preventing SSRF vulnerabilities.v0.4.9)autoLoopback, on by default): For vendors whose OAuth redirect URI is a loopback address (Codex :1455, Grok :56121), the plugin spins up a temporary local HTTP server and catches the callback by itself — no URL pasting needed. The paste fallback always stays available.auth.openai.com, you open https://auth.openai.com/codex/device on any device, enter the code, and the plugin completes the standard PKCE exchange automatically.useWebCallback) and manual paste of the redirected URL / authorization code remain available for custom OAuth clients.v0.4.9)proxyUrl): Every account slot accepts its own proxy URL (http://, https://, socks5://[user:pass@]host:port). All requests for that account — OAuth token refresh, vendor checks, model requests — are routed through it. Empty = direct connection.ms) in the history store, so you can compare direct vs proxied latency over time.v0.4.9)privacyMask): One toggle in the settings card masks personal data across the whole UI: emails render as j***n@example.com everywhere (account lists, status labels, check results). Designed for screen sharing and streaming. Server-side masking means labels never leak through API responses either; the underlying account data is never overwritten.v0.4.9)| Route | Method | Purpose |
|---|---|---|
/dsh-subscriptions/diagnostics |
GET | Anonymized diagnostics report (no secrets, no tokens, no proxy URLs) |
/dsh-subscriptions/proxy-check |
POST | Latency check of a slot's proxy against its vendor base URL |
/dsh-subscriptions/oauth/device/start |
POST | Begin Codex device-code login (returns user code + verification URL) |
/dsh-subscriptions/oauth/device/poll |
POST | Poll device-code authorization status |
v0.4.17)ollama): When a local Ollama is reachable at ollamaBaseUrl (default http://127.0.0.1:11434), it appears in the native DSH model picker with the models discovered from /api/tags. No API key needed.ollamaFallback, on by default): When every account of a provider is exhausted (or unreachable) and nothing has been streamed yet, the chat continues on a local model (ollamaFallbackModel, or the first model from /api/tags). The fallback is logged and recorded in request history as kind: fallback.v0.4.17)reasoning.effort in the Codex /responses protocol. Grok forwards effort with its own catalog-aware filtering.codexVerbosity): low / medium / high is sent as text.verbosity for Codex reasoning models. Empty = protocol default.codexFastMode): Sends service_tier: priority (1.5x speed billing tier) with every Codex request. The active-subscription chip shows a ⚡ prefix while enabled.v0.4.17)*thinking*, grok *reasoning*, all codex models) cools down only the reasoning family of that account — standard models on the same account keep working immediately. Legacy cooldowns (from older versions) still block the whole account until expiry.hideDeprecatedModels): Filters test/preview/dev/alpha/beta/legacy model ids out of the native picker (applies to live catalogs and the static fallback).v0.4.18)reset / nothing to reset (nothing consumed) / no usable credit / already redeemed.v0.4.18)conversation.input.right slot).composerQuota setting): off / percent (85%) / bar (40px mini bar, green>30 / amber 10-30 / red <10) / forecast.calibrating…, with no consumption it says no usage. Ready state shows ~4.5h / ~12m.v0.4.18)SUBS (N) in the session header actions area with a pool-health LED: green <50% max usage, amber 50-90%, red ≥90%, gray when nothing is connected.v0.4.18)shell.overlay: a 64px circle with an SVG ring gauge of the active subscription balance, mounted via createPortal.localStorage.backdrop-filter: blur(28px) panel listing every account with usage bars. Clicking the bubble refreshes quota data; data also refreshes every 60 s.v0.4.18): Chevron switched to the core IconChevronDownOutline14 primitive; explicit settings snapshot states (loading / unavailable + Retry) guard against phantom input.v0.6.6)Host online (XX ms)), real-time connected account indicators, and pool size at a glance.HistoryStore debounces disk persistence asynchronously to prevent blocking the Node.js event loop during high-throughput streaming.dsh plugin --profile web add @goodandready/dsh-subscriptions
[!IMPORTANT] Restart DSH Web UI after installation (
systemctl --user restart dsh-web) and navigate to Settings → Plugins → Plugin Settings → Subscriptions to link your accounts.
[!TIP] UI Settings Card vs YAML Overrides: All common options (account slots, autoLoopback, privacyMask, composerQuota, expiryNotifyDays, codexFastMode, codexVerbosity, ollamaFallback/baseUrl/model, and cooldown/probe intervals) can be managed directly in the Web UI card (Settings → Plugins → Plugin Settings → Subscriptions). Low-level parameters such as OAuth client IDs/redirect URIs, API base URL overrides, and custom vendors are configured in
settings.yaml.
settings.yaml)dsh-subscriptions:
switchAtRemaining: 1
cooldownMs: 60000
autoLoopback: true # v0.4.9: catch loopback OAuth callbacks automatically
privacyMask: false # v0.4.9: mask emails and account identifiers in the UI
ollamaBaseUrl: http://127.0.0.1:11434 # v0.4.17: local Ollama gateway
ollamaFallback: true # v0.4.17: seamless fallback when all accounts are exhausted
ollamaFallbackModel: '' # v0.4.17: e.g. qwen2.5-coder; empty = first model from /api/tags
hideDeprecatedModels: false # v0.4.17: filter test/preview/beta/legacy model ids
codexVerbosity: '' # v0.4.17: low | medium | high (text.verbosity)
codexFastMode: false # v0.4.17: service_tier priority (1.5x speed tier)
composerQuota: 'off' # v0.4.18: composer indicator: off | percent | bar | forecast
# Per-slot fields (v0.4.9): expiresAt (ms epoch), proxyUrl (http/https/socks5://)
accounts:
codex:
- ref: CODEX_OAUTH_1
label: "Work Pro Account"
- ref: CODEX_OAUTH_2
label: "Personal Plus Account"
claude:
- ref: CLAUDE_OAUTH_1
label: "Claude Max"
grok:
- ref: GROK_OAUTH_1
label: "X Premium"
Supports Anthropic's adaptive thinking (thinking: { type: "adaptive" }) and reasoning effort steering (output_config: { effort }):
low, medium, high, xhigh, max) and Sonnet 4.6+, Sonnet 5 (low, medium, high).reasoning.efforts options to the DeepSeek Harness interface.en) and Simplified Chinese (zh) translation dictionaries and instruction guides.dsh-russian-lang), leaving the core plugin codebase lean and zero-hardcoded.latencyMs) for each individual subscription account slot./dsh-subscriptions/update, checking the npm registry for newer releases and executing single-flight installation via the host DSH CLI (dsh plugin add --config.minimumReleaseAge=0).127.0.0.1, IPv6 ::1, localhost), x-dsh-plugin-update header verification, and same-origin validation to prevent unauthorized updates.AbortSignal.timeout(15_000)), preventing hanging sockets during vendor outages.provider || vendor and index || accountIndex aliases in check endpoints, and deduplicated threshold notification loops.received NaN, expected number on uncachedInputTokens and outputTokens.TokenUsage Normalization: Introduced toTokenUsage() across all streaming pipelines (codexResponsesStream, openaiChatStream, anthropicStream, and googleStream) to map raw vendor usage payloads into canonical DSH TokenUsage (inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens, reasoningTokens, totalTokens).0 fallback, never NaN or undefined). Disjoint uncached token calculation is performed when cached tokens are folded into prompt totals.SubscriptionAdapter to prevent malformed or invalid token usage chunks from ever reaching DSH session persistence.bestEffort helper logging debug diagnostics.ctx.logger('subscriptions') subsystem.listModels, fetchFor, quotaFetch, jsonTokenRequest) with explicit fetchWithTimeout and AbortSignal.timeout safeguards.--dsw-alias-*, color-mix), achieving 100% theme token coverage and zero standalone rgba values.@deepseek-ai/dsh-client-locale, @deepseek-ai/dsh-client-ui-slots) in package manifest.The plugin source language is English only. Russian and other translations are provided at runtime by separate language plugins (for example the russification plugin), which translate the registered locale keys - the package itself ships no bundled translations (Changed in 0.6.1).
MIT © GooDAnDReaDY
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。