@yejiming/dsh-data-agent 0.0.9 → 0.0.11
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 +32 -14
- package/README.md +32 -14
- package/cordis.patch.yml +8 -9
- package/lib/client.js +576 -593
- package/lib/client.js.map +1 -1
- package/lib/command-DuCpwVbl.js +875 -0
- package/lib/command.js +1 -874
- package/lib/{connections-DeauhaZi.js → connections-5sfdEDsG.js} +344 -34
- package/lib/index.js +104 -36
- package/lib/routes.js +6 -2
- package/lib/tool-DVh61An-.js +1128 -0
- package/lib/tool.js +1 -1127
- package/lib/types/client/DataAgentWorkbench.d.ts +2 -2
- package/lib/types/client/index.d.ts +3 -4
- package/lib/types/client/locales.d.ts +24 -0
- package/lib/types/client/persistence.d.ts +1 -1
- package/lib/types/client-discovery.d.ts +45 -0
- package/lib/types/clients.d.ts +7 -1
- package/lib/types/connections.d.ts +10 -0
- package/lib/types/defaults.d.ts +2 -0
- package/lib/types/index.d.ts +42 -16
- package/lib/types/routes.d.ts +0 -14
- package/lib/types/storage.d.ts +5 -0
- package/lib/types/tool.d.ts +4 -0
- package/package.json +5 -1
- package/preset/data-agent/agent.cordis.yml +6 -25
- package/preset/data-agent/preset.yml +1 -1
package/README.en.md
CHANGED
|
@@ -3,17 +3,22 @@
|
|
|
3
3
|
[中文](README.md) | **English**
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="assets/dsh-data-agent-banner.
|
|
6
|
+
<img src="assets/dsh-data-agent-banner.webp" alt="dsh-data-agent hero banner" width="100%">
|
|
7
7
|
</p>
|
|
8
8
|
<p align="center">
|
|
9
9
|
<img src="https://img.shields.io/github/v/release/omdsh-dev/dsh-data-agent?style=flat-square" alt="Version">
|
|
10
10
|
|
|
11
|
+
<a href="https://dshfind.com/en/plugins/omdsh-dev/dsh-data-agent?ref=badge"><img src="https://dshfind.com/api/badge/omdsh-dev/dsh-data-agent" alt="dshfind badge"></a>
|
|
12
|
+
|
|
11
13
|
<img src="https://img.shields.io/github/stars/omdsh-dev/dsh-data-agent?style=flat-square" alt="Stars">
|
|
12
14
|
|
|
13
15
|
<img src="https://img.shields.io/npm/v/@yejiming%2Fdsh-data-agent?style=flat-square&label=npm" alt="npm">
|
|
14
16
|
|
|
15
17
|
<img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License">
|
|
16
18
|
</p>
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://dshfind.com/en/plugins/omdsh-dev/dsh-data-agent?ref=badge"><img src="https://dshfind.com/api/card/omdsh-dev/dsh-data-agent" alt="dshfind card" width="440"></a>
|
|
21
|
+
</p>
|
|
17
22
|
<p align="center">
|
|
18
23
|
<strong>Connect DeepSeek Harness to databases and turn conversations into data analysis and business insights</strong><br>
|
|
19
24
|
<em>Natural-language queries · Automatic SQL execution · Iterative analysis · Web UI · dsh-tui · Read-only protection</em>
|
|
@@ -29,6 +34,8 @@
|
|
|
29
34
|
|
|
30
35
|
dsh-data-agent is a data analysis plugin for DeepSeek Harness (DSH). Connect a database and ask a business question; DSH inspects schemas, writes and runs SQL, continues the analysis from real results, and returns clear conclusions and business insights. The plugin supports both the Web UI and dsh-tui without modifying the DSH source code.
|
|
31
36
|
|
|
37
|
+

