@fraziym/axoniz 0.1.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 (512) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/dist/agents/definition.d.ts +15 -0
  4. package/dist/agents/definition.d.ts.map +1 -0
  5. package/dist/agents/definition.js +41 -0
  6. package/dist/agents/definition.js.map +1 -0
  7. package/dist/agents/index.d.ts +12 -0
  8. package/dist/agents/index.d.ts.map +1 -0
  9. package/dist/agents/index.js +11 -0
  10. package/dist/agents/index.js.map +1 -0
  11. package/dist/agents/registry.d.ts +17 -0
  12. package/dist/agents/registry.d.ts.map +1 -0
  13. package/dist/agents/registry.js +23 -0
  14. package/dist/agents/registry.js.map +1 -0
  15. package/dist/agents/specialized.d.ts +31 -0
  16. package/dist/agents/specialized.d.ts.map +1 -0
  17. package/dist/agents/specialized.js +75 -0
  18. package/dist/agents/specialized.js.map +1 -0
  19. package/dist/awareness/index.d.ts +14 -0
  20. package/dist/awareness/index.d.ts.map +1 -0
  21. package/dist/awareness/index.js +22 -0
  22. package/dist/awareness/index.js.map +1 -0
  23. package/dist/awareness/service.d.ts +180 -0
  24. package/dist/awareness/service.d.ts.map +1 -0
  25. package/dist/awareness/service.js +789 -0
  26. package/dist/awareness/service.js.map +1 -0
  27. package/dist/cli/entry.d.ts +13 -0
  28. package/dist/cli/entry.d.ts.map +1 -0
  29. package/dist/cli/entry.js +35 -0
  30. package/dist/cli/entry.js.map +1 -0
  31. package/dist/comms/telegram.d.ts +41 -0
  32. package/dist/comms/telegram.d.ts.map +1 -0
  33. package/dist/comms/telegram.js +332 -0
  34. package/dist/comms/telegram.js.map +1 -0
  35. package/dist/core/agent.d.ts +252 -0
  36. package/dist/core/agent.d.ts.map +1 -0
  37. package/dist/core/agent.js +1399 -0
  38. package/dist/core/agent.js.map +1 -0
  39. package/dist/core/auth.d.ts +23 -0
  40. package/dist/core/auth.d.ts.map +1 -0
  41. package/dist/core/auth.js +113 -0
  42. package/dist/core/auth.js.map +1 -0
  43. package/dist/core/authority.d.ts +118 -0
  44. package/dist/core/authority.d.ts.map +1 -0
  45. package/dist/core/authority.js +402 -0
  46. package/dist/core/authority.js.map +1 -0
  47. package/dist/core/backend/async_queue.d.ts +17 -0
  48. package/dist/core/backend/async_queue.d.ts.map +1 -0
  49. package/dist/core/backend/async_queue.js +66 -0
  50. package/dist/core/backend/async_queue.js.map +1 -0
  51. package/dist/core/backend/index.d.ts +24 -0
  52. package/dist/core/backend/index.d.ts.map +1 -0
  53. package/dist/core/backend/index.js +128 -0
  54. package/dist/core/backend/index.js.map +1 -0
  55. package/dist/core/backend/llama_server.d.ts +39 -0
  56. package/dist/core/backend/llama_server.d.ts.map +1 -0
  57. package/dist/core/backend/llama_server.js +182 -0
  58. package/dist/core/backend/llama_server.js.map +1 -0
  59. package/dist/core/backend/llamacpp.d.ts +40 -0
  60. package/dist/core/backend/llamacpp.d.ts.map +1 -0
  61. package/dist/core/backend/llamacpp.js +200 -0
  62. package/dist/core/backend/llamacpp.js.map +1 -0
  63. package/dist/core/backend/lmstudio.d.ts +53 -0
  64. package/dist/core/backend/lmstudio.d.ts.map +1 -0
  65. package/dist/core/backend/lmstudio.js +274 -0
  66. package/dist/core/backend/lmstudio.js.map +1 -0
  67. package/dist/core/backend/ollama.d.ts +25 -0
  68. package/dist/core/backend/ollama.d.ts.map +1 -0
  69. package/dist/core/backend/ollama.js +86 -0
  70. package/dist/core/backend/ollama.js.map +1 -0
  71. package/dist/core/backend/openai.d.ts +27 -0
  72. package/dist/core/backend/openai.d.ts.map +1 -0
  73. package/dist/core/backend/openai.js +84 -0
  74. package/dist/core/backend/openai.js.map +1 -0
  75. package/dist/core/backend/types.d.ts +73 -0
  76. package/dist/core/backend/types.d.ts.map +1 -0
  77. package/dist/core/backend/types.js +137 -0
  78. package/dist/core/backend/types.js.map +1 -0
  79. package/dist/core/chat_store.d.ts +77 -0
  80. package/dist/core/chat_store.d.ts.map +1 -0
  81. package/dist/core/chat_store.js +332 -0
  82. package/dist/core/chat_store.js.map +1 -0
  83. package/dist/core/cli.d.ts +82 -0
  84. package/dist/core/cli.d.ts.map +1 -0
  85. package/dist/core/cli.js +602 -0
  86. package/dist/core/cli.js.map +1 -0
  87. package/dist/core/config.d.ts +127 -0
  88. package/dist/core/config.d.ts.map +1 -0
  89. package/dist/core/config.js +295 -0
  90. package/dist/core/config.js.map +1 -0
  91. package/dist/core/debug.d.ts +8 -0
  92. package/dist/core/debug.d.ts.map +1 -0
  93. package/dist/core/debug.js +8 -0
  94. package/dist/core/debug.js.map +1 -0
  95. package/dist/core/downloader.d.ts +31 -0
  96. package/dist/core/downloader.d.ts.map +1 -0
  97. package/dist/core/downloader.js +180 -0
  98. package/dist/core/downloader.js.map +1 -0
  99. package/dist/core/errors.d.ts +80 -0
  100. package/dist/core/errors.d.ts.map +1 -0
  101. package/dist/core/errors.js +134 -0
  102. package/dist/core/errors.js.map +1 -0
  103. package/dist/core/extras.d.ts +160 -0
  104. package/dist/core/extras.d.ts.map +1 -0
  105. package/dist/core/extras.js +553 -0
  106. package/dist/core/extras.js.map +1 -0
  107. package/dist/core/health.d.ts +27 -0
  108. package/dist/core/health.d.ts.map +1 -0
  109. package/dist/core/health.js +96 -0
  110. package/dist/core/health.js.map +1 -0
  111. package/dist/core/history.d.ts +50 -0
  112. package/dist/core/history.d.ts.map +1 -0
  113. package/dist/core/history.js +276 -0
  114. package/dist/core/history.js.map +1 -0
  115. package/dist/core/index.d.ts +6 -0
  116. package/dist/core/index.d.ts.map +1 -0
  117. package/dist/core/index.js +6 -0
  118. package/dist/core/index.js.map +1 -0
  119. package/dist/core/intelligence/ast_index.d.ts +255 -0
  120. package/dist/core/intelligence/ast_index.d.ts.map +1 -0
  121. package/dist/core/intelligence/ast_index.js +1369 -0
  122. package/dist/core/intelligence/ast_index.js.map +1 -0
  123. package/dist/core/intelligence/confidence.d.ts +113 -0
  124. package/dist/core/intelligence/confidence.d.ts.map +1 -0
  125. package/dist/core/intelligence/confidence.js +298 -0
  126. package/dist/core/intelligence/confidence.js.map +1 -0
  127. package/dist/core/intelligence/context_compressor.d.ts +80 -0
  128. package/dist/core/intelligence/context_compressor.d.ts.map +1 -0
  129. package/dist/core/intelligence/context_compressor.js +245 -0
  130. package/dist/core/intelligence/context_compressor.js.map +1 -0
  131. package/dist/core/intelligence/daemon.d.ts +247 -0
  132. package/dist/core/intelligence/daemon.d.ts.map +1 -0
  133. package/dist/core/intelligence/daemon.js +842 -0
  134. package/dist/core/intelligence/daemon.js.map +1 -0
  135. package/dist/core/intelligence/index.d.ts +60 -0
  136. package/dist/core/intelligence/index.d.ts.map +1 -0
  137. package/dist/core/intelligence/index.js +101 -0
  138. package/dist/core/intelligence/index.js.map +1 -0
  139. package/dist/core/intelligence/predictor.d.ts +246 -0
  140. package/dist/core/intelligence/predictor.d.ts.map +1 -0
  141. package/dist/core/intelligence/predictor.js +590 -0
  142. package/dist/core/intelligence/predictor.js.map +1 -0
  143. package/dist/core/intelligence/reflex.d.ts +84 -0
  144. package/dist/core/intelligence/reflex.d.ts.map +1 -0
  145. package/dist/core/intelligence/reflex.js +344 -0
  146. package/dist/core/intelligence/reflex.js.map +1 -0
  147. package/dist/core/intelligence/self_correction.d.ts +121 -0
  148. package/dist/core/intelligence/self_correction.d.ts.map +1 -0
  149. package/dist/core/intelligence/self_correction.js +327 -0
  150. package/dist/core/intelligence/self_correction.js.map +1 -0
  151. package/dist/core/intelligence/skill_distiller.d.ts +100 -0
  152. package/dist/core/intelligence/skill_distiller.d.ts.map +1 -0
  153. package/dist/core/intelligence/skill_distiller.js +246 -0
  154. package/dist/core/intelligence/skill_distiller.js.map +1 -0
  155. package/dist/core/intelligence/swarm.d.ts +330 -0
  156. package/dist/core/intelligence/swarm.d.ts.map +1 -0
  157. package/dist/core/intelligence/swarm.js +1064 -0
  158. package/dist/core/intelligence/swarm.js.map +1 -0
  159. package/dist/core/intelligence/trajectory.d.ts +107 -0
  160. package/dist/core/intelligence/trajectory.d.ts.map +1 -0
  161. package/dist/core/intelligence/trajectory.js +330 -0
  162. package/dist/core/intelligence/trajectory.js.map +1 -0
  163. package/dist/core/logger.d.ts +111 -0
  164. package/dist/core/logger.d.ts.map +1 -0
  165. package/dist/core/logger.js +640 -0
  166. package/dist/core/logger.js.map +1 -0
  167. package/dist/core/loop.d.ts +123 -0
  168. package/dist/core/loop.d.ts.map +1 -0
  169. package/dist/core/loop.js +423 -0
  170. package/dist/core/loop.js.map +1 -0
  171. package/dist/core/memory.d.ts +81 -0
  172. package/dist/core/memory.d.ts.map +1 -0
  173. package/dist/core/memory.js +328 -0
  174. package/dist/core/memory.js.map +1 -0
  175. package/dist/core/metrics.d.ts +29 -0
  176. package/dist/core/metrics.d.ts.map +1 -0
  177. package/dist/core/metrics.js +109 -0
  178. package/dist/core/metrics.js.map +1 -0
  179. package/dist/core/models.d.ts +51 -0
  180. package/dist/core/models.d.ts.map +1 -0
  181. package/dist/core/models.js +146 -0
  182. package/dist/core/models.js.map +1 -0
  183. package/dist/core/optimizer.d.ts +34 -0
  184. package/dist/core/optimizer.d.ts.map +1 -0
  185. package/dist/core/optimizer.js +131 -0
  186. package/dist/core/optimizer.js.map +1 -0
  187. package/dist/core/persona.d.ts +35 -0
  188. package/dist/core/persona.d.ts.map +1 -0
  189. package/dist/core/persona.js +126 -0
  190. package/dist/core/persona.js.map +1 -0
  191. package/dist/core/rate_limit.d.ts +23 -0
  192. package/dist/core/rate_limit.d.ts.map +1 -0
  193. package/dist/core/rate_limit.js +62 -0
  194. package/dist/core/rate_limit.js.map +1 -0
  195. package/dist/core/runner.d.ts +63 -0
  196. package/dist/core/runner.d.ts.map +1 -0
  197. package/dist/core/runner.js +671 -0
  198. package/dist/core/runner.js.map +1 -0
  199. package/dist/core/stream_parser.d.ts +43 -0
  200. package/dist/core/stream_parser.d.ts.map +1 -0
  201. package/dist/core/stream_parser.js +140 -0
  202. package/dist/core/stream_parser.js.map +1 -0
  203. package/dist/core/tool_schemas.d.ts +26 -0
  204. package/dist/core/tool_schemas.d.ts.map +1 -0
  205. package/dist/core/tool_schemas.js +124 -0
  206. package/dist/core/tool_schemas.js.map +1 -0
  207. package/dist/core/which.d.ts +2 -0
  208. package/dist/core/which.d.ts.map +1 -0
  209. package/dist/core/which.js +35 -0
  210. package/dist/core/which.js.map +1 -0
  211. package/dist/goals/index.d.ts +9 -0
  212. package/dist/goals/index.d.ts.map +1 -0
  213. package/dist/goals/index.js +17 -0
  214. package/dist/goals/index.js.map +1 -0
  215. package/dist/goals/service.d.ts +115 -0
  216. package/dist/goals/service.d.ts.map +1 -0
  217. package/dist/goals/service.js +415 -0
  218. package/dist/goals/service.js.map +1 -0
  219. package/dist/goals/types.d.ts +47 -0
  220. package/dist/goals/types.d.ts.map +1 -0
  221. package/dist/goals/types.js +66 -0
  222. package/dist/goals/types.js.map +1 -0
  223. package/dist/index.d.ts +22 -0
  224. package/dist/index.d.ts.map +1 -0
  225. package/dist/index.js +22 -0
  226. package/dist/index.js.map +1 -0
  227. package/dist/integrations/autonomous_startup.d.ts +51 -0
  228. package/dist/integrations/autonomous_startup.d.ts.map +1 -0
  229. package/dist/integrations/autonomous_startup.js +419 -0
  230. package/dist/integrations/autonomous_startup.js.map +1 -0
  231. package/dist/integrations/goose.d.ts +105 -0
  232. package/dist/integrations/goose.d.ts.map +1 -0
  233. package/dist/integrations/goose.js +408 -0
  234. package/dist/integrations/goose.js.map +1 -0
  235. package/dist/integrations/index.d.ts +21 -0
  236. package/dist/integrations/index.d.ts.map +1 -0
  237. package/dist/integrations/index.js +17 -0
  238. package/dist/integrations/index.js.map +1 -0
  239. package/dist/integrations/mcp.d.ts +73 -0
  240. package/dist/integrations/mcp.d.ts.map +1 -0
  241. package/dist/integrations/mcp.js +307 -0
  242. package/dist/integrations/mcp.js.map +1 -0
  243. package/dist/integrations/mempalace.d.ts +18 -0
  244. package/dist/integrations/mempalace.d.ts.map +1 -0
  245. package/dist/integrations/mempalace.js +25 -0
  246. package/dist/integrations/mempalace.js.map +1 -0
  247. package/dist/integrations/multi_agent.d.ts +82 -0
  248. package/dist/integrations/multi_agent.d.ts.map +1 -0
  249. package/dist/integrations/multi_agent.js +280 -0
  250. package/dist/integrations/multi_agent.js.map +1 -0
  251. package/dist/integrations/unified_memory.d.ts +415 -0
  252. package/dist/integrations/unified_memory.d.ts.map +1 -0
  253. package/dist/integrations/unified_memory.js +1489 -0
  254. package/dist/integrations/unified_memory.js.map +1 -0
  255. package/dist/roles/beru.yaml +48 -0
  256. package/dist/sidecar/client.d.ts +63 -0
  257. package/dist/sidecar/client.d.ts.map +1 -0
  258. package/dist/sidecar/client.js +222 -0
  259. package/dist/sidecar/client.js.map +1 -0
  260. package/dist/sidecar/index.d.ts +7 -0
  261. package/dist/sidecar/index.d.ts.map +1 -0
  262. package/dist/sidecar/index.js +6 -0
  263. package/dist/sidecar/index.js.map +1 -0
  264. package/dist/startup.d.ts +22 -0
  265. package/dist/startup.d.ts.map +1 -0
  266. package/dist/startup.js +194 -0
  267. package/dist/startup.js.map +1 -0
  268. package/dist/tools/_internal.d.ts +90 -0
  269. package/dist/tools/_internal.d.ts.map +1 -0
  270. package/dist/tools/_internal.js +375 -0
  271. package/dist/tools/_internal.js.map +1 -0
  272. package/dist/tools/_smoke.d.ts +2 -0
  273. package/dist/tools/_smoke.d.ts.map +1 -0
  274. package/dist/tools/_smoke.js +203 -0
  275. package/dist/tools/_smoke.js.map +1 -0
  276. package/dist/tools/axodex_tools.d.ts +51 -0
  277. package/dist/tools/axodex_tools.d.ts.map +1 -0
  278. package/dist/tools/axodex_tools.js +181 -0
  279. package/dist/tools/axodex_tools.js.map +1 -0
  280. package/dist/tools/code_tools.d.ts +33 -0
  281. package/dist/tools/code_tools.d.ts.map +1 -0
  282. package/dist/tools/code_tools.js +191 -0
  283. package/dist/tools/code_tools.js.map +1 -0
  284. package/dist/tools/computer_tools.d.ts +59 -0
  285. package/dist/tools/computer_tools.d.ts.map +1 -0
  286. package/dist/tools/computer_tools.js +348 -0
  287. package/dist/tools/computer_tools.js.map +1 -0
  288. package/dist/tools/file_tools.d.ts +51 -0
  289. package/dist/tools/file_tools.d.ts.map +1 -0
  290. package/dist/tools/file_tools.js +424 -0
  291. package/dist/tools/file_tools.js.map +1 -0
  292. package/dist/tools/index.d.ts +13 -0
  293. package/dist/tools/index.d.ts.map +1 -0
  294. package/dist/tools/index.js +13 -0
  295. package/dist/tools/index.js.map +1 -0
  296. package/dist/tools/shell_tools.d.ts +39 -0
  297. package/dist/tools/shell_tools.d.ts.map +1 -0
  298. package/dist/tools/shell_tools.js +163 -0
  299. package/dist/tools/shell_tools.js.map +1 -0
  300. package/dist/tools/web_tools.d.ts +31 -0
  301. package/dist/tools/web_tools.d.ts.map +1 -0
  302. package/dist/tools/web_tools.js +117 -0
  303. package/dist/tools/web_tools.js.map +1 -0
  304. package/dist/voice/index.d.ts +41 -0
  305. package/dist/voice/index.d.ts.map +1 -0
  306. package/dist/voice/index.js +58 -0
  307. package/dist/voice/index.js.map +1 -0
  308. package/dist/voice/light_daemon.d.ts +197 -0
  309. package/dist/voice/light_daemon.d.ts.map +1 -0
  310. package/dist/voice/light_daemon.js +746 -0
  311. package/dist/voice/light_daemon.js.map +1 -0
  312. package/dist/voice/setup.d.ts +63 -0
  313. package/dist/voice/setup.d.ts.map +1 -0
  314. package/dist/voice/setup.js +443 -0
  315. package/dist/voice/setup.js.map +1 -0
  316. package/dist/voice/stt.d.ts +148 -0
  317. package/dist/voice/stt.d.ts.map +1 -0
  318. package/dist/voice/stt.js +361 -0
  319. package/dist/voice/stt.js.map +1 -0
  320. package/dist/voice/tts.d.ts +168 -0
  321. package/dist/voice/tts.d.ts.map +1 -0
  322. package/dist/voice/tts.js +698 -0
  323. package/dist/voice/tts.js.map +1 -0
  324. package/dist/voice/voice_loop.d.ts +101 -0
  325. package/dist/voice/voice_loop.d.ts.map +1 -0
  326. package/dist/voice/voice_loop.js +463 -0
  327. package/dist/voice/voice_loop.js.map +1 -0
  328. package/dist/voice/wake_word.d.ts +153 -0
  329. package/dist/voice/wake_word.d.ts.map +1 -0
  330. package/dist/voice/wake_word.js +458 -0
  331. package/dist/voice/wake_word.js.map +1 -0
  332. package/dist/voice/wav.d.ts +99 -0
  333. package/dist/voice/wav.d.ts.map +1 -0
  334. package/dist/voice/wav.js +306 -0
  335. package/dist/voice/wav.js.map +1 -0
  336. package/dist/web/broker.d.ts +33 -0
  337. package/dist/web/broker.d.ts.map +1 -0
  338. package/dist/web/broker.js +58 -0
  339. package/dist/web/broker.js.map +1 -0
  340. package/dist/web/open_browser.d.ts +2 -0
  341. package/dist/web/open_browser.d.ts.map +1 -0
  342. package/dist/web/open_browser.js +42 -0
  343. package/dist/web/open_browser.js.map +1 -0
  344. package/dist/web/server.d.ts +54 -0
  345. package/dist/web/server.d.ts.map +1 -0
  346. package/dist/web/server.js +831 -0
  347. package/dist/web/server.js.map +1 -0
  348. package/dist/web/static/app.js +4121 -0
  349. package/dist/web/static/index.html +2281 -0
  350. package/dist/web/static/js/MODULE_SUMMARY.md +124 -0
  351. package/dist/web/static/js/a11y.js +165 -0
  352. package/dist/web/static/js/admin.js +2145 -0
  353. package/dist/web/static/js/assistant.js +475 -0
  354. package/dist/web/static/js/calendar/reminders.js +114 -0
  355. package/dist/web/static/js/calendar/utils.js +166 -0
  356. package/dist/web/static/js/calendar.js +3348 -0
  357. package/dist/web/static/js/censor.js +356 -0
  358. package/dist/web/static/js/chat.js +4546 -0
  359. package/dist/web/static/js/chatRenderer.js +2294 -0
  360. package/dist/web/static/js/chatStream.js +276 -0
  361. package/dist/web/static/js/codeRunner.js +398 -0
  362. package/dist/web/static/js/color/hex.js +14 -0
  363. package/dist/web/static/js/colorPicker.js +453 -0
  364. package/dist/web/static/js/compare/icons.js +77 -0
  365. package/dist/web/static/js/compare/index.js +1482 -0
  366. package/dist/web/static/js/compare/models.js +104 -0
  367. package/dist/web/static/js/compare/panes.js +817 -0
  368. package/dist/web/static/js/compare/probe.js +78 -0
  369. package/dist/web/static/js/compare/scoreboard.js +223 -0
  370. package/dist/web/static/js/compare/selector.js +1335 -0
  371. package/dist/web/static/js/compare/state.js +58 -0
  372. package/dist/web/static/js/compare/stream.js +695 -0
  373. package/dist/web/static/js/compare/vote.js +254 -0
  374. package/dist/web/static/js/cookbook-diagnosis.js +694 -0
  375. package/dist/web/static/js/cookbook-hwfit.js +1888 -0
  376. package/dist/web/static/js/cookbook.js +2093 -0
  377. package/dist/web/static/js/cookbookDownload.js +633 -0
  378. package/dist/web/static/js/cookbookProgressSignal.js +29 -0
  379. package/dist/web/static/js/cookbookRunning.js +3506 -0
  380. package/dist/web/static/js/cookbookServe.js +2128 -0
  381. package/dist/web/static/js/document.js +9731 -0
  382. package/dist/web/static/js/documentLibrary.js +3376 -0
  383. package/dist/web/static/js/dragSort.js +265 -0
  384. package/dist/web/static/js/editor/ai-inpaint.js +374 -0
  385. package/dist/web/static/js/editor/ai-models.js +273 -0
  386. package/dist/web/static/js/editor/ai-rembg.js +230 -0
  387. package/dist/web/static/js/editor/ai-tool-runner.js +147 -0
  388. package/dist/web/static/js/editor/ai-tools-misc.js +216 -0
  389. package/dist/web/static/js/editor/build/controls.js +366 -0
  390. package/dist/web/static/js/editor/build/popups.js +112 -0
  391. package/dist/web/static/js/editor/build/right-panel.js +200 -0
  392. package/dist/web/static/js/editor/build/toolbar.js +73 -0
  393. package/dist/web/static/js/editor/build/topbar.js +131 -0
  394. package/dist/web/static/js/editor/build/transform-popup.js +109 -0
  395. package/dist/web/static/js/editor/canvas-coords.js +21 -0
  396. package/dist/web/static/js/editor/canvas-events.js +197 -0
  397. package/dist/web/static/js/editor/canvas-transforms.js +132 -0
  398. package/dist/web/static/js/editor/checkerboard.js +24 -0
  399. package/dist/web/static/js/editor/clipboard-and-drop.js +133 -0
  400. package/dist/web/static/js/editor/composite-helpers.js +83 -0
  401. package/dist/web/static/js/editor/filters/blur.js +118 -0
  402. package/dist/web/static/js/editor/filters/edge-feather.js +70 -0
  403. package/dist/web/static/js/editor/fx/adj-popup.js +677 -0
  404. package/dist/web/static/js/editor/fx/filter-string.js +38 -0
  405. package/dist/web/static/js/editor/fx/histogram.js +67 -0
  406. package/dist/web/static/js/editor/fx/pixel-pass.js +249 -0
  407. package/dist/web/static/js/editor/harmonize-masks.js +116 -0
  408. package/dist/web/static/js/editor/history-panel.js +176 -0
  409. package/dist/web/static/js/editor/keyboard-shortcuts.js +271 -0
  410. package/dist/web/static/js/editor/layer-helpers.js +131 -0
  411. package/dist/web/static/js/editor/layer-panel.js +600 -0
  412. package/dist/web/static/js/editor/mask-utils.js +91 -0
  413. package/dist/web/static/js/editor/shortcuts-popover.js +149 -0
  414. package/dist/web/static/js/editor/slider-ux.js +191 -0
  415. package/dist/web/static/js/editor/snap.js +107 -0
  416. package/dist/web/static/js/editor/state.js +257 -0
  417. package/dist/web/static/js/editor/stroke-pipeline.js +162 -0
  418. package/dist/web/static/js/editor/stroke-tool-sliders.js +64 -0
  419. package/dist/web/static/js/editor/tools/clone.js +81 -0
  420. package/dist/web/static/js/editor/tools/crop.js +137 -0
  421. package/dist/web/static/js/editor/tools/flood-fill.js +72 -0
  422. package/dist/web/static/js/editor/tools/lasso-mask.js +171 -0
  423. package/dist/web/static/js/editor/tools/lasso.js +65 -0
  424. package/dist/web/static/js/editor/tools/move.js +79 -0
  425. package/dist/web/static/js/editor/tools/stroke.js +123 -0
  426. package/dist/web/static/js/editor/tools/transform-drag.js +174 -0
  427. package/dist/web/static/js/editor/tools/transform-handles.js +271 -0
  428. package/dist/web/static/js/editor/tools/transform-session.js +381 -0
  429. package/dist/web/static/js/editor/tools/wand.js +46 -0
  430. package/dist/web/static/js/editor/wire-import.js +148 -0
  431. package/dist/web/static/js/editor/wire-inpaint-controls.js +164 -0
  432. package/dist/web/static/js/editor/wire-merge-buttons.js +103 -0
  433. package/dist/web/static/js/editor/wire-selection-controls.js +170 -0
  434. package/dist/web/static/js/editor/wire-topbar-menus.js +174 -0
  435. package/dist/web/static/js/editor/wire-topbar-overflow.js +49 -0
  436. package/dist/web/static/js/editor/wire-topbar.js +188 -0
  437. package/dist/web/static/js/emailInbox.js +1245 -0
  438. package/dist/web/static/js/emailLibrary/replyRecipients.js +27 -0
  439. package/dist/web/static/js/emailLibrary/signatureFold.js +339 -0
  440. package/dist/web/static/js/emailLibrary/state.js +34 -0
  441. package/dist/web/static/js/emailLibrary/utils.js +202 -0
  442. package/dist/web/static/js/emailLibrary.js +5217 -0
  443. package/dist/web/static/js/emojiPicker.js +311 -0
  444. package/dist/web/static/js/escMenuStack.js +102 -0
  445. package/dist/web/static/js/fileHandler.js +295 -0
  446. package/dist/web/static/js/gallery.js +2835 -0
  447. package/dist/web/static/js/galleryEditor.js +3798 -0
  448. package/dist/web/static/js/group.js +955 -0
  449. package/dist/web/static/js/init.js +405 -0
  450. package/dist/web/static/js/keyboard-shortcuts.js +292 -0
  451. package/dist/web/static/js/langIcons.js +187 -0
  452. package/dist/web/static/js/markdown/tableRow.js +19 -0
  453. package/dist/web/static/js/markdown.js +806 -0
  454. package/dist/web/static/js/memory.js +1418 -0
  455. package/dist/web/static/js/modalManager.js +1552 -0
  456. package/dist/web/static/js/modalSnap.js +782 -0
  457. package/dist/web/static/js/model/matchKey.js +19 -0
  458. package/dist/web/static/js/modelPicker.js +695 -0
  459. package/dist/web/static/js/modelSort.js +33 -0
  460. package/dist/web/static/js/models.js +642 -0
  461. package/dist/web/static/js/notes.js +5054 -0
  462. package/dist/web/static/js/package.json +1 -0
  463. package/dist/web/static/js/platform.js +47 -0
  464. package/dist/web/static/js/presets.js +1110 -0
  465. package/dist/web/static/js/providers.js +93 -0
  466. package/dist/web/static/js/rag.js +177 -0
  467. package/dist/web/static/js/research/jobs.js +335 -0
  468. package/dist/web/static/js/research/panel.js +1233 -0
  469. package/dist/web/static/js/researchSynapse.js +225 -0
  470. package/dist/web/static/js/search-chat.js +201 -0
  471. package/dist/web/static/js/search.js +52 -0
  472. package/dist/web/static/js/section-management.js +260 -0
  473. package/dist/web/static/js/sessions.js +3108 -0
  474. package/dist/web/static/js/settings.js +4991 -0
  475. package/dist/web/static/js/sidebar-layout.js +573 -0
  476. package/dist/web/static/js/signature.js +504 -0
  477. package/dist/web/static/js/skills.js +1908 -0
  478. package/dist/web/static/js/slashAutocomplete.js +267 -0
  479. package/dist/web/static/js/slashCommands.js +6099 -0
  480. package/dist/web/static/js/spinner.js +406 -0
  481. package/dist/web/static/js/storage.js +123 -0
  482. package/dist/web/static/js/tasks.js +2699 -0
  483. package/dist/web/static/js/theme.js +2086 -0
  484. package/dist/web/static/js/tileManager.js +386 -0
  485. package/dist/web/static/js/tourAutoplay.js +133 -0
  486. package/dist/web/static/js/tourHints.js +179 -0
  487. package/dist/web/static/js/tts-ai.js +521 -0
  488. package/dist/web/static/js/ui.js +1288 -0
  489. package/dist/web/static/js/util/ordinal.js +13 -0
  490. package/dist/web/static/js/voiceRecorder.js +283 -0
  491. package/dist/web/static/js/windowDrag.js +326 -0
  492. package/dist/web/static/js/windowResize.js +233 -0
  493. package/dist/web/static/landing.html +824 -0
  494. package/dist/web/static/lib/docx.umd.min.js +20116 -0
  495. package/dist/web/static/lib/highlight.min.js +1213 -0
  496. package/dist/web/static/lib/html2pdf.bundle.min.js +3 -0
  497. package/dist/web/static/lib/mammoth.browser.min.js +21 -0
  498. package/dist/web/static/lib/qrcode.min.js +8 -0
  499. package/dist/web/static/lib/xlsx.full.min.js +24 -0
  500. package/dist/web/static/login.html +582 -0
  501. package/dist/web/static/manifest.json +15 -0
  502. package/dist/web/static/style.css +35733 -0
  503. package/dist/web/static/sw.js +144 -0
  504. package/dist/workflows/engine.d.ts +162 -0
  505. package/dist/workflows/engine.d.ts.map +1 -0
  506. package/dist/workflows/engine.js +625 -0
  507. package/dist/workflows/engine.js.map +1 -0
  508. package/dist/workflows/index.d.ts +8 -0
  509. package/dist/workflows/index.d.ts.map +1 -0
  510. package/dist/workflows/index.js +14 -0
  511. package/dist/workflows/index.js.map +1 -0
  512. package/package.json +112 -0
