|
28 | 28 |
|
29 | 29 | STDIO_TYPE_LITERAL = 'Literal["2#-datamodel-code-generator-#-object-#-special-#"]' |
30 | 30 | STDIO_TYPE_PATTERN = re.compile( |
31 | | - r"^ type:\s*Literal\[['\"]2#-datamodel-code-generator-#-object-#-special-#['\"]\]" |
| 31 | + r"^ type:\s*Literal\[['\"]McpServerStdio['\"]\]" |
32 | 32 | r"(?:\s*=\s*['\"][^'\"]+['\"])?\s*$", |
33 | 33 | re.MULTILINE, |
34 | 34 | ) |
|
40 | 40 | "AgentOutgoingMessage2": "AgentResponseMessage", |
41 | 41 | "AgentOutgoingMessage3": "AgentErrorMessage", |
42 | 42 | "AgentOutgoingMessage4": "AgentNotificationMessage", |
43 | | - "AvailableCommandInput1": "CommandInputHint", |
44 | 43 | "ClientOutgoingMessage1": "ClientRequestMessage", |
45 | 44 | "ClientOutgoingMessage2": "ClientResponseMessage", |
46 | 45 | "ClientOutgoingMessage3": "ClientErrorMessage", |
|
52 | 51 | "ContentBlock5": "EmbeddedResourceContentBlock", |
53 | 52 | "McpServer1": "HttpMcpServer", |
54 | 53 | "McpServer2": "SseMcpServer", |
55 | | - "McpServer3": "StdioMcpServer", |
56 | 54 | "RequestPermissionOutcome1": "DeniedOutcome", |
57 | 55 | "RequestPermissionOutcome2": "AllowedOutcome", |
58 | 56 | "SessionUpdate1": "UserMessageChunk", |
|
68 | 66 | "ToolCallContent3": "TerminalToolCallContent", |
69 | 67 | } |
70 | 68 |
|
| 69 | +ALIASES_MAP = { |
| 70 | + "StdioMcpServer": "McpServerStdio", |
| 71 | +} |
| 72 | + |
71 | 73 | ENUM_LITERAL_MAP: dict[str, tuple[str, ...]] = { |
72 | 74 | "PermissionOptionKind": ( |
73 | 75 | "allow_once", |
|
87 | 89 | ("PlanEntry", "priority", "PlanEntryPriority", False), |
88 | 90 | ("PlanEntry", "status", "PlanEntryStatus", False), |
89 | 91 | ("PromptResponse", "stop_reason", "StopReason", False), |
90 | | - ("ToolCallProgress", "kind", "ToolKind", True), |
91 | | - ("ToolCallProgress", "status", "ToolCallStatus", True), |
92 | | - ("ToolCallStart", "kind", "ToolKind", True), |
93 | | - ("ToolCallStart", "status", "ToolCallStatus", True), |
94 | 92 | ("ToolCall", "kind", "ToolKind", True), |
95 | 93 | ("ToolCall", "status", "ToolCallStatus", True), |
| 94 | + ("ToolCallUpdate", "kind", "ToolKind", True), |
| 95 | + ("ToolCallUpdate", "status", "ToolCallStatus", True), |
96 | 96 | ) |
97 | 97 |
|
98 | 98 | DEFAULT_VALUE_OVERRIDES: tuple[tuple[str, str, str], ...] = ( |
99 | 99 | ("AgentCapabilities", "mcp_capabilities", "McpCapabilities()"), |
| 100 | + ("AgentCapabilities", "session_capabilities", "SessionCapabilities()"), |
100 | 101 | ( |
101 | 102 | "AgentCapabilities", |
102 | 103 | "prompt_capabilities", |
@@ -222,6 +223,7 @@ def _build_header_block() -> str: |
222 | 223 |
|
223 | 224 | def _build_alias_block() -> str: |
224 | 225 | alias_lines = [f"{old} = {new}" for old, new in sorted(RENAME_MAP.items())] |
| 226 | + alias_lines += [f"{old} = {new}" for old, new in sorted(ALIASES_MAP.items())] |
225 | 227 | return BACKCOMPAT_MARKER + "\n" + "\n".join(alias_lines) + "\n" |
226 | 228 |
|
227 | 229 |
|
@@ -421,6 +423,7 @@ def _normalize_stdio_model(content: str) -> str: |
421 | 423 | replacement_line = ' type: Literal["stdio"] = "stdio"' |
422 | 424 | new_content, count = STDIO_TYPE_PATTERN.subn(replacement_line, content) |
423 | 425 | if count == 0: |
| 426 | + print("Warning: stdio type placeholder not found; no replacements made.", file=sys.stderr) |
424 | 427 | return content |
425 | 428 | if count > 1: |
426 | 429 | print( |
|
0 commit comments