New:Socket for Asana Is Now Available.Learn more
Get Started

dsh-plugin-tushare

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsh-plugin-tushare

Shared Tushare Pro access for DeepSeek Harness finance plugins: one token, one per-interface quota gate, one trading calendar, and errors that tell an agent whether the token lacks permission or the quota just needs a moment.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

dsh-plugin-tushare

English | 中文

Shared Tushare Pro access for the finance plugins in this repo. It provides the tushare service and registers no tools — the model never calls it directly.

Install it once, configure the token once, and every finance plugin uses it.

dsh plugin --profile web add dsh-plugin-tushare
- id: tushare
  config:
    token: 'your-tushare-token'

Why a shared provider

Each finance plugin could carry its own token field, but then the user pastes the same token four times, and — the real problem — each plugin meters its own per-minute quota while Tushare meters the account. Four plugins each politely staying under the limit still blow through it together.

One service means one token, one quota gate, and one trading calendar.

Is Tushare free?

Tushare Pro accounts are free to create, but interfaces are gated by points, and points come from registration, activity, or payment. Roughly:

TierInterfaces used by these plugins
basic — entry-level accounttrade_cal, stock_basic, daily
points — higher score requireddaily_basic, income, balancesheet, cashflow, fina_indicator, express, moneyflow, top_list, hsgt_top10, moneyflow_hsgt, cb_basic, cb_daily, stk_holdernumber

Tushare moves these thresholds, so the table is documentation, not a gate. The authoritative answer is the error you get: it quotes the current requirement. ctx.tushare.access(apiName) returns the tier so a tool can warn up front.

What a failure tells the agent

Tushare answers every call with HTTP 200 and reports failure in the body, and three unrelated problems arrive as the same code: 40203. This client separates them, because they call for opposite responses:

KindMeaningWhat the agent should do
no-tokenNot configured, or the token was rejectedAsk the user to set a valid token
access-deniedThe token lacks the points for this interfaceReport it — retrying and rewording will not help
rate-limitedPer-minute quota exhausted (already retried with backoff)Wait, or narrow the request
provider-errorTushare rejected the request itselfUsually a bad parameter — a bug to fix
transportThe request never got an answerNetwork problem; retry may help

access-denied and no-token messages say explicitly that the data is unavailable and that the agent must not substitute or invent it. That sentence is there because the alternative was observed: told only that data was missing, an agent assembled numbers from elsewhere and answered with confidence. An unavailable interface has to end the task, not redirect it.

Service API

ctx.tushare.configured                      // boolean: is a token set?
ctx.tushare.access(apiName)                 // 'basic' | 'points' | undefined
ctx.tushare.query({ apiName, params, fields, signal })   // → rows, rejects with TushareError
ctx.tushare.tradeDates({ endDate, count, signal })       // → ['20260810', …] ascending

Consumers declare inject: ['tools', 'systemPrompt', 'tushare'], following the provider/consumer split dsh uses for its own capabilities (dsh-bash-local + dsh-tool-bash). This plugin must be installed for them to load.

Windows are counted in trading days from the exchange calendar — calendar arithmetic cannot tell you that a Monday was a holiday.

License

MIT

Keywords

dsh

FAQs

Package last updated on 20 Aug 2026

Related posts