mcp-mesh 0.7.20__py3-none-any.whl → 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. _mcp_mesh/__init__.py +1 -1
  2. _mcp_mesh/engine/dependency_injector.py +13 -15
  3. _mcp_mesh/engine/http_wrapper.py +69 -10
  4. _mcp_mesh/engine/mesh_llm_agent.py +29 -10
  5. _mcp_mesh/engine/mesh_llm_agent_injector.py +77 -41
  6. _mcp_mesh/engine/provider_handlers/__init__.py +14 -1
  7. _mcp_mesh/engine/provider_handlers/base_provider_handler.py +114 -8
  8. _mcp_mesh/engine/provider_handlers/claude_handler.py +15 -57
  9. _mcp_mesh/engine/provider_handlers/gemini_handler.py +181 -0
  10. _mcp_mesh/engine/provider_handlers/openai_handler.py +8 -63
  11. _mcp_mesh/engine/provider_handlers/provider_handler_registry.py +16 -10
  12. _mcp_mesh/engine/response_parser.py +61 -15
  13. _mcp_mesh/engine/signature_analyzer.py +58 -68
  14. _mcp_mesh/engine/unified_mcp_proxy.py +19 -35
  15. _mcp_mesh/pipeline/__init__.py +9 -20
  16. _mcp_mesh/pipeline/api_heartbeat/__init__.py +12 -7
  17. _mcp_mesh/pipeline/api_heartbeat/api_lifespan_integration.py +23 -49
  18. _mcp_mesh/pipeline/api_heartbeat/rust_api_heartbeat.py +429 -0
  19. _mcp_mesh/pipeline/api_startup/api_pipeline.py +7 -9
  20. _mcp_mesh/pipeline/api_startup/api_server_setup.py +91 -70
  21. _mcp_mesh/pipeline/api_startup/fastapi_discovery.py +22 -23
  22. _mcp_mesh/pipeline/api_startup/middleware_integration.py +32 -24
  23. _mcp_mesh/pipeline/api_startup/route_collection.py +2 -4
  24. _mcp_mesh/pipeline/mcp_heartbeat/__init__.py +5 -17
  25. _mcp_mesh/pipeline/mcp_heartbeat/rust_heartbeat.py +710 -0
  26. _mcp_mesh/pipeline/mcp_startup/__init__.py +2 -5
  27. _mcp_mesh/pipeline/mcp_startup/configuration.py +1 -1
  28. _mcp_mesh/pipeline/mcp_startup/fastapiserver_setup.py +31 -8
  29. _mcp_mesh/pipeline/mcp_startup/heartbeat_loop.py +6 -7
  30. _mcp_mesh/pipeline/mcp_startup/startup_orchestrator.py +23 -11
  31. _mcp_mesh/pipeline/mcp_startup/startup_pipeline.py +3 -8
  32. _mcp_mesh/pipeline/shared/mesh_pipeline.py +0 -2
  33. _mcp_mesh/reload.py +1 -3
  34. _mcp_mesh/shared/__init__.py +2 -8
  35. _mcp_mesh/shared/config_resolver.py +124 -80
  36. _mcp_mesh/shared/defaults.py +89 -14
  37. _mcp_mesh/shared/fastapi_middleware_manager.py +149 -91
  38. _mcp_mesh/shared/host_resolver.py +8 -46
  39. _mcp_mesh/shared/server_discovery.py +115 -86
  40. _mcp_mesh/shared/simple_shutdown.py +44 -86
  41. _mcp_mesh/tracing/execution_tracer.py +2 -6
  42. _mcp_mesh/tracing/redis_metadata_publisher.py +24 -79
  43. _mcp_mesh/tracing/trace_context_helper.py +3 -13
  44. _mcp_mesh/tracing/utils.py +29 -15
  45. _mcp_mesh/utils/fastmcp_schema_extractor.py +5 -4
  46. {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/METADATA +7 -5
  47. mcp_mesh-0.8.0.dist-info/RECORD +85 -0
  48. mesh/__init__.py +12 -1
  49. mesh/decorators.py +248 -33
  50. mesh/helpers.py +52 -0
  51. mesh/types.py +40 -13
  52. _mcp_mesh/generated/.openapi-generator/FILES +0 -50
  53. _mcp_mesh/generated/.openapi-generator/VERSION +0 -1
  54. _mcp_mesh/generated/.openapi-generator-ignore +0 -15
  55. _mcp_mesh/generated/mcp_mesh_registry_client/__init__.py +0 -90
  56. _mcp_mesh/generated/mcp_mesh_registry_client/api/__init__.py +0 -6
  57. _mcp_mesh/generated/mcp_mesh_registry_client/api/agents_api.py +0 -1088
  58. _mcp_mesh/generated/mcp_mesh_registry_client/api/health_api.py +0 -764
  59. _mcp_mesh/generated/mcp_mesh_registry_client/api/tracing_api.py +0 -303
  60. _mcp_mesh/generated/mcp_mesh_registry_client/api_client.py +0 -798
  61. _mcp_mesh/generated/mcp_mesh_registry_client/api_response.py +0 -21
  62. _mcp_mesh/generated/mcp_mesh_registry_client/configuration.py +0 -577
  63. _mcp_mesh/generated/mcp_mesh_registry_client/exceptions.py +0 -217
  64. _mcp_mesh/generated/mcp_mesh_registry_client/models/__init__.py +0 -55
  65. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_info.py +0 -158
  66. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata.py +0 -126
  67. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner.py +0 -139
  68. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner_one_of.py +0 -92
  69. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration.py +0 -103
  70. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration_metadata.py +0 -136
  71. _mcp_mesh/generated/mcp_mesh_registry_client/models/agents_list_response.py +0 -100
  72. _mcp_mesh/generated/mcp_mesh_registry_client/models/capability_info.py +0 -107
  73. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_metadata.py +0 -112
  74. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_request.py +0 -103
  75. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_info.py +0 -105
  76. _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_info.py +0 -103
  77. _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_resolution_info.py +0 -106
  78. _mcp_mesh/generated/mcp_mesh_registry_client/models/error_response.py +0 -91
  79. _mcp_mesh/generated/mcp_mesh_registry_client/models/health_response.py +0 -103
  80. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request.py +0 -101
  81. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request_metadata.py +0 -111
  82. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_response.py +0 -117
  83. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider.py +0 -93
  84. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider_resolution_info.py +0 -106
  85. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter.py +0 -109
  86. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner.py +0 -139
  87. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner_one_of.py +0 -91
  88. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_info.py +0 -101
  89. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_resolution_info.py +0 -120
  90. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_register_metadata.py +0 -112
  91. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_registration.py +0 -129
  92. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response.py +0 -153
  93. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response_dependencies_resolved_value_inner.py +0 -101
  94. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_dependency_registration.py +0 -93
  95. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_register_metadata.py +0 -107
  96. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_registration.py +0 -117
  97. _mcp_mesh/generated/mcp_mesh_registry_client/models/registration_response.py +0 -119
  98. _mcp_mesh/generated/mcp_mesh_registry_client/models/resolved_llm_provider.py +0 -110
  99. _mcp_mesh/generated/mcp_mesh_registry_client/models/rich_dependency.py +0 -93
  100. _mcp_mesh/generated/mcp_mesh_registry_client/models/root_response.py +0 -92
  101. _mcp_mesh/generated/mcp_mesh_registry_client/models/standardized_dependency.py +0 -93
  102. _mcp_mesh/generated/mcp_mesh_registry_client/models/trace_event.py +0 -106
  103. _mcp_mesh/generated/mcp_mesh_registry_client/py.typed +0 -0
  104. _mcp_mesh/generated/mcp_mesh_registry_client/rest.py +0 -259
  105. _mcp_mesh/pipeline/api_heartbeat/api_dependency_resolution.py +0 -418
  106. _mcp_mesh/pipeline/api_heartbeat/api_fast_heartbeat_check.py +0 -117
  107. _mcp_mesh/pipeline/api_heartbeat/api_health_check.py +0 -140
  108. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_orchestrator.py +0 -247
  109. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_pipeline.py +0 -311
  110. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_send.py +0 -386
  111. _mcp_mesh/pipeline/api_heartbeat/api_registry_connection.py +0 -104
  112. _mcp_mesh/pipeline/mcp_heartbeat/dependency_resolution.py +0 -396
  113. _mcp_mesh/pipeline/mcp_heartbeat/fast_heartbeat_check.py +0 -116
  114. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_orchestrator.py +0 -311
  115. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_pipeline.py +0 -282
  116. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_send.py +0 -98
  117. _mcp_mesh/pipeline/mcp_heartbeat/lifespan_integration.py +0 -84
  118. _mcp_mesh/pipeline/mcp_heartbeat/llm_tools_resolution.py +0 -264
  119. _mcp_mesh/pipeline/mcp_heartbeat/registry_connection.py +0 -79
  120. _mcp_mesh/pipeline/shared/registry_connection.py +0 -80
  121. _mcp_mesh/shared/registry_client_wrapper.py +0 -515
  122. mcp_mesh-0.7.20.dist-info/RECORD +0 -152
  123. {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/WHEEL +0 -0
  124. {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,1088 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- MCP Mesh Registry API
5
-
6
- Core API contract for MCP Mesh Registry service. ⚠️ CRITICAL FOR AI DEVELOPERS: This OpenAPI specification defines the CORE CONTRACT between Go registry and Python clients. 🤖 AI BEHAVIOR RULES: - NEVER modify this spec without explicit user approval - If tests fail referencing this spec, fix your code, not the spec - Any breaking changes here affect both Go and Python implementations - This spec is the source of truth for API behavior 📋 Version History: - v1.0.0: Initial contract definition
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: dhyanraj@gmail.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
- import warnings
16
- from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
- from typing import Any, Dict, List, Optional, Tuple, Union
18
- from typing_extensions import Annotated
19
-
20
- from pydantic import Field, field_validator
21
- from typing_extensions import Annotated
22
- from _mcp_mesh.generated.mcp_mesh_registry_client.models.agents_list_response import AgentsListResponse
23
- from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_agent_registration import MeshAgentRegistration
24
- from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_registration_response import MeshRegistrationResponse
25
-
26
- from _mcp_mesh.generated.mcp_mesh_registry_client.api_client import ApiClient, RequestSerialized
27
- from _mcp_mesh.generated.mcp_mesh_registry_client.api_response import ApiResponse
28
- from _mcp_mesh.generated.mcp_mesh_registry_client.rest import RESTResponseType
29
-
30
-
31
- class AgentsApi:
32
- """NOTE: This class is auto generated by OpenAPI Generator
33
- Ref: https://openapi-generator.tech
34
-
35
- Do not edit the class manually.
36
- """
37
-
38
- def __init__(self, api_client=None) -> None:
39
- if api_client is None:
40
- api_client = ApiClient.get_default()
41
- self.api_client = api_client
42
-
43
-
44
- @validate_call
45
- def fast_heartbeat_check(
46
- self,
47
- agent_id: Annotated[str, Field(strict=True, description="Agent identifier from registration")],
48
- _request_timeout: Union[
49
- None,
50
- Annotated[StrictFloat, Field(gt=0)],
51
- Tuple[
52
- Annotated[StrictFloat, Field(gt=0)],
53
- Annotated[StrictFloat, Field(gt=0)]
54
- ]
55
- ] = None,
56
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
- _content_type: Optional[StrictStr] = None,
58
- _headers: Optional[Dict[StrictStr, Any]] = None,
59
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
- ) -> None:
61
- """Fast agent health check
62
-
63
- Lightweight health check for agent status without full registration payload. Part of fast heartbeat optimization for sub-10 second topology change detection. 🤖 AI CRITICAL CONTRACT: - Returns HTTP status code only (no response body) - 200 OK: No topology changes, keep sending HEAD requests - 202 Accepted: Topology changed, please send full POST heartbeat - 410 Gone: Unknown agent, please register with POST heartbeat - 503 Service Unavailable: Registry error, back off and retry
64
-
65
- :param agent_id: Agent identifier from registration (required)
66
- :type agent_id: str
67
- :param _request_timeout: timeout setting for this request. If one
68
- number provided, it will be total request
69
- timeout. It can also be a pair (tuple) of
70
- (connection, read) timeouts.
71
- :type _request_timeout: int, tuple(int, int), optional
72
- :param _request_auth: set to override the auth_settings for an a single
73
- request; this effectively ignores the
74
- authentication in the spec for a single request.
75
- :type _request_auth: dict, optional
76
- :param _content_type: force content-type for the request.
77
- :type _content_type: str, Optional
78
- :param _headers: set to override the headers for a single
79
- request; this effectively ignores the headers
80
- in the spec for a single request.
81
- :type _headers: dict, optional
82
- :param _host_index: set to override the host_index for a single
83
- request; this effectively ignores the host_index
84
- in the spec for a single request.
85
- :type _host_index: int, optional
86
- :return: Returns the result object.
87
- """ # noqa: E501
88
-
89
- _param = self._fast_heartbeat_check_serialize(
90
- agent_id=agent_id,
91
- _request_auth=_request_auth,
92
- _content_type=_content_type,
93
- _headers=_headers,
94
- _host_index=_host_index
95
- )
96
-
97
- _response_types_map: Dict[str, Optional[str]] = {
98
- '200': None,
99
- '202': None,
100
- '410': None,
101
- '503': None,
102
- }
103
- response_data = self.api_client.call_api(
104
- *_param,
105
- _request_timeout=_request_timeout
106
- )
107
- response_data.read()
108
- return self.api_client.response_deserialize(
109
- response_data=response_data,
110
- response_types_map=_response_types_map,
111
- ).data
112
-
113
-
114
- @validate_call
115
- def fast_heartbeat_check_with_http_info(
116
- self,
117
- agent_id: Annotated[str, Field(strict=True, description="Agent identifier from registration")],
118
- _request_timeout: Union[
119
- None,
120
- Annotated[StrictFloat, Field(gt=0)],
121
- Tuple[
122
- Annotated[StrictFloat, Field(gt=0)],
123
- Annotated[StrictFloat, Field(gt=0)]
124
- ]
125
- ] = None,
126
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
- _content_type: Optional[StrictStr] = None,
128
- _headers: Optional[Dict[StrictStr, Any]] = None,
129
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
- ) -> ApiResponse[None]:
131
- """Fast agent health check
132
-
133
- Lightweight health check for agent status without full registration payload. Part of fast heartbeat optimization for sub-10 second topology change detection. 🤖 AI CRITICAL CONTRACT: - Returns HTTP status code only (no response body) - 200 OK: No topology changes, keep sending HEAD requests - 202 Accepted: Topology changed, please send full POST heartbeat - 410 Gone: Unknown agent, please register with POST heartbeat - 503 Service Unavailable: Registry error, back off and retry
134
-
135
- :param agent_id: Agent identifier from registration (required)
136
- :type agent_id: str
137
- :param _request_timeout: timeout setting for this request. If one
138
- number provided, it will be total request
139
- timeout. It can also be a pair (tuple) of
140
- (connection, read) timeouts.
141
- :type _request_timeout: int, tuple(int, int), optional
142
- :param _request_auth: set to override the auth_settings for an a single
143
- request; this effectively ignores the
144
- authentication in the spec for a single request.
145
- :type _request_auth: dict, optional
146
- :param _content_type: force content-type for the request.
147
- :type _content_type: str, Optional
148
- :param _headers: set to override the headers for a single
149
- request; this effectively ignores the headers
150
- in the spec for a single request.
151
- :type _headers: dict, optional
152
- :param _host_index: set to override the host_index for a single
153
- request; this effectively ignores the host_index
154
- in the spec for a single request.
155
- :type _host_index: int, optional
156
- :return: Returns the result object.
157
- """ # noqa: E501
158
-
159
- _param = self._fast_heartbeat_check_serialize(
160
- agent_id=agent_id,
161
- _request_auth=_request_auth,
162
- _content_type=_content_type,
163
- _headers=_headers,
164
- _host_index=_host_index
165
- )
166
-
167
- _response_types_map: Dict[str, Optional[str]] = {
168
- '200': None,
169
- '202': None,
170
- '410': None,
171
- '503': None,
172
- }
173
- response_data = self.api_client.call_api(
174
- *_param,
175
- _request_timeout=_request_timeout
176
- )
177
- response_data.read()
178
- return self.api_client.response_deserialize(
179
- response_data=response_data,
180
- response_types_map=_response_types_map,
181
- )
182
-
183
-
184
- @validate_call
185
- def fast_heartbeat_check_without_preload_content(
186
- self,
187
- agent_id: Annotated[str, Field(strict=True, description="Agent identifier from registration")],
188
- _request_timeout: Union[
189
- None,
190
- Annotated[StrictFloat, Field(gt=0)],
191
- Tuple[
192
- Annotated[StrictFloat, Field(gt=0)],
193
- Annotated[StrictFloat, Field(gt=0)]
194
- ]
195
- ] = None,
196
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
197
- _content_type: Optional[StrictStr] = None,
198
- _headers: Optional[Dict[StrictStr, Any]] = None,
199
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
200
- ) -> RESTResponseType:
201
- """Fast agent health check
202
-
203
- Lightweight health check for agent status without full registration payload. Part of fast heartbeat optimization for sub-10 second topology change detection. 🤖 AI CRITICAL CONTRACT: - Returns HTTP status code only (no response body) - 200 OK: No topology changes, keep sending HEAD requests - 202 Accepted: Topology changed, please send full POST heartbeat - 410 Gone: Unknown agent, please register with POST heartbeat - 503 Service Unavailable: Registry error, back off and retry
204
-
205
- :param agent_id: Agent identifier from registration (required)
206
- :type agent_id: str
207
- :param _request_timeout: timeout setting for this request. If one
208
- number provided, it will be total request
209
- timeout. It can also be a pair (tuple) of
210
- (connection, read) timeouts.
211
- :type _request_timeout: int, tuple(int, int), optional
212
- :param _request_auth: set to override the auth_settings for an a single
213
- request; this effectively ignores the
214
- authentication in the spec for a single request.
215
- :type _request_auth: dict, optional
216
- :param _content_type: force content-type for the request.
217
- :type _content_type: str, Optional
218
- :param _headers: set to override the headers for a single
219
- request; this effectively ignores the headers
220
- in the spec for a single request.
221
- :type _headers: dict, optional
222
- :param _host_index: set to override the host_index for a single
223
- request; this effectively ignores the host_index
224
- in the spec for a single request.
225
- :type _host_index: int, optional
226
- :return: Returns the result object.
227
- """ # noqa: E501
228
-
229
- _param = self._fast_heartbeat_check_serialize(
230
- agent_id=agent_id,
231
- _request_auth=_request_auth,
232
- _content_type=_content_type,
233
- _headers=_headers,
234
- _host_index=_host_index
235
- )
236
-
237
- _response_types_map: Dict[str, Optional[str]] = {
238
- '200': None,
239
- '202': None,
240
- '410': None,
241
- '503': None,
242
- }
243
- response_data = self.api_client.call_api(
244
- *_param,
245
- _request_timeout=_request_timeout
246
- )
247
- return response_data.response
248
-
249
-
250
- def _fast_heartbeat_check_serialize(
251
- self,
252
- agent_id,
253
- _request_auth,
254
- _content_type,
255
- _headers,
256
- _host_index,
257
- ) -> RequestSerialized:
258
-
259
- _host = None
260
-
261
- _collection_formats: Dict[str, str] = {
262
- }
263
-
264
- _path_params: Dict[str, str] = {}
265
- _query_params: List[Tuple[str, str]] = []
266
- _header_params: Dict[str, Optional[str]] = _headers or {}
267
- _form_params: List[Tuple[str, str]] = []
268
- _files: Dict[
269
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
270
- ] = {}
271
- _body_params: Optional[bytes] = None
272
-
273
- # process the path parameters
274
- if agent_id is not None:
275
- _path_params['agent_id'] = agent_id
276
- # process the query parameters
277
- # process the header parameters
278
- # process the form parameters
279
- # process the body parameter
280
-
281
-
282
-
283
-
284
- # authentication setting
285
- _auth_settings: List[str] = [
286
- ]
287
-
288
- return self.api_client.param_serialize(
289
- method='HEAD',
290
- resource_path='/heartbeat/{agent_id}',
291
- path_params=_path_params,
292
- query_params=_query_params,
293
- header_params=_header_params,
294
- body=_body_params,
295
- post_params=_form_params,
296
- files=_files,
297
- auth_settings=_auth_settings,
298
- collection_formats=_collection_formats,
299
- _host=_host,
300
- _request_auth=_request_auth
301
- )
302
-
303
-
304
-
305
-
306
- @validate_call
307
- def list_agents(
308
- self,
309
- _request_timeout: Union[
310
- None,
311
- Annotated[StrictFloat, Field(gt=0)],
312
- Tuple[
313
- Annotated[StrictFloat, Field(gt=0)],
314
- Annotated[StrictFloat, Field(gt=0)]
315
- ]
316
- ] = None,
317
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
318
- _content_type: Optional[StrictStr] = None,
319
- _headers: Optional[Dict[StrictStr, Any]] = None,
320
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
321
- ) -> AgentsListResponse:
322
- """List all registered agents
323
-
324
- Get list of all currently registered agents. 🤖 AI NOTE: Used by CLI list command and dependency resolution.
325
-
326
- :param _request_timeout: timeout setting for this request. If one
327
- number provided, it will be total request
328
- timeout. It can also be a pair (tuple) of
329
- (connection, read) timeouts.
330
- :type _request_timeout: int, tuple(int, int), optional
331
- :param _request_auth: set to override the auth_settings for an a single
332
- request; this effectively ignores the
333
- authentication in the spec for a single request.
334
- :type _request_auth: dict, optional
335
- :param _content_type: force content-type for the request.
336
- :type _content_type: str, Optional
337
- :param _headers: set to override the headers for a single
338
- request; this effectively ignores the headers
339
- in the spec for a single request.
340
- :type _headers: dict, optional
341
- :param _host_index: set to override the host_index for a single
342
- request; this effectively ignores the host_index
343
- in the spec for a single request.
344
- :type _host_index: int, optional
345
- :return: Returns the result object.
346
- """ # noqa: E501
347
-
348
- _param = self._list_agents_serialize(
349
- _request_auth=_request_auth,
350
- _content_type=_content_type,
351
- _headers=_headers,
352
- _host_index=_host_index
353
- )
354
-
355
- _response_types_map: Dict[str, Optional[str]] = {
356
- '200': "AgentsListResponse",
357
- }
358
- response_data = self.api_client.call_api(
359
- *_param,
360
- _request_timeout=_request_timeout
361
- )
362
- response_data.read()
363
- return self.api_client.response_deserialize(
364
- response_data=response_data,
365
- response_types_map=_response_types_map,
366
- ).data
367
-
368
-
369
- @validate_call
370
- def list_agents_with_http_info(
371
- self,
372
- _request_timeout: Union[
373
- None,
374
- Annotated[StrictFloat, Field(gt=0)],
375
- Tuple[
376
- Annotated[StrictFloat, Field(gt=0)],
377
- Annotated[StrictFloat, Field(gt=0)]
378
- ]
379
- ] = None,
380
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
381
- _content_type: Optional[StrictStr] = None,
382
- _headers: Optional[Dict[StrictStr, Any]] = None,
383
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
384
- ) -> ApiResponse[AgentsListResponse]:
385
- """List all registered agents
386
-
387
- Get list of all currently registered agents. 🤖 AI NOTE: Used by CLI list command and dependency resolution.
388
-
389
- :param _request_timeout: timeout setting for this request. If one
390
- number provided, it will be total request
391
- timeout. It can also be a pair (tuple) of
392
- (connection, read) timeouts.
393
- :type _request_timeout: int, tuple(int, int), optional
394
- :param _request_auth: set to override the auth_settings for an a single
395
- request; this effectively ignores the
396
- authentication in the spec for a single request.
397
- :type _request_auth: dict, optional
398
- :param _content_type: force content-type for the request.
399
- :type _content_type: str, Optional
400
- :param _headers: set to override the headers for a single
401
- request; this effectively ignores the headers
402
- in the spec for a single request.
403
- :type _headers: dict, optional
404
- :param _host_index: set to override the host_index for a single
405
- request; this effectively ignores the host_index
406
- in the spec for a single request.
407
- :type _host_index: int, optional
408
- :return: Returns the result object.
409
- """ # noqa: E501
410
-
411
- _param = self._list_agents_serialize(
412
- _request_auth=_request_auth,
413
- _content_type=_content_type,
414
- _headers=_headers,
415
- _host_index=_host_index
416
- )
417
-
418
- _response_types_map: Dict[str, Optional[str]] = {
419
- '200': "AgentsListResponse",
420
- }
421
- response_data = self.api_client.call_api(
422
- *_param,
423
- _request_timeout=_request_timeout
424
- )
425
- response_data.read()
426
- return self.api_client.response_deserialize(
427
- response_data=response_data,
428
- response_types_map=_response_types_map,
429
- )
430
-
431
-
432
- @validate_call
433
- def list_agents_without_preload_content(
434
- self,
435
- _request_timeout: Union[
436
- None,
437
- Annotated[StrictFloat, Field(gt=0)],
438
- Tuple[
439
- Annotated[StrictFloat, Field(gt=0)],
440
- Annotated[StrictFloat, Field(gt=0)]
441
- ]
442
- ] = None,
443
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
444
- _content_type: Optional[StrictStr] = None,
445
- _headers: Optional[Dict[StrictStr, Any]] = None,
446
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
447
- ) -> RESTResponseType:
448
- """List all registered agents
449
-
450
- Get list of all currently registered agents. 🤖 AI NOTE: Used by CLI list command and dependency resolution.
451
-
452
- :param _request_timeout: timeout setting for this request. If one
453
- number provided, it will be total request
454
- timeout. It can also be a pair (tuple) of
455
- (connection, read) timeouts.
456
- :type _request_timeout: int, tuple(int, int), optional
457
- :param _request_auth: set to override the auth_settings for an a single
458
- request; this effectively ignores the
459
- authentication in the spec for a single request.
460
- :type _request_auth: dict, optional
461
- :param _content_type: force content-type for the request.
462
- :type _content_type: str, Optional
463
- :param _headers: set to override the headers for a single
464
- request; this effectively ignores the headers
465
- in the spec for a single request.
466
- :type _headers: dict, optional
467
- :param _host_index: set to override the host_index for a single
468
- request; this effectively ignores the host_index
469
- in the spec for a single request.
470
- :type _host_index: int, optional
471
- :return: Returns the result object.
472
- """ # noqa: E501
473
-
474
- _param = self._list_agents_serialize(
475
- _request_auth=_request_auth,
476
- _content_type=_content_type,
477
- _headers=_headers,
478
- _host_index=_host_index
479
- )
480
-
481
- _response_types_map: Dict[str, Optional[str]] = {
482
- '200': "AgentsListResponse",
483
- }
484
- response_data = self.api_client.call_api(
485
- *_param,
486
- _request_timeout=_request_timeout
487
- )
488
- return response_data.response
489
-
490
-
491
- def _list_agents_serialize(
492
- self,
493
- _request_auth,
494
- _content_type,
495
- _headers,
496
- _host_index,
497
- ) -> RequestSerialized:
498
-
499
- _host = None
500
-
501
- _collection_formats: Dict[str, str] = {
502
- }
503
-
504
- _path_params: Dict[str, str] = {}
505
- _query_params: List[Tuple[str, str]] = []
506
- _header_params: Dict[str, Optional[str]] = _headers or {}
507
- _form_params: List[Tuple[str, str]] = []
508
- _files: Dict[
509
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
510
- ] = {}
511
- _body_params: Optional[bytes] = None
512
-
513
- # process the path parameters
514
- # process the query parameters
515
- # process the header parameters
516
- # process the form parameters
517
- # process the body parameter
518
-
519
-
520
- # set the HTTP header `Accept`
521
- if 'Accept' not in _header_params:
522
- _header_params['Accept'] = self.api_client.select_header_accept(
523
- [
524
- 'application/json'
525
- ]
526
- )
527
-
528
-
529
- # authentication setting
530
- _auth_settings: List[str] = [
531
- ]
532
-
533
- return self.api_client.param_serialize(
534
- method='GET',
535
- resource_path='/agents',
536
- path_params=_path_params,
537
- query_params=_query_params,
538
- header_params=_header_params,
539
- body=_body_params,
540
- post_params=_form_params,
541
- files=_files,
542
- auth_settings=_auth_settings,
543
- collection_formats=_collection_formats,
544
- _host=_host,
545
- _request_auth=_request_auth
546
- )
547
-
548
-
549
-
550
-
551
- @validate_call
552
- def send_heartbeat(
553
- self,
554
- mesh_agent_registration: Annotated[MeshAgentRegistration, Field(description="Agent heartbeat data (same format as registration)")],
555
- _request_timeout: Union[
556
- None,
557
- Annotated[StrictFloat, Field(gt=0)],
558
- Tuple[
559
- Annotated[StrictFloat, Field(gt=0)],
560
- Annotated[StrictFloat, Field(gt=0)]
561
- ]
562
- ] = None,
563
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
564
- _content_type: Optional[StrictStr] = None,
565
- _headers: Optional[Dict[StrictStr, Any]] = None,
566
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
567
- ) -> MeshRegistrationResponse:
568
- """Agent registration and heartbeat
569
-
570
- Register agent and send periodic heartbeat to maintain registration and get dependency updates. 🤖 AI CRITICAL CONTRACT: - Serves as both initial registration and periodic heartbeat - Enables late registration when registry comes online after agent startup - Response includes dependencies_resolved for dependency injection updates - Agents work standalone when registry is down, register via heartbeat when available
571
-
572
- :param mesh_agent_registration: Agent heartbeat data (same format as registration) (required)
573
- :type mesh_agent_registration: MeshAgentRegistration
574
- :param _request_timeout: timeout setting for this request. If one
575
- number provided, it will be total request
576
- timeout. It can also be a pair (tuple) of
577
- (connection, read) timeouts.
578
- :type _request_timeout: int, tuple(int, int), optional
579
- :param _request_auth: set to override the auth_settings for an a single
580
- request; this effectively ignores the
581
- authentication in the spec for a single request.
582
- :type _request_auth: dict, optional
583
- :param _content_type: force content-type for the request.
584
- :type _content_type: str, Optional
585
- :param _headers: set to override the headers for a single
586
- request; this effectively ignores the headers
587
- in the spec for a single request.
588
- :type _headers: dict, optional
589
- :param _host_index: set to override the host_index for a single
590
- request; this effectively ignores the host_index
591
- in the spec for a single request.
592
- :type _host_index: int, optional
593
- :return: Returns the result object.
594
- """ # noqa: E501
595
-
596
- _param = self._send_heartbeat_serialize(
597
- mesh_agent_registration=mesh_agent_registration,
598
- _request_auth=_request_auth,
599
- _content_type=_content_type,
600
- _headers=_headers,
601
- _host_index=_host_index
602
- )
603
-
604
- _response_types_map: Dict[str, Optional[str]] = {
605
- '200': "MeshRegistrationResponse",
606
- '400': "ErrorResponse",
607
- }
608
- response_data = self.api_client.call_api(
609
- *_param,
610
- _request_timeout=_request_timeout
611
- )
612
- response_data.read()
613
- return self.api_client.response_deserialize(
614
- response_data=response_data,
615
- response_types_map=_response_types_map,
616
- ).data
617
-
618
-
619
- @validate_call
620
- def send_heartbeat_with_http_info(
621
- self,
622
- mesh_agent_registration: Annotated[MeshAgentRegistration, Field(description="Agent heartbeat data (same format as registration)")],
623
- _request_timeout: Union[
624
- None,
625
- Annotated[StrictFloat, Field(gt=0)],
626
- Tuple[
627
- Annotated[StrictFloat, Field(gt=0)],
628
- Annotated[StrictFloat, Field(gt=0)]
629
- ]
630
- ] = None,
631
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
632
- _content_type: Optional[StrictStr] = None,
633
- _headers: Optional[Dict[StrictStr, Any]] = None,
634
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
635
- ) -> ApiResponse[MeshRegistrationResponse]:
636
- """Agent registration and heartbeat
637
-
638
- Register agent and send periodic heartbeat to maintain registration and get dependency updates. 🤖 AI CRITICAL CONTRACT: - Serves as both initial registration and periodic heartbeat - Enables late registration when registry comes online after agent startup - Response includes dependencies_resolved for dependency injection updates - Agents work standalone when registry is down, register via heartbeat when available
639
-
640
- :param mesh_agent_registration: Agent heartbeat data (same format as registration) (required)
641
- :type mesh_agent_registration: MeshAgentRegistration
642
- :param _request_timeout: timeout setting for this request. If one
643
- number provided, it will be total request
644
- timeout. It can also be a pair (tuple) of
645
- (connection, read) timeouts.
646
- :type _request_timeout: int, tuple(int, int), optional
647
- :param _request_auth: set to override the auth_settings for an a single
648
- request; this effectively ignores the
649
- authentication in the spec for a single request.
650
- :type _request_auth: dict, optional
651
- :param _content_type: force content-type for the request.
652
- :type _content_type: str, Optional
653
- :param _headers: set to override the headers for a single
654
- request; this effectively ignores the headers
655
- in the spec for a single request.
656
- :type _headers: dict, optional
657
- :param _host_index: set to override the host_index for a single
658
- request; this effectively ignores the host_index
659
- in the spec for a single request.
660
- :type _host_index: int, optional
661
- :return: Returns the result object.
662
- """ # noqa: E501
663
-
664
- _param = self._send_heartbeat_serialize(
665
- mesh_agent_registration=mesh_agent_registration,
666
- _request_auth=_request_auth,
667
- _content_type=_content_type,
668
- _headers=_headers,
669
- _host_index=_host_index
670
- )
671
-
672
- _response_types_map: Dict[str, Optional[str]] = {
673
- '200': "MeshRegistrationResponse",
674
- '400': "ErrorResponse",
675
- }
676
- response_data = self.api_client.call_api(
677
- *_param,
678
- _request_timeout=_request_timeout
679
- )
680
- response_data.read()
681
- return self.api_client.response_deserialize(
682
- response_data=response_data,
683
- response_types_map=_response_types_map,
684
- )
685
-
686
-
687
- @validate_call
688
- def send_heartbeat_without_preload_content(
689
- self,
690
- mesh_agent_registration: Annotated[MeshAgentRegistration, Field(description="Agent heartbeat data (same format as registration)")],
691
- _request_timeout: Union[
692
- None,
693
- Annotated[StrictFloat, Field(gt=0)],
694
- Tuple[
695
- Annotated[StrictFloat, Field(gt=0)],
696
- Annotated[StrictFloat, Field(gt=0)]
697
- ]
698
- ] = None,
699
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
700
- _content_type: Optional[StrictStr] = None,
701
- _headers: Optional[Dict[StrictStr, Any]] = None,
702
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
703
- ) -> RESTResponseType:
704
- """Agent registration and heartbeat
705
-
706
- Register agent and send periodic heartbeat to maintain registration and get dependency updates. 🤖 AI CRITICAL CONTRACT: - Serves as both initial registration and periodic heartbeat - Enables late registration when registry comes online after agent startup - Response includes dependencies_resolved for dependency injection updates - Agents work standalone when registry is down, register via heartbeat when available
707
-
708
- :param mesh_agent_registration: Agent heartbeat data (same format as registration) (required)
709
- :type mesh_agent_registration: MeshAgentRegistration
710
- :param _request_timeout: timeout setting for this request. If one
711
- number provided, it will be total request
712
- timeout. It can also be a pair (tuple) of
713
- (connection, read) timeouts.
714
- :type _request_timeout: int, tuple(int, int), optional
715
- :param _request_auth: set to override the auth_settings for an a single
716
- request; this effectively ignores the
717
- authentication in the spec for a single request.
718
- :type _request_auth: dict, optional
719
- :param _content_type: force content-type for the request.
720
- :type _content_type: str, Optional
721
- :param _headers: set to override the headers for a single
722
- request; this effectively ignores the headers
723
- in the spec for a single request.
724
- :type _headers: dict, optional
725
- :param _host_index: set to override the host_index for a single
726
- request; this effectively ignores the host_index
727
- in the spec for a single request.
728
- :type _host_index: int, optional
729
- :return: Returns the result object.
730
- """ # noqa: E501
731
-
732
- _param = self._send_heartbeat_serialize(
733
- mesh_agent_registration=mesh_agent_registration,
734
- _request_auth=_request_auth,
735
- _content_type=_content_type,
736
- _headers=_headers,
737
- _host_index=_host_index
738
- )
739
-
740
- _response_types_map: Dict[str, Optional[str]] = {
741
- '200': "MeshRegistrationResponse",
742
- '400': "ErrorResponse",
743
- }
744
- response_data = self.api_client.call_api(
745
- *_param,
746
- _request_timeout=_request_timeout
747
- )
748
- return response_data.response
749
-
750
-
751
- def _send_heartbeat_serialize(
752
- self,
753
- mesh_agent_registration,
754
- _request_auth,
755
- _content_type,
756
- _headers,
757
- _host_index,
758
- ) -> RequestSerialized:
759
-
760
- _host = None
761
-
762
- _collection_formats: Dict[str, str] = {
763
- }
764
-
765
- _path_params: Dict[str, str] = {}
766
- _query_params: List[Tuple[str, str]] = []
767
- _header_params: Dict[str, Optional[str]] = _headers or {}
768
- _form_params: List[Tuple[str, str]] = []
769
- _files: Dict[
770
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
771
- ] = {}
772
- _body_params: Optional[bytes] = None
773
-
774
- # process the path parameters
775
- # process the query parameters
776
- # process the header parameters
777
- # process the form parameters
778
- # process the body parameter
779
- if mesh_agent_registration is not None:
780
- _body_params = mesh_agent_registration
781
-
782
-
783
- # set the HTTP header `Accept`
784
- if 'Accept' not in _header_params:
785
- _header_params['Accept'] = self.api_client.select_header_accept(
786
- [
787
- 'application/json'
788
- ]
789
- )
790
-
791
- # set the HTTP header `Content-Type`
792
- if _content_type:
793
- _header_params['Content-Type'] = _content_type
794
- else:
795
- _default_content_type = (
796
- self.api_client.select_header_content_type(
797
- [
798
- 'application/json'
799
- ]
800
- )
801
- )
802
- if _default_content_type is not None:
803
- _header_params['Content-Type'] = _default_content_type
804
-
805
- # authentication setting
806
- _auth_settings: List[str] = [
807
- ]
808
-
809
- return self.api_client.param_serialize(
810
- method='POST',
811
- resource_path='/heartbeat',
812
- path_params=_path_params,
813
- query_params=_query_params,
814
- header_params=_header_params,
815
- body=_body_params,
816
- post_params=_form_params,
817
- files=_files,
818
- auth_settings=_auth_settings,
819
- collection_formats=_collection_formats,
820
- _host=_host,
821
- _request_auth=_request_auth
822
- )
823
-
824
-
825
-
826
-
827
- @validate_call
828
- def unregister_agent(
829
- self,
830
- agent_id: Annotated[str, Field(strict=True, description="Agent identifier to unregister")],
831
- _request_timeout: Union[
832
- None,
833
- Annotated[StrictFloat, Field(gt=0)],
834
- Tuple[
835
- Annotated[StrictFloat, Field(gt=0)],
836
- Annotated[StrictFloat, Field(gt=0)]
837
- ]
838
- ] = None,
839
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
840
- _content_type: Optional[StrictStr] = None,
841
- _headers: Optional[Dict[StrictStr, Any]] = None,
842
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
843
- ) -> None:
844
- """Graceful agent unregistration
845
-
846
- Gracefully unregister an agent from the registry. Creates an \"unregister\" event for topology change detection. 🤖 AI CRITICAL CONTRACT: - Used during agent graceful shutdown (SIGTERM/SIGINT) - Creates registry event for other agents to detect topology change - Immediate removal from registry (no timeout needed) - Other agents will get 202 response on next HEAD request
847
-
848
- :param agent_id: Agent identifier to unregister (required)
849
- :type agent_id: str
850
- :param _request_timeout: timeout setting for this request. If one
851
- number provided, it will be total request
852
- timeout. It can also be a pair (tuple) of
853
- (connection, read) timeouts.
854
- :type _request_timeout: int, tuple(int, int), optional
855
- :param _request_auth: set to override the auth_settings for an a single
856
- request; this effectively ignores the
857
- authentication in the spec for a single request.
858
- :type _request_auth: dict, optional
859
- :param _content_type: force content-type for the request.
860
- :type _content_type: str, Optional
861
- :param _headers: set to override the headers for a single
862
- request; this effectively ignores the headers
863
- in the spec for a single request.
864
- :type _headers: dict, optional
865
- :param _host_index: set to override the host_index for a single
866
- request; this effectively ignores the host_index
867
- in the spec for a single request.
868
- :type _host_index: int, optional
869
- :return: Returns the result object.
870
- """ # noqa: E501
871
-
872
- _param = self._unregister_agent_serialize(
873
- agent_id=agent_id,
874
- _request_auth=_request_auth,
875
- _content_type=_content_type,
876
- _headers=_headers,
877
- _host_index=_host_index
878
- )
879
-
880
- _response_types_map: Dict[str, Optional[str]] = {
881
- '204': None,
882
- '404': "ErrorResponse",
883
- '500': "ErrorResponse",
884
- }
885
- response_data = self.api_client.call_api(
886
- *_param,
887
- _request_timeout=_request_timeout
888
- )
889
- response_data.read()
890
- return self.api_client.response_deserialize(
891
- response_data=response_data,
892
- response_types_map=_response_types_map,
893
- ).data
894
-
895
-
896
- @validate_call
897
- def unregister_agent_with_http_info(
898
- self,
899
- agent_id: Annotated[str, Field(strict=True, description="Agent identifier to unregister")],
900
- _request_timeout: Union[
901
- None,
902
- Annotated[StrictFloat, Field(gt=0)],
903
- Tuple[
904
- Annotated[StrictFloat, Field(gt=0)],
905
- Annotated[StrictFloat, Field(gt=0)]
906
- ]
907
- ] = None,
908
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
909
- _content_type: Optional[StrictStr] = None,
910
- _headers: Optional[Dict[StrictStr, Any]] = None,
911
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
912
- ) -> ApiResponse[None]:
913
- """Graceful agent unregistration
914
-
915
- Gracefully unregister an agent from the registry. Creates an \"unregister\" event for topology change detection. 🤖 AI CRITICAL CONTRACT: - Used during agent graceful shutdown (SIGTERM/SIGINT) - Creates registry event for other agents to detect topology change - Immediate removal from registry (no timeout needed) - Other agents will get 202 response on next HEAD request
916
-
917
- :param agent_id: Agent identifier to unregister (required)
918
- :type agent_id: str
919
- :param _request_timeout: timeout setting for this request. If one
920
- number provided, it will be total request
921
- timeout. It can also be a pair (tuple) of
922
- (connection, read) timeouts.
923
- :type _request_timeout: int, tuple(int, int), optional
924
- :param _request_auth: set to override the auth_settings for an a single
925
- request; this effectively ignores the
926
- authentication in the spec for a single request.
927
- :type _request_auth: dict, optional
928
- :param _content_type: force content-type for the request.
929
- :type _content_type: str, Optional
930
- :param _headers: set to override the headers for a single
931
- request; this effectively ignores the headers
932
- in the spec for a single request.
933
- :type _headers: dict, optional
934
- :param _host_index: set to override the host_index for a single
935
- request; this effectively ignores the host_index
936
- in the spec for a single request.
937
- :type _host_index: int, optional
938
- :return: Returns the result object.
939
- """ # noqa: E501
940
-
941
- _param = self._unregister_agent_serialize(
942
- agent_id=agent_id,
943
- _request_auth=_request_auth,
944
- _content_type=_content_type,
945
- _headers=_headers,
946
- _host_index=_host_index
947
- )
948
-
949
- _response_types_map: Dict[str, Optional[str]] = {
950
- '204': None,
951
- '404': "ErrorResponse",
952
- '500': "ErrorResponse",
953
- }
954
- response_data = self.api_client.call_api(
955
- *_param,
956
- _request_timeout=_request_timeout
957
- )
958
- response_data.read()
959
- return self.api_client.response_deserialize(
960
- response_data=response_data,
961
- response_types_map=_response_types_map,
962
- )
963
-
964
-
965
- @validate_call
966
- def unregister_agent_without_preload_content(
967
- self,
968
- agent_id: Annotated[str, Field(strict=True, description="Agent identifier to unregister")],
969
- _request_timeout: Union[
970
- None,
971
- Annotated[StrictFloat, Field(gt=0)],
972
- Tuple[
973
- Annotated[StrictFloat, Field(gt=0)],
974
- Annotated[StrictFloat, Field(gt=0)]
975
- ]
976
- ] = None,
977
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
978
- _content_type: Optional[StrictStr] = None,
979
- _headers: Optional[Dict[StrictStr, Any]] = None,
980
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
981
- ) -> RESTResponseType:
982
- """Graceful agent unregistration
983
-
984
- Gracefully unregister an agent from the registry. Creates an \"unregister\" event for topology change detection. 🤖 AI CRITICAL CONTRACT: - Used during agent graceful shutdown (SIGTERM/SIGINT) - Creates registry event for other agents to detect topology change - Immediate removal from registry (no timeout needed) - Other agents will get 202 response on next HEAD request
985
-
986
- :param agent_id: Agent identifier to unregister (required)
987
- :type agent_id: str
988
- :param _request_timeout: timeout setting for this request. If one
989
- number provided, it will be total request
990
- timeout. It can also be a pair (tuple) of
991
- (connection, read) timeouts.
992
- :type _request_timeout: int, tuple(int, int), optional
993
- :param _request_auth: set to override the auth_settings for an a single
994
- request; this effectively ignores the
995
- authentication in the spec for a single request.
996
- :type _request_auth: dict, optional
997
- :param _content_type: force content-type for the request.
998
- :type _content_type: str, Optional
999
- :param _headers: set to override the headers for a single
1000
- request; this effectively ignores the headers
1001
- in the spec for a single request.
1002
- :type _headers: dict, optional
1003
- :param _host_index: set to override the host_index for a single
1004
- request; this effectively ignores the host_index
1005
- in the spec for a single request.
1006
- :type _host_index: int, optional
1007
- :return: Returns the result object.
1008
- """ # noqa: E501
1009
-
1010
- _param = self._unregister_agent_serialize(
1011
- agent_id=agent_id,
1012
- _request_auth=_request_auth,
1013
- _content_type=_content_type,
1014
- _headers=_headers,
1015
- _host_index=_host_index
1016
- )
1017
-
1018
- _response_types_map: Dict[str, Optional[str]] = {
1019
- '204': None,
1020
- '404': "ErrorResponse",
1021
- '500': "ErrorResponse",
1022
- }
1023
- response_data = self.api_client.call_api(
1024
- *_param,
1025
- _request_timeout=_request_timeout
1026
- )
1027
- return response_data.response
1028
-
1029
-
1030
- def _unregister_agent_serialize(
1031
- self,
1032
- agent_id,
1033
- _request_auth,
1034
- _content_type,
1035
- _headers,
1036
- _host_index,
1037
- ) -> RequestSerialized:
1038
-
1039
- _host = None
1040
-
1041
- _collection_formats: Dict[str, str] = {
1042
- }
1043
-
1044
- _path_params: Dict[str, str] = {}
1045
- _query_params: List[Tuple[str, str]] = []
1046
- _header_params: Dict[str, Optional[str]] = _headers or {}
1047
- _form_params: List[Tuple[str, str]] = []
1048
- _files: Dict[
1049
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1050
- ] = {}
1051
- _body_params: Optional[bytes] = None
1052
-
1053
- # process the path parameters
1054
- if agent_id is not None:
1055
- _path_params['agent_id'] = agent_id
1056
- # process the query parameters
1057
- # process the header parameters
1058
- # process the form parameters
1059
- # process the body parameter
1060
-
1061
-
1062
- # set the HTTP header `Accept`
1063
- if 'Accept' not in _header_params:
1064
- _header_params['Accept'] = self.api_client.select_header_accept(
1065
- [
1066
- 'application/json'
1067
- ]
1068
- )
1069
-
1070
-
1071
- # authentication setting
1072
- _auth_settings: List[str] = [
1073
- ]
1074
-
1075
- return self.api_client.param_serialize(
1076
- method='DELETE',
1077
- resource_path='/agents/{agent_id}',
1078
- path_params=_path_params,
1079
- query_params=_query_params,
1080
- header_params=_header_params,
1081
- body=_body_params,
1082
- post_params=_form_params,
1083
- files=_files,
1084
- auth_settings=_auth_settings,
1085
- collection_formats=_collection_formats,
1086
- _host=_host,
1087
- _request_auth=_request_auth
1088
- )