|
|
38
|
+
|
|
32
39
|
## Features
|
|
33
40
|
|
|
34
41
|
- **Analyze data through conversation**: Describe your goal in natural language. DSH understands the question, breaks it into analysis steps, queries real data, and organizes the conclusions. You can keep asking follow-up questions to explore the same context in greater depth.
|
|
@@ -40,35 +47,31 @@ dsh-data-agent is a data analysis plugin for DeepSeek Harness (DSH). Connect a d
|
|
|
40
47
|
- **Stay focused with Data Mode**: The session uses DSH's native `str_replace_editor` for files and keeps `sql-query`, `sql-write`, and `sql-cmd`; Web additionally provides `render-analysis`. Host or community tools such as `describe_image` and `ssh_*` do not leak into Data Mode.
|
|
41
48
|
- **Work safely with real data**: Use read-only mode and a read-only database account when appropriate. TUI passwords are masked and are never restored as part of a form draft. You decide whether the session may modify data.
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
The Web UI also includes an embedded database workbench for browsing schemas, inspecting columns, and running an occasional SQL statement. Once the conversation starts, the workbench moves to the sidebar so it does not interrupt the analysis.
|
|
50
|
+
The Web UI also includes an on-demand database workbench. Click the database button in the top-right of the composer to configure the connection, browse schemas, inspect columns, or run SQL in one Modal. Before and after the conversation starts, it no longer occupies the area above the composer or a left sidebar.
|
|
46
51
|
|
|
47
|
-

|
|
48
53
|
|
|
49
54
|
Choose “Data Mode” when creating a session, and DSH will use the data-analysis workflow for everything that follows.
|
|
50
55
|
|
|
51
|
-

