mirror of
https://github.com/cjpais/Handy.git
synced 2026-11-26 01:50:26 +08:00
Direct typing turns each character into a keycode, so on Linux it drops capitals and accents and types the wrong characters on non-US layouts (#429, #439, #1853). Shift+Insert pastes in GUI apps and terminals alike once the transcript is also on the primary selection, which kitty, Ghostty, Alacritty, xterm and VTE read; both are restored afterwards. New installs get Shift+Insert and a longer restore delay, since Linux apps fetch the clipboard only when they handle the key. Existing settings are left alone; a Linux-only What's New note suggests switching. Release notes can now be platform-specific for that. Also fixes the enigo Shift+Insert fallback, which sent the keysym for 'v' and typed 'V'.
223 lines
9.2 KiB
TOML
223 lines
9.2 KiB
TOML
[package]
|
|
name = "handy"
|
|
version = "0.10.0"
|
|
description = "Handy"
|
|
authors = ["cjpais"]
|
|
edition = "2021"
|
|
license = "MIT"
|
|
default-run = "handy"
|
|
|
|
[profile.dev]
|
|
incremental = true # Compile your binary in smaller steps.
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[lib]
|
|
# The `_lib` suffix may seem redundant but it is necessary
|
|
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
name = "handy_app_lib"
|
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2", features = [] }
|
|
serde_json = "1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
|
|
[dependencies]
|
|
once_cell = "1"
|
|
# The OS's preferred languages (macOS, Linux; Windows' fallback). Already
|
|
# pulled in by tauri-plugin-os.
|
|
sys-locale = "0.3"
|
|
tauri = { version = "2.11.5", features = [
|
|
"protocol-asset",
|
|
"macos-private-api",
|
|
"tray-icon",
|
|
'image-png',
|
|
] }
|
|
tauri-plugin-log = "2.7.1"
|
|
tauri-plugin-opener = "2.5.2"
|
|
tauri-plugin-store = "2.4.1"
|
|
tauri-plugin-os = "2.3.2"
|
|
tauri-plugin-clipboard-manager = "2.3.2"
|
|
tauri-plugin-macos-permissions = "2.3.0"
|
|
tauri-plugin-process = "2.3.1"
|
|
rusqlite_migration = "2.3"
|
|
tauri-plugin-fs = "2.4.4"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
rdev = { git = "https://github.com/rustdesk-org/rdev" }
|
|
anyhow = "1.0.95"
|
|
hound = "3.5.1"
|
|
log = "0.4.25"
|
|
env_filter = "0.1.0"
|
|
tokio = { version = "1.43.0", features = ["process"] }
|
|
earshot = "1.2.2"
|
|
enigo = "0.6.1"
|
|
# Feedback sounds. No `recording`: microphone capture is handy-recorder's.
|
|
rodio = { version = "0.23.0", default-features = false, features = ["playback", "wav", "flac", "mp3", "vorbis"] }
|
|
# Decodes files for transcription. rodio's version, plus the M4A/MP4 (AAC,
|
|
# ALAC) and AIFF support rodio leaves out.
|
|
symphonia = { version = "0.5.5", features = ["aac", "alac", "isomp4", "mp3", "aiff"] }
|
|
# Opus (most .ogg/.opus/.webm voice notes), which symphonia can't decode.
|
|
# Builds libopus from source with cmake. 0.2 is the last for symphonia 0.5;
|
|
# 0.2.3 and older drop 120 ms stereo packets (too small a buffer).
|
|
symphonia-adapter-libopus = "0.2.9"
|
|
# Resamples a decoded file to 16 kHz; the version handy-recorder already uses.
|
|
rubato = "5"
|
|
handy-recorder = "0.1.1"
|
|
reqwest = { version = "0.12", features = ["json", "stream", "gzip", "brotli", "deflate"] }
|
|
futures-util = "0.3"
|
|
rustfft = "6.4.0"
|
|
strsim = "0.11.0"
|
|
natural = "0.5.0"
|
|
regex = "1"
|
|
# Text-based language ID (filler-word removal fallback); isolang bridges the
|
|
# ISO 639-1 codes in model metadata to whatlang's 639-3 codes.
|
|
whatlang = "0.16"
|
|
isolang = "2"
|
|
chrono = "0.4"
|
|
rusqlite = { version = "0.37", features = ["bundled"] }
|
|
sha2 = "0.10"
|
|
libc = "0.2"
|
|
# Every model runs through transcribe-cpp (GGUF/ggml, native backends).
|
|
# Per-platform backend features are added in the target tables (Cargo unifies
|
|
# features, so `serde` here applies to every platform).
|
|
transcribe-cpp = { version = "0.4.2", default-features = false, features = [
|
|
"serde",
|
|
] }
|
|
handy-keys = "0.3.4"
|
|
ferrous-opencc = "0.2.3"
|
|
clap = { version = "4", features = ["derive"] }
|
|
specta = "=2.0.0-rc.22"
|
|
specta-typescript = "0.0.9"
|
|
tauri-specta = { version = "=2.0.0-rc.21", features = ["derive", "typescript"] }
|
|
tauri-plugin-dialog = "2.6"
|
|
hf-hub = { git = "https://github.com/cjpais/hf-hub", branch = "cancellable-downloads", features = [
|
|
"tokio",
|
|
] }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
signal-hook = "0.3"
|
|
|
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
|
tauri-plugin-autostart = "2.5.1"
|
|
tauri-plugin-global-shortcut = "2.3.1"
|
|
tauri-plugin-single-instance = "2.3.2"
|
|
tauri-plugin-updater = "2.10.1"
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
# Used to reach ICoreWebView2Settings3 through the webview's controller
|
|
# (disabling browser accelerator keys in the main window). Must match the
|
|
# version wry links against so the COM types are identical.
|
|
webview2-com = "0.38"
|
|
windows = { version = "0.61.3", features = [
|
|
"System_UserProfile",
|
|
"Win32_Media_Audio_Endpoints",
|
|
"Win32_Security",
|
|
"Win32_System_Com_StructuredStorage",
|
|
"Win32_System_DataExchange",
|
|
"Win32_System_LibraryLoader",
|
|
"Win32_System_Ole",
|
|
"Win32_System_Memory",
|
|
"Win32_System_Threading",
|
|
"Win32_System_Variant",
|
|
"Win32_Foundation",
|
|
"Win32_Graphics_Gdi",
|
|
"Win32_UI_WindowsAndMessaging",
|
|
] }
|
|
winreg = "0.55"
|
|
|
|
# Whisper backend per Windows arch. x86_64 ships the Vulkan GPU backend and
|
|
# keeps the dynamic-backends posture (loadable per-ISA CPU modules + Vulkan),
|
|
# where runtime ISA scoring (GGML_CPU_ALL_VARIANTS) earns the extra shipped DLLs.
|
|
#
|
|
# Windows-on-ARM is CPU-only: its Adreno Vulkan drivers are immature, and
|
|
# ggml-vulkan's shader generator (vulkan-shaders-gen) does not build under the
|
|
# clang-cl/lld toolchain that ggml's ARM CPU backend requires. dynamic-backends
|
|
# buys nothing on ARM — ALL_VARIANTS is an x86 concept, so a DL build there is
|
|
# just a single portable CPU module shipped as a DLL. So ARM links transcribe-cpp
|
|
# STATICALLY (no features = static CPU-only): the one CPU backend is compiled into
|
|
# handy.exe and we ship zero DLLs, which sidesteps the installer's per-DLL
|
|
# signtool verify entirely. CI pins -DGGML_NATIVE=OFF (see build.yml) so the
|
|
# static build targets a portable ARM baseline, not the build runner's CPU.
|
|
[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies]
|
|
transcribe-cpp = { version = "0.4.2", default-features = false, features = [
|
|
"dynamic-backends",
|
|
"vulkan",
|
|
] }
|
|
|
|
[target.'cfg(all(windows, target_arch = "aarch64"))'.dependencies]
|
|
transcribe-cpp = { version = "0.4.2", default-features = false }
|
|
# libopus's ARM runtime CPU probe (celt/arm/armcpu.c) sees clang-cl's _MSC_VER
|
|
# and calls MSVC's __emit, which clang lacks; presuming NEON instead trips a
|
|
# libopus CMake bug (celt_inner_prod_neon left undeclared). Build plain C:
|
|
# decoding Opus files is cheap.
|
|
opusic-sys = { version = "0.7", features = ["no-simd"] }
|
|
|
|
# Whisper backend per macOS arch. Apple Silicon links the static Metal build.
|
|
# Intel Macs are CPU-only: ggml-metal compiles its embedded shader library at
|
|
# backend init (app launch, regardless of the selected accelerator), and on
|
|
# some AMD GPUs that compile never finishes, hanging every model load (#2340).
|
|
# Metal on Intel/AMD buys little at these model sizes anyway. With no features,
|
|
# transcribe-cpp-sys sets TRANSCRIBE_METAL=OFF and pins a portable x86 CPU floor.
|
|
[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies]
|
|
transcribe-cpp = { version = "0.4.2", default-features = false, features = ["metal"] }
|
|
|
|
[target.'cfg(all(target_os = "macos", target_arch = "x86_64"))'.dependencies]
|
|
transcribe-cpp = { version = "0.4.2", default-features = false }
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2.1" }
|
|
# Used by the receipt-sequenced ("reliable") paste path for lazy NSPasteboard
|
|
# promises. Versions track what Tauri already pulls in.
|
|
objc2 = "0.6"
|
|
objc2-foundation = "0.3"
|
|
objc2-app-kit = "0.3"
|
|
objc2-service-management = "0.3.2"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
# PRIMARY selection access for Shift+Insert paste (already in the tree via the clipboard plugin).
|
|
arboard = { version = "3.6.1", default-features = false }
|
|
gtk-layer-shell = { version = "0.8", features = ["v0_6"] }
|
|
# Renderer policy in src/webkit_renderer.rs compares the linked WebKitGTK
|
|
# version against the release that introduced damage-based compositing.
|
|
webkit2gtk-sys = "2.0"
|
|
gtk = "0.18"
|
|
transcribe-cpp = { version = "0.4.2", default-features = false, features = [
|
|
"dynamic-backends",
|
|
"vulkan",
|
|
] }
|
|
|
|
# TEMPORARY: tao pinned past 0.35.3 for the Wayland client-side-decorations fix
|
|
# (tao #1218, fixes tauri #11856 — dead titlebar buttons after visible(false) →
|
|
# show()). Drop this once a tao release containing it lands in tauri.
|
|
#
|
|
# The rev is a cjpais/tao branch, not upstream: dev past 0.35.3 also carries
|
|
# tao #1231 (removed window subclassing), which left the thread event target's
|
|
# WNDPROC falling through to DefSubclassProc. On a no-longer-subclassed window
|
|
# that returns 0, so WM_QUERYENDSESSION answered FALSE and vetoed Windows
|
|
# shutdown (Handy #1710). `handy` = 07f3742b + a cherry-pick of tao #1274
|
|
# (DefSubclassProc → DefWindowProcW). Repoint at upstream once #1274 merges.
|
|
#
|
|
# tao-macros must be patched to the SAME rev even though nothing here depends on
|
|
# it directly: wry pulls tao-macros 0.1.3 from crates.io, so without this the
|
|
# lockfile carries two tao-macros 0.1.3 entries (registry + git). cargo tolerates
|
|
# that, but Nix's importCargoLock vendors both to the same `tao-macros-0.1.3`
|
|
# dir and fails with a symlink collision. Unifying the source removes the dup.
|
|
[patch.crates-io]
|
|
tao = { git = "https://github.com/cjpais/tao", rev = "c3bee28c1d446d95f08c95c3b6f8d4bde052b876" }
|
|
tao-macros = { git = "https://github.com/cjpais/tao", rev = "c3bee28c1d446d95f08c95c3b6f8d4bde052b876" }
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
# Test-only tokio features for the local socket servers exercising the
|
|
# resumable HTTP downloader; normal builds keep the leaner feature set.
|
|
tokio = { version = "1.43.0", features = ["macros", "net", "io-util", "sync", "time", "rt-multi-thread"] }
|
|
|
|
[profile.release]
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|
|
panic = "unwind"
|