agent-dev-cli 0.0.1b260112__py3-none-any.whl → 0.0.1b260128__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.
- {agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/METADATA +6 -5
- {agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/RECORD +8 -8
- agentdev/_version.py +1 -1
- agentdev/backend/_utils.py +11 -8
- agentdev/backend/event_mapper.py +82 -11
- {agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/WHEEL +0 -0
- {agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/entry_points.txt +0 -0
- {agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-dev-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.1b260128
|
|
4
4
|
Summary: AI Toolkit - CLI and SDK for agent debugging and workflow visualization
|
|
5
5
|
Keywords: ai,agent,toolkit,debugging,workflow,visualization
|
|
6
6
|
Author-email: Microsoft <aitkfeedback@microsoft.com>
|
|
@@ -26,9 +26,10 @@ Requires-Dist: python-dotenv>=1.2.1
|
|
|
26
26
|
Requires-Dist: azure-ai-agents>=1.2.0b5
|
|
27
27
|
Requires-Dist: starlette>=0.49.3
|
|
28
28
|
Requires-Dist: openai>=1.109.1
|
|
29
|
-
Requires-Dist: agent-framework-azure-ai>=1.0.0b251211
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist: azure-ai-agentserver-
|
|
29
|
+
Requires-Dist: agent-framework-azure-ai>=1.0.0b251211,<=1.0.0b260107
|
|
30
|
+
Requires-Dist: agent-framework-core>=1.0.0b251211,<=1.0.0b260107
|
|
31
|
+
Requires-Dist: azure-ai-agentserver-agentframework==1.0.0b7
|
|
32
|
+
Requires-Dist: azure-ai-agentserver-core==1.0.0b7
|
|
32
33
|
Requires-Dist: click>=8.1.0
|
|
33
34
|
Requires-Dist: azure-ai-projects>=2.0.0b2
|
|
34
35
|
Project-URL: Documentation, https://github.com/microsoft/vscode-ai-toolkit#readme
|
|
@@ -144,5 +145,5 @@ curl 'http://localhost:8087/agentdev/v1/responses' \
|
|
|
144
145
|
|
|
145
146
|
## License
|
|
146
147
|
|
|
147
|
-
|
|
148
|
+
This project is licensed under the **Microsoft AI Toolkit – Agent Dev CLI License Terms**.
|
|
148
149
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
agentdev/__init__.py,sha256=Gf0UUj3_2MdCadGtKtnyJeYY02iUH5ZMevelN8Um09M,557
|
|
2
2
|
agentdev/__main__.py,sha256=lHwzD56r-Jd0A_VOGRmv2PcP2AZ56dWz61o3zCBGxzY,135
|
|
3
3
|
agentdev/_hooks.py,sha256=0bdq-K170vTmhE9a5JHL-DCXJOCpuG2LIvannQqH3jU,9819
|
|
4
|
-
agentdev/_version.py,sha256=
|
|
4
|
+
agentdev/_version.py,sha256=IOwzoprLYeJ3RUKmfsFNbFBU52JnkrkpFoWL96h6Fng,79
|
|
5
5
|
agentdev/bootstrap.py,sha256=sL9CobtPdK4n2piHhFr1-K12AlWgTfgfbdzyfTYWuxc,2192
|
|
6
6
|
agentdev/cli.py,sha256=SWM_SHfZdmLr6ZH8yuGtiMLcd9lhta5YjQxW9xICXac,4948
|
|
7
7
|
agentdev/localdebug.py,sha256=qn75D3hISn2k8yFLRs0qXFrr_asCNRqyOcNy-97AWaY,2028
|
|
8
8
|
agentdev/backend/__init__.py,sha256=BFiYU9_0aAfygA0oTs0o70etmH65_gX9cN53ZcMwFIY,197
|
|
9
9
|
agentdev/backend/_conversations.py,sha256=ui62ml5pise0fF9ri7HITM_l4irMdmm2jJ7d_U1FL74,18518
|
|
10
|
-
agentdev/backend/_utils.py,sha256=
|
|
10
|
+
agentdev/backend/_utils.py,sha256=MmysFnqhNmfCyb1cTfLtpGR66yJ2nElpcDQq8j_4hT0,3412
|
|
11
11
|
agentdev/backend/code_analyzer.py,sha256=-B_1Qrf3cbWhvcxjxgk7xbHyfjKuL11GvtzY9wA1hkM,1565
|
|
12
12
|
agentdev/backend/errors.py,sha256=95geZNBeAfxAWyJDCaGFXSFsCifUZ2V0PHmsPOYsmt4,53
|
|
13
|
-
agentdev/backend/event_mapper.py,sha256=
|
|
13
|
+
agentdev/backend/event_mapper.py,sha256=WTWxuk8col3gugEJgGNFy2BW9XHgTZyts4orQTycviQ,16044
|
|
14
14
|
agentdev/backend/server.py,sha256=BRtZqJI2GxWraRwYkrpJNcDnhxZJ22aL0ScIZNhfNSk,12388
|
|
15
15
|
agentdev/backend/structs/__init__.py,sha256=UKpDMo_sjEtvmHI8Rys6_s4dUYaE0lz3-jw0T_BWoQ8,212
|
|
16
16
|
agentdev/backend/structs/entity_response.py,sha256=dGG-9J3gpGxqu4LV_6UqeoyzjdBqFn8tiesu2EPXzmc,1079
|
|
17
17
|
agentdev/backend/structs/request.py,sha256=lG0Tcp3bvR505DobO9u8XPfeVg-0DGKvt7mhPbGFJRg,2044
|
|
18
|
-
agent_dev_cli-0.0.
|
|
19
|
-
agent_dev_cli-0.0.
|
|
20
|
-
agent_dev_cli-0.0.
|
|
21
|
-
agent_dev_cli-0.0.
|
|
22
|
-
agent_dev_cli-0.0.
|
|
18
|
+
agent_dev_cli-0.0.1b260128.dist-info/entry_points.txt,sha256=Zeb1F0rPDO1dIQorHn7Q-hpOg09ZDE7elz4fowvO6BQ,46
|
|
19
|
+
agent_dev_cli-0.0.1b260128.dist-info/licenses/LICENSE,sha256=spth2ab8cfDqNmKBLSbKHNqnlnDIj-bYaw8insufb2w,3000
|
|
20
|
+
agent_dev_cli-0.0.1b260128.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
21
|
+
agent_dev_cli-0.0.1b260128.dist-info/METADATA,sha256=c6wmFQukxsiJAI0qGkyvip24faqAgoh65uaG-aAJhkk,4488
|
|
22
|
+
agent_dev_cli-0.0.1b260128.dist-info/RECORD,,
|
agentdev/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Version information for agentdev package."""
|
|
2
|
-
__version__ = "0.0.
|
|
2
|
+
__version__ = "0.0.1b260128"
|
agentdev/backend/_utils.py
CHANGED
|
@@ -36,11 +36,6 @@ def serialize_data(data: Any, max_depth: int = 10) -> Any:
|
|
|
36
36
|
if isinstance(data, dict):
|
|
37
37
|
return {k: serialize_data(v, max_depth - 1) for k, v in data.items()}
|
|
38
38
|
|
|
39
|
-
# Handle ChatMessage - show as {"role":"xxx", "text":"xxx"}
|
|
40
|
-
if isinstance(data, ChatMessage):
|
|
41
|
-
role_str = data.role.value if hasattr(data.role, 'value') else str(data.role)
|
|
42
|
-
return {"role": role_str, "text": data.text}
|
|
43
|
-
|
|
44
39
|
# Handle AgentExecutorResponse
|
|
45
40
|
if isinstance(data, AgentExecutorResponse):
|
|
46
41
|
result = {}
|
|
@@ -53,14 +48,21 @@ def serialize_data(data: Any, max_depth: int = 10) -> Any:
|
|
|
53
48
|
# Handle objects with to_dict() method
|
|
54
49
|
if hasattr(data, "to_dict") and callable(data.to_dict):
|
|
55
50
|
try:
|
|
56
|
-
|
|
51
|
+
dict_data = data.to_dict()
|
|
52
|
+
return serialize_data(dict_data, max_depth - 1)
|
|
57
53
|
except Exception:
|
|
58
54
|
pass
|
|
55
|
+
|
|
56
|
+
# Handle ChatMessage - Fallback if to_dict failed or is not available
|
|
57
|
+
if isinstance(data, ChatMessage):
|
|
58
|
+
role_str = data.role.value if hasattr(data.role, 'value') else str(data.role)
|
|
59
|
+
return {"role": role_str, "text": data.text, "contents": serialize_data(data.contents, max_depth - 1)}
|
|
59
60
|
|
|
60
61
|
# Handle Pydantic models with model_dump()
|
|
61
62
|
if hasattr(data, "model_dump") and callable(data.model_dump):
|
|
62
63
|
try:
|
|
63
|
-
|
|
64
|
+
model_data = data.model_dump()
|
|
65
|
+
return serialize_data(model_data, max_depth - 1)
|
|
64
66
|
except Exception:
|
|
65
67
|
pass
|
|
66
68
|
|
|
@@ -68,7 +70,8 @@ def serialize_data(data: Any, max_depth: int = 10) -> Any:
|
|
|
68
70
|
if hasattr(data, "__dataclass_fields__"):
|
|
69
71
|
try:
|
|
70
72
|
from dataclasses import asdict
|
|
71
|
-
|
|
73
|
+
dataclass_dict = asdict(data)
|
|
74
|
+
return serialize_data(dataclass_dict, max_depth - 1)
|
|
72
75
|
except Exception:
|
|
73
76
|
pass
|
|
74
77
|
|
agentdev/backend/event_mapper.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import time
|
|
2
3
|
from typing import Callable, Type, Any
|
|
3
4
|
from functools import wraps
|
|
@@ -132,16 +133,82 @@ class EventMapper():
|
|
|
132
133
|
|
|
133
134
|
@event_mapper(AgentRunUpdateEvent)
|
|
134
135
|
def _map_agent_run_update_event(self, ctx: MapperContext, event: AgentRunUpdateEvent) -> list[dict]:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
events = []
|
|
137
|
+
update = event.data
|
|
138
|
+
logging.debug(f"[EventMapper] AgentRunUpdateEvent received, executor_id={event.executor_id}, contents={len(update.contents) if update.contents else 0}")
|
|
139
|
+
if not ctx.item_id:
|
|
140
|
+
# Fallback if item_id not set
|
|
141
|
+
ctx.item_id = f"exec_{event.executor_id}_{str(uuid.uuid4())[:8]}"
|
|
142
|
+
|
|
143
|
+
message_item_id = ctx.item_id + "_message"
|
|
144
|
+
|
|
145
|
+
for content in update.contents:
|
|
146
|
+
logging.debug(f"[EventMapper] Processing content type: {type(content).__name__}")
|
|
147
|
+
if isinstance(content, TextContent):
|
|
148
|
+
events.append({
|
|
149
|
+
"type":"response.output_text.delta",
|
|
150
|
+
"content_index":0,
|
|
151
|
+
"delta": content.text,
|
|
152
|
+
"item_id": message_item_id,
|
|
153
|
+
"logprobs":[],
|
|
154
|
+
"output_index":ctx.output_index,
|
|
155
|
+
})
|
|
156
|
+
elif isinstance(content, FunctionCallContent):
|
|
157
|
+
if content.call_id != ctx.call_id:
|
|
158
|
+
ctx.call_id = content.call_id
|
|
159
|
+
ctx.output_index += 1
|
|
160
|
+
events.append({
|
|
161
|
+
"type":"response.output_item.added",
|
|
162
|
+
"output_index": ctx.output_index,
|
|
163
|
+
"item":{
|
|
164
|
+
"type":"function_call",
|
|
165
|
+
"arguments":"",
|
|
166
|
+
"call_id": ctx.call_id,
|
|
167
|
+
"name": content.name,
|
|
168
|
+
"id": content.call_id,
|
|
169
|
+
"status":"in_progress",
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
# Handle arguments delta
|
|
174
|
+
delta_args = ""
|
|
175
|
+
if isinstance(content.arguments, str):
|
|
176
|
+
delta_args = content.arguments
|
|
177
|
+
elif content.arguments:
|
|
178
|
+
# Serialize dictionary arguments
|
|
179
|
+
try:
|
|
180
|
+
delta_args = json.dumps(serialize_data(content.arguments))
|
|
181
|
+
except Exception as e:
|
|
182
|
+
logging.warning(f"Failed to serialize arguments: {e}")
|
|
183
|
+
delta_args = str(content.arguments)
|
|
184
|
+
|
|
185
|
+
if delta_args:
|
|
186
|
+
events.append({
|
|
187
|
+
"type": "response.function_call_arguments.delta",
|
|
188
|
+
"output_index": ctx.output_index,
|
|
189
|
+
"item_id": ctx.call_id,
|
|
190
|
+
"delta": delta_args,
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
elif isinstance(content, FunctionResultContent):
|
|
194
|
+
serialized_result = None
|
|
195
|
+
try:
|
|
196
|
+
serialized_result = serialize_data(content.result)
|
|
197
|
+
except Exception as e:
|
|
198
|
+
logging.warning(f"Failed to serialize function result: {e}")
|
|
199
|
+
serialized_result = str(content.result)
|
|
200
|
+
|
|
201
|
+
events.append({
|
|
202
|
+
"type":"response.function_result.complete",
|
|
203
|
+
"call_id": content.call_id,
|
|
204
|
+
"output_index": ctx.output_index,
|
|
205
|
+
"output": serialized_result,
|
|
206
|
+
"status":"completed",
|
|
207
|
+
"item_id": ctx.item_id,
|
|
208
|
+
"timestamp":datetime.now().isoformat(),
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
return events
|
|
145
212
|
|
|
146
213
|
@event_mapper(ExecutorEvent)
|
|
147
214
|
def _map_executor_event(self, ctx: MapperContext, event: ExecutorEvent) -> list[dict]:
|
|
@@ -225,6 +292,7 @@ class EventMapper():
|
|
|
225
292
|
@event_mapper(AgentRunResponseUpdate)
|
|
226
293
|
def _map_agent_run_response_update(self, ctx: MapperContext, event: AgentRunResponseUpdate) -> list[dict]:
|
|
227
294
|
item_id = event.message_id
|
|
295
|
+
logging.debug(f"[EventMapper] AgentRunResponseUpdate received, message_id={item_id}, contents={len(event.contents) if event.contents else 0}")
|
|
228
296
|
results = []
|
|
229
297
|
if item_id and item_id != ctx.item_id:
|
|
230
298
|
ctx.item_id = item_id
|
|
@@ -306,10 +374,13 @@ class EventMapper():
|
|
|
306
374
|
|
|
307
375
|
def map_event(self, ctx: MapperContext, event: Any) -> list[dict]:
|
|
308
376
|
"""Map an Agent Framework event to OpenAI Responses API events"""
|
|
377
|
+
logging.debug(f"[EventMapper] map_event called with event type: {type(event).__name__}")
|
|
309
378
|
mapper = self._get_event_mapper(type(event))
|
|
310
379
|
if not mapper:
|
|
311
380
|
logging.warning("Unknown event: %s", type(event))
|
|
312
381
|
return []
|
|
313
382
|
|
|
314
|
-
|
|
383
|
+
result = mapper(ctx, event)
|
|
384
|
+
logging.debug(f"[EventMapper] Mapped to {len(result)} output events: {[e.get('type') for e in result]}")
|
|
385
|
+
return result
|
|
315
386
|
|
|
File without changes
|
{agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{agent_dev_cli-0.0.1b260112.dist-info → agent_dev_cli-0.0.1b260128.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|