@yejiming/dsh-data-agent 0.0.9 → 0.0.10

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 CHANGED
@@ -8,12 +8,17 @@
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
  &nbsp;
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
+ &nbsp;
11
13
  <img src="https://img.shields.io/github/stars/omdsh-dev/dsh-data-agent?style=flat-square" alt="Stars">
12
14
  &nbsp;
13
15
  <img src="https://img.shields.io/npm/v/@yejiming%2Fdsh-data-agent?style=flat-square&label=npm" alt="npm">
14
16
  &nbsp;
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
+ ![Data analysis charts](assets/charts.png)
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,9 +47,7 @@ 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
- ![Database connection](assets/connection.png)
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
52
  ![Database workbench](assets/tables.png)
48
53
 
@@ -52,12 +57,13 @@ Choose “Data Mode” when creating a session, and DSH will use the data-analys
52
57
 
53
58
  ## Quick Install
54
59
 
55
- The Web UI and dsh-tui use separate DSH profiles. Install only the profile for the interface you use, or run both commands if you use both interfaces.
60
+ The Web UI, DSH Desktop, and dsh-tui use separate DSH profiles. Install the plugin into every profile you actually use.
56
61
 
57
62
  ### Method 1: npm (recommended)
58
63
 
59
64
  ```sh
60
65
  dsh plugin --profile web add @yejiming/dsh-data-agent
66
+ dsh plugin --profile desktop add @yejiming/dsh-data-agent
61
67
  dsh plugin --profile dsh-tui add @yejiming/dsh-data-agent
62
68
  ```
63
69
 
@@ -65,10 +71,11 @@ dsh plugin --profile dsh-tui add @yejiming/dsh-data-agent
65
71
 
66
72
  ```sh
67
73
  dsh plugin --profile web add github:omdsh-dev/dsh-data-agent
74
+ dsh plugin --profile desktop add github:omdsh-dev/dsh-data-agent
68
75
  dsh plugin --profile dsh-tui add github:omdsh-dev/dsh-data-agent
69
76
  ```
70
77
 
71
- The plugin installs the Data Mode preset automatically. No local build is required.
78
+ 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
79
 
73
80
  ## Using Data Agent in the Web UI
74
81
 
@@ -81,7 +88,7 @@ dsh --profile web
81
88
  Then:
82
89
 
83
90
  1. Create a session and choose “Data Mode.”
84
- 2. Enter your connection details in the database workbench.
91
+ 2. Click the database button in the top-right of the composer and enter your connection details in the workbench Modal.
85
92
  3. Once connected, ask an analysis question directly in the conversation.
86
93
  4. Follow up on the first result and ask DSH to narrow the scope, compare dimensions, or summarize the conclusions.
87
94
 
@@ -152,9 +159,25 @@ DSH must be able to reach the target database from your machine, and the corresp
152
159
  - PostgreSQL requires the `psql` client.
153
160
  - Oracle, Hive, and Impala require their respective command-line clients.
154
161
 
162
+ 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.
163
+
164
+ 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:
165
+
166
+ ```yaml
167
+ - id: data-agent
168
+ config:
169
+ clients:
170
+ mysql:
171
+ searchPaths:
172
+ - /opt/company/mysql/bin
173
+ # command: /opt/company/mysql/bin/mysql
174
+ ```
175
+
176
+ 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`.
177
+
155
178
  We recommend creating a read-only database account so Data Agent can explore and analyze data without modifying production records.
156
179
 
157
- If you see `failed to mount` or a missing `@yejiming/dsh-data-agent` package error, the plugin is usually not installed in the current profile. Make sure you ran the matching install command for the Web UI or dsh-tui, then restart DSH.
180
+ 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
181
 
159
182
  ## Security
160
183
 
@@ -168,6 +191,7 @@ If you see `failed to mount` or a missing `@yejiming/dsh-data-agent` package err
168
191
 
169
192
  ```sh
170
193
  dsh plugin --profile web remove @yejiming/dsh-data-agent
194
+ dsh plugin --profile desktop remove @yejiming/dsh-data-agent
171
195
  dsh plugin --profile dsh-tui remove @yejiming/dsh-data-agent
172
196
  rm -rf $DSH_HOME/.agent-presets/data-agent
173
197
  ```
package/README.md CHANGED
@@ -8,12 +8,17 @@
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
  &nbsp;
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
+ &nbsp;
11
13
  <img src="https://img.shields.io/github/stars/omdsh-dev/dsh-data-agent?style=flat-square" alt="Stars">
12
14
  &nbsp;
13
15
  <img src="https://img.shields.io/npm/v/@yejiming%2Fdsh-data-agent?style=flat-square&label=npm" alt="npm">
14
16
  &nbsp;
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
+ ![数据分析图表](assets/charts.png)
38
+
32
39
  ## 主要功能
33
40
 
34
41
  - **通过对话完成数据分析**:直接用自然语言描述目标,DSH会理解问题、拆解分析步骤、查询真实数据并整理结论。你可以继续追问,分析会沿着当前上下文逐步深入。
@@ -40,9 +47,7 @@ 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
- ![数据库连接](assets/connection.png)
44
-
45
- Web UI还提供内嵌数据库工作台,可以浏览库表、查看字段结构,或临时运行SQL。开始对话后,工作台会自动移到侧栏,不打断分析过程。
50
+ Web UI还提供按需数据库工作台:点击输入框右上角的数据库按钮,即可在同一个Modal中配置连接、浏览库表、查看字段结构或临时运行SQL。开始对话前后都不占用输入框上方或左侧的对话空间。
46
51
 
47
52
  ![数据库工作台](assets/tables.png)
48
53
 
@@ -52,12 +57,13 @@ Web UI还提供内嵌数据库工作台,可以浏览库表、查看字段结
52
57
 
53
58
  ## 快速安装
54
59
 
55
- Web UI和dsh-tui使用独立的DSH profile。只使用其中一种界面时,安装对应的一项;两个界面都使用时,请执行两条命令。
60
+ Web UI、DSH Desktop和dsh-tui使用独立的DSH profile。请把插件安装到实际使用的profile;同时使用多个界面时,分别执行对应命令。
56
61
 
57
62
  ### 方式一:npm安装(推荐)
58
63
 
59
64
  ```sh
