odant-work 1.0.91 → 1.0.92

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 (427) hide show
  1. package/#system/certs/russian_trusted_root_ca.pem +32 -32
  2. package/#system/mail.json.example +9 -9
  3. package/#system/package-manifest.json +332 -373
  4. package/#system/settings.json.example +3 -3
  5. package/$server/$folder/$class/$data/handlers/pages/form/objects/$handler/class.js +2158 -0
  6. package/$server/$folder/$class/$data/handlers/pages/form/objects/object/$handler/class.js +1377 -0
  7. package/$server/$folder/$class/$domain/class.js +4 -4
  8. package/$server/$folder/$class/$handler/$trigger/class.js +3 -3
  9. package/$server/$folder/$class/$handler/class.js +9 -9
  10. package/$server/$folder/$class/$handler/handlers/pages/editor/$handler/class.js +5 -5
  11. package/$server/$folder/$class/$handler/readme.md +23 -23
  12. package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/mcp/$handler/mcp.js → mcp/$handler/class.js} +251 -210
  13. package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/modules → modules}/$handler/class.js +1 -0
  14. package/$server/$folder/$class/$structure/$organization/handlers/pages/site/$handler/{site.js → class.js} +351 -364
  15. package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/license/$handler/license.js → license/$handler/class.js} +104 -103
  16. package/$server/$folder/$class/$structure/$server/handlers/pages/site/$handler/{site.js → class.js} +45 -30
  17. package/$server/$folder/$class/$structure/$user/class.js +2 -2
  18. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +3 -0
  19. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +3 -0
  20. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/modules/$handler/class.js +3 -0
  21. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/{$handler/tabs/profile/$handler/profile.js → profile/$handler/class.js} +6 -2
  22. package/$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js +308 -5
  23. package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js +14 -3
  24. package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js +1281 -7
  25. package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/readme.md +40 -40
  26. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +2216 -6
  27. package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/class.js +1304 -6
  28. package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/class.js +305 -5
  29. package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/agent/$handler/agent.js → agent/$handler/class.js} +329 -320
  30. package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/database/$handler/database.js → database/$handler/class.js} +510 -577
  31. package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/messengers/$handler/messengers.js → messengers/$handler/class.js} +142 -143
  32. package/$server/$folder/$class/$structure/handlers/pages/form/system/modules/$handler/class.js +270 -0
  33. package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +2114 -0
  34. package/$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js +229 -4
  35. package/$server/$folder/$class/ai/config.js +19 -19
  36. package/$server/$folder/$class/ai/prompt/$method/class.js +41 -41
  37. package/$server/$folder/$class/ai/skills/approval-flow.md +14 -14
  38. package/$server/$folder/$class/ai/skills/backup-check.md +13 -13
  39. package/$server/$folder/$class/ai/skills/computer.md +27 -27
  40. package/$server/$folder/$class/ai/skills/delegate-task.md +15 -15
  41. package/$server/$folder/$class/ai/skills/external-signup.md +14 -14
  42. package/$server/$folder/$class/ai/skills/onboarding.md +15 -15
  43. package/$server/$folder/$class/ai/skills/orchestration.md +41 -41
  44. package/$server/$folder/$class/ai/system.md +1 -1
  45. package/$server/$folder/$class/class.js +0 -3
  46. package/$server/$folder/$class/handlers/pages/form/folder/$handler/class.js +3 -0
  47. package/$server/$folder/$class/handlers/pages/form/system/$handler/class.js +2 -4
  48. package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/files → files}/$handler/class.js +2 -0
  49. package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/requisites/$handler/requisites.js → requisites/$handler/class.js} +43 -36
  50. package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +25 -6
  51. package/$server/$folder/$file/$audio/handlers/preview/$handler/class.js +3 -3
  52. package/$server/$folder/$file/$audio/handlers/preview/$handler/preview.js +88 -88
  53. package/$server/$folder/$file/$call/class.js +10 -10
  54. package/$server/$folder/$file/$call/handlers/preview/$handler/class.js +4 -4
  55. package/$server/$folder/$file/$call/triggers/on_save/$trigger/class.js +48 -48
  56. package/$server/$folder/$file/$data/class.js +16 -16
  57. package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/class.js +31 -4
  58. package/$server/$folder/$file/$devs/$js/class.js +2 -2
  59. package/$server/$folder/$file/$devs/$json/class.js +2 -2
  60. package/$server/$folder/$file/$devs/$ts/class.js +2 -2
  61. package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/class.js +30 -2
  62. package/$server/$folder/$file/$eml/class.js +17 -17
  63. package/$server/$folder/$file/$ics/class.js +44 -44
  64. package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/class.js +10 -2
  65. package/$server/$folder/$file/$ics/handlers/preview/$handler/class.js +3 -3
  66. package/$server/$folder/$file/$ics/handlers/preview/$handler/preview.js +67 -67
  67. package/$server/$folder/$file/$ics/readme.md +21 -21
  68. package/$server/$folder/$file/$image/$svg/class.js +11 -11
  69. package/$server/$folder/$file/$image/handlers/preview/$handler/class.js +3 -3
  70. package/$server/$folder/$file/$image/handlers/preview/$handler/preview.js +33 -33
  71. package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/class.js +82 -2
  72. package/$server/$folder/$file/$logs/class.js +39 -39
  73. package/$server/$folder/$file/$logs/handlers/methods/txt-test/$handler/class.js +4 -4
  74. package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/class.js +60 -2
  75. package/$server/$folder/$file/$office/$outlook/$ics/class.js +227 -227
  76. package/$server/$folder/$file/$office/$word/$rtf/template.rtf +159 -159
  77. package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/class.js +1699 -2
  78. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +827 -2
  79. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/readme.md +1 -1
  80. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/feed.js +17 -0
  81. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/panel.js +7 -1
  82. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/util.js +1 -0
  83. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/voice-policy.js +6 -2
  84. package/$server/$folder/$file/$task/handlers/preview/$handler/class.js +3 -3
  85. package/$server/$folder/$file/$task/readme.md +32 -32
  86. package/$server/$folder/$file/$txt/handlers/preview/$handler/class.js +3 -3
  87. package/$server/$folder/$file/$txt/handlers/preview/$handler/preview.js +41 -41
  88. package/$server/$folder/$file/$video/handlers/preview/$handler/class.js +4 -4
  89. package/$server/$folder/$file/$video/handlers/preview/$handler/preview.js +13 -13
  90. package/$server/$folder/$file/class.js +2 -2
  91. package/$server/$folder/$file/handlers/methods/download/$handler/class.js +2 -2
  92. package/$server/$folder/$file/handlers/methods/download/$handler/download.js +4 -4
  93. package/$server/$folder/$file/handlers/pages/form/$handler/class.js +2 -2
  94. package/$server/$folder/$file/handlers/pages/form/file/$handler/class.js +32 -2
  95. package/$server/$folder/$file/handlers/pages/form/folder/$handler/class.js +3 -0
  96. package/$server/$folder/$file/readme.md +31 -31
  97. package/$server/$folder/class.js +11 -11
  98. package/$server/$folder/handlers/pages/form/$handler/class.js +2469 -5
  99. package/$server/$folder/handlers/pages/form/folder/$handler/class.js +22 -0
  100. package/$server/$folder/lib/chat-item/chat-item.js +2 -2
  101. package/$server/$folder/lib/email/settings.js +82 -82
  102. package/$server/$folder/lib/file-viewer/file-viewer.js +8 -8
  103. package/$server/$folder/lib/icon/user/user.js +6 -6
  104. package/$server/$folder/lib/item-data-grid/item-data-grid.js +48 -48
  105. package/$server/$folder/lib/item-form/item-form.js +84 -84
  106. package/$server/$folder/lib/menu/menu.js +3 -2
  107. package/$server/$folder/lib/menu/readme.md +29 -29
  108. package/$server/$folder/lib/node/readme.md +29 -29
  109. package/$server/$folder/lib/pack/pack.js +4 -4
  110. package/$server/$folder/lib/site-loc/readme.md +16 -16
  111. package/.github/workflows/ci.yml +39 -39
  112. package/AGENTS.md +1 -1
  113. package/{models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js} +383 -430
  114. package/{models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$provider/handlers/pages/form/system/ai/$handler/class.js} +155 -166
  115. package/{models → MODELS}/$ai/$folder/$class/$provider/readme.md +16 -16
  116. package/{models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/handlers/pages/form/system/ai/$handler/class.js} +34 -33
  117. package/{models → MODELS}/GigaChat/$provider/readme.md +24 -24
  118. package/{models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/Local/$provider/handlers/pages/form/system/ai/$handler/class.js} +569 -626
  119. package/MODULES/$domain/handlers/pages/form/system/{$handler/tabs/mcp → mcp}/$handler/class.js +1 -0
  120. package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +648 -20
  121. package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +140 -6
  122. package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" +305 -5
  123. package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" +241 -5
  124. package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" +515 -15
  125. package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/objects/$handler/class.js +3 -0
  126. package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js +422 -5
  127. package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +40 -40
  128. package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +56 -56
  129. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/class.js +13 -7
  130. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/class.js +1791 -7
  131. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/class.js +13 -7
  132. package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/class.js +776 -5
  133. package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js +807 -5
  134. package/MODULES/Register/REGISTER/68/01/$account/class.js +1 -1
  135. package/MODULES/Register/REGISTER/68/02/$account/class.js +1 -1
  136. package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/320/265/321/200/320/262/$account/class.js" +1 -1
  137. package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$account/class.js" +1 -1
  138. package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/240/320/260/320/261/320/276/321/202/320/260/321/216/321/202/$account/class.js +1 -1
  139. package/MODULES/Register/REGISTER//320/242/320/265/321/205/320/275/320/270/321/207/320/265/321/201/320/272/320/270/320/271/$account/class.js +1 -1
  140. package/MODULES/Register/STRUCTS/$struct/class.js +4 -4
  141. package/NODES/$node/$folder/$class/$node/class.js +35 -35
  142. package/NODES/$node/class.js +5 -5
  143. package/NODES/$node/handlers/pages/form/network/$handler/class.js +121 -4
  144. package/oda/benchmarks/dbmon/lib/ENV.js +213 -213
  145. package/oda/benchmarks/dbmon/lib/ga.js +11 -11
  146. package/oda/benchmarks/dbmon/lib/memory-stats.js +105 -105
  147. package/oda/benchmarks/dbmon/lib/monitor.js +69 -69
  148. package/oda/benchmarks/sierpinski/sierpinski.js +149 -149
  149. package/oda/components/editors/code-editor/code-editor.js +387 -387
  150. package/oda/components/editors/code-editor/src/ace.js +16 -16
  151. package/oda/components/editors/code-editor/src/beautify-css.js +1625 -1625
  152. package/oda/components/editors/code-editor/src/beautify-html.js +3122 -3122
  153. package/oda/components/editors/code-editor/src/beautify.js +4005 -4005
  154. package/oda/components/editors/code-editor/src/ext-beautify.js +7 -7
  155. package/oda/components/editors/code-editor/src/ext-code_lens.js +7 -7
  156. package/oda/components/editors/code-editor/src/ext-elastic_tabstops_lite.js +7 -7
  157. package/oda/components/editors/code-editor/src/ext-emmet.js +7 -7
  158. package/oda/components/editors/code-editor/src/ext-error_marker.js +7 -7
  159. package/oda/components/editors/code-editor/src/ext-hardwrap.js +7 -7
  160. package/oda/components/editors/code-editor/src/ext-keybinding_menu.js +7 -7
  161. package/oda/components/editors/code-editor/src/ext-language_tools.js +7 -7
  162. package/oda/components/editors/code-editor/src/ext-linking.js +7 -7
  163. package/oda/components/editors/code-editor/src/ext-modelist.js +7 -7
  164. package/oda/components/editors/code-editor/src/ext-options.js +7 -7
  165. package/oda/components/editors/code-editor/src/ext-prompt.js +7 -7
  166. package/oda/components/editors/code-editor/src/ext-rtl.js +7 -7
  167. package/oda/components/editors/code-editor/src/ext-searchbox.js +7 -7
  168. package/oda/components/editors/code-editor/src/ext-settings_menu.js +7 -7
  169. package/oda/components/editors/code-editor/src/ext-spellcheck.js +7 -7
  170. package/oda/components/editors/code-editor/src/ext-split.js +7 -7
  171. package/oda/components/editors/code-editor/src/ext-static_highlight.js +7 -7
  172. package/oda/components/editors/code-editor/src/ext-statusbar.js +7 -7
  173. package/oda/components/editors/code-editor/src/ext-textarea.js +7 -7
  174. package/oda/components/editors/code-editor/src/ext-themelist.js +7 -7
  175. package/oda/components/editors/code-editor/src/ext-whitespace.js +7 -7
  176. package/oda/components/editors/code-editor/src/keybinding-emacs.js +7 -7
  177. package/oda/components/editors/code-editor/src/keybinding-sublime.js +7 -7
  178. package/oda/components/editors/code-editor/src/keybinding-vim.js +7 -7
  179. package/oda/components/editors/code-editor/src/keybinding-vscode.js +7 -7
  180. package/oda/components/editors/code-editor/src/mode-css.js +7 -7
  181. package/oda/components/editors/code-editor/src/mode-html.js +7 -7
  182. package/oda/components/editors/code-editor/src/mode-javascript.js +7 -7
  183. package/oda/components/editors/code-editor/src/mode-json.js +7 -7
  184. package/oda/components/editors/code-editor/src/mode-markdown.js +7 -7
  185. package/oda/components/editors/code-editor/src/mode-svg.js +7 -7
  186. package/oda/components/editors/code-editor/src/mode-text.js +7 -7
  187. package/oda/components/editors/code-editor/src/mode-xml.js +7 -7
  188. package/oda/components/editors/code-editor/src/mode-xquery.js +7 -7
  189. package/oda/components/editors/code-editor/src/snippets/css.js +7 -7
  190. package/oda/components/editors/code-editor/src/snippets/html.js +7 -7
  191. package/oda/components/editors/code-editor/src/snippets/javascript.js +7 -7
  192. package/oda/components/editors/code-editor/src/snippets/json.js +7 -7
  193. package/oda/components/editors/code-editor/src/snippets/markdown.js +7 -7
  194. package/oda/components/editors/code-editor/src/snippets/svg.js +7 -7
  195. package/oda/components/editors/code-editor/src/snippets/text.js +7 -7
  196. package/oda/components/editors/code-editor/src/snippets/xml.js +7 -7
  197. package/oda/components/editors/code-editor/src/snippets/xquery.js +7 -7
  198. package/oda/components/editors/code-editor/src/theme-solarized_dark.js +7 -7
  199. package/oda/components/editors/code-editor/src/theme-solarized_light.js +7 -7
  200. package/oda/components/editors/markdown/markdown-editor/lib/font-awesome.min.css +3 -3
  201. package/oda/components/editors/markdown/markdown-editor/lib/readme.md +332 -332
  202. package/oda/components/editors/markdown/markdown-editor/markdown-editor.js +78 -78
  203. package/oda/components/editors/markdown/markdown-viewer/test.md +239 -239
  204. package/oda/components/editors/markdown/markdown.js +76 -76
  205. package/oda/components/inputs/block/readme.md +39 -39
  206. package/oda/components/inputs/checkbox/checkbox.js +92 -92
  207. package/oda/components/inputs/color/color.js +83 -83
  208. package/oda/components/inputs/date/date.js +40 -40
  209. package/oda/components/inputs/input/input.js +219 -219
  210. package/oda/components/inputs/link/link.js +1 -1
  211. package/oda/components/inputs/link/readme.md +42 -42
  212. package/oda/components/inputs/markdown-input/markdown-input.js +77 -77
  213. package/oda/components/inputs/numeric/numeric.js +141 -141
  214. package/oda/components/inputs/table-input/readme.md +39 -39
  215. package/oda/components/inputs/text/text.js +88 -88
  216. package/oda/components/inputs/toggle/toggle.js +101 -101
  217. package/oda/components/layouts/hexagon-layout/hexagon-layout.js +218 -218
  218. package/oda/components/menus/menu/index_old.html +140 -140
  219. package/oda/components/structure/controls-map.js +56 -56
  220. package/oda/components/structure/controls.js +29 -29
  221. package/oda/components/structure/readme.md +31 -31
  222. package/oda/components/structure/structure.js +64 -64
  223. package/oda/components/table/index.html +210 -210
  224. package/oda/components/table/lib/coerce.js +68 -68
  225. package/oda/components/table/lib/column.js +568 -568
  226. package/oda/components/table/readme.md +120 -120
  227. package/oda/components/table/router.js +86 -86
  228. package/oda/components/table/settings.js +89 -89
  229. package/oda/index.html +159 -159
  230. package/oda/tools/icons/icons-set/icons-set.js +60 -60
  231. package/oda/tools/icons/lib/svg/_makeSVG.html +41 -41
  232. package/oda/tools/icons/lib/svg/aws.svg +2679 -2679
  233. package/oda/tools/icons/lib/svg/info.json +46 -46
  234. package/oda/tools/jupyter/demo.ipynb +160 -160
  235. package/oda/tools/jupyter/lib/print_elements.js +73 -73
  236. package/oda/tools/jupyter/test-2.ipynb +305 -305
  237. package/oda/tools/jupyter/test.ipynb +603 -603
  238. package/oda/tools/styles/adoptedStyleSheets.js +333 -333
  239. package/oda/tools/tester/device-preview/devices.json +9 -9
  240. package/package.json +1 -1
  241. package/rules/rules.md +445 -445
  242. package/scripts/SYNC-README.md +107 -107
  243. package/scripts/agent-eval.mjs +223 -223
  244. package/scripts/dump-svn-chat.mjs +9 -9
  245. package/scripts/extract-chat-day.mjs +21 -21
  246. package/scripts/rag-bench.mjs +166 -166
  247. package/scripts/restore-chat.mjs +166 -166
  248. package/scripts/sync-svn-git.bat +129 -129
  249. package/scripts/test-merge.mjs +75 -75
  250. package/scripts/work-desktop-bridge.mjs +101 -101
  251. package/sources/client/class.js +3 -0
  252. package/sources/client/field.js +168 -168
  253. package/sources/client/handler.js +68 -32
  254. package/sources/client/index.js +32 -32
  255. package/sources/client/readme.md +16 -16
  256. package/sources/client.js +12 -0
  257. package/sources/core.js +91 -91
  258. package/sources/data/choices.js +125 -125
  259. package/sources/host/babel-merge.js +398 -353
  260. package/sources/host/config.js +48 -48
  261. package/sources/host/index-db.js +94 -94
  262. package/sources/host/net-guard.js +228 -228
  263. package/sources/host/package-install.js +63 -63
  264. package/sources/host/push.js +86 -86
  265. package/sources/host/readme.md +41 -41
  266. package/sources/host/secret-box.js +93 -93
  267. package/sources/host/server-id.js +26 -26
  268. package/sources/host/stun.js +33 -33
  269. package/sources/host/tls-ca.js +60 -60
  270. package/sources/host/vapid.js +14 -14
  271. package/sources/index.html +1 -1
  272. package/sources/modules/a2a/server.js +608 -608
  273. package/sources/modules/agent/connections.js +442 -442
  274. package/sources/modules/agent/diff.js +69 -69
  275. package/sources/modules/agent/eval.js +222 -222
  276. package/sources/modules/agent/hooks.js +131 -131
  277. package/sources/modules/agent/index.js +6 -3
  278. package/sources/modules/agent/log.js +43 -43
  279. package/sources/modules/agent/loop.js +65 -0
  280. package/sources/modules/agent/mcp-pool.js +253 -253
  281. package/sources/modules/agent/recovery.js +89 -89
  282. package/sources/modules/agent/scope.js +387 -0
  283. package/sources/modules/agent/session.js +350 -15
  284. package/sources/modules/agent/taint.js +100 -100
  285. package/sources/modules/agent/tools/branch.js +311 -311
  286. package/sources/modules/agent/tools/browser.js +254 -254
  287. package/sources/modules/agent/tools/computer.js +120 -120
  288. package/sources/modules/agent/tools/connect.js +316 -316
  289. package/sources/modules/agent/tools/dev/lsp.js +334 -334
  290. package/sources/modules/agent/tools/dev/patch.js +564 -564
  291. package/sources/modules/agent/tools/memory.js +153 -153
  292. package/sources/modules/agent/tools/meta.js +60 -0
  293. package/sources/modules/agent/tools/os-files.js +358 -358
  294. package/sources/modules/agent/tools/plugins.js +80 -80
  295. package/sources/modules/agent/tools/sandbox.js +268 -268
  296. package/sources/modules/agent/types.d.ts +183 -183
  297. package/sources/modules/agent/undo.js +254 -254
  298. package/sources/modules/agent/util.js +179 -179
  299. package/sources/modules/contacts/contacts.js +200 -200
  300. package/sources/modules/contacts/index.html +546 -546
  301. package/sources/modules/lan/discovery.js +192 -192
  302. package/sources/modules/lan/store.js +62 -62
  303. package/sources/modules/mcp/readme.md +70 -70
  304. package/sources/modules/mcp/server.js +525 -525
  305. package/sources/modules/mcp/tokens.js +140 -140
  306. package/sources/modules/nodes/identity.js +123 -123
  307. package/sources/modules/nodes/outbound.js +105 -105
  308. package/sources/modules/nodes/signing.js +71 -71
  309. package/sources/modules/rag/embed-worker.js +36 -36
  310. package/sources/modules/rag/readme.md +70 -70
  311. package/sources/modules/readme.md +21 -21
  312. package/sources/modules/sandbox/config.js +74 -74
  313. package/sources/modules/sandbox/driver.js +100 -100
  314. package/sources/modules/sandbox/images/work-computer/Dockerfile +34 -34
  315. package/sources/modules/sandbox/images/work-computer/entrypoint.sh +24 -24
  316. package/sources/modules/sandbox/manager.js +1089 -1089
  317. package/sources/modules/sandbox/readme.md +63 -63
  318. package/sources/modules/sandbox/vnc-proxy.js +296 -296
  319. package/sources/server/access/audit.js +138 -138
  320. package/sources/server/access/refs.js +106 -106
  321. package/sources/server/assert-class-id.js +23 -23
  322. package/sources/server/chat-threads.js +16 -5
  323. package/sources/server/class.js +4 -1
  324. package/sources/server/external-source.js +90 -90
  325. package/sources/server/file.js +1 -1
  326. package/sources/server/folder.js +75 -33
  327. package/sources/server/handler.js +25 -12
  328. package/sources/server/index.js +12 -12
  329. package/sources/server/memory-mark.js +34 -34
  330. package/sources/server/readme.md +110 -110
  331. package/sources/server/safe-node-name.js +67 -67
  332. package/sources/server/server.js +6 -6
  333. package/sources/server/upload-mark.js +24 -24
  334. package/sources/server/zip-guard.js +81 -81
  335. package/whitepaper.md +568 -568
  336. package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/mcp/$handler/class.js +0 -9
  337. package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -1
  338. package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/$handler/tabs/license/$handler/class.js +0 -6
  339. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -3
  340. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -3
  341. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -3
  342. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/profile/$handler/class.js +0 -5
  343. package/$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js +0 -313
  344. package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js +0 -16
  345. package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +0 -1226
  346. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +0 -2095
  347. package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +0 -1188
  348. package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/search.js +0 -289
  349. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -6
  350. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database/$handler/class.js +0 -9
  351. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -6
  352. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -5
  353. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -281
  354. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/class.js +0 -5
  355. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/staff.js +0 -2126
  356. package/$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js +0 -240
  357. package/$server/$folder/$class/handlers/pages/form/object/$handler/class.js +0 -32
  358. package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +0 -1371
  359. package/$server/$folder/$class/handlers/pages/form/objects/$handler/class.js +0 -32
  360. package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +0 -2130
  361. package/$server/$folder/$class/handlers/pages/form/system/$handler/system.js +0 -309
  362. package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/files/$handler/files.js +0 -17
  363. package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/requisites/$handler/class.js +0 -16
  364. package/$server/$folder/$class/handlers/pages/storage/$handler/storage.js +0 -21
  365. package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/editor.js +0 -27
  366. package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/file.js +0 -31
  367. package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/file.js +0 -10
  368. package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/file.js +0 -72
  369. package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/file.js +0 -63
  370. package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/file.js +0 -1845
  371. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/file.js +0 -760
  372. package/$server/$folder/$file/handlers/pages/form/file/$handler/file.js +0 -29
  373. package/$server/$folder/handlers/pages/form/$handler/form.js +0 -2122
  374. package/MODULES/$domain/handlers/pages/form/system/$handler/tabs/mcp/$handler/mcp.js +0 -1
  375. package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js +0 -623
  376. package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js +0 -134
  377. package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/gantt.js" +0 -293
  378. package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/scheduler.js" +0 -234
  379. package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/bpmn.js" +0 -406
  380. package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/virtual.js +0 -399
  381. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/analysis.js +0 -9
  382. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/postings.js +0 -1700
  383. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/turnovers.js +0 -9
  384. package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/journal.js +0 -723
  385. package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/sheet.js +0 -808
  386. package/NODES/$node/handlers/pages/form/network/$handler/network.js +0 -110
  387. package/models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  388. package/models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  389. package/models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  390. package/models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  391. /package/$server/$folder/$class/$structure/$organization/handlers/pages/form/system/{$handler/tabs/requisites → requisites}/$handler/class.js +0 -0
  392. /package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/database → database}/$handler/class.js +0 -0
  393. /package/{models → MODELS}/$ai/$folder/$class/$ai/class.js +0 -0
  394. /package/{models → MODELS}/$ai/$folder/$class/$ai/methods/chat/$method/class.js +0 -0
  395. /package/{models → MODELS}/$ai/$folder/$class/$provider/class.js +0 -0
  396. /package/{models → MODELS}/$ai/class.js +0 -0
  397. /package/{models → MODELS}/$ai/readme.md +0 -0
  398. /package/{models → MODELS}/GigaChat/$provider/$folder/$class/$ai/class.js +0 -0
  399. /package/{models → MODELS}/GigaChat/$provider/class.js +0 -0
  400. /package/{models → MODELS}/GigaChat/GigaChat 2 Lite/$ai/class.js +0 -0
  401. /package/{models → MODELS}/GigaChat/GigaChat 2 Max/$ai/class.js +0 -0
  402. /package/{models → MODELS}/GigaChat/GigaChat 2 Pro/$ai/class.js +0 -0
  403. /package/{models → MODELS}/GigaChat/GigaChat Embeddings/$ai/class.js +0 -0
  404. /package/{models → MODELS}/Local/$provider/$folder/$class/$ai/class.js +0 -0
  405. /package/{models → MODELS}/Local/$provider/class.js +0 -0
  406. /package/{models → MODELS}/Local/$provider/handlers/methods/transfer/$handler/class.js +0 -0
  407. /package/{models → MODELS}/MTS-AI/$provider/$folder/$class/$ai/class.js +0 -0
  408. /package/{models → MODELS}/MTS-AI/$provider/class.js +0 -0
  409. /package/{models → MODELS}/MTS-AI/Cotype Lite/$ai/class.js +0 -0
  410. /package/{models → MODELS}/MTS-AI/Cotype Pro 2/$ai/class.js +0 -0
  411. /package/{models → MODELS}/MTS-AI/Cotype Vision/$ai/class.js +0 -0
  412. /package/{models → MODELS}/T-Bank/$provider/$folder/$class/$ai/class.js +0 -0
  413. /package/{models → MODELS}/T-Bank/$provider/class.js +0 -0
  414. /package/{models → MODELS}/T-Bank/T-Lite 2.0/$ai/class.js +0 -0
  415. /package/{models → MODELS}/T-Bank/T-Pro 2.0/$ai/class.js +0 -0
  416. /package/{models → MODELS}/T-Bank/T-VoiceKit ASR/$ai/class.js +0 -0
  417. /package/{models → MODELS}/T-Bank/T-VoiceKit TTS/$ai/class.js +0 -0
  418. /package/{models → MODELS}/Yandex/$provider/$folder/$class/$ai/class.js +0 -0
  419. /package/{models → MODELS}/Yandex/$provider/class.js +0 -0
  420. /package/{models → MODELS}/Yandex/Alice AI (YandexGPT 5 Pro)/$ai/class.js +0 -0
  421. /package/{models → MODELS}/Yandex/Yandex Embeddings/$ai/class.js +0 -0
  422. /package/{models → MODELS}/Yandex/Yandex SpeechKit ASR/$ai/class.js +0 -0
  423. /package/{models → MODELS}/Yandex/Yandex SpeechKit TTS/$ai/class.js +0 -0
  424. /package/{models → MODELS}/Yandex/YandexART/$ai/class.js +0 -0
  425. /package/{models → MODELS}/Yandex/YandexGPT 5 Lite/$ai/class.js +0 -0
  426. /package/{models → MODELS}/Yandex/YandexGPT Reasoning/$ai/class.js +0 -0
  427. /package/{users → USERS}/$users/class.js +0 -0
