@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.
Files changed (59) hide show
  1. package/dist/assets/spotlight-vue.css +1 -1
  2. package/dist/avatar/speech/live2dTtsPlayback.d.ts +15 -2
  3. package/dist/avatar/speech/live2dTtsPlayback.d.ts.map +1 -1
  4. package/dist/avatar/speech/live2dTtsPlayback.js +77 -15
  5. package/dist/avatar/speech/spotlightSpeech.d.ts.map +1 -1
  6. package/dist/avatar/speech/spotlightSpeech.js +44 -36
  7. package/dist/avatar/spine/live2dApp.d.ts +3 -0
  8. package/dist/avatar/spine/live2dApp.d.ts.map +1 -1
  9. package/dist/avatar/spine/live2dApp.js +30 -18
  10. package/dist/avatar/spine/spineAvatar.d.ts +4 -0
  11. package/dist/avatar/spine/spineAvatar.d.ts.map +1 -1
  12. package/dist/avatar/spine/spineAvatar.js +114 -83
  13. package/dist/avatar/spine/spineLipSync.d.ts +1 -0
  14. package/dist/avatar/spine/spineLipSync.d.ts.map +1 -1
  15. package/dist/avatar/spine/spineLipSync.js +41 -36
  16. package/dist/avatar/voice/avatarDirector.d.ts +8 -0
  17. package/dist/avatar/voice/avatarDirector.d.ts.map +1 -0
  18. package/dist/avatar/voice/avatarDirector.js +6 -0
  19. package/dist/avatar/voice/config.d.ts +5 -0
  20. package/dist/avatar/voice/config.d.ts.map +1 -0
  21. package/dist/avatar/voice/config.js +5 -0
  22. package/dist/avatar/voice/panelHidePolicy.d.ts +6 -0
  23. package/dist/avatar/voice/panelHidePolicy.d.ts.map +1 -0
  24. package/dist/avatar/voice/panelHidePolicy.js +6 -0
  25. package/dist/avatar/voice/voiceSession.d.ts +5 -0
  26. package/dist/avatar/voice/voiceSession.d.ts.map +1 -0
  27. package/dist/avatar/voice/voiceSession.js +14 -0
  28. package/dist/components/Live2dPanel.vue.d.ts.map +1 -1
  29. package/dist/components/Live2dPanel.vue.js +2 -2
  30. package/dist/components/Live2dPanel2.vue.js +31 -27
  31. package/dist/components/SpotlightShell.vue.d.ts.map +1 -1
  32. package/dist/components/SpotlightShell.vue.js +5 -2
  33. package/dist/components/SpotlightShell2.vue.js +289 -222
  34. package/dist/config.d.ts +3 -0
  35. package/dist/config.d.ts.map +1 -1
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +24 -22
  39. package/dist/mountShell.d.ts.map +1 -1
  40. package/dist/mountShell.js +13 -10
  41. package/dist/plugin.js +1 -1
  42. package/dist/remote/audio.d.ts.map +1 -1
  43. package/dist/remote/audio.js +19 -18
  44. package/dist/remote/runPipeline.d.ts +10 -3
  45. package/dist/remote/runPipeline.d.ts.map +1 -1
  46. package/dist/remote/runPipeline.js +120 -111
  47. package/dist/store/live2dSpeechStore.d.ts +2 -2
  48. package/dist/store/memoryPreferenceStore.d.ts +1 -1
  49. package/dist/store/pipeline/constants.d.ts +2 -0
  50. package/dist/store/pipeline/constants.d.ts.map +1 -1
  51. package/dist/store/pipeline/constants.js +2 -0
  52. package/dist/store/runtime/types.d.ts +1 -1
  53. package/dist/store/runtime/types.d.ts.map +1 -1
  54. package/dist/store/spotlightStore.d.ts +11 -13
  55. package/dist/store/spotlightStore.d.ts.map +1 -1
  56. package/package.json +3 -3
  57. package/dist/avatar/speech/live2dBriefingSummarizer.js +0 -91
  58. package/dist/avatar/speech/live2dStreamSpeech.js +0 -4
  59. 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.8.5",
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-client": "0.8.5",
95
- "@inupedia/spotlight-protocol": "0.8.5"
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,4 +0,0 @@
1
- const E = "answer";
2
- export {
3
- E as LIVE2D_ANSWER_STEP_ID
4
- };
@@ -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
- };