@@ -73,9 +73,9 @@ async def requestPermission(
7373 option = _pick_preferred_option (params .options )
7474 if option is None :
7575 return RequestPermissionResponse (outcome = DeniedOutcome (outcome = "cancelled" ))
76- return RequestPermissionResponse (outcome = AllowedOutcome (optionId = option .optionId , outcome = "selected" ))
76+ return RequestPermissionResponse (outcome = AllowedOutcome (option_id = option .option_id , outcome = "selected" ))
7777
78- title = params .toolCall .title or "<permission>"
78+ title = params .tool_call .title or "<permission>"
7979 if not params .options :
8080 print (f"\n 🔐 Permission requested: { title } (no options, cancelling)" )
8181 return RequestPermissionResponse (outcome = DeniedOutcome (outcome = "cancelled" ))
@@ -92,7 +92,9 @@ async def requestPermission(
9292 idx = int (choice ) - 1
9393 if 0 <= idx < len (params .options ):
9494 opt = params .options [idx ]
95- return RequestPermissionResponse (outcome = AllowedOutcome (optionId = opt .optionId , outcome = "selected" ))
95+ return RequestPermissionResponse (
96+ outcome = AllowedOutcome (option_id = opt .option_id , outcome = "selected" )
97+ )
9698 print ("Invalid selection, try again." )
9799
98100 async def writeTextFile (
@@ -141,13 +143,13 @@ async def sessionUpdate(
141143 print (f"\n 🔧 { update .title } ({ update .status or 'pending' } )" )
142144 elif isinstance (update , ToolCallProgress ):
143145 status = update .status or "in_progress"
144- print (f"\n 🔧 Tool call `{ update .toolCallId } ` → { status } " )
146+ print (f"\n 🔧 Tool call `{ update .tool_call_id } ` → { status } " )
145147 if update .content :
146148 for item in update .content :
147149 if isinstance (item , FileEditToolCallContent ):
148150 print (f" diff: { item .path } " )
149151 elif isinstance (item , TerminalToolCallContent ):
150- print (f" terminal: { item .terminalId } " )
152+ print (f" terminal: { item .terminal_id } " )
151153 elif isinstance (item , dict ):
152154 print (f" content: { json .dumps (item , indent = 2 )} " )
153155 else :
@@ -159,7 +161,7 @@ async def createTerminal(
159161 params : CreateTerminalRequest ,
160162 ) -> CreateTerminalResponse : # type: ignore[override]
161163 print (f"[Client] createTerminal: { params } " )
162- return CreateTerminalResponse (terminalId = "term-1" )
164+ return CreateTerminalResponse (terminal_id = "term-1" )
163165
164166 async def terminalOutput (
165167 self ,
@@ -246,13 +248,13 @@ async def interactive_loop(conn: ClientSideConnection, session_id: str) -> None:
246248 if line in {":exit" , ":quit" }:
247249 break
248250 if line == ":cancel" :
249- await conn .cancel (CancelNotification (sessionId = session_id ))
251+ await conn .cancel (CancelNotification (session_id = session_id ))
250252 continue
251253
252254 try :
253255 await conn .prompt (
254256 PromptRequest (
255- sessionId = session_id ,
257+ session_id = session_id ,
256258 prompt = [text_block (line )],
257259 )
258260 )
@@ -321,9 +323,9 @@ async def run(argv: list[str]) -> int:
321323 try :
322324 init_resp = await conn .initialize (
323325 InitializeRequest (
324- protocolVersion = PROTOCOL_VERSION ,
325- clientCapabilities = ClientCapabilities (
326- fs = FileSystemCapability (readTextFile = True , writeTextFile = True ),
326+ protocol_version = PROTOCOL_VERSION ,
327+ client_capabilities = ClientCapabilities (
328+ fs = FileSystemCapability (read_text_file = True , write_text_file = True ),
327329 terminal = True ,
328330 ),
329331 )
@@ -337,13 +339,13 @@ async def run(argv: list[str]) -> int:
337339 await _shutdown (proc , conn )
338340 return 1
339341
340- print (f"✅ Connected to Gemini (protocol v{ init_resp .protocolVersion } )" )
342+ print (f"✅ Connected to Gemini (protocol v{ init_resp .protocol_version } )" )
341343
342344 try :
343345 session = await conn .newSession (
344346 NewSessionRequest (
345347 cwd = os .getcwd (),
346- mcpServers = [],
348+ mcp_servers = [],
347349 )
348350 )
349351 except RequestError as err :
@@ -355,10 +357,10 @@ async def run(argv: list[str]) -> int:
355357 await _shutdown (proc , conn )
356358 return 1
357359
358- print (f"📝 Created session: { session .sessionId } " )
360+ print (f"📝 Created session: { session .session_id } " )
359361
360362 try :
361- await interactive_loop (conn , session .sessionId )
363+ await interactive_loop (conn , session .session_id )
362364 finally :
363365 await _shutdown (proc , conn )
364366
0 commit comments