├── .github └── FUNDING.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE.md ├── README.md └── src └── main.rs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [chriskrycho] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.24.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.1.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "anstream" 31 | version = "0.6.18" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" 34 | dependencies = [ 35 | "anstyle", 36 | "anstyle-parse", 37 | "anstyle-query", 38 | "anstyle-wincon", 39 | "colorchoice", 40 | "is_terminal_polyfill", 41 | "utf8parse", 42 | ] 43 | 44 | [[package]] 45 | name = "anstyle" 46 | version = "1.0.10" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" 49 | 50 | [[package]] 51 | name = "anstyle-parse" 52 | version = "0.2.6" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" 55 | dependencies = [ 56 | "utf8parse", 57 | ] 58 | 59 | [[package]] 60 | name = "anstyle-query" 61 | version = "1.1.2" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" 64 | dependencies = [ 65 | "windows-sys 0.59.0", 66 | ] 67 | 68 | [[package]] 69 | name = "anstyle-wincon" 70 | version = "3.0.7" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" 73 | dependencies = [ 74 | "anstyle", 75 | "once_cell", 76 | "windows-sys 0.59.0", 77 | ] 78 | 79 | [[package]] 80 | name = "async-stream" 81 | version = "0.3.6" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" 84 | dependencies = [ 85 | "async-stream-impl", 86 | "futures-core", 87 | "pin-project-lite", 88 | ] 89 | 90 | [[package]] 91 | name = "async-stream-impl" 92 | version = "0.3.6" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" 95 | dependencies = [ 96 | "proc-macro2", 97 | "quote", 98 | "syn", 99 | ] 100 | 101 | [[package]] 102 | name = "autocfg" 103 | version = "1.4.0" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 106 | 107 | [[package]] 108 | name = "backtrace" 109 | version = "0.3.74" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 112 | dependencies = [ 113 | "addr2line", 114 | "cfg-if", 115 | "libc", 116 | "miniz_oxide", 117 | "object", 118 | "rustc-demangle", 119 | "windows-targets", 120 | ] 121 | 122 | [[package]] 123 | name = "base64" 124 | version = "0.22.1" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 127 | 128 | [[package]] 129 | name = "bitflags" 130 | version = "2.8.0" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" 133 | 134 | [[package]] 135 | name = "bumpalo" 136 | version = "3.16.0" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 139 | 140 | [[package]] 141 | name = "bytes" 142 | version = "1.9.0" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" 145 | 146 | [[package]] 147 | name = "cc" 148 | version = "1.2.10" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" 151 | dependencies = [ 152 | "shlex", 153 | ] 154 | 155 | [[package]] 156 | name = "cfg-if" 157 | version = "1.0.0" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 160 | 161 | [[package]] 162 | name = "clap" 163 | version = "4.5.26" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" 166 | dependencies = [ 167 | "clap_builder", 168 | "clap_derive", 169 | ] 170 | 171 | [[package]] 172 | name = "clap_builder" 173 | version = "4.5.26" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" 176 | dependencies = [ 177 | "anstream", 178 | "anstyle", 179 | "clap_lex", 180 | "strsim", 181 | ] 182 | 183 | [[package]] 184 | name = "clap_derive" 185 | version = "4.5.24" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" 188 | dependencies = [ 189 | "heck", 190 | "proc-macro2", 191 | "quote", 192 | "syn", 193 | ] 194 | 195 | [[package]] 196 | name = "clap_lex" 197 | version = "0.7.4" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" 200 | 201 | [[package]] 202 | name = "colorchoice" 203 | version = "1.0.3" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" 206 | 207 | [[package]] 208 | name = "core-foundation" 209 | version = "0.9.4" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 212 | dependencies = [ 213 | "core-foundation-sys", 214 | "libc", 215 | ] 216 | 217 | [[package]] 218 | name = "core-foundation-sys" 219 | version = "0.8.7" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 222 | 223 | [[package]] 224 | name = "displaydoc" 225 | version = "0.2.5" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 228 | dependencies = [ 229 | "proc-macro2", 230 | "quote", 231 | "syn", 232 | ] 233 | 234 | [[package]] 235 | name = "dyn-clone" 236 | version = "1.0.17" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" 239 | 240 | [[package]] 241 | name = "env_filter" 242 | version = "0.1.3" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" 245 | dependencies = [ 246 | "log", 247 | "regex", 248 | ] 249 | 250 | [[package]] 251 | name = "env_logger" 252 | version = "0.11.6" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" 255 | dependencies = [ 256 | "anstream", 257 | "anstyle", 258 | "env_filter", 259 | "humantime", 260 | "log", 261 | ] 262 | 263 | [[package]] 264 | name = "errno" 265 | version = "0.3.10" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" 268 | dependencies = [ 269 | "libc", 270 | "windows-sys 0.59.0", 271 | ] 272 | 273 | [[package]] 274 | name = "fastrand" 275 | version = "2.3.0" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 278 | 279 | [[package]] 280 | name = "fnv" 281 | version = "1.0.7" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 284 | 285 | [[package]] 286 | name = "foreign-types" 287 | version = "0.3.2" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 290 | dependencies = [ 291 | "foreign-types-shared", 292 | ] 293 | 294 | [[package]] 295 | name = "foreign-types-shared" 296 | version = "0.1.1" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 299 | 300 | [[package]] 301 | name = "form_urlencoded" 302 | version = "1.2.1" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 305 | dependencies = [ 306 | "percent-encoding", 307 | ] 308 | 309 | [[package]] 310 | name = "futures-channel" 311 | version = "0.3.31" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 314 | dependencies = [ 315 | "futures-core", 316 | ] 317 | 318 | [[package]] 319 | name = "futures-core" 320 | version = "0.3.31" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 323 | 324 | [[package]] 325 | name = "futures-task" 326 | version = "0.3.31" 327 | source = "registry+https://github.com/rust-lang/crates.io-index" 328 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 329 | 330 | [[package]] 331 | name = "futures-util" 332 | version = "0.3.31" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 335 | dependencies = [ 336 | "futures-core", 337 | "futures-task", 338 | "pin-project-lite", 339 | "pin-utils", 340 | ] 341 | 342 | [[package]] 343 | name = "getrandom" 344 | version = "0.2.15" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 347 | dependencies = [ 348 | "cfg-if", 349 | "libc", 350 | "wasi", 351 | ] 352 | 353 | [[package]] 354 | name = "gimli" 355 | version = "0.31.1" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 358 | 359 | [[package]] 360 | name = "hashbrown" 361 | version = "0.12.3" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 364 | 365 | [[package]] 366 | name = "heck" 367 | version = "0.5.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 370 | 371 | [[package]] 372 | name = "http" 373 | version = "1.2.0" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" 376 | dependencies = [ 377 | "bytes", 378 | "fnv", 379 | "itoa", 380 | ] 381 | 382 | [[package]] 383 | name = "http-body" 384 | version = "1.0.1" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 387 | dependencies = [ 388 | "bytes", 389 | "http", 390 | ] 391 | 392 | [[package]] 393 | name = "http-body-util" 394 | version = "0.1.2" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" 397 | dependencies = [ 398 | "bytes", 399 | "futures-util", 400 | "http", 401 | "http-body", 402 | "pin-project-lite", 403 | ] 404 | 405 | [[package]] 406 | name = "httparse" 407 | version = "1.9.5" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" 410 | 411 | [[package]] 412 | name = "humantime" 413 | version = "2.1.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 416 | 417 | [[package]] 418 | name = "hyper" 419 | version = "1.5.2" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" 422 | dependencies = [ 423 | "bytes", 424 | "futures-channel", 425 | "futures-util", 426 | "http", 427 | "http-body", 428 | "httparse", 429 | "itoa", 430 | "pin-project-lite", 431 | "smallvec", 432 | "tokio", 433 | "want", 434 | ] 435 | 436 | [[package]] 437 | name = "hyper-tls" 438 | version = "0.6.0" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" 441 | dependencies = [ 442 | "bytes", 443 | "http-body-util", 444 | "hyper", 445 | "hyper-util", 446 | "native-tls", 447 | "tokio", 448 | "tokio-native-tls", 449 | "tower-service", 450 | ] 451 | 452 | [[package]] 453 | name = "hyper-util" 454 | version = "0.1.10" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" 457 | dependencies = [ 458 | "bytes", 459 | "futures-channel", 460 | "futures-util", 461 | "http", 462 | "http-body", 463 | "hyper", 464 | "pin-project-lite", 465 | "socket2", 466 | "tokio", 467 | "tower-service", 468 | "tracing", 469 | ] 470 | 471 | [[package]] 472 | name = "icu_collections" 473 | version = "1.5.0" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" 476 | dependencies = [ 477 | "displaydoc", 478 | "yoke", 479 | "zerofrom", 480 | "zerovec", 481 | ] 482 | 483 | [[package]] 484 | name = "icu_locid" 485 | version = "1.5.0" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" 488 | dependencies = [ 489 | "displaydoc", 490 | "litemap", 491 | "tinystr", 492 | "writeable", 493 | "zerovec", 494 | ] 495 | 496 | [[package]] 497 | name = "icu_locid_transform" 498 | version = "1.5.0" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" 501 | dependencies = [ 502 | "displaydoc", 503 | "icu_locid", 504 | "icu_locid_transform_data", 505 | "icu_provider", 506 | "tinystr", 507 | "zerovec", 508 | ] 509 | 510 | [[package]] 511 | name = "icu_locid_transform_data" 512 | version = "1.5.0" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" 515 | 516 | [[package]] 517 | name = "icu_normalizer" 518 | version = "1.5.0" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" 521 | dependencies = [ 522 | "displaydoc", 523 | "icu_collections", 524 | "icu_normalizer_data", 525 | "icu_properties", 526 | "icu_provider", 527 | "smallvec", 528 | "utf16_iter", 529 | "utf8_iter", 530 | "write16", 531 | "zerovec", 532 | ] 533 | 534 | [[package]] 535 | name = "icu_normalizer_data" 536 | version = "1.5.0" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" 539 | 540 | [[package]] 541 | name = "icu_properties" 542 | version = "1.5.1" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" 545 | dependencies = [ 546 | "displaydoc", 547 | "icu_collections", 548 | "icu_locid_transform", 549 | "icu_properties_data", 550 | "icu_provider", 551 | "tinystr", 552 | "zerovec", 553 | ] 554 | 555 | [[package]] 556 | name = "icu_properties_data" 557 | version = "1.5.0" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" 560 | 561 | [[package]] 562 | name = "icu_provider" 563 | version = "1.5.0" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" 566 | dependencies = [ 567 | "displaydoc", 568 | "icu_locid", 569 | "icu_provider_macros", 570 | "stable_deref_trait", 571 | "tinystr", 572 | "writeable", 573 | "yoke", 574 | "zerofrom", 575 | "zerovec", 576 | ] 577 | 578 | [[package]] 579 | name = "icu_provider_macros" 580 | version = "1.5.0" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" 583 | dependencies = [ 584 | "proc-macro2", 585 | "quote", 586 | "syn", 587 | ] 588 | 589 | [[package]] 590 | name = "idna" 591 | version = "1.0.3" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" 594 | dependencies = [ 595 | "idna_adapter", 596 | "smallvec", 597 | "utf8_iter", 598 | ] 599 | 600 | [[package]] 601 | name = "idna_adapter" 602 | version = "1.2.0" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" 605 | dependencies = [ 606 | "icu_normalizer", 607 | "icu_properties", 608 | ] 609 | 610 | [[package]] 611 | name = "indexmap" 612 | version = "1.9.3" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 615 | dependencies = [ 616 | "autocfg", 617 | "hashbrown", 618 | "serde", 619 | ] 620 | 621 | [[package]] 622 | name = "ipnet" 623 | version = "2.10.1" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" 626 | 627 | [[package]] 628 | name = "is_terminal_polyfill" 629 | version = "1.70.1" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 632 | 633 | [[package]] 634 | name = "itoa" 635 | version = "1.0.14" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" 638 | 639 | [[package]] 640 | name = "jj-gpc" 641 | version = "0.7.2" 642 | dependencies = [ 643 | "clap", 644 | "env_logger", 645 | "log", 646 | "ollama-rs", 647 | "schemars", 648 | "serde", 649 | "serde_json", 650 | "tokio", 651 | ] 652 | 653 | [[package]] 654 | name = "js-sys" 655 | version = "0.3.77" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" 658 | dependencies = [ 659 | "once_cell", 660 | "wasm-bindgen", 661 | ] 662 | 663 | [[package]] 664 | name = "libc" 665 | version = "0.2.169" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" 668 | 669 | [[package]] 670 | name = "linux-raw-sys" 671 | version = "0.4.15" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" 674 | 675 | [[package]] 676 | name = "litemap" 677 | version = "0.7.4" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" 680 | 681 | [[package]] 682 | name = "log" 683 | version = "0.4.25" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" 686 | 687 | [[package]] 688 | name = "memchr" 689 | version = "2.7.4" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 692 | 693 | [[package]] 694 | name = "mime" 695 | version = "0.3.17" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 698 | 699 | [[package]] 700 | name = "miniz_oxide" 701 | version = "0.8.3" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" 704 | dependencies = [ 705 | "adler2", 706 | ] 707 | 708 | [[package]] 709 | name = "mio" 710 | version = "1.0.3" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" 713 | dependencies = [ 714 | "libc", 715 | "wasi", 716 | "windows-sys 0.52.0", 717 | ] 718 | 719 | [[package]] 720 | name = "native-tls" 721 | version = "0.2.12" 722 | source = "registry+https://github.com/rust-lang/crates.io-index" 723 | checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" 724 | dependencies = [ 725 | "libc", 726 | "log", 727 | "openssl", 728 | "openssl-probe", 729 | "openssl-sys", 730 | "schannel", 731 | "security-framework", 732 | "security-framework-sys", 733 | "tempfile", 734 | ] 735 | 736 | [[package]] 737 | name = "object" 738 | version = "0.36.7" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" 741 | dependencies = [ 742 | "memchr", 743 | ] 744 | 745 | [[package]] 746 | name = "ollama-rs" 747 | version = "0.2.4" 748 | source = "registry+https://github.com/rust-lang/crates.io-index" 749 | checksum = "af32a0936dcb0945f2436d60663e2a7df8cb944c82efbcb2e67ad2ce3662f43a" 750 | dependencies = [ 751 | "async-stream", 752 | "log", 753 | "reqwest", 754 | "schemars", 755 | "serde", 756 | "serde_json", 757 | "thiserror", 758 | "url", 759 | ] 760 | 761 | [[package]] 762 | name = "once_cell" 763 | version = "1.20.2" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" 766 | 767 | [[package]] 768 | name = "openssl" 769 | version = "0.10.68" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" 772 | dependencies = [ 773 | "bitflags", 774 | "cfg-if", 775 | "foreign-types", 776 | "libc", 777 | "once_cell", 778 | "openssl-macros", 779 | "openssl-sys", 780 | ] 781 | 782 | [[package]] 783 | name = "openssl-macros" 784 | version = "0.1.1" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 787 | dependencies = [ 788 | "proc-macro2", 789 | "quote", 790 | "syn", 791 | ] 792 | 793 | [[package]] 794 | name = "openssl-probe" 795 | version = "0.1.5" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 798 | 799 | [[package]] 800 | name = "openssl-sys" 801 | version = "0.9.104" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" 804 | dependencies = [ 805 | "cc", 806 | "libc", 807 | "pkg-config", 808 | "vcpkg", 809 | ] 810 | 811 | [[package]] 812 | name = "percent-encoding" 813 | version = "2.3.1" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 816 | 817 | [[package]] 818 | name = "pin-project-lite" 819 | version = "0.2.16" 820 | source = "registry+https://github.com/rust-lang/crates.io-index" 821 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 822 | 823 | [[package]] 824 | name = "pin-utils" 825 | version = "0.1.0" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 828 | 829 | [[package]] 830 | name = "pkg-config" 831 | version = "0.3.31" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" 834 | 835 | [[package]] 836 | name = "proc-macro2" 837 | version = "1.0.93" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" 840 | dependencies = [ 841 | "unicode-ident", 842 | ] 843 | 844 | [[package]] 845 | name = "quote" 846 | version = "1.0.38" 847 | source = "registry+https://github.com/rust-lang/crates.io-index" 848 | checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" 849 | dependencies = [ 850 | "proc-macro2", 851 | ] 852 | 853 | [[package]] 854 | name = "regex" 855 | version = "1.11.1" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 858 | dependencies = [ 859 | "aho-corasick", 860 | "memchr", 861 | "regex-automata", 862 | "regex-syntax", 863 | ] 864 | 865 | [[package]] 866 | name = "regex-automata" 867 | version = "0.4.9" 868 | source = "registry+https://github.com/rust-lang/crates.io-index" 869 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 870 | dependencies = [ 871 | "aho-corasick", 872 | "memchr", 873 | "regex-syntax", 874 | ] 875 | 876 | [[package]] 877 | name = "regex-syntax" 878 | version = "0.8.5" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 881 | 882 | [[package]] 883 | name = "reqwest" 884 | version = "0.12.12" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" 887 | dependencies = [ 888 | "base64", 889 | "bytes", 890 | "futures-core", 891 | "futures-util", 892 | "http", 893 | "http-body", 894 | "http-body-util", 895 | "hyper", 896 | "hyper-tls", 897 | "hyper-util", 898 | "ipnet", 899 | "js-sys", 900 | "log", 901 | "mime", 902 | "native-tls", 903 | "once_cell", 904 | "percent-encoding", 905 | "pin-project-lite", 906 | "rustls-pemfile", 907 | "serde", 908 | "serde_json", 909 | "serde_urlencoded", 910 | "sync_wrapper", 911 | "tokio", 912 | "tokio-native-tls", 913 | "tower", 914 | "tower-service", 915 | "url", 916 | "wasm-bindgen", 917 | "wasm-bindgen-futures", 918 | "web-sys", 919 | "windows-registry", 920 | ] 921 | 922 | [[package]] 923 | name = "rustc-demangle" 924 | version = "0.1.24" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 927 | 928 | [[package]] 929 | name = "rustix" 930 | version = "0.38.43" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" 933 | dependencies = [ 934 | "bitflags", 935 | "errno", 936 | "libc", 937 | "linux-raw-sys", 938 | "windows-sys 0.59.0", 939 | ] 940 | 941 | [[package]] 942 | name = "rustls-pemfile" 943 | version = "2.2.0" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" 946 | dependencies = [ 947 | "rustls-pki-types", 948 | ] 949 | 950 | [[package]] 951 | name = "rustls-pki-types" 952 | version = "1.10.1" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" 955 | 956 | [[package]] 957 | name = "rustversion" 958 | version = "1.0.19" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" 961 | 962 | [[package]] 963 | name = "ryu" 964 | version = "1.0.18" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 967 | 968 | [[package]] 969 | name = "schannel" 970 | version = "0.1.27" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" 973 | dependencies = [ 974 | "windows-sys 0.59.0", 975 | ] 976 | 977 | [[package]] 978 | name = "schemars" 979 | version = "0.8.21" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" 982 | dependencies = [ 983 | "dyn-clone", 984 | "indexmap", 985 | "schemars_derive", 986 | "serde", 987 | "serde_json", 988 | ] 989 | 990 | [[package]] 991 | name = "schemars_derive" 992 | version = "0.8.21" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" 995 | dependencies = [ 996 | "proc-macro2", 997 | "quote", 998 | "serde_derive_internals", 999 | "syn", 1000 | ] 1001 | 1002 | [[package]] 1003 | name = "security-framework" 1004 | version = "2.11.1" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 1007 | dependencies = [ 1008 | "bitflags", 1009 | "core-foundation", 1010 | "core-foundation-sys", 1011 | "libc", 1012 | "security-framework-sys", 1013 | ] 1014 | 1015 | [[package]] 1016 | name = "security-framework-sys" 1017 | version = "2.14.0" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" 1020 | dependencies = [ 1021 | "core-foundation-sys", 1022 | "libc", 1023 | ] 1024 | 1025 | [[package]] 1026 | name = "serde" 1027 | version = "1.0.217" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" 1030 | dependencies = [ 1031 | "serde_derive", 1032 | ] 1033 | 1034 | [[package]] 1035 | name = "serde_derive" 1036 | version = "1.0.217" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" 1039 | dependencies = [ 1040 | "proc-macro2", 1041 | "quote", 1042 | "syn", 1043 | ] 1044 | 1045 | [[package]] 1046 | name = "serde_derive_internals" 1047 | version = "0.29.1" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" 1050 | dependencies = [ 1051 | "proc-macro2", 1052 | "quote", 1053 | "syn", 1054 | ] 1055 | 1056 | [[package]] 1057 | name = "serde_json" 1058 | version = "1.0.135" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" 1061 | dependencies = [ 1062 | "itoa", 1063 | "memchr", 1064 | "ryu", 1065 | "serde", 1066 | ] 1067 | 1068 | [[package]] 1069 | name = "serde_urlencoded" 1070 | version = "0.7.1" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1073 | dependencies = [ 1074 | "form_urlencoded", 1075 | "itoa", 1076 | "ryu", 1077 | "serde", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "shlex" 1082 | version = "1.3.0" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1085 | 1086 | [[package]] 1087 | name = "smallvec" 1088 | version = "1.13.2" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1091 | 1092 | [[package]] 1093 | name = "socket2" 1094 | version = "0.5.8" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" 1097 | dependencies = [ 1098 | "libc", 1099 | "windows-sys 0.52.0", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "stable_deref_trait" 1104 | version = "1.2.0" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1107 | 1108 | [[package]] 1109 | name = "strsim" 1110 | version = "0.11.1" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1113 | 1114 | [[package]] 1115 | name = "syn" 1116 | version = "2.0.96" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" 1119 | dependencies = [ 1120 | "proc-macro2", 1121 | "quote", 1122 | "unicode-ident", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "sync_wrapper" 1127 | version = "1.0.2" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" 1130 | dependencies = [ 1131 | "futures-core", 1132 | ] 1133 | 1134 | [[package]] 1135 | name = "synstructure" 1136 | version = "0.13.1" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" 1139 | dependencies = [ 1140 | "proc-macro2", 1141 | "quote", 1142 | "syn", 1143 | ] 1144 | 1145 | [[package]] 1146 | name = "tempfile" 1147 | version = "3.15.0" 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" 1149 | checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" 1150 | dependencies = [ 1151 | "cfg-if", 1152 | "fastrand", 1153 | "getrandom", 1154 | "once_cell", 1155 | "rustix", 1156 | "windows-sys 0.59.0", 1157 | ] 1158 | 1159 | [[package]] 1160 | name = "thiserror" 1161 | version = "2.0.11" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" 1164 | dependencies = [ 1165 | "thiserror-impl", 1166 | ] 1167 | 1168 | [[package]] 1169 | name = "thiserror-impl" 1170 | version = "2.0.11" 1171 | source = "registry+https://github.com/rust-lang/crates.io-index" 1172 | checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" 1173 | dependencies = [ 1174 | "proc-macro2", 1175 | "quote", 1176 | "syn", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "tinystr" 1181 | version = "0.7.6" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" 1184 | dependencies = [ 1185 | "displaydoc", 1186 | "zerovec", 1187 | ] 1188 | 1189 | [[package]] 1190 | name = "tokio" 1191 | version = "1.43.0" 1192 | source = "registry+https://github.com/rust-lang/crates.io-index" 1193 | checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" 1194 | dependencies = [ 1195 | "backtrace", 1196 | "bytes", 1197 | "libc", 1198 | "mio", 1199 | "pin-project-lite", 1200 | "socket2", 1201 | "tokio-macros", 1202 | "windows-sys 0.52.0", 1203 | ] 1204 | 1205 | [[package]] 1206 | name = "tokio-macros" 1207 | version = "2.5.0" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" 1210 | dependencies = [ 1211 | "proc-macro2", 1212 | "quote", 1213 | "syn", 1214 | ] 1215 | 1216 | [[package]] 1217 | name = "tokio-native-tls" 1218 | version = "0.3.1" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1221 | dependencies = [ 1222 | "native-tls", 1223 | "tokio", 1224 | ] 1225 | 1226 | [[package]] 1227 | name = "tower" 1228 | version = "0.5.2" 1229 | source = "registry+https://github.com/rust-lang/crates.io-index" 1230 | checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" 1231 | dependencies = [ 1232 | "futures-core", 1233 | "futures-util", 1234 | "pin-project-lite", 1235 | "sync_wrapper", 1236 | "tokio", 1237 | "tower-layer", 1238 | "tower-service", 1239 | ] 1240 | 1241 | [[package]] 1242 | name = "tower-layer" 1243 | version = "0.3.3" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1246 | 1247 | [[package]] 1248 | name = "tower-service" 1249 | version = "0.3.3" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1252 | 1253 | [[package]] 1254 | name = "tracing" 1255 | version = "0.1.41" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 1258 | dependencies = [ 1259 | "pin-project-lite", 1260 | "tracing-core", 1261 | ] 1262 | 1263 | [[package]] 1264 | name = "tracing-core" 1265 | version = "0.1.33" 1266 | source = "registry+https://github.com/rust-lang/crates.io-index" 1267 | checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" 1268 | dependencies = [ 1269 | "once_cell", 1270 | ] 1271 | 1272 | [[package]] 1273 | name = "try-lock" 1274 | version = "0.2.5" 1275 | source = "registry+https://github.com/rust-lang/crates.io-index" 1276 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1277 | 1278 | [[package]] 1279 | name = "unicode-ident" 1280 | version = "1.0.14" 1281 | source = "registry+https://github.com/rust-lang/crates.io-index" 1282 | checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" 1283 | 1284 | [[package]] 1285 | name = "url" 1286 | version = "2.5.4" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" 1289 | dependencies = [ 1290 | "form_urlencoded", 1291 | "idna", 1292 | "percent-encoding", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "utf16_iter" 1297 | version = "1.0.5" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" 1300 | 1301 | [[package]] 1302 | name = "utf8_iter" 1303 | version = "1.0.4" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1306 | 1307 | [[package]] 1308 | name = "utf8parse" 1309 | version = "0.2.2" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 1312 | 1313 | [[package]] 1314 | name = "vcpkg" 1315 | version = "0.2.15" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1318 | 1319 | [[package]] 1320 | name = "want" 1321 | version = "0.3.1" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1324 | dependencies = [ 1325 | "try-lock", 1326 | ] 1327 | 1328 | [[package]] 1329 | name = "wasi" 1330 | version = "0.11.0+wasi-snapshot-preview1" 1331 | source = "registry+https://github.com/rust-lang/crates.io-index" 1332 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1333 | 1334 | [[package]] 1335 | name = "wasm-bindgen" 1336 | version = "0.2.100" 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" 1338 | checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" 1339 | dependencies = [ 1340 | "cfg-if", 1341 | "once_cell", 1342 | "rustversion", 1343 | "wasm-bindgen-macro", 1344 | ] 1345 | 1346 | [[package]] 1347 | name = "wasm-bindgen-backend" 1348 | version = "0.2.100" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" 1351 | dependencies = [ 1352 | "bumpalo", 1353 | "log", 1354 | "proc-macro2", 1355 | "quote", 1356 | "syn", 1357 | "wasm-bindgen-shared", 1358 | ] 1359 | 1360 | [[package]] 1361 | name = "wasm-bindgen-futures" 1362 | version = "0.4.50" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" 1365 | dependencies = [ 1366 | "cfg-if", 1367 | "js-sys", 1368 | "once_cell", 1369 | "wasm-bindgen", 1370 | "web-sys", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "wasm-bindgen-macro" 1375 | version = "0.2.100" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" 1378 | dependencies = [ 1379 | "quote", 1380 | "wasm-bindgen-macro-support", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "wasm-bindgen-macro-support" 1385 | version = "0.2.100" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" 1388 | dependencies = [ 1389 | "proc-macro2", 1390 | "quote", 1391 | "syn", 1392 | "wasm-bindgen-backend", 1393 | "wasm-bindgen-shared", 1394 | ] 1395 | 1396 | [[package]] 1397 | name = "wasm-bindgen-shared" 1398 | version = "0.2.100" 1399 | source = "registry+https://github.com/rust-lang/crates.io-index" 1400 | checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" 1401 | dependencies = [ 1402 | "unicode-ident", 1403 | ] 1404 | 1405 | [[package]] 1406 | name = "web-sys" 1407 | version = "0.3.77" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" 1410 | dependencies = [ 1411 | "js-sys", 1412 | "wasm-bindgen", 1413 | ] 1414 | 1415 | [[package]] 1416 | name = "windows-registry" 1417 | version = "0.2.0" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" 1420 | dependencies = [ 1421 | "windows-result", 1422 | "windows-strings", 1423 | "windows-targets", 1424 | ] 1425 | 1426 | [[package]] 1427 | name = "windows-result" 1428 | version = "0.2.0" 1429 | source = "registry+https://github.com/rust-lang/crates.io-index" 1430 | checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" 1431 | dependencies = [ 1432 | "windows-targets", 1433 | ] 1434 | 1435 | [[package]] 1436 | name = "windows-strings" 1437 | version = "0.1.0" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" 1440 | dependencies = [ 1441 | "windows-result", 1442 | "windows-targets", 1443 | ] 1444 | 1445 | [[package]] 1446 | name = "windows-sys" 1447 | version = "0.52.0" 1448 | source = "registry+https://github.com/rust-lang/crates.io-index" 1449 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1450 | dependencies = [ 1451 | "windows-targets", 1452 | ] 1453 | 1454 | [[package]] 1455 | name = "windows-sys" 1456 | version = "0.59.0" 1457 | source = "registry+https://github.com/rust-lang/crates.io-index" 1458 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1459 | dependencies = [ 1460 | "windows-targets", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "windows-targets" 1465 | version = "0.52.6" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1468 | dependencies = [ 1469 | "windows_aarch64_gnullvm", 1470 | "windows_aarch64_msvc", 1471 | "windows_i686_gnu", 1472 | "windows_i686_gnullvm", 1473 | "windows_i686_msvc", 1474 | "windows_x86_64_gnu", 1475 | "windows_x86_64_gnullvm", 1476 | "windows_x86_64_msvc", 1477 | ] 1478 | 1479 | [[package]] 1480 | name = "windows_aarch64_gnullvm" 1481 | version = "0.52.6" 1482 | source = "registry+https://github.com/rust-lang/crates.io-index" 1483 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1484 | 1485 | [[package]] 1486 | name = "windows_aarch64_msvc" 1487 | version = "0.52.6" 1488 | source = "registry+https://github.com/rust-lang/crates.io-index" 1489 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1490 | 1491 | [[package]] 1492 | name = "windows_i686_gnu" 1493 | version = "0.52.6" 1494 | source = "registry+https://github.com/rust-lang/crates.io-index" 1495 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1496 | 1497 | [[package]] 1498 | name = "windows_i686_gnullvm" 1499 | version = "0.52.6" 1500 | source = "registry+https://github.com/rust-lang/crates.io-index" 1501 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1502 | 1503 | [[package]] 1504 | name = "windows_i686_msvc" 1505 | version = "0.52.6" 1506 | source = "registry+https://github.com/rust-lang/crates.io-index" 1507 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1508 | 1509 | [[package]] 1510 | name = "windows_x86_64_gnu" 1511 | version = "0.52.6" 1512 | source = "registry+https://github.com/rust-lang/crates.io-index" 1513 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1514 | 1515 | [[package]] 1516 | name = "windows_x86_64_gnullvm" 1517 | version = "0.52.6" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1520 | 1521 | [[package]] 1522 | name = "windows_x86_64_msvc" 1523 | version = "0.52.6" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1526 | 1527 | [[package]] 1528 | name = "write16" 1529 | version = "1.0.0" 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" 1531 | checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" 1532 | 1533 | [[package]] 1534 | name = "writeable" 1535 | version = "0.5.5" 1536 | source = "registry+https://github.com/rust-lang/crates.io-index" 1537 | checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" 1538 | 1539 | [[package]] 1540 | name = "yoke" 1541 | version = "0.7.5" 1542 | source = "registry+https://github.com/rust-lang/crates.io-index" 1543 | checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" 1544 | dependencies = [ 1545 | "serde", 1546 | "stable_deref_trait", 1547 | "yoke-derive", 1548 | "zerofrom", 1549 | ] 1550 | 1551 | [[package]] 1552 | name = "yoke-derive" 1553 | version = "0.7.5" 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" 1555 | checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" 1556 | dependencies = [ 1557 | "proc-macro2", 1558 | "quote", 1559 | "syn", 1560 | "synstructure", 1561 | ] 1562 | 1563 | [[package]] 1564 | name = "zerofrom" 1565 | version = "0.1.5" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" 1568 | dependencies = [ 1569 | "zerofrom-derive", 1570 | ] 1571 | 1572 | [[package]] 1573 | name = "zerofrom-derive" 1574 | version = "0.1.5" 1575 | source = "registry+https://github.com/rust-lang/crates.io-index" 1576 | checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" 1577 | dependencies = [ 1578 | "proc-macro2", 1579 | "quote", 1580 | "syn", 1581 | "synstructure", 1582 | ] 1583 | 1584 | [[package]] 1585 | name = "zerovec" 1586 | version = "0.10.4" 1587 | source = "registry+https://github.com/rust-lang/crates.io-index" 1588 | checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" 1589 | dependencies = [ 1590 | "yoke", 1591 | "zerofrom", 1592 | "zerovec-derive", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "zerovec-derive" 1597 | version = "0.10.3" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" 1600 | dependencies = [ 1601 | "proc-macro2", 1602 | "quote", 1603 | "syn", 1604 | ] 1605 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "jj-gpc" 3 | version = "0.7.2" 4 | edition = "2021" 5 | license-file = "LICENSE.md" 6 | authors = ["Chris Krycho "] 7 | repository = "https://github.com/chriskrycho/jj-gpc" 8 | 9 | [dependencies] 10 | clap = { version = "4", features = ["derive"] } 11 | env_logger = "0.11" 12 | log = "0.4" 13 | ollama-rs = "0.2" 14 | serde = { version = "1.0.217", features = ["serde_derive"] } 15 | serde_json = "1.0.135" 16 | schemars = { version = "0.8" } 17 | tokio = { version = "1", features = ["macros", "rt"] } 18 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Blue Oak Model License 2 | 3 | Version 1.0.0 4 | 5 | ## Purpose 6 | 7 | This license gives everyone as much permission to work with 8 | this software as possible, while protecting contributors 9 | from liability. 10 | 11 | ## Acceptance 12 | 13 | In order to receive this license, you must agree to its 14 | rules. The rules of this license are both obligations 15 | under that agreement and conditions to your license. 16 | You must not do anything with this software that triggers 17 | a rule that you cannot or will not follow. 18 | 19 | ## Copyright 20 | 21 | Each contributor licenses you to do everything with this 22 | software that would otherwise infringe that contributor's 23 | copyright in it. 24 | 25 | ## Notices 26 | 27 | You must ensure that everyone who gets a copy of 28 | any part of this software from you, with or without 29 | changes, also gets the text of this license or a link to 30 | . 31 | 32 | ## Excuse 33 | 34 | If anyone notifies you in writing that you have not 35 | complied with [Notices](#notices), you can keep your 36 | license by taking all practical steps to comply within 30 37 | days after the notice. If you do not do so, your license 38 | ends immediately. 39 | 40 | ## Patent 41 | 42 | Each contributor licenses you to do everything with this 43 | software that would otherwise infringe any patent claims 44 | they can license or become able to license. 45 | 46 | ## Reliability 47 | 48 | No contributor can revoke this license. 49 | 50 | ## No Liability 51 | 52 | ***As far as the law allows, this software comes as is, 53 | without any warranty or condition, and no contributor 54 | will be liable to anyone for any damages related to this 55 | software or this license, under any kind of legal claim.*** 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jj-gpc 2 | 3 | ✨ 100% local LLM-based bookmark (Git branch) name creation for [Jujutsu VCS][jj] 4 | 5 | [jj]: https://github.com/martinvonz/jj 6 | 7 | Jujutsu is a modern, Git-compatible VCS. It supports (and I primarily use) anonymous branches for development. Since Git, and thus all Git-based “forges” (GitHub, GitLab, Bitbucket, etc.) require branch names, though, you need to give a branch name when you push your changes for others to work with. 8 | 9 | Jujutsu has native support making this easy. If you run `jj git push --change `,it creates a Jujutsu bookmark (which it maps to Git branches) and then pushes that newly created bookmark. The bookmark names it creates are of the form `push-`, though. Those are not especially attractive to most collaborators! 10 | 11 | This tiny tool is one “solution”: it generates a bookmark name based on the messages associated with the changes you tell it to use—by default, `trunk()..@`, or “everything between my current working copy and whatever the ‘trunk’ is for this project (usually `main` or `master`”). 12 | 13 | `gpc` is short for `git push change`. 14 | 15 | ## Installation 16 | 17 | Prerequisites: a relatively recent version of Rust. (I built it with Rust 1.82, but it probably works with versions quite a bit earlier than that!) 18 | 19 | - Clone the repo. 20 | 21 | With Jujutsu: 22 | 23 | ```sh 24 | jj git clone https://github.com/chriskrycho/jj-gpc 25 | ``` 26 | 27 | With Git: 28 | 29 | ```sh 30 | git clone https://github.com/chriskrycho/jj-gpc.git 31 | ``` 32 | 33 | - Install it with Cargo: 34 | 35 | ```sh 36 | cargo install --path . --locked 37 | ``` 38 | 39 | - Install and run [ollama][o]. 40 | 41 | - Fetch [the `phi3` model][model]: 42 | 43 | ```sh 44 | ollama pull phi3 45 | ``` 46 | 47 | [o]: https://ollama.com 48 | [model]: https://ollama.com/library/phi3 49 | 50 | That’s it; now you can run `jj-gpc` to do this. 51 | 52 | ## Usage 53 | 54 | `jj-gpc [change] [flags]` 55 | 56 | 57 | `change` is the revset to use to generate the bookmark name. If not passed, it will use `@`. 58 | 59 | A few of the most useful flags: 60 | 61 | - `-f`/`--from`: the initial revision to use in the revset for generating the name. Note that the revset is of the form `..`, so the `` message will *not* be included, because the default is `trunk()`, and the point is to generate a description of what is *different* from the trunk. 62 | - `-p`/`--prefix`: apply a prefix before the generated bookmark name. For example, `jj-gpc -p chriskrycho` would produce a name like `chriskrycho/did-some-stuff`, instead of just `did-some-stuff`. 63 | - `--log-format`: pass `one-line` (the default) to pass just summary messages, or `full` to pass the whole commit message, to the LLM for branch name description. 64 | - `--dry-run`: generate a branch name but neither create the bookmark nor push it. 65 | 66 | For the full set of flags and more details, run `jj-gpc --help`! 67 | 68 | ## Example output 69 | 70 | A handful of branch names I have actually seen generated by this: 71 | 72 | - `update-infra-issues` 73 | - `update-mdbook-dependencies` 74 | - `software-updates-implemented` 75 | - `cleaning-and-fixes` 76 | - `small-bug-fixes` 77 | - `small-code-updates` 78 | - `add-some-examples` 79 | - `small-digital-notebook` 80 | - `fix-library-errors` 81 | - `bump-typescript-version` 82 | - `support-ts-versions` 83 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::process; 2 | 3 | use clap::Parser as _; 4 | use ollama_rs::{ 5 | generation::{ 6 | completion::{request::GenerationRequest, GenerationResponse}, 7 | options::GenerationOptions, 8 | parameters::{FormatType, JsonSchema, JsonStructure}, 9 | }, 10 | Ollama, 11 | }; 12 | use serde::Deserialize; 13 | 14 | #[tokio::main(flavor = "current_thread")] 15 | async fn main() { 16 | env_logger::init(); 17 | 18 | let args = Cli::parse(); 19 | let revset = format!("{}..{}", args.from, args.change); 20 | 21 | let log_template = match args.log_format { 22 | Some(LogFormat::Full) => LOG_FULL, 23 | Some(LogFormat::OneLine) | None => LOG_ONE_LINE, 24 | }; 25 | 26 | let commits = execute(process::Command::new("jj").args(&[ 27 | "log", 28 | "-T", 29 | log_template, 30 | "-r", 31 | &revset, 32 | "--no-graph", 33 | ])); 34 | 35 | if commits.stdout.trim().is_empty() { 36 | eprintln!("No commits to summarize"); 37 | std::process::exit(1); 38 | } 39 | 40 | let prompt = format!( 41 | "{PROMPT_START}\n\n{commits}\n\n{PROMPT_END}", 42 | commits = commits.stdout 43 | ); 44 | log::debug!("prompt: {prompt}"); 45 | 46 | let request = GenerationRequest::new(args.model.clone(), prompt.clone()) 47 | .format(FormatType::StructuredJson(JsonStructure::new::())) 48 | .options( 49 | GenerationOptions::default() 50 | .top_k(args.top_k) 51 | .top_p(args.top_p) 52 | .temperature(args.temperature), 53 | ); 54 | 55 | let response_result = Ollama::default() 56 | .generate(request) 57 | .await 58 | .unwrap_or_else(|e| { 59 | eprintln!("Could not run Ollama. Maybe it is not installed or running?"); 60 | eprintln!("Cause: {e}"); 61 | process::exit(1); 62 | }); 63 | 64 | let GenerationResponse { response, .. } = response_result; 65 | 66 | let Branch(branch) = serde_json::from_str::(&response).unwrap_or_else(|err| { 67 | eprintln!("Invalid model response"); 68 | eprintln!("Cause: {err}"); 69 | eprintln!("Original response: '{response}'"); 70 | process::exit(1); 71 | }); 72 | 73 | let branch_name = args 74 | .prefix 75 | .map(|prefix| format!("{prefix}/{}", branch)) 76 | .unwrap_or(branch); 77 | 78 | if args.dry_run { 79 | println!( 80 | "[dry run] jj bookmark create {branch_name} --revision {}", 81 | args.change 82 | ); 83 | println!("[dry run] jj git push --bookmark {branch_name} --allow-new"); 84 | return; 85 | } 86 | 87 | println!( 88 | "jj bookmark create {branch_name} --revision {}", 89 | args.change 90 | ); 91 | let branch_output = execute(process::Command::new("jj").args(&[ 92 | "bookmark", 93 | "create", 94 | &branch_name, 95 | "--revision", 96 | &args.change, 97 | ])); 98 | 99 | if !branch_output.stdout.trim().is_empty() { 100 | println!("{}", branch_output.stdout); 101 | } 102 | 103 | if !branch_output.stderr.trim().is_empty() { 104 | println!("{}", branch_output.stderr); 105 | } 106 | 107 | println!("jj git push --bookmark {branch_name} --allow-new"); 108 | let push_output = execute(process::Command::new("jj").args(&[ 109 | "git", 110 | "push", 111 | "--bookmark", 112 | &branch_name, 113 | "--allow-new", 114 | ])); 115 | push_output.to_console(); 116 | } 117 | 118 | #[repr(transparent)] 119 | #[derive(JsonSchema, Deserialize, Debug)] 120 | struct Branch(#[schemars(regex(pattern = "^[a-z]{1,10}+(-[a-z]{1,10}){2,4}$"))] String); 121 | 122 | fn execute(command: &mut process::Command) -> CommandOutput { 123 | log::trace!("{command:?}"); 124 | let process::Output { 125 | status, 126 | stdout, 127 | stderr, 128 | } = command 129 | .output() 130 | .unwrap_or_else(|e| panic!("Could not execute command {command:?}.\nCause: {e}")); 131 | 132 | if !status.success() { 133 | eprintln!( 134 | "Error running '{command:?}' ({status}):\nCause: {}", 135 | String::from_utf8_lossy(&stderr) 136 | ); 137 | process::exit(status.code().unwrap_or(1)); 138 | } 139 | 140 | CommandOutput { 141 | stdout: String::from_utf8_lossy(&stdout).to_string(), 142 | stderr: String::from_utf8_lossy(&stderr).to_string(), 143 | } 144 | } 145 | 146 | struct CommandOutput { 147 | stdout: String, 148 | stderr: String, 149 | } 150 | 151 | impl CommandOutput { 152 | fn to_console(&self) { 153 | let Self { stdout, stderr } = self; 154 | if !stdout.trim().is_empty() { 155 | print!("{}", stdout); 156 | } 157 | 158 | if !stderr.trim().is_empty() { 159 | eprint!("{}", stderr); 160 | } 161 | } 162 | } 163 | 164 | /// Generate a branch name for use with jj. 165 | #[derive(clap::Parser, Debug)] 166 | #[command(version, author)] 167 | struct Cli { 168 | #[arg(default_value = "@")] 169 | change: String, 170 | 171 | #[arg(long, value_enum)] 172 | log_format: Option, 173 | 174 | #[arg(short, long, default_value = "trunk()")] 175 | from: String, 176 | 177 | /// Prefix for the generated branch name, `/` 178 | #[arg(short, long)] 179 | prefix: Option, 180 | 181 | /// Generate the branch name, but do not actually create or push it. 182 | #[arg(long = "dry-run", default_value = "false")] 183 | dry_run: bool, 184 | 185 | /// The temperature of the model. Increasing the temperature will make the 186 | /// model answer more creatively. 187 | #[arg(long, default_value = "2")] 188 | temperature: f32, 189 | 190 | /// Reduces the probability of generating nonsense. A higher value (e.g. 100) 191 | /// will give more diverse answers, while a lower value (e.g. 10) will be more 192 | /// conservative. 193 | #[arg(long, default_value = "20")] 194 | top_k: u32, 195 | 196 | /// Works together with top-k. A higher value (e.g., 0.95) will lead to more 197 | /// diverse text, while a lower value (e.g., 0.5) will generate more focused 198 | /// and conservative text. 199 | #[arg(long, default_value = "0.7")] 200 | top_p: f32, 201 | 202 | /// Which model to use. Can be any model available in Ollama on your system. 203 | /// 204 | /// The model you choose to use will significantly alters the quality of the 205 | /// output, so you may need to tune the parameters as well. If this is not a 206 | /// model available in Ollama on your system, the request will fail. 207 | #[arg(long, default_value = "phi3")] 208 | model: String, 209 | } 210 | 211 | #[derive(clap::ValueEnum, Debug, Clone)] 212 | enum LogFormat { 213 | OneLine, 214 | Full, 215 | } 216 | 217 | const LOG_ONE_LINE: &'static str = 218 | r#""```\n" ++ if(description, description.first_line(), '') ++ "\n```\n\n---\n\n""#; 219 | const LOG_FULL: &'static str = r#""```\n" ++ if(description, description, '') ++ "```\n\n---\n\n""#; 220 | 221 | const PROMPT_START: &'static str = r#"Rules for branch names: 222 | 223 | - A good branch name uses at least 3 and no more than 5 lowercase words separated by hyphens. 224 | - A good branch name is always derived from the summary of changes in the log. 225 | - A good branch name incorporates the sentiment of the majority of commits in the log. 226 | - A bad branch name has too little information, like `ab-1234`. 227 | - A bad branch name would only use the date. 228 | - Empty commits are not relevant. 229 | 230 | Commits are in blocks of markdown, separated by `---`. The commits that make up this branch are: 231 | "#; 232 | const PROMPT_END: &'static str = r#" 233 | 234 | The best descriptive branch name for these commits (*not* a pull request description, just a branch name) for a Git branch containing these commits is: 235 | "#; 236 | --------------------------------------------------------------------------------