definition property

  1. @override
Tool get definition
override

Implementation

@override
Tool get definition => Tool(
      name: 'scroll_to_find',
      description:
          'Scroll until a target is on screen, then return its glintId (tap:true also taps it, so it must also be hittable). Match targetGlintId (exact id) or targetTextContent (substring of any text), not both. direction default down, maxScrolls 8 (cap 50, a larger value is clamped and the reply says so), amountFraction 0.6; progress every 10 s. It stops early when the list stops moving (end reached). When it stalls with a loading indicator showing it waits up to 4 s for rows to arrive before deciding it is at the end. Swipes the nearest scrollable around the target on that axis, and stops if the route or an outer PageView page changes. errorKind: targetNotFound (never appeared), scrollLimitReached (appeared, never on screen; detail says where it sat), notHittable (tap:true, on screen but covered), unresolvedTarget (inside a modal, not scrollable content), scrollSideEffect (route or outer page changed), flutterModeRequired (device mode).',
      inputSchema: ObjectSchema(
        properties: {
          'targetGlintId': Schema.string(
            description: 'Stable id to find. Mutually exclusive with `targetTextContent`.',
          ),
          'targetTextContent': Schema.string(
            description: 'Case-insensitive substring to match against any text '
                'node\'s content. Useful when the compact renderer collapsed '
                'the id you wanted.',
          ),
          'text': Schema.string(
            description: 'Alias of targetTextContent.',
          ),
          'direction': Schema.string(
            description: 'One of: up, down, left, right. Default down.',
          ),
          'maxScrolls': Schema.int(
            description: 'Scroll ceiling, 0-20. Default 8.',
          ),
          'amountFraction': Schema.num(
            description: 'Scroll size per step. Default 0.6.',
          ),
          'tap': Schema.bool(
            description:
                'Tap it once found (its nearest tappable ancestor when the match is text) and return the tap result. Default false.',
          ),
        },
      ),
    );