repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/exec_cell/model.rs
codex-rs/tui/src/exec_cell/model.rs
use std::time::Duration; use std::time::Instant; use codex_core::protocol::ExecCommandSource; use codex_protocol::parse_command::ParsedCommand; #[derive(Clone, Debug, Default)] pub(crate) struct CommandOutput { pub(crate) exit_code: i32, /// The aggregated stderr + stdout interleaved. pub(crate) aggregate...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/exec_cell/mod.rs
codex-rs/tui/src/exec_cell/mod.rs
mod model; mod render; pub(crate) use model::CommandOutput; #[cfg(test)] pub(crate) use model::ExecCall; pub(crate) use model::ExecCell; pub(crate) use render::OutputLinesParams; pub(crate) use render::TOOL_CALL_MAX_LINES; pub(crate) use render::new_active_exec_command; pub(crate) use render::output_lines; pub(crate) ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/bin/md-events.rs
codex-rs/tui/src/bin/md-events.rs
use std::io::Read; use std::io::{self}; fn main() { let mut input = String::new(); if let Err(err) = io::stdin().read_to_string(&mut input) { eprintln!("failed to read stdin: {err}"); std::process::exit(1); } let parser = pulldown_cmark::Parser::new(&input); for event in parser { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/notifications/osc9.rs
codex-rs/tui/src/notifications/osc9.rs
use std::fmt; use std::io; use std::io::stdout; use crossterm::Command; use ratatui::crossterm::execute; #[derive(Debug, Default)] pub struct Osc9Backend; impl Osc9Backend { pub fn notify(&mut self, message: &str) -> io::Result<()> { execute!(stdout(), PostNotification(message.to_string())) } } /// ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/notifications/mod.rs
codex-rs/tui/src/notifications/mod.rs
mod osc9; mod windows_toast; use std::env; use std::io; use codex_core::env::is_wsl; use osc9::Osc9Backend; use windows_toast::WindowsToastBackend; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum NotificationBackendKind { Osc9, WindowsToast, } #[derive(Debug)] pub enum DesktopNotificationBackend { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/notifications/windows_toast.rs
codex-rs/tui/src/notifications/windows_toast.rs
use std::io; use std::process::Command; use std::process::Stdio; use base64::Engine as _; use base64::engine::general_purpose::STANDARD as BASE64; const APP_ID: &str = "Codex"; const POWERSHELL_EXE: &str = "powershell.exe"; #[derive(Debug)] pub struct WindowsToastBackend { encoded_title: String, } impl WindowsT...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/render/highlight.rs
codex-rs/tui/src/render/highlight.rs
use ratatui::style::Style; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::text::Span; use std::sync::OnceLock; use tree_sitter_highlight::Highlight; use tree_sitter_highlight::HighlightConfiguration; use tree_sitter_highlight::HighlightEvent; use tree_sitter_highlight::Highlighter; // Ref: https://...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/render/renderable.rs
codex-rs/tui/src/render/renderable.rs
use std::sync::Arc; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::text::Line; use ratatui::text::Span; use ratatui::widgets::Paragraph; use ratatui::widgets::WidgetRef; use crate::render::Insets; use crate::render::RectExt as _; pub trait Renderable { fn render(&self, area: Rect, buf: &mut...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/render/mod.rs
codex-rs/tui/src/render/mod.rs
use ratatui::layout::Rect; pub mod highlight; pub mod line_utils; pub mod renderable; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Insets { left: u16, top: u16, right: u16, bottom: u16, } impl Insets { pub fn tlbr(top: u16, left: u16, bottom: u16, right: u16) -> Self { Self { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/render/line_utils.rs
codex-rs/tui/src/render/line_utils.rs
use ratatui::text::Line; use ratatui::text::Span; /// Clone a borrowed ratatui `Line` into an owned `'static` line. pub fn line_to_static(line: &Line<'_>) -> Line<'static> { Line { style: line.style, alignment: line.alignment, spans: line .spans .iter() ....
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/tests.rs
codex-rs/tui/src/status/tests.rs
use super::new_status_output; use super::rate_limit_snapshot_display; use crate::history_cell::HistoryCell; use chrono::Duration as ChronoDuration; use chrono::TimeZone; use chrono::Utc; use codex_core::AuthManager; use codex_core::config::Config; use codex_core::config::ConfigBuilder; use codex_core::models_manager::m...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/helpers.rs
codex-rs/tui/src/status/helpers.rs
use crate::exec_command::relativize_to_home; use crate::text_formatting; use chrono::DateTime; use chrono::Local; use codex_app_server_protocol::AuthMode; use codex_core::AuthManager; use codex_core::config::Config; use codex_core::project_doc::discover_project_doc_paths; use codex_protocol::account::PlanType; use std:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/mod.rs
codex-rs/tui/src/status/mod.rs
mod account; mod card; mod format; mod helpers; mod rate_limits; pub(crate) use card::new_status_output; pub(crate) use helpers::format_tokens_compact; pub(crate) use rate_limits::RateLimitSnapshotDisplay; pub(crate) use rate_limits::rate_limit_snapshot_display; #[cfg(test)] mod tests;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/format.rs
codex-rs/tui/src/status/format.rs
use ratatui::prelude::*; use ratatui::style::Stylize; use std::collections::BTreeSet; use unicode_width::UnicodeWidthChar; use unicode_width::UnicodeWidthStr; #[derive(Debug, Clone)] pub(crate) struct FieldFormatter { indent: &'static str, label_width: usize, value_offset: usize, value_indent: String, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/card.rs
codex-rs/tui/src/status/card.rs
use crate::history_cell::CompositeHistoryCell; use crate::history_cell::HistoryCell; use crate::history_cell::PlainHistoryCell; use crate::history_cell::with_border_with_inner_width; use crate::version::CODEX_CLI_VERSION; use chrono::DateTime; use chrono::Local; use codex_common::create_config_summary_entries; use code...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/rate_limits.rs
codex-rs/tui/src/status/rate_limits.rs
use crate::chatwidget::get_limits_duration; use crate::text_formatting::capitalize_first; use super::helpers::format_reset_timestamp; use chrono::DateTime; use chrono::Duration as ChronoDuration; use chrono::Local; use chrono::Utc; use codex_core::protocol::CreditsSnapshot as CoreCreditsSnapshot; use codex_core::proto...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/src/status/account.rs
codex-rs/tui/src/status/account.rs
#[derive(Debug, Clone)] pub(crate) enum StatusAccountDisplay { ChatGpt { email: Option<String>, plan: Option<String>, }, ApiKey, }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/tests/test_backend.rs
codex-rs/tui/tests/test_backend.rs
#[path = "../src/test_backend.rs"] mod inner; pub use inner::VT100Backend;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/tests/all.rs
codex-rs/tui/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. #[cfg(feature = "vt100-tests")] mod test_backend; mod suite;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/tests/suite/vt100_live_commit.rs
codex-rs/tui/tests/suite/vt100_live_commit.rs
#![cfg(feature = "vt100-tests")] use crate::test_backend::VT100Backend; use ratatui::layout::Rect; use ratatui::text::Line; #[test] fn live_001_commit_on_overflow() { let backend = VT100Backend::new(20, 6); let mut term = match codex_tui::custom_terminal::Terminal::with_options(backend) { Ok(t) => t, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/tests/suite/mod.rs
codex-rs/tui/tests/suite/mod.rs
// Aggregates all former standalone integration tests as modules. mod status_indicator; mod vt100_history; mod vt100_live_commit;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/tests/suite/vt100_history.rs
codex-rs/tui/tests/suite/vt100_history.rs
#![cfg(feature = "vt100-tests")] #![expect(clippy::expect_used)] use crate::test_backend::VT100Backend; use ratatui::layout::Rect; use ratatui::style::Stylize; use ratatui::text::Line; // Small helper macro to assert a collection contains an item with a clearer // failure message. macro_rules! assert_contains { (...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui/tests/suite/status_indicator.rs
codex-rs/tui/tests/suite/status_indicator.rs
//! Regression test: ensure that `StatusIndicatorWidget` sanitises ANSI escape //! sequences so that no raw `\x1b` bytes are written into the backing //! buffer. Rendering logic is tricky to unit‑test end‑to‑end, therefore we //! verify the *public* contract of `ansi_escape_line()` which the widget now //! relies on. ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/lib.rs
codex-rs/codex-client/src/lib.rs
mod default_client; mod error; mod request; mod retry; mod sse; mod telemetry; mod transport; pub use crate::default_client::CodexHttpClient; pub use crate::default_client::CodexRequestBuilder; pub use crate::error::StreamError; pub use crate::error::TransportError; pub use crate::request::Request; pub use crate::requ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/telemetry.rs
codex-rs/codex-client/src/telemetry.rs
use crate::error::TransportError; use http::StatusCode; use std::time::Duration; /// API specific telemetry. pub trait RequestTelemetry: Send + Sync { fn on_request( &self, attempt: u64, status: Option<StatusCode>, error: Option<&TransportError>, duration: Duration, ); }...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/default_client.rs
codex-rs/codex-client/src/default_client.rs
use http::Error as HttpError; use opentelemetry::global; use opentelemetry::propagation::Injector; use reqwest::IntoUrl; use reqwest::Method; use reqwest::Response; use reqwest::header::HeaderMap; use reqwest::header::HeaderName; use reqwest::header::HeaderValue; use serde::Serialize; use std::collections::HashMap; use...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/error.rs
codex-rs/codex-client/src/error.rs
use http::HeaderMap; use http::StatusCode; use thiserror::Error; #[derive(Debug, Error)] pub enum TransportError { #[error("http {status}: {body:?}")] Http { status: StatusCode, headers: Option<HeaderMap>, body: Option<String>, }, #[error("retry limit reached")] RetryLimit, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/transport.rs
codex-rs/codex-client/src/transport.rs
use crate::default_client::CodexHttpClient; use crate::default_client::CodexRequestBuilder; use crate::error::TransportError; use crate::request::Request; use crate::request::Response; use async_trait::async_trait; use bytes::Bytes; use futures::StreamExt; use futures::stream::BoxStream; use http::HeaderMap; use http::...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/request.rs
codex-rs/codex-client/src/request.rs
use bytes::Bytes; use http::Method; use reqwest::header::HeaderMap; use serde::Serialize; use serde_json::Value; use std::time::Duration; #[derive(Debug, Clone)] pub struct Request { pub method: Method, pub url: String, pub headers: HeaderMap, pub body: Option<Value>, pub timeout: Option<Duration>,...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/retry.rs
codex-rs/codex-client/src/retry.rs
use crate::error::TransportError; use crate::request::Request; use rand::Rng; use std::future::Future; use std::time::Duration; use tokio::time::sleep; #[derive(Debug, Clone)] pub struct RetryPolicy { pub max_attempts: u64, pub base_delay: Duration, pub retry_on: RetryOn, } #[derive(Debug, Clone)] pub str...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/codex-client/src/sse.rs
codex-rs/codex-client/src/sse.rs
use crate::error::StreamError; use crate::transport::ByteStream; use eventsource_stream::Eventsource; use futures::StreamExt; use tokio::sync::mpsc; use tokio::time::Duration; use tokio::time::timeout; /// Minimal SSE helper that forwards raw `data:` frames as UTF-8 strings. /// /// Errors and idle timeouts are sent a...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/string/src/lib.rs
codex-rs/utils/string/src/lib.rs
// Truncate a &str to a byte budget at a char boundary (prefix) #[inline] pub fn take_bytes_at_char_boundary(s: &str, maxb: usize) -> &str { if s.len() <= maxb { return s; } let mut last_ok = 0; for (i, ch) in s.char_indices() { let nb = i + ch.len_utf8(); if nb > maxb { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/image/src/lib.rs
codex-rs/utils/image/src/lib.rs
use std::num::NonZeroUsize; use std::path::Path; use std::sync::LazyLock; use crate::error::ImageProcessingError; use base64::Engine; use base64::engine::general_purpose::STANDARD as BASE64_STANDARD; use codex_utils_cache::BlockingLruCache; use codex_utils_cache::sha1_digest; use image::ColorType; use image::DynamicIm...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/image/src/error.rs
codex-rs/utils/image/src/error.rs
use image::ImageError; use image::ImageFormat; use std::path::PathBuf; use thiserror::Error; #[derive(Debug, Error)] pub enum ImageProcessingError { #[error("failed to read image at {path}: {source}")] Read { path: PathBuf, #[source] source: std::io::Error, }, #[error("failed to...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/cache/src/lib.rs
codex-rs/utils/cache/src/lib.rs
use std::borrow::Borrow; use std::hash::Hash; use std::num::NonZeroUsize; use lru::LruCache; use sha1::Digest; use sha1::Sha1; use tokio::sync::Mutex; use tokio::sync::MutexGuard; /// A minimal LRU cache protected by a Tokio mutex. /// Calls outside a Tokio runtime are no-ops. pub struct BlockingLruCache<K, V> { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/cargo-bin/src/lib.rs
codex-rs/utils/cargo-bin/src/lib.rs
use std::ffi::OsString; use std::path::PathBuf; #[derive(Debug, thiserror::Error)] pub enum CargoBinError { #[error("failed to read current exe")] CurrentExe { #[source] source: std::io::Error, }, #[error("failed to read current directory")] CurrentDir { #[source] so...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/json-to-toml/src/lib.rs
codex-rs/utils/json-to-toml/src/lib.rs
use serde_json::Value as JsonValue; use toml::Value as TomlValue; /// Convert a `serde_json::Value` into a semantically equivalent `toml::Value`. pub fn json_to_toml(v: JsonValue) -> TomlValue { match v { JsonValue::Null => TomlValue::String(String::new()), JsonValue::Bool(b) => TomlValue::Boolean(...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/readiness/src/lib.rs
codex-rs/utils/readiness/src/lib.rs
//! Readiness flag with token-based authorization and async waiting (Tokio). use std::collections::HashSet; use std::fmt; use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicI32; use std::sync::atomic::Ordering; use std::time::Duration; use tokio::sync::Mutex; use tokio::sync::watch; use tokio::time; ///...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/errors.rs
codex-rs/utils/git/src/errors.rs
use std::path::PathBuf; use std::process::ExitStatus; use std::string::FromUtf8Error; use thiserror::Error; use walkdir::Error as WalkdirError; /// Errors returned while managing git worktree snapshots. #[derive(Debug, Error)] pub enum GitToolingError { #[error("git command `{command}` failed with status {status}...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/ghost_commits.rs
codex-rs/utils/git/src/ghost_commits.rs
use std::collections::BTreeMap; use std::collections::HashSet; use std::ffi::OsString; use std::fs; use std::io; use std::path::Component; use std::path::Path; use std::path::PathBuf; use tempfile::Builder; use crate::GhostCommit; use crate::GitToolingError; use crate::operations::apply_repo_prefix_to_force_include; ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/branch.rs
codex-rs/utils/git/src/branch.rs
use std::ffi::OsString; use std::path::Path; use crate::GitToolingError; use crate::operations::ensure_git_repository; use crate::operations::resolve_head; use crate::operations::resolve_repository_root; use crate::operations::run_git_for_stdout; /// Returns the merge-base commit between `HEAD` and the latest version...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/lib.rs
codex-rs/utils/git/src/lib.rs
use std::fmt; use std::path::PathBuf; mod apply; mod branch; mod errors; mod ghost_commits; mod operations; mod platform; pub use apply::ApplyGitRequest; pub use apply::ApplyGitResult; pub use apply::apply_git_patch; pub use apply::extract_paths_from_patch; pub use apply::parse_git_apply_output; pub use apply::stage_...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/platform.rs
codex-rs/utils/git/src/platform.rs
use std::path::Path; use crate::GitToolingError; #[cfg(unix)] pub fn create_symlink( _source: &Path, link_target: &Path, destination: &Path, ) -> Result<(), GitToolingError> { use std::os::unix::fs::symlink; symlink(link_target, destination)?; Ok(()) } #[cfg(windows)] pub fn create_symlink( ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/apply.rs
codex-rs/utils/git/src/apply.rs
//! Helpers for applying unified diffs using the system `git` binary. //! //! The entry point is [`apply_git_patch`], which writes a diff to a temporary //! file, shells out to `git apply` with the right flags, and then parses the //! command’s output into structured details. Callers can opt into dry-run //! mode via [...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/git/src/operations.rs
codex-rs/utils/git/src/operations.rs
use std::ffi::OsStr; use std::ffi::OsString; use std::path::Component; use std::path::Path; use std::path::PathBuf; use std::process::Command; use crate::GitToolingError; pub(crate) fn ensure_git_repository(path: &Path) -> Result<(), GitToolingError> { match run_git_for_stdout( path, vec![ ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/pty/src/lib.rs
codex-rs/utils/pty/src/lib.rs
use core::fmt; use std::collections::HashMap; use std::io::ErrorKind; use std::path::Path; use std::sync::atomic::AtomicBool; use std::sync::Arc; use std::sync::Mutex as StdMutex; use std::time::Duration; #[cfg(windows)] mod win; use anyhow::Result; #[cfg(not(windows))] use portable_pty::native_pty_system; use portab...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/pty/src/win/mod.rs
codex-rs/utils/pty/src/win/mod.rs
#![allow(clippy::unwrap_used)] // This file is copied from https://github.com/wezterm/wezterm (MIT license). // Copyright (c) 2018-Present Wez Furlong // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in t...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/pty/src/win/psuedocon.rs
codex-rs/utils/pty/src/win/psuedocon.rs
#![allow(clippy::expect_used)] #![allow(clippy::upper_case_acronyms)] // This file is copied from https://github.com/wezterm/wezterm (MIT license). // Copyright (c) 2018-Present Wez Furlong // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/pty/src/win/conpty.rs
codex-rs/utils/pty/src/win/conpty.rs
#![allow(clippy::unwrap_used)] // This file is copied from https://github.com/wezterm/wezterm (MIT license). // Copyright (c) 2018-Present Wez Furlong // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in t...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/pty/src/win/procthreadattr.rs
codex-rs/utils/pty/src/win/procthreadattr.rs
#![allow(clippy::uninit_vec)] // This file is copied from https://github.com/wezterm/wezterm (MIT license). // Copyright (c) 2018-Present Wez Furlong // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in th...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/utils/absolute-path/src/lib.rs
codex-rs/utils/absolute-path/src/lib.rs
use path_absolutize::Absolutize; use schemars::JsonSchema; use serde::Deserialize; use serde::Deserializer; use serde::Serialize; use serde::de::Error as SerdeError; use std::cell::RefCell; use std::path::Display; use std::path::Path; use std::path::PathBuf; use ts_rs::TS; /// A path that is guaranteed to be absolute ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/elapsed.rs
codex-rs/common/src/elapsed.rs
use std::time::Duration; use std::time::Instant; /// Returns a string representing the elapsed time since `start_time` like /// "1m 15s" or "1.50s". pub fn format_elapsed(start_time: Instant) -> String { format_duration(start_time.elapsed()) } /// Convert a [`std::time::Duration`] into a human-readable, compact s...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/lib.rs
codex-rs/common/src/lib.rs
#[cfg(feature = "cli")] mod approval_mode_cli_arg; #[cfg(feature = "elapsed")] pub mod elapsed; #[cfg(feature = "cli")] pub use approval_mode_cli_arg::ApprovalModeCliArg; #[cfg(feature = "cli")] mod sandbox_mode_cli_arg; #[cfg(feature = "cli")] pub use sandbox_mode_cli_arg::SandboxModeCliArg; #[cfg(feature = "cli"...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/oss.rs
codex-rs/common/src/oss.rs
//! OSS provider utilities shared between TUI and exec. use codex_core::LMSTUDIO_OSS_PROVIDER_ID; use codex_core::OLLAMA_OSS_PROVIDER_ID; use codex_core::config::Config; /// Returns the default model for a given OSS provider. pub fn get_default_model_for_oss_provider(provider_id: &str) -> Option<&'static str> { m...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/approval_mode_cli_arg.rs
codex-rs/common/src/approval_mode_cli_arg.rs
//! Standard type to use with the `--approval-mode` CLI option. //! Available when the `cli` feature is enabled for the crate. use clap::ValueEnum; use codex_core::protocol::AskForApproval; #[derive(Clone, Copy, Debug, ValueEnum)] #[value(rename_all = "kebab-case")] pub enum ApprovalModeCliArg { /// Only run "tr...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/fuzzy_match.rs
codex-rs/common/src/fuzzy_match.rs
/// Simple case-insensitive subsequence matcher used for fuzzy filtering. /// /// Returns the indices (character positions) of the matched characters in the /// ORIGINAL `haystack` string and a score where smaller is better. /// /// Unicode correctness: we perform the match on a lowercased copy of the /// haystack and ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/config_summary.rs
codex-rs/common/src/config_summary.rs
use codex_core::WireApi; use codex_core::config::Config; use crate::sandbox_summary::summarize_sandbox_policy; /// Build a list of key/value pairs summarizing the effective configuration. pub fn create_config_summary_entries(config: &Config, model: &str) -> Vec<(&'static str, String)> { let mut entries = vec![ ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/sandbox_mode_cli_arg.rs
codex-rs/common/src/sandbox_mode_cli_arg.rs
//! Standard type to use with the `--sandbox` (`-s`) CLI option. //! //! This mirrors the variants of [`codex_core::protocol::SandboxPolicy`], but //! without any of the associated data so it can be expressed as a simple flag //! on the command-line. Users that need to tweak the advanced options for //! `workspace-writ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/approval_presets.rs
codex-rs/common/src/approval_presets.rs
use codex_core::protocol::AskForApproval; use codex_core::protocol::SandboxPolicy; /// A simple preset pairing an approval policy with a sandbox policy. #[derive(Debug, Clone)] pub struct ApprovalPreset { /// Stable identifier for the preset. pub id: &'static str, /// Display label shown in UIs. pub la...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/sandbox_summary.rs
codex-rs/common/src/sandbox_summary.rs
use codex_core::protocol::NetworkAccess; use codex_core::protocol::SandboxPolicy; pub fn summarize_sandbox_policy(sandbox_policy: &SandboxPolicy) -> String { match sandbox_policy { SandboxPolicy::DangerFullAccess => "danger-full-access".to_string(), SandboxPolicy::ReadOnly => "read-only".to_string(...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/format_env_display.rs
codex-rs/common/src/format_env_display.rs
use std::collections::HashMap; pub fn format_env_display(env: Option<&HashMap<String, String>>, env_vars: &[String]) -> String { let mut parts: Vec<String> = Vec::new(); if let Some(map) = env { let mut pairs: Vec<_> = map.iter().collect(); pairs.sort_by(|(a, _), (b, _)| a.cmp(b)); par...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/common/src/config_override.rs
codex-rs/common/src/config_override.rs
//! Support for `-c key=value` overrides shared across Codex CLI tools. //! //! This module provides a [`CliConfigOverrides`] struct that can be embedded //! into a `clap`-derived CLI struct using `#[clap(flatten)]`. Each occurrence //! of `-c key=value` (or `--config key=value`) will be collected as a raw //! string. ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/build.rs
codex-rs/execpolicy-legacy/build.rs
fn main() { println!("cargo:rerun-if-changed=src/default.policy"); }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/valid_exec.rs
codex-rs/execpolicy-legacy/src/valid_exec.rs
use crate::arg_type::ArgType; use crate::error::Result; use serde::Serialize; /// exec() invocation that has been accepted by a `Policy`. #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)] pub struct ValidExec { pub program: String, pub flags: Vec<MatchedFlag>, pub opts: Vec<MatchedOpt>, pub ar...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/lib.rs
codex-rs/execpolicy-legacy/src/lib.rs
#![allow(clippy::type_complexity)] #![allow(clippy::too_many_arguments)] #[macro_use] extern crate starlark; mod arg_matcher; mod arg_resolver; mod arg_type; mod error; mod exec_call; mod execv_checker; mod opt; mod policy; mod policy_parser; mod program; mod sed_command; mod valid_exec; pub use arg_matcher::ArgMatch...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/program.rs
codex-rs/execpolicy-legacy/src/program.rs
use serde::Serialize; use std::collections::HashMap; use std::collections::HashSet; use crate::ArgType; use crate::ExecCall; use crate::arg_matcher::ArgMatcher; use crate::arg_resolver::PositionalArg; use crate::arg_resolver::resolve_observed_args_with_patterns; use crate::error::Error; use crate::error::Result; use c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/policy_parser.rs
codex-rs/execpolicy-legacy/src/policy_parser.rs
#![allow(clippy::needless_lifetimes)] use crate::Opt; use crate::Policy; use crate::ProgramSpec; use crate::arg_matcher::ArgMatcher; use crate::opt::OptMeta; use log::info; use multimap::MultiMap; use regex_lite::Regex; use starlark::any::ProvidesStaticType; use starlark::environment::GlobalsBuilder; use starlark::env...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/sed_command.rs
codex-rs/execpolicy-legacy/src/sed_command.rs
use crate::error::Error; use crate::error::Result; pub fn parse_sed_command(sed_command: &str) -> Result<()> { // For now, we parse only commands like `122,202p`. if let Some(stripped) = sed_command.strip_suffix("p") && let Some((first, rest)) = stripped.split_once(",") && first.parse::<u64>()....
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/arg_resolver.rs
codex-rs/execpolicy-legacy/src/arg_resolver.rs
use serde::Serialize; use crate::arg_matcher::ArgMatcher; use crate::arg_matcher::ArgMatcherCardinality; use crate::error::Error; use crate::error::Result; use crate::valid_exec::MatchedArg; #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct PositionalArg { pub index: usize, pub value: String, } pu...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/policy.rs
codex-rs/execpolicy-legacy/src/policy.rs
use multimap::MultiMap; use regex_lite::Error as RegexError; use regex_lite::Regex; use crate::ExecCall; use crate::Forbidden; use crate::MatchedExec; use crate::NegativeExamplePassedCheck; use crate::ProgramSpec; use crate::error::Error; use crate::error::Result; use crate::policy_parser::ForbiddenProgramRegex; use c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/error.rs
codex-rs/execpolicy-legacy/src/error.rs
use std::path::PathBuf; use serde::Serialize; use crate::arg_matcher::ArgMatcher; use crate::arg_resolver::PositionalArg; use serde_with::DisplayFromStr; use serde_with::serde_as; pub type Result<T> = std::result::Result<T, Error>; #[serde_as] #[derive(Debug, Eq, PartialEq, Serialize)] #[serde(tag = "type")] pub en...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/exec_call.rs
codex-rs/execpolicy-legacy/src/exec_call.rs
use std::fmt::Display; use serde::Serialize; #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct ExecCall { pub program: String, pub args: Vec<String>, } impl ExecCall { pub fn new(program: &str, args: &[&str]) -> Self { Self { program: program.to_string(), args: ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/arg_matcher.rs
codex-rs/execpolicy-legacy/src/arg_matcher.rs
#![allow(clippy::needless_lifetimes)] use crate::arg_type::ArgType; use crate::starlark::values::ValueLike; use allocative::Allocative; use derive_more::derive::Display; use starlark::any::ProvidesStaticType; use starlark::values::AllocValue; use starlark::values::Heap; use starlark::values::NoSerialize; use starlark:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/opt.rs
codex-rs/execpolicy-legacy/src/opt.rs
#![allow(clippy::needless_lifetimes)] use crate::ArgType; use crate::starlark::values::ValueLike; use allocative::Allocative; use derive_more::derive::Display; use starlark::any::ProvidesStaticType; use starlark::values::AllocValue; use starlark::values::Heap; use starlark::values::NoSerialize; use starlark::values::S...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/main.rs
codex-rs/execpolicy-legacy/src/main.rs
use anyhow::Result; use clap::Parser; use clap::Subcommand; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::Policy; use codex_execpolicy_legacy::PolicyParser; use codex_execpolicy_legacy::ValidExec; use codex_execpolicy_legacy::get_default_policy; use serde:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/execv_checker.rs
codex-rs/execpolicy-legacy/src/execv_checker.rs
use std::borrow::Cow; use std::ffi::OsString; use std::path::Path; use std::path::PathBuf; use crate::ArgType; use crate::Error::CannotCanonicalizePath; use crate::Error::CannotCheckRelativePath; use crate::Error::ReadablePathNotInReadableFolders; use crate::Error::WriteablePathNotInWriteableFolders; use crate::ExecCa...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/src/arg_type.rs
codex-rs/execpolicy-legacy/src/arg_type.rs
#![allow(clippy::needless_lifetimes)] use crate::error::Error; use crate::error::Result; use crate::sed_command::parse_sed_command; use allocative::Allocative; use derive_more::derive::Display; use serde::Serialize; use starlark::any::ProvidesStaticType; use starlark::values::StarlarkValue; use starlark::values::starl...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/all.rs
codex-rs/execpolicy-legacy/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. mod suite;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/cp.rs
codex-rs/execpolicy-legacy/tests/suite/cp.rs
extern crate codex_execpolicy_legacy; use codex_execpolicy_legacy::ArgMatcher; use codex_execpolicy_legacy::ArgType; use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedArg; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::Policy; use cod...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/ls.rs
codex-rs/execpolicy-legacy/tests/suite/ls.rs
extern crate codex_execpolicy_legacy; use codex_execpolicy_legacy::ArgType; use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedArg; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::MatchedFlag; use codex_execpolicy_legacy::Policy; use co...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/pwd.rs
codex-rs/execpolicy-legacy/tests/suite/pwd.rs
extern crate codex_execpolicy_legacy; use std::vec; use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::MatchedFlag; use codex_execpolicy_legacy::Policy; use codex_execpolicy_legacy::PositionalArg; use codex_execpolicy_legac...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/literal.rs
codex-rs/execpolicy-legacy/tests/suite/literal.rs
use codex_execpolicy_legacy::ArgType; use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedArg; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::PolicyParser; use codex_execpolicy_legacy::Result; use codex_execpolicy_legacy::ValidExec; ext...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/good.rs
codex-rs/execpolicy-legacy/tests/suite/good.rs
use codex_execpolicy_legacy::PositiveExampleFailedCheck; use codex_execpolicy_legacy::get_default_policy; #[test] fn verify_everything_in_good_list_is_allowed() { let policy = get_default_policy().expect("failed to load default policy"); let violations = policy.check_each_good_list_individually(); assert_e...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/bad.rs
codex-rs/execpolicy-legacy/tests/suite/bad.rs
use codex_execpolicy_legacy::NegativeExamplePassedCheck; use codex_execpolicy_legacy::get_default_policy; #[test] fn verify_everything_in_bad_list_is_rejected() { let policy = get_default_policy().expect("failed to load default policy"); let violations = policy.check_each_bad_list_individually(); assert_eq...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/mod.rs
codex-rs/execpolicy-legacy/tests/suite/mod.rs
// Aggregates all former standalone integration tests as modules. mod bad; mod cp; mod good; mod head; mod literal; mod ls; mod parse_sed_command; mod pwd; mod sed;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/head.rs
codex-rs/execpolicy-legacy/tests/suite/head.rs
use codex_execpolicy_legacy::ArgMatcher; use codex_execpolicy_legacy::ArgType; use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedArg; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::MatchedOpt; use codex_execpolicy_legacy::Policy; use c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/sed.rs
codex-rs/execpolicy-legacy/tests/suite/sed.rs
extern crate codex_execpolicy_legacy; use codex_execpolicy_legacy::ArgType; use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::ExecCall; use codex_execpolicy_legacy::MatchedArg; use codex_execpolicy_legacy::MatchedExec; use codex_execpolicy_legacy::MatchedFlag; use codex_execpolicy_legacy::MatchedOpt; us...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/execpolicy-legacy/tests/suite/parse_sed_command.rs
codex-rs/execpolicy-legacy/tests/suite/parse_sed_command.rs
use codex_execpolicy_legacy::Error; use codex_execpolicy_legacy::parse_sed_command; #[test] fn parses_simple_print_command() { assert_eq!(parse_sed_command("122,202p"), Ok(())); } #[test] fn rejects_malformed_print_command() { assert_eq!( parse_sed_command("122,202"), Err(Error::SedCommandNotP...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/error_code.rs
codex-rs/app-server/src/error_code.rs
pub(crate) const INVALID_REQUEST_ERROR_CODE: i64 = -32600; pub(crate) const INTERNAL_ERROR_CODE: i64 = -32603;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/lib.rs
codex-rs/app-server/src/lib.rs
#![deny(clippy::print_stdout, clippy::print_stderr)] use codex_common::CliConfigOverrides; use codex_core::config::Config; use std::io::ErrorKind; use std::io::Result as IoResult; use std::path::PathBuf; use crate::message_processor::MessageProcessor; use crate::outgoing_message::OutgoingMessage; use crate::outgoing_...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/bespoke_event_handling.rs
codex-rs/app-server/src/bespoke_event_handling.rs
use crate::codex_message_processor::ApiVersion; use crate::codex_message_processor::PendingInterrupts; use crate::codex_message_processor::TurnSummary; use crate::codex_message_processor::TurnSummaryStore; use crate::outgoing_message::OutgoingMessageSender; use codex_app_server_protocol::AccountRateLimitsUpdatedNotific...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/config_api.rs
codex-rs/app-server/src/config_api.rs
use crate::error_code::INTERNAL_ERROR_CODE; use crate::error_code::INVALID_REQUEST_ERROR_CODE; use codex_app_server_protocol::ConfigBatchWriteParams; use codex_app_server_protocol::ConfigReadParams; use codex_app_server_protocol::ConfigReadResponse; use codex_app_server_protocol::ConfigValueWriteParams; use codex_app_s...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/message_processor.rs
codex-rs/app-server/src/message_processor.rs
use std::path::PathBuf; use std::sync::Arc; use crate::codex_message_processor::CodexMessageProcessor; use crate::config_api::ConfigApi; use crate::error_code::INVALID_REQUEST_ERROR_CODE; use crate::outgoing_message::OutgoingMessageSender; use codex_app_server_protocol::ClientInfo; use codex_app_server_protocol::Clien...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/codex_message_processor.rs
codex-rs/app-server/src/codex_message_processor.rs
use crate::bespoke_event_handling::apply_bespoke_event_handling; use crate::error_code::INTERNAL_ERROR_CODE; use crate::error_code::INVALID_REQUEST_ERROR_CODE; use crate::fuzzy_file_search::run_fuzzy_file_search; use crate::models::supported_models; use crate::outgoing_message::OutgoingMessageSender; use crate::outgoin...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/main.rs
codex-rs/app-server/src/main.rs
use codex_app_server::run_main; use codex_arg0::arg0_dispatch_or_else; use codex_common::CliConfigOverrides; fn main() -> anyhow::Result<()> { arg0_dispatch_or_else(|codex_linux_sandbox_exe| async move { run_main(codex_linux_sandbox_exe, CliConfigOverrides::default()).await?; Ok(()) }) }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/outgoing_message.rs
codex-rs/app-server/src/outgoing_message.rs
use std::collections::HashMap; use std::sync::atomic::AtomicI64; use std::sync::atomic::Ordering; use codex_app_server_protocol::JSONRPCErrorError; use codex_app_server_protocol::RequestId; use codex_app_server_protocol::Result; use codex_app_server_protocol::ServerNotification; use codex_app_server_protocol::ServerRe...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/fuzzy_file_search.rs
codex-rs/app-server/src/fuzzy_file_search.rs
use std::num::NonZero; use std::num::NonZeroUsize; use std::path::PathBuf; use std::sync::Arc; use std::sync::atomic::AtomicBool; use codex_app_server_protocol::FuzzyFileSearchResult; use codex_file_search as file_search; use tokio::task::JoinSet; use tracing::warn; const LIMIT_PER_ROOT: usize = 50; const MAX_THREADS...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/src/models.rs
codex-rs/app-server/src/models.rs
use std::sync::Arc; use codex_app_server_protocol::Model; use codex_app_server_protocol::ReasoningEffortOption; use codex_core::ConversationManager; use codex_core::config::Config; use codex_protocol::openai_models::ModelPreset; use codex_protocol::openai_models::ReasoningEffortPreset; pub async fn supported_models( ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/tests/all.rs
codex-rs/app-server/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. mod suite;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/app-server/tests/suite/config.rs
codex-rs/app-server/tests/suite/config.rs
use anyhow::Result; use app_test_support::McpProcess; use app_test_support::test_tmp_path; use app_test_support::to_response; use codex_app_server_protocol::GetUserSavedConfigResponse; use codex_app_server_protocol::JSONRPCResponse; use codex_app_server_protocol::Profile; use codex_app_server_protocol::RequestId; use c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false