How to change the paint bucket tool's configuration in UXP?

Hi there, I have a case that need to switch to paint bucket tool by my plugin. This could be set by batchPlay like:

const result = await batchPlay(
[
   {
      "_obj": "select",
      "_target": [
         {
            "_ref": "bucketTool",
         }
      ],

      "dontRecord": true,
      "forceNotify": true,
      "_isCommand": false,
      "_options": {
         "dialogOptions": "dontDisplay"
      }
   }
],{
   "synchronousExecution": false,
   "modalBehavior": "fail"
});

But this seems can’t set the configuration of the bucket tool, like changing the value of tolerance, or setting contiguous ON/OFF…

I tried to capture the event by Alchemist and I also searched the docs, but nothing get. So I just want to know if there is a way could set the bucket tool, not only select it, but also set the configuration of it automatically?

BTW, to work around it, here is another possible option but I also need some help… it seems I can trigger a bucket fill by batchPlay like:

await batchPlay(
[
   {
      "_obj": "fill",
      "from": {
         "_obj": "paint",
         "horizontal": {
            "_unit": "pixelsUnit",
            "_value": 249
         },
         "vertical": {
            "_unit": "pixelsUnit",
            "_value": 62
         }
      },
      "tolerance": 0,
      "using": {
         "_enum": "fillContents",
         "_value": "foregroundColor"
      },
      "contiguous": false,
      "_isCommand": true,
      "_options": {
         "dialogOptions": "dontDisplay"
      }
   }
],{
   "synchronousExecution": false,
   "modalBehavior": "fail"
});

This could allow me to set any parameter of the bucket tool, which is great. But it requires the location of mouse in the canvas, which stuck me again… is there a way that could get this information under UXP?

Solution to any one of them will both be helpful for me, thanks for any help or suggestions

Every setter structure is something like:

await batchPlay(
  [
     {
        "_obj": "set",
        "_target": [
           {"_ref": "bucketTool"}
        ],
        "to": toolOptions
     }
  ],{
     "synchronousExecution": false
  }
);

Where toolOptions is the options you want to change for the specific tool. You can check the options with Alchemist and adjust them as necessary

Thanks a lot, It works!

And for anyone who also having similar issue, I think you probably will wish to watch this video first if you haven’t do so:
Adobe UXP: Things you need to know! #8 BatchPlay (part 3): the Alchemist inspector - YouTube