dsh-db-studio 0.0.0-stage → 1.0.2
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/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.en.md +94 -0
- package/README.md +91 -2
- package/cordis.patch.yml +11 -0
- package/docs/conversation.png +0 -0
- package/docs/demo.gif +0 -0
- package/docs/panel.png +0 -0
- package/lib/client.js +2313 -0
- package/lib/drivers.js +456 -0
- package/lib/home.js +38 -0
- package/lib/index.js +481 -0
- package/lib/service.js +448 -0
- package/lib/session-store.js +223 -0
- package/lib/store.js +203 -0
- package/package.json +69 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.0.2 — 2026-10-25
|
|
4
|
+
|
|
5
|
+
- 新增 `/db` 斜杠指令:输入 `/` 后可从指令列表直接打开数据库面板,带数据库图标
|
|
6
|
+
|
|
7
|
+
## v1.0.1 — 2026-10-24
|
|
8
|
+
|
|
9
|
+
首个稳定版。
|
|
10
|
+
|
|
11
|
+
- 左侧栏「数据库」面板:连接管理、表结构浏览、分页数据、SQL 控制台
|
|
12
|
+
- 对话内「数据库」tab:在会话中直接查看和操作已选数据库
|
|
13
|
+
- 输入框旁多选下拉 + 紧凑连接状态条
|
|
14
|
+
- 4 个内置对话工具,按会话选择严格授权
|
|
15
|
+
- SQLite / PostgreSQL / MySQL 支持
|
|
16
|
+
- 中文 / English README、界面演示 GIF、GitHub Actions CI
|
|
17
|
+
|
|
18
|
+
## v0.2.0
|
|
19
|
+
|
|
20
|
+
- 首个公开版本:数据库面板、对话数据库 tab、多选、状态条和 agent 工具
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jianjun Xiao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# dsh-db-studio
|
|
2
|
+
|
|
3
|
+
English | [简体中文](./README.md)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/etShaw-zh/dsh-db-studio/actions/workflows/test.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/etShaw-zh/dsh-db-studio/releases)
|
|
8
|
+
[](https://www.npmjs.com/package/dsh-db-studio)
|
|
9
|
+
|
|
10
|
+
Connect to databases in [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH), then query and edit data right in the conversation.
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## What it does
|
|
15
|
+
|
|
16
|
+
### Browse and manage databases
|
|
17
|
+
|
|
18
|
+
- **Database panel in the sidebar**: browse connections, schemas and paginated data, and run SQL.
|
|
19
|
+
- **SQLite / PostgreSQL / MySQL**, with SQLite requiring no extra driver.
|
|
20
|
+
|
|
21
|
+
### Work in the conversation
|
|
22
|
+
|
|
23
|
+
- **Database tab in a conversation**: view and work with the selected databases without leaving the chat.
|
|
24
|
+
- **Multi-select picker in the composer**: choose the databases this conversation may use.
|
|
25
|
+
- **Talk to the data**: four agent tools for querying, creating tables and writing data.
|
|
26
|
+
- **`/db` command**: type `/`, pick **Database** from the command list, and open the database panel.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
From npm:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# macOS desktop
|
|
34
|
+
DSH_CLI="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh"
|
|
35
|
+
"$DSH_CLI" plugin --profile desktop add dsh-db-studio@1.0.2
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or install directly from GitHub:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
"$DSH_CLI" plugin --profile desktop add github:etShaw-zh/dsh-db-studio
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Restart DeepSeek Harness afterwards. Stable builds are listed in [Releases](https://github.com/etShaw-zh/dsh-db-studio/releases). On Windows / Linux use the `dsh` path installed on your machine.
|
|
45
|
+
|
|
46
|
+
From source:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/etShaw-zh/dsh-db-studio.git
|
|
50
|
+
"$DSH_CLI" plugin --profile desktop add "$PWD/dsh-db-studio"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Getting started
|
|
54
|
+
|
|
55
|
+
1. Open **Database** in the sidebar and create a connection, or use the built-in demo database.
|
|
56
|
+
2. Select the databases for the conversation, then ask the assistant to work with them:
|
|
57
|
+
|
|
58
|
+
> Show me the 10 most recent orders in the demo database, sorted by amount.
|
|
59
|
+
>
|
|
60
|
+
> Change every Hangzhou user's city to “Hangzhou · West Lake”.
|
|
61
|
+
>
|
|
62
|
+
> Add a notes field to the orders table.
|
|
63
|
+
|
|
64
|
+
The assistant can only access databases selected for the conversation; if none are selected, it asks you to choose one first.
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
Set these in the profile's `cordis.patch.yml`:
|
|
69
|
+
|
|
70
|
+
| Key | Default | Meaning |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `demo` | `true` | Create a demo database when there are no connections |
|
|
73
|
+
| `allowWrite` | `true` | Allow write operations |
|
|
74
|
+
| `agentTools` | `true` | Register the conversation tools |
|
|
75
|
+
| `maxRows` | `200` | Maximum rows returned by a query |
|
|
76
|
+
|
|
77
|
+
## Data and security
|
|
78
|
+
|
|
79
|
+
- Connections live in `~/.dsh/dsh-db-studio/connections.json` with file mode `0600`.
|
|
80
|
+
- Passwords stay on this machine and never reach the browser or the model context.
|
|
81
|
+
- For production databases, use a read-only account or connection, or set `allowWrite: false`.
|
|
82
|
+
|
|
83
|
+
## Development
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm install
|
|
87
|
+
npm test
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Issues and PRs are welcome: <https://github.com/etShaw-zh/dsh-db-studio>
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,3 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-db-studio
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
简体中文 | [English](./README.en.md)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/etShaw-zh/dsh-db-studio/actions/workflows/test.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/etShaw-zh/dsh-db-studio/releases)
|
|
8
|
+
[](https://www.npmjs.com/package/dsh-db-studio)
|
|
9
|
+
|
|
10
|
+
在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)里连接数据库,直接在对话中查数据、改数据。
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## 能做什么
|
|
15
|
+
|
|
16
|
+
### 浏览和管理数据库
|
|
17
|
+
- **左侧栏「数据库」面板**:浏览连接、表结构、分页数据,执行 SQL。
|
|
18
|
+
- **支持 SQLite / PostgreSQL / MySQL**,SQLite 无需额外安装驱动。
|
|
19
|
+
|
|
20
|
+
### 在对话里直接用
|
|
21
|
+
- **对话内「数据库」标签**:在当前对话里直接查看和操作已选数据库。
|
|
22
|
+
- **输入框旁多选下拉**:选择本次对话要使用的数据库,支持多选。
|
|
23
|
+
- **对话中直接操作**:内置 4 个助手工具,可以帮你查询、建表、写数据。
|
|
24
|
+
- **`/db` 指令**:输入 `/`,在指令列表里选择「数据库」,直接打开数据库面板。
|
|
25
|
+
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
从 npm 安装:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# macOS 桌面端
|
|
32
|
+
DSH_CLI="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh"
|
|
33
|
+
"$DSH_CLI" plugin --profile desktop add dsh-db-studio@1.0.2
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
也可以直接从 GitHub 安装:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
"$DSH_CLI" plugin --profile desktop add github:etShaw-zh/dsh-db-studio
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
安装后**重启 DeepSeek Harness**。稳定版见 [Releases](https://github.com/etShaw-zh/dsh-db-studio/releases)。Windows / Linux 使用本机对应的 `dsh` 路径即可。
|
|
43
|
+
|
|
44
|
+
从源码安装:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone https://github.com/etShaw-zh/dsh-db-studio.git
|
|
48
|
+
"$DSH_CLI" plugin --profile desktop add "$PWD/dsh-db-studio"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 开始使用
|
|
52
|
+
|
|
53
|
+
1. 左侧栏点击「数据库」,新建连接,或使用内置示例数据库。
|
|
54
|
+
2. 在对话框里选中要用的数据库;也可以直接在对话里让助手操作:
|
|
55
|
+
|
|
56
|
+
> 查一下示例数据库里最近 10 笔订单,按金额排序
|
|
57
|
+
>
|
|
58
|
+
> 把 users 表里杭州的用户城市改成「杭州·西湖区」
|
|
59
|
+
>
|
|
60
|
+
> 给 orders 表加一个备注字段
|
|
61
|
+
|
|
62
|
+
助手只能访问当前对话选中的数据库;没选数据库时会先提示你选择。
|
|
63
|
+
|
|
64
|
+
## 配置
|
|
65
|
+
|
|
66
|
+
插件配置写在 profile 的 `cordis.patch.yml`,常用项:
|
|
67
|
+
|
|
68
|
+
| 配置 | 默认 | 说明 |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `demo` | `true` | 没有连接时自动创建示例数据库 |
|
|
71
|
+
| `allowWrite` | `true` | 是否允许写操作 |
|
|
72
|
+
| `agentTools` | `true` | 是否注册对话工具 |
|
|
73
|
+
| `maxRows` | `200` | 查询最多返回行数 |
|
|
74
|
+
|
|
75
|
+
## 数据与安全
|
|
76
|
+
|
|
77
|
+
- 连接信息保存在 `~/.dsh/dsh-db-studio/connections.json`,文件权限为 `0600`。
|
|
78
|
+
- 密码只保存在本机,不会发送到浏览器或模型上下文。
|
|
79
|
+
- 生产库建议使用只读账号、只读连接,或设置 `allowWrite: false`。
|
|
80
|
+
|
|
81
|
+
## 开发
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install
|
|
85
|
+
npm test
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
欢迎提交 Issue 或 PR:<https://github.com/etShaw-zh/dsh-db-studio>
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# dsh-db-studio bundle patch.
|
|
2
|
+
#
|
|
3
|
+
# `dsh plugin --profile <name> add dsh-db-studio` reads this file and appends the
|
|
4
|
+
# row below to the profile's bundle stack. The `name` is the npm package name,
|
|
5
|
+
# so Node module resolution finds the installed package.
|
|
6
|
+
- insert:
|
|
7
|
+
- id: db-studio
|
|
8
|
+
name: dsh-db-studio
|
|
9
|
+
config:
|
|
10
|
+
demo: true
|
|
11
|
+
allowWrite: true
|
|
Binary file
|
package/docs/demo.gif
ADDED
|
Binary file
|
package/docs/panel.png
ADDED
|
Binary file
|