odant-work 1.0.30 → 1.0.31

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "packageName": "odant-work",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "createdAt": 1794658837090,
5
- "updatedAt": 1794840664247,
5
+ "updatedAt": 1794842686887,
6
6
  "files": {
7
7
  "run.mjs": "f8918c612e8641e9beee06221be6680aa6fd21f25468451f2ac857fd51772266",
8
- "package.json": "de1536d38a9b2ab2974e6d85c606717d0af7b3308ecf796bbc93515c6740fb0a",
9
- "package-lock.json": "916426f7c4a2513f05dc37044bab6d8b08d33d4fe2dcfcff66b4253c1066dc69",
8
+ "package.json": "072e66fbf544dfef750f3f6114307cccbda147ca7bb16b473b6ac26da8a2f060",
9
+ "package-lock.json": "c77b383b70e4e73fdf4e3461ee5feb15324cbfdfeb18e4f31101f52c907768ee",
10
10
  "sources/client/class.js": "c3fb8f143fc83aaa2df1ddeddd412d2d4dfe88656578095babe2df34fb3b3922",
11
11
  "sources/client/field.js": "ffdd50fa8b6ec515cc42da5fca96658ff2b20e274601a1f926e0031372467a19",
12
12
  "sources/client/file.js": "667101d75fa30840370d5be232e518aaac7c1fd52ca05a12da560eef6c0848b0",
@@ -26,7 +26,7 @@
26
26
  "sources/data/objects.js": "23f51d5b00cd766fe27879b874738bc9bd9056bd6e27285fb7a52926c0dbc6a8",
27
27
  "sources/data/posting.js": "6595bb9ec632539ae7629504db327d25a491e61c1cdc598bb43d08ea0d45548d",
28
28
  "sources/data/print.js": "704f0f2fc80c6466a4196e4650d763150cf9b592eab14ea67ece85d51100107c",
29
- "sources/data/progress.md": "5cd0ce285e983ed090a05c933ccb16b93e08b9219198b129346fe98c21adfb76",
29
+ "sources/data/progress.md": "40f88c625ec131493d45c5a97fb090813b1d553b8194a77dbfd7ff0d2df490ac",
30
30
  "sources/data/readme.md": "593fa2ae07aa91bc26d7542275da6953a9cd419240a9a49e00cb62fb9d5d8e36",
31
31
  "sources/data/reports.js": "0330f404860fe2589a7d46a2f0fe690ca23249bd841a062a26718742d4fd11d6",
32
32
  "sources/data/schema.js": "1c994f9adb76c156dc86601dd6b1046376b66549b041e1a58aa1727b5476bdbe",
@@ -176,13 +176,13 @@
176
176
  "sources/modules/sandbox/vnc-proxy.js": "1c75c2b24d579f254de1c4727621fbbcc7e8a10360f638f4cf1c4bd91184d103",
177
177
  "sources/modules/trainer/dataset.js": "e631e1feda2958cf93436cb48a331958d7b029aa52bd42247865e87504b642f7",
178
178
  "sources/modules/trainer/downloader.js": "d9e96cb07e7bf64386558be8c2265c482af35a513f42954250add6d5fc87bdc4",
179
- "sources/modules/trainer/halogen.js": "cb73a06c571551cf5708789da6bab0410f4cedc73164812158769ca4e80985e8",
180
- "sources/modules/trainer/huggingface.js": "fad4fe792c42c668708dcff5062f0afd44dce0092ec24d82db838cd6ca4b88f6",
181
- "sources/modules/trainer/index.js": "f79b2ace4b3816748ff0ea0a2ac725ab217b2d2c82ce506d53881ef99be52ffe",
179
+ "sources/modules/trainer/halogen.js": "58aaac2183a396bfe5bd9030c8bb33f82db5b475d1bb53cbecdcb03330d49424",
180
+ "sources/modules/trainer/huggingface.js": "710d385142205007e9beb36d77eeb3e0310aa68bd1280b4a9b7aa208594af850",
181
+ "sources/modules/trainer/index.js": "c8101691036af98b2156530cd63752e44577db24056b09090d89d2af1629b3e7",
182
182
  "sources/modules/trainer/local-engine.js": "0aa161d9800be79534e8fcb8271c418a5e342d29244c95cd448e7df6d6b15458",
183
- "sources/modules/trainer/paths.js": "5c58d1bc4e3861ae7c92956ac0245b0d27020c04dc28321e3462edafae6e7197",
184
- "sources/modules/trainer/providers.js": "7edf40bcdd133d9b0643acc1be299bb1d7714eea5c89fd1b6bf857111dba04ff",
185
- "sources/modules/trainer/runner.js": "82020f5dffc9966bab0f45c6659b9ea3cd5300443f98d2229cc3781fd29fdabf",
183
+ "sources/modules/trainer/paths.js": "92b7dca6e3c86872f12d7738501c4c706918ea97d202371412944bf38f4c1479",
184
+ "sources/modules/trainer/providers.js": "c842cc928b846559776170d1f49e67748c2ada0db40a29cbf911d70197bc07c8",
185
+ "sources/modules/trainer/runner.js": "0a5a3a530e8302fd3151d767916822e3d8f9e0b02fb16de1c5c73727880a5272",
186
186
  "sources/modules/trainer/tar-stream.js": "52f1739579a01818b53d04a93fd05a91c49a0716019f309a6fca951ba112794f",
187
187
  "sources/modules/trainer/transfer.js": "2c603d538e0f85e1794e2f304081fac136f0ff72f85d8b00c2141c7402b3a1fb",
188
188
  "sources/modules/trainer/worker/local_infer_worker.py": "7b001d75c64ac3ae6de650f6d738f22bfc21b6bd0694b57248e5b40966deb443",
@@ -982,7 +982,7 @@
982
982
  "MODELS/$ai/$folder/$class/$provider/handlers/pages/form/provider/$handler/class.js": "8d327820cefd696d351ac4fa7998994039e4d57ef7a9f8ae297209e4dd1b0a9e",
983
983
  "MODELS/$ai/$folder/$class/$provider/handlers/pages/form/provider/$handler/provider.js": "b9ddf0040a9cd12e0dacd2dd3a61a1f0e62686cc664d02ef446326bc3991f4ce",
984
984
  "MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/class.js": "06b279a1c053deb37dd7401c84df7f9370309b8dfbd35b368ab1bab4f635cb3f",
985
- "MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js": "e90c7a225e87ee2b12a8ebaa8d7dbf5fb097d44af76558f189171cc395cad0af",
985
+ "MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js": "b17c98c144c2f281687090b8effc9234355ca18e69d2b1045943d757ce8abe90",
986
986
  "MODELS/$ai/$folder/$class/$provider/readme.md": "d6ceef2010231ab121510c3d3f35630dd7009a069c7723f6673a0e264799b227",
987
987
  "MODELS/$ai/class.js": "54e1bbbde88f8b1f272ff7f5cad87243407591748a44719b7ec90ae2b4962de7",
988
988
  "MODELS/$ai/readme.md": "90d70305a2c85312282cf67cc468a0f0b417495cb3d5b3d2ca60c6f44b81cb77",
@@ -1306,7 +1306,8 @@ export default {
1306
1306
  return;
1307
1307
  const res = await this._call('halogen_download_bundle', { models: nodeName });
1308
1308
  if (res) {
1309
- this.notice = `Начата установка модели «${nodeName}» в /MODELS/Local…`;
1309
+ const warn = Array.isArray(res.warnings) && res.warnings.length ? ` (${res.warnings.join(' ')})` : '';
1310
+ this.notice = `Начата установка модели «${nodeName}» в /MODELS/Local…${warn}`;
1310
1311
  await this.reloadAll();
1311
1312
  this._invalidateClientModelsTree();
1312
1313
  }
@@ -1314,7 +1315,8 @@ export default {
1314
1315
  async downloadHalogenBundleAll() {
1315
1316
  const res = await this._call('halogen_download_bundle', {});
1316
1317
  if (res) {
1317
- this.notice = `Начата установка комплекта Halo (${res.totalModels} моделей GPU + NPU) в /MODELS/Local…`;
1318
+ const warn = Array.isArray(res.warnings) && res.warnings.length ? ` (${res.warnings.join(' ')})` : '';
1319
+ this.notice = `Начата установка комплекта Halo (${res.totalModels} моделей) в /MODELS/Local…${warn}`;
1318
1320
  await this.reloadAll();
1319
1321
  this._invalidateClientModelsTree();
1320
1322
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odant-work",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "ODANT-WORK — платформа цифровой организации (встроенная система учёта, документооборот, управление процессами и приватный мультимодальный ИИ)",
5
5
  "type": "module",
6
6
  "main": "sources/work.js",
@@ -1,6 +1,10 @@
1
1
  # Прогресс: sources/data
2
2
 
3
3
  ## Последние изменения
4
+ - [17:15, 16.11] Быстрый расчёт `RAM + UMA` через реестр Windows (192 ГБ на Ryzen AI Max+ PRO 495), полный комплект из 8 Windows-совместимых моделей Halo и загрузка без блокировок (`sources/modules/trainer/{runner,halogen,huggingface,paths,providers,index}.js`, `MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js`, `tests/halogen-provider.test.js`, `odant-work@1.0.31`):
5
+ - **Мгновенный опрос видеопамяти/UMA на Windows (`detectHardware` + `parseWindowsVideoRegistry`):** вместо медленного PowerShell/WMI (который мог падать по таймауту 4.5 с и занижать 192 ГБ машинку Halo до `63.7 ГБ`) используется нативный `reg query` (~50 мс) с чтением `DriverDesc` и 64-битного `HardwareInformation.qwMemorySize` (`REG_QWORD` и `REG_BINARY`). Для Unified APU (`64 ГБ CPU + 128 ГБ GPU`) суммарная память определяется как **~192 ГБ**.
6
+ - **Полный комплект из 8 моделей Halo на Windows (`HALOGEN_WINDOWS_COMPANIONS`):** вместо исключённых Linux-only `.hnpw` моделей на Windows возвращены все 7 ролей-компаньонов в совместимом формате `.safetensors` (`Qwen3-4B` для сжатия, `Qwen3-ASR-1.7B` STT, `Qwen3-TTS-12Hz-1.7B-VoiceDesign` TTS, `Z-Image-Turbo` для картинок, `bge-m3` и `bge-reranker-v2-m3` для RAG, `Qwen3-0.6B` для быстрых классификаций) рядом с главной `Qwen3.8-Flash-Next` (Halowin Bubo GGUF).
7
+ - **Загрузка не блокируется из-за памяти/места (`checkWindowsHalogenPreflight`):** проверки памяти/диска возвращают мягкие предупреждения (`warnings`) без остановки скачивания (модели можно качать и для переноса на другой ПК / флешку); при этом папки `peonist-ai/halogen-*` с `.hgn`/`.hnpw` на Windows всегда помечаются как `Несовместима с ОС` с удалением в 1 клик.
4
8
  - [16:40, 16.11] Разделение форматов локальных моделей ИИ по ОС (Windows `Halowin Bubo` GGUF vs Linux `.hgn`/`.hnpw`), автозапуск движка `:8731` внутри ядра WORK, честный учёт памяти `RAM + UMA` и точная диагностика (`sources/modules/trainer/{halogen,huggingface,local-engine,providers,runner,paths,index}.js`, `sources/server/class.js`, `MODELS/$ai/$folder/$class/$ai/{class.js,handlers/pages/form/trainer/$handler/trainer.js}`, `MODELS/$ai/$folder/$class/$provider/handlers/pages/form/trainer/$handler/trainer.js`, `tests/halogen-provider.test.js`, `odant-work@1.0.30`):
5
9
  - **Учёт памяти `RAM + UMA` на Windows (`detectHardware`):** опрос `Win32_PhysicalMemory`, `Win32_VideoController` и 64-битного `HardwareInformation.qwMemorySize` корректно распознаёт 192 ГБ Unified Memory на машинах Strix Halo (даже если 128 ГБ отданы в BIOS под iGPU и ОС видит 64 ГБ RAM).
6
10
  - **Разделение форматов по ОС и экономия трафика (`halogen.js`, `huggingface.js`):** на Windows из каталога и автоподбора исключены Linux-only `.hgn` и `.hnpw` (попытка загрузки блокируется до старта, `resumeInterruptedDownloads` не возобновляет несовместимые `.hgn`); для `Qwen3.8-Flash-Next` на Windows используется нативный GGUF-стек `Halowin Bubo` (~116.6 ГБ) с проверкой места на диске, памяти и `pagefile.sys`. На Linux `selectFilesToDownload` выбирает только актуальные `.hgn` (`v2`, `ngram`, `drafter-r2`, `vision`, токенизатор — ~112 ГБ вместо 308 ГБ).
@@ -223,23 +223,160 @@ export const HALOGEN_MODELS_CATALOG = Object.freeze([
223
223
  },
224
224
  ]);
225
225
 
226
+ /**
227
+ * 7 Windows-совместимых моделей-компаньонов (.safetensors) для комплекта Halo на Windows 11,
228
+ * заменяющих Linux-only `.hnpw` модели и работающих на встроенном движке WORK.
229
+ */
230
+ export const HALOGEN_WINDOWS_COMPANIONS = Object.freeze([
231
+ {
232
+ nodeName: 'Qwen3-4B',
233
+ label: 'Qwen3-4B (Быстрая LLM / Сжатие)',
234
+ icon: 'ai:qwen',
235
+ path: '/MODELS/Local/Qwen3-4B',
236
+ baseUrl: '',
237
+ model: 'Qwen/Qwen3-4B',
238
+ hfRepo: 'Qwen/Qwen3-4B',
239
+ protocol: 'local',
240
+ runtimeType: 'local',
241
+ device: 'Встроенный движок WORK (.safetensors)',
242
+ modality: 'llm',
243
+ maxTokens: 32768,
244
+ maxOutput: 8192,
245
+ ramGb: 3.5,
246
+ capabilities: ['chat', 'stream', 'tools', 'functions', 'thinking', 'lora'],
247
+ role: 'Быстрая модель для сжатия контекста (compactModel), сводок и локальных агентов без вымывания кэша основной 180B модели',
248
+ },
249
+ {
250
+ nodeName: 'Qwen3-ASR-1.7B',
251
+ label: 'Qwen3-ASR 1.7B (Распознавание речи)',
252
+ icon: 'carbon:microphone',
253
+ path: '/MODELS/Local/Qwen3-ASR-1.7B',
254
+ baseUrl: '',
255
+ model: 'Qwen/Qwen3-ASR-1.7B',
256
+ hfRepo: 'Qwen/Qwen3-ASR-1.7B',
257
+ protocol: 'local',
258
+ runtimeType: 'local',
259
+ device: 'Встроенный движок WORK (.safetensors)',
260
+ modality: 'audio',
261
+ maxTokens: 4096,
262
+ maxOutput: 2048,
263
+ ramGb: 2.0,
264
+ capabilities: ['stt', 'asr', 'lora'],
265
+ role: 'Потоковое распознавание русской и английской речи для голосового режима (sttModel)',
266
+ },
267
+ {
268
+ nodeName: 'Qwen3-TTS-12Hz-1.7B-VoiceDesign',
269
+ label: 'Qwen3-TTS 1.7B VoiceDesign (Голос)',
270
+ icon: 'carbon:volume-up',
271
+ path: '/MODELS/Local/Qwen3-TTS-12Hz-1.7B-VoiceDesign',
272
+ baseUrl: '',
273
+ model: 'Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign',
274
+ hfRepo: 'Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign',
275
+ protocol: 'local',
276
+ runtimeType: 'local',
277
+ device: 'Встроенный движок WORK (.safetensors)',
278
+ modality: 'audio',
279
+ maxTokens: 4096,
280
+ maxOutput: 2048,
281
+ ramGb: 2.3,
282
+ capabilities: ['tts', 'voice', 'lora'],
283
+ role: 'Синтез живой русской и английской речи для озвучивания ответов агентов (ttsModel)',
284
+ },
285
+ {
286
+ nodeName: 'Z-Image-Turbo',
287
+ label: 'Z-Image-Turbo 6B (Картинки)',
288
+ icon: 'ai:stablediffusion',
289
+ path: '/MODELS/Local/Z-Image-Turbo',
290
+ baseUrl: '',
291
+ model: 'Tongyi-MAI/Z-Image-Turbo',
292
+ hfRepo: 'Tongyi-MAI/Z-Image-Turbo',
293
+ protocol: 'local',
294
+ runtimeType: 'local',
295
+ device: 'Встроенный движок WORK (.safetensors)',
296
+ modality: 'image',
297
+ maxTokens: 4096,
298
+ maxOutput: 1024,
299
+ ramGb: 7.5,
300
+ capabilities: ['image', 'text-to-image', 'lora'],
301
+ role: 'Генерация иллюстраций, фото товаров для Номенклатуры и слайдов презентаций (imageModel)',
302
+ },
303
+ {
304
+ nodeName: 'bge-m3',
305
+ label: 'BGE-M3 (Эмбеддинги RAG)',
306
+ icon: 'carbon:search-locate',
307
+ path: '/MODELS/Local/bge-m3',
308
+ baseUrl: '',
309
+ model: 'BAAI/bge-m3',
310
+ hfRepo: 'BAAI/bge-m3',
311
+ protocol: 'local',
312
+ runtimeType: 'local',
313
+ device: 'Встроенный движок WORK (.safetensors)',
314
+ modality: 'embed',
315
+ maxTokens: 8192,
316
+ maxOutput: 1024,
317
+ ramGb: 1.4,
318
+ capabilities: ['embeddings', 'rag'],
319
+ role: 'Мультиязычные векторные эмбеддинги для семантического поиска RAG по документам и БД WORK',
320
+ },
321
+ {
322
+ nodeName: 'bge-reranker-v2-m3',
323
+ label: 'BGE-Reranker-v2-M3 (Реранкер RAG)',
324
+ icon: 'carbon:filter',
325
+ path: '/MODELS/Local/bge-reranker-v2-m3',
326
+ baseUrl: '',
327
+ model: 'BAAI/bge-reranker-v2-m3',
328
+ hfRepo: 'BAAI/bge-reranker-v2-m3',
329
+ protocol: 'local',
330
+ runtimeType: 'local',
331
+ device: 'Встроенный движок WORK (.safetensors)',
332
+ modality: 'embed',
333
+ maxTokens: 8192,
334
+ maxOutput: 1024,
335
+ ramGb: 1.4,
336
+ capabilities: ['rerank', 'rag'],
337
+ role: 'Точное переранжирование найденных документов и объектов БД для RAG-контекста',
338
+ },
339
+ {
340
+ nodeName: 'Qwen3-0.6B',
341
+ label: 'Qwen3-0.6B (Быстрый классификатор)',
342
+ icon: 'carbon:decision-tree',
343
+ path: '/MODELS/Local/Qwen3-0.6B',
344
+ baseUrl: '',
345
+ model: 'Qwen/Qwen3-0.6B',
346
+ hfRepo: 'Qwen/Qwen3-0.6B',
347
+ protocol: 'local',
348
+ runtimeType: 'local',
349
+ device: 'Встроенный движок WORK (.safetensors)',
350
+ modality: 'llm',
351
+ maxTokens: 32768,
352
+ maxOutput: 2048,
353
+ ramGb: 1.0,
354
+ capabilities: ['chat', 'stream', 'decide', 'classify'],
355
+ role: 'Мгновенный локальный классификатор, маршрутизатор и короткие системные проверки',
356
+ },
357
+ ]);
358
+
226
359
  /**
227
360
  * Вернуть каталог моделей Halo, совместимый с указанной ОС (`win32` или `linux`).
228
- * На Windows не возвращаем Linux-only модели `.hnpw`, а для `Qwen3.8-Flash-Next` указываем GGUF/Bubo-стек.
361
+ * На Windows: 1 основная GPU-модель `Qwen3.8-Flash-Next` через Halowin Bubo (GGUF) + 7 совместимых `.safetensors` моделей.
362
+ * На Linux: 1 `.hgn` + 7 `.hnpw` для контейнера `halogen-flash-server`.
229
363
  */
230
364
  export function getHalogenCatalogForPlatform(platform = os.platform()) {
231
- const isWin = platform === 'win32';
365
+ if (platform === 'win32') {
366
+ const flashSpec = HALOGEN_MODELS_CATALOG.find(m => m.nodeName === 'Qwen3.8-Flash-Next');
367
+ const winFlash = flashSpec ? [{
368
+ ...flashSpec,
369
+ hfRepo: flashSpec.windowsBuboRepo || flashSpec.hfRepo,
370
+ ramGb: flashSpec.windowsRamGb || flashSpec.ramGb,
371
+ role: flashSpec.windowsRole || flashSpec.role,
372
+ protocol: 'halogen',
373
+ runtimeType: 'bubo',
374
+ }] : [];
375
+ return [...winFlash, ...HALOGEN_WINDOWS_COMPANIONS.map(m => ({ ...m }))];
376
+ }
232
377
  return HALOGEN_MODELS_CATALOG
233
378
  .filter(spec => !Array.isArray(spec.platforms) || spec.platforms.includes(platform))
234
- .map(spec => isWin
235
- ? {
236
- ...spec,
237
- hfRepo: spec.windowsBuboRepo || spec.hfRepo,
238
- ramGb: spec.windowsRamGb || spec.ramGb,
239
- role: spec.windowsRole || spec.role,
240
- runtimeType: 'bubo',
241
- }
242
- : { ...spec, runtimeType: 'halogen-linux' });
379
+ .map(spec => ({ ...spec, protocol: 'halogen', runtimeType: 'halogen-linux' }));
243
380
  }
244
381
 
245
382
  /** Допустимые пресетные голоса `qwen3-tts-*-customvoice` в Halogen NPU. */
@@ -870,11 +1007,13 @@ export function checkWindowsHalogenPreflight({
870
1007
  const warnings = [];
871
1008
  const errors = [];
872
1009
 
1010
+ // По требованию пользователя загрузка не блокируется из-за памяти или свободного места (может качаться на перенос/флешку),
1011
+ // а все замечания возвращаются как предупреждения.
873
1012
  if (freeDiskGb !== null && requiredDiskGb > 0 && freeDiskGb < requiredDiskGb) {
874
- errors.push(`Недостаточно свободного места на диске: доступно ${freeDiskGb} ГБ, требуется не менее ${requiredDiskGb} ГБ.`);
1013
+ warnings.push(`На текущем диске свободно ${freeDiskGb} ГБ (для полной 180B модели требуется ~${requiredDiskGb} ГБ).`);
875
1014
  }
876
1015
  if (totalMemoryGb !== null && minTotalMemoryGb > 0 && totalMemoryGb < minTotalMemoryGb) {
877
- errors.push(`Недостаточно общей памяти (RAM + UMA): обнаружено ${totalMemoryGb} ГБ, для 180B модели требуется не менее ${minTotalMemoryGb} ГБ (рекомендуется 128–192 ГБ). Используйте компактную модель (например, Qwen3-30B-A3B или Qwen3-14B).`);
1016
+ warnings.push(`Обнаружено ${totalMemoryGb} ГБ общей памяти (RAM + UMA); для запуска 180B модели на этой машине рекомендуется 128–192 ГБ.`);
878
1017
  }
879
1018
  if (winEnv.pageFileOk === false) {
880
1019
  warnings.push(`Файл подкачки pagefile.sys равен ${winEnv.pageFileGb} ГБ; для стабильной работы 180B модели на Windows рекомендуется фиксированный PageFile 128 ГБ (131072 МБ).`);
@@ -884,7 +1023,7 @@ export function checkWindowsHalogenPreflight({
884
1023
  }
885
1024
 
886
1025
  return {
887
- ok: errors.length === 0,
1026
+ ok: true,
888
1027
  freeDiskGb,
889
1028
  requiredDiskGb,
890
1029
  totalMemoryGb,
@@ -942,10 +1081,10 @@ export async function prepareWindowsBuboRuntime({
942
1081
  };
943
1082
 
944
1083
  try {
945
- if ((step === 'model' || step === 'all') && spawnImpl === spawn) {
1084
+ if (step === 'model' || step === 'all') {
946
1085
  const freeGb = getFreeDiskSpaceGb(rootDir);
947
1086
  if (freeGb !== null && freeGb < 118) {
948
- throw new Error(`Недостаточно свободного места на диске для установки Qwen3.8-Flash-Next (Bubo GGUF): свободно ${freeGb} ГБ, требуется ~120 ГБ.`);
1087
+ appendLog(`Предупреждение: на диске свободно ${freeGb} ГБ (рекомендуется ~120 ГБ для модели).`);
949
1088
  }
950
1089
  }
951
1090
 
@@ -1747,59 +1886,102 @@ export async function downloadHalogenBundle({
1747
1886
  throw new Error('Выбранная модель предназначена только для Linux (формат .hnpw/.hgn) и не поддерживается на Windows. Используйте совместимые Windows-модели из каталога.');
1748
1887
  }
1749
1888
 
1750
- const preflight = checkWindowsHalogenPreflight({
1751
- rootDir,
1752
- requiredDiskGb: 120,
1753
- minTotalMemoryGb: 96,
1754
- totalMemoryGb,
1755
- });
1756
- if (!preflight.ok) {
1757
- throw new Error(preflight.errors.join(' '));
1758
- }
1759
-
1760
- if (_windowsPrepareState.status === 'running') {
1761
- return {
1762
- totalModels: targets.length,
1763
- startedCount: 0,
1764
- alreadyActiveCount: 1,
1765
- mode: 'bubo-windows',
1766
- preflight,
1767
- jobs: [{
1768
- id: 'bubo_prepare',
1769
- folderName: 'Qwen3.8-Flash-Next',
1770
- status: 'downloading',
1771
- progress: _windowsPrepareState.progress,
1772
- }],
1773
- };
1774
- }
1889
+ const hasBuboTarget = targets.some(m => m.runtimeType === 'bubo');
1890
+ const preflight = hasBuboTarget
1891
+ ? checkWindowsHalogenPreflight({
1892
+ rootDir,
1893
+ requiredDiskGb: 120,
1894
+ minTotalMemoryGb: 96,
1895
+ totalMemoryGb,
1896
+ })
1897
+ : { ok: true, warnings: [], errors: [] };
1898
+
1899
+ const existingDownloads = listHuggingFaceDownloads(rootDir);
1900
+ const jobs = [];
1901
+ let startedCount = 0;
1902
+ let alreadyActiveCount = 0;
1903
+
1904
+ for (const spec of targets) {
1905
+ if (spec.runtimeType === 'bubo') {
1906
+ if (_windowsPrepareState.status === 'running') {
1907
+ alreadyActiveCount++;
1908
+ jobs.push({
1909
+ id: 'bubo_prepare',
1910
+ folderName: spec.nodeName,
1911
+ status: 'downloading',
1912
+ progress: _windowsPrepareState.progress,
1913
+ });
1914
+ }
1915
+ else {
1916
+ const runPrep = prepareWindowsBuboRuntime({
1917
+ rootDir,
1918
+ step: 'all',
1919
+ modelSet: 'original',
1920
+ fetchImpl,
1921
+ });
1922
+ if (waitForCompletion) {
1923
+ const res = await runPrep;
1924
+ if (!res.ok)
1925
+ throw new Error(res.error || 'Не удалось подготовить Halowin Bubo');
1926
+ }
1927
+ else {
1928
+ runPrep.catch(() => {});
1929
+ }
1930
+ startedCount++;
1931
+ jobs.push({
1932
+ id: 'bubo_prepare',
1933
+ folderName: spec.nodeName,
1934
+ status: _windowsPrepareState.status === 'completed' ? 'completed' : 'downloading',
1935
+ progress: _windowsPrepareState.progress,
1936
+ });
1937
+ }
1938
+ continue;
1939
+ }
1775
1940
 
1776
- const runPrep = prepareWindowsBuboRuntime({
1777
- rootDir,
1778
- step: 'all',
1779
- modelSet: 'original',
1780
- fetchImpl,
1781
- });
1782
- if (waitForCompletion) {
1783
- const res = await runPrep;
1784
- if (!res.ok)
1785
- throw new Error(res.error || 'Не удалось подготовить Halowin Bubo');
1786
- }
1787
- else {
1788
- runPrep.catch(() => {});
1941
+ const running = existingDownloads.find(d =>
1942
+ d.status === 'downloading'
1943
+ && (d.repoId === spec.hfRepo || d.folderName === spec.nodeName || d.modelPath === spec.path)
1944
+ );
1945
+ if (running) {
1946
+ alreadyActiveCount++;
1947
+ jobs.push(running);
1948
+ continue;
1949
+ }
1950
+ const job = await startHuggingFaceDownload({
1951
+ repoId: spec.hfRepo,
1952
+ providerFolder: 'Local',
1953
+ targetNodeName: spec.nodeName,
1954
+ platform,
1955
+ nodeMeta: {
1956
+ label: spec.label || spec.nodeName,
1957
+ model: spec.model || spec.hfRepo,
1958
+ protocol: spec.protocol || 'local',
1959
+ icon: spec.icon || 'ai:qwen',
1960
+ modality: spec.modality,
1961
+ capabilities: spec.capabilities,
1962
+ efforts: spec.efforts,
1963
+ maxTokens: spec.maxTokens,
1964
+ maxOutput: spec.maxOutput,
1965
+ baseUrl: spec.baseUrl || '',
1966
+ },
1967
+ rootDir,
1968
+ token,
1969
+ registerInWork: true,
1970
+ waitForCompletion,
1971
+ fetchImpl,
1972
+ });
1973
+ startedCount++;
1974
+ jobs.push(job);
1789
1975
  }
1790
1976
 
1791
1977
  return {
1792
1978
  totalModels: targets.length,
1793
- startedCount: 1,
1794
- alreadyActiveCount: 0,
1795
- mode: 'bubo-windows',
1979
+ startedCount,
1980
+ alreadyActiveCount,
1981
+ mode: hasBuboTarget ? 'bubo-windows' : 'local-windows',
1982
+ warnings: preflight.warnings || [],
1796
1983
  preflight,
1797
- jobs: [{
1798
- id: 'bubo_prepare',
1799
- folderName: 'Qwen3.8-Flash-Next',
1800
- status: _windowsPrepareState.status === 'completed' ? 'completed' : 'downloading',
1801
- progress: _windowsPrepareState.progress,
1802
- }],
1984
+ jobs,
1803
1985
  };
1804
1986
  }
1805
1987
 
@@ -29,7 +29,6 @@ import {
29
29
  migrateLocalModelsLayoutSync,
30
30
  hasReadyWeightFilesSync,
31
31
  LINUX_ONLY_HALOGEN_EXT_RE,
32
- getFreeDiskSpaceGb,
33
32
  } from './paths.js';
34
33
 
35
34
  const HF_ORIGIN = DEFAULT_HF_ORIGIN;
@@ -73,6 +72,22 @@ export const MODEL_CAPABILITIES = Object.freeze({
73
72
  */
74
73
  export const CURATED_HF_MODELS = Object.freeze([
75
74
  // --- ТЕКСТ И КОД (LLM / АГЕНТЫ) ---
75
+ {
76
+ id: 'Qwen/Qwen3-0.6B',
77
+ author: 'Qwen',
78
+ modelName: 'Qwen3-0.6B (Сверхлёгкий маршрутизатор)',
79
+ modality: 'llm',
80
+ format: 'safetensors',
81
+ paramsB: 0.6,
82
+ ramRequiredGb: 1.0,
83
+ trainRamGb: 2.2,
84
+ capabilities: ['chat', 'classify', 'decide'],
85
+ whatItDoes: 'Мгновенная классификация запросов, маршрутизация и быстрые короткие ответы на CPU/GPU',
86
+ recommendedFor: 'Работает на любом ПК (<1 ГБ памяти)',
87
+ tags: ['qwen3', '0.6b', 'safetensors', 'fast'],
88
+ downloads: 190000,
89
+ likes: 720,
90
+ },
76
91
  {
77
92
  id: 'Qwen/Qwen3-4B',
78
93
  author: 'Qwen',
@@ -1258,15 +1273,6 @@ export async function startHuggingFaceDownload({
1258
1273
  throw new Error(`В репозитории ${cleanId} найдены только веса Linux (.hgn/.hnpw), несовместимые с Windows.`);
1259
1274
  }
1260
1275
 
1261
- const totalExpectedBytes = selected.reduce((acc, f) => acc + (Number(f.size) || 0), 0);
1262
- if (totalExpectedBytes > 512 * 1024 * 1024) {
1263
- const freeGb = getFreeDiskSpaceGb(rootDir);
1264
- const needGb = +(totalExpectedBytes / (1024 ** 3)).toFixed(1);
1265
- if (freeGb !== null && freeGb < needGb + 1) {
1266
- throw new Error(`Недостаточно свободного места на диске для загрузки ${cleanId}: свободно ${freeGb} ГБ, требуется не менее ${needGb} ГБ.`);
1267
- }
1268
- }
1269
-
1270
1276
  const folderName = targetNodeName
1271
1277
  ? String(targetNodeName).replace(/[<>:"/\\|?*]/g, '-')
1272
1278
  : safeModelFolderName(cleanId, quant && selected.some(f => f.kind === 'gguf') ? quant : '');
@@ -54,6 +54,7 @@ import {
54
54
  HALOGEN_IMAGE_TAG,
55
55
  BUBO_WINDOWS_RELEASE,
56
56
  HALOGEN_MODELS_CATALOG,
57
+ HALOGEN_WINDOWS_COMPANIONS,
57
58
  HALOGEN_TTS_VOICES,
58
59
  getHalogenCatalogForPlatform,
59
60
  checkWindowsHalogenPreflight,
@@ -161,6 +162,7 @@ export {
161
162
  HALOGEN_IMAGE_TAG,
162
163
  BUBO_WINDOWS_RELEASE,
163
164
  HALOGEN_MODELS_CATALOG,
165
+ HALOGEN_WINDOWS_COMPANIONS,
164
166
  HALOGEN_TTS_VOICES,
165
167
  getHalogenCatalogForPlatform,
166
168
  checkWindowsHalogenPreflight,
@@ -142,7 +142,7 @@ export function inspectWeightsDirectorySync(dirPath, platform = os.platform()) {
142
142
  weightFormat = 'other';
143
143
 
144
144
  const isWin = platform === 'win32';
145
- const incompatibleOnPlatform = isWin && (hasHgn || hasHnpw) && !hasGguf && !hasBuboManifest && !hasSafetensors;
145
+ const incompatibleOnPlatform = isWin && (hasHgn || hasHnpw) && !hasGguf && !hasBuboManifest;
146
146
  const incompatibleReason = incompatibleOnPlatform
147
147
  ? 'Скачаны веса формата Linux (.hgn/.hnpw), несовместимые с Windows. Удалите их и установите Windows-версию (GGUF / .safetensors).'
148
148
  : '';
@@ -908,6 +908,15 @@ export function evaluateAiNodeActivitySync(item, rootDir = process.cwd()) {
908
908
  path.resolve(rootDir, adapterRel),
909
909
  ], platform);
910
910
 
911
+ const isHalogenLinuxRepo = /^peonist-ai\/halogen-/i.test(String(data.hfRepo || ''));
912
+ if (platform === 'win32' && isHalogenLinuxRepo && !(isFlashNext && hasBuboGlobal) && !check.info?.hasGguf && !check.info?.hasBuboManifest) {
913
+ return {
914
+ active: false,
915
+ reason: check.info?.incompatibleReason || 'Веса формата Linux (.hgn/.hnpw) несовместимы с Windows',
916
+ incompatibleOnPlatform: true,
917
+ configuredKey: false,
918
+ };
919
+ }
911
920
  if (check.ready || (isFlashNext && hasBuboGlobal)) {
912
921
  return { active: true, reason: 'Активна (веса модели на диске)', configuredKey: true };
913
922
  }
@@ -103,6 +103,81 @@ export function computeAdaptiveDefaults(usableMemoryGb) {
103
103
  };
104
104
  }
105
105
 
106
+ function parseRegMemoryBytes(regType, rawValue) {
107
+ const val = String(rawValue || '').trim();
108
+ if (!val)
109
+ return 0;
110
+ try {
111
+ if (/REG_QWORD|REG_DWORD/i.test(regType)) {
112
+ return Number(BigInt(val));
113
+ }
114
+ if (/REG_BINARY/i.test(regType)) {
115
+ const hex = val.replace(/[^0-9a-f]/gi, '');
116
+ if (hex.length >= 16) {
117
+ const buf = Buffer.from(hex.slice(0, 16), 'hex');
118
+ return Number(buf.readBigUInt64LE(0));
119
+ }
120
+ if (hex.length >= 8) {
121
+ const buf = Buffer.from(hex.slice(0, 8), 'hex');
122
+ return buf.readUInt32LE(0);
123
+ }
124
+ }
125
+ }
126
+ catch { /* ignore */ }
127
+ return 0;
128
+ }
129
+
130
+ function parseWindowsVideoRegistry(output) {
131
+ const byKey = new Map();
132
+ let cur = null;
133
+ for (const rawLine of String(output || '').split(/\r?\n/)) {
134
+ const line = rawLine.trim();
135
+ if (!line)
136
+ continue;
137
+ if (/^HKEY_/i.test(line)) {
138
+ const key = line.toLowerCase();
139
+ cur = byKey.get(key) || { name: '', qwBytes: 0, dwBytes: 0 };
140
+ byKey.set(key, cur);
141
+ continue;
142
+ }
143
+ if (!cur)
144
+ continue;
145
+ const mDesc = line.match(/^DriverDesc\s+REG_SZ\s+(.+)$/i);
146
+ if (mDesc) {
147
+ cur.name = mDesc[1].trim();
148
+ continue;
149
+ }
150
+ const mQw = line.match(/^HardwareInformation\.qwMemorySize\s+(REG_\w+)\s+(.+)$/i);
151
+ if (mQw) {
152
+ cur.qwBytes = parseRegMemoryBytes(mQw[1], mQw[2]);
153
+ continue;
154
+ }
155
+ const mDw = line.match(/^HardwareInformation\.MemorySize\s+(REG_\w+)\s+(.+)$/i);
156
+ if (mDw) {
157
+ cur.dwBytes = parseRegMemoryBytes(mDw[1], mDw[2]);
158
+ }
159
+ }
160
+
161
+ let bestName = '';
162
+ let maxBytes = 0;
163
+ for (const a of byKey.values()) {
164
+ if (/Basic Display|Virtual|Indirect/i.test(a.name))
165
+ continue;
166
+ const bytes = a.qwBytes || a.dwBytes || 0;
167
+ if (bytes > maxBytes) {
168
+ maxBytes = bytes;
169
+ bestName = a.name || bestName;
170
+ }
171
+ else if (!bestName && a.name) {
172
+ bestName = a.name;
173
+ }
174
+ }
175
+ return {
176
+ gpuName: bestName,
177
+ vramGb: maxBytes > 0 ? +(maxBytes / (1024 ** 3)).toFixed(1) : 0,
178
+ };
179
+ }
180
+
106
181
  /**
107
182
  * Определить реальный аппаратный профиль текущей машины (CPU, RAM, GPU/VRAM/UMA, Python + Unsloth, llama-server)
108
183
  * и адаптировать все бюджеты памяти и рекомендации под фактическое железо.
@@ -126,19 +201,17 @@ export async function detectHardware({ force = false } = {}) {
126
201
  const platform = os.platform();
127
202
  const arch = os.arch();
128
203
 
129
- const winPsScript = [
130
- '$pm = (Get-CimInstance Win32_PhysicalMemory -ErrorAction SilentlyContinue | Measure-Object Capacity -Sum).Sum',
131
- '$gpu = Get-CimInstance Win32_VideoController -ErrorAction SilentlyContinue | Where-Object { $_.Name -notmatch "Basic Display|Virtual" } | Select-Object -First 1 Name',
132
- '$qw = (Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\0*" -Name "HardwareInformation.qwMemorySize" -ErrorAction SilentlyContinue | Measure-Object "HardwareInformation.qwMemorySize" -Maximum).Maximum',
133
- '[PSCustomObject]@{phys=$pm;gpu=$gpu.Name;vram=$qw} | ConvertTo-Json -Compress',
134
- ].join('\n');
204
+ const winVideoRegKey = 'HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}';
135
205
 
136
- // Параллельно опрашиваем видеокарту (NVIDIA / AMD ROCm / Windows WMI+DXGI) и окружение Python / llama-server
137
- const [nvidiaProbe, rocmProbe, winProbe, pyProbe, llamaProbe] = await Promise.all([
206
+ // Параллельно опрашиваем видеокарту (NVIDIA / AMD ROCm / нативный reg query на Windows за ~50 мс) и Python / llama-server
207
+ const [nvidiaProbe, rocmProbe, winRegDesc, winRegMem, pyProbe, llamaProbe] = await Promise.all([
138
208
  probeCommand('nvidia-smi', ['--query-gpu=name,memory.total', '--format=csv,noheader,nounits']),
139
209
  probeCommand('rocm-smi', ['--showproductname', '--showmeminfo', 'vram', '--json']),
140
210
  platform === 'win32'
141
- ? probeCommand('powershell', ['-NoProfile', '-EncodedCommand', Buffer.from(winPsScript, 'utf16le').toString('base64')], 4500)
211
+ ? probeCommand('reg', ['query', winVideoRegKey, '/s', '/v', 'DriverDesc'], 2500)
212
+ : Promise.resolve({ ok: false, output: '' }),
213
+ platform === 'win32'
214
+ ? probeCommand('reg', ['query', winVideoRegKey, '/s', '/v', 'HardwareInformation.*MemorySize'], 2500)
142
215
  : Promise.resolve({ ok: false, output: '' }),
143
216
  probeCommand('python', ['-c', 'import json, torch; import unsloth; print(json.dumps({"torch": torch.__version__, "cuda": torch.cuda.is_available(), "hip": getattr(torch.version, "hip", None)}))']),
144
217
  probeCommand('llama-server', ['--version']),
@@ -146,22 +219,15 @@ export async function detectHardware({ force = false } = {}) {
146
219
 
147
220
  let gpuName = '';
148
221
  let vramGb = 0;
149
- let physicalRamGb = osTotalRamGb;
222
+ const physicalRamGb = osTotalRamGb;
150
223
  let memoryType = 'System RAM / UMA';
151
224
 
152
- if (winProbe.ok && winProbe.output) {
153
- try {
154
- const w = JSON.parse(winProbe.output.split(/\r?\n/).pop() || '{}');
155
- const physB = Number(w.phys) || 0;
156
- if (physB > 0)
157
- physicalRamGb = Math.max(osTotalRamGb, +(physB / (1024 ** 3)).toFixed(1));
158
- const vramB = Number(w.vram) || 0;
159
- if (vramB > 0)
160
- vramGb = +(vramB / (1024 ** 3)).toFixed(1);
161
- if (w.gpu && typeof w.gpu === 'string')
162
- gpuName = w.gpu.trim();
163
- }
164
- catch { /* ignore */ }
225
+ if (winRegDesc.ok || winRegMem.ok) {
226
+ const parsed = parseWindowsVideoRegistry(`${winRegDesc.output || ''}\n${winRegMem.output || ''}`);
227
+ if (parsed.gpuName)
228
+ gpuName = parsed.gpuName;
229
+ if (parsed.vramGb > 0)
230
+ vramGb = parsed.vramGb;
165
231
  }
166
232
 
167
233
  if (nvidiaProbe.ok && nvidiaProbe.output) {
@@ -365,7 +431,9 @@ export async function listLocalModelsAndAdapters(rootDir = process.cwd()) {
365
431
 
366
432
  if (hasRealWeightBinary || isAdapterNode || hasBuboExternal) {
367
433
  const enabled = meta.enabled !== false;
368
- const incompatible = !hasBuboExternal && wInsp.incompatibleOnPlatform;
434
+ const isHalogenLinuxRepo = platform === 'win32' && /^peonist-ai\/halogen-/i.test(String(meta.hfRepo || ''));
435
+ const incompatible = !hasBuboExternal && (wInsp.incompatibleOnPlatform || (isHalogenLinuxRepo && !wInsp.hasGguf && !wInsp.hasBuboManifest));
436
+ const incompatibleReason = wInsp.incompatibleReason || (incompatible ? 'Веса формата Linux (.hgn/.hnpw) несовместимы с Windows. Удалите их и установите Windows-версию.' : '');
369
437
  models.push({
370
438
  id: e.name,
371
439
  label: meta.label || e.name,
@@ -378,7 +446,7 @@ export async function listLocalModelsAndAdapters(rootDir = process.cwd()) {
378
446
  enabled,
379
447
  active: enabled && (hasRealWeightBinary || isAdapterNode || hasBuboExternal) && !incompatible,
380
448
  incompatibleOnPlatform: incompatible,
381
- incompatibleReason: incompatible ? wInsp.incompatibleReason : '',
449
+ incompatibleReason: incompatible ? incompatibleReason : '',
382
450
  weightFormat: hasBuboExternal ? 'bubo' : wInsp.weightFormat,
383
451
  path: `/MODELS/Local/${e.name}`,
384
452
  hasClass: fs.existsSync(aiClassFile),
@@ -664,3 +732,5 @@ export async function publishTrainedAdapter(jobId, {
664
732
  job.publishedPath = res.modelPath;
665
733
  return res;
666
734
  }
735
+
736
+ export { parseWindowsVideoRegistry };