dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Perplexity consumer-account (Pro) web search provider for DeepSeek Harness — login with browser SSO / email OTP, no API key billed. Ported from oh-my-pi.
Perplexity search provider for DeepSeek Harness with oh-my-pi's full auth chain: consumer account session (Pro included), billed Sonar API key, OpenRouter, or anonymous — each tried in order with fallback. Includes a complete login flow: browser SSO, email OTP (with TOTP challenge support), macOS desktop-app session borrowing, and API-key paste. Ported from oh-my-pi's perplexity.ts adapter.
This package unifies all Perplexity search modes in one provider: consumer account sessions (Pro included), direct Sonar API keys, OpenRouter routing, and anonymous fallback. Pin it in your profile with searchProvider: perplexity-account.
perplexity-account WebSearchProvider into ctx.web.cookies → session token (config / $PERPLEXITY_SESSION_TOKEN / stored record) → Perplexity API key (config / $PERPLEXITY_API_KEY / stored record) → OpenRouter key ($OPENROUTER_API_KEY, routes perplexity/sonar-pro) → anonymous.https://www.perplexity.ai/rest/sse/perplexity_ask over SSE; the session JWT rides as the __Secure-next-auth.session-token cookie — that is what unlocks the account's Pro model selection (a bearer header would silently degrade to anonymous turbo).chat/completions with search_mode: "web", num_search_results, max_tokens, temperature, web_search_options, and native domain/date/language filters.ctx.authorization (rendered by every harness UI):
ai.perplexity.mac install.web-search-perplexity/session and web-search-perplexity/api-key (with automatic reading fallback to legacy web-search-perplexity-account/* records); the provider re-reads them per search, so a login takes effect without restart.Clone and build the plugin:
git clone https://github.com/genson1808/dsh-web-search-perplexity
cd dsh-web-search-perplexity
npm install && npm run build
Add it to your DeepSeek Harness profile:
dsh plugin add /path/to/dsh-web-search-perplexity
The package declares dsh.bundle, so dsh plugin add appends it to dsh.profile.bundles and its shipped cordis.patch.yml inserts the loader entry automatically.
Mounting is automatic; selecting it as the active provider and tuning it happen in the profile's cordis.patch.yml:
- id: web
config:
searchProvider: perplexity-account
- id: <entry-id> # shown in Settings → Plugins → Plugin list
config:
sessionToken: !!js process.env.PERPLEXITY_SESSION_TOKEN # or leave unset and sign in via the authorization UI
model: experimental # consumer model_preference; default 'experimental'
searchRecency: week # optional: hour|day|week|month|year
timeoutMs: 60000 # optional
| Field | Default | Meaning |
|---|---|---|
cookies | $PERPLEXITY_COOKIES | Raw Cookie header from a logged-in perplexity.ai session (highest precedence) |
sessionToken | $PERPLEXITY_SESSION_TOKEN | Value of __Secure-next-auth.session-token; falls back to the credential record |
apiKey | $PERPLEXITY_API_KEY | Billed Sonar API key; falls back to the api-key credential record |
openRouterKey | $OPENROUTER_API_KEY | OpenRouter key — routes perplexity/<apiModel> |
model | experimental | Consumer model_preference (Sonar on paid plans) |
apiModel | sonar-pro | API-mode model |
apiMaxTokens | 8192 | API-mode max_tokens |
apiTemperature | 0.2 | API-mode sampling temperature |
numSearchResults | 20 | API-mode num_search_results |
useResponsesApi | $PERPLEXITY_RESPONSES=1 | API-mode transport: Responses API SSE instead of chat/completions |
searchRecency | (unset) | search_recency_filter: hour, day, week, month, year |
timeoutMs | 60000 | Hard per-request timeout |
To sign in interactively, run the harness's login/authorization UI and pick Perplexity (account session) — browser SSO is the default method — or Perplexity (API key) to store a Sonar API key. In the web interface, the plugin appears as Enabled under Settings → Plugins → Plugin list → Global plugins; no card is rendered under Plugin configuration (which requires a client-side browser bundle), so tuning parameters are configured exclusively via the profile patch (cordis.patch.yml) or environment variables.
site: / -site:, after:, before:, and lang: directives map onto Perplexity's native search_domain_filter, date, and language filters (so the engine is not double-constrained); other operators pass through as text signal. Recency is dropped when explicit after:/before: bounds are present — the upstream API rejects the combination.
maxResults is sliced post-hoc (the ctx.web seam enforces the bound regardless).turbo model.useResponsesApi mirrors oh-my-pi's PI_PERPLEXITY_RESPONSES=1 opt-in; it is experimental upstream and off by default.PERPLEXITY_AUTH_NO_BORROW=1 to skip desktop-app session borrowing (oh-my-pi's PI_AUTH_NO_BORROW).npm run typecheck # tsc --noEmit
npm test # unit tests (mocked fetch)
npm run build # tsdown → lib/ + tsc declarations
packages/ai/src/registry/oauth/perplexity.ts, packages/coding-agent/src/web/search/providers/perplexity.ts), MIT licensed.