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/llm-bridge.cjs
CHANGED
|
@@ -1,234 +1,234 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* 真实大模型桥(DeepSeek Harness 内置 LLM 服务)
|
|
4
|
-
* ------------------------------------------------------------------
|
|
5
|
-
* 不使用任何本地写死的回复:每一次对话都通过 ctx.llm 向真实 DeepSeek 模型发起请求,
|
|
6
|
-
* 无需在本插件里另外填 API Key。
|
|
7
|
-
*
|
|
8
|
-
* 模型策略(2026-11 起):
|
|
9
|
-
* ① 默认锁定最新旗舰 —— PREFERRED(deepseek-official / deepseek-flash,即 DeepSeek-V4.1-Flash);
|
|
10
|
-
* ② 若宿主要解析不到该模型(prepareCall 失败),自动回落到 Harness 当前选中模型,
|
|
11
|
-
* 并把回落的告警打到日志,不会让对话直接失败;
|
|
12
|
-
* ③ 可用环境变量覆盖锁定目标:QIP_LLM_PROVIDER / QIP_LLM_MODEL。
|
|
13
|
-
*/
|
|
14
|
-
const { outbound } = require('./src/lib/privacy');
|
|
15
|
-
const PREFERRED = {
|
|
16
|
-
provider: process.env.QIP_LLM_PROVIDER || 'deepseek-official',
|
|
17
|
-
model: process.env.QIP_LLM_MODEL || 'deepseek-flash',
|
|
18
|
-
label: 'DeepSeek-V4.1-Flash',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
function createBridge(ctx) {
|
|
22
|
-
let retryPinnedAt = 0;
|
|
23
|
-
let lastSuccess = null;
|
|
24
|
-
let lastFailure = null;
|
|
25
|
-
|
|
26
|
-
function unavailable(error) {
|
|
27
|
-
if (['MODEL_NOT_FOUND', 'UNKNOWN_MODEL', 'PROVIDER_NOT_FOUND', 'MODEL_UNAVAILABLE', 'PROVIDER_NOT_CONFIGURED'].includes(error?.code)) return true;
|
|
28
|
-
return /(?:unknown|unsupported|unconfigured) (?:model|provider)|(?:model|provider)\b.*(?:not found|not configured|unavailable)|(?:找不到|未找到|未知)(?:该|指定)?(?:模型|供应商|提供商)/i.test(error?.message || '');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function llmService() {
|
|
32
|
-
try {
|
|
33
|
-
return ctx.get('llm') || null;
|
|
34
|
-
} catch (_) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Harness 当前选中模型(用户在 Harness 里登录/切换的那一个) */
|
|
40
|
-
function harnessSelection() {
|
|
41
|
-
try {
|
|
42
|
-
const model = ctx.get('agentDefaultModel');
|
|
43
|
-
if (!llmService() || !model) return null;
|
|
44
|
-
const sel = model.currentSelection();
|
|
45
|
-
if (!sel || !sel.provider || !sel.model) return null;
|
|
46
|
-
return { provider: sel.provider, model: sel.model, pinned: false };
|
|
47
|
-
} catch (_) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** 对外报告的模型:优先锁定模型,锁定失效则回落到 Harness 当前模型 */
|
|
53
|
-
function selection() {
|
|
54
|
-
if (!llmService()) return null;
|
|
55
|
-
if (Date.now() >= retryPinnedAt && PREFERRED.provider && PREFERRED.model) {
|
|
56
|
-
return { provider: PREFERRED.provider, model: PREFERRED.model, label: PREFERRED.label, pinned: true };
|
|
57
|
-
}
|
|
58
|
-
return harnessSelection();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function noModelError() {
|
|
62
|
-
const err = new Error('Harness 当前没有可用模型(请先在 Harness 里完成模型接入)');
|
|
63
|
-
err.code = 'NO_MODEL';
|
|
64
|
-
return err;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function prepare(info, maxTokens, signal, reasoning) {
|
|
68
|
-
const llm = llmService();
|
|
69
|
-
if (!llm) throw noModelError();
|
|
70
|
-
const configure = reasoning === false ? (controls, modelInfo) =>
|
|
71
|
-
modelInfo.reasoning?.efforts?.some(({ id }) => id === 'off') ? { ...controls, reasoningEffort: 'off' } : controls
|
|
72
|
-
: undefined;
|
|
73
|
-
return llm.prepareCall({ provider: info.provider, model: info.model, maxTokens }, signal, configure);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** 流式调用一次模型,返回完整文本。 */
|
|
77
|
-
async function invoke({ system, user, maxTokens = 3200, signal, onDelta, keepPartial = false, reasoning: useReasoning, photo }) {
|
|
78
|
-
signal?.throwIfAborted();
|
|
79
|
-
const first = selection();
|
|
80
|
-
if (!first) throw noModelError();
|
|
81
|
-
|
|
82
|
-
let info = first;
|
|
83
|
-
let call;
|
|
84
|
-
try {
|
|
85
|
-
call = await prepare(first, maxTokens, signal, useReasoning);
|
|
86
|
-
} catch (err) {
|
|
87
|
-
// 锁定模型宿主解析不到(或该 provider 未登录):回落到 Harness 当前模型,只回落一次
|
|
88
|
-
signal?.throwIfAborted();
|
|
89
|
-
if (!first.pinned || !unavailable(err)) throw err;
|
|
90
|
-
retryPinnedAt = Date.now() + 60_000;
|
|
91
|
-
const fallback = harnessSelection();
|
|
92
|
-
if (!fallback || (fallback.provider === first.provider && fallback.model === first.model)) throw err;
|
|
93
|
-
console.warn(
|
|
94
|
-
'[qip-real-workbench] 锁定模型 ' + first.provider + ' / ' + first.model + ' 不可用(' + err.message + '),回落到 Harness 当前模型 ' + fallback.provider + ' / ' + fallback.model,
|
|
95
|
-
);
|
|
96
|
-
info = fallback;
|
|
97
|
-
call = await prepare(fallback, maxTokens, signal, useReasoning);
|
|
98
|
-
}
|
|
99
|
-
if (photo && call.inputModalities?.includes('image') !== true) {
|
|
100
|
-
const fallback=harnessSelection();
|
|
101
|
-
if (fallback && (fallback.provider!==info.provider || fallback.model!==info.model)) {
|
|
102
|
-
call=await prepare(fallback,maxTokens,signal,useReasoning);
|
|
103
|
-
info=fallback;
|
|
104
|
-
}
|
|
105
|
-
if (call.inputModalities?.includes('image') !== true) {
|
|
106
|
-
throw Object.assign(new Error('当前模型未声明支持图片,可填写照片中看到的现象后上报'),{status:409});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
const content = [{type:'text',text:outbound(String(user))}];
|
|
110
|
-
if (photo) {
|
|
111
|
-
const attachments = ctx.get('attachments');
|
|
112
|
-
if (typeof attachments?.saveImage!=='function') throw Object.assign(new Error('当前 DSH 未启用图片处理服务'),{status:409});
|
|
113
|
-
signal?.throwIfAborted();
|
|
114
|
-
const attachment=await attachments.saveImage(photo);
|
|
115
|
-
signal?.throwIfAborted();
|
|
116
|
-
content.push({type:'image',attachment});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
let text = '';
|
|
120
|
-
let usage = null;
|
|
121
|
-
let finishReason = null;
|
|
122
|
-
const stream = call.stream({
|
|
123
|
-
...call.config,
|
|
124
|
-
system: outbound(system),
|
|
125
|
-
messages: [{ role: 'user', content }],
|
|
126
|
-
signal,
|
|
127
|
-
});
|
|
128
|
-
try {
|
|
129
|
-
for await (const chunk of stream) {
|
|
130
|
-
if (chunk.type === 'text-delta') {
|
|
131
|
-
text += chunk.text;
|
|
132
|
-
if (onDelta) onDelta(chunk.text);
|
|
133
|
-
} else if (chunk.type === 'usage') {
|
|
134
|
-
usage = chunk.usage;
|
|
135
|
-
} else if (chunk.type === 'finish') {
|
|
136
|
-
const kind = chunk.reason && chunk.reason.kind;
|
|
137
|
-
finishReason = kind || null;
|
|
138
|
-
if (kind === 'error' || kind === 'aborted') {
|
|
139
|
-
const failure = (chunk.reason && chunk.reason.failure) || {};
|
|
140
|
-
throw Object.assign(new Error(failure.message || (kind === 'aborted' ? '模型调用被中断' : '模型调用失败')), {
|
|
141
|
-
name: kind === 'aborted' ? 'AbortError' : 'Error', code: failure.code,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
} catch (error) {
|
|
147
|
-
if (!keepPartial || (!text && !signal?.aborted)) throw error;
|
|
148
|
-
finishReason = signal?.aborted || error.name === 'AbortError' ? 'aborted' : 'interrupted';
|
|
149
|
-
}
|
|
150
|
-
if (!keepPartial) {
|
|
151
|
-
signal?.throwIfAborted();
|
|
152
|
-
if (!text.trim()) throw new Error('模型没有返回可用文本');
|
|
153
|
-
}
|
|
154
|
-
if (finishReason === 'stop') lastSuccess = { provider: info.provider, model: info.model, pinned: !!info.pinned, at: new Date().toISOString() };
|
|
155
|
-
lastFailure = null;
|
|
156
|
-
return { text, usage, finishReason, provider: info.provider, model: info.model, pinned: !!info.pinned };
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
async function complete(options) {
|
|
160
|
-
try {
|
|
161
|
-
return await invoke(options);
|
|
162
|
-
} catch (error) {
|
|
163
|
-
if (!options.signal?.aborted && error.name !== 'AbortError') {
|
|
164
|
-
lastFailure = { kind: unavailable(error) ? 'model_unavailable' :
|
|
165
|
-
error.name === 'TimeoutError' || error.code === 'ETIMEDOUT' ? 'timeout' : 'request_failed', at: new Date().toISOString() };
|
|
166
|
-
}
|
|
167
|
-
throw error;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function status() {
|
|
172
|
-
const candidate = selection();
|
|
173
|
-
const sameModel = !!candidate && lastSuccess?.provider === candidate.provider && lastSuccess?.model === candidate.model;
|
|
174
|
-
return { serviceAvailable: !!llmService(), candidate, lastSuccess, lastFailure,
|
|
175
|
-
verified: sameModel && !lastFailure };
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function parseJson(text) {
|
|
179
|
-
const raw = String(text || '').trim().replace(/^```(?:json)?\s*|\s*```$/gi, '');
|
|
180
|
-
const value = JSON.parse(raw);
|
|
181
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('自检要求返回 JSON 对象');
|
|
182
|
-
return value;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
async function ping() {
|
|
186
|
-
const steps = [];
|
|
187
|
-
const info = selection();
|
|
188
|
-
steps.push({ name: '① 模型选择', ok: !!info,
|
|
189
|
-
detail: info ? info.provider + ' / ' + info.model : 'Harness 没有可选模型', ms: 0 });
|
|
190
|
-
if (!info) return { ok: false, steps, ...status() };
|
|
191
|
-
|
|
192
|
-
const check = async (name, work) => {
|
|
193
|
-
const t0 = Date.now();
|
|
194
|
-
try {
|
|
195
|
-
const detail = await work();
|
|
196
|
-
steps.push({ name, ok: true, detail, ms: Date.now() - t0 });
|
|
197
|
-
} catch (error) {
|
|
198
|
-
steps.push({ name, ok: false, detail: error.message, ms: Date.now() - t0 });
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
await check('② 对话能力', async () => {
|
|
202
|
-
const reply = await complete({ system: '您是连通性自检助手。', user: '只回复两个字:正常', maxTokens: 128 });
|
|
203
|
-
return '实际响应 ' + reply.provider + ' / ' + reply.model;
|
|
204
|
-
});
|
|
205
|
-
await check('③ 结构化输出', async () => {
|
|
206
|
-
const reply = await complete({ system: '只输出一个 JSON 对象。', user: '输出 {"ok":true}', maxTokens: 256 });
|
|
207
|
-
const result = parseJson(reply.text);
|
|
208
|
-
if (result.ok !== true) throw new Error('应返回布尔字段 ok=true');
|
|
209
|
-
return 'JSON 已解析并通过字段校验';
|
|
210
|
-
});
|
|
211
|
-
await check('④ 工具编排', async () => {
|
|
212
|
-
const call = await complete({
|
|
213
|
-
system: '只可调用固定的只读统计工具 stat_describe。请用 JSON 指定工具名 tool、参数 args。',
|
|
214
|
-
user: '用 stat_describe 统计数组 [2,4,6]。只输出 {"tool":"stat_describe","args":{"values":[2,4,6]}}',
|
|
215
|
-
maxTokens: 256,
|
|
216
|
-
});
|
|
217
|
-
const action = parseJson(call.text);
|
|
218
|
-
if (action.tool !== 'stat_describe' || JSON.stringify(action.args?.values) !== '[2,4,6]') {
|
|
219
|
-
throw new Error('未获得合格的只读工具调用');
|
|
220
|
-
}
|
|
221
|
-
const tool = require('./src/tools/registry').get('stat_describe');
|
|
222
|
-
if (!tool || tool.write) throw new Error('只读自检工具未注册');
|
|
223
|
-
const result = tool.run({ values: [2, 4, 6] });
|
|
224
|
-
if (!result.ok || result.n !== 3 || result.统计量?.均值 !== 4) throw new Error('只读工具回执校验失败');
|
|
225
|
-
return '实际执行 stat_describe,回执 n=3,均值=4';
|
|
226
|
-
});
|
|
227
|
-
return { ok: steps.every((step) => step.ok), steps, model: lastSuccess, ...status() };
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return { selection, complete, ping, status, preferred: PREFERRED };
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
module.exports = { createBridge, PREFERRED };
|
|
234
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* 真实大模型桥(DeepSeek Harness 内置 LLM 服务)
|
|
4
|
+
* ------------------------------------------------------------------
|
|
5
|
+
* 不使用任何本地写死的回复:每一次对话都通过 ctx.llm 向真实 DeepSeek 模型发起请求,
|
|
6
|
+
* 无需在本插件里另外填 API Key。
|
|
7
|
+
*
|
|
8
|
+
* 模型策略(2026-11 起):
|
|
9
|
+
* ① 默认锁定最新旗舰 —— PREFERRED(deepseek-official / deepseek-flash,即 DeepSeek-V4.1-Flash);
|
|
10
|
+
* ② 若宿主要解析不到该模型(prepareCall 失败),自动回落到 Harness 当前选中模型,
|
|
11
|
+
* 并把回落的告警打到日志,不会让对话直接失败;
|
|
12
|
+
* ③ 可用环境变量覆盖锁定目标:QIP_LLM_PROVIDER / QIP_LLM_MODEL。
|
|
13
|
+
*/
|
|
14
|
+
const { outbound } = require('./src/lib/privacy');
|
|
15
|
+
const PREFERRED = {
|
|
16
|
+
provider: process.env.QIP_LLM_PROVIDER || 'deepseek-official',
|
|
17
|
+
model: process.env.QIP_LLM_MODEL || 'deepseek-flash',
|
|
18
|
+
label: 'DeepSeek-V4.1-Flash',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function createBridge(ctx) {
|
|
22
|
+
let retryPinnedAt = 0;
|
|
23
|
+
let lastSuccess = null;
|
|
24
|
+
let lastFailure = null;
|
|
25
|
+
|
|
26
|
+
function unavailable(error) {
|
|
27
|
+
if (['MODEL_NOT_FOUND', 'UNKNOWN_MODEL', 'PROVIDER_NOT_FOUND', 'MODEL_UNAVAILABLE', 'PROVIDER_NOT_CONFIGURED'].includes(error?.code)) return true;
|
|
28
|
+
return /(?:unknown|unsupported|unconfigured) (?:model|provider)|(?:model|provider)\b.*(?:not found|not configured|unavailable)|(?:找不到|未找到|未知)(?:该|指定)?(?:模型|供应商|提供商)/i.test(error?.message || '');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function llmService() {
|
|
32
|
+
try {
|
|
33
|
+
return ctx.get('llm') || null;
|
|
34
|
+
} catch (_) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Harness 当前选中模型(用户在 Harness 里登录/切换的那一个) */
|
|
40
|
+
function harnessSelection() {
|
|
41
|
+
try {
|
|
42
|
+
const model = ctx.get('agentDefaultModel');
|
|
43
|
+
if (!llmService() || !model) return null;
|
|
44
|
+
const sel = model.currentSelection();
|
|
45
|
+
if (!sel || !sel.provider || !sel.model) return null;
|
|
46
|
+
return { provider: sel.provider, model: sel.model, pinned: false };
|
|
47
|
+
} catch (_) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** 对外报告的模型:优先锁定模型,锁定失效则回落到 Harness 当前模型 */
|
|
53
|
+
function selection() {
|
|
54
|
+
if (!llmService()) return null;
|
|
55
|
+
if (Date.now() >= retryPinnedAt && PREFERRED.provider && PREFERRED.model) {
|
|
56
|
+
return { provider: PREFERRED.provider, model: PREFERRED.model, label: PREFERRED.label, pinned: true };
|
|
57
|
+
}
|
|
58
|
+
return harnessSelection();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function noModelError() {
|
|
62
|
+
const err = new Error('Harness 当前没有可用模型(请先在 Harness 里完成模型接入)');
|
|
63
|
+
err.code = 'NO_MODEL';
|
|
64
|
+
return err;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function prepare(info, maxTokens, signal, reasoning) {
|
|
68
|
+
const llm = llmService();
|
|
69
|
+
if (!llm) throw noModelError();
|
|
70
|
+
const configure = reasoning === false ? (controls, modelInfo) =>
|
|
71
|
+
modelInfo.reasoning?.efforts?.some(({ id }) => id === 'off') ? { ...controls, reasoningEffort: 'off' } : controls
|
|
72
|
+
: undefined;
|
|
73
|
+
return llm.prepareCall({ provider: info.provider, model: info.model, maxTokens }, signal, configure);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** 流式调用一次模型,返回完整文本。 */
|
|
77
|
+
async function invoke({ system, user, maxTokens = 3200, signal, onDelta, keepPartial = false, reasoning: useReasoning, photo }) {
|
|
78
|
+
signal?.throwIfAborted();
|
|
79
|
+
const first = selection();
|
|
80
|
+
if (!first) throw noModelError();
|
|
81
|
+
|
|
82
|
+
let info = first;
|
|
83
|
+
let call;
|
|
84
|
+
try {
|
|
85
|
+
call = await prepare(first, maxTokens, signal, useReasoning);
|
|
86
|
+
} catch (err) {
|
|
87
|
+
// 锁定模型宿主解析不到(或该 provider 未登录):回落到 Harness 当前模型,只回落一次
|
|
88
|
+
signal?.throwIfAborted();
|
|
89
|
+
if (!first.pinned || !unavailable(err)) throw err;
|
|
90
|
+
retryPinnedAt = Date.now() + 60_000;
|
|
91
|
+
const fallback = harnessSelection();
|
|
92
|
+
if (!fallback || (fallback.provider === first.provider && fallback.model === first.model)) throw err;
|
|
93
|
+
console.warn(
|
|
94
|
+
'[qip-real-workbench] 锁定模型 ' + first.provider + ' / ' + first.model + ' 不可用(' + err.message + '),回落到 Harness 当前模型 ' + fallback.provider + ' / ' + fallback.model,
|
|
95
|
+
);
|
|
96
|
+
info = fallback;
|
|
97
|
+
call = await prepare(fallback, maxTokens, signal, useReasoning);
|
|
98
|
+
}
|
|
99
|
+
if (photo && call.inputModalities?.includes('image') !== true) {
|
|
100
|
+
const fallback=harnessSelection();
|
|
101
|
+
if (fallback && (fallback.provider!==info.provider || fallback.model!==info.model)) {
|
|
102
|
+
call=await prepare(fallback,maxTokens,signal,useReasoning);
|
|
103
|
+
info=fallback;
|
|
104
|
+
}
|
|
105
|
+
if (call.inputModalities?.includes('image') !== true) {
|
|
106
|
+
throw Object.assign(new Error('当前模型未声明支持图片,可填写照片中看到的现象后上报'),{status:409});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const content = [{type:'text',text:outbound(String(user))}];
|
|
110
|
+
if (photo) {
|
|
111
|
+
const attachments = ctx.get('attachments');
|
|
112
|
+
if (typeof attachments?.saveImage!=='function') throw Object.assign(new Error('当前 DSH 未启用图片处理服务'),{status:409});
|
|
113
|
+
signal?.throwIfAborted();
|
|
114
|
+
const attachment=await attachments.saveImage(photo);
|
|
115
|
+
signal?.throwIfAborted();
|
|
116
|
+
content.push({type:'image',attachment});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
let text = '';
|
|
120
|
+
let usage = null;
|
|
121
|
+
let finishReason = null;
|
|
122
|
+
const stream = call.stream({
|
|
123
|
+
...call.config,
|
|
124
|
+
system: outbound(system),
|
|
125
|
+
messages: [{ role: 'user', content }],
|
|
126
|
+
signal,
|
|
127
|
+
});
|
|
128
|
+
try {
|
|
129
|
+
for await (const chunk of stream) {
|
|
130
|
+
if (chunk.type === 'text-delta') {
|
|
131
|
+
text += chunk.text;
|
|
132
|
+
if (onDelta) onDelta(chunk.text);
|
|
133
|
+
} else if (chunk.type === 'usage') {
|
|
134
|
+
usage = chunk.usage;
|
|
135
|
+
} else if (chunk.type === 'finish') {
|
|
136
|
+
const kind = chunk.reason && chunk.reason.kind;
|
|
137
|
+
finishReason = kind || null;
|
|
138
|
+
if (kind === 'error' || kind === 'aborted') {
|
|
139
|
+
const failure = (chunk.reason && chunk.reason.failure) || {};
|
|
140
|
+
throw Object.assign(new Error(failure.message || (kind === 'aborted' ? '模型调用被中断' : '模型调用失败')), {
|
|
141
|
+
name: kind === 'aborted' ? 'AbortError' : 'Error', code: failure.code,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (!keepPartial || (!text && !signal?.aborted)) throw error;
|
|
148
|
+
finishReason = signal?.aborted || error.name === 'AbortError' ? 'aborted' : 'interrupted';
|
|
149
|
+
}
|
|
150
|
+
if (!keepPartial) {
|
|
151
|
+
signal?.throwIfAborted();
|
|
152
|
+
if (!text.trim()) throw new Error('模型没有返回可用文本');
|
|
153
|
+
}
|
|
154
|
+
if (finishReason === 'stop') lastSuccess = { provider: info.provider, model: info.model, pinned: !!info.pinned, at: new Date().toISOString() };
|
|
155
|
+
lastFailure = null;
|
|
156
|
+
return { text, usage, finishReason, provider: info.provider, model: info.model, pinned: !!info.pinned };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function complete(options) {
|
|
160
|
+
try {
|
|
161
|
+
return await invoke(options);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (!options.signal?.aborted && error.name !== 'AbortError') {
|
|
164
|
+
lastFailure = { kind: unavailable(error) ? 'model_unavailable' :
|
|
165
|
+
error.name === 'TimeoutError' || error.code === 'ETIMEDOUT' ? 'timeout' : 'request_failed', at: new Date().toISOString() };
|
|
166
|
+
}
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function status() {
|
|
172
|
+
const candidate = selection();
|
|
173
|
+
const sameModel = !!candidate && lastSuccess?.provider === candidate.provider && lastSuccess?.model === candidate.model;
|
|
174
|
+
return { serviceAvailable: !!llmService(), candidate, lastSuccess, lastFailure,
|
|
175
|
+
verified: sameModel && !lastFailure };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function parseJson(text) {
|
|
179
|
+
const raw = String(text || '').trim().replace(/^```(?:json)?\s*|\s*```$/gi, '');
|
|
180
|
+
const value = JSON.parse(raw);
|
|
181
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('自检要求返回 JSON 对象');
|
|
182
|
+
return value;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async function ping() {
|
|
186
|
+
const steps = [];
|
|
187
|
+
const info = selection();
|
|
188
|
+
steps.push({ name: '① 模型选择', ok: !!info,
|
|
189
|
+
detail: info ? info.provider + ' / ' + info.model : 'Harness 没有可选模型', ms: 0 });
|
|
190
|
+
if (!info) return { ok: false, steps, ...status() };
|
|
191
|
+
|
|
192
|
+
const check = async (name, work) => {
|
|
193
|
+
const t0 = Date.now();
|
|
194
|
+
try {
|
|
195
|
+
const detail = await work();
|
|
196
|
+
steps.push({ name, ok: true, detail, ms: Date.now() - t0 });
|
|
197
|
+
} catch (error) {
|
|
198
|
+
steps.push({ name, ok: false, detail: error.message, ms: Date.now() - t0 });
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
await check('② 对话能力', async () => {
|
|
202
|
+
const reply = await complete({ system: '您是连通性自检助手。', user: '只回复两个字:正常', maxTokens: 128 });
|
|
203
|
+
return '实际响应 ' + reply.provider + ' / ' + reply.model;
|
|
204
|
+
});
|
|
205
|
+
await check('③ 结构化输出', async () => {
|
|
206
|
+
const reply = await complete({ system: '只输出一个 JSON 对象。', user: '输出 {"ok":true}', maxTokens: 256 });
|
|
207
|
+
const result = parseJson(reply.text);
|
|
208
|
+
if (result.ok !== true) throw new Error('应返回布尔字段 ok=true');
|
|
209
|
+
return 'JSON 已解析并通过字段校验';
|
|
210
|
+
});
|
|
211
|
+
await check('④ 工具编排', async () => {
|
|
212
|
+
const call = await complete({
|
|
213
|
+
system: '只可调用固定的只读统计工具 stat_describe。请用 JSON 指定工具名 tool、参数 args。',
|
|
214
|
+
user: '用 stat_describe 统计数组 [2,4,6]。只输出 {"tool":"stat_describe","args":{"values":[2,4,6]}}',
|
|
215
|
+
maxTokens: 256,
|
|
216
|
+
});
|
|
217
|
+
const action = parseJson(call.text);
|
|
218
|
+
if (action.tool !== 'stat_describe' || JSON.stringify(action.args?.values) !== '[2,4,6]') {
|
|
219
|
+
throw new Error('未获得合格的只读工具调用');
|
|
220
|
+
}
|
|
221
|
+
const tool = require('./src/tools/registry').get('stat_describe');
|
|
222
|
+
if (!tool || tool.write) throw new Error('只读自检工具未注册');
|
|
223
|
+
const result = tool.run({ values: [2, 4, 6] });
|
|
224
|
+
if (!result.ok || result.n !== 3 || result.统计量?.均值 !== 4) throw new Error('只读工具回执校验失败');
|
|
225
|
+
return '实际执行 stat_describe,回执 n=3,均值=4';
|
|
226
|
+
});
|
|
227
|
+
return { ok: steps.every((step) => step.ok), steps, model: lastSuccess, ...status() };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return { selection, complete, ping, status, preferred: PREFERRED };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = { createBridge, PREFERRED };
|
|
234
|
+
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"title": "全质开源质量平台",
|
|
4
|
-
"description": "An open-source (MIT) quality improvement platform: every number is computed by the built-in statistics engine, all business data is persisted to a local SQLite database, reports are exported as real Word/Excel files, and AI chat uses the real model currently configured in DeepSeek Harness. 16 real quality tools are exposed to the agent."
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "全质开源质量平台",
|
|
4
|
+
"description": "An open-source (MIT) quality improvement platform: every number is computed by the built-in statistics engine, all business data is persisted to a local SQLite database, reports are exported as real Word/Excel files, and AI chat uses the real model currently configured in DeepSeek Harness. 16 real quality tools are exposed to the agent."
|
|
5
|
+
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"title": "全质开源质量平台",
|
|
4
|
-
"description": "开源质量改进平台(MIT):所有数字由内置统计引擎实算,所有数据写入本机 SQLite 数据库,报告导出为真正的 Word/Excel 文件;AI 对话调用 DeepSeek Harness 当前登录的真实模型,并把 16 个真实质量工具交给智能体。"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "全质开源质量平台",
|
|
4
|
+
"description": "开源质量改进平台(MIT):所有数字由内置统计引擎实算,所有数据写入本机 SQLite 数据库,报告导出为真正的 Word/Excel 文件;AI 对话调用 DeepSeek Harness 当前登录的真实模型,并把 16 个真实质量工具交给智能体。"
|
|
5
|
+
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-total-quality",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.57",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "独立安装的全质开源质量平台,页面 /qip-real-workbench/,工具 qip_workbench_*,数据 ~/.dsh/qip-real-workbench/data。开源质量改进平台(DeepSeek Harness 插件):真实 SQLite 数据库、真实统计引擎(SPC/八大判异/Cpk/GR&R/DOE)、真实 Word/Excel 报告导出;对话默认锁定 DeepSeek-V4.1-Flash(deepseek-official / deepseek-flash),并把 16 个真实质量工具交给智能体。",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"src/**/*.js",
|
|
53
53
|
"src/lib/voice-hotwords.txt",
|
|
54
54
|
"src/package.json",
|
|
55
|
-
"public/**/*",
|
|
55
|
+
"public/**/*",
|
|
56
|
+
"resources/qms-templates/*",
|
|
56
57
|
"locale/*.json",
|
|
57
58
|
"icon.svg",
|
|
58
59
|
"README.md",
|
package/public/app.css
CHANGED
|
@@ -377,6 +377,9 @@ select.inp { background:#fff; }
|
|
|
377
377
|
|
|
378
378
|
/* ---------- 移动端适配(页面内预览) ---------- */
|
|
379
379
|
.phone-frame { width:330px; background:#111; border-radius:38px; padding:10px; box-shadow:0 18px 40px rgba(0,0,0,.18); flex-shrink:0; }
|
|
380
|
+
.mobile-preview-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:24px 18px; max-width:1100px; margin:0 auto; }
|
|
381
|
+
.mobile-preview-card { min-width:0; display:flex; flex-direction:column; align-items:center; gap:12px; }
|
|
382
|
+
.mobile-preview-card .phone-frame { box-sizing:border-box; max-width:100%; }
|
|
380
383
|
.phone-screen { background:#f2f4f8; border-radius:30px; overflow:hidden; height:660px; display:flex; flex-direction:column; position:relative; }
|
|
381
384
|
.phone-notch { width:110px; height:20px; background:#111; border-radius:0 0 12px 12px; margin:0 auto; position:relative; z-index:5; }
|
|
382
385
|
.phone-status { display:flex; justify-content:space-between; padding:4px 18px 2px; font-size:10px; color:#1a2233; background:#fff; }
|
package/public/app.js
CHANGED
|
@@ -103,7 +103,6 @@ global.Scale = {
|
|
|
103
103
|
content.scrollTop = 0;
|
|
104
104
|
decorateFooter();
|
|
105
105
|
if (def.mount) def.mount();
|
|
106
|
-
void global.WorkbenchNotices?.refresh();
|
|
107
106
|
} catch (e) {
|
|
108
107
|
if (request !== pageRequest) return;
|
|
109
108
|
console.error(e);
|
|
@@ -236,7 +235,6 @@ global.Scale = {
|
|
|
236
235
|
};
|
|
237
236
|
},
|
|
238
237
|
...QualityWorkflow.actions,
|
|
239
|
-
...RemoteKnowledge.actions,
|
|
240
238
|
/* ---------- 今天 / 小质 / 事项 ---------- */
|
|
241
239
|
toggleXiaozhi: () => global.XiaoZhi.toggle(),
|
|
242
240
|
openXiaozhi: () => global.XiaoZhi.open(),
|
|
@@ -1109,6 +1107,12 @@ global.Scale = {
|
|
|
1109
1107
|
<b>6. 六大业务插件核心接口</b>:<code>getMeasureData / getScrapLine / getTraceByVIN / getBatchByWorkstation</code>(MES)、<code>getBOM / getBatch / getSupplier / getCost</code>(ERP)、<code>startWorkflow / pushTodo / getOrgTree</code>(OA)、<code>submitBenefit / getVerifiedBenefit</code>(FIN)、<code>getControlChart / getRuleViolations / getCpk</code>(SPC)、<code>getDefects / getImageResult</code>(AQI)。
|
|
1110
1108
|
</div>`,
|
|
1111
1109
|
}),
|
|
1110
|
+
mobileGuide: () => modal({
|
|
1111
|
+
width:'narrow', title:'移动端说明',
|
|
1112
|
+
body:'<p>在手机浏览器中打开可访问的 DSH Web 地址,进入全质插件。窄屏下通过顶部「菜单」进入各页面。</p>' +
|
|
1113
|
+
'<p>预览中的驾驶舱和待办读取当前台账,其余界面以示例说明布局。</p>',
|
|
1114
|
+
}),
|
|
1115
|
+
|
|
1112
1116
|
/* ---------- 数据管理 ---------- */
|
|
1113
1117
|
openImportedFiles: ({target}) => { closeModal(); return Pages.companyLibrary.openImports(target); },
|
|
1114
1118
|
importFile: (a) => {
|
package/public/index.html
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
6
|
<title>全质开源质量平台</title>
|
|
7
7
|
<link rel="icon" id="brandIcon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='20' fill='%230b3ea8'/><text x='50' y='68' font-size='58' text-anchor='middle' fill='white' font-family='sans-serif'>全</text></svg>">
|
|
8
|
-
<link rel="stylesheet" href="app.css?v=
|
|
8
|
+
<link rel="stylesheet" href="app.css?v=20261205-mobile-preview">
|
|
9
9
|
<link rel="stylesheet" href="company-knowledge.css?v=2.0.41">
|
|
10
10
|
<link rel="stylesheet" href="enterprise-survey.css?v=20261126-survey-dates">
|
|
11
11
|
<link rel="stylesheet" href="xiaozhi.css?v=2.0.49">
|
|
12
12
|
<link rel="stylesheet" href="business-controls.css?v=2.0.44">
|
|
13
13
|
<link rel="stylesheet" href="workbench.css?v=20261204-workspace">
|
|
14
|
-
<link rel="stylesheet" href="
|
|
15
|
-
<link rel="stylesheet" href="responsive.css?v=20261204-workspace">
|
|
14
|
+
<link rel="stylesheet" href="responsive.css?v=20261205-2">
|
|
16
15
|
</head>
|
|
17
16
|
<body>
|
|
18
17
|
<div class="app">
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
<button type="button" class="nav-item nav-parent" aria-expanded="false">知识与团队<span class="caret">▾</span></button>
|
|
70
69
|
<div class="nav-drop">
|
|
71
70
|
<a class="nav-item" data-page="companyLibrary" href="#companyLibrary">企业知识库</a>
|
|
72
|
-
<a class="nav-item" data-page="remoteKnowledge" href="#remoteKnowledge">远程知识库</a>
|
|
73
71
|
<a class="nav-item" data-page="qualityQuestions" href="#qualityQuestions">问问题</a>
|
|
74
72
|
<a class="nav-item" data-page="growth" href="#growth">员工成长中心</a>
|
|
75
73
|
</div>
|
|
@@ -79,6 +77,7 @@
|
|
|
79
77
|
<button type="button" class="nav-item nav-parent" aria-expanded="false">帮助<span class="caret">▾</span></button>
|
|
80
78
|
<div class="nav-drop">
|
|
81
79
|
<a class="nav-item" data-page="arch" href="#arch">DeepSeek 插件架构</a>
|
|
80
|
+
<a class="nav-item" data-page="mobile" href="#mobile">移动端适配</a>
|
|
82
81
|
<a class="nav-item" data-page="settings" href="#settings">系统设置</a>
|
|
83
82
|
<a class="nav-item" href="platform-site/index.html" target="_blank" rel="noopener">平台帮助</a>
|
|
84
83
|
</div>
|
|
@@ -86,8 +85,8 @@
|
|
|
86
85
|
</nav>
|
|
87
86
|
|
|
88
87
|
<div class="nav-right">
|
|
89
|
-
<button type="button" class="btn" id="wbNotices" aria-label="质量提醒">提醒<span></span></button>
|
|
90
88
|
<button type="button" class="btn" id="qipMobileMenuButton" aria-haspopup="dialog" aria-controls="qipMobileMenu">菜单</button>
|
|
89
|
+
<button type="button" id="pluginUpdate" class="btn btn-sm btn-primary" hidden>当前版本可更新,点击更新</button>
|
|
91
90
|
<span class="ds-chip" id="chipModel">模型未配置</span><span class="ds-chip pu">深度推理</span>
|
|
92
91
|
<span class="ds-chip" id="chipStatus">检查中…</span>
|
|
93
92
|
<div class="nav-org" id="navOrg">某制造型企业 · 质量改进部门</div>
|
|
@@ -162,7 +161,6 @@
|
|
|
162
161
|
<script src="js/api.js?v=20261204-workspace"></script>
|
|
163
162
|
<script src="vendor/markdown-it-15.0.3.umd.min.js"></script>
|
|
164
163
|
<script src="js/ui.js?v=2.0.47"></script>
|
|
165
|
-
<script src="js/workbench-notices.js?v=2.0.48"></script>
|
|
166
164
|
<script src="js/assistant-history.js?v=2.0.17"></script>
|
|
167
165
|
<script src="js/pages-today.js?v=20261204-workspace"></script>
|
|
168
166
|
<script src="js/pages-thanks.js"></script>
|
|
@@ -174,7 +172,7 @@
|
|
|
174
172
|
<script src="js/pages-analytics.js?v=20261204-workspace"></script>
|
|
175
173
|
<script src="js/pages-kb.js?v=20261204-workspace"></script>
|
|
176
174
|
<script src="js/pages-growth.js?v=20261204-workspace"></script>
|
|
177
|
-
<script src="js/pages-company-knowledge.js?v=
|
|
175
|
+
<script src="js/pages-company-knowledge.js?v=20261205-workspace"></script>
|
|
178
176
|
<script src="js/business-controls.js?v=20261204-workspace"></script>
|
|
179
177
|
<script src="js/pages-system.js?v=20261204-workspace"></script>
|
|
180
178
|
<script src="js/pages-qms.js?v=2.0.48"></script>
|
|
@@ -184,8 +182,9 @@
|
|
|
184
182
|
<script src="js/xiaozhi-voice.js?v=2.0.31"></script>
|
|
185
183
|
<script src="js/quality-workflow.js?v=20261204-workspace"></script>
|
|
186
184
|
<script src="js/xiaozhi.js?v=20261204-workspace"></script>
|
|
187
|
-
<script src="js/
|
|
188
|
-
<script src="
|
|
185
|
+
<script src="js/mobile-preview.js?v=20261205"></script>
|
|
186
|
+
<script src="js/plugin-updates.js?v=20261205-2"></script>
|
|
187
|
+
<script src="app.js?v=20261205-1"></script>
|
|
189
188
|
</body>
|
|
190
189
|
</html>
|
|
191
190
|
|