anveesa 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +352 -5
- package/Cargo.toml +3 -1
- package/package.json +1 -1
- package/src/lib.rs +56 -5
- package/src/tui.rs +1122 -0
package/Cargo.lock
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
3
|
version = 4
|
|
4
4
|
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "allocator-api2"
|
|
7
|
+
version = "0.2.21"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
|
10
|
+
|
|
5
11
|
[[package]]
|
|
6
12
|
name = "anstream"
|
|
7
13
|
version = "1.0.0"
|
|
@@ -54,12 +60,14 @@ dependencies = [
|
|
|
54
60
|
|
|
55
61
|
[[package]]
|
|
56
62
|
name = "anveesa"
|
|
57
|
-
version = "0.3.
|
|
63
|
+
version = "0.3.7"
|
|
58
64
|
dependencies = [
|
|
59
65
|
"anyhow",
|
|
60
66
|
"base64",
|
|
61
67
|
"clap",
|
|
68
|
+
"crossterm",
|
|
62
69
|
"libc",
|
|
70
|
+
"ratatui",
|
|
63
71
|
"reqwest",
|
|
64
72
|
"rustyline",
|
|
65
73
|
"serde",
|
|
@@ -104,6 +112,21 @@ version = "1.11.1"
|
|
|
104
112
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
113
|
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
|
|
106
114
|
|
|
115
|
+
[[package]]
|
|
116
|
+
name = "cassowary"
|
|
117
|
+
version = "0.3.0"
|
|
118
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
119
|
+
checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
|
|
120
|
+
|
|
121
|
+
[[package]]
|
|
122
|
+
name = "castaway"
|
|
123
|
+
version = "0.2.4"
|
|
124
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
125
|
+
checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a"
|
|
126
|
+
dependencies = [
|
|
127
|
+
"rustversion",
|
|
128
|
+
]
|
|
129
|
+
|
|
107
130
|
[[package]]
|
|
108
131
|
name = "cc"
|
|
109
132
|
version = "1.2.62"
|
|
@@ -187,6 +210,79 @@ version = "1.0.5"
|
|
|
187
210
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
188
211
|
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
189
212
|
|
|
213
|
+
[[package]]
|
|
214
|
+
name = "compact_str"
|
|
215
|
+
version = "0.8.2"
|
|
216
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
217
|
+
checksum = "7fd622ebbb56a5b2ccb651b32b911cdeb2a9b4b11776b2473bf26a26a286244e"
|
|
218
|
+
dependencies = [
|
|
219
|
+
"castaway",
|
|
220
|
+
"cfg-if",
|
|
221
|
+
"itoa",
|
|
222
|
+
"rustversion",
|
|
223
|
+
"ryu",
|
|
224
|
+
"static_assertions",
|
|
225
|
+
]
|
|
226
|
+
|
|
227
|
+
[[package]]
|
|
228
|
+
name = "crossterm"
|
|
229
|
+
version = "0.28.1"
|
|
230
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
231
|
+
checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"
|
|
232
|
+
dependencies = [
|
|
233
|
+
"bitflags",
|
|
234
|
+
"crossterm_winapi",
|
|
235
|
+
"mio",
|
|
236
|
+
"parking_lot",
|
|
237
|
+
"rustix 0.38.44",
|
|
238
|
+
"signal-hook",
|
|
239
|
+
"signal-hook-mio",
|
|
240
|
+
"winapi",
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
[[package]]
|
|
244
|
+
name = "crossterm_winapi"
|
|
245
|
+
version = "0.9.1"
|
|
246
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
247
|
+
checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"
|
|
248
|
+
dependencies = [
|
|
249
|
+
"winapi",
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
[[package]]
|
|
253
|
+
name = "darling"
|
|
254
|
+
version = "0.23.0"
|
|
255
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
256
|
+
checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d"
|
|
257
|
+
dependencies = [
|
|
258
|
+
"darling_core",
|
|
259
|
+
"darling_macro",
|
|
260
|
+
]
|
|
261
|
+
|
|
262
|
+
[[package]]
|
|
263
|
+
name = "darling_core"
|
|
264
|
+
version = "0.23.0"
|
|
265
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
266
|
+
checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0"
|
|
267
|
+
dependencies = [
|
|
268
|
+
"ident_case",
|
|
269
|
+
"proc-macro2",
|
|
270
|
+
"quote",
|
|
271
|
+
"strsim",
|
|
272
|
+
"syn",
|
|
273
|
+
]
|
|
274
|
+
|
|
275
|
+
[[package]]
|
|
276
|
+
name = "darling_macro"
|
|
277
|
+
version = "0.23.0"
|
|
278
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
279
|
+
checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
|
|
280
|
+
dependencies = [
|
|
281
|
+
"darling_core",
|
|
282
|
+
"quote",
|
|
283
|
+
"syn",
|
|
284
|
+
]
|
|
285
|
+
|
|
190
286
|
[[package]]
|
|
191
287
|
name = "displaydoc"
|
|
192
288
|
version = "0.2.5"
|
|
@@ -198,6 +294,12 @@ dependencies = [
|
|
|
198
294
|
"syn",
|
|
199
295
|
]
|
|
200
296
|
|
|
297
|
+
[[package]]
|
|
298
|
+
name = "either"
|
|
299
|
+
version = "1.16.0"
|
|
300
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
301
|
+
checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
|
|
302
|
+
|
|
201
303
|
[[package]]
|
|
202
304
|
name = "endian-type"
|
|
203
305
|
version = "0.1.2"
|
|
@@ -233,7 +335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
233
335
|
checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78"
|
|
234
336
|
dependencies = [
|
|
235
337
|
"cfg-if",
|
|
236
|
-
"rustix",
|
|
338
|
+
"rustix 1.1.4",
|
|
237
339
|
"windows-sys 0.52.0",
|
|
238
340
|
]
|
|
239
341
|
|
|
@@ -243,6 +345,12 @@ version = "0.1.9"
|
|
|
243
345
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
244
346
|
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
|
245
347
|
|
|
348
|
+
[[package]]
|
|
349
|
+
name = "foldhash"
|
|
350
|
+
version = "0.1.5"
|
|
351
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
352
|
+
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
|
353
|
+
|
|
246
354
|
[[package]]
|
|
247
355
|
name = "form_urlencoded"
|
|
248
356
|
version = "1.2.2"
|
|
@@ -339,6 +447,17 @@ dependencies = [
|
|
|
339
447
|
"wasm-bindgen",
|
|
340
448
|
]
|
|
341
449
|
|
|
450
|
+
[[package]]
|
|
451
|
+
name = "hashbrown"
|
|
452
|
+
version = "0.15.5"
|
|
453
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
454
|
+
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
|
455
|
+
dependencies = [
|
|
456
|
+
"allocator-api2",
|
|
457
|
+
"equivalent",
|
|
458
|
+
"foldhash",
|
|
459
|
+
]
|
|
460
|
+
|
|
342
461
|
[[package]]
|
|
343
462
|
name = "hashbrown"
|
|
344
463
|
version = "0.17.1"
|
|
@@ -540,6 +659,12 @@ dependencies = [
|
|
|
540
659
|
"zerovec",
|
|
541
660
|
]
|
|
542
661
|
|
|
662
|
+
[[package]]
|
|
663
|
+
name = "ident_case"
|
|
664
|
+
version = "1.0.1"
|
|
665
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
666
|
+
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
|
667
|
+
|
|
543
668
|
[[package]]
|
|
544
669
|
name = "idna"
|
|
545
670
|
version = "1.1.0"
|
|
@@ -568,7 +693,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
568
693
|
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
|
|
569
694
|
dependencies = [
|
|
570
695
|
"equivalent",
|
|
571
|
-
"hashbrown",
|
|
696
|
+
"hashbrown 0.17.1",
|
|
697
|
+
]
|
|
698
|
+
|
|
699
|
+
[[package]]
|
|
700
|
+
name = "indoc"
|
|
701
|
+
version = "2.0.7"
|
|
702
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
703
|
+
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
704
|
+
dependencies = [
|
|
705
|
+
"rustversion",
|
|
706
|
+
]
|
|
707
|
+
|
|
708
|
+
[[package]]
|
|
709
|
+
name = "instability"
|
|
710
|
+
version = "0.3.12"
|
|
711
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
712
|
+
checksum = "5eb2d60ef19920a3a9193c3e371f726ec1dafc045dac788d0fb3704272458971"
|
|
713
|
+
dependencies = [
|
|
714
|
+
"darling",
|
|
715
|
+
"indoc",
|
|
716
|
+
"proc-macro2",
|
|
717
|
+
"quote",
|
|
718
|
+
"syn",
|
|
572
719
|
]
|
|
573
720
|
|
|
574
721
|
[[package]]
|
|
@@ -583,6 +730,15 @@ version = "1.70.2"
|
|
|
583
730
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
584
731
|
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|
585
732
|
|
|
733
|
+
[[package]]
|
|
734
|
+
name = "itertools"
|
|
735
|
+
version = "0.13.0"
|
|
736
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
737
|
+
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
|
738
|
+
dependencies = [
|
|
739
|
+
"either",
|
|
740
|
+
]
|
|
741
|
+
|
|
586
742
|
[[package]]
|
|
587
743
|
name = "itoa"
|
|
588
744
|
version = "1.0.18"
|
|
@@ -607,6 +763,12 @@ version = "0.2.186"
|
|
|
607
763
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
608
764
|
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
609
765
|
|
|
766
|
+
[[package]]
|
|
767
|
+
name = "linux-raw-sys"
|
|
768
|
+
version = "0.4.15"
|
|
769
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
770
|
+
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
|
|
771
|
+
|
|
610
772
|
[[package]]
|
|
611
773
|
name = "linux-raw-sys"
|
|
612
774
|
version = "0.12.1"
|
|
@@ -619,12 +781,30 @@ version = "0.8.2"
|
|
|
619
781
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
620
782
|
checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
|
|
621
783
|
|
|
784
|
+
[[package]]
|
|
785
|
+
name = "lock_api"
|
|
786
|
+
version = "0.4.14"
|
|
787
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
788
|
+
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
|
|
789
|
+
dependencies = [
|
|
790
|
+
"scopeguard",
|
|
791
|
+
]
|
|
792
|
+
|
|
622
793
|
[[package]]
|
|
623
794
|
name = "log"
|
|
624
795
|
version = "0.4.29"
|
|
625
796
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
626
797
|
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|
627
798
|
|
|
799
|
+
[[package]]
|
|
800
|
+
name = "lru"
|
|
801
|
+
version = "0.12.5"
|
|
802
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
803
|
+
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
|
|
804
|
+
dependencies = [
|
|
805
|
+
"hashbrown 0.15.5",
|
|
806
|
+
]
|
|
807
|
+
|
|
628
808
|
[[package]]
|
|
629
809
|
name = "lru-slab"
|
|
630
810
|
version = "0.1.2"
|
|
@@ -644,6 +824,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
644
824
|
checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
|
|
645
825
|
dependencies = [
|
|
646
826
|
"libc",
|
|
827
|
+
"log",
|
|
647
828
|
"wasi",
|
|
648
829
|
"windows-sys 0.61.2",
|
|
649
830
|
]
|
|
@@ -681,6 +862,35 @@ version = "1.70.2"
|
|
|
681
862
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
682
863
|
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
683
864
|
|
|
865
|
+
[[package]]
|
|
866
|
+
name = "parking_lot"
|
|
867
|
+
version = "0.12.5"
|
|
868
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
869
|
+
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
|
|
870
|
+
dependencies = [
|
|
871
|
+
"lock_api",
|
|
872
|
+
"parking_lot_core",
|
|
873
|
+
]
|
|
874
|
+
|
|
875
|
+
[[package]]
|
|
876
|
+
name = "parking_lot_core"
|
|
877
|
+
version = "0.9.12"
|
|
878
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
879
|
+
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
|
|
880
|
+
dependencies = [
|
|
881
|
+
"cfg-if",
|
|
882
|
+
"libc",
|
|
883
|
+
"redox_syscall",
|
|
884
|
+
"smallvec",
|
|
885
|
+
"windows-link",
|
|
886
|
+
]
|
|
887
|
+
|
|
888
|
+
[[package]]
|
|
889
|
+
name = "paste"
|
|
890
|
+
version = "1.0.15"
|
|
891
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
892
|
+
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
|
893
|
+
|
|
684
894
|
[[package]]
|
|
685
895
|
name = "percent-encoding"
|
|
686
896
|
version = "2.3.2"
|
|
@@ -829,6 +1039,36 @@ dependencies = [
|
|
|
829
1039
|
"getrandom 0.3.4",
|
|
830
1040
|
]
|
|
831
1041
|
|
|
1042
|
+
[[package]]
|
|
1043
|
+
name = "ratatui"
|
|
1044
|
+
version = "0.29.0"
|
|
1045
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1046
|
+
checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
|
|
1047
|
+
dependencies = [
|
|
1048
|
+
"bitflags",
|
|
1049
|
+
"cassowary",
|
|
1050
|
+
"compact_str",
|
|
1051
|
+
"crossterm",
|
|
1052
|
+
"indoc",
|
|
1053
|
+
"instability",
|
|
1054
|
+
"itertools",
|
|
1055
|
+
"lru",
|
|
1056
|
+
"paste",
|
|
1057
|
+
"strum",
|
|
1058
|
+
"unicode-segmentation",
|
|
1059
|
+
"unicode-truncate",
|
|
1060
|
+
"unicode-width 0.2.0",
|
|
1061
|
+
]
|
|
1062
|
+
|
|
1063
|
+
[[package]]
|
|
1064
|
+
name = "redox_syscall"
|
|
1065
|
+
version = "0.5.18"
|
|
1066
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1067
|
+
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
|
1068
|
+
dependencies = [
|
|
1069
|
+
"bitflags",
|
|
1070
|
+
]
|
|
1071
|
+
|
|
832
1072
|
[[package]]
|
|
833
1073
|
name = "reqwest"
|
|
834
1074
|
version = "0.12.28"
|
|
@@ -890,6 +1130,19 @@ version = "2.1.2"
|
|
|
890
1130
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
891
1131
|
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
|
|
892
1132
|
|
|
1133
|
+
[[package]]
|
|
1134
|
+
name = "rustix"
|
|
1135
|
+
version = "0.38.44"
|
|
1136
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1137
|
+
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
|
|
1138
|
+
dependencies = [
|
|
1139
|
+
"bitflags",
|
|
1140
|
+
"errno",
|
|
1141
|
+
"libc",
|
|
1142
|
+
"linux-raw-sys 0.4.15",
|
|
1143
|
+
"windows-sys 0.52.0",
|
|
1144
|
+
]
|
|
1145
|
+
|
|
893
1146
|
[[package]]
|
|
894
1147
|
name = "rustix"
|
|
895
1148
|
version = "1.1.4"
|
|
@@ -899,7 +1152,7 @@ dependencies = [
|
|
|
899
1152
|
"bitflags",
|
|
900
1153
|
"errno",
|
|
901
1154
|
"libc",
|
|
902
|
-
"linux-raw-sys",
|
|
1155
|
+
"linux-raw-sys 0.12.1",
|
|
903
1156
|
"windows-sys 0.61.2",
|
|
904
1157
|
]
|
|
905
1158
|
|
|
@@ -961,7 +1214,7 @@ dependencies = [
|
|
|
961
1214
|
"nix",
|
|
962
1215
|
"radix_trie",
|
|
963
1216
|
"unicode-segmentation",
|
|
964
|
-
"unicode-width",
|
|
1217
|
+
"unicode-width 0.1.14",
|
|
965
1218
|
"utf8parse",
|
|
966
1219
|
"windows-sys 0.52.0",
|
|
967
1220
|
]
|
|
@@ -972,6 +1225,12 @@ version = "1.0.23"
|
|
|
972
1225
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
973
1226
|
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
|
974
1227
|
|
|
1228
|
+
[[package]]
|
|
1229
|
+
name = "scopeguard"
|
|
1230
|
+
version = "1.2.0"
|
|
1231
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1232
|
+
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
1233
|
+
|
|
975
1234
|
[[package]]
|
|
976
1235
|
name = "serde"
|
|
977
1236
|
version = "1.0.228"
|
|
@@ -1042,6 +1301,27 @@ version = "1.3.0"
|
|
|
1042
1301
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1043
1302
|
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
1044
1303
|
|
|
1304
|
+
[[package]]
|
|
1305
|
+
name = "signal-hook"
|
|
1306
|
+
version = "0.3.18"
|
|
1307
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1308
|
+
checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
|
|
1309
|
+
dependencies = [
|
|
1310
|
+
"libc",
|
|
1311
|
+
"signal-hook-registry",
|
|
1312
|
+
]
|
|
1313
|
+
|
|
1314
|
+
[[package]]
|
|
1315
|
+
name = "signal-hook-mio"
|
|
1316
|
+
version = "0.2.5"
|
|
1317
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1318
|
+
checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc"
|
|
1319
|
+
dependencies = [
|
|
1320
|
+
"libc",
|
|
1321
|
+
"mio",
|
|
1322
|
+
"signal-hook",
|
|
1323
|
+
]
|
|
1324
|
+
|
|
1045
1325
|
[[package]]
|
|
1046
1326
|
name = "signal-hook-registry"
|
|
1047
1327
|
version = "1.4.8"
|
|
@@ -1080,12 +1360,40 @@ version = "1.2.1"
|
|
|
1080
1360
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1081
1361
|
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
|
|
1082
1362
|
|
|
1363
|
+
[[package]]
|
|
1364
|
+
name = "static_assertions"
|
|
1365
|
+
version = "1.1.0"
|
|
1366
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1367
|
+
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
|
1368
|
+
|
|
1083
1369
|
[[package]]
|
|
1084
1370
|
name = "strsim"
|
|
1085
1371
|
version = "0.11.1"
|
|
1086
1372
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1087
1373
|
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
1088
1374
|
|
|
1375
|
+
[[package]]
|
|
1376
|
+
name = "strum"
|
|
1377
|
+
version = "0.26.3"
|
|
1378
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1379
|
+
checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
|
|
1380
|
+
dependencies = [
|
|
1381
|
+
"strum_macros",
|
|
1382
|
+
]
|
|
1383
|
+
|
|
1384
|
+
[[package]]
|
|
1385
|
+
name = "strum_macros"
|
|
1386
|
+
version = "0.26.4"
|
|
1387
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1388
|
+
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
|
|
1389
|
+
dependencies = [
|
|
1390
|
+
"heck",
|
|
1391
|
+
"proc-macro2",
|
|
1392
|
+
"quote",
|
|
1393
|
+
"rustversion",
|
|
1394
|
+
"syn",
|
|
1395
|
+
]
|
|
1396
|
+
|
|
1089
1397
|
[[package]]
|
|
1090
1398
|
name = "subtle"
|
|
1091
1399
|
version = "2.6.1"
|
|
@@ -1341,12 +1649,29 @@ version = "1.13.2"
|
|
|
1341
1649
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1342
1650
|
checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c"
|
|
1343
1651
|
|
|
1652
|
+
[[package]]
|
|
1653
|
+
name = "unicode-truncate"
|
|
1654
|
+
version = "1.1.0"
|
|
1655
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1656
|
+
checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf"
|
|
1657
|
+
dependencies = [
|
|
1658
|
+
"itertools",
|
|
1659
|
+
"unicode-segmentation",
|
|
1660
|
+
"unicode-width 0.1.14",
|
|
1661
|
+
]
|
|
1662
|
+
|
|
1344
1663
|
[[package]]
|
|
1345
1664
|
name = "unicode-width"
|
|
1346
1665
|
version = "0.1.14"
|
|
1347
1666
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1348
1667
|
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
|
|
1349
1668
|
|
|
1669
|
+
[[package]]
|
|
1670
|
+
name = "unicode-width"
|
|
1671
|
+
version = "0.2.0"
|
|
1672
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1673
|
+
checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
|
|
1674
|
+
|
|
1350
1675
|
[[package]]
|
|
1351
1676
|
name = "untrusted"
|
|
1352
1677
|
version = "0.9.0"
|
|
@@ -1498,6 +1823,28 @@ dependencies = [
|
|
|
1498
1823
|
"rustls-pki-types",
|
|
1499
1824
|
]
|
|
1500
1825
|
|
|
1826
|
+
[[package]]
|
|
1827
|
+
name = "winapi"
|
|
1828
|
+
version = "0.3.9"
|
|
1829
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1830
|
+
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
|
1831
|
+
dependencies = [
|
|
1832
|
+
"winapi-i686-pc-windows-gnu",
|
|
1833
|
+
"winapi-x86_64-pc-windows-gnu",
|
|
1834
|
+
]
|
|
1835
|
+
|
|
1836
|
+
[[package]]
|
|
1837
|
+
name = "winapi-i686-pc-windows-gnu"
|
|
1838
|
+
version = "0.4.0"
|
|
1839
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1840
|
+
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|
1841
|
+
|
|
1842
|
+
[[package]]
|
|
1843
|
+
name = "winapi-x86_64-pc-windows-gnu"
|
|
1844
|
+
version = "0.4.0"
|
|
1845
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1846
|
+
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
1847
|
+
|
|
1501
1848
|
[[package]]
|
|
1502
1849
|
name = "windows-link"
|
|
1503
1850
|
version = "0.2.1"
|
package/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "anveesa"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.7"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
default-run = "anveesa"
|
|
6
6
|
|
|
@@ -9,6 +9,8 @@ base64 = "0.22"
|
|
|
9
9
|
anyhow = "1.0"
|
|
10
10
|
clap = { version = "4.5", features = ["derive"] }
|
|
11
11
|
libc = "0.2"
|
|
12
|
+
crossterm = "0.28"
|
|
13
|
+
ratatui = "0.29"
|
|
12
14
|
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "stream"] }
|
|
13
15
|
rustyline = "14"
|
|
14
16
|
serde = { version = "1.0", features = ["derive"] }
|
package/package.json
CHANGED
package/src/lib.rs
CHANGED
|
@@ -2,6 +2,7 @@ pub mod cli;
|
|
|
2
2
|
pub mod config;
|
|
3
3
|
pub mod provider;
|
|
4
4
|
pub mod tools;
|
|
5
|
+
pub mod tui;
|
|
5
6
|
|
|
6
7
|
use std::{
|
|
7
8
|
fs,
|
|
@@ -81,7 +82,8 @@ async fn run_interactive(options: AskOptions) -> Result<()> {
|
|
|
81
82
|
.get(&provider_name)
|
|
82
83
|
.with_context(|| format!("unknown provider '{provider_name}'"))?;
|
|
83
84
|
let _tools_available = matches!(provider, ProviderConfig::OpenAiCompatible(_));
|
|
84
|
-
let
|
|
85
|
+
let images_available = matches!(provider, ProviderConfig::OpenAiCompatible(_));
|
|
86
|
+
let mut images_available = images_available;
|
|
85
87
|
let model = options
|
|
86
88
|
.model
|
|
87
89
|
.clone()
|
|
@@ -150,6 +152,45 @@ async fn run_interactive(options: AskOptions) -> Result<()> {
|
|
|
150
152
|
);
|
|
151
153
|
|
|
152
154
|
let is_tty = io::stdout().is_terminal();
|
|
155
|
+
|
|
156
|
+
// ── TUI mode ──────────────────────────────────────────────────────────────
|
|
157
|
+
if is_tty {
|
|
158
|
+
// Spawn a background task to read keyboard events (crossterm::event::read is blocking).
|
|
159
|
+
let (key_tx, key_rx) = tokio::sync::mpsc::unbounded_channel();
|
|
160
|
+
tokio::task::spawn_blocking(move || {
|
|
161
|
+
loop {
|
|
162
|
+
match crossterm::event::read() {
|
|
163
|
+
Ok(ev) => { if key_tx.send(ev).is_err() { break; } }
|
|
164
|
+
Err(_) => break,
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
let short_cwd = std::env::var("HOME")
|
|
170
|
+
.map(|h| cwd.display().to_string().replacen(&h, "~", 1))
|
|
171
|
+
.unwrap_or_else(|_| cwd.display().to_string());
|
|
172
|
+
|
|
173
|
+
let app = tui::App::new(
|
|
174
|
+
provider_name.clone(),
|
|
175
|
+
session_options.model.clone().unwrap_or_else(|| "-".to_string()),
|
|
176
|
+
short_cwd,
|
|
177
|
+
history,
|
|
178
|
+
images_available,
|
|
179
|
+
session_path.clone(),
|
|
180
|
+
last_saved_at,
|
|
181
|
+
input_history,
|
|
182
|
+
config,
|
|
183
|
+
session_options,
|
|
184
|
+
workspace_context,
|
|
185
|
+
policy,
|
|
186
|
+
key_rx,
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
tui::run(app).await?;
|
|
190
|
+
return Ok(());
|
|
191
|
+
}
|
|
192
|
+
// ── Fallback: plain REPL (non-TTY / piped) ────────────────────────────────
|
|
193
|
+
|
|
153
194
|
let width = term_width();
|
|
154
195
|
let label = prompt_label(is_tty);
|
|
155
196
|
// Fingerprint of the last clipboard image we attached — prevents re-attaching
|
|
@@ -1215,7 +1256,7 @@ fn print_session_info(is_tty: bool, path: Option<&Path>, turns: usize, saved_at:
|
|
|
1215
1256
|
println!();
|
|
1216
1257
|
}
|
|
1217
1258
|
|
|
1218
|
-
fn export_conversation(path: &std::path::Path, history: &[ChatMessage]) -> Result<()> {
|
|
1259
|
+
pub fn export_conversation(path: &std::path::Path, history: &[ChatMessage]) -> Result<()> {
|
|
1219
1260
|
let mut out = String::new();
|
|
1220
1261
|
for msg in history {
|
|
1221
1262
|
match msg.role {
|
|
@@ -2081,7 +2122,7 @@ fn image_mime_for_path(path: &Path) -> Option<&'static str> {
|
|
|
2081
2122
|
/// Try to grab an image from the system clipboard and return it base64-encoded.
|
|
2082
2123
|
/// Only supported on macOS; returns None on other platforms or when no image is present.
|
|
2083
2124
|
#[cfg(target_os = "macos")]
|
|
2084
|
-
fn grab_clipboard_image() -> Option<ImageAttachment> {
|
|
2125
|
+
pub fn grab_clipboard_image() -> Option<ImageAttachment> {
|
|
2085
2126
|
read_clipboard_image().ok()
|
|
2086
2127
|
}
|
|
2087
2128
|
|
|
@@ -2257,7 +2298,7 @@ fn convert_tiff_to_png(tiff: &[u8]) -> Result<Vec<u8>> {
|
|
|
2257
2298
|
}
|
|
2258
2299
|
|
|
2259
2300
|
#[cfg(not(target_os = "macos"))]
|
|
2260
|
-
fn grab_clipboard_image() -> Option<ImageAttachment> {
|
|
2301
|
+
pub fn grab_clipboard_image() -> Option<ImageAttachment> {
|
|
2261
2302
|
None
|
|
2262
2303
|
}
|
|
2263
2304
|
|
|
@@ -2273,7 +2314,7 @@ fn repl_history_path() -> Option<PathBuf> {
|
|
|
2273
2314
|
Some(dir.join("history"))
|
|
2274
2315
|
}
|
|
2275
2316
|
|
|
2276
|
-
fn unix_now() -> u64 {
|
|
2317
|
+
pub fn unix_now() -> u64 {
|
|
2277
2318
|
std::time::SystemTime::now()
|
|
2278
2319
|
.duration_since(std::time::UNIX_EPOCH)
|
|
2279
2320
|
.unwrap_or_default()
|
|
@@ -2370,6 +2411,16 @@ fn load_interactive_session(path: &Path, cwd: &Path) -> Option<InteractiveSessio
|
|
|
2370
2411
|
Some(session)
|
|
2371
2412
|
}
|
|
2372
2413
|
|
|
2414
|
+
pub fn save_interactive_session_pub(
|
|
2415
|
+
path: &Path,
|
|
2416
|
+
cwd: &Path,
|
|
2417
|
+
provider: &str,
|
|
2418
|
+
options: &AskOptions,
|
|
2419
|
+
history: &[ChatMessage],
|
|
2420
|
+
) -> Result<()> {
|
|
2421
|
+
save_interactive_session(path, cwd, provider, options, history)
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2373
2424
|
fn save_interactive_session(
|
|
2374
2425
|
path: &Path,
|
|
2375
2426
|
cwd: &Path,
|