Expand description
Method-name -> Rust-identifier derivation, ported from
build_combined_schema.py. Naming here must exactly match what typify
names the corresponding generated Rust types/enum variants - this was
empirically cross-validated against real typify output when this crate
was first built, so keep it in lock-step with the Python original rather
than “simplifying”.
Constants§
- KNOWN_
VOID_ 🔒RESPONSE_ METHODS - Methods confirmed (by hand, against the schema) to genuinely have no response payload / no params - NOT “our heuristic failed to find one.” Anything else the heuristics can’t resolve is a hard build-time error, so a future codex schema change that introduces a new shape breaks the build loudly instead of silently generating wrong code (dropped params, dropped response data). See README.md “Regenerating the schema”.
- RESPONSE_
OVERRIDES - Known irregular method -> response-type-name mappings the naming
convention can’t derive (see
crates/shared/codex-app-server-client/README.mdfor how these were discovered).
Functions§
- camel_
token_ 🔒regex - camel_
tokens - Splits a single camelCase/PascalCase word into lowercase tokens, treating
runs of consecutive capitals as an acronym token of their own (e.g.
"HTTPServer"->["http", "server"]). Exact regex ported frombuild_combined_schema.py:[A-Z]?[a-z0-9]+|[A-Z]+(?=[A-Z]|$). - fuzzy_
response_ match - Finds a
*Responsedefinition whose name’s tokens are a superset of the method’s tokens, preferring the shortest match. Bails if two or more candidates tie for shortest - an unresolvable ambiguity, not something to silently guess at (a future codex schema change that introduces a second plausible*Responsename for some method should break the build, not silently wire that method to whichever candidate happened to sort first). A single strictly-shortest candidate is treated as an unambiguous match even when longer candidates also exist. - method_
to_ pascal PascalCasederived from a/- and_-delimited method name, e.g."thread/start"->"ThreadStart". Only the first character of each segment is uppercased; the rest of the segment is left untouched (so already-camelCase segments like"mcpServer"become"McpServer", not"MCPSERVER"or"Mcpserver").- method_
to_ snake_ fn snake_casefunction name derived from a method name, e.g."item/tool/requestUserInput"->"item_tool_request_user_input".- resolve_
response - Resolves a method’s response type name:
RESPONSE_OVERRIDES, then the{PascalMethod}Responsenaming convention, then a fuzzy token-subset match, thenKNOWN_VOID_RESPONSE_METHODS. Hard-fails (matching the Python original’sresolve_response) if none of those resolve it, so a future codex schema change with a genuinely new naming shape breaks the build loudly instead of silently generating wrong code. - response_
override 🔒