@hedeqiang/dsh-nl2sql 0.11.2 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md DELETED
@@ -1,90 +0,0 @@
1
- # dsh-nl2sql · Data Q&A
2
-
3
- An enterprise NL2SQL plugin for DeepSeek Harness: connect databases, ask in plain language, and the agent writes read-only SQL, runs it and charts the result in the conversation. Pin results to dashboards, push them to Lark / Feishu, or ask the bot directly in a Lark group.
4
-
5
- [中文](README.md)
6
-
7
- ## Features
8
-
9
- - **Data sources:** MySQL 5.7+, PostgreSQL, Elasticsearch SQL (optionally over SSH), and CSV / Excel uploads stored as local SQLite.
10
- - **Schema analysis:** table roles, column semantics (time / measure / enum / sensitive), inferred relations, ER view.
11
- - **Asking:** in a Harness conversation through the `nl2sql_*` tools; results render as ECharts charts or tables.
12
- - **Drill-down and "why did it change":** split by a dimension, show rows, rank dimensions by their contribution to a change.
13
- - **Metric library and business knowledge:** glossary, governed metrics (`nl2sql_metric`), column notes, verified examples; import / export; accuracy evaluation against the examples.
14
- - **Dashboards:** multiple boards, global filters, drag-to-reorder, three widths, snapshots, Excel export; a board may mix data sources — each chart shows its source and the board can be scoped to the current source.
15
- - **Large results in IM:** messages say how many rows are shown; Lark app bots and Telegram attach the full data as Excel.
16
- - **Channels:** Lark / Feishu, Telegram, WeCom and DingTalk through pluggable adapters ([docs/CHANNELS.md](docs/CHANNELS.md)); push Markdown and results (native charts, images or tables per platform), and @-mention bots that need no public URL.
17
- - **Automation:** scheduled reports, metric alerts (threshold / change / anomaly / missing), schema change detection.
18
- - **Safety:**
19
- - read-only admission with per-dialect lexing, read-only transactions, server-side timeouts, streamed truncation;
20
- - table / column access policies with masking, full-scan guard;
21
- - member scopes, viewer role and row-level rules for Lark users;
22
- - a setting for what result data reaches the model (column statistics by default); audit attributed to people.
23
-
24
- ## Install
25
-
26
- Requires DeepSeek Harness 0.2 or later (desktop or `dsh web`). Published on npm as [`@hedeqiang/dsh-nl2sql`](https://www.npmjs.com/package/@hedeqiang/dsh-nl2sql).
27
-
28
- [![npm](https://img.shields.io/npm/v/@hedeqiang/dsh-nl2sql)](https://www.npmjs.com/package/@hedeqiang/dsh-nl2sql)
29
-
30
- **In Harness (recommended)**
31
-
32
- 1. Sidebar → **Plugins** → **Add plugin**.
33
- 2. Enter `@hedeqiang/dsh-nl2sql` (optionally with a version, e.g. `@hedeqiang/dsh-nl2sql@0.11.1`), install and enable it.
34
- 3. **Data Q&A** appears in the sidebar, and the Data Q&A preset is available for new conversations.
35
-
36
- You can also ask the Harness agent: "install the plugin @hedeqiang/dsh-nl2sql".
37
-
38
- **Command line**
39
-
40
- ```bash
41
- dsh plugin --profile desktop add @hedeqiang/dsh-nl2sql # desktop app profile; dsh web uses "web" by default
42
- ```
43
-
44
- Then enable it on the **Plugins** page (or restart Harness).
45
-
46
- **Upgrade:** update it from the plugin's details on the **Plugins** page, or run `dsh plugin --profile desktop update @hedeqiang/dsh-nl2sql`, then re-enable the plugin. Configuration and data live in `~/.dsh/nl2sql` and survive upgrades; older configuration is migrated on first load.
47
-
48
- **Uninstall:** remove it on the **Plugins** page or with `dsh plugin --profile desktop remove @hedeqiang/dsh-nl2sql`. Data in `~/.dsh/nl2sql` is kept; delete the directory if you no longer need it. Database passwords live in the Harness credential store.
49
-
50
- > All dependencies (mysql2, pg, ssh2, echarts, @resvg/resvg-js, @larksuiteoapi/node-sdk) ship prebuilt; no install scripts need to run.
51
-
52
- **From source (development)**
53
-
54
- ```bash
55
- git clone https://github.com/hedeqiang/dsh-nl2sql.git && cd dsh-nl2sql
56
- pnpm install --ignore-scripts
57
- ```
58
-
59
- Enter the directory's absolute path in **Plugins** → **Add plugin** (it is linked, so re-enabling the plugin picks up code changes), or ask the agent to install the directory with the plugin manager.
60
-
61
- ## Use
62
-
63
- 1. Sidebar → **Data Q&A** → **Manage → Data sources**: add a database (a read-only account is recommended) or upload a file.
64
- 2. **Schema** → analyze.
65
- 3. Ask on the **Ask** page, or pick the Data Q&A preset in any conversation.
66
- 4. Pin useful charts to a **Dashboard**; add glossary terms, metrics and examples under **Knowledge**.
67
- 5. **Manage → Push channels / Alerts & reports / Members & access** for Lark push, automation and the Lark bot.
68
-
69
- ## Data and privacy
70
-
71
- - **Configuration:** `~/.dsh/nl2sql/state.json`.
72
- - **Results, cache and logs:** `~/.dsh/nl2sql/results.sqlite`.
73
- - **Uploaded files:** `~/.dsh/nl2sql/files/`.
74
- - **Passwords and app secrets:** the Harness credential store.
75
- - **What reaches the model:** **Settings → Data shown to the model** decides this; by default it is schema, enum values and per-column result statistics.
76
- - **Lark:** content pushed to Lark leaves the machine.
77
-
78
- ## Development
79
-
80
- ```bash
81
- npm test # whole suite; local MySQL / PostgreSQL optional (skipped when absent)
82
- npm test -- --fast # unit + UI tests only
83
- node scripts/build-client.mjs # regenerate lib/client.js after editing client-src/
84
- ```
85
-
86
- See [DEVELOPMENT.md](DEVELOPMENT.md) and [eval/README.md](eval/README.md).
87
-
88
- ## License
89
-
90
- [MIT](LICENSE)
File without changes