MCPcopy Create free account
hub / github.com/dallay/agentsync / parse_codex_doc

Function parse_codex_doc

src/mcp.rs:998–1006  ·  view source on GitHub ↗

Parse Codex CLI config TOML into a document table

(content: &str)

Source from the content-addressed store, hash-verified

996
997/// Parse Codex CLI config TOML into a document table
998fn parse_codex_doc(content: &str) -> Result<TomlTable> {
999 let mut parsed: TomlValue =
1000 toml::from_str(content).context("Failed to parse existing Codex config as TOML")?;
1001 if let Some(table) = parsed.as_table_mut() {
1002 Ok(std::mem::take(table))
1003 } else {
1004 Ok(TomlTable::new())
1005 }
1006}
1007
1008/// Convert TOML value recursively to JSON value for unified parsing APIs
1009fn toml_to_json_value(value: &TomlValue) -> Value {

Callers 3

parse_existingMethod · 0.85
mergeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected