@inupedia/spotlight-vue 0.1.1 → 0.1.2

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 (177) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +0 -1
  2. package/dist/avatar/config.js +0 -1
  3. package/dist/avatar/speech/live2dAnswerSpeechPolicy.js +0 -1
  4. package/dist/avatar/speech/live2dBriefingSummarizer.js +0 -1
  5. package/dist/avatar/speech/live2dStreamSpeech.js +0 -1
  6. package/dist/avatar/speech/live2dTtsPlayback.js +0 -1
  7. package/dist/avatar/speech/llmUtils.js +0 -1
  8. package/dist/avatar/speech/spotlightSpeech.js +0 -1
  9. package/dist/avatar/spine/live2dApp.js +0 -1
  10. package/dist/avatar/spine/spineAvatar.js +0 -1
  11. package/dist/avatar/spine/spineLipSync.js +0 -1
  12. package/dist/components/InspiraCardSpotlight.js +0 -1
  13. package/dist/components/InspiraCardSpotlight.vue.js +0 -1
  14. package/dist/components/Live2dPanel.vue.js +0 -1
  15. package/dist/components/Live2dPanel2.vue.js +0 -1
  16. package/dist/components/OfficialBorderBeam.js +0 -1
  17. package/dist/components/OfficialBorderBeam.vue.js +0 -1
  18. package/dist/components/SpotlightCommandPanel.vue.js +0 -1
  19. package/dist/components/SpotlightCommandPanel2.vue.js +0 -1
  20. package/dist/components/SpotlightMarkdownPreview.vue.js +0 -1
  21. package/dist/components/SpotlightMarkdownPreview2.vue.js +0 -1
  22. package/dist/components/SpotlightRoot.vue.js +0 -1
  23. package/dist/components/SpotlightRoot2.vue.js +0 -1
  24. package/dist/components/SpotlightShell.vue.js +0 -1
  25. package/dist/components/SpotlightShell2.vue.js +0 -1
  26. package/dist/components/SpotlightThinking.vue.js +0 -1
  27. package/dist/components/SpotlightThinking2.vue.js +0 -1
  28. package/dist/components/index.d.ts +3 -0
  29. package/dist/components/index.d.ts.map +1 -0
  30. package/dist/components/index.js +6 -0
  31. package/dist/composables/useSpotlightCommandShortcuts.js +0 -1
  32. package/dist/composables/useSpotlightPanelUi.js +0 -1
  33. package/dist/config.js +0 -1
  34. package/dist/constants/toolNames.js +0 -1
  35. package/dist/host/defineApp.js +0 -1
  36. package/dist/host/defineHost.js +0 -1
  37. package/dist/host/mergeSkills.js +0 -1
  38. package/dist/host/normalizeSkills.js +0 -1
  39. package/dist/host/skillExecution.js +0 -1
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +113 -117
  43. package/dist/markdown/index.d.ts +2 -0
  44. package/dist/markdown/index.d.ts.map +1 -0
  45. package/dist/markdown/index.js +6 -0
  46. package/dist/mountShell.js +0 -1
  47. package/dist/plugin.js +0 -1
  48. package/dist/remote/audio.js +0 -1
  49. package/dist/remote/hostToolRunner.js +3 -4
  50. package/dist/remote/httpConfig.js +0 -1
  51. package/dist/remote/index.js +0 -1
  52. package/dist/remote/meta.js +0 -1
  53. package/dist/remote/runPipeline.js +0 -1
  54. package/dist/remote/serverJson.js +0 -1
  55. package/dist/resolveConfig.js +0 -1
  56. package/dist/session/agentSession.js +0 -1
  57. package/dist/skills/index.js +0 -1
  58. package/dist/skills/matching.js +0 -1
  59. package/dist/skills/parser.js +0 -1
  60. package/dist/skills/skillFrontmatterParse.js +0 -1
  61. package/dist/skills/skillListing.js +0 -1
  62. package/dist/skills/skillPaths.js +0 -1
  63. package/dist/store/capabilities.js +0 -1
  64. package/dist/store/constants.js +0 -1
  65. package/dist/store/index.d.ts +5 -0
  66. package/dist/store/index.d.ts.map +1 -0
  67. package/dist/store/index.js +22 -0
  68. package/dist/store/live2dOverlayStore.js +0 -1
  69. package/dist/store/live2dSpeechStore.js +0 -1
  70. package/dist/store/live2dVoiceChannelStore.js +0 -1
  71. package/dist/store/pipeline/api.js +0 -1
  72. package/dist/store/pipeline/constants.js +0 -1
  73. package/dist/store/pipeline/displayText.js +0 -1
  74. package/dist/store/pipeline/errors.js +0 -1
  75. package/dist/store/pipeline/spotlightMarkdown.d.ts.map +1 -1
  76. package/dist/store/pipeline/spotlightMarkdown.js +51 -46
  77. package/dist/store/pipeline/steps.js +0 -1
  78. package/dist/store/pipeline/toolDisplay.js +0 -1
  79. package/dist/store/pipeline/typing.js +0 -1
  80. package/dist/store/recent.js +0 -1
  81. package/dist/store/runtimeStore.js +0 -1
  82. package/dist/store/spotlightStore.js +14 -16
  83. package/dist/store/storeSink.js +0 -1
  84. package/dist/store/types.js +0 -1
  85. package/dist/testing/index.d.ts +3 -0
  86. package/dist/testing/index.d.ts.map +1 -0
  87. package/dist/testing/index.js +6 -0
  88. package/dist/utils/devConsole.js +0 -1
  89. package/dist/utils/requestTimeout.js +0 -1
  90. package/dist/workflow/createOperateDefinition.js +0 -1
  91. package/dist/workflow/index.d.ts +6 -0
  92. package/dist/workflow/index.d.ts.map +1 -0
  93. package/dist/workflow/index.js +20 -0
  94. package/dist/workflow/operate.js +0 -1
  95. package/dist/workflow/runHostTool.js +0 -1
  96. package/dist/workflow/sessionControl.js +0 -1
  97. package/dist/workflow/shared.js +0 -1
  98. package/package.json +72 -8
  99. package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
  100. package/dist/avatar/config.js.map +0 -1
  101. package/dist/avatar/speech/live2dAnswerSpeechPolicy.js.map +0 -1
  102. package/dist/avatar/speech/live2dBriefingSummarizer.js.map +0 -1
  103. package/dist/avatar/speech/live2dStreamSpeech.js.map +0 -1
  104. package/dist/avatar/speech/live2dTtsPlayback.js.map +0 -1
  105. package/dist/avatar/speech/llmUtils.js.map +0 -1
  106. package/dist/avatar/speech/spotlightSpeech.js.map +0 -1
  107. package/dist/avatar/spine/live2dApp.js.map +0 -1
  108. package/dist/avatar/spine/spineAvatar.js.map +0 -1
  109. package/dist/avatar/spine/spineLipSync.js.map +0 -1
  110. package/dist/components/InspiraCardSpotlight.js.map +0 -1
  111. package/dist/components/InspiraCardSpotlight.vue.js.map +0 -1
  112. package/dist/components/Live2dPanel.vue.js.map +0 -1
  113. package/dist/components/Live2dPanel2.vue.js.map +0 -1
  114. package/dist/components/OfficialBorderBeam.js.map +0 -1
  115. package/dist/components/OfficialBorderBeam.vue.js.map +0 -1
  116. package/dist/components/SpotlightCommandPanel.vue.js.map +0 -1
  117. package/dist/components/SpotlightCommandPanel2.vue.js.map +0 -1
  118. package/dist/components/SpotlightMarkdownPreview.vue.js.map +0 -1
  119. package/dist/components/SpotlightMarkdownPreview2.vue.js.map +0 -1
  120. package/dist/components/SpotlightRoot.vue.js.map +0 -1
  121. package/dist/components/SpotlightRoot2.vue.js.map +0 -1
  122. package/dist/components/SpotlightShell.vue.js.map +0 -1
  123. package/dist/components/SpotlightShell2.vue.js.map +0 -1
  124. package/dist/components/SpotlightThinking.vue.js.map +0 -1
  125. package/dist/components/SpotlightThinking2.vue.js.map +0 -1
  126. package/dist/composables/useSpotlightCommandShortcuts.js.map +0 -1
  127. package/dist/composables/useSpotlightPanelUi.js.map +0 -1
  128. package/dist/config.js.map +0 -1
  129. package/dist/constants/toolNames.js.map +0 -1
  130. package/dist/host/defineApp.js.map +0 -1
  131. package/dist/host/defineHost.js.map +0 -1
  132. package/dist/host/mergeSkills.js.map +0 -1
  133. package/dist/host/normalizeSkills.js.map +0 -1
  134. package/dist/host/skillExecution.js.map +0 -1
  135. package/dist/index.js.map +0 -1
  136. package/dist/mountShell.js.map +0 -1
  137. package/dist/plugin.js.map +0 -1
  138. package/dist/remote/audio.js.map +0 -1
  139. package/dist/remote/hostToolRunner.js.map +0 -1
  140. package/dist/remote/httpConfig.js.map +0 -1
  141. package/dist/remote/index.js.map +0 -1
  142. package/dist/remote/meta.js.map +0 -1
  143. package/dist/remote/runPipeline.js.map +0 -1
  144. package/dist/remote/serverJson.js.map +0 -1
  145. package/dist/resolveConfig.js.map +0 -1
  146. package/dist/session/agentSession.js.map +0 -1
  147. package/dist/skills/index.js.map +0 -1
  148. package/dist/skills/matching.js.map +0 -1
  149. package/dist/skills/parser.js.map +0 -1
  150. package/dist/skills/skillFrontmatterParse.js.map +0 -1
  151. package/dist/skills/skillListing.js.map +0 -1
  152. package/dist/skills/skillPaths.js.map +0 -1
  153. package/dist/store/capabilities.js.map +0 -1
  154. package/dist/store/constants.js.map +0 -1
  155. package/dist/store/live2dOverlayStore.js.map +0 -1
  156. package/dist/store/live2dSpeechStore.js.map +0 -1
  157. package/dist/store/live2dVoiceChannelStore.js.map +0 -1
  158. package/dist/store/pipeline/api.js.map +0 -1
  159. package/dist/store/pipeline/constants.js.map +0 -1
  160. package/dist/store/pipeline/displayText.js.map +0 -1
  161. package/dist/store/pipeline/errors.js.map +0 -1
  162. package/dist/store/pipeline/spotlightMarkdown.js.map +0 -1
  163. package/dist/store/pipeline/steps.js.map +0 -1
  164. package/dist/store/pipeline/toolDisplay.js.map +0 -1
  165. package/dist/store/pipeline/typing.js.map +0 -1
  166. package/dist/store/recent.js.map +0 -1
  167. package/dist/store/runtimeStore.js.map +0 -1
  168. package/dist/store/spotlightStore.js.map +0 -1
  169. package/dist/store/storeSink.js.map +0 -1
  170. package/dist/store/types.js.map +0 -1
  171. package/dist/utils/devConsole.js.map +0 -1
  172. package/dist/utils/requestTimeout.js.map +0 -1
  173. package/dist/workflow/createOperateDefinition.js.map +0 -1
  174. package/dist/workflow/operate.js.map +0 -1
  175. package/dist/workflow/runHostTool.js.map +0 -1
  176. package/dist/workflow/sessionControl.js.map +0 -1
  177. package/dist/workflow/shared.js.map +0 -1
