@sonicloud/dsh-sonicloud-device 0.1.3 → 0.1.5

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 (74) hide show
  1. package/CHANGELOG.md +37 -1
  2. package/CHANGELOG.zh.md +37 -1
  3. package/README.md +18 -14
  4. package/README.zh.md +9 -5
  5. package/dist/build.json +1 -1
  6. package/dist/client.js +2112 -120
  7. package/docs/contributing/development.md +7 -5
  8. package/docs/specs/ci-cd.md +5 -4
  9. package/docs/specs/mouse-settings.md +1 -1
  10. package/docs/specs/multilingual.md +98 -0
  11. package/docs/specs/smart-mouse-plugin.md +6 -3
  12. package/locale/de.json +7 -0
  13. package/locale/en.json +7 -0
  14. package/locale/es.json +7 -0
  15. package/locale/fr.json +7 -0
  16. package/locale/ja.json +7 -0
  17. package/locale/pt.json +7 -0
  18. package/locale/ru.json +7 -0
  19. package/locale/zh.json +7 -0
  20. package/native/desktop/VOICE_SOURCE.json +2 -2
  21. package/native/desktop/VoicePanel.cs +70 -33
  22. package/native/desktop/VoicePanel.swift +58 -21
  23. package/native/desktop/darwin-arm64/Sonicloud Voice.app/Contents/MacOS/sonicloud-voice +0 -0
  24. package/native/screenshot/README.md +9 -4
  25. package/native/screenshot/SOURCE.json +48 -17
  26. package/native/screenshot/darwin-arm64/screentool-macos-1.2.2.zip +0 -0
  27. package/native/screenshot/helper-i18n/de.json +85 -0
  28. package/native/screenshot/helper-i18n/es.json +85 -0
  29. package/native/screenshot/helper-i18n/fr.json +85 -0
  30. package/native/screenshot/patches/{hide-cloud-actions.patch → macos/hide-cloud-actions.patch} +84 -76
  31. package/native/screenshot/patches/macos/mac-clang-compat.patch +14 -0
  32. package/native/screenshot/patches/macos/mac-color-panel.patch +40 -0
  33. package/native/screenshot/patches/macos/mac-permissions.patch +549 -0
  34. package/native/screenshot/patches/macos/mac-ui-focus.patch +658 -0
  35. package/native/screenshot/patches/macos/upstream-files.json +77 -0
  36. package/native/screenshot/patches/upstream-files.json +12 -8
  37. package/native/screenshot/win32-x64/i18n/de.json +85 -0
  38. package/native/screenshot/win32-x64/i18n/es.json +85 -0
  39. package/native/screenshot/win32-x64/i18n/fr.json +85 -0
  40. package/native/screenshot/win32-x64/screenhelper.exe +0 -0
  41. package/package.json +5 -3
  42. package/src/asr/auth.mjs +9 -8
  43. package/src/asr/config.mjs +1 -1
  44. package/src/asr/stream.mjs +25 -24
  45. package/src/desktop/presentation.mjs +18 -12
  46. package/src/desktop/screenshot-shortcut-worker.mjs +188 -0
  47. package/src/desktop/screenshot-shortcut.mjs +266 -0
  48. package/src/desktop/screenshot-worker.mjs +49 -32
  49. package/src/desktop/screenshot.mjs +46 -26
  50. package/src/devices/actions.mjs +7 -6
  51. package/src/devices/config.mjs +2 -1
  52. package/src/devices/diagnostics.mjs +4 -3
  53. package/src/devices/manager.mjs +77 -43
  54. package/src/devices/native-worker.mjs +4 -3
  55. package/src/devices/native.mjs +9 -8
  56. package/src/devices/queue.mjs +4 -3
  57. package/src/devices/recognition.mjs +5 -4
  58. package/src/devices/store.mjs +3 -2
  59. package/src/devices/translate.mjs +11 -10
  60. package/src/host/ai-conversation.mjs +8 -7
  61. package/src/host/index.mjs +13 -3
  62. package/src/host/locale.mjs +44 -0
  63. package/src/shared/devices.mjs +13 -12
  64. package/src/shared/i18n.mjs +47 -0
  65. package/src/shared/locales/de.json +181 -0
  66. package/src/shared/locales/en.json +181 -0
  67. package/src/shared/locales/es.json +181 -0
  68. package/src/shared/locales/fr.json +181 -0
  69. package/src/shared/locales/ja.json +181 -0
  70. package/src/shared/locales/pt.json +181 -0
  71. package/src/shared/locales/ru.json +181 -0
  72. package/src/shared/locales/zh.json +181 -0
  73. package/src/shared/remote.mjs +7 -1
  74. package/src/shared/screenshot-shortcut.mjs +50 -0
