1717VERSION_FILE = SCHEMA_DIR / "VERSION"
1818SCHEMA_OUT = ROOT / "src" / "acp" / "schema.py"
1919
20- BACKCOMPAT_MARKER = "# Backwards compatibility aliases"
21-
2220# Pattern caches used when post-processing generated schema.
2321FIELD_DECLARATION_PATTERN = re .compile (r"[A-Za-z_][A-Za-z0-9_]*\s*:" )
2422DESCRIPTION_PATTERN = re .compile (
6967 "ToolCallContent3" : "TerminalToolCallContent" ,
7068}
7169
72- ALIASES_MAP = {
73- "StdioMcpServer" : "McpServerStdio" ,
74- }
75-
7670ENUM_LITERAL_MAP : dict [str , tuple [str , ...]] = {
7771 "PermissionOptionKind" : (
7872 "allow_once" ,
@@ -174,7 +168,6 @@ def postprocess_generated_schema(output_path: Path) -> list[str]:
174168 header_block = _build_header_block ()
175169
176170 content = _strip_existing_header (raw_content )
177- content = _remove_backcompat_block (content )
178171 content = _remove_unused_models (content )
179172 content , leftover_classes = _rename_numbered_models (content )
180173
@@ -191,8 +184,7 @@ def postprocess_generated_schema(output_path: Path) -> list[str]:
191184 missing_targets = _find_missing_targets (content )
192185
193186 content = _inject_enum_aliases (content )
194- alias_block = _build_alias_block ()
195- final_content = header_block + content .rstrip () + "\n \n " + alias_block
187+ final_content = header_block + content .rstrip () + "\n "
196188 if not final_content .endswith ("\n " ):
197189 final_content += "\n "
198190 output_path .write_text (final_content , encoding = "utf-8" )
@@ -224,26 +216,13 @@ def _build_header_block() -> str:
224216 return "\n " .join (header_lines ) + "\n \n "
225217
226218
227- def _build_alias_block () -> str :
228- alias_lines = [f"{ old } = { new } " for old , new in sorted (RENAME_MAP .items ())]
229- alias_lines += [f"{ old } = { new } " for old , new in sorted (ALIASES_MAP .items ())]
230- return BACKCOMPAT_MARKER + "\n " + "\n " .join (alias_lines ) + "\n "
231-
232-
233219def _strip_existing_header (content : str ) -> str :
234220 existing_header = re .match (r"(#.*\n)+" , content )
235221 if existing_header :
236222 return content [existing_header .end () :].lstrip ("\n " )
237223 return content .lstrip ("\n " )
238224
239225
240- def _remove_backcompat_block (content : str ) -> str :
241- marker_index = content .find (BACKCOMPAT_MARKER )
242- if marker_index != - 1 :
243- return content [:marker_index ].rstrip ()
244- return content
245-
246-
247226def _rename_numbered_models (content : str ) -> tuple [str , list [str ]]:
248227 renamed = content
249228 for old , new in sorted (RENAME_MAP .items (), key = lambda item : len (item [0 ]), reverse = True ):
0 commit comments