superbased 2.0.9 → 3.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (709) hide show
  1. package/LICENSE +15 -26
  2. package/README.md +198 -290
  3. package/bin/superbased.js +7 -0
  4. package/package.json +42 -140
  5. package/SUPERBASED_SKILL.md +0 -1660
  6. package/dist/electron/ai/ai-client.d.ts +0 -45
  7. package/dist/electron/ai/ai-client.d.ts.map +0 -1
  8. package/dist/electron/ai/ai-client.js +0 -205
  9. package/dist/electron/ai/ai-client.js.map +0 -1
  10. package/dist/electron/ai/context-builder.d.ts +0 -8
  11. package/dist/electron/ai/context-builder.d.ts.map +0 -1
  12. package/dist/electron/ai/context-builder.js +0 -28
  13. package/dist/electron/ai/context-builder.js.map +0 -1
  14. package/dist/electron/ai/instruction-parser.d.ts +0 -11
  15. package/dist/electron/ai/instruction-parser.d.ts.map +0 -1
  16. package/dist/electron/ai/instruction-parser.js +0 -47
  17. package/dist/electron/ai/instruction-parser.js.map +0 -1
  18. package/dist/electron/ai/orchestrator.d.ts +0 -17
  19. package/dist/electron/ai/orchestrator.d.ts.map +0 -1
  20. package/dist/electron/ai/orchestrator.js +0 -53
  21. package/dist/electron/ai/orchestrator.js.map +0 -1
  22. package/dist/electron/ai/providers/anthropic.d.ts +0 -6
  23. package/dist/electron/ai/providers/anthropic.d.ts.map +0 -1
  24. package/dist/electron/ai/providers/anthropic.js +0 -67
  25. package/dist/electron/ai/providers/anthropic.js.map +0 -1
  26. package/dist/electron/ai/providers/azure-openai.d.ts +0 -12
  27. package/dist/electron/ai/providers/azure-openai.d.ts.map +0 -1
  28. package/dist/electron/ai/providers/azure-openai.js +0 -87
  29. package/dist/electron/ai/providers/azure-openai.js.map +0 -1
  30. package/dist/electron/ai/providers/gemini.d.ts +0 -6
  31. package/dist/electron/ai/providers/gemini.d.ts.map +0 -1
  32. package/dist/electron/ai/providers/gemini.js +0 -49
  33. package/dist/electron/ai/providers/gemini.js.map +0 -1
  34. package/dist/electron/ai/providers/openai.d.ts +0 -6
  35. package/dist/electron/ai/providers/openai.d.ts.map +0 -1
  36. package/dist/electron/ai/providers/openai.js +0 -68
  37. package/dist/electron/ai/providers/openai.js.map +0 -1
  38. package/dist/electron/core/auth-store.d.ts +0 -15
  39. package/dist/electron/core/auth-store.d.ts.map +0 -1
  40. package/dist/electron/core/auth-store.js +0 -86
  41. package/dist/electron/core/auth-store.js.map +0 -1
  42. package/dist/electron/core/config.d.ts +0 -6
  43. package/dist/electron/core/config.d.ts.map +0 -1
  44. package/dist/electron/core/config.js +0 -81
  45. package/dist/electron/core/config.js.map +0 -1
  46. package/dist/electron/core/file-logger.d.ts +0 -17
  47. package/dist/electron/core/file-logger.d.ts.map +0 -1
  48. package/dist/electron/core/file-logger.js +0 -74
  49. package/dist/electron/core/file-logger.js.map +0 -1
  50. package/dist/electron/core/input-injection/index.d.ts +0 -6
  51. package/dist/electron/core/input-injection/index.d.ts.map +0 -1
  52. package/dist/electron/core/input-injection/index.js +0 -31
  53. package/dist/electron/core/input-injection/index.js.map +0 -1
  54. package/dist/electron/core/input-injection/macos.d.ts +0 -3
  55. package/dist/electron/core/input-injection/macos.d.ts.map +0 -1
  56. package/dist/electron/core/input-injection/macos.js +0 -14
  57. package/dist/electron/core/input-injection/macos.js.map +0 -1
  58. package/dist/electron/core/input-injection/windows.d.ts +0 -3
  59. package/dist/electron/core/input-injection/windows.d.ts.map +0 -1
  60. package/dist/electron/core/input-injection/windows.js +0 -119
  61. package/dist/electron/core/input-injection/windows.js.map +0 -1
  62. package/dist/electron/core/json-store.d.ts +0 -26
  63. package/dist/electron/core/json-store.d.ts.map +0 -1
  64. package/dist/electron/core/json-store.js +0 -132
  65. package/dist/electron/core/json-store.js.map +0 -1
  66. package/dist/electron/core/paths.d.ts +0 -17
  67. package/dist/electron/core/paths.d.ts.map +0 -1
  68. package/dist/electron/core/paths.js +0 -117
  69. package/dist/electron/core/paths.js.map +0 -1
  70. package/dist/electron/core/platform.d.ts +0 -24
  71. package/dist/electron/core/platform.d.ts.map +0 -1
  72. package/dist/electron/core/platform.js +0 -18
  73. package/dist/electron/core/platform.js.map +0 -1
  74. package/dist/electron/core/process-coord.d.ts +0 -19
  75. package/dist/electron/core/process-coord.d.ts.map +0 -1
  76. package/dist/electron/core/process-coord.js +0 -124
  77. package/dist/electron/core/process-coord.js.map +0 -1
  78. package/dist/electron/core/serialize-schema.d.ts +0 -35
  79. package/dist/electron/core/serialize-schema.d.ts.map +0 -1
  80. package/dist/electron/core/serialize-schema.js +0 -89
  81. package/dist/electron/core/serialize-schema.js.map +0 -1
  82. package/dist/electron/core/settings-schema.d.ts +0 -81
  83. package/dist/electron/core/settings-schema.d.ts.map +0 -1
  84. package/dist/electron/core/settings-schema.js +0 -1370
  85. package/dist/electron/core/settings-schema.js.map +0 -1
  86. package/dist/electron/db/database.d.ts +0 -154
  87. package/dist/electron/db/database.d.ts.map +0 -1
  88. package/dist/electron/db/database.js +0 -637
  89. package/dist/electron/db/database.js.map +0 -1
  90. package/dist/electron/db/models.d.ts +0 -26
  91. package/dist/electron/db/models.d.ts.map +0 -1
  92. package/dist/electron/db/models.js +0 -4
  93. package/dist/electron/db/models.js.map +0 -1
  94. package/dist/electron/logger.d.ts +0 -9
  95. package/dist/electron/logger.d.ts.map +0 -1
  96. package/dist/electron/logger.js +0 -32
  97. package/dist/electron/logger.js.map +0 -1
  98. package/dist/electron/main.js +0 -3652
  99. package/dist/electron/modules/accessibility/macos-provider.d.ts +0 -8
  100. package/dist/electron/modules/accessibility/macos-provider.d.ts.map +0 -1
  101. package/dist/electron/modules/accessibility/macos-provider.js +0 -94
  102. package/dist/electron/modules/accessibility/macos-provider.js.map +0 -1
  103. package/dist/electron/modules/accessibility/provider.d.ts +0 -12
  104. package/dist/electron/modules/accessibility/provider.d.ts.map +0 -1
  105. package/dist/electron/modules/accessibility/provider.js +0 -52
  106. package/dist/electron/modules/accessibility/provider.js.map +0 -1
  107. package/dist/electron/modules/accessibility/types.d.ts +0 -63
  108. package/dist/electron/modules/accessibility/types.d.ts.map +0 -1
  109. package/dist/electron/modules/accessibility/types.js +0 -6
  110. package/dist/electron/modules/accessibility/types.js.map +0 -1
  111. package/dist/electron/modules/accessibility/windows-provider.d.ts +0 -8
  112. package/dist/electron/modules/accessibility/windows-provider.d.ts.map +0 -1
  113. package/dist/electron/modules/accessibility/windows-provider.js +0 -85
  114. package/dist/electron/modules/accessibility/windows-provider.js.map +0 -1
  115. package/dist/electron/modules/active-window.d.ts +0 -6
  116. package/dist/electron/modules/active-window.d.ts.map +0 -1
  117. package/dist/electron/modules/active-window.js +0 -76
  118. package/dist/electron/modules/active-window.js.map +0 -1
  119. package/dist/electron/modules/api-server.d.ts +0 -11
  120. package/dist/electron/modules/api-server.d.ts.map +0 -1
  121. package/dist/electron/modules/api-server.js +0 -2759
  122. package/dist/electron/modules/api-server.js.map +0 -1
  123. package/dist/electron/modules/auth.d.ts +0 -42
  124. package/dist/electron/modules/auth.d.ts.map +0 -1
  125. package/dist/electron/modules/auth.js +0 -193
  126. package/dist/electron/modules/auth.js.map +0 -1
  127. package/dist/electron/modules/azure-speech-realtime.d.ts +0 -48
  128. package/dist/electron/modules/azure-speech-realtime.d.ts.map +0 -1
  129. package/dist/electron/modules/azure-speech-realtime.js +0 -543
  130. package/dist/electron/modules/azure-speech-realtime.js.map +0 -1
  131. package/dist/electron/modules/capture-modes.d.ts +0 -19
  132. package/dist/electron/modules/capture-modes.d.ts.map +0 -1
  133. package/dist/electron/modules/capture-modes.js +0 -100
  134. package/dist/electron/modules/capture-modes.js.map +0 -1
  135. package/dist/electron/modules/capture.d.ts +0 -24
  136. package/dist/electron/modules/capture.d.ts.map +0 -1
  137. package/dist/electron/modules/capture.js +0 -191
  138. package/dist/electron/modules/capture.js.map +0 -1
  139. package/dist/electron/modules/clipboard.d.ts +0 -6
  140. package/dist/electron/modules/clipboard.d.ts.map +0 -1
  141. package/dist/electron/modules/clipboard.js +0 -26
  142. package/dist/electron/modules/clipboard.js.map +0 -1
  143. package/dist/electron/modules/color-picker.d.ts +0 -4
  144. package/dist/electron/modules/color-picker.d.ts.map +0 -1
  145. package/dist/electron/modules/color-picker.js +0 -233
  146. package/dist/electron/modules/color-picker.js.map +0 -1
  147. package/dist/electron/modules/compose-screenshots.d.ts +0 -8
  148. package/dist/electron/modules/compose-screenshots.d.ts.map +0 -1
  149. package/dist/electron/modules/compose-screenshots.js +0 -86
  150. package/dist/electron/modules/compose-screenshots.js.map +0 -1
  151. package/dist/electron/modules/context-menu-detect.d.ts +0 -47
  152. package/dist/electron/modules/context-menu-detect.d.ts.map +0 -1
  153. package/dist/electron/modules/context-menu-detect.js +0 -272
  154. package/dist/electron/modules/context-menu-detect.js.map +0 -1
  155. package/dist/electron/modules/dictation.d.ts +0 -27
  156. package/dist/electron/modules/dictation.d.ts.map +0 -1
  157. package/dist/electron/modules/dictation.js +0 -1231
  158. package/dist/electron/modules/dictation.js.map +0 -1
  159. package/dist/electron/modules/error-reporter.d.ts +0 -7
  160. package/dist/electron/modules/error-reporter.d.ts.map +0 -1
  161. package/dist/electron/modules/error-reporter.js +0 -65
  162. package/dist/electron/modules/error-reporter.js.map +0 -1
  163. package/dist/electron/modules/gif-util.d.ts +0 -9
  164. package/dist/electron/modules/gif-util.d.ts.map +0 -1
  165. package/dist/electron/modules/gif-util.js +0 -63
  166. package/dist/electron/modules/gif-util.js.map +0 -1
  167. package/dist/electron/modules/gui-automation-errors.d.ts +0 -11
  168. package/dist/electron/modules/gui-automation-errors.d.ts.map +0 -1
  169. package/dist/electron/modules/gui-automation-errors.js +0 -79
  170. package/dist/electron/modules/gui-automation-errors.js.map +0 -1
  171. package/dist/electron/modules/gui-automation-telemetry.d.ts +0 -38
  172. package/dist/electron/modules/gui-automation-telemetry.d.ts.map +0 -1
  173. package/dist/electron/modules/gui-automation-telemetry.js +0 -200
  174. package/dist/electron/modules/gui-automation-telemetry.js.map +0 -1
  175. package/dist/electron/modules/gui-automation.d.ts +0 -1143
  176. package/dist/electron/modules/gui-automation.d.ts.map +0 -1
  177. package/dist/electron/modules/gui-automation.js +0 -8769
  178. package/dist/electron/modules/gui-automation.js.map +0 -1
  179. package/dist/electron/modules/hotkeys.d.ts +0 -5
  180. package/dist/electron/modules/hotkeys.d.ts.map +0 -1
  181. package/dist/electron/modules/hotkeys.js +0 -64
  182. package/dist/electron/modules/hotkeys.js.map +0 -1
  183. package/dist/electron/modules/human-input/index.d.ts +0 -35
  184. package/dist/electron/modules/human-input/index.d.ts.map +0 -1
  185. package/dist/electron/modules/human-input/index.js +0 -163
  186. package/dist/electron/modules/human-input/index.js.map +0 -1
  187. package/dist/electron/modules/human-input/keyboard/timing.d.ts +0 -38
  188. package/dist/electron/modules/human-input/keyboard/timing.d.ts.map +0 -1
  189. package/dist/electron/modules/human-input/keyboard/timing.js +0 -57
  190. package/dist/electron/modules/human-input/keyboard/timing.js.map +0 -1
  191. package/dist/electron/modules/human-input/mouse/path.d.ts +0 -24
  192. package/dist/electron/modules/human-input/mouse/path.d.ts.map +0 -1
  193. package/dist/electron/modules/human-input/mouse/path.js +0 -80
  194. package/dist/electron/modules/human-input/mouse/path.js.map +0 -1
  195. package/dist/electron/modules/human-input/mouse/velocity.d.ts +0 -48
  196. package/dist/electron/modules/human-input/mouse/velocity.d.ts.map +0 -1
  197. package/dist/electron/modules/human-input/mouse/velocity.js +0 -93
  198. package/dist/electron/modules/human-input/mouse/velocity.js.map +0 -1
  199. package/dist/electron/modules/human-input/profiles.d.ts +0 -90
  200. package/dist/electron/modules/human-input/profiles.d.ts.map +0 -1
  201. package/dist/electron/modules/human-input/profiles.js +0 -124
  202. package/dist/electron/modules/human-input/profiles.js.map +0 -1
  203. package/dist/electron/modules/human-input/rng.d.ts +0 -16
  204. package/dist/electron/modules/human-input/rng.d.ts.map +0 -1
  205. package/dist/electron/modules/human-input/rng.js +0 -101
  206. package/dist/electron/modules/human-input/rng.js.map +0 -1
  207. package/dist/electron/modules/human-input/salt.d.ts +0 -15
  208. package/dist/electron/modules/human-input/salt.d.ts.map +0 -1
  209. package/dist/electron/modules/human-input/salt.js +0 -48
  210. package/dist/electron/modules/human-input/salt.js.map +0 -1
  211. package/dist/electron/modules/image-utils.d.ts +0 -20
  212. package/dist/electron/modules/image-utils.d.ts.map +0 -1
  213. package/dist/electron/modules/image-utils.js +0 -80
  214. package/dist/electron/modules/image-utils.js.map +0 -1
  215. package/dist/electron/modules/keystroke.d.ts +0 -7
  216. package/dist/electron/modules/keystroke.d.ts.map +0 -1
  217. package/dist/electron/modules/keystroke.js +0 -53
  218. package/dist/electron/modules/keystroke.js.map +0 -1
  219. package/dist/electron/modules/license.d.ts +0 -25
  220. package/dist/electron/modules/license.d.ts.map +0 -1
  221. package/dist/electron/modules/license.js +0 -175
  222. package/dist/electron/modules/license.js.map +0 -1
  223. package/dist/electron/modules/mcp-config.d.ts +0 -16
  224. package/dist/electron/modules/mcp-config.d.ts.map +0 -1
  225. package/dist/electron/modules/mcp-config.js +0 -146
  226. package/dist/electron/modules/mcp-config.js.map +0 -1
  227. package/dist/electron/modules/ocr.d.ts +0 -3
  228. package/dist/electron/modules/ocr.d.ts.map +0 -1
  229. package/dist/electron/modules/ocr.js +0 -188
  230. package/dist/electron/modules/ocr.js.map +0 -1
  231. package/dist/electron/modules/ollama/capability.d.ts +0 -32
  232. package/dist/electron/modules/ollama/capability.d.ts.map +0 -1
  233. package/dist/electron/modules/ollama/capability.js +0 -117
  234. package/dist/electron/modules/ollama/capability.js.map +0 -1
  235. package/dist/electron/modules/ollama/client.d.ts +0 -14
  236. package/dist/electron/modules/ollama/client.d.ts.map +0 -1
  237. package/dist/electron/modules/ollama/client.js +0 -134
  238. package/dist/electron/modules/ollama/client.js.map +0 -1
  239. package/dist/electron/modules/ollama/detector.d.ts +0 -29
  240. package/dist/electron/modules/ollama/detector.d.ts.map +0 -1
  241. package/dist/electron/modules/ollama/detector.js +0 -177
  242. package/dist/electron/modules/ollama/detector.js.map +0 -1
  243. package/dist/electron/modules/ollama/dispatcher.d.ts +0 -36
  244. package/dist/electron/modules/ollama/dispatcher.d.ts.map +0 -1
  245. package/dist/electron/modules/ollama/dispatcher.js +0 -97
  246. package/dist/electron/modules/ollama/dispatcher.js.map +0 -1
  247. package/dist/electron/modules/ollama/router.d.ts +0 -51
  248. package/dist/electron/modules/ollama/router.d.ts.map +0 -1
  249. package/dist/electron/modules/ollama/router.js +0 -201
  250. package/dist/electron/modules/ollama/router.js.map +0 -1
  251. package/dist/electron/modules/pin-window.d.ts +0 -3
  252. package/dist/electron/modules/pin-window.d.ts.map +0 -1
  253. package/dist/electron/modules/pin-window.js +0 -64
  254. package/dist/electron/modules/pin-window.js.map +0 -1
  255. package/dist/electron/modules/platform/dpi.d.ts +0 -2
  256. package/dist/electron/modules/platform/dpi.d.ts.map +0 -1
  257. package/dist/electron/modules/platform/dpi.js +0 -48
  258. package/dist/electron/modules/platform/dpi.js.map +0 -1
  259. package/dist/electron/modules/platform/errors.d.ts +0 -13
  260. package/dist/electron/modules/platform/errors.d.ts.map +0 -1
  261. package/dist/electron/modules/platform/errors.js +0 -36
  262. package/dist/electron/modules/platform/errors.js.map +0 -1
  263. package/dist/electron/modules/platform/index.d.ts +0 -24
  264. package/dist/electron/modules/platform/index.d.ts.map +0 -1
  265. package/dist/electron/modules/platform/index.js +0 -133
  266. package/dist/electron/modules/platform/index.js.map +0 -1
  267. package/dist/electron/modules/platform/interfaces.d.ts +0 -140
  268. package/dist/electron/modules/platform/interfaces.d.ts.map +0 -1
  269. package/dist/electron/modules/platform/interfaces.js +0 -14
  270. package/dist/electron/modules/platform/interfaces.js.map +0 -1
  271. package/dist/electron/modules/platform/macos/ax.d.ts +0 -15
  272. package/dist/electron/modules/platform/macos/ax.d.ts.map +0 -1
  273. package/dist/electron/modules/platform/macos/ax.js +0 -222
  274. package/dist/electron/modules/platform/macos/ax.js.map +0 -1
  275. package/dist/electron/modules/platform/macos/capture.d.ts +0 -14
  276. package/dist/electron/modules/platform/macos/capture.d.ts.map +0 -1
  277. package/dist/electron/modules/platform/macos/capture.js +0 -106
  278. package/dist/electron/modules/platform/macos/capture.js.map +0 -1
  279. package/dist/electron/modules/platform/macos/input.d.ts +0 -16
  280. package/dist/electron/modules/platform/macos/input.d.ts.map +0 -1
  281. package/dist/electron/modules/platform/macos/input.js +0 -342
  282. package/dist/electron/modules/platform/macos/input.js.map +0 -1
  283. package/dist/electron/modules/platform/macos/launch.d.ts +0 -10
  284. package/dist/electron/modules/platform/macos/launch.d.ts.map +0 -1
  285. package/dist/electron/modules/platform/macos/launch.js +0 -114
  286. package/dist/electron/modules/platform/macos/launch.js.map +0 -1
  287. package/dist/electron/modules/platform/macos/session.d.ts +0 -8
  288. package/dist/electron/modules/platform/macos/session.d.ts.map +0 -1
  289. package/dist/electron/modules/platform/macos/session.js +0 -17
  290. package/dist/electron/modules/platform/macos/session.js.map +0 -1
  291. package/dist/electron/modules/platform/macos/window.d.ts +0 -31
  292. package/dist/electron/modules/platform/macos/window.d.ts.map +0 -1
  293. package/dist/electron/modules/platform/macos/window.js +0 -271
  294. package/dist/electron/modules/platform/macos/window.js.map +0 -1
  295. package/dist/electron/modules/platform/shared.d.ts +0 -10
  296. package/dist/electron/modules/platform/shared.d.ts.map +0 -1
  297. package/dist/electron/modules/platform/shared.js +0 -201
  298. package/dist/electron/modules/platform/shared.js.map +0 -1
  299. package/dist/electron/modules/platform/types.d.ts +0 -182
  300. package/dist/electron/modules/platform/types.d.ts.map +0 -1
  301. package/dist/electron/modules/platform/types.js +0 -24
  302. package/dist/electron/modules/platform/types.js.map +0 -1
  303. package/dist/electron/modules/platform/windows/ax.d.ts +0 -15
  304. package/dist/electron/modules/platform/windows/ax.d.ts.map +0 -1
  305. package/dist/electron/modules/platform/windows/ax.js +0 -277
  306. package/dist/electron/modules/platform/windows/ax.js.map +0 -1
  307. package/dist/electron/modules/platform/windows/capture.d.ts +0 -14
  308. package/dist/electron/modules/platform/windows/capture.d.ts.map +0 -1
  309. package/dist/electron/modules/platform/windows/capture.js +0 -115
  310. package/dist/electron/modules/platform/windows/capture.js.map +0 -1
  311. package/dist/electron/modules/platform/windows/input.d.ts +0 -17
  312. package/dist/electron/modules/platform/windows/input.d.ts.map +0 -1
  313. package/dist/electron/modules/platform/windows/input.js +0 -422
  314. package/dist/electron/modules/platform/windows/input.js.map +0 -1
  315. package/dist/electron/modules/platform/windows/launch.d.ts +0 -10
  316. package/dist/electron/modules/platform/windows/launch.d.ts.map +0 -1
  317. package/dist/electron/modules/platform/windows/launch.js +0 -185
  318. package/dist/electron/modules/platform/windows/launch.js.map +0 -1
  319. package/dist/electron/modules/platform/windows/session.d.ts +0 -8
  320. package/dist/electron/modules/platform/windows/session.d.ts.map +0 -1
  321. package/dist/electron/modules/platform/windows/session.js +0 -87
  322. package/dist/electron/modules/platform/windows/session.js.map +0 -1
  323. package/dist/electron/modules/platform/windows/tray.d.ts +0 -13
  324. package/dist/electron/modules/platform/windows/tray.d.ts.map +0 -1
  325. package/dist/electron/modules/platform/windows/tray.js +0 -390
  326. package/dist/electron/modules/platform/windows/tray.js.map +0 -1
  327. package/dist/electron/modules/platform/windows/window.d.ts +0 -30
  328. package/dist/electron/modules/platform/windows/window.d.ts.map +0 -1
  329. package/dist/electron/modules/platform/windows/window.js +0 -444
  330. package/dist/electron/modules/platform/windows/window.js.map +0 -1
  331. package/dist/electron/modules/recording/ai-analysis.d.ts +0 -8
  332. package/dist/electron/modules/recording/ai-analysis.d.ts.map +0 -1
  333. package/dist/electron/modules/recording/ai-analysis.js +0 -88
  334. package/dist/electron/modules/recording/ai-analysis.js.map +0 -1
  335. package/dist/electron/modules/recording/capture-queue.d.ts +0 -48
  336. package/dist/electron/modules/recording/capture-queue.d.ts.map +0 -1
  337. package/dist/electron/modules/recording/capture-queue.js +0 -409
  338. package/dist/electron/modules/recording/capture-queue.js.map +0 -1
  339. package/dist/electron/modules/recording/cli.d.ts +0 -13
  340. package/dist/electron/modules/recording/cli.d.ts.map +0 -1
  341. package/dist/electron/modules/recording/cli.js +0 -135
  342. package/dist/electron/modules/recording/cli.js.map +0 -1
  343. package/dist/electron/modules/recording/http-api.d.ts +0 -3
  344. package/dist/electron/modules/recording/http-api.d.ts.map +0 -1
  345. package/dist/electron/modules/recording/http-api.js +0 -236
  346. package/dist/electron/modules/recording/http-api.js.map +0 -1
  347. package/dist/electron/modules/recording/index.d.ts +0 -15
  348. package/dist/electron/modules/recording/index.d.ts.map +0 -1
  349. package/dist/electron/modules/recording/index.js +0 -154
  350. package/dist/electron/modules/recording/index.js.map +0 -1
  351. package/dist/electron/modules/recording/input-hook-provider.d.ts +0 -15
  352. package/dist/electron/modules/recording/input-hook-provider.d.ts.map +0 -1
  353. package/dist/electron/modules/recording/input-hook-provider.js +0 -5
  354. package/dist/electron/modules/recording/input-hook-provider.js.map +0 -1
  355. package/dist/electron/modules/recording/mcp-tool.d.ts +0 -13
  356. package/dist/electron/modules/recording/mcp-tool.d.ts.map +0 -1
  357. package/dist/electron/modules/recording/mcp-tool.js +0 -81
  358. package/dist/electron/modules/recording/mcp-tool.js.map +0 -1
  359. package/dist/electron/modules/recording/monitor-analyzer.d.ts +0 -40
  360. package/dist/electron/modules/recording/monitor-analyzer.d.ts.map +0 -1
  361. package/dist/electron/modules/recording/monitor-analyzer.js +0 -220
  362. package/dist/electron/modules/recording/monitor-analyzer.js.map +0 -1
  363. package/dist/electron/modules/recording/providers/change-detect-provider.d.ts +0 -28
  364. package/dist/electron/modules/recording/providers/change-detect-provider.d.ts.map +0 -1
  365. package/dist/electron/modules/recording/providers/change-detect-provider.js +0 -181
  366. package/dist/electron/modules/recording/providers/change-detect-provider.js.map +0 -1
  367. package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.d.ts +0 -15
  368. package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.d.ts.map +0 -1
  369. package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.js +0 -62
  370. package/dist/electron/modules/recording/providers/change-detect-shared-wrapper.js.map +0 -1
  371. package/dist/electron/modules/recording/providers/periodic-provider.d.ts +0 -15
  372. package/dist/electron/modules/recording/providers/periodic-provider.d.ts.map +0 -1
  373. package/dist/electron/modules/recording/providers/periodic-provider.js +0 -55
  374. package/dist/electron/modules/recording/providers/periodic-provider.js.map +0 -1
  375. package/dist/electron/modules/recording/providers/provider-factory.d.ts +0 -15
  376. package/dist/electron/modules/recording/providers/provider-factory.d.ts.map +0 -1
  377. package/dist/electron/modules/recording/providers/provider-factory.js +0 -97
  378. package/dist/electron/modules/recording/providers/provider-factory.js.map +0 -1
  379. package/dist/electron/modules/recording/providers/uiohook-provider.d.ts +0 -19
  380. package/dist/electron/modules/recording/providers/uiohook-provider.d.ts.map +0 -1
  381. package/dist/electron/modules/recording/providers/uiohook-provider.js +0 -267
  382. package/dist/electron/modules/recording/providers/uiohook-provider.js.map +0 -1
  383. package/dist/electron/modules/recording/recording-session.d.ts +0 -29
  384. package/dist/electron/modules/recording/recording-session.d.ts.map +0 -1
  385. package/dist/electron/modules/recording/recording-session.js +0 -389
  386. package/dist/electron/modules/recording/recording-session.js.map +0 -1
  387. package/dist/electron/modules/recording/session-alignment.d.ts +0 -32
  388. package/dist/electron/modules/recording/session-alignment.d.ts.map +0 -1
  389. package/dist/electron/modules/recording/session-alignment.js +0 -103
  390. package/dist/electron/modules/recording/session-alignment.js.map +0 -1
  391. package/dist/electron/modules/recording/session-export.d.ts +0 -2
  392. package/dist/electron/modules/recording/session-export.d.ts.map +0 -1
  393. package/dist/electron/modules/recording/session-export.js +0 -287
  394. package/dist/electron/modules/recording/session-export.js.map +0 -1
  395. package/dist/electron/modules/recording/trigger-engine.d.ts +0 -62
  396. package/dist/electron/modules/recording/trigger-engine.d.ts.map +0 -1
  397. package/dist/electron/modules/recording/trigger-engine.js +0 -553
  398. package/dist/electron/modules/recording/trigger-engine.js.map +0 -1
  399. package/dist/electron/modules/recording/visual-diff.d.ts +0 -17
  400. package/dist/electron/modules/recording/visual-diff.d.ts.map +0 -1
  401. package/dist/electron/modules/recording/visual-diff.js +0 -109
  402. package/dist/electron/modules/recording/visual-diff.js.map +0 -1
  403. package/dist/electron/modules/redact.d.ts +0 -34
  404. package/dist/electron/modules/redact.d.ts.map +0 -1
  405. package/dist/electron/modules/redact.js +0 -583
  406. package/dist/electron/modules/redact.js.map +0 -1
  407. package/dist/electron/modules/scroll-calibration.d.ts +0 -152
  408. package/dist/electron/modules/scroll-calibration.d.ts.map +0 -1
  409. package/dist/electron/modules/scroll-calibration.js +0 -271
  410. package/dist/electron/modules/scroll-calibration.js.map +0 -1
  411. package/dist/electron/modules/scroll-capture.d.ts +0 -21
  412. package/dist/electron/modules/scroll-capture.d.ts.map +0 -1
  413. package/dist/electron/modules/scroll-capture.js +0 -134
  414. package/dist/electron/modules/scroll-capture.js.map +0 -1
  415. package/dist/electron/modules/sequence-locate.d.ts +0 -126
  416. package/dist/electron/modules/sequence-locate.d.ts.map +0 -1
  417. package/dist/electron/modules/sequence-locate.js +0 -356
  418. package/dist/electron/modules/sequence-locate.js.map +0 -1
  419. package/dist/electron/modules/store.d.ts +0 -18
  420. package/dist/electron/modules/store.d.ts.map +0 -1
  421. package/dist/electron/modules/store.js +0 -126
  422. package/dist/electron/modules/store.js.map +0 -1
  423. package/dist/electron/modules/stt/capability-probe.d.ts +0 -67
  424. package/dist/electron/modules/stt/capability-probe.d.ts.map +0 -1
  425. package/dist/electron/modules/stt/capability-probe.js +0 -331
  426. package/dist/electron/modules/stt/capability-probe.js.map +0 -1
  427. package/dist/electron/modules/stt/macos-engine.d.ts +0 -20
  428. package/dist/electron/modules/stt/macos-engine.d.ts.map +0 -1
  429. package/dist/electron/modules/stt/macos-engine.js +0 -259
  430. package/dist/electron/modules/stt/macos-engine.js.map +0 -1
  431. package/dist/electron/modules/stt/model-manager.d.ts +0 -87
  432. package/dist/electron/modules/stt/model-manager.d.ts.map +0 -1
  433. package/dist/electron/modules/stt/model-manager.js +0 -321
  434. package/dist/electron/modules/stt/model-manager.js.map +0 -1
  435. package/dist/electron/modules/stt/router.d.ts +0 -35
  436. package/dist/electron/modules/stt/router.d.ts.map +0 -1
  437. package/dist/electron/modules/stt/router.js +0 -263
  438. package/dist/electron/modules/stt/router.js.map +0 -1
  439. package/dist/electron/modules/stt/sherpa-engine.d.ts +0 -43
  440. package/dist/electron/modules/stt/sherpa-engine.d.ts.map +0 -1
  441. package/dist/electron/modules/stt/sherpa-engine.js +0 -521
  442. package/dist/electron/modules/stt/sherpa-engine.js.map +0 -1
  443. package/dist/electron/modules/stt/types.d.ts +0 -72
  444. package/dist/electron/modules/stt/types.d.ts.map +0 -1
  445. package/dist/electron/modules/stt/types.js +0 -16
  446. package/dist/electron/modules/stt/types.js.map +0 -1
  447. package/dist/electron/modules/stt/winrt-engine.d.ts +0 -20
  448. package/dist/electron/modules/stt/winrt-engine.d.ts.map +0 -1
  449. package/dist/electron/modules/stt/winrt-engine.js +0 -238
  450. package/dist/electron/modules/stt/winrt-engine.js.map +0 -1
  451. package/dist/electron/modules/tce/content-analyzer.d.ts +0 -20
  452. package/dist/electron/modules/tce/content-analyzer.d.ts.map +0 -1
  453. package/dist/electron/modules/tce/content-analyzer.js +0 -123
  454. package/dist/electron/modules/tce/content-analyzer.js.map +0 -1
  455. package/dist/electron/modules/tce/index.d.ts +0 -54
  456. package/dist/electron/modules/tce/index.d.ts.map +0 -1
  457. package/dist/electron/modules/tce/index.js +0 -174
  458. package/dist/electron/modules/tce/index.js.map +0 -1
  459. package/dist/electron/modules/tce/layout-engine.d.ts +0 -68
  460. package/dist/electron/modules/tce/layout-engine.d.ts.map +0 -1
  461. package/dist/electron/modules/tce/layout-engine.js +0 -313
  462. package/dist/electron/modules/tce/layout-engine.js.map +0 -1
  463. package/dist/electron/modules/tce/renderer.d.ts +0 -16
  464. package/dist/electron/modules/tce/renderer.d.ts.map +0 -1
  465. package/dist/electron/modules/tce/renderer.js +0 -196
  466. package/dist/electron/modules/tce/renderer.js.map +0 -1
  467. package/dist/electron/modules/tce/themes.d.ts +0 -14
  468. package/dist/electron/modules/tce/themes.d.ts.map +0 -1
  469. package/dist/electron/modules/tce/themes.js +0 -68
  470. package/dist/electron/modules/tce/themes.js.map +0 -1
  471. package/dist/electron/modules/tce/token-estimator.d.ts +0 -30
  472. package/dist/electron/modules/tce/token-estimator.d.ts.map +0 -1
  473. package/dist/electron/modules/tce/token-estimator.js +0 -59
  474. package/dist/electron/modules/tce/token-estimator.js.map +0 -1
  475. package/dist/electron/modules/telemetry.d.ts +0 -44
  476. package/dist/electron/modules/telemetry.d.ts.map +0 -1
  477. package/dist/electron/modules/telemetry.js +0 -316
  478. package/dist/electron/modules/telemetry.js.map +0 -1
  479. package/dist/electron/modules/template-match.d.ts +0 -62
  480. package/dist/electron/modules/template-match.d.ts.map +0 -1
  481. package/dist/electron/modules/template-match.js +0 -205
  482. package/dist/electron/modules/template-match.js.map +0 -1
  483. package/dist/electron/modules/tray.d.ts +0 -24
  484. package/dist/electron/modules/tray.d.ts.map +0 -1
  485. package/dist/electron/modules/tray.js +0 -349
  486. package/dist/electron/modules/tray.js.map +0 -1
  487. package/dist/electron/modules/uiohook-manager.d.ts +0 -19
  488. package/dist/electron/modules/uiohook-manager.d.ts.map +0 -1
  489. package/dist/electron/modules/uiohook-manager.js +0 -101
  490. package/dist/electron/modules/uiohook-manager.js.map +0 -1
  491. package/dist/electron/modules/undo-stack.d.ts +0 -22
  492. package/dist/electron/modules/undo-stack.d.ts.map +0 -1
  493. package/dist/electron/modules/undo-stack.js +0 -41
  494. package/dist/electron/modules/undo-stack.js.map +0 -1
  495. package/dist/electron/modules/updater.d.ts +0 -14
  496. package/dist/electron/modules/updater.d.ts.map +0 -1
  497. package/dist/electron/modules/updater.js +0 -102
  498. package/dist/electron/modules/updater.js.map +0 -1
  499. package/dist/electron/modules/usage-link.d.ts +0 -7
  500. package/dist/electron/modules/usage-link.d.ts.map +0 -1
  501. package/dist/electron/modules/usage-link.js +0 -63
  502. package/dist/electron/modules/usage-link.js.map +0 -1
  503. package/dist/electron/modules/version-check.d.ts +0 -3
  504. package/dist/electron/modules/version-check.d.ts.map +0 -1
  505. package/dist/electron/modules/version-check.js +0 -76
  506. package/dist/electron/modules/version-check.js.map +0 -1
  507. package/dist/electron/modules/watchers/active-window-watcher.d.ts +0 -5
  508. package/dist/electron/modules/watchers/active-window-watcher.d.ts.map +0 -1
  509. package/dist/electron/modules/watchers/active-window-watcher.js +0 -152
  510. package/dist/electron/modules/watchers/active-window-watcher.js.map +0 -1
  511. package/dist/electron/modules/watchers/clipboard-watcher.d.ts +0 -5
  512. package/dist/electron/modules/watchers/clipboard-watcher.d.ts.map +0 -1
  513. package/dist/electron/modules/watchers/clipboard-watcher.js +0 -90
  514. package/dist/electron/modules/watchers/clipboard-watcher.js.map +0 -1
  515. package/dist/electron/modules/watchers/file-watcher.d.ts +0 -5
  516. package/dist/electron/modules/watchers/file-watcher.d.ts.map +0 -1
  517. package/dist/electron/modules/watchers/file-watcher.js +0 -91
  518. package/dist/electron/modules/watchers/file-watcher.js.map +0 -1
  519. package/dist/electron/modules/watchers/registry.d.ts +0 -34
  520. package/dist/electron/modules/watchers/registry.d.ts.map +0 -1
  521. package/dist/electron/modules/watchers/registry.js +0 -108
  522. package/dist/electron/modules/watchers/registry.js.map +0 -1
  523. package/dist/electron/modules/watchers/screen-region-service.d.ts +0 -18
  524. package/dist/electron/modules/watchers/screen-region-service.d.ts.map +0 -1
  525. package/dist/electron/modules/watchers/screen-region-service.js +0 -126
  526. package/dist/electron/modules/watchers/screen-region-service.js.map +0 -1
  527. package/dist/electron/modules/watchers/screen-region-watcher.d.ts +0 -6
  528. package/dist/electron/modules/watchers/screen-region-watcher.d.ts.map +0 -1
  529. package/dist/electron/modules/watchers/screen-region-watcher.js +0 -70
  530. package/dist/electron/modules/watchers/screen-region-watcher.js.map +0 -1
  531. package/dist/electron/modules/window-activate.d.ts +0 -103
  532. package/dist/electron/modules/window-activate.d.ts.map +0 -1
  533. package/dist/electron/modules/window-activate.js +0 -630
  534. package/dist/electron/modules/window-activate.js.map +0 -1
  535. package/dist/electron/modules/window-input.d.ts +0 -43
  536. package/dist/electron/modules/window-input.d.ts.map +0 -1
  537. package/dist/electron/modules/window-input.js +0 -623
  538. package/dist/electron/modules/window-input.js.map +0 -1
  539. package/dist/electron/modules/window-picker.d.ts +0 -6
  540. package/dist/electron/modules/window-picker.d.ts.map +0 -1
  541. package/dist/electron/modules/window-picker.js +0 -192
  542. package/dist/electron/modules/window-picker.js.map +0 -1
  543. package/dist/electron/modules/window-resolver.d.ts +0 -35
  544. package/dist/electron/modules/window-resolver.d.ts.map +0 -1
  545. package/dist/electron/modules/window-resolver.js +0 -210
  546. package/dist/electron/modules/window-resolver.js.map +0 -1
  547. package/dist/headless/electron/ai/ai-client.js +0 -204
  548. package/dist/headless/electron/ai/context-builder.js +0 -27
  549. package/dist/headless/electron/ai/instruction-parser.js +0 -46
  550. package/dist/headless/electron/core/auth-store.js +0 -85
  551. package/dist/headless/electron/core/config.js +0 -80
  552. package/dist/headless/electron/core/file-logger.js +0 -73
  553. package/dist/headless/electron/core/input-injection/index.js +0 -30
  554. package/dist/headless/electron/core/input-injection/macos.js +0 -13
  555. package/dist/headless/electron/core/input-injection/windows.js +0 -118
  556. package/dist/headless/electron/core/json-store.js +0 -131
  557. package/dist/headless/electron/core/paths.js +0 -116
  558. package/dist/headless/electron/core/platform.js +0 -17
  559. package/dist/headless/electron/core/process-coord.js +0 -123
  560. package/dist/headless/electron/core/serialize-schema.js +0 -88
  561. package/dist/headless/electron/core/settings-schema.js +0 -1369
  562. package/dist/headless/electron/db/database.js +0 -636
  563. package/dist/headless/electron/db/models.js +0 -3
  564. package/dist/headless/electron/logger.js +0 -31
  565. package/dist/headless/electron/modules/accessibility/macos-provider.js +0 -93
  566. package/dist/headless/electron/modules/accessibility/provider.js +0 -51
  567. package/dist/headless/electron/modules/accessibility/types.js +0 -5
  568. package/dist/headless/electron/modules/accessibility/windows-provider.js +0 -84
  569. package/dist/headless/electron/modules/active-window.js +0 -75
  570. package/dist/headless/electron/modules/api-server.js +0 -2758
  571. package/dist/headless/electron/modules/auth.js +0 -192
  572. package/dist/headless/electron/modules/azure-speech-realtime.js +0 -542
  573. package/dist/headless/electron/modules/capture.js +0 -190
  574. package/dist/headless/electron/modules/clipboard.js +0 -25
  575. package/dist/headless/electron/modules/context-menu-detect.js +0 -271
  576. package/dist/headless/electron/modules/dictation.js +0 -1230
  577. package/dist/headless/electron/modules/gui-automation-errors.js +0 -78
  578. package/dist/headless/electron/modules/gui-automation-telemetry.js +0 -199
  579. package/dist/headless/electron/modules/gui-automation.js +0 -8768
  580. package/dist/headless/electron/modules/human-input/keyboard/timing.js +0 -56
  581. package/dist/headless/electron/modules/human-input/mouse/path.js +0 -79
  582. package/dist/headless/electron/modules/human-input/mouse/velocity.js +0 -92
  583. package/dist/headless/electron/modules/human-input/profiles.js +0 -123
  584. package/dist/headless/electron/modules/human-input/rng.js +0 -100
  585. package/dist/headless/electron/modules/human-input/salt.js +0 -47
  586. package/dist/headless/electron/modules/image-utils.js +0 -79
  587. package/dist/headless/electron/modules/keystroke.js +0 -52
  588. package/dist/headless/electron/modules/license.js +0 -174
  589. package/dist/headless/electron/modules/mcp-config.js +0 -145
  590. package/dist/headless/electron/modules/ocr.js +0 -187
  591. package/dist/headless/electron/modules/ollama/capability.js +0 -116
  592. package/dist/headless/electron/modules/ollama/client.js +0 -133
  593. package/dist/headless/electron/modules/ollama/detector.js +0 -176
  594. package/dist/headless/electron/modules/ollama/dispatcher.js +0 -96
  595. package/dist/headless/electron/modules/ollama/router.js +0 -200
  596. package/dist/headless/electron/modules/platform/dpi.js +0 -47
  597. package/dist/headless/electron/modules/platform/errors.js +0 -35
  598. package/dist/headless/electron/modules/platform/index.js +0 -132
  599. package/dist/headless/electron/modules/platform/interfaces.js +0 -13
  600. package/dist/headless/electron/modules/platform/macos/ax.js +0 -221
  601. package/dist/headless/electron/modules/platform/macos/capture.js +0 -105
  602. package/dist/headless/electron/modules/platform/macos/input.js +0 -341
  603. package/dist/headless/electron/modules/platform/macos/launch.js +0 -113
  604. package/dist/headless/electron/modules/platform/macos/session.js +0 -16
  605. package/dist/headless/electron/modules/platform/macos/window.js +0 -270
  606. package/dist/headless/electron/modules/platform/shared.js +0 -200
  607. package/dist/headless/electron/modules/platform/types.js +0 -23
  608. package/dist/headless/electron/modules/platform/windows/ax.js +0 -276
  609. package/dist/headless/electron/modules/platform/windows/capture.js +0 -114
  610. package/dist/headless/electron/modules/platform/windows/input.js +0 -421
  611. package/dist/headless/electron/modules/platform/windows/launch.js +0 -184
  612. package/dist/headless/electron/modules/platform/windows/session.js +0 -86
  613. package/dist/headless/electron/modules/platform/windows/tray.js +0 -389
  614. package/dist/headless/electron/modules/platform/windows/window.js +0 -443
  615. package/dist/headless/electron/modules/recording/ai-analysis.js +0 -87
  616. package/dist/headless/electron/modules/recording/capture-queue.js +0 -408
  617. package/dist/headless/electron/modules/recording/cli.js +0 -134
  618. package/dist/headless/electron/modules/recording/http-api.js +0 -235
  619. package/dist/headless/electron/modules/recording/index.js +0 -153
  620. package/dist/headless/electron/modules/recording/input-hook-provider.js +0 -4
  621. package/dist/headless/electron/modules/recording/mcp-tool.js +0 -80
  622. package/dist/headless/electron/modules/recording/monitor-analyzer.js +0 -219
  623. package/dist/headless/electron/modules/recording/providers/change-detect-provider.js +0 -180
  624. package/dist/headless/electron/modules/recording/providers/change-detect-shared-wrapper.js +0 -61
  625. package/dist/headless/electron/modules/recording/providers/periodic-provider.js +0 -54
  626. package/dist/headless/electron/modules/recording/providers/provider-factory.js +0 -96
  627. package/dist/headless/electron/modules/recording/providers/uiohook-provider.js +0 -266
  628. package/dist/headless/electron/modules/recording/recording-session.js +0 -388
  629. package/dist/headless/electron/modules/recording/session-alignment.js +0 -102
  630. package/dist/headless/electron/modules/recording/session-export.js +0 -286
  631. package/dist/headless/electron/modules/recording/trigger-engine.js +0 -552
  632. package/dist/headless/electron/modules/recording/visual-diff.js +0 -108
  633. package/dist/headless/electron/modules/redact.js +0 -582
  634. package/dist/headless/electron/modules/scroll-calibration.js +0 -270
  635. package/dist/headless/electron/modules/sequence-locate.js +0 -355
  636. package/dist/headless/electron/modules/store.js +0 -125
  637. package/dist/headless/electron/modules/stt/capability-probe.js +0 -330
  638. package/dist/headless/electron/modules/stt/macos-engine.js +0 -258
  639. package/dist/headless/electron/modules/stt/model-manager.js +0 -320
  640. package/dist/headless/electron/modules/stt/router.js +0 -262
  641. package/dist/headless/electron/modules/stt/sherpa-engine.js +0 -520
  642. package/dist/headless/electron/modules/stt/types.js +0 -15
  643. package/dist/headless/electron/modules/stt/winrt-engine.js +0 -237
  644. package/dist/headless/electron/modules/tce/content-analyzer.js +0 -122
  645. package/dist/headless/electron/modules/tce/index.js +0 -173
  646. package/dist/headless/electron/modules/tce/layout-engine.js +0 -312
  647. package/dist/headless/electron/modules/tce/renderer.js +0 -195
  648. package/dist/headless/electron/modules/tce/themes.js +0 -67
  649. package/dist/headless/electron/modules/tce/token-estimator.js +0 -58
  650. package/dist/headless/electron/modules/telemetry.js +0 -315
  651. package/dist/headless/electron/modules/template-match.js +0 -204
  652. package/dist/headless/electron/modules/uiohook-manager.js +0 -100
  653. package/dist/headless/electron/modules/undo-stack.js +0 -40
  654. package/dist/headless/electron/modules/watchers/active-window-watcher.js +0 -151
  655. package/dist/headless/electron/modules/watchers/clipboard-watcher.js +0 -89
  656. package/dist/headless/electron/modules/watchers/file-watcher.js +0 -90
  657. package/dist/headless/electron/modules/watchers/registry.js +0 -107
  658. package/dist/headless/electron/modules/watchers/screen-region-service.js +0 -125
  659. package/dist/headless/electron/modules/watchers/screen-region-watcher.js +0 -69
  660. package/dist/headless/electron/modules/window-activate.js +0 -629
  661. package/dist/headless/electron/modules/window-input.js +0 -622
  662. package/dist/headless/electron/modules/window-resolver.js +0 -209
  663. package/dist/headless/headless/capture-hotkey.js +0 -155
  664. package/dist/headless/headless/cli-auth.js +0 -158
  665. package/dist/headless/headless/cli.js +0 -278
  666. package/dist/headless/headless/config-cmd.js +0 -306
  667. package/dist/headless/headless/dictation-hotkey.js +0 -525
  668. package/dist/headless/headless/dictation-overlay.js +0 -218
  669. package/dist/headless/headless/doctor.js +0 -599
  670. package/dist/headless/headless/mic-capture.js +0 -406
  671. package/dist/headless/headless/ollama-cmd.js +0 -211
  672. package/dist/headless/headless/platform-headless.js +0 -233
  673. package/dist/headless/headless/server.js +0 -195
  674. package/dist/headless/headless/stt-cmd.js +0 -213
  675. package/dist/headless/headless/tui/index.mjs +0 -7
  676. package/dist/headless/headless/tui/plain-dump.js +0 -41
  677. package/dist/headless/headless/tui/settings-app.mjs +0 -744
  678. package/dist/headless/headless/tui/setup-wizard.mjs +0 -257
  679. package/dist/headless/headless/tui-bridge.js +0 -80
  680. package/dist/headless/headless/win32-text-injector.js +0 -359
  681. package/dist/headless/mic-capture.d.ts +0 -49
  682. package/dist/headless/mic-capture.d.ts.map +0 -1
  683. package/dist/headless/mic-capture.js +0 -407
  684. package/dist/headless/mic-capture.js.map +0 -1
  685. package/dist/headless/shared/constants.js +0 -65
  686. package/dist/headless/shared/design-tokens.js +0 -189
  687. package/dist/headless/shared/recording-types.js +0 -93
  688. package/dist/headless/shared/types.js +0 -3
  689. package/dist/shared/constants.d.ts +0 -100
  690. package/dist/shared/constants.d.ts.map +0 -1
  691. package/dist/shared/constants.js +0 -66
  692. package/dist/shared/constants.js.map +0 -1
  693. package/dist/shared/design-tokens.d.ts +0 -112
  694. package/dist/shared/design-tokens.d.ts.map +0 -1
  695. package/dist/shared/design-tokens.js +0 -190
  696. package/dist/shared/design-tokens.js.map +0 -1
  697. package/dist/shared/recording-types.d.ts +0 -186
  698. package/dist/shared/recording-types.d.ts.map +0 -1
  699. package/dist/shared/recording-types.js +0 -94
  700. package/dist/shared/recording-types.js.map +0 -1
  701. package/dist/shared/types.d.ts +0 -143
  702. package/dist/shared/types.d.ts.map +0 -1
  703. package/dist/shared/types.js +0 -4
  704. package/dist/shared/types.js.map +0 -1
  705. package/mcp-server/dist/api-client.js +0 -521
  706. package/mcp-server/dist/index.js +0 -2550
  707. package/mcp-server/dist/project-sense.js +0 -161
  708. package/mcp-server/dist/tool-categories.js +0 -161
  709. package/mcp-server/package.json +0 -22
