diff --git a/internal/version/VERSION b/internal/version/VERSION index a40a80c8..0c419f8c 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2506241536 +v5.0.0-beta-2506241601 diff --git a/report.go b/report.go index fbc9933e..9ab06436 100644 --- a/report.go +++ b/report.go @@ -2442,9 +2442,19 @@ const htmlTemplate = ` {{if $action.AIResult}}
- - {{if $action.AIResult.Thought}} -
{{$action.AIResult.Thought}}
+ + {{if eq $action.AIResult.Type "query"}} + {{if $action.AIResult.QueryResult.Thought}} +
{{$action.AIResult.QueryResult.Thought}}
+ {{end}} + {{else if eq $action.AIResult.Type "action"}} + {{if $action.AIResult.PlanningResult.Thought}} +
{{$action.AIResult.PlanningResult.Thought}}
+ {{end}} + {{else if eq $action.AIResult.Type "assert"}} + {{if $action.AIResult.AssertionResult.Thought}} +
{{$action.AIResult.AssertionResult.Thought}}
+ {{end}} {{end}} @@ -2514,8 +2524,19 @@ const htmlTemplate = ` {{if $action.AIResult.Resolution}}
📐 Resolution: {{$action.AIResult.Resolution.Width}}x{{$action.AIResult.Resolution.Height}}
{{end}} - {{if $action.AIResult.Content}} -
💬 {{title $action.AIResult.Type}} Result: {{$action.AIResult.Content}}
+ {{/* Display Content from specific result types */}} + {{if eq $action.AIResult.Type "query"}} + {{if $action.AIResult.QueryResult.Content}} +
💬 {{title $action.AIResult.Type}} Result: {{$action.AIResult.QueryResult.Content}}
+ {{end}} + {{else if eq $action.AIResult.Type "action"}} + {{if $action.AIResult.PlanningResult.Content}} +
💬 {{title $action.AIResult.Type}} Result: {{$action.AIResult.PlanningResult.Content}}
+ {{end}} + {{else if eq $action.AIResult.Type "assert"}} + {{if $action.AIResult.AssertionResult.Content}} +
💬 {{title $action.AIResult.Type}} Result: {{$action.AIResult.AssertionResult.Content}}
+ {{end}} {{end}}
diff --git a/uixt/driver_ext_ai.go b/uixt/driver_ext_ai.go index e6aaf723..bef8ac5f 100644 --- a/uixt/driver_ext_ai.go +++ b/uixt/driver_ext_ai.go @@ -156,8 +156,6 @@ func (dExt *XTDriver) AIAction(ctx context.Context, prompt string, opts ...optio ImagePath: screenResult.ImagePath, Resolution: &screenResult.Resolution, PlanningResult: &planningResult.PlanningResult, - Thought: planningResult.Thought, - Content: planningResult.Content, } if err != nil { @@ -341,9 +339,7 @@ type AIExecutionResult struct { AssertionResult *ai.AssertionResult `json:"assertion_result,omitempty"` // for ai_assert operations // Common fields - Thought string `json:"thought,omitempty"` // AI reasoning/thought process - Content string `json:"content,omitempty"` // operation result content - Error string `json:"error,omitempty"` // error message if operation failed + Error string `json:"error,omitempty"` // error message if operation failed } // SubActionResult represents a sub-action within a start_to_goal action @@ -408,8 +404,6 @@ func (dExt *XTDriver) AIQuery(text string, opts ...option.ActionOption) (*AIExec ImagePath: screenResult.ImagePath, // screenshot path Resolution: &screenResult.Resolution, // screen resolution QueryResult: result, // query-specific result - Thought: result.Thought, // AI reasoning - Content: result.Content, // query result content } return aiResult, nil } @@ -458,7 +452,6 @@ func (dExt *XTDriver) AIAssert(assertion string, opts ...option.ActionOption) (* ImagePath: screenResult.ImagePath, Resolution: &screenResult.Resolution, AssertionResult: result, - Thought: result.Thought, } if err != nil { @@ -471,6 +464,5 @@ func (dExt *XTDriver) AIAssert(assertion string, opts ...option.ActionOption) (* return aiResult, errors.New(result.Thought) } - aiResult.Content = "Assertion passed" return aiResult, nil } diff --git a/uixt/mcp_tools_ai.go b/uixt/mcp_tools_ai.go index 5fa87c05..e29e3cc6 100644 --- a/uixt/mcp_tools_ai.go +++ b/uixt/mcp_tools_ai.go @@ -174,7 +174,7 @@ func (t *ToolAIQuery) Implement() server.ToolHandlerFunc { message := fmt.Sprintf("Successfully queried information with prompt: %s", unifiedReq.Prompt) returnData := ToolAIQuery{ Prompt: unifiedReq.Prompt, - Result: queryResult.Content, + Result: queryResult.QueryResult.Content, } return NewMCPSuccessResponse(message, &returnData), nil