@@ -0,0 +1,77 @@
1
+ {
2
+ "source": {
3
+ "repository": "screenTool(厂商仓库)test 分支",
4
+ "commit": "e379887",
5
+ "tree": "358b36b9908bd0a666e5088ff2ffabdd39fbae0a",
6
+ "helperVersion": "1.3.0"
7
+ },
8
+ "patches": [
9
+ "mac-clang-compat.patch",
10
+ "hide-cloud-actions.patch",
11
+ "mac-permissions.patch",
12
+ "mac-ui-focus.patch",
13
+ "mac-color-panel.patch"
14
+ ],
15
+ "files": [
16
+ {
17
+ "path": "CMakeLists.txt",
18
+ "sha256": "d8dd98a68ae058cc97d84bdca8ce9738b9310cf0cde30e8add44759b704d1628"
19
+ },
20
+ {
21
+ "path": "core/graphics_item.cpp",
22
+ "sha256": "88398ab66933ca2c1ea2ab0c2d33f6fada1f33db6f42b3e6bffc9d68d340f4e4"
23
+ },
24
+ {
25
+ "path": "core/language_manager.cpp",
26
+ "sha256": "b6378590db9b283acdd95752a0194e9c62632251162ad93bb7607924f44b9c4f"
27
+ },
28
+ {
29
+ "path": "core/mac_native.h",
30
+ "sha256": "87c515bdce1ff035a51ed74f13e0ac2c488e75a1e55df797a14c04e760103927"
31
+ },
32
+ {
33
+ "path": "core/mac_window_level.mm",
34
+ "sha256": "8f63a21c8bb0d40002a309fd59652a38d9fe2ca59cd1280e55cb049bc3be0e3e"
35
+ },
36
+ {
37
+ "path": "core/popup_font_size.cpp",
38
+ "sha256": "1001290834264ac939884291767ec7454c3e551483f49479808ef9ba68aed8f2"
39
+ },
40
+ {
41
+ "path": "core/popup_pen_width.cpp",
42
+ "sha256": "a6604dc362cb136a3434a84270214af69a94590c0bf821d447f2b8a5c6eef5df"
43
+ },
44
+ {
45
+ "path": "core/screen_label.cpp",
46
+ "sha256": "ebc3fa1dc49c60eed49219d5431e8d5f663d8d7ce4f5f83058e60af3d92ebacf"
47
+ },
48
+ {
49
+ "path": "core/screen_label.h",
50
+ "sha256": "ba779d394f85b761ad0057142d46351b5abd6461fb9e966a986bb72992f823c8"
51
+ },
52
+ {
53
+ "path": "core/screen_tool_bar.cpp",
54
+ "sha256": "0b7553a9100bb4e3766328c8188c4900cd1b5aff5488f0488765e9350893a2fa"
55
+ },
56
+ {
57
+ "path": "core/stick_widget.cpp",
58
+ "sha256": "6f6092e558c0aef625f174f56101d5ea5671c5da2a1624ad69895d0e9d84a02d"
59
+ },
60
+ {
61
+ "path": "core/tools/text_tool.cpp",
62
+ "sha256": "870788fe052b5d310e878a62d005299383715014d4e8a323f558e6ea1d8687d3"
63
+ },
64
+ {
65
+ "path": "core/zoom_popup.cpp",
66
+ "sha256": "22424a1d385a2810a64e8ba42be39dc81c5c7927ea5852b5536a7f389f91a81f"
67
+ },
68
+ {
69
+ "path": "ipc/helper_gateway.cpp",
70
+ "sha256": "c7452c34406a65f815bc81011c2227fd28e8fccc9fb19a26094487c3ab3ba7b0"
71
+ },
72
+ {
73
+ "path": "ipc/helper_gateway.h",
74
+ "sha256": "da8fceba0525d73b35b94f25d7429a986bd13686ea99a1fa348a4d64936457d3"
75
+ }
76
+ ]
77
+ }
@@ -1,22 +1,26 @@
1
1
  [
2
2
  {
3
- "path": "core/screen_tool_bar.cpp",
4
- "sha256": "0b7553a9100bb4e3766328c8188c4900cd1b5aff5488f0488765e9350893a2fa"
3
+ "path": "CMakeLists.txt",
4
+ "sha256": "d8dd98a68ae058cc97d84bdca8ce9738b9310cf0cde30e8add44759b704d1628"
5
+ },
6
+ {
7
+ "path": "core/screen_label.cpp",
8
+ "sha256": "ebc3fa1dc49c60eed49219d5431e8d5f663d8d7ce4f5f83058e60af3d92ebacf"
5
9
  },
6
10
  {
7
11
  "path": "core/screen_label.h",
8
- "sha256": "b0105929067c2e3648cac46eaf668e2778b8e93a1084b947d2525e3900d47de8"
12
+ "sha256": "ba779d394f85b761ad0057142d46351b5abd6461fb9e966a986bb72992f823c8"
9
13
  },
10
14
  {
11
- "path": "core/screen_label.cpp",
12
- "sha256": "efc6d031df62be1e102d8c0954a4064e24240d68985fad0dcea28d8b4d12ca3f"
15
+ "path": "core/screen_tool_bar.cpp",
16
+ "sha256": "0b7553a9100bb4e3766328c8188c4900cd1b5aff5488f0488765e9350893a2fa"
13
17
  },
14
18
  {
15
19
  "path": "ipc/helper_gateway.cpp",
16
- "sha256": "42c352b33a521807ff19960eda168b5bf7b58a240e19b1d71c3e8c977d4659a8"
20
+ "sha256": "c7452c34406a65f815bc81011c2227fd28e8fccc9fb19a26094487c3ab3ba7b0"
17
21
  },
18
22
  {
19
- "path": "CMakeLists.txt",
20
- "sha256": "907778a37e319d1fe8e475f74e532c0f51c79b517b6eae85325d42211a505d49"
23
+ "path": "ipc/helper_gateway.h",
24
+ "sha256": "da8fceba0525d73b35b94f25d7429a986bd13686ea99a1fa348a4d64936457d3"
21
25
  }
22
26
  ]
