@alwith/module-device 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +5 -2
- package/dist/chunk-48n5t82k.js +2 -0
- package/dist/chunk-arw91r4t.js +2 -0
- package/dist/chunk-ctffar6x.js +2 -0
- package/dist/chunk-f0y4sedm.js +2 -0
- package/dist/chunk-mcpaya08.js +2 -0
- package/dist/chunk-rqdjybwe.js +2 -0
- package/dist/chunk-s4svy2y1.js +2 -0
- package/dist/{chunk-rhxr74g1.js → chunk-sbhrg9jp.js} +2 -2
- package/dist/generated/commands.d.ts +274 -0
- package/dist/generated/commands.js +1 -0
- package/dist/index.js +1 -1
- package/dist/preview/bezel.js +1 -1
- package/dist/preview/device-panel.js +1 -1
- package/dist/preview/gestures.js +1 -1
- package/dist/preview/index.js +1 -1
- package/dist/preview/locales.js +1 -1
- package/dist/preview/menu.js +1 -1
- package/dist/preview/screens.js +1 -1
- package/dist/tauri.d.ts +11 -0
- package/dist/tauri.js +1 -0
- package/native/darwin-arm64/THIRD_PARTY_NOTICES.md +80 -0
- package/native/darwin-arm64/alwith-device-helper +0 -0
- package/native/darwin-arm64/artifact.json +13 -0
- package/native/darwin-arm64/libalwith_native_device.dylib +0 -0
- package/native/darwin-arm64/licenses/Inflector-0.11.4/LICENSE.md +22 -0
- package/native/darwin-arm64/licenses/adler2-2.0.1/LICENSE-0BSD +12 -0
- package/native/darwin-arm64/licenses/adler2-2.0.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/adler2-2.0.1/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/anyhow-1.0.104/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/anyhow-1.0.104/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/atomic-waker-1.1.2/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/atomic-waker-1.1.2/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/atomic-waker-1.1.2/LICENSE-THIRD-PARTY +45 -0
- package/native/darwin-arm64/licenses/autocfg-1.5.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/autocfg-1.5.1/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/base64-0.23.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/base64-0.23.1/LICENSE-MIT +21 -0
- package/native/darwin-arm64/licenses/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/bytemuck-1.25.2/LICENSE-APACHE +61 -0
- package/native/darwin-arm64/licenses/bytemuck-1.25.2/LICENSE-MIT +9 -0
- package/native/darwin-arm64/licenses/bytemuck-1.25.2/LICENSE-ZLIB +11 -0
- package/native/darwin-arm64/licenses/byteorder-lite-0.1.0/LICENSE-MIT +21 -0
- package/native/darwin-arm64/licenses/bytes-1.12.1/LICENSE +25 -0
- package/native/darwin-arm64/licenses/cfg-if-1.0.5/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/cfg-if-1.0.5/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/crc32fast-1.5.4/LICENSE-APACHE +202 -0
- package/native/darwin-arm64/licenses/crc32fast-1.5.4/LICENSE-MIT +21 -0
- package/native/darwin-arm64/licenses/dirs-7.0.0/LICENSE-APACHE +174 -0
- package/native/darwin-arm64/licenses/dirs-7.0.0/LICENSE-MIT +19 -0
- package/native/darwin-arm64/licenses/dirs-sys-0.5.0/LICENSE-APACHE +174 -0
- package/native/darwin-arm64/licenses/dirs-sys-0.5.0/LICENSE-MIT +19 -0
- package/native/darwin-arm64/licenses/either-1.19.0/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/either-1.19.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/equivalent-1.0.3/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/equivalent-1.0.3/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/errno-0.3.14/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/errno-0.3.14/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/fastrand-2.5.0/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/fastrand-2.5.0/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/fdeflate-0.3.7/LICENSE-APACHE +177 -0
- package/native/darwin-arm64/licenses/fdeflate-0.3.7/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/flate2-1.1.10/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/flate2-1.1.10/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/fnv-1.0.7/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/fnv-1.0.7/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/foldhash-0.2.0/LICENSE +19 -0
- package/native/darwin-arm64/licenses/futures-core-0.3.34/LICENSE-APACHE +202 -0
- package/native/darwin-arm64/licenses/futures-core-0.3.34/LICENSE-MIT +26 -0
- package/native/darwin-arm64/licenses/futures-sink-0.3.34/LICENSE-APACHE +202 -0
- package/native/darwin-arm64/licenses/futures-sink-0.3.34/LICENSE-MIT +26 -0
- package/native/darwin-arm64/licenses/getrandom-0.4.3/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/getrandom-0.4.3/LICENSE-MIT +26 -0
- package/native/darwin-arm64/licenses/h2-0.4.20/LICENSE +25 -0
- package/native/darwin-arm64/licenses/hashbrown-0.17.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/hashbrown-0.17.1/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/http-1.5.0/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/http-1.5.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/idb/LICENSE +21 -0
- package/native/darwin-arm64/licenses/image-0.25.10/LICENSE-APACHE +177 -0
- package/native/darwin-arm64/licenses/image-0.25.10/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/indexmap-2.14.2/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/indexmap-2.14.2/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/itertools-0.14.0/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/itertools-0.14.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/itoa-1.0.18/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/itoa-1.0.18/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/libc-0.2.191/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/libc-0.2.191/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/memchr-2.8.3/COPYING +3 -0
- package/native/darwin-arm64/licenses/memchr-2.8.3/LICENSE-MIT +21 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.8.9/LICENSE +25 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.8.9/LICENSE-APACHE.md +177 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.8.9/LICENSE-MIT.md +24 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.8.9/LICENSE-ZLIB.md +14 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.9.1/LICENSE +25 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.9.1/LICENSE-APACHE.md +177 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.9.1/LICENSE-MIT.md +24 -0
- package/native/darwin-arm64/licenses/miniz_oxide-0.9.1/LICENSE-ZLIB.md +14 -0
- package/native/darwin-arm64/licenses/mio-1.2.4/LICENSE +19 -0
- package/native/darwin-arm64/licenses/moxcms-0.8.1/LICENSE-APACHE.md +201 -0
- package/native/darwin-arm64/licenses/moxcms-0.8.1/LICENSE.md +26 -0
- package/native/darwin-arm64/licenses/num-traits-0.2.19/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/num-traits-0.2.19/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/once_cell-1.21.4/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/once_cell-1.21.4/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/option-ext-0.2.0/LICENSE.txt +373 -0
- package/native/darwin-arm64/licenses/pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
- package/native/darwin-arm64/licenses/pin-project-lite-0.2.17/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/png-0.18.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/png-0.18.1/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/proc-macro2-1.0.107/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/prost-0.14.4/LICENSE +201 -0
- package/native/darwin-arm64/licenses/prost-derive-0.14.4/LICENSE +201 -0
- package/native/darwin-arm64/licenses/pxfm-0.1.30/LICENSE-APACHE.md +201 -0
- package/native/darwin-arm64/licenses/pxfm-0.1.30/LICENSE.md +26 -0
- package/native/darwin-arm64/licenses/quote-1.0.47/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/quote-1.0.47/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/rustc_version-0.4.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/rustc_version-0.4.1/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/rustix-1.1.6/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/rustix-1.1.6/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/native/darwin-arm64/licenses/rustix-1.1.6/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/semver-1.0.28/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/semver-1.0.28/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/serde-1.0.229/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/serde-1.0.229/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/serde_core-1.0.229/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/serde_core-1.0.229/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/serde_derive-1.0.229/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/serde_derive-1.0.229/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/serde_json-1.0.154/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/serde_json-1.0.154/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/signal-hook-registry-1.4.8/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/signal-hook-registry-1.4.8/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/simd-adler32-0.3.10/LICENSE.md +21 -0
- package/native/darwin-arm64/licenses/slab-0.4.12/LICENSE +25 -0
- package/native/darwin-arm64/licenses/socket2-0.6.5/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/socket2-0.6.5/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/specta-2.0.0-rc.27/LICENSE +21 -0
- package/native/darwin-arm64/licenses/specta-macros-2.0.0-rc.27/LICENSE +21 -0
- package/native/darwin-arm64/licenses/syn-2.0.119/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/syn-2.0.119/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/syn-3.0.9/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/syn-3.0.9/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/tempfile-3.27.0/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/tempfile-3.27.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/tokio-1.54.1/LICENSE +21 -0
- package/native/darwin-arm64/licenses/tokio-macros-2.7.2/LICENSE +22 -0
- package/native/darwin-arm64/licenses/tokio-util-0.7.20/LICENSE +21 -0
- package/native/darwin-arm64/licenses/tracing-0.1.44/LICENSE +25 -0
- package/native/darwin-arm64/licenses/tracing-core-0.1.36/LICENSE +25 -0
- package/native/darwin-arm64/licenses/unicode-ident-1.0.27/LICENSE-APACHE +176 -0
- package/native/darwin-arm64/licenses/unicode-ident-1.0.27/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/unicode-ident-1.0.27/LICENSE-UNICODE +39 -0
- package/native/darwin-arm64/licenses/uuid-1.29.0/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/uuid-1.29.0/LICENSE-MIT +26 -0
- package/native/darwin-arm64/licenses/zlib-rs-0.6.8/LICENSE +19 -0
- package/native/darwin-arm64/licenses/zmij-1.0.23/LICENSE-MIT +23 -0
- package/native/darwin-arm64/licenses/zune-core-0.5.3/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/zune-core-0.5.3/LICENSE-MIT +21 -0
- package/native/darwin-arm64/licenses/zune-core-0.5.3/LICENSE-ZLIB +19 -0
- package/native/darwin-arm64/licenses/zune-jpeg-0.5.15/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/zune-jpeg-0.5.15/LICENSE-MIT +21 -0
- package/native/darwin-arm64/licenses/zune-jpeg-0.5.15/LICENSE-ZLIB +19 -0
- package/native/win32-x64/THIRD_PARTY_NOTICES.md +77 -0
- package/native/win32-x64/alwith_native_device.dll +0 -0
- package/native/win32-x64/artifact.json +8 -0
- package/native/win32-x64/licenses/Inflector-0.11.4/LICENSE.md +22 -0
- package/native/win32-x64/licenses/adler2-2.0.1/LICENSE-0BSD +12 -0
- package/native/win32-x64/licenses/adler2-2.0.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/adler2-2.0.1/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/anyhow-1.0.104/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/anyhow-1.0.104/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/atomic-waker-1.1.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/atomic-waker-1.1.2/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/atomic-waker-1.1.2/LICENSE-THIRD-PARTY +45 -0
- package/native/win32-x64/licenses/autocfg-1.5.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/autocfg-1.5.1/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/base64-0.23.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/base64-0.23.1/LICENSE-MIT +21 -0
- package/native/win32-x64/licenses/bitflags-2.13.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/bitflags-2.13.2/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/bytemuck-1.25.2/LICENSE-APACHE +61 -0
- package/native/win32-x64/licenses/bytemuck-1.25.2/LICENSE-MIT +9 -0
- package/native/win32-x64/licenses/bytemuck-1.25.2/LICENSE-ZLIB +11 -0
- package/native/win32-x64/licenses/byteorder-lite-0.1.0/LICENSE-MIT +21 -0
- package/native/win32-x64/licenses/bytes-1.12.1/LICENSE +25 -0
- package/native/win32-x64/licenses/cfg-if-1.0.5/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/cfg-if-1.0.5/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/crc32fast-1.5.4/LICENSE-APACHE +202 -0
- package/native/win32-x64/licenses/crc32fast-1.5.4/LICENSE-MIT +21 -0
- package/native/win32-x64/licenses/dirs-7.0.0/LICENSE-APACHE +174 -0
- package/native/win32-x64/licenses/dirs-7.0.0/LICENSE-MIT +19 -0
- package/native/win32-x64/licenses/dirs-sys-0.5.0/LICENSE-APACHE +174 -0
- package/native/win32-x64/licenses/dirs-sys-0.5.0/LICENSE-MIT +19 -0
- package/native/win32-x64/licenses/either-1.19.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/either-1.19.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/equivalent-1.0.3/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/equivalent-1.0.3/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/fastrand-2.5.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/fastrand-2.5.0/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/fdeflate-0.3.7/LICENSE-APACHE +177 -0
- package/native/win32-x64/licenses/fdeflate-0.3.7/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/flate2-1.1.10/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/flate2-1.1.10/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/fnv-1.0.7/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/fnv-1.0.7/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/foldhash-0.2.0/LICENSE +19 -0
- package/native/win32-x64/licenses/futures-core-0.3.34/LICENSE-APACHE +202 -0
- package/native/win32-x64/licenses/futures-core-0.3.34/LICENSE-MIT +26 -0
- package/native/win32-x64/licenses/futures-sink-0.3.34/LICENSE-APACHE +202 -0
- package/native/win32-x64/licenses/futures-sink-0.3.34/LICENSE-MIT +26 -0
- package/native/win32-x64/licenses/getrandom-0.4.3/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/getrandom-0.4.3/LICENSE-MIT +26 -0
- package/native/win32-x64/licenses/h2-0.4.20/LICENSE +25 -0
- package/native/win32-x64/licenses/hashbrown-0.17.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/hashbrown-0.17.1/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/http-1.5.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/http-1.5.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/image-0.25.10/LICENSE-APACHE +177 -0
- package/native/win32-x64/licenses/image-0.25.10/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/indexmap-2.14.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/indexmap-2.14.2/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/itertools-0.14.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/itertools-0.14.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/itoa-1.0.18/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/itoa-1.0.18/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/memchr-2.8.3/COPYING +3 -0
- package/native/win32-x64/licenses/memchr-2.8.3/LICENSE-MIT +21 -0
- package/native/win32-x64/licenses/miniz_oxide-0.8.9/LICENSE +25 -0
- package/native/win32-x64/licenses/miniz_oxide-0.8.9/LICENSE-APACHE.md +177 -0
- package/native/win32-x64/licenses/miniz_oxide-0.8.9/LICENSE-MIT.md +24 -0
- package/native/win32-x64/licenses/miniz_oxide-0.8.9/LICENSE-ZLIB.md +14 -0
- package/native/win32-x64/licenses/miniz_oxide-0.9.1/LICENSE +25 -0
- package/native/win32-x64/licenses/miniz_oxide-0.9.1/LICENSE-APACHE.md +177 -0
- package/native/win32-x64/licenses/miniz_oxide-0.9.1/LICENSE-MIT.md +24 -0
- package/native/win32-x64/licenses/miniz_oxide-0.9.1/LICENSE-ZLIB.md +14 -0
- package/native/win32-x64/licenses/mio-1.2.4/LICENSE +19 -0
- package/native/win32-x64/licenses/moxcms-0.8.1/LICENSE-APACHE.md +201 -0
- package/native/win32-x64/licenses/moxcms-0.8.1/LICENSE.md +26 -0
- package/native/win32-x64/licenses/num-traits-0.2.19/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/num-traits-0.2.19/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/once_cell-1.21.4/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/once_cell-1.21.4/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/option-ext-0.2.0/LICENSE.txt +373 -0
- package/native/win32-x64/licenses/pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
- package/native/win32-x64/licenses/pin-project-lite-0.2.17/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/png-0.18.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/png-0.18.1/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/proc-macro2-1.0.107/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/prost-0.14.4/LICENSE +201 -0
- package/native/win32-x64/licenses/prost-derive-0.14.4/LICENSE +201 -0
- package/native/win32-x64/licenses/pxfm-0.1.30/LICENSE-APACHE.md +201 -0
- package/native/win32-x64/licenses/pxfm-0.1.30/LICENSE.md +26 -0
- package/native/win32-x64/licenses/quote-1.0.47/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/quote-1.0.47/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/rustc_version-0.4.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/rustc_version-0.4.1/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/semver-1.0.28/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/semver-1.0.28/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/serde-1.0.229/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/serde-1.0.229/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/serde_core-1.0.229/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/serde_core-1.0.229/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/serde_derive-1.0.229/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/serde_derive-1.0.229/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/serde_json-1.0.154/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/serde_json-1.0.154/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/simd-adler32-0.3.10/LICENSE.md +21 -0
- package/native/win32-x64/licenses/slab-0.4.12/LICENSE +25 -0
- package/native/win32-x64/licenses/socket2-0.6.5/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/socket2-0.6.5/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/specta-2.0.0-rc.27/LICENSE +21 -0
- package/native/win32-x64/licenses/specta-macros-2.0.0-rc.27/LICENSE +21 -0
- package/native/win32-x64/licenses/syn-2.0.119/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/syn-2.0.119/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/syn-3.0.9/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/syn-3.0.9/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/tempfile-3.27.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/tempfile-3.27.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/tokio-1.54.1/LICENSE +21 -0
- package/native/win32-x64/licenses/tokio-macros-2.7.2/LICENSE +22 -0
- package/native/win32-x64/licenses/tokio-util-0.7.20/LICENSE +21 -0
- package/native/win32-x64/licenses/tracing-0.1.44/LICENSE +25 -0
- package/native/win32-x64/licenses/tracing-core-0.1.36/LICENSE +25 -0
- package/native/win32-x64/licenses/unicode-ident-1.0.27/LICENSE-APACHE +176 -0
- package/native/win32-x64/licenses/unicode-ident-1.0.27/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/unicode-ident-1.0.27/LICENSE-UNICODE +39 -0
- package/native/win32-x64/licenses/uuid-1.29.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/uuid-1.29.0/LICENSE-MIT +26 -0
- package/native/win32-x64/licenses/windows-link-0.2.1/license-apache-2.0 +201 -0
- package/native/win32-x64/licenses/windows-link-0.2.1/license-mit +21 -0
- package/native/win32-x64/licenses/windows-sys-0.61.2/license-apache-2.0 +201 -0
- package/native/win32-x64/licenses/windows-sys-0.61.2/license-mit +21 -0
- package/native/win32-x64/licenses/zlib-rs-0.6.8/LICENSE +19 -0
- package/native/win32-x64/licenses/zmij-1.0.23/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/zune-core-0.5.3/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/zune-core-0.5.3/LICENSE-MIT +21 -0
- package/native/win32-x64/licenses/zune-core-0.5.3/LICENSE-ZLIB +19 -0
- package/native/win32-x64/licenses/zune-jpeg-0.5.15/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/zune-jpeg-0.5.15/LICENSE-MIT +21 -0
- package/native/win32-x64/licenses/zune-jpeg-0.5.15/LICENSE-ZLIB +19 -0
- package/package.json +15 -7
- package/dist/chunk-8k3bfx79.js +0 -2
- package/dist/chunk-b2q98506.js +0 -2
- package/dist/chunk-mjnnssp9.js +0 -2
- package/dist/chunk-r3k3511t.js +0 -2
- package/dist/chunk-s105r96w.js +0 -2
- package/rust/Cargo.toml +0 -15
- package/rust/src/lib.rs +0 -222
package/dist/chunk-mjnnssp9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i,r,s}from"./chunk-s105r96w.js";import{l,c,d,o,f}from"./chunk-b2q98506.js";import{a,e}from"./chunk-rhxr74g1.js";import{t}from"./chunk-8k3bfx79.js";import{p,m}from"./chunk-r3k3511t.js";import{Camera as ze,ChevronDown as we,Home as Le,Maximize2 as Fe,Minimize2 as Ie,RotateCw as Oe,Square as Ae,SquareTerminal as He,Video as Xe,X as Ne}from"lucide-react";import{useCallback as K,useEffect as G,useMemo as he,useRef as ae,useState as E}from"react";import{toast as fe}from"sonner";import{Button as Pe}from"@nyssance/shadcn/vega/components/ui/button";import{Tooltip as $e,TooltipContent as qe,TooltipProvider as We,TooltipTrigger as Ye}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as k,jsxs as Z}from"react/jsx-runtime";var te=[25,33,50,66,75,100,125,150,200],xe=(n)=>`alwith-device:consent:${n}`,Ke={read:(n)=>Promise.resolve(Se(()=>localStorage.getItem(xe(n))==="granted")??!1),write:(n,S)=>Promise.resolve(Se(()=>localStorage.setItem(xe(n),S?"granted":"denied"))??void 0)};function Se(n){try{return n()}catch{return null}}function se(n){let S=n instanceof Error?n.message:String(n);try{let w=JSON.parse(S);if(typeof w==="object"&&w!==null&&"message"in w&&typeof w.message==="string")return w.message}catch{}return S}function b({bridge:n,platform:S="ios",udid:w,language:B,agentName:A="AI",pollFps:R=30,maximized:z=!1,onMaximize:T,onClose:N,className:L}){let u=he(()=>a(B),[B]),[M,X]=E(S),[H,ne]=E([]);G(()=>n.subscribe(ne),[n]);let g=he(()=>w?H.find((h)=>h.udid===w):H[0],[H,w]);G(()=>{if(g?.platform==="ios"||g?.platform==="android")X(g.platform)},[g?.platform]);let[I,F]=E("fit"),[_,O]=E(R),[C,le]=E(0),[j,W]=E(!1),[ce,ie]=E(!1),[oe,v]=E(!1),[D,P]=E(null);G(()=>P(null),[g?.udid]);let[J,U]=E(null),[q,ee]=E(null),[de,ge]=E(null),[ve,ue]=E(null),[be,ke]=E("live"),pe=n.consent??Ke,V=K((h)=>{P(null),h().catch((x)=>P(se(x)))},[]),re=K(async(h)=>{U(h&&!h.running?"booting":"attaching"),P(null);try{await n.attach(h?.id,h?.platform??M),ge(null)}catch(x){let y=se(x);if(h&&/no simulator|not available|不可用|No device/i.test(y))ge(h.name);P(y)}finally{U(null)}},[n,M]),me=K(async(h)=>{let x=h;if(!x){let y=await n.listDevices(M);if(x=y.find((Y)=>Y.running)??y[0],!x){P(u.noSimulators);return}}if(await pe.read(x.id))await re(x);else ee(x)},[n,M,pe,re,u.noSimulators]);G(()=>{if(!g||!n.appearance)return;let h=!1;return n.appearance(g.udid).then((x)=>{if(!h)ue(x)}).catch(()=>{return}),()=>{h=!0}},[n,g]);let Te=k(De,{bridge:n,platform:M,labels:u,current:g?.udid,currentName:g?.deviceName,onPlatformChange:X,disabled:J!==null,onPick:(h)=>{if(g&&h.id!==g.udid)V(async()=>{await re(h),await n.detach(g.udid)});else if(!g)V(()=>me(h))}}),Me=[{kind:"item",label:u.undo,disabled:!0,hint:u.inputUnavailable},{kind:"item",label:u.redo,disabled:!0},{kind:"separator"},{kind:"item",label:u.cut,disabled:!0},{kind:"item",label:u.copy,disabled:!0},{kind:"item",label:u.paste,disabled:!0},{kind:"item",label:u.selectAll,disabled:!0},{kind:"item",label:u.delete,disabled:!0}],Ce=()=>{let h=g,x=(y)=>()=>{if(h)V(()=>y(h))};return[{kind:"section",label:u.appearance},{kind:"item",label:u.light,checked:ve==="light",disabled:!h||!n.setAppearance,onSelect:x(async(y)=>{await n.setAppearance?.(y.udid,"light"),ue("light")})},{kind:"item",label:u.dark,checked:ve==="dark",disabled:!h||!n.setAppearance,onSelect:x(async(y)=>{await n.setAppearance?.(y.udid,"dark"),ue("dark")})},{kind:"section",label:u.statusBar},{kind:"item",label:u.statusLive,checked:be==="live",disabled:!h||!n.setStatusBar,onSelect:x(async(y)=>{await n.setStatusBar?.(y.udid,"live"),ke("live")})},{kind:"item",label:u.statusShowcase,checked:be==="showcase",disabled:!h||!n.setStatusBar,onSelect:x(async(y)=>{await n.setStatusBar?.(y.udid,"showcase"),ke("showcase")})},{kind:"separator"},{kind:"item",label:u.restart,disabled:!h||!n.restart,onSelect:x(async(y)=>{U("booting");try{await n.restart?.(y.udid),await n.attach(y.udid,y.platform)}finally{U(null)}})},{kind:"item",label:u.shutdown,disabled:!h||!n.shutdown,onSelect:x((y)=>n.shutdown(y.udid))},{kind:"separator"},{kind:"item",label:u.detach,disabled:!h,onSelect:x((y)=>n.detach(y.udid))}]},ye=(h)=>F((x)=>{let y=x==="fit"?100:x,Y=te.findIndex((Re)=>Re>=y);return(h>0?te[Math.min(te.length-1,(Y===-1?te.length-1:Y)+1)]:te[Math.max(0,(Y===-1?te.length:Y)-1)])??x}),Be=()=>[{kind:"item",label:u.zoomIn,onSelect:()=>ye(1),hint:"⌘+"},{kind:"item",label:u.zoomOut,onSelect:()=>ye(-1),hint:"⌘−"},{kind:"item",label:u.zoomFit,checked:I==="fit",onSelect:()=>F("fit")},{kind:"item",label:u.actualSize,checked:I===100,onSelect:()=>F(100),hint:"⌘0"},{kind:"section",label:u.frameRate},...[15,30,60].map((h)=>({kind:"item",label:`${h} FPS`,checked:_===h,onSelect:()=>O(h)}))],Q=(h,x,y,Y)=>Z($e,{children:[k(Ye,{render:k(Pe,{variant:"ghost",size:"icon-sm","aria-label":h,"aria-pressed":Y?.pressed,disabled:Y?.disabled,onClick:y,className:"aria-pressed:bg-muted"}),children:x}),k(qe,{children:h})]});return k(We,{children:Z("div",{"data-device-panel":!0,className:`bg-background text-foreground flex h-full min-h-0 flex-col ${L??""}`,children:[Z("div",{"data-device-menubar":!0,className:"border-border flex h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b px-2 whitespace-nowrap",children:[Te,k(t,{label:u.menuEdit,entries:Me}),k(t,{label:u.menuDevice,entries:Ce}),k(t,{label:u.menuView,entries:Be}),k("span",{className:"flex-1"}),g&&k("span",{className:"text-muted-foreground mx-1 text-xs tabular-nums",children:C>0?e(u.fpsValue,{fps:C}):u.fpsIdle}),T&&Q(z?u.collapse:u.expand,z?k(Ie,{}):k(Fe,{}),T,{pressed:z}),N&&Q(u.close,k(Ne,{}),N)]}),D&&k("p",{role:"alert",className:"border-border text-destructive shrink-0 border-b px-3 py-1.5 text-xs",children:D}),k("div",{"data-device-stage":!0,className:`[container-type:size] flex min-h-0 flex-1 items-center justify-center p-4 ${I==="fit"?"overflow-hidden":"overflow-auto"}`,children:g?k(Ze,{bridge:n,attachment:g,labels:u,fps:_,zoom:I,onError:P,onFps:le},g.udid):k(Ee,{kind:i(M,q?.name??"iPhone"),zoom:I,children:q?k(m,{labels:u,agent:A,deviceName:q.name,systemVersion:q.systemVersion,onCancel:()=>ee(null),onContinue:()=>{let h=q;ee(null),V(async()=>{await pe.write(h.id,!0),await re(h)})}}):k(p,{labels:u,agent:A,unavailableDevice:de,busy:J,error:null,onAttach:()=>void me(void 0),picker:k(De,{bridge:n,platform:M,labels:u,disabled:J!==null,compact:!0,onPick:(h)=>void me(h)})})})}),k("div",{"data-device-toolbar":!0,className:"flex shrink-0 justify-center py-3",children:Z("div",{className:"inline-flex items-center gap-0.5",children:[Q(u.home,k(Le,{className:"size-4"}),()=>g&&V(()=>n.gesture(g.udid,{type:"button",name:"HOME"})),{disabled:!g}),Q(u.rotate,k(Oe,{className:"size-4"}),()=>g&&V(()=>n.gesture(g.udid,{type:"rotate",direction:"right"})),{disabled:!g}),Q(u.screenshot,k(ze,{className:"size-4"}),()=>g&&V(async()=>{ie(!0);try{let h;if(n.saveScreenshot)h=await n.saveScreenshot(g.udid,"");else{let x=await n.captureFrame(g.udid);if(!x)throw Error("Device did not produce a frame");let y=document.createElement("a");y.href=x,y.download=`${g.deviceName}-${Date.now()}.${x.startsWith("data:image/jpeg")?"jpg":"png"}`,y.click(),h=y.download}if(h)fe.success(e(u.screenshotSaved,{path:h}))}finally{ie(!1)}}),{disabled:!g||ce}),Q(g?.recordingPath?u.stopRecording:u.record,g?.recordingPath?k(Ae,{className:"size-4"}):k(Xe,{className:"size-4"}),()=>g&&V(async()=>{W(!0);try{if(g.recordingPath){let h=await n.stopRecording(g.udid);fe.success(e(u.recordingSaved,{path:h}))}else await n.startRecording(g.udid),fe.success(u.recordingStarted)}finally{W(!1)}}),{disabled:!g||j||!n.startRecording||!n.stopRecording,pressed:!!g?.recordingPath}),Q(u.logs,k(He,{className:"size-4"}),()=>v((h)=>!h),{disabled:!g||!n.readLogs,pressed:oe})]})}),oe&&g&&n.readLogs&&k(je,{bridge:n,udid:g.udid,labels:u,onClose:()=>v(!1)})]})})}function De({bridge:n,platform:S,labels:w,current:B,currentName:A,onPlatformChange:R,disabled:z,compact:T,onPick:N}){let[L,u]=E(null),[M,X]=E(null),H=K(()=>{u(null),X(null),n.listDevices(S).then(u).catch((F)=>X(se(F)))},[n,S]);G(()=>{H()},[H]);let ne=()=>{if(M)return[{kind:"item",label:M,disabled:!0}];if(L===null)return[{kind:"item",label:w.loadingDevices,disabled:!0}];if(L.length===0)return[{kind:"item",label:w.noSimulators,disabled:!0}];let F=L.filter((C)=>C.running),_=L.filter((C)=>!C.running),O=(C)=>({kind:"item",label:C.name,hint:C.systemVersion,checked:B===void 0?void 0:C.id===B,onSelect:()=>N(C)});return[...F.length>0?[{kind:"section",label:w.booted},...F.map(O)]:[],..._.length>0?[{kind:"section",label:w.willBoot},..._.map(O)]:[]]},g=()=>[...R?[{kind:"item",label:"iOS",checked:S==="ios",onSelect:()=>R("ios")},{kind:"item",label:"Android",checked:S==="android",onSelect:()=>R("android")},{kind:"separator"}]:[],...ne()],I=(F)=>{if(F)H()};if(T)return k(t,{ariaLabel:w.chooseDevice,entries:g,disabled:z,caret:!1,align:"end",variant:"default",size:"lg",className:"border-s-primary-foreground/20 rounded-s-none border-s px-3",onOpenChange:I,children:k(we,{className:"size-4","aria-hidden":!0})});return Z(t,{ariaLabel:w.chooseDevice,entries:g,disabled:z,caret:!1,size:"default",className:"h-8 max-w-48 justify-start px-2 text-left",onOpenChange:I,children:[k("span",{className:"flex min-w-0 items-center gap-2",children:k("span",{className:"truncate text-[15px] font-medium",children:A??w.chooseDevice})}),k(we,{className:"size-4 shrink-0 opacity-60","aria-hidden":!0})]})}function Ee({kind:n,zoom:S,pixelWidth:w,pixelHeight:B,rotation:A,scale:R=3,children:z,overlay:T}){let N=he(()=>r(n,w,B),[n,w,B]),L=S==="fit"?{height:`min(100cqh, calc(100cqw / ${N.aspect}))`,aspectRatio:N.aspect}:(()=>{let u=(100-2*Number.parseFloat(N.style.top))/100;return{height:`${(B??2622)/R*S/100/u}px`,aspectRatio:N.aspect,flexShrink:0}})();return Z("div",{"data-device-screen-stage":!0,className:"relative",style:L,children:[k("div",{className:"bg-background absolute z-0 overflow-hidden",style:N.style,children:z}),k(s,{kind:n,pixelWidth:w,pixelHeight:B,rotation:A,style:{position:"absolute",inset:0,zIndex:10,width:"100%",height:"100%",pointerEvents:"none",userSelect:"none",filter:"drop-shadow(0 2px 6px rgb(0 0 0 / 0.2)) drop-shadow(0 12px 32px rgb(0 0 0 / 0.25))"}}),T&&k("div",{className:"absolute z-20",style:N.style,children:T})]})}function Ze({bridge:n,attachment:S,labels:w,fps:B,zoom:A,onError:R,onFps:z}){let{udid:T,deviceName:N,platform:L}=S,[u,M]=E(null),X=S.pixelWidth&&S.pixelHeight?{width:S.pixelWidth,height:S.pixelHeight}:null,[H,ne]=E(!1),g=ae(null),I=ae(!1),F=ae([]);G(()=>{if(B<=0)return;let v=!1,D,P=0,J=async()=>{if(v)return;let U=performance.now();try{let q=await n.captureFrame(T);if(!v&&q){if(P>0)R(null);P=0,M(q);let ee=performance.now();F.current=[...F.current.filter((de)=>ee-de<2000),ee],z(Math.round(F.current.length/2))}}catch(q){if(!v)P++,F.current=[],M(null),z(0),R(se(q))}if(v)return;D=setTimeout(()=>void J(),P?Math.min(5000,250*2**Math.min(P,5)):Math.max(0,1000/B-(performance.now()-U)))};return J(),()=>{if(v=!0,z(0),D!==void 0)clearTimeout(D)}},[n,T,B,z,R]);let _=i(L,N),O=S.pointWidth??0,C=S.pointHeight??0,le=S.pixelWidth&&O>0?S.pixelWidth/O:void 0,j=K((v)=>{n.gesture(T,v).then(()=>R(null),(D)=>R(se(D)))},[n,T,R]),W=K(()=>{if(H)return;ne(!0),n.takeOver?.(T).catch(()=>{return})},[n,T,H]),ce=K((v)=>{if(v.button!==0)return;W(),v.currentTarget.setPointerCapture(v.pointerId),v.currentTarget.focus({preventScroll:!0});let D=o(v.currentTarget.getBoundingClientRect(),v.clientX,v.clientY,O,C);if(D)g.current={samples:[{...D,clientX:v.clientX,clientY:v.clientY,t:performance.now()}],mirrored:v.altKey}},[W,O,C]),ie=K((v)=>{if(v.button!==0)return;let D=g.current;if(g.current=null,!D)return;let P=o(v.currentTarget.getBoundingClientRect(),v.clientX,v.clientY,O,C);if(!P)return;D.samples.push({...P,clientX:v.clientX,clientY:v.clientY,t:performance.now()}),j(f(D.samples,D.mirrored,O,C))},[j,O,C]),oe=K((v)=>{if(v.nativeEvent.isComposing||I.current)return;let D=d(v,L==="android"?c:l);if(!D)return;v.preventDefault(),v.stopPropagation(),W(),j(D)},[L,j,W]);return k(Ee,{kind:_,zoom:A,pixelWidth:X?.width,pixelHeight:X?.height,scale:le,rotation:S.rotation??void 0,overlay:k("div",{role:"application",tabIndex:0,"aria-label":w.touchSurface,"data-device-touch-surface":!0,"data-controlling":H||void 0,title:H?w.takeOver:void 0,contentEditable:"plaintext-only",suppressContentEditableWarning:!0,spellCheck:!1,className:"h-full w-full cursor-pointer touch-none overflow-hidden text-transparent caret-transparent outline-none",onPointerDown:ce,onPointerMove:(v)=>{let D=g.current;if(!D)return;let P=o(v.currentTarget.getBoundingClientRect(),v.clientX,v.clientY,O,C);if(!P)return;if(D.samples.length>=1200)D.samples=D.samples.filter((J,U)=>U%2===0);D.samples.push({...P,clientX:v.clientX,clientY:v.clientY,t:performance.now()})},onPointerUp:ie,onPointerCancel:()=>g.current=null,onKeyDown:oe,onCompositionStart:()=>{I.current=!0},onCompositionEnd:(v)=>{if(I.current=!1,v.data)W(),j({type:"text",value:v.data});v.currentTarget.textContent=""},onInput:(v)=>{if(!I.current)v.currentTarget.textContent=""},onPaste:(v)=>{v.preventDefault();let D=v.clipboardData.getData("text/plain");if(D)W(),j({type:"text",value:D})}}),children:u?k("img",{src:u,alt:e(w.liveStream,{device:N}),draggable:!1,className:"block h-full w-full bg-black object-cover select-none"}):k("div",{className:"h-full w-full bg-black"})})}function je({bridge:n,udid:S,labels:w,onClose:B}){let[A,R]=E([]),z=ae(0),T=ae(null);return G(()=>{let N=!1,L=async()=>{try{let M=await n.readLogs(S,{sinceSeq:z.current||void 0,tail:200});if(N)return;if(M.entries.length>0)z.current=M.lastSeq,R((X)=>[...X,...M.entries].slice(-500))}catch{}};L();let u=setInterval(()=>void L(),2000);return()=>{N=!0,clearInterval(u)}},[n,S]),G(()=>{T.current?.scrollTo({top:T.current.scrollHeight})},[A]),Z("div",{"data-device-logs":!0,className:"border-border flex h-[40%] shrink-0 flex-col border-t",children:[Z("div",{className:"text-muted-foreground flex h-8 shrink-0 items-center gap-2 px-3 text-xs",children:[k("span",{className:"flex-1",children:w.logsTitle}),k(Pe,{variant:"ghost",size:"icon-xs","aria-label":w.closeLogs,title:w.closeLogs,onClick:B,children:k(Ne,{})})]}),k("div",{ref:T,className:"min-h-0 flex-1 overflow-auto px-3 pb-2 font-mono text-[11px] leading-4",children:A.length===0?k("p",{className:"text-muted-foreground py-4 text-center",children:w.logsEmpty}):A.map((N)=>Z("div",{className:"flex gap-2 break-all whitespace-pre-wrap",children:[k("span",{className:"text-muted-foreground shrink-0",children:N.timestamp.slice(11,23)}),k("span",{className:`shrink-0 ${N.level==="error"||N.level==="fault"?"text-destructive":"text-muted-foreground"}`,children:N.level}),k("span",{children:N.message})]},N.seq))})]})}
|
|
2
|
-
export{b};
|
package/dist/chunk-r3k3511t.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e}from"./chunk-rhxr74g1.js";import{CircleCheck as f,Eye as g,Info as v,Settings2 as h,Smartphone as N,UserRound as b}from"lucide-react";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as a}from"react/jsx-runtime";function p({labels:n,agent:i,unavailableDevice:o,busy:s,error:l,onAttach:c,picker:d}){return a("div",{"data-device-attach-screen":!0,className:"bg-background text-foreground flex h-full min-h-0 flex-col text-center",children:[a("div",{className:"flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-5 pt-[22%]",children:[t("h2",{className:"text-[22px] leading-tight font-semibold text-balance",children:e(n.attachTitle,{agent:i})}),t("p",{className:"text-muted-foreground mt-3 text-sm text-balance",children:e(n.attachBody,{agent:i})}),a("div",{className:"bg-muted mt-6 flex w-full items-center gap-3 rounded-xl px-4 py-3 text-left text-sm",children:[t(f,{className:"size-5 shrink-0 text-emerald-500","aria-hidden":!0}),t("span",{children:n.xcodeInstalled})]}),o&&a("div",{className:"border-border mt-3 flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left text-sm",children:[t(v,{className:"text-muted-foreground mt-0.5 size-5 shrink-0","aria-hidden":!0}),t("span",{children:e(n.unavailable,{device:o})})]}),l&&t("p",{role:"alert",className:"text-destructive mt-3 w-full text-left text-xs",children:l})]}),a("div",{className:"w-full shrink-0 px-5 pb-6",children:[t("p",{className:"text-muted-foreground mb-4 text-[11px]",children:n.trademark}),a("div",{className:"flex w-full","data-slot":"button-group",children:[t(r,{size:"lg",className:"flex-1 rounded-e-none",disabled:s!==null,onClick:c,children:s==="booting"?n.booting:s==="attaching"?n.attaching:n.attach}),d]})]})]})}function m({labels:n,agent:i,deviceName:o,systemVersion:s,onCancel:l,onContinue:c}){let d=[{icon:g,text:n.consentScreen},{icon:b,text:n.consentAccounts},{icon:h,text:n.consentSettings}];return a("div",{"data-device-consent-screen":!0,className:"bg-background text-foreground flex h-full min-h-0 flex-col text-center",children:[a("div",{className:"flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-5 pt-[10%]",children:[t("h2",{className:"text-[22px] leading-tight font-semibold text-balance",children:e(n.consentTitle,{agent:i})}),a("span",{className:"bg-muted mt-4 inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium",children:[t(N,{className:"size-4","aria-hidden":!0}),o," · ",s]}),t("p",{className:"text-muted-foreground mt-5 text-sm text-balance",children:e(n.consentBody,{agent:i})}),t("p",{className:"text-muted-foreground mt-3 text-sm text-balance",children:n.consentRetention}),t("div",{className:"mt-4 flex w-full flex-col gap-2 pb-4",children:d.map(({icon:u,text:x})=>a("div",{className:"bg-muted flex items-start gap-3 rounded-xl px-3 py-3 text-left text-[13px] leading-snug",children:[t(u,{className:"text-muted-foreground mt-0.5 size-4 shrink-0","aria-hidden":!0}),t("span",{children:x})]},x))})]}),a("div",{className:"flex w-full shrink-0 gap-3 px-5 pt-2 pb-6",children:[t(r,{variant:"outline",size:"lg",className:"flex-1",onClick:l,children:n.cancel}),t(r,{size:"lg",className:"flex-1",onClick:c,children:n.continue})]})]})}
|
|
2
|
-
export{p,m};
|
package/dist/chunk-s105r96w.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{memo as L,useId as Q,useMemo as S}from"react";import{jsx as R,jsxs as E}from"react/jsx-runtime";var u={iPhone:{pixelW:1206,pixelH:2622,screenRadius:186,frame:34,silver:8,grey:12,nubProtrude:27,nubs:[["left",507,102],["left",690,192],["left",927,192],["right",813,303]]},androidPhone:{pixelW:1080,pixelH:2400,screenRadius:100,frame:22,silver:6,grey:8,nubProtrude:18,nubs:[["right",480,130],["right",670,240]]},iPad:{pixelW:1668,pixelH:2420,screenRadius:58,frame:64,silver:12,grey:16,nubProtrude:20,nubs:[["right",202,104],["right",328,104],["top",-148,126]]}};function i(o,n){if(o==="android")return"androidPhone";return n.toLowerCase().includes("ipad")?"iPad":"iPhone"}function K(o,n,F){let b=u[o],k=b.frame+b.silver+b.grey,f=k+b.nubProtrude,m=n??b.pixelW,P=F??b.pixelH;return{p:b,edge:k,margin:f,W:m+2*f,H:P+2*f,width:m,height:P}}function r(o,n,F){let{p:b,margin:k,W:f,H:m,width:P,height:h}=K(o,n,F),p=100*k/f,t=100*k/m;return{aspect:f/m,style:{left:`${p}%`,top:`${t}%`,width:`${100-2*p}%`,height:`${100-2*t}%`,borderRadius:`${100*b.screenRadius/P}% / ${100*b.screenRadius/h}%`}}}function B(o,n,F,b,k){let f=Math.min(k,Math.min(F,b)/3.06),m=1.528665*f,P=1.088311*f,h=0.868407*f,p=0.631494*f,t=0.372375*f,l=0.16906*f,W=0.066987*f,e=o+F,a=n+b,d=(z)=>+z.toFixed(3),c=(z,H,g,v,C,w)=>`C${d(z)} ${d(H)} ${d(g)} ${d(v)} ${d(C)} ${d(w)}`;return[`M${d(o+m)} ${d(n)}`,`L${d(e-m)} ${d(n)}`,c(e-P,n,e-h,n,e-p,n+W),c(e-t,n+l,e-l,n+t,e-W,n+p),c(e,n+h,e,n+P,e,n+m),`L${d(e)} ${d(a-m)}`,c(e,a-P,e,a-h,e-W,a-p),c(e-l,a-t,e-t,a-l,e-p,a-W),c(e-h,a,e-P,a,e-m,a),`L${d(o+m)} ${d(a)}`,c(o+P,a,o+h,a,o+p,a-W),c(o+t,a-l,o+l,a-t,o+W,a-p),c(o,a-h,o,a-P,o,a-m),`L${d(o)} ${d(n+m)}`,c(o,n+P,o,n+h,o+W,n+p),c(o+l,n+t,o+t,n+l,o+p,n+W),c(o+h,n,o+P,n,o+m,n),"Z"].join("")}var s=L(function({kind:n="iPhone",pixelWidth:F,pixelHeight:b,rotation:k,className:f,style:m}){let P=Q(),h=k??((F??0)>(b??0)?90:0),p=h===90||h===270,t=S(()=>{let{p:l,edge:W,W:e,H:a}=K(n,p?b:F,p?F:b),d=(H)=>B(l.nubProtrude+H,l.nubProtrude+H,e-2*(l.nubProtrude+H),a-2*(l.nubProtrude+H),l.screenRadius+(W-H)),c=l.nubProtrude,z=l.nubs.map(([H,g,v])=>{let C=g+6,w=g+v-6;switch(H){case"left":return{fill:`M0 ${g}h${c}v${v}H0z`,edge:`M${c} ${g}H6Q0 ${g} 0 ${C}V${w}Q0 ${g+v} 6 ${g+v}H${c}`};case"right":return{fill:`M${e-c} ${g}H${e}v${v}H${e-c}z`,edge:`M${e-c} ${g}H${e-6}Q${e} ${g} ${e} ${C}V${w}Q${e} ${g+v} ${e-6} ${g+v}H${e-c}`};default:{let M=g>=0?g:e+g-v;return{fill:`M${M} 0v${c}h${v}V0z`,edge:`M${M} ${c}V6Q${M} 0 ${M+6} 0H${M+v-6}Q${M+v} 0 ${M+v} 6V${c}`}}}});return{W:e,H:a,outer:d(0),grey:d(l.silver),black:d(l.silver+l.grey),cutout:d(W),nubFill:z.map((H)=>H.fill).join(""),nubEdge:z.map((H)=>H.edge).join("")}},[n,F,b,p]);return E("svg",{viewBox:`0 0 ${p?t.H:t.W} ${p?t.W:t.H}`,className:f,style:m,"aria-hidden":!0,focusable:!1,children:[R("defs",{children:E("linearGradient",{id:P,x1:"0",y1:"0",x2:"1",y2:"1",children:[R("stop",{offset:"0%",stopColor:"#e8e8ec"}),R("stop",{offset:"45%",stopColor:"#bcbcc0"}),R("stop",{offset:"55%",stopColor:"#b4b4b8"}),R("stop",{offset:"100%",stopColor:"#e2e2e6"})]})}),E("g",{transform:h===90?`translate(${t.H} 0) rotate(90)`:h===180?`translate(${t.W} ${t.H}) rotate(180)`:h===270?`translate(0 ${t.W}) rotate(270)`:void 0,children:[R("path",{d:`${t.outer} ${t.cutout}`,fill:`url(#${P})`,fillRule:"evenodd"}),R("path",{d:`${t.grey} ${t.cutout}`,fill:"#4a4a4e",fillRule:"evenodd"}),R("path",{d:`${t.black} ${t.cutout}`,fill:"#0b0b0c",fillRule:"evenodd"}),R("path",{d:t.cutout,fill:"none",stroke:"#2a2a2c",strokeWidth:3}),R("path",{d:t.outer,fill:"none",stroke:"#000",strokeWidth:1.5,vectorEffect:"non-scaling-stroke"}),R("path",{d:t.nubFill,fill:"#4a4a4e"}),R("path",{d:t.nubEdge,fill:"none",stroke:"#000",strokeWidth:1.5,strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})]})]})});
|
|
2
|
-
export{u,i,r,s};
|
package/rust/Cargo.toml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
autobins = false
|
|
3
|
-
autotests = false
|
|
4
|
-
name = "alwith-device"
|
|
5
|
-
version = "0.5.0"
|
|
6
|
-
edition = "2024"
|
|
7
|
-
publish = false
|
|
8
|
-
[workspace]
|
|
9
|
-
[dependencies]
|
|
10
|
-
alwith-native-client = { path = "../../native-kit/rust" }
|
|
11
|
-
serde = { version = "1", features = ["derive"] }
|
|
12
|
-
serde_json = "1"
|
|
13
|
-
specta = { version = "2.0.0-rc.27", features = ["derive"] }
|
|
14
|
-
[dev-dependencies]
|
|
15
|
-
tokio = { version = "1", features = ["rt-multi-thread"] }
|
package/rust/src/lib.rs
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
//! Managed device types and ABI transport. The implementation lives in `@alwith/native-device`.
|
|
2
|
-
use alwith_native_client::Handle;
|
|
3
|
-
use serde::{Deserialize, Serialize};
|
|
4
|
-
use serde_json::{Value, json};
|
|
5
|
-
|
|
6
|
-
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, specta::Type)]
|
|
7
|
-
#[serde(rename_all = "camelCase")]
|
|
8
|
-
pub struct ManagedDevice {
|
|
9
|
-
pub id: String,
|
|
10
|
-
pub platform: String,
|
|
11
|
-
pub name: String,
|
|
12
|
-
pub system_version: String,
|
|
13
|
-
pub running: bool,
|
|
14
|
-
}
|
|
15
|
-
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, specta::Type)]
|
|
16
|
-
#[serde(tag = "type", content = "id", rename_all = "snake_case")]
|
|
17
|
-
pub enum Owner {
|
|
18
|
-
DevelopmentSession(String),
|
|
19
|
-
QaRun(String),
|
|
20
|
-
}
|
|
21
|
-
#[derive(Clone, Debug, Serialize, Deserialize, specta::Type)]
|
|
22
|
-
#[serde(rename_all = "camelCase")]
|
|
23
|
-
pub struct LaunchedApp {
|
|
24
|
-
pub bundle_id: String,
|
|
25
|
-
pub executable: String,
|
|
26
|
-
pub pid: u32,
|
|
27
|
-
pub launched_at: String,
|
|
28
|
-
}
|
|
29
|
-
#[derive(Clone, Debug, Serialize, Deserialize, specta::Type)]
|
|
30
|
-
#[serde(rename_all = "camelCase")]
|
|
31
|
-
pub struct AttachmentInfo {
|
|
32
|
-
pub udid: String,
|
|
33
|
-
pub platform: String,
|
|
34
|
-
pub device_name: String,
|
|
35
|
-
pub system_version: String,
|
|
36
|
-
pub owner: Owner,
|
|
37
|
-
pub attached_at: String,
|
|
38
|
-
pub pixel_width: Option<u32>,
|
|
39
|
-
pub pixel_height: Option<u32>,
|
|
40
|
-
pub point_width: Option<f64>,
|
|
41
|
-
pub point_height: Option<f64>,
|
|
42
|
-
#[serde(default)]
|
|
43
|
-
pub rotation: Option<u16>,
|
|
44
|
-
#[serde(default)]
|
|
45
|
-
pub recording_path: Option<String>,
|
|
46
|
-
pub app: Option<LaunchedApp>,
|
|
47
|
-
}
|
|
48
|
-
#[derive(Clone, Debug, Serialize, Deserialize, specta::Type)]
|
|
49
|
-
#[serde(rename_all = "camelCase")]
|
|
50
|
-
pub struct Registration {
|
|
51
|
-
pub address: String,
|
|
52
|
-
pub token: String,
|
|
53
|
-
}
|
|
54
|
-
#[derive(Clone, Debug, Default, Serialize, Deserialize, specta::Type)]
|
|
55
|
-
#[serde(rename_all = "camelCase")]
|
|
56
|
-
pub struct LogQuery {
|
|
57
|
-
pub since_seq: Option<u64>,
|
|
58
|
-
pub tail: Option<usize>,
|
|
59
|
-
pub min_level: Option<String>,
|
|
60
|
-
pub filter: Option<String>,
|
|
61
|
-
}
|
|
62
|
-
#[derive(Clone, Debug, Serialize, Deserialize, specta::Type)]
|
|
63
|
-
#[serde(rename_all = "camelCase")]
|
|
64
|
-
pub struct LogEntry {
|
|
65
|
-
pub seq: u64,
|
|
66
|
-
pub timestamp: String,
|
|
67
|
-
pub level: String,
|
|
68
|
-
pub process: String,
|
|
69
|
-
pub pid: u64,
|
|
70
|
-
pub subsystem: String,
|
|
71
|
-
pub category: String,
|
|
72
|
-
pub message: String,
|
|
73
|
-
}
|
|
74
|
-
#[derive(Clone, Debug, Serialize, Deserialize, specta::Type)]
|
|
75
|
-
#[serde(rename_all = "camelCase")]
|
|
76
|
-
pub struct LogPage {
|
|
77
|
-
pub entries: Vec<LogEntry>,
|
|
78
|
-
pub dropped: u64,
|
|
79
|
-
pub total: u64,
|
|
80
|
-
pub last_seq: u64,
|
|
81
|
-
pub capture_started_at: String,
|
|
82
|
-
}
|
|
83
|
-
#[derive(Clone, Debug, Serialize, Deserialize, specta::Type)]
|
|
84
|
-
#[serde(rename_all = "camelCase")]
|
|
85
|
-
pub struct CrashReport {
|
|
86
|
-
pub path: String,
|
|
87
|
-
pub process: String,
|
|
88
|
-
pub timestamp: String,
|
|
89
|
-
pub summary: String,
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/// Devices available on this machine, without a host instance.
|
|
93
|
-
pub fn list(platform: &str) -> Result<Vec<ManagedDevice>, String> {
|
|
94
|
-
alwith_native_client::Library::module("device")?.call("device.list", json!({"platform": platform}))
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/// One host instance: its gateway, attachments and operations.
|
|
98
|
-
pub struct DeviceHost(Handle);
|
|
99
|
-
impl Default for DeviceHost {
|
|
100
|
-
fn default() -> Self {
|
|
101
|
-
Self::open().expect("Native device module is required")
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
impl DeviceHost {
|
|
105
|
-
/// None when the device module is not staged; hosts then run without simulators.
|
|
106
|
-
pub fn open() -> Option<Self> {
|
|
107
|
-
Handle::open("device", json!({})).ok().map(Self)
|
|
108
|
-
}
|
|
109
|
-
pub async fn listen(&self) -> Result<String, String> {
|
|
110
|
-
self.0.call_async("gateway_listen", json!({})).await
|
|
111
|
-
}
|
|
112
|
-
pub fn register(&self) -> Result<Registration, String> {
|
|
113
|
-
self.0.call("gateway_register", json!({}))
|
|
114
|
-
}
|
|
115
|
-
pub fn bind(&self, token: &str, session: &str) -> Result<(), String> {
|
|
116
|
-
self.0.call("gateway_bind", json!({"token": token, "session": session}))
|
|
117
|
-
}
|
|
118
|
-
pub async fn stop_session(&self, session: &str) -> Result<(), String> {
|
|
119
|
-
self.0.call_async("gateway_stop_session", json!({"session": session})).await
|
|
120
|
-
}
|
|
121
|
-
pub fn revision(&self) -> Result<u64, String> {
|
|
122
|
-
self.0.call("revision", json!({}))
|
|
123
|
-
}
|
|
124
|
-
/// Blocks up to 25 seconds until the attachments change past `revision`.
|
|
125
|
-
pub async fn changed_since(&self, revision: u64) -> Result<u64, String> {
|
|
126
|
-
self.0.call_async("changed_since", json!({"revision": revision})).await
|
|
127
|
-
}
|
|
128
|
-
pub fn attachments(&self) -> Result<Vec<AttachmentInfo>, String> {
|
|
129
|
-
self.0.call("attachments", json!({}))
|
|
130
|
-
}
|
|
131
|
-
pub async fn list(&self, platform: &str) -> Result<Vec<ManagedDevice>, String> {
|
|
132
|
-
let platform = platform.to_string();
|
|
133
|
-
tokio_free_blocking(move || list(&platform)).await
|
|
134
|
-
}
|
|
135
|
-
pub async fn attach(
|
|
136
|
-
&self, owner: Owner, platform: &str, udid: Option<&str>, auto_boot: bool,
|
|
137
|
-
) -> Result<AttachmentInfo, String> {
|
|
138
|
-
self.0
|
|
139
|
-
.call_async("attach", json!({"owner": owner, "platform": platform, "udid": udid, "auto_boot": auto_boot}))
|
|
140
|
-
.await
|
|
141
|
-
}
|
|
142
|
-
/// The host opening a device: one another owner holds moves to `owner`, otherwise it attaches as usual.
|
|
143
|
-
pub async fn take_over(
|
|
144
|
-
&self, owner: Owner, platform: &str, udid: Option<&str>, auto_boot: bool,
|
|
145
|
-
) -> Result<AttachmentInfo, String> {
|
|
146
|
-
self.0
|
|
147
|
-
.call_async(
|
|
148
|
-
"take_over",
|
|
149
|
-
json!({"owner": owner, "platform": platform, "udid": udid, "auto_boot": auto_boot}),
|
|
150
|
-
)
|
|
151
|
-
.await
|
|
152
|
-
}
|
|
153
|
-
pub async fn detach(&self, udid: &str, owner: Option<Owner>) -> Result<(), String> {
|
|
154
|
-
self.0.call_async("detach", json!({"udid": udid, "owner": owner})).await
|
|
155
|
-
}
|
|
156
|
-
pub async fn launch(
|
|
157
|
-
&self, udid: &str, bundle_id: &str, app_path: Option<&str>, arguments: Vec<String>,
|
|
158
|
-
) -> Result<LaunchedApp, String> {
|
|
159
|
-
self.0
|
|
160
|
-
.call_async(
|
|
161
|
-
"launch",
|
|
162
|
-
json!({"udid": udid, "bundle_id": bundle_id, "app_path": app_path, "arguments": arguments}),
|
|
163
|
-
)
|
|
164
|
-
.await
|
|
165
|
-
}
|
|
166
|
-
pub async fn terminate(&self, udid: &str, bundle_id: &str) -> Result<(), String> {
|
|
167
|
-
self.0.call_async("terminate", json!({"udid": udid, "bundle_id": bundle_id})).await
|
|
168
|
-
}
|
|
169
|
-
/// Base64 PNG of the current screen.
|
|
170
|
-
pub async fn screenshot(&self, udid: &str) -> Result<String, String> {
|
|
171
|
-
self.0.call_async("screenshot", json!({"udid": udid})).await
|
|
172
|
-
}
|
|
173
|
-
pub async fn gesture(&self, udid: &str, gesture: Value) -> Result<(), String> {
|
|
174
|
-
self.0.call_async("gesture", json!({"udid": udid, "gesture": gesture})).await
|
|
175
|
-
}
|
|
176
|
-
pub async fn inspect(&self, udid: &str) -> Result<String, String> {
|
|
177
|
-
self.0.call_async("inspect", json!({"udid": udid})).await
|
|
178
|
-
}
|
|
179
|
-
pub async fn open_url(&self, udid: &str, url: &str) -> Result<(), String> {
|
|
180
|
-
self.0.call_async("open_url", json!({"udid": udid, "url": url})).await
|
|
181
|
-
}
|
|
182
|
-
pub async fn appearance(&self, udid: &str) -> Result<String, String> {
|
|
183
|
-
self.0.call_async("appearance", json!({"udid": udid})).await
|
|
184
|
-
}
|
|
185
|
-
pub async fn set_appearance(&self, udid: &str, mode: &str) -> Result<(), String> {
|
|
186
|
-
self.0.call_async("set_appearance", json!({"udid": udid, "mode": mode})).await
|
|
187
|
-
}
|
|
188
|
-
pub async fn shutdown_device(&self, udid: &str) -> Result<(), String> {
|
|
189
|
-
self.0.call_async("shutdown_device", json!({"udid": udid})).await
|
|
190
|
-
}
|
|
191
|
-
pub async fn restart_device(&self, udid: &str) -> Result<(), String> {
|
|
192
|
-
self.0.call_async("restart_device", json!({"udid": udid})).await
|
|
193
|
-
}
|
|
194
|
-
pub async fn set_status_bar(&self, udid: &str, look: &str) -> Result<(), String> {
|
|
195
|
-
self.0.call_async("set_status_bar", json!({"udid": udid, "look": look})).await
|
|
196
|
-
}
|
|
197
|
-
pub async fn read_logs(&self, udid: &str, query: LogQuery) -> Result<LogPage, String> {
|
|
198
|
-
self.0.call_async("logs_read", json!({"udid": udid, "query": query})).await
|
|
199
|
-
}
|
|
200
|
-
pub fn crash_report(&self, udid: &str, bundle_id: Option<&str>) -> Result<Option<CrashReport>, String> {
|
|
201
|
-
self.0.call("crash_report", json!({"udid": udid, "bundle_id": bundle_id}))
|
|
202
|
-
}
|
|
203
|
-
pub fn call_value(&self, operation: &str, params: Value) -> Result<Value, Value> {
|
|
204
|
-
self.0.call_value(operation, params)
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
async fn tokio_free_blocking<T: Send + 'static>(
|
|
208
|
-
work: impl FnOnce() -> Result<T, String> + Send + 'static,
|
|
209
|
-
) -> Result<T, String> {
|
|
210
|
-
let (sender, receiver) = std::sync::mpsc::channel();
|
|
211
|
-
std::thread::spawn(move || {
|
|
212
|
-
let _ = sender.send(work());
|
|
213
|
-
});
|
|
214
|
-
// The native call is short; poll the channel without holding an async runtime dependency.
|
|
215
|
-
loop {
|
|
216
|
-
match receiver.try_recv() {
|
|
217
|
-
Ok(result) => return result,
|
|
218
|
-
Err(std::sync::mpsc::TryRecvError::Empty) => std::thread::sleep(std::time::Duration::from_millis(10)),
|
|
219
|
-
Err(std::sync::mpsc::TryRecvError::Disconnected) => return Err("device listing thread exited".into()),
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|