From ed7357a28bd0b977ec649fdda0e3603281a8787e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 24 Aug 2026 17:57:06 +0200 Subject: [PATCH] Extract Codex transport from Epiphany --- Cargo.lock | 5054 +---------------- Cargo.toml | 7 +- .../src/bin/epiphany-mvp-coordinator.rs | 60 +- epiphany-core/src/bin/epiphany-swarm.rs | 8 +- epiphany-core/src/current_work.rs | 2 +- epiphany-core/src/resident_readiness.rs | 38 +- epiphany-core/src/resident_self.rs | 19 +- epiphany-core/src/runtime_spine.rs | 5 +- epiphany-model-adapter/src/lib.rs | 18 +- epiphany-openai-adapter/Cargo.toml | 3 + epiphany-openai-adapter/src/lib.rs | 706 ++- epiphany-openai-codex-spine/Cargo.toml | 21 - epiphany-openai-codex-spine/src/lib.rs | 1960 ------- .../src/bin/epiphany-openai-runtime.rs | 158 +- .../src/bin/epiphany-persona-service.rs | 25 +- epiphany-openai-runtime/src/lib.rs | 115 +- .../src/provider_transport.rs | 308 +- 17 files changed, 1410 insertions(+), 7097 deletions(-) delete mode 100644 epiphany-openai-codex-spine/Cargo.toml delete mode 100644 epiphany-openai-codex-spine/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 8b65eae1..0470736e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,22 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - [[package]] name = "aead" version = "0.5.2" @@ -53,19 +37,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "getrandom 0.3.4", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.5" @@ -75,36 +46,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocative" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fac2ce611db8b8cee9b2aa886ca03c924e9da5e5295d0dbd0526e5d0b0710f7" -dependencies = [ - "allocative_derive", - "bumpalo", - "ctor", - "hashbrown 0.14.5", - "num-bigint", -] - -[[package]] -name = "allocative_derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe233a377643e0fc1a56421d7c90acdec45c291b30345eb9f08e8d0ddce5a4ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "android_system_properties" version = "0.1.6" @@ -114,256 +55,12 @@ dependencies = [ "libc", ] -[[package]] -name = "annotate-snippets" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "anstream" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" - -[[package]] -name = "anstyle-parse" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.61.2", -] - [[package]] name = "anyhow" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - -[[package]] -name = "asn1-rs" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f43a50ac4fdca5df8e885c21b835997f0a1cdee65494a6847694a98652d9d8" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom 7.1.3", - "num-traits", - "rusticata-macros", - "thiserror 2.0.20", - "time", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "async-broadcast" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" -dependencies = [ - "event-listener", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-channel" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "pin-project-lite", - "slab", -] - -[[package]] -name = "async-fs" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5" -dependencies = [ - "async-lock", - "blocking", - "futures-lite", -] - -[[package]] -name = "async-io" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" -dependencies = [ - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-lock" -version = "3.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" -dependencies = [ - "event-listener", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" -dependencies = [ - "async-channel", - "async-io", - "async-lock", - "async-signal", - "async-task", - "blocking", - "cfg-if", - "event-listener", - "futures-lite", - "rustix", -] - -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "async-signal" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix", - "signal-hook-registry", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.92" @@ -375,16 +72,6 @@ dependencies = [ "syn 3.0.3", ] -[[package]] -name = "asynk-strim" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52697735bdaac441a29391a9e97102c74c6ef0f9b60a40cf109b1b404e29d2f6" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -404,7 +91,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce2b2dcc879c3bae0d371e77c99f2238400ef24ec001394befa67b6e543add9e" dependencies = [ "aws-lc-sys", - "untrusted 0.7.1", "zeroize", ] @@ -427,63 +113,24 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + [[package]] name = "base64ct" version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec 0.6.3", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bit-vec" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -493,15 +140,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-padding" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" -dependencies = [ - "generic-array", -] - [[package]] name = "block2" version = "0.6.2" @@ -511,38 +149,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "blocking" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" -dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - -[[package]] -name = "borsh" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88b7ea17d208c4193f2c1e6de3c35fe71f98c96982d5ced308bdcc749ff6e1f" -dependencies = [ - "bytes", - "cfg_aliases 0.2.2", -] - -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "tinyvec", -] - [[package]] name = "bstr" version = "1.13.0" @@ -559,39 +165,12 @@ version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "bytemuck" -version = "1.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - [[package]] name = "bytes" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" -[[package]] -name = "cbc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" -dependencies = [ - "cipher", -] - [[package]] name = "cc" version = "1.4.2" @@ -601,7 +180,7 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex 2.0.1", + "shlex", ] [[package]] @@ -610,12 +189,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cfg_aliases" version = "0.2.2" @@ -633,17 +206,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "chardetng" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b8f0b65b7b08ae3c8187e8d77174de20cb6777864c6b832d8ad365999cf1ea" -dependencies = [ - "cfg-if", - "encoding_rs", - "memchr", -] - [[package]] name = "chrono" version = "0.4.45" @@ -658,12 +220,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "chunked_transfer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" - [[package]] name = "cipher" version = "0.4.4" @@ -672,56 +228,6 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", - "zeroize", -] - -[[package]] -name = "clap" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim 0.11.1", -] - -[[package]] -name = "clap_derive" -version = "4.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 3.0.3", -] - -[[package]] -name = "clap_lex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" - -[[package]] -name = "clipboard-win" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" -dependencies = [ - "error-code", ] [[package]] @@ -734,435 +240,21 @@ dependencies = [ ] [[package]] -name = "cmp_any" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b18233253483ce2f65329a24072ec414db782531bdbb7d0bbc4bd2ce6b7e21" - -[[package]] -name = "codex-agent-identity" -version = "0.0.0" +name = "codex-connector" +version = "0.1.0" +source = "git+https://github.com/GameCult/CodexConnector?rev=54d8bc2525b7e7fa1b9dd26b95871247ff4c7566#54d8bc2525b7e7fa1b9dd26b95871247ff4c7566" dependencies = [ - "anyhow", - "base64", - "chrono", - "codex-protocol", - "crypto_box", - "ed25519-dalek", - "rand 0.9.5", - "reqwest 0.12.28", + "aes-gcm", + "base64 0.23.1", + "rand_core 0.6.4", + "rmp-serde", "serde", "serde_json", "sha2", + "thiserror", + "zeroize", ] -[[package]] -name = "codex-api" -version = "0.0.0" -dependencies = [ - "async-channel", - "async-trait", - "base64", - "bytes", - "chrono", - "codex-client", - "codex-protocol", - "codex-utils-rustls-provider", - "eventsource-stream", - "futures", - "http", - "regex-lite", - "reqwest 0.12.28", - "serde", - "serde_json", - "thiserror 2.0.20", - "tokio", - "tokio-tungstenite", - "tokio-util", - "tracing", - "tungstenite", - "url", -] - -[[package]] -name = "codex-app-server-protocol" -version = "0.0.0" -dependencies = [ - "anyhow", - "clap", - "codex-experimental-api-macros", - "codex-protocol", - "codex-shell-command", - "codex-utils-absolute-path", - "inventory", - "rmcp 0.15.0", - "schemars 0.8.22", - "serde", - "serde_json", - "serde_with", - "strum_macros", - "thiserror 2.0.20", - "tracing", - "ts-rs", - "uuid", -] - -[[package]] -name = "codex-async-utils" -version = "0.0.0" -dependencies = [ - "async-trait", - "tokio", - "tokio-util", -] - -[[package]] -name = "codex-client" -version = "0.0.0" -dependencies = [ - "async-trait", - "bytes", - "codex-utils-rustls-provider", - "eventsource-stream", - "futures", - "http", - "opentelemetry", - "rand 0.9.5", - "reqwest 0.12.28", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "serde", - "serde_json", - "thiserror 2.0.20", - "tokio", - "tracing", - "tracing-opentelemetry", - "zstd", -] - -[[package]] -name = "codex-config" -version = "0.0.0" -dependencies = [ - "anyhow", - "async-trait", - "codex-app-server-protocol", - "codex-execpolicy", - "codex-features", - "codex-model-provider-info", - "codex-network-proxy", - "codex-protocol", - "codex-utils-absolute-path", - "codex-utils-path", - "dns-lookup", - "futures", - "gethostname", - "libc", - "multimap", - "schemars 0.8.22", - "serde", - "serde_json", - "serde_path_to_error", - "sha2", - "thiserror 2.0.20", - "tokio", - "toml", - "toml_edit 0.24.1+spec-1.1.0", - "tracing", - "wildmatch", - "winapi-util", -] - -[[package]] -name = "codex-execpolicy" -version = "0.0.0" -dependencies = [ - "anyhow", - "clap", - "codex-utils-absolute-path", - "multimap", - "serde", - "serde_json", - "shlex 1.3.0", - "starlark", - "thiserror 2.0.20", -] - -[[package]] -name = "codex-experimental-api-macros" -version = "0.0.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "codex-features" -version = "0.0.0" -dependencies = [ - "codex-otel", - "codex-protocol", - "schemars 0.8.22", - "serde", - "toml", - "tracing", -] - -[[package]] -name = "codex-keyring-store" -version = "0.0.0" -dependencies = [ - "keyring", - "tracing", -] - -[[package]] -name = "codex-login" -version = "0.0.0" -dependencies = [ - "async-trait", - "base64", - "chrono", - "codex-agent-identity", - "codex-app-server-protocol", - "codex-client", - "codex-config", - "codex-keyring-store", - "codex-model-provider-info", - "codex-otel", - "codex-protocol", - "codex-terminal-detection", - "codex-utils-template", - "once_cell", - "os_info", - "rand 0.9.5", - "reqwest 0.12.28", - "serde", - "serde_json", - "sha2", - "thiserror 2.0.20", - "tiny_http", - "tokio", - "tracing", - "url", - "urlencoding", - "webbrowser", -] - -[[package]] -name = "codex-model-provider-info" -version = "0.0.0" -dependencies = [ - "codex-api", - "codex-app-server-protocol", - "codex-protocol", - "http", - "schemars 0.8.22", - "serde", -] - -[[package]] -name = "codex-network-proxy" -version = "0.0.0" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "clap", - "codex-utils-absolute-path", - "codex-utils-home-dir", - "codex-utils-rustls-provider", - "globset", - "rama-core", - "rama-http", - "rama-http-backend", - "rama-net", - "rama-socks5", - "rama-tcp", - "rama-tls-rustls", - "rama-unix", - "serde", - "serde_json", - "thiserror 2.0.20", - "time", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "codex-otel" -version = "0.0.0" -dependencies = [ - "chrono", - "codex-api", - "codex-app-server-protocol", - "codex-protocol", - "codex-utils-absolute-path", - "codex-utils-string", - "eventsource-stream", - "gethostname", - "http", - "opentelemetry", - "opentelemetry-appender-tracing", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", - "os_info", - "reqwest 0.12.28", - "serde", - "serde_json", - "strum_macros", - "thiserror 2.0.20", - "tokio", - "tokio-tungstenite", - "tracing", - "tracing-opentelemetry", - "tracing-subscriber", -] - -[[package]] -name = "codex-protocol" -version = "0.0.0" -dependencies = [ - "chardetng", - "chrono", - "codex-async-utils", - "codex-execpolicy", - "codex-network-proxy", - "codex-utils-absolute-path", - "codex-utils-image", - "codex-utils-string", - "codex-utils-template", - "encoding_rs", - "globset", - "icu_decimal", - "icu_locale_core", - "icu_provider", - "landlock", - "quick-xml", - "reqwest 0.12.28", - "schemars 0.8.22", - "seccompiler", - "serde", - "serde_json", - "serde_with", - "strum", - "strum_macros", - "sys-locale", - "thiserror 2.0.20", - "tokio", - "tracing", - "ts-rs", - "uuid", -] - -[[package]] -name = "codex-shell-command" -version = "0.0.0" -dependencies = [ - "base64", - "codex-protocol", - "codex-utils-absolute-path", - "once_cell", - "regex", - "serde", - "serde_json", - "shlex 1.3.0", - "tree-sitter", - "tree-sitter-bash", - "url", - "which", -] - -[[package]] -name = "codex-terminal-detection" -version = "0.0.0" -dependencies = [ - "tracing", -] - -[[package]] -name = "codex-utils-absolute-path" -version = "0.0.0" -dependencies = [ - "dirs", - "dunce", - "schemars 0.8.22", - "serde", - "ts-rs", -] - -[[package]] -name = "codex-utils-cache" -version = "0.0.0" -dependencies = [ - "lru", - "sha1", - "tokio", -] - -[[package]] -name = "codex-utils-home-dir" -version = "0.0.0" -dependencies = [ - "codex-utils-absolute-path", - "dirs", -] - -[[package]] -name = "codex-utils-image" -version = "0.0.0" -dependencies = [ - "base64", - "codex-utils-cache", - "image", - "mime_guess", - "thiserror 2.0.20", - "tokio", -] - -[[package]] -name = "codex-utils-path" -version = "0.0.0" -dependencies = [ - "codex-utils-absolute-path", - "dunce", - "tempfile", -] - -[[package]] -name = "codex-utils-rustls-provider" -version = "0.0.0" -dependencies = [ - "rustls", -] - -[[package]] -name = "codex-utils-string" -version = "0.0.0" -dependencies = [ - "regex-lite", -] - -[[package]] -name = "codex-utils-template" -version = "0.0.0" - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "colorchoice" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" - [[package]] name = "combine" version = "4.6.7" @@ -1173,102 +265,12 @@ dependencies = [ "memchr", ] -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-hex" -version = "1.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e2a781ebdf4467d1428dc4593067825fb646f6871475098d8577421af73558" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "proptest", - "serde_core", -] - [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const_format" -version = "0.2.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" -dependencies = [ - "const_format_proc_macros", - "konst", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "cookie" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - -[[package]] -name = "cookie_store" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" -dependencies = [ - "cookie", - "document-features", - "idna", - "log", - "publicsuffix", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] - -[[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" @@ -1303,30 +305,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crossbeam-channel" -version = "0.5.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.7" @@ -1352,12 +330,6 @@ version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - [[package]] name = "crypto-common" version = "0.1.7" @@ -1369,67 +341,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto_box" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16182b4f39a82ec8a6851155cc4c0cda3065bb1db33651726a29e1951de0f009" -dependencies = [ - "aead", - "blake2", - "crypto_secretbox", - "curve25519-dalek", - "salsa20", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto_secretbox" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" -dependencies = [ - "aead", - "cipher", - "generic-array", - "poly1305", - "salsa20", - "subtle", - "zeroize", -] - -[[package]] -name = "csv" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde_core", -] - -[[package]] -name = "csv-core" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" -dependencies = [ - "memchr", -] - -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "ctr" version = "0.9.2" @@ -1446,7 +357,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0b1fab2ae45819af2d0731d60f2afe17227ebb1a1538a236da84c93e9a60162" dependencies = [ "dispatch2", - "nix 0.31.3", + "nix", "windows-sys 0.61.2", ] @@ -1494,7 +405,7 @@ version = "0.1.0" dependencies = [ "aes-gcm", "anyhow", - "base64", + "base64 0.22.1", "chrono", "cultcache-rs", "ed25519-dalek", @@ -1540,86 +451,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.119", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "data-encoding" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" - -[[package]] -name = "dbus" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e" -dependencies = [ - "libc", - "libdbus-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "dbus-secret-service" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "708b509edf7889e53d7efb0ffadd994cc6c2345ccb62f55cfd6b0682165e4fa6" -dependencies = [ - "aes", - "block-padding", - "cbc", - "dbus", - "fastrand", - "hkdf", - "num", - "once_cell", - "sha2", - "zeroize", -] - -[[package]] -name = "debugserver-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf6834a70ed14e8e4e41882df27190bea150f1f6ecf461f1033f8739cd8af4a" -dependencies = [ - "schemafy", - "serde", - "serde_json", -] - [[package]] name = "der" version = "0.7.10" @@ -1630,62 +461,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom 7.1.3", - "num-bigint", - "num-traits", - "rusticata-macros", -] - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "serde_core", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "syn 2.0.119", - "unicode-xid", -] - [[package]] name = "diff" version = "0.1.13" @@ -1703,70 +478,18 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.5.2", - "windows-sys 0.61.2", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users 0.4.6", - "winapi", -] - [[package]] name = "dispatch2" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" dependencies = [ - "bitflags 2.13.1", + "bitflags", "block2", "libc", "objc2", ] -[[package]] -name = "display_container" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a110a75c96bedec8e65823dea00a1d710288b7a369d95fd8a0f5127639466fa" -dependencies = [ - "either", - "indenter", -] - [[package]] name = "displaydoc" version = "0.2.7" @@ -1778,53 +501,12 @@ dependencies = [ "syn 3.0.3", ] -[[package]] -name = "dns-lookup" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e39034cee21a2f5bbb66ba0e3689819c4bb5d00382a282006e802a7ffa6c41d" -dependencies = [ - "cfg-if", - "libc", - "socket2 0.6.5", - "windows-sys 0.60.2", -] - -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - [[package]] name = "dunce" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" -[[package]] -name = "dupe" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed2bc011db9c93fbc2b6cdb341a53737a55bafb46dbb74cf6764fc33a2fbf9c" -dependencies = [ - "dupe_derive", -] - -[[package]] -name = "dupe_derive" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e195b4945e88836d826124af44fdcb262ec01ef94d44f14f4fb5103f19892a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "dyn-clone" version = "1.0.20" @@ -1855,81 +537,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "either" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" - -[[package]] -name = "ena" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabffdaee24bd1bf95c5ef7cec31260444317e72ea56c4c91750e8b7ee58d5f1" -dependencies = [ - "log", -] - -[[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 = "endi" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "endian-type" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869b0adbda23651a9c5c0c3d270aac9fcb52e8622a8f2b17e57802d7791962f2" - -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "enumflags2" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "epiphany-core" version = "0.1.0" @@ -1971,24 +578,12 @@ dependencies = [ name = "epiphany-openai-adapter" version = "0.1.0" dependencies = [ + "anyhow", "cultcache-rs", "epiphany-model-adapter", "serde", -] - -[[package]] -name = "epiphany-openai-codex-spine" -version = "0.1.0" -dependencies = [ - "anyhow", - "codex-client", - "codex-login", - "epiphany-openai-adapter", - "http", - "serde", "serde_json", "sha2", - "tokio", ] [[package]] @@ -2017,13 +612,13 @@ version = "0.1.0" dependencies = [ "anyhow", "chrono", + "codex-connector", "ctrlc", "cultcache-rs", "cultnet-rs", "epiphany-core", "epiphany-model-adapter", "epiphany-openai-adapter", - "epiphany-openai-codex-spine", "epiphany-openai-runtime", "epiphany-tool-adapter", "epiphany-tool-mcp-runtime", @@ -2034,7 +629,9 @@ dependencies = [ "tempfile", "tokio", "toml", + "ureq", "uuid", + "zeroize", ] [[package]] @@ -2056,7 +653,7 @@ dependencies = [ name = "epiphany-state-model" version = "0.1.0" dependencies = [ - "schemars 0.8.22", + "schemars", "serde", "ts-rs", ] @@ -2080,8 +677,8 @@ dependencies = [ "epiphany-core", "epiphany-tool-adapter", "http", - "reqwest 0.13.4", - "rmcp 2.2.0", + "reqwest", + "rmcp", "serde", "serde_json", "sha2", @@ -2096,15 +693,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "erased-serde" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" -dependencies = [ - "serde", -] - [[package]] name = "errno" version = "0.3.14" @@ -2115,71 +703,11 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "error-code" -version = "3.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" - -[[package]] -name = "event-listener" -version = "5.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" -dependencies = [ - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" -dependencies = [ - "event-listener", - "pin-project-lite", -] - -[[package]] -name = "eventsource-stream" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" -dependencies = [ - "futures-core", - "nom 7.1.3", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" -dependencies = [ - "getrandom 0.4.3", -] - -[[package]] -name = "fd-lock" -version = "4.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" -dependencies = [ - "cfg-if", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] [[package]] name = "fiat-crypto" @@ -2193,73 +721,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de" -[[package]] -name = "fixed_decimal" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c3c892f121fff406e5dd6b28c1b30096b95111c30701a899d4f2b18da6d1bd" -dependencies = [ - "displaydoc", - "smallvec", - "writeable", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "libz-sys", - "miniz_oxide", -] - -[[package]] -name = "flume" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be" -dependencies = [ - "fastrand", - "futures-core", - "futures-sink", - "spin", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[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" @@ -2333,19 +794,6 @@ version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" -[[package]] -name = "futures-lite" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.33" @@ -2386,30 +834,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generator" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b854b0e584ead1a33f18b2fcad7cf7be18b3875c78816b753639aa501513ae" -dependencies = [ - "cc", - "cfg-if", - "libc", - "log", - "rustversion", - "windows-link", - "windows-result", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2418,17 +842,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", -] - -[[package]] -name = "gethostname" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" -dependencies = [ - "rustix", - "windows-link", ] [[package]] @@ -2489,16 +902,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "gif" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" -dependencies = [ - "color_quant", - "weezl", -] - [[package]] name = "globset" version = "0.4.20" @@ -2509,53 +912,7 @@ dependencies = [ "bstr", "log", "regex-automata", - "regex-syntax 0.8.11", -] - -[[package]] -name = "h2" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.14.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hashbrown" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", + "regex-syntax", ] [[package]] @@ -2564,103 +921,6 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" -[[package]] -name = "headers" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3314d5adb5d94bcdf56771f2e50dbbc80bb4bdf88967526706205ac9eff24eb" -dependencies = [ - "base64", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" -dependencies = [ - "http", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hickory-proto" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna", - "ipnet", - "once_cell", - "rand 0.9.5", - "ring", - "thiserror 2.0.20", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "hickory-resolver" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto", - "ipconfig", - "moka", - "once_cell", - "parking_lot", - "rand 0.9.5", - "resolv-conf", - "smallvec", - "thiserror 2.0.20", - "tokio", - "tracing", -] - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - [[package]] name = "hmac" version = "0.12.1" @@ -2670,15 +930,6 @@ dependencies = [ "digest", ] -[[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.5.0" @@ -2712,24 +963,12 @@ dependencies = [ "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.11.0" @@ -2740,7 +979,6 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "h2", "http", "http-body", "httparse", @@ -2761,40 +999,9 @@ dependencies = [ "hyper", "hyper-util", "rustls", - "rustls-native-certs", "tokio", "tokio-rustls", "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-timeout" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" -dependencies = [ - "hyper", - "hyper-util", - "pin-project-lite", - "tokio", - "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]] @@ -2803,7 +1010,7 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-channel", "futures-util", @@ -2815,11 +1022,9 @@ dependencies = [ "percent-encoding", "pin-project-lite", "socket2 0.6.5", - "system-configuration", "tokio", "tower-service", "tracing", - "windows-registry", ] [[package]] @@ -2860,44 +1065,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_decimal" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288247df2e32aa776ac54fdd64de552149ac43cb840f2761811f0e8d09719dd4" -dependencies = [ - "displaydoc", - "fixed_decimal", - "icu_decimal_data", - "icu_locale", - "icu_locale_core", - "icu_plurals", - "icu_provider", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_decimal_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f14a5ca9e8af29eef62064f269078424283d90dbaffeac5225addf62aaabc22" - -[[package]] -name = "icu_locale" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5a396343c7208121dc86e35623d3dfe19814a7613cfd14964994cdc9c9a2e26" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_locale_data", - "icu_provider", - "potential_utf", - "tinystr", - "zerovec", -] - [[package]] name = "icu_locale_core" version = "2.2.0" @@ -2906,18 +1073,11 @@ checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", - "serde", "tinystr", "writeable", "zerovec", ] -[[package]] -name = "icu_locale_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fdcc9ac77c6d74ff5cf6e65ef3181d6af32003b16fce3a77fb451d2f695993" - [[package]] name = "icu_normalizer" version = "2.2.0" @@ -2938,25 +1098,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" -[[package]] -name = "icu_plurals" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a50023f1d49ad5c4333380328a0d4a19e4b9d6d842ec06639affd5ba47c8103" -dependencies = [ - "fixed_decimal", - "icu_locale", - "icu_plurals_data", - "icu_provider", - "zerovec", -] - -[[package]] -name = "icu_plurals_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8485497155dc865f901decb93ecc20d3e467df67bfeceb91e3ba34e2b11e8e1d" - [[package]] name = "icu_properties" version = "2.2.0" @@ -2985,8 +1126,6 @@ checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", - "serde", - "stable_deref_trait", "writeable", "yoke", "zerofrom", @@ -2994,12 +1133,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "1.1.0" @@ -3037,51 +1170,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "image" -version = "0.25.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" -dependencies = [ - "bytemuck", - "byteorder-lite", - "color_quant", - "gif", - "image-webp", - "moxcms", - "num-traits", - "png", - "zune-core", - "zune-jpeg", -] - -[[package]] -name = "image-webp" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" -dependencies = [ - "byteorder-lite", - "quick-error", -] - -[[package]] -name = "indenter" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.14.0" @@ -3089,9 +1177,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.17.1", - "serde", - "serde_core", + "hashbrown", ] [[package]] @@ -3100,92 +1186,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ - "block-padding", "generic-array", ] -[[package]] -name = "inventory" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" -dependencies = [ - "rustversion", -] - -[[package]] -name = "ipconfig" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d40460c0ce33d6ce4b0630ad68ff63d6661961c48b6dba35e5a4d81cfb48222" -dependencies = [ - "socket2 0.6.5", - "widestring", - "windows-registry", - "windows-result", - "windows-sys 0.61.2", -] - [[package]] name = "ipnet" version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78" -[[package]] -name = "iri-string" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1663ee7d8cf2900cc1414b1e1eec9f348d6eaa3bcab07579f4726a4b8499f447" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.18" @@ -3204,7 +1213,7 @@ dependencies = [ "jni-sys", "log", "simd_cesu8", - "thiserror 2.0.20", + "thiserror", "walkdir", "windows-link", ] @@ -3262,132 +1271,12 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "keyring" -version = "3.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c" -dependencies = [ - "byteorder", - "dbus-secret-service", - "linux-keyutils", - "log", - "secret-service", - "security-framework 2.11.1", - "security-framework 3.7.0", - "windows-sys 0.60.2", - "zbus", - "zeroize", -] - -[[package]] -name = "konst" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" -dependencies = [ - "konst_macro_rules", -] - -[[package]] -name = "konst_macro_rules" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" - -[[package]] -name = "lalrpop" -version = "0.19.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" -dependencies = [ - "ascii-canvas", - "bit-set", - "diff", - "ena", - "is-terminal", - "itertools 0.10.5", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax 0.6.29", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "lalrpop-util" -version = "0.19.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" -dependencies = [ - "regex", -] - -[[package]] -name = "landlock" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cca98e95f35b29d469dade6724c6f96cec9236640f745a0e99b0334ec320ab1" -dependencies = [ - "enumflags2", - "libc", - "thiserror 2.0.20", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" -[[package]] -name = "libdbus-sys" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" -dependencies = [ - "pkg-config", -] - -[[package]] -name = "libredox" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" -dependencies = [ - "libc", -] - -[[package]] -name = "libz-sys" -version = "1.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linux-keyutils" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83270a18e9f90d0707c41e9f35efada77b64c0e6f3f1810e71c8368a864d5590" -dependencies = [ - "bitflags 2.13.1", - "libc", -] - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -3400,177 +1289,24 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - -[[package]] -name = "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.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" -[[package]] -name = "logos" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf8b031682c67a8e3d5446840f9573eb7fe26efe7ec8d195c9ac4c0647c502f1" -dependencies = [ - "logos-derive", -] - -[[package]] -name = "logos-derive" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d849148dbaf9661a6151d1ca82b13bb4c4c128146a88d05253b38d4e2f496c" -dependencies = [ - "beef", - "fnv", - "proc-macro2", - "quote", - "regex-syntax 0.6.29", - "syn 1.0.109", -] - -[[package]] -name = "loom" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" -dependencies = [ - "cfg-if", - "generator", - "pin-utils", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "lru" -version = "0.16.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" -dependencies = [ - "hashbrown 0.16.1", -] - [[package]] name = "lru-slab" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" -[[package]] -name = "lsp-types" -version = "0.94.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" -dependencies = [ - "bitflags 1.3.2", - "serde", - "serde_json", - "serde_repr", - "url", -] - -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[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.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8863b587001c1b9a8a4e36008cebc6b3612cb1226fe2de94858e06092687b608" - -[[package]] -name = "md5" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebb8d8732c6a6df3d8f032a82911cfc747e00efb95cc46e8d0acd5b5b88570c" - [[package]] name = "memchr" version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - -[[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 = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - [[package]] name = "mio" version = "1.2.2" @@ -3582,214 +1318,18 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "moka" -version = "0.12.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957228ad12042ee839f93c8f257b62b4c0ab5eaae1d4fa60de53b27c9d7c5046" -dependencies = [ - "crossbeam-channel", - "crossbeam-epoch", - "crossbeam-utils", - "equivalent", - "parking_lot", - "portable-atomic", - "smallvec", - "tagptr", - "uuid", -] - -[[package]] -name = "moxcms" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" -dependencies = [ - "num-traits", - "pxfm", -] - -[[package]] -name = "multimap" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" -dependencies = [ - "serde", -] - -[[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 3.7.0", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "nix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" -dependencies = [ - "bitflags 2.13.1", - "cfg-if", - "cfg_aliases 0.1.1", - "libc", -] - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.13.1", - "cfg-if", - "cfg_aliases 0.2.2", - "libc", - "memoffset 0.9.1", -] - [[package]] name = "nix" version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ - "bitflags 2.13.1", + "bitflags", "cfg-if", - "cfg_aliases 0.2.2", + "cfg_aliases", "libc", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nom" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" -dependencies = [ - "memchr", -] - -[[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 = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -3808,191 +1348,17 @@ dependencies = [ "objc2-encode", ] -[[package]] -name = "objc2-app-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" -dependencies = [ - "bitflags 2.13.1", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" -dependencies = [ - "bitflags 2.13.1", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-data" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" -dependencies = [ - "bitflags 2.13.1", - "dispatch2", - "objc2", -] - -[[package]] -name = "objc2-core-graphics" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" -dependencies = [ - "bitflags 2.13.1", - "dispatch2", - "objc2", - "objc2-core-foundation", - "objc2-io-surface", -] - -[[package]] -name = "objc2-core-image" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-location" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-text" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" -dependencies = [ - "bitflags 2.13.1", - "objc2", - "objc2-core-foundation", - "objc2-core-graphics", -] - [[package]] name = "objc2-encode" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" -[[package]] -name = "objc2-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" -dependencies = [ - "bitflags 2.13.1", - "block2", - "libc", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-io-surface" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" -dependencies = [ - "bitflags 2.13.1", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" -dependencies = [ - "bitflags 2.13.1", - "objc2", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "objc2-ui-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" -dependencies = [ - "bitflags 2.13.1", - "block2", - "objc2", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-core-image", - "objc2-core-location", - "objc2-core-text", - "objc2-foundation", - "objc2-quartz-core", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "oid-registry" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7" -dependencies = [ - "asn1-rs", -] - [[package]] name = "once_cell" version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -dependencies = [ - "critical-section", - "portable-atomic", -] - -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "opaque-debug" @@ -4000,299 +1366,24 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openssl" -version = "0.10.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" -dependencies = [ - "bitflags 2.13.1", - "cfg-if", - "foreign-types", - "libc", - "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 2.0.119", -] - [[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.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "opentelemetry" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bcd6ae87133e903af7ef497404dda70c60d0ea14895fc8a5e6722754fc2a0" -dependencies = [ - "futures-core", - "futures-sink", - "js-sys", - "pin-project-lite", - "thiserror 2.0.20", - "tracing", -] - -[[package]] -name = "opentelemetry-appender-tracing" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6a1ac5ca3accf562b8c306fa8483c85f4390f768185ab775f242f7fe8fdcc2" -dependencies = [ - "opentelemetry", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "opentelemetry-http" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a6d09a73194e6b66df7c8f1b680f156d916a1a942abf2de06823dd02b7855d" -dependencies = [ - "async-trait", - "bytes", - "http", - "opentelemetry", - "reqwest 0.12.28", -] - -[[package]] -name = "opentelemetry-otlp" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" -dependencies = [ - "http", - "opentelemetry", - "opentelemetry-http", - "opentelemetry-proto", - "opentelemetry_sdk", - "prost", - "reqwest 0.12.28", - "serde_json", - "thiserror 2.0.20", - "tokio", - "tonic", - "tracing", -] - -[[package]] -name = "opentelemetry-proto" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7175df06de5eaee9909d4805a3d07e28bb752c34cab57fa9cff549da596b30f" -dependencies = [ - "base64", - "const-hex", - "opentelemetry", - "opentelemetry_sdk", - "prost", - "serde", - "serde_json", - "tonic", - "tonic-prost", -] - -[[package]] -name = "opentelemetry-semantic-conventions" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e62e29dfe041afb8ed2a6c9737ab57db4907285d999ef8ad3a59092a36bdc846" - -[[package]] -name = "opentelemetry_sdk" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ae4f5991976fd48df6d843de219ca6d31b01daaab2dad5af2badeded372bd" -dependencies = [ - "futures-channel", - "futures-executor", - "futures-util", - "opentelemetry", - "percent-encoding", - "rand 0.9.5", - "thiserror 2.0.20", - "tokio", - "tokio-stream", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "ordered-stream" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" -dependencies = [ - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "os_info" -version = "3.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf20a545b305cf1da722b236b5155c9bb35f1d5ceb28c048bd96ca842f41b5b" -dependencies = [ - "android_system_properties", - "log", - "nix 0.31.3", - "objc2", - "objc2-foundation", - "objc2-ui-kit", - "serde", - "windows-sys 0.61.2", -] - -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[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 = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pastey" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" - -[[package]] -name = "pem" -version = "3.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" -dependencies = [ - "base64", - "serde_core", -] - [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap 2.14.0", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project" -version = "1.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.10.2" @@ -4309,44 +1400,6 @@ version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" -[[package]] -name = "png" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" -dependencies = [ - "bitflags 2.13.1", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "polling" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures 0.2.17", - "opaque-debug", - "universal-hash", -] - [[package]] name = "polyval" version = "0.6.2" @@ -4359,29 +1412,15 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" - [[package]] name = "potential_utf" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ - "serde_core", - "writeable", "zerovec", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.21" @@ -4391,12 +1430,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "pretty_assertions" version = "1.4.1" @@ -4407,15 +1440,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro-crate" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" -dependencies = [ - "toml_edit 0.25.13+spec-1.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.107" @@ -4432,98 +1456,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e842efad9119158434d193c6682e2ebee4b44d6ad801d7b349623b3f57cdf55" dependencies = [ "futures", - "indexmap 2.14.0", - "nix 0.31.3", + "indexmap", + "nix", "tokio", "tracing", "windows", ] -[[package]] -name = "proptest" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" -dependencies = [ - "bitflags 2.13.1", - "num-traits", - "rand 0.9.5", - "rand_chacha 0.9.0", - "rand_xorshift", - "regex-syntax 0.8.11", - "unarray", -] - -[[package]] -name = "prost" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" -dependencies = [ - "anyhow", - "itertools 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "psl" -version = "2.1.223" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0dedad316e05de220cbf3fd8bfb69f3df8755dde2d7d479211827b595168a93" -dependencies = [ - "psl-types", -] - -[[package]] -name = "psl-types" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" - -[[package]] -name = "publicsuffix" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" -dependencies = [ - "idna", - "psl-types", -] - -[[package]] -name = "pxfm" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quick-xml" -version = "0.38.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "quinn" version = "0.11.11" @@ -4531,14 +1470,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" dependencies = [ "bytes", - "cfg_aliases 0.2.2", + "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", "rustls", "socket2 0.6.5", - "thiserror 2.0.20", + "thiserror", "tokio", "tracing", "web-time", @@ -4561,7 +1500,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.20", + "thiserror", "tinyvec", "tracing", "web-time", @@ -4573,7 +1512,7 @@ version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" dependencies = [ - "cfg_aliases 0.2.2", + "cfg_aliases", "libc", "once_cell", "socket2 0.6.5", @@ -4602,354 +1541,13 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type 0.1.2", - "nibble_vec", -] - -[[package]] -name = "radix_trie" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b4431027dcd37fc2a73ef740b5f233aa805897935b8bce0195e41bbf9a3289a" -dependencies = [ - "endian-type 0.2.0", - "nibble_vec", -] - -[[package]] -name = "rama-core" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b93751ab27c9d151e84c1100057eab3f2a6a1378bc31b62abd416ecb1847658" -dependencies = [ - "ahash", - "asynk-strim", - "bytes", - "futures", - "parking_lot", - "pin-project-lite", - "rama-error", - "rama-macros", - "rama-utils", - "serde", - "serde_json", - "tokio", - "tokio-graceful", - "tokio-util", - "tracing", -] - -[[package]] -name = "rama-dns" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e340fef2799277e204260b17af01bc23604712092eacd6defe40167f304baed8" -dependencies = [ - "ahash", - "hickory-resolver", - "rama-core", - "rama-net", - "rama-utils", - "serde", - "tokio", -] - -[[package]] -name = "rama-error" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452aba1beb7e29b873ff32f304536164cffcc596e786921aea64e858ff8f40" - -[[package]] -name = "rama-http" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453d60af031e23af2d48995e41b17023f6150044738680508b63671f8d7417dd" -dependencies = [ - "ahash", - "base64", - "bitflags 2.13.1", - "chrono", - "const_format", - "csv", - "http", - "http-range-header", - "httpdate", - "iri-string", - "matchit", - "parking_lot", - "percent-encoding", - "pin-project-lite", - "radix_trie 0.3.0", - "rama-core", - "rama-error", - "rama-http-headers", - "rama-http-types", - "rama-net", - "rama-utils", - "rand 0.9.5", - "serde", - "serde_html_form", - "serde_json", - "tokio", - "uuid", -] - -[[package]] -name = "rama-http-backend" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ff6a3c8ae690be8167e43777ba0bf6b0c8c2f6de165c538666affe2a32fd81" -dependencies = [ - "h2", - "pin-project-lite", - "rama-core", - "rama-http", - "rama-http-core", - "rama-http-headers", - "rama-http-types", - "rama-net", - "rama-tcp", - "rama-unix", - "rama-utils", - "tokio", -] - -[[package]] -name = "rama-http-core" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3822be6703e010afec0bcfeb5dbb6e5a3b23ca5689d9b1215b66ce6446653b77" -dependencies = [ - "ahash", - "atomic-waker", - "futures-channel", - "httparse", - "httpdate", - "indexmap 2.14.0", - "itoa", - "parking_lot", - "pin-project-lite", - "rama-core", - "rama-http", - "rama-http-types", - "rama-utils", - "slab", - "tokio", - "tokio-test", - "want", -] - -[[package]] -name = "rama-http-headers" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d74fe0cd9bd4440827dc6dc0f504cf66065396532e798891dee2c1b740b2285" -dependencies = [ - "ahash", - "base64", - "chrono", - "const_format", - "httpdate", - "rama-core", - "rama-error", - "rama-http-types", - "rama-macros", - "rama-net", - "rama-utils", - "rand 0.9.5", - "serde", - "sha1", -] - -[[package]] -name = "rama-http-types" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6dae655a72da5f2b97cfacb67960d8b28c5025e62707b4c8c5f0c5c9843a444" -dependencies = [ - "ahash", - "bytes", - "const_format", - "fnv", - "http", - "http-body", - "http-body-util", - "itoa", - "memchr", - "mime", - "mime_guess", - "nom 8.0.0", - "pin-project-lite", - "rama-core", - "rama-error", - "rama-macros", - "rama-utils", - "rand 0.9.5", - "serde", - "serde_json", - "sync_wrapper", - "tokio", -] - -[[package]] -name = "rama-macros" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea18a110bcf21e35c5f194168e6914ccea45ffdd0fea51bc4b169fbeafef6428" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "rama-net" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28ee9e1e5d39264414b71f5c33e7fbb66b382c3fac456fe0daad39cf5509933" -dependencies = [ - "ahash", - "const_format", - "flume", - "hex", - "ipnet", - "itertools 0.14.0", - "md5", - "nom 8.0.0", - "parking_lot", - "pin-project-lite", - "psl", - "radix_trie 0.3.0", - "rama-core", - "rama-http-types", - "rama-macros", - "rama-utils", - "serde", - "sha2", - "socket2 0.6.5", - "tokio", -] - -[[package]] -name = "rama-socks5" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5468b263516daaf258de32542c1974b7cbe962363ad913dcb669f5d46db0ef3e" -dependencies = [ - "byteorder", - "rama-core", - "rama-net", - "rama-tcp", - "rama-udp", - "rama-utils", - "tokio", -] - -[[package]] -name = "rama-tcp" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe60cd604f91196b3659a1b28945add2e8b10bd0b4e6373c93d024fb3197704b" -dependencies = [ - "pin-project-lite", - "rama-core", - "rama-dns", - "rama-http-types", - "rama-net", - "rama-utils", - "rand 0.9.5", - "tokio", -] - -[[package]] -name = "rama-tls-rustls" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536d47f6b269fb20dffd45e4c04aa8b340698b3509326e3c36e444b4f33ce0d6" -dependencies = [ - "pin-project-lite", - "rama-core", - "rama-http-types", - "rama-net", - "rama-utils", - "rcgen", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "webpki-roots", - "x509-parser", -] - -[[package]] -name = "rama-udp" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ed05e0ecac73e084e92a3a8b1fbf16fdae8958c506f0f0eada180a2d99eef4" -dependencies = [ - "rama-core", - "rama-net", - "tokio", - "tokio-util", -] - -[[package]] -name = "rama-unix" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91acb16d571428ba4cece072dfab90d2667cdfa910a7b3cb4530c3f31542d708" -dependencies = [ - "pin-project-lite", - "rama-core", - "rama-net", - "tokio", -] - -[[package]] -name = "rama-utils" -version = "0.3.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf28b18ba4a57f8334d7992d3f8020194ea359b246ae6f8f98b8df524c7a14ef" -dependencies = [ - "const_format", - "parking_lot", - "pin-project-lite", - "rama-macros", - "regex", - "serde", - "smallvec", - "smol_str", - "tokio", - "wildcard", -] - -[[package]] -name = "rand" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ - "rand_chacha 0.9.0", + "rand_chacha", "rand_core 0.9.5", ] @@ -4964,16 +1562,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - [[package]] name = "rand_chacha" version = "0.9.0" @@ -5017,29 +1605,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "rand_xorshift" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" -dependencies = [ - "rand_core 0.9.5", -] - -[[package]] -name = "rcgen" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57f6d249aad744e274e682777a50283a225a32705394ee6d5fcc01efa25e4055" -dependencies = [ - "aws-lc-rs", - "pem", - "rustls-pki-types", - "time", - "x509-parser", - "yasna", -] - [[package]] name = "redb" version = "4.1.0" @@ -5049,69 +1614,6 @@ dependencies = [ "libc", ] -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.13.1", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 1.0.69", -] - -[[package]] -name = "redox_users" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 2.0.20", -] - -[[package]] -name = "ref-cast" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216e8f773d7923bcba9ceb86a86c93cabb3903a11872fc3f138c49630e50b96d" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9283685feec7d69af75fb0e858d5e7378f33fe4fc699383b2916ab9273e03c" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.3", -] - -[[package]] -name = "regex" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax 0.8.11", -] - [[package]] name = "regex-automata" version = "0.4.18" @@ -5120,85 +1622,22 @@ checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.11", + "regex-syntax", ] -[[package]] -name = "regex-lite" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" -[[package]] -name = "reqwest" -version = "0.12.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" -dependencies = [ - "base64", - "bytes", - "cookie", - "cookie_store", - "encoding_rs", - "futures-channel", - "futures-core", - "futures-util", - "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", - "quinn", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tokio-util", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams 0.4.2", - "web-sys", - "webpki-roots", -] - [[package]] name = "reqwest" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-core", "futures-util", @@ -5228,16 +1667,10 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams 0.5.0", + "wasm-streams", "web-sys", ] -[[package]] -name = "resolv-conf" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" - [[package]] name = "ring" version = "0.17.14" @@ -5248,32 +1681,10 @@ dependencies = [ "cfg-if", "getrandom 0.2.17", "libc", - "untrusted 0.9.0", + "untrusted", "windows-sys 0.52.0", ] -[[package]] -name = "rmcp" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bef41ebc9ebed2c1b1d90203e9d1756091e8a00bbc3107676151f39868ca0ee" -dependencies = [ - "async-trait", - "base64", - "chrono", - "futures", - "pastey", - "pin-project-lite", - "rmcp-macros", - "schemars 1.2.2", - "serde", - "serde_json", - "thiserror 2.0.20", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "rmcp" version = "2.2.0" @@ -5286,30 +1697,17 @@ dependencies = [ "http", "pin-project-lite", "process-wrap", - "reqwest 0.13.4", + "reqwest", "serde", "serde_json", "sse-stream", - "thiserror 2.0.20", + "thiserror", "tokio", "tokio-stream", "tokio-util", "tracing", ] -[[package]] -name = "rmcp-macros" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e88ad84b8b6237a934534a62b379a5be6388915663c0cc598ceb9b3292bbbfe" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.119", -] - [[package]] name = "rmp" version = "0.8.15" @@ -5355,22 +1753,13 @@ dependencies = [ "semver", ] -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom 7.1.3", -] - [[package]] name = "rustix" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.13.1", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -5402,7 +1791,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.7.0", + "security-framework", ] [[package]] @@ -5421,7 +1810,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" dependencies = [ - "core-foundation 0.10.1", + "core-foundation", "core-foundation-sys", "jni", "log", @@ -5430,7 +1819,7 @@ dependencies = [ "rustls-native-certs", "rustls-platform-verifier-android", "rustls-webpki", - "security-framework 3.7.0", + "security-framework", "security-framework-sys", "webpki-root-certs", "windows-sys 0.61.2", @@ -5451,7 +1840,7 @@ dependencies = [ "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -5460,43 +1849,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" -[[package]] -name = "rustyline" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e8936da37efd9b6d4478277f4b2b9bb5cdb37a113e8d63222e58da647e63" -dependencies = [ - "bitflags 2.13.1", - "cfg-if", - "clipboard-win", - "fd-lock", - "home", - "libc", - "log", - "memchr", - "nix 0.28.0", - "radix_trie 0.2.1", - "unicode-segmentation", - "unicode-width", - "utf8parse", - "windows-sys 0.52.0", -] - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher", -] - [[package]] name = "same-file" version = "1.0.6" @@ -5515,48 +1867,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "schemafy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aea5ba40287dae331f2c48b64dbc8138541f5e97ee8793caa7948c1f31d86d5" -dependencies = [ - "Inflector", - "schemafy_core", - "schemafy_lib", - "serde", - "serde_derive", - "serde_json", - "serde_repr", - "syn 1.0.109", -] - -[[package]] -name = "schemafy_core" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41781ae092f4fd52c9287efb74456aea0d3b90032d2ecad272bd14dbbcb0511b" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "schemafy_lib" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e953db32579999ca98c451d80801b6f6a7ecba6127196c5387ec0774c528befa" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "schemafy_core", - "serde", - "serde_derive", - "serde_json", - "syn 1.0.109", -] - [[package]] name = "schemars" version = "0.8.22" @@ -5564,33 +1874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" dependencies = [ "dyn-clone", - "schemars_derive 0.8.22", - "serde", - "serde_json", -] - -[[package]] -name = "schemars" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" -dependencies = [ - "chrono", - "dyn-clone", - "ref-cast", - "schemars_derive 1.2.2", + "schemars_derive", "serde", "serde_json", ] @@ -5603,83 +1887,18 @@ checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" dependencies = [ "proc-macro2", "quote", - "serde_derive_internals 0.29.1", + "serde_derive_internals", "syn 2.0.119", ] -[[package]] -name = "schemars_derive" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98c67716b46af2f0b8cf752abc930f6f9aecfbf671ecfb531db8a31dbe4e2ba" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals 0.30.0", - "syn 3.0.3", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "seccompiler" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4ae55de56877481d112a559bbc12667635fdaf5e005712fd4e2b2fa50ffc884" -dependencies = [ - "libc", -] - -[[package]] -name = "secret-service" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4d35ad99a181be0a60ffcbe85d680d98f87bdc4d7644ade319b87076b9dbfd4" -dependencies = [ - "aes", - "cbc", - "futures-util", - "generic-array", - "hkdf", - "num", - "once_cell", - "rand 0.8.7", - "serde", - "sha2", - "zbus", -] - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.13.1", - "core-foundation 0.9.4", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - [[package]] name = "security-framework" version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.13.1", - "core-foundation 0.10.1", + "bitflags", + "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", @@ -5756,37 +1975,12 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "serde_derive_internals" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.3", -] - -[[package]] -name = "serde_html_form" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acf96b1d9364968fce46ebb548f1c0e1d7eceae27bdff73865d42e6c7369d94" -dependencies = [ - "form_urlencoded", - "indexmap 2.14.0", - "itoa", - "ryu", - "serde_core", -] - [[package]] name = "serde_json" version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ - "indexmap 2.14.0", "itoa", "memchr", "serde", @@ -5794,28 +1988,6 @@ dependencies = [ "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_repr" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.3", -] - [[package]] name = "serde_spanned" version = "1.1.1" @@ -5825,61 +1997,6 @@ dependencies = [ "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 = "serde_with" -version = "3.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" -dependencies = [ - "base64", - "bs58", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.14.0", - "schemars 0.9.0", - "schemars 1.2.2", - "serde_core", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "sha1" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest", -] - [[package]] name = "sha1_smol" version = "1.0.1" @@ -5897,21 +2014,6 @@ dependencies = [ "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 = "shlex" version = "2.0.1" @@ -5937,12 +2039,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "simd-adler32" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" - [[package]] name = "simd_cesu8" version = "1.2.0" @@ -5959,12 +2055,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" -[[package]] -name = "siphasher" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" - [[package]] name = "slab" version = "0.4.12" @@ -5976,19 +2066,6 @@ name = "smallvec" version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" -dependencies = [ - "serde", -] - -[[package]] -name = "smol_str" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aaa7368fcf4852a4c2dd92df0cace6a71f2091ca0a23391ce7f3a31833f1523" -dependencies = [ - "borsh", - "serde_core", -] [[package]] name = "socket2" @@ -6010,15 +2087,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "spin" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.7.3" @@ -6048,167 +2116,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" -[[package]] -name = "starlark" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f53849859f05d9db705b221bd92eede93877fd426c1b4a3c3061403a5912a8f" -dependencies = [ - "allocative", - "anyhow", - "bumpalo", - "cmp_any", - "debugserver-types", - "derivative", - "derive_more", - "display_container", - "dupe", - "either", - "erased-serde", - "hashbrown 0.14.5", - "inventory", - "itertools 0.13.0", - "maplit", - "memoffset 0.6.5", - "num-bigint", - "num-traits", - "once_cell", - "paste", - "ref-cast", - "regex", - "rustyline", - "serde", - "serde_json", - "starlark_derive", - "starlark_map", - "starlark_syntax", - "static_assertions", - "strsim 0.10.0", - "textwrap", - "thiserror 1.0.69", -] - -[[package]] -name = "starlark_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe58bc6c8b7980a1fe4c9f8f48200c3212db42ebfe21ae6a0336385ab53f082a" -dependencies = [ - "dupe", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "starlark_map" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92659970f120df0cc1c0bb220b33587b7a9a90e80d4eecc5c5af5debb950173d" -dependencies = [ - "allocative", - "dupe", - "equivalent", - "fxhash", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "starlark_syntax" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe53b3690d776aafd7cb6b9fed62d94f83280e3b87d88e3719cc0024638461b3" -dependencies = [ - "allocative", - "annotate-snippets", - "anyhow", - "derivative", - "derive_more", - "dupe", - "lalrpop", - "lalrpop-util", - "logos", - "lsp-types", - "memchr", - "num-bigint", - "num-traits", - "once_cell", - "starlark_map", - "thiserror 1.0.69", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "streaming-iterator" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" - -[[package]] -name = "string_cache" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared", - "precomputed-hash", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" - -[[package]] -name = "strum_macros" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.119" @@ -6251,42 +2164,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "sys-locale" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" -dependencies = [ - "libc", -] - -[[package]] -name = "system-configuration" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" -dependencies = [ - "bitflags 2.13.1", - "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 = "tagptr" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" - [[package]] name = "tempfile" version = "3.27.0" @@ -6300,17 +2177,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -6320,42 +2186,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" dependencies = [ - "thiserror-impl 2.0.20", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", + "thiserror-impl", ] [[package]] @@ -6369,66 +2206,6 @@ dependencies = [ "syn 3.0.3", ] -[[package]] -name = "thread_local" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "time" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" - -[[package]] -name = "time-macros" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tiny_http" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82" -dependencies = [ - "ascii", - "chunked_transfer", - "httpdate", - "log", -] - [[package]] name = "tinystr" version = "0.8.3" @@ -6436,7 +2213,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", - "serde_core", "zerovec", ] @@ -6464,7 +2240,6 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2 0.6.5", @@ -6472,19 +2247,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "tokio-graceful" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45740b38b48641855471cd402922e89156bdfbd97b69b45eeff170369cc18c7d" -dependencies = [ - "loom", - "pin-project-lite", - "slab", - "tokio", - "tracing", -] - [[package]] name = "tokio-macros" version = "2.7.2" @@ -6496,16 +2258,6 @@ dependencies = [ "syn 3.0.3", ] -[[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" @@ -6527,32 +2279,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-test" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6d24790a10a7af737693a3e8f1d03faef7e6ca0cc99aae5066f533766de545" -dependencies = [ - "futures-core", - "tokio", - "tokio-stream", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.28.0" -source = "git+https://github.com/openai-oss-forks/tokio-tungstenite?rev=132f5b39c862e3a970f731d709608b3e6276d5f6#132f5b39c862e3a970f731d709608b3e6276d5f6" -dependencies = [ - "futures-util", - "log", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tungstenite", -] - [[package]] name = "tokio-util" version = "0.7.19" @@ -6573,10 +2299,10 @@ version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ - "indexmap 2.14.0", + "indexmap", "serde_core", "serde_spanned", - "toml_datetime 0.7.5+spec-1.1.0", + "toml_datetime", "toml_parser", "toml_writer", "winnow 0.7.15", @@ -6591,40 +2317,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_datetime" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_edit" -version = "0.24.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f2eadbbc6b377a847be05f60791ef1058d9f696ecb51d2c07fe911d8569d8e" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 0.7.5+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 0.7.15", -] - -[[package]] -name = "toml_edit" -version = "0.25.13+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "winnow 1.0.4", -] - [[package]] name = "toml_parser" version = "1.1.3+spec-1.1.0" @@ -6640,45 +2332,6 @@ version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" -[[package]] -name = "tonic" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" -dependencies = [ - "async-trait", - "base64", - "bytes", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-timeout", - "hyper-util", - "percent-encoding", - "pin-project", - "rustls-native-certs", - "sync_wrapper", - "tokio", - "tokio-rustls", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tonic-prost" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" -dependencies = [ - "bytes", - "prost", - "tonic", -] - [[package]] name = "tower" version = "0.5.3" @@ -6687,15 +2340,11 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", - "indexmap 2.14.0", "pin-project-lite", - "slab", "sync_wrapper", "tokio", - "tokio-util", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -6704,7 +2353,7 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ - "bitflags 2.13.1", + "bitflags", "bytes", "futures-util", "http", @@ -6734,7 +2383,6 @@ 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", @@ -6758,84 +2406,8 @@ 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-opentelemetry" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac28f2d093c6c477eaa76b23525478f38de514fa9aeb1285738d4b97a9552fc" -dependencies = [ - "js-sys", - "opentelemetry", - "smallvec", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", - "web-time", -] - -[[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 = "tree-sitter" -version = "0.25.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87" -dependencies = [ - "cc", - "regex", - "regex-syntax 0.8.11", - "serde_json", - "streaming-iterator", - "tree-sitter-language", -] - -[[package]] -name = "tree-sitter-bash" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5ec769279cc91b561d3df0d8a5deb26b0ad40d183127f409494d6d8fc53062" -dependencies = [ - "cc", - "tree-sitter-language", -] - -[[package]] -name = "tree-sitter-language" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009994f150cc0cd50ff54917d5bc8bffe8cad10ca10d81c34da2ec421ae61782" - [[package]] name = "try-lock" version = "0.2.5" @@ -6849,7 +2421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4994acea2522cd2b3b85c1d9529a55991e3ad5e25cdcd3de9d505972c4379424" dependencies = [ "serde_json", - "thiserror 2.0.20", + "thiserror", "ts-rs-macros", "uuid", ] @@ -6866,79 +2438,18 @@ dependencies = [ "termcolor", ] -[[package]] -name = "tungstenite" -version = "0.27.0" -source = "git+https://github.com/openai-oss-forks/tungstenite-rs?rev=9200079d3b54a1ff51072e24d81fd354f085156f#9200079d3b54a1ff51072e24d81fd354f085156f" -dependencies = [ - "bytes", - "data-encoding", - "flate2", - "headers", - "http", - "httparse", - "log", - "rand 0.9.5", - "rustls", - "rustls-pki-types", - "sha1", - "thiserror 2.0.20", - "utf-8", -] - [[package]] name = "typenum" version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" -[[package]] -name = "uds_windows" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" -dependencies = [ - "memoffset 0.9.1", - "tempfile", - "windows-sys 0.61.2", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[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-segmentation" -version = "1.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "universal-hash" version = "0.5.1" @@ -6949,18 +2460,40 @@ dependencies = [ "subtle", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "ureq" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972d7902c8735f2695410b8aed7df6ed12a47394aa1c8d7af49f0497b731a94d" +dependencies = [ + "base64 0.23.1", + "log", + "percent-encoding", + "rustls", + "rustls-pki-types", + "ureq-proto", + "utf8-zero", + "webpki-roots", +] + +[[package]] +name = "ureq-proto" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5f78b09e6941e1a0f2e30e695e4b120377b54d5e0aec11b594bb57b3971613" +dependencies = [ + "base64 0.23.1", + "http", + "httparse", + "log", +] + [[package]] name = "url" version = "2.5.8" @@ -6971,20 +2504,13 @@ dependencies = [ "idna", "percent-encoding", "serde", - "serde_derive", ] [[package]] -name = "urlencoding" -version = "2.1.3" +name = "utf8-zero" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" [[package]] name = "utf8_iter" @@ -6992,12 +2518,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "uuid" version = "1.24.0" @@ -7011,18 +2531,6 @@ dependencies = [ "wasm-bindgen", ] -[[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" @@ -7118,19 +2626,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wasm-streams" version = "0.5.0" @@ -7164,22 +2659,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webbrowser" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62c35be770821a214dbc362fc26908c853e776c0004294d0b10b8a6bad582f94" -dependencies = [ - "jni", - "log", - "ndk-context", - "objc2", - "objc2-app-kit", - "objc2-foundation", - "url", - "web-sys", -] - [[package]] name = "webpki-root-certs" version = "1.0.9" @@ -7198,42 +2677,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "weezl" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" - -[[package]] -name = "which" -version = "8.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3ef584124b911bcc3875c2f1472e80f24361ceb789bd1c62b3e9a3df9ff43c" -dependencies = [ - "libc", -] - -[[package]] -name = "widestring" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" - -[[package]] -name = "wildcard" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b0540e91e49de3817c314da0dd3bc518093ceacc6ea5327cb0e1eb073e5189" -dependencies = [ - "thiserror 2.0.20", -] - -[[package]] -name = "wildmatch" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29333c3ea1ba8b17211763463ff24ee84e41c78224c16b001cd907e663a38c68" - [[package]] name = "winapi" version = "0.3.9" @@ -7348,17 +2791,6 @@ dependencies = [ "windows-link", ] -[[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" @@ -7383,7 +2815,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -7392,16 +2824,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", + "windows-targets", ] [[package]] @@ -7419,31 +2842,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", + "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]] @@ -7461,113 +2867,59 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[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_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[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_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[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_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[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_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "winnow" version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" -dependencies = [ - "memchr", -] [[package]] name = "winnow" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" -dependencies = [ - "memchr", -] [[package]] name = "wit-bindgen" @@ -7581,51 +2933,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" -[[package]] -name = "x509-parser" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43b0f71ce057da06bc0851b23ee24f3f86190b07203dd8f567d0b706a185202" -dependencies = [ - "asn1-rs", - "aws-lc-rs", - "data-encoding", - "der-parser", - "lazy_static", - "nom 7.1.3", - "oid-registry", - "ring", - "rusticata-macros", - "thiserror 2.0.20", - "time", -] - -[[package]] -name = "xdg-home" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "yansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -[[package]] -name = "yasna" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f6765e852b9b4dc8e2a76843e4d64d1cea8e79bcde0b6901aea8e7c7f08282" -dependencies = [ - "bit-vec 0.9.1", - "time", -] - [[package]] name = "yoke" version = "0.8.3" @@ -7649,68 +2962,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zbus" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" -dependencies = [ - "async-broadcast", - "async-executor", - "async-fs", - "async-io", - "async-lock", - "async-process", - "async-recursion", - "async-task", - "async-trait", - "blocking", - "enumflags2", - "event-listener", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "nix 0.29.0", - "ordered-stream", - "rand 0.8.7", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "tracing", - "uds_windows", - "windows-sys 0.52.0", - "xdg-home", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.119", - "zvariant_utils", -] - -[[package]] -name = "zbus_names" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] - [[package]] name = "zerocopy" version = "0.8.56" @@ -7757,20 +3008,6 @@ name = "zeroize" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] [[package]] name = "zerotrie" @@ -7781,7 +3018,6 @@ dependencies = [ "displaydoc", "yoke", "zerofrom", - "zerovec", ] [[package]] @@ -7790,7 +3026,6 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ - "serde", "yoke", "zerofrom", "zerovec-derive", @@ -7813,82 +3048,17 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" -[[package]] -name = "zstd" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" -dependencies = [ - "zstd-safe", -] +[[patch.unused]] +name = "tungstenite" +version = "0.27.0" +source = "git+https://github.com/openai-oss-forks/tungstenite-rs?rev=9200079d3b54a1ff51072e24d81fd354f085156f#9200079d3b54a1ff51072e24d81fd354f085156f" -[[package]] -name = "zstd-safe" -version = "7.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" -dependencies = [ - "zstd-sys", -] +[[patch.unused]] +name = "tokio-tungstenite" +version = "0.28.0" +source = "git+https://github.com/openai-oss-forks/tokio-tungstenite?rev=132f5b39c862e3a970f731d709608b3e6276d5f6#132f5b39c862e3a970f731d709608b3e6276d5f6" -[[package]] -name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" -dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "zune-core" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b" - -[[package]] -name = "zune-jpeg" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" -dependencies = [ - "zune-core", -] - -[[package]] -name = "zvariant" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" -dependencies = [ - "endi", - "enumflags2", - "serde", - "static_assertions", - "zvariant_derive", -] - -[[package]] -name = "zvariant_derive" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.119", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] +[[patch.unused]] +name = "tungstenite" +version = "0.27.0" +source = "git+https://github.com/openai-oss-forks/tungstenite-rs?rev=9200079d3b54a1ff51072e24d81fd354f085156f#9200079d3b54a1ff51072e24d81fd354f085156f" diff --git a/Cargo.toml b/Cargo.toml index 65f6d0a5..6618cf68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ members = [ "epiphany-core", "epiphany-model-adapter", "epiphany-openai-adapter", - "epiphany-openai-codex-spine", "epiphany-openai-runtime", "epiphany-release-construction", "epiphany-state-model", @@ -30,8 +29,8 @@ cultnet-rs = { path = "vendor/cultnet-rs" } epiphany-core = { path = "epiphany-core" } epiphany-model-adapter = { path = "epiphany-model-adapter" } epiphany-openai-adapter = { path = "epiphany-openai-adapter" } -epiphany-openai-codex-spine = { path = "epiphany-openai-codex-spine", optional = true } epiphany-openai-runtime = { path = "epiphany-openai-runtime", optional = true } +codex-connector = { git = "https://github.com/GameCult/CodexConnector", rev = "54d8bc2525b7e7fa1b9dd26b95871247ff4c7566", default-features = false, optional = true } epiphany-tool-adapter = { path = "epiphany-tool-adapter" } epiphany-tool-mcp-runtime = { path = "epiphany-tool-mcp-runtime", optional = true } rmp-serde = "1" @@ -40,10 +39,12 @@ serde_json = "1" sha2 = "0.10" tokio = { version = "1", features = ["io-util", "macros", "process", "rt", "rt-multi-thread", "time"] } toml = "0.9" +ureq = { version = "3.4", default-features = false, features = ["rustls"], optional = true } uuid = { version = "1", features = ["serde", "v4"] } +zeroize = { version = "1", optional = true } [features] -openai-runtime = ["dep:epiphany-openai-codex-spine", "dep:epiphany-openai-runtime"] +openai-runtime = ["dep:codex-connector", "dep:epiphany-openai-runtime", "dep:ureq", "dep:zeroize"] tool-mcp-runtime = ["dep:epiphany-tool-mcp-runtime"] release-runtime = ["openai-runtime", "tool-mcp-runtime"] diff --git a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs index d3cdb61f..9df3f9c2 100644 --- a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs +++ b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs @@ -11,6 +11,7 @@ use epiphany_core::HANDS_PATCH_RECEIPT_TYPE; use epiphany_core::HandsActionIntent; use epiphany_core::RepoFrontierHandsAuthority; use epiphany_core::RuntimeSpineInitOptions; +use epiphany_core::coordinator_status as status_projection; use epiphany_core::finalize_coordinator_run; use epiphany_core::hands_action_review_for_intent; use epiphany_core::initialize_runtime_spine; @@ -25,13 +26,13 @@ use epiphany_core::substrate_gate_coordinator_implementation_grant; use epiphany_core::{ LaunchedCoordinator, capture_process_instance, claim_resident_self_preparation_as_child, }; -use epiphany_core::coordinator_status as status_projection; use serde_json::Value; use serde_json::json; use sha2::{Digest, Sha256}; use std::collections::BTreeMap; use std::env; use std::fs; +use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::thread; @@ -69,7 +70,7 @@ struct Args { thread_id: Option, objective: Option, cwd: PathBuf, - codex_home: PathBuf, + model_connector_endpoint: SocketAddr, mcp_config: PathBuf, artifact_dir: PathBuf, runtime_store: PathBuf, @@ -106,9 +107,7 @@ impl Args { thread_id: None, objective: None, cwd: root.clone(), - codex_home: env::var_os("CODEX_HOME") - .map(PathBuf::from) - .unwrap_or_else(|| home_dir().join(".codex")), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: root.join(".epiphany").join("mcp.toml"), artifact_dir: root.join(".epiphany-dogfood").join("coordinator"), runtime_store: root.join("state").join("runtime-spine.msgpack"), @@ -197,7 +196,10 @@ impl Args { parsed.required_action = Some(take_string(&mut args, "--required-action")?) } "--cwd" => parsed.cwd = take_path(&mut args, "--cwd")?, - "--codex-home" => parsed.codex_home = take_path(&mut args, "--codex-home")?, + "--connector-endpoint" => { + parsed.model_connector_endpoint = + take_string(&mut args, "--connector-endpoint")?.parse()? + } "--mcp-config" => parsed.mcp_config = take_path(&mut args, "--mcp-config")?, "--artifact-dir" => parsed.artifact_dir = take_path(&mut args, "--artifact-dir")?, "--runtime-store" => { @@ -283,12 +285,10 @@ fn run_coordinator(args: &Args) -> Result { let cwd = status_projection::absolute_path(&args.cwd)?; let model_runtime_bin = resolve_model_runtime_bin(&root, &args.model_runtime_bin)?; let tool_adapter_bin = resolve_model_runtime_bin(&root, &args.tool_adapter_bin)?; - let codex_home = status_projection::absolute_path(&args.codex_home)?; let mcp_config = status_projection::absolute_path(&args.mcp_config)?; let artifact_dir = status_projection::absolute_path(&args.artifact_dir)?; let runtime_store = status_projection::absolute_path(&args.runtime_store)?; reset_artifact_dir(&artifact_dir)?; - fs::create_dir_all(&codex_home)?; let telemetry_path = artifact_dir.join("agent-function-telemetry.json"); let steps_path = artifact_dir.join("coordinator-steps.jsonl"); @@ -408,7 +408,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -450,7 +450,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -504,7 +504,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -549,7 +549,9 @@ fn run_coordinator(args: &Args) -> Result { let snapshot_name = format!("step-{index:02}-{action}.txt"); fs::write( artifact_dir.join(&snapshot_name), - status_projection::render_status(&status_projection::sanitize_for_operator(status.clone())), + status_projection::render_status(&status_projection::sanitize_for_operator( + status.clone(), + )), )?; snapshots.push(snapshot_name); let mut step = json!({ @@ -656,7 +658,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -706,7 +708,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -1027,7 +1029,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -1070,7 +1072,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -1186,7 +1188,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -1256,7 +1258,7 @@ fn run_coordinator(args: &Args) -> Result { &args.model, args.provider_credential_path.as_deref(), &runtime_store, - &codex_home, + args.model_connector_endpoint, &mcp_config, &cwd, args.resident_state_store.as_deref(), @@ -1344,7 +1346,7 @@ fn run_coordinator(args: &Args) -> Result { "modelRuntimeBin": model_runtime_bin, "toolAdapterBin": tool_adapter_bin, "modelProvider": args.model_provider, - "codexHome": codex_home, + "modelConnectorEndpoint": args.model_connector_endpoint, "mcpConfig": mcp_config, "runtimeStore": runtime_store, "workspace": cwd, @@ -1738,7 +1740,7 @@ fn launch_worker_runtime_detached( model: &str, provider_credential_path: Option<&Path>, runtime_store: &Path, - codex_home: &Path, + model_connector_endpoint: SocketAddr, mcp_config: &Path, cwd: &Path, resident_store: Option<&Path>, @@ -1767,8 +1769,8 @@ fn launch_worker_runtime_detached( .arg(model) .arg("--store") .arg(runtime_store) - .arg("--codex-home") - .arg(codex_home) + .arg("--connector-endpoint") + .arg(model_connector_endpoint.to_string()) .arg("--mcp-config") .arg(mcp_config) .arg("--job-id") @@ -2053,7 +2055,10 @@ fn append_jsonl(path: &Path, value: &Value) -> Result<()> { } fn append_operator_step_jsonl(path: &Path, step: &Value) -> Result<()> { - append_jsonl(path, &status_projection::sanitize_for_operator(step.clone())) + append_jsonl( + path, + &status_projection::sanitize_for_operator(step.clone()), + ) } fn take_string(args: &mut impl Iterator, name: &str) -> Result { @@ -2065,13 +2070,6 @@ fn take_path(args: &mut impl Iterator, name: &str) -> Result PathBuf { - env::var_os("USERPROFILE") - .or_else(|| env::var_os("HOME")) - .map(PathBuf::from) - .unwrap_or_else(|| PathBuf::from(".")) -} - #[cfg(test)] mod tests { use super::*; @@ -2111,7 +2109,7 @@ mod tests { thread_id: Some("error-terminalization".to_string()), objective: Some("Exercise the coordinator error boundary.".to_string()), cwd: cwd.clone(), - codex_home: temp.path().join("codex-home"), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: cwd.join(".epiphany/mcp.toml"), artifact_dir: cwd.join(".epiphany-smoke/error-terminalization"), runtime_store: runtime_store.clone(), diff --git a/epiphany-core/src/bin/epiphany-swarm.rs b/epiphany-core/src/bin/epiphany-swarm.rs index d8cbaa6e..c4fa36be 100644 --- a/epiphany-core/src/bin/epiphany-swarm.rs +++ b/epiphany-core/src/bin/epiphany-swarm.rs @@ -495,7 +495,11 @@ impl Args { runtime_store: path("--runtime-store")?, local_verse_store: path("--local-verse-store")?, artifact_root: path("--artifact-root")?, - codex_home: path("--codex-home")?, + model_connector_endpoint: value + .get("--connector-endpoint") + .ok_or_else(|| anyhow!("missing --connector-endpoint"))? + .parse() + .context("invalid --connector-endpoint")?, mcp_config: path("--mcp-config")?, model_provider: value .get("--model-provider") @@ -776,7 +780,7 @@ mod brake_tests { runtime_store, local_verse_store: verse_store, artifact_root: shared.join("artifacts"), - codex_home: shared.join("codex-home"), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: shared.join("mcp.toml"), model_provider: "test".into(), model: "test-model".into(), diff --git a/epiphany-core/src/current_work.rs b/epiphany-core/src/current_work.rs index ee4f9c46..3b26c232 100644 --- a/epiphany-core/src/current_work.rs +++ b/epiphany-core/src/current_work.rs @@ -3664,7 +3664,7 @@ mod tests { runtime_store: store.clone(), local_verse_store: temp.path().join("local-verse.cc"), artifact_root: temp.path().join("artifacts"), - codex_home: temp.path().join("codex-home"), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: temp.path().join("mcp.toml"), model_provider: "openrouter".into(), model: "stealth/ox-alpha".into(), diff --git a/epiphany-core/src/resident_readiness.rs b/epiphany-core/src/resident_readiness.rs index 564745b5..f8b74293 100644 --- a/epiphany-core/src/resident_readiness.rs +++ b/epiphany-core/src/resident_readiness.rs @@ -728,20 +728,12 @@ fn directory_ready(path: &Path) -> bool { fs::metadata(path).is_ok_and(|value| value.is_dir() && !value.permissions().readonly()) } -fn codex_credentials_ready(codex_home: &Path) -> bool { - directory_ready(codex_home) && credential_file_ready(&codex_home.join("auth.json")) -} - fn model_provider_credential_ready(policy: &ResidentSelfPolicy) -> bool { match policy.model_provider.as_str() { - "openai-codex" | "openai" => codex_credentials_ready(&policy.codex_home), - "openrouter" => policy + "openai-codex" | "openai" | "openrouter" => policy .provider_credential_path .as_deref() - .is_some_and(|path| { - fs::metadata(path).is_ok_and(|metadata| metadata.is_file()) - && fs::File::open(path).is_ok() - }), + .is_some_and(credential_file_ready), _ => false, } } @@ -972,30 +964,6 @@ mod tests { Ok(()) } - #[cfg(unix)] - #[test] - fn unix_credentials_reject_group_or_other_access() -> Result<()> { - use std::os::unix::fs::PermissionsExt; - let temp = tempfile::tempdir()?; - let auth = temp.path().join("auth.json"); - fs::write(&auth, b"{}")?; - fs::set_permissions(&auth, fs::Permissions::from_mode(0o400))?; - assert!(!codex_credentials_ready(temp.path())); - fs::set_permissions(&auth, fs::Permissions::from_mode(0o644))?; - assert!(!codex_credentials_ready(temp.path())); - fs::set_permissions(&auth, fs::Permissions::from_mode(0o600))?; - assert!(codex_credentials_ready(temp.path())); - Ok(()) - } - - #[test] - fn legacy_credentials_file_cannot_impersonate_canonical_auth() -> Result<()> { - let temp = tempfile::tempdir()?; - fs::write(temp.path().join("credentials.json"), b"{}")?; - assert!(!codex_credentials_ready(temp.path())); - Ok(()) - } - #[test] fn readiness_uses_mounted_cognitive_identity_for_projection_and_brake() -> Result<()> { let temp = tempfile::tempdir()?; @@ -1026,7 +994,7 @@ mod tests { runtime_store, local_verse_store, artifact_root: shared.join("artifacts"), - codex_home: shared.join("codex-home"), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: shared.join("mcp.toml"), model_provider: "test".into(), model: "test-model".into(), diff --git a/epiphany-core/src/resident_self.rs b/epiphany-core/src/resident_self.rs index 50651cf9..8623bf1c 100644 --- a/epiphany-core/src/resident_self.rs +++ b/epiphany-core/src/resident_self.rs @@ -5,6 +5,7 @@ use cultcache_rs::{ use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use std::collections::{BTreeSet, HashSet}; +use std::net::SocketAddr; use std::path::{Path, PathBuf}; pub const RESIDENT_SELF_STATE_KEY: &str = "resident-self"; @@ -273,7 +274,7 @@ pub struct ResidentSelfPolicy { pub runtime_store: PathBuf, pub local_verse_store: PathBuf, pub artifact_root: PathBuf, - pub codex_home: PathBuf, + pub model_connector_endpoint: SocketAddr, pub mcp_config: PathBuf, pub model_provider: String, pub model: String, @@ -301,7 +302,6 @@ impl ResidentSelfPolicy { ("runtime store", &self.runtime_store), ("local Verse store", &self.local_verse_store), ("artifact root", &self.artifact_root), - ("Codex home", &self.codex_home), ("MCP config", &self.mcp_config), ("release store", &self.release_store), ] { @@ -320,6 +320,13 @@ impl ResidentSelfPolicy { path.display() )); } + if !self.model_connector_endpoint.ip().is_loopback() + || self.model_connector_endpoint.port() == 0 + { + return Err(anyhow!( + "resident Self model connector must use a nonzero loopback endpoint" + )); + } if self.model_provider.trim().is_empty() || self.model.trim().is_empty() || self.max_steps == 0 @@ -617,8 +624,8 @@ pub fn coordinator_argv( turn_id.into(), "--cwd".into(), policy.workspace.display().to_string(), - "--codex-home".into(), - policy.codex_home.display().to_string(), + "--connector-endpoint".into(), + policy.model_connector_endpoint.to_string(), "--mcp-config".into(), policy.mcp_config.display().to_string(), "--artifact-dir".into(), @@ -2762,7 +2769,7 @@ mod coordinator_launch_contract_tests { runtime_store, local_verse_store: root.join("local-verse.cc"), artifact_root: root.join("artifacts"), - codex_home: root.join("codex-home"), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: root.join("mcp.toml"), model_provider: "openrouter".into(), model: "stealth/ox-alpha".into(), @@ -2791,7 +2798,7 @@ mod coordinator_launch_contract_tests { runtime_store: PathBuf::from("/epiphany/state/runtime.cc"), local_verse_store: PathBuf::from("/epiphany/state/local-verse.cc"), artifact_root: PathBuf::from("/epiphany/artifacts"), - codex_home: PathBuf::from("/epiphany/codex-home"), + model_connector_endpoint: "127.0.0.1:17891".parse().unwrap(), mcp_config: PathBuf::from("/epiphany/mcp.toml"), model_provider: "openrouter".into(), model: "stealth/ox-alpha".into(), diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 34737881..9e268ef4 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -55,7 +55,7 @@ pub const COORDINATOR_RUN_RECEIPT_TYPE: &str = "epiphany.coordinator_run_receipt pub const RUNTIME_IDENTITY_KEY: &str = "self"; pub const RUNTIME_SWARM_BINDING_KEY: &str = "runtime-swarm-binding"; pub const RUNTIME_SWARM_BINDING_SCHEMA_VERSION: &str = "epiphany.runtime.swarm_binding.v1"; -pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v37"; +pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v38"; pub const EPIPHANY_RUNTIME_ROOT_SESSION_ID: &str = "epiphany-main"; #[derive(Clone, Debug, PartialEq, DatabaseEntry)] #[cultcache(type = "epiphany.runtime.identity", schema = "EpiphanyRuntimeIdentity")] @@ -1936,7 +1936,8 @@ fn archive_completed_model_session( } match &native_terminals[0].payload { EpiphanyModelStreamPayload::Completed { receipt } => { - if cache.get::(request_id)?.as_ref() != Some(receipt) { + if cache.get::(request_id)?.as_ref() != Some(receipt.as_ref()) + { return Err(anyhow!( "runtime session archive found inconsistent native model receipt" )); diff --git a/epiphany-model-adapter/src/lib.rs b/epiphany-model-adapter/src/lib.rs index f91e8d05..7507717e 100644 --- a/epiphany-model-adapter/src/lib.rs +++ b/epiphany-model-adapter/src/lib.rs @@ -4,7 +4,7 @@ use serde::Serialize; pub const MODEL_ADAPTER_REQUEST_SCHEMA_ID: &str = "epiphany.model_request.v0"; pub const MODEL_ADAPTER_EVENT_SCHEMA_ID: &str = "epiphany.model_stream_event.v0"; -pub const MODEL_ADAPTER_RECEIPT_SCHEMA_ID: &str = "epiphany.model_receipt.v0"; +pub const MODEL_ADAPTER_RECEIPT_SCHEMA_ID: &str = "epiphany.model_receipt.v1"; #[derive(Debug, Clone, PartialEq, DatabaseEntry)] #[cultcache(type = "epiphany.model_request.v0", schema = "EpiphanyModelRequest")] pub struct EpiphanyModelRequest { @@ -129,7 +129,7 @@ pub enum EpiphanyModelStreamPayload { arguments: String, }, Completed { - receipt: EpiphanyModelReceipt, + receipt: Box, }, Failed { message: String, @@ -137,7 +137,7 @@ pub enum EpiphanyModelStreamPayload { } #[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)] -#[cultcache(type = "epiphany.model_receipt.v0", schema = "EpiphanyModelReceipt")] +#[cultcache(type = "epiphany.model_receipt.v1", schema = "EpiphanyModelReceipt")] pub struct EpiphanyModelReceipt { #[cultcache(key = 0)] pub schema_id: String, @@ -157,6 +157,14 @@ pub struct EpiphanyModelReceipt { pub reasoning_output_tokens: Option, #[cultcache(key = 8, default)] pub transport: Option, + #[cultcache(key = 9, default)] + pub caller_runtime_id: Option, + #[cultcache(key = 10, default)] + pub native_request_sha256: Option, + #[cultcache(key = 11, default)] + pub provider_request_sha256: Option, + #[cultcache(key = 12, default)] + pub cached_input_tokens: Option, } impl EpiphanyModelReceipt { @@ -175,6 +183,10 @@ impl EpiphanyModelReceipt { output_tokens: None, reasoning_output_tokens: None, transport: None, + caller_runtime_id: None, + native_request_sha256: None, + provider_request_sha256: None, + cached_input_tokens: None, } } } diff --git a/epiphany-openai-adapter/Cargo.toml b/epiphany-openai-adapter/Cargo.toml index 9875b49d..6fc79709 100644 --- a/epiphany-openai-adapter/Cargo.toml +++ b/epiphany-openai-adapter/Cargo.toml @@ -10,6 +10,9 @@ name = "epiphany_openai_adapter" path = "src/lib.rs" [dependencies] +anyhow = "1" cultcache-rs = { path = "../vendor/cultcache-rs" } epiphany-model-adapter = { path = "../epiphany-model-adapter" } serde = { version = "1", features = ["derive"] } +serde_json = "1" +sha2 = "0.10" diff --git a/epiphany-openai-adapter/src/lib.rs b/epiphany-openai-adapter/src/lib.rs index 2bb7ee0a..ca2f5c89 100644 --- a/epiphany-openai-adapter/src/lib.rs +++ b/epiphany-openai-adapter/src/lib.rs @@ -2,6 +2,7 @@ use cultcache_rs::DatabaseEntry; use epiphany_model_adapter::{EpiphanyModelInputItem, EpiphanyModelRequest}; use serde::Deserialize; use serde::Serialize; +use sha2::{Digest, Sha256}; pub const OPENAI_ADAPTER_REQUEST_SCHEMA_ID: &str = "epiphany.openai_model_request.v1"; #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] @@ -183,7 +184,7 @@ pub enum EpiphanyOpenAiStreamPayload { arguments: String, }, Completed { - receipt: EpiphanyOpenAiModelReceipt, + receipt: Box, }, Failed { message: String, @@ -199,6 +200,10 @@ pub struct EpiphanyOpenAiModelReceipt { pub output_tokens: Option, pub reasoning_output_tokens: Option, pub transport: Option, + pub caller_runtime_id: Option, + pub native_request_sha256: Option, + pub provider_request_sha256: Option, + pub cached_input_tokens: Option, } impl EpiphanyOpenAiModelReceipt { @@ -211,6 +216,615 @@ impl EpiphanyOpenAiModelReceipt { output_tokens: None, reasoning_output_tokens: None, transport: None, + caller_runtime_id: None, + native_request_sha256: None, + provider_request_sha256: None, + cached_input_tokens: None, + } + } +} + +/// Project Epiphany's canonical JSON Schema into the strict subset accepted by +/// model providers. Native decoding remains the final validation authority. +pub fn strict_provider_schema(schema_json: &str) -> anyhow::Result { + let mut schema = serde_json::from_str(schema_json) + .map_err(|error| anyhow::anyhow!("provider schema is not valid JSON Schema: {error}"))?; + lower_provider_schema(&mut schema); + close_provider_objects(&mut schema, "$")?; + if !provider_schema_is_strict(&schema) { + return Err(anyhow::anyhow!( + "projected provider output schema is not strict" + )); + } + Ok(schema) +} + +/// Provider-safe output-format identity derived from the native contract. +pub fn provider_format_name(value: &str) -> String { + let mut name = value + .chars() + .map(|ch| { + if ch.is_ascii_alphanumeric() || matches!(ch, '_' | '-') { + ch + } else { + '_' + } + }) + .take(64) + .collect::(); + if name.is_empty() { + name.push_str("epiphany_worker_result"); + } + name +} + +/// Responses call IDs have a narrow alphabet and byte bound. Preserve already +/// legal IDs and derive a stable identity for every other native call ID. +pub fn provider_call_id(value: &str) -> String { + if !value.is_empty() + && value.len() <= 64 + && value + .bytes() + .all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'-')) + { + return value.to_string(); + } + let digest = Sha256::digest(value.as_bytes()); + let mut projected = String::with_capacity(64); + for byte in digest { + use std::fmt::Write as _; + write!(&mut projected, "{byte:02x}").expect("writing to a String cannot fail"); + } + projected +} + +pub const OPENROUTER_TERMINAL_TOOL_NAME: &str = "epiphany_submit_typed_result"; + +/// Lower one typed Epiphany request to OpenRouter's terminal-tool dialect. +pub fn openrouter_request_body( + request: &EpiphanyOpenAiModelRequest, +) -> anyhow::Result { + if request.provider_id != "openrouter" + || request.wire_dialect != EpiphanyOpenAiWireDialect::ChatCompletionsTerminalTool + { + return Err(anyhow::anyhow!( + "OpenRouter requires its exact provider identity and terminal-tool dialect" + )); + } + let has_tool_result = request + .input + .iter() + .any(|item| matches!(item, EpiphanyOpenAiInputItem::ToolResult { .. })); + let output_schema = request + .output_schema_json + .as_deref() + .map(strict_provider_schema) + .transpose()?; + let include_terminal_tool = + output_schema.is_some() && (request.tools.is_empty() || has_tool_result); + if request + .tools + .iter() + .any(|tool| tool.name == OPENROUTER_TERMINAL_TOOL_NAME) + { + return Err(anyhow::anyhow!( + "native tool name collides with the OpenRouter terminal decision tool" + )); + } + + let mut messages = vec![serde_json::json!({ + "role": "system", + "content": request.instructions, + })]; + for item in &request.input { + messages.push(match item { + EpiphanyOpenAiInputItem::UserText { text } => { + serde_json::json!({"role": "user", "content": text}) + } + EpiphanyOpenAiInputItem::AssistantText { text } => { + serde_json::json!({"role": "assistant", "content": text}) + } + EpiphanyOpenAiInputItem::ToolCall { + call_id, + name, + arguments, + } => serde_json::json!({ + "role": "assistant", + "tool_calls": [{ + "id": call_id, + "type": "function", + "function": {"name": name, "arguments": arguments}, + }], + }), + EpiphanyOpenAiInputItem::ToolResult { call_id, output } => serde_json::json!({ + "role": "tool", + "tool_call_id": call_id, + "content": output, + }), + }); + } + + let mut tools = request + .tools + .iter() + .map(|tool| { + Ok(serde_json::json!({ + "type": "function", + "function": { + "name": tool.name, + "description": tool.description, + "strict": true, + "parameters": strict_provider_schema(&tool.parameters_json)?, + }, + })) + }) + .collect::>>()?; + if include_terminal_tool { + tools.push(serde_json::json!({ + "type": "function", + "function": { + "name": OPENROUTER_TERMINAL_TOOL_NAME, + "description": "Submit the final typed Epiphany decision. Call this only when the pass is complete.", + "strict": true, + "parameters": output_schema.expect("terminal schema exists"), + }, + })); + } + + let mut body = serde_json::json!({ + "model": request.model, + "messages": messages, + "stream": false, + "parallel_tool_calls": false, + }); + if !tools.is_empty() { + body["tools"] = serde_json::Value::Array(tools); + body["tool_choice"] = serde_json::Value::String( + if include_terminal_tool || (!request.tools.is_empty() && !has_tool_result) { + "required" + } else { + "auto" + } + .into(), + ); + } + if let Some(effort) = request.reasoning_effort.as_deref() { + body["reasoning"] = serde_json::json!({"effort": effort}); + } + Ok(body) +} + +/// Interpret one non-streaming OpenRouter response into Epiphany's transient +/// event family. The model transcript remains optional; the terminal receipt +/// is authoritative transport evidence. +pub fn openrouter_events_from_response( + request: &EpiphanyOpenAiModelRequest, + response_bytes: &[u8], +) -> anyhow::Result> { + let response: OpenRouterResponse = serde_json::from_slice(response_bytes) + .map_err(|error| anyhow::anyhow!("OpenRouter returned an invalid response: {error}"))?; + let choice = response + .choices + .into_iter() + .next() + .ok_or_else(|| anyhow::anyhow!("OpenRouter response contained no completion choice"))?; + let mut events = Vec::new(); + if let Some(reasoning) = choice.message.reasoning.filter(|value| !value.is_empty()) { + push_openrouter_event( + &mut events, + &request.request_id, + EpiphanyOpenAiStreamPayload::ReasoningDelta { text: reasoning }, + ); + } + let terminal_calls = choice + .message + .tool_calls + .iter() + .filter(|call| call.function.name == OPENROUTER_TERMINAL_TOOL_NAME) + .collect::>(); + if !terminal_calls.is_empty() { + if terminal_calls.len() != 1 || choice.message.tool_calls.len() != 1 { + return Err(anyhow::anyhow!( + "OpenRouter mixed the terminal decision tool with another tool call" + )); + } + let arguments = &terminal_calls[0].function.arguments; + if !matches!( + serde_json::from_str::(arguments), + Ok(serde_json::Value::Object(_)) + ) { + return Err(anyhow::anyhow!( + "OpenRouter terminal decision tool returned non-object arguments" + )); + } + push_openrouter_event( + &mut events, + &request.request_id, + EpiphanyOpenAiStreamPayload::TextDelta { + text: arguments.clone(), + }, + ); + } else { + if let Some(content) = choice.message.content.filter(|value| !value.is_empty()) { + push_openrouter_event( + &mut events, + &request.request_id, + EpiphanyOpenAiStreamPayload::TextDelta { text: content }, + ); + } + for call in choice.message.tool_calls { + push_openrouter_event( + &mut events, + &request.request_id, + EpiphanyOpenAiStreamPayload::ToolCall { + call_id: call.id, + name: call.function.name, + arguments: call.function.arguments, + }, + ); + } + } + if events.is_empty() { + return Err(anyhow::anyhow!( + "OpenRouter response contained neither text nor tool calls" + )); + } + let usage = response.usage; + let mut receipt = EpiphanyOpenAiModelReceipt::new( + &request.request_id, + response.model.unwrap_or_else(|| request.model.clone()), + ); + receipt.response_id = response.id; + receipt.input_tokens = usage.as_ref().and_then(|usage| usage.prompt_tokens); + receipt.output_tokens = usage.as_ref().and_then(|usage| usage.completion_tokens); + receipt.reasoning_output_tokens = usage + .as_ref() + .and_then(|usage| usage.completion_tokens_details.as_ref()) + .and_then(|details| details.reasoning_tokens); + receipt.transport = Some("openrouter-chat-completions".into()); + push_openrouter_event( + &mut events, + &request.request_id, + EpiphanyOpenAiStreamPayload::Completed { + receipt: Box::new(receipt), + }, + ); + Ok(events) +} + +#[derive(Debug, Deserialize)] +struct OpenRouterResponse { + id: Option, + model: Option, + choices: Vec, + usage: Option, +} + +#[derive(Debug, Deserialize)] +struct OpenRouterChoice { + message: OpenRouterMessage, +} + +#[derive(Debug, Deserialize)] +struct OpenRouterMessage { + content: Option, + #[serde(default)] + reasoning: Option, + #[serde(default)] + tool_calls: Vec, +} + +#[derive(Debug, Deserialize)] +struct OpenRouterToolCall { + id: String, + function: OpenRouterFunctionCall, +} + +#[derive(Debug, Deserialize)] +struct OpenRouterFunctionCall { + name: String, + arguments: String, +} + +#[derive(Debug, Deserialize)] +struct OpenRouterUsage { + prompt_tokens: Option, + completion_tokens: Option, + completion_tokens_details: Option, +} + +#[derive(Debug, Deserialize)] +struct OpenRouterCompletionTokenDetails { + reasoning_tokens: Option, +} + +fn push_openrouter_event( + events: &mut Vec, + request_id: &str, + payload: EpiphanyOpenAiStreamPayload, +) { + events.push(EpiphanyOpenAiStreamEvent { + request_id: request_id.into(), + sequence: events.len() as u64, + payload, + }); +} + +fn provider_schema_is_strict(schema: &serde_json::Value) -> bool { + match schema { + serde_json::Value::Object(map) => { + if (map.contains_key("const") || map.contains_key("enum")) && !map.contains_key("type") + { + return false; + } + if schema_map_describes_object(map) { + if map.get("additionalProperties") != Some(&serde_json::Value::Bool(false)) { + return false; + } + let Some(properties) = map.get("properties").and_then(serde_json::Value::as_object) + else { + return false; + }; + let Some(required) = map.get("required").and_then(serde_json::Value::as_array) + else { + return false; + }; + if properties + .keys() + .any(|key| !required.iter().any(|item| item.as_str() == Some(key))) + { + return false; + } + } + map.values().all(provider_schema_is_strict) + } + serde_json::Value::Array(values) => values.iter().all(provider_schema_is_strict), + _ => true, + } +} + +fn close_provider_objects(schema: &mut serde_json::Value, path: &str) -> anyhow::Result<()> { + match schema { + serde_json::Value::Object(map) => { + let describes_object = schema_map_describes_object(map); + if describes_object { + map.insert("type".into(), serde_json::Value::String("object".into())); + let properties = map + .get("properties") + .and_then(serde_json::Value::as_object) + .cloned() + .unwrap_or_default(); + let canonical_required = map + .get("required") + .and_then(serde_json::Value::as_array) + .cloned() + .unwrap_or_default(); + for required in &canonical_required { + let required = required.as_str().ok_or_else(|| { + anyhow::anyhow!("provider schema {path} has a non-string required key") + })?; + if !properties.contains_key(required) { + return Err(anyhow::anyhow!( + "provider schema {path} requires undeclared property {required:?}" + )); + } + } + let canonical_required = canonical_required + .into_iter() + .filter_map(|value| value.as_str().map(ToOwned::to_owned)) + .collect::>(); + let mut projected = serde_json::Map::new(); + for (name, mut property) in properties { + close_provider_objects(&mut property, &format!("{path}.properties.{name}"))?; + if !canonical_required.contains(&name) { + property = nullable_provider_property(property); + } + projected.insert(name, property); + } + let required = projected + .keys() + .cloned() + .map(serde_json::Value::String) + .collect(); + map.insert("properties".into(), serde_json::Value::Object(projected)); + map.insert("required".into(), serde_json::Value::Array(required)); + map.insert( + "additionalProperties".into(), + serde_json::Value::Bool(false), + ); + } + for (name, value) in map.iter_mut() { + if name != "properties" || !describes_object { + close_provider_objects(value, &format!("{path}.{name}"))?; + } + } + Ok(()) + } + serde_json::Value::Array(values) => { + for (index, value) in values.iter_mut().enumerate() { + close_provider_objects(value, &format!("{path}[{index}]"))?; + } + Ok(()) + } + _ => Ok(()), + } +} + +fn schema_map_describes_object(map: &serde_json::Map) -> bool { + map.get("type").and_then(serde_json::Value::as_str) == Some("object") + || [ + "properties", + "required", + "additionalProperties", + "patternProperties", + "propertyNames", + "minProperties", + "maxProperties", + ] + .iter() + .any(|keyword| map.contains_key(*keyword)) +} + +fn parent_relative_object_alternatives(value: &serde_json::Value) -> bool { + let Some(alternatives) = value.as_array() else { + return false; + }; + !alternatives.is_empty() + && alternatives.iter().all(|alternative| { + let Some(map) = alternative.as_object() else { + return false; + }; + !map.contains_key("type") + && !map.contains_key("$ref") + && map + .keys() + .any(|key| matches!(key.as_str(), "properties" | "required")) + && map.keys().all(|key| { + matches!( + key.as_str(), + "properties" | "required" | "title" | "description" | "$comment" + ) + }) + }) +} + +fn infer_literal_type(map: &mut serde_json::Map) { + if map.contains_key("type") { + return; + } + let mut types = std::collections::BTreeSet::new(); + if let Some(value) = map.get("const") { + types.insert(json_type(value)); + } else if let Some(values) = map.get("enum").and_then(serde_json::Value::as_array) { + types.extend(values.iter().map(json_type)); + } + match types.len() { + 0 => {} + 1 => { + map.insert( + "type".into(), + serde_json::Value::String(types.into_iter().next().expect("one type").into()), + ); + } + _ => { + map.insert( + "type".into(), + serde_json::Value::Array( + types + .into_iter() + .map(|value| serde_json::Value::String(value.into())) + .collect(), + ), + ); + } + } +} + +fn json_type(value: &serde_json::Value) -> &'static str { + match value { + serde_json::Value::Null => "null", + serde_json::Value::Bool(_) => "boolean", + serde_json::Value::Number(number) if number.is_i64() || number.is_u64() => "integer", + serde_json::Value::Number(_) => "number", + serde_json::Value::String(_) => "string", + serde_json::Value::Array(_) => "array", + serde_json::Value::Object(_) => "object", + } +} + +fn nullable_provider_property(property: serde_json::Value) -> serde_json::Value { + if property + .get("anyOf") + .and_then(serde_json::Value::as_array) + .is_some_and(|variants| { + variants.iter().any(|variant| { + variant.get("type").and_then(serde_json::Value::as_str) == Some("null") + }) + }) + { + property + } else { + serde_json::json!({"anyOf": [property, {"type": "null"}]}) + } +} + +const UNSUPPORTED_PROVIDER_SCHEMA_KEYWORDS: &[&str] = &[ + "allOf", + "not", + "dependentRequired", + "dependentSchemas", + "if", + "then", + "else", + "patternProperties", + "propertyNames", + "minProperties", + "maxProperties", + "unevaluatedProperties", + "uniqueItems", + "contains", + "minContains", + "maxContains", + "prefixItems", + "unevaluatedItems", + "default", + "examples", + "readOnly", + "writeOnly", + "$schema", + "$id", + "$anchor", + "$dynamicAnchor", + "$dynamicRef", + "$vocabulary", +]; + +fn lower_provider_schema(schema: &mut serde_json::Value) { + let serde_json::Value::Object(map) = schema else { + return; + }; + infer_literal_type(map); + if map.get("format").and_then(serde_json::Value::as_str) == Some("uuid") { + map.remove("format"); + map.entry("pattern").or_insert_with(|| { + serde_json::Value::String( + "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + .into(), + ) + }); + } + for keyword in UNSUPPORTED_PROVIDER_SCHEMA_KEYWORDS { + map.remove(*keyword); + } + if let Some(one_of) = map.remove("oneOf") { + map.insert("anyOf".into(), one_of); + } + if map + .get("anyOf") + .is_some_and(parent_relative_object_alternatives) + { + map.remove("anyOf"); + } + for collection in ["properties", "$defs", "definitions"] { + if let Some(serde_json::Value::Object(children)) = map.get_mut(collection) { + for child in children.values_mut() { + lower_provider_schema(child); + } + } + } + if let Some(items) = map.get_mut("items") { + match items { + serde_json::Value::Array(items) => { + for item in items { + lower_provider_schema(item); + } + } + item => lower_provider_schema(item), + } + } + if let Some(serde_json::Value::Array(alternatives)) = map.get_mut("anyOf") { + for alternative in alternatives { + lower_provider_schema(alternative); } } } @@ -247,4 +861,94 @@ mod tests { ); assert_ne!(openai.schema_id, "epiphany.openai_model_request.v0"); } + + #[test] + fn provider_projection_closes_objects_without_keeping_parent_conditions() { + let schema = strict_provider_schema( + r#"{ + "type":"object", + "properties":{"choice":{"type":"string"},"note":{"type":"string"}}, + "required":["choice"], + "allOf":[{"if":{"properties":{"choice":{"const":"x"}}}}], + "anyOf":[{"required":["choice"]},{"required":["note"]}] + }"#, + ) + .unwrap(); + + assert_eq!(schema["additionalProperties"], false); + assert_eq!(schema["required"], serde_json::json!(["choice", "note"])); + assert!(schema.get("allOf").is_none()); + assert!(schema.get("anyOf").is_none()); + assert_eq!(schema["properties"]["note"]["anyOf"][1]["type"], "null"); + } + + #[test] + fn provider_projection_types_literals_and_lowers_uuid() { + let schema = strict_provider_schema( + r#"{ + "type":"object", + "properties":{ + "kind":{"const":"ready"}, + "id":{"type":"string","format":"uuid"}, + "items":{"type":"array","uniqueItems":true,"items":{"enum":[1,2]}} + }, + "required":["kind","id","items"] + }"#, + ) + .unwrap(); + + assert_eq!(schema["properties"]["kind"]["type"], "string"); + assert!(schema["properties"]["id"].get("format").is_none()); + assert!(schema["properties"]["id"]["pattern"].is_string()); + assert!(schema["properties"]["items"].get("uniqueItems").is_none()); + assert_eq!(schema["properties"]["items"]["items"]["type"], "integer"); + } + + #[test] + fn provider_identities_are_stable_and_bounded() { + assert_eq!(provider_format_name("role/result.v1"), "role_result_v1"); + assert_eq!(provider_call_id("already-safe_1"), "already-safe_1"); + let first = provider_call_id("unsafe/call identity"); + assert_eq!(first, provider_call_id("unsafe/call identity")); + assert_eq!(first.len(), 64); + assert!(first.bytes().all(|byte| byte.is_ascii_hexdigit())); + } + + #[test] + fn openrouter_terminal_tool_preserves_structured_decision() { + let mut request = + EpiphanyOpenAiModelRequest::new("request", "conversation", "ox", "decide"); + request.provider_id = "openrouter".into(); + request.wire_dialect = EpiphanyOpenAiWireDialect::ChatCompletionsTerminalTool; + request.output_schema_json = Some( + r#"{"type":"object","properties":{"verdict":{"type":"string"}},"required":["verdict"]}"#.into(), + ); + let body = openrouter_request_body(&request).unwrap(); + assert_eq!(body["tool_choice"], "required"); + assert_eq!( + body["tools"][0]["function"]["name"], + OPENROUTER_TERMINAL_TOOL_NAME + ); + + let response = serde_json::json!({ + "id": "response", + "model": "ox", + "choices": [{"message": {"tool_calls": [{ + "id": "terminal", + "function": {"name": OPENROUTER_TERMINAL_TOOL_NAME, "arguments": "{\"verdict\":\"pass\"}"} + }]}}] + }); + let events = + openrouter_events_from_response(&request, &serde_json::to_vec(&response).unwrap()) + .unwrap(); + assert!(matches!( + &events[0].payload, + EpiphanyOpenAiStreamPayload::TextDelta { text } if text == "{\"verdict\":\"pass\"}" + )); + assert!(matches!( + &events[1].payload, + EpiphanyOpenAiStreamPayload::Completed { receipt } + if receipt.transport.as_deref() == Some("openrouter-chat-completions") + )); + } } diff --git a/epiphany-openai-codex-spine/Cargo.toml b/epiphany-openai-codex-spine/Cargo.toml deleted file mode 100644 index 179e3a18..00000000 --- a/epiphany-openai-codex-spine/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "epiphany-openai-codex-spine" -version = "0.1.0" -edition = "2024" -publish = false -license-file = "../LICENSE" - -[lib] -name = "epiphany_openai_codex_spine" -path = "src/lib.rs" - -[dependencies] -anyhow = "1" -codex-client = { path = "../vendor/codex/codex-rs/codex-client" } -codex-login = { path = "../vendor/codex/codex-rs/login" } -epiphany-openai-adapter = { path = "../epiphany-openai-adapter" } -http = "1" -serde = "1" -serde_json = "1" -sha2 = "0.10" -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } diff --git a/epiphany-openai-codex-spine/src/lib.rs b/epiphany-openai-codex-spine/src/lib.rs deleted file mode 100644 index 2c9ec7c7..00000000 --- a/epiphany-openai-codex-spine/src/lib.rs +++ /dev/null @@ -1,1960 +0,0 @@ -use std::collections::HashMap; -use std::sync::Arc; -use std::time::Duration; - -use anyhow::Context; -use anyhow::Result; -use codex_client::HttpTransport; -use codex_client::Request; -use codex_client::ReqwestTransport; -use codex_client::TransportError; -use codex_client::sse_stream; -use epiphany_openai_adapter::EpiphanyOpenAiInputItem; -use epiphany_openai_adapter::EpiphanyOpenAiModelReceipt; -use epiphany_openai_adapter::EpiphanyOpenAiModelRequest; -use epiphany_openai_adapter::EpiphanyOpenAiStreamEvent; -use epiphany_openai_adapter::EpiphanyOpenAiStreamPayload; -use epiphany_openai_adapter::EpiphanyOpenAiWireDialect; -use codex_login::AuthCredentialsStoreMode; -use codex_login::AuthManager; -use codex_login::CodexAuth; -use codex_login::default_client::build_reqwest_client; -use serde::Deserialize; -use serde::Serialize; -use serde_json::Value; -use sha2::Digest; -use sha2::Sha256; - -const CHATGPT_CODEX_BASE_URL: &str = "https://chatgpt.com/backend-api/codex"; -const OPENAI_API_BASE_URL: &str = "https://api.openai.com/v1"; -const OPENROUTER_API_BASE_URL: &str = "https://openrouter.ai/api/v1"; -// Keep provider silence shorter than Epiphany worker watchdogs so the runtime can -// write a typed stream failure instead of being killed with no model evidence. -const RESPONSES_STREAM_IDLE_TIMEOUT: Duration = Duration::from_secs(45); -const RESPONSES_CALL_ID_MAX_BYTES: usize = 64; - -pub const OPENROUTER_TERMINAL_TOOL_NAME: &str = "epiphany_submit_typed_result"; - -pub fn default_codex_home() -> Result { - if let Ok(path) = std::env::var("CODEX_HOME") { - return Ok(std::path::PathBuf::from(path)); - } - let home = std::env::var("USERPROFILE") - .or_else(|_| std::env::var("HOME")) - .context("CODEX_HOME is unset and no home directory environment variable exists")?; - Ok(std::path::PathBuf::from(home).join(".codex")) -} - -pub fn auth_manager(codex_home: std::path::PathBuf) -> Arc { - AuthManager::shared( - codex_home, - /*enable_codex_api_key_env*/ true, - AuthCredentialsStoreMode::Auto, - /*chatgpt_base_url*/ None, - ) -} - -pub struct EpiphanyCodexOpenAiTransport { - auth_manager: Arc, - base_url: Option, -} - -impl EpiphanyCodexOpenAiTransport { - pub fn new(auth_manager: Arc, base_url: Option) -> Self { - Self { - auth_manager, - base_url, - } - } - - pub fn openai(auth_manager: Arc) -> Self { - Self::new(auth_manager, None) - } - - pub async fn collect_model_events( - &self, - request: EpiphanyOpenAiModelRequest, - ) -> Result> { - let request_id = request.request_id.clone(); - let model = request.model.clone(); - let auth = self - .auth_manager - .auth() - .await - .ok_or_else(|| anyhow::anyhow!("Codex auth is unavailable"))?; - let stream_response = self.open_responses_stream(&auth, request).await?; - let (tx, mut rx) = tokio::sync::mpsc::channel(1600); - sse_stream(stream_response.bytes, RESPONSES_STREAM_IDLE_TIMEOUT, tx); - - let mut stream_state = EpiphanyResponsesStreamState::new(&request_id, &model); - while let Some(frame) = rx.recv().await { - match frame { - Ok(frame) => stream_state.push_sse_frame(&frame), - Err(err) => stream_state.push_failed(err.to_string()), - } - if stream_state.completed { - break; - } - } - - if stream_state.events.is_empty() { - stream_state.push_failed("Responses stream closed without typed events".to_string()); - } - Ok(stream_state.events) - } - - async fn open_responses_stream( - &self, - auth: &CodexAuth, - request: EpiphanyOpenAiModelRequest, - ) -> Result { - let base_url = self - .base_url - .clone() - .unwrap_or_else(|| default_base_url_for_auth(auth).to_string()); - let url = format!("{}/responses", base_url.trim_end_matches('/')); - let conversation_id = request.conversation_id.clone(); - let mut outbound = Request::new(http::Method::POST, url) - .with_json(&responses_body_from_epiphany(request)?); - attach_codex_auth_headers(auth, &mut outbound.headers) - .context("failed to attach Codex auth headers")?; - outbound - .headers - .insert(http::header::ACCEPT, "text/event-stream".parse()?); - outbound - .headers - .insert("session_id", conversation_id.parse()?); - outbound - .headers - .insert("x-client-request-id", conversation_id.parse()?); - attach_optional_env_header( - &mut outbound.headers, - "OpenAI-Organization", - "OPENAI_ORGANIZATION", - ); - attach_optional_env_header(&mut outbound.headers, "OpenAI-Project", "OPENAI_PROJECT"); - - let transport = ReqwestTransport::new(build_reqwest_client()); - transport - .stream(outbound) - .await - .map_err(transport_error_to_anyhow) - } -} - -/// OpenRouter owns a distinct credential and wire dialect. It is intentionally -/// not routed through Codex auth or the Responses transport. -pub struct EpiphanyOpenRouterTransport { - api_key: String, - base_url: String, - request_timeout: Option, -} - -impl EpiphanyOpenRouterTransport { - pub fn new(api_key: impl Into, request_timeout: Option) -> Result { - let api_key = api_key.into(); - if api_key.trim().is_empty() || api_key.trim() != api_key { - return Err(anyhow::anyhow!( - "OpenRouter API key must be a non-empty trimmed credential" - )); - } - if request_timeout.is_some_and(|timeout| timeout.is_zero()) { - return Err(anyhow::anyhow!( - "OpenRouter request timeout must be positive when present" - )); - } - Ok(Self { - api_key, - base_url: OPENROUTER_API_BASE_URL.to_string(), - request_timeout, - }) - } - - pub async fn collect_model_events( - &self, - request: EpiphanyOpenAiModelRequest, - ) -> Result> { - let url = format!("{}/chat/completions", self.base_url.trim_end_matches('/')); - let body = chat_completions_body_from_epiphany(&request)?; - let mut outbound = Request::new(http::Method::POST, url).with_json(&body); - let mut authorization = format!("Bearer {}", self.api_key).parse::()?; - authorization.set_sensitive(true); - outbound - .headers - .insert(http::header::AUTHORIZATION, authorization); - outbound.timeout = self.request_timeout; - let transport = ReqwestTransport::new(build_reqwest_client()); - let response = transport - .execute(outbound) - .await - .map_err(transport_error_to_anyhow)?; - let response: OpenRouterChatCompletionResponse = serde_json::from_slice(&response.body) - .context("OpenRouter returned an invalid Chat Completions response")?; - openrouter_events_from_chat_completion(&request, response) - } -} - -pub fn chat_completions_body_from_epiphany( - request: &EpiphanyOpenAiModelRequest, -) -> Result { - if request.provider_id != "openrouter" - || request.wire_dialect != EpiphanyOpenAiWireDialect::ChatCompletionsTerminalTool - { - return Err(anyhow::anyhow!( - "OpenRouter transport requires its exact provider identity and Chat Completions dialect" - )); - } - let has_tool_result = request - .input - .iter() - .any(|item| matches!(item, EpiphanyOpenAiInputItem::ToolResult { .. })); - let output_schema = request - .output_schema_json - .as_deref() - .map(strict_provider_schema) - .transpose()?; - let include_terminal_tool = - output_schema.is_some() && (request.tools.is_empty() || has_tool_result); - if request - .tools - .iter() - .any(|tool| tool.name == OPENROUTER_TERMINAL_TOOL_NAME) - { - return Err(anyhow::anyhow!( - "native tool name collides with the OpenRouter terminal decision tool" - )); - } - - let mut messages = vec![serde_json::json!({ - "role": "system", - "content": request.instructions, - })]; - for item in &request.input { - messages.push(match item { - EpiphanyOpenAiInputItem::UserText { text } => serde_json::json!({ - "role": "user", - "content": text, - }), - EpiphanyOpenAiInputItem::AssistantText { text } => serde_json::json!({ - "role": "assistant", - "content": text, - }), - EpiphanyOpenAiInputItem::ToolCall { - call_id, - name, - arguments, - } => serde_json::json!({ - "role": "assistant", - "tool_calls": [{ - "id": call_id, - "type": "function", - "function": {"name": name, "arguments": arguments}, - }], - }), - EpiphanyOpenAiInputItem::ToolResult { call_id, output } => serde_json::json!({ - "role": "tool", - "tool_call_id": call_id, - "content": output, - }), - }); - } - - let mut tools = request - .tools - .iter() - .map(|tool| { - let parameters = strict_provider_schema(&tool.parameters_json)?; - Ok(serde_json::json!({ - "type": "function", - "function": { - "name": tool.name, - "description": tool.description, - "strict": true, - "parameters": parameters, - }, - })) - }) - .collect::>>()?; - if let Some(schema) = output_schema { - if include_terminal_tool { - tools.push(serde_json::json!({ - "type": "function", - "function": { - "name": OPENROUTER_TERMINAL_TOOL_NAME, - "description": "Submit the final typed Epiphany decision. Call this only when the pass is complete.", - "strict": true, - "parameters": schema, - }, - })); - } - } - - let mut body = serde_json::json!({ - "model": request.model, - "messages": messages, - "stream": false, - "parallel_tool_calls": false, - }); - if !tools.is_empty() { - body["tools"] = serde_json::Value::Array(tools); - body["tool_choice"] = serde_json::Value::String( - if include_terminal_tool || (!request.tools.is_empty() && !has_tool_result) { - "required" - } else { - "auto" - } - .to_string(), - ); - } - if let Some(effort) = request.reasoning_effort.as_deref() { - body["reasoning"] = serde_json::json!({"effort": effort}); - } - Ok(body) -} - -fn strict_provider_schema(schema_json: &str) -> Result { - let mut schema: serde_json::Value = serde_json::from_str(schema_json) - .context("provider tool parameters are not valid JSON Schema")?; - project_strict_responses_schema(&mut schema)?; - Ok(schema) -} - -#[derive(Debug, Deserialize)] -struct OpenRouterChatCompletionResponse { - id: Option, - model: Option, - choices: Vec, - usage: Option, -} - -#[derive(Debug, Deserialize)] -struct OpenRouterChatChoice { - message: OpenRouterChatMessage, -} - -#[derive(Debug, Deserialize)] -struct OpenRouterChatMessage { - content: Option, - #[serde(default)] - reasoning: Option, - #[serde(default)] - tool_calls: Vec, -} - -#[derive(Debug, Deserialize)] -struct OpenRouterChatToolCall { - id: String, - function: OpenRouterChatFunctionCall, -} - -#[derive(Debug, Deserialize)] -struct OpenRouterChatFunctionCall { - name: String, - arguments: String, -} - -#[derive(Debug, Deserialize)] -struct OpenRouterChatUsage { - prompt_tokens: Option, - completion_tokens: Option, - completion_tokens_details: Option, -} - -#[derive(Debug, Deserialize)] -struct OpenRouterCompletionTokenDetails { - reasoning_tokens: Option, -} - -fn openrouter_events_from_chat_completion( - request: &EpiphanyOpenAiModelRequest, - response: OpenRouterChatCompletionResponse, -) -> Result> { - let choice = response - .choices - .into_iter() - .next() - .ok_or_else(|| anyhow::anyhow!("OpenRouter response contained no completion choice"))?; - let mut events = Vec::new(); - if let Some(reasoning) = choice.message.reasoning.filter(|value| !value.is_empty()) { - push_openrouter_event( - &mut events, - &request.request_id, - EpiphanyOpenAiStreamPayload::ReasoningDelta { text: reasoning }, - ); - } - let terminal_calls = choice - .message - .tool_calls - .iter() - .filter(|call| call.function.name == OPENROUTER_TERMINAL_TOOL_NAME) - .collect::>(); - if !terminal_calls.is_empty() { - if terminal_calls.len() != 1 || choice.message.tool_calls.len() != 1 { - return Err(anyhow::anyhow!( - "OpenRouter mixed the terminal decision tool with another tool call" - )); - } - let arguments = &terminal_calls[0].function.arguments; - if !matches!( - serde_json::from_str::(arguments), - Ok(serde_json::Value::Object(_)) - ) { - return Err(anyhow::anyhow!( - "OpenRouter terminal decision tool returned non-object arguments" - )); - } - push_openrouter_event( - &mut events, - &request.request_id, - EpiphanyOpenAiStreamPayload::TextDelta { - text: arguments.clone(), - }, - ); - } else { - if let Some(content) = choice.message.content.filter(|value| !value.is_empty()) { - push_openrouter_event( - &mut events, - &request.request_id, - EpiphanyOpenAiStreamPayload::TextDelta { text: content }, - ); - } - for call in choice.message.tool_calls { - push_openrouter_event( - &mut events, - &request.request_id, - EpiphanyOpenAiStreamPayload::ToolCall { - call_id: call.id, - name: call.function.name, - arguments: call.function.arguments, - }, - ); - } - } - if events.is_empty() { - return Err(anyhow::anyhow!( - "OpenRouter response contained neither text nor tool calls" - )); - } - let usage = response.usage; - let mut receipt = EpiphanyOpenAiModelReceipt::new( - &request.request_id, - response.model.unwrap_or_else(|| request.model.clone()), - ); - receipt.response_id = response.id; - receipt.input_tokens = usage.as_ref().and_then(|item| item.prompt_tokens); - receipt.output_tokens = usage.as_ref().and_then(|item| item.completion_tokens); - receipt.reasoning_output_tokens = usage - .as_ref() - .and_then(|item| item.completion_tokens_details.as_ref()) - .and_then(|item| item.reasoning_tokens); - receipt.transport = Some("openrouter-chat-completions".to_string()); - push_openrouter_event( - &mut events, - &request.request_id, - EpiphanyOpenAiStreamPayload::Completed { receipt }, - ); - Ok(events) -} - -fn push_openrouter_event( - events: &mut Vec, - request_id: &str, - payload: EpiphanyOpenAiStreamPayload, -) { - events.push(EpiphanyOpenAiStreamEvent { - request_id: request_id.to_string(), - sequence: events.len() as u64, - payload, - }); -} - -pub fn responses_body_from_epiphany( - request: EpiphanyOpenAiModelRequest, -) -> Result { - if !matches!(request.provider_id.as_str(), "openai-codex" | "openai") - || request.wire_dialect != EpiphanyOpenAiWireDialect::Responses - { - return Err(anyhow::anyhow!( - "Responses transport requires an OpenAI provider identity and Responses dialect" - )); - } - let requires_initial_tool = !request.tools.is_empty() - && !request - .input - .iter() - .any(|item| matches!(item, EpiphanyOpenAiInputItem::ToolResult { .. })); - let text = responses_text_format( - request.output_contract_id.as_deref(), - request.output_schema_json.as_deref(), - &request.request_id, - )?; - let body = EpiphanyResponsesBody { - model: request.model, - instructions: request.instructions, - input: request - .input - .into_iter() - .map(openai_input_item_from_epiphany_input) - .collect(), - tools: request - .tools - .into_iter() - .map(openai_tool_from_epiphany_tool) - .collect::>>()?, - tool_choice: if requires_initial_tool { - "required" - } else { - "auto" - } - .to_string(), - parallel_tool_calls: false, - reasoning: Some(EpiphanyResponsesReasoning { - effort: parse_reasoning_effort(request.reasoning_effort.as_deref())?, - summary: parse_reasoning_summary(request.reasoning_summary.as_deref())?, - }), - store: false, - stream: true, - include: Vec::new(), - service_tier: parse_service_tier(request.service_tier.as_deref())?, - previous_response_id: request.previous_response_id, - prompt_cache_key: None, - text, - client_metadata: None, - }; - serde_json::to_value(body).context("failed to encode typed Epiphany Responses body") -} - -fn responses_text_format( - output_contract_id: Option<&str>, - output_schema_json: Option<&str>, - request_id: &str, -) -> Result> { - let Some(schema_json) = output_schema_json else { - return Ok(None); - }; - let mut schema: serde_json::Value = - serde_json::from_str(schema_json).context("output_schema_json is not valid JSON Schema")?; - project_strict_responses_schema(&mut schema)?; - let raw_name = output_contract_id.unwrap_or(request_id); - let mut name = raw_name - .chars() - .map(|ch| { - if ch.is_ascii_alphanumeric() || ch == '_' || ch == '-' { - ch - } else { - '_' - } - }) - .take(64) - .collect::(); - if name.is_empty() { - name = "epiphany_worker_result".to_string(); - } - Ok(Some(serde_json::json!({ - "format": { - "type": "json_schema", - "name": name, - "strict": true, - "schema": schema - } - }))) -} - -fn responses_schema_is_strict(schema: &serde_json::Value) -> bool { - match schema { - serde_json::Value::Object(map) => { - if (map.contains_key("const") || map.contains_key("enum")) && !map.contains_key("type") - { - return false; - } - if schema_map_describes_object(map) { - if map.get("additionalProperties") != Some(&serde_json::Value::Bool(false)) { - return false; - } - let Some(properties) = map.get("properties").and_then(serde_json::Value::as_object) - else { - return false; - }; - let Some(required) = map.get("required").and_then(serde_json::Value::as_array) - else { - return false; - }; - if properties - .keys() - .any(|key| !required.iter().any(|item| item.as_str() == Some(key))) - { - return false; - } - } - map.values().all(responses_schema_is_strict) - } - serde_json::Value::Array(values) => values.iter().all(responses_schema_is_strict), - _ => true, - } -} - -fn project_strict_responses_schema(schema: &mut serde_json::Value) -> Result<()> { - lower_schema_for_responses_format(schema); - require_closed_responses_objects(schema, "$")?; - if !responses_schema_is_strict(schema) { - return Err(anyhow::anyhow!( - "projected Responses output schema is not strict" - )); - } - Ok(()) -} - -fn require_closed_responses_objects(schema: &mut serde_json::Value, path: &str) -> Result<()> { - match schema { - serde_json::Value::Object(map) => { - let describes_object = schema_map_describes_object(map); - if describes_object { - map.insert( - "type".to_string(), - serde_json::Value::String("object".to_string()), - ); - let properties = map - .get("properties") - .and_then(serde_json::Value::as_object) - .cloned() - .unwrap_or_default(); - let canonical_required = map - .get("required") - .and_then(serde_json::Value::as_array) - .cloned() - .unwrap_or_default(); - for required in &canonical_required { - let required = required.as_str().ok_or_else(|| { - anyhow::anyhow!("Responses schema {path} has a non-string required key") - })?; - if !properties.contains_key(required) { - return Err(anyhow::anyhow!( - "Responses schema {path} requires undeclared property {required:?}" - )); - } - } - - let canonical_required = canonical_required - .into_iter() - .filter_map(|value| value.as_str().map(ToString::to_string)) - .collect::>(); - let mut projected = serde_json::Map::new(); - for (name, mut property) in properties { - let property_path = format!("{path}.properties.{name}"); - require_closed_responses_objects(&mut property, &property_path)?; - if !canonical_required.contains(&name) { - property = nullable_responses_property(property); - } - projected.insert(name, property); - } - let required = projected - .keys() - .cloned() - .map(serde_json::Value::String) - .collect(); - map.insert( - "properties".to_string(), - serde_json::Value::Object(projected), - ); - map.insert("required".to_string(), serde_json::Value::Array(required)); - map.insert( - "additionalProperties".to_string(), - serde_json::Value::Bool(false), - ); - } - - for (name, value) in map.iter_mut() { - if name == "properties" && describes_object { - continue; - } - require_closed_responses_objects(value, &format!("{path}.{name}"))?; - } - Ok(()) - } - serde_json::Value::Array(values) => { - for (index, value) in values.iter_mut().enumerate() { - require_closed_responses_objects(value, &format!("{path}[{index}]"))?; - } - Ok(()) - } - _ => Ok(()), - } -} - -fn schema_map_describes_object(map: &serde_json::Map) -> bool { - map.get("type").and_then(serde_json::Value::as_str) == Some("object") - || [ - "properties", - "required", - "additionalProperties", - "patternProperties", - "propertyNames", - "minProperties", - "maxProperties", - ] - .iter() - .any(|keyword| map.contains_key(*keyword)) -} - -fn parent_relative_object_alternatives(value: &serde_json::Value) -> bool { - let Some(alternatives) = value.as_array() else { - return false; - }; - !alternatives.is_empty() - && alternatives.iter().all(|alternative| { - let Some(map) = alternative.as_object() else { - return false; - }; - !map.contains_key("type") - && !map.contains_key("$ref") - && map - .keys() - .any(|key| matches!(key.as_str(), "properties" | "required")) - && map.keys().all(|key| { - matches!( - key.as_str(), - "properties" | "required" | "title" | "description" | "$comment" - ) - }) - }) -} - -fn inferred_json_type(value: &serde_json::Value) -> &'static str { - match value { - serde_json::Value::Null => "null", - serde_json::Value::Bool(_) => "boolean", - serde_json::Value::Number(number) if number.is_i64() || number.is_u64() => "integer", - serde_json::Value::Number(_) => "number", - serde_json::Value::String(_) => "string", - serde_json::Value::Array(_) => "array", - serde_json::Value::Object(_) => "object", - } -} - -fn infer_responses_literal_type(map: &mut serde_json::Map) { - if map.contains_key("type") { - return; - } - let mut types = std::collections::BTreeSet::new(); - if let Some(value) = map.get("const") { - types.insert(inferred_json_type(value)); - } else if let Some(values) = map.get("enum").and_then(serde_json::Value::as_array) { - for value in values { - types.insert(inferred_json_type(value)); - } - } - match types.len() { - 0 => {} - 1 => { - map.insert( - "type".to_string(), - serde_json::Value::String( - types.into_iter().next().expect("one literal type").into(), - ), - ); - } - _ => { - map.insert( - "type".to_string(), - serde_json::Value::Array( - types - .into_iter() - .map(|value| serde_json::Value::String(value.into())) - .collect(), - ), - ); - } - } -} - -fn lower_responses_known_format(map: &mut serde_json::Map) { - if map.get("format").and_then(serde_json::Value::as_str) == Some("uuid") { - // JSON Schema `format` may be annotation-only. Responses supports - // `pattern` for standard models, so give generation the same lexical - // boundary that native UUID decoding will later enforce. - map.remove("format"); - map.entry("pattern".to_string()).or_insert_with(|| { - serde_json::Value::String( - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" - .to_string(), - ) - }); - } -} - -fn nullable_responses_property(property: serde_json::Value) -> serde_json::Value { - if property - .get("anyOf") - .and_then(serde_json::Value::as_array) - .is_some_and(|variants| { - variants.iter().any(|variant| { - variant.get("type").and_then(serde_json::Value::as_str) == Some("null") - }) - }) - { - return property; - } - serde_json::json!({ - "anyOf": [property, {"type": "null"}] - }) -} - -const RESPONSES_UNSUPPORTED_SCHEMA_KEYWORDS: &[&str] = &[ - // Composition and conditional validation are outside the Responses subset. - "allOf", - "not", - "dependentRequired", - "dependentSchemas", - "if", - "then", - "else", - // Standard-model Responses accepts type-specific assertions which remain - // useful generation constraints; native ingress still owns final - // validation. `uniqueItems` is excluded because the live strict endpoint - // rejects it even though ordinary JSON Schema permits it. - "patternProperties", - "propertyNames", - "minProperties", - "maxProperties", - "unevaluatedProperties", - "uniqueItems", - "contains", - "minContains", - "maxContains", - "prefixItems", - "unevaluatedItems", - // Annotation and dialect metadata do not belong in the provider contract. - // Title and description are retained because they help generation without - // claiming validation authority. - "default", - "examples", - "readOnly", - "writeOnly", - "$schema", - "$id", - "$anchor", - "$dynamicAnchor", - "$dynamicRef", - "$vocabulary", -]; - -fn lower_schema_for_responses_format(schema: &mut serde_json::Value) { - let serde_json::Value::Object(map) = schema else { - return; - }; - infer_responses_literal_type(map); - lower_responses_known_format(map); - // Responses structured output accepts only a JSON-Schema subset. - // Canonical assertion authority remains enforced by Epiphany ingress - // and Mind admission; this projection owns provider formatting only. - for unsupported in RESPONSES_UNSUPPORTED_SCHEMA_KEYWORDS { - map.remove(*unsupported); - } - if let Some(one_of) = map.remove("oneOf") { - map.insert("anyOf".to_string(), one_of); - } - // A canonical object may use anyOf solely to require one of several - // sibling properties. Responses strict schemas require every object - // alternative to repeat a complete closed property declaration, so - // those parent-relative fragments are not a valid provider shape. - // Runtime ingress remains the owner of the conditional invariant. - if map - .get("anyOf") - .is_some_and(parent_relative_object_alternatives) - { - map.remove("anyOf"); - } - - // Recurse only through positions that contain schemas. A `properties` or - // `$defs` map contains user-authored names; treating those names as schema - // keywords would silently delete legitimate fields such as `format`. - for collection in ["properties", "$defs", "definitions"] { - if let Some(serde_json::Value::Object(children)) = map.get_mut(collection) { - for child in children.values_mut() { - lower_schema_for_responses_format(child); - } - } - } - if let Some(items) = map.get_mut("items") { - match items { - serde_json::Value::Array(items) => { - for item in items { - lower_schema_for_responses_format(item); - } - } - item => lower_schema_for_responses_format(item), - } - } - if let Some(serde_json::Value::Array(alternatives)) = map.get_mut("anyOf") { - for alternative in alternatives { - lower_schema_for_responses_format(alternative); - } - } -} - -fn openai_tool_from_epiphany_tool( - tool: epiphany_openai_adapter::EpiphanyOpenAiToolDefinition, -) -> Result { - let mut parameters: serde_json::Value = serde_json::from_str(&tool.parameters_json) - .with_context(|| format!("tool {} parameters_json is not valid JSON", tool.name))?; - project_strict_responses_schema(&mut parameters) - .with_context(|| format!("tool {} parameters cannot be projected strictly", tool.name))?; - Ok(serde_json::json!({ - "type": "function", - "name": tool.name, - "description": tool.description, - "parameters": parameters, - "strict": true - })) -} - -#[derive(Debug, Clone, Serialize)] -struct EpiphanyResponsesBody { - model: String, - #[serde(skip_serializing_if = "String::is_empty")] - instructions: String, - input: Vec, - tools: Vec, - tool_choice: String, - parallel_tool_calls: bool, - reasoning: Option, - store: bool, - stream: bool, - include: Vec, - #[serde(skip_serializing_if = "Option::is_none")] - service_tier: Option, - #[serde(skip_serializing_if = "Option::is_none")] - previous_response_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - prompt_cache_key: Option, - #[serde(skip_serializing_if = "Option::is_none")] - text: Option, - #[serde(skip_serializing_if = "Option::is_none")] - client_metadata: Option>, -} - -#[derive(Debug, Clone, Serialize)] -struct EpiphanyResponsesReasoning { - #[serde(skip_serializing_if = "Option::is_none")] - effort: Option, - #[serde(skip_serializing_if = "Option::is_none")] - summary: Option, -} - -#[derive(Debug, Clone, Serialize)] -#[serde(tag = "type", rename_all = "snake_case")] -enum EpiphanyResponsesInputItem { - Message { - role: String, - content: Vec, - }, - FunctionCall { - call_id: String, - name: String, - arguments: String, - }, - FunctionCallOutput { - call_id: String, - output: String, - }, -} - -#[derive(Debug, Clone, Serialize)] -#[serde(tag = "type", rename_all = "snake_case")] -enum EpiphanyResponsesContentItem { - InputText { text: String }, - OutputText { text: String }, -} - -fn openai_input_item_from_epiphany_input( - input: EpiphanyOpenAiInputItem, -) -> EpiphanyResponsesInputItem { - match input { - EpiphanyOpenAiInputItem::UserText { text } => EpiphanyResponsesInputItem::Message { - role: "user".to_string(), - content: vec![EpiphanyResponsesContentItem::InputText { text }], - }, - EpiphanyOpenAiInputItem::AssistantText { text } => EpiphanyResponsesInputItem::Message { - role: "assistant".to_string(), - content: vec![EpiphanyResponsesContentItem::OutputText { text }], - }, - EpiphanyOpenAiInputItem::ToolCall { - call_id, - name, - arguments, - } => EpiphanyResponsesInputItem::FunctionCall { - call_id: responses_call_id(&call_id), - name, - arguments, - }, - EpiphanyOpenAiInputItem::ToolResult { call_id, output } => { - EpiphanyResponsesInputItem::FunctionCallOutput { - call_id: responses_call_id(&call_id), - output, - } - } - } -} - -fn responses_call_id(internal_call_id: &str) -> String { - if !internal_call_id.is_empty() - && internal_call_id.is_ascii() - && internal_call_id.len() <= RESPONSES_CALL_ID_MAX_BYTES - { - return internal_call_id.to_string(); - } - - let digest = format!("{:x}", Sha256::digest(internal_call_id.as_bytes())); - format!("epi-{}", &digest[..RESPONSES_CALL_ID_MAX_BYTES - 4]) -} - -#[derive(Debug, Deserialize)] -struct EpiphanyResponsesStreamEvent { - #[serde(rename = "type")] - kind: String, - response: Option, - item: Option, - item_id: Option, - call_id: Option, - delta: Option, -} - -#[derive(Debug, Deserialize)] -struct EpiphanyResponseCompleted { - id: String, - #[serde(default)] - usage: Option, -} - -#[derive(Debug, Deserialize)] -struct EpiphanyResponseCompletedUsage { - input_tokens: i64, - output_tokens: i64, - output_tokens_details: Option, -} - -#[derive(Debug, Deserialize)] -struct EpiphanyResponseCompletedOutputTokensDetails { - reasoning_tokens: i64, -} - -struct EpiphanyResponsesStreamState { - request_id: String, - requested_model: String, - sequence: u64, - completed: bool, - pending_tool_calls: HashMap, - events: Vec, -} - -#[derive(Debug, Clone, Default)] -struct PendingToolCall { - call_id: Option, - name: Option, - arguments: String, -} - -impl EpiphanyResponsesStreamState { - fn new(request_id: &str, requested_model: &str) -> Self { - Self { - request_id: request_id.to_string(), - requested_model: requested_model.to_string(), - sequence: 0, - completed: false, - pending_tool_calls: HashMap::new(), - events: Vec::new(), - } - } - - fn push_sse_frame(&mut self, frame: &str) { - let Ok(event) = serde_json::from_str::(frame) else { - return; - }; - match event.kind.as_str() { - "response.output_text.delta" => { - if let Some(text) = event.delta { - self.push_payload(EpiphanyOpenAiStreamPayload::TextDelta { text }); - } - } - "response.reasoning_summary_text.delta" | "response.reasoning_text.delta" => { - if let Some(text) = event.delta { - self.push_payload(EpiphanyOpenAiStreamPayload::ReasoningDelta { text }); - } - } - "response.output_item.added" => { - if let Some(item) = event.item { - self.seed_tool_call_from_item(&item); - } - } - "response.function_call_arguments.delta" => { - if let (Some(arguments), Some(item_id)) = - (event.delta, event.item_id.clone().or(event.call_id.clone())) - { - self.pending_tool_calls - .entry(item_id.clone()) - .or_insert_with(|| PendingToolCall { - call_id: event.call_id.clone().or(Some(item_id)), - name: None, - arguments: String::new(), - }) - .arguments - .push_str(&arguments); - } - } - "response.custom_tool_call_input.delta" => { - if let (Some(arguments), Some(item_id)) = - (event.delta, event.item_id.clone().or(event.call_id.clone())) - { - self.pending_tool_calls - .entry(item_id.clone()) - .or_insert_with(|| PendingToolCall { - call_id: event.call_id.clone().or(Some(item_id)), - name: None, - arguments: String::new(), - }) - .arguments - .push_str(&arguments); - } - } - "response.output_item.done" => { - if let Some(item) = event.item { - self.push_tool_call_from_done_item(&item); - } - } - "response.completed" => { - if let Some(response) = event.response { - match serde_json::from_value::(response) { - Ok(completed) => self.push_completed(completed), - Err(err) => self.push_failed(format!( - "failed to parse response.completed event: {err}" - )), - } - } - self.completed = true; - } - "response.failed" | "response.incomplete" => { - self.push_failed(response_error_message(event.response.as_ref())); - } - _ => {} - } - } - - fn push_completed(&mut self, completed: EpiphanyResponseCompleted) { - let mut receipt = EpiphanyOpenAiModelReceipt::new(&self.request_id, &self.requested_model); - receipt.response_id = Some(completed.id); - receipt.transport = Some("epiphany_direct_responses_http".to_string()); - if let Some(usage) = completed.usage { - receipt.input_tokens = nonnegative_i64_to_u64(usage.input_tokens); - receipt.output_tokens = nonnegative_i64_to_u64(usage.output_tokens); - receipt.reasoning_output_tokens = usage - .output_tokens_details - .and_then(|details| nonnegative_i64_to_u64(details.reasoning_tokens)); - } - self.push_payload(EpiphanyOpenAiStreamPayload::Completed { receipt }); - } - - fn seed_tool_call_from_item(&mut self, item: &Value) { - let Some(kind) = item_type(item) else { - return; - }; - if kind != "function_call" && kind != "custom_tool_call" { - return; - } - let Some(item_id) = item_identity(item) else { - return; - }; - let pending = self.pending_tool_calls.entry(item_id.clone()).or_default(); - if pending.call_id.is_none() { - pending.call_id = item_call_id(item).or(Some(item_id)); - } - if pending.name.is_none() { - pending.name = item_name(item); - } - if pending.arguments.is_empty() - && let Some(arguments) = item_arguments(item) - { - pending.arguments = arguments; - } - } - - fn push_tool_call_from_done_item(&mut self, item: &Value) { - let Some(kind) = item_type(item) else { - return; - }; - if kind != "function_call" && kind != "custom_tool_call" { - return; - } - let item_id = item_identity(item); - let pending = item_id - .as_ref() - .and_then(|id| self.pending_tool_calls.remove(id)) - .unwrap_or_default(); - let Some(name) = item_name(item).or(pending.name) else { - return; - }; - let Some(call_id) = item_call_id(item).or(pending.call_id).or(item_id) else { - return; - }; - let arguments = item_arguments(item).unwrap_or(pending.arguments); - self.push_payload(EpiphanyOpenAiStreamPayload::ToolCall { - call_id, - name, - arguments, - }); - } - - fn push_failed(&mut self, message: String) { - self.push_payload(EpiphanyOpenAiStreamPayload::Failed { message }); - self.completed = true; - } - - fn push_payload(&mut self, payload: EpiphanyOpenAiStreamPayload) { - self.events.push(EpiphanyOpenAiStreamEvent { - request_id: self.request_id.clone(), - sequence: self.sequence, - payload, - }); - self.sequence += 1; - } -} - -fn item_type(item: &Value) -> Option<&str> { - item.get("type").and_then(Value::as_str) -} - -fn item_identity(item: &Value) -> Option { - item.get("id") - .and_then(Value::as_str) - .or_else(|| item.get("item_id").and_then(Value::as_str)) - .or_else(|| item.get("call_id").and_then(Value::as_str)) - .map(ToString::to_string) -} - -fn item_call_id(item: &Value) -> Option { - item.get("call_id") - .and_then(Value::as_str) - .map(ToString::to_string) -} - -fn item_name(item: &Value) -> Option { - item.get("name") - .and_then(Value::as_str) - .map(ToString::to_string) -} - -fn item_arguments(item: &Value) -> Option { - item.get("arguments") - .or_else(|| item.get("input")) - .and_then(Value::as_str) - .map(ToString::to_string) -} - -fn parse_reasoning_effort(value: Option<&str>) -> Result> { - match value { - None => Ok(None), - Some("none" | "minimal" | "low" | "medium" | "high" | "xhigh") => { - Ok(value.map(ToString::to_string)) - } - Some(other) => anyhow::bail!("invalid reasoning_effort: {other}"), - } -} - -fn parse_reasoning_summary(value: Option<&str>) -> Result> { - match value { - None => Ok(None), - Some("auto" | "concise" | "detailed" | "none") => Ok(value.map(ToString::to_string)), - Some(other) => anyhow::bail!("invalid reasoning_summary: {other}"), - } -} - -fn parse_service_tier(value: Option<&str>) -> Result> { - match value { - None => Ok(None), - Some("fast" | "flex") => Ok(value.map(ToString::to_string)), - Some(other) => anyhow::bail!("invalid service_tier: {other}"), - } -} - -fn nonnegative_i64_to_u64(value: i64) -> Option { - u64::try_from(value).ok() -} - -fn default_base_url_for_auth(auth: &CodexAuth) -> &'static str { - if auth.uses_codex_backend() { - CHATGPT_CODEX_BASE_URL - } else { - OPENAI_API_BASE_URL - } -} - -fn attach_codex_auth_headers( - auth: &CodexAuth, - headers: &mut http::HeaderMap, -) -> std::io::Result<()> { - let token = auth.get_token()?; - let value = format!("Bearer {token}"); - if let Ok(value) = value.parse() { - headers.insert(http::header::AUTHORIZATION, value); - } - if let Some(account_id) = auth.get_account_id() - && let Ok(value) = account_id.parse() - { - headers.insert("ChatGPT-Account-ID", value); - } - if auth.is_fedramp_account() { - headers.insert("X-OpenAI-Fedramp", "true".parse().expect("valid header")); - } - Ok(()) -} - -fn attach_optional_env_header(headers: &mut http::HeaderMap, name: &'static str, env_key: &str) { - let Ok(value) = std::env::var(env_key) else { - return; - }; - let value = value.trim(); - if value.is_empty() { - return; - } - if let Ok(value) = value.parse() { - headers.insert(name, value); - } -} - -fn response_error_message(response: Option<&Value>) -> String { - response - .and_then(|response| response.get("error")) - .and_then(|error| error.get("message")) - .and_then(Value::as_str) - .or_else(|| { - response - .and_then(|response| response.get("incomplete_details")) - .and_then(|details| details.get("reason")) - .and_then(Value::as_str) - }) - .unwrap_or("Responses stream failed") - .to_string() -} - -fn transport_error_to_anyhow(err: TransportError) -> anyhow::Error { - anyhow::anyhow!("failed to open provider transport: {err}") -} - -#[cfg(test)] -mod tests { - use super::*; - - fn openrouter_request( - request_id: &str, - conversation_id: &str, - instructions: &str, - ) -> EpiphanyOpenAiModelRequest { - let mut request = EpiphanyOpenAiModelRequest::new( - request_id, - conversation_id, - "stealth/ox-alpha", - instructions, - ); - request.provider_id = "openrouter".to_string(); - request.wire_dialect = EpiphanyOpenAiWireDialect::ChatCompletionsTerminalTool; - request - } - - #[test] - fn openrouter_whole_request_timeout_is_explicit() -> Result<()> { - let bounded = EpiphanyOpenRouterTransport::new("test-key", Some(Duration::from_secs(90)))?; - assert_eq!(bounded.request_timeout, Some(Duration::from_secs(90))); - let outer_budget_owned = EpiphanyOpenRouterTransport::new("test-key", None)?; - assert_eq!(outer_budget_owned.request_timeout, None); - assert!(EpiphanyOpenRouterTransport::new("test-key", Some(Duration::ZERO)).is_err()); - Ok(()) - } - - #[test] - fn openrouter_terminal_tool_owns_typed_output_instead_of_response_format() { - let mut request = openrouter_request( - "req-terminal", - "conversation-terminal", - "Return the typed result.", - ); - request.input.push(EpiphanyOpenAiInputItem::UserText { - text: "Decide.".to_string(), - }); - request.output_schema_json = Some( - serde_json::json!({ - "type": "object", - "additionalProperties": false, - "properties": {"status": {"type": "string", "enum": ["ok"]}}, - "required": ["status"] - }) - .to_string(), - ); - - let body = chat_completions_body_from_epiphany(&request).expect("request should map"); - - assert!(body.get("response_format").is_none()); - assert_eq!(body["tool_choice"], "required"); - assert_eq!(body["tools"].as_array().expect("tools").len(), 1); - assert_eq!( - body["tools"][0]["function"]["name"], - OPENROUTER_TERMINAL_TOOL_NAME - ); - assert_eq!( - body["tools"][0]["function"]["parameters"]["properties"]["status"]["enum"][0], - "ok" - ); - } - - #[test] - fn openrouter_requires_source_sight_before_exposing_terminal_decision() { - let mut request = - openrouter_request("req-tools", "conversation-tools", "Inspect, then decide."); - request.input.push(EpiphanyOpenAiInputItem::UserText { - text: "Inspect the source.".to_string(), - }); - request - .tools - .push(epiphany_openai_adapter::EpiphanyOpenAiToolDefinition { - name: "mcp__epiphany_source__read_file".to_string(), - description: "Read a file.".to_string(), - parameters_json: serde_json::json!({ - "type": "object", - "additionalProperties": false, - "properties": {"path": {"type": "string"}}, - "required": ["path"] - }) - .to_string(), - }); - request.output_schema_json = Some( - serde_json::json!({ - "type": "object", - "additionalProperties": false, - "properties": {"status": {"type": "string"}}, - "required": ["status"] - }) - .to_string(), - ); - - let initial = chat_completions_body_from_epiphany(&request).expect("initial request"); - assert_eq!(initial["tool_choice"], "required"); - assert_eq!(initial["tools"].as_array().expect("tools").len(), 1); - assert_eq!( - initial["tools"][0]["function"]["name"], - "mcp__epiphany_source__read_file" - ); - - request.input.push(EpiphanyOpenAiInputItem::ToolCall { - call_id: "call-1".to_string(), - name: "mcp__epiphany_source__read_file".to_string(), - arguments: r#"{"path":"README.md"}"#.to_string(), - }); - request.input.push(EpiphanyOpenAiInputItem::ToolResult { - call_id: "call-1".to_string(), - output: r#"{"ok":true}"#.to_string(), - }); - let followup = chat_completions_body_from_epiphany(&request).expect("followup request"); - assert_eq!(followup["tool_choice"], "required"); - assert_eq!(followup["tools"].as_array().expect("tools").len(), 2); - assert_eq!( - followup["tools"][1]["function"]["name"], - OPENROUTER_TERMINAL_TOOL_NAME - ); - assert_eq!(followup["messages"][2]["tool_calls"][0]["id"], "call-1"); - assert_eq!(followup["messages"][3]["tool_call_id"], "call-1"); - } - - #[test] - fn openrouter_terminal_call_becomes_exact_assistant_json() { - let request = openrouter_request( - "req-terminal-events", - "conversation-terminal-events", - "Return the typed result.", - ); - let response = OpenRouterChatCompletionResponse { - id: Some("generation-1".to_string()), - model: Some("stealth/ox-alpha".to_string()), - choices: vec![OpenRouterChatChoice { - message: OpenRouterChatMessage { - content: None, - reasoning: None, - tool_calls: vec![OpenRouterChatToolCall { - id: "call-terminal".to_string(), - function: OpenRouterChatFunctionCall { - name: OPENROUTER_TERMINAL_TOOL_NAME.to_string(), - arguments: r#"{"status":"ok"}"#.to_string(), - }, - }], - }, - }], - usage: Some(OpenRouterChatUsage { - prompt_tokens: Some(12), - completion_tokens: Some(3), - completion_tokens_details: Some(OpenRouterCompletionTokenDetails { - reasoning_tokens: Some(1), - }), - }), - }; - - let events = openrouter_events_from_chat_completion(&request, response) - .expect("response should normalize"); - assert!(matches!( - &events[0].payload, - EpiphanyOpenAiStreamPayload::TextDelta { text } - if text == r#"{"status":"ok"}"# - )); - assert!(matches!( - &events[1].payload, - EpiphanyOpenAiStreamPayload::Completed { receipt } - if receipt.transport.as_deref() == Some("openrouter-chat-completions") - && receipt.input_tokens == Some(12) - && receipt.reasoning_output_tokens == Some(1) - )); - } - - #[test] - fn maps_typed_request_to_responses_body_without_codex_protocol_payload() { - let mut request = EpiphanyOpenAiModelRequest::new( - "req-1", - "conversation-1", - "gpt-5.4", - "Answer plainly.", - ); - request.input.push(EpiphanyOpenAiInputItem::UserText { - text: "hello".to_string(), - }); - request.input.push(EpiphanyOpenAiInputItem::ToolCall { - call_id: "call-1".to_string(), - name: "mcp__epiphany_source__read_file".to_string(), - arguments: "{\"path\":\"README.md\"}".to_string(), - }); - request.input.push(EpiphanyOpenAiInputItem::ToolResult { - call_id: "call-1".to_string(), - output: "{\"ok\":true}".to_string(), - }); - request.reasoning_effort = Some("low".to_string()); - request.reasoning_summary = Some("concise".to_string()); - request.service_tier = Some("flex".to_string()); - request.previous_response_id = Some("resp-1".to_string()); - request - .tools - .push(epiphany_openai_adapter::EpiphanyOpenAiToolDefinition { - name: "mcp__epiphany_source__read_file".to_string(), - description: "Read a bounded file slice.".to_string(), - parameters_json: serde_json::json!({ - "type": "object", - "properties": {"path": {"type": "string"}}, - "required": ["path"] - }) - .to_string(), - }); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - - assert_eq!(responses["model"], "gpt-5.4"); - assert_eq!(responses["instructions"], "Answer plainly."); - assert_eq!(responses["previous_response_id"], "resp-1"); - assert_eq!(responses["input"][0]["content"][0]["type"], "input_text"); - assert_eq!(responses["input"][1]["type"], "function_call"); - assert_eq!( - responses["input"][1]["name"], - "mcp__epiphany_source__read_file" - ); - assert_eq!(responses["input"][2]["type"], "function_call_output"); - assert_eq!(responses["stream"], true); - assert_eq!(responses["store"], false); - assert_eq!(responses["service_tier"], "flex"); - assert_eq!(responses["tools"].as_array().expect("tools").len(), 1); - assert_eq!( - responses["tools"][0]["name"], - "mcp__epiphany_source__read_file" - ); - assert_eq!(responses["tool_choice"], "auto"); - } - - #[test] - fn responses_call_ids_are_one_shared_bounded_transport_projection() { - assert_eq!(responses_call_id("call-1"), "call-1"); - - let internal_call_id = "call-requested-public-source-3d04d447ac7eb759245b7c732c2942465f78611c7a3b1716169a92582f1361ae"; - let alias = responses_call_id(internal_call_id); - assert!(alias.is_ascii()); - assert_eq!(alias.len(), RESPONSES_CALL_ID_MAX_BYTES); - assert_eq!(alias, responses_call_id(internal_call_id)); - assert_ne!( - alias, - responses_call_id( - "call-requested-public-source-3d04d447ac7eb759245b7c732c2942465f78611c7a3b1716169a92582f1361af" - ) - ); - - let mut request = EpiphanyOpenAiModelRequest::new( - "req-long-call-id", - "conversation-long-call-id", - "gpt-5.4", - "Use the supplied evidence.", - ); - request.input.push(EpiphanyOpenAiInputItem::ToolCall { - call_id: internal_call_id.to_string(), - name: "github_file".to_string(), - arguments: "{}".to_string(), - }); - request.input.push(EpiphanyOpenAiInputItem::ToolResult { - call_id: internal_call_id.to_string(), - output: "evidence".to_string(), - }); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - assert_eq!(responses["input"][0]["call_id"], alias); - assert_eq!(responses["input"][1]["call_id"], alias); - } - - #[test] - fn tool_bearing_initial_request_requires_one_tool_call() { - let mut request = EpiphanyOpenAiModelRequest::new( - "req-1", - "conversation-1", - "gpt-5.4", - "Inspect before answering.", - ); - request.input.push(EpiphanyOpenAiInputItem::UserText { - text: "verify".to_string(), - }); - request - .tools - .push(epiphany_openai_adapter::EpiphanyOpenAiToolDefinition { - name: "mcp__epiphany_source__read_file".to_string(), - description: "Read a bounded file slice.".to_string(), - parameters_json: serde_json::json!({ - "type": "object", - "properties": {"path": {"type": "string"}}, - "required": ["path"] - }) - .to_string(), - }); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - - assert_eq!(responses["tool_choice"], "required"); - assert_eq!(responses["tools"][0]["strict"], true); - assert_eq!( - responses["tools"][0]["parameters"]["additionalProperties"], - false - ); - } - - #[test] - fn declared_output_schema_reaches_responses_text_format() { - let mut request = EpiphanyOpenAiModelRequest::new( - "req-schema", - "conversation-schema", - "gpt-5.4", - "Return the typed result.", - ); - request.output_contract_id = Some("epiphany.role_worker_output.v3".to_string()); - request.output_schema_json = Some( - serde_json::json!({ - "type": "object", - "additionalProperties": false, - "properties": {"summary": {"type": "string"}}, - "required": ["summary"] - }) - .to_string(), - ); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - - assert_eq!(responses["text"]["format"]["type"], "json_schema"); - assert_eq!( - responses["text"]["format"]["name"], - "epiphany_role_worker_output_v3" - ); - assert_eq!(responses["text"]["format"]["strict"], true); - assert_eq!( - responses["text"]["format"]["schema"]["required"][0], - "summary" - ); - } - - #[test] - fn provider_schema_projection_drops_conditional_authority_only() { - let mut request = EpiphanyOpenAiModelRequest::new( - "req-conditional", - "conversation-conditional", - "gpt-5.4", - "Return the typed result.", - ); - request.output_contract_id = Some("epiphany.worker".to_string()); - request.output_schema_json = Some( - serde_json::json!({ - "type": "object", - "properties": { - "purpose": { - "oneOf": [ - {"type": "string", "const": "evolution"}, - {"type": "string", "const": "repair"} - ] - } - }, - "allOf": [{"if": {"properties": {"purpose": {"const": "repair"}}}, "then": {"required": ["receipt"]}}] - }) - .to_string(), - ); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - let schema = &responses["text"]["format"]["schema"]; - assert_eq!(responses["text"]["format"]["strict"], true); - assert!(schema.get("allOf").is_none()); - assert!(schema["properties"]["purpose"].get("oneOf").is_none()); - assert!(schema["properties"]["purpose"]["anyOf"].is_array()); - assert_eq!(schema["additionalProperties"], false); - assert_eq!(schema["required"], serde_json::json!(["purpose"])); - } - - #[test] - fn provider_schema_projection_drops_parent_relative_presence_alternatives() { - let mut request = EpiphanyOpenAiModelRequest::new( - "req-object-presence", - "conversation-object-presence", - "gpt-5.4", - "Return the typed result.", - ); - request.output_contract_id = Some("epiphany.worker".to_string()); - request.output_schema_json = Some( - serde_json::json!({ - "type": "object", - "properties": { - "statePatch": { - "type": "object", - "properties": { - "scratch": { - "type": "object", - "properties": {"summary": {"type": "string"}}, - "required": ["summary"] - }, - "investigationCheckpoint": { - "type": "object", - "properties": {"focus": {"type": "string"}}, - "required": ["focus"] - } - }, - "anyOf": [ - {"required": ["scratch"]}, - {"required": ["investigationCheckpoint"]} - ] - } - }, - "required": ["statePatch"] - }) - .to_string(), - ); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - let state_patch = &responses["text"]["format"]["schema"]["properties"]["statePatch"]; - assert!(state_patch.get("anyOf").is_none()); - assert_eq!(state_patch["additionalProperties"], false); - assert_eq!( - state_patch["required"], - serde_json::json!(["investigationCheckpoint", "scratch"]) - ); - assert_eq!( - state_patch["properties"]["scratch"]["anyOf"][0]["additionalProperties"], - false - ); - assert_eq!( - state_patch["properties"]["investigationCheckpoint"]["anyOf"][0]["additionalProperties"], - false - ); - } - - #[test] - fn provider_schema_projection_types_literals_and_drops_parent_property_refinements() { - let mut request = EpiphanyOpenAiModelRequest::new( - "req-literal-types", - "conversation-literal-types", - "gpt-5.4", - "Return the typed result.", - ); - request.output_contract_id = Some("epiphany.worker".to_string()); - request.output_schema_json = Some( - serde_json::json!({ - "type": "object", - "required": ["schemaVersion", "effects", "source_refs", "format", "claim_id", "node"], - "properties": { - "schemaVersion": {"const": "epiphany.test.v0"}, - "effects": { - "type": "array", - "items": { - "oneOf": [{ - "type": "object", - "required": ["kind", "memory_kind"], - "properties": { - "kind": {"const": "state_note"}, - "memory_kind": {"enum": ["memory", "social_read", "bond"]} - }, - "additionalProperties": false - }] - } - }, - "source_refs": { - "type": "array", - "minItems": 1, - "maxItems": 8, - "uniqueItems": true, - "items": { - "type": "string", - "minLength": 1, - "pattern": "^source:" - } - }, - "format": { - "type": "string", - "format": "uri" - }, - "claim_id": { - "type": "string", - "format": "uuid" - }, - "node": { - "type": "object", - "required": ["question", "tension"], - "properties": { - "question": {"type": "string"}, - "tension": {"type": "string"} - }, - "anyOf": [ - {"properties": {"question": {"minLength": 1}}}, - {"properties": {"tension": {"minLength": 1}}} - ], - "additionalProperties": false - } - }, - "additionalProperties": false - }) - .to_string(), - ); - - let responses = responses_body_from_epiphany(request).expect("request should map"); - let schema = &responses["text"]["format"]["schema"]; - assert_eq!(schema["properties"]["schemaVersion"]["type"], "string"); - assert_eq!( - schema["properties"]["effects"]["items"]["anyOf"][0]["properties"]["kind"]["type"], - "string" - ); - assert_eq!( - schema["properties"]["effects"]["items"]["anyOf"][0]["properties"]["memory_kind"]["type"], - "string" - ); - let source_refs = &schema["properties"]["source_refs"]; - assert_eq!(source_refs["minItems"], 1); - assert_eq!(source_refs["maxItems"], 8); - assert!(source_refs.get("uniqueItems").is_none()); - assert_eq!(source_refs["items"]["minLength"], 1); - assert_eq!(source_refs["items"]["pattern"], "^source:"); - assert_eq!(schema["properties"]["format"]["type"], "string"); - assert_eq!(schema["properties"]["format"]["format"], "uri"); - assert!(schema["properties"]["claim_id"].get("format").is_none()); - assert_eq!( - schema["properties"]["claim_id"]["pattern"], - "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" - ); - assert!(schema["properties"]["node"].get("anyOf").is_none()); - } - - #[test] - fn strict_schema_check_recognizes_required_only_object_fragments() { - assert!(!responses_schema_is_strict(&serde_json::json!({ - "anyOf": [{"required": ["scratch"]}, {"required": ["checkpoint"]}] - }))); - assert!(!responses_schema_is_strict(&serde_json::json!({ - "const": "state_note" - }))); - assert!(!responses_schema_is_strict(&serde_json::json!({ - "enum": ["memory", "social_read", "bond"] - }))); - } - - #[test] - fn parses_function_call_output_item_done_as_complete_tool_call() { - let mut state = EpiphanyResponsesStreamState::new("req-tools", "gpt-5.4"); - state.push_sse_frame( - &serde_json::json!({ - "type": "response.output_item.done", - "item": { - "id": "fc_1", - "type": "function_call", - "name": "mcp__epiphany_source__read_file", - "arguments": "{\"path\":\"README.md\"}", - "call_id": "call_1" - } - }) - .to_string(), - ); - - assert_eq!(state.events.len(), 1); - assert_eq!( - state.events[0].payload, - EpiphanyOpenAiStreamPayload::ToolCall { - call_id: "call_1".to_string(), - name: "mcp__epiphany_source__read_file".to_string(), - arguments: "{\"path\":\"README.md\"}".to_string(), - } - ); - } - - #[test] - fn assembles_function_call_argument_deltas_until_output_item_done() { - let mut state = EpiphanyResponsesStreamState::new("req-tools", "gpt-5.4"); - state.push_sse_frame( - &serde_json::json!({ - "type": "response.output_item.added", - "item": { - "id": "fc_1", - "type": "function_call", - "name": "mcp__epiphany_source__git_show", - "call_id": "call_1", - "arguments": "" - } - }) - .to_string(), - ); - state.push_sse_frame( - &serde_json::json!({ - "type": "response.function_call_arguments.delta", - "item_id": "fc_1", - "call_id": "call_1", - "delta": "{\"revision\":" - }) - .to_string(), - ); - state.push_sse_frame( - &serde_json::json!({ - "type": "response.function_call_arguments.delta", - "item_id": "fc_1", - "call_id": "call_1", - "delta": "\"HEAD\"}" - }) - .to_string(), - ); - state.push_sse_frame( - &serde_json::json!({ - "type": "response.output_item.done", - "item": { - "id": "fc_1", - "type": "function_call", - "name": "mcp__epiphany_source__git_show", - "call_id": "call_1" - } - }) - .to_string(), - ); - - assert_eq!(state.events.len(), 1); - assert_eq!( - state.events[0].payload, - EpiphanyOpenAiStreamPayload::ToolCall { - call_id: "call_1".to_string(), - name: "mcp__epiphany_source__git_show".to_string(), - arguments: "{\"revision\":\"HEAD\"}".to_string(), - } - ); - } -} diff --git a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs index 703902b7..c9483c69 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs @@ -1,5 +1,6 @@ use std::env; use std::fs; +use std::net::SocketAddr; use std::path::Path; use std::path::PathBuf; use std::process; @@ -20,7 +21,7 @@ use epiphany_openai_adapter::{ EpiphanyOpenAiModelReceipt, EpiphanyOpenAiModelRequest, EpiphanyOpenAiStreamEvent, EpiphanyOpenAiStreamPayload, }; -use epiphany_openai_codex_spine::default_codex_home; +use epiphany_openai_runtime::DEFAULT_CODEX_CONNECTOR_ENDPOINT; use epiphany_openai_runtime::DEFAULT_PROVIDER_REQUEST_TIMEOUT; use epiphany_openai_runtime::EpiphanyOpenAiRuntimeOptions; #[cfg(test)] @@ -179,8 +180,9 @@ async fn main() -> Result<()> { struct RunWorkerCliOptions { provider: String, store_path: PathBuf, - codex_home: PathBuf, provider_credential_path: Option, + connector_endpoint: SocketAddr, + caller_runtime_id: String, mcp_config: Option, job_id: String, model: String, @@ -195,8 +197,9 @@ struct RunWorkerCliOptions { fn parse_run_worker_options(args: Vec) -> Result { let mut provider = DEFAULT_PROVIDER.to_string(); let mut store_path = PathBuf::from(DEFAULT_STORE); - let mut codex_home = default_codex_home()?; let mut provider_credential_path = None; + let mut connector_endpoint = DEFAULT_CODEX_CONNECTOR_ENDPOINT; + let mut caller_runtime_id = "epiphany-model-runtime".to_string(); let mut mcp_config = None; let mut job_id = None; let mut model = default_worker_model(); @@ -211,13 +214,18 @@ fn parse_run_worker_options(args: Vec) -> Result { match arg.as_str() { "--provider" => provider = next_value(&mut iter, "--provider")?, "--store" => store_path = PathBuf::from(next_value(&mut iter, "--store")?), - "--codex-home" => codex_home = PathBuf::from(next_value(&mut iter, "--codex-home")?), "--provider-credential" => { provider_credential_path = Some(PathBuf::from(next_value( &mut iter, "--provider-credential", )?)) } + "--connector-endpoint" => { + connector_endpoint = next_value(&mut iter, "--connector-endpoint")?.parse()? + } + "--caller-runtime-id" => { + caller_runtime_id = next_value(&mut iter, "--caller-runtime-id")? + } "--mcp-config" => { mcp_config = Some(PathBuf::from(next_value(&mut iter, "--mcp-config")?)) } @@ -245,8 +253,9 @@ fn parse_run_worker_options(args: Vec) -> Result { Ok(RunWorkerCliOptions { provider, store_path, - codex_home, provider_credential_path, + connector_endpoint, + caller_runtime_id, mcp_config, job_id: job_id.context("run-worker requires --job-id")?, model, @@ -482,8 +491,9 @@ async fn run_worker_launch( )?; let openai_options = EpiphanyOpenAiRuntimeOptions { store_path: options.store_path.clone(), - codex_home: options.codex_home.clone(), provider_credential_path: options.provider_credential_path.clone(), + connector_endpoint: Some(options.connector_endpoint), + caller_runtime_id: options.caller_runtime_id.clone(), session_id: worker_model_session_id(&launch_request.job_id), job_id: format!("openai-worker-{}", launch_request.job_id), objective: format!( @@ -910,6 +920,121 @@ mod tests { Ok(()) } + #[test] + fn codex_connector_projection_is_one_strict_deterministic_request() -> Result<()> { + let mut request = EpiphanyOpenAiModelRequest::new( + "connector-request", + "connector-conversation", + "gpt-test", + "Decide.", + ); + request.output_contract_id = Some("role/result.v1".into()); + request.output_schema_json = Some( + r#"{"type":"object","properties":{"verdict":{"const":"pass"}},"required":["verdict"]}"# + .into(), + ); + request + .tools + .push(epiphany_openai_adapter::EpiphanyOpenAiToolDefinition { + name: "inspect_body".into(), + description: "Inspect the typed Body.".into(), + parameters_json: + r#"{"type":"object","properties":{"path":{"type":"string"}},"required":["path"]}"# + .into(), + }); + request + .input + .push(epiphany_openai_adapter::EpiphanyOpenAiInputItem::ToolCall { + call_id: "native/call".into(), + name: "inspect_body".into(), + arguments: r#"{"path":"src/lib.rs"}"#.into(), + }); + request.input.push( + epiphany_openai_adapter::EpiphanyOpenAiInputItem::ToolResult { + call_id: "native/call".into(), + output: r#"{"ok":true}"#.into(), + }, + ); + + let projected = provider_transport::codex_request_from_epiphany(request)?; + assert_eq!( + projected.output_format_name.as_deref(), + Some("role_result_v1") + ); + assert_eq!( + projected.tool_choice, + codex_connector::CodexToolChoice::Auto + ); + let (call, result) = (&projected.input[0], &projected.input[1]); + let codex_connector::CodexInputItem::ToolCall { call_id, .. } = call else { + panic!("first input must remain a tool call") + }; + let codex_connector::CodexInputItem::ToolResult { + call_id: result_id, .. + } = result + else { + panic!("second input must remain a tool result") + }; + assert_eq!(call_id, result_id); + assert_ne!(call_id, "native/call"); + assert_eq!(call_id.len(), 64); + assert_eq!( + serde_json::from_str::( + projected.output_schema_json.as_deref().unwrap() + )?["properties"]["verdict"]["type"], + "string" + ); + Ok(()) + } + + #[test] + fn connector_receipt_digests_survive_without_transport_transcript() -> Result<()> { + let result = codex_connector::CodexTransportResult { + schema_id: codex_connector::RESULT_SCHEMA_ID.into(), + request_id: "connector-request".into(), + caller_runtime_id: "epiphany-test".into(), + disposition: codex_connector::CodexTransportDisposition::Transported { + events: Vec::new(), + receipt: Box::new(codex_connector::CodexTransportReceipt { + schema_id: codex_connector::RECEIPT_SCHEMA_ID.into(), + request_id: "connector-request".into(), + caller_runtime_id: "epiphany-test".into(), + native_request_sha256: [0x11; 32], + provider_request_sha256: [0x22; 32], + model: "gpt-test".into(), + transport: "fake-connector".into(), + outcome: codex_connector::CodexTransportOutcome::Completed { + provider_response_id: Some("response".into()), + input_tokens: Some(10), + output_tokens: Some(4), + reasoning_output_tokens: Some(2), + cached_input_tokens: Some(6), + }, + }), + }, + }; + + let events = provider_transport::events_from_connector_result(result)?; + assert_eq!(events.len(), 1); + let EpiphanyOpenAiStreamPayload::Completed { receipt } = &events[0].payload else { + panic!("connector result must produce one terminal receipt") + }; + let native_digest = "11".repeat(32); + let provider_digest = "22".repeat(32); + assert_eq!(receipt.caller_runtime_id.as_deref(), Some("epiphany-test")); + assert_eq!( + receipt.native_request_sha256.as_deref(), + Some(native_digest.as_str()) + ); + assert_eq!( + receipt.provider_request_sha256.as_deref(), + Some(provider_digest.as_str()) + ); + assert_eq!(receipt.cached_input_tokens, Some(6)); + assert_eq!(receipt.transport.as_deref(), Some("fake-connector")); + Ok(()) + } + #[test] fn every_static_worker_contract_projects_to_one_strict_provider_shape() -> Result<()> { let schemas = vec![ @@ -942,8 +1067,10 @@ mod tests { ); request.output_contract_id = Some(format!("worker-schema-{index}")); request.output_schema_json = Some(serde_json::to_string(&schema)?); - let body = epiphany_openai_codex_spine::responses_body_from_epiphany(request)?; - assert_eq!(body["text"]["format"]["strict"], true); + let projected = epiphany_openai_adapter::strict_provider_schema( + request.output_schema_json.as_deref().unwrap(), + )?; + assert_eq!(projected["additionalProperties"], false); } Ok(()) } @@ -964,8 +1091,10 @@ mod tests { ), )?); - let body = epiphany_openai_codex_spine::responses_body_from_epiphany(request)?; - let decision = &body["text"]["format"]["schema"]["properties"]["researchDecision"]; + let projected = epiphany_openai_adapter::strict_provider_schema( + request.output_schema_json.as_deref().unwrap(), + )?; + let decision = &projected["properties"]["researchDecision"]; assert!(decision.get("anyOf").is_none()); assert_eq!(decision["additionalProperties"], false); assert_eq!( @@ -1034,8 +1163,9 @@ mod tests { store, &EpiphanyOpenAiRuntimeOptions { store_path: store.to_path_buf(), - codex_home: PathBuf::from(".codex"), provider_credential_path: None, + connector_endpoint: Some(DEFAULT_CODEX_CONNECTOR_ENDPOINT), + caller_runtime_id: "epiphany-model-runtime-test".to_string(), session_id, job_id, objective: format!("Run model execution for {worker_job_id}."), @@ -1057,7 +1187,9 @@ mod tests { EpiphanyOpenAiStreamEvent { request_id: request_id.to_string(), sequence: 1, - payload: EpiphanyOpenAiStreamPayload::Completed { receipt }, + payload: EpiphanyOpenAiStreamPayload::Completed { + receipt: Box::new(receipt), + }, }, ], ) @@ -1542,5 +1674,5 @@ fn now() -> String { } fn usage() -> &'static str { - "usage: epiphany-model-runtime [--provider openai-codex|openrouter] [--provider-credential path] [--store path] [--codex-home path] [--context-id id] [--output path] [--job-id id] [--activation-token-sha256 hex] [--default-model model] --tool-adapter-bin path [--mcp-config path] [--cwd path] [--max-tool-rounds n]" + "usage: epiphany-model-runtime [--provider openai-codex|openrouter] [--provider-credential path] [--connector-endpoint 127.0.0.1:17891] [--caller-runtime-id id] [--store path] [--context-id id] [--output path] [--job-id id] [--activation-token-sha256 hex] [--default-model model] --tool-adapter-bin path [--mcp-config path] [--cwd path] [--max-tool-rounds n]" } diff --git a/epiphany-openai-runtime/src/bin/epiphany-persona-service.rs b/epiphany-openai-runtime/src/bin/epiphany-persona-service.rs index 691de1ba..ef1ec32c 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-persona-service.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-persona-service.rs @@ -19,8 +19,8 @@ use epiphany_core::{ }; use epiphany_model_adapter::EpiphanyModelRequest; use epiphany_openai_runtime::{ - EpiphanyOpenAiRuntimeOptions, PersonaModelExecutionPlan, PersonaModelRunner, - assistant_text_from_model_events, execute_persona_model_turn, + DEFAULT_CODEX_CONNECTOR_ENDPOINT, EpiphanyOpenAiRuntimeOptions, PersonaModelExecutionPlan, + PersonaModelRunner, assistant_text_from_model_events, execute_persona_model_turn, }; #[path = "../provider_transport.rs"] @@ -29,8 +29,9 @@ mod provider_transport; #[derive(Clone, Debug)] struct NativePersonaModelRunner { store_path: PathBuf, - codex_home: PathBuf, provider_credential_path: Option, + connector_endpoint: SocketAddr, + caller_runtime_id: String, provider: String, model: String, turn_timeout: Duration, @@ -54,8 +55,9 @@ impl PersonaModelRunner for NativePersonaModelRunner { } let options = EpiphanyOpenAiRuntimeOptions { store_path: self.store_path.clone(), - codex_home: self.codex_home.clone(), provider_credential_path: self.provider_credential_path.clone(), + connector_endpoint: Some(self.connector_endpoint), + caller_runtime_id: self.caller_runtime_id.clone(), session_id: format!("persona-turn-{turn_id}"), job_id: format!("persona-{stage}-{turn_id}"), objective: format!("Run Persona {stage} stage for {turn_id}"), @@ -173,8 +175,9 @@ async fn poll_once(options: &Options) -> Result { )?; let mut runner = NativePersonaModelRunner { store_path: options.runtime_store.clone(), - codex_home: options.codex_home.clone(), provider_credential_path: options.provider_credential_path.clone(), + connector_endpoint: options.connector_endpoint, + caller_runtime_id: options.runtime_id.clone(), provider: options.provider.clone(), model: options.model.clone(), turn_timeout: Duration::from_secs(options.turn_timeout_seconds), @@ -365,8 +368,8 @@ struct Options { runtime_store: PathBuf, social_store: PathBuf, cultmesh_store: PathBuf, - codex_home: PathBuf, provider_credential_path: Option, + connector_endpoint: SocketAddr, runtime_id: String, provider: String, model: String, @@ -412,8 +415,14 @@ impl Options { runtime_store: path("--runtime-store")?, social_store: path("--persona-social-store")?, cultmesh_store: path("--cultmesh-store")?, - codex_home: path("--codex-home")?, provider_credential_path: values.get("--provider-credential").map(PathBuf::from), + connector_endpoint: value( + &values, + "--connector-endpoint", + &DEFAULT_CODEX_CONNECTOR_ENDPOINT.to_string(), + ) + .parse() + .context("--connector-endpoint must be an IP:port socket address")?, _repo_root: path("--repo-root")?, mouth_request_store: path("--mouth-request-store")?, mouth_receipt_store: path("--mouth-receipt-store")?, @@ -511,8 +520,8 @@ mod tests { runtime_store: runtime_store.clone(), social_store: absent.join("persona-social.cc"), cultmesh_store: absent.join("cultmesh.cc"), - codex_home: absent.join("codex-home"), provider_credential_path: None, + connector_endpoint: DEFAULT_CODEX_CONNECTOR_ENDPOINT, runtime_id: "persona-reentry".into(), provider: "test".into(), model: "test-model".into(), diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index 3d715244..511732a9 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -1,4 +1,5 @@ use std::collections::{BTreeMap, BTreeSet}; +use std::net::SocketAddr; use std::path::Path; use std::path::PathBuf; use std::time::Duration; @@ -51,6 +52,8 @@ pub const OPENAI_RUNTIME_ROLE: &str = "openai-model-adapter"; pub const DEFAULT_PROVIDER_REQUEST_TIMEOUT: Duration = Duration::from_secs(90); pub const DEFAULT_MODEL_PROVIDER: &str = "openai-codex"; pub const OPENROUTER_MODEL_PROVIDER: &str = "openrouter"; +pub const DEFAULT_CODEX_CONNECTOR_ENDPOINT: SocketAddr = + SocketAddr::new(std::net::IpAddr::V4(std::net::Ipv4Addr::LOCALHOST), 17891); fn validate_model_provider(provider: &str) -> Result<()> { match provider { @@ -68,8 +71,9 @@ pub fn worker_model_session_id(worker_job_id: &str) -> String { #[derive(Debug, Clone, PartialEq, Eq)] pub struct EpiphanyOpenAiRuntimeOptions { pub store_path: PathBuf, - pub codex_home: PathBuf, pub provider_credential_path: Option, + pub connector_endpoint: Option, + pub caller_runtime_id: String, pub session_id: String, pub job_id: String, pub objective: String, @@ -158,11 +162,11 @@ pub fn record_model_turn_events( &model_event, )?; if let EpiphanyModelStreamPayload::Completed { receipt } = &model_event.payload { - cache.put(model_receipt_key(&receipt.request_id), receipt)?; + cache.put(model_receipt_key(&receipt.request_id), receipt.as_ref())?; } match &event.payload { EpiphanyOpenAiStreamPayload::Completed { receipt: completed } => { - receipt = Some(completed.clone()); + receipt = Some(completed.as_ref().clone()); } EpiphanyOpenAiStreamPayload::Failed { message } => { failure = Some(message.clone()); @@ -821,13 +825,13 @@ pub fn append_requested_public_source_receipts( pub fn default_options( store_path: PathBuf, - codex_home: PathBuf, request: &EpiphanyOpenAiModelRequest, ) -> EpiphanyOpenAiRuntimeOptions { EpiphanyOpenAiRuntimeOptions { store_path, - codex_home, provider_credential_path: None, + connector_endpoint: Some(DEFAULT_CODEX_CONNECTOR_ENDPOINT), + caller_runtime_id: "epiphany-model-runtime".to_string(), session_id: format!("openai-session-{}", request.conversation_id), job_id: format!("openai-job-{}", request.request_id), objective: format!("Run typed OpenAI model request {}", request.request_id), @@ -961,7 +965,7 @@ pub fn model_event_from_openai_event( }, EpiphanyOpenAiStreamPayload::Completed { receipt } => { EpiphanyModelStreamPayload::Completed { - receipt: model_receipt_from_openai_receipt(provider, receipt), + receipt: Box::new(model_receipt_from_openai_receipt(provider, receipt)), } } EpiphanyOpenAiStreamPayload::Failed { message } => EpiphanyModelStreamPayload::Failed { @@ -985,6 +989,10 @@ pub fn model_receipt_from_openai_receipt( output_tokens: receipt.output_tokens, reasoning_output_tokens: receipt.reasoning_output_tokens, transport: receipt.transport.clone(), + caller_runtime_id: receipt.caller_runtime_id.clone(), + native_request_sha256: receipt.native_request_sha256.clone(), + provider_request_sha256: receipt.provider_request_sha256.clone(), + cached_input_tokens: receipt.cached_input_tokens, } } @@ -1591,48 +1599,47 @@ fn role_worker_result_from_ingress( } else { (None, None) }; - let (frontier_plan_candidate_msgpack, frontier_plan_candidate_error) = if let Some(ingress) = - result.frontier_plan_candidate.as_ref() - { - let mut safe_paths = clean_string_vec(&ingress.safe_paths); - safe_paths.sort(); - safe_paths.dedup(); - let mut candidate = epiphany_core::RepoFrontierPlanCandidate { - candidate_id: String::new(), - planning_request_id: frontier_planning_context - .map(|context| context.request_id.clone()) - .unwrap_or_default(), - model_projection_digest: frontier_planning_context - .map(|context| context.model_projection_digest.clone()) - .unwrap_or_default(), - model_source_documents: frontier_planning_context - .map(|context| context.model_source_documents.clone()) - .unwrap_or_default(), - frontier_item_id: frontier_planning_context - .map(|context| context.frontier_item_id.clone()) - .unwrap_or_default(), - frontier_item_hash: frontier_planning_context - .map(|context| context.frontier_item_hash.clone()) - .unwrap_or_default(), - safe_paths, - action: ingress.action.trim().to_string(), - command: ingress.command.trim().to_string(), - checks: clean_string_vec(&ingress.checks), - stop_conditions: clean_string_vec(&ingress.stop_conditions), - rollback_steps: clean_string_vec(&ingress.rollback_steps), - commit_message: ingress.commit_message.trim().to_string(), - proposed_at: completed_at.to_string(), - }; - match epiphany_core::canonical_repo_frontier_plan_candidate_id(&candidate) { - Ok(candidate_id) => { - candidate.candidate_id = candidate_id; - encode_optional_document(&Some(candidate), "frontierPlanCandidate") + let (frontier_plan_candidate_msgpack, frontier_plan_candidate_error) = + if let Some(ingress) = result.frontier_plan_candidate.as_ref() { + let mut safe_paths = clean_string_vec(&ingress.safe_paths); + safe_paths.sort(); + safe_paths.dedup(); + let mut candidate = epiphany_core::RepoFrontierPlanCandidate { + candidate_id: String::new(), + planning_request_id: frontier_planning_context + .map(|context| context.request_id.clone()) + .unwrap_or_default(), + model_projection_digest: frontier_planning_context + .map(|context| context.model_projection_digest.clone()) + .unwrap_or_default(), + model_source_documents: frontier_planning_context + .map(|context| context.model_source_documents.clone()) + .unwrap_or_default(), + frontier_item_id: frontier_planning_context + .map(|context| context.frontier_item_id.clone()) + .unwrap_or_default(), + frontier_item_hash: frontier_planning_context + .map(|context| context.frontier_item_hash.clone()) + .unwrap_or_default(), + safe_paths, + action: ingress.action.trim().to_string(), + command: ingress.command.trim().to_string(), + checks: clean_string_vec(&ingress.checks), + stop_conditions: clean_string_vec(&ingress.stop_conditions), + rollback_steps: clean_string_vec(&ingress.rollback_steps), + commit_message: ingress.commit_message.trim().to_string(), + proposed_at: completed_at.to_string(), + }; + match epiphany_core::canonical_repo_frontier_plan_candidate_id(&candidate) { + Ok(candidate_id) => { + candidate.candidate_id = candidate_id; + encode_optional_document(&Some(candidate), "frontierPlanCandidate") + } + Err(error) => (None, Some(format!("frontierPlanCandidate: {error}"))), } - Err(error) => (None, Some(format!("frontierPlanCandidate: {error}"))), - } - } else { - (None, None) - }; + } else { + (None, None) + }; let (frontier_plan_mind_decision_msgpack, frontier_plan_mind_decision_error) = if let Some(ingress) = result.frontier_plan_mind_decision.as_ref() { if let Some(decision) = ingress.decision { @@ -3038,7 +3045,7 @@ mod tests { "req-1", 4, EpiphanyOpenAiStreamPayload::Completed { - receipt: EpiphanyOpenAiModelReceipt::new("req-1", "gpt-5.4"), + receipt: Box::new(EpiphanyOpenAiModelReceipt::new("req-1", "gpt-5.4")), }, ), ]; @@ -3073,7 +3080,7 @@ mod tests { "Answer plainly.", ); let request = epiphany_openai_adapter::request_from_native(&native_request); - let options = default_options(store.clone(), PathBuf::from(".codex"), &request); + let options = default_options(store.clone(), &request); ensure_openai_runtime_ready(&options)?; open_runtime_model_execution( &store, @@ -3097,7 +3104,9 @@ mod tests { let events = vec![EpiphanyOpenAiStreamEvent { request_id: "req-1".to_string(), sequence: 0, - payload: EpiphanyOpenAiStreamPayload::Completed { receipt }, + payload: EpiphanyOpenAiStreamPayload::Completed { + receipt: Box::new(receipt), + }, }]; let summary = record_model_turn_events(&store, &options, &native_request, &events)?; @@ -3554,7 +3563,7 @@ mod tests { native_request.output_schema_json = Some(r#"{"type":"object","required":["researchDecision"]}"#.to_string()); let request = epiphany_openai_adapter::request_from_native(&native_request); - let options = default_options(store.clone(), PathBuf::from(".codex"), &request); + let options = default_options(store.clone(), &request); ensure_openai_runtime_ready(&options)?; open_runtime_model_execution( &store, @@ -3588,7 +3597,9 @@ mod tests { EpiphanyOpenAiStreamEvent { request_id: "req-tools".to_string(), sequence: 1, - payload: EpiphanyOpenAiStreamPayload::Completed { receipt }, + payload: EpiphanyOpenAiStreamPayload::Completed { + receipt: Box::new(receipt), + }, }, ]; let summary = record_model_turn_events(&store, &options, &native_request, &events)?; diff --git a/epiphany-openai-runtime/src/provider_transport.rs b/epiphany-openai-runtime/src/provider_transport.rs index b57af5bc..ff2d0785 100644 --- a/epiphany-openai-runtime/src/provider_transport.rs +++ b/epiphany-openai-runtime/src/provider_transport.rs @@ -1,15 +1,31 @@ +use std::io::Read; use std::path::Path; +use std::time::{Duration, SystemTime, UNIX_EPOCH}; use anyhow::{Context, Result, anyhow}; +use codex_connector::{ + CodexConnectorClient, CodexInputItem, CodexProviderRequest, CodexToolChoice, + CodexToolDefinition, CodexTransportDisposition, CodexTransportEventPayload, + CodexTransportInvocation, CodexTransportOutcome, +}; use epiphany_model_adapter::EpiphanyModelRequest; -use epiphany_openai_adapter::{EpiphanyOpenAiStreamEvent, EpiphanyOpenAiStreamPayload}; -use epiphany_openai_codex_spine::{ - EpiphanyCodexOpenAiTransport, EpiphanyOpenRouterTransport, auth_manager, +use epiphany_openai_adapter::{ + EpiphanyOpenAiInputItem, EpiphanyOpenAiModelReceipt, EpiphanyOpenAiModelRequest, + EpiphanyOpenAiStreamEvent, EpiphanyOpenAiStreamPayload, EpiphanyOpenAiWireDialect, + openrouter_events_from_response, openrouter_request_body, provider_call_id, + provider_format_name, strict_provider_schema, }; use epiphany_openai_runtime::{ EpiphanyOpenAiRuntimeOptions, EpiphanyOpenAiRuntimeRunSummary, OPENROUTER_MODEL_PROVIDER, open_model_turn, record_model_turn_events, }; +use sha2::{Digest, Sha256}; +use zeroize::Zeroizing; + +const OPENROUTER_COMPLETIONS_URL: &str = "https://openrouter.ai/api/v1/chat/completions"; +const MAX_CONNECTOR_FRAME_BYTES: usize = 32 * 1024 * 1024; +const MAX_OPENROUTER_RESPONSE_BYTES: u64 = 16 * 1024 * 1024; +const INVOCATION_ADMISSION_WINDOW: Duration = Duration::from_secs(60); pub async fn run_model_turn( provider: &str, @@ -17,33 +33,273 @@ pub async fn run_model_turn( request: EpiphanyModelRequest, ) -> Result { let provider_request = open_model_turn(provider, &options, &request)?; + let request_id = request.request_id.clone(); let events = match provider { "openai-codex" | "openai" => { - let transport = - EpiphanyCodexOpenAiTransport::openai(auth_manager(options.codex_home.clone())); collect_transport_events( - transport.collect_model_events(provider_request), - &request.request_id, + execute_codex_connector(&options, &request, provider_request), + &request_id, ) .await } OPENROUTER_MODEL_PROVIDER => { - let credential = read_static_provider_credential( - options.provider_credential_path.as_deref(), - OPENROUTER_MODEL_PROVIDER, - )?; - let transport = EpiphanyOpenRouterTransport::new(credential, options.request_timeout)?; - collect_transport_events( - transport.collect_model_events(provider_request), - &request.request_id, - ) - .await + collect_transport_events(execute_openrouter(&options, provider_request), &request_id) + .await } _ => unreachable!("open_model_turn validates provider identity"), }; record_model_turn_events(&options.store_path, &options, &request, &events) } +async fn execute_codex_connector( + options: &EpiphanyOpenAiRuntimeOptions, + native_request: &EpiphanyModelRequest, + request: EpiphanyOpenAiModelRequest, +) -> Result> { + let endpoint = options + .connector_endpoint + .ok_or_else(|| anyhow!("Codex provider requires an explicit connector endpoint"))?; + let caller_runtime_id = options.caller_runtime_id.clone(); + if caller_runtime_id.trim().is_empty() || caller_runtime_id.trim() != caller_runtime_id { + return Err(anyhow!( + "Codex connector caller runtime identity is invalid" + )); + } + let connection_key = Zeroizing::new(read_static_provider_credential( + options.provider_credential_path.as_deref(), + "codex-connector", + )?); + let native_request_sha256: [u8; 32] = Sha256::digest(rmp_serde::to_vec(native_request)?).into(); + let provider_request = codex_request_from_epiphany(request)?; + let expires_at_unix_ms = unix_time_ms()? + .checked_add(INVOCATION_ADMISSION_WINDOW.as_millis() as u64) + .ok_or_else(|| anyhow!("Codex connector invocation expiry overflowed"))?; + let invocation = CodexTransportInvocation::new( + caller_runtime_id, + expires_at_unix_ms, + native_request_sha256, + provider_request, + )?; + let client = CodexConnectorClient::new( + endpoint, + connection_key.as_str().to_string(), + MAX_CONNECTOR_FRAME_BYTES, + options.request_timeout, + )?; + tokio::task::spawn_blocking(move || { + let result = client.execute(&invocation)?; + events_from_connector_result(result) + }) + .await + .context("Codex connector client task failed")? +} + +pub(super) fn codex_request_from_epiphany( + request: EpiphanyOpenAiModelRequest, +) -> Result { + if !matches!(request.provider_id.as_str(), "openai-codex" | "openai") + || request.wire_dialect != EpiphanyOpenAiWireDialect::Responses + { + return Err(anyhow!( + "Codex connector requires an OpenAI provider identity and Responses dialect" + )); + } + let has_tool_result = request + .input + .iter() + .any(|item| matches!(item, EpiphanyOpenAiInputItem::ToolResult { .. })); + let output_format_name = request.output_schema_json.as_ref().map(|_| { + provider_format_name( + request + .output_contract_id + .as_deref() + .unwrap_or(&request.request_id), + ) + }); + let output_schema_json = request + .output_schema_json + .as_deref() + .map(strict_provider_schema) + .transpose()? + .map(|schema| serde_json::to_string(&schema)) + .transpose()?; + let tools = request + .tools + .into_iter() + .map(|tool| { + Ok(CodexToolDefinition { + name: tool.name, + description: tool.description, + parameters_json: serde_json::to_string(&strict_provider_schema( + &tool.parameters_json, + )?)?, + }) + }) + .collect::>>()?; + let tool_choice = if !tools.is_empty() && !has_tool_result { + CodexToolChoice::Required + } else { + CodexToolChoice::Auto + }; + let input = request + .input + .into_iter() + .map(|item| match item { + EpiphanyOpenAiInputItem::UserText { text } => CodexInputItem::UserText { text }, + EpiphanyOpenAiInputItem::AssistantText { text } => { + CodexInputItem::AssistantText { text } + } + EpiphanyOpenAiInputItem::ToolCall { + call_id, + name, + arguments, + } => CodexInputItem::ToolCall { + call_id: provider_call_id(&call_id), + name, + arguments, + }, + EpiphanyOpenAiInputItem::ToolResult { call_id, output } => CodexInputItem::ToolResult { + call_id: provider_call_id(&call_id), + output, + }, + }) + .collect(); + let mut provider_request = CodexProviderRequest::new( + request.request_id, + request.conversation_id, + request.model, + request.instructions, + ); + provider_request.input = input; + provider_request.reasoning_effort = request.reasoning_effort; + provider_request.reasoning_summary = request.reasoning_summary; + provider_request.service_tier = request.service_tier; + provider_request.output_format_name = output_format_name; + provider_request.previous_response_id = request.previous_response_id; + provider_request.tools = tools; + provider_request.tool_choice = tool_choice; + provider_request.parallel_tool_calls = false; + provider_request.output_schema_json = output_schema_json; + provider_request.validate()?; + Ok(provider_request) +} + +pub(super) fn events_from_connector_result( + result: codex_connector::CodexTransportResult, +) -> Result> { + let request_id = result.request_id.clone(); + match result.disposition { + CodexTransportDisposition::Refused(reason) => Err(anyhow!( + "Codex connector refused request {request_id:?}: {reason:?}" + )), + CodexTransportDisposition::Transported { events, receipt } => { + let mut projected = events + .into_iter() + .map(|event| EpiphanyOpenAiStreamEvent { + request_id: request_id.clone(), + sequence: event.sequence, + payload: match event.payload { + CodexTransportEventPayload::TextDelta { text } => { + EpiphanyOpenAiStreamPayload::TextDelta { text } + } + CodexTransportEventPayload::ToolCall { + call_id, + name, + arguments, + } => EpiphanyOpenAiStreamPayload::ToolCall { + call_id, + name, + arguments, + }, + }, + }) + .collect::>(); + let mut terminal = EpiphanyOpenAiModelReceipt::new(&request_id, &receipt.model); + terminal.transport = Some(receipt.transport.clone()); + terminal.caller_runtime_id = Some(receipt.caller_runtime_id.clone()); + terminal.native_request_sha256 = Some(hex_digest(receipt.native_request_sha256)); + terminal.provider_request_sha256 = Some(hex_digest(receipt.provider_request_sha256)); + match receipt.outcome { + CodexTransportOutcome::Completed { + provider_response_id, + input_tokens, + output_tokens, + reasoning_output_tokens, + cached_input_tokens, + } => { + terminal.response_id = provider_response_id; + terminal.input_tokens = input_tokens; + terminal.output_tokens = output_tokens; + terminal.reasoning_output_tokens = reasoning_output_tokens; + terminal.cached_input_tokens = cached_input_tokens; + projected.push(EpiphanyOpenAiStreamEvent { + request_id, + sequence: projected.len() as u64, + payload: EpiphanyOpenAiStreamPayload::Completed { + receipt: Box::new(terminal), + }, + }); + } + CodexTransportOutcome::Failed { + failure_kind, + message, + } => { + projected.push(EpiphanyOpenAiStreamEvent { + request_id, + sequence: projected.len() as u64, + payload: EpiphanyOpenAiStreamPayload::Failed { + message: format!("Codex connector {failure_kind}: {message}"), + }, + }); + } + } + Ok(projected) + } + } +} + +async fn execute_openrouter( + options: &EpiphanyOpenAiRuntimeOptions, + request: EpiphanyOpenAiModelRequest, +) -> Result> { + let api_key = Zeroizing::new(read_static_provider_credential( + options.provider_credential_path.as_deref(), + OPENROUTER_MODEL_PROVIDER, + )?); + let request_timeout = options.request_timeout; + tokio::task::spawn_blocking(move || { + let body = serde_json::to_vec(&openrouter_request_body(&request)?)?; + let agent: ureq::Agent = ureq::Agent::config_builder() + .timeout_connect(Some(Duration::from_secs(10))) + .timeout_recv_response(request_timeout) + .timeout_recv_body(request_timeout) + .max_redirects(0) + .build() + .into(); + let authorization = Zeroizing::new(format!("Bearer {}", api_key.as_str())); + let response = agent + .post(OPENROUTER_COMPLETIONS_URL) + .header("authorization", authorization.as_str()) + .header("content-type", "application/json") + .header("accept", "application/json") + .send(body) + .context("OpenRouter request failed")?; + let mut bytes = Vec::new(); + response + .into_body() + .into_reader() + .take(MAX_OPENROUTER_RESPONSE_BYTES + 1) + .read_to_end(&mut bytes) + .context("OpenRouter response read failed")?; + if bytes.len() as u64 > MAX_OPENROUTER_RESPONSE_BYTES { + return Err(anyhow!("OpenRouter response exceeded its byte bound")); + } + openrouter_events_from_response(&request, &bytes) + }) + .await + .context("OpenRouter client task failed")? +} + async fn collect_transport_events(future: F, request_id: &str) -> Vec where F: std::future::Future>>, @@ -78,3 +334,21 @@ fn read_static_provider_credential(path: Option<&Path>, provider: &str) -> Resul } Ok(credential.to_string()) } + +fn unix_time_ms() -> Result { + SystemTime::now() + .duration_since(UNIX_EPOCH) + .context("system clock predates Unix epoch")? + .as_millis() + .try_into() + .context("Unix time does not fit u64 milliseconds") +} + +fn hex_digest(digest: [u8; 32]) -> String { + let mut value = String::with_capacity(64); + for byte in digest { + use std::fmt::Write as _; + write!(&mut value, "{byte:02x}").expect("writing to a String cannot fail"); + } + value +}