meshagent-api 0.46.0__tar.gz → 0.46.2__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 (67) hide show
  1. {meshagent_api-0.46.0/meshagent_api.egg-info → meshagent_api-0.46.2}/PKG-INFO +1 -1
  2. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/__init__.py +4 -0
  3. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/client.py +40 -14
  4. meshagent_api-0.46.2/meshagent/api/version.py +1 -0
  5. {meshagent_api-0.46.0 → meshagent_api-0.46.2/meshagent_api.egg-info}/PKG-INFO +1 -1
  6. meshagent_api-0.46.0/meshagent/api/version.py +0 -1
  7. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/LICENSE +0 -0
  8. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/MANIFEST.in +0 -0
  9. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/README.md +0 -0
  10. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/agent_content.py +0 -0
  11. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/aiohttp_redaction.py +0 -0
  12. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/chan.py +0 -0
  13. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/client_test.py +0 -0
  14. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/crdt.py +0 -0
  15. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/dataset_schema.py +0 -0
  16. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/entrypoint.js +0 -0
  17. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/error_codes.py +0 -0
  18. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/helpers.py +0 -0
  19. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/http.py +0 -0
  20. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/image_runtime.py +0 -0
  21. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/keys.py +0 -0
  22. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/managed_agents.py +0 -0
  23. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/managed_agents_test.py +0 -0
  24. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/messaging.py +0 -0
  25. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/messaging_test.py +0 -0
  26. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/oauth.py +0 -0
  27. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/oauth_scopes.py +0 -0
  28. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/oauth_scopes_test.py +0 -0
  29. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/participant.py +0 -0
  30. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/participant_token.py +0 -0
  31. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/participant_token_test.py +0 -0
  32. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/port_forward.py +0 -0
  33. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/port_forward_test.py +0 -0
  34. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/protocol.py +0 -0
  35. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/protocol_test.py +0 -0
  36. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/py.typed +0 -0
  37. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/reasoning_schema.py +0 -0
  38. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/registry_auth.py +0 -0
  39. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/room_ports.py +0 -0
  40. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/room_server_client.py +0 -0
  41. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/room_server_client_test.py +0 -0
  42. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/runtime.py +0 -0
  43. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/runtime_test.py +0 -0
  44. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/schema.py +0 -0
  45. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/schema_document.py +0 -0
  46. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/schema_document_test.py +0 -0
  47. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/schema_registry.py +0 -0
  48. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/schema_test.py +0 -0
  49. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/schema_util.py +0 -0
  50. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/service_spec_test.py +0 -0
  51. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/service_template_test.py +0 -0
  52. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/services.py +0 -0
  53. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/specs/service.py +0 -0
  54. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/sql.py +0 -0
  55. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/sql_test.py +0 -0
  56. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/token_test.py +0 -0
  57. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/urls.py +0 -0
  58. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/webhooks.py +0 -0
  59. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/webhooks_test.py +0 -0
  60. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/websocket_protocol.py +0 -0
  61. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent/api/websocket_protocol_test.py +0 -0
  62. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent_api.egg-info/SOURCES.txt +0 -0
  63. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent_api.egg-info/dependency_links.txt +0 -0
  64. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent_api.egg-info/requires.txt +0 -0
  65. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/meshagent_api.egg-info/top_level.txt +0 -0
  66. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/pyproject.toml +0 -0
  67. {meshagent_api-0.46.0 → meshagent_api-0.46.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-api
3
- Version: 0.46.0
3
+ Version: 0.46.2
4
4
  Summary: Python Server API for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -33,10 +33,12 @@ from .room_server_client import (
33
33
  )
34
34
  from .client import (
35
35
  Meshagent,
36
+ CreateProjectRequest,
36
37
  CreateProjectRepositoryRequest,
37
38
  CreateRepositoryTokenRequest,
38
39
  UpdateProjectRepositoryRequest,
39
40
  ProjectInfo,
41
+ ProjectsPage,
40
42
  ProjectRepository,
41
43
  RepositoryToken,
42
44
  )
@@ -104,10 +106,12 @@ from .dataset_schema import LANCE_COMPRESSION_METADATA_KEY, LANCE_ZSTD_FIELD_MET
104
106
 
105
107
  __all__ = [
106
108
  "Meshagent",
109
+ "CreateProjectRequest",
107
110
  "CreateProjectRepositoryRequest",
108
111
  "CreateRepositoryTokenRequest",
109
112
  "UpdateProjectRepositoryRequest",
110
113
  "ProjectInfo",
114
+ "ProjectsPage",
111
115
  "ProjectRepository",
112
116
  "RepositoryToken",
113
117
  "DatasetJson",
@@ -908,12 +908,37 @@ class ProjectInfo(BaseModel):
908
908
  id: str
909
909
  owner_user_id: str | None = Field(default=None, alias="owner_user_id")
910
910
  name: str
911
- project_key: str
911
+ project_key: str | None = None
912
912
  created_at: datetime | None = Field(default=None, alias="created_at")
913
913
  settings: dict[str, JsonValue] | None = None
914
914
 
915
915
  model_config = ConfigDict(populate_by_name=True)
916
916
 
917
+ def __contains__(self, key: str) -> bool:
918
+ return key in type(self).model_fields
919
+
920
+ def __getitem__(self, key: str) -> Any:
921
+ if key not in type(self).model_fields:
922
+ raise KeyError(key)
923
+ return self.__dict__[key]
924
+
925
+
926
+ class CreateProjectRequest(BaseModel):
927
+ name: str
928
+ settings: dict[str, JsonValue] | None = None
929
+
930
+
931
+ class ProjectsPage(BaseModel):
932
+ projects: list[ProjectInfo]
933
+
934
+ def __contains__(self, key: str) -> bool:
935
+ return key in type(self).model_fields
936
+
937
+ def __getitem__(self, key: str) -> Any:
938
+ if key not in type(self).model_fields:
939
+ raise KeyError(key)
940
+ return self.__dict__[key]
941
+
917
942
 
918
943
  class CreateRepositoryTokenRequest(BaseModel):
919
944
  model_config = ConfigDict(extra="forbid")
@@ -1190,22 +1215,23 @@ class Meshagent:
1190
1215
  return await resp.read()
1191
1216
 
1192
1217
  async def create_project(
1193
- self, name: str, settings: Optional[dict] = None
1194
- ) -> Dict[str, Any]:
1218
+ self, name: str, settings: dict[str, JsonValue] | None = None
1219
+ ) -> ProjectInfo:
1195
1220
  """
1196
1221
  Corresponds to: POST /accounts/projects
1197
1222
  Body: { "name": "<name>" }
1198
- Returns a JSON dict with { "id", "owner_user_id", "name", "project_key" } on success.
1223
+ Returns { "id", "owner_user_id", "name", "project_key" } on success.
1199
1224
  """
1200
1225
  url = f"{self.base_url}/accounts/projects"
1226
+ request = CreateProjectRequest(name=name, settings=settings)
1201
1227
 
1202
1228
  async with self._session.post(
1203
1229
  url,
1204
1230
  headers=self._get_headers(),
1205
- json={"name": name, "settings": settings},
1231
+ json=request.model_dump(mode="json"),
1206
1232
  ) as resp:
1207
1233
  await self._raise_for_status(resp)
1208
- return await resp.json()
1234
+ return await self._read_model(resp, ProjectInfo)
1209
1235
 
1210
1236
  async def add_user_to_project(
1211
1237
  self,
@@ -1338,29 +1364,29 @@ class Meshagent:
1338
1364
  await self._raise_for_status(resp)
1339
1365
  return await resp.json()
1340
1366
 
1341
- async def list_projects(self) -> Dict[str, Any]:
1367
+ async def list_projects(self) -> ProjectsPage:
1342
1368
  """
1343
1369
  Corresponds to: GET /accounts/projects
1344
- Returns a JSON dict with { "projects": [...] }.
1370
+ Returns { "projects": [...] }.
1345
1371
  """
1346
1372
  url = f"{self.base_url}/accounts/projects"
1347
1373
 
1348
1374
  async with self._session.get(url, headers=self._get_headers()) as resp:
1349
1375
  await self._raise_for_status(resp)
1350
- return await resp.json()
1376
+ return await self._read_model(resp, ProjectsPage)
1351
1377
 
1352
- async def get_project(self, project_id: str) -> Dict[str, Any]:
1378
+ async def get_project(self, project_id: str) -> ProjectInfo:
1353
1379
  """
1354
1380
  Corresponds to: GET /accounts/projects
1355
- Returns a JSON dict with { "projects": [...] }.
1381
+ Returns a project.
1356
1382
  """
1357
1383
  url = f"{self.base_url}/accounts/projects/{project_id}"
1358
1384
 
1359
1385
  async with self._session.get(url, headers=self._get_headers()) as resp:
1360
1386
  await self._raise_for_status(resp)
1361
- return await resp.json()
1387
+ return await self._read_model(resp, ProjectInfo)
1362
1388
 
1363
- async def get_project_by_key(self, project_key: str) -> Dict[str, Any]:
1389
+ async def get_project_by_key(self, project_key: str) -> ProjectInfo:
1364
1390
  """
1365
1391
  Corresponds to: GET /accounts/projects/by-key/{project_key}
1366
1392
  Returns a JSON dict with { "id", "owner_user_id", "name", "project_key" }.
@@ -1369,7 +1395,7 @@ class Meshagent:
1369
1395
 
1370
1396
  async with self._session.get(url, headers=self._get_headers()) as resp:
1371
1397
  await self._raise_for_status(resp)
1372
- return await resp.json()
1398
+ return await self._read_model(resp, ProjectInfo)
1373
1399
 
1374
1400
  async def get_project_info(self, project_id: str) -> ProjectInfo:
1375
1401
  url = f"{self.base_url}/accounts/projects/{project_id}"
@@ -0,0 +1 @@
1
+ __version__ = "0.46.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-api
3
- Version: 0.46.0
3
+ Version: 0.46.2
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.46.0"
File without changes
File without changes
File without changes