fleet-python 0.2.15__tar.gz → 0.2.16__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.

Potentially problematic release.


This version of fleet-python might be problematic. Click here for more details.

Files changed (74) hide show
  1. {fleet_python-0.2.15 → fleet_python-0.2.16}/PKG-INFO +1 -1
  2. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/client.py +19 -1
  3. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/client.py +19 -0
  4. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet_python.egg-info/PKG-INFO +1 -1
  5. {fleet_python-0.2.15 → fleet_python-0.2.16}/pyproject.toml +1 -1
  6. {fleet_python-0.2.15 → fleet_python-0.2.16}/LICENSE +0 -0
  7. {fleet_python-0.2.15 → fleet_python-0.2.16}/README.md +0 -0
  8. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/diff_example.py +0 -0
  9. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/dsl_example.py +0 -0
  10. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example.py +0 -0
  11. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_action_log.py +0 -0
  12. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_client.py +0 -0
  13. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_mcp_anthropic.py +0 -0
  14. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_mcp_openai.py +0 -0
  15. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_sync.py +0 -0
  16. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_task.py +0 -0
  17. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/example_verifier.py +0 -0
  18. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/gemini_example.py +0 -0
  19. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/json_tasks_example.py +0 -0
  20. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/nova_act_example.py +0 -0
  21. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/openai_example.py +0 -0
  22. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/openai_simple_example.py +0 -0
  23. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/query_builder_example.py +0 -0
  24. {fleet_python-0.2.15 → fleet_python-0.2.16}/examples/quickstart.py +0 -0
  25. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/__init__.py +0 -0
  26. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/__init__.py +0 -0
  27. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/base.py +0 -0
  28. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/env/__init__.py +0 -0
  29. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/env/client.py +0 -0
  30. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/exceptions.py +0 -0
  31. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/instance/__init__.py +0 -0
  32. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/instance/base.py +0 -0
  33. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/instance/client.py +0 -0
  34. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/playwright.py +0 -0
  35. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/resources/__init__.py +0 -0
  36. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/resources/base.py +0 -0
  37. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/resources/browser.py +0 -0
  38. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/resources/sqlite.py +0 -0
  39. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/tasks.py +0 -0
  40. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/verifiers/__init__.py +0 -0
  41. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/verifiers/bundler.py +0 -0
  42. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/_async/verifiers/verifier.py +0 -0
  43. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/base.py +0 -0
  44. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/config.py +0 -0
  45. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/env/__init__.py +0 -0
  46. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/env/client.py +0 -0
  47. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/exceptions.py +0 -0
  48. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/instance/__init__.py +0 -0
  49. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/instance/base.py +0 -0
  50. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/instance/client.py +0 -0
  51. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/instance/models.py +0 -0
  52. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/models.py +0 -0
  53. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/playwright.py +0 -0
  54. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/resources/__init__.py +0 -0
  55. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/resources/base.py +0 -0
  56. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/resources/browser.py +0 -0
  57. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/resources/mcp.py +0 -0
  58. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/resources/sqlite.py +0 -0
  59. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/tasks.py +0 -0
  60. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/types.py +0 -0
  61. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/__init__.py +0 -0
  62. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/bundler.py +0 -0
  63. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/code.py +0 -0
  64. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/db.py +0 -0
  65. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/decorator.py +0 -0
  66. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/sql_differ.py +0 -0
  67. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet/verifiers/verifier.py +0 -0
  68. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet_python.egg-info/SOURCES.txt +0 -0
  69. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet_python.egg-info/dependency_links.txt +0 -0
  70. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet_python.egg-info/requires.txt +0 -0
  71. {fleet_python-0.2.15 → fleet_python-0.2.16}/fleet_python.egg-info/top_level.txt +0 -0
  72. {fleet_python-0.2.15 → fleet_python-0.2.16}/scripts/fix_sync_imports.py +0 -0
  73. {fleet_python-0.2.15 → fleet_python-0.2.16}/scripts/unasync.py +0 -0
  74. {fleet_python-0.2.15 → fleet_python-0.2.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fleet-python
3
- Version: 0.2.15
3
+ Version: 0.2.16
4
4
  Summary: Python SDK for Fleet environments
5
5
  Author-email: Fleet AI <nic@fleet.so>
6
6
  License: Apache-2.0
@@ -19,7 +19,7 @@ import cloudpickle
19
19
  import httpx
20
20
  import logging
21
21
  import os
22
- from typing import List, Optional
22
+ from typing import List, Optional, Dict
23
23
 
24
24
  from .base import EnvironmentBase, AsyncWrapper
25
25
  from ..models import (
@@ -51,6 +51,7 @@ class AsyncEnv(EnvironmentBase):
51
51
  def __init__(self, client: Optional[AsyncWrapper], **kwargs):
52
52
  super().__init__(**kwargs)
53
53
  self._client = client
54
+ self._apps: Dict[str, AsyncInstanceClient] = {}
54
55
  self._instance: Optional[AsyncInstanceClient] = None
55
56
 
56
57
  @property
@@ -60,6 +61,23 @@ class AsyncEnv(EnvironmentBase):
60
61
  self.manager_url, self._client.httpx_client if self._client else None
61
62
  )
62
63
  return self._instance
64
+
65
+ def app(self, name: str) -> AsyncInstanceClient:
66
+ if name not in self._apps:
67
+ # Extract base URL by removing the current app path (e.g., /sentry/api/v1/env)
68
+ # manager_url looks like: https://xxx.fleetai.com/sentry/api/v1/env
69
+ base_url = self.manager_url.split('/api/v1/env')[0]
70
+ # Remove the current app name (e.g., /sentry) to get the root
71
+ if '/' in base_url:
72
+ parts = base_url.rsplit('/', 1)
73
+ if len(parts) == 2:
74
+ base_url = parts[0]
75
+
76
+ self._apps[name] = AsyncInstanceClient(
77
+ f"{base_url}/{name}/api/v1/env",
78
+ self._client.httpx_client if self._client else None,
79
+ )
80
+ return self._apps[name]
63
81
 
64
82
  @property
65
83
  def _load_client(self) -> AsyncWrapper:
@@ -143,6 +143,7 @@ class Environment(EnvironmentBase):
143
143
  super().__init__(**kwargs)
144
144
  self._client = client
145
145
  self._instance: Optional[InstanceClient] = None
146
+ self._apps: Dict[str, InstanceClient] = {}
146
147
  self._session_id: Optional[str] = None # ADD THIS
147
148
 
148
149
  @property
@@ -155,6 +156,24 @@ class Environment(EnvironmentBase):
155
156
  )