@@ -1,1660 +0,0 @@
1
- ---
2
- name: superbased
3
- description: Use this skill when you need to see, capture, OCR, record, diff, annotate, redact, dictate, compress, or DRIVE the user's actual desktop. Provides 72 MCP tools — eyes (capture / OCR / window targeting incl. minimized / gallery search / clipboard image read / display enumeration / visual template match), ears (voice dictation + cloud transcription), hands (click / type incl. JKC / IME Unicode path / hotkey / scroll / drag incl. waypoint path / hover / pixel_color / resize_window / window_state / launch_app / open_url / virtual_desktop / tray_click / context_menu_select / ax_invoke / form_fill / dialog_handle / find_in_page / tab_management / focus_window / mouse_position / wait / wait_for / OCR-based locator / sequence), and automation meta (dry_run wrapper / replay from audit log / doctor hermetic probe — S7 additions; all write-action tools OFF by default behind a master toggle, per-action + group (safe/write/destructive) toggles, protected-apps blocklist, protected-process geofence (SuperBased self-targeting refused), confirm-flag gate, and NDJSON audit log). Plus recording sessions (smart change-detect / periodic / monitor with AI alerts), visual regression diff, baseline management, frame description / narration, token compression (text → optimized images), and PII / secrets redaction. Cross-platform (Windows / macOS / Linux). Most tools work without an account; cloud AI vision, transcription, and frame narration require sign-in. Backed by a local HTTP API on port 47592 — works alongside the SuperBased desktop app or standalone via the `superbased` npm package.
4
- ---
5
-
6
- # SuperBased — Screen Capture & AI Tools via MCP
7
-
8
- SuperBased gives you eyes on the user's screen. Use it to see what's visible, capture screenshots, analyze UI, extract text, record sessions, monitor for errors, and more — all via MCP tools.
9
-
10
- > Skill metadata: `name: superbased` · 72 MCP tools, 13 resources · install: `npm install -g superbased` · cross-platform · most tools work without an account.
11
-
12
- ## When to Use SuperBased
13
-
14
- **You SHOULD use SuperBased tools when:**
15
- - You need to **see what's on the user's screen** → `superbased_screenshot`
16
- - You need to **list open windows** or find a specific app → `superbased_window_list`
17
- - You need to **capture a specific window** (even if minimized) → `superbased_screenshot` with `target="name"` (NEVER chain `superbased_focus_window` first — the screenshot tool handles focus automatically in one call)
18
- - You need to **read text from the screen** → `superbased_ocr` or `superbased_ai` with `/extract`
19
- - You need to **check what the user is looking at** → `superbased_screenshot` with `resolution=half`
20
- - You need to **verify a UI change** after code edits → `superbased_screenshot`
21
- - You need to **record the screen** over time → `superbased_recording` with `mode=smart`
22
- - You need to **watch the screen for errors** → `superbased_recording` with `mode=monitor`
23
- - You need to **see an image the user copied** → `superbased_clipboard` with `action=readImage`
24
- - You need to **dictate or listen to the user** → `superbased_dictate` with `mic=true`
25
- - You need to **drive the UI** (click, type, hotkey, scroll) → `superbased_locate` then `superbased_click` / `superbased_type` / `superbased_hotkey` / `superbased_scroll` with `processName=` or `hwnd=` on the action tool itself (GUI automation must be enabled — check `superbased_health.capabilities.gui_automation.enabled` first). NEVER chain `superbased_focus_window` before any of these — the per-tool approval click steals focus back to the agent and the action fires on the wrong window.
26
-
27
- **Quick decision guide:**
28
- | I need to... | Use this tool |
29
- |---|---|
30
- | Take a screenshot (fullscreen, visual inspection only — NOT for reading clickable coords off the image) | `superbased_screenshot` — image is returned for the agent / user to LOOK AT. If you plan to click on what you see, use `superbased_ui_dump` instead. |
31
- | Screenshot a specific window (visual inspection only) | `superbased_screenshot target="Notepad"` — handles focus in one call; do NOT chain `superbased_focus_window`. For clickable coords, use `superbased_ui_dump`. |
32
- | **"I need coordinates to click on something I see"** | `superbased_ui_dump processName="..."` — returns screenshot PLUS every visible text element with screen-space `center.{x,y}` ready to feed into `superbased_click`. Never try to eyeball coords off a `superbased_screenshot` output — the image may be downscaled (`resolution=half` default) and the pixel coords will NOT match screen coords. |
33
- | List windows | `superbased_window_list` |
34
- | Read text from screen | `superbased_ai instruction="/extract"` |
35
- | Record screen changes | `superbased_recording action=start mode=smart` |
36
- | Monitor for errors | `superbased_recording action=start mode=monitor` |
37
- | See clipboard image | `superbased_clipboard action=readImage` |
38
- | Listen via mic | `superbased_dictate mic=true` |
39
- | Find a UI element by text | `superbased_locate label="Sign In"` |
40
- | **"What's on the page right now?" (one-call page read)** | `superbased_ui_dump processName="SuperBased"` — ONE call returns screenshot + OCR words + OCR lines + AX tree (when @superbased/win-uia or @superbased/macos-ax installed) + sorted text-elements list with bbox + center coords. Replaces screenshot → locate → screenshot loops. Set `ocrScaleFactor=2` for small-text UIs (sidebars, status bars). Set `background=true` for zero focus flicker on Windows. |
41
- | **"Find X on a long page" (scroll-until-found)** | `superbased_scroll_to targetText="Settings" processName="SuperBased" confirm=true` — ONE call loops ui_dump → search → PageDown → retry (up to maxPages, default 10). Returns `{ found, match: {center, text, ...}, atEnd, pagesScrolled }`. Replaces the 15-20 call scroll+screenshot flood. Agent feeds `match.center` directly into the next click. |
42
- | **Exploratory scroll — "walk through this whole section / page" (Windows only)** | `superbased_scroll_capture anchorX=... anchorY=... processName="SuperBased" maxPages=8 confirm=true` — **the MCP equivalent of Ctrl+Shift+A / Cmd+Shift+A.** ONE approval, N frames back. Inline calibration (no visible rewind). Heuristic fallback if calibration is noisy (never returns a hard error). Always prefer this over chaining `superbased_scroll` + screenshot calls. |
43
- | **Multi-step GUI task (the common case — always prefer this)** | `superbased_sequence steps=[{action:"click",x,y},{action:"screenshot"},{action:"scroll",amount:5,method:"auto"},{action:"screenshot"}] processName="SuperBased" confirm=true` — ONE approval, ONE activation, N steps. Replaces the 10-20+ call flood for "look at page X" / "fill this form" / "navigate to Y". Screenshot steps return images inline. Scroll step takes `method` (wheel / keys / auto — default "auto" rescues Electron/React scroll containers where wheel no-ops). |
44
- | Click in a specific window | `superbased_click x=... y=... processName="Notepad" confirm=true` — ONE call; never chain `superbased_focus_window` before it |
45
- | **Click a labeled element without knowing coords** (0.10) | `superbased_click label="Save" processName="Notepad" confirm=true` — resolves via OCR/AX, saves one round-trip vs `ui_dump → click` |
46
- | Type into a specific window | `superbased_type text="..." processName="Notepad" confirm=true` — ONE call; never chain `superbased_focus_window` before it |
47
- | **Type into a labeled field without knowing coords** (0.10) | `superbased_type text="..." label="Email" processName="..." confirm=true` — clicks the field first then types |
48
- | Send a hotkey to a specific window | `superbased_hotkey combo="Ctrl+S" processName="Notepad" confirm=true` — ONE call; never chain `superbased_focus_window` before it |
49
- | Scroll inside a specific window | `superbased_scroll amount=3 processName="Notepad" confirm=true` — ONE call; never chain `superbased_focus_window` before it |
50
- | Click / type / hotkey / scroll globally (whatever's foreground) | Omit `window` / `processName` / `hwnd` — e.g. `superbased_click x=... y=... confirm=true` |
51
- | Bring a window to focus (STANDALONE only — never as a setup step for another tool) | `superbased_focus_window window="Slack"` |
52
- | Pause between automation steps | `superbased_wait ms=500` |
53
- | **Wait for a UI state** (0.9) | `superbased_wait_for condition={type:"window", title:"Save As"} timeoutMs=3000` — polls server-side, no approval-per-iteration cost |
54
- | **Multi-step automation under ONE approval** | `superbased_sequence` with `targets[]` + `locate` directives on each step — see sequence docs for the full shape (drag/hover/wait_for/assert step variants in 0.1; target switching in 0.4; checkpoint + dryRun in 0.6–0.7) |
55
-
56
- ---
57
-
58
- ## Tools Reference
59
-
60
- ### Capture & View
61
-
62
- #### superbased_screenshot (preferred)
63
- The primary tool for taking screenshots. Returns the image inline. Handles window targeting in one server-side call so you never chain tools.
64
-
65
- | Parameter | Type | Description |
66
- |-----------|------|-------------|
67
- | `target` | string | Window title substring (case-insensitive). Scored matcher — refuses on ambiguous matches and returns `alternatives[]`. |
68
- | `processName` | string | Process executable name (e.g. `electron`, `notepad`). Combine with `target` to disambiguate same-process windows (e.g. two VS Code windows → `processName="code"` + `target="tsconfig"`). |
69
- | `hwnd` | string | Windows window handle from `superbased_window_list`. Unambiguous; bypasses scoring. Use this when `target` returns an ambiguous-match error. |
70
- | `resolution` | `full` / `high` / `half` / `quarter` / `thumbnail` | Image resolution (default: half — saves ~4x tokens vs full) |
71
-
72
- **Token savings**: A 1920x1080 screenshot at `full` = ~2,765 tokens. At `half` = ~691 tokens. At `quarter` = ~173 tokens.
73
-
74
- **Image dimension limit (≤2000px on each side):** Anthropic / OpenAI multimodal APIs reject images whose larger side exceeds 2000px in many-image conversations ("An image in the conversation exceeds the dimension limit"). The `half` default keeps a 1920×1080 capture at 960×540 (safe), and a 4K (3840×2160) at 1920×1080 (safe). On 5K+ displays, multi-monitor region captures, or `resolution=full`, the image CAN exceed 2000px — drop to `resolution=quarter` (≤960px on 4K) or `thumbnail`, or capture a smaller `region` via `superbased_capture_image`. **Never resize the user's window to make a screenshot fit** — `superbased_screenshot` already captures minimized + background windows via `PrintWindow`, and resizing changes the user's actual workspace.
75
-
76
- **Why a dedicated tool, and why never chain before it:**
77
- Agents that chain `superbased_focus_window` → `superbased_screenshot` trigger two permission prompts in the agent UI. The second prompt steals focus back to the agent window (the user clicks Approve there), which defeats the first focus change — the screenshot then captures the agent, not the target. `superbased_screenshot` with `target` / `processName` / `hwnd` does the whole round-trip server-side in a single approval.
78
-
79
- **Targeting precedence (most to least specific):**
80
- 1. `hwnd="3149370"` — unambiguous, recommended when the agent has already run `superbased_window_list`.
81
- 2. `processName="electron"` — narrows by .exe. Combine with `target` if the process has multiple windows.
82
- 3. `target="Name"` — title substring. Case-insensitive. If ambiguous, the tool refuses and returns `alternatives[]` so you can retry with `hwnd` from the list.
83
- 4. (no params) — fullscreen.
84
-
85
- **Diagnostic return field:**
86
- The response text prefix tells you whether the OS actually brought the window to front:
87
- - `✓ Activation verified` — target was confirmed foreground at capture time. Image reliable.
88
- - `⚠ OS refused to bring target to front` — `broughtToFront:false`. Another window (topmost flag, UIA lock, elevated process) beat the activation. Image likely shows the original foreground. Retry with a different targeting param (hwnd recommended) or investigate the covering window.
89
-
90
- **Typical workflow:**
91
- 1. `superbased_screenshot target="SuperBased"` — done in one call for unambiguous names.
92
- 2. If returns 409/ambiguous with `alternatives[]`: inspect the list, pick the one you want, retry with its `hwnd`.
93
- 3. If returns 200 but `⚠ broughtToFront:false`: investigate the covering window; retry with `hwnd` for reliability.
94
-
95
- #### superbased_capture_image (advanced)
96
- Only use when you need absolute-pixel region coordinates (`x`, `y`, `width`, `height`) or explicit `mode` control. For plain "screenshot this / screenshot that window" requests, always prefer `superbased_screenshot`.
97
-
98
- | Parameter | Type | Description |
99
- |-----------|------|-------------|
100
- | `mode` | `fullscreen` / `region` / `active_window` | Capture mode (default: fullscreen) |
101
- | `resolution` | `full` / `high` / `half` / `quarter` / `thumbnail` | Image resolution (default: half) |
102
- | `window` | string | Same window-targeting semantics as `superbased_screenshot`'s `target`. |
103
- | `x`, `y`, `width`, `height` | number | Absolute screen pixel coordinates for region mode |
104
-
105
- #### superbased_capture
106
- Take a screenshot. Returns capture ID and metadata (no image inline). Use when you only need the ID to feed downstream tools (`superbased_ai`, `superbased_annotate`, etc.) and don't need to look at the image yourself.
107
-
108
- | Parameter | Type | Description |
109
- |-----------|------|-------------|
110
- | `mode` | `fullscreen` / `region` / `active_window` | What to capture |
111
- | `x`, `y`, `width`, `height` | number | Absolute screen pixel coordinates for region mode (0,0 = top-left) |
112
- | `projectDir` | string | Where to save (default: CWD) |
113
-
114
- #### superbased_gallery_image
115
- Retrieve a saved capture's image inline from the gallery.
116
-
117
- | Parameter | Type | Description |
118
- |-----------|------|-------------|
119
- | `captureId` | number | Gallery capture ID |
120
- | `resolution` | `full` / `high` / `half` / `quarter` / `thumbnail` | Image resolution (default: half). Use `quarter` or `thumbnail` when you only need to check layout/presence, not read text. |
121
-
122
- **Token savings**: Same as `superbased_capture_image` — `half` saves ~4x vs `full`, `quarter` saves ~16x.
123
-
124
- #### superbased_window_list
125
- List all visible windows on screen. Returns each window's name, active status, and minimized state. Use window names with `superbased_capture_image` to target specific windows.
126
-
127
- Returns: `{ windows: [{ id, name, hwnd, minimized, isActive }], activeWindow: { appName, windowTitle } }`
128
-
129
- - `hwnd` (Windows only): Window handle used internally for activation
130
- - `minimized`: Whether the window is minimized to taskbar
131
- - `isActive`: Whether this is the currently focused window
132
-
133
- ### AI & OCR
134
-
135
- #### superbased_ai
136
- Send a screenshot to AI for analysis. If no image provided, captures the screen automatically.
137
-
138
- | Parameter | Type | Description |
139
- |-----------|------|-------------|
140
- | `instruction` | string | What to do. Supports slash commands: `/extract` (get text), `/summarize`, `/code` (extract code), `/explain`, `/translate`, `/table` (extract tabular data), `/edit`, `/reformat` |
141
- | `captureId` | number | Use an existing capture from gallery |
142
- | `screenshotPath` | string | Path to an image file |
143
- | `projectDir` | string | For auto-captures |
144
- | `provider` | `auto` / `cloud` / `ollama` / `ollama:<model>` | Phase 6.3. `auto` (default) respects settings: if `ollama.routing.enabled=true` AND `ollama.routing.vision=true` (or `chat`) AND `ollama.model.vision` is set, routes to Ollama; else cloud. `ollama:<model>` is shorthand for `provider=ollama` + `model=<model>`. |
145
- | `model` | string | Per-call Ollama model tag (e.g. `llama3.2-vision:11b`). Only valid when `provider` is concrete (`ollama` or `cloud`). Passing `model` with `provider=auto` returns a structured `model_with_auto_provider` error. |
146
- | `forceVision` | boolean | Bypass the vision-capable model pre-check (M4 escape hatch). Default false. |
147
-
148
- **Ollama routing structured errors** (Phase 6.3): when `provider` routing fails, `superbased_ai` returns `isError: true` with a JSON body carrying `{ error: <code>, message, hint?, provider? }`. Codes:
149
- - `model_with_auto_provider` — `model` passed with `provider=auto`. Pin the provider explicitly.
150
- - `ollama_model_not_configured` — `provider=ollama` without a model (per-call or in settings). The hint surfaces the exact `superbased config set ollama.model.<task> <tag>` command.
151
- - `vision_incompatible_model` — Ollama model failed the vision pre-check. The message surfaces whether the decision came from `/api/show` (authoritative) or the allowlist. `forceVision=true` bypasses.
152
- - `not_signed_in` — `provider=cloud` while signed out, or `auto` fell through to cloud with no sign-in.
153
-
154
- **Ollama routing bypasses the cloud safety checks** (content moderation + per-day token budget). Opting in means trusting your local model.
155
-
156
- #### superbased_ocr
157
- Extract text from a screenshot using Tesseract OCR (runs locally — no data leaves your machine).
158
-
159
- | Parameter | Type | Description |
160
- |-----------|------|-------------|
161
- | `screenshotPath` | string | Path to image file |
162
- | `captureId` | number | Use an existing capture |
163
-
164
- #### superbased_ai_usage
165
- Check your daily AI quota (used/remaining/limit). Requires sign-in.
166
-
167
- #### superbased_transcribe
168
- Transcribe an audio file to text. Engine-routed (Phase 4b): `engine="auto"` (default) picks cloud when signed in, else sherpa (offline) if a model is downloaded, else a structured error. For voice notes with filler word removal, use `superbased_dictate` instead.
169
-
170
- | Parameter | Type | Description |
171
- |-----------|------|-------------|
172
- | `audioPath` | string | Path to audio file (wav, mp3, webm) |
173
- | `audioBase64` | string | Base64-encoded audio data |
174
- | `language` | string | BCP 47 language code (e.g. en-US) |
175
- | `engine` | `auto` / `native` / `sherpa` / `cloud` | Which STT engine to use. Default `auto`. |
176
-
177
- **Structured engine errors.** When the chosen engine can't run, the tool returns `isError: true` with a JSON body like:
178
- ```
179
- { "ok": false, "error": "model_required", "engine": "sherpa",
180
- "message": "Sherpa model zipformer-en-20M (~60 MB) is not downloaded...",
181
- "model": "zipformer-en-20M", "size_mb": 60,
182
- "consent_command": "superbased stt download zipformer-en-20M",
183
- "hint": "Or enable `stt.sherpa.autoDownloadOnFirstUse` via `superbased settings`." }
184
- ```
185
-
186
- Error codes agents should branch on:
187
- - `model_required` — sherpa requested but no model; surface `consent_command` to the user.
188
- - `binary_not_installed` — sherpa-onnx-node missing; `npm install -g superbased --include=optional`.
189
- - `binary_load_failed` — binary there but failed to `dlopen` (missing libonnxruntime, ABI mismatch). Surface `binary_error` verbatim.
190
- - `not_signed_in` — explicit `engine="cloud"` while signed out. Run `superbased auth login` or switch to `engine="sherpa"`.
191
- - `engine_disabled` — `stt.sherpa.enabled = false`. Flip via `superbased config set stt.sherpa.enabled true`.
192
- - `unavailable` — catch-all. `auto` with nothing installed falls here.
193
-
194
- **When to call `superbased_stt_status` first**: before requesting `engine="sherpa"` in a tight loop, check status once so you surface the `model_required` condition with a human-friendly message rather than one call per iteration.
195
-
196
- #### superbased_project
197
- Zero-arg "where am I" snapshot for agents landing in a fresh workspace. Returns:
198
-
199
- ```
200
- {
201
- cwd: "/path/to/project",
202
- git: { branch, ahead, behind, status: [...up to 10 short lines], statusTotal, remoteUrl },
203
- frameworks: { detected: ["node","typescript","next",...], evidence: [...] },
204
- server: { recentCaptures: [...3], lastDictation: {...} | null, activeRecording: null },
205
- serverError?: "..." // non-null only when /api/project/server-state failed
206
- }
207
- ```
208
-
209
- **When to use**: at the start of most sessions, before picking more specific tools. Tells you whether the user's workspace is a git repo, what ecosystem they're in (so you can pre-load the right knowledge), whether they have recent captures / dictations worth referencing, and whether a recording session is active that you should avoid duplicating. Cheap (one HTTP + a few git shell-outs); safe to skip if you already know the context.
210
-
211
- `git` fields are `null` / `[]` when cwd isn't a git repo or git isn't on PATH. `frameworks.detected` is empty when no known manifest files are present.
212
-
213
- #### superbased_workspace_sync
214
- Zero-arg bundled snapshot: fullscreen capture + OCR + active window + timestamp + project dir, all in one call. Replaces a common three-step chain (`superbased_capture` → `superbased_ocr` → `superbased_window_list`) when you need all three at once.
215
-
216
- Returns the image as an `image` content block + a JSON summary as a `text` block. OCR is truncated at 4000 chars; for full OCR call `superbased_ocr` separately on a persisted capture.
217
-
218
- **Read-only**: does NOT persist the capture to the gallery. Use `superbased_capture` when you need a `captureId` for follow-up tools.
219
-
220
- **When to use**: at the start of a "help me with what's on my screen" interaction. Gives you everything an agent typically needs to orient — image, text, and what app is focused — without three round-trips.
221
-
222
- #### superbased_stt_status
223
- Report which local speech-to-text engines are available on this machine. Useful before requesting `engine="sherpa"` on dictate/transcribe (Phase 4b) to avoid a `model_required` round-trip.
224
-
225
- No parameters. Returns:
226
-
227
- ```
228
- {
229
- sherpa: { binaryInstalled, binaryError?, modelDownloaded, modelId, modelPath },
230
- cloud: { signedIn },
231
- native: { platform, available, reason },
232
- autoResolvedTo: "sherpa" | "cloud" | "native-macos" | "native-windows" | "none",
233
- computedAt: <epoch-ms>
234
- }
235
- ```
236
-
237
- If `sherpa.modelDownloaded` is `false`, tell the user to run `superbased stt download <modelId>` — do not download silently. If `sherpa.binaryInstalled` is `false` with a `binaryError`, surface the error verbatim; it usually indicates a missing shared library (`libonnxruntime`) or a Node ABI mismatch.
238
-
239
- #### superbased_compress_text
240
- Convert text to token-efficient images using the Token Compression Engine.
241
-
242
- | Parameter | Type | Description |
243
- |-----------|------|-------------|
244
- | `text` | string | Text to compress |
245
- | `preset` | `compact` / `standard` / `tall` / `wide` / `full` / `auto` | Resolution preset |
246
- | `columns` | `auto` / `1` / `2` / `3` | Column layout |
247
- | `theme` | `dark` / `light` / `terminal` / `high-contrast` / `paper` | Visual theme |
248
- | `render_style` | `auto` / `code` / `document` / `terminal` | Rendering style |
249
-
250
- ### Gallery
251
-
252
- #### superbased_gallery
253
- Browse and search the capture gallery.
254
-
255
- | Parameter | Type | Description |
256
- |-----------|------|-------------|
257
- | `action` | `list` / `get` / `search` / `stats` | What to do |
258
- | `captureId` | number | For `get` action |
259
- | `query` | string | For `search` action (full-text) |
260
- | `limit` | number | Max results (default 20) |
261
-
262
- #### superbased_gallery_update
263
- Update tags or notes on a capture.
264
-
265
- | Parameter | Type | Description |
266
- |-----------|------|-------------|
267
- | `captureId` | number | Capture to update |
268
- | `tags` | string | Comma-separated tags |
269
- | `notes` | string | Notes text |
270
-
271
- ### Privacy & Security
272
-
273
- #### superbased_redact
274
- Auto-redact secrets (API keys, tokens, passwords) and PII (emails, phone numbers) from captures.
275
-
276
- | Parameter | Type | Description |
277
- |-----------|------|-------------|
278
- | `captureId` | number | Capture to redact |
279
- | `screenshotPath` | string | Path to image file |
280
- | `secrets` | boolean | Redact API keys, tokens (default: true) |
281
- | `pii` | boolean | Redact emails, phones, names (default: false) |
282
-
283
- Returns the redacted image inline + list of regions found.
284
-
285
- ### Annotations
286
-
287
- #### superbased_annotate
288
- Add programmatic annotations to captures (rectangles, highlights, blur, text labels, arrows).
289
-
290
- | Parameter | Type | Description |
291
- |-----------|------|-------------|
292
- | `captureId` | number | Capture to annotate |
293
- | `annotations` | array | Annotation objects (see types below) |
294
- | `save` | boolean | Save over the original (default: false — returns annotated image without modifying the original) |
295
-
296
- **Annotation types:**
297
- - `rectangle`: bounding box outline — `{type:"rectangle", x, y, width, height, color}`
298
- - `highlight`: semi-transparent overlay — `{type:"highlight", x, y, width, height, color}`
299
- - `blur`: pixelate a region — `{type:"blur", x, y, width, height}`
300
- - `text`: text label — `{type:"text", x, y, text, color, fontSize}`
301
- - `arrow`: arrow between two points — `{type:"arrow", x, y, toX, toY, color}`
302
-
303
- **Example:**
304
- ```
305
- superbased_annotate captureId=42 annotations=[{type:"rectangle",x:100,y:200,width:300,height:50,color:"#ff0000"},{type:"text",x:100,y:190,text:"Bug: misaligned button",color:"#ff0000"}]
306
- ```
307
-
308
- ### Dictation & Voice
309
-
310
- #### superbased_dictate
311
- Transcribe audio with text cleanup (filler word removal, deduplication). Engine-routed (Phase 4b) — cleanup is identical across engines; only the transcription source differs. Supports file input, base64, or **live microphone recording**.
312
-
313
- | Parameter | Type | Description |
314
- |-----------|------|-------------|
315
- | `audioPath` | string | Path to audio file |
316
- | `audioBase64` | string | Base64-encoded audio |
317
- | `mic` | boolean | Set to `true` to record from the microphone (requires ffmpeg installed) |
318
- | `duration` | number | Mic recording duration in seconds (default: 10) |
319
- | `language` | string | BCP 47 language code |
320
- | `cleanup` | boolean | Apply filler removal + dedup (default: true) |
321
- | `engine` | `auto` / `native` / `sherpa` / `cloud` | Which STT engine to use. Default `auto`. |
322
-
323
- **When to use `mic`:** The user asks you to "listen", "hear what I'm saying", or wants live voice input. Set `mic=true` and optionally `duration=15` for longer recordings.
324
-
325
- **When to force `engine="sherpa"`:** the user explicitly wants offline / private dictation, or you know they're signed out and have a model downloaded. Check `superbased_stt_status` first to confirm `sherpa.binaryInstalled && sherpa.modelDownloaded`.
326
-
327
- **When to force `engine="cloud"`:** you need high-accuracy transcription and the user is signed in. The bundled 20M Zipformer (sherpa's default) prioritizes latency + privacy over accuracy — expect **noticeably worse recognition of proper nouns, acronyms, technical terms, and accented speech** compared to cloud Whisper. Recognition of general conversational English is fine. If accuracy matters more than privacy/offline, pick cloud or explicitly confirm with the user before recommending sherpa for their use case.
328
-
329
- **Case note**: sherpa transcripts are normalized to sentence-case on return (`"A free online resource..."`). The underlying 20M model produces all-caps tokens; normalization happens in the engine layer. Agents can treat `engine="sherpa"` and `engine="cloud"` output as having the same casing contract.
330
-
331
- **Structured errors:** Same shape as `superbased_transcribe` — see that tool's docs for error codes (`model_required`, `binary_load_failed`, `not_signed_in`, etc.).
332
-
333
- **`superbased_dictate` vs `superbased_transcribe`:** Dictate adds text cleanup (filler words, deduplication) and supports mic recording. Transcribe returns the engine's raw output only. Both share the same `engine` parameter and error shapes.
334
-
335
- #### superbased_dictation_history
336
- Query past voice transcriptions.
337
-
338
- | Parameter | Type | Description |
339
- |-----------|------|-------------|
340
- | `limit` | number | Max entries to return (default: 20) |
341
-
342
- ### Recording & Visual QA
343
-
344
- #### superbased_recording
345
- Control automated screenshot recording sessions. Supports 4 modes: interaction (desktop input hooks), periodic (fixed interval), smart (change detection — headless default), and monitor (smart + AI analysis loop).
346
-
347
- | Parameter | Type | Description |
348
- |-----------|------|-------------|
349
- | `action` | `start` / `stop` / `pause` / `resume` / `status` / `capture` / `get_analysis` | Recording action |
350
- | `name` | string | Session name |
351
- | `profile` | `automated_test` / `bug_report` / `user_journey` / `compliance` | Recording profile |
352
- | `targetApp` | string | Process name to scope to |
353
- | `mode` | `interaction` / `periodic` / `smart` / `monitor` | Recording mode (default: smart for headless, interaction for desktop) |
354
- | `interval` | number | Capture interval in seconds (default: 3 for smart, 5 for monitor) |
355
- | `changeThreshold` | number | 0-1, minimum visual change to trigger capture (default: 0.05 = 5%) |
356
- | `analysisPrompt` | string | Custom AI instruction for monitor mode (e.g. "Flag any errors or test failures") |
357
- | `analyzeEvery` | number | AI analysis every N significant frames (monitor mode, default: 5) |
358
- | `analyzeInterval` | number | Minimum seconds between AI analyses (monitor mode, default: 30) |
359
- | `analysisDetail` | `low` / `high` | Image resolution for AI: low=512px, high=1024px (monitor mode, default: low) |
360
- | `sessionId` | string | Session ID (for `get_analysis` action) |
361
- | `since` | number | Only analyses after frame N (for `get_analysis` action) |
362
-
363
- **Recording modes:**
364
- - **`smart`** (recommended for headless/MCP): Captures at interval, but only saves frames when the screen visually changes by more than the threshold. Efficient — no redundant frames.
365
- - **`monitor`**: Like smart, but periodically sends captured frames to AI for analysis. AI flags errors, warnings, or unexpected states. Alerts are sent as MCP notifications and stored on frames. Use `get_analysis` to retrieve all AI analyses for a session.
366
- - **`periodic`**: Captures every N seconds regardless of changes. Simple time-lapse.
367
- - **`interaction`**: Desktop only — captures on clicks, keystrokes, scrolls (requires input hooks).
368
-
369
- **Monitor mode token budget:** Control AI costs with `analyzeEvery` (frames between AI calls) and `analyzeInterval` (minimum seconds between AI calls). Use `analysisDetail=low` to send 512px images (fewer tokens).
370
-
371
- #### superbased_sessions
372
- List past recording sessions and their frames.
373
-
374
- | Parameter | Type | Description |
375
- |-----------|------|-------------|
376
- | `action` | `list` / `frames` | What to do |
377
- | `sessionId` | string | For `frames` action |
378
-
379
- #### superbased_describe_frames
380
- AI-describe each frame in a recording session (what's visible, UI state, changes).
381
-
382
- | Parameter | Type | Description |
383
- |-----------|------|-------------|
384
- | `sessionId` | string | Recording session ID |
385
- | `limit` | number | Max frames to describe (default: 20) |
386
- | `provider` | `auto` / `cloud` / `ollama` / `ollama:<model>` | Phase 6.3. Each frame is a vision call; settings field is `ollama.model.vision`. |
387
- | `model` | string | Per-call Ollama model tag. Only valid when `provider` is concrete. |
388
- | `forceVision` | boolean | Bypass the vision-capable model pre-check. |
389
-
390
- #### superbased_narrate
391
- Generate a prose narrative summary of a recording session from frame descriptions.
392
-
393
- | Parameter | Type | Description |
394
- |-----------|------|-------------|
395
- | `sessionId` | string | Recording session ID |
396
- | `descriptions` | array | Frame descriptions from `superbased_describe_frames` |
397
- | `provider` | `auto` / `cloud` / `ollama` / `ollama:<model>` | Phase 6.3. Text-only; settings field is `ollama.model.chat`. |
398
- | `model` | string | Per-call Ollama model tag. Only valid when `provider` is concrete. |
399
-
400
- #### superbased_diff
401
- Compare two recording sessions for visual differences (visual regression testing).
402
-
403
- | Parameter | Type | Description |
404
- |-----------|------|-------------|
405
- | `baselineSessionId` | string | Baseline session ID |
406
- | `currentSessionId` | string | Current session ID |
407
-
408
- #### superbased_baseline
409
- Manage workflow baselines for visual regression testing.
410
-
411
- | Parameter | Type | Description |
412
- |-----------|------|-------------|
413
- | `action` | `set` / `get` / `history` | Baseline action |
414
- | `workflowName` | string | Workflow name (e.g. "checkout-flow") |
415
- | `sessionId` | string | Session ID (for set action) |
416
-
417
- #### superbased_export
418
- Export a recording session in various formats.
419
-
420
- | Parameter | Type | Description |
421
- |-----------|------|-------------|
422
- | `sessionId` | string | Session to export |
423
- | `format` | `zip` / `markdown` / `pdf` / `html` / `gif` | Export format |
424
-
425
- ### Settings & Config
426
-
427
- #### superbased_settings
428
- View or update app settings. API keys are never exposed.
429
-
430
- | Parameter | Type | Description |
431
- |-----------|------|-------------|
432
- | `action` | `get` / `set` / `get_provider` | What to do |
433
- | `key` | string | Setting key for `set` |
434
- | `value` | string | New value for `set` |
435
-
436
- #### superbased_presets
437
- Manage AI instruction presets (saved templates with optional keyboard shortcuts).
438
-
439
- | Parameter | Type | Description |
440
- |-----------|------|-------------|
441
- | `action` | `list` / `create` / `update` / `delete` | What to do |
442
- | `name` | string | Preset name |
443
- | `instruction` | string | AI instruction template |
444
- | `shortcut` | string | Keyboard shortcut (e.g. "Ctrl+Shift+1") |
445
- | `id` | number | Preset ID (for update/delete) |
446
-
447
- ### Status & Auth
448
-
449
- #### superbased_health
450
- Check if SuperBased is running and what features are available.
451
-
452
- #### superbased_auth
453
- Check authentication status (email, plan, authenticated).
454
-
455
- #### superbased_license
456
- View plan limits, feature gates, and device info.
457
-
458
- #### superbased_clipboard
459
- Read or write system clipboard.
460
-
461
- | Parameter | Type | Description |
462
- |-----------|------|-------------|
463
- | `action` | `read` / `write` / `readImage` | Clipboard action |
464
- | `text` | string | Text to write (for write action) |
465
-
466
- **Returns:** `read` returns clipboard text. `write` confirms success. `readImage` returns the clipboard image inline (PNG) — useful for reading screenshots copied from other apps.
467
-
468
- ### GUI Automation (agent hands)
469
-
470
- > **Off by default.** GUI automation is gated by `guiAutomation.enabled` in settings (default `false`). The user must opt in via `superbased config set guiAutomation.enabled true` or `superbased settings`. Refused actions return `{ ok: false, error, hint }` — never throw. Always check `superbased_health` → `capabilities.gui_automation.enabled` before invoking these tools.
471
- >
472
- > Each call also requires `confirm: true` unless the user has disabled the safety prompt (`guiAutomation.requireConfirmFlag = false`). Calls to apps in the **protected-apps blocklist** (password managers, banking sites, by default) are refused regardless of toggles. Every action — accepted or refused — is appended to `~/.superbased/audit.log` as one NDJSON line.
473
- >
474
- > All tools return `{ ok, method, confidence, error?, hint? }` where `method` is one of `coordinates` / `ocr_locator` / `window` / `ax_tree` (the last reserved for future native accessibility integration).
475
- >
476
- > **For any multi-step task, use `superbased_sequence` — ONE approval, ONE activation, N steps.** The single-step tools below are building blocks; chaining them forces a permission prompt per step, and every prompt-click steals focus back to the agent. Always reach for `superbased_sequence` first.
477
- >
478
- > **Approval-mode guidance (focus-stealing vs focus-preserving hosts).** Most of the "NEVER chain `superbased_focus_window` before `type`/`hotkey`/`click`" warnings in this doc assume a **focus-stealing** host — Claude Code's terminal UI and Claude Desktop's approval modal both bring themselves to the foreground while the user clicks Approve, which defeats any preceding `focus_window` and lands the keystrokes on the agent window instead of the target. In those hosts, the targeted-call pattern (`processName=` / `hwnd=` on the action tool itself, which uses focus-free PostMessage/UIA on Windows) is the ONLY reliable route. In **focus-preserving** hosts — Cursor's MCP auto-approve, Codex CLI `--yolo`, any session where the user has set `guiAutomation.requireConfirmFlag: false`, all headless/scripted runs — approval doesn't move focus, so `focus_window → type (untargeted) → hotkey (untargeted)` is safe and often cleaner for long chains against the same window (focus once, chain N keystrokes with `restoreFocus:false` on each). You can tell which mode you're in: call `superbased_health` and inspect `capabilities.gui_automation.require_confirm_flag` — when `false`, focus is NOT being stolen per-call (some action groups may still require `confirm:true`, but the prompt-click itself doesn't fire). For focus-preserving callers, treat the "NEVER chain focus_window" warnings below as "still unnecessary" rather than "unsafe" — the targeted single-call pattern remains preferred for one-shot actions because it saves a round-trip, but the `focus_window → untargeted` chain is a valid alternative. Targeted paths work identically in both modes.
479
- >
480
- > **Chaining keystrokes against the same window: use `restoreFocus:false`.** Every write tool defaults to `restoreFocus:true` — after delivering the keystroke / click it snapshots and restores the pre-call foreground. Safe default for one-shot actions, but when firing multiple keystrokes at the same target (e.g. `hotkey Ctrl+A` → `hotkey Delete` → `type "new content"`), each restore forces the NEXT call to re-activate the target, which costs ~200ms per call AND on some apps resets ephemeral state tied to focus. Win11 Notepad in particular drops the editor's active text selection when focus leaves the window, so `Ctrl+A restoreFocus:true` followed by `Delete restoreFocus:true` re-activates Notepad with NO selection and the Delete no-ops. **Pattern**: set `restoreFocus:false` on every call in the chain EXCEPT the last one, which uses the default `true` (or explicit `true`) to hand foreground back to the agent/caller after the chain completes. Targeted PostMessage/UIA paths don't touch focus at all and don't need this — only SendInput-forced targets (browsers, Electron, Win11 Notepad, anything in the classifier's force-SendInput list). **Alternative**: wrap the whole chain in `superbased_sequence` — one activation, one restore, N steps, no focus-state guessing.
481
- >
482
- > **Auto-snapshot after every write action.** `superbased_click` / `_type` / `_hotkey` / `_scroll` now auto-return the post-action screenshot as an MCP image content block (`returnObservation: 'screenshot'` default). **You no longer need a separate `superbased_screenshot` call after a write action.** Set `returnObservation: 'full'` to also get OCR + accessibility-tree `textElements` (same shape as `superbased_ui_dump` — ready to feed coordinates into the next click). Set `returnObservation: 'none'` in tight loops where the observation would bloat payload (e.g. multi-scroll pagination). **Inside `superbased_sequence`, per-step default is `'none'`** — opt in per step when you need a frame; explicit `{ action: 'screenshot' }` steps still work as before.
483
- >
484
- > **Coordinate system (virtual-screen policy).** All API coordinates are virtual-screen logical units with top-left origin. Primary display at `(0, 0)`; secondary to the LEFT sits at negative X, to the RIGHT at X ≥ primary.width. Windows: DPI-logical pixels across the union of all monitors. macOS: Quartz points (top-left origin; Retina is 2x / 3x transparently). There is NO `display?: number` half-measure on positional tools — learn display bounds via `superbased_display_list` and pass virtual-screen coords everywhere. `display?:` is accepted ONLY on screenshot / capture tools as a "capture just this display" convenience; coords they return stay virtual-screen. `superbased_screenshot` with a region that falls outside the primary display on a setup where the underlying capture doesn't span all monitors may return empty / wrong pixels — use `display?:` to target the specific monitor instead, or capture per-window via `hwnd`/`processName`.
485
- >
486
- > **Host-side permission prompts (Claude Code / Cursor).** Even with sequence + ui_dump, the agent host may still prompt per tool call unless you've whitelisted the server. In Claude Code, add this to `.claude/settings.json` (project) or `~/.claude/settings.json` (global):
487
- > ```json
488
- > { "permissions": { "allow": ["mcp__superbased"] } }
489
- > ```
490
- > This auto-approves every SuperBased tool — but the SuperBased server still enforces its own safety gates (`guiAutomation.enabled` toggle, per-action toggles, `confirm: true` flag, protected-apps blocklist, audit log). The host-side prompt is a redundant second gate; turning it off after you've opted into `guiAutomation.enabled` is safe. See `docs/MCP_INTEGRATION_GUIDE.md` for Cursor / Windsurf / Cline equivalents.
491
-
492
- #### superbased_ui_dump (PREFERRED for "read the page" tasks)
493
- One-call page read — returns screenshot + OCR text regions (words + lines with bbox + center coords) + accessibility tree (when the optional `@superbased/win-uia` / `@superbased/macos-ax` binding is installed) + merged `textElements` list sorted in top-to-bottom, left-to-right reading order. Replaces the screenshot → `superbased_locate` → "label not found" → screenshot → guess-coords loop.
494
-
495
- | Parameter | Type | Description |
496
- |-----------|------|-------------|
497
- | `window` / `processName` / `hwnd` | string | Window target. Omit to dump foreground / full screen. |
498
- | `background` | boolean | Default true — PrintWindow capture on Windows for zero focus flicker. |
499
- | `includeScreenshot` | boolean | Default true — emit PNG as MCP image content block. Set false to get only coordinates. |
500
- | `includeOcr` | boolean | Default true — Tesseract OCR + words + lines. |
501
- | `includeAxTree` | boolean | Default true — include AX tree when native binding available; structured note when not. |
502
- | `ocrScaleFactor` | number | Default 1. Set **2** for small-text UIs (sidebar labels, status bars) where native-res OCR misses text. |
503
- | `ocrMinConfidence` | number | Default 30 (0-100). Raise to filter low-confidence OCR noise. |
504
-
505
- **Response:** `{ ok, screenshot?: {width, height, mimeType}, window?: {title, processName, hwnd}, textElements: [{text, bbox, center, confidence, source: 'ocr_word'|'ocr_line'|'ax_tree', role?}], axTree: {available, error?, nodeCount?, root?}, timings, backgroundMode }`. Screenshot comes back as an MCP image content block (not duplicated in the JSON body). `textElements` are deduplicated across OCR + AX sources — AX-tree labels win over OCR on the same region because their bboxes are tighter.
506
-
507
- **Typical workflow:**
508
- 1. `superbased_ui_dump processName="SuperBased"` → read everything on-screen in one call.
509
- 2. Find the label you want in `textElements` → grab its `center: {x, y}`.
510
- 3. `superbased_click x=<center.x> y=<center.y> processName="SuperBased" confirm=true` — or include the click in a `superbased_sequence`.
511
-
512
- **When to prefer this over `superbased_locate`:**
513
- - You want to see EVERYTHING on screen, not just match one label.
514
- - The OCR path failed on a small-text label at native resolution — `ocrScaleFactor=2` here usually rescues it.
515
- - You want the AX tree for interactive-element coordinates (exact button/menu-item bboxes) without a separate `superbased_accessibility_tree` call.
516
-
517
- #### superbased_scroll_capture (PREFERRED for "walk through the whole page / section")
518
- **Exploratory scroll** — the MCP equivalent of the desktop Ctrl+Shift+A / Cmd+Shift+A hotkey. One permission, one `confirm:true`, one activation. Server-side: calibrate → scroll → capture → repeat until end. Returns ALL frames inline as image content blocks.
519
-
520
- **When to use**: "show me everything on this settings page," "walk through the GUI Automation panel," "capture the whole sidebar." Any task where you want to READ a long scrollable section. **DO NOT chain `superbased_scroll` + screenshot calls for this** — each chained call costs its own approval. `superbased_scroll_capture` gives you N frames under ONE approval.
521
-
522
- | Parameter | Type | Description |
523
- |-----------|------|-------------|
524
- | `anchorX` | number (required) | Physical screen X inside the scroll container. Grab from a `superbased_ui_dump` textElement's `center.x`. |
525
- | `anchorY` | number (required) | Physical screen Y for the anchor. See `anchorX`. |
526
- | `window` / `processName` / `hwnd` | string | Target window (required — the tool can't calibrate without a known window). |
527
- | `direction` | `down` / `up` | Default `down`. |
528
- | `maxPages` | number | Default 8, cap 20. Each page ≈ one viewport with 10% overlap. |
529
- | `stopOnAtEnd` | boolean | Default true — bail when pixel-offset < 3 px (no-movement = end of content). |
530
- | `settleMs` | number | Default 400. Bump to 600-800 if the target does heavy smooth-scroll animation. |
531
- | `recalibrate` | boolean | Force a fresh measurement even if cache has a valid entry. Use after window resize. |
532
- | `confirm` | boolean | Required unless disabled. ONE confirm covers the whole walkthrough. |
533
- | `restoreFocus` | boolean | Default true — restore previous foreground after all frames captured. |
534
-
535
- **Response shape**:
536
- ```
537
- {
538
- ok: true,
539
- framesCaptured: 6,
540
- pagesScrolled: 5,
541
- atEnd: true,
542
- atEndReason: 'no_movement' | 'max_pages' | 'error',
543
- frames: [
544
- { page: 0, imageBase64, width, height, scrolledPx: 0, timestampMs: 0 },
545
- { page: 1, imageBase64, width, height, scrolledPx: 900, timestampMs: 780 },
546
- ...
547
- ],
548
- calibration: {
549
- pixelsPerScroll: 42, score: 0.73, windowHeight: 1440,
550
- ticksPerPage: 31, cacheHit: false, measured: true,
551
- lowConfidence: false, stripPicked: 'center'
552
- },
553
- dpiScale: 1.5
554
- }
555
- ```
556
- Each frame's PNG is also emitted as a separate MCP image content block so the agent can visually read all viewports in one turn.
557
-
558
- **Inline calibration (no visible rewind)**: the first scroll IS the calibration. Flow: capture frame 0 → scroll 5 ticks → measure vs frame 0 → derive `pixelsPerScroll` → extend the first scroll with `(ticksPerPage − 5)` more ticks to complete one full viewport → capture frame 1. User sees only natural forward scrolling — no "scroll down, scroll back up" dance that distracted in earlier rounds.
559
-
560
- **Never fails on calibration alone**: when measurement score < 0.4 or offset < 15 px (sparse content, solid-background anchor, fast animation), the tool falls back to a typical Chromium/Electron heuristic (`pixelsPerScroll: 40`) with `calibration.lowConfidence: true`. It keeps returning frames. You get a best-effort walkthrough instead of a hard error. The heuristic is NOT cached, so the next call retries real measurement.
561
-
562
- **Picking an anchor**: run `superbased_ui_dump` first, pick a `textElement` whose `center.{x,y}` sits INSIDE the scrollable container you want to page through (NOT inside a sidebar / header / toolbar — those scroll separately). The anchor point is where Win32 routes the wheel event; if it's over the wrong container, the wrong container scrolls.
563
-
564
- **When NOT to use**:
565
- - You already know exactly what's on the page — `ui_dump` is cheaper (one call, no scrolling).
566
- - Target text is known — `superbased_scroll_to` stops at the match instead of walking the whole page.
567
- - Non-scrollable content (modal dialogs, single-page forms) — nothing to traverse.
568
-
569
- #### superbased_scroll_to (PREFERRED for "find X on a long page")
570
- Scroll until a text label is visible in the viewport, under ONE permission approval. The tool loops server-side:
571
- 1. `ui_dump` the current viewport (OCR + AX tree)
572
- 2. Search `textElements` for `targetText`
573
- 3. If found → return coords + final screenshot, done
574
- 4. Else scroll one page (PageDown — predictable)
575
- 5. Check `atEnd` via pre/post similarity; bail if the viewport didn't move
576
- 6. Repeat up to `maxPages` (default 10, capped at 50)
577
-
578
- Replaces the 15-20 call "scroll + screenshot + scroll + screenshot" flood agents fall into when exploring a sidebar / menu / settings page. Typical cost is 2-4 iterations × ~700 ms = a few seconds for "find Settings > GUI Automation in a long sidebar."
579
-
580
- | Parameter | Type | Description |
581
- |-----------|------|-------------|
582
- | `targetText` | string (required) | Text to find. See `matchMode`. |
583
- | `direction` | `down` / `up` | Default `down`. |
584
- | `maxPages` | number | Max iterations before giving up. Default 10, capped at 50. |
585
- | `matchMode` | `substring` / `exact` | Default `substring` (element text *includes* target). `exact` = whole-element match. |
586
- | `caseSensitive` | boolean | Default `false`. |
587
- | `confirm` | boolean | Required unless disabled. ONE confirm covers the whole loop. |
588
- | `window` / `processName` / `hwnd` | string | Target window (same semantics as superbased_click). Applied ONCE at loop start. |
589
- | `restoreFocus` | boolean | Default `true`. Restore previous foreground after the loop ends. |
590
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — returns the final-state PNG (frame where we found the target, or where we bailed). `full` adds OCR + AX `textElements`. |
591
- | `ocrScaleFactor` | number | Default 1. Set 2 for small-text sidebars / menus. Forwarded to the inner ui_dump calls. |
592
-
593
- **Response shape:**
594
- ```
595
- {
596
- ok: true, found: true, pagesScrolled: 3, atEnd: false,
597
- match: { text, bbox, center: {x, y}, confidence, source, role? },
598
- matches: [...all hits...],
599
- method: 'ax_tree' | 'ocr_locator',
600
- confidence: <best match's confidence>,
601
- observation: { width, height, mimeType, ... },
602
- details: { direction, matchMode, caseSensitive, maxPages, focus, restoreFocus, matchedWindow, timings }
603
- }
604
- ```
605
-
606
- **Typical workflow** — "open Settings → GUI Automation in SuperBased":
607
- ```
608
- superbased_scroll_to targetText="GUI Automation" processName="SuperBased" confirm=true
609
- → { found: true, match: { center: {x:1101, y:672}, ... } }
610
-
611
- superbased_click x=1101 y=1101 processName="SuperBased" confirm=true
612
- → done. 2 MCP calls total for the old 15-20 call pattern.
613
- ```
614
-
615
- **When NOT to use**:
616
- - Target is already visible in the current viewport → use `superbased_ui_dump` (one call, no scrolling) or `superbased_locate`.
617
- - Target text is too common to disambiguate (e.g. "OK") → use `matchMode: "exact"` plus a more specific label, or fall back to coordinates from `superbased_ui_dump`.
618
- - You need to click inside a nested scroll container that PageDown doesn't reach (some custom scrollable divs) → fall back to `superbased_sequence` with manual scroll + screenshot steps.
619
-
620
- #### superbased_sequence (PREFERRED for anything with more than 1 step)
621
- Batched automation — runs an array of steps in one MCP call, one permission approval, one activation window. The target is focused once at sequence start and restored once at the end. Steps inside the sequence run focus-free primitives (no per-step activation/restore), so the whole flow completes in seconds with a stable focus context.
622
-
623
- | Parameter | Type | Description |
624
- |-----------|------|-------------|
625
- | `steps` | array | Ordered list (max 50). Each step is a discriminated union on `action`: `click` (x, y, button?, doubleClick?, returnObservation?), `type` (text, returnObservation?), `hotkey` (combo, returnObservation?), `scroll` (amount, returnObservation?), `screenshot` (background?), `wait` (ms), `move` (x, y). Per-step `returnObservation` defaults to `'none'` inside a sequence (payload-safe) — opt in on individual steps where you need a frame. Explicit `{ action: 'screenshot' }` steps continue to return an image inline. |
626
- | `window` / `processName` / `hwnd` | string | Target window (same semantics as superbased_click). Applied ONCE at sequence start. |
627
- | `restoreFocus` | boolean | Default true — restore previous foreground after the entire sequence completes. |
628
- | `confirm` | boolean | Required (one confirm covers all steps). |
629
- | `stopOnError` | boolean | Default true — halt on first failed step. Set false for best-effort flows. |
630
-
631
- **Response:** `{ ok, results: [...], focus, restoreFocus, matchedWindow, timings, stoppedAt? }`. Each step result has `{ step, action, ok, error?, imageBase64?, width?, height?, durationMs }`. Screenshot steps return the PNG inline as MCP image content blocks so the agent can read the state across multiple frames in one turn.
632
-
633
- **When to use:**
634
- - "Open Settings → GUI Automation and tell me what's there" → one sequence with `[screenshot, click sidebar-Settings, screenshot, click submenu-GUI-Automation, screenshot, scroll, screenshot]` — 1 approval, 1 activation, ~2–4 seconds total. Compare to 7 individual calls (7 approvals, 7 activation round-trips, 20+ seconds of permission clicks).
635
- - Form fill: `[click field1, type value1, hotkey Tab, type value2, hotkey Enter]`.
636
- - Verify-and-retry patterns where you need screenshots between actions: `[click, wait 200, screenshot, click, wait 200, screenshot]`.
637
-
638
- **ALWAYS end the sequence with a `{ action: "screenshot" }` step.** Per-step `returnObservation` defaults to `'none'` inside a sequence — without an explicit final screenshot step the tool returns no image and you waste a follow-up MCP call to inspect the result. Single-step `superbased_click` / `_type` / `_hotkey` / `_scroll` auto-snapshot (default `returnObservation: 'screenshot'`); sequences do NOT, by design, because mid-sequence frames bloat payloads. The pattern is: every sequence ends in a `screenshot` step (or a final `wait_for` / `assert` that returns its own observation). Skip this rule only when stopOnError handling already gives you the frame you need.
639
-
640
- **Refusal shape:** If master toggle is off, or any per-action toggle required by the sequence is off, or the active window matches a protected app, the tool returns `{ ok: false, error, hint, results: [] }` without running anything. Same gate semantics as single-step tools — just checked once.
641
-
642
- **Anti-patterns:**
643
- - Do NOT chain `superbased_focus_window` before this — the sequence handles focus itself. Chaining doubles the prompt count and steals focus.
644
- - Do NOT use `superbased_sequence` for a literal single step — just call the primitive. Sequence overhead (gate check + wrapper) is small but not zero.
645
- - Do NOT expect `type` steps inside a sequence to interpret special keys — `action: "type", text: "Hello{Enter}"` types 14 literal characters. Use `action: "hotkey", combo: "Enter"` as a separate step.
646
- - Do NOT call `superbased_screenshot` separately AFTER a sequence — fold the screenshot into the sequence as the final step. Two MCP calls = two approvals = two activations = the second focus prompt steals focus from the actual target.
647
-
648
- #### superbased_click
649
- Click at screen coordinates OR at a resolved UI element (S0/0.10). Pass EITHER `x` + `y` OR one of `label` / `automationId` / `role + name` — the latter resolve via the **reliability pyramid** (`automationId` → `role+name` → `label`), saving one round-trip vs `ui_dump → click`. Pass `window=` / `processName=` / `hwnd=` on this call to drive a specific window — the tool does focus → click → verified-restore in ONE MCP turn. NEVER chain `superbased_focus_window` before this.
650
-
651
- | Parameter | Type | Description |
652
- |-----------|------|-------------|
653
- | `x` | number | Absolute x (px from left edge of primary display). Pass EITHER `x` + `y` OR one of the resolver fields. |
654
- | `y` | number | Absolute y (px from top) |
655
- | `label` | string | **0.10** — Visible text (OCR-resolved). Falls back to `LOCATE_NO_MATCH` if not visible in a fresh ui_dump. |
656
- | `automationId` | string | **0.10** — AX AutomationId (Windows UIA) / AXIdentifier (macOS). Most reliable — prefer over `label` when available. |
657
- | `role` | string | **0.10** — AX role (e.g. `"button"`, `"textbox"`) — pair with `name=`. |
658
- | `name` | string | **0.10** — AX accessible name — required when `role=` is set. |
659
- | `caseSensitive` | boolean | Match `label` / `role` + `name` case-sensitively (default false). |
660
- | `button` | `left` / `right` / `middle` | Default: `left` |
661
- | `doubleClick` | boolean | Send double-click instead of single. Back-compat alias for `clickCount: 2`. |
662
- | `clickCount` | 1 / 2 / 3 | **S2/2.1** — 1 single, 2 double, 3 triple-click (word → line selection in text fields). Default 1. `doubleClick: true` wins over `clickCount` when both are set. |
663
- | `modifiers` | array | **S2/2.1** — `["shift"]` / `["ctrl"]` / `["alt"]` / `["meta"]` — held for the duration of the click. Shift-click extends selection, Ctrl-click multi-selects (open-in-new-tab in browsers), Meta = Cmd on macOS / Win on Windows. Multiple combine. |
664
- | `confirm` | boolean | Required unless user has disabled the safety prompt |
665
- | `window` | string | Window-title substring (scored matcher). Refuses on ambiguous matches. |
666
- | `processName` | string | Exact process executable name (highest precision). |
667
- | `hwnd` | string | Direct window handle from `superbased_window_list`. |
668
- | `restoreFocus` | boolean | Default true — restore previous foreground via AttachThreadInput + verify + retry. |
669
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — auto-returns post-click PNG inline. `full` adds OCR + AX `textElements`. `none` suppresses. |
670
- | `humanize` | `off` / `light` / `human` / `paranoid` | Per-call override of the global `humanInputDefault` setting (default `light`). When non-`off`, the cursor follows a Bezier curve from its current position to `(x, y)` BEFORE the click fires — defeats trajectory classifiers that flag teleport-then-click. `light` adds modest curvature; `human` adds 2 control points + 15% overshoot; `paranoid` adds 3 + 40% overshoot at ~5-10x slower travel. Move skipped for tiny hops (<4px) — the click still lands on target. Cross-platform via `getCursorPosition()` (`GetCursorPos` on win32, `CGEventSourceGetMouseLocation` on darwin). |
671
-
672
- **Error codes** (in `details.errorCode` on `ok: false`): `LOCATE_NO_MATCH` (element not visible in fresh ui_dump), `LOCATE_AMBIGUOUS` (multiple matches — narrow with `processName=` or use `automationId` / `role+name`), `SESSION_LOCKED` (screen locked), `ELEVATION_REQUIRED` (UAC prompt up), `ACCESSIBILITY_NOT_GRANTED` (macOS TCC — see hint for deep-link), `TARGET_HOSTILE` (anti-automation block).
673
-
674
- #### superbased_type
675
- Type literal characters into the focused text field. **Does not interpret special-key forms** like `{Enter}` — use `superbased_hotkey` for those. Pass `window=` / `processName=` / `hwnd=` to target a specific window in one MCP turn (focus-free PostMessage/UIA path on Windows; activate-then-SendInput-then-restore elsewhere). **S0/0.10** adds label / AX resolution: when `label` / `automationId` / `role + name` is set, the tool clicks the matched field first (keeping focus) then types — saves one round-trip vs `ui_dump → click → type`.
676
-
677
- | Parameter | Type | Description |
678
- |-----------|------|-------------|
679
- | `text` | string | Characters to type |
680
- | `confirm` | boolean | Required unless disabled |
681
- | `label` | string | **0.10** — Click-target field label (OCR) before typing. |
682
- | `automationId` | string | **0.10** — AX AutomationId for the target field — most reliable. |
683
- | `role` | string | **0.10** — AX role (e.g. `"textbox"`) — pair with `name=`. |
684
- | `name` | string | **0.10** — AX accessible name — required when `role=` is set. |
685
- | `caseSensitive` | boolean | Match `label` / `role` + `name` case-sensitively (default false). |
686
- | `clearFirst` | boolean | **S2/2.6** — Replace instead of append. Overwrites a pre-populated field in one call. On Windows the semantic propagates end-to-end: the PostMessage WM_CHAR path pre-sends WM_KEYDOWN Ctrl+A + Delete to the resolved Edit child; the UIA SetValue fallback calls `SetValue(text)` alone (not `SetValue(before + text)`) so modern WinUI controls like Win11 Notepad's `RichEditD2DPT` get true replace semantics; the clipboard-paste fallback sends Ctrl+A before Ctrl+V. The activated-target / no-target SendInput paths use native Ctrl+A + Delete. On macOS: Cmd+A + Delete via SendInput. Check `details.diagnostic.strategy` — `*_replace` suffix confirms the replace path fired. |
687
- | `delayMs` | number | **S2/2.6** — Inter-key delay in ms. Default 0 (fastest). Honored on SendInput paths (no-target OR activated target). Ignored on the PostMessage burst path. Raise to 20-50 ms for per-keystroke validation / IME fields that coalesce fast input; 100+ simulates human typing. |
688
- | `ime` | boolean | **S8/5.3** — Route through the layout-independent Unicode primitive (Windows `SendInput` + `VK_PACKET`; macOS `CGEventKeyboardSetUnicodeString`) instead of layout-aware nut-js. Required for Japanese / Korean / Chinese (JKC) and other non-Latin text the default path drops or misrenders. V1 delivers COMPLETED Unicode only — no TSF / WM_IME_COMPOSITION composition-window simulation. Honored on the SendInput paths; no-op on the Windows focus-free PostMessage path (WM_CHAR already carries Unicode there). Verify via `details.mode === "sendinput-unicode"` in the response. |
689
- | `humanize` | `off` / `light` / `human` / `paranoid` | Per-call override of the global `humanInputDefault` setting (default `light`). `off` sends machine-fast SendInput; `light` adds gamma-distributed inter-key delays so timing rhythm varies; `human` cranks delays + bigram timing to ~3-5x slower for CAPTCHA / banking / Cloudflare-Turnstile flows; `paranoid` goes to ~5-10x with longer pauses. **IGNORED when `delayMs` is set explicitly** — the caller asked for that exact pacing. Cross-platform (Windows + macOS via the same nut-js per-char path). Not a substitute for browser stealth: this only addresses keystroke timing, not TLS / canvas / CDP fingerprints. |
690
- | `window` / `processName` / `hwnd` | string | Target window (see superbased_click). Never chain `superbased_focus_window` before this. |
691
- | `restoreFocus` | boolean | Default true — AttachThreadInput + verify + retry. |
692
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — auto-returns post-type PNG inline. `full` adds OCR + AX `textElements`. `none` suppresses. |
693
-
694
- #### superbased_hotkey
695
- Send a keyboard shortcut. Combo strings like `"Cmd+A"`, `"Ctrl+Shift+P"`, `"Tab"`, `"F5"`. `"Cmd"` / `"Meta"` / `"Win"` / `"Super"` auto-map to the platform mod key. `"CmdOrCtrl"` resolves to Cmd on macOS and Ctrl elsewhere. App-level shortcuts (Ctrl+Tab, Win+V) only fire via global SendInput — omit `window` / `processName` for those.
696
-
697
- **Delivery (S1/1.1)**: Windows automatically picks PostMessage (focus-free, fast — for classic Win32 controls like Explorer, Edit / Rich-Edit dialogs) OR activate+SendInput (for browsers, Electron apps, modern WPF — Chrome, Edge, VS Code, Discord, Slack, Notion, Obsidian, Figma, Spotify, SuperBased itself, **and Win11 Notepad** which is WinUI 3 and silently drops PostMessage WM_KEYDOWN just like Chromium). The classifier picks based on the resolved target's `processName`. Override via `method:"postmessage"|"sendinput"` when the classifier guesses wrong. Returns `details.method` = the actual delivery used + `details.classifier` = what the classifier would have picked.
698
-
699
- | Parameter | Type | Description |
700
- |-----------|------|-------------|
701
- | `combo` | string | Key combo string |
702
- | `confirm` | boolean | Required unless disabled |
703
- | `window` / `processName` / `hwnd` | string | Target window (see superbased_click). Never chain `superbased_focus_window` before this. |
704
- | `method` | `auto` / `postmessage` / `sendinput` | **S1/1.1** — Default `auto`: classifier picks PostMessage for classic Win32, SendInput for browsers/Electron. `postmessage` forces focus-free (fast, no flicker, but TARGET_HOSTILE on modern apps). `sendinput` forces activate+OS-level keystroke (works everywhere, ~200ms focus steal). macOS: ignored — uses CGEventPost. |
705
- | `restoreFocus` | boolean | Default true. |
706
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — auto-returns post-hotkey PNG inline. `full` adds OCR + AX `textElements`. `none` suppresses. |
707
-
708
- **Error codes** (in `errorCode` on `ok: false`): `WINDOW_NOT_FOUND`, `TARGET_HOSTILE` (PostMessage delivered but the target's message loop ignored it — typical for browsers / Electron / modern WPF when `method: 'postmessage'` was forced; switch to `'sendinput'`), `ACTIVATION_FAILED` (target couldn't be brought to foreground for the SendInput path), `SESSION_LOCKED`, `ELEVATION_REQUIRED`, `UNSUPPORTED_PLATFORM`.
709
-
710
- **Target quirks — Win11 Notepad ribbon focus**: when `activate+SendInput` brings Win11 Notepad to the foreground, keyboard focus lands on the ribbon's **File** button, not the editor body. Any `Ctrl+<letter>` chord (Ctrl+A, Ctrl+S, Ctrl+Z) opens the File menu instead of operating on the text. This is intrinsic to the Notepad WinUI 3 design — no adapter fix possible. **Workaround**: `superbased_click` into a known-empty spot inside the editor body (e.g., anywhere below the toolbar, mid-window) with `restoreFocus:false` to land focus inside the document, then send `Ctrl+<letter>` hotkeys with `restoreFocus:false` on each follow-up call so activation doesn't re-steal focus. Applies to `superbased_type` fallbacks that route through the SendInput path too.
711
-
712
- #### superbased_scroll
713
- **Calibrated, anchor-aware scroll** — same algorithm SuperBased's auto-scroll-capture uses for long-page stitched screenshots. On first use per hwnd, measures pixels-per-tick by scrolling 3 ticks and running strip-correlation on pre/post frames (~600-900 ms one-time cost, cached 10 min). Subsequent calls use the cached measurement to scroll exactly one viewport per `unit: "page"` with 10% overlap. Delivery is Win32 `mouse_event` wheel on Windows (bypasses nut-js synthetic wheel events that Electron/React scroll containers drop silently).
714
-
715
- **Anchor is critical for target windows with multiple containers** (sidebar + content, list + detail). Windows routes wheel events to the window under the cursor, so without `anchorX` / `anchorY`, the scroll fires wherever the cursor last happened to sit — usually the last-clicked element (a sidebar row), not the content panel you want to page.
716
-
717
- **Workflow**:
718
- 1. `superbased_ui_dump` to get `textElements` with `center.{x,y}` in the container you want to scroll.
719
- 2. Pick a visual anchor inside that container (often an empty area or the first element).
720
- 3. `superbased_scroll amount=1 unit="page" anchorX=<x> anchorY=<y> processName="MyApp" confirm=true` — scrolls one viewport inside the right container.
721
- 4. Read `details.atEnd` from the response; stop the loop when `true`.
722
-
723
- **ATEND SIGNAL**: `details.atEnd = true` when pre/post screenshots are >95% similar (viewport didn't move = hit end of content). Terminate pagination loops on this flag.
724
-
725
- | Parameter | Type | Description |
726
- |-----------|------|-------------|
727
- | `amount` | number | Interpreted per `unit`. Positive = down (axis='y') / RIGHT (axis='x'), negative = up / LEFT. |
728
- | `unit` | `ticks` / `page` / `line` | Default `ticks` (legacy wheel ticks). **Prefer `page` for agent pagination** — `amount: 1` = one CALIBRATED viewport (Win32 wheel, with per-hwnd pixels-per-tick cache). `line` = arrow-key nudges. |
729
- | `axis` | `y` / `x` | **S2/2.5** — Default `y` (vertical). `x` uses Windows `MOUSEEVENTF_HWHEEL` (with Shift+Wheel fallback) so real horizontal-scroll bars (Excel, wide tables, Chromium horizontal overflow) actually move. `unit='page'` + `axis='x'` falls back to tick count (calibration is vertical-only); `unit='line'` + `axis='x'` uses Right/Left arrows. |
730
- | `anchorX` | number | Physical screen X where the cursor moves before scrolling. Pass a point INSIDE the scroll container you want to page. |
731
- | `anchorY` | number | Physical screen Y for the anchor. See `anchorX`. |
732
- | `recalibrate` | boolean | Force a fresh calibration even if the cache has a valid entry. Use after resizing / re-laying-out the target window. |
733
- | `confirm` | boolean | Required unless disabled |
734
- | `window` / `processName` / `hwnd` | string | Target window (see superbased_click). |
735
- | `restoreFocus` | boolean | Default true. |
736
- | `method` | `wheel` / `keys` / `auto` | Default `auto`. Windows+hasTarget: Win32 mouse_event wheel. `keys` forces keyboard-only (unreliable on Electron — keyboard focus may be elsewhere). |
737
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
738
-
739
- **Response `details`**:
740
- - `unit` — echo of what was used
741
- - `ticksIssued` — actual wheel ticks sent to the OS (for `unit: "page"` this is the calibrated count)
742
- - `calibration` — `{ pixelsPerScroll, score, windowHeight, cacheHit, measured }` on success, `{ error }` on failure (fallback: ~18 ticks per page)
743
- - `atEnd` — bool
744
- - `anchor` — echo of `{ x, y }` if supplied
745
-
746
- **Pagination loop**:
747
- ```
748
- # First find a good anchor inside the content panel (e.g. from ui_dump)
749
- superbased_ui_dump processName="MyApp" → textElements; pick one in the content panel
750
- anchor = { x: elem.center.x, y: elem.center.y }
751
-
752
- while not atEnd:
753
- result = superbased_scroll amount=1 unit="page" anchorX=anchor.x anchorY=anchor.y processName="MyApp" confirm=true
754
- atEnd = result.details.atEnd
755
- ```
756
-
757
- #### superbased_resize_window (S1/1.2)
758
- Resize a target window to a device preset OR custom width × height. Windows (S1) + macOS (S9 — AX `set size` + `set position` via osascript; AXFullScreen sentinel). Auto-invalidates the scroll-calibration cache for the target since `pixelsPerScroll` depends on viewport height.
759
-
760
- **Use cases**: responsive-design testing (resize Chrome to phone/tablet sizes before screenshot), arrange windows for a comparison shot, set a known viewport before walking a long page, **moving a window to an exact pixel position** (pass `x` + `y` alongside `width` + `height`, OR pass `x` + `y` with the window's current size read via `superbased_window_bounds`).
761
-
762
- **Prefer this over `superbased_drag` for any window-move intent.** Dragging a window's title bar is fragile on modern apps: Win11 Notepad / Chrome / Edge / VS Code have tab-container title bars where presses land on tabs (becomes a tab-drag, not a window-drag); Win11 aero-snap at screen corners / edges turns exact-pixel drops into half/quarter snaps; and safe-pickup zones vary per app. `resize_window` calls `SetWindowPos` directly — exact placement, no DWM interception, no target-specific pickup reconnaissance. See `superbased_drag` notes for the full failure taxonomy.
763
-
764
- | Parameter | Type | Description |
765
- |-----------|------|-------------|
766
- | `preset` | enum | `iphone-se` (375×667) / `iphone-12` (390×844) / `iphone-pro-max` (430×932) / `pixel-7` (412×915) / `ipad-mini` (768×1024) / `ipad` (820×1180) / `ipad-pro-11` (834×1194) / `ipad-pro-13` (1024×1366) / `desktop-hd` (1920×1080) / `desktop-qhd` (2560×1440) / `fullscreen` (SW_MAXIMIZE) / `custom` (requires `width` + `height`). |
767
- | `width` | number | Width in pixels. Required for `preset:"custom"`. Ignored for `preset:"fullscreen"`. |
768
- | `height` | number | Height in pixels. Required for `preset:"custom"`. Ignored for `preset:"fullscreen"`. |
769
- | `x` | number | Optional X reposition (virtual-screen logical pixels). Omit to keep current position. |
770
- | `y` | number | Optional Y reposition. |
771
- | `contentArea` | boolean | Default false. **Set true for browser device-emulation** — the OUTER window grows so the CLIENT area matches `width × height` (accounts for titlebar + borders + tabstrip; Chrome on Win10 has ~8px borders + ~70px tabstrip, so an "iphone-12" outer window renders a 374×774 viewport without this flag). |
772
- | `confirm` | boolean | Required unless disabled |
773
- | `window` / `processName` / `hwnd` | string | Target window (required — pick via `superbased_window_list` or scored matcher). |
774
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — auto-returns post-resize PNG. |
775
-
776
- **Returns**: `{ok, details:{preset, requested:{width,height}, actual:{x,y,width,height}, contentArea, fullscreen}, observation}`. `actual` is read back from `GetWindowRect` post-resize so the agent can verify what landed (some windows refuse exact dims; legacy DPI-virtualized apps round to the nearest scale step).
777
-
778
- #### superbased_display_list (S4/3.6)
779
- Enumerate all connected displays. Returns each display's virtual-screen bounds, DPI scale, primary flag, color space, and platform id. Use BEFORE targeting a non-primary monitor — the returned `bounds` are in the SAME virtual-screen coordinate frame that every positional tool uses (click / type / drag / hover / find_image / screenshot region / etc.), so feed a display's `bounds` straight into `region:` for capture / search, or pass `id` into `superbased_window_state action:"move_to_display"` to re-home a window.
780
-
781
- **Virtual-screen policy** (design principle 12): every coord in the SuperBased MCP surface is virtual-screen logical units — top-left origin, Windows DPI-logical pixels / macOS Quartz points. Primary at `(0, 0)`. A secondary display to the LEFT of primary sits at negative X; to the RIGHT at X ≥ primary.width. There is NO `display?: number` half-measure on positional tools: learn coords from `display_list` and pass them through directly. Screenshot-like tools accept `display?` only as a "capture just this display" convenience — returned coords stay virtual-screen.
782
-
783
- No parameters. No safety gate (read-only enumeration). Cross-platform (Windows + macOS both work today via Electron's `screen` module).
784
-
785
- | Field | Type | Description |
786
- |-------|------|-------------|
787
- | `id` | number | Platform display id. Feed into `window_state action:"move_to_display"`. |
788
- | `primary` | boolean | True for the primary display. |
789
- | `bounds` | `{x,y,width,height}` | Virtual-screen bounds. |
790
- | `scaleFactor` | number | 1.0 / 1.25 / 1.5 / 2.0 / 3.0 (Retina). Templates captured at one scale will not match at another — see `superbased_find_image` metadata guards. |
791
- | `name` | string | Platform-provided display name (when available). |
792
- | `colorSpace` | `srgb` / `display-p3` / `unknown` | Approximate color space. |
793
-
794
- #### superbased_find_image (S4/3.5)
795
- Visual template match — locate a small PNG template (icon, button, logo, glyph) on screen. Returns `matches: [{x, y, width, height, center:{x,y}, confidence}]` in virtual-screen coords, top-confidence first. Use when AX / OCR rungs of the reliability pyramid fall short: pixel-perfect button-shaped matches in a canvas or game UI, PDF viewers, color-keyed state indicators, any surface where there's no accessibility tree and OCR misses. ALSO unblocks the `locate:{imageTemplate:"<path>"}` resolver across click / type / drag / hover / scroll / sequence — capture once, reuse anywhere. Pass EITHER `templateBase64` (inline PNG) OR `templatePath` (filesystem path; `.meta.json` sidecar auto-loaded). Algorithm: pure-JS downsampled grayscale NCC (Rec. 601). Cost ~200-800 ms on typical viewports; shrinks with `region`.
796
-
797
- **Metadata guards** (the reason to always pair with `superbased_capture_template`): the sidecar records the DPI scale + theme at capture time. `find_image` REFUSES matches under different DPI or theme by default — a template captured at 125% scaling / dark-mode will not silently drift when the system flips to 100% / light-mode. Override with `ignoreDpiScale:true` / `ignoreTheme:true` only when the template is robust to the difference (vector-icon captures at multiple scales, brand logos not affected by theme).
798
-
799
- | Parameter | Type | Description |
800
- |-----------|------|-------------|
801
- | `templateBase64` | string | Inline base64 PNG. Pass this OR `templatePath`. |
802
- | `templatePath` | string | Filesystem path to a PNG. `<path>.meta.json` auto-loaded when present. |
803
- | `region` | `{x,y,width,height}` | Virtual-screen rect to search. Recommended: constrain when approximate location is known. |
804
- | `threshold` | number | NCC confidence floor ∈ [0, 1]. Default 0.85. 0.95 = near-identical; 0.75 = antialiasing-tolerant. |
805
- | `multi` | boolean | Default false (top-1). Set true to return all non-overlapping matches ≥ threshold (count instances, enumerate rows). |
806
- | `maxMatches` | number | Cap in multi mode. Default 10. |
807
- | `ignoreDpiScale` | boolean | Default false — refuse mismatched DPI. |
808
- | `ignoreTheme` | boolean | Default false — refuse mismatched theme. |
809
- | `maxSearchDim` | number | Longer-side downsample budget for the NCC pass. Default 400. Rarely needs changing. |
810
- | `confirm` | boolean | Required unless disabled. **Note**: `actions.findImage` toggle defaults ON (pure screen-read). |
811
-
812
- **Sequence step variant** — with `name` set, the top match's center is recorded in `runtime.history` so subsequent steps can `locate:{relative:{to:name, dx, dy}}`:
813
- ```
814
- { action:"find_image", name:"saveBtn", templatePath:"/tmp/save.png", region:{x:0,y:0,width:1920,height:1080} }
815
- { action:"click", locate:{relative:{to:"saveBtn", dx:0, dy:0}} }
816
- ```
817
-
818
- #### superbased_capture_template (S4/3.5)
819
- Capture a virtual-screen region to a PNG + write a `<path>.meta.json` sidecar recording DPI scale, theme, source bounds, displayId, and timestamp. **Always use this to produce templates** — hand-cropped PNGs without metadata will fail `find_image`'s metadata guard unless the caller explicitly passes `ignoreDpiScale:true` / `ignoreTheme:true`. Default destination: `~/.superbased/templates/<tag>-<timestamp>.png`. Returns `{ok, details:{path, metaPath, dpiScale, theme, width, height, sourceRect, tag}}`.
820
-
821
- | Parameter | Type | Description |
822
- |-----------|------|-------------|
823
- | `region` | `{x,y,width,height}` | Virtual-screen rect to capture. Required. |
824
- | `destPath` | string | Absolute PNG path. Default `~/.superbased/templates/<tag>-<timestamp>.png`. Parent dir auto-created. |
825
- | `tag` | string | Short human-readable tag. Used in default filename + stored in metadata. E.g. "save-btn", "nav-settings". |
826
- | `displayId` | number | Resolve via `superbased_display_list` (S4/3.6). Stored in metadata for cross-monitor checks. |
827
- | `confirm` | boolean | Required unless disabled. **Note**: `actions.findImage` toggle defaults ON. |
828
-
829
- #### superbased_window_state (S3/3.1)
830
- Change a target window's state — minimize / maximize / restore (un-minimize or un-maximize) / close / always-on-top (on / off / toggle) / move-to-display. One approval for the whole action; `close` adds a secondary gate (`actions.destructive`, defaults OFF) since close can lose unsaved work. Windows (S3) + macOS (S9). Windows routes through `PlatformWindowAdapter.setState` → `ShowWindow` / `PostMessage(WM_CLOSE)` / `SetWindowPos(HWND_TOPMOST|NOTOPMOST)`; `always_on_top_toggle` reads `GWL_EXSTYLE` inline and flips; `move_to_display` restores if maximized, centers on the target display (clamps window size to display bounds), then re-maximizes if it started maximized. macOS drives AX via osascript (AXMinimized attribute for minimize/restore, click button 1 for close, set position / set size for move + maximize to display bounds). `always_on_top_on|off|toggle` return `UNSUPPORTED_PLATFORM` on macOS — AX exposes no AXAlwaysOnTop attribute; private CGSInternal APIs would be required.
831
-
832
- **Use cases**: programmatically maximize a browser before a screenshot sweep, pin a log viewer always-on-top during a long-running capture, move a dev-tools window to a secondary monitor before interacting with the main-monitor app, close a stray dialog mid-sequence.
833
-
834
- | Parameter | Type | Description |
835
- |-----------|------|-------------|
836
- | `action` | enum | `minimize` / `maximize` / `restore` / `close` / `always_on_top_on` / `always_on_top_off` / `always_on_top_toggle` / `move_to_display`. `close` requires `guiAutomation.actions.destructive` to be ON. |
837
- | `displayId` | number | Required for `action:"move_to_display"`. Resolve via `superbased_display_list` (S4/3.6) or `platform.capture.enumerateDisplays()`. |
838
- | `confirm` | boolean | Required unless disabled. Master toggle: `guiAutomation.actions.windowManage` (defaults ON). |
839
- | `window` / `processName` / `hwnd` | string | Target window (required). |
840
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` for maximize/restore/always-on-top/move-to-display; forced `none` for close/minimize (target no longer visible). |
841
-
842
- **Sequence step variant**: `{ action:"window_state", state:"maximize", target:"chrome" }`. `state:"close"` in a sequence is refused at pre-flight if the `destructive` toggle is OFF. `isStateChangingAction` flags `window_state` so the locate cache is auto-invalidated after the step runs.
843
-
844
- #### superbased_launch_app (S3/3.2)
845
- Start a process (path/name) or open a URL via ShellExecute (Windows) or `/usr/bin/open` (macOS). Pass EXACTLY ONE of `{ path, name, url }`. Two gates: `actions.launch` (default OFF) AND `guiAutomation.launchAllowlist` (empty default = deny-all). Allowlist forms: plain substring (case-insensitive against resolved path/name/url), or `"sha256:<hex>"` binary-hash pin for path mode (file is hashed at call time — recommended for password managers + other sensitive binaries since attackers can't swap the file without updating the pin). Path mode resolves to absolute BEFORE allowlist match. Optional `waitForWindow: true` polls `listWindows()` for the launched app to appear (matches on `processName` + `titleMatch`, derived from path basename / name by default). Windows (S3) + macOS (S9 — `open -a <name>` / `open <path>` / `open <url>`; processId returns 0 since open doesn't surface PID, so callers should use `waitForWindow` to resolve the window handle).
846
-
847
- **Use cases**: chain `launch_app + focus_window + screenshot` to snap a freshly-started app's initial state, launch a text editor with a prepared file path, open a specific URL in the user's default browser for a demo.
848
-
849
- | Parameter | Type | Description |
850
- |-----------|------|-------------|
851
- | `path` | string | Absolute or relative path to exe/document. Resolved to absolute before allowlist match. |
852
- | `name` | string | App name resolvable via PATH (`notepad`, `code`). |
853
- | `url` | string | HTTP/HTTPS URL — opens in default browser. |
854
- | `args` | array | Arguments passed to the process (ignored for URL mode). |
855
- | `workingDir` | string | Working directory. Ignored for URL mode. |
856
- | `waitForWindow` | boolean | When true, polls for launched app's window (matches processName + titleMatch, derived from path basename / name unless overridden). |
857
- | `timeoutMs` | number | waitForWindow deadline. Default 5000. |
858
- | `processNameMatch` | string | Override the derived processName needle for waitForWindow. |
859
- | `titleMatch` | string | Title substring needle for waitForWindow. |
860
- | `confirm` | boolean | Required unless disabled. **Note**: `actions.launch` toggle defaults OFF AND the allowlist defaults to empty — both must be explicitly configured by the user. |
861
- | `returnObservation` | `none` / `screenshot` / `full` | Default `none` — freshly-launched apps may still be loading. |
862
-
863
- **Returns**: `{ok, details:{target, targetKind:'path'|'name'|'url', pid, allowlistEntry, window?:{title,processName}}, observation}`. When `waitForWindow:true` and the window doesn't appear within `timeoutMs`, returns `ok:false errorCode:"TIMEOUT"` — the process is still running, but the tool gives up waiting.
864
-
865
- **Sequence step variant**: `{ action:"launch_app", path:"C:/bin/app.exe", waitForWindow:true }`. Does NOT mutate `runtime.handle` — follow up with `superbased_focus_window` or use `targets[]` with the launched app's processName for subsequent steps.
866
-
867
- #### superbased_find_title_bar_drag_region (P26 + P27)
868
- Resolve a safe pickup coordinate for generic title-bar drag on a target window. **Pure query** — no activation, no input injected. Runs `ui_dump` internally (AX tree + OCR; ~1-3s) and returns the midpoint of the widest interactive-free horizontal strip in the window's title-bar band.
869
-
870
- **Use this BEFORE `superbased_drag` when the goal is to move a window.** Win11 WinUI 3 title bars are tab-container owned and have resize-frame hit-test zones extending 8-15px inside the visible edges, so fixed-coord recipes like `(bounds.x+10, bounds.y+15)` are unreliable — this tool walks the AX tree (preferred) or the OCR text-element list (fallback) for you and returns coords that lie outside every interactive element in the title bar.
871
-
872
- **Dual source:** the tool prefers the AX tree (precise role-based classification; `source:"ax"`, confidence 1.0) and falls back to OCR (treats every title-bar text element as an exclusion; `source:"ocr"`, confidence 0.8) when the `@superbased/win-uia` binding isn't installed. The OCR path reserves 140px on the right of the band for the min/max/close cluster since OCR can't detect vector-glyph buttons.
873
-
874
- | Parameter | Type | Description |
875
- |-----------|------|-------------|
876
- | `window` / `processName` / `hwnd` | string | Standard window targeting (see `superbased_click`). Same precedence: `hwnd` > `processName` > `window`. |
877
-
878
- **Returns on success**: `{ok, details: { hwnd, bounds:{x,y,width,height}, pickup:{x,y}, gap:{x1,x2,widthPx}, source:"ax"|"ocr", matchedWindow, axAvailable, axNodeCount, ocrElementCount }}`. Feed `pickup.x` / `pickup.y` straight into `superbased_drag` as `fromX` / `fromY`.
879
-
880
- **Returns `ok:false` with `errorCode:"DRAG_NO_SAFE_PICKUP"`** when BOTH sources fail — AX path couldn't classify and OCR couldn't find a ≥30px clean gap. In that case the drag WILL fail; use `superbased_resize_window({x, y, width, height, hwnd})` for placement instead (SetWindowPos bypasses the drag surface entirely). Do NOT attempt a heuristic drag after DRAG_NO_SAFE_PICKUP — every fixed-coord recipe breaks somewhere (resize frame / tab strip / aero-snap).
881
-
882
- **Usage pattern**:
883
- ```
884
- const { details: { bounds, pickup } } = await find_title_bar_drag_region({ hwnd });
885
- await drag({ hwnd, fromX: pickup.x, fromY: pickup.y, toX: DROP_X, toY: DROP_Y });
886
- ```
887
- Keep drops ≥200px from any screen edge so Win11 aero-snap doesn't intercept them.
888
-
889
- #### superbased_drag (S1/1.3 + S3/3.3 path)
890
- Drag from `(fromX, fromY)` to `(toX, toY)` — or along a multi-point waypoint path. Press → interpolate → release. Modifiers wrap the entire drag. Built from primitives (not nut-js's atomic `.drag()`) so drag-sensitive UIs — Chromium DnD, draggable React components — receive the press → sustained move → release sequence they need. **3.3**: accepts `path: [{x, y, atMs?}]` waypoints for non-linear trajectories (signature-style drags, curved reorder gestures, chain selection, shape-drawing). Per-waypoint `atMs` paces segments unevenly. When `path` is provided AND `fromX/Y/toX/Y` are set, waypoints are inserted BETWEEN start and end. When `path` is provided WITHOUT from/to, the path is used as-is (must have ≥2 waypoints).
891
-
892
- **Use cases**: reorder list items (drag row from position 3 to position 1), resize via a handle, move sliders, drag files into a drop zone (HTML5 DnD on websites works since real OS-level mouse events fire `dragstart` / `dragend`), Ctrl+drag to copy in Explorer / Finder, signature-style drawing in a canvas, multi-column column-reorder in a table.
893
-
894
- **Do NOT use `superbased_drag` to move a window to a new screen position.** Use `superbased_resize_window({x, y, width, height})` instead. Dragging a window's title bar works on classic Win32 apps (Notepad Win10, regedit, mspaint) but fails on three increasingly-common modern-app patterns: **(a) tab-container title bars** (Win11 Notepad, Chrome, Edge, VS Code — the entire "title bar" is actually a tab strip; any press-move inside it becomes a tab-drag, not a window-drag, and the tab tears off or no-ops instead of moving the window), **(b) Win11 aero-snap corner interception** (a drag that ENDS near `(0, 0)` / screen edges / corners triggers DWM's snap-to-quarter gesture — Windows un-maximizes AND snaps to half/quarter screen, not to the literal drop coordinate), and **(c) variable safe-pickup zones** (every modern app's title bar has idiosyncratic non-draggable widgets — window controls, extension icons, profile pills — and finding a reliable pickup point requires per-app ui_dump reconnaissance). `resize_window` bypasses all of this — it calls `SetWindowPos` directly, honors exact pixel placement, and isn't intercepted by DWM. For exact window positioning, always prefer the explicit primitive.
895
-
896
- **If you MUST drag a window** (simulating a real user's gesture, or the caller explicitly asked for drag not resize), **call `superbased_find_title_bar_drag_region({ hwnd })` FIRST** and feed its returned `pickup.x` / `pickup.y` into `drag` as `fromX` / `fromY`. That tool does the AX-tree walk internally and returns a coord that lies outside every interactive element in the title bar — skip the manual `ui_dump` + AX-filter dance.
897
-
898
- There is no universal fixed-coord pickup heuristic that works on Win11 WinUI 3 title bars. The draggable surface varies per app / per open-tab-count / per DPI scale, and the common `(bounds.x+N)` recipes all break somewhere:
899
-
900
- - Pickup within 8-15px of any window edge → hits the **resize-frame hit-test zone** (invisible border inside the visual edge; the margin is ~10px at 100% DPI and grows proportionally with scale factor, so bounds.x+10 is already inside it at 125%+). Drag stretches the window instead of moving it.
901
- - Mid-title-bar (bounds.x + width/2) → hits a **tab header** on any app with >1 tab open (Notepad / Chrome / Edge / VS Code). Drag becomes a tab-drag or no-op.
902
- - Between last tab and window controls → variable-width strip; position depends on open-tab-count and window-control visibility; can't be computed from bounds alone.
903
-
904
- If `find_title_bar_drag_region` returns `DRAG_NO_SAFE_PICKUP` (AX unavailable OR every candidate strip covered by interactive elements), **switch to `superbased_resize_window`**. Its `SetWindowPos` path bypasses the resize-frame / tab-container / aero-snap stack entirely. Either way, pair the drop with **≥200px from any screen edge** — Win11 aero-snap intercepts drops near corners / edges and rewrites them to half / quarter snap zones, or cancels into the maximize preview near the top edge.
905
-
906
- **Win11 aero-snap interference** (applies to both `drag` on windows AND the rare cases where you legitimately need drag to end at a screen edge): drops near the four screen corners or edges trigger Windows' snap-layouts gesture, which repositions the target to a half/quarter screen instead of the literal drop coord. Mitigations: route the drag through a mid-screen waypoint first, keep the final drop ≥200px from any screen edge, or switch to `resize_window` when the goal is exact placement.
907
-
908
- | Parameter | Type | Description |
909
- |-----------|------|-------------|
910
- | `fromX` | number | Start X (virtual-screen logical pixels). Optional when `path` has ≥2 waypoints. |
911
- | `fromY` | number | Start Y. |
912
- | `toX` | number | End X. |
913
- | `toY` | number | End Y. |
914
- | `path` | array | Waypoints `[{x, y, atMs?}]` inserted between from/to (or used as-is in path-only mode). `atMs` = target elapsed ms from drag start; missing atMs = equal time-slicing across `durationMs`. |
915
- | `durationMs` | number | Total drag duration. Default 200. Drag-sensitive UIs (Chromium DnD) want 150-300 ms with intermediate moves. Ignored per-segment when atMs is on every waypoint. |
916
- | `steps` | number | Intermediate move events per segment. Default 10. Higher = smoother for animation-tracking UIs. |
917
- | `button` | `left` / `right` | Default `left`. Right-button drag is rare but used by some file managers (drag-with-context-menu on drop). |
918
- | `modifiers` | array | `["shift"]` / `["ctrl"]` / etc. — held during the entire drag. E.g. `["ctrl"]` for Ctrl+drag (copy in Explorer / Finder). |
919
- | `confirm` | boolean | Required unless disabled. **Note**: `actions.drag` toggle defaults OFF — user must enable. |
920
- | `window` / `processName` / `hwnd` | string | Target window (see superbased_click). When given, runs inside `withActivatedWindow` so focus restores post-drag. |
921
- | `restoreFocus` | boolean | Default true. |
922
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
923
- | `humanize` | `off` / `light` / `human` / `paranoid` | Per-call override of the global `humanInputDefault` setting (default `light`). Substitutes each linear segment with a Bezier curve — perpendicular jittered control points + optional overshoot/pullback at the endpoints. `off` keeps linear paths; `light` adds modest curvature (1 control point); `human` adds 2 control points + 15% overshoot; `paranoid` adds 3 + 40% overshoot. **Windows pre/post-press dwells (20/50/100/50ms) stay intact regardless of profile** — they live inside the platform adapter, outside the path the wrapper sees. Cross-platform (macOS adapter walks the same waypoint array; macOS has no platform-level dwells, by design). |
924
-
925
- **Pixel-precise drags (puzzle pieces, slider CAPTCHAs, jigsaw verifications) — drop humanization to `off` or `light`.** `human` and `paranoid` add overshoot+pullback (15% / 40% probability) AND target jitter (3.0 / 4.5 px gaussian on the drop coords) — both of which sabotage placement when the puzzle needs you to land in a ±3px tolerance zone. `light` keeps the curve (defeats linear-trajectory classifiers) but disables overshoot AND has the smallest target jitter (1.5 px). For the very tightest CAPTCHAs (1-2px tolerance), use `humanize: "off"` — accept the linear trajectory tell in exchange for landing on target. **Pattern**: try `humanize: "light"` first; if the puzzle rejects, observe the gap with a follow-up screenshot and either (a) drop to `humanize: "off"` for a retry, or (b) issue a small corrective drag (e.g. `fromX=current, toX=target, durationMs=120`) and screenshot again. Don't keep retrying with `human`/`paranoid` — the overshoot keeps overshooting.
926
-
927
- **Sequence step variant** supports `fromLocate` / `toLocate` for drag-by-label without coords, plus the 3.3 `path` waypoints:
928
- ```
929
- { action:"drag", fromLocate:{label:"Inbox row 3"}, toLocate:{label:"Archive folder"}, modifiers:["shift"] }
930
- { action:"drag", path:[{x:100,y:200},{x:200,y:150,atMs:150},{x:300,y:300,atMs:400}] }
931
- ```
932
-
933
- #### superbased_context_menu_select (S1/1.4)
934
- Right-click at `(x, y)` → wait for the context-menu popup → click the menu item matching `menuItemText`. ONE approval covers the whole flow (vs the 4-call dance: right-click + ui_dump + locate + click). The full flow runs INSIDE the target's activation window so the popup stays open until the item is clicked.
935
-
936
- **Match rules**: prefers exact text over substring; ties broken by shortest item text. `caseSensitive: false` by default.
937
-
938
- **Platform**: Windows (S1 — EnumWindows diff + ui_dump of the popup hwnd) + macOS (S9 — osascript polls for an AXMenu of the frontmost process, then AXPress on the matched item by title).
939
-
940
- **Limitations**: returns `errorCode: "CONTEXT_MENU_NOT_DETECTED"` when the popup is invisible to the detection pass — on Windows typical for WPF / WinUI custom-drawn menus (Visual Studio editor menus are rendered inside the host window, not as separate hwnds), shell-IContextMenu integrations (Explorer right-click → "explorer.exe"-owned popups), and ownerless popups; on macOS typical for Electron apps with custom menu rendering and Chromium browser page menus (render outside the AX hierarchy). On those, fall back to fullscreen `superbased_ui_dump` + `superbased_click` on the matched item.
941
-
942
- | Parameter | Type | Description |
943
- |-----------|------|-------------|
944
- | `x` | number | Right-click X (virtual-screen logical pixels). |
945
- | `y` | number | Right-click Y. |
946
- | `menuItemText` | string | Text of the menu item to click (matched against OCR + AX text in the popup). |
947
- | `caseSensitive` | boolean | Default false. |
948
- | `timeoutMs` | number | How long to wait for the popup to appear after the right-click. Default 2000ms; bump for slow apps. |
949
- | `confirm` | boolean | Required unless disabled. **Note**: `actions.contextMenu` toggle defaults ON. |
950
- | `window` / `processName` / `hwnd` | string | Target window. Required when targeting non-foreground. |
951
- | `restoreFocus` | boolean | Default true. |
952
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
953
-
954
- **RELATED**: `superbased_click button:"right" returnObservation:"screenshot"` now attaches `observation.contextMenu: { hwnd, bounds }` automatically when a popup is detected — use that to *inspect* the menu items first (e.g. `superbased_ui_dump hwnd=<that hwnd>`); use `superbased_context_menu_select` when you already know which item to click.
955
-
956
- #### superbased_hover (S2/2.2)
957
- Move the cursor to `(x, y)` — or a resolved UI element — and dwell for `dwellMs` so tooltips and hover-reveal UIs render before the caller's next action. No button press. Accepts `label` / `automationId` / `role + name` via the same reliability pyramid as `superbased_click`.
958
-
959
- **Use cases**: reveal tooltip text before `superbased_ui_dump`, trigger hover-only dropdown previews, make hidden toolbar buttons visible, populate tab-switcher cards.
960
-
961
- | Parameter | Type | Description |
962
- |-----------|------|-------------|
963
- | `x` / `y` | number | Absolute virtual-screen logical pixels. Pass EITHER `x+y` OR one of the resolver fields. |
964
- | `label` / `automationId` / `role` / `name` / `caseSensitive` | string / bool | Resolver fields (same semantics as superbased_click). |
965
- | `dwellMs` | number | How long to dwell after the move. Default 0. Set 400-800 ms for tooltips; some apps need 1000-1500. Counted against `superbased_sequence` `maxDurationMs` budget. |
966
- | `confirm` | boolean | Required unless disabled. `actions.hover` toggle defaults ON. |
967
- | `window` / `processName` / `hwnd` | string | Target window. |
968
- | `restoreFocus` | boolean | Default true. |
969
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — so the tooltip is visible in the returned PNG. |
970
- | `humanize` | `off` / `light` / `human` / `paranoid` | Per-call override of the global `humanInputDefault` setting. When non-`off`, the cursor follows a Bezier curve from its current position to `(x, y)` BEFORE the dwell starts — useful for hover-reveal UIs that watch for natural-looking approach paths (some tooltips suppress on teleport-then-stop heuristics). Move skipped for tiny hops (<4px). Cross-platform. |
971
-
972
- Sequence step: `{ action:"hover", x, y, dwellMs }` OR `{ action:"hover", locate:{...}, dwellMs }`.
973
-
974
- #### superbased_pixel_color (S2/2.4)
975
- Read the RGBA of a single pixel at virtual-screen `(x, y)`. Pure screen-read; no input injection. Pass `expected: "#RRGGBB"` + optional `tolerance` to get an automatic `matches` boolean in the response.
976
-
977
- **Use cases**: verify visual state that text/AX can't express (dark-mode vs light-mode toggle, status LEDs in toolbars, tab-active highlight colors, progress-bar fill, canvas inspection).
978
-
979
- **Also unlocks** these sequence primitives (previously stubbed to always-false / UNSUPPORTED_YET):
980
- - `step.action:"wait_for" condition:{type:"pixelColor", x, y, expected, tolerance?}` — wait for a visual state change.
981
- - `step.action:"assert" condition:{type:"pixelColor", x, y, expected, tolerance?}` — fail a sequence early on mismatch.
982
- - `step.locate:{pixelColor:"#RRGGBB", near:{x,y}}` — point-probe resolver (returns `near.{x,y}` when the pixel at that point matches, LOCATE_NO_MATCH otherwise). Not a spiral-scan — for area scanning wait for `find_image` (Phase 3b).
983
-
984
- **Platform**: Windows (S2) + macOS (S9 — routes through Electron desktopCapturer + sharp 1×1 crop; gated by TCC Screen Recording permission). Per-call cost ~80-150 ms; avoid hammering — use `wait_for.pixelColor` for polling.
985
-
986
- | Parameter | Type | Description |
987
- |-----------|------|-------------|
988
- | `x` | number | Absolute x. |
989
- | `y` | number | Absolute y. |
990
- | `expected` | string | Optional `#RRGGBB` or `#RRGGBBAA` hex. When set, response includes `matches` boolean. |
991
- | `tolerance` | number | Per-channel tolerance (0-255). Default 0 (exact). Raise to 8-16 for antialiased edges, 32+ for theme-variant robustness. |
992
- | `confirm` | boolean | Required unless disabled. `actions.pixelColor` toggle defaults ON (read-only). |
993
-
994
- **Returns**: `{ok, details:{x, y, r, g, b, a, hex, matches?, expected?, tolerance?}}`.
995
-
996
- #### superbased_ax_invoke (S5/4.1)
997
- Top-of-reliability-pyramid invocation: resolve a UI element via its `automationId` (preferred) or `role+name`, then call the matching UIA **pattern** directly — WITHOUT synthesizing click / keystrokes. More reliable than coord-based click for controls that expose semantic patterns: buttons (`Invoke`), checkboxes / toggles (`Toggle`), radios / list items (`SelectionItem.Select`), text fields (`Value.SetValue` — overwrites existing contents in one shot, bypasses typing), tree / combobox / expander (`ExpandCollapse.Expand` / `ExpandCollapse.Collapse`).
998
-
999
- **Use when**: the control has a stable AutomationId; OR coord-click keeps missing hitboxes (custom-skinned UI); OR you need to set a long text field without typing overhead; OR you want to trigger a hidden / offscreen button the user can't see.
1000
-
1001
- **Avoid when**: the control has no AutomationId AND no clean role+name (use `superbased_click label=...` instead — OCR-based); OR the pattern doesn't map to the action (e.g. "click a hyperlink" — links are InvokePattern in browsers but coord-click works equally and doesn't need AX).
1002
-
1003
- **Platform**: Windows (S5 — PowerShell + UIAutomationClient.dll since `@superbased/win-uia` binding is tree-dump only) + macOS (S9 — osascript System Events AX actions: AXPress for Invoke/Toggle/SelectionItem/ExpandCollapse; `set value` for Value.SetValue; requires `@superbased/macos-ax` optional binding for dumpTree + findBy* helpers). Per-call cost ~100-250 ms (UIA / osascript shell-out + element re-resolve).
1004
-
1005
- | Parameter | Type | Description |
1006
- |-----------|------|-------------|
1007
- | `automationId` | string | UIA AutomationId (preferred; top of pyramid). |
1008
- | `role` / `name` | string | UIA ControlType (`Button`, `Edit`, `CheckBox`, `ListItem`, `TreeItem`) + Name. Paired fallback when no automationId. |
1009
- | `caseSensitive` | boolean | Default false. |
1010
- | `pattern` | enum | `Invoke` / `Toggle` / `SelectionItem.Select` / `Value.SetValue` / `ExpandCollapse.Expand` / `ExpandCollapse.Collapse`. |
1011
- | `value` | string | Required when `pattern="Value.SetValue"`. Text to write. SetValue on a read-only field returns `TARGET_HOSTILE`. |
1012
- | `confirm` | boolean | Required unless disabled. `actions.axInvoke` toggle defaults ON. |
1013
- | `window` / `processName` / `hwnd` | string | Target window (required). |
1014
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
1015
-
1016
- **Errors**: `LOCATE_NO_MATCH` (element not in tree), `TARGET_HOSTILE` (pattern unsupported or read-only field), `ACCESSIBILITY_NOT_GRANTED` (macOS — System Events not authorized), `INVALID_ARGS` (unknown pattern, missing value, missing target). `isStateChangingAction` flags `ax_invoke` — locate cache invalidates after step (Toggle flips state, Expand reveals children, Select rebuilds a list).
1017
-
1018
- **Sequence step variant**: `{ action:"ax_invoke", automationId:"SaveBtn", pattern:"Invoke" }`. Uses `runtime.handle` (sequence-level target) for the UIA tree walk.
1019
-
1020
- #### superbased_form_fill (S5/4.2)
1021
- Macro: fill a multi-field form with ONE approval. Per-field resolution walks the reliability pyramid (`automationId` → `role+name` → `label`); value is written via `Value.SetValue` (one shot, bypasses typing) when the control supports it, else falls back to click + `clearFirst` + type. Inter-field `Tab` advances focus (default). Optional `submitLabel` / `submitAutomationId` clicks / `ax_invoke`s the Submit button after all fields are filled. ONE activation window for the entire macro — focus leakage is impossible between fields.
1022
-
1023
- **Audit**: stores BOTH the macro invocation AND per-field events with a shared `sessionId` (crypto.randomUUID) per roadmap decision 37. Query `~/.superbased/audit.log` with `jq 'select(.sessionId=="<id>")'` to see the full form run. Four event kinds: `form_fill_macro_start` / `form_fill_field` / `form_fill_submit[_error]` / `form_fill_macro_end`.
1024
-
1025
- **Use when**: filling sign-up / checkout / config forms; any multi-field form where agents would otherwise chain N × click + type.
1026
-
1027
- **Avoid when**: the form has conditional fields that appear/disappear based on prior entries (form_fill pre-validates all fields before starting — split into multiple calls, or insert `wait_for` / `assert` between dynamic sections).
1028
-
1029
- **Platform**: Windows + macOS. Field cap 50 per call. macOS routes AXIdentifier-resolved fields through Value.SetValue via osascript AX (set value of text field …); unresolved fields fall through to click + cmdOrCtrl+a + type. Role+name locators (`Button`, `Edit`, `CheckBox`, …) resolve against both UIA and AX-prefixed variants via the AX adapter's role synonyms — write cross-platform without role-tagging.
1030
-
1031
- | Parameter | Type | Description |
1032
- |-----------|------|-------------|
1033
- | `fields` | array | `[{label?|automationId?|role+name, value, clearFirst?, caseSensitive?}]`. Each field needs ONE locator; `value` is always required. |
1034
- | `submitLabel` | string | Label of Submit button — clicked after all fields filled. |
1035
- | `submitAutomationId` | string | AutomationId of Submit — preferred (routes via InvokePattern). |
1036
- | `tabBetweenFields` | boolean | Default true. |
1037
- | `confirm` | boolean | Required unless disabled. `actions.formFill` toggle defaults ON. |
1038
- | `window` / `processName` / `hwnd` | string | Target window (required). |
1039
- | `restoreFocus` | boolean | Default true. |
1040
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — post-macro PNG for verification. |
1041
-
1042
- **Returns**: `{ok, details:{sessionId, fieldsFilled, submitted, matchedWindow}, observation}`.
1043
-
1044
- **Sequence step variant**: `{ action:"form_fill", fields:[...], submitLabel:"Save" }`. Uses `runtime.handle` for the target; preserves sequence's outer activation (`restoreFocus:false` on the inner call).
1045
-
1046
- #### superbased_dialog_handle (S5/4.3)
1047
- One-approval modal handling: `confirm` / `dismiss` / `fill_path` against the active dialog. Auto-detects via foreground window (modals own foreground while open — safe default for the common case where a preceding `click` / `hotkey` / `launch_app` triggered the dialog). Caller can pin explicitly via `window` / `processName` / `hwnd` for stacked-modal scenarios.
1048
-
1049
- **Three actions**:
1050
- - `confirm`: click `buttonLabel` when set (role=Button resolution + OCR fallback; macOS matches against AXButton via the AX role synonym table), else press Enter (default action for >95% of Windows MessageBox / File Save/Open / `#32770` dialogs, and of macOS NSAlert / NSSavePanel / NSOpenPanel).
1051
- - `dismiss`: press Escape. Cancels the dialog without saving.
1052
- - `fill_path`: AX-first — dump the dialog tree, find the first Edit / Textbox (Windows) or AXTextField / AXTextArea / AXComboBox (macOS), call `ValuePattern.SetValue(path)` (Windows UIA) or `set value of text field` via osascript (macOS). If the AX invocation fails / no text field is in the tree, fall back to `cmdOrCtrl+a` + `Delete` on the focused field (dialogs typically open with filename focused) + SendInput / nut-js type. Follow with Enter.
1053
-
1054
- **Save-As pattern**:
1055
- ```
1056
- 1. superbased_hotkey combo:"cmdOrCtrl+shift+s" window:"Notepad" # trigger Save As
1057
- 2. superbased_dialog_handle dialogAction:"fill_path" path:"C:\\Users\\me\\out.txt"
1058
- ```
1059
-
1060
- **Platform**: Windows + macOS. On macOS, NSSavePanel / NSOpenPanel / NSAlert live as AXSheet children of the frontmost app's AXWindow — foreground auto-detect resolves the parent window, and the AX tree walk reaches the sheet's filename AXTextField via depth-first traversal.
1061
-
1062
- | Parameter | Type | Description |
1063
- |-----------|------|-------------|
1064
- | `dialogAction` | enum | `confirm` / `dismiss` / `fill_path`. |
1065
- | `path` | string | Required for `dialogAction:"fill_path"`. Absolute path. |
1066
- | `buttonLabel` | string | Optional for `confirm` — click this button instead of pressing Enter ("Yes to All", "Keep Both", etc.). |
1067
- | `confirm` | boolean | Required unless disabled. `actions.dialogHandle` toggle defaults ON. |
1068
- | `window` / `processName` / `hwnd` | string | Optional: pin a specific dialog. Default = foreground. |
1069
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
1070
-
1071
- **Sequence step variant**: `{ action:"dialog_handle", dialogAction:"fill_path", path:"..." }`. Note the sequence step uses `dialogAction` (not `action`) to avoid colliding with the step discriminator.
1072
-
1073
- #### superbased_find_in_page (S6/4.5)
1074
- Browser find-in-page shortcut: `Ctrl+F` → type `query` → Enter (direction `next`, default) or Shift+Enter (direction `prev`) → optional Escape (when `closeAfter:true`) to close the find bar. Routes through `PlatformInputAdapter.sendHotkey` + `.type` — the S1 classifier forces SendInput for browsers / Electron so PostMessage WM_KEYDOWN doesn't silently drop Ctrl+F on Chromium. Requires `window` / `processName` / `hwnd`; the find bar opens in the active tab of the targeted window.
1075
-
1076
- **Best-effort**: browsers occasionally change find-bar signatures across versions, and there's no programmatic way to read the match count without a browser extension. Agents branch on `errorCode:"FIND_BAR_UNKNOWN"` when Ctrl+F fires but no find bar opens (Notepad, custom-skinned Electron apps, etc.).
1077
-
1078
- **Jump-to-text pattern**:
1079
- ```
1080
- 1. superbased_find_in_page query:"Sign in" processName:"chrome.exe" closeAfter:true
1081
- 2. superbased_click label:"Sign in" processName:"chrome.exe" # now scrolled into view
1082
- ```
1083
-
1084
- **Platform**: Windows (S6 — Ctrl+F) + macOS (S9 — Cmd+F). Fires through the platform input adapter so native browser shortcuts land correctly regardless of OS.
1085
-
1086
- | Parameter | Type | Description |
1087
- |-----------|------|-------------|
1088
- | `query` | string | Text to search for. Required. |
1089
- | `direction` | `next` / `prev` | Default `next`. `prev` sends Shift+Enter to cycle backward. |
1090
- | `closeAfter` | boolean | Default false. When true, Escape closes the find bar after the navigate — use when the next step types into the page itself. |
1091
- | `confirm` | boolean | Required unless disabled. `actions.findInPage` toggle defaults ON. |
1092
- | `window` / `processName` / `hwnd` | string | Required. The find bar opens in this window's active tab. |
1093
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot` — shows the highlighted match in context. |
1094
-
1095
- **Sequence step variant**: `{ action:"find_in_page", query:"...", direction?, closeAfter? }`. Runs inline via the sequence's activated target — no re-activation.
1096
-
1097
- #### superbased_tab_management (S6/4.6)
1098
- Browser tab operations via hotkey — ONE approval for ONE hotkey delivered to the active browser window. FIVE actions:
1099
- - `new`: `Ctrl+T`. When `url` is also set, types the URL into the auto-focused address bar + Enter.
1100
- - `close`: `Ctrl+W`. Closes the active tab (browsers prompt on unsaved forms — that's their UI, not ours).
1101
- - `next` / `prev`: `Ctrl+Tab` / `Ctrl+Shift+Tab`. Wraps at the ends.
1102
- - `switch_to`: `Ctrl+<index>` with 1-indexed `index`. Chrome / Edge / Firefox all map Ctrl+1..Ctrl+8 to tabs 1..8 and **Ctrl+9 to the LAST tab** — values `>=9` clamp to Ctrl+9.
1103
-
1104
- Requires `window` / `processName` / `hwnd` so the hotkey fires inside the right browser.
1105
-
1106
- **Bulk-tab pattern**:
1107
- ```
1108
- 1. superbased_open_url url:"https://a.com" browser:"chrome" waitForLoad:true
1109
- 2. superbased_tab_management tabAction:"new" url:"https://b.com" processName:"chrome.exe"
1110
- 3. superbased_tab_management tabAction:"new" url:"https://c.com" processName:"chrome.exe"
1111
- 4. superbased_tab_management tabAction:"switch_to" index:1 processName:"chrome.exe" # back to first
1112
- ```
1113
-
1114
- **Platform**: Windows (S6) + macOS (S9). macOS uses Cmd-based browser shortcuts: Cmd+T (new), Cmd+W (close), Cmd+Shift+] (next), Cmd+Shift+[ (prev), Cmd+1..9 (switch_to).
1115
-
1116
- | Parameter | Type | Description |
1117
- |-----------|------|-------------|
1118
- | `tabAction` | enum | `new` / `close` / `next` / `prev` / `switch_to`. |
1119
- | `url` | string | Optional for `new`. Types url + Enter after Ctrl+T. |
1120
- | `index` | number | Required for `switch_to`. 1-indexed. `>=9` → last tab (Ctrl+9). |
1121
- | `confirm` | boolean | Required unless disabled. `actions.tabManagement` toggle defaults ON. |
1122
- | `window` / `processName` / `hwnd` | string | Required. |
1123
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
1124
-
1125
- **Sequence step variant**: `{ action:"tab_management", tabAction:"...", url?, index? }`. Note the step uses `tabAction` (not `action`) to avoid step-discriminator collision — same precedent as `dialogAction` in 4.3.
1126
-
1127
- #### superbased_open_url (S6/4.7)
1128
- Open a URL with optional browser selection + optional wait-for-window. Tighter surface than `superbased_launch_app({url})`: (a) `browser?:` selects a specific browser binary (path or resolvable name — "chrome.exe", absolute path, "firefox") instead of always routing through the OS default; (b) `waitForLoad:` defaults **TRUE** (polls for the browser window via `PlatformLaunchAdapter.waitForWindow`) so the follow-up step has a target.
1129
-
1130
- **Gate**: reuses `actions.launch` + `guiAutomation.launchAllowlist` (deny-by-default when empty). Allowlist matches against the URL (no browser) or the resolved browser path / name (with browser).
1131
-
1132
- **Hand-off pattern** (open → interact):
1133
- ```
1134
- 1. superbased_open_url url:"https://docs.github.com" browser:"chrome" waitForLoad:true
1135
- 2. superbased_find_in_page query:"Fine-grained tokens" processName:"chrome.exe" closeAfter:true
1136
- 3. superbased_screenshot window:"Fine-grained"
1137
- ```
1138
-
1139
- **Platform**: Windows (S6) + macOS (S9 — routes through `/usr/bin/open <url>` for default-handler, `open -a <browser> <url>` for explicit browser selection).
1140
-
1141
- | Parameter | Type | Description |
1142
- |-----------|------|-------------|
1143
- | `url` | string | Fully-qualified URL. Required. |
1144
- | `browser` | string | Optional. Path or resolvable name. Omit for default handler. |
1145
- | `waitForLoad` | boolean | Default true. Polls for the browser window to appear. |
1146
- | `timeoutMs` | number | Default 10000ms. |
1147
- | `processNameMatch` / `titleMatch` | string | Override waitForWindow needles. |
1148
- | `confirm` | boolean | Required unless disabled. `actions.launch` toggle defaults OFF. |
1149
- | `returnObservation` | `none` / `screenshot` / `full` | Default `none` — page hasn't rendered yet on return. |
1150
-
1151
- **Behaviour**: `waitForLoad:true` with neither `browser` nor `processNameMatch` set SKIPS the poll (would match the first window otherwise) and returns `ok:true` with `details.waitForLoad:"skipped"`. DryRun flags open_url as destructive only when `browser` is explicitly set (spawning a specific browser process).
1152
-
1153
- **Sequence step variant**: `{ action:"open_url", url:"...", browser?, waitForLoad? }`. Does NOT mutate `runtime.handle` — agents chain `focus_window` or use `targets[]` with the matched processName / titleMatch for follow-up steps.
1154
-
1155
- #### superbased_dry_run (S7/6.7)
1156
- Preview a tool call WITHOUT executing it. Returns `ok:false` with `errorCode:"DRYRUN"`, echoing `{ tool, args }` in details. Writes an audit entry (`event="dryrun"`) but does NOT dispatch to the underlying tool's handler. Useful for sanity-checking a composed args object before committing — especially for `superbased_form_fill` / `superbased_sequence` where argument validation failures otherwise waste an approval.
1157
-
1158
- **NOT a full simulation**: does NOT resolve locate specs, run gate checks, or activate windows. Sequences have their own `dryRun:true` flag for per-step-level preview; this wrapper is the single-call equivalent.
1159
-
1160
- | Parameter | Type | Description |
1161
- |-----------|------|-------------|
1162
- | `tool` | string | Name of the tool that would be invoked, e.g. `"superbased_click"`. Required. |
1163
- | `args` | object | The args object that would be passed to `tool`. Echoed verbatim in the response. Not validated against the target tool's schema. |
1164
-
1165
- **No sequence step variant** — cross-tool modifier, not a side-effecting action.
1166
-
1167
- #### superbased_replay (S7/6.8)
1168
- Re-execute a previously-recorded flow from the audit log. Reads `~/.superbased/audit.log`, filters by time range / sessionId, reconstructs `SequenceStep[]` from the ORIGINAL locate specs (label / automationId / role+name) preserved in each entry — NOT the resolved coords — and dispatches via `runSequence()`. §6.8 determinism guarantee: "same locate spec resolves to same element" (re-resolves against the CURRENT UI at replay time), not pixel-identical coords.
1169
-
1170
- **DEFAULT-SAFE**: `dryRun:true` by default. To actually re-execute, pass BOTH `dryRun:false` AND `confirm:true` (wrapper refuses with `INVALID_ARGS` if only one is set; `runSequence`'s own confirm gate still applies on top).
1171
-
1172
- **NOT replayable** (audit strips critical info — these land in `details.skipped[]` with reasons):
1173
- - `type` — text content not logged (privacy)
1174
- - `find_in_page` — query redacted to queryLength
1175
- - `tab_management` — url not preserved
1176
- - `form_fill` — fields array not preserved
1177
- - `launch_app` — structured args collapsed to target string
1178
-
1179
- | Parameter | Type | Description |
1180
- |-----------|------|-------------|
1181
- | `from` | string (ISO-8601) | Lower bound (inclusive) for entry timestamp. Omit to read from log start. |
1182
- | `to` | string (ISO-8601) | Upper bound (inclusive). Omit to read through log tail. |
1183
- | `sessionId` | string | Filter to entries with a specific audit sessionId (e.g. a prior form_fill or sequence macro). |
1184
- | `dryRun` | boolean | Default TRUE. When false AND `confirm:true`, replay re-executes via runSequence. |
1185
- | `confirm` | boolean | Must be TRUE alongside `dryRun:false` to execute. Ignored when dryRun is true. |
1186
-
1187
- **No sequence step variant** — replay IS a sequence orchestrator.
1188
-
1189
- **Usage pattern** (preview, then commit):
1190
- ```
1191
- 1. superbased_replay sessionId:"abc123" # preview only (dryRun defaults true)
1192
- 2. superbased_replay sessionId:"abc123" dryRun:false confirm:true # re-execute
1193
- ```
1194
-
1195
- #### superbased_doctor_gui_automation (S7/6.9)
1196
- Hermetic end-to-end probe of the GUI-automation adapter seam. Launches a canned target (Notepad on Windows, TextEdit on macOS) via a DIRECT `platform.launch.launch({path})` call — bypassing `launchApp()`'s `launchAllowlist` check — and runs each input primitive (click / type / hotkey / scroll / drag / hover / resize / AX dumpTree) against it. Reports per-primitive `{ primitive, ok, durationMs, error?, errorCode? }` plus summary counts + macOS TCC status.
1197
-
1198
- **Why bypass allowlist**: the target is a hard-coded first-party system binary, not agent-supplied. The allowlist is a user-surface safety feature for agent-chosen launches; a probe with a fixed system target sits below it. The master `guiAutomation.enabled` toggle still applies.
1199
-
1200
- **Validation model**: "did the adapter return without throwing". A passing click only proves the adapter accepted the call, not that the OS routed the event to the right widget. For effect-level validation, follow up with `superbased_ui_dump`.
1201
-
1202
- **Cleanup** is best-effort: tries `window.setState(handle, 'close')`, falls back to `sendHotkey(handle, 'alt+n')` to dismiss the save-changes modal (Notepad).
1203
-
1204
- | Parameter | Type | Description |
1205
- |-----------|------|-------------|
1206
- | `skipPrimitives` | string[] | Skip by name (case-insensitive). Valid: `click` / `type` / `hotkey` / `scroll` / `drag` / `hover` / `resize` / `ax`. Skipped entries still appear in results with `skipped:true`. |
1207
- | `timeoutMs` | number | waitForWindow deadline in ms after launch. Default 10000. Bump for slow cold-starts. |
1208
-
1209
- **Typical usage**: run after an OS upgrade, driver change, permission grant ("Accessibility" on macOS), or when an agent reports "my clicks don't work". The summary `{ passed, failed, skipped }` + per-primitive errorCodes tell you which layer of the stack broke.
1210
-
1211
- **No sequence step variant** — pure probe.
1212
-
1213
- #### superbased_tray_click (S8/5.2)
1214
- Click a Windows system-tray (notification-area) icon by tooltip match. Enumerates `Shell_TrayWnd` → `TrayNotifyWnd` → `ToolbarWindow32` via cross-process read of explorer.exe's `TBBUTTON` array (`VirtualAllocEx` + `ReadProcessMemory`), finds the single icon whose tooltip contains `tooltipMatch` (substring, case-insensitive by default), and issues a real OS-level click at that icon's center. Windows 10 + 11 tray layouts both handled; 32-bit and 64-bit TBBUTTON structs both read correctly.
1215
-
1216
- **Match contract**: unique substring match required. Multi-match returns `LOCATE_AMBIGUOUS` with `details.alternatives[]`; no-match returns `TRAY_ICON_NOT_FOUND` with `details.tooltips[]` listing every scanned tooltip so the agent can self-correct.
1217
-
1218
- **Overflow**: `includeOverflow:true` also walks the `NotifyIconOverflowWindow` caret flyout. Windows 11 keeps the overflow toolbar enumerable without opening the flyout; Windows 10 may underreport until the user has clicked the caret at least once this session.
1219
-
1220
- **Gate**: `guiAutomation.actions.trayClick` (default ON, group `write`) — same risk class as `click`/`hotkey` (synthesized input against a surface the user populated).
1221
-
1222
- **Platform**: Windows only in S8. macOS `NSStatusItem` enumeration needs private AppKit APIs; workaround on macOS is `superbased_capture_template` + `superbased_find_image` against a menu-bar region, then `superbased_click`.
1223
-
1224
- | Parameter | Type | Description |
1225
- |-----------|------|-------------|
1226
- | `tooltipMatch` | string | Required. Substring to match against each icon's tooltip. |
1227
- | `button` | `left` / `right` | Default `left` (primary action, usually toggles the owning app). `right` opens the icon's context menu. |
1228
- | `caseSensitive` | boolean | Default false. |
1229
- | `includeOverflow` | boolean | Default false. Walk the `^` overflow flyout too. |
1230
- | `confirm` | boolean | Required unless disabled. |
1231
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
1232
-
1233
- **Sequence step variant**: `{ action:"tray_click", tooltipMatch:"...", button?, caseSensitive?, includeOverflow? }`. Does NOT mutate `runtime.handle` — the tray click fires against explorer.exe; follow-up steps against the icon's owning app should use `target:` switch or `wait_for`.
1234
-
1235
- #### superbased_virtual_desktop (S8/5.6)
1236
- Switch virtual desktops (Windows) or Spaces (macOS — Phase 7) one step to the left or right. Pure hotkey wrapper — no new adapter primitive — because Windows exposes only relative motion via `Win+Ctrl+Left/Right`. Absolute "switch to desktop N" requires the undocumented `IVirtualDesktopManager` COM interface with per-Windows-build GUIDs; deliberately deferred until a real user need materializes.
1237
-
1238
- **Wrap-around**: Windows stops at the edges (`right` on the last desktop stays put). To move N desktops, invoke the tool N times, or batch inside `superbased_sequence`.
1239
-
1240
- **Settle**: the tool waits 300ms after the hotkey so the Win11 smooth-switch animation finishes before the `returnObservation` screenshot captures the new desktop.
1241
-
1242
- **Gate**: `guiAutomation.actions.virtualDesktop` (default ON, group `write`). Navigation-only — fully reversible by re-switching.
1243
-
1244
- **Platform**: Windows (S8 — `Win+Ctrl+Left/Right`) + macOS (S9 — `Ctrl+Left/Right` for Spaces; user must have the System Settings → Keyboard → Shortcuts → Mission Control keyboard shortcut enabled — default ON). Linux returns `UNSUPPORTED_PLATFORM` with a hint pointing at `superbased_hotkey` against the WM-specific combo (GNOME, KDE, Xfce all differ).
1245
-
1246
- | Parameter | Type | Description |
1247
- |-----------|------|-------------|
1248
- | `direction` | `left` / `right` | Required. Relative motion only. |
1249
- | `confirm` | boolean | Required unless disabled. |
1250
- | `returnObservation` | `none` / `screenshot` / `full` | Default `screenshot`. |
1251
-
1252
- **Sequence step variant**: `{ action:"virtual_desktop", direction:"left"|"right" }`.
1253
-
1254
- #### superbased_drag_file (S8/5.1) — SCAFFOLD ONLY
1255
- API SHAPE COMMITTED, IMPLEMENTATION DEFERRED. Every invocation returns `errorCode:"UNSUPPORTED_YET"` in v1 because the real implementation needs a Windows native helper .exe hosting `IDataObject` + `IDropSource` + `DoDragDrop` (COM STA modal message loop blocks the calling thread — cannot run inline in the adapter). The `{ filePath, toX, toY, fromX?, fromY?, button?, path?, durationMs? }` shape is stable and committed — code written against the tool today will work unmodified once the helper lands in a follow-up phase.
1256
-
1257
- **Workarounds for agents that need file drag today**:
1258
- 1. Manually arrange Explorer to show the file, then `superbased_drag` with source coords at the file thumbnail and target coords at the drop destination.
1259
- 2. Most apps: clipboard + `superbased_hotkey Ctrl+V` is equivalent to a drop.
1260
- 3. Browser file inputs: `superbased_click` + `superbased_dialog_handle dialogAction:"fill_path"` instead of drag.
1261
-
1262
- | Parameter | Type | Description |
1263
- |-----------|------|-------------|
1264
- | `filePath` | string | Required. Absolute path to the file. Will surface via `CF_HDROP` when the helper lands. |
1265
- | `toX` / `toY` | number | Required. Drop-target screen coordinates. |
1266
- | `fromX` / `fromY` | number | Optional. Default = current cursor position. |
1267
- | `button` | `left` / `right` | Default `left`. `right` surfaces the shell's drag context menu on drop. |
1268
- | `path` | waypoint[] | Optional non-linear drag path. Same contract as `superbased_drag`. |
1269
- | `durationMs` | number | Default 400ms (slightly slower than cursor drag — OLE targets need hover-state time). |
1270
- | `confirm` | boolean | Required unless disabled. |
1271
-
1272
- **Sequence step variant**: `{ action:"drag_file", filePath:"...", toX, toY, ... }` — returns the same `UNSUPPORTED_YET` until the native helper ships.
1273
-
1274
- See `GUI_AUTOMATION_ROADMAP.md` §5.1 for the resume checklist (native helper CLI contract, adapter wiring, gate / audit / snapshot work) so the follow-up phase can land the OLE implementation without archaeology.
1275
-
1276
- #### superbased_focus_window
1277
- Bring a window to the foreground by name substring (case-insensitive). Use ONLY for standalone focus changes the user wants to see (e.g. "switch me to Slack"). **NEVER chain this before another superbased tool.** All of `superbased_screenshot` / `superbased_click` / `superbased_type` / `superbased_hotkey` / `superbased_scroll` accept `window=` / `processName=` / `hwnd=` on their own call and handle the full focus→action→restore cycle server-side in a single MCP turn. Chaining focus_window before them trips a second permission prompt — the user's Approve click steals focus back to the agent window, defeating the activation and sending the action to the wrong app.
1278
-
1279
- | Parameter | Type | Description |
1280
- |-----------|------|-------------|
1281
- | `window` | string | Window-title substring (scored matcher) |
1282
- | `processName` | string | Exact process executable name (e.g. "Notepad", "Notepad.exe") |
1283
- | `hwnd` | string | Direct window handle from `superbased_window_list` |
1284
-
1285
- #### superbased_window_bounds
1286
- Read a window's current screen rect + minimized / maximized state. **PURE QUERY — no activation, no focus change, no side effects.** Use when the agent needs to reason about positioning ("is this window in the top-left corner yet?", "does the target fit on the primary display?") without disturbing the user's foreground. Fills the gap where agents previously had to chain `superbased_focus_window` + fullscreen screenshot or trigger `superbased_resize_window` just to learn a rect. Rect is in virtual-screen physical pixels — directly usable as input to `resize_window` / `click` / `drag` / `screenshot` region. Windows: `GetWindowRect` + `IsIconic` + `IsZoomed` via one PowerShell call. macOS: `osascript` position + size + `AXMinimized` + `AXFullScreen` via System Events AX. Not gated by `confirm` (same policy as `window_list` / `mouse_position` — reads don't need approval).
1287
-
1288
- | Parameter | Type | Description |
1289
- |-----------|------|-------------|
1290
- | `window` | string | Window-title needle (scored matcher). Use `superbased_window_list` to enumerate. |
1291
- | `processName` | string | Exact process executable name. Highest-precision non-hwnd target. |
1292
- | `hwnd` | string | Direct window handle (from a prior tool's `details.matchedWindow.hwnd` or `superbased_window_list`). Bypasses scoring — preferred for chained operations where the title may drift. |
1293
-
1294
- **Returns**: `{ ok, details: { hwnd, rect:{x,y,width,height}, minimized, maximized, matchedWindow } }` on success. Returns `WINDOW_NOT_FOUND` errorCode when no matching window resolves.
1295
-
1296
- #### superbased_accessibility_tree (Phase 8.1)
1297
- Return the **native** accessibility tree for a running application — macOS `AXUIElement` via `@superbased/macos-ax`, Windows UIA via `@superbased/win-uia`. More reliable than OCR for structured UI dumps: roles, labels, values, bounding rects, and full hierarchy come straight from the OS. **Different from `superbased_ui_dump`** — `ui_dump` merges OCR text + AX into a flat element list optimized for "find me a clickable thing"; `accessibility_tree` returns the raw hierarchical structure for agents that need to walk the tree (e.g. "find the second row inside the third group inside the data table"). Requires the optional native binding installed (`npm install -g superbased --include=optional`) AND Accessibility permission granted on macOS (System Settings > Privacy & Security > Accessibility).
1298
-
1299
- | Parameter | Type | Description |
1300
- |-----------|------|-------------|
1301
- | `pid` | number | Target process id. Required on darwin; optional on win32 (defaults to foreground). |
1302
- | `hwnd` | number | Windows window handle (win32 only). Mutually exclusive with `pid`. |
1303
- | `maxDepth` | number | Tree walker depth limit (default 24, max 64). Lower values reduce latency + JSON size on rich GUIs (e.g. complex Electron apps with thousands of nodes). |
1304
- | `includeAttributes` | boolean | Include the full per-node attribute list (default false). Noisy but useful for debugging which UIA / AX attribute holds the value you want. |
1305
-
1306
- **Returns**: `{ ok, tree?: { role, title, value, frame:{x,y,width,height}, children: [...], attributes? }, error?, message? }`. On macOS without the binding installed: `{ ok:false, error: 'binding_not_installed', hint: 'npm install -g superbased --include=optional' }`. On macOS without Accessibility permission: `{ ok:false, error: 'ACCESSIBILITY_NOT_GRANTED', hint: 'System Settings > Privacy & Security > Accessibility — add SuperBased' }`.
1307
-
1308
- **When to use vs `superbased_ui_dump`:** prefer `ui_dump` for the common "I want to click something" path (returns flat elements with screen-space `center.{x,y}` ready to feed into `click`). Use `accessibility_tree` when you need parent/child relationships, AX-pattern availability, or the full attribute set per node — e.g. tree traversal in a treeview, finding the Nth row of a grid, querying a control's `IsEnabled` / `IsKeyboardFocusable` state.
1309
-
1310
- #### superbased_undo_last (Phase 5.4)
1311
- Reverse the last GUI automation action from this server process's in-memory stack. **`type` actions undo via Backspace keystrokes** matching the typed length (so `type "hello"` → undo presses Backspace 5×). **`click`, `hotkey`, `scroll`, `focus_window` actions are recorded but NOT reversible** — they pop from the stack and return `ok:false, error:"not_reversible"` so calling `undo_last` again reverses the NEXT-most-recent action (lets the agent walk back through a chain skipping non-reversible entries). Returns `ok:false, error:"stack_empty"` when nothing to undo. **Stack is per-process and does not persist** — clears on process restart. Useful as a safety net in agent loops where the agent realizes it just typed into the wrong field.
1312
-
1313
- No parameters. No safety gate (action-is-reversal of an already-approved action).
1314
-
1315
- **Returns**: `{ ok, action?, count?, ... }` on success (e.g. `{ ok:true, action:"type", count:5 }` after undoing a `type "hello"`). `{ ok:false, error:"not_reversible"|"stack_empty", ... }` otherwise.
1316
-
1317
- **Limitations**: doesn't reverse cross-process state. If `type "hello"` triggered an autocomplete that filled additional characters, the Backspace count will under-delete. If the field was cleared by an unrelated event between the type and the undo, the Backspaces will eat the wrong characters. Treat as best-effort, especially across user-driven foreground changes.
1318
-
1319
- #### superbased_tools (Phase 5.5)
1320
- Progressive-disclosure dispatcher. **When `progressiveDisclosure.enabled = true` in settings, only the 15 core tools appear in the standard `tools/list` MCP response; the other ~57 tools are hidden but still callable.** Call this with a category to get the names + descriptions of the hidden tools in that group. Useful for token-cost reduction in agents that load every tool definition into context — the hidden tools stay discoverable but don't bloat the initial schema dump.
1321
-
1322
- | Parameter | Type | Description |
1323
- |-----------|------|-------------|
1324
- | `category` | enum | One of: `capture` / `record` / `dictate` / `interact` / `window` / `layout` / `ax` / `ai` / `edit` / `clipboard` / `system`. Omit for the full index across all categories. |
1325
-
1326
- **Returns**: `{ ok, categories: [{ name, count, tools: [{ name, description }] }], coreTools: [...] }`. The returned schemas are **names + descriptions only**; once an agent knows a hidden tool name, it can call it directly and the MCP server accepts the call. The progressive-disclosure feature is about trimming `tools/list` token cost, **not access restriction**.
1327
-
1328
- #### superbased_mouse_position
1329
- Read the current cursor position. Read-only; no safety gate.
1330
-
1331
- #### superbased_wait
1332
- Pause for a fixed duration (0–60000 ms). Useful between automation steps that need time for UI animations.
1333
-
1334
- | Parameter | Type | Description |
1335
- |-----------|------|-------------|
1336
- | `ms` | number | Milliseconds to wait |
1337
-
1338
- #### superbased_wait_for
1339
- **S0/0.9** — Poll a condition until it holds or `timeoutMs` elapses. Read-only (no `actions.*` gate). Replaces the old "screenshot-in-a-loop" pattern that costs one approval per iteration — `wait_for` polls server-side until the condition hits or times out, then returns once. Used by `superbased_sequence` as the `wait_for` step variant too.
1340
-
1341
- | Parameter | Type | Description |
1342
- |-----------|------|-------------|
1343
- | `condition` | object | One of: `{type:"text", value, caseSensitive?}` (OCR-visible string), `{type:"window", title?, processName?, appeared?}` (window appeared / disappeared — `appeared:false` waits for removal), `{type:"idle", ms}` (foreground stable for N ms — page-settle detection), `{type:"pixelColor", x, y, expected, tolerance?}` (ships with S2 / 2.4). |
1344
- | `timeoutMs` | number | Required — max wait (ms). |
1345
- | `intervalMs` | number | Polling interval (default 250 ms). |
1346
-
1347
- **Returns**: `{ok:true, matchedAtMs}` on success, `{ok:false, error:"...", details:{errorCode:"TIMEOUT"}}` on timeout (HTTP 408).
1348
-
1349
- **Typical use** inside a sequence after a `click` that opens a dialog:
1350
-
1351
- ```
1352
- superbased_sequence targets=[{name:"app", processName:"MyApp"}] confirm=true steps=[
1353
- { action:"click", locate:{label:"Save"} },
1354
- { action:"wait_for", condition:{type:"window", title:"Save As"}, timeoutMs:3000 },
1355
- { action:"type", text:"C:\\Users\\me\\shapes.png", target:"saveDlg" },
1356
- { action:"hotkey", combo:"Enter", target:"saveDlg" },
1357
- ]
1358
- ```
1359
-
1360
- #### superbased_locate
1361
- Find a UI element by visible text label. Captures the screen, runs Tesseract OCR, returns matching regions sorted by confidence with `bbox` / `center` / `confidence` per match plus a `bestMatch` shortcut.
1362
-
1363
- | Parameter | Type | Description |
1364
- |-----------|------|-------------|
1365
- | `label` | string | Visible text on the UI element (button label, link text, etc.) |
1366
- | `caseSensitive` | boolean | Default false |
1367
-
1368
- **Common pattern**: `locate("Sign In")` → use `bestMatch.center.{x,y}` as input to `superbased_click`. Confidence below 0.7 is a hint that the OCR match is uncertain — verify with `superbased_capture_image` first.
1369
-
1370
- ---
1371
-
1372
- ## Ambient Watchers (subscribable event streams)
1373
-
1374
- Unlike tools (which you call), watchers are **resources you subscribe to** and then receive `notifications/resources/updated` whenever state changes. Use `resources/subscribe { uri }` to start; `resources/unsubscribe { uri }` to stop. Event payload is delivered via the notification; re-read the resource for current state.
1375
-
1376
- | URI | Description | Payload shape |
1377
- |-----|-------------|---------------|
1378
- | `superbased://watchers/clipboard` | Clipboard text changed. Text-only for v1; image/file-list clipboards are a future extension. | `{ text, length }` |
1379
- | `superbased://watchers/active-window` | Foreground window / app changed. | `{ appName, windowTitle, source }` |
1380
- | `superbased://watchers/file/{url-encoded-path}` | File / directory content changed. Uses chokidar with `awaitWriteFinish` so editor-style atomic saves are debounced. | `{ kind: 'add' \| 'change' \| 'unlink', path }` |
1381
- | `superbased://watchers/screen-region/fullscreen` | Fullscreen visual content changed (same engine as `superbased_recording mode=monitor` — they share a single provider, so running both is free). | `{ kind: 'change', regionId, at }` |
1382
-
1383
- **Throttling defaults** (settable in `~/.superbased/superbased-settings.json`):
1384
- - Clipboard: 200 ms poll
1385
- - Active window: 1000 ms poll
1386
- - File: 300 ms write-stability threshold
1387
- - Screen region: 500 ms min interval (honoured only on first-start; if recording already started the provider with a different interval, existing config wins)
1388
-
1389
- **Master toggle** `watchers.enabled` defaults to **ON** — watchers are pull-initiated (nothing runs until a client subscribes), so "on" just means the machinery is available. Per-watcher `watchers.<kind>.enabled` gives granular off-switches.
1390
-
1391
- **File-watcher URI construction**: `superbased://watchers/file/${encodeURIComponent(absolutePath)}`. Example for `/home/user/notes.md` on Linux: `superbased://watchers/file/%2Fhome%2Fuser%2Fnotes.md`.
1392
-
1393
- ---
1394
-
1395
- ## Common Workflows
1396
-
1397
- ### See what's on screen
1398
- ```
1399
- superbased_capture_image mode=fullscreen resolution=half
1400
- ```
1401
-
1402
- ### Capture a specific window (even if minimized)
1403
- ```
1404
- 1. superbased_window_list -> find the window name
1405
- 2. superbased_capture_image window="Notepad" resolution=half
1406
- ```
1407
- The window will be activated (restored if minimized), captured, and focus restored to the previous window.
1408
-
1409
- ### Read text from a specific window
1410
- ```
1411
- 1. superbased_window_list -> find window name
1412
- 2. superbased_capture_image window="Chrome" resolution=half -> capture + view it
1413
- 3. superbased_ocr captureId=<id> -> extract text from capture
1414
- ```
1415
-
1416
- ### Screenshot and extract text
1417
- ```
1418
- 1. superbased_capture mode=fullscreen
1419
- 2. superbased_ocr captureId=<id from step 1>
1420
- ```
1421
-
1422
- ### Quick text extraction (one step)
1423
- ```
1424
- superbased_ai instruction="/extract"
1425
- ```
1426
-
1427
- ### Capture, redact secrets, then share
1428
- ```
1429
- 1. superbased_capture mode=fullscreen
1430
- 2. superbased_redact captureId=<id> secrets=true pii=true
1431
- ```
1432
-
1433
- ### Live mic dictation
1434
- ```
1435
- superbased_dictate mic=true duration=15
1436
- ```
1437
- Records from the microphone for 15 seconds, transcribes with cleanup.
1438
-
1439
- ### Smart screen recording (change detection)
1440
- ```
1441
- superbased_recording action=start name="Testing checkout" mode=smart interval=2
1442
- (do things on screen — only visual changes are captured)
1443
- superbased_recording action=stop
1444
- superbased_sessions action=frames sessionId=<id>
1445
- ```
1446
-
1447
- ### Proactive screen monitoring
1448
- ```
1449
- superbased_recording action=start mode=monitor name="Deploy watch" analysisPrompt="Flag any errors, failed health checks, or red status indicators" analyzeEvery=3 analyzeInterval=20
1450
- (AI will analyze frames and alert via MCP notifications)
1451
- superbased_recording action=get_analysis sessionId=<id>
1452
- superbased_recording action=stop
1453
- ```
1454
-
1455
- ### Visual regression testing
1456
- ```
1457
- 1. superbased_recording action=start name="Before: login flow" profile=automated_test
1458
- 2. (navigate through the login UI)
1459
- 3. superbased_recording action=stop
1460
- 4. superbased_baseline action=set workflowName="login-flow" sessionId=<id>
1461
- 5. (make code changes)
1462
- 6. superbased_recording action=start name="After: login flow" profile=automated_test
1463
- 7. (navigate through the same flow)
1464
- 8. superbased_recording action=stop
1465
- 9. superbased_diff baselineSessionId=<baseline> currentSessionId=<after>
1466
- 10. superbased_describe_frames sessionId=<after>
1467
- ```
1468
-
1469
- ### Annotate a capture for a bug report
1470
- ```
1471
- 1. superbased_capture_image mode=fullscreen resolution=half
1472
- 2. superbased_annotate captureId=<id> annotations=[{type:"rectangle", x:100, y:200, width:300, height:50, color:"#ff0000"}, {type:"text", x:100, y:190, text:"Bug: button is misaligned"}] save=true
1473
- ```
1474
-
1475
- ### Read an image from clipboard
1476
- ```
1477
- superbased_clipboard action=readImage
1478
- ```
1479
- Returns the clipboard image inline — useful when the user says "look at what I copied."
1480
-
1481
- ### Compress large text for token savings
1482
- ```
1483
- superbased_compress_text text="<large text content>" preset=compact theme=dark
1484
- ```
1485
-
1486
- ### Click a button by its label (GUI automation)
1487
- ```
1488
- 1. superbased_health -> verify capabilities.gui_automation.enabled === true
1489
- 2. superbased_locate label="Sign In" -> find the button via OCR
1490
- 3. (inspect bestMatch.confidence — re-verify if < 0.7)
1491
- 4. superbased_click x=<bestMatch.center.x> y=<bestMatch.center.y> confirm=true
1492
- ```
1493
- If `enabled` is false, surface this to the user with the enable command:
1494
- `superbased config set guiAutomation.enabled true`. Don't silently fail.
1495
-
1496
- ### Fill out a form (GUI automation)
1497
- **Preferred (S5/4.2 — one approval, audit trail, focus-leak-proof):**
1498
- ```
1499
- superbased_form_fill window="Sign Up" confirm=true fields=[
1500
- {label:"Username", value:"alice@example.com"},
1501
- {label:"Password", value:"hunter2"}
1502
- ] submitLabel="Sign In"
1503
- ```
1504
- Resolution walks the pyramid (automationId → role+name → label); ValuePattern is used
1505
- when supported (bypasses typing entirely). Shared sessionId links the macro entry,
1506
- per-field events, and submit event in `~/.superbased/audit.log`.
1507
-
1508
- **Fallback when form_fill doesn't fit (e.g. conditional fields mid-form):**
1509
- ```
1510
- 1. superbased_locate label="Username" -> find field
1511
- 2. superbased_click x=... y=... confirm=true -> focus it
1512
- 3. superbased_type text="alice@example.com" confirm=true
1513
- 4. superbased_hotkey combo="Tab" confirm=true -> next field
1514
- 5. superbased_type text="hunter2" confirm=true
1515
- 6. superbased_hotkey combo="Enter" confirm=true -> submit
1516
- ```
1517
- Always include `confirm=true` unless the user has explicitly disabled the safety prompt
1518
- (`superbased config set guiAutomation.requireConfirmFlag false`).
1519
-
1520
- ### Handle a modal dialog (GUI automation)
1521
- ```
1522
- 1. superbased_hotkey combo="ctrl+shift+s" window="Notepad" confirm=true -> triggers Save As
1523
- 2. superbased_dialog_handle dialogAction="fill_path" path="C:\\Users\\me\\out.txt" confirm=true
1524
- ```
1525
- `dialog_handle` auto-detects the foreground dialog; use `dialogAction:"confirm"` + `buttonLabel`
1526
- to click a specific button ("Yes to All", "Keep Both"), or `"dismiss"` to press Escape.
1527
-
1528
- ### Invoke a button / toggle via AX (no mouse synthesis)
1529
- ```
1530
- superbased_ax_invoke window="Chrome" automationId="ReloadButton" pattern="Invoke" confirm=true
1531
- ```
1532
- Works for buttons (Invoke), checkboxes (Toggle), list items (SelectionItem.Select), text fields
1533
- (Value.SetValue with `value:"..."`), and tree nodes (ExpandCollapse.Expand / .Collapse). Prefer
1534
- this over coord-click when the control has a stable AutomationId — bypasses hitbox issues.
1535
-
1536
- ### CAPTCHA solving (reCAPTCHA, hCaptcha, Cloudflare Turnstile, GeeTest, KeyCAPTCHA, etc.)
1537
-
1538
- CAPTCHA flows are the dominant case where humanization tradeoffs matter. The single most useful
1539
- rule: **batch every CAPTCHA interaction inside `superbased_sequence` with a final screenshot
1540
- step** so you observe the verifier's response in the same MCP turn that submits the answer.
1541
- A separate post-submit screenshot call gives the verifier ~500ms of stationary cursor between
1542
- submit and observe — a strong "automated" signal even when the click itself is humanized.
1543
-
1544
- **General principles:**
1545
- - **Default profile (`humanize: "light"`) is enough for click-only CAPTCHAs** (Cloudflare
1546
- Turnstile, reCAPTCHA V2 checkbox, hCaptcha checkbox). Bezier approach + click-target jitter
1547
- + click-hold variation defeat the trivial trajectory and event-timing classifiers.
1548
- - **Batch the whole flow.** A typical reCAPTCHA solve is one `superbased_sequence` of `[click
1549
- checkbox, wait 800, screenshot, ...inspect tiles in vision..., click tile1, click tile2, ...,
1550
- click verify, wait 1000, screenshot]`. One activation, one focus context, the verifier sees a
1551
- natural multi-action session instead of N separate sessions.
1552
- - **Vision identifies; SuperBased clicks.** For grid-based CAPTCHAs (reCAPTCHA V2 image select,
1553
- hCaptcha grid), use `superbased_ui_dump` to capture the tile array with screen-space coords
1554
- AND the image; ask vision to identify which tiles match the prompt; emit one
1555
- `superbased_sequence` of clicks at the matched tiles.
1556
-
1557
- **Drag-puzzle CAPTCHAs (slider verify, GeeTest jigsaw):**
1558
- ```
1559
- 1. superbased_ui_dump processName="<browser>" -> get the puzzle image + screen coords
1560
- 2. (vision identifies puzzle gap → compute drop coord)
1561
- 3. superbased_sequence steps=[
1562
- {action:"drag", fromX:<handleX>, fromY:<handleY>, toX:<gapX>, toY:<gapY>, humanize:"light"},
1563
- {action:"wait", ms:600},
1564
- {action:"screenshot"}
1565
- ] processName="<browser>" confirm=true
1566
- ```
1567
- - `humanize: "light"` keeps the curve but skips overshoot — puzzle pieces need ±3px placement
1568
- precision that `human`/`paranoid` overshoot would blow. If the puzzle still rejects on `light`,
1569
- retry with `humanize: "off"` (accepts the linear-path tell to gain pixel-exact landing).
1570
- - If the first drop misses by a known offset, a small corrective drag from the current handle
1571
- position to the target lands faster than retrying the full slide.
1572
-
1573
- **Rotation-puzzle CAPTCHAs (rotate puzzle to match orientation):**
1574
- The agent must NOT click the rotate button N times speculatively. Instead, calibrate then execute:
1575
- ```
1576
- 1. superbased_screenshot processName="<browser>" -> baseline angle
1577
- 2. superbased_sequence steps=[
1578
- {action:"click", x:<rotateBtnX>, y:<rotateBtnY>},
1579
- {action:"wait", ms:300},
1580
- {action:"screenshot"}
1581
- ] processName="<browser>" confirm=true
1582
- 3. (vision compares the two frames → measures degrees-per-click delta)
1583
- 4. (compute requiredClicks = round(remainingAngleDegrees / deltaPerClick))
1584
- 5. superbased_sequence steps=[
1585
- ...repeat {click, wait 250} requiredClicks times,
1586
- {action:"wait", ms:500},
1587
- {action:"screenshot"}
1588
- ] processName="<browser>" confirm=true
1589
- ```
1590
- - One calibration click, one batched execution sequence. Beats the alternative (click → screenshot
1591
- → click → screenshot loop) by 10×+ in tool-call count and presents a continuous interaction
1592
- pattern to the verifier instead of N pause-then-resume sessions.
1593
- - The 250–300ms `wait` between clicks matches a comfortable double/triple-click cadence; faster
1594
- may race the puzzle's rotation animation.
1595
-
1596
- **Click-sequence CAPTCHAs (KeyCAPTCHA, Click CAPTCHA, MTCaptcha — "click these in order"):**
1597
- ```
1598
- 1. superbased_ui_dump processName="<browser>" -> get the prompt image + targets
1599
- 2. (vision identifies click order: e.g. "click red, then blue, then green")
1600
- 3. superbased_sequence steps=[
1601
- {action:"click", x:<x1>, y:<y1>},
1602
- {action:"wait", ms:200 + jitter},
1603
- {action:"click", x:<x2>, y:<y2>},
1604
- {action:"wait", ms:200 + jitter},
1605
- ...
1606
- {action:"screenshot"}
1607
- ] processName="<browser>" confirm=true
1608
- ```
1609
- - Stagger inter-click waits randomly in 200–500ms — a perfectly periodic click cadence is itself a tell.
1610
- - The default `humanize` setting handles the per-click trajectory + hold variance; you don't need
1611
- per-step `humanize` overrides unless a specific click needs a different profile.
1612
-
1613
- **Cloudflare Turnstile / reCAPTCHA V3 (no visible challenge — just a single checkbox or invisible):**
1614
- - Single `superbased_click` with `humanize: "human"` (the default `light` may be enough on many
1615
- sites, but Turnstile's score-based fusion model rewards more aggressive humanization).
1616
- - Don't add settle/wait padding before the click — Turnstile measures time-on-page before the
1617
- click; a long settle that you orchestrate looks artificial.
1618
-
1619
- **What humanization v2 cannot help with:**
1620
- - **OS-level injection markers** (`LLMHF_INJECTED` flag on Win32, `kCGEventSourceUserData` on
1621
- darwin). Anti-bot SDKs that install low-level mouse hooks see the synthetic-input bit on every
1622
- event — kernel driver territory. If a target shows "automated input detected" instantly on
1623
- first interaction regardless of humanization profile, it's reading these bits.
1624
- - **Browser fingerprint** (canvas / WebGL / JA3 / CDP markers like `navigator.webdriver`). Pair
1625
- SuperBased input with a stealth-patched browser (puppeteer-extra-plugin-stealth or similar).
1626
- - **Multi-signal session score** (Turnstile, reCAPTCHA V3 Enterprise). Kinematics is one input
1627
- of dozens; a perfect input layer with a default Chrome profile and a datacenter IP still
1628
- scores high-risk.
1629
-
1630
- If a CAPTCHA reliably fails on `humanize: "paranoid"` AND a stealth-patched browser AND a
1631
- residential IP, you're past what this tool can address — surface that to the user rather than
1632
- churning retries.
1633
-
1634
- ## Tips
1635
-
1636
- - **Use `resolution=half` or `quarter`** to save tokens when you don't need full detail
1637
- - **Use `window` param** to capture just the window you care about — works even on minimized windows
1638
- - **The `/extract` slash command** is the fastest way to get text from screen
1639
- - **Captures are saved to your project** when `projectDir` is set (automatic in Claude Code)
1640
- - **Gallery persists across sessions** — search for past captures anytime
1641
- - **OCR is local** (Tesseract) — no data leaves your machine for text extraction
1642
- - **Redact before sharing** — use `superbased_redact` to remove API keys and PII
1643
- - **Mic dictation** — `superbased_dictate mic=true` records live audio, no file needed
1644
- - **Visual QA workflow**: record -> change -> record -> diff -> report
1645
- - **Smart recording** — use `mode=smart` to only capture when the screen changes (no redundant frames)
1646
- - **Monitor mode** — use `mode=monitor` for proactive AI screen watching; the AI will flag errors and unexpected states
1647
- - **Monitor token control** — set `analyzeEvery=10 analyzeInterval=60` to reduce AI calls during long monitoring sessions
1648
- - **Clipboard image** — `superbased_clipboard action=readImage` shows whatever image the user copied
1649
- - **CAPTCHA / verification flows** — batch the entire flow inside `superbased_sequence` ending with a `screenshot` step. For drag puzzles use `humanize:"light"` (or `"off"` for ≤2px tolerance); for rotation puzzles, calibrate one click to measure degrees-per-click then batch the computed click count. See "CAPTCHA solving" in Common Workflows.
1650
- - **Image dimension errors** ("exceeds the dimension limit (2000px)") — drop screenshot `resolution` to `quarter` or `thumbnail`, or capture a smaller `region` via `superbased_capture_image`. Never resize the user's window to make screenshots fit; `superbased_screenshot` already handles minimized + background captures.
1651
-
1652
- ## Troubleshooting
1653
-
1654
- - **"Cannot connect to SuperBased"** — Make sure the desktop app or `superbased mcp` is running
1655
- - **"Authentication required"** — Sign in via SuperBased app, or run `superbased auth login`
1656
- - **Recording tools return errors** — Enable recording in SuperBased Settings > Recording
1657
- - **Window capture gets wrong window** — Use the exact window name from `superbased_window_list`
1658
- - **CAPTCHA drag overshoots / undershoots** — `humanize:"human"` and `"paranoid"` add overshoot+pullback (15–40% prob) and target jitter (±3–4.5px). For pixel-precise drops, set `humanize:"light"` or `"off"` on the drag call.
1659
- - **No screenshot returned after `superbased_sequence`** — per-step `returnObservation` defaults to `none` inside sequences. Add a final `{action:"screenshot"}` step instead of calling screenshot separately.
1660
- - **Check app status**: Use `superbased_health` or check `~/.superbased/mcp.json`