refactor: make code-mode crate wasm-safe

Gate the native V8 dependency out of wasm builds and provide a wasm-specific default CodeModeService that preserves the shared request/response/runtime trait surface while returning clear errors unless a browser runtime is injected. Keep the public code-mode types available on wasm and mark the V8-backed runtime internals as native-only so codex-code-mode now checks cleanly for wasm32-unknown-unknown.
This commit is contained in:
Jeremy Lewi
2026-04-13 09:51:19 -07:00
parent 3ffd99cd3d
commit ee4138c363
5 changed files with 152 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
mod description;
mod response;
mod runtime;
#[cfg_attr(target_arch = "wasm32", path = "service_wasm.rs")]
mod service;
pub use description::CODE_MODE_PRAGMA_PREFIX;