fleet-python 0.2.57__tar.gz → 0.2.59__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.
- {fleet_python-0.2.57 → fleet_python-0.2.59}/PKG-INFO +1 -1
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/__init__.py +4 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/__init__.py +17 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/client.py +42 -2
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/tasks.py +20 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/client.py +42 -2
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/tasks.py +20 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet_python.egg-info/PKG-INFO +1 -1
- {fleet_python-0.2.57 → fleet_python-0.2.59}/pyproject.toml +1 -1
- {fleet_python-0.2.57 → fleet_python-0.2.59}/LICENSE +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/README.md +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/diff_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_account.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_sync.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_task.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/export_tasks.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/import_tasks.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/openai_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/quickstart.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/base.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/base.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/config.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/env/client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/global_client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/models.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/types.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/scripts/unasync.py +0 -0
- {fleet_python-0.2.57 → fleet_python-0.2.59}/setup.cfg +0 -0
|
@@ -53,6 +53,7 @@ from ._async.tasks import (
|
|
|
53
53
|
load_tasks_from_file as load_tasks_from_file_async,
|
|
54
54
|
import_task as import_task_async,
|
|
55
55
|
import_tasks as import_tasks_async,
|
|
56
|
+
get_task as get_task_async,
|
|
56
57
|
)
|
|
57
58
|
|
|
58
59
|
# Import sync task functions
|
|
@@ -61,6 +62,7 @@ from .tasks import (
|
|
|
61
62
|
load_tasks_from_file,
|
|
62
63
|
import_task,
|
|
63
64
|
import_tasks,
|
|
65
|
+
get_task,
|
|
64
66
|
)
|
|
65
67
|
|
|
66
68
|
# Import shared types
|
|
@@ -117,6 +119,8 @@ __all__ = [
|
|
|
117
119
|
"import_task_async",
|
|
118
120
|
"import_tasks",
|
|
119
121
|
"import_tasks_async",
|
|
122
|
+
"get_task",
|
|
123
|
+
"get_task_async",
|
|
120
124
|
# Version
|
|
121
125
|
"__version__",
|
|
122
126
|
]
|
|
@@ -89,6 +89,7 @@ __all__ = [
|
|
|
89
89
|
"import_task",
|
|
90
90
|
"import_tasks",
|
|
91
91
|
"account",
|
|
92
|
+
"get_task",
|
|
92
93
|
# Version
|
|
93
94
|
"__version__",
|
|
94
95
|
]
|
|
@@ -228,6 +229,22 @@ async def account() -> AccountResponse:
|
|
|
228
229
|
return await _async_global_client.get_client().account()
|
|
229
230
|
|
|
230
231
|
|
|
232
|
+
async def get_task(task_key: str, version_id: Optional[str] = None):
|
|
233
|
+
"""Get a task by key and optional version.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
task_key: The key of the task to retrieve
|
|
237
|
+
version_id: Optional version ID to filter by
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
task = await fleet.get_task("my-task")
|
|
241
|
+
task = await fleet.get_task("my-task", version_id="v1")
|
|
242
|
+
"""
|
|
243
|
+
return await _async_global_client.get_client().get_task(
|
|
244
|
+
task_key=task_key, version_id=version_id
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
|
|
231
248
|
def configure(
|
|
232
249
|
api_key: Optional[str] = None,
|
|
233
250
|
base_url: Optional[str] = None,
|
|
@@ -333,9 +333,26 @@ class AsyncFleet:
|
|
|
333
333
|
) -> Task:
|
|
334
334
|
verifier = None
|
|
335
335
|
verifier_code = task_json.get("verifier_func") or task_json.get("verifier_code")
|
|
336
|
+
verifier_sha = task_json.get("verifier_sha", "")
|
|
337
|
+
|
|
338
|
+
# Check if verifier is a nested object with code inside
|
|
339
|
+
if not verifier_code and "verifier" in task_json:
|
|
340
|
+
verifier_obj = task_json["verifier"]
|
|
341
|
+
if isinstance(verifier_obj, dict):
|
|
342
|
+
verifier_code = verifier_obj.get("code")
|
|
343
|
+
# Also extract sha256 from nested verifier if not found at top level
|
|
344
|
+
if not verifier_sha:
|
|
345
|
+
verifier_sha = verifier_obj.get("sha256", "")
|
|
336
346
|
|
|
337
347
|
# Try to find verifier_id in multiple locations
|
|
338
348
|
verifier_id = task_json.get("verifier_id")
|
|
349
|
+
|
|
350
|
+
# Check nested verifier object for verifier_id
|
|
351
|
+
if not verifier_id and "verifier" in task_json:
|
|
352
|
+
verifier_obj = task_json["verifier"]
|
|
353
|
+
if isinstance(verifier_obj, dict):
|
|
354
|
+
verifier_id = verifier_obj.get("verifier_id")
|
|
355
|
+
|
|
339
356
|
if (
|
|
340
357
|
not verifier_id
|
|
341
358
|
and "metadata" in task_json
|
|
@@ -355,7 +372,7 @@ class AsyncFleet:
|
|
|
355
372
|
verifier_id=verifier_id,
|
|
356
373
|
verifier_key=task_json.get("key", task_json.get("id")),
|
|
357
374
|
verifier_code=verifier_code,
|
|
358
|
-
verifier_sha=
|
|
375
|
+
verifier_sha=verifier_sha,
|
|
359
376
|
)
|
|
360
377
|
except Exception as e:
|
|
361
378
|
error_msg = f"Failed to create verifier {task_json.get('key', task_json.get('id'))}: {e}"
|
|
@@ -378,7 +395,7 @@ class AsyncFleet:
|
|
|
378
395
|
verifier_func=verifier_code, # Set verifier code
|
|
379
396
|
verifier=verifier, # Use created verifier or None
|
|
380
397
|
verifier_id=verifier_id, # Set verifier_id so _rebuild_verifier works
|
|
381
|
-
verifier_sha=
|
|
398
|
+
verifier_sha=verifier_sha, # Set verifier_sha
|
|
382
399
|
metadata=task_json.get("metadata", {}), # Default empty metadata
|
|
383
400
|
)
|
|
384
401
|
return task
|
|
@@ -700,6 +717,29 @@ class AsyncFleet:
|
|
|
700
717
|
)
|
|
701
718
|
return TaskResponse(**response.json())
|
|
702
719
|
|
|
720
|
+
async def get_task(
|
|
721
|
+
self,
|
|
722
|
+
task_key: str,
|
|
723
|
+
version_id: Optional[str] = None,
|
|
724
|
+
) -> TaskResponse:
|
|
725
|
+
"""Get a task by key and optional version.
|
|
726
|
+
|
|
727
|
+
Args:
|
|
728
|
+
task_key: The key of the task to retrieve
|
|
729
|
+
version_id: Optional version ID to filter by
|
|
730
|
+
|
|
731
|
+
Returns:
|
|
732
|
+
TaskResponse containing the task details
|
|
733
|
+
"""
|
|
734
|
+
params = {}
|
|
735
|
+
if version_id is not None:
|
|
736
|
+
params["version_id"] = version_id
|
|
737
|
+
|
|
738
|
+
response = await self.client.request(
|
|
739
|
+
"GET", f"/v1/tasks/{task_key}", params=params
|
|
740
|
+
)
|
|
741
|
+
return TaskResponse(**response.json())
|
|
742
|
+
|
|
703
743
|
async def _create_verifier_from_data(
|
|
704
744
|
self, verifier_id: str, verifier_key: str, verifier_code: str, verifier_sha: str
|
|
705
745
|
) -> "AsyncVerifierFunction":
|
|
@@ -389,6 +389,26 @@ async def update_task(
|
|
|
389
389
|
)
|
|
390
390
|
|
|
391
391
|
|
|
392
|
+
async def get_task(task_key: str, version_id: Optional[str] = None):
|
|
393
|
+
"""Convenience function to get a task by key and optional version.
|
|
394
|
+
|
|
395
|
+
Args:
|
|
396
|
+
task_key: The key of the task to retrieve
|
|
397
|
+
version_id: Optional version ID to filter by
|
|
398
|
+
|
|
399
|
+
Returns:
|
|
400
|
+
TaskResponse containing the task details
|
|
401
|
+
|
|
402
|
+
Examples:
|
|
403
|
+
response = await fleet.get_task("my-task")
|
|
404
|
+
response = await fleet.get_task("my-task", version_id="v1")
|
|
405
|
+
"""
|
|
406
|
+
from .global_client import get_client
|
|
407
|
+
|
|
408
|
+
client = get_client()
|
|
409
|
+
return await client.get_task(task_key=task_key, version_id=version_id)
|
|
410
|
+
|
|
411
|
+
|
|
392
412
|
async def import_task(task: Task, project_key: Optional[str] = None):
|
|
393
413
|
"""Convenience function to import a single task.
|
|
394
414
|
|
|
@@ -331,9 +331,26 @@ class Fleet:
|
|
|
331
331
|
) -> Task:
|
|
332
332
|
verifier = None
|
|
333
333
|
verifier_code = task_json.get("verifier_func") or task_json.get("verifier_code")
|
|
334
|
+
verifier_sha = task_json.get("verifier_sha", "")
|
|
335
|
+
|
|
336
|
+
# Check if verifier is a nested object with code inside
|
|
337
|
+
if not verifier_code and "verifier" in task_json:
|
|
338
|
+
verifier_obj = task_json["verifier"]
|
|
339
|
+
if isinstance(verifier_obj, dict):
|
|
340
|
+
verifier_code = verifier_obj.get("code")
|
|
341
|
+
# Also extract sha256 from nested verifier if not found at top level
|
|
342
|
+
if not verifier_sha:
|
|
343
|
+
verifier_sha = verifier_obj.get("sha256", "")
|
|
334
344
|
|
|
335
345
|
# Try to find verifier_id in multiple locations
|
|
336
346
|
verifier_id = task_json.get("verifier_id")
|
|
347
|
+
|
|
348
|
+
# Check nested verifier object for verifier_id
|
|
349
|
+
if not verifier_id and "verifier" in task_json:
|
|
350
|
+
verifier_obj = task_json["verifier"]
|
|
351
|
+
if isinstance(verifier_obj, dict):
|
|
352
|
+
verifier_id = verifier_obj.get("verifier_id")
|
|
353
|
+
|
|
337
354
|
if (
|
|
338
355
|
not verifier_id
|
|
339
356
|
and "metadata" in task_json
|
|
@@ -353,7 +370,7 @@ class Fleet:
|
|
|
353
370
|
verifier_id=verifier_id,
|
|
354
371
|
verifier_key=task_json.get("key", task_json.get("id")),
|
|
355
372
|
verifier_code=verifier_code,
|
|
356
|
-
verifier_sha=
|
|
373
|
+
verifier_sha=verifier_sha,
|
|
357
374
|
)
|
|
358
375
|
except Exception as e:
|
|
359
376
|
error_msg = f"Failed to create verifier {task_json.get('key', task_json.get('id'))}: {e}"
|
|
@@ -376,7 +393,7 @@ class Fleet:
|
|
|
376
393
|
verifier_func=verifier_code, # Set verifier code
|
|
377
394
|
verifier=verifier, # Use created verifier or None
|
|
378
395
|
verifier_id=verifier_id, # Set verifier_id so _rebuild_verifier works
|
|
379
|
-
verifier_sha=
|
|
396
|
+
verifier_sha=verifier_sha, # Set verifier_sha
|
|
380
397
|
metadata=task_json.get("metadata", {}), # Default empty metadata
|
|
381
398
|
)
|
|
382
399
|
return task
|
|
@@ -698,6 +715,29 @@ class Fleet:
|
|
|
698
715
|
)
|
|
699
716
|
return TaskResponse(**response.json())
|
|
700
717
|
|
|
718
|
+
def get_task(
|
|
719
|
+
self,
|
|
720
|
+
task_key: str,
|
|
721
|
+
version_id: Optional[str] = None,
|
|
722
|
+
) -> TaskResponse:
|
|
723
|
+
"""Get a task by key and optional version.
|
|
724
|
+
|
|
725
|
+
Args:
|
|
726
|
+
task_key: The key of the task to retrieve
|
|
727
|
+
version_id: Optional version ID to filter by
|
|
728
|
+
|
|
729
|
+
Returns:
|
|
730
|
+
TaskResponse containing the task details
|
|
731
|
+
"""
|
|
732
|
+
params = {}
|
|
733
|
+
if version_id is not None:
|
|
734
|
+
params["version_id"] = version_id
|
|
735
|
+
|
|
736
|
+
response = self.client.request(
|
|
737
|
+
"GET", f"/v1/tasks/{task_key}", params=params
|
|
738
|
+
)
|
|
739
|
+
return TaskResponse(**response.json())
|
|
740
|
+
|
|
701
741
|
def _create_verifier_from_data(
|
|
702
742
|
self, verifier_id: str, verifier_key: str, verifier_code: str, verifier_sha: str
|
|
703
743
|
) -> "SyncVerifierFunction":
|
|
@@ -390,6 +390,26 @@ def update_task(
|
|
|
390
390
|
)
|
|
391
391
|
|
|
392
392
|
|
|
393
|
+
def get_task(task_key: str, version_id: Optional[str] = None):
|
|
394
|
+
"""Convenience function to get a task by key and optional version.
|
|
395
|
+
|
|
396
|
+
Args:
|
|
397
|
+
task_key: The key of the task to retrieve
|
|
398
|
+
version_id: Optional version ID to filter by
|
|
399
|
+
|
|
400
|
+
Returns:
|
|
401
|
+
TaskResponse containing the task details
|
|
402
|
+
|
|
403
|
+
Examples:
|
|
404
|
+
response = fleet.get_task("my-task")
|
|
405
|
+
response = fleet.get_task("my-task", version_id="v1")
|
|
406
|
+
"""
|
|
407
|
+
from .global_client import get_client
|
|
408
|
+
|
|
409
|
+
client = get_client()
|
|
410
|
+
return client.get_task(task_key=task_key, version_id=version_id)
|
|
411
|
+
|
|
412
|
+
|
|
393
413
|
def import_task(task: Task, project_key: Optional[str] = None):
|
|
394
414
|
"""Convenience function to import a single task.
|
|
395
415
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|