@sonicloud/dsh-sonicloud-device 0.1.4 → 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 (46) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/CHANGELOG.zh.md +21 -0
  3. package/README.md +7 -5
  4. package/README.zh.md +7 -5
  5. package/dist/build.json +1 -1
  6. package/dist/client.js +647 -52
  7. package/docs/contributing/development.md +3 -3
  8. package/docs/specs/mouse-settings.md +1 -1
  9. package/docs/specs/multilingual.md +1 -1
  10. package/docs/specs/smart-mouse-plugin.md +6 -3
  11. package/native/screenshot/README.md +9 -4
  12. package/native/screenshot/SOURCE.json +48 -17
  13. package/native/screenshot/darwin-arm64/screentool-macos-1.2.2.zip +0 -0
  14. package/native/screenshot/helper-i18n/de.json +85 -0
  15. package/native/screenshot/helper-i18n/es.json +85 -0
  16. package/native/screenshot/helper-i18n/fr.json +85 -0
  17. package/native/screenshot/patches/{hide-cloud-actions.patch → macos/hide-cloud-actions.patch} +84 -76
  18. package/native/screenshot/patches/macos/mac-clang-compat.patch +14 -0
  19. package/native/screenshot/patches/macos/mac-color-panel.patch +40 -0
  20. package/native/screenshot/patches/macos/mac-permissions.patch +549 -0
  21. package/native/screenshot/patches/macos/mac-ui-focus.patch +658 -0
  22. package/native/screenshot/patches/macos/upstream-files.json +77 -0
  23. package/native/screenshot/patches/upstream-files.json +12 -8
  24. package/native/screenshot/win32-x64/i18n/de.json +85 -0
  25. package/native/screenshot/win32-x64/i18n/es.json +85 -0
  26. package/native/screenshot/win32-x64/i18n/fr.json +85 -0
  27. package/native/screenshot/win32-x64/screenhelper.exe +0 -0
  28. package/package.json +1 -1
  29. package/src/desktop/presentation.mjs +1 -1
  30. package/src/desktop/screenshot-shortcut-worker.mjs +188 -0
  31. package/src/desktop/screenshot-shortcut.mjs +266 -0
  32. package/src/desktop/screenshot-worker.mjs +16 -0
  33. package/src/desktop/screenshot.mjs +21 -2
  34. package/src/devices/manager.mjs +36 -3
  35. package/src/host/index.mjs +7 -2
  36. package/src/host/locale.mjs +5 -3
  37. package/src/shared/locales/de.json +28 -2
  38. package/src/shared/locales/en.json +28 -2
  39. package/src/shared/locales/es.json +28 -2
  40. package/src/shared/locales/fr.json +28 -2
  41. package/src/shared/locales/ja.json +28 -2
  42. package/src/shared/locales/pt.json +28 -2
  43. package/src/shared/locales/ru.json +28 -2
  44. package/src/shared/locales/zh.json +28 -2
  45. package/src/shared/remote.mjs +5 -0
  46. 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.4",
3
+ "version": "0.1.5",
4
4
  "description": "DeepSeek Harness 智能鼠标、多设备设置与共享语音服务",
5
5
  "icon": "./src/client/assets/sonicloud.png",
6
6
  "type": "module",
@@ -82,7 +82,7 @@ export class DesktopPresentation {
82
82
  return value;
83
83
  }
