odant-work 1.0.93 → 1.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/#system/package-manifest.json +618 -649
  2. package/$server/$folder/$class/$ai/class.js +1 -0
  3. package/$server/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js +4 -1
  4. package/$server/$folder/$class/$data/$catalog/$virtual/class.js +1 -0
  5. package/$server/$folder/$class/$data/$catalog/class.js +1 -0
  6. package/$server/$folder/$class/$data/$operation/class.js +1 -0
  7. package/$server/$folder/$class/$data/$register/$account/class.js +1 -0
  8. package/$server/$folder/$class/$data/$register/class.js +1 -0
  9. package/$server/$folder/$class/$data/$struct/class.js +1 -0
  10. package/$server/$folder/$class/$domain/class.js +1 -0
  11. package/$server/$folder/$class/$module/$mcp/class.js +1 -0
  12. package/$server/$folder/$class/$module/$provider/class.js +1 -0
  13. package/$server/$folder/$class/$module/$provider/handlers/pages/form/system/ai/$handler/class.js +38 -6
  14. package/$server/$folder/$class/$module/class.js +1 -0
  15. package/$server/$folder/$class/$structure/$project/class.js +1 -0
  16. package/$server/$folder/$class/$structure/$server/class.js +1 -0
  17. package/$server/$folder/$class/$structure/$user/class.js +2 -0
  18. package/$server/$folder/$class/$structure/class.js +1 -0
  19. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat-task.js +20 -6
  20. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +23 -17
  21. package/$server/$folder/$class/$structure/handlers/pages/form/system/agent/$handler/class.js +35 -3
  22. package/$server/$folder/$class/$structure/handlers/pages/form/system/messengers/$handler/class.js +38 -3
  23. package/$server/$folder/$class/$users/class.js +1 -0
  24. package/$server/$folder/$class/handlers/pages/form/system/requisites/$handler/class.js +95 -24
  25. package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +22 -4
  26. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +4 -3
  27. package/$server/$folder/handlers/pages/form/$handler/class.js +167 -13
  28. package/$server/$folder/lib/explorer/explorer.js +2 -1
  29. package/$server/$folder/lib/icon/icon.js +2 -2
  30. package/$server/$folder/lib/node/node.js +3 -11
  31. package/$server/$folder/lib/prompt-bar/prompt-bar.js +4 -2
  32. package/$server/$folder/lib/tree/tree.js +12 -1
  33. package/MODULES//320/224/320/260/320/275/320/275/321/213/320/265/Geo/$module/class.js +1 -0
  34. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/engine/$handler/class.js +445 -0
  35. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/class.js" +1 -0
  36. package/package.json +1 -1
  37. package/run.mjs +11 -0
  38. package/scripts/agent-eval.mjs +1 -1
  39. package/scripts/migrate-tree.mjs +9 -438
  40. package/sources/client/class.js +1 -1
  41. package/sources/host/auth-methods.js +16 -2
  42. package/sources/host/auto-updater.js +34 -24
  43. package/sources/host/tree-migration.js +580 -0
  44. package/sources/host/tree-migration.json +85 -0
  45. package/sources/modules/agent/index.js +23 -10
  46. package/sources/modules/agent/session.js +22 -2
  47. package/sources/modules/agent/tools/meta.js +1 -1
  48. package/sources/modules/agent/voice.js +6 -2
  49. package/sources/modules/license/index.js +53 -0
  50. package/sources/modules/trainer/dataset.js +6 -4
  51. package/sources/modules/trainer/halogen.js +9 -9
  52. package/sources/modules/trainer/huggingface.js +1 -1
  53. package/sources/modules/trainer/index.js +25 -5
  54. package/sources/modules/trainer/local-engine.js +17 -11
  55. package/sources/modules/trainer/runner.js +32 -9
  56. package/sources/server/class/distro.js +1 -1
  57. package/sources/server/class.js +8 -0
  58. package/sources/server/folder.js +9 -2
  59. package/$server/$folder/$class/$data/$catalog/$folder/$class/$data/$catalog/$virtual/class.js +0 -4
  60. package/$server/$folder/$class/$data/$catalog/$folder/$class/$data/$catalog/class.js +0 -4
  61. package/$server/$folder/$class/$data/$catalog/$virtual/$folder/$class/$data/$catalog/$virtual/class.js +0 -4
  62. package/$server/$folder/$class/$data/$operation/$folder/$class/$data/$operation/class.js +0 -4
  63. package/$server/$folder/$class/$data/$register/$account/$folder/$class/$data/$register/$account/class.js +0 -4
  64. package/$server/$folder/$class/$data/$register/$folder/$class/$data/$register/$account/class.js +0 -4
  65. package/$server/$folder/$class/$data/$register/$folder/$class/$data/$register/class.js +0 -4
  66. package/$server/$folder/$class/$data/$struct/$folder/$class/$data/$struct/class.js +0 -4
  67. package/$server/$folder/$class/$domain/$folder/$class/$domain/class.js +0 -4
  68. package/$server/$folder/$class/$module/$folder/$class/$data/$catalog/class.js +0 -4
  69. package/$server/$folder/$class/$module/$folder/$class/$data/$operation/class.js +0 -4
  70. package/$server/$folder/$class/$module/$folder/$class/$data/$register/class.js +0 -4
  71. package/$server/$folder/$class/$module/$folder/$class/$data/$struct/class.js +0 -4
  72. package/$server/$folder/$class/$module/$folder/$class/$domain/class.js +0 -4
  73. package/$server/$folder/$class/$module/$folder/$class/$module/class.js +0 -4
  74. package/$server/$folder/$class/$structure/$folder/$class/$structure/class.js +0 -4
  75. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$catalog/class.js +0 -4
  76. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$operation/class.js +0 -4
  77. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$register/class.js +0 -4
  78. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$struct/class.js +0 -4
  79. package/$server/$folder/$class/$structure/$project/$folder/$class/$domain/class.js +0 -4
  80. package/$server/$folder/$class/$structure/$project/$folder/$class/$structure/$project/class.js +0 -4
  81. package/$server/$folder/$class/$structure/$project/$folder/$class/$structure/class.js +0 -4
  82. package/$server/$folder/$class/$structure/$server/$folder/$class/$domain/class.js +0 -4
  83. package/$server/$folder/$class/$users/$folder/$class/$structure/$user/class.js +0 -4
