Add ratatui-based interactive chat UI for terminal sessions
If stdin is a terminal, launch a TUI chat interface using ratatui and crossterm instead of starting the ACP agent server.
Seto Elkahfi committed
Apr 14, 2026 at 21:41 UTC
1ab72bfc3b02b53d7132125e8a1d6b5b0967e6c1
3 files changed
+247
-94
Cargo.lock
+232
-94
index 6ab2b75..d19dc1f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -113,13 +113,12 @@ dependencies = [
[[package]]
name = "annotate-snippets"
-version = "0.12.15"
+version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92570a3f9c98e7e84df84b71d0965ac99b1871fcd75a3773a3bd1bad13f64cf7"
+checksum = "96401ca08501972288ecbcde33902fce858bf73fbcbdf91dab8c3a9544e106bb"
dependencies = [
"anstyle",
- "memchr",
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
]
[[package]]
@@ -477,9 +476,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.11.0"
+version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
+checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
[[package]]
name = "bitstream-io"
@@ -725,6 +724,12 @@ dependencies = [
"thiserror 2.0.18",
]
+[[package]]
+name = "cassowary"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
+
[[package]]
name = "castaway"
version = "0.2.4"
@@ -879,6 +884,20 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "compact_str"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32"
+dependencies = [
+ "castaway",
+ "cfg-if",
+ "itoa",
+ "rustversion",
+ "ryu",
+ "static_assertions",
+]
+
[[package]]
name = "compact_str"
version = "0.9.0"
@@ -912,7 +931,7 @@ dependencies = [
"encode_unicode",
"libc",
"once_cell",
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
"windows-sys 0.59.0",
]
@@ -924,7 +943,7 @@ checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87"
dependencies = [
"encode_unicode",
"libc",
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
"windows-sys 0.61.2",
]
@@ -1036,15 +1055,34 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "crossterm"
-version = "0.25.0"
+version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67"
+checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags 2.11.1",
"crossterm_winapi",
- "libc",
- "mio 0.8.11",
+ "mio",
"parking_lot",
+ "rustix 0.38.44",
+ "signal-hook",
+ "signal-hook-mio",
+ "winapi",
+]
+
+[[package]]
+name = "crossterm"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b"
+dependencies = [
+ "bitflags 2.11.1",
+ "crossterm_winapi",
+ "derive_more",
+ "document-features",
+ "futures-core",
+ "mio",
+ "parking_lot",
+ "rustix 1.1.4",
"signal-hook",
"signal-hook-mio",
"winapi",
@@ -1376,7 +1414,7 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"block2",
"objc2",
]
@@ -1398,6 +1436,15 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2db04e74f0a9a93103b50e90b96024c9b2bdca8bce6a632ec71b88736d3d359"
+[[package]]
+name = "document-features"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61"
+dependencies = [
+ "litrs",
+]
+
[[package]]
name = "dtoa"
version = "1.0.11"
@@ -2143,7 +2190,7 @@ version = "0.2.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df"
dependencies = [
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
]
[[package]]
@@ -2366,7 +2413,7 @@ dependencies = [
"html5ever 0.38.0",
"tendril 0.5.0",
"thiserror 2.0.18",
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
]
[[package]]
@@ -2701,7 +2748,7 @@ dependencies = [
"console 0.15.11",
"number_prefix",
"portable-atomic",
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
"web-time",
]
@@ -2714,11 +2761,33 @@ dependencies = [
"console 0.16.3",
"portable-atomic",
"rayon",
- "unicode-width 0.2.2",
+ "unicode-width 0.2.0",
"unit-prefix",
"web-time",
]
+[[package]]
+name = "indoc"
+version = "2.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
+dependencies = [
+ "rustversion",
+]
+
+[[package]]
+name = "instability"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5eb2d60ef19920a3a9193c3e371f726ec1dafc045dac788d0fb3704272458971"
+dependencies = [
+ "darling 0.23.0",
+ "indoc",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "interpolate_name"
version = "0.2.4"
@@ -2765,6 +2834,15 @@ version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
+[[package]]
+name = "itertools"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
+dependencies = [
+ "either",
+]
+
[[package]]
name = "itertools"
version = "0.14.0"
@@ -2890,9 +2968,9 @@ checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"
[[package]]
name = "libc"
-version = "0.2.184"
+version = "0.2.185"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
+checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f"
[[package]]
name = "libfuzzer-sys"
@@ -2929,6 +3007,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "linux-raw-sys"
+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"
@@ -2941,6 +3025,12 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
+[[package]]
+name = "litrs"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"
+
[[package]]
name = "llguidance"
version = "1.7.2"
@@ -3008,6 +3098,15 @@ dependencies = [
"vob",
]
+[[package]]
+name = "lru"
+version = "0.12.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
+dependencies = [
+ "hashbrown 0.15.5",
+]
+
[[package]]
name = "lru-slab"
version = "0.1.2"
@@ -3124,7 +3223,7 @@ version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"block",
"core-graphics-types",
"foreign-types",
@@ -3186,18 +3285,6 @@ dependencies = [
"simd-adler32",
]
-[[package]]
-name = "mio"
-version = "0.8.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
-dependencies = [
- "libc",
- "log",
- "wasi",
- "windows-sys 0.48.0",
-]
-
[[package]]
name = "mio"
version = "1.2.0"
@@ -3205,6 +3292,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
dependencies = [
"libc",
+ "log",
"wasi",
"windows-sys 0.61.2",
]
@@ -3212,8 +3300,7 @@ dependencies = [
[[package]]
name = "mistralrs"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9bb0a83340b4492ebba9760ba6845364de369c7e10c1f91af8733d574c7405fa"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"anyhow",
"candle-core",
@@ -3240,8 +3327,7 @@ dependencies = [
[[package]]
name = "mistralrs-audio"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ac5d36f634c7c20c45845bc995be3b6387ab01048410386a5b180cfeaf89c72"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"anyhow",
"apodize",
@@ -3252,8 +3338,7 @@ dependencies = [
[[package]]
name = "mistralrs-core"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2b8b9e5c94491d9ceeded3a30291cb6af6ae74810a5776dd55e3bbb8b3429d4"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"ahash",
"akin",
@@ -3289,7 +3374,7 @@ dependencies = [
"indexmap 2.14.0",
"indicatif 0.18.4",
"interprocess",
- "itertools",
+ "itertools 0.14.0",
"libc",
"llguidance",
"lrtable",
@@ -3350,8 +3435,7 @@ dependencies = [
[[package]]
name = "mistralrs-macros"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aa9b4794322d3f89fe61d21f33f67be494c16d5bd869604b111218f32544d32"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"darling 0.23.0",
"proc-macro2",
@@ -3362,8 +3446,7 @@ dependencies = [
[[package]]
name = "mistralrs-mcp"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fa97d4e3189ed80ebbc730b7da5b2356df0ae004ab489066249340c33c089ab"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"anyhow",
"async-trait",
@@ -3383,8 +3466,7 @@ dependencies = [
[[package]]
name = "mistralrs-paged-attn"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e53ddf1537426997b46abdadbe6ca8a7ce7668004ed2b7cf00115016558bae8"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"anyhow",
"candle-core",
@@ -3400,8 +3482,7 @@ dependencies = [
[[package]]
name = "mistralrs-quant"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "980715493d252e9aaf0779c4c101576d67ef4dd9812bfd77a54987f6f17526f4"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"byteorder",
"candle-core",
@@ -3430,8 +3511,7 @@ dependencies = [
[[package]]
name = "mistralrs-vision"
version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10046a3da2de5b702d3e829b5ddef7aa829ad454819dcc4876dea481a6cb5456"
+source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#020dcbf8e2c4147c16bb015e89435811501baa28"
dependencies = [
"candle-core",
"image",
@@ -3683,7 +3763,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"dispatch2",
"objc2",
]
@@ -3700,7 +3780,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"block2",
"libc",
"objc2",
@@ -3723,7 +3803,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"block2",
"dispatch2",
"objc2",
@@ -3746,8 +3826,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
name = "onde"
version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "939495589fec914220491600a00bddedcba437e5fd5e3926ca1af2e8da681bb0"
+source = "git+https://github.com/ondeinference/onde?branch=development#0cf8325b4b9ebcc7278bfc29c5a3d229ab05d632"
dependencies = [
"anyhow",
"cc",
@@ -3769,7 +3848,7 @@ version = "6.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"libc",
"once_cell",
"onig_sys",
@@ -3963,7 +4042,7 @@ version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"crc32fast",
"fdeflate",
"flate2",
@@ -4319,6 +4398,27 @@ dependencies = [
"rand_core 0.9.5",
]
+[[package]]
+name = "ratatui"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
+dependencies = [
+ "bitflags 2.11.1",
+ "cassowary",
+ "compact_str 0.8.1",
+ "crossterm 0.28.1",
+ "indoc",
+ "instability",
+ "itertools 0.13.0",
+ "lru",
+ "paste",
+ "strum 0.26.3",
+ "unicode-segmentation",
+ "unicode-truncate",
+ "unicode-width 0.2.0",
+]
+
[[package]]
name = "rav1e"
version = "0.8.1"
@@ -4335,7 +4435,7 @@ dependencies = [
"built",
"cfg-if",
"interpolate_name",
- "itertools",
+ "itertools 0.14.0",
"libc",
"libfuzzer-sys",
"log",
@@ -4375,7 +4475,7 @@ version = "11.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
]
[[package]]
@@ -4401,7 +4501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2964d0cf57a3e7a06e8183d14a8b527195c706b7983549cd5462d5aa3747438f"
dependencies = [
"either",
- "itertools",
+ "itertools 0.14.0",
"rayon",
]
@@ -4442,7 +4542,7 @@ version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
]
[[package]]
@@ -4682,16 +4782,29 @@ dependencies = [
"transpose",
]
+[[package]]
+name = "rustix"
+version = "0.38.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
+dependencies = [
+ "bitflags 2.11.1",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.4.15",
+ "windows-sys 0.59.0",
+]
+
[[package]]
name = "rustix"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"errno",
"libc",
- "linux-raw-sys",
+ "linux-raw-sys 0.12.1",
"windows-sys 0.61.2",
]
@@ -4933,7 +5046,7 @@ version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"core-foundation 0.10.1",
"core-foundation-sys",
"libc",
@@ -4956,7 +5069,7 @@ version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "feef350c36147532e1b79ea5c1f3791373e61cbd9a6a2615413b3807bb164fb7"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"cssparser",
"derive_more",
"log",
@@ -5183,10 +5296,12 @@ dependencies = [
"agent-client-protocol",
"anyhow",
"async-trait",
+ "crossterm 0.29.0",
"env_logger",
"futures",
"log",
"onde",
+ "ratatui",
"tokio",
"tokio-util",
"uuid 1.23.0",
@@ -5209,7 +5324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc"
dependencies = [
"libc",
- "mio 0.8.11",
+ "mio",
"signal-hook",
]
@@ -5439,6 +5554,15 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "strum"
+version = "0.26.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
+dependencies = [
+ "strum_macros 0.26.4",
+]
+
[[package]]
name = "strum"
version = "0.27.2"
@@ -5457,6 +5581,19 @@ dependencies = [
"strum_macros 0.28.0",
]
+[[package]]
+name = "strum_macros"
+version = "0.26.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
+dependencies = [
+ "heck 0.5.0",
+ "proc-macro2",
+ "quote",
+ "rustversion",
+ "syn 2.0.117",
+]
+
[[package]]
name = "strum_macros"
version = "0.27.2"
@@ -5670,7 +5807,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01198a2debb237c62b6826ec7081082d951f46dbb64b0e8c7649a452230d1dfc"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"byteorder",
"enum-as-inner",
"libc",
@@ -5698,7 +5835,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"core-foundation 0.9.4",
"system-configuration-sys",
]
@@ -5722,7 +5859,7 @@ dependencies = [
"fastrand",
"getrandom 0.4.2",
"once_cell",
- "rustix",
+ "rustix 1.1.4",
"windows-sys 0.61.2",
]
@@ -5753,7 +5890,7 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874"
dependencies = [
- "rustix",
+ "rustix 1.1.4",
"windows-sys 0.61.2",
]
@@ -5902,13 +6039,13 @@ checksum = "a620b996116a59e184c2fa2dfd8251ea34a36d0a514758c6f966386bd2e03476"
dependencies = [
"ahash",
"aho-corasick",
- "compact_str",
+ "compact_str 0.9.0",
"dary_heap",
"derive_builder",
"esaxx-rs",
"fancy-regex 0.14.0",
"getrandom 0.3.4",
- "itertools",
+ "itertools 0.14.0",
"log",
"macro_rules_attribute",
"monostate",
@@ -5935,12 +6072,12 @@ checksum = "b238e22d44a15349529690fb07bd645cf58149a1b1e44d6cb5bd1641ff1a6223"
dependencies = [
"ahash",
"aho-corasick",
- "compact_str",
+ "compact_str 0.9.0",
"dary_heap",
"derive_builder",
"esaxx-rs",
"getrandom 0.3.4",
- "itertools",
+ "itertools 0.14.0",
"log",
"macro_rules_attribute",
"monostate",
@@ -5962,13 +6099,13 @@ dependencies = [
[[package]]
name = "tokio"
-version = "1.51.1"
+version = "1.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c"
+checksum = "a91135f59b1cbf38c91e73cf3386fca9bb77915c45ce2771460c9d92f0f3d776"
dependencies = [
"bytes",
"libc",
- "mio 1.2.0",
+ "mio",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
@@ -6121,7 +6258,7 @@ version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"bytes",
"futures-util",
"http",
@@ -6148,11 +6285,10 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tqdm"
version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b316d5c2ac649ca856dacd487d0ebb94f3b746bada51355d93dd2c007ab62a2e"
+source = "git+https://github.com/setoelkahfi/tqdm?branch=deps%2Fbump-crossterm#41e4182829136e6dadbdd1c36af824d19219147a"
dependencies = [
"anyhow",
- "crossterm",
+ "crossterm 0.29.0",
"once_cell",
]
@@ -6352,6 +6488,17 @@ version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c"
+[[package]]
+name = "unicode-truncate"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf"
+dependencies = [
+ "itertools 0.13.0",
+ "unicode-segmentation",
+ "unicode-width 0.1.14",
+]
+
[[package]]
name = "unicode-width"
version = "0.1.14"
@@ -6360,9 +6507,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]]
name = "unicode-width"
-version = "0.2.2"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
+checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
[[package]]
name = "unicode-xid"
@@ -6823,7 +6970,7 @@ version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
dependencies = [
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"hashbrown 0.15.5",
"indexmap 2.14.0",
"semver",
@@ -7118,15 +7265,6 @@ dependencies = [
"windows-targets 0.42.2",
]
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
[[package]]
name = "windows-sys"
version = "0.52.0"
@@ -7488,7 +7626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
dependencies = [
"anyhow",
- "bitflags 2.11.0",
+ "bitflags 2.11.1",
"indexmap 2.14.0",
"log",
"serde",
Cargo.toml
+4
index 79f6e89..212fbd6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,6 +24,10 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "io-std"
tokio-util = { version = "0.7", features = ["compat"] }
futures = "0.3"
+# TUI (interactive chat mode)
+ratatui = "0.29"
+crossterm = { version = "0.29", features = ["event-stream"] }
+
# Utilities
anyhow = "1"
log = "0.4"
src/main.rs
+11
index 65cd5e1..5fc18b7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -24,6 +24,7 @@
//! }
//! ```
+mod chat;
mod setup;
use std::sync::Arc;
@@ -198,6 +199,16 @@ async fn main() -> anyhow::Result<()> {
log::info!("model loaded and ready");
+ // If stdin is a terminal, run the interactive chat UI instead of the ACP agent.
+ if std::io::IsTerminal::is_terminal(&std::io::stdin()) {
+ log::info!("interactive mode — starting chat UI");
+ chat::run(&engine).await?;
+ log::info!("siGit shutting down");
+ return Ok(());
+ }
+
+ log::info!("ACP mode — starting agent server");
+
// ACP server
let (notification_tx, mut notification_rx) = mpsc::channel::<SessionNotification>(256);