84
84
  event(event) {
85
- if (event.type === 'devices' || event.type === 'request' || event.type === 'result') return;
85
+ if (event.type === 'devices' || event.type === 'screenshotShortcut' || event.type === 'request' || event.type === 'result') return;
86
86
  if (event.sessionId && event.sessionId !== this.sessionId) return;
87
87
  // Do not launch a native window for background device discovery messages.
88
88
  if (!this.child) return;
@@ -0,0 +1,188 @@
1
+ import koffi from 'koffi';
2
+ import { resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { normalizeShortcut } from '../shared/screenshot-shortcut.mjs';
5
+ import { message as msg } from '../shared/i18n.mjs';
6
+
7
+ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
8
+ const WIN_KEYS = { ArrowLeft: 0x25, ArrowUp: 0x26, ArrowRight: 0x27, ArrowDown: 0x28, Home: 0x24, End: 0x23,
9
+ PageUp: 0x21, PageDown: 0x22, Insert: 0x2d, Delete: 0x2e, Backspace: 8, Space: 0x20, Tab: 9, Enter: 13, Escape: 27 };
10
+ const WIN_SCAN_CODES = { KeyA: 0x1e, KeyB: 0x30, KeyC: 0x2e, KeyD: 0x20, KeyE: 0x12, KeyF: 0x21,
11
+ KeyG: 0x22, KeyH: 0x23, KeyI: 0x17, KeyJ: 0x24, KeyK: 0x25, KeyL: 0x26, KeyM: 0x32,
12
+ KeyN: 0x31, KeyO: 0x18, KeyP: 0x19, KeyQ: 0x10, KeyR: 0x13, KeyS: 0x1f, KeyT: 0x14,
13
+ KeyU: 0x16, KeyV: 0x2f, KeyW: 0x11, KeyX: 0x2d, KeyY: 0x15, KeyZ: 0x2c,
14
+ Digit1: 0x02, Digit2: 0x03, Digit3: 0x04, Digit4: 0x05, Digit5: 0x06, Digit6: 0x07,
15
+ Digit7: 0x08, Digit8: 0x09, Digit9: 0x0a, Digit0: 0x0b };
16
+ const MAC_KEYS = { KeyA: 0, KeyS: 1, KeyD: 2, KeyF: 3, KeyH: 4, KeyG: 5, KeyZ: 6, KeyX: 7, KeyC: 8,
17
+ KeyV: 9, KeyB: 11, KeyQ: 12, KeyW: 13, KeyE: 14, KeyR: 15, KeyY: 16, KeyT: 17, Digit1: 18, Digit2: 19,
18
+ Digit3: 20, Digit4: 21, Digit6: 22, Digit5: 23, Digit9: 25, Digit7: 26, Digit8: 28, Digit0: 29,
19
+ KeyO: 31, KeyU: 32, KeyI: 34, KeyP: 35, Enter: 36, KeyL: 37, KeyJ: 38, KeyK: 40, KeyN: 45,
20
+ KeyM: 46, Tab: 48, Space: 49, Backspace: 51, Escape: 53, F5: 96, F6: 97, F7: 98, F3: 99, F8: 100,
21
+ F9: 101, F11: 103, F10: 109, Insert: 114, Home: 115, PageUp: 116, Delete: 117, F4: 118, End: 119,
22
+ F2: 120, PageDown: 121, F1: 122, ArrowLeft: 123, ArrowRight: 124, ArrowDown: 125, ArrowUp: 126 };
23
+
24
+ function windowsApi() {
25
+ const user = koffi.load('user32.dll'), kernel = koffi.load('kernel32.dll');
26
+ const point = koffi.struct({ x: 'int32', y: 'int32' });
27
+ const message = koffi.struct({ hwnd: 'void *', message: 'uint32', wParam: 'uintptr_t', lParam: 'intptr_t',
28
+ time: 'uint32', pt: point, lPrivate: 'uint32' });
29
+ const foreground = user.func('void *__stdcall GetForegroundWindow()');
30
+ const thread = user.func('uint32 __stdcall GetWindowThreadProcessId(void *window, void *processId)');
31
+ const layout = user.func('void *__stdcall GetKeyboardLayout(uint32 threadId)');
32
+ const map = user.func('uint32 __stdcall MapVirtualKeyExW(uint32 code, uint32 mapType, void *layout)');
33
+ return {
34
+ register: user.func('int __stdcall RegisterHotKey(void *window, int id, uint32 modifiers, uint32 key)'),
35
+ unregister: user.func('int __stdcall UnregisterHotKey(void *window, int id)'),
36
+ peek: user.func('PeekMessageW', 'int', [koffi.out(koffi.pointer(message)), 'void *', 'uint32', 'uint32', 'uint32']),
37
+ lastError: kernel.func('uint32 __stdcall GetLastError()'),
38
+ physicalKey: scanCode => { const window = foreground(); return map(scanCode, 3, layout(window ? thread(window, null) : 0)); },
39
+ };
40
+ }
41
+
42
+ export function createWindowsHotkeyAdapter({ onTrigger = () => {}, api = windowsApi() } = {}) {
43
+ let current, nextId = 0x5300, closed = false;
44
+ const drain = deliver => {
45
+ for (let i = 0; i < 64; i++) {
46
+ const event = {};
47
+ if (!api.peek(event, null, 0x0312, 0x0312, 1)) break;
48
+ if (deliver && current && Number(event.wParam) === current.id) onTrigger(current.generation);
49
+ }
50
+ };
51
+ return {
52
+ set(input, generation) {
53
+ if (closed) throw new Error(msg('shortcut.unavailable'));
54
+ const binding = normalizeShortcut(input, 'win32');
55
+ if (current && same(current.binding, binding)) { current.generation = generation; drain(false); return; }
56
+ let candidate;
57
+ if (binding) {
58
+ if (++nextId > 0xbfff) throw new Error(msg('shortcut.unavailable'));
59
+ const flags = binding.modifiers.reduce((value, key) => value | { Alt: 1, Control: 2, Shift: 4 }[key], 0) | 0x4000;
60
+ const key = WIN_SCAN_CODES[binding.code] && api.physicalKey ? api.physicalKey(WIN_SCAN_CODES[binding.code])
61
+ : binding.code.startsWith('Key') ? binding.code.charCodeAt(3)
62
+ : binding.code.startsWith('Digit') ? binding.code.charCodeAt(5)
63
+ : /^F\d+$/.test(binding.code) ? 0x6f + Number(binding.code.slice(1)) : WIN_KEYS[binding.code];
64
+ if (!key) throw new Error(msg('shortcut.invalid'));
65
+ if (!api.register(null, nextId, flags, key))
66
+ throw new Error(msg(api.lastError() === 1409 ? 'shortcut.conflict' : 'shortcut.unavailable'));
67
+ candidate = { binding, generation, id: nextId };
68
+ }
69
+ if (current && !api.unregister(null, current.id)) {
70
+ if (candidate) api.unregister(null, candidate.id);
71
+ throw new Error(msg('shortcut.unavailable'));
72
+ }
73
+ current = candidate; drain(false);
74
+ },
75
+ poll() { if (!closed) drain(true); },
76
+ close() { if (closed) return; closed = true; if (current) api.unregister(null, current.id); current = undefined; drain(false); },
77
+ };
78
+ }
79
+
80
+ function suppressDockActivation() {
81
+ // [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited](=2)。
82
+ // worker 与宿主是同一个 app bundle 二进制:Carbon 热键注册会让 LaunchServices
83
+ // 把本进程登记为第二个可激活应用(Dock 出现双图标,并干扰宿主的激活状态,
84
+ // 2026-11-30 实测宿主 renderer 被 kill)。本进程是纯后台热键监听者,注册前
85
+ // 显式禁止激活。仅真 macApi 路径调用(测试注入 mock,不加载 dylib)。
86
+ const objc = koffi.load('/usr/lib/libobjc.dylib');
87
+ const getClass = objc.func('void *objc_getClass(const char *name)');
88
+ const registerSel = objc.func('void *sel_registerName(const char *name)');
89
+ const send0 = objc.func('void *objc_msgSend(void *self, void *sel)');
90
+ const sendLong = objc.func('void *objc_msgSend(void *self, void *sel, long policy)');
91
+ const app = send0(getClass('NSApplication'), registerSel('sharedApplication'));
92
+ if (app) sendLong(app, registerSel('setActivationPolicy:'), 2);
93
+ }
94
+
95
+ function macApi() {
96
+ suppressDockActivation();
97
+ const carbon = koffi.load('/System/Library/Frameworks/Carbon.framework/Carbon');
98
+ const hotkeyId = koffi.struct({ signature: 'uint32', id: 'uint32' });
99
+ const eventType = koffi.struct({ eventClass: 'uint32', eventKind: 'uint32' });
100
+ return {
101
+ target: carbon.func('void *GetApplicationEventTarget()'),
102
+ register: carbon.func('RegisterEventHotKey', 'int32', ['uint32', 'uint32', hotkeyId, 'void *', 'uint32', koffi.out(koffi.pointer('void *'))]),
103
+ unregister: carbon.func('int32 UnregisterEventHotKey(void *hotkey)'),
104
+ receive: carbon.func('ReceiveNextEvent', 'int32', ['uint32', koffi.pointer(eventType), 'double', 'uint8', koffi.out(koffi.pointer('void *'))]),
105
+ kind: carbon.func('uint32 GetEventKind(void *event)'),
106
+ parameter: carbon.func('GetEventParameter', 'int32', ['void *', 'uint32', 'uint32', 'void *', 'uintptr_t', 'void *', koffi.out(koffi.pointer(hotkeyId))]),
107
+ release: carbon.func('void ReleaseEvent(void *event)'),
108
+ };
109
+ }
110
+
111
+ export function createMacHotkeyAdapter({ onTrigger = () => {}, api = macApi() } = {}) {
112
+ const signature = 0x53434c44, target = api.target();
113
+ const types = [{ eventClass: 0x6b657962, eventKind: 5 }, { eventClass: 0x6b657962, eventKind: 6 }];
114
+ let current, nextId = 0, held = false, closed = false;
115
+ const drain = deliver => {
116
+ for (let i = 0; i < 64; i++) {
117
+ const output = [null];
118
+ const rc = api.receive(types.length, types, 0, 1, output);
119
+ if (rc === -9875) break;
120
+ if (rc !== 0 || !output[0]) throw new Error(msg('shortcut.unavailable'));
121
+ const event = output[0];
122
+ try {
123
+ const id = {}, kind = api.kind(event);
124
+ if (!deliver || !current || api.parameter(event, 0x2d2d2d2d, 0x686b6964, null, 8, null, id) !== 0
125
+ || id.signature !== signature || id.id !== current.id) continue;
126
+ if (kind === 6) held = false;
127
+ else if (kind === 5 && !held) { held = true; onTrigger(current.generation); }
128
+ } finally { api.release(event); }
129
+ }
130
+ };
131
+ return {
132
+ set(input, generation) {
133
+ if (closed) throw new Error(msg('shortcut.unavailable'));
134
+ const binding = normalizeShortcut(input, 'darwin');
135
+ if (current && same(current.binding, binding)) { current.generation = generation; held = false; drain(false); return; }
136
+ let candidate;
137
+ if (binding) {
138
+ const id = ++nextId, ref = [null];
139
+ const modifiers = binding.modifiers.reduce((value, key) => value | { Meta: 256, Shift: 512, Alt: 2048, Control: 4096 }[key], 0);
140
+ // Carbon 默认允许共享热键;exclusive 才能在保存时发现其他进程占用。
141
+ const rc = api.register(MAC_KEYS[binding.code], modifiers, { signature, id }, target, 1, ref);
142
+ if (rc !== 0 || !ref[0]) throw new Error(msg(rc === -9878 ? 'shortcut.conflict' : 'shortcut.unavailable'));
143
+ candidate = { binding, generation, id, ref: ref[0] };
144
+ }
145
+ if (current && api.unregister(current.ref) !== 0) {
146
+ if (candidate) api.unregister(candidate.ref);
147
+ throw new Error(msg('shortcut.unavailable'));
148
+ }
149
+ current = candidate; held = false; drain(false);
150
+ },
151
+ poll() { if (!closed) drain(true); },
152
+ close() { if (closed) return; closed = true; if (current) api.unregister(current.ref); current = undefined; held = false; drain(false); },
153
+ };
154
+ }
155
+
156
+ export function createNativeShortcutAdapter({ platform = process.platform, ...options } = {}) {
157
+ if (platform === 'win32') return createWindowsHotkeyAdapter(options);
158
+ if (platform === 'darwin') return createMacHotkeyAdapter(options);
159
+ throw new Error(msg('shortcut.unavailable'));
160
+ }
161
+
162
+ function runWorker() {
163
+ let adapter, timer, closed = false;
164
+ const send = value => { if (process.connected) { try { process.send(value, () => {}); } catch {} } };
165
+ const close = (code = 0) => {
166
+ if (closed) return;
167
+ closed = true; clearInterval(timer);
168
+ try { adapter?.close(); } catch {}
169
+ if (process.connected) process.disconnect();
170
+ process.exitCode = code;
171
+ };
172
+ try {
173
+ adapter = createNativeShortcutAdapter({ onTrigger: generation => send({ type: 'trigger', generation }) });
174
+ timer = setInterval(() => { try { adapter.poll(); } catch { send({ type: 'fatal', message: msg('shortcut.unavailable') }); close(1); } }, 20);
175
+ process.on('message', message => {
176
+ if (closed || !message || typeof message !== 'object') return;
177
+ if (message.command === 'close') { close(); return; }
178
+ if (message.command !== 'set' || !Number.isSafeInteger(message.requestId) || !Number.isSafeInteger(message.generation)) return;
179
+ try {
180
+ adapter.set(message.binding, message.generation);
181
+ send({ type: 'reply', requestId: message.requestId, ok: true });
182
+ } catch (error) { send({ type: 'reply', requestId: message.requestId, ok: false, message: error.message }); }
183
+ });
184
+ process.once('disconnect', () => close());
185
+ send({ type: 'ready' });
186
+ } catch { send({ type: 'fatal', message: msg('shortcut.unavailable') }); close(1); }
187
+ }
188
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url) && process.send) runWorker();