Preface¶
When building agent applications, models often need to perform calculations: unit conversion, percentages, exchange rates, date intervals. The system’s built-in calculator is either incomplete or requires staring at a bunch of buttons, making it impossible to “write what you want to calculate directly.” dsh-simple-calc combines “writing” and “calculating”: one expression per line, use Enter for new lines, results display instantly, and the history of expressions is the whole sheet.
Below introduces the plugin’s positioning, installation method, and specific usage. This article is compiled based on the plugin README and directory page information; please refer to the actual version in the repository for code and behavior.
What is it¶
dsh-simple-calc is a DSH client plugin, maintained by 6e6e6e, categorized as a client plugin. The directory page shows it has 0 stars, version 0.2.3, and MIT license. It brings the fend calculation engine (1.5.9 wasm build, see vendor/fend/) into the DSH sidebar, supporting units, percentages, currencies, bases, big numbers, and date calculations, along with variable assignment and local currency rate caching.
It solves the “write and get results” interaction problem: no need to memorize function names, no need to find symbols on buttons; what you write is the expression, and the result follows immediately.
Core Features¶
- One expression per line, evaluated line by line. Pressing Backspace at the start of a line merges the current line with the previous line;
↑/↓are used to move between lines. - Variable assignment. Write
x = 5, and subsequent lines can directly usex * 2to get 10. - Unit conversion. Supports syntaxes like
100 km/h to mph,5'10" to cm,100 C to F. - Percentage.
20% of 80,200 * 15%; the latter displays the result as30and annotates the original value as3000%. - Currency conversion.
100 USD to CNY,100 CNY to USD,100 USD + 50 EUR to USD. Exchange rates are fetched from Frankfurter (ECB reference rates), updated once on first open, and then every 12 hours with disk caching, falling back to cached values when offline. - Date calculation. e.g.,
@2026-11-01,today + 1 months,days until @2027-01-01. Dates only support@YYYY-MM-DDand time zones are not supported for now. - Big numbers and bases.
2^100,0xff + 1, thanks to fend’s arbitrary precision calculation. - Results and Export. Clicking a result copies it directly, with a “Copy Successful” prompt after copying; “Copy All” exports the entire sheet as plain text in the format
Expression = Result.
The ? in the top right opens the syntax cheat sheet; the interface supports i18n, and the plugin includes locale/*.json.
Installation and Enablement¶
The plugin is released as a DSH plugin package. Installation relies on dsh-simple-calc.tgz in Releases: select “Install Local Package” in the DSH plugin panel and point it to the downloaded file.
wget https://github.com/6e6e6e/dsh-simple-calc/releases/latest/download/dsh-simple-calc.tgz
This fixed address always points to the latest version. If you need to specify a version, go to the Release page and pick the package with the version number. For development and debugging, you can also clone directly and point the plugin panel to that directory:
git clone https://github.com/6e6e6e/dsh-simple-calc.git
After installation, click “Minimal Calculator” in the sidebar to enter the calculation page.
The plugin’s host-side entry point index.js mounts two services: /api/dsh-simple-calc/fend.wasm and /api/dsh-simple-calc/rates, the former providing the calculation engine and the latter providing exchange rate data. cordis.patch.yml is used for client bundle patching configuration. The runtime environment requires Node.js >= 20.
Typical Usage¶
A continuous series of daily calculations can be written directly on one page:
x = 5
x * 2
100 km/h to mph
20% of 80
100 USD to CNY
days until @2027-01-01
2^100
Results appear as soon as a line is finished; variables are available in subsequent lines. Date lines are separate and accept full-line expressions only.
The usage when you need to remember exchange rates or units is: first write the common conversions on the “paper” (in the app), when you need to reproduce it, click “Copy All” to export the text for archiving, and when you need to recalculate, simply re-enter it, and the exchange rates will automatically refresh on a 12-hour cycle.
Development-side commands are also explained here for reference against the source code:
npm test # 37 test cases: dates, evaluation, formatting, rate caching, host routing, bundle smoke
npm run build # generates client.js from lib/ and vendor/
Changes to lib/ generate client.js as the build artifact; scripts/build-client.mjs inlines date/core/fend.
Applicable Scenarios and Notes¶
Suitable for people who need a handy calculator in the DSH client: for quick unit, percentage, exchange rate, and date calculations, and variables can temporarily store intermediate results. For developers who need to embed calculations into agent workflows, this is a calculation view with a very thin interaction layer, with host routes /api/dsh-simple-calc/rates and /api/dsh-simple-calc/fend.wasm serving as ready-made interfaces.
A few points to note before using:
- The plugin runs with the permissions of the current DSH process. Before installing, you should open the source code and license to review it, paying special attention to the routes mounted by
index.jsand the disk caching behavior oflib/rates.js. - The plugin README explicitly states it does not support solving equations, calculus, or matrices, the reason being to avoid introducing a large number of function symbols; do not expect dates to participate in ordinary arithmetic.
- Date usage limitations: only supports
@YYYY-MM-DD, time zones are not supported for now; date lines must be acted upon as a whole line, assignments liked = @2026-11-05are not supported for now, and ordinary expressions will not treat dates as numbers. - Rate validity: updated once on first open, then refreshed and cached locally every 12 hours, and only cached values can be used when offline.
- Both the calculation engine and the plugin itself are under the MIT license; the original license of the engine can be seen in
vendor/fend/LICENSE, and the plugin LICENSE states Copyright (c) 2026 6e6e6e.
Closing¶
The positioning of dsh-simple-calc is very straightforward: it is not a scientific calculator, nor a collection of function symbols, but rather provides a “page for writing expressions on paper,” collecting units, percentages, currencies, bases, big numbers, and dates into the fend engine. As a client plugin in the DSH community directory, it is suitable for embedding in the sidebar as a daily arithmetic tool.
Directory page: https://www.skillhub.cn/plugins/6e6e6e/dsh-simple-calc
Source code: https://github.com/6e6e6e/dsh-simple-calc