156
157
  return self._instance
157
158
 
159
+ def app(self, name: str) -> InstanceClient:
160
+ if name not in self._apps:
161
+ # Extract base URL by removing the current app path (e.g., /sentry/api/v1/env)
162
+ # manager_url looks like: https://xxx.fleetai.com/sentry/api/v1/env
163
+ base_url = self.manager_url.split('/api/v1/env')[0]
164
+ # Remove the current app name (e.g., /sentry) to get the root
165
+ if '/' in base_url:
166
+ parts = base_url.rsplit('/', 1)
167
+ if len(parts) == 2:
168
+ base_url = parts[0]
169
+
170
+ self._apps[name] = InstanceClient(
171
+ f"{base_url}/{name}/api/v1/env",
172
+ self.env_key,
173
+ self._client.httpx_client if self._client else None,
174
+ )
175
+ return self._apps[name]
176
+
158
177
  @property
159
178
  def session_id(self) -> Optional[str]: # ADD THIS PROPERTY
160
179
  """Get the current tool logging session ID."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fleet-python
3
- Version: 0.2.15
3
+ Version: 0.2.16
4
4
  Summary: Python SDK for Fleet environments
5
5
  Author-email: Fleet AI <nic@fleet.so>
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fleet-python"
7
- version = "0.2.15"
7
+ version = "0.2.16"
8
8
  description = "Python SDK for Fleet environments"
9
9
  authors = [
10
10
  {name = "Fleet AI", email = "nic@fleet.so"},
File without changes
File without changes
File without changes