@@ -96,7 +96,7 @@ def __exit__(self, *args: object) -> None:
9696 """Context manager exit."""
9797 self .close ()
9898
99- async def register_agent (self ) -> dict :
99+ async def register_agent (self ) -> dict [ str , Any ] :
100100 """
101101 Register the agent with the governance gateway.
102102
@@ -125,11 +125,12 @@ async def register_agent(self) -> dict:
125125 json = body if body else None ,
126126 )
127127 response .raise_for_status ()
128- return response .json ()
128+ data : dict [str , Any ] = response .json ()
129+ return data
129130 except httpx .HTTPError as e :
130131 raise GatewayError (f"Failed to register agent: { e } " ) from e
131132
132- async def check_policy_compliance (self , action : str ) -> dict :
133+ async def check_policy_compliance (self , action : str ) -> dict [ str , Any ] :
133134 """
134135 Check if an action complies with governance policies.
135136
@@ -148,7 +149,8 @@ async def check_policy_compliance(self, action: str) -> dict:
148149 json = {"action" : action },
149150 )
150151 response .raise_for_status ()
151- return response .json ()
152+ data : dict [str , Any ] = response .json ()
153+ return data
152154 except httpx .HTTPError as e :
153155 raise GatewayError (f"Failed to check policy compliance: { e } " ) from e
154156
@@ -157,8 +159,8 @@ def report_edge(
157159 source_agent_id : str ,
158160 target_agent_id : str ,
159161 edge_type : str ,
160- metadata : dict | None = None ,
161- ) -> dict :
162+ metadata : dict [ str , Any ] | None = None ,
163+ ) -> dict [ str , Any ] :
162164 """
163165 Report a directed edge between two agents to the topology store.
164166
@@ -176,7 +178,7 @@ def report_edge(
176178 """
177179 import json as _json
178180
179- body : dict = {
181+ body : dict [ str , str ] = {
180182 "source_agent_id" : source_agent_id ,
181183 "target_agent_id" : target_agent_id ,
182184 "edge_type" : edge_type ,
@@ -186,7 +188,8 @@ def report_edge(
186188 try :
187189 response = self .client .post ("/topology/edges" , json = body )
188190 response .raise_for_status ()
189- return response .json ()
191+ data : dict [str , Any ] = response .json ()
192+ return data
190193 except httpx .HTTPError as e :
191194 raise GatewayError (f"Failed to report edge: { e } " ) from e
192195
0 commit comments