commit 602cd1586a6771a808f5eef71142e3066f93f36e Author: Will Anderson Date: Mon Apr 27 19:12:42 2026 -0500 feat: el-ide — native IDE for engram-lang, LSP, type graph, plugin ecosystem Axum HTTP server (port 7771) serving a single-page IDE with CodeMirror 6 syntax highlighting for engram-lang, a force-directed type graph visualizer, LSP (completions, hover, diagnostics), SSE-streamed build/run output, a plugin host with five first-party plugins, and a reasoning panel that proxies to engram-server. 28 tests across three crates, zero warnings. diff --git a/ide/.gitignore b/ide/.gitignore new file mode 100644 index 0000000..ca98cd9 --- /dev/null +++ b/ide/.gitignore @@ -0,0 +1,2 @@ +/target/ +Cargo.lock diff --git a/ide/Cargo.lock b/ide/Cargo.lock new file mode 100644 index 0000000..545dea0 --- /dev/null +++ b/ide/Cargo.lock @@ -0,0 +1,2350 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "axum-macros", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core 0.5.6", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit 0.8.4", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[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 = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[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" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +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 = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[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", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "el-ide-server" +version = "0.1.0" +dependencies = [ + "async-stream", + "axum 0.7.9", + "el-lsp", + "el-plugin-host", + "mime_guess", + "reqwest", + "rust-embed", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tower", + "tower-http 0.5.2", + "tracing", + "tracing-subscriber", + "urlencoding", + "which", +] + +[[package]] +name = "el-lexer" +version = "0.1.0" +dependencies = [ + "thiserror", +] + +[[package]] +name = "el-lsp" +version = "0.1.0" +dependencies = [ + "el-lexer", + "el-parser", + "el-types", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "el-parser" +version = "0.1.0" +dependencies = [ + "el-lexer", + "thiserror", +] + +[[package]] +name = "el-plugin-host" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "el-types" +version = "0.1.0" +dependencies = [ + "el-lexer", + "el-parser", + "thiserror", +] + +[[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 = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[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 = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", + "wasip3", +] + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.0", + "serde", + "serde_core", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "openssl" +version = "0.10.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38c4372413cdaaf3cc79dd92d29d7d9f5ab09b51b10dded508fb90bb70b9222" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13ce1245cd07fcc4cfdb438f7507b0c7e4f3849a69fd84d52374c66d83741bb6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tower", + "tower-http 0.6.8", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rust-embed" +version = "8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04113cb9355a377d83f06ef1f0a45b8ab8cd7d8b1288160717d66df5c7988d27" +dependencies = [ + "axum 0.8.9", + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0902e4c7c8e997159ab384e6d0fc91c221375f6894346ae107f47dd0f3ccaa" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bcdef0be6fe7f6fa333b1073c949729274b05f123a0ad7efcb8efd878e5c3b1" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2c118cb077cca2822033836dfb1b975355dfb784b5e8da48f7b6c5db74e60e" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[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 = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.52.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[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 = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "which" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" +dependencies = [ + "either", + "home", + "rustix 0.38.44", + "winsafe", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/ide/Cargo.toml b/ide/Cargo.toml new file mode 100644 index 0000000..9f4e271 --- /dev/null +++ b/ide/Cargo.toml @@ -0,0 +1,40 @@ +[workspace] +members = [ + "crates/el-ide-server", + "crates/el-lsp", + "crates/el-plugin-host", +] +resolver = "2" + +[workspace.package] +version = "0.1.0" +edition = "2021" +license = "MIT" +authors = ["Neuron Technologies"] + +[workspace.dependencies] +# Internal crates (el-ide workspace) +el-lsp = { path = "crates/el-lsp" } +el-plugin-host = { path = "crates/el-plugin-host" } + +# Engram lang crates (path deps) +el-lexer = { path = "../engram-lang/crates/el-lexer" } +el-parser = { path = "../engram-lang/crates/el-parser" } +el-types = { path = "../engram-lang/crates/el-types" } +el-compiler = { path = "../engram-lang/crates/el-compiler" } + +# External +serde = { version = "1", features = ["derive"] } +serde_json = "1" +thiserror = "2" +tokio = { version = "1", features = ["full"] } +axum = { version = "0.7", features = ["macros"] } +tower-http = { version = "0.5", features = ["cors", "fs"] } +rust-embed = { version = "8", features = ["axum"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +reqwest = { version = "0.12", features = ["json"] } +async-stream = "0.3" +tokio-stream = "0.1" +which = "6" +mime_guess = "2" diff --git a/ide/crates/el-ide-server/Cargo.toml b/ide/crates/el-ide-server/Cargo.toml new file mode 100644 index 0000000..7fc8bca --- /dev/null +++ b/ide/crates/el-ide-server/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "el-ide-server" +version.workspace = true +edition.workspace = true +license.workspace = true + +[[bin]] +name = "el-ide" +path = "src/main.rs" + +[dependencies] +el-lsp = { workspace = true } +el-plugin-host = { workspace = true } + +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true } +axum = { workspace = true } +tower-http = { workspace = true } +rust-embed = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +reqwest = { workspace = true } +async-stream = { workspace = true } +tokio-stream = { workspace = true } +which = { workspace = true } +urlencoding = "2" +mime_guess = { workspace = true } + +[dev-dependencies] +tokio = { workspace = true, features = ["macros", "rt"] } +tower = "0.5" diff --git a/ide/crates/el-ide-server/src/api/build.rs b/ide/crates/el-ide-server/src/api/build.rs new file mode 100644 index 0000000..0b8a033 --- /dev/null +++ b/ide/crates/el-ide-server/src/api/build.rs @@ -0,0 +1,158 @@ +//! Build and run API — streams output via SSE. + +use std::convert::Infallible; + +use axum::{ + extract::State, + Json, + response::{ + sse::{Event, KeepAlive, Sse}, + IntoResponse, + }, +}; +use serde::Deserialize; +use tokio::io::AsyncBufReadExt; + +use crate::{sse::classify_line, AppState}; + +// ── Request types ───────────────────────────────────────────────────────────── + +#[derive(Debug, Deserialize)] +pub struct BuildRequest { + /// Target: "debug" | "release" | "prod" + #[serde(default = "default_target")] + pub target: String, + /// Optional specific file to build; otherwise builds whole project. + pub file: Option, +} + +#[derive(Debug, Deserialize)] +pub struct RunRequest { + pub file: String, +} + +fn default_target() -> String { + "debug".into() +} + +// ── Handlers ────────────────────────────────────────────────────────────────── + +/// POST /api/build — streams build output as SSE. +pub async fn build_handler( + State(state): State, + Json(req): Json, +) -> impl IntoResponse { + let project_path = state.config.project_path.clone(); + let stream = build_stream(project_path, req); + Sse::new(stream).keep_alive(KeepAlive::default()) +} + +/// POST /api/run — compiles and runs a file, streams output as SSE. +pub async fn run_handler( + State(state): State, + Json(req): Json, +) -> impl IntoResponse { + let project_path = state.config.project_path.clone(); + let stream = run_stream(project_path, req); + Sse::new(stream).keep_alive(KeepAlive::default()) +} + +// ── Stream builders ─────────────────────────────────────────────────────────── + +fn build_stream( + project_path: String, + req: BuildRequest, +) -> impl tokio_stream::Stream> { + async_stream::stream! { + let el_bin = el_binary(); + let mut cmd = tokio::process::Command::new(&el_bin); + + if let Some(ref file) = req.file { + let file_path = format!("{project_path}/{file}"); + cmd.arg("build").arg(&file_path).arg("--target").arg(&req.target); + } else { + let main = format!("{project_path}/src/main.el"); + cmd.arg("build").arg(&main).arg("--target").arg(&req.target); + } + + cmd.stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .current_dir(&project_path); + + yield Ok(Event::default().event("info").data(format!("Running: el build --target {}", req.target))); + + match cmd.spawn() { + Err(e) => { + yield Ok(Event::default().event("error").data(format!("Failed to start el: {e}"))); + yield Ok(Event::default().event("done").data("1")); + } + Ok(mut child) => { + if let Some(stdout) = child.stdout.take() { + let mut reader = tokio::io::BufReader::new(stdout).lines(); + while let Ok(Some(line)) = reader.next_line().await { + yield Ok(classify_line(&line)); + } + } + if let Some(stderr) = child.stderr.take() { + let mut reader = tokio::io::BufReader::new(stderr).lines(); + while let Ok(Some(line)) = reader.next_line().await { + yield Ok(classify_line(&line)); + } + } + let code = child.wait().await.map(|s| s.code().unwrap_or(0)).unwrap_or(1); + yield Ok(Event::default().event("done").data(code.to_string())); + } + } + } +} + +fn run_stream( + project_path: String, + req: RunRequest, +) -> impl tokio_stream::Stream> { + async_stream::stream! { + let el_bin = el_binary(); + let file_path = format!("{project_path}/{}", req.file); + + yield Ok(Event::default().event("info").data(format!("Running: el run {}", req.file))); + + let mut cmd = tokio::process::Command::new(&el_bin); + cmd.arg("run") + .arg(&file_path) + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .current_dir(&project_path); + + match cmd.spawn() { + Err(e) => { + yield Ok(Event::default().event("error").data(format!("Failed to start el: {e}"))); + yield Ok(Event::default().event("done").data("1")); + } + Ok(mut child) => { + if let Some(stdout) = child.stdout.take() { + let mut reader = tokio::io::BufReader::new(stdout).lines(); + while let Ok(Some(line)) = reader.next_line().await { + yield Ok(Event::default().event("output").data(line)); + } + } + if let Some(stderr) = child.stderr.take() { + let mut reader = tokio::io::BufReader::new(stderr).lines(); + while let Ok(Some(line)) = reader.next_line().await { + yield Ok(classify_line(&line)); + } + } + let code = child.wait().await.map(|s| s.code().unwrap_or(0)).unwrap_or(1); + yield Ok(Event::default().event("done").data(code.to_string())); + } + } + } +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +fn el_binary() -> String { + if let Ok(path) = which::which("el") { + return path.to_string_lossy().to_string(); + } + "el".to_string() +} diff --git a/ide/crates/el-ide-server/src/api/files.rs b/ide/crates/el-ide-server/src/api/files.rs new file mode 100644 index 0000000..c95f9c0 --- /dev/null +++ b/ide/crates/el-ide-server/src/api/files.rs @@ -0,0 +1,180 @@ +//! File system API — list, read, and write files within the project root. + +use std::path::{Path, PathBuf}; + +use axum::{ + extract::{Query, State}, + http::StatusCode, + Json, +}; +use serde::{Deserialize, Serialize}; + +use crate::AppState; + +// ── Types ───────────────────────────────────────────────────────────────────── + +#[derive(Debug, Deserialize)] +pub struct PathQuery { + pub path: Option, +} + +#[derive(Debug, Serialize)] +pub struct FileEntry { + pub name: String, + pub path: String, + pub is_dir: bool, + pub children: Option>, +} + +#[derive(Debug, Serialize)] +pub struct FileContent { + pub path: String, + pub content: String, +} + +#[derive(Debug, Deserialize)] +pub struct WriteRequest { + pub path: String, + pub content: String, +} + +#[derive(Debug, Serialize)] +pub struct WriteResponse { + pub ok: bool, +} + +type ApiResult = Result, (StatusCode, Json)>; + +fn api_err(code: StatusCode, msg: impl Into) -> (StatusCode, Json) { + (code, Json(serde_json::json!({ "error": msg.into() }))) +} + +// ── Handlers ────────────────────────────────────────────────────────────────── + +/// GET /api/files?path={dir} +/// +/// Returns a recursive directory listing for the given path +/// (relative to EL_IDE_PROJECT_PATH). +pub async fn list_files( + State(state): State, + Query(q): Query, +) -> ApiResult> { + let root = PathBuf::from(&state.config.project_path); + let rel = q.path.unwrap_or_else(|| ".".into()); + let target = root.join(&rel); + let target = target + .canonicalize() + .map_err(|e| api_err(StatusCode::BAD_REQUEST, format!("invalid path: {e}")))?; + + // Security: ensure the resolved path is within the project root + let root_canonical = root + .canonicalize() + .map_err(|e| api_err(StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?; + if !target.starts_with(&root_canonical) { + return Err(api_err(StatusCode::FORBIDDEN, "path escapes project root")); + } + + let entries = read_dir_recursive(&target, &root_canonical, 0) + .map_err(|e| api_err(StatusCode::INTERNAL_SERVER_ERROR, e))?; + + Ok(Json(entries)) +} + +fn read_dir_recursive( + dir: &Path, + root: &Path, + depth: usize, +) -> Result, String> { + if depth > 8 { + return Ok(vec![]); + } + let mut entries = Vec::new(); + let rd = std::fs::read_dir(dir).map_err(|e| e.to_string())?; + let mut items: Vec<_> = rd.filter_map(|e| e.ok()).collect(); + items.sort_by_key(|e| e.file_name()); + + for entry in items { + let path = entry.path(); + let name = entry.file_name().to_string_lossy().to_string(); + // Skip hidden files/dirs + if name.starts_with('.') { + continue; + } + let rel_path = path.strip_prefix(root).unwrap_or(&path).to_string_lossy().to_string(); + let is_dir = path.is_dir(); + + let children = if is_dir { + Some(read_dir_recursive(&path, root, depth + 1).unwrap_or_default()) + } else { + None + }; + + entries.push(FileEntry { name, path: rel_path, is_dir, children }); + } + Ok(entries) +} + +/// GET /api/file?path={file} +pub async fn read_file( + State(state): State, + Query(q): Query, +) -> ApiResult { + let rel = q.path.ok_or_else(|| api_err(StatusCode::BAD_REQUEST, "missing path parameter"))?; + let file_path = safe_path(&state.config.project_path, &rel) + .map_err(|e| api_err(StatusCode::FORBIDDEN, e))?; + + let content = std::fs::read_to_string(&file_path) + .map_err(|e| api_err(StatusCode::NOT_FOUND, format!("cannot read file: {e}")))?; + + Ok(Json(FileContent { path: rel, content })) +} + +/// POST /api/file — body: { path, content } +pub async fn write_file( + State(state): State, + Json(req): Json, +) -> ApiResult { + let file_path = safe_path(&state.config.project_path, &req.path) + .map_err(|e| api_err(StatusCode::FORBIDDEN, e))?; + + // Create parent dirs if needed + if let Some(parent) = file_path.parent() { + std::fs::create_dir_all(parent) + .map_err(|e| api_err(StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?; + } + + std::fs::write(&file_path, &req.content) + .map_err(|e| api_err(StatusCode::INTERNAL_SERVER_ERROR, format!("cannot write: {e}")))?; + + Ok(Json(WriteResponse { ok: true })) +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +fn safe_path(project_root: &str, rel: &str) -> Result { + let root = PathBuf::from(project_root) + .canonicalize() + .map_err(|e| format!("invalid project root: {e}"))?; + // Prevent path traversal + let joined = root.join(rel); + // We can't canonicalize non-existent files, so check manually + let normalized = normalize_path(&joined); + if !normalized.starts_with(&root) { + return Err(format!("path '{rel}' escapes project root")); + } + Ok(normalized) +} + +/// Normalize a path without requiring the file to exist. +fn normalize_path(path: &Path) -> PathBuf { + let mut out = PathBuf::new(); + for component in path.components() { + use std::path::Component; + match component { + Component::ParentDir => { out.pop(); } + Component::CurDir => {} + c => out.push(c), + } + } + out +} diff --git a/ide/crates/el-ide-server/src/api/lsp.rs b/ide/crates/el-ide-server/src/api/lsp.rs new file mode 100644 index 0000000..707c7e4 --- /dev/null +++ b/ide/crates/el-ide-server/src/api/lsp.rs @@ -0,0 +1,51 @@ +//! LSP API endpoints — completions, hover, errors. + +use axum::{ + extract::Query, + http::StatusCode, + Json, +}; +use serde::Deserialize; + +use el_lsp::{Completion, Diagnostic, HoverInfo, LanguageServer}; + +type ApiResult = Result, (StatusCode, Json)>; + +// ── Query types ─────────────────────────────────────────────────────────────── + +#[derive(Debug, Deserialize)] +pub struct SourceQuery { + pub source: String, + pub pos: Option, +} + +// ── Handlers ────────────────────────────────────────────────────────────────── + +/// GET /api/lsp/complete?source=...&pos=... +pub async fn complete( + Query(q): Query, +) -> ApiResult> { + let lsp = LanguageServer::new(); + let pos = q.pos.unwrap_or(0); + let completions = lsp.complete(&q.source, pos); + Ok(Json(completions)) +} + +/// GET /api/lsp/hover?source=...&pos=... +pub async fn hover( + Query(q): Query, +) -> ApiResult> { + let lsp = LanguageServer::new(); + let pos = q.pos.unwrap_or(0); + let info = lsp.hover(&q.source, pos); + Ok(Json(info)) +} + +/// GET /api/lsp/errors?source=... +pub async fn errors( + Query(q): Query, +) -> ApiResult> { + let lsp = LanguageServer::new(); + let diags = lsp.diagnostics(&q.source); + Ok(Json(diags)) +} diff --git a/ide/crates/el-ide-server/src/api/mod.rs b/ide/crates/el-ide-server/src/api/mod.rs new file mode 100644 index 0000000..6617d36 --- /dev/null +++ b/ide/crates/el-ide-server/src/api/mod.rs @@ -0,0 +1,6 @@ +pub mod build; +pub mod files; +pub mod lsp; +pub mod plugins; +pub mod reason; +pub mod type_graph; diff --git a/ide/crates/el-ide-server/src/api/plugins.rs b/ide/crates/el-ide-server/src/api/plugins.rs new file mode 100644 index 0000000..7bc77dc --- /dev/null +++ b/ide/crates/el-ide-server/src/api/plugins.rs @@ -0,0 +1,56 @@ +//! Plugins API — list, install, remove. + +use axum::{ + extract::{Path, State}, + http::StatusCode, + Json, +}; +use serde::{Deserialize, Serialize}; + +use el_plugin_host::Plugin; + +use crate::AppState; + +type ApiResult = Result, (StatusCode, Json)>; + +fn api_err(code: StatusCode, msg: impl Into) -> (StatusCode, Json) { + (code, Json(serde_json::json!({ "error": msg.into() }))) +} + +#[derive(Debug, Deserialize)] +pub struct InstallRequest { + pub name: String, +} + +#[derive(Debug, Serialize)] +pub struct OkResponse { + pub ok: bool, +} + +/// GET /api/plugins +pub async fn list_plugins(State(state): State) -> ApiResult> { + let host = state.plugins.lock().await; + Ok(Json(host.list())) +} + +/// POST /api/plugins/install — body: { name } +pub async fn install_plugin( + State(state): State, + Json(req): Json, +) -> ApiResult { + let mut host = state.plugins.lock().await; + host.install(&req.name) + .map(Json) + .map_err(|e| api_err(StatusCode::BAD_REQUEST, e.to_string())) +} + +/// DELETE /api/plugins/{name} +pub async fn remove_plugin( + State(state): State, + Path(name): Path, +) -> ApiResult { + let mut host = state.plugins.lock().await; + host.remove(&name) + .map(|_| Json(OkResponse { ok: true })) + .map_err(|e| api_err(StatusCode::BAD_REQUEST, e.to_string())) +} diff --git a/ide/crates/el-ide-server/src/api/reason.rs b/ide/crates/el-ide-server/src/api/reason.rs new file mode 100644 index 0000000..e88d337 --- /dev/null +++ b/ide/crates/el-ide-server/src/api/reason.rs @@ -0,0 +1,82 @@ +//! Reasoning API — proxy to engram-server for hypothesis evaluation. + +use axum::{ + extract::State, + http::StatusCode, + Json, +}; +use serde::{Deserialize, Serialize}; + +use crate::AppState; + +type ApiResult = Result, (StatusCode, Json)>; + +fn api_err(code: StatusCode, msg: impl Into) -> (StatusCode, Json) { + (code, Json(serde_json::json!({ "error": msg.into() }))) +} + +#[derive(Debug, Deserialize)] +pub struct ReasonRequest { + pub hypothesis: String, + pub context: Option, +} + +#[derive(Debug, Serialize)] +pub struct ReasonResponse { + pub verdict: String, + pub confidence: f64, + pub evidence: Vec, + pub source: String, +} + +#[derive(Debug, Serialize)] +pub struct EvidenceItem { + pub text: String, + pub weight: f64, +} + +/// POST /api/reason — proxy to engram-server reasoning endpoint. +pub async fn reason( + State(state): State, + Json(req): Json, +) -> ApiResult { + let engram_url = &state.config.engram_url; + let url = format!("{engram_url}/api/reason"); + + // Attempt to proxy to engram-server; fall back to stub if unavailable. + let client = reqwest::Client::new(); + let body = serde_json::json!({ + "hypothesis": req.hypothesis, + "context": req.context, + }); + + match client.post(&url).json(&body).timeout(std::time::Duration::from_secs(10)).send().await { + Ok(resp) if resp.status().is_success() => { + let json: serde_json::Value = resp.json().await + .map_err(|e| api_err(StatusCode::BAD_GATEWAY, format!("invalid response: {e}")))?; + Ok(Json(ReasonResponse { + verdict: json["verdict"].as_str().unwrap_or("unknown").to_string(), + confidence: json["confidence"].as_f64().unwrap_or(0.0), + evidence: json["evidence"].as_array().map(|arr| { + arr.iter().map(|e| EvidenceItem { + text: e["text"].as_str().unwrap_or("").to_string(), + weight: e["weight"].as_f64().unwrap_or(0.0), + }).collect() + }).unwrap_or_default(), + source: "engram-server".into(), + })) + } + _ => { + // Stub response when engram-server is unavailable + Ok(Json(ReasonResponse { + verdict: "unresolved".into(), + confidence: 0.0, + evidence: vec![EvidenceItem { + text: "engram-server is not reachable; connect an Engram instance for live reasoning.".into(), + weight: 0.0, + }], + source: "stub".into(), + })) + } + } +} diff --git a/ide/crates/el-ide-server/src/api/type_graph.rs b/ide/crates/el-ide-server/src/api/type_graph.rs new file mode 100644 index 0000000..cf3a95d --- /dev/null +++ b/ide/crates/el-ide-server/src/api/type_graph.rs @@ -0,0 +1,42 @@ +//! Type graph API — returns nodes and edges for the current project. + +use axum::{ + extract::{Query, State}, + http::StatusCode, + Json, +}; +use serde::Deserialize; + +use el_lsp::{LanguageServer, TypeGraph}; + +use crate::AppState; + +type ApiResult = Result, (StatusCode, Json)>; + +#[derive(Debug, Deserialize)] +pub struct TypeGraphQuery { + /// Optional source to use directly (e.g. current editor content). + pub source: Option, + /// Or load from a file path within the project. + pub path: Option, +} + +/// GET /api/type-graph?source=... or ?path=... +/// +/// If neither is provided, reads src/main.el from the project root. +pub async fn type_graph( + State(state): State, + Query(q): Query, +) -> ApiResult { + let source = if let Some(src) = q.source { + src + } else { + let rel = q.path.unwrap_or_else(|| "src/main.el".into()); + let file_path = std::path::PathBuf::from(&state.config.project_path).join(&rel); + std::fs::read_to_string(&file_path).unwrap_or_default() + }; + + let lsp = LanguageServer::new(); + let graph = lsp.type_graph(&source); + Ok(Json(graph)) +} diff --git a/ide/crates/el-ide-server/src/config.rs b/ide/crates/el-ide-server/src/config.rs new file mode 100644 index 0000000..5e2c143 --- /dev/null +++ b/ide/crates/el-ide-server/src/config.rs @@ -0,0 +1,32 @@ +//! Server configuration loaded from environment variables. + +#[derive(Debug, Clone)] +pub struct Config { + /// HTTP port (EL_IDE_PORT, default 7771) + pub port: u16, + /// Root path of the project to open (EL_IDE_PROJECT_PATH, default ".") + pub project_path: String, + /// Engram server URL for reasoning (EL_ENGRAM_URL, default http://localhost:8742) + pub engram_url: String, +} + +impl Config { + pub fn from_env() -> Self { + Self { + port: std::env::var("EL_IDE_PORT") + .ok() + .and_then(|v| v.parse().ok()) + .unwrap_or(7771), + project_path: std::env::var("EL_IDE_PROJECT_PATH") + .unwrap_or_else(|_| ".".into()), + engram_url: std::env::var("EL_ENGRAM_URL") + .unwrap_or_else(|_| "http://localhost:8742".into()), + } + } +} + +impl Default for Config { + fn default() -> Self { + Self::from_env() + } +} diff --git a/ide/crates/el-ide-server/src/embed.rs b/ide/crates/el-ide-server/src/embed.rs new file mode 100644 index 0000000..6f45a53 --- /dev/null +++ b/ide/crates/el-ide-server/src/embed.rs @@ -0,0 +1,50 @@ +//! Embedded static assets via rust-embed. + +use axum::{ + extract::Path, + http::{header, StatusCode}, + response::{IntoResponse, Response}, +}; +use rust_embed::RustEmbed; + +#[derive(RustEmbed)] +#[folder = "../../ide/"] +pub struct Assets; + +/// Serve `index.html` at the root path. +pub async fn serve_index() -> impl IntoResponse { + serve_file("index.html") +} + +/// Serve any embedded asset by path. +pub async fn serve_asset(Path(path): Path) -> impl IntoResponse { + serve_file(&path) +} + +fn serve_file(path: &str) -> Response { + match Assets::get(path) { + Some(content) => { + let mime = mime_guess::from_path(path) + .first_or_octet_stream() + .to_string(); + ( + StatusCode::OK, + [(header::CONTENT_TYPE, mime)], + content.data.to_vec(), + ) + .into_response() + } + None => { + // For SPA routing, fall back to index.html + match Assets::get("index.html") { + Some(content) => ( + StatusCode::OK, + [(header::CONTENT_TYPE, "text/html; charset=utf-8".to_string())], + content.data.to_vec(), + ) + .into_response(), + None => StatusCode::NOT_FOUND.into_response(), + } + } + } +} diff --git a/ide/crates/el-ide-server/src/main.rs b/ide/crates/el-ide-server/src/main.rs new file mode 100644 index 0000000..eb2efe0 --- /dev/null +++ b/ide/crates/el-ide-server/src/main.rs @@ -0,0 +1,87 @@ +//! el-ide-server — Axum HTTP server for the Engram Language IDE. +//! +//! Serves the IDE HTML at GET / and provides API endpoints for file operations, +//! build/run (SSE streaming), LSP, plugins, and type graph visualization. + +mod api; +mod config; +mod embed; +mod sse; + +#[cfg(test)] +mod tests; + +use std::sync::Arc; + +use axum::{Router, routing::{delete, get, post}}; +use tokio::sync::Mutex; +use tower_http::cors::{Any, CorsLayer}; +use tracing::info; +use tracing_subscriber::EnvFilter; + +use el_plugin_host::PluginHost; + +use crate::config::Config; + +// ── App state ───────────────────────────────────────────────────────────────── + +#[derive(Clone)] +pub struct AppState { + pub config: Arc, + pub plugins: Arc>, +} + +// ── Entry point ─────────────────────────────────────────────────────────────── + +#[tokio::main] +async fn main() { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env().add_directive("el_ide=info".parse().unwrap())) + .init(); + + let config = Config::from_env(); + let port = config.port; + let state = AppState { + config: Arc::new(config), + plugins: Arc::new(Mutex::new(PluginHost::new())), + }; + + let app = build_router(state); + let addr = format!("0.0.0.0:{port}"); + let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); + + info!("el-ide listening on http://{addr}"); + axum::serve(listener, app).await.unwrap(); +} + +pub fn build_router(state: AppState) -> Router { + let cors = CorsLayer::new() + .allow_origin(Any) + .allow_methods(Any) + .allow_headers(Any); + + Router::new() + // IDE HTML + .route("/", get(embed::serve_index)) + .route("/*path", get(embed::serve_asset)) + // File API + .route("/api/files", get(api::files::list_files)) + .route("/api/file", get(api::files::read_file).post(api::files::write_file)) + // Build/run (SSE) + .route("/api/build", post(api::build::build_handler)) + .route("/api/run", post(api::build::run_handler)) + // LSP + .route("/api/lsp/complete", get(api::lsp::complete)) + .route("/api/lsp/hover", get(api::lsp::hover)) + .route("/api/lsp/errors", get(api::lsp::errors)) + // Type graph + .route("/api/type-graph", get(api::type_graph::type_graph)) + // Plugins + .route("/api/plugins", get(api::plugins::list_plugins)) + .route("/api/plugins/install", post(api::plugins::install_plugin)) + .route("/api/plugins/{name}", delete(api::plugins::remove_plugin)) + // Reasoning (proxy to engram-server) + .route("/api/reason", post(api::reason::reason)) + .layer(cors) + .with_state(state) +} diff --git a/ide/crates/el-ide-server/src/sse.rs b/ide/crates/el-ide-server/src/sse.rs new file mode 100644 index 0000000..b9d2bfa --- /dev/null +++ b/ide/crates/el-ide-server/src/sse.rs @@ -0,0 +1,20 @@ +//! SSE helpers for streaming build/run output. + +use axum::response::sse::Event; + +/// Build a line-output SSE event, classifying the line as error/warning/success/info. +pub fn classify_line(line: &str) -> Event { + let event_type = if line.to_lowercase().contains("error") { + "error" + } else if line.to_lowercase().contains("warning") || line.to_lowercase().contains("warn") { + "warning" + } else if line.to_lowercase().contains("compiled") + || line.to_lowercase().contains("ok") + || line.to_lowercase().contains("success") + { + "success" + } else { + "info" + }; + Event::default().event(event_type).data(line.to_string()) +} diff --git a/ide/crates/el-ide-server/src/tests.rs b/ide/crates/el-ide-server/src/tests.rs new file mode 100644 index 0000000..44f967f --- /dev/null +++ b/ide/crates/el-ide-server/src/tests.rs @@ -0,0 +1,235 @@ +//! Integration tests for el-ide-server API endpoints. + +use std::sync::Arc; +use tokio::sync::Mutex; + +use axum::{ + body::Body, + http::{Request, StatusCode}, +}; +use tower::ServiceExt; + +use el_plugin_host::PluginHost; + +use crate::{build_router, config::Config, AppState}; + +fn test_state(project_path: &str) -> AppState { + AppState { + config: Arc::new(Config { + port: 7771, + project_path: project_path.to_string(), + engram_url: "http://localhost:8742".into(), + }), + plugins: Arc::new(Mutex::new(PluginHost::new())), + } +} + +fn test_project_path() -> String { + // Use the examples/hello-project as the test project. + // CARGO_MANIFEST_DIR = el-ide/crates/el-ide-server + let manifest = env!("CARGO_MANIFEST_DIR"); + // Normalize: go up three directories from the crate to workspace root, then into examples + let ws_root = std::path::Path::new(manifest) + .parent().unwrap() // crates/ + .parent().unwrap() // el-ide/ + .to_path_buf(); + ws_root.join("examples/hello-project") + .canonicalize() + .unwrap_or_else(|_| ws_root.join("examples/hello-project")) + .to_string_lossy() + .to_string() +} + +async fn get_json(app: axum::Router, uri: &str) -> (StatusCode, serde_json::Value) { + let resp = app + .oneshot(Request::get(uri).body(Body::empty()).unwrap()) + .await + .unwrap(); + let status = resp.status(); + let bytes = axum::body::to_bytes(resp.into_body(), 1024 * 1024).await.unwrap(); + let json: serde_json::Value = serde_json::from_slice(&bytes).unwrap_or(serde_json::Value::Null); + (status, json) +} + +// ── GET / ───────────────────────────────────────────────────────────────────── + +#[tokio::test] +async fn test_root_returns_html() { + let state = test_state(&test_project_path()); + let app = build_router(state); + + let resp = app + .oneshot(Request::get("/").body(Body::empty()).unwrap()) + .await + .unwrap(); + + // The embedded HTML should return 200 + assert_eq!(resp.status(), StatusCode::OK); +} + +// ── GET /api/files ──────────────────────────────────────────────────────────── + +#[tokio::test] +async fn test_list_files_returns_entries() { + let project = test_project_path(); + let state = test_state(&project); + let app = build_router(state); + + let (status, json) = get_json(app, "/api/files?path=.").await; + assert_eq!(status, StatusCode::OK, "body: {json}"); + assert!(json.is_array(), "expected array, got {json}"); + let arr = json.as_array().unwrap(); + assert!(!arr.is_empty(), "expected non-empty file listing"); +} + +#[tokio::test] +async fn test_list_files_contains_src_dir() { + let project = test_project_path(); + let state = test_state(&project); + let app = build_router(state); + + let (status, json) = get_json(app, "/api/files?path=.").await; + assert_eq!(status, StatusCode::OK); + let arr = json.as_array().unwrap(); + let has_src = arr.iter().any(|e| e["name"] == "src" || e["name"] == "el.toml"); + assert!(has_src, "expected src or el.toml in listing; got {arr:?}"); +} + +// ── GET /api/file ───────────────────────────────────────────────────────────── + +#[tokio::test] +async fn test_read_file_main_el() { + let project = test_project_path(); + let state = test_state(&project); + let app = build_router(state); + + let (status, json) = get_json(app, "/api/file?path=src/main.el").await; + assert_eq!(status, StatusCode::OK, "body: {json}"); + assert!(json["content"].is_string(), "expected content field"); + let content = json["content"].as_str().unwrap(); + assert!(content.contains("fn main"), "expected fn main in content"); +} + +#[tokio::test] +async fn test_read_missing_file_returns_404() { + let project = test_project_path(); + let state = test_state(&project); + let app = build_router(state); + + let (status, _) = get_json(app, "/api/file?path=nonexistent.el").await; + assert_eq!(status, StatusCode::NOT_FOUND); +} + +// ── GET /api/lsp/errors ─────────────────────────────────────────────────────── + +#[tokio::test] +async fn test_lsp_errors_clean_source() { + let state = test_state("."); + let app = build_router(state); + + let source = "fn main() -> Void { let x: Int = 42 }"; + let uri = format!("/api/lsp/errors?source={}", urlencoding::encode(source)); + + let (status, json) = get_json(app, &uri).await; + assert_eq!(status, StatusCode::OK, "body: {json}"); + assert!(json.is_array()); + let errors: Vec<_> = json.as_array().unwrap().iter() + .filter(|d| d["severity"] == "error") + .collect(); + assert!(errors.is_empty(), "unexpected errors: {errors:?}"); +} + +#[tokio::test] +async fn test_lsp_errors_bad_type() { + let state = test_state("."); + let app = build_router(state); + + let source = "let x: NonExistentType = 42"; + let uri = format!("/api/lsp/errors?source={}", urlencoding::encode(source)); + + let (status, json) = get_json(app, &uri).await; + assert_eq!(status, StatusCode::OK, "body: {json}"); + assert!(json.is_array()); + // Should have at least one diagnostic + assert!(!json.as_array().unwrap().is_empty(), "expected diagnostic for unknown type"); +} + +// ── GET /api/type-graph ─────────────────────────────────────────────────────── + +#[tokio::test] +async fn test_type_graph_returns_nodes_and_edges() { + let state = test_state("."); + let app = build_router(state); + + let source = "type Point { x: Float y: Float } type Circle { center: Point radius: Float }"; + let uri = format!("/api/type-graph?source={}", urlencoding::encode(source)); + + let (status, json) = get_json(app, &uri).await; + assert_eq!(status, StatusCode::OK, "body: {json}"); + assert!(json["nodes"].is_array()); + assert!(json["edges"].is_array()); + + let node_names: Vec<_> = json["nodes"].as_array().unwrap() + .iter().map(|n| n["name"].as_str().unwrap_or("")).collect(); + assert!(node_names.contains(&"Point"), "expected Point node"); + assert!(node_names.contains(&"Circle"), "expected Circle node"); +} + +#[tokio::test] +async fn test_type_graph_has_field_edge() { + let state = test_state("."); + let app = build_router(state); + + let source = "type Point { x: Float y: Float } type Circle { center: Point radius: Float }"; + let uri = format!("/api/type-graph?source={}", urlencoding::encode(source)); + + let (status, json) = get_json(app, &uri).await; + assert_eq!(status, StatusCode::OK); + + let edges = json["edges"].as_array().unwrap(); + let has_edge = edges.iter().any(|e| e["from"] == "Circle" && e["to"] == "Point"); + assert!(has_edge, "expected Circle->Point edge, edges: {edges:?}"); +} + +// ── GET /api/plugins ────────────────────────────────────────────────────────── + +#[tokio::test] +async fn test_list_plugins_returns_five() { + let state = test_state("."); + let app = build_router(state); + + let (status, json) = get_json(app, "/api/plugins").await; + assert_eq!(status, StatusCode::OK, "body: {json}"); + let plugins = json.as_array().unwrap(); + assert_eq!(plugins.len(), 5, "expected 5 first-party plugins"); +} + +#[tokio::test] +async fn test_dark_theme_installed() { + let state = test_state("."); + let app = build_router(state); + + let (status, json) = get_json(app, "/api/plugins").await; + assert_eq!(status, StatusCode::OK); + let plugins = json.as_array().unwrap(); + let dark = plugins.iter().find(|p| p["name"] == "el-theme-dark").unwrap(); + assert_eq!(dark["installed"], true); +} + +// ── GET /api/lsp/complete ───────────────────────────────────────────────────── + +#[tokio::test] +async fn test_completions_return_keywords() { + let state = test_state("."); + let app = build_router(state); + + let uri = "/api/lsp/complete?source=&pos=0"; + let (status, json) = get_json(app, uri).await; + assert_eq!(status, StatusCode::OK); + assert!(json.is_array()); + let labels: Vec<_> = json.as_array().unwrap().iter() + .map(|c| c["label"].as_str().unwrap_or("")) + .collect(); + assert!(labels.contains(&"let"), "expected 'let' in completions"); + assert!(labels.contains(&"fn"), "expected 'fn' in completions"); +} diff --git a/ide/crates/el-lsp/Cargo.toml b/ide/crates/el-lsp/Cargo.toml new file mode 100644 index 0000000..43150e6 --- /dev/null +++ b/ide/crates/el-lsp/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "el-lsp" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +el-lexer = { workspace = true } +el-parser = { workspace = true } +el-types = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } + +[dev-dependencies] diff --git a/ide/crates/el-lsp/src/completion.rs b/ide/crates/el-lsp/src/completion.rs new file mode 100644 index 0000000..82f8f00 --- /dev/null +++ b/ide/crates/el-lsp/src/completion.rs @@ -0,0 +1,187 @@ +//! Completion engine — prefix-based + semantic scoring. + +use serde::{Deserialize, Serialize}; + +use el_types::{TypeDef, TypeEnv}; + +// ── Types ───────────────────────────────────────────────────────────────────── + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Completion { + pub label: String, + pub kind: CompletionKind, + pub detail: String, + pub documentation: Option, + /// Activation strength: higher = more relevant, completions sorted desc. + pub score: f32, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "lowercase")] +pub enum CompletionKind { + Variable, + Function, + Type, + Keyword, +} + +// ── Keywords ────────────────────────────────────────────────────────────────── + +const KEYWORDS: &[&str] = &[ + "let", "fn", "type", "enum", "match", "return", "activate", "where", + "sealed", "if", "else", "for", "in", "true", "false", +]; + +const BUILTIN_TYPES: &[(&str, &str)] = &[ + ("Int", "64-bit signed integer"), + ("Float", "64-bit IEEE 754 double"), + ("String", "UTF-8 string"), + ("Bool", "Boolean value"), + ("Uuid", "RFC 4122 UUID"), + ("Void", "Unit type — no value"), +]; + +// ── Entry point ─────────────────────────────────────────────────────────────── + +/// Produce completions at `cursor_pos` in `source`. +/// +/// Extracts the identifier prefix before the cursor and returns all +/// completions whose label starts with that prefix, sorted by score +/// (prefix match score + semantic boost). +pub fn completions_at(env: &TypeEnv, source: &str, cursor_pos: usize) -> Vec { + let prefix = extract_prefix(source, cursor_pos); + let mut results: Vec = Vec::new(); + + // Keywords + for &kw in KEYWORDS { + if kw.starts_with(&prefix) { + let score = prefix_score(kw, &prefix) + + if matches!(kw, "activate" | "sealed") { 0.2 } else { 0.0 }; + results.push(Completion { + label: kw.to_string(), + kind: CompletionKind::Keyword, + detail: "keyword".into(), + documentation: keyword_doc(kw), + score, + }); + } + } + + // Built-in types + for &(name, desc) in BUILTIN_TYPES { + if name.to_lowercase().starts_with(&prefix.to_lowercase()) || prefix.is_empty() { + results.push(Completion { + label: name.to_string(), + kind: CompletionKind::Type, + detail: desc.into(), + documentation: Some(format!("Built-in type: {desc}")), + score: prefix_score(name, &prefix) + 0.1, + }); + } + } + + // User-defined types from env + for (type_name, def) in &env.types { + // Skip built-ins already listed above + if BUILTIN_TYPES.iter().any(|(n, _)| *n == type_name) { + continue; + } + if type_name.to_lowercase().starts_with(&prefix.to_lowercase()) || prefix.is_empty() { + let (detail, doc, extra_score) = match def { + TypeDef::Struct { fields, .. } => { + let field_list = fields + .iter() + .map(|(f, t)| format!("{f}: {t}")) + .collect::>() + .join(", "); + (format!("struct {{ {field_list} }}"), + Some(format!("User-defined struct with fields: {field_list}")), + 0.15) + } + TypeDef::Enum { variants, .. } => { + let v_list = variants.iter().map(|v| v.name.clone()).collect::>().join(", "); + (format!("enum {{ {v_list} }}"), + Some(format!("Enum variants: {v_list}")), + 0.15) + } + TypeDef::Primitive(_) => { + ("primitive type".into(), None, 0.05) + } + }; + results.push(Completion { + label: type_name.clone(), + kind: CompletionKind::Type, + detail, + documentation: doc, + score: prefix_score(type_name, &prefix) + extra_score, + }); + } + } + + // Functions from env + for (fn_name, fn_type) in &env.functions { + if fn_name.to_lowercase().starts_with(&prefix.to_lowercase()) || prefix.is_empty() { + results.push(Completion { + label: fn_name.clone(), + kind: CompletionKind::Function, + detail: fn_type.to_string(), + documentation: Some(format!("Function: {fn_name} :: {fn_type}")), + score: prefix_score(fn_name, &prefix) + 0.12, + }); + } + } + + // Sort by score descending + results.sort_by(|a, b| b.score.partial_cmp(&a.score).unwrap_or(std::cmp::Ordering::Equal)); + results +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +/// Extract the identifier fragment immediately before `cursor_pos`. +fn extract_prefix(source: &str, cursor_pos: usize) -> String { + let end = cursor_pos.min(source.len()); + let bytes = source.as_bytes(); + let mut start = end; + while start > 0 && (bytes[start - 1].is_ascii_alphanumeric() || bytes[start - 1] == b'_') { + start -= 1; + } + source[start..end].to_string() +} + +/// Score based on how much of the label is matched by the prefix. +/// Returns a value in [0, 1]. +fn prefix_score(label: &str, prefix: &str) -> f32 { + if prefix.is_empty() { + return 0.5; + } + let lower_label = label.to_lowercase(); + let lower_prefix = prefix.to_lowercase(); + if lower_label.starts_with(&lower_prefix) { + // Exact prefix match — score by how complete the prefix is + (lower_prefix.len() as f32 / lower_label.len() as f32).min(1.0) + } else { + 0.0 + } +} + +fn keyword_doc(kw: &str) -> Option { + let doc = match kw { + "activate" => "Spreading-activation query: `activate TypeName where \"query\"`\nReturns `[TypeName]` from the Engram knowledge graph.", + "sealed" => "Quantum-sealed block: marks sensitive code for runtime protection.", + "let" => "Declare an immutable binding: `let name: Type = expr`", + "fn" => "Define a function: `fn name(params) -> ReturnType { body }`", + "type" => "Define a struct type: `type Name { field: Type }`", + "enum" => "Define an enum: `enum Name { Variant1, Variant2(Type) }`", + "match" => "Pattern match: `match expr { Pattern => result }`", + "return" => "Return a value from a function.", + "where" => "Used in `activate T where \"query\"`", + "if" => "Conditional: `if cond { then } else { else }`", + "else" => "Else branch of an if expression.", + "for" => "For loop: `for item in collection { body }`", + "in" => "Used in `for item in collection`", + "true" | "false" => "Boolean literal", + _ => return None, + }; + Some(doc.to_string()) +} diff --git a/ide/crates/el-lsp/src/diagnostic.rs b/ide/crates/el-lsp/src/diagnostic.rs new file mode 100644 index 0000000..f605ca7 --- /dev/null +++ b/ide/crates/el-lsp/src/diagnostic.rs @@ -0,0 +1,59 @@ +//! Diagnostic computation — wraps el-types TypeChecker output. + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Diagnostic { + /// Human-readable message. + pub message: String, + /// "error" | "warning" | "info" + pub severity: String, + /// 1-based line number (if known). + pub line: Option, + /// 1-based column (if known). + pub col: Option, +} + +impl Diagnostic { + pub fn error(message: impl Into) -> Self { + Self { message: message.into(), severity: "error".into(), line: None, col: None } + } + + pub fn warning(message: impl Into) -> Self { + Self { message: message.into(), severity: "warning".into(), line: None, col: None } + } +} + +/// Parse and type-check `source`, returning all diagnostics. +pub fn check(source: &str) -> Vec { + let mut out = Vec::new(); + + let tokens = match el_lexer::tokenize(source) { + Ok(t) => t, + Err(e) => { + out.push(Diagnostic::error(format!("Lex error: {e}"))); + return out; + } + }; + + let program = match el_parser::parse(tokens, source.to_string()) { + Ok(p) => p, + Err(e) => { + out.push(Diagnostic::error(format!("Parse error: {e}"))); + return out; + } + }; + + let mut checker = el_types::TypeChecker::with_builtins(); + checker.check(&program); + + for d in &checker.diagnostics { + if d.is_error { + out.push(Diagnostic::error(&d.message)); + } else { + out.push(Diagnostic::warning(&d.message)); + } + } + + out +} diff --git a/ide/crates/el-lsp/src/hover.rs b/ide/crates/el-lsp/src/hover.rs new file mode 100644 index 0000000..0ddcac1 --- /dev/null +++ b/ide/crates/el-lsp/src/hover.rs @@ -0,0 +1,131 @@ +//! Hover information — identify the token under the cursor and return type docs. + +use serde::{Deserialize, Serialize}; + +use el_types::{TypeDef, TypeEnv}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct HoverInfo { + pub type_name: String, + pub documentation: String, + pub engram_node_type: Option, +} + +/// Return hover info for the token at `cursor_pos`. +pub fn hover_at(env: &TypeEnv, source: &str, cursor_pos: usize) -> Option { + let token = extract_token(source, cursor_pos); + if token.is_empty() { + return None; + } + + // Check built-in primitives + let primitive_doc = match token.as_str() { + "Int" => Some(("Int", "64-bit signed integer")), + "Float" => Some(("Float", "64-bit IEEE 754 double")), + "String" => Some(("String", "UTF-8 string")), + "Bool" => Some(("Bool", "Boolean — true or false")), + "Uuid" => Some(("Uuid", "RFC 4122 UUID")), + "Void" => Some(("Void", "Unit type — no value")), + _ => None, + }; + + if let Some((name, doc)) = primitive_doc { + return Some(HoverInfo { + type_name: name.to_string(), + documentation: doc.to_string(), + engram_node_type: None, + }); + } + + // Check user-defined types + if let Some(def) = env.types.get(&token) { + let engram_node_type = env.engram_mappings.get(&token).cloned(); + let doc = format_typedef_doc(&token, def); + return Some(HoverInfo { + type_name: token.clone(), + documentation: doc, + engram_node_type, + }); + } + + // Check functions + if let Some(fn_type) = env.functions.get(&token) { + return Some(HoverInfo { + type_name: token.clone(), + documentation: format!("fn {token} :: {fn_type}"), + engram_node_type: None, + }); + } + + // Check keywords + let kw_doc = match token.as_str() { + "activate" => Some("activate TypeName where \"query\"\nReturns [TypeName] via spreading activation over the Engram knowledge graph."), + "sealed" => Some("sealed { ... }\nMarks the block as sensitive — values are redacted from debuggers in debug builds."), + "let" => Some("let name: Type = expr\nDeclare an immutable binding."), + "fn" => Some("fn name(params) -> ReturnType { body }\nDefine a function."), + "type" => Some("type Name { field: Type }\nDefine a struct type."), + "enum" => Some("enum Name { Variant1, Variant2(Type) }\nDefine an enum."), + "match" => Some("match expr { Pattern => result }\nPattern match an expression."), + "return" => Some("return expr\nReturn a value from the enclosing function."), + _ => None, + }; + if let Some(doc) = kw_doc { + return Some(HoverInfo { + type_name: token.clone(), + documentation: doc.to_string(), + engram_node_type: None, + }); + } + + None +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +fn extract_token(source: &str, cursor_pos: usize) -> String { + let len = source.len(); + if cursor_pos > len { + return String::new(); + } + let bytes = source.as_bytes(); + + // Expand left + let mut start = cursor_pos; + while start > 0 && (bytes[start - 1].is_ascii_alphanumeric() || bytes[start - 1] == b'_') { + start -= 1; + } + // Expand right + let mut end = cursor_pos; + while end < len && (bytes[end].is_ascii_alphanumeric() || bytes[end] == b'_') { + end += 1; + } + source[start..end].to_string() +} + +fn format_typedef_doc(name: &str, def: &TypeDef) -> String { + match def { + TypeDef::Struct { fields, .. } => { + let fields_str = fields + .iter() + .map(|(f, t)| format!(" {f}: {t}")) + .collect::>() + .join("\n"); + format!("type {name} {{\n{fields_str}\n}}") + } + TypeDef::Enum { variants, .. } => { + let variants_str = variants + .iter() + .map(|v| { + if let Some(payload) = &v.payload { + format!(" {}({})", v.name, payload) + } else { + format!(" {}", v.name) + } + }) + .collect::>() + .join("\n"); + format!("enum {name} {{\n{variants_str}\n}}") + } + TypeDef::Primitive(t) => format!("primitive type {name} = {t}"), + } +} diff --git a/ide/crates/el-lsp/src/lib.rs b/ide/crates/el-lsp/src/lib.rs new file mode 100644 index 0000000..988dd55 --- /dev/null +++ b/ide/crates/el-lsp/src/lib.rs @@ -0,0 +1,193 @@ +//! el-lsp — Minimal Language Server for the Engram language. +//! +//! Provides completions, hover info, diagnostics, and a type graph. +//! Driven by the el-types type checker and el-parser AST. + +mod completion; +mod diagnostic; +mod hover; +mod type_graph; + +pub use completion::{Completion, CompletionKind}; +pub use diagnostic::Diagnostic; +pub use hover::HoverInfo; +pub use type_graph::{TypeEdge, TypeGraph, TypeNode}; + +use el_types::{TypeChecker, TypeEnv}; + +// ── LanguageServer ──────────────────────────────────────────────────────────── + +pub struct LanguageServer; + +impl LanguageServer { + pub fn new() -> Self { + Self + } + + /// Compute completions at the given cursor byte position. + pub fn complete(&self, source: &str, cursor_pos: usize) -> Vec { + let env = build_type_env(source); + completion::completions_at(&env, source, cursor_pos) + } + + /// Return hover information for the token at the given byte position. + pub fn hover(&self, source: &str, cursor_pos: usize) -> Option { + let env = build_type_env(source); + hover::hover_at(&env, source, cursor_pos) + } + + /// Run the type checker and return diagnostics. + pub fn diagnostics(&self, source: &str) -> Vec { + diagnostic::check(source) + } + + /// Build a type graph from the source. + pub fn type_graph(&self, source: &str) -> TypeGraph { + let env = build_type_env(source); + type_graph::build(&env) + } +} + +impl Default for LanguageServer { + fn default() -> Self { + Self::new() + } +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +/// Parse source and run the type checker, returning the final TypeEnv. +fn build_type_env(source: &str) -> TypeEnv { + let tokens = match el_lexer::tokenize(source) { + Ok(t) => t, + Err(_) => return TypeEnv::with_builtins(), + }; + let program = match el_parser::parse(tokens, source.to_string()) { + Ok(p) => p, + Err(_) => return TypeEnv::with_builtins(), + }; + let mut checker = TypeChecker::with_builtins(); + checker.check(&program); + checker.env +} + +#[cfg(test)] +mod tests { + use super::*; + + const SAMPLE: &str = r#" +type Point { + x: Float + y: Float +} + +type Circle { + center: Point + radius: Float +} + +enum Color { + Red + Green + Blue + Custom(String) +} + +fn distance(a: Point, b: Point) -> Float { + let dx: Float = a.x - b.x + let dy: Float = a.y - b.y + return dx * dx + dy * dy +} + +fn main() -> Void { + let greeting: String = "Hello from Engram" + let count: Int = 42 +} +"#; + + #[test] + fn test_diagnostics_clean_source() { + let lsp = LanguageServer::new(); + let diags = lsp.diagnostics(SAMPLE); + // Should have no errors for valid source + let errors: Vec<_> = diags.iter().filter(|d| d.severity == "error").collect(); + assert!(errors.is_empty(), "unexpected errors: {errors:?}"); + } + + #[test] + fn test_diagnostics_invalid_source() { + let lsp = LanguageServer::new(); + let diags = lsp.diagnostics("let x: UnknownType = 42"); + // Should surface at least one diagnostic for unknown type + assert!(!diags.is_empty()); + } + + #[test] + fn test_type_graph_has_nodes() { + let lsp = LanguageServer::new(); + let graph = lsp.type_graph(SAMPLE); + // Should have at least the built-in types plus Point, Circle, Color + assert!(!graph.nodes.is_empty()); + let names: Vec<_> = graph.nodes.iter().map(|n| n.name.as_str()).collect(); + assert!(names.contains(&"Point"), "expected Point in type graph"); + assert!(names.contains(&"Circle"), "expected Circle in type graph"); + } + + #[test] + fn test_type_graph_has_edges() { + let lsp = LanguageServer::new(); + let graph = lsp.type_graph(SAMPLE); + // Circle has a field `center: Point` → should produce an edge + let has_circle_edge = graph + .edges + .iter() + .any(|e| e.from == "Circle" && e.to == "Point"); + assert!(has_circle_edge, "expected Circle->Point edge; edges: {:?}", graph.edges); + } + + #[test] + fn test_completions_return_keywords() { + let lsp = LanguageServer::new(); + let completions = lsp.complete("", 0); + let labels: Vec<_> = completions.iter().map(|c| c.label.as_str()).collect(); + assert!(labels.contains(&"let"), "expected 'let' keyword completion"); + assert!(labels.contains(&"fn"), "expected 'fn' keyword completion"); + } + + #[test] + fn test_completions_include_types() { + let lsp = LanguageServer::new(); + let completions = lsp.complete(SAMPLE, 0); + let labels: Vec<_> = completions.iter().map(|c| c.label.as_str()).collect(); + // User-defined types should appear + assert!(labels.contains(&"Point"), "expected Point in completions"); + } + + #[test] + fn test_hover_on_builtin_type() { + let lsp = LanguageServer::new(); + // Position at the "Float" token in the sample + let source = "let x: Float = 3.14"; + // Find the byte offset of "Float" + let pos = source.find("Float").unwrap(); + let info = lsp.hover(source, pos); + assert!(info.is_some(), "expected hover info for Float"); + let info = info.unwrap(); + assert_eq!(info.type_name, "Float"); + } + + #[test] + fn test_completions_sorted_by_score() { + let lsp = LanguageServer::new(); + let completions = lsp.complete(SAMPLE, 0); + // Completions should be sorted descending by score + for window in completions.windows(2) { + assert!( + window[0].score >= window[1].score, + "completions not sorted by score: {:?} before {:?}", + window[0], + window[1] + ); + } + } +} diff --git a/ide/crates/el-lsp/src/type_graph.rs b/ide/crates/el-lsp/src/type_graph.rs new file mode 100644 index 0000000..d6196d3 --- /dev/null +++ b/ide/crates/el-lsp/src/type_graph.rs @@ -0,0 +1,162 @@ +//! Type graph construction — nodes are types, edges are field/return/param relationships. + +use serde::{Deserialize, Serialize}; + +use el_types::{Type, TypeDef, TypeEnv}; + +// ── Data types ──────────────────────────────────────────────────────────────── + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TypeGraph { + pub nodes: Vec, + pub edges: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TypeNode { + pub id: String, + pub name: String, + /// "builtin" | "struct" | "enum" | "primitive" + pub kind: String, + pub fields: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TypeEdge { + pub from: String, + pub to: String, + /// "field" | "returns" | "param" | "extends" + pub label: String, +} + +// ── Builder ─────────────────────────────────────────────────────────────────── + +const BUILTINS: &[&str] = &["Int", "Float", "String", "Bool", "Uuid", "Void"]; + +pub fn build(env: &TypeEnv) -> TypeGraph { + let mut nodes: Vec = Vec::new(); + let mut edges: Vec = Vec::new(); + + // Add all built-in types as nodes + for &name in BUILTINS { + nodes.push(TypeNode { + id: name.to_string(), + name: name.to_string(), + kind: "builtin".into(), + fields: vec![], + }); + } + + // Add user-defined types + for (type_name, def) in &env.types { + // Skip built-ins — already added + if BUILTINS.contains(&type_name.as_str()) { + continue; + } + match def { + TypeDef::Struct { fields, .. } => { + let field_strs: Vec = fields + .iter() + .map(|(f, t)| format!("{f}: {t}")) + .collect(); + + nodes.push(TypeNode { + id: type_name.clone(), + name: type_name.clone(), + kind: "struct".into(), + fields: field_strs, + }); + + // Add field edges + for (field_name, field_type) in fields { + if let Some(target) = named_type(field_type) { + edges.push(TypeEdge { + from: type_name.clone(), + to: target, + label: format!("field:{field_name}"), + }); + } + } + } + TypeDef::Enum { variants, .. } => { + let field_strs: Vec = variants + .iter() + .map(|v| { + if let Some(payload) = &v.payload { + format!("{}({})", v.name, payload) + } else { + v.name.clone() + } + }) + .collect(); + + nodes.push(TypeNode { + id: type_name.clone(), + name: type_name.clone(), + kind: "enum".into(), + fields: field_strs, + }); + + // Add variant payload edges + for v in variants { + if let Some(payload) = &v.payload { + if let Some(target) = named_type(payload) { + edges.push(TypeEdge { + from: type_name.clone(), + to: target, + label: format!("variant:{}", v.name), + }); + } + } + } + } + TypeDef::Primitive(_) => { + // Register as primitive node (e.g. user-registered aliases) + nodes.push(TypeNode { + id: type_name.clone(), + name: type_name.clone(), + kind: "primitive".into(), + fields: vec![], + }); + } + } + } + + // Add function signature edges + for (fn_name, fn_type) in &env.functions { + if let Type::Fn { params, return_type } = fn_type { + // Return edge: fn -> return type + if let Some(ret) = named_type(return_type) { + edges.push(TypeEdge { + from: fn_name.clone(), + to: ret, + label: "returns".into(), + }); + } + // Param edges: fn -> param types + for param_type in params { + if let Some(param) = named_type(param_type) { + edges.push(TypeEdge { + from: fn_name.clone(), + to: param, + label: "param".into(), + }); + } + } + } + } + + TypeGraph { nodes, edges } +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +/// Extract the name from a Named type, or the inner type for Array/Optional. +fn named_type(ty: &Type) -> Option { + match ty { + Type::Named(n) => Some(n.clone()), + Type::Array(inner) => named_type(inner), + Type::Optional(inner) => named_type(inner), + _ => None, + } +} diff --git a/ide/crates/el-plugin-host/Cargo.toml b/ide/crates/el-plugin-host/Cargo.toml new file mode 100644 index 0000000..f6661de --- /dev/null +++ b/ide/crates/el-plugin-host/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "el-plugin-host" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } diff --git a/ide/crates/el-plugin-host/src/lib.rs b/ide/crates/el-plugin-host/src/lib.rs new file mode 100644 index 0000000..789aa15 --- /dev/null +++ b/ide/crates/el-plugin-host/src/lib.rs @@ -0,0 +1,253 @@ +//! el-plugin-host — Plugin lifecycle management for el-ide. +//! +//! Manages installation, removal, and querying of IDE plugins. +//! First-party plugins are pre-registered; a plugin registry server +//! is required for third-party installation (not yet live). + +use std::collections::HashMap; + +use serde::{Deserialize, Serialize}; +use thiserror::Error; + +// ── Types ───────────────────────────────────────────────────────────────────── + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PluginHook { + OnSave, + OnBuild, + OnBuildComplete, + CustomPanel, + CustomTool, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Plugin { + pub name: String, + pub version: String, + pub description: String, + pub installed: bool, + pub enabled: bool, + pub hooks: Vec, + /// Whether this is a first-party Neuron Technologies plugin. + pub first_party: bool, +} + +#[derive(Debug, Error)] +pub enum PluginError { + #[error("plugin '{0}' not found")] + NotFound(String), + #[error("plugin '{0}' is already installed")] + AlreadyInstalled(String), + #[error("plugin registry is not available (registry URL not configured)")] + RegistryUnavailable, + #[error("plugin '{0}' cannot be removed: it is a required built-in")] + BuiltIn(String), +} + +// ── PluginHost ──────────────────────────────────────────────────────────────── + +pub struct PluginHost { + plugins: HashMap, +} + +impl PluginHost { + /// Create a PluginHost pre-populated with first-party plugins. + pub fn new() -> Self { + let mut host = Self { plugins: HashMap::new() }; + host.register_first_party_plugins(); + host + } + + // ── Public API ──────────────────────────────────────────────────────────── + + pub fn list(&self) -> Vec { + let mut plugins: Vec = self.plugins.values().cloned().collect(); + plugins.sort_by(|a, b| a.name.cmp(&b.name)); + plugins + } + + /// Install a plugin by name. + /// + /// For first-party plugins, this marks them as installed. + /// For third-party, registry access is required (not yet implemented). + pub fn install(&mut self, name: &str) -> Result { + if let Some(plugin) = self.plugins.get_mut(name) { + if plugin.installed { + return Err(PluginError::AlreadyInstalled(name.to_string())); + } + plugin.installed = true; + plugin.enabled = true; + Ok(plugin.clone()) + } else { + Err(PluginError::RegistryUnavailable) + } + } + + /// Remove a plugin. + pub fn remove(&mut self, name: &str) -> Result<(), PluginError> { + match self.plugins.get_mut(name) { + None => Err(PluginError::NotFound(name.to_string())), + Some(p) => { + if p.name == "el-theme-dark" { + return Err(PluginError::BuiltIn(name.to_string())); + } + p.installed = false; + p.enabled = false; + Ok(()) + } + } + } + + pub fn enable(&mut self, name: &str) -> Result<(), PluginError> { + self.plugins + .get_mut(name) + .ok_or_else(|| PluginError::NotFound(name.to_string())) + .map(|p| { p.enabled = true; }) + } + + pub fn disable(&mut self, name: &str) -> Result<(), PluginError> { + self.plugins + .get_mut(name) + .ok_or_else(|| PluginError::NotFound(name.to_string())) + .map(|p| { p.enabled = false; }) + } + + pub fn get(&self, name: &str) -> Option<&Plugin> { + self.plugins.get(name) + } + + // ── First-party plugins ─────────────────────────────────────────────────── + + fn register_first_party_plugins(&mut self) { + let plugins = vec![ + Plugin { + name: "el-theme-dark".into(), + version: "1.0.0".into(), + description: "Dark theme — the default Engram IDE theme.".into(), + installed: true, + enabled: true, + hooks: vec![], + first_party: true, + }, + Plugin { + name: "el-theme-light".into(), + version: "1.0.0".into(), + description: "Light theme for high-ambient-light environments.".into(), + installed: false, + enabled: false, + hooks: vec![], + first_party: true, + }, + Plugin { + name: "el-fmt".into(), + version: "0.1.0".into(), + description: "Code formatter — auto-formats .el files on save.".into(), + installed: true, + enabled: true, + hooks: vec![PluginHook::OnSave], + first_party: true, + }, + Plugin { + name: "el-doc".into(), + version: "0.1.0".into(), + description: "Documentation generator — produces HTML docs from type definitions.".into(), + installed: false, + enabled: false, + hooks: vec![PluginHook::CustomTool], + first_party: true, + }, + Plugin { + name: "el-test".into(), + version: "0.1.0".into(), + description: "Test runner with inline results displayed in the editor gutter.".into(), + installed: false, + enabled: false, + hooks: vec![PluginHook::OnBuildComplete, PluginHook::CustomPanel], + first_party: true, + }, + ]; + + for plugin in plugins { + self.plugins.insert(plugin.name.clone(), plugin); + } + } +} + +impl Default for PluginHost { + fn default() -> Self { + Self::new() + } +} + +// ── Tests ───────────────────────────────────────────────────────────────────── + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_list_returns_all_first_party() { + let host = PluginHost::new(); + let plugins = host.list(); + assert_eq!(plugins.len(), 5); + } + + #[test] + fn test_dark_theme_installed_by_default() { + let host = PluginHost::new(); + let plugin = host.get("el-theme-dark").unwrap(); + assert!(plugin.installed); + assert!(plugin.enabled); + } + + #[test] + fn test_install_uninstalled_plugin() { + let mut host = PluginHost::new(); + let result = host.install("el-doc"); + assert!(result.is_ok()); + let plugin = host.get("el-doc").unwrap(); + assert!(plugin.installed); + assert!(plugin.enabled); + } + + #[test] + fn test_install_already_installed_errors() { + let mut host = PluginHost::new(); + let result = host.install("el-theme-dark"); + assert!(matches!(result, Err(PluginError::AlreadyInstalled(_)))); + } + + #[test] + fn test_remove_plugin() { + let mut host = PluginHost::new(); + host.install("el-fmt").ok(); // already installed + let result = host.remove("el-fmt"); + assert!(result.is_ok()); + let plugin = host.get("el-fmt").unwrap(); + assert!(!plugin.installed); + } + + #[test] + fn test_remove_builtin_errors() { + let mut host = PluginHost::new(); + let result = host.remove("el-theme-dark"); + assert!(matches!(result, Err(PluginError::BuiltIn(_)))); + } + + #[test] + fn test_remove_nonexistent_errors() { + let mut host = PluginHost::new(); + let result = host.remove("el-nonexistent"); + assert!(matches!(result, Err(PluginError::NotFound(_)))); + } + + #[test] + fn test_enable_disable() { + let mut host = PluginHost::new(); + host.disable("el-theme-dark").unwrap(); + assert!(!host.get("el-theme-dark").unwrap().enabled); + host.enable("el-theme-dark").unwrap(); + assert!(host.get("el-theme-dark").unwrap().enabled); + } +} diff --git a/ide/examples/hello-project/el.toml b/ide/examples/hello-project/el.toml new file mode 100644 index 0000000..5261a74 --- /dev/null +++ b/ide/examples/hello-project/el.toml @@ -0,0 +1,3 @@ +[package] +name = "hello" +version = "0.1.0" diff --git a/ide/examples/hello-project/src/main.el b/ide/examples/hello-project/src/main.el new file mode 100644 index 0000000..09d5c5c --- /dev/null +++ b/ide/examples/hello-project/src/main.el @@ -0,0 +1,41 @@ +fn main() -> Void { + let greeting: String = "Hello from Engram" + let count: Int = 42 +} + +type Point { + x: Float + y: Float +} + +fn distance(a: Point, b: Point) -> Float { + let dx: Float = a.x - b.x + let dy: Float = a.y - b.y + return dx * dx + dy * dy +} + +type Circle { + center: Point + radius: Float +} + +enum Shape { + Dot + Line(String) + Polygon(Int) +} + +fn classify(s: Shape) -> String { + match s { + Shape::Dot => "point" + Shape::Line(name) => name + Shape::Polygon(sides) => "polygon" + } +} + +// activate example — spreading activation query +// let circles: [Circle] = activate Circle where "large circles near origin" + +sealed { + let api_key: String = "secret-key" +} diff --git a/ide/ide/index.html b/ide/ide/index.html new file mode 100644 index 0000000..566db1b --- /dev/null +++ b/ide/ide/index.html @@ -0,0 +1,1466 @@ + + + + + +el-ide — Engram Language IDE + + + + + + + + + + +
+
+ + +
+
Files
+
+
Loading...
+
+
+ + +
+
+
+ main.el +
+
+
+
+
+
+
+ + +
+
Type Graph
+ +
+
+
+ builtin +
+
+
+ struct +
+
+
+ enum +
+
+
+ primitive +
+
+
+ +
+ + +
+
+
Build Output
+
+ Problems +
+
Reasoning
+
Plugins
+
+
+ + +
+ el-ide ready. Press Build to compile. +
+ + +
+
No problems detected.
+
+ + +
+
+ + +
+
+
Enter a hypothesis and press Reason to query the Engram knowledge graph.
+
+
+ + +
+
Loading...
+
+ +
+
+ +
+ + + + + + +