@olares/lares-core 0.15.15 → 0.15.16

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/i18n/voice.js CHANGED
@@ -32,6 +32,7 @@ export const ZH = {
32
32
  "dictation.discard": "放弃",
33
33
  "dictation.original": "查看原文",
34
34
  "dictation.processing": "正在整理文字…",
35
+ "dictation.processingFailed": "文字整理失败,原始转写已保留",
35
36
  "dictation.preview": "预览并编辑",
36
37
  "dictation.retry": "重试",
37
38
  "dictation.useOriginal": "使用原文",
@@ -274,6 +275,7 @@ export const EN = {
274
275
  "dictation.discard": "Discard",
275
276
  "dictation.original": "View original",
276
277
  "dictation.processing": "Refining text…",
278
+ "dictation.processingFailed": "Text processing failed. Original transcript preserved.",
277
279
  "dictation.preview": "Preview and edit",
278
280
  "dictation.retry": "Retry",
279
281
  "dictation.useOriginal": "Use original",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olares/lares-core",
3
- "version": "0.15.15",
3
+ "version": "0.15.16",
4
4
  "description": "Lares 共享业务核心:Router、workspace、文件/媒体、Olares 身份(无 UI、无平台壳)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -21,6 +21,12 @@ export function voiceInputPresentation(view, now = Date.now()) {
21
21
  return { ...ui, label, elapsed, disabled: ui.pending && !view.holding, timed: ui.recording || view.holding };
22
22
  }
23
23
 
24
+ export function voiceDictationPresentation(view, now = Date.now()) {
25
+ const ui = voiceInputPresentation(view, now);
26
+ const processingFailed = Boolean(view.raw && view.error && view.error !== "voice_draft_changed");
27
+ return { ...ui, waveform: ui.phase === "recording" && !ui.error, processingFailed, recoverable: Boolean(view.raw && ui.error) };
28
+ }
29
+
24
30
  /** Discovery establishes capability; a transient connection error does not revoke it. */
25
31
  export function voiceAvailability(settings) {
26
32
  if (!settings) return { dictation: false, conversation: false, reason: "loading" };