@yejiming/dsh-data-agent 0.0.5 → 0.0.6
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 +6 -6
- package/README.md +5 -5
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/preset/data-agent/preset.yml +1 -1
package/README.en.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[中文](README.md) | **English**
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
This plugin is a Data Agent built on DeepSeek Harness, letting DeepSeek focus on database operations.
|
|
8
8
|
|
|
9
|
-
Leveraging the agent-preset capability of DeepSeek Harness, it adds a Data
|
|
9
|
+
Leveraging the agent-preset capability of DeepSeek Harness, it adds a Data Mode preset. The preset keeps only the three DSH built-in tools — read, edit, write — and adds custom sql-query / sql-write / sqlcmd database tools in place of the bash tool, free from irrelevant tools and prompts.
|
|
10
10
|
|
|
11
11
|
With this preset, you can configure a database connection right in the conversation UI, grant the AI access to the database, and complete CRUD operations.
|
|
12
12
|
|
|
@@ -18,11 +18,11 @@ With this preset, you can configure a database connection right in the conversat
|
|
|
18
18
|
|
|
19
19
|
- **Database workbench** (embedded above the session's input bar): connection config card (collapses into a summary row after connecting, expandable for review); schema explorer (a "Tables" button opens a Modal — single-click a database to expand its scrollable table list, click a table to inspect its columns); SQL command box (write and run SQL on the non-agent channel, monospace output). The connection config is persisted to browser localStorage — switching pages or restarting restores the form and auto-reconnects. Once the conversation starts, the workbench becomes the left column and the chat records + input bar sit on the right.
|
|
20
20
|
- **Database tools**: `sql-query` runs read-only SQL and returns structured `{ columns, rows, affectedRows, elapsedMs }`; `sql-write` runs one write/management SQL per call with explicit autocommit semantics; `sqlcmd` keeps the original raw terminal output. All three run through the database clients (mysql / psql / sqlite3 / sqlplus / beeline / impala-shell); no shell layer (argv arrays + SQL via stdin), timeouts terminate the process tree, output is bounded and truncated, and one call carries at most one SQL statement.
|
|
21
|
-
- **Data
|
|
21
|
+
- **Data Mode preset**: choose "Data Mode" when creating a session — the tool surface is `sql-query`/`sql-write`/`sqlcmd`/`read`/`write`/`edit`, and every other project tool (bash, grep, skill, todo, goal, web, subagent, …) is simply absent, i.e. disabled; non-Data-Mode sessions render no workbench at all.
|
|
22
22
|
|
|
23
|
-

|
|
24
24
|
|
|
25
|
-
- **Standard agent loop**: a data-
|
|
25
|
+
- **Standard agent loop**: a data-mode session is an ordinary DSH session — standard turn/step, streaming, tool scheduling, and persistence, with zero host changes.
|
|
26
26
|
|
|
27
27
|
## Quick Install
|
|
28
28
|
|
|
@@ -56,7 +56,7 @@ Start the Web GUI:
|
|
|
56
56
|
dsh --profile web
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
In the Web GUI: create a session → choose the "Data
|
|
59
|
+
In the Web GUI: create a session → choose the "Data Mode" preset → the database workbench appears above the input bar → fill in the connection info (type/host/port/user/password/database; SQLite uses a file path) → after connecting, browse schemas (single-click a database to expand tables, click a table for its structure) or run SQL directly in the command box → once the conversation starts the workbench moves to the left; in Chat ask the AI to "list all tables and count rows" or "write a SQL query for orders in the last 30 days, save it to orders.sql and run it".
|
|
60
60
|
|
|
61
61
|
> Database client binaries: sqlite3 usually ships with macOS/Linux; mysql / psql / sqlplus / beeline / impala-shell must be provided by the deployment and can be overridden per type via the `clients` config (missing clients are named in the connect error).
|
|
62
62
|
|
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.en.md) | **中文**
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
用AI写过SQL的同学都有这种体验,AI现在写代码能力已经很强了,但SQL逻辑老写不对。**原因是AI并没有与数据库操作形成Agent Loop**,它只能根据静态指令生成SQL,却无法感知执行结果、无法根据报错或返回数据动态调优。
|
|
8
8
|
|
|
9
9
|
这个插件就是来填这个坑的。它复用DeepSeek Harness强大的Agent主循环能力,让AI连上数据库并获得实时反馈,同时删掉所有跟数据无关的上下文和工具,让AI专注于SQL生成和业务数据分析。
|
|
10
10
|
|
|
11
|
-
我利用DeepSeek Harness的Agent
|
|
11
|
+
我利用DeepSeek Harness的Agent预设功能,定义了专用的数据模式预设。仅保留read、edit、write三个DSH自带的 tools,并自定义 sql-query / sql-write / sqlcmd 三个数据库 tools 替代 bash tool。
|
|
12
12
|
|
|
13
13
|
懂行的朋友一眼就能看出,这是借鉴了Pi Agent的设计,只使用最基本的工具。
|
|
14
14
|
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
|
|
24
24
|

