odant-work 1.0.90 → 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.
- package/#system/package-manifest.json +275 -246
- package/$server/$folder/$class/$data/$catalog/$folder/$class/$data/$catalog/$virtual/class.js +4 -0
- package/$server/$folder/$class/$data/$catalog/$folder/$class/$data/$catalog/class.js +4 -0
- package/$server/$folder/$class/$data/$catalog/$virtual/$folder/$class/$data/$catalog/$virtual/class.js +4 -0
- package/$server/$folder/$class/$data/$catalog/$virtual/class.js +8 -0
- package/{MODULES/Register/CATALOGS/$catalog/$folder/$class → $server/$folder/$class/$data}/$catalog/class.js +1 -0
- package/$server/$folder/$class/$data/$operation/$folder/$class/$data/$operation/class.js +4 -0
- package/{MODULES/Register/OPERATIONS/$operation/$folder/$class → $server/$folder/$class/$data}/$operation/class.js +1 -0
- package/$server/$folder/$class/$data/$register/$account/$folder/$class/$data/$register/$account/class.js +4 -0
- package/$server/$folder/$class/$data/$register/$account/class.js +8 -0
- package/$server/$folder/$class/$data/$register/$folder/$class/$data/$register/$account/class.js +4 -0
- package/$server/$folder/$class/$data/$register/$folder/$class/$data/$register/class.js +4 -0
- package/$server/$folder/$class/$data/$register/class.js +8 -0
- package/$server/$folder/$class/$data/$struct/$folder/$class/$data/$struct/class.js +4 -0
- package/$server/$folder/$class/$data/$struct/class.js +5 -0
- package/$server/$folder/$class/$data/class.js +5 -0
- package/$server/$folder/$class/$data/handlers/pages/form/objects/$handler/class.js +2158 -0
- package/$server/$folder/$class/$data/handlers/pages/form/objects/object/$handler/class.js +1377 -0
- package/$server/$folder/$class/$domain/$folder/$class/$domain/class.js +4 -0
- package/$server/$folder/$class/$domain/handlers/methods/restore/$handler/class.js +5 -5
- package/$server/$folder/$class/$domain/readme.md +1 -1
- package/$server/$folder/$class/$handler/$method/class.js +4 -0
- package/$server/$folder/$class/$handler/$timer/class.js +4 -0
- package/$server/$folder/$class/$module/$folder/$class/$data/$catalog/class.js +4 -0
- package/$server/$folder/$class/$module/$folder/$class/$data/$operation/class.js +4 -0
- package/$server/$folder/$class/$module/$folder/$class/$data/$register/class.js +4 -0
- package/$server/$folder/$class/$module/$folder/$class/$data/$struct/class.js +4 -0
- package/$server/$folder/$class/$module/$folder/$class/$domain/class.js +4 -0
- package/$server/$folder/$class/$module/$folder/$class/$module/class.js +4 -0
- package/$server/$folder/$class/$module/class.js +418 -6
- package/$server/$folder/$class/{handlers/pages/form/system/$handler/tabs/mcp.js → $module/handlers/pages/form/system/mcp/$handler/class.js} +261 -220
- package/$server/$folder/$class/$module/handlers/pages/form/system/modules/$handler/class.js +7 -0
- package/$server/$folder/$class/$structure/$folder/$class/$structure/class.js +4 -0
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$catalog/class.js +4 -0
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$operation/class.js +4 -0
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$register/class.js +4 -0
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$struct/class.js +4 -0
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$domain/class.js +4 -0
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$module/class.js +4 -0
- package/{ORGANIZATIONS/$domain/$folder/$class/$base → $server/$folder/$class/$structure/$organization/$folder/$class/$structure/$organization}/class.js +4 -5
- package/$server/$folder/$class/$structure/$organization/$folder/$class/$structure/class.js +4 -0
- package/{ORGANIZATIONS/$domain/$folder/$class/$base/$folder/$class/$structure/$base → $server/$folder/$class/$structure/$organization}/class.js +19 -17
- package/$server/$folder/$class/$structure/$organization/handlers/pages/form/system/requisites/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/{$base/handlers/pages/site/$handler/site.js → $organization/handlers/pages/site/$handler/class.js} +352 -365
- package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$catalog/class.js +4 -0
- package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$operation/class.js +4 -0
- package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$register/class.js +4 -0
- package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$struct/class.js +4 -0
- package/$server/$folder/$class/$structure/$project/$folder/$class/$domain/class.js +4 -0
- package/$server/$folder/$class/$structure/$project/$folder/$class/$module/class.js +4 -0
- package/$server/$folder/$class/$structure/$project/class.js +1 -0
- package/$server/$folder/$class/$structure/$project/readme.md +1 -1
- package/$server/$folder/$class/$structure/$server/$folder/$class/$domain/class.js +4 -0
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/database/$handler/class.js +3 -0
- package/$server/$folder/$class/{handlers/pages/form/system/$handler/tabs/license.js → $structure/$server/handlers/pages/form/system/license/$handler/class.js} +104 -103
- package/$server/$folder/$class/$structure/$server/handlers/pages/site/$handler/{site.js → class.js} +45 -30
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/modules/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/profile/$handler/class.js +18 -0
- package/$server/$folder/$class/$structure/ai/system.md +1 -1
- package/$server/$folder/$class/$structure/class.js +1 -1
- package/$server/$folder/$class/$structure/handlers/methods/archive/$handler/class.js +3 -3
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js +309 -8
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js +15 -4
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js +1281 -7
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +2216 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/class.js +1304 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/methods/refresh/$method/class.js +1 -1
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/class.js +305 -9
- package/$server/$folder/$class/{handlers/pages/form/system/$handler/tabs/agent.js → $structure/handlers/pages/form/system/agent/$handler/class.js} +329 -320
- package/$server/$folder/$class/{handlers/pages/form/system/$handler/tabs/database.js → $structure/handlers/pages/form/system/database/$handler/class.js} +510 -577
- package/$server/$folder/$class/{handlers/pages/form/system/$handler/tabs/messengers.js → $structure/handlers/pages/form/system/messengers/$handler/class.js} +143 -144
- package/$server/$folder/$class/$structure/handlers/pages/form/system/modules/$handler/class.js +270 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +2114 -0
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js +229 -4
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/readme.md +1 -1
- package/$server/$folder/$class/$structure/readme.md +3 -3
- package/$server/$folder/$class/$users/$folder/$class/$structure/$user/class.js +4 -0
- package/$server/$folder/$class/$users/class.js +4 -0
- package/$server/$folder/$class/ai/agents/integrator-1c.md +1 -1
- package/$server/$folder/$class/ai/agents/it-admin.md +1 -1
- package/$server/$folder/$class/ai/agents/org-architect.md +4 -4
- package/$server/$folder/$class/ai/agents/readme.md +1 -1
- package/$server/$folder/$class/ai/agents/schema-validator.md +2 -2
- package/$server/$folder/$class/ai/skills/lan-inventory.md +2 -2
- package/$server/$folder/$class/ai/skills/org-structure.md +1 -1
- package/$server/$folder/$class/ai/skills/printer-setup.md +1 -1
- package/$server/$folder/$class/ai/skills/telegram-notify.md +2 -2
- package/$server/$folder/$class/ai/skills/work-scenarios.md +3 -3
- package/$server/$folder/$class/ai/system.md +14 -8
- package/$server/$folder/$class/class.js +2 -6
- package/$server/$folder/$class/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$class/handlers/pages/form/system/$handler/class.js +2 -4
- package/$server/$folder/$class/handlers/pages/form/system/files/$handler/class.js +7 -0
- package/$server/$folder/$class/handlers/pages/form/system/requisites/$handler/class.js +100 -0
- package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +25 -6
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/class.js +32 -5
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/class.js +31 -3
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/class.js +11 -3
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/class.js +83 -3
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/class.js +61 -3
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/class.js +1699 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +827 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/readme.md +1 -1
- package/$server/$folder/$file/handlers/pages/form/file/$handler/class.js +33 -3
- package/$server/$folder/$file/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/handlers/methods/create/$handler/class.js +5 -5
- package/$server/$folder/handlers/pages/form/$handler/class.js +2467 -3
- package/$server/$folder/handlers/pages/form/folder/$handler/class.js +22 -0
- package/$server/$folder/handlers/readme.md +1 -1
- package/$server/$folder/lib/chat-item/chat-item.js +5 -10
- package/$server/$folder/lib/consultant/consultant.js +7 -10
- package/$server/$folder/lib/explorer/explorer.js +1 -1
- package/$server/$folder/lib/icon/icon.js +1 -1
- package/$server/$folder/lib/menu/menu.js +3 -2
- package/$server/$folder/lib/messenger-settings/messenger-settings.js +4 -4
- package/$server/$folder/lib/node/node.js +3 -3
- package/$server/$folder/lib/prompt-bar/prompt-bar.js +2 -2
- package/$server/$folder/lib/role/role.js +1 -2
- package/$server/$folder/lib/security/admin/admin.js +3 -3
- package/$server/$folder/lib/security/security.js +4 -4
- package/$server/$folder/lib/security/users/users.js +2 -5
- package/$server/$folder/lib/site-loc/site-loc.js +3 -3
- package/$server/$folder/lib/tree/tree.js +14 -22
- package/$server/class.js +1 -0
- package/AGENTS.md +21 -13
- package/{$server/$folder/$class/handlers/pages/form/system/$handler/tabs/ai-model.js → MODELS/$ai/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js} +385 -425
- package/{$server/$folder/$class/handlers/pages/form/system/$handler/tabs/ai-provider.js → MODELS/$ai/$folder/$class/$provider/handlers/pages/form/system/ai/$handler/class.js} +157 -161
- package/{$server/$folder/$class/handlers/pages/form/system/$handler/tabs/ai-root.js → MODELS/$ai/handlers/pages/form/system/ai/$handler/class.js} +34 -33
- package/{$server/$folder/$class/handlers/pages/form/system/$handler/tabs/ai-local.js → MODELS/Local/$provider/handlers/pages/form/system/ai/$handler/class.js} +572 -622
- package/MODULES/$domain/class.js +85 -4
- package/MODULES/$domain/handlers/pages/form/system/mcp/$handler/class.js +7 -0
- package/MODULES/$domain/readme.md +7 -6
- package/{SERVICES/1C/$service → MODULES/1C/$module}/class.js +7 -1
- package/MODULES/2GIS/$module/class.js +32 -0
- package/MODULES/2GIS/$module/readme.md +57 -0
- package/{SERVICES/Bitrix24/$service → MODULES/Bitrix24/$module}/class.js +7 -2
- package/{SERVICES/CBR/$service → MODULES/CBR/$module}/class.js +5 -0
- package/{SERVICES/DaData/$service → MODULES/DaData/$module}/class.js +9 -3
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +648 -21
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +140 -6
- package/{SERVICES/Marketplaces/$service → MODULES/Marketplaces/$domain}/class.js +1 -1
- package/{SERVICES/Marketplaces/Ozon/$service → MODULES/Marketplaces/Ozon/$module}/class.js +1 -1
- package/{SERVICES/Marketplaces/Wildberries/$service → MODULES/Marketplaces/Wildberries/$module}/class.js +1 -1
- package/{SERVICES/Marketplaces/YandexMarket/$service → MODULES/Marketplaces/YandexMarket/$module}/class.js +1 -1
- package/MODULES/Process/$module/readme.md +1 -1
- 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 -6
- 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 -6
- 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 -16
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/{$virtual → $data/$catalog/$virtual}/class.js +3 -0
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/objects/$handler/class.js +3 -0
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/{$virtual/handlers/pages/form/virtual/$handler/virtual.js → $data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js} +413 -390
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/class.js +14 -0
- package/MODULES/Register/CATALOGS/$catalog/class.js +7 -14
- package/MODULES/Register/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270/$virtual/$folder/$class/$data/$catalog/$virtual/class.js +9 -0
- package/MODULES/Register/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270/$virtual/class.js +0 -7
- package/MODULES/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213/$catalog/$folder/$class/$data/$catalog/class.js +11 -0
- package/MODULES/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213/$catalog/class.js +0 -9
- package/MODULES/Register/OPERATIONS/$operation/$folder/$class/$data/$operation/class.js +16 -0
- package/MODULES/Register/OPERATIONS/$operation/class.js +0 -9
- package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213/$operation/$folder/$class/$data/$operation/class.js +8 -0
- package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213/$operation/class.js +4 -10
- package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260/$operation/$folder/$class/$data/$operation/class.js +8 -0
- package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260/$operation/class.js +0 -6
- package/MODULES/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$operation/$folder/$class/$data/$operation/class.js +8 -0
- package/MODULES/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$operation/class.js +4 -10
- package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/$folder/$class/$data/$operation/class.js" +10 -0
- package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/class.js" +4 -12
- package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202/$operation/$folder/$class/$data/$operation/class.js" +10 -0
- package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202/$operation/class.js" +4 -12
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217/$operation/$folder/$class/$data/$operation/class.js +24 -0
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217/$operation/class.js +0 -22
- package/MODULES/Register/REGISTER/$register/$folder/$class/{$account/handlers/pages/form/analysis/$handler/analysis.js → $data/$register/$account/handlers/pages/form/analysis/$handler/class.js} +9 -4
- package/MODULES/Register/REGISTER/$register/$folder/$class/{$account/handlers/pages/form/postings/$handler/postings.js → $data/$register/$account/handlers/pages/form/postings/$handler/class.js} +845 -753
- package/MODULES/Register/REGISTER/$register/$folder/$class/{$account/handlers/pages/form/turnovers/$handler/turnovers.js → $data/$register/$account/handlers/pages/form/turnovers/$handler/class.js} +9 -4
- package/MODULES/Register/REGISTER/$register/{$folder/$class/$register/handlers/pages/form/journal/$handler/journal.js → handlers/pages/form/journal/$handler/class.js} +382 -329
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js +807 -0
- package/MODULES/Register/REGISTER/10/$account/$folder/$class/$data/$register/$account/class.js +21 -0
- package/MODULES/Register/REGISTER/10/$account/class.js +0 -19
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213/$account/$folder/$class/$data/$register/$account/class.js +14 -0
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213/$account/class.js +4 -16
- package/{SERVICES/SearXNG/$service → MODULES/SearXNG/$module}/class.js +5 -0
- package/{SERVICES/Yandex/$service → MODULES/Yandex/$module}/class.js +7 -0
- package/{SERVICES/YandexDisk/$service → MODULES/YandexDisk/$module}/class.js +8 -2
- package/NODES/$node/handlers/pages/form/network/$handler/class.js +122 -5
- package/ORGANIZATIONS/$domain/$folder/$class/$structure/$organization/class.js +5 -0
- package/ORGANIZATIONS/$domain/class.js +5 -5
- package/oda/components/inputs/link/link.js +1 -1
- package/package.json +1 -1
- package/readme.md +6 -7
- package/scripts/check-architecture.mjs +541 -0
- package/scripts/cleanup-storage.mjs +1 -1
- package/scripts/demo-seed.mjs +3 -3
- package/scripts/import-bis.mjs +33 -15
- package/scripts/import-delovaya.mjs +26 -14
- package/sources/client/class.js +19 -10
- package/sources/client/folder.js +10 -22
- package/sources/client/handler.js +75 -33
- package/sources/data/api.js +9 -10
- package/sources/data/classes.js +85 -9
- package/sources/data/db.js +10 -6
- package/sources/data/print.js +15 -41
- package/sources/data/readme.md +5 -5
- package/sources/data/schema.js +206 -118
- package/sources/data/sql-inspector.js +7 -7
- package/sources/host/auth-methods.js +2 -5
- package/sources/host/auto-updater.js +1 -2
- package/sources/host/babel-merge.js +174 -129
- package/sources/host/prewarm.js +1 -1
- package/sources/host/watch.js +1 -1
- package/sources/index.html +1 -1
- package/sources/modules/agent/extensions.js +48 -38
- package/sources/modules/agent/index.js +1 -1
- package/sources/modules/agent/node-rules.js +69 -41
- package/sources/modules/agent/permissions.js +1 -1
- package/sources/modules/agent/plugins.js +11 -11
- package/sources/modules/agent/resources.js +96 -52
- package/sources/modules/agent/tools/net.js +1 -1
- package/sources/modules/agent/tools/services.js +7 -7
- package/sources/modules/agent/tools/work/access.js +10 -8
- package/sources/modules/agent/tools/work/classes.js +26 -47
- package/sources/modules/agent/tools/work/common.js +8 -10
- package/sources/modules/agent/tools/work/data.js +4 -4
- package/sources/modules/agent/triggers.js +1 -1
- package/sources/modules/agent/twin-bus.js +4 -4
- package/sources/modules/agent/voice.js +1 -1
- package/sources/modules/call/call.js +4 -4
- package/sources/modules/kladr/index.js +3 -3
- package/sources/modules/lan/register.js +7 -7
- package/sources/modules/mcp-marketplaces/ozon.js +1 -1
- package/sources/modules/mcp-marketplaces/wildberries.js +1 -1
- package/sources/modules/mcp-marketplaces/yandex-market.js +1 -1
- package/sources/modules/nodes/mount.js +2 -4
- package/sources/modules/notify/index.js +18 -18
- package/sources/modules/rag/extract.js +9 -2
- package/sources/modules/rag/indexer.js +1 -1
- package/sources/modules/rag/scope.js +7 -33
- package/sources/modules/trainer/dataset.js +2 -2
- package/sources/modules/trainer/local-engine.js +1 -1
- package/sources/page.html +2 -2
- package/sources/readme.md +1 -1
- package/sources/server/access/gateway.js +19 -19
- package/sources/server/access/invites.js +4 -5
- package/sources/server/access/links.js +10 -8
- package/sources/server/access/policy.js +65 -39
- package/sources/server/access/workplaces.js +20 -14
- package/sources/server/chat-threads.js +4 -4
- package/sources/server/class/archive.js +15 -15
- package/sources/server/class/base-template.js +13 -9
- package/sources/server/class/distro.js +3 -4
- package/sources/server/class/feed.js +3 -3
- package/sources/server/class/mail-calendar.js +9 -8
- package/sources/server/class/scaffold.js +110 -60
- package/sources/server/class/search.js +2 -2
- package/sources/server/class/security.js +76 -94
- package/sources/server/class.js +181 -64
- package/sources/server/file.js +2 -2
- package/sources/server/folder.js +376 -191
- package/sources/server/handler.js +52 -13
- package/sources/server/logs.js +7 -7
- package/sources/server/node.js +12 -43
- package/sources/server/server.js +16 -17
- package/$server/$folder/$class/$device/class.js +0 -3
- package/$server/$folder/$class/$handler/$task/class.js +0 -3
- package/$server/$folder/$class/$service/$class/$service/class.js +0 -4
- package/$server/$folder/$class/$structure/$base/class.js +0 -10
- package/$server/$folder/$class/$structure/$base/roots_1/roots.test +0 -0
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js +0 -313
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js +0 -16
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +0 -1226
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +0 -2217
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +0 -1188
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/search.js +0 -289
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js +0 -240
- package/$server/$folder/$class/handlers/pages/form/object/$handler/class.js +0 -33
- package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +0 -1371
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/class.js +0 -33
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +0 -2130
- package/$server/$folder/$class/handlers/pages/form/system/$handler/system.js +0 -384
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/modules.js +0 -244
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/staff.js +0 -2126
- package/$server/$folder/$class/handlers/pages/storage/$handler/storage.js +0 -21
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/editor.js +0 -27
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/file.js +0 -31
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/file.js +0 -10
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/file.js +0 -72
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/file.js +0 -63
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/file.js +0 -1845
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/file.js +0 -785
- package/$server/$folder/$file/handlers/pages/form/file/$handler/file.js +0 -29
- package/$server/$folder/handlers/pages/form/$handler/form.js +0 -2122
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js +0 -623
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js +0 -134
- 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
- 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
- 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
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$virtual/handlers/pages/form/virtual/$handler/class.js +0 -6
- package/MODULES/Register/REGISTER/$register/$folder/$class/$account/handlers/pages/form/analysis/$handler/class.js +0 -9
- package/MODULES/Register/REGISTER/$register/$folder/$class/$account/handlers/pages/form/postings/$handler/class.js +0 -9
- package/MODULES/Register/REGISTER/$register/$folder/$class/$account/handlers/pages/form/turnovers/$handler/class.js +0 -9
- package/MODULES/Register/REGISTER/$register/$folder/$class/$register/handlers/pages/form/journal/$handler/class.js +0 -6
- package/MODULES/Register/REGISTER/$register/$folder/$class/$register/handlers/pages/form/sheet/$handler/class.js +0 -6
- package/MODULES/Register/REGISTER/$register/$folder/$class/$register/handlers/pages/form/sheet/$handler/sheet.js +0 -808
- package/NODES/$node/handlers/pages/form/network/$handler/network.js +0 -110
- package/SERVICES/$service/$folder/$storage/$service/class.js +0 -8
- package/SERVICES/$service/class.js +0 -442
- package/SERVICES/readme.md +0 -36
- /package/$server/$folder/$class/$structure/{$base → $organization}/icon.png +0 -0
- /package/{SERVICES/DuckDuckGo/$service → MODULES/DuckDuckGo/$module}/class.js +0 -0
- /package/MODULES/KLADR/$module/$folder/$class/{$catalog → $data/$catalog}/class.js +0 -0
- /package/MODULES/Process/$module/$folder/$class/{$catalog → $data/$catalog}/class.js +0 -0
- /package/MODULES/Register/$module/$folder/$class/{$catalog → $data/$catalog}/class.js +0 -0
- /package/MODULES/Register/$module/$folder/$class/{$operation → $data/$operation}/class.js +0 -0
- /package/MODULES/Register/$module/$folder/$class/{$register → $data/$register}/class.js +0 -0
- /package/MODULES/Register/$module/$folder/$class/{$struct → $data/$struct}/class.js +0 -0
- /package/MODULES/Register/CATALOGS/$catalog/$folder/$class/{$virtual/$folder/$class → $data/$catalog/$virtual/$folder/$class/$data/$catalog}/$virtual/class.js +0 -0
- /package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/{print → $folder/$class/$data/$operation/print}//320/237/320/273/320/260/321/202/321/221/320/266/320/275/320/276/320/265 /320/277/320/276/321/200/321/203/321/207/320/265/320/275/320/270/320/265.html" +0 -0
- /package/MODULES/Register/REGISTER/$register/$folder/$class/{$account → $data/$register/$account}/class.js +0 -0
- /package/MODULES/Register/REGISTER/$register/$folder/$class/{$account → $data/$register/$account}/readme.md +0 -0
- /package/MODULES/Register/REGISTER/$register/$folder/$class/{$register → $data/$register}/class.js +0 -0
- /package/MODULES/Register/STRUCTS/$struct/$folder/$class/{$struct → $data/$struct}/class.js +0 -0
- /package/{SERVICES/RuCalendar/$service → MODULES/RuCalendar/$module}/class.js +0 -0
- /package/{SERVICES/Telegram/$service → MODULES/Telegram/$module}/class.js +0 -0
- /package/{SERVICES/Weather/$service → MODULES/Weather/$module}/class.js +0 -0
- /package/PROJECTS/$domain/$folder/$class/{$project → $structure/$project}/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>
|
|
@@ -605,7 +604,7 @@ export default {
|
|
|
605
604
|
<div class="card">
|
|
606
605
|
<div class="section-title">Шаг 1. Собрать обучающий набор из организации</div>
|
|
607
606
|
<div class="field">
|
|
608
|
-
<label>Организация ($
|
|
607
|
+
<label>Организация ($organization)</label>
|
|
609
608
|
<input :value="datasetBasePath" placeholder="/ORGANIZATIONS/Моё предприятие" @input="datasetBasePath = $this.value">
|
|
610
609
|
</div>
|
|
611
610
|
<div class="field">
|
|
@@ -678,21 +677,35 @@ export default {
|
|
|
678
677
|
</div>
|
|
679
678
|
</div>
|
|
680
679
|
`,
|
|
680
|
+
$item: {
|
|
681
|
+
$def: null,
|
|
682
|
+
set(n) {
|
|
683
|
+
if (n) this.reloadAll().then(() => this.searchHf());
|
|
684
|
+
}
|
|
685
|
+
},
|
|
681
686
|
activeTab: 'models',
|
|
682
687
|
get trainerTabItems() {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
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
|
+
}];
|
|
687
701
|
},
|
|
688
702
|
get trainerTabIndex() {
|
|
689
|
-
|
|
690
|
-
|
|
703
|
+
const idx = this.trainerTabItems.findIndex(t => t.id === this.activeTab);
|
|
704
|
+
return idx >= 0 ? idx : 0;
|
|
691
705
|
},
|
|
692
706
|
onTrainerTabSelect(e) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
this.activeTab = id;
|
|
707
|
+
const id = e?.detail?.item?.id;
|
|
708
|
+
if (id) this.activeTab = id;
|
|
696
709
|
},
|
|
697
710
|
hardware: null,
|
|
698
711
|
runtime: null,
|
|
@@ -738,709 +751,646 @@ export default {
|
|
|
738
751
|
installingPythonDeps: false,
|
|
739
752
|
checkAllResult: null,
|
|
740
753
|
_pollTimer: null,
|
|
741
|
-
|
|
742
754
|
get missingPythonPkgs() {
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
set.add(dep);
|
|
755
|
-
}
|
|
756
|
-
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];
|
|
757
766
|
},
|
|
758
|
-
|
|
759
767
|
get hasNetworkChanges() {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
return true;
|
|
775
|
-
if (this.netClearProxy && Boolean(savedProxy || n.hasProxy))
|
|
776
|
-
return true;
|
|
777
|
-
if (String(this.netProxy || '').trim() !== savedProxy)
|
|
778
|
-
return true;
|
|
779
|
-
if (this.netClearToken && Boolean(n.hasToken))
|
|
780
|
-
return true;
|
|
781
|
-
if (String(this.netToken || '').trim() !== '')
|
|
782
|
-
return true;
|
|
783
|
-
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;
|
|
784
782
|
},
|
|
785
783
|
get networkSummary() {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
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}`;
|
|
791
789
|
},
|
|
792
|
-
|
|
793
790
|
get categoryTabs() {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
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
|
+
}];
|
|
805
828
|
},
|
|
806
829
|
get activeDownloads() {
|
|
807
|
-
|
|
830
|
+
return (this.downloads || []).filter(d => d.status === 'downloading');
|
|
808
831
|
},
|
|
809
832
|
get activeTransfers() {
|
|
810
|
-
|
|
833
|
+
return (this.transfers || []).filter(t => t.status === 'running');
|
|
811
834
|
},
|
|
812
835
|
get hasAvailableHalo() {
|
|
813
|
-
|
|
814
|
-
!h.weightsDownloaded
|
|
815
|
-
&& !this.isRepoInstalled(h.hfRepo, h.nodeName)
|
|
816
|
-
&& !this.getDownloadEntry(h.hfRepo, h.nodeName)
|
|
817
|
-
);
|
|
836
|
+
return (this.halogenCatalog || []).some(h => !h.weightsDownloaded && !this.isRepoInstalled(h.hfRepo, h.nodeName) && !this.getDownloadEntry(h.hfRepo, h.nodeName));
|
|
818
837
|
},
|
|
819
838
|
get unifiedModels() {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
const shortRepo = repoLow ? repoLow.split('/').pop() : '';
|
|
836
|
-
return list.find(x =>
|
|
837
|
-
(idLow && (x.id?.toLowerCase() === idLow || x.download?.folderName?.toLowerCase() === idLow))
|
|
838
|
-
|| (repoLow && x.repoId?.toLowerCase() === repoLow)
|
|
839
|
-
|| (shortRepo && x.id?.toLowerCase() === shortRepo)
|
|
840
|
-
) || null;
|
|
841
|
-
};
|
|
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
|
+
};
|
|
842
854
|
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
// 2. Активные, приостановленные и упавшие загрузки (в т.ч. .part на диске)
|
|
876
|
-
for (const d of this.downloads || []) {
|
|
877
|
-
if (d.status === 'completed' || d.status === 'cancelled')
|
|
878
|
-
continue;
|
|
879
|
-
const halo = haloByNode.get(String(d.folderName || '').toLowerCase())
|
|
880
|
-
|| haloByRepo.get(String(d.repoId || '').toLowerCase());
|
|
881
|
-
const existing = findEntry(d.folderName, d.repoId);
|
|
882
|
-
const state = d.status === 'downloading' ? 'downloading' : (d.status === 'failed' ? 'failed' : 'paused');
|
|
883
|
-
const progressPct = d.totalBytes > 0
|
|
884
|
-
? Math.min(99, Math.max(0, Number(d.progress) || Math.round((d.downloadedBytes / d.totalBytes) * 100)))
|
|
885
|
-
: (d.downloadedBytes > 0 ? 15 : 0);
|
|
886
|
-
const etaText = d.stalled ? '' : this.formatEta(d.etaSeconds);
|
|
887
|
-
if (existing) {
|
|
888
|
-
if (existing.state !== 'installed') {
|
|
889
|
-
existing.state = state;
|
|
890
|
-
existing.dotClass = state === 'downloading' ? 'on' : 'warn';
|
|
891
|
-
existing.download = d;
|
|
892
|
-
existing.progressPct = progressPct;
|
|
893
|
-
existing.etaText = etaText;
|
|
894
|
-
}
|
|
895
|
-
continue;
|
|
896
|
-
}
|
|
897
|
-
list.push({
|
|
898
|
-
key: `dl:${d.id || d.folderName}`,
|
|
899
|
-
id: d.folderName || halo?.nodeName || d.repoId,
|
|
900
|
-
repoId: d.repoId || halo?.hfRepo || '',
|
|
901
|
-
label: halo?.label || d.label || d.folderName || d.repoId,
|
|
902
|
-
desc: halo?.role || d.repoId || `Папка модели: ${d.folderName}/$ai/#weights`,
|
|
903
|
-
icon: halo?.icon || 'ai:ollama',
|
|
904
|
-
modality: halo?.modality || d.modality || 'llm',
|
|
905
|
-
isHalo: Boolean(halo),
|
|
906
|
-
state,
|
|
907
|
-
dotClass: state === 'downloading' ? 'on' : 'warn',
|
|
908
|
-
ramGb: halo?.ramGb || 4,
|
|
909
|
-
fit: 'optimal',
|
|
910
|
-
device: halo?.device || '',
|
|
911
|
-
download: d,
|
|
912
|
-
progressPct,
|
|
913
|
-
etaText,
|
|
914
|
-
});
|
|
915
|
-
}
|
|
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
|
+
}
|
|
916
885
|
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
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
|
+
}
|
|
943
923
|
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
download: null,
|
|
970
|
-
progressPct: 0,
|
|
971
|
-
etaText: '',
|
|
972
|
-
});
|
|
973
|
-
}
|
|
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
|
+
}
|
|
974
949
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
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));
|
|
994
997
|
},
|
|
995
998
|
formatEta(sec) {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
const h = Math.floor(s / 3600);
|
|
1004
|
-
const m = Math.floor((s % 3600) / 60);
|
|
1005
|
-
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} мин`;
|
|
1006
1006
|
},
|
|
1007
1007
|
fmtDownloadBytes(bytes) {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
if (b < 1024 ** 3)
|
|
1014
|
-
return `${(b / (1024 * 1024)).toFixed(1)} МБ`;
|
|
1015
|
-
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)} ГБ`;
|
|
1016
1013
|
},
|
|
1017
1014
|
isRepoInstalled(repoId, nodeName = '') {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|| (nodeLower && mId === nodeLower)
|
|
1028
|
-
|| (repoLower && mModel === repoLower);
|
|
1029
|
-
});
|
|
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
|
+
});
|
|
1030
1024
|
},
|
|
1031
1025
|
getDownloadEntry(repoId, nodeName = '') {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
return (this.downloads || []).find(d =>
|
|
1035
|
-
(d.status === 'downloading' || d.status === 'paused' || d.status === 'failed')
|
|
1036
|
-
&& ((repoId && d.repoId === repoId) || (nodeName && d.folderName === nodeName))
|
|
1037
|
-
) || 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;
|
|
1038
1028
|
},
|
|
1039
1029
|
async attached() {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|| (this.jobs || []).some(j => j.status === 'running')
|
|
1048
|
-
) {
|
|
1049
|
-
this.reloadAll();
|
|
1050
|
-
}
|
|
1051
|
-
}, 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);
|
|
1052
1037
|
},
|
|
1053
1038
|
detached() {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1039
|
+
if (this._pollTimer) {
|
|
1040
|
+
clearInterval(this._pollTimer);
|
|
1041
|
+
this._pollTimer = null;
|
|
1042
|
+
}
|
|
1058
1043
|
},
|
|
1059
1044
|
async _call(method, params = {}) {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
return null;
|
|
1069
|
-
}
|
|
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
|
+
}
|
|
1070
1053
|
},
|
|
1071
1054
|
async checkAllModels() {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
finally {
|
|
1088
|
-
this.checkingAll = false;
|
|
1089
|
-
}
|
|
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
|
+
}
|
|
1090
1070
|
},
|
|
1091
1071
|
async installMissingPythonDeps() {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
this.installingPythonDeps = false;
|
|
1112
|
-
}
|
|
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
|
+
}
|
|
1113
1091
|
},
|
|
1114
1092
|
_invalidateClientModelsTree() {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
delete node[w.R].cache.items;
|
|
1125
|
-
node?.reset?.();
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
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?.();
|
|
1128
1102
|
}
|
|
1129
|
-
|
|
1130
|
-
}
|
|
1103
|
+
}
|
|
1104
|
+
} catch {/* ignore cross-frame */}
|
|
1105
|
+
}
|
|
1131
1106
|
},
|
|
1132
1107
|
async reloadAll() {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
this.halogenCatalog = st.halogen.catalog;
|
|
1161
|
-
this.halogenPrepareState = st.halogen?.windowsEnv?.prepareState || null;
|
|
1162
|
-
if (this.localModels.length !== prevCount)
|
|
1163
|
-
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();
|
|
1164
1135
|
},
|
|
1165
1136
|
lowSpeedHint(dl) {
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
if (dl?.sourceLabel === 'hf-mirror' || String(dl?.endpointUrl || '').includes('hf-mirror'))
|
|
1172
|
-
return `Низкая скорость на HF-Mirror (${sp} МБ/с). Попробуйте указать прокси или включить VPN.`;
|
|
1173
|
-
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 или указать прокси для моделей.`;
|
|
1174
1142
|
},
|
|
1175
1143
|
_applyNetworkState(n) {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
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;
|
|
1188
1155
|
},
|
|
1189
1156
|
toggleNetworkPanel() {
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
if (this.networkOpen)
|
|
1194
|
-
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();
|
|
1195
1160
|
},
|
|
1196
1161
|
openNetworkPanel() {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
this._focusNetworkPanel();
|
|
1162
|
+
this.networkOpen = true;
|
|
1163
|
+
if (this.network && !this.hasNetworkChanges) this._applyNetworkState(this.network);
|
|
1164
|
+
this._focusNetworkPanel();
|
|
1201
1165
|
},
|
|
1202
1166
|
_focusNetworkPanel() {
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
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);
|
|
1208
1175
|
},
|
|
1209
1176
|
onNetworkPresetChange(val) {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
this.netEndpoint = 'https://huggingface.co';
|
|
1213
|
-
else if (this.netPreset === 'hf-mirror')
|
|
1214
|
-
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';
|
|
1215
1179
|
},
|
|
1216
1180
|
setNetworkField(field, val) {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
if (field === 'netToken' && String(val || '').trim())
|
|
1221
|
-
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;
|
|
1222
1184
|
},
|
|
1223
1185
|
async saveNetworkSettings() {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
const extra = res.restartedCount > 0
|
|
1247
|
-
? ` · активных загрузок перезапущено на новых настройках: ${res.restartedCount}`
|
|
1248
|
-
: '';
|
|
1249
|
-
this.notice = `Сетевые настройки загрузчика сохранены (${res.sourceLabel}, ${res.threads} потоков${extra}).`;
|
|
1250
|
-
if (res.restartedCount > 0)
|
|
1251
|
-
await this.reloadAll();
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
finally {
|
|
1255
|
-
this.netBusy = false;
|
|
1256
|
-
}
|
|
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
|
+
}
|
|
1257
1208
|
},
|
|
1258
1209
|
clearNetworkProxy() {
|
|
1259
|
-
|
|
1260
|
-
|
|
1210
|
+
this.netProxy = '';
|
|
1211
|
+
this.netClearProxy = Boolean(this.network?.hasProxy || this.network?.proxyUrl);
|
|
1261
1212
|
},
|
|
1262
1213
|
clearNetworkToken() {
|
|
1263
|
-
|
|
1264
|
-
|
|
1214
|
+
this.netToken = '';
|
|
1215
|
+
this.netClearToken = Boolean(this.network?.hasToken);
|
|
1265
1216
|
},
|
|
1266
1217
|
async setModality(mod) {
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1218
|
+
this.hfModality = String(mod || 'all');
|
|
1219
|
+
if (this.hfModality !== 'halo' && this.hfModality !== 'installed') {
|
|
1220
|
+
await this.searchHf();
|
|
1221
|
+
}
|
|
1271
1222
|
},
|
|
1272
1223
|
async installUnifiedModel(item) {
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
if (item.buboPackage || item.haloNodeName)
|
|
1280
|
-
await this.downloadHalogenModel(item.haloNodeName || 'Qwen3.8-Flash-Next');
|
|
1281
|
-
else if (item.isHalo)
|
|
1282
|
-
await this.downloadHalogenModel(item.id);
|
|
1283
|
-
else
|
|
1284
|
-
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);
|
|
1285
1230
|
},
|
|
1286
1231
|
async pauseDownload(item) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
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();
|
|
1293
1239
|
},
|
|
1294
1240
|
async resumeDownload(item) {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
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
|
+
}
|
|
1306
1252
|
},
|
|
1307
1253
|
async discardDownload(item) {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
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();
|
|
1315
1261
|
},
|
|
1316
1262
|
async setHfFilter(val) {
|
|
1317
|
-
|
|
1318
|
-
|
|
1263
|
+
this.hfFilter = String(val || 'all');
|
|
1264
|
+
await this.searchHf();
|
|
1319
1265
|
},
|
|
1320
1266
|
async searchHf() {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
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;
|
|
1328
1273
|
},
|
|
1329
1274
|
async installModelOneClick(repoId) {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
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
|
+
}
|
|
1343
1287
|
},
|
|
1344
1288
|
async cancelDownload(jobId) {
|
|
1345
|
-
|
|
1346
|
-
|
|
1289
|
+
await this._call('trainer_hf_cancel', {
|
|
1290
|
+
jobId
|
|
1291
|
+
});
|
|
1292
|
+
await this.reloadAll();
|
|
1347
1293
|
},
|
|
1348
1294
|
async cancelTransfer(jobId) {
|
|
1349
|
-
|
|
1350
|
-
|
|
1295
|
+
await this._call('trainer_transfer_cancel', {
|
|
1296
|
+
jobId
|
|
1297
|
+
});
|
|
1298
|
+
await this.reloadAll();
|
|
1351
1299
|
},
|
|
1352
1300
|
async openTransferDialog(mode = 'export') {
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
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();
|
|
1362
1310
|
},
|
|
1363
1311
|
async toggleLocalModel(modelPath, checked) {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1312
|
+
await this._call('provider_toggle_model', {
|
|
1313
|
+
nodePath: modelPath,
|
|
1314
|
+
enabled: checked
|
|
1315
|
+
});
|
|
1316
|
+
await this.reloadAll();
|
|
1317
|
+
this._invalidateClientModelsTree();
|
|
1370
1318
|
},
|
|
1371
1319
|
async deleteLocalModel(modelId) {
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
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
|
+
}
|
|
1380
1329
|
},
|
|
1381
1330
|
async releaseMemory() {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1331
|
+
const res = await this._call('trainer_release_memory');
|
|
1332
|
+
if (res?.ok) {
|
|
1333
|
+
this.runtime = res.runtime || this.runtime;
|
|
1334
|
+
this.notice = 'Оперативная память и видеопамять локального ИИ освобождены.';
|
|
1335
|
+
}
|
|
1387
1336
|
},
|
|
1388
1337
|
async downloadHalogenModel(nodeName) {
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
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
|
+
}
|
|
1398
1348
|
},
|
|
1399
1349
|
async downloadHalogenBundleAll() {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
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
|
+
}
|
|
1407
1357
|
},
|
|
1408
1358
|
async buildDataset() {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
})
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
this.notice = `Обучающий набор «${ds.name}» собран (${ds.totalExamples} примеров).`;
|
|
1424
|
-
await this.reloadAll();
|
|
1425
|
-
}
|
|
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
|
+
}
|
|
1426
1373
|
},
|
|
1427
1374
|
async startTraining() {
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
await this.reloadAll();
|
|
1440
|
-
}
|
|
1441
|
-
},
|
|
1442
|
-
async stopTraining(jobId) {
|
|
1443
|
-
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}»…`;
|
|
1444
1386
|
await this.reloadAll();
|
|
1387
|
+
}
|
|
1445
1388
|
},
|
|
1446
|
-
|
|
1389
|
+
async stopTraining(jobId) {
|
|
1390
|
+
await this._call('trainer_stop', {
|
|
1391
|
+
jobId
|
|
1392
|
+
});
|
|
1393
|
+
await this.reloadAll();
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
};
|