dsh-data-cleaning-agent 0.8.4 → 0.8.5
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 +10 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/lib/client.js +47 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录 `dsh-data-cleaning-agent` 的版本变更。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.8.5] - 2026-09-06
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- 清洗入口恢复使用 workspaceId 创建独立会话,修复仅 cwd 导致 DSH 首页缺少工作区、图片任务回填后发送按钮和模型控件持续禁用的问题。
|
|
9
|
+
- 增加可卸载的新会话兼容 Bridge:仅在清洗业务激活期间通过原生 create/open 创建普通会话,避免复用空白清洗会话;普通会话仍使用原生动作。
|
|
10
|
+
- 创建失败保留原会话和草稿,连续点击合并;等待期间切换其它智能体不被迟到的创建结果抢回页面。
|
|
11
|
+
|
|
12
|
+
### Tests
|
|
13
|
+
- 增加 DSH 原生 Hero 工作区禁用表达式回归、工作区关联和新会话生命周期测试;这些为代码/契约测试,不等于真实 QCC OCR 已通过。
|
|
14
|
+
|
|
5
15
|
## [0.8.4] - 2026-09-06
|
|
6
16
|
|
|
7
17
|
### Fixed
|
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 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.
|
|
4
4
|
>
|
|
5
|
-
> Current source version / 当前源码版本: **0.8.
|
|
5
|
+
> Current source version / 当前源码版本: **0.8.5** (stable release)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/duhu2000/dsh-data-cleaning-agent/actions/workflows/ci.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/dsh-data-cleaning-agent)
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 在 DeepSeek Harness 中清洗、补全、画像企业名单数据的智能体插件:本地 CSV/XLSX/JSON 引擎 + 可选企查查(Qichacha/QCC)MCP 企业数据补全,由企查查(Qichacha/QCC)团队发起并维护。
|
|
4
4
|
>
|
|
5
|
-
> 当前源码版本 / Current source version: **0.8.
|
|
5
|
+
> 当前源码版本 / Current source version: **0.8.5**(正式版本)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/duhu2000/dsh-data-cleaning-agent/actions/workflows/ci.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/dsh-data-cleaning-agent)
|
package/lib/client.js
CHANGED
|
@@ -1109,6 +1109,7 @@ window.__ModuleLoader__.load({
|
|
|
1109
1109
|
* 面板和用户草稿。新版本入口始终创建独立会话,不再依赖 DOM 文案推测导航。
|
|
1110
1110
|
*/
|
|
1111
1111
|
function installSessionOwnershipBridge(ctx) {
|
|
1112
|
+
const releaseNewSessionBridge = installNewSessionBridge(ctx);
|
|
1112
1113
|
let staleDraftObserver = null;
|
|
1113
1114
|
let staleDraftObserverTimer = null;
|
|
1114
1115
|
const clearStaleDefaultDraft = () => {
|
|
@@ -1156,6 +1157,7 @@ window.__ModuleLoader__.load({
|
|
|
1156
1157
|
}
|
|
1157
1158
|
});
|
|
1158
1159
|
return () => {
|
|
1160
|
+
releaseNewSessionBridge();
|
|
1159
1161
|
staleDraftObserver?.disconnect();
|
|
1160
1162
|
if (staleDraftObserverTimer !== null) clearTimeout(staleDraftObserverTimer);
|
|
1161
1163
|
if (typeof unsubscribe === 'function') unsubscribe();
|
|
@@ -1549,6 +1551,45 @@ window.__ModuleLoader__.load({
|
|
|
1549
1551
|
return mount;
|
|
1550
1552
|
}
|
|
1551
1553
|
|
|
1554
|
+
// rc/alpha 兼容边界:原生 startSession 会复用工作区内的空白会话。
|
|
1555
|
+
// 只在清洗会话激活时替换此动作,创建普通会话;不改 connectWorkspace 或全局点击。
|
|
1556
|
+
function installNewSessionBridge(ctx) {
|
|
1557
|
+
const workspaces = ctx.workspaces;
|
|
1558
|
+
const original = workspaces?.startSession;
|
|
1559
|
+
if (typeof original !== 'function' || typeof ctx.sessions?.create !== 'function') return () => {};
|
|
1560
|
+
const ownDescriptor = Object.getOwnPropertyDescriptor(workspaces, 'startSession');
|
|
1561
|
+
let pending = null;
|
|
1562
|
+
let disposed = false;
|
|
1563
|
+
const wrapped = function (workspaceId) {
|
|
1564
|
+
if (disposed) return original.call(this, workspaceId);
|
|
1565
|
+
const current = ctx.sessions.list.getSnapshot().current;
|
|
1566
|
+
if (!isCleaningSession(current)) return original.call(this, workspaceId);
|
|
1567
|
+
if (pending) return;
|
|
1568
|
+
const snapshot = workspaces.list.getSnapshot();
|
|
1569
|
+
const target = workspaceId
|
|
1570
|
+
?? snapshot.items.find((item) => item.sessionIds?.includes(current))?.workspaceId
|
|
1571
|
+
?? snapshot.recentWorkspaceId;
|
|
1572
|
+
if (!target) return original.call(this, workspaceId);
|
|
1573
|
+
pending = Promise.resolve().then(() => ctx.sessions.create({ workspaceId: target }))
|
|
1574
|
+
.then((sessionId) => {
|
|
1575
|
+
// 用户在等待期间转往其它智能体时不抢回页面;成功导航才撤销业务归属。
|
|
1576
|
+
if (!disposed && isCleaningSession(current) && ctx.sessions.list.getSnapshot().current === current) {
|
|
1577
|
+
ctx.sessions.open(sessionId);
|
|
1578
|
+
}
|
|
1579
|
+
}).catch((error) => {
|
|
1580
|
+
console.warn('[dc-agent] new session failed; current draft retained:', error instanceof Error ? error.message : String(error));
|
|
1581
|
+
}).finally(() => { pending = null; });
|
|
1582
|
+
};
|
|
1583
|
+
try { workspaces.startSession = wrapped; }
|
|
1584
|
+
catch (_error) { console.warn('[dc-agent] New Session compatibility bridge unavailable'); return () => {}; }
|
|
1585
|
+
return () => {
|
|
1586
|
+
disposed = true;
|
|
1587
|
+
if (workspaces.startSession !== wrapped) return;
|
|
1588
|
+
if (ownDescriptor) Object.defineProperty(workspaces, 'startSession', ownDescriptor);
|
|
1589
|
+
else delete workspaces.startSession;
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1552
1593
|
const CLEANING_SESSION_ID_PREFIX = 'session-dsh-data-cleaning-agent-';
|
|
1553
1594
|
const SESSION_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
|
|
1554
1595
|
function createCleaningSessionId() {
|
|
@@ -1567,20 +1608,20 @@ window.__ModuleLoader__.load({
|
|
|
1567
1608
|
? undefined
|
|
1568
1609
|
: items.find((item) => Array.isArray(item.sessionIds) && item.sessionIds.includes(current));
|
|
1569
1610
|
const recentWorkspace = items.find((item) => item.workspaceId === workspace.recentWorkspaceId);
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1611
|
+
const targetWorkspace = currentWorkspace ?? recentWorkspace ?? items[0];
|
|
1612
|
+
if (!targetWorkspace?.workspaceId) {
|
|
1572
1613
|
throw new Error('请先选择一个工作空间,再打开数据清洗补全智能体');
|
|
1573
1614
|
}
|
|
1574
1615
|
// 单一会话所有权:与招投标入口一致,显式创建带前缀的独立原生会话,绝不复用空白会话。
|
|
1575
1616
|
// connectWorkspace 会把「招投标」尚为空白的工作台会话复用为清洗会话,
|
|
1576
1617
|
// 使同一会话同时被招投标与清洗两个插件认领,进而争夺 Hero 标题与右侧工作台面板。
|
|
1577
|
-
//
|
|
1578
|
-
//
|
|
1618
|
+
// 原生 Hero 通过 workspace.sessionIds 判断输入是否可用。仅 cwd 会导致
|
|
1619
|
+
// chipTitle 缺失、inert=true;必须关联工作区,空白复用由 New Session Bridge 隔离。
|
|
1579
1620
|
if (typeof ctx.sessions.create !== 'function') {
|
|
1580
1621
|
throw new Error('当前 DSH 版本没有可用的独立会话创建能力');
|
|
1581
1622
|
}
|
|
1582
1623
|
const requestedId = createCleaningSessionId();
|
|
1583
|
-
const sessionId = await ctx.sessions.create({
|
|
1624
|
+
const sessionId = await ctx.sessions.create({ workspaceId: targetWorkspace.workspaceId, sessionId: requestedId });
|
|
1584
1625
|
if (sessionId !== requestedId) {
|
|
1585
1626
|
throw new Error('当前 DSH 版本不支持独立会话创建,请升级 DSH 后再打开数据清洗补全智能体');
|
|
1586
1627
|
}
|
|
@@ -3865,6 +3906,7 @@ window.__ModuleLoader__.load({
|
|
|
3865
3906
|
guessMappings,
|
|
3866
3907
|
deactivateCleaningSession,
|
|
3867
3908
|
installSessionOwnershipBridge,
|
|
3909
|
+
installNewSessionBridge,
|
|
3868
3910
|
isCleaningSession,
|
|
3869
3911
|
isKnownCleaningDraft,
|
|
3870
3912
|
markCleaningSession,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-data-cleaning-agent",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Clean, complete, and profile enterprise name lists in DeepSeek Harness — a data cleaning & completion agent plugin with local CSV/XLSX/JSON engine and optional Qichacha (QCC) MCP enrichment. Maintained by Qichacha/QCC.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|