@inupedia/spotlight-vue 0.8.5 → 0.9.0
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/dist/assets/spotlight-vue.css +1 -1
- package/dist/avatar/speech/live2dTtsPlayback.d.ts +15 -2
- package/dist/avatar/speech/live2dTtsPlayback.d.ts.map +1 -1
- package/dist/avatar/speech/live2dTtsPlayback.js +77 -15
- package/dist/avatar/speech/spotlightSpeech.d.ts.map +1 -1
- package/dist/avatar/speech/spotlightSpeech.js +44 -36
- package/dist/avatar/spine/live2dApp.d.ts +3 -0
- package/dist/avatar/spine/live2dApp.d.ts.map +1 -1
- package/dist/avatar/spine/live2dApp.js +30 -18
- package/dist/avatar/spine/spineAvatar.d.ts +4 -0
- package/dist/avatar/spine/spineAvatar.d.ts.map +1 -1
- package/dist/avatar/spine/spineAvatar.js +114 -83
- package/dist/avatar/spine/spineLipSync.d.ts +1 -0
- package/dist/avatar/spine/spineLipSync.d.ts.map +1 -1
- package/dist/avatar/spine/spineLipSync.js +41 -36
- package/dist/avatar/voice/avatarDirector.d.ts +8 -0
- package/dist/avatar/voice/avatarDirector.d.ts.map +1 -0
- package/dist/avatar/voice/avatarDirector.js +6 -0
- package/dist/avatar/voice/config.d.ts +5 -0
- package/dist/avatar/voice/config.d.ts.map +1 -0
- package/dist/avatar/voice/config.js +5 -0
- package/dist/avatar/voice/panelHidePolicy.d.ts +6 -0
- package/dist/avatar/voice/panelHidePolicy.d.ts.map +1 -0
- package/dist/avatar/voice/panelHidePolicy.js +6 -0
- package/dist/avatar/voice/voiceSession.d.ts +5 -0
- package/dist/avatar/voice/voiceSession.d.ts.map +1 -0
- package/dist/avatar/voice/voiceSession.js +14 -0
- package/dist/components/Live2dPanel.vue.d.ts.map +1 -1
- package/dist/components/Live2dPanel.vue.js +2 -2
- package/dist/components/Live2dPanel2.vue.js +31 -27
- package/dist/components/SpotlightShell.vue.d.ts.map +1 -1
- package/dist/components/SpotlightShell.vue.js +5 -2
- package/dist/components/SpotlightShell2.vue.js +289 -222
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -22
- package/dist/mountShell.d.ts.map +1 -1
- package/dist/mountShell.js +13 -10
- package/dist/plugin.js +1 -1
- package/dist/remote/audio.d.ts.map +1 -1
- package/dist/remote/audio.js +19 -18
- package/dist/remote/runPipeline.d.ts +10 -3
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +120 -111
- package/dist/store/live2dSpeechStore.d.ts +2 -2
- package/dist/store/memoryPreferenceStore.d.ts +1 -1
- package/dist/store/pipeline/constants.d.ts +2 -0
- package/dist/store/pipeline/constants.d.ts.map +1 -1
- package/dist/store/pipeline/constants.js +2 -0
- package/dist/store/runtime/types.d.ts +1 -1
- package/dist/store/runtime/types.d.ts.map +1 -1
- package/dist/store/spotlightStore.d.ts +11 -13
- package/dist/store/spotlightStore.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/avatar/speech/live2dBriefingSummarizer.js +0 -91
- package/dist/avatar/speech/live2dStreamSpeech.js +0 -4
- package/dist/avatar/speech/llmUtils.js +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inupedia/spotlight-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Thin Vue runtime for Inupedia Spotlight Client Tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"prettier": "^3.8.1",
|
|
93
93
|
"yaml": "^2.8.4",
|
|
94
|
-
"@inupedia/spotlight-
|
|
95
|
-
"@inupedia/spotlight-
|
|
94
|
+
"@inupedia/spotlight-protocol": "0.9.0",
|
|
95
|
+
"@inupedia/spotlight-client": "0.9.0"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"@inspira-ui/plugins": "^0.0.2",
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { parseJsonContent as m, getLlmTimeoutMs as p } from "./llmUtils.js";
|
|
2
|
-
import { postSpotlightJson as f } from "../../remote/serverJson.js";
|
|
3
|
-
const M = [
|
|
4
|
-
"你是工程项目数字人汇报压缩器。",
|
|
5
|
-
"你的任务:把输入内容压缩成适合口播汇报的短句。",
|
|
6
|
-
"输出必须是 JSON,且严格匹配 schema,不要输出任何额外文本。",
|
|
7
|
-
"约束:",
|
|
8
|
-
"1) 句子通俗、口语化,避免工具名、链路细节、markdown 标记。",
|
|
9
|
-
"2) 优先保留:结论、关键数字、风险提醒、下一步建议。",
|
|
10
|
-
"3) 每句长度建议 16~36 字,最多 8 句。",
|
|
11
|
-
"4) 如果信息不足,给出保守说明,不要编造。"
|
|
12
|
-
].join(`
|
|
13
|
-
`);
|
|
14
|
-
function i() {
|
|
15
|
-
return Number.isFinite(5) ? Math.min(8, Math.max(1, Math.round(5))) : 5;
|
|
16
|
-
}
|
|
17
|
-
function l(e) {
|
|
18
|
-
const s = e.text.replace(/\s+/g, " ").replace(/[。!?;,.,]+$/g, "").trim();
|
|
19
|
-
return s ? {
|
|
20
|
-
text: `${s}。`,
|
|
21
|
-
pauseMs: typeof e.pauseMs == "number" ? Math.min(1200, Math.max(0, Math.round(e.pauseMs))) : 260
|
|
22
|
-
} : null;
|
|
23
|
-
}
|
|
24
|
-
function u(e) {
|
|
25
|
-
const s = i(), t = e.replace(/```[\s\S]*?```/g, " ").replace(/`([^`]+)`/g, "$1").replace(/\[(.*?)\]\((.*?)\)/g, "$1").replace(/[#>*_-]+/g, " ").replace(/\s+/g, " ").trim(), n = t.split(/[。!?;]/).map((r) => r.trim()).filter(Boolean).slice(0, s);
|
|
26
|
-
return { title: "本轮汇报", sentences: (n.length ? n : [t.slice(0, 48)]).map((r) => l({ text: r, pauseMs: 260 })).filter((r) => !!r) };
|
|
27
|
-
}
|
|
28
|
-
function w(e) {
|
|
29
|
-
return u(e);
|
|
30
|
-
}
|
|
31
|
-
function x(e) {
|
|
32
|
-
const s = i(), t = (e.sentences ?? []).map(
|
|
33
|
-
(n) => l({
|
|
34
|
-
text: n.text ?? "",
|
|
35
|
-
pauseMs: n.pauseMs ?? 260
|
|
36
|
-
})
|
|
37
|
-
).filter((n) => !!n).slice(0, s);
|
|
38
|
-
if (!t.length)
|
|
39
|
-
throw new Error("live2d briefing has empty sentences");
|
|
40
|
-
return {
|
|
41
|
-
title: e.title?.trim() || "本轮汇报",
|
|
42
|
-
sentences: t
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
async function h(e, s, t) {
|
|
46
|
-
const { content: n } = await f(
|
|
47
|
-
"/v1/llm/chat",
|
|
48
|
-
{
|
|
49
|
-
systemPrompt: [
|
|
50
|
-
M,
|
|
51
|
-
`5) 最多输出 ${s} 句。`,
|
|
52
|
-
"输出格式示例:",
|
|
53
|
-
'{"title":"本轮汇报","sentences":[{"text":"...","pauseMs":260}]}',
|
|
54
|
-
"禁止输出 markdown 代码块。"
|
|
55
|
-
].join(`
|
|
56
|
-
`),
|
|
57
|
-
userPrompt: e,
|
|
58
|
-
maxTokens: 700,
|
|
59
|
-
timeoutMs: Math.max(p(), 45e3)
|
|
60
|
-
},
|
|
61
|
-
t
|
|
62
|
-
);
|
|
63
|
-
return n;
|
|
64
|
-
}
|
|
65
|
-
async function d(e, s) {
|
|
66
|
-
const t = e.trim();
|
|
67
|
-
if (!t)
|
|
68
|
-
return { title: "本轮汇报", sentences: [] };
|
|
69
|
-
try {
|
|
70
|
-
const n = i(), c = t.slice(0, 4e3), r = await h(
|
|
71
|
-
`请将以下内容压缩为数字人汇报短句:
|
|
72
|
-
|
|
73
|
-
${c}`,
|
|
74
|
-
n,
|
|
75
|
-
s
|
|
76
|
-
), a = m(r);
|
|
77
|
-
return x({
|
|
78
|
-
title: a.title,
|
|
79
|
-
sentences: Array.isArray(a.sentences) ? a.sentences.map((o) => ({
|
|
80
|
-
text: o.text ?? "",
|
|
81
|
-
pauseMs: o.pauseMs
|
|
82
|
-
})) : []
|
|
83
|
-
});
|
|
84
|
-
} catch {
|
|
85
|
-
return u(t);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
w as buildFastLive2dBriefing,
|
|
90
|
-
d as summarizeLive2dBriefing
|
|
91
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const e = {};
|
|
2
|
-
function s() {
|
|
3
|
-
const t = e;
|
|
4
|
-
return Number(
|
|
5
|
-
t.VITE_LLM_TIMEOUT_MS ?? t.VITE_QWEN_TIMEOUT_MS ?? 2e4
|
|
6
|
-
);
|
|
7
|
-
}
|
|
8
|
-
function o(t) {
|
|
9
|
-
const r = t.trim(), n = r.match(/^```(?:json)?\s*([\s\S]*?)```$/);
|
|
10
|
-
return n ? n[1].trim() : r;
|
|
11
|
-
}
|
|
12
|
-
function _(t) {
|
|
13
|
-
return typeof t == "string" ? JSON.parse(o(t)) : t;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
s as getLlmTimeoutMs,
|
|
17
|
-
_ as parseJsonContent
|
|
18
|
-
};
|