meshagent-api 0.41.4__tar.gz → 0.41.6__tar.gz

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 (66) hide show
  1. {meshagent_api-0.41.4/meshagent_api.egg-info → meshagent_api-0.41.6}/PKG-INFO +1 -1
  2. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/client.py +42 -0
  3. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/client_test.py +62 -0
  4. meshagent_api-0.41.6/meshagent/api/version.py +1 -0
  5. {meshagent_api-0.41.4 → meshagent_api-0.41.6/meshagent_api.egg-info}/PKG-INFO +1 -1
  6. meshagent_api-0.41.4/meshagent/api/version.py +0 -1
  7. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/LICENSE +0 -0
  8. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/MANIFEST.in +0 -0
  9. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/README.md +0 -0
  10. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/__init__.py +0 -0
  11. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/agent_content.py +0 -0
  12. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/aiohttp_redaction.py +0 -0
  13. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/chan.py +0 -0
  14. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/crdt.py +0 -0
  15. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/dataset_schema.py +0 -0
  16. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/entrypoint.js +0 -0
  17. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/error_codes.py +0 -0
  18. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/helpers.py +0 -0
  19. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/http.py +0 -0
  20. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/image_runtime.py +0 -0
  21. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/keys.py +0 -0
  22. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/managed_agents.py +0 -0
  23. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/managed_agents_test.py +0 -0
  24. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/messaging.py +0 -0
  25. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/messaging_test.py +0 -0
  26. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/oauth.py +0 -0
  27. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/oauth_scopes.py +0 -0
  28. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/oauth_scopes_test.py +0 -0
  29. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/participant.py +0 -0
  30. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/participant_token.py +0 -0
  31. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/participant_token_test.py +0 -0
  32. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/port_forward.py +0 -0
  33. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/port_forward_test.py +0 -0
  34. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/protocol.py +0 -0
  35. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/protocol_test.py +0 -0
  36. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/py.typed +0 -0
  37. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/reasoning_schema.py +0 -0
  38. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/registry_auth.py +0 -0
  39. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/room_ports.py +0 -0
  40. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/room_server_client.py +0 -0
  41. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/room_server_client_test.py +0 -0
  42. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/runtime.py +0 -0
  43. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/runtime_test.py +0 -0
  44. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/schema.py +0 -0
  45. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/schema_document.py +0 -0
  46. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/schema_document_test.py +0 -0
  47. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/schema_registry.py +0 -0
  48. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/schema_test.py +0 -0
  49. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/schema_util.py +0 -0
  50. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/service_spec_test.py +0 -0
  51. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/service_template_test.py +0 -0
  52. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/services.py +0 -0
  53. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/specs/service.py +0 -0
  54. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/sql.py +0 -0
  55. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/sql_test.py +0 -0
  56. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/token_test.py +0 -0
  57. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/urls.py +0 -0
  58. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/webhooks.py +0 -0
  59. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/websocket_protocol.py +0 -0
  60. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent/api/websocket_protocol_test.py +0 -0
  61. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent_api.egg-info/SOURCES.txt +0 -0
  62. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent_api.egg-info/dependency_links.txt +0 -0
  63. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent_api.egg-info/requires.txt +0 -0
  64. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/meshagent_api.egg-info/top_level.txt +0 -0
  65. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/pyproject.toml +0 -0
  66. {meshagent_api-0.41.4 → meshagent_api-0.41.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-api
3
- Version: 0.41.4
3
+ Version: 0.41.6
4
4
  Summary: Python Server API for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -2,6 +2,7 @@ import aiohttp
2
2
  import base64
3
3
  import json
4
4
  import re
5
+ from urllib.parse import quote
5
6
  from typing import Any, Dict, List, Optional, Literal, TypeVar
6
7
  from pydantic import (
7
8
  BaseModel,
@@ -2700,6 +2701,26 @@ class Meshagent:
2700
2701
  except ValidationError as exc:
2701
2702
  raise RoomException(f"Invalid service payload: {exc}") from exc
2702
2703
 
2704
+ async def get_service_by_name(
2705
+ self, *, project_id: str, service_name: str
2706
+ ) -> ServiceSpec:
2707
+ """
2708
+ GET /accounts/projects/{project_id}/services/by-name/{service_name}
2709
+ Returns a `Service` instance.
2710
+ """
2711
+ service_name_path = quote(service_name, safe="")
2712
+ url = (
2713
+ f"{self.base_url}/accounts/projects/{project_id}"
2714
+ f"/services/by-name/{service_name_path}"
2715
+ )
2716
+ async with self._session.get(url, headers=self._get_headers()) as resp:
2717
+ await self._raise_for_status(resp)
2718
+ raw = await resp.text()
2719
+ try:
2720
+ return ServiceSpec.model_validate_json(raw)
2721
+ except ValidationError as exc:
2722
+ raise RoomException(f"Invalid service payload: {exc}") from exc
2723
+
2703
2724
  async def list_services(self, *, project_id: str) -> List[ServiceSpec]:
2704
2725
  """
2705
2726
  GET /accounts/projects/{project_id}/services
@@ -2858,6 +2879,27 @@ class Meshagent:
2858
2879
  except ValidationError as exc:
2859
2880
  raise RoomException(f"Invalid service payload: {exc}") from exc
2860
2881
 
2882
+ async def get_room_service_by_name(
2883
+ self, *, project_id: str, room_name: str, service_name: str
2884
+ ) -> ServiceSpec:
2885
+ """
2886
+ GET /accounts/projects/{project_id}/rooms/{room_name}/services/by-name/{service_name}
2887
+ Returns a `Service` instance.
2888
+ """
2889
+ room_name_path = quote(room_name, safe="")
2890
+ service_name_path = quote(service_name, safe="")
2891
+ url = (
2892
+ f"{self.base_url}/accounts/projects/{project_id}/rooms/{room_name_path}"
2893
+ f"/services/by-name/{service_name_path}"
2894
+ )
2895
+ async with self._session.get(url, headers=self._get_headers()) as resp:
2896
+ await self._raise_for_status(resp)
2897
+ raw = await resp.text()
2898
+ try:
2899
+ return ServiceSpec.model_validate_json(raw)
2900
+ except ValidationError as exc:
2901
+ raise RoomException(f"Invalid service payload: {exc}") from exc
2902
+
2861
2903
  async def list_room_services(
2862
2904
  self, *, project_id: str, room_name: str
2863
2905
  ) -> List[ServiceSpec]:
@@ -253,6 +253,68 @@ async def test_create_room_service_omits_client_supplied_id():
253
253
  ]
254
254
 
255
255
 
256
+ @pytest.mark.asyncio
257
+ async def test_get_service_by_name_uses_by_name_endpoint():
258
+ session = _FakeSession(
259
+ [
260
+ _FakeResponse(
261
+ status=200,
262
+ payload={
263
+ "version": "v1",
264
+ "kind": "Service",
265
+ "id": "svc_123",
266
+ "metadata": {"name": "worker"},
267
+ },
268
+ )
269
+ ]
270
+ )
271
+ client = Meshagent(base_url="http://example.test", token="token", session=session)
272
+
273
+ service = await client.get_service_by_name(
274
+ project_id="proj_123", service_name="worker/service"
275
+ )
276
+
277
+ assert service.id == "svc_123"
278
+ assert session.calls == [
279
+ (
280
+ "get",
281
+ "http://example.test/accounts/projects/proj_123/services/by-name/worker%2Fservice",
282
+ None,
283
+ )
284
+ ]
285
+
286
+
287
+ @pytest.mark.asyncio
288
+ async def test_get_room_service_by_name_uses_by_name_endpoint():
289
+ session = _FakeSession(
290
+ [
291
+ _FakeResponse(
292
+ status=200,
293
+ payload={
294
+ "version": "v1",
295
+ "kind": "Service",
296
+ "id": "svc_123",
297
+ "metadata": {"name": "worker"},
298
+ },
299
+ )
300
+ ]
301
+ )
302
+ client = Meshagent(base_url="http://example.test", token="token", session=session)
303
+
304
+ service = await client.get_room_service_by_name(
305
+ project_id="proj_123", room_name="room 1", service_name="worker/service"
306
+ )
307
+
308
+ assert service.id == "svc_123"
309
+ assert session.calls == [
310
+ (
311
+ "get",
312
+ "http://example.test/accounts/projects/proj_123/rooms/room%201/services/by-name/worker%2Fservice",
313
+ None,
314
+ )
315
+ ]
316
+
317
+
256
318
  @pytest.mark.asyncio
257
319
  async def test_update_scheduled_task_replaces_spec():
258
320
  session = _FakeSession([_FakeResponse(status=200, payload={})])
@@ -0,0 +1 @@
1
+ __version__ = "0.41.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-api
3
- Version: 0.41.4
3
+ Version: 0.41.6
4
4
  Summary: Python Server API for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -1 +0,0 @@
1
- __version__ = "0.41.4"
File without changes
File without changes
File without changes