rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:fuyu1993/dsh-anysearch-quota
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Answers one question for DSH: how much AnySearch search do I have left?
It does it in two places:
AnySearch 958. Click it to open the full panel.额度 tab in the conversation Views, beside Chat / Trajectory / Stats.| Source | What it gives | Trust |
|---|---|---|
| Console dashboard | remaining / used / total, plan tier, next reset |
The real account figure, same source as anysearch.com/console/overview |
| Local ledger | calls this machine made, per UTC day | Exact for this machine; an estimate against the account balance |
| Rate window | x-ratelimit-limit / -remaining / -reset |
Real, but a short-lived limiter — not "calls left" |
The dashboard source wins whenever it is available; the panel labels the local ledger as an estimate when it is not. The two are never mixed in one display.
AnySearch's public API has no endpoint for the remaining balance — its own docs say the console is authoritative. The console page is fed by an internal JSON API, which this plugin calls directly:
POST /auth/refresh { refresh_token } → session tokens
GET /api/user/billing/overview Authorization: Bearer … → the real counters
It authenticates as a console session, not with the as_sk_… API key (that
key is rejected with 401). To enable it, copy the console's refresh token into a
credential:
localStorage['search-template-auth-state']
and copy its state.refreshToken.ANYSEARCH_CONSOLE_REFRESH_TOKEN in
$DSH_HOME/.credentials.yaml:refs:
ANYSEARCH_CONSOLE_REFRESH_TOKEN: "<the refresh token>"
That is the only value that leaves this machine besides the search requests
themselves, and it only goes to www.anysearch.com. The console rotates the
refresh token on every exchange; the rotated value is written back through the
credential service, so the session survives a restart.
Without it the plugin still works: it shows the local ledger estimate and tells you which credential would enable the real figures.
Calls are counted from observed tools/result events, billed by AnySearch's own
rules:
web_search / anysearch_search → 1 callweb_fetch (extract) → 1 callanysearch_batch_search → 1 per successful sub-queryanysearch_capabilities → noneGET /v1/domains is documented as consuming no free or paid search quota, so it
is the endpoint used to read the limiter headers. A 429 answer is recorded too —
that is what a saturated window looks like. The panel states plainly that these
headers are a window, not the daily quota.
Optional keys on the plugin's row in cordis.patch.yml:
- id: dsh-anysearch-quota
config:
consoleEnabled: true # false: ledger estimate only
consoleTokenEnv: ANYSEARCH_CONSOLE_REFRESH_TOKEN
consoleBaseURL: https://www.anysearch.com
consoleTtlMs: 60000 # how long a dashboard reading is reused
freeCalls: 1000 # allowance the ledger estimate is drawn against
probeEnabled: true # startup window probe + probe button
probeMinIntervalMs: 30000
apiKeyEnv: ANYSEARCH_API_KEY
baseURL: https://api.anysearch.com
stateFile: /path/state.json
conversation.session.header.actions (the Session
title row) and, because the header hides its chrome on a blank New Session,
also in conversation.hero.options. The two phases never overlap.document.body: the header clips its overflow, so a
panel growing inside it would be cut off.额度 tab stays available for the full view.The API key and the console refresh token are resolved inside the Host process,
per operation, from credential references. The browser half only ever receives
numbers. The ledger is a local JSON file at $DSH_HOME/anysearch-quota/state.json;
turning the plugin off stops the counting and removes the badge and tab, but
keeps that file.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。