fleet-python 0.2.28__py3-none-any.whl → 0.2.32__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.
Potentially problematic release.
This version of fleet-python might be problematic. Click here for more details.
- examples/diff_example.py +30 -20
- examples/dsl_example.py +12 -7
- examples/example.py +4 -4
- examples/example_account.py +8 -0
- examples/example_action_log.py +2 -2
- examples/example_client.py +2 -2
- examples/example_mcp_anthropic.py +8 -5
- examples/example_mcp_openai.py +2 -2
- examples/example_sync.py +4 -4
- examples/example_task.py +16 -6
- examples/example_tasks.py +3 -6
- examples/example_verifier.py +16 -3
- examples/gemini_example.py +6 -6
- examples/json_tasks_example.py +2 -2
- examples/nova_act_example.py +2 -2
- examples/openai_example.py +3 -3
- examples/openai_simple_example.py +3 -3
- examples/query_builder_example.py +11 -7
- fleet/__init__.py +60 -5
- fleet/_async/__init__.py +258 -1
- fleet/_async/base.py +2 -1
- fleet/_async/client.py +194 -127
- fleet/_async/env/client.py +5 -1
- fleet/_async/global_client.py +43 -0
- fleet/_async/instance/client.py +1 -1
- fleet/_async/models.py +172 -171
- fleet/_async/resources/base.py +1 -1
- fleet/_async/resources/mcp.py +55 -0
- fleet/_async/resources/sqlite.py +141 -130
- fleet/_async/tasks.py +71 -16
- fleet/_async/verifiers/__init__.py +2 -2
- fleet/_async/verifiers/bundler.py +18 -14
- fleet/_async/verifiers/verifier.py +77 -71
- fleet/base.py +2 -1
- fleet/client.py +176 -136
- fleet/config.py +3 -2
- fleet/env/__init__.py +10 -1
- fleet/env/client.py +5 -1
- fleet/global_client.py +43 -0
- fleet/instance/__init__.py +1 -1
- fleet/instance/client.py +2 -4
- fleet/models.py +172 -171
- fleet/resources/base.py +1 -1
- fleet/resources/mcp.py +27 -33
- fleet/resources/sqlite.py +136 -131
- fleet/tasks.py +197 -16
- fleet/types.py +1 -1
- fleet/verifiers/__init__.py +2 -2
- fleet/verifiers/bundler.py +18 -14
- fleet/verifiers/code.py +1 -1
- fleet/verifiers/decorator.py +25 -34
- fleet/verifiers/parse.py +98 -68
- fleet/verifiers/verifier.py +77 -78
- {fleet_python-0.2.28.dist-info → fleet_python-0.2.32.dist-info}/METADATA +9 -9
- fleet_python-0.2.32.dist-info/RECORD +74 -0
- scripts/fix_sync_imports.py +87 -59
- scripts/unasync.py +10 -9
- fleet_python-0.2.28.dist-info/RECORD +0 -70
- {fleet_python-0.2.28.dist-info → fleet_python-0.2.32.dist-info}/WHEEL +0 -0
- {fleet_python-0.2.28.dist-info → fleet_python-0.2.32.dist-info}/licenses/LICENSE +0 -0
- {fleet_python-0.2.28.dist-info → fleet_python-0.2.32.dist-info}/top_level.txt +0 -0
fleet/models.py
CHANGED
|
@@ -11,333 +11,334 @@ from pydantic import BaseModel, Field, conint
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class CDPDescribeResponse(BaseModel):
|
|
14
|
-
success: bool = Field(..., title=
|
|
15
|
-
url: str = Field(..., title=
|
|
16
|
-
devtools_url: str = Field(..., title=
|
|
14
|
+
success: bool = Field(..., title="Success")
|
|
15
|
+
url: str = Field(..., title="Url")
|
|
16
|
+
devtools_url: str = Field(..., title="Devtools Url")
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class ChromeStartRequest(BaseModel):
|
|
20
|
-
start_page: Optional[str] = Field(
|
|
21
|
-
resolution: Optional[str] = Field(
|
|
20
|
+
start_page: Optional[str] = Field("about:blank", title="Start Page")
|
|
21
|
+
resolution: Optional[str] = Field("1920x1080", title="Resolution")
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class ChromeStartResponse(BaseModel):
|
|
25
|
-
success: bool = Field(..., title=
|
|
26
|
-
message: str = Field(..., title=
|
|
25
|
+
success: bool = Field(..., title="Success")
|
|
26
|
+
message: str = Field(..., title="Message")
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
class ChromeStatusResponse(BaseModel):
|
|
30
|
-
running: bool = Field(..., title=
|
|
31
|
-
message: str = Field(..., title=
|
|
30
|
+
running: bool = Field(..., title="Running")
|
|
31
|
+
message: str = Field(..., title="Message")
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
class Environment(BaseModel):
|
|
35
|
-
env_key: str = Field(..., title=
|
|
36
|
-
name: str = Field(..., title=
|
|
37
|
-
description: Optional[str] = Field(..., title=
|
|
38
|
-
default_version: Optional[str] = Field(..., title=
|
|
39
|
-
versions: Dict[str, str] = Field(..., title=
|
|
35
|
+
env_key: str = Field(..., title="Env Key")
|
|
36
|
+
name: str = Field(..., title="Name")
|
|
37
|
+
description: Optional[str] = Field(..., title="Description")
|
|
38
|
+
default_version: Optional[str] = Field(..., title="Default Version")
|
|
39
|
+
versions: Dict[str, str] = Field(..., title="Versions")
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
class Instance(BaseModel):
|
|
43
|
-
instance_id: str = Field(..., title=
|
|
44
|
-
env_key: str = Field(..., title=
|
|
45
|
-
version: str = Field(..., title=
|
|
46
|
-
status: str = Field(..., title=
|
|
47
|
-
subdomain: str = Field(..., title=
|
|
48
|
-
created_at: str = Field(..., title=
|
|
49
|
-
updated_at: str = Field(..., title=
|
|
50
|
-
terminated_at: Optional[str] = Field(None, title=
|
|
51
|
-
team_id: str = Field(..., title=
|
|
52
|
-
region: str = Field(..., title=
|
|
53
|
-
env_variables: Optional[Dict[str, Any]] = Field(None, title=
|
|
43
|
+
instance_id: str = Field(..., title="Instance Id")
|
|
44
|
+
env_key: str = Field(..., title="Env Key")
|
|
45
|
+
version: str = Field(..., title="Version")
|
|
46
|
+
status: str = Field(..., title="Status")
|
|
47
|
+
subdomain: str = Field(..., title="Subdomain")
|
|
48
|
+
created_at: str = Field(..., title="Created At")
|
|
49
|
+
updated_at: str = Field(..., title="Updated At")
|
|
50
|
+
terminated_at: Optional[str] = Field(None, title="Terminated At")
|
|
51
|
+
team_id: str = Field(..., title="Team Id")
|
|
52
|
+
region: str = Field(..., title="Region")
|
|
53
|
+
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
class InstanceRequest(BaseModel):
|
|
57
|
-
env_key: str = Field(..., title=
|
|
58
|
-
version: Optional[str] = Field(None, title=
|
|
59
|
-
region: Optional[str] = Field(
|
|
60
|
-
seed: Optional[int] = Field(None, title=
|
|
61
|
-
timestamp: Optional[int] = Field(None, title=
|
|
62
|
-
p_error: Optional[float] = Field(None, title=
|
|
63
|
-
avg_latency: Optional[float] = Field(None, title=
|
|
64
|
-
run_id: Optional[str] = Field(None, title=
|
|
65
|
-
task_id: Optional[str] = Field(None, title=
|
|
66
|
-
force_pull: Optional[bool] = Field(None, title=
|
|
67
|
-
env_variables: Optional[Dict[str, Any]] = Field(None, title=
|
|
68
|
-
created_from: Optional[str] = Field(None, title=
|
|
57
|
+
env_key: str = Field(..., title="Env Key")
|
|
58
|
+
version: Optional[str] = Field(None, title="Version")
|
|
59
|
+
region: Optional[str] = Field("us-west-1", title="Region")
|
|
60
|
+
seed: Optional[int] = Field(None, title="Seed")
|
|
61
|
+
timestamp: Optional[int] = Field(None, title="Timestamp")
|
|
62
|
+
p_error: Optional[float] = Field(None, title="P Error")
|
|
63
|
+
avg_latency: Optional[float] = Field(None, title="Avg Latency")
|
|
64
|
+
run_id: Optional[str] = Field(None, title="Run Id")
|
|
65
|
+
task_id: Optional[str] = Field(None, title="Task Id")
|
|
66
|
+
force_pull: Optional[bool] = Field(None, title="Force Pull")
|
|
67
|
+
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
68
|
+
created_from: Optional[str] = Field(None, title="Created From")
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
class InstanceStatus(Enum):
|
|
72
|
-
pending =
|
|
73
|
-
running =
|
|
74
|
-
stopped =
|
|
75
|
-
error =
|
|
72
|
+
pending = "pending"
|
|
73
|
+
running = "running"
|
|
74
|
+
stopped = "stopped"
|
|
75
|
+
error = "error"
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
class ManagerURLs(BaseModel):
|
|
79
|
-
api: str = Field(..., title=
|
|
80
|
-
docs: str = Field(..., title=
|
|
81
|
-
reset: str = Field(..., title=
|
|
82
|
-
diff: str = Field(..., title=
|
|
83
|
-
snapshot: str = Field(..., title=
|
|
84
|
-
execute_verifier_function: str = Field(..., title=
|
|
79
|
+
api: str = Field(..., title="Api")
|
|
80
|
+
docs: str = Field(..., title="Docs")
|
|
81
|
+
reset: str = Field(..., title="Reset")
|
|
82
|
+
diff: str = Field(..., title="Diff")
|
|
83
|
+
snapshot: str = Field(..., title="Snapshot")
|
|
84
|
+
execute_verifier_function: str = Field(..., title="Execute Verifier Function")
|
|
85
85
|
execute_verifier_function_with_upload: str = Field(
|
|
86
|
-
..., title=
|
|
86
|
+
..., title="Execute Verifier Function With Upload"
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
class QueryRequest(BaseModel):
|
|
91
|
-
query: str = Field(..., title=
|
|
92
|
-
args: Optional[List] = Field(None, title=
|
|
93
|
-
read_only: Optional[bool] = Field(True, title=
|
|
91
|
+
query: str = Field(..., title="Query")
|
|
92
|
+
args: Optional[List] = Field(None, title="Args")
|
|
93
|
+
read_only: Optional[bool] = Field(True, title="Read Only")
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
class QueryResponse(BaseModel):
|
|
97
|
-
success: bool = Field(..., title=
|
|
98
|
-
columns: Optional[List[str]] = Field(None, title=
|
|
99
|
-
rows: Optional[List[List]] = Field(None, title=
|
|
100
|
-
rows_affected: Optional[int] = Field(None, title=
|
|
101
|
-
last_insert_id: Optional[int] = Field(None, title=
|
|
102
|
-
error: Optional[str] = Field(None, title=
|
|
103
|
-
message: str = Field(..., title=
|
|
97
|
+
success: bool = Field(..., title="Success")
|
|
98
|
+
columns: Optional[List[str]] = Field(None, title="Columns")
|
|
99
|
+
rows: Optional[List[List]] = Field(None, title="Rows")
|
|
100
|
+
rows_affected: Optional[int] = Field(None, title="Rows Affected")
|
|
101
|
+
last_insert_id: Optional[int] = Field(None, title="Last Insert Id")
|
|
102
|
+
error: Optional[str] = Field(None, title="Error")
|
|
103
|
+
message: str = Field(..., title="Message")
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
class RecreateResponse(BaseModel):
|
|
107
|
-
success: bool = Field(..., title=
|
|
108
|
-
instance_id: str = Field(..., title=
|
|
109
|
-
env_key: str = Field(..., title=
|
|
110
|
-
version: str = Field(..., title=
|
|
111
|
-
recreated_at: str = Field(..., title=
|
|
107
|
+
success: bool = Field(..., title="Success")
|
|
108
|
+
instance_id: str = Field(..., title="Instance Id")
|
|
109
|
+
env_key: str = Field(..., title="Env Key")
|
|
110
|
+
version: str = Field(..., title="Version")
|
|
111
|
+
recreated_at: str = Field(..., title="Recreated At")
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
class ResourceMode(Enum):
|
|
115
|
-
ro =
|
|
116
|
-
rw =
|
|
115
|
+
ro = "ro"
|
|
116
|
+
rw = "rw"
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
class ResourceType(Enum):
|
|
120
|
-
sqlite =
|
|
121
|
-
cdp =
|
|
120
|
+
sqlite = "sqlite"
|
|
121
|
+
cdp = "cdp"
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
class RestoreRequest(BaseModel):
|
|
125
|
-
backup_id: Optional[str] = Field(None, title=
|
|
125
|
+
backup_id: Optional[str] = Field(None, title="Backup Id")
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
class RestoreResponse(BaseModel):
|
|
129
|
-
success: bool = Field(..., title=
|
|
130
|
-
backup_id: str = Field(..., title=
|
|
131
|
-
source_instance_id: str = Field(..., title=
|
|
132
|
-
target_instance_id: str = Field(..., title=
|
|
133
|
-
restored_at: str = Field(..., title=
|
|
129
|
+
success: bool = Field(..., title="Success")
|
|
130
|
+
backup_id: str = Field(..., title="Backup Id")
|
|
131
|
+
source_instance_id: str = Field(..., title="Source Instance Id")
|
|
132
|
+
target_instance_id: str = Field(..., title="Target Instance Id")
|
|
133
|
+
restored_at: str = Field(..., title="Restored At")
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
class SnapshotResponse(BaseModel):
|
|
137
|
-
success: bool = Field(..., title=
|
|
138
|
-
backup_id: str = Field(..., title=
|
|
139
|
-
instance_id: str = Field(..., title=
|
|
140
|
-
s3_key: str = Field(..., title=
|
|
141
|
-
created_at: str = Field(..., title=
|
|
137
|
+
success: bool = Field(..., title="Success")
|
|
138
|
+
backup_id: str = Field(..., title="Backup Id")
|
|
139
|
+
instance_id: str = Field(..., title="Instance Id")
|
|
140
|
+
s3_key: str = Field(..., title="S3 Key")
|
|
141
|
+
created_at: str = Field(..., title="Created At")
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
class TableSchema(BaseModel):
|
|
145
|
-
name: str = Field(..., title=
|
|
146
|
-
sql: str = Field(..., title=
|
|
147
|
-
columns: List[Dict[str, Any]] = Field(..., title=
|
|
145
|
+
name: str = Field(..., title="Name")
|
|
146
|
+
sql: str = Field(..., title="Sql")
|
|
147
|
+
columns: List[Dict[str, Any]] = Field(..., title="Columns")
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
class TaskRequest(BaseModel):
|
|
151
|
-
key: str = Field(..., title=
|
|
152
|
-
prompt: str = Field(..., title=
|
|
153
|
-
environment_id: str = Field(..., title=
|
|
154
|
-
verifier_id: Optional[str] = Field(None, title=
|
|
155
|
-
version: Optional[str] = Field(None, title=
|
|
156
|
-
env_variables: Optional[Dict[str, Any]] = Field(None, title=
|
|
151
|
+
key: str = Field(..., title="Key")
|
|
152
|
+
prompt: str = Field(..., title="Prompt")
|
|
153
|
+
environment_id: str = Field(..., title="Environment Id")
|
|
154
|
+
verifier_id: Optional[str] = Field(None, title="Verifier Id")
|
|
155
|
+
version: Optional[str] = Field(None, title="Version")
|
|
156
|
+
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
class VerifierData(BaseModel):
|
|
160
|
-
verifier_id: str = Field(..., title=
|
|
161
|
-
key: str = Field(..., title=
|
|
162
|
-
version: int = Field(..., title=
|
|
163
|
-
sha256: str = Field(..., title=
|
|
164
|
-
code: str = Field(..., title=
|
|
165
|
-
comment: Optional[str] = Field(None, title=
|
|
166
|
-
created_at: str = Field(..., title=
|
|
160
|
+
verifier_id: str = Field(..., title="Verifier Id")
|
|
161
|
+
key: str = Field(..., title="Key")
|
|
162
|
+
version: int = Field(..., title="Version")
|
|
163
|
+
sha256: str = Field(..., title="Sha256")
|
|
164
|
+
code: str = Field(..., title="Code")
|
|
165
|
+
comment: Optional[str] = Field(None, title="Comment")
|
|
166
|
+
created_at: str = Field(..., title="Created At")
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
class TaskResponse(BaseModel):
|
|
170
|
-
key: str = Field(..., title=
|
|
171
|
-
prompt: str = Field(..., title=
|
|
172
|
-
team_id: str = Field(..., title=
|
|
173
|
-
environment_id: str = Field(..., title=
|
|
174
|
-
created_at: str = Field(..., title=
|
|
175
|
-
verifier_id: Optional[str] = Field(None, title=
|
|
176
|
-
verifier_func: Optional[str] = Field(None, title=
|
|
177
|
-
version: Optional[str] = Field(None, title=
|
|
178
|
-
env_variables: Optional[Dict[str, Any]] = Field(None, title=
|
|
179
|
-
verifier: Optional[VerifierData] = Field(None, title=
|
|
170
|
+
key: str = Field(..., title="Key")
|
|
171
|
+
prompt: str = Field(..., title="Prompt")
|
|
172
|
+
team_id: str = Field(..., title="Team Id")
|
|
173
|
+
environment_id: str = Field(..., title="Environment Id")
|
|
174
|
+
created_at: str = Field(..., title="Created At")
|
|
175
|
+
verifier_id: Optional[str] = Field(None, title="Verifier Id")
|
|
176
|
+
verifier_func: Optional[str] = Field(None, title="Verifier Func")
|
|
177
|
+
version: Optional[str] = Field(None, title="Version")
|
|
178
|
+
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
179
|
+
verifier: Optional[VerifierData] = Field(None, title="Verifier")
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
class ValidationError(BaseModel):
|
|
183
|
-
loc: List[Union[str, int]] = Field(..., title=
|
|
184
|
-
msg: str = Field(..., title=
|
|
185
|
-
type: str = Field(..., title=
|
|
183
|
+
loc: List[Union[str, int]] = Field(..., title="Location")
|
|
184
|
+
msg: str = Field(..., title="Message")
|
|
185
|
+
type: str = Field(..., title="Error Type")
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
class VerifiersCheckResponse(BaseModel):
|
|
189
189
|
key: Optional[str] = Field(
|
|
190
|
-
None, description=
|
|
190
|
+
None, description="Key of the verifier artifact", title="Key"
|
|
191
191
|
)
|
|
192
192
|
version: Optional[int] = Field(
|
|
193
|
-
None, description=
|
|
193
|
+
None, description="Version of the verifier artifact", title="Version"
|
|
194
194
|
)
|
|
195
195
|
display_src: Optional[str] = Field(
|
|
196
|
-
None, description=
|
|
196
|
+
None, description="Display source code of the verifier", title="Display Src"
|
|
197
197
|
)
|
|
198
198
|
created_at: Optional[str] = Field(
|
|
199
|
-
None, description=
|
|
199
|
+
None, description="Creation timestamp", title="Created At"
|
|
200
200
|
)
|
|
201
201
|
comment: Optional[str] = Field(
|
|
202
|
-
None, description=
|
|
202
|
+
None, description="Comment about the verifier", title="Comment"
|
|
203
203
|
)
|
|
204
204
|
success: bool = Field(
|
|
205
|
-
..., description=
|
|
205
|
+
..., description="Whether the verification was successful", title="Success"
|
|
206
206
|
)
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
class VerifiersExecuteRequest(BaseModel):
|
|
210
210
|
key: Optional[str] = Field(
|
|
211
|
-
None, description=
|
|
211
|
+
None, description="Key of the verifier artifact", title="Key"
|
|
212
212
|
)
|
|
213
213
|
sha256: Optional[str] = Field(
|
|
214
214
|
None,
|
|
215
|
-
description=
|
|
216
|
-
title=
|
|
215
|
+
description="SHA256 hash of the function (auto-generated if bundle is provided)",
|
|
216
|
+
title="Sha256",
|
|
217
217
|
)
|
|
218
218
|
bundle: Optional[str] = Field(
|
|
219
|
-
None, description=
|
|
219
|
+
None, description="Base64 encoded bundle data", title="Bundle"
|
|
220
220
|
)
|
|
221
221
|
args: Optional[str] = Field(
|
|
222
|
-
None, description=
|
|
222
|
+
None, description="Base64 encoded cloudpickled args", title="Args"
|
|
223
223
|
)
|
|
224
224
|
args_array: Optional[List] = Field(
|
|
225
225
|
None,
|
|
226
|
-
description=
|
|
227
|
-
title=
|
|
226
|
+
description="Array of argument values to pass to the function",
|
|
227
|
+
title="Args Array",
|
|
228
228
|
)
|
|
229
229
|
function_name: Optional[str] = Field(
|
|
230
|
-
|
|
230
|
+
"verify", description="Name of the function to execute", title="Function Name"
|
|
231
231
|
)
|
|
232
232
|
timeout: Optional[conint(ge=1, le=300)] = Field(
|
|
233
|
-
60, description=
|
|
233
|
+
60, description="Execution timeout in seconds", title="Timeout"
|
|
234
234
|
)
|
|
235
235
|
region: Optional[str] = Field(
|
|
236
|
-
None, description=
|
|
236
|
+
None, description="AWS region for execution", title="Region"
|
|
237
237
|
)
|
|
238
238
|
metadata: Optional[Dict[str, Any]] = Field(
|
|
239
|
-
None, description=
|
|
239
|
+
None, description="Additional metadata", title="Metadata"
|
|
240
240
|
)
|
|
241
241
|
comment: Optional[str] = Field(
|
|
242
|
-
None, description=
|
|
242
|
+
None, description="Comment about the function", title="Comment"
|
|
243
243
|
)
|
|
244
244
|
display_src: Optional[str] = Field(
|
|
245
|
-
None, description=
|
|
245
|
+
None, description="Display source code", title="Display Src"
|
|
246
246
|
)
|
|
247
247
|
|
|
248
248
|
|
|
249
249
|
class VerifiersExecuteResponse(BaseModel):
|
|
250
250
|
key: Optional[str] = Field(
|
|
251
|
-
None, description=
|
|
251
|
+
None, description="Key of the verifier artifact", title="Key"
|
|
252
252
|
)
|
|
253
253
|
version: Optional[int] = Field(
|
|
254
|
-
None, description=
|
|
254
|
+
None, description="Version of the verifier artifact", title="Version"
|
|
255
255
|
)
|
|
256
256
|
display_src: Optional[str] = Field(
|
|
257
|
-
None, description=
|
|
257
|
+
None, description="Display source code of the verifier", title="Display Src"
|
|
258
258
|
)
|
|
259
259
|
created_at: Optional[str] = Field(
|
|
260
|
-
None, description=
|
|
260
|
+
None, description="Creation timestamp", title="Created At"
|
|
261
261
|
)
|
|
262
262
|
comment: Optional[str] = Field(
|
|
263
|
-
None, description=
|
|
263
|
+
None, description="Comment about the verifier", title="Comment"
|
|
264
264
|
)
|
|
265
265
|
success: bool = Field(
|
|
266
|
-
..., description=
|
|
266
|
+
..., description="Whether the verification was successful", title="Success"
|
|
267
267
|
)
|
|
268
268
|
result: Optional[Any] = Field(
|
|
269
|
-
None, description=
|
|
269
|
+
None, description="The return value of the function", title="Result"
|
|
270
270
|
)
|
|
271
271
|
error: Optional[Dict[str, Any]] = Field(
|
|
272
|
-
None, description=
|
|
272
|
+
None, description="Error details if verification failed", title="Error"
|
|
273
273
|
)
|
|
274
274
|
execution_time_ms: int = Field(
|
|
275
|
-
..., description=
|
|
275
|
+
..., description="Execution time in milliseconds", title="Execution Time Ms"
|
|
276
276
|
)
|
|
277
277
|
bundle_cache_hit: Optional[bool] = Field(
|
|
278
278
|
False,
|
|
279
|
-
description=
|
|
280
|
-
title=
|
|
279
|
+
description="Whether the bundle was already cached",
|
|
280
|
+
title="Bundle Cache Hit",
|
|
281
281
|
)
|
|
282
282
|
stdout: Optional[str] = Field(
|
|
283
|
-
None, description=
|
|
283
|
+
None, description="Captured stdout from execution", title="Stdout"
|
|
284
284
|
)
|
|
285
285
|
|
|
286
286
|
|
|
287
287
|
class DescribeResponse(BaseModel):
|
|
288
|
-
success: bool = Field(..., title=
|
|
289
|
-
resource_name: str = Field(..., title=
|
|
290
|
-
tables: Optional[List[TableSchema]] = Field(None, title=
|
|
291
|
-
error: Optional[str] = Field(None, title=
|
|
292
|
-
message: str = Field(..., title=
|
|
288
|
+
success: bool = Field(..., title="Success")
|
|
289
|
+
resource_name: str = Field(..., title="Resource Name")
|
|
290
|
+
tables: Optional[List[TableSchema]] = Field(None, title="Tables")
|
|
291
|
+
error: Optional[str] = Field(None, title="Error")
|
|
292
|
+
message: str = Field(..., title="Message")
|
|
293
293
|
|
|
294
294
|
|
|
295
295
|
class HTTPValidationError(BaseModel):
|
|
296
|
-
detail: Optional[List[ValidationError]] = Field(None, title=
|
|
296
|
+
detail: Optional[List[ValidationError]] = Field(None, title="Detail")
|
|
297
297
|
|
|
298
298
|
|
|
299
299
|
class InstanceURLs(BaseModel):
|
|
300
|
-
root: str = Field(..., title=
|
|
301
|
-
app: List[str] = Field(..., title=
|
|
302
|
-
api: Optional[str] = Field(None, title=
|
|
303
|
-
health: Optional[str] = Field(None, title=
|
|
304
|
-
api_docs: Optional[str] = Field(None, title=
|
|
300
|
+
root: str = Field(..., title="Root")
|
|
301
|
+
app: List[str] = Field(..., title="App")
|
|
302
|
+
api: Optional[str] = Field(None, title="Api")
|
|
303
|
+
health: Optional[str] = Field(None, title="Health")
|
|
304
|
+
api_docs: Optional[str] = Field(None, title="Api Docs")
|
|
305
305
|
manager: ManagerURLs
|
|
306
306
|
|
|
307
307
|
|
|
308
308
|
class Resource(BaseModel):
|
|
309
|
-
name: str = Field(..., title=
|
|
309
|
+
name: str = Field(..., title="Name")
|
|
310
310
|
type: ResourceType
|
|
311
311
|
mode: ResourceMode
|
|
312
|
-
label: Optional[str] = Field(None, title=
|
|
312
|
+
label: Optional[str] = Field(None, title="Label")
|
|
313
313
|
|
|
314
314
|
|
|
315
315
|
class ResourcesResponse(BaseModel):
|
|
316
|
-
resources: List[Resource] = Field(..., title=
|
|
316
|
+
resources: List[Resource] = Field(..., title="Resources")
|
|
317
317
|
|
|
318
318
|
|
|
319
319
|
class TaskListResponse(BaseModel):
|
|
320
|
-
tasks: List[TaskResponse] = Field(..., title=
|
|
321
|
-
total: int = Field(..., title=
|
|
320
|
+
tasks: List[TaskResponse] = Field(..., title="Tasks")
|
|
321
|
+
total: int = Field(..., title="Total")
|
|
322
322
|
|
|
323
323
|
|
|
324
324
|
class InstanceResponse(BaseModel):
|
|
325
|
-
instance_id: str = Field(..., title=
|
|
326
|
-
env_key: str = Field(..., title=
|
|
327
|
-
version: str = Field(..., title=
|
|
328
|
-
status: str = Field(..., title=
|
|
329
|
-
subdomain: str = Field(..., title=
|
|
330
|
-
created_at: str = Field(..., title=
|
|
331
|
-
updated_at: str = Field(..., title=
|
|
332
|
-
terminated_at: Optional[str] = Field(None, title=
|
|
333
|
-
team_id: str = Field(..., title=
|
|
334
|
-
region: str = Field(..., title=
|
|
335
|
-
env_variables: Optional[Dict[str, Any]] = Field(None, title=
|
|
336
|
-
urls: Optional[InstanceURLs] = Field(None, title=
|
|
337
|
-
health: Optional[bool] = Field(None, title=
|
|
325
|
+
instance_id: str = Field(..., title="Instance Id")
|
|
326
|
+
env_key: str = Field(..., title="Env Key")
|
|
327
|
+
version: str = Field(..., title="Version")
|
|
328
|
+
status: str = Field(..., title="Status")
|
|
329
|
+
subdomain: str = Field(..., title="Subdomain")
|
|
330
|
+
created_at: str = Field(..., title="Created At")
|
|
331
|
+
updated_at: str = Field(..., title="Updated At")
|
|
332
|
+
terminated_at: Optional[str] = Field(None, title="Terminated At")
|
|
333
|
+
team_id: str = Field(..., title="Team Id")
|
|
334
|
+
region: str = Field(..., title="Region")
|
|
335
|
+
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
336
|
+
urls: Optional[InstanceURLs] = Field(None, title="Urls")
|
|
337
|
+
health: Optional[bool] = Field(None, title="Health")
|
|
338
|
+
|
|
338
339
|
|
|
339
340
|
class AccountResponse(BaseModel):
|
|
340
|
-
team_id: str = Field(..., title=
|
|
341
|
-
team_name: str = Field(..., title=
|
|
342
|
-
instance_limit: int = Field(..., title=
|
|
343
|
-
instance_count: int = Field(..., title=
|
|
341
|
+
team_id: str = Field(..., title="Team Id")
|
|
342
|
+
team_name: str = Field(..., title="Team Name")
|
|
343
|
+
instance_limit: int = Field(..., title="Instance Limit")
|
|
344
|
+
instance_count: int = Field(..., title="Instance Count")
|
fleet/resources/base.py
CHANGED
fleet/resources/mcp.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from typing import Dict
|
|
2
|
-
import json
|
|
3
2
|
|
|
4
3
|
|
|
5
4
|
class MCPResource:
|
|
@@ -22,39 +21,34 @@ class MCPResource:
|
|
|
22
21
|
"name": self._env_key,
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
import
|
|
24
|
+
def list_tools(self):
|
|
25
|
+
import requests
|
|
26
|
+
|
|
27
27
|
"""
|
|
28
|
-
Make
|
|
29
|
-
|
|
28
|
+
Make a request to list available tools from the MCP endpoint.
|
|
29
|
+
|
|
30
30
|
Returns:
|
|
31
31
|
List of available tools with name, description, and input_schema
|
|
32
32
|
"""
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
return available_tools
|
|
58
|
-
else:
|
|
59
|
-
# Handle error or empty response
|
|
60
|
-
return []
|
|
33
|
+
payload = {"jsonrpc": "2.0", "method": "tools/list", "params": {}, "id": 2}
|
|
34
|
+
|
|
35
|
+
response = requests.post(self.url, json=payload)
|
|
36
|
+
data = response.json()
|
|
37
|
+
|
|
38
|
+
# Extract tools from the response
|
|
39
|
+
if "result" in data and "tools" in data["result"]:
|
|
40
|
+
tools = data["result"]["tools"]
|
|
41
|
+
|
|
42
|
+
available_tools = [
|
|
43
|
+
{
|
|
44
|
+
"name": tool.get("name"),
|
|
45
|
+
"description": tool.get("description"),
|
|
46
|
+
"input_schema": tool.get("inputSchema"),
|
|
47
|
+
}
|
|
48
|
+
for tool in tools
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
return available_tools
|
|
52
|
+
else:
|
|
53
|
+
# Handle error or empty response
|
|
54
|
+
return []
|