@@ -292,6 +292,66 @@ class ObjectSetPropertiesTrace(TypedDict):
292292 description : str
293293
294294
295+ class PythonStdoutEvent (TypedDict ):
296+ kind : Literal ["stdout" ]
297+ ts : int
298+ text : str
299+
300+
301+ class PythonStderrEvent (TypedDict ):
302+ kind : Literal ["stderr" ]
303+ ts : int
304+ text : str
305+
306+
307+ class PythonSubAgentCallEvent (TypedDict ):
308+ kind : Literal ["subAgentCall" ]
309+ ts_start : int
310+ ts_end : int
311+ agent_type : str
312+ prompt : str
313+ status : Literal ["success" , "error" , "timeout" ]
314+ request_id : NotRequired [str ]
315+ error_message : NotRequired [str ]
316+ action_trace : NotRequired [ActionTrace ]
317+
318+
319+ class PythonExtensionActionEvent (TypedDict ):
320+ kind : Literal ["extensionAction" ]
321+ ts_start : int
322+ ts_end : int
323+ action_name : str
324+ request_summary : dict [str , object ]
325+ result_summary : NotRequired [dict [str , object ]]
326+ status : Literal ["success" , "error" , "timeout" ]
327+ error_message : NotRequired [str ]
328+
329+
330+ class PythonSideEffectEvent (TypedDict ):
331+ kind : Literal ["sideEffect" ]
332+ ts : int
333+ effect_type : Literal ["download_file" , "render_html" ]
334+ description : str
335+
336+
337+ type PythonTraceEvent = (
338+ PythonStdoutEvent
339+ | PythonStderrEvent
340+ | PythonSubAgentCallEvent
341+ | PythonExtensionActionEvent
342+ | PythonSideEffectEvent
343+ )
344+
345+
346+ class PythonAgentRunTrace (TypedDict ):
347+ step_type : Literal ["pythonAgentRun" ]
348+ url : str
349+ status : Literal ["success" , "error" , "aborted" ]
350+ duration_ms : int
351+ events : list [PythonTraceEvent ]
352+ error_message : NotRequired [str ]
353+
354+
295355ApaStepTrace = (
296356 GoToUrlTrace
297357 | GetUrlTrace
@@ -324,6 +384,7 @@ class ObjectSetPropertiesTrace(TypedDict):
324384 | DataTableInsertRowTrace
325385 | DataTableUpdateCellValueTrace
326386 | ObjectSetPropertiesTrace
387+ | PythonAgentRunTrace
327388)
328389
329390
0 commit comments