dsh-data-cleaning-agent 0.9.3 → 0.9.4
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 +4 -0
- package/README.en.md +1 -1
- package/README.md +2 -2
- package/lib/artifact-preview.js +17 -0
- package/lib/web.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.en.md
CHANGED
|
@@ -10,7 +10,7 @@ Related agents: [数据清洗补全](https://github.com/duhu2000/dsh-data-cleani
|
|
|
10
10
|
|
|
11
11
|
> A data cleaning & completion agent plugin for DeepSeek Harness: local CSV/XLSX/JSON engine plus optional Qichacha (QCC) MCP enterprise-data enrichment. Initiated and maintained by the Qichacha (QCC) team.
|
|
12
12
|
>
|
|
13
|
-
> Current source version / 当前源码版本: **0.9.
|
|
13
|
+
> Current source version / 当前源码版本: **0.9.4** (stable release)
|
|
14
14
|
|
|
15
15
|
This release unifies spreadsheet previews, column mapping, and enrichment scope across the prompt wizard and workbench. Mapping statuses use color and text; mapped fields automatically enter the scope, with optional extra fields collapsed. Multiple confirmed output columns may share a non-identity field while preserving non-empty values. It fixes saved drafts resetting the scope to five defaults and detects stale Host versions. Preparing a draft does not query QCC; sending starts execution. Fully restart DSH after upgrading. Existing download artifacts are not rewritten.
|
|
16
16
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
数据清洗补全智能体:面向 Excel/CSV/JSON 企业名单,提供数据清洗、表格清洗、清洗补全、去重、企业数据补全与字段补全,支持企查查 MCP 和结果导出。
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
dsh plugin --profile web add dsh-data-cleaning-agent@0.9.
|
|
12
|
+
dsh plugin --profile web add dsh-data-cleaning-agent@0.9.4
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
请先满足下文的 DSH、连接器及侧边栏依赖要求;安装后完整停止并重启对应 Profile。
|
|
@@ -27,7 +27,7 @@ dsh plugin --profile web add dsh-data-cleaning-agent@0.9.3
|
|
|
27
27
|
|
|
28
28
|
> 在 DeepSeek Harness 中清洗、补全、画像企业名单数据的智能体插件:本地 CSV/XLSX/JSON 引擎 + 可选企查查(Qichacha/QCC)MCP 企业数据补全,由企查查(Qichacha/QCC)团队发起并维护。
|
|
29
29
|
>
|
|
30
|
-
> 当前源码版本 / Current source version: **0.9.
|
|
30
|
+
> 当前源码版本 / Current source version: **0.9.4**(正式版本)
|
|
31
31
|
|
|
32
32
|
本版上传表格后展示完整清单及空白数量,用绿色、琥珀色、红色及文字区分已通过、待确认和未匹配映射。已映射字段自动纳入补全范围,额外字段默认折叠;多个原列可经确认使用同一非主体字段,分别补空并保留非空原值。修复 Host 草稿重置为默认五字段的问题,增加前后端版本错配提示。生成说明不查询,发送才执行;升级后需完整重启 DSH,历史下载文件不自动改写。
|
|
33
33
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Read-only CSV-style preview: preserve values, but never wrap long cells.
|
|
2
|
+
export function renderArtifactPreview({ fileName, taskId, rowCount, columns, rows, download }) {
|
|
3
|
+
const escape = value => String(value ?? '').replace(/[&<>"]/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
4
|
+
return `<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escape(fileName)}</title><style>
|
|
5
|
+
*{box-sizing:border-box}
|
|
6
|
+
html,body{height:100%;margin:0;overflow:hidden}
|
|
7
|
+
body{font:14px system-ui;color:#243044;display:flex;flex-direction:column;padding:16px;gap:12px}
|
|
8
|
+
header{flex:none;min-width:0}h1{font-size:18px;margin:0 0 8px;overflow-wrap:anywhere}p{margin:0 0 8px;color:#66758b;font-size:12px;overflow-wrap:anywhere}a{color:#0875ce}
|
|
9
|
+
.grid{flex:1;min-height:0;min-width:0;overflow:auto;scrollbar-gutter:stable;border:1px solid #dde5ef;border-radius:6px}
|
|
10
|
+
table{border-collapse:separate;border-spacing:0;table-layout:auto;width:max-content;min-width:100%}
|
|
11
|
+
td,th{white-space:nowrap;word-break:normal;overflow-wrap:normal;vertical-align:middle;min-width:100px;height:34px;padding:7px 12px;border-right:1px solid #dde5ef;border-bottom:1px solid #dde5ef;text-align:left;line-height:20px}
|
|
12
|
+
thead th{position:sticky;top:0;z-index:2;background:#e5f3ff;box-shadow:0 1px 0 #c7d8e8}
|
|
13
|
+
tbody tr:nth-child(even){background:#f8fafc}tbody tr:hover{background:#edf6ff}
|
|
14
|
+
.row-number{min-width:48px;text-align:right;color:#66758b;background:#f3f7fb;position:sticky;left:0;z-index:1}thead .row-number{z-index:3;background:#e5f3ff}
|
|
15
|
+
.grid:focus-visible{outline:2px solid #0875ce;outline-offset:1px}
|
|
16
|
+
</style><header><h1>${escape(fileName)}</h1><p>任务 ${escape(taskId)} · 共 ${escape(rowCount)} 行 / ${columns.length} 列,当前预览 ${rows.length} 行(最多 50 行);源文件未修改。左右滚动查看全部字段,表头固定。</p><a href="${escape(download)}">下载完整 Excel</a></header><div class="grid" role="region" aria-label="结果数据表格,可横向和纵向滚动" tabindex="0"><table><thead><tr><th class="row-number" scope="col">序号</th>${columns.map(c => `<th scope="col">${escape(c)}</th>`).join('')}</tr></thead><tbody>${rows.map((row, i) => `<tr><th class="row-number" scope="row">${i + 1}</th>${columns.map(c => `<td>${escape(row[c])}</td>`).join('')}</tr>`).join('')}</tbody></table></div></html>`;
|
|
17
|
+
}
|
package/lib/web.js
CHANGED
|
@@ -16,6 +16,7 @@ import { PHASE3_BATCH_LIMITS, Phase3BatchService, Phase3RunStore } from './qcc-p
|
|
|
16
16
|
import { publicWorkflowContract } from './workflow-contract.js';
|
|
17
17
|
import { DataCleaningWorkflowStore, WorkflowError } from './workflow.js';
|
|
18
18
|
import { ArtifactError, WorkflowArtifactStore } from './artifacts.js';
|
|
19
|
+
import { renderArtifactPreview } from './artifact-preview.js';
|
|
19
20
|
import { createWorkflowExecution } from './workflow-execution.js';
|
|
20
21
|
import { createImageWorkflow } from './image-workflow.js';
|
|
21
22
|
import {
|
|
@@ -583,11 +584,10 @@ export function mountWebRoutes(wctx, { logger, report, TOOL_NAME, SKILL_NAME })
|
|
|
583
584
|
const bytes = await artifactStore.read(taskId, artifact);
|
|
584
585
|
if (artifact.format === 'xlsx' && new URL(req.url, 'http://127.0.0.1').searchParams.get('preview') === '1') {
|
|
585
586
|
const parsed = await parseXlsx(bytes);
|
|
586
|
-
const escape = value => String(value ?? '').replace(/[&<>\"]/g, c => ({ '&': '&', '<': '<', '>': '>', '\"': '"' }[c]));
|
|
587
587
|
const columns = parsed.headers || [];
|
|
588
588
|
const rows = (parsed.rows || []).slice(0, 50);
|
|
589
589
|
const download = `/data-cleaning/api/workflow/tasks/${encodeURIComponent(taskId)}/artifacts/${encodeURIComponent(artifactId)}`;
|
|
590
|
-
const html =
|
|
590
|
+
const html = renderArtifactPreview({ fileName: artifact.fileName, taskId, rowCount: artifact.rowCount, columns, rows, download });
|
|
591
591
|
res.writeHead(200, { 'content-type': 'text/html; charset=utf-8', 'cache-control': 'no-store', 'content-security-policy': "default-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'self'", 'x-content-type-options': 'nosniff' });
|
|
592
592
|
return res.end(html);
|
|
593
593
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-data-cleaning-agent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "Data cleaning and data enrichment for CSV/XLSX/JSON enterprise lists in DeepSeek Harness, including spreadsheet cleaning, deduplication, profiling, optional Qichacha MCP and exports.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|