|
|
52
57
|
|
|
53
58
|
## Quick Install
|
|
54
59
|
|
|
55
|
-
The
|
|
60
|
+
The commands below install the plugin into the Web profile.
|
|
56
61
|
|
|
57
62
|
### Method 1: npm (recommended)
|
|
58
63
|
|
|
59
64
|
```sh
|
|
60
65
|
dsh plugin --profile web add @yejiming/dsh-data-agent
|
|
61
|
-
dsh plugin --profile dsh-tui add @yejiming/dsh-data-agent
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
### Method 2: GitHub
|
|
65
69
|
|
|
66
70
|
```sh
|
|
67
71
|
dsh plugin --profile web add github:omdsh-dev/dsh-data-agent
|
|
68
|
-
dsh plugin --profile dsh-tui add github:omdsh-dev/dsh-data-agent
|
|
69
72
|
```
|
|
70
73
|
|
|
71
|
-
The plugin installs the Data Mode preset automatically. No local build is required.
|
|
74
|
+
The plugin installs the Data Mode preset automatically and preloads its database tools and command when the profile starts. Selecting the preset no longer performs dynamic package-subpath imports. No local build is required.
|
|
72
75
|
|
|
73
76
|
## Using Data Agent in the Web UI
|
|
74
77
|
|
|
@@ -81,7 +84,7 @@ dsh --profile web
|
|
|
81
84
|
Then:
|
|
82
85
|
|
|
83
86
|
1. Create a session and choose “Data Mode.”
|
|
84
|
-
2.
|
|
87
|
+
2. Click the database button in the top-right of the composer and enter your connection details in the workbench Modal.
|
|
85
88
|
3. Once connected, ask an analysis question directly in the conversation.
|
|
86
89
|
4. Follow up on the first result and ask DSH to narrow the scope, compare dimensions, or summarize the conclusions.
|
|
87
90
|
|
|
@@ -124,8 +127,6 @@ After connecting, return to the chat input and ask a business question. Other us
|
|
|
124
127
|
|
|
125
128
|
When you reopen the connection form in the same session, it restores the latest database type, host, port, user, database, and read-only mode. The password always remains masked and is never restored.
|
|
126
129
|
|
|
127
|
-

|
|
128
|
-
|
|
129
130
|
## How to Ask Better Analysis Questions
|
|
130
131
|
|
|
131
132
|
For more valuable results, include the business goal, time range, and dimensions you care about. For example:
|
|
@@ -152,9 +153,25 @@ DSH must be able to reach the target database from your machine, and the corresp
|
|
|
152
153
|
- PostgreSQL requires the `psql` client.
|
|
153
154
|
- Oracle, Hive, and Impala require their respective command-line clients.
|
|
154
155
|
|
|
156
|
+
The plugin tries the active profile process PATH first. If that fails, it also checks client HOME environment variables and common Windows, macOS, and Linux installation locations, including Homebrew, MacPorts, Linuxbrew, Snap, Nix, WinGet Links, Scoop, Chocolatey, and versioned Program Files directories. The supplemental PATH used for discovery is also passed to the actual client process, so DSH Desktop launched from Finder normally needs no manual path override for Homebrew clients.
|
|
157
|
+
|
|
158
|
+
If a client lives in a company toolchain or another custom directory, add search directories to the current profile's `data-agent` config. Use an absolute command path when you need to pin one exact version. The current profile PATH always wins, and `searchPaths` is checked before platform defaults:
|
|
159
|
+
|
|
160
|
+
```yaml
|
|
161
|
+
- id: data-agent
|
|
162
|
+
config:
|
|
163
|
+
clients:
|
|
164
|
+
mysql:
|
|
165
|
+
searchPaths:
|
|
166
|
+
- /opt/company/mysql/bin
|
|
167
|
+
# command: /opt/company/mysql/bin/mysql
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
On Windows, a search path can be written as `C:\Program Files\MySQL\MySQL Server 9.0\bin`. The plugin does not download database clients, run a login shell, or scan the whole disk. A client in an unusual directory that is not on PATH still requires `searchPaths` or `command`.
|
|
171
|
+
|
|
155
172
|
We recommend creating a read-only database account so Data Agent can explore and analyze data without modifying production records.
|
|
156
173
|
|
|
157
|
-
If you see `failed to mount` or a missing `@yejiming/dsh-data-agent` package error, the plugin is usually
|
|
174
|
+
If you see `failed to mount` or a missing `@yejiming/dsh-data-agent` package error, the plugin is usually missing from the current profile or an older preset is still installed. Run the matching command for the Web UI, DSH Desktop, or dsh-tui, then quit and restart DSH completely. An unmodified legacy preset is migrated automatically; for a hand-edited preset, remove the two configuration blocks that reference `@yejiming/dsh-data-agent/tool` and `@yejiming/dsh-data-agent/command`.
|
|
158
175
|
|
|
159
176
|
## Security
|
|
160
177
|
|
|
@@ -168,6 +185,7 @@ If you see `failed to mount` or a missing `@yejiming/dsh-data-agent` package err
|
|
|
168
185
|
|
|
169
186
|
```sh
|
|
170
187
|
dsh plugin --profile web remove @yejiming/dsh-data-agent
|
|
188
|
+
dsh plugin --profile desktop remove @yejiming/dsh-data-agent
|
|
171
189
|
dsh plugin --profile dsh-tui remove @yejiming/dsh-data-agent
|
|
172
190
|
rm -rf $DSH_HOME/.agent-presets/data-agent
|
|
173
191
|
```
|
package/README.md
CHANGED
|
@@ -3,17 +3,22 @@
|
|
|
3
3
|
**中文** | [English](README.en.md)
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="assets/dsh-data-agent-banner.
|
|
6
|
+
<img src="assets/dsh-data-agent-banner.webp" alt="dsh-data-agent HERO图" width="100%">
|
|
7
7
|
</p>
|
|
8
8
|
<p align="center">
|
|
9
9
|
<img src="https://img.shields.io/github/v/release/omdsh-dev/dsh-data-agent?style=flat-square" alt="Version">
|
|
10
10
|
|
|
11
|
+
<a href="https://dshfind.com/zh/plugins/omdsh-dev/dsh-data-agent?ref=badge"><img src="https://dshfind.com/api/badge/omdsh-dev/dsh-data-agent?lang=zh" alt="dshfind 小标"></a>
|
|
12
|
+
|
|
11
13
|
<img src="https://img.shields.io/github/stars/omdsh-dev/dsh-data-agent?style=flat-square" alt="Stars">
|
|
12
14
|
|
|
13
15
|
<img src="https://img.shields.io/npm/v/@yejiming%2Fdsh-data-agent?style=flat-square&label=npm" alt="npm">
|
|
14
16
|
|
|
15
17
|
<img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License">
|
|
16
18
|
</p>
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://dshfind.com/zh/plugins/omdsh-dev/dsh-data-agent?ref=badge"><img src="https://dshfind.com/api/card/omdsh-dev/dsh-data-agent?lang=zh" alt="dshfind 展示卡" width="440"></a>
|
|
21
|
+
</p>
|
|
17
22
|
<p align="center">
|
|
18
23
|
<strong>让DeepSeek Harness连接数据库,用对话完成数据分析与商业洞察</strong><br>
|
|
19
24
|
<em>自然语言查询 · 自动执行SQL · 连续分析 · Web UI · dsh-tui · 只读保护</em>
|
|
@@ -29,6 +34,8 @@
|
|
|
29
34
|
|
|
30
35
|
dsh-data-agent是DeepSeek Harness(DSH)的数据分析插件。连接数据库后,直接提出业务问题,DSH会自动查看库表、编写并执行SQL、根据真实结果继续分析,最终给出清晰的数据结论和商业洞察。插件同时支持Web UI与dsh-tui,无需修改DSH源码。
|
|
31
36
|
|
|
37
|
+

