dsh-total-quality 2.0.55 → 2.0.57
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/CONTRIBUTING.md +51 -47
- package/LICENSE.md +37 -37
- package/README.en.md +32 -30
- package/README.md +90 -88
- package/agent-host.cjs +277 -277
- package/client.js +199 -92
- package/cordis.patch.yml +5 -5
- package/docs/enterprise-onboarding.md +10 -10
- package/docs/technical-reference.md +223 -223
- package/host.cjs +91 -124
- package/llm-bridge.cjs +234 -234
- package/locale/en.json +5 -5
- package/locale/zh.json +5 -5
- package/package.json +3 -2
- package/public/app.css +3 -0
- package/public/app.js +6 -2
- package/public/index.html +8 -9
- package/public/js/api.js +152 -152
- package/public/js/assistant-history.js +62 -62
- package/public/js/material-library.js +100 -100
- package/public/js/mobile-preview.js +119 -0
- package/public/js/pages-company-knowledge.js +9 -32
- package/public/js/pages-core.js +232 -232
- package/public/js/pages-growth.js +148 -148
- package/public/js/pages-qms.js +1 -1
- package/public/js/pages-qtools.js +410 -410
- package/public/js/pages-thanks.js +71 -71
- package/public/js/plugin-updates.js +53 -0
- package/public/js/quality-workflow.js +205 -205
- package/public/js/survey-dates.js +41 -41
- package/public/js/survey-knowledge.js +301 -301
- package/public/js/tool-wizards.js +621 -621
- package/public/js/ui.js +467 -467
- package/public/js/voice-capture-worklet.js +30 -30
- package/public/js/xiaozhi-voice.js +264 -264
- package/public/js/xiaozhi.js +468 -468
- package/public/platform-help.html +426 -426
- package/public/platform-site/assets/0468a68574112812.css +10703 -10703
- package/public/platform-site/assets/159e086d35adfa1c.css +2094 -2094
- package/public/platform-site/assets/169e3159cade0d9f.css +98 -98
- package/public/platform-site/assets/22b917c4a3d4ae3d.svg +14 -14
- package/public/platform-site/assets/476f9254ccf723e7.css +8265 -8265
- package/public/platform-site/assets/85a0a4fb4416ded9.css +120 -120
- package/public/platform-site/assets/a3b272383226f6d9.svg +135 -135
- package/public/platform-site/assets/fd16dc5f3cc9d97e.svg +104 -104
- package/public/platform-site/assets/qip-favicon.svg +5 -5
- package/public/platform-site/index.html +279 -279
- package/public/platform-site/offline.js +261 -261
- package/public/platform-site/qip-brand.css +566 -566
- package/public/platform-site/qip-module-guides.js +237 -237
- package/public/responsive.css +103 -101
- package/public/vendor/markdown-it-15.0.3.LICENSE +22 -22
- package/public/vendor/markdown-it-15.0.3.umd.min.js +13 -13
- package/public/workbench.css +7 -7
- package/public/xiaozhi.css +292 -292
- package/resources/qms-templates/019ffb58f24ed48d.docx +0 -0
- package/resources/qms-templates/04a69165fc15143a.docx +0 -0
- package/resources/qms-templates/09af69358c989a63.docx +0 -0
- package/resources/qms-templates/0e7ac77844e45311.docx +0 -0
- package/resources/qms-templates/12446a1b5e173c71.docx +0 -0
- package/resources/qms-templates/15ae40f67f9a3efc.docx +0 -0
- package/resources/qms-templates/18a69bbebf2ece7f.docx +0 -0
- package/resources/qms-templates/1978faa989134f02.docx +0 -0
- package/resources/qms-templates/1a30e121de752f7b.docx +0 -0
- package/resources/qms-templates/1b88907969ea7d4c.docx +0 -0
- package/resources/qms-templates/1e92b808722bf90a.docx +0 -0
- package/resources/qms-templates/2091cad340dc0e7f.docx +0 -0
- package/resources/qms-templates/271ae1002c896ed7.docx +0 -0
- package/resources/qms-templates/280ce53e5d3b5fcf.docx +0 -0
- package/resources/qms-templates/28ca8e4ede0adf6d.docx +0 -0
- package/resources/qms-templates/2ac6675f3cb1f993.docx +0 -0
- package/resources/qms-templates/2c3b799389909d8b.docx +0 -0
- package/resources/qms-templates/2c51038ba2cc3264.docx +0 -0
- package/resources/qms-templates/30c888851d16d764.docx +0 -0
- package/resources/qms-templates/3459fc4daaa2743d.docx +0 -0
- package/resources/qms-templates/3751dafc335e0e80.docx +0 -0
- package/resources/qms-templates/38798cd4298cd2db.docx +0 -0
- package/resources/qms-templates/38f551f9d738ab0a.docx +0 -0
- package/resources/qms-templates/3c85a23ea17018b4.docx +0 -0
- package/resources/qms-templates/3cdb7d14caf1b852.docx +0 -0
- package/resources/qms-templates/3f23239bb6b3e1db.docx +0 -0
- package/resources/qms-templates/42a5b9efeeaa8007.docx +0 -0
- package/resources/qms-templates/47352aafe9b8dac1.docx +0 -0
- package/resources/qms-templates/495359b1e3cbb8fe.docx +0 -0
- package/resources/qms-templates/4ca6920464785166.docx +0 -0
- package/resources/qms-templates/4ce862582a7791be.docx +0 -0
- package/resources/qms-templates/54c9a02a10991b9e.docx +0 -0
- package/resources/qms-templates/5aeb8fddf5f3693f.docx +0 -0
- package/resources/qms-templates/5d7e5576b0e73be7.docx +0 -0
- package/resources/qms-templates/5db3a40edac37791.docx +0 -0
- package/resources/qms-templates/5ffa21eb78eb6f77.docx +0 -0
- package/resources/qms-templates/60d0fbcb709b7161.docx +0 -0
- package/resources/qms-templates/63e1d3a166756095.docx +0 -0
- package/resources/qms-templates/65c724c080d32f10.docx +0 -0
- package/resources/qms-templates/674bd7826c6cbac2.docx +0 -0
- package/resources/qms-templates/677e851acca1b879.docx +0 -0
- package/resources/qms-templates/6bf15feb1a0d2a8d.docx +0 -0
- package/resources/qms-templates/6c3889c7d0918db9.docx +0 -0
- package/resources/qms-templates/6c4c349eeb0a96a8.docx +0 -0
- package/resources/qms-templates/6c5befbd33f759c1.docx +0 -0
- package/resources/qms-templates/6df8367901347508.docx +0 -0
- package/resources/qms-templates/71db51997037692b.docx +0 -0
- package/resources/qms-templates/78a8ef8c76510c99.docx +0 -0
- package/resources/qms-templates/8397bfd1c0a1b013.docx +0 -0
- package/resources/qms-templates/84d750cf858b60a1.docx +0 -0
- package/resources/qms-templates/880de58a4b334533.docx +0 -0
- package/resources/qms-templates/88c37d1b87d9b78c.docx +0 -0
- package/resources/qms-templates/88e9cd42f1849462.docx +0 -0
- package/resources/qms-templates/8956597403be35b6.docx +0 -0
- package/resources/qms-templates/94675c810a233e1f.docx +0 -0
- package/resources/qms-templates/94dff59dd7ebec6e.docx +0 -0
- package/resources/qms-templates/9670b9cd02141594.docx +0 -0
- package/resources/qms-templates/98c373ebd7b5163d.docx +0 -0
- package/resources/qms-templates/a4078cf2378a9388.docx +0 -0
- package/resources/qms-templates/a5b110c7ef917139.docx +0 -0
- package/resources/qms-templates/aec75820e45774be.docx +0 -0
- package/resources/qms-templates/b31c085e281d230c.docx +0 -0
- package/resources/qms-templates/b7c1c3c72f8ffeef.docx +0 -0
- package/resources/qms-templates/b81b82eaa5c8f422.docx +0 -0
- package/resources/qms-templates/b92a2fa31f75f137.docx +0 -0
- package/resources/qms-templates/b96c54ae9cfffc54.docx +0 -0
- package/resources/qms-templates/bc47cfd626c010e7.docx +0 -0
- package/resources/qms-templates/be60792734afca69.docx +0 -0
- package/resources/qms-templates/c0018d8ae9ad19e1.docx +0 -0
- package/resources/qms-templates/c171027c964c8be3.docx +0 -0
- package/resources/qms-templates/c4b93d71f5d98b4b.docx +0 -0
- package/resources/qms-templates/c531da29fcb3090f.docx +0 -0
- package/resources/qms-templates/c88eddd43358d015.docx +0 -0
- package/resources/qms-templates/cb978da542f0d892.docx +0 -0
- package/resources/qms-templates/ccde4a94532a8d36.docx +0 -0
- package/resources/qms-templates/cf3fb1e20ae6f24d.docx +0 -0
- package/resources/qms-templates/d231b4982fc8113e.docx +0 -0
- package/resources/qms-templates/d3c55aa5ed14055c.docx +0 -0
- package/resources/qms-templates/db45c44a00a13349.docx +0 -0
- package/resources/qms-templates/db849a41210f54e0.docx +0 -0
- package/resources/qms-templates/dba9ce363d83ddc8.docx +0 -0
- package/resources/qms-templates/dca3ea4c95eb2225.docx +0 -0
- package/resources/qms-templates/dfa4220d2b6b8131.docx +0 -0
- package/resources/qms-templates/dfa51222c777734f.docx +0 -0
- package/resources/qms-templates/e07ea511507e14f5.docx +0 -0
- package/resources/qms-templates/e0a2e00c03458dfa.docx +0 -0
- package/resources/qms-templates/e0e802f46b6764d1.docx +0 -0
- package/resources/qms-templates/e53fc85717f2852b.docx +0 -0
- package/resources/qms-templates/e9dd82d5e54520e5.docx +0 -0
- package/resources/qms-templates/ea7bfc22c06d82a9.docx +0 -0
- package/resources/qms-templates/ecf0db9f37294536.docx +0 -0
- package/resources/qms-templates/f05fcfc87e82ff39.docx +0 -0
- package/resources/qms-templates/fb9e56a17c4a4f97.docx +0 -0
- package/resources/qms-templates/manifest.json +932 -0
- package/src/data/seed-sme.js +317 -317
- package/src/data/seed.js +879 -879
- package/src/lib/backup-identity.js +57 -57
- package/src/lib/chat-answer.js +225 -225
- package/src/lib/chat-context.js +99 -99
- package/src/lib/company-library.js +28 -19
- package/src/lib/data-import.js +217 -217
- package/src/lib/data-sources.js +118 -118
- package/src/lib/demo-data.js +27 -1
- package/src/lib/employee-intake.js +84 -84
- package/src/lib/growth.js +53 -53
- package/src/lib/intake-packets.js +119 -119
- package/src/lib/issue-intake.js +88 -88
- package/src/lib/kb-revision.js +214 -214
- package/src/lib/llm.js +279 -279
- package/src/lib/model-error.js +14 -14
- package/src/lib/privacy.js +26 -26
- package/src/lib/qms-drafting.js +194 -194
- package/src/lib/qms-jobs.js +11 -7
- package/src/lib/qms-manual-review.js +185 -185
- package/src/lib/qms-procedure-review.js +109 -109
- package/src/lib/qms-templates.js +358 -326
- package/src/lib/qms.js +369 -369
- package/src/lib/quality-priority.js +100 -100
- package/src/lib/quality-state.js +92 -92
- package/src/lib/quality-workflow.js +65 -65
- package/src/lib/retrieval.js +159 -159
- package/src/lib/spc.js +127 -127
- package/src/lib/voice-hotwords.txt +22 -22
- package/src/lib/voice-text.js +13 -13
- package/src/lib/voice-worker.js +72 -72
- package/src/lib/voice.js +330 -330
- package/src/lib/workbench-notices.js +49 -49
- package/src/lib/workbench.js +103 -106
- package/src/package.json +3 -3
- package/src/tools/analysis.js +306 -306
- package/src/tools/data.js +596 -596
- package/src/tools/docs.js +430 -430
- package/src/tools/registry.js +57 -57
- package/tools-dsh.cjs +153 -153
- package//345/256/211/350/243/205/350/257/264/346/230/216.md +33 -25
- package//346/234/254/346/234/272/347/213/254/347/253/213/345/256/211/350/243/205/350/257/264/346/230/216.md +17 -17
- package//350/207/252/346/243/200.cjs +88 -88
- package/public/js/remote-knowledge.js +0 -165
- package/public/js/workbench-notices.js +0 -67
- package/public/remote-knowledge-help.html +0 -35
- package/public/remote-knowledge.css +0 -40
- package/src/lib/remote-knowledge.js +0 -284
package/src/tools/registry.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* 工具注册中心
|
|
4
|
-
* ------------------------------------------------------------------
|
|
5
|
-
* 每个工具 = 一个真实可执行的能力,声明:
|
|
6
|
-
* plugin 归属插件(@MES / @SPC / … / 知识库 / 本平台),用于调用链可视化
|
|
7
|
-
* name 函数名(暴露给模型的 function name,唯一)
|
|
8
|
-
* label 中文名
|
|
9
|
-
* description 给模型看的说明(写清楚什么时候用、返回什么)
|
|
10
|
-
* parameters JSON Schema
|
|
11
|
-
* confirm 是否需要人工确认后才执行(对外承诺类动作)
|
|
12
|
-
* write 是否为写操作(审计日志中标记)
|
|
13
|
-
* run(args, ctx) => any
|
|
14
|
-
*/
|
|
15
|
-
const registry = new Map();
|
|
16
|
-
|
|
17
|
-
function define(def) {
|
|
18
|
-
if (!def.name) throw new Error('工具必须有 name');
|
|
19
|
-
// 同一个工具被再次注册(插件热重载 / 模块被两条路径各加载一次)时不再抛错:
|
|
20
|
-
// 以「后注册的实现为准」覆盖,并只提示一次,避免整包 import 失败。
|
|
21
|
-
if (registry.has(def.name)) {
|
|
22
|
-
if (!define._warned.has(def.name)) {
|
|
23
|
-
define._warned.add(def.name);
|
|
24
|
-
console.warn('[qip-real-workbench] 工具重复注册,已用新实现覆盖:' + def.name);
|
|
25
|
-
}
|
|
26
|
-
registry.delete(def.name);
|
|
27
|
-
}
|
|
28
|
-
registry.set(def.name, Object.assign({ plugin: '本平台', write: false, confirm: false }, def));
|
|
29
|
-
return def;
|
|
30
|
-
}
|
|
31
|
-
define._warned = new Set();
|
|
32
|
-
|
|
33
|
-
function all() { return [...registry.values()]; }
|
|
34
|
-
function get(name) { return registry.get(name) || null; }
|
|
35
|
-
|
|
36
|
-
/** 转成 OpenAI tools 参数(按开关过滤插件) */
|
|
37
|
-
function schemas(pluginFilter, confirmActions) {
|
|
38
|
-
return all()
|
|
39
|
-
.filter((t) => !pluginFilter || pluginFilter(t))
|
|
40
|
-
.map((t) => ({
|
|
41
|
-
type: 'function',
|
|
42
|
-
function: {
|
|
43
|
-
name: t.name,
|
|
44
|
-
description: t.description,
|
|
45
|
-
parameters: t.parameters || { type: 'object', properties: {}, required: [] },
|
|
46
|
-
},
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** 判断某工具是否需要人工确认 */
|
|
51
|
-
function needsConfirm(name, confirmList) {
|
|
52
|
-
const t = get(name);
|
|
53
|
-
if (!t) return false;
|
|
54
|
-
return !!t.confirm || (Array.isArray(confirmList) && confirmList.indexOf(name) >= 0);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
module.exports = { define, all, get, schemas, needsConfirm, registry };
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* 工具注册中心
|
|
4
|
+
* ------------------------------------------------------------------
|
|
5
|
+
* 每个工具 = 一个真实可执行的能力,声明:
|
|
6
|
+
* plugin 归属插件(@MES / @SPC / … / 知识库 / 本平台),用于调用链可视化
|
|
7
|
+
* name 函数名(暴露给模型的 function name,唯一)
|
|
8
|
+
* label 中文名
|
|
9
|
+
* description 给模型看的说明(写清楚什么时候用、返回什么)
|
|
10
|
+
* parameters JSON Schema
|
|
11
|
+
* confirm 是否需要人工确认后才执行(对外承诺类动作)
|
|
12
|
+
* write 是否为写操作(审计日志中标记)
|
|
13
|
+
* run(args, ctx) => any
|
|
14
|
+
*/
|
|
15
|
+
const registry = new Map();
|
|
16
|
+
|
|
17
|
+
function define(def) {
|
|
18
|
+
if (!def.name) throw new Error('工具必须有 name');
|
|
19
|
+
// 同一个工具被再次注册(插件热重载 / 模块被两条路径各加载一次)时不再抛错:
|
|
20
|
+
// 以「后注册的实现为准」覆盖,并只提示一次,避免整包 import 失败。
|
|
21
|
+
if (registry.has(def.name)) {
|
|
22
|
+
if (!define._warned.has(def.name)) {
|
|
23
|
+
define._warned.add(def.name);
|
|
24
|
+
console.warn('[qip-real-workbench] 工具重复注册,已用新实现覆盖:' + def.name);
|
|
25
|
+
}
|
|
26
|
+
registry.delete(def.name);
|
|
27
|
+
}
|
|
28
|
+
registry.set(def.name, Object.assign({ plugin: '本平台', write: false, confirm: false }, def));
|
|
29
|
+
return def;
|
|
30
|
+
}
|
|
31
|
+
define._warned = new Set();
|
|
32
|
+
|
|
33
|
+
function all() { return [...registry.values()]; }
|
|
34
|
+
function get(name) { return registry.get(name) || null; }
|
|
35
|
+
|
|
36
|
+
/** 转成 OpenAI tools 参数(按开关过滤插件) */
|
|
37
|
+
function schemas(pluginFilter, confirmActions) {
|
|
38
|
+
return all()
|
|
39
|
+
.filter((t) => !pluginFilter || pluginFilter(t))
|
|
40
|
+
.map((t) => ({
|
|
41
|
+
type: 'function',
|
|
42
|
+
function: {
|
|
43
|
+
name: t.name,
|
|
44
|
+
description: t.description,
|
|
45
|
+
parameters: t.parameters || { type: 'object', properties: {}, required: [] },
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** 判断某工具是否需要人工确认 */
|
|
51
|
+
function needsConfirm(name, confirmList) {
|
|
52
|
+
const t = get(name);
|
|
53
|
+
if (!t) return false;
|
|
54
|
+
return !!t.confirm || (Array.isArray(confirmList) && confirmList.indexOf(name) >= 0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = { define, all, get, schemas, needsConfirm, registry };
|
package/tools-dsh.cjs
CHANGED
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* 把平台里的真实工具注册成 DeepSeek Harness 的 Agent 工具。
|
|
4
|
-
* ------------------------------------------------------------------
|
|
5
|
-
* 每个 Harness 工具都直接调用内置工具注册中心的实现:
|
|
6
|
-
* 参数结构、执行逻辑、统计口径全部复用,不存在"另写一套数据"。
|
|
7
|
-
* 因此对话里(Harness 自带 DeepSeek 智能体)也能真的查数、算 SPC、出报告。
|
|
8
|
-
*/
|
|
9
|
-
const host = require('./host.cjs');
|
|
10
|
-
|
|
11
|
-
const registry = host.registry;
|
|
12
|
-
|
|
13
|
-
const text = (value) => [{ type: 'text', text: String(value) }];
|
|
14
|
-
|
|
15
|
-
const DEFS = [
|
|
16
|
-
{
|
|
17
|
-
ds: 'qip_workbench_overview',
|
|
18
|
-
real: 'dashboard_overview',
|
|
19
|
-
desc: '查询质量驾驶舱的真实 KPI 总览:测量点数、超差点、判异特性、在改项目、按期率、已核定收益等,全部由统计引擎实算。用户问"整体质量怎么样/今天质量指标"时先用它。',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
ds: 'qip_workbench_spc_list_chars',
|
|
23
|
-
real: 'spc_list_chars',
|
|
24
|
-
desc: '列出平台里所有可做 SPC 分析的关键特性(编号、名称、产品、车间、规格上下限、子组大小)。回答任何 SPC 问题前先调用它确认特性编号。',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
ds: 'qip_workbench_spc_rule_check',
|
|
28
|
-
real: 'spc_rule_check',
|
|
29
|
-
desc: '对指定特性做 GB/T 4091 八大判异准则检查(真实统计引擎,返回命中的准则、涉及点位、控制限)。用户问"有没有判异/失控/异常波动"时用它。',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
ds: 'qip_workbench_spc_capability',
|
|
33
|
-
real: 'spc_capability',
|
|
34
|
-
desc: '计算指定特性的过程能力 Cp/Cpk/Pp/Ppk、ppm 与判定(能力充足/不足)。用户问"Cpk 多少/过程能力"时用它。',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
ds: 'qip_workbench_spc_control_chart',
|
|
38
|
-
real: 'spc_control_chart',
|
|
39
|
-
desc: '生成指定特性的真实控制图数据(I-MR/Xbar-R/Xbar-S/EWMA、UCL/CL/LCL、逐点数值),用于展示过程受控状态。',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
ds: 'qip_workbench_measurements',
|
|
43
|
-
real: 'mes_query_measurements',
|
|
44
|
-
desc: '从 @MES 数据仓查询指定特性的在线测量值:样本量、均值、超差条数与比例、分班次统计、批次与追溯字段。用户问"这批数据怎么样/超差多少"时用它。',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
ds: 'qip_workbench_issue_search',
|
|
48
|
-
real: 'issue_search',
|
|
49
|
-
desc: '检索质量问题库(支持关键词、产品、车间、状态),返回问题编号、等级、责任人、项目关联。用户问"有哪些质量问题/某个问题进展"时用它。',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
ds: 'qip_workbench_issue_create',
|
|
53
|
-
real: 'issue_create',
|
|
54
|
-
desc: '登记一条新的质量问题(自动编号、自动查重、相似历史案例匹配)。用户明确要求"登记/新建一个问题"时用它。',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
ds: 'qip_workbench_project_list',
|
|
58
|
-
real: 'project_list',
|
|
59
|
-
desc: '列出质量改进项目(8D):编号、标题、阶段、等级、责任人、SLA 与超期状态。用户问"有哪些改进项目/8D 进展"时用它。',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
ds: 'qip_workbench_project_advance',
|
|
63
|
-
real: 'project_advance',
|
|
64
|
-
desc: '推进某个 8D 改进项目到下一阶段,并写入该阶段交付物。用户明确要求"把某项目推进到 D4/下一阶段"时用它。',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
ds: 'qip_workbench_knowledge_search',
|
|
68
|
-
real: 'kb_search',
|
|
69
|
-
desc: '在企业知识库里做中文语义检索(BM25),命中师傅经验卡/历史案例/标准条款,带编号出处。做根因分析前先检索历史经验。',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
ds: 'qip_workbench_risk_scan',
|
|
73
|
-
real: 'aqi_risk_scan',
|
|
74
|
-
desc: '跨源风险扫描:判异、缺陷密度上升、项目超期、重复问题聚类等,返回按 A/B/C 分级的风险清单与建议动作。用户问"有什么风险/该关注什么"时用它。',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
ds: 'qip_workbench_benefit_calc',
|
|
78
|
-
real: 'fin_benefit_calc',
|
|
79
|
-
desc: '按财务口径测算改进收益:年化收益(万元)、投资回收期(月)、计算依据。用户问"这个改进值多少钱/收益测算"时用它。',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
ds: 'qip_workbench_report_generate',
|
|
83
|
-
real: 'report_generate',
|
|
84
|
-
desc: '生成真实 Word(.docx) 报告文件(周报/月报/专项/根因/SPC/8D),返回磁盘绝对路径与文件大小。用户要求"出报告/导报告"时用它。',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
ds: 'qip_workbench_data_export',
|
|
88
|
-
real: 'data_export',
|
|
89
|
-
desc: '把平台数据导出为真实 Excel(.xlsx) 多工作表文件或 CSV,返回磁盘绝对路径与包含的工作表。用户要求"导出数据/要 Excel"时用它。',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
ds: 'qip_workbench_db_status',
|
|
93
|
-
real: 'dashboard_overview',
|
|
94
|
-
desc: '查看平台真实存储状态:SQLite 数据库文件路径、大小、各表行数、测量值条数(数据是否真的落库)。用户问"数据存在哪/有没有入库"时用它。',
|
|
95
|
-
},
|
|
96
|
-
];
|
|
97
|
-
|
|
98
|
-
const RENDER_LIMIT = 7000;
|
|
99
|
-
|
|
100
|
-
function buildTools() {
|
|
101
|
-
const out = [];
|
|
102
|
-
for (const def of DEFS) {
|
|
103
|
-
const real = registry.get(def.real);
|
|
104
|
-
if (!real) {
|
|
105
|
-
console.warn('[qip-real-workbench] 跳过工具 ' + def.ds + ':平台没有 ' + def.real);
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
out.push({
|
|
109
|
-
name: def.ds,
|
|
110
|
-
description: '全质开源质量平台:' + def.desc + '(真实执行 ' + real.plugin + ' · ' + real.name + ')',
|
|
111
|
-
parameters: real.parameters || { type: 'object', properties: {}, additionalProperties: false },
|
|
112
|
-
output: {
|
|
113
|
-
schema: { type: 'object', additionalProperties: true, properties: {} },
|
|
114
|
-
render: (_args, value) => {
|
|
115
|
-
let preview = '';
|
|
116
|
-
try {
|
|
117
|
-
preview = JSON.stringify(value, null, 2);
|
|
118
|
-
} catch (_) {
|
|
119
|
-
preview = String(value);
|
|
120
|
-
}
|
|
121
|
-
if (preview.length > RENDER_LIMIT) preview = preview.slice(0, RENDER_LIMIT) + '\n…(已截断)';
|
|
122
|
-
let summary = '';
|
|
123
|
-
try { summary = host.agent.summarize(real.name, value); } catch (_) { summary = ''; }
|
|
124
|
-
return text((summary ? summary + '\n\n' : '') + preview);
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
async execute(args) {
|
|
128
|
-
await host.init();
|
|
129
|
-
if (!host.modelDataAllowed()) {
|
|
130
|
-
return {ok:false,error:'企业数据当前只在平台本地处理。请在平台业务页面查看。'};
|
|
131
|
-
}
|
|
132
|
-
if (def.ds === 'qip_workbench_db_status') {
|
|
133
|
-
const info = host.store.persist ? host.store.persist.info() : { engine: 'json', path: host.store.file };
|
|
134
|
-
return {
|
|
135
|
-
ok: true,
|
|
136
|
-
database: info,
|
|
137
|
-
dataDir: host.DATA_DIR,
|
|
138
|
-
reportDir: host.OUTPUT_DIR,
|
|
139
|
-
counts: host.countAll(),
|
|
140
|
-
note: '所有业务数据以 SQLite 为权威存储,另留 JSON 快照用于备份。',
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
const result = await host.agent.executeTool(real, args || {}, { outputDir: host.OUTPUT_DIR }, 'DSH 工具');
|
|
144
|
-
return result === undefined ? { ok: true } : result;
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return out;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
module.exports = { buildTools, DEFS };
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* 把平台里的真实工具注册成 DeepSeek Harness 的 Agent 工具。
|
|
4
|
+
* ------------------------------------------------------------------
|
|
5
|
+
* 每个 Harness 工具都直接调用内置工具注册中心的实现:
|
|
6
|
+
* 参数结构、执行逻辑、统计口径全部复用,不存在"另写一套数据"。
|
|
7
|
+
* 因此对话里(Harness 自带 DeepSeek 智能体)也能真的查数、算 SPC、出报告。
|
|
8
|
+
*/
|
|
9
|
+
const host = require('./host.cjs');
|
|
10
|
+
|
|
11
|
+
const registry = host.registry;
|
|
12
|
+
|
|
13
|
+
const text = (value) => [{ type: 'text', text: String(value) }];
|
|
14
|
+
|
|
15
|
+
const DEFS = [
|
|
16
|
+
{
|
|
17
|
+
ds: 'qip_workbench_overview',
|
|
18
|
+
real: 'dashboard_overview',
|
|
19
|
+
desc: '查询质量驾驶舱的真实 KPI 总览:测量点数、超差点、判异特性、在改项目、按期率、已核定收益等,全部由统计引擎实算。用户问"整体质量怎么样/今天质量指标"时先用它。',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
ds: 'qip_workbench_spc_list_chars',
|
|
23
|
+
real: 'spc_list_chars',
|
|
24
|
+
desc: '列出平台里所有可做 SPC 分析的关键特性(编号、名称、产品、车间、规格上下限、子组大小)。回答任何 SPC 问题前先调用它确认特性编号。',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
ds: 'qip_workbench_spc_rule_check',
|
|
28
|
+
real: 'spc_rule_check',
|
|
29
|
+
desc: '对指定特性做 GB/T 4091 八大判异准则检查(真实统计引擎,返回命中的准则、涉及点位、控制限)。用户问"有没有判异/失控/异常波动"时用它。',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
ds: 'qip_workbench_spc_capability',
|
|
33
|
+
real: 'spc_capability',
|
|
34
|
+
desc: '计算指定特性的过程能力 Cp/Cpk/Pp/Ppk、ppm 与判定(能力充足/不足)。用户问"Cpk 多少/过程能力"时用它。',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
ds: 'qip_workbench_spc_control_chart',
|
|
38
|
+
real: 'spc_control_chart',
|
|
39
|
+
desc: '生成指定特性的真实控制图数据(I-MR/Xbar-R/Xbar-S/EWMA、UCL/CL/LCL、逐点数值),用于展示过程受控状态。',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
ds: 'qip_workbench_measurements',
|
|
43
|
+
real: 'mes_query_measurements',
|
|
44
|
+
desc: '从 @MES 数据仓查询指定特性的在线测量值:样本量、均值、超差条数与比例、分班次统计、批次与追溯字段。用户问"这批数据怎么样/超差多少"时用它。',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
ds: 'qip_workbench_issue_search',
|
|
48
|
+
real: 'issue_search',
|
|
49
|
+
desc: '检索质量问题库(支持关键词、产品、车间、状态),返回问题编号、等级、责任人、项目关联。用户问"有哪些质量问题/某个问题进展"时用它。',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
ds: 'qip_workbench_issue_create',
|
|
53
|
+
real: 'issue_create',
|
|
54
|
+
desc: '登记一条新的质量问题(自动编号、自动查重、相似历史案例匹配)。用户明确要求"登记/新建一个问题"时用它。',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
ds: 'qip_workbench_project_list',
|
|
58
|
+
real: 'project_list',
|
|
59
|
+
desc: '列出质量改进项目(8D):编号、标题、阶段、等级、责任人、SLA 与超期状态。用户问"有哪些改进项目/8D 进展"时用它。',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
ds: 'qip_workbench_project_advance',
|
|
63
|
+
real: 'project_advance',
|
|
64
|
+
desc: '推进某个 8D 改进项目到下一阶段,并写入该阶段交付物。用户明确要求"把某项目推进到 D4/下一阶段"时用它。',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
ds: 'qip_workbench_knowledge_search',
|
|
68
|
+
real: 'kb_search',
|
|
69
|
+
desc: '在企业知识库里做中文语义检索(BM25),命中师傅经验卡/历史案例/标准条款,带编号出处。做根因分析前先检索历史经验。',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
ds: 'qip_workbench_risk_scan',
|
|
73
|
+
real: 'aqi_risk_scan',
|
|
74
|
+
desc: '跨源风险扫描:判异、缺陷密度上升、项目超期、重复问题聚类等,返回按 A/B/C 分级的风险清单与建议动作。用户问"有什么风险/该关注什么"时用它。',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
ds: 'qip_workbench_benefit_calc',
|
|
78
|
+
real: 'fin_benefit_calc',
|
|
79
|
+
desc: '按财务口径测算改进收益:年化收益(万元)、投资回收期(月)、计算依据。用户问"这个改进值多少钱/收益测算"时用它。',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
ds: 'qip_workbench_report_generate',
|
|
83
|
+
real: 'report_generate',
|
|
84
|
+
desc: '生成真实 Word(.docx) 报告文件(周报/月报/专项/根因/SPC/8D),返回磁盘绝对路径与文件大小。用户要求"出报告/导报告"时用它。',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
ds: 'qip_workbench_data_export',
|
|
88
|
+
real: 'data_export',
|
|
89
|
+
desc: '把平台数据导出为真实 Excel(.xlsx) 多工作表文件或 CSV,返回磁盘绝对路径与包含的工作表。用户要求"导出数据/要 Excel"时用它。',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
ds: 'qip_workbench_db_status',
|
|
93
|
+
real: 'dashboard_overview',
|
|
94
|
+
desc: '查看平台真实存储状态:SQLite 数据库文件路径、大小、各表行数、测量值条数(数据是否真的落库)。用户问"数据存在哪/有没有入库"时用它。',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
const RENDER_LIMIT = 7000;
|
|
99
|
+
|
|
100
|
+
function buildTools() {
|
|
101
|
+
const out = [];
|
|
102
|
+
for (const def of DEFS) {
|
|
103
|
+
const real = registry.get(def.real);
|
|
104
|
+
if (!real) {
|
|
105
|
+
console.warn('[qip-real-workbench] 跳过工具 ' + def.ds + ':平台没有 ' + def.real);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
out.push({
|
|
109
|
+
name: def.ds,
|
|
110
|
+
description: '全质开源质量平台:' + def.desc + '(真实执行 ' + real.plugin + ' · ' + real.name + ')',
|
|
111
|
+
parameters: real.parameters || { type: 'object', properties: {}, additionalProperties: false },
|
|
112
|
+
output: {
|
|
113
|
+
schema: { type: 'object', additionalProperties: true, properties: {} },
|
|
114
|
+
render: (_args, value) => {
|
|
115
|
+
let preview = '';
|
|
116
|
+
try {
|
|
117
|
+
preview = JSON.stringify(value, null, 2);
|
|
118
|
+
} catch (_) {
|
|
119
|
+
preview = String(value);
|
|
120
|
+
}
|
|
121
|
+
if (preview.length > RENDER_LIMIT) preview = preview.slice(0, RENDER_LIMIT) + '\n…(已截断)';
|
|
122
|
+
let summary = '';
|
|
123
|
+
try { summary = host.agent.summarize(real.name, value); } catch (_) { summary = ''; }
|
|
124
|
+
return text((summary ? summary + '\n\n' : '') + preview);
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
async execute(args) {
|
|
128
|
+
await host.init();
|
|
129
|
+
if (!host.modelDataAllowed()) {
|
|
130
|
+
return {ok:false,error:'企业数据当前只在平台本地处理。请在平台业务页面查看。'};
|
|
131
|
+
}
|
|
132
|
+
if (def.ds === 'qip_workbench_db_status') {
|
|
133
|
+
const info = host.store.persist ? host.store.persist.info() : { engine: 'json', path: host.store.file };
|
|
134
|
+
return {
|
|
135
|
+
ok: true,
|
|
136
|
+
database: info,
|
|
137
|
+
dataDir: host.DATA_DIR,
|
|
138
|
+
reportDir: host.OUTPUT_DIR,
|
|
139
|
+
counts: host.countAll(),
|
|
140
|
+
note: '所有业务数据以 SQLite 为权威存储,另留 JSON 快照用于备份。',
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const result = await host.agent.executeTool(real, args || {}, { outputDir: host.OUTPUT_DIR }, 'DSH 工具');
|
|
144
|
+
return result === undefined ? { ok: true } : result;
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
module.exports = { buildTools, DEFS };
|
|
152
|
+
|
|
153
|
+
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
# 安装说明
|
|
2
|
-
|
|
3
|
-
全质开源质量平台是 DeepSeek Harness(DSH)Web
|
|
4
|
-
|
|
5
|
-
## 从
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
# 安装说明
|
|
2
|
+
|
|
3
|
+
全质开源质量平台是 DeepSeek Harness(DSH)Web 插件。npm 包名为 `dsh-total-quality`,GitHub 安装包名为 `qip-real-workbench`。支持的 Node 版本为 22.19 或更高的 22.x 版本,以及 24.x 及以上。DSH Web 适用版本见 [插件清单](package.json)。
|
|
4
|
+
|
|
5
|
+
## 从 npm 安装
|
|
6
|
+
|
|
7
|
+
在 DSH 的「添加插件」中输入 `dsh-total-quality`,打开侧栏「全质开源质量平台」。也可以使用以下命令。
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
dsh plugin --profile web add dsh-total-quality
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 从 GitHub 安装
|
|
14
|
+
|
|
15
|
+
1. 从 [发布页](https://github.com/total-quality/dsh-total-quality/releases/latest) 下载 `qip-real-workbench-2.0.57.tgz`,在 DSH 当前 Web profile 的插件管理器添加该包。
|
|
16
|
+
2. 打开侧栏「全质开源质量平台」。安装后入口暂时未出现时,刷新 DSH Web 页面或重新启动 DSH。
|
|
17
|
+
3. 首次打开选择「开始使用」建立空白业务台账。试用时可以在单独的数据环境选择「体验示例」。
|
|
18
|
+
|
|
19
|
+
可在命令行直接添加发布包:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add https://github.com/total-quality/dsh-total-quality/releases/download/v2.0.57/qip-real-workbench-2.0.57.tgz
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
如果手头已有安装包,可把上面命令中的网址换成本地 `.tgz` 路径。需要从源码目录安装时,见 [本机独立安装说明](本机独立安装说明.md)。
|
|
26
|
+
|
|
27
|
+
## 使用和维护
|
|
28
|
+
|
|
29
|
+
数据默认在 `~/.dsh/qip-real-workbench/data/`。其中包含 SQLite、原始文件和已生成报告。Windows 下的 `~` 对应当前用户目录。更新同一插件前,可从「数据管理」创建业务备份,然后用同一个 Web profile 添加新版本。
|
|
30
|
+
|
|
31
|
+
小质等助手通过 DSH 模型服务工作。企业可在「系统设置 → 模型数据权限」核对本地检索和模型处理设置。启用语音后,首次使用会准备中文识别模型。
|
|
32
|
+
|
|
33
|
+
安装完成后,在运行 DSH Web 的电脑上从侧栏打开统一工作台。窄窗口通过顶部「菜单」选择页面。业务备份和旧版迁移包的还原方法见[工作台使用与数据迁移](docs/enterprise-onboarding.md)。
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# 本机源码安装
|
|
2
|
-
|
|
3
|
-
在 DSH 中,可用插件管理器的 `install_bundle` 选择本仓库根目录的绝对路径。根目录包含 `package.json` 和 `cordis.patch.yml`。也可以把源码打包后再安装:
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
npm pack
|
|
7
|
-
dsh plugin --profile web add ./qip-real-workbench-2.0.49.tgz
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
安装完成后打开 DSH 侧栏「全质开源质量平台」。需要与原版同时试用时,这个包使用独立的 `qip-real-workbench` 标识和数据目录。贡献者可以先执行下面的自检:
|
|
11
|
-
|
|
12
|
-
```sh
|
|
13
|
-
node 自检.cjs
|
|
14
|
-
node --test test/*.test.cjs
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
相关入口和数据路径见 [安装说明](安装说明.md)。
|
|
1
|
+
# 本机源码安装
|
|
2
|
+
|
|
3
|
+
在 DSH 中,可用插件管理器的 `install_bundle` 选择本仓库根目录的绝对路径。根目录包含 `package.json` 和 `cordis.patch.yml`。也可以把源码打包后再安装:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm pack
|
|
7
|
+
dsh plugin --profile web add ./qip-real-workbench-2.0.49.tgz
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
安装完成后打开 DSH 侧栏「全质开源质量平台」。需要与原版同时试用时,这个包使用独立的 `qip-real-workbench` 标识和数据目录。贡献者可以先执行下面的自检:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
node 自检.cjs
|
|
14
|
+
node --test test/*.test.cjs
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
相关入口和数据路径见 [安装说明](安装说明.md)。
|