fix: remove unnecessary IgnoreNotFoundError and MaxRetryTimes from coordinate-based tap tools

- Removed IgnoreNotFoundError and MaxRetryTimes parameters from TapRequest, TapAbsXYRequest, and DoubleTapXYRequest structures
- Updated corresponding tool implementations to remove references to these non-existent fields
- These parameters are not applicable to coordinate-based operations as they don't involve element searching
- Only OCR/CV-based operations need these error handling parameters

This ensures that only relevant tools have the ignore_NotFoundError functionality,
making the API more consistent and avoiding confusion.
This commit is contained in:
lilong.129
2025-05-26 22:10:08 +08:00
parent df65f9a828
commit 77f5683f9a
3 changed files with 9 additions and 31 deletions
-16
View File
@@ -316,18 +316,10 @@ func (t *ToolTapXY) Implement() server.ToolHandlerFunc {
// Build action options from request structure
var opts []option.ActionOption
// Add boolean options
if tapReq.IgnoreNotFoundError {
opts = append(opts, option.WithIgnoreNotFoundError(true))
}
// Add numeric options
if tapReq.Duration > 0 {
opts = append(opts, option.WithDuration(tapReq.Duration))
}
if tapReq.MaxRetryTimes > 0 {
opts = append(opts, option.WithMaxRetryTimes(tapReq.MaxRetryTimes))
}
// Add default options
opts = append(opts, option.WithPreMarkOperation(true))
@@ -394,18 +386,10 @@ func (t *ToolTapAbsXY) Implement() server.ToolHandlerFunc {
// Build action options from request structure
var opts []option.ActionOption
// Add boolean options
if tapAbsReq.IgnoreNotFoundError {
opts = append(opts, option.WithIgnoreNotFoundError(true))
}
// Add numeric options
if tapAbsReq.Duration > 0 {
opts = append(opts, option.WithDuration(tapAbsReq.Duration))
}
if tapAbsReq.MaxRetryTimes > 0 {
opts = append(opts, option.WithMaxRetryTimes(tapAbsReq.MaxRetryTimes))
}
// Tap absolute XY action logic
log.Info().Float64("x", tapAbsReq.X).Float64("y", tapAbsReq.Y).Msg("tapping at absolute coordinates")