|
|
38
|
+
|
|
32
39
|
## 主要功能
|
|
33
40
|
|
|
34
41
|
- **通过对话完成数据分析**:直接用自然语言描述目标,DSH会理解问题、拆解分析步骤、查询真实数据并整理结论。你可以继续追问,分析会沿着当前上下文逐步深入。
|
|
@@ -40,35 +47,31 @@ dsh-data-agent是DeepSeek Harness(DSH)的数据分析插件。连接数据
|
|
|
40
47
|
- **专注数据任务的数据模式**:会话使用DSH原生`str_replace_editor`处理文件,并保留`sql-query`、`sql-write`、`sql-cmd`;Web额外提供`render-analysis`。`describe_image`、`ssh_*`等宿主或社区插件工具不会进入数据模式。
|
|
41
48
|
- **安全地使用真实数据**:支持只读模式和数据库只读账号;TUI密码会被隐藏,且不会作为表单草稿恢复。是否允许修改数据由你决定。
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Web UI还提供内嵌数据库工作台,可以浏览库表、查看字段结构,或临时运行SQL。开始对话后,工作台会自动移到侧栏,不打断分析过程。
|
|
50
|
+
Web UI还提供按需数据库工作台:点击输入框右上角的数据库按钮,即可在同一个Modal中配置连接、浏览库表、查看字段结构或临时运行SQL。开始对话前后都不占用输入框上方或左侧的对话空间。
|
|
46
51
|
|
|
47
|
-

|
|
48
53
|
|
|
49
54
|
创建会话时选择“数据模式”,DSH就会以数据分析工作流处理后续问题。
|
|
50
55
|
|
|
51
|
-