@@ -147,4 +147,3 @@ const f = m("agentSession", {
147
147
  export {
148
148
  f as useAgentSessionStore
149
149
  };
150
- //# sourceMappingURL=agentSession.js.map
@@ -20,4 +20,3 @@ export {
20
20
  u as loadBundledSkillsFromGlob,
21
21
  e as parseSpotlightSkillMarkdown
22
22
  };
23
- //# sourceMappingURL=index.js.map
@@ -30,4 +30,3 @@ export {
30
30
  o as normalizeSkillQuestion,
31
31
  a as questionMatchesSkill
32
32
  };
33
- //# sourceMappingURL=matching.js.map
@@ -14,4 +14,3 @@ function d(i, l) {
14
14
  export {
15
15
  d as parseSpotlightSkillMarkdown
16
16
  };
17
- //# sourceMappingURL=parser.js.map
@@ -200,4 +200,3 @@ function K(n, e) {
200
200
  export {
201
201
  K as parseSpotlightSkillMarkdownFields
202
202
  };
203
- //# sourceMappingURL=skillFrontmatterParse.js.map
@@ -42,4 +42,3 @@ export {
42
42
  L as formatSkillsWithinBudget,
43
43
  E as getSkillListingCharBudget
44
44
  };
45
- //# sourceMappingURL=skillListing.js.map
@@ -19,4 +19,3 @@ export {
19
19
  l as inferSkillRootFromSourcePath,
20
20
  n as resolveSkillRoot
21
21
  };
22
- //# sourceMappingURL=skillPaths.js.map
@@ -9,4 +9,3 @@ function g(e) {
9
9
  export {
10
10
  g as getSuggestedQuestions
11
11
  };
12
- //# sourceMappingURL=capabilities.js.map
@@ -3,4 +3,3 @@ export {
3
3
  E as RECENT_QUESTIONS_MAX,
4
4
  t as SPOTLIGHT_RECENT_KEY
5
5
  };
6
- //# sourceMappingURL=constants.js.map
@@ -0,0 +1,5 @@
1
+ export { useSpotlightStore, SpotlightIntent, SPOTLIGHT_INTENT_LABELS, ProgressSubIntent, PROGRESS_SUB_INTENT_LABELS, InvestmentSubIntent, INVESTMENT_SUB_INTENT_LABELS, QualitySubIntent, QUALITY_SUB_INTENT_LABELS, SafetySubIntent, SAFETY_SUB_INTENT_LABELS, SUB_INTENT_CONFIG, type AgentStep, type IntentWithReason, type SubIntentConfig, type SpotlightSkillPermissionRequest, } from "./spotlightStore.js";
2
+ export { SpotlightCommandDomain, SpotlightCommandScope, type SpotlightCommand, type SpotlightCommandAction, type SpotlightCommandTarget, type SpotlightVideoChannelId, } from "./types.js";
3
+ export { useSpotlightRuntimeStore } from "./runtimeStore.js";
4
+ export { useAgentSessionStore } from "../session/agentSession.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,+BAA+B,GACrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { useSpotlightStore as e } from "./spotlightStore.js";
2
+ import { INVESTMENT_SUB_INTENT_LABELS as n, InvestmentSubIntent as T, PROGRESS_SUB_INTENT_LABELS as I, ProgressSubIntent as _, QUALITY_SUB_INTENT_LABELS as E, QualitySubIntent as N, SAFETY_SUB_INTENT_LABELS as r, SPOTLIGHT_INTENT_LABELS as L, SUB_INTENT_CONFIG as m, SafetySubIntent as p, SpotlightCommandDomain as B, SpotlightCommandScope as i, SpotlightIntent as u } from "./types.js";
3
+ import { useSpotlightRuntimeStore as A } from "./runtimeStore.js";
4
+ import { useAgentSessionStore as l } from "../session/agentSession.js";
5
+ export {
6
+ n as INVESTMENT_SUB_INTENT_LABELS,
7
+ T as InvestmentSubIntent,
8
+ I as PROGRESS_SUB_INTENT_LABELS,
9
+ _ as ProgressSubIntent,
10
+ E as QUALITY_SUB_INTENT_LABELS,
11
+ N as QualitySubIntent,
12
+ r as SAFETY_SUB_INTENT_LABELS,
13
+ L as SPOTLIGHT_INTENT_LABELS,
14
+ m as SUB_INTENT_CONFIG,
15
+ p as SafetySubIntent,
16
+ B as SpotlightCommandDomain,
17
+ i as SpotlightCommandScope,
18
+ u as SpotlightIntent,
19
+ l as useAgentSessionStore,
20
+ A as useSpotlightRuntimeStore,
21
+ e as useSpotlightStore
22
+ };
@@ -16,4 +16,3 @@ const f = i("live2dOverlay", () => {
16
16
  export {
17
17
  f as useLive2dOverlayStore
18
18
  };
19
- //# sourceMappingURL=live2dOverlayStore.js.map
@@ -16,4 +16,3 @@ const c = i("live2dSpeech", () => {
16
16
  export {
17
17
  c as useLive2dSpeechStore
18
18
  };
19
- //# sourceMappingURL=live2dSpeechStore.js.map
@@ -19,4 +19,3 @@ const c = l(
19
19
  export {
20
20
  c as useLive2dVoiceChannelStore
21
21
  };
22
- //# sourceMappingURL=live2dVoiceChannelStore.js.map
@@ -83,4 +83,3 @@ function k(t) {
83
83
  export {
84
84
  k as buildSpotlightHandlerApi
85
85
  };
86
- //# sourceMappingURL=api.js.map
@@ -14,4 +14,3 @@ export {
14
14
  n as SPOTLIGHT_PIPELINE_STEP_IDS,
15
15
  o as SPOTLIGHT_PIPELINE_STEP_LABELS
16
16
  };
17
- //# sourceMappingURL=constants.js.map
@@ -90,4 +90,3 @@ export {
90
90
  S as splitToolStepContent,
91
91
  L as stripLoopPlanningBlocks
92
92
  };
93
- //# sourceMappingURL=displayText.js.map
@@ -27,4 +27,3 @@ export {
27
27
  $ as applyPipelineError,
28
28
  d as formatToolFailure
29
29
  };
30
- //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spotlightMarkdown.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/spotlightMarkdown.ts"],"names":[],"mappings":"AAGA,4CAA4C;AAC5C,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBhE;AA0ED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,gEAAgE;AAChE,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
1
+ {"version":3,"file":"spotlightMarkdown.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/spotlightMarkdown.ts"],"names":[],"mappings":"AAeA,4CAA4C;AAC5C,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBhE;AA0ED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,gEAAgE;AAChE,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
@@ -1,86 +1,91 @@
1
- import * as p from "prettier/standalone";
2
- import * as l from "prettier/plugins/markdown";
3
- function f(e) {
4
- if (!e.trim()) return e;
5
- let r = e.replace(/\r\n/g, `
1
+ let u = null;
2
+ function l() {
3
+ return u ??= Promise.all([
4
+ import("prettier/standalone"),
5
+ import("prettier/plugins/markdown")
6
+ ]).then(([r, e]) => ({ prettier: r, markdownPlugin: e })), u;
7
+ }
8
+ function f(r) {
9
+ if (!r.trim()) return r;
10
+ let e = r.replace(/\r\n/g, `
6
11
  `);
7
- return r = r.replace(/(#{1,6}\s+[^\n#|]+?)(#{1,6}\s)/g, `$1
12
+ return e = e.replace(/(#{1,6}\s+[^\n#|]+?)(#{1,6}\s)/g, `$1
8
13
 
9
- $2`), r = r.replace(/([\u4e00-\u9fa5)】>])(#{1,6})(?=\S)/g, `$1
14
+ $2`), e = e.replace(/([\u4e00-\u9fa5)】>])(#{1,6})(?=\S)/g, `$1
10
15
 
11
- $2`), r = r.replace(/^(#{1,6})(\d+[.)、])/gm, "$1 $2"), r = r.replace(/^-(?![-])(\S)/gm, "- $1"), r = r.replace(
16
+ $2`), e = e.replace(/^(#{1,6})(\d+[.)、])/gm, "$1 $2"), e = e.replace(/^-(?![-])(\S)/gm, "- $1"), e = e.replace(
12
17
  new RegExp("(?<=[\\d.km座处)%)kW#])-(?=[\\u4e00-\\u9fa5])", "g"),
13
18
  `
14
19
  - `
15
- ), r = r.split(`
16
- `).map((n) => m(n)).join(`
17
- `), r = g(r), r.replace(/\n{3,}/g, `
20
+ ), e = e.split(`
21
+ `).map((n) => d(n)).join(`
22
+ `), e = m(e), e.replace(/\n{3,}/g, `
18
23
 
19
24
  `).trim();
20
25
  }
21
- function m(e) {
22
- const r = e.trim();
23
- if (!r.includes("|") || /^\|/.test(r) || /^\|[-\s|:]+\|/.test(r.replace(/\s/g, ""))) return e;
24
- const n = r.indexOf("|"), t = r.slice(0, n).trimEnd(), i = r.slice(n).trimStart();
25
- return !t || !i || !i.includes("|") && !i.startsWith("|") ? e : `${t}
26
+ function d(r) {
27
+ const e = r.trim();
28
+ if (!e.includes("|") || /^\|/.test(e) || /^\|[-\s|:]+\|/.test(e.replace(/\s/g, ""))) return r;
29
+ const n = e.indexOf("|"), t = e.slice(0, n).trimEnd(), i = e.slice(n).trimStart();
30
+ return !t || !i || !i.includes("|") && !i.startsWith("|") ? r : `${t}
26
31
 
27
32
  ${i}`;
28
33
  }
29
- function g(e) {
30
- const r = e.split(`
34
+ function m(r) {
35
+ const e = r.split(`
31
36
  `), n = [];
32
- for (let t = 0; t < r.length; t++) {
33
- const i = r[t], u = i.trim();
34
- if (!c(u)) {
37
+ for (let t = 0; t < e.length; t++) {
38
+ const i = e[t], p = i.trim();
39
+ if (!c(p)) {
35
40
  n.push(i);
36
41
  continue;
37
42
  }
38
- const o = [];
39
- for (; t < r.length; ) {
40
- const s = r[t].trim();
41
- if (!s) {
43
+ const s = [];
44
+ for (; t < e.length; ) {
45
+ const o = e[t].trim();
46
+ if (!o) {
42
47
  t++;
43
48
  continue;
44
49
  }
45
- if (!c(s)) break;
46
- o.push(s), t++;
50
+ if (!c(o)) break;
51
+ s.push(o), t++;
47
52
  }
48
53
  t--;
49
- const a = d(o);
54
+ const a = g(s);
50
55
  a.length && n.push(...a);
51
56
  }
52
57
  return n.join(`
53
58
  `);
54
59
  }
55
- function c(e) {
56
- return e ? /^\|.*\|$/.test(e) && /[|:-]/.test(e) ? !0 : /^[\s|:-]+$/.test(e) : !1;
60
+ function c(r) {
61
+ return r ? /^\|.*\|$/.test(r) && /[|:-]/.test(r) ? !0 : /^[\s|:-]+$/.test(r) : !1;
57
62
  }
58
- function d(e) {
59
- if (!e.length) return [];
60
- if (!e.every(
63
+ function g(r) {
64
+ if (!r.length) return [];
65
+ if (!r.every(
61
66
  (t) => /^[\s|:-]+$/.test(t.replace(/[^|:\-\s]/g, ""))
62
- )) return e;
63
- const n = e.join("").replace(/\s+/g, "").replace(/\|+/g, "|").replace(/^\|/, "|").replace(/\|$/, "|");
64
- return /^\|[-:|]+\|$/.test(n) ? [n] : e;
67
+ )) return r;
68
+ const n = r.join("").replace(/\s+/g, "").replace(/\|+/g, "|").replace(/^\|/, "|").replace(/\|$/, "|");
69
+ return /^\|[-:|]+\|$/.test(n) ? [n] : r;
65
70
  }
66
- async function $(e) {
67
- const r = f(e);
68
- if (!r) return "";
71
+ async function h(r) {
72
+ const e = f(r);
73
+ if (!e) return "";
69
74
  try {
70
- return (await p.format(r, {
75
+ const { prettier: n, markdownPlugin: t } = await l();
76
+ return (await n.format(e, {
71
77
  parser: "markdown",
72
- plugins: [l],
78
+ plugins: [t],
73
79
  proseWrap: "preserve"
74
80
  })).trim();
75
81
  } catch {
76
- return r;
82
+ return e;
77
83
  }
78
84
  }
79
- function h() {
85
+ function $() {
80
86
  }
81
87
  export {
82
- $ as formatSpotlightKnowledgeMarkdown,
83
- h as initSpotlightMarkdownPreview,
88
+ h as formatSpotlightKnowledgeMarkdown,
89
+ $ as initSpotlightMarkdownPreview,
84
90
  f as preprocessKnowledgeMarkdown
85
91
  };
86
- //# sourceMappingURL=spotlightMarkdown.js.map
@@ -99,4 +99,3 @@ export {
99
99
  d as findActiveStep,
100
100
  x as setStepState
101
101
  };
102
- //# sourceMappingURL=steps.js.map
@@ -62,4 +62,3 @@ export {
62
62
  r as normalizeToolName,
63
63
  w as partitionToolCalls
64
64
  };
65
- //# sourceMappingURL=toolDisplay.js.map
@@ -29,4 +29,3 @@ export {
29
29
  s as typewriterAppendToStepContent,
30
30
  g as typewriterToStepContent
31
31
  };
32
- //# sourceMappingURL=typing.js.map
@@ -24,4 +24,3 @@ export {
24
24
  a as loadRecentQuestions,
25
25
  u as persistRecentQuestions
26
26
  };
27
- //# sourceMappingURL=recent.js.map
@@ -22,4 +22,3 @@ const l = e("spotlightRuntime", {
22
22
  export {
23
23
  l as useSpotlightRuntimeStore
24
24
  };
25
- //# sourceMappingURL=runtimeStore.js.map
@@ -1,7 +1,6 @@
1
1
  import { defineStore as m } from "pinia";
2
2
  import { getSpotlightConfig as S } from "../plugin.js";
3
3
  import { runRemoteSpotlightPipeline as g, warmupSpotlightRemoteContext as u, cancelRemoteSpotlightRunForSignal as f } from "../remote/runPipeline.js";
4
- import "@inupedia/spotlight-client";
5
4
  import { ensureSpotlightMeta as T } from "../remote/meta.js";
6
5
  import { devWarn as y } from "../utils/devConsole.js";
7
6
  import { useAgentSessionStore as E } from "../session/agentSession.js";
@@ -13,7 +12,7 @@ import { typewriterAppendToStepContent as b, typewriterToStepContent as v } from
13
12
  import { addRecentQuestionToList as R, persistRecentQuestions as Q, loadRecentQuestions as L } from "./recent.js";
14
13
  import { getSuggestedQuestions as C } from "./capabilities.js";
15
14
  import { buildSpotlightStoreSink as N } from "./storeSink.js";
16
- import { INVESTMENT_SUB_INTENT_LABELS as te, InvestmentSubIntent as ie, PROGRESS_SUB_INTENT_LABELS as ne, ProgressSubIntent as se, QUALITY_SUB_INTENT_LABELS as re, QualitySubIntent as oe, SAFETY_SUB_INTENT_LABELS as le, SPOTLIGHT_INTENT_LABELS as ue, SUB_INTENT_CONFIG as pe, SafetySubIntent as ae, SpotlightIntent as he } from "./types.js";
15
+ import { INVESTMENT_SUB_INTENT_LABELS as ee, InvestmentSubIntent as te, PROGRESS_SUB_INTENT_LABELS as ie, ProgressSubIntent as ne, QUALITY_SUB_INTENT_LABELS as se, QualitySubIntent as re, SAFETY_SUB_INTENT_LABELS as oe, SPOTLIGHT_INTENT_LABELS as le, SUB_INTENT_CONFIG as ue, SafetySubIntent as pe, SpotlightIntent as ae } from "./types.js";
17
16
  const h = "spotlight-telemetry-snapshots", l = 20;
18
17
  function p(e) {
19
18
  return e instanceof DOMException && e.name === "AbortError" ? !0 : e instanceof Error && e.name === "AbortError";
@@ -88,7 +87,7 @@ function B(e) {
88
87
  function O(e, i) {
89
88
  return c(e).find((n) => n[0]?.turnId === i) ?? [];
90
89
  }
91
- const Z = m("spotlight", {
90
+ const z = m("spotlight", {
92
91
  state: () => ({
93
92
  visible: !1,
94
93
  prompt: "",
@@ -345,17 +344,16 @@ const Z = m("spotlight", {
345
344
  }
346
345
  });
347
346
  export {
348
- te as INVESTMENT_SUB_INTENT_LABELS,
349
- ie as InvestmentSubIntent,
350
- ne as PROGRESS_SUB_INTENT_LABELS,
351
- se as ProgressSubIntent,
352
- re as QUALITY_SUB_INTENT_LABELS,
353
- oe as QualitySubIntent,
354
- le as SAFETY_SUB_INTENT_LABELS,
355
- ue as SPOTLIGHT_INTENT_LABELS,
356
- pe as SUB_INTENT_CONFIG,
357
- ae as SafetySubIntent,
358
- he as SpotlightIntent,
359
- Z as useSpotlightStore
347
+ ee as INVESTMENT_SUB_INTENT_LABELS,
348
+ te as InvestmentSubIntent,
349
+ ie as PROGRESS_SUB_INTENT_LABELS,
350
+ ne as ProgressSubIntent,
351
+ se as QUALITY_SUB_INTENT_LABELS,
352
+ re as QualitySubIntent,
353
+ oe as SAFETY_SUB_INTENT_LABELS,
354
+ le as SPOTLIGHT_INTENT_LABELS,
355
+ ue as SUB_INTENT_CONFIG,
356
+ pe as SafetySubIntent,
357
+ ae as SpotlightIntent,
358
+ z as useSpotlightStore
360
359
  };
361
- //# sourceMappingURL=spotlightStore.js.map
@@ -124,4 +124,3 @@ function g(t) {
124
124
  export {
125
125
  g as buildSpotlightStoreSink
126
126
  };
127
- //# sourceMappingURL=storeSink.js.map
@@ -84,4 +84,3 @@ export {
84
84
  d as TUNNEL_WANDER_SUB_INTENT_LABELS,
85
85
  s as TunnelWanderSubIntent
86
86
  };
87
- //# sourceMappingURL=types.js.map
@@ -0,0 +1,3 @@
1
+ export { resetSpotlightRuntimeForTests } from "../plugin.js";
2
+ export { resetSpotlightMetaCacheForTests } from "../remote/meta.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { resetSpotlightRuntimeForTests as o } from "../plugin.js";
2
+ import { resetSpotlightMetaCacheForTests as s } from "../remote/meta.js";
3
+ export {
4
+ s as resetSpotlightMetaCacheForTests,
5
+ o as resetSpotlightRuntimeForTests
6
+ };
@@ -3,4 +3,3 @@ function n(e, ...a) {
3
3
  export {
4
4
  n as devWarn
5
5
  };
6
- //# sourceMappingURL=devConsole.js.map
@@ -9,4 +9,3 @@ function s(n, o) {
9
9
  export {
10
10
  s as withRequestTimeout
11
11
  };
12
- //# sourceMappingURL=requestTimeout.js.map
@@ -29,4 +29,3 @@ function c(e) {
29
29
  export {
30
30
  c as createOperateDefinition
31
31
  };
32
- //# sourceMappingURL=createOperateDefinition.js.map
@@ -0,0 +1,6 @@
1
+ export { buildCommonWorkflowSteps, buildCommonSteps, COMMON_WORKFLOW_STEPS, } from "./shared.js";
2
+ export { runHostTool } from "./runHostTool.js";
3
+ export { buildOperateWorkflowSteps, createOperateExecutor, isOperateWorkflowContext, type OperateToolCall, type OperateWorkflowDefinition, } from "./operate.js";
4
+ export { createOperateDefinition, type CreateOperateDefinitionOptions, type OperateActionBinding, } from "./createOperateDefinition.js";
5
+ export { buildRepeatLastAnswerContext, buildOperateCommandContext, buildSessionControlWorkflowSteps, createRunSessionHostTool, createSessionControlExecutor, type ExecuteOperateWorkflow, type SessionControlHooksFactory, type SessionControlWorkflowHooks, } from "./sessionControl.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,eAAe,EACpB,KAAK,yBAAyB,GAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,gCAAgC,EAChC,wBAAwB,EACxB,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { COMMON_WORKFLOW_STEPS as t, buildCommonSteps as r, buildCommonWorkflowSteps as n } from "./shared.js";
2
+ import { runHostTool as s } from "./runHostTool.js";
3
+ import { buildOperateWorkflowSteps as i, createOperateExecutor as a, isOperateWorkflowContext as m } from "./operate.js";
4
+ import { createOperateDefinition as u } from "./createOperateDefinition.js";
5
+ import { buildOperateCommandContext as C, buildRepeatLastAnswerContext as O, buildSessionControlWorkflowSteps as S, createRunSessionHostTool as d, createSessionControlExecutor as b } from "./sessionControl.js";
6
+ export {
7
+ t as COMMON_WORKFLOW_STEPS,
8
+ r as buildCommonSteps,
9
+ n as buildCommonWorkflowSteps,
10
+ C as buildOperateCommandContext,
11
+ i as buildOperateWorkflowSteps,
12
+ O as buildRepeatLastAnswerContext,
13
+ S as buildSessionControlWorkflowSteps,
14
+ u as createOperateDefinition,
15
+ a as createOperateExecutor,
16
+ d as createRunSessionHostTool,
17
+ b as createSessionControlExecutor,
18
+ m as isOperateWorkflowContext,
19
+ s as runHostTool
20
+ };
@@ -93,4 +93,3 @@ export {
93
93
  p as createOperateExecutor,
94
94
  k as isOperateWorkflowContext
95
95
  };
96
- //# sourceMappingURL=operate.js.map
@@ -10,4 +10,3 @@ async function s(r, t) {
10
10
  export {
11
11
  s as runHostTool
12
12
  };
13
- //# sourceMappingURL=runHostTool.js.map
@@ -110,4 +110,3 @@ export {
110
110
  k as createRunSessionHostTool,
111
111
  T as createSessionControlExecutor
112
112
  };
113
- //# sourceMappingURL=sessionControl.js.map
@@ -12,4 +12,3 @@ export {
12
12
  e as buildCommonSteps,
13
13
  t as buildCommonWorkflowSteps
14
14
  };
15
- //# sourceMappingURL=shared.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inupedia/spotlight-vue",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Vue plugin and config entry for Inupedia Spotlight (monorepo workspace package)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,22 +18,85 @@
18
18
  "types": "./dist/remote/index.d.ts",
19
19
  "import": "./dist/remote/index.js"
20
20
  },
21
- "./components/*": {
22
- "types": "./dist/components/*.vue.d.ts",
23
- "import": "./dist/components/*.js"
21
+ "./markdown": {
22
+ "types": "./dist/markdown/index.d.ts",
23
+ "import": "./dist/markdown/index.js"
24
24
  },
25
- "./styles/*": "./dist/assets/*"
25
+ "./store": {
26
+ "types": "./dist/store/index.d.ts",
27
+ "import": "./dist/store/index.js"
28
+ },
29
+ "./workflow": {
30
+ "types": "./dist/workflow/index.d.ts",
31
+ "import": "./dist/workflow/index.js"
32
+ },
33
+ "./testing": {
34
+ "types": "./dist/testing/index.d.ts",
35
+ "import": "./dist/testing/index.js"
36
+ },
37
+ "./components": {
38
+ "types": "./dist/components/index.d.ts",
39
+ "import": "./dist/components/index.js"
40
+ },
41
+ "./components/InspiraCardSpotlight": {
42
+ "types": "./dist/components/InspiraCardSpotlight.vue.d.ts",
43
+ "import": "./dist/components/InspiraCardSpotlight.js"
44
+ },
45
+ "./components/InspiraCardSpotlight.vue": {
46
+ "types": "./dist/components/InspiraCardSpotlight.vue.d.ts",
47
+ "import": "./dist/components/InspiraCardSpotlight.vue.js"
48
+ },
49
+ "./components/OfficialBorderBeam": {
50
+ "types": "./dist/components/OfficialBorderBeam.vue.d.ts",
51
+ "import": "./dist/components/OfficialBorderBeam.js"
52
+ },
53
+ "./components/OfficialBorderBeam.vue": {
54
+ "types": "./dist/components/OfficialBorderBeam.vue.d.ts",
55
+ "import": "./dist/components/OfficialBorderBeam.vue.js"
56
+ },
57
+ "./components/Live2dPanel.vue": {
58
+ "types": "./dist/components/Live2dPanel.vue.d.ts",
59
+ "import": "./dist/components/Live2dPanel.vue.js"
60
+ },
61
+ "./components/SpotlightCommandPanel.vue": {
62
+ "types": "./dist/components/SpotlightCommandPanel.vue.d.ts",
63
+ "import": "./dist/components/SpotlightCommandPanel.vue.js"
64
+ },
65
+ "./components/SpotlightMarkdownPreview.vue": {
66
+ "types": "./dist/components/SpotlightMarkdownPreview.vue.d.ts",
67
+ "import": "./dist/components/SpotlightMarkdownPreview.vue.js"
68
+ },
69
+ "./components/SpotlightRoot.vue": {
70
+ "types": "./dist/components/SpotlightRoot.vue.d.ts",
71
+ "import": "./dist/components/SpotlightRoot.vue.js"
72
+ },
73
+ "./components/SpotlightShell.vue": {
74
+ "types": "./dist/components/SpotlightShell.vue.d.ts",
75
+ "import": "./dist/components/SpotlightShell.vue.js"
76
+ },
77
+ "./components/SpotlightThinking.vue": {
78
+ "types": "./dist/components/SpotlightThinking.vue.d.ts",
79
+ "import": "./dist/components/SpotlightThinking.vue.js"
80
+ },
81
+ "./styles/spotlight-vue.css": "./dist/assets/spotlight-vue.css"
26
82
  },
27
83
  "main": "./dist/index.js",
28
84
  "types": "./dist/index.d.ts",
85
+ "publishConfig": {
86
+ "access": "public"
87
+ },
88
+ "sideEffects": [
89
+ "**/*.css",
90
+ "dist/assets/*.css"
91
+ ],
29
92
  "files": [
30
93
  "dist"
31
94
  ],
32
95
  "dependencies": {
33
96
  "prettier": "^3.8.1",
34
97
  "yaml": "^2.8.4",
35
- "@inupedia/spotlight-client": "0.1.1",
36
- "@inupedia/spotlight-protocol": "0.1.1"
98
+ "@inupedia/spotlight-client": "0.1.2",
99
+ "@inupedia/spotlight-protocol": "0.1.2"
37
100
  },
38
101
  "peerDependencies": {
39
102
  "@inspira-ui/plugins": "^0.0.2",
@@ -73,6 +136,7 @@
73
136
  "typecheck": "vue-tsc --noEmit -p tsconfig.json",
74
137
  "build:js": "vite build",
75
138
  "build:types": "vue-tsc -p tsconfig.build.json",
76
- "build": "pnpm run clean && pnpm run build:js && pnpm run build:types"
139
+ "build": "pnpm run clean && pnpm run build:js && pnpm run build:types && pnpm run verify:exports",
140
+ "verify:exports": "node ../scripts/verify-package-exports.mjs --no-js-sourcemaps"
77
141
  }
78
142
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sources":["../../src/avatar/config.ts"],"sourcesContent":["import { inject, type InjectionKey } from \"vue\";\n\nexport type SpotlightAvatarConfig = {\n /** Base URL for Spine assets (defaults to `import.meta.env.BASE_URL`). */\n assetBaseUrl?: string;\n /** Skeleton JSON path relative to asset base (default: `little-drop/export/shuidi.json`). */\n skeletonJson?: string;\n greetingText?: string;\n bubbleTitle?: string;\n deckKicker?: string;\n briefingKeepLastMs?: number;\n};\n\nexport const SPOTLIGHT_AVATAR_CONFIG_KEY: InjectionKey<SpotlightAvatarConfig> =\n Symbol(\"spotlight-avatar-config\");\n\nconst DEFAULT_SKELETON = \"little-drop/export/shuidi.json\";\n\nexport function resolveAvatarAssetBase(config?: SpotlightAvatarConfig): string {\n const base = config?.assetBaseUrl?.trim();\n if (base) return base.endsWith(\"/\") ? base : `${base}/`;\n const envBase =\n typeof import.meta !== \"undefined\"\n ? String(import.meta.env.BASE_URL ?? \"/\")\n : \"/\";\n return envBase.endsWith(\"/\") ? envBase : `${envBase}/`;\n}\n\nexport function resolveAvatarSkeletonUrl(config?: SpotlightAvatarConfig): string {\n const relative = config?.skeletonJson?.trim() || DEFAULT_SKELETON;\n const base = resolveAvatarAssetBase(config);\n return relative.startsWith(\"http\") ? relative : `${base}${relative.replace(/^\\//, \"\")}`;\n}\n\nexport function useSpotlightAvatarConfig(): SpotlightAvatarConfig {\n return inject(SPOTLIGHT_AVATAR_CONFIG_KEY, {});\n}\n"],"names":["SPOTLIGHT_AVATAR_CONFIG_KEY","DEFAULT_SKELETON","resolveAvatarAssetBase","config","base","envBase","resolveAvatarSkeletonUrl","relative","useSpotlightAvatarConfig","inject"],"mappings":";AAaO,MAAMA,2BACJ,yBAAyB,GAE5BC,IAAmB;AAElB,SAASC,EAAuBC,GAAwC;AAC7E,QAAMC,IAAOD,GAAQ,cAAc,KAAA;AACnC,MAAIC,UAAaA,EAAK,SAAS,GAAG,IAAIA,IAAO,GAAGA,CAAI;AACpD,QAAMC,IAEO;AAEb,SAAOA,EAAQ,SAAS,GAAG,IAAIA,IAAU,GAAGA,CAAO;AACrD;AAEO,SAASC,EAAyBH,GAAwC;AAC/E,QAAMI,IAAWJ,GAAQ,cAAc,KAAA,KAAUF,GAC3CG,IAAOF,EAAuBC,CAAM;AAC1C,SAAOI,EAAS,WAAW,MAAM,IAAIA,IAAW,GAAGH,CAAI,GAAGG,EAAS,QAAQ,OAAO,EAAE,CAAC;AACvF;AAEO,SAASC,IAAkD;AAChE,SAAOC,EAAOT,GAA6B,EAAE;AAC/C;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"live2dAnswerSpeechPolicy.js","sources":["../../../src/avatar/speech/live2dAnswerSpeechPolicy.ts"],"sourcesContent":["const GENERIC_HOST_REPLY_PARTS = new Set([\n \"前端操作已执行。\",\n \"前端操作已执行\",\n \"前端操作执行失败。\",\n \"前端操作执行失败\",\n]);\n\n/** 纯宿主工具(打开 BIM / 监控等)默认短反馈,不适合占用数字人长口播。 */\nexport function isGenericHostExecutionReply(text: string): boolean {\n const normalized = text.trim();\n if (!normalized) return true;\n const parts = normalized\n .split(/[;;]/)\n .map((part) => part.trim())\n .filter(Boolean);\n if (parts.length === 0) return true;\n return parts.every((part) => GENERIC_HOST_REPLY_PARTS.has(part));\n}\n"],"names":["GENERIC_HOST_REPLY_PARTS","isGenericHostExecutionReply","text","normalized","parts","part"],"mappings":"AAAA,MAAMA,wBAA+B,IAAI;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,SAASC,EAA4BC,GAAuB;AACjE,QAAMC,IAAaD,EAAK,KAAA;AACxB,MAAI,CAACC,EAAY,QAAO;AACxB,QAAMC,IAAQD,EACX,MAAM,MAAM,EACZ,IAAI,CAACE,MAASA,EAAK,KAAA,CAAM,EACzB,OAAO,OAAO;AACjB,SAAID,EAAM,WAAW,IAAU,KACxBA,EAAM,MAAM,CAACC,MAASL,EAAyB,IAAIK,CAAI,CAAC;AACjE;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"live2dBriefingSummarizer.js","sources":["../../../src/avatar/speech/live2dBriefingSummarizer.ts"],"sourcesContent":["import { getLlmTimeoutMs, parseJsonContent } from \"./llmUtils.js\";\nimport { postSpotlightJson } from \"../../remote/serverJson.js\";\n\nexport interface Live2dBriefingSentence {\n text: string;\n pauseMs?: number;\n}\n\nexport interface Live2dBriefingPlan {\n title?: string;\n sentences: Live2dBriefingSentence[];\n}\n\ntype Live2dBriefingSchema = {\n title?: string;\n sentences?: Array<{\n text?: string;\n pauseMs?: number;\n }>;\n};\n\nconst SYSTEM_PROMPT = [\n \"你是工程项目数字人汇报压缩器。\",\n \"你的任务:把输入内容压缩成适合口播汇报的短句。\",\n \"输出必须是 JSON,且严格匹配 schema,不要输出任何额外文本。\",\n \"约束:\",\n \"1) 句子通俗、口语化,避免工具名、链路细节、markdown 标记。\",\n \"2) 优先保留:结论、关键数字、风险提醒、下一步建议。\",\n \"3) 每句长度建议 16~36 字,最多 8 句。\",\n \"4) 如果信息不足,给出保守说明,不要编造。\",\n].join(\"\\n\");\n\nfunction resolveMaxSentences(): number {\n const raw = Number(import.meta.env.VITE_LIVE2D_BRIEFING_MAX_SENTENCES ?? 5);\n if (!Number.isFinite(raw)) return 5;\n return Math.min(8, Math.max(1, Math.round(raw)));\n}\n\nfunction normalizeSentence(\n sentence: Live2dBriefingSentence,\n): Live2dBriefingSentence | null {\n const text = sentence.text\n .replace(/\\s+/g, \" \")\n .replace(/[。!?;,.,]+$/g, \"\")\n .trim();\n if (!text) return null;\n return {\n text: `${text}。`,\n pauseMs:\n typeof sentence.pauseMs === \"number\"\n ? Math.min(1200, Math.max(0, Math.round(sentence.pauseMs)))\n : 260,\n };\n}\n\nfunction fallbackSplitSentences(content: string): Live2dBriefingPlan {\n const maxSentences = resolveMaxSentences();\n const plain = content\n .replace(/```[\\s\\S]*?```/g, \" \")\n .replace(/`([^`]+)`/g, \"$1\")\n .replace(/\\[(.*?)\\]\\((.*?)\\)/g, \"$1\")\n .replace(/[#>*_-]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n\n const chunks = plain\n .split(/[。!?;]/)\n .map((part) => part.trim())\n .filter(Boolean)\n .slice(0, maxSentences);\n\n const sentences = (chunks.length ? chunks : [plain.slice(0, 48)])\n .map((text) => normalizeSentence({ text, pauseMs: 260 }))\n .filter((item): item is Live2dBriefingSentence => Boolean(item));\n\n return { title: \"本轮汇报\", sentences };\n}\n\nexport function buildFastLive2dBriefing(\n rawContent: string,\n): Live2dBriefingPlan {\n return fallbackSplitSentences(rawContent);\n}\n\nfunction toPlan(data: Live2dBriefingSchema): Live2dBriefingPlan {\n const maxSentences = resolveMaxSentences();\n const sentences = (data.sentences ?? [])\n .map((item) =>\n normalizeSentence({\n text: item.text ?? \"\",\n pauseMs: item.pauseMs ?? 260,\n }),\n )\n .filter((item): item is Live2dBriefingSentence => Boolean(item))\n .slice(0, maxSentences);\n\n if (!sentences.length) {\n throw new Error(\"live2d briefing has empty sentences\");\n }\n\n return {\n title: data.title?.trim() || \"本轮汇报\",\n sentences,\n };\n}\n\nasync function requestBriefingLlm(\n userPrompt: string,\n maxSentences: number,\n signal?: AbortSignal,\n): Promise<string> {\n const { content } = await postSpotlightJson<{ content: string }>(\n \"/v1/llm/chat\",\n {\n systemPrompt: [\n SYSTEM_PROMPT,\n `5) 最多输出 ${maxSentences} 句。`,\n \"输出格式示例:\",\n '{\"title\":\"本轮汇报\",\"sentences\":[{\"text\":\"...\",\"pauseMs\":260}]}',\n \"禁止输出 markdown 代码块。\",\n ].join(\"\\n\"),\n userPrompt,\n maxTokens: 700,\n timeoutMs: Math.max(getLlmTimeoutMs(), 45_000),\n },\n signal,\n );\n return content;\n}\n\nexport async function summarizeLive2dBriefing(\n rawContent: string,\n signal?: AbortSignal,\n): Promise<Live2dBriefingPlan> {\n const input = rawContent.trim();\n if (!input) {\n return { title: \"本轮汇报\", sentences: [] };\n }\n\n try {\n const maxSentences = resolveMaxSentences();\n const compactInput = input.slice(0, 4000);\n const content = await requestBriefingLlm(\n `请将以下内容压缩为数字人汇报短句:\\n\\n${compactInput}`,\n maxSentences,\n signal,\n );\n const parsed = parseJsonContent<Live2dBriefingSchema>(content);\n return toPlan({\n title: parsed.title,\n sentences: Array.isArray(parsed.sentences)\n ? parsed.sentences.map((item) => ({\n text: item.text ?? \"\",\n pauseMs: item.pauseMs,\n }))\n : [],\n });\n } catch {\n return fallbackSplitSentences(input);\n }\n}\n"],"names":["SYSTEM_PROMPT","resolveMaxSentences","normalizeSentence","sentence","text","fallbackSplitSentences","content","maxSentences","plain","chunks","part","item","buildFastLive2dBriefing","rawContent","toPlan","data","sentences","requestBriefingLlm","userPrompt","signal","postSpotlightJson","getLlmTimeoutMs","summarizeLive2dBriefing","input","compactInput","parsed","parseJsonContent"],"mappings":";;AAqBA,MAAMA,IAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK;AAAA,CAAI;AAEX,SAASC,IAA8B;AAErC,SAAK,OAAO,SAAS,CAAG,IACjB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,CAAG,CAAC,CAAC,IADb;AAEpC;AAEA,SAASC,EACPC,GAC+B;AAC/B,QAAMC,IAAOD,EAAS,KACnB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,gBAAgB,EAAE,EAC1B,KAAA;AACH,SAAKC,IACE;AAAA,IACL,MAAM,GAAGA,CAAI;AAAA,IACb,SACE,OAAOD,EAAS,WAAY,WACxB,KAAK,IAAI,MAAM,KAAK,IAAI,GAAG,KAAK,MAAMA,EAAS,OAAO,CAAC,CAAC,IACxD;AAAA,EAAA,IANU;AAQpB;AAEA,SAASE,EAAuBC,GAAqC;AACnE,QAAMC,IAAeN,EAAA,GACfO,IAAQF,EACX,QAAQ,mBAAmB,GAAG,EAC9B,QAAQ,cAAc,IAAI,EAC1B,QAAQ,uBAAuB,IAAI,EACnC,QAAQ,aAAa,GAAG,EACxB,QAAQ,QAAQ,GAAG,EACnB,KAAA,GAEGG,IAASD,EACZ,MAAM,QAAQ,EACd,IAAI,CAACE,MAASA,EAAK,KAAA,CAAM,EACzB,OAAO,OAAO,EACd,MAAM,GAAGH,CAAY;AAMxB,SAAO,EAAE,OAAO,QAAQ,YAJLE,EAAO,SAASA,IAAS,CAACD,EAAM,MAAM,GAAG,EAAE,CAAC,GAC5D,IAAI,CAACJ,MAASF,EAAkB,EAAE,MAAAE,GAAM,SAAS,IAAA,CAAK,CAAC,EACvD,OAAO,CAACO,MAAyC,EAAQA,CAAK,EAEzC;AAC1B;AAEO,SAASC,EACdC,GACoB;AACpB,SAAOR,EAAuBQ,CAAU;AAC1C;AAEA,SAASC,EAAOC,GAAgD;AAC9D,QAAMR,IAAeN,EAAA,GACfe,KAAaD,EAAK,aAAa,CAAA,GAClC;AAAA,IAAI,CAACJ,MACJT,EAAkB;AAAA,MAChB,MAAMS,EAAK,QAAQ;AAAA,MACnB,SAASA,EAAK,WAAW;AAAA,IAAA,CAC1B;AAAA,EAAA,EAEF,OAAO,CAACA,MAAyC,EAAQA,CAAK,EAC9D,MAAM,GAAGJ,CAAY;AAExB,MAAI,CAACS,EAAU;AACb,UAAM,IAAI,MAAM,qCAAqC;AAGvD,SAAO;AAAA,IACL,OAAOD,EAAK,OAAO,KAAA,KAAU;AAAA,IAC7B,WAAAC;AAAA,EAAA;AAEJ;AAEA,eAAeC,EACbC,GACAX,GACAY,GACiB;AACjB,QAAM,EAAE,SAAAb,EAAA,IAAY,MAAMc;AAAA,IACxB;AAAA,IACA;AAAA,MACE,cAAc;AAAA,QACZpB;AAAA,QACA,WAAWO,CAAY;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MAAA,EACA,KAAK;AAAA,CAAI;AAAA,MACX,YAAAW;AAAA,MACA,WAAW;AAAA,MACX,WAAW,KAAK,IAAIG,EAAA,GAAmB,IAAM;AAAA,IAAA;AAAA,IAE/CF;AAAA,EAAA;AAEF,SAAOb;AACT;AAEA,eAAsBgB,EACpBT,GACAM,GAC6B;AAC7B,QAAMI,IAAQV,EAAW,KAAA;AACzB,MAAI,CAACU;AACH,WAAO,EAAE,OAAO,QAAQ,WAAW,CAAA,EAAC;AAGtC,MAAI;AACF,UAAMhB,IAAeN,EAAA,GACfuB,IAAeD,EAAM,MAAM,GAAG,GAAI,GAClCjB,IAAU,MAAMW;AAAA,MACpB;AAAA;AAAA,EAAwBO,CAAY;AAAA,MACpCjB;AAAA,MACAY;AAAA,IAAA,GAEIM,IAASC,EAAuCpB,CAAO;AAC7D,WAAOQ,EAAO;AAAA,MACZ,OAAOW,EAAO;AAAA,MACd,WAAW,MAAM,QAAQA,EAAO,SAAS,IACrCA,EAAO,UAAU,IAAI,CAACd,OAAU;AAAA,QAC9B,MAAMA,EAAK,QAAQ;AAAA,QACnB,SAASA,EAAK;AAAA,MAAA,EACd,IACF,CAAA;AAAA,IAAC,CACN;AAAA,EACH,QAAQ;AACN,WAAON,EAAuBkB,CAAK;AAAA,EACrC;AACF;"}