@yejiming/dsh-data-agent 0.1.0 → 0.1.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/README.en.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  <p align="center">
28
28
 
29
- [Project Overview](#project-overview) · [Ecosystem Status](#ecosystem-specification-status) · [Features](#features) · [Quick Install](#quick-install) · [Web UI](#using-data-agent-in-the-web-ui) · [dsh-tui](#using-data-agent-in-dsh-tui) · [Security](#security)
29
+ [Project Overview](#project-overview) · [Features](#features) · [Quick Install](#quick-install) · [Web UI](#using-data-agent-in-the-web-ui) · [dsh-tui](#using-data-agent-in-dsh-tui) · [Security](#security) · [Local Development](#local-development) · [Ecosystem Status](#ecosystem-specification-status)
30
30
 
31
31
  </p>
32
32
 
@@ -36,29 +36,13 @@ dsh-data-agent is a data analysis plugin for DeepSeek Harness (DSH). Connect a d
36
36
 
37
37
  ![Data analysis charts](assets/charts.webp)
38
38
 
39
- ## Ecosystem Specification Status
40
-
41
- This package includes an experimental declaration for the [DSH Ecosystem Specification](https://github.com/T-Auto/dsh-ecosystem-spec) Community v0.15. It does not replace or double-register the existing Cordis behavior. The native bundle, preset, commands, tools, routes, Web UI, TUI form, and connection storage remain the sole functional implementation.
42
-
43
- | Item | Current status |
44
- | --- | --- |
45
- | Specification and stage | Community v0.15, Draft / Experimental |
46
- | Pinned baseline | `dsh-ecosystem-spec@ec80a4be5d92bbb971655afd0f097bb5586a1a28`; `dsh-std@614dfa1ac168db79fcf4577cf0ebb34e2e3b944b` |
47
- | Manifest | `dsh-plugin.json`, `manifestVersion: 0.15`, package identity `@yejiming/dsh-data-agent@0.1.0` |
48
- | Admission decision | The repository's eligible fixture is `compatible`; this is not an admission result from a real dsh-TUI Host |
49
- | Evidence level | `Parsed`; fixture negotiation is recorded only as `fixture-only` and does not become `Negotiated` evidence |
50
- | Exercised environment | Offline parser/projector/definition validation; disposable local mount/unmount with `@dsh-std/adapter-dsh@0.1.0-rc3` |
51
- | Artifact | The release identity is package name and version; a tarball SHA-256 is written only to an external sidecar after a real `npm pack`, never into the source manifest |
52
- | Unverified | Real Host Descriptor, real Web/Desktop/dsh-tui, real TTY, database, remote, attach/detach, multiple Presentation, `Observed`, and `Attested` evidence |
53
-
54
- Active restrictions include intentionally leaving `UserInteraction` undeclared because the pinned Community manifest cannot carry the requirement spec required by its dsh-std definition. Model tools, the agent preset, Cordis service, HTTP routes, Web slots, persistence domain, and local TTY remain native DSH behavior. During `@dsh-std/adapter-dsh` discovery, the ecosystem facet publishes only a degraded snapshot and no second Command, Tool, or UI handler.
55
-
56
- The plugin remains **trusted in-process** and is not sandboxed. Manifest permissions are Host admission contracts; they do not provide OS, process, or realm isolation. These results are not official DSH certification, security approval, a vulnerability-free guarantee, or a universal Host compatibility claim.
57
-
58
39
  ## Features
59
40
 
41
+ ![DSH Data Agent features: conversation, SQL, data governance, business insights, reports, and read-only protection](assets/dsh-data-agent-features.webp)
42
+
60
43
  - **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.
61
44
  - **Discover business insights automatically**: Data Agent goes beyond returning query results. It helps compare trends, locate anomalies, identify valuable customers or products, and turn the data into explanations that support decisions.
45
+ - **AI-assisted data governance**: Scan a database with the AI model configured in the current DSH session. Using tables, fields, comments, and relations, it generates candidate business meanings for every table and field. Every AI-generated candidate requires human review, and users can also add business terms and metric definitions manually. During later queries and analysis, Data Agent automatically reads the relevant definitions through the built-in `catalog-search`, `catalog-get`, and `metric-get` tools, grounding SQL and conclusions in governed business context.
62
46
  - **Cross-surface HTML reports (render-analysis)**: In an ordinary tool call, the agent can choose to produce a single chart or a Dashboard-style report (metric/line/bar/pie/scatter/table views). Every successful call saves an offline HTML file under `analysis-reports/` in the current workspace. Web also shows an inline preview and a “View analysis” Modal; dsh-tui returns the file path. Whether to chart remains the agent's decision — schema exploration, single scalars, and queries without visual value are never forced into charts.
63
47
  - **Shares the core path across Web UI and dsh-tui**: For a visual workflow, we recommend [zhu1090093659/dsh-web-ui](https://github.com/zhu1090093659/dsh-web-ui), where you can connect databases, browse schemas, and inspect results in the browser. For a keyboard-first workflow, we recommend [ccch1mneyyy/dsh-TUI](https://github.com/ccch1mneyyy/dsh-TUI), where you can use the same Data Mode, connect through `/database`, and move directly into conversational analysis. Both interfaces share the database service and tool protocol; validate the exact version and deployment separately.
64
48
  - **Connect common business databases**: Supports MySQL, PostgreSQL, SQLite, Oracle, Hive, Impala, ClickHouse, Apache Doris, and SQL Server across application databases, analytics systems, local data files, and data warehouses.
@@ -66,40 +50,23 @@ The plugin remains **trusted in-process** and is not sandboxed. Manifest permiss
66
50
  - **Stay focused with Data Mode**: The session uses DSH's native `str_replace_editor` for files and keeps `sql-query`, `sql-write`, `sql-cmd`, `render-analysis`, `catalog-search`, `catalog-get`, and `metric-get`; Web, Desktop, dsh-tui, and headless profiles use the same eight-tool protocol. Host or community tools such as `describe_image` and `ssh_*` do not leak into Data Mode.
67
51
  - **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.
68
52
 
69
- The Web UI also includes an on-demand database workbench. Click the database button in the top-right of the composer to use four tabs—Connection, Tables, Data Catalog, and SQL—in one Modal. The Data Catalog reads the independent persistent `data_agent_catalog@1` domain. Historical snapshots remain searchable after the live database disconnects; a new scan still requires a connection to the same stable profile.
70
-
71
- The SQL tab renders read-query results as a structured table with a sticky header, 100-row pages, and local horizontal scrolling for wide datasets. The complete loaded result can be exported as Excel (`.xlsx`), UTF-8 CSV, or copied to the clipboard, with a hard limit of 50,000 rows per query. Write/administrative commands and errors remain text messages instead of being misparsed as tables.
72
-
73
- ### Data Catalog and metric governance
53
+ ### Database Workbench
74
54
 
75
- A Catalog scan is an explicit human action. Its first stage reads database system catalogs only: it does not read business rows, persist sample rows, or run full-table `COUNT(*)` queries for exact counts. Its second stage uses the model currently configured in the initiating DSH session to generate table-level and field-level business-meaning candidates, one table at a time. The model receives only bounded technical metadatanames, types, nullable flags, database comments, keys, and relationsnot sample values, query results, or credentials. Web offers full-source, schema, and single-table scopes in the Data Catalog tab, with an extra confirmation for full scans. `/database` and `/catalog` are registered only when the current Cordis composition actually loads `@deepseek-harness-tui/dsh-tui`; the profile label is not consulted, so installing Data Agent or merely naming a profile `dsh-tui` never exposes them. A normal Web composition uses the database workbench instead. dsh-tui uses:
55
+ The Web UI also includes an on-demand database workbench. Click the database button in the top-right of the composer to use four tabsConnection, Tables, Data Governance, and SQL—in one Modal.
76
56
 
77
- Catalog metadata queries use an independent `catalogMaxResultChars` capture bound (32 MiB by default), so they no longer inherit the smaller `maxResultChars` budget used by ordinary SQL tools. Exceeding the Catalog-specific bound still fails safely with guidance to narrow the scope or adjust the configuration; a truncated snapshot is never published.
78
-
79
- ```text
80
- /catalog scan Choose a scope interactively; reconfirm a full scan
81
- /catalog scan --all Explicit full-source scan
82
- /catalog scan --schema sales Scan one schema
83
- /catalog scan --schema sales --table orders
84
- /catalog status [--run <run-id>]
85
- /catalog cancel [--run <run-id>]
86
- /catalog diff [--from <run-id> --to <run-id>]
87
- /catalog view Open the read-only full-screen Catalog browser
88
- ```
89
-
90
- Scans run in the background, with at most one active run per source. When dsh-tui exposes its public extension services, a persistent line above the prompt follows the real “technical metadata → Catalog publish → AI business meanings” phases. Success, partial success, and failure remain visible until the next scan or `/catalog view`, instead of disappearing with a short notification. `/catalog view` opens a read-only full-screen scene: tables/views are paged on the left, while the selected table's summary, fields, and AI business meanings appear on the right. It supports search, independently scrolling panes, business-schema/all-schema switching, refresh, and Escape to return. Older dsh-tui versions without the public status/scene services keep the scan commands and explicitly fall back to `/catalog status` and the Web Catalog.
57
+ ![Database workbench](assets/tables.webp)
91
58
 
92
- Results are stored by stable profile, asset identity, and immutable revision. Unchanged assets do not duplicate revisions. Only a complete successful technical scan may mark absent objects `missing`, and only inside its exact scope. Table/schema scans do not alter out-of-scope assets or the last-full-scan time. Reappearing assets become `restored`. Failed, cancelled, interrupted, or permission-incomplete metadata runs never replace the previous successful snapshot, and ambiguous permission failures are not treated as deletions. AI enrichment has separate queued, running, succeeded, partial, failed, and cancelled states. Model output remains bounded; if a full-table response reaches the token limit, the same model configuration automatically retries smaller field batches and persists only after every field is complete. An AI failure does not erase a committed technical snapshot or publish an incomplete result for a table.
59
+ ### Analyze Data Through Conversation
93
60
 
94
- Database facts are `observed`; AI-generated table/field meanings and candidate business terms or metrics are `inferred`. Only human review in Web can verify the current version as `verified`. The Data Catalog groups meanings by table and lets a user confirm or delete each table or field candidate. Delete creates an auditable retired revision, hides it from the default detail, and prevents later scans from reviving or overwriting the human decision. Structural changes mark affected definitions `needs_review` without auto-verifying them. For business analysis, the agent first uses read-only `catalog-search`, then `catalog-get` for technical context or `metric-get` for an exact metric version; it falls back to live schema inspection when the Catalog has no match. AI candidates, database comments, human text, and formulas are always untrusted reference data.
61
+ Choose Data Mode” when creating a session, and DSH will use the data-analysis workflow for everything that follows.
95
62
 
96
- The first release does not include scheduled scans, business-row sampling, AI auto-certification, external-catalog synchronization, complete lineage, Catalog-level RBAC, or physical deletion driven by a scan.
63
+ ![Data Mode preset](assets/settings.webp)
97
64
 
98
- ![Database workbench](assets/tables.webp)
65
+ ### Data Catalog and Metric Governance
99
66
 
100
- Choose Data Mode” when creating a session, and DSH will use the data-analysis workflow for everything that follows.
67
+ In Web, open Data Governance, choose a source and scan scope, then click Scan. Search or compare results, review AI meanings, and add terms or metrics. Full scans require confirmation.
101
68
 
102
- ![Data Mode preset](assets/settings.webp)
69
+ ![Data governance: AI-generated business meanings for tables and fields with human review](assets/data-governance.png)
103
70
 
104
71
  ## Quick Install
105
72
 
@@ -184,7 +151,7 @@ After connecting, return to the chat input and ask a business question. Other us
184
151
  /catalog view Open read-only Catalog results grouped by table
185
152
  ```
186
153
 
187
- You do not need to repeat `/catalog status` after a scan starts: the line above the prompt follows technical collection and AI-enrichment progress, then retains the final success/failure state. After completion, run `/catalog view`; use arrows or `j/k` to select and scroll, Tab or ←/→ to switch panes, `/` to search, `a` to switch between the business schema and all schemas, `r` to refresh, and Escape to return. The TUI remains read-only; confirm or delete AI candidates one at a time from Web's Data Catalog.
154
+ You do not need to repeat `/catalog status` after a scan starts: the line above the prompt follows technical collection and AI-enrichment progress, then retains the final success/failure state. After completion, run `/catalog view`; use arrows or `j/k` to select and scroll, Tab or ←/→ to switch panes, `/` to search, `a` to switch between the business schema and all schemas, `r` to refresh, and Escape to return. The TUI remains read-only; confirm or delete AI candidates one at a time from Web's Data Governance tab.
188
155
 
189
156
  After the agent generates a report, the tool card shows dataset, view, empty-data facts, and the absolute HTML path. TUI does not print a character Dashboard and does not register `/analysis`; open the HTML in a local browser to inspect all six view types and raw data. The file belongs to that tool call, and `/resume` does not re-query the database.
190
157
 
@@ -223,6 +190,8 @@ The plugin tries the active profile process PATH first. If that fails, it also c
223
190
 
224
191
  MySQL and Doris invocations include `--default-character-set=utf8mb4` by default, preventing Windows code pages from corrupting Chinese database, table, column, or query-result text before it reaches DSH. You do not need to repeat this argument in the profile.
225
192
 
193
+ Schema and table names used for metadata browsing may contain Unicode letters, combining marks, numbers, `_`, and `$`; column names returned by the database are displayed unchanged. For example, a SQLite table named `中文表名` with a `姓名` column can be browsed directly in the workbench. To keep the metadata SQL boundary explicit, whitespace, controls, quotes, backticks, backslashes, semicolons, dots, hyphens, and other punctuation in schema or table inputs are still rejected before a database client starts.
194
+
226
195
  SQL Server reads use T-SQL `TOP` or an existing `OFFSET ... FETCH` clause and never append `LIMIT`. To prevent `sqlcmd` scripting from crossing the SQL boundary, `GO`, `!!`, colon commands, and `$(...)` substitutions are rejected before the client starts. The plugin does not add `-C` or another trust-server-certificate option by default.
227
196
 
228
197
  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, or use `args` for other CLI arguments. The current profile PATH always wins, and `searchPaths` is checked before platform defaults:
@@ -291,9 +260,24 @@ The prebuilt `lib/` directory is committed to the repository, so npm and GitHub
291
260
 
292
261
  Upgrading the specification baseline requires an explicit update to both revisions and pinned digests in `conformance/dsh-ecosystem/baseline.json`, offline conformance against the matching local checkouts, review of inventory/restriction drift, and a complete build and test run. Generate release evidence with `pnpm conformance:artifact --output-dir <outside-worktree-directory>` so a real `npm pack` tarball produces an external sidecar. Documentation and claims must stay within the weakest verified evidence level in that sidecar.
293
262
 
294
- ## License
263
+ ## Ecosystem Specification Status
295
264
 
296
- MIT
265
+ This package includes an experimental declaration for the [DSH Ecosystem Specification](https://github.com/T-Auto/dsh-ecosystem-spec) Community v0.15. It does not replace or double-register the existing Cordis behavior. The native bundle, preset, commands, tools, routes, Web UI, TUI form, and connection storage remain the sole functional implementation.
266
+
267
+ | Item | Current status |
268
+ | -------------------------| --------------------------------------------------------------------------------------------------------------------------------------------------------------------|
269
+ | Specification and stage | Community v0.15, Draft / Experimental |
270
+ | Pinned baseline | `dsh-ecosystem-spec@ec80a4be5d92bbb971655afd0f097bb5586a1a28`; `dsh-std@614dfa1ac168db79fcf4577cf0ebb34e2e3b944b` |
271
+ | Manifest | `dsh-plugin.json`, `manifestVersion: 0.15`, package identity `@yejiming/dsh-data-agent@0.1.2` |
272
+ | Admission decision | The repository's eligible fixture is `compatible`; this is not an admission result from a real dsh-TUI Host |
273
+ | Evidence level | `Parsed`; fixture negotiation is recorded only as `fixture-only` and does not become `Negotiated` evidence |
274
+ | Exercised environment | Offline parser/projector/definition validation; disposable local mount/unmount with `@dsh-std/adapter-dsh@0.1.0-rc3` |
275
+ | Artifact | The release identity is package name and version; a tarball SHA-256 is written only to an external sidecar after a real `npm pack`, never into the source manifest |
276
+ | Unverified | Real Host Descriptor, real Web/Desktop/dsh-tui, real TTY, database, remote, attach/detach, multiple Presentation, `Observed`, and `Attested` evidence |
277
+
278
+ Active restrictions include intentionally leaving `UserInteraction` undeclared because the pinned Community manifest cannot carry the requirement spec required by its dsh-std definition. Model tools, the agent preset, Cordis service, HTTP routes, Web slots, persistence domain, and local TTY remain native DSH behavior. During `@dsh-std/adapter-dsh` discovery, the ecosystem facet publishes only a degraded snapshot and no second Command, Tool, or UI handler.
279
+
280
+ The plugin remains **trusted in-process** and is not sandboxed. Manifest permissions are Host admission contracts; they do not provide OS, process, or realm isolation. These results are not official DSH certification, security approval, a vulnerability-free guarantee, or a universal Host compatibility claim.
297
281
 
298
282
  ## Related Links
299
283
 
@@ -301,3 +285,7 @@ MIT
301
285
  - [dsh-web-ui](https://github.com/dsh-external/dsh-web-ui): An extensible Web UI for DeepSeek Harness, with browser-based interaction and a plugin and theme ecosystem
302
286
  - [dsh-cc-tui](https://github.com/dsh-external/dsh-cc-tui): A keyboard-first, full-screen terminal interface for DeepSeek Harness, designed for efficient conversational development workflows
303
287
  - [platonai/Browser4](https://github.com/platonai/Browser4): an AI-native browser engine for autonomous agents, intelligent extraction, and large-scale web automation.
288
+
289
+ ## License
290
+
291
+ MIT
package/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  <p align="center">
28
28
 
29
- [项目简介](#项目简介) · [生态规范状态](#生态规范状态) · [主要功能](#主要功能) · [快速安装](#快速安装) · [Web UI](#在web-ui中使用) · [dsh-tui](#在dsh-tui中使用) · [安全说明](#安全说明)
29
+ [项目简介](#项目简介) · [主要功能](#主要功能) · [快速安装](#快速安装) · [Web UI](#在web-ui中使用) · [dsh-tui](#在dsh-tui中使用) · [安全说明](#安全说明) · [本地开发](#本地开发) · [生态规范状态](#生态规范状态)
30
30
 
31
31
  </p>
32
32
 
@@ -36,29 +36,13 @@ dsh-data-agent是DeepSeek Harness(DSH)的数据分析插件。连接数据
36
36
 
37
37
  ![数据分析图表](assets/charts.webp)
38
38
 
39
- ## 生态规范状态
40
-
41
- 本包附带一层实验性的 [DSH Ecosystem Specification](https://github.com/T-Auto/dsh-ecosystem-spec) Community v0.15 声明。它不会替代或重复注册现有 Cordis 功能;原生 bundle、preset、命令、工具、路由、Web UI、TUI 表单和连接存储仍是唯一功能实现。
42
-
43
- | 项目 | 当前状态 |
44
- | --- | --- |
45
- | 规范与阶段 | Community v0.15,Draft / Experimental |
46
- | 固定基线 | `dsh-ecosystem-spec@ec80a4be5d92bbb971655afd0f097bb5586a1a28`;`dsh-std@614dfa1ac168db79fcf4577cf0ebb34e2e3b944b` |
47
- | Manifest | `dsh-plugin.json`,`manifestVersion: 0.15`,包身份 `@yejiming/dsh-data-agent@0.1.0` |
48
- | 准入结果 | 仓库内 eligible fixture 为 `compatible`;这不是实际 dsh-TUI Host 的准入结论 |
49
- | 证据等级 | `Parsed`;fixture negotiation 只记录为 `fixture-only`,不提升为 `Negotiated` |
50
- | 已执行环境 | 离线 parser/projector/definition 校验;`@dsh-std/adapter-dsh@0.1.0-rc3` 一次性本地 fixture 挂载/卸载 |
51
- | Artifact | 发布物身份为包名和版本;tarball SHA-256 只在真实 `npm pack` 后写入工作树外 sidecar,不嵌入 source manifest |
52
- | 未验证 | 真实 Host Descriptor、真实 Web/Desktop/dsh-tui、真实 TTY、数据库、remote、attach/detach、多 Presentation、`Observed`、`Attested` |
53
-
54
- 主要限制包括:`UserInteraction` 因固定 Community manifest 无法携带 dsh-std definition 所需 requirement spec 而暂不声明;模型工具、agent preset、Cordis service、HTTP routes、Web slots、持久化域和本地 TTY 仍由原生 DSH 路径拥有。安装 `@dsh-std/adapter-dsh` 进行发现时,生态 facet 只发布降级快照,不发布第二个 Command、Tool 或 UI handler。
55
-
56
- 该插件仍是 **trusted in-process**、非沙箱代码。Manifest permission 是 Host 的准入契约,不提供 OS、进程或 realm 隔离。上述结果不代表 DSH 官方认证、安全批准、无漏洞保证或对所有 Host 的普遍兼容承诺。
57
-
58
39
  ## 主要功能
59
40
 
41
+ ![DSH Data Agent主要功能:对话、SQL、数据治理、商业洞察、分析报告与只读保护](assets/dsh-data-agent-features.webp)
42
+
60
43
  - **通过对话完成数据分析**:直接用自然语言描述目标,DSH会理解问题、拆解分析步骤、查询真实数据并整理结论。你可以继续追问,分析会沿着当前上下文逐步深入。
61
44
  - **自动寻找商业洞察**:不仅返回查询结果,还能帮助比较趋势、定位异常、识别高价值客户或商品,并把数据转化为便于业务决策的说明。
45
+ - **AI驱动的数据治理**:使用当前DSH会话配置的AI模型扫描数据库,根据库表、字段、注释和关系,为每张表及每个字段生成业务含义候选。所有AI候选都需要人工确认,用户也可以人工补充业务术语和指标定义。后续查询分析时,数据Agent会通过内置的`catalog-search`、`catalog-get`和`metric-get`工具自动读取相关业务定义,让SQL和分析结论基于经过治理的业务口径。
62
46
  - **跨界面HTML分析报告(render-analysis)**:Agent可在普通工具调用里自主生成单图或Dashboard式综合分析报告(metric/line/bar/pie/scatter/table视图)。每次成功调用都会在当前工作目录的`analysis-reports/`中保存一份离线可打开的HTML;Web同时提供内联预览与“查看分析”Modal,dsh-tui直接返回文件路径。是否画图由Agent按问题判断,schema探查、单标量等查询不会被强制生成图表。
63
47
  - **共享Web UI与dsh-tui核心路径**:喜欢可视化操作时,可以在Web界面连接数据库、浏览库表和查看结果,推荐使用[zhu1090093659/dsh-web-ui](https://github.com/zhu1090093659/dsh-web-ui);习惯键盘工作流时,可以在终端中使用同一“数据模式”,通过`/database`完成连接,然后直接开始对话分析,推荐使用[ccch1mneyyy/dsh-TUI](https://github.com/ccch1mneyyy/dsh-TUI)。两种界面共享数据Agent的数据库服务和工具协议;具体版本与部署仍应分别验证。
64
48
  - **连接常见业务数据库**:支持MySQL、PostgreSQL、SQLite、Oracle、Hive、Impala、ClickHouse、Apache Doris和SQL Server,可用于业务系统、分析库、本地数据文件及数仓场景。
@@ -66,40 +50,23 @@ dsh-data-agent是DeepSeek Harness(DSH)的数据分析插件。连接数据
66
50
  - **专注数据任务的数据模式**:会话使用DSH原生`str_replace_editor`处理文件,并保留`sql-query`、`sql-write`、`sql-cmd`、`render-analysis`、`catalog-search`、`catalog-get`与`metric-get`;Web、Desktop、dsh-tui和headless profile使用同一套八工具协议。`describe_image`、`ssh_*`等宿主或社区插件工具不会进入数据模式。
67
51
  - **安全地使用真实数据**:支持只读模式和数据库只读账号;TUI密码会被隐藏,且不会作为表单草稿恢复。是否允许修改数据由你决定。
68
52
 
69
- Web UI还提供按需数据库工作台:点击输入框右上角的数据库按钮,即可在同一个Modal的“连接配置、库表、数据目录、SQL”四个页签中配置连接、浏览结构、治理口径或临时运行SQL。“数据目录”读取独立的`data_agent_catalog@1`持久化域;只要存在历史snapshot,断开实时数据库后仍可搜索和查看,重新扫描则必须连接到同一个稳定Profile。
70
-
71
- SQL命令页会把读查询结果显示为带固定表头的结构化表格,并按100行分页,宽表可在结果区内横向滚动。当前结果可导出为Excel(`.xlsx`)、UTF-8 CSV或复制到剪贴板;三种导出都包含已加载的完整结果,单次最多50,000行。写入/管理命令及错误仍显示为文本消息,不会被误解析成表格。
72
-
73
- ### 数据目录与口径治理
53
+ ### 数据库工作台
74
54
 
75
- Catalog扫描是显式人工动作。第一阶段只读取数据库系统目录,不读取业务明细、不保存样例行,也不会为精确行数执行全表`COUNT(*)`;第二阶段调用发起扫描的DSH会话当前配置模型,按表生成表级和字段级业务含义候选。发送给模型的只有表/字段名称、类型、nullable、数据库注释、键和关系等有界技术元数据,不包含样例值、查询结果或凭据。Web可在“数据目录”页选择全库、Schema或单表范围;全库扫描需要二次确认。`/database`和`/catalog`只在当前Cordis组合实际加载`@deepseek-harness-tui/dsh-tui`插件时注册;Profile名称不参与判断,仅安装Data Agent或把Profile命名为`dsh-tui`都不会暴露命令。普通Web组合不展示这两个命令,而是在数据库工作台中完成连接和扫描。dsh-tui使用:
55
+ Web UI还提供按需数据库工作台:点击输入框右上角的数据库按钮,即可在同一个Modal的“连接配置、库表、数据治理、SQL”四个页签中配置连接、浏览结构、治理口径或临时运行SQL。
76
56
 
77
- Catalog元数据查询使用独立的`catalogMaxResultChars`捕获上限(默认32 MiB),不会再受普通SQL工具较小的`maxResultChars`限制;超过Catalog专属上限时仍会安全失败,并提示缩小扫描范围或调整配置,不会发布被截断的snapshot。
78
-
79
- ```text
80
- /catalog scan 交互选择范围;选择全库时再次确认
81
- /catalog scan --all 显式全库扫描
82
- /catalog scan --schema sales 扫描一个Schema
83
- /catalog scan --schema sales --table orders
84
- /catalog status [--run <run-id>]
85
- /catalog cancel [--run <run-id>]
86
- /catalog diff [--from <run-id> --to <run-id>]
87
- /catalog view 打开只读全屏目录浏览器
88
- ```
89
-
90
- 扫描在后台运行,同一个source同时只允许一个活动run。在提供公开扩展接口的dsh-tui中,输入框上方会持续显示“技术元数据采集 → 目录发布 → AI业务含义”的实际进度;成功、部分成功或失败终态会一直保留到下一次扫描或打开`/catalog view`,不再依赖短暂通知。`/catalog view`使用全屏只读场景:左侧按表/视图分页,右侧展示表级说明、字段类型与字段级AI业务含义,支持搜索、左右独立滚动、业务Schema/全部Schema切换和刷新;按Esc返回。旧版dsh-tui没有公开状态/scene服务时,扫描命令仍可用,并明确回退到`/catalog status`和Web数据目录。
57
+ ![数据库工作台](assets/tables.webp)
91
58
 
92
- 结果按稳定Profile、资产身份和不可变revision保存:未变化对象不复制revision;完整成功的技术扫描只在其精确范围内把消失对象标记为`missing`;单表/Schema扫描不会改动范围外对象,也不会更新最近全库扫描时间;对象重新出现时记录为`restored`。元数据失败、取消、中断或权限不完整的run不会覆盖上一份成功snapshot,权限不确定时也不会把对象误判为删除。AI阶段具有独立的排队、运行、成功、部分成功、失败和取消状态;模型输出保持有界,整表输出触及token上限时会沿用当前模型配置并自动按字段分批重试,只有整张表的字段结果齐全后才写入。AI失败不会抹掉已经成功提交的技术snapshot,也不会把不完整表结果写成候选。
59
+ ### 通过对话完成数据分析
93
60
 
94
- 数据库事实是`observed`,AI生成的表/字段业务含义以及候选业务术语/指标是`inferred`;只有Web中的人工审核可以基于当前version确认成`verified`。数据目录按表展示表级说明和每个字段说明,用户可以逐项确认或删除;删除会保留审计revision并从默认详情隐藏,后续扫描不会自动复活或覆盖已确认/已删除决策。结构变化会把受影响口径标为`needs_review`,不会自动确认。Agent分析业务问题时先用只读`catalog-search`查找目录,再用`catalog-get`读取技术上下文或`metric-get`读取精确指标版本;目录无命中时再回退到实时Schema探查。目录中的AI候选、数据库注释、人工说明和公式都按不可信参考文本处理。
61
+ 创建会话时选择“数据模式”,DSH就会以数据分析工作流处理后续问题。
95
62
 
96
- 首版不包含定时扫描、业务明细采样、AI自动认证、外部Catalog同步、完整血缘、Catalog级RBAC或扫描结果物理删除。
63
+ ![数据模式预设](assets/settings.webp)
97
64
 
98
- ![数据库工作台](assets/tables.webp)
65
+ ### 数据治理
99
66
 
100
- 创建会话时选择“数据模式”,DSH就会以数据分析工作流处理后续问题。
67
+ 在Web数据库工作台打开“数据治理”页,选择数据源和扫描范围(全库、Schema或单表),点击“扫描”;全库扫描需再次确认。完成后可搜索表、字段、术语或指标,查看版本变化,并逐项确认或删除AI生成的表/字段业务含义,也可人工新增业务术语和指标定义。后续分析会自动参考已保存的口径。
101
68
 
102
- ![数据模式预设](assets/settings.webp)
69
+ ![数据治理:AI生成表和字段业务含义,并由用户审核](assets/data-governance.png)
103
70
 
104
71
  ## 快速安装
105
72
 
@@ -184,7 +151,7 @@ dsh --profile dsh-tui
184
151
  /catalog view 打开按表组织的只读Catalog结果
185
152
  ```
186
153
 
187
- 扫描开始后无需反复执行`/catalog status`:输入框上方会持续显示技术采集和AI业务含义进度,并保留最终成功/失败状态。完成后执行`/catalog view`,使用↑↓或`j/k`选择表、Tab或←→切换左右区域、`/`搜索、`a`切换业务Schema/全部Schema、`r`刷新、Esc返回。TUI只提供读取;AI候选的确认与删除仍在Web“数据目录”中逐项完成。
154
+ 扫描开始后无需反复执行`/catalog status`:输入框上方会持续显示技术采集和AI业务含义进度,并保留最终成功/失败状态。完成后执行`/catalog view`,使用↑↓或`j/k`选择表、Tab或←→切换左右区域、`/`搜索、`a`切换业务Schema/全部Schema、`r`刷新、Esc返回。TUI只提供读取;AI候选的确认与删除仍在Web“数据治理”页逐项完成。
188
155
 
189
156
  Agent生成分析报告后,工具卡会显示数据集、视图、空数据摘要与HTML绝对路径。TUI不会输出字符Dashboard,也没有`/analysis`命令;直接在本机浏览器中打开该HTML即可查看六类视图和原始数据。文件来自本次工具调用,`/resume`不会重新查询数据库。
190
157
 
@@ -222,6 +189,8 @@ DSH运行查询时需要本机能够访问目标数据库,并安装相应的
222
189
 
223
190
  插件调用MySQL或Doris客户端时会内置`--default-character-set=utf8mb4`,确保Windows代码页不会使库名、表名、字段名或查询结果中的中文在进入DSH前乱码,无需在profile中重复配置该参数。
224
191
 
192
+ 库表元数据浏览支持由Unicode字母、组合标记、数字以及`_`、`$`组成的schema和表名,数据库返回的字段名会原样展示。例如SQLite中的`中文表名`及其`姓名`字段可以直接在工作台中浏览。为保持元数据SQL边界明确,schema和表名中的空白、控制字符、引号、反引号、反斜杠、分号、点号、连字符及其他标点仍会在启动数据库客户端前被拒绝。
193
+
225
194
  SQL Server查询使用T-SQL `TOP`或已有的`OFFSET ... FETCH`限行,绝不会追加`LIMIT`。为避免`sqlcmd`自身脚本能力绕过SQL边界,输入中的`GO`、`!!`、冒号命令和`$(...)`变量替换会在启动客户端前被拒绝。插件不会默认添加`-C`或其他“信任服务器证书”选项。
226
195
 
227
196
  如果客户端安装在公司工具链或其他自定义目录,可在当前profile的`data-agent`配置中补充搜索目录;需要锁定具体版本时则直接填写绝对命令路径,也可通过`args`添加其他CLI参数。当前profile的PATH始终优先,`searchPaths`在系统常见目录之前:
@@ -290,9 +259,24 @@ pnpm conformance
290
259
 
291
260
  升级规范基线必须显式更新`conformance/dsh-ecosystem/baseline.json`中的两个revision和固定digest,使用对应的本地checkout离线运行conformance,复核inventory/restriction漂移,并重新执行完整构建与测试。发布证据应运行`pnpm conformance:artifact --output-dir <工作树外目录>`,从真实`npm pack` tarball生成外部sidecar;文档和claim不得超过其中最弱的已验证证据等级。
292
261
 
293
- ## 许可
262
+ ## 生态规范状态
294
263
 
295
- MIT
264
+ 本包附带一层实验性的 [DSH Ecosystem Specification](https://github.com/T-Auto/dsh-ecosystem-spec) Community v0.15 声明。它不会替代或重复注册现有 Cordis 功能;原生 bundle、preset、命令、工具、路由、Web UI、TUI 表单和连接存储仍是唯一功能实现。
265
+
266
+ | 项目 | 当前状态 |
267
+ | --- | --- |
268
+ | 规范与阶段 | Community v0.15,Draft / Experimental |
269
+ | 固定基线 | `dsh-ecosystem-spec@ec80a4be5d92bbb971655afd0f097bb5586a1a28`;`dsh-std@614dfa1ac168db79fcf4577cf0ebb34e2e3b944b` |
270
+ | Manifest | `dsh-plugin.json`,`manifestVersion: 0.15`,包身份 `@yejiming/dsh-data-agent@0.1.2` |
271
+ | 准入结果 | 仓库内 eligible fixture 为 `compatible`;这不是实际 dsh-TUI Host 的准入结论 |
272
+ | 证据等级 | `Parsed`;fixture negotiation 只记录为 `fixture-only`,不提升为 `Negotiated` |
273
+ | 已执行环境 | 离线 parser/projector/definition 校验;`@dsh-std/adapter-dsh@0.1.0-rc3` 一次性本地 fixture 挂载/卸载 |
274
+ | Artifact | 发布物身份为包名和版本;tarball SHA-256 只在真实 `npm pack` 后写入工作树外 sidecar,不嵌入 source manifest |
275
+ | 未验证 | 真实 Host Descriptor、真实 Web/Desktop/dsh-tui、真实 TTY、数据库、remote、attach/detach、多 Presentation、`Observed`、`Attested` |
276
+
277
+ 主要限制包括:`UserInteraction` 因固定 Community manifest 无法携带 dsh-std definition 所需 requirement spec 而暂不声明;模型工具、agent preset、Cordis service、HTTP routes、Web slots、持久化域和本地 TTY 仍由原生 DSH 路径拥有。安装 `@dsh-std/adapter-dsh` 进行发现时,生态 facet 只发布降级快照,不发布第二个 Command、Tool 或 UI handler。
278
+
279
+ 该插件仍是 **trusted in-process**、非沙箱代码。Manifest permission 是 Host 的准入契约,不提供 OS、进程或 realm 隔离。上述结果不代表 DSH 官方认证、安全批准、无漏洞保证或对所有 Host 的普遍兼容承诺。
296
280
 
297
281
  ## 友情链接
298
282
 
@@ -300,3 +284,7 @@ MIT
300
284
  - [dsh-web-ui](https://github.com/dsh-external/dsh-web-ui):DeepSeek Harness的可扩展Web UI,支持浏览器端交互以及插件与主题扩展
301
285
  - [dsh-cc-tui](https://github.com/dsh-external/dsh-cc-tui):面向DeepSeek Harness的键盘优先全屏终端界面,适用于高效的对话式开发工作流
302
286
  - [platonai/Browser4](https://github.com/platonai/Browser4):面向自主智能体、智能信息抽取与大规模Web自动化的AI原生浏览器引擎
287
+
288
+ ## 许可
289
+
290
+ MIT
package/dsh-plugin.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifestVersion": "0.15",
4
4
  "id": "io.github.omdsh-dev.dsh-data-agent",
5
5
  "name": "DSH Data Agent",
6
- "version": "0.1.0",
6
+ "version": "0.1.2",
7
7
  "facets": {
8
8
  "host": {
9
9
  "entry": "lib/ecosystem.js",
@@ -1,4 +1,4 @@
1
- import { b as DATABASE_TYPES, r as redactSecretText } from "./connections-CFXOZTHZ.js";
1
+ import { b as DATABASE_TYPES, r as redactSecretText } from "./connections-dGPjgsGg.js";
2
2
  import { a as catalogSemanticRevisionId, c as normalizeCatalogIdentifier, i as catalogSemanticId, l as normalizeCatalogText, n as catalogAssetId, o as catalogSourceId, r as catalogRevisionId, s as catalogTechnicalFingerprint, t as canonicalCatalogIdentity, u as stableJson } from "./catalog-identity-CVftmvQL.js";
3
3
  import { createHash } from "node:crypto";
4
4
  import { basename } from "node:path";