|
|
52
57
|
|
|
53
58
|
## 快速安装
|
|
54
59
|
|
|
55
|
-
Web
|
|
60
|
+
以下命令将插件安装到Web profile。
|
|
56
61
|
|
|
57
62
|
### 方式一:npm安装(推荐)
|
|
58
63
|
|
|
59
64
|
```sh
|
|
60
65
|
dsh plugin --profile web add @yejiming/dsh-data-agent
|
|
61
|
-
dsh plugin --profile dsh-tui add @yejiming/dsh-data-agent
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
### 方式二:从GitHub安装
|
|
65
69
|
|
|
66
70
|
```sh
|
|
67
71
|
dsh plugin --profile web add github:omdsh-dev/dsh-data-agent
|
|
68
|
-
dsh plugin --profile dsh-tui add github:omdsh-dev/dsh-data-agent
|
|
69
72
|
```
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
插件会自动安装“数据模式”预设,并在profile启动时预加载该预设的数据库工具与命令;选择预设时不再动态导入插件子路径,无需本地构建。
|
|
72
75
|
|
|
73
76
|
## 在Web UI中使用
|
|
74
77
|
|
|
@@ -81,7 +84,7 @@ dsh --profile web
|
|
|
81
84
|
然后按下面的步骤操作:
|
|
82
85
|
|
|
83
86
|
1. 新建会话并选择“数据模式”。
|
|
84
|
-
2.
|
|
87
|
+
2. 点击输入框右上角的数据库按钮,在工作台Modal中填写连接信息。
|
|
85
88
|
3. 连接成功后,直接在对话框中提出分析问题。
|
|
86
89
|
4. 根据第一轮结果继续追问,让DSH缩小范围、比较维度或总结结论。
|
|
87
90
|
|
|
@@ -124,8 +127,6 @@ dsh --profile dsh-tui
|
|
|
124
127
|
|
|
125
128
|
同一会话再次打开连接表单时,会恢复最近填写的数据库类型、地址、端口、用户、数据库和只读模式。密码始终隐藏且不会恢复。
|
|
126
129
|
|
|
127
|
-

|
|
128
|
-
|
|
129
130
|
## 推荐的提问方式
|
|
130
131
|
|
|
131
132
|
为了获得更有价值的分析,可以在问题中补充业务目标、时间范围和关注维度。例如:
|
|
@@ -151,9 +152,25 @@ DSH运行查询时需要本机能够访问目标数据库,并安装相应的
|
|
|
151
152
|
- PostgreSQL需要`psql`客户端。
|
|
152
153
|
- Oracle、Hive和Impala需要各自的命令行客户端。
|
|
153
154
|
|
|
155
|
+
插件会先使用当前profile进程的PATH;找不到时,会继续检查客户端HOME环境变量以及Windows、macOS、Linux的常见安装位置,包括Homebrew、MacPorts、Linuxbrew、Snap、Nix、WinGet Links、Scoop、Chocolatey和Program Files下的版本目录。自动发现使用的补充PATH也会传给实际客户端进程,因此从Finder启动的DSH Desktop通常无需再为Homebrew客户端手工配置路径。
|
|
156
|
+
|
|
157
|
+
如果客户端安装在公司工具链或其他自定义目录,可在当前profile的`data-agent`配置中补充搜索目录;需要锁定具体版本时则直接填写绝对命令路径。当前profile的PATH始终优先,`searchPaths`在系统常见目录之前:
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
- id: data-agent
|
|
161
|
+
config:
|
|
162
|
+
clients:
|
|
163
|
+
mysql:
|
|
164
|
+
searchPaths:
|
|
165
|
+
- /opt/company/mysql/bin
|
|
166
|
+
# command: /opt/company/mysql/bin/mysql
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Windows路径可以写成`C:\Program Files\MySQL\MySQL Server 9.0\bin`。插件不会下载数据库客户端、执行登录shell或扫描整块磁盘;位于非常规目录且未进入PATH时,仍需使用`searchPaths`或`command`。
|
|
170
|
+
|
|
154
171
|
建议先准备一个只读数据库账号,让数据Agent在不修改业务数据的前提下完成探索和分析。
|
|
155
172
|
|
|
156
|
-
如果出现`failed to mount`或提示找不到`@yejiming/dsh-data-agent`,通常是当前profile
|
|
173
|
+
如果出现`failed to mount`或提示找不到`@yejiming/dsh-data-agent`,通常是当前profile还没有安装插件,或仍在使用旧版预设。请为Web UI、DSH Desktop或dsh-tui执行对应的安装命令,然后完全退出并重新启动DSH。未修改过的旧版预设会自动迁移;手工编辑过的预设需要删除其中指向`@yejiming/dsh-data-agent/tool`和`@yejiming/dsh-data-agent/command`的两行配置块。
|
|
157
174
|
|
|
158
175
|
## 安全说明
|
|
159
176
|
|
|
@@ -167,6 +184,7 @@ DSH运行查询时需要本机能够访问目标数据库,并安装相应的
|
|
|
167
184
|
|
|
168
185
|
```sh
|
|
169
186
|
dsh plugin --profile web remove @yejiming/dsh-data-agent
|
|
187
|
+
dsh plugin --profile desktop remove @yejiming/dsh-data-agent
|
|
170
188
|
dsh plugin --profile dsh-tui remove @yejiming/dsh-data-agent
|
|
171
189
|
rm -rf $DSH_HOME/.agent-presets/data-agent
|
|
172
190
|
```
|
package/cordis.patch.yml
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# The dsh-data-agent bundle patch: activates the plugin as a profile layer.
|
|
2
2
|
#
|
|
3
|
-
# Two host rows: `data-agent` provides the connection store,
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
# activates where the webserver exists (web profiles).
|
|
7
|
-
# (lib/client.js) ships in the same package and loads under
|
|
8
|
-
# through the `dsh.client` declaration in package.json
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
# (duplicate ids fail the load).
|
|
3
|
+
# Two host rows: `data-agent` provides the connection store, installs the
|
|
4
|
+
# selectable agent preset, and statically preloads that preset's scoped tools
|
|
5
|
+
# and command through the profile bundle path; `data-agent-routes` mounts the
|
|
6
|
+
# HTTP routes and only activates where the webserver exists (web profiles).
|
|
7
|
+
# The browser half (lib/client.js) ships in the same package and loads under
|
|
8
|
+
# the data-agent id through the `dsh.client` declaration in package.json.
|
|
9
|
+
# The preset composition deliberately contains no dynamic imports of this
|
|
10
|
+
# package, which keeps DSH Desktop away from its unpacked-ASAR resolver bug.
|
|
12
11
|
- insert:
|
|
13
12
|
- id: data-agent
|
|
14
13
|
name: '@yejiming/dsh-data-agent'
|