60
65
  dsh plugin --profile web add @yejiming/dsh-data-agent
66
+ dsh plugin --profile desktop add @yejiming/dsh-data-agent
61
67
  dsh plugin --profile dsh-tui add @yejiming/dsh-data-agent
62
68
  ```
63
69
 
@@ -65,10 +71,11 @@ dsh plugin --profile dsh-tui add @yejiming/dsh-data-agent
65
71
 
66
72
  ```sh
67
73
  dsh plugin --profile web add github:omdsh-dev/dsh-data-agent
74
+ dsh plugin --profile desktop add github:omdsh-dev/dsh-data-agent
68
75
  dsh plugin --profile dsh-tui add github:omdsh-dev/dsh-data-agent
69
76
  ```
70
77
 
71
- 插件会自动安装“数据模式”预设,无需本地构建。
78
+ 插件会自动安装“数据模式”预设,并在profile启动时预加载该预设的数据库工具与命令;选择预设时不再动态导入插件子路径,无需本地构建。
72
79
 
73
80
  ## 在Web UI中使用
74
81
 
@@ -81,7 +88,7 @@ dsh --profile web
81
88
  然后按下面的步骤操作:
82
89
 
83
90
  1. 新建会话并选择“数据模式”。
84
- 2. 在数据库工作台填写连接信息。
91
+ 2. 点击输入框右上角的数据库按钮,在工作台Modal中填写连接信息。
85
92
  3. 连接成功后,直接在对话框中提出分析问题。
86
93
  4. 根据第一轮结果继续追问,让DSH缩小范围、比较维度或总结结论。
87
94
 
@@ -151,9 +158,25 @@ DSH运行查询时需要本机能够访问目标数据库,并安装相应的
151
158
  - PostgreSQL需要`psql`客户端。
152
159
  - Oracle、Hive和Impala需要各自的命令行客户端。
153
160
 
161
+ 插件会先使用当前profile进程的PATH;找不到时,会继续检查客户端HOME环境变量以及Windows、macOS、Linux的常见安装位置,包括Homebrew、MacPorts、Linuxbrew、Snap、Nix、WinGet Links、Scoop、Chocolatey和Program Files下的版本目录。自动发现使用的补充PATH也会传给实际客户端进程,因此从Finder启动的DSH Desktop通常无需再为Homebrew客户端手工配置路径。
162
+
163
+ 如果客户端安装在公司工具链或其他自定义目录,可在当前profile的`data-agent`配置中补充搜索目录;需要锁定具体版本时则直接填写绝对命令路径。当前profile的PATH始终优先,`searchPaths`在系统常见目录之前:
164
+
165
+ ```yaml
166
+ - id: data-agent
167
+ config:
168
+ clients:
169
+ mysql:
170
+ searchPaths:
171
+ - /opt/company/mysql/bin
172
+ # command: /opt/company/mysql/bin/mysql
173
+ ```
174
+
175
+ Windows路径可以写成`C:\Program Files\MySQL\MySQL Server 9.0\bin`。插件不会下载数据库客户端、执行登录shell或扫描整块磁盘;位于非常规目录且未进入PATH时,仍需使用`searchPaths`或`command`。
176
+
154
177
  建议先准备一个只读数据库账号,让数据Agent在不修改业务数据的前提下完成探索和分析。
155
178
 
156
- 如果出现`failed to mount`或提示找不到`@yejiming/dsh-data-agent`,通常是当前profile还没有安装插件。请确认Web UIdsh-tui分别执行了对应的安装命令,然后重新启动DSH
179
+ 如果出现`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
180
 
158
181
  ## 安全说明
159
182
 
@@ -167,6 +190,7 @@ DSH运行查询时需要本机能够访问目标数据库,并安装相应的
167
190
 
168
191
  ```sh
169
192
  dsh plugin --profile web remove @yejiming/dsh-data-agent
193
+ dsh plugin --profile desktop remove @yejiming/dsh-data-agent
170
194
  dsh plugin --profile dsh-tui remove @yejiming/dsh-data-agent
171
195
  rm -rf $DSH_HOME/.agent-presets/data-agent
172
196
  ```
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, seeds config
4
- # connections, and self-installs the agent preset (works in every profile,
5
- # headless included); `data-agent-routes` mounts the HTTP routes and only
6
- # activates where the webserver exists (web profiles). The browser half
7
- # (lib/client.js) ships in the same package and loads under the data-agent id
8
- # through the `dsh.client` declaration in package.json; the tool half
9
- # (lib/tool.js) is mounted only by the `data-agent` agent preset as the
10
- # `@yejiming/dsh-data-agent/tool` row, so no further rows belong here
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'