@@ -48,6 +48,8 @@ function filterMainTreeItems(items, parent) {
48
48
  }
49
49
  if (isModulesContainer(parent))
50
50
  return items.filter(f => f && (f.type === '$folder' || f.type === '$module' || f.type === '$provider' || f.type === '$mcp'));
51
+ if (parent.type === '$folder')
52
+ return items;
51
53
  if (isRootSectionNode(parent))
52
54
  return items.filter(f => f && MAIN_TREE_ENV_TYPES.has(f.type));
53
55
  if (isMainTreeLeaf(parent))
@@ -639,6 +641,10 @@ ODA({is: 'oda-tree-node',
639
641
  height: 52px;
640
642
  min-height: 52px;
641
643
  }
644
+ .node.medium-icon-node {
645
+ height: 38px;
646
+ min-height: 38px;
647
+ }
642
648
  .node.structure-only-node {
643
649
  height: 36px;
644
650
  min-height: 36px;
@@ -709,7 +715,7 @@ ODA({is: 'oda-tree-node',
709
715
  padding: 0px;
710
716
  }
711
717
  </style>
712
- <div draggable="true" ~if="hideTops<1" class='node' ~class="{'node-focused': isFocused, 'is-stuck': isStuck, 'module-blocked': isModuleBlocked, 'large-icon-node': isLargeIconNode, 'structure-only-node': isDepartmentNode}" :style="nodeStickyStyle" :category="isCategory" @tap="isCategory?$pdp.focusedItem=$pdp.focusedItem:$pdp.focusedItem = $item" @dragstart>
718
+ <div draggable="true" ~if="hideTops<1" class='node' ~class="{'node-focused': isFocused, 'is-stuck': isStuck, 'module-blocked': isModuleBlocked, 'large-icon-node': isLargeIconNode, 'medium-icon-node': isMediumIconNode, 'structure-only-node': isDepartmentNode}" :style="nodeStickyStyle" :category="isCategory" @tap="isCategory?$pdp.focusedItem=$pdp.focusedItem:$pdp.focusedItem = $item" @dragstart>
713
719
  <oda-icon ~if="hideRoots<1" ~show="showExpander" :disabled="!expanderIcon" :icon="expanderIcon" :icon-size="expanderIconSize" @tap.stop="expanded = !expanded"></oda-icon>
714
720
  <div vertical flex style="min-width: 0; overflow: hidden;">
715
721
  <div horizontal flex style="min-width: 0; overflow: hidden; align-items: center;">
@@ -815,12 +821,17 @@ ODA({is: 'oda-tree-node',
815
821
  const isNetServer = t === '$node' && it.id !== 'NODES';
816
822
  return it instanceof CORE.$user || t === '$user' || t === '$project' || t === '$structure' || t === '$server' || isNetServer;
817
823
  },
824
+ get isMediumIconNode() {
825
+ return this.isModule;
826
+ },
818
827
  get isDepartmentNode() {
819
828
  return false;
820
829
  },
821
830
  get rowHeight() {
822
831
  if (this.isLargeIconNode)
823
832
  return 52;
833
+ if (this.isMediumIconNode)
834
+ return 38;
824
835
  if (this.isDepartmentNode)
825
836
  return 36;
826
837
  return 30;
@@ -1,3 +1,4 @@
1
1
  export default {
2
2
  label: 'Геолокация и координаты',
3
+ icon: 'carbon:location',
3
4
  }
@@ -0,0 +1,445 @@
1
+ export default {
2
+ label: 'Движок и настройка',
3
+ icon: 'icons:settings',
4
+ order: 8,
5
+ allowSave: true,
6
+ component: {
7
+ imports: 'oda//icon, oda//button',
8
+ template: /* html */`
9
+ <style>
10
+ :host {
11
+ @apply --vertical;
12
+ @apply --flex;
13
+ padding: 16px 20px;
14
+ gap: 14px;
15
+ overflow-y: auto;
16
+ box-sizing: border-box;
17
+ background: var(--body-background, #f6f8fb);
18
+ color: var(--content-color);
19
+ font-size: 13px;
20
+ }
21
+ .card {
22
+ background: var(--content-background);
23
+ border: 1px solid var(--subtle-border, var(--border-color));
24
+ border-radius: 10px;
25
+ padding: 14px 16px;
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: 10px;
29
+ }
30
+ .card-head {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: space-between;
34
+ gap: 10px;
35
+ flex-wrap: wrap;
36
+ font-weight: 700;
37
+ font-size: 14px;
38
+ }
39
+ .row {
40
+ display: flex;
41
+ align-items: center;
42
+ flex-wrap: wrap;
43
+ gap: 8px;
44
+ }
45
+ .grid {
46
+ display: grid;
47
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
48
+ gap: 10px 14px;
49
+ }
50
+ .field {
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: 4px;
54
+ }
55
+ .field label {
56
+ font-size: 12px;
57
+ font-weight: 600;
58
+ opacity: 0.85;
59
+ }
60
+ .field input[type="text"],
61
+ .field input[type="number"],
62
+ .field select {
63
+ padding: 7px 10px;
64
+ border-radius: 7px;
65
+ border: 1px solid var(--border-color, #cbd5e1);
66
+ background: var(--content-background);
67
+ color: var(--content-color);
68
+ font: inherit;
69
+ box-sizing: border-box;
70
+ }
71
+ .badge {
72
+ display: inline-flex;
73
+ align-items: center;
74
+ gap: 6px;
75
+ padding: 3px 10px;
76
+ border-radius: 999px;
77
+ font-size: 12px;
78
+ font-weight: 600;
79
+ }
80
+ .badge.on {
81
+ background: light-dark(#dcfce7, #14532d);
82
+ color: light-dark(#15803d, #86efac);
83
+ }
84
+ .badge.off {
85
+ background: light-dark(#f1f5f9, #1e293b);
86
+ color: light-dark(#475569, #cbd5e1);
87
+ }
88
+ .dot {
89
+ width: 8px;
90
+ height: 8px;
91
+ border-radius: 50%;
92
+ background: currentColor;
93
+ }
94
+ .kv {
95
+ display: grid;
96
+ grid-template-columns: minmax(150px, 210px) 1fr;
97
+ gap: 5px 12px;
98
+ font-size: 12.5px;
99
+ align-items: baseline;
100
+ }
101
+ .kv-k {
102
+ opacity: 0.72;
103
+ }
104
+ .kv-v {
105
+ font-family: ui-monospace, monospace;
106
+ word-break: break-all;
107
+ }
108
+ .btn {
109
+ padding: 6px 12px;
110
+ border-radius: 7px;
111
+ border: 1px solid var(--border-color, #cbd5e1);
112
+ background: var(--content-background);
113
+ color: var(--content-color);
114
+ font: inherit;
115
+ font-size: 12.5px;
116
+ font-weight: 600;
117
+ cursor: pointer;
118
+ display: inline-flex;
119
+ align-items: center;
120
+ gap: 6px;
121
+ }
122
+ .btn:hover:not(:disabled) {
123
+ border-color: var(--accent-color);
124
+ color: var(--accent-color);
125
+ }
126
+ .btn.primary {
127
+ background: var(--accent-color, #2563eb);
128
+ border-color: var(--accent-color, #2563eb);
129
+ color: #fff;
130
+ }
131
+ .btn.danger {
132
+ border-color: #ef4444;
133
+ color: #dc2626;
134
+ }
135
+ .btn:disabled {
136
+ opacity: 0.55;
137
+ cursor: default;
138
+ }
139
+ .msg {
140
+ padding: 8px 12px;
141
+ border-radius: 8px;
142
+ font-size: 12.5px;
143
+ }
144
+ .msg.ok {
145
+ background: light-dark(#dcfce7, #14532d);
146
+ color: light-dark(#15803d, #86efac);
147
+ }
148
+ .msg.err {
149
+ background: light-dark(#fee2e2, #7f1d1d);
150
+ color: light-dark(#b91c1c, #fecaca);
151
+ }
152
+ .muted {
153
+ opacity: 0.75;
154
+ font-size: 12px;
155
+ }
156
+ </style>
157
+
158
+ <div class="msg ok" ~if="notice">{{notice}}</div>
159
+ <div class="msg err" ~if="error">{{error}}</div>
160
+
161
+ <!-- 1. Состояние движка и управление процессом -->
162
+ <div class="card">
163
+ <div class="card-head">
164
+ <div class="row">
165
+ <oda-icon icon="carbon:chip" icon-size="18"></oda-icon>
166
+ <span>Локальный движок (Halowin Bubo / Gufo / ROCm)</span>
167
+ <span class="badge" ~class="status?.online ? 'on' : 'off'">
168
+ <span class="dot"></span>
169
+ <span>{{status?.online ? ('Запущен · ' + (status?.modeLabel || status?.mode || 'online')) : 'Остановлен'}}</span>
170
+ </span>
171
+ </div>
172
+ <div class="row">
173
+ <button type="button" class="btn primary" :disabled="busy" @tap="startEngine()">{{status?.online ? 'Проверить / Запустить' : 'Запустить движок'}}</button>
174
+ <button type="button" class="btn" :disabled="busy" @tap="restartEngine()">Перезапустить</button>
175
+ <button type="button" class="btn danger" :disabled="busy || !status?.online" @tap="stopEngine()">Остановить</button>
176
+ <button type="button" class="btn" :disabled="busy" @tap="reload(true)">Обновить</button>
177
+ </div>
178
+ </div>
179
+
180
+ <div class="kv" ~if="status">
181
+ <span class="kv-k">Оборудование</span>
182
+ <span class="kv-v">{{hardwareLine}}</span>
183
+ <span class="kv-k">Статус NPU (Ryzen AI)</span>
184
+ <span class="kv-v">{{engine?.npuStatusText || '—'}}</span>
185
+ <span class="kv-k">Исполняемый файл</span>
186
+ <span class="kv-v">{{winEnv?.buboExePath || winEnv?.gufoExePath || 'Не найден (используйте подготовку или вкладку «Установка моделей»)'}}</span>
187
+ <span class="kv-k" ~if="winEnv?.rocmRuntimeDir">ROCm Runtime</span>
188
+ <span class="kv-v" ~if="winEnv?.rocmRuntimeDir">{{winEnv.rocmRuntimeDir}}</span>
189
+ <span class="kv-k">Основная GGUF-модель</span>
190
+ <span class="kv-v">{{engine?.mainModel ? (engine.mainModel.name + ' (' + engine.mainModel.sizeGb + ' ГБ)') : 'Не найдена'}}</span>
191
+ <span class="kv-k" ~if="sidecarSummary">Спекуляция / Sidecars</span>
192
+ <span class="kv-v" ~if="sidecarSummary">{{sidecarSummary}}</span>
193
+ </div>
194
+
195
+ <div class="row" ~if="isWindows" style="padding-top:4px;border-top:1px dashed var(--subtle-border);">
196
+ <button type="button" class="btn" :disabled="busy" @tap="prepareWindows()">Подготовить Windows Runtime (Bubo / ROCm 10.0)</button>
197
+ <span class="muted" ~if="winEnv?.prepareState?.active">Подготовка выполняется: {{winEnv.prepareState.stage || '…'}}</span>
198
+ </div>
199
+ </div>
200
+
201
+ <!-- 2. Параметры запуска и спекулятивного декодирования (сохраняются общей кнопкой Save в шапке) -->
202
+ <div class="card">
203
+ <div class="card-head">
204
+ <div class="row">
205
+ <oda-icon icon="icons:tune" icon-size="18"></oda-icon>
206
+ <span>Настройки движка</span>
207
+ </div>
208
+ <span class="muted">Изменения сохраняются кнопкой «Сохранить» в шапке формы</span>
209
+ </div>
210
+
211
+ <div class="grid">
212
+ <div class="field">
213
+ <label>Профиль запуска</label>
214
+ <select @change="profile = $this.value; _notifyForm()">
215
+ <option value="default" :selected="profile === 'default'">default (основной + NPU prefill)</option>
216
+ <option value="subagents" :selected="profile === 'subagents'">subagents (многослотовый для субагентов)</option>
217
+ <option value="exact" :selected="profile === 'exact'">exact (без оптимизаций, точный)</option>
218
+ <option value="stock" :selected="profile === 'stock'">stock</option>
219
+ </select>
220
+ </div>
221
+
222
+ <div class="field">
223
+ <label>Спекулятивное декодирование</label>
224
+ <select @change="speculation = $this.value; _notifyForm()">
225
+ <option value="auto" :selected="speculation === 'auto'">auto (выбирать лучшее доступное)</option>
226
+ <option value="mtp" :selected="speculation === 'mtp'">mtp (Multi-Token Prediction)</option>
227
+ <option value="twin" :selected="speculation === 'twin'">twin (драфт-модель)</option>
228
+ <option value="draft" :selected="speculation === 'draft'">draft (Draft Head)</option>
229
+ <option value="off" :selected="speculation === 'off'">off (выключено)</option>
230
+ </select>
231
+ </div>
232
+
233
+ <div class="field">
234
+ <label>Prompt Lookup (кэш совпадений промпта)</label>
235
+ <select @change="promptLookup = $this.value; _notifyForm()">
236
+ <option value="auto" :selected="promptLookup === 'auto'">auto</option>
237
+ <option value="on" :selected="promptLookup === 'on'">on</option>
238
+ <option value="off" :selected="promptLookup === 'off'">off</option>
239
+ </select>
240
+ </div>
241
+
242
+ <div class="field">
243
+ <label>Макс. токенов драфта (draftMax)</label>
244
+ <input type="number" min="0" max="64" :value="draftMax" @input="draftMax = Number($this.value) || 0; _notifyForm()">
245
+ </div>
246
+ </div>
247
+
248
+ <div class="row" style="gap:18px;margin-top:2px;">
249
+ <label class="row" style="cursor:pointer;">
250
+ <input type="checkbox" :checked="npuPrefill" @change="npuPrefill = $event.target.checked; _notifyForm()">
251
+ <span>NPU Prefill (--npu-prefill on, AMD Ryzen AI XRT)</span>
252
+ </label>
253
+ <label class="row" style="cursor:pointer;">
254
+ <input type="checkbox" :checked="restartOnSave" @change="restartOnSave = $event.target.checked">
255
+ <span>Перезапускать движок после сохранения</span>
256
+ </label>
257
+ </div>
258
+ </div>
259
+ `,
260
+ $form: null,
261
+ allowSave: true,
262
+ $item: {
263
+ $def: null,
264
+ set(n) {
265
+ if (n) this.reload(false);
266
+ }
267
+ },
268
+ status: null,
269
+ engine: null,
270
+ busy: false,
271
+ notice: '',
272
+ error: '',
273
+ profile: 'default',
274
+ speculation: 'auto',
275
+ promptLookup: 'auto',
276
+ draftMax: 8,
277
+ npuPrefill: true,
278
+ restartOnSave: true,
279
+ _savedSnap: '',
280
+ get isWindows() {
281
+ return String(this.status?.hardware?.platform || navigator?.platform || '').toLowerCase().includes('win');
282
+ },
283
+ get winEnv() {
284
+ return this.engine?.windowsEnv || this.status?.windowsEnv || null;
285
+ },
286
+ get hardwareLine() {
287
+ const hw = this.status?.hardware;
288
+ if (!hw) return '—';
289
+ const parts = [];
290
+ if (hw.cpuModel) parts.push(hw.cpuModel);
291
+ if (hw.totalRamGb) parts.push(`${hw.totalRamGb} ГБ RAM`);
292
+ if (hw.gpuName) parts.push(hw.gpuName);
293
+ if (hw.platform) parts.push(hw.platform);
294
+ return parts.join(' · ') || '—';
295
+ },
296
+ get sidecarSummary() {
297
+ const s = this.engine?.sidecars;
298
+ if (!s) return '';
299
+ const out = [];
300
+ if (s.mtp) out.push(`MTP: ${s.mtp.name}`);
301
+ if (s.twin) out.push(`Twin: ${s.twin.name}`);
302
+ if (s.draftHead) out.push(`DraftHead: ${s.draftHead.name}`);
303
+ if (s.mmproj) out.push(`Vision mmproj: ${s.mmproj.name}`);
304
+ return out.join(' · ');
305
+ },
306
+ _currentSnap() {
307
+ return JSON.stringify({
308
+ profile: this.profile || 'default',
309
+ speculation: this.speculation || 'auto',
310
+ promptLookup: this.promptLookup || 'auto',
311
+ draftMax: Number(this.draftMax) || 0,
312
+ npuPrefill: Boolean(this.npuPrefill),
313
+ });
314
+ },
315
+ get isChanged() {
316
+ if (!this._savedSnap) return false;
317
+ return this._currentSnap() !== this._savedSnap;
318
+ },
319
+ isDirty() {
320
+ return this.isChanged;
321
+ },
322
+ _notifyForm() {
323
+ this.$form?.syncFromView?.(this);
324
+ },
325
+ async attached() {
326
+ if (this.$item) await this.reload(false);
327
+ },
328
+ async _target() {
329
+ return this.$item || await WORK.get_item('/MODULES/Модели/Local');
330
+ },
331
+ async reload(refreshCaps = false) {
332
+ this.error = '';
333
+ try {
334
+ const target = await this._target();
335
+ const [st, eng] = await Promise.all([
336
+ target.fetch('halogen_status'),
337
+ target.fetch('halogen_engine_config', refreshCaps ? { refresh: true } : {}),
338
+ ]);
339
+ this.status = st || null;
340
+ this.engine = eng || null;
341
+ const cfg = eng?.settings || {};
342
+ this.profile = cfg.profile || 'default';
343
+ this.speculation = cfg.speculation || 'auto';
344
+ this.promptLookup = cfg.promptLookup || 'auto';
345
+ this.draftMax = cfg.draftMax !== undefined ? Number(cfg.draftMax) : 8;
346
+ this.npuPrefill = cfg.npuPrefill !== false;
347
+ this._savedSnap = this._currentSnap();
348
+ this._notifyForm();
349
+ } catch (e) {
350
+ this.error = String(e?.message || e);
351
+ }
352
+ },
353
+ async save() {
354
+ this.error = '';
355
+ this.notice = '';
356
+ this.busy = true;
357
+ try {
358
+ const target = await this._target();
359
+ const res = await target.fetch('halogen_save_engine_config', {
360
+ profile: this.profile,
361
+ speculation: this.speculation,
362
+ promptLookup: this.promptLookup,
363
+ draftMax: Number(this.draftMax) || 0,
364
+ npuPrefill: Boolean(this.npuPrefill),
365
+ restart: Boolean(this.restartOnSave && this.status?.online),
366
+ });
367
+ this.engine = res || this.engine;
368
+ this._savedSnap = this._currentSnap();
369
+ this.notice = res?.restarted
370
+ ? 'Настройки движка сохранены, движок перезапущен.'
371
+ : 'Настройки движка сохранены.';
372
+ await this.reload(false);
373
+ } catch (e) {
374
+ this.error = String(e?.message || e);
375
+ throw e;
376
+ } finally {
377
+ this.busy = false;
378
+ this._notifyForm();
379
+ }
380
+ },
381
+ async startEngine() {
382
+ this.error = '';
383
+ this.notice = '';
384
+ this.busy = true;
385
+ try {
386
+ const target = await this._target();
387
+ const res = await target.fetch('halogen_start', {
388
+ profile: this.profile,
389
+ npuPrefill: Boolean(this.npuPrefill),
390
+ });
391
+ this.notice = res?.note || (res?.started ? `Движок запущен (режим: ${res.mode || 'ok'}).` : 'Запуск выполнен.');
392
+ await this.reload(false);
393
+ } catch (e) {
394
+ this.error = String(e?.message || e);
395
+ } finally {
396
+ this.busy = false;
397
+ }
398
+ },
399
+ async restartEngine() {
400
+ this.error = '';
401
+ this.notice = '';
402
+ this.busy = true;
403
+ try {
404
+ const target = await this._target();
405
+ await target.fetch('halogen_restart', { profile: this.profile });
406
+ this.notice = 'Движок перезапущен.';
407
+ await this.reload(false);
408
+ } catch (e) {
409
+ this.error = String(e?.message || e);
410
+ } finally {
411
+ this.busy = false;
412
+ }
413
+ },
414
+ async stopEngine() {
415
+ this.error = '';
416
+ this.notice = '';
417
+ this.busy = true;
418
+ try {
419
+ const target = await this._target();
420
+ await target.fetch('halogen_stop');
421
+ this.notice = 'Движок остановлен.';
422
+ await this.reload(false);
423
+ } catch (e) {
424
+ this.error = String(e?.message || e);
425
+ } finally {
426
+ this.busy = false;
427
+ }
428
+ },
429
+ async prepareWindows() {
430
+ this.error = '';
431
+ this.notice = '';
432
+ this.busy = true;
433
+ try {
434
+ const target = await this._target();
435
+ const res = await target.fetch('halogen_prepare_windows', { step: 'runtime' });
436
+ this.notice = res?.note || (res?.ok ? 'Windows runtime (Bubo / ROCm) подготовлен.' : 'Подготовка завершена.');
437
+ await this.reload(true);
438
+ } catch (e) {
439
+ this.error = String(e?.message || e);
440
+ } finally {
441
+ this.busy = false;
442
+ }
443
+ },
444
+ }
445
+ };
@@ -1,3 +1,4 @@
1
1
  export default {
2
2
  label: 'Учётный регистр',
3
+ icon: 'carbon:calculator',
3
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odant-work",
3
- "version": "1.0.93",
3
+ "version": "1.0.95",
4
4
  "description": "ODANT-WORK — платформа цифровой организации (встроенная система учёта, документооборот, управление процессами и приватный мультимодальный ИИ)",
5
5
  "type": "module",
6
6
  "main": "sources/work.js",
package/run.mjs CHANGED
@@ -99,6 +99,17 @@ if (workRoot !== pkgRoot) {
99
99
  }
100
100
  }
101
101
 
102
+ try {
103
+ const { needsTreeMigration, migrateTreeSync } = await import('./sources/host/tree-migration.js');
104
+ if (needsTreeMigration(workRoot)) {
105
+ const mig = migrateTreeSync(workRoot);
106
+ console.log('[WORK] Выполнена автомиграция дерева:', JSON.stringify(mig));
107
+ }
108
+ }
109
+ catch (e) {
110
+ console.warn('[WORK] Автомиграция дерева пропущена:', e?.message || e);
111
+ }
112
+
102
113
  /**
103
114
  * Если предыдущий экземпляр `run.mjs` остался висеть в фоне и держит порт 8001 / STUN 3478,
104
115
  * аккуратно завершаем его перед стартом нового экземпляра.
@@ -95,7 +95,7 @@ async function runCase(c, imports) {
95
95
  const tmp = await fsp.mkdtemp(path.join(os.tmpdir(), 'work-eval-'));
96
96
  const prev = process.cwd();
97
97
  await copyTree(path.join(ROOT, '$server'), path.join(tmp, '$server'));
98
- await copyTree(path.join(ROOT, 'MODELS'), path.join(tmp, 'MODELS'));
98
+ await copyTree(path.join(ROOT, 'MODULES'), path.join(tmp, 'MODULES'));
99
99
  for (const [rel, content] of Object.entries(c.files || {}))
100
100
  write(tmp, rel, content);
101
101
  process.chdir(tmp);