pygpt-net 2.6.55__py3-none-any.whl → 2.6.56__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 (371) hide show
  1. pygpt_net/CHANGELOG.txt +6 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +26 -22
  4. pygpt_net/controller/audio/audio.py +0 -0
  5. pygpt_net/controller/calendar/calendar.py +0 -0
  6. pygpt_net/controller/calendar/note.py +0 -0
  7. pygpt_net/controller/chat/chat.py +0 -0
  8. pygpt_net/controller/chat/handler/openai_stream.py +2 -1
  9. pygpt_net/controller/chat/handler/worker.py +0 -0
  10. pygpt_net/controller/chat/remote_tools.py +0 -0
  11. pygpt_net/controller/chat/render.py +0 -0
  12. pygpt_net/controller/chat/text.py +0 -0
  13. pygpt_net/controller/ctx/common.py +0 -0
  14. pygpt_net/controller/debug/debug.py +26 -2
  15. pygpt_net/controller/debug/fixtures.py +1 -1
  16. pygpt_net/controller/dialogs/confirm.py +15 -1
  17. pygpt_net/controller/dialogs/debug.py +2 -0
  18. pygpt_net/controller/lang/mapping.py +0 -0
  19. pygpt_net/controller/launcher/launcher.py +0 -0
  20. pygpt_net/controller/mode/mode.py +0 -0
  21. pygpt_net/controller/presets/presets.py +0 -0
  22. pygpt_net/controller/realtime/realtime.py +0 -0
  23. pygpt_net/controller/theme/theme.py +0 -0
  24. pygpt_net/controller/ui/mode.py +0 -0
  25. pygpt_net/controller/ui/tabs.py +0 -0
  26. pygpt_net/core/agents/agents.py +3 -1
  27. pygpt_net/core/agents/custom.py +150 -0
  28. pygpt_net/core/agents/provider.py +0 -0
  29. pygpt_net/core/builder/__init__.py +12 -0
  30. pygpt_net/core/builder/graph.py +478 -0
  31. pygpt_net/core/calendar/calendar.py +0 -0
  32. pygpt_net/core/ctx/ctx.py +0 -0
  33. pygpt_net/core/ctx/output.py +0 -0
  34. pygpt_net/core/debug/agent.py +0 -0
  35. pygpt_net/core/debug/agent_builder.py +29 -0
  36. pygpt_net/core/debug/console/console.py +0 -0
  37. pygpt_net/core/debug/db.py +0 -0
  38. pygpt_net/core/debug/debug.py +0 -0
  39. pygpt_net/core/debug/events.py +0 -0
  40. pygpt_net/core/debug/indexes.py +0 -0
  41. pygpt_net/core/debug/kernel.py +0 -0
  42. pygpt_net/core/debug/tabs.py +0 -0
  43. pygpt_net/core/filesystem/filesystem.py +0 -0
  44. pygpt_net/core/fixtures/__init__ +0 -0
  45. pygpt_net/core/fixtures/stream/__init__.py +0 -0
  46. pygpt_net/core/fixtures/stream/generator.py +0 -0
  47. pygpt_net/core/models/models.py +0 -0
  48. pygpt_net/core/render/plain/pid.py +0 -0
  49. pygpt_net/core/render/plain/renderer.py +26 -4
  50. pygpt_net/core/render/web/body.py +46 -4
  51. pygpt_net/core/render/web/debug.py +0 -0
  52. pygpt_net/core/render/web/helpers.py +0 -0
  53. pygpt_net/core/render/web/pid.py +0 -0
  54. pygpt_net/core/render/web/renderer.py +15 -20
  55. pygpt_net/core/tabs/tab.py +0 -0
  56. pygpt_net/core/tabs/tabs.py +0 -0
  57. pygpt_net/core/text/utils.py +0 -0
  58. pygpt_net/css.qrc +0 -0
  59. pygpt_net/css_rc.py +0 -0
  60. pygpt_net/data/config/config.json +7 -7
  61. pygpt_net/data/config/models.json +3 -3
  62. pygpt_net/data/css/web-blocks.css +9 -0
  63. pygpt_net/data/css/web-blocks.dark.css +6 -0
  64. pygpt_net/data/css/web-blocks.darkest.css +6 -0
  65. pygpt_net/data/css/web-chatgpt.css +14 -6
  66. pygpt_net/data/css/web-chatgpt.dark.css +6 -0
  67. pygpt_net/data/css/web-chatgpt.darkest.css +6 -0
  68. pygpt_net/data/css/web-chatgpt.light.css +6 -0
  69. pygpt_net/data/css/web-chatgpt_wide.css +14 -6
  70. pygpt_net/data/css/web-chatgpt_wide.dark.css +6 -0
  71. pygpt_net/data/css/web-chatgpt_wide.darkest.css +6 -0
  72. pygpt_net/data/css/web-chatgpt_wide.light.css +6 -0
  73. pygpt_net/data/fixtures/fake_stream.txt +14 -1
  74. pygpt_net/data/icons/case.svg +0 -0
  75. pygpt_net/data/icons/chat1.svg +0 -0
  76. pygpt_net/data/icons/chat2.svg +0 -0
  77. pygpt_net/data/icons/chat3.svg +0 -0
  78. pygpt_net/data/icons/chat4.svg +0 -0
  79. pygpt_net/data/icons/fit.svg +0 -0
  80. pygpt_net/data/icons/note1.svg +0 -0
  81. pygpt_net/data/icons/note2.svg +0 -0
  82. pygpt_net/data/icons/note3.svg +0 -0
  83. pygpt_net/data/icons/stt.svg +0 -0
  84. pygpt_net/data/icons/translate.svg +0 -0
  85. pygpt_net/data/icons/tts.svg +0 -0
  86. pygpt_net/data/icons/url.svg +0 -0
  87. pygpt_net/data/icons/vision.svg +0 -0
  88. pygpt_net/data/icons/web_off.svg +0 -0
  89. pygpt_net/data/icons/web_on.svg +0 -0
  90. pygpt_net/data/js/app/async.js +166 -0
  91. pygpt_net/data/js/app/bridge.js +88 -0
  92. pygpt_net/data/js/app/common.js +212 -0
  93. pygpt_net/data/js/app/config.js +223 -0
  94. pygpt_net/data/js/app/custom.js +961 -0
  95. pygpt_net/data/js/app/data.js +84 -0
  96. pygpt_net/data/js/app/dom.js +322 -0
  97. pygpt_net/data/js/app/events.js +400 -0
  98. pygpt_net/data/js/app/highlight.js +542 -0
  99. pygpt_net/data/js/app/logger.js +305 -0
  100. pygpt_net/data/js/app/markdown.js +1137 -0
  101. pygpt_net/data/js/app/math.js +167 -0
  102. pygpt_net/data/js/app/nodes.js +395 -0
  103. pygpt_net/data/js/app/queue.js +260 -0
  104. pygpt_net/data/js/app/raf.js +250 -0
  105. pygpt_net/data/js/app/runtime.js +582 -0
  106. pygpt_net/data/js/app/scroll.js +433 -0
  107. pygpt_net/data/js/app/stream.js +2708 -0
  108. pygpt_net/data/js/app/template.js +287 -0
  109. pygpt_net/data/js/app/tool.js +87 -0
  110. pygpt_net/data/js/app/ui.js +86 -0
  111. pygpt_net/data/js/app/user.js +380 -0
  112. pygpt_net/data/js/app/utils.js +64 -0
  113. pygpt_net/data/js/app.min.js +880 -0
  114. pygpt_net/data/js/markdown-it/markdown-it-katex.min.js +1 -1
  115. pygpt_net/data/js/markdown-it/markdown-it.min.js +0 -0
  116. pygpt_net/data/locale/locale.de.ini +0 -0
  117. pygpt_net/data/locale/locale.en.ini +7 -0
  118. pygpt_net/data/locale/locale.es.ini +0 -0
  119. pygpt_net/data/locale/locale.fr.ini +0 -0
  120. pygpt_net/data/locale/locale.it.ini +0 -0
  121. pygpt_net/data/locale/locale.pl.ini +0 -0
  122. pygpt_net/data/locale/locale.uk.ini +0 -0
  123. pygpt_net/data/locale/locale.zh.ini +0 -0
  124. pygpt_net/data/locale/plugin.agent.de.ini +0 -0
  125. pygpt_net/data/locale/plugin.agent.en.ini +0 -0
  126. pygpt_net/data/locale/plugin.agent.es.ini +0 -0
  127. pygpt_net/data/locale/plugin.agent.fr.ini +0 -0
  128. pygpt_net/data/locale/plugin.agent.it.ini +0 -0
  129. pygpt_net/data/locale/plugin.agent.pl.ini +0 -0
  130. pygpt_net/data/locale/plugin.agent.uk.ini +0 -0
  131. pygpt_net/data/locale/plugin.agent.zh.ini +0 -0
  132. pygpt_net/data/locale/plugin.audio_input.de.ini +0 -0
  133. pygpt_net/data/locale/plugin.audio_input.en.ini +0 -0
  134. pygpt_net/data/locale/plugin.audio_input.es.ini +0 -0
  135. pygpt_net/data/locale/plugin.audio_input.fr.ini +0 -0
  136. pygpt_net/data/locale/plugin.audio_input.it.ini +0 -0
  137. pygpt_net/data/locale/plugin.audio_input.pl.ini +0 -0
  138. pygpt_net/data/locale/plugin.audio_input.uk.ini +0 -0
  139. pygpt_net/data/locale/plugin.audio_input.zh.ini +0 -0
  140. pygpt_net/data/locale/plugin.audio_output.de.ini +0 -0
  141. pygpt_net/data/locale/plugin.audio_output.en.ini +0 -0
  142. pygpt_net/data/locale/plugin.audio_output.es.ini +0 -0
  143. pygpt_net/data/locale/plugin.audio_output.fr.ini +0 -0
  144. pygpt_net/data/locale/plugin.audio_output.it.ini +0 -0
  145. pygpt_net/data/locale/plugin.audio_output.pl.ini +0 -0
  146. pygpt_net/data/locale/plugin.audio_output.uk.ini +0 -0
  147. pygpt_net/data/locale/plugin.audio_output.zh.ini +0 -0
  148. pygpt_net/data/locale/plugin.cmd_api.de.ini +0 -0
  149. pygpt_net/data/locale/plugin.cmd_api.en.ini +0 -0
  150. pygpt_net/data/locale/plugin.cmd_api.es.ini +0 -0
  151. pygpt_net/data/locale/plugin.cmd_api.fr.ini +0 -0
  152. pygpt_net/data/locale/plugin.cmd_api.it.ini +0 -0
  153. pygpt_net/data/locale/plugin.cmd_api.pl.ini +0 -0
  154. pygpt_net/data/locale/plugin.cmd_api.uk.ini +0 -0
  155. pygpt_net/data/locale/plugin.cmd_api.zh.ini +0 -0
  156. pygpt_net/data/locale/plugin.cmd_code_interpreter.de.ini +0 -0
  157. pygpt_net/data/locale/plugin.cmd_code_interpreter.en.ini +0 -0
  158. pygpt_net/data/locale/plugin.cmd_code_interpreter.es.ini +0 -0
  159. pygpt_net/data/locale/plugin.cmd_code_interpreter.fr.ini +0 -0
  160. pygpt_net/data/locale/plugin.cmd_code_interpreter.it.ini +0 -0
  161. pygpt_net/data/locale/plugin.cmd_code_interpreter.pl.ini +0 -0
  162. pygpt_net/data/locale/plugin.cmd_code_interpreter.uk.ini +0 -0
  163. pygpt_net/data/locale/plugin.cmd_code_interpreter.zh.ini +0 -0
  164. pygpt_net/data/locale/plugin.cmd_custom.de.ini +0 -0
  165. pygpt_net/data/locale/plugin.cmd_custom.en.ini +0 -0
  166. pygpt_net/data/locale/plugin.cmd_custom.es.ini +0 -0
  167. pygpt_net/data/locale/plugin.cmd_custom.fr.ini +0 -0
  168. pygpt_net/data/locale/plugin.cmd_custom.it.ini +0 -0
  169. pygpt_net/data/locale/plugin.cmd_custom.pl.ini +0 -0
  170. pygpt_net/data/locale/plugin.cmd_custom.uk.ini +0 -0
  171. pygpt_net/data/locale/plugin.cmd_custom.zh.ini +0 -0
  172. pygpt_net/data/locale/plugin.cmd_files.de.ini +0 -0
  173. pygpt_net/data/locale/plugin.cmd_files.en.ini +0 -0
  174. pygpt_net/data/locale/plugin.cmd_files.es.ini +0 -0
  175. pygpt_net/data/locale/plugin.cmd_files.fr.ini +0 -0
  176. pygpt_net/data/locale/plugin.cmd_files.it.ini +0 -0
  177. pygpt_net/data/locale/plugin.cmd_files.pl.ini +0 -0
  178. pygpt_net/data/locale/plugin.cmd_files.uk.ini +0 -0
  179. pygpt_net/data/locale/plugin.cmd_files.zh.ini +0 -0
  180. pygpt_net/data/locale/plugin.cmd_history.de.ini +0 -0
  181. pygpt_net/data/locale/plugin.cmd_history.en.ini +0 -0
  182. pygpt_net/data/locale/plugin.cmd_history.es.ini +0 -0
  183. pygpt_net/data/locale/plugin.cmd_history.fr.ini +0 -0
  184. pygpt_net/data/locale/plugin.cmd_history.it.ini +0 -0
  185. pygpt_net/data/locale/plugin.cmd_history.pl.ini +0 -0
  186. pygpt_net/data/locale/plugin.cmd_history.uk.ini +0 -0
  187. pygpt_net/data/locale/plugin.cmd_history.zh.ini +0 -0
  188. pygpt_net/data/locale/plugin.cmd_mouse_control.de.ini +0 -0
  189. pygpt_net/data/locale/plugin.cmd_mouse_control.en.ini +0 -0
  190. pygpt_net/data/locale/plugin.cmd_mouse_control.es.ini +0 -0
  191. pygpt_net/data/locale/plugin.cmd_mouse_control.fr.ini +0 -0
  192. pygpt_net/data/locale/plugin.cmd_mouse_control.it.ini +0 -0
  193. pygpt_net/data/locale/plugin.cmd_mouse_control.pl.ini +0 -0
  194. pygpt_net/data/locale/plugin.cmd_mouse_control.uk.ini +0 -0
  195. pygpt_net/data/locale/plugin.cmd_mouse_control.zh.ini +0 -0
  196. pygpt_net/data/locale/plugin.cmd_serial.de.ini +0 -0
  197. pygpt_net/data/locale/plugin.cmd_serial.en.ini +0 -0
  198. pygpt_net/data/locale/plugin.cmd_serial.es.ini +0 -0
  199. pygpt_net/data/locale/plugin.cmd_serial.fr.ini +0 -0
  200. pygpt_net/data/locale/plugin.cmd_serial.it.ini +0 -0
  201. pygpt_net/data/locale/plugin.cmd_serial.pl.ini +0 -0
  202. pygpt_net/data/locale/plugin.cmd_serial.uk.ini +0 -0
  203. pygpt_net/data/locale/plugin.cmd_serial.zh.ini +0 -0
  204. pygpt_net/data/locale/plugin.cmd_system.de.ini +0 -0
  205. pygpt_net/data/locale/plugin.cmd_system.en.ini +0 -0
  206. pygpt_net/data/locale/plugin.cmd_system.es.ini +0 -0
  207. pygpt_net/data/locale/plugin.cmd_system.fr.ini +0 -0
  208. pygpt_net/data/locale/plugin.cmd_system.it.ini +0 -0
  209. pygpt_net/data/locale/plugin.cmd_system.pl.ini +0 -0
  210. pygpt_net/data/locale/plugin.cmd_system.uk.ini +0 -0
  211. pygpt_net/data/locale/plugin.cmd_system.zh.ini +0 -0
  212. pygpt_net/data/locale/plugin.cmd_web.de.ini +0 -0
  213. pygpt_net/data/locale/plugin.cmd_web.en.ini +0 -0
  214. pygpt_net/data/locale/plugin.cmd_web.es.ini +0 -0
  215. pygpt_net/data/locale/plugin.cmd_web.fr.ini +0 -0
  216. pygpt_net/data/locale/plugin.cmd_web.it.ini +0 -0
  217. pygpt_net/data/locale/plugin.cmd_web.pl.ini +0 -0
  218. pygpt_net/data/locale/plugin.cmd_web.uk.ini +0 -0
  219. pygpt_net/data/locale/plugin.cmd_web.zh.ini +0 -0
  220. pygpt_net/data/locale/plugin.crontab.de.ini +0 -0
  221. pygpt_net/data/locale/plugin.crontab.en.ini +0 -0
  222. pygpt_net/data/locale/plugin.crontab.es.ini +0 -0
  223. pygpt_net/data/locale/plugin.crontab.fr.ini +0 -0
  224. pygpt_net/data/locale/plugin.crontab.it.ini +0 -0
  225. pygpt_net/data/locale/plugin.crontab.pl.ini +0 -0
  226. pygpt_net/data/locale/plugin.crontab.uk.ini +0 -0
  227. pygpt_net/data/locale/plugin.crontab.zh.ini +0 -0
  228. pygpt_net/data/locale/plugin.experts.de.ini +0 -0
  229. pygpt_net/data/locale/plugin.experts.en.ini +0 -0
  230. pygpt_net/data/locale/plugin.experts.es.ini +0 -0
  231. pygpt_net/data/locale/plugin.experts.fr.ini +0 -0
  232. pygpt_net/data/locale/plugin.experts.it.ini +0 -0
  233. pygpt_net/data/locale/plugin.experts.pl.ini +0 -0
  234. pygpt_net/data/locale/plugin.experts.uk.ini +0 -0
  235. pygpt_net/data/locale/plugin.experts.zh.ini +0 -0
  236. pygpt_net/data/locale/plugin.extra_prompt.de.ini +0 -0
  237. pygpt_net/data/locale/plugin.extra_prompt.en.ini +0 -0
  238. pygpt_net/data/locale/plugin.extra_prompt.es.ini +0 -0
  239. pygpt_net/data/locale/plugin.extra_prompt.fr.ini +0 -0
  240. pygpt_net/data/locale/plugin.extra_prompt.it.ini +0 -0
  241. pygpt_net/data/locale/plugin.extra_prompt.pl.ini +0 -0
  242. pygpt_net/data/locale/plugin.extra_prompt.uk.ini +0 -0
  243. pygpt_net/data/locale/plugin.extra_prompt.zh.ini +0 -0
  244. pygpt_net/data/locale/plugin.idx_llama_index.de.ini +0 -0
  245. pygpt_net/data/locale/plugin.idx_llama_index.en.ini +0 -0
  246. pygpt_net/data/locale/plugin.idx_llama_index.es.ini +0 -0
  247. pygpt_net/data/locale/plugin.idx_llama_index.fr.ini +0 -0
  248. pygpt_net/data/locale/plugin.idx_llama_index.it.ini +0 -0
  249. pygpt_net/data/locale/plugin.idx_llama_index.pl.ini +0 -0
  250. pygpt_net/data/locale/plugin.idx_llama_index.uk.ini +0 -0
  251. pygpt_net/data/locale/plugin.idx_llama_index.zh.ini +0 -0
  252. pygpt_net/data/locale/plugin.mailer.en.ini +0 -0
  253. pygpt_net/data/locale/plugin.mcp.en.ini +0 -0
  254. pygpt_net/data/locale/plugin.openai_dalle.de.ini +0 -0
  255. pygpt_net/data/locale/plugin.openai_dalle.en.ini +0 -0
  256. pygpt_net/data/locale/plugin.openai_dalle.es.ini +0 -0
  257. pygpt_net/data/locale/plugin.openai_dalle.fr.ini +0 -0
  258. pygpt_net/data/locale/plugin.openai_dalle.it.ini +0 -0
  259. pygpt_net/data/locale/plugin.openai_dalle.pl.ini +0 -0
  260. pygpt_net/data/locale/plugin.openai_dalle.uk.ini +0 -0
  261. pygpt_net/data/locale/plugin.openai_dalle.zh.ini +0 -0
  262. pygpt_net/data/locale/plugin.openai_vision.de.ini +0 -0
  263. pygpt_net/data/locale/plugin.openai_vision.en.ini +0 -0
  264. pygpt_net/data/locale/plugin.openai_vision.es.ini +0 -0
  265. pygpt_net/data/locale/plugin.openai_vision.fr.ini +0 -0
  266. pygpt_net/data/locale/plugin.openai_vision.it.ini +0 -0
  267. pygpt_net/data/locale/plugin.openai_vision.pl.ini +0 -0
  268. pygpt_net/data/locale/plugin.openai_vision.uk.ini +0 -0
  269. pygpt_net/data/locale/plugin.openai_vision.zh.ini +0 -0
  270. pygpt_net/data/locale/plugin.osm.en.ini +0 -0
  271. pygpt_net/data/locale/plugin.real_time.de.ini +0 -0
  272. pygpt_net/data/locale/plugin.real_time.en.ini +0 -0
  273. pygpt_net/data/locale/plugin.real_time.es.ini +0 -0
  274. pygpt_net/data/locale/plugin.real_time.fr.ini +0 -0
  275. pygpt_net/data/locale/plugin.real_time.it.ini +0 -0
  276. pygpt_net/data/locale/plugin.real_time.pl.ini +0 -0
  277. pygpt_net/data/locale/plugin.real_time.uk.ini +0 -0
  278. pygpt_net/data/locale/plugin.real_time.zh.ini +0 -0
  279. pygpt_net/data/locale/plugin.voice_control.de.ini +0 -0
  280. pygpt_net/data/locale/plugin.voice_control.en.ini +0 -0
  281. pygpt_net/data/locale/plugin.voice_control.es.ini +0 -0
  282. pygpt_net/data/locale/plugin.voice_control.fr.ini +0 -0
  283. pygpt_net/data/locale/plugin.voice_control.it.ini +0 -0
  284. pygpt_net/data/locale/plugin.voice_control.pl.ini +0 -0
  285. pygpt_net/data/locale/plugin.voice_control.uk.ini +0 -0
  286. pygpt_net/data/locale/plugin.voice_control.zh.ini +0 -0
  287. pygpt_net/data/locale/plugin.wolfram.en.ini +0 -0
  288. pygpt_net/fonts.qrc +0 -0
  289. pygpt_net/fonts_rc.py +0 -0
  290. pygpt_net/icons.qrc +0 -0
  291. pygpt_net/icons_rc.py +0 -0
  292. pygpt_net/item/agent.py +62 -0
  293. pygpt_net/item/builder_layout.py +62 -0
  294. pygpt_net/js.qrc +24 -1
  295. pygpt_net/js_rc.py +51394 -33687
  296. pygpt_net/plugin/base/worker.py +0 -0
  297. pygpt_net/plugin/mcp/__init__.py +0 -0
  298. pygpt_net/plugin/mcp/config.py +0 -0
  299. pygpt_net/plugin/mcp/plugin.py +0 -0
  300. pygpt_net/plugin/mcp/worker.py +0 -0
  301. pygpt_net/plugin/osm/__init__.py +0 -0
  302. pygpt_net/plugin/osm/config.py +0 -0
  303. pygpt_net/plugin/osm/plugin.py +0 -0
  304. pygpt_net/plugin/osm/worker.py +0 -0
  305. pygpt_net/plugin/wolfram/__init__.py +0 -0
  306. pygpt_net/plugin/wolfram/config.py +0 -0
  307. pygpt_net/plugin/wolfram/plugin.py +0 -0
  308. pygpt_net/plugin/wolfram/worker.py +0 -0
  309. pygpt_net/provider/api/anthropic/tools.py +0 -0
  310. pygpt_net/provider/api/google/__init__.py +0 -0
  311. pygpt_net/provider/api/google/video.py +0 -0
  312. pygpt_net/provider/api/openai/agents/experts.py +0 -0
  313. pygpt_net/provider/api/openai/agents/remote_tools.py +0 -0
  314. pygpt_net/provider/api/openai/remote_tools.py +0 -0
  315. pygpt_net/provider/api/openai/responses.py +0 -0
  316. pygpt_net/provider/api/x_ai/__init__.py +0 -0
  317. pygpt_net/provider/api/x_ai/remote.py +0 -0
  318. pygpt_net/provider/core/agent/__init__.py +10 -0
  319. pygpt_net/provider/core/agent/base.py +51 -0
  320. pygpt_net/provider/core/agent/json_file.py +200 -0
  321. pygpt_net/provider/core/config/patch.py +18 -0
  322. pygpt_net/provider/core/config/patches/__init__.py +0 -0
  323. pygpt_net/provider/core/config/patches/patch_before_2_6_42.py +0 -0
  324. pygpt_net/provider/core/ctx/db_sqlite/storage.py +0 -0
  325. pygpt_net/provider/core/model/patches/__init__.py +0 -0
  326. pygpt_net/provider/core/model/patches/patch_before_2_6_42.py +0 -0
  327. pygpt_net/provider/core/preset/patch.py +0 -0
  328. pygpt_net/provider/core/preset/patches/__init__.py +0 -0
  329. pygpt_net/provider/core/preset/patches/patch_before_2_6_42.py +0 -0
  330. pygpt_net/provider/llms/base.py +0 -0
  331. pygpt_net/provider/llms/deepseek_api.py +0 -0
  332. pygpt_net/provider/llms/google.py +0 -0
  333. pygpt_net/provider/llms/hugging_face_api.py +0 -0
  334. pygpt_net/provider/llms/hugging_face_embedding.py +0 -0
  335. pygpt_net/provider/llms/hugging_face_router.py +0 -0
  336. pygpt_net/provider/llms/local.py +0 -0
  337. pygpt_net/provider/llms/mistral.py +0 -0
  338. pygpt_net/provider/llms/open_router.py +0 -0
  339. pygpt_net/provider/llms/perplexity.py +0 -0
  340. pygpt_net/provider/llms/utils.py +0 -0
  341. pygpt_net/provider/llms/voyage.py +0 -0
  342. pygpt_net/provider/llms/x_ai.py +0 -0
  343. pygpt_net/tools/agent_builder/__init__.py +12 -0
  344. pygpt_net/tools/agent_builder/tool.py +292 -0
  345. pygpt_net/tools/agent_builder/ui/__init__.py +0 -0
  346. pygpt_net/tools/agent_builder/ui/dialogs.py +152 -0
  347. pygpt_net/tools/agent_builder/ui/list.py +228 -0
  348. pygpt_net/tools/code_interpreter/ui/html.py +0 -0
  349. pygpt_net/tools/code_interpreter/ui/widgets.py +0 -0
  350. pygpt_net/tools/html_canvas/tool.py +23 -6
  351. pygpt_net/tools/html_canvas/ui/widgets.py +224 -2
  352. pygpt_net/ui/layout/chat/chat.py +0 -0
  353. pygpt_net/ui/main.py +10 -9
  354. pygpt_net/ui/menu/debug.py +39 -1
  355. pygpt_net/ui/widget/builder/__init__.py +12 -0
  356. pygpt_net/ui/widget/builder/editor.py +2001 -0
  357. pygpt_net/ui/widget/draw/painter.py +0 -0
  358. pygpt_net/ui/widget/element/labels.py +9 -4
  359. pygpt_net/ui/widget/lists/db.py +0 -0
  360. pygpt_net/ui/widget/lists/debug.py +0 -0
  361. pygpt_net/ui/widget/tabs/body.py +0 -0
  362. pygpt_net/ui/widget/textarea/input.py +9 -7
  363. pygpt_net/ui/widget/textarea/output.py +21 -1
  364. pygpt_net/ui/widget/textarea/web.py +29 -2
  365. pygpt_net/utils.py +40 -0
  366. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.56.dist-info}/METADATA +8 -2
  367. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.56.dist-info}/RECORD +85 -46
  368. pygpt_net/data/js/app.js +0 -5869
  369. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.56.dist-info}/LICENSE +0 -0
  370. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.56.dist-info}/WHEEL +0 -0
  371. {pygpt_net-2.6.55.dist-info → pygpt_net-2.6.56.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,380 @@
1
+ // ==========================================================================
2
+ // User collapse manager
3
+ // ==========================================================================
4
+
5
+ class UserCollapseManager {
6
+
7
+ // collapsible user messages (msg-box.msg-user)
8
+ constructor(cfg) {
9
+ this.cfg = cfg || {};
10
+ // Collapse threshold in pixels (can be overridden via window.USER_MSG_COLLAPSE_HEIGHT_PX).
11
+ this.threshold = Utils.g('USER_MSG_COLLAPSE_HEIGHT_PX', 1000);
12
+ // Track processed .msg elements to allow cheap remeasure on resize if needed.
13
+ this._processed = new Set();
14
+
15
+ // Visual indicator attached while collapsed (does not modify original text).
16
+ this.ellipsisText = ' [...]';
17
+ }
18
+
19
+ // Icon paths for the collapse/expand buttons.
20
+ _icons() {
21
+ const I = (this.cfg && this.cfg.ICONS) || {};
22
+ return {
23
+ expand: I.EXPAND || '',
24
+ collapse: I.COLLAPSE || ''
25
+ };
26
+ }
27
+
28
+ // Label texts for the collapse/expand buttons.
29
+ _labels() {
30
+ const L = (this.cfg && this.cfg.LOCALE) || {};
31
+ return {
32
+ expand: L.EXPAND || 'Expand',
33
+ collapse: L.COLLAPSE || 'Collapse'
34
+ };
35
+ }
36
+
37
+ // Schedule a function for next frame (ensures layout is up-to-date before scrolling).
38
+ _afterLayout(fn) {
39
+ try {
40
+ if (typeof runtime !== 'undefined' && runtime.raf && typeof runtime.raf.schedule === 'function') {
41
+ const key = {
42
+ t: 'UC:afterLayout',
43
+ i: Math.random()
44
+ };
45
+ runtime.raf.schedule(key, () => {
46
+ try {
47
+ fn && fn();
48
+ } catch (_) {}
49
+ }, 'UserCollapse', 0);
50
+ return;
51
+ }
52
+ } catch (_) {}
53
+ try {
54
+ requestAnimationFrame(() => {
55
+ try {
56
+ fn && fn();
57
+ } catch (_) {}
58
+ });
59
+ } catch (_) {
60
+ setTimeout(() => {
61
+ try {
62
+ fn && fn();
63
+ } catch (__) {}
64
+ }, 0);
65
+ }
66
+ }
67
+
68
+ // Bring toggle into view with minimal scroll (upwards if it moved above after collapse).
69
+ _scrollToggleIntoView(toggleEl) {
70
+ if (!toggleEl || !toggleEl.isConnected) return;
71
+ try {
72
+ if (runtime && runtime.scrollMgr) {
73
+ runtime.scrollMgr.userInteracted = true;
74
+ runtime.scrollMgr.autoFollow = false;
75
+ }
76
+ } catch (_) {}
77
+ this._afterLayout(() => {
78
+ try {
79
+ if (toggleEl.scrollIntoView) {
80
+ // Prefer minimal movement; keep behavior non-animated and predictable.
81
+ try {
82
+ toggleEl.scrollIntoView({
83
+ block: 'nearest',
84
+ inline: 'nearest',
85
+ behavior: 'instant'
86
+ });
87
+ } catch (_) {
88
+ toggleEl.scrollIntoView(false);
89
+ }
90
+ }
91
+ } catch (_) {}
92
+ });
93
+ }
94
+
95
+ // Ensure wrapper and toggle exist for a given .msg element.
96
+ _ensureStructure(msg) {
97
+ if (!msg || !msg.isConnected) return null;
98
+
99
+ // Wrap all direct children into a dedicated content container to measure height accurately.
100
+ let content = msg.querySelector('.uc-content');
101
+ if (!content) {
102
+ content = document.createElement('div');
103
+ content.className = 'uc-content';
104
+ const frag = document.createDocumentFragment();
105
+ while (msg.firstChild) frag.appendChild(msg.firstChild);
106
+ content.appendChild(frag);
107
+ msg.appendChild(content);
108
+ }
109
+
110
+ // Ensure a single toggle exists (click and keyboard accessible).
111
+ let toggle = msg.querySelector('.uc-toggle');
112
+ if (!toggle) {
113
+ const icons = this._icons();
114
+ const labels = this._labels();
115
+
116
+ toggle = document.createElement('div');
117
+ toggle.className = 'uc-toggle';
118
+ toggle.tabIndex = 0;
119
+ toggle.setAttribute('role', 'button');
120
+ toggle.setAttribute('aria-expanded', 'false');
121
+ toggle.title = labels.expand;
122
+
123
+ const img = document.createElement('img');
124
+ img.className = 'uc-toggle-icon';
125
+ img.alt = labels.expand;
126
+ img.src = icons.expand;
127
+
128
+ // Provide a sane default size even if CSS did not load yet (CSS will override when present).
129
+ img.width = 26; // keep in sync with CSS fallback var(--uc-toggle-icon-size, 26px)
130
+ img.height = 26; // ensures a consistent, non-tiny control from the first paint
131
+
132
+ toggle.appendChild(img);
133
+
134
+ // Attach local listeners (no global handler change; production-safe).
135
+ toggle.addEventListener('click', (ev) => {
136
+ ev.preventDefault();
137
+ ev.stopPropagation();
138
+ this.toggleFromToggle(toggle);
139
+ });
140
+ toggle.addEventListener('keydown', (ev) => {
141
+ if (ev.key === 'Enter' || ev.key === ' ') {
142
+ ev.preventDefault();
143
+ ev.stopPropagation();
144
+ this.toggleFromToggle(toggle);
145
+ }
146
+ }, {
147
+ passive: false
148
+ });
149
+
150
+ msg.appendChild(toggle);
151
+ }
152
+
153
+ this._processed.add(msg);
154
+ msg.dataset.ucInit = '1';
155
+ return {
156
+ content,
157
+ toggle
158
+ };
159
+ }
160
+
161
+ // Create or update the ellipsis indicator inside content (absolute in the bottom-right corner).
162
+ _ensureEllipsisEl(msg, contentEl) {
163
+ const content = contentEl || (msg && msg.querySelector('.uc-content'));
164
+ if (!content) return null;
165
+
166
+ // Ensure the content becomes a positioning context only when needed.
167
+ if (getComputedStyle(content).position === 'static') {
168
+ content.style.position = 'relative';
169
+ }
170
+
171
+ let dot = content.querySelector('.uc-ellipsis');
172
+ if (!dot) {
173
+ dot = document.createElement('span');
174
+ dot.className = 'uc-ellipsis';
175
+ dot.textContent = this.ellipsisText;
176
+ // Inline, theme-agnostic styles; kept minimal and non-interactive.
177
+ dot.style.position = 'absolute';
178
+ dot.style.right = '0';
179
+ dot.style.bottom = '0';
180
+ dot.style.paddingLeft = '6px';
181
+ dot.style.pointerEvents = 'none';
182
+ dot.style.zIndex = '1';
183
+ dot.style.fontWeight = '500';
184
+ dot.style.opacity = '0.75';
185
+ // Do not include in copy-to-clipboard.
186
+ dot.setAttribute('aria-hidden', 'true');
187
+ dot.setAttribute('data-copy-ignore', '1');
188
+
189
+ content.appendChild(dot);
190
+ }
191
+ return dot;
192
+ }
193
+
194
+ // Show ellipsis only when there is hidden overflow (collapsed).
195
+ _showEllipsis(msg, contentEl) {
196
+ const dot = this._ensureEllipsisEl(msg, contentEl);
197
+ if (dot) dot.style.display = 'inline';
198
+ }
199
+
200
+ // Hide and clean ellipsis when not needed (expanded or short content).
201
+ _hideEllipsis(msg) {
202
+ const content = msg && msg.querySelector('.uc-content');
203
+ if (!content) return;
204
+ const dot = content.querySelector('.uc-ellipsis');
205
+ if (dot && dot.parentNode) {
206
+ // Remove the indicator to avoid accidental copy/select and keep DOM lean.
207
+ dot.parentNode.removeChild(dot);
208
+ }
209
+ // Drop positioning context when no indicator is present (keep styles minimal).
210
+ try {
211
+ if (content && content.style && content.querySelector('.uc-ellipsis') == null) {
212
+ content.style.position = '';
213
+ }
214
+ } catch (_) {}
215
+ }
216
+
217
+ // Apply collapse to all user messages under root.
218
+ apply(root) {
219
+ const scope = root || document;
220
+ let list;
221
+ if (scope.nodeType === 1) list = scope.querySelectorAll('.msg-box.msg-user .msg');
222
+ else list = document.querySelectorAll('.msg-box.msg-user .msg');
223
+ if (!list || !list.length) return;
224
+
225
+ for (let i = 0; i < list.length; i++) {
226
+ const msg = list[i];
227
+ const st = this._ensureStructure(msg);
228
+ if (!st) continue;
229
+ this._update(msg, st.content, st.toggle);
230
+ }
231
+ }
232
+
233
+ // Update collapsed/expanded state depending on content height.
234
+ _update(msg, contentEl, toggleEl) {
235
+ const c = contentEl || (msg && msg.querySelector('.uc-content'));
236
+ if (!msg || !c) return;
237
+
238
+ // Special-case: when threshold = 0 (or '0'), auto-collapse is globally disabled.
239
+ // We avoid any measurement, force the content to be fully expanded, and ensure the toggle is hidden.
240
+ // This preserves public API while providing an explicit opt-out, without impacting existing behavior.
241
+ if (this.threshold === 0 || this.threshold === '0') {
242
+ const t = toggleEl || msg.querySelector('.uc-toggle');
243
+ const labels = this._labels();
244
+
245
+ // Ensure expanded state and remove any limiting classes.
246
+ c.classList.remove('uc-collapsed');
247
+ c.classList.remove('uc-expanded'); // No class => fully expanded by default CSS.
248
+ msg.dataset.ucState = 'expanded';
249
+
250
+ // Hide ellipsis in disabled mode.
251
+ this._hideEllipsis(msg);
252
+
253
+ // Hide toggle in disabled mode to avoid user interaction.
254
+ if (t) {
255
+ t.classList.remove('visible');
256
+ t.setAttribute('aria-expanded', 'false');
257
+ t.title = labels.expand;
258
+ const img = t.querySelector('img');
259
+ if (img) {
260
+ img.alt = labels.expand;
261
+ }
262
+ }
263
+ return; // Do not proceed with measuring or collapsing.
264
+ }
265
+
266
+ // Temporarily remove limiting classes for precise measurement.
267
+ c.classList.remove('uc-collapsed');
268
+ c.classList.remove('uc-expanded');
269
+
270
+ const fullHeight = Math.ceil(c.scrollHeight);
271
+ const labels = this._labels();
272
+ const icons = this._icons();
273
+ const t = toggleEl || msg.querySelector('.uc-toggle');
274
+
275
+ if (fullHeight > this.threshold) {
276
+ if (t) t.classList.add('visible');
277
+ const desired = msg.dataset.ucState || 'collapsed';
278
+ const expand = (desired === 'expanded');
279
+
280
+ if (expand) {
281
+ c.classList.add('uc-expanded');
282
+ this._hideEllipsis(msg); // Expanded => no ellipsis
283
+ } else {
284
+ c.classList.add('uc-collapsed');
285
+ this._showEllipsis(msg, c); // Collapsed => show ellipsis overlay
286
+ }
287
+
288
+ if (t) {
289
+ const img = t.querySelector('img');
290
+ if (img) {
291
+ if (expand) {
292
+ img.src = icons.collapse;
293
+ img.alt = labels.collapse;
294
+ } else {
295
+ img.src = icons.expand;
296
+ img.alt = labels.expand;
297
+ }
298
+ }
299
+ t.setAttribute('aria-expanded', expand ? 'true' : 'false');
300
+ t.title = expand ? labels.collapse : labels.expand;
301
+ }
302
+ } else {
303
+ // Short content – ensure fully expanded and hide toggle + ellipsis.
304
+ c.classList.remove('uc-collapsed');
305
+ c.classList.remove('uc-expanded');
306
+ msg.dataset.ucState = 'expanded';
307
+ this._hideEllipsis(msg);
308
+ if (t) {
309
+ t.classList.remove('visible');
310
+ t.setAttribute('aria-expanded', 'false');
311
+ t.title = labels.expand;
312
+ }
313
+ }
314
+ }
315
+
316
+ // Toggle handler via the toggle element (div.uc-toggle).
317
+ toggleFromToggle(toggleEl) {
318
+ const msg = toggleEl && toggleEl.closest ? toggleEl.closest('.msg-box.msg-user .msg') : null;
319
+ if (!msg) return;
320
+ this.toggle(msg);
321
+ }
322
+
323
+ // Core toggle logic.
324
+ toggle(msg) {
325
+ if (!msg || !msg.isConnected) return;
326
+ const c = msg.querySelector('.uc-content');
327
+ if (!c) return;
328
+ const t = msg.querySelector('.uc-toggle');
329
+ const labels = this._labels();
330
+ const icons = this._icons();
331
+
332
+ const isCollapsed = c.classList.contains('uc-collapsed');
333
+ if (isCollapsed) {
334
+ // Expand – leave scroll as-is; remove ellipsis.
335
+ c.classList.remove('uc-collapsed');
336
+ c.classList.add('uc-expanded');
337
+ msg.dataset.ucState = 'expanded';
338
+ this._hideEllipsis(msg);
339
+ if (t) {
340
+ t.setAttribute('aria-expanded', 'true');
341
+ t.title = labels.collapse;
342
+ const img = t.querySelector('img');
343
+ if (img) {
344
+ img.src = icons.collapse;
345
+ img.alt = labels.collapse;
346
+ }
347
+ }
348
+ } else {
349
+ // Collapse – apply classes, show ellipsis, then bring toggle into view (scroll up if needed).
350
+ c.classList.remove('uc-expanded');
351
+ c.classList.add('uc-collapsed');
352
+ msg.dataset.ucState = 'collapsed';
353
+ this._showEllipsis(msg, c);
354
+ if (t) {
355
+ t.setAttribute('aria-expanded', 'false');
356
+ t.title = labels.expand;
357
+ const img = t.querySelector('img');
358
+ if (img) {
359
+ img.src = icons.expand;
360
+ img.alt = labels.expand;
361
+ }
362
+ // Follow the collapsing content upward – keep the toggle visible.
363
+ this._scrollToggleIntoView(t);
364
+ }
365
+ }
366
+ }
367
+
368
+ // Optional public method to re-evaluate height after layout/resize.
369
+ remeasureAll() {
370
+ const arr = Array.from(this._processed || []);
371
+ for (let i = 0; i < arr.length; i++) {
372
+ const msg = arr[i];
373
+ if (!msg || !msg.isConnected) {
374
+ this._processed.delete(msg);
375
+ continue;
376
+ }
377
+ this._update(msg);
378
+ }
379
+ }
380
+ }
@@ -0,0 +1,64 @@
1
+ // ==========================================================================
2
+ // Utils
3
+ // ==========================================================================
4
+
5
+ class Utils {
6
+
7
+ // Gets a global variable or returns a default value.
8
+ static g(name, dflt) {
9
+ return (typeof window[name] !== 'undefined') ? window[name] : dflt;
10
+ }
11
+
12
+ // Gets the current timestamp.
13
+ static now() {
14
+ return (typeof performance !== 'undefined' && performance.now) ? performance.now() : Date.now();
15
+ }
16
+
17
+ // reuse a single detached element to reduce allocations on hot path.
18
+ static escapeHtml(s) {
19
+ const d = Utils._escDiv || (Utils._escDiv = document.createElement('div'));
20
+ d.textContent = String(s ?? '');
21
+ return d.innerHTML;
22
+ }
23
+
24
+ // Counts the number of newline characters in a string.
25
+ static countNewlines(s) {
26
+ if (!s) return 0;
27
+ let c = 0,
28
+ i = -1;
29
+ while ((i = s.indexOf('\n', i + 1)) !== -1) c++;
30
+ return c;
31
+ }
32
+
33
+ // Re-escapes a string for safe HTML rendering.
34
+ static reEscape(s) {
35
+ return String(s).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
36
+ }
37
+
38
+ // Schedule a function in idle time (falls back to setTimeout).
39
+ static idle(fn, timeout) {
40
+ if ('requestIdleCallback' in window) return requestIdleCallback(fn, {
41
+ timeout: timeout || 800
42
+ });
43
+ return setTimeout(fn, 50);
44
+ }
45
+
46
+ // Cancel idle callback if possible (safe for fallback).
47
+ static cancelIdle(id) {
48
+ try {
49
+ if ('cancelIdleCallback' in window) cancelIdleCallback(id);
50
+ else clearTimeout(id);
51
+ } catch (_) {}
52
+ }
53
+
54
+ // Gets the scrolling element for the document.
55
+ static get SE() {
56
+ return document.scrollingElement || document.documentElement;
57
+ }
58
+
59
+ // shared UTF-8 decoder to avoid per-call allocations.
60
+ static utf8Decode(bytes) {
61
+ if (!Utils._td) Utils._td = new TextDecoder('utf-8');
62
+ return Utils._td.decode(bytes);
63
+ }
64
+ }