@mseep/clawdcursor 1.5.5

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 (354) hide show
  1. package/CHANGELOG.md +2264 -0
  2. package/LICENSE +21 -0
  3. package/README.md +385 -0
  4. package/SECURITY.md +44 -0
  5. package/SKILL.md +503 -0
  6. package/dist/core/agent-loop/agent.d.ts +42 -0
  7. package/dist/core/agent-loop/agent.js +1023 -0
  8. package/dist/core/agent-loop/agent.js.map +1 -0
  9. package/dist/core/agent-loop/batch-tool.d.ts +25 -0
  10. package/dist/core/agent-loop/batch-tool.js +218 -0
  11. package/dist/core/agent-loop/batch-tool.js.map +1 -0
  12. package/dist/core/agent-loop/coord-scale.d.ts +72 -0
  13. package/dist/core/agent-loop/coord-scale.js +89 -0
  14. package/dist/core/agent-loop/coord-scale.js.map +1 -0
  15. package/dist/core/agent-loop/focus-guard.d.ts +24 -0
  16. package/dist/core/agent-loop/focus-guard.js +29 -0
  17. package/dist/core/agent-loop/focus-guard.js.map +1 -0
  18. package/dist/core/agent-loop/project-mcp.d.ts +97 -0
  19. package/dist/core/agent-loop/project-mcp.js +253 -0
  20. package/dist/core/agent-loop/project-mcp.js.map +1 -0
  21. package/dist/core/agent-loop/prompt.d.ts +45 -0
  22. package/dist/core/agent-loop/prompt.js +426 -0
  23. package/dist/core/agent-loop/prompt.js.map +1 -0
  24. package/dist/core/agent-loop/tool-meta.d.ts +93 -0
  25. package/dist/core/agent-loop/tool-meta.js +651 -0
  26. package/dist/core/agent-loop/tool-meta.js.map +1 -0
  27. package/dist/core/agent-loop/tools.d.ts +38 -0
  28. package/dist/core/agent-loop/tools.js +2134 -0
  29. package/dist/core/agent-loop/tools.js.map +1 -0
  30. package/dist/core/agent-loop/types.d.ts +170 -0
  31. package/dist/core/agent-loop/types.js +12 -0
  32. package/dist/core/agent-loop/types.js.map +1 -0
  33. package/dist/core/agent.d.ts +51 -0
  34. package/dist/core/agent.js +245 -0
  35. package/dist/core/agent.js.map +1 -0
  36. package/dist/core/app-categories.d.ts +67 -0
  37. package/dist/core/app-categories.js +108 -0
  38. package/dist/core/app-categories.js.map +1 -0
  39. package/dist/core/banner.d.ts +70 -0
  40. package/dist/core/banner.js +245 -0
  41. package/dist/core/banner.js.map +1 -0
  42. package/dist/core/classify/capability.d.ts +45 -0
  43. package/dist/core/classify/capability.js +78 -0
  44. package/dist/core/classify/capability.js.map +1 -0
  45. package/dist/core/decompose/llm-decomposer.d.ts +35 -0
  46. package/dist/core/decompose/llm-decomposer.js +156 -0
  47. package/dist/core/decompose/llm-decomposer.js.map +1 -0
  48. package/dist/core/decompose/parser.d.ts +27 -0
  49. package/dist/core/decompose/parser.js +101 -0
  50. package/dist/core/decompose/parser.js.map +1 -0
  51. package/dist/core/observability/correlation.d.ts +19 -0
  52. package/dist/core/observability/correlation.js +36 -0
  53. package/dist/core/observability/correlation.js.map +1 -0
  54. package/dist/core/observability/cost-meter.d.ts +51 -0
  55. package/dist/core/observability/cost-meter.js +134 -0
  56. package/dist/core/observability/cost-meter.js.map +1 -0
  57. package/dist/core/observability/logger.d.ts +61 -0
  58. package/dist/core/observability/logger.js +550 -0
  59. package/dist/core/observability/logger.js.map +1 -0
  60. package/dist/core/router/aliases.d.ts +50 -0
  61. package/dist/core/router/aliases.js +104 -0
  62. package/dist/core/router/aliases.js.map +1 -0
  63. package/dist/core/router/normalize.d.ts +41 -0
  64. package/dist/core/router/normalize.js +80 -0
  65. package/dist/core/router/normalize.js.map +1 -0
  66. package/dist/core/safety.d.ts +126 -0
  67. package/dist/core/safety.js +568 -0
  68. package/dist/core/safety.js.map +1 -0
  69. package/dist/core/sense/a11y-resolver.d.ts +73 -0
  70. package/dist/core/sense/a11y-resolver.js +76 -0
  71. package/dist/core/sense/a11y-resolver.js.map +1 -0
  72. package/dist/core/sense/fingerprint.d.ts +41 -0
  73. package/dist/core/sense/fingerprint.js +123 -0
  74. package/dist/core/sense/fingerprint.js.map +1 -0
  75. package/dist/core/sense/rank.d.ts +70 -0
  76. package/dist/core/sense/rank.js +192 -0
  77. package/dist/core/sense/rank.js.map +1 -0
  78. package/dist/core/sense/reactive-check.d.ts +40 -0
  79. package/dist/core/sense/reactive-check.js +48 -0
  80. package/dist/core/sense/reactive-check.js.map +1 -0
  81. package/dist/core/sense/snapshot.d.ts +19 -0
  82. package/dist/core/sense/snapshot.js +100 -0
  83. package/dist/core/sense/snapshot.js.map +1 -0
  84. package/dist/core/sense/types.d.ts +66 -0
  85. package/dist/core/sense/types.js +9 -0
  86. package/dist/core/sense/types.js.map +1 -0
  87. package/dist/core/sense/ui-map-anchors.d.ts +7 -0
  88. package/dist/core/sense/ui-map-anchors.js +24 -0
  89. package/dist/core/sense/ui-map-anchors.js.map +1 -0
  90. package/dist/core/sense/ui-map-elements.d.ts +5 -0
  91. package/dist/core/sense/ui-map-elements.js +33 -0
  92. package/dist/core/sense/ui-map-elements.js.map +1 -0
  93. package/dist/core/sense/ui-map-find.d.ts +56 -0
  94. package/dist/core/sense/ui-map-find.js +153 -0
  95. package/dist/core/sense/ui-map-find.js.map +1 -0
  96. package/dist/core/sense/ui-map-fuse.d.ts +4 -0
  97. package/dist/core/sense/ui-map-fuse.js +44 -0
  98. package/dist/core/sense/ui-map-fuse.js.map +1 -0
  99. package/dist/core/sense/ui-map-geom.d.ts +3 -0
  100. package/dist/core/sense/ui-map-geom.js +16 -0
  101. package/dist/core/sense/ui-map-geom.js.map +1 -0
  102. package/dist/core/sense/ui-map-holder.d.ts +58 -0
  103. package/dist/core/sense/ui-map-holder.js +87 -0
  104. package/dist/core/sense/ui-map-holder.js.map +1 -0
  105. package/dist/core/sense/ui-map-normalize.d.ts +19 -0
  106. package/dist/core/sense/ui-map-normalize.js +65 -0
  107. package/dist/core/sense/ui-map-normalize.js.map +1 -0
  108. package/dist/core/sense/ui-map-render.d.ts +4 -0
  109. package/dist/core/sense/ui-map-render.js +34 -0
  110. package/dist/core/sense/ui-map-render.js.map +1 -0
  111. package/dist/core/sense/ui-map-resolve.d.ts +41 -0
  112. package/dist/core/sense/ui-map-resolve.js +59 -0
  113. package/dist/core/sense/ui-map-resolve.js.map +1 -0
  114. package/dist/core/sense/ui-map-types.d.ts +66 -0
  115. package/dist/core/sense/ui-map-types.js +11 -0
  116. package/dist/core/sense/ui-map-types.js.map +1 -0
  117. package/dist/core/sense/ui-map.d.ts +29 -0
  118. package/dist/core/sense/ui-map.js +113 -0
  119. package/dist/core/sense/ui-map.js.map +1 -0
  120. package/dist/core/verify/assertions.d.ts +132 -0
  121. package/dist/core/verify/assertions.js +284 -0
  122. package/dist/core/verify/assertions.js.map +1 -0
  123. package/dist/index.d.ts +21 -0
  124. package/dist/index.js +24 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/llm/browser-config.d.ts +36 -0
  127. package/dist/llm/browser-config.js +83 -0
  128. package/dist/llm/browser-config.js.map +1 -0
  129. package/dist/llm/client.d.ts +268 -0
  130. package/dist/llm/client.js +1094 -0
  131. package/dist/llm/client.js.map +1 -0
  132. package/dist/llm/config.d.ts +79 -0
  133. package/dist/llm/config.js +375 -0
  134. package/dist/llm/config.js.map +1 -0
  135. package/dist/llm/credentials.d.ts +35 -0
  136. package/dist/llm/credentials.js +491 -0
  137. package/dist/llm/credentials.js.map +1 -0
  138. package/dist/llm/external-creds.d.ts +42 -0
  139. package/dist/llm/external-creds.js +169 -0
  140. package/dist/llm/external-creds.js.map +1 -0
  141. package/dist/llm/providers.d.ts +123 -0
  142. package/dist/llm/providers.js +717 -0
  143. package/dist/llm/providers.js.map +1 -0
  144. package/dist/paths.d.ts +31 -0
  145. package/dist/paths.js +147 -0
  146. package/dist/paths.js.map +1 -0
  147. package/dist/platform/accessibility.d.ts +139 -0
  148. package/dist/platform/accessibility.js +670 -0
  149. package/dist/platform/accessibility.js.map +1 -0
  150. package/dist/platform/cdp-driver.d.ts +318 -0
  151. package/dist/platform/cdp-driver.js +1179 -0
  152. package/dist/platform/cdp-driver.js.map +1 -0
  153. package/dist/platform/index.d.ts +11 -0
  154. package/dist/platform/index.js +69 -0
  155. package/dist/platform/index.js.map +1 -0
  156. package/dist/platform/keys.d.ts +17 -0
  157. package/dist/platform/keys.js +129 -0
  158. package/dist/platform/keys.js.map +1 -0
  159. package/dist/platform/launch-poll.d.ts +101 -0
  160. package/dist/platform/launch-poll.js +177 -0
  161. package/dist/platform/launch-poll.js.map +1 -0
  162. package/dist/platform/linux.d.ts +173 -0
  163. package/dist/platform/linux.js +1253 -0
  164. package/dist/platform/linux.js.map +1 -0
  165. package/dist/platform/macos.d.ts +136 -0
  166. package/dist/platform/macos.js +976 -0
  167. package/dist/platform/macos.js.map +1 -0
  168. package/dist/platform/native-desktop.d.ts +145 -0
  169. package/dist/platform/native-desktop.js +936 -0
  170. package/dist/platform/native-desktop.js.map +1 -0
  171. package/dist/platform/native-helper.d.ts +130 -0
  172. package/dist/platform/native-helper.js +592 -0
  173. package/dist/platform/native-helper.js.map +1 -0
  174. package/dist/platform/ocr-engine.d.ts +78 -0
  175. package/dist/platform/ocr-engine.js +363 -0
  176. package/dist/platform/ocr-engine.js.map +1 -0
  177. package/dist/platform/ps-runner.d.ts +28 -0
  178. package/dist/platform/ps-runner.js +228 -0
  179. package/dist/platform/ps-runner.js.map +1 -0
  180. package/dist/platform/types.d.ts +397 -0
  181. package/dist/platform/types.js +15 -0
  182. package/dist/platform/types.js.map +1 -0
  183. package/dist/platform/uri-handler.d.ts +75 -0
  184. package/dist/platform/uri-handler.js +273 -0
  185. package/dist/platform/uri-handler.js.map +1 -0
  186. package/dist/platform/wayland-backend.d.ts +53 -0
  187. package/dist/platform/wayland-backend.js +348 -0
  188. package/dist/platform/wayland-backend.js.map +1 -0
  189. package/dist/platform/windows.d.ts +232 -0
  190. package/dist/platform/windows.js +1210 -0
  191. package/dist/platform/windows.js.map +1 -0
  192. package/dist/postbuild.d.ts +10 -0
  193. package/dist/postbuild.js +98 -0
  194. package/dist/postbuild.js.map +1 -0
  195. package/dist/schema/snapshot.d.ts +33 -0
  196. package/dist/schema/snapshot.js +90 -0
  197. package/dist/schema/snapshot.js.map +1 -0
  198. package/dist/shortcuts.d.ts +30 -0
  199. package/dist/shortcuts.js +261 -0
  200. package/dist/shortcuts.js.map +1 -0
  201. package/dist/surface/cli.d.ts +7 -0
  202. package/dist/surface/cli.js +1556 -0
  203. package/dist/surface/cli.js.map +1 -0
  204. package/dist/surface/dashboard.d.ts +8 -0
  205. package/dist/surface/dashboard.js +1193 -0
  206. package/dist/surface/dashboard.js.map +1 -0
  207. package/dist/surface/doctor.d.ts +29 -0
  208. package/dist/surface/doctor.js +1514 -0
  209. package/dist/surface/doctor.js.map +1 -0
  210. package/dist/surface/format.d.ts +10 -0
  211. package/dist/surface/format.js +37 -0
  212. package/dist/surface/format.js.map +1 -0
  213. package/dist/surface/http-utility.d.ts +65 -0
  214. package/dist/surface/http-utility.js +336 -0
  215. package/dist/surface/http-utility.js.map +1 -0
  216. package/dist/surface/mcp-server.d.ts +91 -0
  217. package/dist/surface/mcp-server.js +280 -0
  218. package/dist/surface/mcp-server.js.map +1 -0
  219. package/dist/surface/onboarding.d.ts +15 -0
  220. package/dist/surface/onboarding.js +184 -0
  221. package/dist/surface/onboarding.js.map +1 -0
  222. package/dist/surface/pidfile.d.ts +79 -0
  223. package/dist/surface/pidfile.js +263 -0
  224. package/dist/surface/pidfile.js.map +1 -0
  225. package/dist/surface/readiness.d.ts +45 -0
  226. package/dist/surface/readiness.js +230 -0
  227. package/dist/surface/readiness.js.map +1 -0
  228. package/dist/surface/report.d.ts +68 -0
  229. package/dist/surface/report.js +341 -0
  230. package/dist/surface/report.js.map +1 -0
  231. package/dist/surface/skill-register.d.ts +14 -0
  232. package/dist/surface/skill-register.js +150 -0
  233. package/dist/surface/skill-register.js.map +1 -0
  234. package/dist/surface/version.d.ts +6 -0
  235. package/dist/surface/version.js +27 -0
  236. package/dist/surface/version.js.map +1 -0
  237. package/dist/tools/a11y.d.ts +8 -0
  238. package/dist/tools/a11y.js +545 -0
  239. package/dist/tools/a11y.js.map +1 -0
  240. package/dist/tools/a11y_depth.d.ts +19 -0
  241. package/dist/tools/a11y_depth.js +455 -0
  242. package/dist/tools/a11y_depth.js.map +1 -0
  243. package/dist/tools/agent.d.ts +15 -0
  244. package/dist/tools/agent.js +248 -0
  245. package/dist/tools/agent.js.map +1 -0
  246. package/dist/tools/batch.d.ts +46 -0
  247. package/dist/tools/batch.js +230 -0
  248. package/dist/tools/batch.js.map +1 -0
  249. package/dist/tools/cdp.d.ts +8 -0
  250. package/dist/tools/cdp.js +233 -0
  251. package/dist/tools/cdp.js.map +1 -0
  252. package/dist/tools/compact.d.ts +63 -0
  253. package/dist/tools/compact.js +418 -0
  254. package/dist/tools/compact.js.map +1 -0
  255. package/dist/tools/cost-class.d.ts +38 -0
  256. package/dist/tools/cost-class.js +117 -0
  257. package/dist/tools/cost-class.js.map +1 -0
  258. package/dist/tools/desktop.d.ts +9 -0
  259. package/dist/tools/desktop.js +346 -0
  260. package/dist/tools/desktop.js.map +1 -0
  261. package/dist/tools/electron_bridge.d.ts +41 -0
  262. package/dist/tools/electron_bridge.js +261 -0
  263. package/dist/tools/electron_bridge.js.map +1 -0
  264. package/dist/tools/extras.d.ts +22 -0
  265. package/dist/tools/extras.js +942 -0
  266. package/dist/tools/extras.js.map +1 -0
  267. package/dist/tools/favorites.d.ts +13 -0
  268. package/dist/tools/favorites.js +137 -0
  269. package/dist/tools/favorites.js.map +1 -0
  270. package/dist/tools/introspection.d.ts +13 -0
  271. package/dist/tools/introspection.js +55 -0
  272. package/dist/tools/introspection.js.map +1 -0
  273. package/dist/tools/ocr.d.ts +8 -0
  274. package/dist/tools/ocr.js +66 -0
  275. package/dist/tools/ocr.js.map +1 -0
  276. package/dist/tools/orchestration.d.ts +7 -0
  277. package/dist/tools/orchestration.js +377 -0
  278. package/dist/tools/orchestration.js.map +1 -0
  279. package/dist/tools/playbooks/extract-compose.d.ts +22 -0
  280. package/dist/tools/playbooks/extract-compose.js +85 -0
  281. package/dist/tools/playbooks/extract-compose.js.map +1 -0
  282. package/dist/tools/playbooks/find-replace.d.ts +11 -0
  283. package/dist/tools/playbooks/find-replace.js +56 -0
  284. package/dist/tools/playbooks/find-replace.js.map +1 -0
  285. package/dist/tools/playbooks/index.d.ts +63 -0
  286. package/dist/tools/playbooks/index.js +70 -0
  287. package/dist/tools/playbooks/index.js.map +1 -0
  288. package/dist/tools/playbooks/keys-blocklist.d.ts +24 -0
  289. package/dist/tools/playbooks/keys-blocklist.js +89 -0
  290. package/dist/tools/playbooks/keys-blocklist.js.map +1 -0
  291. package/dist/tools/registry.d.ts +40 -0
  292. package/dist/tools/registry.js +560 -0
  293. package/dist/tools/registry.js.map +1 -0
  294. package/dist/tools/safety-gate.d.ts +16 -0
  295. package/dist/tools/safety-gate.js +70 -0
  296. package/dist/tools/safety-gate.js.map +1 -0
  297. package/dist/tools/scheduler.d.ts +76 -0
  298. package/dist/tools/scheduler.js +413 -0
  299. package/dist/tools/scheduler.js.map +1 -0
  300. package/dist/tools/shortcuts.d.ts +13 -0
  301. package/dist/tools/shortcuts.js +205 -0
  302. package/dist/tools/shortcuts.js.map +1 -0
  303. package/dist/tools/smart.d.ts +15 -0
  304. package/dist/tools/smart.js +785 -0
  305. package/dist/tools/smart.js.map +1 -0
  306. package/dist/tools/types.d.ts +174 -0
  307. package/dist/tools/types.js +67 -0
  308. package/dist/tools/types.js.map +1 -0
  309. package/dist/tools/window-text.d.ts +15 -0
  310. package/dist/tools/window-text.js +39 -0
  311. package/dist/tools/window-text.js.map +1 -0
  312. package/dist/types.d.ts +122 -0
  313. package/dist/types.js +41 -0
  314. package/dist/types.js.map +1 -0
  315. package/native/Package.swift +38 -0
  316. package/native/README.md +113 -0
  317. package/native/Sources/ClawdCursorHelper/main.swift +602 -0
  318. package/native/Sources/ClawdCursorHost/main.swift +182 -0
  319. package/native/Sources/PermissionCheck/main.swift +53 -0
  320. package/native/Sources/ScreenshotHelper/main.swift +219 -0
  321. package/native/build.sh +139 -0
  322. package/native/entitlements.plist +12 -0
  323. package/package.json +115 -0
  324. package/scripts/banner.ps1 +112 -0
  325. package/scripts/coord-accuracy.ps1 +140 -0
  326. package/scripts/coord-uwp.ps1 +80 -0
  327. package/scripts/edge-glow.ps1 +180 -0
  328. package/scripts/find-element.ps1 +198 -0
  329. package/scripts/get-foreground-window.ps1 +71 -0
  330. package/scripts/get-screen-context.ps1 +183 -0
  331. package/scripts/get-windows.ps1 +66 -0
  332. package/scripts/install-panic-hotkey.ps1 +46 -0
  333. package/scripts/interact-element.ps1 +431 -0
  334. package/scripts/invoke-element.ps1 +314 -0
  335. package/scripts/linux/atspi-bridge.py +356 -0
  336. package/scripts/linux/ocr-recognize.py +154 -0
  337. package/scripts/mac/_window-picker.jxa +163 -0
  338. package/scripts/mac/find-element.jxa +0 -0
  339. package/scripts/mac/find-element.sh +161 -0
  340. package/scripts/mac/focus-window.jxa +284 -0
  341. package/scripts/mac/get-focused-element.jxa +102 -0
  342. package/scripts/mac/get-foreground-window.jxa +173 -0
  343. package/scripts/mac/get-screen-context.jxa +197 -0
  344. package/scripts/mac/get-ui-tree.sh +141 -0
  345. package/scripts/mac/get-windows.jxa +117 -0
  346. package/scripts/mac/interact-element.sh +235 -0
  347. package/scripts/mac/invoke-element.jxa +408 -0
  348. package/scripts/mac/ocr-recognize.swift +124 -0
  349. package/scripts/ocr-recognize.ps1 +102 -0
  350. package/scripts/postinstall-native.js +48 -0
  351. package/scripts/ps-bridge.ps1 +830 -0
  352. package/scripts/smoke-mcp.ps1 +119 -0
  353. package/scripts/sync-version.ts +178 -0
  354. package/scripts/verify-install.js +81 -0