@@ -0,0 +1,85 @@
1
+ {
2
+ "format": "screentool-i18n/1",
3
+ "language": "de",
4
+ "native_name": "Deutsch",
5
+ "english_name": "German",
6
+ "strings": {
7
+ "FontSizePopup": {
8
+ "S": "S",
9
+ "M": "M",
10
+ "L": "L"
11
+ },
12
+ "OcrResultWindow": {
13
+ "Close": "Schließen",
14
+ "Retry": "Erneut versuchen",
15
+ "Recognition failed": "Erkennung fehlgeschlagen",
16
+ "Copy all": "Alles kopieren",
17
+ "Image text recognition": "Texterkennung im Bild",
18
+ "Recognizing…": "Erkennen…"
19
+ },
20
+ "ScreenLabel": {
21
+ "Save the image": "Bild speichern",
22
+ "Save failed": "Speichern fehlgeschlagen",
23
+ "Cannot write file:\n%1": "Datei kann nicht geschrieben werden:\n%1",
24
+ "Accessibility permission": "Berechtigung für Bedienungshilfen",
25
+ "\"Auto scroll\" in scroll screenshots requires the Accessibility permission (manual scrolling is not affected).\n\nOpen System Settings → Privacy & Security → Accessibility, click \"+\" to add and check screenhelper.app (path: %1; press Cmd+Shift+G in the dialog and paste the path above to locate it). It takes effect immediately after adding.\n\nOpen System Settings now?": "„Automatisches Scrollen“ bei Scroll-Screenshots erfordert die Berechtigung für Bedienungshilfen (manuelles Scrollen ist nicht betroffen).\n\nÖffnen Sie Systemeinstellungen → Datenschutz & Sicherheit → Bedienungshilfen, klicken Sie auf „+“, um screenhelper.app hinzuzufügen und zu aktivieren (Pfad: %1; drücken Sie im Dialog Cmd+Shift+G und fügen Sie den obigen Pfad ein, um ihn zu finden). Wirkt sofort nach dem Hinzufügen.\n\nSystemeinstellungen jetzt öffnen?",
26
+ "Screen recording permission": "Berechtigung für Bildschirmaufnahme",
27
+ "Scroll screenshots require the Screen Recording permission, otherwise the captured image will have a black background.\n\nOpen System Settings → Privacy & Security → Screen Recording, click \"+\" to add and check screenhelper.app (path: %1; press Cmd+Shift+G in the dialog and paste the path above to locate it). Restart screenhelper after adding for it to take effect.\n\nOpen System Settings now?": "Scroll-Screenshots erfordern die Berechtigung für Bildschirmaufnahme, sonst hat das aufgenommene Bild einen schwarzen Hintergrund.\n\nÖffnen Sie Systemeinstellungen → Datenschutz & Sicherheit → Bildschirmaufnahme, klicken Sie auf „+“, um screenhelper.app hinzuzufügen und zu aktivieren (Pfad: %1; drücken Sie im Dialog Cmd+Shift+G und fügen Sie den obigen Pfad ein, um ihn zu finden). Starten Sie screenhelper nach dem Hinzufügen neu, damit es wirksam wird.\n\nSystemeinstellungen jetzt öffnen?",
28
+ "Scroll screenshot failed": "Scroll-Screenshot fehlgeschlagen"
29
+ },
30
+ "ScreenToolBar": {
31
+ "OCR": "OCR",
32
+ "Pen": "Stift",
33
+ "Redo": "Wiederholen",
34
+ "Undo": "Rückgängig",
35
+ "Zoom": "Zoom",
36
+ "Mosaic label": "Mosaik",
37
+ "Save Ctrl+S": "Speichern Strg+S",
38
+ "Take a new screenshot": "Neuer Screenshot",
39
+ "Text label": "Text",
40
+ "Rect label": "Rechteck",
41
+ "Line label": "Linie",
42
+ "Translate": "Übersetzen",
43
+ "Scroll screenshot": "Scroll-Screenshot",
44
+ "Arrow label": "Pfeil",
45
+ "Select color": "Farbe wählen",
46
+ "Finish edit": "Bearbeitung abschließen",
47
+ "Pin on desktop": "Auf dem Desktop anheften",
48
+ "Ellipse label": "Ellipse",
49
+ "Cancel edit": "Bearbeitung abbrechen",
50
+ "Complete screenshot": "Screenshot abschließen",
51
+ "Exit screenshot": "Screenshot beenden",
52
+ "Color palette": "Farbpalette"
53
+ },
54
+ "StickWidget": {
55
+ "Copy": "Kopieren",
56
+ "Edit": "Bearbeiten",
57
+ "Save": "Speichern",
58
+ "Close": "Schließen",
59
+ "Zoom percentage:": "Zoom-Prozentwert:",
60
+ "Save failed": "Speichern fehlgeschlagen",
61
+ "Cannot write file:\n%1": "Datei kann nicht geschrieben werden:\n%1",
62
+ "Zoom: %1%": "Zoom: %1%",
63
+ "Custom…": "Benutzerdefiniert…",
64
+ "Set zoom": "Zoom festlegen",
65
+ "Always on top": "Immer im Vordergrund"
66
+ }
67
+ },
68
+ "pixpin": {
69
+ "Hold to drag toolbar": "Halten, um die Leiste zu ziehen",
70
+ "Drag to move": "Ziehen zum Verschieben",
71
+ "Change Direction": "Richtung wechseln",
72
+ "Auto Scroll Screenshot": "Automatischer Scroll-Screenshot",
73
+ "Crop": "Zuschneiden",
74
+ "Start/Stop": "Start/Stopp",
75
+ "Close": "Schließen",
76
+ "Save": "Speichern",
77
+ "Copy and close": "Kopieren und schließen",
78
+ "AI Assistant": "KI-Assistent",
79
+ "Drag Horizontal": "Horizontal ziehen",
80
+ "Drag Vertical": "Vertikal ziehen",
81
+ "Auto cropping": "Automatisches Zuschneiden",
82
+ "Save Image": "Bild speichern",
83
+ "PNG Image (*.png);;JPEG Image (*.jpg *.jpeg);;BMP Image (*.bmp);;All Files (*)": "PNG-Bild (*.png);;JPEG-Bild (*.jpg *.jpeg);;BMP-Bild (*.bmp);;Alle Dateien (*)"
84
+ }
85
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "format": "screentool-i18n/1",
3
+ "language": "es",
4
+ "native_name": "Español",
5
+ "english_name": "Spanish",
6
+ "strings": {
7
+ "FontSizePopup": {
8
+ "S": "P",
9
+ "M": "M",
10
+ "L": "G"
11
+ },
12
+ "OcrResultWindow": {
13
+ "Close": "Cerrar",
14
+ "Retry": "Reintentar",
15
+ "Recognition failed": "Reconocimiento fallido",
16
+ "Copy all": "Copiar todo",
17
+ "Image text recognition": "Reconocimiento de texto en imagen",
18
+ "Recognizing…": "Reconociendo…"
19
+ },
20
+ "ScreenLabel": {
21
+ "Save the image": "Guardar imagen",
22
+ "Save failed": "Error al guardar",
23
+ "Cannot write file:\n%1": "No se puede escribir el archivo:\n%1",
24
+ "Accessibility permission": "Permiso de accesibilidad",
25
+ "\"Auto scroll\" in scroll screenshots requires the Accessibility permission (manual scrolling is not affected).\n\nOpen System Settings → Privacy & Security → Accessibility, click \"+\" to add and check screenhelper.app (path: %1; press Cmd+Shift+G in the dialog and paste the path above to locate it). It takes effect immediately after adding.\n\nOpen System Settings now?": "El «desplazamiento automático» de las capturas desplazables requiere el permiso de accesibilidad (el desplazamiento manual no se ve afectado).\n\nAbra Ajustes del sistema → Privacidad y seguridad → Accesibilidad, pulse «+» para añadir y marcar screenhelper.app (ruta: %1; pulse Cmd+Shift+G en el cuadro de diálogo y pegue la ruta anterior para localizarlo). Surte efecto inmediatamente después de añadirlo.\n\n¿Abrir ahora los Ajustes del sistema?",
26
+ "Screen recording permission": "Permiso de grabación de pantalla",
27
+ "Scroll screenshots require the Screen Recording permission, otherwise the captured image will have a black background.\n\nOpen System Settings → Privacy & Security → Screen Recording, click \"+\" to add and check screenhelper.app (path: %1; press Cmd+Shift+G in the dialog and paste the path above to locate it). Restart screenhelper after adding for it to take effect.\n\nOpen System Settings now?": "Las capturas desplazables requieren el permiso de grabación de pantalla; de lo contrario, la imagen capturada tendrá un fondo negro.\n\nAbra Ajustes del sistema → Privacidad y seguridad → Grabación de pantalla, pulse «+» para añadir y marcar screenhelper.app (ruta: %1; pulse Cmd+Shift+G en el cuadro de diálogo y pegue la ruta anterior para localizarlo). Reinicie screenhelper después de añadirlo para que surta efecto.\n\n¿Abrir ahora los Ajustes del sistema?",
28
+ "Scroll screenshot failed": "Error en la captura desplazable"
29
+ },
30
+ "ScreenToolBar": {
31
+ "OCR": "OCR",
32
+ "Pen": "Lápiz",
33
+ "Redo": "Rehacer",
34
+ "Undo": "Deshacer",
35
+ "Zoom": "Zoom",
36
+ "Mosaic label": "Mosaico",
37
+ "Save Ctrl+S": "Guardar Ctrl+S",
38
+ "Take a new screenshot": "Nueva captura",
39
+ "Text label": "Texto",
40
+ "Rect label": "Rectángulo",
41
+ "Line label": "Línea",
42
+ "Translate": "Traducir",
43
+ "Scroll screenshot": "Captura desplazable",
44
+ "Arrow label": "Flecha",
45
+ "Select color": "Elegir color",
46
+ "Finish edit": "Terminar edición",
47
+ "Pin on desktop": "Fijar en el escritorio",
48
+ "Ellipse label": "Elipse",
49
+ "Cancel edit": "Cancelar edición",
50
+ "Complete screenshot": "Completar captura",
51
+ "Exit screenshot": "Salir de la captura",
52
+ "Color palette": "Paleta de colores"
53
+ },
54
+ "StickWidget": {
55
+ "Copy": "Copiar",
56
+ "Edit": "Editar",
57
+ "Save": "Guardar",
58
+ "Close": "Cerrar",
59
+ "Zoom percentage:": "Porcentaje de zoom:",
60
+ "Save failed": "Error al guardar",
61
+ "Cannot write file:\n%1": "No se puede escribir el archivo:\n%1",
62
+ "Zoom: %1%": "Zoom: %1%",
63
+ "Custom…": "Personalizar…",
64
+ "Set zoom": "Ajustar zoom",
65
+ "Always on top": "Siempre visible"
66
+ }
67
+ },
68
+ "pixpin": {
69
+ "Hold to drag toolbar": "Mantener pulsado para arrastrar la barra",
70
+ "Drag to move": "Arrastrar para mover",
71
+ "Change Direction": "Cambiar dirección",
72
+ "Auto Scroll Screenshot": "Captura desplazable automática",
73
+ "Crop": "Recortar",
74
+ "Start/Stop": "Iniciar/Detener",
75
+ "Close": "Cerrar",
76
+ "Save": "Guardar",
77
+ "Copy and close": "Copiar y cerrar",
78
+ "AI Assistant": "Asistente de IA",
79
+ "Drag Horizontal": "Arrastrar en horizontal",
80
+ "Drag Vertical": "Arrastrar en vertical",
81
+ "Auto cropping": "Recorte automático",
82
+ "Save Image": "Guardar imagen",
83
+ "PNG Image (*.png);;JPEG Image (*.jpg *.jpeg);;BMP Image (*.bmp);;All Files (*)": "Imagen PNG (*.png);;Imagen JPEG (*.jpg *.jpeg);;Imagen BMP (*.bmp);;Todos los archivos (*)"
84
+ }
85
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "format": "screentool-i18n/1",
3
+ "language": "fr",
4
+ "native_name": "Français",
5
+ "english_name": "French",
6
+ "strings": {
7
+ "FontSizePopup": {
8
+ "S": "P",
9
+ "M": "M",
10
+ "L": "G"
11
+ },
12
+ "OcrResultWindow": {
13
+ "Close": "Fermer",
14
+ "Retry": "Réessayer",
15
+ "Recognition failed": "Échec de la reconnaissance",
16
+ "Copy all": "Tout copier",
17
+ "Image text recognition": "Reconnaissance de texte dans l'image",
18
+ "Recognizing…": "Reconnaissance…"
19
+ },
20
+ "ScreenLabel": {
21
+ "Save the image": "Enregistrer l'image",
22
+ "Save failed": "Échec de l'enregistrement",
23
+ "Cannot write file:\n%1": "Impossible d'écrire le fichier :\n%1",
24
+ "Accessibility permission": "Autorisation d'accessibilité",
25
+ "\"Auto scroll\" in scroll screenshots requires the Accessibility permission (manual scrolling is not affected).\n\nOpen System Settings → Privacy & Security → Accessibility, click \"+\" to add and check screenhelper.app (path: %1; press Cmd+Shift+G in the dialog and paste the path above to locate it). It takes effect immediately after adding.\n\nOpen System Settings now?": "Le « défilement automatique » des captures défilantes nécessite l'autorisation d'accessibilité (le défilement manuel n'est pas concerné).\n\nOuvrez Réglages Système → Confidentialité et sécurité → Accessibilité, cliquez sur « + » pour ajouter et cocher screenhelper.app (chemin : %1 ; appuyez sur Cmd+Maj+G dans la boîte de dialogue et collez le chemin ci-dessus pour le localiser). Prend effet immédiatement après l'ajout.\n\nOuvrir les Réglages Système maintenant ?",
26
+ "Screen recording permission": "Autorisation d'enregistrement de l'écran",
27
+ "Scroll screenshots require the Screen Recording permission, otherwise the captured image will have a black background.\n\nOpen System Settings → Privacy & Security → Screen Recording, click \"+\" to add and check screenhelper.app (path: %1; press Cmd+Shift+G in the dialog and paste the path above to locate it). Restart screenhelper after adding for it to take effect.\n\nOpen System Settings now?": "Les captures défilantes nécessitent l'autorisation d'enregistrement de l'écran, sinon l'image capturée aura un fond noir.\n\nOuvrez Réglages Système → Confidentialité et sécurité → Enregistrement de l'écran, cliquez sur « + » pour ajouter et cocher screenhelper.app (chemin : %1 ; appuyez sur Cmd+Maj+G dans la boîte de dialogue et collez le chemin ci-dessus pour le localiser). Redémarrez screenhelper après l'ajout pour qu'il prenne effet.\n\nOuvrir les Réglages Système maintenant ?",
28
+ "Scroll screenshot failed": "Échec de la capture défilante"
29
+ },
30
+ "ScreenToolBar": {
31
+ "OCR": "OCR",
32
+ "Pen": "Crayon",
33
+ "Redo": "Rétablir",
34
+ "Undo": "Annuler",
35
+ "Zoom": "Zoom",
36
+ "Mosaic label": "Mosaïque",
37
+ "Save Ctrl+S": "Enregistrer Ctrl+S",
38
+ "Take a new screenshot": "Nouvelle capture",
39
+ "Text label": "Texte",
40
+ "Rect label": "Rectangle",
41
+ "Line label": "Ligne",
42
+ "Translate": "Traduire",
43
+ "Scroll screenshot": "Capture défilante",
44
+ "Arrow label": "Flèche",
45
+ "Select color": "Choisir la couleur",
46
+ "Finish edit": "Terminer la modification",
47
+ "Pin on desktop": "Épingler sur le bureau",
48
+ "Ellipse label": "Ellipse",
49
+ "Cancel edit": "Annuler la modification",
50
+ "Complete screenshot": "Terminer la capture",
51
+ "Exit screenshot": "Quitter la capture",
52
+ "Color palette": "Palette de couleurs"
53
+ },
54
+ "StickWidget": {
55
+ "Copy": "Copier",
56
+ "Edit": "Modifier",
57
+ "Save": "Enregistrer",
58
+ "Close": "Fermer",
59
+ "Zoom percentage:": "Pourcentage de zoom :",
60
+ "Save failed": "Échec de l'enregistrement",
61
+ "Cannot write file:\n%1": "Impossible d'écrire le fichier :\n%1",
62
+ "Zoom: %1%": "Zoom : %1%",
63
+ "Custom…": "Personnaliser…",
64
+ "Set zoom": "Définir le zoom",
65
+ "Always on top": "Toujours au premier plan"
66
+ }
67
+ },
68
+ "pixpin": {
69
+ "Hold to drag toolbar": "Maintenir pour faire glisser la barre",
70
+ "Drag to move": "Faire glisser pour déplacer",
71
+ "Change Direction": "Changer de direction",
72
+ "Auto Scroll Screenshot": "Capture défilante automatique",
73
+ "Crop": "Recadrer",
74
+ "Start/Stop": "Démarrer/Arrêter",
75
+ "Close": "Fermer",
76
+ "Save": "Enregistrer",
77
+ "Copy and close": "Copier et fermer",
78
+ "AI Assistant": "Assistant IA",
79
+ "Drag Horizontal": "Faire glisser horizontalement",
80
+ "Drag Vertical": "Faire glisser verticalement",
81
+ "Auto cropping": "Recadrage automatique",
82
+ "Save Image": "Enregistrer l'image",
83
+ "PNG Image (*.png);;JPEG Image (*.jpg *.jpeg);;BMP Image (*.bmp);;All Files (*)": "Image PNG (*.png);;Image JPEG (*.jpg *.jpeg);;Image BMP (*.bmp);;Tous les fichiers (*)"
84
+ }
85
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonicloud/dsh-sonicloud-device",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "DeepSeek Harness 智能鼠标、多设备设置与共享语音服务",
5
5
  "icon": "./src/client/assets/sonicloud.png",
6
6
  "type": "module",
@@ -8,7 +8,8 @@
8
8
  "exports": {
9
9
  ".": "./src/host/index.mjs",
10
10
  "./client": "./dist/client.js",
11
- "./package.json": "./package.json"
11
+ "./package.json": "./package.json",
12
+ "./locale/*.json": "./locale/*.json"
12
13
  },
13
14
  "files": [
14
15
  "src/asr",
@@ -24,7 +25,8 @@
24
25
  "native",
25
26
  "docs",
26
27
  "CHANGELOG.md",
27
- "CHANGELOG.zh.md"
28
+ "CHANGELOG.zh.md",
29
+ "locale"
28
30
  ],
29
31
  "dsh": {
30
32
  "bundle": {
package/src/asr/auth.mjs CHANGED
@@ -1,8 +1,9 @@
1
+ import { message as msg } from '../shared/i18n.mjs';
1
2
  import { BUILTIN_ASR } from './config.mjs';
2
3
  import { isStableSn } from '../shared/devices.mjs';
3
4
 
4
5
  export function createTokenRequest({ sn }) {
5
- if (!isStableSn(sn)) throw new Error('设备身份未确认,请重新连接鼠标');
6
+ if (!isStableSn(sn)) throw new Error(msg('error.device'));
6
7
  return { sn };
7
8
  }
8
9
 
@@ -26,24 +27,24 @@ export function createTokenProvider(config, fetchImpl = globalThis.fetch, lifeti
26
27
  });
27
28
  payload = await response.json();
28
29
  } catch (error) {
29
- if (signal.aborted && !entry.abort.signal.aborted && !lifetime?.aborted) throw new Error('Token 获取超时,请稍后重试');
30
+ if (signal.aborted && !entry.abort.signal.aborted && !lifetime?.aborted) throw new Error(msg('error.timeout'));
30
31
  signal.throwIfAborted();
31
32
  if (!isStableSn(service.sn)) throw error;
32
- throw new Error('Token 获取失败,请检查网络后重试');
33
+ throw new Error(msg('error.auth'));
33
34
  }
34
35
  signal.throwIfAborted();
35
36
  if (!response.ok || payload?.code !== 0) {
36
37
  const messages = {
37
- 4001: '设备身份无效,请重新连接鼠标', 1001: '设备鉴权参数错误,请联系服务方',
38
- 1002: '设备鉴权失败,请联系服务方', 1008: 'License 设备数量已达上限',
38
+ 4001: msg('error.device'), 1001: msg('error.auth'),
39
+ 1002: msg('error.auth'), 1008: msg('error.deviceLimit'),
39
40
  };
40
- throw new Error(messages[payload?.code] ?? 'Token 获取失败,请稍后重试');
41
+ throw new Error(messages[payload?.code] ?? msg('error.auth'));
41
42
  }
42
43
  const { token, expire_time: expiry } = payload.data ?? {};
43
44
  if (typeof token !== 'string' || !token.trim() || !Number.isSafeInteger(expiry) || expiry <= Date.now() / 1000) {
44
- throw new Error('Token 响应无效或已过期,请稍后重试');
45
+ throw new Error(msg('error.auth'));
45
46
  }
46
- if (entry.generation !== generation) throw new Error('Token 请求已失效');
47
+ if (entry.generation !== generation) throw new Error(msg('error.auth'));
47
48
  cachedToken = token; expiresAt = expiry * 1000;
48
49
  return token;
49
50
  }
