dsh-data-cleaning-agent 0.8.23 → 0.9.1

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.
@@ -0,0 +1,49 @@
1
+ /** Read-only combination check. Never installs packages or reads profile secrets. */
2
+ import { readFileSync } from 'node:fs';
3
+ import { resolve, dirname } from 'node:path';
4
+ import { createRequire } from 'node:module';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { execFileSync } from 'node:child_process';
7
+
8
+ export function assessCombination({ host, sidebar, context }) {
9
+ const errors = [], warnings = [];
10
+ if (host === '0.1.2-rc.1' && sidebar === '0.17.1') errors.push('DSH 0.1.2-rc.1 与 Better Sidebar 0.17.1 不兼容:缺少 settingsNamespace;请升级侧边栏到 0.18.1。');
11
+ if (!host) errors.push('无法识别实际 DSH CLI 版本;请先安装完整 DSH,再重新预检。');
12
+ if (sidebar === '0.18.1' && host && host !== '0.1.2-rc.1') {
13
+ if (['0.1.1-rc.2', '0.1.2-alpha.2'].includes(host)) {
14
+ errors.push('Better Sidebar 0.18.1 不兼容此旧宿主。备份后由宿主管理者升级完整 @deepseek-ai/dsh@0.1.2-rc.1;不要只升级 Session 子包。');
15
+ } else warnings.push('此宿主与 Better Sidebar 0.18.1 组合未验证。');
16
+ }
17
+ if (!sidebar) errors.push('工作台需要 dsh-better-sidebar;目标 Profile 请安装 0.18.1(需完整 DSH 0.1.2-rc.1)。');
18
+ else if (sidebar !== '0.18.1') warnings.push('此侧边栏版本未验证;仍需 targetedOpen 和 stateSubscription 能力。');
19
+ if (host === '0.1.2-rc.1' && context === '0.36.0') errors.push('已安装的 dsh-context 0.36.0 使用旧 settingsNamespace;先升级该插件到 0.48.0。context 并非本产品必装依赖。');
20
+ else if (context && context !== '0.48.0') warnings.push('已安装的 context 版本尚未做共存验证。');
21
+ if (host && host !== '0.1.2-rc.1' && !warnings.length && !errors.length) warnings.push('此宿主组合未验证。');
22
+ return { host, sidebar, context, errors, warnings, ok: errors.length === 0 };
23
+ }
24
+
25
+ export function inspectProfile(profile, host) {
26
+ const req = createRequire(resolve(profile, 'package.json'));
27
+ const version = name => {
28
+ let path;
29
+ try { path = req.resolve(`${name}/package.json`); }
30
+ catch { try { path = req.resolve(name); } catch { return null; } }
31
+ for (let dir = dirname(path); ; dir = dirname(dir)) {
32
+ try { const pkg = JSON.parse(readFileSync(resolve(dir, 'package.json'), 'utf8')); if (pkg.name === name) return pkg.version; } catch { /* no manifest here */ }
33
+ if (dirname(dir) === dir) return null;
34
+ }
35
+ };
36
+ return assessCombination({ host, sidebar: version('dsh-better-sidebar'), context: version('dsh-context') });
37
+ }
38
+
39
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
40
+ const profile = process.argv[2];
41
+ if (!profile) { console.error('Usage: node lib/install-preflight.js <profile-directory> [dsh-executable]'); process.exitCode = 2; }
42
+ else {
43
+ let host = null;
44
+ try { host = execFileSync(process.argv[3] || 'dsh', ['--version'], { encoding: 'utf8', timeout: 15000 }).match(/\b\d+\.\d+\.\d+(?:-[\w.]+)?\b/)?.[0] ?? null; } catch { /* reported below */ }
45
+ const report = inspectProfile(profile, host);
46
+ console.log(JSON.stringify(report, null, 2));
47
+ process.exitCode = report.ok ? 0 : 1;
48
+ }
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-data-cleaning-agent",
3
- "version": "0.8.23",
3
+ "version": "0.9.1",
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",
@@ -22,6 +22,7 @@
22
22
  "docs/USER-GUIDE.md",
23
23
  "docs/FIRST-CONTRIBUTION.md",
24
24
  "docs/COMPATIBILITY.md",
25
+ "docs/UI-V1.5.0-ADOPTION.md",
25
26
  "docs/QCC-ENRICHMENT-DESIGN.md",
26
27
  "docs/QCC-PHASES-ROADMAP.md",
27
28
  "docs/PHASE2-ACCEPTANCE.md",