@@ -0,0 +1,418 @@
1
+ "use strict";
2
+ /**
3
+ * Compact MCP surface — 6 compound tools covering every granular
4
+ * primitive, Anthropic-Computer-Use-style.
5
+ *
6
+ * Why this exists:
7
+ * An agent driving clawdcursor via MCP otherwise sees 97 granular
8
+ * tool schemas (~18,000 tokens of tool catalog). Most models
9
+ * over-think the choice, pick near-duplicates, and burn context.
10
+ * This file collapses the granular tools into 6 action-discriminated
11
+ * compound tools — the same "1 tool with N sub-actions" shape that
12
+ * Anthropic uses for computer_20250124.
13
+ *
14
+ * Net effect: the LLM sees ~1,500 tokens of tool catalog, picks a
15
+ * COMPOUND first (which primitive SPACE do I want?), then an
16
+ * ACTION (which specific operation?), then fills in the args.
17
+ * Decision trees shrink, accuracy rises.
18
+ *
19
+ * The 6 compounds cover EXACTLY the granular tool set — no new
20
+ * capability, no removed capability. Every compact action maps to
21
+ * exactly one granular tool via the delegation table. The granular
22
+ * surface stays available (same repo, same schemas); agents simply
23
+ * pick which shape to consume.
24
+ *
25
+ * Selection:
26
+ * `clawdcursor mcp` → 97 granular tools (back-compat)
27
+ * `clawdcursor mcp --compact` → 6 compound tools (this file)
28
+ * GET /tools?mode=compact → REST gets the same compact schemas
29
+ *
30
+ * Extending:
31
+ * Add a new granular tool → map it in the `ACTION_MAP` below under
32
+ * its owning compound. No other wiring needed; dispatcher picks it
33
+ * up automatically.
34
+ */
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.COMPACT_TOOL_NAMES = exports.COMPOUND_ROUTE_INDEX = void 0;
37
+ exports.getCompactTools = getCompactTools;
38
+ const registry_1 = require("./registry");
39
+ const batch_1 = require("./batch");
40
+ const COMPUTER_ACTIONS = [
41
+ // Perception
42
+ { action: 'screenshot', delegate: 'desktop_screenshot' },
43
+ { action: 'screenshot_region', delegate: 'desktop_screenshot_region' },
44
+ // Mouse
45
+ { action: 'click', delegate: 'mouse_click' },
46
+ { action: 'double_click', delegate: 'mouse_double_click' },
47
+ { action: 'right_click', delegate: 'mouse_right_click' },
48
+ { action: 'middle_click', delegate: 'mouse_middle_click' },
49
+ { action: 'triple_click', delegate: 'mouse_triple_click' },
50
+ { action: 'hover', delegate: 'mouse_hover' },
51
+ { action: 'move', delegate: 'mouse_hover' }, // alias
52
+ { action: 'move_relative', delegate: 'mouse_move_relative' },
53
+ { action: 'scroll', delegate: 'mouse_scroll' },
54
+ { action: 'scroll_horizontal', delegate: 'mouse_scroll_horizontal' },
55
+ { action: 'drag', delegate: 'mouse_drag' },
56
+ { action: 'drag_path', delegate: 'mouse_drag_stepped' },
57
+ { action: 'mouse_down', delegate: 'mouse_down' },
58
+ { action: 'mouse_up', delegate: 'mouse_up' },
59
+ // Keyboard — `combo` is the natural compound name for a key chord;
60
+ // it remaps to the granular `key_press`'s `key` parameter (see argRemap
61
+ // doc-comment above).
62
+ { action: 'type', delegate: 'type_text' },
63
+ { action: 'key', delegate: 'key_press', argRemap: { combo: 'key' } },
64
+ { action: 'key_press', delegate: 'key_press', argRemap: { combo: 'key' } },
65
+ { action: 'key_down', delegate: 'key_down', argRemap: { combo: 'key' } },
66
+ { action: 'key_up', delegate: 'key_up', argRemap: { combo: 'key' } },
67
+ // Flow
68
+ { action: 'wait', delegate: 'wait' },
69
+ ];
70
+ const ACCESSIBILITY_ACTIONS = [
71
+ { action: 'read_tree', delegate: 'read_screen' },
72
+ { action: 'find', delegate: 'find_element' },
73
+ { action: 'get_element', delegate: 'a11y_get_element' },
74
+ { action: 'focused', delegate: 'get_focused_element' },
75
+ { action: 'invoke', delegate: 'invoke_element' },
76
+ { action: 'focus', delegate: 'focus_element' },
77
+ { action: 'set_value', delegate: 'set_field_value' },
78
+ { action: 'get_value', delegate: 'a11y_get_value' },
79
+ { action: 'expand', delegate: 'a11y_expand' },
80
+ { action: 'collapse', delegate: 'a11y_collapse' },
81
+ { action: 'toggle', delegate: 'a11y_toggle' },
82
+ { action: 'select', delegate: 'a11y_select' },
83
+ { action: 'state', delegate: 'get_element_state' },
84
+ { action: 'list_children', delegate: 'a11y_list_children', argRemap: { name: 'parentName' } },
85
+ { action: 'wait_for', delegate: 'wait_for_element' },
86
+ // el_NN UI State Compiler (v1.5.0) — the flagship perception substrate. These
87
+ // were granular-only, leaving compact-surface agents unable to reach the
88
+ // {element_id, snapshot_id} ref path the `invoke`/`set_value` actions accept
89
+ // (gauntlet F1). compile_ui fuses a11y+OCR into one ranked map with stable
90
+ // ids; the finders locate a target semantically and return an el_NN to act on.
91
+ { action: 'compile_ui', delegate: 'compile_ui' },
92
+ { action: 'find_button', delegate: 'find_action_button' },
93
+ { action: 'find_field', delegate: 'find_input_field' },
94
+ // Smart auto-fallback (OCR → a11y → CDP, by element text — no coordinates).
95
+ // Restores the smart_* ergonomics to the recommended compound surface.
96
+ { action: 'smart_click', delegate: 'smart_click' },
97
+ { action: 'smart_type', delegate: 'smart_type' },
98
+ { action: 'smart_read', delegate: 'smart_read' },
99
+ ];
100
+ const WINDOW_ACTIONS = [
101
+ { action: 'list', delegate: 'get_windows' },
102
+ { action: 'active', delegate: 'get_active_window' },
103
+ { action: 'focus', delegate: 'focus_window' },
104
+ { action: 'maximize', delegate: 'maximize_window' },
105
+ { action: 'minimize', delegate: 'minimize_window_to_taskbar' },
106
+ { action: 'restore', delegate: 'restore_window' },
107
+ { action: 'close', delegate: 'close_window' },
108
+ { action: 'resize', delegate: 'resize_window' },
109
+ { action: 'list_displays', delegate: 'list_displays' },
110
+ { action: 'screen_size', delegate: 'get_screen_size' },
111
+ { action: 'open_app', delegate: 'open_app' },
112
+ { action: 'open_file', delegate: 'open_file' },
113
+ { action: 'open_url', delegate: 'open_url' },
114
+ { action: 'switch_tab', delegate: 'switch_tab_os' },
115
+ { action: 'navigate', delegate: 'navigate_browser' },
116
+ ];
117
+ const SYSTEM_ACTIONS = [
118
+ { action: 'clipboard_read', delegate: 'read_clipboard' },
119
+ { action: 'clipboard_write', delegate: 'write_clipboard' },
120
+ { action: 'system_time', delegate: 'get_system_time' },
121
+ { action: 'ocr', delegate: 'ocr_read_screen' },
122
+ { action: 'undo', delegate: 'undo_last' },
123
+ { action: 'shortcuts_list', delegate: 'shortcuts_list' },
124
+ { action: 'shortcuts_run', delegate: 'shortcuts_execute' },
125
+ { action: 'delegate', delegate: 'delegate_to_agent' },
126
+ // v0.8.2 — Electron/WebView2 bridge
127
+ { action: 'detect_webview', delegate: 'detect_webview_apps' },
128
+ { action: 'relaunch_with_cdp', delegate: 'relaunch_with_cdp' },
129
+ // v0.9.2 — pipeline introspection (give external brains the same context
130
+ // the autonomous loop's LLM gets injected automatically).
131
+ { action: 'system_prompt', delegate: 'get_system_prompt' },
132
+ // URI escape hatches — accomplish an intent WITHOUT driving UI by dispatching
133
+ // a registered URI scheme (mailto:, tel:, slack:, vscode:, spotify:, file:, …).
134
+ // Cross-OS: macOS `open`, Linux `xdg-open`, Windows registered-handler resolve.
135
+ { action: 'build_uri', delegate: 'build_uri' },
136
+ { action: 'open_uri', delegate: 'open_uri' },
137
+ // Launch/open family — ALSO on `window`, aliased here because "open an
138
+ // app/file/url" reads as a system action (and `open_uri` already lives on
139
+ // system). The MCP layer enum-validates `action` before our dispatcher, so
140
+ // the cross-compound hint can't fire over /mcp — making the intuitive call
141
+ // valid on BOTH compounds is what actually unblocks an integrating agent.
142
+ { action: 'open_app', delegate: 'open_app' },
143
+ { action: 'open_file', delegate: 'open_file' },
144
+ { action: 'open_url', delegate: 'open_url' },
145
+ ];
146
+ // `task` compound — bounded-sync delegation plus its poll/cancel companions.
147
+ // status/abort exist here because a >45s task returns a RUNNING receipt and
148
+ // the compact surface must be able to follow up (the granular submit_task/
149
+ // agent_status/abort_task family used to be granular-only — live failure
150
+ // 2026-06-12: a compact-surface agent had NO non-timing-out delegation path).
151
+ const TASK_ACTIONS = [
152
+ { action: 'run', delegate: 'delegate_to_agent', argRemap: { instruction: 'task' } },
153
+ { action: 'status', delegate: 'agent_status' },
154
+ { action: 'abort', delegate: 'abort_task' },
155
+ ];
156
+ const BROWSER_ACTIONS = [
157
+ { action: 'connect', delegate: 'cdp_connect' },
158
+ { action: 'page_context', delegate: 'cdp_page_context' },
159
+ { action: 'read_text', delegate: 'cdp_read_text' },
160
+ { action: 'click', delegate: 'cdp_click' },
161
+ { action: 'type', delegate: 'cdp_type' },
162
+ { action: 'select_option', delegate: 'cdp_select_option' },
163
+ { action: 'evaluate', delegate: 'cdp_evaluate' },
164
+ { action: 'wait_for', delegate: 'cdp_wait_for_selector' },
165
+ { action: 'list_tabs', delegate: 'cdp_list_tabs' },
166
+ { action: 'switch_tab', delegate: 'cdp_switch_tab' },
167
+ { action: 'scroll', delegate: 'cdp_scroll' },
168
+ ];
169
+ /**
170
+ * Build the flat set of arg properties a compound exposes, merging
171
+ * every delegate's parameter spec. `action` is always first and
172
+ * required; everything else is optional (each sub-action enforces
173
+ * its own required fields via the granular tool's validator).
174
+ */
175
+ function buildCompoundSchema(routes) {
176
+ const schema = {
177
+ action: {
178
+ type: 'string',
179
+ description: 'Which sub-action to perform. See this tool\'s description for the enum of valid values.',
180
+ required: true,
181
+ enum: routes.map(r => r.action),
182
+ },
183
+ };
184
+ for (const route of routes) {
185
+ const granular = (0, registry_1.getTool)(route.delegate);
186
+ if (!granular)
187
+ continue; // Defensive: unknown delegate (shouldn't happen).
188
+ for (const [pname, pdef] of Object.entries(granular.parameters)) {
189
+ // Apply arg remapping — the compound exposes the REMAPPED name,
190
+ // dispatcher un-maps back to the granular name at runtime.
191
+ const remappedFrom = route.argRemap
192
+ ? Object.entries(route.argRemap).find(([, v]) => v === pname)?.[0]
193
+ : undefined;
194
+ const targetName = remappedFrom ?? pname;
195
+ // Anti silent-drop: when a field is RENAMED on the compound (e.g.
196
+ // `combo` exposes the granular `key_press`'s `key`), the granular's
197
+ // native name (`key`) is otherwise absent from the published schema —
198
+ // so the MCP server's Zod validator silently strips it and the handler
199
+ // crashes on `undefined`. Publish the native name as an accepted alias.
200
+ // The dispatcher already forwards unmapped native names verbatim to the
201
+ // granular, so no runtime change is needed — this only stops the strip.
202
+ if (remappedFrom && remappedFrom !== pname && !(pname in schema)) {
203
+ schema[pname] = {
204
+ ...pdef,
205
+ required: false,
206
+ description: `Alias for "${remappedFrom}". ${pdef.description}`,
207
+ };
208
+ }
209
+ if (targetName in schema) {
210
+ // Field already declared by an earlier delegate. The first-wins
211
+ // policy is fine for type/description (they should match), but
212
+ // for an `enum` constraint we have to UNION the values across
213
+ // delegates — otherwise `mouse_scroll`'s `direction: ['up','down']`
214
+ // wins and `mouse_scroll_horizontal`'s `['left','right']` becomes
215
+ // invisible to the schema, so an LLM calling
216
+ // `computer({action:'scroll_horizontal', direction:'left'})`
217
+ // violates the published schema.
218
+ const existing = schema[targetName];
219
+ if (Array.isArray(existing.enum) && Array.isArray(pdef.enum)) {
220
+ const merged = Array.from(new Set([...existing.enum, ...pdef.enum]));
221
+ if (merged.length !== existing.enum.length) {
222
+ existing.enum = merged;
223
+ }
224
+ }
225
+ continue;
226
+ }
227
+ schema[targetName] = {
228
+ ...pdef,
229
+ required: false, // Every arg is optional on the compound — sub-actions enforce their own.
230
+ description: pdef.description,
231
+ };
232
+ }
233
+ }
234
+ return schema;
235
+ }
236
+ /** Human-readable one-line list of actions for the tool description. */
237
+ function actionCatalog(routes) {
238
+ return routes.map(r => r.action).join(', ');
239
+ }
240
+ // ─── Compound dispatcher ───────────────────────────────────────────
241
+ /**
242
+ * Shared runtime: look up the granular tool for a compact (compound,
243
+ * action) pair, optionally remap args, then hand off. Surfacing the
244
+ * same ToolResult contract the granular tool returns.
245
+ */
246
+ /**
247
+ * Index of every compound's action table — lets a misrouted action point the
248
+ * caller at the compound that actually owns it (e.g. `system open_app` →
249
+ * "that action is on `window`"), instead of a dead-end "unknown action".
250
+ */
251
+ // Exported so the schema-invariant test can iterate the LIVE tables instead of
252
+ // a hand-maintained copy that silently drifts (review 2026-06-11).
253
+ exports.COMPOUND_ROUTE_INDEX = {
254
+ computer: COMPUTER_ACTIONS,
255
+ accessibility: ACCESSIBILITY_ACTIONS,
256
+ window: WINDOW_ACTIONS,
257
+ system: SYSTEM_ACTIONS,
258
+ browser: BROWSER_ACTIONS,
259
+ task: TASK_ACTIONS,
260
+ };
261
+ /** Which other compound(s) expose `action`, excluding the one already tried. */
262
+ function compoundsForAction(action, exclude) {
263
+ const hits = [];
264
+ for (const [name, routes] of Object.entries(exports.COMPOUND_ROUTE_INDEX)) {
265
+ if (name === exclude)
266
+ continue;
267
+ if (routes.some(r => r.action === action))
268
+ hits.push(name);
269
+ }
270
+ return hits;
271
+ }
272
+ async function dispatchCompound(compoundName, routes, args, ctx) {
273
+ const actionName = String(args.action ?? '');
274
+ if (!actionName) {
275
+ return {
276
+ text: `${compoundName}: "action" is required. Valid: ${actionCatalog(routes)}`,
277
+ isError: true,
278
+ };
279
+ }
280
+ const route = routes.find(r => r.action === actionName);
281
+ if (!route) {
282
+ const elsewhere = compoundsForAction(actionName, compoundName);
283
+ const hint = elsewhere.length
284
+ ? ` — that action lives on the "${elsewhere.join('"/"')}" compound; call it there.`
285
+ : '';
286
+ return {
287
+ text: `${compoundName}: unknown action "${actionName}"${hint} Valid actions here: ${actionCatalog(routes)}`,
288
+ isError: true,
289
+ };
290
+ }
291
+ const granular = (0, registry_1.getTool)(route.delegate);
292
+ if (!granular) {
293
+ return { text: `${compoundName}: delegate "${route.delegate}" not registered`, isError: true };
294
+ }
295
+ // Strip the `action` key + apply any remapping before forwarding.
296
+ const forwarded = {};
297
+ for (const [k, v] of Object.entries(args)) {
298
+ if (k === 'action')
299
+ continue;
300
+ const mapped = route.argRemap?.[k] ?? k;
301
+ forwarded[mapped] = v;
302
+ }
303
+ // Enforce the granular's REQUIRED params at the compound boundary. Every
304
+ // compound field is published as optional (sub-actions own their own
305
+ // requirements), so without this a missing required arg reaches the handler
306
+ // as `undefined` and crashes on the first `.toLowerCase()` / `.goto()` / etc.
307
+ // (smart_click.target, smart_type.text, key_*.key, navigate.url, …). Fail
308
+ // with an actionable message naming the field in the compound's vocabulary.
309
+ const missing = Object.entries(granular.parameters)
310
+ .filter(([, def]) => def.required === true)
311
+ .filter(([pname]) => forwarded[pname] === undefined || forwarded[pname] === null)
312
+ .map(([pname]) => {
313
+ const exposed = route.argRemap
314
+ ? Object.entries(route.argRemap).find(([, v]) => v === pname)?.[0]
315
+ : undefined;
316
+ return exposed ?? pname;
317
+ });
318
+ if (missing.length) {
319
+ return {
320
+ text: `${compoundName} ${actionName}: missing required field(s): ${missing.join(', ')}.`,
321
+ isError: true,
322
+ };
323
+ }
324
+ return granular.handler(forwarded, ctx);
325
+ }
326
+ // ─── Tool definitions ──────────────────────────────────────────────
327
+ function getCompactTools() {
328
+ return [
329
+ {
330
+ name: 'computer',
331
+ description: 'Direct mouse/keyboard/screenshot control (Anthropic Computer-Use style). ' +
332
+ `Pick an action: ${actionCatalog(COMPUTER_ACTIONS)}. ` +
333
+ 'Coordinates are image-space pixels from the most recent screenshot. ' +
334
+ 'Prefer `accessibility` for named targets; use `computer` only when you need pixel-level control.',
335
+ parameters: buildCompoundSchema(COMPUTER_ACTIONS),
336
+ category: 'orchestration',
337
+ safetyTier: 1,
338
+ handler: (args, ctx) => dispatchCompound('computer', COMPUTER_ACTIONS, args, ctx),
339
+ },
340
+ {
341
+ name: 'accessibility',
342
+ description: 'Interact with the OS accessibility tree — read element names, find by name/role, invoke, toggle, expand/collapse, set value, query state. ' +
343
+ `Pick an action: ${actionCatalog(ACCESSIBILITY_ACTIONS)}. ` +
344
+ 'Always preferred over `computer.click(x,y)` when the target has a name — more reliable across DPI, window resize, layout shifts. ' +
345
+ 'For sparse/ambiguous UIs: `compile_ui` fuses a11y+OCR into one ranked map of elements with stable ids; `find_button`/`find_field` locate a target semantically and return an {element_id, snapshot_id} you pass straight to `invoke`/`set_value` (survives layout shifts, no coordinates).',
346
+ parameters: buildCompoundSchema(ACCESSIBILITY_ACTIONS),
347
+ category: 'perception',
348
+ safetyTier: 0,
349
+ handler: (args, ctx) => dispatchCompound('accessibility', ACCESSIBILITY_ACTIONS, args, ctx),
350
+ },
351
+ {
352
+ name: 'window',
353
+ description: 'Window, app, and display management. Open/focus/maximize/minimize/restore/close/resize windows; enumerate displays; switch browser tabs at the OS level; open apps/files/URLs. ' +
354
+ `Pick an action: ${actionCatalog(WINDOW_ACTIONS)}.`,
355
+ parameters: buildCompoundSchema(WINDOW_ACTIONS),
356
+ category: 'window',
357
+ safetyTier: 1,
358
+ handler: (args, ctx) => dispatchCompound('window', WINDOW_ACTIONS, args, ctx),
359
+ },
360
+ {
361
+ name: 'system',
362
+ description: 'System integration — clipboard read/write, system time, OCR screen-reading, undo shortcut, named shortcuts registry, delegate to a sub-agent. ' +
363
+ `Pick an action: ${actionCatalog(SYSTEM_ACTIONS)}.`,
364
+ parameters: buildCompoundSchema(SYSTEM_ACTIONS),
365
+ category: 'orchestration',
366
+ safetyTier: 1,
367
+ handler: (args, ctx) => dispatchCompound('system', SYSTEM_ACTIONS, args, ctx),
368
+ },
369
+ {
370
+ name: 'browser',
371
+ description: 'Chrome DevTools Protocol control — operates on DOM elements by CSS selector rather than screen pixels. Requires Chrome/Edge launched with remote debugging (see `cdp_connect`). Much more reliable than `computer` for web automation. ' +
372
+ `Pick an action: ${actionCatalog(BROWSER_ACTIONS)}.`,
373
+ parameters: buildCompoundSchema(BROWSER_ACTIONS),
374
+ category: 'browser',
375
+ safetyTier: 1,
376
+ handler: (args, ctx) => dispatchCompound('browser', BROWSER_ACTIONS, args, ctx),
377
+ },
378
+ {
379
+ name: 'task',
380
+ description: '**Requires the `clawdcursor agent` daemon to be running** (binds 127.0.0.1:3847 with an LLM configured). ' +
381
+ 'Hand clawdcursor a WHOLE natural-language task and let its internal pipeline decide how to execute it (router → blind agent → hybrid → vision fallback). ' +
382
+ 'Use this when you don\'t want to micromanage every primitive — clawdcursor decomposes the task, picks the cheapest execution path, and returns a trace. ' +
383
+ 'BOUNDED-SYNC: waits up to `timeout` seconds (default 45) — a longer task returns {status:"running"} with progress while it CONTINUES in the background; re-call with the SAME instruction to keep waiting (re-attaches, never restarts), {action:"status"} to poll, {action:"abort"} to stop it. ' +
384
+ 'The `computer`/`accessibility`/`window`/`system`/`browser` compounds are for when you want step-level control yourself. ' +
385
+ 'If the daemon isn\'t running you get a clear error telling you how to start it.',
386
+ parameters: {
387
+ action: {
388
+ type: 'string',
389
+ description: 'Default "run" (submit/continue the instruction). "status" → poll the running task (cheap, poll at 1–2 Hz). "abort" → stop the running task.',
390
+ required: false,
391
+ enum: ['run', 'status', 'abort'],
392
+ },
393
+ instruction: {
394
+ type: 'string',
395
+ description: 'Natural-language task description, e.g. "open Notepad and type hello", "go to github.com", "send email in Outlook". Required for action "run" (the default); ignored for status/abort.',
396
+ required: false,
397
+ },
398
+ timeout: {
399
+ type: 'number',
400
+ description: 'Max seconds to WAIT for completion before returning a running receipt (default 45, clamped 1–50). The task keeps running — this only bounds the wait.',
401
+ required: false,
402
+ },
403
+ },
404
+ category: 'orchestration',
405
+ safetyTier: 1,
406
+ handler: (args, ctx) => {
407
+ const action = typeof args.action === 'string' && args.action ? args.action : 'run';
408
+ return dispatchCompound('task', TASK_ACTIONS, { ...args, action }, ctx);
409
+ },
410
+ },
411
+ // `batch` — run an ordered list of the above calls in one shot (declarative,
412
+ // guarded, safety-gated per step). The efficiency lever without a sandbox.
413
+ ...(0, batch_1.getBatchTools)(),
414
+ ];
415
+ }
416
+ /** Names of all compact tools (for tier + doc lookups). */
417
+ exports.COMPACT_TOOL_NAMES = ['computer', 'accessibility', 'window', 'system', 'browser', 'task', 'batch'];
418
+ //# sourceMappingURL=compact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact.js","sourceRoot":"","sources":["../../src/tools/compact.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AA2UH,0CAoGC;AA7aD,yCAAqC;AACrC,mCAAwC;AAoBxC,MAAM,gBAAgB,GAAkB;IACtC,aAAa;IACb,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE;IACxD,EAAE,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,2BAA2B,EAAE;IACtE,QAAQ;IACR,EAAE,MAAM,EAAE,OAAO,EAAU,QAAQ,EAAE,aAAa,EAAE;IACpD,EAAE,MAAM,EAAE,cAAc,EAAG,QAAQ,EAAE,oBAAoB,EAAE;IAC3D,EAAE,MAAM,EAAE,aAAa,EAAI,QAA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S,0HAA0H;gBAC1H,iFAAiF;YACnF,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6IAA6I;oBAC1J,QAAQ,EAAE,KAAK;oBACf,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC;iBACjC;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wLAAwL;oBACrM,QAAQ,EAAE,KAAK;iBAChB;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uJAAuJ;oBACpK,QAAQ,EAAE,KAAK;iBAChB;aACF;YACD,QAAQ,EAAE,eAAe;YACzB,UAAU,EAAE,CAAC;YACb,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;gBACrB,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;gBACpF,OAAO,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;YAC1E,CAAC;SACF;QAED,6EAA6E;QAC7E,2EAA2E;QAC3E,GAAG,IAAA,qBAAa,GAAE;KACnB,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC9C,QAAA,kBAAkB,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Phase A — authoritative cost-class assignments for every granular tool.
3
+ *
4
+ * Why a central table instead of inline `costClass:` on each of the 97
5
+ * ToolDefinitions: one reviewable surface, one place to keep the taxonomy
6
+ * consistent, and a single boot-validated source of truth. The values are
7
+ * stamped onto the granular tools at registry-assembly time
8
+ * (`stampCostClasses`), so every consumer — the coverage test, the MCP
9
+ * `tools/list` projection, future runtime hints — reads `tool.costClass`
10
+ * exactly as if it had been declared inline.
11
+ *
12
+ * Taxonomy (cheapest first): act < inspect < perceive-text < perceive-image.
13
+ * See `ToolCostClass` in types.ts for the per-class token budgets.
14
+ *
15
+ * Compound dispatcher tools (`computer`, `accessibility`, `window`,
16
+ * `system`, `browser`, `task`) are intentionally ABSENT — their cost
17
+ * depends on the delegated action, so they stay `undefined`.
18
+ */
19
+ import type { ToolCostClass, ToolDefinition } from './types';
20
+ /**
21
+ * name → costClass. Grouped by class for readability. Every granular tool
22
+ * returned by `getTools()` must appear exactly once; `validateCostClassMap`
23
+ * (called from the coverage test) enforces both completeness and that no
24
+ * stale name lingers after a tool is renamed/removed.
25
+ */
26
+ export declare const COST_CLASS_BY_TOOL: Readonly<Record<string, ToolCostClass>>;
27
+ /**
28
+ * Stamp `costClass` onto each granular tool from the table. Mutates and
29
+ * returns the same array (assembly happens once per `getTools()` call).
30
+ * Tools missing from the table are left untouched (coverage test warns).
31
+ */
32
+ export declare function stampCostClasses(tools: ToolDefinition[]): ToolDefinition[];
33
+ /**
34
+ * Validate the table against the live granular tool set. Returns the set of
35
+ * problems (empty array = clean). Used by the coverage test so a renamed or
36
+ * removed tool surfaces immediately instead of rotting.
37
+ */
38
+ export declare function validateCostClassMap(toolNames: string[]): string[];
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ /**
3
+ * Phase A — authoritative cost-class assignments for every granular tool.
4
+ *
5
+ * Why a central table instead of inline `costClass:` on each of the 97
6
+ * ToolDefinitions: one reviewable surface, one place to keep the taxonomy
7
+ * consistent, and a single boot-validated source of truth. The values are
8
+ * stamped onto the granular tools at registry-assembly time
9
+ * (`stampCostClasses`), so every consumer — the coverage test, the MCP
10
+ * `tools/list` projection, future runtime hints — reads `tool.costClass`
11
+ * exactly as if it had been declared inline.
12
+ *
13
+ * Taxonomy (cheapest first): act < inspect < perceive-text < perceive-image.
14
+ * See `ToolCostClass` in types.ts for the per-class token budgets.
15
+ *
16
+ * Compound dispatcher tools (`computer`, `accessibility`, `window`,
17
+ * `system`, `browser`, `task`) are intentionally ABSENT — their cost
18
+ * depends on the delegated action, so they stay `undefined`.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.COST_CLASS_BY_TOOL = void 0;
22
+ exports.stampCostClasses = stampCostClasses;
23
+ exports.validateCostClassMap = validateCostClassMap;
24
+ /**
25
+ * name → costClass. Grouped by class for readability. Every granular tool
26
+ * returned by `getTools()` must appear exactly once; `validateCostClassMap`
27
+ * (called from the coverage test) enforces both completeness and that no
28
+ * stale name lingers after a tool is renamed/removed.
29
+ */
30
+ exports.COST_CLASS_BY_TOOL = {
31
+ // ── act ── side-effect verbs; caller already knows what + where. ≤200 tok.
32
+ // mouse
33
+ mouse_click: 'act', mouse_double_click: 'act', mouse_right_click: 'act',
34
+ mouse_hover: 'act', mouse_scroll: 'act', mouse_drag: 'act',
35
+ mouse_move_relative: 'act', mouse_middle_click: 'act', mouse_triple_click: 'act',
36
+ mouse_down: 'act', mouse_up: 'act', mouse_scroll_horizontal: 'act',
37
+ mouse_drag_stepped: 'act',
38
+ // keyboard
39
+ type_text: 'act', key_press: 'act', shortcuts_execute: 'act',
40
+ key_down: 'act', key_up: 'act', undo_last: 'act',
41
+ // window / element mutation
42
+ focus_element: 'act', focus_window: 'act', invoke_element: 'act',
43
+ minimize_window: 'act', maximize_window: 'act', minimize_window_to_taskbar: 'act',
44
+ restore_window: 'act', close_window: 'act', resize_window: 'act',
45
+ switch_tab_os: 'act', set_field_value: 'act',
46
+ a11y_expand: 'act', a11y_collapse: 'act', a11y_toggle: 'act', a11y_select: 'act',
47
+ // clipboard write
48
+ write_clipboard: 'act',
49
+ // browser actions
50
+ cdp_connect: 'act', cdp_click: 'act', cdp_type: 'act', cdp_select_option: 'act',
51
+ cdp_switch_tab: 'act', cdp_scroll: 'act',
52
+ // orchestration verbs
53
+ delegate_to_agent: 'act', open_app: 'act', navigate_browser: 'act', wait: 'act',
54
+ open_file: 'act', open_url: 'act', open_uri: 'act', relaunch_with_cdp: 'act',
55
+ submit_task: 'act', abort_task: 'act', submit_report: 'act',
56
+ // batch is inert itself (each step is gated/costed individually); classify the wrapper cheapest.
57
+ batch: 'act',
58
+ favorites_add: 'act', favorites_remove: 'act',
59
+ scheduled_task_create: 'act', scheduled_task_delete: 'act', scheduled_task_toggle: 'act',
60
+ // ── inspect ── cheap structured read. ≤2K tok.
61
+ get_screen_size: 'inspect', get_system_time: 'inspect', wait_for_element: 'inspect',
62
+ a11y_get_element: 'inspect', a11y_get_value: 'inspect', get_element_state: 'inspect',
63
+ // verify runs only read primitives (window list, UIA value, clipboard, fs);
64
+ // ocr_contains is the lone pricier path and is opt-in per assertion.
65
+ verify: 'inspect',
66
+ a11y_list_children: 'inspect', detect_webview_apps: 'inspect',
67
+ shortcuts_list: 'inspect',
68
+ get_windows: 'inspect', get_active_window: 'inspect', get_focused_element: 'inspect',
69
+ find_element: 'inspect', list_displays: 'inspect',
70
+ read_clipboard: 'inspect',
71
+ cdp_evaluate: 'inspect', cdp_wait_for_selector: 'inspect', cdp_list_tabs: 'inspect',
72
+ build_uri: 'inspect', logs_recent: 'inspect', agent_status: 'inspect',
73
+ task_logs_list: 'inspect', task_logs_current: 'inspect', favorites_list: 'inspect',
74
+ scheduled_task_list: 'inspect',
75
+ // ── perceive-text ── a11y/OCR/DOM dumps + tools that read them internally. ≤10K tok.
76
+ read_screen: 'perceive-text', ocr_read_screen: 'perceive-text', smart_read: 'perceive-text',
77
+ smart_type: 'perceive-text', smart_click: 'perceive-text',
78
+ cdp_page_context: 'perceive-text', cdp_read_text: 'perceive-text',
79
+ get_system_prompt: 'perceive-text',
80
+ compile_ui: 'perceive-text',
81
+ find_action_button: 'perceive-text', find_input_field: 'perceive-text',
82
+ // ── perceive-image ── screenshots with image bytes. ≤50K tok incl. base64.
83
+ desktop_screenshot: 'perceive-image', desktop_screenshot_region: 'perceive-image',
84
+ screenshot_full: 'perceive-image',
85
+ };
86
+ /**
87
+ * Stamp `costClass` onto each granular tool from the table. Mutates and
88
+ * returns the same array (assembly happens once per `getTools()` call).
89
+ * Tools missing from the table are left untouched (coverage test warns).
90
+ */
91
+ function stampCostClasses(tools) {
92
+ for (const tool of tools) {
93
+ const cc = exports.COST_CLASS_BY_TOOL[tool.name];
94
+ if (cc !== undefined)
95
+ tool.costClass = cc;
96
+ }
97
+ return tools;
98
+ }
99
+ /**
100
+ * Validate the table against the live granular tool set. Returns the set of
101
+ * problems (empty array = clean). Used by the coverage test so a renamed or
102
+ * removed tool surfaces immediately instead of rotting.
103
+ */
104
+ function validateCostClassMap(toolNames) {
105
+ const live = new Set(toolNames);
106
+ const problems = [];
107
+ for (const name of Object.keys(exports.COST_CLASS_BY_TOOL)) {
108
+ if (!live.has(name))
109
+ problems.push(`COST_CLASS_BY_TOOL has stale entry "${name}" (no such tool)`);
110
+ }
111
+ for (const name of toolNames) {
112
+ if (exports.COST_CLASS_BY_TOOL[name] === undefined)
113
+ problems.push(`tool "${name}" missing a costClass`);
114
+ }
115
+ return problems;
116
+ }
117
+ //# sourceMappingURL=cost-class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost-class.js","sourceRoot":"","sources":["../../src/tools/cost-class.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AA2EH,4CAMC;AAOD,oDAUC;AA9FD;;;;;GAKG;AACU,QAAA,kBAAkB,GAA4C;IACzE,4EAA4E;IAC5E,QAAQ;IACR,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK;IACvE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK;IAC1D,mBAAmB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK;IAChF,UAAU,EAAE,KAAK,EAAE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,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,0BAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,EAAE,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,SAAmB;IACtD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,0BAAkB,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,uCAAuC,IAAI,kBAAkB,CAAC,CAAC;IACpG,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,0BAAkB,CAAC,IAAI,CAAC,KAAK,SAAS;YAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,uBAAuB,CAAC,CAAC;IAClG,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Desktop tools — screenshot, mouse, keyboard, screen info.
3
+ *
4
+ * Coordinate system: All mouse tools accept IMAGE-SPACE coordinates
5
+ * (matching the 1280px-wide screenshots from desktop_screenshot).
6
+ * The server auto-scales to Windows LOGICAL coordinates via mouseScaleFactor.
7
+ */
8
+ import type { ToolDefinition } from './types';
9
+ export declare function getDesktopTools(): ToolDefinition[];