Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

feat(linux): read call names through AT-SPI

10ax7a70c63aab92
diff --git a/app/native/yogurt-system/Cargo.lock b/app/native/yogurt-system/Cargo.lock
index 3ef368a9..15ae7c43 100644
--- a/app/native/yogurt-system/Cargo.lock
+++ b/app/native/yogurt-system/Cargo.lock
@@ -2,6 +2,143 @@
# It is not intended for manual editing.
version = 4
+[[package]]
+name = "async-broadcast"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
+dependencies = [
+ "event-listener",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-channel"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
+dependencies = [
+ "concurrent-queue",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-executor"
+version = "1.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8"
+dependencies = [
+ "async-task",
+ "concurrent-queue",
+ "fastrand",
+ "futures-lite",
+ "pin-project-lite",
+ "slab",
+]
+
+[[package]]
+name = "async-io"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
+dependencies = [
+ "autocfg",
+ "cfg-if",
+ "concurrent-queue",
+ "futures-io",
+ "futures-lite",
+ "parking",
+ "polling",
+ "rustix 1.1.6",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "async-lock"
+version = "3.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
+dependencies = [
+ "event-listener",
+ "event-listener-strategy",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-process"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
+dependencies = [
+ "async-channel",
+ "async-io",
+ "async-lock",
+ "async-signal",
+ "async-task",
+ "blocking",
+ "cfg-if",
+ "event-listener",
+ "futures-lite",
+ "rustix 1.1.6",
+]
+
+[[package]]
+name = "async-recursion"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "async-signal"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
+dependencies = [
+ "async-io",
+ "async-lock",
+ "atomic-waker",
+ "cfg-if",
+ "futures-core",
+ "futures-io",
+ "rustix 1.1.6",
+ "signal-hook-registry",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "async-task"
+version = "4.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
+
+[[package]]
+name = "async-trait"
+version = "0.1.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "atomic-waker"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
+
[[package]]
name = "autocfg"
version = "1.5.1"
@@ -14,12 +151,79 @@ version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
+[[package]]
+name = "blocking"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"
+dependencies = [
+ "async-channel",
+ "async-task",
+ "futures-io",
+ "futures-lite",
+ "piper",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.20.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
+
[[package]]
name = "cfg-if"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
+[[package]]
+name = "concurrent-queue"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
+
+[[package]]
+name = "endi"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
+
+[[package]]
+name = "enumflags2"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
+dependencies = [
+ "enumflags2_derive",
+ "serde",
+]
+
+[[package]]
+name = "enumflags2_derive"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
+
[[package]]
name = "errno"
version = "0.3.14"
@@ -30,6 +234,75 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "event-listener"
+version = "5.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
+dependencies = [
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener-strategy"
+version = "0.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
+dependencies = [
+ "event-listener",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
+
+[[package]]
+name = "futures-core"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
+
+[[package]]
+name = "futures-io"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
+
+[[package]]
+name = "futures-lite"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
+dependencies = [
+ "fastrand",
+ "futures-core",
+ "futures-io",
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "futures-task"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
+
+[[package]]
+name = "futures-util"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "pin-project-lite",
+ "slab",
+]
+
[[package]]
name = "gethostname"
version = "0.4.3"
@@ -40,12 +313,62 @@ dependencies = [
"windows-targets 0.48.5",
]
+[[package]]
+name = "getrandom"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "r-efi",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.17.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
+
+[[package]]
+name = "hermit-abi"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
+
+[[package]]
+name = "hex"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+
+[[package]]
+name = "indexmap"
+version = "2.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
[[package]]
name = "itoa"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
+[[package]]
+name = "js-sys"
+version = "0.3.106"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
+dependencies = [
+ "cfg-if",
+ "futures-util",
+ "wasm-bindgen",
+]
+
[[package]]
name = "libc"
version = "0.2.191"
@@ -85,12 +408,27 @@ version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
+[[package]]
+name = "linux-raw-sys"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
+
[[package]]
name = "memchr"
version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
+[[package]]
+name = "memoffset"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
+dependencies = [
+ "autocfg",
+]
+
[[package]]
name = "num-derive"
version = "0.4.2"
@@ -111,12 +449,74 @@ dependencies = [
"autocfg",
]
+[[package]]
+name = "once_cell"
+version = "1.21.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
+
+[[package]]
+name = "ordered-stream"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "parking"
+version = "2.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
+
+[[package]]
+name = "piper"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
+dependencies = [
+ "atomic-waker",
+ "fastrand",
+ "futures-io",
+]
+
[[package]]
name = "pkg-config"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
+[[package]]
+name = "polling"
+version = "3.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
+dependencies = [
+ "cfg-if",
+ "concurrent-queue",
+ "hermit-abi",
+ "pin-project-lite",
+ "rustix 1.1.6",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "proc-macro-crate"
+version = "3.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
+dependencies = [
+ "toml_edit",
+]
+
[[package]]
name = "proc-macro2"
version = "1.0.107"
@@ -135,6 +535,12 @@ dependencies = [
"proc-macro2",
]
+[[package]]
+name = "r-efi"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
+
[[package]]
name = "rustix"
version = "0.38.44"
@@ -144,10 +550,29 @@ dependencies = [
"bitflags",
"errno",
"libc",
- "linux-raw-sys",
+ "linux-raw-sys 0.4.15",
"windows-sys 0.59.0",
]
+[[package]]
+name = "rustix"
+version = "1.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
+dependencies = [
+ "bitflags",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.12.1",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
+
[[package]]
name = "ryu"
version = "1.0.23"
@@ -161,6 +586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
dependencies = [
"serde_core",
+ "serde_derive",
]
[[package]]
@@ -195,6 +621,33 @@ dependencies = [
"serde",
]
+[[package]]
+name = "serde_repr"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
+dependencies = [
+ "errno",
+ "libc",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
+
[[package]]
name = "syn"
version = "2.0.119"
@@ -217,12 +670,153 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "tempfile"
+version = "3.27.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
+dependencies = [
+ "fastrand",
+ "getrandom",
+ "once_cell",
+ "rustix 1.1.6",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "toml_datetime"
+version = "1.1.2+spec-1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
+dependencies = [
+ "serde_core",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.25.17+spec-1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c"
+dependencies = [
+ "indexmap",
+ "toml_datetime",
+ "toml_parser",
+ "winnow",
+]
+
+[[package]]
+name = "toml_parser"
+version = "1.1.5+spec-1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"
+dependencies = [
+ "winnow",
+]
+
+[[package]]
+name = "tracing"
+version = "0.1.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
+dependencies = [
+ "pin-project-lite",
+ "tracing-attributes",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-attributes"
+version = "0.1.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
+dependencies = [
+ "once_cell",
+]
+
+[[package]]
+name = "uds_windows"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
+dependencies = [
+ "memoffset",
+ "tempfile",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "unicode-ident"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
+[[package]]
+name = "uuid"
+version = "1.26.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce"
+dependencies = [
+ "js-sys",
+ "serde_core",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "rustversion",
+ "wasm-bindgen-macro",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7"
+dependencies = [
+ "bumpalo",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6"
+dependencies = [
+ "unicode-ident",
+]
+
[[package]]
name = "winapi"
version = "0.3.9"
@@ -463,6 +1057,15 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+[[package]]
+name = "winnow"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "winreg"
version = "0.52.0"
@@ -480,7 +1083,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12"
dependencies = [
"gethostname",
- "rustix",
+ "rustix 0.38.44",
"x11rb-protocol",
]
@@ -495,8 +1098,121 @@ name = "yogurt-system"
version = "0.1.0"
dependencies = [
"libpulse-binding",
+ "serde",
"serde_json",
"windows",
"winreg",
"x11rb",
+ "zbus",
+]
+
+[[package]]
+name = "zbus"
+version = "5.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"
+dependencies = [
+ "async-broadcast",
+ "async-executor",
+ "async-io",
+ "async-lock",
+ "async-process",
+ "async-recursion",
+ "async-task",
+ "async-trait",
+ "blocking",
+ "enumflags2",
+ "event-listener",
+ "futures-core",
+ "futures-lite",
+ "hex",
+ "libc",
+ "ordered-stream",
+ "rustix 1.1.6",
+ "serde",
+ "serde_repr",
+ "tracing",
+ "uds_windows",
+ "uuid",
+ "windows-sys 0.61.2",
+ "winnow",
+ "zbus_macros",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "zbus_macros"
+version = "5.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "zbus_names",
+ "zvariant",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zbus_names"
+version = "4.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd"
+dependencies = [
+ "serde",
+ "winnow",
+ "zvariant",
+]
+
+[[package]]
+name = "zcheapstr"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "zvariant"
+version = "5.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7"
+dependencies = [
+ "endi",
+ "enumflags2",
+ "serde",
+ "winnow",
+ "zcheapstr",
+ "zvariant_derive",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_derive"
+version = "5.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_utils"
+version = "4.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "syn 3.0.9",
+ "winnow",
]
diff --git a/app/native/yogurt-system/Cargo.toml b/app/native/yogurt-system/Cargo.toml
index 4390f396..7d0cb690 100644
--- a/app/native/yogurt-system/Cargo.toml
+++ b/app/native/yogurt-system/Cargo.toml
@@ -29,6 +29,9 @@ windows = { version = "=0.58.0", features = [
[target.'cfg(target_os = "linux")'.dependencies]
libpulse-binding = "=2.30.1"
x11rb = "=0.13.1"
+# the accessibility bus, for names in calls: pure Rust, so the helper still links only glibc and libpulse
+zbus = "=5.19.0"
+serde = "=1.0.229"
[profile.release]
opt-level = "s"
diff --git a/app/native/yogurt-system/smoke/linux.sh b/app/native/yogurt-system/smoke/linux.sh
index 47a590ca..2ca12c96 100644
--- a/app/native/yogurt-system/smoke/linux.sh
+++ b/app/native/yogurt-system/smoke/linux.sh
@@ -47,6 +47,10 @@ check "the xterm title" "v['title'] in ('Meet - abc-defg-hij', 'Second window')"
check "no window for an app that is not open" "v == {'title': None}" "$(DISPLAY=:99 "$BIN" browser-title not-running-here)"
check "no X server (pure Wayland): null" "v == {'title': None}" "$(env -u DISPLAY "$BIN" browser-title xterm)"
+# names in calls: no accessibility bus on the runner, so the watch says why and ends when its stdin closes
+CALLS=$(sleep 1 | timeout 10 "$BIN" call-watch 100 zoom | head -n 1)
+check "call-watch says it cannot read, and stops with stdin" "v.get('error') in ('no-accessibility', 'not-running')" "$CALLS"
+
# wrong use fails like the Mac helper
if "$BIN" browser-title 2>/dev/null; then echo "browser-title with no id should fail"; exit 1; fi
echo "all Linux smoke checks passed"
diff --git a/app/native/yogurt-system/src/atspi.rs b/app/native/yogurt-system/src/atspi.rs
new file mode 100644
index 00000000..b900d144
--- /dev/null
+++ b/app/native/yogurt-system/src/atspi.rs
@@ -0,0 +1,193 @@
+//! The accessibility tree of a call app, read through AT-SPI on Linux: what yogurt-mac copies with AX on a Mac.
+//! Read-only: nothing is clicked or changed in the app. The tree is cut at a depth and a node budget, like the Mac's.
+
+use std::collections::HashMap;
+use std::time::Duration;
+
+use serde_json::{json, Map, Value};
+use zbus::blocking::{connection::Builder, Connection};
+use zbus::zvariant::{DynamicDeserialize, OwnedObjectPath, OwnedValue};
+
+const ACCESSIBLE: &str = "org.a11y.atspi.Accessible";
+const PROPERTIES: &str = "org.freedesktop.DBus.Properties";
+const TEXT: &str = "org.a11y.atspi.Text";
+/// how long one call may wait for an app that stopped answering, like the Mac's AX messaging timeout
+const TIMEOUT: Duration = Duration::from_millis(300);
+/// the longest text copied from one element (the Mac caps it too)
+const MAX_TEXT: usize = 300;
+/// roles that hold text worth reading; inputs are never read
+fn text_role(role: &str) -> bool {
+ matches!(role, "static" | "label" | "text" | "paragraph" | "heading" | "caption" | "link" | "list item" | "table cell")
+}
+/// a Mac calls a window a window; AT-SPI has more than one word for it
+pub fn window_role(role: &str) -> bool {
+ matches!(role, "frame" | "window" | "dialog")
+}
+
+pub struct A11y {
+ conn: Connection,
+}
+
+/// One application on the accessibility bus: its bus name and root object
+#[derive(Clone)]
+pub struct App {
+ pub bus: String,
+ pub path: OwnedObjectPath,
+}
+
+impl A11y {
+ /// The accessibility bus: the session bus says where it is (org.a11y.Bus)
+ pub fn connect() -> Result<Self, String> {
+ let session = Connection::session().map_err(|e| format!("no session bus: {e}"))?;
+ let addr: String = session
+ .call_method(Some("org.a11y.Bus"), "/org/a11y/bus", Some("org.a11y.Bus"), "GetAddress", &())
+ .map_err(|e| format!("no accessibility bus: {e}"))?
+ .body()
+ .deserialize()
+ .map_err(|e| format!("bad accessibility address: {e}"))?;
+ let conn = Builder::address(addr.as_str())
+ .map_err(|e| format!("bad accessibility address: {e}"))?
+ .method_timeout(TIMEOUT)
+ .build()
+ .map_err(|e| format!("cannot reach the accessibility bus: {e}"))?;
+ Ok(Self { conn })
+ }
+
+ /// The applications on the bus now
+ pub fn apps(&self) -> Result<Vec<App>, String> {
+ let children: Vec<(String, OwnedObjectPath)> = self
+ .call("org.a11y.atspi.Registry", "/org/a11y/atspi/accessible/root", ACCESSIBLE, "GetChildren", &())
+ .map_err(|e| format!("cannot list the accessibility apps: {e}"))?;
+ Ok(children.into_iter().map(|(bus, path)| App { bus, path }).collect())
+ }
+
+ /// The process id behind an application's bus name
+ pub fn pid(&self, bus: &str) -> Option<u32> {
+ self.call("org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "GetConnectionUnixProcessID", &(bus,))
+ .ok()
+ }
+
+ /// The name an element shows (its accessible name)
+ pub fn name(&self, bus: &str, path: &OwnedObjectPath) -> Option<String> {
+ self.props(bus, path).get("Name").and_then(|v| v.downcast_ref::<&str>().ok()).map(str::to_string)
+ }
+
+ /// The role AT-SPI gives an element
+ pub fn role(&self, bus: &str, path: &OwnedObjectPath) -> Option<String> {
+ self.call(bus, path.as_str(), ACCESSIBLE, "GetRoleName", &()).ok()
+ }
+
+ /// The elements directly under one
+ pub fn children(&self, bus: &str, path: &OwnedObjectPath) -> Vec<(String, OwnedObjectPath)> {
+ self.call(bus, path.as_str(), ACCESSIBLE, "GetChildren", &()).unwrap_or_default()
+ }
+
+ /// One element and what is under it, in the shape src/main/callNames/parse.ts reads (AxNode)
+ pub fn node(&self, bus: &str, path: &OwnedObjectPath, depth: usize, max_depth: usize, budget: &mut i32) -> Value {
+ *budget -= 1;
+ let role = self.role(bus, path).unwrap_or_default();
+ let props = self.props(bus, path);
+ let mut n = Map::new();
+ n.insert("r".into(), json!(role));
+ let name = props.get("Name").and_then(|v| v.downcast_ref::<&str>().ok()).filter(|s| !s.is_empty());
+ if let Some(x) = props.get("Description").and_then(|v| v.downcast_ref::<&str>().ok()).filter(|s| !s.is_empty()) {
+ n.insert("d".into(), json!(clip(x)));
+ }
+ if let Some(x) = name {
+ n.insert("t".into(), json!(clip(x)));
+ }
+ // what someone types is never copied
+ if text_role(&role) {
+ if let Some(x) = self.text(bus, path).filter(|x| !x.is_empty() && Some(x.as_str()) != name) {
+ n.insert("v".into(), json!(clip(&x)));
+ }
+ }
+ let attrs = self.attrs(bus, path);
+ if let Some(x) = attrs.get("id").filter(|s| !s.is_empty()) {
+ n.insert("i".into(), json!(x));
+ }
+ if let Some(x) = attrs.get("class") {
+ let classes: Vec<&str> = x.split_whitespace().take(20).collect();
+ if !classes.is_empty() {
+ n.insert("c".into(), json!(classes));
+ }
+ }
+ if depth < max_depth && *budget > 0 {
+ let mut kids = Vec::new();
+ for (b, p) in self.children(bus, path) {
+ if *budget <= 0 {
+ break;
+ }
+ kids.push(self.node(&b, &p, depth + 1, max_depth, budget));
+ }
+ if !kids.is_empty() {
+ n.insert("k".into(), json!(kids));
+ }
+ }
+ Value::Object(n)
+ }
+
+ fn props(&self, bus: &str, path: &OwnedObjectPath) -> HashMap<String, OwnedValue> {
+ self.call(bus, path.as_str(), PROPERTIES, "GetAll", &(ACCESSIBLE,)).unwrap_or_default()
+ }
+
+ fn attrs(&self, bus: &str, path: &OwnedObjectPath) -> HashMap<String, String> {
+ self.call(bus, path.as_str(), ACCESSIBLE, "GetAttributes", &()).unwrap_or_default()
+ }
+
+ fn text(&self, bus: &str, path: &OwnedObjectPath) -> Option<String> {
+ self.call(bus, path.as_str(), TEXT, "GetText", &(0i32, -1i32)).ok()
+ }
+
+ fn call<B, R>(&self, dest: &str, path: &str, iface: &str, method: &str, body: &B) -> Result<R, String>
+ where
+ B: serde::ser::Serialize + zbus::zvariant::DynamicType,
+ R: for<'de> DynamicDeserialize<'de>,
+ {
+ let reply = self
+ .conn
+ .call_method(Some(dest), path, Some(iface), method, body)
+ .map_err(|e| e.to_string())?;
+ reply.body().deserialize().map_err(|e| e.to_string())
+ }
+}
+
+fn clip(s: &str) -> String {
+ let s = s.trim();
+ match s.char_indices().nth(MAX_TEXT) {
+ Some((i, _)) => s[..i].to_string(),
+ None => s.to_string(),
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn inputs_are_never_read_but_labels_are() {
+ for role in ["static", "label", "text", "paragraph", "heading", "link"] {
+ assert!(text_role(role), "{role}");
+ }
+ for role in ["entry text", "password text", "text field", "combo box", "document web", "push button"] {
+ assert!(!text_role(role), "{role}");
+ }
+ }
+
+ #[test]
+ fn a_window_is_a_frame_window_or_dialog() {
+ for role in ["frame", "window", "dialog"] {
+ assert!(window_role(role), "{role}");
+ }
+ for role in ["panel", "section", "page tab"] {
+ assert!(!window_role(role), "{role}");
+ }
+ }
+
+ #[test]
+ fn long_text_is_cut_like_the_mac_helper() {
+ assert_eq!(clip(" hi "), "hi");
+ let long = "a".repeat(400);
+ assert_eq!(clip(&long).chars().count(), MAX_TEXT);
+ }
+}
diff --git a/app/native/yogurt-system/src/calls.rs b/app/native/yogurt-system/src/calls.rs
new file mode 100644
index 00000000..32c9b3cf
--- /dev/null
+++ b/app/native/yogurt-system/src/calls.rs
@@ -0,0 +1,222 @@
+//! `yogurt-system call-watch MS ID...`: who is in a call and who is talking, as the call app shows it through
+//! AT-SPI, one JSON line per reading (the same shape as yogurt-mac's call-watch). Linux only.
+
+use std::fs;
+use std::io::Read;
+use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
+
+use serde_json::{json, Value};
+
+use crate::atspi::{window_role, A11y, App};
+
+/// what kind of window a call app has, from its id (detect.ts's names carry the app)
+#[derive(Clone, Copy, Debug, PartialEq)]
+enum Kind {
+ Zoom,
+ Teams,
+ Meet,
+}
+
+fn kind(id: &str) -> Kind {
+ let id = id.to_ascii_lowercase();
+ if id.contains("zoom") {
+ Kind::Zoom
+ } else if id.contains("teams") {
+ Kind::Teams
+ } else {
+ Kind::Meet
+ }
+}
+
+/// The watch: read the apps asked about every `every_ms`, until Yogurt closes stdin (or dies, which closes it too)
+pub fn watch(every_ms: u64, ids: &[String]) -> ! {
+ std::thread::spawn(|| {
+ let mut sink = Vec::new();
+ let _ = std::io::stdin().read_to_end(&mut sink);
+ std::process::exit(0);
+ });
+ let every = every_ms.max(100);
+ // the bus is found and connected once: a reading every 400 ms must not pay for a handshake each time
+ let mut a11y: Option<A11y> = None;
+ let mut complained = false;
+ loop {
+ let started = Instant::now();
+ if a11y.is_none() {
+ match A11y::connect() {
+ Ok(a) => {
+ a11y = Some(a);
+ complained = false;
+ }
+ Err(e) => {
+ if !complained {
+ eprintln!("call-watch: {e}");
+ complained = true;
+ }
+ }
+ }
+ }
+ let line = match &a11y {
+ Some(a) => match read_once(a, ids) {
+ Ok(v) => v,
+ Err(e) => {
+ if !complained {
+ eprintln!("call-watch: {e}");
+ complained = true;
+ }
+ a11y = None;
+ json!({ "t": now_ms(), "error": "no-accessibility" })
+ }
+ },
+ None => json!({ "t": now_ms(), "error": "no-accessibility" }),
+ };
+ crate::out(line);
+ // a slow app (a big page) is read less often, so the reading never takes much of the computer
+ let took = started.elapsed().as_millis() as u64;
+ std::thread::sleep(Duration::from_millis(every.max(took * 2).saturating_sub(took)));
+ }
+}
+
+fn read_once(a11y: &A11y, ids: &[String]) -> Result<Value, String> {
+ let t = now_ms();
+ let apps = a11y.apps()?;
+ let mut seen = false;
+ for app in &apps {
+ let Some(pid) = a11y.pid(&app.bus) else { continue };
+ let Some(id) = matched_id(pid, ids) else { continue };
+ seen = true;
+ let kind = kind(&id);
+ let windows = windows(a11y, app, kind);
+ if !windows.is_empty() {
+ return Ok(json!({ "t": t, "app": id, "windows": windows }));
+ }
+ }
+ Ok(if seen {
+ json!({ "t": t, "error": "no-call-window" })
+ } else {
+ json!({ "t": t, "error": "not-running" })
+ })
+}
+
+/// The call windows of one app, in the shape src/main/callNames/parse.ts reads
+fn windows(a11y: &A11y, app: &App, kind: Kind) -> Vec<Value> {
+ let mut budget: i32 = if kind == Kind::Zoom { 1500 } else { 4000 };
+ let max_depth = if kind == Kind::Zoom { 14 } else { 40 };
+ let mut out = Vec::new();
+ for (bus, path) in a11y.children(&app.bus, &app.path) {
+ if out.len() == 4 || budget <= 0 {
+ break;
+ }
+ let Some(role) = a11y.role(&bus, &path) else { continue };
+ if !window_role(&role) {
+ continue;
+ }
+ let title = a11y.name(&bus, &path).unwrap_or_default();
+ if !call_window(kind, &title) {
+ continue;
+ }
+ let tree = a11y.node(&bus, &path, 0, max_depth, &mut budget);
+ out.push(json!({ "title": title, "tree": tree }));
+ }
+ out
+}
+
+/// Whether a window holds the call: a browser only when its front tab is a Meet call, Zoom only a meeting
+fn call_window(kind: Kind, title: &str) -> bool {
+ match kind {
+ Kind::Teams => true,
+ Kind::Zoom => title.starts_with("Zoom Meeting") || title.starts_with("Zoom Webinar"),
+ Kind::Meet => has_word(title, "meet"),
+ }
+}
+
+/// "Meet - abc-defg-hij" has the word; "Meeting notes" does not
+fn has_word(title: &str, word: &str) -> bool {
+ title.split(|c: char| !c.is_alphanumeric()).any(|w| w.eq_ignore_ascii_case(word))
+}
+
+/// The id asked about that this process is: its Flatpak app id, else its program name
+fn matched_id(pid: u32, ids: &[String]) -> Option<String> {
+ if let Some(flatpak) = flatpak_id(pid) {
+ if let Some(id) = ids.iter().find(|id| **id == flatpak) {
+ return Some(id.clone());
+ }
+ }
+ let program = program_name(pid)?;
+ ids.iter().find(|id| **id == program).cloned()
+}
+
+/// A Flatpak app runs in its own cgroup: app-flatpak-com.example.App-<instance>.scope
+fn flatpak_id(pid: u32) -> Option<String> {
+ let cgroup = fs::read_to_string(format!("/proc/{pid}/cgroup")).ok()?;
+ flatpak_id_from_cgroup(&cgroup)
+}
+
+fn flatpak_id_from_cgroup(cgroup: &str) -> Option<String> {
+ for line in cgroup.lines() {
+ let Some(rest) = line.split("app-flatpak-").nth(1) else { continue };
+ let id = rest.rsplit_once('-').map(|(id, _)| id).unwrap_or(rest);
+ let id = id.strip_suffix(".scope").unwrap_or(id);
+ if !id.is_empty() {
+ return Some(id.to_string());
+ }
+ }
+ None
+}
+
+/// The program's file name: /app/teams-for-linux/teams-for-linux, /usr/lib/firefox/firefox
+fn program_name(pid: u32) -> Option<String> {
+ let cmd = fs::read(format!("/proc/{pid}/cmdline")).ok()?;
+ program_name_of(&cmd).or_else(|| fs::read_to_string(format!("/proc/{pid}/comm")).ok().map(|s| s.trim().to_string()))
+}
+
+fn program_name_of(cmdline: &[u8]) -> Option<String> {
+ let first = cmdline.split(|b| *b == 0).next()?;
+ let first = String::from_utf8_lossy(first);
+ let base = first.rsplit('/').next().unwrap_or("");
+ (!base.is_empty()).then(|| base.to_string())
+}
+
+fn now_ms() -> u64 {
+ SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_millis() as u64).unwrap_or(0)
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn the_kind_comes_from_the_id() {
+ assert_eq!(kind("us.zoom.xos"), Kind::Zoom);
+ assert_eq!(kind("zoom"), Kind::Zoom);
+ assert_eq!(kind("com.microsoft.teams2"), Kind::Teams);
+ assert_eq!(kind("teams-for-linux"), Kind::Teams);
+ assert_eq!(kind("com.github.IsmaelMartinez.teams_for_linux"), Kind::Teams);
+ assert_eq!(kind("com.google.Chrome"), Kind::Meet);
+ assert_eq!(kind("firefox"), Kind::Meet);
+ }
+
+ #[test]
+ fn a_browser_window_is_a_call_only_with_the_word_meet() {
+ assert!(call_window(Kind::Meet, "Meet - abc-defg-hij - Google Chrome"));
+ assert!(call_window(Kind::Meet, "meet.google.com"));
+ assert!(!call_window(Kind::Meet, "Meeting notes - Google Chrome"));
+ assert!(call_window(Kind::Zoom, "Zoom Meeting"));
+ assert!(call_window(Kind::Zoom, "Zoom Webinar - 123"));
+ assert!(!call_window(Kind::Zoom, "Zoom Workplace"));
+ assert!(call_window(Kind::Teams, "Chat | Microsoft Teams"));
+ }
+
+ #[test]
+ fn a_flatpak_id_comes_from_the_cgroup() {
+ let line = "0::/user.slice/user-1000.slice/[email protected]/app.slice/app-flatpak-com.github.IsmaelMartinez.teams_for_linux-1512112203.scope";
+ assert_eq!(flatpak_id_from_cgroup(line).as_deref(), Some("com.github.IsmaelMartinez.teams_for_linux"));
+ assert_eq!(flatpak_id_from_cgroup("0::/user.slice/user-1000.slice/session-3.scope"), None);
+ }
+
+ #[test]
+ fn the_program_name_is_the_file_name() {
+ assert_eq!(program_name_of(b"/app/teams-for-linux/teams-for-linux\0--ozone-platform=wayland\0").as_deref(), Some("teams-for-linux"));
+ assert_eq!(program_name_of(b"/usr/lib/firefox/firefox\0").as_deref(), Some("firefox"));
+ assert_eq!(program_name_of(b"\0"), None);
+ }
+}
diff --git a/app/native/yogurt-system/src/main.rs b/app/native/yogurt-system/src/main.rs
index c70afb0f..ab9a9ebe 100644
--- a/app/native/yogurt-system/src/main.rs
+++ b/app/native/yogurt-system/src/main.rs
@@ -4,6 +4,7 @@
//! mic-apps [{"bundleId","name","pid"}] for each app recording from a microphone now
//! running-apps ID... the IDs that have a running process
//! browser-title ID {"title": the app's front window title, or null}
+//! call-watch MS ID... Linux: one JSON line every MS with the call app's windows (yogurt-mac's call-watch)
//!
//! IDs are the program's file name: "zoom.exe" (lowercased) on Windows, "zoom" or a Flatpak app id on Linux.
@@ -11,6 +12,10 @@
#[allow(dead_code)]
mod parse;
+#[cfg(target_os = "linux")]
+mod atspi;
+#[cfg(target_os = "linux")]
+mod calls;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(windows)]
@@ -46,6 +51,14 @@ fn main() {
}
out(json!({ "title": os::window_title(&args[1]) }))
}
- _ => fail("yogurt-system mic-apps | running-apps APP_ID... | browser-title APP_ID"),
+ #[cfg(target_os = "linux")]
+ Some("call-watch") => {
+ if args.len() < 3 {
+ fail("call-watch MS APP_ID...")
+ }
+ let every = args[1].parse::<u64>().unwrap_or(400);
+ calls::watch(every, &args[2..])
+ }
+ _ => fail("yogurt-system mic-apps | running-apps APP_ID... | browser-title APP_ID | call-watch MS APP_ID..."),
}
}
diff --git a/app/src/main/callNames/index.ts b/app/src/main/callNames/index.ts
index 78a0ceea..7e547f47 100644
--- a/app/src/main/callNames/index.ts
+++ b/app/src/main/callNames/index.ts
@@ -5,25 +5,27 @@ import { readCall, summarize, type AxWindow, type CallKind } from './parse'
/**
* Names from the call: while a meeting records, the call app it is in (Zoom, Teams, Meet in a browser) is read through
- * macOS Accessibility about twice a second, and each line of the other side is named after the person the app shows
- * talking, or the only other person in the call. The mic is always You. Without the permission, in another app, or
- * when the app shows nothing clear, lines of the other side are Them. Nothing is guessed, and nothing leaves the Mac.
+ * the accessibility tree about twice a second (macOS Accessibility, AT-SPI on Linux), and each line of the other side
+ * is named after the person the app shows talking, or the only other person in the call. The mic is always You.
+ * Without the permission, in another app, or when the app shows nothing clear, lines of the other side are Them.
+ * Nothing is guessed, and nothing leaves the computer.
*/
/** what yogurt-mac call-watch prints each time it reads: the call windows, or why it could not */
export type WatchLine = { t: number; app?: string; windows?: AxWindow[]; error?: string }
export type Watch = (ids: string[], onLine: (l: WatchLine) => void) => { stop(): void }
-/** the call apps that can be read, by the name meeting detection gives them (detect.ts), and the kind of window each has */
+/** the call apps that can be read, by the name meeting detection gives them (detect.ts), and the kind of window each
+ * has. A Mac's ids are bundle ids; Linux's are program names or Flatpak app ids. */
const APPS: Record<string, { kind: CallKind; ids: string[] }> = {
- Zoom: { kind: 'zoom', ids: ['us.zoom.xos'] },
- Teams: { kind: 'teams', ids: ['com.microsoft.teams2', 'com.microsoft.teams'] },
- Chrome: { kind: 'meet', ids: ['com.google.Chrome'] },
+ Zoom: { kind: 'zoom', ids: ['us.zoom.xos', 'zoom', 'us.zoom.Zoom'] },
+ Teams: { kind: 'teams', ids: ['com.microsoft.teams2', 'com.microsoft.teams', 'teams-for-linux', 'com.github.IsmaelMartinez.teams_for_linux'] },
+ Chrome: { kind: 'meet', ids: ['com.google.Chrome', 'chrome', 'google-chrome'] },
Arc: { kind: 'meet', ids: ['company.thebrowser.Browser'] },
- Brave: { kind: 'meet', ids: ['com.brave.Browser'] },
- Edge: { kind: 'meet', ids: ['com.microsoft.edgemac'] },
+ Brave: { kind: 'meet', ids: ['com.brave.Browser', 'brave'] },
+ Edge: { kind: 'meet', ids: ['com.microsoft.edgemac', 'msedge', 'com.microsoft.Edge'] },
Safari: { kind: 'meet', ids: ['com.apple.Safari'] },
- Firefox: { kind: 'meet', ids: ['org.mozilla.firefox'] },
+ Firefox: { kind: 'meet', ids: ['org.mozilla.firefox', 'firefox', 'firefox-bin'] },
}
/** The apps to read for a meeting: the one it was detected in; with none (started by hand) any of them, the frontmost with a call first */
export const watchIds = (app: string | null): string[] => (app ? APPS[app]?.ids ?? [] : Object.values(APPS).flatMap((a) => a.ids))
diff --git a/app/src/main/callNames/parse.ts b/app/src/main/callNames/parse.ts
index 2c0a7d74..57932d47 100644
--- a/app/src/main/callNames/parse.ts
+++ b/app/src/main/callNames/parse.ts
@@ -1,7 +1,8 @@
/**
* What a call app's window says about who is in the call and who is talking, read from its accessibility tree
- * (yogurt-mac call-watch copies the tree out; this reads it). Every rule fails towards reading nothing, so a changed
- * app means Them, never a wrong name. The signals each app gives, and how sure we are of them, are in the comments.
+ * (yogurt-mac call-watch copies it out on a Mac, yogurt-system on Linux; this reads either). Every rule fails towards
+ * reading nothing, so a changed app means Them, never a wrong name. The signals each app gives, and how sure we are of
+ * them, are in the comments.
*/
/** one element of the tree as the helper copies it: role, subrole, description, title, value, identifier, DOM classes, size */
@@ -10,6 +11,13 @@ export type AxWindow = { title?: string; id?: string; tree: AxNode }
export type CallKind = 'zoom' | 'teams' | 'meet'
export type CallReading = { speaking: string[]; participants: string[]; me: string | null }
+// A role has two names: macOS Accessibility says AXTabGroup, AXStaticText, AXRow, AXOutline; AT-SPI (Linux) says
+// page tab, label/static/text, table row/list item, tree table/table/list. The rules below know both.
+const TAB_GROUP = new Set(['AXTabGroup', 'page tab'])
+const STATIC_TEXT = new Set(['AXStaticText', 'static', 'label', 'text', 'paragraph', 'heading', 'caption'])
+const ROW = new Set(['AXRow', 'table row', 'list item', 'row'])
+const OUTLINE = new Set(['AXOutline', 'tree table', 'table', 'list', 'list box', 'outline', 'tree'])
+
const uniq = (xs: string[]) => [...new Map(xs.map((x) => [x.toLocaleLowerCase(), x])).values()]
const walk = (n: AxNode, fn: (n: AxNode, up: AxNode[]) => void, up: AxNode[] = []) => {
fn(n, up)
@@ -75,19 +83,22 @@ function readZoom(windows: AxWindow[]): CallReading {
let me: string | null = null
for (const w of windows) {
walk(w.tree, (n, up) => {
- if (n.r === 'AXTabGroup' && n.d) {
+ if (TAB_GROUP.has(n.r) && n.d) {
const tile = zoomTile(n.d)
if (tile) { participants.push(tile.name); if (tile.talking) speaking.push(tile.name) }
}
- // the floating window's "Talking: Name"
- if (n.r === 'AXStaticText' && n.v) {
- const v = n.v.normalize('NFKC')
- for (const key of TALKING) if (v.startsWith(key)) { const name = cleanZoom(v.slice(key.length).replace(/^\s*[::]\s*/, '')); if (name) speaking.push(name) }
+ // the floating window's "Talking: Name"; AT-SPI labels carry it as their name
+ if (STATIC_TEXT.has(n.r)) {
+ for (const raw of [n.v, n.t]) {
+ if (!raw) continue
+ const v = raw.normalize('NFKC')
+ for (const key of TALKING) if (v.startsWith(key)) { const name = cleanZoom(v.slice(key.length).replace(/^\s*[::]\s*/, '')); if (name) speaking.push(name) }
+ }
}
// a row of the participants list: its first text is the name, "(me)" on the person using Yogurt
- if (n.r === 'AXRow' && up.some((a) => a.r === 'AXOutline' && LISTS.has(low(a.d ?? a.t ?? '')))) {
+ if (ROW.has(n.r) && up.some((a) => OUTLINE.has(a.r) && LISTS.has(low(a.d ?? a.t ?? '')))) {
let text: string | undefined
- walk(n, (x) => { if (!text && x.r === 'AXStaticText' && x.v) text = x.v })
+ walk(n, (x) => { if (!text && STATIC_TEXT.has(x.r)) text = x.v ?? x.t })
if (!text) return
const name = cleanZoom(text)
if (!name) return
@@ -123,8 +134,10 @@ function readMeet(windows: AxWindow[], o: { talkingClasses?: string[] }): CallRe
if (w.title && !/\bMeet\b/.test(w.title)) continue
const skip = new Set((w.title ?? '').split(/\s+[-–—]\s+/).map(low))
walk(w.tree, (n, up) => {
- if (n.r !== 'AXStaticText' || !n.v || up.length < TILE_UP) return
- const name = meetName(n.v)
+ if (!STATIC_TEXT.has(n.r) || up.length < TILE_UP) return
+ const text = n.v ?? n.t
+ if (!text) return
+ const name = meetName(text)
if (!name || skip.has(low(name))) return
const root = up[up.length - TILE_UP]
groups.set(root, [...(groups.get(root) ?? []), name])
@@ -146,16 +159,31 @@ function readMeet(windows: AxWindow[], o: { talkingClasses?: string[] }): CallRe
}
// ---- Microsoft Teams (new Teams, com.microsoft.teams2, and classic) ----
-// No measured tree to go on: Teams draws its talking ring as a style with no words.
-// What is read is words only: an element labelled "Name, speaking" / "Name is speaking" / "Active speaker: Name",
-// tiles labelled "Name, muted" / "Name, unmuted" / "Name, video on", and "(You)" after the person's own name in
-// the people list. Low confidence until a real call's tree is seen (each recording logs a summary of it).
+// Measured on Teams for Linux 2.28.0 (AT-SPI, Plasma Wayland): the People panel's "Attendees" tree has rows
+// "Name, Role, Muted|Unmuted" ("Dana Smith, Organizer, Unmuted"), and the row's section repeats it. Teams marks the
+// active speaker only with a ring: no word and no class in the tree. What is read is words only: those roster rows,
+// an element labelled "Name, speaking" / "Name is speaking" / "Active speaker: Name" (other builds), and "(You)"
+// after the person's own name. When the roster is closed and nobody is marked, only a call of two can be named
+// (attribute.ts).
const TEAMS_SPEAKING = [/^(.{2,60}?)(?:,\s*|\s+is\s+)(?:speaking|talking)\b/i, /\b(?:active speaker|now speaking|speaking now)[:,]?\s+(.{2,60})$/i]
-const TEAMS_TILE = /^(.{2,60}?),\s*(?:muted|unmuted|mic(?:rophone)? (?:on|off)|video (?:is )?(?:on|off)|camera (?:is )?(?:on|off))\b/i
+/** the state Teams puts after a person in the roster; the role ("Organizer", "Presenter", ...) may sit between */
+const TEAMS_STATUS = /^(?:muted|unmuted|mic(?:rophone)? (?:on|off)|video (?:is )?(?:on|off)|camera (?:is )?(?:on|off))$/i
+const TEAMS_SAYS = /^(?:speaking|talking|active speaker|now speaking)$/i
const TEAMS_ME = /^(.{2,60}?)\s*\((?:you|me)\)/i
const cleanTeams = (s: string) => s.replace(/\s*\((?:organizer|presenter|guest|external|you|me)\)/gi, '').replace(/[,.:;]+$/, '').trim()
+/** "Dana Smith, Organizer, Unmuted" → Dana Smith; null when the label is not a person with a state */
+function teamsPersona(label: string): { name: string; speaking: boolean } | null {
+ const fields = label.normalize('NFKC').split(/\s*,\s*/)
+ if (fields.length < 2) return null
+ const name = cleanTeams(fields[0])
+ if (name.length < 2 || name.length > 60) return null
+ const rest = fields.slice(1)
+ if (!rest.some((f) => TEAMS_STATUS.test(f))) return null
+ return { name, speaking: rest.some((f) => TEAMS_SAYS.test(f)) }
+}
+
function readTeams(windows: AxWindow[]): CallReading {
const speaking: string[] = [], participants: string[] = []
let me: string | null = null
@@ -163,8 +191,8 @@ function readTeams(windows: AxWindow[]): CallReading {
walk(w.tree, (n) => {
for (const label of texts(n)) {
for (const re of TEAMS_SPEAKING) { const m = re.exec(label); if (m) { const name = cleanTeams(m[1]); if (name.length >= 2 && !/^(you|me)\b/i.test(name)) speaking.push(name) } }
- const tile = TEAMS_TILE.exec(label)
- if (tile) participants.push(cleanTeams(tile[1]))
+ const persona = teamsPersona(label)
+ if (persona) { participants.push(persona.name); if (persona.speaking) speaking.push(persona.name) }
const mine = TEAMS_ME.exec(label)
if (mine) { me = cleanTeams(mine[1]); participants.push(me) }
}
diff --git a/app/src/main/callNames/watch.ts b/app/src/main/callNames/watch.ts
index 5e92b53a..19f40210 100644
--- a/app/src/main/callNames/watch.ts
+++ b/app/src/main/callNames/watch.ts
@@ -7,7 +7,7 @@ import { WATCH_EVERY_MS, type Watch, type WatchLine } from './index'
const running = new Set<ChildProcess>()
export const killAllWatches = () => { for (const c of running) c.kill('SIGKILL'); running.clear() }
-/** yogurt-mac call-watch: one JSON line per reading of the call app, until its stdin is closed */
+/** yogurt-mac call-watch (or yogurt-system on Linux): one JSON line per reading of the call app, until its stdin is closed */
export const helperWatch = (binary: () => string): Watch => (ids, onLine) => {
const child = spawn(binary(), ['call-watch', String(WATCH_EVERY_MS), ...ids], { stdio: ['pipe', 'pipe', 'pipe'] })
running.add(child)
@@ -17,7 +17,7 @@ export const helperWatch = (binary: () => string): Watch => (ids, onLine) => {
try { onLine(JSON.parse(l) as WatchLine) } catch { /* a cut line: the next reading comes soon */ }
})
child.stderr.on('data', () => {})
- child.on('error', (e) => console.error('call names: yogurt-mac call-watch failed', e))
+ child.on('error', (e) => console.error('call names: the call watch failed', e))
child.on('exit', () => running.delete(child))
return {
stop() {
diff --git a/app/src/shared/platform.ts b/app/src/shared/platform.ts
index 8d44ab49..09c2bf23 100644
--- a/app/src/shared/platform.ts
+++ b/app/src/shared/platform.ts
@@ -24,7 +24,8 @@ export type Capabilities = {
export function capabilities(platform: string): Capabilities {
const mac = platform === 'darwin'
- return { calendar: mac, callNames: mac, permissionPrompts: mac, mediaPause: mac }
+ // Linux reads call names through AT-SPI (yogurt-system call-watch), the same WatchLine JSON as the Mac
+ return { calendar: mac, callNames: mac || platform === 'linux', permissionPrompts: mac, mediaPause: mac }
}
/** The computer Yogurt runs on. Only fake mode may pretend to be another one (YOGURT_FAKE_PLATFORM), so Mac tests can try the others' screens. */
diff --git a/app/test/callNames.test.ts b/app/test/callNames.test.ts
index 5f197ab5..5a6987a8 100644
--- a/app/test/callNames.test.ts
+++ b/app/test/callNames.test.ts
@@ -49,14 +49,15 @@ function setup(o: { app?: string | null; attendees?: Meeting['attendees'] } = {}
const wait = () => new Promise((r) => setTimeout(r, 10))
describe('watchIds: only the call app the meeting is in', () => {
- it('maps the detected app to its bundle ids; no app known: every call app (the frontmost with a call is read)', () => {
- expect(watchIds('Zoom')).toEqual(['us.zoom.xos'])
- expect(watchIds('Teams')).toEqual(['com.microsoft.teams2', 'com.microsoft.teams'])
- expect(watchIds('Chrome')).toEqual(['com.google.Chrome'])
+ it('maps the detected app to its ids (bundle ids on a Mac, program names and Flatpak ids on Linux); no app known: every call app (the first with a call is read)', () => {
+ expect(watchIds('Zoom')).toEqual(['us.zoom.xos', 'zoom', 'us.zoom.Zoom'])
+ expect(watchIds('Teams')).toEqual(['com.microsoft.teams2', 'com.microsoft.teams', 'teams-for-linux', 'com.github.IsmaelMartinez.teams_for_linux'])
+ expect(watchIds('Chrome')).toEqual(['com.google.Chrome', 'chrome', 'google-chrome'])
expect(watchIds('Safari')).toEqual(['com.apple.Safari'])
expect(watchIds('FaceTime')).toEqual([])
expect(watchIds(null)).toContain('us.zoom.xos')
expect(watchIds(null)).toContain('org.mozilla.firefox')
+ expect(watchIds(null)).toContain('teams-for-linux')
})
})
@@ -74,7 +75,7 @@ describe('hookCallNames', () => {
it('reads the meeting\'s app while it records, and a line of the other side gets the name talking then', () => {
const s = setup()
s.start()
- expect(s.watched).toEqual([['us.zoom.xos']])
+ expect(s.watched).toEqual([['us.zoom.xos', 'zoom', 'us.zoom.Zoom']])
// meeting time 0 was heard at 1_005_000 (the 100 ms of audio arrived 100 ms after it started)
s.audio(0, 1_005_100)
for (let t = 1_006_000; t < 1_014_000; t += 500) s.emit(zoomLine(t, ['Alex Morgan', 'Dana Smith', 'Ann Lee'], t < 1_010_000 ? 'Dana Smith' : 'Ann Lee'))
diff --git a/app/test/callParse.test.ts b/app/test/callParse.test.ts
index a0674a67..d1d33ebe 100644
--- a/app/test/callParse.test.ts
+++ b/app/test/callParse.test.ts
@@ -47,6 +47,14 @@ describe('Zoom', () => {
const r = readCall('zoom', [win(node('AXWindow', {}, node('AXGroup', { d: 'Dana Smith' }), node('AXTabGroup', { d: 'Chat' }), node('AXStaticText', { v: 'Dana Smith' })))])
expect(r).toEqual({ speaking: [], participants: [], me: null })
})
+
+ it('reads the same signals from AT-SPI roles (Linux): page tab, label, table row, tree table', () => {
+ const tree = node('frame', { t: 'Zoom Meeting' },
+ node('page tab', { d: 'Ana Ruiz, Computer audio unmuted, Active speaker' }),
+ node('label', { t: 'Talking: Ann Lee' }),
+ node('tree table', { t: 'Participants list' }, node('table row', {}, node('label', { t: 'Alex Morgan (me)' }))))
+ expect(readCall('zoom', [win(tree)])).toEqual({ speaking: ['Ana Ruiz', 'Ann Lee'], participants: ['Ana Ruiz', 'Alex Morgan'], me: 'Alex Morgan' })
+ })
})
// ---- Google Meet in a browser: names as text in each tile, the talking tile marked by a class ----
@@ -95,6 +103,44 @@ describe('Microsoft Teams', () => {
const tree = node('AXWindow', {}, node('AXStaticText', { v: 'You are speaking' }), node('AXButton', { d: 'Mic on' }))
expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: [], me: null })
})
+
+ it('reads AT-SPI names as well as descriptions (Linux)', () => {
+ const tree = node('frame', {},
+ node('section', { t: 'Dana Smith, speaking' }),
+ node('section', { t: 'Ann Lee, muted' }))
+ expect(readCall('teams', [win(tree)])).toEqual({ speaking: ['Dana Smith'], participants: ['Ann Lee'], me: null })
+ })
+
+ it('reads the People panel roster (Teams for Linux): "Name, Role, Muted|Unmuted"', () => {
+ const tree = node('frame', { t: 'Meeting | Microsoft Teams' },
+ node('landmark', { t: 'Participants' },
+ node('tree', { t: 'Attendees' },
+ node('tree item', { t: 'Dana Smith, Organizer, Unmuted' },
+ node('section', { t: 'Dana Smith, Organizer, Unmuted' },
+ node('section', { t: 'Dana Smith' },
+ node('static', { t: 'Dana Smith' }),
+ node('static', { t: 'Organizer' }),
+ node('image', { t: 'Unmuted' })))))))
+ expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: ['Dana Smith'], me: null })
+ })
+
+ it('reads every roster row, with a role between the name and the state, and never the group header', () => {
+ const tree = node('frame', {},
+ node('tree', { t: 'Attendees' },
+ node('tree item', { t: 'Dana Smith, Organizer, Unmuted' }),
+ node('tree item', { t: 'Alex Morgan, Presenter, Muted' }),
+ node('tree item', { t: 'Sam Lee, Guest, Unmuted' }),
+ node('tree item', { t: 'In this meeting, 3 total' })))
+ expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: ['Dana Smith', 'Alex Morgan', 'Sam Lee'], me: null })
+ })
+
+ it('a roster row marked (You) is the person using Yogurt', () => {
+ const tree = node('frame', {},
+ node('tree', { t: 'Attendees' },
+ node('tree item', { t: 'Dana Smith (You), Organizer, Unmuted' }),
+ node('tree item', { t: 'Alex Morgan, Presenter, Unmuted' })))
+ expect(readCall('teams', [win(tree)])).toEqual({ speaking: [], participants: ['Dana Smith', 'Alex Morgan'], me: 'Dana Smith' })
+ })
})
describe('summarize: a short picture of the tree for the log', () => {
diff --git a/app/test/platform.test.ts b/app/test/platform.test.ts
index 2a317bd3..744f7f1a 100644
--- a/app/test/platform.test.ts
+++ b/app/test/platform.test.ts
@@ -6,8 +6,9 @@ describe('what each computer can do', () => {
it('a Mac has every feature, exactly as before', () => {
expect(capabilities('darwin')).toEqual({ calendar: true, callNames: true, permissionPrompts: true, mediaPause: true })
})
- it('Windows and Linux have no calendar, no names from calls (yet) and nothing to ask permission for up front', () => {
- for (const p of ['win32', 'linux']) expect(capabilities(p)).toEqual({ calendar: false, callNames: false, permissionPrompts: false, mediaPause: false })
+ it('Windows has no calendar and no names from calls; Linux reads names through AT-SPI', () => {
+ expect(capabilities('win32')).toEqual({ calendar: false, callNames: false, permissionPrompts: false, mediaPause: false })
+ expect(capabilities('linux')).toEqual({ calendar: false, callNames: true, permissionPrompts: false, mediaPause: false })
})
it('only fake mode can pretend to be another computer, so the Mac CI can try the Windows and Linux screens', () => {
expect(platformOf('darwin', { YOGURT_FAKE: '1', YOGURT_FAKE_PLATFORM: 'win32' })).toBe('win32')
@@ -41,6 +42,9 @@ describe('permissions to ask for', () => {
it('without a calendar or names from calls, those are never asked', () => {
expect(supportedKinds(capabilities('win32'))).toEqual(['mic', 'systemAudio', 'notifications'])
})
+ it('Linux keeps accessibility in the list (it has no prompt for it)', () => {
+ expect(supportedKinds(capabilities('linux'))).toEqual(['mic', 'systemAudio', 'notifications', 'accessibility'])
+ })
})
describe('shortcuts', () => {