@@ -1,10 +1,9 @@
1
- /**
2
- * form/trainer («Модели ИИ» на /MODELS/Local) — чистый интерфейс управления локальными моделями ИИ:
3
- * - встроенный в WORK сервер локального ИИ (автозапуск по запросу, постоянный режим на Halo ≥ 128 ГБ, выгрузка при простое на обычных ПК);
4
- * - вкладка «Модели»: установленные модели (Вкл/Выкл, Удалить с диска) + установка моделей в 1 клик (включая комплект Halo);
5
- * - вкладка «Дообучение»: двухшаговый мастер (1. Собрать данные организации → 2. Дообучить модель LoRA).
6
- */
7
1
  export default {
2
+ label: 'Модели ИИ',
3
+ icon: 'carbon:chip',
4
+ order: 5,
5
+ tag: 'system-tab-ai-local',
6
+ component: {
8
7
  imports: 'oda//button, oda//icon, oda//tabs',
9
8
  template: /*html*/`
10
9
  <style>
@@ -679,27 +678,34 @@ export default {
679
678
  </div>
680
679
  `,
681
680
  $item: {
682
- $def: null,
683
- set(n) {
684
- if (n)
685
- this.reloadAll().then(() => this.searchHf());
686
- }
681
+ $def: null,
682
+ set(n) {
683
+ if (n) this.reloadAll().then(() => this.searchHf());
684
+ }
687
685
  },
688
686
  activeTab: 'models',
689
687
  get trainerTabItems() {
690
- return [
691
- { id: 'models', label: 'Модели', icon: 'carbon:machine-learning-model', count: this.localModels?.length || 0, showZeroCount: true },
692
- { id: 'train', label: 'Дообучение', icon: 'carbon:education', count: this.adapters?.length || 0, showZeroCount: true },
693
- ];
688
+ return [{
689
+ id: 'models',
690
+ label: 'Модели',
691
+ icon: 'carbon:machine-learning-model',
692
+ count: this.localModels?.length || 0,
693
+ showZeroCount: true
694
+ }, {
695
+ id: 'train',
696
+ label: 'Дообучение',
697
+ icon: 'carbon:education',
698
+ count: this.adapters?.length || 0,
699
+ showZeroCount: true
700
+ }];
694
701
  },
695
702
  get trainerTabIndex() {
696
- const idx = this.trainerTabItems.findIndex(t => t.id === this.activeTab);
697
- return idx >= 0 ? idx : 0;
703
+ const idx = this.trainerTabItems.findIndex(t => t.id === this.activeTab);
704
+ return idx >= 0 ? idx : 0;
698
705
  },
699
706
  onTrainerTabSelect(e) {
700
- const id = e?.detail?.item?.id;
701
- if (id)
702
- this.activeTab = id;
707
+ const id = e?.detail?.item?.id;
708
+ if (id) this.activeTab = id;
703
709
  },
704
710
  hardware: null,
705
711
  runtime: null,
@@ -745,709 +751,646 @@ export default {
745
751
  installingPythonDeps: false,
746
752
  checkAllResult: null,
747
753
  _pollTimer: null,
748
-
749
754
  get missingPythonPkgs() {
750
- const res = this.checkAllResult;
751
- if (!res)
752
- return [];
753
- const set = new Set();
754
- const pkgs = res.pythonDeps?.packages || {};
755
- for (const [k, ok] of Object.entries(pkgs)) {
756
- if (!ok)
757
- set.add(k);
758
- }
759
- for (const r of (res.results || [])) {
760
- for (const dep of (r.missingDeps || []))
761
- set.add(dep);
762
- }
763
- return [...set];
755
+ const res = this.checkAllResult;
756
+ if (!res) return [];
757
+ const set = new Set();
758
+ const pkgs = res.pythonDeps?.packages || {};
759
+ for (const [k, ok] of Object.entries(pkgs)) {
760
+ if (!ok) set.add(k);
761
+ }
762
+ for (const r of res.results || []) {
763
+ for (const dep of r.missingDeps || []) set.add(dep);
764
+ }
765
+ return [...set];
764
766
  },
765
-
766
767
  get hasNetworkChanges() {
767
- const n = this.network || {};
768
- const savedPreset = n.sourcePreset || 'official';
769
- const savedEndpoint = String(n.endpointUrl || 'https://huggingface.co').replace(/\/+$/, '');
770
- const savedThreads = Number(n.threads) || 8;
771
- const savedProxy = String(n.proxyUrl || '').trim();
772
-
773
- if (String(this.netPreset || 'official') !== savedPreset)
774
- return true;
775
- const curEndpoint = this.netPreset === 'official'
776
- ? 'https://huggingface.co'
777
- : (this.netPreset === 'hf-mirror' ? 'https://hf-mirror.com' : String(this.netEndpoint || '').trim().replace(/\/+$/, ''));
778
- if (this.netPreset === 'custom' && curEndpoint !== savedEndpoint)
779
- return true;
780
- if (Number(this.netThreads || 8) !== savedThreads)
781
- return true;
782
- if (this.netClearProxy && Boolean(savedProxy || n.hasProxy))
783
- return true;
784
- if (String(this.netProxy || '').trim() !== savedProxy)
785
- return true;
786
- if (this.netClearToken && Boolean(n.hasToken))
787
- return true;
788
- if (String(this.netToken || '').trim() !== '')
789
- return true;
790
- return false;
768
+ const n = this.network || {};
769
+ const savedPreset = n.sourcePreset || 'official';
770
+ const savedEndpoint = String(n.endpointUrl || 'https://huggingface.co').replace(/\/+$/, '');
771
+ const savedThreads = Number(n.threads) || 8;
772
+ const savedProxy = String(n.proxyUrl || '').trim();
773
+ if (String(this.netPreset || 'official') !== savedPreset) return true;
774
+ const curEndpoint = this.netPreset === 'official' ? 'https://huggingface.co' : this.netPreset === 'hf-mirror' ? 'https://hf-mirror.com' : String(this.netEndpoint || '').trim().replace(/\/+$/, '');
775
+ if (this.netPreset === 'custom' && curEndpoint !== savedEndpoint) return true;
776
+ if (Number(this.netThreads || 8) !== savedThreads) return true;
777
+ if (this.netClearProxy && Boolean(savedProxy || n.hasProxy)) return true;
778
+ if (String(this.netProxy || '').trim() !== savedProxy) return true;
779
+ if (this.netClearToken && Boolean(n.hasToken)) return true;
780
+ if (String(this.netToken || '').trim() !== '') return true;
781
+ return false;
791
782
  },
792
783
  get networkSummary() {
793
- const n = this.network;
794
- const src = n?.sourceLabel || 'huggingface.co';
795
- const thr = n?.threads || this.netThreads || 8;
796
- const pxy = n?.hasProxy ? ' · прокси' : '';
797
- return `${src} · ${thr} пот.${pxy}`;
784
+ const n = this.network;
785
+ const src = n?.sourceLabel || 'huggingface.co';
786
+ const thr = n?.threads || this.netThreads || 8;
787
+ const pxy = n?.hasProxy ? ' · прокси' : '';
788
+ return `${src} · ${thr} пот.${pxy}`;
798
789
  },
799
-
800
790
  get categoryTabs() {
801
- return [
802
- { id: 'all', label: 'Все', icon: 'icons:apps' },
803
- { id: 'installed', label: `Установленные (${(this.localModels || []).length})`, icon: 'icons:check' },
804
- { id: 'llm', label: 'Чат и Код', icon: 'carbon:chat' },
805
- { id: 'vlm', label: 'Зрение и Документы', icon: 'carbon:image-search' },
806
- { id: 'audio', label: 'Речь и Голос', icon: 'carbon:microphone' },
807
- { id: 'image', label: 'Картинки', icon: 'carbon:paint-brush' },
808
- { id: 'video', label: 'Видео', icon: 'av:videocam' },
809
- { id: 'embed', label: 'Поиск (RAG)', icon: 'carbon:search-locate' },
810
- { id: 'halo', label: 'Комплект Halo (128–192 ГБ)', icon: 'carbon:chip' },
811
- ];
791
+ return [{
792
+ id: 'all',
793
+ label: 'Все',
794
+ icon: 'icons:apps'
795
+ }, {
796
+ id: 'installed',
797
+ label: `Установленные (${(this.localModels || []).length})`,
798
+ icon: 'icons:check'
799
+ }, {
800
+ id: 'llm',
801
+ label: 'Чат и Код',
802
+ icon: 'carbon:chat'
803
+ }, {
804
+ id: 'vlm',
805
+ label: 'Зрение и Документы',
806
+ icon: 'carbon:image-search'
807
+ }, {
808
+ id: 'audio',
809
+ label: 'Речь и Голос',
810
+ icon: 'carbon:microphone'
811
+ }, {
812
+ id: 'image',
813
+ label: 'Картинки',
814
+ icon: 'carbon:paint-brush'
815
+ }, {
816
+ id: 'video',
817
+ label: 'Видео',
818
+ icon: 'av:videocam'
819
+ }, {
820
+ id: 'embed',
821
+ label: 'Поиск (RAG)',
822
+ icon: 'carbon:search-locate'
823
+ }, {
824
+ id: 'halo',
825
+ label: 'Комплект Halo (128–192 ГБ)',
826
+ icon: 'carbon:chip'
827
+ }];
812
828
  },
813
829
  get activeDownloads() {
814
- return (this.downloads || []).filter(d => d.status === 'downloading');
830
+ return (this.downloads || []).filter(d => d.status === 'downloading');
815
831
  },
816
832
  get activeTransfers() {
817
- return (this.transfers || []).filter(t => t.status === 'running');
833
+ return (this.transfers || []).filter(t => t.status === 'running');
818
834
  },
819
835
  get hasAvailableHalo() {
820
- return (this.halogenCatalog || []).some(h =>
821
- !h.weightsDownloaded
822
- && !this.isRepoInstalled(h.hfRepo, h.nodeName)
823
- && !this.getDownloadEntry(h.hfRepo, h.nodeName)
824
- );
836
+ return (this.halogenCatalog || []).some(h => !h.weightsDownloaded && !this.isRepoInstalled(h.hfRepo, h.nodeName) && !this.getDownloadEntry(h.hfRepo, h.nodeName));
825
837
  },
826
838
  get unifiedModels() {
827
- const mod = String(this.hfModality || 'all');
828
- const q = String(this.hfQuery || '').trim().toLowerCase();
829
- const haloByNode = new Map();
830
- const haloByRepo = new Map();
831
- for (const h of this.halogenCatalog || []) {
832
- if (h?.nodeName)
833
- haloByNode.set(h.nodeName.toLowerCase(), h);
834
- if (h?.hfRepo)
835
- haloByRepo.set(h.hfRepo.toLowerCase(), h);
836
- }
837
-
838
- const list = [];
839
- const findEntry = (id, repoId) => {
840
- const idLow = String(id || '').toLowerCase();
841
- const repoLow = String(repoId || '').toLowerCase();
842
- const shortRepo = repoLow ? repoLow.split('/').pop() : '';
843
- return list.find(x =>
844
- (idLow && (x.id?.toLowerCase() === idLow || x.download?.folderName?.toLowerCase() === idLow))
845
- || (repoLow && x.repoId?.toLowerCase() === repoLow)
846
- || (shortRepo && x.id?.toLowerCase() === shortRepo)
847
- ) || null;
848
- };
839
+ const mod = String(this.hfModality || 'all');
840
+ const q = String(this.hfQuery || '').trim().toLowerCase();
841
+ const haloByNode = new Map();
842
+ const haloByRepo = new Map();
843
+ for (const h of this.halogenCatalog || []) {
844
+ if (h?.nodeName) haloByNode.set(h.nodeName.toLowerCase(), h);
845
+ if (h?.hfRepo) haloByRepo.set(h.hfRepo.toLowerCase(), h);
846
+ }
847
+ const list = [];
848
+ const findEntry = (id, repoId) => {
849
+ const idLow = String(id || '').toLowerCase();
850
+ const repoLow = String(repoId || '').toLowerCase();
851
+ const shortRepo = repoLow ? repoLow.split('/').pop() : '';
852
+ return list.find(x => idLow && (x.id?.toLowerCase() === idLow || x.download?.folderName?.toLowerCase() === idLow) || repoLow && x.repoId?.toLowerCase() === repoLow || shortRepo && x.id?.toLowerCase() === shortRepo) || null;
853
+ };
849
854
 
850
- // 1. Установленные локальные модели
851
- for (const m of this.localModels || []) {
852
- const halo = haloByNode.get(String(m.id || '').toLowerCase())
853
- || haloByRepo.get(String(m.model || '').toLowerCase());
854
- const incompatible = Boolean(m.incompatibleOnPlatform);
855
- list.push({
856
- key: `inst:${m.id}`,
857
- id: m.id,
858
- repoId: halo?.hfRepo || (String(m.model || '').includes('/') ? m.model : ''),
859
- label: m.label || halo?.label || m.id,
860
- desc: `Путь: ${m.path}${m.sizeGb ? ` · На диске: ${m.sizeGb} ГБ` : ''}`,
861
- icon: m.icon || halo?.icon || 'ai:ollama',
862
- modality: m.modality || halo?.modality || 'llm',
863
- isHalo: Boolean(halo),
864
- state: 'installed',
865
- dotClass: incompatible ? 'warn' : (m.active ? 'on' : 'off'),
866
- path: m.path,
867
- enabled: m.enabled !== false,
868
- active: Boolean(m.active) && !incompatible,
869
- incompatibleOnPlatform: incompatible,
870
- incompatibleReason: m.incompatibleReason || '',
871
- sizeGb: m.sizeGb || 0,
872
- ramGb: m.sizeGb || halo?.ramGb || 4,
873
- fit: 'optimal',
874
- device: m.launchPassport?.computeDevice || halo?.device || '',
875
- launchPassport: m.launchPassport || null,
876
- download: null,
877
- progressPct: 100,
878
- etaText: '',
879
- });
880
- }
881
-
882
- // 2. Активные, приостановленные и упавшие загрузки (в т.ч. .part на диске)
883
- for (const d of this.downloads || []) {
884
- if (d.status === 'completed' || d.status === 'cancelled')
885
- continue;
886
- const halo = haloByNode.get(String(d.folderName || '').toLowerCase())
887
- || haloByRepo.get(String(d.repoId || '').toLowerCase());
888
- const existing = findEntry(d.folderName, d.repoId);
889
- const state = d.status === 'downloading' ? 'downloading' : (d.status === 'failed' ? 'failed' : 'paused');
890
- const progressPct = d.totalBytes > 0
891
- ? Math.min(99, Math.max(0, Number(d.progress) || Math.round((d.downloadedBytes / d.totalBytes) * 100)))
892
- : (d.downloadedBytes > 0 ? 15 : 0);
893
- const etaText = d.stalled ? '' : this.formatEta(d.etaSeconds);
894
- if (existing) {
895
- if (existing.state !== 'installed') {
896
- existing.state = state;
897
- existing.dotClass = state === 'downloading' ? 'on' : 'warn';
898
- existing.download = d;
899
- existing.progressPct = progressPct;
900
- existing.etaText = etaText;
901
- }
902
- continue;
903
- }
904
- list.push({
905
- key: `dl:${d.id || d.folderName}`,
906
- id: d.folderName || halo?.nodeName || d.repoId,
907
- repoId: d.repoId || halo?.hfRepo || '',
908
- label: halo?.label || d.label || d.folderName || d.repoId,
909
- desc: halo?.role || d.repoId || `Папка модели: ${d.folderName}/$ai/#weights`,
910
- icon: halo?.icon || 'ai:ollama',
911
- modality: halo?.modality || d.modality || 'llm',
912
- isHalo: Boolean(halo),
913
- state,
914
- dotClass: state === 'downloading' ? 'on' : 'warn',
915
- ramGb: halo?.ramGb || 4,
916
- fit: 'optimal',
917
- device: halo?.device || '',
918
- download: d,
919
- progressPct,
920
- etaText,
921
- });
922
- }
855
+ // 1. Установленные локальные модели
856
+ for (const m of this.localModels || []) {
857
+ const halo = haloByNode.get(String(m.id || '').toLowerCase()) || haloByRepo.get(String(m.model || '').toLowerCase());
858
+ const incompatible = Boolean(m.incompatibleOnPlatform);
859
+ list.push({
860
+ key: `inst:${m.id}`,
861
+ id: m.id,
862
+ repoId: halo?.hfRepo || (String(m.model || '').includes('/') ? m.model : ''),
863
+ label: m.label || halo?.label || m.id,
864
+ desc: `Путь: ${m.path}${m.sizeGb ? ` · На диске: ${m.sizeGb} ГБ` : ''}`,
865
+ icon: m.icon || halo?.icon || 'ai:ollama',
866
+ modality: m.modality || halo?.modality || 'llm',
867
+ isHalo: Boolean(halo),
868
+ state: 'installed',
869
+ dotClass: incompatible ? 'warn' : m.active ? 'on' : 'off',
870
+ path: m.path,
871
+ enabled: m.enabled !== false,
872
+ active: Boolean(m.active) && !incompatible,
873
+ incompatibleOnPlatform: incompatible,
874
+ incompatibleReason: m.incompatibleReason || '',
875
+ sizeGb: m.sizeGb || 0,
876
+ ramGb: m.sizeGb || halo?.ramGb || 4,
877
+ fit: 'optimal',
878
+ device: m.launchPassport?.computeDevice || halo?.device || '',
879
+ launchPassport: m.launchPassport || null,
880
+ download: null,
881
+ progressPct: 100,
882
+ etaText: ''
883
+ });
884
+ }
923
885
 
924
- // 3. Каталог Halo
925
- for (const h of this.halogenCatalog || []) {
926
- if (findEntry(h.nodeName, h.hfRepo))
927
- continue;
928
- const dl = h.activeDownload || null;
929
- const state = dl?.status === 'downloading' ? 'downloading' : (dl?.status === 'failed' ? 'failed' : 'available');
930
- const progressPct = dl ? Math.min(99, Math.max(1, Number(dl.progress) || 5)) : 0;
931
- list.push({
932
- key: `halo:${h.nodeName}`,
933
- id: h.nodeName,
934
- repoId: h.hfRepo,
935
- label: h.label || h.nodeName,
936
- desc: h.role || '',
937
- icon: h.icon || 'ai:qwen',
938
- modality: h.modality || 'llm',
939
- isHalo: true,
940
- state,
941
- dotClass: state === 'downloading' ? 'on' : 'off',
942
- ramGb: h.ramGb || 4,
943
- fit: 'optimal',
944
- device: h.device || '',
945
- download: dl,
946
- progressPct,
947
- etaText: '',
948
- });
949
- }
886
+ // 2. Активные, приостановленные и упавшие загрузки (в т.ч. .part на диске)
887
+ for (const d of this.downloads || []) {
888
+ if (d.status === 'completed' || d.status === 'cancelled') continue;
889
+ const halo = haloByNode.get(String(d.folderName || '').toLowerCase()) || haloByRepo.get(String(d.repoId || '').toLowerCase());
890
+ const existing = findEntry(d.folderName, d.repoId);
891
+ const state = d.status === 'downloading' ? 'downloading' : d.status === 'failed' ? 'failed' : 'paused';
892
+ const progressPct = d.totalBytes > 0 ? Math.min(99, Math.max(0, Number(d.progress) || Math.round(d.downloadedBytes / d.totalBytes * 100))) : d.downloadedBytes > 0 ? 15 : 0;
893
+ const etaText = d.stalled ? '' : this.formatEta(d.etaSeconds);
894
+ if (existing) {
895
+ if (existing.state !== 'installed') {
896
+ existing.state = state;
897
+ existing.dotClass = state === 'downloading' ? 'on' : 'warn';
898
+ existing.download = d;
899
+ existing.progressPct = progressPct;
900
+ existing.etaText = etaText;
901
+ }
902
+ continue;
903
+ }
904
+ list.push({
905
+ key: `dl:${d.id || d.folderName}`,
906
+ id: d.folderName || halo?.nodeName || d.repoId,
907
+ repoId: d.repoId || halo?.hfRepo || '',
908
+ label: halo?.label || d.label || d.folderName || d.repoId,
909
+ desc: halo?.role || d.repoId || `Папка модели: ${d.folderName}/$ai/#weights`,
910
+ icon: halo?.icon || 'ai:ollama',
911
+ modality: halo?.modality || d.modality || 'llm',
912
+ isHalo: Boolean(halo),
913
+ state,
914
+ dotClass: state === 'downloading' ? 'on' : 'warn',
915
+ ramGb: halo?.ramGb || 4,
916
+ fit: 'optimal',
917
+ device: halo?.device || '',
918
+ download: d,
919
+ progressPct,
920
+ etaText
921
+ });
922
+ }
950
923
 
951
- // 4. Каталог Hugging Face
952
- for (const item of this.hfModels || []) {
953
- const short = String(item.id || '').split('/').pop();
954
- const targetId = item.folderName || short || item.id;
955
- if (findEntry(targetId, item.id) || (short && findEntry(short, item.id)))
956
- continue;
957
- list.push({
958
- key: `hf:${item.id}`,
959
- id: targetId,
960
- repoId: item.id,
961
- label: item.modelName || item.id,
962
- desc: item.whatItDoes || item.recommendedFor || '',
963
- icon: item.icon || 'ai:ollama',
964
- modality: item.modality || 'llm',
965
- isHalo: Boolean(item.buboPackage),
966
- buboPackage: Boolean(item.buboPackage),
967
- haloNodeName: item.haloNodeName || '',
968
- state: 'available',
969
- dotClass: 'off',
970
- ramGb: Number(item.ramRequiredGb) || 0,
971
- fit: item.fit || 'unknown',
972
- fitLabel: item.fitLabel || '',
973
- diffusersCompatible: item.diffusersCompatible !== false,
974
- compatibilityNote: item.compatibilityNote || '',
975
- device: '',
976
- download: null,
977
- progressPct: 0,
978
- etaText: '',
979
- });
980
- }
924
+ // 3. Каталог Halo
925
+ for (const h of this.halogenCatalog || []) {
926
+ if (findEntry(h.nodeName, h.hfRepo)) continue;
927
+ const dl = h.activeDownload || null;
928
+ const state = dl?.status === 'downloading' ? 'downloading' : dl?.status === 'failed' ? 'failed' : 'available';
929
+ const progressPct = dl ? Math.min(99, Math.max(1, Number(dl.progress) || 5)) : 0;
930
+ list.push({
931
+ key: `halo:${h.nodeName}`,
932
+ id: h.nodeName,
933
+ repoId: h.hfRepo,
934
+ label: h.label || h.nodeName,
935
+ desc: h.role || '',
936
+ icon: h.icon || 'ai:qwen',
937
+ modality: h.modality || 'llm',
938
+ isHalo: true,
939
+ state,
940
+ dotClass: state === 'downloading' ? 'on' : 'off',
941
+ ramGb: h.ramGb || 4,
942
+ fit: 'optimal',
943
+ device: h.device || '',
944
+ download: dl,
945
+ progressPct,
946
+ etaText: ''
947
+ });
948
+ }
981
949
 
982
- const rank = { downloading: 0, paused: 1, failed: 1, installed: 2, available: 3 };
983
- return list
984
- .filter(item => {
985
- if (mod === 'installed')
986
- return item.state === 'installed';
987
- if (mod === 'halo')
988
- return item.isHalo;
989
- if (mod !== 'all' && item.modality !== mod)
990
- return false;
991
- if (q && mod !== 'halo' && mod !== 'installed') {
992
- const hay = `${item.label} ${item.id} ${item.repoId} ${item.desc}`.toLowerCase();
993
- if (!hay.includes(q))
994
- return false;
995
- }
996
- if (this.hfFilter === 'fit' && item.state === 'available' && item.fit === 'too_large')
997
- return false;
998
- return true;
999
- })
1000
- .sort((a, b) => (rank[a.state] ?? 9) - (rank[b.state] ?? 9));
950
+ // 4. Каталог Hugging Face
951
+ for (const item of this.hfModels || []) {
952
+ const short = String(item.id || '').split('/').pop();
953
+ const targetId = item.folderName || short || item.id;
954
+ if (findEntry(targetId, item.id) || short && findEntry(short, item.id)) continue;
955
+ list.push({
956
+ key: `hf:${item.id}`,
957
+ id: targetId,
958
+ repoId: item.id,
959
+ label: item.modelName || item.id,
960
+ desc: item.whatItDoes || item.recommendedFor || '',
961
+ icon: item.icon || 'ai:ollama',
962
+ modality: item.modality || 'llm',
963
+ isHalo: Boolean(item.buboPackage),
964
+ buboPackage: Boolean(item.buboPackage),
965
+ haloNodeName: item.haloNodeName || '',
966
+ state: 'available',
967
+ dotClass: 'off',
968
+ ramGb: Number(item.ramRequiredGb) || 0,
969
+ fit: item.fit || 'unknown',
970
+ fitLabel: item.fitLabel || '',
971
+ diffusersCompatible: item.diffusersCompatible !== false,
972
+ compatibilityNote: item.compatibilityNote || '',
973
+ device: '',
974
+ download: null,
975
+ progressPct: 0,
976
+ etaText: ''
977
+ });
978
+ }
979
+ const rank = {
980
+ downloading: 0,
981
+ paused: 1,
982
+ failed: 1,
983
+ installed: 2,
984
+ available: 3
985
+ };
986
+ return list.filter(item => {
987
+ if (mod === 'installed') return item.state === 'installed';
988
+ if (mod === 'halo') return item.isHalo;
989
+ if (mod !== 'all' && item.modality !== mod) return false;
990
+ if (q && mod !== 'halo' && mod !== 'installed') {
991
+ const hay = `${item.label} ${item.id} ${item.repoId} ${item.desc}`.toLowerCase();
992
+ if (!hay.includes(q)) return false;
993
+ }
994
+ if (this.hfFilter === 'fit' && item.state === 'available' && item.fit === 'too_large') return false;
995
+ return true;
996
+ }).sort((a, b) => (rank[a.state] ?? 9) - (rank[b.state] ?? 9));
1001
997
  },
1002
998
  formatEta(sec) {
1003
- const s = Number(sec);
1004
- if (!Number.isFinite(s) || s <= 0)
1005
- return '';
1006
- if (s < 60)
1007
- return `~${s} с`;
1008
- if (s < 3600)
1009
- return `~${Math.floor(s / 60)} мин ${s % 60} с`;
1010
- const h = Math.floor(s / 3600);
1011
- const m = Math.floor((s % 3600) / 60);
1012
- return `~${h} ч ${m} мин`;
999
+ const s = Number(sec);
1000
+ if (!Number.isFinite(s) || s <= 0) return '';
1001
+ if (s < 60) return `~${s} с`;
1002
+ if (s < 3600) return `~${Math.floor(s / 60)} мин ${s % 60} с`;
1003
+ const h = Math.floor(s / 3600);
1004
+ const m = Math.floor(s % 3600 / 60);
1005
+ return `~${h} ч ${m} мин`;
1013
1006
  },
1014
1007
  fmtDownloadBytes(bytes) {
1015
- const b = Number(bytes) || 0;
1016
- if (b <= 0)
1017
- return '0 МБ';
1018
- if (b < 1024 * 1024)
1019
- return `${Math.round(b / 1024)} КБ`;
1020
- if (b < 1024 ** 3)
1021
- return `${(b / (1024 * 1024)).toFixed(1)} МБ`;
1022
- return `${(b / (1024 ** 3)).toFixed(2)} ГБ`;
1008
+ const b = Number(bytes) || 0;
1009
+ if (b <= 0) return '0 МБ';
1010
+ if (b < 1024 * 1024) return `${Math.round(b / 1024)} КБ`;
1011
+ if (b < 1024 ** 3) return `${(b / (1024 * 1024)).toFixed(1)} МБ`;
1012
+ return `${(b / 1024 ** 3).toFixed(2)} ГБ`;
1023
1013
  },
1024
1014
  isRepoInstalled(repoId, nodeName = '') {
1025
- if (!repoId && !nodeName)
1026
- return false;
1027
- const shortName = repoId ? String(repoId).split('/').pop().toLowerCase() : '';
1028
- const nodeLower = nodeName ? String(nodeName).toLowerCase() : '';
1029
- const repoLower = repoId ? String(repoId).toLowerCase() : '';
1030
- return (this.localModels || []).some(m => {
1031
- const mId = String(m.id || '').toLowerCase();
1032
- const mModel = String(m.model || '').toLowerCase();
1033
- return (shortName && mId === shortName)
1034
- || (nodeLower && mId === nodeLower)
1035
- || (repoLower && mModel === repoLower);
1036
- });
1015
+ if (!repoId && !nodeName) return false;
1016
+ const shortName = repoId ? String(repoId).split('/').pop().toLowerCase() : '';
1017
+ const nodeLower = nodeName ? String(nodeName).toLowerCase() : '';
1018
+ const repoLower = repoId ? String(repoId).toLowerCase() : '';
1019
+ return (this.localModels || []).some(m => {
1020
+ const mId = String(m.id || '').toLowerCase();
1021
+ const mModel = String(m.model || '').toLowerCase();
1022
+ return shortName && mId === shortName || nodeLower && mId === nodeLower || repoLower && mModel === repoLower;
1023
+ });
1037
1024
  },
1038
1025
  getDownloadEntry(repoId, nodeName = '') {
1039
- if (!repoId && !nodeName)
1040
- return null;
1041
- return (this.downloads || []).find(d =>
1042
- (d.status === 'downloading' || d.status === 'paused' || d.status === 'failed')
1043
- && ((repoId && d.repoId === repoId) || (nodeName && d.folderName === nodeName))
1044
- ) || null;
1026
+ if (!repoId && !nodeName) return null;
1027
+ return (this.downloads || []).find(d => (d.status === 'downloading' || d.status === 'paused' || d.status === 'failed') && (repoId && d.repoId === repoId || nodeName && d.folderName === nodeName)) || null;
1045
1028
  },
1046
1029
  async attached() {
1047
- await this.reloadAll();
1048
- await this.searchHf();
1049
- this._pollTimer = setInterval(() => {
1050
- if (
1051
- this.activeDownloads.length
1052
- || this.activeTransfers.length
1053
- || this.halogenPrepareState?.status === 'running'
1054
- || (this.jobs || []).some(j => j.status === 'running')
1055
- ) {
1056
- this.reloadAll();
1057
- }
1058
- }, 1200);
1030
+ await this.reloadAll();
1031
+ await this.searchHf();
1032
+ this._pollTimer = setInterval(() => {
1033
+ if (this.activeDownloads.length || this.activeTransfers.length || this.halogenPrepareState?.status === 'running' || (this.jobs || []).some(j => j.status === 'running')) {
1034
+ this.reloadAll();
1035
+ }
1036
+ }, 1200);
1059
1037
  },
1060
1038
  detached() {
1061
- if (this._pollTimer) {
1062
- clearInterval(this._pollTimer);
1063
- this._pollTimer = null;
1064
- }
1039
+ if (this._pollTimer) {
1040
+ clearInterval(this._pollTimer);
1041
+ this._pollTimer = null;
1042
+ }
1065
1043
  },
1066
1044
  async _call(method, params = {}) {
1067
- this.error = '';
1068
- if (!this.$item)
1069
- return null;
1070
- try {
1071
- return await this.$item.fetch(method, params);
1072
- }
1073
- catch (e) {
1074
- this.error = String(e?.message || e);
1075
- return null;
1076
- }
1045
+ this.error = '';
1046
+ if (!this.$item) return null;
1047
+ try {
1048
+ return await this.$item.fetch(method, params);
1049
+ } catch (e) {
1050
+ this.error = String(e?.message || e);
1051
+ return null;
1052
+ }
1077
1053
  },
1078
1054
  async checkAllModels() {
1079
- if (!this.$item)
1080
- return;
1081
- this.checkingAll = true;
1082
- this.error = '';
1083
- this.notice = '';
1084
- try {
1085
- const res = await this.$item.fetch('trainer_check_all_models');
1086
- this.checkAllResult = res;
1087
- const total = (res?.results || []).filter(r => !r.skipped).length;
1088
- const passed = (res?.results || []).filter(r => r.ok).length;
1089
- this.notice = `Проверка завершена: работает ${passed} из ${total} активных моделей.`;
1090
- }
1091
- catch (e) {
1092
- this.error = String(e?.message || e);
1093
- }
1094
- finally {
1095
- this.checkingAll = false;
1096
- }
1055
+ if (!this.$item) return;
1056
+ this.checkingAll = true;
1057
+ this.error = '';
1058
+ this.notice = '';
1059
+ try {
1060
+ const res = await this.$item.fetch('trainer_check_all_models');
1061
+ this.checkAllResult = res;
1062
+ const total = (res?.results || []).filter(r => !r.skipped).length;
1063
+ const passed = (res?.results || []).filter(r => r.ok).length;
1064
+ this.notice = `Проверка завершена: работает ${passed} из ${total} активных моделей.`;
1065
+ } catch (e) {
1066
+ this.error = String(e?.message || e);
1067
+ } finally {
1068
+ this.checkingAll = false;
1069
+ }
1097
1070
  },
1098
1071
  async installMissingPythonDeps() {
1099
- if (!this.$item || !this.missingPythonPkgs.length)
1100
- return;
1101
- this.installingPythonDeps = true;
1102
- this.error = '';
1103
- this.notice = '';
1104
- try {
1105
- const res = await this.$item.fetch('trainer_install_python_deps', {}, { packages: this.missingPythonPkgs });
1106
- if (res?.ok) {
1107
- this.notice = 'Пакеты установлены: ' + (res.packages || []).join(', ') + '. Повторяем проверку…';
1108
- await this.checkAllModels();
1109
- }
1110
- else {
1111
- this.error = res?.error || 'Не удалось установить Python-пакеты.';
1112
- }
1113
- }
1114
- catch (e) {
1115
- this.error = String(e?.message || e);
1116
- }
1117
- finally {
1118
- this.installingPythonDeps = false;
1119
- }
1072
+ if (!this.$item || !this.missingPythonPkgs.length) return;
1073
+ this.installingPythonDeps = true;
1074
+ this.error = '';
1075
+ this.notice = '';
1076
+ try {
1077
+ const res = await this.$item.fetch('trainer_install_python_deps', {}, {
1078
+ packages: this.missingPythonPkgs
1079
+ });
1080
+ if (res?.ok) {
1081
+ this.notice = 'Пакеты установлены: ' + (res.packages || []).join(', ') + '. Повторяем проверку…';
1082
+ await this.checkAllModels();
1083
+ } else {
1084
+ this.error = res?.error || 'Не удалось установить Python-пакеты.';
1085
+ }
1086
+ } catch (e) {
1087
+ this.error = String(e?.message || e);
1088
+ } finally {
1089
+ this.installingPythonDeps = false;
1090
+ }
1120
1091
  },
1121
1092
  _invalidateClientModelsTree() {
1122
- for (const w of [window, window.parent, window.top]) {
1123
- try {
1124
- const wk = w?.WORK;
1125
- if (!wk?.items)
1126
- continue;
1127
- for (const k of Object.keys(wk.items)) {
1128
- if (k === '/MODELS' || k.startsWith('/MODELS/')) {
1129
- const node = wk.items[k];
1130
- if (node?.[w.R]?.cache)
1131
- delete node[w.R].cache.items;
1132
- node?.reset?.();
1133
- }
1134
- }
1093
+ for (const w of [window, window.parent, window.top]) {
1094
+ try {
1095
+ const wk = w?.WORK;
1096
+ if (!wk?.items) continue;
1097
+ for (const k of Object.keys(wk.items)) {
1098
+ if (k === '/MODELS' || k.startsWith('/MODELS/')) {
1099
+ const node = wk.items[k];
1100
+ if (node?.[w.R]?.cache) delete node[w.R].cache.items;
1101
+ node?.reset?.();
1135
1102
  }
1136
- catch { /* ignore cross-frame */ }
1137
- }
1103
+ }
1104
+ } catch {/* ignore cross-frame */}
1105
+ }
1138
1106
  },
1139
1107
  async reloadAll() {
1140
- const prevCount = this.localModels?.length || 0;
1141
- const st = await this._call('trainer_status');
1142
- if (!st)
1143
- return;
1144
- if (st.hardware) {
1145
- const firstLoad = !this.hardware;
1146
- this.hardware = st.hardware;
1147
- if (firstLoad && st.hardware.recommendedBaseModel) {
1148
- this.trainBaseModel = st.hardware.recommendedBaseModel;
1149
- this.trainLoraR = st.hardware.recommendedLoraR || 16;
1150
- this.trainMaxSeq = st.hardware.recommendedMaxSeq || 8192;
1151
- }
1152
- }
1153
- this.runtime = st.runtime || null;
1154
- this.localModels = st.models || [];
1155
- this.adapters = st.adapters || [];
1156
- this.datasets = st.datasets || [];
1157
- this.downloads = st.downloads || [];
1158
- this.jobs = st.jobs || [];
1159
- this.transfers = st.transfers || [];
1160
- if (st.network) {
1161
- const hadChanges = this.hasNetworkChanges;
1162
- this.network = st.network;
1163
- if (!hadChanges)
1164
- this._applyNetworkState(st.network);
1165
- }
1166
- if (st.halogen?.catalog)
1167
- this.halogenCatalog = st.halogen.catalog;
1168
- this.halogenPrepareState = st.halogen?.windowsEnv?.prepareState || null;
1169
- if (this.localModels.length !== prevCount)
1170
- this._invalidateClientModelsTree();
1108
+ const prevCount = this.localModels?.length || 0;
1109
+ const st = await this._call('trainer_status');
1110
+ if (!st) return;
1111
+ if (st.hardware) {
1112
+ const firstLoad = !this.hardware;
1113
+ this.hardware = st.hardware;
1114
+ if (firstLoad && st.hardware.recommendedBaseModel) {
1115
+ this.trainBaseModel = st.hardware.recommendedBaseModel;
1116
+ this.trainLoraR = st.hardware.recommendedLoraR || 16;
1117
+ this.trainMaxSeq = st.hardware.recommendedMaxSeq || 8192;
1118
+ }
1119
+ }
1120
+ this.runtime = st.runtime || null;
1121
+ this.localModels = st.models || [];
1122
+ this.adapters = st.adapters || [];
1123
+ this.datasets = st.datasets || [];
1124
+ this.downloads = st.downloads || [];
1125
+ this.jobs = st.jobs || [];
1126
+ this.transfers = st.transfers || [];
1127
+ if (st.network) {
1128
+ const hadChanges = this.hasNetworkChanges;
1129
+ this.network = st.network;
1130
+ if (!hadChanges) this._applyNetworkState(st.network);
1131
+ }
1132
+ if (st.halogen?.catalog) this.halogenCatalog = st.halogen.catalog;
1133
+ this.halogenPrepareState = st.halogen?.windowsEnv?.prepareState || null;
1134
+ if (this.localModels.length !== prevCount) this._invalidateClientModelsTree();
1171
1135
  },
1172
1136
  lowSpeedHint(dl) {
1173
- const sp = dl?.avgSpeedMBs || dl?.speedMBs || 0;
1174
- if (dl?.stalled)
1175
- return `Источник не передаёт данные ${dl.idleSec || 0} с — соединение переподключается автоматически. Если простой повторяется, смените источник на HF-Mirror или включите прокси/VPN.`;
1176
- if (dl?.usingProxy)
1177
- return `Низкая скорость через прокси (${sp} МБ/с). Проверьте скорость прокси-сервера или попробуйте другой источник.`;
1178
- if (dl?.sourceLabel === 'hf-mirror' || String(dl?.endpointUrl || '').includes('hf-mirror'))
1179
- return `Низкая скорость на HF-Mirror (${sp} МБ/с). Попробуйте указать прокси или включить VPN.`;
1180
- return `Низкая скорость (${sp} МБ/с). Попробуйте переключить источник на HF-Mirror или указать прокси для моделей.`;
1137
+ const sp = dl?.avgSpeedMBs || dl?.speedMBs || 0;
1138
+ if (dl?.stalled) return `Источник не передаёт данные ${dl.idleSec || 0} с — соединение переподключается автоматически. Если простой повторяется, смените источник на HF-Mirror или включите прокси/VPN.`;
1139
+ if (dl?.usingProxy) return `Низкая скорость через прокси (${sp} МБ/с). Проверьте скорость прокси-сервера или попробуйте другой источник.`;
1140
+ if (dl?.sourceLabel === 'hf-mirror' || String(dl?.endpointUrl || '').includes('hf-mirror')) return `Низкая скорость на HF-Mirror (${sp} МБ/с). Попробуйте указать прокси или включить VPN.`;
1141
+ return `Низкая скорость (${sp} МБ/с). Попробуйте переключить источник на HF-Mirror или указать прокси для моделей.`;
1181
1142
  },
1182
1143
  _applyNetworkState(n) {
1183
- if (!n)
1184
- return;
1185
- this.netPreset = n.sourcePreset || 'official';
1186
- this.netEndpoint = n.endpointUrl || 'https://huggingface.co';
1187
- this.netProxy = n.proxyUrl || '';
1188
- this.netHasProxy = Boolean(n.hasProxy);
1189
- this.netThreads = Number(n.threads) || 8;
1190
- this.netHasToken = Boolean(n.hasToken);
1191
- this.netTokenMask = n.tokenMask || '';
1192
- this.netToken = '';
1193
- this.netClearProxy = false;
1194
- this.netClearToken = false;
1144
+ if (!n) return;
1145
+ this.netPreset = n.sourcePreset || 'official';
1146
+ this.netEndpoint = n.endpointUrl || 'https://huggingface.co';
1147
+ this.netProxy = n.proxyUrl || '';
1148
+ this.netHasProxy = Boolean(n.hasProxy);
1149
+ this.netThreads = Number(n.threads) || 8;
1150
+ this.netHasToken = Boolean(n.hasToken);
1151
+ this.netTokenMask = n.tokenMask || '';
1152
+ this.netToken = '';
1153
+ this.netClearProxy = false;
1154
+ this.netClearToken = false;
1195
1155
  },
1196
1156
  toggleNetworkPanel() {
1197
- this.networkOpen = !this.networkOpen;
1198
- if (this.networkOpen && this.network && !this.hasNetworkChanges)
1199
- this._applyNetworkState(this.network);
1200
- if (this.networkOpen)
1201
- this._focusNetworkPanel();
1157
+ this.networkOpen = !this.networkOpen;
1158
+ if (this.networkOpen && this.network && !this.hasNetworkChanges) this._applyNetworkState(this.network);
1159
+ if (this.networkOpen) this._focusNetworkPanel();
1202
1160
  },
1203
1161
  openNetworkPanel() {
1204
- this.networkOpen = true;
1205
- if (this.network && !this.hasNetworkChanges)
1206
- this._applyNetworkState(this.network);
1207
- this._focusNetworkPanel();
1162
+ this.networkOpen = true;
1163
+ if (this.network && !this.hasNetworkChanges) this._applyNetworkState(this.network);
1164
+ this._focusNetworkPanel();
1208
1165
  },
1209
1166
  _focusNetworkPanel() {
1210
- this.async(() => {
1211
- const panel = this.__shadowRoot__?.getElementById?.('networkPanel') || this.shadowRoot?.getElementById?.('networkPanel');
1212
- panel?.scrollIntoView?.({ behavior: 'smooth', block: 'center' });
1213
- panel?.querySelector?.('select, input')?.focus?.();
1214
- }, 50);
1167
+ this.async(() => {
1168
+ const panel = this.__shadowRoot__?.getElementById?.('networkPanel') || this.shadowRoot?.getElementById?.('networkPanel');
1169
+ panel?.scrollIntoView?.({
1170
+ behavior: 'smooth',
1171
+ block: 'center'
1172
+ });
1173
+ panel?.querySelector?.('select, input')?.focus?.();
1174
+ }, 50);
1215
1175
  },
1216
1176
  onNetworkPresetChange(val) {
1217
- this.netPreset = String(val || 'official');
1218
- if (this.netPreset === 'official')
1219
- this.netEndpoint = 'https://huggingface.co';
1220
- else if (this.netPreset === 'hf-mirror')
1221
- this.netEndpoint = 'https://hf-mirror.com';
1177
+ this.netPreset = String(val || 'official');
1178
+ if (this.netPreset === 'official') this.netEndpoint = 'https://huggingface.co';else if (this.netPreset === 'hf-mirror') this.netEndpoint = 'https://hf-mirror.com';
1222
1179
  },
1223
1180
  setNetworkField(field, val) {
1224
- this[field] = val;
1225
- if (field === 'netProxy' && String(val || '').trim())
1226
- this.netClearProxy = false;
1227
- if (field === 'netToken' && String(val || '').trim())
1228
- this.netClearToken = false;
1181
+ this[field] = val;
1182
+ if (field === 'netProxy' && String(val || '').trim()) this.netClearProxy = false;
1183
+ if (field === 'netToken' && String(val || '').trim()) this.netClearToken = false;
1229
1184
  },
1230
1185
  async saveNetworkSettings() {
1231
- if (!this.hasNetworkChanges)
1232
- return;
1233
- this.netBusy = true;
1234
- try {
1235
- const payload = {
1236
- sourcePreset: this.netPreset,
1237
- endpointUrl: this.netPreset === 'official'
1238
- ? 'https://huggingface.co'
1239
- : (this.netPreset === 'hf-mirror' ? 'https://hf-mirror.com' : this.netEndpoint),
1240
- proxyUrl: this.netProxy,
1241
- threads: this.netThreads,
1242
- };
1243
- if (this.netClearProxy && !String(this.netProxy || '').trim())
1244
- payload.clearProxy = true;
1245
- if (this.netClearToken && !String(this.netToken || '').trim())
1246
- payload.clearToken = true;
1247
- else if (this.netToken)
1248
- payload.token = this.netToken;
1249
- const res = await this._call('trainer_network_set', payload);
1250
- if (res) {
1251
- this.network = res;
1252
- this._applyNetworkState(res);
1253
- const extra = res.restartedCount > 0
1254
- ? ` · активных загрузок перезапущено на новых настройках: ${res.restartedCount}`
1255
- : '';
1256
- this.notice = `Сетевые настройки загрузчика сохранены (${res.sourceLabel}, ${res.threads} потоков${extra}).`;
1257
- if (res.restartedCount > 0)
1258
- await this.reloadAll();
1259
- }
1260
- }
1261
- finally {
1262
- this.netBusy = false;
1263
- }
1186
+ if (!this.hasNetworkChanges) return;
1187
+ this.netBusy = true;
1188
+ try {
1189
+ const payload = {
1190
+ sourcePreset: this.netPreset,
1191
+ endpointUrl: this.netPreset === 'official' ? 'https://huggingface.co' : this.netPreset === 'hf-mirror' ? 'https://hf-mirror.com' : this.netEndpoint,
1192
+ proxyUrl: this.netProxy,
1193
+ threads: this.netThreads
1194
+ };
1195
+ if (this.netClearProxy && !String(this.netProxy || '').trim()) payload.clearProxy = true;
1196
+ if (this.netClearToken && !String(this.netToken || '').trim()) payload.clearToken = true;else if (this.netToken) payload.token = this.netToken;
1197
+ const res = await this._call('trainer_network_set', payload);
1198
+ if (res) {
1199
+ this.network = res;
1200
+ this._applyNetworkState(res);
1201
+ const extra = res.restartedCount > 0 ? ` · активных загрузок перезапущено на новых настройках: ${res.restartedCount}` : '';
1202
+ this.notice = `Сетевые настройки загрузчика сохранены (${res.sourceLabel}, ${res.threads} потоков${extra}).`;
1203
+ if (res.restartedCount > 0) await this.reloadAll();
1204
+ }
1205
+ } finally {
1206
+ this.netBusy = false;
1207
+ }
1264
1208
  },
1265
1209
  clearNetworkProxy() {
1266
- this.netProxy = '';
1267
- this.netClearProxy = Boolean(this.network?.hasProxy || this.network?.proxyUrl);
1210
+ this.netProxy = '';
1211
+ this.netClearProxy = Boolean(this.network?.hasProxy || this.network?.proxyUrl);
1268
1212
  },
1269
1213
  clearNetworkToken() {
1270
- this.netToken = '';
1271
- this.netClearToken = Boolean(this.network?.hasToken);
1214
+ this.netToken = '';
1215
+ this.netClearToken = Boolean(this.network?.hasToken);
1272
1216
  },
1273
1217
  async setModality(mod) {
1274
- this.hfModality = String(mod || 'all');
1275
- if (this.hfModality !== 'halo' && this.hfModality !== 'installed') {
1276
- await this.searchHf();
1277
- }
1218
+ this.hfModality = String(mod || 'all');
1219
+ if (this.hfModality !== 'halo' && this.hfModality !== 'installed') {
1220
+ await this.searchHf();
1221
+ }
1278
1222
  },
1279
1223
  async installUnifiedModel(item) {
1280
- if (!item)
1281
- return;
1282
- if (item.download && (item.state === 'paused' || item.state === 'failed')) {
1283
- await this.resumeDownload(item);
1284
- return;
1285
- }
1286
- if (item.buboPackage || item.haloNodeName)
1287
- await this.downloadHalogenModel(item.haloNodeName || 'Qwen3.8-Flash-Next');
1288
- else if (item.isHalo)
1289
- await this.downloadHalogenModel(item.id);
1290
- else
1291
- await this.installModelOneClick(item.repoId);
1224
+ if (!item) return;
1225
+ if (item.download && (item.state === 'paused' || item.state === 'failed')) {
1226
+ await this.resumeDownload(item);
1227
+ return;
1228
+ }
1229
+ if (item.buboPackage || item.haloNodeName) await this.downloadHalogenModel(item.haloNodeName || 'Qwen3.8-Flash-Next');else if (item.isHalo) await this.downloadHalogenModel(item.id);else await this.installModelOneClick(item.repoId);
1292
1230
  },
1293
1231
  async pauseDownload(item) {
1294
- const jobId = item?.download?.id || item?.id || item;
1295
- if (!jobId)
1296
- return;
1297
- await this._call('trainer_hf_pause', { jobId });
1298
- this.notice = `Загрузка «${item?.label || jobId}» поставлена на паузу (скачанное сохранено для докачки).`;
1299
- await this.reloadAll();
1232
+ const jobId = item?.download?.id || item?.id || item;
1233
+ if (!jobId) return;
1234
+ await this._call('trainer_hf_pause', {
1235
+ jobId
1236
+ });
1237
+ this.notice = `Загрузка «${item?.label || jobId}» поставлена на паузу (скачанное сохранено для докачки).`;
1238
+ await this.reloadAll();
1300
1239
  },
1301
1240
  async resumeDownload(item) {
1302
- const dl = item?.download || item || {};
1303
- const job = await this._call('trainer_hf_resume', {
1304
- jobId: dl.id || '',
1305
- folderName: dl.folderName || item?.id || '',
1306
- repoId: item?.repoId || dl.repoId || '',
1307
- quant: (this.hardware?.usableMemoryGb || 12) >= 24 ? 'Q8_0' : 'Q4_K_M',
1308
- });
1309
- if (job) {
1310
- this.notice = `Возобновлена докачка модели «${item?.label || dl.folderName || item?.repoId}»…`;
1311
- await this.reloadAll();
1312
- }
1241
+ const dl = item?.download || item || {};
1242
+ const job = await this._call('trainer_hf_resume', {
1243
+ jobId: dl.id || '',
1244
+ folderName: dl.folderName || item?.id || '',
1245
+ repoId: item?.repoId || dl.repoId || '',
1246
+ quant: (this.hardware?.usableMemoryGb || 12) >= 24 ? 'Q8_0' : 'Q4_K_M'
1247
+ });
1248
+ if (job) {
1249
+ this.notice = `Возобновлена докачка модели «${item?.label || dl.folderName || item?.repoId}»…`;
1250
+ await this.reloadAll();
1251
+ }
1313
1252
  },
1314
1253
  async discardDownload(item) {
1315
- const dl = item?.download || item || {};
1316
- await this._call('trainer_hf_discard', {
1317
- jobId: dl.id || '',
1318
- folderName: dl.folderName || item?.id || '',
1319
- });
1320
- this.notice = `Недокачанные файлы «${item?.label || dl.folderName}» удалены.`;
1321
- await this.reloadAll();
1254
+ const dl = item?.download || item || {};
1255
+ await this._call('trainer_hf_discard', {
1256
+ jobId: dl.id || '',
1257
+ folderName: dl.folderName || item?.id || ''
1258
+ });
1259
+ this.notice = `Недокачанные файлы «${item?.label || dl.folderName}» удалены.`;
1260
+ await this.reloadAll();
1322
1261
  },
1323
1262
  async setHfFilter(val) {
1324
- this.hfFilter = String(val || 'all');
1325
- await this.searchHf();
1263
+ this.hfFilter = String(val || 'all');
1264
+ await this.searchHf();
1326
1265
  },
1327
1266
  async searchHf() {
1328
- const res = await this._call('trainer_hf_search', {
1329
- query: this.hfQuery,
1330
- modality: (this.hfModality === 'halo' || this.hfModality === 'installed') ? 'all' : this.hfModality,
1331
- filter: this.hfFilter,
1332
- });
1333
- if (res?.items)
1334
- this.hfModels = res.items;
1267
+ const res = await this._call('trainer_hf_search', {
1268
+ query: this.hfQuery,
1269
+ modality: this.hfModality === 'halo' || this.hfModality === 'installed' ? 'all' : this.hfModality,
1270
+ filter: this.hfFilter
1271
+ });
1272
+ if (res?.items) this.hfModels = res.items;
1335
1273
  },
1336
1274
  async installModelOneClick(repoId) {
1337
- if (!repoId)
1338
- return;
1339
- this.notice = '';
1340
- const quant = (this.hardware?.usableMemoryGb || 12) >= 24 ? 'Q8_0' : 'Q4_K_M';
1341
- const job = await this._call('trainer_hf_download', {
1342
- repoId,
1343
- quant,
1344
- });
1345
- if (job) {
1346
- this.notice = `Начата установка модели «${repoId}»…`;
1347
- await this.reloadAll();
1348
- this._invalidateClientModelsTree();
1349
- }
1275
+ if (!repoId) return;
1276
+ this.notice = '';
1277
+ const quant = (this.hardware?.usableMemoryGb || 12) >= 24 ? 'Q8_0' : 'Q4_K_M';
1278
+ const job = await this._call('trainer_hf_download', {
1279
+ repoId,
1280
+ quant
1281
+ });
1282
+ if (job) {
1283
+ this.notice = `Начата установка модели «${repoId}»…`;
1284
+ await this.reloadAll();
1285
+ this._invalidateClientModelsTree();
1286
+ }
1350
1287
  },
1351
1288
  async cancelDownload(jobId) {
1352
- await this._call('trainer_hf_cancel', { jobId });
1353
- await this.reloadAll();
1289
+ await this._call('trainer_hf_cancel', {
1290
+ jobId
1291
+ });
1292
+ await this.reloadAll();
1354
1293
  },
1355
1294
  async cancelTransfer(jobId) {
1356
- await this._call('trainer_transfer_cancel', { jobId });
1357
- await this.reloadAll();
1295
+ await this._call('trainer_transfer_cancel', {
1296
+ jobId
1297
+ });
1298
+ await this.reloadAll();
1358
1299
  },
1359
1300
  async openTransferDialog(mode = 'export') {
1360
- const mod = await import('/$server/$folder/lib/local-models-transfer/local-models-transfer.js');
1361
- await mod.openLocalModelsTransferDialog(this.$item, {
1362
- mode,
1363
- onComplete: async () => {
1364
- await this.reloadAll();
1365
- this._invalidateClientModelsTree();
1366
- },
1367
- });
1368
- await this.reloadAll();
1301
+ const mod = await import('/$server/$folder/lib/local-models-transfer/local-models-transfer.js');
1302
+ await mod.openLocalModelsTransferDialog(this.$item, {
1303
+ mode,
1304
+ onComplete: async () => {
1305
+ await this.reloadAll();
1306
+ this._invalidateClientModelsTree();
1307
+ }
1308
+ });
1309
+ await this.reloadAll();
1369
1310
  },
1370
1311
  async toggleLocalModel(modelPath, checked) {
1371
- await this._call('provider_toggle_model', {
1372
- nodePath: modelPath,
1373
- enabled: checked,
1374
- });
1375
- await this.reloadAll();
1376
- this._invalidateClientModelsTree();
1312
+ await this._call('provider_toggle_model', {
1313
+ nodePath: modelPath,
1314
+ enabled: checked
1315
+ });
1316
+ await this.reloadAll();
1317
+ this._invalidateClientModelsTree();
1377
1318
  },
1378
1319
  async deleteLocalModel(modelId) {
1379
- if (!modelId)
1380
- return;
1381
- const res = await this._call('trainer_delete_model', { modelId });
1382
- if (res?.ok) {
1383
- this.notice = `Модель «${modelId}» и её веса удалены с диска.`;
1384
- await this.reloadAll();
1385
- this._invalidateClientModelsTree();
1386
- }
1320
+ if (!modelId) return;
1321
+ const res = await this._call('trainer_delete_model', {
1322
+ modelId
1323
+ });
1324
+ if (res?.ok) {
1325
+ this.notice = `Модель «${modelId}» и её веса удалены с диска.`;
1326
+ await this.reloadAll();
1327
+ this._invalidateClientModelsTree();
1328
+ }
1387
1329
  },
1388
1330
  async releaseMemory() {
1389
- const res = await this._call('trainer_release_memory');
1390
- if (res?.ok) {
1391
- this.runtime = res.runtime || this.runtime;
1392
- this.notice = 'Оперативная память и видеопамять локального ИИ освобождены.';
1393
- }
1331
+ const res = await this._call('trainer_release_memory');
1332
+ if (res?.ok) {
1333
+ this.runtime = res.runtime || this.runtime;
1334
+ this.notice = 'Оперативная память и видеопамять локального ИИ освобождены.';
1335
+ }
1394
1336
  },
1395
1337
  async downloadHalogenModel(nodeName) {
1396
- if (!nodeName)
1397
- return;
1398
- const res = await this._call('halogen_download_bundle', { models: nodeName });
1399
- if (res) {
1400
- const warn = Array.isArray(res.warnings) && res.warnings.length ? ` (${res.warnings.join(' ')})` : '';
1401
- this.notice = `Начата установка модели «${nodeName}» в /MODELS/Local…${warn}`;
1402
- await this.reloadAll();
1403
- this._invalidateClientModelsTree();
1404
- }
1338
+ if (!nodeName) return;
1339
+ const res = await this._call('halogen_download_bundle', {
1340
+ models: nodeName
1341
+ });
1342
+ if (res) {
1343
+ const warn = Array.isArray(res.warnings) && res.warnings.length ? ` (${res.warnings.join(' ')})` : '';
1344
+ this.notice = `Начата установка модели «${nodeName}» в /MODELS/Local…${warn}`;
1345
+ await this.reloadAll();
1346
+ this._invalidateClientModelsTree();
1347
+ }
1405
1348
  },
1406
1349
  async downloadHalogenBundleAll() {
1407
- const res = await this._call('halogen_download_bundle', {});
1408
- if (res) {
1409
- const warn = Array.isArray(res.warnings) && res.warnings.length ? ` (${res.warnings.join(' ')})` : '';
1410
- this.notice = `Начата установка комплекта Halo (${res.totalModels} моделей) в /MODELS/Local…${warn}`;
1411
- await this.reloadAll();
1412
- this._invalidateClientModelsTree();
1413
- }
1350
+ const res = await this._call('halogen_download_bundle', {});
1351
+ if (res) {
1352
+ const warn = Array.isArray(res.warnings) && res.warnings.length ? ` (${res.warnings.join(' ')})` : '';
1353
+ this.notice = `Начата установка комплекта Halo (${res.totalModels} моделей) в /MODELS/Local…${warn}`;
1354
+ await this.reloadAll();
1355
+ this._invalidateClientModelsTree();
1356
+ }
1414
1357
  },
1415
1358
  async buildDataset() {
1416
- const sources = [];
1417
- if (this.srcTasks)
1418
- sources.push('tasks');
1419
- if (this.srcAccounting)
1420
- sources.push('accounting');
1421
- if (this.srcClasses)
1422
- sources.push('classes');
1423
- const ds = await this._call('trainer_dataset_build', {
1424
- name: this.datasetName,
1425
- basePath: this.datasetBasePath,
1426
- sources: sources.join(','),
1427
- });
1428
- if (ds) {
1429
- this.trainDatasetName = `${ds.name}.jsonl`;
1430
- this.notice = `Обучающий набор «${ds.name}» собран (${ds.totalExamples} примеров).`;
1431
- await this.reloadAll();
1432
- }
1359
+ const sources = [];
1360
+ if (this.srcTasks) sources.push('tasks');
1361
+ if (this.srcAccounting) sources.push('accounting');
1362
+ if (this.srcClasses) sources.push('classes');
1363
+ const ds = await this._call('trainer_dataset_build', {
1364
+ name: this.datasetName,
1365
+ basePath: this.datasetBasePath,
1366
+ sources: sources.join(',')
1367
+ });
1368
+ if (ds) {
1369
+ this.trainDatasetName = `${ds.name}.jsonl`;
1370
+ this.notice = `Обучающий набор «${ds.name}» собран (${ds.totalExamples} примеров).`;
1371
+ await this.reloadAll();
1372
+ }
1433
1373
  },
1434
1374
  async startTraining() {
1435
- const job = await this._call('trainer_start', {
1436
- adapterName: this.trainAdapterName,
1437
- baseModel: this.trainBaseModel,
1438
- datasetName: this.trainDatasetName,
1439
- mode: this.trainMode,
1440
- loraR: this.trainLoraR,
1441
- maxSeqLength: this.trainMaxSeq,
1442
- basePath: this.datasetBasePath,
1443
- });
1444
- if (job) {
1445
- this.notice = `Запущено дообучение модели «${this.trainAdapterName}»…`;
1446
- await this.reloadAll();
1447
- }
1448
- },
1449
- async stopTraining(jobId) {
1450
- await this._call('trainer_stop', { jobId });
1375
+ const job = await this._call('trainer_start', {
1376
+ adapterName: this.trainAdapterName,
1377
+ baseModel: this.trainBaseModel,
1378
+ datasetName: this.trainDatasetName,
1379
+ mode: this.trainMode,
1380
+ loraR: this.trainLoraR,
1381
+ maxSeqLength: this.trainMaxSeq,
1382
+ basePath: this.datasetBasePath
1383
+ });
1384
+ if (job) {
1385
+ this.notice = `Запущено дообучение модели «${this.trainAdapterName}»…`;
1451
1386
  await this.reloadAll();
1387
+ }
1452
1388
  },
1453
- }
1389
+ async stopTraining(jobId) {
1390
+ await this._call('trainer_stop', {
1391
+ jobId
1392
+ });
1393
+ await this.reloadAll();
1394
+ }
1395
+ }
1396
+ };