@@ -0,0 +1,453 @@
1
+ // In-house color picker with live-feedback HSV square, hue bar,
2
+ // eyedropper, recent colors, and harmony suggestions.
3
+ // Non-invasive: wraps existing <input type="color"> elements —
4
+ // their .value stays the source of truth, and we dispatch 'input'
5
+ // events so existing listeners keep working.
6
+
7
+ const LS_RECENT = 'zero-recent-colors';
8
+ const MAX_RECENT = 12;
9
+
10
+ let _popover = null;
11
+ let _input = null;
12
+ let _h = 0, _s = 100, _v = 100; // HSV
13
+ let _drag = null; // 'sl' | 'hue' | null
14
+ let _onOutside = null;
15
+
16
+ // ── Color math ────────────────────────────────────────────────────────
17
+ function clamp(v, min, max) { return Math.max(min, Math.min(max, v)); }
18
+
19
+ function hexToRgb(hex) {
20
+ hex = String(hex || '').replace('#', '');
21
+ if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');
22
+ if (!/^[0-9a-f]{6}$/i.test(hex)) return { r: 0, g: 0, b: 0 };
23
+ const n = parseInt(hex, 16);
24
+ return { r: (n >> 16) & 255, g: (n >> 8) & 255, b: n & 255 };
25
+ }
26
+
27
+ function rgbToHex(r, g, b) {
28
+ return '#' + [r, g, b].map(v =>
29
+ Math.round(clamp(v, 0, 255)).toString(16).padStart(2, '0')
30
+ ).join('');
31
+ }
32
+
33
+ function rgbToHsv(r, g, b) {
34
+ r /= 255; g /= 255; b /= 255;
35
+ const max = Math.max(r, g, b), min = Math.min(r, g, b);
36
+ const d = max - min;
37
+ let h;
38
+ const s = max === 0 ? 0 : d / max;
39
+ const v = max;
40
+ if (d === 0) h = 0;
41
+ else if (max === r) h = ((g - b) / d + (g < b ? 6 : 0));
42
+ else if (max === g) h = (b - r) / d + 2;
43
+ else h = (r - g) / d + 4;
44
+ return { h: h * 60, s: s * 100, v: v * 100 };
45
+ }
46
+
47
+ function hsvToRgb(h, s, v) {
48
+ h = ((h % 360) + 360) % 360;
49
+ h /= 60; s /= 100; v /= 100;
50
+ const i = Math.floor(h);
51
+ const f = h - i;
52
+ const p = v * (1 - s);
53
+ const q = v * (1 - f * s);
54
+ const t = v * (1 - (1 - f) * s);
55
+ let r, g, b;
56
+ switch (i % 6) {
57
+ case 0: r = v; g = t; b = p; break;
58
+ case 1: r = q; g = v; b = p; break;
59
+ case 2: r = p; g = v; b = t; break;
60
+ case 3: r = p; g = q; b = v; break;
61
+ case 4: r = t; g = p; b = v; break;
62
+ case 5: r = v; g = p; b = q; break;
63
+ }
64
+ return { r: Math.round(r * 255), g: Math.round(g * 255), b: Math.round(b * 255) };
65
+ }
66
+
67
+ function hsvToHex(h, s, v) { const { r, g, b } = hsvToRgb(h, s, v); return rgbToHex(r, g, b); }
68
+
69
+ function hexToHsv(hex) { const { r, g, b } = hexToRgb(hex); return rgbToHsv(r, g, b); }
70
+
71
+ // ── Storage ───────────────────────────────────────────────────────────
72
+ function getRecents() {
73
+ try { return JSON.parse(localStorage.getItem(LS_RECENT) || '[]'); }
74
+ catch { return []; }
75
+ }
76
+
77
+ function addRecent(hex) {
78
+ if (!/^#[0-9a-f]{6}$/i.test(hex)) return;
79
+ let recents = getRecents().filter(c => c.toLowerCase() !== hex.toLowerCase());
80
+ recents.unshift(hex.toLowerCase());
81
+ recents = recents.slice(0, MAX_RECENT);
82
+ try { localStorage.setItem(LS_RECENT, JSON.stringify(recents)); } catch {}
83
+ }
84
+
85
+ // ── Suggestions based on current color (5 harmony swatches) ──────────
86
+ function computeSuggestions() {
87
+ // Complement, analogous ±30°, split-complement (+150), tone shift
88
+ return [
89
+ { hex: hsvToHex(_h + 180, _s, _v), label: 'Complement' },
90
+ { hex: hsvToHex(_h + 30, _s, _v), label: 'Analogous +30°' },
91
+ { hex: hsvToHex(_h - 30, _s, _v), label: 'Analogous -30°' },
92
+ { hex: hsvToHex(_h + 150, _s, _v), label: 'Split-complement' },
93
+ { hex: hsvToHex(_h, _s, clamp(_v > 50 ? _v - 30 : _v + 30, 10, 95)), label: 'Tone shift' },
94
+ ];
95
+ }
96
+
97
+ // ── Popover build ─────────────────────────────────────────────────────
98
+ function buildPopover() {
99
+ const p = document.createElement('div');
100
+ p.className = 'cp-popover';
101
+ p.innerHTML = `
102
+ <div class="cp-sl" data-drag="sl">
103
+ <div class="cp-sl-white"></div>
104
+ <div class="cp-sl-black"></div>
105
+ <div class="cp-sl-handle"></div>
106
+ </div>
107
+ <div class="cp-hue" data-drag="hue">
108
+ <div class="cp-hue-handle"></div>
109
+ </div>
110
+ <div class="cp-row">
111
+ <div class="cp-preview"></div>
112
+ <input type="text" class="cp-hex" maxlength="7" spellcheck="false" autocomplete="off">
113
+ <button class="cp-eyedropper" title="Eyedropper" type="button">
114
+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
115
+ <path d="M2 22l4-4m0 0l3-3 5 5-3 3a2 2 0 01-2.8 0l-2.2-2.2a2 2 0 010-2.8z"/>
116
+ <path d="M14 8l3-3a3 3 0 014.2 4.2l-3 3-4.2-4.2z"/>
117
+ </svg>
118
+ </button>
119
+ </div>
120
+ <div class="cp-section-label">Suggestions</div>
121
+ <div class="cp-swatches cp-suggestions"></div>
122
+ <div class="cp-section-label">Recent</div>
123
+ <div class="cp-swatches cp-recent"></div>
124
+ `;
125
+ document.body.appendChild(p);
126
+ wireHandlers(p);
127
+ return p;
128
+ }
129
+
130
+ // ── UI sync ───────────────────────────────────────────────────────────
131
+ function syncUI() {
132
+ if (!_popover) return;
133
+ const sl = _popover.querySelector('.cp-sl');
134
+ const slH = _popover.querySelector('.cp-sl-handle');
135
+ const hue = _popover.querySelector('.cp-hue');
136
+ const hueH = _popover.querySelector('.cp-hue-handle');
137
+ const hex = _popover.querySelector('.cp-hex');
138
+ const preview = _popover.querySelector('.cp-preview');
139
+
140
+ const pureHue = hsvToHex(_h, 100, 100);
141
+ sl.style.background = pureHue; // base hue — white/black layers stacked on top via CSS
142
+
143
+ slH.style.left = (_s) + '%';
144
+ slH.style.top = (100 - _v) + '%';
145
+
146
+ hueH.style.left = (_h / 360 * 100) + '%';
147
+
148
+ const current = hsvToHex(_h, _s, _v);
149
+ preview.style.background = current;
150
+ if (document.activeElement !== hex) hex.value = current;
151
+
152
+ // Suggestions
153
+ const sContainer = _popover.querySelector('.cp-suggestions');
154
+ const sugs = computeSuggestions();
155
+ sContainer.innerHTML = sugs.map(s =>
156
+ `<button class="cp-swatch" title="${s.label}: ${s.hex}" data-hex="${s.hex}" style="background:${s.hex}"></button>`
157
+ ).join('');
158
+
159
+ // Recents
160
+ const rContainer = _popover.querySelector('.cp-recent');
161
+ const recs = getRecents();
162
+ rContainer.innerHTML = recs.length
163
+ ? recs.map(h => `<button class="cp-swatch" title="${h}" data-hex="${h}" style="background:${h}"></button>`).join('')
164
+ : '<div class="cp-recent-empty">(none yet)</div>';
165
+ }
166
+
167
+ function applyToInput(pushChange) {
168
+ if (!_input) return;
169
+ const hex = hsvToHex(_h, _s, _v);
170
+ _input.value = hex; // setter also updates style.background
171
+ if (pushChange) _input.dispatchEvent(new Event('input', { bubbles: true }));
172
+ syncUI();
173
+ }
174
+
175
+ function setFromHex(hex) {
176
+ const v = hexToHsv(hex);
177
+ _h = v.h; _s = v.s; _v = v.v;
178
+ }
179
+
180
+ // ── Handlers ──────────────────────────────────────────────────────────
181
+ // Window-level pointer listeners — installed ONCE, not per-popover, so they
182
+ // don't leak when the popover is rebuilt on every open.
183
+ let _windowPointerInstalled = false;
184
+ function _installWindowPointer() {
185
+ if (_windowPointerInstalled) return;
186
+ _windowPointerInstalled = true;
187
+ window.addEventListener('pointermove', (e) => { if (_drag) handleDrag(e); });
188
+ window.addEventListener('pointerup', () => {
189
+ if (_drag) {
190
+ _drag = null;
191
+ commitCurrent();
192
+ }
193
+ });
194
+ }
195
+
196
+ function wireHandlers(p) {
197
+ const sl = p.querySelector('.cp-sl');
198
+ const hue = p.querySelector('.cp-hue');
199
+ const hex = p.querySelector('.cp-hex');
200
+ const eye = p.querySelector('.cp-eyedropper');
201
+
202
+ const onDown = (type) => (e) => {
203
+ _drag = type;
204
+ handleDrag(e);
205
+ e.preventDefault();
206
+ };
207
+ sl.addEventListener('pointerdown', onDown('sl'));
208
+ hue.addEventListener('pointerdown', onDown('hue'));
209
+ _installWindowPointer();
210
+
211
+ hex.addEventListener('input', () => {
212
+ let v = hex.value.trim();
213
+ if (!v.startsWith('#')) v = '#' + v;
214
+ if (/^#[0-9a-f]{6}$/i.test(v)) {
215
+ setFromHex(v);
216
+ applyToInput(true);
217
+ }
218
+ });
219
+ hex.addEventListener('keydown', (e) => {
220
+ if (e.key === 'Enter') { commitCurrent(); close(); }
221
+ if (e.key === 'Escape') { close(); }
222
+ });
223
+
224
+ p.addEventListener('click', (e) => {
225
+ const sw = e.target.closest('.cp-swatch');
226
+ if (sw && sw.dataset.hex) {
227
+ setFromHex(sw.dataset.hex);
228
+ applyToInput(true);
229
+ commitCurrent();
230
+ }
231
+ });
232
+
233
+ if (window.EyeDropper) {
234
+ eye.addEventListener('click', async (ev) => {
235
+ ev.stopPropagation();
236
+ // Suppress the outside-click close while the OS eyedropper is open.
237
+ // Without this, the user's pixel-pick fires a window click that
238
+ // hits our document-capture listener and closes the popover.
239
+ const wasOnOutside = _onOutside;
240
+ _detachOutsideHandlers();
241
+ try {
242
+ const r = await new window.EyeDropper().open();
243
+ if (r && r.sRGBHex) {
244
+ setFromHex(r.sRGBHex);
245
+ applyToInput(true);
246
+ commitCurrent();
247
+ }
248
+ } catch (_) { /* user cancelled */ }
249
+ // Re-arm outside-click handler after a frame so the eyedropper's
250
+ // own pick-click doesn't immediately re-close us.
251
+ if (wasOnOutside && _popover) {
252
+ requestAnimationFrame(() => {
253
+ if (!_popover) return;
254
+ _onOutside = wasOnOutside;
255
+ _onEsc = (e) => { if (e.key === 'Escape') { e.preventDefault(); close(); } };
256
+ document.addEventListener('click', _onOutside, true);
257
+ document.addEventListener('keydown', _onEsc, true);
258
+ });
259
+ }
260
+ });
261
+ } else {
262
+ eye.disabled = true;
263
+ eye.style.opacity = '0.3';
264
+ eye.title = 'Eyedropper not supported in this browser';
265
+ }
266
+ }
267
+
268
+ function handleDrag(e) {
269
+ if (_drag === 'sl') {
270
+ const sl = _popover.querySelector('.cp-sl');
271
+ const r = sl.getBoundingClientRect();
272
+ const x = clamp((e.clientX - r.left) / r.width, 0, 1);
273
+ const y = clamp((e.clientY - r.top) / r.height, 0, 1);
274
+ _s = x * 100;
275
+ _v = (1 - y) * 100;
276
+ applyToInput(true);
277
+ } else if (_drag === 'hue') {
278
+ const hue = _popover.querySelector('.cp-hue');
279
+ const r = hue.getBoundingClientRect();
280
+ const x = clamp((e.clientX - r.left) / r.width, 0, 1);
281
+ _h = x * 360;
282
+ applyToInput(true);
283
+ }
284
+ }
285
+
286
+ function commitCurrent() {
287
+ if (!_input) return;
288
+ addRecent(_input.value);
289
+ syncUI();
290
+ }
291
+
292
+ // ── Open / close ──────────────────────────────────────────────────────
293
+ function position(p, anchor) {
294
+ const rect = anchor.getBoundingClientRect();
295
+ const pRect = p.getBoundingClientRect();
296
+ let left = rect.left;
297
+ let top = rect.bottom + 6;
298
+ if (left + pRect.width > window.innerWidth - 8) left = window.innerWidth - pRect.width - 8;
299
+ if (top + pRect.height > window.innerHeight - 8) top = rect.top - pRect.height - 6;
300
+ if (left < 8) left = 8;
301
+ if (top < 8) top = 8;
302
+ p.style.left = left + 'px';
303
+ p.style.top = top + 'px';
304
+ }
305
+
306
+ let _onEsc = null;
307
+
308
+ function _detachOutsideHandlers() {
309
+ if (_onOutside) {
310
+ document.removeEventListener('click', _onOutside, true);
311
+ document.removeEventListener('mousedown', _onOutside, true);
312
+ document.removeEventListener('pointerdown', _onOutside, true);
313
+ _onOutside = null;
314
+ }
315
+ if (_onEsc) {
316
+ document.removeEventListener('keydown', _onEsc, true);
317
+ _onEsc = null;
318
+ }
319
+ }
320
+
321
+ function _destroyPopover() {
322
+ _detachOutsideHandlers();
323
+ if (_popover && _popover.parentNode) {
324
+ _popover.parentNode.removeChild(_popover);
325
+ }
326
+ _popover = null;
327
+ _input = null;
328
+ _drag = null;
329
+ }
330
+
331
+ function open(inputEl) {
332
+ // Always tear down any previous popover so we never inherit stale state
333
+ // (orphaned listeners, hidden-but-mispositioned div, etc.).
334
+ _destroyPopover();
335
+ _popover = buildPopover();
336
+ _input = inputEl;
337
+ setFromHex(inputEl.value || '#000000');
338
+ _popover.style.display = 'block';
339
+ _popover.style.visibility = 'visible';
340
+ _popover.style.opacity = '1';
341
+ _popover.style.pointerEvents = 'auto';
342
+ // Let it render with its natural size, then position
343
+ requestAnimationFrame(() => {
344
+ if (_popover && _input) position(_popover, _input);
345
+ });
346
+ syncUI();
347
+
348
+ _onOutside = (e) => {
349
+ if (_drag) return; // ignore during drag
350
+ if (!_popover) return;
351
+ if (_popover.contains(e.target)) return;
352
+ if (e.target === _input) return;
353
+ // If the click landed on a modal close button (X), swallow it so the
354
+ // popover-close doesn't also dismiss the enclosing modal. The user
355
+ // wants their first click to just close the color picker.
356
+ const closeBtn = e.target.closest && e.target.closest('.close-btn, [aria-label*="lose" i]');
357
+ if (closeBtn) {
358
+ e.preventDefault();
359
+ e.stopPropagation();
360
+ if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
361
+ }
362
+ close();
363
+ };
364
+ _onEsc = (e) => {
365
+ if (e.key === 'Escape') {
366
+ // Same idea for the keyboard: Escape closes the picker first; the
367
+ // modal's own Esc handler only fires on the next press.
368
+ e.preventDefault();
369
+ e.stopPropagation();
370
+ if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
371
+ close();
372
+ }
373
+ };
374
+ // Defer install so the click that opened us doesn't immediately close us.
375
+ // Use requestAnimationFrame instead of setTimeout(0) to be sure the current
376
+ // click event has fully bubbled before we register the listener.
377
+ requestAnimationFrame(() => {
378
+ document.addEventListener('click', _onOutside, true);
379
+ // pointerdown fires before click on touch devices, and reliably even
380
+ // when the tap target swallows the click. Catching it ensures
381
+ // outside-touches close the picker on mobile.
382
+ document.addEventListener('pointerdown', _onOutside, true);
383
+ document.addEventListener('keydown', _onEsc, true);
384
+ });
385
+ }
386
+
387
+ function close() {
388
+ _destroyPopover();
389
+ }
390
+
391
+ // ── Attach to inputs ──────────────────────────────────────────────────
392
+ // Standard setter we need to call after wrapping .value with a custom setter.
393
+ const _NATIVE_VALUE_DESC = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
394
+
395
+ function _syncSwatch(el) {
396
+ const v = _NATIVE_VALUE_DESC.get.call(el);
397
+ if (/^#[0-9a-f]{6}$/i.test(v || '')) el.style.background = v;
398
+ }
399
+
400
+ export function attachColorPicker(inputEl) {
401
+ if (!inputEl || inputEl.dataset.cpAttached === '1') return;
402
+ inputEl.dataset.cpAttached = '1';
403
+
404
+ // Neutralize the native color dialog by changing the element's type.
405
+ // Existing `.value` reads + `input` event listeners continue to work.
406
+ const initialAttr = inputEl.getAttribute('value');
407
+ const initial = inputEl.value || initialAttr || '#000000';
408
+ inputEl.setAttribute('data-cp-original-type', inputEl.type || 'color');
409
+ inputEl.type = 'text';
410
+ inputEl.readOnly = true;
411
+ inputEl.classList.add('cp-swatch-input');
412
+
413
+ // Wrap .value so ANY assignment (from theme.js applyColors etc.) auto-updates the swatch bg.
414
+ Object.defineProperty(inputEl, 'value', {
415
+ configurable: true,
416
+ get() { return _NATIVE_VALUE_DESC.get.call(this); },
417
+ set(v) {
418
+ _NATIVE_VALUE_DESC.set.call(this, v);
419
+ _syncSwatch(this);
420
+ },
421
+ });
422
+
423
+ // Apply initial value so swatch shows color even before any programmatic set.
424
+ inputEl.value = initial;
425
+
426
+ // Use mousedown so we fire BEFORE any document-level click handler
427
+ // (e.g. our own _onOutside listener) can decide to close.
428
+ inputEl.addEventListener('mousedown', (e) => {
429
+ e.preventDefault();
430
+ e.stopPropagation();
431
+ // If the same input already has the picker open, close it (toggle).
432
+ // Otherwise always (re)open — never get stuck in a "won't reopen" state.
433
+ if (_input === inputEl && _popover) {
434
+ close();
435
+ } else {
436
+ open(inputEl);
437
+ }
438
+ });
439
+ // Suppress the trailing click so it can't bubble to overlays/listeners.
440
+ inputEl.addEventListener('click', (e) => {
441
+ e.preventDefault();
442
+ e.stopPropagation();
443
+ });
444
+ }
445
+
446
+ export function initColorPickers(root = document) {
447
+ root.querySelectorAll('input[type="color"]').forEach(attachColorPicker);
448
+ }
449
+
450
+ // Re-run on new inputs that may mount after init
451
+ export function refreshColorPickers(root = document) {
452
+ initColorPickers(root);
453
+ }
@@ -0,0 +1,77 @@
1
+ // compare/icons.js — SVG icons, prompt templates, and constants
2
+
3
+ // ── SVG Icons ──
4
+
5
+ export const EYE_OPEN = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>';
6
+ export const EYE_CLOSED = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><line x1="8" y1="16" x2="16" y2="8"/><line x1="8" y1="8" x2="16" y2="16"/></svg>';
7
+ export const SAVE_ICON = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>';
8
+ export const CHAT_ICON = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>';
9
+ export const ICON_COPY = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';
10
+ export const ICON_REROLL = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>';
11
+ export const ICON_EXPAND = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>';
12
+ export const ICON_COLLAPSE = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" y1="10" x2="21" y2="3"/><line x1="3" y1="21" x2="10" y2="14"/></svg>';
13
+ export const ICON_DICE = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="3"/><circle cx="8" cy="8" r="1.5" fill="currentColor"/><circle cx="16" cy="8" r="1.5" fill="currentColor"/><circle cx="8" cy="16" r="1.5" fill="currentColor"/><circle cx="16" cy="16" r="1.5" fill="currentColor"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/></svg>';
14
+ export const ICON_PLAY = '<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="5,3 19,12 5,21"/></svg>';
15
+ export const ICON_CODE = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>';
16
+ export const ICON_CLOSE = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>';
17
+ // Parallel = lines side by side, Sequential = numbered list
18
+ export const ICON_PARALLEL = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>';
19
+ export const ICON_SEQUENTIAL = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="6" x2="20" y2="6"/><line x1="8" y1="12" x2="20" y2="12"/><line x1="8" y1="18" x2="20" y2="18"/><circle cx="4" cy="6" r="1.5" fill="currentColor"/><circle cx="4" cy="12" r="1.5" fill="currentColor"/><circle cx="4" cy="18" r="1.5" fill="currentColor"/></svg>';
20
+ export const SEND_SVG = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19V5M5 12l7-7 7 7"/></svg>';
21
+
22
+ // ── Animation ──
23
+
24
+ export const WAVE_FRAMES = ['▁▂▃', '▂▃▄', '▃▄▅', '▄▅▆', '▅▆▇', '▆▅▄', '▅▄▃', '▄▃▂'];
25
+
26
+ // ── Storage keys & limits ──
27
+
28
+ export const VOTES_STORAGE_KEY = 'zero-compare-votes';
29
+ export const VOTES_MAX = 200;
30
+ export const POOL_STORAGE_KEY = 'zero-shuffle-pool-excluded';
31
+
32
+ // ── Evaluation prompt templates ──
33
+ //
34
+ // Five high-signal prompts per category — each picked to differentiate models
35
+ // on a distinct capability. The Visual / SVG-render prompt in `chat` ends with
36
+ // the subject as the last words, so swapping "a pelican riding a bicycle" for
37
+ // anything else is a one-line edit.
38
+
39
+ export const EVAL_PROMPTS = {
40
+ chat: [
41
+ // ── ★ Featured — prompts that have actually broken frontier models ──
42
+ { sub: '★ Featured', label: 'Sum digits 2^100', answer: '115', prompt: 'Compute the sum of the decimal digits of 2^100. Do NOT use code execution — work it out by reasoning about the number. Show every step, then end with the final number on its own line.' },
43
+ { sub: '★ Featured', label: 'Three jugs', answer: '4 pours: 7→5, 5→3, 3→7, 5→3', prompt: 'You have three jugs of capacities 7, 5, and 3 liters. The 7-liter jug starts full; the others empty. Using only pouring (no markings), produce the shortest sequence of pours that leaves exactly 2 liters in the 3-liter jug. Output each step as `pour A → B` on its own line. Then state the total number of pours on a final line.' },
44
+
45
+ { sub: 'Visual', label: 'Draw SVG', prompt: 'Output a complete self-contained HTML file (```html block, no explanation, no other text) that centers a single SVG illustration on a simple background. The SVG must use only inline shapes — no <img>, no external assets, no JavaScript. Make it expressive and detailed. The SVG should depict: a friendly robot' },
46
+ { sub: 'Visual explain', label: 'Black hole HTML', prompt: 'Output a complete HTML file (```html block, no explanation outside the code) that visually explains how a black hole forms. Use four labeled "frames" laid out left-to-right (or stacked on small screens) showing: 1) a glowing massive star, 2) the star going supernova with shockwave rings, 3) collapse into a singularity, 4) the final black hole with a curved accretion disk and bent light around it. Use only vanilla HTML, CSS, and inline SVG — no JavaScript, no images. Each frame should have a one-sentence caption.' },
47
+ { sub: 'Visual explain', label: 'Butterfly ASCII', prompt: 'Explain the butterfly lifecycle using ASCII art. Produce four separate frames in fenced code blocks, in order: egg, caterpillar, chrysalis, adult butterfly. Each frame must be drawn with monospace ASCII characters only and be visually recognizable as the creature/stage. Below each frame add one playful one-line caption (no longer than 15 words) describing what is happening at that stage.' },
48
+ ],
49
+ code: [
50
+ { sub: 'Algorithms', label: 'LRU cache', prompt: 'Implement an LRU cache with O(1) get and put operations. Support a configurable max capacity. Write it in any language with full comments.' },
51
+ { sub: 'Debugging', label: 'Race condition', prompt: 'This Go code has a race condition. Find it, explain why it happens, and fix it:\n\nvar counter int\nfunc increment(wg *sync.WaitGroup) {\n defer wg.Done()\n for i := 0; i < 1000; i++ {\n counter++\n }\n}' },
52
+ { sub: 'Debugging', label: 'Security review', prompt: 'Review this code for bugs, security issues, and performance problems:\n\napp.get("/user/:id", (req, res) => {\n const query = `SELECT * FROM users WHERE id = ${req.params.id}`;\n db.query(query, (err, result) => {\n res.json(result[0]);\n });\n});' },
53
+ { sub: 'Architecture', label: 'URL shortener', prompt: 'Design a URL shortener service. Cover the API, database schema, and how you would handle 1000 requests per second.' },
54
+ { sub: 'Refactoring', label: 'Clean up', prompt: 'Refactor this code to be more idiomatic and efficient:\n\nresults = []\nfor i in range(len(data)):\n if data[i]["status"] == "active":\n if data[i]["score"] > 50:\n results.append(data[i]["name"].upper())' },
55
+ ],
56
+ agent: [
57
+ { sub: 'Web tasks', label: 'Multi-step', prompt: 'Search the web for the current population of the 3 largest cities in the world, then calculate what percentage of the world\'s total population lives in those cities.', toggles: ['web'] },
58
+ { sub: 'Web tasks', label: 'Fact check', prompt: 'Fact-check these claims: 1) The Great Wall of China is visible from space. 2) Humans only use 10% of their brains. 3) Lightning never strikes the same place twice. Cite sources.', toggles: ['web'] },
59
+ { sub: 'Web tasks', label: 'Compare prices', prompt: 'Find and compare the pricing, features, and limitations of the top 3 cloud GPU providers for machine learning training. Create a markdown comparison table.', toggles: ['web'] },
60
+ { sub: 'Code tasks', label: 'Script + run', prompt: 'Write a Python script that generates a bar chart of the 5 most common programming languages in 2025 and save it as chart.png. Then run it.' },
61
+ { sub: 'Math', label: 'Proof + verify', prompt: 'Prove that the square root of 2 is irrational. Then write a Python program that approximates it using Newton\'s method to 50 decimal places and verify.' },
62
+ ],
63
+ html: [
64
+ { sub: 'Games', label: 'Snake', prompt: 'Output a complete HTML file (```html block) for a Snake game. ONLY use vanilla HTML, CSS, and JavaScript — no libraries, no Python, no imports, no external files. Canvas-based, neon green snake on dark grid, glowing food, score counter, speed increases, game over + restart. Skip any explanation, just output the code.' },
65
+ { sub: 'Games', label: 'Breakout', prompt: 'Output a complete HTML file (```html block) for a Breakout brick breaker game. ONLY use vanilla HTML, CSS, and JavaScript — no libraries, no Python, no imports, no external files. Canvas-based, colorful gradient brick rows, glowing paddle, ball with trail, score + lives, particle explosions on break. Skip any explanation, just output the code.' },
66
+ { sub: 'Animation', label: 'Solar system', prompt: 'Output a complete HTML file (```html block) for an animated solar system. ONLY use vanilla HTML, CSS, and JavaScript — no libraries, no Python, no imports, no external files. Canvas-based, glowing Sun center, 8 planets orbiting at correct relative speeds with real colors, orbit trails, starfield background, labels on hover. Skip any explanation, just output the code.' },
67
+ { sub: 'Animation', label: 'Matrix rain', prompt: 'Output a complete HTML file (```html block) for the Matrix digital rain effect. ONLY use vanilla HTML, CSS, and JavaScript — no libraries, no Python, no imports, no external files. Full-screen canvas, green katakana characters falling at varying speeds, glowing heads, fading trails, scan-line overlay. Skip any explanation, just output the code.' },
68
+ { sub: 'Generative', label: 'Fractal tree', prompt: 'Output a complete HTML file (```html block) for an interactive fractal tree. ONLY use vanilla HTML, CSS, and JavaScript — no libraries, no Python, no imports, no external files. Canvas-based, tree grows from bottom with recursive branches, sliders for angle/depth/length/wind, gradient colors from brown trunk to green leaves. Skip any explanation, just output the code.' },
69
+ ],
70
+ search: [
71
+ { sub: 'Factual', label: 'Current events', prompt: 'latest AI regulation news 2025' },
72
+ { sub: 'Technical', label: 'Programming', prompt: 'Rust vs Go performance benchmarks 2025' },
73
+ { sub: 'Research', label: 'Academic', prompt: 'transformer architecture improvements since attention is all you need' },
74
+ { sub: 'Comparison', label: 'GPU providers', prompt: 'cloud GPU providers pricing comparison 2025' },
75
+ { sub: 'Factual', label: 'Science', prompt: 'CRISPR gene therapy breakthroughs' },
76
+ ],
77
+ };