|
|
25
25
|
- **数据库 tools**:`sql-query` 执行只读 SQL 并返回结构化 `{ columns, rows, affectedRows, elapsedMs }`;`sql-write` 执行写/管理 SQL(单条自动提交,写语义明确);`sqlcmd` 保留原始终端输出。三者均在数据库客户端(mysql / psql / sqlite3 / sqlplus / beeline / impala-shell)执行;无 shell 层(argv 数组化 + SQL 走 stdin),超时自动终止进程树,输出有界截断,单次调用只允许一条 SQL。
|
|
26
|
-
-
|
|
26
|
+
- **数据模式 预设**:新建会话可选「数据模式」——工具面为 `sql-query`/`sql-write`/`sqlcmd`/`read`/`write`/`edit`,项目其他工具(bash、grep、skill、todo、goal、web、subagent 等)全部缺席即禁用;非数据模式会话不渲染工作台,零影响。
|
|
27
27
|
|
|
28
|
-

|
|
29
29
|
- **标准 agent loop**:data-agent 会话就是普通 DSH 会话,走标准 turn/step、流式输出、工具调度与持久化,零宿主改动。
|
|
30
30
|
|
|
31
31
|
## 快速安装
|
|
@@ -60,7 +60,7 @@ ls $DSH_HOME/.agent-presets/data-agent/ # 应有 agent.cordis.yml + preset.yml
|
|
|
60
60
|
dsh --profile web
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
在 Web GUI 中:新建会话 →
|
|
63
|
+
在 Web GUI 中:新建会话 → 选择「数据模式」预设 → 输入框上方出现数据库工作台 → 填写连接信息(类型/主机/端口/用户/密码/库名;SQLite 填文件路径)→ 连接成功后浏览库表(单击库展开表、点击表看结构),或在 SQL 命令框直接运行 SQL → 开始对话后工作台移到左侧,在 Chat 让 AI「列出所有表并统计行数」或「写一条 SQL 查出近 30 天订单,保存到 orders.sql 并执行」。
|
|
64
64
|
|
|
65
65
|
> 数据库客户端二进制要求:sqlite3 一般系统自带(macOS/Linux);mysql / psql / sqlplus / beeline / impala-shell 需部署方安装,且可在插件配置 `clients` 中覆盖命令名或绝对路径(缺失时连接报错会点名缺失的命令)。
|
|
66
66
|
|
package/lib/index.js
CHANGED
|
@@ -117,7 +117,7 @@ async function installPreset(ctx, presetId) {
|
|
|
117
117
|
await cp(sourceDir, targetDir, { recursive: true });
|
|
118
118
|
ctx.logger.info("data-agent: installed preset \"%s\" to %s", presetId, targetDir);
|
|
119
119
|
} catch (error) {
|
|
120
|
-
ctx.logger.warn("data-agent: failed to install preset \"%s\" to %s (%s); copy preset/data-agent/ manually to enable the
|
|
120
|
+
ctx.logger.warn("data-agent: failed to install preset \"%s\" to %s (%s); copy preset/data-agent/ manually to enable the 数据模式 preset", presetId, targetDir, error instanceof Error ? error.message : String(error));
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yejiming/dsh-data-agent",
|
|
3
3
|
"description": "Data Agent for the dsh web GUI: session-scoped database connections (MySQL/PostgreSQL/SQLite), the sqlcmd tool, the data-agent agent preset, and the database conversation-view tab",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|