rookery-agent 0.1.0 → 0.3.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 (670) hide show
  1. package/README.md +467 -367
  2. package/docs/migration.md +88 -88
  3. package/docs/updates.md +112 -0
  4. package/package.json +13 -3
  5. package/packages/cli/dist/commands/config.js +2 -2
  6. package/packages/cli/dist/commands/doctor.d.ts.map +1 -1
  7. package/packages/cli/dist/commands/doctor.js +13 -9
  8. package/packages/cli/dist/commands/doctor.js.map +1 -1
  9. package/packages/cli/dist/commands/memory.js +1 -1
  10. package/packages/cli/dist/commands/org.d.ts +2 -2
  11. package/packages/cli/dist/commands/org.d.ts.map +1 -1
  12. package/packages/cli/dist/commands/org.js +19 -17
  13. package/packages/cli/dist/commands/org.js.map +1 -1
  14. package/packages/cli/dist/commands/serve.js +1 -1
  15. package/packages/cli/dist/commands/serve.js.map +1 -1
  16. package/packages/cli/dist/commands/shared.d.ts.map +1 -1
  17. package/packages/cli/dist/commands/shared.js +2 -1
  18. package/packages/cli/dist/commands/shared.js.map +1 -1
  19. package/packages/cli/dist/commands/tasks.d.ts.map +1 -1
  20. package/packages/cli/dist/commands/tasks.js +25 -11
  21. package/packages/cli/dist/commands/tasks.js.map +1 -1
  22. package/packages/cli/dist/commands/tools.js +1 -1
  23. package/packages/cli/dist/commands/tools.js.map +1 -1
  24. package/packages/cli/dist/index.js +13 -13
  25. package/packages/cli/dist/index.js.map +1 -1
  26. package/packages/cli/dist/repl.d.ts +12 -0
  27. package/packages/cli/dist/repl.d.ts.map +1 -1
  28. package/packages/cli/dist/repl.js +170 -16
  29. package/packages/cli/dist/repl.js.map +1 -1
  30. package/packages/cli/dist/tui/App.d.ts +7 -3
  31. package/packages/cli/dist/tui/App.d.ts.map +1 -1
  32. package/packages/cli/dist/tui/App.js +182 -16
  33. package/packages/cli/dist/tui/App.js.map +1 -1
  34. package/packages/cli/dist/tui/commands.d.ts +7 -0
  35. package/packages/cli/dist/tui/commands.d.ts.map +1 -1
  36. package/packages/cli/dist/tui/commands.js +70 -8
  37. package/packages/cli/dist/tui/commands.js.map +1 -1
  38. package/packages/cli/dist/tui/components/AssignmentsView.js +4 -4
  39. package/packages/cli/dist/tui/components/AssignmentsView.js.map +1 -1
  40. package/packages/cli/dist/tui/components/Banner.d.ts +11 -2
  41. package/packages/cli/dist/tui/components/Banner.d.ts.map +1 -1
  42. package/packages/cli/dist/tui/components/Banner.js +7 -10
  43. package/packages/cli/dist/tui/components/Banner.js.map +1 -1
  44. package/packages/cli/dist/tui/components/CodeBlock.js +2 -2
  45. package/packages/cli/dist/tui/components/CodeBlock.js.map +1 -1
  46. package/packages/cli/dist/tui/components/InputBox.d.ts.map +1 -1
  47. package/packages/cli/dist/tui/components/InputBox.js +4 -4
  48. package/packages/cli/dist/tui/components/InputBox.js.map +1 -1
  49. package/packages/cli/dist/tui/components/Logo.d.ts +56 -0
  50. package/packages/cli/dist/tui/components/Logo.d.ts.map +1 -0
  51. package/packages/cli/dist/tui/components/Logo.js +50 -0
  52. package/packages/cli/dist/tui/components/Logo.js.map +1 -0
  53. package/packages/cli/dist/tui/components/Markdown.js +8 -8
  54. package/packages/cli/dist/tui/components/Markdown.js.map +1 -1
  55. package/packages/cli/dist/tui/components/Message.d.ts +1 -1
  56. package/packages/cli/dist/tui/components/Message.d.ts.map +1 -1
  57. package/packages/cli/dist/tui/components/Message.js +5 -4
  58. package/packages/cli/dist/tui/components/Message.js.map +1 -1
  59. package/packages/cli/dist/tui/components/QuestionView.d.ts +29 -0
  60. package/packages/cli/dist/tui/components/QuestionView.d.ts.map +1 -0
  61. package/packages/cli/dist/tui/components/QuestionView.js +53 -0
  62. package/packages/cli/dist/tui/components/QuestionView.js.map +1 -0
  63. package/packages/cli/dist/tui/components/SlashPalette.d.ts +5 -2
  64. package/packages/cli/dist/tui/components/SlashPalette.d.ts.map +1 -1
  65. package/packages/cli/dist/tui/components/SlashPalette.js +2 -2
  66. package/packages/cli/dist/tui/components/SlashPalette.js.map +1 -1
  67. package/packages/cli/dist/tui/components/StatusLine.d.ts +0 -2
  68. package/packages/cli/dist/tui/components/StatusLine.d.ts.map +1 -1
  69. package/packages/cli/dist/tui/components/StatusLine.js +8 -5
  70. package/packages/cli/dist/tui/components/StatusLine.js.map +1 -1
  71. package/packages/cli/dist/tui/components/ToolGroup.js +2 -2
  72. package/packages/cli/dist/tui/components/ToolGroup.js.map +1 -1
  73. package/packages/cli/dist/tui/components/WatchView.d.ts +21 -0
  74. package/packages/cli/dist/tui/components/WatchView.d.ts.map +1 -0
  75. package/packages/cli/dist/tui/components/WatchView.js +36 -0
  76. package/packages/cli/dist/tui/components/WatchView.js.map +1 -0
  77. package/packages/cli/dist/tui/history.d.ts +20 -0
  78. package/packages/cli/dist/tui/history.d.ts.map +1 -0
  79. package/packages/cli/dist/tui/history.js +105 -0
  80. package/packages/cli/dist/tui/history.js.map +1 -0
  81. package/packages/cli/dist/tui/hooks/useSlash.d.ts.map +1 -1
  82. package/packages/cli/dist/tui/hooks/useSlash.js +3 -2
  83. package/packages/cli/dist/tui/hooks/useSlash.js.map +1 -1
  84. package/packages/cli/dist/tui/hooks/useTurn.d.ts +58 -1
  85. package/packages/cli/dist/tui/hooks/useTurn.d.ts.map +1 -1
  86. package/packages/cli/dist/tui/hooks/useTurn.js +214 -36
  87. package/packages/cli/dist/tui/hooks/useTurn.js.map +1 -1
  88. package/packages/cli/dist/tui/hooks/useWatch.d.ts +52 -0
  89. package/packages/cli/dist/tui/hooks/useWatch.d.ts.map +1 -0
  90. package/packages/cli/dist/tui/hooks/useWatch.js +145 -0
  91. package/packages/cli/dist/tui/hooks/useWatch.js.map +1 -0
  92. package/packages/cli/dist/tui/inkTheme.d.ts +19 -0
  93. package/packages/cli/dist/tui/inkTheme.d.ts.map +1 -0
  94. package/packages/cli/dist/tui/inkTheme.js +81 -0
  95. package/packages/cli/dist/tui/inkTheme.js.map +1 -0
  96. package/packages/cli/dist/tui/theme.d.ts +39 -29
  97. package/packages/cli/dist/tui/theme.d.ts.map +1 -1
  98. package/packages/cli/dist/tui/theme.js +35 -25
  99. package/packages/cli/dist/tui/theme.js.map +1 -1
  100. package/packages/cli/dist/tui/types.d.ts +56 -3
  101. package/packages/cli/dist/tui/types.d.ts.map +1 -1
  102. package/packages/cli/dist/tui/types.js +85 -0
  103. package/packages/cli/dist/tui/types.js.map +1 -1
  104. package/packages/cli/dist/ui/modelNames.d.ts +51 -0
  105. package/packages/cli/dist/ui/modelNames.d.ts.map +1 -0
  106. package/packages/cli/dist/ui/modelNames.js +134 -0
  107. package/packages/cli/dist/ui/modelNames.js.map +1 -0
  108. package/packages/cli/dist/ui/render.d.ts.map +1 -1
  109. package/packages/cli/dist/ui/render.js +17 -8
  110. package/packages/cli/dist/ui/render.js.map +1 -1
  111. package/packages/cli/dist/ui/speech.js +5 -0
  112. package/packages/cli/dist/ui/speech.js.map +1 -1
  113. package/packages/cli/dist/ui/theme.d.ts +33 -9
  114. package/packages/cli/dist/ui/theme.d.ts.map +1 -1
  115. package/packages/cli/dist/ui/theme.js +33 -9
  116. package/packages/cli/dist/ui/theme.js.map +1 -1
  117. package/packages/cli/package.json +1 -1
  118. package/packages/core/dist/agents/persona.d.ts.map +1 -1
  119. package/packages/core/dist/agents/persona.js +5 -2
  120. package/packages/core/dist/agents/persona.js.map +1 -1
  121. package/packages/core/dist/computer/accessibility.d.ts +78 -0
  122. package/packages/core/dist/computer/accessibility.d.ts.map +1 -0
  123. package/packages/core/dist/computer/accessibility.js +270 -0
  124. package/packages/core/dist/computer/accessibility.js.map +1 -0
  125. package/packages/core/dist/computer/assemblies.d.ts +17 -0
  126. package/packages/core/dist/computer/assemblies.d.ts.map +1 -0
  127. package/packages/core/dist/computer/assemblies.js +55 -0
  128. package/packages/core/dist/computer/assemblies.js.map +1 -0
  129. package/packages/core/dist/computer/browser-init.d.ts +9 -0
  130. package/packages/core/dist/computer/browser-init.d.ts.map +1 -0
  131. package/packages/core/dist/computer/browser-init.js +133 -0
  132. package/packages/core/dist/computer/browser-init.js.map +1 -0
  133. package/packages/core/dist/computer/cursor.d.ts +30 -0
  134. package/packages/core/dist/computer/cursor.d.ts.map +1 -0
  135. package/packages/core/dist/computer/cursor.js +30 -0
  136. package/packages/core/dist/computer/cursor.js.map +1 -0
  137. package/packages/core/dist/computer/mcp-server.js +524 -82
  138. package/packages/core/dist/computer/mcp-server.js.map +1 -1
  139. package/packages/core/dist/computer/powershell.d.ts +4 -0
  140. package/packages/core/dist/computer/powershell.d.ts.map +1 -1
  141. package/packages/core/dist/computer/powershell.js +471 -81
  142. package/packages/core/dist/computer/powershell.js.map +1 -1
  143. package/packages/core/dist/computer/screen-text.d.ts +82 -0
  144. package/packages/core/dist/computer/screen-text.d.ts.map +1 -0
  145. package/packages/core/dist/computer/screen-text.js +243 -0
  146. package/packages/core/dist/computer/screen-text.js.map +1 -0
  147. package/packages/core/dist/computer/sketch.d.ts +66 -0
  148. package/packages/core/dist/computer/sketch.d.ts.map +1 -0
  149. package/packages/core/dist/computer/sketch.js +540 -0
  150. package/packages/core/dist/computer/sketch.js.map +1 -0
  151. package/packages/core/dist/computer/tools.d.ts +8 -8
  152. package/packages/core/dist/computer/tools.d.ts.map +1 -1
  153. package/packages/core/dist/computer/tools.js +186 -31
  154. package/packages/core/dist/computer/tools.js.map +1 -1
  155. package/packages/core/dist/computer/validation.d.ts +555 -0
  156. package/packages/core/dist/computer/validation.d.ts.map +1 -0
  157. package/packages/core/dist/computer/validation.js +111 -0
  158. package/packages/core/dist/computer/validation.js.map +1 -0
  159. package/packages/core/dist/computer/windows-cursor.d.ts +14 -0
  160. package/packages/core/dist/computer/windows-cursor.d.ts.map +1 -0
  161. package/packages/core/dist/computer/windows-cursor.js +713 -0
  162. package/packages/core/dist/computer/windows-cursor.js.map +1 -0
  163. package/packages/core/dist/config.d.ts +34 -1
  164. package/packages/core/dist/config.d.ts.map +1 -1
  165. package/packages/core/dist/config.js +362 -11
  166. package/packages/core/dist/config.js.map +1 -1
  167. package/packages/core/dist/cron/scheduler.d.ts +59 -6
  168. package/packages/core/dist/cron/scheduler.d.ts.map +1 -1
  169. package/packages/core/dist/cron/scheduler.js +295 -27
  170. package/packages/core/dist/cron/scheduler.js.map +1 -1
  171. package/packages/core/dist/cron/store.d.ts +19 -1
  172. package/packages/core/dist/cron/store.d.ts.map +1 -1
  173. package/packages/core/dist/cron/store.js +36 -8
  174. package/packages/core/dist/cron/store.js.map +1 -1
  175. package/packages/core/dist/external/claude-code.d.ts +4 -0
  176. package/packages/core/dist/external/claude-code.d.ts.map +1 -0
  177. package/packages/core/dist/external/claude-code.js +111 -0
  178. package/packages/core/dist/external/claude-code.js.map +1 -0
  179. package/packages/core/dist/external/discovery.d.ts +33 -0
  180. package/packages/core/dist/external/discovery.d.ts.map +1 -0
  181. package/packages/core/dist/external/discovery.js +144 -0
  182. package/packages/core/dist/external/discovery.js.map +1 -0
  183. package/packages/core/dist/external/homes.d.ts +26 -0
  184. package/packages/core/dist/external/homes.d.ts.map +1 -0
  185. package/packages/core/dist/external/homes.js +49 -0
  186. package/packages/core/dist/external/homes.js.map +1 -0
  187. package/packages/core/dist/external/shared.d.ts +201 -0
  188. package/packages/core/dist/external/shared.d.ts.map +1 -0
  189. package/packages/core/dist/external/shared.js +308 -0
  190. package/packages/core/dist/external/shared.js.map +1 -0
  191. package/packages/core/dist/gateway/policy.d.ts +117 -2
  192. package/packages/core/dist/gateway/policy.d.ts.map +1 -1
  193. package/packages/core/dist/gateway/policy.js +286 -6
  194. package/packages/core/dist/gateway/policy.js.map +1 -1
  195. package/packages/core/dist/index.d.ts +38 -12
  196. package/packages/core/dist/index.d.ts.map +1 -1
  197. package/packages/core/dist/index.js +66 -12
  198. package/packages/core/dist/index.js.map +1 -1
  199. package/packages/core/dist/memory/db.d.ts +1 -1
  200. package/packages/core/dist/memory/db.d.ts.map +1 -1
  201. package/packages/core/dist/memory/db.js +878 -1
  202. package/packages/core/dist/memory/db.js.map +1 -1
  203. package/packages/core/dist/memory/dream/admission.d.ts +124 -0
  204. package/packages/core/dist/memory/dream/admission.d.ts.map +1 -0
  205. package/packages/core/dist/memory/dream/admission.js +116 -0
  206. package/packages/core/dist/memory/dream/admission.js.map +1 -0
  207. package/packages/core/dist/memory/dream/candidate.d.ts +152 -0
  208. package/packages/core/dist/memory/dream/candidate.d.ts.map +1 -0
  209. package/packages/core/dist/memory/dream/candidate.js +547 -0
  210. package/packages/core/dist/memory/dream/candidate.js.map +1 -0
  211. package/packages/core/dist/memory/dream/evaluate.d.ts +394 -0
  212. package/packages/core/dist/memory/dream/evaluate.d.ts.map +1 -0
  213. package/packages/core/dist/memory/dream/evaluate.js +1032 -0
  214. package/packages/core/dist/memory/dream/evaluate.js.map +1 -0
  215. package/packages/core/dist/memory/dream/frame.d.ts +61 -0
  216. package/packages/core/dist/memory/dream/frame.d.ts.map +1 -0
  217. package/packages/core/dist/memory/dream/frame.js +292 -0
  218. package/packages/core/dist/memory/dream/frame.js.map +1 -0
  219. package/packages/core/dist/memory/dream/label.d.ts +370 -0
  220. package/packages/core/dist/memory/dream/label.d.ts.map +1 -0
  221. package/packages/core/dist/memory/dream/label.js +439 -0
  222. package/packages/core/dist/memory/dream/label.js.map +1 -0
  223. package/packages/core/dist/memory/dream/measure.d.ts +114 -0
  224. package/packages/core/dist/memory/dream/measure.d.ts.map +1 -0
  225. package/packages/core/dist/memory/dream/measure.js +205 -0
  226. package/packages/core/dist/memory/dream/measure.js.map +1 -0
  227. package/packages/core/dist/memory/dream/policy.d.ts +21 -0
  228. package/packages/core/dist/memory/dream/policy.d.ts.map +1 -0
  229. package/packages/core/dist/memory/dream/policy.js +157 -0
  230. package/packages/core/dist/memory/dream/policy.js.map +1 -0
  231. package/packages/core/dist/memory/dream/probe.d.ts +202 -0
  232. package/packages/core/dist/memory/dream/probe.d.ts.map +1 -0
  233. package/packages/core/dist/memory/dream/probe.js +671 -0
  234. package/packages/core/dist/memory/dream/probe.js.map +1 -0
  235. package/packages/core/dist/memory/dream/promote.d.ts +312 -0
  236. package/packages/core/dist/memory/dream/promote.d.ts.map +1 -0
  237. package/packages/core/dist/memory/dream/promote.js +528 -0
  238. package/packages/core/dist/memory/dream/promote.js.map +1 -0
  239. package/packages/core/dist/memory/dream/score.d.ts +103 -0
  240. package/packages/core/dist/memory/dream/score.d.ts.map +1 -0
  241. package/packages/core/dist/memory/dream/score.js +334 -0
  242. package/packages/core/dist/memory/dream/score.js.map +1 -0
  243. package/packages/core/dist/memory/dream/slots.d.ts +193 -0
  244. package/packages/core/dist/memory/dream/slots.d.ts.map +1 -0
  245. package/packages/core/dist/memory/dream/slots.js +0 -0
  246. package/packages/core/dist/memory/dream/slots.js.map +1 -0
  247. package/packages/core/dist/memory/dream/trajectory.d.ts +262 -0
  248. package/packages/core/dist/memory/dream/trajectory.d.ts.map +1 -0
  249. package/packages/core/dist/memory/dream/trajectory.js +366 -0
  250. package/packages/core/dist/memory/dream/trajectory.js.map +1 -0
  251. package/packages/core/dist/memory/extractor.d.ts +7 -0
  252. package/packages/core/dist/memory/extractor.d.ts.map +1 -1
  253. package/packages/core/dist/memory/extractor.js +35 -12
  254. package/packages/core/dist/memory/extractor.js.map +1 -1
  255. package/packages/core/dist/memory/gate.d.ts +43 -7
  256. package/packages/core/dist/memory/gate.d.ts.map +1 -1
  257. package/packages/core/dist/memory/gate.js +91 -4
  258. package/packages/core/dist/memory/gate.js.map +1 -1
  259. package/packages/core/dist/memory/recall.d.ts +57 -0
  260. package/packages/core/dist/memory/recall.d.ts.map +1 -1
  261. package/packages/core/dist/memory/recall.js +60 -123
  262. package/packages/core/dist/memory/recall.js.map +1 -1
  263. package/packages/core/dist/memory/sleep.d.ts +131 -4
  264. package/packages/core/dist/memory/sleep.d.ts.map +1 -1
  265. package/packages/core/dist/memory/sleep.js +2384 -65
  266. package/packages/core/dist/memory/sleep.js.map +1 -1
  267. package/packages/core/dist/memory/store.d.ts +564 -10
  268. package/packages/core/dist/memory/store.d.ts.map +1 -1
  269. package/packages/core/dist/memory/store.js +1673 -102
  270. package/packages/core/dist/memory/store.js.map +1 -1
  271. package/packages/core/dist/org/controller.d.ts +268 -4
  272. package/packages/core/dist/org/controller.d.ts.map +1 -1
  273. package/packages/core/dist/org/controller.js +2298 -248
  274. package/packages/core/dist/org/controller.js.map +1 -1
  275. package/packages/core/dist/org/ponytail.d.ts +1 -1
  276. package/packages/core/dist/org/ponytail.js +1 -1
  277. package/packages/core/dist/org/project-mcp.d.ts +3 -3
  278. package/packages/core/dist/org/prompts.d.ts +44 -30
  279. package/packages/core/dist/org/prompts.d.ts.map +1 -1
  280. package/packages/core/dist/org/prompts.js +209 -92
  281. package/packages/core/dist/org/prompts.js.map +1 -1
  282. package/packages/core/dist/org/questions.d.ts +104 -0
  283. package/packages/core/dist/org/questions.d.ts.map +1 -0
  284. package/packages/core/dist/org/questions.js +136 -0
  285. package/packages/core/dist/org/questions.js.map +1 -0
  286. package/packages/core/dist/org/review.d.ts +100 -0
  287. package/packages/core/dist/org/review.d.ts.map +1 -0
  288. package/packages/core/dist/org/review.js +256 -0
  289. package/packages/core/dist/org/review.js.map +1 -0
  290. package/packages/core/dist/org/store.d.ts +311 -2
  291. package/packages/core/dist/org/store.d.ts.map +1 -1
  292. package/packages/core/dist/org/store.js +981 -13
  293. package/packages/core/dist/org/store.js.map +1 -1
  294. package/packages/core/dist/org/tools.d.ts +33 -3
  295. package/packages/core/dist/org/tools.d.ts.map +1 -1
  296. package/packages/core/dist/org/tools.js +380 -67
  297. package/packages/core/dist/org/tools.js.map +1 -1
  298. package/packages/core/dist/providers/catalogue.d.ts +1 -1
  299. package/packages/core/dist/providers/catalogue.d.ts.map +1 -1
  300. package/packages/core/dist/providers/catalogue.js +2 -2
  301. package/packages/core/dist/providers/catalogue.js.map +1 -1
  302. package/packages/core/dist/providers/claude-code.d.ts +19 -3
  303. package/packages/core/dist/providers/claude-code.d.ts.map +1 -1
  304. package/packages/core/dist/providers/claude-code.js +501 -40
  305. package/packages/core/dist/providers/claude-code.js.map +1 -1
  306. package/packages/core/dist/providers/claude-tui.d.ts +288 -0
  307. package/packages/core/dist/providers/claude-tui.d.ts.map +1 -0
  308. package/packages/core/dist/providers/claude-tui.js +1118 -0
  309. package/packages/core/dist/providers/claude-tui.js.map +1 -0
  310. package/packages/core/dist/providers/codex-auth.d.ts +15 -0
  311. package/packages/core/dist/providers/codex-auth.d.ts.map +1 -0
  312. package/packages/core/dist/providers/codex-auth.js +127 -0
  313. package/packages/core/dist/providers/codex-auth.js.map +1 -0
  314. package/packages/core/dist/providers/codex-bridge.d.ts +58 -0
  315. package/packages/core/dist/providers/codex-bridge.d.ts.map +1 -0
  316. package/packages/core/dist/providers/codex-bridge.js +375 -0
  317. package/packages/core/dist/providers/codex-bridge.js.map +1 -0
  318. package/packages/core/dist/providers/codex-translate.d.ts +75 -0
  319. package/packages/core/dist/providers/codex-translate.d.ts.map +1 -0
  320. package/packages/core/dist/providers/codex-translate.js +383 -0
  321. package/packages/core/dist/providers/codex-translate.js.map +1 -0
  322. package/packages/core/dist/providers/model-gateway.d.ts +56 -0
  323. package/packages/core/dist/providers/model-gateway.d.ts.map +1 -0
  324. package/packages/core/dist/providers/model-gateway.js +119 -0
  325. package/packages/core/dist/providers/model-gateway.js.map +1 -0
  326. package/packages/core/dist/providers/process.d.ts +3 -1
  327. package/packages/core/dist/providers/process.d.ts.map +1 -1
  328. package/packages/core/dist/providers/process.js +3 -3
  329. package/packages/core/dist/providers/process.js.map +1 -1
  330. package/packages/core/dist/providers/profiles.d.ts +11 -0
  331. package/packages/core/dist/providers/profiles.d.ts.map +1 -0
  332. package/packages/core/dist/providers/profiles.js +28 -0
  333. package/packages/core/dist/providers/profiles.js.map +1 -0
  334. package/packages/core/dist/providers/provider-catalog.d.ts +72 -0
  335. package/packages/core/dist/providers/provider-catalog.d.ts.map +1 -0
  336. package/packages/core/dist/providers/provider-catalog.js +144 -0
  337. package/packages/core/dist/providers/provider-catalog.js.map +1 -0
  338. package/packages/core/dist/providers/quota.d.ts +40 -1
  339. package/packages/core/dist/providers/quota.d.ts.map +1 -1
  340. package/packages/core/dist/providers/quota.js +288 -25
  341. package/packages/core/dist/providers/quota.js.map +1 -1
  342. package/packages/core/dist/providers/registry.d.ts +46 -3
  343. package/packages/core/dist/providers/registry.d.ts.map +1 -1
  344. package/packages/core/dist/providers/registry.js +148 -13
  345. package/packages/core/dist/providers/registry.js.map +1 -1
  346. package/packages/core/dist/providers/router.d.ts +28 -0
  347. package/packages/core/dist/providers/router.d.ts.map +1 -0
  348. package/packages/core/dist/providers/router.js +88 -0
  349. package/packages/core/dist/providers/router.js.map +1 -0
  350. package/packages/core/dist/providers/user-settings-guard.d.ts +12 -0
  351. package/packages/core/dist/providers/user-settings-guard.d.ts.map +1 -0
  352. package/packages/core/dist/providers/user-settings-guard.js +130 -0
  353. package/packages/core/dist/providers/user-settings-guard.js.map +1 -0
  354. package/packages/core/dist/runtime.d.ts +193 -7
  355. package/packages/core/dist/runtime.d.ts.map +1 -1
  356. package/packages/core/dist/runtime.js +1676 -219
  357. package/packages/core/dist/runtime.js.map +1 -1
  358. package/packages/core/dist/skills/builtin.d.ts +34 -0
  359. package/packages/core/dist/skills/builtin.d.ts.map +1 -0
  360. package/packages/core/dist/skills/builtin.js +305 -0
  361. package/packages/core/dist/skills/builtin.js.map +1 -0
  362. package/packages/core/dist/skills/shelf.d.ts +30 -0
  363. package/packages/core/dist/skills/shelf.d.ts.map +1 -0
  364. package/packages/core/dist/skills/shelf.js +159 -0
  365. package/packages/core/dist/skills/shelf.js.map +1 -0
  366. package/packages/core/dist/skills/store.d.ts +66 -4
  367. package/packages/core/dist/skills/store.d.ts.map +1 -1
  368. package/packages/core/dist/skills/store.js +105 -18
  369. package/packages/core/dist/skills/store.js.map +1 -1
  370. package/packages/core/dist/skills/suggest.d.ts +21 -0
  371. package/packages/core/dist/skills/suggest.d.ts.map +1 -0
  372. package/packages/core/dist/skills/suggest.js +150 -0
  373. package/packages/core/dist/skills/suggest.js.map +1 -0
  374. package/packages/core/dist/tools/catalog.d.ts +1 -3
  375. package/packages/core/dist/tools/catalog.d.ts.map +1 -1
  376. package/packages/core/dist/tools/catalog.js +38 -26
  377. package/packages/core/dist/tools/catalog.js.map +1 -1
  378. package/packages/core/dist/tools/hub.d.ts +136 -10
  379. package/packages/core/dist/tools/hub.d.ts.map +1 -1
  380. package/packages/core/dist/tools/hub.js +418 -24
  381. package/packages/core/dist/tools/hub.js.map +1 -1
  382. package/packages/core/dist/turns/journal.d.ts +78 -0
  383. package/packages/core/dist/turns/journal.d.ts.map +1 -0
  384. package/packages/core/dist/turns/journal.js +104 -0
  385. package/packages/core/dist/turns/journal.js.map +1 -0
  386. package/packages/core/dist/types.d.ts +1776 -12
  387. package/packages/core/dist/types.d.ts.map +1 -1
  388. package/packages/core/dist/types.js.map +1 -1
  389. package/packages/core/dist/util/blocks.d.ts +41 -0
  390. package/packages/core/dist/util/blocks.d.ts.map +1 -0
  391. package/packages/core/dist/util/blocks.js +175 -0
  392. package/packages/core/dist/util/blocks.js.map +1 -0
  393. package/packages/core/dist/util/queue.d.ts +12 -0
  394. package/packages/core/dist/util/queue.d.ts.map +1 -1
  395. package/packages/core/dist/util/queue.js +16 -0
  396. package/packages/core/dist/util/queue.js.map +1 -1
  397. package/packages/core/dist/util/time.d.ts +39 -0
  398. package/packages/core/dist/util/time.d.ts.map +1 -0
  399. package/packages/core/dist/util/time.js +71 -0
  400. package/packages/core/dist/util/time.js.map +1 -0
  401. package/packages/core/package.json +1 -1
  402. package/packages/server/dist/auth.d.ts +14 -1
  403. package/packages/server/dist/auth.d.ts.map +1 -1
  404. package/packages/server/dist/auth.js +19 -0
  405. package/packages/server/dist/auth.js.map +1 -1
  406. package/packages/server/dist/context.d.ts +35 -1
  407. package/packages/server/dist/context.d.ts.map +1 -1
  408. package/packages/server/dist/context.js +39 -10
  409. package/packages/server/dist/context.js.map +1 -1
  410. package/packages/server/dist/gateways/attachments.d.ts +32 -0
  411. package/packages/server/dist/gateways/attachments.d.ts.map +1 -0
  412. package/packages/server/dist/gateways/attachments.js +167 -0
  413. package/packages/server/dist/gateways/attachments.js.map +1 -0
  414. package/packages/server/dist/gateways/markdown.d.ts +9 -0
  415. package/packages/server/dist/gateways/markdown.d.ts.map +1 -0
  416. package/packages/server/dist/gateways/markdown.js +170 -0
  417. package/packages/server/dist/gateways/markdown.js.map +1 -0
  418. package/packages/server/dist/gateways/push.d.ts +1 -1
  419. package/packages/server/dist/gateways/push.d.ts.map +1 -1
  420. package/packages/server/dist/gateways/push.js +420 -13
  421. package/packages/server/dist/gateways/push.js.map +1 -1
  422. package/packages/server/dist/gateways/telegram-api.d.ts +70 -1
  423. package/packages/server/dist/gateways/telegram-api.d.ts.map +1 -1
  424. package/packages/server/dist/gateways/telegram-api.js +140 -1
  425. package/packages/server/dist/gateways/telegram-api.js.map +1 -1
  426. package/packages/server/dist/gateways/telegram.d.ts +181 -1
  427. package/packages/server/dist/gateways/telegram.d.ts.map +1 -1
  428. package/packages/server/dist/gateways/telegram.js +1572 -78
  429. package/packages/server/dist/gateways/telegram.js.map +1 -1
  430. package/packages/server/dist/gateways/threads.d.ts +84 -0
  431. package/packages/server/dist/gateways/threads.d.ts.map +1 -0
  432. package/packages/server/dist/gateways/threads.js +289 -0
  433. package/packages/server/dist/gateways/threads.js.map +1 -0
  434. package/packages/server/dist/index.d.ts +2 -1
  435. package/packages/server/dist/index.d.ts.map +1 -1
  436. package/packages/server/dist/index.js +2 -1
  437. package/packages/server/dist/index.js.map +1 -1
  438. package/packages/server/dist/listeners/imap.d.ts +13 -0
  439. package/packages/server/dist/listeners/imap.d.ts.map +1 -0
  440. package/packages/server/dist/listeners/imap.js +0 -0
  441. package/packages/server/dist/listeners/imap.js.map +1 -0
  442. package/packages/server/dist/listeners/registry.d.ts +18 -0
  443. package/packages/server/dist/listeners/registry.d.ts.map +1 -0
  444. package/packages/server/dist/listeners/registry.js +88 -0
  445. package/packages/server/dist/listeners/registry.js.map +1 -0
  446. package/packages/server/dist/listeners/types.d.ts +55 -0
  447. package/packages/server/dist/listeners/types.d.ts.map +1 -0
  448. package/packages/server/dist/listeners/types.js +2 -0
  449. package/packages/server/dist/listeners/types.js.map +1 -0
  450. package/packages/server/dist/main.js +15 -1
  451. package/packages/server/dist/main.js.map +1 -1
  452. package/packages/server/dist/routes/chat.d.ts +7 -3
  453. package/packages/server/dist/routes/chat.d.ts.map +1 -1
  454. package/packages/server/dist/routes/chat.js +8 -17
  455. package/packages/server/dist/routes/chat.js.map +1 -1
  456. package/packages/server/dist/routes/config.d.ts.map +1 -1
  457. package/packages/server/dist/routes/config.js +66 -7
  458. package/packages/server/dist/routes/config.js.map +1 -1
  459. package/packages/server/dist/routes/cron.d.ts.map +1 -1
  460. package/packages/server/dist/routes/cron.js +65 -8
  461. package/packages/server/dist/routes/cron.js.map +1 -1
  462. package/packages/server/dist/routes/dream.d.ts +22 -0
  463. package/packages/server/dist/routes/dream.d.ts.map +1 -0
  464. package/packages/server/dist/routes/dream.js +152 -0
  465. package/packages/server/dist/routes/dream.js.map +1 -0
  466. package/packages/server/dist/routes/hooks.d.ts +18 -0
  467. package/packages/server/dist/routes/hooks.d.ts.map +1 -0
  468. package/packages/server/dist/routes/hooks.js +62 -0
  469. package/packages/server/dist/routes/hooks.js.map +1 -0
  470. package/packages/server/dist/routes/listeners.d.ts +10 -0
  471. package/packages/server/dist/routes/listeners.d.ts.map +1 -0
  472. package/packages/server/dist/routes/listeners.js +12 -0
  473. package/packages/server/dist/routes/listeners.js.map +1 -0
  474. package/packages/server/dist/routes/memories.d.ts.map +1 -1
  475. package/packages/server/dist/routes/memories.js +55 -3
  476. package/packages/server/dist/routes/memories.js.map +1 -1
  477. package/packages/server/dist/routes/org.d.ts.map +1 -1
  478. package/packages/server/dist/routes/org.js +289 -49
  479. package/packages/server/dist/routes/org.js.map +1 -1
  480. package/packages/server/dist/routes/profile.d.ts.map +1 -1
  481. package/packages/server/dist/routes/profile.js +6 -3
  482. package/packages/server/dist/routes/profile.js.map +1 -1
  483. package/packages/server/dist/routes/providers.d.ts.map +1 -1
  484. package/packages/server/dist/routes/providers.js +66 -7
  485. package/packages/server/dist/routes/providers.js.map +1 -1
  486. package/packages/server/dist/routes/questions.d.ts +45 -0
  487. package/packages/server/dist/routes/questions.d.ts.map +1 -0
  488. package/packages/server/dist/routes/questions.js +73 -0
  489. package/packages/server/dist/routes/questions.js.map +1 -0
  490. package/packages/server/dist/routes/sessions.d.ts.map +1 -1
  491. package/packages/server/dist/routes/sessions.js +26 -6
  492. package/packages/server/dist/routes/sessions.js.map +1 -1
  493. package/packages/server/dist/routes/sleep.d.ts.map +1 -1
  494. package/packages/server/dist/routes/sleep.js +71 -2
  495. package/packages/server/dist/routes/sleep.js.map +1 -1
  496. package/packages/server/dist/routes/terminals.d.ts +25 -0
  497. package/packages/server/dist/routes/terminals.d.ts.map +1 -0
  498. package/packages/server/dist/routes/terminals.js +35 -0
  499. package/packages/server/dist/routes/terminals.js.map +1 -0
  500. package/packages/server/dist/routes/tools.d.ts.map +1 -1
  501. package/packages/server/dist/routes/tools.js +140 -6
  502. package/packages/server/dist/routes/tools.js.map +1 -1
  503. package/packages/server/dist/routes/updates.d.ts +10 -0
  504. package/packages/server/dist/routes/updates.d.ts.map +1 -0
  505. package/packages/server/dist/routes/updates.js +22 -0
  506. package/packages/server/dist/routes/updates.js.map +1 -0
  507. package/packages/server/dist/routes/ws.d.ts +11 -5
  508. package/packages/server/dist/routes/ws.d.ts.map +1 -1
  509. package/packages/server/dist/routes/ws.js +168 -28
  510. package/packages/server/dist/routes/ws.js.map +1 -1
  511. package/packages/server/dist/schemas.d.ts +1177 -215
  512. package/packages/server/dist/schemas.d.ts.map +1 -1
  513. package/packages/server/dist/schemas.js +317 -12
  514. package/packages/server/dist/schemas.js.map +1 -1
  515. package/packages/server/dist/server.d.ts +7 -1
  516. package/packages/server/dist/server.d.ts.map +1 -1
  517. package/packages/server/dist/server.js +210 -3
  518. package/packages/server/dist/server.js.map +1 -1
  519. package/packages/server/dist/services/stream.d.ts +94 -5
  520. package/packages/server/dist/services/stream.d.ts.map +1 -1
  521. package/packages/server/dist/services/stream.js +9 -20
  522. package/packages/server/dist/services/stream.js.map +1 -1
  523. package/packages/server/dist/services/stt.d.ts +65 -0
  524. package/packages/server/dist/services/stt.d.ts.map +1 -0
  525. package/packages/server/dist/services/stt.js +306 -0
  526. package/packages/server/dist/services/stt.js.map +1 -0
  527. package/packages/server/dist/services/turns.d.ts +54 -0
  528. package/packages/server/dist/services/turns.d.ts.map +1 -0
  529. package/packages/server/dist/services/turns.js +186 -0
  530. package/packages/server/dist/services/turns.js.map +1 -0
  531. package/packages/server/dist/services/updates.d.ts +99 -0
  532. package/packages/server/dist/services/updates.d.ts.map +1 -0
  533. package/packages/server/dist/services/updates.js +316 -0
  534. package/packages/server/dist/services/updates.js.map +1 -0
  535. package/packages/server/package.json +1 -1
  536. package/packages/web/dist/app-icon.svg +2 -0
  537. package/packages/web/dist/apple-touch-icon.png +0 -0
  538. package/packages/web/dist/assets/abnfDiagram-O67JEVCF-D7YyFndQ.js +1 -0
  539. package/packages/web/dist/assets/arc-C_Zgk2dJ.js +1 -0
  540. package/packages/web/dist/assets/architectureDiagram-NJMV4G6O-eI0adu1B.js +36 -0
  541. package/packages/web/dist/assets/blockDiagram-BEXU5L5S-WAoOFUA9.js +140 -0
  542. package/packages/web/dist/assets/c4Diagram-YGBWAQC7-DE8Zyhng.js +38 -0
  543. package/packages/web/dist/assets/channel-egZxcyUK.js +1 -0
  544. package/packages/web/dist/assets/chunk-2Q5K7J3B-bnqLP2XD.js +1 -0
  545. package/packages/web/dist/assets/chunk-3FUC2YCW-Ck1_SVe0.js +2 -0
  546. package/packages/web/dist/assets/chunk-5VM5RSS4-hDmC41gD.js +15 -0
  547. package/packages/web/dist/assets/chunk-GTNCS2PH-PoWvfCrT.js +88 -0
  548. package/packages/web/dist/assets/chunk-GWA4HPMP-D3V0IG43.js +1 -0
  549. package/packages/web/dist/assets/chunk-JWPE2WC7-BryfpHM5.js +1 -0
  550. package/packages/web/dist/assets/chunk-NETBCI7D-8ic1iEdT.js +1 -0
  551. package/packages/web/dist/assets/chunk-WEXAMYUT-nM8tmQT2.js +1 -0
  552. package/packages/web/dist/assets/chunk-XXDRQBXY-Do28F482.js +1 -0
  553. package/packages/web/dist/assets/classDiagram-v2-NBCMYWYE-Bop9oNNO.js +217 -0
  554. package/packages/web/dist/assets/cose-bilkent-JH36ORCC-a7f_bpnt.js +1 -0
  555. package/packages/web/dist/assets/cynefin-OW5HDTMX-DnArcis_.js +178 -0
  556. package/packages/web/dist/assets/cynefinDiagram-VND7K2PF-vEuTb1GD.js +62 -0
  557. package/packages/web/dist/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
  558. package/packages/web/dist/assets/dagre-6A5THRUB-BgG4MynJ.js +4 -0
  559. package/packages/web/dist/assets/diagram-22UHCM2B-DRCQpafv.js +200 -0
  560. package/packages/web/dist/assets/diagram-3UASUU5V-BKgmAXde.js +24 -0
  561. package/packages/web/dist/assets/diagram-ATOU4E4O-B6Hsy36X.js +3 -0
  562. package/packages/web/dist/assets/diagram-CDSNMT55-JflyfyoB.js +30 -0
  563. package/packages/web/dist/assets/diagram-MLGK6HIB-Dd2QPJjT.js +24 -0
  564. package/packages/web/dist/assets/diagram-MPIPVDR6-DE5QU60x.js +41 -0
  565. package/packages/web/dist/assets/draco_decoder-C32yEggz.wasm +0 -0
  566. package/packages/web/dist/assets/draco_decoder-Z1_iN-Ht.wasm +0 -0
  567. package/packages/web/dist/assets/draco_decoder-fzg4nYZr.js +34 -0
  568. package/packages/web/dist/assets/draco_wasm_wrapper-DxJM36Ib.js +117 -0
  569. package/packages/web/dist/assets/draco_wasm_wrapper-fZCQGLGb.js +116 -0
  570. package/packages/web/dist/assets/ebnfDiagram-ZINNZB2B-D7AQ741b.js +1 -0
  571. package/packages/web/dist/assets/elk-276RUBZZ-CeewBVLF.js +27 -0
  572. package/packages/web/dist/assets/erDiagram-OPXOYQCR-mLLYkZ5c.js +99 -0
  573. package/packages/web/dist/assets/flowDiagram-KWPJA3E3-DtpSpsQN.js +213 -0
  574. package/packages/web/dist/assets/ganttDiagram-FUAMR5RP-1_lh-3ky.js +292 -0
  575. package/packages/web/dist/assets/gitGraphDiagram-X574FWY7-DoPXZuT5.js +106 -0
  576. package/packages/web/dist/assets/graph-Bn3Yngep.js +1 -0
  577. package/packages/web/dist/assets/index-Cw2Opmx7.js +648 -0
  578. package/packages/web/dist/assets/index-j0zBRCgT.css +32 -0
  579. package/packages/web/dist/assets/infoDiagram-VRGFBTTK-DQpRGGiD.js +2 -0
  580. package/packages/web/dist/assets/ishikawaDiagram-OU5B5YK6-gH5C9Q2e.js +70 -0
  581. package/packages/web/dist/assets/journeyDiagram-ZHPQQLJL-Bg-oeFjb.js +139 -0
  582. package/packages/web/dist/assets/kanban-definition-PNTS6WVX-BnpI4VH8.js +89 -0
  583. package/packages/web/dist/assets/katex-C5jXJg4s.js +257 -0
  584. package/packages/web/dist/assets/mermaid.core-BwBKxlRA.js +313 -0
  585. package/packages/web/dist/assets/mindmap-definition-NLK3R4M7-NBnnxEoO.js +96 -0
  586. package/packages/web/dist/assets/pegDiagram-GJSIUBJH-RrXXbIvO.js +1 -0
  587. package/packages/web/dist/assets/pieDiagram-5QR66LMP-B27q6Gso.js +39 -0
  588. package/packages/web/dist/assets/quadrantDiagram-O4NWA36T-DGDsdur2.js +7 -0
  589. package/packages/web/dist/assets/railroadDiagram-XR7U4H2S-GdjkE3mI.js +1 -0
  590. package/packages/web/dist/assets/requirementDiagram-PLB6GJNP-DjK0GfgO.js +84 -0
  591. package/packages/web/dist/assets/sankeyDiagram-IPEJSGJF-BG_AIkwF.js +40 -0
  592. package/packages/web/dist/assets/scene-D4LPicHk.js +4620 -0
  593. package/packages/web/dist/assets/sequenceDiagram-PO4LG4MO-CIQwUb4y.js +169 -0
  594. package/packages/web/dist/assets/sizeCapture-INFHLROL-bpIoPxdJ.js +1 -0
  595. package/packages/web/dist/assets/stateDiagram-v2-GCMORJYK-8hYXvPPv.js +291 -0
  596. package/packages/web/dist/assets/swimlanes-2SLR337P-gfflUMF9.js +1 -0
  597. package/packages/web/dist/assets/swimlanesDiagram-TC7HE7FX-9wdzGXU-.js +8 -0
  598. package/packages/web/dist/assets/timeline-definition-EJHVYXUP-PHMNoGTZ.js +120 -0
  599. package/packages/web/dist/assets/usecaseDiagram-POWQR4AR-B2j5iteO.js +370 -0
  600. package/packages/web/dist/assets/vennDiagram-UO4OBE2U-BzxtZ-_2.js +34 -0
  601. package/packages/web/dist/assets/wardleyDiagram-VNRHLVJA-DL7YbMpY.js +78 -0
  602. package/packages/web/dist/assets/xychartDiagram-PMCCYNJV-CisgP1cT.js +7 -0
  603. package/packages/web/dist/draco/draco_decoder.js +33 -0
  604. package/packages/web/dist/draco/draco_decoder.wasm +0 -0
  605. package/packages/web/dist/draco/draco_wasm_wrapper.js +116 -0
  606. package/packages/web/dist/favicon-16.png +0 -0
  607. package/packages/web/dist/favicon-32.png +0 -0
  608. package/packages/web/dist/favicon-48.png +0 -0
  609. package/packages/web/dist/favicon.ico +0 -0
  610. package/packages/web/dist/favicon.svg +1 -1
  611. package/packages/web/dist/icon-192.png +0 -0
  612. package/packages/web/dist/icon-512.png +0 -0
  613. package/packages/web/dist/index.html +12 -4
  614. package/packages/web/dist/logo-light.svg +1 -1
  615. package/packages/web/dist/logo-mono.svg +2 -0
  616. package/packages/web/dist/logo-stacked-light.svg +2 -0
  617. package/packages/web/dist/logo-stacked.svg +2 -0
  618. package/packages/web/dist/logo-white.svg +2 -0
  619. package/packages/web/dist/logo.svg +1 -1
  620. package/packages/web/dist/mark-light.svg +1 -1
  621. package/packages/web/dist/mark-mono.svg +2 -0
  622. package/packages/web/dist/mark-small-light.svg +2 -0
  623. package/packages/web/dist/mark-small.svg +2 -0
  624. package/packages/web/dist/mark-white.svg +2 -0
  625. package/packages/web/dist/mark.svg +1 -1
  626. package/packages/web/dist/models/LICENSE.txt +5 -0
  627. package/packages/web/dist/models/brain.glb +0 -0
  628. package/packages/web/dist/site.webmanifest +23 -0
  629. package/packages/web/dist/wordmark-light.svg +2 -0
  630. package/packages/web/dist/wordmark.svg +2 -0
  631. package/packages/web/package.json +1 -1
  632. package/scripts/rookery.mjs +204 -122
  633. package/scripts/updater.mjs +227 -0
  634. package/packages/cli/dist/tui/components/Wordmark.d.ts +0 -35
  635. package/packages/cli/dist/tui/components/Wordmark.d.ts.map +0 -1
  636. package/packages/cli/dist/tui/components/Wordmark.js +0 -81
  637. package/packages/cli/dist/tui/components/Wordmark.js.map +0 -1
  638. package/packages/core/dist/agents/orchestrator.d.ts +0 -24
  639. package/packages/core/dist/agents/orchestrator.d.ts.map +0 -1
  640. package/packages/core/dist/agents/orchestrator.js +0 -88
  641. package/packages/core/dist/agents/orchestrator.js.map +0 -1
  642. package/packages/core/dist/agents/roles.d.ts +0 -21
  643. package/packages/core/dist/agents/roles.d.ts.map +0 -1
  644. package/packages/core/dist/agents/roles.js +0 -81
  645. package/packages/core/dist/agents/roles.js.map +0 -1
  646. package/packages/core/dist/agents/team.d.ts +0 -105
  647. package/packages/core/dist/agents/team.d.ts.map +0 -1
  648. package/packages/core/dist/agents/team.js +0 -623
  649. package/packages/core/dist/agents/team.js.map +0 -1
  650. package/packages/core/dist/providers/codex.d.ts +0 -10
  651. package/packages/core/dist/providers/codex.d.ts.map +0 -1
  652. package/packages/core/dist/providers/codex.js +0 -375
  653. package/packages/core/dist/providers/codex.js.map +0 -1
  654. package/packages/core/dist/tools/browser.d.ts +0 -20
  655. package/packages/core/dist/tools/browser.d.ts.map +0 -1
  656. package/packages/core/dist/tools/browser.js +0 -72
  657. package/packages/core/dist/tools/browser.js.map +0 -1
  658. package/packages/server/dist/routes/agents.d.ts +0 -5
  659. package/packages/server/dist/routes/agents.d.ts.map +0 -1
  660. package/packages/server/dist/routes/agents.js +0 -6
  661. package/packages/server/dist/routes/agents.js.map +0 -1
  662. package/packages/server/dist/routes/team.d.ts +0 -11
  663. package/packages/server/dist/routes/team.d.ts.map +0 -1
  664. package/packages/server/dist/routes/team.js +0 -36
  665. package/packages/server/dist/routes/team.js.map +0 -1
  666. package/packages/web/dist/assets/3d-force-graph-BPZmoydi.js +0 -1163
  667. package/packages/web/dist/assets/index-IBSTzK7-.js +0 -1255
  668. package/packages/web/dist/assets/index-qUXUui7W.css +0 -1
  669. package/packages/web/dist/assets/three-spritetext-B9ZIW7c-.js +0 -4
  670. package/packages/web/dist/assets/three.module-cmFfBtHS.js +0 -4228