@@ -1,5 +1,5 @@
1
1
  export const BUILTIN_ASR = Object.freeze({
2
- name: '声云 ASR',
2
+ name: 'Sonicloud ASR',
3
3
  streamUrl: 'wss://openapi.sinicloud.com/talentStreamAsr',
4
4
  tokenUrl: 'https://dsh_device.sonicrhino.cc/api/open.sign/generate',
5
5
  translateUrl: 'https://openapi.sinicloud.com/v1/translate/text',
@@ -1,3 +1,4 @@
1
+ import { message as msg } from '../shared/i18n.mjs';
1
2
  import WebSocket from 'ws';
2
3
 
3
4
  class Queue {
@@ -5,7 +6,7 @@ class Queue {
5
6
  ended = false;
6
7
  push(item) {
7
8
  if (this.ended) return;
8
- if (this.items.length >= 256) { this.items = [{ type: 'error', message: '识别结果接收过慢,请重新录音' }]; this.end(); return; }
9
+ if (this.items.length >= 256) { this.items = [{ type: 'error', message: msg('error.audio') }]; this.end(); return; }
9
10
  this.items.push(item); this.wake?.();
10
11
  }
11
12
  end() { this.ended = true; this.wake?.(); }
@@ -19,12 +20,12 @@ class Queue {
19
20
  }
20
21
 
21
22
  const errors = {
22
- '4010': 'Token 认证失败,请稍后重试',
23
- '4011': 'ASR 额度不足,请充值后重试',
24
- '4012': 'ASR 应用不存在、未认证或已下线',
25
- '4013': 'ASR 并发连接已达上限,请稍后重试',
26
- '4014': 'License 设备未注册', '4015': 'License 设备已被其他会话占用',
27
- '-1': '语音太短,请重新录音', '16': '未识别到语音',
23
+ '4010': msg('error.auth'),
24
+ '4011': msg('error.quota'),
25
+ '4012': msg('error.auth'),
26
+ '4013': msg('error.busy'),
27
+ '4014': msg('error.auth'), '4015': msg('error.busy'),
28
+ '-1': msg('error.noSpeech'), '16': msg('error.noSpeech'),
28
29
  };
29
30
 
30
31
  // The live service also uses numeric strings and code 3 interim / code 10 final frames.
@@ -56,16 +57,16 @@ export async function* streamRecognition({ service, token, uplink, signal, onAut
56
57
  socket.terminate();
57
58
  };
58
59
  const arm = (delay, message) => { clearTimeout(timer); timer = setTimeout(() => fail(message), delay); };
59
- connectTimer = setTimeout(() => fail('ASR 连接超时,请检查网络后重试'), connectTimeout);
60
+ connectTimer = setTimeout(() => fail(msg('error.timeout')), connectTimeout);
60
61
  const abort = () => { queue.end(); settleReady(false); socket.terminate(); };
61
62
  signal.addEventListener('abort', abort, { once: true });
62
63
  if (signal.aborted) abort();
63
- socket.on('error', () => fail('ASR 连接失败,请检查服务地址与网络'));
64
+ socket.on('error', () => fail(msg('error.connection')));
64
65
  const transcript = (message, forcedFinal) => {
65
66
  const begin = timestamp(message.Begin), end = timestamp(message.End);
66
67
  if (!ready || complete || typeof message.result !== 'string' || message.result.length > 4096 ||
67
68
  begin === undefined || end === undefined || (end > 0 && end < begin)) {
68
- fail('ASR 返回了无效识别结果'); return false;
69
+ fail(msg('error.connection')); return false;
69
70
  }
70
71
  queue.push({ type: 'transcript', text: message.result, begin, end, final: forcedFinal ?? end > 0 });
71
72
  return true;
@@ -73,20 +74,20 @@ export async function* streamRecognition({ service, token, uplink, signal, onAut
73
74
  socket.on('message', data => {
74
75
  if (queue.ended) return;
75
76
  let message;
76
- try { message = JSON.parse(data.toString()); } catch { fail('ASR 返回了无效数据'); return; }
77
+ try { message = JSON.parse(data.toString()); } catch { fail(msg('error.connection')); return; }
77
78
  const code = String(message?.errCode);
78
79
  if (code === '1000') {
79
80
  if (ready) return;
80
81
  ready = true; clearTimeout(connectTimer);
81
- arm(idleTimeout, '录音数据中断,请重新录音'); queue.push({ type: 'ready' });
82
+ arm(idleTimeout, msg('error.audio')); queue.push({ type: 'ready' });
82
83
  settleReady(true);
83
- } else if (code === '1001') queue.push({ type: 'warning', message: 'ASR 余额较低,请及时充值' });
84
+ } else if (code === '1001') queue.push({ type: 'warning', message: msg('warning.lowBalance') });
84
85
  else if (code === '0') transcript(message);
85
86
  else if (code === '3') {
86
87
  // End can be nonzero on live rolling results; code 3 is never a final sentence.
87
88
  if (Object.hasOwn(message, 'Begin') || Object.hasOwn(message, 'End')) transcript(message, false);
88
89
  } else if (code === '10') {
89
- if (!ended) { fail('ASR 服务提前结束了录音'); return; }
90
+ if (!ended) { fail(msg('error.connection')); return; }
90
91
  // Older responses send the final sentence separately with code 0. Newer ones
91
92
  // include it in code 10. Do not treat an untimed status message as transcript.
92
93
  if ((Object.hasOwn(message, 'Begin') || Object.hasOwn(message, 'End')) && !transcript(message, true)) return;
@@ -96,12 +97,12 @@ export async function* streamRecognition({ service, token, uplink, signal, onAut
96
97
  }
97
98
  else {
98
99
  if (code === '4010') onAuthFailure();
99
- fail(errors[code] ?? (code.startsWith('400') ? 'ASR 连接参数无效,请检查配置' : 'ASR 识别失败,请稍后重试'), code);
100
+ fail(errors[code] ?? msg('error.connection'), code);
100
101
  }
101
102
  });
102
103
  socket.on('close', () => {
103
104
  if (queue.ended) return;
104
- fail('ASR 连接中断,识别结果未完成');
105
+ fail(msg('error.connection'));
105
106
  });
106
107
  const input = uplink[Symbol.asyncIterator]();
107
108
  const upload = async () => {
@@ -114,21 +115,21 @@ export async function* streamRecognition({ service, token, uplink, signal, onAut
114
115
  if (queue.ended || signal.aborted) return;
115
116
  if (done) {
116
117
  ended = true;
117
- arm(finalTimeout, '最终识别结果超时,可复制已有预览后重试');
118
+ arm(finalTimeout, msg('error.timeout'));
118
119
  queue.push({ type: 'finishing' });
119
120
  socket.send('end'); return;
120
121
  }
121
- if (typeof value !== 'string' || value.length > 4400) throw new Error('音频包无效');
122
+ if (typeof value !== 'string' || value.length > 4400) throw new Error(msg('error.audio'));
122
123
  const bytes = Buffer.from(value, 'base64');
123
- if (bytes.toString('base64') !== value || bytes.length <= 80 || bytes.length > 3200 || bytes.length % 2) throw new Error('音频包无效');
124
+ if (bytes.toString('base64') !== value || bytes.length <= 80 || bytes.length > 3200 || bytes.length % 2) throw new Error(msg('error.audio'));
124
125
  totalBytes += bytes.length;
125
- if (totalBytes > 16_000 * 2 * 600) throw new Error('单次录音最长 10 分钟');
126
- if (socket.bufferedAmount > 320_000) throw new Error('网络发送过慢,请重新录音');
127
- socket.send(bytes); arm(idleTimeout, '录音数据中断,请重新录音');
126
+ if (totalBytes > 16_000 * 2 * 600) throw new Error(msg('error.duration'));
127
+ if (socket.bufferedAmount > 320_000) throw new Error(msg('error.generic'));
128
+ socket.send(bytes); arm(idleTimeout, msg('error.audio'));
128
129
  }
129
130
  } catch (error) {
130
- if (!signal.aborted) fail(error.message === '音频包无效' || error.message === '单次录音最长 10 分钟' || error.message === '网络发送过慢,请重新录音'
131
- ? error.message : '音频上传中断,请重新录音');
131
+ if (!signal.aborted) fail(error.message === msg('error.audio') || error.message === msg('error.duration') || error.message === msg('error.generic')
132
+ ? error.message : msg('error.audio'));
132
133
  }
133
134
  };
134
135
  void upload();