mindroot 9.22.0__py3-none-any.whl → 10.14.0__py3-none-any.whl

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 (331) hide show
  1. mindroot/coreplugins/admin/static/js/agent-form.js +26 -1
  2. mindroot/coreplugins/admin/static/js/persona-editor.js +14 -1
  3. mindroot/coreplugins/agent/agent.py +59 -18
  4. mindroot/coreplugins/agent/agent.py.bak +507 -0
  5. mindroot/coreplugins/agent/buagentz1.py +540 -0
  6. mindroot/coreplugins/agent/speech_to_speech.py +77 -0
  7. mindroot/coreplugins/agent/speech_to_speech.py.backup +46 -0
  8. mindroot/coreplugins/chat/buservices.py +625 -0
  9. mindroot/coreplugins/chat/buwidget_routes.py +287 -0
  10. mindroot/coreplugins/chat/commands.py +4 -0
  11. mindroot/coreplugins/chat/services.py +178 -8
  12. mindroot/coreplugins/chat/static/css/dark.css +90 -1
  13. mindroot/coreplugins/chat/static/css/default.css +90 -1
  14. mindroot/coreplugins/chat/static/css/light.css +724 -0
  15. mindroot/coreplugins/chat/static/css/mobile.css +37 -0
  16. mindroot/coreplugins/chat/static/js/chat.js +150 -89
  17. mindroot/coreplugins/chat/static/js/chatform.js +1 -1
  18. mindroot/coreplugins/chat/static/js/throttle.js +4 -2
  19. mindroot/coreplugins/chat/templates/chat.jinja2 +9 -1
  20. mindroot/coreplugins/chat/widget_routes.py +54 -10
  21. mindroot/coreplugins/check_list/helpers.py +221 -0
  22. mindroot/coreplugins/check_list/mod.py +435 -126
  23. mindroot/coreplugins/check_list/mod.py.backup +378 -0
  24. mindroot/coreplugins/check_list/mod.py.backup2 +506 -0
  25. mindroot/coreplugins/check_list/mod.py.backup3 +506 -0
  26. mindroot/coreplugins/check_list/mod_create_checklist_lol.py +756 -0
  27. mindroot/coreplugins/check_list/plugin_info.json +15 -0
  28. mindroot/coreplugins/jwt_auth/middleware.py +1 -1
  29. mindroot/docs/.env +1 -0
  30. mindroot/docs/.gitignore +1 -0
  31. mindroot/docs/_build/doctrees/chat_with_assistant.doctree +0 -0
  32. mindroot/docs/_build/doctrees/developer_documentation.doctree +0 -0
  33. mindroot/docs/_build/doctrees/embed_chat.doctree +0 -0
  34. mindroot/docs/_build/doctrees/environment.pickle +0 -0
  35. mindroot/docs/_build/doctrees/getting_started.doctree +0 -0
  36. mindroot/docs/_build/doctrees/index.doctree +0 -0
  37. mindroot/docs/_build/doctrees/install_plugins_with_tools.doctree +0 -0
  38. mindroot/docs/_build/doctrees/installation.doctree +0 -0
  39. mindroot/docs/_build/doctrees/llm_api_key.doctree +0 -0
  40. mindroot/docs/_build/doctrees/llm_plugin_installation.doctree +0 -0
  41. mindroot/docs/_build/doctrees/programming_task.doctree +0 -0
  42. mindroot/docs/_build/doctrees/source/ahp.doctree +0 -0
  43. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.admin.doctree +0 -0
  44. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.api_keys.doctree +0 -0
  45. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.chat.doctree +0 -0
  46. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.chat_avatar.doctree +0 -0
  47. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.check_list.doctree +0 -0
  48. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.credits.doctree +0 -0
  49. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.doctree +0 -0
  50. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.email.doctree +0 -0
  51. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.env_manager.doctree +0 -0
  52. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.events.doctree +0 -0
  53. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.index.doctree +0 -0
  54. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.index.handlers.doctree +0 -0
  55. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.jwt_auth.doctree +0 -0
  56. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.l8n.doctree +0 -0
  57. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.mcp_.doctree +0 -0
  58. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.persona.doctree +0 -0
  59. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.startup.doctree +0 -0
  60. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.subscriptions.doctree +0 -0
  61. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.usage.doctree +0 -0
  62. mindroot/docs/_build/doctrees/source/mindroot.coreplugins.user_service.doctree +0 -0
  63. mindroot/docs/_build/doctrees/source/mindroot.doctree +0 -0
  64. mindroot/docs/_build/doctrees/source/mindroot.lib.auth.doctree +0 -0
  65. mindroot/docs/_build/doctrees/source/mindroot.lib.doctree +0 -0
  66. mindroot/docs/_build/doctrees/source/mindroot.lib.json_str_block.doctree +0 -0
  67. mindroot/docs/_build/doctrees/source/mindroot.lib.plugins.doctree +0 -0
  68. mindroot/docs/_build/doctrees/source/mindroot.lib.providers.backup.doctree +0 -0
  69. mindroot/docs/_build/doctrees/source/mindroot.lib.providers.doctree +0 -0
  70. mindroot/docs/_build/doctrees/source/mindroot.registry.doctree +0 -0
  71. mindroot/docs/_build/doctrees/source/modules.doctree +0 -0
  72. mindroot/docs/_build/doctrees/source/mr_agent_expert_instr.doctree +0 -0
  73. mindroot/docs/_build/doctrees/starting_mindroot.doctree +0 -0
  74. mindroot/docs/_build/doctrees/user_documentation.doctree +0 -0
  75. mindroot/docs/_build/html/_images/apikey.png +0 -0
  76. mindroot/docs/_build/html/_images/chatwidgetx.png +0 -0
  77. mindroot/docs/_build/html/_images/disablechatavatar.png +0 -0
  78. mindroot/docs/_build/html/_images/widgetform.png +0 -0
  79. mindroot/docs/_build/html/_images/widgetonpage.png +0 -0
  80. mindroot/docs/_build/html/_modules/index.html +1 -0
  81. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/agent_importer.html +282 -86
  82. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/agent_router.html +281 -88
  83. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/asset_manager.html +280 -84
  84. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/command_router.html +281 -88
  85. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/mcp_catalog_routes.html +279 -86
  86. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/mcp_publish_routes.html +284 -91
  87. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/mcp_registry_routes.html +284 -91
  88. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/mcp_routes.html +281 -88
  89. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/mod.html +280 -84
  90. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/oauth_callback_router.html +280 -87
  91. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/persona_handler.html +282 -86
  92. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/persona_router.html +285 -89
  93. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/plugin_manager.html +281 -88
  94. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/plugin_router.html +280 -87
  95. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/plugin_routes.html +280 -87
  96. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/registry_settings_routes.html +280 -87
  97. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/router.html +281 -88
  98. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/server_router.html +280 -84
  99. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/service_models.html +280 -87
  100. mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/settings_router.html +288 -89
  101. mindroot/docs/_build/html/_modules/mindroot/coreplugins/api_keys/api_key_manager.html +280 -87
  102. mindroot/docs/_build/html/_modules/mindroot/coreplugins/api_keys/mod.html +279 -86
  103. mindroot/docs/_build/html/_modules/mindroot/coreplugins/api_keys/router.html +280 -87
  104. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/commands.html +281 -88
  105. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/mod.html +279 -86
  106. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/models.html +280 -87
  107. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/router.html +281 -88
  108. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/services.html +283 -90
  109. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/widget_manager.html +279 -86
  110. mindroot/docs/_build/html/_modules/mindroot/coreplugins/chat/widget_routes.html +279 -86
  111. mindroot/docs/_build/html/_modules/mindroot/coreplugins/check_list/mod.html +669 -213
  112. mindroot/docs/_build/html/_modules/mindroot/coreplugins/credits/conversion.html +280 -87
  113. mindroot/docs/_build/html/_modules/mindroot/coreplugins/credits/ledger.html +281 -88
  114. mindroot/docs/_build/html/_modules/mindroot/coreplugins/credits/mod.html +281 -88
  115. mindroot/docs/_build/html/_modules/mindroot/coreplugins/credits/models.html +279 -86
  116. mindroot/docs/_build/html/_modules/mindroot/coreplugins/credits/router.html +279 -86
  117. mindroot/docs/_build/html/_modules/mindroot/coreplugins/credits/storage.html +279 -86
  118. mindroot/docs/_build/html/_modules/mindroot/coreplugins/email/email_provider.html +280 -87
  119. mindroot/docs/_build/html/_modules/mindroot/coreplugins/email/imap_handler.html +284 -91
  120. mindroot/docs/_build/html/_modules/mindroot/coreplugins/email/mod.html +280 -87
  121. mindroot/docs/_build/html/_modules/mindroot/coreplugins/email/services.html +280 -87
  122. mindroot/docs/_build/html/_modules/mindroot/coreplugins/email/smtp_handler.html +280 -87
  123. mindroot/docs/_build/html/_modules/mindroot/coreplugins/email/test_email_service.html +280 -87
  124. mindroot/docs/_build/html/_modules/mindroot/coreplugins/env_manager/mod.html +281 -88
  125. mindroot/docs/_build/html/_modules/mindroot/coreplugins/env_manager/router.html +280 -87
  126. mindroot/docs/_build/html/_modules/mindroot/coreplugins/events/router.html +280 -87
  127. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/handlers/agent_ops.html +280 -87
  128. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/handlers/index_ops.html +280 -87
  129. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/handlers/plugin_ops.html +284 -91
  130. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/handlers/publish.html +281 -88
  131. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/mod.html +279 -86
  132. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/models.html +282 -86
  133. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/router.html +284 -91
  134. mindroot/docs/_build/html/_modules/mindroot/coreplugins/index/utils.html +282 -86
  135. mindroot/docs/_build/html/_modules/mindroot/coreplugins/jwt_auth/middleware.html +282 -89
  136. mindroot/docs/_build/html/_modules/mindroot/coreplugins/jwt_auth/mod.html +279 -86
  137. mindroot/docs/_build/html/_modules/mindroot/coreplugins/jwt_auth/router.html +280 -87
  138. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/language_detection.html +280 -84
  139. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/middleware.html +280 -84
  140. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/mod.html +282 -86
  141. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/test_enhanced.html +280 -84
  142. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/test_l8n_standalone.html +282 -86
  143. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/test_middleware.html +282 -86
  144. mindroot/docs/_build/html/_modules/mindroot/coreplugins/l8n/utils.html +280 -84
  145. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/catalog_commands.html +282 -86
  146. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/catalog_manager.html +280 -84
  147. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/dynamic_commands.html +280 -84
  148. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/mcp_manager.html +282 -86
  149. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/mod.html +282 -86
  150. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/oauth_storage.html +280 -84
  151. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/server_installer.html +282 -86
  152. mindroot/docs/_build/html/_modules/mindroot/coreplugins/mcp_/testmcpclient.html +285 -89
  153. mindroot/docs/_build/html/_modules/mindroot/coreplugins/persona/init_persona.html +280 -84
  154. mindroot/docs/_build/html/_modules/mindroot/coreplugins/persona/mod.html +282 -86
  155. mindroot/docs/_build/html/_modules/mindroot/coreplugins/startup/mod.html +282 -86
  156. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/credit_integration.html +280 -84
  157. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/mod.html +282 -86
  158. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/models.html +280 -84
  159. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/router.html +285 -89
  160. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/storage.html +282 -86
  161. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/stripe_integration.html +280 -84
  162. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/subscription_manager.html +280 -84
  163. mindroot/docs/_build/html/_modules/mindroot/coreplugins/subscriptions/webhook_handler.html +280 -84
  164. mindroot/docs/_build/html/_modules/mindroot/coreplugins/usage/handlers.html +282 -86
  165. mindroot/docs/_build/html/_modules/mindroot/coreplugins/usage/mod.html +282 -86
  166. mindroot/docs/_build/html/_modules/mindroot/coreplugins/usage/models.html +282 -86
  167. mindroot/docs/_build/html/_modules/mindroot/coreplugins/usage/reporting.html +282 -86
  168. mindroot/docs/_build/html/_modules/mindroot/coreplugins/usage/router.html +282 -86
  169. mindroot/docs/_build/html/_modules/mindroot/coreplugins/usage/storage.html +285 -89
  170. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/admin_init.html +282 -86
  171. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/email_service.html +282 -86
  172. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/mod.html +280 -84
  173. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/models.html +282 -86
  174. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/password_reset_service.html +282 -86
  175. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/role_service.html +282 -86
  176. mindroot/docs/_build/html/_modules/mindroot/coreplugins/user_service/router.html +282 -86
  177. mindroot/docs/_build/html/_modules/mindroot/lib/auth/api_key.html +280 -84
  178. mindroot/docs/_build/html/_modules/mindroot/lib/auth/auth.html +282 -86
  179. mindroot/docs/_build/html/_modules/mindroot/lib/buchatlog.html +285 -89
  180. mindroot/docs/_build/html/_modules/mindroot/lib/buchatlog2.html +282 -86
  181. mindroot/docs/_build/html/_modules/mindroot/lib/butemplates.html +282 -86
  182. mindroot/docs/_build/html/_modules/mindroot/lib/chatcontext.html +285 -89
  183. mindroot/docs/_build/html/_modules/mindroot/lib/chatlog.html +440 -91
  184. mindroot/docs/_build/html/_modules/mindroot/lib/chatlog_optimized.html +282 -86
  185. mindroot/docs/_build/html/_modules/mindroot/lib/json_escape.html +280 -84
  186. mindroot/docs/_build/html/_modules/mindroot/lib/json_str_block/json_str_block.html +282 -86
  187. mindroot/docs/_build/html/_modules/mindroot/lib/parent_templates.html +282 -86
  188. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/installation.html +280 -84
  189. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/l8n_static_handler.html +280 -84
  190. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/loader.html +282 -86
  191. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/loader_with_l8n.html +282 -86
  192. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/manifest.html +282 -86
  193. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/mapping.html +280 -84
  194. mindroot/docs/_build/html/_modules/mindroot/lib/plugins/paths.html +282 -86
  195. mindroot/docs/_build/html/_modules/mindroot/lib/plugins_install.html +282 -86
  196. mindroot/docs/_build/html/_modules/mindroot/lib/providers/commands.html +282 -87
  197. mindroot/docs/_build/html/_modules/mindroot/lib/providers/hooks.html +280 -85
  198. mindroot/docs/_build/html/_modules/mindroot/lib/providers/missing.html +282 -87
  199. mindroot/docs/_build/html/_modules/mindroot/lib/providers/model_preferences_v2.html +294 -91
  200. mindroot/docs/_build/html/_modules/mindroot/lib/providers/services.html +282 -87
  201. mindroot/docs/_build/html/_modules/mindroot/lib/providers.html +285 -89
  202. mindroot/docs/_build/html/_modules/mindroot/lib/route_decorators.html +282 -86
  203. mindroot/docs/_build/html/_modules/mindroot/lib/session_files.html +282 -86
  204. mindroot/docs/_build/html/_modules/mindroot/lib/streamcmd.html +282 -86
  205. mindroot/docs/_build/html/_modules/mindroot/lib/templates.html +343 -98
  206. mindroot/docs/_build/html/_modules/mindroot/lib/token_counter.html +280 -84
  207. mindroot/docs/_build/html/_modules/mindroot/migrate.html +282 -86
  208. mindroot/docs/_build/html/_modules/mindroot/registry/component_manager.html +282 -86
  209. mindroot/docs/_build/html/_modules/mindroot/registry/data_access.html +285 -89
  210. mindroot/docs/_build/html/_modules/mindroot/server.html +292 -87
  211. mindroot/docs/_build/html/_modules/mindroot/server_missing_normal_args.html +282 -86
  212. mindroot/docs/_build/html/_modules/mindroot/server_prev.html +282 -86
  213. mindroot/docs/_build/html/_sources/developer_documentation.rst.txt +21 -1
  214. mindroot/docs/_build/html/_sources/embed_chat.rst.txt +54 -0
  215. mindroot/docs/_build/html/_sources/user_documentation.rst.txt +6 -1
  216. mindroot/docs/_build/html/chat_with_assistant.html +1 -0
  217. mindroot/docs/_build/html/developer_documentation.html +45 -4
  218. mindroot/docs/_build/html/embed_chat.html +381 -0
  219. mindroot/docs/_build/html/genindex.html +9 -2
  220. mindroot/docs/_build/html/getting_started.html +19 -15
  221. mindroot/docs/_build/html/index.html +3 -0
  222. mindroot/docs/_build/html/install_plugins_with_tools.html +1 -0
  223. mindroot/docs/_build/html/installation.html +1 -0
  224. mindroot/docs/_build/html/llm_api_key.html +1 -0
  225. mindroot/docs/_build/html/llm_plugin_installation.html +1 -0
  226. mindroot/docs/_build/html/objects.inv +0 -0
  227. mindroot/docs/_build/html/programming_task.html +4 -3
  228. mindroot/docs/_build/html/py-modindex.html +2 -1
  229. mindroot/docs/_build/html/search.html +1 -0
  230. mindroot/docs/_build/html/searchindex.js +1 -1
  231. mindroot/docs/_build/html/source/ahp.html +1 -0
  232. mindroot/docs/_build/html/source/mindroot.coreplugins.admin.html +1 -0
  233. mindroot/docs/_build/html/source/mindroot.coreplugins.api_keys.html +16 -2
  234. mindroot/docs/_build/html/source/mindroot.coreplugins.chat.html +1 -0
  235. mindroot/docs/_build/html/source/mindroot.coreplugins.chat_avatar.html +16 -2
  236. mindroot/docs/_build/html/source/mindroot.coreplugins.check_list.html +91 -47
  237. mindroot/docs/_build/html/source/mindroot.coreplugins.credits.html +16 -2
  238. mindroot/docs/_build/html/source/mindroot.coreplugins.email.html +1 -0
  239. mindroot/docs/_build/html/source/mindroot.coreplugins.env_manager.html +16 -2
  240. mindroot/docs/_build/html/source/mindroot.coreplugins.events.html +16 -2
  241. mindroot/docs/_build/html/source/mindroot.coreplugins.html +3 -0
  242. mindroot/docs/_build/html/source/mindroot.coreplugins.index.handlers.html +16 -2
  243. mindroot/docs/_build/html/source/mindroot.coreplugins.index.html +16 -2
  244. mindroot/docs/_build/html/source/mindroot.coreplugins.jwt_auth.html +1 -0
  245. mindroot/docs/_build/html/source/mindroot.coreplugins.l8n.html +1 -0
  246. mindroot/docs/_build/html/source/mindroot.coreplugins.mcp_.html +1 -0
  247. mindroot/docs/_build/html/source/mindroot.coreplugins.persona.html +16 -2
  248. mindroot/docs/_build/html/source/mindroot.coreplugins.startup.html +16 -2
  249. mindroot/docs/_build/html/source/mindroot.coreplugins.subscriptions.html +16 -2
  250. mindroot/docs/_build/html/source/mindroot.coreplugins.usage.html +16 -2
  251. mindroot/docs/_build/html/source/mindroot.coreplugins.user_service.html +16 -2
  252. mindroot/docs/_build/html/source/mindroot.html +2 -0
  253. mindroot/docs/_build/html/source/mindroot.lib.auth.html +16 -2
  254. mindroot/docs/_build/html/source/mindroot.lib.html +36 -4
  255. mindroot/docs/_build/html/source/mindroot.lib.json_str_block.html +16 -2
  256. mindroot/docs/_build/html/source/mindroot.lib.plugins.html +16 -2
  257. mindroot/docs/_build/html/source/mindroot.lib.providers.backup.html +1 -0
  258. mindroot/docs/_build/html/source/mindroot.lib.providers.html +1 -0
  259. mindroot/docs/_build/html/source/mindroot.registry.html +16 -2
  260. mindroot/docs/_build/html/source/modules.html +16 -2
  261. mindroot/docs/_build/html/source/mr_agent_expert_instr.html +1 -0
  262. mindroot/docs/_build/html/starting_mindroot.html +1 -0
  263. mindroot/docs/_build/html/user_documentation.html +9 -0
  264. mindroot/docs/apikey.png +0 -0
  265. mindroot/docs/chatwidget1.png +0 -0
  266. mindroot/docs/chatwidgetx.png +0 -0
  267. mindroot/docs/developer_documentation.rst +21 -1
  268. mindroot/docs/disablechatavatar.png +0 -0
  269. mindroot/docs/embed_chat.rst +54 -0
  270. mindroot/docs/user_documentation.rst +6 -1
  271. mindroot/docs/widgetform.png +0 -0
  272. mindroot/docs/widgetonpage.png +0 -0
  273. mindroot/lib/buchatlog3.py +592 -0
  274. mindroot/lib/chatcontext.py +1 -0
  275. mindroot/lib/chatlog.py +195 -5
  276. mindroot/lib/logging/logfiles.py +1 -0
  277. {mindroot-9.22.0.dist-info → mindroot-10.14.0.dist-info}/METADATA +1 -1
  278. {mindroot-9.22.0.dist-info → mindroot-10.14.0.dist-info}/RECORD +282 -300
  279. mindroot/docs/_build/html/.buildinfo.bak +0 -4
  280. mindroot/docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -123
  281. mindroot/docs/_build/html/_static/css/badge_only.css +0 -1
  282. mindroot/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  283. mindroot/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  284. mindroot/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  285. mindroot/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  286. mindroot/docs/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
  287. mindroot/docs/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -2671
  288. mindroot/docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  289. mindroot/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
  290. mindroot/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  291. mindroot/docs/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
  292. mindroot/docs/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  293. mindroot/docs/_build/html/_static/css/fonts/lato-bold.woff +0 -0
  294. mindroot/docs/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
  295. mindroot/docs/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
  296. mindroot/docs/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  297. mindroot/docs/_build/html/_static/css/fonts/lato-normal.woff +0 -0
  298. mindroot/docs/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
  299. mindroot/docs/_build/html/_static/css/theme.css +0 -4
  300. mindroot/docs/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
  301. mindroot/docs/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
  302. mindroot/docs/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
  303. mindroot/docs/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
  304. mindroot/docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
  305. mindroot/docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
  306. mindroot/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
  307. mindroot/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
  308. mindroot/docs/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
  309. mindroot/docs/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
  310. mindroot/docs/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
  311. mindroot/docs/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
  312. mindroot/docs/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
  313. mindroot/docs/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
  314. mindroot/docs/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
  315. mindroot/docs/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
  316. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
  317. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
  318. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
  319. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
  320. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
  321. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
  322. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
  323. mindroot/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
  324. mindroot/docs/_build/html/_static/jquery.js +0 -2
  325. mindroot/docs/_build/html/_static/js/badge_only.js +0 -1
  326. mindroot/docs/_build/html/_static/js/theme.js +0 -1
  327. mindroot/docs/_build/html/_static/js/versions.js +0 -228
  328. {mindroot-9.22.0.dist-info → mindroot-10.14.0.dist-info}/WHEEL +0 -0
  329. {mindroot-9.22.0.dist-info → mindroot-10.14.0.dist-info}/entry_points.txt +0 -0
  330. {mindroot-9.22.0.dist-info → mindroot-10.14.0.dist-info}/licenses/LICENSE +0 -0
  331. {mindroot-9.22.0.dist-info → mindroot-10.14.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
1
1
  /* Mobile-specific styles */
2
+
2
3
  @media screen and (max-width: 768px) {
3
4
  .page-container {
4
5
  position: relative;
@@ -132,6 +133,42 @@
132
133
  padding: 8px 12px;
133
134
  }
134
135
 
136
+ /* Fix for mobile chat layout - ensure chat form is visible */
137
+ html, body {
138
+ height: 100%;
139
+ overflow: hidden;
140
+ }
141
+
142
+ .page-container {
143
+ height: 100%;
144
+ display: flex;
145
+ flex-direction: column;
146
+ }
147
+
148
+ .main {
149
+ height: 100%;
150
+ display: flex;
151
+ flex-direction: column;
152
+ overflow: hidden;
153
+ }
154
+
155
+ chat-ai {
156
+ height: 100%;
157
+ display: flex;
158
+ flex-direction: column;
159
+ padding-top: 60px; /* Space for hamburger menu */
160
+ padding-bottom: 10px;
161
+ }
162
+
163
+ .chat-log {
164
+ flex: 1;
165
+ overflow-y: auto;
166
+ }
167
+
168
+ chat-form {
169
+ flex-shrink: 0;
170
+ }
171
+
135
172
  /* Ensure images in markdown content are also responsive */
136
173
  .message p img {
137
174
  max-width: 100%;
@@ -15,9 +15,12 @@ import showNotification from './notification.js';
15
15
  if (!window.lastParsed) window.lastParsed = Date.now();
16
16
  if (!window.lastScrolled) window.lastScrolled = Date.now();
17
17
 
18
+ // Initialize ansi_up for ANSI color code rendering
19
+ const ansi_up = new AnsiUp();
20
+
18
21
  window.lastScrolled = Date.now();
19
22
 
20
- const commandHandlers = {};
23
+ window.commandHandlers = {};
21
24
 
22
25
  // Function to register command handlers
23
26
  window.registerCommandHandler = function(command, handler) {
@@ -27,10 +30,15 @@ window.registerCommandHandler = function(command, handler) {
27
30
 
28
31
  registerDelegate()
29
32
 
30
- function tryParse(markdown) {
33
+
34
+ function tryParse_(markdown) {
31
35
  return markdownRenderer.parse(markdown);
32
36
  }
33
37
 
38
+ //const tryParse = throttle(tryParse_, 200)
39
+ const tryParse = tryParse_;
40
+
41
+
34
42
  const noAction = [ 'say', 'json_encoded_md', 'wait_for_user_reply', 'markdown_await_user', 'tell_and_continue', 'think' ]
35
43
 
36
44
  class Chat extends BaseEl {
@@ -104,19 +112,21 @@ class Chat extends BaseEl {
104
112
  } else {
105
113
  this.sse = new EventSource(`/chat/${this.sessionid}/events`);
106
114
  }
107
-
108
- const thisPartial = this._partialCmd.bind(this)
115
+
116
+ const thisPartial_ = this._partialCmd.bind(this)
117
+ const thisPartial = throttle(thisPartial_, 300)
109
118
  const thisRunning = this._runningCmd.bind(this)
110
119
  const thisResult = this._cmdResult.bind(this)
111
120
  const thisFinished = this._finished.bind(this)
112
121
  const thisError = this._showError.bind(this)
113
122
 
114
123
  this.sse.addEventListener('image', this._imageMsg.bind(this));
115
- this.sse.addEventListener('partial_command', e => thisPartial(e).catch(console.error));
124
+ this.sse.addEventListener('partial_command', e => thisPartial(e));
116
125
  this.sse.addEventListener('running_command', e => thisRunning(e).catch(console.error));
117
126
  this.sse.addEventListener('command_result', e => thisResult(e).catch(console.error));
118
127
  this.sse.addEventListener('finished_chat', e => thisFinished(e).catch(console.error));
119
128
  this.sse.addEventListener('system_error', e=> thisError(e).catch(console.error));
129
+ this.sse.addEventListener('backend_user_message', this._backendUserMessage.bind(this));
120
130
 
121
131
  // when the user scrolls in the chat log, stop auto-scrolling to the bottom
122
132
  const chatLog = this.shadowRoot.querySelector('.chat-log');
@@ -144,6 +154,27 @@ class Chat extends BaseEl {
144
154
  showNotification('error', data.error);
145
155
  }
146
156
 
157
+ _backendUserMessage(event) {
158
+ console.log('Backend user message received:', event);
159
+ const data = JSON.parse(event.data);
160
+ const { content, sender, persona } = data;
161
+
162
+ // Parse the content as markdown
163
+ const parsed = tryParse_(content);
164
+
165
+ // Add the message to the chat log
166
+ this.messages = [...this.messages, {
167
+ content: parsed,
168
+ spinning: 'no',
169
+ sender: sender || 'user',
170
+ persona: persona || 'user'
171
+ }];
172
+
173
+ // Scroll to show the new message
174
+ setTimeout(() => {
175
+ this._scrollToBottom();
176
+ }, 100);
177
+ }
147
178
 
148
179
 
149
180
  _addMessage(event) {
@@ -153,14 +184,14 @@ class Chat extends BaseEl {
153
184
  let combinedContent = '';
154
185
  for (let item of content) {
155
186
  if (item.type === 'text') {
156
- combinedContent += tryParse(item.text);
187
+ combinedContent += tryParse_(item.text);
157
188
  } else if (item.type === 'image') {
158
189
  combinedContent += `<img src="${item.data}" class="image_input" alt="pasted image">`;
159
190
  }
160
191
  }
161
192
  this.messages = [...this.messages, { content: combinedContent, spinning:'no', sender, persona }];
162
193
  } else {
163
- const parsed = tryParse(content);
194
+ const parsed = tryParse_(content);
164
195
  this.messages = [...this.messages, { content: parsed, spinning:'no', sender, persona }];
165
196
  content = [{ type: 'text', text: content }]
166
197
  }
@@ -205,106 +236,121 @@ class Chat extends BaseEl {
205
236
  }
206
237
 
207
238
  textParam (data) {
208
- if (data.params.text) {
239
+ console.log('textParam', data);
240
+ if (typeof(data) == 'string') {
241
+ try {
242
+ data = JSON.parse(data);
243
+ } catch (e) {
244
+ console.error('Could not parse data string:', e);
245
+ return data;
246
+ }
247
+ }
248
+ if (data?.args?.text) {
249
+ return data.args.text;
250
+ } else if (data?.params?.text) {
209
251
  return data.params.text;
210
252
  } else if (data.params.markdown) {
211
- return data.params.markdown;
212
- } else if (data.params.extensive_chain_of_thoughts) {
253
+ return data?.params?.markdown;
254
+ } else if (data?.params?.extensive_chain_of_thoughts) {
213
255
  return data.params.extensive_chain_of_thoughts;
214
256
  }
215
257
  return JSON.stringify(data.params);
216
258
  }
217
259
 
218
260
  async _partialCmd(event) {
219
- console.log('Event received');
220
- console.log(event);
221
- let content = null
222
- const data = JSON.parse(event.data);
223
- data.event = 'partial'
224
- console.log("data:", data)
225
- const handler = commandHandlers[data.command];
226
- if (handler) {
227
- content = await handler(data);
228
- }
229
- if (this.messages[this.messages.length - 1]?.sender != 'ai' || this.startNewMsg) {
230
- console.log('adding message');
231
- this.messages = [...this.messages, { content: '', sender: 'ai', persona: data.persona }];
232
- this.startNewMsg = false
233
- }
234
-
235
- if (noAction.includes(data.command)) {
236
- // Check if there's a registered handler for this command
261
+ try {
262
+ console.log('Event received');
263
+ console.log(event);
264
+ let content = null
265
+ const data = JSON.parse(event.data);
266
+ data.event = 'partial'
267
+ console.log("data:", data)
268
+ const handler = commandHandlers[data.command];
237
269
  if (handler) {
238
- console.log('Used registered handler for', data.command);
239
- this.msgSoFar = null
240
- } else {
241
- this.msgSoFar = this.textParam(data);
270
+ content = await handler(data);
271
+ }
272
+ if (this.messages[this.messages.length - 1]?.sender != 'ai' || this.startNewMsg) {
273
+ console.log('adding message');
274
+ this.messages = [...this.messages, { content: '', sender: 'ai', persona: data.persona }];
275
+ this.startNewMsg = false
242
276
  }
243
277
 
244
- try {
245
- if (!window.lastParsed) window.lastParsed = Date.now();
246
- if (content) {
247
- this.messages[this.messages.length - 1].content = content
248
- } else if (this.msgSoFar) {
249
- let elapsed_ = Date.now() - window.lastParsed;
250
- if (elapsed_ > 40 || this.msgSoFar + '' == '[object Object]' ) {
251
- const parsed_ = tryParse(this.msgSoFar);
252
- if (false && parsed_+'' == '[object Object]') {
253
- console.log('msgSoFar is an object, not parsing:', this.msgSoFar);
278
+ if (noAction.includes(data.command)) {
279
+ // Check if there's a registered handler for this command
280
+ if (handler) {
281
+ console.log('Used registered handler for', data.command);
282
+ this.msgSoFar = null
283
+ } else {
284
+ this.msgSoFar = this.textParam(data);
285
+ }
286
+
287
+ try {
288
+ if (!window.lastParsed) window.lastParsed = Date.now();
289
+ if (content) {
290
+ this.messages[this.messages.length - 1].content = content
291
+ } else if (this.msgSoFar) {
292
+ let elapsed_ = Date.now() - window.lastParsed;
293
+ if (elapsed_ > 40 || this.msgSoFar + '' == '[object Object]' ) {
294
+ const parsed_ = tryParse(this.msgSoFar);
295
+ if (false && parsed_+'' == '[object Object]') {
296
+ console.log('msgSoFar is an object, not parsing:', this.msgSoFar);
297
+ } else {
298
+ this.messages[this.messages.length - 1].content = parsed_;
299
+ console.log(' parsed ', elapsed_);
300
+ window.lastParsed = Date.now();
301
+ }
254
302
  } else {
255
- this.messages[this.messages.length - 1].content = parsed_;
256
- console.log(' parsed ', elapsed_);
257
- window.lastParsed = Date.now();
303
+ console.log('********************************* only ',elapsed_);
258
304
  }
259
- } else {
260
- console.log('********************************* only ',elapsed_);
261
305
  }
306
+ } catch (e) {
307
+ console.error("Could not parse markdown:", e)
308
+ console.log('msgSoFar:')
309
+ console.log(this.msgSoFar)
310
+ this.messages[this.messages.length - 1].content = `<pre><code>${this.msgSoFar}</code></pre>`
262
311
  }
263
- } catch (e) {
264
- console.error("Could not parse markdown:", e)
265
- console.log('msgSoFar:')
266
- console.log(this.msgSoFar)
267
- this.messages[this.messages.length - 1].content = `<pre><code>${this.msgSoFar}</code></pre>`
268
- }
269
- } else {
270
- console.log('partial. data.params', data.params)
271
- console.log("command is", data.command)
272
- if (handler) {
273
- data.event = 'partial'
274
- console.log('handler:', handler)
275
- content = handler(data);
276
- this.requestUpdate();
277
312
  } else {
278
- console.warn('No handler for command:', data.command)
279
- console.warn(commandHandlers)
280
- }
313
+ console.log('partial. data.params', data.params)
314
+ console.log("command is", data.command)
315
+ if (handler) {
316
+ data.event = 'partial'
317
+ console.log('handler:', handler)
318
+ content = handler(data);
319
+ this.requestUpdate();
320
+ } else {
321
+ console.warn('No handler for command:', data.command)
322
+ console.warn(commandHandlers)
323
+ }
281
324
 
282
- if (typeof(data.params) == 'array') {
283
- data.params = {"val": data.params}
284
- } else if (typeof(data.params) == 'string') {
285
- data.params = {"val": data.params}
286
- } else if (typeof(data.params) == 'object') {
287
- data.params = {"val": data.params}
288
- }
289
- const paramStr = JSON.stringify(data.params)
290
- const escaped = escapeJsonForHtml(paramStr)
291
- if (content) {
292
- console.log('found content, not using action component')
293
- this.messages[this.messages.length - 1].content = content
294
- } else {
295
- if (this.messages[this.messages.length - 1].content == '' ||
296
- Date.now()- window.lastParsed > 40) {
297
- window.lastParsed = Date.now();
298
- this.messages[this.messages.length - 1].content = `
299
- <action-component funcName="${data.command}" params="${escaped}"
300
- result="">
301
- </action-component>`;
325
+ if (typeof(data.params) == 'array') {
326
+ data.params = {"val": data.params}
327
+ } else if (typeof(data.params) == 'string') {
328
+ data.params = {"val": data.params}
329
+ } else if (typeof(data.params) == 'object') {
330
+ data.params = {"val": data.params}
331
+ }
332
+ const paramStr = JSON.stringify(data.params)
333
+ const escaped = escapeJsonForHtml(paramStr)
334
+ if (content) {
335
+ console.log('found content, not using action component')
336
+ this.messages[this.messages.length - 1].content = content
337
+ } else {
338
+ if (this.messages[this.messages.length - 1].content == '' ||
339
+ Date.now()- window.lastParsed > 40) {
340
+ window.lastParsed = Date.now();
341
+ this.messages[this.messages.length - 1].content = `
342
+ <action-component funcName="${data.command}" params="${escaped}"
343
+ result="">
344
+ </action-component>`;
345
+ }
302
346
  }
303
347
  }
348
+ this.requestUpdate();
349
+ this._scrollToBottom()
350
+ window.initializeCodeCopyButtons();
351
+ } catch (e) {
352
+ console.error("Error in partialCmd", e)
304
353
  }
305
- this.requestUpdate();
306
- this._scrollToBottom()
307
- window.initializeCodeCopyButtons();
308
354
  }
309
355
 
310
356
  async _runningCmd(event) {
@@ -322,7 +368,7 @@ class Chat extends BaseEl {
322
368
  }
323
369
 
324
370
  if (data.args?.markdown?.split('\n').length < 3) {
325
- this.messages[this.messages.length - 1].content = tryParse(data.args.markdown);
371
+ this.messages[this.messages.length - 1].content = tryParse_(data.args.markdown);
326
372
  }
327
373
 
328
374
  console.log(event);
@@ -342,7 +388,7 @@ class Chat extends BaseEl {
342
388
  if (!noAction.includes(data.command)) {
343
389
  this.messages[this.messages.length - 1].content = `<action-component funcName="${data.command}" params="${escapeJsonForHtml(JSON.stringify(data.args))}" result=""></action-component>`;
344
390
  } else {
345
- this.messages[this.messages.length - 1].content = tryParse(this.textParam(data));
391
+ this.messages[this.messages.length - 1].content = tryParse_(this.textParam(data));
346
392
  }
347
393
  }
348
394
  window.initializeCodeCopyButtons();
@@ -356,6 +402,21 @@ class Chat extends BaseEl {
356
402
  data.event = 'result'
357
403
  if (handler) {
358
404
  await handler(data);
405
+ } else {
406
+ try {
407
+ if (data.command == 'execute_command' || data.command == 'run_python') {
408
+ let skipWarning = data.result?.replace(' command result, NOT user reply','');
409
+ // Convert ANSI codes to HTML
410
+ const htmlOutput = ansi_up.ansi_to_html(skipWarning);
411
+
412
+ this.messages.push( {
413
+ role: 'user',
414
+ content: `<pre class="shellout"><code>${htmlOutput}</code></pre>`,
415
+ })
416
+ }
417
+ } catch (e) {
418
+ console.error("Could not parse command result:", e)
419
+ }
359
420
  }
360
421
  for (let msg of this.messages) {
361
422
  msg.spinning = 'no'
@@ -465,7 +465,7 @@ class ChatForm extends BaseEl {
465
465
  if (this.messageEl.value.trim()) {
466
466
  messageContent.push({
467
467
  type: 'text',
468
- text: this.messageEl.value.replaceAll("\n", "\n\n")
468
+ text: "\n" + this.messageEl.value.replaceAll("\n", "\n\n")
469
469
  })
470
470
  }
471
471
 
@@ -6,14 +6,16 @@ export function throttle(func, wait) {
6
6
  const now = Date.now();
7
7
 
8
8
  if (now - lastCall >= wait) {
9
- func(...args);
9
+ const res = func(...args);
10
10
  lastCall = now;
11
+ return res
11
12
  } else {
12
13
  // Optional: ensure the last call still happens
13
14
  clearTimeout(timeout);
14
15
  timeout = setTimeout(() => {
15
- func(...args);
16
+ const res2 = func(...args);
16
17
  lastCall = Date.now();
18
+ return res2
17
19
  }, wait - (now - lastCall));
18
20
  }
19
21
  };
@@ -11,6 +11,9 @@
11
11
 
12
12
  {% block head_styles %}
13
13
  <link rel="stylesheet" href="/chat/static/css/main.css">
14
+ <link rel="preconnect" href="https://fonts.googleapis.com">
15
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
16
+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
14
17
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/atom-one-dark.min.css">
15
18
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
16
19
  {% endblock %}
@@ -18,6 +21,7 @@
18
21
  {% block head_scripts %}
19
22
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
20
23
  <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
24
+ <script src="https://cdn.jsdelivr.net/npm/ansi_up@5.2.1/ansi_up.min.js"></script>
21
25
  <script type="module" src="/chat/static/js/chatmessage.js"></script>
22
26
  <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
23
27
  <!-- <script src="https://cdn.jsdelivr.net/npm/marked-highlight/lib/index.umd.js"></script> -->
@@ -36,7 +40,7 @@
36
40
 
37
41
  {% block head_extra %}{% endblock %}
38
42
  </head>
39
- <body>
43
+ <body{% if embed_mode %} class="embedded"{% endif %}>
40
44
  {% block body_init %}
41
45
  <script>
42
46
  // print a big colorful header annoucing data init section
@@ -72,6 +76,10 @@
72
76
  </div>
73
77
  {% endblock %}
74
78
 
79
+ {% block post_content %}
80
+
81
+ {% endblock %}
82
+
75
83
  </div> <!-- page-container -->
76
84
 
77
85
  <script type="module" src="/chat/static/js/code-copy-button.js"></script>
@@ -133,6 +133,12 @@ async def get_embed_script(token: str):
133
133
  let chatContainer = null;
134
134
  let chatIcon = null;
135
135
  let isLoaded = false;
136
+ let isMobile = false;
137
+
138
+ function detectMobile() {{
139
+ const userAgent = navigator.userAgent || navigator.vendor || window.opera || "";
140
+ return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent.toLowerCase());
141
+ }}
136
142
 
137
143
  function createChatIcon() {{
138
144
  if (chatIcon) return;
@@ -141,13 +147,15 @@ async def get_embed_script(token: str):
141
147
  chatIcon.id = "mindroot-chat-icon-" + config.token;
142
148
  chatIcon.innerHTML = "💬";
143
149
 
150
+ const iconSize = isMobile ? 80 : 60;
151
+ const fontSize = isMobile ? 28 : 24;
144
152
  const iconStyles = {{
145
153
  position: "fixed",
146
- bottom: "20px",
154
+ bottom: isMobile ? "30px" : "20px",
147
155
  right: config.position.includes("left") ? "auto" : "20px",
148
156
  left: config.position.includes("left") ? "20px" : "auto",
149
- width: "60px",
150
- height: "60px",
157
+ width: iconSize + "px",
158
+ height: iconSize + "px",
151
159
  background: "#2196F3",
152
160
  borderRadius: "50%",
153
161
  display: "flex",
@@ -156,7 +164,7 @@ async def get_embed_script(token: str):
156
164
  cursor: "pointer",
157
165
  boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
158
166
  zIndex: "10000",
159
- fontSize: "24px",
167
+ fontSize: fontSize + "px",
160
168
  color: "white",
161
169
  transition: "all 0.3s ease"
162
170
  }};
@@ -172,7 +180,22 @@ async def get_embed_script(token: str):
172
180
  chatContainer = document.createElement("div");
173
181
  chatContainer.id = "mindroot-chat-container-" + config.token;
174
182
 
175
- const containerStyles = {{
183
+ const containerStyles = isMobile ? {{
184
+ position: "fixed",
185
+ top: "0px",
186
+ left: "0",
187
+ right: "0",
188
+ bottom: "0",
189
+ width: "100vw",
190
+ height: "100vh",
191
+ background: "white",
192
+ borderRadius: "0",
193
+ boxShadow: "none",
194
+ zIndex: "10001",
195
+ display: "none",
196
+ flexDirection: "column",
197
+ overflow: "hidden"
198
+ }} : {{
176
199
  position: "fixed",
177
200
  bottom: "90px",
178
201
  right: config.position.includes("left") ? "auto" : "20px",
@@ -198,26 +221,47 @@ async def get_embed_script(token: str):
198
221
 
199
222
  if (isVisible) {{
200
223
  chatContainer.style.display = "none";
224
+ if (isMobile) {{
225
+ document.body.style.removeProperty("overflow");
226
+ }}
201
227
  }} else {{
202
228
  if (!isLoaded) {{
203
229
  // Create iframe and load the secure session
204
230
  const iframe = document.createElement("iframe");
205
- iframe.style.cssText = "width: 100%; height: 100%; border: none; border-radius: 12px;";
231
+ if (isMobile) {{
232
+ iframe.style.cssText = "width: 100%; height: 100%; border: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0;";
233
+ // Add viewport meta tag if not present
234
+ if (!document.querySelector('meta[name="viewport"]')) {{
235
+ const meta = document.createElement('meta');
236
+ meta.name = 'viewport';
237
+ meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';
238
+ document.head.appendChild(meta);
239
+ }}
240
+ }} else {{
241
+ iframe.style.cssText = "width: 100%; height: 100%; border: none; border-radius: 12px;";
242
+ }}
206
243
  iframe.src = config.baseUrl + "/chat/widget/" + config.token + "/session";
244
+ iframe.setAttribute('allow', 'microphone');
207
245
  chatContainer.appendChild(iframe);
208
246
  isLoaded = true;
209
247
  }}
210
248
  chatContainer.style.display = "block";
249
+ if (isMobile) {{
250
+ document.body.style.overflow = "hidden";
251
+ }}
211
252
  }}
212
253
  }}
213
254
 
214
255
  function init() {{
256
+ const boot = () => {{
257
+ isMobile = detectMobile();
258
+ createChatIcon();
259
+ }};
260
+
215
261
  if (document.readyState === "loading") {{
216
- document.addEventListener("DOMContentLoaded", function() {{
217
- createChatIcon();
218
- }});
262
+ document.addEventListener("DOMContentLoaded", boot);
219
263
  }} else {{
220
- createChatIcon();
264
+ boot();
221
265
  }}
222
266
  }}
223
267