@@ -0,0 +1,713 @@
1
+ import { compiledSource } from './assemblies.js';
2
+ import { CURSOR } from './cursor.js';
3
+ /**
4
+ * A process-owned WPF overlay; closing the MCP worker also removes the window.
5
+ *
6
+ * All motion runs here in C#, never in PowerShell script: one step is one
7
+ * SetCursorPos plus one SetWindowPos on a steady ~2 ms cadence, so the real
8
+ * pointer and the overlay move together and every refresh shows a fresh step.
9
+ * Positions are physical pixels throughout; the window offset of the tip is
10
+ * the only place the DPI scale enters.
11
+ */
12
+ export const OVERLAY = `
13
+ namespace Rookery {
14
+ using System;
15
+ using System.Diagnostics;
16
+ using System.IO;
17
+ using System.Threading;
18
+ using System.Runtime.InteropServices;
19
+ using System.Windows;
20
+ using System.Windows.Controls;
21
+ using System.Windows.Interop;
22
+ using System.Windows.Media;
23
+ using System.Windows.Media.Animation;
24
+ using System.Windows.Media.Imaging;
25
+ using System.Windows.Shapes;
26
+ using System.Windows.Threading;
27
+
28
+ public sealed class AgentPointer : Window {
29
+ // Where the tip of the pointer sits inside the 56 px glyph bitmap.
30
+ const double Tip = ${12 + CURSOR.hotspot};
31
+ // Stopwatch timestamp of the last mouse event a human made (not injected); 0 until then.
32
+ static long humanAt;
33
+ static Thread watcher;
34
+ static HookProc hook;
35
+ static AgentPointer pointer;
36
+ static Dispatcher ui;
37
+ static readonly ManualResetEvent ready = new ManualResetEvent(false);
38
+ static Exception failure;
39
+ static Thread worker;
40
+ static readonly object gate = new object();
41
+ static double tipX, tipY, offsetX, offsetY;
42
+ static int ticket;
43
+ static Thread mover;
44
+ public static IntPtr Handle { get; private set; }
45
+ readonly DispatcherTimer idle = new DispatcherTimer();
46
+ readonly TextBlock label = new TextBlock();
47
+ readonly Image glyph = new Image();
48
+ readonly Border badge = new Border();
49
+ readonly Ellipse pulse = new Ellipse();
50
+ readonly Canvas canvas = new Canvas();
51
+ bool capturing;
52
+ bool shouldShow;
53
+
54
+ [StructLayout(LayoutKind.Sequential)] struct POINT { public int X, Y; }
55
+ [StructLayout(LayoutKind.Sequential)] struct MOUSEINPUT { public int dx, dy; public uint data, flags, time; public IntPtr extra; }
56
+ // MOUSEINPUT is the largest member of the INPUT union, so this has the native size.
57
+ [StructLayout(LayoutKind.Sequential)] struct INPUT { public uint type; public MOUSEINPUT mi; }
58
+ [StructLayout(LayoutKind.Sequential)] struct HOOKINFO { public POINT pt; public uint data, flags, time; public IntPtr extra; }
59
+ [StructLayout(LayoutKind.Sequential)] struct MSG { public IntPtr h; public uint message; public IntPtr w, l; public uint time; public POINT pt; }
60
+ delegate IntPtr HookProc(int code, IntPtr w, IntPtr l);
61
+ [DllImport("user32.dll")] static extern uint SendInput(uint n, INPUT[] inputs, int size);
62
+ [DllImport("user32.dll", SetLastError = true)] static extern IntPtr SetWindowsHookEx(int id, HookProc proc, IntPtr module, uint thread);
63
+ [DllImport("user32.dll")] static extern IntPtr CallNextHookEx(IntPtr hook, int code, IntPtr w, IntPtr l);
64
+ [DllImport("user32.dll")] static extern int GetMessage(out MSG msg, IntPtr h, uint min, uint max);
65
+ [DllImport("kernel32.dll")] static extern IntPtr GetModuleHandle(string name);
66
+ [DllImport("user32.dll")] static extern int GetWindowLong(IntPtr h, int index);
67
+ [DllImport("user32.dll")] static extern int SetWindowLong(IntPtr h, int index, int value);
68
+ [DllImport("user32.dll")] static extern IntPtr WindowFromPoint(POINT point);
69
+ [DllImport("user32.dll")] static extern IntPtr GetAncestor(IntPtr h, uint flags);
70
+ [DllImport("user32.dll")] static extern bool IsWindowVisible(IntPtr h);
71
+ [DllImport("user32.dll")] static extern bool IsIconic(IntPtr h);
72
+ [DllImport("user32.dll")] static extern bool SystemParametersInfo(uint action, uint parameter, out bool value, uint flags);
73
+ [DllImport("user32.dll")] static extern bool SetWindowPos(IntPtr h, IntPtr after, int x, int y, int cx, int cy, uint flags);
74
+ [DllImport("user32.dll")] static extern bool SetCursorPos(int x, int y);
75
+ [DllImport("user32.dll")] static extern bool GetCursorPos(out POINT p);
76
+ [DllImport("winmm.dll")] static extern uint timeBeginPeriod(uint ms);
77
+ [DllImport("winmm.dll")] static extern uint timeEndPeriod(uint ms);
78
+
79
+ AgentPointer(byte[] png) {
80
+ Width = 220; Height = 104;
81
+ WindowStyle = WindowStyle.None; ResizeMode = ResizeMode.NoResize;
82
+ AllowsTransparency = true; Background = Brushes.Transparent;
83
+ ShowActivated = false; ShowInTaskbar = false; Topmost = true;
84
+ Focusable = false; IsHitTestVisible = false;
85
+ var bitmap = new BitmapImage();
86
+ using (var stream = new MemoryStream(png)) {
87
+ bitmap.BeginInit(); bitmap.CacheOption = BitmapCacheOption.OnLoad;
88
+ bitmap.StreamSource = stream; bitmap.EndInit(); bitmap.Freeze();
89
+ }
90
+ glyph.Source = bitmap; glyph.Width = 56; glyph.Height = 56;
91
+ glyph.RenderTransformOrigin = new Point(Tip / 56, Tip / 56);
92
+ glyph.RenderTransform = new ScaleTransform(1, 1);
93
+ Canvas.SetTop(glyph, 28);
94
+ pulse.Width = 28; pulse.Height = 28; pulse.Opacity = 0;
95
+ pulse.Stroke = new SolidColorBrush(Color.FromRgb(131, 227, 209)); pulse.StrokeThickness = 1.5;
96
+ pulse.RenderTransformOrigin = new Point(0.5, 0.5);
97
+ pulse.RenderTransform = new ScaleTransform(1, 1);
98
+ label.FontFamily = new FontFamily("Segoe UI"); label.FontSize = 11;
99
+ label.Foreground = new SolidColorBrush(Color.FromRgb(238, 249, 245));
100
+ label.Text = "Rookery · Ready";
101
+ badge.Child = label; badge.CornerRadius = new CornerRadius(9);
102
+ badge.Padding = new Thickness(11, 6, 11, 6);
103
+ badge.Background = new SolidColorBrush(Color.FromArgb(240, 18, 30, 29));
104
+ badge.BorderBrush = new SolidColorBrush(Color.FromArgb(90, 131, 227, 209));
105
+ badge.BorderThickness = new Thickness(1);
106
+ canvas.Children.Add(pulse); canvas.Children.Add(glyph); canvas.Children.Add(badge);
107
+ Content = canvas;
108
+ idle.Interval = TimeSpan.FromSeconds(2);
109
+ idle.Tick += delegate { idle.Stop(); label.Text = "Rookery · Waiting"; };
110
+ new WindowInteropHelper(this).EnsureHandle();
111
+ }
112
+
113
+ protected override void OnSourceInitialized(EventArgs e) {
114
+ base.OnSourceInitialized(e);
115
+ Handle = new WindowInteropHelper(this).Handle;
116
+ // WS_EX_NOACTIVATE | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW: never focused, never hit.
117
+ SetWindowLong(Handle, -20, GetWindowLong(Handle, -20) | 0x08000000 | 0x20 | 0x80);
118
+ HwndSource.FromHwnd(Handle).AddHook(delegate(IntPtr h, int msg, IntPtr w, IntPtr l, ref bool handled) {
119
+ if (msg == 0x84) { handled = true; return new IntPtr(-1); } // HTTRANSPARENT
120
+ if (msg == 0x21) { handled = true; return new IntPtr(3); } // MA_NOACTIVATE
121
+ return IntPtr.Zero;
122
+ });
123
+ }
124
+
125
+ /** Start the overlay thread once; throws if the overlay cannot exist. */
126
+ public static void Start(byte[] png) {
127
+ if (worker == null) {
128
+ worker = new Thread(delegate() {
129
+ try { ui = Dispatcher.CurrentDispatcher; pointer = new AgentPointer(png); }
130
+ catch (Exception error) { failure = error; }
131
+ finally { ready.Set(); }
132
+ if (failure == null) Dispatcher.Run();
133
+ });
134
+ worker.IsBackground = true; worker.SetApartmentState(ApartmentState.STA); worker.Start();
135
+ Watch();
136
+ }
137
+ if (!ready.WaitOne(5000)) throw new TimeoutException("Cursor overlay startup timed out.");
138
+ if (failure != null) throw new InvalidOperationException("Cursor overlay is unavailable.", failure);
139
+ if (watcher == null) throw new InvalidOperationException("Cannot watch for the user taking over the mouse.");
140
+ }
141
+
142
+ /**
143
+ * A low-level mouse hook on its own message loop. It only notes when a
144
+ * human touched the mouse: injected events carry LLMHF_INJECTED, so our own
145
+ * moves never count, while a user grabbing the mouse always does. There is
146
+ * deliberately no keyboard hook: a script installing one is what keyloggers
147
+ * look like, and antivirus (AMSI) blocks the whole worker for it.
148
+ */
149
+ static void Watch() {
150
+ var installed = new ManualResetEvent(false);
151
+ bool ok = false;
152
+ var thread = new Thread(delegate() {
153
+ hook = delegate(int code, IntPtr w, IntPtr l) {
154
+ if (code >= 0 && (((HOOKINFO)Marshal.PtrToStructure(l, typeof(HOOKINFO))).flags & 0x1) == 0)
155
+ Interlocked.Exchange(ref humanAt, Stopwatch.GetTimestamp());
156
+ return CallNextHookEx(IntPtr.Zero, code, w, l);
157
+ };
158
+ ok = SetWindowsHookEx(14, hook, GetModuleHandle(null), 0) != IntPtr.Zero; // WH_MOUSE_LL
159
+ installed.Set();
160
+ if (!ok) return;
161
+ MSG msg;
162
+ while (GetMessage(out msg, IntPtr.Zero, 0, 0) > 0) { }
163
+ });
164
+ thread.IsBackground = true; thread.Start();
165
+ installed.WaitOne(5000);
166
+ if (ok) watcher = thread;
167
+ }
168
+
169
+ /**
170
+ * Put the overlay at a point. Without follow it travels there on its own
171
+ * thread; Settle waits for it. False when a background target is covered.
172
+ */
173
+ public static bool ShowPointer(long window, int x, int y, string action, bool follow) {
174
+ int my = Interlocked.Increment(ref ticket);
175
+ int was = (int)ui.Invoke(new Func<int>(delegate { return pointer.Begin(new IntPtr(window), x, y, action); }));
176
+ if (was < 0) return false;
177
+ double fromX, fromY;
178
+ lock (gate) { fromX = tipX; fromY = tipY; }
179
+ int ms = follow || was == 0 ? 0 : Duration(Distance(fromX, fromY, x, y));
180
+ if (ms == 0) { MoveTo(x, y, false); Reveal(); return true; }
181
+ Reveal();
182
+ var thread = new Thread(delegate() { Animate(my, false, 0, 0, fromX, fromY, x, y, ms); });
183
+ thread.IsBackground = true; mover = thread; thread.Start();
184
+ return true;
185
+ }
186
+
187
+ /** Wait until an overlay-only move has arrived. */
188
+ public static void Settle() {
189
+ Thread thread = mover;
190
+ if (thread != null) thread.Join(1000);
191
+ }
192
+
193
+ /** Move the real pointer to a point on a slight arc, the overlay with it. Null on arrival, else why it stopped. */
194
+ public static string Glide(int x, int y, string action) {
195
+ int my = Interlocked.Increment(ref ticket);
196
+ Settle();
197
+ POINT start; GetCursorPos(out start);
198
+ int was = (int)ui.Invoke(new Func<int>(delegate { return pointer.Begin(IntPtr.Zero, x, y, action); }));
199
+ double fromX = start.X, fromY = start.Y;
200
+ if (was == 1) { lock (gate) { fromX = tipX; fromY = tipY; } }
201
+ else MoveTo(fromX, fromY, false);
202
+ Reveal();
203
+ return Animate(my, true, start.X, start.Y, fromX, fromY, x, y, Duration(Distance(start.X, start.Y, x, y)));
204
+ }
205
+
206
+ /**
207
+ * Draw a whole picture in one call. packed is the stroke count, then per
208
+ * stroke its point count and its x, y pairs. Each stroke: a quick pen-up
209
+ * hop to its start, press, trace, release. Null when done, else why it
210
+ * stopped; the button is always released.
211
+ */
212
+ public static string Draw(int[] packed, bool right, string action) {
213
+ int count = packed[0];
214
+ int my = Interlocked.Increment(ref ticket);
215
+ Settle();
216
+ POINT now; GetCursorPos(out now);
217
+ ui.Invoke(new Func<int>(delegate { return pointer.Begin(IntPtr.Zero, now.X, now.Y, action); }));
218
+ MoveTo(now.X, now.Y, false);
219
+ Reveal();
220
+ uint down = right ? 0x0008u : 0x0002u, up = right ? 0x0010u : 0x0004u;
221
+ long since = Stopwatch.GetTimestamp();
222
+ timeBeginPeriod(1);
223
+ try {
224
+ for (int k = 0, at = 1; k < count; k++) {
225
+ int n = packed[at++];
226
+ var points = new int[2 * n];
227
+ Array.Copy(packed, at, points, 0, 2 * n);
228
+ at += 2 * n;
229
+ if (count > 1) Label(action + " · " + (k + 1) + "/" + count);
230
+ GetCursorPos(out now);
231
+ double hop = Distance(now.X, now.Y, points[0], points[1]);
232
+ // Pen up: a short, fast hop; the show is the ink, not the travel.
233
+ int ms = hop < 3 ? 0 : (int)Math.Min(140, 40 + 20 * Math.Log(1 + hop / 24, 2));
234
+ string stop = Animate(my, true, now.X, now.Y, now.X, now.Y, points[0], points[1], ms);
235
+ if (stop != null) return stop;
236
+ if (Interlocked.Read(ref humanAt) > since) return TakenOver;
237
+ Button(down);
238
+ try {
239
+ // Short holds at both ends let apps tell a stroke from a click.
240
+ Thread.Sleep(8);
241
+ if (n > 1) {
242
+ stop = Trace(points, since);
243
+ if (stop != null) return stop;
244
+ Thread.Sleep(8);
245
+ }
246
+ } finally { Button(up); }
247
+ }
248
+ return null;
249
+ } finally { timeEndPeriod(1); }
250
+ }
251
+
252
+ /**
253
+ * Trace a polyline with the held button: straight segments, every vertex
254
+ * hit exactly, a short dwell at sharp corners so apps that sample the
255
+ * pointer per frame cannot round them off, and no two consecutive events
256
+ * more than 2 px apart, because stamp brushes (calligraphy, watercolour)
257
+ * paint only where an event lands.
258
+ */
259
+ static string Trace(int[] points, long since) {
260
+ int n = points.Length / 2;
261
+ var along = new double[n];
262
+ for (int i = 1; i < n; i++) along[i] = along[i - 1] + Distance(points[2 * i - 2], points[2 * i - 1], points[2 * i], points[2 * i + 1]);
263
+ double length = along[n - 1];
264
+ // About 3.5 px per ms of ink, eased; long strokes are capped rather than slowed further.
265
+ int ms = (int)Math.Min(4000, Math.Max(40, length / 3.5));
266
+ int px = points[0], py = points[1];
267
+ string stop;
268
+ var clock = Stopwatch.StartNew();
269
+ double paused = 0;
270
+ int next = 1;
271
+ while (true) {
272
+ double t = Math.Min(1, (clock.Elapsed.TotalMilliseconds - paused) / ms);
273
+ double d = t * t * t * (10 - 15 * t + 6 * t * t) * length;
274
+ for (; next < n && along[next] <= d; next++) {
275
+ stop = Ink(points[2 * next], points[2 * next + 1], ref px, ref py, since);
276
+ if (stop != null) return stop;
277
+ if (next < n - 1 && Sharp(points, next)) {
278
+ double before = clock.Elapsed.TotalMilliseconds;
279
+ Thread.Sleep(8);
280
+ paused += clock.Elapsed.TotalMilliseconds - before;
281
+ }
282
+ }
283
+ if (next < n && along[next] > along[next - 1]) {
284
+ double f = (d - along[next - 1]) / (along[next] - along[next - 1]);
285
+ int ax = points[2 * next - 2], ay = points[2 * next - 1];
286
+ stop = Ink((int)Math.Round(ax + (points[2 * next] - ax) * f), (int)Math.Round(ay + (points[2 * next + 1] - ay) * f), ref px, ref py, since);
287
+ if (stop != null) return stop;
288
+ }
289
+ if (t >= 1) { Land(points[2 * n - 2], points[2 * n - 1]); return null; }
290
+ Pace(clock);
291
+ }
292
+ }
293
+
294
+ /** Move from (px, py) to (x, y) in events at most 2 px apart, sent as one batch. */
295
+ static string Ink(int x, int y, ref int px, ref int py, long since) {
296
+ if (Interlocked.Read(ref humanAt) > since) return TakenOver;
297
+ int count = Math.Max(1, (int)Math.Ceiling(Distance(px, py, x, y) / 2));
298
+ var screen = System.Windows.Forms.SystemInformation.VirtualScreen;
299
+ var inputs = new INPUT[count];
300
+ for (int i = 1; i <= count; i++)
301
+ inputs[i - 1] = Move((int)Math.Round(px + (x - px) * (double)i / count), (int)Math.Round(py + (y - py) * (double)i / count), screen);
302
+ if (SendInput((uint)count, inputs, Marshal.SizeOf(typeof(INPUT))) != count)
303
+ return "Stopped: Windows refused the pointer input (a secure or elevated window is in front). Take a fresh screenshot.";
304
+ px = x; py = y;
305
+ MoveTo(x, y, true);
306
+ return null;
307
+ }
308
+
309
+ /** A button press or release, injected like the moves. */
310
+ static void Button(uint flags) {
311
+ var input = new INPUT[1];
312
+ input[0].mi.flags = flags;
313
+ SendInput(1, input, Marshal.SizeOf(typeof(INPUT)));
314
+ }
315
+
316
+ static void Label(string text) {
317
+ ui.BeginInvoke(new Action(delegate {
318
+ pointer.label.Text = "Rookery · " + text;
319
+ pointer.idle.Stop();
320
+ }));
321
+ }
322
+
323
+ /** Click feedback at the current tip: a ripple and a short press of the glyph. */
324
+ public static void Pulse(string action) {
325
+ if (ui == null || pointer == null) return;
326
+ ui.BeginInvoke(new Action(delegate {
327
+ pointer.label.Text = "Rookery · " + action;
328
+ pointer.idle.Stop();
329
+ if (Animations()) pointer.Ripple();
330
+ }));
331
+ }
332
+
333
+ public static void Status(string action) {
334
+ if (ui == null || pointer == null) return;
335
+ ui.Invoke(new Action(delegate {
336
+ pointer.label.Text = "Rookery · " + action;
337
+ pointer.idle.Stop();
338
+ }));
339
+ }
340
+
341
+ public static void Complete() {
342
+ if (ui == null || pointer == null) return;
343
+ ui.Invoke(new Action(delegate {
344
+ if (pointer.shouldShow) pointer.idle.Start();
345
+ }));
346
+ }
347
+
348
+ /** The turn is over: fade out and stay hidden until an action reveals it again. Returns once it is gone. */
349
+ public static void Dismiss() {
350
+ if (ui == null || pointer == null) return;
351
+ var gone = new ManualResetEvent(false);
352
+ ui.Invoke(new Action(delegate { pointer.FadeOut(gone); }));
353
+ gone.WaitOne(500);
354
+ }
355
+
356
+ /** UI thread. */
357
+ void FadeOut(ManualResetEvent gone) {
358
+ idle.Stop();
359
+ shouldShow = false;
360
+ if (!IsVisible || !Animations()) { Hide(); gone.Set(); return; }
361
+ label.Text = "Rookery · Done";
362
+ var fade = new DoubleAnimation(0, TimeSpan.FromMilliseconds(260)) { BeginTime = TimeSpan.FromMilliseconds(120), EasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseIn } };
363
+ fade.Completed += delegate {
364
+ // A reveal during the fade already took the animation off and wants the pointer shown.
365
+ if (!shouldShow) { Hide(); BeginAnimation(OpacityProperty, null); Opacity = 1; }
366
+ gone.Set();
367
+ };
368
+ BeginAnimation(OpacityProperty, fade);
369
+ }
370
+
371
+ public static void Capture(bool hide) {
372
+ if (ui == null || pointer == null) return;
373
+ ui.Invoke(new Action(delegate {
374
+ pointer.capturing = hide;
375
+ if (hide) pointer.Hide();
376
+ else if (pointer.shouldShow) pointer.Show();
377
+ }));
378
+ }
379
+
380
+ public static string StatusText {
381
+ get { return pointer == null ? "" : (string)ui.Invoke(new Func<string>(delegate { return pointer.label.Text; })); }
382
+ }
383
+
384
+ /** UI thread: -1 covered target (hidden), 0 was hidden, 1 was visible. */
385
+ int Begin(IntPtr target, int x, int y, string action) {
386
+ idle.Stop();
387
+ // Never paint a background action over a different app covering its target.
388
+ // The overlay itself is transparent to WindowFromPoint, so it need not hide first.
389
+ if (target != IntPtr.Zero && (!IsWindowVisible(target) || IsIconic(target) ||
390
+ GetAncestor(WindowFromPoint(new POINT { X = x, Y = y }), 2) != target)) {
391
+ shouldShow = false;
392
+ Hide();
393
+ return -1;
394
+ }
395
+ label.Text = "Rookery · " + action;
396
+ int was = IsVisible ? 1 : 0;
397
+ Layout(x, y);
398
+ return was;
399
+ }
400
+
401
+ /** UI thread: keep the badge on screen at the destination and remember where the tip sits. */
402
+ void Layout(int x, int y) {
403
+ var scale = HwndSource.FromHwnd(Handle).CompositionTarget.TransformToDevice;
404
+ var area = System.Windows.Forms.Screen.FromPoint(new System.Drawing.Point(x, y)).WorkingArea;
405
+ bool flip = x + 200 * scale.M11 > area.Right;
406
+ double left = flip ? 164 : 0;
407
+ Canvas.SetLeft(glyph, left);
408
+ Canvas.SetLeft(pulse, left + Tip - 14);
409
+ Canvas.SetTop(pulse, 28 + Tip - 14);
410
+ Canvas.SetLeft(badge, flip ? 0 : 40);
411
+ Canvas.SetTop(badge, y + 60 * scale.M22 > area.Bottom ? 0 : 66);
412
+ double tx, ty;
413
+ lock (gate) { offsetX = (left + Tip) * scale.M11; offsetY = (28 + Tip) * scale.M22; tx = tipX; ty = tipY; }
414
+ // A flipped layout must not make the visible tip jump.
415
+ if (IsVisible) MoveTo(tx, ty, false);
416
+ }
417
+
418
+ void Ripple() {
419
+ var fade = new QuadraticEase { EasingMode = EasingMode.EaseOut };
420
+ pulse.BeginAnimation(OpacityProperty, new DoubleAnimation(0.85, 0, TimeSpan.FromMilliseconds(380)) { EasingFunction = fade });
421
+ var ring = (ScaleTransform)pulse.RenderTransform;
422
+ var grow = new DoubleAnimation(0.4, 1.7, TimeSpan.FromMilliseconds(380)) { EasingFunction = fade };
423
+ ring.BeginAnimation(ScaleTransform.ScaleXProperty, grow);
424
+ ring.BeginAnimation(ScaleTransform.ScaleYProperty, grow);
425
+ var press = (ScaleTransform)glyph.RenderTransform;
426
+ var squeeze = new DoubleAnimation(1, 0.82, TimeSpan.FromMilliseconds(70)) { AutoReverse = true, EasingFunction = new QuadraticEase() };
427
+ press.BeginAnimation(ScaleTransform.ScaleXProperty, squeeze);
428
+ press.BeginAnimation(ScaleTransform.ScaleYProperty, squeeze);
429
+ }
430
+
431
+ /** Show the pointer; from hidden it fades in instead of popping up. */
432
+ static void Reveal() {
433
+ ui.Invoke(new Action(delegate {
434
+ pointer.shouldShow = true;
435
+ bool appearing = !pointer.IsVisible;
436
+ pointer.BeginAnimation(OpacityProperty, null);
437
+ pointer.Opacity = 1;
438
+ if (pointer.capturing) return;
439
+ pointer.Show();
440
+ if (appearing && Animations())
441
+ pointer.BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(140)) { EasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseOut } });
442
+ }));
443
+ }
444
+
445
+ /** One SetWindowPos per frame; async so a busy UI thread never stalls the pointer. */
446
+ static void MoveTo(double x, double y, bool async) {
447
+ int left, top;
448
+ lock (gate) {
449
+ tipX = x; tipY = y;
450
+ left = (int)Math.Round(x - offsetX); top = (int)Math.Round(y - offsetY);
451
+ }
452
+ // SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER [| SWP_ASYNCWINDOWPOS]
453
+ SetWindowPos(Handle, IntPtr.Zero, left, top, 0, 0, 0x0001u | 0x0004u | 0x0010u | 0x0200u | (async ? 0x4000u : 0u));
454
+ }
455
+
456
+ static bool Animations() {
457
+ bool enabled;
458
+ return !SystemParametersInfo(0x1042, 0, out enabled, 0) || enabled; // SPI_GETCLIENTAREAANIMATION
459
+ }
460
+
461
+ static double Distance(double ax, double ay, double bx, double by) {
462
+ return Math.Sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
463
+ }
464
+
465
+ /** Fitts-like: short hops are quick, long travel grows only logarithmically. */
466
+ static int Duration(double distance) {
467
+ if (distance < 3 || !Animations()) return 0;
468
+ return (int)Math.Min(280, 90 + 30 * Math.Log(1 + distance / 24, 2));
469
+ }
470
+
471
+ /** Control point of a slight arc, as a hand moves; straight for short hops, kept on screen. */
472
+ static void Arc(double ax, double ay, double bx, double by, out double cx, out double cy) {
473
+ double dx = bx - ax, dy = by - ay, d = Math.Sqrt(dx * dx + dy * dy);
474
+ cx = (ax + bx) / 2; cy = (ay + by) / 2;
475
+ if (d < 60) return;
476
+ double bend = Math.Min(40, d * 0.08) * (dx >= 0 ? -1 : 1) / d;
477
+ var screen = System.Windows.Forms.SystemInformation.VirtualScreen;
478
+ cx = Math.Max(screen.Left, Math.Min(screen.Right - 1, cx - dy * bend));
479
+ cy = Math.Max(screen.Top, Math.Min(screen.Bottom - 1, cy + dx * bend));
480
+ }
481
+
482
+ static double Curve(double a, double c, double b, double s) {
483
+ return (1 - s) * (1 - s) * a + 2 * (1 - s) * s * c + s * s * b;
484
+ }
485
+
486
+ /**
487
+ * Step every ~2 ms instead of waiting on DwmFlush: with displays of mixed
488
+ * refresh rates its clock beats (3-10 ms steps on a 240 Hz screen). A fine,
489
+ * steady cadence means every refresh shows a position at most 2 ms old.
490
+ */
491
+ static void Pace(Stopwatch clock) {
492
+ double next = clock.Elapsed.TotalMilliseconds + 2;
493
+ while (clock.Elapsed.TotalMilliseconds < next) Thread.Sleep(1);
494
+ }
495
+
496
+ const string TakenOver = "Stopped: the user moved the mouse, so the agent let go. Nothing further was sent. Take a fresh screenshot before continuing.";
497
+
498
+ /**
499
+ * One real mouse move, injected like hardware input so apps that read
500
+ * pointer or raw input (Paint, canvases, games) see it; SetCursorPos alone
501
+ * only teleports the cursor. NOCOALESCE keeps every step, so corners and
502
+ * curves survive. Refuses once a human touched the mouse since the motion began.
503
+ */
504
+ static string Step(int x, int y, long since, bool follow) {
505
+ if (Interlocked.Read(ref humanAt) > since) return TakenOver;
506
+ var input = new[] { Move(x, y, System.Windows.Forms.SystemInformation.VirtualScreen) };
507
+ if (SendInput(1, input, Marshal.SizeOf(typeof(INPUT))) != 1)
508
+ return "Stopped: Windows refused the pointer input (a secure or elevated window is in front). Take a fresh screenshot.";
509
+ if (follow) MoveTo(x, y, true);
510
+ return null;
511
+ }
512
+
513
+ /** An absolute, uncoalesced move to a pixel of the virtual desktop. */
514
+ static INPUT Move(int x, int y, System.Drawing.Rectangle screen) {
515
+ var input = new INPUT();
516
+ // The smallest normalized value that lands in pixel x: Windows floors n * width / 65536.
517
+ input.mi.dx = (int)Math.Ceiling((x - screen.Left) * 65536.0 / screen.Width);
518
+ input.mi.dy = (int)Math.Ceiling((y - screen.Top) * 65536.0 / screen.Height);
519
+ input.mi.flags = 0x0001 | 0x2000 | 0x4000 | 0x8000; // MOVE | MOVE_NOCOALESCE | VIRTUALDESK | ABSOLUTE
520
+ return input;
521
+ }
522
+
523
+ /** Injected moves apply asynchronously; wait for the last one, then pin the exact pixel. */
524
+ static void Land(int x, int y) {
525
+ var clock = Stopwatch.StartNew();
526
+ POINT now;
527
+ while (GetCursorPos(out now) && (now.X != x || now.Y != y) && clock.ElapsedMilliseconds < 30) Thread.Sleep(1);
528
+ if (now.X != x || now.Y != y) SetCursorPos(x, y);
529
+ }
530
+
531
+ /** A turn of more than 30 degrees at vertex i. */
532
+ static bool Sharp(int[] p, int i) {
533
+ double ax = p[2 * i] - p[2 * i - 2], ay = p[2 * i + 1] - p[2 * i - 1];
534
+ double bx = p[2 * i + 2] - p[2 * i], by = p[2 * i + 3] - p[2 * i + 1];
535
+ double la = Math.Sqrt(ax * ax + ay * ay), lb = Math.Sqrt(bx * bx + by * by);
536
+ return la > 0 && lb > 0 && (ax * bx + ay * by) / (la * lb) < 0.866;
537
+ }
538
+
539
+ static string Animate(int my, bool cursor, int sx, int sy, double fx, double fy, int x, int y, int ms) {
540
+ double cpx, cpy, opx, opy;
541
+ Arc(sx, sy, x, y, out cpx, out cpy);
542
+ Arc(fx, fy, x, y, out opx, out opy);
543
+ long since = Stopwatch.GetTimestamp();
544
+ timeBeginPeriod(1);
545
+ try {
546
+ var clock = Stopwatch.StartNew();
547
+ while (true) {
548
+ if (Thread.VolatileRead(ref ticket) != my) return null; // A newer move took over the overlay.
549
+ double t = ms <= 0 ? 1 : Math.Min(1, clock.Elapsed.TotalMilliseconds / ms);
550
+ double s = t * t * t * (10 - 15 * t + 6 * t * t); // minimum jerk: no snap at either end
551
+ if (cursor) {
552
+ string stop = Step((int)Math.Round(Curve(sx, cpx, x, s)), (int)Math.Round(Curve(sy, cpy, y, s)), since, false);
553
+ if (stop != null) return stop;
554
+ }
555
+ MoveTo(Curve(fx, opx, x, s), Curve(fy, opy, y, s), true);
556
+ if (t >= 1) { if (cursor) Land(x, y); return null; }
557
+ Pace(clock);
558
+ }
559
+ } finally { timeEndPeriod(1); }
560
+ }
561
+ }
562
+ }
563
+ `;
564
+ export const OVERLAY_FILES = compiledSource('overlay', OVERLAY);
565
+ /** Windows renders the shared SVG asset once, then reuses its bitmap. */
566
+ export const WINDOWS_CURSOR = `
567
+ $script:rkPointerBitmap = $null
568
+ $script:rkPointerPng = $null
569
+ $script:rkOverlay = $false
570
+ function Rk-PointerBitmap {
571
+ if ($null -ne $script:rkPointerBitmap) { return $script:rkPointerBitmap }
572
+ Add-Type -AssemblyName PresentationCore
573
+ Add-Type -AssemblyName WindowsBase
574
+ $visual = New-Object System.Windows.Media.DrawingVisual
575
+ $drawing = $visual.RenderOpen()
576
+ $fill = [System.Windows.Media.BrushConverter]::new().ConvertFromString('${CURSOR.fill}')
577
+ $edge = [System.Windows.Media.BrushConverter]::new().ConvertFromString('${CURSOR.outline}')
578
+ $pen = New-Object System.Windows.Media.Pen $edge, 1
579
+ $pen.LineJoin = [System.Windows.Media.PenLineJoin]::Round
580
+ $drawing.PushTransform((New-Object System.Windows.Media.TranslateTransform 12, 12))
581
+ $drawing.PushTransform((New-Object System.Windows.Media.ScaleTransform (${CURSOR.size} / 24), (${CURSOR.size} / 24)))
582
+ $drawing.DrawGeometry($fill, $pen, [System.Windows.Media.Geometry]::Parse('${CURSOR.path}'))
583
+ $drawing.Close()
584
+ $glow = New-Object System.Windows.Media.Effects.DropShadowEffect
585
+ $glow.Color = [System.Windows.Media.ColorConverter]::ConvertFromString('${CURSOR.glow}')
586
+ $glow.BlurRadius = 8; $glow.ShadowDepth = 0; $glow.Opacity = 0.45
587
+ $visual.Effect = $glow
588
+ $image = New-Object System.Windows.Media.Imaging.RenderTargetBitmap 56, 56, 96, 96, ([System.Windows.Media.PixelFormats]::Pbgra32)
589
+ $image.Render($visual)
590
+ $encoder = New-Object System.Windows.Media.Imaging.PngBitmapEncoder
591
+ $encoder.Frames.Add([System.Windows.Media.Imaging.BitmapFrame]::Create($image))
592
+ $stream = New-Object System.IO.MemoryStream
593
+ try {
594
+ $encoder.Save($stream)
595
+ $script:rkPointerPng = $stream.ToArray()
596
+ $stream.Position = 0
597
+ $bitmap = New-Object System.Drawing.Bitmap $stream
598
+ try { $script:rkPointerBitmap = $bitmap.Clone() } finally { $bitmap.Dispose() }
599
+ } finally { $stream.Dispose() }
600
+ $script:rkPointerBitmap
601
+ }
602
+
603
+ function Rk-DrawPointer($graphics, $x, $y) {
604
+ $image = Rk-PointerBitmap
605
+ $graphics.DrawImage($image, [single]($x - ${12 + CURSOR.hotspot}), [single]($y - ${12 + CURSOR.hotspot}), 56, 56)
606
+ }
607
+
608
+ # Compile and start the overlay once; throws while it cannot exist.
609
+ function Rk-Overlay {
610
+ if ($script:rkOverlay) { return }
611
+ Add-Type -AssemblyName PresentationFramework
612
+ $refs = @(
613
+ 'System.dll', 'System.Core.dll', 'System.Xaml.dll',
614
+ [System.Windows.Forms.Form].Assembly.Location,
615
+ [System.Drawing.Bitmap].Assembly.Location,
616
+ [System.Windows.Window].Assembly.Location,
617
+ [System.Windows.Media.Visual].Assembly.Location,
618
+ [System.Windows.Threading.Dispatcher].Assembly.Location
619
+ )
620
+ Rk-Assembly '${OVERLAY_FILES.assembly.replace(/'/g, "''")}' '${OVERLAY_FILES.source.replace(/'/g, "''")}' 'Rookery.AgentPointer' $refs
621
+ Rk-PointerBitmap | Out-Null
622
+ [Rookery.AgentPointer]::Start($script:rkPointerPng)
623
+ $script:rkOverlay = $true
624
+ }
625
+
626
+ function Rk-ShowPointer($window, $x, $y, $action = 'Working', $follow = $false) {
627
+ try {
628
+ Rk-Overlay
629
+ $shown = [Rookery.AgentPointer]::ShowPointer($window, [int]$x, [int]$y, $action, [bool]$follow)
630
+ $script:rkCursorFeedback = @{ visible = $shown; overlayHandle = [long][Rookery.AgentPointer]::Handle }
631
+ $script:rkCursorFeedback
632
+ } catch {
633
+ # Display failure must never trigger a retry of an already-dispatched action.
634
+ $script:rkCursorFeedback = @{ visible = $false; error = $_.Exception.Message }
635
+ $script:rkCursorFeedback
636
+ }
637
+ }
638
+
639
+ # Move the real pointer with the overlay; throws before any motion if the overlay is missing.
640
+ function Rk-Glide($x, $y, $action = 'Moving') {
641
+ Rk-Failsafe
642
+ try { Rk-Overlay } catch { throw ('Cannot show the computer-use cursor. No input sent: ' + $_.Exception.Message) }
643
+ $stopped = [Rookery.AgentPointer]::Glide([int]$x, [int]$y, $action)
644
+ $script:rkCursorFeedback = @{ visible = $true; overlayHandle = [long][Rookery.AgentPointer]::Handle }
645
+ if ($stopped) { throw $stopped }
646
+ $script:rkPointer = @{ window = [long][RkNative]::GetForegroundWindow(); x = $x; y = $y }
647
+ }
648
+
649
+ # Draw packed strokes (count, then per stroke its point count and x,y pairs) in one native call.
650
+ # The server sends them as base64 Int32 data; a drag passes a small int array directly.
651
+ function Rk-Draw($packed, $button = 'left', $action = 'Drawing') {
652
+ Rk-Failsafe
653
+ try { Rk-Overlay } catch { throw ('Cannot show the computer-use cursor. No input sent: ' + $_.Exception.Message) }
654
+ if ($packed -is [string]) {
655
+ $bytes = [Convert]::FromBase64String($packed)
656
+ $ints = New-Object int[] ($bytes.Length / 4)
657
+ [Buffer]::BlockCopy($bytes, 0, $ints, 0, $bytes.Length)
658
+ $packed = $ints
659
+ }
660
+ $stopped = [Rookery.AgentPointer]::Draw([int[]]$packed, ($button -eq 'right'), $action)
661
+ $script:rkCursorFeedback = @{ visible = $true; overlayHandle = [long][Rookery.AgentPointer]::Handle }
662
+ if ($stopped) { throw $stopped }
663
+ $c = Rk-Cursor
664
+ $script:rkPointer = @{ window = [long][RkNative]::GetForegroundWindow(); x = $c.x; y = $c.y }
665
+ @{ ok = $true }
666
+ }
667
+
668
+ function Rk-CursorSettle {
669
+ if ($script:rkOverlay) { [Rookery.AgentPointer]::Settle() }
670
+ }
671
+
672
+ function Rk-CursorPulse($action) {
673
+ if ($script:rkOverlay) { [Rookery.AgentPointer]::Pulse($action) }
674
+ }
675
+
676
+ function Rk-CursorStatus($action) {
677
+ if ($script:rkOverlay) { [Rookery.AgentPointer]::Status($action) }
678
+ }
679
+
680
+ function Rk-CursorCapture($hide) {
681
+ if ($script:rkOverlay) { [Rookery.AgentPointer]::Capture($hide) }
682
+ }
683
+
684
+ function Rk-CursorDone {
685
+ if ($script:rkOverlay) { [Rookery.AgentPointer]::Complete() }
686
+ }
687
+
688
+ function Rk-CursorDismiss {
689
+ if ($script:rkOverlay) { [Rookery.AgentPointer]::Dismiss() }
690
+ }
691
+
692
+ function Rk-ObserverState {
693
+ if (-not $script:rkOverlay) { return @{ visible = $false } }
694
+ @{ visible = [RkNative]::IsWindowVisible([Rookery.AgentPointer]::Handle);
695
+ overlayHandle = [long][Rookery.AgentPointer]::Handle; label = [Rookery.AgentPointer]::StatusText }
696
+ }
697
+
698
+ # Travel to the focused control and arrive before a single key is sent.
699
+ function Rk-InputPointer($action) {
700
+ $point = Rk-Cursor
701
+ $element = [System.Windows.Automation.AutomationElement]::FocusedElement
702
+ if ($null -ne $element) {
703
+ $rect = $element.Current.BoundingRectangle
704
+ if (-not $rect.IsEmpty -and -not $element.Current.IsOffscreen) {
705
+ $point = @{ x = $rect.X + $rect.Width / 2; y = $rect.Y + $rect.Height / 2 }
706
+ }
707
+ }
708
+ $feedback = Rk-ShowPointer 0 $point.x $point.y $action
709
+ if ($feedback.error) { throw ('Cannot show the computer-use cursor. No input sent: ' + $feedback.error) }
710
+ Rk-CursorSettle
711
+ }
712
+ `;
713
+ //# sourceMappingURL=windows-cursor.js.map