diff --git a/Cargo.lock b/Cargo.lock index c2ca38e..42de483 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -170,9 +170,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -229,9 +229,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.15" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -315,16 +315,41 @@ dependencies = [ [[package]] name = "code2prompt" -version = "2.1.0" +version = "3.0.0" dependencies = [ "anyhow", "arboard", "assert_cmd", "clap", + "code2prompt_core", + "colored", + "env_logger", + "indicatif", + "log", + "num-format", + "predicates 2.1.5", + "serde_json", + "tempfile", +] + +[[package]] +name = "code2prompt-python" +version = "3.0.0" +dependencies = [ + "code2prompt_core", + "pyo3", + "serde_json", +] + +[[package]] +name = "code2prompt_core" +version = "3.0.0" +dependencies = [ + "anyhow", + "assert_cmd", "colored", "env_logger", "git2", - "glob", "globset", "handlebars", "ignore", @@ -335,7 +360,6 @@ dependencies = [ "num-format", "once_cell", "predicates 2.1.5", - "pyo3", "regex", "serde_json", "tempfile", @@ -361,9 +385,9 @@ dependencies = [ [[package]] name = "console" -version = "0.15.10" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", "libc", @@ -757,7 +781,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "libc", "libgit2-sys", "log", @@ -774,9 +798,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "globset" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" +checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" dependencies = [ "aho-corasick", "bstr", @@ -1013,7 +1037,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "crossterm", "dyn-clone", "fuzzy-matcher", @@ -1141,9 +1165,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -1292,7 +1316,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "block2", "libc", "objc2", @@ -1308,7 +1332,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-foundation", @@ -1338,7 +1362,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "block2", "libc", "objc2", @@ -1350,7 +1374,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-foundation", @@ -1362,7 +1386,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-foundation", @@ -1560,9 +1584,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.23.4" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc" +checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872" dependencies = [ "cfg-if", "indoc", @@ -1578,20 +1602,19 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.23.4" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3927b5a78757a0d71aa9dff669f903b1eb64b54142a9bd9f757f8fde65fd7" +checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb" dependencies = [ "once_cell", - "python3-dll-a", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.23.4" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab6bb2102bd8f991e7749f130a70d05dd557613e39ed2deeee8e9ca0c4d548d" +checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d" dependencies = [ "libc", "pyo3-build-config", @@ -1599,9 +1622,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.23.4" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91871864b353fd5ffcb3f91f2f703a22a9797c91b9ab497b1acac7b07ae509c7" +checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1611,9 +1634,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.23.4" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43abc3b80bc20f3facd86cd3c60beed58c3e2aa26213f3cda368de39c60a27e4" +checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028" dependencies = [ "heck", "proc-macro2", @@ -1622,15 +1645,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "python3-dll-a" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fe4227a288cf9493942ad0220ea3f185f4d1f2a14f197f7344d6d02f4ed4ed" -dependencies = [ - "cc", -] - [[package]] name = "quote" version = "1.0.38" @@ -1666,7 +1680,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -1710,7 +1724,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "errno", "libc", "linux-raw-sys", @@ -2377,7 +2391,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -2435,18 +2449,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 88c9702..596f17e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,66 +1,35 @@ -[package] -name = "code2prompt" -version = "2.1.0" -authors = ["Mufeed VH ","Olivier D'Ancona "] -description = "A command-line (CLI) tool to generate an LLM prompt from codebases of any size, fast." -keywords = ["code", "prompt", "llm", "gpt", "ai", "agent", "glob"] -categories = ["command-line-utilities", "development-tools"] -homepage = "https://github.com/mufeedvh/code2prompt" -documentation = "https://github.com/mufeedvh/code2prompt" -repository = "https://github.com/mufeedvh/code2prompt" -license = "MIT" -readme = "README.md" -exclude = [".github/*", ".assets/*"] -edition = "2021" -build = "build.rs" +[workspace] +resolver = "2" +members = ["crates/*"] +default-members = ["crates/code2prompt-core", "crates/code2prompt"] -[[bin]] -name = "code2prompt" -test = false -bench = false -path = "src/main.rs" - -[lib] -name = "code2prompt" -crate-type = ["cdylib", "rlib"] +[profile.release] +lto = "thin" +panic = 'abort' +codegen-units = 1 -[dependencies] -clap = { version = "4.0", features = ["derive"] } +[workspace.dependencies] +anyhow = "1.0.80" +colored = "2.1.0" +indicatif = "0.17.8" +log = "0.4" +num-format = { version = "0.4.4", features = ["with-system-locale"] } +serde_json = "1.0.114" handlebars = "4.3" jwalk = "0.8" termtree = "0.4" -serde_json = "1.0.114" -indicatif = "0.17.8" -colored = "2.1.0" tiktoken-rs = "0.6.0" ignore = "0.4.22" -anyhow = "1.0.80" inquire = "0.7.1" regex = "1.10.3" -git2 = { version = "0.18.2", default-features = false, features = [ "https", "vendored-libgit2", "vendored-openssl" ] } -glob = "0.3.1" +git2 = { version = "0.18.2", default-features = false, features = [ + "https", + "vendored-libgit2", + "vendored-openssl", +] } once_cell = "1.19.0" -log = "0.4" -env_logger = "0.11.3" -arboard = "3.4.0" -pyo3 = { version = "0.23", features = ["extension-module", "abi3-py312", "generate-import-lib"] } globset = "0.4.15" -num-format = { version = "0.4.4", features = ["with-system-locale"] } - - -[profile.release] -lto = "thin" -panic = 'abort' -codegen-units = 1 - -[package.metadata.deb] -section = "utility" -assets = [ - ["target/release/code2prompt", "/usr/bin/", "755"], -] - -[dev-dependencies] -tempfile = "3.3" -assert_cmd = "2.0" -predicates = "2.0" -env_logger = "0.11.3" +pyo3 = { version = "0.23", features = ["extension-module", "abi3-py312"] } +clap = { version = "4.0", features = ["derive"] } +env_logger = { version = "0.11.3" } +arboard = { version = "3.4.0" } diff --git a/crates/code2prompt-core/Cargo.lock b/crates/code2prompt-core/Cargo.lock new file mode 100644 index 0000000..3dfb7ac --- /dev/null +++ b/crates/code2prompt-core/Cargo.lock @@ -0,0 +1,2477 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" + +[[package]] +name = "arboard" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" +dependencies = [ + "clipboard-win", + "core-graphics", + "image", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "windows-sys 0.48.0", + "x11rb", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "assert_cmd" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" +dependencies = [ + "anstyle", + "bstr", + "doc-comment", + "libc", + "predicates 3.1.3", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bindgen" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 1.0.109", + "which", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + +[[package]] +name = "bstr" +version = "1.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "code2prompt" +version = "3.0.0" +dependencies = [ + "anyhow", + "arboard", + "assert_cmd", + "clap", + "colored", + "env_logger", + "git2", + "glob", + "globset", + "handlebars", + "ignore", + "indicatif", + "inquire", + "jwalk", + "log", + "num-format", + "once_cell", + "predicates 2.1.5", + "pyo3", + "regex", + "serde_json", + "tempfile", + "termtree 0.4.1", + "tiktoken-rs", +] + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.59.0", +] + +[[package]] +name = "console" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "dyn-clone" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" + +[[package]] +name = "either" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + +[[package]] +name = "fancy-regex" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fuzzy-matcher" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" +dependencies = [ + "thread_local", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "git2" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" +dependencies = [ + "bitflags 2.8.0", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "globset" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "handlebars" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.25.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] + +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width 0.2.0", + "web-time", +] + +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + +[[package]] +name = "inquire" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" +dependencies = [ + "bitflags 2.8.0", + "crossterm", + "dyn-clone", + "fuzzy-matcher", + "fxhash", + "newline-converter", + "once_cell", + "unicode-segmentation", + "unicode-width 0.1.14", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "jwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" +dependencies = [ + "crossbeam", + "rayon", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "libgit2-sys" +version = "0.16.2+1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "libz-sys" +version = "1.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", + "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 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "newline-converter" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b6b097ecb1cbfed438542d16e84fd7ad9b0c76c8a65b7f9039212a3d14dc7f" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "cfg-if", + "encoding_rs", + "itoa", + "lazy_static", + "libc", + "num-format-windows", + "widestring", + "winapi", +] + +[[package]] +name = "num-format-windows" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1e07f67225c1eb911d16c2f72492669c1fb08212dbfaa1f6cfbeb119152cfa" +dependencies = [ + "bindgen", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.8.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.8.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.8.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "once_cell" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-src" +version = "300.4.2+3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" +dependencies = [ + "memchr", + "thiserror 2.0.11", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "pest_meta" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" +dependencies = [ + "anstyle", + "difflib", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" + +[[package]] +name = "predicates-tree" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" +dependencies = [ + "predicates-core", + "termtree 0.5.1", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pyo3" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset", + "once_cell", + "portable-atomic", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb" +dependencies = [ + "once_cell", + "python3-dll-a", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028" +dependencies = [ + "heck", + "proc-macro2", + "pyo3-build-config", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "python3-dll-a" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49fe4227a288cf9493942ad0220ea3f185f4d1f2a14f197f7344d6d02f4ed4ed" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.8.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "serde_json" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tempfile" +version = "3.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "tiktoken-rs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44075987ee2486402f0808505dd65692163d243a337fc54363d49afac41087f6" +dependencies = [ + "anyhow", + "base64", + "bstr", + "fancy-regex", + "lazy_static", + "parking_lot", + "regex", + "rustc-hash", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.98", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[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.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] diff --git a/crates/code2prompt-core/Cargo.toml b/crates/code2prompt-core/Cargo.toml new file mode 100644 index 0000000..bded63a --- /dev/null +++ b/crates/code2prompt-core/Cargo.toml @@ -0,0 +1,56 @@ +[package] +name = "code2prompt_core" +version = "3.0.0" +authors = [ + "Mufeed VH ", + "Olivier D'Ancona ", +] +description = "A command-line (CLI) tool to generate an LLM prompt from codebases of any size, fast." +keywords = ["code", "ingestion", "prompt", "llm", "agent"] +categories = ["command-line-utilities", "development-tools"] +homepage = "https://code2prompt.dev" +documentation = "https://code2prompt.dev/docs/welcome" +repository = "https://github.com/mufeedvh/code2prompt" +license = "MIT" +exclude = [".github/*", ".assets/*"] +edition = "2021" +build = "build.rs" +readme = "../../README.md" + + +[features] +default = [] + +[dependencies] +anyhow = { workspace = true } +colored = { workspace = true } +indicatif = { workspace = true } +log = { workspace = true } +num-format = { workspace = true } +serde_json = { workspace = true } +handlebars = { workspace = true } +jwalk = { workspace = true } +termtree = { workspace = true } +tiktoken-rs = { workspace = true } +ignore = { workspace = true } +inquire = { workspace = true } +regex = { workspace = true } +git2 = { workspace = true } +once_cell = { workspace = true } +globset = { workspace = true } + +[lib] +name = "code2prompt_core" +path = "src/lib.rs" +# crate-type = ["cdylib", "rlib"] +crate-type = ["rlib"] + +[package.metadata.deb] +section = "utility" +assets = [["target/release/code2prompt_core", "/usr/bin/", "755"]] + +[dev-dependencies] +tempfile = "3.3" +assert_cmd = "2.0" +predicates = "2.0" +env_logger = "0.11.3" diff --git a/build.rs b/crates/code2prompt-core/build.rs similarity index 100% rename from build.rs rename to crates/code2prompt-core/build.rs diff --git a/src/filter.rs b/crates/code2prompt-core/src/filter.rs similarity index 100% rename from src/filter.rs rename to crates/code2prompt-core/src/filter.rs diff --git a/src/git.rs b/crates/code2prompt-core/src/git.rs similarity index 100% rename from src/git.rs rename to crates/code2prompt-core/src/git.rs diff --git a/crates/code2prompt-core/src/lib.rs b/crates/code2prompt-core/src/lib.rs new file mode 100644 index 0000000..0137a4f --- /dev/null +++ b/crates/code2prompt-core/src/lib.rs @@ -0,0 +1,7 @@ +pub mod filter; +pub mod git; +pub mod path; +pub mod sort; +pub mod template; +pub mod tokenizer; +pub mod util; diff --git a/src/path.rs b/crates/code2prompt-core/src/path.rs similarity index 99% rename from src/path.rs rename to crates/code2prompt-core/src/path.rs index cffa082..de20f29 100644 --- a/src/path.rs +++ b/crates/code2prompt-core/src/path.rs @@ -1,5 +1,4 @@ //! This module contains the functions for traversing the directory and processing the files. - use crate::filter::should_include_file; use crate::sort::{sort_files, sort_tree, FileSortMethod}; use crate::util::strip_utf8_bom; diff --git a/src/sort.rs b/crates/code2prompt-core/src/sort.rs similarity index 100% rename from src/sort.rs rename to crates/code2prompt-core/src/sort.rs diff --git a/src/template.rs b/crates/code2prompt-core/src/template.rs similarity index 100% rename from src/template.rs rename to crates/code2prompt-core/src/template.rs diff --git a/src/tokenizer.rs b/crates/code2prompt-core/src/tokenizer.rs similarity index 100% rename from src/tokenizer.rs rename to crates/code2prompt-core/src/tokenizer.rs diff --git a/src/util.rs b/crates/code2prompt-core/src/util.rs similarity index 100% rename from src/util.rs rename to crates/code2prompt-core/src/util.rs diff --git a/templates/binary-exploitation-ctf-solver.hbs b/crates/code2prompt-core/templates/binary-exploitation-ctf-solver.hbs similarity index 100% rename from templates/binary-exploitation-ctf-solver.hbs rename to crates/code2prompt-core/templates/binary-exploitation-ctf-solver.hbs diff --git a/templates/claude-xml.hbs b/crates/code2prompt-core/templates/claude-xml.hbs similarity index 100% rename from templates/claude-xml.hbs rename to crates/code2prompt-core/templates/claude-xml.hbs diff --git a/templates/clean-up-code.hbs b/crates/code2prompt-core/templates/clean-up-code.hbs similarity index 100% rename from templates/clean-up-code.hbs rename to crates/code2prompt-core/templates/clean-up-code.hbs diff --git a/templates/cryptography-ctf-solver.hbs b/crates/code2prompt-core/templates/cryptography-ctf-solver.hbs similarity index 100% rename from templates/cryptography-ctf-solver.hbs rename to crates/code2prompt-core/templates/cryptography-ctf-solver.hbs diff --git a/templates/document-the-code.hbs b/crates/code2prompt-core/templates/document-the-code.hbs similarity index 100% rename from templates/document-the-code.hbs rename to crates/code2prompt-core/templates/document-the-code.hbs diff --git a/templates/find-security-vulnerabilities.hbs b/crates/code2prompt-core/templates/find-security-vulnerabilities.hbs similarity index 100% rename from templates/find-security-vulnerabilities.hbs rename to crates/code2prompt-core/templates/find-security-vulnerabilities.hbs diff --git a/templates/fix-bugs.hbs b/crates/code2prompt-core/templates/fix-bugs.hbs similarity index 100% rename from templates/fix-bugs.hbs rename to crates/code2prompt-core/templates/fix-bugs.hbs diff --git a/templates/improve-performance.hbs b/crates/code2prompt-core/templates/improve-performance.hbs similarity index 100% rename from templates/improve-performance.hbs rename to crates/code2prompt-core/templates/improve-performance.hbs diff --git a/templates/refactor.hbs b/crates/code2prompt-core/templates/refactor.hbs similarity index 100% rename from templates/refactor.hbs rename to crates/code2prompt-core/templates/refactor.hbs diff --git a/templates/reverse-engineering-ctf-solver.hbs b/crates/code2prompt-core/templates/reverse-engineering-ctf-solver.hbs similarity index 100% rename from templates/reverse-engineering-ctf-solver.hbs rename to crates/code2prompt-core/templates/reverse-engineering-ctf-solver.hbs diff --git a/templates/web-ctf-solver.hbs b/crates/code2prompt-core/templates/web-ctf-solver.hbs similarity index 100% rename from templates/web-ctf-solver.hbs rename to crates/code2prompt-core/templates/web-ctf-solver.hbs diff --git a/templates/write-git-commit.hbs b/crates/code2prompt-core/templates/write-git-commit.hbs similarity index 100% rename from templates/write-git-commit.hbs rename to crates/code2prompt-core/templates/write-git-commit.hbs diff --git a/templates/write-github-pull-request.hbs b/crates/code2prompt-core/templates/write-github-pull-request.hbs similarity index 100% rename from templates/write-github-pull-request.hbs rename to crates/code2prompt-core/templates/write-github-pull-request.hbs diff --git a/templates/write-github-readme.hbs b/crates/code2prompt-core/templates/write-github-readme.hbs similarity index 100% rename from templates/write-github-readme.hbs rename to crates/code2prompt-core/templates/write-github-readme.hbs diff --git a/tests/clipboard_test.rs b/crates/code2prompt-core/tests/clipboard_test.rs similarity index 100% rename from tests/clipboard_test.rs rename to crates/code2prompt-core/tests/clipboard_test.rs diff --git a/tests/filter_test.rs b/crates/code2prompt-core/tests/filter_test.rs similarity index 99% rename from tests/filter_test.rs rename to crates/code2prompt-core/tests/filter_test.rs index 81cf71d..94884bd 100644 --- a/tests/filter_test.rs +++ b/crates/code2prompt-core/tests/filter_test.rs @@ -1,7 +1,7 @@ /// This file tests the filter logic /// Code2prompt uses the file globbing and globpattern to match files /// Therefore you can match files: -use code2prompt::filter::should_include_file; +use code2prompt_core::filter::should_include_file; use colored::*; use once_cell::sync::Lazy; use std::fs::{self, File}; diff --git a/tests/git_test.rs b/crates/code2prompt-core/tests/git_test.rs similarity index 99% rename from tests/git_test.rs rename to crates/code2prompt-core/tests/git_test.rs index 6b5b3df..353c4ad 100644 --- a/tests/git_test.rs +++ b/crates/code2prompt-core/tests/git_test.rs @@ -1,4 +1,4 @@ -use code2prompt::git::{get_git_diff, get_git_diff_between_branches, get_git_log}; +use code2prompt_core::git::{get_git_diff, get_git_diff_between_branches, get_git_log}; #[cfg(test)] mod tests { diff --git a/tests/sort_test.rs b/crates/code2prompt-core/tests/sort_test.rs similarity index 99% rename from tests/sort_test.rs rename to crates/code2prompt-core/tests/sort_test.rs index 639782d..c5d41f2 100644 --- a/tests/sort_test.rs +++ b/crates/code2prompt-core/tests/sort_test.rs @@ -1,4 +1,4 @@ -use code2prompt::{sort_files, sort_tree, FileSortMethod}; +use code2prompt_core::sort::{sort_files, sort_tree, FileSortMethod}; #[cfg(test)] mod tests { diff --git a/tests/template_test.rs b/crates/code2prompt-core/tests/template_test.rs similarity index 94% rename from tests/template_test.rs rename to crates/code2prompt-core/tests/template_test.rs index ecbef7a..c83296c 100644 --- a/tests/template_test.rs +++ b/crates/code2prompt-core/tests/template_test.rs @@ -1,4 +1,4 @@ -use code2prompt::template::{extract_undefined_variables, handlebars_setup, render_template}; +use code2prompt_core::template::{extract_undefined_variables, handlebars_setup, render_template}; #[cfg(test)] mod tests { diff --git a/tests/util_test.rs b/crates/code2prompt-core/tests/util_test.rs similarity index 96% rename from tests/util_test.rs rename to crates/code2prompt-core/tests/util_test.rs index bce3203..7ed94b4 100644 --- a/tests/util_test.rs +++ b/crates/code2prompt-core/tests/util_test.rs @@ -1,4 +1,4 @@ -use code2prompt::util::strip_utf8_bom; +use code2prompt_core::util::strip_utf8_bom; #[cfg(test)] mod tests { diff --git a/crates/code2prompt-python/.python-version b/crates/code2prompt-python/.python-version new file mode 100644 index 0000000..c10780c --- /dev/null +++ b/crates/code2prompt-python/.python-version @@ -0,0 +1 @@ +3.13.1 diff --git a/crates/code2prompt-python/Cargo.toml b/crates/code2prompt-python/Cargo.toml new file mode 100644 index 0000000..b219dcd --- /dev/null +++ b/crates/code2prompt-python/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "code2prompt-python" +version = "3.0.0" +edition = "2021" + +[lib] +name = "code2prompt_rs" +crate-type = ["cdylib"] + +[dependencies] +serde_json = { workspace = true } +code2prompt_core = { path = "../code2prompt-core" } +pyo3 = { workspace = true } diff --git a/crates/code2prompt-python/pyproject.toml b/crates/code2prompt-python/pyproject.toml new file mode 100644 index 0000000..13c988c --- /dev/null +++ b/crates/code2prompt-python/pyproject.toml @@ -0,0 +1,55 @@ +[project] +name = "code2prompt_rs" +version = "3.0.0" +description = "Python bindings for code2prompt" +authors = [ + { name = "Mufeed VH", email = "contact@mufeedvh.com" }, + { name = "Olivier D'Ancona", email = "olivier.dancona@master.hes-so.ch" }, +] +dependencies = [ + "maturin>=1.8.2", + "pytest>=8.3.4", + "pip>=25.0.1", + "patchelf>=0.17.2.1", +] +requires-python = ">= 3.11" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Rust", + "Topic :: Software Development :: Libraries :: Python Modules", +] + +[build-system] +requires = ["maturin>=1.0,<2.0"] +build-backend = "maturin" + +[tool.maturin] +bindings = "pyo3" +module-name = "code2prompt_rs" +manifest-path = "Cargo.toml" +python-source = "python-sdk" +features = ["pyo3/extension-module"] + +[tool.rye] +managed = true +dev-dependencies = ["maturin>=1.8.2"] + +[tool.rye.scripts] +build = "maturin develop" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["src/python_sdk"] + +[project.urls] +Homepage = "https://code2prompt.dev" +Documentation = "https://code2prompt.dev/docs/welcome" +Repository = "https://github.com/mufeedvh/code2prompt" diff --git a/python-sdk/.gitignore b/crates/code2prompt-python/python-sdk/.gitignore similarity index 100% rename from python-sdk/.gitignore rename to crates/code2prompt-python/python-sdk/.gitignore diff --git a/python-sdk/README.md b/crates/code2prompt-python/python-sdk/README.md similarity index 100% rename from python-sdk/README.md rename to crates/code2prompt-python/python-sdk/README.md diff --git a/python-sdk/__init__.py b/crates/code2prompt-python/python-sdk/__init__.py similarity index 100% rename from python-sdk/__init__.py rename to crates/code2prompt-python/python-sdk/__init__.py diff --git a/python-sdk/code2prompt/__init__.py b/crates/code2prompt-python/python-sdk/code2prompt_rs/__init__.py similarity index 82% rename from python-sdk/code2prompt/__init__.py rename to crates/code2prompt-python/python-sdk/code2prompt_rs/__init__.py index c163b0a..02acb00 100644 --- a/python-sdk/code2prompt/__init__.py +++ b/crates/code2prompt-python/python-sdk/code2prompt_rs/__init__.py @@ -8,6 +8,6 @@ - Count tokens for different models """ -from .code2prompt import CodePrompt +from .code2prompt_rs import Code2Prompt -__all__ = ['CodePrompt'] \ No newline at end of file +__all__ = ['Code2Prompt'] diff --git a/python-sdk/code2prompt/code2prompt.py b/crates/code2prompt-python/python-sdk/code2prompt_rs/code2promp_rs.py similarity index 93% rename from python-sdk/code2prompt/code2prompt.py rename to crates/code2prompt-python/python-sdk/code2prompt_rs/code2promp_rs.py index f172821..e022528 100644 --- a/python-sdk/code2prompt/code2prompt.py +++ b/crates/code2prompt-python/python-sdk/code2prompt_rs/code2promp_rs.py @@ -1,7 +1,7 @@ # Import the Rust module -from code2prompt import CodePrompt as RustCodePrompt +from code2prompt_rs import CodePrompt as RustCodePrompt -class CodePrompt: +class Code2Prompt: def __init__(self, path, include_patterns=None, exclude_patterns=None, include_priority=False, line_numbers=False, relative_paths=False, exclude_from_tree=False, no_codeblock=False, follow_symlinks=False): diff --git a/python-sdk/examples/basic_usage.py b/crates/code2prompt-python/python-sdk/examples/basic_usage.py similarity index 93% rename from python-sdk/examples/basic_usage.py rename to crates/code2prompt-python/python-sdk/examples/basic_usage.py index aaf36ed..d502c60 100644 --- a/python-sdk/examples/basic_usage.py +++ b/crates/code2prompt-python/python-sdk/examples/basic_usage.py @@ -1,10 +1,10 @@ """Example usage of the code2prompt Python SDK.""" -from code2prompt import CodePrompt +from code2prompt_rs import Code2Prompt def main(): - # Create a CodePrompt instance for the current directory - prompt = CodePrompt( + # Create a Code2Prompt instance for the current directory + prompt = Code2Prompt( path=".", include_patterns=["*.py", "*.rs"], # Only include Python and Rust files exclude_patterns=["**/tests/*"], # Exclude test files diff --git a/crates/code2prompt-python/requirements-dev.lock b/crates/code2prompt-python/requirements-dev.lock new file mode 100644 index 0000000..d45fbe1 --- /dev/null +++ b/crates/code2prompt-python/requirements-dev.lock @@ -0,0 +1,26 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +-e file:. +iniconfig==2.0.0 + # via pytest +maturin==1.8.2 + # via code2prompt-rs +packaging==24.2 + # via pytest +patchelf==0.17.2.1 + # via code2prompt-rs +pip==25.0.1 + # via code2prompt-rs +pluggy==1.5.0 + # via pytest +pytest==8.3.4 + # via code2prompt-rs diff --git a/crates/code2prompt-python/requirements.lock b/crates/code2prompt-python/requirements.lock new file mode 100644 index 0000000..d45fbe1 --- /dev/null +++ b/crates/code2prompt-python/requirements.lock @@ -0,0 +1,26 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +-e file:. +iniconfig==2.0.0 + # via pytest +maturin==1.8.2 + # via code2prompt-rs +packaging==24.2 + # via pytest +patchelf==0.17.2.1 + # via code2prompt-rs +pip==25.0.1 + # via code2prompt-rs +pluggy==1.5.0 + # via pytest +pytest==8.3.4 + # via code2prompt-rs diff --git a/crates/code2prompt-python/src/lib.rs b/crates/code2prompt-python/src/lib.rs new file mode 100644 index 0000000..e83684b --- /dev/null +++ b/crates/code2prompt-python/src/lib.rs @@ -0,0 +1 @@ +mod python; diff --git a/src/python.rs b/crates/code2prompt-python/src/python.rs similarity index 93% rename from src/python.rs rename to crates/code2prompt-python/src/python.rs index bed55ea..e6954b6 100644 --- a/src/python.rs +++ b/crates/code2prompt-python/src/python.rs @@ -2,24 +2,23 @@ use pyo3::prelude::*; use pyo3::types::PyDict; use std::path::PathBuf; -use crate::{ - count_tokens, +use code2prompt_core::{ git::{get_git_diff, get_git_diff_between_branches, get_git_log}, path::traverse_directory, template::{handlebars_setup, render_template}, - TokenizerType, + tokenizer::{count_tokens, TokenizerType}, }; /// Python module for code2prompt -#[pymodule] -fn code2prompt(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { - m.add_class::()?; +#[pymodule(name = "code2prompt_rs")] +fn code2prompt_rs(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { + m.add_class::()?; Ok(()) } /// Main class for generating prompts from code #[pyclass] -struct CodePrompt { +struct Code2Prompt { path: PathBuf, include_patterns: Vec, exclude_patterns: Vec, @@ -34,8 +33,8 @@ struct CodePrompt { } #[pymethods] -impl CodePrompt { - /// Create a new CodePrompt instance +impl Code2Prompt { + /// Create a new Code2Prompt instance /// /// Args: /// path (str): Path to the codebase directory @@ -120,8 +119,8 @@ impl CodePrompt { .map_err(|e| PyErr::new::(e.to_string()))?; // Setup template - let template_content = - template.unwrap_or_else(|| include_str!("default_template_md.hbs").to_string()); + let template_content = template + .unwrap_or_else(|| include_str!("../../default_template_md.hbs").to_string()); let handlebars = handlebars_setup(&template_content, "template") .map_err(|e| PyErr::new::(e.to_string()))?; diff --git a/crates/code2prompt/Cargo.toml b/crates/code2prompt/Cargo.toml new file mode 100644 index 0000000..5869e7b --- /dev/null +++ b/crates/code2prompt/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "code2prompt" +version = "3.0.0" +edition = "2021" +description = "Command-line interface for code2prompt" +license = "MIT" +repository = "https://github.com/mufeedvh/code2prompt" + +[dependencies] +code2prompt_core = { path = "../code2prompt-core" } +clap = { workspace = true } +env_logger = { workspace = true } +arboard = { workspace = true } +anyhow = { workspace = true } +colored = { workspace = true } +indicatif = { workspace = true } +log = { workspace = true } +num-format = { workspace = true } +serde_json = { workspace = true } + +[[bin]] +name = "code2prompt" +path = "src/main.rs" + +[dev-dependencies] +tempfile = "3.3" +assert_cmd = "2.0" +predicates = "2.0" +env_logger = "0.11.3" diff --git a/crates/code2prompt/src/args.rs b/crates/code2prompt/src/args.rs new file mode 100644 index 0000000..ca2e60d --- /dev/null +++ b/crates/code2prompt/src/args.rs @@ -0,0 +1,103 @@ +use clap::Parser; +use code2prompt_core::{template::OutputFormat, tokenizer::TokenFormat}; +use std::path::PathBuf; + +// ~~~ CLI Arguments ~~~ +#[derive(Parser)] +#[clap( + name = env!("CARGO_PKG_NAME"), + version = env!("CARGO_PKG_VERSION"), + author = env!("CARGO_PKG_AUTHORS") +)] +#[command(arg_required_else_help = true)] +pub struct Cli { + /// Path to the codebase directory + #[arg()] + pub path: PathBuf, + + /// Patterns to include + #[clap(short = 'i', long)] + pub include: Option, + + /// Patterns to exclude + #[clap(short = 'e', long)] + pub exclude: Option, + + /// Include files in case of conflict between include and exclude patterns + #[clap(long)] + pub include_priority: bool, + + /// Optional output file path + #[clap(short = 'O', long = "output-file")] + pub output_file: Option, + + /// Output format: markdown, json, or xml + #[clap(short = 'F', long = "output-format", default_value = "markdown")] + pub output_format: OutputFormat, + + /// Optional Path to a custom Handlebars template + #[clap(short, long)] + pub template: Option, + + /// List the full directory tree + #[clap(long)] + pub full_directory_tree: bool, + + /// Optional tokenizer to use for token count + /// + /// Supported tokenizers: cl100k (default), p50k, p50k_edit, r50k, gpt2 + #[clap(short = 'c', long)] + pub encoding: Option, + + /// Display the token count of the generated prompt. + /// Accepts a format: "raw" (machine parsable) or "format" (human readable). + #[clap(long, value_name = "FORMAT", default_value = "format")] + pub tokens: TokenFormat, + + /// Include git diff + #[clap(short, long)] + pub diff: bool, + + /// Generate git diff between two branches + #[clap(long, value_name = "BRANCHES")] + pub git_diff_branch: Option, + + /// Retrieve git log between two branches + #[clap(long, value_name = "BRANCHES")] + pub git_log_branch: Option, + + /// Add line numbers to the source code + #[clap(short, long)] + pub line_number: bool, + + /// Use relative paths instead of absolute paths, including the parent directory + #[clap(long)] + pub relative_paths: bool, + + /// Follow symlinks + #[clap(short = 'L', long)] + pub follow_symlinks: bool, + + /// Include hidden directories and files + #[clap(long)] + pub hidden: bool, + + /// Disable wrapping code inside markdown code blocks + #[clap(long)] + pub no_codeblock: bool, + + /// Optional Disable copying to clipboard + #[clap(long)] + pub no_clipboard: bool, + + /// Skip .gitignore rules + #[clap(long)] + pub no_ignore: bool, + + /// Sort order for files: one of "name_asc", "name_desc", "date_asc", or "date_desc" + #[clap(long)] + pub sort: Option, + + #[arg(long, hide = true)] + pub clipboard_daemon: bool, +} diff --git a/src/clipboard.rs b/crates/code2prompt/src/clipboard.rs similarity index 97% rename from src/clipboard.rs rename to crates/code2prompt/src/clipboard.rs index cb3d90c..e1e5517 100644 --- a/src/clipboard.rs +++ b/crates/code2prompt/src/clipboard.rs @@ -1,6 +1,6 @@ -use anyhow::{Context, Result}; -use arboard::Clipboard; +use anyhow::Context; +#[cfg(not(target_os = "linux"))] /// Copies the provided text to the system clipboard. /// /// This is a simple, one-shot copy operation suitable for non-Linux platforms @@ -14,6 +14,8 @@ use arboard::Clipboard; /// /// * `Result<()>` - Returns Ok on success, or an error if the clipboard could not be accessed. pub fn copy_text_to_clipboard(rendered: &str) -> Result<()> { + use anyhow::Result; + use arboard::Clipboard; match Clipboard::new() { Ok(mut clipboard) => { clipboard diff --git a/src/main.rs b/crates/code2prompt/src/main.rs similarity index 74% rename from src/main.rs rename to crates/code2prompt/src/main.rs index 228d54c..c8a1999 100644 --- a/src/main.rs +++ b/crates/code2prompt/src/main.rs @@ -1,120 +1,27 @@ //! code2prompt is a command-line tool to generate an LLM prompt from a codebase directory. //! //! Authors: Mufeed VH (@mufeedvh), Olivier D'Ancona (@ODAncona) +mod args; +mod clipboard; use anyhow::{Context, Result}; +use args::Cli; use clap::Parser; -use code2prompt::{ - count_tokens, get_git_diff, get_git_diff_between_branches, get_git_log, - handle_undefined_variables, handlebars_setup, label, render_template, traverse_directory, - write_to_file, FileSortMethod, OutputFormat, TokenFormat, TokenizerType, + +use code2prompt_core::{ + git::{get_git_diff, get_git_diff_between_branches, get_git_log}, + path::{label, traverse_directory}, + sort::FileSortMethod, + template::{ + handle_undefined_variables, handlebars_setup, render_template, write_to_file, OutputFormat, + }, + tokenizer::{count_tokens, TokenFormat, TokenizerType}, }; use colored::*; use indicatif::{ProgressBar, ProgressStyle}; use log::{debug, error, info}; use num_format::{SystemLocale, ToFormattedString}; use serde_json::json; -use std::path::PathBuf; - -// ~~~ CLI Arguments ~~~ -#[derive(Parser)] -#[clap( - name = env!("CARGO_PKG_NAME"), - version = env!("CARGO_PKG_VERSION"), - author = env!("CARGO_PKG_AUTHORS") -)] -#[command(arg_required_else_help = true)] -struct Cli { - /// Path to the codebase directory - #[arg()] - path: PathBuf, - - /// Patterns to include - #[clap(short = 'i', long)] - include: Option, - - /// Patterns to exclude - #[clap(short = 'e', long)] - exclude: Option, - - /// Include files in case of conflict between include and exclude patterns - #[clap(long)] - include_priority: bool, - - /// Optional output file path - #[clap(short = 'O', long = "output-file")] - output_file: Option, - - /// Output format: markdown, json, or xml - #[clap(short = 'F', long = "output-format", default_value = "markdown")] - output_format: OutputFormat, - - /// Optional Path to a custom Handlebars template - #[clap(short, long)] - template: Option, - - /// List the full directory tree - #[clap(long)] - full_directory_tree: bool, - - /// Optional tokenizer to use for token count - /// - /// Supported tokenizers: cl100k (default), p50k, p50k_edit, r50k, gpt2 - #[clap(short = 'c', long)] - encoding: Option, - - /// Display the token count of the generated prompt. - /// Accepts a format: "raw" (machine parsable) or "format" (human readable). - #[clap(long, value_name = "FORMAT", default_value = "format")] - tokens: TokenFormat, - - /// Include git diff - #[clap(short, long)] - diff: bool, - - /// Generate git diff between two branches - #[clap(long, value_name = "BRANCHES")] - git_diff_branch: Option, - - /// Retrieve git log between two branches - #[clap(long, value_name = "BRANCHES")] - git_log_branch: Option, - - /// Add line numbers to the source code - #[clap(short, long)] - line_number: bool, - - /// Use relative paths instead of absolute paths, including the parent directory - #[clap(long)] - relative_paths: bool, - - /// Follow symlinks - #[clap(short = 'L', long)] - follow_symlinks: bool, - - /// Include hidden directories and files - #[clap(long)] - hidden: bool, - - /// Disable wrapping code inside markdown code blocks - #[clap(long)] - no_codeblock: bool, - - /// Optional Disable copying to clipboard - #[clap(long)] - no_clipboard: bool, - - /// Skip .gitignore rules - #[clap(long)] - no_ignore: bool, - - /// Sort order for files: one of "name_asc", "name_desc", "date_asc", or "date_desc" - #[clap(long)] - sort: Option, - - #[arg(long, hide = true)] - clipboard_daemon: bool, -} fn main() -> Result<()> { env_logger::init(); @@ -124,7 +31,7 @@ fn main() -> Result<()> { // ~~~ Clipboard Daemon ~~~ #[cfg(target_os = "linux")] { - use code2prompt::serve_clipboard_daemon; + use clipboard::serve_clipboard_daemon; if args.clipboard_daemon { info! {"Serving clipboard daemon..."}; serve_clipboard_daemon()?; @@ -156,7 +63,6 @@ fn main() -> Result<()> { }; // ~~~ Traverse the directory ~~~ - let create_tree = traverse_directory( &args.path, &include_patterns, @@ -300,7 +206,7 @@ fn main() -> Result<()> { if !args.no_clipboard { #[cfg(target_os = "linux")] { - use code2prompt::spawn_clipboard_daemon; + use clipboard::spawn_clipboard_daemon; spawn_clipboard_daemon(&rendered)?; } #[cfg(not(target_os = "linux"))] @@ -396,11 +302,11 @@ fn get_template(args: &Cli) -> Result<(String, String)> { } else { match format { OutputFormat::Markdown | OutputFormat::Json => Ok(( - include_str!("default_template_md.hbs").to_string(), + include_str!("../../default_template_md.hbs").to_string(), "markdown".to_string(), )), OutputFormat::Xml => Ok(( - include_str!("default_template_xml.hbs").to_string(), + include_str!("../../default_template_xml.hbs").to_string(), "xml".to_string(), )), } diff --git a/tests/integration_test.rs b/crates/code2prompt/tests/integration_test.rs similarity index 100% rename from tests/integration_test.rs rename to crates/code2prompt/tests/integration_test.rs diff --git a/src/default_template_md.hbs b/crates/default_template_md.hbs similarity index 100% rename from src/default_template_md.hbs rename to crates/default_template_md.hbs diff --git a/src/default_template_xml.hbs b/crates/default_template_xml.hbs similarity index 100% rename from src/default_template_xml.hbs rename to crates/default_template_xml.hbs diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 7585238..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -book diff --git a/docs/book.toml b/docs/book.toml deleted file mode 100644 index 03aedb1..0000000 --- a/docs/book.toml +++ /dev/null @@ -1,9 +0,0 @@ -[book] -authors = ["ODAncona","Mufeed VH"] -language = "en" -multilingual = false -src = "src" -title = "Code2prompt Documentation" - -[output.html] -mathjax-support = true \ No newline at end of file diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md deleted file mode 100644 index 61d2be4..0000000 --- a/docs/src/SUMMARY.md +++ /dev/null @@ -1,24 +0,0 @@ -# Summary - -[Introduction](introduction.md) - -# ๐Ÿ› ๏ธ Tutorials ๐Ÿ› ๏ธ - -- [Use Glob Pattern Filter](tutorials/use_filter.md) -- [Use Handlebars Templates](tutorials/templates.md) - -# ๐Ÿ—๏ธ How-To Guides ๐Ÿ—๏ธ - -- [Installation Guide](how_to/install.md) -- [Usage Guide](how_to/filter_files.md) - -# ๐Ÿ“– Explanations ๐Ÿ“– - -- [How the Glob Pattern Filter Works](explanations/glob_pattern_filter.md) -- [Understanding Tokenizers](explanations/tokenizers.md) -- [What are Glob Patterns](explanations/glob_patterns.md) - - diff --git a/docs/src/assets/filter.png b/docs/src/assets/filter.png deleted file mode 100644 index ad0fc78..0000000 Binary files a/docs/src/assets/filter.png and /dev/null differ diff --git a/docs/src/explanations/glob_pattern_filter.md b/docs/src/explanations/glob_pattern_filter.md deleted file mode 100644 index 902358a..0000000 --- a/docs/src/explanations/glob_pattern_filter.md +++ /dev/null @@ -1,50 +0,0 @@ -# How the Glob Pattern Filter Works - -The tool uses glob patterns to include or exclude files and directories, working similarly to tools like `tree` or `grep`. Hereโ€™s a detailed explanation: - -## Key Concepts - -- **Include List (A)**: A set containing the glob patterns for files and directories you want to include. -- **Exclude List (B)**: A set containing the glob patterns for files and directories you want to exclude. -- **Universe (ฮฉ)**: The set of all files and directories. - -When you specify an `--exclude` list and/or an `--include` list, the following logic applies: - -### Cases and Logic - -1. **No include list, no exclude list** - Include everything: - $$ - \neg A \cap \neg B \implies \Omega - $$ - -2. **No include list, with exclude list** - Include everything except what matches the exclude list: - $$ - \neg A \cap B \implies \Omega \setminus B - $$ - -3. **With include list, no exclude list** - Include only what matches the include list: - $$ - A \cap \neg B \implies A - $$ - -4. **With include list and exclude list** - Include what matches the include list and exclude what matches the exclude list. Handle the intersection based on the `include_priority` parameter: - - - **Include priority == true**: - $$ - A \setminus (A \cap B) - $$ - - - **Include priority != true***: - $$ - B \setminus (A \cap B) - $$ - -### Visual Representation of Case 4 - -Let (A) and (B) overlap. Depending on the priority, the intersection $$( A \cap B )$$ is either included or excluded based on the `include_priority` parameter. - -![Visual Representation of Case 4](../../assets/filter.png) diff --git a/docs/src/explanations/glob_pattern_tool.md b/docs/src/explanations/glob_pattern_tool.md deleted file mode 100644 index d883e30..0000000 --- a/docs/src/explanations/glob_pattern_tool.md +++ /dev/null @@ -1 +0,0 @@ -# How the Glob Pattern Tool Works diff --git a/docs/src/explanations/glob_patterns.md b/docs/src/explanations/glob_patterns.md deleted file mode 100644 index 0ddf7b4..0000000 --- a/docs/src/explanations/glob_patterns.md +++ /dev/null @@ -1,67 +0,0 @@ -# Glob Patterns - -Glob patterns are a simple yet powerful way to match file names and paths using wildcard characters. They are commonly used in command-line interfaces and programming languages to specify sets of filenames or directories. Here's a breakdown of the most commonly used glob patterns: - -## Basic Wildcards - -- `*`: Matches any number of characters, including zero characters. - - Example: `*.txt` matches all files ending with `.txt`. - -- `?`: Matches exactly one character. - - Example: `file?.txt` matches `file1.txt`, `fileA.txt`, but not `file10.txt`. - -- `[]`: Matches any one of the enclosed characters. - - Example: `file[1-3].txt` matches `file1.txt`, `file2.txt`, `file3.txt`. - -- `[!]` or `[^]`: Matches any character not enclosed. - - Example: `file[!1-3].txt` matches `file4.txt`, `fileA.txt`, but not `file1.txt`. - -## Advanced Patterns - -- `**`: Matches any number of directories and subdirectories recursively. - - Example: `**/*.txt` matches all `.txt` files in the current directory and all subdirectories. - -- `{}`: Matches any of the comma-separated patterns enclosed. - - Example: `file{1,2,3}.txt` matches `file1.txt`, `file2.txt`, `file3.txt`. - -## Examples - -1. **Matching all text files in a directory:** - - ```sh - *.txt - ``` - -2. **Matching all files with a single digit before the extension:** - - ```sh - file?.txt - ``` - -3. **Matching files with extensions `.jpg` or `.png`:** - - ```sh - *.{jpg,png} - ``` - -4. **Matching all `.txt` files in any subdirectory:** - - ```sh - **/*.txt - ``` - -5. **Matching files that start with `a` or `b` and end with `.txt`:** - - ```sh - {a,b}*.txt - ``` - -## Use Cases - -- **Command-Line Tools:** Glob patterns are extensively used in command-line tools like `ls`, `cp`, `mv`, and `rm` to specify multiple files or directories. -- **Programming Languages:** Languages like Python, JavaScript, and Ruby support glob patterns for file matching through libraries like `glob` in Python. -- **Build Systems:** Tools like Makefile use glob patterns to specify source files and dependencies. - -## Conclusion - -Glob patterns provide a flexible and intuitive way to match filenames and paths, making them invaluable for scripting, automation, and file management tasks. Understanding and utilizing these patterns can significantly enhance your productivity and efficiency in handling files and directories. diff --git a/docs/src/explanations/tokenizers.md b/docs/src/explanations/tokenizers.md deleted file mode 100644 index 3968b20..0000000 --- a/docs/src/explanations/tokenizers.md +++ /dev/null @@ -1,18 +0,0 @@ -# Tokenizers for `code2prompt` - -When working with language models, text needs to be transformed into a format that the model can understandโ€”**tokens**, which are sequences of numbers. This transformation is handled by a **tokenizer**. - ---- - -## What is a Tokenizer? - -A tokenizer converts raw text into tokens, which are the building blocks for how language models process input. These tokens can represent words, subwords, or even individual characters, depending on the tokenizer's design. - -For `code2prompt`, we use the **tiktoken** tokenizer. Itโ€™s efficient, robust, and optimized for OpenAI models. -You can explore its functionality in the official repository - -๐Ÿ‘‰ [tiktoken GitHub Repository](https://github.com/openai/tiktoken) - -If you want to learn more about tokenizer in general, check out the - -๐Ÿ‘‰ [Mistral Tokenization Guide](https://docs.mistral.ai/guides/tokenization/). diff --git a/docs/src/how_to/exclude_files_from_tree.md b/docs/src/how_to/exclude_files_from_tree.md deleted file mode 100644 index cced430..0000000 --- a/docs/src/how_to/exclude_files_from_tree.md +++ /dev/null @@ -1 +0,0 @@ -# Exclude Files from Tree diff --git a/docs/src/how_to/filter_files.md b/docs/src/how_to/filter_files.md deleted file mode 100644 index 004ae18..0000000 --- a/docs/src/how_to/filter_files.md +++ /dev/null @@ -1,103 +0,0 @@ - -## Usage - -Generate a prompt from a codebase directory: - -```sh -code2prompt path/to/codebase -``` - -Use a custom Handlebars template file: - -```sh -code2prompt path/to/codebase -t path/to/template.hbs -``` - -Filter files using glob patterns: - -```sh -code2prompt path/to/codebase --include="*.rs,*.toml" -``` - -Exclude files using glob patterns: - -```sh -code2prompt path/to/codebase --exclude="*.txt,*.md" -``` - -Exclude files/folders from the source tree based on exclude patterns: - -```sh -code2prompt path/to/codebase --exclude="*.npy,*.wav" --exclude-from-tree -``` - -Display the token count of the generated prompt: - -```sh -code2prompt path/to/codebase --tokens -``` - -Specify a tokenizer for token count: - -```sh -code2prompt path/to/codebase --tokens --encoding=p50k -``` - -Supported tokenizers: `cl100k`, `p50k`, `p50k_edit`, `r50k_bas`. -> [!NOTE] -> See [Tokenizers](#tokenizers) for more details. - -Save the generated prompt to an output file: - -```sh -code2prompt path/to/codebase --output=output.txt -``` - -Print output as JSON: - -```sh -code2prompt path/to/codebase --json -``` - -The JSON output will have the following structure: - -```json -{ - "prompt": "", - "directory_name": "codebase", - "token_count": 1234, - "model_info": "ChatGPT models, text-embedding-ada-002", - "files": [] -} -``` - -Generate a Git commit message (for staged files): - -```sh -code2prompt path/to/codebase --diff -t templates/write-git-commit.hbs -``` - -Generate a Pull Request with branch comparing (for staged files): - -```sh -code2prompt path/to/codebase --git-diff-branch 'main, development' --git-log-branch 'main, development' -t templates/write-github-pull-request.hbs -``` - -Add line numbers to source code blocks: - -```sh -code2prompt path/to/codebase --line-number -``` - -Disable wrapping code inside markdown code blocks: - -```sh -code2prompt path/to/codebase --no-codeblock -``` - -- Rewrite the code to another language. -- Find bugs/security vulnerabilities. -- Document the code. -- Implement new features. - -> I initially wrote this for personal use to utilize Claude 3.0's 200K context window and it has proven to be pretty useful so I decided to open-source it! diff --git a/docs/src/how_to/install.md b/docs/src/how_to/install.md deleted file mode 100644 index c41dcfb..0000000 --- a/docs/src/how_to/install.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Installation - -## Binary releases - -Download the latest binary for your OS from [Releases](https://github.com/mufeedvh/code2prompt/releases). - -## Source build - -Requires: - -- [Git](https://git-scm.org/downloads), [Rust](https://rust-lang.org/tools/install) and Cargo. - -```sh -git clone https://github.com/mufeedvh/code2prompt.git -cd code2prompt/ -cargo build --release -``` - -# cargo - -installs from the [`crates.io`](https://crates.io) registry. - -```sh -cargo install code2prompt -``` - -For unpublished builds: - -```sh -cargo install --git https://github.com/mufeedvh/code2prompt -``` - -## AUR - -`code2prompt` is available in the [`AUR`](https://aur.archlinux.org/packages?O=0&K=code2prompt). Install it via any AUR helpers. - -```sh -paru/yay -S code2prompt -``` - -## Nix - -If you are on nix, You can use `nix-env` or `profile` to install. - -```sh -# without flakes: -nix-env -iA nixpkgs.code2prompt -# with flakes: -nix profile install nixpkgs#code2prompt -``` diff --git a/docs/src/how_to/save_generated_prompt.md b/docs/src/how_to/save_generated_prompt.md deleted file mode 100644 index 71a0424..0000000 --- a/docs/src/how_to/save_generated_prompt.md +++ /dev/null @@ -1 +0,0 @@ -# Save Generated Prompt diff --git a/docs/src/introduction.md b/docs/src/introduction.md deleted file mode 100644 index eded9ed..0000000 --- a/docs/src/introduction.md +++ /dev/null @@ -1,71 +0,0 @@ -# Introduction to `code2prompt` - -`code2prompt` is a powerful command-line tool designed to generate large language model (LLM) prompts directly from your codebase. It simplifies the process of combining and formatting code, making it easy to analyze, document, or refactor code using LLMs like GPT or Claude. - -This tool is built with scalability and customization in mind, allowing you to handle even the largest codebases effortlessly. Whether you are generating documentation, searching for bugs, or refactoring code, `code2prompt` provides the flexibility and precision needed for various development tasks. - ---- - -## Key Features - -- **Generate LLM Prompts**: Quickly convert entire codebases into structured LLM prompts. -- **Glob Pattern Filtering**: Include or exclude specific files and directories using glob patterns. -- **Customizable Templates**: Tailor prompt generation with Handlebars templates. -- **Token Counting**: Analyze token usage and optimize for LLMs with varying context windows. -- **Git Integration**: Include Git diffs and commit messages in prompts for code reviews. -- **Respects `.gitignore`**: Automatically ignores files listed in `.gitignore` to streamline prompt generation. - ---- - -## Getting Started - -### Installation - -Check out the ๐Ÿ‘‰ [Installation Guide](../how_to/install.md) for detailed instructions on how to install `code2prompt`. - -### Usage - -Check out the ๐Ÿ‘‰ [Filter Files Guide](../how_to/filter_files.md) to learn how to filter files using glob patterns. - -Check out the ๐Ÿ‘‰ [Templates Guide](../tutorials/templates.md) to learn how to use custom Handlebars templates. - -With `code2prompt`, you can unlock the full potential of LLMs by creating well-structured and meaningful prompts from your codebase. Let's get started! - ---- - -## Why `code2prompt`? - -1. **Save Time**: - - Automates the process of traversing a codebase and formatting files for LLMs. - - Avoids repetitive copy-pasting of code. - -2. **Improve Productivity**: - - Provides a structured and consistent format for code analysis. - - Helps identify bugs, refactor code, and write documentation faster. - -3. **Handle Large Codebases**: - - Designed to work seamlessly with large codebases, respecting context limits of LLMs. - -4. **Customizable Workflows**: - - Flexible options for filtering files, using templates, and generating targeted prompts. - ---- - -## Example Use Cases - -- **Code Documentation**: - Automatically generate documentation for public functions, methods, and classes. - -- **Bug Detection**: - Find potential bugs and vulnerabilities by analyzing your codebase with LLMs. - -- **Refactoring**: - Simplify and optimize code by generating prompts for code quality improvements. - -- **Learning and Exploration**: - Understand new codebases by generating summaries and detailed breakdowns. - -- **Git Commit and PR Descriptions**: - Generate meaningful commit messages and pull request descriptions from Git diffs. - ---- diff --git a/docs/src/references/command_line_options.md b/docs/src/references/command_line_options.md deleted file mode 100644 index 158691d..0000000 --- a/docs/src/references/command_line_options.md +++ /dev/null @@ -1 +0,0 @@ -# Command-Line Options diff --git a/docs/src/references/default_template.md b/docs/src/references/default_template.md deleted file mode 100644 index 2e1ecbf..0000000 --- a/docs/src/references/default_template.md +++ /dev/null @@ -1 +0,0 @@ -# Default Template diff --git a/docs/src/tutorials/getting_started.md b/docs/src/tutorials/getting_started.md deleted file mode 100644 index bad5562..0000000 --- a/docs/src/tutorials/getting_started.md +++ /dev/null @@ -1 +0,0 @@ -# Getting Started diff --git a/docs/src/tutorials/templates.md b/docs/src/tutorials/templates.md deleted file mode 100644 index 3ed9ed6..0000000 --- a/docs/src/tutorials/templates.md +++ /dev/null @@ -1,52 +0,0 @@ - -## Templates - -`code2prompt` comes with a set of built-in templates for common use cases. You can find them in the [`templates`](templates) directory. - -### [`document-the-code.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/document-the-code.hbs) - -Use this template to generate prompts for documenting the code. It will add documentation comments to all public functions, methods, classes and modules in the codebase. - -### [`find-security-vulnerabilities.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/find-security-vulnerabilities.hbs) - -Use this template to generate prompts for finding potential security vulnerabilities in the codebase. It will look for common security issues and provide recommendations on how to fix or mitigate them. - -### [`clean-up-code.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/clean-up-code.hbs) - -Use this template to generate prompts for cleaning up and improving the code quality. It will look for opportunities to improve readability, adherence to best practices, efficiency, error handling, and more. - -### [`fix-bugs.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/fix-bugs.hbs) - -Use this template to generate prompts for fixing bugs in the codebase. It will help diagnose issues, provide fix suggestions, and update the code with proposed fixes. - -### [`write-github-pull-request.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/write-github-pull-request.hbs) - -Use this template to create GitHub pull request description in markdown by comparing the git diff and git log of two branches. - -### [`write-github-readme.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/write-github-readme.hbs) - -Use this template to generate a high-quality README file for the project, suitable for hosting on GitHub. It will analyze the codebase to understand its purpose and functionality, and generate the README content in Markdown format. - -### [`write-git-commit.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/write-git-commit.hbs) - -Use this template to generate git commits from the staged files in your git directory. It will analyze the codebase to understand its purpose and functionality, and generate the git commit message content in Markdown format. - -### [`improve-performance.hbs`](https://github.com/mufeedvh/code2prompt/tree/main/templates/improve-performance.hbs) - -Use this template to generate prompts for improving the performance of the codebase. It will look for optimization opportunities, provide specific suggestions, and update the code with the changes. - -You can use these templates by passing the `-t` flag followed by the path to the template file. For example: - -```sh -code2prompt path/to/codebase -t templates/document-the-code.hbs -``` - -## User Defined Variables - -`code2prompt` supports the use of user defined variables in the Handlebars templates. Any variables in the template that are not part of the default context (`absolute_code_path`, `source_tree`, `files`) will be treated as user defined variables. - -During prompt generation, `code2prompt` will prompt the user to enter values for these user defined variables. This allows for further customization of the generated prompts based on user input. - -For example, if your template includes `{{challenge_name}}` and `{{challenge_description}}`, you will be prompted to enter values for these variables when running `code2prompt`. - -This feature enables creating reusable templates that can be adapted to different scenarios based on user provided information. diff --git a/docs/src/tutorials/use_filter.md b/docs/src/tutorials/use_filter.md deleted file mode 100644 index 0b14081..0000000 --- a/docs/src/tutorials/use_filter.md +++ /dev/null @@ -1,155 +0,0 @@ -# Using the Glob Pattern Filter - -This tutorial demonstrates how to use the **glob pattern tool** in `code2prompt` to filter and manage files based on include and exclude patterns. Glob patterns work similarly to tools like `tree` or `grep`, providing powerful filtering capabilities. Check out the [detailed explanation](../explanations/glob_pattern_tool.md) for more information. - ---- - -## Prerequisites - -Ensure you have `code2prompt` installed. If you havenโ€™t installed it yet, refer to the [Installation Guide](../how_to/install.md). - ---- - -## Understanding Include and Exclude Patterns - -Glob patterns allow you to specify rules for filtering files and directories. - -- **Include Patterns** (`--include`): Specify files and directories you want to include. -- **Exclude Patterns** (`--exclude`): Specify files and directories you want to exclude. -- **Priority** (`--include-priority`): Resolves conflicts between include and exclude patterns. - ---- - -## Setting Up the Environment - -To practice with glob patterns, letโ€™s create a sample folder structure with some files. - -### Bash Script to Generate the Test Structure - -Run this script to set up a temporary directory structure: - -```bash -#!/bin/bash - -# Create base directory -mkdir -p test_dir/{lowercase,uppercase,.secret} - -# Create files in the structure -echo "content foo.py" > "test_dir/lowercase/foo.py" -echo "content bar.py" > "test_dir/lowercase/bar.py" -echo "content baz.py" > "test_dir/lowercase/baz.py" -echo "content qux.txt" > "test_dir/lowercase/qux.txt" -echo "content corge.txt" > "test_dir/lowercase/corge.txt" -echo "content grault.txt" > "test_dir/lowercase/grault.txt" - -echo "CONTENT FOO.py" > "test_dir/uppercase/FOO.PY" -echo "CONTENT BAR.py" > "test_dir/uppercase/BAR.PY" -echo "CONTENT BAZ.py" > "test_dir/uppercase/BAZ.PY" -echo "CONTENT QUX.txt" > "test_dir/uppercase/QUX.TXT" -echo "CONTENT CORGE.txt" > "test_dir/uppercase/CORGE.TXT" -echo "CONTENT GRAULT.txt" > "test_dir/uppercase/GRAULT.TXT" - -echo "top secret" > "test_dir/.secret/secret.txt" -``` - -To clean up the structure later, run: - -```bash -rm -rf test_dir -``` - ---- - -## Examples: Filtering Files with Include and Exclude Patterns - -### Case 1: No Include, No Exclude - -Command: - -```bash -code2prompt test_dir -``` - -#### Result - -All files are included: - -- `lowercase/foo.py` -- `lowercase/bar.py` -- `uppercase/FOO.py` -- `.secret/secret.txt` - ---- - -### Case 2: Exclude Specific File Types - -Exclude `.txt` files: - -```bash -code2prompt test_dir --exclude="*.txt" -``` - -#### Result - -Excluded: - -- All `.txt` files - -Included: - -- `lowercase/foo.py` -- `lowercase/bar.py` -- `uppercase/FOO.py` - ---- - -### Case 3: Include Specific File Types - -Include only Python files: - -```bash -code2prompt test_dir --include="*.py" -``` - -#### Result - -Included: - -- All `.py` files - -Excluded: - -- `.secret/secret.txt` - ---- - -### Case 4: Include and Exclude with Priority - -Include `.py` files but exclude files in the `uppercase` folder: - -```bash -code2prompt test_dir --include="*.py" --exclude="**/uppercase/*" --include-priority=true -``` - -#### Result - -Included: - -- All `lowercase/1` files having `.py` extension - -Excluded: - -- All `uppercase` files -- `.secret/secret.txt` - ---- - -## Summary - -The glob pattern tool in `code2prompt` allows you to filter files and directories effectively using: - -- `--include` for specifying files to include -- `--exclude` for files to exclude -- `--include-priority` for resolving conflicts between patterns - -To practice, set up the sample directory, try out the commands, and see how the tool filters files dynamically. diff --git a/docs/src/tutorials/using_glob_pattern_tool.md b/docs/src/tutorials/using_glob_pattern_tool.md deleted file mode 100644 index 55161bb..0000000 --- a/docs/src/tutorials/using_glob_pattern_tool.md +++ /dev/null @@ -1 +0,0 @@ -# Use Filter Tool diff --git a/docs/src/tutorials/using_templates.md b/docs/src/tutorials/using_templates.md deleted file mode 100644 index 06833ab..0000000 --- a/docs/src/tutorials/using_templates.md +++ /dev/null @@ -1 +0,0 @@ -# Using Templates diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index f446979..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,37 +0,0 @@ -[build-system] -requires = ["maturin>=1.4,<2.0"] -build-backend = "maturin" - -[project] -name = "code2prompt" -version = "2.0.0" -description = "Python bindings for code2prompt - A tool to generate LLM prompts from codebases" -authors = [ - {name = "Mufeed VH", email = "mufeed@lyminal.space"}, -] -readme = "README.md" -requires-python = ">=3.12" -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Rust", - "Topic :: Software Development :: Libraries :: Python Modules", -] - -[project.urls] -Homepage = "https://github.com/mufeedvh/code2prompt" -Documentation = "https://github.com/mufeedvh/code2prompt" -Repository = "https://github.com/mufeedvh/code2prompt" - -[tool.maturin] -python-source = "python-sdk" -features = ["pyo3/extension-module"] -module-name = "code2prompt.code2prompt" \ No newline at end of file diff --git a/python-sdk/setup.py b/python-sdk/setup.py deleted file mode 100644 index 46a0595..0000000 --- a/python-sdk/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -from setuptools import setup, find_packages - -setup( - name="code2prompt", - version="2.0.0", - packages=find_packages(), - install_requires=[], - author="Mufeed VH", - author_email="contact@mufeedvh.com", - description="Python bindings for code2prompt", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - url="https://github.com/mufeedvh/code2prompt", - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - python_requires=">=3.7", -) \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 4c44d2c..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,23 +0,0 @@ -pub mod clipboard; -pub mod filter; -pub mod git; -pub mod path; -pub mod python; -pub mod sort; -pub mod template; -pub mod tokenizer; -pub mod util; - -#[cfg(target_os = "linux")] -pub use clipboard::{serve_clipboard_daemon, spawn_clipboard_daemon}; - -pub use clipboard::copy_text_to_clipboard; -pub use filter::should_include_file; -pub use git::{get_git_diff, get_git_diff_between_branches, get_git_log}; -pub use path::{label, traverse_directory}; -pub use sort::{sort_files, sort_tree, FileSortMethod}; -pub use template::{ - handle_undefined_variables, handlebars_setup, render_template, write_to_file, OutputFormat, -}; -pub use tokenizer::{count_tokens, TokenFormat, TokenizerType}; -pub use util::strip_utf8_bom;